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
|
@@ -0,0 +1,1387 @@
|
|
|
1
|
+
import {
|
|
2
|
+
NumericFileHandle,
|
|
3
|
+
assertContainedFileCurrent,
|
|
4
|
+
assertContainedParentCurrent,
|
|
5
|
+
containedEntryMetadata,
|
|
6
|
+
descriptorPath,
|
|
7
|
+
listContainedDirectory,
|
|
8
|
+
loadDarwinBinding,
|
|
9
|
+
missingContainedDirectories,
|
|
10
|
+
openContainedFile,
|
|
11
|
+
openContainedParent,
|
|
12
|
+
openContainedParentFile,
|
|
13
|
+
readContainedUtf8Handle,
|
|
14
|
+
scanContainedFiles
|
|
15
|
+
} from "./index-px2gm2jp.js";
|
|
16
|
+
import {
|
|
17
|
+
codingPathRefusal,
|
|
18
|
+
codingRefusal,
|
|
19
|
+
missingSandboxRestrictions,
|
|
20
|
+
probeAgentProcessSandbox,
|
|
21
|
+
refuseMissingCodingPath
|
|
22
|
+
} from "./index-qmy6zq75.js";
|
|
23
|
+
import {
|
|
24
|
+
defineRuntimeTool
|
|
25
|
+
} from "./index-xw3s75nj.js";
|
|
26
|
+
import {
|
|
27
|
+
conflict,
|
|
28
|
+
forbidden
|
|
29
|
+
} from "./index-2vtcmrj9.js";
|
|
30
|
+
|
|
31
|
+
// src/agent-runtime/coding-tool-contract.ts
|
|
32
|
+
import { z } from "zod";
|
|
33
|
+
var AgentCodingToolLimitsSchema = z.object({
|
|
34
|
+
maxPathBytes: z.int().positive(),
|
|
35
|
+
maxReadBytes: z.int().positive(),
|
|
36
|
+
maxWriteBytes: z.int().positive(),
|
|
37
|
+
maxShellArguments: z.int().positive(),
|
|
38
|
+
maxShellArgumentBytes: z.int().positive(),
|
|
39
|
+
maxShellOutputBytes: z.int().positive(),
|
|
40
|
+
maxArtifactBytes: z.int().positive(),
|
|
41
|
+
maxListEntries: z.int().positive(),
|
|
42
|
+
maxSearchResults: z.int().positive(),
|
|
43
|
+
maxSearchFiles: z.int().positive(),
|
|
44
|
+
maxSearchDepth: z.int().nonnegative(),
|
|
45
|
+
shellTimeoutMs: z.int().positive(),
|
|
46
|
+
shellTerminationGraceMs: z.int().positive()
|
|
47
|
+
}).strict();
|
|
48
|
+
var AgentCodingToolAuthorizationSchema = z.discriminatedUnion("operation", [
|
|
49
|
+
z.object({ operation: z.literal("read"), path: z.string().min(1) }).strict(),
|
|
50
|
+
z.object({
|
|
51
|
+
operation: z.literal("write"),
|
|
52
|
+
path: z.string().min(1),
|
|
53
|
+
bytes: z.int().nonnegative(),
|
|
54
|
+
overwrite: z.boolean(),
|
|
55
|
+
createsDirectories: z.array(z.string().min(1))
|
|
56
|
+
}).strict(),
|
|
57
|
+
z.object({
|
|
58
|
+
operation: z.literal("search"),
|
|
59
|
+
query: z.string().min(1),
|
|
60
|
+
mode: z.enum(["path", "content"])
|
|
61
|
+
}).strict(),
|
|
62
|
+
z.object({
|
|
63
|
+
operation: z.literal("edit"),
|
|
64
|
+
path: z.string().min(1),
|
|
65
|
+
baseSha256: z.string().length(64),
|
|
66
|
+
resultSha256: z.string().length(64),
|
|
67
|
+
resultBytes: z.int().nonnegative(),
|
|
68
|
+
replacements: z.int().positive(),
|
|
69
|
+
dryRun: z.boolean()
|
|
70
|
+
}).strict(),
|
|
71
|
+
z.object({ operation: z.literal("list"), path: z.string().min(1) }).strict(),
|
|
72
|
+
z.object({
|
|
73
|
+
operation: z.literal("glob"),
|
|
74
|
+
pattern: z.string().min(1),
|
|
75
|
+
path: z.string().min(1)
|
|
76
|
+
}).strict(),
|
|
77
|
+
z.object({
|
|
78
|
+
operation: z.literal("artifact-read"),
|
|
79
|
+
reference: z.string().min(1),
|
|
80
|
+
offset: z.int().nonnegative(),
|
|
81
|
+
maxBytes: z.int().positive()
|
|
82
|
+
}).strict(),
|
|
83
|
+
z.object({
|
|
84
|
+
operation: z.literal("artifact-search"),
|
|
85
|
+
reference: z.string().min(1),
|
|
86
|
+
query: z.string().min(1),
|
|
87
|
+
maxMatches: z.int().positive()
|
|
88
|
+
}).strict(),
|
|
89
|
+
z.object({
|
|
90
|
+
operation: z.literal("shell"),
|
|
91
|
+
executable: z.string().min(1),
|
|
92
|
+
args: z.array(z.string()),
|
|
93
|
+
cwd: z.string().min(1)
|
|
94
|
+
}).strict()
|
|
95
|
+
]);
|
|
96
|
+
var AgentCodingToolPathAuthorizationSchema = z.object({ path: z.string().min(1) }).strict();
|
|
97
|
+
var CodingDeniedEntrySchema = z.object({
|
|
98
|
+
path: z.string().min(1),
|
|
99
|
+
kind: z.enum(["file", "directory", "symlink", "other"])
|
|
100
|
+
}).strict();
|
|
101
|
+
var FileReadInputSchema = z.object({
|
|
102
|
+
path: z.string().min(1),
|
|
103
|
+
offset: z.int().nonnegative().default(0),
|
|
104
|
+
maxBytes: z.int().positive().optional()
|
|
105
|
+
}).strict();
|
|
106
|
+
var FileReadOutputSchema = z.object({
|
|
107
|
+
path: z.string().min(1),
|
|
108
|
+
text: z.string(),
|
|
109
|
+
bytes: z.int().nonnegative(),
|
|
110
|
+
sha256: z.string().length(64),
|
|
111
|
+
truncated: z.boolean(),
|
|
112
|
+
nextOffset: z.int().nonnegative().optional()
|
|
113
|
+
}).strict();
|
|
114
|
+
var FileWriteInputSchema = z.object({
|
|
115
|
+
path: z.string().min(1),
|
|
116
|
+
content: z.string(),
|
|
117
|
+
overwrite: z.boolean().default(false)
|
|
118
|
+
}).strict();
|
|
119
|
+
var FileWriteOutputSchema = z.object({
|
|
120
|
+
path: z.string().min(1),
|
|
121
|
+
bytes: z.int().nonnegative(),
|
|
122
|
+
createdDirectories: z.array(z.string().min(1))
|
|
123
|
+
}).strict();
|
|
124
|
+
function createShellInputSchema(executableNames) {
|
|
125
|
+
if (executableNames.length === 0) {
|
|
126
|
+
throw new Error("A command tool requires at least one executable alias");
|
|
127
|
+
}
|
|
128
|
+
return z.object({
|
|
129
|
+
executable: z.enum(executableNames),
|
|
130
|
+
args: z.array(z.string()).default([]),
|
|
131
|
+
cwd: z.string().min(1).default(".")
|
|
132
|
+
}).strict();
|
|
133
|
+
}
|
|
134
|
+
var ShellInputSchema = z.object({
|
|
135
|
+
executable: z.string().min(1),
|
|
136
|
+
args: z.array(z.string()).default([]),
|
|
137
|
+
cwd: z.string().min(1).default(".")
|
|
138
|
+
}).strict();
|
|
139
|
+
var ShellOutputSchema = z.object({
|
|
140
|
+
executable: z.string().min(1),
|
|
141
|
+
exitCode: z.int().nullable(),
|
|
142
|
+
signal: z.string().nullable(),
|
|
143
|
+
stdout: z.string(),
|
|
144
|
+
stderr: z.string(),
|
|
145
|
+
outcome: z.enum(["exited", "timeout", "output-limit", "cancelled"]),
|
|
146
|
+
artifact: z.object({
|
|
147
|
+
reference: z.string().min(1),
|
|
148
|
+
bytes: z.int().nonnegative(),
|
|
149
|
+
truncated: z.boolean(),
|
|
150
|
+
headBytes: z.int().nonnegative(),
|
|
151
|
+
tailBytes: z.int().nonnegative(),
|
|
152
|
+
omittedBytes: z.int().nonnegative()
|
|
153
|
+
}).strict().optional()
|
|
154
|
+
}).strict();
|
|
155
|
+
var DEFAULT_LIMITS = {
|
|
156
|
+
maxPathBytes: 4096,
|
|
157
|
+
maxReadBytes: 262144,
|
|
158
|
+
maxWriteBytes: 262144,
|
|
159
|
+
maxShellArguments: 128,
|
|
160
|
+
maxShellArgumentBytes: 65536,
|
|
161
|
+
maxShellOutputBytes: 262144,
|
|
162
|
+
maxArtifactBytes: 4194304,
|
|
163
|
+
maxListEntries: 500,
|
|
164
|
+
maxSearchResults: 100,
|
|
165
|
+
maxSearchFiles: 1e4,
|
|
166
|
+
maxSearchDepth: 32,
|
|
167
|
+
shellTimeoutMs: 30000,
|
|
168
|
+
shellTerminationGraceMs: 250
|
|
169
|
+
};
|
|
170
|
+
function resolveCodingToolLimits(input) {
|
|
171
|
+
return AgentCodingToolLimitsSchema.parse({ ...DEFAULT_LIMITS, ...input });
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// src/agent-runtime/coding-tools.ts
|
|
175
|
+
import path5 from "node:path";
|
|
176
|
+
import { z as z4 } from "zod";
|
|
177
|
+
|
|
178
|
+
// src/agent-runtime/coding-tool-files.ts
|
|
179
|
+
import { createHash } from "node:crypto";
|
|
180
|
+
import { realpath as realpath2 } from "node:fs/promises";
|
|
181
|
+
|
|
182
|
+
// src/agent-runtime/coding-tool-paths.ts
|
|
183
|
+
import { lstat, realpath } from "node:fs/promises";
|
|
184
|
+
import path from "node:path";
|
|
185
|
+
function within(root, target) {
|
|
186
|
+
const relative = path.relative(root, target);
|
|
187
|
+
return relative === "" || !relative.startsWith(`..${path.sep}`) && relative !== ".." && !path.isAbsolute(relative);
|
|
188
|
+
}
|
|
189
|
+
function inputPath(root, requested, maxPathBytes) {
|
|
190
|
+
if (new TextEncoder().encode(requested).byteLength > maxPathBytes) {
|
|
191
|
+
codingRefusal("BAD_REQUEST", `Path exceeds the ${maxPathBytes}-byte limit`, {
|
|
192
|
+
details: { maxPathBytes },
|
|
193
|
+
hint: "Use a shorter workspace-relative path."
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
if (path.isAbsolute(requested)) {
|
|
197
|
+
const relative = path.relative(root, requested);
|
|
198
|
+
const recoveryPath = within(root, requested) ? relative.split(path.sep).join("/") || "." : undefined;
|
|
199
|
+
codingRefusal("BAD_REQUEST", "Paths must be relative to the workspace root", {
|
|
200
|
+
details: { path: requested, ...recoveryPath && { recoveryPath } },
|
|
201
|
+
hint: recoveryPath ? `Use the workspace-relative path \`${recoveryPath}\`.` : "Pass a path relative to the workspace root; absolute paths outside it have no workspace-relative equivalent."
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
const resolved = path.resolve(root, requested);
|
|
205
|
+
if (!within(root, resolved)) {
|
|
206
|
+
codingRefusal("FORBIDDEN", "Path escapes the workspace root", {
|
|
207
|
+
details: { path: requested },
|
|
208
|
+
hint: "Stay inside the workspace; `..` segments that leave the root are refused."
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
return resolved;
|
|
212
|
+
}
|
|
213
|
+
function boundedCodingRelativePath(root, requested, maxPathBytes) {
|
|
214
|
+
if (path.isAbsolute(requested))
|
|
215
|
+
inputPath(root, requested, maxPathBytes);
|
|
216
|
+
if (requested.includes("\\")) {
|
|
217
|
+
codingRefusal("FORBIDDEN", "Path separators must be `/`", {
|
|
218
|
+
details: { path: requested },
|
|
219
|
+
hint: "Use `/` between segments; a backslash is refused because the workspace walk reads it as a separator."
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
const segments = requested.split("/");
|
|
223
|
+
if (segments.some((segment) => segment === "" || segment === "." || segment === "..")) {
|
|
224
|
+
codingRefusal("FORBIDDEN", "Path segments must name real entries under the root", {
|
|
225
|
+
details: { path: requested },
|
|
226
|
+
hint: "Pass a plain workspace-relative path — `.`, `..` and empty segments are refused."
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
inputPath(root, requested, maxPathBytes);
|
|
230
|
+
return requested;
|
|
231
|
+
}
|
|
232
|
+
async function existingCodingPath(root, requested, maxPathBytes) {
|
|
233
|
+
const resolved = await realpath(inputPath(root, requested, maxPathBytes));
|
|
234
|
+
if (!within(root, resolved))
|
|
235
|
+
throw new Error("Coding tool path resolves outside its root");
|
|
236
|
+
return { absolute: resolved, relative: path.relative(root, resolved) || "." };
|
|
237
|
+
}
|
|
238
|
+
async function authorizeCodingTool(config, request) {
|
|
239
|
+
const parsed = AgentCodingToolAuthorizationSchema.parse(request);
|
|
240
|
+
if (!await config.authorize(parsed))
|
|
241
|
+
forbidden("Coding tool permission denied");
|
|
242
|
+
}
|
|
243
|
+
async function isCodingPathAuthorized(config, path2) {
|
|
244
|
+
if (!config.authorizePath)
|
|
245
|
+
return true;
|
|
246
|
+
const parsed = AgentCodingToolPathAuthorizationSchema.parse({ path: path2 });
|
|
247
|
+
return await config.authorizePath(parsed);
|
|
248
|
+
}
|
|
249
|
+
async function authorizeCodingPath(config, path2) {
|
|
250
|
+
if (!await isCodingPathAuthorized(config, path2)) {
|
|
251
|
+
codingRefusal("FORBIDDEN", "Coding tool path permission denied", {
|
|
252
|
+
details: { path: path2 },
|
|
253
|
+
hint: "The host policy refused this path or a directory above it."
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
async function authorizeCodingPathChain(config, relative) {
|
|
258
|
+
if (!config.authorizePath)
|
|
259
|
+
return;
|
|
260
|
+
const segments = relative === "." ? ["."] : relative.split("/");
|
|
261
|
+
for (let depth = 1;depth <= segments.length; depth += 1) {
|
|
262
|
+
await authorizeCodingPath(config, segments.slice(0, depth).join("/"));
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
var codingPathLocks = new Map;
|
|
266
|
+
async function withCodingPathLock(target, work) {
|
|
267
|
+
const previous = codingPathLocks.get(target) ?? Promise.resolve();
|
|
268
|
+
let release = () => {
|
|
269
|
+
return;
|
|
270
|
+
};
|
|
271
|
+
const current = new Promise((resolve) => {
|
|
272
|
+
release = resolve;
|
|
273
|
+
});
|
|
274
|
+
const queued = previous.then(() => current);
|
|
275
|
+
codingPathLocks.set(target, queued);
|
|
276
|
+
await previous;
|
|
277
|
+
try {
|
|
278
|
+
return await work();
|
|
279
|
+
} finally {
|
|
280
|
+
release();
|
|
281
|
+
if (codingPathLocks.get(target) === queued)
|
|
282
|
+
codingPathLocks.delete(target);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
function textOccurrences(source, search) {
|
|
286
|
+
let count = 0;
|
|
287
|
+
let offset = 0;
|
|
288
|
+
while (offset <= source.length - search.length) {
|
|
289
|
+
const found = source.indexOf(search, offset);
|
|
290
|
+
if (found < 0)
|
|
291
|
+
break;
|
|
292
|
+
count += 1;
|
|
293
|
+
offset = found + search.length;
|
|
294
|
+
}
|
|
295
|
+
return count;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
// src/agent-runtime/coding-tool-utf8.ts
|
|
299
|
+
function sequenceLength(lead) {
|
|
300
|
+
if (lead < 128)
|
|
301
|
+
return 1;
|
|
302
|
+
if ((lead & 224) === 192)
|
|
303
|
+
return 2;
|
|
304
|
+
if ((lead & 240) === 224)
|
|
305
|
+
return 3;
|
|
306
|
+
if ((lead & 248) === 240)
|
|
307
|
+
return 4;
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
function utf8AlignedEnd(data, start, limit) {
|
|
311
|
+
const safe = Math.max(start, Math.min(start + limit, data.byteLength));
|
|
312
|
+
for (let back = 1;back <= 4 && safe - back >= start; back += 1) {
|
|
313
|
+
const byte = data[safe - back];
|
|
314
|
+
if ((byte & 192) === 128)
|
|
315
|
+
continue;
|
|
316
|
+
const length = sequenceLength(byte);
|
|
317
|
+
if (length === undefined)
|
|
318
|
+
return safe;
|
|
319
|
+
if (back >= length)
|
|
320
|
+
return safe;
|
|
321
|
+
const sequenceEnd = safe - back + length;
|
|
322
|
+
return sequenceEnd <= data.byteLength ? sequenceEnd : safe - back;
|
|
323
|
+
}
|
|
324
|
+
return safe;
|
|
325
|
+
}
|
|
326
|
+
function utf8AlignedStart(data, start, end) {
|
|
327
|
+
let safe = Math.max(0, Math.min(start, end));
|
|
328
|
+
while (safe < end && (data[safe] & 192) === 128)
|
|
329
|
+
safe += 1;
|
|
330
|
+
return safe;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
// src/agent-runtime/contained-write.ts
|
|
334
|
+
import { fchmod, write as writeDescriptor } from "node:fs";
|
|
335
|
+
import { rename, unlink, writeFile } from "node:fs/promises";
|
|
336
|
+
import path2 from "node:path";
|
|
337
|
+
async function writeDescriptorFully(descriptor, content) {
|
|
338
|
+
const bytes = Buffer.from(content);
|
|
339
|
+
let offset = 0;
|
|
340
|
+
while (offset < bytes.byteLength) {
|
|
341
|
+
const written = await new Promise((resolve, reject) => {
|
|
342
|
+
writeDescriptor(descriptor, bytes, offset, bytes.byteLength - offset, null, (error, bytesWritten) => error ? reject(error) : resolve(bytesWritten));
|
|
343
|
+
});
|
|
344
|
+
if (written === 0)
|
|
345
|
+
throw new Error("Contained file write made no progress");
|
|
346
|
+
offset += written;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
async function chmodDescriptor(descriptor, mode) {
|
|
350
|
+
await new Promise((resolve, reject) => {
|
|
351
|
+
fchmod(descriptor, mode & 4095, (error) => error ? reject(error) : resolve());
|
|
352
|
+
});
|
|
353
|
+
}
|
|
354
|
+
async function createDarwinFile(parent, name, content, mode) {
|
|
355
|
+
const binding = loadDarwinBinding();
|
|
356
|
+
const descriptor = binding.createFileAt(parent.fd, name, mode & 4095);
|
|
357
|
+
let failed;
|
|
358
|
+
try {
|
|
359
|
+
await writeDescriptorFully(descriptor, content);
|
|
360
|
+
await chmodDescriptor(descriptor, mode);
|
|
361
|
+
} catch (error) {
|
|
362
|
+
failed = error;
|
|
363
|
+
} finally {
|
|
364
|
+
try {
|
|
365
|
+
await new NumericFileHandle(descriptor).close();
|
|
366
|
+
} catch (error) {
|
|
367
|
+
failed ??= error;
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
if (failed) {
|
|
371
|
+
binding.unlinkAt(parent.fd, name);
|
|
372
|
+
throw failed;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
async function writeContainedFile(input) {
|
|
376
|
+
const mode = input.mode ?? 438;
|
|
377
|
+
if (!input.replace) {
|
|
378
|
+
if (process.platform === "darwin") {
|
|
379
|
+
await createDarwinFile(input.parent.handle, input.parent.basename, input.content, mode);
|
|
380
|
+
return;
|
|
381
|
+
}
|
|
382
|
+
await writeFile(path2.join(descriptorPath(input.parent.handle), input.parent.basename), input.content, { flag: "wx", mode });
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
385
|
+
const temporary = `.${input.parent.basename}.${process.pid}.${crypto.randomUUID()}.tmp`;
|
|
386
|
+
if (process.platform === "darwin") {
|
|
387
|
+
const binding = loadDarwinBinding();
|
|
388
|
+
let created = false;
|
|
389
|
+
try {
|
|
390
|
+
await createDarwinFile(input.parent.handle, temporary, input.content, mode);
|
|
391
|
+
created = true;
|
|
392
|
+
binding.renameAt(input.parent.handle.fd, temporary, input.parent.basename);
|
|
393
|
+
} catch (error) {
|
|
394
|
+
if (created)
|
|
395
|
+
binding.unlinkAt(input.parent.handle.fd, temporary);
|
|
396
|
+
throw error;
|
|
397
|
+
}
|
|
398
|
+
return;
|
|
399
|
+
}
|
|
400
|
+
const directory = descriptorPath(input.parent.handle);
|
|
401
|
+
const temporaryPath = path2.join(directory, temporary);
|
|
402
|
+
try {
|
|
403
|
+
await writeFile(temporaryPath, input.content, { flag: "wx", mode });
|
|
404
|
+
await rename(temporaryPath, path2.join(directory, input.parent.basename));
|
|
405
|
+
} catch (error) {
|
|
406
|
+
await unlink(temporaryPath).catch(() => {
|
|
407
|
+
return;
|
|
408
|
+
});
|
|
409
|
+
throw error;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
// src/agent-runtime/coding-tool-files.ts
|
|
414
|
+
async function digestFile(handle, size) {
|
|
415
|
+
const hash = createHash("sha256");
|
|
416
|
+
const chunk = Buffer.alloc(Math.min(64 * 1024, Math.max(1, size)));
|
|
417
|
+
for (let position = 0;position < size; ) {
|
|
418
|
+
const length = Math.min(chunk.byteLength, size - position);
|
|
419
|
+
const { bytesRead } = await handle.read(chunk, 0, length, position);
|
|
420
|
+
if (bytesRead === 0)
|
|
421
|
+
break;
|
|
422
|
+
hash.update(chunk.subarray(0, bytesRead));
|
|
423
|
+
position += bytesRead;
|
|
424
|
+
}
|
|
425
|
+
return hash.digest("hex");
|
|
426
|
+
}
|
|
427
|
+
function createFileCodingTools(config, limits) {
|
|
428
|
+
const read = defineRuntimeTool({
|
|
429
|
+
name: "read_file",
|
|
430
|
+
description: "Read a bounded UTF-8 slice from a host-authorized workspace file.",
|
|
431
|
+
identity: { serviceName: "coding", action: "read-file", method: "POST" },
|
|
432
|
+
input: FileReadInputSchema,
|
|
433
|
+
output: FileReadOutputSchema,
|
|
434
|
+
transports: ["AGENT"],
|
|
435
|
+
handler: async ({ input }) => {
|
|
436
|
+
const root = await realpath2(config.root);
|
|
437
|
+
const relative = boundedCodingRelativePath(root, input.path, limits.maxPathBytes);
|
|
438
|
+
await authorizeCodingPathChain(config, relative);
|
|
439
|
+
const handle = await openContainedFile(root, relative).catch((error) => refuseMissingCodingPath(error, relative));
|
|
440
|
+
const maximum = Math.min(input.maxBytes ?? limits.maxReadBytes, limits.maxReadBytes);
|
|
441
|
+
let selected;
|
|
442
|
+
let start = input.offset;
|
|
443
|
+
let size;
|
|
444
|
+
let sha256;
|
|
445
|
+
try {
|
|
446
|
+
await authorizeCodingTool(config, { operation: "read", path: relative });
|
|
447
|
+
await assertContainedFileCurrent(root, relative, handle);
|
|
448
|
+
const metadata = await handle.stat();
|
|
449
|
+
if (!metadata.isFile()) {
|
|
450
|
+
codingPathRefusal("BAD_REQUEST", "This path is not a regular file", relative, {
|
|
451
|
+
hint: "Use list_directory to see what is here."
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
size = metadata.size;
|
|
455
|
+
const length = Math.min(maximum + 4, Math.max(0, size - input.offset));
|
|
456
|
+
selected = Buffer.alloc(length);
|
|
457
|
+
const { bytesRead } = await handle.read(selected, 0, length, input.offset);
|
|
458
|
+
selected = selected.subarray(0, bytesRead);
|
|
459
|
+
if (input.offset > 0) {
|
|
460
|
+
const aligned = utf8AlignedStart(selected, 0, selected.byteLength);
|
|
461
|
+
start = input.offset + aligned;
|
|
462
|
+
selected = selected.subarray(aligned);
|
|
463
|
+
}
|
|
464
|
+
if (selected.byteLength > maximum) {
|
|
465
|
+
selected = selected.subarray(0, utf8AlignedEnd(selected, 0, maximum));
|
|
466
|
+
}
|
|
467
|
+
sha256 = await digestFile(handle, size);
|
|
468
|
+
} finally {
|
|
469
|
+
await handle.close();
|
|
470
|
+
}
|
|
471
|
+
let text;
|
|
472
|
+
try {
|
|
473
|
+
text = new TextDecoder("utf-8", { fatal: true }).decode(selected);
|
|
474
|
+
} catch {
|
|
475
|
+
codingPathRefusal("BAD_REQUEST", "The selected file bytes are not valid UTF-8", relative, {
|
|
476
|
+
details: { reason: "invalid_utf8" },
|
|
477
|
+
hint: "Use a binary-capable reader or convert the file to UTF-8."
|
|
478
|
+
});
|
|
479
|
+
}
|
|
480
|
+
const end = start + selected.byteLength;
|
|
481
|
+
const truncated = end < size;
|
|
482
|
+
return {
|
|
483
|
+
path: relative,
|
|
484
|
+
text,
|
|
485
|
+
bytes: selected.byteLength,
|
|
486
|
+
sha256,
|
|
487
|
+
truncated,
|
|
488
|
+
...truncated && { nextOffset: end }
|
|
489
|
+
};
|
|
490
|
+
}
|
|
491
|
+
});
|
|
492
|
+
const write = defineRuntimeTool({
|
|
493
|
+
name: "write_file",
|
|
494
|
+
description: "Write bounded UTF-8 content to a host-authorized workspace file.",
|
|
495
|
+
identity: { serviceName: "coding", action: "write-file", method: "POST" },
|
|
496
|
+
input: FileWriteInputSchema,
|
|
497
|
+
output: FileWriteOutputSchema,
|
|
498
|
+
transports: ["AGENT"],
|
|
499
|
+
handler: async ({ input }) => {
|
|
500
|
+
const root = await realpath2(config.root);
|
|
501
|
+
const relative = boundedCodingRelativePath(root, input.path, limits.maxPathBytes);
|
|
502
|
+
await authorizeCodingPathChain(config, relative);
|
|
503
|
+
const bytes = Buffer.byteLength(input.content);
|
|
504
|
+
if (bytes > limits.maxWriteBytes) {
|
|
505
|
+
codingPathRefusal("BAD_REQUEST", `The content is ${bytes} bytes, over the ${limits.maxWriteBytes}-byte limit`, relative, {
|
|
506
|
+
details: { bytes, maxWriteBytes: limits.maxWriteBytes },
|
|
507
|
+
hint: "Write a smaller file, or split it."
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
const createsDirectories = await missingContainedDirectories(root, relative).catch((error) => {
|
|
511
|
+
if (error.code === "ENOTDIR") {
|
|
512
|
+
codingPathRefusal("CONFLICT", "A segment of this path is not a directory", relative, {
|
|
513
|
+
hint: "Write under a different path, or remove the file blocking it."
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
throw error;
|
|
517
|
+
});
|
|
518
|
+
await authorizeCodingTool(config, {
|
|
519
|
+
operation: "write",
|
|
520
|
+
path: relative,
|
|
521
|
+
bytes,
|
|
522
|
+
overwrite: input.overwrite,
|
|
523
|
+
createsDirectories
|
|
524
|
+
});
|
|
525
|
+
const parent = await openContainedParent(root, relative, { create: true }).catch((error) => {
|
|
526
|
+
const code = error.code;
|
|
527
|
+
if (code === "ENOTDIR" || error instanceof Error && error.message.includes("ancestor is not a directory")) {
|
|
528
|
+
codingPathRefusal("CONFLICT", "A segment of this path is not a directory", relative, {
|
|
529
|
+
details: { createsDirectories },
|
|
530
|
+
hint: "Write under a different path, or remove the file blocking it."
|
|
531
|
+
});
|
|
532
|
+
}
|
|
533
|
+
throw error;
|
|
534
|
+
});
|
|
535
|
+
try {
|
|
536
|
+
await assertContainedParentCurrent(root, relative, parent.handle);
|
|
537
|
+
const current = await containedEntryMetadata(parent);
|
|
538
|
+
if (input.overwrite) {
|
|
539
|
+
if (current?.isSymbolicLink()) {
|
|
540
|
+
codingPathRefusal("FORBIDDEN", "This path is a symlink", relative, {
|
|
541
|
+
hint: "Coding tools never write through symlinks; write to the target directly."
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
await writeContainedFile({
|
|
545
|
+
parent,
|
|
546
|
+
content: input.content,
|
|
547
|
+
replace: true,
|
|
548
|
+
...current && { mode: current.mode }
|
|
549
|
+
});
|
|
550
|
+
} else {
|
|
551
|
+
if (current) {
|
|
552
|
+
codingPathRefusal("CONFLICT", "This file already exists", relative, {
|
|
553
|
+
hint: "Pass overwrite: true to replace it, or edit_file to change part of it."
|
|
554
|
+
});
|
|
555
|
+
}
|
|
556
|
+
await writeContainedFile({ parent, content: input.content, replace: false });
|
|
557
|
+
}
|
|
558
|
+
} finally {
|
|
559
|
+
await parent.handle.close();
|
|
560
|
+
}
|
|
561
|
+
return { path: relative, bytes, createdDirectories: createsDirectories };
|
|
562
|
+
}
|
|
563
|
+
});
|
|
564
|
+
return [read, write];
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
// src/agent-runtime/coding-tool-listing.ts
|
|
568
|
+
import { realpath as realpath3 } from "node:fs/promises";
|
|
569
|
+
import path3 from "node:path";
|
|
570
|
+
import { z as z2 } from "zod";
|
|
571
|
+
var DEFAULT_EXCLUDED_DIRECTORIES = [
|
|
572
|
+
".git",
|
|
573
|
+
".next",
|
|
574
|
+
".stitchkit",
|
|
575
|
+
"build",
|
|
576
|
+
"coverage",
|
|
577
|
+
"dist",
|
|
578
|
+
"node_modules"
|
|
579
|
+
];
|
|
580
|
+
var ListInputSchema = z2.object({ path: z2.string().min(1).default(".") }).strict();
|
|
581
|
+
var ListOutputSchema = z2.object({
|
|
582
|
+
path: z2.string().min(1),
|
|
583
|
+
entries: z2.array(z2.object({
|
|
584
|
+
name: z2.string().min(1),
|
|
585
|
+
kind: z2.enum(["file", "directory", "symlink", "other"]),
|
|
586
|
+
bytes: z2.int().nonnegative().optional(),
|
|
587
|
+
excluded: z2.boolean().optional()
|
|
588
|
+
}).strict()),
|
|
589
|
+
truncated: z2.boolean(),
|
|
590
|
+
denied: z2.array(CodingDeniedEntrySchema).optional(),
|
|
591
|
+
deniedTruncated: z2.boolean().optional()
|
|
592
|
+
}).strict();
|
|
593
|
+
var GlobInputSchema = z2.object({ pattern: z2.string().min(1), path: z2.string().min(1).default(".") }).strict();
|
|
594
|
+
var GlobOutputSchema = z2.object({
|
|
595
|
+
paths: z2.array(z2.string().min(1)),
|
|
596
|
+
truncated: z2.boolean(),
|
|
597
|
+
resultTruncated: z2.boolean(),
|
|
598
|
+
skippedDirectories: z2.int().nonnegative(),
|
|
599
|
+
scannedFiles: z2.int().nonnegative(),
|
|
600
|
+
denied: z2.array(CodingDeniedEntrySchema).optional(),
|
|
601
|
+
deniedTruncated: z2.boolean().optional()
|
|
602
|
+
}).strict();
|
|
603
|
+
function compileWorkspaceGlob(pattern) {
|
|
604
|
+
let source = "";
|
|
605
|
+
for (let index = 0;index < pattern.length; index += 1) {
|
|
606
|
+
const character = pattern[index];
|
|
607
|
+
if (character === "*") {
|
|
608
|
+
if (pattern[index + 1] === "*") {
|
|
609
|
+
if (pattern[index + 2] === "/") {
|
|
610
|
+
source += "(?:[^/]+/)*";
|
|
611
|
+
index += 2;
|
|
612
|
+
continue;
|
|
613
|
+
}
|
|
614
|
+
source += ".*";
|
|
615
|
+
index += 1;
|
|
616
|
+
continue;
|
|
617
|
+
}
|
|
618
|
+
source += "[^/]*";
|
|
619
|
+
continue;
|
|
620
|
+
}
|
|
621
|
+
if (character === "?") {
|
|
622
|
+
source += "[^/]";
|
|
623
|
+
continue;
|
|
624
|
+
}
|
|
625
|
+
source += character?.replace(/[.*+?^${}()|[\]\\]/g, "\\$&") ?? "";
|
|
626
|
+
}
|
|
627
|
+
return new RegExp(`^${source}$`);
|
|
628
|
+
}
|
|
629
|
+
function createListingCodingTools(config, limits) {
|
|
630
|
+
const excluded = new Set(config.search?.excludeDirectories ?? DEFAULT_EXCLUDED_DIRECTORIES);
|
|
631
|
+
const list = defineRuntimeTool({
|
|
632
|
+
name: "list_directory",
|
|
633
|
+
description: "List the direct entries of one workspace directory.",
|
|
634
|
+
identity: { serviceName: "coding", action: "list-directory", method: "POST" },
|
|
635
|
+
input: ListInputSchema,
|
|
636
|
+
output: ListOutputSchema,
|
|
637
|
+
transports: ["AGENT"],
|
|
638
|
+
handler: async ({ input }) => {
|
|
639
|
+
const root = await realpath3(config.root);
|
|
640
|
+
const relative = input.path === "." ? "." : boundedCodingRelativePath(root, input.path, limits.maxPathBytes);
|
|
641
|
+
await authorizeCodingPathChain(config, relative);
|
|
642
|
+
await authorizeCodingTool(config, { operation: "list", path: relative });
|
|
643
|
+
const listing = await listContainedDirectory(root, relative, limits.maxListEntries, (candidate) => isCodingPathAuthorized(config, candidate)).catch((error) => {
|
|
644
|
+
if (error instanceof Error && error.message.includes("ancestor is not a directory")) {
|
|
645
|
+
codingPathRefusal("BAD_REQUEST", "This path is not a directory", relative, {
|
|
646
|
+
hint: "Pass a directory; use read_file for a file."
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
if (error.code === "ENOENT") {
|
|
650
|
+
codingPathRefusal("NOT_FOUND", "This directory does not exist", relative, {
|
|
651
|
+
hint: "List a parent directory to see what is there."
|
|
652
|
+
});
|
|
653
|
+
}
|
|
654
|
+
return refuseMissingCodingPath(error, relative);
|
|
655
|
+
});
|
|
656
|
+
return {
|
|
657
|
+
path: relative,
|
|
658
|
+
entries: listing.entries.map((entry) => ({
|
|
659
|
+
...entry,
|
|
660
|
+
...entry.kind === "directory" && excluded.has(entry.name) && { excluded: true }
|
|
661
|
+
})),
|
|
662
|
+
truncated: listing.truncated,
|
|
663
|
+
...listing.denied.length > 0 && {
|
|
664
|
+
denied: listing.denied.map((entry) => ({
|
|
665
|
+
path: relative === "." ? entry.name : path3.join(relative, entry.name),
|
|
666
|
+
kind: entry.kind
|
|
667
|
+
})),
|
|
668
|
+
deniedTruncated: listing.deniedTruncated
|
|
669
|
+
}
|
|
670
|
+
};
|
|
671
|
+
}
|
|
672
|
+
});
|
|
673
|
+
const glob = defineRuntimeTool({
|
|
674
|
+
name: "glob",
|
|
675
|
+
description: "List workspace files matching a `**`/`*`/`?` pattern.",
|
|
676
|
+
identity: { serviceName: "coding", action: "glob", method: "POST" },
|
|
677
|
+
input: GlobInputSchema,
|
|
678
|
+
output: GlobOutputSchema,
|
|
679
|
+
transports: ["AGENT"],
|
|
680
|
+
handler: async ({ input }) => {
|
|
681
|
+
const root = await realpath3(config.root);
|
|
682
|
+
const relative = input.path === "." ? "." : boundedCodingRelativePath(root, input.path, limits.maxPathBytes);
|
|
683
|
+
await authorizeCodingPathChain(config, relative);
|
|
684
|
+
await authorizeCodingTool(config, {
|
|
685
|
+
operation: "glob",
|
|
686
|
+
pattern: input.pattern,
|
|
687
|
+
path: relative
|
|
688
|
+
});
|
|
689
|
+
let matcher;
|
|
690
|
+
try {
|
|
691
|
+
matcher = compileWorkspaceGlob(input.pattern);
|
|
692
|
+
} catch {
|
|
693
|
+
codingRefusal("BAD_REQUEST", "This glob pattern could not be compiled", {
|
|
694
|
+
details: { pattern: input.pattern },
|
|
695
|
+
hint: "Use only `**`, `*` and `?`."
|
|
696
|
+
});
|
|
697
|
+
}
|
|
698
|
+
const scan = await scanContainedFiles({
|
|
699
|
+
root,
|
|
700
|
+
maxDepth: limits.maxSearchDepth,
|
|
701
|
+
maxFiles: limits.maxSearchFiles,
|
|
702
|
+
symlinks: "skip",
|
|
703
|
+
excludeDirectory: (directory) => directory.split(path3.sep).some((segment) => excluded.has(segment)),
|
|
704
|
+
authorizePath: (candidate) => isCodingPathAuthorized(config, candidate)
|
|
705
|
+
});
|
|
706
|
+
const prefix = relative === "." ? "" : `${relative}${path3.sep}`;
|
|
707
|
+
const matched = scan.files.filter((file) => file.relative.startsWith(prefix)).map((file) => file.relative).filter((candidate) => matcher.test(candidate.slice(prefix.length))).sort();
|
|
708
|
+
const paths = matched.slice(0, limits.maxSearchResults);
|
|
709
|
+
const scopedDenied = scan.denied.filter((entry) => entry.relative.startsWith(prefix));
|
|
710
|
+
const denied = scopedDenied.slice(0, limits.maxSearchResults).map((entry) => ({
|
|
711
|
+
path: entry.relative,
|
|
712
|
+
kind: entry.kind
|
|
713
|
+
}));
|
|
714
|
+
return {
|
|
715
|
+
paths,
|
|
716
|
+
truncated: scan.truncated,
|
|
717
|
+
resultTruncated: matched.length > paths.length,
|
|
718
|
+
skippedDirectories: scan.skippedDirectories,
|
|
719
|
+
scannedFiles: scan.files.length,
|
|
720
|
+
...denied.length > 0 && {
|
|
721
|
+
denied,
|
|
722
|
+
deniedTruncated: scan.deniedTruncated || scopedDenied.length > denied.length
|
|
723
|
+
}
|
|
724
|
+
};
|
|
725
|
+
}
|
|
726
|
+
});
|
|
727
|
+
return [list, glob];
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
// src/agent-runtime/coding-tool-search-patch.ts
|
|
731
|
+
import { createHash as createHash2 } from "node:crypto";
|
|
732
|
+
import { realpath as realpath4 } from "node:fs/promises";
|
|
733
|
+
import path4 from "node:path";
|
|
734
|
+
import { z as z3 } from "zod";
|
|
735
|
+
var SearchInputSchema = z3.object({
|
|
736
|
+
query: z3.string().min(1),
|
|
737
|
+
mode: z3.enum(["path", "content"]).default("content"),
|
|
738
|
+
regex: z3.boolean().default(false),
|
|
739
|
+
context: z3.int().nonnegative().max(10).default(0),
|
|
740
|
+
include: z3.string().min(1).describe("Anchored `**`/`*`/`?` pattern matched against the whole workspace-relative path. `*` does not cross `/`; use `**/` to include matching files in subdirectories.").optional()
|
|
741
|
+
}).strict();
|
|
742
|
+
var SearchOutputSchema = z3.object({
|
|
743
|
+
matches: z3.array(z3.object({
|
|
744
|
+
path: z3.string().min(1),
|
|
745
|
+
line: z3.int().positive().optional(),
|
|
746
|
+
text: z3.string().optional(),
|
|
747
|
+
before: z3.array(z3.string()).optional(),
|
|
748
|
+
after: z3.array(z3.string()).optional()
|
|
749
|
+
}).strict()),
|
|
750
|
+
truncated: z3.boolean(),
|
|
751
|
+
scannedFiles: z3.int().nonnegative().describe("Files admitted by include and host authorization that reached path or content comparison."),
|
|
752
|
+
skippedDirectories: z3.int().nonnegative(),
|
|
753
|
+
skippedSymlinks: z3.int().nonnegative(),
|
|
754
|
+
denied: z3.array(CodingDeniedEntrySchema).optional(),
|
|
755
|
+
deniedTruncated: z3.boolean().optional(),
|
|
756
|
+
hint: z3.string().min(1).optional()
|
|
757
|
+
}).strict();
|
|
758
|
+
function compileSearchRegex(pattern) {
|
|
759
|
+
if (/\\[1-9]/.test(pattern) || /\(\?<?[=!]/.test(pattern)) {
|
|
760
|
+
codingRefusal("BAD_REQUEST", "This pattern uses a construct search does not allow", {
|
|
761
|
+
details: { pattern },
|
|
762
|
+
hint: "Backreferences and lookaround are refused because they cannot be bounded. Rewrite without them."
|
|
763
|
+
});
|
|
764
|
+
}
|
|
765
|
+
try {
|
|
766
|
+
return new RegExp(pattern);
|
|
767
|
+
} catch (error) {
|
|
768
|
+
codingRefusal("BAD_REQUEST", "This pattern is not a valid regular expression", {
|
|
769
|
+
details: { pattern, reason: error instanceof Error ? error.message : "unknown" },
|
|
770
|
+
hint: "Fix the expression, or pass regex: false to search for it literally."
|
|
771
|
+
});
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
var MAX_SEARCHED_LINE_BYTES = 8192;
|
|
775
|
+
var EditInputSchema = z3.object({
|
|
776
|
+
path: z3.string().min(1),
|
|
777
|
+
oldText: z3.string().min(1),
|
|
778
|
+
newText: z3.string(),
|
|
779
|
+
replaceAll: z3.boolean().default(false),
|
|
780
|
+
expectedSha256: z3.string().length(64).optional(),
|
|
781
|
+
dryRun: z3.boolean().default(false)
|
|
782
|
+
}).strict();
|
|
783
|
+
var EditOutputSchema = z3.object({
|
|
784
|
+
path: z3.string().min(1),
|
|
785
|
+
baseSha256: z3.string().length(64),
|
|
786
|
+
sha256: z3.string().length(64),
|
|
787
|
+
replacements: z3.int().positive(),
|
|
788
|
+
bytes: z3.int().nonnegative(),
|
|
789
|
+
applied: z3.boolean()
|
|
790
|
+
}).strict();
|
|
791
|
+
function sha256(value) {
|
|
792
|
+
return createHash2("sha256").update(value).digest("hex");
|
|
793
|
+
}
|
|
794
|
+
async function searchFiles(config, limits, input) {
|
|
795
|
+
await authorizeCodingTool(config, {
|
|
796
|
+
operation: "search",
|
|
797
|
+
query: input.query,
|
|
798
|
+
mode: input.mode
|
|
799
|
+
});
|
|
800
|
+
const root = await realpath4(config.root);
|
|
801
|
+
await authorizeCodingPath(config, ".");
|
|
802
|
+
const excluded = new Set(config.search?.excludeDirectories ?? DEFAULT_EXCLUDED_DIRECTORIES);
|
|
803
|
+
const included = input.include ? compileWorkspaceGlob(input.include) : null;
|
|
804
|
+
let rejectedByInclude = 0;
|
|
805
|
+
const scan = await scanContainedFiles({
|
|
806
|
+
root,
|
|
807
|
+
maxDepth: limits.maxSearchDepth,
|
|
808
|
+
maxFiles: limits.maxSearchFiles,
|
|
809
|
+
symlinks: "skip",
|
|
810
|
+
...input.mode === "content" && {
|
|
811
|
+
readMaxBytes: limits.maxReadBytes,
|
|
812
|
+
skipUnreadable: true
|
|
813
|
+
},
|
|
814
|
+
excludeDirectory: (relative) => relative.split(path4.sep).some((segment) => excluded.has(segment)),
|
|
815
|
+
includeFile: (candidate) => {
|
|
816
|
+
if (included && !included.test(candidate)) {
|
|
817
|
+
rejectedByInclude += 1;
|
|
818
|
+
return false;
|
|
819
|
+
}
|
|
820
|
+
return true;
|
|
821
|
+
},
|
|
822
|
+
authorizePath: (candidate) => isCodingPathAuthorized(config, candidate)
|
|
823
|
+
});
|
|
824
|
+
const matcher = input.regex ? compileSearchRegex(input.query) : null;
|
|
825
|
+
const hit = (line) => {
|
|
826
|
+
if (line.length > MAX_SEARCHED_LINE_BYTES)
|
|
827
|
+
return false;
|
|
828
|
+
if (matcher) {
|
|
829
|
+
matcher.lastIndex = 0;
|
|
830
|
+
return matcher.test(line);
|
|
831
|
+
}
|
|
832
|
+
return line.includes(input.query);
|
|
833
|
+
};
|
|
834
|
+
const matches = [];
|
|
835
|
+
let truncated = false;
|
|
836
|
+
for (const file of scan.files) {
|
|
837
|
+
if (input.mode === "path") {
|
|
838
|
+
if (hit(file.relative))
|
|
839
|
+
matches.push({ path: file.relative });
|
|
840
|
+
} else {
|
|
841
|
+
const text = file.content?.text;
|
|
842
|
+
if (text === undefined)
|
|
843
|
+
continue;
|
|
844
|
+
const lines = text.split(`
|
|
845
|
+
`);
|
|
846
|
+
for (let index = 0;index < lines.length; index += 1) {
|
|
847
|
+
const line = lines[index];
|
|
848
|
+
if (line === undefined || !hit(line))
|
|
849
|
+
continue;
|
|
850
|
+
matches.push({
|
|
851
|
+
path: file.relative,
|
|
852
|
+
line: index + 1,
|
|
853
|
+
text: line,
|
|
854
|
+
...input.context > 0 && {
|
|
855
|
+
before: lines.slice(Math.max(0, index - input.context), index),
|
|
856
|
+
after: lines.slice(index + 1, index + 1 + input.context)
|
|
857
|
+
}
|
|
858
|
+
});
|
|
859
|
+
if (matches.length >= limits.maxSearchResults)
|
|
860
|
+
break;
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
if (matches.length >= limits.maxSearchResults) {
|
|
864
|
+
truncated = true;
|
|
865
|
+
break;
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
return {
|
|
869
|
+
matches,
|
|
870
|
+
truncated: truncated || scan.truncated,
|
|
871
|
+
scannedFiles: scan.files.length,
|
|
872
|
+
skippedDirectories: scan.skippedDirectories,
|
|
873
|
+
skippedSymlinks: scan.skippedSymlinks,
|
|
874
|
+
...scan.denied.length > 0 && {
|
|
875
|
+
denied: scan.denied.slice(0, limits.maxSearchResults).map(({ relative, kind }) => ({ path: relative, kind })),
|
|
876
|
+
deniedTruncated: scan.deniedTruncated || scan.denied.length > limits.maxSearchResults
|
|
877
|
+
},
|
|
878
|
+
...input.include && scan.files.length === 0 && rejectedByInclude > 0 && {
|
|
879
|
+
hint: `The anchored include pattern \`${input.include}\` rejected all ${rejectedByInclude} ${rejectedByInclude === 1 ? "file" : "files"} the scan reached. \`*\` does not cross \`/\`; use a pattern such as \`**/*.ts\` for matching files in subdirectories.`
|
|
880
|
+
}
|
|
881
|
+
};
|
|
882
|
+
}
|
|
883
|
+
async function editFile(config, limits, input) {
|
|
884
|
+
const root = await realpath4(config.root);
|
|
885
|
+
const relative = boundedCodingRelativePath(root, input.path, limits.maxPathBytes);
|
|
886
|
+
await authorizeCodingPathChain(config, relative);
|
|
887
|
+
const parent = await openContainedParent(root, relative).catch((error) => refuseMissingCodingPath(error, relative));
|
|
888
|
+
try {
|
|
889
|
+
return await withCodingPathLock(`${root}:${relative}`, async () => {
|
|
890
|
+
const handle = await openContainedParentFile(parent).catch((error) => refuseMissingCodingPath(error, relative));
|
|
891
|
+
const read = await readContainedUtf8Handle(handle, limits.maxWriteBytes).finally(() => handle.close());
|
|
892
|
+
const source = read.text;
|
|
893
|
+
const baseSha256 = sha256(source);
|
|
894
|
+
if (input.expectedSha256 !== undefined && baseSha256 !== input.expectedSha256) {
|
|
895
|
+
conflict("The file changed since it was read", {
|
|
896
|
+
message: "The file changed since it was read",
|
|
897
|
+
path: relative,
|
|
898
|
+
expectedSha256: input.expectedSha256,
|
|
899
|
+
actualSha256: baseSha256
|
|
900
|
+
});
|
|
901
|
+
}
|
|
902
|
+
const count = textOccurrences(source, input.oldText);
|
|
903
|
+
if (count === 0) {
|
|
904
|
+
codingPathRefusal("NOT_FOUND", "oldText does not appear in this file", relative, {
|
|
905
|
+
details: { occurrences: 0 },
|
|
906
|
+
hint: "Read the file and copy the snippet exactly, including indentation."
|
|
907
|
+
});
|
|
908
|
+
}
|
|
909
|
+
if (!input.replaceAll && count !== 1) {
|
|
910
|
+
codingPathRefusal("CONFLICT", `oldText appears ${count} times, so the edit is ambiguous`, relative, {
|
|
911
|
+
details: { occurrences: count },
|
|
912
|
+
hint: "Lengthen the snippet until it is unique, or pass replaceAll: true."
|
|
913
|
+
});
|
|
914
|
+
}
|
|
915
|
+
const replacements = input.replaceAll ? count : 1;
|
|
916
|
+
const changed = input.replaceAll ? source.replaceAll(input.oldText, input.newText) : source.replace(input.oldText, () => input.newText);
|
|
917
|
+
const bytes = Buffer.byteLength(changed);
|
|
918
|
+
const resultSha256 = sha256(changed);
|
|
919
|
+
if (bytes > limits.maxWriteBytes) {
|
|
920
|
+
codingPathRefusal("BAD_REQUEST", `The result would be ${bytes} bytes, over the ${limits.maxWriteBytes}-byte limit`, relative, {
|
|
921
|
+
details: { bytes, maxWriteBytes: limits.maxWriteBytes },
|
|
922
|
+
hint: "Make a smaller edit, or split the file."
|
|
923
|
+
});
|
|
924
|
+
}
|
|
925
|
+
await authorizeCodingTool(config, {
|
|
926
|
+
operation: "edit",
|
|
927
|
+
path: relative,
|
|
928
|
+
baseSha256,
|
|
929
|
+
resultSha256,
|
|
930
|
+
resultBytes: bytes,
|
|
931
|
+
replacements,
|
|
932
|
+
dryRun: input.dryRun
|
|
933
|
+
});
|
|
934
|
+
await assertContainedParentCurrent(root, relative, parent.handle);
|
|
935
|
+
if (!input.dryRun) {
|
|
936
|
+
await writeContainedFile({
|
|
937
|
+
parent,
|
|
938
|
+
content: changed,
|
|
939
|
+
replace: true,
|
|
940
|
+
mode: read.mode
|
|
941
|
+
});
|
|
942
|
+
}
|
|
943
|
+
return {
|
|
944
|
+
path: relative,
|
|
945
|
+
baseSha256,
|
|
946
|
+
sha256: resultSha256,
|
|
947
|
+
replacements,
|
|
948
|
+
bytes,
|
|
949
|
+
applied: !input.dryRun
|
|
950
|
+
};
|
|
951
|
+
});
|
|
952
|
+
} finally {
|
|
953
|
+
await parent.handle.close();
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
function createSearchAndPatchCodingTools(config, limits) {
|
|
957
|
+
const search = defineRuntimeTool({
|
|
958
|
+
name: "search_files",
|
|
959
|
+
description: "Search bounded relative paths or UTF-8 file content under the workspace root.",
|
|
960
|
+
identity: { serviceName: "coding", action: "search", method: "POST" },
|
|
961
|
+
input: SearchInputSchema,
|
|
962
|
+
output: SearchOutputSchema,
|
|
963
|
+
transports: ["AGENT"],
|
|
964
|
+
handler: ({ input }) => searchFiles(config, limits, input)
|
|
965
|
+
});
|
|
966
|
+
const edit = defineRuntimeTool({
|
|
967
|
+
name: "edit_file",
|
|
968
|
+
description: "Replace an exact snippet in one workspace file.",
|
|
969
|
+
identity: { serviceName: "coding", action: "edit-file", method: "POST" },
|
|
970
|
+
input: EditInputSchema,
|
|
971
|
+
output: EditOutputSchema,
|
|
972
|
+
transports: ["AGENT"],
|
|
973
|
+
handler: ({ input }) => editFile(config, limits, input)
|
|
974
|
+
});
|
|
975
|
+
return [search, edit];
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
// src/agent-runtime/coding-tool-shell.ts
|
|
979
|
+
import { realpath as realpath5, stat } from "node:fs/promises";
|
|
980
|
+
|
|
981
|
+
// src/agent-runtime/coding-shell-process.ts
|
|
982
|
+
import { spawn } from "node:child_process";
|
|
983
|
+
function preview(data, budget) {
|
|
984
|
+
if (data.byteLength <= budget) {
|
|
985
|
+
return { data, headBytes: data.byteLength, tailBytes: 0, omittedBytes: 0 };
|
|
986
|
+
}
|
|
987
|
+
const headEnd = utf8AlignedEnd(data, 0, Math.ceil(budget / 2));
|
|
988
|
+
const tailStart = Math.max(headEnd, utf8AlignedStart(data, data.byteLength - Math.floor(budget / 2), data.byteLength));
|
|
989
|
+
const tailBytes = data.byteLength - tailStart;
|
|
990
|
+
return {
|
|
991
|
+
data: Buffer.concat([data.subarray(0, headEnd), data.subarray(tailStart)]),
|
|
992
|
+
headBytes: headEnd,
|
|
993
|
+
tailBytes,
|
|
994
|
+
omittedBytes: data.byteLength - headEnd - tailBytes
|
|
995
|
+
};
|
|
996
|
+
}
|
|
997
|
+
function retainedPreview(data) {
|
|
998
|
+
const end = utf8AlignedEnd(data, 0, data.byteLength);
|
|
999
|
+
return {
|
|
1000
|
+
data: data.subarray(0, end),
|
|
1001
|
+
headBytes: end,
|
|
1002
|
+
tailBytes: 0,
|
|
1003
|
+
omittedBytes: data.byteLength - end
|
|
1004
|
+
};
|
|
1005
|
+
}
|
|
1006
|
+
async function runCodingShell(input) {
|
|
1007
|
+
const stdoutHeader = Buffer.from(`--- stdout ---
|
|
1008
|
+
`);
|
|
1009
|
+
const stderrHeader = Buffer.from(`
|
|
1010
|
+
--- stderr ---
|
|
1011
|
+
`);
|
|
1012
|
+
const artifactPayloadLimit = input.maxArtifactBytes - stdoutHeader.byteLength - stderrHeader.byteLength;
|
|
1013
|
+
if (input.artifacts && artifactPayloadLimit < 0)
|
|
1014
|
+
throw new Error("maxArtifactBytes is smaller than the shell artifact envelope");
|
|
1015
|
+
if (input.signal?.aborted) {
|
|
1016
|
+
return ShellOutputSchema.parse({
|
|
1017
|
+
executable: input.executableName,
|
|
1018
|
+
exitCode: null,
|
|
1019
|
+
signal: null,
|
|
1020
|
+
stdout: "",
|
|
1021
|
+
stderr: "",
|
|
1022
|
+
outcome: "cancelled"
|
|
1023
|
+
});
|
|
1024
|
+
}
|
|
1025
|
+
return await new Promise((resolve, reject) => {
|
|
1026
|
+
const ownsProcessGroup = process.platform !== "win32";
|
|
1027
|
+
const child = input.spawn ? input.spawn() : spawn(input.executable, input.args, {
|
|
1028
|
+
cwd: input.cwd,
|
|
1029
|
+
env: input.environment,
|
|
1030
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
1031
|
+
detached: ownsProcessGroup
|
|
1032
|
+
});
|
|
1033
|
+
const stdout = [];
|
|
1034
|
+
const stderr = [];
|
|
1035
|
+
const artifactStdout = [];
|
|
1036
|
+
const artifactStderr = [];
|
|
1037
|
+
let retained = 0;
|
|
1038
|
+
let artifactBytes = 0;
|
|
1039
|
+
let outcome = "exited";
|
|
1040
|
+
let settled = false;
|
|
1041
|
+
let settlementTimer;
|
|
1042
|
+
const cancel = () => terminate("cancelled");
|
|
1043
|
+
const cleanup = () => {
|
|
1044
|
+
clearTimeout(timer);
|
|
1045
|
+
if (settlementTimer)
|
|
1046
|
+
clearTimeout(settlementTimer);
|
|
1047
|
+
input.signal?.removeEventListener("abort", cancel);
|
|
1048
|
+
};
|
|
1049
|
+
const persistAndResolve = async (exitCode, signal) => {
|
|
1050
|
+
if (settled)
|
|
1051
|
+
return;
|
|
1052
|
+
settled = true;
|
|
1053
|
+
cleanup();
|
|
1054
|
+
try {
|
|
1055
|
+
const hasArtifact = input.artifacts && artifactBytes > input.maxOutputBytes;
|
|
1056
|
+
const completeStdout = Buffer.concat(artifactStdout);
|
|
1057
|
+
const completeStderr = Buffer.concat(artifactStderr);
|
|
1058
|
+
const artifactData = hasArtifact ? Buffer.concat([stdoutHeader, completeStdout, stderrHeader, completeStderr]) : undefined;
|
|
1059
|
+
const stdoutBudget = completeStderr.byteLength === 0 ? input.maxOutputBytes : Math.ceil(input.maxOutputBytes / 2);
|
|
1060
|
+
const stderrBudget = completeStdout.byteLength === 0 ? input.maxOutputBytes : Math.floor(input.maxOutputBytes / 2);
|
|
1061
|
+
const stdoutPreview = hasArtifact ? preview(completeStdout, stdoutBudget) : retainedPreview(Buffer.concat(stdout));
|
|
1062
|
+
const stderrPreview = hasArtifact ? preview(completeStderr, stderrBudget) : retainedPreview(Buffer.concat(stderr));
|
|
1063
|
+
const persisted = hasArtifact ? await input.artifacts?.write({
|
|
1064
|
+
mediaType: "text/plain; charset=utf-8",
|
|
1065
|
+
data: artifactData ?? new Uint8Array,
|
|
1066
|
+
...input.authorization && { authorization: input.authorization }
|
|
1067
|
+
}) : undefined;
|
|
1068
|
+
resolve(ShellOutputSchema.parse({
|
|
1069
|
+
executable: input.executableName,
|
|
1070
|
+
exitCode,
|
|
1071
|
+
signal,
|
|
1072
|
+
stdout: stdoutPreview.data.toString("utf8"),
|
|
1073
|
+
stderr: stderrPreview.data.toString("utf8"),
|
|
1074
|
+
outcome,
|
|
1075
|
+
...persisted && {
|
|
1076
|
+
artifact: {
|
|
1077
|
+
reference: persisted.reference,
|
|
1078
|
+
bytes: artifactData?.byteLength ?? 0,
|
|
1079
|
+
truncated: outcome === "output-limit",
|
|
1080
|
+
headBytes: stdoutPreview.headBytes + stderrPreview.headBytes,
|
|
1081
|
+
tailBytes: stdoutPreview.tailBytes + stderrPreview.tailBytes,
|
|
1082
|
+
omittedBytes: stdoutPreview.omittedBytes + stderrPreview.omittedBytes
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
}));
|
|
1086
|
+
} catch (error) {
|
|
1087
|
+
reject(error);
|
|
1088
|
+
}
|
|
1089
|
+
};
|
|
1090
|
+
const killOwnedProcessGroup = () => {
|
|
1091
|
+
if (!ownsProcessGroup || child.pid === undefined)
|
|
1092
|
+
return false;
|
|
1093
|
+
try {
|
|
1094
|
+
process.kill(-child.pid, "SIGKILL");
|
|
1095
|
+
return true;
|
|
1096
|
+
} catch {
|
|
1097
|
+
return false;
|
|
1098
|
+
}
|
|
1099
|
+
};
|
|
1100
|
+
const boundStreamSettlement = () => {
|
|
1101
|
+
if (settlementTimer)
|
|
1102
|
+
return;
|
|
1103
|
+
settlementTimer = setTimeout(() => {
|
|
1104
|
+
child.stdout.destroy();
|
|
1105
|
+
child.stderr.destroy();
|
|
1106
|
+
persistAndResolve(child.exitCode, child.signalCode);
|
|
1107
|
+
}, input.terminationGraceMs);
|
|
1108
|
+
};
|
|
1109
|
+
const terminate = (reason) => {
|
|
1110
|
+
if (settled || outcome !== "exited")
|
|
1111
|
+
return;
|
|
1112
|
+
outcome = reason;
|
|
1113
|
+
if (!killOwnedProcessGroup())
|
|
1114
|
+
child.kill("SIGKILL");
|
|
1115
|
+
boundStreamSettlement();
|
|
1116
|
+
};
|
|
1117
|
+
const timer = setTimeout(() => terminate("timeout"), input.timeoutMs);
|
|
1118
|
+
timer.unref();
|
|
1119
|
+
const retain = (target, artifactTarget, chunk) => {
|
|
1120
|
+
const remaining = Math.max(0, input.maxOutputBytes - retained);
|
|
1121
|
+
if (remaining > 0) {
|
|
1122
|
+
const kept = chunk.subarray(0, remaining);
|
|
1123
|
+
target.push(kept);
|
|
1124
|
+
retained += kept.byteLength;
|
|
1125
|
+
}
|
|
1126
|
+
if (input.artifacts) {
|
|
1127
|
+
const artifactRemaining = Math.max(0, artifactPayloadLimit - artifactBytes);
|
|
1128
|
+
if (artifactRemaining > 0) {
|
|
1129
|
+
const kept = chunk.subarray(0, artifactRemaining);
|
|
1130
|
+
artifactTarget.push(kept);
|
|
1131
|
+
artifactBytes += kept.byteLength;
|
|
1132
|
+
}
|
|
1133
|
+
if (chunk.byteLength > artifactRemaining)
|
|
1134
|
+
terminate("output-limit");
|
|
1135
|
+
} else if (chunk.byteLength > remaining)
|
|
1136
|
+
terminate("output-limit");
|
|
1137
|
+
};
|
|
1138
|
+
child.stdout.on("data", (chunk) => retain(stdout, artifactStdout, Buffer.from(chunk)));
|
|
1139
|
+
child.stderr.on("data", (chunk) => retain(stderr, artifactStderr, Buffer.from(chunk)));
|
|
1140
|
+
child.on("error", (error) => {
|
|
1141
|
+
if (settled)
|
|
1142
|
+
return;
|
|
1143
|
+
settled = true;
|
|
1144
|
+
cleanup();
|
|
1145
|
+
reject(error);
|
|
1146
|
+
});
|
|
1147
|
+
child.on("exit", (exitCode, signal) => {
|
|
1148
|
+
if (outcome === "exited")
|
|
1149
|
+
killOwnedProcessGroup();
|
|
1150
|
+
boundStreamSettlement();
|
|
1151
|
+
if (child.stdout.destroyed && child.stderr.destroyed) {
|
|
1152
|
+
persistAndResolve(exitCode, signal);
|
|
1153
|
+
}
|
|
1154
|
+
});
|
|
1155
|
+
child.on("close", (exitCode, signal) => void persistAndResolve(exitCode, signal));
|
|
1156
|
+
input.signal?.addEventListener("abort", cancel, { once: true });
|
|
1157
|
+
if (input.signal?.aborted)
|
|
1158
|
+
cancel();
|
|
1159
|
+
});
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
// src/agent-runtime/coding-tool-shell.ts
|
|
1163
|
+
function createShellCodingTool(config, limits) {
|
|
1164
|
+
const executables = config.executables ?? {};
|
|
1165
|
+
const executableNames = Object.keys(executables).sort();
|
|
1166
|
+
return defineRuntimeTool({
|
|
1167
|
+
name: "run_command",
|
|
1168
|
+
description: "Run a finite host-declared executable with bounded arguments, time and output.",
|
|
1169
|
+
identity: { serviceName: "coding", action: "shell", method: "POST" },
|
|
1170
|
+
input: createShellInputSchema(executableNames),
|
|
1171
|
+
output: ShellOutputSchema,
|
|
1172
|
+
transports: ["AGENT"],
|
|
1173
|
+
handler: async ({ input, signal }) => {
|
|
1174
|
+
if (input.args.length > limits.maxShellArguments) {
|
|
1175
|
+
throw new Error("Coding tool shell arguments exceed maxShellArguments");
|
|
1176
|
+
}
|
|
1177
|
+
const argumentBytes = input.args.reduce((total, argument) => total + Buffer.byteLength(argument), 0);
|
|
1178
|
+
if (argumentBytes > limits.maxShellArgumentBytes) {
|
|
1179
|
+
throw new Error("Coding tool shell arguments exceed maxShellArgumentBytes");
|
|
1180
|
+
}
|
|
1181
|
+
const executable = executables[input.executable];
|
|
1182
|
+
if (!executable)
|
|
1183
|
+
throw new Error("Coding tool executable is not declared");
|
|
1184
|
+
const root = await realpath5(config.root);
|
|
1185
|
+
const cwd = await existingCodingPath(root, input.cwd === "." ? "." : boundedCodingRelativePath(root, input.cwd, limits.maxPathBytes), limits.maxPathBytes);
|
|
1186
|
+
if (!(await stat(cwd.absolute)).isDirectory()) {
|
|
1187
|
+
throw new Error("Coding tool cwd is not a directory");
|
|
1188
|
+
}
|
|
1189
|
+
const shellAuthorization = {
|
|
1190
|
+
operation: "shell",
|
|
1191
|
+
executable: input.executable,
|
|
1192
|
+
args: input.args,
|
|
1193
|
+
cwd: cwd.relative
|
|
1194
|
+
};
|
|
1195
|
+
await authorizeCodingTool(config, shellAuthorization);
|
|
1196
|
+
let executablePath = executable;
|
|
1197
|
+
let executableArgs = input.args;
|
|
1198
|
+
let environment = config.environment ?? {};
|
|
1199
|
+
if (config.sandbox) {
|
|
1200
|
+
const grade = await probeAgentProcessSandbox(config.sandbox.adapter);
|
|
1201
|
+
if (grade.grade === "unavailable") {
|
|
1202
|
+
codingRefusal("SANDBOX_UNAVAILABLE", "The configured process sandbox is unavailable", {
|
|
1203
|
+
details: { reason: grade.reason }
|
|
1204
|
+
});
|
|
1205
|
+
}
|
|
1206
|
+
const missing = missingSandboxRestrictions(grade, config.sandbox.required);
|
|
1207
|
+
if (missing.length > 0) {
|
|
1208
|
+
codingRefusal("SANDBOX_INSUFFICIENT", "The process sandbox lacks required restrictions", {
|
|
1209
|
+
details: { missing, grade: grade.grade }
|
|
1210
|
+
});
|
|
1211
|
+
}
|
|
1212
|
+
try {
|
|
1213
|
+
const prepared = await config.sandbox.adapter.prepare({
|
|
1214
|
+
required: config.sandbox.required,
|
|
1215
|
+
executable,
|
|
1216
|
+
args: input.args,
|
|
1217
|
+
cwd: cwd.absolute,
|
|
1218
|
+
environment
|
|
1219
|
+
});
|
|
1220
|
+
executablePath = prepared.executable;
|
|
1221
|
+
executableArgs = [...prepared.args];
|
|
1222
|
+
environment = prepared.environment ?? environment;
|
|
1223
|
+
} catch (error) {
|
|
1224
|
+
const refreshed = await probeAgentProcessSandbox(config.sandbox.adapter, {
|
|
1225
|
+
refresh: true
|
|
1226
|
+
});
|
|
1227
|
+
codingRefusal("SANDBOX_UNAVAILABLE", "The process sandbox failed while preparing a command", {
|
|
1228
|
+
details: {
|
|
1229
|
+
grade: refreshed.grade,
|
|
1230
|
+
reason: error instanceof Error ? error.message : "unknown sandbox error"
|
|
1231
|
+
}
|
|
1232
|
+
});
|
|
1233
|
+
}
|
|
1234
|
+
}
|
|
1235
|
+
return runCodingShell({
|
|
1236
|
+
...config.sandbox?.adapter.spawn && {
|
|
1237
|
+
spawn: () => {
|
|
1238
|
+
const adapter = config.sandbox?.adapter;
|
|
1239
|
+
if (!adapter?.spawn)
|
|
1240
|
+
throw new Error("Sandbox launcher is unavailable");
|
|
1241
|
+
return adapter.spawn({
|
|
1242
|
+
executable: executablePath,
|
|
1243
|
+
args: executableArgs,
|
|
1244
|
+
cwd: cwd.absolute,
|
|
1245
|
+
environment
|
|
1246
|
+
});
|
|
1247
|
+
}
|
|
1248
|
+
},
|
|
1249
|
+
executableName: input.executable,
|
|
1250
|
+
executable: executablePath,
|
|
1251
|
+
args: executableArgs,
|
|
1252
|
+
cwd: cwd.absolute,
|
|
1253
|
+
environment,
|
|
1254
|
+
...signal && { signal },
|
|
1255
|
+
timeoutMs: limits.shellTimeoutMs,
|
|
1256
|
+
terminationGraceMs: limits.shellTerminationGraceMs,
|
|
1257
|
+
maxOutputBytes: limits.maxShellOutputBytes,
|
|
1258
|
+
maxArtifactBytes: limits.maxArtifactBytes,
|
|
1259
|
+
...config.artifacts && { artifacts: config.artifacts },
|
|
1260
|
+
authorization: shellAuthorization
|
|
1261
|
+
});
|
|
1262
|
+
}
|
|
1263
|
+
});
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
// src/agent-runtime/coding-tools.ts
|
|
1267
|
+
var AGENT_CODING_TOOL_NAMES = {
|
|
1268
|
+
editFile: "edit_file",
|
|
1269
|
+
glob: "glob",
|
|
1270
|
+
listDirectory: "list_directory",
|
|
1271
|
+
readFile: "read_file",
|
|
1272
|
+
readOutput: "read_output",
|
|
1273
|
+
searchOutput: "search_output",
|
|
1274
|
+
runCommand: "run_command",
|
|
1275
|
+
searchFiles: "search_files",
|
|
1276
|
+
writeFile: "write_file"
|
|
1277
|
+
};
|
|
1278
|
+
function createAgentCodingTools(config) {
|
|
1279
|
+
if (!path5.isAbsolute(config.root))
|
|
1280
|
+
throw new Error("Coding tool root must be absolute");
|
|
1281
|
+
for (const executable of Object.values(config.executables ?? {})) {
|
|
1282
|
+
if (!path5.isAbsolute(executable)) {
|
|
1283
|
+
throw new Error("Coding tool executables must be absolute paths");
|
|
1284
|
+
}
|
|
1285
|
+
}
|
|
1286
|
+
const limits = resolveCodingToolLimits(config.limits);
|
|
1287
|
+
const artifactTools = [];
|
|
1288
|
+
if (config.artifacts) {
|
|
1289
|
+
const artifacts = config.artifacts;
|
|
1290
|
+
artifactTools.push(defineRuntimeTool({
|
|
1291
|
+
name: AGENT_CODING_TOOL_NAMES.readOutput,
|
|
1292
|
+
description: "Read a bounded byte slice from one opaque coding output artifact.",
|
|
1293
|
+
identity: { serviceName: "coding", action: "read-artifact", method: "POST" },
|
|
1294
|
+
input: z4.object({
|
|
1295
|
+
reference: z4.string().min(1),
|
|
1296
|
+
offset: z4.int().nonnegative().default(0),
|
|
1297
|
+
maxBytes: z4.int().positive().optional()
|
|
1298
|
+
}).strict(),
|
|
1299
|
+
output: z4.object({
|
|
1300
|
+
reference: z4.string().min(1),
|
|
1301
|
+
offset: z4.int().nonnegative(),
|
|
1302
|
+
text: z4.string(),
|
|
1303
|
+
bytes: z4.int().nonnegative(),
|
|
1304
|
+
totalBytes: z4.int().nonnegative().optional()
|
|
1305
|
+
}).strict(),
|
|
1306
|
+
transports: ["AGENT"],
|
|
1307
|
+
handler: async ({ input }) => {
|
|
1308
|
+
const maxBytes = Math.min(input.maxBytes ?? limits.maxReadBytes, limits.maxReadBytes);
|
|
1309
|
+
await authorizeCodingTool(config, {
|
|
1310
|
+
operation: "artifact-read",
|
|
1311
|
+
reference: input.reference,
|
|
1312
|
+
offset: input.offset,
|
|
1313
|
+
maxBytes
|
|
1314
|
+
});
|
|
1315
|
+
const originAuthorization = await artifacts.authorization?.(input.reference);
|
|
1316
|
+
if (originAuthorization)
|
|
1317
|
+
await authorizeCodingTool(config, originAuthorization);
|
|
1318
|
+
const result = await artifacts.read({
|
|
1319
|
+
reference: input.reference,
|
|
1320
|
+
offset: input.offset,
|
|
1321
|
+
maxBytes
|
|
1322
|
+
});
|
|
1323
|
+
if (result.data.byteLength > maxBytes)
|
|
1324
|
+
throw new Error("Coding artifact store exceeded the requested byte budget");
|
|
1325
|
+
if (result.totalBytes !== undefined && result.totalBytes < input.offset + result.data.byteLength) {
|
|
1326
|
+
throw new Error("Coding artifact store returned inconsistent totalBytes");
|
|
1327
|
+
}
|
|
1328
|
+
return {
|
|
1329
|
+
reference: input.reference,
|
|
1330
|
+
offset: input.offset,
|
|
1331
|
+
text: new TextDecoder("utf-8", { fatal: true }).decode(result.data),
|
|
1332
|
+
bytes: result.data.byteLength,
|
|
1333
|
+
...result.totalBytes !== undefined && { totalBytes: result.totalBytes }
|
|
1334
|
+
};
|
|
1335
|
+
}
|
|
1336
|
+
}));
|
|
1337
|
+
if (artifacts.search) {
|
|
1338
|
+
const search = artifacts.search;
|
|
1339
|
+
artifactTools.push(defineRuntimeTool({
|
|
1340
|
+
name: AGENT_CODING_TOOL_NAMES.searchOutput,
|
|
1341
|
+
description: "Search a durable spilled output without loading it into context.",
|
|
1342
|
+
identity: { serviceName: "coding", action: "search-artifact", method: "POST" },
|
|
1343
|
+
input: z4.object({
|
|
1344
|
+
reference: z4.string().min(1),
|
|
1345
|
+
query: z4.string().min(1),
|
|
1346
|
+
maxMatches: z4.int().positive().max(limits.maxSearchResults).default(20)
|
|
1347
|
+
}).strict(),
|
|
1348
|
+
output: z4.object({
|
|
1349
|
+
reference: z4.string(),
|
|
1350
|
+
matches: z4.array(z4.object({ line: z4.int().positive(), text: z4.string() }))
|
|
1351
|
+
}).strict(),
|
|
1352
|
+
transports: ["AGENT"],
|
|
1353
|
+
handler: async ({ input }) => {
|
|
1354
|
+
await authorizeCodingTool(config, {
|
|
1355
|
+
operation: "artifact-search",
|
|
1356
|
+
reference: input.reference,
|
|
1357
|
+
query: input.query,
|
|
1358
|
+
maxMatches: input.maxMatches
|
|
1359
|
+
});
|
|
1360
|
+
const originAuthorization = await artifacts.authorization?.(input.reference);
|
|
1361
|
+
if (originAuthorization)
|
|
1362
|
+
await authorizeCodingTool(config, originAuthorization);
|
|
1363
|
+
return {
|
|
1364
|
+
reference: input.reference,
|
|
1365
|
+
matches: [
|
|
1366
|
+
...await search({
|
|
1367
|
+
reference: input.reference,
|
|
1368
|
+
query: input.query,
|
|
1369
|
+
maxMatches: input.maxMatches
|
|
1370
|
+
})
|
|
1371
|
+
]
|
|
1372
|
+
};
|
|
1373
|
+
}
|
|
1374
|
+
}));
|
|
1375
|
+
}
|
|
1376
|
+
}
|
|
1377
|
+
const commandTools = Object.keys(config.executables ?? {}).length ? [createShellCodingTool(config, limits)] : [];
|
|
1378
|
+
return [
|
|
1379
|
+
...createFileCodingTools(config, limits),
|
|
1380
|
+
...createListingCodingTools(config, limits),
|
|
1381
|
+
...createSearchAndPatchCodingTools(config, limits),
|
|
1382
|
+
...commandTools,
|
|
1383
|
+
...artifactTools
|
|
1384
|
+
];
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
export { AgentCodingToolLimitsSchema, AgentCodingToolAuthorizationSchema, AgentCodingToolPathAuthorizationSchema, createAgentCodingTools };
|