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
|
@@ -1,798 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createAgentCodingTools
|
|
3
|
-
} from "./index-fq77yfzc.js";
|
|
4
|
-
import"./index-bn2cjajt.js";
|
|
5
|
-
import {
|
|
6
|
-
codingRefusal,
|
|
7
|
-
missingSandboxRestrictions,
|
|
8
|
-
probeAgentProcessSandbox
|
|
9
|
-
} from "./index-qmy6zq75.js";
|
|
10
|
-
import"./index-0a349c33.js";
|
|
11
|
-
import"./index-rxfy4cq7.js";
|
|
12
|
-
import"./index-6k1937bx.js";
|
|
13
|
-
import"./index-vjpvjqpn.js";
|
|
14
|
-
import"./index-h9etkkyk.js";
|
|
15
|
-
import"./index-cby4ar3v.js";
|
|
16
|
-
import"./index-2vtcmrj9.js";
|
|
17
|
-
import"./index-kzfs85xp.js";
|
|
18
|
-
import"./index-77fekveh.js";
|
|
19
|
-
|
|
20
|
-
// src/agent-runtime/sandbox-bubblewrap.ts
|
|
21
|
-
import { mkdir as mkdir2, mkdtemp, realpath, rm as rm2 } from "node:fs/promises";
|
|
22
|
-
import { tmpdir } from "node:os";
|
|
23
|
-
import { join as join2, posix as posix2 } from "node:path";
|
|
24
|
-
import { z as z3 } from "zod";
|
|
25
|
-
|
|
26
|
-
// src/agent-runtime/sandbox-broker.ts
|
|
27
|
-
import { chmod, unlink } from "node:fs/promises";
|
|
28
|
-
import { createServer } from "node:http";
|
|
29
|
-
|
|
30
|
-
// src/agent-runtime/sandbox-contract.ts
|
|
31
|
-
import { z } from "zod";
|
|
32
|
-
var SandboxNetworkPolicySchema = z.union([
|
|
33
|
-
z.literal("allow-all"),
|
|
34
|
-
z.literal("deny-all"),
|
|
35
|
-
z.object({
|
|
36
|
-
allow: z.array(z.object({
|
|
37
|
-
origin: z.url().refine((value) => {
|
|
38
|
-
const u = new URL(value);
|
|
39
|
-
return ["http:", "https:"].includes(u.protocol) && !u.username && !u.password && u.pathname === "/" && !u.search && !u.hash;
|
|
40
|
-
}, "Expected an HTTP origin"),
|
|
41
|
-
headers: z.record(z.string().regex(/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/).refine((name) => ![
|
|
42
|
-
"host",
|
|
43
|
-
"connection",
|
|
44
|
-
"content-length",
|
|
45
|
-
"transfer-encoding",
|
|
46
|
-
"proxy-authorization",
|
|
47
|
-
"proxy-connection",
|
|
48
|
-
"upgrade",
|
|
49
|
-
"trailer",
|
|
50
|
-
"te"
|
|
51
|
-
].includes(name.toLowerCase()), "Routing and hop-by-hop headers cannot be brokered"), z.string().refine((value) => !/[\r\n\0]/.test(value), "Invalid header value")).optional()
|
|
52
|
-
}).strict())
|
|
53
|
-
}).strict().refine((policy) => new Set(policy.allow.map((entry) => new URL(entry.origin).host)).size === policy.allow.length, "Each gateway host must have exactly one origin")
|
|
54
|
-
]);
|
|
55
|
-
var SandboxStateSchema = z.object({
|
|
56
|
-
backend: z.string().min(1),
|
|
57
|
-
sessionId: z.string().min(1),
|
|
58
|
-
templateKey: z.string().min(1)
|
|
59
|
-
}).strict();
|
|
60
|
-
var SandboxCommandSchema = z.object({
|
|
61
|
-
executable: z.string().min(1),
|
|
62
|
-
args: z.array(z.string()).optional(),
|
|
63
|
-
cwd: z.string().optional(),
|
|
64
|
-
environment: z.record(z.string(), z.string()).optional(),
|
|
65
|
-
timeoutMs: z.number().int().positive().max(2147483647).optional(),
|
|
66
|
-
maxOutputBytes: z.number().int().positive().optional()
|
|
67
|
-
}).strict();
|
|
68
|
-
|
|
69
|
-
class SandboxError extends Error {
|
|
70
|
-
code;
|
|
71
|
-
constructor(code, message, options) {
|
|
72
|
-
super(message, options);
|
|
73
|
-
this.code = code;
|
|
74
|
-
this.name = "SandboxError";
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
// src/agent-runtime/sandbox-broker.ts
|
|
79
|
-
async function createSandboxBroker(socketPath, getPolicy, onError) {
|
|
80
|
-
const controllers = new Set;
|
|
81
|
-
const maxBytes = 1048576;
|
|
82
|
-
async function handle(req, res) {
|
|
83
|
-
const policy = getPolicy();
|
|
84
|
-
const rule = typeof policy === "object" ? policy.allow.find((entry) => new URL(entry.origin).host === req.headers.host) : undefined;
|
|
85
|
-
if (!rule || !req.url?.startsWith("/") || req.url.startsWith("//")) {
|
|
86
|
-
res.writeHead(403).end("Sandbox network denied");
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
if (controllers.size >= 16) {
|
|
90
|
-
res.writeHead(503).end("Sandbox broker busy");
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
const controller = new AbortController;
|
|
94
|
-
controllers.add(controller);
|
|
95
|
-
const timer = setTimeout(() => {
|
|
96
|
-
controller.abort();
|
|
97
|
-
req.destroy();
|
|
98
|
-
}, 30000);
|
|
99
|
-
timer.unref();
|
|
100
|
-
const abort = () => controller.abort();
|
|
101
|
-
req.on("aborted", abort);
|
|
102
|
-
res.on("close", abort);
|
|
103
|
-
try {
|
|
104
|
-
const chunks = [];
|
|
105
|
-
let size = 0;
|
|
106
|
-
for await (const chunk of req) {
|
|
107
|
-
const bytes = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
|
|
108
|
-
size += bytes.byteLength;
|
|
109
|
-
if (size > maxBytes)
|
|
110
|
-
throw new SandboxError("SANDBOX_LIMIT", "Sandbox request limit exceeded");
|
|
111
|
-
chunks.push(bytes);
|
|
112
|
-
}
|
|
113
|
-
const target = new URL(req.url, rule.origin);
|
|
114
|
-
if (target.origin !== new URL(rule.origin).origin)
|
|
115
|
-
throw new SandboxError("SANDBOX_NETWORK_DENIED", "Sandbox network denied");
|
|
116
|
-
const headers = new Headers;
|
|
117
|
-
for (const name of ["content-type", "accept"]) {
|
|
118
|
-
const value = req.headers[name];
|
|
119
|
-
if (typeof value === "string")
|
|
120
|
-
headers.set(name, value);
|
|
121
|
-
}
|
|
122
|
-
for (const [name, value] of Object.entries(rule.headers ?? {}))
|
|
123
|
-
headers.set(name, value);
|
|
124
|
-
const response = await fetch(target, {
|
|
125
|
-
method: req.method,
|
|
126
|
-
headers,
|
|
127
|
-
redirect: "manual",
|
|
128
|
-
signal: controller.signal,
|
|
129
|
-
...size > 0 && { body: Buffer.concat(chunks) }
|
|
130
|
-
});
|
|
131
|
-
if (response.status >= 300 && response.status < 400) {
|
|
132
|
-
await response.body?.cancel();
|
|
133
|
-
throw new SandboxError("SANDBOX_NETWORK_DENIED", "Sandbox redirects are denied");
|
|
134
|
-
}
|
|
135
|
-
const reader = response.body?.getReader();
|
|
136
|
-
const output = [];
|
|
137
|
-
size = 0;
|
|
138
|
-
try {
|
|
139
|
-
while (reader) {
|
|
140
|
-
const next = await reader.read();
|
|
141
|
-
if (next.done)
|
|
142
|
-
break;
|
|
143
|
-
size += next.value.byteLength;
|
|
144
|
-
if (size > maxBytes)
|
|
145
|
-
throw new SandboxError("SANDBOX_LIMIT", "Sandbox response limit exceeded");
|
|
146
|
-
output.push(next.value);
|
|
147
|
-
}
|
|
148
|
-
} finally {
|
|
149
|
-
await reader?.cancel();
|
|
150
|
-
}
|
|
151
|
-
const type = response.headers.get("content-type");
|
|
152
|
-
res.writeHead(response.status, type ? { "content-type": type } : {});
|
|
153
|
-
res.end(Buffer.concat(output));
|
|
154
|
-
} catch (cause) {
|
|
155
|
-
try {
|
|
156
|
-
onError(cause);
|
|
157
|
-
} catch (observerError) {
|
|
158
|
-
process.emitWarning(new Error("Sandbox diagnostic sink failed", {
|
|
159
|
-
cause: new AggregateError([cause, observerError])
|
|
160
|
-
}));
|
|
161
|
-
}
|
|
162
|
-
if (!res.destroyed)
|
|
163
|
-
res.writeHead(502).end("Sandbox upstream request failed");
|
|
164
|
-
} finally {
|
|
165
|
-
clearTimeout(timer);
|
|
166
|
-
controllers.delete(controller);
|
|
167
|
-
req.off("aborted", abort);
|
|
168
|
-
res.off("close", abort);
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
const server = createServer((req, res) => {
|
|
172
|
-
handle(req, res);
|
|
173
|
-
});
|
|
174
|
-
server.on("connect", (_req, socket) => socket.end(`HTTP/1.1 403 Forbidden\r
|
|
175
|
-
Connection: close\r
|
|
176
|
-
\r
|
|
177
|
-
`));
|
|
178
|
-
server.requestTimeout = 30000;
|
|
179
|
-
server.headersTimeout = 5000;
|
|
180
|
-
await new Promise((resolve, reject) => {
|
|
181
|
-
server.once("error", reject);
|
|
182
|
-
server.listen(socketPath, resolve);
|
|
183
|
-
});
|
|
184
|
-
await chmod(socketPath, 384);
|
|
185
|
-
return {
|
|
186
|
-
abortRequests() {
|
|
187
|
-
for (const controller of controllers)
|
|
188
|
-
controller.abort();
|
|
189
|
-
},
|
|
190
|
-
async close() {
|
|
191
|
-
for (const controller of controllers)
|
|
192
|
-
controller.abort();
|
|
193
|
-
await new Promise((resolve, reject) => {
|
|
194
|
-
server.close((error) => error ? reject(error) : resolve());
|
|
195
|
-
server.closeAllConnections();
|
|
196
|
-
});
|
|
197
|
-
await unlink(socketPath).catch((error) => {
|
|
198
|
-
if (!(error instanceof Error && ("code" in error) && error.code === "ENOENT"))
|
|
199
|
-
throw error;
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
// src/agent-runtime/sandbox-bubblewrap-args.ts
|
|
206
|
-
function bubblewrapArgs(input) {
|
|
207
|
-
const args = [
|
|
208
|
-
"--unshare-all",
|
|
209
|
-
"--die-with-parent",
|
|
210
|
-
"--new-session",
|
|
211
|
-
"--cap-drop",
|
|
212
|
-
"ALL",
|
|
213
|
-
"--ro-bind",
|
|
214
|
-
"/usr",
|
|
215
|
-
"/usr",
|
|
216
|
-
"--ro-bind",
|
|
217
|
-
"/lib",
|
|
218
|
-
"/lib",
|
|
219
|
-
"--ro-bind",
|
|
220
|
-
"/lib64",
|
|
221
|
-
"/lib64",
|
|
222
|
-
"--symlink",
|
|
223
|
-
"usr/bin",
|
|
224
|
-
"/bin",
|
|
225
|
-
"--symlink",
|
|
226
|
-
"usr/sbin",
|
|
227
|
-
"/sbin",
|
|
228
|
-
"--proc",
|
|
229
|
-
"/proc",
|
|
230
|
-
"--dev",
|
|
231
|
-
"/dev",
|
|
232
|
-
"--tmpfs",
|
|
233
|
-
"/tmp",
|
|
234
|
-
"--dir",
|
|
235
|
-
"/run",
|
|
236
|
-
"--bind",
|
|
237
|
-
input.workspace,
|
|
238
|
-
"/workspace",
|
|
239
|
-
"--ro-bind",
|
|
240
|
-
input.socket,
|
|
241
|
-
"/run/stitchkit-network.sock",
|
|
242
|
-
"--clearenv",
|
|
243
|
-
"--setenv",
|
|
244
|
-
"PATH",
|
|
245
|
-
"/usr/bin:/bin",
|
|
246
|
-
"--setenv",
|
|
247
|
-
"HOME",
|
|
248
|
-
"/workspace"
|
|
249
|
-
];
|
|
250
|
-
if (input.network === "allow-all")
|
|
251
|
-
args.push("--share-net", "--ro-bind", "/etc/resolv.conf", "/etc/resolv.conf");
|
|
252
|
-
for (const [key, value] of Object.entries(input.command.environment ?? {}))
|
|
253
|
-
args.push("--setenv", key, value);
|
|
254
|
-
args.push("--chdir", input.command.cwd ?? "/workspace", "--", input.command.executable, ...input.command.args ?? []);
|
|
255
|
-
return args;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
// src/agent-runtime/sandbox-bubblewrap-storage.ts
|
|
259
|
-
import { createHash, randomUUID } from "node:crypto";
|
|
260
|
-
import { cp, mkdir, open, readFile, rename, rm, writeFile } from "node:fs/promises";
|
|
261
|
-
import { dirname, join } from "node:path";
|
|
262
|
-
import { z as z2 } from "zod";
|
|
263
|
-
|
|
264
|
-
// src/agent-runtime/sandbox-session.ts
|
|
265
|
-
import { posix } from "node:path";
|
|
266
|
-
function sandboxPath(path) {
|
|
267
|
-
const relative = path.startsWith("/workspace/") ? path.slice(11) : path;
|
|
268
|
-
if (path === "/workspace" || path === ".")
|
|
269
|
-
return "/workspace";
|
|
270
|
-
if (!relative || relative.startsWith("/") || relative.includes("\\") || relative.includes("\x00") || relative.split("/").some((part) => part === ".." || part === "" || part === ".")) {
|
|
271
|
-
throw new SandboxError("SANDBOX_PATH", "Expected a canonical workspace-relative path");
|
|
272
|
-
}
|
|
273
|
-
return posix.join("/workspace", relative);
|
|
274
|
-
}
|
|
275
|
-
function createSandboxSession(id, driver, brokerSocket) {
|
|
276
|
-
const spawn = (command, options) => {
|
|
277
|
-
const parsed = SandboxCommandSchema.parse(command);
|
|
278
|
-
return driver.spawn({ ...parsed, cwd: sandboxPath(parsed.cwd ?? ".") }, options);
|
|
279
|
-
};
|
|
280
|
-
return {
|
|
281
|
-
id,
|
|
282
|
-
...brokerSocket && { brokerSocket },
|
|
283
|
-
resolvePath: sandboxPath,
|
|
284
|
-
readBinaryFile: (path) => driver.read(sandboxPath(path)),
|
|
285
|
-
readTextFile: async (path) => new TextDecoder("utf-8", { fatal: true }).decode(await driver.read(sandboxPath(path))),
|
|
286
|
-
writeBinaryFile: (path, bytes) => driver.write(sandboxPath(path), bytes),
|
|
287
|
-
writeTextFile: (path, text) => driver.write(sandboxPath(path), new TextEncoder().encode(text)),
|
|
288
|
-
removePath: (path) => {
|
|
289
|
-
const resolved = sandboxPath(path);
|
|
290
|
-
if (resolved === "/workspace")
|
|
291
|
-
throw new SandboxError("SANDBOX_PATH", "Cannot remove the workspace root");
|
|
292
|
-
return driver.remove(resolved);
|
|
293
|
-
},
|
|
294
|
-
spawn,
|
|
295
|
-
async run(command, options) {
|
|
296
|
-
const result = await (await spawn(command, options)).result;
|
|
297
|
-
return {
|
|
298
|
-
exitCode: result.exitCode,
|
|
299
|
-
stdout: new TextDecoder().decode(result.stdout),
|
|
300
|
-
stderr: new TextDecoder().decode(result.stderr)
|
|
301
|
-
};
|
|
302
|
-
},
|
|
303
|
-
setNetworkPolicy: (policy) => driver.setNetworkPolicy(SandboxNetworkPolicySchema.parse(policy))
|
|
304
|
-
};
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
// src/agent-runtime/sandbox-bubblewrap-storage.ts
|
|
308
|
-
var Key = z2.string().regex(/^[a-f0-9]{64}$/);
|
|
309
|
-
var digest = (value) => createHash("sha256").update(value).digest("hex");
|
|
310
|
-
function sandboxStorage(root, name) {
|
|
311
|
-
const base = join(root, digest(name));
|
|
312
|
-
async function prewarm(input) {
|
|
313
|
-
const files = Object.entries(input.files ?? {}).map(([path, bytes]) => [path, Uint8Array.from(bytes)]).sort(([a], [b]) => a.localeCompare(b));
|
|
314
|
-
const key = digest(JSON.stringify([
|
|
315
|
-
name,
|
|
316
|
-
input.template,
|
|
317
|
-
files.map(([path, bytes]) => [
|
|
318
|
-
sandboxPath(path),
|
|
319
|
-
createHash("sha256").update(bytes).digest("hex")
|
|
320
|
-
])
|
|
321
|
-
]));
|
|
322
|
-
const directory = join(base, "templates", key);
|
|
323
|
-
await mkdir(join(base, "templates"), { recursive: true, mode: 448 });
|
|
324
|
-
try {
|
|
325
|
-
await readFile(join(directory, "ready"));
|
|
326
|
-
return { reused: true, templateKey: key };
|
|
327
|
-
} catch (error) {
|
|
328
|
-
if (!missing(error))
|
|
329
|
-
throw error;
|
|
330
|
-
}
|
|
331
|
-
const temporary = join(base, "templates", randomUUID());
|
|
332
|
-
await mkdir(join(temporary, "data"), { recursive: true, mode: 448 });
|
|
333
|
-
try {
|
|
334
|
-
for (const [path, bytes] of files) {
|
|
335
|
-
const resolved = sandboxPath(path);
|
|
336
|
-
if (resolved === "/workspace")
|
|
337
|
-
throw new SandboxError("SANDBOX_PATH", "Template file cannot be the workspace root");
|
|
338
|
-
const target = join(temporary, "data", resolved.slice(11));
|
|
339
|
-
await mkdir(dirname(target), { recursive: true, mode: 448 });
|
|
340
|
-
await writeFile(target, bytes, { flag: "wx", mode: 384 });
|
|
341
|
-
}
|
|
342
|
-
await writeFile(join(temporary, "ready"), JSON.stringify({ backend: name, templateKey: key }));
|
|
343
|
-
try {
|
|
344
|
-
await rename(temporary, directory);
|
|
345
|
-
} catch (error) {
|
|
346
|
-
if (!(error instanceof Error && ("code" in error) && ["EEXIST", "ENOTEMPTY"].includes(String(error.code))))
|
|
347
|
-
throw error;
|
|
348
|
-
}
|
|
349
|
-
return { reused: false, templateKey: key };
|
|
350
|
-
} finally {
|
|
351
|
-
await rm(temporary, { recursive: true, force: true });
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
async function acquire(id) {
|
|
355
|
-
const directory = join(base, "sessions", Key.parse(id));
|
|
356
|
-
await mkdir(directory, { recursive: true, mode: 448 });
|
|
357
|
-
try {
|
|
358
|
-
const lease = await open(join(directory, "lease"), "wx", 384);
|
|
359
|
-
try {
|
|
360
|
-
await lease.writeFile(String(process.pid));
|
|
361
|
-
} catch (error) {
|
|
362
|
-
await rm(join(directory, "lease"), { force: true });
|
|
363
|
-
throw error;
|
|
364
|
-
} finally {
|
|
365
|
-
await lease.close();
|
|
366
|
-
}
|
|
367
|
-
} catch (error) {
|
|
368
|
-
if (error instanceof Error && "code" in error && error.code === "EEXIST")
|
|
369
|
-
throw new SandboxError("SANDBOX_BUSY", "Sandbox session already has an owner");
|
|
370
|
-
throw error;
|
|
371
|
-
}
|
|
372
|
-
return { directory, release: () => rm(join(directory, "lease"), { force: true }) };
|
|
373
|
-
}
|
|
374
|
-
async function create(template, saved) {
|
|
375
|
-
Key.parse(template);
|
|
376
|
-
if (saved && (saved.backend !== name || saved.templateKey !== template))
|
|
377
|
-
throw new SandboxError("SANDBOX_STATE_MISMATCH", "Reconnect state does not match backend and template");
|
|
378
|
-
const templateDirectory = join(base, "templates", template);
|
|
379
|
-
const record = z2.object({ backend: z2.string(), templateKey: z2.string() }).parse(JSON.parse(await readFile(join(templateDirectory, "ready"), "utf8")));
|
|
380
|
-
if (record.backend !== name || record.templateKey !== template)
|
|
381
|
-
throw new SandboxError("SANDBOX_STATE_MISMATCH", "Template belongs to another backend");
|
|
382
|
-
const state = saved ? SandboxStateSchema.parse(saved) : { backend: name, sessionId: digest(randomUUID()), templateKey: template };
|
|
383
|
-
if (state.backend !== name || state.templateKey !== template)
|
|
384
|
-
throw new SandboxError("SANDBOX_STATE_MISMATCH", "Reconnect state does not match backend and template");
|
|
385
|
-
const lease = await acquire(state.sessionId);
|
|
386
|
-
try {
|
|
387
|
-
const statePath = join(lease.directory, "state.json");
|
|
388
|
-
if (saved) {
|
|
389
|
-
const existing = SandboxStateSchema.parse(JSON.parse(await readFile(statePath, "utf8")));
|
|
390
|
-
if (JSON.stringify(existing) !== JSON.stringify(state))
|
|
391
|
-
throw new SandboxError("SANDBOX_STATE_MISMATCH", "Reconnect identity does not match saved session");
|
|
392
|
-
} else {
|
|
393
|
-
await cp(join(templateDirectory, "data"), join(lease.directory, "workspace"), {
|
|
394
|
-
recursive: true
|
|
395
|
-
});
|
|
396
|
-
await writeFile(statePath, JSON.stringify(state), { flag: "wx", mode: 384 });
|
|
397
|
-
}
|
|
398
|
-
return { ...lease, workspace: join(lease.directory, "workspace"), state };
|
|
399
|
-
} catch (error) {
|
|
400
|
-
try {
|
|
401
|
-
if (!saved)
|
|
402
|
-
await rm(lease.directory, { recursive: true, force: true });
|
|
403
|
-
} finally {
|
|
404
|
-
await lease.release();
|
|
405
|
-
}
|
|
406
|
-
throw error;
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
return { prewarm, create, acquire };
|
|
410
|
-
}
|
|
411
|
-
function missing(error) {
|
|
412
|
-
return error instanceof Error && "code" in error && error.code === "ENOENT";
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
// src/agent-runtime/sandbox-coding.ts
|
|
416
|
-
import { relative, sep } from "node:path";
|
|
417
|
-
function sandboxCommandCwd(root, cwd) {
|
|
418
|
-
const path = relative(root, cwd).split(sep).join("/");
|
|
419
|
-
return sandboxPath(path || ".");
|
|
420
|
-
}
|
|
421
|
-
function createSandboxCodingTools(handle, config) {
|
|
422
|
-
const binding = handle.coding;
|
|
423
|
-
if (!binding)
|
|
424
|
-
throw new SandboxError("SANDBOX_UNAVAILABLE", "Backend does not expose a host coding workspace");
|
|
425
|
-
binding.assertActive();
|
|
426
|
-
const assertToolActive = () => {
|
|
427
|
-
try {
|
|
428
|
-
binding.assertActive();
|
|
429
|
-
} catch (error) {
|
|
430
|
-
if (error instanceof SandboxError)
|
|
431
|
-
codingRefusal("SANDBOX_UNAVAILABLE", "Sandbox session cannot execute this operation", {
|
|
432
|
-
details: { reason: error.code }
|
|
433
|
-
});
|
|
434
|
-
throw error;
|
|
435
|
-
}
|
|
436
|
-
};
|
|
437
|
-
const { requiredRestrictions, ...options } = config;
|
|
438
|
-
return createAgentCodingTools({
|
|
439
|
-
...options,
|
|
440
|
-
root: binding.root,
|
|
441
|
-
sandbox: {
|
|
442
|
-
adapter: binding.adapter,
|
|
443
|
-
required: requiredRestrictions ?? [
|
|
444
|
-
"write-contained",
|
|
445
|
-
"process-contained",
|
|
446
|
-
"secrets-hidden"
|
|
447
|
-
]
|
|
448
|
-
},
|
|
449
|
-
authorize(input) {
|
|
450
|
-
assertToolActive();
|
|
451
|
-
return options.authorize(input);
|
|
452
|
-
},
|
|
453
|
-
authorizePath(input) {
|
|
454
|
-
assertToolActive();
|
|
455
|
-
return options.authorizePath?.(input) ?? true;
|
|
456
|
-
}
|
|
457
|
-
});
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
// src/agent-runtime/sandbox-coding-adapter.ts
|
|
461
|
-
function createSandboxCodingAdapter(input) {
|
|
462
|
-
const { workspace, socket, executable, getPolicy, processes, assertActive } = input;
|
|
463
|
-
let policyRevision = 0;
|
|
464
|
-
const preparations = new WeakMap;
|
|
465
|
-
const grade = () => ({
|
|
466
|
-
grade: "full",
|
|
467
|
-
restrictions: getPolicy() === "deny-all" ? ["network-denied", "write-contained", "secrets-hidden", "process-contained"] : ["write-contained", "secrets-hidden", "process-contained"]
|
|
468
|
-
});
|
|
469
|
-
const adapter = {
|
|
470
|
-
probe: grade,
|
|
471
|
-
prepare(command) {
|
|
472
|
-
assertActive();
|
|
473
|
-
if (missingSandboxRestrictions(grade(), command.required ?? []).length)
|
|
474
|
-
throw new SandboxError("SANDBOX_NETWORK_DENIED", "Sandbox policy no longer satisfies required restrictions");
|
|
475
|
-
const environment = {};
|
|
476
|
-
preparations.set(environment, policyRevision);
|
|
477
|
-
return {
|
|
478
|
-
executable,
|
|
479
|
-
args: bubblewrapArgs({
|
|
480
|
-
workspace,
|
|
481
|
-
socket,
|
|
482
|
-
network: getPolicy(),
|
|
483
|
-
command: {
|
|
484
|
-
executable: command.executable,
|
|
485
|
-
args: [...command.args],
|
|
486
|
-
cwd: sandboxCommandCwd(workspace, command.cwd),
|
|
487
|
-
environment: { ...command.environment }
|
|
488
|
-
}
|
|
489
|
-
}),
|
|
490
|
-
environment
|
|
491
|
-
};
|
|
492
|
-
},
|
|
493
|
-
spawn(command) {
|
|
494
|
-
assertActive();
|
|
495
|
-
if (preparations.get(command.environment) !== policyRevision)
|
|
496
|
-
throw new SandboxError("SANDBOX_BUSY", "Sandbox policy changed after command preparation");
|
|
497
|
-
preparations.delete(command.environment);
|
|
498
|
-
return processes.spawn(command);
|
|
499
|
-
}
|
|
500
|
-
};
|
|
501
|
-
return {
|
|
502
|
-
adapter,
|
|
503
|
-
async refresh() {
|
|
504
|
-
policyRevision++;
|
|
505
|
-
await probeAgentProcessSandbox(adapter, { refresh: true });
|
|
506
|
-
}
|
|
507
|
-
};
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
// src/agent-runtime/sandbox-process.ts
|
|
511
|
-
import { spawn } from "node:child_process";
|
|
512
|
-
function spawnSandboxProcess(executable, args, limits, options = {}, onSpawn) {
|
|
513
|
-
options.signal?.throwIfAborted();
|
|
514
|
-
const child = spawn(executable, args, {
|
|
515
|
-
env: {},
|
|
516
|
-
detached: true,
|
|
517
|
-
stdio: ["pipe", "pipe", "pipe"]
|
|
518
|
-
});
|
|
519
|
-
onSpawn?.(child);
|
|
520
|
-
const stdout = [];
|
|
521
|
-
const stderr = [];
|
|
522
|
-
let bytes = 0;
|
|
523
|
-
let failure;
|
|
524
|
-
let finished = false;
|
|
525
|
-
const kill = () => {
|
|
526
|
-
if (finished || child.pid === undefined)
|
|
527
|
-
return;
|
|
528
|
-
try {
|
|
529
|
-
process.kill(-child.pid, "SIGKILL");
|
|
530
|
-
} catch (error) {
|
|
531
|
-
if (!(error instanceof Error && ("code" in error) && error.code === "ESRCH"))
|
|
532
|
-
failure ??= error;
|
|
533
|
-
}
|
|
534
|
-
};
|
|
535
|
-
const abort = () => {
|
|
536
|
-
failure ??= options.signal?.reason ?? new Error("Sandbox command aborted");
|
|
537
|
-
kill();
|
|
538
|
-
};
|
|
539
|
-
const timer = setTimeout(() => {
|
|
540
|
-
failure ??= new SandboxError("SANDBOX_LIMIT", "Sandbox command deadline exceeded");
|
|
541
|
-
kill();
|
|
542
|
-
}, limits.timeoutMs);
|
|
543
|
-
timer.unref();
|
|
544
|
-
const result = new Promise((resolve, reject) => {
|
|
545
|
-
const collect = (target) => (chunk) => {
|
|
546
|
-
bytes += chunk.byteLength;
|
|
547
|
-
if (bytes > limits.maxOutputBytes) {
|
|
548
|
-
failure ??= new SandboxError("SANDBOX_LIMIT", "Sandbox output limit exceeded");
|
|
549
|
-
kill();
|
|
550
|
-
} else
|
|
551
|
-
target.push(chunk);
|
|
552
|
-
};
|
|
553
|
-
child.stdout.on("data", collect(stdout));
|
|
554
|
-
child.stderr.on("data", collect(stderr));
|
|
555
|
-
child.on("error", (error) => {
|
|
556
|
-
failure ??= new SandboxError("SANDBOX_UNAVAILABLE", "Sandbox process could not start", { cause: error });
|
|
557
|
-
});
|
|
558
|
-
child.stdin.on("error", (error) => {
|
|
559
|
-
if (!(("code" in error) && error.code === "EPIPE")) {
|
|
560
|
-
failure ??= error;
|
|
561
|
-
kill();
|
|
562
|
-
}
|
|
563
|
-
});
|
|
564
|
-
child.on("close", (code) => {
|
|
565
|
-
finished = true;
|
|
566
|
-
clearTimeout(timer);
|
|
567
|
-
options.signal?.removeEventListener("abort", abort);
|
|
568
|
-
if (failure !== undefined)
|
|
569
|
-
reject(failure);
|
|
570
|
-
else
|
|
571
|
-
resolve({
|
|
572
|
-
exitCode: code ?? 137,
|
|
573
|
-
stdout: Buffer.concat(stdout),
|
|
574
|
-
stderr: Buffer.concat(stderr)
|
|
575
|
-
});
|
|
576
|
-
});
|
|
577
|
-
});
|
|
578
|
-
result.catch(() => {
|
|
579
|
-
return;
|
|
580
|
-
});
|
|
581
|
-
options.signal?.addEventListener("abort", abort, { once: true });
|
|
582
|
-
if (options.signal?.aborted)
|
|
583
|
-
abort();
|
|
584
|
-
child.stdin.end(options.stdin);
|
|
585
|
-
return {
|
|
586
|
-
result,
|
|
587
|
-
async stop() {
|
|
588
|
-
kill();
|
|
589
|
-
await result.then(() => {
|
|
590
|
-
return;
|
|
591
|
-
}, () => {
|
|
592
|
-
return;
|
|
593
|
-
});
|
|
594
|
-
}
|
|
595
|
-
};
|
|
596
|
-
}
|
|
597
|
-
|
|
598
|
-
// src/agent-runtime/sandbox-process-owner.ts
|
|
599
|
-
import { spawn as spawn2 } from "node:child_process";
|
|
600
|
-
function sandboxProcessOwner(assertActive, maximum) {
|
|
601
|
-
const children = new Map;
|
|
602
|
-
const admit = () => {
|
|
603
|
-
assertActive();
|
|
604
|
-
if (children.size >= maximum)
|
|
605
|
-
throw new SandboxError("SANDBOX_BUSY", "Sandbox command concurrency limit reached");
|
|
606
|
-
};
|
|
607
|
-
const track = (child) => {
|
|
608
|
-
const closed = new Promise((resolve) => {
|
|
609
|
-
child.once("close", () => {
|
|
610
|
-
children.delete(child);
|
|
611
|
-
resolve();
|
|
612
|
-
});
|
|
613
|
-
});
|
|
614
|
-
children.set(child, closed);
|
|
615
|
-
};
|
|
616
|
-
return {
|
|
617
|
-
admit,
|
|
618
|
-
track,
|
|
619
|
-
get size() {
|
|
620
|
-
return children.size;
|
|
621
|
-
},
|
|
622
|
-
spawn(input) {
|
|
623
|
-
admit();
|
|
624
|
-
const child = spawn2(input.executable, [...input.args], {
|
|
625
|
-
cwd: input.cwd,
|
|
626
|
-
env: input.environment,
|
|
627
|
-
detached: true,
|
|
628
|
-
stdio: ["pipe", "pipe", "pipe"]
|
|
629
|
-
});
|
|
630
|
-
child.stdin.end();
|
|
631
|
-
track(child);
|
|
632
|
-
return child;
|
|
633
|
-
},
|
|
634
|
-
async stop() {
|
|
635
|
-
const pending = [...children];
|
|
636
|
-
for (const [child] of pending) {
|
|
637
|
-
if (child.pid === undefined)
|
|
638
|
-
continue;
|
|
639
|
-
try {
|
|
640
|
-
process.kill(-child.pid, "SIGKILL");
|
|
641
|
-
} catch (error) {
|
|
642
|
-
if (!(error instanceof Error && ("code" in error) && error.code === "ESRCH"))
|
|
643
|
-
throw error;
|
|
644
|
-
}
|
|
645
|
-
}
|
|
646
|
-
await Promise.all(pending.map(([, closed]) => closed));
|
|
647
|
-
}
|
|
648
|
-
};
|
|
649
|
-
}
|
|
650
|
-
|
|
651
|
-
// src/agent-runtime/sandbox-bubblewrap.ts
|
|
652
|
-
async function createBubblewrapSandboxBackend(config) {
|
|
653
|
-
if (process.platform !== "linux")
|
|
654
|
-
throw new SandboxError("SANDBOX_UNAVAILABLE", "Bubblewrap requires Linux");
|
|
655
|
-
const executable = config.executable ?? "/usr/bin/bwrap";
|
|
656
|
-
const name = z3.string().min(1).parse(config.name ?? "bubblewrap");
|
|
657
|
-
await mkdir2(config.stateDirectory, { recursive: true, mode: 448 });
|
|
658
|
-
const root = await realpath(config.stateDirectory);
|
|
659
|
-
const storage = sandboxStorage(root, name);
|
|
660
|
-
const maximum = z3.number().int().positive().max(1024).parse(config.maxConcurrentCommands ?? 8);
|
|
661
|
-
return {
|
|
662
|
-
name,
|
|
663
|
-
prewarm: storage.prewarm,
|
|
664
|
-
async create(input) {
|
|
665
|
-
let policy = SandboxNetworkPolicySchema.parse(input.network);
|
|
666
|
-
const stored = await storage.create(input.template, input.state);
|
|
667
|
-
async function abandon() {
|
|
668
|
-
try {
|
|
669
|
-
if (!input.state)
|
|
670
|
-
await rm2(stored.directory, { recursive: true, force: true });
|
|
671
|
-
} finally {
|
|
672
|
-
await stored.release();
|
|
673
|
-
}
|
|
674
|
-
}
|
|
675
|
-
const temporary = await mkdtemp(join2(tmpdir(), "stitchkit-sandbox-")).catch(async (error) => {
|
|
676
|
-
await abandon();
|
|
677
|
-
throw error;
|
|
678
|
-
});
|
|
679
|
-
const socket = join2(temporary, "network.sock");
|
|
680
|
-
let active = true;
|
|
681
|
-
let deleted = false;
|
|
682
|
-
let stopPending;
|
|
683
|
-
const broker = await createSandboxBroker(socket, () => policy, config.onBrokerError).catch(async (error) => {
|
|
684
|
-
await abandon();
|
|
685
|
-
await rm2(temporary, { recursive: true, force: true });
|
|
686
|
-
throw error;
|
|
687
|
-
});
|
|
688
|
-
const assertActive = () => {
|
|
689
|
-
if (!active)
|
|
690
|
-
throw new SandboxError("SANDBOX_STOPPED", "Sandbox session is stopped");
|
|
691
|
-
};
|
|
692
|
-
const processes = sandboxProcessOwner(assertActive, maximum);
|
|
693
|
-
const coding = createSandboxCodingAdapter({
|
|
694
|
-
workspace: stored.workspace,
|
|
695
|
-
socket,
|
|
696
|
-
executable,
|
|
697
|
-
getPolicy: () => policy,
|
|
698
|
-
processes,
|
|
699
|
-
assertActive
|
|
700
|
-
});
|
|
701
|
-
const driver = {
|
|
702
|
-
async spawn(command, options) {
|
|
703
|
-
processes.admit();
|
|
704
|
-
const process2 = spawnSandboxProcess(executable, bubblewrapArgs({ workspace: stored.workspace, socket, command, network: policy }), {
|
|
705
|
-
timeoutMs: command.timeoutMs ?? 30000,
|
|
706
|
-
maxOutputBytes: command.maxOutputBytes ?? 1048576
|
|
707
|
-
}, options, processes.track);
|
|
708
|
-
return process2;
|
|
709
|
-
},
|
|
710
|
-
async read(path) {
|
|
711
|
-
return (await execute("/usr/bin/cat", ["--", path])).stdout;
|
|
712
|
-
},
|
|
713
|
-
async write(path, bytes) {
|
|
714
|
-
if (bytes.byteLength > 1048576)
|
|
715
|
-
throw new SandboxError("SANDBOX_LIMIT", "Sandbox file write limit exceeded");
|
|
716
|
-
await execute("/usr/bin/mkdir", ["-p", "--", posix2.dirname(path)]);
|
|
717
|
-
await execute("/usr/bin/tee", ["--", path], bytes);
|
|
718
|
-
},
|
|
719
|
-
async remove(path) {
|
|
720
|
-
await execute("/usr/bin/rm", ["-rf", "--", path]);
|
|
721
|
-
},
|
|
722
|
-
async setNetworkPolicy(next) {
|
|
723
|
-
assertActive();
|
|
724
|
-
if (processes.size)
|
|
725
|
-
throw new SandboxError("SANDBOX_BUSY", "Stop live commands before changing network policy");
|
|
726
|
-
broker.abortRequests();
|
|
727
|
-
policy = SandboxNetworkPolicySchema.parse(next);
|
|
728
|
-
await coding.refresh();
|
|
729
|
-
}
|
|
730
|
-
};
|
|
731
|
-
async function execute(binary, args, stdin) {
|
|
732
|
-
const result = await (await driver.spawn({ executable: binary, args }, { stdin })).result;
|
|
733
|
-
if (result.exitCode !== 0)
|
|
734
|
-
throw new SandboxError("SANDBOX_UNAVAILABLE", "Sandbox file operation failed");
|
|
735
|
-
return result;
|
|
736
|
-
}
|
|
737
|
-
function stop() {
|
|
738
|
-
if (stopPending)
|
|
739
|
-
return stopPending;
|
|
740
|
-
active = false;
|
|
741
|
-
stopPending = (async () => {
|
|
742
|
-
await processes.stop();
|
|
743
|
-
try {
|
|
744
|
-
await broker.close();
|
|
745
|
-
} finally {
|
|
746
|
-
try {
|
|
747
|
-
await rm2(temporary, { recursive: true, force: true });
|
|
748
|
-
} finally {
|
|
749
|
-
await stored.release();
|
|
750
|
-
}
|
|
751
|
-
}
|
|
752
|
-
})();
|
|
753
|
-
return stopPending;
|
|
754
|
-
}
|
|
755
|
-
try {
|
|
756
|
-
await execute("/usr/bin/true", []);
|
|
757
|
-
} catch (error) {
|
|
758
|
-
await stop();
|
|
759
|
-
if (!input.state)
|
|
760
|
-
await rm2(stored.directory, { recursive: true, force: true });
|
|
761
|
-
throw new SandboxError("SANDBOX_UNAVAILABLE", "Bubblewrap could not establish isolation", { cause: error });
|
|
762
|
-
}
|
|
763
|
-
return {
|
|
764
|
-
coding: { root: stored.workspace, adapter: coding.adapter, assertActive },
|
|
765
|
-
session: createSandboxSession(stored.state.sessionId, driver, "/run/stitchkit-network.sock"),
|
|
766
|
-
captureState() {
|
|
767
|
-
if (deleted)
|
|
768
|
-
throw new SandboxError("SANDBOX_STOPPED", "Sandbox session is deleted");
|
|
769
|
-
return { ...stored.state };
|
|
770
|
-
},
|
|
771
|
-
stop,
|
|
772
|
-
shutdown: stop,
|
|
773
|
-
async delete() {
|
|
774
|
-
if (deleted)
|
|
775
|
-
return;
|
|
776
|
-
await stop();
|
|
777
|
-
const lease = await storage.acquire(stored.state.sessionId);
|
|
778
|
-
try {
|
|
779
|
-
await rm2(lease.directory, { recursive: true, force: true });
|
|
780
|
-
deleted = true;
|
|
781
|
-
} catch (error) {
|
|
782
|
-
await lease.release();
|
|
783
|
-
throw error;
|
|
784
|
-
}
|
|
785
|
-
}
|
|
786
|
-
};
|
|
787
|
-
}
|
|
788
|
-
};
|
|
789
|
-
}
|
|
790
|
-
export {
|
|
791
|
-
createSandboxSession,
|
|
792
|
-
createSandboxCodingTools,
|
|
793
|
-
createBubblewrapSandboxBackend,
|
|
794
|
-
SandboxStateSchema,
|
|
795
|
-
SandboxNetworkPolicySchema,
|
|
796
|
-
SandboxError,
|
|
797
|
-
SandboxCommandSchema
|
|
798
|
-
};
|