stitchkit 0.125.0 → 0.127.0
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 +1707 -1
- package/README.md +12 -4
- package/dist/agent-executor/acp/scenarios.d.ts +4 -0
- package/dist/agent-executor/acp/scenarios.d.ts.map +1 -0
- package/dist/agent-executor/acp/v1-connect.d.ts +89 -0
- package/dist/agent-executor/acp/v1-connect.d.ts.map +1 -0
- package/dist/agent-executor/acp/v1-driver.d.ts +31 -0
- package/dist/agent-executor/acp/v1-driver.d.ts.map +1 -0
- package/dist/agent-executor/acp/v1-map.d.ts +41 -0
- package/dist/agent-executor/acp/v1-map.d.ts.map +1 -0
- package/dist/agent-executor/acp/v1-protocol.d.ts +270 -0
- package/dist/agent-executor/acp/v1-protocol.d.ts.map +1 -0
- package/dist/agent-executor/acp/v1-session.d.ts +22 -0
- package/dist/agent-executor/acp/v1-session.d.ts.map +1 -0
- package/dist/agent-executor/acp/v1-turn.d.ts +25 -0
- package/dist/agent-executor/acp/v1-turn.d.ts.map +1 -0
- package/dist/agent-executor/claude/classify.d.ts +54 -0
- package/dist/agent-executor/claude/classify.d.ts.map +1 -0
- package/dist/agent-executor/claude/cli-driver.d.ts +27 -0
- package/dist/agent-executor/claude/cli-driver.d.ts.map +1 -0
- package/dist/agent-executor/claude/limits.d.ts +8 -0
- package/dist/agent-executor/claude/limits.d.ts.map +1 -0
- package/dist/agent-executor/claude/protocol.d.ts +188 -0
- package/dist/agent-executor/claude/protocol.d.ts.map +1 -0
- package/dist/agent-executor/claude/scenarios.d.ts +4 -0
- package/dist/agent-executor/claude/scenarios.d.ts.map +1 -0
- package/dist/agent-executor/claude/session.d.ts +22 -0
- package/dist/agent-executor/claude/session.d.ts.map +1 -0
- package/dist/agent-executor/claude/transcript.d.ts +33 -0
- package/dist/agent-executor/claude/transcript.d.ts.map +1 -0
- package/dist/agent-executor/claude-sdk/driver.d.ts +31 -0
- package/dist/agent-executor/claude-sdk/driver.d.ts.map +1 -0
- package/dist/agent-executor/claude-sdk/session.d.ts +10 -0
- package/dist/agent-executor/claude-sdk/session.d.ts.map +1 -0
- package/dist/agent-executor/codex/classify.d.ts +28 -0
- package/dist/agent-executor/codex/classify.d.ts.map +1 -0
- package/dist/agent-executor/codex/driver.d.ts +23 -0
- package/dist/agent-executor/codex/driver.d.ts.map +1 -0
- package/dist/agent-executor/codex/limits.d.ts +4 -0
- package/dist/agent-executor/codex/limits.d.ts.map +1 -0
- package/dist/agent-executor/codex/protocol.d.ts +152 -0
- package/dist/agent-executor/codex/protocol.d.ts.map +1 -0
- package/dist/agent-executor/codex/scenarios.d.ts +4 -0
- package/dist/agent-executor/codex/scenarios.d.ts.map +1 -0
- package/dist/agent-executor/codex/session.d.ts +41 -0
- package/dist/agent-executor/codex/session.d.ts.map +1 -0
- package/dist/agent-executor/contract.d.ts +454 -0
- package/dist/agent-executor/contract.d.ts.map +1 -0
- package/dist/agent-executor/dispatch.d.ts +41 -0
- package/dist/agent-executor/dispatch.d.ts.map +1 -0
- package/dist/agent-executor/engine-process.d.ts +45 -0
- package/dist/agent-executor/engine-process.d.ts.map +1 -0
- package/dist/agent-executor/engine-requests.d.ts +63 -0
- package/dist/agent-executor/engine-requests.d.ts.map +1 -0
- package/dist/agent-executor/engine.d.ts +64 -0
- package/dist/agent-executor/engine.d.ts.map +1 -0
- package/dist/agent-executor/executor-contract.d.ts +387 -0
- package/dist/agent-executor/executor-contract.d.ts.map +1 -0
- package/dist/agent-executor/executor-machine.d.ts +50 -0
- package/dist/agent-executor/executor-machine.d.ts.map +1 -0
- package/dist/agent-executor/hello.d.ts +235 -0
- package/dist/agent-executor/hello.d.ts.map +1 -0
- package/dist/agent-executor/json-rpc-peer.d.ts +48 -0
- package/dist/agent-executor/json-rpc-peer.d.ts.map +1 -0
- package/dist/agent-executor/leases.d.ts +159 -0
- package/dist/agent-executor/leases.d.ts.map +1 -0
- package/dist/agent-executor/plan-limits.d.ts +25 -0
- package/dist/agent-executor/plan-limits.d.ts.map +1 -0
- package/dist/agent-executor/profile.d.ts +52 -0
- package/dist/agent-executor/profile.d.ts.map +1 -0
- package/dist/agent-executor/projection.d.ts +14 -0
- package/dist/agent-executor/projection.d.ts.map +1 -0
- package/dist/agent-executor/session-primitives.d.ts +72 -0
- package/dist/agent-executor/session-primitives.d.ts.map +1 -0
- package/dist/agent-executor/testing/conformance.d.ts +55 -0
- package/dist/agent-executor/testing/conformance.d.ts.map +1 -0
- package/dist/agent-executor/testing/fake-claude-engine.d.ts +18 -0
- package/dist/agent-executor/testing/fake-claude-engine.d.ts.map +1 -0
- package/dist/agent-executor/testing/fake-engine.d.ts +52 -0
- package/dist/agent-executor/testing/fake-engine.d.ts.map +1 -0
- package/dist/agent-executor/turn-phases.d.ts +10 -0
- package/dist/agent-executor/turn-phases.d.ts.map +1 -0
- package/dist/agent-executor/vocabulary.d.ts +353 -0
- package/dist/agent-executor/vocabulary.d.ts.map +1 -0
- package/dist/agent-parts/parts.d.ts +160 -0
- package/dist/agent-parts/parts.d.ts.map +1 -0
- package/dist/agent-runtime/agent-tool.d.ts +1 -1
- package/dist/agent-runtime/agent-tool.d.ts.map +1 -1
- package/dist/agent-runtime/archive-projection.d.ts +5 -0
- package/dist/agent-runtime/archive-projection.d.ts.map +1 -1
- package/dist/agent-runtime/branch-contract.d.ts +63 -1
- package/dist/agent-runtime/branch-contract.d.ts.map +1 -1
- package/dist/agent-runtime/branch-events.d.ts +7 -0
- package/dist/agent-runtime/branch-events.d.ts.map +1 -1
- package/dist/agent-runtime/branch-identities.d.ts +53 -1
- package/dist/agent-runtime/branch-identities.d.ts.map +1 -1
- package/dist/agent-runtime/branch-messages.d.ts +15 -26
- package/dist/agent-runtime/branch-messages.d.ts.map +1 -1
- package/dist/agent-runtime/branch-observations.d.ts +138 -28
- package/dist/agent-runtime/branch-observations.d.ts.map +1 -1
- package/dist/agent-runtime/branch-provider.d.ts +32 -51
- package/dist/agent-runtime/branch-provider.d.ts.map +1 -1
- package/dist/agent-runtime/branch-refusal.d.ts +60 -0
- package/dist/agent-runtime/branch-refusal.d.ts.map +1 -0
- package/dist/agent-runtime/branch-runtime-tools.d.ts +14 -0
- package/dist/agent-runtime/branch-runtime-tools.d.ts.map +1 -0
- package/dist/agent-runtime/branch-source.d.ts +7 -2
- package/dist/agent-runtime/branch-source.d.ts.map +1 -1
- package/dist/agent-runtime/branch-transitions.d.ts.map +1 -1
- package/dist/agent-runtime/browser-control-contract.d.ts +2 -2
- package/dist/agent-runtime/browser-controller.d.ts.map +1 -1
- package/dist/agent-runtime/child-blocking.d.ts +17 -6
- package/dist/agent-runtime/child-blocking.d.ts.map +1 -1
- package/dist/agent-runtime/child-budget-policy.d.ts +4 -9
- package/dist/agent-runtime/child-budget-policy.d.ts.map +1 -1
- package/dist/agent-runtime/child-tools.d.ts +19 -8
- package/dist/agent-runtime/child-tools.d.ts.map +1 -1
- package/dist/agent-runtime/children-contract.d.ts +84 -3
- package/dist/agent-runtime/children-contract.d.ts.map +1 -1
- package/dist/agent-runtime/children-control.d.ts +23 -2
- package/dist/agent-runtime/children-control.d.ts.map +1 -1
- package/dist/agent-runtime/children-spawn.d.ts +9 -0
- package/dist/agent-runtime/children-spawn.d.ts.map +1 -1
- package/dist/agent-runtime/children-state.d.ts +121 -19
- package/dist/agent-runtime/children-state.d.ts.map +1 -1
- package/dist/agent-runtime/children-usage.d.ts +10 -1
- package/dist/agent-runtime/children-usage.d.ts.map +1 -1
- package/dist/agent-runtime/children.d.ts +3 -3
- package/dist/agent-runtime/children.d.ts.map +1 -1
- package/dist/agent-runtime/{sandbox-coding.d.ts → coding-sandbox.d.ts} +2 -9
- package/dist/agent-runtime/coding-sandbox.d.ts.map +1 -0
- package/dist/agent-runtime/coding-shell-process.d.ts +2 -0
- package/dist/agent-runtime/coding-shell-process.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-contract.d.ts +32 -1
- package/dist/agent-runtime/coding-tool-contract.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-shell.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tools.d.ts.map +1 -1
- package/dist/agent-runtime/compaction.d.ts.map +1 -1
- package/dist/agent-runtime/companion-host.d.ts +38 -0
- package/dist/agent-runtime/companion-host.d.ts.map +1 -0
- package/dist/agent-runtime/context-issue.d.ts +5 -0
- package/dist/agent-runtime/context-issue.d.ts.map +1 -0
- package/dist/agent-runtime/control-schema.d.ts +2 -2
- package/dist/agent-runtime/control-schema.d.ts.map +1 -1
- package/dist/agent-runtime/conversations.d.ts.map +1 -1
- package/dist/agent-runtime/coordinator.d.ts.map +1 -1
- package/dist/agent-runtime/deferred-tool-types.d.ts +17 -5
- package/dist/agent-runtime/deferred-tool-types.d.ts.map +1 -1
- package/dist/agent-runtime/deferred-tools-internal.d.ts +2 -0
- package/dist/agent-runtime/deferred-tools-internal.d.ts.map +1 -1
- package/dist/agent-runtime/deferred-tools.d.ts.map +1 -1
- package/dist/agent-runtime/event-durability.d.ts +8 -0
- package/dist/agent-runtime/event-durability.d.ts.map +1 -0
- package/dist/agent-runtime/event-schema.d.ts +13 -5
- package/dist/agent-runtime/event-schema.d.ts.map +1 -1
- package/dist/agent-runtime/event-search-postgres.d.ts +38 -0
- package/dist/agent-runtime/event-search-postgres.d.ts.map +1 -0
- package/dist/agent-runtime/event-search-terms.d.ts +37 -0
- package/dist/agent-runtime/event-search-terms.d.ts.map +1 -0
- package/dist/agent-runtime/event-search-tools.d.ts +64 -4
- package/dist/agent-runtime/event-search-tools.d.ts.map +1 -1
- package/dist/agent-runtime/event-search.d.ts +16 -3
- package/dist/agent-runtime/event-search.d.ts.map +1 -1
- package/dist/agent-runtime/fault-bench.d.ts.map +1 -1
- package/dist/agent-runtime/harness-control.d.ts +8 -0
- package/dist/agent-runtime/harness-control.d.ts.map +1 -1
- package/dist/agent-runtime/harness-realtime.d.ts +0 -2
- package/dist/agent-runtime/harness-realtime.d.ts.map +1 -1
- package/dist/agent-runtime/invocation-read.d.ts.map +1 -1
- package/dist/agent-runtime/invocation-schema.d.ts +23 -0
- package/dist/agent-runtime/invocation-schema.d.ts.map +1 -1
- package/dist/agent-runtime/invocation-spend.d.ts +9 -0
- package/dist/agent-runtime/invocation-spend.d.ts.map +1 -0
- package/dist/agent-runtime/invocations.d.ts.map +1 -1
- package/dist/agent-runtime/managed-tools.d.ts +2 -2
- package/dist/agent-runtime/managed-tools.d.ts.map +1 -1
- package/dist/agent-runtime/observability.d.ts +42 -4
- package/dist/agent-runtime/observability.d.ts.map +1 -1
- package/dist/agent-runtime/openrouter-admission.d.ts +81 -0
- package/dist/agent-runtime/openrouter-admission.d.ts.map +1 -0
- package/dist/agent-runtime/openrouter-catalog.d.ts +83 -0
- package/dist/agent-runtime/openrouter-catalog.d.ts.map +1 -0
- package/dist/agent-runtime/openrouter-models.d.ts +66 -0
- package/dist/agent-runtime/openrouter-models.d.ts.map +1 -0
- package/dist/agent-runtime/openrouter-options.d.ts +106 -0
- package/dist/agent-runtime/openrouter-options.d.ts.map +1 -0
- package/dist/agent-runtime/openrouter-route.d.ts +50 -0
- package/dist/agent-runtime/openrouter-route.d.ts.map +1 -0
- package/dist/agent-runtime/openrouter-spend.d.ts +24 -0
- package/dist/agent-runtime/openrouter-spend.d.ts.map +1 -0
- package/dist/agent-runtime/openrouter.d.ts +23 -2
- package/dist/agent-runtime/openrouter.d.ts.map +1 -1
- package/dist/agent-runtime/owned-provider-stream.d.ts.map +1 -1
- package/dist/agent-runtime/postgres-schema.d.ts +34 -0
- package/dist/agent-runtime/postgres-schema.d.ts.map +1 -0
- package/dist/agent-runtime/postgres-transactions.d.ts +54 -0
- package/dist/agent-runtime/postgres-transactions.d.ts.map +1 -0
- package/dist/agent-runtime/postgres.d.ts +72 -0
- package/dist/agent-runtime/postgres.d.ts.map +1 -0
- package/dist/agent-runtime/projections.d.ts +57 -17
- package/dist/agent-runtime/projections.d.ts.map +1 -1
- package/dist/agent-runtime/provider-journal.d.ts +57 -0
- package/dist/agent-runtime/provider-journal.d.ts.map +1 -1
- package/dist/agent-runtime/purge.d.ts.map +1 -1
- package/dist/agent-runtime/retry-policy.d.ts +6 -0
- package/dist/agent-runtime/retry-policy.d.ts.map +1 -1
- package/dist/agent-runtime/run-acquisition.d.ts.map +1 -1
- package/dist/agent-runtime/run-execution-state.d.ts +26 -2
- package/dist/agent-runtime/run-execution-state.d.ts.map +1 -1
- package/dist/agent-runtime/run-execution.d.ts.map +1 -1
- package/dist/agent-runtime/run-failure.d.ts.map +1 -1
- package/dist/agent-runtime/run-model-attempts.d.ts.map +1 -1
- package/dist/agent-runtime/run-provider-ledger.d.ts +2 -0
- package/dist/agent-runtime/run-provider-ledger.d.ts.map +1 -1
- package/dist/agent-runtime/run-step-barriers.d.ts +72 -0
- package/dist/agent-runtime/run-step-barriers.d.ts.map +1 -0
- package/dist/agent-runtime/run-step-spend.d.ts +319 -0
- package/dist/agent-runtime/run-step-spend.d.ts.map +1 -0
- package/dist/agent-runtime/run-stream-parts.d.ts +2 -0
- package/dist/agent-runtime/run-stream-parts.d.ts.map +1 -1
- package/dist/agent-runtime/{tool-progress.d.ts → run-tool-progress.d.ts} +1 -1
- package/dist/agent-runtime/run-tool-progress.d.ts.map +1 -0
- package/dist/agent-runtime/run-turn-preparation.d.ts +3 -1
- package/dist/agent-runtime/run-turn-preparation.d.ts.map +1 -1
- package/dist/agent-runtime/runtime-admission-gate.d.ts +0 -14
- package/dist/agent-runtime/runtime-admission-gate.d.ts.map +1 -1
- package/dist/agent-runtime/runtime-internals.d.ts +6 -0
- package/dist/agent-runtime/runtime-internals.d.ts.map +1 -1
- package/dist/agent-runtime/runtime-state.d.ts.map +1 -1
- package/dist/agent-runtime/runtime.d.ts +31 -2
- package/dist/agent-runtime/runtime.d.ts.map +1 -1
- package/dist/agent-runtime/sandbox-binding.d.ts +10 -0
- package/dist/agent-runtime/sandbox-binding.d.ts.map +1 -0
- package/dist/agent-runtime/sandbox-bubblewrap-storage.d.ts.map +1 -1
- package/dist/agent-runtime/sandbox-contract.d.ts +1 -1
- package/dist/agent-runtime/sandbox-contract.d.ts.map +1 -1
- package/dist/agent-runtime/sandbox.d.ts +5 -0
- package/dist/agent-runtime/sandbox.d.ts.map +1 -1
- package/dist/agent-runtime/schedule-contract.d.ts +3 -2
- package/dist/agent-runtime/schedule-contract.d.ts.map +1 -1
- package/dist/agent-runtime/schedule-dispatch.d.ts +3 -2
- package/dist/agent-runtime/schedule-dispatch.d.ts.map +1 -1
- package/dist/agent-runtime/schedule-records.d.ts +6 -6
- package/dist/agent-runtime/schedule-records.d.ts.map +1 -1
- package/dist/agent-runtime/schedule-tools.d.ts +19 -8
- package/dist/agent-runtime/schedule-tools.d.ts.map +1 -1
- package/dist/agent-runtime/schedules.d.ts +13 -3
- package/dist/agent-runtime/schedules.d.ts.map +1 -1
- package/dist/agent-runtime/schemas-message.d.ts +118 -0
- package/dist/agent-runtime/schemas-message.d.ts.map +1 -0
- package/dist/agent-runtime/schemas-provider.d.ts +8 -0
- package/dist/agent-runtime/schemas-provider.d.ts.map +1 -0
- package/dist/agent-runtime/schemas-records.d.ts +5 -0
- package/dist/agent-runtime/schemas-records.d.ts.map +1 -0
- package/dist/agent-runtime/schemas-run.d.ts +487 -0
- package/dist/agent-runtime/schemas-run.d.ts.map +1 -0
- package/dist/agent-runtime/schemas-usage.d.ts +129 -0
- package/dist/agent-runtime/schemas-usage.d.ts.map +1 -0
- package/dist/agent-runtime/schemas.d.ts +11 -886
- package/dist/agent-runtime/schemas.d.ts.map +1 -1
- package/dist/agent-runtime/spill.d.ts +9 -7
- package/dist/agent-runtime/spill.d.ts.map +1 -1
- package/dist/agent-runtime/sql-events.d.ts +6 -0
- package/dist/agent-runtime/sql-events.d.ts.map +1 -0
- package/dist/agent-runtime/sql-history.d.ts +8 -0
- package/dist/agent-runtime/sql-history.d.ts.map +1 -0
- package/dist/agent-runtime/sql-ledger.d.ts +5 -0
- package/dist/agent-runtime/sql-ledger.d.ts.map +1 -0
- package/dist/agent-runtime/sql-purge.d.ts +13 -0
- package/dist/agent-runtime/sql-purge.d.ts.map +1 -0
- package/dist/agent-runtime/sql-reads.d.ts +16 -0
- package/dist/agent-runtime/sql-reads.d.ts.map +1 -0
- package/dist/agent-runtime/{sqlite-rows.d.ts → sql-rows.d.ts} +24 -10
- package/dist/agent-runtime/sql-rows.d.ts.map +1 -0
- package/dist/agent-runtime/sql-session.d.ts +71 -0
- package/dist/agent-runtime/sql-session.d.ts.map +1 -0
- package/dist/agent-runtime/sqlite-bun.d.ts +1 -1
- package/dist/agent-runtime/sqlite-bun.d.ts.map +1 -1
- package/dist/agent-runtime/sqlite-node.d.ts +1 -1
- package/dist/agent-runtime/sqlite-node.d.ts.map +1 -1
- package/dist/agent-runtime/sqlite-purge.d.ts +2 -3
- package/dist/agent-runtime/sqlite-purge.d.ts.map +1 -1
- package/dist/agent-runtime/sqlite-schema.d.ts +1 -1
- package/dist/agent-runtime/sqlite-schema.d.ts.map +1 -1
- package/dist/agent-runtime/sqlite-transactions.d.ts +10 -6
- package/dist/agent-runtime/sqlite-transactions.d.ts.map +1 -1
- package/dist/agent-runtime/sqlite.d.ts +10 -29
- package/dist/agent-runtime/sqlite.d.ts.map +1 -1
- package/dist/agent-runtime/state-tools.d.ts +8 -4
- package/dist/agent-runtime/state-tools.d.ts.map +1 -1
- package/dist/agent-runtime/store-archive.d.ts.map +1 -1
- package/dist/agent-runtime/store-branch.d.ts +6 -1
- package/dist/agent-runtime/store-branch.d.ts.map +1 -1
- package/dist/agent-runtime/store-capabilities.d.ts +42 -0
- package/dist/agent-runtime/store-capabilities.d.ts.map +1 -0
- package/dist/agent-runtime/store-conformance-branch.d.ts +5 -2
- package/dist/agent-runtime/store-conformance-branch.d.ts.map +1 -1
- package/dist/agent-runtime/store-conformance-capabilities.d.ts +6 -0
- package/dist/agent-runtime/store-conformance-capabilities.d.ts.map +1 -0
- package/dist/agent-runtime/store-conformance-event-once.d.ts +12 -0
- package/dist/agent-runtime/store-conformance-event-once.d.ts.map +1 -0
- package/dist/agent-runtime/store-conformance-lifecycle.d.ts +20 -20
- package/dist/agent-runtime/store-conformance-seed.d.ts +8 -0
- package/dist/agent-runtime/store-conformance-seed.d.ts.map +1 -0
- package/dist/agent-runtime/store-conformance.d.ts +31 -8
- package/dist/agent-runtime/store-conformance.d.ts.map +1 -1
- package/dist/agent-runtime/store-create.d.ts +1 -1
- package/dist/agent-runtime/store-create.d.ts.map +1 -1
- package/dist/agent-runtime/store-driver-contract.d.ts +15 -8
- package/dist/agent-runtime/store-driver-contract.d.ts.map +1 -1
- package/dist/agent-runtime/store-event-once.d.ts.map +1 -1
- package/dist/agent-runtime/store-events.d.ts +114 -0
- package/dist/agent-runtime/store-events.d.ts.map +1 -1
- package/dist/agent-runtime/store-memory-archive.d.ts +2 -0
- package/dist/agent-runtime/store-memory-archive.d.ts.map +1 -1
- package/dist/agent-runtime/store-memory.d.ts +2 -2
- package/dist/agent-runtime/store-memory.d.ts.map +1 -1
- package/dist/agent-runtime/store-mutate.d.ts.map +1 -1
- package/dist/agent-runtime/store-reduce-shared.d.ts +2 -1
- package/dist/agent-runtime/store-reduce-shared.d.ts.map +1 -1
- package/dist/agent-runtime/store-reducer.d.ts.map +1 -1
- package/dist/agent-runtime/store-replay.d.ts.map +1 -1
- package/dist/agent-runtime/store.d.ts +15 -2
- package/dist/agent-runtime/store.d.ts.map +1 -1
- package/dist/agent-runtime/terminal-commit.d.ts +10 -10
- package/dist/application/admission-run.d.ts.map +1 -1
- package/dist/application/admission.d.ts.map +1 -1
- package/dist/application/change-subscription.d.ts.map +1 -1
- package/dist/application/decisions.d.ts.map +1 -1
- package/dist/application/diagnostic-journal-lock-format.d.ts +9 -0
- package/dist/application/diagnostic-journal-lock-format.d.ts.map +1 -0
- package/dist/application/diagnostic-journal-manager.d.ts.map +1 -1
- package/dist/application/directory-inbox-delivery.d.ts.map +1 -1
- package/dist/application/grammy-update-admission.d.ts.map +1 -1
- package/dist/application/health.d.ts.map +1 -1
- package/dist/application/kernel-admission.d.ts.map +1 -1
- package/dist/application/kernel-contract.d.ts.map +1 -1
- package/dist/application/kernel-restart.d.ts.map +1 -1
- package/dist/application/kernel-rollback.d.ts.map +1 -1
- package/dist/application/kernel-shutdown.d.ts.map +1 -1
- package/dist/application/kernel-state.d.ts.map +1 -1
- package/dist/application/notification-outbox-state.d.ts.map +1 -1
- package/dist/application/notification-outbox.d.ts +1 -1
- package/dist/application/notification-outbox.d.ts.map +1 -1
- package/dist/application/revision-signal.d.ts.map +1 -1
- package/dist/application/schedule-run.d.ts.map +1 -1
- package/dist/application/schedule.d.ts.map +1 -1
- package/dist/application/sqlite-migrations.d.ts +104 -0
- package/dist/application/sqlite-migrations.d.ts.map +1 -0
- package/dist/application/watch-hub-core.d.ts +2 -1
- package/dist/application/watch-hub-core.d.ts.map +1 -1
- package/dist/application/watch-hub-source.d.ts +2 -0
- package/dist/application/watch-hub-source.d.ts.map +1 -1
- package/dist/application/watch-hub.d.ts +20 -1
- package/dist/application/watch-hub.d.ts.map +1 -1
- package/dist/browser/bridge-errors.d.ts +24 -0
- package/dist/browser/bridge-errors.d.ts.map +1 -0
- package/dist/browser/bridge-fetch.d.ts +30 -0
- package/dist/browser/bridge-fetch.d.ts.map +1 -0
- package/dist/browser/bridge-inbound.d.ts +28 -0
- package/dist/browser/bridge-inbound.d.ts.map +1 -0
- package/dist/browser/cancellation.d.ts +10 -2
- package/dist/browser/cancellation.d.ts.map +1 -1
- package/dist/browser/chunked-upload.d.ts +1 -1
- package/dist/browser/chunked-upload.d.ts.map +1 -1
- package/dist/browser/client-call-arguments.d.ts +31 -0
- package/dist/browser/client-call-arguments.d.ts.map +1 -0
- package/dist/browser/client-executors.d.ts +6 -0
- package/dist/browser/client-executors.d.ts.map +1 -1
- package/dist/browser/client.d.ts +9 -0
- package/dist/browser/client.d.ts.map +1 -1
- package/dist/browser/http.d.ts +17 -2
- package/dist/browser/http.d.ts.map +1 -1
- package/dist/browser/realtime-client.d.ts +0 -5
- package/dist/browser/realtime-client.d.ts.map +1 -1
- package/dist/browser/session-credentials-storage.d.ts +48 -0
- package/dist/browser/session-credentials-storage.d.ts.map +1 -0
- package/dist/browser/session-credentials.d.ts +26 -5
- package/dist/browser/session-credentials.d.ts.map +1 -1
- package/dist/browser/session-refresh-policy.d.ts +124 -0
- package/dist/browser/session-refresh-policy.d.ts.map +1 -0
- package/dist/browser/session-refresh-timer.d.ts +30 -0
- package/dist/browser/session-refresh-timer.d.ts.map +1 -0
- package/dist/browser/session.d.ts.map +1 -1
- package/dist/browser/socket-io-connection.d.ts.map +1 -1
- package/dist/browser/socket-io-explicit-peer.d.ts +0 -1
- package/dist/browser/socket-io-explicit-peer.d.ts.map +1 -1
- package/dist/browser/stream.d.ts +1 -1
- package/dist/browser/stream.d.ts.map +1 -1
- package/dist/browser/upload-progress.d.ts +3 -0
- package/dist/browser/upload-progress.d.ts.map +1 -1
- package/dist/contract/bridge-envelope.d.ts +155 -0
- package/dist/contract/bridge-envelope.d.ts.map +1 -0
- package/dist/contract/define-validation.d.ts +2 -0
- package/dist/contract/define-validation.d.ts.map +1 -1
- package/dist/contract/define.d.ts +3 -0
- package/dist/contract/define.d.ts.map +1 -1
- package/dist/contract/errors.d.ts +4 -4
- package/dist/contract/errors.d.ts.map +1 -1
- package/dist/contract/normalize.d.ts +3 -1
- package/dist/contract/normalize.d.ts.map +1 -1
- package/dist/contract/operation-effect.d.ts +29 -0
- package/dist/contract/operation-effect.d.ts.map +1 -0
- package/dist/contract/runtime-context.d.ts +2 -0
- package/dist/contract/runtime-context.d.ts.map +1 -1
- package/dist/contract/tool-options.d.ts +7 -0
- package/dist/contract/tool-options.d.ts.map +1 -1
- package/dist/declaration/command.d.ts +26 -0
- package/dist/declaration/command.d.ts.map +1 -0
- package/dist/declaration/declaration.d.ts +4 -22
- package/dist/declaration/declaration.d.ts.map +1 -1
- package/dist/declaration/machine-names.d.ts +11 -0
- package/dist/declaration/machine-names.d.ts.map +1 -0
- package/dist/durability/effect.d.ts.map +1 -1
- package/dist/durability/engine.d.ts.map +1 -1
- package/dist/durability/events.d.ts +5 -8
- package/dist/durability/events.d.ts.map +1 -1
- package/dist/durability/parks.d.ts +0 -5
- package/dist/durability/parks.d.ts.map +1 -1
- package/dist/durability/scheduler.d.ts +5 -0
- package/dist/durability/scheduler.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/acp.d.ts +4 -0
- package/dist/entrypoints/agent-executor/acp.d.ts.map +1 -0
- package/dist/entrypoints/agent-executor/acp.js +910 -0
- package/dist/entrypoints/agent-executor/claude-sdk.d.ts +2 -0
- package/dist/entrypoints/agent-executor/claude-sdk.d.ts.map +1 -0
- package/dist/entrypoints/agent-executor/claude-sdk.js +309 -0
- package/dist/entrypoints/agent-executor/claude.d.ts +5 -0
- package/dist/entrypoints/agent-executor/claude.d.ts.map +1 -0
- package/dist/entrypoints/agent-executor/claude.js +403 -0
- package/dist/entrypoints/agent-executor/codex.d.ts +4 -0
- package/dist/entrypoints/agent-executor/codex.d.ts.map +1 -0
- package/dist/entrypoints/agent-executor/codex.js +798 -0
- package/dist/entrypoints/agent-executor/testing.d.ts +4 -0
- package/dist/entrypoints/agent-executor/testing.d.ts.map +1 -0
- package/dist/entrypoints/agent-executor/testing.js +375 -0
- package/dist/entrypoints/agent-executor.d.ts +15 -0
- package/dist/entrypoints/agent-executor.d.ts.map +1 -0
- package/dist/entrypoints/agent-executor.js +455 -0
- package/dist/entrypoints/agent-runtime/browser.d.ts +1 -0
- package/dist/entrypoints/agent-runtime/browser.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime/browser.js +60 -30
- package/dist/entrypoints/agent-runtime/coding-tools.js +9 -12
- package/dist/entrypoints/agent-runtime/harness.js +35 -22
- package/dist/entrypoints/agent-runtime/openrouter.d.ts +6 -0
- package/dist/entrypoints/agent-runtime/openrouter.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime/openrouter.js +675 -45
- package/dist/entrypoints/agent-runtime/postgres.d.ts +4 -0
- package/dist/entrypoints/agent-runtime/postgres.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime/postgres.js +330 -0
- package/dist/entrypoints/agent-runtime/realtime.js +46 -49
- package/dist/entrypoints/agent-runtime/sandbox.d.ts +3 -1
- package/dist/entrypoints/agent-runtime/sandbox.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime/sandbox.js +74 -67
- package/dist/entrypoints/agent-runtime/sqlite/bun.js +18 -18
- package/dist/entrypoints/agent-runtime/sqlite/node.js +18 -18
- package/dist/entrypoints/agent-runtime/testing.d.ts +1 -1
- package/dist/entrypoints/agent-runtime/testing.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime/testing.js +419 -96
- package/dist/entrypoints/agent-runtime.d.ts +21 -13
- package/dist/entrypoints/agent-runtime.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime.js +1280 -1086
- package/dist/entrypoints/application/diagnostic-journal.js +16 -11
- package/dist/entrypoints/application/directory-inbox.js +20 -14
- package/dist/entrypoints/application/grammy.js +11 -8
- package/dist/entrypoints/application/opentelemetry.js +3 -3
- package/dist/entrypoints/application.d.ts +5 -3
- package/dist/entrypoints/application.d.ts.map +1 -1
- package/dist/entrypoints/application.js +464 -116
- package/dist/entrypoints/bin/upgrade-cli.d.ts +0 -12
- package/dist/entrypoints/bin/upgrade-cli.d.ts.map +1 -1
- package/dist/entrypoints/bin/upgrade-cli.js +13 -7
- package/dist/entrypoints/cli/publish.js +10 -9
- package/dist/entrypoints/cli.d.ts +10 -3
- package/dist/entrypoints/cli.d.ts.map +1 -1
- package/dist/entrypoints/cli.js +91 -29
- package/dist/entrypoints/contract.d.ts +2 -1
- package/dist/entrypoints/contract.d.ts.map +1 -1
- package/dist/entrypoints/contract.js +13 -7
- package/dist/entrypoints/declaration.d.ts +2 -0
- package/dist/entrypoints/declaration.d.ts.map +1 -1
- package/dist/entrypoints/declaration.js +55 -44
- package/dist/entrypoints/files/packaging.js +8 -5
- package/dist/entrypoints/files.d.ts +5 -0
- package/dist/entrypoints/files.d.ts.map +1 -1
- package/dist/entrypoints/files.js +236 -47
- package/dist/entrypoints/geo.js +9 -4
- package/dist/entrypoints/google.js +14 -13
- package/dist/entrypoints/handler.d.ts +12 -0
- package/dist/entrypoints/handler.d.ts.map +1 -0
- package/dist/entrypoints/handler.js +350 -0
- package/dist/entrypoints/http.d.ts +4 -0
- package/dist/entrypoints/http.d.ts.map +1 -1
- package/dist/entrypoints/http.js +411 -5
- package/dist/entrypoints/index.d.ts +2 -0
- package/dist/entrypoints/index.d.ts.map +1 -1
- package/dist/entrypoints/index.js +664 -91
- package/dist/entrypoints/live.js +22 -12
- package/dist/entrypoints/node.d.ts +2 -1
- package/dist/entrypoints/node.d.ts.map +1 -1
- package/dist/entrypoints/node.js +34 -24
- package/dist/entrypoints/observability.d.ts +2 -0
- package/dist/entrypoints/observability.d.ts.map +1 -1
- package/dist/entrypoints/observability.js +205 -131
- package/dist/entrypoints/primitives.js +152 -14
- package/dist/entrypoints/process/owner-loss.js +2 -2
- package/dist/entrypoints/process.js +18 -92
- package/dist/entrypoints/react.js +6 -5
- package/dist/entrypoints/realtime.d.ts +1 -0
- package/dist/entrypoints/realtime.d.ts.map +1 -1
- package/dist/entrypoints/realtime.js +6 -3
- package/dist/entrypoints/release.js +4 -0
- package/dist/entrypoints/remote.js +7 -6
- package/dist/entrypoints/server.d.ts +4 -2
- package/dist/entrypoints/server.d.ts.map +1 -1
- package/dist/entrypoints/server.js +300 -199
- package/dist/entrypoints/service-host/macos.d.ts +16 -0
- package/dist/entrypoints/service-host/macos.d.ts.map +1 -0
- package/dist/entrypoints/service-host/macos.js +1998 -0
- package/dist/entrypoints/service-host.d.ts +23 -0
- package/dist/entrypoints/service-host.d.ts.map +1 -0
- package/dist/entrypoints/service-host.js +2544 -0
- package/dist/entrypoints/spend/testing.d.ts +2 -0
- package/dist/entrypoints/spend/testing.d.ts.map +1 -0
- package/dist/entrypoints/spend/testing.js +442 -0
- package/dist/entrypoints/spend.d.ts +8 -0
- package/dist/entrypoints/spend.d.ts.map +1 -0
- package/dist/entrypoints/spend.js +593 -0
- package/dist/entrypoints/sync/postgres.d.ts +12 -0
- package/dist/entrypoints/sync/postgres.d.ts.map +1 -0
- package/dist/entrypoints/sync/postgres.js +737 -0
- package/dist/entrypoints/sync.d.ts +12 -0
- package/dist/entrypoints/sync.d.ts.map +1 -0
- package/dist/entrypoints/sync.js +782 -0
- package/dist/entrypoints/telegram/grammy.js +5 -5
- package/dist/entrypoints/telegram/html.d.ts +2 -0
- package/dist/entrypoints/telegram/html.d.ts.map +1 -1
- package/dist/entrypoints/telegram/html.js +839 -2
- package/dist/entrypoints/telegram/screens.js +13 -15
- package/dist/entrypoints/telegram.d.ts +1 -1
- package/dist/entrypoints/telegram.d.ts.map +1 -1
- package/dist/entrypoints/telegram.js +286 -76
- package/dist/entrypoints/testing.js +33 -41
- package/dist/entrypoints/tools/agent.js +12 -9
- package/dist/entrypoints/tools/connections.js +664 -63
- package/dist/entrypoints/tools/contract.d.ts +2 -2
- package/dist/entrypoints/tools/contract.js +4 -1
- package/dist/entrypoints/tools/invoker.js +9 -7
- package/dist/entrypoints/tools/mcp.js +16 -11
- package/dist/entrypoints/tools/toolkit.js +21 -16
- package/dist/entrypoints/tools.d.ts +3 -1
- package/dist/entrypoints/tools.d.ts.map +1 -1
- package/dist/entrypoints/tools.js +107 -94
- package/dist/entrypoints/tracking/contract.js +2 -1
- package/dist/entrypoints/tracking/performance.js +4 -0
- package/dist/entrypoints/tracking.js +6 -1
- package/dist/entrypoints/voice.js +3 -3
- package/dist/entrypoints/xlsx.js +1 -1
- package/dist/files/boundary.d.ts.map +1 -1
- package/dist/files/chunk-spool.d.ts +27 -0
- package/dist/files/chunk-spool.d.ts.map +1 -1
- package/dist/files/directory-appearance.d.ts +44 -0
- package/dist/files/directory-appearance.d.ts.map +1 -0
- package/dist/files/file-io.d.ts.map +1 -1
- package/dist/files/file-stamp.d.ts +35 -0
- package/dist/files/file-stamp.d.ts.map +1 -0
- package/dist/files/json-file-reading.d.ts +37 -0
- package/dist/files/json-file-reading.d.ts.map +1 -0
- package/dist/files/native-packaging.d.ts.map +1 -1
- package/dist/files/polled-json.d.ts +121 -0
- package/dist/files/polled-json.d.ts.map +1 -0
- package/dist/files/regular-file.d.ts +125 -0
- package/dist/files/regular-file.d.ts.map +1 -0
- package/dist/geo/index.d.ts +2 -1
- package/dist/geo/index.d.ts.map +1 -1
- package/dist/geo/resolver.d.ts.map +1 -1
- package/dist/geo/types.d.ts +0 -1
- package/dist/geo/types.d.ts.map +1 -1
- package/dist/google/google.d.ts +6 -0
- package/dist/google/google.d.ts.map +1 -1
- package/dist/{index-w0eqdhyd.js → index-09f7w2qq.js} +6 -1
- package/dist/index-0djnptn8.js +501 -0
- package/dist/index-0hdm5sx6.js +1457 -0
- package/dist/{index-t05a2ry4.js → index-0p0s5hrj.js} +8 -14
- package/dist/{index-1c945ten.js → index-0r15pkjq.js} +1 -1
- package/dist/{index-v1swr26p.js → index-0tyt97nk.js} +2 -2
- package/dist/{index-332d0m9g.js → index-0x4mnwg5.js} +4 -0
- package/dist/index-118aebbg.js +48 -0
- package/dist/index-1q0n6zek.js +184 -0
- package/dist/index-27hck3z2.js +307 -0
- package/dist/index-2rf33y2h.js +77 -0
- package/dist/index-360j58vb.js +63 -0
- package/dist/{index-tt30h7mr.js → index-39n02e0q.js} +1 -1
- package/dist/index-3agqmmrg.js +42 -0
- package/dist/{index-n6hvd1r2.js → index-3b31z0pc.js} +22 -15
- package/dist/index-3djgv3ch.js +472 -0
- package/dist/{index-mfntvj58.js → index-3dq8466w.js} +1 -1
- package/dist/index-3gwp8ez6.js +200 -0
- package/dist/{index-x2d51zay.js → index-3ypvpkwr.js} +309 -345
- package/dist/index-4gk6k3zc.js +248 -0
- package/dist/index-4qvyhn23.js +40 -0
- package/dist/index-4s2w4g37.js +647 -0
- package/dist/index-4ynw5ktx.js +78 -0
- package/dist/index-5awtbyns.js +19 -0
- package/dist/{index-kxff9e9w.js → index-5e0zsbf7.js} +5 -4
- package/dist/{index-nz06qw5a.js → index-5jyjb4s0.js} +1 -1
- package/dist/{index-7q05ag0z.js → index-5ptwb6ka.js} +1 -1
- package/dist/{index-w3nv6kr8.js → index-5q0qpw3v.js} +54 -9
- package/dist/{index-mm89hd8v.js → index-5t4fpdct.js} +1 -1
- package/dist/{index-0v9xb8pz.js → index-5y7j383h.js} +5 -5
- package/dist/index-5zwac8ft.js +221 -0
- package/dist/{index-v62cpkx3.js → index-6g85s734.js} +1 -1
- package/dist/{index-sqc6ezrb.js → index-6kec3b14.js} +17 -4
- package/dist/{index-kqnd6a85.js → index-7416mhyh.js} +1 -1
- package/dist/{index-m0wsfmrc.js → index-7csn6pva.js} +37 -24
- package/dist/{index-dqpesdck.js → index-7grgs8cx.js} +25 -5
- package/dist/{index-gdqawggb.js → index-7kfcb576.js} +143 -39
- package/dist/{index-cvjddnvd.js → index-7xp05h20.js} +19 -10
- package/dist/{index-fgzbc06j.js → index-83n766x4.js} +91 -50
- package/dist/{index-ss67fxhj.js → index-877e9y8r.js} +7 -7
- package/dist/{index-aw6kx2e6.js → index-8gmmdz7k.js} +1 -1
- package/dist/{index-wt6rw7rf.js → index-8xr2eq99.js} +29 -21
- package/dist/{index-rz3z13e9.js → index-97q9kykw.js} +1 -1
- package/dist/index-97rp94ff.js +8 -0
- package/dist/{index-0w0hxp7n.js → index-9pv126eh.js} +3 -9
- package/dist/{index-x2rvpbtj.js → index-9wh98cpa.js} +110 -16
- package/dist/{index-egg0yp2j.js → index-9xr44d2g.js} +86 -210
- package/dist/{index-b2sey031.js → index-9y0afd5f.js} +24 -23
- package/dist/index-a725ayvz.js +405 -0
- package/dist/{index-nmaqxdx7.js → index-ac5rj3d4.js} +203 -90
- package/dist/{index-wqzw3qg9.js → index-agy5fqgf.js} +32 -13
- package/dist/index-ajmtxsky.js +193 -0
- package/dist/{index-ndjzbt2v.js → index-akf0xkrm.js} +4 -3
- package/dist/index-akfgymyr.js +8 -0
- package/dist/index-apv5xfef.js +13 -0
- package/dist/index-ax3wns1a.js +93 -0
- package/dist/{index-0sg3wnzr.js → index-bbzvrq66.js} +1670 -340
- package/dist/index-bh4pmtr9.js +317 -0
- package/dist/{index-fa53vygr.js → index-bmaz3jzy.js} +3 -3
- package/dist/{index-8kzct1d6.js → index-bn2baakz.js} +143 -143
- package/dist/{index-m8ddk770.js → index-brhhaygm.js} +1 -1
- package/dist/index-caywx1c0.js +199 -0
- package/dist/index-cbhxhma2.js +90 -0
- package/dist/index-cfnmvcq8.js +11 -0
- package/dist/index-cv9b7fz2.js +42 -0
- package/dist/index-d4svrknj.js +156 -0
- package/dist/{index-a3z56mtn.js → index-d96c1n1q.js} +5 -3
- package/dist/{index-3ymcmpa9.js → index-dvd1qdwa.js} +33 -163
- package/dist/{index-v7rbjatr.js → index-dwa6pskj.js} +1837 -1151
- package/dist/{index-ne4j9998.js → index-e06z0tkb.js} +123 -94
- package/dist/{index-99nnsz39.js → index-en8e5zsj.js} +15 -135
- package/dist/index-fcw255hd.js +929 -0
- package/dist/{index-20hn8pbh.js → index-fmzg39a8.js} +1 -1
- package/dist/{index-fvd6pvw3.js → index-g1q7fwn9.js} +2 -2
- package/dist/index-g56ht6qf.js +98 -0
- package/dist/{index-f56ct5gb.js → index-gj1rjf78.js} +4 -3
- package/dist/{index-g6a3na27.js → index-gnjgkecx.js} +7 -3
- package/dist/index-hy4653g4.js +345 -0
- package/dist/index-j13gzgdv.js +403 -0
- package/dist/{index-r8swbw1x.js → index-j516jaaz.js} +37 -11
- package/dist/{index-t8jz0e20.js → index-j903yhp4.js} +30 -38
- package/dist/{index-9ypczvpj.js → index-jb4m241t.js} +2 -0
- package/dist/index-jrka9029.js +177 -0
- package/dist/{index-cjzaj7ev.js → index-jxtg307y.js} +23 -21
- package/dist/index-kmbpej2y.js +1152 -0
- package/dist/{index-bz9cmnqq.js → index-kt6dh1n6.js} +4 -4
- package/dist/index-ky3ardqn.js +80 -0
- package/dist/index-kyejf658.js +14 -0
- package/dist/{index-zyc64nbh.js → index-kynwa08q.js} +52 -47
- package/dist/index-kzavdze2.js +15 -0
- package/dist/{index-pq7rkwkk.js → index-mbd92r1w.js} +67 -12
- package/dist/index-mxt0wfjy.js +58 -0
- package/dist/{index-9cxxfkhb.js → index-n20tybgk.js} +14 -9
- package/dist/index-nbv44x0x.js +250 -0
- package/dist/index-ngwf1s3c.js +51 -0
- package/dist/{index-zfncctjp.js → index-nk0cy9g1.js} +5 -4
- package/dist/index-p1m9djt6.js +108 -0
- package/dist/{index-hs76yzt7.js → index-paff5y0r.js} +17 -11
- package/dist/{index-qaet40b2.js → index-prf6ayhf.js} +5 -7
- package/dist/{index-hkxgennw.js → index-ps3djm8d.js} +7 -1
- package/dist/{index-1v3k5zgx.js → index-qnzhmk2s.js} +528 -1129
- package/dist/{index-3bzk2645.js → index-r9kq5ark.js} +1 -1
- package/dist/{index-hkw233vx.js → index-rbd2rq3z.js} +2 -2
- package/dist/{index-r0xr7y4m.js → index-rhb33thr.js} +138 -33
- package/dist/{index-kffm4r8w.js → index-rj32hkkp.js} +2 -2
- package/dist/index-rptj3qnc.js +96 -0
- package/dist/{index-hqsbtvta.js → index-rpyn7geq.js} +11 -3
- package/dist/{index-m9hb9wnk.js → index-sfzfd2m2.js} +2 -2
- package/dist/{index-sqkttz7z.js → index-sv5svtq7.js} +1 -1
- package/dist/{index-srs8hj9c.js → index-sx3g49y2.js} +5 -1
- package/dist/{index-9mjrnqxs.js → index-t1a2jrg7.js} +21 -91
- package/dist/{index-568w258r.js → index-tazm4dxf.js} +1 -1
- package/dist/{index-b51tzcgh.js → index-tf70nm22.js} +2 -2
- package/dist/index-ttexdtjj.js +28 -0
- package/dist/{index-gbj964dt.js → index-v37b2cd6.js} +1970 -3142
- package/dist/{index-0ndz5r8z.js → index-v59pxmf1.js} +17 -9
- package/dist/{index-rfkh44ss.js → index-vgytj9wp.js} +1 -1
- package/dist/{index-tnnmekgb.js → index-wa6h4tz6.js} +3 -3
- package/dist/{index-8wzhmgpa.js → index-wavv538x.js} +211 -196
- package/dist/{index-1szhrfsf.js → index-wbnpa8z6.js} +7 -5
- package/dist/index-werjqesf.js +43 -0
- package/dist/{index-7qyv50r4.js → index-wv8dqy7q.js} +2 -2
- package/dist/index-wz392jyz.js +10 -0
- package/dist/{index-1d7s7da0.js → index-x6sp5vpa.js} +36 -5
- package/dist/{index-bqzgaj57.js → index-x90w78yz.js} +183 -61
- package/dist/index-xgae0bn7.js +37 -0
- package/dist/index-xmr47znh.js +160 -0
- package/dist/{index-ftk3838x.js → index-xq4s9mka.js} +7 -2
- package/dist/{index-ww3gss55.js → index-xrgn784x.js} +1 -1
- package/dist/{index-fpwbskp2.js → index-xtby8rj3.js} +1 -1
- package/dist/index-xtkw9866.js +107 -0
- package/dist/{index-btjwc7xr.js → index-xypxnzhp.js} +15 -14
- package/dist/{index-yex7eg1v.js → index-y7sy1xdp.js} +6 -2
- package/dist/index-z4k0hqp9.js +476 -0
- package/dist/{index-a7ebd769.js → index-zwgwyvdt.js} +3 -3
- package/dist/internal/abort-error.d.ts +9 -0
- package/dist/internal/abort-error.d.ts.map +1 -0
- package/dist/internal/abort-race.d.ts +47 -4
- package/dist/internal/abort-race.d.ts.map +1 -1
- package/dist/internal/atomic-file.d.ts +19 -0
- package/dist/internal/atomic-file.d.ts.map +1 -1
- package/dist/internal/backoff.d.ts.map +1 -1
- package/dist/internal/bounded-body.d.ts +37 -1
- package/dist/internal/bounded-body.d.ts.map +1 -1
- package/dist/internal/bounded-file-read.d.ts +31 -15
- package/dist/internal/bounded-file-read.d.ts.map +1 -1
- package/dist/internal/bun-command.d.ts +11 -0
- package/dist/internal/bun-command.d.ts.map +1 -1
- package/dist/internal/channel.d.ts.map +1 -1
- package/dist/internal/coalesced-task.d.ts +14 -2
- package/dist/internal/coalesced-task.d.ts.map +1 -1
- package/dist/internal/darwin-binding-error.d.ts.map +1 -1
- package/dist/internal/darwin-binding.d.ts +10 -0
- package/dist/internal/darwin-binding.d.ts.map +1 -1
- package/dist/internal/deadline.d.ts +22 -2
- package/dist/internal/deadline.d.ts.map +1 -1
- package/dist/internal/exclusive-lock-owner.d.ts +20 -1
- package/dist/internal/exclusive-lock-owner.d.ts.map +1 -1
- package/dist/internal/exclusive-lock-read.d.ts +2 -0
- package/dist/internal/exclusive-lock-read.d.ts.map +1 -1
- package/dist/internal/exclusive-lock.d.ts +26 -0
- package/dist/internal/exclusive-lock.d.ts.map +1 -1
- package/dist/internal/file-observation.d.ts +49 -0
- package/dist/internal/file-observation.d.ts.map +1 -1
- package/dist/internal/json-response.d.ts +10 -0
- package/dist/internal/json-response.d.ts.map +1 -0
- package/dist/internal/open-descriptors.d.ts +5 -0
- package/dist/internal/open-descriptors.d.ts.map +1 -1
- package/dist/internal/optional-peer.d.ts.map +1 -1
- package/dist/internal/pinned-http.d.ts.map +1 -1
- package/dist/internal/positive-integer.d.ts +14 -6
- package/dist/internal/positive-integer.d.ts.map +1 -1
- package/dist/internal/postgres-query.d.ts +16 -0
- package/dist/internal/postgres-query.d.ts.map +1 -0
- package/dist/internal/process-identity.d.ts +21 -1
- package/dist/internal/process-identity.d.ts.map +1 -1
- package/dist/internal/process-instance.d.ts +6 -0
- package/dist/internal/process-instance.d.ts.map +1 -1
- package/dist/internal/request.d.ts +4 -0
- package/dist/internal/request.d.ts.map +1 -1
- package/dist/internal/secret-equal.d.ts +11 -0
- package/dist/internal/secret-equal.d.ts.map +1 -0
- package/dist/internal/secure-fetch.d.ts.map +1 -1
- package/dist/internal/sqlite.d.ts +8 -0
- package/dist/internal/sqlite.d.ts.map +1 -1
- package/dist/internal/timers.d.ts +20 -0
- package/dist/internal/timers.d.ts.map +1 -1
- package/dist/internal/typed.d.ts +11 -0
- package/dist/internal/typed.d.ts.map +1 -1
- package/dist/internal/unix-client-error.d.ts +21 -0
- package/dist/internal/unix-client-error.d.ts.map +1 -0
- package/dist/internal/unix-socket-lock.d.ts +23 -0
- package/dist/internal/unix-socket-lock.d.ts.map +1 -0
- package/dist/internal/unix-socket.d.ts +60 -0
- package/dist/internal/unix-socket.d.ts.map +1 -1
- package/dist/internal/upgrade-affects.d.ts +3 -3
- package/dist/internal/upgrade-affects.d.ts.map +1 -1
- package/dist/internal/upgrade-plan.d.ts.map +1 -1
- package/dist/json-schema/dialect.d.ts +0 -6
- package/dist/json-schema/dialect.d.ts.map +1 -1
- package/dist/json-schema/keywords.d.ts +116 -0
- package/dist/json-schema/keywords.d.ts.map +1 -0
- package/dist/json-schema/string-format.d.ts.map +1 -1
- package/dist/live/events.d.ts.map +1 -1
- package/dist/live/watch-client.d.ts.map +1 -1
- package/dist/observability/bounded-logger.d.ts +3 -0
- package/dist/observability/bounded-logger.d.ts.map +1 -1
- package/dist/observability/bounded-sink.d.ts.map +1 -1
- package/dist/observability/context.d.ts +12 -2
- package/dist/observability/context.d.ts.map +1 -1
- package/dist/observability/event-loop-delay.d.ts +62 -0
- package/dist/observability/event-loop-delay.d.ts.map +1 -0
- package/dist/observability/json-logger.d.ts.map +1 -1
- package/dist/observability/log-repeat.d.ts +44 -0
- package/dist/observability/log-repeat.d.ts.map +1 -0
- package/dist/observability/spool-core.d.ts +95 -0
- package/dist/observability/spool-core.d.ts.map +1 -0
- package/dist/observability/spool-file.d.ts +46 -0
- package/dist/observability/spool-file.d.ts.map +1 -0
- package/dist/observability/spool.d.ts +14 -8
- package/dist/observability/spool.d.ts.map +1 -1
- package/dist/observability/trace.d.ts.map +1 -1
- package/dist/observability/work.d.ts.map +1 -1
- package/dist/primitives/index.d.ts +1 -0
- package/dist/primitives/index.d.ts.map +1 -1
- package/dist/primitives/order-key.d.ts +37 -0
- package/dist/primitives/order-key.d.ts.map +1 -0
- package/dist/process/bun-child.d.ts.map +1 -1
- package/dist/process/command-owner.d.ts.map +1 -1
- package/dist/process/contract.d.ts +4 -3
- package/dist/process/contract.d.ts.map +1 -1
- package/dist/process/group-presence.d.ts.map +1 -1
- package/dist/process/group-settlement.d.ts +2 -0
- package/dist/process/group-settlement.d.ts.map +1 -1
- package/dist/process/group.d.ts +5 -1
- package/dist/process/group.d.ts.map +1 -1
- package/dist/process/launch.d.ts +5 -3
- package/dist/process/launch.d.ts.map +1 -1
- package/dist/process/owner-loss-guard.d.ts.map +1 -1
- package/dist/react/cache-bridge.d.ts.map +1 -1
- package/dist/release/watcher.d.ts.map +1 -1
- package/dist/server/bridge-host.d.ts +51 -0
- package/dist/server/bridge-host.d.ts.map +1 -0
- package/dist/server/bun.d.ts +4 -4
- package/dist/server/bun.d.ts.map +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.map +1 -1
- package/dist/server/create.d.ts +1 -0
- package/dist/server/create.d.ts.map +1 -1
- package/dist/server/endpoint-dispatch.d.ts.map +1 -1
- package/dist/server/endpoint-response.d.ts.map +1 -1
- package/dist/server/error-dispatch.d.ts +4 -0
- package/dist/server/error-dispatch.d.ts.map +1 -1
- package/dist/server/error-hook.d.ts +2 -0
- package/dist/server/error-hook.d.ts.map +1 -1
- package/dist/server/handler-state.d.ts +16 -2
- package/dist/server/handler-state.d.ts.map +1 -1
- package/dist/server/implement.d.ts +1 -0
- package/dist/server/implement.d.ts.map +1 -1
- package/dist/server/local-host.d.ts +47 -0
- package/dist/server/local-host.d.ts.map +1 -0
- package/dist/server/logger.d.ts +20 -3
- package/dist/server/logger.d.ts.map +1 -1
- package/dist/server/logging.d.ts +2 -1
- package/dist/server/logging.d.ts.map +1 -1
- package/dist/server/middleware/cors.d.ts +49 -3
- package/dist/server/middleware/cors.d.ts.map +1 -1
- package/dist/server/middleware/signed-link.d.ts +42 -0
- package/dist/server/middleware/signed-link.d.ts.map +1 -0
- package/dist/server/multipart-reader.d.ts +3 -1
- package/dist/server/multipart-reader.d.ts.map +1 -1
- package/dist/server/multipart.d.ts.map +1 -1
- package/dist/server/oauth/cimd.d.ts.map +1 -1
- package/dist/server/oauth/endpoints.d.ts.map +1 -1
- package/dist/server/openapi.d.ts.map +1 -1
- package/dist/server/protocol-outcome.d.ts +17 -0
- package/dist/server/protocol-outcome.d.ts.map +1 -0
- package/dist/server/raw.d.ts.map +1 -1
- package/dist/server/request-completion.d.ts +3 -1
- package/dist/server/request-completion.d.ts.map +1 -1
- package/dist/server/shutdown.d.ts.map +1 -1
- package/dist/server/socket-io-config.d.ts +1 -1
- package/dist/server/socket-io-config.d.ts.map +1 -1
- package/dist/server/streaming-route.d.ts.map +1 -1
- package/dist/server/types.d.ts +20 -11
- package/dist/server/types.d.ts.map +1 -1
- package/dist/server/unix-client-body.d.ts +4 -1
- package/dist/server/unix-client-body.d.ts.map +1 -1
- package/dist/server/unix-client-bun.d.ts.map +1 -1
- package/dist/server/unix-client.d.ts +1 -1
- package/dist/server/unix-client.d.ts.map +1 -1
- package/dist/service-host/artifact-activation.d.ts +58 -0
- package/dist/service-host/artifact-activation.d.ts.map +1 -0
- package/dist/service-host/artifact-manifest.d.ts +68 -0
- package/dist/service-host/artifact-manifest.d.ts.map +1 -0
- package/dist/service-host/artifact.d.ts +43 -0
- package/dist/service-host/artifact.d.ts.map +1 -0
- package/dist/service-host/config-reloader-contract.d.ts +66 -0
- package/dist/service-host/config-reloader-contract.d.ts.map +1 -0
- package/dist/service-host/config-reloader-helpers.d.ts +32 -0
- package/dist/service-host/config-reloader-helpers.d.ts.map +1 -0
- package/dist/service-host/config-reloader-source.d.ts +47 -0
- package/dist/service-host/config-reloader-source.d.ts.map +1 -0
- package/dist/service-host/config-reloader.d.ts +6 -0
- package/dist/service-host/config-reloader.d.ts.map +1 -0
- package/dist/service-host/host-adapter.d.ts +72 -0
- package/dist/service-host/host-adapter.d.ts.map +1 -0
- package/dist/service-host/identity-unix-socket.d.ts +101 -0
- package/dist/service-host/identity-unix-socket.d.ts.map +1 -0
- package/dist/service-host/identity.d.ts +117 -0
- package/dist/service-host/identity.d.ts.map +1 -0
- package/dist/service-host/launchd-plist.d.ts +77 -0
- package/dist/service-host/launchd-plist.d.ts.map +1 -0
- package/dist/service-host/launchd-render.d.ts +91 -0
- package/dist/service-host/launchd-render.d.ts.map +1 -0
- package/dist/service-host/launchd.d.ts +82 -0
- package/dist/service-host/launchd.d.ts.map +1 -0
- package/dist/service-host/macos/bundle-plist.d.ts +50 -0
- package/dist/service-host/macos/bundle-plist.d.ts.map +1 -0
- package/dist/service-host/macos/bundle.d.ts +66 -0
- package/dist/service-host/macos/bundle.d.ts.map +1 -0
- package/dist/service-host/macos/codesign.d.ts +95 -0
- package/dist/service-host/macos/codesign.d.ts.map +1 -0
- package/dist/service-host/macos/icon.d.ts +93 -0
- package/dist/service-host/macos/icon.d.ts.map +1 -0
- package/dist/service-host/macos/launch-services.d.ts +88 -0
- package/dist/service-host/macos/launch-services.d.ts.map +1 -0
- package/dist/service-host/macos/launcher.d.ts +59 -0
- package/dist/service-host/macos/launcher.d.ts.map +1 -0
- package/dist/service-host/macos/responsibility.d.ts +90 -0
- package/dist/service-host/macos/responsibility.d.ts.map +1 -0
- package/dist/service-host/macos/runner.d.ts +69 -0
- package/dist/service-host/macos/runner.d.ts.map +1 -0
- package/dist/service-host/plist-xml.d.ts +48 -0
- package/dist/service-host/plist-xml.d.ts.map +1 -0
- package/dist/service-host/process-evidence.d.ts +17 -0
- package/dist/service-host/process-evidence.d.ts.map +1 -0
- package/dist/service-host/systemd-inspect.d.ts +126 -0
- package/dist/service-host/systemd-inspect.d.ts.map +1 -0
- package/dist/service-host/systemd-links.d.ts +23 -0
- package/dist/service-host/systemd-links.d.ts.map +1 -0
- package/dist/service-host/systemd-render.d.ts +93 -0
- package/dist/service-host/systemd-render.d.ts.map +1 -0
- package/dist/service-host/systemd.d.ts +50 -0
- package/dist/service-host/systemd.d.ts.map +1 -0
- package/dist/spend/attribution.d.ts +17 -0
- package/dist/spend/attribution.d.ts.map +1 -0
- package/dist/spend/coverage-guard.d.ts +60 -0
- package/dist/spend/coverage-guard.d.ts.map +1 -0
- package/dist/spend/coverage-lexer.d.ts +20 -0
- package/dist/spend/coverage-lexer.d.ts.map +1 -0
- package/dist/spend/facts.d.ts +23 -0
- package/dist/spend/facts.d.ts.map +1 -0
- package/dist/spend/gateway-stream.d.ts +25 -0
- package/dist/spend/gateway-stream.d.ts.map +1 -0
- package/dist/spend/gateway.d.ts +64 -0
- package/dist/spend/gateway.d.ts.map +1 -0
- package/dist/spend/receipt-merge.d.ts +13 -0
- package/dist/spend/receipt-merge.d.ts.map +1 -0
- package/dist/spend/receipt-spool.d.ts +35 -0
- package/dist/spend/receipt-spool.d.ts.map +1 -0
- package/dist/spend/reconcile.d.ts +45 -0
- package/dist/spend/reconcile.d.ts.map +1 -0
- package/dist/spend/schemas.d.ts +249 -0
- package/dist/spend/schemas.d.ts.map +1 -0
- package/dist/sync/outbox.d.ts +131 -0
- package/dist/sync/outbox.d.ts.map +1 -0
- package/dist/sync/overlay.d.ts +59 -0
- package/dist/sync/overlay.d.ts.map +1 -0
- package/dist/sync/protocol.d.ts +132 -0
- package/dist/sync/protocol.d.ts.map +1 -0
- package/dist/sync/server-store-check.d.ts +10 -0
- package/dist/sync/server-store-check.d.ts.map +1 -0
- package/dist/sync/server-store-memory.d.ts +14 -0
- package/dist/sync/server-store-memory.d.ts.map +1 -0
- package/dist/sync/server-store-postgres.d.ts +25 -0
- package/dist/sync/server-store-postgres.d.ts.map +1 -0
- package/dist/sync/server-store.d.ts +139 -0
- package/dist/sync/server-store.d.ts.map +1 -0
- package/dist/sync/session-machine.d.ts +79 -0
- package/dist/sync/session-machine.d.ts.map +1 -0
- package/dist/sync/session-snapshot.d.ts +19 -0
- package/dist/sync/session-snapshot.d.ts.map +1 -0
- package/dist/sync/session-steps.d.ts +15 -0
- package/dist/sync/session-steps.d.ts.map +1 -0
- package/dist/sync/session.d.ts +142 -0
- package/dist/sync/session.d.ts.map +1 -0
- package/dist/sync/tombstones.d.ts +53 -0
- package/dist/sync/tombstones.d.ts.map +1 -0
- package/dist/telegram/bot-api.d.ts.map +1 -1
- package/dist/telegram/broadcast-failure.d.ts.map +1 -1
- package/dist/telegram/budget-transformer.d.ts.map +1 -1
- package/dist/telegram/crypto.d.ts +2 -10
- package/dist/telegram/crypto.d.ts.map +1 -1
- package/dist/telegram/html/markdown-inline.d.ts +19 -0
- package/dist/telegram/html/markdown-inline.d.ts.map +1 -0
- package/dist/telegram/html/markdown-lines.d.ts +51 -0
- package/dist/telegram/html/markdown-lines.d.ts.map +1 -0
- package/dist/telegram/html/markdown-split.d.ts +49 -0
- package/dist/telegram/html/markdown-split.d.ts.map +1 -0
- package/dist/telegram/html/markdown.d.ts +14 -0
- package/dist/telegram/html/markdown.d.ts.map +1 -0
- package/dist/telegram/html/nodes.d.ts +26 -4
- package/dist/telegram/html/nodes.d.ts.map +1 -1
- package/dist/telegram/html/parse.d.ts.map +1 -1
- package/dist/telegram/html/render.d.ts.map +1 -1
- package/dist/telegram/init-data.d.ts.map +1 -1
- package/dist/telegram/local-files.d.ts.map +1 -1
- package/dist/telegram/operator-channel.d.ts +15 -2
- package/dist/telegram/operator-channel.d.ts.map +1 -1
- package/dist/telegram/outbound-budget.d.ts.map +1 -1
- package/dist/telegram/outbound-cost.d.ts +9 -1
- package/dist/telegram/outbound-cost.d.ts.map +1 -1
- package/dist/telegram/outbound-queue.d.ts +2 -1
- package/dist/telegram/outbound-queue.d.ts.map +1 -1
- package/dist/telegram/screens/outcome.d.ts.map +1 -1
- package/dist/telegram/send-failure.d.ts.map +1 -1
- package/dist/telegram/transport-connect.d.ts.map +1 -1
- package/dist/telegram/transport.d.ts.map +1 -1
- package/dist/telegram/update-intake.d.ts.map +1 -1
- package/dist/telegram/update-store-postgres.d.ts +2 -2
- package/dist/telegram/update-store-postgres.d.ts.map +1 -1
- package/dist/telegram/webhook.d.ts.map +1 -1
- package/dist/testing/managed-resource-conformance.d.ts.map +1 -1
- package/dist/testing/surface-conformance.d.ts.map +1 -1
- package/dist/testing/surface-manifest.d.ts +2 -0
- package/dist/testing/surface-manifest.d.ts.map +1 -1
- package/dist/tools/access.d.ts +34 -0
- package/dist/tools/access.d.ts.map +1 -0
- package/dist/tools/agent.d.ts +14 -6
- package/dist/tools/agent.d.ts.map +1 -1
- package/dist/tools/cli/args-classify.d.ts +154 -0
- package/dist/tools/cli/args-classify.d.ts.map +1 -0
- package/dist/tools/cli/args-fields.d.ts +14 -7
- package/dist/tools/cli/args-fields.d.ts.map +1 -1
- package/dist/tools/cli/args-json.d.ts +1 -1
- package/dist/tools/cli/args-json.d.ts.map +1 -1
- package/dist/tools/cli/args-route.d.ts +4 -48
- package/dist/tools/cli/args-route.d.ts.map +1 -1
- package/dist/tools/cli/args-scan.d.ts +70 -0
- package/dist/tools/cli/args-scan.d.ts.map +1 -0
- package/dist/tools/cli/args-tokens.d.ts +2 -1
- package/dist/tools/cli/args-tokens.d.ts.map +1 -1
- package/dist/tools/cli/args.d.ts +31 -19
- package/dist/tools/cli/args.d.ts.map +1 -1
- package/dist/tools/cli/checkpoint.d.ts.map +1 -1
- package/dist/tools/cli/command-shape.d.ts +5 -0
- package/dist/tools/cli/command-shape.d.ts.map +1 -1
- package/dist/tools/cli/command.d.ts +57 -2
- package/dist/tools/cli/command.d.ts.map +1 -1
- package/dist/tools/cli/config.d.ts +15 -58
- package/dist/tools/cli/config.d.ts.map +1 -1
- package/dist/tools/cli/create-cli.d.ts +7 -3
- package/dist/tools/cli/create-cli.d.ts.map +1 -1
- package/dist/tools/cli/format.d.ts.map +1 -1
- package/dist/tools/cli/help.d.ts.map +1 -1
- package/dist/tools/cli/invoke.d.ts +70 -20
- package/dist/tools/cli/invoke.d.ts.map +1 -1
- package/dist/tools/cli/io.d.ts.map +1 -1
- package/dist/tools/cli/managed-surface.d.ts.map +1 -1
- package/dist/tools/cli/notices.d.ts.map +1 -1
- package/dist/tools/cli/policy.d.ts +66 -10
- package/dist/tools/cli/policy.d.ts.map +1 -1
- package/dist/tools/cli/prepare.d.ts +5 -4
- package/dist/tools/cli/prepare.d.ts.map +1 -1
- package/dist/tools/cli/run-managed.d.ts.map +1 -1
- package/dist/tools/cli/run-native.d.ts.map +1 -1
- package/dist/tools/cli/run-stream.d.ts.map +1 -1
- package/dist/tools/cli/runner.d.ts +28 -0
- package/dist/tools/cli/runner.d.ts.map +1 -0
- package/dist/tools/cli/session.d.ts +12 -6
- package/dist/tools/cli/session.d.ts.map +1 -1
- package/dist/tools/cli/stream-surface.d.ts.map +1 -1
- package/dist/tools/cli/stream.d.ts.map +1 -1
- package/dist/tools/cli/unavailable.d.ts +2 -0
- package/dist/tools/cli/unavailable.d.ts.map +1 -1
- package/dist/tools/cli/unix-outcome.d.ts +8 -0
- package/dist/tools/cli/unix-outcome.d.ts.map +1 -0
- package/dist/tools/cli/update.d.ts.map +1 -1
- package/dist/tools/cli/view-columns.d.ts +18 -0
- package/dist/tools/cli/view-columns.d.ts.map +1 -0
- package/dist/tools/cli/view.d.ts.map +1 -1
- package/dist/tools/connections/define.d.ts.map +1 -1
- package/dist/tools/connections/foreign-schema-join.d.ts +28 -0
- package/dist/tools/connections/foreign-schema-join.d.ts.map +1 -0
- package/dist/tools/connections/foreign-schema.d.ts +9 -0
- package/dist/tools/connections/foreign-schema.d.ts.map +1 -0
- package/dist/tools/connections/limits.d.ts +1 -1
- package/dist/tools/connections/limits.d.ts.map +1 -1
- package/dist/tools/connections/mcp-client.d.ts.map +1 -1
- package/dist/tools/connections/mcp.d.ts.map +1 -1
- package/dist/tools/connections/openapi.d.ts.map +1 -1
- package/dist/tools/connections/runtime.d.ts +18 -6
- package/dist/tools/connections/runtime.d.ts.map +1 -1
- package/dist/tools/connections/sse-session.d.ts.map +1 -1
- package/dist/tools/connections/types.d.ts +12 -2
- package/dist/tools/connections/types.d.ts.map +1 -1
- package/dist/tools/execute.d.ts.map +1 -1
- package/dist/tools/internal/expose.d.ts +6 -0
- package/dist/tools/internal/expose.d.ts.map +1 -0
- package/dist/tools/internal/json-projection.d.ts +17 -0
- package/dist/tools/internal/json-projection.d.ts.map +1 -0
- package/dist/tools/internal/surface-projector.d.ts +18 -4
- package/dist/tools/internal/surface-projector.d.ts.map +1 -1
- package/dist/tools/invoker.d.ts +9 -2
- package/dist/tools/invoker.d.ts.map +1 -1
- package/dist/tools/lifecycle.d.ts +8 -2
- package/dist/tools/lifecycle.d.ts.map +1 -1
- package/dist/tools/list-names.d.ts +1 -1
- package/dist/tools/list-names.d.ts.map +1 -1
- package/dist/tools/manifest.d.ts +2 -0
- package/dist/tools/manifest.d.ts.map +1 -1
- package/dist/tools/mcp/handler.d.ts.map +1 -1
- package/dist/tools/mcp/mount.d.ts +26 -14
- package/dist/tools/mcp/mount.d.ts.map +1 -1
- package/dist/tools/mcp/prepare.d.ts +2 -0
- package/dist/tools/mcp/prepare.d.ts.map +1 -1
- package/dist/tools/mcp/register.d.ts.map +1 -1
- package/dist/tools/mcp/runtime-tools.d.ts +1 -1
- package/dist/tools/mcp/runtime-tools.d.ts.map +1 -1
- package/dist/tools/mcp/stdio.d.ts.map +1 -1
- package/dist/tools/mount.d.ts +7 -2
- package/dist/tools/mount.d.ts.map +1 -1
- package/dist/tools/native-definition.d.ts +1 -1
- package/dist/tools/native-definition.d.ts.map +1 -1
- package/dist/tools/operations/async-operation-runtime-tools.d.ts +2 -2
- package/dist/tools/operations/async-operation-runtime-tools.d.ts.map +1 -1
- package/dist/tools/operations/async-operation-runtime-types.d.ts +1 -1
- package/dist/tools/operations/async-operation-runtime-types.d.ts.map +1 -1
- package/dist/tools/operations/define-wait-tool.d.ts.map +1 -1
- package/dist/tools/operations/mount-wait.d.ts.map +1 -1
- package/dist/tools/operations/wait-core.d.ts.map +1 -1
- package/dist/tools/read-operation.d.ts +6 -4
- package/dist/tools/read-operation.d.ts.map +1 -1
- package/dist/tools/registry.d.ts.map +1 -1
- package/dist/tools/runtime-tool-declaration.d.ts +4 -1
- package/dist/tools/runtime-tool-declaration.d.ts.map +1 -1
- package/dist/tools/runtime-tool.d.ts +6 -1
- package/dist/tools/runtime-tool.d.ts.map +1 -1
- package/dist/tools/schema/coerce.d.ts.map +1 -1
- package/dist/tools/schema/inline-references.d.ts +7 -0
- package/dist/tools/schema/inline-references.d.ts.map +1 -0
- package/dist/tools/schema/json-schema-origin.d.ts +1 -1
- package/dist/tools/schema/json-schema-origin.d.ts.map +1 -1
- package/dist/tools/schema/presentation.d.ts +6 -0
- package/dist/tools/schema/presentation.d.ts.map +1 -1
- package/dist/tools/schema/schema.d.ts +2 -0
- package/dist/tools/schema/schema.d.ts.map +1 -1
- package/dist/tools/schema/untyped-properties.d.ts.map +1 -1
- package/dist/tools/surface.d.ts.map +1 -1
- package/dist/tools/toolkit.d.ts +6 -3
- package/dist/tools/toolkit.d.ts.map +1 -1
- package/dist/tools/transfer/define-download-tool.d.ts.map +1 -1
- package/dist/tools/transfer/define-upload-tool.d.ts.map +1 -1
- package/dist/tools/transfer/define-view-file-tool.d.ts +2 -1
- package/dist/tools/transfer/define-view-file-tool.d.ts.map +1 -1
- package/dist/tools/transfer/mount-download.d.ts.map +1 -1
- package/dist/tools/transfer/view-file-contract.d.ts +2 -2
- package/dist/tools/transfer/view-file.d.ts +1 -2
- package/dist/tools/transfer/view-file.d.ts.map +1 -1
- package/dist/tracking/client.d.ts +0 -13
- package/dist/tracking/client.d.ts.map +1 -1
- package/dist/tracking/delivery.d.ts.map +1 -1
- package/dist/tracking/performance/collector.d.ts.map +1 -1
- package/llms/agent-executor-acp.txt +51 -0
- package/llms/agent-executor-claude-sdk.txt +31 -0
- package/llms/agent-executor-claude.txt +29 -0
- package/llms/agent-executor-codex.txt +25 -0
- package/llms/agent-executor-testing.txt +26 -0
- package/llms/agent-executor.txt +40 -0
- package/llms/agent-runtime-harness.txt +68 -5
- package/llms/agent-runtime-openrouter.txt +8 -2
- package/llms/agent-runtime-postgres.txt +30 -0
- package/llms/agent-runtime-react.txt +1 -1
- package/llms/agent-runtime-realtime.txt +1 -1
- package/llms/agent-runtime-sandbox.txt +5 -2
- package/llms/agent-runtime-sqlite-bun.txt +2 -2
- package/llms/agent-runtime-sqlite-node.txt +2 -2
- package/llms/agent-runtime-testing.txt +2 -1
- package/llms/agent-runtime.2.txt +475 -496
- package/llms/agent-runtime.3.txt +229 -267
- package/llms/agent-runtime.4.txt +23 -242
- package/llms/agent-runtime.5.txt +1 -1
- package/llms/agent-runtime.txt +551 -2
- package/llms/application-diagnostic-journal.txt +2 -0
- package/llms/application.2.txt +3 -0
- package/llms/application.3.txt +30 -7
- package/llms/application.txt +4 -1
- package/llms/cli.2.txt +259 -99
- package/llms/cli.3.txt +90 -0
- package/llms/cli.txt +95 -184
- package/llms/contract.txt +7 -6
- package/llms/declaration.txt +1 -1
- package/llms/files.txt +11 -0
- package/llms/handler.txt +25 -0
- package/llms/http.txt +18 -1
- package/llms/live.txt +28 -1
- package/llms/node.txt +3 -2
- package/llms/observability.2.txt +105 -0
- package/llms/observability.txt +14 -90
- package/llms/primitives.txt +27 -0
- package/llms/process.2.txt +2 -2
- package/llms/process.txt +10 -9
- package/llms/realtime.txt +11 -0
- package/llms/server.2.txt +355 -0
- package/llms/server.3.txt +2 -1
- package/llms/server.4.txt +45 -6
- package/llms/server.5.txt +9 -2
- package/llms/server.txt +185 -255
- package/llms/service-host-macos.txt +53 -0
- package/llms/service-host.txt +69 -0
- package/llms/spend-testing.txt +21 -0
- package/llms/spend.txt +173 -0
- package/llms/stitchkit.2.txt +368 -42
- package/llms/stitchkit.3.txt +164 -13
- package/llms/stitchkit.txt +95 -417
- package/llms/sync-postgres.txt +31 -0
- package/llms/sync.txt +396 -0
- package/llms/telegram-html.txt +4 -1
- package/llms/telegram.2.txt +4 -4
- package/llms/telegram.txt +105 -14
- package/llms/testing.txt +4 -3
- package/llms/tools-connections.txt +4 -4
- package/llms/tools.2.txt +78 -17
- package/llms/tools.3.txt +12 -8
- package/llms/tools.txt +85 -78
- package/llms/{upgrading-0.106.0-0.125.0.txt → upgrading-0.106.0-0.126.0.txt} +42 -3
- package/llms/upgrading-0.127.0.txt +1059 -0
- package/llms/upgrading.txt +2 -1
- package/llms-full.txt +3692 -518
- package/llms.txt +45 -29
- package/native/darwin-arm64.node +0 -0
- package/native/darwin-x64.node +0 -0
- package/native-assets.json +4 -4
- package/package.json +69 -11
- package/dist/agent-runtime/sandbox-coding.d.ts.map +0 -1
- package/dist/agent-runtime/sqlite-events.d.ts +0 -5
- package/dist/agent-runtime/sqlite-events.d.ts.map +0 -1
- package/dist/agent-runtime/sqlite-history.d.ts +0 -7
- package/dist/agent-runtime/sqlite-history.d.ts.map +0 -1
- package/dist/agent-runtime/sqlite-ledger.d.ts +0 -7
- package/dist/agent-runtime/sqlite-ledger.d.ts.map +0 -1
- package/dist/agent-runtime/sqlite-reads.d.ts +0 -14
- package/dist/agent-runtime/sqlite-reads.d.ts.map +0 -1
- package/dist/agent-runtime/sqlite-rows.d.ts.map +0 -1
- package/dist/agent-runtime/tool-progress.d.ts.map +0 -1
- package/dist/entrypoints/application/schemas.d.ts +0 -15
- package/dist/entrypoints/application/schemas.d.ts.map +0 -1
- package/dist/entrypoints/application/schemas.js +0 -27
- package/dist/index-0s4xebbg.js +0 -8
- package/dist/index-5dmk54h9.js +0 -256
- package/dist/index-7cn66qdk.js +0 -92
- package/dist/index-8x0q6yfb.js +0 -247
- package/dist/index-a5qr2rj6.js +0 -26
- package/dist/index-b0kddvzw.js +0 -35
- package/dist/index-cj5f0x4y.js +0 -1150
- package/dist/index-drcjjhy1.js +0 -40
- package/dist/index-eemvahkc.js +0 -21
- package/dist/index-gfk7nrht.js +0 -0
- package/dist/index-jp2qd9jb.js +0 -108
- package/dist/index-nx6eazt0.js +0 -160
- package/dist/index-wxadzdb7.js +0 -55
- package/dist/internal/until-aborted.d.ts +0 -9
- package/dist/internal/until-aborted.d.ts.map +0 -1
- package/dist/server/unix-client-error.d.ts +0 -9
- package/dist/server/unix-client-error.d.ts.map +0 -1
- package/llms/application-schemas.txt +0 -42
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import"../index-m38ej7e5.js";
|
|
2
|
+
import {
|
|
3
|
+
BackoffPolicySchema2,
|
|
4
|
+
createBackoff2
|
|
5
|
+
} from "../index-gnjgkecx.js";
|
|
2
6
|
import {
|
|
3
7
|
DEFAULT_CONTRACT_STREAM_FRAME_BYTES2,
|
|
4
8
|
ContractStreamFrameSchema2
|
|
5
|
-
} from "../index-
|
|
9
|
+
} from "../index-5y7j383h.js";
|
|
6
10
|
import {
|
|
7
11
|
createHttpClient2
|
|
8
|
-
} from "../index-
|
|
12
|
+
} from "../index-rhb33thr.js";
|
|
9
13
|
import {
|
|
10
14
|
ContractFingerprintSchema2,
|
|
11
15
|
contractFingerprint2,
|
|
@@ -15,26 +19,31 @@ import {
|
|
|
15
19
|
paginatedSchema2,
|
|
16
20
|
encodeCursor2,
|
|
17
21
|
decodeCursor2
|
|
18
|
-
} from "../index-
|
|
22
|
+
} from "../index-kt6dh1n6.js";
|
|
19
23
|
import {
|
|
20
24
|
ALL_TRANSPORTS2,
|
|
21
25
|
TOOL_TRANSPORTS2
|
|
22
26
|
} from "../index-yt1gg11x.js";
|
|
27
|
+
import {
|
|
28
|
+
OperationEffectSchema2,
|
|
29
|
+
contractOperationEffects2,
|
|
30
|
+
requireContractOperationEffects2
|
|
31
|
+
} from "../index-werjqesf.js";
|
|
23
32
|
import {
|
|
24
33
|
withToolView2,
|
|
25
34
|
defineContract2
|
|
26
|
-
} from "../index-
|
|
27
|
-
import"../index-
|
|
35
|
+
} from "../index-d4svrknj.js";
|
|
36
|
+
import"../index-09f7w2qq.js";
|
|
28
37
|
import {
|
|
29
38
|
LiveStatePhaseSchema2,
|
|
30
39
|
LiveStateStopReasonSchema2,
|
|
31
40
|
LiveStateControllerStatusSchema2,
|
|
32
41
|
createLiveStateController2
|
|
33
|
-
} from "../index-
|
|
42
|
+
} from "../index-vgytj9wp.js";
|
|
34
43
|
import {
|
|
35
44
|
REALTIME_REJECTION_KEY2,
|
|
36
45
|
asRealtimeRejection2
|
|
37
|
-
} from "../index-
|
|
46
|
+
} from "../index-0r15pkjq.js";
|
|
38
47
|
import {
|
|
39
48
|
RealtimeRequestPhaseSchema2,
|
|
40
49
|
RealtimeRequestPhaseEventSchema2,
|
|
@@ -43,10 +52,6 @@ import {
|
|
|
43
52
|
RealtimeRequestInvalidAcknowledgementError2,
|
|
44
53
|
RealtimeRequestRejectedError2
|
|
45
54
|
} from "../index-4s0fep5q.js";
|
|
46
|
-
import {
|
|
47
|
-
BackoffPolicySchema2,
|
|
48
|
-
createBackoff2
|
|
49
|
-
} from "../index-g6a3na27.js";
|
|
50
55
|
import {
|
|
51
56
|
defineRealtimeContract2
|
|
52
57
|
} from "../index-814xpr6d.js";
|
|
@@ -54,12 +59,20 @@ import {
|
|
|
54
59
|
ManagedFilePathSchema2,
|
|
55
60
|
ManagedFileRefSchema2
|
|
56
61
|
} from "../index-xqhede6x.js";
|
|
62
|
+
import {
|
|
63
|
+
DEFAULT_REPEAT_WINDOW_MS2,
|
|
64
|
+
DEFAULT_REPEAT_MAX_KINDS2,
|
|
65
|
+
repeatLimited2
|
|
66
|
+
} from "../index-4gk6k3zc.js";
|
|
57
67
|
import {
|
|
58
68
|
createMutationQueue
|
|
59
69
|
} from "../index-sykb5ag7.js";
|
|
70
|
+
import {
|
|
71
|
+
messageOf
|
|
72
|
+
} from "../index-r9kq5ark.js";
|
|
60
73
|
import {
|
|
61
74
|
uploadInChunks2
|
|
62
|
-
} from "../index-
|
|
75
|
+
} from "../index-rpyn7geq.js";
|
|
63
76
|
import {
|
|
64
77
|
parseNDJSON2,
|
|
65
78
|
createNDJSONDecoder2,
|
|
@@ -71,31 +84,22 @@ import {
|
|
|
71
84
|
createUrlBuilder2,
|
|
72
85
|
createUrlBuilders2,
|
|
73
86
|
createScopedUrlBuilders2
|
|
74
|
-
} from "../index-
|
|
87
|
+
} from "../index-e06z0tkb.js";
|
|
75
88
|
import {
|
|
76
89
|
StreamLineLimitError2,
|
|
77
90
|
StreamTruncatedLineError2
|
|
78
|
-
} from "../index-
|
|
91
|
+
} from "../index-sfzfd2m2.js";
|
|
79
92
|
import {
|
|
80
93
|
createRetainedTopics2,
|
|
81
94
|
createRealtimeClientWithPeer,
|
|
82
95
|
createSocketIOClientWithPeer
|
|
83
|
-
} from "../index-
|
|
96
|
+
} from "../index-xq4s9mka.js";
|
|
84
97
|
import {
|
|
85
98
|
bindRealtimeClient2
|
|
86
|
-
} from "../index-
|
|
99
|
+
} from "../index-nk0cy9g1.js";
|
|
87
100
|
import {
|
|
88
101
|
ApiError2
|
|
89
102
|
} from "../index-kfjkb396.js";
|
|
90
|
-
import {
|
|
91
|
-
withDeadline
|
|
92
|
-
} from "../index-wqzw3qg9.js";
|
|
93
|
-
import {
|
|
94
|
-
readBoundedBody2
|
|
95
|
-
} from "../index-wxadzdb7.js";
|
|
96
|
-
import {
|
|
97
|
-
sleep
|
|
98
|
-
} from "../index-eemvahkc.js";
|
|
99
103
|
import {
|
|
100
104
|
zodIssues2,
|
|
101
105
|
formatZodError2
|
|
@@ -110,15 +114,31 @@ import {
|
|
|
110
114
|
rateLimited2,
|
|
111
115
|
STITCH_ERROR_STATUS2,
|
|
112
116
|
isRetryableStatus2,
|
|
113
|
-
isStitchErrorCode2
|
|
114
|
-
|
|
115
|
-
} from "../index-0w0hxp7n.js";
|
|
117
|
+
isStitchErrorCode2
|
|
118
|
+
} from "../index-9pv126eh.js";
|
|
116
119
|
import {
|
|
117
120
|
createTraceContext2,
|
|
118
121
|
parseTraceparent2,
|
|
119
122
|
formatTraceparent2,
|
|
120
123
|
childSpan2
|
|
121
|
-
} from "../index-
|
|
124
|
+
} from "../index-y7sy1xdp.js";
|
|
125
|
+
import {
|
|
126
|
+
readBoundedBody2
|
|
127
|
+
} from "../index-xmr47znh.js";
|
|
128
|
+
import {
|
|
129
|
+
randomHex
|
|
130
|
+
} from "../index-c9d05kvt.js";
|
|
131
|
+
import {
|
|
132
|
+
scheduleAt,
|
|
133
|
+
sleep
|
|
134
|
+
} from "../index-mxt0wfjy.js";
|
|
135
|
+
import {
|
|
136
|
+
raceAbort,
|
|
137
|
+
withLinkedAbortSignals
|
|
138
|
+
} from "../index-rptj3qnc.js";
|
|
139
|
+
import {
|
|
140
|
+
abortError
|
|
141
|
+
} from "../index-wz392jyz.js";
|
|
122
142
|
// src/browser/contract-identity.ts
|
|
123
143
|
async function readContractIdentity(contracts, configOrClient) {
|
|
124
144
|
const client = contractFingerprint2(contracts);
|
|
@@ -205,7 +225,7 @@ function createSessionScope() {
|
|
|
205
225
|
};
|
|
206
226
|
const operation = {
|
|
207
227
|
context,
|
|
208
|
-
id:
|
|
228
|
+
id: randomHex(16),
|
|
209
229
|
generation: id,
|
|
210
230
|
signal: controller.signal,
|
|
211
231
|
current,
|
|
@@ -262,98 +282,644 @@ function createSessionScope() {
|
|
|
262
282
|
}
|
|
263
283
|
};
|
|
264
284
|
}
|
|
265
|
-
// src/browser/session-credentials.ts
|
|
266
|
-
function
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
285
|
+
// src/browser/session-credentials-storage.ts
|
|
286
|
+
async function withClockDeadline(work, timeoutMs, clock) {
|
|
287
|
+
let handle;
|
|
288
|
+
const expiry = new Promise((resolve) => {
|
|
289
|
+
handle = clock.schedule(() => resolve({ settled: false }), timeoutMs);
|
|
290
|
+
});
|
|
291
|
+
try {
|
|
292
|
+
return await Promise.race([
|
|
293
|
+
work.then(() => ({ settled: true })),
|
|
294
|
+
expiry
|
|
295
|
+
]);
|
|
296
|
+
} finally {
|
|
297
|
+
handle?.cancel();
|
|
278
298
|
}
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
299
|
+
}
|
|
300
|
+
function createCredentialPersistence(ports) {
|
|
301
|
+
const serialize = createMutationQueue(ports.capacity);
|
|
302
|
+
const bounded = async (work, wrote, operation) => {
|
|
303
|
+
const outcome = await withClockDeadline(work, ports.storageTimeout, ports.clock);
|
|
282
304
|
if (outcome.settled)
|
|
283
305
|
return;
|
|
284
306
|
work.then(() => {
|
|
285
|
-
|
|
286
|
-
|
|
307
|
+
const current = ports.getState();
|
|
308
|
+
if (operation && ports.scope.owns(operation) && current?.operation === operation && current.credentials === wrote) {
|
|
309
|
+
current.unstored = false;
|
|
310
|
+
ports.onConverged();
|
|
311
|
+
return;
|
|
312
|
+
}
|
|
313
|
+
if (operation !== undefined || current !== undefined) {
|
|
314
|
+
return rewriteStored().catch((error) => {
|
|
315
|
+
const latest = ports.getState();
|
|
316
|
+
if (latest && ports.scope.owns(latest.operation)) {
|
|
317
|
+
ports.onRewriteFailed(latest.operation, error);
|
|
318
|
+
}
|
|
319
|
+
});
|
|
320
|
+
}
|
|
287
321
|
}).catch(() => {
|
|
288
322
|
return;
|
|
289
323
|
});
|
|
290
324
|
throw new Error("Session storage did not answer within storageTimeoutMs");
|
|
291
325
|
};
|
|
292
|
-
const
|
|
293
|
-
const current =
|
|
294
|
-
if (
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
326
|
+
const rewriteStored = (onlyIfUnstoredFor) => serialize(async () => {
|
|
327
|
+
const current = ports.getState();
|
|
328
|
+
if (onlyIfUnstoredFor) {
|
|
329
|
+
if (!ports.scope.owns(onlyIfUnstoredFor) || current?.operation !== onlyIfUnstoredFor) {
|
|
330
|
+
throw new SessionExpiredError;
|
|
331
|
+
}
|
|
332
|
+
if (!current.unstored)
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
if (current && ports.scope.owns(current.operation)) {
|
|
336
|
+
const credentials = current.credentials;
|
|
337
|
+
await bounded(ports.storage.write(current.operation.context, credentials), credentials, current.operation);
|
|
338
|
+
if (ports.getState() === current && current.credentials === credentials) {
|
|
339
|
+
current.unstored = false;
|
|
340
|
+
ports.onConverged();
|
|
341
|
+
}
|
|
342
|
+
} else {
|
|
343
|
+
await bounded(ports.storage.clear(), undefined, undefined);
|
|
344
|
+
}
|
|
345
|
+
});
|
|
346
|
+
const readStored = (generationBefore) => serialize(async () => {
|
|
347
|
+
if (ports.scope.generation !== generationBefore)
|
|
348
|
+
return { status: "stale" };
|
|
349
|
+
let loaded = null;
|
|
350
|
+
try {
|
|
351
|
+
const work = Promise.resolve().then(() => ports.storage.read()).then((value) => {
|
|
352
|
+
loaded = value;
|
|
353
|
+
});
|
|
354
|
+
const outcome = await withClockDeadline(work, ports.storageTimeout, ports.clock);
|
|
355
|
+
if (!outcome.settled) {
|
|
356
|
+
return {
|
|
357
|
+
status: "unreadable",
|
|
358
|
+
error: new Error("Session storage did not answer within storageTimeoutMs")
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
} catch (error) {
|
|
362
|
+
return { status: "unreadable", error };
|
|
363
|
+
}
|
|
364
|
+
if (ports.scope.generation !== generationBefore)
|
|
365
|
+
return { status: "stale" };
|
|
366
|
+
return { status: "ok", value: loaded };
|
|
367
|
+
});
|
|
368
|
+
const write = (operation, credentials) => serialize(async () => {
|
|
369
|
+
const current = ports.getState();
|
|
370
|
+
if (!ports.scope.owns(operation) || current?.operation !== operation) {
|
|
371
|
+
throw new SessionExpiredError;
|
|
372
|
+
}
|
|
373
|
+
await bounded(ports.storage.write(operation.context, credentials), credentials, operation);
|
|
374
|
+
operation.assertCurrent();
|
|
298
375
|
});
|
|
376
|
+
const clearForGeneration = (generation) => serialize(async () => {
|
|
377
|
+
if (ports.scope.generation === generation) {
|
|
378
|
+
await bounded(ports.storage.clear(), undefined, undefined);
|
|
379
|
+
}
|
|
380
|
+
});
|
|
381
|
+
return { readStored, rewriteStored, write, clearForGeneration };
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
// src/browser/session-refresh-policy.ts
|
|
385
|
+
var DEFAULT_REFRESH_LEAD_MS = 60000;
|
|
386
|
+
var DEFAULT_REFRESH_COOLDOWN_MS = 30000;
|
|
387
|
+
var DEFAULT_REFRESH_TIMEOUT_MS = 30000;
|
|
388
|
+
var DEFAULT_STORAGE_RETRY_MS = 5000;
|
|
389
|
+
var DEFAULT_REFRESH_RETRY_POLICY = {
|
|
390
|
+
minDelayMs: 30000,
|
|
391
|
+
maxDelayMs: 300000,
|
|
392
|
+
jitter: 0.5
|
|
393
|
+
};
|
|
394
|
+
|
|
395
|
+
class SessionRefreshRejectedError extends Error {
|
|
396
|
+
constructor(options) {
|
|
397
|
+
super("Session refresh was rejected", options);
|
|
398
|
+
this.name = "SessionRefreshRejectedError";
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
function createDefaultSessionClock() {
|
|
402
|
+
return {
|
|
403
|
+
now: () => Date.now(),
|
|
404
|
+
monotonic: () => performance.now(),
|
|
405
|
+
schedule(run, delayMs) {
|
|
406
|
+
const handle = setTimeout(run, delayMs);
|
|
407
|
+
handle.unref?.();
|
|
408
|
+
return {
|
|
409
|
+
cancel() {
|
|
410
|
+
clearTimeout(handle);
|
|
411
|
+
}
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
};
|
|
415
|
+
}
|
|
416
|
+
function effectiveRefreshLeadMs(expiresAt, receivedAt, leadMs) {
|
|
417
|
+
const lifetime = Math.max(0, expiresAt - receivedAt);
|
|
418
|
+
return Math.min(leadMs, Math.floor(lifetime / 2));
|
|
419
|
+
}
|
|
420
|
+
function refreshDelayMs(expiresAt, receivedAt, now, leadMs = DEFAULT_REFRESH_LEAD_MS) {
|
|
421
|
+
const effectiveLead = receivedAt === undefined ? leadMs : effectiveRefreshLeadMs(expiresAt, receivedAt, leadMs);
|
|
422
|
+
return Math.max(0, expiresAt - now - effectiveLead);
|
|
423
|
+
}
|
|
424
|
+
function refreshDue(expiresAt, now, leadMs = DEFAULT_REFRESH_LEAD_MS, receivedAt) {
|
|
425
|
+
if (expiresAt === null || !Number.isFinite(expiresAt))
|
|
426
|
+
return false;
|
|
427
|
+
const effectiveLead = receivedAt === undefined ? leadMs : effectiveRefreshLeadMs(expiresAt, receivedAt, leadMs);
|
|
428
|
+
return expiresAt - now <= effectiveLead;
|
|
429
|
+
}
|
|
430
|
+
function defaultClassifyRefreshFailure(error) {
|
|
431
|
+
if (typeof error === "object" && error !== null && "status" in error) {
|
|
432
|
+
const { status } = error;
|
|
433
|
+
if (status === 401 || status === 403)
|
|
434
|
+
return "rejected";
|
|
435
|
+
}
|
|
436
|
+
return "unavailable";
|
|
437
|
+
}
|
|
438
|
+
function assertOptionInRange(name, value, min, max) {
|
|
439
|
+
if (!Number.isInteger(value) || value < min || value > max) {
|
|
440
|
+
throw new RangeError(`${name} must be between ${min} and ${max}`);
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
function parseSessionCredentialsOptions(config) {
|
|
444
|
+
const capacity = config.maxPendingWrites ?? 128;
|
|
445
|
+
assertOptionInRange("maxPendingWrites", capacity, 1, 65536);
|
|
446
|
+
const timeout = config.refreshTimeoutMs ?? DEFAULT_REFRESH_TIMEOUT_MS;
|
|
447
|
+
assertOptionInRange("refreshTimeoutMs", timeout, 1, 3600000);
|
|
448
|
+
const storageTimeout = config.storageTimeoutMs ?? 30000;
|
|
449
|
+
assertOptionInRange("storageTimeoutMs", storageTimeout, 1, 3600000);
|
|
450
|
+
const storageRetryMs = config.storageRetryMs ?? DEFAULT_STORAGE_RETRY_MS;
|
|
451
|
+
assertOptionInRange("storageRetryMs", storageRetryMs, 1, 3600000);
|
|
452
|
+
const leadMs = config.refreshAhead?.leadMs ?? DEFAULT_REFRESH_LEAD_MS;
|
|
453
|
+
assertOptionInRange("refreshAhead.leadMs", leadMs, 1, 86400000);
|
|
454
|
+
const cooldownMs = config.refreshAhead?.cooldownMs ?? DEFAULT_REFRESH_COOLDOWN_MS;
|
|
455
|
+
assertOptionInRange("refreshAhead.cooldownMs", cooldownMs, 1, 3600000);
|
|
456
|
+
return {
|
|
457
|
+
capacity,
|
|
458
|
+
timeout,
|
|
459
|
+
storageTimeout,
|
|
460
|
+
storageRetryMs,
|
|
461
|
+
leadMs,
|
|
462
|
+
cooldownMs,
|
|
463
|
+
backoff: createBackoff2(config.retry ?? DEFAULT_REFRESH_RETRY_POLICY),
|
|
464
|
+
clock: config.clock ?? createDefaultSessionClock(),
|
|
465
|
+
classify: config.classifyRefreshFailure ?? defaultClassifyRefreshFailure
|
|
466
|
+
};
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
// src/browser/session-refresh-timer.ts
|
|
470
|
+
var MIN_REFRESH_PAUSE_MS = 1000;
|
|
471
|
+
function createSessionRefreshTimer(config) {
|
|
472
|
+
const { scope, clock, leadMs, cooldownMs, storageRetryMs } = config;
|
|
473
|
+
let bound;
|
|
474
|
+
let detachAbort;
|
|
475
|
+
let lastFiredAt = null;
|
|
476
|
+
let refreshHandle;
|
|
477
|
+
let storageHandle;
|
|
478
|
+
const wall = {
|
|
479
|
+
now: () => clock.now(),
|
|
480
|
+
schedule: (run, delayMs) => clock.schedule(run, delayMs)
|
|
481
|
+
};
|
|
482
|
+
const monotonic = {
|
|
483
|
+
now: () => clock.monotonic(),
|
|
484
|
+
schedule: (run, delayMs) => clock.schedule(run, delayMs)
|
|
485
|
+
};
|
|
486
|
+
const cancelRefresh = () => {
|
|
487
|
+
refreshHandle?.cancel();
|
|
488
|
+
refreshHandle = undefined;
|
|
489
|
+
};
|
|
490
|
+
const cancelStorageRetry = () => {
|
|
491
|
+
storageHandle?.cancel();
|
|
492
|
+
storageHandle = undefined;
|
|
493
|
+
};
|
|
494
|
+
const cancelAll = () => {
|
|
495
|
+
cancelRefresh();
|
|
496
|
+
cancelStorageRetry();
|
|
497
|
+
};
|
|
498
|
+
const clear = () => {
|
|
499
|
+
cancelAll();
|
|
500
|
+
detachAbort?.();
|
|
501
|
+
detachAbort = undefined;
|
|
502
|
+
bound = undefined;
|
|
503
|
+
lastFiredAt = null;
|
|
504
|
+
};
|
|
505
|
+
const remainingCooldown = (expiresAt, receivedAt) => {
|
|
506
|
+
if (lastFiredAt === null)
|
|
507
|
+
return 0;
|
|
508
|
+
const halfLife = receivedAt === undefined ? 0 : (expiresAt - receivedAt) / 2;
|
|
509
|
+
const pause = halfLife >= MIN_REFRESH_PAUSE_MS ? Math.min(cooldownMs, halfLife) : cooldownMs;
|
|
510
|
+
return Math.max(0, lastFiredAt + pause - clock.monotonic());
|
|
511
|
+
};
|
|
512
|
+
const isOwned = (operation) => bound === operation && scope.owns(operation);
|
|
513
|
+
const scheduleProactiveStep = (operation, expiresAt, receivedAt) => {
|
|
514
|
+
cancelRefresh();
|
|
515
|
+
const delay = Math.max(refreshDelayMs(expiresAt, receivedAt, clock.now(), leadMs), remainingCooldown(expiresAt, receivedAt));
|
|
516
|
+
if (!isOwned(operation))
|
|
517
|
+
return;
|
|
518
|
+
refreshHandle = scheduleAt(wall, clock.now() + delay, () => {
|
|
519
|
+
refreshHandle = undefined;
|
|
520
|
+
if (!isOwned(operation))
|
|
521
|
+
return;
|
|
522
|
+
const remaining = Math.max(refreshDelayMs(expiresAt, receivedAt, clock.now(), leadMs), remainingCooldown(expiresAt, receivedAt));
|
|
523
|
+
if (!isOwned(operation))
|
|
524
|
+
return;
|
|
525
|
+
if (remaining > 0) {
|
|
526
|
+
scheduleProactiveStep(operation, expiresAt, receivedAt);
|
|
527
|
+
return;
|
|
528
|
+
}
|
|
529
|
+
lastFiredAt = clock.monotonic();
|
|
530
|
+
config.onRefreshDue(operation);
|
|
531
|
+
});
|
|
532
|
+
};
|
|
533
|
+
const scheduleRetryStep = (operation, targetMono) => {
|
|
534
|
+
cancelRefresh();
|
|
535
|
+
if (!isOwned(operation))
|
|
536
|
+
return;
|
|
537
|
+
refreshHandle = scheduleAt(monotonic, targetMono, () => {
|
|
538
|
+
refreshHandle = undefined;
|
|
539
|
+
if (!isOwned(operation))
|
|
540
|
+
return;
|
|
541
|
+
lastFiredAt = clock.monotonic();
|
|
542
|
+
config.onRefreshDue(operation);
|
|
543
|
+
});
|
|
544
|
+
};
|
|
545
|
+
return {
|
|
546
|
+
bind(operation) {
|
|
547
|
+
clear();
|
|
548
|
+
if (!scope.owns(operation))
|
|
549
|
+
return;
|
|
550
|
+
bound = operation;
|
|
551
|
+
const onAbort = () => {
|
|
552
|
+
if (bound === operation)
|
|
553
|
+
clear();
|
|
554
|
+
};
|
|
555
|
+
operation.signal.addEventListener("abort", onAbort, { once: true });
|
|
556
|
+
detachAbort = () => operation.signal.removeEventListener("abort", onAbort);
|
|
557
|
+
},
|
|
558
|
+
markFired(operation) {
|
|
559
|
+
if (bound === operation)
|
|
560
|
+
lastFiredAt = clock.monotonic();
|
|
561
|
+
},
|
|
562
|
+
cooldownPassed(operation, expiresAt, receivedAt) {
|
|
563
|
+
if (bound !== operation)
|
|
564
|
+
return false;
|
|
565
|
+
if (expiresAt !== undefined && expiresAt !== null && Number.isFinite(expiresAt)) {
|
|
566
|
+
return remainingCooldown(expiresAt, receivedAt) === 0;
|
|
567
|
+
}
|
|
568
|
+
return lastFiredAt === null || clock.monotonic() - lastFiredAt >= cooldownMs;
|
|
569
|
+
},
|
|
570
|
+
armRefresh(operation, expiresAt, receivedAt) {
|
|
571
|
+
cancelRefresh();
|
|
572
|
+
if (expiresAt === null || !Number.isFinite(expiresAt))
|
|
573
|
+
return;
|
|
574
|
+
if (!isOwned(operation))
|
|
575
|
+
return;
|
|
576
|
+
scheduleProactiveStep(operation, expiresAt, receivedAt);
|
|
577
|
+
},
|
|
578
|
+
armRetry(operation, delayMs) {
|
|
579
|
+
cancelRefresh();
|
|
580
|
+
if (!isOwned(operation))
|
|
581
|
+
return;
|
|
582
|
+
scheduleRetryStep(operation, clock.monotonic() + Math.max(0, delayMs));
|
|
583
|
+
},
|
|
584
|
+
cancelRefresh,
|
|
585
|
+
armStorageRetry(operation) {
|
|
586
|
+
cancelStorageRetry();
|
|
587
|
+
if (!isOwned(operation))
|
|
588
|
+
return;
|
|
589
|
+
storageHandle = scheduleAt(monotonic, clock.monotonic() + storageRetryMs, () => {
|
|
590
|
+
storageHandle = undefined;
|
|
591
|
+
if (!isOwned(operation))
|
|
592
|
+
return;
|
|
593
|
+
config.onStorageRetry(operation);
|
|
594
|
+
});
|
|
595
|
+
},
|
|
596
|
+
cancelStorageRetry,
|
|
597
|
+
clear
|
|
598
|
+
};
|
|
599
|
+
}
|
|
600
|
+
function runWithRefreshDeadline(operation, clock, timeoutMs, work) {
|
|
601
|
+
operation.assertCurrent();
|
|
602
|
+
const controller = new AbortController;
|
|
603
|
+
return withLinkedAbortSignals(operation.signal, controller.signal, (signal) => {
|
|
604
|
+
const timeoutHandle = clock.schedule(() => controller.abort(abortError("Refresh timed out", "TimeoutError")), timeoutMs);
|
|
605
|
+
let workPromise;
|
|
606
|
+
try {
|
|
607
|
+
workPromise = Promise.resolve(work(signal));
|
|
608
|
+
} catch (error) {
|
|
609
|
+
timeoutHandle.cancel();
|
|
610
|
+
return Promise.reject(error);
|
|
611
|
+
}
|
|
612
|
+
return raceAbort(workPromise, signal).finally(() => {
|
|
613
|
+
timeoutHandle.cancel();
|
|
614
|
+
});
|
|
615
|
+
});
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
// src/browser/session-credentials.ts
|
|
619
|
+
async function syncUnstoredCredentials(ctx, operation, mode) {
|
|
620
|
+
const current = ctx.getState();
|
|
621
|
+
if (!ctx.config.scope.owns(operation) || current?.operation !== operation || !current.unstored)
|
|
622
|
+
return;
|
|
623
|
+
if (mode === "flush")
|
|
624
|
+
ctx.timers.cancelStorageRetry();
|
|
625
|
+
const target = current.credentials;
|
|
626
|
+
try {
|
|
627
|
+
await ctx.persistence.rewriteStored(operation);
|
|
628
|
+
} catch (error) {
|
|
629
|
+
if (error instanceof SessionExpiredError) {
|
|
630
|
+
if (mode === "flush")
|
|
631
|
+
throw error;
|
|
632
|
+
return;
|
|
633
|
+
}
|
|
634
|
+
const latest = ctx.getState();
|
|
635
|
+
if (!ctx.config.scope.owns(operation) || latest?.operation !== operation) {
|
|
636
|
+
if (mode === "flush")
|
|
637
|
+
throw new SessionExpiredError({ cause: error });
|
|
638
|
+
return;
|
|
639
|
+
}
|
|
640
|
+
if (latest.credentials === target)
|
|
641
|
+
ctx.recordStorageFailure(operation, error);
|
|
642
|
+
if (mode === "flush")
|
|
643
|
+
throw error;
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
async function runRefreshPass(ctx, operation, markRotated) {
|
|
647
|
+
const { config, options, timers, persistence } = ctx;
|
|
648
|
+
const recordUnavailable = (credentials, error) => {
|
|
649
|
+
const expiresAt = ctx.readExpiresAt(credentials);
|
|
650
|
+
const current = ctx.getState();
|
|
651
|
+
const canRetry = config.refreshAhead !== undefined && expiresAt !== null && current?.operation === operation && !current.rejected;
|
|
652
|
+
const retryInMs = canRetry ? options.backoff.next() : null;
|
|
653
|
+
if (retryInMs !== null)
|
|
654
|
+
timers.armRetry(operation, retryInMs);
|
|
655
|
+
ctx.emit({ type: "refresh-unavailable", operation, error, retryInMs, expiresAt });
|
|
656
|
+
};
|
|
657
|
+
const initial = ctx.getState();
|
|
658
|
+
if (!config.scope.owns(operation) || initial?.operation !== operation) {
|
|
659
|
+
throw new SessionExpiredError;
|
|
660
|
+
}
|
|
661
|
+
if (initial.unstored) {
|
|
662
|
+
try {
|
|
663
|
+
await syncUnstoredCredentials(ctx, operation, "flush");
|
|
664
|
+
} catch (error) {
|
|
665
|
+
if (error instanceof SessionExpiredError)
|
|
666
|
+
throw error;
|
|
667
|
+
const latest = ctx.getState();
|
|
668
|
+
if (!config.scope.owns(operation) || latest?.operation !== operation) {
|
|
669
|
+
throw new SessionExpiredError({ cause: error });
|
|
670
|
+
}
|
|
671
|
+
recordUnavailable(latest.credentials, error);
|
|
672
|
+
throw error;
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
const credentials = ctx.read(operation);
|
|
676
|
+
operation.assertCurrent();
|
|
677
|
+
timers.markFired(operation);
|
|
678
|
+
let next;
|
|
679
|
+
try {
|
|
680
|
+
next = await runWithRefreshDeadline(operation, options.clock, options.timeout, (signal) => config.refresh(credentials, signal));
|
|
681
|
+
} catch (error) {
|
|
682
|
+
if (error instanceof SessionExpiredError)
|
|
683
|
+
throw error;
|
|
684
|
+
const latest = ctx.getState();
|
|
685
|
+
if (!config.scope.owns(operation) || latest?.operation !== operation) {
|
|
686
|
+
throw new SessionExpiredError({ cause: error });
|
|
687
|
+
}
|
|
688
|
+
if (options.classify(error) === "rejected") {
|
|
689
|
+
latest.rejected = true;
|
|
690
|
+
timers.cancelRefresh();
|
|
691
|
+
ctx.emit({ type: "refresh-rejected", operation, error });
|
|
692
|
+
throw new SessionRefreshRejectedError({ cause: error });
|
|
693
|
+
}
|
|
694
|
+
recordUnavailable(credentials, error);
|
|
695
|
+
throw error;
|
|
696
|
+
}
|
|
697
|
+
ctx.read(operation);
|
|
698
|
+
options.backoff.reset();
|
|
699
|
+
const receivedAt = options.clock.now();
|
|
700
|
+
const active = ctx.getState();
|
|
701
|
+
if (!active || active.operation !== operation)
|
|
702
|
+
throw new SessionExpiredError;
|
|
703
|
+
active.credentials = next;
|
|
704
|
+
active.receivedAt = receivedAt;
|
|
705
|
+
active.unstored = true;
|
|
706
|
+
active.rejected = false;
|
|
707
|
+
markRotated();
|
|
708
|
+
let storageFailure;
|
|
709
|
+
try {
|
|
710
|
+
await persistence.write(operation, next);
|
|
711
|
+
if (ctx.getState() === active && active.credentials === next) {
|
|
712
|
+
active.unstored = false;
|
|
713
|
+
timers.cancelStorageRetry();
|
|
714
|
+
}
|
|
715
|
+
} catch (error) {
|
|
716
|
+
if (error instanceof SessionExpiredError)
|
|
717
|
+
throw error;
|
|
718
|
+
if (!config.scope.owns(operation) || ctx.getState()?.operation !== operation) {
|
|
719
|
+
throw new SessionExpiredError({ cause: error });
|
|
720
|
+
}
|
|
721
|
+
active.unstored = true;
|
|
722
|
+
timers.armStorageRetry(operation);
|
|
723
|
+
storageFailure = { failed: true, error };
|
|
724
|
+
}
|
|
725
|
+
ctx.read(operation);
|
|
726
|
+
const expiresAt = ctx.readExpiresAt(next);
|
|
727
|
+
if (config.refreshAhead)
|
|
728
|
+
timers.armRefresh(operation, expiresAt, receivedAt);
|
|
729
|
+
if (storageFailure) {
|
|
730
|
+
ctx.emit({
|
|
731
|
+
type: "storage-failed",
|
|
732
|
+
operation,
|
|
733
|
+
error: storageFailure.error,
|
|
734
|
+
retryInMs: options.storageRetryMs
|
|
735
|
+
});
|
|
736
|
+
}
|
|
737
|
+
if (config.scope.owns(operation) && ctx.getState()?.operation === operation) {
|
|
738
|
+
ctx.emit({ type: "refreshed", operation, expiresAt });
|
|
739
|
+
}
|
|
740
|
+
return next;
|
|
741
|
+
}
|
|
742
|
+
async function writeLoginCredentials(ctx, operation, credentials, clearState) {
|
|
743
|
+
try {
|
|
744
|
+
await ctx.persistence.write(operation, credentials);
|
|
745
|
+
operation.assertCurrent();
|
|
746
|
+
} catch (error) {
|
|
747
|
+
const isSameOperation = ctx.getState()?.operation === operation;
|
|
748
|
+
if (isSameOperation && ctx.config.scope.owns(operation)) {
|
|
749
|
+
ctx.timers.clear();
|
|
750
|
+
clearState();
|
|
751
|
+
ctx.config.scope.clear();
|
|
752
|
+
await ctx.persistence.rewriteStored().catch((clearError) => {
|
|
753
|
+
throw new AggregateError([error, clearError], `Login failed (${messageOf(error)}) and the stored session could not be cleared`, { cause: error });
|
|
754
|
+
});
|
|
755
|
+
throw error;
|
|
756
|
+
}
|
|
757
|
+
if (isSameOperation)
|
|
758
|
+
clearState();
|
|
759
|
+
if (error instanceof SessionExpiredError)
|
|
760
|
+
throw error;
|
|
761
|
+
throw new SessionExpiredError({ cause: error });
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
function createSessionCredentials(config) {
|
|
765
|
+
const options = parseSessionCredentialsOptions(config);
|
|
766
|
+
const { storageTimeout, storageRetryMs, leadMs, cooldownMs, backoff, clock } = options;
|
|
767
|
+
let state;
|
|
299
768
|
let flight;
|
|
769
|
+
const emit = (event) => {
|
|
770
|
+
try {
|
|
771
|
+
config.onEvent?.(event);
|
|
772
|
+
} catch {}
|
|
773
|
+
};
|
|
774
|
+
const readExpiresAt = (credentials) => {
|
|
775
|
+
if (!config.refreshAhead)
|
|
776
|
+
return null;
|
|
777
|
+
const value = config.refreshAhead.expiresAt(credentials);
|
|
778
|
+
return value !== null && Number.isFinite(value) ? value : null;
|
|
779
|
+
};
|
|
300
780
|
const read = (operation) => {
|
|
301
781
|
if (!config.scope.owns(operation) || state?.operation !== operation)
|
|
302
782
|
throw new SessionExpiredError;
|
|
303
783
|
return state.credentials;
|
|
304
784
|
};
|
|
305
|
-
const
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
785
|
+
const recordStorageFailure = (operation, error) => {
|
|
786
|
+
if (!config.scope.owns(operation) || state?.operation !== operation)
|
|
787
|
+
return;
|
|
788
|
+
state.unstored = true;
|
|
789
|
+
timers.armStorageRetry(operation);
|
|
790
|
+
emit({ type: "storage-failed", operation, error, retryInMs: storageRetryMs });
|
|
791
|
+
};
|
|
792
|
+
const timers = createSessionRefreshTimer({
|
|
793
|
+
scope: config.scope,
|
|
794
|
+
clock,
|
|
795
|
+
leadMs,
|
|
796
|
+
cooldownMs,
|
|
797
|
+
storageRetryMs,
|
|
798
|
+
onRefreshDue(operation) {
|
|
799
|
+
if (!config.scope.owns(operation) || state?.operation !== operation || state.rejected)
|
|
800
|
+
return;
|
|
801
|
+
refresh(operation).catch(() => {
|
|
802
|
+
return;
|
|
803
|
+
});
|
|
804
|
+
},
|
|
805
|
+
onStorageRetry(operation) {
|
|
806
|
+
syncUnstoredCredentials(executionContext, operation, "retry").catch(() => {
|
|
807
|
+
return;
|
|
808
|
+
});
|
|
809
|
+
}
|
|
810
|
+
});
|
|
811
|
+
const persistence = createCredentialPersistence({
|
|
812
|
+
scope: config.scope,
|
|
813
|
+
storage: config.storage,
|
|
814
|
+
clock,
|
|
815
|
+
capacity: options.capacity,
|
|
816
|
+
storageTimeout,
|
|
817
|
+
getState: () => state,
|
|
818
|
+
onConverged: () => timers.cancelStorageRetry(),
|
|
819
|
+
onRewriteFailed: recordStorageFailure
|
|
309
820
|
});
|
|
821
|
+
const executionContext = {
|
|
822
|
+
config,
|
|
823
|
+
options,
|
|
824
|
+
timers,
|
|
825
|
+
persistence,
|
|
826
|
+
getState: () => state,
|
|
827
|
+
read,
|
|
828
|
+
readExpiresAt,
|
|
829
|
+
emit,
|
|
830
|
+
recordStorageFailure
|
|
831
|
+
};
|
|
832
|
+
const refresh = (operation, refreshOptions) => {
|
|
833
|
+
const credentials = read(operation);
|
|
834
|
+
if (refreshOptions?.rejected !== undefined && refreshOptions.rejected !== credentials) {
|
|
835
|
+
return Promise.resolve(credentials);
|
|
836
|
+
}
|
|
837
|
+
if (flight?.operation === operation) {
|
|
838
|
+
if (refreshOptions?.rejected !== undefined && flight.rotated && refreshOptions.rejected === credentials) {
|
|
839
|
+
const pending = flight.result;
|
|
840
|
+
return pending.then(() => refresh(operation, refreshOptions), () => refresh(operation, refreshOptions));
|
|
841
|
+
}
|
|
842
|
+
return flight.result;
|
|
843
|
+
}
|
|
844
|
+
const activeFlight = {
|
|
845
|
+
operation,
|
|
846
|
+
rotated: false,
|
|
847
|
+
result: Promise.resolve(credentials)
|
|
848
|
+
};
|
|
849
|
+
const result = operation.run(() => runRefreshPass(executionContext, operation, () => {
|
|
850
|
+
activeFlight.rotated = true;
|
|
851
|
+
})).finally(() => {
|
|
852
|
+
if (flight?.result === result)
|
|
853
|
+
flight = undefined;
|
|
854
|
+
});
|
|
855
|
+
activeFlight.result = result;
|
|
856
|
+
flight = activeFlight;
|
|
857
|
+
return result;
|
|
858
|
+
};
|
|
859
|
+
const activateGeneration = (operation, credentials, receivedAt) => {
|
|
860
|
+
backoff.reset();
|
|
861
|
+
timers.bind(operation);
|
|
862
|
+
if (config.refreshAhead)
|
|
863
|
+
timers.armRefresh(operation, readExpiresAt(credentials), receivedAt);
|
|
864
|
+
};
|
|
310
865
|
return {
|
|
311
866
|
async login(session, credentials) {
|
|
312
867
|
const operation = config.scope.replace(session);
|
|
313
868
|
operation.assertCurrent();
|
|
314
|
-
|
|
315
|
-
|
|
869
|
+
const receivedAt = clock.now();
|
|
870
|
+
state = { operation, credentials, receivedAt, unstored: false, rejected: false };
|
|
871
|
+
await writeLoginCredentials(executionContext, operation, credentials, () => {
|
|
872
|
+
state = undefined;
|
|
873
|
+
});
|
|
874
|
+
activateGeneration(operation, credentials, receivedAt);
|
|
316
875
|
return operation;
|
|
317
876
|
},
|
|
318
877
|
logout() {
|
|
878
|
+
timers.clear();
|
|
319
879
|
config.scope.clear();
|
|
320
880
|
state = undefined;
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
881
|
+
return persistence.clearForGeneration(config.scope.generation);
|
|
882
|
+
},
|
|
883
|
+
async restore() {
|
|
884
|
+
const generationBefore = config.scope.generation;
|
|
885
|
+
const outcome = await persistence.readStored(generationBefore);
|
|
886
|
+
if (outcome.status === "stale")
|
|
887
|
+
throw new SessionExpiredError;
|
|
888
|
+
if (outcome.status === "unreadable")
|
|
889
|
+
return { status: "unreadable", error: outcome.error };
|
|
890
|
+
if (outcome.value === null)
|
|
891
|
+
return { status: "absent" };
|
|
892
|
+
if (config.scope.generation !== generationBefore)
|
|
893
|
+
throw new SessionExpiredError;
|
|
894
|
+
const { session, credentials } = outcome.value;
|
|
895
|
+
const operation = config.scope.replace(session);
|
|
896
|
+
operation.assertCurrent();
|
|
897
|
+
state = {
|
|
898
|
+
operation,
|
|
899
|
+
credentials,
|
|
900
|
+
receivedAt: undefined,
|
|
901
|
+
unstored: false,
|
|
902
|
+
rejected: false
|
|
903
|
+
};
|
|
904
|
+
activateGeneration(operation, credentials, undefined);
|
|
905
|
+
return { status: "present", operation };
|
|
326
906
|
},
|
|
327
907
|
read,
|
|
328
|
-
refresh
|
|
908
|
+
refresh,
|
|
909
|
+
async refreshIfDue(operation) {
|
|
329
910
|
const credentials = read(operation);
|
|
911
|
+
const current = state;
|
|
912
|
+
if (!config.refreshAhead || !current || current.operation !== operation || current.rejected) {
|
|
913
|
+
return;
|
|
914
|
+
}
|
|
915
|
+
const expiresAt = readExpiresAt(credentials);
|
|
916
|
+
if (!refreshDue(expiresAt, clock.now(), leadMs, current.receivedAt))
|
|
917
|
+
return;
|
|
330
918
|
if (flight?.operation === operation)
|
|
331
919
|
return flight.result;
|
|
332
|
-
|
|
333
|
-
const signal = AbortSignal.any([operation.signal, controller.signal]);
|
|
334
|
-
const timer = setTimeout(() => controller.abort(new DOMException("Refresh timed out", "TimeoutError")), timeout);
|
|
335
|
-
let onAbort = () => {
|
|
920
|
+
if (!timers.cooldownPassed(operation, expiresAt, current.receivedAt))
|
|
336
921
|
return;
|
|
337
|
-
|
|
338
|
-
const abortPromise = new Promise((_, reject) => {
|
|
339
|
-
onAbort = () => reject(signal.reason);
|
|
340
|
-
signal.addEventListener("abort", onAbort, { once: true });
|
|
341
|
-
});
|
|
342
|
-
const result = operation.run(async () => {
|
|
343
|
-
const next = await Promise.race([config.refresh(credentials, signal), abortPromise]);
|
|
344
|
-
read(operation);
|
|
345
|
-
state = { operation, credentials: next };
|
|
346
|
-
await write(operation, next);
|
|
347
|
-
read(operation);
|
|
348
|
-
return next;
|
|
349
|
-
}).finally(() => {
|
|
350
|
-
clearTimeout(timer);
|
|
351
|
-
signal.removeEventListener("abort", onAbort);
|
|
352
|
-
if (flight?.result === result)
|
|
353
|
-
flight = undefined;
|
|
354
|
-
});
|
|
355
|
-
flight = { operation, result };
|
|
356
|
-
return result;
|
|
922
|
+
return refresh(operation);
|
|
357
923
|
}
|
|
358
924
|
};
|
|
359
925
|
}
|
|
@@ -385,11 +951,14 @@ export {
|
|
|
385
951
|
ContractFingerprintSchema2 as ContractFingerprintSchema,
|
|
386
952
|
ContractStreamFrameSchema2 as ContractStreamFrameSchema,
|
|
387
953
|
DEFAULT_CONTRACT_STREAM_FRAME_BYTES2 as DEFAULT_CONTRACT_STREAM_FRAME_BYTES,
|
|
954
|
+
DEFAULT_REPEAT_MAX_KINDS2 as DEFAULT_REPEAT_MAX_KINDS,
|
|
955
|
+
DEFAULT_REPEAT_WINDOW_MS2 as DEFAULT_REPEAT_WINDOW_MS,
|
|
388
956
|
LiveStateControllerStatusSchema2 as LiveStateControllerStatusSchema,
|
|
389
957
|
LiveStatePhaseSchema2 as LiveStatePhaseSchema,
|
|
390
958
|
LiveStateStopReasonSchema2 as LiveStateStopReasonSchema,
|
|
391
959
|
ManagedFilePathSchema2 as ManagedFilePathSchema,
|
|
392
960
|
ManagedFileRefSchema2 as ManagedFileRefSchema,
|
|
961
|
+
OperationEffectSchema2 as OperationEffectSchema,
|
|
393
962
|
REALTIME_REJECTION_KEY2 as REALTIME_REJECTION_KEY,
|
|
394
963
|
RealtimeRequestDisconnectedError2 as RealtimeRequestDisconnectedError,
|
|
395
964
|
RealtimeRequestInvalidAcknowledgementError2 as RealtimeRequestInvalidAcknowledgementError,
|
|
@@ -399,10 +968,10 @@ export {
|
|
|
399
968
|
RealtimeRequestTimeoutError2 as RealtimeRequestTimeoutError,
|
|
400
969
|
STITCH_ERROR_STATUS2 as STITCH_ERROR_STATUS,
|
|
401
970
|
SessionExpiredError,
|
|
971
|
+
SessionRefreshRejectedError,
|
|
402
972
|
StreamLineLimitError2 as StreamLineLimitError,
|
|
403
973
|
StreamTruncatedLineError2 as StreamTruncatedLineError,
|
|
404
974
|
TOOL_TRANSPORTS2 as TOOL_TRANSPORTS,
|
|
405
|
-
appError2 as appError,
|
|
406
975
|
asRealtimeRejection2 as asRealtimeRejection,
|
|
407
976
|
badRequest2 as badRequest,
|
|
408
977
|
bindRealtimeClient2 as bindRealtimeClient,
|
|
@@ -411,6 +980,7 @@ export {
|
|
|
411
980
|
contractEndpointMatchers2 as contractEndpointMatchers,
|
|
412
981
|
contractFingerprint2 as contractFingerprint,
|
|
413
982
|
contractIdentityContract2 as contractIdentityContract,
|
|
983
|
+
contractOperationEffects2 as contractOperationEffects,
|
|
414
984
|
createBackoff2 as createBackoff,
|
|
415
985
|
createClient2 as createClient,
|
|
416
986
|
createClients2 as createClients,
|
|
@@ -429,6 +999,7 @@ export {
|
|
|
429
999
|
createUrlBuilder2 as createUrlBuilder,
|
|
430
1000
|
createUrlBuilders2 as createUrlBuilders,
|
|
431
1001
|
decodeCursor2 as decodeCursor,
|
|
1002
|
+
defaultClassifyRefreshFailure,
|
|
432
1003
|
defineContract2 as defineContract,
|
|
433
1004
|
defineErrors2 as defineErrors,
|
|
434
1005
|
defineRealtimeContract2 as defineRealtimeContract,
|
|
@@ -446,6 +1017,8 @@ export {
|
|
|
446
1017
|
rateLimited2 as rateLimited,
|
|
447
1018
|
readBoundedBody2 as readBoundedBody,
|
|
448
1019
|
readContractIdentity,
|
|
1020
|
+
repeatLimited2 as repeatLimited,
|
|
1021
|
+
requireContractOperationEffects2 as requireContractOperationEffects,
|
|
449
1022
|
resumableIterator,
|
|
450
1023
|
unauthorized2 as unauthorized,
|
|
451
1024
|
uploadInChunks2 as uploadInChunks,
|