Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins
TypeScript ai-agentcoding-agentdesktop-appelectronglobali18nlocal-firstmcppipi-agentpi-desktoppluginsreactrusttypescript
fix(runtime): complete Pi 1.0.0 migration
vastsa246c100bfe3e
diff --git a/apps/desktop/electron/main/pi-model-metadata.ts b/apps/desktop/electron/main/pi-model-metadata.tsindex 2540bb45c..b07164373 100644--- a/apps/desktop/electron/main/pi-model-metadata.ts+++ b/apps/desktop/electron/main/pi-model-metadata.ts@@ -67,7 +67,7 @@ export function relayChatMetadata(models: Models, id: string): Model<Api> | unde/*** Display-only compatibility data for speech/embedding/image settings rows that- * Pi 0.99.1 does not publish. It has no auth, prices, refresh, routing or dispatch.+ * Pi 1.0.0 does not publish. It has no auth, prices, refresh, routing or dispatch.* Chat selection and typed Pi operation lookups never consult this data.*/export function settingsOperationMetadata(providerId: string, vendor?: string, id?: string): ModelInfo[] {diff --git a/apps/desktop/package.json b/apps/desktop/package.jsonindex 0d40bc3f5..07adcb08a 100644--- a/apps/desktop/package.json+++ b/apps/desktop/package.json@@ -36,8 +36,8 @@"electron-updater": "^6.8.9"},"devDependencies": {- "@earendil-works/pi-ai": "0.99.1",- "@earendil-works/pi-mcp": "0.99.1",+ "@earendil-works/pi-ai": "1.0.0",+ "@earendil-works/pi-mcp": "1.0.0","@pi-desktop/agent-host": "workspace:*","@pi-desktop/agent-runtime": "workspace:*","@pi-desktop/host-runtime": "workspace:*",@@ -135,6 +135,10 @@{"from": "resources/plugins","to": "plugins"+ },+ {+ "from": "resources/models.dev",+ "to": "models.dev"}],"mac": {diff --git a/apps/desktop/test/anthropic-oauth-retry.test.mjs b/apps/desktop/test/anthropic-oauth-retry.test.mjsindex b16c3eba0..c6eaab700 100644--- a/apps/desktop/test/anthropic-oauth-retry.test.mjs+++ b/apps/desktop/test/anthropic-oauth-retry.test.mjs@@ -69,8 +69,15 @@ async function fixture(outcomes, run) {const events = [];const oauth = new VendorOAuth({ call: host.call, openExternal: async () => {}, emit: event => {events.push(event);- if (event.kind === "prompt") oauth.respond({ loginId: event.loginId,- promptId: event.request.promptId, value: "fixture-authorization-code" });+ if (event.kind === "prompt") {+ const value = event.request.type === "select"+ ? "copy_code"+ : event.request.type === "manual_code"+ ? `fixture-authorization-code#${new URL(events.find(candidate =>+ candidate.kind === "authUrl" && candidate.loginId === event.loginId).url).searchParams.get("state")}`+ : undefined;+ oauth.respond({ loginId: event.loginId, promptId: event.request.promptId, value });+ }} });const signIn = async () => {await oauth.start("anthropic");diff --git a/apps/desktop/test/e2e/trusted-extensions/drive.mjs b/apps/desktop/test/e2e/trusted-extensions/drive.mjsindex 2ceab02d4..1d60a5f10 100644--- a/apps/desktop/test/e2e/trusted-extensions/drive.mjs+++ b/apps/desktop/test/e2e/trusted-extensions/drive.mjs@@ -75,7 +75,7 @@ let detail = await tool("pi_session_get", { id: sessionId });let messages = detail?.session?.messages ?? [];const toolRow = messages.find((m) => m.role === "tool" && m.toolName === "fx_add");const assistant = [...messages].reverse().find((m) => m.role === "assistant");-check("fx_add tool executed", !!toolRow, JSON.stringify(toolRow?.content ?? toolRow).slice(0, 120));+check("fx_add tool executed", !!toolRow, (JSON.stringify(toolRow?.content ?? toolRow) ?? "undefined").slice(0, 120));check("tool_result replacement reached the model", /42 \(replaced\)/.test(assistant?.content ?? ""), assistant?.content);const requests = readFileSync(join(root, "requests.jsonl"), "utf8").trim().split("\n").map((l) => JSON.parse(l));diff --git a/apps/desktop/test/packaging-footprint.test.mjs b/apps/desktop/test/packaging-footprint.test.mjsindex a776dde60..23397c48e 100644--- a/apps/desktop/test/packaging-footprint.test.mjs+++ b/apps/desktop/test/packaging-footprint.test.mjs@@ -209,6 +209,10 @@ test("packaging keeps only shipped locales and excludes non-runtime artifacts",from: "resources/plugins",to: "plugins",},+ {+ from: "resources/models.dev",+ to: "models.dev",+ },]);assert.doesNotMatch(JSON.stringify(packageJson.build), /node-pty/);});diff --git a/apps/desktop/test/vendor-oauth-login.test.mjs b/apps/desktop/test/vendor-oauth-login.test.mjsindex 760d846aa..2a67ec5a1 100644--- a/apps/desktop/test/vendor-oauth-login.test.mjs+++ b/apps/desktop/test/vendor-oauth-login.test.mjs@@ -11,6 +11,9 @@ import {buildProviderModel,createProviderModels,} from "../../../packages/agent-runtime/dist/provider-binding.js";+import { InMemoryModelsStore } from "@earendil-works/pi-ai";+import { registerBunOAuthFlows } from "@earendil-works/pi-ai/bun-oauth";+import { builtinModels } from "@earendil-works/pi-ai/providers/all";import {VendorOAuth,@@ -183,7 +186,7 @@ function harness(options = {}) {},createModels: (store) => {stores.push(store);- return fakeModels(store, options);+ return options.createModels ? options.createModels(store) : fakeModels(store, options);},modelConfigFor: options.modelConfigFor,onAccountModels: options.onAccountModels,@@ -215,6 +218,15 @@ async function waitFor(events, kind, maxAttempts = 200) {throw new Error(`no ${kind} event; saw ${events.map((e) => e.kind).join(", ")}`);}+async function waitForPromptType(events, type, maxAttempts = 200) {+ for (let attempt = 0; attempt < maxAttempts; attempt++) {+ const found = events.find((event) => event.kind === "prompt" && event.request.type === type);+ if (found) return found;+ await new Promise((resolve) => setTimeout(resolve, 5));+ }+ throw new Error(`no ${type} prompt; saw ${events.filter((e) => e.kind === "prompt").map((e) => e.request.type).join(", ")}`);+}+test("wire apis map to the provider row's api style and protocol", () => {assert.equal(apiStyleForWireApi("openai-codex-responses"), "openai_codex_responses");assert.equal(apiStyleForWireApi("pi-messages"), "pi_messages");@@ -296,6 +308,69 @@ test("a completed login stores the credential and configures the row", async ()]);});+test("the pi-ai 1.0 Anthropic copy-code flow uses the select and manual-code bridge", async () => {+ const requests = [];+ const previousFetch = globalThis.fetch;+ globalThis.fetch = async (input, init = {}) => {+ const url = String(input);+ requests.push({ url, init });+ assert.equal(url, "https://platform.claude.com/v1/oauth/token");+ return new Response(JSON.stringify({+ access_token: "fixture-access-token",+ refresh_token: "fixture-refresh-token",+ expires_in: 3600,+ }), { status: 200, headers: { "content-type": "application/json" } });+ };++ let registered = false;+ const { host, events, opened, oauth } = harness({+ createModels: (credentials) => {+ if (!registered) {+ registerBunOAuthFlows();+ registered = true;+ }+ return builtinModels({+ credentials,+ authContext: { env: async () => undefined, fileExists: async () => false },+ modelsStore: new InMemoryModelsStore(),+ });+ },+ });++ try {+ const { loginId } = await oauth.start("anthropic");+ const selection = await waitForPromptType(events, "select");+ assert.deepEqual(selection.request.options.map(({ id }) => id), ["browser", "copy_code"]);+ assert.equal(oauth.respond({ loginId, promptId: selection.request.promptId, value: "copy_code" }), true);++ const authUrl = await waitFor(events, "authUrl");+ assert.deepEqual(opened, [authUrl.url]);+ const redirect = new URL(authUrl.url).searchParams.get("redirect_uri");+ assert.equal(redirect, "https://platform.claude.com/oauth/code/callback");++ const manualCode = await waitForPromptType(events, "manual_code");+ const state = new URL(authUrl.url).searchParams.get("state");+ assert.ok(state);+ assert.equal(oauth.respond({+ loginId,+ promptId: manualCode.request.promptId,+ value: `fixture-auth-code#${state}`,+ }), true);++ const done = await waitFor(events, "done");+ const row = host.providers.get(done.providerId);+ const stored = JSON.parse(host.secrets.get(secretRefForProviderOauth(row.id)));+ assert.equal(stored.refresh, "fixture-refresh-token");+ assert.equal(stored.access, "fixture-access-token");+ assert.equal(host.secrets.has(`secret:provider:${row.id}:api_key`), false);+ assert.deepEqual(await oauth.resolveAuth(row.id), { apiKey: "fixture-access-token" });+ assert.equal(requests.length, 1);+ assert.equal(JSON.parse(requests[0].init.body).grant_type, "authorization_code");+ } finally {+ globalThis.fetch = previousFetch;+ }+});+test("OAuth model configuration comes from the supplied models.dev snapshot", async () => {const modelConfigFor = async ({ option }) => ({source: "models.dev",diff --git a/docs/project/pi-1000-adoption.md b/docs/project/pi-1000-adoption.mdnew file mode 100644index 000000000..f0ec6d654--- /dev/null+++ b/docs/project/pi-1000-adoption.md@@ -0,0 +1,79 @@+# Pi 1.0.0 adoption++Status: implemented on the `upgrade/pi-1.0.0` task candidate based on+`afe0fe4b0b52e21df1506f7ab46271a1754c643e`. The candidate is not committed,+published, or release-qualified. See the [qualification report](pi-1000-qualification.md)+for executed checks and remaining release gates.++## Scope and ownership++The migration pins all direct Pi dependencies used by Agent Runtime and+Electron Main to `1.0.0`, ports the required Desktop patches, and updates the+removed public type import. It does not adopt `pi-durable`, Codemode, a new+session owner, or a new MCP implementation. Host-core remains the only SQLite+owner; Desktop continues to own credentials, provider rows, permissions, the+Plugin SDK contract, and MCP lifecycle. The trusted-extension shim remains a+documented compatibility subset.++| Workspace entry | Direct dependencies |+| --- | --- |+| `packages/agent-runtime` | `@earendil-works/pi-agent-core`, `@earendil-works/pi-ai`, `@earendil-works/pi-coding-agent` |+| `apps/desktop` | `@earendil-works/pi-ai`, `@earendil-works/pi-mcp` |++All five direct pins are exact `1.0.0` versions. The pnpm lockfile records the+published package integrity values and the three patch hashes. Pi's obsolete+release-age exceptions were removed. `check:pi-dependencies` verifies the+manifest pins and installed patched instances; `check:pi-patches` verifies the+workspace mappings, lockfile patch IDs, and representative JavaScript and+declaration contracts.++The remaining type import in `agent-messages.ts` now sources `JsonValue` from+`pi-ai`, where it is exported in 1.0.0. Readonly top-level arrays are rejected+at the existing JSON-object boundary instead of being cast through the type+system. No removed Harness or session API was reintroduced.++## Compatibility behavior retained++- Pi Models remains the provider transport/auth boundary, while models.dev+ remains the source for published chat-model metadata and Host remains the+ source for account entitlement and explicit binding overrides.+- Hosted-search request, event, replay, estimation, error, persistence, and+ compaction behavior remains covered by the rebased patches and tests.+- Anthropic token requests retain bounded explicit-429 retry, deadline,+ cancellation, credential-lock, and response-redaction behavior. Pi 1.0.0's+ browser/copy-code login is connected to the existing Desktop UI bridge.+- Image generations and edits keep the existing account-scoped Pi operation,+ cancellation, ordering, artifact, and physical-usage behavior. No automatic+ retry was added for billable image requests.+- Native Pi JSONL continuation and its file lease remain on the existing+ `pi-coding-agent` path. The extension shim's legacy `VERSION` marker remains+ `0.87.1` by design; it describes the modeled extension kernel surface, not+ the installed Pi package version. Unsupported static named exports now stay+ unavailable and produce an `unsupported_api` diagnostic through the Jiti+ loader, rather than appearing silently absent.+- The packaged app now includes the models.dev snapshot at `models.dev`, which+ the app's startup catalog loader requires. A packaged-app boot probe exposed+ the missing resource; the packaging map and footprint assertion now cover it.++No database schema, Host RPC, Plugin SDK, or persisted session format changed.+The normal rollback unit is the complete dependency/patch/adapter/build set,+not an individual Pi package. The required baseline → 1.0.0 → previous-app+round trip over copied user data was not executed; see `ROLLBACK-01` below.++## Published package and patch identity++The lockfile SRI values identify the upstream npm archives; SHA-256 values+identify the exact repository patches. A frozen install and installed-instance+checks passed in the task worktree.++| Package | Version | Lockfile integrity | Patch SHA-256 |+| --- | --- | --- | --- |+| `@earendil-works/pi-agent-core` | `1.0.0` | `sha512-bHFONjtEBDqiV+g1DmmtkSlfAaqHELr+XO+6I5Nah4gswwZrLJO4yZB/JjsnlI4AKWTayBLfgS6DCbeBBz9e2Q==` | `02de513ae53cf7f1e92d0cfc7fce07cf880d31195f5ec621d2f2197ead92a9da` |+| `@earendil-works/pi-ai` | `1.0.0` | `sha512-3/W1vdDaVtpeMd23ElvJC12HLA5yS/BGqqcXF+0SK082dN7cbgNcCwguTBRBC258Ke8SzSvUW1B75iAf8w8IxA==` | `7b666ab69d8e8a12a7d02550e98a3a0020f38d7046da6dc82b237adf176475e3` |+| `@earendil-works/pi-coding-agent` | `1.0.0` | `sha512-/FtbxoSQU/mEv1QnichJjRjqteqaIaMWxmhB4G367+MwZfX7/DI5B9YAg5lqbN7nztFskBEtUSZ+FlmMBECtMw==` | `2d46470684b572b37bba57cf3cec31d81cf7747be163812b74563c8be8a95da3` |+| `@earendil-works/pi-mcp` | `1.0.0` | `sha512-rYra0aF5iPmJd+fsB+VBuqxWNABGJ3Iiyhg0CqIc/91ta2n7IvQmCp0Cac/YkUTNnvRsVZnjgAiBkRi6+ouWuw==` | — |++Patch behavior and upstream equivalence decisions are recorded in the+[patch audit](pi-1000-patch-audit.md). The active dependency boundary and+runtime specifications now describe the 1.0.0 pin; historical 0.99.1 ADRs and+validation records remain historical.diff --git a/docs/project/pi-1000-patch-audit.md b/docs/project/pi-1000-patch-audit.mdnew file mode 100644index 000000000..c41e48168--- /dev/null+++ b/docs/project/pi-1000-patch-audit.md@@ -0,0 +1,69 @@+# Pi 1.0.0 patch audit++The three patches were rebuilt against the `1.0.0` npm package contents+resolved by the frozen lockfile. `pnpm install --frozen-lockfile`,+`check:pi-dependencies`, and `check:pi-patches` passed. The checks verify the+installed patched package identities and reviewed API/declaration markers;+the migration qualification tests exercise the behavior at runtime. No+upstream `package-lock.json` is modified by the patches.++## `pi-agent-core`++Patch: `patches/@[email protected]`<br>+SHA-256: `02de513ae53cf7f1e92d0cfc7fce07cf880d31195f5ec621d2f2197ead92a9da`++- Forwards Pi AI's `hosted_search_update` progress event through the agent loop+ so Desktop can render provider-side search rounds before the final response.+- Preserves the typed local-request failure details from `pi-ai` in the agent's+ final error message, without marking aborted turns as local-request failures.+- Regression coverage: Hosted Search E2E, the runtime hosted-search tests, and+ the agent-core local error projection tests in the workspace suite.++## `pi-ai`++Patch: `patches/@[email protected]`<br>+SHA-256: `7b666ab69d8e8a12a7d02550e98a3a0020f38d7046da6dc82b237adf176475e3`++- Restores Desktop's hosted-search message block, provider request opt-in,+ streamed progress events, target-API replay projection, validation, and+ model-aware estimates. Malformed replay data remains a local validation+ failure and is not sent to a provider.+- Adds local request preparation/stream error details so validation,+ serialization, and estimation failures remain distinguishable from HTTP+ errors and do not trigger provider retry or model fallback. Messages remain+ bounded and do not expose raw response bodies or credentials.+- Retains the Desktop Anthropic token-request policy: only explicit HTTP 429 is+ retried, with a bounded attempt count, caller cancellation, a shared deadline,+ preserved refresh locking, and safe recovery text.+- Reapplies required declarations for public hosted-search frames, estimators,+ and local-request errors alongside their runtime exports.+- Does not reapply the older terminal-event patch hunk. Pi 1.0.0 already owns+ the relevant `response.completed` terminal handling; the current patch keeps+ the separate Desktop-specific search and error contracts.+- Upstream 1.0.0 fixes are checked rather than duplicated: Anthropic+ `strict: "prefer"` fallback, malformed `Retry-After` fallback, Z.AI overflow+ classification, OpenAI Responses grammar tool-call replay, and the+ Anthropic copy-code login path. Runtime-contract tests and the mocked local+ OAuth bridge test cover these behaviors.++## `pi-coding-agent`++Patch: `patches/@[email protected]`<br>+SHA-256: `2d46470684b572b37bba57cf3cec31d81cf7747be163812b74563c8be8a95da3`++- Threads the actual model through session compaction thresholds, before/after+ estimates, branch preparation, cut-point selection, usage bookkeeping, and+ bug-report context selection. The matching `.d.ts` overloads expose the model+ parameter.+- Keeps context projection, usage anchors, compaction entries, and native JSONL+ ownership unchanged; it changes the estimate inputs so the Pi model's+ tokenizer and hosted-search replay projection are used consistently.+- `prepareBranchEntries` already existed before Pi 1.0.0. The patch makes that+ existing function model-aware; it does not claim the migration added the+ function itself.+- Regression coverage: `pi-coding-agent-compaction.test.ts`, native-session+ tests, and the full agent-runtime package suite.++No patch removes a product path or changes the Desktop persistence contract.+Any remaining test gap is recorded by acceptance ID in the+[qualification report](pi-1000-qualification.md).diff --git a/docs/project/pi-1000-qualification.md b/docs/project/pi-1000-qualification.mdnew file mode 100644index 000000000..92aef4ab4--- /dev/null+++ b/docs/project/pi-1000-qualification.md@@ -0,0 +1,95 @@+# Pi 1.0.0 migration qualification++Status is for the task candidate based on+`afe0fe4b0b52e21df1506f7ab46271a1754c643e`, on branch `upgrade/pi-1.0.0` in+the dedicated worktree. The candidate is uncommitted. `PASS` means the stated+local evidence ran; it does not extend to a live provider, real user data, or+another platform. See the release limitations at the end.++## Environment and artifact identity++- Host: macOS arm64, Node `v26.0.0`, pnpm `12.8.1`.+- Frozen install: `pnpm install --frozen-lockfile` — **PASS**.+- Pi dependency graph: `pnpm check:pi-dependencies` — **PASS**.+- Patch map, installed patch hashes, and declaration contracts:+ `pnpm check:pi-patches` — **PASS**.+- Final standalone Agent Runtime bundle SHA-256:+ `592808ec5b46ba7c36c74a1174176abc29c79d25534d9c04e0e2531b21e29191`+ (`packages/agent-runtime/dist-bundle/sidecar.js` entry file).+- Hosted Search's final 7-scenario E2E snapshot digest (entry + ESM marker ++ relative chunks): `f985081cb1f3fd1220dbb5d15bde98e1f976cee8f9f103dd3bdefdcc4067f6db`.+- `pnpm test:e2e:hosted-search` wrote fixture evidence to+ `/var/folders/pw/qtkwc6cx67d28cj0znhrklg00000gn/T/hosted-search-e2e-nhcyVs/result.json`.+- The packaged artifact checked was an unsigned macOS arm64 `.app` directory+ build. Electron Builder reported no Developer ID signing identity; no+ installer was signed, uploaded, or released.++## Acceptance matrix++| ID | Status | Evidence / limitation |+| --- | --- | --- |+| DEP-01 | PASS | Frozen install; lockfile SRI and all three patch hashes are recorded in `pi-1000-adoption.md`. |+| DEP-02 | PASS | Direct Main/Sidecar pins and installed patch identities checked; JS build, sidecar bundle, E2Es, and packaged macOS app boot exercised. Other OS launchers not run. |+| TYPE-01 | PASS | Workspace builds and package typechecks passed; `agent-messages.ts` regression covers the 1.0 `JsonValue` boundary. |+| LOOP-01 | PASS | Agent Runtime package suite and trusted-extension E2E cover message/tool/error ordering, abort, and blocked tools. |+| SEARCH-01 | PASS | Production sidecar Hosted Search E2E includes provider request, progress, result, and citation scenarios. |+| SEARCH-02 | PASS | E2E covers next prompt, Read, changed instructions, and delegated Task replay. |+| SEARCH-03 | PASS | E2E covers persisted restore; focused tests cover usage anchors and compaction projection. |+| SEARCH-04 | PASS | E2E covers invalid container/phase; focused tests cover error results and old/missing fields. |+| SEARCH-05 | PASS | Focused Hosted Search projection tests and E2E cover compatible provider/API projections and disabled/invalid search states. |+| ERROR-01 | PASS | Runtime suite covers local validation/estimation failures; no request is issued for rejected local input. |+| ERROR-02 | PASS | Runtime request/retry tests and Anthropic retry suite distinguish HTTP outcomes, cancellation, and ambiguous network failures. |+| UPSTREAM-01 | PASS | Pi 1.0 contract test exercises Anthropic strict-schema fallback behavior. |+| UPSTREAM-02 | PASS | Pi 1.0 contract test covers malformed Retry-After, Z.AI overflow, and grammar tool-call replay. |+| AUTH-01 | PASS | Offline Desktop OAuth tests exercise browser and copy-code paths, cancellation, state, and the Pi 1.0 Anthropic select/manual-code bridge. Real account login not run. |+| AUTH-02 | PASS | OAuth retry suite: explicit 429 bounds, deadlines, invalid_grant, 5xx, network failure, cancellation, safe text, and credential retention. |+| AUTH-03 | PASS | OAuth suite covers concurrent writes and separate same-vendor accounts with mocked external I/O; no real credential store was used. |+| MODEL-01 | PASS | OAuth/catalog and runtime tests cover account entitlement, explicit overrides, unknown/ambiguous models, and sibling metadata isolation. |+| IMAGE-01 | PASS | All three image E2E scripts passed with local HTTP fixtures; no real provider request. |+| IMAGE-02 | PASS | Image E2E covered batch, edit, download, unconfigured state, ordering, and no duplicate operation. Focused tests cover cancellation, limits, and failures. |+| USAGE-01 | PASS | Workspace tests and subagent/image E2Es cover physical request usage, replay, delegation, and image attribution. |+| NATIVE-01 | PASS | Native-session and compaction regression suites passed; packaged boot probe read 800 temporary session records. No user profile was opened. |+| NATIVE-02 | PASS | Native-session/lease tests passed for conflict and file ownership guards; no external native-session files were modified. |+| NATIVE-03 | PASS | Runtime lifecycle tests and trusted-extension E2E passed for startup failure, cancellation, settlement, and tool restrictions. |+| EXT-01 | PASS | Trusted-extension E2E: 39/39 scenarios passed for aliases, TS loading, cache reuse, types, and diagnostics. |+| EXT-02 | PASS | Runner tests use the real Jiti loader with an unsupported static named import; it stays undefined and emits an `unsupported_api` diagnostic. Direct missing-export access and legacy aliases are covered too. |+| BUNDLE-01 | PASS | Standalone OAuth bundle test passed outside the repository with empty `NODE_PATH`; sidecar E2E ran the generated bundle. |+| RELEASE-01 | BLOCKED_ENVIRONMENT | macOS arm64 `.app` directory packaging and isolated boot passed, including Host protocol 11 and 800 temporary session reads. Windows/Linux and signed installers were not available. |+| ROLLBACK-01 | NOT_RUN | No baseline → candidate → prior-app round trip was run against copied application data. It remains a release gate. |++## Executed checks++| Command / run | Result |+| --- | --- |+| `pnpm install --frozen-lockfile` | PASS |+| `pnpm check:pi-dependencies && pnpm check:pi-patches` | PASS |+| `pnpm typecheck` | PASS; workspace builds (including docs and Desktop) and typechecks completed |+| `pnpm lint` | PASS; Biome and style-token checks |+| `pnpm docs:check && pnpm check:release-docs` | PASS; 84 locale pairs, 553 documentation pages, release docs aligned |+| `pnpm check:agent-policy && pnpm check:pr-base` | PASS; policy synchronized and `origin/main` is the task base |+| `git diff --check` | PASS |+| Pi focused Runtime tests from the migration plan | PASS, 123 tests / 8 files |+| OAuth tests (`vendor-oauth-login`, `anthropic-oauth-retry`, `oauth-standalone-bundle`) | PASS, 57 tests |+| `pnpm test:e2e:hosted-search` | PASS, 7 scenarios; snapshot digest above |+| `pnpm test:e2e:images` | PASS, 25 scenarios over generation, UI, and full desktop chat with local fixtures |+| Trusted extensions E2E | PASS, 39 scenarios |+| Provider order, provider API style, subagents, subagent models, remote host | PASS, results recorded from local fixture runs |+| Live Voice E2E and interaction E2E | PASS, local TLS/realtime fixtures and 51 UI journeys; no real account/device call |+| Packaged boot probe | PASS, isolated temporary data directory; 800 session reads, protocol 11 |+| `pnpm run pack` | PASS, macOS arm64 unsigned `.app` directory build; Builder warned that no signing identity was present |+| `test/packaging-footprint.test.mjs` | PASS, 9 tests; models.dev resource is present in package mapping |+| `pnpm -r --if-present test` | PASS, all workspace package suites completed with exit code 0 |++E2E fixtures used local providers and temporary data directories. No paid API,+real provider, real user profile, live OAuth account, or real Desktop window was+used. Temporary artifacts from the harness are under the OS temp directory.++## Release limitations++- `RELEASE-01` is only qualified for the macOS arm64 directory build and boot+ probe; Windows/Linux installers and signing are not covered.+- `ROLLBACK-01` remains untested. Validate a copied user-data set with the+ previous app after candidate use before calling the migration publish-ready.+- Live Anthropic account/browser authentication and real provider usage were+ intentionally not exercised. They require a separate explicit release+ qualification run; all local OAuth flows in this report used fixtures.diff --git a/docs/spec/02-architecture/02-tech-stack.md b/docs/spec/02-architecture/02-tech-stack.mdindex e84c94d2e..c7f4b9438 100644--- a/docs/spec/02-architecture/02-tech-stack.md+++ b/docs/spec/02-architecture/02-tech-stack.md@@ -12,9 +12,9 @@| Host backend | **Rust** | stable Rust toolchain | tools/plugins/permissions/persistence adapters || Rust async | tokio | stable | host services || Host RPC | stdio JSON-RPC (NDJSON) | frozen (D001) | Electron main ↔ Rust host |-| Agent engine | `@earendil-works/pi-agent-core` | 0.99.1 | agent loop |-| Model API | `@earendil-works/pi-ai` | 0.99.1 | provider adapters, OAuth, and stream handling |-| Model catalog | pi-ai Providers/Models | pinned 0.99.1 + explicit provider refresh | account-scoped metadata and typed operations |+| Agent engine | `@earendil-works/pi-agent-core` | 1.0.0 | agent loop |+| Model API | `@earendil-works/pi-ai` | 1.0.0 | provider adapters, OAuth, and stream handling |+| Model catalog | pi-ai Providers/Models | pinned 1.0.0 + explicit provider refresh | account-scoped metadata and typed operations |> pi-ai owns published metadata, native thinking support, transports and auth.> Host persists Desktop account rows, credentials, and explicit binding overrides.diff --git a/docs/spec/02-architecture/06-pi-runtime-dependency-boundary.md b/docs/spec/02-architecture/06-pi-runtime-dependency-boundary.mdindex 0ebd869d3..8fbfc374d 100644--- a/docs/spec/02-architecture/06-pi-runtime-dependency-boundary.md+++ b/docs/spec/02-architecture/06-pi-runtime-dependency-boundary.md@@ -8,6 +8,12 @@ boundaries must keep that split clear as upstream packages evolve.## 2. Current ownership+The sidecar pins `@earendil-works/pi-agent-core`, `pi-ai`, and+`pi-coding-agent` together at exactly `1.0.0`; Desktop's `pi-ai` and `pi-mcp`+development dependencies use the same release. Target-release package patches+remain narrow compatibility deltas and are listed with their audited behavior+in `docs/project/pi-1000-patch-audit.md`.+- `@earendil-works/pi-agent-core` supplies the agent loop and its stable agent,event, and tool types. Agent Runtime owns desktop-specific compaction,prompt-template expansion, and session-context projection.@@ -25,6 +31,11 @@ boundaries must keep that split clear as upstream packages evolve.host-core checkpoint-compaction path, and durable session store do not usethe package's AgentSession.+The extension shim is a versioned compatibility subset, not the full 1.0.0+coding-agent API. Its legacy `VERSION` marker remains sourced from+`TRUSTED_EXTENSION_KERNEL_VERSION` and intentionally identifies the modeled+0.87.1 extension surface.+Do not reintroduce imports from removed `pi-agent-core` harness, session,compaction, or prompt-template APIs. Keep desktop behavior in the agent-runtimeboundary and use public `pi-ai` APIs for provider-facing operations.diff --git a/docs/spec/03-runtime/02-agent-runtime.md b/docs/spec/03-runtime/02-agent-runtime.mdindex 91bb9d8dd..7ede74646 100644--- a/docs/spec/03-runtime/02-agent-runtime.md+++ b/docs/spec/03-runtime/02-agent-runtime.md@@ -1564,7 +1564,7 @@ with the original v3 `SessionManager`, Pi `ModelRuntime`, `SettingsManager`, andleaf, compaction, model/thinking changes, and context-bearing custom messages;it is never reconstructed from renderer `UiMessage` rows.-The 0.99.1 SDK also applies append-only `context_edit` entries to this model+The Pi 1.0.0 SDK also applies append-only `context_edit` entries to this modelprojection. An edit can omit or replace an earlier message for later providerrequests without rewriting its raw JSONL entry or the visible native history.Native Pi extensions use the SDK's boundary hooks; all entries they append,@@ -1634,7 +1634,7 @@ and never triggers a provider transport rebuild. Protocol errors such as`EPROTO` keep their existing retry behavior. See[certificate trust ADR](../../adr/provider-system-certificates.md).-## Pi 0.99.1 execution boundary+## Pi 1.0.0 execution boundaryPublished model metadata and account entitlement come from one account-scopedPi Models collection. Effective binding projection is shared by launch, delegatesdiff --git a/docs/spec/03-runtime/11-provider-model-system.md b/docs/spec/03-runtime/11-provider-model-system.mdindex a9cf6c01d..aac286077 100644--- a/docs/spec/03-runtime/11-provider-model-system.md+++ b/docs/spec/03-runtime/11-provider-model-system.md@@ -464,7 +464,7 @@ same vendor key.### Anthropic token endpoint rate limits-The pinned pi-ai 0.99.1 patch gives Anthropic authorization-code exchange and+The pinned pi-ai 1.0.0 patch gives Anthropic authorization-code exchange andrefresh a shared, bounded token-request policy: retry only an explicit HTTP429, at most three total requests. Wait at least 1 s then 2 s, or longer when`Retry-After` gives delta seconds or an HTTP date. A server delay beyond the@@ -681,16 +681,11 @@ This is the **universal escape hatch** guaranteeing market coverage beyond nativ### 16.1 Responses stream termination (pi-ai patch)-The OpenAI Responses adapter must treat `response.completed` (and-`response.incomplete`) as the end of the stream: after finalizing the-response, it stops consuming the stream instead of awaiting the server's-TCP FIN. Upstream pi-ai keeps iterating until the server closes the-connection, which hangs the turn behind reverse proxies that hold the idle-connection open. Until the fix ships upstream, `patches/` carries a pnpm-patch on `@earendil-works/[email protected]` that breaks the event loop on the-terminal event (the OpenAI SDK aborts the underlying request when the-consumer stops iterating). Drop the patch once a pi-ai release includes the-fix.+The OpenAI Responses adapter treats `response.completed` and+`response.incomplete` as the end of the stream, so a reverse proxy that keeps+the TCP connection open cannot hold the turn after the final event. Pi-ai+1.0.0 includes this upstream fix. The 1.0.0 hosted-search patch does not need to+reapply the old 0.99.1 terminal-event hunk.## 17. Multi-provider product rulesdiff --git a/docs/spec/03-runtime/14-secrets-storage.md b/docs/spec/03-runtime/14-secrets-storage.mdindex 12b8f19ec..5212ffcc4 100644--- a/docs/spec/03-runtime/14-secrets-storage.md+++ b/docs/spec/03-runtime/14-secrets-storage.md@@ -147,6 +147,12 @@ survives cancellation, account deletion, and service restart. Initializationfailures remain retryable and use a redacted error. The identity never entersprovider rows, portable configuration, renderer events, or ordinary diagnostics.+Anthropic login uses pi-ai's browser or copy-code choice through the existing+Main-to-renderer `select` prompt bridge. Copy-code login returns through the+generic manual-code prompt with the flow's PKCE state; both paths persist the+credential through the same provider-scoped Host secret store. The choice does+not expose refresh tokens or change the account/auth ownership boundary.+Request auth flows one way only:1. The launch payload for an `authKind: "oauth"` row carries `apiKey: ""`.diff --git a/docs/spec/03-runtime/21-image-generation.md b/docs/spec/03-runtime/21-image-generation.mdindex 33051d644..eb5682cde 100644--- a/docs/spec/03-runtime/21-image-generation.md+++ b/docs/spec/03-runtime/21-image-generation.md@@ -123,7 +123,7 @@ previews, editing a generated file, collapsed results, and setup navigation.Live verification is opt-in via `scripts/test-image-generation-live.mjs`, limitedto one generation plus one edit and never a default test command.-## Pi 0.99.1 operation boundary+## Pi 1.0.0 operation boundaryImage generation and edits execute through account-scoped Pi `Models.generateImages`.Use native OpenRouter images or a registered compatible OpenAI-images adapter,diff --git a/docs/spec/06-delivery/04-e2e-test-plan.md b/docs/spec/06-delivery/04-e2e-test-plan.mdindex 00272e30d..18869dc83 100644--- a/docs/spec/06-delivery/04-e2e-test-plan.md+++ b/docs/spec/06-delivery/04-e2e-test-plan.md@@ -3293,7 +3293,7 @@ identify the platform validation still needed.#### E2E-MCP-pi-client-owner-policy: Pi protocol under existing Desktop owners-- **Preconditions**: Pi 0.99.1 with the pinned host-policy patch; offline stdio and+- **Preconditions**: Pi 1.0.0 with the pinned host-policy patch; offline stdio andHTTP fixtures, no paid provider or user credentials.- **Steps**: Run `plugin-mcp.test.mjs`, `user-mcp.test.mjs`,`mcp-stdio-launch.test.mjs`, `mcp-call-registry.test.mjs`, `mcp-oauth.test.mjs`,@@ -8505,6 +8505,25 @@ must keep splitting are covered by `markdown-blocks.test.mjs`.transport and orchestration integration test, not live OAuth, visual UI orHost persistence validation. Post-integration main E2E is NOT RUN.+#### E2E-OAUTH-anthropic-copy-code: Anthropic copy-code login uses the existing prompt bridge++- **Preconditions**: A local token-endpoint fixture intercepts only Anthropic's+ OAuth token URL. The production pi-ai Anthropic flow and Desktop `VendorOAuth`+ use an in-memory Host RPC fixture. No real account or remote endpoint is used.+- **Steps**: Start an Anthropic vendor login; choose `copy_code` from the+ `select` prompt; inspect the generated authorization URL; provide a synthetic+ `code#state` to the manual-code prompt; finish token exchange against the+ fixture; resolve request auth and inspect the stored Host credential.+- **Expected**: The select options retain `browser` and `copy_code`; the+ authorization URL uses `https://platform.claude.com/oauth/code/callback`;+ the token exchange succeeds; refresh credentials stay under the+ provider-scoped Host OAuth reference and only the short-lived access token is+ returned to runtime auth. No API-key secret is created.+- **Specs linked**: `03-runtime/14-secrets-storage.md` §10; `07-plugins/16-trusted-extensions.md` §4.+- **Acceptance**: B (vendor accounts), Security, Quality.+- **Status**: Local provider-flow integration fixture; no live account or visual+ renderer validation.+#### E2E-151: Multiple vendor accounts stay isolated through login, use, and removal- **Preconditions**: A build with `registerBunOAuthFlows()` running at startup@@ -14224,15 +14243,17 @@ plugin-form fixtures in an isolated temporary directory at runtime.#### E2E-244: Unsupported APIs, load errors, and handler timeouts degrade to diagnostics-- **Preconditions**: Three enabled fixture extensions: one importing- `@earendil-works/pi-tui` at top level and calling `ui.setWidget`; one whose+- **Preconditions**: Four enabled fixture extensions: one importing+ `@earendil-works/pi-tui` at top level and calling `ui.setWidget`; one importing+ an unsupported named export from `@earendil-works/pi-coding-agent`; one whosemodule throws at load; one whose `context` handler never resolves.- **Steps**: 1) Start a turn. 2) Open the diagnostics drawer for each entry.- 3) Wait past the 30 s handler limit. 4) Disable the throwing extension and- start another turn.+ 3) Confirm the unsupported export stays undefined. 4) Wait past the 30 s+ handler limit. 5) Disable the throwing extension and start another turn.- **Expected**: The pi-tui import succeeds, `setWidget` returns an inert`dispose`, and one diagnostic per member is recorded; the throwing- extension shows `error` with message and stack, the composer shows a+ coding-agent export stays unavailable and reports `unsupported_api`; the+ throwing extension shows `error` with message and stack, the composer shows aone-line notice, and the other extensions still load; the stalled handleris abandoned after 30 s with a diagnostic and the turn completes with theunmodified context; after disabling, the notice disappears at the next turn@@ -14240,7 +14261,7 @@ plugin-form fixtures in an isolated temporary directory at runtime.- **Specs linked**: `07-plugins/16-trusted-extensions.md` §4.2, §4.4, §5, §6- **Acceptance**: Quality- **Milestone**: Post-MVP (R7 v1)-- **Status**: Partially automated (`pnpm test:e2e:trusted-extensions`); load errors and inert terminal-UI APIs degrade to diagnostics, while the stalled-handler timeout and disable-at-boundary journey remain additional validation.+- **Status**: Partially automated (`pnpm test:e2e:trusted-extensions`); missing static named exports are covered through the real Jiti loader by `runner.test.ts`, while diagnostics-drawer rendering for that import, the stalled-handler timeout, and disable-at-boundary journey remain additional validation.#### E2E-245: The packaged sidecar loads a TypeScript extension through jiti@@ -16229,7 +16250,7 @@ renderer's durable transcript reads. No real model or provider is contacted.## E2E-OAUTH-pi-installation-identity-and-standalone-load-- **Preconditions**: Pi 0.99.1; temporary Host secrets and account fixtures;+- **Preconditions**: Pi 1.0.0; temporary Host secrets and account fixtures;network/browser/callback I/O mocked; no user account or paid service.- **Steps**: Run `installation-identity.test.mjs`, `vendor-oauth-login.test.mjs`and `oauth-standalone-bundle.test.mjs` under `apps/desktop/test`.diff --git a/docs/spec/07-plugins/16-trusted-extensions.md b/docs/spec/07-plugins/16-trusted-extensions.mdindex c223a0646..2b1ab9b14 100644--- a/docs/spec/07-plugins/16-trusted-extensions.md+++ b/docs/spec/07-plugins/16-trusted-extensions.md@@ -10,17 +10,18 @@ surface of PI-Desktop. This document specifies one plugin contribution,`contributes.agentExtensions`: TypeScript or JavaScript modules that runinside the Agent sidecar, receive an `ExtensionAPI` object, and registertools, commands, and event handlers directly on the agent loop. The-`ExtensionAPI` contract is the one defined by `@earendil-works/pi-coding-agent`,-which PI-Desktop adopts alongside the `pi-ai` and `pi-agent-core` kernel-(ADR 0002), so an extension written for the pi CLI is the module a plugin-contributes. D388 folded the earlier standalone "trusted extensions"-registry into this contribution; the engine below is unchanged.+`ExtensionAPI` shape is modeled on `@earendil-works/pi-coding-agent`, which+PI-Desktop adopts alongside the `pi-ai` and `pi-agent-core` kernel (ADR 0002).+The Desktop adapter implements an explicit subset, so compatibility with the+pi CLI is limited to the members listed here. D388 folded the earlier+standalone "trusted extensions" registry into this contribution; the engine+below is unchanged.This contract describes extensions attached to Desktop Agent sessions. TheDesktop adapter implements the explicit subset in §5–6; new upstream events donot become actionable here automatically. Native Pi continuation runs the-coding-agent SDK's own extension lifecycle and can use its 0.87.1 boundary-hooks, subject to the separate native-session lease and trust rules in+coding-agent SDK's own extension lifecycle and native runtime package version,+subject to the separate native-session lease and trust rules in[ADR 0254](../../adr/0254-native-pi-session-continuation.md).Provider declarations are a separate manifest surface rather than part of this@@ -217,11 +218,10 @@ never in Electron main, the renderer, or a plugin host process.### 4.2 Loader-- The sidecar pins `@earendil-works/pi-coding-agent` at exactly the version- pinned for `pi-ai` and `pi-agent-core`. The three versions must match; CI- fails when they drift. Native Pi sessions run its extension loader- in process, so the pin is a bundled runtime dependency and not a- types-only contract.+- The sidecar pins `@earendil-works/pi-agent-core`, `pi-ai`, and+ `pi-coding-agent` together at the same exact release. Native Pi sessions run+ the coding-agent session manager in process, so these are runtime dependencies,+ not a types-only contract.- The loader mirrors the `pi-coding-agent` discovery rules and uses`jiti/static` with `virtualModules`, so the babel transform is bundledand no path resolution happens at runtime. The bundling step is verified@@ -240,6 +240,13 @@ never in Electron main, the renderer, or a plugin host process.resolves to a stub module that exports every symbol as an inertvalue so a top-level import never fails. Using a stubbed symbol raises adiagnostic at call time.+- The trusted-extension coding-agent shim exposes only its documented supported+ helpers. Importing or accessing another root export reports an+ `unsupported_api` diagnostic; the export remains unavailable, and the loader+ does not load the full coding-agent runtime as a fallback.+ `TRUSTED_EXTENSION_KERNEL_VERSION` remains the legacy marker exposed as+ `VERSION` by this shim. It describes the compatibility subset modeled on the+ 0.87.1 API and deliberately does not mirror the installed 1.0.0 package.### 4.3 Runner per session@@ -511,7 +518,13 @@ runtime, main, and renderer tracks in parallel.## 13. Versioning policy-- Upgrading any pi package upgrades all three together.+- Upgrading the sidecar kernel upgrades `pi-agent-core`, `pi-ai`, and+ `pi-coding-agent` together at one exact version; the dependency gate verifies+ the direct pins. Desktop's `pi-ai` and `pi-mcp` development dependencies+ follow that release.+- The `VERSION` field on the extension compatibility shim uses the shared+ `TRUSTED_EXTENSION_KERNEL_VERSION` marker, not the package release. Change+ that marker only with an explicit compatibility review and shim contract test.- A fixture set of sample extensions covering each supported member runs as acontract test on every upgrade.- New `ExtensionAPI` members land in the Unsupported class with adiff --git a/docs/zh-CN/spec/02-architecture/02-tech-stack.md b/docs/zh-CN/spec/02-architecture/02-tech-stack.mdindex faf585f4f..e89dd76ba 100644--- a/docs/zh-CN/spec/02-architecture/02-tech-stack.md+++ b/docs/zh-CN/spec/02-architecture/02-tech-stack.md@@ -15,9 +15,9 @@| 主机后端 | **Rust** | 稳定的 Rust 工具链 | tools/plugins/permissions/persistence 适配器 || Rust 异步 | 东京 | 稳定 | 主机服务 || 主机 RPC | stdio JSON-RPC (NDJSON) | 冷冻(D001) | Electron 主 ↔ Rust 主机 |-| Agent 引擎 | `@earendil-works/pi-agent-core` | 0.99.1 | Agent 循环及稳定的 agent/event/tool 类型 |-| 模型 API | `@earendil-works/pi-ai` | 0.99.1 | 提供商 |-| Model catalog | pi-ai Providers/Models | pinned 0.99.1 + explicit provider refresh | account-scoped metadata and typed operations |+| Agent 引擎 | `@earendil-works/pi-agent-core` | 1.0.0 | Agent 循环及稳定的 agent/event/tool 类型 |+| 模型 API | `@earendil-works/pi-ai` | 1.0.0 | 提供商 |+| Model catalog | pi-ai Providers/Models | pinned 1.0.0 + explicit provider refresh | account-scoped metadata and typed operations |> pi-ai 提供已发布的模型元数据、原生思考能力、传输和认证。> Host 持有 Desktop 账户行、凭据和显式绑定覆盖。diff --git a/docs/zh-CN/spec/03-runtime/02-agent-runtime.md b/docs/zh-CN/spec/03-runtime/02-agent-runtime.mdindex b01ed892e..820a0d5b3 100644--- a/docs/zh-CN/spec/03-runtime/02-agent-runtime.md+++ b/docs/zh-CN/spec/03-runtime/02-agent-runtime.md@@ -1162,7 +1162,7 @@ System/Direct/Custom 代理路由保持不变。provider transport 重建。`EPROTO` 等协议错误继续使用原有重试行为。详见[证书信任 ADR](../../../adr/provider-system-certificates.md)。-## Pi 0.99.1 execution boundary+## Pi 1.0.0 execution boundaryPublished model metadata and account entitlement come from one account-scopedPi Models collection. Effective binding projection is shared by launch, delegatesdiff --git a/docs/zh-CN/spec/03-runtime/11-provider-model-system.md b/docs/zh-CN/spec/03-runtime/11-provider-model-system.mdindex 3599471fe..f86259229 100644--- a/docs/zh-CN/spec/03-runtime/11-provider-model-system.md+++ b/docs/zh-CN/spec/03-runtime/11-provider-model-system.md@@ -174,7 +174,7 @@ PI-Desktop 不得把用户永久限制在一份简短的固定模型列表上。### 6.2 Catalog responsibilities-1. pi-ai 0.99.1 Providers/Models own published metadata, transport, thinking+1. pi-ai 1.0.0 Providers/Models own published metadata, transport, thinkingsupport and native operation types. Electron's historically named`ModelsDevCatalog` is an account-aware adapter over this public API.2. Startup is cache-only and disables ambient environment/file credentials.@@ -381,7 +381,7 @@ Codex CLI 版本(`CODEX_MODELS_CLIENT_VERSION`),账户模型缺失时调### Anthropic token 端点限流-固定版本 pi-ai 0.99.1 的仓库补丁为 Anthropic 授权码交换与刷新提供同一套+固定版本 pi-ai 1.0.0 的仓库补丁为 Anthropic 授权码交换与刷新提供同一套有限策略:只重试明确的 HTTP 429,最多总共三次请求。先等待至少 1 秒、再等待至少 2 秒;若 `Retry-After` 给出更长的秒数或 HTTP 日期,则遵守该时间。服务器要求的等待超出剩余预算时结束本次尝试,不缩短等待后提前重试。@@ -575,14 +575,10 @@ UI 可能会显示层级提示,但默认情况下不得硬阻止未知模型### 16.1 Responses 流终止(pi-ai 补丁)-OpenAI Responses 适配器必须把 `response.completed`(以及-`response.incomplete`)视为流的终点:完成响应收尾后即停止消费流,-而不是继续等待服务端的 TCP FIN。上游 pi-ai 会一直迭代直到服务端关闭-连接,在保持空闲连接不关的反向代理后面会导致整个回合挂起。在该修复-随上游发布之前,`patches/` 通过 pnpm patch 修改-`@earendil-works/[email protected]`,在终态事件处跳出事件循环(消费方停止-迭代时 OpenAI SDK 会中止底层请求)。待 pi-ai 发布包含该修复的版本后-移除补丁。+OpenAI Responses 适配器会把 `response.completed` 和+`response.incomplete` 视为流终点,因此反向代理即使保持 TCP 连接打开,+终态事件之后也不会继续挂起本轮请求。pi-ai 1.0.0 已包含这项上游修复;+1.0.0 hosted-search 补丁不再重复应用旧 0.99.1 终态事件代码。## 17. 多提供商产品规则diff --git a/docs/zh-CN/spec/03-runtime/13-model-catalog-and-selection.md b/docs/zh-CN/spec/03-runtime/13-model-catalog-and-selection.mdindex 7c2b2c84a..b065dd87d 100644--- a/docs/zh-CN/spec/03-runtime/13-model-catalog-and-selection.md+++ b/docs/zh-CN/spec/03-runtime/13-model-catalog-and-selection.md@@ -136,7 +136,7 @@ type RecentModelRef = {## 6. Refresh behavior-The pinned pi-ai 0.99.1 catalog is the startup baseline. Startup reads no remote+The pinned pi-ai 1.0.0 catalog is the startup baseline. Startup reads no remotecatalog and uses no ambient credentials. `providers.refreshModelCatalog` invokesPi's public refresh API; settings metadata lookups themselves are local.diff --git a/docs/zh-CN/spec/03-runtime/21-image-generation.md b/docs/zh-CN/spec/03-runtime/21-image-generation.mdindex e7190bf66..d17453c7f 100644--- a/docs/zh-CN/spec/03-runtime/21-image-generation.md+++ b/docs/zh-CN/spec/03-runtime/21-image-generation.md@@ -58,7 +58,7 @@`node scripts/e2e-image-chat.mjs` 在隔离桌面中使用本地模型/图片 HTTP 夹具,覆盖相邻默认设置、Composer 提交、批量结果、引用生成文件编辑、收起详情和配置跳转。真实接口验证通过 `scripts/test-image-generation-live.mjs` 显式启用,仅限一次生成和一次编辑,不属于默认测试命令。-## Pi 0.99.1 operation boundary+## Pi 1.0.0 operation boundaryImage generation and edits execute through account-scoped Pi `Models.generateImages`.Use native OpenRouter images or a registered compatible OpenAI-images adapter,diff --git a/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md b/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.mdindex 64fe26caa..4e8caff87 100644--- a/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md+++ b/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md@@ -6996,6 +6996,20 @@ eleven-tool-round desktop paths are verified by- **验收**:B(模型配置)、质量- **里程碑**:M6++#### E2E-OAUTH-anthropic-copy-code:Anthropic 复制代码登录复用现有提示桥接++- **前置条件**:本地 token 端点夹具只拦截 Anthropic OAuth token URL。生产 pi-ai+ Anthropic 流程与 Desktop `VendorOAuth` 使用内存 Host RPC 夹具;不使用真实账户或远程端点。+- **步骤**:发起 Anthropic 厂商登录;在 `select` 提示中选择 `copy_code`;检查授权 URL;+ 为 manual-code 提示输入合成的 `code#state`;通过夹具完成 token 交换;解析请求认证并检查+ Host 中存储的凭据。+- **预期**:选择项保留 `browser` 和 `copy_code`;授权 URL 使用+ `https://platform.claude.com/oauth/code/callback`;token 交换成功;refresh 凭据保存在+ provider 作用域的 Host OAuth 引用中,运行时只获得短期 access token;不创建 API-key secret。+- **链接规格**:`03-runtime/14-secrets-storage.md` §10;`07-plugins/16-trusted-extensions.md` §4。+- **验收**:B(厂商账户)、安全、质量。+- **状态**:本地 provider-flow 集成夹具;未验证真实账户或渲染器视觉流程。+#### E2E-164:上下文压缩保留活动任务边界- **先决条件**:提供商夹具可以在一个会话中完成多个连续任务,在终止边界触发自动@@ -7694,18 +7708,20 @@ runner 会在运行时的隔离临时目录中生成六个插件形态 fixture#### E2E-244:不支持的 API、加载错误与处理器超时降级为诊断-- **前置条件**:三个已启用的夹具扩展:一个在顶层导入 `@earendil-works/pi-tui` 并- 调用 `ui.setWidget`;一个模块在加载时抛出;一个 `context` 处理器永不返回。-- **步骤**:1)开始一个回合。2)打开每个条目的诊断抽屉。3)等待超过 30 秒处理器- 限制。4)禁用抛出的扩展并开始另一个回合。+- **前置条件**:四个已启用的夹具扩展:一个在顶层导入 `@earendil-works/pi-tui` 并+ 调用 `ui.setWidget`;一个从 `@earendil-works/pi-coding-agent` 导入不支持的命名导出;+ 一个模块在加载时抛出;一个 `context` 处理器永不返回。+- **步骤**:1)开始一个回合。2)打开每个条目的诊断抽屉。3)确认不支持的导出仍为+ undefined。4)等待超过 30 秒处理器限制。5)禁用抛出的扩展并开始另一个回合。- **预期**:pi-tui 导入成功,`setWidget` 返回惰性 `dispose`,每个成员记录一条诊断;- 抛出的扩展显示 `error` 及消息和堆栈,composer 显示一行提示,其余扩展仍加载;+ 不支持的 coding-agent 导出保持不可用并记录 `unsupported_api`;抛出的扩展显示 `error`+ 及消息和堆栈,composer 显示一行提示,其余扩展仍加载;停滞的处理器在 30 秒后被放弃并记诊断,回合以未修改的上下文完成;禁用后提示在下一回合边界消失,且没有运行中的回合被打断。- **链接规格**:`07-plugins/16-trusted-extensions.md` §4.2、§4.4、§5、§6- **验收**:质量- **里程碑**:MVP 后(R7 v1)-- **状态**:部分自动化(`pnpm test:e2e:trusted-extensions`);加载错误与惰性 terminal-UI API 会降级为诊断;停滞处理器超时和边界禁用旅程仍需额外验证+- **状态**:部分自动化(`pnpm test:e2e:trusted-extensions`);`runner.test.ts` 通过真实 Jiti loader 覆盖缺失的静态命名导出;该导入对应的诊断抽屉渲染、停滞处理器超时和边界禁用旅程仍需额外验证#### E2E-245:打包后的 sidecar 经 jiti 加载 TypeScript 扩展diff --git a/docs/zh-CN/spec/07-plugins/16-trusted-extensions.md b/docs/zh-CN/spec/07-plugins/16-trusted-extensions.mdindex 59ea831b0..c7146e5ae 100644--- a/docs/zh-CN/spec/07-plugins/16-trusted-extensions.md+++ b/docs/zh-CN/spec/07-plugins/16-trusted-extensions.md@@ -136,6 +136,9 @@ main、渲染层或插件宿主进程中。工具结果类型守卫。`@earendil-works/pi-tui` 解析到一个桩模块,它把每个符号导出为惰性值,使顶层 import 永不失败。调用被桩替代的符号时在调用点产生一条诊断。+- 可信扩展的 coding-agent shim 仅公开文档列出的受支持助手。导入或访问其他根导出会+ 产生 `unsupported_api` 诊断;该导出仍不可用,loader 不会加载完整 coding-agent+ 运行时作为回退。### 4.3 每会话一个 Runnerdiff --git a/package.json b/package.jsonindex f088d14b2..9e85a1525 100644--- a/package.json+++ b/package.json@@ -57,6 +57,8 @@"test:e2e:subagents": "node scripts/e2e-subagents.mjs","test:e2e:subagent-models": "node scripts/e2e-subagent-models.mjs","check:marketplace": "node scripts/check-marketplace-catalog.mjs",+ "check:pi-dependencies": "node scripts/check-pi-dependencies.mjs",+ "check:pi-patches": "node scripts/check-pi-patches.mjs","check:release-docs": "node scripts/check-release-docs.mjs","check:agent-policy": "node scripts/check-agent-policy-sync.mjs","check:pr-base": "node scripts/check-pr-base-main.mjs",diff --git a/packages/agent-runtime/package.json b/packages/agent-runtime/package.jsonindex 4e1d2e3c1..3121a2924 100644--- a/packages/agent-runtime/package.json+++ b/packages/agent-runtime/package.json@@ -27,9 +27,9 @@"clean": "node -e \"fs.rmSync('dist',{recursive:true,force:true});fs.rmSync('dist-bundle',{recursive:true,force:true})\""},"dependencies": {- "@earendil-works/pi-agent-core": "0.99.1",- "@earendil-works/pi-ai": "0.99.1",- "@earendil-works/pi-coding-agent": "0.99.1",+ "@earendil-works/pi-agent-core": "1.0.0",+ "@earendil-works/pi-ai": "1.0.0",+ "@earendil-works/pi-coding-agent": "1.0.0","@pi-desktop/shared": "workspace:*","jiti": "2.7.0","typebox": "1.3.27",diff --git a/packages/agent-runtime/src/agent-messages.test.ts b/packages/agent-runtime/src/agent-messages.test.tsnew file mode 100644index 000000000..3631d9bba--- /dev/null+++ b/packages/agent-runtime/src/agent-messages.test.ts@@ -0,0 +1,12 @@+import { describe, expect, it } from "vitest";+import { toJsonObject, toJsonValue } from "./agent-messages.js";++describe("agent message JSON projections", () => {+ it("keeps JSON objects and rejects readonly arrays as object maps", () => {+ const values: readonly unknown[] = Object.freeze([{ nested: "value" }]);++ expect(toJsonObject({ details: values })).toEqual({ details: [{ nested: "value" }] });+ expect(toJsonObject(values)).toEqual({});+ expect(toJsonValue(values)).toEqual([{ nested: "value" }]);+ });+});diff --git a/packages/agent-runtime/src/agent-messages.ts b/packages/agent-runtime/src/agent-messages.tsindex ba284c459..53687ee93 100644--- a/packages/agent-runtime/src/agent-messages.ts+++ b/packages/agent-runtime/src/agent-messages.ts@@ -5,8 +5,8 @@* shape, so the conversions live here instead of being duplicated per loop.*/-import type { AgentMessage, JsonValue } from "@earendil-works/pi-agent-core";-import type { Usage } from "@earendil-works/pi-ai";+import type { AgentMessage } from "@earendil-works/pi-agent-core";+import type { JsonObject, JsonValue, Usage } from "@earendil-works/pi-ai";import type { MessageUsage, UsageProvenance } from "@pi-desktop/shared";export function nowIso(): string {@@ -40,9 +40,14 @@ export function toJsonValue(value: unknown): JsonValue | undefined {return undefined;}}++function isJsonObject(value: JsonValue): value is JsonObject {+ return typeof value === "object" && value !== null && !Array.isArray(value);+}+export function toJsonObject(value: unknown): Record<string, JsonValue> {const normalized = toJsonValue(value);- return normalized && typeof normalized === "object" && !Array.isArray(normalized)+ return normalized !== undefined && isJsonObject(normalized)? normalized: {};}diff --git a/packages/agent-runtime/src/extensions/loader.ts b/packages/agent-runtime/src/extensions/loader.tsindex a8096b3ed..6330a8715 100644--- a/packages/agent-runtime/src/extensions/loader.ts+++ b/packages/agent-runtime/src/extensions/loader.ts@@ -13,10 +13,12 @@ import * as typeboxCompile from "typebox/compile";import * as typeboxValue from "typebox/value";import * as piAgentCore from "@earendil-works/pi-agent-core";import * as piAi from "@earendil-works/pi-ai";+import { TRUSTED_EXTENSION_KERNEL_VERSION } from "@pi-desktop/shared";export type ExtensionFactory = (api: unknown) => unknown;export type StubSymbolReporter = (symbol: string) => void;+export type MissingCodingAgentApiReporter = (symbol: string) => void;/** Callable, constructible, property-bearing nothing. */function inertValue(): unknown {@@ -63,8 +65,8 @@ export function createTuiStub(onUse: StubSymbolReporter): Record<string, unknown}/** Runtime surface of `@earendil-works/pi-coding-agent` that extensions import. */-export function createCodingAgentShim(): Record<string, unknown> {- return {+export function createCodingAgentShim(onMissingApi?: MissingCodingAgentApiReporter): Record<string, unknown> {+ const supported = {defineTool: <T>(tool: T): T => tool,/** Result type guards from the pi CLI's built-in tools. Trusted extensions* run beside the desktop's own tools, so these never match here. */@@ -78,8 +80,32 @@ export function createCodingAgentShim(): Record<string, unknown> {isPowerShellToolResult: () => false,isToolCallEventType: (type: unknown) =>type === "tool_call" || type === "tool_result",- VERSION: "0.87.1",+ VERSION: TRUSTED_EXTENSION_KERNEL_VERSION,+ };+ const reportMissing = (target: typeof supported, prop: PropertyKey) => {+ if (+ typeof prop === "string" &&+ prop !== "default" &&+ prop !== "__esModule" &&+ prop !== "then" &&+ !(prop in target)+ ) {+ onMissingApi?.(prop);+ }};+ return new Proxy(supported, {+ get: (target, prop, receiver) => {+ reportMissing(target, prop);+ return Reflect.get(target, prop, receiver);+ },+ // Jiti checks `name in module` before reading a virtual named import.+ // Report unknown static imports here even though the unsupported export+ // remains absent from the compatibility subset.+ has: (target, prop) => {+ reportMissing(target, prop);+ return Reflect.has(target, prop);+ },+ });}export type CreateVirtualModulesOptions = {@@ -96,6 +122,8 @@ export type CreateVirtualModulesOptions = {const stubReporters = new Map<string, StubSymbolReporter>();/** Symbols each cached module touched at import time; replayed to later Runners. */const stubSymbolsByExtension = new Map<string, Set<string>>();+const missingCodingAgentApiReporters = new Map<string, MissingCodingAgentApiReporter>();+const missingCodingAgentApisByExtension = new Map<string, Set<string>>();export function setStubSymbolReporter(extensionId: string, reporter: StubSymbolReporter | undefined): void {if (reporter) stubReporters.set(extensionId, reporter);@@ -107,6 +135,19 @@ export function knownStubSymbols(extensionId: string): string[] {return [...(stubSymbolsByExtension.get(extensionId) ?? [])];}+export function setMissingCodingAgentApiReporter(+ extensionId: string,+ reporter: MissingCodingAgentApiReporter | undefined,+): void {+ if (reporter) missingCodingAgentApiReporters.set(extensionId, reporter);+ else missingCodingAgentApiReporters.delete(extensionId);+}++/** Missing shim exports touched by a cached module, for later Runners. */+export function knownMissingCodingAgentApis(extensionId: string): string[] {+ return [...(missingCodingAgentApisByExtension.get(extensionId) ?? [])];+}+export function createVirtualModules(options: CreateVirtualModulesOptions,): Record<string, unknown> {@@ -119,7 +160,15 @@ export function createVirtualModules(known.add(symbol);stubReporters.get(options.extensionId)?.(symbol);});- const codingAgent = createCodingAgentShim();+ const codingAgent = createCodingAgentShim((symbol) => {+ let known = missingCodingAgentApisByExtension.get(options.extensionId);+ if (!known) {+ known = new Set();+ missingCodingAgentApisByExtension.set(options.extensionId, known);+ }+ known.add(symbol);+ missingCodingAgentApiReporters.get(options.extensionId)?.(symbol);+ });return {typebox,"typebox/compile": typeboxCompile,diff --git a/packages/agent-runtime/src/extensions/runner.test.ts b/packages/agent-runtime/src/extensions/runner.test.tsindex a0e5697fb..0e9eb327d 100644--- a/packages/agent-runtime/src/extensions/runner.test.ts+++ b/packages/agent-runtime/src/extensions/runner.test.ts@@ -11,6 +11,11 @@ import type {TrustedExtensionUiRequest,TrustedExtensionUiResponse,} from "./index.js";+import {+ createVirtualModules,+ setMissingCodingAgentApiReporter,+} from "./loader.js";+import { TRUSTED_EXTENSION_KERNEL_VERSION } from "@pi-desktop/shared";let root: string;@@ -85,6 +90,57 @@ function fakeBridge(const flush = () => new Promise((r) => setTimeout(r, 0));describe("TrustedExtensionRunner", () => {+ it("keeps the legacy extension version marker tied to its tested shim subset", async () => {+ const missing: string[] = [];+ const extensionId = "coding-agent-compat-check";+ setMissingCodingAgentApiReporter(extensionId, (symbol) => missing.push(symbol));+ const shim = createVirtualModules({ extensionId })["@earendil-works/pi-coding-agent"] as Record<string, unknown>;+ const tool = { name: "example" };+ expect(shim.VERSION).toBe(TRUSTED_EXTENSION_KERNEL_VERSION);+ expect((shim.defineTool as (value: unknown) => unknown)(tool)).toBe(tool);+ expect((shim.isBashToolResult as () => boolean)()).toBe(false);+ expect((shim.isToolCallEventType as (value: unknown) => boolean)("tool_result")).toBe(true);+ expect((shim.isToolCallEventType as (value: unknown) => boolean)("turn_start")).toBe(false);+ expect(createVirtualModules({ extensionId: "compat-aliases" })["@mariozechner/pi-coding-agent"])+ .toBeDefined();+ expect(createVirtualModules({ extensionId: "compat-aliases" })["@mariozechner/pi-ai/compat"])+ .toBeDefined();+ expect(shim.newRuntimeApi).toBeUndefined();+ expect(missing).toEqual(["newRuntimeApi"]);++ const ext = spec("shim-version", `import { VERSION } from "@earendil-works/pi-coding-agent";+export default function (pi: any) { pi.setSessionName(VERSION); }+`);+ const { bridge, log } = fakeBridge();+ const runner = new TrustedExtensionRunner({ specs: [ext], bridge });+ const [report] = await runner.load();+ expect(report.state).toBe("loaded");+ expect(log.sessionName).toBe(TRUSTED_EXTENSION_KERNEL_VERSION);+ });++ it("reports a missing coding-agent named export used through the Jiti loader", async () => {+ const ext = spec(+ "missing-coding-agent-export",+ `import { newSessionApi } from "@earendil-works/pi-coding-agent";+export default function (pi) { pi.setSessionName(String(newSessionApi)); }+`,+ );+ const { bridge, log } = fakeBridge();+ const runner = new TrustedExtensionRunner({ specs: [ext], bridge });+ const [report] = await runner.load();++ expect(report.state).toBe("loaded");+ expect(log.sessionName).toBe("undefined");+ expect(runner.getDiagnostics()).toContainEqual(+ expect.objectContaining({+ extensionId: ext.id,+ kind: "unsupported_api",+ member: "newSessionApi",+ }),+ );+ await runner.dispose();+ });+it("chains prompt returns in supplied extension order and handler registration order", async () => {const first = spec("z-first", `export default function (pi) {pi.on("before_agent_start", (e) => ({ systemPrompt: e.systemPrompt + " A" }));diff --git a/packages/agent-runtime/src/extensions/runner.ts b/packages/agent-runtime/src/extensions/runner.tsindex 92d58a7eb..2e0a6e293 100644--- a/packages/agent-runtime/src/extensions/runner.ts+++ b/packages/agent-runtime/src/extensions/runner.ts@@ -26,8 +26,10 @@ import {} from "@pi-desktop/shared";import {createVirtualModules,+ knownMissingCodingAgentApis,knownStubSymbols,loadExtensionFactory,+ setMissingCodingAgentApiReporter,setStubSymbolReporter,type ExtensionFactory,} from "./loader.js";@@ -344,12 +346,25 @@ export class TrustedExtensionRunner {reportedStubs.add(symbol);this.report(spec.id, "stub_symbol", `pi-tui symbol "${symbol}" is a no-op in PI-Desktop`, symbol);};+ const reportedMissingApis = new Set<string>();+ const reportMissingApi = (symbol: string) => {+ if (reportedMissingApis.has(symbol)) return;+ reportedMissingApis.add(symbol);+ this.report(+ spec.id,+ "unsupported_api",+ `@earendil-works/pi-coding-agent export "${symbol}" is outside PI-Desktop's extension compatibility subset`,+ symbol,+ );+ };setStubSymbolReporter(spec.id, reportStub);+ setMissingCodingAgentApiReporter(spec.id, reportMissingApi);const virtualModules = createVirtualModules({ extensionId: spec.id });let factory = factoryCache.get(spec.id);// A cached module keeps the pi-tui symbols it imported the first time;// report them here so this session's diagnostics say so too.if (factory) for (const symbol of knownStubSymbols(spec.id)) reportStub(symbol);+ if (factory) for (const symbol of knownMissingCodingAgentApis(spec.id)) reportMissingApi(symbol);if (!factory) {try {factory = await this.lifecycle.run(diff --git a/packages/agent-runtime/src/pi-upstream-1.0-contract.test.ts b/packages/agent-runtime/src/pi-upstream-1.0-contract.test.tsnew file mode 100644index 000000000..6626c92b7--- /dev/null+++ b/packages/agent-runtime/src/pi-upstream-1.0-contract.test.ts@@ -0,0 +1,100 @@+import { describe, expect, it, vi } from "vitest";+import { convertResponsesMessages } from "@earendil-works/pi-ai/api/openai-responses-shared";+import { retryProviderRequest } from "@earendil-works/pi-ai/utils/provider-retry";+import { isContextOverflow } from "@earendil-works/pi-ai/utils/overflow";+import { normalizeContext, type AssistantMessage, type Model } from "@earendil-works/pi-ai";++const testModel: Model<"openai-responses"> = {+ id: "test-model",+ name: "test model",+ api: "openai-responses",+ provider: "openai",+ baseUrl: "http://localhost",+ reasoning: false,+ input: ["text"],+ cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },+ contextWindow: 32_000,+ maxTokens: 4_000,+};++describe("Pi 1.0 upstream regression contracts", () => {+ it("replays a grammar tool-call item with the required ctc_ identifier", () => {+ const message: AssistantMessage = {+ role: "assistant",+ content: [{+ type: "toolCall",+ id: "call_123|ctc_response_item",+ name: "lookup",+ arguments: { query: "pi" },+ }],+ api: "openai-responses",+ provider: "openai",+ model: "test-model",+ usage: {+ input: 0, output: 0, cacheRead: 0, cacheWrite: 0, totalTokens: 0,+ cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 },+ },+ stopReason: "toolUse",+ timestamp: 1,+ };+ const replay = convertResponsesMessages(+ testModel,+ normalizeContext({ messages: [message] }),+ new Set(),+ { grammarToolInputProperties: new Map([["lookup", "query"]]) },+ );+ expect(replay).toContainEqual(expect.objectContaining({+ type: "custom_tool_call",+ id: "ctc_response_item",+ call_id: "call_123",+ name: "lookup",+ }));+ });++ it("uses the bounded exponential fallback for an invalid Retry-After value", async () => {+ vi.useFakeTimers();+ const random = vi.spyOn(Math, "random").mockReturnValue(0);+ try {+ const rateLimit = Object.assign(new Error("rate limited"), {+ status: 429,+ headers: new Headers({ "retry-after": "not-a-date" }),+ });+ let requests = 0;+ const pending = retryProviderRequest(async () => {+ requests += 1;+ if (requests === 1) throw rateLimit;+ return "recovered";+ }, { maxRetries: 1 });++ await Promise.resolve();+ await Promise.resolve();+ expect(requests).toBe(1);+ await vi.advanceTimersByTimeAsync(499);+ expect(requests).toBe(1);+ await vi.advanceTimersByTimeAsync(1);+ await expect(pending).resolves.toBe("recovered");+ expect(requests).toBe(2);+ } finally {+ random.mockRestore();+ vi.useRealTimers();+ }+ });++ it("recognizes the Z.AI context-overflow finish reason", () => {+ const message: AssistantMessage = {+ role: "assistant",+ content: [],+ api: "openai-responses",+ provider: "zai",+ model: "test-model",+ usage: {+ input: 1, output: 0, cacheRead: 0, cacheWrite: 0, totalTokens: 1,+ cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 },+ },+ stopReason: "error",+ errorMessage: "model_context_window_exceeded",+ timestamp: 1,+ };+ expect(isContextOverflow(message)).toBe(true);+ });+});diff --git a/packages/agent-runtime/src/runtime.ts b/packages/agent-runtime/src/runtime.tsindex 38e3f9b49..0c6140702 100644--- a/packages/agent-runtime/src/runtime.ts+++ b/packages/agent-runtime/src/runtime.ts@@ -2594,6 +2594,10 @@ Do not invent objections or turn speculative risks into blockers. Stop when theprivate extensionModelRegistry(): Record<string, unknown> {const getRunner = () => this.extensionRunner;const models = () => [this.model, ...(getRunner()?.getAgentModels() ?? [])];+ const hasConfiguredProvider = (providerId: string) =>+ providerId === this.provider.id ||+ providerId === this.model.provider ||+ (getRunner()?.getAgents().some((agent) => agent.providerId === providerId) ?? false);return {getAll: () => [...new Map(models().map((model) => [`${model.provider}/${model.id}`, model])).values()],getAvailable: () => [...new Map(models().map((model) => [`${model.provider}/${model.id}`, model])).values()],@@ -2603,12 +2607,11 @@ Do not invent objections or turn speculative risks into blockers. Stop when thegetRunner()?.getAgents().find((agent) => agent.providerId === providerId)?.name ??(providerId === this.provider.id ? this.provider.name : providerId),getProviderAuthStatus: (providerId: string) => ({- configured: [this.provider.id, ...(getRunner()?.getAgents().map((agent) => agent.providerId) ?? [])].includes(providerId),+ configured: hasConfiguredProvider(providerId),source: "plugin",}),hasConfiguredAuth: (model: { provider?: string }) =>- typeof model.provider === "string" &&- [this.provider.id, ...(getRunner()?.getAgents().map((agent) => agent.providerId) ?? [])].includes(model.provider),+ typeof model.provider === "string" && hasConfiguredProvider(model.provider),};}diff --git a/packages/shared/src/trusted-extensions.ts b/packages/shared/src/trusted-extensions.tsindex 0cdc2288f..6c3304c0a 100644--- a/packages/shared/src/trusted-extensions.ts+++ b/packages/shared/src/trusted-extensions.ts@@ -152,7 +152,12 @@ export const TRUSTED_EXTENSION_HANDLER_TIMEOUT_MS = 30_000;/** Modal prompt timeout (spec §9). */export const TRUSTED_EXTENSION_PROMPT_TIMEOUT_MS = 5 * 60_000;-/** The pinned kernel version every pi package in the sidecar must share (spec §13). */+/**+ * Legacy compatibility marker exposed by the trusted-extension coding-agent+ * shim. It identifies the subset modeled on the 0.87.1 extension API; it is+ * intentionally independent from the installed Pi runtime package versions.+ * Change it only with an explicit shim compatibility review and contract test.+ */export const TRUSTED_EXTENSION_KERNEL_VERSION = "0.87.1";/** Palette command id prefix for extension commands. */diff --git a/patches/@[email protected] b/patches/@[email protected]similarity index 91%rename from patches/@[email protected]rename to patches/@[email protected]index 17a4aa7ad..d91895778 100644--- a/patches/@[email protected]+++ b/patches/@[email protected]@@ -1,5 +1,5 @@diff --git a/dist/agent-loop.js b/dist/agent-loop.js-index edcfba73a..4374aa013 100644+index edcfba73a4e8f548f19a17bdaf8982bd528c76bd..4374aa013b252013eca1bb9066cb1935ed3ca59c 100644--- a/dist/agent-loop.js+++ b/dist/agent-loop.js@@ -294,6 +294,12 @@ async function streamAssistantResponse(context, config, signal, emit, streamFunc@@ -16,7 +16,7 @@ index edcfba73a..4374aa013 100644partialMessage = event.partial;context.messages[context.messages.length - 1] = partialMessage;diff --git a/dist/agent.js b/dist/agent.js-index a8ccfc0bd..0f98e4736 100644+index a8ccfc0bd9bd84895b5f158c9dfa328e65f200ca..0f98e4736f7bbf4fed2c53a5596cda2f03fe0a26 100644--- a/dist/agent.js+++ b/dist/agent.js@@ -1,3 +1,4 @@diff --git a/patches/@[email protected] b/patches/@[email protected]similarity index 95%rename from patches/@[email protected]rename to patches/@[email protected]index df5da3d0d..c4e2774db 100644--- a/patches/@[email protected]+++ b/patches/@[email protected]@@ -1,15 +1,15 @@diff --git a/dist/api/anthropic-messages.js b/dist/api/anthropic-messages.js-index 501971b2a..a72110c70 100644+index 106f2b9617fa3b810261e067a3c965f209907af3..b4b92125484b40d54fc12aa4121a52f8ba9d6324 100644--- a/dist/api/anthropic-messages.js+++ b/dist/api/anthropic-messages.js@@ -1,3 +1,6 @@+import { hostedSearchReplayProjection, validateHostedSearchMessages } from "../utils/hosted-search.js";+import { asLocalRequestError, localRequestErrorDetails } from "../utils/local-request-error.js";+import { withLocalRequestErrors } from "../utils/local-request-stream.js";- import Anthropic from "@anthropic-ai/sdk";+ import Anthropic, {} from "@anthropic-ai/sdk";+ import { ANTHROPIC_FEDERATION_RULE_ID_ENV, ANTHROPIC_IDENTITY_TOKEN_FILE_ENV, ANTHROPIC_ORGANIZATION_ID_ENV, ANTHROPIC_SERVICE_ACCOUNT_ID_ENV, ANTHROPIC_WORKSPACE_ID_ENV, } from "../env-api-keys.js";import { calculateCost } from "../models.js";- import { appendAssistantMessageDiagnostic } from "../utils/diagnostics.js";-@@ -332,8 +335,6 @@ async function* iterateAnthropicEvents(response, signal) {+@@ -375,8 +378,6 @@ async function* iterateAnthropicEvents(response, signal) {}export const stream = (model, context, options) => {const stream = new AssistantMessageEventStream();@@ -18,7 +18,7 @@ index 501971b2a..a72110c70 100644(async () => {const providerThinkingLevel = model.compat?.supportsMidConvoEffort ? (options?.effort ?? "high") : undefined;const output = {-@@ -354,7 +355,11 @@ export const stream = (model, context, options) => {+@@ -397,7 +398,11 @@ export const stream = (model, context, options) => {stopReason: "pending",timestamp: Date.now(),};@@ -30,7 +30,7 @@ index 501971b2a..a72110c70 100644let client;let isOAuth;let usageModel = model;-@@ -390,6 +395,8 @@ export const stream = (model, context, options) => {+@@ -435,6 +440,8 @@ export const stream = (model, context, options) => {...(options?.timeoutMs !== undefined ? { timeout: options.timeoutMs } : {}),maxRetries: 0,};@@ -39,7 +39,7 @@ index 501971b2a..a72110c70 100644const response = await retryProviderRequest(() => client.beta.messages.create(params, requestOptions).asResponse(), {maxRetries: options?.maxRetries,maxRetryDelayMs: options?.maxRetryDelayMs,-@@ -475,17 +482,50 @@ export const stream = (model, context, options) => {+@@ -520,17 +527,50 @@ export const stream = (model, context, options) => {output.content.push(block);stream.push({ type: "toolcall_start", contentIndex: output.content.length - 1, partial: output });}@@ -92,7 +92,7 @@ index 501971b2a..a72110c70 100644partial: output,});}-@@ -494,11 +534,11 @@ export const stream = (model, context, options) => {+@@ -539,11 +579,11 @@ export const stream = (model, context, options) => {const index = blocks.findIndex((b) => b.index === event.index);const block = blocks[index];if (block && block.type === "thinking") {@@ -106,7 +106,7 @@ index 501971b2a..a72110c70 100644partial: output,});}-@@ -507,12 +547,24 @@ export const stream = (model, context, options) => {+@@ -552,12 +592,24 @@ export const stream = (model, context, options) => {const index = blocks.findIndex((b) => b.index === event.index);const block = blocks[index];if (block && block.type === "toolCall") {@@ -133,7 +133,7 @@ index 501971b2a..a72110c70 100644partial: output,});}-@@ -522,7 +574,19 @@ export const stream = (model, context, options) => {+@@ -567,7 +619,19 @@ export const stream = (model, context, options) => {const block = blocks[index];if (block && block.type === "thinking") {block.thinkingSignature = block.thinkingSignature || "";@@ -154,7 +154,7 @@ index 501971b2a..a72110c70 100644}}}-@@ -559,6 +623,12 @@ export const stream = (model, context, options) => {+@@ -604,6 +668,12 @@ export const stream = (model, context, options) => {partial: output,});}@@ -167,7 +167,7 @@ index 501971b2a..a72110c70 100644}}else if (event.type === "message_delta") {-@@ -631,13 +701,18 @@ export const stream = (model, context, options) => {+@@ -676,13 +746,18 @@ export const stream = (model, context, options) => {stream.end();}catch (error) {@@ -187,16 +187,16 @@ index 501971b2a..a72110c70 100644stream.push({ type: "error", reason: output.stopReason, error: output });stream.end();}-@@ -665,7 +740,7 @@ function mapThinkingLevelToEffort(model, level) {+@@ -710,7 +785,7 @@ function mapThinkingLevelToEffort(model, level) {return "high";}}-export const streamSimple = (model, context, options) => {+export const streamSimple = (model, context, options) => withLocalRequestErrors(model, options, () => {- assertRequestAuth(model.provider, options?.apiKey, options?.headers);- const base = {- ...buildBaseOptions(model, context, options, options?.apiKey),-@@ -697,7 +772,7 @@ export const streamSimple = (model, context, options) => {+ if (!getAnthropicFederation(model, options?.apiKey, options?.headers, options?.env)) {+ assertRequestAuth(model.provider, options?.apiKey, options?.headers);+ }+@@ -744,7 +819,7 @@ export const streamSimple = (model, context, options) => {thinkingEnabled: true,thinkingBudgetTokens: Math.min(adjusted.thinkingBudget, Math.max(0, maxTokens - 1024)),});@@ -205,7 +205,7 @@ index 501971b2a..a72110c70 100644function isOAuthToken(apiKey) {return apiKey.includes("sk-ant-oat");}-@@ -874,6 +949,15 @@ function buildParams(model, context, isOAuthToken, options) {+@@ -936,6 +1011,15 @@ function buildParams(model, context, isOAuthToken, options) {params.tools = convertTools(tools, isOAuthToken, compat.supportsEagerToolInputStreaming, compat.supportsStrictTools, toolCacheControl);}}@@ -221,7 +221,7 @@ index 501971b2a..a72110c70 100644// Managed effort models always use adaptive thinking so prefix mismatches can// be dropped instead of surfacing as persistent 400 responses.if (model.compat?.supportsMidConvoEffort === true) {-@@ -1078,6 +1162,15 @@ function convertMessages(transformedMessages, isOAuthToken, cacheControl, allowE+@@ -1140,6 +1224,15 @@ function convertMessages(transformedMessages, isOAuthToken, cacheControl, allowEinput: block.arguments ?? {},});}@@ -238,7 +238,7 @@ index 501971b2a..a72110c70 100644if (blocks.length === 0)continue;diff --git a/dist/api/azure-openai-responses.js b/dist/api/azure-openai-responses.js-index dc2d8f9be..e43cc048c 100644+index dc2d8f9be2f47dc73dde758c630fe12dd7749d5d..e43cc048c4bb6fcb7c3a82d27d14843cd1819ffd 100644--- a/dist/api/azure-openai-responses.js+++ b/dist/api/azure-openai-responses.js@@ -1,3 +1,5 @@@@ -343,7 +343,7 @@ index dc2d8f9be..e43cc048c 100644Object.assign(params, model.samplingParams, options?.samplingParams);return params;diff --git a/dist/api/mistral-conversations.js b/dist/api/mistral-conversations.js-index fbcc5e25e..92b07a1a1 100644+index fbcc5e25ee6752a9c5461b41fa8544a090a17b3f..92b07a1a107a9e0993bc9872d685279ccd921139 100644--- a/dist/api/mistral-conversations.js+++ b/dist/api/mistral-conversations.js@@ -658,6 +658,9 @@ function toChatMessages(messages, supportsImages) {@@ -357,7 +357,7 @@ index fbcc5e25e..92b07a1a1 100644id: block.id,type: "function",diff --git a/dist/api/openai-codex-responses.js b/dist/api/openai-codex-responses.js-index 40014b3b7..f8b215d3a 100644+index 40014b3b7eacb3a8e5e43daac2cec6446e8810c2..f8b215d3aec7b5124c4f9c5fa2fe5a1f0886015d 100644--- a/dist/api/openai-codex-responses.js+++ b/dist/api/openai-codex-responses.js@@ -411,6 +411,12 @@ function buildRequestBody(model, context, options, cacheSessionId, grammarToolIn@@ -374,7 +374,7 @@ index 40014b3b7..f8b215d3a 100644const effort = options.reasoningEffort === "none"? model.thinkingLevelMap?.off === undefineddiff --git a/dist/api/openai-completions.js b/dist/api/openai-completions.js-index eecd83c75..2390122f7 100644+index eecd83c753e3b758b8e44628f560b862f8252839..2390122f72d7a6f04a9e1e93b96f885392b91d5e 100644--- a/dist/api/openai-completions.js+++ b/dist/api/openai-completions.js@@ -1041,21 +1041,27 @@ export function convertMessages(model, context, compat, options) {@@ -473,7 +473,7 @@ index eecd83c75..2390122f7 100644openRouterRouting: model.compat.openRouterRouting ?? {},vercelGatewayRouting: model.compat.vercelGatewayRouting ?? detected.vercelGatewayRouting,diff --git a/dist/api/openai-responses-shared.js b/dist/api/openai-responses-shared.js-index 3e3b48a9e..7bd0d1498 100644+index f413fe5f2a1abcac39c38bbd4a77b38c349a5918..af7832b03b722013d7fcbc01423d6b36dd8c146b 100644--- a/dist/api/openai-responses-shared.js+++ b/dist/api/openai-responses-shared.js@@ -1,3 +1,4 @@@@ -503,7 +503,7 @@ index 3e3b48a9e..7bd0d1498 100644else if (block.type === "toolCall") {const toolCall = block;const [callId, itemIdRaw] = toolCall.id.split("|");-@@ -405,6 +414,28 @@ export async function processResponsesStream(openaiStream, output, stream, model+@@ -406,6 +415,28 @@ export async function processResponsesStream(openaiStream, output, stream, modelstream.push({ type: "toolcall_start", contentIndex: slot.contentIndex, partial: output });return slot;}@@ -532,7 +532,7 @@ index 3e3b48a9e..7bd0d1498 100644return undefined;};const getOrCreateSlot = (outputIndex, item) => {-@@ -486,11 +517,11 @@ export async function processResponsesStream(openaiStream, output, stream, model+@@ -487,11 +518,11 @@ export async function processResponsesStream(openaiStream, output, stream, modelconst slot = getSlot(event.output_index, "thinking");if (!slot)continue;@@ -546,7 +546,7 @@ index 3e3b48a9e..7bd0d1498 100644partial: output,});}-@@ -510,11 +541,11 @@ export async function processResponsesStream(openaiStream, output, stream, model+@@ -511,11 +542,11 @@ export async function processResponsesStream(openaiStream, output, stream, modelconst slot = getSlot(event.output_index, "thinking");if (!slot)continue;@@ -560,7 +560,7 @@ index 3e3b48a9e..7bd0d1498 100644partial: output,});}-@@ -522,23 +553,44 @@ export async function processResponsesStream(openaiStream, output, stream, model+@@ -523,23 +554,44 @@ export async function processResponsesStream(openaiStream, output, stream, modelconst slot = getSlot(event.output_index, "text");if (!slot)continue;@@ -609,7 +609,7 @@ index 3e3b48a9e..7bd0d1498 100644partial: output,});}-@@ -546,9 +598,9 @@ export async function processResponsesStream(openaiStream, output, stream, model+@@ -547,9 +599,9 @@ export async function processResponsesStream(openaiStream, output, stream, modelconst slot = getSlot(event.output_index, "toolCall");if (!slot || slot.block.partialJson === undefined)continue;@@ -621,7 +621,7 @@ index 3e3b48a9e..7bd0d1498 100644}else if (event.type === "response.function_call_arguments.done") {const slot = getSlot(event.output_index, "toolCall");-@@ -634,9 +686,25 @@ export async function processResponsesStream(openaiStream, output, stream, model+@@ -635,9 +687,25 @@ export async function processResponsesStream(openaiStream, output, stream, model});outputSlots.delete(event.output_index);}@@ -648,7 +648,7 @@ index 3e3b48a9e..7bd0d1498 100644else if (event.type === "error") {throw new Error(`Error Code ${event.code}: ${event.message}` || "Unknown error");diff --git a/dist/api/openai-responses.js b/dist/api/openai-responses.js-index 4d58c9772..c928c3f64 100644+index 4d58c9772b49f0d40e31d42c251a6d993a4a673f..c928c3f640a0b58941ebfc509171ec1984be56ba 100644--- a/dist/api/openai-responses.js+++ b/dist/api/openai-responses.js@@ -1,3 +1,5 @@@@ -751,7 +751,7 @@ index 4d58c9772..c928c3f64 100644Object.assign(params, model.samplingParams, options?.samplingParams);return params;diff --git a/dist/api/simple-options.js b/dist/api/simple-options.js-index da0fc83be..d56ef2ab9 100644+index da0fc83be3031326465b7dc1c53030a0d184517a..d56ef2ab9d76579b6b335c1083da94f1a84e8e93 100644--- a/dist/api/simple-options.js+++ b/dist/api/simple-options.js@@ -4,7 +4,7 @@ const MIN_MAX_TOKENS = 1;@@ -764,10 +764,10 @@ index da0fc83be..d56ef2ab9 100644}export function buildBaseOptions(model, context, options, apiKey) {diff --git a/dist/auth/oauth/anthropic.js b/dist/auth/oauth/anthropic.js-index 94c8f0035..e5b6f72dd 100644+index e136a751e45d059b721257f829f418a601ce3243..0d35358ce444ff32278521cf2b37997ada17f9d9 100644--- a/dist/auth/oauth/anthropic.js+++ b/dist/auth/oauth/anthropic.js-@@ -61,21 +61,90 @@ function formatErrorDetails(error) {+@@ -64,21 +64,90 @@ function formatErrorDetails(error) {}return String(error);}@@ -871,7 +871,7 @@ index 94c8f0035..e5b6f72dd 100644}async function exchangeAuthorizationCode(code, state, verifier, redirectUri, signal) {let responseBody;-@@ -90,6 +159,8 @@ async function exchangeAuthorizationCode(code, state, verifier, redirectUri, sig+@@ -93,6 +162,8 @@ async function exchangeAuthorizationCode(code, state, verifier, redirectUri, sig}, signal);}catch (error) {@@ -880,7 +880,7 @@ index 94c8f0035..e5b6f72dd 100644throw new Error(`Token exchange request failed. url=${TOKEN_URL}; redirect_uri=${redirectUri}; response_type=authorization_code; details=${formatErrorDetails(error)}`);}let tokenData;-@@ -97,7 +168,7 @@ async function exchangeAuthorizationCode(code, state, verifier, redirectUri, sig+@@ -100,7 +171,7 @@ async function exchangeAuthorizationCode(code, state, verifier, redirectUri, sigtokenData = JSON.parse(responseBody);}catch (error) {@@ -889,7 +889,7 @@ index 94c8f0035..e5b6f72dd 100644}return {type: "oauth",-@@ -171,6 +242,8 @@ async function refreshAnthropicToken(refreshToken, signal) {+@@ -205,6 +276,8 @@ async function refreshAnthropicToken(refreshToken, signal) {}, signal);}catch (error) {@@ -898,7 +898,7 @@ index 94c8f0035..e5b6f72dd 100644throw new Error(`Anthropic token refresh request failed. url=${TOKEN_URL}; details=${formatErrorDetails(error)}`);}let data;-@@ -178,7 +251,7 @@ async function refreshAnthropicToken(refreshToken, signal) {+@@ -212,7 +285,7 @@ async function refreshAnthropicToken(refreshToken, signal) {data = JSON.parse(responseBody);}catch (error) {@@ -908,7 +908,7 @@ index 94c8f0035..e5b6f72dd 100644return {type: "oauth",diff --git a/dist/index.d.ts b/dist/index.d.ts-index 75c0d7ba7..b0bf6975c 100644+index 75c0d7ba79dbf893724a302829011bc0f8ded282..b0bf6975cb155df67e7cad59e4c65d751f47ec8b 100644--- a/dist/index.d.ts+++ b/dist/index.d.ts@@ -33,4 +33,7 @@ export * from "./utils/transcript.ts";@@ -921,7 +921,7 @@ index 75c0d7ba7..b0bf6975c 100644//# sourceMappingURL=index.d.ts.map\ No newline at end of filediff --git a/dist/index.js b/dist/index.js-index 4fafddad7..2e4ed41e5 100644+index 4fafddad713ac5811fe2b1dfea629b4b8f6627e1..2e4ed41e548807b836625b35ba753a8422aea160 100644--- a/dist/index.js+++ b/dist/index.js@@ -20,4 +20,6 @@ export * from "./utils/transcript.js";@@ -933,7 +933,7 @@ index 4fafddad7..2e4ed41e5 100644//# sourceMappingURL=index.js.map\ No newline at end of filediff --git a/dist/types.d.ts b/dist/types.d.ts-index 68aa0553d..d6d73b0ca 100644+index 68aa0553de03aab4f7a47084995732f83ae4de00..d6d73b0caf995a5bc0b40456890d499dd39b625b 100644--- a/dist/types.d.ts+++ b/dist/types.d.ts@@ -286,6 +286,30 @@ export interface ToolCall {@@ -1019,7 +1019,7 @@ index 68aa0553d..d6d73b0ca 100644* Maps pi thinking levels to provider/model-specific values.* Missing keys use provider defaults. null marks a level as unsupported.diff --git a/dist/utils/assistant-message-frame.d.ts b/dist/utils/assistant-message-frame.d.ts-index 08207197a..0584f6898 100644+index 08207197acab532d0f5f596363700a2d15a687d8..0584f6898e1d842c4414869b9080505b63c3a7b7 100644--- a/dist/utils/assistant-message-frame.d.ts+++ b/dist/utils/assistant-message-frame.d.ts@@ -1,4 +1,4 @@@@ -1041,7 +1041,7 @@ index 08207197a..0584f6898 100644/*** Encodes one assistant stream. `partial` remains a shared live accumulator;diff --git a/dist/utils/assistant-message-frame.js b/dist/utils/assistant-message-frame.js-index c0e00197b..a86f5939a 100644+index c0e00197b2bdd4c815106daa036d844c07aca800..a86f5939accd25110d7a4d1e0d268646691d321d 100644--- a/dist/utils/assistant-message-frame.js+++ b/dist/utils/assistant-message-frame.js@@ -1,15 +1,30 @@@@ -1196,7 +1196,7 @@ index c0e00197b..a86f5939a 100644if (frame.content.type !== "text") {throw new Error(`text_start frame contains ${frame.content.type} content`);diff --git a/dist/utils/estimate.d.ts b/dist/utils/estimate.d.ts-index 6dcca6eff..5ccaaf235 100644+index 6dcca6eff16b95b83e047a6e27b65d9d7694bf2c..5ccaaf2358a0afeea3ce354e5799255ae8508f3d 100644--- a/dist/utils/estimate.d.ts+++ b/dist/utils/estimate.d.ts@@ -1,4 +1,4 @@@@ -1217,7 +1217,7 @@ index 6dcca6eff..5ccaaf235 100644//# sourceMappingURL=estimate.d.ts.map\ No newline at end of filediff --git a/dist/utils/estimate.js b/dist/utils/estimate.js-index d04ff22cb..28564cc73 100644+index d04ff22cbe8d7357404b938e228b8e3a2dbdcb1d..28564cc73798163f7590290123b7476573d5bee5 100644--- a/dist/utils/estimate.js+++ b/dist/utils/estimate.js@@ -1,95 +1,114 @@@@ -1392,7 +1392,7 @@ index d04ff22cb..28564cc73 100644\ No newline at end of filediff --git a/dist/utils/hosted-search.d.ts b/dist/utils/hosted-search.d.tsnew file mode 100644-index 000000000..a76ae5269+index 0000000000000000000000000000000000000000..a76ae5269313931b8476e1f153e76792875ad54c--- /dev/null+++ b/dist/utils/hosted-search.d.ts@@ -0,0 +1,10 @@@@ -1408,7 +1408,7 @@ index 000000000..a76ae5269+export declare function validateHostedSearchMessages(messages: readonly Message[]): void;diff --git a/dist/utils/hosted-search.js b/dist/utils/hosted-search.jsnew file mode 100644-index 000000000..b98cb8d12+index 0000000000000000000000000000000000000000..b98cb8d128310273014e4490e9c26144f45b56af--- /dev/null+++ b/dist/utils/hosted-search.js@@ -0,0 +1,97 @@@@ -1511,7 +1511,7 @@ index 000000000..b98cb8d12+}diff --git a/dist/utils/local-request-error.d.ts b/dist/utils/local-request-error.d.tsnew file mode 100644-index 000000000..a72f65b33+index 0000000000000000000000000000000000000000..a72f65b33c64b89f118a59bd286e62624711fd90--- /dev/null+++ b/dist/utils/local-request-error.d.ts@@ -0,0 +1,15 @@@@ -1532,7 +1532,7 @@ index 000000000..a72f65b33+export declare function prepareLocalRequest<T>(phase: LocalRequestErrorPhase, prepare: () => T): T;diff --git a/dist/utils/local-request-error.js b/dist/utils/local-request-error.jsnew file mode 100644-index 000000000..4d276ddc8+index 0000000000000000000000000000000000000000..4d276ddc8caee98dfeeeeaa9bcd234ad63dc414b--- /dev/null+++ b/dist/utils/local-request-error.js@@ -0,0 +1,38 @@@@ -1576,7 +1576,7 @@ index 000000000..4d276ddc8+}diff --git a/dist/utils/local-request-stream.d.ts b/dist/utils/local-request-stream.d.tsnew file mode 100644-index 000000000..879b78cbe+index 0000000000000000000000000000000000000000..879b78cbecb0cc2c4322049ed2c7d61f77be9375--- /dev/null+++ b/dist/utils/local-request-stream.d.ts@@ -0,0 +1,3 @@@@ -1585,7 +1585,7 @@ index 000000000..879b78cbe+export declare function withLocalRequestErrors(model: Model<Api>, options: { signal?: AbortSignal } | undefined, prepare: () => AssistantMessageEventStream): AssistantMessageEventStream;diff --git a/dist/utils/local-request-stream.js b/dist/utils/local-request-stream.jsnew file mode 100644-index 000000000..5c63b882a+index 0000000000000000000000000000000000000000..5c63b882ae4cb618e964c5d2ce8d3c18e0fe4688--- /dev/null+++ b/dist/utils/local-request-stream.js@@ -0,0 +1,24 @@diff --git a/patches/@[email protected] b/patches/@[email protected]similarity index 95%rename from patches/@[email protected]rename to patches/@[email protected]index f755032b6..6ca162d5b 100644--- a/patches/@[email protected]+++ b/patches/@[email protected]@@ -1,8 +1,8 @@diff --git a/dist/core/agent-session.js b/dist/core/agent-session.js-index 07af8cf3c..b98c7f38c 100644+index 1da213f5fb33ff8d0e98ed044a1844c97463bcd3..a447789cfc1782cd7a0aaa96c2fc92b03d944ce6 100644--- a/dist/core/agent-session.js+++ b/dist/core/agent-session.js-@@ -67,10 +67,10 @@ function withoutDeletedHeaders(headers) {+@@ -68,10 +68,10 @@ function withoutDeletedHeaders(headers) {? Object.fromEntries(Object.entries(headers).filter((entry) => entry[1] !== null)): undefined;}@@ -15,7 +15,7 @@ index 07af8cf3c..b98c7f38c 100644}return tokens;}-@@ -397,7 +397,7 @@ export class AgentSession {+@@ -406,7 +406,7 @@ export class AgentSession {_exceedsCompactionThreshold(model, projection) {if (model.contextWindow <= 0)return false;@@ -24,7 +24,7 @@ index 07af8cf3c..b98c7f38c 100644}async _compactBeforeNextAssistantResponse(context) {const projection = this.sessionManager.buildSessionProjection();-@@ -569,7 +569,7 @@ export class AgentSession {+@@ -578,7 +578,7 @@ export class AgentSession {entryId = manager.appendContextEdit(draft.targetId, draft.replacement);break;case "compaction": {@@ -33,7 +33,7 @@ index 07af8cf3c..b98c7f38c 100644entryId = manager.appendCompaction(draft.summary, draft.firstKeptEntryId, tokensBefore, draft.details, true, draft.usage);break;}-@@ -2110,7 +2110,7 @@ export class AgentSession {+@@ -2142,7 +2142,7 @@ export class AgentSession {}const settings = this.settingsManager.getCompactionSettings(model);const pathEntries = this.sessionManager.getBranch();@@ -42,7 +42,7 @@ index 07af8cf3c..b98c7f38c 100644if (!preparation) {// Check why we can't compactconst lastEntry = pathEntries[pathEntries.length - 1];-@@ -2167,7 +2167,7 @@ export class AgentSession {+@@ -2199,7 +2199,7 @@ export class AgentSession {this.sessionManager.appendCompaction(summary, firstKeptEntryId, tokensBefore, details, fromExtension, usage);const newEntries = this.sessionManager.getEntries();this._refreshFinalizedContext();@@ -51,7 +51,7 @@ index 07af8cf3c..b98c7f38c 100644// Get the saved compaction entry for the extension eventconst savedCompactionEntry = newEntries.find((e) => e.type === "compaction" && e.summary === summary);if (this._extensionRunner && savedCompactionEntry) {-@@ -2350,11 +2350,11 @@ export class AgentSession {+@@ -2382,11 +2382,11 @@ export class AgentSession {const hasContextEdits = projection.entries.some((entry) => entry.sourceEntry.type === "context_edit");const directContextTokens = assistantMessage.usage ? calculateContextTokens(assistantMessage.usage) : 0;if (hasContextEdits) {@@ -65,7 +65,7 @@ index 07af8cf3c..b98c7f38c 100644// Without provider usage, estimate.tokens is the pure message-size estimate.// Only usage-backed estimates need the stale pre-compaction check.if (estimate.lastUsageIndex !== null) {-@@ -2400,7 +2400,7 @@ export class AgentSession {+@@ -2432,7 +2432,7 @@ export class AgentSession {return false;}const pathEntries = this.sessionManager.getBranch();@@ -74,7 +74,7 @@ index 07af8cf3c..b98c7f38c 100644if (!preparation) {return false;}-@@ -2456,7 +2456,7 @@ export class AgentSession {+@@ -2488,7 +2488,7 @@ export class AgentSession {this.sessionManager.appendCompaction(summary, firstKeptEntryId, tokensBefore, details, fromExtension, usage);const newEntries = this.sessionManager.getEntries();this._refreshFinalizedContext();@@ -83,7 +83,7 @@ index 07af8cf3c..b98c7f38c 100644// Get the saved compaction entry for the extension eventconst savedCompactionEntry = newEntries.find((e) => e.type === "compaction" && e.summary === summary);if (this._extensionRunner && savedCompactionEntry) {-@@ -3383,7 +3383,7 @@ export class AgentSession {+@@ -3424,7 +3424,7 @@ export class AgentSession {if (!hasPostCompactionUsage)return { tokens: null, contextWindow, percent: null };}@@ -93,7 +93,7 @@ index 07af8cf3c..b98c7f38c 100644return {tokens: estimate.tokens,diff --git a/dist/core/bug-report.js b/dist/core/bug-report.js-index bc4af31b5..24a4f8e28 100644+index bc4af31b57f4a8696a68d4f2a529a26669955382..24a4f8e28624523112cac6c73464e93fb650f03a 100644--- a/dist/core/bug-report.js+++ b/dist/core/bug-report.js@@ -232,12 +232,12 @@ Numbered list, as specific as the transcript allows.@@ -121,7 +121,7 @@ index bc4af31b5..24a4f8e28 100644const prompt = [messages.length < options.messages.lengthdiff --git a/dist/core/compaction/branch-summarization.d.ts b/dist/core/compaction/branch-summarization.d.ts-index 12cb88ef5..6ff73567b 100644+index 12cb88ef5398b2365d5823597b7ccf063af567d6..6ff73567bbd5289b8b3f2fb82f923a5b5dc7860e 100644--- a/dist/core/compaction/branch-summarization.d.ts+++ b/dist/core/compaction/branch-summarization.d.ts@@ -6,7 +6,7 @@@@ -143,7 +143,7 @@ index 12cb88ef5..6ff73567b 100644* Generate a summary of abandoned branch entries.*diff --git a/dist/core/compaction/branch-summarization.js b/dist/core/compaction/branch-summarization.js-index 3f98859dd..b68f7adb1 100644+index 3f98859ddbc6de3b6075c08557fe396a61d1814e..b68f7adb1fd2145a6a0d1e74af05065d25c7925b 100644--- a/dist/core/compaction/branch-summarization.js+++ b/dist/core/compaction/branch-summarization.js@@ -95,7 +95,7 @@ function getMessageFromEntry(entry) {@@ -174,7 +174,7 @@ index 3f98859dd..b68f7adb1 100644return { summary: "No content to summarize" };}diff --git a/dist/core/compaction/compaction.d.ts b/dist/core/compaction/compaction.d.ts-index 04416da43..fdf79d9f2 100644+index 04416da43184fce4dc2fc33afeb920e2edddedc9..fdf79d9f200e78178aa46020341c7295024734a5 100644--- a/dist/core/compaction/compaction.d.ts+++ b/dist/core/compaction/compaction.d.ts@@ -6,7 +6,7 @@@@ -229,7 +229,7 @@ index 04416da43..fdf79d9f2 100644* Generate summaries for compaction using prepared data.* Returns CompactionResult - SessionManager adds uuid/parentUuid when saving.diff --git a/dist/core/compaction/compaction.js b/dist/core/compaction/compaction.js-index e4992e8d2..0797ad50e 100644+index e4992e8d2bff8aa6d2a4b044c9cf571d9e7f2fa2..0797ad50e267863a32adf27cbc2d7037e07dcb21 100644--- a/dist/core/compaction/compaction.js+++ b/dist/core/compaction/compaction.js@@ -4,8 +4,10 @@@@ -424,7 +424,7 @@ index e4992e8d2..0797ad50e 100644if (!firstKeptEntry?.id)return undefined;diff --git a/dist/core/compaction/utils.js b/dist/core/compaction/utils.js-index 92ee18e6a..ef4df7671 100644+index 92ee18e6a99c46dd5fc6b249a6cf670938f5f963..ef4df7671fc2a2b778ede9e485eb03fc49ebc3a8 100644--- a/dist/core/compaction/utils.js+++ b/dist/core/compaction/utils.js@@ -2,6 +2,7 @@diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 0d8d79462..6185de925 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -199,15 +199,9 @@ overrides:vite@5: '>=6.4.3 <7'patchedDependencies:- '@earendil-works/[email protected]':- hash: bbec87b73d8febb2bfc1441c900bb56488965269dcd1e858ec58e09365b09853- path: patches/@[email protected]- '@earendil-works/[email protected]':- hash: c9e66480f4eefd4a5d3ac998d3b65bf761fb22a17a238cb44c76d31448454ec4- path: patches/@[email protected]- '@earendil-works/[email protected]':- hash: 0e05051778ef4ffca9bac7ec68cae64f1d659d4b8640eeeb1a121e0f620a6abe- path: patches/@[email protected]+ '@earendil-works/[email protected]': 02de513ae53cf7f1e92d0cfc7fce07cf880d31195f5ec621d2f2197ead92a9da+ '@earendil-works/[email protected]': 7b666ab69d8e8a12a7d02550e98a3a0020f38d7046da6dc82b237adf176475e3+ '@earendil-works/[email protected]': 2d46470684b572b37bba57cf3cec31d81cf7747be163812b74563c8be8a95da3importers:@@ -227,17 +221,17 @@ importers:version: 1.2.9electron-updater:specifier: ^6.8.9- version: 6.8.9+ version: 6.8.9([email protected])transcribe-cpp:specifier: 0.2.2version: 0.2.2devDependencies:'@earendil-works/pi-ai':- specifier: 0.99.1- version: 0.99.1(patch_hash=c9e66480f4eefd4a5d3ac998d3b65bf761fb22a17a238cb44c76d31448454ec4)(@aws-sdk/[email protected])(@smithy/[email protected])([email protected])([email protected])([email protected])+ specifier: 1.0.0+ version: 1.0.0(patch_hash=7b666ab69d8e8a12a7d02550e98a3a0020f38d7046da6dc82b237adf176475e3)(@aws-sdk/[email protected])(@smithy/[email protected])([email protected])([email protected])([email protected])([email protected])'@earendil-works/pi-mcp':- specifier: 0.99.1- version: 0.99.1+ specifier: 1.0.0+ version: 1.0.0'@pi-desktop/agent-host':specifier: workspace:*version: link:../../packages/agent-host@@ -279,19 +273,19 @@ importers:version: 8.18.1'@vitejs/plugin-react':specifier: ^4.6.0- version: 4.7.0([email protected](@types/[email protected])([email protected])([email protected])([email protected]))+ version: 4.7.0([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected]))dompurify:specifier: '>=3.4.13 <4'version: 3.4.13electron:specifier: ^43.4.1- version: 43.6.0+ version: 43.6.0([email protected])electron-builder:specifier: ^26.15.3- version: 26.15.3([email protected])+ version: 26.15.3([email protected])([email protected])electron-vite:specifier: ^4.0.0- version: 4.0.1([email protected](@types/[email protected])([email protected])([email protected])([email protected]))+ version: 4.0.1([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected]))i18next:specifier: ^26.3.6version: 26.3.6([email protected])@@ -318,7 +312,7 @@ importers:version: 15.7.4([email protected]([email protected]))([email protected]([email protected]))([email protected])([email protected])react-markdown:specifier: ^10.1.0- version: 10.1.0(@types/[email protected])([email protected])rehype-katex:specifier: ^7.0.1version: 7.0.1@@ -330,13 +324,13 @@ importers:version: 6.0.0remark-gfm:specifier: ^4.0.1- version: 4.0.1+ version: 4.0.1([email protected])remark-math:specifier: ^6.0.0- version: 6.0.0+ version: 6.0.0([email protected])remark-parse:specifier: ^11.0.0- version: 11.0.0+ version: 11.0.0([email protected])shiki:specifier: ^4.4.3version: 4.4.3@@ -425,14 +419,14 @@ importers:packages/agent-runtime:dependencies:'@earendil-works/pi-agent-core':- specifier: 0.99.1- version: 0.99.1(patch_hash=bbec87b73d8febb2bfc1441c900bb56488965269dcd1e858ec58e09365b09853)(@aws-sdk/[email protected])(@smithy/[email protected])([email protected])([email protected])([email protected])+ specifier: 1.0.0+ version: 1.0.0(patch_hash=02de513ae53cf7f1e92d0cfc7fce07cf880d31195f5ec621d2f2197ead92a9da)(@aws-sdk/[email protected])(@smithy/[email protected])([email protected])([email protected])([email protected])([email protected])'@earendil-works/pi-ai':- specifier: 0.99.1- version: 0.99.1(patch_hash=c9e66480f4eefd4a5d3ac998d3b65bf761fb22a17a238cb44c76d31448454ec4)(@aws-sdk/[email protected])(@smithy/[email protected])([email protected])([email protected])([email protected])+ specifier: 1.0.0+ version: 1.0.0(patch_hash=7b666ab69d8e8a12a7d02550e98a3a0020f38d7046da6dc82b237adf176475e3)(@aws-sdk/[email protected])(@smithy/[email protected])([email protected])([email protected])([email protected])([email protected])'@earendil-works/pi-coding-agent':- specifier: 0.99.1- version: 0.99.1(patch_hash=0e05051778ef4ffca9bac7ec68cae64f1d659d4b8640eeeb1a121e0f620a6abe)(@aws-sdk/[email protected])(@smithy/[email protected])([email protected])([email protected])+ specifier: 1.0.0+ version: 1.0.0(patch_hash=2d46470684b572b37bba57cf3cec31d81cf7747be163812b74563c8be8a95da3)(@aws-sdk/[email protected])(@smithy/[email protected])([email protected])([email protected])([email protected])'@pi-desktop/shared':specifier: workspace:*version: link:../shared@@ -574,7 +568,7 @@ importers:version: 5.9.3vitest:specifier: ^3.2.1- version: 3.2.7(@types/[email protected])(@types/[email protected])([email protected])([email protected])([email protected])+ version: 3.2.7(@types/[email protected])(@types/[email protected])([email protected])([email protected])([email protected])([email protected])optionalDependencies:'@huggingface/hub':specifier: 2.15.0@@ -944,38 +938,38 @@ packages:search-insights:optional: true- '@earendil-works/[email protected]':- resolution: {integrity: sha512-4xyn0IBzJ+Xu/iOGi2hjXJGAR61QEhEWZsIqTDqr+GmItdquYwBO5jYFnqGiBaTqlY12/EpM7QHoEKSHbyvOug==}+ '@earendil-works/[email protected]':+ resolution: {integrity: sha512-BIfWfrByM0pKq6tfKYXuwx0ed2CvaqIM3EDA7Dps+fP+d3CiPWdlHi1cDsJC05llqKJoRz5//G0hz0yQwwjISQ==}engines: {node: '>=22.19.0'}- '@earendil-works/[email protected]':- resolution: {integrity: sha512-zywvWnj5FujeuFI/x/CJHwwxhcLIQgjqseTA+bQgX4O8gJTcgjRd/I8SZnQDqJvxC9QcV12ujiGLviv6EgwcCg==}+ '@earendil-works/[email protected]':+ resolution: {integrity: sha512-bHFONjtEBDqiV+g1DmmtkSlfAaqHELr+XO+6I5Nah4gswwZrLJO4yZB/JjsnlI4AKWTayBLfgS6DCbeBBz9e2Q==}engines: {node: '>=22.19.0'}- '@earendil-works/[email protected]':- resolution: {integrity: sha512-4nV9JKc94iPX8bwdGPc2nTuVPKIPsffhnp3WoN9NYCNqbtoOF8LhYcIs/+Sn/alroqJK/5QRu6/Z6Ck+n0hyBA==}+ '@earendil-works/[email protected]':+ resolution: {integrity: sha512-3/W1vdDaVtpeMd23ElvJC12HLA5yS/BGqqcXF+0SK082dN7cbgNcCwguTBRBC258Ke8SzSvUW1B75iAf8w8IxA==}engines: {node: '>=22.19.0'}hasBin: true- '@earendil-works/[email protected]':- resolution: {integrity: sha512-oh8TMsBI3SWTN3xTQtX8u5n+BKhnVXcFagroWumfn6/WWfBnDYL/LmeQtjLb83WRTb9rcu+ZdK8rFa4vggvCJg==}+ '@earendil-works/[email protected]':+ resolution: {integrity: sha512-LPpFI4+T9NzDnhBDs15izWAolaoM8xnwqdziRd6Zx8BQeoEPvzefD2vMMzSyF0rOtq34TfQqkZ0ki16f6cGdMg==}engines: {node: '>=22.19.0'}- '@earendil-works/[email protected]':- resolution: {integrity: sha512-cWUrTOqA5M73cOYMgsh9PlhDrsBhavd+n5kVY6F7BGbGl1RjqCteVCoeVMVqhngoGACVDyw1tbLjajL8l9jrHg==}+ '@earendil-works/[email protected]':+ resolution: {integrity: sha512-/FtbxoSQU/mEv1QnichJjRjqteqaIaMWxmhB4G367+MwZfX7/DI5B9YAg5lqbN7nztFskBEtUSZ+FlmMBECtMw==}engines: {node: '>=22.19.0'}hasBin: true- '@earendil-works/[email protected]':- resolution: {integrity: sha512-YCFGPkmDzLwQuIzwfbP6Vuk/g/ukKpZhwTpbcfzomuI1Fkiu6hHRkOGwAqsO3G8cTkZWkM8vmOkFJjStQNC4qA==}+ '@earendil-works/[email protected]':+ resolution: {integrity: sha512-rYra0aF5iPmJd+fsB+VBuqxWNABGJ3Iiyhg0CqIc/91ta2n7IvQmCp0Cac/YkUTNnvRsVZnjgAiBkRi6+ouWuw==}engines: {node: '>=22.19.0'}- '@earendil-works/[email protected]':- resolution: {integrity: sha512-9PBPjGk+TXRtuMianpqBbHBpYpyKusESF6rwdmgD0WTZSTUQXhcKEO0hAINRLuSwy4V7yPvXV+EVV0ONY7mbpQ==}+ '@earendil-works/[email protected]':+ resolution: {integrity: sha512-WjNBj5TYIiPZFQEz2WlULcDwPLaKwIlmsKjVeYM+LJSbnSp38kWsHUJysIDGnu23IcLbKoPtywsvYfUJCeZePA==}engines: {node: '>=22.19.0'}- '@earendil-works/[email protected]':- resolution: {integrity: sha512-gZp0Guat96Fr1AuC/xqVz5B2lulZakp/PxD1lXx3lSgBdjiqmwYhJbcQ0HRrGAfy0WtMGn9b05RJr5qJf7oIuw==}+ '@earendil-works/[email protected]':+ resolution: {integrity: sha512-JsT7kXnpZA2YOtQu6RyriyxEO0eJIzPyfiH09bH+OLN5+s18HYkwaUD/tBkjhnSfMu6/50CQPRYJagzSP6HdPw==}engines: {node: '>=22.19.0'}'@electron-internal/[email protected]':@@ -3222,10 +3216,6 @@ packages:resolution: {integrity: sha512-eAmLkjDjAFCVXg7A1unxHsLf961m6y17QFqXqAXGj/gVkKFrEICfStRfwUlGNfeCEjNRa32JEWOUTlYXPyyKvA==}engines: {node: '>=14'}- resolution: {integrity: sha512-WE9av4wKDZgRjBwgVUabocx8T6/7o3Ca1Fat46FXDhXVAFibzNadedcOXrdgd1Kzmk8tsk/9ZH89Wyf/SqeZ3A==}- engines: {node: '>=18'}-resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==}engines: {node: '>= 0.4'}@@ -5147,20 +5137,20 @@ snapshots:'@babel/[email protected]': {}- '@babel/[email protected]':+ '@babel/[email protected]([email protected])':dependencies:'@babel/code-frame': 7.29.7'@babel/generator': 7.29.7'@babel/helper-compilation-targets': 7.29.7- '@babel/helper-module-transforms': 7.29.7(@babel/[email protected])+ '@babel/helper-module-transforms': 7.29.7(@babel/[email protected]([email protected]))([email protected])'@babel/helpers': 7.29.7'@babel/parser': 7.29.8'@babel/template': 7.29.7- '@babel/traverse': 7.29.7+ '@babel/traverse': 7.29.7([email protected])'@babel/types': 7.29.8'@jridgewell/remapping': 2.3.5convert-source-map: 2.0.0- debug: 4.4.3+ debug: 4.4.3([email protected])gensync: 1.0.0-beta.2json5: 2.2.3semver: 6.3.1@@ -5185,19 +5175,19 @@ snapshots:'@babel/[email protected]': {}- '@babel/[email protected]':+ '@babel/[email protected]([email protected])':dependencies:- '@babel/traverse': 7.29.7+ '@babel/traverse': 7.29.7([email protected])'@babel/types': 7.29.8transitivePeerDependencies:- supports-color- '@babel/[email protected](@babel/[email protected])':dependencies:- '@babel/core': 7.29.7- '@babel/helper-module-imports': 7.29.7+ '@babel/core': 7.29.7([email protected])+ '@babel/helper-module-imports': 7.29.7([email protected])'@babel/helper-validator-identifier': 7.29.7- '@babel/traverse': 7.29.7+ '@babel/traverse': 7.29.7([email protected])transitivePeerDependencies:- supports-color@@ -5222,19 +5212,19 @@ snapshots:dependencies:'@babel/types': 7.29.8- '@babel/[email protected](@babel/[email protected])':dependencies:- '@babel/core': 7.29.7+ '@babel/core': 7.29.7([email protected])'@babel/helper-plugin-utils': 7.29.7- '@babel/[email protected](@babel/[email protected])':dependencies:- '@babel/core': 7.29.7+ '@babel/core': 7.29.7([email protected])'@babel/helper-plugin-utils': 7.29.7- '@babel/[email protected](@babel/[email protected])':dependencies:- '@babel/core': 7.29.7+ '@babel/core': 7.29.7([email protected])'@babel/helper-plugin-utils': 7.29.7'@babel/[email protected]': {}@@ -5245,7 +5235,7 @@ snapshots:'@babel/parser': 7.29.8'@babel/types': 7.29.8- '@babel/[email protected]':+ '@babel/[email protected]([email protected])':dependencies:'@babel/code-frame': 7.29.7'@babel/generator': 7.29.7@@ -5253,7 +5243,7 @@ snapshots:'@babel/parser': 7.29.8'@babel/template': 7.29.7'@babel/types': 7.29.8- debug: 4.4.3+ debug: 4.4.3([email protected])transitivePeerDependencies:- supports-color@@ -5331,19 +5321,14 @@ snapshots:transitivePeerDependencies:- '@algolia/client-search'- '@earendil-works/[email protected]':+ '@earendil-works/[email protected]':dependencies:esbuild: 0.28.2- '@earendil-works/[email protected](patch_hash=bbec87b73d8febb2bfc1441c900bb56488965269dcd1e858ec58e09365b09853)(@aws-sdk/[email protected])(@smithy/[email protected])([email protected])([email protected])([email protected])':+ '@earendil-works/[email protected](patch_hash=02de513ae53cf7f1e92d0cfc7fce07cf880d31195f5ec621d2f2197ead92a9da)(@aws-sdk/[email protected])(@smithy/[email protected])([email protected])([email protected])([email protected])([email protected])':dependencies:- '@earendil-works/chord': 0.99.1- '@earendil-works/pi-ai': 0.99.1(patch_hash=c9e66480f4eefd4a5d3ac998d3b65bf761fb22a17a238cb44c76d31448454ec4)(@aws-sdk/[email protected])(@smithy/[email protected])([email protected])([email protected])([email protected])- '@earendil-works/pi-telemetry': 0.99.1- diff: 8.0.4- ignore: 7.0.8+ '@earendil-works/pi-ai': 1.0.0(patch_hash=7b666ab69d8e8a12a7d02550e98a3a0020f38d7046da6dc82b237adf176475e3)(@aws-sdk/[email protected])(@smithy/[email protected])([email protected])([email protected])([email protected])([email protected])typebox: 1.3.27- yaml: 2.9.0transitivePeerDependencies:- '@aws-sdk/credential-provider-node'- '@modelcontextprotocol/sdk'@@ -5357,15 +5342,15 @@ snapshots:- ws- zod- '@earendil-works/[email protected](patch_hash=c9e66480f4eefd4a5d3ac998d3b65bf761fb22a17a238cb44c76d31448454ec4)(@aws-sdk/[email protected])(@smithy/[email protected])([email protected])([email protected])([email protected])':+ '@earendil-works/[email protected](patch_hash=7b666ab69d8e8a12a7d02550e98a3a0020f38d7046da6dc82b237adf176475e3)(@aws-sdk/[email protected])(@smithy/[email protected])([email protected])([email protected])([email protected])([email protected])':dependencies:'@anthropic-ai/sdk': 0.124.0([email protected])'@aws-sdk/client-bedrock-runtime': 3.1127.0- '@earendil-works/pi-telemetry': 0.99.1- '@google/genai': 2.21.0+ '@earendil-works/pi-telemetry': 1.0.0+ '@google/genai': 2.21.0([email protected])'@smithy/node-http-handler': 4.12.1- http-proxy-agent: 9.1.0- https-proxy-agent: 9.1.0+ http-proxy-agent: 9.1.0([email protected])+ https-proxy-agent: 9.1.0([email protected])openai: 7.19.0(@aws-sdk/[email protected])(@smithy/[email protected])([email protected])([email protected])([email protected])partial-json: 0.1.7typebox: 1.3.27@@ -5382,15 +5367,15 @@ snapshots:- ws- zod- '@earendil-works/[email protected](patch_hash=c9e66480f4eefd4a5d3ac998d3b65bf761fb22a17a238cb44c76d31448454ec4)(@aws-sdk/[email protected])(@smithy/[email protected])([email protected])([email protected])([email protected])':+ '@earendil-works/[email protected](patch_hash=7b666ab69d8e8a12a7d02550e98a3a0020f38d7046da6dc82b237adf176475e3)(@aws-sdk/[email protected])(@smithy/[email protected])([email protected])([email protected])([email protected])([email protected])':dependencies:'@anthropic-ai/sdk': 0.124.0([email protected])'@aws-sdk/client-bedrock-runtime': 3.1127.0- '@earendil-works/pi-telemetry': 0.99.1- '@google/genai': 2.21.0+ '@earendil-works/pi-telemetry': 1.0.0+ '@google/genai': 2.21.0([email protected])'@smithy/node-http-handler': 4.12.1- http-proxy-agent: 9.1.0- https-proxy-agent: 9.1.0+ http-proxy-agent: 9.1.0([email protected])+ https-proxy-agent: 9.1.0([email protected])openai: 7.19.0(@aws-sdk/[email protected])(@smithy/[email protected])([email protected])([email protected])([email protected])partial-json: 0.1.7typebox: 1.3.27@@ -5407,18 +5392,18 @@ snapshots:- ws- zod- '@earendil-works/[email protected]':+ '@earendil-works/[email protected]':dependencies:quickjs-wasi: 3.6.2- '@earendil-works/[email protected](patch_hash=0e05051778ef4ffca9bac7ec68cae64f1d659d4b8640eeeb1a121e0f620a6abe)(@aws-sdk/[email protected])(@smithy/[email protected])([email protected])([email protected])':+ '@earendil-works/[email protected](patch_hash=2d46470684b572b37bba57cf3cec31d81cf7747be163812b74563c8be8a95da3)(@aws-sdk/[email protected])(@smithy/[email protected])([email protected])([email protected])([email protected])':dependencies:- '@earendil-works/chord': 0.99.1- '@earendil-works/pi-agent-core': 0.99.1(patch_hash=bbec87b73d8febb2bfc1441c900bb56488965269dcd1e858ec58e09365b09853)(@aws-sdk/[email protected])(@smithy/[email protected])([email protected])([email protected])([email protected])- '@earendil-works/pi-ai': 0.99.1(patch_hash=c9e66480f4eefd4a5d3ac998d3b65bf761fb22a17a238cb44c76d31448454ec4)(@aws-sdk/[email protected])(@smithy/[email protected])([email protected])([email protected])([email protected])- '@earendil-works/pi-codemode': 0.99.1- '@earendil-works/pi-mcp': 0.99.1- '@earendil-works/pi-tui': 0.99.1+ '@earendil-works/chord': 1.0.0+ '@earendil-works/pi-agent-core': 1.0.0(patch_hash=02de513ae53cf7f1e92d0cfc7fce07cf880d31195f5ec621d2f2197ead92a9da)(@aws-sdk/[email protected])(@smithy/[email protected])([email protected])([email protected])([email protected])([email protected])+ '@earendil-works/pi-ai': 1.0.0(patch_hash=7b666ab69d8e8a12a7d02550e98a3a0020f38d7046da6dc82b237adf176475e3)(@aws-sdk/[email protected])(@smithy/[email protected])([email protected])([email protected])([email protected])([email protected])+ '@earendil-works/pi-codemode': 1.0.0+ '@earendil-works/pi-mcp': 1.0.0+ '@earendil-works/pi-tui': 1.0.0'@silvia-odwyer/photon-node': 0.3.4chalk: 6.0.0cross-spawn: 7.0.6@@ -5447,13 +5432,13 @@ snapshots:- ws- zod- '@earendil-works/[email protected]':+ '@earendil-works/[email protected]':dependencies:cross-spawn: 7.0.6- '@earendil-works/[email protected]': {}+ '@earendil-works/[email protected]': {}- '@earendil-works/[email protected]':+ '@earendil-works/[email protected]':dependencies:get-east-asian-width: 1.6.0marked: 18.0.11@@ -5472,45 +5457,45 @@ snapshots:fs-extra: 9.1.0minimist: 1.2.8- '@electron/[email protected]':+ '@electron/[email protected]([email protected])':dependencies:- debug: 4.4.3+ debug: 4.4.3([email protected])env-paths: 2.2.1fs-extra: 8.1.0got: 11.8.6progress: 2.0.3semver: 6.3.1- sumchecker: 3.0.1+ sumchecker: 3.0.1([email protected])optionalDependencies:global-agent: 3.0.0transitivePeerDependencies:- supports-color- '@electron/[email protected]':+ '@electron/[email protected]([email protected])':dependencies:- debug: 4.4.3+ debug: 4.4.3([email protected])env-paths: 3.0.0graceful-fs: 4.2.11progress: 2.0.3semver: 7.8.5- sumchecker: 3.0.1+ sumchecker: 3.0.1([email protected])optionalDependencies:undici: 7.29.0transitivePeerDependencies:- supports-color- '@electron/[email protected]':+ '@electron/[email protected]([email protected])':dependencies:- debug: 4.4.3+ debug: 4.4.3([email protected])fs-extra: 9.1.0promise-retry: 2.0.1transitivePeerDependencies:- supports-color- '@electron/[email protected]':+ '@electron/[email protected]([email protected])':dependencies:compare-version: 0.1.2- debug: 4.4.3+ debug: 4.4.3([email protected])fs-extra: 10.1.0isbinaryfile: 4.0.10minimist: 1.2.8@@ -5518,22 +5503,22 @@ snapshots:transitivePeerDependencies:- supports-color- '@electron/[email protected]':+ '@electron/[email protected]([email protected])':dependencies:'@malept/cross-spawn-promise': 2.0.0- debug: 4.4.3+ debug: 4.4.3([email protected])node-abi: 4.33.0node-api-version: 0.2.1node-gyp: 12.4.0- read-binary-file-arch: 1.0.6+ read-binary-file-arch: 1.0.6([email protected])transitivePeerDependencies:- supports-color- '@electron/[email protected]':+ '@electron/[email protected]([email protected])':dependencies:'@electron/asar': 3.4.1'@malept/cross-spawn-promise': 2.0.0- debug: 4.4.3+ debug: 4.4.3([email protected])dir-compare: 4.2.0fs-extra: 11.3.6minimatch: 9.0.9@@ -5541,10 +5526,10 @@ snapshots:transitivePeerDependencies:- supports-color- '@electron/[email protected]':+ '@electron/[email protected]([email protected])':dependencies:cross-dirname: 0.1.0- debug: 4.4.3+ debug: 4.4.3([email protected])fs-extra: 11.3.6minimist: 1.2.8postject: 1.0.0-alpha.6@@ -5786,9 +5771,9 @@ snapshots:'@esbuild/[email protected]':optional: true- '@google/[email protected]':+ '@google/[email protected]([email protected])':dependencies:- google-auth-library: 10.9.0+ google-auth-library: 10.9.0([email protected])p-retry: 4.6.2protobufjs: 7.6.5ws: 8.21.1@@ -5918,9 +5903,9 @@ snapshots:dependencies:cross-spawn: 7.0.6- '@malept/[email protected]':+ '@malept/[email protected]([email protected])':dependencies:- debug: 4.4.3+ debug: 4.4.3([email protected])fs-extra: 9.1.0lodash: 4.18.1tmp-promise: 3.0.3@@ -6498,11 +6483,11 @@ snapshots:d3-selection: 3.0.0d3-transition: 3.0.1([email protected])- '@vitejs/[email protected]([email protected](@types/[email protected])([email protected])([email protected])([email protected]))':+ '@vitejs/[email protected]([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected]))':dependencies:- '@babel/core': 7.29.7- '@babel/plugin-transform-react-jsx-self': 7.29.7(@babel/[email protected])- '@babel/plugin-transform-react-jsx-source': 7.29.7(@babel/[email protected])+ '@babel/core': 7.29.7([email protected])+ '@babel/plugin-transform-react-jsx-self': 7.29.7(@babel/[email protected]([email protected]))+ '@babel/plugin-transform-react-jsx-source': 7.29.7(@babel/[email protected]([email protected]))'@rolldown/pluginutils': 1.0.0-beta.27'@types/babel__core': 7.20.5react-refresh: 0.17.0@@ -6737,33 +6722,33 @@ snapshots:dependencies:color-convert: 2.0.1dependencies:'@electron/asar': 3.4.1'@electron/fuses': 1.8.0- '@electron/get': 3.1.0- '@electron/notarize': 2.5.0- '@electron/osx-sign': 1.3.3- '@electron/rebuild': 4.2.0- '@electron/universal': 2.0.3- '@malept/flatpak-bundler': 0.4.0+ '@electron/get': 3.1.0([email protected])+ '@electron/notarize': 2.5.0([email protected])+ '@electron/osx-sign': 1.3.3([email protected])+ '@electron/rebuild': 4.2.0([email protected])+ '@electron/universal': 2.0.3([email protected])+ '@malept/flatpak-bundler': 0.4.0([email protected])'@noble/hashes': 2.2.0'@peculiar/webcrypto': 1.7.1'@types/fs-extra': 9.0.13ajv: 8.20.0asn1js: 3.0.10async-exit-hook: 2.0.1- builder-util: 26.15.3- builder-util-runtime: 9.7.0+ builder-util: 26.15.3([email protected])+ builder-util-runtime: 9.7.0([email protected])chromium-pickle-js: 0.2.0ci-info: 4.3.1- debug: 4.4.3- dmg-builder: 26.15.3([email protected])+ debug: 4.4.3([email protected])+ dmg-builder: 26.15.3([email protected])([email protected])dotenv: 16.6.1dotenv-expand: 11.0.7ejs: 3.1.10- electron-builder-squirrel-windows: 26.15.3([email protected])- electron-publish: 26.15.3+ electron-builder-squirrel-windows: 26.15.3([email protected])([email protected])+ electron-publish: 26.15.3([email protected])fs-extra: 10.1.0hosted-git-info: 4.1.0isbinaryfile: 5.0.7@@ -6851,23 +6836,23 @@ snapshots:dependencies:- debug: 4.4.3+ debug: 4.4.3([email protected])sax: 1.6.0transitivePeerDependencies:- supports-colordependencies:'@types/debug': 4.1.13- builder-util-runtime: 9.7.0+ builder-util-runtime: 9.7.0([email protected])chalk: 4.1.2cross-spawn: 7.0.6- debug: 4.4.3+ debug: 4.4.3([email protected])fs-extra: 10.1.0- http-proxy-agent: 7.0.2- https-proxy-agent: 7.0.6+ http-proxy-agent: 7.0.2([email protected])+ https-proxy-agent: 7.0.6([email protected])js-yaml: 4.3.1sanitize-filename: 1.6.4source-map-support: 0.5.21@@ -7192,9 +7177,11 @@ snapshots:dependencies:ms: 2.1.3+ optionalDependencies:+ supports-color: 7.2.0dependencies:@@ -7246,10 +7233,10 @@ snapshots:minimatch: 3.1.5p-limit: 3.1.0dependencies:- app-builder-lib: 26.15.3([email protected])([email protected])- builder-util: 26.15.3+ builder-util: 26.15.3([email protected])fs-extra: 10.1.0js-yaml: 4.3.1transitivePeerDependencies:@@ -7284,23 +7271,23 @@ snapshots:dependencies:jake: 10.9.4dependencies:- app-builder-lib: 26.15.3([email protected])([email protected])- builder-util: 26.15.3- electron-winstaller: 5.4.0+ builder-util: 26.15.3([email protected])+ electron-winstaller: 5.4.0([email protected])transitivePeerDependencies:- dmg-builder- supports-colordependencies:- app-builder-lib: 26.15.3([email protected])([email protected])- builder-util: 26.15.3- builder-util-runtime: 9.7.0+ builder-util: 26.15.3([email protected])+ builder-util-runtime: 9.7.0([email protected])chalk: 4.1.2ci-info: 4.4.0- dmg-builder: 26.15.3([email protected])+ dmg-builder: 26.15.3([email protected])([email protected])fs-extra: 10.1.0lazy-val: 1.0.5simple-update-notifier: 2.0.0@@ -7309,12 +7296,12 @@ snapshots:- electron-builder-squirrel-windows- supports-colordependencies:'@types/fs-extra': 9.0.13aws4: 1.13.2- builder-util: 26.15.3- builder-util-runtime: 9.7.0+ builder-util: 26.15.3([email protected])+ builder-util-runtime: 9.7.0([email protected])chalk: 4.1.2form-data: 4.0.6fs-extra: 10.1.0@@ -7325,9 +7312,9 @@ snapshots:dependencies:- builder-util-runtime: 9.7.0+ builder-util-runtime: 9.7.0([email protected])fs-extra: 10.1.0js-yaml: 4.3.1lazy-val: 1.0.5@@ -7338,10 +7325,10 @@ snapshots:transitivePeerDependencies:- supports-color- [email protected]([email protected](@types/[email protected])([email protected])([email protected])([email protected])):+ [email protected]([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])):dependencies:- '@babel/core': 7.29.7- '@babel/plugin-transform-arrow-functions': 7.29.7(@babel/[email protected])+ '@babel/core': 7.29.7([email protected])+ '@babel/plugin-transform-arrow-functions': 7.29.7(@babel/[email protected]([email protected]))cac: 6.7.14esbuild: 0.25.12magic-string: 0.30.21@@ -7350,22 +7337,22 @@ snapshots:transitivePeerDependencies:- supports-colordependencies:'@electron/asar': 3.4.1- debug: 4.4.3+ debug: 4.4.3([email protected])fs-extra: 7.0.1lodash: 4.18.1temp: 0.9.4optionalDependencies:- '@electron/windows-sign': 1.2.2+ '@electron/windows-sign': 1.2.2([email protected])transitivePeerDependencies:- supports-colordependencies:'@electron-internal/extract-zip': 1.0.5- '@electron/get': 5.1.0+ '@electron/get': 5.1.0([email protected])'@types/node': 24.13.3transitivePeerDependencies:- supports-color@@ -7604,18 +7591,18 @@ snapshots:dependencies:extend: 3.0.2- https-proxy-agent: 7.0.6+ https-proxy-agent: 7.0.6([email protected])node-fetch: 3.3.2transitivePeerDependencies:- supports-colordependencies:- gaxios: 7.2.0- google-logging-utils: 1.2.0+ gaxios: 7.2.0([email protected])+ google-logging-utils: 1.1.3json-bigint: 1.0.0transitivePeerDependencies:- supports-color@@ -7676,12 +7663,12 @@ snapshots:gopd: 1.2.0optional: truedependencies:base64-js: 1.5.1ecdsa-sig-formatter: 1.0.11- gaxios: 7.2.0- gcp-metadata: 8.1.2+ gaxios: 7.2.0([email protected])+ gcp-metadata: 8.1.2([email protected])google-logging-utils: 1.1.3jws: 4.0.1transitivePeerDependencies:@@ -7689,8 +7676,6 @@ snapshots:- [email protected]: {}-@@ -7807,7 +7792,7 @@ snapshots:stringify-entities: 4.0.4zwitch: 2.0.4dependencies:'@types/estree': 1.0.9'@types/hast': 3.0.5@@ -7816,9 +7801,9 @@ snapshots:devlop: 1.1.0estree-util-is-identifier-name: 3.0.0hast-util-whitespace: 3.0.0- mdast-util-mdx-expression: 2.0.1- mdast-util-mdx-jsx: 3.2.0- mdast-util-mdxjs-esm: 2.0.1+ mdast-util-mdx-expression: 2.0.1([email protected])+ mdast-util-mdx-jsx: 3.2.0([email protected])+ mdast-util-mdxjs-esm: 2.0.1([email protected])property-information: 7.2.0space-separated-tokens: 2.0.2style-to-js: 1.1.21@@ -7878,17 +7863,17 @@ snapshots:dependencies:agent-base: 7.1.4- debug: 4.4.3+ debug: 4.4.3([email protected])transitivePeerDependencies:- supports-colordependencies:agent-base: 9.0.0- debug: 4.4.3+ debug: 4.4.3([email protected])proxy-agent-negotiate: 1.1.0transitivePeerDependencies:- kerberos@@ -7899,17 +7884,17 @@ snapshots:quick-lru: 5.1.1resolve-alpn: 1.2.1dependencies:agent-base: 7.1.4- debug: 4.4.3+ debug: 4.4.3([email protected])transitivePeerDependencies:- supports-colordependencies:agent-base: 9.0.0- debug: 4.4.3+ debug: 4.4.3([email protected])proxy-agent-negotiate: 1.1.0transitivePeerDependencies:- kerberos@@ -8170,14 +8155,14 @@ snapshots:unist-util-is: 6.0.1unist-util-visit-parents: 6.0.2dependencies:'@types/mdast': 4.0.4'@types/unist': 3.0.3decode-named-character-reference: 1.3.0devlop: 1.1.0mdast-util-to-string: 4.0.0- micromark: 4.0.2+ micromark: 4.0.2([email protected])micromark-util-decode-numeric-character-reference: 2.0.2micromark-util-decode-string: 2.0.1micromark-util-normalize-identifier: 2.0.1@@ -8195,79 +8180,79 @@ snapshots:mdast-util-find-and-replace: 3.0.2micromark-util-character: 2.1.1dependencies:'@types/mdast': 4.0.4devlop: 1.1.0- mdast-util-from-markdown: 2.0.3+ mdast-util-from-markdown: 2.0.3([email protected])mdast-util-to-markdown: 2.1.2micromark-util-normalize-identifier: 2.0.1transitivePeerDependencies:- supports-colordependencies:'@types/mdast': 4.0.4- mdast-util-from-markdown: 2.0.3+ mdast-util-from-markdown: 2.0.3([email protected])mdast-util-to-markdown: 2.1.2transitivePeerDependencies:- supports-colordependencies:'@types/mdast': 4.0.4devlop: 1.1.0markdown-table: 3.0.4- mdast-util-from-markdown: 2.0.3+ mdast-util-from-markdown: 2.0.3([email protected])mdast-util-to-markdown: 2.1.2transitivePeerDependencies:- supports-colordependencies:'@types/mdast': 4.0.4devlop: 1.1.0- mdast-util-from-markdown: 2.0.3+ mdast-util-from-markdown: 2.0.3([email protected])mdast-util-to-markdown: 2.1.2transitivePeerDependencies:- supports-colordependencies:- mdast-util-from-markdown: 2.0.3+ mdast-util-from-markdown: 2.0.3([email protected])mdast-util-gfm-autolink-literal: 2.0.1- mdast-util-gfm-footnote: 2.1.0- mdast-util-gfm-strikethrough: 2.0.0- mdast-util-gfm-table: 2.0.0- mdast-util-gfm-task-list-item: 2.0.0+ mdast-util-gfm-footnote: 2.1.0([email protected])+ mdast-util-gfm-strikethrough: 2.0.0([email protected])+ mdast-util-gfm-table: 2.0.0([email protected])+ mdast-util-gfm-task-list-item: 2.0.0([email protected])mdast-util-to-markdown: 2.1.2transitivePeerDependencies:- supports-colordependencies:'@types/hast': 3.0.5'@types/mdast': 4.0.4devlop: 1.1.0longest-streak: 3.1.0- mdast-util-from-markdown: 2.0.3+ mdast-util-from-markdown: 2.0.3([email protected])mdast-util-to-markdown: 2.1.2unist-util-remove-position: 5.0.0transitivePeerDependencies:- supports-colordependencies:'@types/estree-jsx': 1.0.5'@types/hast': 3.0.5'@types/mdast': 4.0.4devlop: 1.1.0- mdast-util-from-markdown: 2.0.3+ mdast-util-from-markdown: 2.0.3([email protected])mdast-util-to-markdown: 2.1.2transitivePeerDependencies:- supports-colordependencies:'@types/estree-jsx': 1.0.5'@types/hast': 3.0.5@@ -8275,7 +8260,7 @@ snapshots:'@types/unist': 3.0.3ccount: 2.0.1devlop: 1.1.0- mdast-util-from-markdown: 2.0.3+ mdast-util-from-markdown: 2.0.3([email protected])mdast-util-to-markdown: 2.1.2parse-entities: 4.0.2stringify-entities: 4.0.4@@ -8284,13 +8269,13 @@ snapshots:transitivePeerDependencies:- supports-colordependencies:'@types/estree-jsx': 1.0.5'@types/hast': 3.0.5'@types/mdast': 4.0.4devlop: 1.1.0- mdast-util-from-markdown: 2.0.3+ mdast-util-from-markdown: 2.0.3([email protected])mdast-util-to-markdown: 2.1.2transitivePeerDependencies:- supports-color@@ -8531,10 +8516,10 @@ snapshots:dependencies:'@types/debug': 4.1.13- debug: 4.4.3+ debug: 4.4.3([email protected])decode-named-character-reference: 1.3.0devlop: 1.1.0micromark-core-commonmark: 2.0.3@@ -8844,17 +8829,17 @@ snapshots:react-dom: 19.2.8([email protected])typescript: 5.9.3dependencies:'@types/hast': 3.0.5'@types/mdast': 4.0.4'@types/react': 19.2.18devlop: 1.1.0- hast-util-to-jsx-runtime: 2.3.6+ hast-util-to-jsx-runtime: 2.3.6([email protected])html-url-attributes: 3.0.1mdast-util-to-hast: 13.2.1react: 19.2.8- remark-parse: 11.0.0+ remark-parse: 11.0.0([email protected])remark-rehype: 11.1.2unified: 11.0.5unist-util-visit: 5.1.0@@ -8866,9 +8851,9 @@ snapshots:dependencies:- debug: 4.4.3+ debug: 4.4.3([email protected])transitivePeerDependencies:- supports-color@@ -8913,30 +8898,30 @@ snapshots:'@types/hast': 3.0.5hast-util-sanitize: 5.0.2dependencies:'@types/mdast': 4.0.4- mdast-util-gfm: 3.1.0+ mdast-util-gfm: 3.1.0([email protected])micromark-extension-gfm: 3.0.0- remark-parse: 11.0.0+ remark-parse: 11.0.0([email protected])remark-stringify: 11.0.0unified: 11.0.5transitivePeerDependencies:- supports-colordependencies:'@types/mdast': 4.0.4- mdast-util-math: 3.0.0+ mdast-util-math: 3.0.0([email protected])micromark-extension-math: 3.1.0unified: 11.0.5transitivePeerDependencies:- supports-colordependencies:'@types/mdast': 4.0.4- mdast-util-from-markdown: 2.0.3+ mdast-util-from-markdown: 2.0.3([email protected])micromark-util-types: 2.0.2unified: 11.0.5transitivePeerDependencies:@@ -9162,9 +9147,9 @@ snapshots:dependencies:- debug: 4.4.3+ debug: 4.4.3([email protected])transitivePeerDependencies:- supports-color@@ -9355,10 +9340,10 @@ snapshots:'@types/unist': 3.0.3vfile-message: 4.0.3- [email protected](@types/[email protected])([email protected])([email protected])([email protected]):+ [email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]):dependencies:cac: 6.7.14- debug: 4.4.3+ debug: 4.4.3([email protected])es-module-lexer: 1.7.0pathe: 2.0.3@@ -9459,7 +9444,7 @@ snapshots:- universal-cookie- yaml- [email protected](@types/[email protected])(@types/[email protected])([email protected])([email protected])([email protected]):+ [email protected](@types/[email protected])(@types/[email protected])([email protected])([email protected])([email protected])([email protected]):dependencies:'@types/chai': 5.2.3'@vitest/expect': 3.2.7@@ -9470,7 +9455,7 @@ snapshots:'@vitest/spy': 3.2.7'@vitest/utils': 3.2.7chai: 5.3.3- debug: 4.4.3+ debug: 4.4.3([email protected])expect-type: 1.4.0magic-string: 0.30.21pathe: 2.0.3@@ -9482,7 +9467,7 @@ snapshots:tinypool: 1.1.1tinyrainbow: 2.0.0- vite-node: 3.2.4(@types/[email protected])([email protected])([email protected])([email protected])+ vite-node: 3.2.4(@types/[email protected])([email protected])([email protected])([email protected])([email protected])why-is-node-running: 2.3.0optionalDependencies:'@types/debug': 4.1.13diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yamlindex c640706ed..c406fca42 100644--- a/pnpm-workspace.yaml+++ b/pnpm-workspace.yaml@@ -12,17 +12,6 @@ allowBuilds:# koffi (FFI of transcribe-cpp) loads the prebuilt @koromix/koffi-<platform># binary; its from-source install script was never approved and is not needed.koffi: false-# Drop this list once the pinned @earendil-works packages are older than-# pnpm's supply-chain age gate (packages published within the last day).-minimumReleaseAgeExclude:- - '@earendil-works/[email protected]'- - '@earendil-works/[email protected]'- - '@earendil-works/[email protected]'- - '@earendil-works/[email protected]'- - '@earendil-works/[email protected]'- - '@earendil-works/[email protected]'- - '@earendil-works/[email protected]'- - '@earendil-works/[email protected]'# Advisory fixes for transitives whose parents still resolve the vulnerable# version. Drop each one once its parent ships a release that resolves the# patched version on its own.@@ -50,13 +39,13 @@ overrides:# a major its parent has not declared. Verified against `docs:build` and# `docs:dev` (serves 200); drop it for vitepress 2 once that ships stable.vite@5: '>=6.4.3 <7'-patchedDependencies:- '@earendil-works/[email protected]': patches/@[email protected]- '@earendil-works/[email protected]': patches/@[email protected]- '@earendil-works/[email protected]': patches/@[email protected]# pnpm defaults to `lowest-direct`, which makes a plain `pnpm update` resolve# every range to its floor — silently downgrading dependencies instead of# refreshing them. Pin the intent: `pnpm update` means "newest within range".+patchedDependencies:+ '@earendil-works/[email protected]': patches/@[email protected]+ '@earendil-works/[email protected]': patches/@[email protected]+ '@earendil-works/[email protected]': patches/@[email protected]resolutionMode: highest# shamefully-hoist also lives in .npmrc, but pnpm 12 applies it only from# here; without it public hoisting is empty and examples/ plugins cannotdiff --git a/scripts/check-pi-dependencies.mjs b/scripts/check-pi-dependencies.mjsnew file mode 100644index 000000000..162cace73--- /dev/null+++ b/scripts/check-pi-dependencies.mjs@@ -0,0 +1,62 @@+import { existsSync, readFileSync, realpathSync } from "node:fs";+import { dirname, join, resolve } from "node:path";+import { fileURLToPath } from "node:url";++const root = resolve(dirname(fileURLToPath(import.meta.url)), "..");+const targetVersion = "1.0.0";++function readJson(path) {+ return JSON.parse(readFileSync(join(root, path), "utf8"));+}++function assertPin(manifestPath, section, packageName) {+ const manifest = readJson(manifestPath);+ const value = manifest[section]?.[packageName];+ if (value !== targetVersion) {+ throw new Error(`${manifestPath} ${section}.${packageName} must be exactly ${targetVersion}; found ${value ?? "missing"}`);+ }+}++function assertInstalled(packagePath, expectedName, { patched = false } = {}) {+ const link = join(root, packagePath);+ if (!existsSync(link)) throw new Error(`Install dependencies before this check; missing ${packagePath}`);+ const resolved = realpathSync(link);+ const manifest = JSON.parse(readFileSync(join(resolved, "package.json"), "utf8"));+ if (manifest.name !== expectedName || manifest.version !== targetVersion) {+ throw new Error(`${packagePath} resolves to ${manifest.name}@${manifest.version}, expected ${expectedName}@${targetVersion}`);+ }+ if (patched && !resolved.includes("patch_hash=")) {+ throw new Error(`${packagePath} does not resolve to pnpm's patched package instance`);+ }+}++for (const packageName of [+ "@earendil-works/pi-agent-core",+ "@earendil-works/pi-ai",+ "@earendil-works/pi-coding-agent",+]) {+ assertPin("packages/agent-runtime/package.json", "dependencies", packageName);+ assertInstalled(`packages/agent-runtime/node_modules/${packageName}`, packageName, { patched: true });+}+for (const packageName of ["@earendil-works/pi-ai", "@earendil-works/pi-mcp"]) {+ assertPin("apps/desktop/package.json", "devDependencies", packageName);+ assertInstalled(`apps/desktop/node_modules/${packageName}`, packageName, {+ patched: packageName === "@earendil-works/pi-ai",+ });+}++const lockfile = readFileSync(join(root, "pnpm-lock.yaml"), "utf8");+for (const packageName of ["pi-agent-core", "pi-ai", "pi-coding-agent", "pi-mcp"]) {+ if (new RegExp(`@earendil-works/${packageName}@0\\.99\\.1(?:[(:]|$)`).test(lockfile)) {+ throw new Error(`pnpm-lock.yaml still contains @earendil-works/${packageName}@0.99.1`);+ }+}+const workspace = readFileSync(join(root, "pnpm-workspace.yaml"), "utf8");+const releaseAgeExclusions = workspace.match(+ /^minimumReleaseAgeExclude:[ \t]*([\s\S]*?)(?=^[A-Za-z][\w-]*:|\s*$)/m,+)?.[1] ?? "";+if (/@earendil-works\/(?:chord|pi-agent-core|pi-ai|pi-telemetry|pi-coding-agent|pi-codemode|pi-mcp|pi-tui)@/.test(releaseAgeExclusions)) {+ throw new Error("Remove the obsolete Pi-specific minimumReleaseAgeExclude entries");+}++process.stdout.write("Pi direct pins and installed package instances are aligned at 1.0.0.\n");diff --git a/scripts/check-pi-patches.mjs b/scripts/check-pi-patches.mjsnew file mode 100644index 000000000..951d9f8a7--- /dev/null+++ b/scripts/check-pi-patches.mjs@@ -0,0 +1,68 @@+import { existsSync, readFileSync, realpathSync } from "node:fs";+import { dirname, join, resolve } from "node:path";+import { fileURLToPath } from "node:url";++const root = resolve(dirname(fileURLToPath(import.meta.url)), "..");+const entries = [+ {+ name: "@earendil-works/pi-agent-core",+ patch: "patches/@[email protected]",+ packagePath: "packages/agent-runtime/node_modules/@earendil-works/pi-agent-core",+ markers: ["hosted_search_update", "localRequestErrorDetails"],+ },+ {+ name: "@earendil-works/pi-ai",+ patch: "patches/@[email protected]",+ packagePath: "packages/agent-runtime/node_modules/@earendil-works/pi-ai",+ markers: ["hostedSearch", "withLocalRequestErrors", "AnthropicOAuthTokenError", "Retry-After"],+ },+ {+ name: "@earendil-works/pi-coding-agent",+ patch: "patches/@[email protected]",+ packagePath: "packages/agent-runtime/node_modules/@earendil-works/pi-coding-agent",+ markers: ["hostedSearchReplayProjection", "estimateProjectedContextTokens"],+ },+];+const workspace = readFileSync(join(root, "pnpm-workspace.yaml"), "utf8");+const lockfile = readFileSync(join(root, "pnpm-lock.yaml"), "utf8");++for (const entry of entries) {+ if (!existsSync(join(root, entry.patch))) throw new Error(`Missing patch: ${entry.patch}`);+ const patchText = readFileSync(join(root, entry.patch), "utf8");+ if (/diff --git a\/[^\n]*package-lock\.json/.test(patchText)) {+ throw new Error(`${entry.patch} must not change unrelated upstream package-lock.json files`);+ }+ for (const marker of entry.markers) {+ if (!patchText.includes(marker)) throw new Error(`${entry.patch} is missing audited behavior marker ${marker}`);+ }+ const workspaceMapping = `'${entry.name}@1.0.0': ${entry.patch}`;+ if (!workspace.includes(workspaceMapping)) throw new Error(`pnpm-workspace.yaml does not map ${entry.name} to ${entry.patch}`);+ const packagePath = join(root, entry.packagePath);+ const resolved = realpathSync(packagePath);+ const patchHash = resolved.match(/patch_hash=([a-f0-9]+)/)?.[1];+ if (!patchHash || !lockfile.includes(`${entry.name}@1.0.0(patch_hash=${patchHash}`)) {+ throw new Error(`${entry.name}@1.0.0 installed patch hash is absent from pnpm-lock.yaml`);+ }+}++const piAiPatch = readFileSync(join(root, entries[1].patch), "utf8");+for (const declarationPath of [+ "dist/index.d.ts",+ "dist/types.d.ts",+ "dist/utils/assistant-message-frame.d.ts",+ "dist/utils/estimate.d.ts",+ "dist/utils/hosted-search.d.ts",+ "dist/utils/local-request-error.d.ts",+ "dist/utils/local-request-stream.d.ts",+]) {+ if (!piAiPatch.includes(`diff --git a/${declarationPath} `)) {+ throw new Error(`Pi AI patch is missing the audited declaration file ${declarationPath}`);+ }+}++const codingAgentPatch = readFileSync(join(root, entries[2].patch), "utf8");+if (!codingAgentPatch.includes("+export declare function estimateProjectedContextTokens(")) {+ throw new Error("Pi coding-agent runtime estimator declaration is missing from its patch");+}++process.stdout.write("All three Pi 1.0.0 patches are mapped, locked, installed, and contain the audited contracts.\n");diff --git a/scripts/e2e-hosted-search.mjs b/scripts/e2e-hosted-search.mjsindex deaf64ed8..d3d3ffdde 100644--- a/scripts/e2e-hosted-search.mjs+++ b/scripts/e2e-hosted-search.mjs@@ -160,7 +160,7 @@ when the run ends; any change between the two fails the run.`);for (const name of ["pi-ai", "pi-agent-core", "pi-coding-agent"]) {const manifest = JSON.parse(await readFile(join(root, "packages/agent-runtime/node_modules/@earendil-works", name, "package.json"), "utf8"));evidence.installedDependencies[name] = manifest.version;- assert.equal(manifest.version, "0.99.1", `${name} must match the locked pi version`);+ assert.equal(manifest.version, "1.0.0", `${name} must match the locked pi version`);}evidence.lockfileSha256 = await hash(join(root, "pnpm-lock.yaml"));evidence.head = git("rev-parse", "HEAD");diff --git a/scripts/e2e-image-chat.mjs b/scripts/e2e-image-chat.mjsindex 712bf2abd..f68f7f47d 100644--- a/scripts/e2e-image-chat.mjs+++ b/scripts/e2e-image-chat.mjs@@ -66,8 +66,25 @@ delete env.ELECTRON_RUN_AS_NODE;const child = spawn(electronBinary,[`--remote-debugging-port=${port}`, `--user-data-dir=${join(root, "profile")}`, "."],- { cwd: appDir, env, stdio: ["ignore", "pipe", "pipe"] },+ {+ cwd: appDir,+ env,+ stdio: ["ignore", "pipe", "pipe"],+ detached: process.platform !== "win32",+ },);+const childClose = new Promise((resolve) => child.once("close", resolve));+const waitForChildExit = async (timeoutMs) => {+ let timer;+ const exited = await Promise.race([+ childClose.then(() => true),+ new Promise((resolve) => {+ timer = setTimeout(() => resolve(false), timeoutMs);+ }),+ ]);+ clearTimeout(timer);+ return exited;+};let output = "";child.stdout.on("data", (data) => {output += data;@@ -346,6 +363,22 @@ try {throw error;} finally {ws?.close();- child.kill();+ try {+ if (process.platform === "win32") child.kill("SIGTERM");+ else process.kill(-child.pid, "SIGTERM");+ } catch (error) {+ if (error.code !== "ESRCH") throw error;+ }+ if (!(await waitForChildExit(3000))) {+ try {+ if (process.platform === "win32") child.kill("SIGKILL");+ else process.kill(-child.pid, "SIGKILL");+ } catch (error) {+ if (error.code !== "ESRCH") throw error;+ }+ if (!(await waitForChildExit(3000))) {+ throw new Error("Electron process group did not close during E2E cleanup");+ }+ }server.close();}diff --git a/scripts/test-live-voice-interaction.mjs b/scripts/test-live-voice-interaction.mjsindex d065372ce..a35e061d5 100644--- a/scripts/test-live-voice-interaction.mjs+++ b/scripts/test-live-voice-interaction.mjs@@ -27,8 +27,8 @@ try {outfile: join(temp, "fixture.js"), bundle: true, format: "esm", platform: "browser", jsx: "automatic",// Reused node_modules may link a primary-checkout dist; test candidate sources.alias: {- "@pi-desktop/i18n": join(root, "packages/i18n/src/index.ts"),- "@pi-desktop/shared": join(root, "packages/shared/src/index.ts"),+ "@pi-desktop/i18n": join(root, "packages/i18n/src"),+ "@pi-desktop/shared": join(root, "packages/shared/src"),"@pi-desktop/voice-runtime/live": join(root, "packages/voice-runtime/src/live/index.ts"),},define: { "import.meta.env.DEV": "false", "process.env.NODE_ENV": '"production"' },