@harrylabsj/kiwi-merchant-cloud 0.12.4 → 0.12.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/a2a/node.d.ts +5 -1
- package/app/a2a/node.js +68 -30
- package/app/a2a/node.js.map +1 -1
- package/app/a2a/server/merchant-handler.d.ts +4 -0
- package/app/a2a/server/merchant-handler.js +123 -45
- package/app/a2a/server/merchant-handler.js.map +1 -1
- package/app/a2a/server/merchant-product-facts.d.ts +32 -0
- package/app/a2a/server/merchant-product-facts.js +57 -0
- package/app/a2a/server/merchant-product-facts.js.map +1 -0
- package/app/agent/buyer/buyer-tools.js +285 -3
- package/app/agent/buyer/buyer-tools.js.map +1 -1
- package/app/agent/merchant/types.d.ts +4 -9
- package/app/agent/merchant/types.js +14 -0
- package/app/agent/merchant/types.js.map +1 -1
- package/app/buyer-core/a2a-knp.d.ts +1 -0
- package/app/buyer-core/a2a-knp.js +1 -1
- package/app/buyer-core/a2a-knp.js.map +1 -1
- package/app/buyer-core/a2a-negotiator.d.ts +2 -0
- package/app/buyer-core/a2a-negotiator.js +20 -19
- package/app/buyer-core/a2a-negotiator.js.map +1 -1
- package/app/buyer-core/a2a-quote-fetcher.d.ts +2 -0
- package/app/buyer-core/a2a-quote-fetcher.js +13 -5
- package/app/buyer-core/a2a-quote-fetcher.js.map +1 -1
- package/app/buyer-core/product-summary.d.ts +4 -0
- package/app/buyer-core/product-summary.js +6 -0
- package/app/buyer-core/product-summary.js.map +1 -1
- package/app/buyer-core/protocol-recovery.d.ts +12 -1
- package/app/buyer-core/protocol-recovery.js +59 -19
- package/app/buyer-core/protocol-recovery.js.map +1 -1
- package/app/buyer-core/receive-gate.d.ts +11 -0
- package/app/buyer-core/receive-gate.js +107 -0
- package/app/buyer-core/receive-gate.js.map +1 -0
- package/app/cloud/bootstrap.d.ts +4 -0
- package/app/cloud/bootstrap.js +69 -55
- package/app/cloud/bootstrap.js.map +1 -1
- package/app/cloud/file-listing-publication.js +6 -0
- package/app/cloud/file-listing-publication.js.map +1 -1
- package/app/cloud/main.d.ts +3 -0
- package/app/cloud/main.js +47 -11
- package/app/cloud/main.js.map +1 -1
- package/app/cloud/product-import-tabular.d.ts +1 -1
- package/app/cloud/product-import-tabular.js +263 -36
- package/app/cloud/product-import-tabular.js.map +1 -1
- package/app/cloud/product-source.d.ts +6 -1
- package/app/cloud/product-source.js +47 -15
- package/app/cloud/product-source.js.map +1 -1
- package/app/cloud-sample/products.json +3 -3
- package/app/commerce/data-source.d.ts +4 -0
- package/app/commerce/data-source.js.map +1 -1
- package/app/commerce/shopping-cli-source.js +4 -0
- package/app/commerce/shopping-cli-source.js.map +1 -1
- package/app/discovery/catalog-source/kiwi-source.d.ts +2 -0
- package/app/discovery/catalog-source/kiwi-source.js +4 -0
- package/app/discovery/catalog-source/kiwi-source.js.map +1 -1
- package/app/handoff/index.d.ts +2 -1
- package/app/handoff/index.js +1 -0
- package/app/handoff/index.js.map +1 -1
- package/app/handoff/launch-marketplace-policy.d.ts +149 -0
- package/app/handoff/launch-marketplace-policy.js +301 -0
- package/app/handoff/launch-marketplace-policy.js.map +1 -0
- package/app/handoff/marketplace-product-link.d.ts +18 -0
- package/app/handoff/marketplace-product-link.js +71 -0
- package/app/handoff/marketplace-product-link.js.map +1 -0
- package/app/handoff/transaction.d.ts +30 -0
- package/app/handoff/transaction.js +64 -0
- package/app/handoff/transaction.js.map +1 -1
- package/app/handoff/url-safety.d.ts +3 -0
- package/app/handoff/url-safety.js +4 -0
- package/app/handoff/url-safety.js.map +1 -1
- package/app/http/merchant-management/page.js +176 -45
- package/app/http/merchant-management/page.js.map +1 -1
- package/app/i18n.d.ts +1 -0
- package/app/i18n.js +3 -0
- package/app/i18n.js.map +1 -1
- package/app/lifecycle/close.d.ts +24 -0
- package/app/lifecycle/close.js +131 -0
- package/app/lifecycle/close.js.map +1 -0
- package/app/mcp/merchant-runtime-assembly.js +6 -4
- package/app/mcp/merchant-runtime-assembly.js.map +1 -1
- package/app/mcp/tools.js +17 -16
- package/app/mcp/tools.js.map +1 -1
- package/app/merchant/application/service.d.ts +4 -0
- package/app/merchant/application/service.js.map +1 -1
- package/app/merchant/stats-store.d.ts +3 -0
- package/app/merchant/stats-store.js +15 -1
- package/app/merchant/stats-store.js.map +1 -1
- package/app/merchant-core/rfq/data-source-adapter.d.ts +2 -10
- package/app/merchant-core/rfq/data-source-adapter.js +21 -9
- package/app/merchant-core/rfq/data-source-adapter.js.map +1 -1
- package/app/merchant-gateway/pinned-fetch.js +5 -2
- package/app/merchant-gateway/pinned-fetch.js.map +1 -1
- package/build-manifest.json +2901 -1966
- package/node_modules/@earendil-works/chord/CHANGELOG.md +20 -0
- package/node_modules/@earendil-works/chord/README.md +77 -194
- package/node_modules/@earendil-works/chord/dist/cell.d.ts +101 -0
- package/node_modules/@earendil-works/chord/dist/cell.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/cell.js +316 -0
- package/node_modules/@earendil-works/chord/dist/cell.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/cluster.d.ts +26 -0
- package/node_modules/@earendil-works/chord/dist/cluster.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/cluster.js +214 -0
- package/node_modules/@earendil-works/chord/dist/cluster.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/connection.d.ts +157 -0
- package/node_modules/@earendil-works/chord/dist/connection.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/connection.js +757 -0
- package/node_modules/@earendil-works/chord/dist/connection.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/context/index.d.ts +12 -1
- package/node_modules/@earendil-works/chord/dist/context/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/chord/dist/context/index.js.map +1 -1
- package/node_modules/@earendil-works/chord/dist/contract.d.ts +133 -0
- package/node_modules/@earendil-works/chord/dist/contract.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/contract.js +157 -0
- package/node_modules/@earendil-works/chord/dist/contract.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/declare.d.ts +70 -0
- package/node_modules/@earendil-works/chord/dist/declare.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/declare.js +22 -0
- package/node_modules/@earendil-works/chord/dist/declare.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/delta/apply-immutable-trusted.js.map +1 -1
- package/node_modules/@earendil-works/chord/dist/delta/diff.d.ts +1 -1
- package/node_modules/@earendil-works/chord/dist/delta/diff.d.ts.map +1 -1
- package/node_modules/@earendil-works/chord/dist/delta/diff.js.map +1 -1
- package/node_modules/@earendil-works/chord/dist/delta/index.d.ts +2 -2
- package/node_modules/@earendil-works/chord/dist/delta/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/chord/dist/delta/index.js +41 -0
- package/node_modules/@earendil-works/chord/dist/delta/index.js.map +1 -1
- package/node_modules/@earendil-works/chord/dist/delta/revision-validator.d.ts +1 -1
- package/node_modules/@earendil-works/chord/dist/delta/revision-validator.d.ts.map +1 -1
- package/node_modules/@earendil-works/chord/dist/delta/revision-validator.js.map +1 -1
- package/node_modules/@earendil-works/chord/dist/delta/tracker.d.ts +1 -1
- package/node_modules/@earendil-works/chord/dist/delta/tracker.d.ts.map +1 -1
- package/node_modules/@earendil-works/chord/dist/delta/tracker.js +40 -4
- package/node_modules/@earendil-works/chord/dist/delta/tracker.js.map +1 -1
- package/node_modules/@earendil-works/chord/dist/errors.d.ts +27 -0
- package/node_modules/@earendil-works/chord/dist/errors.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/errors.js +44 -0
- package/node_modules/@earendil-works/chord/dist/errors.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/host.d.ts +254 -0
- package/node_modules/@earendil-works/chord/dist/host.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/host.js +795 -0
- package/node_modules/@earendil-works/chord/dist/host.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/index.d.ts +17 -10
- package/node_modules/@earendil-works/chord/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/chord/dist/index.js +8 -8
- package/node_modules/@earendil-works/chord/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/chord/dist/json.d.ts +9 -1
- package/node_modules/@earendil-works/chord/dist/json.d.ts.map +1 -1
- package/node_modules/@earendil-works/chord/dist/json.js.map +1 -1
- package/node_modules/@earendil-works/chord/dist/link.d.ts +72 -0
- package/node_modules/@earendil-works/chord/dist/link.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/link.js +169 -0
- package/node_modules/@earendil-works/chord/dist/link.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/loader.d.ts +4 -0
- package/node_modules/@earendil-works/chord/dist/loader.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/loader.js +68 -0
- package/node_modules/@earendil-works/chord/dist/loader.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/manager.d.ts +115 -0
- package/node_modules/@earendil-works/chord/dist/manager.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/manager.js +319 -0
- package/node_modules/@earendil-works/chord/dist/manager.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/node.d.ts +3 -4
- package/node_modules/@earendil-works/chord/dist/node.d.ts.map +1 -1
- package/node_modules/@earendil-works/chord/dist/node.js +3 -2
- package/node_modules/@earendil-works/chord/dist/node.js.map +1 -1
- package/node_modules/@earendil-works/chord/dist/publish.d.ts +5 -0
- package/node_modules/@earendil-works/chord/dist/publish.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/publish.js +40 -0
- package/node_modules/@earendil-works/chord/dist/publish.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/record.d.ts +320 -0
- package/node_modules/@earendil-works/chord/dist/record.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/record.js +1292 -0
- package/node_modules/@earendil-works/chord/dist/record.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/registry.d.ts +25 -0
- package/node_modules/@earendil-works/chord/dist/registry.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/registry.js +6 -0
- package/node_modules/@earendil-works/chord/dist/registry.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/reload.d.ts +118 -0
- package/node_modules/@earendil-works/chord/dist/reload.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/reload.js +589 -0
- package/node_modules/@earendil-works/chord/dist/reload.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/remote.d.ts +70 -0
- package/node_modules/@earendil-works/chord/dist/remote.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/remote.js +308 -0
- package/node_modules/@earendil-works/chord/dist/remote.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/schema.d.ts +21 -0
- package/node_modules/@earendil-works/chord/dist/schema.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/schema.js +228 -0
- package/node_modules/@earendil-works/chord/dist/schema.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/state.d.ts +92 -0
- package/node_modules/@earendil-works/chord/dist/state.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/{services/state.js → state.js} +28 -138
- package/node_modules/@earendil-works/chord/dist/state.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/types.d.ts +62 -262
- package/node_modules/@earendil-works/chord/dist/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/chord/dist/types.js.map +1 -1
- package/node_modules/@earendil-works/chord/dist/websocket.d.ts +16 -0
- package/node_modules/@earendil-works/chord/dist/websocket.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/websocket.js +15 -0
- package/node_modules/@earendil-works/chord/dist/websocket.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/wire.d.ts +135 -0
- package/node_modules/@earendil-works/chord/dist/wire.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/wire.js +112 -0
- package/node_modules/@earendil-works/chord/dist/wire.js.map +1 -0
- package/node_modules/@earendil-works/chord/docs/guide.md +750 -0
- package/node_modules/@earendil-works/chord/docs/spec.md +261 -0
- package/node_modules/@earendil-works/chord/docs/tutorial.md +909 -0
- package/node_modules/@earendil-works/chord/package.json +10 -11
- package/node_modules/@earendil-works/chord/src/delta/README.md +5 -3
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js +9 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/proxy.d.ts +2 -5
- package/node_modules/@earendil-works/pi-agent-core/dist/proxy.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/proxy.js +2 -14
- package/node_modules/@earendil-works/pi-agent-core/dist/proxy.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts +4 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
- package/node_modules/@earendil-works/pi-ai/README.md +14 -3
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +63 -22
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-config.d.ts +15 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-config.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-config.js +76 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-config.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.d.ts +3 -6
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js +2 -74
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js +33 -2
- package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/classifier-shared.d.ts +21 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/classifier-shared.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/classifier-shared.js +98 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/classifier-shared.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-workers-ai-system-one.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-workers-ai-system-one.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-workers-ai-system-one.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/lazy.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/lazy.js +4 -3
- package/node_modules/@earendil-works/pi-ai/dist/api/lazy.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/llama-cpp-classify.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/llama-cpp-classify.js +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/llama-cpp-classify.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js +31 -14
- package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js +7 -4
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.d.ts +4 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.js +162 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.lazy.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.lazy.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.lazy.js +4 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-decisions.lazy.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/system-one-shared.d.ts +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/system-one-shared.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/system-one-shared.js +5 -89
- package/node_modules/@earendil-works/pi-ai/dist/api/system-one-shared.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/typesafe-system-one.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/typesafe-system-one.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/typesafe-system-one.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/anthropic.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/anthropic.js +14 -6
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/anthropic.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openai-chatgpt.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openai-chatgpt.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openai-codex.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openai-codex.js +4 -4
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openai-codex.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.d.ts +16 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js +51 -27
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/types.d.ts +5 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.d.ts +5 -0
- package/node_modules/@earendil-works/pi-ai/dist/models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts +4 -4
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.js +4 -4
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.js +7 -8
- package/node_modules/@earendil-works/pi-ai/dist/models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/all.js +2 -2
- package/node_modules/@earendil-works/pi-ai/dist/providers/all.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure.js +46 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure.models.d.ts +6 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure.models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure.models.js +8 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure.models.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/compat-schema.d.ts +338 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/compat-schema.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/compat-schema.js +375 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/compat-schema.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/amazon-bedrock.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/anthropic.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/azure.json +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/baseten.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-workers-ai.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/github-copilot.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/google-vertex.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/google.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/huggingface.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/meta.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/minimax-cn.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/minimax.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/mistral.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode-go.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/radius.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/faux.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js +25 -8
- package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/model-schema.d.ts +91 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/model-schema.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/model-schema.js +55 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/model-schema.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai.js +12 -3
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter-api.d.ts +40 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter-api.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter-api.js +41 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter-api.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.d.ts +11 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.js +52 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/radius.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/radius.js +4 -12
- package/node_modules/@earendil-works/pi-ai/dist/providers/radius.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +22 -305
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/estimate.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/estimate.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.d.ts +10 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js +25 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/model-operations.d.ts +3 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/model-operations.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/model-operations.js +6 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/model-operations.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.d.ts +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.js +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +8 -2
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/package.json +2 -2
- package/node_modules/@earendil-works/pi-codemode/README.md +177 -11
- package/node_modules/@earendil-works/pi-codemode/dist/cloudflare.d.ts +53 -0
- package/node_modules/@earendil-works/pi-codemode/dist/cloudflare.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-codemode/dist/cloudflare.js +64 -0
- package/node_modules/@earendil-works/pi-codemode/dist/cloudflare.js.map +1 -0
- package/node_modules/@earendil-works/pi-codemode/dist/declarations.d.ts +6 -21
- package/node_modules/@earendil-works/pi-codemode/dist/declarations.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-codemode/dist/declarations.js +113 -127
- package/node_modules/@earendil-works/pi-codemode/dist/declarations.js.map +1 -1
- package/node_modules/@earendil-works/pi-codemode/dist/index.d.ts +5 -2
- package/node_modules/@earendil-works/pi-codemode/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-codemode/dist/index.js +4 -1
- package/node_modules/@earendil-works/pi-codemode/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-codemode/dist/portable.d.ts +15 -0
- package/node_modules/@earendil-works/pi-codemode/dist/portable.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-codemode/dist/portable.js +12 -0
- package/node_modules/@earendil-works/pi-codemode/dist/portable.js.map +1 -0
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/execution.d.ts +66 -0
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/execution.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/execution.js +494 -0
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/execution.js.map +1 -0
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/host.d.ts +8 -30
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/host.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/host.js +41 -283
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/host.js.map +1 -1
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/inline.d.ts +63 -0
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/inline.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/inline.js +80 -0
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/inline.js.map +1 -0
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/prelude-source.d.ts +9 -3
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/prelude-source.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/prelude-source.js +122 -12
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/prelude-source.js.map +1 -1
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/protocol.d.ts +47 -6
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/protocol.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/protocol.js +6 -1
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/protocol.js.map +1 -1
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/remote.d.ts +102 -0
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/remote.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/remote.js +175 -0
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/remote.js.map +1 -0
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/vm.d.ts +24 -0
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/vm.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/vm.js +293 -0
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/vm.js.map +1 -0
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/worker.js +11 -110
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/worker.js.map +1 -1
- package/node_modules/@earendil-works/pi-codemode/dist/source.d.ts +2 -1
- package/node_modules/@earendil-works/pi-codemode/dist/source.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-codemode/dist/source.js +8 -2
- package/node_modules/@earendil-works/pi-codemode/dist/source.js.map +1 -1
- package/node_modules/@earendil-works/pi-codemode/dist/types.d.ts +101 -6
- package/node_modules/@earendil-works/pi-codemode/dist/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-codemode/dist/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-codemode/package.json +15 -3
- package/node_modules/@earendil-works/pi-coding-agent/CHANGELOG.md +165 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/anthropic-messages-Q7SXESRX.js +6 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/anthropic.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/azure-openai-responses-LM52U7CK.js +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/bedrock-converse-stream.js +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-22CYIUS4.js +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-3ZATHNCK.js +9 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-5GTPJSRI.js +7 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-6MWTY2OB.js +130 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-6QGV3IWD.js +6 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-2KAZSACP.js → chunk-AKJ3ZOR3.js} +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-G7EDXK4D.js → chunk-CQ3XTLTY.js} +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-SYF2TF6W.js → chunk-D7PHKNBM.js} +29 -92
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-DOST5PQW.js +82 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-DVQEBGVL.js +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-ZSI3BL5Q.js → chunk-GDR5JFDJ.js} +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-HACVPRBJ.js +11 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-ITZNWD4K.js +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-LPXNMA2W.js +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-LD2P6SFZ.js → chunk-PMRZO46Y.js} +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-RDZVAGPR.js +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-ZSBPJAJ2.js → chunk-TJXZSVTD.js} +116 -99
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-BYB6ZAAQ.js → chunk-TN4NLWHF.js} +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-WBQBCFWG.js +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-WJUNYZC5.js +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-XIX7LUWI.js +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-ZBURYEWF.js +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{cli-KILDDGW3.js → cli-SWM4FQ6V.js} +4 -4
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/cloudflare-workers-ai-system-one-UTBL2KOF.js +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/codemode-worker.js +117 -14
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/easter-egg-3d-OX6RUCIS.js +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/execute-3CFUPDLS.js +499 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/github-copilot.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{google-generative-ai-ZOK6CV7D.js → google-generative-ai-DXKP72HC.js} +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{google-vertex-VKWZQ3AY.js → google-vertex-W6SIDOVV.js} +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/image-resize-worker.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{llama-cpp-classify-XT44PI3C.js → llama-cpp-classify-FYN623RH.js} +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/mistral-conversations-GBMHTSYF.js +5 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/openai-chatgpt.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/openai-codex-responses-RN6B5UPP.js +10 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/openai-codex.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{openai-completions-GWHGMQ3T.js → openai-completions-QW2B4SML.js} +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/openai-decisions-WVPMQ4JD.js +5 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{openai-responses-EZ7FJ2KL.js → openai-responses-KDJUSIU7.js} +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{openrouter-images-ZVXWCSIM.js → openrouter-images-DUPG5DZO.js} +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{pi-messages-TM5SOOIW.js → pi-messages-YHKPQIHC.js} +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/runtime-366HE7CW.js +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/typesafe-system-one-ZSK3RN4B.js +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/virtual-modules-GI6FRNLG.js +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/cli-runtime.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/index.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/rpc-entry.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.d.ts +2 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.js +24 -5
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/config.d.ts +18 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/config.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/config.js +44 -6
- package/node_modules/@earendil-works/pi-coding-agent/dist/config.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.d.ts +47 -5
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js +148 -78
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.js +20 -13
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/bash-executor.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/bash-executor.js +42 -52
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/bash-executor.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/bug-report.d.ts +9 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/bug-report.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/utils.d.ts +6 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/utils.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/utils.js +7 -8
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/utils.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/export-html/tool-renderer.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/export-html/tool-renderer.js +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/export-html/tool-renderer.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/index.d.ts +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.d.ts +4 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.js +2 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/types.d.ts +44 -7
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/key-id-schema.d.ts +6 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/key-id-schema.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/key-id-schema.js +16 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/key-id-schema.js.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings-schema.d.ts +4 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings-schema.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings-schema.js +16 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings-schema.js.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings.d.ts +198 -66
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings.js +26 -23
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/mcp-servers.d.ts +8 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/mcp-servers.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/mcp-servers.js +30 -7
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/mcp-servers.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-config.d.ts +695 -74
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-config.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-config.js +16 -166
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-config.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-runtime.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-runtime.js +13 -7
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-runtime.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/nested-tool-calls.d.ts +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/nested-tool-calls.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/nested-tool-calls.js +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/nested-tool-calls.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.js +3 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/project-trust.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/project-trust.js +2 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/project-trust.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/remote-catalog-provider.d.ts +12 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/remote-catalog-provider.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/remote-catalog-provider.js +82 -24
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/remote-catalog-provider.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.d.ts +3 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.js +9 -4
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.d.ts +13 -4
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.js +19 -6
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-defaults.d.ts +65 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-defaults.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-defaults.js +66 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-defaults.js.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.d.ts +15 -145
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.js +85 -57
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-schema.d.ts +228 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-schema.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-schema.js +287 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-schema.js.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/skills.d.ts +4 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/skills.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/skills.js +6 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/skills.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.d.ts +6 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.js +9 -4
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/output-accumulator.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/output-accumulator.js +4 -10
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/output-accumulator.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.d.ts +13 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.js +18 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/render-utils.d.ts +18 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/render-utils.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/render-utils.js +46 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/render-utils.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/renderers/bash.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/renderers/bash.js +7 -35
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/renderers/bash.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/renderers/edit.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/renderers/edit.js +5 -4
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/renderers/edit.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/execute.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/execute.js +165 -48
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/execute.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/index.js +3 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/renderer.d.ts +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/renderer.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/renderer.js +9 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/renderer.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/tool.d.ts +15 -14
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/tool.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/tool.js +58 -38
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/tool.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/llama/provider.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/llama/provider.js +34 -11
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/llama/provider.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/cli.js +22 -31
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/cli.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/index.js +188 -84
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/oauth.d.ts +5 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/oauth.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/oauth.js +36 -10
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/oauth.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/resources.d.ts +3 -10
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/resources.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/resources.js +4 -5
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/resources.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/runtime.d.ts +7 -7
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/runtime.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/runtime.js +26 -44
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/runtime.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/tools.d.ts +4 -4
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/tools.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/tools.js +68 -16
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/tools.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/ui.d.ts +3 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/ui.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/ui.js +10 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/ui.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/tool-search/tool.d.ts +0 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/tool-search/tool.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/tool-search/tool.js +2 -4
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/tool-search/tool.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/index.d.ts +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/main.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/main.js +4 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/main.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/bash-execution.d.ts +5 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/bash-execution.js +17 -14
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/branch-summary-message.d.ts +2 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/branch-summary-message.js +5 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.d.ts +2 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.js +5 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-entry.d.ts +3 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-entry.js +8 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-entry.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-message.js +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-selector.js +4 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.d.ts +2 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.js +5 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/status-indicator.d.ts +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/status-indicator.js +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/status-indicator.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts +5 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +10 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +9 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js +103 -40
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/program-status-reporter.d.ts +34 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/program-status-reporter.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/program-status-reporter.js +110 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/program-status-reporter.js.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/dark.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/light.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-schema.d.ts +28 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-schema.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-schema.js +105 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-schema.js.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-tokens.d.ts +257 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-tokens.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-tokens.js +94 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-tokens.js.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts +13 -16
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme.js +22 -29
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/print-mode.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/print-mode.js +4 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/print-mode.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.js +24 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/ansi.d.ts +8 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/ansi.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/ansi.js +30 -11
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/ansi.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/clipboard.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/clipboard.js +18 -12
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/clipboard.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-core.d.ts +12 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-core.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-core.js +5 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-core.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-worker.js +3 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-worker.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize.js +9 -10
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/output-files.d.ts +15 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/output-files.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/output-files.js +30 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/output-files.js.map +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/syntax-highlight.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/syntax-highlight.js +6 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/syntax-highlight.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/docs/cli-integration.md +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/docs/cli.md +19 -7
- package/node_modules/@earendil-works/pi-coding-agent/docs/codemode.md +30 -9
- package/node_modules/@earendil-works/pi-coding-agent/docs/compaction.md +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/docs/environment-variables.md +3 -1
- package/node_modules/@earendil-works/pi-coding-agent/docs/extensions.md +7 -4
- package/node_modules/@earendil-works/pi-coding-agent/docs/json.md +3 -3
- package/node_modules/@earendil-works/pi-coding-agent/docs/keybindings.md +5 -4
- package/node_modules/@earendil-works/pi-coding-agent/docs/llama-cpp.md +8 -1
- package/node_modules/@earendil-works/pi-coding-agent/docs/mcp.md +4 -2
- package/node_modules/@earendil-works/pi-coding-agent/docs/message-types.md +22 -4
- package/node_modules/@earendil-works/pi-coding-agent/docs/models.md +5 -1
- package/node_modules/@earendil-works/pi-coding-agent/docs/providers.md +47 -0
- package/node_modules/@earendil-works/pi-coding-agent/docs/settings.md +6 -4
- package/node_modules/@earendil-works/pi-coding-agent/docs/terminal-setup.md +14 -0
- package/node_modules/@earendil-works/pi-coding-agent/docs/themes.md +4 -2
- package/node_modules/@earendil-works/pi-coding-agent/docs/tui.md +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/README.md +0 -3
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/dynamic-resources/dynamic.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/gondolin/package-lock.json +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/gondolin/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/overlay-test.ts +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/plan-mode/index.ts +6 -2
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/sandbox/package-lock.json +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/sandbox/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/with-deps/package-lock.json +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/with-deps/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/package.json +10 -21
- package/node_modules/@earendil-works/pi-coding-agent/schemas/keybindings.schema.json +393 -0
- package/node_modules/@earendil-works/pi-coding-agent/schemas/models.schema.json +1157 -0
- package/node_modules/@earendil-works/pi-coding-agent/schemas/settings.schema.json +765 -0
- package/node_modules/@earendil-works/pi-coding-agent/schemas/theme.schema.json +365 -0
- package/node_modules/@earendil-works/pi-durable/CHANGELOG.md +114 -0
- package/node_modules/@earendil-works/pi-durable/README.md +164 -12
- package/node_modules/@earendil-works/pi-durable/dist/codemode/codemode.d.ts +173 -0
- package/node_modules/@earendil-works/pi-durable/dist/codemode/codemode.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/codemode/codemode.js +886 -0
- package/node_modules/@earendil-works/pi-durable/dist/codemode/codemode.js.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/codemode/describe.d.ts +38 -0
- package/node_modules/@earendil-works/pi-durable/dist/codemode/describe.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/codemode/describe.js +119 -0
- package/node_modules/@earendil-works/pi-durable/dist/codemode/describe.js.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/codemode/index.d.ts +3 -0
- package/node_modules/@earendil-works/pi-durable/dist/codemode/index.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/codemode/index.js +3 -0
- package/node_modules/@earendil-works/pi-durable/dist/codemode/index.js.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/codemode/models.d.ts +28 -0
- package/node_modules/@earendil-works/pi-durable/dist/codemode/models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/codemode/models.js +231 -0
- package/node_modules/@earendil-works/pi-durable/dist/codemode/models.js.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/codemode/output.d.ts +41 -0
- package/node_modules/@earendil-works/pi-durable/dist/codemode/output.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/codemode/output.js +167 -0
- package/node_modules/@earendil-works/pi-durable/dist/codemode/output.js.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/env/decode.d.ts +16 -0
- package/node_modules/@earendil-works/pi-durable/dist/env/decode.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/env/decode.js +28 -0
- package/node_modules/@earendil-works/pi-durable/dist/env/decode.js.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/env/index.d.ts +197 -3
- package/node_modules/@earendil-works/pi-durable/dist/env/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/env/index.js +2 -0
- package/node_modules/@earendil-works/pi-durable/dist/env/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/env/line-scan.d.ts +13 -0
- package/node_modules/@earendil-works/pi-durable/dist/env/line-scan.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/env/line-scan.js +147 -0
- package/node_modules/@earendil-works/pi-durable/dist/env/line-scan.js.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/env/node-watch.d.ts +29 -0
- package/node_modules/@earendil-works/pi-durable/dist/env/node-watch.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/env/node-watch.js +485 -0
- package/node_modules/@earendil-works/pi-durable/dist/env/node-watch.js.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/env/node.d.ts +11 -2
- package/node_modules/@earendil-works/pi-durable/dist/env/node.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/env/node.js +284 -21
- package/node_modules/@earendil-works/pi-durable/dist/env/node.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/errors.d.ts +20 -3
- package/node_modules/@earendil-works/pi-durable/dist/errors.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/errors.js +34 -5
- package/node_modules/@earendil-works/pi-durable/dist/errors.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/agent.d.ts +7 -3
- package/node_modules/@earendil-works/pi-durable/dist/harness/agent.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/agent.js +81 -25
- package/node_modules/@earendil-works/pi-durable/dist/harness/agent.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/compaction.d.ts +6 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/compaction.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/compaction.js +11 -8
- package/node_modules/@earendil-works/pi-durable/dist/harness/compaction.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/context.d.ts +29 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/context.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/context.js +125 -24
- package/node_modules/@earendil-works/pi-durable/dist/harness/context.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/events.d.ts +35 -15
- package/node_modules/@earendil-works/pi-durable/dist/harness/events.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/events.js +77 -23
- package/node_modules/@earendil-works/pi-durable/dist/harness/events.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/generation.d.ts +2 -0
- package/node_modules/@earendil-works/pi-durable/dist/harness/generation.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/generation.js +40 -16
- package/node_modules/@earendil-works/pi-durable/dist/harness/generation.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/harness.d.ts +7 -0
- package/node_modules/@earendil-works/pi-durable/dist/harness/harness.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/harness.js +56 -28
- package/node_modules/@earendil-works/pi-durable/dist/harness/harness.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/inbox.d.ts +16 -4
- package/node_modules/@earendil-works/pi-durable/dist/harness/inbox.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/inbox.js +26 -3
- package/node_modules/@earendil-works/pi-durable/dist/harness/inbox.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/live.d.ts +74 -17
- package/node_modules/@earendil-works/pi-durable/dist/harness/live.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/live.js +66 -14
- package/node_modules/@earendil-works/pi-durable/dist/harness/live.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/output.d.ts +13 -6
- package/node_modules/@earendil-works/pi-durable/dist/harness/output.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/output.js +75 -18
- package/node_modules/@earendil-works/pi-durable/dist/harness/output.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/scheduler.d.ts +18 -5
- package/node_modules/@earendil-works/pi-durable/dist/harness/scheduler.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/scheduler.js +794 -168
- package/node_modules/@earendil-works/pi-durable/dist/harness/scheduler.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/submissions.d.ts +7 -4
- package/node_modules/@earendil-works/pi-durable/dist/harness/submissions.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/submissions.js +32 -13
- package/node_modules/@earendil-works/pi-durable/dist/harness/submissions.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/task-graph.d.ts +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/task-graph.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/task-graph.js +15 -10
- package/node_modules/@earendil-works/pi-durable/dist/harness/task-graph.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/tool.d.ts +45 -5
- package/node_modules/@earendil-works/pi-durable/dist/harness/tool.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/tool.js +400 -67
- package/node_modules/@earendil-works/pi-durable/dist/harness/tool.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/types.d.ts +194 -17
- package/node_modules/@earendil-works/pi-durable/dist/harness/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/util.d.ts +6 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/util.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/util.js +5 -2
- package/node_modules/@earendil-works/pi-durable/dist/harness/util.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/view.d.ts +6 -2
- package/node_modules/@earendil-works/pi-durable/dist/harness/view.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/harness/view.js +22 -12
- package/node_modules/@earendil-works/pi-durable/dist/harness/view.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/images/cloudflare.d.ts +4 -0
- package/node_modules/@earendil-works/pi-durable/dist/images/cloudflare.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/images/cloudflare.js +9 -0
- package/node_modules/@earendil-works/pi-durable/dist/images/cloudflare.js.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/images/exif.d.ts +3 -0
- package/node_modules/@earendil-works/pi-durable/dist/images/exif.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/images/exif.js +71 -0
- package/node_modules/@earendil-works/pi-durable/dist/images/exif.js.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/images/index.d.ts +18 -0
- package/node_modules/@earendil-works/pi-durable/dist/images/index.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/images/index.js +125 -0
- package/node_modules/@earendil-works/pi-durable/dist/images/index.js.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/images/node-worker.d.ts +17 -0
- package/node_modules/@earendil-works/pi-durable/dist/images/node-worker.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/images/node-worker.js +16 -0
- package/node_modules/@earendil-works/pi-durable/dist/images/node-worker.js.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/images/node.d.ts +21 -0
- package/node_modules/@earendil-works/pi-durable/dist/images/node.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/images/node.js +121 -0
- package/node_modules/@earendil-works/pi-durable/dist/images/node.js.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/index.d.ts +7 -7
- package/node_modules/@earendil-works/pi-durable/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/index.js +4 -4
- package/node_modules/@earendil-works/pi-durable/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/search.d.ts +13 -0
- package/node_modules/@earendil-works/pi-durable/dist/search.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/search.js +85 -0
- package/node_modules/@earendil-works/pi-durable/dist/search.js.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/session/observation.d.ts +10 -3
- package/node_modules/@earendil-works/pi-durable/dist/session/observation.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/session/observation.js +24 -34
- package/node_modules/@earendil-works/pi-durable/dist/session/observation.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/session/session.d.ts +71 -6
- package/node_modules/@earendil-works/pi-durable/dist/session/session.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/session/session.js +463 -50
- package/node_modules/@earendil-works/pi-durable/dist/session/session.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/session/transaction.d.ts +2 -0
- package/node_modules/@earendil-works/pi-durable/dist/session/transaction.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/session/transaction.js +19 -1
- package/node_modules/@earendil-works/pi-durable/dist/session/transaction.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/storage/jsonl/storage.d.ts +8 -0
- package/node_modules/@earendil-works/pi-durable/dist/storage/jsonl/storage.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/storage/jsonl/storage.js +2 -1
- package/node_modules/@earendil-works/pi-durable/dist/storage/jsonl/storage.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/storage/memory.d.ts +2 -0
- package/node_modules/@earendil-works/pi-durable/dist/storage/memory.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/storage/memory.js +79 -27
- package/node_modules/@earendil-works/pi-durable/dist/storage/memory.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/storage/scan.d.ts +18 -0
- package/node_modules/@earendil-works/pi-durable/dist/storage/scan.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/storage/scan.js +29 -0
- package/node_modules/@earendil-works/pi-durable/dist/storage/scan.js.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/storage/sqlite/cloudflare.d.ts +46 -0
- package/node_modules/@earendil-works/pi-durable/dist/storage/sqlite/cloudflare.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/storage/sqlite/cloudflare.js +106 -0
- package/node_modules/@earendil-works/pi-durable/dist/storage/sqlite/cloudflare.js.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/storage/sqlite/storage.d.ts +2 -0
- package/node_modules/@earendil-works/pi-durable/dist/storage/sqlite/storage.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/storage/sqlite/storage.js +77 -27
- package/node_modules/@earendil-works/pi-durable/dist/storage/sqlite/storage.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/testing/env-conformance.d.ts +7 -0
- package/node_modules/@earendil-works/pi-durable/dist/testing/env-conformance.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/testing/env-conformance.js +531 -0
- package/node_modules/@earendil-works/pi-durable/dist/testing/env-conformance.js.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/testing/index.d.ts +3 -2
- package/node_modules/@earendil-works/pi-durable/dist/testing/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/testing/index.js +2 -1
- package/node_modules/@earendil-works/pi-durable/dist/testing/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/testing/runner.d.ts +4 -2
- package/node_modules/@earendil-works/pi-durable/dist/testing/runner.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/testing/runner.js +9 -0
- package/node_modules/@earendil-works/pi-durable/dist/testing/runner.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/testing/storage-conformance.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/testing/storage-conformance.js +61 -2
- package/node_modules/@earendil-works/pi-durable/dist/testing/storage-conformance.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/testing/types.d.ts +20 -0
- package/node_modules/@earendil-works/pi-durable/dist/testing/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/testing/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/tool-search/index.d.ts +2 -0
- package/node_modules/@earendil-works/pi-durable/dist/tool-search/index.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/tool-search/index.js +2 -0
- package/node_modules/@earendil-works/pi-durable/dist/tool-search/index.js.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/tool-search/tool-search.d.ts +23 -0
- package/node_modules/@earendil-works/pi-durable/dist/tool-search/tool-search.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/tool-search/tool-search.js +84 -0
- package/node_modules/@earendil-works/pi-durable/dist/tool-search/tool-search.js.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/tools/bash.d.ts +30 -3
- package/node_modules/@earendil-works/pi-durable/dist/tools/bash.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/tools/bash.js +105 -37
- package/node_modules/@earendil-works/pi-durable/dist/tools/bash.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/tools/edit.js +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/tools/edit.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/tools/image-processor.d.ts +47 -0
- package/node_modules/@earendil-works/pi-durable/dist/tools/image-processor.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/tools/image-processor.js +30 -0
- package/node_modules/@earendil-works/pi-durable/dist/tools/image-processor.js.map +1 -0
- package/node_modules/@earendil-works/pi-durable/dist/tools/image.d.ts +18 -0
- package/node_modules/@earendil-works/pi-durable/dist/tools/image.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/tools/image.js +86 -0
- package/node_modules/@earendil-works/pi-durable/dist/tools/image.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/tools/index.d.ts +26 -3
- package/node_modules/@earendil-works/pi-durable/dist/tools/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/tools/index.js +14 -6
- package/node_modules/@earendil-works/pi-durable/dist/tools/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/tools/read.d.ts +10 -2
- package/node_modules/@earendil-works/pi-durable/dist/tools/read.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/tools/read.js +212 -78
- package/node_modules/@earendil-works/pi-durable/dist/tools/read.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/tools/write.js +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/tools/write.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/truncate.d.ts +9 -0
- package/node_modules/@earendil-works/pi-durable/dist/truncate.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/truncate.js +12 -4
- package/node_modules/@earendil-works/pi-durable/dist/truncate.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/types.d.ts +89 -12
- package/node_modules/@earendil-works/pi-durable/dist/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-durable/dist/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-durable/package.json +50 -5
- package/node_modules/@earendil-works/pi-mcp/CHANGELOG.md +29 -0
- package/node_modules/@earendil-works/pi-mcp/dist/auth-provider.d.ts +4 -0
- package/node_modules/@earendil-works/pi-mcp/dist/auth-provider.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-mcp/dist/auth-provider.js.map +1 -1
- package/node_modules/@earendil-works/pi-mcp/dist/client.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-mcp/dist/client.js +9 -5
- package/node_modules/@earendil-works/pi-mcp/dist/client.js.map +1 -1
- package/node_modules/@earendil-works/pi-mcp/dist/index.d.ts +1 -1
- package/node_modules/@earendil-works/pi-mcp/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-mcp/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-mcp/dist/oauth/discovery.d.ts +3 -0
- package/node_modules/@earendil-works/pi-mcp/dist/oauth/discovery.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-mcp/dist/oauth/discovery.js +8 -5
- package/node_modules/@earendil-works/pi-mcp/dist/oauth/discovery.js.map +1 -1
- package/node_modules/@earendil-works/pi-mcp/dist/oauth/errors.d.ts +3 -2
- package/node_modules/@earendil-works/pi-mcp/dist/oauth/errors.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-mcp/dist/oauth/errors.js +3 -1
- package/node_modules/@earendil-works/pi-mcp/dist/oauth/errors.js.map +1 -1
- package/node_modules/@earendil-works/pi-mcp/dist/oauth/flow.d.ts +4 -0
- package/node_modules/@earendil-works/pi-mcp/dist/oauth/flow.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-mcp/dist/oauth/flow.js +35 -7
- package/node_modules/@earendil-works/pi-mcp/dist/oauth/flow.js.map +1 -1
- package/node_modules/@earendil-works/pi-mcp/dist/oauth/types.d.ts +5 -0
- package/node_modules/@earendil-works/pi-mcp/dist/oauth/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-mcp/dist/oauth/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-mcp/dist/protocol/content.d.ts +2 -1
- package/node_modules/@earendil-works/pi-mcp/dist/protocol/content.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-mcp/dist/protocol/content.js.map +1 -1
- package/node_modules/@earendil-works/pi-mcp/dist/transports/streamable-http.d.ts +9 -2
- package/node_modules/@earendil-works/pi-mcp/dist/transports/streamable-http.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-mcp/dist/transports/streamable-http.js +28 -19
- package/node_modules/@earendil-works/pi-mcp/dist/transports/streamable-http.js.map +1 -1
- package/node_modules/@earendil-works/pi-mcp/dist/transports/transport.d.ts +9 -1
- package/node_modules/@earendil-works/pi-mcp/dist/transports/transport.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-mcp/dist/transports/transport.js.map +1 -1
- package/node_modules/@earendil-works/pi-mcp/package.json +2 -2
- package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
- package/node_modules/@earendil-works/pi-tui/README.md +5 -3
- package/node_modules/@earendil-works/pi-tui/dist/components/box.d.ts +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/box.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/box.js +4 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/box.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +3 -3
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/input.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/input.js +4 -4
- package/node_modules/@earendil-works/pi-tui/dist/components/input.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/text.d.ts +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/text.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/text.js +4 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/text.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.d.ts +2 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.js +3 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts +4 -4
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.js +4 -4
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/keys.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/keys.js +52 -20
- package/node_modules/@earendil-works/pi-tui/dist/keys.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/program-status.d.ts +23 -0
- package/node_modules/@earendil-works/pi-tui/dist/program-status.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/program-status.js +43 -0
- package/node_modules/@earendil-works/pi-tui/dist/program-status.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.d.ts +4 -2
- package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.js +36 -1
- package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js +5 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts +17 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal.js +46 -2
- package/node_modules/@earendil-works/pi-tui/dist/terminal.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.d.ts +2 -0
- package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.js +8 -4
- package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui-main-screen.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui-main-screen.js +2 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui-main-screen.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts +11 -0
- package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui.js +23 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/utils.js +5 -2
- package/node_modules/@earendil-works/pi-tui/dist/utils.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/node_modules/@silvia-odwyer/photon/LICENSE.md +201 -0
- package/node_modules/@silvia-odwyer/photon/README.md +158 -0
- package/node_modules/@silvia-odwyer/photon/package.json +23 -0
- package/node_modules/@silvia-odwyer/photon/photon_rs.d.ts +3443 -0
- package/node_modules/@silvia-odwyer/photon/photon_rs.js +4572 -0
- package/node_modules/@silvia-odwyer/photon/photon_rs_bg.wasm +0 -0
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/crypto.d.ts +2 -2
- package/node_modules/@types/node/dgram.d.ts +1 -1
- package/node_modules/@types/node/package.json +2 -2
- package/node_modules/@types/node/util.d.ts +6 -3
- package/node_modules/@types/node/zlib.d.ts +6 -0
- package/package.json +7 -8
- package/runtime-package.json +7 -9
- package/scripts/check-install-toolchain.mjs +64 -40
- package/shipping-sbom.cdx.json +126 -160
- package/shipping-source.json +15 -15
- package/node_modules/@earendil-works/chord/dist/api.d.ts +0 -20
- package/node_modules/@earendil-works/chord/dist/api.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/api.js +0 -77
- package/node_modules/@earendil-works/chord/dist/api.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/bundler.d.ts +0 -6
- package/node_modules/@earendil-works/chord/dist/bundler.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/bundler.js +0 -3
- package/node_modules/@earendil-works/chord/dist/bundler.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/facets/host.d.ts +0 -12
- package/node_modules/@earendil-works/chord/dist/facets/host.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/facets/host.js +0 -763
- package/node_modules/@earendil-works/chord/dist/facets/host.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/facets/loader.d.ts +0 -3
- package/node_modules/@earendil-works/chord/dist/facets/loader.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/facets/loader.js +0 -5
- package/node_modules/@earendil-works/chord/dist/facets/loader.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/node/bundle-loader.d.ts +0 -30
- package/node_modules/@earendil-works/chord/dist/node/bundle-loader.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/node/bundle-loader.js +0 -377
- package/node_modules/@earendil-works/chord/dist/node/bundle-loader.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/node/bundle.d.ts +0 -26
- package/node_modules/@earendil-works/chord/dist/node/bundle.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/node/bundle.js +0 -183
- package/node_modules/@earendil-works/chord/dist/node/bundle.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/node/manifest.d.ts +0 -36
- package/node_modules/@earendil-works/chord/dist/node/manifest.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/node/manifest.js +0 -6
- package/node_modules/@earendil-works/chord/dist/node/manifest.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/node/package.d.ts +0 -15
- package/node_modules/@earendil-works/chord/dist/node/package.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/node/package.js +0 -199
- package/node_modules/@earendil-works/chord/dist/node/package.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/consumer.d.ts +0 -11
- package/node_modules/@earendil-works/chord/dist/services/consumer.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/consumer.js +0 -585
- package/node_modules/@earendil-works/chord/dist/services/consumer.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/errors.d.ts +0 -8
- package/node_modules/@earendil-works/chord/dist/services/errors.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/errors.js +0 -22
- package/node_modules/@earendil-works/chord/dist/services/errors.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/handle.d.ts +0 -15
- package/node_modules/@earendil-works/chord/dist/services/handle.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/handle.js +0 -101
- package/node_modules/@earendil-works/chord/dist/services/handle.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/instances.d.ts +0 -26
- package/node_modules/@earendil-works/chord/dist/services/instances.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/instances.js +0 -140
- package/node_modules/@earendil-works/chord/dist/services/instances.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/loopback.d.ts +0 -5
- package/node_modules/@earendil-works/chord/dist/services/loopback.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/loopback.js +0 -15
- package/node_modules/@earendil-works/chord/dist/services/loopback.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/provider.d.ts +0 -37
- package/node_modules/@earendil-works/chord/dist/services/provider.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/provider.js +0 -521
- package/node_modules/@earendil-works/chord/dist/services/provider.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/state-codec.d.ts +0 -15
- package/node_modules/@earendil-works/chord/dist/services/state-codec.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/state-codec.js +0 -133
- package/node_modules/@earendil-works/chord/dist/services/state-codec.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/state-internals.d.ts +0 -13
- package/node_modules/@earendil-works/chord/dist/services/state-internals.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/state-internals.js +0 -10
- package/node_modules/@earendil-works/chord/dist/services/state-internals.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/state.d.ts +0 -28
- package/node_modules/@earendil-works/chord/dist/services/state.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/state.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/wire.d.ts +0 -63
- package/node_modules/@earendil-works/chord/dist/services/wire.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/wire.js +0 -186
- package/node_modules/@earendil-works/chord/dist/services/wire.js.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.d.ts +0 -3
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js +0 -14
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.models.d.ts +0 -6
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.models.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.models.js +0 -8
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.models.js.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/azure-openai-responses.json +0 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/anthropic-messages-MVG2FL56.js +0 -6
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/azure-openai-responses-7AMFUIWJ.js +0 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-6FX7UEPL.js +0 -132
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-7JGR3GZN.js +0 -11
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-A3JYRWB6.js +0 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-IKZJX7ZT.js +0 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-OSKPX3Z5.js +0 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-OYBSLV7Y.js +0 -16
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-PDFMCAOZ.js +0 -19
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-U7B62NSC.js +0 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-VIV3CWXG.js +0 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-WCQZGZ6I.js +0 -82
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/cloudflare-workers-ai-system-one-X5PVWWYJ.js +0 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/easter-egg-3d-T5FFWIBR.js +0 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/execute-RYVK27GT.js +0 -388
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/mistral-conversations-7DAUEE4N.js +0 -5
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/openai-codex-responses-TC3OK7B4.js +0 -10
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/runtime-D5I2NTIF.js +0 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/typesafe-system-one-A4CZTQWZ.js +0 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/virtual-modules-KVWJD3T3.js +0 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-json.d.ts +0 -85
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-json.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-json.js +0 -132
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-json.js.map +0 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme-schema.json +0 -361
- package/node_modules/@earendil-works/pi-coding-agent/examples/plugins/pi-example-plugin/README.md +0 -38
- package/node_modules/@earendil-works/pi-coding-agent/examples/plugins/pi-example-plugin/package.json +0 -10
- package/node_modules/@earendil-works/pi-coding-agent/examples/plugins/pi-example-plugin/src/contract.ts +0 -13
- package/node_modules/@earendil-works/pi-coding-agent/examples/plugins/pi-example-plugin/src/session.ts +0 -24
- package/node_modules/@earendil-works/pi-coding-agent/examples/plugins/pi-example-plugin/src/tui.ts +0 -31
- package/node_modules/@esbuild/linux-x64/README.md +0 -3
- package/node_modules/@esbuild/linux-x64/bin/esbuild +0 -0
- package/node_modules/@esbuild/linux-x64/package.json +0 -20
- package/node_modules/esbuild/LICENSE.md +0 -21
- package/node_modules/esbuild/README.md +0 -3
- package/node_modules/esbuild/bin/esbuild +0 -223
- package/node_modules/esbuild/install.js +0 -300
- package/node_modules/esbuild/lib/main.d.ts +0 -720
- package/node_modules/esbuild/lib/main.js +0 -2536
- package/node_modules/esbuild/package.json +0 -74
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generation.js","sourceRoot":"","sources":["../../src/harness/generation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,QAAQ,EAA8B,MAAM,uBAAuB,CAAC;AAW3F,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,yBAAyB,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAC5F,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAEnF,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAWzC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,iBA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;IACxE,IAAI,IAAI,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI;QAAE,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC;AACrD,CAAC","sourcesContent":["import { type Context, copyJson, type Draft, type JsonValue } from \"@earendil-works/chord\";\nimport type {\n\tApi,\n\tAssistantMessage,\n\tDeferredHandle,\n\tMessage,\n\tModel,\n\tModelThinkingLevel,\n\tSimpleStreamOptions,\n\tToolCall,\n} from \"@earendil-works/pi-ai\";\nimport { isContextOverflow } from \"@earendil-works/pi-ai/utils/overflow\";\nimport { isRetryableAssistantError, retryDelayMs } from \"@earendil-works/pi-ai/utils/retry\";\nimport { getCurrentTools } from \"@earendil-works/pi-ai/utils/transcript\";\nimport { AssistantEntry, ResetEntry, SystemEntry, UserEntry } from \"../entries.ts\";\nimport type { ExecutionEnv } from \"../env/index.ts\";\nimport { defineTask } from \"../tasks.ts\";\nimport type {\n\tConversationId,\n\tEntryId,\n\tNextTaskState,\n\tSubmissionId,\n\tTaskId,\n\tTaskRuntime,\n\tTx,\n\tTypedEntry,\n} from \"../types.ts\";\nimport { addTools } from \"./agent.ts\";\nimport { createCompaction, estimateContext, selectCut } from \"./compaction.ts\";\nimport { applyBoundary, prepareBoundary } from \"./inbox.ts\";\nimport { assignJson } from \"./json.ts\";\nimport { endRun, LiveDoc, type LiveState, type ToolSlot } from \"./live.ts\";\nimport { planSystemEntries, renderSections, replaySections } from \"./prompt.ts\";\nimport { ensureProviderSessionId } from \"./provider.ts\";\nimport { appendToolResult, harnessError, ToolTask, type ToolTaskResult } from \"./tool.ts\";\nimport type {\n\tCompactionPolicy,\n\tCompactionResult,\n\tContextView,\n\tConversationStreamOptions,\n\tGenerationHooks,\n\tModelRef,\n\tPromptInput,\n\tToolControl,\n\tUserInput,\n} from \"./types.ts\";\nimport { recordUsage } from \"./usage.ts\";\n\nexport type GenerationInput = Record<string, never>;\n\nexport type GenerationCheckpoint =\n\t| {\n\t\t\tphase: \"prepare\";\n\t\t\tattempt: number;\n\t\t\t/** The blocking compaction this generation waited for; it starts no other compaction (spec §8.3). */\n\t\t\tcompacted?: TaskId<CompactionResult>;\n\t\t\t/** Error text of the overflow that started `compacted`; checked once when `prepare` resumes. */\n\t\t\toverflow?: string;\n\t }\n\t| {\n\t\t\tphase: \"request\";\n\t\t\tattempt: number;\n\t\t\tcompacted?: TaskId<CompactionResult>;\n\t\t\tmodel: ModelRef;\n\t\t\tthinkingLevel: ModelThinkingLevel;\n\t\t\t/** The settings' request options when preparation committed; a resend after recovery uses them unchanged. */\n\t\t\tstreamOptions: ConversationStreamOptions;\n\t\t\t/** Newest entry included in the request. */\n\t\t\tcutoff: EntryId;\n\t }\n\t| { phase: \"retry\"; attempt: number; compacted?: TaskId<CompactionResult>; until: number }\n\t| {\n\t\t\tphase: \"poll\";\n\t\t\tattempt: number;\n\t\t\tcompacted?: TaskId<CompactionResult>;\n\t\t\tmodel: ModelRef;\n\t\t\tcutoff: EntryId;\n\t\t\thandle: DeferredHandle;\n\t\t\tpollAt: number;\n\t }\n\t| {\n\t\t\t/** Waiting on the round's tool tasks, which the generation owns (spec §8.5). */\n\t\t\tphase: \"tools\";\n\t\t\t/** The tool-calling answer. */\n\t\t\tassistant: EntryId;\n\t\t\t/** Tool tasks created so far, in call order; grows by one per started call of a sequential round. */\n\t\t\ttools: TaskId<ToolTaskResult>[];\n\t\t\t/** Calls of a sequential round not started yet, in call order. */\n\t\t\tpending: string[];\n\t };\n\nexport type GenerationResult = { entryId: EntryId };\n\ntype Runtime = TaskRuntime<GenerationInput, GenerationCheckpoint, GenerationResult, GenerationHooks>;\ntype Next = NextTaskState<GenerationCheckpoint, GenerationResult>;\n\n/** What classification needs from the request that produced a message. */\ntype Request = {\n\treadonly attempt: number;\n\treadonly compacted: TaskId<CompactionResult> | undefined;\n\treadonly model: ModelRef;\n\treadonly cutoff: EntryId;\n\t/** Committed model context through `cutoff`, when the phase already derived it. */\n\treadonly messages?: readonly Message[];\n\t/** Set when the message came from polling, so a still deferred result polls strictly later. */\n\treadonly pollAt?: number;\n};\n\nconst PARTIAL_THROTTLE_MS = 100;\nconst DEFAULT_POLL_AFTER_MS = 5000;\n\n/**\n * Built-in generation task: prepares the positional system prompt and tool loadout, requests or polls the model,\n * retries, and classifies the response. The run's inputs live in `pi.live.run`.\n */\nexport const GenerationTask = defineTask<GenerationInput, GenerationCheckpoint, GenerationResult, GenerationHooks>({\n\tname: \"pi.generation\",\n\tversion: 1,\n\tinitial: () => ({ phase: \"prepare\", attempt: 1 }),\n\tphases: {\n\t\t/**\n\t\t * Render the system prompt and tool loadout and append the positional `pi.system` entries they need, then move to\n\t\t * `request`. The agent and settings resolved here are fixed for this request. Only the Harness writes to a busy\n\t\t * conversation, so the transcript read here is still the tail at the commit.\n\t\t */\n\t\tprepare: async (task, runtime, context) => {\n\t\t\tconst { conversationId } = runtime;\n\t\t\tconst agent = await runtime.agent(context);\n\t\t\tconst settings = runtime.settings;\n\t\t\tconst { model, thinkingLevel } = agent;\n\t\t\tconst resolved = model === undefined ? undefined : runtime.models.getModel(model.provider, model.modelId);\n\t\t\tif (model === undefined || resolved === undefined) return failNoModel(runtime, model, context);\n\t\t\tconst { attempt, compacted, overflow } = task.state.checkpoint;\n\t\t\tif (compacted !== undefined && overflow !== undefined) {\n\t\t\t\tconst [outcome] = await runtime.outcomes([compacted], context);\n\t\t\t\tif (outcome?.status !== \"completed\" || outcome.result.entryId === undefined) {\n\t\t\t\t\treturn failModelError(runtime, overflow, context);\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst view = await runtime.context(conversationId, context);\n\t\t\tconst shown = replaySections(view.messages);\n\t\t\tconst report = (error: unknown) => runtime.report(error);\n\t\t\tlet env: ExecutionEnv | undefined;\n\t\t\ttry {\n\t\t\t\tenv = await runtime.env(context);\n\t\t\t} catch (error) {\n\t\t\t\tif (context.abortSignal?.aborted) throw error;\n\t\t\t\treport(error);\n\t\t\t}\n\t\t\tconst input: PromptInput = { conversationId, agent, env, shown: Object.fromEntries(shown), read: runtime };\n\t\t\tconst desired = await renderSections(agent.sections, input, shown, report, context);\n\t\t\tconst entries = planSystemEntries(view, desired, agent.tools, runtime.now());\n\t\t\tconst threshold =\n\t\t\t\tcompacted === undefined\n\t\t\t\t\t? thresholdCompaction(view, entries, resolved.contextWindow, settings.compaction)\n\t\t\t\t\t: undefined;\n\t\t\tif (threshold === \"blocking\") {\n\t\t\t\t// Compact first and prepare again; the transcript is unchanged until the compaction appends.\n\t\t\t\tawait runtime.commit(async (tx): Promise<Next> => {\n\t\t\t\t\tconst child = await createCompaction(tx, conversationId, { reason: \"threshold\" }, runtime.taskId);\n\t\t\t\t\tconst checkpoint = { phase: \"prepare\", attempt, compacted: child } as const;\n\t\t\t\t\treturn { status: \"waiting\", checkpoint, on: [child], policy: \"allSettled\" };\n\t\t\t\t}, context);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tawait runtime.commit(async (tx) => {\n\t\t\t\tlet cutoff = (await tx.scanEntries({ conversationId }, 1)).items[0]?.id;\n\t\t\t\tfor (const entry of entries) cutoff = (await tx.appendEntry(SystemEntry, conversationId, entry)).id;\n\t\t\t\tif (cutoff === undefined) throw new Error(`Conversation ${conversationId} has no entries to send`);\n\t\t\t\t// Checked in this commit, so a compaction admitted during preparation counts.\n\t\t\t\tif (threshold === \"background\" && (await tx.doc(LiveDoc, conversationId)).compactions === undefined) {\n\t\t\t\t\tawait createCompaction(tx, conversationId, { reason: \"threshold\" });\n\t\t\t\t}\n\t\t\t\tconst request = {\n\t\t\t\t\tattempt,\n\t\t\t\t\t...(compacted === undefined ? {} : { compacted }),\n\t\t\t\t\tmodel,\n\t\t\t\t\tthinkingLevel,\n\t\t\t\t\tstreamOptions: settings.stream,\n\t\t\t\t\tcutoff,\n\t\t\t\t};\n\t\t\t\treturn { status: \"running\", checkpoint: { phase: \"request\", ...request } };\n\t\t\t}, context);\n\t\t},\n\t\trequest: async (task, runtime, context) => {\n\t\t\tconst { attempt, compacted, model: ref, thinkingLevel, streamOptions, cutoff } = task.state.checkpoint;\n\t\t\tconst conversationId = runtime.conversationId;\n\t\t\tawait runtime.commit(async (tx) => {\n\t\t\t\tconst live = await tx.doc(LiveDoc, conversationId);\n\t\t\t\tawait convertPartial(tx, live, conversationId);\n\t\t\t\tlive.generation = { attempt };\n\t\t\t\treturn undefined;\n\t\t\t}, context);\n\t\t\tconst model = runtime.models.getModel(ref.provider, ref.modelId);\n\t\t\tif (model === undefined) return failNoModel(runtime, ref, context);\n\t\t\tconst view = await runtime.context(conversationId, context, cutoff);\n\t\t\tlet messages = view.messages;\n\t\t\tawait runtime.hooks.each(\"beforeRequest\", async (hook) => {\n\t\t\t\tconst replaced = await hook({ messages }, runtime, context);\n\t\t\t\tif (replaced !== undefined) messages = replaced.messages;\n\t\t\t});\n\t\t\tconst options: SimpleStreamOptions = {\n\t\t\t\t...streamOptions,\n\t\t\t\tsignal: runtime.signal,\n\t\t\t\tsessionId: await ensureProviderSessionId(runtime, context),\n\t\t\t\t...(thinkingLevel === \"off\" ? {} : { reasoning: thinkingLevel }),\n\t\t\t};\n\t\t\tconst message = await streamResponse(runtime, model, messages, options, attempt, context);\n\t\t\tconst request = { attempt, compacted, model: ref, cutoff, messages: view.messages };\n\t\t\tawait classify(runtime, request, message, context);\n\t\t},\n\t\tretry: async (task, runtime, context) => {\n\t\t\tconst { attempt, compacted, until } = task.state.checkpoint;\n\t\t\tawait runtime.sleep(until, context);\n\t\t\tawait runtime.commit(async (tx) => {\n\t\t\t\t(await tx.doc(LiveDoc, runtime.conversationId)).generation = { attempt: attempt + 1 };\n\t\t\t\tconst checkpoint: GenerationCheckpoint = {\n\t\t\t\t\tphase: \"prepare\",\n\t\t\t\t\tattempt: attempt + 1,\n\t\t\t\t\t...(compacted === undefined ? {} : { compacted }),\n\t\t\t\t};\n\t\t\t\treturn { status: \"running\", checkpoint };\n\t\t\t}, context);\n\t\t},\n\t\tpoll: async (task, runtime, context) => {\n\t\t\tconst { attempt, compacted, model: ref, cutoff, handle, pollAt } = task.state.checkpoint;\n\t\t\tconst model = runtime.models.getModel(ref.provider, ref.modelId);\n\t\t\tif (model === undefined) return failNoModel(runtime, ref, context);\n\t\t\tawait runtime.sleep(pollAt, context);\n\t\t\tconst message = await runtime.models.fetchDeferred(model, handle, { signal: runtime.signal });\n\t\t\tconst request = { attempt, compacted, model: ref, cutoff, pollAt };\n\t\t\tawait classify(runtime, request, message, context);\n\t\t},\n\t\ttools: async (task, runtime, context) => {\n\t\t\tconst { assistant, tools, pending } = task.state.checkpoint;\n\t\t\tconst [next, ...rest] = pending;\n\t\t\tif (next === undefined) return finishToolRound(runtime, assistant, tools, context);\n\t\t\t// Sequential round: start the next call and wait for it.\n\t\t\tawait runtime.commit(async (tx): Promise<Next> => {\n\t\t\t\tconst live = await tx.doc(LiveDoc, runtime.conversationId);\n\t\t\t\tconst taskId = await createToolTask(tx, runtime, assistant, next);\n\t\t\t\tconst slot = live.tools?.find((slot) => slot.callId === next && slot.taskId === undefined);\n\t\t\t\tif (slot !== undefined) slot.taskId = taskId;\n\t\t\t\tconst checkpoint: GenerationCheckpoint = {\n\t\t\t\t\tphase: \"tools\",\n\t\t\t\t\tassistant,\n\t\t\t\t\ttools: [...tools, taskId],\n\t\t\t\t\tpending: rest,\n\t\t\t\t};\n\t\t\t\treturn { status: \"waiting\", checkpoint, on: [taskId], policy: \"allSettled\" };\n\t\t\t}, context);\n\t\t},\n\t},\n\tabort: async (task, runtime, context) => {\n\t\tconst checkpoint = task.state.checkpoint;\n\t\tif (checkpoint.phase === \"poll\") {\n\t\t\tconst model = runtime.models.getModel(checkpoint.model.provider, checkpoint.model.modelId);\n\t\t\tif (model !== undefined) {\n\t\t\t\ttry {\n\t\t\t\t\tawait runtime.models.cancelDeferred(model, checkpoint.handle, { signal: runtime.signal });\n\t\t\t\t} catch (error) {\n\t\t\t\t\truntime.report(error);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tconst conversationId = runtime.conversationId;\n\t\t// Runs after the round's tool tasks are terminal; calls never started get `aborted` results (spec §8.5).\n\t\tconst unstarted =\n\t\t\tcheckpoint.phase === \"tools\"\n\t\t\t\t? await readCalls(runtime, checkpoint.assistant, checkpoint.pending, context)\n\t\t\t\t: [];\n\t\tawait runtime.commit(async (tx) => {\n\t\t\tconst live = await tx.doc(LiveDoc, conversationId);\n\t\t\tawait convertPartial(tx, live, conversationId);\n\t\t\tfor (const call of unstarted) {\n\t\t\t\tconst result = harnessError(\"aborted\", `Tool ${call.name} was aborted`);\n\t\t\t\tawait appendToolResult(tx, conversationId, call, result, runtime.now());\n\t\t\t}\n\t\t\tendRun(tx, live, runtime.taskId, { status: \"unanswered\", reason: \"aborted\" });\n\t\t\treturn { status: \"terminal\", outcome: { status: \"aborted\" } };\n\t\t}, context);\n\t},\n});\n\n/** The calls `callIds` of the assistant entry, in the given order. */\nasync function readCalls(\n\truntime: Runtime,\n\tassistant: EntryId,\n\tcallIds: readonly string[],\n\tcontext: Context,\n): Promise<ToolCall[]> {\n\tconst message = (await runtime.entry(AssistantEntry, assistant, context))?.model?.[0];\n\tconst calls = message?.role === \"assistant\" ? message.content.filter((content) => content.type === \"toolCall\") : [];\n\treturn callIds.flatMap((id) => calls.filter((call) => call.id === id).slice(0, 1));\n}\n\n/** A tool task for call `callId`, owned by the generation. */\nfunction createToolTask(tx: Tx, runtime: Runtime, assistant: EntryId, callId: string): Promise<TaskId<ToolTaskResult>> {\n\treturn tx.createTask(ToolTask, { assistant, callId }, { ownership: { kind: \"task\", taskId: runtime.taskId } });\n}\n\n/**\n * Which threshold compaction preparation starts before its request (spec §8.3): `blocking` above\n * `contextWindow - reserveTokens`, `background` above the background threshold, and only when range selection finds a\n * cut. The caller starts a background one only while no compaction is listed.\n */\nfunction thresholdCompaction(\n\tview: ContextView,\n\tplanned: readonly { readonly model?: readonly Message[] }[],\n\tcontextWindow: number,\n\tpolicy: CompactionPolicy,\n): \"blocking\" | \"background\" | undefined {\n\tif (!policy.enabled || contextWindow <= 0) return undefined;\n\tconst tokens = estimateContext(\n\t\tview,\n\t\tplanned.flatMap((entry) => entry.model ?? []),\n\t);\n\tconst blocking = contextWindow - policy.reserveTokens;\n\tconst background = blocking - policy.backgroundTokens;\n\tconst over =\n\t\ttokens > blocking ? \"blocking\" : policy.backgroundTokens > 0 && tokens > background ? \"background\" : undefined;\n\tif (over === undefined || selectCut(view, policy.keepRecentTokens) === undefined) return undefined;\n\treturn over;\n}\n\n/** Settle the run's inputs `unanswered` with `model_error` and fail with `text`. */\nasync function failModelError(runtime: Runtime, text: string, context: Context): Promise<void> {\n\tawait runtime.commit(async (tx) => {\n\t\tconst live = await tx.doc(LiveDoc, runtime.conversationId);\n\t\tendRun(tx, live, runtime.taskId, { status: \"unanswered\", reason: \"model_error\", detail: text });\n\t\treturn {\n\t\t\tstatus: \"terminal\",\n\t\t\toutcome: { status: \"failed\", error: { message: text, detail: { reason: \"model_error\" } } },\n\t\t};\n\t}, context);\n}\n\n/** Settle the run's inputs `unanswered` with `no_model` and fail. */\nasync function failNoModel(runtime: Runtime, ref: ModelRef | undefined, context: Context): Promise<void> {\n\tconst message =\n\t\tref === undefined ? \"No model is configured\" : `Model ${ref.provider}/${ref.modelId} is not available`;\n\tawait runtime.commit(async (tx) => {\n\t\tconst live = await tx.doc(LiveDoc, runtime.conversationId);\n\t\tendRun(tx, live, runtime.taskId, { status: \"unanswered\", reason: \"no_model\" });\n\t\treturn { status: \"terminal\", outcome: { status: \"failed\", error: { message, detail: { reason: \"no_model\" } } } };\n\t}, context);\n}\n\n/**\n * Append a committed partial left by an interrupted, aborted, faulted, or orphaned attempt as an aborted assistant\n * entry; the caller replaces or removes `generation`.\n */\nexport async function convertPartial(tx: Tx, live: Draft<LiveState>, conversationId: ConversationId): Promise<void> {\n\tconst partial = live.generation?.message;\n\tif (partial === undefined) return;\n\tconst message = copyJson(partial) as unknown as AssistantMessage;\n\tawait appendAssistant(tx, conversationId, { ...message, stopReason: \"aborted\" });\n}\n\n/**\n * Stream one request and return the terminal message. Partials commit as trailing writes at most every 100 ms with one\n * commit in flight; `finally` stops the throttle and awaits that commit, so no stale partial lands after the outcome.\n */\nasync function streamResponse(\n\truntime: Runtime,\n\tmodel: Model<Api>,\n\tmessages: readonly Message[],\n\toptions: SimpleStreamOptions,\n\tattempt: number,\n\tcontext: Context,\n): Promise<AssistantMessage> {\n\tlet pending: AssistantMessage | undefined;\n\tlet timer: ReturnType<typeof setTimeout> | undefined;\n\tlet inFlight: Promise<void> | undefined;\n\tlet stopped = false;\n\tconst flush = (): void => {\n\t\ttimer = undefined;\n\t\tconst partial = pending;\n\t\tpending = undefined;\n\t\tif (partial === undefined || stopped) return;\n\t\tinFlight = (async () => {\n\t\t\t// Copy synchronously: the provider keeps mutating its partial.\n\t\t\tconst message = copyJson(partial, { omitUndefinedProperties: true });\n\t\t\tawait runtime.commit(async (tx) => {\n\t\t\t\tconst live = await tx.doc(LiveDoc, runtime.conversationId);\n\t\t\t\tlive.generation ??= { attempt };\n\t\t\t\tassignJson(live.generation as Draft<Record<string, JsonValue>>, \"message\", message);\n\t\t\t\treturn undefined;\n\t\t\t}, context);\n\t\t})()\n\t\t\t.catch((error: unknown) => {\n\t\t\t\t// Rejections after an abort mark or close are expected; the committed state stays consistent.\n\t\t\t\tif (!runtime.signal.aborted) runtime.report(error);\n\t\t\t})\n\t\t\t.finally(() => {\n\t\t\t\tinFlight = undefined;\n\t\t\t\tif (pending !== undefined && !stopped) timer = setTimeout(flush, PARTIAL_THROTTLE_MS);\n\t\t\t});\n\t};\n\ttry {\n\t\tconst events = runtime.models.streamSimple(model, { messages: [...messages] }, options);\n\t\tfor await (const event of events) {\n\t\t\t// A partial without content, such as pi-ai's opening `start` event, shows nothing; a deferred response\n\t\t\t// never gets past it, so it never leaves a partial.\n\t\t\tif (event.type === \"done\" || event.type === \"error\" || event.partial.content.length === 0) continue;\n\t\t\tpending = event.partial;\n\t\t\tif (timer === undefined && inFlight === undefined) timer = setTimeout(flush, PARTIAL_THROTTLE_MS);\n\t\t}\n\t\treturn await events.result();\n\t} finally {\n\t\tstopped = true;\n\t\tclearTimeout(timer);\n\t\tawait inFlight;\n\t}\n}\n\n/** Classify a terminal provider message in one commit that also clears the partial. */\nasync function classify(\n\truntime: Runtime,\n\trequest: Request,\n\tmessage: AssistantMessage,\n\tcontext: Context,\n): Promise<void> {\n\t// An abort mark or close: the abort invocation or the reopened run handles the committed state.\n\truntime.signal.throwIfAborted();\n\tconst conversationId = runtime.conversationId;\n\tconst { attempt, compacted, model: ref, cutoff } = request;\n\tif (message.stopReason === \"deferred\" && message.deferred !== undefined) {\n\t\tconst handle = message.deferred;\n\t\tconst pollAt = Math.max(\n\t\t\truntime.now() + (handle.pollAfterMs ?? DEFAULT_POLL_AFTER_MS),\n\t\t\trequest.pollAt === undefined ? Number.NEGATIVE_INFINITY : request.pollAt + 1,\n\t\t);\n\t\tawait runtime.commit(async (tx) => {\n\t\t\t(await tx.doc(LiveDoc, conversationId)).generation = { attempt, deferred: { pollAt } };\n\t\t\tconst checkpoint = {\n\t\t\t\tphase: \"poll\",\n\t\t\t\tattempt,\n\t\t\t\t...(compacted === undefined ? {} : { compacted }),\n\t\t\t\tmodel: ref,\n\t\t\t\tcutoff,\n\t\t\t\thandle,\n\t\t\t\tpollAt,\n\t\t\t} as const;\n\t\t\treturn { status: \"running\", checkpoint };\n\t\t}, context);\n\t\treturn;\n\t}\n\tawait runtime.hooks.each(\"afterResponse\", (hook) => hook(message, runtime, context));\n\tconst calls = message.content.filter((content): content is ToolCall => content.type === \"toolCall\");\n\tif (message.stopReason === \"toolUse\" && calls.length > 0) {\n\t\treturn startToolRound(runtime, request, message, calls, context);\n\t}\n\tif (message.stopReason === \"stop\" || message.stopReason === \"length\" || message.stopReason === \"toolUse\") {\n\t\treturn answer(runtime, message, context);\n\t}\n\t// The retry and compaction policies govern the next attempt, so they are read now rather than pinned at preparation.\n\tconst settings = runtime.settings;\n\tconst overflow = message.stopReason === \"error\" && isContextOverflow(message);\n\tif (overflow && compacted === undefined && settings.compaction.enabled) {\n\t\tconst policy = settings.compaction;\n\t\tconst view = await runtime.context(conversationId, context, cutoff);\n\t\tif (selectCut(view, policy.keepRecentTokens) !== undefined) {\n\t\t\tconst text = message.errorMessage ?? \"Context overflow\";\n\t\t\tawait runtime.commit(async (tx): Promise<Next> => {\n\t\t\t\tconst live = await tx.doc(LiveDoc, conversationId);\n\t\t\t\tawait appendAssistant(tx, conversationId, message);\n\t\t\t\tdelete live.generation;\n\t\t\t\tconst child = await createCompaction(tx, conversationId, { reason: \"overflow\" }, runtime.taskId);\n\t\t\t\tconst checkpoint = { phase: \"prepare\", attempt, compacted: child, overflow: text } as const;\n\t\t\t\treturn { status: \"waiting\", checkpoint, on: [child], policy: \"allSettled\" };\n\t\t\t}, context);\n\t\t\treturn;\n\t\t}\n\t}\n\tconst policy = settings.retry;\n\t// An overflow is never retried: only a compaction can make the next request fit.\n\tconst retry =\n\t\tmessage.stopReason === \"error\" &&\n\t\t!overflow &&\n\t\tisRetryableAssistantError(message) &&\n\t\tpolicy.enabled &&\n\t\tattempt <= policy.maxRetries;\n\tconst until = retry ? runtime.now() + retryDelayMs(policy, attempt) : 0;\n\tawait runtime.commit(async (tx): Promise<Next> => {\n\t\tconst live = await tx.doc(LiveDoc, conversationId);\n\t\tawait appendAssistant(tx, conversationId, message);\n\t\tif (retry) {\n\t\t\tlive.generation = { attempt, retry: { at: until, error: message.errorMessage ?? \"\" } };\n\t\t\tconst checkpoint = {\n\t\t\t\tphase: \"retry\",\n\t\t\t\tattempt,\n\t\t\t\t...(compacted === undefined ? {} : { compacted }),\n\t\t\t\tuntil,\n\t\t\t} as const;\n\t\t\treturn { status: \"running\", checkpoint };\n\t\t}\n\t\tconst text = message.errorMessage ?? `Model response ended with stop reason ${message.stopReason}`;\n\t\tendRun(tx, live, runtime.taskId, { status: \"unanswered\", reason: \"model_error\", detail: text });\n\t\treturn {\n\t\t\tstatus: \"terminal\",\n\t\t\toutcome: { status: \"failed\", error: { message: text, detail: { reason: \"model_error\" } } },\n\t\t};\n\t}, context);\n}\n\n/**\n * A final answer; the final boundary places queued items (spec §6). The first `onYield` continuation appends a user\n * message and hands the run to a successor generation, but only when the boundary selected no user item and no reset.\n * Otherwise the run's inputs settle `done`, and selected user items start the next run.\n */\nasync function answer(runtime: Runtime, message: AssistantMessage, context: Context): Promise<void> {\n\tlet continuation: UserInput | undefined;\n\tawait runtime.hooks.each(\"onYield\", async (hook) => {\n\t\tif (continuation !== undefined) return;\n\t\tcontinuation = (await hook(message, runtime, context))?.continue;\n\t});\n\tconst conversationId = runtime.conversationId;\n\tawait runtime.commit(async (tx): Promise<Next> => {\n\t\t// Queue modes are read on the Session line, when the boundary is decided.\n\t\tconst boundary = await prepareBoundary(tx, conversationId, runtime.settings);\n\t\tconst live = await tx.doc(LiveDoc, conversationId);\n\t\tconst entry = await appendAssistant(tx, conversationId, message);\n\t\tconst result: Next = { status: \"terminal\", outcome: { status: \"completed\", result: { entryId: entry.id } } };\n\t\tconst { users, reset } = await applyBoundary(tx, boundary, \"final\", runtime.now());\n\t\tif (continuation !== undefined && users.length === 0 && !reset) {\n\t\t\tconst user = { role: \"user\", content: continuation, timestamp: runtime.now() } as const;\n\t\t\tawait tx.appendEntry(UserEntry, conversationId, { model: [user] });\n\t\t\thandOver(live, runtime.taskId, await createGeneration(tx, conversationId));\n\t\t\tdelete live.generation;\n\t\t\treturn result;\n\t\t}\n\t\tendRun(tx, live, runtime.taskId, { status: \"done\", answer: entry.id });\n\t\tif (users.length > 0) await startRun(tx, conversationId, live, users);\n\t\treturn result;\n\t}, context);\n}\n\n/**\n * Append the tool-calling answer and start its tool round in one commit (spec §8.3). A call to a tool the request did\n * not offer gets its `tool_unavailable` result here; every other call gets a tool task owned by the generation, only the\n * first one now when the round is sequential. The generation then waits for them in its `tools` phase, keeping the run.\n */\nasync function startToolRound(\n\truntime: Runtime,\n\trequest: Request,\n\tmessage: AssistantMessage,\n\tcalls: readonly ToolCall[],\n\tcontext: Context,\n): Promise<void> {\n\tconst conversationId = runtime.conversationId;\n\tconst messages = request.messages ?? (await runtime.context(conversationId, context, request.cutoff)).messages;\n\tconst offered = new Set(getCurrentTools(messages).map((tool) => tool.name));\n\t// Read as the round starts; a tool is resolved as its tool task resolves it.\n\tconst tools = (await runtime.agent(context)).tools;\n\tconst sequential =\n\t\truntime.settings.toolExecution === \"sequential\" ||\n\t\tcalls.some(\n\t\t\t(call) =>\n\t\t\t\toffered.has(call.name) && tools.find((tool) => tool.name === call.name)?.executionMode === \"sequential\",\n\t\t);\n\tawait runtime.commit(async (tx): Promise<Next> => {\n\t\tconst live = await tx.doc(LiveDoc, conversationId);\n\t\tconst entry = await appendAssistant(tx, conversationId, message);\n\t\tconst slots: ToolSlot[] = [];\n\t\tconst tools: TaskId<ToolTaskResult>[] = [];\n\t\tconst pending: string[] = [];\n\t\tfor (const call of calls) {\n\t\t\tif (!offered.has(call.name)) {\n\t\t\t\tconst unavailable = harnessError(\"tool_unavailable\", `Tool ${call.name} is not available`);\n\t\t\t\tconst result = await appendToolResult(tx, conversationId, call, unavailable, runtime.now());\n\t\t\t\tslots.push({ callId: call.id, name: call.name, status: \"done\", entry: result.id });\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (sequential && tools.length > 0) {\n\t\t\t\tpending.push(call.id);\n\t\t\t\tslots.push({ callId: call.id, name: call.name, status: \"pending\" });\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst taskId = await createToolTask(tx, runtime, entry.id, call.id);\n\t\t\ttools.push(taskId);\n\t\t\tslots.push({ callId: call.id, name: call.name, taskId, status: \"pending\" });\n\t\t}\n\t\tdelete live.generation;\n\t\tlive.tools = slots;\n\t\tconst checkpoint = { phase: \"tools\", assistant: entry.id, tools, pending } as const;\n\t\treturn { status: \"waiting\", checkpoint, on: tools, policy: \"allSettled\" };\n\t}, context);\n}\n\n/**\n * The round's tools are terminal: apply their controls and either end the run at the final boundary (`terminate`,\n * `handoff`, or a queued reset) or hand it to the next generation at the `postTools` boundary (spec §8.5).\n */\nasync function finishToolRound(\n\truntime: Runtime,\n\tassistant: EntryId,\n\ttools: readonly TaskId<ToolTaskResult>[],\n\tcontext: Context,\n): Promise<void> {\n\tconst conversationId = runtime.conversationId;\n\tconst controls = new Map<TaskId, ToolControl | undefined>();\n\tconst outcomes = await runtime.outcomes(tools, context);\n\ttools.forEach((id, index) => {\n\t\tconst outcome = outcomes[index]!;\n\t\tcontrols.set(id, outcome.status === \"completed\" ? outcome.result.control : undefined);\n\t});\n\tconst slots = (await runtime.snapshot(LiveDoc, conversationId, context))?.tools ?? [];\n\tconst results = slots.flatMap((slot) => (slot.entry === undefined ? [] : [slot.entry]));\n\tawait runtime.hooks.each(\"afterTools\", (hook) => hook(assistant, results, runtime, context));\n\t// Every call of the round, including those answered without a task, must ask to terminate.\n\tconst terminate =\n\t\tslots.length > 0 &&\n\t\tslots.every((slot) => slot.taskId !== undefined && controls.get(slot.taskId)?.terminate === true);\n\tconst added = [...controls.values()].flatMap((control) => control?.addTools ?? []);\n\t// The last handoff in call order wins.\n\tconst handoff = [...controls.values()].findLast((control) => control?.handoff !== undefined)?.handoff;\n\tawait runtime.commit(async (tx): Promise<Next> => {\n\t\tconst boundary = await prepareBoundary(tx, conversationId, runtime.settings);\n\t\tif (added.length > 0) await addTools(tx, conversationId, added);\n\t\tconst live = await tx.doc(LiveDoc, conversationId);\n\t\tconst now = runtime.now();\n\t\tif (terminate || handoff !== undefined) {\n\t\t\tif (handoff !== undefined) {\n\t\t\t\tconst message = { role: \"user\", content: handoff, timestamp: now } as const;\n\t\t\t\tconst entry = await tx.appendEntry(ResetEntry, conversationId, { head: \"self\", model: [message] });\n\t\t\t\tboundary.head = entry.id;\n\t\t\t}\n\t\t\tconst { users } = await applyBoundary(tx, boundary, \"final\", now);\n\t\t\tendRun(tx, live, runtime.taskId, { status: \"done\", answer: assistant });\n\t\t\tif (users.length > 0) await startRun(tx, conversationId, live, users);\n\t\t} else {\n\t\t\tconst { users, reset } = await applyBoundary(tx, boundary, \"postTools\", now);\n\t\t\tif (reset) {\n\t\t\t\t// The queued reset cut the run's context before an answer.\n\t\t\t\tendRun(tx, live, runtime.taskId, { status: \"unanswered\", reason: \"reset\" });\n\t\t\t\tif (users.length > 0) await startRun(tx, conversationId, live, users);\n\t\t\t} else {\n\t\t\t\tdelete live.tools;\n\t\t\t\tif (live.run?.taskId === runtime.taskId) live.run.inputs.push(...users);\n\t\t\t\thandOver(live, runtime.taskId, await createGeneration(tx, conversationId));\n\t\t\t}\n\t\t}\n\t\treturn { status: \"terminal\", outcome: { status: \"completed\", result: { entryId: assistant } } };\n\t}, context);\n}\n\n/**\n * Append a provider result and add its usage to `pi.usage` in the same commit.\n * REMINDER: every built-in writer of assistant entries goes through here, so the usage ledger stays complete.\n */\nasync function appendAssistant(\n\ttx: Tx,\n\tconversationId: ConversationId,\n\tmessage: AssistantMessage,\n): Promise<TypedEntry<never>> {\n\tawait recordUsage(tx, conversationId, \"models\", `${message.provider}/${message.model}`, message.usage);\n\treturn tx.appendEntry(AssistantEntry, conversationId, { model: [message] });\n}\n\n/** Start a run for `inputs`, placed input submissions: a new generation takes `pi.live.run`. */\nexport async function startRun(\n\ttx: Tx,\n\tconversationId: ConversationId,\n\tlive: Draft<LiveState>,\n\tinputs: SubmissionId[],\n): Promise<void> {\n\tlive.run = { taskId: await createGeneration(tx, conversationId), inputs };\n}\n\n/** A generation owned by its conversation. */\nfunction createGeneration(tx: Tx, conversationId: ConversationId): Promise<TaskId<GenerationResult>> {\n\treturn tx.createTask(GenerationTask, {}, { ownership: { kind: \"conversation\" }, conversationId });\n}\n\n/** Hand run control from `from` to `to`; the run's inputs move with it. */\nexport function handOver(live: Draft<LiveState>, from: TaskId, to: TaskId): void {\n\tif (live.run?.taskId === from) live.run.taskId = to;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"generation.js","sourceRoot":"","sources":["../../src/harness/generation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,QAAQ,EAA8B,MAAM,uB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gB,CAAC,EAAM,EAAE,cAA8B;IAC/D,OAAO,EAAE,CAAC,UAAU,CAAC,cAAc,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE,cAAc,EAAE,CAAC,CAAC;AACnG,CAAC;AAED,2EAA2E;AAC3E,MAAM,UAAU,QAAQ,CAAC,IAAsB,EAAE,IAAY,EAAE,EAAU;IACxE,IAAI,IAAI,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI;QAAE,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC;AACrD,CAAC","sourcesContent":["import { type Context, copyJson, type Draft, type JsonValue } from \"@earendil-works/chord\";\nimport type {\n\tApi,\n\tAssistantMessage,\n\tDeferredHandle,\n\tMessage,\n\tModel,\n\tModelThinkingLevel,\n\tSimpleStreamOptions,\n\tToolCall,\n} from \"@earendil-works/pi-ai\";\nimport { isContextOverflow } from \"@earendil-works/pi-ai/utils/overflow\";\nimport { isRetryableAssistantError, retryDelayMs } from \"@earendil-works/pi-ai/utils/retry\";\nimport { getCurrentTools } from \"@earendil-works/pi-ai/utils/transcript\";\nimport { AssistantEntry, ResetEntry, SystemEntry, UserEntry } from \"../entries.ts\";\nimport type { ExecutionEnv } from \"../env/index.ts\";\nimport { defineTask } from \"../tasks.ts\";\nimport type {\n\tConversationId,\n\tEntryId,\n\tNextTaskState,\n\tSubmissionId,\n\tTaskId,\n\tTaskOutcome,\n\tTaskRuntime,\n\tTx,\n\tTypedEntry,\n} from \"../types.ts\";\nimport { addTools } from \"./agent.ts\";\nimport { createCompaction, estimateContext, selectCut } from \"./compaction.ts\";\nimport { applyBoundary, prepareBoundary } from \"./inbox.ts\";\nimport { assignJson } from \"./json.ts\";\nimport { endRun, LiveDoc, type LiveState, type ToolSlot } from \"./live.ts\";\nimport { planSystemEntries, renderSections, replaySections } from \"./prompt.ts\";\nimport { ensureProviderSessionId } from \"./provider.ts\";\nimport { appendToolResult, harnessError, ToolTask, type ToolTaskResult } from \"./tool.ts\";\nimport type {\n\tCompactionPolicy,\n\tCompactionResult,\n\tContextView,\n\tConversationStreamOptions,\n\tGenerationHooks,\n\tModelRef,\n\tPromptInput,\n\tToolControl,\n\tUserInput,\n} from \"./types.ts\";\nimport { recordUsage } from \"./usage.ts\";\n\nexport type GenerationInput = Record<string, never>;\n\nexport type GenerationCheckpoint =\n\t| {\n\t\t\tphase: \"prepare\";\n\t\t\tattempt: number;\n\t\t\t/** The blocking compaction this generation waited for; it starts no other compaction (spec §8.3). */\n\t\t\tcompacted?: TaskId<CompactionResult>;\n\t\t\t/** Error text of the overflow that started `compacted`; checked once when `prepare` resumes. */\n\t\t\toverflow?: string;\n\t\t\t/** Set when the blocking threshold started `compacted`; its outcome is checked once when `prepare` resumes. */\n\t\t\tthreshold?: true;\n\t }\n\t| {\n\t\t\tphase: \"request\";\n\t\t\tattempt: number;\n\t\t\tcompacted?: TaskId<CompactionResult>;\n\t\t\tmodel: ModelRef;\n\t\t\tthinkingLevel: ModelThinkingLevel;\n\t\t\t/** The settings' request options when preparation committed; a resend after recovery uses them unchanged. */\n\t\t\tstreamOptions: ConversationStreamOptions;\n\t\t\t/** Newest entry included in the request. */\n\t\t\tcutoff: EntryId;\n\t }\n\t| { phase: \"retry\"; attempt: number; compacted?: TaskId<CompactionResult>; until: number }\n\t| {\n\t\t\tphase: \"poll\";\n\t\t\tattempt: number;\n\t\t\tcompacted?: TaskId<CompactionResult>;\n\t\t\tmodel: ModelRef;\n\t\t\tcutoff: EntryId;\n\t\t\thandle: DeferredHandle;\n\t\t\tpollAt: number;\n\t }\n\t| {\n\t\t\t/** Waiting on the round's tool tasks, which the generation owns (spec §8.5). */\n\t\t\tphase: \"tools\";\n\t\t\t/** The tool-calling answer. */\n\t\t\tassistant: EntryId;\n\t\t\t/** Tool tasks created so far, in call order; grows by one per started call of a sequential round. */\n\t\t\ttools: TaskId<ToolTaskResult>[];\n\t\t\t/** Calls of a sequential round not started yet, in call order. */\n\t\t\tpending: string[];\n\t };\n\nexport type GenerationResult = { entryId: EntryId };\n\ntype Runtime = TaskRuntime<GenerationInput, GenerationCheckpoint, GenerationResult, GenerationHooks>;\ntype Next = NextTaskState<GenerationCheckpoint, GenerationResult>;\n\n/** What classification needs from the request that produced a message. */\ntype Request = {\n\treadonly attempt: number;\n\treadonly compacted: TaskId<CompactionResult> | undefined;\n\treadonly model: ModelRef;\n\treadonly cutoff: EntryId;\n\t/** Committed model context through `cutoff`, when the phase already derived it. */\n\treadonly messages?: readonly Message[];\n\t/** Set when the message came from polling, so a still deferred result polls strictly later. */\n\treadonly pollAt?: number;\n};\n\nconst DEFAULT_POLL_AFTER_MS = 5000;\n\n/**\n * Built-in generation task: prepares the positional system prompt and tool loadout, requests or polls the model,\n * retries, and classifies the response. The run's inputs live in `pi.live.run`.\n */\nexport const GenerationTask = defineTask<GenerationInput, GenerationCheckpoint, GenerationResult, GenerationHooks>({\n\tname: \"pi.generation\",\n\tversion: 1,\n\tinitial: () => ({ phase: \"prepare\", attempt: 1 }),\n\tphases: {\n\t\t/**\n\t\t * Render the system prompt and tool loadout and append the positional `pi.system` entries they need, then move to\n\t\t * `request`. The agent and settings resolved here are fixed for this request. Only the Harness writes model\n\t\t * context to a busy conversation, so the context read here is still current at the commit; display-only entries\n\t\t * may land meanwhile.\n\t\t */\n\t\tprepare: async (task, runtime, context) => {\n\t\t\tconst { conversationId } = runtime;\n\t\t\tconst agent = await runtime.agent(context);\n\t\t\tconst settings = runtime.settings;\n\t\t\tconst { model, thinkingLevel } = agent;\n\t\t\tconst resolved = model === undefined ? undefined : runtime.models.getModel(model.provider, model.modelId);\n\t\t\tif (model === undefined || resolved === undefined) return failNoModel(runtime, model, context);\n\t\t\tconst { attempt, compacted, overflow, threshold: blocked } = task.state.checkpoint;\n\t\t\tif (compacted !== undefined && overflow !== undefined) {\n\t\t\t\tconst [outcome] = await runtime.outcomes([compacted], context);\n\t\t\t\tif (outcome?.status !== \"completed\" || outcome.result.entryId === undefined) {\n\t\t\t\t\treturn failModelError(runtime, overflow, context);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// A threshold compaction that found nothing to compact or was declined leaves a request that may still fit. One\n\t\t\t// that failed left a context it judged too large: sending it would at best leave no room for the answer.\n\t\t\tif (compacted !== undefined && blocked === true) {\n\t\t\t\tconst [outcome] = await runtime.outcomes([compacted], context);\n\t\t\t\tif (outcome !== undefined && outcome.status !== \"completed\") {\n\t\t\t\t\treturn failModelError(runtime, compactionFailure(outcome), context);\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst view = await runtime.context(conversationId, context);\n\t\t\tconst shown = replaySections(view.messages);\n\t\t\tconst report = (error: unknown) => runtime.report(error);\n\t\t\tlet env: ExecutionEnv | undefined;\n\t\t\ttry {\n\t\t\t\tenv = await runtime.env(context);\n\t\t\t} catch (error) {\n\t\t\t\tif (context.abortSignal?.aborted) throw error;\n\t\t\t\treport(error);\n\t\t\t}\n\t\t\tconst input: PromptInput = { conversationId, agent, env, shown: Object.fromEntries(shown), read: runtime };\n\t\t\tconst desired = await renderSections(agent.sections, input, shown, report, context);\n\t\t\tconst entries = planSystemEntries(view, desired, agent.tools, runtime.now());\n\t\t\tconst threshold =\n\t\t\t\tcompacted === undefined\n\t\t\t\t\t? thresholdCompaction(view, entries, resolved.contextWindow, settings.compaction)\n\t\t\t\t\t: undefined;\n\t\t\tif (threshold === \"blocking\") {\n\t\t\t\t// Compact first and prepare again; the transcript is unchanged until the compaction appends.\n\t\t\t\tawait runtime.commit(async (tx): Promise<Next> => {\n\t\t\t\t\tconst child = await createCompaction(tx, conversationId, { reason: \"threshold\" }, runtime.taskId);\n\t\t\t\t\tconst checkpoint = { phase: \"prepare\", attempt, compacted: child, threshold: true } as const;\n\t\t\t\t\treturn { status: \"waiting\", checkpoint, on: [child], policy: \"allSettled\" };\n\t\t\t\t}, context);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tawait runtime.commit(async (tx) => {\n\t\t\t\tlet cutoff = (await tx.scanEntries({ conversationId }, 1)).items[0]?.id;\n\t\t\t\tfor (const entry of entries) cutoff = (await tx.appendEntry(SystemEntry, conversationId, entry)).id;\n\t\t\t\tif (cutoff === undefined) throw new Error(`Conversation ${conversationId} has no entries to send`);\n\t\t\t\t// Checked in this commit, so a compaction admitted during preparation counts.\n\t\t\t\tif (threshold === \"background\" && (await tx.doc(LiveDoc, conversationId)).compactions === undefined) {\n\t\t\t\t\tawait createCompaction(tx, conversationId, { reason: \"threshold\" });\n\t\t\t\t}\n\t\t\t\tconst request = {\n\t\t\t\t\tattempt,\n\t\t\t\t\t...(compacted === undefined ? {} : { compacted }),\n\t\t\t\t\tmodel,\n\t\t\t\t\tthinkingLevel,\n\t\t\t\t\tstreamOptions: settings.stream,\n\t\t\t\t\tcutoff,\n\t\t\t\t};\n\t\t\t\treturn { status: \"running\", checkpoint: { phase: \"request\", ...request } };\n\t\t\t}, context);\n\t\t},\n\t\trequest: async (task, runtime, context) => {\n\t\t\tconst { attempt, compacted, model: ref, thinkingLevel, streamOptions, cutoff } = task.state.checkpoint;\n\t\t\tconst conversationId = runtime.conversationId;\n\t\t\tawait runtime.commit(async (tx) => {\n\t\t\t\tconst live = await tx.doc(LiveDoc, conversationId);\n\t\t\t\tawait convertPartial(tx, live, conversationId);\n\t\t\t\tlive.generation = { attempt };\n\t\t\t\treturn undefined;\n\t\t\t}, context);\n\t\t\tconst model = runtime.models.getModel(ref.provider, ref.modelId);\n\t\t\tif (model === undefined) return failNoModel(runtime, ref, context);\n\t\t\tconst view = await runtime.context(conversationId, context, { at: cutoff });\n\t\t\tlet messages = view.messages;\n\t\t\tawait runtime.hooks.each(\"beforeRequest\", async (hook) => {\n\t\t\t\tconst replaced = await hook({ messages }, runtime, context);\n\t\t\t\tif (replaced !== undefined) messages = replaced.messages;\n\t\t\t});\n\t\t\tconst options: SimpleStreamOptions = {\n\t\t\t\t...streamOptions,\n\t\t\t\tsignal: runtime.signal,\n\t\t\t\tsessionId: await ensureProviderSessionId(runtime, context),\n\t\t\t\t...(thinkingLevel === \"off\" ? {} : { reasoning: thinkingLevel }),\n\t\t\t};\n\t\t\tconst message = await streamResponse(runtime, model, messages, options, attempt, context);\n\t\t\tconst request = { attempt, compacted, model: ref, cutoff, messages: view.messages };\n\t\t\tawait classify(runtime, request, message, context);\n\t\t},\n\t\tretry: async (task, runtime, context) => {\n\t\t\tconst { attempt, compacted, until } = task.state.checkpoint;\n\t\t\tawait runtime.sleep(until, context);\n\t\t\tawait runtime.commit(async (tx) => {\n\t\t\t\t(await tx.doc(LiveDoc, runtime.conversationId)).generation = { attempt: attempt + 1 };\n\t\t\t\tconst checkpoint: GenerationCheckpoint = {\n\t\t\t\t\tphase: \"prepare\",\n\t\t\t\t\tattempt: attempt + 1,\n\t\t\t\t\t...(compacted === undefined ? {} : { compacted }),\n\t\t\t\t};\n\t\t\t\treturn { status: \"running\", checkpoint };\n\t\t\t}, context);\n\t\t},\n\t\tpoll: async (task, runtime, context) => {\n\t\t\tconst { attempt, compacted, model: ref, cutoff, handle, pollAt } = task.state.checkpoint;\n\t\t\tconst model = runtime.models.getModel(ref.provider, ref.modelId);\n\t\t\tif (model === undefined) return failNoModel(runtime, ref, context);\n\t\t\tawait runtime.sleep(pollAt, context);\n\t\t\tconst message = await runtime.models.fetchDeferred(model, handle, { signal: runtime.signal });\n\t\t\tconst request = { attempt, compacted, model: ref, cutoff, pollAt };\n\t\t\tawait classify(runtime, request, message, context);\n\t\t},\n\t\ttools: async (task, runtime, context) => {\n\t\t\tconst { assistant, tools, pending } = task.state.checkpoint;\n\t\t\tconst [next, ...rest] = pending;\n\t\t\tif (next === undefined) return finishToolRound(runtime, assistant, tools, context);\n\t\t\t// Sequential round: start the next call and wait for it.\n\t\t\tawait runtime.commit(async (tx): Promise<Next> => {\n\t\t\t\tconst live = await tx.doc(LiveDoc, runtime.conversationId);\n\t\t\t\tconst taskId = await createToolTask(tx, runtime, assistant, next);\n\t\t\t\tconst slot = live.tools?.find((slot) => slot.callId === next && slot.taskId === undefined);\n\t\t\t\tif (slot !== undefined) slot.taskId = taskId;\n\t\t\t\tconst checkpoint: GenerationCheckpoint = {\n\t\t\t\t\tphase: \"tools\",\n\t\t\t\t\tassistant,\n\t\t\t\t\ttools: [...tools, taskId],\n\t\t\t\t\tpending: rest,\n\t\t\t\t};\n\t\t\t\treturn { status: \"waiting\", checkpoint, on: [taskId], policy: \"allSettled\" };\n\t\t\t}, context);\n\t\t},\n\t},\n\tabort: async (task, runtime, context) => {\n\t\tconst checkpoint = task.state.checkpoint;\n\t\tif (checkpoint.phase === \"poll\") {\n\t\t\tconst model = runtime.models.getModel(checkpoint.model.provider, checkpoint.model.modelId);\n\t\t\tif (model !== undefined) {\n\t\t\t\ttry {\n\t\t\t\t\tawait runtime.models.cancelDeferred(model, checkpoint.handle, { signal: runtime.signal });\n\t\t\t\t} catch (error) {\n\t\t\t\t\truntime.report(error);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tconst conversationId = runtime.conversationId;\n\t\t// Runs after the round's tool tasks are terminal; calls never started get `aborted` results (spec §8.5).\n\t\tconst unstarted =\n\t\t\tcheckpoint.phase === \"tools\"\n\t\t\t\t? await readCalls(runtime, checkpoint.assistant, checkpoint.pending, context)\n\t\t\t\t: [];\n\t\tawait runtime.commit(async (tx) => {\n\t\t\tconst live = await tx.doc(LiveDoc, conversationId);\n\t\t\tawait convertPartial(tx, live, conversationId);\n\t\t\tfor (const call of unstarted) {\n\t\t\t\tconst result = harnessError(\"aborted\", `Tool ${call.name} was aborted`);\n\t\t\t\tawait appendToolResult(tx, conversationId, call, result, { timestamp: runtime.now() });\n\t\t\t}\n\t\t\tendRun(tx, live, runtime.taskId, { status: \"unanswered\", reason: \"aborted\" });\n\t\t\treturn { status: \"terminal\", outcome: { status: \"aborted\" } };\n\t\t}, context);\n\t},\n});\n\n/** The calls `callIds` of the assistant entry, in the given order. */\nasync function readCalls(\n\truntime: Runtime,\n\tassistant: EntryId,\n\tcallIds: readonly string[],\n\tcontext: Context,\n): Promise<ToolCall[]> {\n\tconst message = (await runtime.entry(AssistantEntry, assistant, context))?.model?.[0];\n\tconst calls = message?.role === \"assistant\" ? message.content.filter((content) => content.type === \"toolCall\") : [];\n\treturn callIds.flatMap((id) => calls.filter((call) => call.id === id).slice(0, 1));\n}\n\n/** A tool task for call `callId`, owned by the generation. */\nfunction createToolTask(tx: Tx, runtime: Runtime, assistant: EntryId, callId: string): Promise<TaskId<ToolTaskResult>> {\n\treturn tx.createTask(\n\t\tToolTask,\n\t\t{ kind: \"model\", assistant, callId },\n\t\t{ ownership: { kind: \"task\", taskId: runtime.taskId } },\n\t);\n}\n\n/**\n * Which threshold compaction preparation starts before its request (spec §8.3): `blocking` above\n * `contextWindow - reserveTokens`, `background` above the background threshold, and only when range selection finds a\n * cut. The caller starts a background one only while no compaction is listed.\n */\nfunction thresholdCompaction(\n\tview: ContextView,\n\tplanned: readonly { readonly model?: readonly Message[] }[],\n\tcontextWindow: number,\n\tpolicy: CompactionPolicy,\n): \"blocking\" | \"background\" | undefined {\n\tif (!policy.enabled || contextWindow <= 0) return undefined;\n\tconst tokens = estimateContext(\n\t\tview,\n\t\tplanned.flatMap((entry) => entry.model ?? []),\n\t);\n\tconst blocking = contextWindow - policy.reserveTokens;\n\tconst background = blocking - policy.backgroundTokens;\n\tconst over =\n\t\ttokens > blocking ? \"blocking\" : policy.backgroundTokens > 0 && tokens > background ? \"background\" : undefined;\n\tif (over === undefined || selectCut(view, policy.keepRecentTokens) === undefined) return undefined;\n\treturn over;\n}\n\n/** Error text for a generation whose blocking compaction ended without completing. */\nfunction compactionFailure(outcome: Exclude<TaskOutcome<CompactionResult>, { status: \"completed\" }>): string {\n\tswitch (outcome.status) {\n\t\tcase \"failed\":\n\t\tcase \"faulted\":\n\t\t\treturn `Compaction failed: ${outcome.error.message}`;\n\t\tcase \"orphaned\":\n\t\t\treturn `Compaction failed: ${outcome.reason}`;\n\t\tcase \"aborted\":\n\t\t\treturn \"Compaction was aborted\";\n\t}\n}\n\n/** Settle the run's inputs `unanswered` with `model_error` and fail with `text`. */\nasync function failModelError(runtime: Runtime, text: string, context: Context): Promise<void> {\n\tawait runtime.commit(async (tx) => {\n\t\tconst live = await tx.doc(LiveDoc, runtime.conversationId);\n\t\tendRun(tx, live, runtime.taskId, { status: \"unanswered\", reason: \"model_error\", detail: text });\n\t\treturn {\n\t\t\tstatus: \"terminal\",\n\t\t\toutcome: { status: \"failed\", error: { message: text, detail: { reason: \"model_error\" } } },\n\t\t};\n\t}, context);\n}\n\n/** Settle the run's inputs `unanswered` with `no_model` and fail. */\nasync function failNoModel(runtime: Runtime, ref: ModelRef | undefined, context: Context): Promise<void> {\n\tconst message =\n\t\tref === undefined ? \"No model is configured\" : `Model ${ref.provider}/${ref.modelId} is not available`;\n\tawait runtime.commit(async (tx) => {\n\t\tconst live = await tx.doc(LiveDoc, runtime.conversationId);\n\t\tendRun(tx, live, runtime.taskId, { status: \"unanswered\", reason: \"no_model\" });\n\t\treturn { status: \"terminal\", outcome: { status: \"failed\", error: { message, detail: { reason: \"no_model\" } } } };\n\t}, context);\n}\n\n/**\n * Append a committed partial left by an interrupted, aborted, faulted, or orphaned attempt as an aborted assistant\n * entry; the caller replaces or removes `generation`.\n */\nexport async function convertPartial(tx: Tx, live: Draft<LiveState>, conversationId: ConversationId): Promise<void> {\n\tconst partial = live.generation?.message;\n\tif (partial === undefined) return;\n\tconst message = copyJson(partial) as unknown as AssistantMessage;\n\tawait appendAssistant(tx, conversationId, { ...message, stopReason: \"aborted\" });\n}\n\n/**\n * Stream one request and return the terminal message. Partials commit as trailing writes at most every\n * `progress.partialIntervalMs` (default 100 ms) with one commit in flight; `finally` stops the throttle and awaits that\n * commit, so no stale partial lands after the outcome.\n */\nasync function streamResponse(\n\truntime: Runtime,\n\tmodel: Model<Api>,\n\tmessages: readonly Message[],\n\toptions: SimpleStreamOptions,\n\tattempt: number,\n\tcontext: Context,\n): Promise<AssistantMessage> {\n\tconst interval = runtime.settings.progress.partialIntervalMs;\n\tlet pending: AssistantMessage | undefined;\n\tlet timer: ReturnType<typeof setTimeout> | undefined;\n\tlet inFlight: Promise<void> | undefined;\n\tlet stopped = false;\n\tconst flush = (): void => {\n\t\ttimer = undefined;\n\t\tconst partial = pending;\n\t\tpending = undefined;\n\t\tif (partial === undefined || stopped) return;\n\t\tinFlight = (async () => {\n\t\t\t// Copy synchronously: the provider keeps mutating its partial.\n\t\t\tconst message = copyJson(partial, { omitUndefinedProperties: true });\n\t\t\tawait runtime.commit(async (tx) => {\n\t\t\t\tconst live = await tx.doc(LiveDoc, runtime.conversationId);\n\t\t\t\tlive.generation ??= { attempt };\n\t\t\t\tassignJson(live.generation as Draft<Record<string, JsonValue>>, \"message\", message);\n\t\t\t\treturn undefined;\n\t\t\t}, context);\n\t\t})()\n\t\t\t.catch((error: unknown) => {\n\t\t\t\t// Rejections after an abort mark or close are expected; the committed state stays consistent.\n\t\t\t\tif (!runtime.signal.aborted) runtime.report(error);\n\t\t\t})\n\t\t\t.finally(() => {\n\t\t\t\tinFlight = undefined;\n\t\t\t\tif (pending !== undefined && !stopped) timer = setTimeout(flush, interval);\n\t\t\t});\n\t};\n\ttry {\n\t\tconst events = runtime.models.streamSimple(model, { messages: [...messages] }, options);\n\t\tfor await (const event of events) {\n\t\t\t// A partial without content, such as pi-ai's opening `start` event, shows nothing; a deferred response\n\t\t\t// never gets past it, so it never leaves a partial.\n\t\t\tif (event.type === \"done\" || event.type === \"error\" || event.partial.content.length === 0) continue;\n\t\t\tpending = event.partial;\n\t\t\tif (timer === undefined && inFlight === undefined) timer = setTimeout(flush, interval);\n\t\t}\n\t\treturn await events.result();\n\t} finally {\n\t\tstopped = true;\n\t\tclearTimeout(timer);\n\t\tawait inFlight;\n\t}\n}\n\n/** Classify a terminal provider message in one commit that also clears the partial. */\nasync function classify(\n\truntime: Runtime,\n\trequest: Request,\n\tmessage: AssistantMessage,\n\tcontext: Context,\n): Promise<void> {\n\t// An abort mark or close: the abort invocation or the reopened run handles the committed state.\n\truntime.signal.throwIfAborted();\n\tconst conversationId = runtime.conversationId;\n\tconst { attempt, compacted, model: ref, cutoff } = request;\n\tif (message.stopReason === \"deferred\" && message.deferred !== undefined) {\n\t\tconst handle = message.deferred;\n\t\tconst pollAt = Math.max(\n\t\t\truntime.now() + (handle.pollAfterMs ?? DEFAULT_POLL_AFTER_MS),\n\t\t\trequest.pollAt === undefined ? Number.NEGATIVE_INFINITY : request.pollAt + 1,\n\t\t);\n\t\tawait runtime.commit(async (tx) => {\n\t\t\t(await tx.doc(LiveDoc, conversationId)).generation = { attempt, deferred: { pollAt } };\n\t\t\tconst checkpoint = {\n\t\t\t\tphase: \"poll\",\n\t\t\t\tattempt,\n\t\t\t\t...(compacted === undefined ? {} : { compacted }),\n\t\t\t\tmodel: ref,\n\t\t\t\tcutoff,\n\t\t\t\thandle,\n\t\t\t\tpollAt,\n\t\t\t} as const;\n\t\t\treturn { status: \"running\", checkpoint };\n\t\t}, context);\n\t\treturn;\n\t}\n\tawait runtime.hooks.each(\"afterResponse\", (hook) => hook(message, runtime, context));\n\tconst calls = message.content.filter((content): content is ToolCall => content.type === \"toolCall\");\n\tif (message.stopReason === \"toolUse\" && calls.length > 0) {\n\t\treturn startToolRound(runtime, request, message, calls, context);\n\t}\n\tif (message.stopReason === \"stop\" || message.stopReason === \"length\" || message.stopReason === \"toolUse\") {\n\t\treturn answer(runtime, message, context);\n\t}\n\t// The retry and compaction policies govern the next attempt, so they are read now rather than pinned at preparation.\n\tconst settings = runtime.settings;\n\tconst overflow = message.stopReason === \"error\" && isContextOverflow(message);\n\tif (overflow && compacted === undefined && settings.compaction.enabled) {\n\t\tconst policy = settings.compaction;\n\t\tconst view = await runtime.context(conversationId, context, { at: cutoff });\n\t\tif (selectCut(view, policy.keepRecentTokens) !== undefined) {\n\t\t\tconst text = message.errorMessage ?? \"Context overflow\";\n\t\t\tawait runtime.commit(async (tx): Promise<Next> => {\n\t\t\t\tconst live = await tx.doc(LiveDoc, conversationId);\n\t\t\t\tawait appendAssistant(tx, conversationId, message);\n\t\t\t\tdelete live.generation;\n\t\t\t\tconst child = await createCompaction(tx, conversationId, { reason: \"overflow\" }, runtime.taskId);\n\t\t\t\tconst checkpoint = { phase: \"prepare\", attempt, compacted: child, overflow: text } as const;\n\t\t\t\treturn { status: \"waiting\", checkpoint, on: [child], policy: \"allSettled\" };\n\t\t\t}, context);\n\t\t\treturn;\n\t\t}\n\t}\n\tconst policy = settings.retry;\n\t// An overflow is never retried: only a compaction can make the next request fit.\n\tconst retry =\n\t\tmessage.stopReason === \"error\" &&\n\t\t!overflow &&\n\t\tisRetryableAssistantError(message) &&\n\t\tpolicy.enabled &&\n\t\tattempt <= policy.maxRetries;\n\tconst until = retry ? runtime.now() + retryDelayMs(policy, attempt) : 0;\n\tawait runtime.commit(async (tx): Promise<Next> => {\n\t\tconst live = await tx.doc(LiveDoc, conversationId);\n\t\tawait appendAssistant(tx, conversationId, message);\n\t\tif (retry) {\n\t\t\tlive.generation = { attempt, retry: { at: until, error: message.errorMessage ?? \"\" } };\n\t\t\tconst checkpoint = {\n\t\t\t\tphase: \"retry\",\n\t\t\t\tattempt,\n\t\t\t\t...(compacted === undefined ? {} : { compacted }),\n\t\t\t\tuntil,\n\t\t\t} as const;\n\t\t\treturn { status: \"running\", checkpoint };\n\t\t}\n\t\tconst text = message.errorMessage ?? `Model response ended with stop reason ${message.stopReason}`;\n\t\tendRun(tx, live, runtime.taskId, { status: \"unanswered\", reason: \"model_error\", detail: text });\n\t\treturn {\n\t\t\tstatus: \"terminal\",\n\t\t\toutcome: { status: \"failed\", error: { message: text, detail: { reason: \"model_error\" } } },\n\t\t};\n\t}, context);\n}\n\n/**\n * A final answer; the final boundary places queued items (spec §6). The first `onYield` continuation appends a user\n * message and hands the run to a successor generation, but only when the boundary selected no user item and no reset.\n * Otherwise the run's inputs settle `done`, and selected user items start the next run.\n */\nasync function answer(runtime: Runtime, message: AssistantMessage, context: Context): Promise<void> {\n\tlet continuation: UserInput | undefined;\n\tawait runtime.hooks.each(\"onYield\", async (hook) => {\n\t\tif (continuation !== undefined) return;\n\t\tcontinuation = (await hook(message, runtime, context))?.continue;\n\t});\n\tconst conversationId = runtime.conversationId;\n\tawait runtime.commit(async (tx): Promise<Next> => {\n\t\t// Queue modes are read on the Session line, when the boundary is decided.\n\t\tconst boundary = await prepareBoundary(tx, conversationId, runtime.settings);\n\t\tconst live = await tx.doc(LiveDoc, conversationId);\n\t\tconst entry = await appendAssistant(tx, conversationId, message);\n\t\tconst result: Next = { status: \"terminal\", outcome: { status: \"completed\", result: { entryId: entry.id } } };\n\t\tconst { users, reset } = await applyBoundary(tx, boundary, \"final\", runtime.now());\n\t\tif (continuation !== undefined && users.length === 0 && !reset) {\n\t\t\tconst user = { role: \"user\", content: continuation, timestamp: runtime.now() } as const;\n\t\t\tawait tx.appendEntry(UserEntry, conversationId, { model: [user] });\n\t\t\thandOver(live, runtime.taskId, await createGeneration(tx, conversationId));\n\t\t\tdelete live.generation;\n\t\t\treturn result;\n\t\t}\n\t\tendRun(tx, live, runtime.taskId, { status: \"done\", answer: entry.id });\n\t\tif (users.length > 0) await startRun(tx, conversationId, live, users);\n\t\treturn result;\n\t}, context);\n}\n\n/**\n * Append the tool-calling answer and start its tool round in one commit (spec §8.3). A call to a tool the request did\n * not offer gets its `tool_unavailable` result here; every other call gets a tool task owned by the generation, only the\n * first one now when the round is sequential. The generation then waits for them in its `tools` phase, keeping the run.\n */\nasync function startToolRound(\n\truntime: Runtime,\n\trequest: Request,\n\tmessage: AssistantMessage,\n\tcalls: readonly ToolCall[],\n\tcontext: Context,\n): Promise<void> {\n\tconst conversationId = runtime.conversationId;\n\tconst messages =\n\t\trequest.messages ?? (await runtime.context(conversationId, context, { at: request.cutoff })).messages;\n\tconst offered = new Set(getCurrentTools(messages).map((tool) => tool.name));\n\t// Read as the round starts; a tool is resolved as its tool task resolves it.\n\tconst tools = (await runtime.agent(context)).tools;\n\tconst sequential =\n\t\truntime.settings.toolExecution === \"sequential\" ||\n\t\tcalls.some(\n\t\t\t(call) =>\n\t\t\t\toffered.has(call.name) && tools.find((tool) => tool.name === call.name)?.executionMode === \"sequential\",\n\t\t);\n\tawait runtime.commit(async (tx): Promise<Next> => {\n\t\tconst live = await tx.doc(LiveDoc, conversationId);\n\t\tconst entry = await appendAssistant(tx, conversationId, message);\n\t\tconst slots: ToolSlot[] = [];\n\t\tconst tools: TaskId<ToolTaskResult>[] = [];\n\t\tconst pending: string[] = [];\n\t\tfor (const call of calls) {\n\t\t\tif (!offered.has(call.name)) {\n\t\t\t\tconst unavailable = harnessError(\"tool_unavailable\", `Tool ${call.name} is not available`);\n\t\t\t\tconst result = await appendToolResult(tx, conversationId, call, unavailable, { timestamp: runtime.now() });\n\t\t\t\tslots.push({ callId: call.id, name: call.name, status: \"done\", entry: result.id });\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (sequential && tools.length > 0) {\n\t\t\t\tpending.push(call.id);\n\t\t\t\tslots.push({ callId: call.id, name: call.name, status: \"pending\" });\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst taskId = await createToolTask(tx, runtime, entry.id, call.id);\n\t\t\ttools.push(taskId);\n\t\t\tslots.push({ callId: call.id, name: call.name, taskId, status: \"pending\" });\n\t\t}\n\t\tdelete live.generation;\n\t\tlive.tools = slots;\n\t\tconst checkpoint = { phase: \"tools\", assistant: entry.id, tools, pending } as const;\n\t\treturn { status: \"waiting\", checkpoint, on: tools, policy: \"allSettled\" };\n\t}, context);\n}\n\n/**\n * The round's tools are terminal: apply their controls and either end the run at the final boundary (`terminate`,\n * `handoff`, or a queued reset) or hand it to the next generation at the `postTools` boundary (spec §8.5).\n */\nasync function finishToolRound(\n\truntime: Runtime,\n\tassistant: EntryId,\n\ttools: readonly TaskId<ToolTaskResult>[],\n\tcontext: Context,\n): Promise<void> {\n\tconst conversationId = runtime.conversationId;\n\tconst controls = new Map<TaskId, ToolControl | undefined>();\n\tconst outcomes = await runtime.outcomes(tools, context);\n\ttools.forEach((id, index) => {\n\t\tconst outcome = outcomes[index]!;\n\t\t// Version 1 results have no kind; every result a generation's round reads is a model-issued call's.\n\t\tcontrols.set(\n\t\t\tid,\n\t\t\toutcome.status === \"completed\" && outcome.result.kind !== \"nested\" ? outcome.result.control : undefined,\n\t\t);\n\t});\n\tconst slots = (await runtime.snapshot(LiveDoc, conversationId, context))?.tools ?? [];\n\tconst results = slots.flatMap((slot) => (slot.entry === undefined ? [] : [slot.entry]));\n\tawait runtime.hooks.each(\"afterTools\", (hook) => hook(assistant, results, runtime, context));\n\t// Every call of the round, including those answered without a task, must ask to terminate.\n\tconst terminate =\n\t\tslots.length > 0 &&\n\t\tslots.every((slot) => slot.taskId !== undefined && controls.get(slot.taskId)?.terminate === true);\n\tconst added = [...controls.values()].flatMap((control) => control?.addTools ?? []);\n\t// The last handoff in call order wins.\n\tconst handoff = [...controls.values()].findLast((control) => control?.handoff !== undefined)?.handoff;\n\tawait runtime.commit(async (tx): Promise<Next> => {\n\t\tconst boundary = await prepareBoundary(tx, conversationId, runtime.settings);\n\t\tif (added.length > 0) await addTools(tx, conversationId, added);\n\t\tconst live = await tx.doc(LiveDoc, conversationId);\n\t\tconst now = runtime.now();\n\t\tif (terminate || handoff !== undefined) {\n\t\t\tif (handoff !== undefined) {\n\t\t\t\tconst message = { role: \"user\", content: handoff, timestamp: now } as const;\n\t\t\t\tconst entry = await tx.appendEntry(ResetEntry, conversationId, { head: \"self\", model: [message] });\n\t\t\t\tboundary.head = entry.id;\n\t\t\t}\n\t\t\tconst { users } = await applyBoundary(tx, boundary, \"final\", now);\n\t\t\tendRun(tx, live, runtime.taskId, { status: \"done\", answer: assistant });\n\t\t\tif (users.length > 0) await startRun(tx, conversationId, live, users);\n\t\t} else {\n\t\t\tconst { users, reset } = await applyBoundary(tx, boundary, \"postTools\", now);\n\t\t\tif (reset) {\n\t\t\t\t// The queued reset cut the run's context before an answer.\n\t\t\t\tendRun(tx, live, runtime.taskId, { status: \"unanswered\", reason: \"reset\" });\n\t\t\t\tif (users.length > 0) await startRun(tx, conversationId, live, users);\n\t\t\t} else {\n\t\t\t\tdelete live.tools;\n\t\t\t\tdelete live.nestedTools;\n\t\t\t\tif (live.run?.taskId === runtime.taskId) live.run.inputs.push(...users);\n\t\t\t\thandOver(live, runtime.taskId, await createGeneration(tx, conversationId));\n\t\t\t}\n\t\t}\n\t\treturn { status: \"terminal\", outcome: { status: \"completed\", result: { entryId: assistant } } };\n\t}, context);\n}\n\n/**\n * Append a provider result and add its usage to `pi.usage` in the same commit.\n * REMINDER: every built-in writer of assistant entries goes through here, so the usage ledger stays complete.\n */\nasync function appendAssistant(\n\ttx: Tx,\n\tconversationId: ConversationId,\n\tmessage: AssistantMessage,\n): Promise<TypedEntry<never>> {\n\tawait recordUsage(tx, conversationId, \"models\", `${message.provider}/${message.model}`, message.usage);\n\treturn tx.appendEntry(AssistantEntry, conversationId, { model: [message] });\n}\n\n/** Start a run for `inputs`, placed input submissions: a new generation takes `pi.live.run`. */\nexport async function startRun(\n\ttx: Tx,\n\tconversationId: ConversationId,\n\tlive: Draft<LiveState>,\n\tinputs: SubmissionId[],\n): Promise<void> {\n\tlive.run = { taskId: await createGeneration(tx, conversationId), inputs };\n}\n\n/** A generation owned by its conversation. */\nfunction createGeneration(tx: Tx, conversationId: ConversationId): Promise<TaskId<GenerationResult>> {\n\treturn tx.createTask(GenerationTask, {}, { ownership: { kind: \"conversation\" }, conversationId });\n}\n\n/** Hand run control from `from` to `to`; the run's inputs move with it. */\nexport function handOver(live: Draft<LiveState>, from: TaskId, to: TaskId): void {\n\tif (live.run?.taskId === from) live.run.taskId = to;\n}\n"]}
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import type { Context } from "@earendil-works/chord";
|
|
2
2
|
import type { Storage } from "../types.ts";
|
|
3
3
|
import type { HarnessOptions, Harness as HarnessType, ToolRegistration } from "./types.ts";
|
|
4
|
+
/** Key of the Harness's internal index-size getter, for tests. */
|
|
5
|
+
export declare const SCHEDULER_INDEX_SIZES: unique symbol;
|
|
6
|
+
/**
|
|
7
|
+
* The host clock, falling back to `Date.now` when it throws: a broken clock must not stop commits. The first throw is
|
|
8
|
+
* reported; the clock is read in every task change, so later ones are not.
|
|
9
|
+
*/
|
|
10
|
+
export declare function safeNow(now: (() => number) | undefined, report: (error: unknown) => void): () => number;
|
|
4
11
|
/** Durable agent harness over one Session. */
|
|
5
12
|
export type Harness = HarnessType;
|
|
6
13
|
export declare const Harness: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harness.d.ts","sourceRoot":"","sources":["../../src/harness/harness.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA2B,OAAO,EAAa,MAAM,uBAAuB,CAAC;AAMzF,OAAO,KAAK,EASX,OAAO,EAKP,MAAM,aAAa,CAAC;AAYrB,OAAO,KAAK,EAYX,cAAc,EACd,OAAO,IAAI,WAAW,EAKtB,gBAAgB,EAChB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"harness.d.ts","sourceRoot":"","sources":["../../src/harness/harness.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA2B,OAAO,EAAa,MAAM,uBAAuB,CAAC;AAMzF,OAAO,KAAK,EASX,OAAO,EAKP,MAAM,aAAa,CAAC;AAYrB,OAAO,KAAK,EAYX,cAAc,EACd,OAAO,IAAI,WAAW,EAKtB,gBAAgB,EAChB,MAAM,YAAY,CAAC;AA+BpB,kEAAkE;AAClE,eAAO,MAAM,qBAAqB,eAA+C,CAAC;AA4SlF;;;GAGG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,CAAC,MAAM,MAAM,CAAC,GAAG,SAAS,EAAE,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAAG,MAAM,MAAM,CAevG;AAuCD,8CAA8C;AAC9C,MAAM,MAAM,OAAO,GAAG,WAAW,CAAC;AAElC,eAAO,MAAM,OAAO;IACnB,0FAA0F;IACpF,IAAI,CAAC,IAAI,SAAS,gBAAgB,WAC9B,OAAO,WACP,cAAc,CAAC,IAAI,CAAC,WACpB,OAAO,GACd,OAAO,CAAC,OAAO,CAAC;CAmBnB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { withAbortSignal, withoutAbortSignal } from "@earendil-works/chord/context";
|
|
2
2
|
import { ResetEntry } from "../entries.js";
|
|
3
|
-
import { SessionImpl } from "../session/session.js";
|
|
3
|
+
import { contained, SessionImpl } from "../session/session.js";
|
|
4
4
|
import { ROOT_CONVERSATION_ID } from "../types.js";
|
|
5
5
|
import { AgentDoc, configure, createAgent, resolveAgent, resolveSettings } from "./agent.js";
|
|
6
6
|
import { createCompaction } from "./compaction.js";
|
|
@@ -16,6 +16,8 @@ import { addUsageState, UsageDoc } from "./usage.js";
|
|
|
16
16
|
import { scanAll } from "./util.js";
|
|
17
17
|
import { ConversationViews } from "./view.js";
|
|
18
18
|
const SCAN_PAGE_SIZE = 256;
|
|
19
|
+
/** Key of the Harness's internal index-size getter, for tests. */
|
|
20
|
+
export const SCHEDULER_INDEX_SIZES = Symbol.for("pi-durable.schedulerIndexSizes");
|
|
19
21
|
class ConversationImpl {
|
|
20
22
|
id;
|
|
21
23
|
#host;
|
|
@@ -47,14 +49,15 @@ class ConversationImpl {
|
|
|
47
49
|
commit(change, context) {
|
|
48
50
|
return this.#host.harness.commitWith(change, context, { conversationId: this.id });
|
|
49
51
|
}
|
|
50
|
-
context(context) {
|
|
51
|
-
return readContext(this.#host.harness, this.#host.storage, this.id, context);
|
|
52
|
+
context(context, options) {
|
|
53
|
+
return readContext(this.#host.harness, this.#host.storage, this.id, context, options?.at);
|
|
52
54
|
}
|
|
53
55
|
entries(query, limit, cursor, context) {
|
|
54
56
|
const bounded = {
|
|
55
57
|
conversationId: this.id,
|
|
56
58
|
...(query.minEntryId === undefined ? {} : { minEntryId: query.minEntryId }),
|
|
57
59
|
...(query.maxEntryId === undefined ? {} : { maxEntryId: query.maxEntryId }),
|
|
60
|
+
...(query.order === undefined ? {} : { order: query.order }),
|
|
58
61
|
};
|
|
59
62
|
return this.#host.harness.readOnLine(() => this.#host.storage.scanEntries(bounded, limit, cursor, context));
|
|
60
63
|
}
|
|
@@ -78,20 +81,21 @@ class ConversationImpl {
|
|
|
78
81
|
}
|
|
79
82
|
/** Session kernel extended with conversation handles and a registry. */
|
|
80
83
|
class HarnessImpl extends SessionImpl {
|
|
81
|
-
#storage;
|
|
82
84
|
#options;
|
|
83
85
|
#report;
|
|
84
86
|
#host;
|
|
85
87
|
#tasks;
|
|
86
88
|
#submissions;
|
|
87
89
|
#taskGraph;
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
this
|
|
90
|
+
constructor(rawStorage, options, context) {
|
|
91
|
+
const report = safeReport(options.onReport);
|
|
92
|
+
const now = safeNow(options.now, report);
|
|
93
|
+
// Read at each use, as all settings are, but only this field: it is read on every commit.
|
|
94
|
+
super(rawStorage, now, () => options.settings?.documentRetentionMs);
|
|
95
|
+
// Every component reads and writes through the Session's failure guard: `rawStorage` serves only `super()`.
|
|
96
|
+
const storage = this.storage;
|
|
92
97
|
this.#options = options;
|
|
93
|
-
this.#report =
|
|
94
|
-
const now = options.now ?? Date.now;
|
|
98
|
+
this.#report = report;
|
|
95
99
|
const settings = () => resolveSettings(options.settings);
|
|
96
100
|
this.#tasks = new TaskScheduler({
|
|
97
101
|
session: this,
|
|
@@ -142,16 +146,20 @@ class HarnessImpl extends SessionImpl {
|
|
|
142
146
|
return this.#tasks.open(context);
|
|
143
147
|
}
|
|
144
148
|
resume() {
|
|
145
|
-
this
|
|
149
|
+
this.assertUsable();
|
|
146
150
|
this.#tasks.resume();
|
|
147
151
|
}
|
|
148
152
|
getTask(id, context) {
|
|
149
|
-
return this.readOnLine(() => this
|
|
153
|
+
return this.readOnLine(() => this.storage.task(id, context));
|
|
154
|
+
}
|
|
155
|
+
/** Internal, for tests: sizes of the scheduler's ownership indexes. */
|
|
156
|
+
get [SCHEDULER_INDEX_SIZES]() {
|
|
157
|
+
return this.#tasks.indexSizes;
|
|
150
158
|
}
|
|
151
159
|
inspect(context) {
|
|
152
160
|
return this.readOnLine(async () => {
|
|
153
161
|
const { scheduling, tasks } = await this.#tasks.inspect(this.#options.registry.snapshot());
|
|
154
|
-
const scan = (status) => scanAll((cursor) => this
|
|
162
|
+
const scan = (status) => scanAll((cursor) => this.storage.scanSubmissions({ status }, SCAN_PAGE_SIZE, cursor, context));
|
|
155
163
|
const submissions = [...(await scan("queued")), ...(await scan("placed"))].sort((a, b) => a.id - b.id);
|
|
156
164
|
return { scheduling, tasks, submissions };
|
|
157
165
|
});
|
|
@@ -175,7 +183,7 @@ class HarnessImpl extends SessionImpl {
|
|
|
175
183
|
}
|
|
176
184
|
/** Sum every conversation's committed `pi.usage`. Each document is read at its own point; totals only grow. */
|
|
177
185
|
async usage(context) {
|
|
178
|
-
const conversations = await this.readOnLine(() => scanAll((cursor) => this
|
|
186
|
+
const conversations = await this.readOnLine(() => scanAll((cursor) => this.storage.scanConversations({}, SCAN_PAGE_SIZE, cursor, context)));
|
|
179
187
|
const total = UsageDoc.definition.initial();
|
|
180
188
|
for (const { id } of conversations) {
|
|
181
189
|
const state = await this.snapshot(UsageDoc, id, context);
|
|
@@ -194,23 +202,22 @@ class HarnessImpl extends SessionImpl {
|
|
|
194
202
|
return this.#create({ kind: "root" }, options ?? {}, context);
|
|
195
203
|
}
|
|
196
204
|
async conversation(id, context) {
|
|
197
|
-
this
|
|
198
|
-
const record = await this.readOnLine(() => this
|
|
205
|
+
this.assertUsable();
|
|
206
|
+
const record = await this.readOnLine(() => this.storage.conversation(id, context));
|
|
199
207
|
return record === undefined ? undefined : new ConversationImpl(record.id, this.#host);
|
|
200
208
|
}
|
|
201
209
|
createConversation(options, context) {
|
|
202
210
|
return this.#create({ kind: "independent", ownership: options.ownership }, options, context);
|
|
203
211
|
}
|
|
204
|
-
|
|
205
|
-
this.#
|
|
206
|
-
return super.close(context);
|
|
212
|
+
report(error) {
|
|
213
|
+
this.#report(error);
|
|
207
214
|
}
|
|
208
|
-
/**
|
|
215
|
+
/** Signal and join task invocations after the close listeners and before Storage closes; writes no task outcome. */
|
|
209
216
|
beforeClose() {
|
|
210
217
|
return this.#tasks.join();
|
|
211
218
|
}
|
|
212
219
|
async #create(target, options, context) {
|
|
213
|
-
this
|
|
220
|
+
this.assertUsable();
|
|
214
221
|
const id = await this.commitWith(async (tx) => {
|
|
215
222
|
if (target.kind === "root" && (await tx.conversation(ROOT_CONVERSATION_ID)) !== undefined) {
|
|
216
223
|
return ROOT_CONVERSATION_ID;
|
|
@@ -241,10 +248,32 @@ class HarnessImpl extends SessionImpl {
|
|
|
241
248
|
await createAgent(tx, record);
|
|
242
249
|
await this.#options.conversationCreated?.(tx, record);
|
|
243
250
|
}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
}
|
|
251
|
+
}
|
|
252
|
+
/** `onReport` that cannot fail: it is the last place an error goes, so its own throw or rejection is dropped. */
|
|
253
|
+
function safeReport(onReport) {
|
|
254
|
+
return (error) => contained(() => onReport?.(error), () => { });
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* The host clock, falling back to `Date.now` when it throws: a broken clock must not stop commits. The first throw is
|
|
258
|
+
* reported; the clock is read in every task change, so later ones are not.
|
|
259
|
+
*/
|
|
260
|
+
export function safeNow(now, report) {
|
|
261
|
+
if (now === undefined)
|
|
262
|
+
return Date.now;
|
|
263
|
+
let reported = false;
|
|
264
|
+
return () => {
|
|
265
|
+
try {
|
|
266
|
+
return now();
|
|
267
|
+
}
|
|
268
|
+
catch (error) {
|
|
269
|
+
// Set first: a report handler that reads the clock again must not report again.
|
|
270
|
+
if (!reported) {
|
|
271
|
+
reported = true;
|
|
272
|
+
report(error);
|
|
273
|
+
}
|
|
274
|
+
return Date.now();
|
|
275
|
+
}
|
|
276
|
+
};
|
|
248
277
|
}
|
|
249
278
|
/**
|
|
250
279
|
* Invocation-bound handle for tasks and tools. Every operation, and every operation of a submission it returns, first
|
|
@@ -293,9 +322,8 @@ export const Harness = {
|
|
|
293
322
|
}
|
|
294
323
|
catch (error) {
|
|
295
324
|
// The caller's context may be what failed open: close without it, and rethrow the open error.
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
.catch((closeError) => options.onReport?.(closeError));
|
|
325
|
+
// A failing Storage close fails the Session, which reports it.
|
|
326
|
+
await harness.close(withoutAbortSignal(context)).catch(() => { });
|
|
299
327
|
throw error;
|
|
300
328
|
}
|
|
301
329
|
return harness;
|