feat(ai,agent,coding-agent): validate tool arguments with pi-schema, drop TypeBox

pi-schema: opt-in coercion, compile(schema, { coerce: true }) with coerce() and
parse(), the superset of TypeBox's Value.Convert rules and pi-ai's old coercion;
unresolvedRefs option; url and json-pointer-uri-fragment formats.
pi-ai: Tool takes any JSON Schema; validation through pi-schema; Type, Static
and TSchema are no longer exported (breaking). pi-agent-core and pi-durable:
tools on pi-schema, no TypeBox dependency. Coding agent: extensions keep Type,
Static, TSchema and StringEnum through an extension view of pi-ai; built-in
tools stay on TypeBox.
This commit is contained in:
Mario Zechner 2026-11-01 10:08:10 +00:00
parent 2c8d1feb14
commit 6536f80129
139 changed files with 5115 additions and 1305 deletions

View file

@ -255,13 +255,6 @@
"type": "array",
"items": {
"type": "object",
"required": [
"inputTokensAbove",
"input",
"output",
"cacheRead",
"cacheWrite"
],
"properties": {
"inputTokensAbove": {
"type": "number",
@ -283,7 +276,14 @@
"type": "number",
"description": "Cache-write cost in USD per million tokens."
}
}
},
"required": [
"inputTokensAbove",
"input",
"output",
"cacheRead",
"cacheWrite"
]
},
"description": "Request-wide pricing tiers. The highest matching input threshold applies to the full request."
}
@ -383,12 +383,6 @@
"$defs": {
"ModelCost": {
"type": "object",
"required": [
"input",
"output",
"cacheRead",
"cacheWrite"
],
"properties": {
"input": {
"type": "number",
@ -410,13 +404,6 @@
"type": "array",
"items": {
"type": "object",
"required": [
"inputTokensAbove",
"input",
"output",
"cacheRead",
"cacheWrite"
],
"properties": {
"inputTokensAbove": {
"type": "number",
@ -438,11 +425,24 @@
"type": "number",
"description": "Cache-write cost in USD per million tokens."
}
}
},
"required": [
"inputTokensAbove",
"input",
"output",
"cacheRead",
"cacheWrite"
]
},
"description": "Request-wide pricing tiers. The highest matching input threshold applies to the full request."
}
}
},
"required": [
"input",
"output",
"cacheRead",
"cacheWrite"
]
},
"ModelInputLimits": {
"type": "object",
@ -628,9 +628,6 @@
},
{
"type": "object",
"required": [
"$var"
],
"properties": {
"$var": {
"anyOf": [
@ -651,7 +648,10 @@
"omitWhenOff": {
"type": "boolean"
}
}
},
"required": [
"$var"
]
}
]
}
@ -677,9 +677,6 @@
},
{
"type": "object",
"required": [
"$var"
],
"properties": {
"$var": {
"anyOf": [
@ -700,7 +697,10 @@
"omitWhenOff": {
"type": "boolean"
}
}
},
"required": [
"$var"
]
}
]
}
@ -1085,11 +1085,6 @@
"type": "array",
"items": {
"type": "object",
"required": [
"provider",
"model",
"cost"
],
"properties": {
"provider": {
"type": "string",
@ -1103,6 +1098,11 @@
"$ref": "#/$defs/ModelCost"
}
},
"required": [
"provider",
"model",
"cost"
],
"description": "An Anthropic server-side refusal fallback model with local pricing metadata."
},
"maxItems": 3,