You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tools/pi-ai: typed parameter schemas so pi-durable can type tool args #194
pi-durable 1.0 types a tool's execute(args) as Static<TParameters>, inferred from parameters. With PiJSONSchema that comes out as {}, so every Workspace tool registered on pi gets untyped arguments. The schema is fine at runtime (pi validates plain JSON Schema with TypeBox); only the static type is lost.
Seen in the agents pi harness example, examples/next/harnesses/pi/src/workspace.ts on cloudflare/agents#2451:
Declare each tool's schema as its exact literal type (satisfies, not widened to PiJSONSchema), and type tools as a tuple or a record keyed by name so each tool keeps its own schema type.
Build the pi-ai schemas with TypeBox (Type from @earendil-works/pi-ai, or typebox as an optional peer). Static then infers the args.
Also export a per-tool execute(args, context) for each declaration, so a pi-durable host doesn't have to route by name through the single execute(call).
Triage summary: createPiTools in the pi-ai tools package types every tool's parameters as the wide PiJSONSchema, so pi-durable's Static<TParameters> infers {} and execute(args) loses typing. The issue proposes literal schema types, TypeBox-built schemas, or per-tool execute exports. No similar open issues found. This is not a commitment to a fix.
Activity
github-actions commentedon Oct 2, 2026
Triage summary:
createPiToolsin the pi-ai tools package types every tool'sparametersas the widePiJSONSchema, so pi-durable'sStatic<TParameters>infers{}andexecute(args)loses typing. The issue proposes literal schema types, TypeBox-built schemas, or per-toolexecuteexports. No similar open issues found. This is not a commitment to a fix.