chore: adopt Pi 1.5 SDK baseline #13

Merged
eleith merged 1 commits from chore/pi-1.5-baseline into main 2026-11-05 15:44:04 +00:00
16 changed files with 114 additions and 62 deletions

No files matched your search

+6
View File
@@ -0,0 +1,6 @@
---
"@eleith-pi/web-fetch": patch
"@eleith-pi/web-search-codex": patch
---
Import tool schemas directly from Pi's host-provided TypeBox package and declare its peer dependency, keeping the extensions compatible with the Pi 1.5 SDK without relying on pi-ai's former TypeBox re-exports.
@@ -22,6 +22,8 @@ function context(overrides: Partial<Context> = {}): Context {
isError: false,
durationMs: undefined,
outputPad: 0,
keyText: () => "",
keyHint: (_key: string, description: string) => description,
...overrides,
};
}
@@ -45,6 +45,8 @@ function context(overrides: Partial<Context> = {}): Context {
isError: false,
durationMs: undefined,
outputPad: 0,
keyText: () => "",
keyHint: (_key: string, description: string) => description,
...overrides,
};
}
@@ -120,6 +120,8 @@ function context<A>(args: A, patch: Partial<Omit<ReadContext, "args">> = {}) {
isError: false,
durationMs: undefined,
outputPad: 0,
keyText: () => "",
keyHint: (_key: string, description: string) => description,
...patch,
};
}
@@ -97,6 +97,8 @@ function readCall(renderers: ToolRenderers | undefined): string {
isError: false,
durationMs: undefined,
outputPad: 0,
keyText: () => "",
keyHint: (_key: string, description: string) => description,
invalidate() {},
};
const component = renderers?.renderCall?.(args, theme, context);
+2 -1
View File
@@ -37,7 +37,8 @@
"peerDependencies": {
"@earendil-works/pi-ai": "*",
"@earendil-works/pi-coding-agent": "*",
"@earendil-works/pi-tui": "*"
"@earendil-works/pi-tui": "*",
"typebox": "*"
},
"engines": {
"node": ">=22.19.0"
@@ -28,6 +28,8 @@ const context = (): RenderContext => ({
isError: false,
durationMs: undefined,
outputPad: 0,
keyText: () => "",
keyHint: (_key: string, description: string) => description,
});
function content(url: string, text = "Small readable content"): ContentResult {
return {
+2
View File
@@ -29,6 +29,8 @@ function context(patch: Partial<RenderContext> = {}): RenderContext {
isError: false,
durationMs: undefined,
outputPad: 0,
keyText: () => "",
keyHint: (_key: string, description: string) => description,
...patch,
};
}
+1 -1
View File
@@ -1,4 +1,4 @@
import { Type } from "@earendil-works/pi-ai";
import { Type } from "typebox";
import { LIMITS } from "./core/limits.ts";
import { FORMATS, type FetchInput } from "./core/types.ts";
import { checkFetchInput } from "./core/input.ts";
+2 -1
View File
@@ -1,4 +1,5 @@
import { Type, validateToolArguments, type TSchema, type JsonValue } from "@earendil-works/pi-ai";
import { validateToolArguments, type JsonValue } from "@earendil-works/pi-ai";
import { Type, type TSchema } from "typebox";
import { beforeEach, expect, it, vi } from "vitest";
import type { BatchResult, ContentResult, FetchHooks, FetchResult } from "./core/types.ts";
import { batchOutputSchema, fetchOutputSchema } from "./schema.ts";
+2 -1
View File
@@ -32,7 +32,8 @@
"peerDependencies": {
"@earendil-works/pi-ai": "*",
"@earendil-works/pi-coding-agent": "*",
"@earendil-works/pi-tui": "*"
"@earendil-works/pi-tui": "*",
"typebox": "*"
},
"pi": {
"extensions": [
+1 -1
View File
@@ -1,4 +1,4 @@
import { Type } from "@earendil-works/pi-ai";
import { Type } from "typebox";
import { defineTool, type ExtensionAPI } from "@earendil-works/pi-coding-agent";
import { registerCommand } from "@eleith/pi-internal/commands";
import { getSettings } from "@eleith/pi-internal/config";
@@ -30,6 +30,8 @@ function context(patch: Partial<ToolRenderContext> = {}): ToolRenderContext {
isError: false,
durationMs: undefined,
outputPad: 0,
keyText: () => "",
keyHint: (_key: string, description: string) => description,
...patch,
};
}
+4 -3
View File
@@ -15,13 +15,14 @@
},
"devDependencies": {
"@changesets/cli": "3.0.3",
"@earendil-works/pi-ai": "^1.3.0",
"@earendil-works/pi-coding-agent": "^1.3.0",
"@earendil-works/pi-tui": "^1.3.0",
"@earendil-works/pi-ai": "^1.5.0",
"@earendil-works/pi-coding-agent": "^1.5.0",
"@earendil-works/pi-tui": "^1.5.0",
"@types/node": "22.19.19",
"esbuild": "0.28.2",
"oxfmt": "0.71.0",
"oxlint": "1.86.0",
"typebox": "1.3.27",
"typescript": "5.9.3",
"vitest": "4.1.11"
},
+74 -47
View File
@@ -12,14 +12,14 @@ importers:
specifier: 3.0.3
version: 3.0.3
'@earendil-works/pi-ai':
specifier: ^1.3.0
version: 1.3.0(@aws-sdk/credential-provider-node@3.972.84)(@smithy/signature-v4@5.7.4)(undici@8.10.2)(ws@8.22.0)
specifier: ^1.5.0
version: 1.5.0(@aws-sdk/credential-provider-node@3.972.84)(@smithy/signature-v4@5.7.4)(undici@8.12.3)(ws@8.22.0)
'@earendil-works/pi-coding-agent':
specifier: ^1.3.0
version: 1.3.0(@aws-sdk/credential-provider-node@3.972.84)(@smithy/signature-v4@5.7.4)(ws@8.22.0)
specifier: ^1.5.0
version: 1.5.0(@aws-sdk/credential-provider-node@3.972.84)(@smithy/signature-v4@5.7.4)(ws@8.22.0)
'@earendil-works/pi-tui':
specifier: ^1.3.0
version: 1.3.0
specifier: ^1.5.0
version: 1.5.0
'@types/node':
specifier: 22.19.19
version: 22.19.19
@@ -32,6 +32,9 @@ importers:
oxlint:
specifier: 1.86.0
version: 1.86.0
typebox:
specifier: 1.3.27
version: 1.3.27
typescript:
specifier: 5.9.3
version: 5.9.3
@@ -269,34 +272,38 @@ packages:
resolution: {integrity: sha512-dlT1m5e/0yUL0kRNcQn7yGLVThkgbB0Ga/1AmfDDC/8ik6AIiSf2QLQO2zPYvefsHP0aFgxO93cVLCCfDp7kzQ==}
engines: {node: '>= 20.12.0'}
'@earendil-works/pi-agent-core@1.3.0':
resolution: {integrity: sha512-2jvpxZs47PFD5mSQb/yK0pGHJ5yO7Nu22u9mFjHbSLRgu62vZ9rupimDSIp4arnqOadyv0AWvYHtCSpFoJV7ag==}
'@earendil-works/pi-agent-core@1.5.0':
resolution: {integrity: sha512-FOj+jXj48DbzMycR/ghNa2KcsqWmvOln24e0FnQOVgnd8vn5H79g335WdHaZUVdRo+zCeogb40/qPPlCWFuvmA==}
engines: {node: '>=22.19.0'}
'@earendil-works/pi-ai@1.3.0':
resolution: {integrity: sha512-KaBI8x7q7sPoFUXICNGD9efHzDG+oRNwVvkA9jdIsSQWH1RjFssOlEGsbLtewUPPgCrvmz0l2KTgSLXTyj3acw==}
'@earendil-works/pi-ai@1.5.0':
resolution: {integrity: sha512-VeWxNqTHSqRCf8AcY/6kvNwh+neRL6MPxZPePVztIQy6qqK9MR/YoCSN/ZgDnIyCD3pqEXgRyQbzk4KV4uvjbg==}
engines: {node: '>=22.19.0'}
hasBin: true
'@earendil-works/pi-codemode@1.3.0':
resolution: {integrity: sha512-2G9tmbsPhgzwfz7cmzJpbLSLqOx3eu22Gbzm+Wc3HqeZMjLQS4F3KfAabozVhv7uEjq3k2O1dZTHmhhWr2xbfQ==}
'@earendil-works/pi-codemode@1.5.0':
resolution: {integrity: sha512-PLBJZ17AEWGzOlAAcFuOkw3PxkOti0JlFuZQyeF2GRTqbpuYo4k9t8YqUV2uOQVzrUnKdxahwaFUqc1eNS1WAg==}
engines: {node: '>=22.19.0'}
'@earendil-works/pi-coding-agent@1.3.0':
resolution: {integrity: sha512-V/WoCjA2hQSe3QLWIUB24cTRdtEdeLiIzkDqU5RMXV6VWuD+KGZnzVBMhglwdnQTySkehZsjt8a3g6Jd2g4nnw==}
'@earendil-works/pi-coding-agent@1.5.0':
resolution: {integrity: sha512-xNDZ5kqowO6Z03FS2gwAkPEGk1ssxVcYKQ6qZId84mFEvwACvvyc2l0vAMOS+c5zvxLRMLBE9r4y44IGYkMJaQ==}
engines: {node: '>=22.19.0'}
hasBin: true
'@earendil-works/pi-mcp@1.3.0':
resolution: {integrity: sha512-lbktLplmdGamM2t460Q0ziNEfpUEHDTVNf79g/AialJ3XZ+SHgNqa/OJXRR+fU+GV/l+gBhRPcyP8XkQlv8Avw==}
'@earendil-works/pi-mcp@1.5.0':
resolution: {integrity: sha512-DURw3IwHCTMHV8CzUJWVp9css27NowsCWfXt4xg2r09IZ+P1O/Uq58hp0hb9WJO0dbkaKGXKBIkV4LVXcu2nlg==}
engines: {node: '>=22.19.0'}
'@earendil-works/pi-telemetry@1.3.0':
resolution: {integrity: sha512-ERGZr+aXjNJzoUbB7ZzHVH3g5otzMHjHLs2Fyizm12By5X+gBEhod9cJXFOk13S7M8a29Am+Mq21zm73mRJFLg==}
'@earendil-works/pi-schema@1.5.0':
resolution: {integrity: sha512-RW0MbT2tR65OY6xMsgB/yVBb7m/RTNwA+9hurSN1vVXfHZRVmVnXbruBPrx/PzbrQnW5yLVlMRWxErGDQtF1Hg==}
engines: {node: '>=22.19.0'}
'@earendil-works/pi-tui@1.3.0':
resolution: {integrity: sha512-AlKvEwEWyVtnuw7SVb4N/mUhlfIohyFslUNWarZVdLHHSdt3ca5EhMLwTzblBpDpaofSz+f+tAHie6CfxVrWKA==}
'@earendil-works/pi-telemetry@1.5.0':
resolution: {integrity: sha512-VW3tcVdnNfl/Vk8wHPTzZdKkxcsCOM12ppiO4DXnd9wMxUCmOfLt/wvUnWeKWbTVlVSRg0uqKtnnhE2UCsG2Bw==}
engines: {node: '>=22.19.0'}
'@earendil-works/pi-tui@1.5.0':
resolution: {integrity: sha512-56KqrDVeLF18k+syppVbT35Ai1opbM44ot+sL7O3K40CaWwXCiwOpqEFugDBAILtAhseZh6uYIuYxPPOJHLFAA==}
engines: {node: '>=22.19.0'}
'@esbuild/aix-ppc64@0.28.2':
@@ -464,6 +471,9 @@ packages:
'@modelcontextprotocol/sdk':
optional: true
'@isaacs/nonrecursive-glob-match@1.0.3':
resolution: {integrity: sha512-SI7kyKHq4XXDRozw+r9GlRZkia1ZkFrpLW98r2IC2Bpr8YkFGE3fvjzmxCG0x78A++69HmDNrDvSMYBZmHGpKA==}
'@jridgewell/sourcemap-codec@1.6.0':
resolution: {integrity: sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==}
@@ -865,6 +875,7 @@ packages:
'@smithy/core@3.35.1':
resolution: {integrity: sha512-i4YPS4B6ts7bjn7UwLnGjiZdprOvHvgGobFZsYK3GIY3E5hIqtj0rReU69BcTpGp+fvtraSNXeG1l+jtJvF55w==}
engines: {node: '>=18.0.0'}
deprecated: Deprecated due to a bug in custom logger data redaction. See https://github.com/aws/aws-sdk-js-v3/issues/8393.
'@smithy/credential-provider-imds@4.5.2':
resolution: {integrity: sha512-A9uSdn72ozbRUSit0eib0TW7nXuNPlaeM0zcGkJ+nE6tFcSDbnmtwoxbTCFBukVQcszDAyvsd7+rTduPTXpygg==}
@@ -1374,6 +1385,12 @@ packages:
magic-string@0.30.21:
resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==}
marked-cjk-friendly@0.1.2:
resolution: {integrity: sha512-GUj8HjiEbur9yhgUo52FBgKizggF1QtT6gVdrYdWW6ZB4lVVjgS3EyyXPyfyRD0V4ghGRPlO7MO80rgSWbm0eA==}
engines: {node: '>=18'}
peerDependencies:
marked: '>=15.0.0'
marked@18.0.11:
resolution: {integrity: sha512-HnslJfsZkRPBDJRHvVtAaWlZHEpSu7u8LgQuJCELjRKuWR+hpq4A7sLq3p8HaI9ypVoXDXxV34CsQJEe1+J5Aw==}
engines: {node: '>= 20'}
@@ -1382,8 +1399,8 @@ packages:
mathml-to-latex@1.8.0:
resolution: {integrity: sha512-gQ0uK3zqB8HwlfaXJkEL5rgaZNbKUiBMmBP/B/W+b+t6KcseLSuYb1b0BjLgS9ZiQa24ePkqTX8/6FaQuDL7wQ==}
minimatch@10.2.6:
resolution: {integrity: sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==}
minimatch@11.0.3:
resolution: {integrity: sha512-iny/40PEGkNJQ5/Pv6z3nm6FbRAby32GeZRjCUJk2WnNDbgPSTcdI+DDvLqsgBdD4cD5sMtMheqPPnehCCa8Nw==}
engines: {node: 18 || 20 || >=22}
ms@2.1.3:
@@ -1610,8 +1627,8 @@ packages:
undici-types@6.21.0:
resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==}
undici@8.10.2:
resolution: {integrity: sha512-/y4/bH9YNU5hi9NIrpOuvGXFcxrj3CMrV+/AYpowAYTpHn8gX/XPFjNy766FPoYY0miQhdW977JFWKGNhBdwyQ==}
undici@8.12.3:
resolution: {integrity: sha512-+fdndUTwBP86cVjihTp21hZHo7d6oj1c/47XPA3lL8mM0XHs+C4EkcjmgRsFnFk2f/UONGDy9ItBItmXsLOQHw==}
engines: {node: '>=22.19.0'}
vite@8.3.2:
@@ -2044,10 +2061,10 @@ snapshots:
fast-wrap-ansi: 0.2.2
sisteransi: 1.0.5
'@earendil-works/pi-agent-core@1.3.0(@aws-sdk/credential-provider-node@3.972.84)(@smithy/signature-v4@5.7.4)(undici@8.10.2)(ws@8.22.0)':
'@earendil-works/pi-agent-core@1.5.0(@aws-sdk/credential-provider-node@3.972.84)(@smithy/signature-v4@5.7.4)(undici@8.12.3)(ws@8.22.0)':
dependencies:
'@earendil-works/pi-ai': 1.3.0(@aws-sdk/credential-provider-node@3.972.84)(@smithy/signature-v4@5.7.4)(undici@8.10.2)(ws@8.22.0)
typebox: 1.3.27
'@earendil-works/pi-ai': 1.5.0(@aws-sdk/credential-provider-node@3.972.84)(@smithy/signature-v4@5.7.4)(undici@8.12.3)(ws@8.22.0)
'@earendil-works/pi-schema': 1.5.0
transitivePeerDependencies:
- '@aws-sdk/credential-provider-node'
- '@modelcontextprotocol/sdk'
@@ -2061,18 +2078,18 @@ snapshots:
- ws
- zod
'@earendil-works/pi-ai@1.3.0(@aws-sdk/credential-provider-node@3.972.84)(@smithy/signature-v4@5.7.4)(undici@8.10.2)(ws@8.22.0)':
'@earendil-works/pi-ai@1.5.0(@aws-sdk/credential-provider-node@3.972.84)(@smithy/signature-v4@5.7.4)(undici@8.12.3)(ws@8.22.0)':
dependencies:
'@anthropic-ai/sdk': 0.129.0
'@aws-sdk/client-bedrock-runtime': 3.1127.0
'@earendil-works/pi-telemetry': 1.3.0
'@earendil-works/pi-schema': 1.5.0
'@earendil-works/pi-telemetry': 1.5.0
'@google/genai': 2.21.0
'@smithy/node-http-handler': 4.12.1
http-proxy-agent: 9.1.0
https-proxy-agent: 9.1.0
openai: 7.19.0(@aws-sdk/credential-provider-node@3.972.84)(@smithy/signature-v4@5.7.4)(undici@8.10.2)(ws@8.22.0)
openai: 7.19.0(@aws-sdk/credential-provider-node@3.972.84)(@smithy/signature-v4@5.7.4)(undici@8.12.3)(ws@8.22.0)
partial-json: 0.1.7
typebox: 1.3.27
transitivePeerDependencies:
- '@aws-sdk/credential-provider-node'
- '@modelcontextprotocol/sdk'
@@ -2086,17 +2103,17 @@ snapshots:
- ws
- zod
'@earendil-works/pi-codemode@1.3.0':
'@earendil-works/pi-codemode@1.5.0':
dependencies:
quickjs-wasi: 3.6.2
'@earendil-works/pi-coding-agent@1.3.0(@aws-sdk/credential-provider-node@3.972.84)(@smithy/signature-v4@5.7.4)(ws@8.22.0)':
'@earendil-works/pi-coding-agent@1.5.0(@aws-sdk/credential-provider-node@3.972.84)(@smithy/signature-v4@5.7.4)(ws@8.22.0)':
dependencies:
'@earendil-works/pi-agent-core': 1.3.0(@aws-sdk/credential-provider-node@3.972.84)(@smithy/signature-v4@5.7.4)(undici@8.10.2)(ws@8.22.0)
'@earendil-works/pi-ai': 1.3.0(@aws-sdk/credential-provider-node@3.972.84)(@smithy/signature-v4@5.7.4)(undici@8.10.2)(ws@8.22.0)
'@earendil-works/pi-codemode': 1.3.0
'@earendil-works/pi-mcp': 1.3.0
'@earendil-works/pi-tui': 1.3.0
'@earendil-works/pi-agent-core': 1.5.0(@aws-sdk/credential-provider-node@3.972.84)(@smithy/signature-v4@5.7.4)(undici@8.12.3)(ws@8.22.0)
'@earendil-works/pi-ai': 1.5.0(@aws-sdk/credential-provider-node@3.972.84)(@smithy/signature-v4@5.7.4)(undici@8.12.3)(ws@8.22.0)
'@earendil-works/pi-codemode': 1.5.0
'@earendil-works/pi-mcp': 1.5.0
'@earendil-works/pi-tui': 1.5.0
'@silvia-odwyer/photon-node': 0.3.4
brace-expansion: 5.0.12
chalk: 6.0.0
@@ -2107,12 +2124,12 @@ snapshots:
hosted-git-info: 9.0.3
ignore: 7.0.8
jiti: 2.7.0
minimatch: 10.2.6
minimatch: 11.0.3
proper-lockfile: 4.1.2
quickjs-wasi: 3.6.2
semver: 7.8.5
typebox: 1.3.27
undici: 8.10.2
undici: 8.12.3
yaml: 2.9.0
transitivePeerDependencies:
- '@aws-sdk/credential-provider-node'
@@ -2126,16 +2143,19 @@ snapshots:
- ws
- zod
'@earendil-works/pi-mcp@1.3.0':
'@earendil-works/pi-mcp@1.5.0':
dependencies:
cross-spawn: 7.0.6
'@earendil-works/pi-telemetry@1.3.0': {}
'@earendil-works/pi-schema@1.5.0': {}
'@earendil-works/pi-tui@1.3.0':
'@earendil-works/pi-telemetry@1.5.0': {}
'@earendil-works/pi-tui@1.5.0':
dependencies:
get-east-asian-width: 1.6.0
marked: 18.0.11
marked-cjk-friendly: 0.1.2(marked@18.0.11)
'@esbuild/aix-ppc64@0.28.2':
optional: true
@@ -2226,6 +2246,8 @@ snapshots:
- supports-color
- utf-8-validate
'@isaacs/nonrecursive-glob-match@1.0.3': {}
'@jridgewell/sourcemap-codec@1.6.0': {}
'@manypkg/find-root@3.1.0':
@@ -2918,14 +2940,19 @@ snapshots:
dependencies:
'@jridgewell/sourcemap-codec': 1.6.0
marked-cjk-friendly@0.1.2(marked@18.0.11):
dependencies:
marked: 18.0.11
marked@18.0.11: {}
mathml-to-latex@1.8.0:
dependencies:
'@xmldom/xmldom': 0.9.12
minimatch@10.2.6:
minimatch@11.0.3:
dependencies:
'@isaacs/nonrecursive-glob-match': 1.0.3
brace-expansion: 5.0.12
ms@2.1.3: {}
@@ -2946,11 +2973,11 @@ snapshots:
obug@2.2.1: {}
openai@7.19.0(@aws-sdk/credential-provider-node@3.972.84)(@smithy/signature-v4@5.7.4)(undici@8.10.2)(ws@8.22.0):
openai@7.19.0(@aws-sdk/credential-provider-node@3.972.84)(@smithy/signature-v4@5.7.4)(undici@8.12.3)(ws@8.22.0):
optionalDependencies:
'@aws-sdk/credential-provider-node': 3.972.84
'@smithy/signature-v4': 5.7.4
undici: 8.10.2
undici: 8.12.3
ws: 8.22.0
oxfmt@0.71.0:
@@ -3133,7 +3160,7 @@ snapshots:
undici-types@6.21.0: {}
undici@8.10.2: {}
undici@8.12.3: {}
vite@8.3.2(@types/node@22.19.19)(esbuild@0.28.2)(jiti@2.7.0)(yaml@2.9.1):
dependencies:
+8 -7
View File
@@ -8,10 +8,11 @@ allowBuilds:
esbuild: true
protobufjs: false
minimumReleaseAgeExclude:
- "@earendil-works/pi-agent-core@1.3.0"
- "@earendil-works/pi-ai@1.3.0"
- "@earendil-works/pi-codemode@1.3.0"
- "@earendil-works/pi-coding-agent@1.3.0"
- "@earendil-works/pi-mcp@1.3.0"
- "@earendil-works/pi-telemetry@1.3.0"
- "@earendil-works/pi-tui@1.3.0"
- "@earendil-works/pi-agent-core@1.5.0"
- "@earendil-works/pi-ai@1.5.0"
- "@earendil-works/pi-codemode@1.5.0"
- "@earendil-works/pi-coding-agent@1.5.0"
- "@earendil-works/pi-mcp@1.5.0"
- "@earendil-works/pi-schema@1.5.0"
- "@earendil-works/pi-telemetry@1.5.0"
- "@earendil-works/pi-tui@1.5.0"