@harrylabsj/kiwi-merchant-cloud 0.12.4 → 0.12.6
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/buyer-core/service.d.ts +22 -1
- package/app/buyer-core/service.js +325 -33
- package/app/buyer-core/service.js.map +1 -1
- package/app/buyer-core/store.d.ts +23 -0
- package/app/buyer-core/store.js +71 -8
- package/app/buyer-core/store.js.map +1 -1
- package/app/cloud/bootstrap.d.ts +17 -0
- package/app/cloud/bootstrap.js +96 -59
- package/app/cloud/bootstrap.js.map +1 -1
- package/app/cloud/config.d.ts +26 -0
- package/app/cloud/config.js +75 -3
- package/app/cloud/config.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 +72 -0
- package/app/cloud/main.js +332 -11
- package/app/cloud/main.js.map +1 -1
- package/app/cloud/owned-clock.d.ts +27 -0
- package/app/cloud/owned-clock.js +98 -0
- package/app/cloud/owned-clock.js.map +1 -0
- package/app/cloud/owned-runtime.d.ts +188 -0
- package/app/cloud/owned-runtime.js +1041 -0
- package/app/cloud/owned-runtime.js.map +1 -0
- 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/demo/demo-runner.js +6 -0
- package/app/demo/demo-runner.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/destination.d.ts +2 -0
- package/app/handoff/destination.js +4 -0
- package/app/handoff/destination.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 +4103 -3123
- 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/node_modules/hono/README.md +1 -1
- package/node_modules/hono/dist/_virtual/_rolldown/runtime.js +13 -0
- package/node_modules/hono/dist/adapter/aws-lambda/conninfo.js +42 -23
- package/node_modules/hono/dist/adapter/aws-lambda/handler.js +320 -342
- package/node_modules/hono/dist/adapter/aws-lambda/index.js +2 -8
- package/node_modules/hono/dist/adapter/aws-lambda/types.js +1 -0
- package/node_modules/hono/dist/adapter/bun/conninfo.js +20 -25
- package/node_modules/hono/dist/adapter/bun/index.js +3 -13
- package/node_modules/hono/dist/adapter/bun/serve-static.js +27 -27
- package/node_modules/hono/dist/adapter/bun/server.js +11 -5
- package/node_modules/hono/dist/adapter/bun/ssg.js +25 -15
- package/node_modules/hono/dist/adapter/bun/websocket.js +61 -68
- package/node_modules/hono/dist/adapter/cloudflare-pages/conninfo.js +24 -9
- package/node_modules/hono/dist/adapter/cloudflare-pages/handler.js +59 -62
- package/node_modules/hono/dist/adapter/cloudflare-pages/index.js +2 -8
- package/node_modules/hono/dist/adapter/cloudflare-workers/conninfo.js +7 -9
- package/node_modules/hono/dist/adapter/cloudflare-workers/index.js +3 -8
- package/node_modules/hono/dist/adapter/cloudflare-workers/serve-static-module.js +5 -6
- package/node_modules/hono/dist/adapter/cloudflare-workers/serve-static.js +26 -20
- package/node_modules/hono/dist/adapter/cloudflare-workers/utils.js +21 -34
- package/node_modules/hono/dist/adapter/cloudflare-workers/websocket.js +31 -39
- package/node_modules/hono/dist/adapter/deno/conninfo.js +16 -13
- package/node_modules/hono/dist/adapter/deno/deno.d.js +1 -0
- package/node_modules/hono/dist/adapter/deno/index.js +3 -10
- package/node_modules/hono/dist/adapter/deno/serve-static.js +33 -38
- package/node_modules/hono/dist/adapter/deno/ssg.js +27 -16
- package/node_modules/hono/dist/adapter/deno/websocket.js +30 -30
- package/node_modules/hono/dist/adapter/lambda-edge/conninfo.js +7 -9
- package/node_modules/hono/dist/adapter/lambda-edge/handler.js +102 -87
- package/node_modules/hono/dist/adapter/lambda-edge/index.js +2 -6
- package/node_modules/hono/dist/adapter/netlify/conninfo.js +24 -9
- package/node_modules/hono/dist/adapter/netlify/handler.js +10 -8
- package/node_modules/hono/dist/adapter/netlify/index.js +3 -2
- package/node_modules/hono/dist/adapter/netlify/mod.js +2 -6
- package/node_modules/hono/dist/adapter/service-worker/handler.js +15 -19
- package/node_modules/hono/dist/adapter/service-worker/index.js +23 -7
- package/node_modules/hono/dist/adapter/service-worker/types.js +1 -0
- package/node_modules/hono/dist/adapter/vercel/conninfo.js +7 -10
- package/node_modules/hono/dist/adapter/vercel/handler.js +8 -6
- package/node_modules/hono/dist/adapter/vercel/index.js +2 -6
- package/node_modules/hono/dist/cjs/_virtual/_rolldown/runtime.js +33 -0
- package/node_modules/hono/dist/cjs/adapter/aws-lambda/conninfo.js +42 -44
- package/node_modules/hono/dist/cjs/adapter/aws-lambda/handler.js +328 -371
- package/node_modules/hono/dist/cjs/adapter/aws-lambda/index.js +7 -34
- package/node_modules/hono/dist/cjs/adapter/aws-lambda/types.js +0 -15
- package/node_modules/hono/dist/cjs/adapter/bun/conninfo.js +21 -47
- package/node_modules/hono/dist/cjs/adapter/bun/index.js +14 -45
- package/node_modules/hono/dist/cjs/adapter/bun/serve-static.js +29 -50
- package/node_modules/hono/dist/cjs/adapter/bun/server.js +11 -26
- package/node_modules/hono/dist/cjs/adapter/bun/ssg.js +24 -35
- package/node_modules/hono/dist/cjs/adapter/bun/websocket.js +63 -91
- package/node_modules/hono/dist/cjs/adapter/cloudflare-pages/conninfo.js +25 -31
- package/node_modules/hono/dist/cjs/adapter/cloudflare-pages/handler.js +61 -85
- package/node_modules/hono/dist/cjs/adapter/cloudflare-pages/index.js +7 -34
- package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/conninfo.js +8 -31
- package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/index.js +7 -33
- package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/serve-static-module.js +7 -29
- package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/serve-static.js +27 -42
- package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/utils.js +21 -55
- package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/websocket.js +33 -62
- package/node_modules/hono/dist/cjs/adapter/deno/conninfo.js +16 -34
- package/node_modules/hono/dist/cjs/adapter/deno/index.js +10 -38
- package/node_modules/hono/dist/cjs/adapter/deno/serve-static.js +33 -59
- package/node_modules/hono/dist/cjs/adapter/deno/ssg.js +27 -37
- package/node_modules/hono/dist/cjs/adapter/deno/websocket.js +32 -53
- package/node_modules/hono/dist/cjs/adapter/lambda-edge/conninfo.js +8 -31
- package/node_modules/hono/dist/cjs/adapter/lambda-edge/handler.js +105 -119
- package/node_modules/hono/dist/cjs/adapter/lambda-edge/index.js +5 -30
- package/node_modules/hono/dist/cjs/adapter/netlify/conninfo.js +25 -31
- package/node_modules/hono/dist/cjs/adapter/netlify/handler.js +10 -29
- package/node_modules/hono/dist/cjs/adapter/netlify/index.js +5 -21
- package/node_modules/hono/dist/cjs/adapter/netlify/mod.js +5 -30
- package/node_modules/hono/dist/cjs/adapter/service-worker/handler.js +16 -41
- package/node_modules/hono/dist/cjs/adapter/service-worker/index.js +25 -30
- package/node_modules/hono/dist/cjs/adapter/service-worker/types.js +0 -15
- package/node_modules/hono/dist/cjs/adapter/vercel/conninfo.js +8 -32
- package/node_modules/hono/dist/cjs/adapter/vercel/handler.js +8 -27
- package/node_modules/hono/dist/cjs/adapter/vercel/index.js +5 -30
- package/node_modules/hono/dist/cjs/client/client.js +139 -212
- package/node_modules/hono/dist/cjs/client/fetch-result-please.js +62 -80
- package/node_modules/hono/dist/cjs/client/index.js +7 -32
- package/node_modules/hono/dist/cjs/client/types.js +0 -15
- package/node_modules/hono/dist/cjs/client/utils.js +54 -92
- package/node_modules/hono/dist/cjs/compose.js +49 -66
- package/node_modules/hono/dist/cjs/context.js +379 -450
- package/node_modules/hono/dist/cjs/helper/accepts/accepts.js +47 -70
- package/node_modules/hono/dist/cjs/helper/accepts/index.js +3 -27
- package/node_modules/hono/dist/cjs/helper/adapter/index.js +33 -73
- package/node_modules/hono/dist/cjs/helper/conninfo/index.js +0 -15
- package/node_modules/hono/dist/cjs/helper/conninfo/types.js +0 -15
- package/node_modules/hono/dist/cjs/helper/cookie/index.js +75 -116
- package/node_modules/hono/dist/cjs/helper/css/common.js +165 -244
- package/node_modules/hono/dist/cjs/helper/css/index.js +136 -151
- package/node_modules/hono/dist/cjs/helper/dev/index.js +45 -71
- package/node_modules/hono/dist/cjs/helper/factory/index.js +30 -51
- package/node_modules/hono/dist/cjs/helper/html/index.js +32 -62
- package/node_modules/hono/dist/cjs/helper/proxy/index.js +113 -106
- package/node_modules/hono/dist/cjs/helper/route/index.js +123 -66
- package/node_modules/hono/dist/cjs/helper/ssg/index.js +19 -43
- package/node_modules/hono/dist/cjs/helper/ssg/middleware.js +56 -64
- package/node_modules/hono/dist/cjs/helper/ssg/plugins.js +55 -57
- package/node_modules/hono/dist/cjs/helper/ssg/ssg.js +196 -296
- package/node_modules/hono/dist/cjs/helper/ssg/utils.js +47 -90
- package/node_modules/hono/dist/cjs/helper/streaming/index.js +8 -35
- package/node_modules/hono/dist/cjs/helper/streaming/sse.js +53 -85
- package/node_modules/hono/dist/cjs/helper/streaming/stream.js +23 -53
- package/node_modules/hono/dist/cjs/helper/streaming/text.js +10 -32
- package/node_modules/hono/dist/cjs/helper/streaming/utils.js +13 -32
- package/node_modules/hono/dist/cjs/helper/testing/index.js +16 -31
- package/node_modules/hono/dist/cjs/helper/websocket/index.js +51 -76
- package/node_modules/hono/dist/cjs/hono-base.js +345 -403
- package/node_modules/hono/dist/cjs/hono.js +28 -42
- package/node_modules/hono/dist/cjs/http-exception.js +55 -56
- package/node_modules/hono/dist/cjs/index.js +22 -30
- package/node_modules/hono/dist/cjs/jsx/base.js +237 -366
- package/node_modules/hono/dist/cjs/jsx/children.js +16 -41
- package/node_modules/hono/dist/cjs/jsx/components.js +119 -192
- package/node_modules/hono/dist/cjs/jsx/constants.js +15 -42
- package/node_modules/hono/dist/cjs/jsx/context.js +144 -162
- package/node_modules/hono/dist/cjs/jsx/dom/client.js +49 -69
- package/node_modules/hono/dist/cjs/jsx/dom/components.js +23 -52
- package/node_modules/hono/dist/cjs/jsx/dom/context.js +39 -67
- package/node_modules/hono/dist/cjs/jsx/dom/css.js +143 -158
- package/node_modules/hono/dist/cjs/jsx/dom/hooks/index.js +55 -64
- package/node_modules/hono/dist/cjs/jsx/dom/index.js +114 -173
- package/node_modules/hono/dist/cjs/jsx/dom/intrinsic-element/components.js +282 -375
- package/node_modules/hono/dist/cjs/jsx/dom/jsx-dev-runtime.js +14 -49
- package/node_modules/hono/dist/cjs/jsx/dom/jsx-runtime.js +5 -32
- package/node_modules/hono/dist/cjs/jsx/dom/render.js +471 -589
- package/node_modules/hono/dist/cjs/jsx/dom/server.js +37 -64
- package/node_modules/hono/dist/cjs/jsx/dom/utils.js +7 -30
- package/node_modules/hono/dist/cjs/jsx/hooks/index.js +225 -318
- package/node_modules/hono/dist/cjs/jsx/index.js +86 -135
- package/node_modules/hono/dist/cjs/jsx/intrinsic-element/common.js +20 -43
- package/node_modules/hono/dist/cjs/jsx/intrinsic-element/components.js +117 -168
- package/node_modules/hono/dist/cjs/jsx/intrinsic-elements.js +0 -15
- package/node_modules/hono/dist/cjs/jsx/jsx-dev-runtime.js +14 -39
- package/node_modules/hono/dist/cjs/jsx/jsx-runtime.js +34 -68
- package/node_modules/hono/dist/cjs/jsx/streaming.js +123 -166
- package/node_modules/hono/dist/cjs/jsx/types.js +0 -15
- package/node_modules/hono/dist/cjs/jsx/utils.js +91 -175
- package/node_modules/hono/dist/cjs/middleware/basic-auth/index.js +98 -86
- package/node_modules/hono/dist/cjs/middleware/bearer-auth/index.js +92 -109
- package/node_modules/hono/dist/cjs/middleware/body-limit/index.js +66 -72
- package/node_modules/hono/dist/cjs/middleware/cache/index.js +153 -199
- package/node_modules/hono/dist/cjs/middleware/combine/index.js +133 -95
- package/node_modules/hono/dist/cjs/middleware/compress/index.js +73 -88
- package/node_modules/hono/dist/cjs/middleware/context-storage/index.js +49 -41
- package/node_modules/hono/dist/cjs/middleware/cors/index.js +107 -107
- package/node_modules/hono/dist/cjs/middleware/csrf/index.js +101 -72
- package/node_modules/hono/dist/cjs/middleware/etag/digest.js +58 -97
- package/node_modules/hono/dist/cjs/middleware/etag/index.js +71 -91
- package/node_modules/hono/dist/cjs/middleware/ip-restriction/index.js +161 -169
- package/node_modules/hono/dist/cjs/middleware/jsx-renderer/index.js +99 -77
- package/node_modules/hono/dist/cjs/middleware/jwk/index.js +3 -27
- package/node_modules/hono/dist/cjs/middleware/jwk/jwk.js +118 -135
- package/node_modules/hono/dist/cjs/middleware/jwt/index.js +9 -38
- package/node_modules/hono/dist/cjs/middleware/jwt/jwt.js +120 -141
- package/node_modules/hono/dist/cjs/middleware/language/index.js +7 -35
- package/node_modules/hono/dist/cjs/middleware/language/language.js +184 -179
- package/node_modules/hono/dist/cjs/middleware/logger/index.js +41 -62
- package/node_modules/hono/dist/cjs/middleware/method-not-allowed/index.js +82 -88
- package/node_modules/hono/dist/cjs/middleware/method-override/index.js +101 -102
- package/node_modules/hono/dist/cjs/middleware/powered-by/index.js +23 -30
- package/node_modules/hono/dist/cjs/middleware/pretty-json/index.js +38 -36
- package/node_modules/hono/dist/cjs/middleware/request-id/index.js +3 -27
- package/node_modules/hono/dist/cjs/middleware/request-id/request-id.js +34 -42
- package/node_modules/hono/dist/cjs/middleware/secure-headers/index.js +4 -29
- package/node_modules/hono/dist/cjs/middleware/secure-headers/permissions-policy.js +0 -15
- package/node_modules/hono/dist/cjs/middleware/secure-headers/secure-headers.js +142 -174
- package/node_modules/hono/dist/cjs/middleware/serve-static/index.js +56 -93
- package/node_modules/hono/dist/cjs/middleware/serve-static/path.js +15 -38
- package/node_modules/hono/dist/cjs/middleware/timeout/index.js +40 -45
- package/node_modules/hono/dist/cjs/middleware/timing/index.js +7 -35
- package/node_modules/hono/dist/cjs/middleware/timing/timing.js +177 -118
- package/node_modules/hono/dist/cjs/middleware/trailing-slash/index.js +85 -58
- package/node_modules/hono/dist/cjs/preset/quick.js +18 -37
- package/node_modules/hono/dist/cjs/preset/tiny.js +15 -33
- package/node_modules/hono/dist/cjs/request/constants.js +5 -27
- package/node_modules/hono/dist/cjs/request.js +334 -343
- package/node_modules/hono/dist/cjs/router/linear-router/index.js +3 -27
- package/node_modules/hono/dist/cjs/router/linear-router/router.js +95 -143
- package/node_modules/hono/dist/cjs/router/pattern-router/index.js +3 -27
- package/node_modules/hono/dist/cjs/router/pattern-router/router.js +41 -63
- package/node_modules/hono/dist/cjs/router/reg-exp-router/index.js +7 -34
- package/node_modules/hono/dist/cjs/router/reg-exp-router/matcher.js +18 -45
- package/node_modules/hono/dist/cjs/router/reg-exp-router/node.js +91 -135
- package/node_modules/hono/dist/cjs/router/reg-exp-router/prepared-router.js +92 -161
- package/node_modules/hono/dist/cjs/router/reg-exp-router/router.js +98 -147
- package/node_modules/hono/dist/cjs/router/reg-exp-router/trie.js +73 -89
- package/node_modules/hono/dist/cjs/router/smart-router/index.js +3 -27
- package/node_modules/hono/dist/cjs/router/smart-router/router.js +49 -79
- package/node_modules/hono/dist/cjs/router/trie-router/index.js +3 -27
- package/node_modules/hono/dist/cjs/router/trie-router/node.js +134 -186
- package/node_modules/hono/dist/cjs/router/trie-router/router.js +15 -39
- package/node_modules/hono/dist/cjs/router/utils.js +5 -27
- package/node_modules/hono/dist/cjs/router.js +37 -37
- package/node_modules/hono/dist/cjs/types.js +5 -28
- package/node_modules/hono/dist/cjs/utils/accept.js +177 -228
- package/node_modules/hono/dist/cjs/utils/basic-auth.js +16 -40
- package/node_modules/hono/dist/cjs/utils/body.js +84 -110
- package/node_modules/hono/dist/cjs/utils/buffer.js +43 -91
- package/node_modules/hono/dist/cjs/utils/color.js +35 -44
- package/node_modules/hono/dist/cjs/utils/compress.js +11 -26
- package/node_modules/hono/dist/cjs/utils/concurrent.js +29 -59
- package/node_modules/hono/dist/cjs/utils/constants.js +7 -26
- package/node_modules/hono/dist/cjs/utils/cookie.js +107 -177
- package/node_modules/hono/dist/cjs/utils/crypto.js +30 -61
- package/node_modules/hono/dist/cjs/utils/encode.js +31 -48
- package/node_modules/hono/dist/cjs/utils/filepath.js +23 -54
- package/node_modules/hono/dist/cjs/utils/handler.js +11 -33
- package/node_modules/hono/dist/cjs/utils/headers.js +0 -15
- package/node_modules/hono/dist/cjs/utils/html.js +96 -137
- package/node_modules/hono/dist/cjs/utils/http-status.js +0 -15
- package/node_modules/hono/dist/cjs/utils/ipaddr.js +213 -286
- package/node_modules/hono/dist/cjs/utils/jwt/index.js +14 -27
- package/node_modules/hono/dist/cjs/utils/jwt/jwa.js +25 -42
- package/node_modules/hono/dist/cjs/utils/jwt/jws.js +119 -199
- package/node_modules/hono/dist/cjs/utils/jwt/jwt.js +122 -205
- package/node_modules/hono/dist/cjs/utils/jwt/types.js +122 -159
- package/node_modules/hono/dist/cjs/utils/jwt/utf8.js +9 -28
- package/node_modules/hono/dist/cjs/utils/mime.js +75 -101
- package/node_modules/hono/dist/cjs/utils/stream.js +88 -111
- package/node_modules/hono/dist/cjs/utils/types.js +0 -15
- package/node_modules/hono/dist/cjs/utils/url.js +185 -234
- package/node_modules/hono/dist/cjs/validator/index.js +3 -27
- package/node_modules/hono/dist/cjs/validator/utils.js +0 -15
- package/node_modules/hono/dist/cjs/validator/validator.js +60 -103
- package/node_modules/hono/dist/client/client.js +138 -197
- package/node_modules/hono/dist/client/fetch-result-please.js +59 -56
- package/node_modules/hono/dist/client/index.js +3 -7
- package/node_modules/hono/dist/client/types.js +1 -0
- package/node_modules/hono/dist/client/utils.js +51 -68
- package/node_modules/hono/dist/compose.js +49 -45
- package/node_modules/hono/dist/context.js +376 -426
- package/node_modules/hono/dist/helper/accepts/accepts.js +47 -49
- package/node_modules/hono/dist/helper/accepts/index.js +1 -4
- package/node_modules/hono/dist/helper/adapter/index.js +33 -52
- package/node_modules/hono/dist/helper/conninfo/index.js +1 -0
- package/node_modules/hono/dist/helper/conninfo/types.js +1 -0
- package/node_modules/hono/dist/helper/cookie/index.js +74 -94
- package/node_modules/hono/dist/helper/css/common.js +167 -225
- package/node_modules/hono/dist/helper/css/index.js +132 -137
- package/node_modules/hono/dist/helper/dev/index.js +44 -49
- package/node_modules/hono/dist/helper/factory/index.js +27 -27
- package/node_modules/hono/dist/helper/html/index.js +30 -39
- package/node_modules/hono/dist/helper/proxy/index.js +116 -88
- package/node_modules/hono/dist/helper/route/index.js +121 -43
- package/node_modules/hono/dist/helper/ssg/index.js +3 -18
- package/node_modules/hono/dist/helper/ssg/middleware.js +53 -40
- package/node_modules/hono/dist/helper/ssg/plugins.js +55 -36
- package/node_modules/hono/dist/helper/ssg/ssg.js +198 -283
- package/node_modules/hono/dist/helper/ssg/utils.js +53 -75
- package/node_modules/hono/dist/helper/streaming/index.js +2 -8
- package/node_modules/hono/dist/helper/streaming/sse.js +50 -61
- package/node_modules/hono/dist/helper/streaming/stream.js +22 -31
- package/node_modules/hono/dist/helper/streaming/text.js +9 -10
- package/node_modules/hono/dist/helper/streaming/utils.js +9 -12
- package/node_modules/hono/dist/helper/testing/index.js +16 -10
- package/node_modules/hono/dist/helper/websocket/index.js +49 -53
- package/node_modules/hono/dist/hono-base.js +342 -379
- package/node_modules/hono/dist/hono.js +27 -20
- package/node_modules/hono/dist/http-exception.js +53 -33
- package/node_modules/hono/dist/index.js +19 -6
- package/node_modules/hono/dist/jsx/base.js +231 -340
- package/node_modules/hono/dist/jsx/children.js +16 -20
- package/node_modules/hono/dist/jsx/components.js +118 -170
- package/node_modules/hono/dist/jsx/constants.js +9 -15
- package/node_modules/hono/dist/jsx/context.js +153 -150
- package/node_modules/hono/dist/jsx/dom/client.js +45 -48
- package/node_modules/hono/dist/jsx/dom/components.js +21 -29
- package/node_modules/hono/dist/jsx/dom/context.js +37 -44
- package/node_modules/hono/dist/jsx/dom/css.js +142 -147
- package/node_modules/hono/dist/jsx/dom/hooks/index.js +52 -40
- package/node_modules/hono/dist/jsx/dom/index.js +71 -134
- package/node_modules/hono/dist/jsx/dom/intrinsic-element/components.js +275 -359
- package/node_modules/hono/dist/jsx/dom/jsx-dev-runtime.js +14 -18
- package/node_modules/hono/dist/jsx/dom/jsx-runtime.js +2 -8
- package/node_modules/hono/dist/jsx/dom/render.js +492 -595
- package/node_modules/hono/dist/jsx/dom/server.js +32 -32
- package/node_modules/hono/dist/jsx/dom/utils.js +6 -8
- package/node_modules/hono/dist/jsx/hooks/index.js +236 -308
- package/node_modules/hono/dist/jsx/index.js +45 -98
- package/node_modules/hono/dist/jsx/intrinsic-element/common.js +20 -22
- package/node_modules/hono/dist/jsx/intrinsic-element/components.js +113 -154
- package/node_modules/hono/dist/jsx/intrinsic-elements.js +1 -0
- package/node_modules/hono/dist/jsx/jsx-dev-runtime.js +12 -16
- package/node_modules/hono/dist/jsx/jsx-runtime.js +29 -42
- package/node_modules/hono/dist/jsx/streaming.js +120 -142
- package/node_modules/hono/dist/jsx/types.js +1 -0
- package/node_modules/hono/dist/jsx/utils.js +105 -168
- package/node_modules/hono/dist/middleware/basic-auth/index.js +96 -63
- package/node_modules/hono/dist/middleware/bearer-auth/index.js +93 -89
- package/node_modules/hono/dist/middleware/body-limit/index.js +66 -51
- package/node_modules/hono/dist/middleware/cache/index.js +165 -190
- package/node_modules/hono/dist/middleware/combine/index.js +132 -73
- package/node_modules/hono/dist/middleware/compress/index.js +75 -69
- package/node_modules/hono/dist/middleware/context-storage/index.js +49 -19
- package/node_modules/hono/dist/middleware/cors/index.js +107 -86
- package/node_modules/hono/dist/middleware/csrf/index.js +103 -53
- package/node_modules/hono/dist/middleware/etag/digest.js +59 -77
- package/node_modules/hono/dist/middleware/etag/index.js +71 -70
- package/node_modules/hono/dist/middleware/ip-restriction/index.js +163 -158
- package/node_modules/hono/dist/middleware/jsx-renderer/index.js +97 -54
- package/node_modules/hono/dist/middleware/jwk/index.js +1 -4
- package/node_modules/hono/dist/middleware/jwk/jwk.js +116 -112
- package/node_modules/hono/dist/middleware/jwt/index.js +2 -10
- package/node_modules/hono/dist/middleware/jwt/jwt.js +114 -114
- package/node_modules/hono/dist/middleware/language/index.js +2 -15
- package/node_modules/hono/dist/middleware/language/language.js +180 -154
- package/node_modules/hono/dist/middleware/logger/index.js +43 -37
- package/node_modules/hono/dist/middleware/method-not-allowed/index.js +81 -66
- package/node_modules/hono/dist/middleware/method-override/index.js +101 -81
- package/node_modules/hono/dist/middleware/powered-by/index.js +23 -9
- package/node_modules/hono/dist/middleware/pretty-json/index.js +39 -16
- package/node_modules/hono/dist/middleware/request-id/index.js +1 -4
- package/node_modules/hono/dist/middleware/request-id/request-id.js +33 -20
- package/node_modules/hono/dist/middleware/secure-headers/index.js +1 -5
- package/node_modules/hono/dist/middleware/secure-headers/permissions-policy.js +1 -0
- package/node_modules/hono/dist/middleware/secure-headers/secure-headers.js +144 -155
- package/node_modules/hono/dist/middleware/serve-static/index.js +56 -72
- package/node_modules/hono/dist/middleware/serve-static/path.js +15 -17
- package/node_modules/hono/dist/middleware/timeout/index.js +40 -23
- package/node_modules/hono/dist/middleware/timing/index.js +2 -9
- package/node_modules/hono/dist/middleware/timing/timing.js +177 -97
- package/node_modules/hono/dist/middleware/trailing-slash/index.js +85 -37
- package/node_modules/hono/dist/preset/quick.js +17 -15
- package/node_modules/hono/dist/preset/tiny.js +14 -11
- package/node_modules/hono/dist/request/constants.js +4 -5
- package/node_modules/hono/dist/request.js +328 -316
- package/node_modules/hono/dist/router/linear-router/index.js +1 -4
- package/node_modules/hono/dist/router/linear-router/router.js +93 -120
- package/node_modules/hono/dist/router/pattern-router/index.js +1 -4
- package/node_modules/hono/dist/router/pattern-router/router.js +39 -40
- package/node_modules/hono/dist/router/reg-exp-router/index.js +1 -7
- package/node_modules/hono/dist/router/reg-exp-router/matcher.js +17 -23
- package/node_modules/hono/dist/router/reg-exp-router/node.js +87 -110
- package/node_modules/hono/dist/router/reg-exp-router/prepared-router.js +89 -137
- package/node_modules/hono/dist/router/reg-exp-router/router.js +92 -129
- package/node_modules/hono/dist/router/reg-exp-router/trie.js +69 -64
- package/node_modules/hono/dist/router/smart-router/index.js +1 -4
- package/node_modules/hono/dist/router/smart-router/router.js +46 -55
- package/node_modules/hono/dist/router/trie-router/index.js +1 -4
- package/node_modules/hono/dist/router/trie-router/node.js +131 -162
- package/node_modules/hono/dist/router/trie-router/router.js +11 -14
- package/node_modules/hono/dist/router/utils.js +4 -5
- package/node_modules/hono/dist/router.js +35 -14
- package/node_modules/hono/dist/types/adapter/aws-lambda/conninfo.d.ts +4 -1
- package/node_modules/hono/dist/types/adapter/aws-lambda/handler.d.ts +150 -105
- package/node_modules/hono/dist/types/adapter/aws-lambda/index.d.ts +4 -8
- package/node_modules/hono/dist/types/adapter/aws-lambda/types.d.ts +152 -123
- package/node_modules/hono/dist/types/adapter/bun/conninfo.d.ts +4 -1
- package/node_modules/hono/dist/types/adapter/bun/index.d.ts +6 -10
- package/node_modules/hono/dist/types/adapter/bun/serve-static.d.ts +7 -2
- package/node_modules/hono/dist/types/adapter/bun/server.d.ts +4 -5
- package/node_modules/hono/dist/types/adapter/bun/ssg.d.ts +5 -1
- package/node_modules/hono/dist/types/adapter/bun/websocket.d.ts +31 -17
- package/node_modules/hono/dist/types/adapter/cloudflare-pages/conninfo.d.ts +4 -1
- package/node_modules/hono/dist/types/adapter/cloudflare-pages/handler.d.ts +29 -18
- package/node_modules/hono/dist/types/adapter/cloudflare-pages/index.d.ts +3 -7
- package/node_modules/hono/dist/types/adapter/cloudflare-workers/conninfo.d.ts +6 -1
- package/node_modules/hono/dist/types/adapter/cloudflare-workers/index.d.ts +4 -7
- package/node_modules/hono/dist/types/adapter/cloudflare-workers/serve-static-module.d.ts +5 -3
- package/node_modules/hono/dist/types/adapter/cloudflare-workers/serve-static.d.ts +10 -5
- package/node_modules/hono/dist/types/adapter/cloudflare-workers/utils.d.ts +10 -2
- package/node_modules/hono/dist/types/adapter/cloudflare-workers/websocket.d.ts +6 -1
- package/node_modules/hono/dist/types/adapter/deno/conninfo.d.ts +4 -1
- package/node_modules/hono/dist/types/adapter/deno/deno.d.ts +1 -0
- package/node_modules/hono/dist/types/adapter/deno/index.d.ts +5 -8
- package/node_modules/hono/dist/types/adapter/deno/serve-static.d.ts +7 -2
- package/node_modules/hono/dist/types/adapter/deno/ssg.d.ts +5 -1
- package/node_modules/hono/dist/types/adapter/deno/websocket.d.ts +6 -1
- package/node_modules/hono/dist/types/adapter/lambda-edge/conninfo.d.ts +6 -1
- package/node_modules/hono/dist/types/adapter/lambda-edge/handler.d.ts +83 -58
- package/node_modules/hono/dist/types/adapter/lambda-edge/index.d.ts +3 -7
- package/node_modules/hono/dist/types/adapter/netlify/conninfo.d.ts +4 -1
- package/node_modules/hono/dist/types/adapter/netlify/handler.d.ts +6 -1
- package/node_modules/hono/dist/types/adapter/netlify/index.d.ts +3 -5
- package/node_modules/hono/dist/types/adapter/netlify/mod.d.ts +3 -2
- package/node_modules/hono/dist/types/adapter/service-worker/handler.d.ts +9 -8
- package/node_modules/hono/dist/types/adapter/service-worker/index.d.ts +6 -9
- package/node_modules/hono/dist/types/adapter/service-worker/types.d.ts +12 -8
- package/node_modules/hono/dist/types/adapter/vercel/conninfo.d.ts +6 -1
- package/node_modules/hono/dist/types/adapter/vercel/handler.d.ts +6 -1
- package/node_modules/hono/dist/types/adapter/vercel/index.d.ts +3 -6
- package/node_modules/hono/dist/types/client/client.d.ts +5 -3
- package/node_modules/hono/dist/types/client/fetch-result-please.d.ts +21 -19
- package/node_modules/hono/dist/types/client/index.d.ts +5 -7
- package/node_modules/hono/dist/types/client/types.d.ts +134 -160
- package/node_modules/hono/dist/types/client/utils.d.ts +6 -4
- package/node_modules/hono/dist/types/compose.d.ts +4 -2
- package/node_modules/hono/dist/types/context.d.ts +335 -336
- package/node_modules/hono/dist/types/helper/accepts/accepts.d.ts +11 -9
- package/node_modules/hono/dist/types/helper/accepts/index.d.ts +2 -5
- package/node_modules/hono/dist/types/helper/adapter/index.d.ts +4 -6
- package/node_modules/hono/dist/types/helper/conninfo/index.d.ts +2 -5
- package/node_modules/hono/dist/types/helper/conninfo/types.d.ts +25 -23
- package/node_modules/hono/dist/types/helper/cookie/index.d.ts +10 -13
- package/node_modules/hono/dist/types/helper/css/common.d.ts +11 -10
- package/node_modules/hono/dist/types/helper/css/index.d.ts +25 -28
- package/node_modules/hono/dist/types/helper/dev/index.d.ts +10 -13
- package/node_modules/hono/dist/types/helper/factory/index.d.ts +26 -74
- package/node_modules/hono/dist/types/helper/html/index.d.ts +4 -7
- package/node_modules/hono/dist/types/helper/proxy/index.d.ts +20 -23
- package/node_modules/hono/dist/types/helper/route/index.d.ts +6 -4
- package/node_modules/hono/dist/types/helper/ssg/index.d.ts +4 -7
- package/node_modules/hono/dist/types/helper/ssg/middleware.d.ts +8 -7
- package/node_modules/hono/dist/types/helper/ssg/plugins.d.ts +3 -1
- package/node_modules/hono/dist/types/helper/ssg/ssg.d.ts +38 -36
- package/node_modules/hono/dist/types/helper/ssg/utils.d.ts +5 -4
- package/node_modules/hono/dist/types/helper/streaming/index.d.ts +4 -8
- package/node_modules/hono/dist/types/helper/streaming/sse.d.ts +10 -8
- package/node_modules/hono/dist/types/helper/streaming/stream.d.ts +4 -2
- package/node_modules/hono/dist/types/helper/streaming/text.d.ts +4 -2
- package/node_modules/hono/dist/types/helper/streaming/utils.d.ts +2 -0
- package/node_modules/hono/dist/types/helper/testing/index.d.ts +7 -10
- package/node_modules/hono/dist/types/helper/websocket/index.d.ts +30 -33
- package/node_modules/hono/dist/types/hono-base.d.ts +208 -211
- package/node_modules/hono/dist/types/hono.d.ts +11 -10
- package/node_modules/hono/dist/types/http-exception.d.ts +20 -23
- package/node_modules/hono/dist/types/index.d.ts +6 -37
- package/node_modules/hono/dist/types/jsx/base.d.ts +36 -35
- package/node_modules/hono/dist/types/jsx/children.d.ts +8 -6
- package/node_modules/hono/dist/types/jsx/components.d.ts +8 -5
- package/node_modules/hono/dist/types/jsx/constants.d.ts +2 -0
- package/node_modules/hono/dist/types/jsx/context.d.ts +9 -7
- package/node_modules/hono/dist/types/jsx/dom/client.d.ts +8 -10
- package/node_modules/hono/dist/types/jsx/dom/components.d.ts +9 -6
- package/node_modules/hono/dist/types/jsx/dom/context.d.ts +3 -1
- package/node_modules/hono/dist/types/jsx/dom/css.d.ts +26 -30
- package/node_modules/hono/dist/types/jsx/dom/hooks/index.d.ts +11 -13
- package/node_modules/hono/dist/types/jsx/dom/index.d.ts +78 -83
- package/node_modules/hono/dist/types/jsx/dom/intrinsic-element/components.d.ts +9 -5
- package/node_modules/hono/dist/types/jsx/dom/jsx-dev-runtime.d.ts +4 -6
- package/node_modules/hono/dist/types/jsx/dom/jsx-runtime.d.ts +3 -7
- package/node_modules/hono/dist/types/jsx/dom/render.d.ts +32 -51
- package/node_modules/hono/dist/types/jsx/dom/server.d.ts +86 -85
- package/node_modules/hono/dist/types/jsx/dom/utils.d.ts +2 -0
- package/node_modules/hono/dist/types/jsx/hooks/index.d.ts +16 -17
- package/node_modules/hono/dist/types/jsx/index.d.ts +70 -73
- package/node_modules/hono/dist/types/jsx/intrinsic-element/common.d.ts +3 -1
- package/node_modules/hono/dist/types/jsx/intrinsic-element/components.d.ts +7 -4
- package/node_modules/hono/dist/types/jsx/intrinsic-elements.d.ts +708 -708
- package/node_modules/hono/dist/types/jsx/jsx-dev-runtime.d.ts +4 -7
- package/node_modules/hono/dist/types/jsx/jsx-runtime.d.ts +7 -10
- package/node_modules/hono/dist/types/jsx/streaming.d.ts +9 -10
- package/node_modules/hono/dist/types/jsx/types.d.ts +11 -13
- package/node_modules/hono/dist/types/jsx/utils.d.ts +2 -0
- package/node_modules/hono/dist/types/middleware/basic-auth/index.d.ts +17 -20
- package/node_modules/hono/dist/types/middleware/bearer-auth/index.d.ts +46 -49
- package/node_modules/hono/dist/types/middleware/body-limit/index.d.ts +6 -9
- package/node_modules/hono/dist/types/middleware/cache/index.d.ts +13 -15
- package/node_modules/hono/dist/types/middleware/combine/index.d.ts +7 -8
- package/node_modules/hono/dist/types/middleware/compress/index.d.ts +8 -10
- package/node_modules/hono/dist/types/middleware/context-storage/index.d.ts +4 -6
- package/node_modules/hono/dist/types/middleware/cors/index.d.ts +10 -13
- package/node_modules/hono/dist/types/middleware/csrf/index.d.ts +6 -9
- package/node_modules/hono/dist/types/middleware/etag/digest.d.ts +2 -0
- package/node_modules/hono/dist/types/middleware/etag/index.d.ts +6 -9
- package/node_modules/hono/dist/types/middleware/ip-restriction/index.d.ts +11 -13
- package/node_modules/hono/dist/types/middleware/jsx-renderer/index.d.ts +11 -12
- package/node_modules/hono/dist/types/middleware/jwk/index.d.ts +2 -1
- package/node_modules/hono/dist/types/middleware/jwk/jwk.d.ts +20 -23
- package/node_modules/hono/dist/types/middleware/jwt/index.d.ts +6 -6
- package/node_modules/hono/dist/types/middleware/jwt/jwt.d.ts +28 -30
- package/node_modules/hono/dist/types/middleware/language/index.d.ts +5 -5
- package/node_modules/hono/dist/types/middleware/language/language.d.ts +42 -44
- package/node_modules/hono/dist/types/middleware/logger/index.d.ts +3 -6
- package/node_modules/hono/dist/types/middleware/method-not-allowed/index.d.ts +7 -10
- package/node_modules/hono/dist/types/middleware/method-override/index.d.ts +14 -17
- package/node_modules/hono/dist/types/middleware/powered-by/index.d.ts +8 -11
- package/node_modules/hono/dist/types/middleware/pretty-json/index.d.ts +18 -21
- package/node_modules/hono/dist/types/middleware/request-id/index.d.ts +5 -5
- package/node_modules/hono/dist/types/middleware/request-id/request-id.d.ts +9 -11
- package/node_modules/hono/dist/types/middleware/secure-headers/index.d.ts +5 -6
- package/node_modules/hono/dist/types/middleware/secure-headers/permissions-policy.d.ts +2 -1
- package/node_modules/hono/dist/types/middleware/secure-headers/secure-headers.d.ts +55 -58
- package/node_modules/hono/dist/types/middleware/serve-static/index.d.ts +24 -24
- package/node_modules/hono/dist/types/middleware/serve-static/path.d.ts +2 -0
- package/node_modules/hono/dist/types/middleware/timeout/index.d.ts +5 -7
- package/node_modules/hono/dist/types/middleware/timing/index.d.ts +5 -5
- package/node_modules/hono/dist/types/middleware/timing/timing.d.ts +17 -21
- package/node_modules/hono/dist/types/middleware/trailing-slash/index.d.ts +35 -38
- package/node_modules/hono/dist/types/preset/quick.d.ts +6 -9
- package/node_modules/hono/dist/types/preset/tiny.d.ts +6 -9
- package/node_modules/hono/dist/types/request/constants.d.ts +2 -0
- package/node_modules/hono/dist/types/request.d.ts +288 -287
- package/node_modules/hono/dist/types/router/linear-router/index.d.ts +2 -5
- package/node_modules/hono/dist/types/router/linear-router/router.d.ts +7 -5
- package/node_modules/hono/dist/types/router/pattern-router/index.d.ts +2 -5
- package/node_modules/hono/dist/types/router/pattern-router/router.d.ts +7 -5
- package/node_modules/hono/dist/types/router/reg-exp-router/index.d.ts +3 -6
- package/node_modules/hono/dist/types/router/reg-exp-router/matcher.d.ts +3 -1
- package/node_modules/hono/dist/types/router/reg-exp-router/node.d.ts +6 -4
- package/node_modules/hono/dist/types/router/reg-exp-router/prepared-router.d.ts +11 -11
- package/node_modules/hono/dist/types/router/reg-exp-router/router.d.ts +10 -9
- package/node_modules/hono/dist/types/router/reg-exp-router/trie.d.ts +7 -5
- package/node_modules/hono/dist/types/router/smart-router/index.d.ts +2 -5
- package/node_modules/hono/dist/types/router/smart-router/router.d.ts +11 -9
- package/node_modules/hono/dist/types/router/trie-router/index.d.ts +2 -5
- package/node_modules/hono/dist/types/router/trie-router/node.d.ts +6 -4
- package/node_modules/hono/dist/types/router/trie-router/router.d.ts +7 -5
- package/node_modules/hono/dist/types/router/utils.d.ts +2 -0
- package/node_modules/hono/dist/types/router.d.ts +23 -22
- package/node_modules/hono/dist/types/types.d.ts +146 -506
- package/node_modules/hono/dist/types/utils/accept.d.ts +5 -3
- package/node_modules/hono/dist/types/utils/basic-auth.d.ts +4 -2
- package/node_modules/hono/dist/types/utils/body.d.ts +46 -51
- package/node_modules/hono/dist/types/utils/buffer.d.ts +7 -6
- package/node_modules/hono/dist/types/utils/color.d.ts +2 -0
- package/node_modules/hono/dist/types/utils/compress.d.ts +2 -0
- package/node_modules/hono/dist/types/utils/concurrent.d.ts +6 -4
- package/node_modules/hono/dist/types/utils/constants.d.ts +2 -0
- package/node_modules/hono/dist/types/utils/cookie.d.ts +20 -19
- package/node_modules/hono/dist/types/utils/crypto.d.ts +5 -8
- package/node_modules/hono/dist/types/utils/encode.d.ts +2 -0
- package/node_modules/hono/dist/types/utils/filepath.d.ts +5 -4
- package/node_modules/hono/dist/types/utils/handler.d.ts +2 -0
- package/node_modules/hono/dist/types/utils/headers.d.ts +2 -0
- package/node_modules/hono/dist/types/utils/html.d.ts +11 -10
- package/node_modules/hono/dist/types/utils/http-status.d.ts +2 -0
- package/node_modules/hono/dist/types/utils/ipaddr.d.ts +4 -6
- package/node_modules/hono/dist/types/utils/jwt/index.d.ts +18 -12
- package/node_modules/hono/dist/types/utils/jwt/jwa.d.ts +15 -13
- package/node_modules/hono/dist/types/utils/jwt/jws.d.ts +4 -7
- package/node_modules/hono/dist/types/utils/jwt/jwt.d.ts +26 -29
- package/node_modules/hono/dist/types/utils/jwt/types.d.ts +48 -45
- package/node_modules/hono/dist/types/utils/jwt/utf8.d.ts +2 -0
- package/node_modules/hono/dist/types/utils/mime.d.ts +59 -57
- package/node_modules/hono/dist/types/utils/stream.d.ts +27 -25
- package/node_modules/hono/dist/types/utils/types.d.ts +15 -28
- package/node_modules/hono/dist/types/utils/url.d.ts +2 -1
- package/node_modules/hono/dist/types/validator/index.d.ts +3 -7
- package/node_modules/hono/dist/types/validator/utils.d.ts +6 -9
- package/node_modules/hono/dist/types/validator/validator.d.ts +11 -10
- package/node_modules/hono/dist/types.js +4 -6
- package/node_modules/hono/dist/utils/accept.js +185 -215
- package/node_modules/hono/dist/utils/basic-auth.js +18 -21
- package/node_modules/hono/dist/utils/body.js +87 -92
- package/node_modules/hono/dist/utils/buffer.js +44 -71
- package/node_modules/hono/dist/utils/color.js +33 -21
- package/node_modules/hono/dist/utils/compress.js +11 -5
- package/node_modules/hono/dist/utils/concurrent.js +29 -38
- package/node_modules/hono/dist/utils/constants.js +7 -5
- package/node_modules/hono/dist/utils/cookie.js +114 -163
- package/node_modules/hono/dist/utils/crypto.js +30 -40
- package/node_modules/hono/dist/utils/encode.js +30 -26
- package/node_modules/hono/dist/utils/filepath.js +23 -33
- package/node_modules/hono/dist/utils/handler.js +10 -11
- package/node_modules/hono/dist/utils/headers.js +1 -0
- package/node_modules/hono/dist/utils/html.js +97 -117
- package/node_modules/hono/dist/utils/http-status.js +1 -0
- package/node_modules/hono/dist/utils/ipaddr.js +227 -279
- package/node_modules/hono/dist/utils/jwt/index.js +12 -4
- package/node_modules/hono/dist/utils/jwt/jwa.js +24 -20
- package/node_modules/hono/dist/utils/jwt/jws.js +115 -174
- package/node_modules/hono/dist/utils/jwt/jwt.js +120 -197
- package/node_modules/hono/dist/utils/jwt/types.js +79 -95
- package/node_modules/hono/dist/utils/jwt/utf8.js +9 -7
- package/node_modules/hono/dist/utils/mime.js +74 -79
- package/node_modules/hono/dist/utils/stream.js +86 -88
- package/node_modules/hono/dist/utils/types.js +1 -0
- package/node_modules/hono/dist/utils/url.js +187 -215
- package/node_modules/hono/dist/validator/index.js +1 -4
- package/node_modules/hono/dist/validator/utils.js +1 -0
- package/node_modules/hono/dist/validator/validator.js +61 -83
- package/node_modules/hono/package.json +27 -27
- package/package.json +7 -8
- package/prepare.mjs +109 -4
- package/runtime-package.json +7 -9
- package/scripts/check-install-toolchain.mjs +64 -40
- package/shipping-sbom.cdx.json +134 -168
- 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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reload.js","sourceRoot":"","sources":["../src/reload.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,IAAI,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEhE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAEN,UAAU,EACV,WAAW,EACX,aAAa,GAOb,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAkDrD,MAAM,IAAI,GAAG,GAA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AE,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;YACrE,6FAA6F;YAC7F,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;YAC5B,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;YAClD,KAAK,CAAC,OAAO,EAAE,CAAC;QACjB,CAAC;QACD,KAAK,MAAM,MAAM,IAAI,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;YACxC,0GAA0G;YAC1G,IAAI,MAAM,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;gBAC/B,IAAI,CAAC;oBACJ,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;gBAClE,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBAChB,MAAM,CAAC,IAAI,CACV,IAAI,UAAU,CAAC,kBAAkB,EAAE,GAAG,MAAM,CAAC,QAAQ,iCAAiC,EAAE;wBACvF,KAAK,EAAE,KAAK;qBACZ,CAAC,CACF,CAAC;oBACF,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;oBACvB,SAAS;gBACV,CAAC;YACF,CAAC;YACD,MAAM,CAAC,YAAY,EAAE,CAAC;QACvB,CAAC;IACF,CAAC;CACD","sourcesContent":["import type { Cell } from \"./cell.ts\";\nimport { type AnyContract, bind, coverage } from \"./contract.ts\";\nimport { asChordError, ChordError, invalid } from \"./errors.ts\";\nimport type { EpochState, Facet, HostImpl, PluginRef, Serve } from \"./host.ts\";\nimport { holdPublications } from \"./publish.ts\";\nimport {\n\ttype Factory,\n\tHandleImpl,\n\tmakeService,\n\tmemberSchemas,\n\ttype RecordImpl,\n\ttype ResourceImpl,\n\ttype Run,\n\ttype ServeOptions,\n\ttype Service,\n\ttype StagedListeners,\n} from \"./record.ts\";\nimport type { RegistryTable } from \"./registry.ts\";\nimport { assertValid, deepEqual } from \"./schema.ts\";\n\nexport interface ReloadOptions {\n\t/** Facet names to remove. */\n\treadonly remove?: readonly string[];\n\t/** Milliseconds the gate waits for grandfathered roots (default 5000). Missed: the reload aborts. */\n\treadonly gateDeadline?: number;\n\t/** Milliseconds to wait for the previous epoch to retire first (default 5000). Missed: it is retired anyway. */\n\treadonly retireDeadline?: number;\n\t/** Server: facet modules for child hosts by host-name prefix (longest wins). Every connected host participates. */\n\treadonly remote?: Readonly<Record<string, readonly string[]>>;\n\t/** Server: facet names to remove on child hosts, by the same host-name prefix rules. */\n\treadonly remoteRemove?: Readonly<Record<string, readonly string[]>>;\n\t/** Server: milliseconds to wait for every child's vote (default: gate + retire deadlines + 5000). */\n\treadonly voteDeadline?: number;\n}\n\nexport interface ReloadReport {\n\treadonly epoch: number;\n\treadonly previous: number;\n\treadonly changed: readonly string[];\n\treadonly removed: readonly string[];\n\t/** Addresses of records whose new factory was installed. */\n\treadonly prepared: readonly string[];\n\t/** Addresses of records that went through the gate. */\n\treadonly gated: readonly string[];\n\t/**\n\t * Cluster reloads: what each participating child host prepared, by host name (its vote; the child commits it after\n\t * the server). Absent for local reloads.\n\t */\n\treadonly children?: Readonly<Record<string, ReloadReport>>;\n}\n\ninterface Candidate {\n\treadonly record: RecordImpl;\n\treadonly service: Service;\n\treadonly run: Run;\n\t/** Why the record needs the gate (empty: compatible). */\n\treadonly reasons: string[];\n\t/** New exclusive resources and their new dependents, opened at the gate. */\n\treadonly atGate: ResourceImpl[];\n\t/** Old exclusive resources closed at the gate. */\n\treadonly replaced: ResourceImpl[];\n\treadonly migrated: Map<Cell<unknown>, unknown>;\n\t/** Values of the run's derivations over the candidate (migrated) values, validated. */\n\tderived: Map<unknown, unknown>;\n\t/** Listener subscriptions made at the end of prepare, activated by the commit. */\n\tstaged: StagedListeners | undefined;\n}\n\nconst noop = (): void => {};\n\n/**\n * Computes the new derivation functions over the candidate values and validates every prospective value (migrated\n * cells and derivations) against every schema that will apply after the commit: the cell's new schema and the new\n * behavior's remote state-member schemas. A failure fails prepare; the commit then installs without re-checking.\n */\nfunction dryRun(candidate: Candidate): void {\n\tconst { run, migrated, service, record } = candidate;\n\tconst exposed = memberSchemas(service, run.behavior);\n\tfor (const [cell, value] of migrated) {\n\t\tfor (const schema of exposed.get(cell) ?? [])\n\t\t\tassertValid(\"state\", `${record.address}: migrated state ${cell.key}`, schema, value);\n\t}\n\tconst values = new Map<unknown, unknown>(migrated);\n\tconst derives = [...run.decls.derives].sort(([, a], [, b]) => a.seq - b.seq);\n\tfor (const [name, derived] of derives) {\n\t\tconst value = derived.compute(\n\t\t\t(source) => (values.has(source) ? values.get(source) : source.value),\n\t\t\trun.decls.deriveFns.get(name),\n\t\t);\n\t\tfor (const schema of exposed.get(derived) ?? [])\n\t\t\tassertValid(\"state\", `${record.address}: derived ${name}`, schema, value);\n\t\tvalues.set(derived, value);\n\t}\n\tcandidate.derived = values;\n}\n\n/** A reload error keeps the underlying code (`contract_mismatch`, `invalid`, ...) and says it aborted the reload. */\nexport function reloadError(error: unknown): ChordError {\n\tconst cause = asChordError(error, \"reload\");\n\tif (/^reload aborted/.test(cause.message.replace(/^[^:]*: /, \"\"))) return cause;\n\treturn new ChordError(cause.code, `reload aborted: ${cause.message}`, {\n\t\tcause,\n\t\treason: cause.reason,\n\t\tdetails: cause.details,\n\t});\n}\n\n/** Serialized: a second reload while one runs is rejected. */\nexport async function runReload(\n\thost: HostImpl,\n\tplugins: readonly PluginRef[],\n\toptions: ReloadOptions,\n): Promise<ReloadReport> {\n\tconst reload = await beginReload(host, plugins, options);\n\ttry {\n\t\tawait reload.prepare();\n\t\treturn reload.commit();\n\t} finally {\n\t\tendReload(host);\n\t}\n}\n\n/** Takes the host's reload slot and loads the plugin modules. Pair with `endReload`. */\nexport async function beginReload(\n\thost: HostImpl,\n\tplugins: readonly PluginRef[],\n\toptions: ReloadOptions,\n\tepoch?: number,\n): Promise<Reload> {\n\tif (host.reloading) {\n\t\tthrow new ChordError(\"unavailable\", \"a reload is already running\", { reason: \"reload_running\" });\n\t}\n\thost.reloading = true;\n\ttry {\n\t\treturn new Reload(host, await host.resolve(plugins), options, epoch);\n\t} catch (error) {\n\t\thost.reloading = false;\n\t\tthrow reloadError(error);\n\t}\n}\n\nexport function endReload(host: HostImpl): void {\n\thost.reloading = false;\n\thost.maybeRetire();\n}\n\n/** One reload on one host: `prepare` (load, prepare, gate), then `commit` or `rollback`. */\nexport class Reload {\n\treadonly host: HostImpl;\n\treadonly facets: readonly Facet[];\n\treadonly options: ReloadOptions;\n\t/** Epoch id to commit (issued by the coordinating server); a local reload allocates one. */\n\treadonly epoch: number | undefined;\n\treadonly candidates = new Map<RecordImpl, Candidate>();\n\treadonly abort = new AbortController();\n\treadonly closed: [RecordImpl, ResourceImpl][] = [];\n\tservices = new Map<string, Service>();\n\tchanged = new Set<string>();\n\tremoved = new Set<string>();\n\ttables = new Map<string, RegistryTable<unknown>>();\n\tgated: Candidate[] = [];\n\trolledBack = false;\n\t/** Records of types this reload adds, with their staged listeners: their runtime starts at commit. */\n\treadonly deferred = new Map<RecordImpl, StagedListeners>();\n\n\tconstructor(host: HostImpl, facets: readonly Facet[], options: ReloadOptions, epoch?: number) {\n\t\tthis.host = host;\n\t\tthis.facets = facets;\n\t\tthis.options = options;\n\t\tthis.epoch = epoch;\n\t}\n\n\t/** Everything up to the commit. On failure the host is rolled back and the underlying error is thrown. */\n\tasync prepare(): Promise<void> {\n\t\ttry {\n\t\t\tawait this.waitForRetirement();\n\t\t\tthis.load();\n\t\t\tthis.checkProviders();\n\t\t\tawait this.prepareAll();\n\t\t\t// From here new records of changed types are rejected (upgrade_conflict, retryable) until commit or abort,\n\t\t\t// so the candidate set is final once the activations already in flight have been prepared.\n\t\t\tthis.host.gating = this.changed;\n\t\t\tawait this.withDeadline(this.prepareAll(), \"activations in flight did not finish\");\n\t\t\tthis.checkHolds();\n\t\t\tthis.tables = this.host.buildTables(this.entries());\n\t\t\tawait this.gate();\n\t\t\tthis.#alive();\n\t\t\tthis.#stage();\n\t\t} catch (error) {\n\t\t\tawait this.rollback();\n\t\t\tthrow reloadError(error);\n\t\t}\n\t}\n\n\t/** What a successful prepare will commit (a child sends it with its vote). */\n\tsummary(): ReloadReport {\n\t\tconst live = [...this.candidates.values()].filter(({ record }) => record.status === \"live\");\n\t\treturn {\n\t\t\tepoch: this.host.pending?.id ?? this.host.current.id,\n\t\t\tprevious: this.host.current.id,\n\t\t\tchanged: [...this.changed],\n\t\t\tremoved: [...this.removed],\n\t\t\tprepared: live.map(({ record }) => record.address),\n\t\t\tgated: this.gated.map(({ record }) => record.address),\n\t\t};\n\t}\n\n\t/** After every await of prepare: a rollback meanwhile (abort from the coordinator) ends it. */\n\t#alive(): void {\n\t\tif (this.rolledBack) throw new ChordError(\"aborted\", \"reload aborted while preparing\", { reason: \"aborted\" });\n\t}\n\n\t/**\n\t * Subscribes every new listener now, buffering its events, so a failing source fails prepare instead of leaving a\n\t * half-installed epoch. Records running only the new code (types this reload adds) are staged too.\n\t */\n\t#stage(): void {\n\t\tfor (const candidate of this.candidates.values()) {\n\t\t\tif (candidate.record.status === \"live\")\n\t\t\t\tcandidate.staged = candidate.record.stageListeners(candidate.run.decls);\n\t\t}\n\t\tfor (const record of this.host.records.values()) {\n\t\t\tif (record.status === \"live\" && record.deferredRuntime)\n\t\t\t\tthis.deferred.set(record, record.stageListeners(record.decls));\n\t\t}\n\t}\n\n\tasync waitForRetirement(): Promise<void> {\n\t\tconst host = this.host;\n\t\tif (host.previous === undefined) return;\n\t\tif (host.previous.roots.size > 0) {\n\t\t\tlet timer: ReturnType<typeof setTimeout> | undefined;\n\t\t\tawait new Promise<void>((resolve) => {\n\t\t\t\thost.retired = resolve;\n\t\t\t\ttimer = setTimeout(resolve, this.options.retireDeadline ?? 5000);\n\t\t\t});\n\t\t\tclearTimeout(timer);\n\t\t\thost.retired = noop;\n\t\t}\n\t\t// Roots of the dropped epoch still running get `superseded` on their next call.\n\t\thost.retire();\n\t}\n\n\t/** Builds the candidate service table: unchanged services plus everything the given facets serve. */\n\tload(): void {\n\t\tconst replaced = new Set([...this.facets.map((facet) => facet.name), ...(this.options.remove ?? [])]);\n\t\tconst current = this.host.current.services;\n\t\tthis.services = new Map([...current].filter(([, service]) => !replaced.has(service.facet)));\n\t\tfor (const facet of this.facets) {\n\t\t\tfacet.setup(\n\t\t\t\tthis.host.facetApi(((type: AnyContract, factory: Factory<AnyContract>, options: ServeOptions = {}) =>\n\t\t\t\t\tthis.host.serveInto(this.services, makeService(type, factory, options, facet.name))) as Serve),\n\t\t\t);\n\t\t}\n\t\tfor (const [name, service] of this.services) if (current.get(name) !== service) this.changed.add(name);\n\t\tfor (const name of current.keys()) if (!this.services.has(name)) this.removed.add(name);\n\t\tthis.host.pending = {\n\t\t\tid: this.host.nextEpochId(this.epoch),\n\t\t\tservices: this.services,\n\t\t\ttables: new Map(),\n\t\t\troots: new Map(),\n\t\t};\n\t}\n\n\tasync withDeadline<T>(promise: Promise<T>, what: string): Promise<T> {\n\t\tconst deadline = this.options.gateDeadline ?? 5000;\n\t\tlet timer: ReturnType<typeof setTimeout> | undefined;\n\t\tconst timeout = new Promise<never>((_, reject) => {\n\t\t\ttimer = setTimeout(\n\t\t\t\t() => reject(new ChordError(\"aborted\", `${what} within ${deadline} ms`, { reason: \"deadline\" })),\n\t\t\t\tdeadline,\n\t\t\t);\n\t\t});\n\t\ttry {\n\t\t\treturn await Promise.race([promise, timeout]);\n\t\t} finally {\n\t\t\tclearTimeout(timer);\n\t\t}\n\t}\n\n\t/** Same contract version must cover the old description (forgotten bump); facets' `uses` must bind. */\n\tcheckProviders(): void {\n\t\tfor (const name of this.changed) {\n\t\t\tconst next = this.services.get(name)!.contract;\n\t\t\tconst old = this.host.current.services.get(name)?.contract;\n\t\t\tif (old === undefined || old.version !== next.version) continue;\n\t\t\tconst reason = coverage(next.description, old.description);\n\t\t\tif (reason !== undefined) {\n\t\t\t\tthrow new ChordError(\n\t\t\t\t\t\"contract_mismatch\",\n\t\t\t\t\t`${name}@${next.version} changed incompatibly without a version bump (${reason})`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tconst facets = new Map(this.host.facets);\n\t\tfor (const facet of this.facets) facets.set(facet.name, facet);\n\t\tfor (const name of this.options.remove ?? []) facets.delete(name);\n\t\tfor (const facet of facets.values()) {\n\t\t\tfor (const token of facet.uses ?? []) {\n\t\t\t\tconst service = this.services.get(token.name);\n\t\t\t\tif (service !== undefined && this.changed.has(token.name))\n\t\t\t\t\tbind(service.contract, service.options.accepts, token);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Prepares every live record of a changed type, including records that activate meanwhile, to a fixpoint. Records\n\t * already running the new code (types this reload adds) are skipped.\n\t */\n\tasync prepareAll(): Promise<void> {\n\t\tfor (;;) {\n\t\t\tconst todo = [...this.host.records.values()].filter(\n\t\t\t\t(record) =>\n\t\t\t\t\tthis.changed.has(record.typeName) &&\n\t\t\t\t\t!this.candidates.has(record) &&\n\t\t\t\t\trecord.service !== this.services.get(record.typeName) &&\n\t\t\t\t\t(record.status === \"live\" || record.status === \"activating\"),\n\t\t\t);\n\t\t\tif (todo.length === 0) return;\n\t\t\tawait Promise.allSettled(todo.map((record) => record.ready));\n\t\t\tthis.#alive();\n\t\t\tfor (const record of todo) {\n\t\t\t\tif (record.status === \"live\" && record.service !== this.services.get(record.typeName)) {\n\t\t\t\t\tawait this.prepareRecord(record);\n\t\t\t\t\tthis.#alive();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Runs the new factory in recording mode and opens what can be opened without the gate. */\n\tasync prepareRecord(record: RecordImpl): Promise<void> {\n\t\tconst service = this.services.get(record.typeName)!;\n\t\tconst run = record.run(service, record.decls);\n\t\tconst candidate: Candidate = {\n\t\t\trecord,\n\t\t\tservice,\n\t\t\trun,\n\t\t\treasons: [],\n\t\t\tatGate: [],\n\t\t\treplaced: [],\n\t\t\tmigrated: new Map(),\n\t\t\tderived: new Map(),\n\t\t\tstaged: undefined,\n\t\t};\n\t\tthis.candidates.set(record, candidate);\n\t\tconst bumped = service.stateVersion !== record.stateVersion;\n\t\tif (bumped) candidate.reasons.push(`state version ${record.stateVersion} -> ${service.stateVersion}`);\n\t\tfor (const [name, cell] of run.decls.cells) {\n\t\t\tif (record.decls.cells.get(name) !== cell || deepEqual(cell.schema, run.decls.cellSchemas.get(name))) continue;\n\t\t\tif (!bumped) {\n\t\t\t\tthrow invalid(\"state\", `${record.address}: schema of state ${name} changed without a state-version bump`);\n\t\t\t}\n\t\t}\n\t\tfor (const name of Object.keys(service.options.state?.migrate ?? {})) {\n\t\t\tif (!run.decls.cells.has(name))\n\t\t\t\tthrow invalid(\"state\", `${record.address}: migrate for undeclared state ${name}`);\n\t\t}\n\t\tconst deferred = new Set<ResourceImpl>();\n\t\tfor (const resource of run.created.resources) {\n\t\t\tif (resource.exclusive || resource.deps.some((dep) => deferred.has(dep as ResourceImpl)))\n\t\t\t\tdeferred.add(resource);\n\t\t}\n\t\tfor (const resource of deferred) {\n\t\t\tcandidate.atGate.push(resource);\n\t\t\tconst old = record.decls.resources.get(resource.key);\n\t\t\tif (resource.exclusive && old?.exclusive && old.state === \"open\") candidate.replaced.push(old);\n\t\t}\n\t\tif (deferred.size > 0) candidate.reasons.push(\"exclusive resource replaced\");\n\t\tif (candidate.reasons.length === 0) dryRun(candidate);\n\t\tawait record.open(\n\t\t\trun.created.resources.filter((resource) => !deferred.has(resource)),\n\t\t\trun.created.holds,\n\t\t\tthis.abort.signal,\n\t\t);\n\t}\n\n\t/**\n\t * Every hold that survives into the new epoch must bind to the new provider. Browser holds don't block a reload:\n\t * after the commit they get `upgrade_required` instead.\n\t */\n\tcheckHolds(): void {\n\t\tconst dropped = new Set<unknown>();\n\t\tfor (const { record, run } of this.candidates.values()) {\n\t\t\tfor (const hold of record.decls.holds.values())\n\t\t\t\tif (![...run.decls.holds.values()].includes(hold)) dropped.add(hold);\n\t\t}\n\t\tfor (const record of this.host.records.values()) {\n\t\t\tconst service = this.services.get(record.typeName);\n\t\t\tif (service === undefined || !this.changed.has(record.typeName)) continue;\n\t\t\tfor (const hold of record.holds) {\n\t\t\t\t// The host's bootstrap hold follows this provider at commit; it is not an old-code consumer.\n\t\t\t\tif (hold === this.host.eager.get(record.typeName)) continue;\n\t\t\t\tif (!dropped.has(hold) && hold.owner !== \"client\")\n\t\t\t\t\tbind(service.contract, service.options.accepts, hold.contract);\n\t\t\t}\n\t\t}\n\t}\n\n\tentries(): [RecordImpl, Run[\"decls\"]][] {\n\t\treturn this.host\n\t\t\t.liveDecls(true)\n\t\t\t.filter(([record]) => !this.removed.has(record.typeName))\n\t\t\t.map(([record, decls]) => [record, this.candidates.get(record)?.run.decls ?? decls]);\n\t}\n\n\t/**\n\t * Admission cut, wait for grandfathered roots (deadline), replace exclusive resources, migrate into private\n\t * copies. Old tasks of gated records are stopped at the cut; listener events are queued until commit or abort.\n\t */\n\tasync gate(): Promise<void> {\n\t\tthis.gated = [...this.candidates.values()].filter(\n\t\t\t(candidate) => candidate.reasons.length > 0 && candidate.record.status === \"live\",\n\t\t);\n\t\tconst drained = this.gated.map(({ record }) => {\n\t\t\tconst grandfathered = new Set(record.leases.keys());\n\t\t\treturn new Promise<void>((resolve) => {\n\t\t\t\trecord.gate = { grandfathered, queue: [], drained: resolve };\n\t\t\t\trecord.stopTasks();\n\t\t\t\tif (grandfathered.size === 0) resolve();\n\t\t\t});\n\t\t});\n\t\tconst deadline = this.options.gateDeadline ?? 5000;\n\t\tlet timer: ReturnType<typeof setTimeout> | undefined;\n\t\tconst timedOut = await Promise.race([\n\t\t\tPromise.all(drained).then(() => false),\n\t\t\tnew Promise<boolean>((resolve) => {\n\t\t\t\ttimer = setTimeout(() => resolve(true), deadline);\n\t\t\t}),\n\t\t]);\n\t\tclearTimeout(timer);\n\t\tif (timedOut) {\n\t\t\tconst blocking = this.gated.flatMap(({ record }) => [...(record.gate?.grandfathered ?? [])]);\n\t\t\tthrow new ChordError(\n\t\t\t\t\"aborted\",\n\t\t\t\t`gate deadline (${deadline} ms) missed; blocking roots: ${blocking.join(\", \")}`,\n\t\t\t\t{\n\t\t\t\t\treason: \"gate_deadline\",\n\t\t\t\t\tdetails: { blocking },\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\t\tthis.#alive();\n\t\tfor (const candidate of this.gated) {\n\t\t\tconst { record } = candidate;\n\t\t\tfor (const old of candidate.replaced) {\n\t\t\t\t// Owned by the rollback before closing: a failing close must still be restored.\n\t\t\t\tthis.closed.push([record, old]);\n\t\t\t\tawait old.close(record.openOrder);\n\t\t\t}\n\t\t\tawait record.open(candidate.atGate, [], this.abort.signal);\n\t\t\tthis.#alive();\n\t\t}\n\t\tfor (const candidate of this.gated) this.migrate(candidate);\n\t}\n\n\tmigrate(candidate: Candidate): void {\n\t\tconst { record, service, run } = candidate;\n\t\tconst migrate = service.options.state?.migrate ?? {};\n\t\tconst bumped = service.stateVersion !== record.stateVersion;\n\t\tfor (const [name, cell] of run.decls.cells) {\n\t\t\tif (record.decls.cells.get(name) !== cell) continue;\n\t\t\tconst schema = run.decls.cellSchemas.get(name)!;\n\t\t\tconst fn = migrate[name];\n\t\t\tlet value: unknown;\n\t\t\tif (bumped && fn !== undefined) value = fn(structuredClone(cell.value), record.stateVersion);\n\t\t\telse if (!deepEqual(cell.schema, schema)) value = cell.value;\n\t\t\telse continue;\n\t\t\tassertValid(\"state\", `${record.address}: migrated state ${name}`, schema, value);\n\t\t\tcandidate.migrated.set(cell, value);\n\t\t}\n\t\tdryRun(candidate);\n\t}\n\n\tasync rollback(): Promise<void> {\n\t\tif (this.rolledBack) return;\n\t\tthis.rolledBack = true;\n\t\tthis.abort.abort(new ChordError(\"aborted\", \"reload aborted\"));\n\t\tconst report = (error: unknown): void => this.host.report(error);\n\t\tfor (const candidate of this.candidates.values()) candidate.staged?.discard();\n\t\tfor (const staged of this.deferred.values()) staged.discard();\n\t\tfor (const { record, run } of this.candidates.values()) {\n\t\t\trecord.pending.delete(run.decls);\n\t\t\tawait record.unwind(run).catch(report);\n\t\t}\n\t\t// Replaced exclusive resources are restored; one that cannot be is marked unavailable, never silently closed.\n\t\tfor (const [record, resource] of this.closed) {\n\t\t\tif (resource.state !== \"closed\") continue;\n\t\t\tawait resource.open(new AbortController().signal, record.openOrder).catch((error: unknown) => {\n\t\t\t\tresource.markUnavailable();\n\t\t\t\treport(\n\t\t\t\t\tnew ChordError(\"unavailable\", `${record.address}: resource ${resource.key} could not be restored`, {\n\t\t\t\t\t\tcause: error,\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t});\n\t\t}\n\t\tfor (const { record } of this.gated) {\n\t\t\tif (record.gate === undefined) continue;\n\t\t\trecord.openGate();\n\t\t\tfor (const name of record.decls.tasks.keys()) record.startTask(name, this.host.current.id);\n\t\t}\n\t\t// Records of types this reload would have added lose their code.\n\t\tconst reason = new ChordError(\"gone\", \"reload aborted; type not served\");\n\t\tfor (const record of [...this.host.records.values()]) {\n\t\t\tif (!this.host.current.services.has(record.typeName)) await record.dispose(true, reason).catch(report);\n\t\t}\n\t\tthis.host.pending = undefined;\n\t\tthis.host.gating = undefined;\n\t}\n\n\t/**\n\t * Publishes the new epoch in one synchronous step. Everything fallible ran in prepare (factories, opens, migration\n\t * and derivation checks against the prospective schemas, listener subscriptions), so this only installs. Observers\n\t * (state, shapes, registries, listener roots) are notified after the whole step. If an install still throws, the\n\t * epoch is half-published: the host fails terminally and admits no more work.\n\t */\n\tcommit(beforeStart?: () => void): ReloadReport {\n\t\ttry {\n\t\t\treturn holdPublications(() => {\n\t\t\t\tconst report = this.#publish();\n\t\t\t\t// Installed, not yet started: the coordinator queues its commit frames here, so nothing this epoch starts\n\t\t\t\t// (tasks, eager activations, then the held listener/registry/state notifications) can reach a child first.\n\t\t\t\tbeforeStart?.();\n\t\t\t\tfor (const start of this.#starts.splice(0)) start();\n\t\t\t\treturn report;\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tthis.host.fail(error);\n\t\t\tthrow reloadError(error);\n\t\t}\n\t}\n\n\t/** Work that may start new-epoch roots, run after installation (and after the coordinator's commit frames). */\n\treadonly #starts: (() => void)[] = [];\n\n\t#publish(): ReloadReport {\n\t\tconst host = this.host;\n\t\tconst previous = host.current;\n\t\tconst next: EpochState = host.pending!;\n\t\thost.pending = undefined;\n\t\thost.epochs.set(next.id, next);\n\t\thost.previous = previous;\n\t\thost.current = next;\n\t\tconst prepared: string[] = [];\n\t\tfor (const record of [...host.records.values()]) {\n\t\t\tif (this.removed.has(record.typeName)) continue;\n\t\t\tconst candidate = this.candidates.get(record);\n\t\t\tif (candidate === undefined) {\n\t\t\t\tconst installed = record.behaviors.get(previous.id);\n\t\t\t\tif (installed !== undefined) record.behaviors.set(next.id, { ...installed, epoch: next.id });\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (record.status !== \"live\") continue;\n\t\t\tthis.install(candidate, next.id);\n\t\t\tprepared.push(record.address);\n\t\t}\n\t\tfor (const { record, run, staged } of this.candidates.values()) {\n\t\t\tif (record.status === \"live\") continue;\n\t\t\tstaged?.discard();\n\t\t\trecord.pending.delete(run.decls);\n\t\t\trecord.unwind(run).catch((error: unknown) => host.report(error));\n\t\t}\n\t\t// Records of types this reload adds start their runtime now.\n\t\tfor (const [record, staged] of this.deferred) {\n\t\t\tif (record.status !== \"live\") {\n\t\t\t\tstaged.discard();\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\trecord.deferredRuntime = false;\n\t\t\tstaged.activate();\n\t\t\tthis.#starts.push(() => record.startTasks());\n\t\t}\n\t\thost.installTables(next, this.tables, true);\n\t\tconst reason = new ChordError(\"gone\", \"type no longer served\");\n\t\tfor (const record of [...host.records.values()]) {\n\t\t\tif (this.removed.has(record.typeName))\n\t\t\t\trecord.dispose(true, reason).catch((error: unknown) => host.report(error));\n\t\t}\n\t\tfor (const name of this.removed) host.eager.delete(name);\n\t\tfor (const facet of this.facets) host.facets.set(facet.name, facet);\n\t\tfor (const name of this.options.remove ?? []) host.facets.delete(name);\n\t\thost.gating = undefined;\n\t\tfor (const [name, service] of this.services) {\n\t\t\tif (service.options.eager && this.changed.has(name) && host.eager.get(name)?.record?.status !== \"live\") {\n\t\t\t\tthis.#starts.push(() => host.startEager(service));\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\tepoch: next.id,\n\t\t\tprevious: previous.id,\n\t\t\tchanged: [...this.changed],\n\t\t\tremoved: [...this.removed],\n\t\t\tprepared,\n\t\t\tgated: this.gated.map(({ record }) => record.address),\n\t\t};\n\t}\n\n\tinstall(candidate: Candidate, epoch: number): void {\n\t\tconst { record, run, service } = candidate;\n\t\tconst gated = candidate.reasons.length > 0;\n\t\trecord.pending.delete(run.decls);\n\t\trecord.stopTasks();\n\t\tif (gated) {\n\t\t\t// Old derivations would compute over migrated values; the old behavior can no longer run anyway.\n\t\t\tconst kept = new Set(run.decls.derives.values());\n\t\t\tfor (const derived of record.decls.derives.values()) if (!kept.has(derived)) derived.detach();\n\t\t}\n\t\trecord.decls = run.decls;\n\t\trecord.service = service;\n\t\trecord.stateVersion = service.stateVersion;\n\t\trecord.behaviors.set(epoch, { epoch, service, behavior: run.behavior, decls: run.decls });\n\t\tif (gated) {\n\t\t\t// Old code can never run over migrated state: drop the previous behavior now, not at retirement.\n\t\t\trecord.minEpoch = epoch;\n\t\t\tfor (const old of [...record.behaviors.keys()]) if (old !== epoch) this.host.retireBehavior(record, old);\n\t\t}\n\t\t// Schemas first, then the values validated against them in prepare.\n\t\trecord.refreshSchemas();\n\t\tfor (const [name, derived] of run.decls.derives) derived.setFn(run.decls.deriveFns.get(name)!);\n\t\tfor (const [name, cell] of run.decls.cells) {\n\t\t\tconst schema = run.decls.cellSchemas.get(name)!;\n\t\t\tif (candidate.migrated.has(cell)) cell.reset(candidate.migrated.get(cell), schema);\n\t\t\telse cell.schema = schema;\n\t\t}\n\t\tconst created = new Set(run.created.derives);\n\t\tfor (const derived of run.created.derives) derived.attach(candidate.derived);\n\t\tfor (const derived of run.decls.derives.values()) if (!created.has(derived)) derived.refresh();\n\t\tcandidate.staged?.activate();\n\t\tthis.#starts.push(() => record.startTasks());\n\t\trecord.openGate();\n\t\tconst eager = this.host.eager.get(record.typeName);\n\t\tif (eager?.record === record && eager.contract.fingerprint !== service.contract.fingerprint) {\n\t\t\tconst replacement = new HandleImpl(record, service.contract, \"host\");\n\t\t\t// Acquire first: releasing the only hold must not dispose/reopen the surviving eager record.\n\t\t\trecord.addHold(replacement);\n\t\t\tthis.host.eager.set(record.typeName, replacement);\n\t\t\teager.release();\n\t\t}\n\t\tfor (const handle of [...record.holds]) {\n\t\t\t// Browser holds whose contract no longer binds are told to reload their code (they never block a reload).\n\t\t\tif (handle.owner === \"client\") {\n\t\t\t\ttry {\n\t\t\t\t\tbind(service.contract, service.options.accepts, handle.contract);\n\t\t\t\t} catch (error) {\n\t\t\t\t\thandle.gone(\n\t\t\t\t\t\tnew ChordError(\"upgrade_required\", `${record.typeName} changed; reload the web facets`, {\n\t\t\t\t\t\t\tcause: error,\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t\trecord.release(handle);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\thandle.shapeChanged();\n\t\t}\n\t}\n}\n"]}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { AnyContract } from "./contract.ts";
|
|
2
|
+
import { type WireOp } from "./delta/index.ts";
|
|
3
|
+
import { type Hold, type HoldOwner, type StatusListener } from "./record.ts";
|
|
4
|
+
import type { Ctx, HandleStatus, Principal, Shape } from "./types.ts";
|
|
5
|
+
import { type RootRef, type WireError } from "./wire.ts";
|
|
6
|
+
export interface StateSink {
|
|
7
|
+
snap?: unknown;
|
|
8
|
+
reset?: unknown;
|
|
9
|
+
ops?: readonly WireOp[];
|
|
10
|
+
error?: WireError;
|
|
11
|
+
}
|
|
12
|
+
/** What a remote handle needs from the link it is bound to (implemented by Connection). */
|
|
13
|
+
export interface RemoteChannel {
|
|
14
|
+
hold(handle: RemoteHandle): number;
|
|
15
|
+
release(id: number): void;
|
|
16
|
+
call(hold: number, member: string, args: unknown, root: RootRef | undefined, signal: AbortSignal): Promise<unknown>;
|
|
17
|
+
sub(hold: number, member: string, sink: (frame: StateSink) => void): number;
|
|
18
|
+
unsub(id: number): void;
|
|
19
|
+
}
|
|
20
|
+
/** What a remote handle needs from its host. */
|
|
21
|
+
export interface RemoteHost {
|
|
22
|
+
readonly inFactory: number;
|
|
23
|
+
report(error: unknown): void;
|
|
24
|
+
root<T>(fn: (ctx: Ctx) => T | Promise<T>, options?: {
|
|
25
|
+
signal?: AbortSignal;
|
|
26
|
+
}): Promise<T>;
|
|
27
|
+
forgetRemote(handle: RemoteHandle): void;
|
|
28
|
+
}
|
|
29
|
+
/** A hold on an object on another host, bound to a link. Late-bound like a local handle. */
|
|
30
|
+
export declare class RemoteHandle implements Hold {
|
|
31
|
+
#private;
|
|
32
|
+
readonly record: undefined;
|
|
33
|
+
readonly host: RemoteHost;
|
|
34
|
+
readonly contract: AnyContract;
|
|
35
|
+
readonly at: string;
|
|
36
|
+
readonly input: unknown;
|
|
37
|
+
/** Forwarded principal (omitted for the host's own principal). */
|
|
38
|
+
readonly principal: Principal | undefined;
|
|
39
|
+
readonly owner: HoldOwner;
|
|
40
|
+
readonly address: string;
|
|
41
|
+
readonly proxy: object;
|
|
42
|
+
readonly ready: Promise<void>;
|
|
43
|
+
status: HandleStatus;
|
|
44
|
+
error: unknown;
|
|
45
|
+
shape: Shape | undefined;
|
|
46
|
+
binding: {
|
|
47
|
+
readonly channel: RemoteChannel;
|
|
48
|
+
readonly id: number;
|
|
49
|
+
} | undefined;
|
|
50
|
+
readonly shapeListeners: Set<(shape: Shape) => void>;
|
|
51
|
+
constructor(host: RemoteHost, fields: {
|
|
52
|
+
contract: AnyContract;
|
|
53
|
+
at: string;
|
|
54
|
+
input: unknown;
|
|
55
|
+
principal: Principal | undefined;
|
|
56
|
+
owner: HoldOwner;
|
|
57
|
+
address: string;
|
|
58
|
+
});
|
|
59
|
+
get kind(): string | undefined;
|
|
60
|
+
onShape(listener: (shape: Shape) => void): () => void;
|
|
61
|
+
onStatus(listener: StatusListener): () => void;
|
|
62
|
+
release(): void;
|
|
63
|
+
bound(channel: RemoteChannel, id: number): void;
|
|
64
|
+
shaped(shape: Shape): void;
|
|
65
|
+
gone(error: unknown): void;
|
|
66
|
+
/** The link went down but may come back (upstream reconnect): wait, then re-hold. */
|
|
67
|
+
detached(): void;
|
|
68
|
+
member(name: string): unknown;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=remote.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../src/remote.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAyC,KAAK,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAEtF,OAAO,EAGN,KAAK,IAAI,EACT,KAAK,SAAS,EAId,KAAK,cAAc,EACnB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,GAAG,EAAE,YAAY,EAAE,SAAS,EAAY,KAAK,EAAc,MAAM,YAAY,CAAC;AAC5F,OAAO,EAAiB,KAAK,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AAIxE,MAAM,WAAW,SAAS;IACzB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,GAAG,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACxB,KAAK,CAAC,EAAE,SAAS,CAAC;CAClB;AAED,2FAA2F;AAC3F,MAAM,WAAW,aAAa;IAC7B,IAAI,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAAC;IACnC,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE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AC,IAAI,CAAC,CAAC;IAC9B,MAAM,EAAE,YAAY,CAAa;IACjC,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC;IACzB,OAAO,EAAE;QAAE,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC;QAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;IAC9E,QAAQ,CAAC,cAAc,cAAmB,KAAK,KAAK,IAAI,EAAI;IAM5D,YACC,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE;QACP,QAAQ,EAAE,WAAW,CAAC;QACtB,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,OAAO,CAAC;QACf,SAAS,EAAE,SAAS,GAAG,SAAS,CAAC;QACjC,KAAK,EAAE,SAAS,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;KAChB,EAyBD;IAED,IAAI,IAAI,IAAI,MAAM,GAAG,SAAS,CAE7B;IAED,OAAO,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,MAAM,IAAI,CAGpD;IAED,QAAQ,CAAC,QAAQ,EAAE,cAAc,GAAG,MAAM,IAAI,CAG7C;IAQD,OAAO,IAAI,IAAI,CAWd;IAID,KAAK,CAAC,OAAO,EAAE,aAAa,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAE9C;IAED,MAAM,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAmBzB;IAED,IAAI,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAUzB;IAED,qFAAqF;IACrF,QAAQ,IAAI,IAAI,CASf;IAID,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAc5B;CAsDD"}
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
import { Value } from "typebox/value";
|
|
2
|
+
import { applyImmutable, decoder } from "./delta/index.js";
|
|
3
|
+
import { ChordError } from "./errors.js";
|
|
4
|
+
import { CtxImpl, HANDLE_BASE, holdsByProxy, notifyStatus, raceSignal, } from "./record.js";
|
|
5
|
+
import { fromWireError } from "./wire.js";
|
|
6
|
+
const noop = () => { };
|
|
7
|
+
/**
|
|
8
|
+
* A state member of a remote handle: hydrated while subscribed (snapshot, then decoded ops); `undefined` before.
|
|
9
|
+
* Re-subscribing after a reconnect delivers the new snapshot as a reset.
|
|
10
|
+
*/
|
|
11
|
+
class RemoteReadable {
|
|
12
|
+
#handle;
|
|
13
|
+
#name;
|
|
14
|
+
#values = new Set();
|
|
15
|
+
#events = new Set();
|
|
16
|
+
#sub;
|
|
17
|
+
#decoder = decoder();
|
|
18
|
+
#value;
|
|
19
|
+
constructor(handle, name) {
|
|
20
|
+
this.#handle = handle;
|
|
21
|
+
this.#name = name;
|
|
22
|
+
}
|
|
23
|
+
get value() {
|
|
24
|
+
return this.#value;
|
|
25
|
+
}
|
|
26
|
+
subscribe(listener) {
|
|
27
|
+
this.#values.add(listener);
|
|
28
|
+
this.#safe(() => listener(this.#value));
|
|
29
|
+
this.bind();
|
|
30
|
+
return () => this.#remove(this.#values, listener);
|
|
31
|
+
}
|
|
32
|
+
events(listener) {
|
|
33
|
+
this.#events.add(listener);
|
|
34
|
+
this.#safe(() => listener({ type: "snap", value: this.#value }));
|
|
35
|
+
this.bind();
|
|
36
|
+
return () => this.#remove(this.#events, listener);
|
|
37
|
+
}
|
|
38
|
+
/** Subscribes upstream while someone listens and the handle is bound; drops a subscription on an old link. */
|
|
39
|
+
bind() {
|
|
40
|
+
const listening = this.#values.size + this.#events.size > 0;
|
|
41
|
+
// Nobody listens: the value would go stale, so forget it. The next subscriber sees `undefined`, then the snapshot.
|
|
42
|
+
if (!listening)
|
|
43
|
+
this.#value = undefined;
|
|
44
|
+
const binding = listening ? this.#handle.binding : undefined;
|
|
45
|
+
if (binding !== undefined && this.#sub?.channel === binding.channel)
|
|
46
|
+
return;
|
|
47
|
+
if (this.#sub !== undefined) {
|
|
48
|
+
if (this.#sub.channel !== binding?.channel || binding === undefined)
|
|
49
|
+
this.#sub.channel.unsub(this.#sub.id);
|
|
50
|
+
this.#sub = undefined;
|
|
51
|
+
}
|
|
52
|
+
if (binding === undefined)
|
|
53
|
+
return;
|
|
54
|
+
const channel = binding.channel;
|
|
55
|
+
this.#decoder = decoder();
|
|
56
|
+
const id = channel.sub(binding.id, this.#name, (frame) => this.#receive(frame));
|
|
57
|
+
this.#sub = { channel, id };
|
|
58
|
+
}
|
|
59
|
+
/** The link is gone: keep the last value, resubscribe on the next binding. */
|
|
60
|
+
detach() {
|
|
61
|
+
this.#sub = undefined;
|
|
62
|
+
}
|
|
63
|
+
stop() {
|
|
64
|
+
this.#values.clear();
|
|
65
|
+
this.#events.clear();
|
|
66
|
+
this.bind();
|
|
67
|
+
}
|
|
68
|
+
#receive(frame) {
|
|
69
|
+
if (frame.error !== undefined) {
|
|
70
|
+
this.#handle.host.report(fromWireError(frame.error));
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
let event;
|
|
74
|
+
if (frame.ops === undefined && !("snap" in frame) && !("reset" in frame))
|
|
75
|
+
return;
|
|
76
|
+
if (frame.ops !== undefined) {
|
|
77
|
+
const ops = this.#decoder.decode(frame.ops);
|
|
78
|
+
this.#value = applyImmutable(this.#value, ops);
|
|
79
|
+
event = { type: "ops", ops, value: this.#value };
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
// Listeners already saw a snapshot (`undefined` or an older value), so every upstream snapshot is a reset.
|
|
83
|
+
this.#decoder = decoder();
|
|
84
|
+
this.#value = "snap" in frame ? frame.snap : frame.reset;
|
|
85
|
+
event = { type: "reset", value: this.#value };
|
|
86
|
+
}
|
|
87
|
+
for (const listener of [...this.#events])
|
|
88
|
+
this.#safe(() => listener(event));
|
|
89
|
+
for (const listener of [...this.#values])
|
|
90
|
+
this.#safe(() => listener(this.#value));
|
|
91
|
+
}
|
|
92
|
+
#remove(set, listener) {
|
|
93
|
+
set.delete(listener);
|
|
94
|
+
this.bind();
|
|
95
|
+
}
|
|
96
|
+
#safe(fn) {
|
|
97
|
+
try {
|
|
98
|
+
fn();
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
this.#handle.host.report(error);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
/** A hold on an object on another host, bound to a link. Late-bound like a local handle. */
|
|
106
|
+
export class RemoteHandle {
|
|
107
|
+
record = undefined;
|
|
108
|
+
host;
|
|
109
|
+
contract;
|
|
110
|
+
at;
|
|
111
|
+
input;
|
|
112
|
+
/** Forwarded principal (omitted for the host's own principal). */
|
|
113
|
+
principal;
|
|
114
|
+
owner;
|
|
115
|
+
address;
|
|
116
|
+
proxy;
|
|
117
|
+
ready;
|
|
118
|
+
status = "loading";
|
|
119
|
+
error;
|
|
120
|
+
shape;
|
|
121
|
+
binding;
|
|
122
|
+
shapeListeners = new Set();
|
|
123
|
+
#readables = new Map();
|
|
124
|
+
#callers = new Map();
|
|
125
|
+
#settleReady;
|
|
126
|
+
#live;
|
|
127
|
+
constructor(host, fields) {
|
|
128
|
+
this.host = host;
|
|
129
|
+
this.contract = fields.contract;
|
|
130
|
+
this.at = fields.at;
|
|
131
|
+
this.input = fields.input;
|
|
132
|
+
this.principal = fields.principal;
|
|
133
|
+
this.owner = fields.owner;
|
|
134
|
+
this.address = fields.address;
|
|
135
|
+
this.ready = new Promise((resolve, reject) => {
|
|
136
|
+
this.#settleReady = { resolve, reject };
|
|
137
|
+
});
|
|
138
|
+
this.ready.catch(noop);
|
|
139
|
+
this.#live = this.#newLive();
|
|
140
|
+
this.proxy = new Proxy(this, {
|
|
141
|
+
get: (target, property) => {
|
|
142
|
+
if (HANDLE_BASE.has(property)) {
|
|
143
|
+
const value = Reflect.get(target, property, target);
|
|
144
|
+
return typeof value === "function" ? value.bind(target) : value;
|
|
145
|
+
}
|
|
146
|
+
if (typeof property !== "string" || property === "then")
|
|
147
|
+
return undefined;
|
|
148
|
+
return target.member(property);
|
|
149
|
+
},
|
|
150
|
+
});
|
|
151
|
+
holdsByProxy.set(this.proxy, this);
|
|
152
|
+
}
|
|
153
|
+
get kind() {
|
|
154
|
+
return this.shape?.kind;
|
|
155
|
+
}
|
|
156
|
+
onShape(listener) {
|
|
157
|
+
this.shapeListeners.add(listener);
|
|
158
|
+
return () => this.shapeListeners.delete(listener);
|
|
159
|
+
}
|
|
160
|
+
onStatus(listener) {
|
|
161
|
+
this.#statusListeners.add(listener);
|
|
162
|
+
return () => this.#statusListeners.delete(listener);
|
|
163
|
+
}
|
|
164
|
+
#statusListeners = new Set();
|
|
165
|
+
#statusChanged() {
|
|
166
|
+
notifyStatus(this.#statusListeners, this.status, this.error, (error) => this.host.report(error));
|
|
167
|
+
}
|
|
168
|
+
release() {
|
|
169
|
+
if (this.status === "released" || this.status === "gone")
|
|
170
|
+
return;
|
|
171
|
+
this.status = "released";
|
|
172
|
+
this.#statusChanged();
|
|
173
|
+
const error = new ChordError("released", `handle ${this.address} released`);
|
|
174
|
+
this.#settleReady?.reject(error);
|
|
175
|
+
this.#live.reject(error);
|
|
176
|
+
for (const readable of this.#readables.values())
|
|
177
|
+
readable.stop();
|
|
178
|
+
if (this.binding !== undefined)
|
|
179
|
+
this.binding.channel.release(this.binding.id);
|
|
180
|
+
this.binding = undefined;
|
|
181
|
+
this.host.forgetRemote(this);
|
|
182
|
+
}
|
|
183
|
+
// ─── driven by the link ───
|
|
184
|
+
bound(channel, id) {
|
|
185
|
+
this.binding = { channel, id };
|
|
186
|
+
}
|
|
187
|
+
shaped(shape) {
|
|
188
|
+
if (this.status === "released" || this.status === "gone")
|
|
189
|
+
return;
|
|
190
|
+
this.shape = shape;
|
|
191
|
+
const wasLoading = this.status === "loading";
|
|
192
|
+
this.status = "live";
|
|
193
|
+
if (wasLoading)
|
|
194
|
+
this.#statusChanged();
|
|
195
|
+
if (wasLoading) {
|
|
196
|
+
this.#settleReady?.resolve();
|
|
197
|
+
this.#settleReady = undefined;
|
|
198
|
+
this.#live.resolve();
|
|
199
|
+
}
|
|
200
|
+
for (const readable of this.#readables.values())
|
|
201
|
+
readable.bind();
|
|
202
|
+
for (const listener of [...this.shapeListeners]) {
|
|
203
|
+
try {
|
|
204
|
+
listener(shape);
|
|
205
|
+
}
|
|
206
|
+
catch (error) {
|
|
207
|
+
this.host.report(error);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
gone(error) {
|
|
212
|
+
if (this.status === "released" || this.status === "gone")
|
|
213
|
+
return;
|
|
214
|
+
this.status = "gone";
|
|
215
|
+
this.error = error;
|
|
216
|
+
this.#statusChanged();
|
|
217
|
+
this.binding = undefined;
|
|
218
|
+
this.#settleReady?.reject(error);
|
|
219
|
+
this.#live.reject(error);
|
|
220
|
+
for (const readable of this.#readables.values())
|
|
221
|
+
readable.stop();
|
|
222
|
+
this.host.forgetRemote(this);
|
|
223
|
+
}
|
|
224
|
+
/** The link went down but may come back (upstream reconnect): wait, then re-hold. */
|
|
225
|
+
detached() {
|
|
226
|
+
if (this.status === "released" || this.status === "gone")
|
|
227
|
+
return;
|
|
228
|
+
this.binding = undefined;
|
|
229
|
+
for (const readable of this.#readables.values())
|
|
230
|
+
readable.detach();
|
|
231
|
+
if (this.status === "live") {
|
|
232
|
+
this.status = "loading";
|
|
233
|
+
this.#live = this.#newLive();
|
|
234
|
+
this.#statusChanged();
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
// ─── members ───
|
|
238
|
+
member(name) {
|
|
239
|
+
const description = Object.values(this.contract.description.variants)
|
|
240
|
+
.map((members) => members[name])
|
|
241
|
+
.find((member) => member !== undefined);
|
|
242
|
+
if (description?.kind === "method")
|
|
243
|
+
return this.#caller(name);
|
|
244
|
+
if (description?.kind === "state") {
|
|
245
|
+
let readable = this.#readables.get(name);
|
|
246
|
+
if (readable === undefined) {
|
|
247
|
+
readable = new RemoteReadable(this, name);
|
|
248
|
+
this.#readables.set(name, readable);
|
|
249
|
+
}
|
|
250
|
+
return readable;
|
|
251
|
+
}
|
|
252
|
+
return undefined;
|
|
253
|
+
}
|
|
254
|
+
#caller(name) {
|
|
255
|
+
let caller = this.#callers.get(name);
|
|
256
|
+
if (caller === undefined) {
|
|
257
|
+
caller = (args, ctx) => {
|
|
258
|
+
if (this.host.inFactory > 0)
|
|
259
|
+
throw new ChordError("not_ready", `${this.address}.${name} called inside a factory`);
|
|
260
|
+
if (ctx instanceof CtxImpl) {
|
|
261
|
+
try {
|
|
262
|
+
ctx.check(ctx.host);
|
|
263
|
+
}
|
|
264
|
+
catch (error) {
|
|
265
|
+
return Promise.reject(error);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
if (ctx === undefined || (ctx instanceof CtxImpl && ctx.holder)) {
|
|
269
|
+
return this.host.root((root) => this.#call(name, args, root), { signal: ctx?.signal });
|
|
270
|
+
}
|
|
271
|
+
return this.#call(name, args, ctx);
|
|
272
|
+
};
|
|
273
|
+
this.#callers.set(name, caller);
|
|
274
|
+
}
|
|
275
|
+
return caller;
|
|
276
|
+
}
|
|
277
|
+
async #call(name, args, ctx) {
|
|
278
|
+
for (;;) {
|
|
279
|
+
if (this.status === "released" || this.status === "gone") {
|
|
280
|
+
throw this.status === "gone" ? this.error : new ChordError("released", `handle ${this.address} released`);
|
|
281
|
+
}
|
|
282
|
+
if (this.status === "loading")
|
|
283
|
+
await raceSignal(this.#live.promise, ctx.signal);
|
|
284
|
+
const binding = this.binding;
|
|
285
|
+
if (binding === undefined)
|
|
286
|
+
continue;
|
|
287
|
+
const kind = this.shape?.kind;
|
|
288
|
+
if (kind === undefined || this.contract.description.variants[kind]?.[name]?.kind !== "method") {
|
|
289
|
+
throw new ChordError("not_in_variant", `${this.address}: ${name} is not a method of variant ${kind}`);
|
|
290
|
+
}
|
|
291
|
+
// Send only what the consumer's own schema knows (the additive rule's premise; see RecordImpl.call).
|
|
292
|
+
const description = this.contract.description.variants[kind]?.[name];
|
|
293
|
+
const sent = description?.kind === "method" ? Value.Clean(description.args, Value.Clone(args)) : args;
|
|
294
|
+
return binding.channel.call(binding.id, name, sent, { rootId: ctx.rootId, epoch: ctx.epoch }, ctx.signal);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
#newLive() {
|
|
298
|
+
let resolve = noop;
|
|
299
|
+
let reject = noop;
|
|
300
|
+
const promise = new Promise((done, fail) => {
|
|
301
|
+
resolve = done;
|
|
302
|
+
reject = fail;
|
|
303
|
+
});
|
|
304
|
+
promise.catch(noop);
|
|
305
|
+
return { promise, resolve, reject };
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
//# sourceMappingURL=remote.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote.js","sourceRoot":"","sources":["../src/remote.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC,OAAO,EAAE,cAAc,EAAgB,OAAO,EAAe,MAAM,kBAAkB,CAAC;AACtF,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EACN,OAAO,EACP,WAAW,EAGX,YAAY,EACZ,YAAY,EACZ,UAAU,GAEV,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,aAAa,EAAgC,MAAM,WAAW,CAAC;AAExE,MAAM,IAAI,GAAG,GAAS,EAAE,GAAE,CAAC,CAAC;AA0B5B;;;GAGG;AACH,MAAM,cAAc;IACV,OAAO,CAAe;IACtB,KAAK,CAAS;IACd,OAAO,GAAG,IAAI,GAAG,EAA4B,CAAC;IAC9C,OAAO,GAAG,IAAI,GAAG,EAAwC,CAAC;IACnE,IAAI,CAAuE;IAC3E,QAAQ,GAAY,OAAO,EAAE,CAAC;IAC9B,MAAM,CAAU;IAEhB,YAAY,MAAoB,EAAE,IAAY;QAC7C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,IAAI,KAAK;QACR,OAAO,IAAI,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,CAAC,CAAC,CAAC,IAAI,CAAC;YACtG,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;QAC3G,CAAC;IACF,CAAC;IAED,QAAQ;QACP,IAAI,OAAO,GAAG,IAAI,CAAC;QACnB,IAAI,MAAM,GAA6B,IAAI,CAAC;QAC5C,MAAM,OAAO,GAAG,IAAI,OAAO,CAAO,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE;YAChD,OAAO,GAAG,IAAI,CAAC;YACf,MAAM,GAAG,IAAI,CAAC;QACf,CAAC,CAAC,CAAC;QACH,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACpB,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IACrC,CAAC;CACD","sourcesContent":["import { Value } from \"typebox/value\";\nimport type { AnyContract } from \"./contract.ts\";\nimport { applyImmutable, type Decoder, decoder, type WireOp } from \"./delta/index.ts\";\nimport { ChordError } from \"./errors.ts\";\nimport {\n\tCtxImpl,\n\tHANDLE_BASE,\n\ttype Hold,\n\ttype HoldOwner,\n\tholdsByProxy,\n\tnotifyStatus,\n\traceSignal,\n\ttype StatusListener,\n} from \"./record.ts\";\nimport type { Ctx, HandleStatus, Principal, Readable, Shape, StateEvent } from \"./types.ts\";\nimport { fromWireError, type RootRef, type WireError } from \"./wire.ts\";\n\nconst noop = (): void => {};\n\nexport interface StateSink {\n\tsnap?: unknown;\n\treset?: unknown;\n\tops?: readonly WireOp[];\n\terror?: WireError;\n}\n\n/** What a remote handle needs from the link it is bound to (implemented by Connection). */\nexport interface RemoteChannel {\n\thold(handle: RemoteHandle): number;\n\trelease(id: number): void;\n\tcall(hold: number, member: string, args: unknown, root: RootRef | undefined, signal: AbortSignal): Promise<unknown>;\n\tsub(hold: number, member: string, sink: (frame: StateSink) => void): number;\n\tunsub(id: number): void;\n}\n\n/** What a remote handle needs from its host. */\nexport interface RemoteHost {\n\treadonly inFactory: number;\n\treport(error: unknown): void;\n\troot<T>(fn: (ctx: Ctx) => T | Promise<T>, options?: { signal?: AbortSignal }): Promise<T>;\n\tforgetRemote(handle: RemoteHandle): void;\n}\n\n/**\n * A state member of a remote handle: hydrated while subscribed (snapshot, then decoded ops); `undefined` before.\n * Re-subscribing after a reconnect delivers the new snapshot as a reset.\n */\nclass RemoteReadable implements Readable<unknown> {\n\treadonly #handle: RemoteHandle;\n\treadonly #name: string;\n\treadonly #values = new Set<(value: unknown) => void>();\n\treadonly #events = new Set<(event: StateEvent<unknown>) => void>();\n\t#sub: { readonly channel: RemoteChannel; readonly id: number } | undefined;\n\t#decoder: Decoder = decoder();\n\t#value: unknown;\n\n\tconstructor(handle: RemoteHandle, name: string) {\n\t\tthis.#handle = handle;\n\t\tthis.#name = name;\n\t}\n\n\tget value(): unknown {\n\t\treturn this.#value;\n\t}\n\n\tsubscribe(listener: (value: unknown) => void): () => void {\n\t\tthis.#values.add(listener);\n\t\tthis.#safe(() => listener(this.#value));\n\t\tthis.bind();\n\t\treturn () => this.#remove(this.#values, listener);\n\t}\n\n\tevents(listener: (event: StateEvent<unknown>) => void): () => void {\n\t\tthis.#events.add(listener);\n\t\tthis.#safe(() => listener({ type: \"snap\", value: this.#value }));\n\t\tthis.bind();\n\t\treturn () => this.#remove(this.#events, listener);\n\t}\n\n\t/** Subscribes upstream while someone listens and the handle is bound; drops a subscription on an old link. */\n\tbind(): void {\n\t\tconst listening = this.#values.size + this.#events.size > 0;\n\t\t// Nobody listens: the value would go stale, so forget it. The next subscriber sees `undefined`, then the snapshot.\n\t\tif (!listening) this.#value = undefined;\n\t\tconst binding = listening ? this.#handle.binding : undefined;\n\t\tif (binding !== undefined && this.#sub?.channel === binding.channel) return;\n\t\tif (this.#sub !== undefined) {\n\t\t\tif (this.#sub.channel !== binding?.channel || binding === undefined) this.#sub.channel.unsub(this.#sub.id);\n\t\t\tthis.#sub = undefined;\n\t\t}\n\t\tif (binding === undefined) return;\n\t\tconst channel = binding.channel;\n\t\tthis.#decoder = decoder();\n\t\tconst id = channel.sub(binding.id, this.#name, (frame) => this.#receive(frame));\n\t\tthis.#sub = { channel, id };\n\t}\n\n\t/** The link is gone: keep the last value, resubscribe on the next binding. */\n\tdetach(): void {\n\t\tthis.#sub = undefined;\n\t}\n\n\tstop(): void {\n\t\tthis.#values.clear();\n\t\tthis.#events.clear();\n\t\tthis.bind();\n\t}\n\n\t#receive(frame: StateSink): void {\n\t\tif (frame.error !== undefined) {\n\t\t\tthis.#handle.host.report(fromWireError(frame.error));\n\t\t\treturn;\n\t\t}\n\t\tlet event: StateEvent<unknown>;\n\t\tif (frame.ops === undefined && !(\"snap\" in frame) && !(\"reset\" in frame)) return;\n\t\tif (frame.ops !== undefined) {\n\t\t\tconst ops = this.#decoder.decode(frame.ops);\n\t\t\tthis.#value = applyImmutable(this.#value, ops);\n\t\t\tevent = { type: \"ops\", ops, value: this.#value };\n\t\t} else {\n\t\t\t// Listeners already saw a snapshot (`undefined` or an older value), so every upstream snapshot is a reset.\n\t\t\tthis.#decoder = decoder();\n\t\t\tthis.#value = \"snap\" in frame ? frame.snap : frame.reset;\n\t\t\tevent = { type: \"reset\", value: this.#value };\n\t\t}\n\t\tfor (const listener of [...this.#events]) this.#safe(() => listener(event));\n\t\tfor (const listener of [...this.#values]) this.#safe(() => listener(this.#value));\n\t}\n\n\t#remove<T>(set: Set<T>, listener: T): void {\n\t\tset.delete(listener);\n\t\tthis.bind();\n\t}\n\n\t#safe(fn: () => void): void {\n\t\ttry {\n\t\t\tfn();\n\t\t} catch (error) {\n\t\t\tthis.#handle.host.report(error);\n\t\t}\n\t}\n}\n\n/** A hold on an object on another host, bound to a link. Late-bound like a local handle. */\nexport class RemoteHandle implements Hold {\n\treadonly record = undefined;\n\treadonly host: RemoteHost;\n\treadonly contract: AnyContract;\n\treadonly at: string;\n\treadonly input: unknown;\n\t/** Forwarded principal (omitted for the host's own principal). */\n\treadonly principal: Principal | undefined;\n\treadonly owner: HoldOwner;\n\treadonly address: string;\n\treadonly proxy: object;\n\treadonly ready: Promise<void>;\n\tstatus: HandleStatus = \"loading\";\n\terror: unknown;\n\tshape: Shape | undefined;\n\tbinding: { readonly channel: RemoteChannel; readonly id: number } | undefined;\n\treadonly shapeListeners = new Set<(shape: Shape) => void>();\n\treadonly #readables = new Map<string, RemoteReadable>();\n\treadonly #callers = new Map<string, (args: unknown, ctx?: Ctx) => Promise<unknown>>();\n\t#settleReady: { resolve: () => void; reject: (error: unknown) => void } | undefined;\n\t#live: { promise: Promise<void>; resolve: () => void; reject: (error: unknown) => void };\n\n\tconstructor(\n\t\thost: RemoteHost,\n\t\tfields: {\n\t\t\tcontract: AnyContract;\n\t\t\tat: string;\n\t\t\tinput: unknown;\n\t\t\tprincipal: Principal | undefined;\n\t\t\towner: HoldOwner;\n\t\t\taddress: string;\n\t\t},\n\t) {\n\t\tthis.host = host;\n\t\tthis.contract = fields.contract;\n\t\tthis.at = fields.at;\n\t\tthis.input = fields.input;\n\t\tthis.principal = fields.principal;\n\t\tthis.owner = fields.owner;\n\t\tthis.address = fields.address;\n\t\tthis.ready = new Promise<void>((resolve, reject) => {\n\t\t\tthis.#settleReady = { resolve, reject };\n\t\t});\n\t\tthis.ready.catch(noop);\n\t\tthis.#live = this.#newLive();\n\t\tthis.proxy = new Proxy(this, {\n\t\t\tget: (target, property) => {\n\t\t\t\tif (HANDLE_BASE.has(property)) {\n\t\t\t\t\tconst value: unknown = Reflect.get(target, property, target);\n\t\t\t\t\treturn typeof value === \"function\" ? value.bind(target) : value;\n\t\t\t\t}\n\t\t\t\tif (typeof property !== \"string\" || property === \"then\") return undefined;\n\t\t\t\treturn target.member(property);\n\t\t\t},\n\t\t});\n\t\tholdsByProxy.set(this.proxy, this);\n\t}\n\n\tget kind(): string | undefined {\n\t\treturn this.shape?.kind;\n\t}\n\n\tonShape(listener: (shape: Shape) => void): () => void {\n\t\tthis.shapeListeners.add(listener);\n\t\treturn () => this.shapeListeners.delete(listener);\n\t}\n\n\tonStatus(listener: StatusListener): () => void {\n\t\tthis.#statusListeners.add(listener);\n\t\treturn () => this.#statusListeners.delete(listener);\n\t}\n\n\treadonly #statusListeners = new Set<StatusListener>();\n\n\t#statusChanged(): void {\n\t\tnotifyStatus(this.#statusListeners, this.status, this.error, (error) => this.host.report(error));\n\t}\n\n\trelease(): void {\n\t\tif (this.status === \"released\" || this.status === \"gone\") return;\n\t\tthis.status = \"released\";\n\t\tthis.#statusChanged();\n\t\tconst error = new ChordError(\"released\", `handle ${this.address} released`);\n\t\tthis.#settleReady?.reject(error);\n\t\tthis.#live.reject(error);\n\t\tfor (const readable of this.#readables.values()) readable.stop();\n\t\tif (this.binding !== undefined) this.binding.channel.release(this.binding.id);\n\t\tthis.binding = undefined;\n\t\tthis.host.forgetRemote(this);\n\t}\n\n\t// ─── driven by the link ───\n\n\tbound(channel: RemoteChannel, id: number): void {\n\t\tthis.binding = { channel, id };\n\t}\n\n\tshaped(shape: Shape): void {\n\t\tif (this.status === \"released\" || this.status === \"gone\") return;\n\t\tthis.shape = shape;\n\t\tconst wasLoading = this.status === \"loading\";\n\t\tthis.status = \"live\";\n\t\tif (wasLoading) this.#statusChanged();\n\t\tif (wasLoading) {\n\t\t\tthis.#settleReady?.resolve();\n\t\t\tthis.#settleReady = undefined;\n\t\t\tthis.#live.resolve();\n\t\t}\n\t\tfor (const readable of this.#readables.values()) readable.bind();\n\t\tfor (const listener of [...this.shapeListeners]) {\n\t\t\ttry {\n\t\t\t\tlistener(shape);\n\t\t\t} catch (error) {\n\t\t\t\tthis.host.report(error);\n\t\t\t}\n\t\t}\n\t}\n\n\tgone(error: unknown): void {\n\t\tif (this.status === \"released\" || this.status === \"gone\") return;\n\t\tthis.status = \"gone\";\n\t\tthis.error = error;\n\t\tthis.#statusChanged();\n\t\tthis.binding = undefined;\n\t\tthis.#settleReady?.reject(error);\n\t\tthis.#live.reject(error);\n\t\tfor (const readable of this.#readables.values()) readable.stop();\n\t\tthis.host.forgetRemote(this);\n\t}\n\n\t/** The link went down but may come back (upstream reconnect): wait, then re-hold. */\n\tdetached(): void {\n\t\tif (this.status === \"released\" || this.status === \"gone\") return;\n\t\tthis.binding = undefined;\n\t\tfor (const readable of this.#readables.values()) readable.detach();\n\t\tif (this.status === \"live\") {\n\t\t\tthis.status = \"loading\";\n\t\t\tthis.#live = this.#newLive();\n\t\t\tthis.#statusChanged();\n\t\t}\n\t}\n\n\t// ─── members ───\n\n\tmember(name: string): unknown {\n\t\tconst description = Object.values(this.contract.description.variants)\n\t\t\t.map((members) => members[name])\n\t\t\t.find((member) => member !== undefined);\n\t\tif (description?.kind === \"method\") return this.#caller(name);\n\t\tif (description?.kind === \"state\") {\n\t\t\tlet readable = this.#readables.get(name);\n\t\t\tif (readable === undefined) {\n\t\t\t\treadable = new RemoteReadable(this, name);\n\t\t\t\tthis.#readables.set(name, readable);\n\t\t\t}\n\t\t\treturn readable;\n\t\t}\n\t\treturn undefined;\n\t}\n\n\t#caller(name: string): (args: unknown, ctx?: Ctx) => Promise<unknown> {\n\t\tlet caller = this.#callers.get(name);\n\t\tif (caller === undefined) {\n\t\t\tcaller = (args, ctx) => {\n\t\t\t\tif (this.host.inFactory > 0)\n\t\t\t\t\tthrow new ChordError(\"not_ready\", `${this.address}.${name} called inside a factory`);\n\t\t\t\tif (ctx instanceof CtxImpl) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tctx.check(ctx.host);\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\treturn Promise.reject(error);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (ctx === undefined || (ctx instanceof CtxImpl && ctx.holder)) {\n\t\t\t\t\treturn this.host.root((root) => this.#call(name, args, root), { signal: ctx?.signal });\n\t\t\t\t}\n\t\t\t\treturn this.#call(name, args, ctx);\n\t\t\t};\n\t\t\tthis.#callers.set(name, caller);\n\t\t}\n\t\treturn caller;\n\t}\n\n\tasync #call(name: string, args: unknown, ctx: Ctx): Promise<unknown> {\n\t\tfor (;;) {\n\t\t\tif (this.status === \"released\" || this.status === \"gone\") {\n\t\t\t\tthrow this.status === \"gone\" ? this.error : new ChordError(\"released\", `handle ${this.address} released`);\n\t\t\t}\n\t\t\tif (this.status === \"loading\") await raceSignal(this.#live.promise, ctx.signal);\n\t\t\tconst binding = this.binding;\n\t\t\tif (binding === undefined) continue;\n\t\t\tconst kind = this.shape?.kind;\n\t\t\tif (kind === undefined || this.contract.description.variants[kind]?.[name]?.kind !== \"method\") {\n\t\t\t\tthrow new ChordError(\"not_in_variant\", `${this.address}: ${name} is not a method of variant ${kind}`);\n\t\t\t}\n\t\t\t// Send only what the consumer's own schema knows (the additive rule's premise; see RecordImpl.call).\n\t\t\tconst description = this.contract.description.variants[kind]?.[name];\n\t\t\tconst sent = description?.kind === \"method\" ? Value.Clean(description.args, Value.Clone(args)) : args;\n\t\t\treturn binding.channel.call(binding.id, name, sent, { rootId: ctx.rootId, epoch: ctx.epoch }, ctx.signal);\n\t\t}\n\t}\n\n\t#newLive(): { promise: Promise<void>; resolve: () => void; reject: (error: unknown) => void } {\n\t\tlet resolve = noop;\n\t\tlet reject: (error: unknown) => void = noop;\n\t\tconst promise = new Promise<void>((done, fail) => {\n\t\t\tresolve = done;\n\t\t\treject = fail;\n\t\t});\n\t\tpromise.catch(noop);\n\t\treturn { promise, resolve, reject };\n\t}\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { TSchema } from "typebox";
|
|
2
|
+
import { type ChordErrorReason } from "./errors.ts";
|
|
3
|
+
/** Canonical JSON: sorted object keys, `undefined` members dropped. */
|
|
4
|
+
export declare function canonicalJson(value: unknown): string;
|
|
5
|
+
/** Non-cryptographic 64-bit hash (two FNV-1a lanes). Contracts are trusted, so collisions are not an attack surface. */
|
|
6
|
+
export declare function hash64(text: string): string;
|
|
7
|
+
export declare function deepEqual(a: unknown, b: unknown): boolean;
|
|
8
|
+
/** Throws `invalid` (with `reason`) and the first schema errors when `value` does not match. */
|
|
9
|
+
export declare function assertValid(reason: ChordErrorReason, what: string, schema: TSchema, value: unknown): void;
|
|
10
|
+
/** Applies defaults, strips unknown fields, validates. Returns a fresh value. */
|
|
11
|
+
export declare function normalize(schema: TSchema, value: unknown, what: string): unknown;
|
|
12
|
+
/** Canonical identity of a normalized value: fields equal to their schema default are omitted. */
|
|
13
|
+
export declare function canonicalIdentity(schema: TSchema, value: unknown): string;
|
|
14
|
+
/**
|
|
15
|
+
* Conservative structural subtyping: true only if every value valid under `sub` is valid under `sup`, where object
|
|
16
|
+
* fields missing from `sub` but optional in `sup` count as fine (unknown fields are stripped at the provider, see
|
|
17
|
+
* `RecordImpl.call`). A provider schema using a keyword this function does not model (`not`, `allOf`, `contains`,
|
|
18
|
+
* `$ref`, ...) or an `additionalProperties` schema only fits an identical consumer schema.
|
|
19
|
+
*/
|
|
20
|
+
export declare function fits(subSchema: unknown, supSchema: unknown): boolean;
|
|
21
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,EAAE,KAAK,gBAAgB,EAAW,MAAM,aAAa,CAAC;AAQ7D,uEAAuE;AACvE,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAOpD;AAED,wHAAwH;AACxH,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAS3C;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,OAAO,CAEzD;AAED,gGAAgG;AAChG,wBAAgB,WAAW,CAAC,MAAM,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAKzG;AAED,iFAAiF;AACjF,wBAAgB,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAIhF;AAED,kGAAkG;AAClG,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,CAEzE;AAyED;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,GAAG,OAAO,CA0BpE"}
|