stitchkit 0.93.0 → 0.94.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +198 -0
- package/README.md +5 -2
- package/dist/agent-runtime/children-control.d.ts +6 -0
- package/dist/agent-runtime/children-control.d.ts.map +1 -0
- package/dist/agent-runtime/children-spawn.d.ts +6 -0
- package/dist/agent-runtime/children-spawn.d.ts.map +1 -0
- package/dist/agent-runtime/children-state.d.ts +46 -0
- package/dist/agent-runtime/children-state.d.ts.map +1 -0
- package/dist/agent-runtime/children-usage.d.ts +8 -0
- package/dist/agent-runtime/children-usage.d.ts.map +1 -0
- package/dist/agent-runtime/children.d.ts +11 -14
- package/dist/agent-runtime/children.d.ts.map +1 -1
- package/dist/agent-runtime/coding-shell-process.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-contract.d.ts +2 -1
- package/dist/agent-runtime/coding-tool-contract.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-listing.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-search-patch.d.ts.map +1 -1
- package/dist/agent-runtime/contained-darwin.d.ts +38 -0
- package/dist/agent-runtime/contained-darwin.d.ts.map +1 -0
- package/dist/agent-runtime/contained-files.d.ts +11 -26
- package/dist/agent-runtime/contained-files.d.ts.map +1 -1
- package/dist/agent-runtime/contained-scan.d.ts +21 -0
- package/dist/agent-runtime/contained-scan.d.ts.map +1 -0
- package/dist/agent-runtime/contained-write.d.ts +9 -0
- package/dist/agent-runtime/contained-write.d.ts.map +1 -0
- package/dist/agent-runtime/deferred-tool-types.d.ts +4 -3
- package/dist/agent-runtime/deferred-tool-types.d.ts.map +1 -1
- package/dist/agent-runtime/events.d.ts +1 -1
- package/dist/agent-runtime/events.d.ts.map +1 -1
- package/dist/agent-runtime/harness-control.d.ts +0 -1
- package/dist/agent-runtime/harness-control.d.ts.map +1 -1
- package/dist/agent-runtime/harness.d.ts +0 -5
- package/dist/agent-runtime/harness.d.ts.map +1 -1
- package/dist/agent-runtime/managed-tools.d.ts +3 -2
- package/dist/agent-runtime/managed-tools.d.ts.map +1 -1
- package/dist/agent-runtime/observability.d.ts +1 -1
- package/dist/agent-runtime/observability.d.ts.map +1 -1
- package/dist/agent-runtime/openrouter.d.ts +29 -0
- package/dist/agent-runtime/openrouter.d.ts.map +1 -0
- package/dist/agent-runtime/projections.d.ts +1 -1
- package/dist/agent-runtime/projections.d.ts.map +1 -1
- package/dist/agent-runtime/run-acquisition.d.ts +17 -0
- package/dist/agent-runtime/run-acquisition.d.ts.map +1 -0
- package/dist/agent-runtime/run-execution-state.d.ts +133 -0
- package/dist/agent-runtime/run-execution-state.d.ts.map +1 -0
- package/dist/agent-runtime/run-execution.d.ts +17 -33
- package/dist/agent-runtime/run-execution.d.ts.map +1 -1
- package/dist/agent-runtime/run-failure.d.ts +18 -0
- package/dist/agent-runtime/run-failure.d.ts.map +1 -0
- package/dist/agent-runtime/run-model-attempts.d.ts +6 -0
- package/dist/agent-runtime/run-model-attempts.d.ts.map +1 -0
- package/dist/agent-runtime/run-prompt-history.d.ts +58 -0
- package/dist/agent-runtime/run-prompt-history.d.ts.map +1 -0
- package/dist/agent-runtime/run-provider-ledger.d.ts +26 -0
- package/dist/agent-runtime/run-provider-ledger.d.ts.map +1 -0
- package/dist/agent-runtime/run-stream-parts.d.ts +17 -0
- package/dist/agent-runtime/run-stream-parts.d.ts.map +1 -0
- package/dist/agent-runtime/run-terminal.d.ts +11 -0
- package/dist/agent-runtime/run-terminal.d.ts.map +1 -0
- package/dist/agent-runtime/run-turn-preparation.d.ts +22 -0
- package/dist/agent-runtime/run-turn-preparation.d.ts.map +1 -0
- package/dist/agent-runtime/runtime-admission-gate.d.ts +29 -0
- package/dist/agent-runtime/runtime-admission-gate.d.ts.map +1 -0
- package/dist/agent-runtime/runtime-control.d.ts +9 -0
- package/dist/agent-runtime/runtime-control.d.ts.map +1 -0
- package/dist/agent-runtime/runtime-recovery.d.ts +10 -0
- package/dist/agent-runtime/runtime-recovery.d.ts.map +1 -0
- package/dist/agent-runtime/runtime-state.d.ts +36 -0
- package/dist/agent-runtime/runtime-state.d.ts.map +1 -0
- package/dist/agent-runtime/runtime-submit.d.ts +5 -0
- package/dist/agent-runtime/runtime-submit.d.ts.map +1 -0
- package/dist/agent-runtime/runtime.d.ts +10 -5
- package/dist/agent-runtime/runtime.d.ts.map +1 -1
- package/dist/agent-runtime/schedule-records.d.ts +34 -0
- package/dist/agent-runtime/schedule-records.d.ts.map +1 -0
- package/dist/agent-runtime/schedules.d.ts +34 -0
- package/dist/agent-runtime/schedules.d.ts.map +1 -1
- package/dist/agent-runtime/sqlite-bun.d.ts +12 -0
- package/dist/agent-runtime/sqlite-bun.d.ts.map +1 -0
- package/dist/agent-runtime/sqlite-events.d.ts +5 -0
- package/dist/agent-runtime/sqlite-events.d.ts.map +1 -0
- package/dist/agent-runtime/sqlite-history.d.ts +7 -0
- package/dist/agent-runtime/sqlite-history.d.ts.map +1 -0
- package/dist/agent-runtime/sqlite-ledger.d.ts +7 -0
- package/dist/agent-runtime/sqlite-ledger.d.ts.map +1 -0
- package/dist/agent-runtime/sqlite-node.d.ts +12 -0
- package/dist/agent-runtime/sqlite-node.d.ts.map +1 -0
- package/dist/agent-runtime/sqlite-reads.d.ts +14 -0
- package/dist/agent-runtime/sqlite-reads.d.ts.map +1 -0
- package/dist/agent-runtime/sqlite-rows.d.ts +178 -0
- package/dist/agent-runtime/sqlite-rows.d.ts.map +1 -0
- package/dist/agent-runtime/sqlite-schema.d.ts +7 -0
- package/dist/agent-runtime/sqlite-schema.d.ts.map +1 -0
- package/dist/agent-runtime/sqlite-transactions.d.ts +25 -0
- package/dist/agent-runtime/sqlite-transactions.d.ts.map +1 -0
- package/dist/agent-runtime/sqlite.d.ts +10 -6
- package/dist/agent-runtime/sqlite.d.ts.map +1 -1
- package/dist/agent-runtime/store-archive.d.ts +16 -0
- package/dist/agent-runtime/store-archive.d.ts.map +1 -0
- package/dist/agent-runtime/store-conformance-lifecycle.d.ts +434 -0
- package/dist/agent-runtime/store-conformance-lifecycle.d.ts.map +1 -0
- package/dist/agent-runtime/store-conformance-ordering.d.ts +18 -0
- package/dist/agent-runtime/store-conformance-ordering.d.ts.map +1 -0
- package/dist/agent-runtime/store-conformance-support.d.ts +130 -0
- package/dist/agent-runtime/store-conformance-support.d.ts.map +1 -0
- package/dist/agent-runtime/store-conformance-terminal.d.ts +12 -0
- package/dist/agent-runtime/store-conformance-terminal.d.ts.map +1 -0
- package/dist/agent-runtime/store-conformance.d.ts +40 -0
- package/dist/agent-runtime/store-conformance.d.ts.map +1 -0
- package/dist/agent-runtime/store-create.d.ts +11 -0
- package/dist/agent-runtime/store-create.d.ts.map +1 -0
- package/dist/agent-runtime/store-driver-contract.d.ts +814 -0
- package/dist/agent-runtime/store-driver-contract.d.ts.map +1 -0
- package/dist/agent-runtime/store-events.d.ts +7 -89
- package/dist/agent-runtime/store-events.d.ts.map +1 -1
- package/dist/agent-runtime/store-memory.d.ts +4 -0
- package/dist/agent-runtime/store-memory.d.ts.map +1 -0
- package/dist/agent-runtime/store-mutate.d.ts +13 -0
- package/dist/agent-runtime/store-mutate.d.ts.map +1 -0
- package/dist/agent-runtime/store-purge.d.ts +1 -1
- package/dist/agent-runtime/store-purge.d.ts.map +1 -1
- package/dist/agent-runtime/store-reads.d.ts +29 -0
- package/dist/agent-runtime/store-reads.d.ts.map +1 -0
- package/dist/agent-runtime/store-reduce-history.d.ts +10 -0
- package/dist/agent-runtime/store-reduce-history.d.ts.map +1 -0
- package/dist/agent-runtime/store-reduce-run.d.ts +14 -0
- package/dist/agent-runtime/store-reduce-run.d.ts.map +1 -0
- package/dist/agent-runtime/store-reduce-shared.d.ts +76 -0
- package/dist/agent-runtime/store-reduce-shared.d.ts.map +1 -0
- package/dist/agent-runtime/store-reduce-terminal.d.ts +6 -0
- package/dist/agent-runtime/store-reduce-terminal.d.ts.map +1 -0
- package/dist/agent-runtime/store-reducer.d.ts +24 -0
- package/dist/agent-runtime/store-reducer.d.ts.map +1 -0
- package/dist/agent-runtime/store-snapshot.d.ts +19 -0
- package/dist/agent-runtime/store-snapshot.d.ts.map +1 -0
- package/dist/agent-runtime/store.d.ts +1 -1
- package/dist/agent-runtime/store.d.ts.map +1 -1
- package/dist/application/admission-rate.d.ts +21 -0
- package/dist/application/admission-rate.d.ts.map +1 -0
- package/dist/application/admission-run.d.ts +8 -0
- package/dist/application/admission-run.d.ts.map +1 -0
- package/dist/application/admission.d.ts +1 -1
- package/dist/application/admission.d.ts.map +1 -1
- package/dist/application/diagnostic-journal-lock.d.ts +9 -34
- package/dist/application/diagnostic-journal-lock.d.ts.map +1 -1
- package/dist/application/diagnostic-journal-manager.d.ts.map +1 -1
- package/dist/application/diagnostic-journal-storage.d.ts.map +1 -1
- package/dist/application/events.d.ts +1 -1
- package/dist/application/events.d.ts.map +1 -1
- package/dist/application/file-state-store.d.ts +23 -0
- package/dist/application/file-state-store.d.ts.map +1 -0
- package/dist/application/health.d.ts +1 -1
- package/dist/application/health.d.ts.map +1 -1
- package/dist/application/kernel-admission.d.ts +8 -0
- package/dist/application/kernel-admission.d.ts.map +1 -0
- package/dist/application/kernel-contract.d.ts +142 -0
- package/dist/application/kernel-contract.d.ts.map +1 -0
- package/dist/application/kernel-resource-context.d.ts +24 -0
- package/dist/application/kernel-resource-context.d.ts.map +1 -0
- package/dist/application/kernel-restart.d.ts +5 -0
- package/dist/application/kernel-restart.d.ts.map +1 -0
- package/dist/application/kernel-rollback.d.ts +4 -0
- package/dist/application/kernel-rollback.d.ts.map +1 -0
- package/dist/application/kernel-shutdown.d.ts +6 -0
- package/dist/application/kernel-shutdown.d.ts.map +1 -0
- package/dist/application/kernel-start.d.ts +20 -0
- package/dist/application/kernel-start.d.ts.map +1 -0
- package/dist/application/kernel-state.d.ts +116 -0
- package/dist/application/kernel-state.d.ts.map +1 -0
- package/dist/application/kernel.d.ts +9 -140
- package/dist/application/kernel.d.ts.map +1 -1
- package/dist/application/latest-sink.d.ts +1 -1
- package/dist/application/latest-sink.d.ts.map +1 -1
- package/dist/application/notification-outbox.d.ts.map +1 -1
- package/dist/application/opentelemetry.d.ts +1 -1
- package/dist/application/opentelemetry.d.ts.map +1 -1
- package/dist/application/schedule.d.ts +0 -1
- package/dist/application/schedule.d.ts.map +1 -1
- package/dist/application/watch-hub-core.d.ts +122 -0
- package/dist/application/watch-hub-core.d.ts.map +1 -0
- package/dist/application/watch-hub.d.ts +3 -3
- package/dist/application/watch-hub.d.ts.map +1 -1
- package/dist/browser/client-executors.d.ts +14 -0
- package/dist/browser/client-executors.d.ts.map +1 -0
- package/dist/browser/client-multipart.d.ts +1 -1
- package/dist/browser/client-multipart.d.ts.map +1 -1
- package/dist/browser/client-url.d.ts +1 -1
- package/dist/browser/client-url.d.ts.map +1 -1
- package/dist/browser/client.d.ts +3 -2
- package/dist/browser/client.d.ts.map +1 -1
- package/dist/browser/contract-stream.d.ts +1 -1
- package/dist/browser/contract-stream.d.ts.map +1 -1
- package/dist/browser/http-fetch.d.ts +22 -0
- package/dist/browser/http-fetch.d.ts.map +1 -0
- package/dist/browser/http.d.ts +2 -4
- package/dist/browser/http.d.ts.map +1 -1
- package/dist/browser/live-state-core.d.ts +63 -0
- package/dist/browser/live-state-core.d.ts.map +1 -0
- package/dist/browser/live-state.d.ts.map +1 -1
- package/dist/browser/realtime-client.d.ts +26 -0
- package/dist/browser/realtime-client.d.ts.map +1 -0
- package/dist/browser/resumable.d.ts +1 -28
- package/dist/browser/resumable.d.ts.map +1 -1
- package/dist/browser/retained.d.ts.map +1 -0
- package/dist/browser/socket-io-connection.d.ts +82 -0
- package/dist/browser/socket-io-connection.d.ts.map +1 -0
- package/dist/browser/socket-io-peer.d.ts +20 -0
- package/dist/browser/socket-io-peer.d.ts.map +1 -0
- package/dist/browser/socket-io-trace.d.ts +31 -0
- package/dist/browser/socket-io-trace.d.ts.map +1 -0
- package/dist/browser/socket-io.d.ts +24 -18
- package/dist/browser/socket-io.d.ts.map +1 -1
- package/dist/browser/stream.d.ts +14 -2
- package/dist/browser/stream.d.ts.map +1 -1
- package/dist/contract/client-types.d.ts +134 -0
- package/dist/contract/client-types.d.ts.map +1 -0
- package/dist/contract/define-validation.d.ts +30 -0
- package/dist/contract/define-validation.d.ts.map +1 -0
- package/dist/contract/define.d.ts +47 -394
- package/dist/contract/define.d.ts.map +1 -1
- package/dist/contract/normalize.d.ts +56 -0
- package/dist/contract/normalize.d.ts.map +1 -0
- package/dist/contract/runtime-context.d.ts +131 -0
- package/dist/contract/runtime-context.d.ts.map +1 -0
- package/dist/contract/tool-options.d.ts +105 -0
- package/dist/contract/tool-options.d.ts.map +1 -0
- package/dist/contract/tool-view.d.ts +148 -0
- package/dist/contract/tool-view.d.ts.map +1 -0
- package/dist/declaration/declaration.d.ts.map +1 -0
- package/dist/durability/contract.d.ts +259 -0
- package/dist/durability/contract.d.ts.map +1 -0
- package/dist/durability/effect.d.ts +24 -0
- package/dist/durability/effect.d.ts.map +1 -0
- package/dist/durability/engine.d.ts +14 -0
- package/dist/durability/engine.d.ts.map +1 -0
- package/dist/durability/events.d.ts +103 -0
- package/dist/durability/events.d.ts.map +1 -0
- package/dist/durability/json.d.ts +3 -0
- package/dist/durability/json.d.ts.map +1 -0
- package/dist/durability/ledger.d.ts +27 -0
- package/dist/durability/ledger.d.ts.map +1 -0
- package/dist/durability/parks.d.ts +22 -0
- package/dist/durability/parks.d.ts.map +1 -0
- package/dist/durability/scheduler.d.ts +30 -0
- package/dist/durability/scheduler.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime/browser.d.ts +5 -0
- package/dist/entrypoints/agent-runtime/browser.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime/browser.js +124 -0
- package/dist/entrypoints/agent-runtime/coding-tools.d.ts +2 -0
- package/dist/entrypoints/agent-runtime/coding-tools.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime/coding-tools.js +22 -0
- package/dist/entrypoints/agent-runtime/harness.d.ts +2 -0
- package/dist/entrypoints/agent-runtime/harness.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime/harness.js +739 -0
- package/dist/entrypoints/agent-runtime/openrouter.d.ts +2 -0
- package/dist/entrypoints/agent-runtime/openrouter.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime/openrouter.js +270 -0
- package/dist/entrypoints/agent-runtime/sandbox.d.ts +5 -0
- package/dist/entrypoints/agent-runtime/sandbox.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime/sandbox.js +797 -0
- package/dist/entrypoints/agent-runtime/sqlite/bun.d.ts +2 -0
- package/dist/entrypoints/agent-runtime/sqlite/bun.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime/sqlite/bun.js +44 -0
- package/dist/entrypoints/agent-runtime/sqlite/node.d.ts +2 -0
- package/dist/entrypoints/agent-runtime/sqlite/node.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime/sqlite/node.js +46 -0
- package/dist/entrypoints/agent-runtime/testing.d.ts +4 -0
- package/dist/entrypoints/agent-runtime/testing.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime/testing.js +1116 -0
- package/dist/entrypoints/agent-runtime.d.ts +42 -0
- package/dist/entrypoints/agent-runtime.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime.js +2670 -0
- package/dist/entrypoints/application/diagnostic-journal.d.ts +21 -0
- package/dist/entrypoints/application/diagnostic-journal.d.ts.map +1 -0
- package/dist/entrypoints/application/diagnostic-journal.js +492 -0
- package/dist/entrypoints/application/grammy.d.ts +2 -0
- package/dist/entrypoints/application/grammy.d.ts.map +1 -0
- package/dist/entrypoints/application/grammy.js +169 -0
- package/dist/entrypoints/application/opentelemetry.d.ts +2 -0
- package/dist/entrypoints/application/opentelemetry.d.ts.map +1 -0
- package/dist/entrypoints/application/opentelemetry.js +250 -0
- package/dist/entrypoints/application/schemas.d.ts +15 -0
- package/dist/entrypoints/application/schemas.d.ts.map +1 -0
- package/dist/entrypoints/application/schemas.js +27 -0
- package/dist/entrypoints/application.d.ts +23 -0
- package/dist/entrypoints/application.d.ts.map +1 -0
- package/dist/entrypoints/application.js +2016 -0
- package/dist/entrypoints/bin/upgrade-cli.d.ts.map +1 -0
- package/dist/entrypoints/bin/upgrade-cli.js +177 -0
- package/dist/entrypoints/cli.d.ts +44 -0
- package/dist/entrypoints/cli.d.ts.map +1 -0
- package/dist/entrypoints/cli.js +773 -0
- package/dist/entrypoints/contract.d.ts +12 -0
- package/dist/entrypoints/contract.d.ts.map +1 -0
- package/dist/entrypoints/contract.js +64 -0
- package/dist/entrypoints/declaration.d.ts +2 -0
- package/dist/entrypoints/declaration.d.ts.map +1 -0
- package/dist/entrypoints/declaration.js +183 -0
- package/dist/entrypoints/files.d.ts +5 -0
- package/dist/entrypoints/files.d.ts.map +1 -0
- package/dist/entrypoints/files.js +111 -0
- package/dist/entrypoints/geo.d.ts +3 -0
- package/dist/entrypoints/geo.d.ts.map +1 -0
- package/dist/entrypoints/geo.js +245 -0
- package/dist/entrypoints/google.d.ts +2 -0
- package/dist/entrypoints/google.d.ts.map +1 -0
- package/dist/entrypoints/google.js +175 -0
- package/dist/entrypoints/index.d.ts +17 -0
- package/dist/entrypoints/index.d.ts.map +1 -0
- package/dist/entrypoints/index.js +764 -0
- package/dist/entrypoints/live.d.ts +19 -0
- package/dist/entrypoints/live.d.ts.map +1 -0
- package/dist/entrypoints/live.js +302 -0
- package/dist/entrypoints/node.d.ts +19 -0
- package/dist/entrypoints/node.d.ts.map +1 -0
- package/dist/entrypoints/node.js +308 -0
- package/dist/entrypoints/oauth.d.ts +2 -0
- package/dist/entrypoints/oauth.d.ts.map +1 -0
- package/dist/entrypoints/oauth.js +170 -0
- package/dist/entrypoints/observability.d.ts +19 -0
- package/dist/entrypoints/observability.d.ts.map +1 -0
- package/dist/entrypoints/observability.js +567 -0
- package/dist/entrypoints/primitives.d.ts +3 -0
- package/dist/entrypoints/primitives.d.ts.map +1 -0
- package/dist/entrypoints/primitives.js +749 -0
- package/dist/entrypoints/react.d.ts +5 -0
- package/dist/entrypoints/react.d.ts.map +1 -0
- package/dist/entrypoints/react.js +403 -0
- package/dist/entrypoints/release.d.ts +15 -0
- package/dist/entrypoints/release.d.ts.map +1 -0
- package/dist/entrypoints/release.js +196 -0
- package/dist/entrypoints/remote.d.ts +9 -0
- package/dist/entrypoints/remote.d.ts.map +1 -0
- package/dist/entrypoints/remote.js +66 -0
- package/dist/entrypoints/server.d.ts +39 -0
- package/dist/entrypoints/server.d.ts.map +1 -0
- package/dist/entrypoints/server.js +2009 -0
- package/dist/entrypoints/telegram.d.ts +3 -0
- package/dist/entrypoints/telegram.d.ts.map +1 -0
- package/dist/entrypoints/telegram.js +224 -0
- package/dist/entrypoints/testing.d.ts +10 -0
- package/dist/entrypoints/testing.d.ts.map +1 -0
- package/dist/entrypoints/testing.js +1377 -0
- package/dist/entrypoints/tools/connections.d.ts +19 -0
- package/dist/entrypoints/tools/connections.d.ts.map +1 -0
- package/dist/entrypoints/tools/connections.js +1110 -0
- package/dist/entrypoints/tools/contract.d.ts +29 -0
- package/dist/entrypoints/tools/contract.d.ts.map +1 -0
- package/dist/entrypoints/tools/contract.js +24 -0
- package/dist/entrypoints/tools/invoker.d.ts +9 -0
- package/dist/entrypoints/tools/invoker.d.ts.map +1 -0
- package/dist/entrypoints/tools/invoker.js +20 -0
- package/dist/entrypoints/tools.d.ts +54 -0
- package/dist/entrypoints/tools.d.ts.map +1 -0
- package/dist/entrypoints/tools.js +3009 -0
- package/dist/entrypoints/tracking/server.d.ts +15 -0
- package/dist/entrypoints/tracking/server.d.ts.map +1 -0
- package/dist/entrypoints/tracking.d.ts +24 -0
- package/dist/entrypoints/tracking.d.ts.map +1 -0
- package/dist/entrypoints/tracking.js +1140 -0
- package/dist/files/boundary.d.ts.map +1 -1
- package/dist/files/file-io.d.ts +14 -0
- package/dist/files/file-io.d.ts.map +1 -0
- package/dist/google/google.d.ts.map +1 -0
- package/dist/index-0b1ess5e.js +38 -0
- package/dist/index-1j8pm5t0.js +412 -0
- package/dist/index-1zbbzgfh.js +89 -0
- package/dist/index-2bxbyab0.js +47 -0
- package/dist/index-2gxzjvyr.js +266 -0
- package/dist/index-35mh5bhj.js +177 -0
- package/dist/index-48ffdxgk.js +6 -0
- package/dist/index-4gcnakhx.js +82 -0
- package/dist/index-55hkhm67.js +343 -0
- package/dist/index-79z7m7dt.js +675 -0
- package/dist/index-7f68ghdn.js +3618 -0
- package/dist/index-7p1f0vp2.js +154 -0
- package/dist/index-83bdg97s.js +16 -0
- package/dist/index-863ea9jb.js +154 -0
- package/dist/index-8p52kd5p.js +242 -0
- package/dist/index-d9pk3td4.js +326 -0
- package/dist/index-dce5wxcq.js +63 -0
- package/dist/index-e01r054k.js +105 -0
- package/dist/index-ensd0r74.js +595 -0
- package/dist/index-eqqvgdb3.js +46 -0
- package/dist/index-gxrt5h6v.js +341 -0
- package/dist/index-h6eeys1v.js +211 -0
- package/dist/index-ham5sz8m.js +734 -0
- package/dist/index-het2he5g.js +1387 -0
- package/dist/index-hffjpmq9.js +30 -0
- package/dist/index-hmp4800j.js +51 -0
- package/dist/index-k30h66yd.js +317 -0
- package/dist/index-k5hsfc3j.js +31 -0
- package/dist/index-khtgb21r.js +92 -0
- package/dist/index-m9zn6cpq.js +51 -0
- package/dist/index-ndddxtyx.js +324 -0
- package/dist/index-ngfhvfpd.js +30 -0
- package/dist/index-np4m8hd3.js +1205 -0
- package/dist/index-p3vsv1fb.js +3493 -0
- package/dist/index-p5r7qpdd.js +85 -0
- package/dist/index-p9e0w8hs.js +1084 -0
- package/dist/index-p9sh0xx4.js +64 -0
- package/dist/index-paz6sgdp.js +371 -0
- package/dist/index-px2gm2jp.js +448 -0
- package/dist/index-qwhynv6x.js +103 -0
- package/dist/index-s812ycat.js +65 -0
- package/dist/index-sp1tzwnb.js +281 -0
- package/dist/index-t9rhjr9f.js +2306 -0
- package/dist/index-v260df89.js +342 -0
- package/dist/index-w906953s.js +946 -0
- package/dist/index-wdkt63w3.js +214 -0
- package/dist/index-wqgjfstn.js +18 -0
- package/dist/index-wsm5w4ee.js +1023 -0
- package/dist/index-xw3s75nj.js +100 -0
- package/dist/index-yw4fzmdz.js +268 -0
- package/dist/index-zfrhfn82.js +85 -0
- package/dist/index-znfs20ss.js +98 -0
- package/dist/internal/atomic-file.d.ts +23 -2
- package/dist/internal/atomic-file.d.ts.map +1 -1
- package/dist/internal/backoff.d.ts +29 -0
- package/dist/internal/backoff.d.ts.map +1 -0
- package/dist/internal/canonical-json.d.ts +21 -11
- package/dist/internal/canonical-json.d.ts.map +1 -1
- package/dist/internal/channel.d.ts.map +1 -0
- package/dist/internal/exclusive-lock.d.ts +51 -0
- package/dist/internal/exclusive-lock.d.ts.map +1 -0
- package/dist/internal/logger.d.ts.map +1 -0
- package/dist/internal/process-identity.d.ts +47 -0
- package/dist/internal/process-identity.d.ts.map +1 -0
- package/dist/internal/request.d.ts.map +1 -0
- package/dist/internal/stable-digest.d.ts +0 -43
- package/dist/internal/stable-digest.d.ts.map +1 -1
- package/dist/internal/typed.d.ts +0 -8
- package/dist/internal/typed.d.ts.map +1 -1
- package/dist/internal/with-exclusive-lock.d.ts +67 -0
- package/dist/internal/with-exclusive-lock.d.ts.map +1 -0
- package/dist/internal/zod-issues.d.ts +38 -0
- package/dist/internal/zod-issues.d.ts.map +1 -0
- package/dist/json-schema/dialect.d.ts +17 -0
- package/dist/json-schema/dialect.d.ts.map +1 -0
- package/dist/json-schema/json-schema.d.ts.map +1 -0
- package/dist/live/watch-client.d.ts.map +1 -1
- package/dist/live/watch-delta.d.ts.map +1 -1
- package/dist/oauth/authorization-code.d.ts +57 -0
- package/dist/oauth/authorization-code.d.ts.map +1 -0
- package/dist/observability/audit.d.ts +3 -3
- package/dist/observability/audit.d.ts.map +1 -1
- package/dist/observability/bounded-logger.d.ts +1 -1
- package/dist/observability/bounded-logger.d.ts.map +1 -1
- package/dist/observability/bounded-sink.d.ts +81 -0
- package/dist/observability/bounded-sink.d.ts.map +1 -0
- package/dist/observability/context.d.ts +1 -1
- package/dist/observability/context.d.ts.map +1 -1
- package/dist/observability/event.d.ts +2 -1
- package/dist/observability/event.d.ts.map +1 -1
- package/dist/observability/work.d.ts +1 -1
- package/dist/observability/work.d.ts.map +1 -1
- package/dist/primitives/audit.d.ts +1 -1
- package/dist/primitives/audit.d.ts.map +1 -1
- package/dist/primitives/export-operation.d.ts +4 -2
- package/dist/primitives/export-operation.d.ts.map +1 -1
- package/dist/realtime/registry.d.ts +0 -5
- package/dist/realtime/registry.d.ts.map +1 -1
- package/dist/realtime/socket.d.ts +1 -1
- package/dist/realtime/socket.d.ts.map +1 -1
- package/dist/server/bun.d.ts +0 -1
- package/dist/server/bun.d.ts.map +1 -1
- package/dist/server/context-contribution.d.ts +1 -1
- package/dist/server/context-contribution.d.ts.map +1 -1
- package/dist/server/context.d.ts +2 -2
- package/dist/server/context.d.ts.map +1 -1
- package/dist/server/contract-method.d.ts +15 -0
- package/dist/server/contract-method.d.ts.map +1 -0
- package/dist/server/contract-stream.d.ts +1 -1
- package/dist/server/contract-stream.d.ts.map +1 -1
- package/dist/server/create.d.ts +8 -0
- package/dist/server/create.d.ts.map +1 -1
- package/dist/server/endpoint-dispatch.d.ts +10 -0
- package/dist/server/endpoint-dispatch.d.ts.map +1 -0
- package/dist/server/endpoint-response.d.ts +19 -0
- package/dist/server/endpoint-response.d.ts.map +1 -0
- package/dist/server/error-dispatch.d.ts +17 -1
- package/dist/server/error-dispatch.d.ts.map +1 -1
- package/dist/server/error-hook.d.ts +2 -2
- package/dist/server/error-hook.d.ts.map +1 -1
- package/dist/server/handler-state.d.ts +44 -0
- package/dist/server/handler-state.d.ts.map +1 -0
- package/dist/server/implement-registry.d.ts +54 -0
- package/dist/server/implement-registry.d.ts.map +1 -0
- package/dist/server/implement.d.ts +9 -55
- package/dist/server/implement.d.ts.map +1 -1
- package/dist/server/middleware/auth.d.ts +1 -31
- package/dist/server/middleware/auth.d.ts.map +1 -1
- package/dist/server/middleware/cors.d.ts +17 -0
- package/dist/server/middleware/cors.d.ts.map +1 -1
- package/dist/server/middleware/jwt.d.ts +31 -0
- package/dist/server/middleware/jwt.d.ts.map +1 -0
- package/dist/server/middleware/trust-fence.d.ts +1 -1
- package/dist/server/middleware/trust-fence.d.ts.map +1 -1
- package/dist/server/multipart-reader.d.ts +22 -0
- package/dist/server/multipart-reader.d.ts.map +1 -0
- package/dist/server/multipart.d.ts +1 -1
- package/dist/server/multipart.d.ts.map +1 -1
- package/dist/server/oauth/cimd.d.ts +88 -0
- package/dist/server/oauth/cimd.d.ts.map +1 -0
- package/dist/server/oauth/endpoints.d.ts +39 -0
- package/dist/server/oauth/endpoints.d.ts.map +1 -0
- package/dist/server/oauth/metadata.d.ts +28 -0
- package/dist/server/oauth/metadata.d.ts.map +1 -0
- package/dist/server/oauth/provider.d.ts +117 -0
- package/dist/server/oauth/provider.d.ts.map +1 -0
- package/dist/server/realtime.d.ts +1 -1
- package/dist/server/realtime.d.ts.map +1 -1
- package/dist/server/request-completion.d.ts +16 -0
- package/dist/server/request-completion.d.ts.map +1 -0
- package/dist/server/response-metadata.d.ts +1 -1
- package/dist/server/response-metadata.d.ts.map +1 -1
- package/dist/server/route-table.d.ts +9 -0
- package/dist/server/route-table.d.ts.map +1 -0
- package/dist/server/stream.d.ts +0 -13
- package/dist/server/stream.d.ts.map +1 -1
- package/dist/server/streaming-pump.d.ts +66 -0
- package/dist/server/streaming-pump.d.ts.map +1 -0
- package/dist/server/streaming-route.d.ts +12 -5
- package/dist/server/streaming-route.d.ts.map +1 -1
- package/dist/server/types.d.ts +10 -4
- package/dist/server/types.d.ts.map +1 -1
- package/dist/server/unix-client-bun.d.ts.map +1 -1
- package/dist/server/unix-client-http1.d.ts +76 -0
- package/dist/server/unix-client-http1.d.ts.map +1 -0
- package/dist/server/unix-client.d.ts.map +1 -1
- package/dist/testing/handler-clients.d.ts +32 -0
- package/dist/testing/handler-clients.d.ts.map +1 -0
- package/dist/testing/managed-resource-conformance-scenarios.d.ts.map +1 -1
- package/dist/testing/realtime-probe.d.ts +33 -0
- package/dist/testing/realtime-probe.d.ts.map +1 -0
- package/dist/testing/surface-conformance.d.ts +2 -32
- package/dist/testing/surface-conformance.d.ts.map +1 -1
- package/dist/testing/surface-manifest-digest.d.ts +44 -0
- package/dist/testing/surface-manifest-digest.d.ts.map +1 -0
- package/dist/testing/surface-manifest.d.ts +30 -4
- package/dist/testing/surface-manifest.d.ts.map +1 -1
- package/dist/tools/agent.d.ts +1 -1
- package/dist/tools/agent.d.ts.map +1 -1
- package/dist/tools/cli/args-fields.d.ts +31 -0
- package/dist/tools/cli/args-fields.d.ts.map +1 -0
- package/dist/tools/cli/args-route.d.ts +42 -0
- package/dist/tools/cli/args-route.d.ts.map +1 -0
- package/dist/tools/cli/args-view.d.ts +32 -0
- package/dist/tools/cli/args-view.d.ts.map +1 -0
- package/dist/tools/cli/args.d.ts +80 -0
- package/dist/tools/cli/args.d.ts.map +1 -0
- package/dist/tools/cli/argument-error.d.ts +5 -0
- package/dist/tools/cli/argument-error.d.ts.map +1 -0
- package/dist/tools/cli/checkpoint.d.ts +24 -0
- package/dist/tools/cli/checkpoint.d.ts.map +1 -0
- package/dist/tools/cli/command.d.ts +70 -0
- package/dist/tools/cli/command.d.ts.map +1 -0
- package/dist/tools/cli/config.d.ts +90 -0
- package/dist/tools/cli/config.d.ts.map +1 -0
- package/dist/tools/cli/create-cli.d.ts +36 -0
- package/dist/tools/cli/create-cli.d.ts.map +1 -0
- package/dist/tools/cli/download.d.ts +8 -0
- package/dist/tools/cli/download.d.ts.map +1 -0
- package/dist/tools/cli/format.d.ts +50 -0
- package/dist/tools/cli/format.d.ts.map +1 -0
- package/dist/tools/cli/help.d.ts +24 -0
- package/dist/tools/cli/help.d.ts.map +1 -0
- package/dist/tools/cli/installer.d.ts +34 -0
- package/dist/tools/cli/installer.d.ts.map +1 -0
- package/dist/tools/cli/invoke.d.ts +144 -0
- package/dist/tools/cli/invoke.d.ts.map +1 -0
- package/dist/tools/cli/io.d.ts +10 -0
- package/dist/tools/cli/io.d.ts.map +1 -0
- package/dist/tools/cli/managed-surface.d.ts +30 -0
- package/dist/tools/cli/managed-surface.d.ts.map +1 -0
- package/dist/tools/cli/manifest.d.ts +80 -0
- package/dist/tools/cli/manifest.d.ts.map +1 -0
- package/dist/tools/cli/policy.d.ts +27 -0
- package/dist/tools/cli/policy.d.ts.map +1 -0
- package/dist/tools/cli/prepare.d.ts +14 -0
- package/dist/tools/cli/prepare.d.ts.map +1 -0
- package/dist/tools/cli/profile.d.ts +40 -0
- package/dist/tools/cli/profile.d.ts.map +1 -0
- package/dist/tools/cli/run-managed.d.ts +5 -0
- package/dist/tools/cli/run-managed.d.ts.map +1 -0
- package/dist/tools/cli/run-native.d.ts +9 -0
- package/dist/tools/cli/run-native.d.ts.map +1 -0
- package/dist/tools/cli/session.d.ts +40 -0
- package/dist/tools/cli/session.d.ts.map +1 -0
- package/dist/tools/cli/signature.d.ts +81 -0
- package/dist/tools/cli/signature.d.ts.map +1 -0
- package/dist/tools/cli/stream.d.ts +93 -0
- package/dist/tools/cli/stream.d.ts.map +1 -0
- package/dist/tools/cli/update.d.ts +145 -0
- package/dist/tools/cli/update.d.ts.map +1 -0
- package/dist/tools/cli/view.d.ts +12 -0
- package/dist/tools/cli/view.d.ts.map +1 -0
- package/dist/tools/cli/wait.d.ts +54 -0
- package/dist/tools/cli/wait.d.ts.map +1 -0
- package/dist/tools/connections/runtime.d.ts +1 -1
- package/dist/tools/connections/runtime.d.ts.map +1 -1
- package/dist/tools/connections/types.d.ts +3 -3
- package/dist/tools/connections/types.d.ts.map +1 -1
- package/dist/tools/durability-context.d.ts +1 -1
- package/dist/tools/durability-context.d.ts.map +1 -1
- package/dist/tools/execute-args.d.ts +23 -0
- package/dist/tools/execute-args.d.ts.map +1 -0
- package/dist/tools/execute-hooks.d.ts +146 -0
- package/dist/tools/execute-hooks.d.ts.map +1 -0
- package/dist/tools/execute-result.d.ts +40 -0
- package/dist/tools/execute-result.d.ts.map +1 -0
- package/dist/tools/execute.d.ts +31 -193
- package/dist/tools/execute.d.ts.map +1 -1
- package/dist/tools/internal/surface-projector.d.ts +9 -6
- package/dist/tools/internal/surface-projector.d.ts.map +1 -1
- package/dist/tools/internal/tool-view.d.ts +41 -0
- package/dist/tools/internal/tool-view.d.ts.map +1 -0
- package/dist/tools/invoker.d.ts +13 -4
- package/dist/tools/invoker.d.ts.map +1 -1
- package/dist/tools/lifecycle.d.ts +1 -1
- package/dist/tools/lifecycle.d.ts.map +1 -1
- package/dist/tools/list-names.d.ts +3 -3
- package/dist/tools/list-names.d.ts.map +1 -1
- package/dist/tools/manifest.d.ts +2 -2
- package/dist/tools/manifest.d.ts.map +1 -1
- package/dist/tools/mcp/app.d.ts +62 -0
- package/dist/tools/mcp/app.d.ts.map +1 -0
- package/dist/tools/mcp/catalog.d.ts +68 -0
- package/dist/tools/mcp/catalog.d.ts.map +1 -0
- package/dist/tools/mcp/handler.d.ts +46 -0
- package/dist/tools/mcp/handler.d.ts.map +1 -0
- package/dist/tools/mcp/mount.d.ts +152 -0
- package/dist/tools/mcp/mount.d.ts.map +1 -0
- package/dist/tools/mcp/prepare.d.ts +76 -0
- package/dist/tools/mcp/prepare.d.ts.map +1 -0
- package/dist/tools/mcp/progress.d.ts +46 -0
- package/dist/tools/mcp/progress.d.ts.map +1 -0
- package/dist/tools/mcp/register.d.ts +36 -0
- package/dist/tools/mcp/register.d.ts.map +1 -0
- package/dist/tools/mcp/round-context.d.ts +38 -0
- package/dist/tools/mcp/round-context.d.ts.map +1 -0
- package/dist/tools/mcp/round-policy.d.ts +33 -0
- package/dist/tools/mcp/round-policy.d.ts.map +1 -0
- package/dist/tools/mcp/round.d.ts +53 -0
- package/dist/tools/mcp/round.d.ts.map +1 -0
- package/dist/tools/mcp/runtime-tools.d.ts +25 -0
- package/dist/tools/mcp/runtime-tools.d.ts.map +1 -0
- package/dist/tools/mcp/stdio-signals.d.ts +33 -0
- package/dist/tools/mcp/stdio-signals.d.ts.map +1 -0
- package/dist/tools/mcp/stdio.d.ts +20 -0
- package/dist/tools/mcp/stdio.d.ts.map +1 -0
- package/dist/tools/mcp/trace.d.ts +12 -0
- package/dist/tools/mcp/trace.d.ts.map +1 -0
- package/dist/tools/mount.d.ts +14 -7
- package/dist/tools/mount.d.ts.map +1 -1
- package/dist/tools/native-definition.d.ts +4 -3
- package/dist/tools/native-definition.d.ts.map +1 -1
- package/dist/tools/operations/async-operation-binding-types.d.ts +127 -0
- package/dist/tools/operations/async-operation-binding-types.d.ts.map +1 -0
- package/dist/tools/operations/async-operation-binding.d.ts +28 -0
- package/dist/tools/operations/async-operation-binding.d.ts.map +1 -0
- package/dist/tools/operations/async-operation-canonical-types.d.ts +110 -0
- package/dist/tools/operations/async-operation-canonical-types.d.ts.map +1 -0
- package/dist/tools/operations/async-operation-canonical.d.ts +7 -0
- package/dist/tools/operations/async-operation-canonical.d.ts.map +1 -0
- package/dist/tools/operations/async-operation-contract.d.ts.map +1 -0
- package/dist/tools/operations/async-operation-id.d.ts +23 -0
- package/dist/tools/operations/async-operation-id.d.ts.map +1 -0
- package/dist/tools/operations/async-operation-runtime-tools.d.ts +41 -0
- package/dist/tools/operations/async-operation-runtime-tools.d.ts.map +1 -0
- package/dist/tools/operations/async-operation-runtime-types.d.ts +69 -0
- package/dist/tools/operations/async-operation-runtime-types.d.ts.map +1 -0
- package/dist/tools/operations/async-operation-runtime.d.ts +5 -0
- package/dist/tools/operations/async-operation-runtime.d.ts.map +1 -0
- package/dist/tools/operations/define-wait-tool.d.ts +22 -0
- package/dist/tools/operations/define-wait-tool.d.ts.map +1 -0
- package/dist/tools/operations/mount-wait.d.ts.map +1 -0
- package/dist/tools/operations/wait-core.d.ts.map +1 -0
- package/dist/tools/remote.d.ts +1 -1
- package/dist/tools/remote.d.ts.map +1 -1
- package/dist/tools/runtime-tool.d.ts +13 -4
- package/dist/tools/runtime-tool.d.ts.map +1 -1
- package/dist/tools/schema/coerce.d.ts.map +1 -0
- package/dist/tools/schema/flatten-join.d.ts.map +1 -0
- package/dist/tools/schema/flatten.d.ts.map +1 -0
- package/dist/tools/schema/portable-formats.d.ts.map +1 -0
- package/dist/tools/schema/presentation.d.ts +24 -0
- package/dist/tools/schema/presentation.d.ts.map +1 -0
- package/dist/tools/schema/schema.d.ts.map +1 -0
- package/dist/tools/schema/untyped-properties.d.ts.map +1 -0
- package/dist/tools/surface.d.ts +2 -3
- package/dist/tools/surface.d.ts.map +1 -1
- package/dist/tools/tool-logger.d.ts +1 -1
- package/dist/tools/tool-logger.d.ts.map +1 -1
- package/dist/tools/toolkit.d.ts +4 -4
- package/dist/tools/toolkit.d.ts.map +1 -1
- package/dist/tools/transfer/define-download-tool.d.ts +18 -0
- package/dist/tools/transfer/define-download-tool.d.ts.map +1 -0
- package/dist/tools/transfer/define-upload-tool.d.ts +16 -0
- package/dist/tools/transfer/define-upload-tool.d.ts.map +1 -0
- package/dist/tools/transfer/define-view-file-tool.d.ts +10 -0
- package/dist/tools/transfer/define-view-file-tool.d.ts.map +1 -0
- package/dist/tools/transfer/download-core.d.ts +20 -0
- package/dist/tools/transfer/download-core.d.ts.map +1 -0
- package/dist/tools/transfer/managed-file-error.d.ts +6 -0
- package/dist/tools/transfer/managed-file-error.d.ts.map +1 -0
- package/dist/tools/transfer/mount-download.d.ts +41 -0
- package/dist/tools/transfer/mount-download.d.ts.map +1 -0
- package/dist/tools/transfer/mount-upload.d.ts +21 -0
- package/dist/tools/transfer/mount-upload.d.ts.map +1 -0
- package/dist/tools/transfer/native-result.d.ts.map +1 -0
- package/dist/tools/transfer/upload-core.d.ts +4 -0
- package/dist/tools/transfer/upload-core.d.ts.map +1 -0
- package/dist/tools/transfer/view-file-contract.d.ts.map +1 -0
- package/dist/tools/transfer/view-file.d.ts +62 -0
- package/dist/tools/transfer/view-file.d.ts.map +1 -0
- package/dist/tools/transports.d.ts +1 -1
- package/dist/tools/transports.d.ts.map +1 -1
- package/dist/tracking/client-listeners.d.ts +30 -0
- package/dist/tracking/client-listeners.d.ts.map +1 -0
- package/dist/tracking/client-visit.d.ts +61 -0
- package/dist/tracking/client-visit.d.ts.map +1 -0
- package/dist/tracking/client.d.ts +3 -2
- package/dist/tracking/client.d.ts.map +1 -1
- package/dist/tracking/contract.d.ts +1 -1
- package/dist/tracking/contract.d.ts.map +1 -1
- package/llms/agent-runtime-browser.txt +33 -0
- package/llms/agent-runtime-coding-tools.txt +58 -0
- package/llms/agent-runtime-harness.txt +45 -0
- package/llms/agent-runtime-openrouter.txt +22 -0
- package/llms/agent-runtime-sandbox.txt +159 -0
- package/llms/agent-runtime-sqlite-bun.txt +29 -0
- package/llms/agent-runtime-sqlite-node.txt +26 -0
- package/llms/agent-runtime-testing.txt +30 -0
- package/llms/agent-runtime.2.txt +550 -0
- package/llms/agent-runtime.3.txt +311 -0
- package/llms/agent-runtime.txt +893 -0
- package/llms/application-diagnostic-journal.txt +30 -0
- package/llms/application-grammy.txt +27 -0
- package/llms/application-opentelemetry.txt +27 -0
- package/llms/application-schemas.txt +42 -0
- package/llms/application.2.txt +487 -0
- package/llms/application.txt +886 -0
- package/llms/cli.2.txt +80 -0
- package/llms/cli.txt +948 -0
- package/llms/contract.txt +606 -0
- package/llms/declaration.txt +286 -0
- package/llms/files.txt +33 -0
- package/llms/geo.txt +114 -0
- package/llms/google.txt +27 -0
- package/llms/live.txt +471 -0
- package/llms/node.txt +43 -0
- package/llms/oauth.txt +136 -0
- package/llms/observability.txt +893 -0
- package/llms/primitives.txt +158 -0
- package/llms/react.txt +184 -0
- package/llms/release.txt +176 -0
- package/llms/remote.txt +25 -0
- package/llms/server.2.txt +361 -0
- package/llms/server.3.txt +1031 -0
- package/llms/server.4.txt +905 -0
- package/llms/server.5.txt +250 -0
- package/llms/server.txt +996 -0
- package/llms/stitchkit.2.txt +836 -0
- package/llms/stitchkit.3.txt +147 -0
- package/llms/stitchkit.txt +260 -0
- package/llms/telegram.txt +30 -0
- package/llms/testing.txt +676 -0
- package/llms/tools-connections.txt +45 -0
- package/llms/tools-contract.txt +9 -0
- package/llms/tools-invoker.txt +9 -0
- package/llms/tools.2.txt +647 -0
- package/llms/tools.3.txt +288 -0
- package/llms/tools.txt +966 -0
- package/llms/tracking-server.txt +32 -0
- package/llms/tracking.txt +263 -0
- package/llms/upgrading-0.37.0-0.50.0.txt +947 -0
- package/llms/upgrading-0.53.0-0.67.0.txt +1174 -0
- package/llms/upgrading-0.68.0-0.94.0.txt +1159 -0
- package/llms/upgrading.txt +215 -0
- package/llms-full.txt +312 -77
- package/llms.txt +54 -5
- package/package.json +84 -83
- package/dist/agent-runtime/durability-contract.d.ts +0 -176
- package/dist/agent-runtime/durability-contract.d.ts.map +0 -1
- package/dist/agent-runtime/durability-json.d.ts +0 -3
- package/dist/agent-runtime/durability-json.d.ts.map +0 -1
- package/dist/agent-runtime/durability-ledger.d.ts +0 -16
- package/dist/agent-runtime/durability-ledger.d.ts.map +0 -1
- package/dist/agent-runtime/durability-scheduler.d.ts +0 -29
- package/dist/agent-runtime/durability-scheduler.d.ts.map +0 -1
- package/dist/agent-runtime/durability.d.ts +0 -14
- package/dist/agent-runtime/durability.d.ts.map +0 -1
- package/dist/agent-runtime/store-driver.d.ts +0 -814
- package/dist/agent-runtime/store-driver.d.ts.map +0 -1
- package/dist/agent-runtime-browser.d.ts +0 -5
- package/dist/agent-runtime-browser.d.ts.map +0 -1
- package/dist/agent-runtime-browser.js +0 -124
- package/dist/agent-runtime-coding-tools.d.ts +0 -2
- package/dist/agent-runtime-coding-tools.d.ts.map +0 -1
- package/dist/agent-runtime-coding-tools.js +0 -23
- package/dist/agent-runtime-harness.d.ts +0 -2
- package/dist/agent-runtime-harness.d.ts.map +0 -1
- package/dist/agent-runtime-harness.js +0 -729
- package/dist/agent-runtime-openrouter.d.ts +0 -29
- package/dist/agent-runtime-openrouter.d.ts.map +0 -1
- package/dist/agent-runtime-openrouter.js +0 -270
- package/dist/agent-runtime-sandbox.d.ts +0 -5
- package/dist/agent-runtime-sandbox.d.ts.map +0 -1
- package/dist/agent-runtime-sandbox.js +0 -798
- package/dist/agent-runtime-sqlite-bun.d.ts +0 -11
- package/dist/agent-runtime-sqlite-bun.d.ts.map +0 -1
- package/dist/agent-runtime-sqlite-bun.js +0 -42
- package/dist/agent-runtime-sqlite-node.d.ts +0 -11
- package/dist/agent-runtime-sqlite-node.d.ts.map +0 -1
- package/dist/agent-runtime-sqlite-node.js +0 -44
- package/dist/agent-runtime-testing.d.ts +0 -3
- package/dist/agent-runtime-testing.d.ts.map +0 -1
- package/dist/agent-runtime-testing.js +0 -156
- package/dist/agent-runtime.d.ts +0 -38
- package/dist/agent-runtime.d.ts.map +0 -1
- package/dist/agent-runtime.js +0 -2607
- package/dist/application/channel.d.ts.map +0 -1
- package/dist/application-diagnostic-journal.d.ts +0 -21
- package/dist/application-diagnostic-journal.d.ts.map +0 -1
- package/dist/application-diagnostic-journal.js +0 -632
- package/dist/application-grammy.d.ts +0 -2
- package/dist/application-grammy.d.ts.map +0 -1
- package/dist/application-grammy.js +0 -169
- package/dist/application-opentelemetry.d.ts +0 -2
- package/dist/application-opentelemetry.d.ts.map +0 -1
- package/dist/application-opentelemetry.js +0 -250
- package/dist/application-schemas.d.ts +0 -15
- package/dist/application-schemas.d.ts.map +0 -1
- package/dist/application-schemas.js +0 -27
- package/dist/application.d.ts +0 -22
- package/dist/application.d.ts.map +0 -1
- package/dist/application.js +0 -1977
- package/dist/cli.d.ts +0 -41
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js +0 -753
- package/dist/contract/index.d.ts +0 -8
- package/dist/contract/index.d.ts.map +0 -1
- package/dist/contract/index.js +0 -55
- package/dist/declaration.d.ts.map +0 -1
- package/dist/declaration.js +0 -183
- package/dist/files.d.ts +0 -3
- package/dist/files.d.ts.map +0 -1
- package/dist/files.js +0 -15
- package/dist/geo.d.ts +0 -3
- package/dist/geo.d.ts.map +0 -1
- package/dist/geo.js +0 -245
- package/dist/google.d.ts.map +0 -1
- package/dist/google.js +0 -175
- package/dist/index-0a349c33.js +0 -470
- package/dist/index-0j3vcp5m.js +0 -28
- package/dist/index-2c2bjw3s.js +0 -51
- package/dist/index-2na0qrfn.js +0 -214
- package/dist/index-2qzskm8h.js +0 -63
- package/dist/index-3bmnp41g.js +0 -2169
- package/dist/index-3xwxfj4z.js +0 -334
- package/dist/index-4fpa9dy2.js +0 -51
- package/dist/index-6kyksz9y.js +0 -268
- package/dist/index-77fekveh.js +0 -44
- package/dist/index-7gnkny4z.js +0 -326
- package/dist/index-7zbps32p.js +0 -89
- package/dist/index-9f8ztey6.js +0 -588
- package/dist/index-a11g2kry.js +0 -866
- package/dist/index-a916km3r.js +0 -45
- package/dist/index-actkayzn.js +0 -367
- package/dist/index-bn2cjajt.js +0 -524
- package/dist/index-bx75zwt7.js +0 -63
- package/dist/index-cby4ar3v.js +0 -46
- package/dist/index-cnyk6te3.js +0 -77
- package/dist/index-cxqhvq21.js +0 -413
- package/dist/index-e0znv5gn.js +0 -176
- package/dist/index-e42wzzz5.js +0 -154
- package/dist/index-f477k430.js +0 -324
- package/dist/index-f9mb610r.js +0 -177
- package/dist/index-fadnxwna.js +0 -1046
- package/dist/index-fq77yfzc.js +0 -1303
- package/dist/index-h9etkkyk.js +0 -1126
- package/dist/index-hrbajay7.js +0 -1196
- package/dist/index-kw9t5ayn.js +0 -507
- package/dist/index-mzvgxp0n.js +0 -80
- package/dist/index-n0f51dfn.js +0 -3170
- package/dist/index-p13mwz16.js +0 -16
- package/dist/index-s8cnx02s.js +0 -90
- package/dist/index-sr93cwf9.js +0 -325
- package/dist/index-tmwcrptx.js +0 -85
- package/dist/index-v5573g1k.js +0 -142
- package/dist/index-vjpvjqpn.js +0 -86
- package/dist/index-vk3kq9sb.js +0 -3344
- package/dist/index-wc4x00bn.js +0 -103
- package/dist/index-wnfk50r0.js +0 -211
- package/dist/index-yewwh1w4.js +0 -647
- package/dist/index-yn8remb1.js +0 -290
- package/dist/index-ywd0y6m1.js +0 -394
- package/dist/index-zwkgfq1s.js +0 -345
- package/dist/index.d.ts +0 -14
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -632
- package/dist/internal/errors.d.ts +0 -92
- package/dist/internal/errors.d.ts.map +0 -1
- package/dist/internal/observability-sink.d.ts +0 -81
- package/dist/internal/observability-sink.d.ts.map +0 -1
- package/dist/live.d.ts +0 -19
- package/dist/live.d.ts.map +0 -1
- package/dist/live.js +0 -282
- package/dist/logger.d.ts.map +0 -1
- package/dist/node.d.ts +0 -18
- package/dist/node.d.ts.map +0 -1
- package/dist/node.js +0 -303
- package/dist/oauth.d.ts +0 -57
- package/dist/oauth.d.ts.map +0 -1
- package/dist/oauth.js +0 -170
- package/dist/observability/index.d.ts +0 -19
- package/dist/observability/index.d.ts.map +0 -1
- package/dist/observability/index.js +0 -569
- package/dist/primitives.d.ts +0 -3
- package/dist/primitives.d.ts.map +0 -1
- package/dist/primitives.js +0 -754
- package/dist/react.d.ts +0 -5
- package/dist/react.d.ts.map +0 -1
- package/dist/react.js +0 -403
- package/dist/release.d.ts +0 -15
- package/dist/release.d.ts.map +0 -1
- package/dist/release.js +0 -196
- package/dist/remote.d.ts +0 -9
- package/dist/remote.d.ts.map +0 -1
- package/dist/remote.js +0 -88
- package/dist/retained.d.ts.map +0 -1
- package/dist/server/file-state-store.d.ts +0 -23
- package/dist/server/file-state-store.d.ts.map +0 -1
- package/dist/server/index.d.ts +0 -36
- package/dist/server/index.d.ts.map +0 -1
- package/dist/server/index.js +0 -1745
- package/dist/server/request.d.ts.map +0 -1
- package/dist/telegram.d.ts +0 -3
- package/dist/telegram.d.ts.map +0 -1
- package/dist/telegram.js +0 -224
- package/dist/testing/agent-store-conformance.d.ts +0 -40
- package/dist/testing/agent-store-conformance.d.ts.map +0 -1
- package/dist/testing.d.ts +0 -39
- package/dist/testing.d.ts.map +0 -1
- package/dist/testing.js +0 -2209
- package/dist/tool-invoker.d.ts +0 -9
- package/dist/tool-invoker.d.ts.map +0 -1
- package/dist/tool-invoker.js +0 -21
- package/dist/tools/async-operation-contract.d.ts.map +0 -1
- package/dist/tools/async-operation.d.ts +0 -332
- package/dist/tools/async-operation.d.ts.map +0 -1
- package/dist/tools/cli-args.d.ts +0 -143
- package/dist/tools/cli-args.d.ts.map +0 -1
- package/dist/tools/cli-checkpoint.d.ts +0 -24
- package/dist/tools/cli-checkpoint.d.ts.map +0 -1
- package/dist/tools/cli-command.d.ts +0 -70
- package/dist/tools/cli-command.d.ts.map +0 -1
- package/dist/tools/cli-format.d.ts +0 -49
- package/dist/tools/cli-format.d.ts.map +0 -1
- package/dist/tools/cli-installer.d.ts +0 -34
- package/dist/tools/cli-installer.d.ts.map +0 -1
- package/dist/tools/cli-invoke.d.ts +0 -143
- package/dist/tools/cli-invoke.d.ts.map +0 -1
- package/dist/tools/cli-manifest.d.ts +0 -80
- package/dist/tools/cli-manifest.d.ts.map +0 -1
- package/dist/tools/cli-policy.d.ts +0 -27
- package/dist/tools/cli-policy.d.ts.map +0 -1
- package/dist/tools/cli-profile.d.ts +0 -40
- package/dist/tools/cli-profile.d.ts.map +0 -1
- package/dist/tools/cli-signature.d.ts +0 -81
- package/dist/tools/cli-signature.d.ts.map +0 -1
- package/dist/tools/cli-stream.d.ts +0 -93
- package/dist/tools/cli-stream.d.ts.map +0 -1
- package/dist/tools/cli-update.d.ts +0 -126
- package/dist/tools/cli-update.d.ts.map +0 -1
- package/dist/tools/cli-view.d.ts +0 -12
- package/dist/tools/cli-view.d.ts.map +0 -1
- package/dist/tools/cli-wait.d.ts +0 -54
- package/dist/tools/cli-wait.d.ts.map +0 -1
- package/dist/tools/cli.d.ts +0 -94
- package/dist/tools/cli.d.ts.map +0 -1
- package/dist/tools/coerce.d.ts.map +0 -1
- package/dist/tools/connections/index.d.ts +0 -20
- package/dist/tools/connections/index.d.ts.map +0 -1
- package/dist/tools/connections/index.js +0 -1107
- package/dist/tools/define-download-tool.d.ts +0 -18
- package/dist/tools/define-download-tool.d.ts.map +0 -1
- package/dist/tools/define-upload-tool.d.ts +0 -16
- package/dist/tools/define-upload-tool.d.ts.map +0 -1
- package/dist/tools/define-view-file-tool.d.ts +0 -10
- package/dist/tools/define-view-file-tool.d.ts.map +0 -1
- package/dist/tools/define-wait-tool.d.ts +0 -22
- package/dist/tools/define-wait-tool.d.ts.map +0 -1
- package/dist/tools/download-core.d.ts +0 -20
- package/dist/tools/download-core.d.ts.map +0 -1
- package/dist/tools/flatten-join.d.ts.map +0 -1
- package/dist/tools/flatten.d.ts.map +0 -1
- package/dist/tools/json-schema-dialect.d.ts +0 -17
- package/dist/tools/json-schema-dialect.d.ts.map +0 -1
- package/dist/tools/json-schema.d.ts.map +0 -1
- package/dist/tools/managed-file-error.d.ts +0 -6
- package/dist/tools/managed-file-error.d.ts.map +0 -1
- package/dist/tools/mcp-app.d.ts +0 -62
- package/dist/tools/mcp-app.d.ts.map +0 -1
- package/dist/tools/mcp-catalog.d.ts +0 -68
- package/dist/tools/mcp-catalog.d.ts.map +0 -1
- package/dist/tools/mcp-handler.d.ts +0 -46
- package/dist/tools/mcp-handler.d.ts.map +0 -1
- package/dist/tools/mcp-prepare.d.ts +0 -75
- package/dist/tools/mcp-prepare.d.ts.map +0 -1
- package/dist/tools/mcp-progress.d.ts +0 -46
- package/dist/tools/mcp-progress.d.ts.map +0 -1
- package/dist/tools/mcp-round-policy.d.ts +0 -33
- package/dist/tools/mcp-round-policy.d.ts.map +0 -1
- package/dist/tools/mcp-round.d.ts +0 -61
- package/dist/tools/mcp-round.d.ts.map +0 -1
- package/dist/tools/mcp-stdio-signals.d.ts +0 -33
- package/dist/tools/mcp-stdio-signals.d.ts.map +0 -1
- package/dist/tools/mcp-stdio.d.ts +0 -20
- package/dist/tools/mcp-stdio.d.ts.map +0 -1
- package/dist/tools/mcp-trace.d.ts +0 -12
- package/dist/tools/mcp-trace.d.ts.map +0 -1
- package/dist/tools/mcp.d.ts +0 -152
- package/dist/tools/mcp.d.ts.map +0 -1
- package/dist/tools/mount-download.d.ts +0 -41
- package/dist/tools/mount-download.d.ts.map +0 -1
- package/dist/tools/mount-upload.d.ts +0 -21
- package/dist/tools/mount-upload.d.ts.map +0 -1
- package/dist/tools/mount-wait.d.ts.map +0 -1
- package/dist/tools/native-mcp.d.ts +0 -20
- package/dist/tools/native-mcp.d.ts.map +0 -1
- package/dist/tools/native-result.d.ts.map +0 -1
- package/dist/tools/oauth-metadata.d.ts +0 -28
- package/dist/tools/oauth-metadata.d.ts.map +0 -1
- package/dist/tools/oauth-provider.d.ts +0 -184
- package/dist/tools/oauth-provider.d.ts.map +0 -1
- package/dist/tools/portable-formats.d.ts.map +0 -1
- package/dist/tools/presentation.d.ts +0 -22
- package/dist/tools/presentation.d.ts.map +0 -1
- package/dist/tools/schema.d.ts.map +0 -1
- package/dist/tools/untyped-properties.d.ts.map +0 -1
- package/dist/tools/upload-core.d.ts +0 -4
- package/dist/tools/upload-core.d.ts.map +0 -1
- package/dist/tools/view-file-contract.d.ts.map +0 -1
- package/dist/tools/view-file.d.ts +0 -62
- package/dist/tools/view-file.d.ts.map +0 -1
- package/dist/tools/wait-core.d.ts.map +0 -1
- package/dist/tools-contract.d.ts +0 -29
- package/dist/tools-contract.d.ts.map +0 -1
- package/dist/tools-contract.js +0 -24
- package/dist/tools.d.ts +0 -50
- package/dist/tools.d.ts.map +0 -1
- package/dist/tools.js +0 -2930
- package/dist/tracking-server.d.ts +0 -15
- package/dist/tracking-server.d.ts.map +0 -1
- package/dist/tracking.d.ts +0 -24
- package/dist/tracking.d.ts.map +0 -1
- package/dist/tracking.js +0 -1092
- package/dist/upgrade-cli.d.ts.map +0 -1
- package/dist/upgrade-cli.js +0 -177
- /package/dist/{retained.d.ts → browser/retained.d.ts} +0 -0
- /package/dist/{declaration.d.ts → declaration/declaration.d.ts} +0 -0
- /package/dist/{upgrade-cli.d.ts → entrypoints/bin/upgrade-cli.d.ts} +0 -0
- /package/dist/{tracking-server.js → entrypoints/tracking/server.js} +0 -0
- /package/dist/{google.d.ts → google/google.d.ts} +0 -0
- /package/dist/{index-pq95qkbf.js → index-5jm36zv1.js} +0 -0
- /package/dist/{application → internal}/channel.d.ts +0 -0
- /package/dist/{logger.d.ts → internal/logger.d.ts} +0 -0
- /package/dist/{server → internal}/request.d.ts +0 -0
- /package/dist/{tools → json-schema}/json-schema.d.ts +0 -0
- /package/dist/tools/{async-operation-contract.d.ts → operations/async-operation-contract.d.ts} +0 -0
- /package/dist/tools/{mount-wait.d.ts → operations/mount-wait.d.ts} +0 -0
- /package/dist/tools/{wait-core.d.ts → operations/wait-core.d.ts} +0 -0
- /package/dist/tools/{coerce.d.ts → schema/coerce.d.ts} +0 -0
- /package/dist/tools/{flatten-join.d.ts → schema/flatten-join.d.ts} +0 -0
- /package/dist/tools/{flatten.d.ts → schema/flatten.d.ts} +0 -0
- /package/dist/tools/{portable-formats.d.ts → schema/portable-formats.d.ts} +0 -0
- /package/dist/tools/{schema.d.ts → schema/schema.d.ts} +0 -0
- /package/dist/tools/{untyped-properties.d.ts → schema/untyped-properties.d.ts} +0 -0
- /package/dist/tools/{native-result.d.ts → transfer/native-result.d.ts} +0 -0
- /package/dist/tools/{view-file-contract.d.ts → transfer/view-file-contract.d.ts} +0 -0
package/dist/primitives.js
DELETED
|
@@ -1,754 +0,0 @@
|
|
|
1
|
-
import"./index-0a349c33.js";
|
|
2
|
-
import"./index-rxfy4cq7.js";
|
|
3
|
-
import {
|
|
4
|
-
ManagedFileRefSchema
|
|
5
|
-
} from "./index-6k1937bx.js";
|
|
6
|
-
import"./index-2vtcmrj9.js";
|
|
7
|
-
import"./index-kzfs85xp.js";
|
|
8
|
-
import"./index-77fekveh.js";
|
|
9
|
-
|
|
10
|
-
// src/primitives/audit.ts
|
|
11
|
-
import { z as z2 } from "zod";
|
|
12
|
-
|
|
13
|
-
// src/primitives/event.ts
|
|
14
|
-
import { z } from "zod";
|
|
15
|
-
var DomainEventActorSchema = z.object({
|
|
16
|
-
id: z.string().min(1),
|
|
17
|
-
role: z.string().min(1)
|
|
18
|
-
});
|
|
19
|
-
var DomainEventSubjectSchema = z.object({
|
|
20
|
-
type: z.string().min(1),
|
|
21
|
-
id: z.string().min(1)
|
|
22
|
-
});
|
|
23
|
-
function createDomainEventSchema(payload) {
|
|
24
|
-
return z.object({
|
|
25
|
-
id: z.string().min(1),
|
|
26
|
-
type: z.string().min(1),
|
|
27
|
-
occurredAt: z.iso.datetime({ offset: true }),
|
|
28
|
-
actor: DomainEventActorSchema.optional(),
|
|
29
|
-
subject: DomainEventSubjectSchema,
|
|
30
|
-
payload
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
var DomainEventSchema = createDomainEventSchema(z.unknown());
|
|
34
|
-
|
|
35
|
-
// src/primitives/audit.ts
|
|
36
|
-
var AuditChangeSchema = z2.object({
|
|
37
|
-
operation: z2.string().min(1),
|
|
38
|
-
change: z2.unknown()
|
|
39
|
-
});
|
|
40
|
-
var AuditRecordSchema = createDomainEventSchema(AuditChangeSchema);
|
|
41
|
-
var audit = Object.freeze({
|
|
42
|
-
record(change) {
|
|
43
|
-
return Object.freeze({ mode: "record", change });
|
|
44
|
-
},
|
|
45
|
-
omit(reason) {
|
|
46
|
-
if (reason.trim() === "")
|
|
47
|
-
throw new Error("[stitchkit] audit omission requires a reason");
|
|
48
|
-
return Object.freeze({ mode: "omit", reason });
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
function isZodType(value) {
|
|
52
|
-
return typeof value === "object" && value !== null && "safeParse" in value && typeof value.safeParse === "function";
|
|
53
|
-
}
|
|
54
|
-
function endpointAuditPolicy(endpoint) {
|
|
55
|
-
const policy = endpoint.meta?.audit;
|
|
56
|
-
if (!policy || typeof policy !== "object" || !("mode" in policy))
|
|
57
|
-
return;
|
|
58
|
-
if (policy.mode === "omit" && "reason" in policy && typeof policy.reason === "string") {
|
|
59
|
-
return audit.omit(policy.reason);
|
|
60
|
-
}
|
|
61
|
-
if (policy.mode === "record" && "change" in policy && isZodType(policy.change)) {
|
|
62
|
-
return { mode: "record", change: policy.change };
|
|
63
|
-
}
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
function assertAuditDeclared(contract) {
|
|
67
|
-
for (const [operation, endpoint] of Object.entries(contract.endpoints)) {
|
|
68
|
-
if (!endpointAuditPolicy(endpoint)) {
|
|
69
|
-
throw new Error(`[stitchkit] contract "${contract.meta.prefix}" operation "${operation}" must declare meta.audit`);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
function createAuditRecord(input) {
|
|
74
|
-
const change = input.policy.change.parse(input.change);
|
|
75
|
-
return AuditRecordSchema.parse({
|
|
76
|
-
id: input.id,
|
|
77
|
-
type: "audit.recorded",
|
|
78
|
-
occurredAt: input.occurredAt,
|
|
79
|
-
actor: input.actor,
|
|
80
|
-
subject: input.subject,
|
|
81
|
-
payload: { operation: input.operation, change }
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
// src/primitives/deadline.ts
|
|
85
|
-
import { z as z3 } from "zod";
|
|
86
|
-
var DAY_MS = 86400000;
|
|
87
|
-
var DeadlineResultSchema = z3.object({
|
|
88
|
-
dueAt: z3.iso.datetime({ offset: true }),
|
|
89
|
-
remainingDays: z3.number().int(),
|
|
90
|
-
overdueDays: z3.number().int().nonnegative(),
|
|
91
|
-
category: z3.string().min(1)
|
|
92
|
-
});
|
|
93
|
-
function partsInZone(value, timeZone) {
|
|
94
|
-
const parts = new Intl.DateTimeFormat("en-CA", {
|
|
95
|
-
timeZone,
|
|
96
|
-
year: "numeric",
|
|
97
|
-
month: "2-digit",
|
|
98
|
-
day: "2-digit",
|
|
99
|
-
hour: "2-digit",
|
|
100
|
-
minute: "2-digit",
|
|
101
|
-
second: "2-digit",
|
|
102
|
-
hourCycle: "h23"
|
|
103
|
-
}).formatToParts(value);
|
|
104
|
-
const read = (type) => {
|
|
105
|
-
const part = parts.find((candidate) => candidate.type === type)?.value;
|
|
106
|
-
if (!part)
|
|
107
|
-
throw new Error(`[stitchkit] timezone projection omitted ${type}`);
|
|
108
|
-
return Number(part);
|
|
109
|
-
};
|
|
110
|
-
return {
|
|
111
|
-
year: read("year"),
|
|
112
|
-
month: read("month"),
|
|
113
|
-
day: read("day"),
|
|
114
|
-
hour: read("hour"),
|
|
115
|
-
minute: read("minute"),
|
|
116
|
-
second: read("second")
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
function partsEpoch(parts) {
|
|
120
|
-
return Date.UTC(parts.year, parts.month - 1, parts.day, parts.hour, parts.minute, parts.second);
|
|
121
|
-
}
|
|
122
|
-
function localPartsToEpoch(parts, timeZone) {
|
|
123
|
-
const desired = partsEpoch(parts);
|
|
124
|
-
let candidate = desired;
|
|
125
|
-
for (let attempt = 0;attempt < 3; attempt += 1) {
|
|
126
|
-
const projected = partsEpoch(partsInZone(new Date(candidate), timeZone));
|
|
127
|
-
candidate += desired - projected;
|
|
128
|
-
}
|
|
129
|
-
return candidate;
|
|
130
|
-
}
|
|
131
|
-
function addCalendarDays(anchor, days, timeZone) {
|
|
132
|
-
const parts = partsInZone(anchor, timeZone);
|
|
133
|
-
const shifted = new Date(Date.UTC(parts.year, parts.month - 1, parts.day + days, parts.hour, parts.minute, parts.second));
|
|
134
|
-
return new Date(localPartsToEpoch(partsInZone(shifted, "UTC"), timeZone));
|
|
135
|
-
}
|
|
136
|
-
function calendarDayKey(value, timeZone) {
|
|
137
|
-
const parts = partsInZone(value, timeZone);
|
|
138
|
-
return Date.UTC(parts.year, parts.month - 1, parts.day) / DAY_MS;
|
|
139
|
-
}
|
|
140
|
-
function defineDeadlinePolicy(config) {
|
|
141
|
-
new Intl.DateTimeFormat("en", { timeZone: config.timeZone }).format(new Date(0));
|
|
142
|
-
if (!Number.isSafeInteger(config.warningDays) || config.warningDays < 0) {
|
|
143
|
-
throw new RangeError("warningDays must be a non-negative safe integer");
|
|
144
|
-
}
|
|
145
|
-
const addDays = (value, days) => config.boundary === "calendar-day" ? addCalendarDays(value, days, config.timeZone) : new Date(value.getTime() + days * DAY_MS);
|
|
146
|
-
return Object.freeze({
|
|
147
|
-
definition: config,
|
|
148
|
-
evaluate(input) {
|
|
149
|
-
if (!Number.isSafeInteger(input.durationDays) || input.durationDays < 0) {
|
|
150
|
-
throw new RangeError("durationDays must be a non-negative safe integer");
|
|
151
|
-
}
|
|
152
|
-
const dueAt = addDays(input.anchorAt, input.durationDays);
|
|
153
|
-
const remainingDays = config.boundary === "calendar-day" ? calendarDayKey(dueAt, config.timeZone) - calendarDayKey(input.now, config.timeZone) : Math.ceil((dueAt.getTime() - input.now.getTime()) / DAY_MS);
|
|
154
|
-
const category = remainingDays < 0 ? config.categories.overdue : remainingDays <= config.warningDays ? config.categories.warning : config.categories.onTrack;
|
|
155
|
-
return DeadlineResultSchema.parse({
|
|
156
|
-
dueAt: dueAt.toISOString(),
|
|
157
|
-
remainingDays,
|
|
158
|
-
overdueDays: Math.max(0, -remainingDays),
|
|
159
|
-
category
|
|
160
|
-
});
|
|
161
|
-
},
|
|
162
|
-
queryBoundary(now) {
|
|
163
|
-
return Object.freeze({
|
|
164
|
-
overdueBefore: now.toISOString(),
|
|
165
|
-
warningBefore: addDays(now, config.warningDays).toISOString()
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
// src/primitives/delivery.ts
|
|
171
|
-
import { z as z4 } from "zod";
|
|
172
|
-
var DomainEventDestinationSchema = z4.object({
|
|
173
|
-
id: z4.string().min(1),
|
|
174
|
-
transport: z4.string().min(1),
|
|
175
|
-
address: z4.string().min(1)
|
|
176
|
-
});
|
|
177
|
-
var DomainEventDeliveryOutcomeSchema = z4.discriminatedUnion("outcome", [
|
|
178
|
-
z4.object({ outcome: z4.literal("delivered"), receipt: z4.string().min(1).optional() }),
|
|
179
|
-
z4.object({
|
|
180
|
-
outcome: z4.literal("retryable"),
|
|
181
|
-
code: z4.string().min(1),
|
|
182
|
-
retryAt: z4.iso.datetime({ offset: true })
|
|
183
|
-
}),
|
|
184
|
-
z4.object({ outcome: z4.literal("terminal"), code: z4.string().min(1) }),
|
|
185
|
-
z4.object({ outcome: z4.literal("unknown"), code: z4.string().min(1) })
|
|
186
|
-
]);
|
|
187
|
-
var DomainEventDeliveryClaimSchema = z4.object({
|
|
188
|
-
event: DomainEventSchema,
|
|
189
|
-
destination: DomainEventDestinationSchema,
|
|
190
|
-
attempt: z4.number().int().positive()
|
|
191
|
-
});
|
|
192
|
-
function defineDomainEventDelivery(config) {
|
|
193
|
-
const maxClaims = config.maxClaimsPerDispatch ?? 100;
|
|
194
|
-
if (!Number.isSafeInteger(maxClaims) || maxClaims <= 0) {
|
|
195
|
-
throw new RangeError("maxClaimsPerDispatch must be a positive safe integer");
|
|
196
|
-
}
|
|
197
|
-
return Object.freeze({
|
|
198
|
-
plan(eventInput) {
|
|
199
|
-
const event = DomainEventSchema.parse(eventInput);
|
|
200
|
-
const destinations = config.routes.filter((route) => route.type === event.type).flatMap((route) => route.destinations(event)).map((destination) => DomainEventDestinationSchema.parse(destination));
|
|
201
|
-
const ids = new Set;
|
|
202
|
-
for (const destination of destinations) {
|
|
203
|
-
if (ids.has(destination.id)) {
|
|
204
|
-
throw new Error(`[stitchkit] duplicate destination id "${destination.id}"`);
|
|
205
|
-
}
|
|
206
|
-
ids.add(destination.id);
|
|
207
|
-
}
|
|
208
|
-
return Object.freeze({ event, destinations: Object.freeze(destinations) });
|
|
209
|
-
},
|
|
210
|
-
async dispatch(eventId) {
|
|
211
|
-
let attempts = 0;
|
|
212
|
-
while (attempts < maxClaims) {
|
|
213
|
-
const claim = await config.outbox.claim(eventId);
|
|
214
|
-
if (!claim)
|
|
215
|
-
return { eventId, attempts, exhausted: false };
|
|
216
|
-
const parsedClaim = DomainEventDeliveryClaimSchema.parse(claim);
|
|
217
|
-
if (parsedClaim.event.id !== eventId) {
|
|
218
|
-
throw new Error("[stitchkit] outbox claim event id does not match dispatch request");
|
|
219
|
-
}
|
|
220
|
-
const transport = config.transports[parsedClaim.destination.transport];
|
|
221
|
-
let outcome;
|
|
222
|
-
if (!transport) {
|
|
223
|
-
outcome = { outcome: "unknown", code: "TRANSPORT_NOT_DECLARED" };
|
|
224
|
-
} else {
|
|
225
|
-
try {
|
|
226
|
-
outcome = DomainEventDeliveryOutcomeSchema.parse(await transport.send(parsedClaim.event, parsedClaim.destination));
|
|
227
|
-
} catch {
|
|
228
|
-
outcome = { outcome: "unknown", code: "TRANSPORT_FAILED" };
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
switch (outcome.outcome) {
|
|
232
|
-
case "delivered":
|
|
233
|
-
await config.outbox.delivered(parsedClaim, outcome);
|
|
234
|
-
break;
|
|
235
|
-
case "retryable":
|
|
236
|
-
await config.outbox.retry(parsedClaim, outcome);
|
|
237
|
-
break;
|
|
238
|
-
case "terminal":
|
|
239
|
-
await config.outbox.terminal(parsedClaim, outcome);
|
|
240
|
-
break;
|
|
241
|
-
case "unknown":
|
|
242
|
-
await config.outbox.unknown(parsedClaim, outcome);
|
|
243
|
-
break;
|
|
244
|
-
}
|
|
245
|
-
attempts += 1;
|
|
246
|
-
}
|
|
247
|
-
return { eventId, attempts, exhausted: true };
|
|
248
|
-
}
|
|
249
|
-
});
|
|
250
|
-
}
|
|
251
|
-
// src/primitives/export-operation.ts
|
|
252
|
-
import { z as z5 } from "zod";
|
|
253
|
-
function createExportResultSchema(operationId) {
|
|
254
|
-
return z5.discriminatedUnion("state", [
|
|
255
|
-
z5.object({
|
|
256
|
-
state: z5.literal("ready"),
|
|
257
|
-
file: ManagedFileRefSchema.extend({
|
|
258
|
-
mediaType: z5.string().min(1),
|
|
259
|
-
name: z5.string().min(1)
|
|
260
|
-
})
|
|
261
|
-
}),
|
|
262
|
-
z5.object({ state: z5.literal("pending"), operationId })
|
|
263
|
-
]);
|
|
264
|
-
}
|
|
265
|
-
function defineExportOperation(config) {
|
|
266
|
-
if (config.mediaType.trim() === "")
|
|
267
|
-
throw new Error("[stitchkit] export mediaType is required");
|
|
268
|
-
const result = createExportResultSchema(config.operationId);
|
|
269
|
-
return Object.freeze({
|
|
270
|
-
input: config.input,
|
|
271
|
-
result,
|
|
272
|
-
ready(inputValue, file) {
|
|
273
|
-
const input = config.input.parse(inputValue);
|
|
274
|
-
return result.parse({
|
|
275
|
-
state: "ready",
|
|
276
|
-
file: {
|
|
277
|
-
...file,
|
|
278
|
-
mediaType: config.mediaType,
|
|
279
|
-
name: config.filename(input)
|
|
280
|
-
}
|
|
281
|
-
});
|
|
282
|
-
},
|
|
283
|
-
pending(operationId) {
|
|
284
|
-
return result.parse({ state: "pending", operationId });
|
|
285
|
-
},
|
|
286
|
-
endpoint(definition) {
|
|
287
|
-
return {
|
|
288
|
-
...definition,
|
|
289
|
-
input: config.input,
|
|
290
|
-
output: result
|
|
291
|
-
};
|
|
292
|
-
}
|
|
293
|
-
});
|
|
294
|
-
}
|
|
295
|
-
// src/primitives/lifecycle.ts
|
|
296
|
-
import { z as z6 } from "zod";
|
|
297
|
-
var lifecycleStateBrand = Symbol("stitchkit.lifecycle.state");
|
|
298
|
-
var LifecycleTransitionEventSchema = z6.object({
|
|
299
|
-
id: z6.string().min(1),
|
|
300
|
-
type: z6.literal("lifecycle.transitioned"),
|
|
301
|
-
occurredAt: z6.iso.datetime({ offset: true }),
|
|
302
|
-
actor: z6.object({ id: z6.string().min(1), role: z6.string().min(1) }),
|
|
303
|
-
subject: z6.object({ type: z6.string().min(1), id: z6.string().min(1) }),
|
|
304
|
-
payload: z6.object({
|
|
305
|
-
lifecycle: z6.string().min(1),
|
|
306
|
-
transition: z6.string().min(1),
|
|
307
|
-
from: z6.string().min(1),
|
|
308
|
-
to: z6.string().min(1),
|
|
309
|
-
data: z6.unknown()
|
|
310
|
-
})
|
|
311
|
-
});
|
|
312
|
-
function stateMatches(expected, actual) {
|
|
313
|
-
return Array.isArray(expected) ? expected.includes(actual) : expected === actual;
|
|
314
|
-
}
|
|
315
|
-
function lifecycleState(value) {
|
|
316
|
-
const state = { value, [lifecycleStateBrand]: true };
|
|
317
|
-
return Object.freeze(state);
|
|
318
|
-
}
|
|
319
|
-
function defineLifecycle(config) {
|
|
320
|
-
const definition = config;
|
|
321
|
-
return Object.freeze({
|
|
322
|
-
definition,
|
|
323
|
-
state(value) {
|
|
324
|
-
if (!config.states.includes(value)) {
|
|
325
|
-
throw new Error(`[stitchkit] lifecycle "${config.name}" received an unknown state`);
|
|
326
|
-
}
|
|
327
|
-
return lifecycleState(value);
|
|
328
|
-
},
|
|
329
|
-
availableTransitions(state, role) {
|
|
330
|
-
return Object.entries(config.transitions).filter(([, transition]) => stateMatches(transition.from, state.value) && transition.by.includes(role)).map(([name]) => name);
|
|
331
|
-
},
|
|
332
|
-
transition(input) {
|
|
333
|
-
const transition = config.transitions[input.transition];
|
|
334
|
-
if (!transition) {
|
|
335
|
-
return {
|
|
336
|
-
outcome: "transition_not_allowed",
|
|
337
|
-
transition: input.transition,
|
|
338
|
-
state: input.state.value
|
|
339
|
-
};
|
|
340
|
-
}
|
|
341
|
-
if (!stateMatches(transition.from, input.state.value)) {
|
|
342
|
-
return {
|
|
343
|
-
outcome: "transition_not_allowed",
|
|
344
|
-
transition: input.transition,
|
|
345
|
-
state: input.state.value
|
|
346
|
-
};
|
|
347
|
-
}
|
|
348
|
-
if (!transition.by.includes(input.role)) {
|
|
349
|
-
return {
|
|
350
|
-
outcome: "role_not_allowed",
|
|
351
|
-
transition: input.transition,
|
|
352
|
-
role: input.role
|
|
353
|
-
};
|
|
354
|
-
}
|
|
355
|
-
const parsedPayload = transition.payload?.safeParse(input.payload);
|
|
356
|
-
if (parsedPayload && !parsedPayload.success) {
|
|
357
|
-
return {
|
|
358
|
-
outcome: "invalid_payload",
|
|
359
|
-
transition: input.transition,
|
|
360
|
-
issues: parsedPayload.error.issues.map((issue) => issue.message)
|
|
361
|
-
};
|
|
362
|
-
}
|
|
363
|
-
const actor = { id: input.actorId, role: input.role };
|
|
364
|
-
const event = LifecycleTransitionEventSchema.parse({
|
|
365
|
-
id: input.eventId,
|
|
366
|
-
type: "lifecycle.transitioned",
|
|
367
|
-
occurredAt: input.occurredAt,
|
|
368
|
-
actor,
|
|
369
|
-
subject: input.subject,
|
|
370
|
-
payload: {
|
|
371
|
-
lifecycle: config.name,
|
|
372
|
-
transition: input.transition,
|
|
373
|
-
from: input.state.value,
|
|
374
|
-
to: transition.to,
|
|
375
|
-
data: parsedPayload?.data ?? input.payload
|
|
376
|
-
}
|
|
377
|
-
});
|
|
378
|
-
return {
|
|
379
|
-
outcome: "transitioned",
|
|
380
|
-
state: lifecycleState(transition.to),
|
|
381
|
-
event
|
|
382
|
-
};
|
|
383
|
-
}
|
|
384
|
-
});
|
|
385
|
-
}
|
|
386
|
-
// src/primitives/migration-checks.ts
|
|
387
|
-
function lineNumber(text, offset) {
|
|
388
|
-
return text.slice(0, offset).split(`
|
|
389
|
-
`).length;
|
|
390
|
-
}
|
|
391
|
-
function excerptAt(text, offset) {
|
|
392
|
-
const start = text.lastIndexOf(`
|
|
393
|
-
`, offset) + 1;
|
|
394
|
-
const end = text.indexOf(`
|
|
395
|
-
`, offset);
|
|
396
|
-
return text.slice(start, end === -1 ? undefined : end).trim();
|
|
397
|
-
}
|
|
398
|
-
function escapeRegExp(value) {
|
|
399
|
-
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
400
|
-
}
|
|
401
|
-
function scanMoneyNumberRisks(sources, identifiers = ["amount", "money", "price", "total"]) {
|
|
402
|
-
const risks = [];
|
|
403
|
-
for (const source of sources) {
|
|
404
|
-
for (const identifier of identifiers) {
|
|
405
|
-
const pattern = new RegExp(`\\b${escapeRegExp(identifier)}\\b[^\\n;]{0,120}\\.toFixed\\(\\s*2\\s*\\)`, "gi");
|
|
406
|
-
for (const match of source.text.matchAll(pattern)) {
|
|
407
|
-
if (match.index === undefined)
|
|
408
|
-
continue;
|
|
409
|
-
risks.push({
|
|
410
|
-
path: source.path,
|
|
411
|
-
line: lineNumber(source.text, match.index),
|
|
412
|
-
kind: "money-number",
|
|
413
|
-
excerpt: excerptAt(source.text, match.index)
|
|
414
|
-
});
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
return risks;
|
|
419
|
-
}
|
|
420
|
-
function scanOwnerFilterRisks(sources, ownerKeys = ["ownerId"]) {
|
|
421
|
-
const risks = [];
|
|
422
|
-
for (const source of sources) {
|
|
423
|
-
for (const ownerKey of ownerKeys) {
|
|
424
|
-
const key = escapeRegExp(ownerKey);
|
|
425
|
-
const pattern = new RegExp(`\\.(?:findMany|findFirst|count|aggregate|groupBy)\\s*\\([^;]{0,500}?\\b${key}\\s*(?::|[,}])`, "g");
|
|
426
|
-
for (const match of source.text.matchAll(pattern)) {
|
|
427
|
-
if (match.index === undefined)
|
|
428
|
-
continue;
|
|
429
|
-
risks.push({
|
|
430
|
-
path: source.path,
|
|
431
|
-
line: lineNumber(source.text, match.index),
|
|
432
|
-
kind: "manual-owner-filter",
|
|
433
|
-
excerpt: excerptAt(source.text, match.index)
|
|
434
|
-
});
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
return risks;
|
|
439
|
-
}
|
|
440
|
-
// src/primitives/money.ts
|
|
441
|
-
import { z as z7 } from "zod";
|
|
442
|
-
var IntegerStringSchema = z7.string().regex(/^-?(?:0|[1-9]\d*)$/);
|
|
443
|
-
function createMoneySchema(currency) {
|
|
444
|
-
return z7.object({
|
|
445
|
-
minor: IntegerStringSchema,
|
|
446
|
-
currency: z7.literal(currency)
|
|
447
|
-
});
|
|
448
|
-
}
|
|
449
|
-
function parseMinor(value) {
|
|
450
|
-
return BigInt(IntegerStringSchema.parse(value.minor));
|
|
451
|
-
}
|
|
452
|
-
function assertSameCurrency(left, right) {
|
|
453
|
-
if (left.currency !== right.currency) {
|
|
454
|
-
throw new TypeError(`cannot combine "${left.currency}" and "${right.currency}"`);
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
function money(minor, currency) {
|
|
458
|
-
return Object.freeze({ minor: minor.toString(), currency });
|
|
459
|
-
}
|
|
460
|
-
function addMoney(left, right) {
|
|
461
|
-
assertSameCurrency(left, right);
|
|
462
|
-
return money(parseMinor(left) + parseMinor(right), left.currency);
|
|
463
|
-
}
|
|
464
|
-
function subtractMoney(left, right) {
|
|
465
|
-
assertSameCurrency(left, right);
|
|
466
|
-
return money(parseMinor(left) - parseMinor(right), left.currency);
|
|
467
|
-
}
|
|
468
|
-
function multiplyMoney(value, quantity) {
|
|
469
|
-
if (typeof quantity === "number" && !Number.isSafeInteger(quantity)) {
|
|
470
|
-
throw new RangeError("quantity must be a safe integer");
|
|
471
|
-
}
|
|
472
|
-
const multiplier = typeof quantity === "bigint" ? quantity : BigInt(quantity);
|
|
473
|
-
return money(parseMinor(value) * multiplier, value.currency);
|
|
474
|
-
}
|
|
475
|
-
function shareMoney(value, numerator, denominator) {
|
|
476
|
-
if (denominator <= 0n)
|
|
477
|
-
throw new RangeError("denominator must be positive");
|
|
478
|
-
if (numerator < 0n)
|
|
479
|
-
throw new RangeError("numerator must be non-negative");
|
|
480
|
-
const scaled = parseMinor(value) * numerator;
|
|
481
|
-
return Object.freeze({
|
|
482
|
-
amount: money(scaled / denominator, value.currency),
|
|
483
|
-
remainder: Object.freeze({
|
|
484
|
-
numerator: (scaled % denominator).toString(),
|
|
485
|
-
denominator: denominator.toString(),
|
|
486
|
-
currency: value.currency
|
|
487
|
-
})
|
|
488
|
-
});
|
|
489
|
-
}
|
|
490
|
-
function splitMoney(value, count) {
|
|
491
|
-
if (!Number.isSafeInteger(count) || count <= 0) {
|
|
492
|
-
throw new RangeError("count must be a positive safe integer");
|
|
493
|
-
}
|
|
494
|
-
const divisor = BigInt(count);
|
|
495
|
-
const total = parseMinor(value);
|
|
496
|
-
return Object.freeze({
|
|
497
|
-
part: money(total / divisor, value.currency),
|
|
498
|
-
count,
|
|
499
|
-
remainder: money(total % divisor, value.currency)
|
|
500
|
-
});
|
|
501
|
-
}
|
|
502
|
-
function defineMoney(currency) {
|
|
503
|
-
const schema = createMoneySchema(currency);
|
|
504
|
-
return Object.freeze({
|
|
505
|
-
currency,
|
|
506
|
-
schema,
|
|
507
|
-
create(minor) {
|
|
508
|
-
const parsed = schema.parse({ minor: minor.toString(), currency });
|
|
509
|
-
return Object.freeze(parsed);
|
|
510
|
-
},
|
|
511
|
-
add: addMoney,
|
|
512
|
-
subtract: subtractMoney,
|
|
513
|
-
multiply: multiplyMoney,
|
|
514
|
-
share: shareMoney,
|
|
515
|
-
split: splitMoney
|
|
516
|
-
});
|
|
517
|
-
}
|
|
518
|
-
// src/primitives/owner-scope.ts
|
|
519
|
-
var ownerScopeBrand = Symbol("stitchkit.owner.scope");
|
|
520
|
-
function scopedOwner(ownerId) {
|
|
521
|
-
const scope = { kind: "owner", ownerId, [ownerScopeBrand]: true };
|
|
522
|
-
return Object.freeze(scope);
|
|
523
|
-
}
|
|
524
|
-
function allOwners() {
|
|
525
|
-
const scope = {
|
|
526
|
-
kind: "all",
|
|
527
|
-
permission: "acrossAllOwners",
|
|
528
|
-
[ownerScopeBrand]: true
|
|
529
|
-
};
|
|
530
|
-
return Object.freeze(scope);
|
|
531
|
-
}
|
|
532
|
-
function defineOwnerScope(definition) {
|
|
533
|
-
return Object.freeze({
|
|
534
|
-
definition,
|
|
535
|
-
forIdentity(identity) {
|
|
536
|
-
const ownerId = definition.ownerId(identity);
|
|
537
|
-
return ownerId ? { outcome: "resolved", scope: scopedOwner(ownerId) } : { outcome: "owner_missing" };
|
|
538
|
-
},
|
|
539
|
-
acrossAllOwners(identity) {
|
|
540
|
-
return definition.canAccessAll(identity) ? { outcome: "resolved", scope: allOwners() } : { outcome: "across_all_forbidden" };
|
|
541
|
-
}
|
|
542
|
-
});
|
|
543
|
-
}
|
|
544
|
-
// src/primitives/permission.ts
|
|
545
|
-
function definePermissionMatrix(config) {
|
|
546
|
-
if (new Set(config.roles).size !== config.roles.length) {
|
|
547
|
-
throw new Error("[stitchkit] permission matrix roles must be unique");
|
|
548
|
-
}
|
|
549
|
-
if (new Set(config.operations).size !== config.operations.length) {
|
|
550
|
-
throw new Error("[stitchkit] permission matrix operations must be unique");
|
|
551
|
-
}
|
|
552
|
-
for (const role of config.roles) {
|
|
553
|
-
const declared = Object.keys(config.grants[role]).sort();
|
|
554
|
-
const expected = [...config.operations].sort();
|
|
555
|
-
if (declared.length !== expected.length || declared.some((value, index) => value !== expected[index])) {
|
|
556
|
-
throw new Error(`[stitchkit] permission matrix role "${role}" must decide every operation`);
|
|
557
|
-
}
|
|
558
|
-
}
|
|
559
|
-
const roleSet = new Set(config.roles);
|
|
560
|
-
const operationSet = new Set(config.operations);
|
|
561
|
-
const decisions = new Map;
|
|
562
|
-
for (const role of config.roles) {
|
|
563
|
-
for (const operation of config.operations) {
|
|
564
|
-
decisions.set(`${role}\x00${operation}`, config.grants[role][operation]);
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
return Object.freeze({
|
|
568
|
-
definition: config,
|
|
569
|
-
allows(role, operation) {
|
|
570
|
-
return config.grants[role][operation];
|
|
571
|
-
},
|
|
572
|
-
capabilities(role) {
|
|
573
|
-
return config.operations.filter((operation) => config.grants[role][operation]);
|
|
574
|
-
},
|
|
575
|
-
check(role, operation) {
|
|
576
|
-
if (!roleSet.has(role))
|
|
577
|
-
return { outcome: "unknown_role", role };
|
|
578
|
-
if (!operationSet.has(operation))
|
|
579
|
-
return { outcome: "unknown_operation", operation };
|
|
580
|
-
return decisions.get(`${role}\x00${operation}`) ? { outcome: "allowed" } : { outcome: "denied" };
|
|
581
|
-
}
|
|
582
|
-
});
|
|
583
|
-
}
|
|
584
|
-
// src/primitives/quantity.ts
|
|
585
|
-
import { z as z8 } from "zod";
|
|
586
|
-
|
|
587
|
-
// src/primitives/decimal.ts
|
|
588
|
-
var DECIMAL_PATTERN = /^-?(?:0|[1-9]\d*)(?:\.\d+)?$/;
|
|
589
|
-
function parseDecimal(value) {
|
|
590
|
-
if (!DECIMAL_PATTERN.test(value))
|
|
591
|
-
throw new TypeError(`invalid decimal value "${value}"`);
|
|
592
|
-
const negative = value.startsWith("-");
|
|
593
|
-
const unsigned = negative ? value.slice(1) : value;
|
|
594
|
-
const [whole = "0", fraction = ""] = unsigned.split(".");
|
|
595
|
-
const coefficient = BigInt(`${negative ? "-" : ""}${whole}${fraction}`);
|
|
596
|
-
return normalizeDecimal({ coefficient, scale: fraction.length });
|
|
597
|
-
}
|
|
598
|
-
function normalizeDecimal(parts) {
|
|
599
|
-
let coefficient = parts.coefficient;
|
|
600
|
-
let scale = parts.scale;
|
|
601
|
-
while (scale > 0 && coefficient % 10n === 0n) {
|
|
602
|
-
coefficient /= 10n;
|
|
603
|
-
scale -= 1;
|
|
604
|
-
}
|
|
605
|
-
return { coefficient, scale };
|
|
606
|
-
}
|
|
607
|
-
function formatDecimal(parts) {
|
|
608
|
-
const normalized = normalizeDecimal(parts);
|
|
609
|
-
const negative = normalized.coefficient < 0n;
|
|
610
|
-
const digits = (negative ? -normalized.coefficient : normalized.coefficient).toString();
|
|
611
|
-
if (normalized.scale === 0)
|
|
612
|
-
return `${negative ? "-" : ""}${digits}`;
|
|
613
|
-
const padded = digits.padStart(normalized.scale + 1, "0");
|
|
614
|
-
const point = padded.length - normalized.scale;
|
|
615
|
-
return `${negative ? "-" : ""}${padded.slice(0, point)}.${padded.slice(point)}`;
|
|
616
|
-
}
|
|
617
|
-
function addDecimal(left, right) {
|
|
618
|
-
const scale = Math.max(left.scale, right.scale);
|
|
619
|
-
const leftCoefficient = left.coefficient * 10n ** BigInt(scale - left.scale);
|
|
620
|
-
const rightCoefficient = right.coefficient * 10n ** BigInt(scale - right.scale);
|
|
621
|
-
return normalizeDecimal({ coefficient: leftCoefficient + rightCoefficient, scale });
|
|
622
|
-
}
|
|
623
|
-
function multiplyDecimalRatio(value, numerator, denominator) {
|
|
624
|
-
if (denominator <= 0n)
|
|
625
|
-
throw new RangeError("conversion denominator must be positive");
|
|
626
|
-
let coefficient = value.coefficient * numerator;
|
|
627
|
-
let scale = value.scale;
|
|
628
|
-
for (let extraScale = 0;extraScale <= 18; extraScale += 1) {
|
|
629
|
-
if (coefficient % denominator === 0n) {
|
|
630
|
-
return normalizeDecimal({ coefficient: coefficient / denominator, scale });
|
|
631
|
-
}
|
|
632
|
-
coefficient *= 10n;
|
|
633
|
-
scale += 1;
|
|
634
|
-
}
|
|
635
|
-
throw new RangeError("conversion does not have a finite decimal representation");
|
|
636
|
-
}
|
|
637
|
-
|
|
638
|
-
// src/primitives/quantity.ts
|
|
639
|
-
var DecimalStringSchema = z8.string().refine((value) => {
|
|
640
|
-
try {
|
|
641
|
-
return formatDecimal(parseDecimal(value)) === value;
|
|
642
|
-
} catch {
|
|
643
|
-
return false;
|
|
644
|
-
}
|
|
645
|
-
}, "expected a canonical decimal string");
|
|
646
|
-
function createQuantitySchema(unit) {
|
|
647
|
-
return z8.object({ value: DecimalStringSchema, unit: z8.literal(unit) });
|
|
648
|
-
}
|
|
649
|
-
function quantity(value, unit) {
|
|
650
|
-
return Object.freeze({ value: formatDecimal(parseDecimal(value)), unit });
|
|
651
|
-
}
|
|
652
|
-
function sameUnit(left, right) {
|
|
653
|
-
return left === right;
|
|
654
|
-
}
|
|
655
|
-
function addQuantity(left, right) {
|
|
656
|
-
if (!sameUnit(left.unit, right.unit)) {
|
|
657
|
-
throw new TypeError(`cannot combine "${left.unit}" and "${right.unit}"`);
|
|
658
|
-
}
|
|
659
|
-
return quantity(formatDecimal(addDecimal(parseDecimal(left.value), parseDecimal(right.value))), left.unit);
|
|
660
|
-
}
|
|
661
|
-
var QuantityProjectionSchema = z8.discriminatedUnion("kind", [
|
|
662
|
-
z8.object({
|
|
663
|
-
kind: z8.literal("recorded"),
|
|
664
|
-
quantity: z8.object({ value: DecimalStringSchema, unit: z8.string().min(1) })
|
|
665
|
-
}),
|
|
666
|
-
z8.object({
|
|
667
|
-
kind: z8.literal("derived"),
|
|
668
|
-
quantity: z8.object({ value: DecimalStringSchema, unit: z8.string().min(1) }),
|
|
669
|
-
source: z8.object({ value: DecimalStringSchema, unit: z8.string().min(1) }),
|
|
670
|
-
conversionId: z8.string().min(1)
|
|
671
|
-
})
|
|
672
|
-
]);
|
|
673
|
-
function defineUnitSystem(config) {
|
|
674
|
-
const ids = new Set;
|
|
675
|
-
for (const conversion of config.conversions) {
|
|
676
|
-
if (ids.has(conversion.id)) {
|
|
677
|
-
throw new Error(`[stitchkit] duplicate conversion id "${conversion.id}"`);
|
|
678
|
-
}
|
|
679
|
-
ids.add(conversion.id);
|
|
680
|
-
if (!/^-?(?:0|[1-9]\d*)$/.test(conversion.numerator)) {
|
|
681
|
-
throw new Error(`[stitchkit] conversion "${conversion.id}" numerator must be an integer`);
|
|
682
|
-
}
|
|
683
|
-
if (!/^(?:[1-9]\d*)$/.test(conversion.denominator)) {
|
|
684
|
-
throw new Error(`[stitchkit] conversion "${conversion.id}" denominator must be positive`);
|
|
685
|
-
}
|
|
686
|
-
}
|
|
687
|
-
return Object.freeze({
|
|
688
|
-
definition: config,
|
|
689
|
-
create(value, unit) {
|
|
690
|
-
if (!config.units.includes(unit))
|
|
691
|
-
throw new Error(`[stitchkit] unknown unit "${unit}"`);
|
|
692
|
-
return quantity(value, unit);
|
|
693
|
-
},
|
|
694
|
-
recorded(value) {
|
|
695
|
-
return Object.freeze({ kind: "recorded", quantity: value });
|
|
696
|
-
},
|
|
697
|
-
convert(source, to) {
|
|
698
|
-
if (sameUnit(source.unit, to)) {
|
|
699
|
-
return Object.freeze({
|
|
700
|
-
kind: "derived",
|
|
701
|
-
quantity: quantity(source.value, to),
|
|
702
|
-
source,
|
|
703
|
-
conversionId: "identity"
|
|
704
|
-
});
|
|
705
|
-
}
|
|
706
|
-
const conversion = config.conversions.find((candidate) => candidate.from === source.unit && candidate.to === to);
|
|
707
|
-
if (!conversion) {
|
|
708
|
-
throw new Error(`[stitchkit] no conversion from "${source.unit}" to "${to}"`);
|
|
709
|
-
}
|
|
710
|
-
const converted = multiplyDecimalRatio(parseDecimal(source.value), BigInt(conversion.numerator), BigInt(conversion.denominator));
|
|
711
|
-
return Object.freeze({
|
|
712
|
-
kind: "derived",
|
|
713
|
-
quantity: quantity(formatDecimal(converted), to),
|
|
714
|
-
source,
|
|
715
|
-
conversionId: conversion.id
|
|
716
|
-
});
|
|
717
|
-
}
|
|
718
|
-
});
|
|
719
|
-
}
|
|
720
|
-
export {
|
|
721
|
-
subtractMoney,
|
|
722
|
-
splitMoney,
|
|
723
|
-
shareMoney,
|
|
724
|
-
scanOwnerFilterRisks,
|
|
725
|
-
scanMoneyNumberRisks,
|
|
726
|
-
multiplyMoney,
|
|
727
|
-
defineUnitSystem,
|
|
728
|
-
definePermissionMatrix,
|
|
729
|
-
defineOwnerScope,
|
|
730
|
-
defineMoney,
|
|
731
|
-
defineLifecycle,
|
|
732
|
-
defineExportOperation,
|
|
733
|
-
defineDomainEventDelivery,
|
|
734
|
-
defineDeadlinePolicy,
|
|
735
|
-
createQuantitySchema,
|
|
736
|
-
createMoneySchema,
|
|
737
|
-
createExportResultSchema,
|
|
738
|
-
createDomainEventSchema,
|
|
739
|
-
createAuditRecord,
|
|
740
|
-
audit,
|
|
741
|
-
assertAuditDeclared,
|
|
742
|
-
addQuantity,
|
|
743
|
-
addMoney,
|
|
744
|
-
QuantityProjectionSchema,
|
|
745
|
-
LifecycleTransitionEventSchema,
|
|
746
|
-
DomainEventSubjectSchema,
|
|
747
|
-
DomainEventSchema,
|
|
748
|
-
DomainEventDestinationSchema,
|
|
749
|
-
DomainEventDeliveryOutcomeSchema,
|
|
750
|
-
DomainEventDeliveryClaimSchema,
|
|
751
|
-
DomainEventActorSchema,
|
|
752
|
-
DeadlineResultSchema,
|
|
753
|
-
AuditRecordSchema
|
|
754
|
-
};
|