stitchkit 0.93.0 → 0.94.1
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/CHANGELOG.md +198 -0
- package/README.md +5 -2
- package/dist/agent-runtime/children-control.d.ts +6 -0
- package/dist/agent-runtime/children-control.d.ts.map +1 -0
- package/dist/agent-runtime/children-spawn.d.ts +6 -0
- package/dist/agent-runtime/children-spawn.d.ts.map +1 -0
- package/dist/agent-runtime/children-state.d.ts +46 -0
- package/dist/agent-runtime/children-state.d.ts.map +1 -0
- package/dist/agent-runtime/children-usage.d.ts +8 -0
- package/dist/agent-runtime/children-usage.d.ts.map +1 -0
- package/dist/agent-runtime/children.d.ts +11 -14
- package/dist/agent-runtime/children.d.ts.map +1 -1
- package/dist/agent-runtime/coding-shell-process.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-contract.d.ts +2 -1
- package/dist/agent-runtime/coding-tool-contract.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-listing.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-search-patch.d.ts.map +1 -1
- package/dist/agent-runtime/contained-darwin.d.ts +38 -0
- package/dist/agent-runtime/contained-darwin.d.ts.map +1 -0
- package/dist/agent-runtime/contained-files.d.ts +11 -26
- package/dist/agent-runtime/contained-files.d.ts.map +1 -1
- package/dist/agent-runtime/contained-scan.d.ts +21 -0
- package/dist/agent-runtime/contained-scan.d.ts.map +1 -0
- package/dist/agent-runtime/contained-write.d.ts +9 -0
- package/dist/agent-runtime/contained-write.d.ts.map +1 -0
- package/dist/agent-runtime/deferred-tool-types.d.ts +4 -3
- package/dist/agent-runtime/deferred-tool-types.d.ts.map +1 -1
- package/dist/agent-runtime/events.d.ts +1 -1
- package/dist/agent-runtime/events.d.ts.map +1 -1
- package/dist/agent-runtime/harness-control.d.ts +0 -1
- package/dist/agent-runtime/harness-control.d.ts.map +1 -1
- package/dist/agent-runtime/harness.d.ts +0 -5
- package/dist/agent-runtime/harness.d.ts.map +1 -1
- package/dist/agent-runtime/managed-tools.d.ts +3 -2
- package/dist/agent-runtime/managed-tools.d.ts.map +1 -1
- package/dist/agent-runtime/observability.d.ts +1 -1
- package/dist/agent-runtime/observability.d.ts.map +1 -1
- package/dist/agent-runtime/openrouter.d.ts +29 -0
- package/dist/agent-runtime/openrouter.d.ts.map +1 -0
- package/dist/agent-runtime/projections.d.ts +1 -1
- package/dist/agent-runtime/projections.d.ts.map +1 -1
- package/dist/agent-runtime/run-acquisition.d.ts +17 -0
- package/dist/agent-runtime/run-acquisition.d.ts.map +1 -0
- package/dist/agent-runtime/run-execution-state.d.ts +133 -0
- package/dist/agent-runtime/run-execution-state.d.ts.map +1 -0
- package/dist/agent-runtime/run-execution.d.ts +17 -33
- package/dist/agent-runtime/run-execution.d.ts.map +1 -1
- package/dist/agent-runtime/run-failure.d.ts +18 -0
- package/dist/agent-runtime/run-failure.d.ts.map +1 -0
- package/dist/agent-runtime/run-model-attempts.d.ts +6 -0
- package/dist/agent-runtime/run-model-attempts.d.ts.map +1 -0
- package/dist/agent-runtime/run-prompt-history.d.ts +58 -0
- package/dist/agent-runtime/run-prompt-history.d.ts.map +1 -0
- package/dist/agent-runtime/run-provider-ledger.d.ts +26 -0
- package/dist/agent-runtime/run-provider-ledger.d.ts.map +1 -0
- package/dist/agent-runtime/run-stream-parts.d.ts +17 -0
- package/dist/agent-runtime/run-stream-parts.d.ts.map +1 -0
- package/dist/agent-runtime/run-terminal.d.ts +11 -0
- package/dist/agent-runtime/run-terminal.d.ts.map +1 -0
- package/dist/agent-runtime/run-turn-preparation.d.ts +22 -0
- package/dist/agent-runtime/run-turn-preparation.d.ts.map +1 -0
- package/dist/agent-runtime/runtime-admission-gate.d.ts +29 -0
- package/dist/agent-runtime/runtime-admission-gate.d.ts.map +1 -0
- package/dist/agent-runtime/runtime-control.d.ts +9 -0
- package/dist/agent-runtime/runtime-control.d.ts.map +1 -0
- package/dist/agent-runtime/runtime-recovery.d.ts +10 -0
- package/dist/agent-runtime/runtime-recovery.d.ts.map +1 -0
- package/dist/agent-runtime/runtime-state.d.ts +36 -0
- package/dist/agent-runtime/runtime-state.d.ts.map +1 -0
- package/dist/agent-runtime/runtime-submit.d.ts +5 -0
- package/dist/agent-runtime/runtime-submit.d.ts.map +1 -0
- package/dist/agent-runtime/runtime.d.ts +10 -5
- package/dist/agent-runtime/runtime.d.ts.map +1 -1
- package/dist/agent-runtime/schedule-records.d.ts +34 -0
- package/dist/agent-runtime/schedule-records.d.ts.map +1 -0
- package/dist/agent-runtime/schedules.d.ts +34 -0
- package/dist/agent-runtime/schedules.d.ts.map +1 -1
- package/dist/agent-runtime/sqlite-bun.d.ts +12 -0
- package/dist/agent-runtime/sqlite-bun.d.ts.map +1 -0
- package/dist/agent-runtime/sqlite-events.d.ts +5 -0
- package/dist/agent-runtime/sqlite-events.d.ts.map +1 -0
- package/dist/agent-runtime/sqlite-history.d.ts +7 -0
- package/dist/agent-runtime/sqlite-history.d.ts.map +1 -0
- package/dist/agent-runtime/sqlite-ledger.d.ts +7 -0
- package/dist/agent-runtime/sqlite-ledger.d.ts.map +1 -0
- package/dist/agent-runtime/sqlite-node.d.ts +12 -0
- package/dist/agent-runtime/sqlite-node.d.ts.map +1 -0
- package/dist/agent-runtime/sqlite-reads.d.ts +14 -0
- package/dist/agent-runtime/sqlite-reads.d.ts.map +1 -0
- package/dist/agent-runtime/sqlite-rows.d.ts +178 -0
- package/dist/agent-runtime/sqlite-rows.d.ts.map +1 -0
- package/dist/agent-runtime/sqlite-schema.d.ts +7 -0
- package/dist/agent-runtime/sqlite-schema.d.ts.map +1 -0
- package/dist/agent-runtime/sqlite-transactions.d.ts +25 -0
- package/dist/agent-runtime/sqlite-transactions.d.ts.map +1 -0
- package/dist/agent-runtime/sqlite.d.ts +10 -6
- package/dist/agent-runtime/sqlite.d.ts.map +1 -1
- package/dist/agent-runtime/store-archive.d.ts +16 -0
- package/dist/agent-runtime/store-archive.d.ts.map +1 -0
- package/dist/agent-runtime/store-conformance-lifecycle.d.ts +434 -0
- package/dist/agent-runtime/store-conformance-lifecycle.d.ts.map +1 -0
- package/dist/agent-runtime/store-conformance-ordering.d.ts +18 -0
- package/dist/agent-runtime/store-conformance-ordering.d.ts.map +1 -0
- package/dist/agent-runtime/store-conformance-support.d.ts +130 -0
- package/dist/agent-runtime/store-conformance-support.d.ts.map +1 -0
- package/dist/agent-runtime/store-conformance-terminal.d.ts +12 -0
- package/dist/agent-runtime/store-conformance-terminal.d.ts.map +1 -0
- package/dist/agent-runtime/store-conformance.d.ts +40 -0
- package/dist/agent-runtime/store-conformance.d.ts.map +1 -0
- package/dist/agent-runtime/store-create.d.ts +11 -0
- package/dist/agent-runtime/store-create.d.ts.map +1 -0
- package/dist/agent-runtime/store-driver-contract.d.ts +814 -0
- package/dist/agent-runtime/store-driver-contract.d.ts.map +1 -0
- package/dist/agent-runtime/store-events.d.ts +7 -89
- package/dist/agent-runtime/store-events.d.ts.map +1 -1
- package/dist/agent-runtime/store-memory.d.ts +4 -0
- package/dist/agent-runtime/store-memory.d.ts.map +1 -0
- package/dist/agent-runtime/store-mutate.d.ts +13 -0
- package/dist/agent-runtime/store-mutate.d.ts.map +1 -0
- package/dist/agent-runtime/store-purge.d.ts +1 -1
- package/dist/agent-runtime/store-purge.d.ts.map +1 -1
- package/dist/agent-runtime/store-reads.d.ts +29 -0
- package/dist/agent-runtime/store-reads.d.ts.map +1 -0
- package/dist/agent-runtime/store-reduce-history.d.ts +10 -0
- package/dist/agent-runtime/store-reduce-history.d.ts.map +1 -0
- package/dist/agent-runtime/store-reduce-run.d.ts +14 -0
- package/dist/agent-runtime/store-reduce-run.d.ts.map +1 -0
- package/dist/agent-runtime/store-reduce-shared.d.ts +76 -0
- package/dist/agent-runtime/store-reduce-shared.d.ts.map +1 -0
- package/dist/agent-runtime/store-reduce-terminal.d.ts +6 -0
- package/dist/agent-runtime/store-reduce-terminal.d.ts.map +1 -0
- package/dist/agent-runtime/store-reducer.d.ts +24 -0
- package/dist/agent-runtime/store-reducer.d.ts.map +1 -0
- package/dist/agent-runtime/store-snapshot.d.ts +19 -0
- package/dist/agent-runtime/store-snapshot.d.ts.map +1 -0
- package/dist/agent-runtime/store.d.ts +1 -1
- package/dist/agent-runtime/store.d.ts.map +1 -1
- package/dist/application/admission-rate.d.ts +21 -0
- package/dist/application/admission-rate.d.ts.map +1 -0
- package/dist/application/admission-run.d.ts +8 -0
- package/dist/application/admission-run.d.ts.map +1 -0
- package/dist/application/admission.d.ts +1 -1
- package/dist/application/admission.d.ts.map +1 -1
- package/dist/application/diagnostic-journal-lock.d.ts +9 -34
- package/dist/application/diagnostic-journal-lock.d.ts.map +1 -1
- package/dist/application/diagnostic-journal-manager.d.ts.map +1 -1
- package/dist/application/diagnostic-journal-storage.d.ts.map +1 -1
- package/dist/application/events.d.ts +1 -1
- package/dist/application/events.d.ts.map +1 -1
- package/dist/application/file-state-store.d.ts +23 -0
- package/dist/application/file-state-store.d.ts.map +1 -0
- package/dist/application/health.d.ts +1 -1
- package/dist/application/health.d.ts.map +1 -1
- package/dist/application/kernel-admission.d.ts +8 -0
- package/dist/application/kernel-admission.d.ts.map +1 -0
- package/dist/application/kernel-contract.d.ts +142 -0
- package/dist/application/kernel-contract.d.ts.map +1 -0
- package/dist/application/kernel-resource-context.d.ts +24 -0
- package/dist/application/kernel-resource-context.d.ts.map +1 -0
- package/dist/application/kernel-restart.d.ts +5 -0
- package/dist/application/kernel-restart.d.ts.map +1 -0
- package/dist/application/kernel-rollback.d.ts +4 -0
- package/dist/application/kernel-rollback.d.ts.map +1 -0
- package/dist/application/kernel-shutdown.d.ts +6 -0
- package/dist/application/kernel-shutdown.d.ts.map +1 -0
- package/dist/application/kernel-start.d.ts +20 -0
- package/dist/application/kernel-start.d.ts.map +1 -0
- package/dist/application/kernel-state.d.ts +116 -0
- package/dist/application/kernel-state.d.ts.map +1 -0
- package/dist/application/kernel.d.ts +9 -140
- package/dist/application/kernel.d.ts.map +1 -1
- package/dist/application/latest-sink.d.ts +1 -1
- package/dist/application/latest-sink.d.ts.map +1 -1
- package/dist/application/notification-outbox.d.ts.map +1 -1
- package/dist/application/opentelemetry.d.ts +1 -1
- package/dist/application/opentelemetry.d.ts.map +1 -1
- package/dist/application/schedule.d.ts +0 -1
- package/dist/application/schedule.d.ts.map +1 -1
- package/dist/application/watch-hub-core.d.ts +122 -0
- package/dist/application/watch-hub-core.d.ts.map +1 -0
- package/dist/application/watch-hub.d.ts +3 -3
- package/dist/application/watch-hub.d.ts.map +1 -1
- package/dist/browser/client-executors.d.ts +14 -0
- package/dist/browser/client-executors.d.ts.map +1 -0
- package/dist/browser/client-multipart.d.ts +1 -1
- package/dist/browser/client-multipart.d.ts.map +1 -1
- package/dist/browser/client-url.d.ts +1 -1
- package/dist/browser/client-url.d.ts.map +1 -1
- package/dist/browser/client.d.ts +3 -2
- package/dist/browser/client.d.ts.map +1 -1
- package/dist/browser/contract-stream.d.ts +1 -1
- package/dist/browser/contract-stream.d.ts.map +1 -1
- package/dist/browser/http-fetch.d.ts +22 -0
- package/dist/browser/http-fetch.d.ts.map +1 -0
- package/dist/browser/http.d.ts +2 -4
- package/dist/browser/http.d.ts.map +1 -1
- package/dist/browser/live-state-core.d.ts +63 -0
- package/dist/browser/live-state-core.d.ts.map +1 -0
- package/dist/browser/live-state.d.ts.map +1 -1
- package/dist/browser/realtime-client.d.ts +26 -0
- package/dist/browser/realtime-client.d.ts.map +1 -0
- package/dist/browser/resumable.d.ts +1 -28
- package/dist/browser/resumable.d.ts.map +1 -1
- package/dist/browser/retained.d.ts.map +1 -0
- package/dist/browser/socket-io-connection.d.ts +82 -0
- package/dist/browser/socket-io-connection.d.ts.map +1 -0
- package/dist/browser/socket-io-peer.d.ts +20 -0
- package/dist/browser/socket-io-peer.d.ts.map +1 -0
- package/dist/browser/socket-io-trace.d.ts +31 -0
- package/dist/browser/socket-io-trace.d.ts.map +1 -0
- package/dist/browser/socket-io.d.ts +24 -18
- package/dist/browser/socket-io.d.ts.map +1 -1
- package/dist/browser/stream.d.ts +14 -2
- package/dist/browser/stream.d.ts.map +1 -1
- package/dist/contract/client-types.d.ts +134 -0
- package/dist/contract/client-types.d.ts.map +1 -0
- package/dist/contract/define-validation.d.ts +30 -0
- package/dist/contract/define-validation.d.ts.map +1 -0
- package/dist/contract/define.d.ts +47 -394
- package/dist/contract/define.d.ts.map +1 -1
- package/dist/contract/normalize.d.ts +56 -0
- package/dist/contract/normalize.d.ts.map +1 -0
- package/dist/contract/runtime-context.d.ts +131 -0
- package/dist/contract/runtime-context.d.ts.map +1 -0
- package/dist/contract/tool-options.d.ts +105 -0
- package/dist/contract/tool-options.d.ts.map +1 -0
- package/dist/contract/tool-view.d.ts +148 -0
- package/dist/contract/tool-view.d.ts.map +1 -0
- package/dist/declaration/declaration.d.ts.map +1 -0
- package/dist/durability/contract.d.ts +259 -0
- package/dist/durability/contract.d.ts.map +1 -0
- package/dist/durability/effect.d.ts +24 -0
- package/dist/durability/effect.d.ts.map +1 -0
- package/dist/durability/engine.d.ts +14 -0
- package/dist/durability/engine.d.ts.map +1 -0
- package/dist/durability/events.d.ts +103 -0
- package/dist/durability/events.d.ts.map +1 -0
- package/dist/durability/json.d.ts +3 -0
- package/dist/durability/json.d.ts.map +1 -0
- package/dist/durability/ledger.d.ts +27 -0
- package/dist/durability/ledger.d.ts.map +1 -0
- package/dist/durability/parks.d.ts +22 -0
- package/dist/durability/parks.d.ts.map +1 -0
- package/dist/durability/scheduler.d.ts +30 -0
- package/dist/durability/scheduler.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime/browser.d.ts +5 -0
- package/dist/entrypoints/agent-runtime/browser.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime/browser.js +124 -0
- package/dist/entrypoints/agent-runtime/coding-tools.d.ts +2 -0
- package/dist/entrypoints/agent-runtime/coding-tools.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime/coding-tools.js +22 -0
- package/dist/entrypoints/agent-runtime/harness.d.ts +2 -0
- package/dist/entrypoints/agent-runtime/harness.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime/harness.js +739 -0
- package/dist/entrypoints/agent-runtime/openrouter.d.ts +2 -0
- package/dist/entrypoints/agent-runtime/openrouter.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime/openrouter.js +270 -0
- package/dist/entrypoints/agent-runtime/sandbox.d.ts +5 -0
- package/dist/entrypoints/agent-runtime/sandbox.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime/sandbox.js +797 -0
- package/dist/entrypoints/agent-runtime/sqlite/bun.d.ts +2 -0
- package/dist/entrypoints/agent-runtime/sqlite/bun.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime/sqlite/bun.js +44 -0
- package/dist/entrypoints/agent-runtime/sqlite/node.d.ts +2 -0
- package/dist/entrypoints/agent-runtime/sqlite/node.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime/sqlite/node.js +46 -0
- package/dist/entrypoints/agent-runtime/testing.d.ts +4 -0
- package/dist/entrypoints/agent-runtime/testing.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime/testing.js +1116 -0
- package/dist/entrypoints/agent-runtime.d.ts +42 -0
- package/dist/entrypoints/agent-runtime.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime.js +2670 -0
- package/dist/entrypoints/application/diagnostic-journal.d.ts +21 -0
- package/dist/entrypoints/application/diagnostic-journal.d.ts.map +1 -0
- package/dist/entrypoints/application/diagnostic-journal.js +492 -0
- package/dist/entrypoints/application/grammy.d.ts +2 -0
- package/dist/entrypoints/application/grammy.d.ts.map +1 -0
- package/dist/entrypoints/application/grammy.js +169 -0
- package/dist/entrypoints/application/opentelemetry.d.ts +2 -0
- package/dist/entrypoints/application/opentelemetry.d.ts.map +1 -0
- package/dist/entrypoints/application/opentelemetry.js +250 -0
- package/dist/entrypoints/application/schemas.d.ts +15 -0
- package/dist/entrypoints/application/schemas.d.ts.map +1 -0
- package/dist/entrypoints/application/schemas.js +27 -0
- package/dist/entrypoints/application.d.ts +23 -0
- package/dist/entrypoints/application.d.ts.map +1 -0
- package/dist/entrypoints/application.js +2016 -0
- package/dist/entrypoints/bin/upgrade-cli.d.ts.map +1 -0
- package/dist/entrypoints/bin/upgrade-cli.js +177 -0
- package/dist/entrypoints/cli.d.ts +44 -0
- package/dist/entrypoints/cli.d.ts.map +1 -0
- package/dist/entrypoints/cli.js +773 -0
- package/dist/entrypoints/contract.d.ts +12 -0
- package/dist/entrypoints/contract.d.ts.map +1 -0
- package/dist/entrypoints/contract.js +64 -0
- package/dist/entrypoints/declaration.d.ts +2 -0
- package/dist/entrypoints/declaration.d.ts.map +1 -0
- package/dist/entrypoints/declaration.js +183 -0
- package/dist/entrypoints/files.d.ts +5 -0
- package/dist/entrypoints/files.d.ts.map +1 -0
- package/dist/entrypoints/files.js +111 -0
- package/dist/entrypoints/geo.d.ts +3 -0
- package/dist/entrypoints/geo.d.ts.map +1 -0
- package/dist/entrypoints/geo.js +245 -0
- package/dist/entrypoints/google.d.ts +2 -0
- package/dist/entrypoints/google.d.ts.map +1 -0
- package/dist/entrypoints/google.js +175 -0
- package/dist/entrypoints/index.d.ts +17 -0
- package/dist/entrypoints/index.d.ts.map +1 -0
- package/dist/entrypoints/index.js +764 -0
- package/dist/entrypoints/live.d.ts +19 -0
- package/dist/entrypoints/live.d.ts.map +1 -0
- package/dist/entrypoints/live.js +302 -0
- package/dist/entrypoints/node.d.ts +19 -0
- package/dist/entrypoints/node.d.ts.map +1 -0
- package/dist/entrypoints/node.js +308 -0
- package/dist/entrypoints/oauth.d.ts +2 -0
- package/dist/entrypoints/oauth.d.ts.map +1 -0
- package/dist/entrypoints/oauth.js +170 -0
- package/dist/entrypoints/observability.d.ts +19 -0
- package/dist/entrypoints/observability.d.ts.map +1 -0
- package/dist/entrypoints/observability.js +567 -0
- package/dist/entrypoints/primitives.d.ts +3 -0
- package/dist/entrypoints/primitives.d.ts.map +1 -0
- package/dist/entrypoints/primitives.js +749 -0
- package/dist/entrypoints/react.d.ts +5 -0
- package/dist/entrypoints/react.d.ts.map +1 -0
- package/dist/entrypoints/react.js +403 -0
- package/dist/entrypoints/release.d.ts +15 -0
- package/dist/entrypoints/release.d.ts.map +1 -0
- package/dist/entrypoints/release.js +196 -0
- package/dist/entrypoints/remote.d.ts +9 -0
- package/dist/entrypoints/remote.d.ts.map +1 -0
- package/dist/entrypoints/remote.js +66 -0
- package/dist/entrypoints/server.d.ts +39 -0
- package/dist/entrypoints/server.d.ts.map +1 -0
- package/dist/entrypoints/server.js +2009 -0
- package/dist/entrypoints/telegram.d.ts +3 -0
- package/dist/entrypoints/telegram.d.ts.map +1 -0
- package/dist/entrypoints/telegram.js +224 -0
- package/dist/entrypoints/testing.d.ts +10 -0
- package/dist/entrypoints/testing.d.ts.map +1 -0
- package/dist/entrypoints/testing.js +1377 -0
- package/dist/entrypoints/tools/connections.d.ts +19 -0
- package/dist/entrypoints/tools/connections.d.ts.map +1 -0
- package/dist/entrypoints/tools/connections.js +1110 -0
- package/dist/entrypoints/tools/contract.d.ts +29 -0
- package/dist/entrypoints/tools/contract.d.ts.map +1 -0
- package/dist/entrypoints/tools/contract.js +24 -0
- package/dist/entrypoints/tools/invoker.d.ts +9 -0
- package/dist/entrypoints/tools/invoker.d.ts.map +1 -0
- package/dist/entrypoints/tools/invoker.js +20 -0
- package/dist/entrypoints/tools.d.ts +54 -0
- package/dist/entrypoints/tools.d.ts.map +1 -0
- package/dist/entrypoints/tools.js +3009 -0
- package/dist/entrypoints/tracking/server.d.ts +15 -0
- package/dist/entrypoints/tracking/server.d.ts.map +1 -0
- package/dist/entrypoints/tracking.d.ts +24 -0
- package/dist/entrypoints/tracking.d.ts.map +1 -0
- package/dist/entrypoints/tracking.js +1140 -0
- package/dist/files/boundary.d.ts.map +1 -1
- package/dist/files/file-io.d.ts +14 -0
- package/dist/files/file-io.d.ts.map +1 -0
- package/dist/google/google.d.ts.map +1 -0
- package/dist/index-0b1ess5e.js +38 -0
- package/dist/index-1j8pm5t0.js +412 -0
- package/dist/index-1zbbzgfh.js +89 -0
- package/dist/index-2bxbyab0.js +47 -0
- package/dist/index-2gxzjvyr.js +266 -0
- package/dist/index-35mh5bhj.js +177 -0
- package/dist/index-48ffdxgk.js +6 -0
- package/dist/index-4gcnakhx.js +82 -0
- package/dist/index-55hkhm67.js +343 -0
- package/dist/index-79z7m7dt.js +675 -0
- package/dist/index-7f68ghdn.js +3618 -0
- package/dist/index-7p1f0vp2.js +154 -0
- package/dist/index-83bdg97s.js +16 -0
- package/dist/index-863ea9jb.js +154 -0
- package/dist/index-8p52kd5p.js +242 -0
- package/dist/index-d9pk3td4.js +326 -0
- package/dist/index-dce5wxcq.js +63 -0
- package/dist/index-e01r054k.js +105 -0
- package/dist/index-ensd0r74.js +595 -0
- package/dist/index-eqqvgdb3.js +46 -0
- package/dist/index-gxrt5h6v.js +341 -0
- package/dist/index-h6eeys1v.js +211 -0
- package/dist/index-ham5sz8m.js +734 -0
- package/dist/index-het2he5g.js +1387 -0
- package/dist/index-hffjpmq9.js +30 -0
- package/dist/index-hmp4800j.js +51 -0
- package/dist/index-k30h66yd.js +317 -0
- package/dist/index-k5hsfc3j.js +31 -0
- package/dist/index-khtgb21r.js +92 -0
- package/dist/index-m9zn6cpq.js +51 -0
- package/dist/index-ndddxtyx.js +324 -0
- package/dist/index-ngfhvfpd.js +30 -0
- package/dist/index-np4m8hd3.js +1205 -0
- package/dist/index-p3vsv1fb.js +3493 -0
- package/dist/index-p5r7qpdd.js +85 -0
- package/dist/index-p9e0w8hs.js +1084 -0
- package/dist/index-p9sh0xx4.js +64 -0
- package/dist/index-paz6sgdp.js +371 -0
- package/dist/index-px2gm2jp.js +448 -0
- package/dist/index-qwhynv6x.js +103 -0
- package/dist/index-s812ycat.js +65 -0
- package/dist/index-sp1tzwnb.js +281 -0
- package/dist/index-t9rhjr9f.js +2306 -0
- package/dist/index-v260df89.js +342 -0
- package/dist/index-w906953s.js +946 -0
- package/dist/index-wdkt63w3.js +214 -0
- package/dist/index-wqgjfstn.js +18 -0
- package/dist/index-wsm5w4ee.js +1023 -0
- package/dist/index-xw3s75nj.js +100 -0
- package/dist/index-yw4fzmdz.js +268 -0
- package/dist/index-zfrhfn82.js +85 -0
- package/dist/index-znfs20ss.js +98 -0
- package/dist/internal/atomic-file.d.ts +23 -2
- package/dist/internal/atomic-file.d.ts.map +1 -1
- package/dist/internal/backoff.d.ts +29 -0
- package/dist/internal/backoff.d.ts.map +1 -0
- package/dist/internal/canonical-json.d.ts +21 -11
- package/dist/internal/canonical-json.d.ts.map +1 -1
- package/dist/internal/channel.d.ts.map +1 -0
- package/dist/internal/exclusive-lock.d.ts +51 -0
- package/dist/internal/exclusive-lock.d.ts.map +1 -0
- package/dist/internal/logger.d.ts.map +1 -0
- package/dist/internal/process-identity.d.ts +47 -0
- package/dist/internal/process-identity.d.ts.map +1 -0
- package/dist/internal/request.d.ts.map +1 -0
- package/dist/internal/stable-digest.d.ts +0 -43
- package/dist/internal/stable-digest.d.ts.map +1 -1
- package/dist/internal/typed.d.ts +0 -8
- package/dist/internal/typed.d.ts.map +1 -1
- package/dist/internal/with-exclusive-lock.d.ts +67 -0
- package/dist/internal/with-exclusive-lock.d.ts.map +1 -0
- package/dist/internal/zod-issues.d.ts +38 -0
- package/dist/internal/zod-issues.d.ts.map +1 -0
- package/dist/json-schema/dialect.d.ts +17 -0
- package/dist/json-schema/dialect.d.ts.map +1 -0
- package/dist/json-schema/json-schema.d.ts.map +1 -0
- package/dist/live/watch-client.d.ts.map +1 -1
- package/dist/live/watch-delta.d.ts.map +1 -1
- package/dist/oauth/authorization-code.d.ts +57 -0
- package/dist/oauth/authorization-code.d.ts.map +1 -0
- package/dist/observability/audit.d.ts +3 -3
- package/dist/observability/audit.d.ts.map +1 -1
- package/dist/observability/bounded-logger.d.ts +1 -1
- package/dist/observability/bounded-logger.d.ts.map +1 -1
- package/dist/observability/bounded-sink.d.ts +81 -0
- package/dist/observability/bounded-sink.d.ts.map +1 -0
- package/dist/observability/context.d.ts +1 -1
- package/dist/observability/context.d.ts.map +1 -1
- package/dist/observability/event.d.ts +2 -1
- package/dist/observability/event.d.ts.map +1 -1
- package/dist/observability/work.d.ts +1 -1
- package/dist/observability/work.d.ts.map +1 -1
- package/dist/primitives/audit.d.ts +1 -1
- package/dist/primitives/audit.d.ts.map +1 -1
- package/dist/primitives/export-operation.d.ts +4 -2
- package/dist/primitives/export-operation.d.ts.map +1 -1
- package/dist/realtime/registry.d.ts +0 -5
- package/dist/realtime/registry.d.ts.map +1 -1
- package/dist/realtime/socket.d.ts +1 -1
- package/dist/realtime/socket.d.ts.map +1 -1
- package/dist/server/bun.d.ts +0 -1
- package/dist/server/bun.d.ts.map +1 -1
- package/dist/server/context-contribution.d.ts +1 -1
- package/dist/server/context-contribution.d.ts.map +1 -1
- package/dist/server/context.d.ts +2 -2
- package/dist/server/context.d.ts.map +1 -1
- package/dist/server/contract-method.d.ts +15 -0
- package/dist/server/contract-method.d.ts.map +1 -0
- package/dist/server/contract-stream.d.ts +1 -1
- package/dist/server/contract-stream.d.ts.map +1 -1
- package/dist/server/create.d.ts +8 -0
- package/dist/server/create.d.ts.map +1 -1
- package/dist/server/endpoint-dispatch.d.ts +10 -0
- package/dist/server/endpoint-dispatch.d.ts.map +1 -0
- package/dist/server/endpoint-response.d.ts +19 -0
- package/dist/server/endpoint-response.d.ts.map +1 -0
- package/dist/server/error-dispatch.d.ts +17 -1
- package/dist/server/error-dispatch.d.ts.map +1 -1
- package/dist/server/error-hook.d.ts +2 -2
- package/dist/server/error-hook.d.ts.map +1 -1
- package/dist/server/handler-state.d.ts +44 -0
- package/dist/server/handler-state.d.ts.map +1 -0
- package/dist/server/implement-registry.d.ts +54 -0
- package/dist/server/implement-registry.d.ts.map +1 -0
- package/dist/server/implement.d.ts +9 -55
- package/dist/server/implement.d.ts.map +1 -1
- package/dist/server/middleware/auth.d.ts +1 -31
- package/dist/server/middleware/auth.d.ts.map +1 -1
- package/dist/server/middleware/cors.d.ts +17 -0
- package/dist/server/middleware/cors.d.ts.map +1 -1
- package/dist/server/middleware/jwt.d.ts +31 -0
- package/dist/server/middleware/jwt.d.ts.map +1 -0
- package/dist/server/middleware/trust-fence.d.ts +1 -1
- package/dist/server/middleware/trust-fence.d.ts.map +1 -1
- package/dist/server/multipart-reader.d.ts +22 -0
- package/dist/server/multipart-reader.d.ts.map +1 -0
- package/dist/server/multipart.d.ts +1 -1
- package/dist/server/multipart.d.ts.map +1 -1
- package/dist/server/oauth/cimd.d.ts +88 -0
- package/dist/server/oauth/cimd.d.ts.map +1 -0
- package/dist/server/oauth/endpoints.d.ts +39 -0
- package/dist/server/oauth/endpoints.d.ts.map +1 -0
- package/dist/server/oauth/metadata.d.ts +28 -0
- package/dist/server/oauth/metadata.d.ts.map +1 -0
- package/dist/server/oauth/provider.d.ts +117 -0
- package/dist/server/oauth/provider.d.ts.map +1 -0
- package/dist/server/realtime.d.ts +1 -1
- package/dist/server/realtime.d.ts.map +1 -1
- package/dist/server/request-completion.d.ts +16 -0
- package/dist/server/request-completion.d.ts.map +1 -0
- package/dist/server/response-metadata.d.ts +1 -1
- package/dist/server/response-metadata.d.ts.map +1 -1
- package/dist/server/route-table.d.ts +9 -0
- package/dist/server/route-table.d.ts.map +1 -0
- package/dist/server/stream.d.ts +0 -13
- package/dist/server/stream.d.ts.map +1 -1
- package/dist/server/streaming-pump.d.ts +66 -0
- package/dist/server/streaming-pump.d.ts.map +1 -0
- package/dist/server/streaming-route.d.ts +12 -5
- package/dist/server/streaming-route.d.ts.map +1 -1
- package/dist/server/types.d.ts +10 -4
- package/dist/server/types.d.ts.map +1 -1
- package/dist/server/unix-client-bun.d.ts.map +1 -1
- package/dist/server/unix-client-http1.d.ts +76 -0
- package/dist/server/unix-client-http1.d.ts.map +1 -0
- package/dist/server/unix-client.d.ts.map +1 -1
- package/dist/testing/handler-clients.d.ts +32 -0
- package/dist/testing/handler-clients.d.ts.map +1 -0
- package/dist/testing/managed-resource-conformance-scenarios.d.ts.map +1 -1
- package/dist/testing/realtime-probe.d.ts +33 -0
- package/dist/testing/realtime-probe.d.ts.map +1 -0
- package/dist/testing/surface-conformance.d.ts +2 -32
- package/dist/testing/surface-conformance.d.ts.map +1 -1
- package/dist/testing/surface-manifest-digest.d.ts +44 -0
- package/dist/testing/surface-manifest-digest.d.ts.map +1 -0
- package/dist/testing/surface-manifest.d.ts +30 -4
- package/dist/testing/surface-manifest.d.ts.map +1 -1
- package/dist/tools/agent.d.ts +1 -1
- package/dist/tools/agent.d.ts.map +1 -1
- package/dist/tools/cli/args-fields.d.ts +31 -0
- package/dist/tools/cli/args-fields.d.ts.map +1 -0
- package/dist/tools/cli/args-route.d.ts +42 -0
- package/dist/tools/cli/args-route.d.ts.map +1 -0
- package/dist/tools/cli/args-view.d.ts +32 -0
- package/dist/tools/cli/args-view.d.ts.map +1 -0
- package/dist/tools/cli/args.d.ts +80 -0
- package/dist/tools/cli/args.d.ts.map +1 -0
- package/dist/tools/cli/argument-error.d.ts +5 -0
- package/dist/tools/cli/argument-error.d.ts.map +1 -0
- package/dist/tools/cli/checkpoint.d.ts +24 -0
- package/dist/tools/cli/checkpoint.d.ts.map +1 -0
- package/dist/tools/cli/command.d.ts +70 -0
- package/dist/tools/cli/command.d.ts.map +1 -0
- package/dist/tools/cli/config.d.ts +90 -0
- package/dist/tools/cli/config.d.ts.map +1 -0
- package/dist/tools/cli/create-cli.d.ts +36 -0
- package/dist/tools/cli/create-cli.d.ts.map +1 -0
- package/dist/tools/cli/download.d.ts +8 -0
- package/dist/tools/cli/download.d.ts.map +1 -0
- package/dist/tools/cli/format.d.ts +50 -0
- package/dist/tools/cli/format.d.ts.map +1 -0
- package/dist/tools/cli/help.d.ts +24 -0
- package/dist/tools/cli/help.d.ts.map +1 -0
- package/dist/tools/cli/installer.d.ts +34 -0
- package/dist/tools/cli/installer.d.ts.map +1 -0
- package/dist/tools/cli/invoke.d.ts +144 -0
- package/dist/tools/cli/invoke.d.ts.map +1 -0
- package/dist/tools/cli/io.d.ts +10 -0
- package/dist/tools/cli/io.d.ts.map +1 -0
- package/dist/tools/cli/managed-surface.d.ts +30 -0
- package/dist/tools/cli/managed-surface.d.ts.map +1 -0
- package/dist/tools/cli/manifest.d.ts +80 -0
- package/dist/tools/cli/manifest.d.ts.map +1 -0
- package/dist/tools/cli/policy.d.ts +27 -0
- package/dist/tools/cli/policy.d.ts.map +1 -0
- package/dist/tools/cli/prepare.d.ts +14 -0
- package/dist/tools/cli/prepare.d.ts.map +1 -0
- package/dist/tools/cli/profile.d.ts +40 -0
- package/dist/tools/cli/profile.d.ts.map +1 -0
- package/dist/tools/cli/run-managed.d.ts +5 -0
- package/dist/tools/cli/run-managed.d.ts.map +1 -0
- package/dist/tools/cli/run-native.d.ts +9 -0
- package/dist/tools/cli/run-native.d.ts.map +1 -0
- package/dist/tools/cli/session.d.ts +40 -0
- package/dist/tools/cli/session.d.ts.map +1 -0
- package/dist/tools/cli/signature.d.ts +81 -0
- package/dist/tools/cli/signature.d.ts.map +1 -0
- package/dist/tools/cli/stream.d.ts +93 -0
- package/dist/tools/cli/stream.d.ts.map +1 -0
- package/dist/tools/cli/update.d.ts +145 -0
- package/dist/tools/cli/update.d.ts.map +1 -0
- package/dist/tools/cli/view.d.ts +12 -0
- package/dist/tools/cli/view.d.ts.map +1 -0
- package/dist/tools/cli/wait.d.ts +54 -0
- package/dist/tools/cli/wait.d.ts.map +1 -0
- package/dist/tools/connections/runtime.d.ts +1 -1
- package/dist/tools/connections/runtime.d.ts.map +1 -1
- package/dist/tools/connections/types.d.ts +3 -3
- package/dist/tools/connections/types.d.ts.map +1 -1
- package/dist/tools/durability-context.d.ts +1 -1
- package/dist/tools/durability-context.d.ts.map +1 -1
- package/dist/tools/execute-args.d.ts +23 -0
- package/dist/tools/execute-args.d.ts.map +1 -0
- package/dist/tools/execute-hooks.d.ts +146 -0
- package/dist/tools/execute-hooks.d.ts.map +1 -0
- package/dist/tools/execute-result.d.ts +40 -0
- package/dist/tools/execute-result.d.ts.map +1 -0
- package/dist/tools/execute.d.ts +31 -193
- package/dist/tools/execute.d.ts.map +1 -1
- package/dist/tools/internal/surface-projector.d.ts +9 -6
- package/dist/tools/internal/surface-projector.d.ts.map +1 -1
- package/dist/tools/internal/tool-view.d.ts +41 -0
- package/dist/tools/internal/tool-view.d.ts.map +1 -0
- package/dist/tools/invoker.d.ts +13 -4
- package/dist/tools/invoker.d.ts.map +1 -1
- package/dist/tools/lifecycle.d.ts +1 -1
- package/dist/tools/lifecycle.d.ts.map +1 -1
- package/dist/tools/list-names.d.ts +3 -3
- package/dist/tools/list-names.d.ts.map +1 -1
- package/dist/tools/manifest.d.ts +2 -2
- package/dist/tools/manifest.d.ts.map +1 -1
- package/dist/tools/mcp/app.d.ts +62 -0
- package/dist/tools/mcp/app.d.ts.map +1 -0
- package/dist/tools/mcp/catalog.d.ts +68 -0
- package/dist/tools/mcp/catalog.d.ts.map +1 -0
- package/dist/tools/mcp/handler.d.ts +46 -0
- package/dist/tools/mcp/handler.d.ts.map +1 -0
- package/dist/tools/mcp/mount.d.ts +152 -0
- package/dist/tools/mcp/mount.d.ts.map +1 -0
- package/dist/tools/mcp/prepare.d.ts +76 -0
- package/dist/tools/mcp/prepare.d.ts.map +1 -0
- package/dist/tools/mcp/progress.d.ts +46 -0
- package/dist/tools/mcp/progress.d.ts.map +1 -0
- package/dist/tools/mcp/register.d.ts +36 -0
- package/dist/tools/mcp/register.d.ts.map +1 -0
- package/dist/tools/mcp/round-context.d.ts +38 -0
- package/dist/tools/mcp/round-context.d.ts.map +1 -0
- package/dist/tools/mcp/round-policy.d.ts +33 -0
- package/dist/tools/mcp/round-policy.d.ts.map +1 -0
- package/dist/tools/mcp/round.d.ts +53 -0
- package/dist/tools/mcp/round.d.ts.map +1 -0
- package/dist/tools/mcp/runtime-tools.d.ts +25 -0
- package/dist/tools/mcp/runtime-tools.d.ts.map +1 -0
- package/dist/tools/mcp/stdio-signals.d.ts +33 -0
- package/dist/tools/mcp/stdio-signals.d.ts.map +1 -0
- package/dist/tools/mcp/stdio.d.ts +20 -0
- package/dist/tools/mcp/stdio.d.ts.map +1 -0
- package/dist/tools/mcp/trace.d.ts +12 -0
- package/dist/tools/mcp/trace.d.ts.map +1 -0
- package/dist/tools/mount.d.ts +14 -7
- package/dist/tools/mount.d.ts.map +1 -1
- package/dist/tools/native-definition.d.ts +4 -3
- package/dist/tools/native-definition.d.ts.map +1 -1
- package/dist/tools/operations/async-operation-binding-types.d.ts +127 -0
- package/dist/tools/operations/async-operation-binding-types.d.ts.map +1 -0
- package/dist/tools/operations/async-operation-binding.d.ts +28 -0
- package/dist/tools/operations/async-operation-binding.d.ts.map +1 -0
- package/dist/tools/operations/async-operation-canonical-types.d.ts +110 -0
- package/dist/tools/operations/async-operation-canonical-types.d.ts.map +1 -0
- package/dist/tools/operations/async-operation-canonical.d.ts +7 -0
- package/dist/tools/operations/async-operation-canonical.d.ts.map +1 -0
- package/dist/tools/operations/async-operation-contract.d.ts.map +1 -0
- package/dist/tools/operations/async-operation-id.d.ts +23 -0
- package/dist/tools/operations/async-operation-id.d.ts.map +1 -0
- package/dist/tools/operations/async-operation-runtime-tools.d.ts +41 -0
- package/dist/tools/operations/async-operation-runtime-tools.d.ts.map +1 -0
- package/dist/tools/operations/async-operation-runtime-types.d.ts +69 -0
- package/dist/tools/operations/async-operation-runtime-types.d.ts.map +1 -0
- package/dist/tools/operations/async-operation-runtime.d.ts +5 -0
- package/dist/tools/operations/async-operation-runtime.d.ts.map +1 -0
- package/dist/tools/operations/define-wait-tool.d.ts +22 -0
- package/dist/tools/operations/define-wait-tool.d.ts.map +1 -0
- package/dist/tools/operations/mount-wait.d.ts.map +1 -0
- package/dist/tools/operations/wait-core.d.ts.map +1 -0
- package/dist/tools/remote.d.ts +1 -1
- package/dist/tools/remote.d.ts.map +1 -1
- package/dist/tools/runtime-tool.d.ts +13 -4
- package/dist/tools/runtime-tool.d.ts.map +1 -1
- package/dist/tools/schema/coerce.d.ts.map +1 -0
- package/dist/tools/schema/flatten-join.d.ts.map +1 -0
- package/dist/tools/schema/flatten.d.ts.map +1 -0
- package/dist/tools/schema/portable-formats.d.ts.map +1 -0
- package/dist/tools/schema/presentation.d.ts +24 -0
- package/dist/tools/schema/presentation.d.ts.map +1 -0
- package/dist/tools/schema/schema.d.ts.map +1 -0
- package/dist/tools/schema/untyped-properties.d.ts.map +1 -0
- package/dist/tools/surface.d.ts +2 -3
- package/dist/tools/surface.d.ts.map +1 -1
- package/dist/tools/tool-logger.d.ts +1 -1
- package/dist/tools/tool-logger.d.ts.map +1 -1
- package/dist/tools/toolkit.d.ts +4 -4
- package/dist/tools/toolkit.d.ts.map +1 -1
- package/dist/tools/transfer/define-download-tool.d.ts +18 -0
- package/dist/tools/transfer/define-download-tool.d.ts.map +1 -0
- package/dist/tools/transfer/define-upload-tool.d.ts +16 -0
- package/dist/tools/transfer/define-upload-tool.d.ts.map +1 -0
- package/dist/tools/transfer/define-view-file-tool.d.ts +10 -0
- package/dist/tools/transfer/define-view-file-tool.d.ts.map +1 -0
- package/dist/tools/transfer/download-core.d.ts +20 -0
- package/dist/tools/transfer/download-core.d.ts.map +1 -0
- package/dist/tools/transfer/managed-file-error.d.ts +6 -0
- package/dist/tools/transfer/managed-file-error.d.ts.map +1 -0
- package/dist/tools/transfer/mount-download.d.ts +41 -0
- package/dist/tools/transfer/mount-download.d.ts.map +1 -0
- package/dist/tools/transfer/mount-upload.d.ts +21 -0
- package/dist/tools/transfer/mount-upload.d.ts.map +1 -0
- package/dist/tools/transfer/native-result.d.ts.map +1 -0
- package/dist/tools/transfer/upload-core.d.ts +4 -0
- package/dist/tools/transfer/upload-core.d.ts.map +1 -0
- package/dist/tools/transfer/view-file-contract.d.ts.map +1 -0
- package/dist/tools/transfer/view-file.d.ts +62 -0
- package/dist/tools/transfer/view-file.d.ts.map +1 -0
- package/dist/tools/transports.d.ts +1 -1
- package/dist/tools/transports.d.ts.map +1 -1
- package/dist/tracking/client-listeners.d.ts +30 -0
- package/dist/tracking/client-listeners.d.ts.map +1 -0
- package/dist/tracking/client-visit.d.ts +61 -0
- package/dist/tracking/client-visit.d.ts.map +1 -0
- package/dist/tracking/client.d.ts +3 -2
- package/dist/tracking/client.d.ts.map +1 -1
- package/dist/tracking/contract.d.ts +1 -1
- package/dist/tracking/contract.d.ts.map +1 -1
- package/llms/agent-runtime-browser.txt +33 -0
- package/llms/agent-runtime-coding-tools.txt +58 -0
- package/llms/agent-runtime-harness.txt +45 -0
- package/llms/agent-runtime-openrouter.txt +22 -0
- package/llms/agent-runtime-sandbox.txt +159 -0
- package/llms/agent-runtime-sqlite-bun.txt +29 -0
- package/llms/agent-runtime-sqlite-node.txt +26 -0
- package/llms/agent-runtime-testing.txt +30 -0
- package/llms/agent-runtime.2.txt +550 -0
- package/llms/agent-runtime.3.txt +311 -0
- package/llms/agent-runtime.txt +893 -0
- package/llms/application-diagnostic-journal.txt +30 -0
- package/llms/application-grammy.txt +27 -0
- package/llms/application-opentelemetry.txt +27 -0
- package/llms/application-schemas.txt +42 -0
- package/llms/application.2.txt +487 -0
- package/llms/application.txt +886 -0
- package/llms/cli.2.txt +80 -0
- package/llms/cli.txt +948 -0
- package/llms/contract.txt +606 -0
- package/llms/declaration.txt +286 -0
- package/llms/files.txt +33 -0
- package/llms/geo.txt +114 -0
- package/llms/google.txt +27 -0
- package/llms/live.txt +471 -0
- package/llms/node.txt +43 -0
- package/llms/oauth.txt +136 -0
- package/llms/observability.txt +893 -0
- package/llms/primitives.txt +158 -0
- package/llms/react.txt +184 -0
- package/llms/release.txt +176 -0
- package/llms/remote.txt +25 -0
- package/llms/server.2.txt +361 -0
- package/llms/server.3.txt +1031 -0
- package/llms/server.4.txt +905 -0
- package/llms/server.5.txt +250 -0
- package/llms/server.txt +996 -0
- package/llms/stitchkit.2.txt +836 -0
- package/llms/stitchkit.3.txt +147 -0
- package/llms/stitchkit.txt +260 -0
- package/llms/telegram.txt +30 -0
- package/llms/testing.txt +676 -0
- package/llms/tools-connections.txt +45 -0
- package/llms/tools-contract.txt +9 -0
- package/llms/tools-invoker.txt +9 -0
- package/llms/tools.2.txt +647 -0
- package/llms/tools.3.txt +288 -0
- package/llms/tools.txt +966 -0
- package/llms/tracking-server.txt +32 -0
- package/llms/tracking.txt +263 -0
- package/llms/upgrading-0.37.0-0.50.0.txt +947 -0
- package/llms/upgrading-0.53.0-0.67.0.txt +1174 -0
- package/llms/upgrading-0.68.0-0.94.0.txt +1159 -0
- package/llms/upgrading.txt +215 -0
- package/llms-full.txt +312 -77
- package/llms.txt +54 -5
- package/package.json +84 -83
- package/dist/agent-runtime/durability-contract.d.ts +0 -176
- package/dist/agent-runtime/durability-contract.d.ts.map +0 -1
- package/dist/agent-runtime/durability-json.d.ts +0 -3
- package/dist/agent-runtime/durability-json.d.ts.map +0 -1
- package/dist/agent-runtime/durability-ledger.d.ts +0 -16
- package/dist/agent-runtime/durability-ledger.d.ts.map +0 -1
- package/dist/agent-runtime/durability-scheduler.d.ts +0 -29
- package/dist/agent-runtime/durability-scheduler.d.ts.map +0 -1
- package/dist/agent-runtime/durability.d.ts +0 -14
- package/dist/agent-runtime/durability.d.ts.map +0 -1
- package/dist/agent-runtime/store-driver.d.ts +0 -814
- package/dist/agent-runtime/store-driver.d.ts.map +0 -1
- package/dist/agent-runtime-browser.d.ts +0 -5
- package/dist/agent-runtime-browser.d.ts.map +0 -1
- package/dist/agent-runtime-browser.js +0 -124
- package/dist/agent-runtime-coding-tools.d.ts +0 -2
- package/dist/agent-runtime-coding-tools.d.ts.map +0 -1
- package/dist/agent-runtime-coding-tools.js +0 -23
- package/dist/agent-runtime-harness.d.ts +0 -2
- package/dist/agent-runtime-harness.d.ts.map +0 -1
- package/dist/agent-runtime-harness.js +0 -729
- package/dist/agent-runtime-openrouter.d.ts +0 -29
- package/dist/agent-runtime-openrouter.d.ts.map +0 -1
- package/dist/agent-runtime-openrouter.js +0 -270
- package/dist/agent-runtime-sandbox.d.ts +0 -5
- package/dist/agent-runtime-sandbox.d.ts.map +0 -1
- package/dist/agent-runtime-sandbox.js +0 -798
- package/dist/agent-runtime-sqlite-bun.d.ts +0 -11
- package/dist/agent-runtime-sqlite-bun.d.ts.map +0 -1
- package/dist/agent-runtime-sqlite-bun.js +0 -42
- package/dist/agent-runtime-sqlite-node.d.ts +0 -11
- package/dist/agent-runtime-sqlite-node.d.ts.map +0 -1
- package/dist/agent-runtime-sqlite-node.js +0 -44
- package/dist/agent-runtime-testing.d.ts +0 -3
- package/dist/agent-runtime-testing.d.ts.map +0 -1
- package/dist/agent-runtime-testing.js +0 -156
- package/dist/agent-runtime.d.ts +0 -38
- package/dist/agent-runtime.d.ts.map +0 -1
- package/dist/agent-runtime.js +0 -2607
- package/dist/application/channel.d.ts.map +0 -1
- package/dist/application-diagnostic-journal.d.ts +0 -21
- package/dist/application-diagnostic-journal.d.ts.map +0 -1
- package/dist/application-diagnostic-journal.js +0 -632
- package/dist/application-grammy.d.ts +0 -2
- package/dist/application-grammy.d.ts.map +0 -1
- package/dist/application-grammy.js +0 -169
- package/dist/application-opentelemetry.d.ts +0 -2
- package/dist/application-opentelemetry.d.ts.map +0 -1
- package/dist/application-opentelemetry.js +0 -250
- package/dist/application-schemas.d.ts +0 -15
- package/dist/application-schemas.d.ts.map +0 -1
- package/dist/application-schemas.js +0 -27
- package/dist/application.d.ts +0 -22
- package/dist/application.d.ts.map +0 -1
- package/dist/application.js +0 -1977
- package/dist/cli.d.ts +0 -41
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js +0 -753
- package/dist/contract/index.d.ts +0 -8
- package/dist/contract/index.d.ts.map +0 -1
- package/dist/contract/index.js +0 -55
- package/dist/declaration.d.ts.map +0 -1
- package/dist/declaration.js +0 -183
- package/dist/files.d.ts +0 -3
- package/dist/files.d.ts.map +0 -1
- package/dist/files.js +0 -15
- package/dist/geo.d.ts +0 -3
- package/dist/geo.d.ts.map +0 -1
- package/dist/geo.js +0 -245
- package/dist/google.d.ts.map +0 -1
- package/dist/google.js +0 -175
- package/dist/index-0a349c33.js +0 -470
- package/dist/index-0j3vcp5m.js +0 -28
- package/dist/index-2c2bjw3s.js +0 -51
- package/dist/index-2na0qrfn.js +0 -214
- package/dist/index-2qzskm8h.js +0 -63
- package/dist/index-3bmnp41g.js +0 -2169
- package/dist/index-3xwxfj4z.js +0 -334
- package/dist/index-4fpa9dy2.js +0 -51
- package/dist/index-6kyksz9y.js +0 -268
- package/dist/index-77fekveh.js +0 -44
- package/dist/index-7gnkny4z.js +0 -326
- package/dist/index-7zbps32p.js +0 -89
- package/dist/index-9f8ztey6.js +0 -588
- package/dist/index-a11g2kry.js +0 -866
- package/dist/index-a916km3r.js +0 -45
- package/dist/index-actkayzn.js +0 -367
- package/dist/index-bn2cjajt.js +0 -524
- package/dist/index-bx75zwt7.js +0 -63
- package/dist/index-cby4ar3v.js +0 -46
- package/dist/index-cnyk6te3.js +0 -77
- package/dist/index-cxqhvq21.js +0 -413
- package/dist/index-e0znv5gn.js +0 -176
- package/dist/index-e42wzzz5.js +0 -154
- package/dist/index-f477k430.js +0 -324
- package/dist/index-f9mb610r.js +0 -177
- package/dist/index-fadnxwna.js +0 -1046
- package/dist/index-fq77yfzc.js +0 -1303
- package/dist/index-h9etkkyk.js +0 -1126
- package/dist/index-hrbajay7.js +0 -1196
- package/dist/index-kw9t5ayn.js +0 -507
- package/dist/index-mzvgxp0n.js +0 -80
- package/dist/index-n0f51dfn.js +0 -3170
- package/dist/index-p13mwz16.js +0 -16
- package/dist/index-s8cnx02s.js +0 -90
- package/dist/index-sr93cwf9.js +0 -325
- package/dist/index-tmwcrptx.js +0 -85
- package/dist/index-v5573g1k.js +0 -142
- package/dist/index-vjpvjqpn.js +0 -86
- package/dist/index-vk3kq9sb.js +0 -3344
- package/dist/index-wc4x00bn.js +0 -103
- package/dist/index-wnfk50r0.js +0 -211
- package/dist/index-yewwh1w4.js +0 -647
- package/dist/index-yn8remb1.js +0 -290
- package/dist/index-ywd0y6m1.js +0 -394
- package/dist/index-zwkgfq1s.js +0 -345
- package/dist/index.d.ts +0 -14
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -632
- package/dist/internal/errors.d.ts +0 -92
- package/dist/internal/errors.d.ts.map +0 -1
- package/dist/internal/observability-sink.d.ts +0 -81
- package/dist/internal/observability-sink.d.ts.map +0 -1
- package/dist/live.d.ts +0 -19
- package/dist/live.d.ts.map +0 -1
- package/dist/live.js +0 -282
- package/dist/logger.d.ts.map +0 -1
- package/dist/node.d.ts +0 -18
- package/dist/node.d.ts.map +0 -1
- package/dist/node.js +0 -303
- package/dist/oauth.d.ts +0 -57
- package/dist/oauth.d.ts.map +0 -1
- package/dist/oauth.js +0 -170
- package/dist/observability/index.d.ts +0 -19
- package/dist/observability/index.d.ts.map +0 -1
- package/dist/observability/index.js +0 -569
- package/dist/primitives.d.ts +0 -3
- package/dist/primitives.d.ts.map +0 -1
- package/dist/primitives.js +0 -754
- package/dist/react.d.ts +0 -5
- package/dist/react.d.ts.map +0 -1
- package/dist/react.js +0 -403
- package/dist/release.d.ts +0 -15
- package/dist/release.d.ts.map +0 -1
- package/dist/release.js +0 -196
- package/dist/remote.d.ts +0 -9
- package/dist/remote.d.ts.map +0 -1
- package/dist/remote.js +0 -88
- package/dist/retained.d.ts.map +0 -1
- package/dist/server/file-state-store.d.ts +0 -23
- package/dist/server/file-state-store.d.ts.map +0 -1
- package/dist/server/index.d.ts +0 -36
- package/dist/server/index.d.ts.map +0 -1
- package/dist/server/index.js +0 -1745
- package/dist/server/request.d.ts.map +0 -1
- package/dist/telegram.d.ts +0 -3
- package/dist/telegram.d.ts.map +0 -1
- package/dist/telegram.js +0 -224
- package/dist/testing/agent-store-conformance.d.ts +0 -40
- package/dist/testing/agent-store-conformance.d.ts.map +0 -1
- package/dist/testing.d.ts +0 -39
- package/dist/testing.d.ts.map +0 -1
- package/dist/testing.js +0 -2209
- package/dist/tool-invoker.d.ts +0 -9
- package/dist/tool-invoker.d.ts.map +0 -1
- package/dist/tool-invoker.js +0 -21
- package/dist/tools/async-operation-contract.d.ts.map +0 -1
- package/dist/tools/async-operation.d.ts +0 -332
- package/dist/tools/async-operation.d.ts.map +0 -1
- package/dist/tools/cli-args.d.ts +0 -143
- package/dist/tools/cli-args.d.ts.map +0 -1
- package/dist/tools/cli-checkpoint.d.ts +0 -24
- package/dist/tools/cli-checkpoint.d.ts.map +0 -1
- package/dist/tools/cli-command.d.ts +0 -70
- package/dist/tools/cli-command.d.ts.map +0 -1
- package/dist/tools/cli-format.d.ts +0 -49
- package/dist/tools/cli-format.d.ts.map +0 -1
- package/dist/tools/cli-installer.d.ts +0 -34
- package/dist/tools/cli-installer.d.ts.map +0 -1
- package/dist/tools/cli-invoke.d.ts +0 -143
- package/dist/tools/cli-invoke.d.ts.map +0 -1
- package/dist/tools/cli-manifest.d.ts +0 -80
- package/dist/tools/cli-manifest.d.ts.map +0 -1
- package/dist/tools/cli-policy.d.ts +0 -27
- package/dist/tools/cli-policy.d.ts.map +0 -1
- package/dist/tools/cli-profile.d.ts +0 -40
- package/dist/tools/cli-profile.d.ts.map +0 -1
- package/dist/tools/cli-signature.d.ts +0 -81
- package/dist/tools/cli-signature.d.ts.map +0 -1
- package/dist/tools/cli-stream.d.ts +0 -93
- package/dist/tools/cli-stream.d.ts.map +0 -1
- package/dist/tools/cli-update.d.ts +0 -126
- package/dist/tools/cli-update.d.ts.map +0 -1
- package/dist/tools/cli-view.d.ts +0 -12
- package/dist/tools/cli-view.d.ts.map +0 -1
- package/dist/tools/cli-wait.d.ts +0 -54
- package/dist/tools/cli-wait.d.ts.map +0 -1
- package/dist/tools/cli.d.ts +0 -94
- package/dist/tools/cli.d.ts.map +0 -1
- package/dist/tools/coerce.d.ts.map +0 -1
- package/dist/tools/connections/index.d.ts +0 -20
- package/dist/tools/connections/index.d.ts.map +0 -1
- package/dist/tools/connections/index.js +0 -1107
- package/dist/tools/define-download-tool.d.ts +0 -18
- package/dist/tools/define-download-tool.d.ts.map +0 -1
- package/dist/tools/define-upload-tool.d.ts +0 -16
- package/dist/tools/define-upload-tool.d.ts.map +0 -1
- package/dist/tools/define-view-file-tool.d.ts +0 -10
- package/dist/tools/define-view-file-tool.d.ts.map +0 -1
- package/dist/tools/define-wait-tool.d.ts +0 -22
- package/dist/tools/define-wait-tool.d.ts.map +0 -1
- package/dist/tools/download-core.d.ts +0 -20
- package/dist/tools/download-core.d.ts.map +0 -1
- package/dist/tools/flatten-join.d.ts.map +0 -1
- package/dist/tools/flatten.d.ts.map +0 -1
- package/dist/tools/json-schema-dialect.d.ts +0 -17
- package/dist/tools/json-schema-dialect.d.ts.map +0 -1
- package/dist/tools/json-schema.d.ts.map +0 -1
- package/dist/tools/managed-file-error.d.ts +0 -6
- package/dist/tools/managed-file-error.d.ts.map +0 -1
- package/dist/tools/mcp-app.d.ts +0 -62
- package/dist/tools/mcp-app.d.ts.map +0 -1
- package/dist/tools/mcp-catalog.d.ts +0 -68
- package/dist/tools/mcp-catalog.d.ts.map +0 -1
- package/dist/tools/mcp-handler.d.ts +0 -46
- package/dist/tools/mcp-handler.d.ts.map +0 -1
- package/dist/tools/mcp-prepare.d.ts +0 -75
- package/dist/tools/mcp-prepare.d.ts.map +0 -1
- package/dist/tools/mcp-progress.d.ts +0 -46
- package/dist/tools/mcp-progress.d.ts.map +0 -1
- package/dist/tools/mcp-round-policy.d.ts +0 -33
- package/dist/tools/mcp-round-policy.d.ts.map +0 -1
- package/dist/tools/mcp-round.d.ts +0 -61
- package/dist/tools/mcp-round.d.ts.map +0 -1
- package/dist/tools/mcp-stdio-signals.d.ts +0 -33
- package/dist/tools/mcp-stdio-signals.d.ts.map +0 -1
- package/dist/tools/mcp-stdio.d.ts +0 -20
- package/dist/tools/mcp-stdio.d.ts.map +0 -1
- package/dist/tools/mcp-trace.d.ts +0 -12
- package/dist/tools/mcp-trace.d.ts.map +0 -1
- package/dist/tools/mcp.d.ts +0 -152
- package/dist/tools/mcp.d.ts.map +0 -1
- package/dist/tools/mount-download.d.ts +0 -41
- package/dist/tools/mount-download.d.ts.map +0 -1
- package/dist/tools/mount-upload.d.ts +0 -21
- package/dist/tools/mount-upload.d.ts.map +0 -1
- package/dist/tools/mount-wait.d.ts.map +0 -1
- package/dist/tools/native-mcp.d.ts +0 -20
- package/dist/tools/native-mcp.d.ts.map +0 -1
- package/dist/tools/native-result.d.ts.map +0 -1
- package/dist/tools/oauth-metadata.d.ts +0 -28
- package/dist/tools/oauth-metadata.d.ts.map +0 -1
- package/dist/tools/oauth-provider.d.ts +0 -184
- package/dist/tools/oauth-provider.d.ts.map +0 -1
- package/dist/tools/portable-formats.d.ts.map +0 -1
- package/dist/tools/presentation.d.ts +0 -22
- package/dist/tools/presentation.d.ts.map +0 -1
- package/dist/tools/schema.d.ts.map +0 -1
- package/dist/tools/untyped-properties.d.ts.map +0 -1
- package/dist/tools/upload-core.d.ts +0 -4
- package/dist/tools/upload-core.d.ts.map +0 -1
- package/dist/tools/view-file-contract.d.ts.map +0 -1
- package/dist/tools/view-file.d.ts +0 -62
- package/dist/tools/view-file.d.ts.map +0 -1
- package/dist/tools/wait-core.d.ts.map +0 -1
- package/dist/tools-contract.d.ts +0 -29
- package/dist/tools-contract.d.ts.map +0 -1
- package/dist/tools-contract.js +0 -24
- package/dist/tools.d.ts +0 -50
- package/dist/tools.d.ts.map +0 -1
- package/dist/tools.js +0 -2930
- package/dist/tracking-server.d.ts +0 -15
- package/dist/tracking-server.d.ts.map +0 -1
- package/dist/tracking.d.ts +0 -24
- package/dist/tracking.d.ts.map +0 -1
- package/dist/tracking.js +0 -1092
- package/dist/upgrade-cli.d.ts.map +0 -1
- package/dist/upgrade-cli.js +0 -177
- /package/dist/{retained.d.ts → browser/retained.d.ts} +0 -0
- /package/dist/{declaration.d.ts → declaration/declaration.d.ts} +0 -0
- /package/dist/{upgrade-cli.d.ts → entrypoints/bin/upgrade-cli.d.ts} +0 -0
- /package/dist/{tracking-server.js → entrypoints/tracking/server.js} +0 -0
- /package/dist/{google.d.ts → google/google.d.ts} +0 -0
- /package/dist/{index-pq95qkbf.js → index-5jm36zv1.js} +0 -0
- /package/dist/{application → internal}/channel.d.ts +0 -0
- /package/dist/{logger.d.ts → internal/logger.d.ts} +0 -0
- /package/dist/{server → internal}/request.d.ts +0 -0
- /package/dist/{tools → json-schema}/json-schema.d.ts +0 -0
- /package/dist/tools/{async-operation-contract.d.ts → operations/async-operation-contract.d.ts} +0 -0
- /package/dist/tools/{mount-wait.d.ts → operations/mount-wait.d.ts} +0 -0
- /package/dist/tools/{wait-core.d.ts → operations/wait-core.d.ts} +0 -0
- /package/dist/tools/{coerce.d.ts → schema/coerce.d.ts} +0 -0
- /package/dist/tools/{flatten-join.d.ts → schema/flatten-join.d.ts} +0 -0
- /package/dist/tools/{flatten.d.ts → schema/flatten.d.ts} +0 -0
- /package/dist/tools/{portable-formats.d.ts → schema/portable-formats.d.ts} +0 -0
- /package/dist/tools/{schema.d.ts → schema/schema.d.ts} +0 -0
- /package/dist/tools/{untyped-properties.d.ts → schema/untyped-properties.d.ts} +0 -0
- /package/dist/tools/{native-result.d.ts → transfer/native-result.d.ts} +0 -0
- /package/dist/tools/{view-file-contract.d.ts → transfer/view-file-contract.d.ts} +0 -0
package/dist/cli.js
DELETED
|
@@ -1,753 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CliArgumentError,
|
|
3
|
-
DEFAULT_EXIT_CODES,
|
|
4
|
-
PrivateAddressRefusal,
|
|
5
|
-
cliExitCode,
|
|
6
|
-
cliInvocationResult,
|
|
7
|
-
createCli,
|
|
8
|
-
createCliInvoker,
|
|
9
|
-
defineCliCommand,
|
|
10
|
-
emitResult,
|
|
11
|
-
extractCliGlobalOptions,
|
|
12
|
-
fetchGuarded,
|
|
13
|
-
parseCliArgs,
|
|
14
|
-
pollUntilDone,
|
|
15
|
-
readCapped,
|
|
16
|
-
renderCliView,
|
|
17
|
-
routeCliArgv
|
|
18
|
-
} from "./index-3bmnp41g.js";
|
|
19
|
-
import {
|
|
20
|
-
serializeCanonicalJson
|
|
21
|
-
} from "./index-0j3vcp5m.js";
|
|
22
|
-
import"./index-sbdmyz75.js";
|
|
23
|
-
import"./index-2c2bjw3s.js";
|
|
24
|
-
import {
|
|
25
|
-
argumentsDigest
|
|
26
|
-
} from "./index-a916km3r.js";
|
|
27
|
-
import"./index-mzvgxp0n.js";
|
|
28
|
-
import"./index-yn8remb1.js";
|
|
29
|
-
import"./index-tmwcrptx.js";
|
|
30
|
-
import"./index-f9mb610r.js";
|
|
31
|
-
import"./index-e0znv5gn.js";
|
|
32
|
-
import"./index-0a349c33.js";
|
|
33
|
-
import"./index-rxfy4cq7.js";
|
|
34
|
-
import"./index-6k1937bx.js";
|
|
35
|
-
import"./index-zcgf3gqf.js";
|
|
36
|
-
import {
|
|
37
|
-
coerceJsonArgs
|
|
38
|
-
} from "./index-7zbps32p.js";
|
|
39
|
-
import"./index-vjpvjqpn.js";
|
|
40
|
-
import"./index-h9etkkyk.js";
|
|
41
|
-
import"./index-cby4ar3v.js";
|
|
42
|
-
import {
|
|
43
|
-
AppError
|
|
44
|
-
} from "./index-2vtcmrj9.js";
|
|
45
|
-
import {
|
|
46
|
-
safeJsonParse
|
|
47
|
-
} from "./index-kzfs85xp.js";
|
|
48
|
-
import {
|
|
49
|
-
isRecord
|
|
50
|
-
} from "./index-77fekveh.js";
|
|
51
|
-
// src/tools/cli-checkpoint.ts
|
|
52
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
53
|
-
|
|
54
|
-
// src/internal/atomic-file.ts
|
|
55
|
-
import { randomBytes } from "node:crypto";
|
|
56
|
-
import { closeSync, fchmodSync, fsyncSync, openSync, renameSync, writeSync } from "node:fs";
|
|
57
|
-
import { basename, dirname, join } from "node:path";
|
|
58
|
-
function writeFileAtomic(target, bytes, mode) {
|
|
59
|
-
const staged = join(dirname(target), `.${basename(target)}.${randomBytes(12).toString("hex")}.tmp`);
|
|
60
|
-
const handle = openSync(staged, "wx", mode);
|
|
61
|
-
try {
|
|
62
|
-
writeSync(handle, bytes);
|
|
63
|
-
fchmodSync(handle, mode);
|
|
64
|
-
fsyncSync(handle);
|
|
65
|
-
} finally {
|
|
66
|
-
closeSync(handle);
|
|
67
|
-
}
|
|
68
|
-
renameSync(staged, target);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// src/tools/cli-checkpoint.ts
|
|
72
|
-
function emptyCheckpoint(entries) {
|
|
73
|
-
return {
|
|
74
|
-
entries,
|
|
75
|
-
digestOf: (line) => argumentsDigest({ command: line.command, args: line.args }),
|
|
76
|
-
record(id, digest, answer) {
|
|
77
|
-
entries[id] = { digest, answer };
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
function readCliCheckpoint(path) {
|
|
82
|
-
if (!existsSync(path))
|
|
83
|
-
return emptyCheckpoint({});
|
|
84
|
-
try {
|
|
85
|
-
const parsed = safeJsonParse(readFileSync(path, "utf8"));
|
|
86
|
-
const entries = {};
|
|
87
|
-
if (isRecord(parsed) && isRecord(parsed.entries)) {
|
|
88
|
-
for (const [id, value] of Object.entries(parsed.entries)) {
|
|
89
|
-
if (isRecord(value) && typeof value.digest === "string") {
|
|
90
|
-
entries[id] = { digest: value.digest, answer: value.answer };
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
return emptyCheckpoint(entries);
|
|
95
|
-
} catch {
|
|
96
|
-
return emptyCheckpoint({});
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
function writeCliCheckpoint(path, checkpoint) {
|
|
100
|
-
writeFileAtomic(path, Buffer.from(`${JSON.stringify({ entries: checkpoint.entries }, null, 2)}
|
|
101
|
-
`, "utf8"), 384);
|
|
102
|
-
}
|
|
103
|
-
// src/tools/cli-installer.ts
|
|
104
|
-
function shellQuote(value) {
|
|
105
|
-
return `'${value.replaceAll("'", `'"'"'`)}'`;
|
|
106
|
-
}
|
|
107
|
-
function renderCliInstaller(config) {
|
|
108
|
-
const binary = config.binaryName ?? config.manifest.name;
|
|
109
|
-
const installDir = config.installDir ?? "$HOME/.local/bin";
|
|
110
|
-
const assets = config.asset ? [config.asset] : config.manifest.assets;
|
|
111
|
-
if (assets.length === 0) {
|
|
112
|
-
throw new Error("[stitchkit] a build manifest with no assets installs nothing");
|
|
113
|
-
}
|
|
114
|
-
const selection = assets.length === 1 && assets[0] !== undefined ? singleTarget(assets[0]) : unameDispatch(assets);
|
|
115
|
-
return `#!/bin/sh
|
|
116
|
-
# ${binary} ${config.manifest.version} (${config.manifest.commit})
|
|
117
|
-
# Generated from the build manifest — it parses no JSON and needs no jq.
|
|
118
|
-
set -eu
|
|
119
|
-
|
|
120
|
-
binary=${shellQuote(binary)}
|
|
121
|
-
dir="\${INSTALL_DIR:-${installDir}}"
|
|
122
|
-
|
|
123
|
-
${selection}
|
|
124
|
-
|
|
125
|
-
fetch() {
|
|
126
|
-
if command -v curl >/dev/null 2>&1; then
|
|
127
|
-
curl -fsSL "$1" -o "$2"
|
|
128
|
-
elif command -v wget >/dev/null 2>&1; then
|
|
129
|
-
wget -q "$1" -O "$2"
|
|
130
|
-
else
|
|
131
|
-
echo "need curl or wget" >&2
|
|
132
|
-
exit 1
|
|
133
|
-
fi
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
digest() {
|
|
137
|
-
if command -v sha256sum >/dev/null 2>&1; then
|
|
138
|
-
sha256sum "$1" | cut -d' ' -f1
|
|
139
|
-
elif command -v shasum >/dev/null 2>&1; then
|
|
140
|
-
shasum -a 256 "$1" | cut -d' ' -f1
|
|
141
|
-
elif command -v openssl >/dev/null 2>&1; then
|
|
142
|
-
openssl dgst -sha256 "$1" | awk '{print $NF}'
|
|
143
|
-
else
|
|
144
|
-
echo "need sha256sum, shasum or openssl" >&2
|
|
145
|
-
exit 1
|
|
146
|
-
fi
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
tmp="$(mktemp -d)"
|
|
150
|
-
trap 'rm -rf "$tmp"' EXIT
|
|
151
|
-
|
|
152
|
-
fetch "$url" "$tmp/download"
|
|
153
|
-
if [ "$compression" = "gzip" ]; then
|
|
154
|
-
gzip -dc "$tmp/download" > "$tmp/binary"
|
|
155
|
-
else
|
|
156
|
-
mv "$tmp/download" "$tmp/binary"
|
|
157
|
-
fi
|
|
158
|
-
|
|
159
|
-
actual="$(digest "$tmp/binary")"
|
|
160
|
-
if [ "$actual" != "$sha256" ]; then
|
|
161
|
-
echo "checksum mismatch: expected $sha256, got $actual" >&2
|
|
162
|
-
exit 1
|
|
163
|
-
fi
|
|
164
|
-
|
|
165
|
-
actual_size="$(wc -c < "$tmp/binary" | tr -d ' ')"
|
|
166
|
-
if [ "$actual_size" != "$size" ]; then
|
|
167
|
-
echo "size mismatch: expected $size bytes, got $actual_size" >&2
|
|
168
|
-
exit 1
|
|
169
|
-
fi
|
|
170
|
-
|
|
171
|
-
mkdir -p "$dir"
|
|
172
|
-
chmod 755 "$tmp/binary"
|
|
173
|
-
# A rename, never a write over the file in place: anything else can leave a
|
|
174
|
-
# half-written executable where a working one used to be.
|
|
175
|
-
mv "$tmp/binary" "$dir/$binary"
|
|
176
|
-
|
|
177
|
-
echo "installed $binary ${config.manifest.version} to $dir/$binary"
|
|
178
|
-
case ":$PATH:" in
|
|
179
|
-
*":$dir:"*) ;;
|
|
180
|
-
*) echo "note: $dir is not on your PATH" >&2 ;;
|
|
181
|
-
esac
|
|
182
|
-
`;
|
|
183
|
-
}
|
|
184
|
-
function singleTarget(asset) {
|
|
185
|
-
return [
|
|
186
|
-
`url=${shellQuote(asset.url)}`,
|
|
187
|
-
`sha256=${shellQuote(asset.sha256)}`,
|
|
188
|
-
`size=${shellQuote(String(asset.size))}`,
|
|
189
|
-
`compression=${shellQuote(asset.compression)}`
|
|
190
|
-
].join(`
|
|
191
|
-
`);
|
|
192
|
-
}
|
|
193
|
-
function unameDispatch(assets) {
|
|
194
|
-
const cases = assets.map((asset) => ` ${asset.platform}/${asset.arch})
|
|
195
|
-
url=${shellQuote(asset.url)}
|
|
196
|
-
sha256=${shellQuote(asset.sha256)}
|
|
197
|
-
size=${shellQuote(String(asset.size))}
|
|
198
|
-
compression=${shellQuote(asset.compression)}
|
|
199
|
-
;;`).join(`
|
|
200
|
-
`);
|
|
201
|
-
const published = assets.map((asset) => `${asset.platform}/${asset.arch}`).join(", ");
|
|
202
|
-
return `case "$(uname -s)" in
|
|
203
|
-
Darwin) platform=darwin ;;
|
|
204
|
-
Linux) platform=linux ;;
|
|
205
|
-
*) platform="$(uname -s)" ;;
|
|
206
|
-
esac
|
|
207
|
-
case "$(uname -m)" in
|
|
208
|
-
x86_64|amd64) arch=x64 ;;
|
|
209
|
-
aarch64|arm64) arch=arm64 ;;
|
|
210
|
-
*) arch="$(uname -m)" ;;
|
|
211
|
-
esac
|
|
212
|
-
|
|
213
|
-
case "$platform/$arch" in
|
|
214
|
-
${cases}
|
|
215
|
-
*)
|
|
216
|
-
echo "no published build for $platform/$arch — published: ${published}" >&2
|
|
217
|
-
exit 1
|
|
218
|
-
;;
|
|
219
|
-
esac`;
|
|
220
|
-
}
|
|
221
|
-
// src/tools/cli-manifest.ts
|
|
222
|
-
import { z as z2 } from "zod";
|
|
223
|
-
|
|
224
|
-
// src/tools/cli-signature.ts
|
|
225
|
-
import {
|
|
226
|
-
createPrivateKey,
|
|
227
|
-
createPublicKey,
|
|
228
|
-
sign as cryptoSign,
|
|
229
|
-
verify as cryptoVerify
|
|
230
|
-
} from "node:crypto";
|
|
231
|
-
import { z } from "zod";
|
|
232
|
-
var CliBuildSignatureSchema = z.object({
|
|
233
|
-
algorithm: z.literal("ed25519"),
|
|
234
|
-
keyId: z.string().min(1),
|
|
235
|
-
signature: z.string().min(1)
|
|
236
|
-
});
|
|
237
|
-
function cliManifestSigningPayload(manifest) {
|
|
238
|
-
return serializeCanonicalJson({
|
|
239
|
-
name: manifest.name,
|
|
240
|
-
version: manifest.version,
|
|
241
|
-
commit: manifest.commit,
|
|
242
|
-
builtAt: manifest.builtAt,
|
|
243
|
-
assets: manifest.assets.map((asset) => ({
|
|
244
|
-
platform: asset.platform,
|
|
245
|
-
arch: asset.arch,
|
|
246
|
-
compression: asset.compression,
|
|
247
|
-
size: asset.size,
|
|
248
|
-
sha256: asset.sha256
|
|
249
|
-
}))
|
|
250
|
-
});
|
|
251
|
-
}
|
|
252
|
-
function publicKeyOf(material) {
|
|
253
|
-
const trimmed = material.trim();
|
|
254
|
-
if (trimmed.includes("BEGIN PUBLIC KEY"))
|
|
255
|
-
return createPublicKey(trimmed);
|
|
256
|
-
const raw = Buffer.from(trimmed, "base64");
|
|
257
|
-
if (raw.length !== 32) {
|
|
258
|
-
throw new Error("[stitchkit] an Ed25519 public key is 32 bytes or SPKI PEM");
|
|
259
|
-
}
|
|
260
|
-
const spki = Buffer.concat([Buffer.from("302a300506032b6570032100", "hex"), raw]);
|
|
261
|
-
return createPublicKey({ key: spki, format: "der", type: "spki" });
|
|
262
|
-
}
|
|
263
|
-
function signCliManifest(manifest, options) {
|
|
264
|
-
const signature = cryptoSign(null, Buffer.from(cliManifestSigningPayload(manifest), "utf8"), createPrivateKey(typeof options.privateKey === "string" ? options.privateKey : { key: Buffer.from(options.privateKey), format: "der", type: "pkcs8" }));
|
|
265
|
-
return {
|
|
266
|
-
algorithm: "ed25519",
|
|
267
|
-
keyId: options.keyId,
|
|
268
|
-
signature: signature.toString("base64")
|
|
269
|
-
};
|
|
270
|
-
}
|
|
271
|
-
function verifyCliManifest(manifest, signature, trust) {
|
|
272
|
-
const keys = trust?.keys;
|
|
273
|
-
if (!keys || Object.keys(keys).length === 0)
|
|
274
|
-
return "unenforced";
|
|
275
|
-
if (!signature)
|
|
276
|
-
return "missing";
|
|
277
|
-
const material = Object.hasOwn(keys, signature.keyId) ? keys[signature.keyId] : undefined;
|
|
278
|
-
if (material === undefined)
|
|
279
|
-
return "unknown-key";
|
|
280
|
-
try {
|
|
281
|
-
const ok = cryptoVerify(null, Buffer.from(cliManifestSigningPayload(manifest), "utf8"), publicKeyOf(material), Buffer.from(signature.signature, "base64"));
|
|
282
|
-
return ok ? "valid" : "invalid";
|
|
283
|
-
} catch {
|
|
284
|
-
return "invalid";
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
function cliSignatureAccepted(verdict) {
|
|
288
|
-
return verdict === "valid" || verdict === "unenforced";
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
// src/tools/cli-manifest.ts
|
|
292
|
-
var CliBuildTargetSchema = z2.object({
|
|
293
|
-
platform: z2.string().min(1),
|
|
294
|
-
arch: z2.string().min(1)
|
|
295
|
-
});
|
|
296
|
-
var CliBuildAssetSchema = CliBuildTargetSchema.extend({
|
|
297
|
-
url: z2.url(),
|
|
298
|
-
compression: z2.enum(["gzip", "none"]).default("none"),
|
|
299
|
-
size: z2.int().positive(),
|
|
300
|
-
sha256: z2.string().regex(/^[0-9a-f]{64}$/, "sha256 must be 64 lowercase hex characters")
|
|
301
|
-
});
|
|
302
|
-
var CliBuildManifestSchema = z2.object({
|
|
303
|
-
name: z2.string().min(1),
|
|
304
|
-
version: z2.string().min(1),
|
|
305
|
-
commit: z2.string().min(1),
|
|
306
|
-
builtAt: z2.iso.datetime(),
|
|
307
|
-
assets: z2.array(CliBuildAssetSchema),
|
|
308
|
-
signature: CliBuildSignatureSchema.optional()
|
|
309
|
-
});
|
|
310
|
-
var CliBuildStampSchema = z2.object({
|
|
311
|
-
version: z2.string().min(1),
|
|
312
|
-
commit: z2.string().min(1),
|
|
313
|
-
builtAt: z2.iso.datetime()
|
|
314
|
-
});
|
|
315
|
-
function formatCliBuildStamp(stamp, name) {
|
|
316
|
-
const prefix = name ? `${name} ` : "";
|
|
317
|
-
return `${prefix}${stamp.version} (${stamp.commit.slice(0, 12)}, built ${stamp.builtAt})`;
|
|
318
|
-
}
|
|
319
|
-
function currentCliBuildTarget() {
|
|
320
|
-
return { platform: process.platform, arch: process.arch };
|
|
321
|
-
}
|
|
322
|
-
function selectCliBuildAsset(manifest, target = currentCliBuildTarget()) {
|
|
323
|
-
return manifest.assets.find((asset) => asset.platform === target.platform && asset.arch === target.arch);
|
|
324
|
-
}
|
|
325
|
-
function isManifestList(value) {
|
|
326
|
-
return Array.isArray(value);
|
|
327
|
-
}
|
|
328
|
-
function assertCliPublishable(previous, next) {
|
|
329
|
-
const published = previous === undefined ? [] : isManifestList(previous) ? previous : [previous];
|
|
330
|
-
for (const candidate of published) {
|
|
331
|
-
if (candidate.version !== next.version)
|
|
332
|
-
continue;
|
|
333
|
-
if (candidate.commit === next.commit)
|
|
334
|
-
continue;
|
|
335
|
-
throw new Error(`[stitchkit] ${next.name} ${next.version} was already published from commit ${candidate.commit}; ` + `refusing to republish it from ${next.commit} — bump the version instead`);
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
// src/tools/cli-profile.ts
|
|
339
|
-
import {
|
|
340
|
-
chmodSync,
|
|
341
|
-
existsSync as existsSync2,
|
|
342
|
-
mkdirSync,
|
|
343
|
-
readdirSync,
|
|
344
|
-
readFileSync as readFileSync2,
|
|
345
|
-
statSync,
|
|
346
|
-
writeFileSync
|
|
347
|
-
} from "node:fs";
|
|
348
|
-
import { join as join2 } from "node:path";
|
|
349
|
-
var PROFILE_SUFFIX = ".json";
|
|
350
|
-
var FILE_MODE = 384;
|
|
351
|
-
var DIRECTORY_MODE = 448;
|
|
352
|
-
|
|
353
|
-
class CliProfileError extends AppError {
|
|
354
|
-
constructor(message, code = "NOT_FOUND") {
|
|
355
|
-
super(code, message, code === "NOT_FOUND" ? 404 : code === "FORBIDDEN" ? 403 : 400);
|
|
356
|
-
this.name = "CliProfileError";
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
function assertProfileName(name) {
|
|
360
|
-
if (!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(name)) {
|
|
361
|
-
throw new CliProfileError(`"${name}" is not a usable profile name — letters, digits, dot, dash and underscore`, "BAD_REQUEST");
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
function createCliProfileStore(config) {
|
|
365
|
-
const announce = config.announce ?? ((line) => process.stderr.write(`${line}
|
|
366
|
-
`));
|
|
367
|
-
const pathFor = (name) => {
|
|
368
|
-
assertProfileName(name);
|
|
369
|
-
return join2(config.directory, `${name}${PROFILE_SUFFIX}`);
|
|
370
|
-
};
|
|
371
|
-
const list = () => {
|
|
372
|
-
if (!existsSync2(config.directory))
|
|
373
|
-
return [];
|
|
374
|
-
return readdirSync(config.directory).filter((entry) => entry.endsWith(PROFILE_SUFFIX)).map((entry) => entry.slice(0, -PROFILE_SUFFIX.length)).sort();
|
|
375
|
-
};
|
|
376
|
-
const read = (name) => {
|
|
377
|
-
const path = pathFor(name);
|
|
378
|
-
if (!existsSync2(path)) {
|
|
379
|
-
throw new CliProfileError(missingMessage(name, path, config));
|
|
380
|
-
}
|
|
381
|
-
const mode = statSync(path).mode & 63;
|
|
382
|
-
if (mode !== 0) {
|
|
383
|
-
throw new CliProfileError(`profile "${name}" is readable by other users — run: chmod 600 ${path}`, "FORBIDDEN");
|
|
384
|
-
}
|
|
385
|
-
const parsed = safeJsonParse(readFileSync2(path, "utf8"));
|
|
386
|
-
const result = config.schema.safeParse(parsed);
|
|
387
|
-
if (!result.success) {
|
|
388
|
-
const issue = result.error.issues[0];
|
|
389
|
-
const field = issue?.path.join(".");
|
|
390
|
-
throw new CliProfileError(`profile "${name}" (${path}) is not usable: ${field ? `${field}: ` : ""}${issue?.message ?? "invalid"}`, "BAD_REQUEST");
|
|
391
|
-
}
|
|
392
|
-
return result.data;
|
|
393
|
-
};
|
|
394
|
-
return {
|
|
395
|
-
directory: config.directory,
|
|
396
|
-
pathFor,
|
|
397
|
-
list,
|
|
398
|
-
read,
|
|
399
|
-
write(name, value) {
|
|
400
|
-
const path = pathFor(name);
|
|
401
|
-
mkdirSync(config.directory, { recursive: true, mode: DIRECTORY_MODE });
|
|
402
|
-
writeFileSync(path, `${JSON.stringify(value, null, 2)}
|
|
403
|
-
`, { mode: FILE_MODE });
|
|
404
|
-
chmodSync(path, FILE_MODE);
|
|
405
|
-
return path;
|
|
406
|
-
},
|
|
407
|
-
resolve(name) {
|
|
408
|
-
if (name !== undefined) {
|
|
409
|
-
const path = pathFor(name);
|
|
410
|
-
return { name, path, value: read(name), substituted: false };
|
|
411
|
-
}
|
|
412
|
-
const configured = list();
|
|
413
|
-
const only = configured[0];
|
|
414
|
-
if (configured.length === 1 && only !== undefined) {
|
|
415
|
-
const path = pathFor(only);
|
|
416
|
-
announce(`[${only}] using the only configured profile (${path})`);
|
|
417
|
-
return { name: only, path, value: read(only), substituted: true };
|
|
418
|
-
}
|
|
419
|
-
if (configured.length === 0) {
|
|
420
|
-
const example = join2(config.directory, `<name>${PROFILE_SUFFIX}`);
|
|
421
|
-
throw new CliProfileError(`no profile is configured in ${config.directory}${config.createHint ? ` — ${config.createHint("<name>", example)}` : ""}`);
|
|
422
|
-
}
|
|
423
|
-
throw new CliProfileError(`several profiles are configured (${configured.join(", ")}) — name one`, "BAD_REQUEST");
|
|
424
|
-
}
|
|
425
|
-
};
|
|
426
|
-
}
|
|
427
|
-
function missingMessage(name, path, config) {
|
|
428
|
-
const hint = config.createHint ? ` — ${config.createHint(name, path)}` : "";
|
|
429
|
-
return `profile "${name}" is not configured; expected ${path}${hint}`;
|
|
430
|
-
}
|
|
431
|
-
// src/tools/cli-stream.ts
|
|
432
|
-
import { z as z3 } from "zod";
|
|
433
|
-
var LineSchema = z3.object({
|
|
434
|
-
id: z3.string().min(1),
|
|
435
|
-
command: z3.string().min(1),
|
|
436
|
-
args: z3.record(z3.string(), z3.unknown()).default({})
|
|
437
|
-
});
|
|
438
|
-
async function* readStdinLines(source = process.stdin) {
|
|
439
|
-
const decoder = new TextDecoder;
|
|
440
|
-
let pending = "";
|
|
441
|
-
for await (const chunk of source) {
|
|
442
|
-
pending += typeof chunk === "string" ? chunk : decoder.decode(chunk, { stream: true });
|
|
443
|
-
let newline = pending.indexOf(`
|
|
444
|
-
`);
|
|
445
|
-
while (newline !== -1) {
|
|
446
|
-
const line = pending.slice(0, newline);
|
|
447
|
-
pending = pending.slice(newline + 1);
|
|
448
|
-
yield line.endsWith("\r") ? line.slice(0, -1) : line;
|
|
449
|
-
newline = pending.indexOf(`
|
|
450
|
-
`);
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
if (pending !== "")
|
|
454
|
-
yield pending.endsWith("\r") ? pending.slice(0, -1) : pending;
|
|
455
|
-
}
|
|
456
|
-
function parseLine(line) {
|
|
457
|
-
let parsed;
|
|
458
|
-
try {
|
|
459
|
-
parsed = safeJsonParse(line);
|
|
460
|
-
} catch {
|
|
461
|
-
return { ok: false, answer: malformed("the line is not JSON") };
|
|
462
|
-
}
|
|
463
|
-
const result = LineSchema.safeParse(parsed);
|
|
464
|
-
if (!result.success) {
|
|
465
|
-
const id = isRecord(parsed) && typeof parsed.id === "string" ? parsed.id : undefined;
|
|
466
|
-
return {
|
|
467
|
-
ok: false,
|
|
468
|
-
answer: {
|
|
469
|
-
...malformed("the line needs `id` and `command`"),
|
|
470
|
-
...id !== undefined && { id }
|
|
471
|
-
}
|
|
472
|
-
};
|
|
473
|
-
}
|
|
474
|
-
return { ok: true, value: result.data };
|
|
475
|
-
}
|
|
476
|
-
function malformed(message) {
|
|
477
|
-
return {
|
|
478
|
-
id: "",
|
|
479
|
-
ok: false,
|
|
480
|
-
exitCode: 2,
|
|
481
|
-
error: { code: "BAD_REQUEST", message }
|
|
482
|
-
};
|
|
483
|
-
}
|
|
484
|
-
async function runCliStream(invoker, lines, onAnswer, hooks = {}) {
|
|
485
|
-
for await (const line of lines) {
|
|
486
|
-
if (line.trim() === "")
|
|
487
|
-
continue;
|
|
488
|
-
const parsed = parseLine(line);
|
|
489
|
-
if (!parsed.ok) {
|
|
490
|
-
onAnswer(parsed.answer);
|
|
491
|
-
continue;
|
|
492
|
-
}
|
|
493
|
-
const { id, command, args } = parsed.value;
|
|
494
|
-
const answered = hooks.before?.(id, { command, args });
|
|
495
|
-
if (answered) {
|
|
496
|
-
onAnswer(answered);
|
|
497
|
-
continue;
|
|
498
|
-
}
|
|
499
|
-
const outcome = await invoker.invoke(command, args);
|
|
500
|
-
hooks.after?.(id, { command, args }, outcome);
|
|
501
|
-
onAnswer({ id, ...outcome });
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
function defineCliStreamCommand(config) {
|
|
505
|
-
return defineCliCommand({
|
|
506
|
-
name: config.name ?? "stream",
|
|
507
|
-
description: config.description ?? "Run one operation per JSON line of stdin, answering each",
|
|
508
|
-
input: z3.object({}),
|
|
509
|
-
handler: async (context) => {
|
|
510
|
-
const invoker = typeof config.invoker === "function" ? await config.invoker() : config.invoker;
|
|
511
|
-
await runCliStream(invoker, (config.readLines ?? readStdinLines)(), (answer) => {
|
|
512
|
-
context.stdout(`${JSON.stringify(answer)}
|
|
513
|
-
`);
|
|
514
|
-
});
|
|
515
|
-
}
|
|
516
|
-
});
|
|
517
|
-
}
|
|
518
|
-
function defineCliBatchCommand(config) {
|
|
519
|
-
return defineCliCommand({
|
|
520
|
-
name: config.name ?? "batch",
|
|
521
|
-
description: config.description ?? "Run one operation per JSON line of stdin, resuming from a checkpoint",
|
|
522
|
-
input: z3.object({
|
|
523
|
-
checkpoint: z3.string().optional()
|
|
524
|
-
}),
|
|
525
|
-
handler: async (context) => {
|
|
526
|
-
const invoker = typeof config.invoker === "function" ? await config.invoker() : config.invoker;
|
|
527
|
-
const path = context.input.checkpoint ?? config.checkpointPath ?? ".stitchkit-batch.json";
|
|
528
|
-
const checkpoint = readCliCheckpoint(path);
|
|
529
|
-
await runCliStream(invoker, (config.readLines ?? readStdinLines)(), (answer) => {
|
|
530
|
-
context.stdout(`${JSON.stringify(answer)}
|
|
531
|
-
`);
|
|
532
|
-
}, {
|
|
533
|
-
before: (id, line) => {
|
|
534
|
-
const digest = checkpoint.digestOf(line);
|
|
535
|
-
const recorded = checkpoint.entries[id];
|
|
536
|
-
if (!recorded)
|
|
537
|
-
return;
|
|
538
|
-
if (recorded.digest !== digest) {
|
|
539
|
-
return {
|
|
540
|
-
id,
|
|
541
|
-
ok: false,
|
|
542
|
-
exitCode: 2,
|
|
543
|
-
error: {
|
|
544
|
-
code: "CONFLICT",
|
|
545
|
-
message: "this id was already run with different content — change the id or start a new checkpoint"
|
|
546
|
-
}
|
|
547
|
-
};
|
|
548
|
-
}
|
|
549
|
-
const replay = isRecord(recorded.answer) ? recorded.answer : {};
|
|
550
|
-
return { ...replay, id, replayed: true };
|
|
551
|
-
},
|
|
552
|
-
after: (id, line, outcome) => {
|
|
553
|
-
if (!outcome.ok)
|
|
554
|
-
return;
|
|
555
|
-
checkpoint.record(id, checkpoint.digestOf(line), outcome);
|
|
556
|
-
writeCliCheckpoint(path, checkpoint);
|
|
557
|
-
}
|
|
558
|
-
});
|
|
559
|
-
}
|
|
560
|
-
});
|
|
561
|
-
}
|
|
562
|
-
// src/tools/cli-update.ts
|
|
563
|
-
import { createHash } from "node:crypto";
|
|
564
|
-
import { existsSync as existsSync3, readFileSync as readFileSync3, statSync as statSync2 } from "node:fs";
|
|
565
|
-
import { gunzipSync } from "node:zlib";
|
|
566
|
-
var DEFAULT_CHECK_TIMEOUT_MS = 2000;
|
|
567
|
-
var DEFAULT_CHECK_INTERVAL_MS = 24 * 60 * 60 * 1000;
|
|
568
|
-
var DEFAULT_DOWNLOAD_TIMEOUT_MS = 120000;
|
|
569
|
-
var MANIFEST_MAX_BYTES = 256 * 1024;
|
|
570
|
-
var DEFAULT_MAX_ASSET_BYTES = 256 * 1024 * 1024;
|
|
571
|
-
function parseVersion(value) {
|
|
572
|
-
const match = /^v?(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?/.exec(value.trim());
|
|
573
|
-
if (!match)
|
|
574
|
-
return;
|
|
575
|
-
const numbers = [match[1], match[2], match[3]].map((part) => Number(part));
|
|
576
|
-
if (numbers.some((part) => !Number.isFinite(part)))
|
|
577
|
-
return;
|
|
578
|
-
return { numbers, prerelease: match[4] };
|
|
579
|
-
}
|
|
580
|
-
function compareCliVersions(left, right) {
|
|
581
|
-
const a = parseVersion(left);
|
|
582
|
-
const b = parseVersion(right);
|
|
583
|
-
if (!a || !b)
|
|
584
|
-
return;
|
|
585
|
-
for (let index = 0;index < 3; index++) {
|
|
586
|
-
const difference = (a.numbers[index] ?? 0) - (b.numbers[index] ?? 0);
|
|
587
|
-
if (difference !== 0)
|
|
588
|
-
return difference < 0 ? -1 : 1;
|
|
589
|
-
}
|
|
590
|
-
if (a.prerelease === b.prerelease)
|
|
591
|
-
return 0;
|
|
592
|
-
if (a.prerelease === undefined)
|
|
593
|
-
return 1;
|
|
594
|
-
if (b.prerelease === undefined)
|
|
595
|
-
return -1;
|
|
596
|
-
return a.prerelease < b.prerelease ? -1 : 1;
|
|
597
|
-
}
|
|
598
|
-
async function checkCliUpdate(config) {
|
|
599
|
-
const now = config.now ?? Date.now();
|
|
600
|
-
const interval = config.intervalMs ?? DEFAULT_CHECK_INTERVAL_MS;
|
|
601
|
-
if (config.lastCheckedAt !== undefined && now - config.lastCheckedAt < interval) {
|
|
602
|
-
return { status: "skipped", nextCheckAt: config.lastCheckedAt + interval };
|
|
603
|
-
}
|
|
604
|
-
try {
|
|
605
|
-
const response = await fetchGuarded(new URL(config.manifestUrl), config.allowPrivateHosts ?? false, {
|
|
606
|
-
timeoutMs: config.timeoutMs ?? DEFAULT_CHECK_TIMEOUT_MS,
|
|
607
|
-
bodyTimeoutMs: config.timeoutMs ?? DEFAULT_CHECK_TIMEOUT_MS
|
|
608
|
-
});
|
|
609
|
-
if (!response.ok)
|
|
610
|
-
return { status: "unknown", reason: `manifest responded ${response.status}` };
|
|
611
|
-
const body = await readCapped(response, MANIFEST_MAX_BYTES);
|
|
612
|
-
if (!body)
|
|
613
|
-
return { status: "unknown", reason: "manifest is larger than expected" };
|
|
614
|
-
const parsed = CliBuildManifestSchema.safeParse(JSON.parse(body.toString("utf8")));
|
|
615
|
-
if (!parsed.success)
|
|
616
|
-
return { status: "unknown", reason: "manifest did not validate" };
|
|
617
|
-
const manifest = parsed.data;
|
|
618
|
-
const order = compareCliVersions(config.currentVersion, manifest.version);
|
|
619
|
-
if (order === undefined) {
|
|
620
|
-
return {
|
|
621
|
-
status: "unknown",
|
|
622
|
-
reason: `cannot compare ${config.currentVersion} with ${manifest.version}`
|
|
623
|
-
};
|
|
624
|
-
}
|
|
625
|
-
const verdict = verifyCliManifest(manifest, manifest.signature, config.trust);
|
|
626
|
-
if (order >= 0)
|
|
627
|
-
return { status: "current", version: manifest.version, signature: verdict };
|
|
628
|
-
if (!cliSignatureAccepted(verdict)) {
|
|
629
|
-
return { status: "unknown", reason: `manifest signature: ${verdict}` };
|
|
630
|
-
}
|
|
631
|
-
const asset = selectCliBuildAsset(manifest, config.target ?? currentCliBuildTarget());
|
|
632
|
-
return {
|
|
633
|
-
status: "outdated",
|
|
634
|
-
version: manifest.version,
|
|
635
|
-
manifest,
|
|
636
|
-
...asset && { asset },
|
|
637
|
-
signature: verdict
|
|
638
|
-
};
|
|
639
|
-
} catch (error) {
|
|
640
|
-
if (error instanceof PrivateAddressRefusal) {
|
|
641
|
-
return {
|
|
642
|
-
status: "unknown",
|
|
643
|
-
reason: `${error.message} — the manifest endpoint is not public. Set ` + "`allowPrivateHosts` if it is your own deployment; the download keeps " + "its own setting, because an asset URL comes from the document."
|
|
644
|
-
};
|
|
645
|
-
}
|
|
646
|
-
return {
|
|
647
|
-
status: "unknown",
|
|
648
|
-
reason: error instanceof Error ? error.message : String(error)
|
|
649
|
-
};
|
|
650
|
-
}
|
|
651
|
-
}
|
|
652
|
-
async function applyCliUpdate(config) {
|
|
653
|
-
const target = config.targetPath ?? process.execPath;
|
|
654
|
-
if (config.trust) {
|
|
655
|
-
if (!config.manifest) {
|
|
656
|
-
throw new Error("[stitchkit] update: a trust root needs the manifest the asset came from");
|
|
657
|
-
}
|
|
658
|
-
const verdict = verifyCliManifest(config.manifest, config.manifest.signature, config.trust);
|
|
659
|
-
if (!cliSignatureAccepted(verdict)) {
|
|
660
|
-
throw new Error(`[stitchkit] update: refusing to install — manifest signature ${verdict}`);
|
|
661
|
-
}
|
|
662
|
-
if (!config.manifest.assets.some((asset) => asset.sha256 === config.asset.sha256)) {
|
|
663
|
-
throw new Error("[stitchkit] update: the asset is not one the signed manifest names");
|
|
664
|
-
}
|
|
665
|
-
}
|
|
666
|
-
const response = await fetchGuarded(new URL(config.asset.url), config.allowPrivateHosts ?? false, {
|
|
667
|
-
timeoutMs: config.timeoutMs ?? DEFAULT_DOWNLOAD_TIMEOUT_MS,
|
|
668
|
-
bodyTimeoutMs: config.timeoutMs ?? DEFAULT_DOWNLOAD_TIMEOUT_MS
|
|
669
|
-
});
|
|
670
|
-
if (!response.ok) {
|
|
671
|
-
throw new Error(`[stitchkit] update download responded ${response.status}`);
|
|
672
|
-
}
|
|
673
|
-
const transferred = await readCapped(response, config.maxBytes ?? DEFAULT_MAX_ASSET_BYTES);
|
|
674
|
-
if (!transferred)
|
|
675
|
-
throw new Error("[stitchkit] update download exceeded the size ceiling");
|
|
676
|
-
const bytes = config.asset.compression === "gzip" ? gunzipSync(transferred, { maxOutputLength: config.asset.size }) : transferred;
|
|
677
|
-
if (bytes.length !== config.asset.size) {
|
|
678
|
-
throw new Error(`[stitchkit] update is ${bytes.length} bytes, manifest says ${config.asset.size} — refusing to install it`);
|
|
679
|
-
}
|
|
680
|
-
const sha256 = createHash("sha256").update(bytes).digest("hex");
|
|
681
|
-
if (sha256 !== config.asset.sha256) {
|
|
682
|
-
throw new Error(`[stitchkit] update digest ${sha256} does not match the manifest — refusing to install it`);
|
|
683
|
-
}
|
|
684
|
-
const backup = config.backupPath ? keepReplacedBinary(target, config.backupPath) : undefined;
|
|
685
|
-
writeFileAtomic(target, bytes, 493);
|
|
686
|
-
return {
|
|
687
|
-
path: target,
|
|
688
|
-
bytes: bytes.length,
|
|
689
|
-
sha256,
|
|
690
|
-
...backup && { backupPath: backup.path, backupSha256: backup.sha256 }
|
|
691
|
-
};
|
|
692
|
-
}
|
|
693
|
-
function keepReplacedBinary(target, backupPath) {
|
|
694
|
-
if (!existsSync3(target))
|
|
695
|
-
return;
|
|
696
|
-
const previous = readFileSync3(target);
|
|
697
|
-
writeFileAtomic(backupPath, previous, statSync2(target).mode & 511);
|
|
698
|
-
return { path: backupPath, sha256: createHash("sha256").update(previous).digest("hex") };
|
|
699
|
-
}
|
|
700
|
-
function rollbackCliUpdate(config) {
|
|
701
|
-
const target = config.targetPath ?? process.execPath;
|
|
702
|
-
if (!existsSync3(config.backupPath)) {
|
|
703
|
-
throw new Error(`[stitchkit] rollback: no backup at ${config.backupPath}`);
|
|
704
|
-
}
|
|
705
|
-
const bytes = readFileSync3(config.backupPath);
|
|
706
|
-
const sha256 = createHash("sha256").update(bytes).digest("hex");
|
|
707
|
-
if (sha256 !== config.expectedSha256) {
|
|
708
|
-
throw new Error(`[stitchkit] rollback: backup digest ${sha256} does not match the expected ${config.expectedSha256} — refusing to restore it`);
|
|
709
|
-
}
|
|
710
|
-
writeFileAtomic(target, bytes, statSync2(config.backupPath).mode & 511);
|
|
711
|
-
return { path: target, bytes: bytes.length, sha256 };
|
|
712
|
-
}
|
|
713
|
-
export {
|
|
714
|
-
writeCliCheckpoint,
|
|
715
|
-
verifyCliManifest,
|
|
716
|
-
signCliManifest,
|
|
717
|
-
selectCliBuildAsset,
|
|
718
|
-
runCliStream,
|
|
719
|
-
routeCliArgv,
|
|
720
|
-
rollbackCliUpdate,
|
|
721
|
-
renderCliView,
|
|
722
|
-
renderCliInstaller,
|
|
723
|
-
readCliCheckpoint,
|
|
724
|
-
pollUntilDone,
|
|
725
|
-
parseCliArgs,
|
|
726
|
-
formatCliBuildStamp,
|
|
727
|
-
extractCliGlobalOptions,
|
|
728
|
-
emitResult,
|
|
729
|
-
defineCliStreamCommand,
|
|
730
|
-
defineCliCommand,
|
|
731
|
-
defineCliBatchCommand,
|
|
732
|
-
currentCliBuildTarget,
|
|
733
|
-
createCliProfileStore,
|
|
734
|
-
createCliInvoker,
|
|
735
|
-
createCli,
|
|
736
|
-
compareCliVersions,
|
|
737
|
-
coerceJsonArgs,
|
|
738
|
-
cliSignatureAccepted,
|
|
739
|
-
cliManifestSigningPayload,
|
|
740
|
-
cliInvocationResult,
|
|
741
|
-
cliExitCode,
|
|
742
|
-
checkCliUpdate,
|
|
743
|
-
assertCliPublishable,
|
|
744
|
-
applyCliUpdate,
|
|
745
|
-
DEFAULT_EXIT_CODES,
|
|
746
|
-
CliProfileError,
|
|
747
|
-
CliBuildTargetSchema,
|
|
748
|
-
CliBuildStampSchema,
|
|
749
|
-
CliBuildSignatureSchema,
|
|
750
|
-
CliBuildManifestSchema,
|
|
751
|
-
CliBuildAssetSchema,
|
|
752
|
-
CliArgumentError
|
|
753
|
-
};
|