@microvac/adapter-utils 0.0.0-stage → 0.1.0-rc.15
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/README.md +69 -2
- package/dist/acpx-engine/accounting-model.d.ts +7 -0
- package/dist/acpx-engine/accounting-model.d.ts.map +1 -0
- package/dist/acpx-engine/accounting-model.js +12 -0
- package/dist/acpx-engine/accounting-model.js.map +1 -0
- package/dist/acpx-engine/accounting-model.test.d.ts +2 -0
- package/dist/acpx-engine/accounting-model.test.d.ts.map +1 -0
- package/dist/acpx-engine/accounting-model.test.js +28 -0
- package/dist/acpx-engine/accounting-model.test.js.map +1 -0
- package/dist/acpx-engine/cli.d.ts +2 -0
- package/dist/acpx-engine/cli.d.ts.map +1 -0
- package/dist/acpx-engine/cli.js +128 -0
- package/dist/acpx-engine/cli.js.map +1 -0
- package/dist/acpx-engine/constants.d.ts +28 -0
- package/dist/acpx-engine/constants.d.ts.map +1 -0
- package/dist/acpx-engine/constants.js +74 -0
- package/dist/acpx-engine/constants.js.map +1 -0
- package/dist/acpx-engine/ephemeral-session-environment.d.ts +4 -0
- package/dist/acpx-engine/ephemeral-session-environment.d.ts.map +1 -0
- package/dist/acpx-engine/ephemeral-session-environment.js +45 -0
- package/dist/acpx-engine/ephemeral-session-environment.js.map +1 -0
- package/dist/acpx-engine/ephemeral-session-environment.test.d.ts +2 -0
- package/dist/acpx-engine/ephemeral-session-environment.test.d.ts.map +1 -0
- package/dist/acpx-engine/ephemeral-session-environment.test.js +219 -0
- package/dist/acpx-engine/ephemeral-session-environment.test.js.map +1 -0
- package/dist/acpx-engine/execute-identity.test.d.ts +2 -0
- package/dist/acpx-engine/execute-identity.test.d.ts.map +1 -0
- package/dist/acpx-engine/execute-identity.test.js +218 -0
- package/dist/acpx-engine/execute-identity.test.js.map +1 -0
- package/dist/acpx-engine/execute.d.ts +366 -0
- package/dist/acpx-engine/execute.d.ts.map +1 -0
- package/dist/acpx-engine/execute.js +5021 -0
- package/dist/acpx-engine/execute.js.map +1 -0
- package/dist/acpx-engine/execute.test.d.ts +2 -0
- package/dist/acpx-engine/execute.test.d.ts.map +1 -0
- package/dist/acpx-engine/execute.test.js +8269 -0
- package/dist/acpx-engine/execute.test.js.map +1 -0
- package/dist/acpx-engine/filesystem-protocol.test.d.ts +2 -0
- package/dist/acpx-engine/filesystem-protocol.test.d.ts.map +1 -0
- package/dist/acpx-engine/filesystem-protocol.test.js +96 -0
- package/dist/acpx-engine/filesystem-protocol.test.js.map +1 -0
- package/dist/acpx-engine/index.d.ts +6 -0
- package/dist/acpx-engine/index.d.ts.map +1 -0
- package/dist/acpx-engine/index.js +6 -0
- package/dist/acpx-engine/index.js.map +1 -0
- package/dist/acpx-engine/local-process-control.d.ts +5 -0
- package/dist/acpx-engine/local-process-control.d.ts.map +1 -0
- package/dist/acpx-engine/local-process-control.js +39 -0
- package/dist/acpx-engine/local-process-control.js.map +1 -0
- package/dist/acpx-engine/local-process-control.test.d.ts +2 -0
- package/dist/acpx-engine/local-process-control.test.d.ts.map +1 -0
- package/dist/acpx-engine/local-process-control.test.js +38 -0
- package/dist/acpx-engine/local-process-control.test.js.map +1 -0
- package/dist/acpx-engine/operator-stop.test.d.ts +2 -0
- package/dist/acpx-engine/operator-stop.test.d.ts.map +1 -0
- package/dist/acpx-engine/operator-stop.test.js +107 -0
- package/dist/acpx-engine/operator-stop.test.js.map +1 -0
- package/dist/acpx-engine/remote-spawn-smoke.test.d.ts +2 -0
- package/dist/acpx-engine/remote-spawn-smoke.test.d.ts.map +1 -0
- package/dist/acpx-engine/remote-spawn-smoke.test.js +152 -0
- package/dist/acpx-engine/remote-spawn-smoke.test.js.map +1 -0
- package/dist/acpx-engine/run-contracts.d.ts +414 -0
- package/dist/acpx-engine/run-contracts.d.ts.map +1 -0
- package/dist/acpx-engine/run-contracts.js +20 -0
- package/dist/acpx-engine/run-contracts.js.map +1 -0
- package/dist/acpx-engine/run-contracts.test.d.ts +2 -0
- package/dist/acpx-engine/run-contracts.test.d.ts.map +1 -0
- package/dist/acpx-engine/run-contracts.test.js +57 -0
- package/dist/acpx-engine/run-contracts.test.js.map +1 -0
- package/dist/acpx-engine/run-coordinator.d.ts +57 -0
- package/dist/acpx-engine/run-coordinator.d.ts.map +1 -0
- package/dist/acpx-engine/run-coordinator.js +63 -0
- package/dist/acpx-engine/run-coordinator.js.map +1 -0
- package/dist/acpx-engine/run-coordinator.test.d.ts +2 -0
- package/dist/acpx-engine/run-coordinator.test.d.ts.map +1 -0
- package/dist/acpx-engine/run-coordinator.test.js +160 -0
- package/dist/acpx-engine/run-coordinator.test.js.map +1 -0
- package/dist/acpx-engine/run-fault-matrix.test.d.ts +2 -0
- package/dist/acpx-engine/run-fault-matrix.test.d.ts.map +1 -0
- package/dist/acpx-engine/run-fault-matrix.test.js +877 -0
- package/dist/acpx-engine/run-fault-matrix.test.js.map +1 -0
- package/dist/acpx-engine/run-resource-ledger.d.ts +30 -0
- package/dist/acpx-engine/run-resource-ledger.d.ts.map +1 -0
- package/dist/acpx-engine/run-resource-ledger.js +148 -0
- package/dist/acpx-engine/run-resource-ledger.js.map +1 -0
- package/dist/acpx-engine/run-resource-ledger.test.d.ts +2 -0
- package/dist/acpx-engine/run-resource-ledger.test.d.ts.map +1 -0
- package/dist/acpx-engine/run-resource-ledger.test.js +154 -0
- package/dist/acpx-engine/run-resource-ledger.test.js.map +1 -0
- package/dist/acpx-engine/run-site-host.d.ts +78 -0
- package/dist/acpx-engine/run-site-host.d.ts.map +1 -0
- package/dist/acpx-engine/run-site-host.js +65 -0
- package/dist/acpx-engine/run-site-host.js.map +1 -0
- package/dist/acpx-engine/run-site-host.test.d.ts +2 -0
- package/dist/acpx-engine/run-site-host.test.d.ts.map +1 -0
- package/dist/acpx-engine/run-site-host.test.js +98 -0
- package/dist/acpx-engine/run-site-host.test.js.map +1 -0
- package/dist/acpx-engine/run-site-sandbox.d.ts +155 -0
- package/dist/acpx-engine/run-site-sandbox.d.ts.map +1 -0
- package/dist/acpx-engine/run-site-sandbox.js +285 -0
- package/dist/acpx-engine/run-site-sandbox.js.map +1 -0
- package/dist/acpx-engine/run-site-sandbox.test.d.ts +2 -0
- package/dist/acpx-engine/run-site-sandbox.test.d.ts.map +1 -0
- package/dist/acpx-engine/run-site-sandbox.test.js +307 -0
- package/dist/acpx-engine/run-site-sandbox.test.js.map +1 -0
- package/dist/acpx-engine/session-codec.d.ts +3 -0
- package/dist/acpx-engine/session-codec.d.ts.map +1 -0
- package/dist/acpx-engine/session-codec.js +50 -0
- package/dist/acpx-engine/session-codec.js.map +1 -0
- package/dist/acpx-engine/session-reuse-store.d.ts +62 -0
- package/dist/acpx-engine/session-reuse-store.d.ts.map +1 -0
- package/dist/acpx-engine/session-reuse-store.js +134 -0
- package/dist/acpx-engine/session-reuse-store.js.map +1 -0
- package/dist/acpx-engine/session-reuse-store.test.d.ts +2 -0
- package/dist/acpx-engine/session-reuse-store.test.d.ts.map +1 -0
- package/dist/acpx-engine/session-reuse-store.test.js +134 -0
- package/dist/acpx-engine/session-reuse-store.test.js.map +1 -0
- package/dist/acpx-engine/settlement-sequence.d.ts +77 -0
- package/dist/acpx-engine/settlement-sequence.d.ts.map +1 -0
- package/dist/acpx-engine/settlement-sequence.js +119 -0
- package/dist/acpx-engine/settlement-sequence.js.map +1 -0
- package/dist/acpx-engine/settlement-sequence.test.d.ts +2 -0
- package/dist/acpx-engine/settlement-sequence.test.d.ts.map +1 -0
- package/dist/acpx-engine/settlement-sequence.test.js +272 -0
- package/dist/acpx-engine/settlement-sequence.test.js.map +1 -0
- package/dist/acpx-engine/spawn-smoke.test.d.ts +2 -0
- package/dist/acpx-engine/spawn-smoke.test.d.ts.map +1 -0
- package/dist/acpx-engine/spawn-smoke.test.js +193 -0
- package/dist/acpx-engine/spawn-smoke.test.js.map +1 -0
- package/dist/acpx-engine/startup-cancellation.d.ts +9 -0
- package/dist/acpx-engine/startup-cancellation.d.ts.map +1 -0
- package/dist/acpx-engine/startup-cancellation.js +97 -0
- package/dist/acpx-engine/startup-cancellation.js.map +1 -0
- package/dist/acpx-engine/startup-cancellation.test.d.ts +2 -0
- package/dist/acpx-engine/startup-cancellation.test.d.ts.map +1 -0
- package/dist/acpx-engine/startup-cancellation.test.js +115 -0
- package/dist/acpx-engine/startup-cancellation.test.js.map +1 -0
- package/dist/acpx-engine/startup-timing.d.ts +433 -0
- package/dist/acpx-engine/startup-timing.d.ts.map +1 -0
- package/dist/acpx-engine/startup-timing.js +631 -0
- package/dist/acpx-engine/startup-timing.js.map +1 -0
- package/dist/acpx-engine/startup-timing.test.d.ts +2 -0
- package/dist/acpx-engine/startup-timing.test.d.ts.map +1 -0
- package/dist/acpx-engine/startup-timing.test.js +619 -0
- package/dist/acpx-engine/startup-timing.test.js.map +1 -0
- package/dist/acpx-engine/stock-runtime-options.d.ts +37 -0
- package/dist/acpx-engine/stock-runtime-options.d.ts.map +1 -0
- package/dist/acpx-engine/stock-runtime-options.js +101 -0
- package/dist/acpx-engine/stock-runtime-options.js.map +1 -0
- package/dist/acpx-engine/stock-runtime-options.test.d.ts +2 -0
- package/dist/acpx-engine/stock-runtime-options.test.d.ts.map +1 -0
- package/dist/acpx-engine/stock-runtime-options.test.js +91 -0
- package/dist/acpx-engine/stock-runtime-options.test.js.map +1 -0
- package/dist/acpx-engine/terminal-session-failure.d.ts +48 -0
- package/dist/acpx-engine/terminal-session-failure.d.ts.map +1 -0
- package/dist/acpx-engine/terminal-session-failure.js +123 -0
- package/dist/acpx-engine/terminal-session-failure.js.map +1 -0
- package/dist/acpx-engine/terminal-session-failure.test.d.ts +2 -0
- package/dist/acpx-engine/terminal-session-failure.test.d.ts.map +1 -0
- package/dist/acpx-engine/terminal-session-failure.test.js +150 -0
- package/dist/acpx-engine/terminal-session-failure.test.js.map +1 -0
- package/dist/acpx-engine/turn-sequence.d.ts +54 -0
- package/dist/acpx-engine/turn-sequence.d.ts.map +1 -0
- package/dist/acpx-engine/turn-sequence.js +75 -0
- package/dist/acpx-engine/turn-sequence.js.map +1 -0
- package/dist/acpx-engine/turn-sequence.test.d.ts +2 -0
- package/dist/acpx-engine/turn-sequence.test.d.ts.map +1 -0
- package/dist/acpx-engine/turn-sequence.test.js +177 -0
- package/dist/acpx-engine/turn-sequence.test.js.map +1 -0
- package/dist/acpx-engine/ui.d.ts +3 -0
- package/dist/acpx-engine/ui.d.ts.map +1 -0
- package/dist/acpx-engine/ui.js +162 -0
- package/dist/acpx-engine/ui.js.map +1 -0
- package/dist/agent-observability.d.ts +25 -0
- package/dist/agent-observability.d.ts.map +1 -0
- package/dist/agent-observability.js +92 -0
- package/dist/agent-observability.js.map +1 -0
- package/dist/agent-observability.test.d.ts +2 -0
- package/dist/agent-observability.test.d.ts.map +1 -0
- package/dist/agent-observability.test.js +127 -0
- package/dist/agent-observability.test.js.map +1 -0
- package/dist/api-billing-type.d.ts +5 -0
- package/dist/api-billing-type.d.ts.map +1 -0
- package/dist/api-billing-type.js +16 -0
- package/dist/api-billing-type.js.map +1 -0
- package/dist/api-billing-type.test.d.ts +2 -0
- package/dist/api-billing-type.test.d.ts.map +1 -0
- package/dist/api-billing-type.test.js +20 -0
- package/dist/api-billing-type.test.js.map +1 -0
- package/dist/billing.d.ts +9 -0
- package/dist/billing.d.ts.map +1 -0
- package/dist/billing.js +39 -0
- package/dist/billing.js.map +1 -0
- package/dist/billing.test.d.ts +2 -0
- package/dist/billing.test.d.ts.map +1 -0
- package/dist/billing.test.js +30 -0
- package/dist/billing.test.js.map +1 -0
- package/dist/bridge-transport-contract.d.ts +43 -0
- package/dist/bridge-transport-contract.d.ts.map +1 -0
- package/dist/bridge-transport-contract.js +33 -0
- package/dist/bridge-transport-contract.js.map +1 -0
- package/dist/chat-file-delivery.d.ts +10 -0
- package/dist/chat-file-delivery.d.ts.map +1 -0
- package/dist/chat-file-delivery.js +39 -0
- package/dist/chat-file-delivery.js.map +1 -0
- package/dist/chat-file-delivery.test.d.ts +2 -0
- package/dist/chat-file-delivery.test.d.ts.map +1 -0
- package/dist/chat-file-delivery.test.js +92 -0
- package/dist/chat-file-delivery.test.js.map +1 -0
- package/dist/codex-observability-home.d.ts +7 -0
- package/dist/codex-observability-home.d.ts.map +1 -0
- package/dist/codex-observability-home.js +75 -0
- package/dist/codex-observability-home.js.map +1 -0
- package/dist/codex-observability-profile.d.ts +16 -0
- package/dist/codex-observability-profile.d.ts.map +1 -0
- package/dist/codex-observability-profile.js +51 -0
- package/dist/codex-observability-profile.js.map +1 -0
- package/dist/codex-shell-environment.d.ts +6 -0
- package/dist/codex-shell-environment.d.ts.map +1 -0
- package/dist/codex-shell-environment.js +32 -0
- package/dist/codex-shell-environment.js.map +1 -0
- package/dist/codex-shell-environment.test.d.ts +2 -0
- package/dist/codex-shell-environment.test.d.ts.map +1 -0
- package/dist/codex-shell-environment.test.js +49 -0
- package/dist/codex-shell-environment.test.js.map +1 -0
- package/dist/command-managed-runtime.d.ts +178 -0
- package/dist/command-managed-runtime.d.ts.map +1 -0
- package/dist/command-managed-runtime.js +486 -0
- package/dist/command-managed-runtime.js.map +1 -0
- package/dist/command-managed-runtime.test.d.ts +2 -0
- package/dist/command-managed-runtime.test.d.ts.map +1 -0
- package/dist/command-managed-runtime.test.js +900 -0
- package/dist/command-managed-runtime.test.js.map +1 -0
- package/dist/command-redaction.d.ts +32 -0
- package/dist/command-redaction.d.ts.map +1 -0
- package/dist/command-redaction.js +280 -0
- package/dist/command-redaction.js.map +1 -0
- package/dist/command-redaction.test.d.ts +2 -0
- package/dist/command-redaction.test.d.ts.map +1 -0
- package/dist/command-redaction.test.js +297 -0
- package/dist/command-redaction.test.js.map +1 -0
- package/dist/connection-failure.d.ts +33 -0
- package/dist/connection-failure.d.ts.map +1 -0
- package/dist/connection-failure.js +43 -0
- package/dist/connection-failure.js.map +1 -0
- package/dist/connection-failure.test.d.ts +2 -0
- package/dist/connection-failure.test.d.ts.map +1 -0
- package/dist/connection-failure.test.js +94 -0
- package/dist/connection-failure.test.js.map +1 -0
- package/dist/directory-merge-lock-diagnostics.d.ts +24 -0
- package/dist/directory-merge-lock-diagnostics.d.ts.map +1 -0
- package/dist/directory-merge-lock-diagnostics.js +54 -0
- package/dist/directory-merge-lock-diagnostics.js.map +1 -0
- package/dist/directory-merge-lock-diagnostics.test.d.ts +2 -0
- package/dist/directory-merge-lock-diagnostics.test.d.ts.map +1 -0
- package/dist/directory-merge-lock-diagnostics.test.js +44 -0
- package/dist/directory-merge-lock-diagnostics.test.js.map +1 -0
- package/dist/directory-merge-lock.test.d.ts +2 -0
- package/dist/directory-merge-lock.test.d.ts.map +1 -0
- package/dist/directory-merge-lock.test.js +168 -0
- package/dist/directory-merge-lock.test.js.map +1 -0
- package/dist/duplex-frame-codec.d.ts +124 -0
- package/dist/duplex-frame-codec.d.ts.map +1 -0
- package/dist/duplex-frame-codec.js +134 -0
- package/dist/duplex-frame-codec.js.map +1 -0
- package/dist/duplex-frame-codec.test.d.ts +2 -0
- package/dist/duplex-frame-codec.test.d.ts.map +1 -0
- package/dist/duplex-frame-codec.test.js +172 -0
- package/dist/duplex-frame-codec.test.js.map +1 -0
- package/dist/duplex-observability.d.ts +220 -0
- package/dist/duplex-observability.d.ts.map +1 -0
- package/dist/duplex-observability.js +248 -0
- package/dist/duplex-observability.js.map +1 -0
- package/dist/duplex-observability.test.d.ts +2 -0
- package/dist/duplex-observability.test.d.ts.map +1 -0
- package/dist/duplex-observability.test.js +55 -0
- package/dist/duplex-observability.test.js.map +1 -0
- package/dist/env-bindings.d.ts +17 -0
- package/dist/env-bindings.d.ts.map +1 -0
- package/dist/env-bindings.js +98 -0
- package/dist/env-bindings.js.map +1 -0
- package/dist/env-bindings.test.d.ts +2 -0
- package/dist/env-bindings.test.d.ts.map +1 -0
- package/dist/env-bindings.test.js +66 -0
- package/dist/env-bindings.test.js.map +1 -0
- package/dist/exclude-patterns.d.ts +13 -0
- package/dist/exclude-patterns.d.ts.map +1 -0
- package/dist/exclude-patterns.js +37 -0
- package/dist/exclude-patterns.js.map +1 -0
- package/dist/execution-phase.d.ts +10 -0
- package/dist/execution-phase.d.ts.map +1 -0
- package/dist/execution-phase.js +27 -0
- package/dist/execution-phase.js.map +1 -0
- package/dist/execution-phase.test.d.ts +2 -0
- package/dist/execution-phase.test.d.ts.map +1 -0
- package/dist/execution-phase.test.js +26 -0
- package/dist/execution-phase.test.js.map +1 -0
- package/dist/execution-target-sandbox.test.d.ts +2 -0
- package/dist/execution-target-sandbox.test.d.ts.map +1 -0
- package/dist/execution-target-sandbox.test.js +5599 -0
- package/dist/execution-target-sandbox.test.js.map +1 -0
- package/dist/execution-target-stdin-race.test.d.ts +2 -0
- package/dist/execution-target-stdin-race.test.d.ts.map +1 -0
- package/dist/execution-target-stdin-race.test.js +2166 -0
- package/dist/execution-target-stdin-race.test.js.map +1 -0
- package/dist/execution-target.d.ts +604 -0
- package/dist/execution-target.d.ts.map +1 -0
- package/dist/execution-target.js +4018 -0
- package/dist/execution-target.js.map +1 -0
- package/dist/execution-target.test.d.ts +2 -0
- package/dist/execution-target.test.d.ts.map +1 -0
- package/dist/execution-target.test.js +404 -0
- package/dist/execution-target.test.js.map +1 -0
- package/dist/git-shallow-import-budget.test.d.ts +2 -0
- package/dist/git-shallow-import-budget.test.d.ts.map +1 -0
- package/dist/git-shallow-import-budget.test.js +72 -0
- package/dist/git-shallow-import-budget.test.js.map +1 -0
- package/dist/git-workspace-sync.d.ts +224 -0
- package/dist/git-workspace-sync.d.ts.map +1 -0
- package/dist/git-workspace-sync.js +1081 -0
- package/dist/git-workspace-sync.js.map +1 -0
- package/dist/git-workspace-sync.test.d.ts +2 -0
- package/dist/git-workspace-sync.test.d.ts.map +1 -0
- package/dist/git-workspace-sync.test.js +1262 -0
- package/dist/git-workspace-sync.test.js.map +1 -0
- package/dist/github-launcher-environment.test.d.ts +2 -0
- package/dist/github-launcher-environment.test.d.ts.map +1 -0
- package/dist/github-launcher-environment.test.js +557 -0
- package/dist/github-launcher-environment.test.js.map +1 -0
- package/dist/github-launcher.d.ts +12 -0
- package/dist/github-launcher.d.ts.map +1 -0
- package/dist/github-launcher.js +240 -0
- package/dist/github-launcher.js.map +1 -0
- package/dist/github-launcher.test.d.ts +2 -0
- package/dist/github-launcher.test.d.ts.map +1 -0
- package/dist/github-launcher.test.js +608 -0
- package/dist/github-launcher.test.js.map +1 -0
- package/dist/http2-bridge-server.d.ts +464 -0
- package/dist/http2-bridge-server.d.ts.map +1 -0
- package/dist/http2-bridge-server.js +1086 -0
- package/dist/http2-bridge-server.js.map +1 -0
- package/dist/http2-bridge-server.test.d.ts +2 -0
- package/dist/http2-bridge-server.test.d.ts.map +1 -0
- package/dist/http2-bridge-server.test.js +2183 -0
- package/dist/http2-bridge-server.test.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/local-process-sandbox.d.ts +41 -0
- package/dist/local-process-sandbox.d.ts.map +1 -0
- package/dist/local-process-sandbox.js +432 -0
- package/dist/local-process-sandbox.js.map +1 -0
- package/dist/local-process-sandbox.test.d.ts +2 -0
- package/dist/local-process-sandbox.test.d.ts.map +1 -0
- package/dist/local-process-sandbox.test.js +399 -0
- package/dist/local-process-sandbox.test.js.map +1 -0
- package/dist/log-redaction.d.ts +9 -0
- package/dist/log-redaction.d.ts.map +1 -0
- package/dist/log-redaction.js +88 -0
- package/dist/log-redaction.js.map +1 -0
- package/dist/login-capability.d.ts +88 -0
- package/dist/login-capability.d.ts.map +1 -0
- package/dist/login-capability.js +78 -0
- package/dist/login-capability.js.map +1 -0
- package/dist/login-capability.test.d.ts +2 -0
- package/dist/login-capability.test.d.ts.map +1 -0
- package/dist/login-capability.test.js +78 -0
- package/dist/login-capability.test.js.map +1 -0
- package/dist/login-pty-transport.d.ts +80 -0
- package/dist/login-pty-transport.d.ts.map +1 -0
- package/dist/login-pty-transport.js +75 -0
- package/dist/login-pty-transport.js.map +1 -0
- package/dist/login-pty-transport.test.d.ts +2 -0
- package/dist/login-pty-transport.test.d.ts.map +1 -0
- package/dist/login-pty-transport.test.js +185 -0
- package/dist/login-pty-transport.test.js.map +1 -0
- package/dist/login-runner-lifecycle.d.ts +70 -0
- package/dist/login-runner-lifecycle.d.ts.map +1 -0
- package/dist/login-runner-lifecycle.js +52 -0
- package/dist/login-runner-lifecycle.js.map +1 -0
- package/dist/login-runner-lifecycle.test.d.ts +2 -0
- package/dist/login-runner-lifecycle.test.d.ts.map +1 -0
- package/dist/login-runner-lifecycle.test.js +122 -0
- package/dist/login-runner-lifecycle.test.js.map +1 -0
- package/dist/managed-ai-runtime-env.d.ts +4 -0
- package/dist/managed-ai-runtime-env.d.ts.map +1 -0
- package/dist/managed-ai-runtime-env.js +47 -0
- package/dist/managed-ai-runtime-env.js.map +1 -0
- package/dist/managed-clone-staging.test.d.ts +2 -0
- package/dist/managed-clone-staging.test.d.ts.map +1 -0
- package/dist/managed-clone-staging.test.js +167 -0
- package/dist/managed-clone-staging.test.js.map +1 -0
- package/dist/mcp-isolation.integration.test.d.ts +2 -0
- package/dist/mcp-isolation.integration.test.d.ts.map +1 -0
- package/dist/mcp-isolation.integration.test.js +202 -0
- package/dist/mcp-isolation.integration.test.js.map +1 -0
- package/dist/model-facing-history.d.ts +10 -0
- package/dist/model-facing-history.d.ts.map +1 -0
- package/dist/model-facing-history.js +44 -0
- package/dist/model-facing-history.js.map +1 -0
- package/dist/model-facing-history.test.d.ts +2 -0
- package/dist/model-facing-history.test.d.ts.map +1 -0
- package/dist/model-facing-history.test.js +27 -0
- package/dist/model-facing-history.test.js.map +1 -0
- package/dist/openrouter-attribution.d.ts +2 -0
- package/dist/openrouter-attribution.d.ts.map +1 -0
- package/dist/openrouter-attribution.js +2 -0
- package/dist/openrouter-attribution.js.map +1 -0
- package/dist/paperclip-runner-lifecycle-default.test.d.ts +2 -0
- package/dist/paperclip-runner-lifecycle-default.test.d.ts.map +1 -0
- package/dist/paperclip-runner-lifecycle-default.test.js +30 -0
- package/dist/paperclip-runner-lifecycle-default.test.js.map +1 -0
- package/dist/paperclip-runner-permissions.d.ts +182 -0
- package/dist/paperclip-runner-permissions.d.ts.map +1 -0
- package/dist/paperclip-runner-permissions.js +205 -0
- package/dist/paperclip-runner-permissions.js.map +1 -0
- package/dist/paperclip-runner-permissions.test.d.ts +2 -0
- package/dist/paperclip-runner-permissions.test.d.ts.map +1 -0
- package/dist/paperclip-runner-permissions.test.js +104 -0
- package/dist/paperclip-runner-permissions.test.js.map +1 -0
- package/dist/prompt-sections.test.d.ts +2 -0
- package/dist/prompt-sections.test.d.ts.map +1 -0
- package/dist/prompt-sections.test.js +53 -0
- package/dist/prompt-sections.test.js.map +1 -0
- package/dist/provider-stopped-boundary.d.ts +7 -0
- package/dist/provider-stopped-boundary.d.ts.map +1 -0
- package/dist/provider-stopped-boundary.js +22 -0
- package/dist/provider-stopped-boundary.js.map +1 -0
- package/dist/provider-stopped-boundary.test.d.ts +2 -0
- package/dist/provider-stopped-boundary.test.d.ts.map +1 -0
- package/dist/provider-stopped-boundary.test.js +76 -0
- package/dist/provider-stopped-boundary.test.js.map +1 -0
- package/dist/published-exports.test.d.ts +2 -0
- package/dist/published-exports.test.d.ts.map +1 -0
- package/dist/published-exports.test.js +17 -0
- package/dist/published-exports.test.js.map +1 -0
- package/dist/remote-execution-env.d.ts +3 -0
- package/dist/remote-execution-env.d.ts.map +1 -0
- package/dist/remote-execution-env.js +56 -0
- package/dist/remote-execution-env.js.map +1 -0
- package/dist/remote-managed-runtime.d.ts +52 -0
- package/dist/remote-managed-runtime.d.ts.map +1 -0
- package/dist/remote-managed-runtime.js +265 -0
- package/dist/remote-managed-runtime.js.map +1 -0
- package/dist/remote-managed-runtime.test.d.ts +2 -0
- package/dist/remote-managed-runtime.test.d.ts.map +1 -0
- package/dist/remote-managed-runtime.test.js +425 -0
- package/dist/remote-managed-runtime.test.js.map +1 -0
- package/dist/remote-pid-lock.d.ts +3 -0
- package/dist/remote-pid-lock.d.ts.map +1 -0
- package/dist/remote-pid-lock.js +35 -0
- package/dist/remote-pid-lock.js.map +1 -0
- package/dist/remote-text-file-sync.d.ts +41 -0
- package/dist/remote-text-file-sync.d.ts.map +1 -0
- package/dist/remote-text-file-sync.js +103 -0
- package/dist/remote-text-file-sync.js.map +1 -0
- package/dist/runner-connectivity.d.ts +61 -0
- package/dist/runner-connectivity.d.ts.map +1 -0
- package/dist/runner-connectivity.js +81 -0
- package/dist/runner-connectivity.js.map +1 -0
- package/dist/runner-connectivity.test.d.ts +2 -0
- package/dist/runner-connectivity.test.d.ts.map +1 -0
- package/dist/runner-connectivity.test.js +183 -0
- package/dist/runner-connectivity.test.js.map +1 -0
- package/dist/runtime-progress.d.ts +48 -0
- package/dist/runtime-progress.d.ts.map +1 -0
- package/dist/runtime-progress.js +99 -0
- package/dist/runtime-progress.js.map +1 -0
- package/dist/runtime-progress.test.d.ts +2 -0
- package/dist/runtime-progress.test.d.ts.map +1 -0
- package/dist/runtime-progress.test.js +240 -0
- package/dist/runtime-progress.test.js.map +1 -0
- package/dist/sandbox-callback-bridge-body.d.ts +12 -0
- package/dist/sandbox-callback-bridge-body.d.ts.map +1 -0
- package/dist/sandbox-callback-bridge-body.js +39 -0
- package/dist/sandbox-callback-bridge-body.js.map +1 -0
- package/dist/sandbox-callback-bridge-body.test.d.ts +2 -0
- package/dist/sandbox-callback-bridge-body.test.d.ts.map +1 -0
- package/dist/sandbox-callback-bridge-body.test.js +31 -0
- package/dist/sandbox-callback-bridge-body.test.js.map +1 -0
- package/dist/sandbox-callback-bridge.d.ts +249 -0
- package/dist/sandbox-callback-bridge.d.ts.map +1 -0
- package/dist/sandbox-callback-bridge.js +2309 -0
- package/dist/sandbox-callback-bridge.js.map +1 -0
- package/dist/sandbox-callback-bridge.test.d.ts +2 -0
- package/dist/sandbox-callback-bridge.test.d.ts.map +1 -0
- package/dist/sandbox-callback-bridge.test.js +3434 -0
- package/dist/sandbox-callback-bridge.test.js.map +1 -0
- package/dist/sandbox-callback-context-routes.test.d.ts +2 -0
- package/dist/sandbox-callback-context-routes.test.d.ts.map +1 -0
- package/dist/sandbox-callback-context-routes.test.js +40 -0
- package/dist/sandbox-callback-context-routes.test.js.map +1 -0
- package/dist/sandbox-file-sync.test.d.ts +2 -0
- package/dist/sandbox-file-sync.test.d.ts.map +1 -0
- package/dist/sandbox-file-sync.test.js +419 -0
- package/dist/sandbox-file-sync.test.js.map +1 -0
- package/dist/sandbox-install-command.d.ts +2 -0
- package/dist/sandbox-install-command.d.ts.map +1 -0
- package/dist/sandbox-install-command.js +47 -0
- package/dist/sandbox-install-command.js.map +1 -0
- package/dist/sandbox-install-command.test.d.ts +2 -0
- package/dist/sandbox-install-command.test.d.ts.map +1 -0
- package/dist/sandbox-install-command.test.js +22 -0
- package/dist/sandbox-install-command.test.js.map +1 -0
- package/dist/sandbox-managed-deletions.test.d.ts +2 -0
- package/dist/sandbox-managed-deletions.test.d.ts.map +1 -0
- package/dist/sandbox-managed-deletions.test.js +85 -0
- package/dist/sandbox-managed-deletions.test.js.map +1 -0
- package/dist/sandbox-managed-runtime.d.ts +465 -0
- package/dist/sandbox-managed-runtime.d.ts.map +1 -0
- package/dist/sandbox-managed-runtime.js +1801 -0
- package/dist/sandbox-managed-runtime.js.map +1 -0
- package/dist/sandbox-managed-runtime.test.d.ts +2 -0
- package/dist/sandbox-managed-runtime.test.d.ts.map +1 -0
- package/dist/sandbox-managed-runtime.test.js +3824 -0
- package/dist/sandbox-managed-runtime.test.js.map +1 -0
- package/dist/sandbox-managed-seed.test.d.ts +2 -0
- package/dist/sandbox-managed-seed.test.d.ts.map +1 -0
- package/dist/sandbox-managed-seed.test.js +223 -0
- package/dist/sandbox-managed-seed.test.js.map +1 -0
- package/dist/sandbox-run-log-stream.d.ts +44 -0
- package/dist/sandbox-run-log-stream.d.ts.map +1 -0
- package/dist/sandbox-run-log-stream.js +203 -0
- package/dist/sandbox-run-log-stream.js.map +1 -0
- package/dist/sandbox-shell.d.ts +3 -0
- package/dist/sandbox-shell.d.ts.map +1 -0
- package/dist/sandbox-shell.js +7 -0
- package/dist/sandbox-shell.js.map +1 -0
- package/dist/server-utils-env.test.d.ts +2 -0
- package/dist/server-utils-env.test.d.ts.map +1 -0
- package/dist/server-utils-env.test.js +15 -0
- package/dist/server-utils-env.test.js.map +1 -0
- package/dist/server-utils.d.ts +691 -0
- package/dist/server-utils.d.ts.map +1 -0
- package/dist/server-utils.js +3479 -0
- package/dist/server-utils.js.map +1 -0
- package/dist/server-utils.test.d.ts +2 -0
- package/dist/server-utils.test.d.ts.map +1 -0
- package/dist/server-utils.test.js +3571 -0
- package/dist/server-utils.test.js.map +1 -0
- package/dist/session-compaction.d.ts +25 -0
- package/dist/session-compaction.d.ts.map +1 -0
- package/dist/session-compaction.js +166 -0
- package/dist/session-compaction.js.map +1 -0
- package/dist/sigv4-presigned-url.d.ts +7 -0
- package/dist/sigv4-presigned-url.d.ts.map +1 -0
- package/dist/sigv4-presigned-url.js +119 -0
- package/dist/sigv4-presigned-url.js.map +1 -0
- package/dist/skill-library-manifest.d.ts +6 -0
- package/dist/skill-library-manifest.d.ts.map +1 -0
- package/dist/skill-library-manifest.js +53 -0
- package/dist/skill-library-manifest.js.map +1 -0
- package/dist/skill-library-manifest.test.d.ts +2 -0
- package/dist/skill-library-manifest.test.d.ts.map +1 -0
- package/dist/skill-library-manifest.test.js +84 -0
- package/dist/skill-library-manifest.test.js.map +1 -0
- package/dist/skills-staging-follow-symlinks.test.d.ts +2 -0
- package/dist/skills-staging-follow-symlinks.test.d.ts.map +1 -0
- package/dist/skills-staging-follow-symlinks.test.js +126 -0
- package/dist/skills-staging-follow-symlinks.test.js.map +1 -0
- package/dist/ssh-auth.test.d.ts +2 -0
- package/dist/ssh-auth.test.d.ts.map +1 -0
- package/dist/ssh-auth.test.js +20 -0
- package/dist/ssh-auth.test.js.map +1 -0
- package/dist/ssh-command-managed.test.d.ts +2 -0
- package/dist/ssh-command-managed.test.d.ts.map +1 -0
- package/dist/ssh-command-managed.test.js +136 -0
- package/dist/ssh-command-managed.test.js.map +1 -0
- package/dist/ssh-conversation-state.d.ts +22 -0
- package/dist/ssh-conversation-state.d.ts.map +1 -0
- package/dist/ssh-conversation-state.js +36 -0
- package/dist/ssh-conversation-state.js.map +1 -0
- package/dist/ssh-export-stream.test.d.ts +2 -0
- package/dist/ssh-export-stream.test.d.ts.map +1 -0
- package/dist/ssh-export-stream.test.js +104 -0
- package/dist/ssh-export-stream.test.js.map +1 -0
- package/dist/ssh-export.test.d.ts +2 -0
- package/dist/ssh-export.test.d.ts.map +1 -0
- package/dist/ssh-export.test.js +102 -0
- package/dist/ssh-export.test.js.map +1 -0
- package/dist/ssh-fixture.test.d.ts +2 -0
- package/dist/ssh-fixture.test.d.ts.map +1 -0
- package/dist/ssh-fixture.test.js +1107 -0
- package/dist/ssh-fixture.test.js.map +1 -0
- package/dist/ssh-tailscale.test.d.ts +2 -0
- package/dist/ssh-tailscale.test.d.ts.map +1 -0
- package/dist/ssh-tailscale.test.js +58 -0
- package/dist/ssh-tailscale.test.js.map +1 -0
- package/dist/ssh.d.ts +138 -0
- package/dist/ssh.d.ts.map +1 -0
- package/dist/ssh.js +1868 -0
- package/dist/ssh.js.map +1 -0
- package/dist/startup-reuse.d.ts +38 -0
- package/dist/startup-reuse.d.ts.map +1 -0
- package/dist/startup-reuse.js +90 -0
- package/dist/startup-reuse.js.map +1 -0
- package/dist/startup-reuse.test.d.ts +2 -0
- package/dist/startup-reuse.test.d.ts.map +1 -0
- package/dist/startup-reuse.test.js +71 -0
- package/dist/startup-reuse.test.js.map +1 -0
- package/dist/sync-operation-schedule.d.ts +17 -0
- package/dist/sync-operation-schedule.d.ts.map +1 -0
- package/dist/sync-operation-schedule.js +66 -0
- package/dist/sync-operation-schedule.js.map +1 -0
- package/dist/sync-operation-schedule.test.d.ts +2 -0
- package/dist/sync-operation-schedule.test.d.ts.map +1 -0
- package/dist/sync-operation-schedule.test.js +130 -0
- package/dist/sync-operation-schedule.test.js.map +1 -0
- package/dist/test-fixtures/follow-up-after-swarm-wake.d.ts +45 -0
- package/dist/test-fixtures/follow-up-after-swarm-wake.d.ts.map +1 -0
- package/dist/test-fixtures/follow-up-after-swarm-wake.js +80 -0
- package/dist/test-fixtures/follow-up-after-swarm-wake.js.map +1 -0
- package/dist/test-fixtures/prompt-context.d.ts +54 -0
- package/dist/test-fixtures/prompt-context.d.ts.map +1 -0
- package/dist/test-fixtures/prompt-context.js +55 -0
- package/dist/test-fixtures/prompt-context.js.map +1 -0
- package/dist/test-support/mcp-isolation-harness.d.ts +23 -0
- package/dist/test-support/mcp-isolation-harness.d.ts.map +1 -0
- package/dist/test-support/mcp-isolation-harness.js +67 -0
- package/dist/test-support/mcp-isolation-harness.js.map +1 -0
- package/dist/types.d.ts +910 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/dist/usage-checkpoint.d.ts +11 -0
- package/dist/usage-checkpoint.d.ts.map +1 -0
- package/dist/usage-checkpoint.js +165 -0
- package/dist/usage-checkpoint.js.map +1 -0
- package/dist/usage-checkpoint.test.d.ts +2 -0
- package/dist/usage-checkpoint.test.d.ts.map +1 -0
- package/dist/usage-checkpoint.test.js +131 -0
- package/dist/usage-checkpoint.test.js.map +1 -0
- package/dist/workspace-checkpoint-capture.test.d.ts +2 -0
- package/dist/workspace-checkpoint-capture.test.d.ts.map +1 -0
- package/dist/workspace-checkpoint-capture.test.js +232 -0
- package/dist/workspace-checkpoint-capture.test.js.map +1 -0
- package/dist/workspace-checkpoint.d.ts +16 -0
- package/dist/workspace-checkpoint.d.ts.map +1 -0
- package/dist/workspace-checkpoint.js +236 -0
- package/dist/workspace-checkpoint.js.map +1 -0
- package/dist/workspace-checkpoint.test.d.ts +2 -0
- package/dist/workspace-checkpoint.test.d.ts.map +1 -0
- package/dist/workspace-checkpoint.test.js +588 -0
- package/dist/workspace-checkpoint.test.js.map +1 -0
- package/dist/workspace-git-stream.d.ts +19 -0
- package/dist/workspace-git-stream.d.ts.map +1 -0
- package/dist/workspace-git-stream.js +99 -0
- package/dist/workspace-git-stream.js.map +1 -0
- package/dist/workspace-git-stream.test.d.ts +2 -0
- package/dist/workspace-git-stream.test.d.ts.map +1 -0
- package/dist/workspace-git-stream.test.js +71 -0
- package/dist/workspace-git-stream.test.js.map +1 -0
- package/dist/workspace-manifest.d.ts +61 -0
- package/dist/workspace-manifest.d.ts.map +1 -0
- package/dist/workspace-manifest.js +257 -0
- package/dist/workspace-manifest.js.map +1 -0
- package/dist/workspace-manifest.test.d.ts +2 -0
- package/dist/workspace-manifest.test.d.ts.map +1 -0
- package/dist/workspace-manifest.test.js +160 -0
- package/dist/workspace-manifest.test.js.map +1 -0
- package/dist/workspace-restore-diagnostics.d.ts +41 -0
- package/dist/workspace-restore-diagnostics.d.ts.map +1 -0
- package/dist/workspace-restore-diagnostics.js +265 -0
- package/dist/workspace-restore-diagnostics.js.map +1 -0
- package/dist/workspace-restore-diagnostics.test.d.ts +2 -0
- package/dist/workspace-restore-diagnostics.test.d.ts.map +1 -0
- package/dist/workspace-restore-diagnostics.test.js +294 -0
- package/dist/workspace-restore-diagnostics.test.js.map +1 -0
- package/dist/workspace-restore-merge.d.ts +126 -0
- package/dist/workspace-restore-merge.d.ts.map +1 -0
- package/dist/workspace-restore-merge.js +768 -0
- package/dist/workspace-restore-merge.js.map +1 -0
- package/dist/workspace-restore-merge.test.d.ts +2 -0
- package/dist/workspace-restore-merge.test.d.ts.map +1 -0
- package/dist/workspace-restore-merge.test.js +805 -0
- package/dist/workspace-restore-merge.test.js.map +1 -0
- package/dist/workspace-restore-result.d.ts +6 -0
- package/dist/workspace-restore-result.d.ts.map +1 -0
- package/dist/workspace-restore-result.js +72 -0
- package/dist/workspace-restore-result.js.map +1 -0
- package/dist/workspace-restore-result.test.d.ts +2 -0
- package/dist/workspace-restore-result.test.d.ts.map +1 -0
- package/dist/workspace-restore-result.test.js +74 -0
- package/dist/workspace-restore-result.test.js.map +1 -0
- package/dist/workspace-restore-teardown.d.ts +29 -0
- package/dist/workspace-restore-teardown.d.ts.map +1 -0
- package/dist/workspace-restore-teardown.js +36 -0
- package/dist/workspace-restore-teardown.js.map +1 -0
- package/dist/workspace-restore-teardown.test.d.ts +2 -0
- package/dist/workspace-restore-teardown.test.d.ts.map +1 -0
- package/dist/workspace-restore-teardown.test.js +104 -0
- package/dist/workspace-restore-teardown.test.js.map +1 -0
- package/dist/workspace-restore-unchanged.test.d.ts +2 -0
- package/dist/workspace-restore-unchanged.test.d.ts.map +1 -0
- package/dist/workspace-restore-unchanged.test.js +143 -0
- package/dist/workspace-restore-unchanged.test.js.map +1 -0
- package/dist/workspace-seed-cache.d.ts +41 -0
- package/dist/workspace-seed-cache.d.ts.map +1 -0
- package/dist/workspace-seed-cache.js +354 -0
- package/dist/workspace-seed-cache.js.map +1 -0
- package/dist/workspace-seed-cache.test.d.ts +2 -0
- package/dist/workspace-seed-cache.test.d.ts.map +1 -0
- package/dist/workspace-seed-cache.test.js +522 -0
- package/dist/workspace-seed-cache.test.js.map +1 -0
- package/dist/workspace-seed-reuse.test.d.ts +2 -0
- package/dist/workspace-seed-reuse.test.d.ts.map +1 -0
- package/dist/workspace-seed-reuse.test.js +274 -0
- package/dist/workspace-seed-reuse.test.js.map +1 -0
- package/dist/workspace-snapshot-concurrency.test.d.ts +2 -0
- package/dist/workspace-snapshot-concurrency.test.d.ts.map +1 -0
- package/dist/workspace-snapshot-concurrency.test.js +165 -0
- package/dist/workspace-snapshot-concurrency.test.js.map +1 -0
- package/dist/workspace-snapshot-thread-limit.test.d.ts +2 -0
- package/dist/workspace-snapshot-thread-limit.test.d.ts.map +1 -0
- package/dist/workspace-snapshot-thread-limit.test.js +84 -0
- package/dist/workspace-snapshot-thread-limit.test.js.map +1 -0
- package/dist/workspace-snapshot-thread-worker.d.ts +2 -0
- package/dist/workspace-snapshot-thread-worker.d.ts.map +1 -0
- package/dist/workspace-snapshot-thread-worker.js +28 -0
- package/dist/workspace-snapshot-thread-worker.js.map +1 -0
- package/dist/workspace-snapshot-thread.d.ts +27 -0
- package/dist/workspace-snapshot-thread.d.ts.map +1 -0
- package/dist/workspace-snapshot-thread.js +77 -0
- package/dist/workspace-snapshot-thread.js.map +1 -0
- package/dist/workspace-snapshot-thread.test.d.ts +2 -0
- package/dist/workspace-snapshot-thread.test.d.ts.map +1 -0
- package/dist/workspace-snapshot-thread.test.js +140 -0
- package/dist/workspace-snapshot-thread.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/LICENSE +191 -0
- package/node_modules/@agentclientprotocol/sdk/README.md +77 -0
- package/node_modules/@agentclientprotocol/sdk/dist/acp.d.ts +1637 -0
- package/node_modules/@agentclientprotocol/sdk/dist/acp.js +1729 -0
- package/node_modules/@agentclientprotocol/sdk/dist/acp.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/acp.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/acp.test.js +5093 -0
- package/node_modules/@agentclientprotocol/sdk/dist/acp.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/connection.d.ts +277 -0
- package/node_modules/@agentclientprotocol/sdk/dist/connection.js +898 -0
- package/node_modules/@agentclientprotocol/sdk/dist/connection.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/connection.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/connection.test.js +666 -0
- package/node_modules/@agentclientprotocol/sdk/dist/connection.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/cookie-store.d.ts +26 -0
- package/node_modules/@agentclientprotocol/sdk/dist/cookie-store.js +96 -0
- package/node_modules/@agentclientprotocol/sdk/dist/cookie-store.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/cookie-store.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/cookie-store.test.js +77 -0
- package/node_modules/@agentclientprotocol/sdk/dist/cookie-store.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/agent.d.ts +2 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/agent.js +232 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/agent.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/client.d.ts +2 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/client.js +132 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/client.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/dual-version-agent.d.ts +9 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/dual-version-agent.js +229 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/dual-version-agent.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/http-client.d.ts +2 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/http-client.js +86 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/http-client.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/http-server.d.ts +2 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/http-server.js +117 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/http-server.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/ws-client.d.ts +2 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/ws-client.js +88 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/ws-client.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/http-stream.d.ts +35 -0
- package/node_modules/@agentclientprotocol/sdk/dist/http-stream.js +473 -0
- package/node_modules/@agentclientprotocol/sdk/dist/http-stream.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/http-stream.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/http-stream.test.js +1380 -0
- package/node_modules/@agentclientprotocol/sdk/dist/http-stream.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.d.ts +604 -0
- package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.js +1082 -0
- package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.test.js +917 -0
- package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/line-buffer.d.ts +24 -0
- package/node_modules/@agentclientprotocol/sdk/dist/line-buffer.js +71 -0
- package/node_modules/@agentclientprotocol/sdk/dist/line-buffer.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/line-buffer.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/line-buffer.test.js +45 -0
- package/node_modules/@agentclientprotocol/sdk/dist/line-buffer.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/nes/acp.d.ts +563 -0
- package/node_modules/@agentclientprotocol/sdk/dist/nes/acp.js +106 -0
- package/node_modules/@agentclientprotocol/sdk/dist/nes/acp.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/nes/schema/types.gen.d.ts +1261 -0
- package/node_modules/@agentclientprotocol/sdk/dist/nes/schema/types.gen.js +4 -0
- package/node_modules/@agentclientprotocol/sdk/dist/nes/schema/types.gen.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/nes/schema/zod.gen.d.ts +962 -0
- package/node_modules/@agentclientprotocol/sdk/dist/nes/schema/zod.gen.js +526 -0
- package/node_modules/@agentclientprotocol/sdk/dist/nes/schema/zod.gen.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/node-adapter.d.ts +17 -0
- package/node_modules/@agentclientprotocol/sdk/dist/node-adapter.js +457 -0
- package/node_modules/@agentclientprotocol/sdk/dist/node-adapter.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/node-adapter.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/node-adapter.test.js +586 -0
- package/node_modules/@agentclientprotocol/sdk/dist/node-adapter.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.d.ts +43 -0
- package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.js +467 -0
- package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.test.js +592 -0
- package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/protocol.d.ts +11 -0
- package/node_modules/@agentclientprotocol/sdk/dist/protocol.js +60 -0
- package/node_modules/@agentclientprotocol/sdk/dist/protocol.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/protocol.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/protocol.test.js +72 -0
- package/node_modules/@agentclientprotocol/sdk/dist/protocol.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/guards.gen.d.ts +305 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/guards.gen.js +355 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/guards.gen.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/index.d.ts +39 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/index.js +40 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/index.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/types.gen.d.ts +5438 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/types.gen.js +3 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/types.gen.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/zod.gen.d.ts +15955 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/zod.gen.js +2827 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/zod.gen.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.d.ts +31 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.js +117 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.test.js +93 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-permission.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-permission.test.js +261 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-permission.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-session-sse.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-session-sse.test.js +536 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-session-sse.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-sse.d.ts +7 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-sse.js +136 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-sse.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-sse.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-sse.test.js +106 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-sse.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-websocket-upgrade.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-websocket-upgrade.test.js +1310 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-websocket-upgrade.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server.d.ts +82 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server.js +414 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server.test.js +1646 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/sse.d.ts +6 -0
- package/node_modules/@agentclientprotocol/sdk/dist/sse.js +114 -0
- package/node_modules/@agentclientprotocol/sdk/dist/sse.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/sse.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/sse.test.js +126 -0
- package/node_modules/@agentclientprotocol/sdk/dist/sse.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/stream-limits.d.ts +15 -0
- package/node_modules/@agentclientprotocol/sdk/dist/stream-limits.js +58 -0
- package/node_modules/@agentclientprotocol/sdk/dist/stream-limits.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/stream.d.ts +38 -0
- package/node_modules/@agentclientprotocol/sdk/dist/stream.js +119 -0
- package/node_modules/@agentclientprotocol/sdk/dist/stream.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/stream.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/stream.test.js +195 -0
- package/node_modules/@agentclientprotocol/sdk/dist/stream.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/test-support/streams.d.ts +8 -0
- package/node_modules/@agentclientprotocol/sdk/dist/test-support/streams.js +51 -0
- package/node_modules/@agentclientprotocol/sdk/dist/test-support/streams.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/test-support/test-agent.d.ts +24 -0
- package/node_modules/@agentclientprotocol/sdk/dist/test-support/test-agent.js +163 -0
- package/node_modules/@agentclientprotocol/sdk/dist/test-support/test-agent.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/test-support/test-http-server.d.ts +9 -0
- package/node_modules/@agentclientprotocol/sdk/dist/test-support/test-http-server.js +74 -0
- package/node_modules/@agentclientprotocol/sdk/dist/test-support/test-http-server.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/test-support/until.d.ts +5 -0
- package/node_modules/@agentclientprotocol/sdk/dist/test-support/until.js +14 -0
- package/node_modules/@agentclientprotocol/sdk/dist/test-support/until.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.d.ts +961 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.js +1451 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.test.js +1423 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/guards.gen.d.ts +1084 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/guards.gen.js +1157 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/guards.gen.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/index.d.ts +30 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/index.js +31 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/index.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/types.gen.d.ts +5672 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/types.gen.js +3 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/types.gen.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/zod.gen.d.ts +37653 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/zod.gen.js +2952 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/zod.gen.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/ws-server.d.ts +14 -0
- package/node_modules/@agentclientprotocol/sdk/dist/ws-server.js +485 -0
- package/node_modules/@agentclientprotocol/sdk/dist/ws-server.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/ws-stream.d.ts +54 -0
- package/node_modules/@agentclientprotocol/sdk/dist/ws-stream.js +253 -0
- package/node_modules/@agentclientprotocol/sdk/dist/ws-stream.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/ws-stream.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/ws-stream.test.js +836 -0
- package/node_modules/@agentclientprotocol/sdk/dist/ws-stream.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/ws-utils.d.ts +19 -0
- package/node_modules/@agentclientprotocol/sdk/dist/ws-utils.js +78 -0
- package/node_modules/@agentclientprotocol/sdk/dist/ws-utils.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/ws-utils.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/ws-utils.test.js +42 -0
- package/node_modules/@agentclientprotocol/sdk/dist/ws-utils.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/package.json +110 -0
- package/node_modules/@agentclientprotocol/sdk/schema/schema.json +7852 -0
- package/node_modules/@agentclientprotocol/sdk/schema/v2/schema.unstable.json +8814 -0
- package/node_modules/@clack/core/LICENSE +9 -0
- package/node_modules/@clack/core/README.md +22 -0
- package/node_modules/@clack/core/dist/index.d.mts +505 -0
- package/node_modules/@clack/core/dist/index.mjs +1006 -0
- package/node_modules/@clack/core/package.json +64 -0
- package/node_modules/@clack/prompts/LICENSE +9 -0
- package/node_modules/@clack/prompts/README.md +396 -0
- package/node_modules/@clack/prompts/dist/index.d.mts +950 -0
- package/node_modules/@clack/prompts/dist/index.mjs +1448 -0
- package/node_modules/@clack/prompts/package.json +67 -0
- package/node_modules/@openclaw/fs-safe/CHANGELOG.md +1772 -0
- package/node_modules/@openclaw/fs-safe/LICENSE +22 -0
- package/node_modules/@openclaw/fs-safe/README.md +383 -0
- package/node_modules/@openclaw/fs-safe/SECURITY.md +45 -0
- package/node_modules/@openclaw/fs-safe/dist/absolute-path.d.ts +32 -0
- package/node_modules/@openclaw/fs-safe/dist/absolute-path.js +307 -0
- package/node_modules/@openclaw/fs-safe/dist/advanced.d.ts +45 -0
- package/node_modules/@openclaw/fs-safe/dist/advanced.js +43 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-crc32.d.ts +1 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-crc32.js +19 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-deadline.d.ts +11 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-deadline.js +101 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-durability.d.ts +23 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-durability.js +180 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-entry.d.ts +13 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-entry.js +89 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-errors.d.ts +12 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-errors.js +23 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-gzip-tail.d.ts +20 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-gzip-tail.js +99 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-input.d.ts +18 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-input.js +100 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-kind.d.ts +7 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-kind.js +71 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-limits.d.ts +56 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-limits.js +131 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-merge.d.ts +22 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-merge.js +307 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-parser-errors.d.ts +1 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-parser-errors.js +12 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-parser.wasm +0 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-plan.d.ts +85 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-plan.js +119 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-read.d.ts +5 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-read.js +241 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-staging.d.ts +32 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-staging.js +291 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-tar-stream.d.ts +27 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-tar-stream.js +127 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-tar-wasm.d.ts +29 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-tar-wasm.js +203 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-admission.d.ts +7 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-admission.js +96 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-count.d.ts +1 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-count.js +160 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-directory.d.ts +21 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-directory.js +267 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-entry.d.ts +24 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-entry.js +10 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-integrity.d.ts +4 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-integrity.js +30 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-loader.d.ts +12 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-loader.js +152 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-manifest.d.ts +4 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-manifest.js +24 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-names.d.ts +17 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-names.js +149 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-preflight.d.ts +4 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-zip-preflight.js +21 -0
- package/node_modules/@openclaw/fs-safe/dist/archive.d.ts +20 -0
- package/node_modules/@openclaw/fs-safe/dist/archive.js +329 -0
- package/node_modules/@openclaw/fs-safe/dist/async-lock.d.ts +1 -0
- package/node_modules/@openclaw/fs-safe/dist/async-lock.js +17 -0
- package/node_modules/@openclaw/fs-safe/dist/atomic-io.d.ts +52 -0
- package/node_modules/@openclaw/fs-safe/dist/atomic-io.js +248 -0
- package/node_modules/@openclaw/fs-safe/dist/atomic.d.ts +7 -0
- package/node_modules/@openclaw/fs-safe/dist/atomic.js +4 -0
- package/node_modules/@openclaw/fs-safe/dist/bounded-read-stream.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/bounded-read-stream.js +15 -0
- package/node_modules/@openclaw/fs-safe/dist/bounded-read.d.ts +26 -0
- package/node_modules/@openclaw/fs-safe/dist/bounded-read.js +161 -0
- package/node_modules/@openclaw/fs-safe/dist/byte-budget.d.ts +3 -0
- package/node_modules/@openclaw/fs-safe/dist/byte-budget.js +9 -0
- package/node_modules/@openclaw/fs-safe/dist/byte-view.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/byte-view.js +13 -0
- package/node_modules/@openclaw/fs-safe/dist/clone-metadata.d.ts +21 -0
- package/node_modules/@openclaw/fs-safe/dist/clone-metadata.js +37 -0
- package/node_modules/@openclaw/fs-safe/dist/config.d.ts +8 -0
- package/node_modules/@openclaw/fs-safe/dist/config.js +7 -0
- package/node_modules/@openclaw/fs-safe/dist/containment.d.ts +1 -0
- package/node_modules/@openclaw/fs-safe/dist/containment.js +1 -0
- package/node_modules/@openclaw/fs-safe/dist/copy-file-input.d.ts +23 -0
- package/node_modules/@openclaw/fs-safe/dist/copy-file-input.js +74 -0
- package/node_modules/@openclaw/fs-safe/dist/copy-link.d.ts +26 -0
- package/node_modules/@openclaw/fs-safe/dist/copy-link.js +170 -0
- package/node_modules/@openclaw/fs-safe/dist/copy-metadata.d.ts +9 -0
- package/node_modules/@openclaw/fs-safe/dist/copy-metadata.js +39 -0
- package/node_modules/@openclaw/fs-safe/dist/copy-path-admission.d.ts +17 -0
- package/node_modules/@openclaw/fs-safe/dist/copy-path-admission.js +126 -0
- package/node_modules/@openclaw/fs-safe/dist/copy-policy.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/copy-policy.js +8 -0
- package/node_modules/@openclaw/fs-safe/dist/copy-publication.d.ts +18 -0
- package/node_modules/@openclaw/fs-safe/dist/copy-publication.js +29 -0
- package/node_modules/@openclaw/fs-safe/dist/copy-root-file-sync.d.ts +36 -0
- package/node_modules/@openclaw/fs-safe/dist/copy-root-file-sync.js +204 -0
- package/node_modules/@openclaw/fs-safe/dist/copy-tree-portable.d.ts +8 -0
- package/node_modules/@openclaw/fs-safe/dist/copy-tree-portable.js +244 -0
- package/node_modules/@openclaw/fs-safe/dist/copy.d.ts +15 -0
- package/node_modules/@openclaw/fs-safe/dist/copy.js +143 -0
- package/node_modules/@openclaw/fs-safe/dist/create-owned-file.d.ts +7 -0
- package/node_modules/@openclaw/fs-safe/dist/create-owned-file.js +16 -0
- package/node_modules/@openclaw/fs-safe/dist/create.d.ts +18 -0
- package/node_modules/@openclaw/fs-safe/dist/create.js +398 -0
- package/node_modules/@openclaw/fs-safe/dist/creation-boundary.d.ts +60 -0
- package/node_modules/@openclaw/fs-safe/dist/creation-boundary.js +374 -0
- package/node_modules/@openclaw/fs-safe/dist/darwin-acl.d.ts +12 -0
- package/node_modules/@openclaw/fs-safe/dist/darwin-acl.js +29 -0
- package/node_modules/@openclaw/fs-safe/dist/deny-mutation-match.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/deny-mutation-match.js +71 -0
- package/node_modules/@openclaw/fs-safe/dist/deny-mutations.d.ts +11 -0
- package/node_modules/@openclaw/fs-safe/dist/deny-mutations.js +96 -0
- package/node_modules/@openclaw/fs-safe/dist/device-path.d.ts +14 -0
- package/node_modules/@openclaw/fs-safe/dist/device-path.js +139 -0
- package/node_modules/@openclaw/fs-safe/dist/directory-durability.d.ts +46 -0
- package/node_modules/@openclaw/fs-safe/dist/directory-durability.js +286 -0
- package/node_modules/@openclaw/fs-safe/dist/directory-entry-path.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/directory-entry-path.js +21 -0
- package/node_modules/@openclaw/fs-safe/dist/directory-guard.d.ts +65 -0
- package/node_modules/@openclaw/fs-safe/dist/directory-guard.js +197 -0
- package/node_modules/@openclaw/fs-safe/dist/directory-mode-node.d.ts +47 -0
- package/node_modules/@openclaw/fs-safe/dist/directory-mode-node.js +323 -0
- package/node_modules/@openclaw/fs-safe/dist/directory-mode-options.d.ts +3 -0
- package/node_modules/@openclaw/fs-safe/dist/directory-mode-options.js +6 -0
- package/node_modules/@openclaw/fs-safe/dist/directory-receipt.d.ts +23 -0
- package/node_modules/@openclaw/fs-safe/dist/directory-receipt.js +126 -0
- package/node_modules/@openclaw/fs-safe/dist/durability.d.ts +5 -0
- package/node_modules/@openclaw/fs-safe/dist/durability.js +3 -0
- package/node_modules/@openclaw/fs-safe/dist/effective-uid.d.ts +1 -0
- package/node_modules/@openclaw/fs-safe/dist/effective-uid.js +22 -0
- package/node_modules/@openclaw/fs-safe/dist/entry-publication-types.d.ts +55 -0
- package/node_modules/@openclaw/fs-safe/dist/entry-publication-types.js +1 -0
- package/node_modules/@openclaw/fs-safe/dist/entry-publication.d.ts +8 -0
- package/node_modules/@openclaw/fs-safe/dist/entry-publication.js +264 -0
- package/node_modules/@openclaw/fs-safe/dist/error-detail.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/error-detail.js +13 -0
- package/node_modules/@openclaw/fs-safe/dist/errors.d.ts +17 -0
- package/node_modules/@openclaw/fs-safe/dist/errors.js +33 -0
- package/node_modules/@openclaw/fs-safe/dist/exact-identity.d.ts +17 -0
- package/node_modules/@openclaw/fs-safe/dist/exact-identity.js +29 -0
- package/node_modules/@openclaw/fs-safe/dist/exclusive-create.d.ts +3 -0
- package/node_modules/@openclaw/fs-safe/dist/exclusive-create.js +22 -0
- package/node_modules/@openclaw/fs-safe/dist/file-cleanup.d.ts +14 -0
- package/node_modules/@openclaw/fs-safe/dist/file-cleanup.js +78 -0
- package/node_modules/@openclaw/fs-safe/dist/file-contents.d.ts +5 -0
- package/node_modules/@openclaw/fs-safe/dist/file-contents.js +40 -0
- package/node_modules/@openclaw/fs-safe/dist/file-handle-transfer.d.ts +15 -0
- package/node_modules/@openclaw/fs-safe/dist/file-handle-transfer.js +192 -0
- package/node_modules/@openclaw/fs-safe/dist/file-hash.d.ts +16 -0
- package/node_modules/@openclaw/fs-safe/dist/file-hash.js +298 -0
- package/node_modules/@openclaw/fs-safe/dist/file-identity.d.ts +13 -0
- package/node_modules/@openclaw/fs-safe/dist/file-identity.js +75 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-acquisition.d.ts +22 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-acquisition.js +98 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-admission.d.ts +16 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-admission.js +47 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-acquire.d.ts +6 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-acquire.js +349 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-held.d.ts +25 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-held.js +392 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-io.d.ts +40 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-io.js +209 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-mutation.d.ts +16 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-mutation.js +284 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-options.d.ts +11 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-options.js +58 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-registration.d.ts +1 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-registration.js +90 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root.d.ts +34 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root.js +286 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-stale-admission.d.ts +19 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-stale-admission.js +198 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync.d.ts +17 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync.js +356 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock.d.ts +24 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock.js +67 -0
- package/node_modules/@openclaw/fs-safe/dist/file-observation.d.ts +8 -0
- package/node_modules/@openclaw/fs-safe/dist/file-observation.js +22 -0
- package/node_modules/@openclaw/fs-safe/dist/file-open-error.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/file-open-error.js +14 -0
- package/node_modules/@openclaw/fs-safe/dist/file-store-boundary.d.ts +34 -0
- package/node_modules/@openclaw/fs-safe/dist/file-store-boundary.js +202 -0
- package/node_modules/@openclaw/fs-safe/dist/file-store-prune.d.ts +11 -0
- package/node_modules/@openclaw/fs-safe/dist/file-store-prune.js +116 -0
- package/node_modules/@openclaw/fs-safe/dist/file-store-sync-directory.d.ts +15 -0
- package/node_modules/@openclaw/fs-safe/dist/file-store-sync-directory.js +345 -0
- package/node_modules/@openclaw/fs-safe/dist/file-store-sync-write.d.ts +9 -0
- package/node_modules/@openclaw/fs-safe/dist/file-store-sync-write.js +132 -0
- package/node_modules/@openclaw/fs-safe/dist/file-store.d.ts +63 -0
- package/node_modules/@openclaw/fs-safe/dist/file-store.js +359 -0
- package/node_modules/@openclaw/fs-safe/dist/file-sync.d.ts +5 -0
- package/node_modules/@openclaw/fs-safe/dist/file-sync.js +24 -0
- package/node_modules/@openclaw/fs-safe/dist/file-write-lease.d.ts +9 -0
- package/node_modules/@openclaw/fs-safe/dist/file-write-lease.js +42 -0
- package/node_modules/@openclaw/fs-safe/dist/filename.d.ts +8 -0
- package/node_modules/@openclaw/fs-safe/dist/filename.js +138 -0
- package/node_modules/@openclaw/fs-safe/dist/fs.d.ts +4 -0
- package/node_modules/@openclaw/fs-safe/dist/fs.js +22 -0
- package/node_modules/@openclaw/fs-safe/dist/guarded-mkdir.d.ts +27 -0
- package/node_modules/@openclaw/fs-safe/dist/guarded-mkdir.js +285 -0
- package/node_modules/@openclaw/fs-safe/dist/guarded-mutation.d.ts +32 -0
- package/node_modules/@openclaw/fs-safe/dist/guarded-mutation.js +81 -0
- package/node_modules/@openclaw/fs-safe/dist/guest-dispatch-python.d.ts +1 -0
- package/node_modules/@openclaw/fs-safe/dist/guest-dispatch-python.js +68 -0
- package/node_modules/@openclaw/fs-safe/dist/guest-native-python.d.ts +3 -0
- package/node_modules/@openclaw/fs-safe/dist/guest-native-python.js +178 -0
- package/node_modules/@openclaw/fs-safe/dist/guest.d.ts +8 -0
- package/node_modules/@openclaw/fs-safe/dist/guest.js +427 -0
- package/node_modules/@openclaw/fs-safe/dist/hardlink-fallback.d.ts +1 -0
- package/node_modules/@openclaw/fs-safe/dist/hardlink-fallback.js +5 -0
- package/node_modules/@openclaw/fs-safe/dist/home-dir.d.ts +11 -0
- package/node_modules/@openclaw/fs-safe/dist/home-dir.js +149 -0
- package/node_modules/@openclaw/fs-safe/dist/index.d.ts +10 -0
- package/node_modules/@openclaw/fs-safe/dist/index.js +6 -0
- package/node_modules/@openclaw/fs-safe/dist/install-path.d.ts +25 -0
- package/node_modules/@openclaw/fs-safe/dist/install-path.js +136 -0
- package/node_modules/@openclaw/fs-safe/dist/json-document-store.d.ts +32 -0
- package/node_modules/@openclaw/fs-safe/dist/json-document-store.js +105 -0
- package/node_modules/@openclaw/fs-safe/dist/json-durable-queue-directory.d.ts +14 -0
- package/node_modules/@openclaw/fs-safe/dist/json-durable-queue-directory.js +150 -0
- package/node_modules/@openclaw/fs-safe/dist/json-durable-queue-ownership.d.ts +19 -0
- package/node_modules/@openclaw/fs-safe/dist/json-durable-queue-ownership.js +368 -0
- package/node_modules/@openclaw/fs-safe/dist/json-durable-queue-read.d.ts +5 -0
- package/node_modules/@openclaw/fs-safe/dist/json-durable-queue-read.js +65 -0
- package/node_modules/@openclaw/fs-safe/dist/json-durable-queue.d.ts +44 -0
- package/node_modules/@openclaw/fs-safe/dist/json-durable-queue.js +210 -0
- package/node_modules/@openclaw/fs-safe/dist/json-store.d.ts +9 -0
- package/node_modules/@openclaw/fs-safe/dist/json-store.js +15 -0
- package/node_modules/@openclaw/fs-safe/dist/json-stringify.d.ts +1 -0
- package/node_modules/@openclaw/fs-safe/dist/json-stringify.js +7 -0
- package/node_modules/@openclaw/fs-safe/dist/json.d.ts +49 -0
- package/node_modules/@openclaw/fs-safe/dist/json.js +305 -0
- package/node_modules/@openclaw/fs-safe/dist/local-file-access.d.ts +8 -0
- package/node_modules/@openclaw/fs-safe/dist/local-file-access.js +81 -0
- package/node_modules/@openclaw/fs-safe/dist/local-file-descriptor.d.ts +13 -0
- package/node_modules/@openclaw/fs-safe/dist/local-file-descriptor.js +101 -0
- package/node_modules/@openclaw/fs-safe/dist/local-roots.d.ts +20 -0
- package/node_modules/@openclaw/fs-safe/dist/local-roots.js +160 -0
- package/node_modules/@openclaw/fs-safe/dist/lock-config.d.ts +9 -0
- package/node_modules/@openclaw/fs-safe/dist/lock-config.js +12 -0
- package/node_modules/@openclaw/fs-safe/dist/move-path-cleanup.d.ts +30 -0
- package/node_modules/@openclaw/fs-safe/dist/move-path-cleanup.js +224 -0
- package/node_modules/@openclaw/fs-safe/dist/move-path-stage.d.ts +7 -0
- package/node_modules/@openclaw/fs-safe/dist/move-path-stage.js +56 -0
- package/node_modules/@openclaw/fs-safe/dist/move-path.d.ts +20 -0
- package/node_modules/@openclaw/fs-safe/dist/move-path.js +392 -0
- package/node_modules/@openclaw/fs-safe/dist/mutation-authority.d.ts +9 -0
- package/node_modules/@openclaw/fs-safe/dist/mutation-authority.js +49 -0
- package/node_modules/@openclaw/fs-safe/dist/native-binding.d.ts +323 -0
- package/node_modules/@openclaw/fs-safe/dist/native-binding.js +8 -0
- package/node_modules/@openclaw/fs-safe/dist/native-config.d.ts +13 -0
- package/node_modules/@openclaw/fs-safe/dist/native-config.js +59 -0
- package/node_modules/@openclaw/fs-safe/dist/native-directory-observation.d.ts +16 -0
- package/node_modules/@openclaw/fs-safe/dist/native-directory-observation.js +39 -0
- package/node_modules/@openclaw/fs-safe/dist/native-fallback-warning.d.ts +4 -0
- package/node_modules/@openclaw/fs-safe/dist/native-fallback-warning.js +35 -0
- package/node_modules/@openclaw/fs-safe/dist/native-guidance.d.ts +3 -0
- package/node_modules/@openclaw/fs-safe/dist/native-guidance.js +21 -0
- package/node_modules/@openclaw/fs-safe/dist/native-move-fallback.d.ts +3 -0
- package/node_modules/@openclaw/fs-safe/dist/native-move-fallback.js +56 -0
- package/node_modules/@openclaw/fs-safe/dist/native-noreplace.d.ts +8 -0
- package/node_modules/@openclaw/fs-safe/dist/native-noreplace.js +55 -0
- package/node_modules/@openclaw/fs-safe/dist/native-operations.d.ts +14 -0
- package/node_modules/@openclaw/fs-safe/dist/native-operations.js +111 -0
- package/node_modules/@openclaw/fs-safe/dist/native-parent-admission.d.ts +76 -0
- package/node_modules/@openclaw/fs-safe/dist/native-parent-admission.js +220 -0
- package/node_modules/@openclaw/fs-safe/dist/native-pinned-write-windows.d.ts +6 -0
- package/node_modules/@openclaw/fs-safe/dist/native-pinned-write-windows.js +290 -0
- package/node_modules/@openclaw/fs-safe/dist/native-pinned-write.d.ts +7 -0
- package/node_modules/@openclaw/fs-safe/dist/native-pinned-write.js +202 -0
- package/node_modules/@openclaw/fs-safe/dist/native-policy-directory-observation.d.ts +11 -0
- package/node_modules/@openclaw/fs-safe/dist/native-policy-directory-observation.js +62 -0
- package/node_modules/@openclaw/fs-safe/dist/native-policy-parent-windows.d.ts +13 -0
- package/node_modules/@openclaw/fs-safe/dist/native-policy-parent-windows.js +62 -0
- package/node_modules/@openclaw/fs-safe/dist/native-policy-parent.d.ts +15 -0
- package/node_modules/@openclaw/fs-safe/dist/native-policy-parent.js +421 -0
- package/node_modules/@openclaw/fs-safe/dist/native-rename-outcome.d.ts +3 -0
- package/node_modules/@openclaw/fs-safe/dist/native-rename-outcome.js +15 -0
- package/node_modules/@openclaw/fs-safe/dist/native-staged-file-metadata.d.ts +3 -0
- package/node_modules/@openclaw/fs-safe/dist/native-staged-file-metadata.js +16 -0
- package/node_modules/@openclaw/fs-safe/dist/native-staged-file.d.ts +45 -0
- package/node_modules/@openclaw/fs-safe/dist/native-staged-file.js +516 -0
- package/node_modules/@openclaw/fs-safe/dist/native-staged-symlink.d.ts +13 -0
- package/node_modules/@openclaw/fs-safe/dist/native-staged-symlink.js +285 -0
- package/node_modules/@openclaw/fs-safe/dist/native-stat-identity.d.ts +3 -0
- package/node_modules/@openclaw/fs-safe/dist/native-stat-identity.js +7 -0
- package/node_modules/@openclaw/fs-safe/dist/native-status.d.ts +17 -0
- package/node_modules/@openclaw/fs-safe/dist/native-status.js +30 -0
- package/node_modules/@openclaw/fs-safe/dist/native.d.ts +40 -0
- package/node_modules/@openclaw/fs-safe/dist/native.js +311 -0
- package/node_modules/@openclaw/fs-safe/dist/opened-file-failure.d.ts +7 -0
- package/node_modules/@openclaw/fs-safe/dist/opened-file-failure.js +48 -0
- package/node_modules/@openclaw/fs-safe/dist/opened-realpath.d.ts +15 -0
- package/node_modules/@openclaw/fs-safe/dist/opened-realpath.js +110 -0
- package/node_modules/@openclaw/fs-safe/dist/output.d.ts +16 -0
- package/node_modules/@openclaw/fs-safe/dist/output.js +145 -0
- package/node_modules/@openclaw/fs-safe/dist/overwrite-file-handle.d.ts +9 -0
- package/node_modules/@openclaw/fs-safe/dist/overwrite-file-handle.js +71 -0
- package/node_modules/@openclaw/fs-safe/dist/owner-dacl-batch-worker.d.ts +1 -0
- package/node_modules/@openclaw/fs-safe/dist/owner-dacl-batch-worker.js +54 -0
- package/node_modules/@openclaw/fs-safe/dist/owner-dacl-batch.d.ts +5 -0
- package/node_modules/@openclaw/fs-safe/dist/owner-dacl-batch.js +64 -0
- package/node_modules/@openclaw/fs-safe/dist/owner-dacl.d.ts +34 -0
- package/node_modules/@openclaw/fs-safe/dist/owner-dacl.js +40 -0
- package/node_modules/@openclaw/fs-safe/dist/path-case.d.ts +6 -0
- package/node_modules/@openclaw/fs-safe/dist/path-case.js +137 -0
- package/node_modules/@openclaw/fs-safe/dist/path-policy.d.ts +24 -0
- package/node_modules/@openclaw/fs-safe/dist/path-policy.js +49 -0
- package/node_modules/@openclaw/fs-safe/dist/path-prefix.d.ts +7 -0
- package/node_modules/@openclaw/fs-safe/dist/path-prefix.js +181 -0
- package/node_modules/@openclaw/fs-safe/dist/path-scope-lexical.d.ts +13 -0
- package/node_modules/@openclaw/fs-safe/dist/path-scope-lexical.js +40 -0
- package/node_modules/@openclaw/fs-safe/dist/path-segment-route.d.ts +7 -0
- package/node_modules/@openclaw/fs-safe/dist/path-segment-route.js +27 -0
- package/node_modules/@openclaw/fs-safe/dist/path-suffix-aliases.d.ts +11 -0
- package/node_modules/@openclaw/fs-safe/dist/path-suffix-aliases.js +394 -0
- package/node_modules/@openclaw/fs-safe/dist/path.d.ts +20 -0
- package/node_modules/@openclaw/fs-safe/dist/path.js +192 -0
- package/node_modules/@openclaw/fs-safe/dist/permission-exec.d.ts +32 -0
- package/node_modules/@openclaw/fs-safe/dist/permission-exec.js +203 -0
- package/node_modules/@openclaw/fs-safe/dist/permissions-public.d.ts +6 -0
- package/node_modules/@openclaw/fs-safe/dist/permissions-public.js +5 -0
- package/node_modules/@openclaw/fs-safe/dist/permissions-windows.d.ts +47 -0
- package/node_modules/@openclaw/fs-safe/dist/permissions-windows.js +380 -0
- package/node_modules/@openclaw/fs-safe/dist/permissions.d.ts +52 -0
- package/node_modules/@openclaw/fs-safe/dist/permissions.js +131 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-mutation-admission.d.ts +23 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-mutation-admission.js +419 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-mutation-observation.d.ts +38 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-mutation-observation.js +205 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-mutation-shared-route.d.ts +18 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-mutation-shared-route.js +70 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-open.d.ts +37 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-open.js +118 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-operation.d.ts +1 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-operation.js +22 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-write-input.d.ts +5 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-write-input.js +54 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-write-mode.d.ts +4 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-write-mode.js +31 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-write-staged.d.ts +5 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-write-staged.js +212 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-write-types.d.ts +74 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-write-types.js +1 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-write.d.ts +12 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-write.js +301 -0
- package/node_modules/@openclaw/fs-safe/dist/pipe.d.ts +9 -0
- package/node_modules/@openclaw/fs-safe/dist/pipe.js +26 -0
- package/node_modules/@openclaw/fs-safe/dist/positional-read.d.ts +8 -0
- package/node_modules/@openclaw/fs-safe/dist/positional-read.js +36 -0
- package/node_modules/@openclaw/fs-safe/dist/prepare-directory-mode.d.ts +9 -0
- package/node_modules/@openclaw/fs-safe/dist/prepare-directory-mode.js +61 -0
- package/node_modules/@openclaw/fs-safe/dist/private-directory.d.ts +4 -0
- package/node_modules/@openclaw/fs-safe/dist/private-directory.js +30 -0
- package/node_modules/@openclaw/fs-safe/dist/private-producer-handoff-sync.d.ts +3 -0
- package/node_modules/@openclaw/fs-safe/dist/private-producer-handoff-sync.js +72 -0
- package/node_modules/@openclaw/fs-safe/dist/private-producer-handoff.d.ts +53 -0
- package/node_modules/@openclaw/fs-safe/dist/private-producer-handoff.js +352 -0
- package/node_modules/@openclaw/fs-safe/dist/private-temp-workspace.d.ts +8 -0
- package/node_modules/@openclaw/fs-safe/dist/private-temp-workspace.js +370 -0
- package/node_modules/@openclaw/fs-safe/dist/publication-handle.d.ts +4 -0
- package/node_modules/@openclaw/fs-safe/dist/publication-handle.js +32 -0
- package/node_modules/@openclaw/fs-safe/dist/publish-copy-stage.d.ts +14 -0
- package/node_modules/@openclaw/fs-safe/dist/publish-copy-stage.js +152 -0
- package/node_modules/@openclaw/fs-safe/dist/publish-file-failure.d.ts +35 -0
- package/node_modules/@openclaw/fs-safe/dist/publish-file-failure.js +26 -0
- package/node_modules/@openclaw/fs-safe/dist/publish-file.d.ts +23 -0
- package/node_modules/@openclaw/fs-safe/dist/publish-file.js +371 -0
- package/node_modules/@openclaw/fs-safe/dist/publish-rename-fallback.d.ts +21 -0
- package/node_modules/@openclaw/fs-safe/dist/publish-rename-fallback.js +102 -0
- package/node_modules/@openclaw/fs-safe/dist/read-open-flags.d.ts +7 -0
- package/node_modules/@openclaw/fs-safe/dist/read-open-flags.js +13 -0
- package/node_modules/@openclaw/fs-safe/dist/read-opened-file.d.ts +19 -0
- package/node_modules/@openclaw/fs-safe/dist/read-opened-file.js +17 -0
- package/node_modules/@openclaw/fs-safe/dist/realpath.d.ts +5 -0
- package/node_modules/@openclaw/fs-safe/dist/realpath.js +102 -0
- package/node_modules/@openclaw/fs-safe/dist/recursive-mkdir-path.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/recursive-mkdir-path.js +8 -0
- package/node_modules/@openclaw/fs-safe/dist/regular-file.d.ts +41 -0
- package/node_modules/@openclaw/fs-safe/dist/regular-file.js +313 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-directory.d.ts +6 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-directory.js +276 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-buffer.d.ts +3 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-buffer.js +22 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-copy-fallback.d.ts +20 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-copy-fallback.js +228 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-copy-source.d.ts +9 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-copy-source.js +60 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-descriptor.d.ts +22 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-descriptor.js +172 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-destination.d.ts +19 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-destination.js +89 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-mode.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-mode.js +10 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-mutation.d.ts +26 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-mutation.js +47 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-rename-policy.d.ts +5 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-rename-policy.js +30 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-temp-owner.d.ts +32 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-temp-owner.js +229 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-types.d.ts +51 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file-types.js +1 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file.d.ts +6 -0
- package/node_modules/@openclaw/fs-safe/dist/replace-file.js +223 -0
- package/node_modules/@openclaw/fs-safe/dist/retained-directory-replacement.d.ts +26 -0
- package/node_modules/@openclaw/fs-safe/dist/retained-directory-replacement.js +193 -0
- package/node_modules/@openclaw/fs-safe/dist/retained-file-types.d.ts +50 -0
- package/node_modules/@openclaw/fs-safe/dist/retained-file-types.js +1 -0
- package/node_modules/@openclaw/fs-safe/dist/retained-file.d.ts +3 -0
- package/node_modules/@openclaw/fs-safe/dist/retained-file.js +121 -0
- package/node_modules/@openclaw/fs-safe/dist/root-boundary.d.ts +29 -0
- package/node_modules/@openclaw/fs-safe/dist/root-boundary.js +176 -0
- package/node_modules/@openclaw/fs-safe/dist/root-context.d.ts +40 -0
- package/node_modules/@openclaw/fs-safe/dist/root-context.js +237 -0
- package/node_modules/@openclaw/fs-safe/dist/root-copy.d.ts +18 -0
- package/node_modules/@openclaw/fs-safe/dist/root-copy.js +128 -0
- package/node_modules/@openclaw/fs-safe/dist/root-create-input.d.ts +30 -0
- package/node_modules/@openclaw/fs-safe/dist/root-create-input.js +97 -0
- package/node_modules/@openclaw/fs-safe/dist/root-create-native.d.ts +47 -0
- package/node_modules/@openclaw/fs-safe/dist/root-create-native.js +586 -0
- package/node_modules/@openclaw/fs-safe/dist/root-directory-creation.d.ts +12 -0
- package/node_modules/@openclaw/fs-safe/dist/root-directory-creation.js +229 -0
- package/node_modules/@openclaw/fs-safe/dist/root-directory-entry.d.ts +11 -0
- package/node_modules/@openclaw/fs-safe/dist/root-directory-entry.js +31 -0
- package/node_modules/@openclaw/fs-safe/dist/root-directory-list-types.d.ts +41 -0
- package/node_modules/@openclaw/fs-safe/dist/root-directory-list-types.js +1 -0
- package/node_modules/@openclaw/fs-safe/dist/root-directory-list.d.ts +21 -0
- package/node_modules/@openclaw/fs-safe/dist/root-directory-list.js +462 -0
- package/node_modules/@openclaw/fs-safe/dist/root-directory.d.ts +22 -0
- package/node_modules/@openclaw/fs-safe/dist/root-directory.js +138 -0
- package/node_modules/@openclaw/fs-safe/dist/root-entries.d.ts +10 -0
- package/node_modules/@openclaw/fs-safe/dist/root-entries.js +61 -0
- package/node_modules/@openclaw/fs-safe/dist/root-errors.d.ts +18 -0
- package/node_modules/@openclaw/fs-safe/dist/root-errors.js +156 -0
- package/node_modules/@openclaw/fs-safe/dist/root-file-final-admission.d.ts +24 -0
- package/node_modules/@openclaw/fs-safe/dist/root-file-final-admission.js +98 -0
- package/node_modules/@openclaw/fs-safe/dist/root-file-open-batch-sync.d.ts +8 -0
- package/node_modules/@openclaw/fs-safe/dist/root-file-open-batch-sync.js +108 -0
- package/node_modules/@openclaw/fs-safe/dist/root-file.d.ts +53 -0
- package/node_modules/@openclaw/fs-safe/dist/root-file.js +216 -0
- package/node_modules/@openclaw/fs-safe/dist/root-handle-context.d.ts +4 -0
- package/node_modules/@openclaw/fs-safe/dist/root-handle-context.js +12 -0
- package/node_modules/@openclaw/fs-safe/dist/root-impl.d.ts +119 -0
- package/node_modules/@openclaw/fs-safe/dist/root-impl.js +1496 -0
- package/node_modules/@openclaw/fs-safe/dist/root-mkdir-native.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/root-mkdir-native.js +258 -0
- package/node_modules/@openclaw/fs-safe/dist/root-move-noreplace.d.ts +17 -0
- package/node_modules/@openclaw/fs-safe/dist/root-move-noreplace.js +252 -0
- package/node_modules/@openclaw/fs-safe/dist/root-native-creation-path.d.ts +32 -0
- package/node_modules/@openclaw/fs-safe/dist/root-native-creation-path.js +56 -0
- package/node_modules/@openclaw/fs-safe/dist/root-observed-path.d.ts +7 -0
- package/node_modules/@openclaw/fs-safe/dist/root-observed-path.js +88 -0
- package/node_modules/@openclaw/fs-safe/dist/root-options.d.ts +85 -0
- package/node_modules/@openclaw/fs-safe/dist/root-options.js +18 -0
- package/node_modules/@openclaw/fs-safe/dist/root-path-errors.d.ts +12 -0
- package/node_modules/@openclaw/fs-safe/dist/root-path-errors.js +22 -0
- package/node_modules/@openclaw/fs-safe/dist/root-path-existing.d.ts +16 -0
- package/node_modules/@openclaw/fs-safe/dist/root-path-existing.js +188 -0
- package/node_modules/@openclaw/fs-safe/dist/root-path-observation.d.ts +55 -0
- package/node_modules/@openclaw/fs-safe/dist/root-path-observation.js +180 -0
- package/node_modules/@openclaw/fs-safe/dist/root-path-stat.d.ts +4 -0
- package/node_modules/@openclaw/fs-safe/dist/root-path-stat.js +134 -0
- package/node_modules/@openclaw/fs-safe/dist/root-path.d.ts +53 -0
- package/node_modules/@openclaw/fs-safe/dist/root-path.js +452 -0
- package/node_modules/@openclaw/fs-safe/dist/root-paths-lexical.d.ts +12 -0
- package/node_modules/@openclaw/fs-safe/dist/root-paths-lexical.js +22 -0
- package/node_modules/@openclaw/fs-safe/dist/root-paths.d.ts +58 -0
- package/node_modules/@openclaw/fs-safe/dist/root-paths.js +291 -0
- package/node_modules/@openclaw/fs-safe/dist/root-public-types.d.ts +12 -0
- package/node_modules/@openclaw/fs-safe/dist/root-public-types.js +1 -0
- package/node_modules/@openclaw/fs-safe/dist/root-read-admission.d.ts +25 -0
- package/node_modules/@openclaw/fs-safe/dist/root-read-admission.js +108 -0
- package/node_modules/@openclaw/fs-safe/dist/root-remove-identity.d.ts +12 -0
- package/node_modules/@openclaw/fs-safe/dist/root-remove-identity.js +87 -0
- package/node_modules/@openclaw/fs-safe/dist/root-remove-native.d.ts +4 -0
- package/node_modules/@openclaw/fs-safe/dist/root-remove-native.js +390 -0
- package/node_modules/@openclaw/fs-safe/dist/root-remove-receipt.d.ts +16 -0
- package/node_modules/@openclaw/fs-safe/dist/root-remove-receipt.js +37 -0
- package/node_modules/@openclaw/fs-safe/dist/root-remove.d.ts +17 -0
- package/node_modules/@openclaw/fs-safe/dist/root-remove.js +468 -0
- package/node_modules/@openclaw/fs-safe/dist/root-symlink-policy.d.ts +13 -0
- package/node_modules/@openclaw/fs-safe/dist/root-symlink-policy.js +34 -0
- package/node_modules/@openclaw/fs-safe/dist/root-walk.d.ts +48 -0
- package/node_modules/@openclaw/fs-safe/dist/root-walk.js +236 -0
- package/node_modules/@openclaw/fs-safe/dist/root-write-admission.d.ts +65 -0
- package/node_modules/@openclaw/fs-safe/dist/root-write-admission.js +302 -0
- package/node_modules/@openclaw/fs-safe/dist/root-write-compatibility.d.ts +11 -0
- package/node_modules/@openclaw/fs-safe/dist/root-write-compatibility.js +23 -0
- package/node_modules/@openclaw/fs-safe/dist/root-write-complete-parent.d.ts +43 -0
- package/node_modules/@openclaw/fs-safe/dist/root-write-complete-parent.js +180 -0
- package/node_modules/@openclaw/fs-safe/dist/root-write-lock-binding.d.ts +14 -0
- package/node_modules/@openclaw/fs-safe/dist/root-write-lock-binding.js +162 -0
- package/node_modules/@openclaw/fs-safe/dist/root-write-mode.d.ts +7 -0
- package/node_modules/@openclaw/fs-safe/dist/root-write-mode.js +72 -0
- package/node_modules/@openclaw/fs-safe/dist/root-write-publication.d.ts +23 -0
- package/node_modules/@openclaw/fs-safe/dist/root-write-publication.js +89 -0
- package/node_modules/@openclaw/fs-safe/dist/root-write-verification.d.ts +20 -0
- package/node_modules/@openclaw/fs-safe/dist/root-write-verification.js +115 -0
- package/node_modules/@openclaw/fs-safe/dist/root.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/root.js +1 -0
- package/node_modules/@openclaw/fs-safe/dist/safe-path-segment.d.ts +11 -0
- package/node_modules/@openclaw/fs-safe/dist/safe-path-segment.js +76 -0
- package/node_modules/@openclaw/fs-safe/dist/secret-file.d.ts +30 -0
- package/node_modules/@openclaw/fs-safe/dist/secret-file.js +338 -0
- package/node_modules/@openclaw/fs-safe/dist/secret-read-async.d.ts +3 -0
- package/node_modules/@openclaw/fs-safe/dist/secret-read-async.js +58 -0
- package/node_modules/@openclaw/fs-safe/dist/secret-read-policy.d.ts +20 -0
- package/node_modules/@openclaw/fs-safe/dist/secret-read-policy.js +68 -0
- package/node_modules/@openclaw/fs-safe/dist/secret.d.ts +3 -0
- package/node_modules/@openclaw/fs-safe/dist/secret.js +3 -0
- package/node_modules/@openclaw/fs-safe/dist/secure-file-windows.d.ts +10 -0
- package/node_modules/@openclaw/fs-safe/dist/secure-file-windows.js +81 -0
- package/node_modules/@openclaw/fs-safe/dist/secure-file.d.ts +33 -0
- package/node_modules/@openclaw/fs-safe/dist/secure-file.js +304 -0
- package/node_modules/@openclaw/fs-safe/dist/secure-temp-dir.d.ts +27 -0
- package/node_modules/@openclaw/fs-safe/dist/secure-temp-dir.js +188 -0
- package/node_modules/@openclaw/fs-safe/dist/secure-temp-repair.d.ts +34 -0
- package/node_modules/@openclaw/fs-safe/dist/secure-temp-repair.js +110 -0
- package/node_modules/@openclaw/fs-safe/dist/sibling-staged-file.d.ts +20 -0
- package/node_modules/@openclaw/fs-safe/dist/sibling-staged-file.js +333 -0
- package/node_modules/@openclaw/fs-safe/dist/sibling-temp.d.ts +29 -0
- package/node_modules/@openclaw/fs-safe/dist/sibling-temp.js +136 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-acquire.d.ts +4 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-acquire.js +471 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-admission-context.d.ts +18 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-admission-context.js +60 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-admission-parser.d.ts +41 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-admission-parser.js +113 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-admission.d.ts +33 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-admission.js +1 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-handle.d.ts +20 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-handle.js +48 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-policy.d.ts +15 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-policy.js +112 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-reclaim.d.ts +64 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-reclaim.js +356 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-registration.d.ts +13 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-registration.js +47 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-retained.d.ts +14 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-retained.js +187 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-root.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-root.js +79 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-stale-admission.d.ts +34 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-stale-admission.js +230 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-target.d.ts +7 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-target.js +62 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-types.d.ts +68 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-types.js +1 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock.d.ts +13 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock.js +296 -0
- package/node_modules/@openclaw/fs-safe/dist/staged-directory.d.ts +40 -0
- package/node_modules/@openclaw/fs-safe/dist/staged-directory.js +177 -0
- package/node_modules/@openclaw/fs-safe/dist/staged-file-settlement.d.ts +17 -0
- package/node_modules/@openclaw/fs-safe/dist/staged-file-settlement.js +65 -0
- package/node_modules/@openclaw/fs-safe/dist/staged-file-types.d.ts +55 -0
- package/node_modules/@openclaw/fs-safe/dist/staged-file-types.js +1 -0
- package/node_modules/@openclaw/fs-safe/dist/staged-symlink-types.d.ts +39 -0
- package/node_modules/@openclaw/fs-safe/dist/staged-symlink-types.js +1 -0
- package/node_modules/@openclaw/fs-safe/dist/stat-observation.d.ts +10 -0
- package/node_modules/@openclaw/fs-safe/dist/stat-observation.js +57 -0
- package/node_modules/@openclaw/fs-safe/dist/store.d.ts +3 -0
- package/node_modules/@openclaw/fs-safe/dist/store.js +3 -0
- package/node_modules/@openclaw/fs-safe/dist/strict-file-identity.d.ts +7 -0
- package/node_modules/@openclaw/fs-safe/dist/strict-file-identity.js +88 -0
- package/node_modules/@openclaw/fs-safe/dist/string-coerce.d.ts +4 -0
- package/node_modules/@openclaw/fs-safe/dist/string-coerce.js +16 -0
- package/node_modules/@openclaw/fs-safe/dist/suppressed-error.d.ts +5 -0
- package/node_modules/@openclaw/fs-safe/dist/suppressed-error.js +15 -0
- package/node_modules/@openclaw/fs-safe/dist/symlink-parents.d.ts +11 -0
- package/node_modules/@openclaw/fs-safe/dist/symlink-parents.js +109 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-cleanup.d.ts +13 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-cleanup.js +81 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-directory-diagnostics.d.ts +10 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-directory-diagnostics.js +29 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-target.d.ts +31 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-target.js +251 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-admission.d.ts +14 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-admission.js +387 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-child-admission.d.ts +23 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-child-admission.js +146 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-descriptor.d.ts +50 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-descriptor.js +344 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-owner.d.ts +25 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-owner.js +489 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-ownership.d.ts +9 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-ownership.js +74 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-types.d.ts +43 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-types.js +1 -0
- package/node_modules/@openclaw/fs-safe/dist/temp.d.ts +3 -0
- package/node_modules/@openclaw/fs-safe/dist/temp.js +2 -0
- package/node_modules/@openclaw/fs-safe/dist/test-hooks.d.ts +36 -0
- package/node_modules/@openclaw/fs-safe/dist/test-hooks.js +14 -0
- package/node_modules/@openclaw/fs-safe/dist/text-atomic.d.ts +10 -0
- package/node_modules/@openclaw/fs-safe/dist/text-atomic.js +18 -0
- package/node_modules/@openclaw/fs-safe/dist/timing.d.ts +8 -0
- package/node_modules/@openclaw/fs-safe/dist/timing.js +59 -0
- package/node_modules/@openclaw/fs-safe/dist/trash.d.ts +4 -0
- package/node_modules/@openclaw/fs-safe/dist/trash.js +249 -0
- package/node_modules/@openclaw/fs-safe/dist/types.d.ts +27 -0
- package/node_modules/@openclaw/fs-safe/dist/types.js +1 -0
- package/node_modules/@openclaw/fs-safe/dist/unicode-path.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/unicode-path.js +16 -0
- package/node_modules/@openclaw/fs-safe/dist/walk.d.ts +37 -0
- package/node_modules/@openclaw/fs-safe/dist/walk.js +250 -0
- package/node_modules/@openclaw/fs-safe/dist/watch-hints.d.ts +16 -0
- package/node_modules/@openclaw/fs-safe/dist/watch-hints.js +365 -0
- package/node_modules/@openclaw/fs-safe/dist/watch-io-error.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/watch-io-error.js +27 -0
- package/node_modules/@openclaw/fs-safe/dist/watch-io-worker.d.ts +1 -0
- package/node_modules/@openclaw/fs-safe/dist/watch-io-worker.js +93 -0
- package/node_modules/@openclaw/fs-safe/dist/watch-io.d.ts +47 -0
- package/node_modules/@openclaw/fs-safe/dist/watch-io.js +236 -0
- package/node_modules/@openclaw/fs-safe/dist/watch-native.d.ts +55 -0
- package/node_modules/@openclaw/fs-safe/dist/watch-native.js +93 -0
- package/node_modules/@openclaw/fs-safe/dist/watch-probe.d.ts +16 -0
- package/node_modules/@openclaw/fs-safe/dist/watch-probe.js +135 -0
- package/node_modules/@openclaw/fs-safe/dist/watch-rescan.d.ts +6 -0
- package/node_modules/@openclaw/fs-safe/dist/watch-rescan.js +167 -0
- package/node_modules/@openclaw/fs-safe/dist/watch-scan.d.ts +45 -0
- package/node_modules/@openclaw/fs-safe/dist/watch-scan.js +385 -0
- package/node_modules/@openclaw/fs-safe/dist/watch-stream.d.ts +10 -0
- package/node_modules/@openclaw/fs-safe/dist/watch-stream.js +57 -0
- package/node_modules/@openclaw/fs-safe/dist/watch-types.d.ts +62 -0
- package/node_modules/@openclaw/fs-safe/dist/watch-types.js +1 -0
- package/node_modules/@openclaw/fs-safe/dist/watch.d.ts +5 -0
- package/node_modules/@openclaw/fs-safe/dist/watch.js +667 -0
- package/node_modules/@openclaw/fs-safe/dist/windows-appcontainer.d.ts +5 -0
- package/node_modules/@openclaw/fs-safe/dist/windows-appcontainer.js +39 -0
- package/node_modules/@openclaw/fs-safe/dist/windows-command.d.ts +1 -0
- package/node_modules/@openclaw/fs-safe/dist/windows-command.js +34 -0
- package/node_modules/@openclaw/fs-safe/dist/windows-owner.d.ts +26 -0
- package/node_modules/@openclaw/fs-safe/dist/windows-owner.js +90 -0
- package/node_modules/@openclaw/fs-safe/dist/windows-path-alias.d.ts +47 -0
- package/node_modules/@openclaw/fs-safe/dist/windows-path-alias.js +140 -0
- package/node_modules/@openclaw/fs-safe/dist/windows-path-syntax.d.ts +18 -0
- package/node_modules/@openclaw/fs-safe/dist/windows-path-syntax.js +72 -0
- package/node_modules/@openclaw/fs-safe/dist/windows-security-command.d.ts +33 -0
- package/node_modules/@openclaw/fs-safe/dist/windows-security-command.js +433 -0
- package/node_modules/@openclaw/fs-safe/dist/windows-security-facts.d.ts +10 -0
- package/node_modules/@openclaw/fs-safe/dist/windows-security-facts.js +117 -0
- package/node_modules/@openclaw/fs-safe/dist/windows-security-helper.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/windows-security-helper.exe +0 -0
- package/node_modules/@openclaw/fs-safe/dist/windows-security-helper.js +7 -0
- package/node_modules/@openclaw/fs-safe/dist/windows-test-hooks.d.ts +16 -0
- package/node_modules/@openclaw/fs-safe/dist/windows-test-hooks.js +51 -0
- package/node_modules/@openclaw/fs-safe/dist/write-file-handle.d.ts +13 -0
- package/node_modules/@openclaw/fs-safe/dist/write-file-handle.js +49 -0
- package/node_modules/@openclaw/fs-safe/dist/write-open-flags.d.ts +4 -0
- package/node_modules/@openclaw/fs-safe/dist/write-open-flags.js +27 -0
- package/node_modules/@openclaw/fs-safe/dist/write-queue.d.ts +1 -0
- package/node_modules/@openclaw/fs-safe/dist/write-queue.js +15 -0
- package/node_modules/@openclaw/fs-safe/docs/advanced.md +285 -0
- package/node_modules/@openclaw/fs-safe/docs/archive.md +879 -0
- package/node_modules/@openclaw/fs-safe/docs/assets/readme-banner.jpg +0 -0
- package/node_modules/@openclaw/fs-safe/docs/atomic.md +635 -0
- package/node_modules/@openclaw/fs-safe/docs/compiler-qualification.md +392 -0
- package/node_modules/@openclaw/fs-safe/docs/config.md +204 -0
- package/node_modules/@openclaw/fs-safe/docs/contributing.md +445 -0
- package/node_modules/@openclaw/fs-safe/docs/copy.md +357 -0
- package/node_modules/@openclaw/fs-safe/docs/creation.md +132 -0
- package/node_modules/@openclaw/fs-safe/docs/directory-identity.md +85 -0
- package/node_modules/@openclaw/fs-safe/docs/durability.md +500 -0
- package/node_modules/@openclaw/fs-safe/docs/entries.md +109 -0
- package/node_modules/@openclaw/fs-safe/docs/entry-publication.md +146 -0
- package/node_modules/@openclaw/fs-safe/docs/errors.md +316 -0
- package/node_modules/@openclaw/fs-safe/docs/file-contents.md +68 -0
- package/node_modules/@openclaw/fs-safe/docs/file-store.md +404 -0
- package/node_modules/@openclaw/fs-safe/docs/filename.md +110 -0
- package/node_modules/@openclaw/fs-safe/docs/guest.md +171 -0
- package/node_modules/@openclaw/fs-safe/docs/in-place-write.md +112 -0
- package/node_modules/@openclaw/fs-safe/docs/index.md +58 -0
- package/node_modules/@openclaw/fs-safe/docs/install-path.md +216 -0
- package/node_modules/@openclaw/fs-safe/docs/install.md +251 -0
- package/node_modules/@openclaw/fs-safe/docs/json-store.md +245 -0
- package/node_modules/@openclaw/fs-safe/docs/json.md +229 -0
- package/node_modules/@openclaw/fs-safe/docs/local-roots.md +149 -0
- package/node_modules/@openclaw/fs-safe/docs/migrating-to-0.5.md +207 -0
- package/node_modules/@openclaw/fs-safe/docs/migrating-to-0.6.md +48 -0
- package/node_modules/@openclaw/fs-safe/docs/native-helper.md +209 -0
- package/node_modules/@openclaw/fs-safe/docs/native.md +657 -0
- package/node_modules/@openclaw/fs-safe/docs/output.md +195 -0
- package/node_modules/@openclaw/fs-safe/docs/path-case.md +64 -0
- package/node_modules/@openclaw/fs-safe/docs/path-prefix.md +84 -0
- package/node_modules/@openclaw/fs-safe/docs/path-scope.md +163 -0
- package/node_modules/@openclaw/fs-safe/docs/path-suffix-aliases.md +204 -0
- package/node_modules/@openclaw/fs-safe/docs/path.md +222 -0
- package/node_modules/@openclaw/fs-safe/docs/permissions.md +428 -0
- package/node_modules/@openclaw/fs-safe/docs/pipe.md +81 -0
- package/node_modules/@openclaw/fs-safe/docs/platform-capabilities.md +63 -0
- package/node_modules/@openclaw/fs-safe/docs/positional-read.md +63 -0
- package/node_modules/@openclaw/fs-safe/docs/public-api.md +201 -0
- package/node_modules/@openclaw/fs-safe/docs/queue-link-free-design.md +237 -0
- package/node_modules/@openclaw/fs-safe/docs/quickstart.md +174 -0
- package/node_modules/@openclaw/fs-safe/docs/reading.md +256 -0
- package/node_modules/@openclaw/fs-safe/docs/regular-file.md +195 -0
- package/node_modules/@openclaw/fs-safe/docs/retained-file.md +115 -0
- package/node_modules/@openclaw/fs-safe/docs/root.md +413 -0
- package/node_modules/@openclaw/fs-safe/docs/secret-file.md +322 -0
- package/node_modules/@openclaw/fs-safe/docs/secure-file.md +112 -0
- package/node_modules/@openclaw/fs-safe/docs/security-model.md +428 -0
- package/node_modules/@openclaw/fs-safe/docs/sidecar-lock.md +659 -0
- package/node_modules/@openclaw/fs-safe/docs/staged-file.md +219 -0
- package/node_modules/@openclaw/fs-safe/docs/staged-symlink.md +124 -0
- package/node_modules/@openclaw/fs-safe/docs/store.md +144 -0
- package/node_modules/@openclaw/fs-safe/docs/temp.md +810 -0
- package/node_modules/@openclaw/fs-safe/docs/testing.md +444 -0
- package/node_modules/@openclaw/fs-safe/docs/timing.md +123 -0
- package/node_modules/@openclaw/fs-safe/docs/types.md +178 -0
- package/node_modules/@openclaw/fs-safe/docs/walk.md +314 -0
- package/node_modules/@openclaw/fs-safe/docs/watch.md +394 -0
- package/node_modules/@openclaw/fs-safe/docs/writing.md +959 -0
- package/node_modules/@openclaw/fs-safe/package.json +219 -0
- package/node_modules/@openclaw/fs-safe-linux-x64-gnu/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-linux-x64-gnu/package.json +32 -0
- package/node_modules/acpx/LICENSE +21 -0
- package/node_modules/acpx/README.md +142 -0
- package/node_modules/acpx/dist/agent-registry-CxpAF3nI.js +844 -0
- package/node_modules/acpx/dist/agent-registry-CxpAF3nI.js.map +1 -0
- package/node_modules/acpx/dist/agent-registry.d.ts +69 -0
- package/node_modules/acpx/dist/agent-registry.d.ts.map +1 -0
- package/node_modules/acpx/dist/agent-registry.js +1 -0
- package/node_modules/acpx/dist/cli-DeYZhjw6.js +187 -0
- package/node_modules/acpx/dist/cli-DeYZhjw6.js.map +1 -0
- package/node_modules/acpx/dist/cli.d.ts +9 -0
- package/node_modules/acpx/dist/cli.d.ts.map +1 -0
- package/node_modules/acpx/dist/cli.js +2573 -0
- package/node_modules/acpx/dist/cli.js.map +1 -0
- package/node_modules/acpx/dist/client-BqZW_W14.d.ts +217 -0
- package/node_modules/acpx/dist/client-BqZW_W14.d.ts.map +1 -0
- package/node_modules/acpx/dist/flows-Bxlp6H8u.js +2541 -0
- package/node_modules/acpx/dist/flows-Bxlp6H8u.js.map +1 -0
- package/node_modules/acpx/dist/flows.d.ts +344 -0
- package/node_modules/acpx/dist/flows.d.ts.map +1 -0
- package/node_modules/acpx/dist/flows.js +1 -0
- package/node_modules/acpx/dist/invocation-options-8lEkbe7g.js +349 -0
- package/node_modules/acpx/dist/invocation-options-8lEkbe7g.js.map +1 -0
- package/node_modules/acpx/dist/ipc-CQUNQ8QQ.js +5304 -0
- package/node_modules/acpx/dist/ipc-CQUNQ8QQ.js.map +1 -0
- package/node_modules/acpx/dist/output-C_T39Ap1.js +1055 -0
- package/node_modules/acpx/dist/output-C_T39Ap1.js.map +1 -0
- package/node_modules/acpx/dist/queue-owner-runtime-ucHvXJ33.js +8387 -0
- package/node_modules/acpx/dist/queue-owner-runtime-ucHvXJ33.js.map +1 -0
- package/node_modules/acpx/dist/runtime.d.ts +899 -0
- package/node_modules/acpx/dist/runtime.d.ts.map +1 -0
- package/node_modules/acpx/dist/runtime.js +2896 -0
- package/node_modules/acpx/dist/runtime.js.map +1 -0
- package/node_modules/acpx/dist/session-options-D9KL7-d8.d.ts +371 -0
- package/node_modules/acpx/dist/session-options-D9KL7-d8.d.ts.map +1 -0
- package/node_modules/acpx/dist/session-watch-D0YvKsnQ.js +75 -0
- package/node_modules/acpx/dist/session-watch-D0YvKsnQ.js.map +1 -0
- package/node_modules/acpx/dist/watch-CXy2A5VY.js +84 -0
- package/node_modules/acpx/dist/watch-CXy2A5VY.js.map +1 -0
- package/node_modules/acpx/package.json +131 -0
- package/node_modules/acpx/skills/acpx/SKILL.md +722 -0
- package/node_modules/b4a/LICENSE +201 -0
- package/node_modules/b4a/README.md +153 -0
- package/node_modules/b4a/browser.js +546 -0
- package/node_modules/b4a/index.d.ts +144 -0
- package/node_modules/b4a/index.js +193 -0
- package/node_modules/b4a/lib/ascii.js +31 -0
- package/node_modules/b4a/lib/base64.js +64 -0
- package/node_modules/b4a/lib/hex.js +51 -0
- package/node_modules/b4a/lib/latin1.js +31 -0
- package/node_modules/b4a/lib/utf16le.js +40 -0
- package/node_modules/b4a/lib/utf8.js +144 -0
- package/node_modules/b4a/package.json +54 -0
- package/node_modules/b4a/react-native.js +5 -0
- package/node_modules/b4a/runtime.d.ts +14 -0
- package/node_modules/bare-buffer/CMakeLists.txt +20 -0
- package/node_modules/bare-buffer/LICENSE +201 -0
- package/node_modules/bare-buffer/README.md +30 -0
- package/node_modules/bare-buffer/binding.c +2041 -0
- package/node_modules/bare-buffer/binding.js +1 -0
- package/node_modules/bare-buffer/global.d.ts +21 -0
- package/node_modules/bare-buffer/global.js +6 -0
- package/node_modules/bare-buffer/index.d.ts +769 -0
- package/node_modules/bare-buffer/index.js +1339 -0
- package/node_modules/bare-buffer/lib/ascii.js +36 -0
- package/node_modules/bare-buffer/lib/base64.js +25 -0
- package/node_modules/bare-buffer/lib/base64url.js +25 -0
- package/node_modules/bare-buffer/lib/checked.js +23 -0
- package/node_modules/bare-buffer/lib/constants.d.ts +7 -0
- package/node_modules/bare-buffer/lib/constants.js +3 -0
- package/node_modules/bare-buffer/lib/hex.js +20 -0
- package/node_modules/bare-buffer/lib/latin1.js +14 -0
- package/node_modules/bare-buffer/lib/utf16le.js +20 -0
- package/node_modules/bare-buffer/lib/utf8.js +18 -0
- package/node_modules/bare-buffer/package.json +59 -0
- package/node_modules/bare-buffer/prebuilds/android-arm/bare-buffer.bare +0 -0
- package/node_modules/bare-buffer/prebuilds/android-arm64/bare-buffer.bare +0 -0
- package/node_modules/bare-buffer/prebuilds/android-ia32/bare-buffer.bare +0 -0
- package/node_modules/bare-buffer/prebuilds/android-x64/bare-buffer.bare +0 -0
- package/node_modules/bare-buffer/prebuilds/darwin-arm64/bare-buffer.bare +0 -0
- package/node_modules/bare-buffer/prebuilds/darwin-x64/bare-buffer.bare +0 -0
- package/node_modules/bare-buffer/prebuilds/ios-arm64/bare-buffer.bare +0 -0
- package/node_modules/bare-buffer/prebuilds/ios-arm64-simulator/bare-buffer.bare +0 -0
- package/node_modules/bare-buffer/prebuilds/ios-x64-simulator/bare-buffer.bare +0 -0
- package/node_modules/bare-buffer/prebuilds/linux-arm64/bare-buffer.bare +0 -0
- package/node_modules/bare-buffer/prebuilds/linux-x64/bare-buffer.bare +0 -0
- package/node_modules/bare-buffer/prebuilds/win32-arm64/bare-buffer.bare +0 -0
- package/node_modules/bare-buffer/prebuilds/win32-x64/bare-buffer.bare +0 -0
- package/node_modules/bare-events/LICENSE +201 -0
- package/node_modules/bare-events/README.md +29 -0
- package/node_modules/bare-events/global.d.ts +15 -0
- package/node_modules/bare-events/global.js +5 -0
- package/node_modules/bare-events/index.d.ts +246 -0
- package/node_modules/bare-events/index.js +423 -0
- package/node_modules/bare-events/lib/errors.js +23 -0
- package/node_modules/bare-events/package.json +63 -0
- package/node_modules/bare-events/web.d.ts +108 -0
- package/node_modules/bare-events/web.js +417 -0
- package/node_modules/bare-fs/CMakeLists.txt +13 -0
- package/node_modules/bare-fs/LICENSE +201 -0
- package/node_modules/bare-fs/README.md +33 -0
- package/node_modules/bare-fs/binding.c +3055 -0
- package/node_modules/bare-fs/binding.js +1 -0
- package/node_modules/bare-fs/index.d.ts +1504 -0
- package/node_modules/bare-fs/index.js +2902 -0
- package/node_modules/bare-fs/lib/constants.d.ts +50 -0
- package/node_modules/bare-fs/lib/constants.js +49 -0
- package/node_modules/bare-fs/lib/errors.d.ts +13 -0
- package/node_modules/bare-fs/lib/errors.js +55 -0
- package/node_modules/bare-fs/lib/queue.js +29 -0
- package/node_modules/bare-fs/package.json +74 -0
- package/node_modules/bare-fs/prebuilds/android-arm/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/android-arm64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/android-ia32/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/android-x64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/darwin-arm64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/darwin-x64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/ios-arm64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/ios-arm64-simulator/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/ios-x64-simulator/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/linux-arm64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/linux-x64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/win32-arm64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/win32-x64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/promises.d.ts +480 -0
- package/node_modules/bare-fs/promises.js +119 -0
- package/node_modules/bare-path/CMakeLists.txt +13 -0
- package/node_modules/bare-path/LICENSE +201 -0
- package/node_modules/bare-path/NOTICE +28 -0
- package/node_modules/bare-path/README.md +27 -0
- package/node_modules/bare-path/binding.c +127 -0
- package/node_modules/bare-path/binding.js +1 -0
- package/node_modules/bare-path/index.d.ts +91 -0
- package/node_modules/bare-path/index.js +9 -0
- package/node_modules/bare-path/lib/constants.js +11 -0
- package/node_modules/bare-path/lib/posix.js +263 -0
- package/node_modules/bare-path/lib/shared.js +81 -0
- package/node_modules/bare-path/lib/win32.js +564 -0
- package/node_modules/bare-path/package.json +47 -0
- package/node_modules/bare-path/prebuilds/android-arm/bare-path.bare +0 -0
- package/node_modules/bare-path/prebuilds/android-arm64/bare-path.bare +0 -0
- package/node_modules/bare-path/prebuilds/android-ia32/bare-path.bare +0 -0
- package/node_modules/bare-path/prebuilds/android-x64/bare-path.bare +0 -0
- package/node_modules/bare-path/prebuilds/darwin-arm64/bare-path.bare +0 -0
- package/node_modules/bare-path/prebuilds/darwin-x64/bare-path.bare +0 -0
- package/node_modules/bare-path/prebuilds/ios-arm64/bare-path.bare +0 -0
- package/node_modules/bare-path/prebuilds/ios-arm64-simulator/bare-path.bare +0 -0
- package/node_modules/bare-path/prebuilds/ios-x64-simulator/bare-path.bare +0 -0
- package/node_modules/bare-path/prebuilds/linux-arm64/bare-path.bare +0 -0
- package/node_modules/bare-path/prebuilds/linux-x64/bare-path.bare +0 -0
- package/node_modules/bare-path/prebuilds/win32-arm64/bare-path.bare +0 -0
- package/node_modules/bare-path/prebuilds/win32-x64/bare-path.bare +0 -0
- package/node_modules/bare-stream/LICENSE +201 -0
- package/node_modules/bare-stream/README.md +354 -0
- package/node_modules/bare-stream/global.d.ts +31 -0
- package/node_modules/bare-stream/global.js +15 -0
- package/node_modules/bare-stream/index.d.ts +235 -0
- package/node_modules/bare-stream/index.js +493 -0
- package/node_modules/bare-stream/package.json +75 -0
- package/node_modules/bare-stream/promises.js +3 -0
- package/node_modules/bare-stream/web.d.ts +152 -0
- package/node_modules/bare-stream/web.js +607 -0
- package/node_modules/bare-url/CMakeLists.txt +36 -0
- package/node_modules/bare-url/LICENSE +201 -0
- package/node_modules/bare-url/README.md +37 -0
- package/node_modules/bare-url/binding.c +465 -0
- package/node_modules/bare-url/binding.js +1 -0
- package/node_modules/bare-url/global.d.ts +24 -0
- package/node_modules/bare-url/global.js +2 -0
- package/node_modules/bare-url/index.d.ts +115 -0
- package/node_modules/bare-url/index.js +734 -0
- package/node_modules/bare-url/lib/errors.d.ts +10 -0
- package/node_modules/bare-url/lib/errors.js +37 -0
- package/node_modules/bare-url/lib/url-search-params.d.ts +66 -0
- package/node_modules/bare-url/lib/url-search-params.js +291 -0
- package/node_modules/bare-url/package.json +55 -0
- package/node_modules/bare-url/prebuilds/android-arm/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/android-arm64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/android-ia32/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/android-x64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/darwin-arm64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/darwin-x64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/ios-arm64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/ios-arm64-simulator/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/ios-x64-simulator/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/linux-arm64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/linux-x64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/win32-arm64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/win32-x64/bare-url.bare +0 -0
- package/node_modules/commander/LICENSE +22 -0
- package/node_modules/commander/Readme.md +1146 -0
- package/node_modules/commander/index.js +21 -0
- package/node_modules/commander/lib/argument.js +147 -0
- package/node_modules/commander/lib/command.js +2803 -0
- package/node_modules/commander/lib/error.js +36 -0
- package/node_modules/commander/lib/help.js +735 -0
- package/node_modules/commander/lib/option.js +377 -0
- package/node_modules/commander/lib/suggestSimilar.js +99 -0
- package/node_modules/commander/package-support.json +19 -0
- package/node_modules/commander/package.json +65 -0
- package/node_modules/commander/typings/index.d.ts +1116 -0
- package/node_modules/core-util-is/LICENSE +19 -0
- package/node_modules/core-util-is/README.md +3 -0
- package/node_modules/core-util-is/lib/util.js +107 -0
- package/node_modules/core-util-is/package.json +38 -0
- package/node_modules/esbuild/LICENSE.md +21 -0
- package/node_modules/esbuild/README.md +3 -0
- package/node_modules/esbuild/bin/esbuild +223 -0
- package/node_modules/esbuild/install.js +300 -0
- package/node_modules/esbuild/lib/main.d.ts +720 -0
- package/node_modules/esbuild/lib/main.js +2536 -0
- package/node_modules/esbuild/package.json +74 -0
- package/node_modules/events-universal/LICENSE +201 -0
- package/node_modules/events-universal/README.md +17 -0
- package/node_modules/events-universal/bare.js +1 -0
- package/node_modules/events-universal/default.js +1 -0
- package/node_modules/events-universal/index.js +1 -0
- package/node_modules/events-universal/package.json +39 -0
- package/node_modules/events-universal/react-native.js +1 -0
- package/node_modules/fast-fifo/LICENSE +21 -0
- package/node_modules/fast-fifo/README.md +78 -0
- package/node_modules/fast-fifo/fixed-size.js +39 -0
- package/node_modules/fast-fifo/index.js +48 -0
- package/node_modules/fast-fifo/package.json +28 -0
- package/node_modules/fast-string-truncated-width/dist/index.d.ts +4 -0
- package/node_modules/fast-string-truncated-width/dist/index.js +111 -0
- package/node_modules/fast-string-truncated-width/dist/types.d.ts +19 -0
- package/node_modules/fast-string-truncated-width/dist/types.js +2 -0
- package/node_modules/fast-string-truncated-width/dist/utils.d.ts +4 -0
- package/node_modules/fast-string-truncated-width/dist/utils.js +20 -0
- package/node_modules/fast-string-truncated-width/license +21 -0
- package/node_modules/fast-string-truncated-width/package.json +35 -0
- package/node_modules/fast-string-truncated-width/readme.md +59 -0
- package/node_modules/fast-string-width/dist/index.d.ts +4 -0
- package/node_modules/fast-string-width/dist/index.js +14 -0
- package/node_modules/fast-string-width/license +21 -0
- package/node_modules/fast-string-width/package.json +34 -0
- package/node_modules/fast-string-width/readme.md +42 -0
- package/node_modules/fast-wrap-ansi/LICENSE +23 -0
- package/node_modules/fast-wrap-ansi/README.md +26 -0
- package/node_modules/fast-wrap-ansi/lib/main.d.ts +6 -0
- package/node_modules/fast-wrap-ansi/lib/main.js +218 -0
- package/node_modules/fast-wrap-ansi/package.json +51 -0
- package/node_modules/immediate/LICENSE.txt +20 -0
- package/node_modules/immediate/README.md +93 -0
- package/node_modules/immediate/dist/immediate.js +75 -0
- package/node_modules/immediate/dist/immediate.min.js +1 -0
- package/node_modules/immediate/lib/browser.js +69 -0
- package/node_modules/immediate/lib/index.js +73 -0
- package/node_modules/immediate/package.json +42 -0
- package/node_modules/inherits/LICENSE +16 -0
- package/node_modules/inherits/README.md +42 -0
- package/node_modules/inherits/inherits.js +9 -0
- package/node_modules/inherits/inherits_browser.js +27 -0
- package/node_modules/inherits/package.json +29 -0
- package/node_modules/isarray/.npmignore +1 -0
- package/node_modules/isarray/.travis.yml +4 -0
- package/node_modules/isarray/Makefile +6 -0
- package/node_modules/isarray/README.md +60 -0
- package/node_modules/isarray/component.json +19 -0
- package/node_modules/isarray/index.js +5 -0
- package/node_modules/isarray/package.json +45 -0
- package/node_modules/isarray/test.js +20 -0
- package/node_modules/jszip/.codeclimate.yml +16 -0
- package/node_modules/jszip/.editorconfig +8 -0
- package/node_modules/jszip/.eslintrc.js +43 -0
- package/node_modules/jszip/.github/FUNDING.yml +1 -0
- package/node_modules/jszip/.github/actions/setup/action.yml +23 -0
- package/node_modules/jszip/.github/workflows/benchmark.yml +38 -0
- package/node_modules/jszip/.github/workflows/main.yml +55 -0
- package/node_modules/jszip/CHANGES.md +210 -0
- package/node_modules/jszip/LICENSE.markdown +651 -0
- package/node_modules/jszip/README.markdown +33 -0
- package/node_modules/jszip/dist/jszip.js +11586 -0
- package/node_modules/jszip/dist/jszip.min.js +13 -0
- package/node_modules/jszip/index.d.ts +344 -0
- package/node_modules/jszip/lib/base64.js +106 -0
- package/node_modules/jszip/lib/compressedObject.js +74 -0
- package/node_modules/jszip/lib/compressions.js +14 -0
- package/node_modules/jszip/lib/crc32.js +77 -0
- package/node_modules/jszip/lib/defaults.js +11 -0
- package/node_modules/jszip/lib/external.js +18 -0
- package/node_modules/jszip/lib/flate.js +85 -0
- package/node_modules/jszip/lib/generate/ZipFileWorker.js +539 -0
- package/node_modules/jszip/lib/generate/index.js +57 -0
- package/node_modules/jszip/lib/index.js +55 -0
- package/node_modules/jszip/lib/license_header.js +11 -0
- package/node_modules/jszip/lib/load.js +88 -0
- package/node_modules/jszip/lib/nodejs/NodejsStreamInputAdapter.js +74 -0
- package/node_modules/jszip/lib/nodejs/NodejsStreamOutputAdapter.js +42 -0
- package/node_modules/jszip/lib/nodejsUtils.js +57 -0
- package/node_modules/jszip/lib/object.js +384 -0
- package/node_modules/jszip/lib/readable-stream-browser.js +10 -0
- package/node_modules/jszip/lib/reader/ArrayReader.js +57 -0
- package/node_modules/jszip/lib/reader/DataReader.js +116 -0
- package/node_modules/jszip/lib/reader/NodeBufferReader.js +19 -0
- package/node_modules/jszip/lib/reader/StringReader.js +38 -0
- package/node_modules/jszip/lib/reader/Uint8ArrayReader.js +22 -0
- package/node_modules/jszip/lib/reader/readerFor.js +28 -0
- package/node_modules/jszip/lib/signature.js +7 -0
- package/node_modules/jszip/lib/stream/ConvertWorker.js +26 -0
- package/node_modules/jszip/lib/stream/Crc32Probe.js +24 -0
- package/node_modules/jszip/lib/stream/DataLengthProbe.js +29 -0
- package/node_modules/jszip/lib/stream/DataWorker.js +116 -0
- package/node_modules/jszip/lib/stream/GenericWorker.js +263 -0
- package/node_modules/jszip/lib/stream/StreamHelper.js +214 -0
- package/node_modules/jszip/lib/support.js +38 -0
- package/node_modules/jszip/lib/utf8.js +275 -0
- package/node_modules/jszip/lib/utils.js +510 -0
- package/node_modules/jszip/lib/zipEntries.js +261 -0
- package/node_modules/jszip/lib/zipEntry.js +293 -0
- package/node_modules/jszip/lib/zipObject.js +133 -0
- package/node_modules/jszip/package.json +67 -0
- package/node_modules/jszip/sponsors.md +21 -0
- package/node_modules/jszip/tsconfig.json +101 -0
- package/node_modules/jszip/vendor/FileSaver.js +247 -0
- package/node_modules/lie/README.md +62 -0
- package/node_modules/lie/dist/lie.js +350 -0
- package/node_modules/lie/dist/lie.min.js +1 -0
- package/node_modules/lie/dist/lie.polyfill.js +358 -0
- package/node_modules/lie/dist/lie.polyfill.min.js +1 -0
- package/node_modules/lie/lib/browser.js +273 -0
- package/node_modules/lie/lib/index.js +298 -0
- package/node_modules/lie/license.md +7 -0
- package/node_modules/lie/lie.d.ts +244 -0
- package/node_modules/lie/package.json +69 -0
- package/node_modules/lie/polyfill.js +4 -0
- package/node_modules/pako/LICENSE +21 -0
- package/node_modules/pako/README.md +191 -0
- package/node_modules/pako/dist/pako.js +6818 -0
- package/node_modules/pako/dist/pako.min.js +1 -0
- package/node_modules/pako/dist/pako_deflate.js +3997 -0
- package/node_modules/pako/dist/pako_deflate.min.js +1 -0
- package/node_modules/pako/dist/pako_inflate.js +3300 -0
- package/node_modules/pako/dist/pako_inflate.min.js +1 -0
- package/node_modules/pako/index.js +14 -0
- package/node_modules/pako/lib/deflate.js +400 -0
- package/node_modules/pako/lib/inflate.js +423 -0
- package/node_modules/pako/lib/utils/common.js +105 -0
- package/node_modules/pako/lib/utils/strings.js +187 -0
- package/node_modules/pako/lib/zlib/README +59 -0
- package/node_modules/pako/lib/zlib/adler32.js +51 -0
- package/node_modules/pako/lib/zlib/constants.js +68 -0
- package/node_modules/pako/lib/zlib/crc32.js +59 -0
- package/node_modules/pako/lib/zlib/deflate.js +1874 -0
- package/node_modules/pako/lib/zlib/gzheader.js +58 -0
- package/node_modules/pako/lib/zlib/inffast.js +345 -0
- package/node_modules/pako/lib/zlib/inflate.js +1556 -0
- package/node_modules/pako/lib/zlib/inftrees.js +343 -0
- package/node_modules/pako/lib/zlib/messages.js +32 -0
- package/node_modules/pako/lib/zlib/trees.js +1222 -0
- package/node_modules/pako/lib/zlib/zstream.js +47 -0
- package/node_modules/pako/package.json +44 -0
- package/node_modules/process-nextick-args/index.js +45 -0
- package/node_modules/process-nextick-args/license.md +19 -0
- package/node_modules/process-nextick-args/package.json +25 -0
- package/node_modules/process-nextick-args/readme.md +18 -0
- package/node_modules/readable-stream/.travis.yml +34 -0
- package/node_modules/readable-stream/CONTRIBUTING.md +38 -0
- package/node_modules/readable-stream/GOVERNANCE.md +136 -0
- package/node_modules/readable-stream/LICENSE +47 -0
- package/node_modules/readable-stream/README.md +58 -0
- package/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +60 -0
- package/node_modules/readable-stream/duplex-browser.js +1 -0
- package/node_modules/readable-stream/duplex.js +1 -0
- package/node_modules/readable-stream/lib/_stream_duplex.js +131 -0
- package/node_modules/readable-stream/lib/_stream_passthrough.js +47 -0
- package/node_modules/readable-stream/lib/_stream_readable.js +1019 -0
- package/node_modules/readable-stream/lib/_stream_transform.js +214 -0
- package/node_modules/readable-stream/lib/_stream_writable.js +685 -0
- package/node_modules/readable-stream/lib/internal/streams/BufferList.js +78 -0
- package/node_modules/readable-stream/lib/internal/streams/destroy.js +84 -0
- package/node_modules/readable-stream/lib/internal/streams/stream-browser.js +1 -0
- package/node_modules/readable-stream/lib/internal/streams/stream.js +1 -0
- package/node_modules/readable-stream/package.json +52 -0
- package/node_modules/readable-stream/passthrough.js +1 -0
- package/node_modules/readable-stream/readable-browser.js +7 -0
- package/node_modules/readable-stream/readable.js +19 -0
- package/node_modules/readable-stream/transform.js +1 -0
- package/node_modules/readable-stream/writable-browser.js +1 -0
- package/node_modules/readable-stream/writable.js +8 -0
- package/node_modules/safe-buffer/LICENSE +21 -0
- package/node_modules/safe-buffer/README.md +584 -0
- package/node_modules/safe-buffer/index.d.ts +187 -0
- package/node_modules/safe-buffer/index.js +62 -0
- package/node_modules/safe-buffer/package.json +37 -0
- package/node_modules/setimmediate/LICENSE.txt +20 -0
- package/node_modules/setimmediate/package.json +30 -0
- package/node_modules/setimmediate/setImmediate.js +186 -0
- package/node_modules/sisteransi/dist/index.d.ts +33 -0
- package/node_modules/sisteransi/dist/index.js +57 -0
- package/node_modules/sisteransi/license +21 -0
- package/node_modules/sisteransi/package.json +45 -0
- package/node_modules/sisteransi/readme.md +126 -0
- package/node_modules/skillflag/LICENSE +21 -0
- package/node_modules/skillflag/README.md +44 -0
- package/node_modules/skillflag/dist/bin/skill-install.d.ts +3 -0
- package/node_modules/skillflag/dist/bin/skill-install.d.ts.map +1 -0
- package/node_modules/skillflag/dist/bin/skill-install.js +6 -0
- package/node_modules/skillflag/dist/bin/skill-install.js.map +1 -0
- package/node_modules/skillflag/dist/bin/skillflag.d.ts +3 -0
- package/node_modules/skillflag/dist/bin/skillflag.d.ts.map +1 -0
- package/node_modules/skillflag/dist/bin/skillflag.js +25 -0
- package/node_modules/skillflag/dist/bin/skillflag.js.map +1 -0
- package/node_modules/skillflag/dist/core/digest.d.ts +2 -0
- package/node_modules/skillflag/dist/core/digest.d.ts.map +1 -0
- package/node_modules/skillflag/dist/core/digest.js +15 -0
- package/node_modules/skillflag/dist/core/digest.js.map +1 -0
- package/node_modules/skillflag/dist/core/errors.d.ts +6 -0
- package/node_modules/skillflag/dist/core/errors.d.ts.map +1 -0
- package/node_modules/skillflag/dist/core/errors.js +13 -0
- package/node_modules/skillflag/dist/core/errors.js.map +1 -0
- package/node_modules/skillflag/dist/core/export.d.ts +2 -0
- package/node_modules/skillflag/dist/core/export.d.ts.map +1 -0
- package/node_modules/skillflag/dist/core/export.js +28 -0
- package/node_modules/skillflag/dist/core/export.js.map +1 -0
- package/node_modules/skillflag/dist/core/list.d.ts +21 -0
- package/node_modules/skillflag/dist/core/list.d.ts.map +1 -0
- package/node_modules/skillflag/dist/core/list.js +71 -0
- package/node_modules/skillflag/dist/core/list.js.map +1 -0
- package/node_modules/skillflag/dist/core/paths.d.ts +15 -0
- package/node_modules/skillflag/dist/core/paths.d.ts.map +1 -0
- package/node_modules/skillflag/dist/core/paths.js +149 -0
- package/node_modules/skillflag/dist/core/paths.js.map +1 -0
- package/node_modules/skillflag/dist/core/show.d.ts +2 -0
- package/node_modules/skillflag/dist/core/show.d.ts.map +1 -0
- package/node_modules/skillflag/dist/core/show.js +8 -0
- package/node_modules/skillflag/dist/core/show.js.map +1 -0
- package/node_modules/skillflag/dist/core/skillflag.d.ts +3 -0
- package/node_modules/skillflag/dist/core/skillflag.d.ts.map +1 -0
- package/node_modules/skillflag/dist/core/skillflag.js +2 -0
- package/node_modules/skillflag/dist/core/skillflag.js.map +1 -0
- package/node_modules/skillflag/dist/core/tar.d.ts +16 -0
- package/node_modules/skillflag/dist/core/tar.d.ts.map +1 -0
- package/node_modules/skillflag/dist/core/tar.js +140 -0
- package/node_modules/skillflag/dist/core/tar.js.map +1 -0
- package/node_modules/skillflag/dist/index.d.ts +5 -0
- package/node_modules/skillflag/dist/index.d.ts.map +1 -0
- package/node_modules/skillflag/dist/index.js +3 -0
- package/node_modules/skillflag/dist/index.js.map +1 -0
- package/node_modules/skillflag/dist/install/cli.d.ts +57 -0
- package/node_modules/skillflag/dist/install/cli.d.ts.map +1 -0
- package/node_modules/skillflag/dist/install/cli.js +653 -0
- package/node_modules/skillflag/dist/install/cli.js.map +1 -0
- package/node_modules/skillflag/dist/install/copy.d.ts +2 -0
- package/node_modules/skillflag/dist/install/copy.d.ts.map +1 -0
- package/node_modules/skillflag/dist/install/copy.js +19 -0
- package/node_modules/skillflag/dist/install/copy.js.map +1 -0
- package/node_modules/skillflag/dist/install/errors.d.ts +6 -0
- package/node_modules/skillflag/dist/install/errors.d.ts.map +1 -0
- package/node_modules/skillflag/dist/install/errors.js +13 -0
- package/node_modules/skillflag/dist/install/errors.js.map +1 -0
- package/node_modules/skillflag/dist/install/extract.d.ts +3 -0
- package/node_modules/skillflag/dist/install/extract.d.ts.map +1 -0
- package/node_modules/skillflag/dist/install/extract.js +76 -0
- package/node_modules/skillflag/dist/install/extract.js.map +1 -0
- package/node_modules/skillflag/dist/install/install.d.ts +21 -0
- package/node_modules/skillflag/dist/install/install.d.ts.map +1 -0
- package/node_modules/skillflag/dist/install/install.js +35 -0
- package/node_modules/skillflag/dist/install/install.js.map +1 -0
- package/node_modules/skillflag/dist/install/resolve.d.ts +12 -0
- package/node_modules/skillflag/dist/install/resolve.d.ts.map +1 -0
- package/node_modules/skillflag/dist/install/resolve.js +119 -0
- package/node_modules/skillflag/dist/install/resolve.js.map +1 -0
- package/node_modules/skillflag/dist/install/validate.d.ts +7 -0
- package/node_modules/skillflag/dist/install/validate.d.ts.map +1 -0
- package/node_modules/skillflag/dist/install/validate.js +28 -0
- package/node_modules/skillflag/dist/install/validate.js.map +1 -0
- package/node_modules/skillflag/dist/shared/frontmatter.d.ts +2 -0
- package/node_modules/skillflag/dist/shared/frontmatter.d.ts.map +1 -0
- package/node_modules/skillflag/dist/shared/frontmatter.js +28 -0
- package/node_modules/skillflag/dist/shared/frontmatter.js.map +1 -0
- package/node_modules/skillflag/dist/skillflag.d.ts +29 -0
- package/node_modules/skillflag/dist/skillflag.d.ts.map +1 -0
- package/node_modules/skillflag/dist/skillflag.js +230 -0
- package/node_modules/skillflag/dist/skillflag.js.map +1 -0
- package/node_modules/skillflag/dist/utils/collections.d.ts +3 -0
- package/node_modules/skillflag/dist/utils/collections.d.ts.map +1 -0
- package/node_modules/skillflag/dist/utils/collections.js +18 -0
- package/node_modules/skillflag/dist/utils/collections.js.map +1 -0
- package/node_modules/skillflag/package.json +78 -0
- package/node_modules/skillflag/skills/skillflag/SKILL.md +144 -0
- package/node_modules/streamx/LICENSE +21 -0
- package/node_modules/streamx/README.md +550 -0
- package/node_modules/streamx/index.d.ts +198 -0
- package/node_modules/streamx/index.js +1314 -0
- package/node_modules/streamx/lib/errors.d.ts +13 -0
- package/node_modules/streamx/lib/errors.js +47 -0
- package/node_modules/streamx/package.json +51 -0
- package/node_modules/streamx/runtime.d.ts +55 -0
- package/node_modules/string_decoder/.travis.yml +50 -0
- package/node_modules/string_decoder/LICENSE +48 -0
- package/node_modules/string_decoder/README.md +47 -0
- package/node_modules/string_decoder/lib/string_decoder.js +296 -0
- package/node_modules/string_decoder/package.json +31 -0
- package/node_modules/tar-stream/LICENSE +21 -0
- package/node_modules/tar-stream/README.md +183 -0
- package/node_modules/tar-stream/constants.js +14 -0
- package/node_modules/tar-stream/extract.js +439 -0
- package/node_modules/tar-stream/headers.js +322 -0
- package/node_modules/tar-stream/index.d.ts +60 -0
- package/node_modules/tar-stream/index.js +2 -0
- package/node_modules/tar-stream/pack.js +287 -0
- package/node_modules/tar-stream/package.json +50 -0
- package/node_modules/teex/LICENSE +21 -0
- package/node_modules/teex/README.md +31 -0
- package/node_modules/teex/example.js +16 -0
- package/node_modules/teex/index.js +52 -0
- package/node_modules/teex/package.json +26 -0
- package/node_modules/teex/test.js +68 -0
- package/node_modules/text-decoder/LICENSE +201 -0
- package/node_modules/text-decoder/README.md +36 -0
- package/node_modules/text-decoder/index.js +64 -0
- package/node_modules/text-decoder/lib/pass-through-decoder.js +19 -0
- package/node_modules/text-decoder/lib/utf8-decoder.js +185 -0
- package/node_modules/text-decoder/package.json +39 -0
- package/node_modules/tsx/LICENSE +21 -0
- package/node_modules/tsx/README.md +32 -0
- package/node_modules/tsx/dist/cjs/api/index.cjs +2 -0
- package/node_modules/tsx/dist/cjs/api/index.d.cts +35 -0
- package/node_modules/tsx/dist/cjs/api/index.d.mts +35 -0
- package/node_modules/tsx/dist/cjs/api/index.mjs +2 -0
- package/node_modules/tsx/dist/cjs/index.cjs +1 -0
- package/node_modules/tsx/dist/cli.mjs +55 -0
- package/node_modules/tsx/dist/client-XItNFmsq.cjs +1 -0
- package/node_modules/tsx/dist/esm/api/index.cjs +2 -0
- package/node_modules/tsx/dist/esm/api/index.d.cts +37 -0
- package/node_modules/tsx/dist/esm/api/index.d.mts +37 -0
- package/node_modules/tsx/dist/esm/api/index.mjs +2 -0
- package/node_modules/tsx/dist/esm/index.mjs +2 -0
- package/node_modules/tsx/dist/index-Bqjv9TxC.mjs +1 -0
- package/node_modules/tsx/dist/index-DE3OBZuV.mjs +14 -0
- package/node_modules/tsx/dist/lexer-CGfpMDSb.cjs +3 -0
- package/node_modules/tsx/dist/lexer-CanA6ArK.mjs +3 -0
- package/node_modules/tsx/dist/loader.mjs +2 -0
- package/node_modules/tsx/dist/package-Dj0mHsMt.mjs +1 -0
- package/node_modules/tsx/dist/patch-repl.cjs +1 -0
- package/node_modules/tsx/dist/preflight.cjs +1 -0
- package/node_modules/tsx/dist/register-B1c7OH6V.cjs +23 -0
- package/node_modules/tsx/dist/register-nyXW-TH3.mjs +2 -0
- package/node_modules/tsx/dist/repl.mjs +4 -0
- package/node_modules/tsx/dist/require-CBjy4Foe.mjs +10 -0
- package/node_modules/tsx/dist/require-CVaYn9z3.cjs +1 -0
- package/node_modules/tsx/dist/suppress-warnings.cjs +1 -0
- package/node_modules/tsx/dist/temporary-directory-Du7LpLp9.mjs +1 -0
- package/node_modules/tsx/package.json +70 -0
- package/node_modules/util-deprecate/History.md +16 -0
- package/node_modules/util-deprecate/LICENSE +24 -0
- package/node_modules/util-deprecate/README.md +53 -0
- package/node_modules/util-deprecate/browser.js +67 -0
- package/node_modules/util-deprecate/node.js +6 -0
- package/node_modules/util-deprecate/package.json +27 -0
- package/node_modules/zod/LICENSE +21 -0
- package/node_modules/zod/README.md +218 -0
- package/node_modules/zod/compile.cjs +96 -0
- package/node_modules/zod/compile.d.cts +1 -0
- package/node_modules/zod/compile.d.ts +1 -0
- package/node_modules/zod/compile.js +52 -0
- package/node_modules/zod/index.cjs +52 -0
- package/node_modules/zod/index.d.cts +3 -0
- package/node_modules/zod/index.d.ts +3 -0
- package/node_modules/zod/index.js +7 -0
- package/node_modules/zod/locales/index.cjs +36 -0
- package/node_modules/zod/locales/index.d.cts +1 -0
- package/node_modules/zod/locales/index.d.ts +1 -0
- package/node_modules/zod/locales/index.js +1 -0
- package/node_modules/zod/locales/package.json +7 -0
- package/node_modules/zod/mini/index.cjs +51 -0
- package/node_modules/zod/mini/index.d.cts +3 -0
- package/node_modules/zod/mini/index.d.ts +3 -0
- package/node_modules/zod/mini/index.js +3 -0
- package/node_modules/zod/mini/package.json +7 -0
- package/node_modules/zod/package.json +147 -0
- package/node_modules/zod/src/compile.ts +56 -0
- package/node_modules/zod/src/index.ts +7 -0
- package/node_modules/zod/src/locales/index.ts +1 -0
- package/node_modules/zod/src/mini/index.ts +3 -0
- package/node_modules/zod/src/v3/ZodError.ts +340 -0
- package/node_modules/zod/src/v3/benchmarks/datetime.ts +58 -0
- package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +80 -0
- package/node_modules/zod/src/v3/benchmarks/index.ts +59 -0
- package/node_modules/zod/src/v3/benchmarks/ipv4.ts +57 -0
- package/node_modules/zod/src/v3/benchmarks/object.ts +69 -0
- package/node_modules/zod/src/v3/benchmarks/primitives.ts +162 -0
- package/node_modules/zod/src/v3/benchmarks/realworld.ts +63 -0
- package/node_modules/zod/src/v3/benchmarks/string.ts +55 -0
- package/node_modules/zod/src/v3/benchmarks/union.ts +80 -0
- package/node_modules/zod/src/v3/errors.ts +13 -0
- package/node_modules/zod/src/v3/external.ts +6 -0
- package/node_modules/zod/src/v3/helpers/enumUtil.ts +17 -0
- package/node_modules/zod/src/v3/helpers/errorUtil.ts +8 -0
- package/node_modules/zod/src/v3/helpers/parseUtil.ts +176 -0
- package/node_modules/zod/src/v3/helpers/partialUtil.ts +34 -0
- package/node_modules/zod/src/v3/helpers/typeAliases.ts +2 -0
- package/node_modules/zod/src/v3/helpers/util.ts +224 -0
- package/node_modules/zod/src/v3/index.ts +4 -0
- package/node_modules/zod/src/v3/locales/en.ts +124 -0
- package/node_modules/zod/src/v3/standard-schema.ts +113 -0
- package/node_modules/zod/src/v3/tests/Mocker.ts +54 -0
- package/node_modules/zod/src/v3/tests/all-errors.test.ts +157 -0
- package/node_modules/zod/src/v3/tests/anyunknown.test.ts +28 -0
- package/node_modules/zod/src/v3/tests/array.test.ts +71 -0
- package/node_modules/zod/src/v3/tests/async-parsing.test.ts +388 -0
- package/node_modules/zod/src/v3/tests/async-refinements.test.ts +46 -0
- package/node_modules/zod/src/v3/tests/base.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/bigint.test.ts +55 -0
- package/node_modules/zod/src/v3/tests/branded.test.ts +53 -0
- package/node_modules/zod/src/v3/tests/catch.test.ts +220 -0
- package/node_modules/zod/src/v3/tests/coerce.test.ts +133 -0
- package/node_modules/zod/src/v3/tests/complex.test.ts +70 -0
- package/node_modules/zod/src/v3/tests/custom.test.ts +31 -0
- package/node_modules/zod/src/v3/tests/date.test.ts +32 -0
- package/node_modules/zod/src/v3/tests/deepmasking.test.ts +186 -0
- package/node_modules/zod/src/v3/tests/default.test.ts +112 -0
- package/node_modules/zod/src/v3/tests/description.test.ts +33 -0
- package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +315 -0
- package/node_modules/zod/src/v3/tests/enum.test.ts +80 -0
- package/node_modules/zod/src/v3/tests/error.test.ts +586 -0
- package/node_modules/zod/src/v3/tests/firstparty.test.ts +87 -0
- package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +21 -0
- package/node_modules/zod/src/v3/tests/function.test.ts +261 -0
- package/node_modules/zod/src/v3/tests/generics.test.ts +48 -0
- package/node_modules/zod/src/v3/tests/instanceof.test.ts +37 -0
- package/node_modules/zod/src/v3/tests/intersection.test.ts +128 -0
- package/node_modules/zod/src/v3/tests/language-server.source.ts +76 -0
- package/node_modules/zod/src/v3/tests/language-server.test.ts +206 -0
- package/node_modules/zod/src/v3/tests/literal.test.ts +36 -0
- package/node_modules/zod/src/v3/tests/map.test.ts +110 -0
- package/node_modules/zod/src/v3/tests/masking.test.ts +4 -0
- package/node_modules/zod/src/v3/tests/mocker.test.ts +19 -0
- package/node_modules/zod/src/v3/tests/nan.test.ts +24 -0
- package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +87 -0
- package/node_modules/zod/src/v3/tests/nullable.test.ts +42 -0
- package/node_modules/zod/src/v3/tests/number.test.ts +176 -0
- package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/object.test.ts +431 -0
- package/node_modules/zod/src/v3/tests/optional.test.ts +42 -0
- package/node_modules/zod/src/v3/tests/parseUtil.test.ts +23 -0
- package/node_modules/zod/src/v3/tests/parser.test.ts +41 -0
- package/node_modules/zod/src/v3/tests/partials.test.ts +243 -0
- package/node_modules/zod/src/v3/tests/pickomit.test.ts +111 -0
- package/node_modules/zod/src/v3/tests/pipeline.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/preprocess.test.ts +186 -0
- package/node_modules/zod/src/v3/tests/primitive.test.ts +440 -0
- package/node_modules/zod/src/v3/tests/promise.test.ts +90 -0
- package/node_modules/zod/src/v3/tests/readonly.test.ts +114 -0
- package/node_modules/zod/src/v3/tests/record.test.ts +171 -0
- package/node_modules/zod/src/v3/tests/recursive.test.ts +197 -0
- package/node_modules/zod/src/v3/tests/refine.test.ts +313 -0
- package/node_modules/zod/src/v3/tests/safeparse.test.ts +27 -0
- package/node_modules/zod/src/v3/tests/set.test.ts +142 -0
- package/node_modules/zod/src/v3/tests/standard-schema.test.ts +83 -0
- package/node_modules/zod/src/v3/tests/string.test.ts +922 -0
- package/node_modules/zod/src/v3/tests/transformer.test.ts +233 -0
- package/node_modules/zod/src/v3/tests/tuple.test.ts +90 -0
- package/node_modules/zod/src/v3/tests/unions.test.ts +57 -0
- package/node_modules/zod/src/v3/tests/validations.test.ts +133 -0
- package/node_modules/zod/src/v3/tests/void.test.ts +15 -0
- package/node_modules/zod/src/v3/types.ts +5138 -0
- package/node_modules/zod/src/v4/classic/checks.ts +33 -0
- package/node_modules/zod/src/v4/classic/coerce.ts +27 -0
- package/node_modules/zod/src/v4/classic/compat.ts +78 -0
- package/node_modules/zod/src/v4/classic/deep-partial.ts +76 -0
- package/node_modules/zod/src/v4/classic/errors.ts +97 -0
- package/node_modules/zod/src/v4/classic/external.ts +57 -0
- package/node_modules/zod/src/v4/classic/from-json-schema.ts +944 -0
- package/node_modules/zod/src/v4/classic/in-out.ts +45 -0
- package/node_modules/zod/src/v4/classic/index.ts +5 -0
- package/node_modules/zod/src/v4/classic/iso.ts +20 -0
- package/node_modules/zod/src/v4/classic/parse.ts +88 -0
- package/node_modules/zod/src/v4/classic/schemas.ts +2937 -0
- package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +26 -0
- package/node_modules/zod/src/v4/classic/tests/apply.test.ts +86 -0
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +291 -0
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +402 -0
- package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +381 -0
- package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +68 -0
- package/node_modules/zod/src/v4/classic/tests/base.test.ts +7 -0
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +89 -0
- package/node_modules/zod/src/v4/classic/tests/brand.test.ts +106 -0
- package/node_modules/zod/src/v4/classic/tests/catch.test.ts +604 -0
- package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +20 -0
- package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +572 -0
- package/node_modules/zod/src/v4/classic/tests/codec.test.ts +704 -0
- package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +160 -0
- package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +374 -0
- package/node_modules/zod/src/v4/classic/tests/credit-card.test.ts +76 -0
- package/node_modules/zod/src/v4/classic/tests/custom.test.ts +40 -0
- package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +985 -0
- package/node_modules/zod/src/v4/classic/tests/date.test.ts +92 -0
- package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +316 -0
- package/node_modules/zod/src/v4/classic/tests/deep-partial.test.ts +380 -0
- package/node_modules/zod/src/v4/classic/tests/default-locale.test.ts +32 -0
- package/node_modules/zod/src/v4/classic/tests/default.test.ts +455 -0
- package/node_modules/zod/src/v4/classic/tests/describe-meta-checks.test.ts +27 -0
- package/node_modules/zod/src/v4/classic/tests/description.test.ts +32 -0
- package/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +221 -0
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +942 -0
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +305 -0
- package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +917 -0
- package/node_modules/zod/src/v4/classic/tests/error.test.ts +1108 -0
- package/node_modules/zod/src/v4/classic/tests/file.test.ts +96 -0
- package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +179 -0
- package/node_modules/zod/src/v4/classic/tests/fix-json-issue.test.ts +26 -0
- package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +1467 -0
- package/node_modules/zod/src/v4/classic/tests/function.test.ts +391 -0
- package/node_modules/zod/src/v4/classic/tests/generics.test.ts +72 -0
- package/node_modules/zod/src/v4/classic/tests/global-config.test.ts +32 -0
- package/node_modules/zod/src/v4/classic/tests/hash.test.ts +67 -0
- package/node_modules/zod/src/v4/classic/tests/iban.test.ts +81 -0
- package/node_modules/zod/src/v4/classic/tests/in-out.test.ts +159 -0
- package/node_modules/zod/src/v4/classic/tests/index.test.ts +958 -0
- package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +319 -0
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +127 -0
- package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +334 -0
- package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +215 -0
- package/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +39 -0
- package/node_modules/zod/src/v4/classic/tests/json.test.ts +109 -0
- package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +262 -0
- package/node_modules/zod/src/v4/classic/tests/literal.test.ts +128 -0
- package/node_modules/zod/src/v4/classic/tests/locales_ka.test.ts +29 -0
- package/node_modules/zod/src/v4/classic/tests/locales_ro.test.ts +24 -0
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +349 -0
- package/node_modules/zod/src/v4/classic/tests/nan.test.ts +21 -0
- package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +168 -0
- package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +101 -0
- package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +22 -0
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +401 -0
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +1006 -0
- package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +235 -0
- package/node_modules/zod/src/v4/classic/tests/optional.test.ts +366 -0
- package/node_modules/zod/src/v4/classic/tests/partial.test.ts +497 -0
- package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +211 -0
- package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +101 -0
- package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +144 -0
- package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +44 -0
- package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +351 -0
- package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +175 -0
- package/node_modules/zod/src/v4/classic/tests/promise.test.ts +81 -0
- package/node_modules/zod/src/v4/classic/tests/properties.test.ts +141 -0
- package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +23 -0
- package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +184 -0
- package/node_modules/zod/src/v4/classic/tests/record.test.ts +885 -0
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +707 -0
- package/node_modules/zod/src/v4/classic/tests/redos.test.ts +68 -0
- package/node_modules/zod/src/v4/classic/tests/refine.test.ts +693 -0
- package/node_modules/zod/src/v4/classic/tests/registries.test.ts +243 -0
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +196 -0
- package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +153 -0
- package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +125 -0
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +1440 -0
- package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +124 -0
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +812 -0
- package/node_modules/zod/src/v4/classic/tests/to-json-schema-methods.test.ts +438 -0
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +4733 -0
- package/node_modules/zod/src/v4/classic/tests/transform.test.ts +378 -0
- package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +511 -0
- package/node_modules/zod/src/v4/classic/tests/union.test.ts +310 -0
- package/node_modules/zod/src/v4/classic/tests/url.test.ts +13 -0
- package/node_modules/zod/src/v4/classic/tests/validate.test.ts +645 -0
- package/node_modules/zod/src/v4/classic/tests/validations.test.ts +283 -0
- package/node_modules/zod/src/v4/classic/tests/void.test.ts +12 -0
- package/node_modules/zod/src/v4/core/api.ts +1875 -0
- package/node_modules/zod/src/v4/core/checks.ts +1266 -0
- package/node_modules/zod/src/v4/core/compile.ts +2322 -0
- package/node_modules/zod/src/v4/core/core.ts +230 -0
- package/node_modules/zod/src/v4/core/doc.ts +52 -0
- package/node_modules/zod/src/v4/core/errors.ts +543 -0
- package/node_modules/zod/src/v4/core/index.ts +19 -0
- package/node_modules/zod/src/v4/core/json-schema-generator.ts +131 -0
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +934 -0
- package/node_modules/zod/src/v4/core/json-schema.ts +148 -0
- package/node_modules/zod/src/v4/core/memoizer.ts +331 -0
- package/node_modules/zod/src/v4/core/parse.ts +309 -0
- package/node_modules/zod/src/v4/core/regexes.ts +217 -0
- package/node_modules/zod/src/v4/core/registries.ts +105 -0
- package/node_modules/zod/src/v4/core/schemas.ts +5226 -0
- package/node_modules/zod/src/v4/core/standard-schema.ts +159 -0
- package/node_modules/zod/src/v4/core/tests/cached.test.ts +54 -0
- package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +1004 -0
- package/node_modules/zod/src/v4/core/tests/compile-generative.test.ts +445 -0
- package/node_modules/zod/src/v4/core/tests/compile-global.test.ts +89 -0
- package/node_modules/zod/src/v4/core/tests/compile-off-by-default.test.ts +26 -0
- package/node_modules/zod/src/v4/core/tests/compile-stats.test.ts +34 -0
- package/node_modules/zod/src/v4/core/tests/compile.test.ts +2036 -0
- package/node_modules/zod/src/v4/core/tests/email-regex.test.ts +140 -0
- package/node_modules/zod/src/v4/core/tests/extend.test.ts +59 -0
- package/node_modules/zod/src/v4/core/tests/index.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +124 -0
- package/node_modules/zod/src/v4/core/tests/locales/el.test.ts +214 -0
- package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +22 -0
- package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +180 -0
- package/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +72 -0
- package/node_modules/zod/src/v4/core/tests/locales/he.test.ts +379 -0
- package/node_modules/zod/src/v4/core/tests/locales/hr.test.ts +163 -0
- package/node_modules/zod/src/v4/core/tests/locales/nl.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/locales/parity.test.ts +42 -0
- package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +128 -0
- package/node_modules/zod/src/v4/core/tests/locales/tg.test.ts +85 -0
- package/node_modules/zod/src/v4/core/tests/locales/tk.test.ts +69 -0
- package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +69 -0
- package/node_modules/zod/src/v4/core/tests/locales/uz.test.ts +105 -0
- package/node_modules/zod/src/v4/core/tests/polyfill-collision.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/record-constructor.test.ts +125 -0
- package/node_modules/zod/src/v4/core/tests/recursive-tuples.test.ts +45 -0
- package/node_modules/zod/src/v4/core/tests/treeshake.test.ts +51 -0
- package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +133 -0
- package/node_modules/zod/src/v4/core/to-json-schema.ts +857 -0
- package/node_modules/zod/src/v4/core/util.ts +1293 -0
- package/node_modules/zod/src/v4/core/versions.ts +5 -0
- package/node_modules/zod/src/v4/core/visit.ts +193 -0
- package/node_modules/zod/src/v4/core/zsf.ts +323 -0
- package/node_modules/zod/src/v4/index.ts +4 -0
- package/node_modules/zod/src/v4/locales/ar.ts +120 -0
- package/node_modules/zod/src/v4/locales/az.ts +116 -0
- package/node_modules/zod/src/v4/locales/be.ts +188 -0
- package/node_modules/zod/src/v4/locales/bg.ts +133 -0
- package/node_modules/zod/src/v4/locales/bn.ts +123 -0
- package/node_modules/zod/src/v4/locales/ca.ts +121 -0
- package/node_modules/zod/src/v4/locales/ckb.ts +140 -0
- package/node_modules/zod/src/v4/locales/cs.ts +123 -0
- package/node_modules/zod/src/v4/locales/da.ts +128 -0
- package/node_modules/zod/src/v4/locales/de.ts +121 -0
- package/node_modules/zod/src/v4/locales/el.ts +124 -0
- package/node_modules/zod/src/v4/locales/en.ts +136 -0
- package/node_modules/zod/src/v4/locales/eo.ts +123 -0
- package/node_modules/zod/src/v4/locales/es.ts +145 -0
- package/node_modules/zod/src/v4/locales/fa.ts +131 -0
- package/node_modules/zod/src/v4/locales/fi.ts +126 -0
- package/node_modules/zod/src/v4/locales/fr-CA.ts +121 -0
- package/node_modules/zod/src/v4/locales/fr.ts +139 -0
- package/node_modules/zod/src/v4/locales/gu.ts +123 -0
- package/node_modules/zod/src/v4/locales/he.ts +253 -0
- package/node_modules/zod/src/v4/locales/hi.ts +126 -0
- package/node_modules/zod/src/v4/locales/hr.ts +135 -0
- package/node_modules/zod/src/v4/locales/hu.ts +122 -0
- package/node_modules/zod/src/v4/locales/hy.ts +175 -0
- package/node_modules/zod/src/v4/locales/id.ts +120 -0
- package/node_modules/zod/src/v4/locales/index.ts +63 -0
- package/node_modules/zod/src/v4/locales/is.ts +124 -0
- package/node_modules/zod/src/v4/locales/it.ts +121 -0
- package/node_modules/zod/src/v4/locales/ja.ts +119 -0
- package/node_modules/zod/src/v4/locales/ka.ts +128 -0
- package/node_modules/zod/src/v4/locales/kh.ts +7 -0
- package/node_modules/zod/src/v4/locales/km.ts +124 -0
- package/node_modules/zod/src/v4/locales/kn.ts +126 -0
- package/node_modules/zod/src/v4/locales/ko.ts +126 -0
- package/node_modules/zod/src/v4/locales/lt.ts +243 -0
- package/node_modules/zod/src/v4/locales/mk.ts +123 -0
- package/node_modules/zod/src/v4/locales/ms.ts +120 -0
- package/node_modules/zod/src/v4/locales/ne.ts +128 -0
- package/node_modules/zod/src/v4/locales/nl.ts +126 -0
- package/node_modules/zod/src/v4/locales/nn.ts +121 -0
- package/node_modules/zod/src/v4/locales/no.ts +121 -0
- package/node_modules/zod/src/v4/locales/ota.ts +122 -0
- package/node_modules/zod/src/v4/locales/pl.ts +123 -0
- package/node_modules/zod/src/v4/locales/ps.ts +131 -0
- package/node_modules/zod/src/v4/locales/pt-BR.ts +161 -0
- package/node_modules/zod/src/v4/locales/pt.ts +159 -0
- package/node_modules/zod/src/v4/locales/ro.ts +132 -0
- package/node_modules/zod/src/v4/locales/ru.ts +188 -0
- package/node_modules/zod/src/v4/locales/sk.ts +123 -0
- package/node_modules/zod/src/v4/locales/sl.ts +123 -0
- package/node_modules/zod/src/v4/locales/sv.ts +124 -0
- package/node_modules/zod/src/v4/locales/ta.ts +123 -0
- package/node_modules/zod/src/v4/locales/tg.ts +135 -0
- package/node_modules/zod/src/v4/locales/th.ts +124 -0
- package/node_modules/zod/src/v4/locales/tk.ts +113 -0
- package/node_modules/zod/src/v4/locales/tr.ts +116 -0
- package/node_modules/zod/src/v4/locales/ua.ts +7 -0
- package/node_modules/zod/src/v4/locales/uk.ts +122 -0
- package/node_modules/zod/src/v4/locales/ur.ts +124 -0
- package/node_modules/zod/src/v4/locales/uz.ts +120 -0
- package/node_modules/zod/src/v4/locales/vi.ts +122 -0
- package/node_modules/zod/src/v4/locales/yo.ts +129 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +121 -0
- package/node_modules/zod/src/v4/locales/zh-TW.ts +120 -0
- package/node_modules/zod/src/v4/mini/checks.ts +33 -0
- package/node_modules/zod/src/v4/mini/coerce.ts +27 -0
- package/node_modules/zod/src/v4/mini/deep-partial.ts +73 -0
- package/node_modules/zod/src/v4/mini/external.ts +52 -0
- package/node_modules/zod/src/v4/mini/in-out.ts +45 -0
- package/node_modules/zod/src/v4/mini/index.ts +3 -0
- package/node_modules/zod/src/v4/mini/iso.ts +66 -0
- package/node_modules/zod/src/v4/mini/parse.ts +16 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +2051 -0
- package/node_modules/zod/src/v4/mini/tests/apply.test.ts +57 -0
- package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +190 -0
- package/node_modules/zod/src/v4/mini/tests/brand.test.ts +94 -0
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +158 -0
- package/node_modules/zod/src/v4/mini/tests/codec.test.ts +582 -0
- package/node_modules/zod/src/v4/mini/tests/computed.test.ts +30 -0
- package/node_modules/zod/src/v4/mini/tests/cyclic-data.test.ts +84 -0
- package/node_modules/zod/src/v4/mini/tests/deep-partial.test.ts +54 -0
- package/node_modules/zod/src/v4/mini/tests/error.test.ts +41 -0
- package/node_modules/zod/src/v4/mini/tests/functions.test.ts +14 -0
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +1146 -0
- package/node_modules/zod/src/v4/mini/tests/number.test.ts +109 -0
- package/node_modules/zod/src/v4/mini/tests/object.test.ts +292 -0
- package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +43 -0
- package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +341 -0
- package/node_modules/zod/src/v4/mini/tests/standard-schema.test.ts +50 -0
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +396 -0
- package/node_modules/zod/src/v4-mini/index.ts +3 -0
- package/node_modules/zod/v3/ZodError.cjs +167 -0
- package/node_modules/zod/v3/ZodError.d.cts +164 -0
- package/node_modules/zod/v3/ZodError.d.ts +164 -0
- package/node_modules/zod/v3/ZodError.js +143 -0
- package/node_modules/zod/v3/errors.cjs +36 -0
- package/node_modules/zod/v3/errors.d.cts +5 -0
- package/node_modules/zod/v3/errors.d.ts +5 -0
- package/node_modules/zod/v3/errors.js +9 -0
- package/node_modules/zod/v3/external.cjs +41 -0
- package/node_modules/zod/v3/external.d.cts +6 -0
- package/node_modules/zod/v3/external.d.ts +6 -0
- package/node_modules/zod/v3/external.js +6 -0
- package/node_modules/zod/v3/helpers/enumUtil.cjs +21 -0
- package/node_modules/zod/v3/helpers/enumUtil.d.cts +8 -0
- package/node_modules/zod/v3/helpers/enumUtil.d.ts +8 -0
- package/node_modules/zod/v3/helpers/enumUtil.js +1 -0
- package/node_modules/zod/v3/helpers/errorUtil.cjs +28 -0
- package/node_modules/zod/v3/helpers/errorUtil.d.cts +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.d.ts +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.js +6 -0
- package/node_modules/zod/v3/helpers/parseUtil.cjs +143 -0
- package/node_modules/zod/v3/helpers/parseUtil.d.cts +78 -0
- package/node_modules/zod/v3/helpers/parseUtil.d.ts +78 -0
- package/node_modules/zod/v3/helpers/parseUtil.js +109 -0
- package/node_modules/zod/v3/helpers/partialUtil.cjs +21 -0
- package/node_modules/zod/v3/helpers/partialUtil.d.cts +8 -0
- package/node_modules/zod/v3/helpers/partialUtil.d.ts +8 -0
- package/node_modules/zod/v3/helpers/partialUtil.js +1 -0
- package/node_modules/zod/v3/helpers/typeAliases.cjs +21 -0
- package/node_modules/zod/v3/helpers/typeAliases.d.cts +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.d.ts +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.js +1 -0
- package/node_modules/zod/v3/helpers/util.cjs +156 -0
- package/node_modules/zod/v3/helpers/util.d.cts +85 -0
- package/node_modules/zod/v3/helpers/util.d.ts +85 -0
- package/node_modules/zod/v3/helpers/util.js +133 -0
- package/node_modules/zod/v3/index.cjs +52 -0
- package/node_modules/zod/v3/index.d.cts +4 -0
- package/node_modules/zod/v3/index.d.ts +4 -0
- package/node_modules/zod/v3/index.js +4 -0
- package/node_modules/zod/v3/locales/en.cjs +112 -0
- package/node_modules/zod/v3/locales/en.d.cts +3 -0
- package/node_modules/zod/v3/locales/en.d.ts +3 -0
- package/node_modules/zod/v3/locales/en.js +109 -0
- package/node_modules/zod/v3/package.json +7 -0
- package/node_modules/zod/v3/standard-schema.cjs +21 -0
- package/node_modules/zod/v3/standard-schema.d.cts +102 -0
- package/node_modules/zod/v3/standard-schema.d.ts +102 -0
- package/node_modules/zod/v3/standard-schema.js +1 -0
- package/node_modules/zod/v3/types.cjs +3798 -0
- package/node_modules/zod/v3/types.d.cts +1034 -0
- package/node_modules/zod/v3/types.d.ts +1034 -0
- package/node_modules/zod/v3/types.js +3697 -0
- package/node_modules/zod/v4/classic/checks.cjs +53 -0
- package/node_modules/zod/v4/classic/checks.d.cts +1 -0
- package/node_modules/zod/v4/classic/checks.d.ts +1 -0
- package/node_modules/zod/v4/classic/checks.js +1 -0
- package/node_modules/zod/v4/classic/coerce.cjs +66 -0
- package/node_modules/zod/v4/classic/coerce.d.cts +17 -0
- package/node_modules/zod/v4/classic/coerce.d.ts +17 -0
- package/node_modules/zod/v4/classic/coerce.js +17 -0
- package/node_modules/zod/v4/classic/compat.cjs +80 -0
- package/node_modules/zod/v4/classic/compat.d.cts +48 -0
- package/node_modules/zod/v4/classic/compat.d.ts +48 -0
- package/node_modules/zod/v4/classic/compat.js +31 -0
- package/node_modules/zod/v4/classic/deep-partial.cjs +58 -0
- package/node_modules/zod/v4/classic/deep-partial.d.cts +14 -0
- package/node_modules/zod/v4/classic/deep-partial.d.ts +14 -0
- package/node_modules/zod/v4/classic/deep-partial.js +13 -0
- package/node_modules/zod/v4/classic/errors.cjs +102 -0
- package/node_modules/zod/v4/classic/errors.d.cts +29 -0
- package/node_modules/zod/v4/classic/errors.d.ts +29 -0
- package/node_modules/zod/v4/classic/errors.js +57 -0
- package/node_modules/zod/v4/classic/external.cjs +97 -0
- package/node_modules/zod/v4/classic/external.d.cts +19 -0
- package/node_modules/zod/v4/classic/external.d.ts +19 -0
- package/node_modules/zod/v4/classic/external.js +17 -0
- package/node_modules/zod/v4/classic/from-json-schema.cjs +926 -0
- package/node_modules/zod/v4/classic/from-json-schema.d.cts +12 -0
- package/node_modules/zod/v4/classic/from-json-schema.d.ts +12 -0
- package/node_modules/zod/v4/classic/from-json-schema.js +881 -0
- package/node_modules/zod/v4/classic/in-out.cjs +82 -0
- package/node_modules/zod/v4/classic/in-out.d.cts +8 -0
- package/node_modules/zod/v4/classic/in-out.d.ts +8 -0
- package/node_modules/zod/v4/classic/in-out.js +36 -0
- package/node_modules/zod/v4/classic/index.cjs +52 -0
- package/node_modules/zod/v4/classic/index.d.cts +3 -0
- package/node_modules/zod/v4/classic/index.d.ts +3 -0
- package/node_modules/zod/v4/classic/index.js +4 -0
- package/node_modules/zod/v4/classic/iso.cjs +68 -0
- package/node_modules/zod/v4/classic/iso.d.cts +7 -0
- package/node_modules/zod/v4/classic/iso.d.ts +7 -0
- package/node_modules/zod/v4/classic/iso.js +15 -0
- package/node_modules/zod/v4/classic/package.json +7 -0
- package/node_modules/zod/v4/classic/parse.cjs +63 -0
- package/node_modules/zod/v4/classic/parse.d.cts +44 -0
- package/node_modules/zod/v4/classic/parse.d.ts +44 -0
- package/node_modules/zod/v4/classic/parse.js +16 -0
- package/node_modules/zod/v4/classic/schemas.cjs +1676 -0
- package/node_modules/zod/v4/classic/schemas.d.cts +816 -0
- package/node_modules/zod/v4/classic/schemas.d.ts +816 -0
- package/node_modules/zod/v4/classic/schemas.js +1535 -0
- package/node_modules/zod/v4/core/api.cjs +1269 -0
- package/node_modules/zod/v4/core/api.d.cts +335 -0
- package/node_modules/zod/v4/core/api.d.ts +335 -0
- package/node_modules/zod/v4/core/api.js +1107 -0
- package/node_modules/zod/v4/core/checks.cjs +561 -0
- package/node_modules/zod/v4/core/checks.d.cts +294 -0
- package/node_modules/zod/v4/core/checks.d.ts +294 -0
- package/node_modules/zod/v4/core/checks.js +516 -0
- package/node_modules/zod/v4/core/compile.cjs +1916 -0
- package/node_modules/zod/v4/core/compile.d.cts +65 -0
- package/node_modules/zod/v4/core/compile.d.ts +65 -0
- package/node_modules/zod/v4/core/compile.js +1866 -0
- package/node_modules/zod/v4/core/core.cjs +167 -0
- package/node_modules/zod/v4/core/core.d.cts +82 -0
- package/node_modules/zod/v4/core/core.d.ts +82 -0
- package/node_modules/zod/v4/core/core.js +141 -0
- package/node_modules/zod/v4/core/doc.cjs +61 -0
- package/node_modules/zod/v4/core/doc.d.cts +16 -0
- package/node_modules/zod/v4/core/doc.d.ts +16 -0
- package/node_modules/zod/v4/core/doc.js +38 -0
- package/node_modules/zod/v4/core/errors.cjs +317 -0
- package/node_modules/zod/v4/core/errors.d.cts +225 -0
- package/node_modules/zod/v4/core/errors.d.ts +225 -0
- package/node_modules/zod/v4/core/errors.js +267 -0
- package/node_modules/zod/v4/core/index.cjs +70 -0
- package/node_modules/zod/v4/core/index.d.cts +19 -0
- package/node_modules/zod/v4/core/index.d.ts +19 -0
- package/node_modules/zod/v4/core/index.js +19 -0
- package/node_modules/zod/v4/core/json-schema-generator.cjs +122 -0
- package/node_modules/zod/v4/core/json-schema-generator.d.cts +65 -0
- package/node_modules/zod/v4/core/json-schema-generator.d.ts +65 -0
- package/node_modules/zod/v4/core/json-schema-generator.js +99 -0
- package/node_modules/zod/v4/core/json-schema-processors.cjs +929 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.cts +65 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.ts +65 -0
- package/node_modules/zod/v4/core/json-schema-processors.js +843 -0
- package/node_modules/zod/v4/core/json-schema.cjs +21 -0
- package/node_modules/zod/v4/core/json-schema.d.cts +89 -0
- package/node_modules/zod/v4/core/json-schema.d.ts +89 -0
- package/node_modules/zod/v4/core/json-schema.js +1 -0
- package/node_modules/zod/v4/core/memoizer.cjs +360 -0
- package/node_modules/zod/v4/core/memoizer.d.cts +15 -0
- package/node_modules/zod/v4/core/memoizer.d.ts +15 -0
- package/node_modules/zod/v4/core/memoizer.js +311 -0
- package/node_modules/zod/v4/core/package.json +7 -0
- package/node_modules/zod/v4/core/parse.cjs +233 -0
- package/node_modules/zod/v4/core/parse.d.cts +52 -0
- package/node_modules/zod/v4/core/parse.d.ts +52 -0
- package/node_modules/zod/v4/core/parse.js +175 -0
- package/node_modules/zod/v4/core/regexes.cjs +209 -0
- package/node_modules/zod/v4/core/regexes.d.cts +90 -0
- package/node_modules/zod/v4/core/regexes.d.ts +90 -0
- package/node_modules/zod/v4/core/regexes.js +156 -0
- package/node_modules/zod/v4/core/registries.cjs +75 -0
- package/node_modules/zod/v4/core/registries.d.cts +35 -0
- package/node_modules/zod/v4/core/registries.d.ts +35 -0
- package/node_modules/zod/v4/core/registries.js +51 -0
- package/node_modules/zod/v4/core/schemas.cjs +2699 -0
- package/node_modules/zod/v4/core/schemas.d.cts +1275 -0
- package/node_modules/zod/v4/core/schemas.d.ts +1275 -0
- package/node_modules/zod/v4/core/schemas.js +2636 -0
- package/node_modules/zod/v4/core/standard-schema.cjs +21 -0
- package/node_modules/zod/v4/core/standard-schema.d.cts +126 -0
- package/node_modules/zod/v4/core/standard-schema.d.ts +126 -0
- package/node_modules/zod/v4/core/standard-schema.js +1 -0
- package/node_modules/zod/v4/core/to-json-schema.cjs +681 -0
- package/node_modules/zod/v4/core/to-json-schema.d.cts +154 -0
- package/node_modules/zod/v4/core/to-json-schema.d.ts +154 -0
- package/node_modules/zod/v4/core/to-json-schema.js +651 -0
- package/node_modules/zod/v4/core/util.cjs +964 -0
- package/node_modules/zod/v4/core/util.d.cts +280 -0
- package/node_modules/zod/v4/core/util.d.ts +280 -0
- package/node_modules/zod/v4/core/util.js +873 -0
- package/node_modules/zod/v4/core/versions.cjs +27 -0
- package/node_modules/zod/v4/core/versions.d.cts +5 -0
- package/node_modules/zod/v4/core/versions.d.ts +5 -0
- package/node_modules/zod/v4/core/versions.js +5 -0
- package/node_modules/zod/v4/core/visit.cjs +214 -0
- package/node_modules/zod/v4/core/visit.d.cts +30 -0
- package/node_modules/zod/v4/core/visit.d.ts +30 -0
- package/node_modules/zod/v4/core/visit.js +169 -0
- package/node_modules/zod/v4/index.cjs +51 -0
- package/node_modules/zod/v4/index.d.cts +3 -0
- package/node_modules/zod/v4/index.d.ts +3 -0
- package/node_modules/zod/v4/index.js +4 -0
- package/node_modules/zod/v4/locales/ar.cjs +138 -0
- package/node_modules/zod/v4/locales/ar.d.cts +5 -0
- package/node_modules/zod/v4/locales/ar.d.ts +4 -0
- package/node_modules/zod/v4/locales/ar.js +111 -0
- package/node_modules/zod/v4/locales/az.cjs +137 -0
- package/node_modules/zod/v4/locales/az.d.cts +5 -0
- package/node_modules/zod/v4/locales/az.d.ts +4 -0
- package/node_modules/zod/v4/locales/az.js +110 -0
- package/node_modules/zod/v4/locales/be.cjs +195 -0
- package/node_modules/zod/v4/locales/be.d.cts +5 -0
- package/node_modules/zod/v4/locales/be.d.ts +4 -0
- package/node_modules/zod/v4/locales/be.js +168 -0
- package/node_modules/zod/v4/locales/bg.cjs +152 -0
- package/node_modules/zod/v4/locales/bg.d.cts +5 -0
- package/node_modules/zod/v4/locales/bg.d.ts +4 -0
- package/node_modules/zod/v4/locales/bg.js +125 -0
- package/node_modules/zod/v4/locales/bn.cjs +140 -0
- package/node_modules/zod/v4/locales/bn.d.cts +5 -0
- package/node_modules/zod/v4/locales/bn.d.ts +4 -0
- package/node_modules/zod/v4/locales/bn.js +113 -0
- package/node_modules/zod/v4/locales/ca.cjs +139 -0
- package/node_modules/zod/v4/locales/ca.d.cts +5 -0
- package/node_modules/zod/v4/locales/ca.d.ts +4 -0
- package/node_modules/zod/v4/locales/ca.js +112 -0
- package/node_modules/zod/v4/locales/ckb.cjs +160 -0
- package/node_modules/zod/v4/locales/ckb.d.cts +5 -0
- package/node_modules/zod/v4/locales/ckb.d.ts +4 -0
- package/node_modules/zod/v4/locales/ckb.js +133 -0
- package/node_modules/zod/v4/locales/cs.cjs +143 -0
- package/node_modules/zod/v4/locales/cs.d.cts +5 -0
- package/node_modules/zod/v4/locales/cs.d.ts +4 -0
- package/node_modules/zod/v4/locales/cs.js +116 -0
- package/node_modules/zod/v4/locales/da.cjs +147 -0
- package/node_modules/zod/v4/locales/da.d.cts +5 -0
- package/node_modules/zod/v4/locales/da.d.ts +4 -0
- package/node_modules/zod/v4/locales/da.js +120 -0
- package/node_modules/zod/v4/locales/de.cjs +140 -0
- package/node_modules/zod/v4/locales/de.d.cts +5 -0
- package/node_modules/zod/v4/locales/de.d.ts +4 -0
- package/node_modules/zod/v4/locales/de.js +113 -0
- package/node_modules/zod/v4/locales/el.cjs +139 -0
- package/node_modules/zod/v4/locales/el.d.cts +5 -0
- package/node_modules/zod/v4/locales/el.d.ts +4 -0
- package/node_modules/zod/v4/locales/el.js +112 -0
- package/node_modules/zod/v4/locales/en.cjs +152 -0
- package/node_modules/zod/v4/locales/en.d.cts +5 -0
- package/node_modules/zod/v4/locales/en.d.ts +4 -0
- package/node_modules/zod/v4/locales/en.js +125 -0
- package/node_modules/zod/v4/locales/eo.cjs +141 -0
- package/node_modules/zod/v4/locales/eo.d.cts +5 -0
- package/node_modules/zod/v4/locales/eo.d.ts +4 -0
- package/node_modules/zod/v4/locales/eo.js +114 -0
- package/node_modules/zod/v4/locales/es.cjs +163 -0
- package/node_modules/zod/v4/locales/es.d.cts +5 -0
- package/node_modules/zod/v4/locales/es.d.ts +4 -0
- package/node_modules/zod/v4/locales/es.js +136 -0
- package/node_modules/zod/v4/locales/fa.cjs +146 -0
- package/node_modules/zod/v4/locales/fa.d.cts +5 -0
- package/node_modules/zod/v4/locales/fa.d.ts +4 -0
- package/node_modules/zod/v4/locales/fa.js +119 -0
- package/node_modules/zod/v4/locales/fi.cjs +144 -0
- package/node_modules/zod/v4/locales/fi.d.cts +5 -0
- package/node_modules/zod/v4/locales/fi.d.ts +4 -0
- package/node_modules/zod/v4/locales/fi.js +117 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +139 -0
- package/node_modules/zod/v4/locales/fr-CA.d.cts +5 -0
- package/node_modules/zod/v4/locales/fr-CA.d.ts +4 -0
- package/node_modules/zod/v4/locales/fr-CA.js +112 -0
- package/node_modules/zod/v4/locales/fr.cjs +156 -0
- package/node_modules/zod/v4/locales/fr.d.cts +5 -0
- package/node_modules/zod/v4/locales/fr.d.ts +4 -0
- package/node_modules/zod/v4/locales/fr.js +129 -0
- package/node_modules/zod/v4/locales/gu.cjs +140 -0
- package/node_modules/zod/v4/locales/gu.d.cts +5 -0
- package/node_modules/zod/v4/locales/gu.d.ts +4 -0
- package/node_modules/zod/v4/locales/gu.js +113 -0
- package/node_modules/zod/v4/locales/he.cjs +248 -0
- package/node_modules/zod/v4/locales/he.d.cts +5 -0
- package/node_modules/zod/v4/locales/he.d.ts +4 -0
- package/node_modules/zod/v4/locales/he.js +221 -0
- package/node_modules/zod/v4/locales/hi.cjs +138 -0
- package/node_modules/zod/v4/locales/hi.d.cts +5 -0
- package/node_modules/zod/v4/locales/hi.d.ts +4 -0
- package/node_modules/zod/v4/locales/hi.js +111 -0
- package/node_modules/zod/v4/locales/hr.cjs +153 -0
- package/node_modules/zod/v4/locales/hr.d.cts +5 -0
- package/node_modules/zod/v4/locales/hr.d.ts +4 -0
- package/node_modules/zod/v4/locales/hr.js +126 -0
- package/node_modules/zod/v4/locales/hu.cjs +140 -0
- package/node_modules/zod/v4/locales/hu.d.cts +5 -0
- package/node_modules/zod/v4/locales/hu.d.ts +4 -0
- package/node_modules/zod/v4/locales/hu.js +113 -0
- package/node_modules/zod/v4/locales/hy.cjs +185 -0
- package/node_modules/zod/v4/locales/hy.d.cts +5 -0
- package/node_modules/zod/v4/locales/hy.d.ts +4 -0
- package/node_modules/zod/v4/locales/hy.js +158 -0
- package/node_modules/zod/v4/locales/id.cjs +138 -0
- package/node_modules/zod/v4/locales/id.d.cts +5 -0
- package/node_modules/zod/v4/locales/id.d.ts +4 -0
- package/node_modules/zod/v4/locales/id.js +111 -0
- package/node_modules/zod/v4/locales/index.cjs +152 -0
- package/node_modules/zod/v4/locales/index.d.cts +63 -0
- package/node_modules/zod/v4/locales/index.d.ts +63 -0
- package/node_modules/zod/v4/locales/index.js +63 -0
- package/node_modules/zod/v4/locales/is.cjs +141 -0
- package/node_modules/zod/v4/locales/is.d.cts +5 -0
- package/node_modules/zod/v4/locales/is.d.ts +4 -0
- package/node_modules/zod/v4/locales/is.js +114 -0
- package/node_modules/zod/v4/locales/it.cjs +140 -0
- package/node_modules/zod/v4/locales/it.d.cts +5 -0
- package/node_modules/zod/v4/locales/it.d.ts +4 -0
- package/node_modules/zod/v4/locales/it.js +113 -0
- package/node_modules/zod/v4/locales/ja.cjs +139 -0
- package/node_modules/zod/v4/locales/ja.d.cts +5 -0
- package/node_modules/zod/v4/locales/ja.d.ts +4 -0
- package/node_modules/zod/v4/locales/ja.js +112 -0
- package/node_modules/zod/v4/locales/ka.cjs +144 -0
- package/node_modules/zod/v4/locales/ka.d.cts +5 -0
- package/node_modules/zod/v4/locales/ka.d.ts +4 -0
- package/node_modules/zod/v4/locales/ka.js +117 -0
- package/node_modules/zod/v4/locales/kh.cjs +12 -0
- package/node_modules/zod/v4/locales/kh.d.cts +5 -0
- package/node_modules/zod/v4/locales/kh.d.ts +5 -0
- package/node_modules/zod/v4/locales/kh.js +5 -0
- package/node_modules/zod/v4/locales/km.cjs +142 -0
- package/node_modules/zod/v4/locales/km.d.cts +5 -0
- package/node_modules/zod/v4/locales/km.d.ts +4 -0
- package/node_modules/zod/v4/locales/km.js +115 -0
- package/node_modules/zod/v4/locales/kn.cjs +143 -0
- package/node_modules/zod/v4/locales/kn.d.cts +5 -0
- package/node_modules/zod/v4/locales/kn.d.ts +4 -0
- package/node_modules/zod/v4/locales/kn.js +116 -0
- package/node_modules/zod/v4/locales/ko.cjs +143 -0
- package/node_modules/zod/v4/locales/ko.d.cts +5 -0
- package/node_modules/zod/v4/locales/ko.d.ts +4 -0
- package/node_modules/zod/v4/locales/ko.js +116 -0
- package/node_modules/zod/v4/locales/lt.cjs +234 -0
- package/node_modules/zod/v4/locales/lt.d.cts +5 -0
- package/node_modules/zod/v4/locales/lt.d.ts +4 -0
- package/node_modules/zod/v4/locales/lt.js +207 -0
- package/node_modules/zod/v4/locales/mk.cjs +141 -0
- package/node_modules/zod/v4/locales/mk.d.cts +5 -0
- package/node_modules/zod/v4/locales/mk.d.ts +4 -0
- package/node_modules/zod/v4/locales/mk.js +114 -0
- package/node_modules/zod/v4/locales/ms.cjs +139 -0
- package/node_modules/zod/v4/locales/ms.d.cts +5 -0
- package/node_modules/zod/v4/locales/ms.d.ts +4 -0
- package/node_modules/zod/v4/locales/ms.js +112 -0
- package/node_modules/zod/v4/locales/ne.cjs +138 -0
- package/node_modules/zod/v4/locales/ne.d.cts +5 -0
- package/node_modules/zod/v4/locales/ne.d.ts +4 -0
- package/node_modules/zod/v4/locales/ne.js +111 -0
- package/node_modules/zod/v4/locales/nl.cjs +142 -0
- package/node_modules/zod/v4/locales/nl.d.cts +5 -0
- package/node_modules/zod/v4/locales/nl.d.ts +4 -0
- package/node_modules/zod/v4/locales/nl.js +115 -0
- package/node_modules/zod/v4/locales/nn.cjs +140 -0
- package/node_modules/zod/v4/locales/nn.d.cts +5 -0
- package/node_modules/zod/v4/locales/nn.d.ts +4 -0
- package/node_modules/zod/v4/locales/nn.js +113 -0
- package/node_modules/zod/v4/locales/no.cjs +140 -0
- package/node_modules/zod/v4/locales/no.d.cts +5 -0
- package/node_modules/zod/v4/locales/no.d.ts +4 -0
- package/node_modules/zod/v4/locales/no.js +113 -0
- package/node_modules/zod/v4/locales/ota.cjs +141 -0
- package/node_modules/zod/v4/locales/ota.d.cts +5 -0
- package/node_modules/zod/v4/locales/ota.d.ts +4 -0
- package/node_modules/zod/v4/locales/ota.js +114 -0
- package/node_modules/zod/v4/locales/package.json +7 -0
- package/node_modules/zod/v4/locales/pl.cjs +141 -0
- package/node_modules/zod/v4/locales/pl.d.cts +5 -0
- package/node_modules/zod/v4/locales/pl.d.ts +4 -0
- package/node_modules/zod/v4/locales/pl.js +114 -0
- package/node_modules/zod/v4/locales/ps.cjs +146 -0
- package/node_modules/zod/v4/locales/ps.d.cts +5 -0
- package/node_modules/zod/v4/locales/ps.d.ts +4 -0
- package/node_modules/zod/v4/locales/ps.js +119 -0
- package/node_modules/zod/v4/locales/pt-BR.cjs +170 -0
- package/node_modules/zod/v4/locales/pt-BR.d.cts +5 -0
- package/node_modules/zod/v4/locales/pt-BR.d.ts +4 -0
- package/node_modules/zod/v4/locales/pt-BR.js +143 -0
- package/node_modules/zod/v4/locales/pt.cjs +169 -0
- package/node_modules/zod/v4/locales/pt.d.cts +5 -0
- package/node_modules/zod/v4/locales/pt.d.ts +4 -0
- package/node_modules/zod/v4/locales/pt.js +142 -0
- package/node_modules/zod/v4/locales/ro.cjs +149 -0
- package/node_modules/zod/v4/locales/ro.d.cts +5 -0
- package/node_modules/zod/v4/locales/ro.d.ts +4 -0
- package/node_modules/zod/v4/locales/ro.js +122 -0
- package/node_modules/zod/v4/locales/ru.cjs +195 -0
- package/node_modules/zod/v4/locales/ru.d.cts +5 -0
- package/node_modules/zod/v4/locales/ru.d.ts +4 -0
- package/node_modules/zod/v4/locales/ru.js +168 -0
- package/node_modules/zod/v4/locales/sk.cjs +143 -0
- package/node_modules/zod/v4/locales/sk.d.cts +5 -0
- package/node_modules/zod/v4/locales/sk.d.ts +4 -0
- package/node_modules/zod/v4/locales/sk.js +116 -0
- package/node_modules/zod/v4/locales/sl.cjs +141 -0
- package/node_modules/zod/v4/locales/sl.d.cts +5 -0
- package/node_modules/zod/v4/locales/sl.d.ts +4 -0
- package/node_modules/zod/v4/locales/sl.js +114 -0
- package/node_modules/zod/v4/locales/sv.cjs +142 -0
- package/node_modules/zod/v4/locales/sv.d.cts +5 -0
- package/node_modules/zod/v4/locales/sv.d.ts +4 -0
- package/node_modules/zod/v4/locales/sv.js +115 -0
- package/node_modules/zod/v4/locales/ta.cjs +142 -0
- package/node_modules/zod/v4/locales/ta.d.cts +5 -0
- package/node_modules/zod/v4/locales/ta.d.ts +4 -0
- package/node_modules/zod/v4/locales/ta.js +115 -0
- package/node_modules/zod/v4/locales/tg.cjs +144 -0
- package/node_modules/zod/v4/locales/tg.d.cts +5 -0
- package/node_modules/zod/v4/locales/tg.d.ts +4 -0
- package/node_modules/zod/v4/locales/tg.js +117 -0
- package/node_modules/zod/v4/locales/th.cjs +142 -0
- package/node_modules/zod/v4/locales/th.d.cts +5 -0
- package/node_modules/zod/v4/locales/th.d.ts +4 -0
- package/node_modules/zod/v4/locales/th.js +115 -0
- package/node_modules/zod/v4/locales/tk.cjs +134 -0
- package/node_modules/zod/v4/locales/tk.d.cts +5 -0
- package/node_modules/zod/v4/locales/tk.d.ts +4 -0
- package/node_modules/zod/v4/locales/tk.js +107 -0
- package/node_modules/zod/v4/locales/tr.cjs +137 -0
- package/node_modules/zod/v4/locales/tr.d.cts +5 -0
- package/node_modules/zod/v4/locales/tr.d.ts +4 -0
- package/node_modules/zod/v4/locales/tr.js +110 -0
- package/node_modules/zod/v4/locales/ua.cjs +12 -0
- package/node_modules/zod/v4/locales/ua.d.cts +5 -0
- package/node_modules/zod/v4/locales/ua.d.ts +5 -0
- package/node_modules/zod/v4/locales/ua.js +5 -0
- package/node_modules/zod/v4/locales/uk.cjs +140 -0
- package/node_modules/zod/v4/locales/uk.d.cts +5 -0
- package/node_modules/zod/v4/locales/uk.d.ts +4 -0
- package/node_modules/zod/v4/locales/uk.js +113 -0
- package/node_modules/zod/v4/locales/ur.cjs +142 -0
- package/node_modules/zod/v4/locales/ur.d.cts +5 -0
- package/node_modules/zod/v4/locales/ur.d.ts +4 -0
- package/node_modules/zod/v4/locales/ur.js +115 -0
- package/node_modules/zod/v4/locales/uz.cjs +140 -0
- package/node_modules/zod/v4/locales/uz.d.cts +5 -0
- package/node_modules/zod/v4/locales/uz.d.ts +4 -0
- package/node_modules/zod/v4/locales/uz.js +113 -0
- package/node_modules/zod/v4/locales/vi.cjs +140 -0
- package/node_modules/zod/v4/locales/vi.d.cts +5 -0
- package/node_modules/zod/v4/locales/vi.d.ts +4 -0
- package/node_modules/zod/v4/locales/vi.js +113 -0
- package/node_modules/zod/v4/locales/yo.cjs +139 -0
- package/node_modules/zod/v4/locales/yo.d.cts +5 -0
- package/node_modules/zod/v4/locales/yo.d.ts +4 -0
- package/node_modules/zod/v4/locales/yo.js +112 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +141 -0
- package/node_modules/zod/v4/locales/zh-CN.d.cts +5 -0
- package/node_modules/zod/v4/locales/zh-CN.d.ts +4 -0
- package/node_modules/zod/v4/locales/zh-CN.js +114 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +139 -0
- package/node_modules/zod/v4/locales/zh-TW.d.cts +5 -0
- package/node_modules/zod/v4/locales/zh-TW.d.ts +4 -0
- package/node_modules/zod/v4/locales/zh-TW.js +112 -0
- package/node_modules/zod/v4/mini/checks.cjs +54 -0
- package/node_modules/zod/v4/mini/checks.d.cts +1 -0
- package/node_modules/zod/v4/mini/checks.d.ts +1 -0
- package/node_modules/zod/v4/mini/checks.js +1 -0
- package/node_modules/zod/v4/mini/coerce.cjs +71 -0
- package/node_modules/zod/v4/mini/coerce.d.cts +7 -0
- package/node_modules/zod/v4/mini/coerce.d.ts +7 -0
- package/node_modules/zod/v4/mini/coerce.js +22 -0
- package/node_modules/zod/v4/mini/deep-partial.cjs +58 -0
- package/node_modules/zod/v4/mini/deep-partial.d.cts +14 -0
- package/node_modules/zod/v4/mini/deep-partial.d.ts +14 -0
- package/node_modules/zod/v4/mini/deep-partial.js +13 -0
- package/node_modules/zod/v4/mini/external.cjs +95 -0
- package/node_modules/zod/v4/mini/external.d.cts +16 -0
- package/node_modules/zod/v4/mini/external.d.ts +16 -0
- package/node_modules/zod/v4/mini/external.js +16 -0
- package/node_modules/zod/v4/mini/in-out.cjs +82 -0
- package/node_modules/zod/v4/mini/in-out.d.cts +8 -0
- package/node_modules/zod/v4/mini/in-out.d.ts +8 -0
- package/node_modules/zod/v4/mini/in-out.js +36 -0
- package/node_modules/zod/v4/mini/index.cjs +51 -0
- package/node_modules/zod/v4/mini/index.d.cts +3 -0
- package/node_modules/zod/v4/mini/index.d.ts +3 -0
- package/node_modules/zod/v4/mini/index.js +3 -0
- package/node_modules/zod/v4/mini/iso.cjs +83 -0
- package/node_modules/zod/v4/mini/iso.d.cts +22 -0
- package/node_modules/zod/v4/mini/iso.d.ts +22 -0
- package/node_modules/zod/v4/mini/iso.js +34 -0
- package/node_modules/zod/v4/mini/package.json +7 -0
- package/node_modules/zod/v4/mini/parse.cjs +37 -0
- package/node_modules/zod/v4/mini/parse.d.cts +1 -0
- package/node_modules/zod/v4/mini/parse.d.ts +1 -0
- package/node_modules/zod/v4/mini/parse.js +1 -0
- package/node_modules/zod/v4/mini/schemas.cjs +1147 -0
- package/node_modules/zod/v4/mini/schemas.d.cts +480 -0
- package/node_modules/zod/v4/mini/schemas.d.ts +480 -0
- package/node_modules/zod/v4/mini/schemas.js +1002 -0
- package/node_modules/zod/v4/package.json +7 -0
- package/node_modules/zod/v4-mini/index.cjs +51 -0
- package/node_modules/zod/v4-mini/index.d.cts +3 -0
- package/node_modules/zod/v4-mini/index.d.ts +3 -0
- package/node_modules/zod/v4-mini/index.js +3 -0
- package/node_modules/zod/v4-mini/package.json +7 -0
- package/package.json +73 -4
|
@@ -0,0 +1,2896 @@
|
|
|
1
|
+
import { S as normalizeAgentCommandInput, a as createAgentRegistry, i as DEFAULT_AGENT_NAME } from "./agent-registry-CxpAF3nI.js";
|
|
2
|
+
import { A as findSession, B as assertPersistedKeyPolicy, C as textPrompt, Dt as extractAcpError, Et as normalizeOutputError, L as readSessionRecord, Ot as isAcpResourceNotFoundError, R as resolveSessionRecord, U as serializeSessionRecordForDisk, V as parseSessionRecord, bt as writePrivateJsonFile, t as tryCancelOnRunningOwner } from "./ipc-CQUNQ8QQ.js";
|
|
3
|
+
import { $ as resolveRequestedConfigOption, A as applyInitialModelSelection, B as reconcileAgentSessionId, C as setSessionModeOnOwner, D as connectAndLoadSession, E as withConnectedSession, F as persistSessionOptions, G as recordSessionUpdate, I as sessionOptionsFromRecord, J as AcpClient, K as cloneSessionAcpxState, L as applyConversation, M as applyRequestedModelIfAdvertised, N as setDesiredModeId, O as applyConfigOptionSelection, P as normalizeSessionOptionShape, Q as isRequestedModelUnsupportedError, R as applyLifecycleSnapshotToRecord, T as setSessionModelOnOwner, U as recordClientOperation, V as cloneSessionConversation, W as recordPromptSubmission, X as REQUESTED_MODEL_UNSUPPORTED_REASONS, Y as REQUESTED_MODEL_UNSUPPORTED_ERROR_CODE, Z as RequestedModelUnsupportedError, _ as cancelSessionPrompt, c as LiveSessionCheckpoint, dt as TimeoutError, et as resolveRequestedModelId, ft as assertControlAuthority, h as ensureSession, j as applyModelSelection, k as applyConfigOptionsToRecord, l as runPromptTurn, mt as withTimeout, nt as snapshotEnvNames, q as advertisedModelState, r as sendSession, s as DISCARD_OUTPUT_FORMATTER, v as closeSession, x as setSessionConfigOptionOnOwner, z as createInitialSessionRecord } from "./queue-owner-runtime-ucHvXJ33.js";
|
|
4
|
+
import { t as watchSession } from "./watch-CXy2A5VY.js";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
import path from "node:path";
|
|
7
|
+
import fs from "node:fs/promises";
|
|
8
|
+
import { randomUUID } from "node:crypto";
|
|
9
|
+
import { isDeepStrictEqual } from "node:util";
|
|
10
|
+
// src/runtime/public/errors.ts
|
|
11
|
+
var AcpRuntimeError = class extends Error {
|
|
12
|
+
code;
|
|
13
|
+
cause;
|
|
14
|
+
constructor(code, message, options) {
|
|
15
|
+
super(message);
|
|
16
|
+
this.name = "AcpRuntimeError";
|
|
17
|
+
this.code = code;
|
|
18
|
+
this.cause = options?.cause;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
function isAcpRuntimeError(value) {
|
|
22
|
+
return value instanceof AcpRuntimeError;
|
|
23
|
+
}
|
|
24
|
+
// src/runtime/engine/controls.ts
|
|
25
|
+
function advertisedConfigOptionIds(record) {
|
|
26
|
+
const configOptions = record?.acpx?.config_options;
|
|
27
|
+
if (!configOptions) return;
|
|
28
|
+
return new Set(configOptions.map((option) => option.id).filter((id) => typeof id === "string" && id.trim().length > 0));
|
|
29
|
+
}
|
|
30
|
+
/** Caller-owned controls and the config option keys the session last advertised. */
|
|
31
|
+
function capabilitiesFromRecord(record) {
|
|
32
|
+
const advertisedIds = advertisedConfigOptionIds(record);
|
|
33
|
+
return {
|
|
34
|
+
controls: [
|
|
35
|
+
"session/set_mode",
|
|
36
|
+
"session/set_model",
|
|
37
|
+
"session/set_config_option",
|
|
38
|
+
"session/status"
|
|
39
|
+
],
|
|
40
|
+
...advertisedIds?.size ? { configOptionKeys: [...advertisedIds] } : {}
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function resolveSupportedConfigOptionId(record, configId) {
|
|
44
|
+
const advertisedIds = advertisedConfigOptionIds(record);
|
|
45
|
+
if (!advertisedIds) return configId;
|
|
46
|
+
if (advertisedIds.has(configId)) return configId;
|
|
47
|
+
if (configId === "thinking" && advertisedIds.has("effort")) return "effort";
|
|
48
|
+
const supported = [...advertisedIds].toSorted();
|
|
49
|
+
const supportedText = supported.length > 0 ? supported.join(", ") : "none";
|
|
50
|
+
throw new AcpRuntimeError("ACP_BACKEND_UNSUPPORTED_CONTROL", `ACP session ${record.acpxRecordId} does not advertise config option '${configId}'. Supported config options: ${supportedText}.`);
|
|
51
|
+
}
|
|
52
|
+
// src/runtime/public/shared.ts
|
|
53
|
+
function isRecord(value) {
|
|
54
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
55
|
+
}
|
|
56
|
+
function asTrimmedString(value) {
|
|
57
|
+
return typeof value === "string" ? value.trim() : "";
|
|
58
|
+
}
|
|
59
|
+
function asString(value) {
|
|
60
|
+
return typeof value === "string" ? value : void 0;
|
|
61
|
+
}
|
|
62
|
+
function asOptionalString(value) {
|
|
63
|
+
return asTrimmedString(value) || void 0;
|
|
64
|
+
}
|
|
65
|
+
function deriveAgentFromSessionKey(sessionKey, fallbackAgent) {
|
|
66
|
+
const match = sessionKey.match(/^agent:([^:]+):/i);
|
|
67
|
+
return (match?.[1] ? asTrimmedString(match[1]) : "") || fallbackAgent;
|
|
68
|
+
}
|
|
69
|
+
// src/runtime/public/events.ts
|
|
70
|
+
const TOOL_OUTPUT_SUMMARY_MAX_CHARS = 500;
|
|
71
|
+
function asOptionalFiniteNumber(value) {
|
|
72
|
+
return typeof value === "number" && Number.isFinite(value) ? value : void 0;
|
|
73
|
+
}
|
|
74
|
+
function resolveStatusTextForTag(params) {
|
|
75
|
+
const resolver = STATUS_TEXT_RESOLVERS[params.tag];
|
|
76
|
+
return resolver ? resolver(params.payload) : null;
|
|
77
|
+
}
|
|
78
|
+
const STATUS_TEXT_RESOLVERS = {
|
|
79
|
+
available_commands_update: availableCommandsStatusText,
|
|
80
|
+
current_mode_update: currentModeStatusText,
|
|
81
|
+
config_option_update: configOptionStatusText,
|
|
82
|
+
session_info_update: sessionInfoStatusText
|
|
83
|
+
};
|
|
84
|
+
function availableCommandsStatusText(payload) {
|
|
85
|
+
const commands = Array.isArray(payload.availableCommands) ? payload.availableCommands : [];
|
|
86
|
+
return commands.length > 0 ? `available commands updated (${commands.length})` : "available commands updated";
|
|
87
|
+
}
|
|
88
|
+
function currentModeStatusText(payload) {
|
|
89
|
+
const mode = asTrimmedString(payload.currentModeId) || asTrimmedString(payload.modeId) || asTrimmedString(payload.mode);
|
|
90
|
+
return mode ? `mode updated: ${mode}` : "mode updated";
|
|
91
|
+
}
|
|
92
|
+
function configOptionStatusText(payload) {
|
|
93
|
+
const id = asTrimmedString(payload.id) || asTrimmedString(payload.configOptionId);
|
|
94
|
+
const value = asTrimmedString(payload.currentValue) || asTrimmedString(payload.value) || asTrimmedString(payload.optionValue);
|
|
95
|
+
if (id && value) return `config updated: ${id}=${value}`;
|
|
96
|
+
return id ? `config updated: ${id}` : "config updated";
|
|
97
|
+
}
|
|
98
|
+
function sessionInfoStatusText(payload) {
|
|
99
|
+
return asTrimmedString(payload.summary) || asTrimmedString(payload.message) || "session updated";
|
|
100
|
+
}
|
|
101
|
+
function planStatusText(payload) {
|
|
102
|
+
const content = asTrimmedString((Array.isArray(payload.entries) ? payload.entries : []).find((entry) => isRecord(entry))?.content);
|
|
103
|
+
return content ? `plan: ${content}` : null;
|
|
104
|
+
}
|
|
105
|
+
function isPlanEntryStatus(value) {
|
|
106
|
+
return value === "pending" || value === "in_progress" || value === "completed";
|
|
107
|
+
}
|
|
108
|
+
function isPlanEntryPriority(value) {
|
|
109
|
+
return value === "high" || value === "medium" || value === "low";
|
|
110
|
+
}
|
|
111
|
+
function planUpdateEvent(payload) {
|
|
112
|
+
const raw = payload.entries;
|
|
113
|
+
const entries = normalizePlanEntries(raw);
|
|
114
|
+
if (Array.isArray(raw) && raw.length === 0) return {
|
|
115
|
+
type: "status",
|
|
116
|
+
text: "plan updated",
|
|
117
|
+
tag: "plan",
|
|
118
|
+
entries: []
|
|
119
|
+
};
|
|
120
|
+
const text = planStatusText(payload) ?? (entries.length > 0 ? `plan: ${entries[0]?.content}` : null);
|
|
121
|
+
if (!text) return null;
|
|
122
|
+
return {
|
|
123
|
+
type: "status",
|
|
124
|
+
text,
|
|
125
|
+
tag: "plan",
|
|
126
|
+
...entries.length > 0 ? { entries } : {}
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
function normalizePlanEntries(value) {
|
|
130
|
+
if (!Array.isArray(value)) return [];
|
|
131
|
+
const entries = [];
|
|
132
|
+
for (const entry of value) {
|
|
133
|
+
const normalized = normalizePlanEntry(entry);
|
|
134
|
+
if (normalized) entries.push(normalized);
|
|
135
|
+
}
|
|
136
|
+
return entries;
|
|
137
|
+
}
|
|
138
|
+
function normalizePlanEntry(value) {
|
|
139
|
+
if (!isRecord(value)) return;
|
|
140
|
+
const content = asTrimmedString(value.content);
|
|
141
|
+
const status = asTrimmedString(value.status);
|
|
142
|
+
if (!content || !isPlanEntryStatus(status)) return;
|
|
143
|
+
const priority = asTrimmedString(value.priority);
|
|
144
|
+
return {
|
|
145
|
+
content,
|
|
146
|
+
status,
|
|
147
|
+
...isPlanEntryPriority(priority) ? { priority } : {}
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Documented allowlist for text_delta.meta origin fields.
|
|
152
|
+
* Only these keys may be copied from ACP update `_meta`.
|
|
153
|
+
* Unknown keys (including secret-like producer-controlled names) are dropped.
|
|
154
|
+
*/
|
|
155
|
+
const ORIGIN_META_KEYS = [
|
|
156
|
+
"origin",
|
|
157
|
+
"kind",
|
|
158
|
+
"source"
|
|
159
|
+
];
|
|
160
|
+
/**
|
|
161
|
+
* Preserve a fail-closed subset of ACP update origin fields for text_delta
|
|
162
|
+
* consumers. Empty or unusable values are omitted rather than inferred.
|
|
163
|
+
*/
|
|
164
|
+
function extractTextDeltaOrigin(payload) {
|
|
165
|
+
const messageId = asOptionalString(payload.messageId);
|
|
166
|
+
const meta = sanitizeOriginMeta(payload._meta);
|
|
167
|
+
return {
|
|
168
|
+
...messageId ? { messageId } : {},
|
|
169
|
+
...meta ? { meta } : {}
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Copy only allowlisted string origin keys from wire `_meta`.
|
|
174
|
+
* Nested objects, arrays, non-strings, and unknown keys are dropped.
|
|
175
|
+
*/
|
|
176
|
+
function sanitizeOriginMeta(value) {
|
|
177
|
+
if (!isRecord(value)) return;
|
|
178
|
+
const out = {};
|
|
179
|
+
for (const key of ORIGIN_META_KEYS) {
|
|
180
|
+
const entry = value[key];
|
|
181
|
+
if (typeof entry !== "string") continue;
|
|
182
|
+
const trimmed = entry.trim();
|
|
183
|
+
if (!trimmed) continue;
|
|
184
|
+
out[key] = trimmed;
|
|
185
|
+
}
|
|
186
|
+
return Object.keys(out).length > 0 ? out : void 0;
|
|
187
|
+
}
|
|
188
|
+
function resolveTextChunk(params) {
|
|
189
|
+
const origin = extractTextDeltaOrigin(params.payload);
|
|
190
|
+
const contentRaw = params.payload.content;
|
|
191
|
+
if (isRecord(contentRaw)) {
|
|
192
|
+
const contentType = asTrimmedString(contentRaw.type);
|
|
193
|
+
if (contentType && contentType !== "text") return null;
|
|
194
|
+
const text = asString(contentRaw.text);
|
|
195
|
+
if (typeof text === "string" && (text.length > 0 || origin.messageId)) return {
|
|
196
|
+
type: "text_delta",
|
|
197
|
+
text,
|
|
198
|
+
stream: params.stream,
|
|
199
|
+
tag: params.tag,
|
|
200
|
+
...origin
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
const text = asString(params.payload.text);
|
|
204
|
+
if (typeof text !== "string" || text.length === 0 && !origin.messageId) return null;
|
|
205
|
+
return {
|
|
206
|
+
type: "text_delta",
|
|
207
|
+
text,
|
|
208
|
+
stream: params.stream,
|
|
209
|
+
tag: params.tag,
|
|
210
|
+
...origin
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
function readFirstString(record, keys) {
|
|
214
|
+
for (const key of keys) {
|
|
215
|
+
const value = asOptionalString(record[key]);
|
|
216
|
+
if (value) return value;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
function readFirstStringArray(record, keys) {
|
|
220
|
+
for (const key of keys) {
|
|
221
|
+
const value = record[key];
|
|
222
|
+
if (!Array.isArray(value)) continue;
|
|
223
|
+
const entries = value.map((entry) => asOptionalString(entry)).filter((entry) => entry !== void 0);
|
|
224
|
+
if (entries.length > 0) return entries;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
function summarizeToolInput(rawInput) {
|
|
228
|
+
if (rawInput == null) return;
|
|
229
|
+
if (typeof rawInput === "string" || typeof rawInput === "number" || typeof rawInput === "boolean") return String(rawInput);
|
|
230
|
+
if (!isRecord(rawInput)) return;
|
|
231
|
+
const command = readFirstString(rawInput, [
|
|
232
|
+
"command",
|
|
233
|
+
"cmd",
|
|
234
|
+
"program"
|
|
235
|
+
]);
|
|
236
|
+
const args = readFirstStringArray(rawInput, ["args", "arguments"]);
|
|
237
|
+
if (command) return [command, ...args ?? []].join(" ");
|
|
238
|
+
return readFirstString(rawInput, [
|
|
239
|
+
"path",
|
|
240
|
+
"file",
|
|
241
|
+
"filePath",
|
|
242
|
+
"filepath",
|
|
243
|
+
"target",
|
|
244
|
+
"uri",
|
|
245
|
+
"url",
|
|
246
|
+
"query",
|
|
247
|
+
"pattern",
|
|
248
|
+
"text",
|
|
249
|
+
"search"
|
|
250
|
+
]);
|
|
251
|
+
}
|
|
252
|
+
function truncateToolSummary(value) {
|
|
253
|
+
if (value.length <= TOOL_OUTPUT_SUMMARY_MAX_CHARS) return value;
|
|
254
|
+
return `${value.slice(0, 499)}…`;
|
|
255
|
+
}
|
|
256
|
+
function readToolContentText(value) {
|
|
257
|
+
const record = isRecord(value) ? value : void 0;
|
|
258
|
+
if (!record) return;
|
|
259
|
+
if (record.type === "content") return readToolContentText(record.content);
|
|
260
|
+
return toolContentTextReader(String(record.type))?.(record);
|
|
261
|
+
}
|
|
262
|
+
const TOOL_CONTENT_TEXT_READERS = {
|
|
263
|
+
text: (record) => asString(record.text),
|
|
264
|
+
audio: (record) => `[audio] ${asOptionalString(record.mimeType) || "audio"}`,
|
|
265
|
+
resource_link: (record) => asOptionalString(record.title) || asOptionalString(record.name) || asOptionalString(record.uri),
|
|
266
|
+
resource: (record) => {
|
|
267
|
+
const resource = isRecord(record.resource) ? record.resource : void 0;
|
|
268
|
+
return asString(resource?.text) || asOptionalString(resource?.uri);
|
|
269
|
+
},
|
|
270
|
+
diff: (record) => `diff ${asOptionalString(record.path) || "file"}`,
|
|
271
|
+
terminal: (record) => {
|
|
272
|
+
const terminalId = asOptionalString(record.terminalId) || asOptionalString(record.id);
|
|
273
|
+
return terminalId ? `[terminal] ${terminalId}` : "[terminal]";
|
|
274
|
+
}
|
|
275
|
+
};
|
|
276
|
+
function toolContentTextReader(type) {
|
|
277
|
+
return Object.hasOwn(TOOL_CONTENT_TEXT_READERS, type) ? TOOL_CONTENT_TEXT_READERS[type] : void 0;
|
|
278
|
+
}
|
|
279
|
+
function summarizeToolContent(content) {
|
|
280
|
+
if (!Array.isArray(content)) return;
|
|
281
|
+
const fragments = content.map((entry) => readToolContentText(entry)?.trim()).filter((entry) => Boolean(entry));
|
|
282
|
+
if (fragments.length === 0) return;
|
|
283
|
+
return truncateToolSummary([...new Set(fragments)].join("\n"));
|
|
284
|
+
}
|
|
285
|
+
function summarizeToolOutput(rawOutput) {
|
|
286
|
+
if (rawOutput == null) return;
|
|
287
|
+
if (isScalarToolOutput(rawOutput)) return truncateToolSummary(String(rawOutput));
|
|
288
|
+
const record = isRecord(rawOutput) ? rawOutput : void 0;
|
|
289
|
+
if (!record) return;
|
|
290
|
+
return truncateToolSummary(readFirstString(record, [
|
|
291
|
+
"text",
|
|
292
|
+
"message",
|
|
293
|
+
"error",
|
|
294
|
+
"stdout",
|
|
295
|
+
"stderr",
|
|
296
|
+
"content"
|
|
297
|
+
]) ?? "") || void 0;
|
|
298
|
+
}
|
|
299
|
+
function isScalarToolOutput(value) {
|
|
300
|
+
return typeof value === "string" || typeof value === "number" || typeof value === "boolean";
|
|
301
|
+
}
|
|
302
|
+
function readToolKind(value) {
|
|
303
|
+
const kind = asOptionalString(value);
|
|
304
|
+
return kind && TOOL_KINDS.has(kind) ? kind : void 0;
|
|
305
|
+
}
|
|
306
|
+
const TOOL_KINDS = /* @__PURE__ */ new Set([
|
|
307
|
+
"read",
|
|
308
|
+
"edit",
|
|
309
|
+
"delete",
|
|
310
|
+
"move",
|
|
311
|
+
"search",
|
|
312
|
+
"execute",
|
|
313
|
+
"fetch",
|
|
314
|
+
"think",
|
|
315
|
+
"switch_mode",
|
|
316
|
+
"other"
|
|
317
|
+
]);
|
|
318
|
+
function createToolCallEvent(params) {
|
|
319
|
+
const title = asTrimmedString(params.payload.title) || "tool call";
|
|
320
|
+
const status = asTrimmedString(params.payload.status);
|
|
321
|
+
const inputSummary = summarizeToolInput(params.payload.rawInput);
|
|
322
|
+
const outputSummary = summarizeToolContent(params.payload.content) ?? summarizeToolOutput(params.payload.rawOutput);
|
|
323
|
+
const toolCallId = asOptionalString(params.payload.toolCallId);
|
|
324
|
+
const kind = readToolKind(params.payload.kind);
|
|
325
|
+
const summaryText = status ? `${title} (${status})` : title;
|
|
326
|
+
const detailSummary = params.tag === "tool_call_update" ? outputSummary ?? inputSummary : inputSummary ?? outputSummary;
|
|
327
|
+
const event = {
|
|
328
|
+
type: "tool_call",
|
|
329
|
+
text: detailSummary ? `${summaryText}: ${detailSummary}` : summaryText,
|
|
330
|
+
tag: params.tag,
|
|
331
|
+
title
|
|
332
|
+
};
|
|
333
|
+
assignToolCallEventMetadata(event, params.payload, {
|
|
334
|
+
toolCallId,
|
|
335
|
+
status,
|
|
336
|
+
kind
|
|
337
|
+
});
|
|
338
|
+
return event;
|
|
339
|
+
}
|
|
340
|
+
function assignToolCallEventMetadata(event, payload, values) {
|
|
341
|
+
if (event.type !== "tool_call") return;
|
|
342
|
+
if (values.toolCallId) event.toolCallId = values.toolCallId;
|
|
343
|
+
if (values.status) event.status = values.status;
|
|
344
|
+
if (values.kind) event.kind = values.kind;
|
|
345
|
+
assignForwardedToolPayload(event, payload);
|
|
346
|
+
}
|
|
347
|
+
function assignForwardedToolPayload(event, payload) {
|
|
348
|
+
const snapshot = JSON.parse(JSON.stringify(payload));
|
|
349
|
+
if (Array.isArray(snapshot.locations)) event.locations = snapshot.locations;
|
|
350
|
+
if (Object.prototype.hasOwnProperty.call(snapshot, "rawInput")) event.rawInput = snapshot.rawInput;
|
|
351
|
+
if (Object.prototype.hasOwnProperty.call(snapshot, "rawOutput")) event.rawOutput = snapshot.rawOutput;
|
|
352
|
+
if (Array.isArray(snapshot.content)) event.content = snapshot.content;
|
|
353
|
+
if (isRecord(snapshot._meta)) event._meta = snapshot._meta;
|
|
354
|
+
}
|
|
355
|
+
function runtimeEventFromMessage(message) {
|
|
356
|
+
if (!isRecord(message)) return null;
|
|
357
|
+
if (asTrimmedString(message.method) !== "session/update") return message.type === "client_operation" ? clientOperationEvent(message) : null;
|
|
358
|
+
const params = message.params;
|
|
359
|
+
if (!isRecord(params) || !isRecord(params.update)) return null;
|
|
360
|
+
const payload = params.update;
|
|
361
|
+
const parser = promptEventParser(asTrimmedString(payload.sessionUpdate));
|
|
362
|
+
return parser ? parser(payload) : null;
|
|
363
|
+
}
|
|
364
|
+
const PROMPT_EVENT_PARSERS = {
|
|
365
|
+
tool_call: (payload) => createToolCallEvent({
|
|
366
|
+
payload,
|
|
367
|
+
tag: "tool_call"
|
|
368
|
+
}),
|
|
369
|
+
tool_call_update: (payload) => createToolCallEvent({
|
|
370
|
+
payload,
|
|
371
|
+
tag: "tool_call_update"
|
|
372
|
+
}),
|
|
373
|
+
agent_message_chunk: (payload) => resolveTextChunk({
|
|
374
|
+
payload,
|
|
375
|
+
stream: "output",
|
|
376
|
+
tag: "agent_message_chunk"
|
|
377
|
+
}),
|
|
378
|
+
agent_thought_chunk: (payload) => resolveTextChunk({
|
|
379
|
+
payload,
|
|
380
|
+
stream: "thought",
|
|
381
|
+
tag: "agent_thought_chunk"
|
|
382
|
+
}),
|
|
383
|
+
usage_update: usageUpdateEvent,
|
|
384
|
+
available_commands_update: availableCommandsUpdateEvent,
|
|
385
|
+
current_mode_update: (payload) => statusUpdateEvent("current_mode_update", payload),
|
|
386
|
+
config_option_update: (payload) => statusUpdateEvent("config_option_update", payload),
|
|
387
|
+
session_info_update: (payload) => statusUpdateEvent("session_info_update", payload),
|
|
388
|
+
plan: planUpdateEvent
|
|
389
|
+
};
|
|
390
|
+
function promptEventParser(type) {
|
|
391
|
+
return Object.hasOwn(PROMPT_EVENT_PARSERS, type) ? PROMPT_EVENT_PARSERS[type] : void 0;
|
|
392
|
+
}
|
|
393
|
+
function usageUpdateEvent(payload) {
|
|
394
|
+
const used = asOptionalFiniteNumber(payload.used);
|
|
395
|
+
const size = asOptionalFiniteNumber(payload.size);
|
|
396
|
+
const meta = isRecord(payload._meta) ? payload._meta : void 0;
|
|
397
|
+
return buildUsageUpdateEvent({
|
|
398
|
+
used,
|
|
399
|
+
size,
|
|
400
|
+
cost: normalizeUsageCost(payload.cost),
|
|
401
|
+
breakdown: normalizeUsageBreakdown(meta?.usage),
|
|
402
|
+
meta
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
function buildUsageUpdateEvent(parts) {
|
|
406
|
+
const { used, size, cost, breakdown, meta } = parts;
|
|
407
|
+
return {
|
|
408
|
+
type: "status",
|
|
409
|
+
text: used != null && size != null ? `usage updated: ${used}/${size}` : "usage updated",
|
|
410
|
+
tag: "usage_update",
|
|
411
|
+
...used != null ? { used } : {},
|
|
412
|
+
...size != null ? { size } : {},
|
|
413
|
+
...cost ? { cost } : {},
|
|
414
|
+
...breakdown ? { breakdown } : {},
|
|
415
|
+
...meta ? { _meta: meta } : {}
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
function availableCommandsUpdateEvent(payload) {
|
|
419
|
+
const raw = Array.isArray(payload.availableCommands) ? payload.availableCommands : [];
|
|
420
|
+
const availableCommands = [];
|
|
421
|
+
for (const entry of raw) {
|
|
422
|
+
if (!isRecord(entry)) continue;
|
|
423
|
+
const name = asTrimmedString(entry.name);
|
|
424
|
+
if (!name) continue;
|
|
425
|
+
const description = asTrimmedString(entry.description);
|
|
426
|
+
availableCommands.push({
|
|
427
|
+
name,
|
|
428
|
+
...description ? { description } : {},
|
|
429
|
+
hasInput: entry.input != null
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
return {
|
|
433
|
+
type: "status",
|
|
434
|
+
text: availableCommands.length > 0 ? `available commands updated (${availableCommands.length})` : "available commands updated",
|
|
435
|
+
tag: "available_commands_update",
|
|
436
|
+
availableCommands
|
|
437
|
+
};
|
|
438
|
+
}
|
|
439
|
+
function normalizeUsageCost(value) {
|
|
440
|
+
if (!isRecord(value)) return;
|
|
441
|
+
const amount = asOptionalFiniteNumber(value.amount);
|
|
442
|
+
const currency = asTrimmedString(value.currency);
|
|
443
|
+
if (amount == null && !currency) return;
|
|
444
|
+
return {
|
|
445
|
+
...amount != null ? { amount } : {},
|
|
446
|
+
...currency ? { currency } : {}
|
|
447
|
+
};
|
|
448
|
+
}
|
|
449
|
+
const USAGE_BREAKDOWN_FIELDS = [
|
|
450
|
+
["inputTokens", ["inputTokens", "input_tokens"]],
|
|
451
|
+
["outputTokens", ["outputTokens", "output_tokens"]],
|
|
452
|
+
["cachedReadTokens", [
|
|
453
|
+
"cachedReadTokens",
|
|
454
|
+
"cacheReadInputTokens",
|
|
455
|
+
"cache_read_input_tokens"
|
|
456
|
+
]],
|
|
457
|
+
["cachedWriteTokens", [
|
|
458
|
+
"cachedWriteTokens",
|
|
459
|
+
"cacheCreationInputTokens",
|
|
460
|
+
"cache_creation_input_tokens"
|
|
461
|
+
]],
|
|
462
|
+
["thoughtTokens", ["thoughtTokens", "thought_tokens"]],
|
|
463
|
+
["totalTokens", ["totalTokens", "total_tokens"]]
|
|
464
|
+
];
|
|
465
|
+
function normalizeUsageBreakdown(value) {
|
|
466
|
+
if (!isRecord(value)) return;
|
|
467
|
+
const breakdown = {};
|
|
468
|
+
for (const [key, aliases] of USAGE_BREAKDOWN_FIELDS) {
|
|
469
|
+
const v = firstFiniteNumber(value, aliases);
|
|
470
|
+
if (v != null) breakdown[key] = v;
|
|
471
|
+
}
|
|
472
|
+
return Object.keys(breakdown).length > 0 ? breakdown : void 0;
|
|
473
|
+
}
|
|
474
|
+
function firstFiniteNumber(record, keys) {
|
|
475
|
+
for (const key of keys) {
|
|
476
|
+
const value = asOptionalFiniteNumber(record[key]);
|
|
477
|
+
if (value != null) return value;
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
function statusUpdateEvent(tag, payload) {
|
|
481
|
+
const text = resolveStatusTextForTag({
|
|
482
|
+
tag,
|
|
483
|
+
payload
|
|
484
|
+
});
|
|
485
|
+
if (!text) return null;
|
|
486
|
+
return {
|
|
487
|
+
type: "status",
|
|
488
|
+
text,
|
|
489
|
+
tag,
|
|
490
|
+
...isRecord(payload._meta) ? { _meta: payload._meta } : {}
|
|
491
|
+
};
|
|
492
|
+
}
|
|
493
|
+
function clientOperationEvent(payload) {
|
|
494
|
+
return {
|
|
495
|
+
type: "status",
|
|
496
|
+
text: [
|
|
497
|
+
asTrimmedString(payload.method) || "operation",
|
|
498
|
+
asTrimmedString(payload.status),
|
|
499
|
+
asTrimmedString(payload.summary)
|
|
500
|
+
].filter(Boolean).join(" ")
|
|
501
|
+
};
|
|
502
|
+
}
|
|
503
|
+
// src/runtime/public/probe.ts
|
|
504
|
+
/**
|
|
505
|
+
* Inspect session model metadata without a runtime store or prompt. The agent
|
|
506
|
+
* may create native session history; only its owned transport is closed.
|
|
507
|
+
*/
|
|
508
|
+
async function inspectAgentModels(options) {
|
|
509
|
+
options.signal?.throwIfAborted();
|
|
510
|
+
const timeoutMs = options.timeoutMs ?? 12e4;
|
|
511
|
+
if (!Number.isFinite(timeoutMs) || timeoutMs <= 0 || timeoutMs > 2147483647) throw new RangeError("Model inspection timeoutMs must be positive and at most 2147483647");
|
|
512
|
+
const deadline = new AbortController();
|
|
513
|
+
const signal = options.signal ? AbortSignal.any([options.signal, deadline.signal]) : deadline.signal;
|
|
514
|
+
const assertActive = () => signal.throwIfAborted();
|
|
515
|
+
const client = new AcpClient({
|
|
516
|
+
...normalizeAgentCommandInput(options.agentCommand),
|
|
517
|
+
cwd: options.cwd,
|
|
518
|
+
agentProcessEnv: options.agentProcessEnv,
|
|
519
|
+
agentProcessEnvAllow: options.agentProcessEnvAllow,
|
|
520
|
+
agentProcessEnvBlock: options.agentProcessEnvBlock,
|
|
521
|
+
permissionMode: "deny-all",
|
|
522
|
+
nonInteractivePermissions: "deny",
|
|
523
|
+
fs: false,
|
|
524
|
+
terminal: false,
|
|
525
|
+
processLifecycle: {
|
|
526
|
+
onBeforeSpawn: assertActive,
|
|
527
|
+
onSpawned: assertActive
|
|
528
|
+
}
|
|
529
|
+
});
|
|
530
|
+
const timer = setTimeout(() => deadline.abort(new TimeoutError(timeoutMs)), timeoutMs);
|
|
531
|
+
let onAbort;
|
|
532
|
+
const aborted = new Promise((_resolve, reject) => {
|
|
533
|
+
onAbort = () => reject(signal.reason);
|
|
534
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
535
|
+
});
|
|
536
|
+
const inspection = (async () => {
|
|
537
|
+
assertActive();
|
|
538
|
+
await client.start();
|
|
539
|
+
assertActive();
|
|
540
|
+
const { models } = await client.createSession();
|
|
541
|
+
assertActive();
|
|
542
|
+
return models ? {
|
|
543
|
+
currentModelId: models.currentModelId,
|
|
544
|
+
availableModelIds: models.availableModels.map((model) => model.modelId),
|
|
545
|
+
availableModels: models.availableModels
|
|
546
|
+
} : void 0;
|
|
547
|
+
})();
|
|
548
|
+
try {
|
|
549
|
+
return await Promise.race([inspection, aborted]);
|
|
550
|
+
} finally {
|
|
551
|
+
clearTimeout(timer);
|
|
552
|
+
signal.removeEventListener("abort", onAbort);
|
|
553
|
+
try {
|
|
554
|
+
if (signal.aborted) await client.close();
|
|
555
|
+
} finally {
|
|
556
|
+
await inspection.catch(() => {});
|
|
557
|
+
await client.close();
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
function isPrimitiveDetail(value) {
|
|
562
|
+
return value == null || typeof value === "number" || typeof value === "boolean" || typeof value === "bigint" || typeof value === "symbol";
|
|
563
|
+
}
|
|
564
|
+
function formatFunctionDetail(value) {
|
|
565
|
+
return value.name ? `[Function ${value.name}]` : "[Function]";
|
|
566
|
+
}
|
|
567
|
+
function serializeRuntimeDetail(value) {
|
|
568
|
+
const seen = /* @__PURE__ */ new WeakSet();
|
|
569
|
+
return JSON.stringify(value, (_key, nested) => {
|
|
570
|
+
if (nested instanceof Error) return nested.message || nested.name;
|
|
571
|
+
if (nested && typeof nested === "object") {
|
|
572
|
+
if (seen.has(nested)) return "[Circular]";
|
|
573
|
+
seen.add(nested);
|
|
574
|
+
}
|
|
575
|
+
return nested;
|
|
576
|
+
}) ?? "undefined";
|
|
577
|
+
}
|
|
578
|
+
function formatRuntimeDetail(value) {
|
|
579
|
+
if (value instanceof Error) return value.message || value.name;
|
|
580
|
+
if (typeof value === "string") return value;
|
|
581
|
+
if (isPrimitiveDetail(value)) return String(value);
|
|
582
|
+
if (typeof value === "function") return formatFunctionDetail(value);
|
|
583
|
+
try {
|
|
584
|
+
return serializeRuntimeDetail(value);
|
|
585
|
+
} catch {
|
|
586
|
+
return "unserializable object";
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
function normalizeRuntimeDetails(details) {
|
|
590
|
+
return details?.map((detail) => formatRuntimeDetail(detail));
|
|
591
|
+
}
|
|
592
|
+
async function probeRuntime(options, deps = {}) {
|
|
593
|
+
const agentName = options.probeAgent?.trim() || "codex";
|
|
594
|
+
const agentCommand = normalizeAgentCommandInput(options.agentRegistry.resolve(agentName));
|
|
595
|
+
const client = createProbeClient(options, agentName, agentCommand, deps);
|
|
596
|
+
try {
|
|
597
|
+
await client.start();
|
|
598
|
+
return {
|
|
599
|
+
ok: true,
|
|
600
|
+
message: "embedded ACP runtime ready",
|
|
601
|
+
details: [
|
|
602
|
+
`agent=${agentName}`,
|
|
603
|
+
`command=${agentCommand.agentCommand}`,
|
|
604
|
+
`cwd=${options.cwd}`,
|
|
605
|
+
...client.initializeResult?.protocolVersion ? [`protocolVersion=${client.initializeResult.protocolVersion}`] : []
|
|
606
|
+
]
|
|
607
|
+
};
|
|
608
|
+
} catch (error) {
|
|
609
|
+
return {
|
|
610
|
+
ok: false,
|
|
611
|
+
message: "embedded ACP runtime probe failed",
|
|
612
|
+
details: [
|
|
613
|
+
`agent=${agentName}`,
|
|
614
|
+
`command=${agentCommand.agentCommand}`,
|
|
615
|
+
`cwd=${options.cwd}`,
|
|
616
|
+
formatRuntimeDetail(error)
|
|
617
|
+
]
|
|
618
|
+
};
|
|
619
|
+
} finally {
|
|
620
|
+
await client.close().catch(() => {});
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
function createProbeClient(options, agentName, agentCommand, deps) {
|
|
624
|
+
const clientOptions = {
|
|
625
|
+
...agentCommand,
|
|
626
|
+
cwd: options.cwd,
|
|
627
|
+
agentProcessEnv: options.agentProcessEnv,
|
|
628
|
+
agentProcessEnvAllow: options.agentProcessEnvAllow,
|
|
629
|
+
agentProcessEnvBlock: options.agentProcessEnvBlock,
|
|
630
|
+
mcpServers: typeof options.mcpServers === "function" ? [] : [...options.mcpServers ?? []],
|
|
631
|
+
permissionMode: options.permissionMode,
|
|
632
|
+
nonInteractivePermissions: options.nonInteractivePermissions,
|
|
633
|
+
permissionPolicy: options.permissionPolicy,
|
|
634
|
+
fs: false,
|
|
635
|
+
terminal: false,
|
|
636
|
+
processLifecycle: options.processLifecycle,
|
|
637
|
+
processLaunchScope: {
|
|
638
|
+
kind: "runtime-probe",
|
|
639
|
+
agent: agentName
|
|
640
|
+
},
|
|
641
|
+
verbose: options.verbose
|
|
642
|
+
};
|
|
643
|
+
return deps.clientFactory?.(clientOptions) ?? new AcpClient(clientOptions);
|
|
644
|
+
}
|
|
645
|
+
// src/runtime/engine/reuse-policy.ts
|
|
646
|
+
function shouldReuseExistingRecord(record, params) {
|
|
647
|
+
if (record.acpx?.reset_on_next_ensure === true) return false;
|
|
648
|
+
if (path.resolve(record.cwd) !== path.resolve(params.cwd)) return false;
|
|
649
|
+
if (record.agentCommand !== params.agentCommand) return false;
|
|
650
|
+
if (!sameArgv(record.agentArgv, params.agentArgv)) return false;
|
|
651
|
+
if (params.resumeSessionId && record.acpSessionId !== params.resumeSessionId) return false;
|
|
652
|
+
return true;
|
|
653
|
+
}
|
|
654
|
+
function sameArgv(left, right) {
|
|
655
|
+
const leftValues = left ?? [];
|
|
656
|
+
const rightValues = right ?? [];
|
|
657
|
+
return leftValues.length === rightValues.length && leftValues.every((value, index) => value === rightValues[index]);
|
|
658
|
+
}
|
|
659
|
+
// src/runtime/engine/status.ts
|
|
660
|
+
function runtimeStatusFromRecord(record) {
|
|
661
|
+
return {
|
|
662
|
+
...record.lastRequestId ? { lastRequestId: record.lastRequestId } : {},
|
|
663
|
+
summary: statusSummary(record),
|
|
664
|
+
acpxRecordId: record.acpxRecordId,
|
|
665
|
+
backendSessionId: record.acpSessionId,
|
|
666
|
+
agentSessionId: record.agentSessionId,
|
|
667
|
+
...buildModelsField(record),
|
|
668
|
+
...buildUsageField(record),
|
|
669
|
+
...buildAvailableCommandsField(record),
|
|
670
|
+
details: {
|
|
671
|
+
cwd: record.cwd,
|
|
672
|
+
lastUsedAt: record.lastUsedAt,
|
|
673
|
+
closed: record.closed === true,
|
|
674
|
+
...record.acpx?.config_options !== void 0 ? { configOptions: structuredClone(record.acpx.config_options) } : {}
|
|
675
|
+
}
|
|
676
|
+
};
|
|
677
|
+
}
|
|
678
|
+
function statusSummary(record) {
|
|
679
|
+
return [
|
|
680
|
+
`session=${record.acpxRecordId}`,
|
|
681
|
+
`backendSessionId=${record.acpSessionId}`,
|
|
682
|
+
record.agentSessionId ? `agentSessionId=${record.agentSessionId}` : null,
|
|
683
|
+
record.pid != null ? `pid=${record.pid}` : null,
|
|
684
|
+
record.closed ? "closed" : "open"
|
|
685
|
+
].filter(Boolean).join(" ");
|
|
686
|
+
}
|
|
687
|
+
function buildModelsField(record) {
|
|
688
|
+
const { available_models: available = [], current_model_id: currentModelId } = record.acpx ?? {};
|
|
689
|
+
if (available.length === 0 && currentModelId === void 0) return {};
|
|
690
|
+
return { models: {
|
|
691
|
+
...currentModelId !== void 0 ? { currentModelId } : {},
|
|
692
|
+
availableModelIds: [...available],
|
|
693
|
+
...buildModelNamesField(record.acpx)
|
|
694
|
+
} };
|
|
695
|
+
}
|
|
696
|
+
function buildModelNamesField(state) {
|
|
697
|
+
const models = advertisedModelState(state);
|
|
698
|
+
return models && (models.configId || state?.available_model_names !== void 0) ? { availableModels: models.availableModels } : {};
|
|
699
|
+
}
|
|
700
|
+
function tokenUsageToBreakdown(usage) {
|
|
701
|
+
if (!usage) return;
|
|
702
|
+
const breakdown = {};
|
|
703
|
+
assignUsageBreakdownField(breakdown, "inputTokens", usage.input_tokens);
|
|
704
|
+
assignUsageBreakdownField(breakdown, "outputTokens", usage.output_tokens);
|
|
705
|
+
assignUsageBreakdownField(breakdown, "cachedReadTokens", usage.cache_read_input_tokens);
|
|
706
|
+
assignUsageBreakdownField(breakdown, "cachedWriteTokens", usage.cache_creation_input_tokens);
|
|
707
|
+
assignUsageBreakdownField(breakdown, "thoughtTokens", usage.thought_tokens);
|
|
708
|
+
assignUsageBreakdownField(breakdown, "totalTokens", usage.total_tokens);
|
|
709
|
+
return Object.keys(breakdown).length > 0 ? breakdown : void 0;
|
|
710
|
+
}
|
|
711
|
+
function assignUsageBreakdownField(breakdown, key, value) {
|
|
712
|
+
if (value !== void 0) breakdown[key] = value;
|
|
713
|
+
}
|
|
714
|
+
function buildUsageField(record) {
|
|
715
|
+
const cumulative = tokenUsageToBreakdown(record.cumulative_token_usage);
|
|
716
|
+
const perRequestEntries = Object.entries(record.request_token_usage ?? {}).map(([id, value]) => [id, tokenUsageToBreakdown(value)]).filter((entry) => entry[1] !== void 0);
|
|
717
|
+
const perRequest = perRequestEntries.length > 0 ? Object.fromEntries(perRequestEntries) : void 0;
|
|
718
|
+
const cost = record.cumulative_cost;
|
|
719
|
+
const usage = {
|
|
720
|
+
...cumulative ? { cumulative } : {},
|
|
721
|
+
...cost ? { cost } : {},
|
|
722
|
+
...perRequest ? { perRequest } : {}
|
|
723
|
+
};
|
|
724
|
+
return Object.keys(usage).length > 0 ? { usage } : {};
|
|
725
|
+
}
|
|
726
|
+
function buildAvailableCommandsField(record) {
|
|
727
|
+
const commands = record.acpx?.available_commands;
|
|
728
|
+
if (!commands || commands.length === 0) return {};
|
|
729
|
+
const availableCommands = commands.map((command) => runtimeAvailableCommand(command)).filter((command) => command !== void 0);
|
|
730
|
+
return availableCommands.length > 0 ? { availableCommands } : {};
|
|
731
|
+
}
|
|
732
|
+
function runtimeAvailableCommand(command) {
|
|
733
|
+
if (typeof command === "string") {
|
|
734
|
+
const name = command.trim();
|
|
735
|
+
return name ? { name } : void 0;
|
|
736
|
+
}
|
|
737
|
+
const record = commandRecord(command);
|
|
738
|
+
if (!record) return;
|
|
739
|
+
const name = asOptionalString(record.name);
|
|
740
|
+
if (!name) return;
|
|
741
|
+
const runtimeCommand = { name };
|
|
742
|
+
const description = asOptionalString(record.description);
|
|
743
|
+
if (description) runtimeCommand.description = description;
|
|
744
|
+
if (typeof record.has_input === "boolean") runtimeCommand.hasInput = record.has_input;
|
|
745
|
+
return runtimeCommand;
|
|
746
|
+
}
|
|
747
|
+
function commandRecord(value) {
|
|
748
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return;
|
|
749
|
+
return value;
|
|
750
|
+
}
|
|
751
|
+
// src/runtime/engine/turn.ts
|
|
752
|
+
function createDeferred() {
|
|
753
|
+
let resolve;
|
|
754
|
+
let reject;
|
|
755
|
+
return {
|
|
756
|
+
promise: new Promise((res, rej) => {
|
|
757
|
+
resolve = res;
|
|
758
|
+
reject = rej;
|
|
759
|
+
}),
|
|
760
|
+
resolve,
|
|
761
|
+
reject
|
|
762
|
+
};
|
|
763
|
+
}
|
|
764
|
+
var AsyncEventQueue = class {
|
|
765
|
+
items = [];
|
|
766
|
+
waits = [];
|
|
767
|
+
closed = false;
|
|
768
|
+
push(item) {
|
|
769
|
+
if (this.closed) return;
|
|
770
|
+
const waiter = this.waits.shift();
|
|
771
|
+
if (waiter) {
|
|
772
|
+
waiter.resolve(item);
|
|
773
|
+
return;
|
|
774
|
+
}
|
|
775
|
+
this.items.push(item);
|
|
776
|
+
}
|
|
777
|
+
close() {
|
|
778
|
+
if (this.closed) return;
|
|
779
|
+
this.closed = true;
|
|
780
|
+
for (const waiter of this.waits.splice(0)) waiter.resolve(null);
|
|
781
|
+
}
|
|
782
|
+
clear() {
|
|
783
|
+
this.items.length = 0;
|
|
784
|
+
}
|
|
785
|
+
async next() {
|
|
786
|
+
if (this.items.length > 0) return this.items.shift() ?? null;
|
|
787
|
+
if (this.closed) return null;
|
|
788
|
+
const waiter = createDeferred();
|
|
789
|
+
this.waits.push(waiter);
|
|
790
|
+
return await waiter.promise;
|
|
791
|
+
}
|
|
792
|
+
async *iterate() {
|
|
793
|
+
try {
|
|
794
|
+
while (true) {
|
|
795
|
+
const next = await this.next();
|
|
796
|
+
if (!next) return;
|
|
797
|
+
yield next;
|
|
798
|
+
}
|
|
799
|
+
} finally {
|
|
800
|
+
this.close();
|
|
801
|
+
this.clear();
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
};
|
|
805
|
+
function toPromptInput(text, attachments) {
|
|
806
|
+
if (!attachments || attachments.length === 0) return text;
|
|
807
|
+
const blocks = [];
|
|
808
|
+
if (text) blocks.push({
|
|
809
|
+
type: "text",
|
|
810
|
+
text
|
|
811
|
+
});
|
|
812
|
+
for (const attachment of attachments) {
|
|
813
|
+
if (attachment.mediaType.startsWith("image/")) {
|
|
814
|
+
blocks.push({
|
|
815
|
+
type: "image",
|
|
816
|
+
mimeType: attachment.mediaType,
|
|
817
|
+
data: attachment.data
|
|
818
|
+
});
|
|
819
|
+
continue;
|
|
820
|
+
}
|
|
821
|
+
if (attachment.mediaType.startsWith("audio/")) {
|
|
822
|
+
blocks.push({
|
|
823
|
+
type: "audio",
|
|
824
|
+
mimeType: attachment.mediaType,
|
|
825
|
+
data: attachment.data
|
|
826
|
+
});
|
|
827
|
+
continue;
|
|
828
|
+
}
|
|
829
|
+
throw new AcpRuntimeError("ACP_TURN_FAILED", `Unsupported ACP runtime attachment media type: ${attachment.mediaType}`);
|
|
830
|
+
}
|
|
831
|
+
return blocks.length > 0 ? blocks : textPrompt(text);
|
|
832
|
+
}
|
|
833
|
+
function legacyTerminalEventFromTurnResult(result) {
|
|
834
|
+
if (result.status === "failed") return {
|
|
835
|
+
type: "error",
|
|
836
|
+
message: result.error.message,
|
|
837
|
+
...result.error.code ? { code: result.error.code } : {},
|
|
838
|
+
...result.error.detailCode ? { detailCode: result.error.detailCode } : {},
|
|
839
|
+
...result.error.retryable === void 0 ? {} : { retryable: result.error.retryable }
|
|
840
|
+
};
|
|
841
|
+
return {
|
|
842
|
+
type: "done",
|
|
843
|
+
...result.stopReason ? { stopReason: result.stopReason } : {},
|
|
844
|
+
...result._meta === void 0 ? {} : { _meta: result._meta }
|
|
845
|
+
};
|
|
846
|
+
}
|
|
847
|
+
// src/runtime/engine/manager.ts
|
|
848
|
+
async function settleAttempt(run) {
|
|
849
|
+
try {
|
|
850
|
+
return {
|
|
851
|
+
ok: true,
|
|
852
|
+
value: await run()
|
|
853
|
+
};
|
|
854
|
+
} catch (error) {
|
|
855
|
+
return {
|
|
856
|
+
ok: false,
|
|
857
|
+
error
|
|
858
|
+
};
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
function firstFailedAttempt(attempts) {
|
|
862
|
+
return attempts.find((attempt) => !attempt.ok);
|
|
863
|
+
}
|
|
864
|
+
function isoNow() {
|
|
865
|
+
return (/* @__PURE__ */ new Date()).toISOString();
|
|
866
|
+
}
|
|
867
|
+
function isUnsupportedSessionCloseError(error) {
|
|
868
|
+
const acp = extractAcpError(error);
|
|
869
|
+
if (!acp) return false;
|
|
870
|
+
if (acp.code === -32601 || acp.code === -32602) return true;
|
|
871
|
+
if (acp.code !== -32603 || !acp.data || typeof acp.data !== "object") return false;
|
|
872
|
+
const details = acp.data.details;
|
|
873
|
+
return typeof details === "string" && details.toLowerCase().includes("invalid params");
|
|
874
|
+
}
|
|
875
|
+
function createRecordId(sessionKey, mode) {
|
|
876
|
+
if (mode === "persistent") return sessionKey;
|
|
877
|
+
return `${sessionKey}:oneshot:${randomUUID()}`;
|
|
878
|
+
}
|
|
879
|
+
function resumePolicyForSessionMode(mode) {
|
|
880
|
+
return mode === "persistent" ? "same-session-only" : "allow-new";
|
|
881
|
+
}
|
|
882
|
+
async function startRuntimeClient(client, agent, timeoutMs) {
|
|
883
|
+
try {
|
|
884
|
+
await withTimeout(client.start(), timeoutMs);
|
|
885
|
+
} catch (error) {
|
|
886
|
+
if (!(error instanceof TimeoutError)) throw error;
|
|
887
|
+
throw new AcpRuntimeError("ACP_SESSION_INIT_FAILED", `ACP agent ${path.basename(agent.agentArgv?.[0] ?? agent.agentCommand.split(/\s+/)[0])} did not complete ACP initialization within ${timeoutMs}ms. Check that the configured command starts an ACP server.`, { cause: error });
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
async function withSessionSetupTimeout(method, request, timeoutMs) {
|
|
891
|
+
try {
|
|
892
|
+
return await withTimeout(request, timeoutMs);
|
|
893
|
+
} catch (error) {
|
|
894
|
+
if (!(error instanceof TimeoutError)) throw error;
|
|
895
|
+
throw new AcpRuntimeError("ACP_SESSION_INIT_FAILED", `ACP ${method} did not complete within ${timeoutMs}ms. Retry session setup and check that the configured ACP agent is responding.`, { cause: error });
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
async function createOrLoadRuntimeSession(client, resumeSessionId, cwd, timeoutMs) {
|
|
899
|
+
if (resumeSessionId) {
|
|
900
|
+
if (client.supportsResumeSession()) {
|
|
901
|
+
const resumed = await withSessionSetupTimeout("session/resume", client.resumeSession(resumeSessionId, cwd), timeoutMs);
|
|
902
|
+
return {
|
|
903
|
+
sessionId: resumeSessionId,
|
|
904
|
+
agentSessionId: resumed.agentSessionId,
|
|
905
|
+
sessionResult: resumed
|
|
906
|
+
};
|
|
907
|
+
}
|
|
908
|
+
if (!client.supportsLoadSession()) throw new Error(`Agent does not support session/resume or session/load; cannot resume session ${resumeSessionId}`);
|
|
909
|
+
const loaded = await withSessionSetupTimeout("session/load", client.loadSession(resumeSessionId, cwd), timeoutMs);
|
|
910
|
+
return {
|
|
911
|
+
sessionId: resumeSessionId,
|
|
912
|
+
agentSessionId: loaded.agentSessionId,
|
|
913
|
+
sessionResult: loaded
|
|
914
|
+
};
|
|
915
|
+
}
|
|
916
|
+
const created = await withSessionSetupTimeout("session/new", client.createSession(cwd), timeoutMs);
|
|
917
|
+
return {
|
|
918
|
+
sessionId: created.sessionId,
|
|
919
|
+
agentSessionId: created.agentSessionId,
|
|
920
|
+
sessionResult: created
|
|
921
|
+
};
|
|
922
|
+
}
|
|
923
|
+
var AcpRuntimeManager = class {
|
|
924
|
+
options;
|
|
925
|
+
deps;
|
|
926
|
+
exactSessionRecordIds = /* @__PURE__ */ new Set();
|
|
927
|
+
activeControllers = /* @__PURE__ */ new Map();
|
|
928
|
+
controlSessionRecords = /* @__PURE__ */ new Map();
|
|
929
|
+
retainedSessionOwners = /* @__PURE__ */ new Map();
|
|
930
|
+
retiringSessionOwners = /* @__PURE__ */ new Set();
|
|
931
|
+
pendingOneShotRecordIds = /* @__PURE__ */ new Map();
|
|
932
|
+
ensureSessionLocks = /* @__PURE__ */ new Map();
|
|
933
|
+
runtimeOperationLocks = /* @__PURE__ */ new Map();
|
|
934
|
+
sessionTasks = /* @__PURE__ */ new Map();
|
|
935
|
+
closingActiveRecords = /* @__PURE__ */ new Set();
|
|
936
|
+
liveClients = /* @__PURE__ */ new Set();
|
|
937
|
+
pendingTasks = /* @__PURE__ */ new Set();
|
|
938
|
+
shuttingDown = false;
|
|
939
|
+
shutdownTask;
|
|
940
|
+
observeAcpMessage = (direction, message) => {
|
|
941
|
+
try {
|
|
942
|
+
Promise.resolve(this.options.onAcpMessage?.(direction, message)).catch(() => {});
|
|
943
|
+
} catch {}
|
|
944
|
+
};
|
|
945
|
+
constructor(options, deps = {}) {
|
|
946
|
+
this.options = options;
|
|
947
|
+
this.deps = deps;
|
|
948
|
+
}
|
|
949
|
+
createClient(options) {
|
|
950
|
+
this.assertOpen();
|
|
951
|
+
const clientOptions = {
|
|
952
|
+
...options,
|
|
953
|
+
onAcpMessage: options.processLaunchScope?.kind === "runtime-session" ? this.observeAcpMessage : void 0,
|
|
954
|
+
agentProcessEnv: this.options.agentProcessEnv,
|
|
955
|
+
agentProcessEnvAllow: this.options.agentProcessEnvAllow,
|
|
956
|
+
agentProcessEnvBlock: this.options.agentProcessEnvBlock,
|
|
957
|
+
spawnAgent: this.options.spawnAgent,
|
|
958
|
+
clientCapabilities: this.options.clientCapabilities,
|
|
959
|
+
protocolGuardFactory: this.options.protocolGuardFactory,
|
|
960
|
+
extensionMethods: this.options.extensionMethods,
|
|
961
|
+
onExtensionRequest: this.options.onExtensionRequest,
|
|
962
|
+
onExtensionNotification: this.options.onExtensionNotification,
|
|
963
|
+
processLifecycle: {
|
|
964
|
+
...options.processLifecycle,
|
|
965
|
+
onBeforeSpawn: async (launch) => {
|
|
966
|
+
this.assertOpen();
|
|
967
|
+
await options.processLifecycle?.onBeforeSpawn?.(launch);
|
|
968
|
+
this.assertOpen();
|
|
969
|
+
},
|
|
970
|
+
onSpawned: async (process) => {
|
|
971
|
+
this.assertOpen();
|
|
972
|
+
await options.processLifecycle?.onSpawned?.(process);
|
|
973
|
+
this.assertOpen();
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
};
|
|
977
|
+
const client = this.deps.clientFactory?.(clientOptions) ?? new AcpClient(clientOptions);
|
|
978
|
+
this.liveClients.add(client);
|
|
979
|
+
return client;
|
|
980
|
+
}
|
|
981
|
+
async probe() {
|
|
982
|
+
let client;
|
|
983
|
+
try {
|
|
984
|
+
return await probeRuntime(this.options, { clientFactory: (options) => client = this.createClient(options) });
|
|
985
|
+
} finally {
|
|
986
|
+
if (client) this.liveClients.delete(client);
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
assertOpen() {
|
|
990
|
+
if (this.shuttingDown) throw new AcpRuntimeError("ACP_BACKEND_UNAVAILABLE", "ACP runtime is shut down.");
|
|
991
|
+
}
|
|
992
|
+
shutdown() {
|
|
993
|
+
if (!this.shutdownTask) {
|
|
994
|
+
this.shuttingDown = true;
|
|
995
|
+
this.shutdownTask = this.shutdownOwnedClients();
|
|
996
|
+
}
|
|
997
|
+
return this.shutdownTask;
|
|
998
|
+
}
|
|
999
|
+
async shutdownOwnedClients() {
|
|
1000
|
+
const closed = await Promise.allSettled([...this.liveClients].map(async (client) => {
|
|
1001
|
+
client.requestCancelActivePrompt().catch(() => {});
|
|
1002
|
+
await this.closeClient(client);
|
|
1003
|
+
}));
|
|
1004
|
+
await Promise.allSettled([
|
|
1005
|
+
...this.ensureSessionLocks.values(),
|
|
1006
|
+
...this.runtimeOperationLocks.values(),
|
|
1007
|
+
...this.pendingTasks
|
|
1008
|
+
]);
|
|
1009
|
+
const owners = /* @__PURE__ */ new Set([...this.retainedSessionOwners.values(), ...this.retiringSessionOwners]);
|
|
1010
|
+
const stopped = await Promise.allSettled([...owners].map(async (owner) => {
|
|
1011
|
+
this.removeRetainedSessionOwner(owner);
|
|
1012
|
+
const retirement = owner.retirement;
|
|
1013
|
+
if (retirement) await retirement;
|
|
1014
|
+
else {
|
|
1015
|
+
const failure = await this.stopSessionOwner(owner);
|
|
1016
|
+
if (failure) throw failure.error;
|
|
1017
|
+
}
|
|
1018
|
+
this.retiringSessionOwners.delete(owner);
|
|
1019
|
+
}));
|
|
1020
|
+
const errors = [];
|
|
1021
|
+
for (const result of [...closed, ...stopped]) if (result.status === "rejected") errors.push(result.reason);
|
|
1022
|
+
if (errors.length) throw new AggregateError(errors, "ACP runtime shutdown failed.");
|
|
1023
|
+
}
|
|
1024
|
+
trackTask(task) {
|
|
1025
|
+
this.pendingTasks.add(task);
|
|
1026
|
+
const remove = () => {
|
|
1027
|
+
this.pendingTasks.delete(task);
|
|
1028
|
+
};
|
|
1029
|
+
task.then(remove, remove);
|
|
1030
|
+
return task;
|
|
1031
|
+
}
|
|
1032
|
+
queueSessionTask(recordId, run, cancel) {
|
|
1033
|
+
const tasks = this.sessionTasks.get(recordId) ?? /* @__PURE__ */ new Set();
|
|
1034
|
+
this.sessionTasks.set(recordId, tasks);
|
|
1035
|
+
const previous = [...tasks].at(-1)?.completion;
|
|
1036
|
+
const result = (async () => {
|
|
1037
|
+
await previous?.catch(() => {});
|
|
1038
|
+
return await run();
|
|
1039
|
+
})();
|
|
1040
|
+
const task = {
|
|
1041
|
+
completion: result.then(() => {}),
|
|
1042
|
+
cancel
|
|
1043
|
+
};
|
|
1044
|
+
task.completion.catch(() => {});
|
|
1045
|
+
tasks.add(task);
|
|
1046
|
+
const remove = () => {
|
|
1047
|
+
tasks.delete(task);
|
|
1048
|
+
if (tasks.size === 0) this.sessionTasks.delete(recordId);
|
|
1049
|
+
};
|
|
1050
|
+
result.then(remove, remove);
|
|
1051
|
+
return this.trackTask(result);
|
|
1052
|
+
}
|
|
1053
|
+
async cancelSessionTasks(recordId) {
|
|
1054
|
+
const tasks = [...this.sessionTasks.get(recordId) ?? []];
|
|
1055
|
+
await Promise.all(tasks.flatMap((task) => task.cancel ? [task.cancel()] : []));
|
|
1056
|
+
return tasks;
|
|
1057
|
+
}
|
|
1058
|
+
async closeClient(client) {
|
|
1059
|
+
await client.close();
|
|
1060
|
+
this.liveClients.delete(client);
|
|
1061
|
+
}
|
|
1062
|
+
createSessionOwner(input) {
|
|
1063
|
+
const owner = {
|
|
1064
|
+
...input,
|
|
1065
|
+
checkpoint: new LiveSessionCheckpoint({ save: async () => this.saveSessionOwner(owner) }),
|
|
1066
|
+
bufferSessionUpdates: false,
|
|
1067
|
+
pendingSessionUpdates: []
|
|
1068
|
+
};
|
|
1069
|
+
input.client.setEventHandlers({
|
|
1070
|
+
onAcpMessage: this.observeAcpMessage,
|
|
1071
|
+
onSessionUpdate: (notification) => this.routeOwnedSessionUpdate(owner, notification),
|
|
1072
|
+
onClientOperation: (operation) => this.routeOwnedClientOperation(owner, operation)
|
|
1073
|
+
});
|
|
1074
|
+
return owner;
|
|
1075
|
+
}
|
|
1076
|
+
async saveSessionOwner(owner) {
|
|
1077
|
+
if (!owner.recordId || owner.pendingResetRecord) return;
|
|
1078
|
+
const active = owner.activeTurn?.turn;
|
|
1079
|
+
const target = active ?? owner.projection;
|
|
1080
|
+
if (!target) return;
|
|
1081
|
+
const { record, conversation } = target;
|
|
1082
|
+
if (active?.connected) record.acpx = active.acpxState;
|
|
1083
|
+
record.lastUsedAt = isoNow();
|
|
1084
|
+
applyConversation(record, conversation);
|
|
1085
|
+
applyLifecycleSnapshotToRecord(record, owner.client.getAgentLifecycleSnapshot());
|
|
1086
|
+
await this.refreshClosedState(record);
|
|
1087
|
+
await this.options.sessionStore.save(record);
|
|
1088
|
+
}
|
|
1089
|
+
routeOwnedSessionUpdate(owner, notification) {
|
|
1090
|
+
const active = owner.activeTurn;
|
|
1091
|
+
if (active) {
|
|
1092
|
+
const { task, turn } = active;
|
|
1093
|
+
if (turn.connected) {
|
|
1094
|
+
turn.acpxState = recordSessionUpdate(turn.conversation, turn.acpxState, notification);
|
|
1095
|
+
owner.checkpoint.request();
|
|
1096
|
+
} else turn.record.acpx = recordSessionUpdate(turn.conversation, turn.record.acpx, notification);
|
|
1097
|
+
this.emitRuntimeTurnEvent(task, {
|
|
1098
|
+
jsonrpc: "2.0",
|
|
1099
|
+
method: "session/update",
|
|
1100
|
+
params: notification
|
|
1101
|
+
});
|
|
1102
|
+
return;
|
|
1103
|
+
}
|
|
1104
|
+
if (owner.bufferSessionUpdates) {
|
|
1105
|
+
owner.pendingSessionUpdates.push(notification);
|
|
1106
|
+
return;
|
|
1107
|
+
}
|
|
1108
|
+
const projection = owner.projection;
|
|
1109
|
+
if (!projection) {
|
|
1110
|
+
owner.pendingSessionUpdates.push(notification);
|
|
1111
|
+
return;
|
|
1112
|
+
}
|
|
1113
|
+
projection.record.acpx = recordSessionUpdate(projection.conversation, projection.record.acpx, notification);
|
|
1114
|
+
owner.checkpoint.request();
|
|
1115
|
+
}
|
|
1116
|
+
routeOwnedClientOperation(owner, operation) {
|
|
1117
|
+
const active = owner.activeTurn;
|
|
1118
|
+
if (!active) return;
|
|
1119
|
+
const { task, turn } = active;
|
|
1120
|
+
if (turn.connected) {
|
|
1121
|
+
turn.acpxState = recordClientOperation(turn.conversation, turn.acpxState, operation);
|
|
1122
|
+
owner.checkpoint.request();
|
|
1123
|
+
} else turn.record.acpx = recordClientOperation(turn.conversation, turn.record.acpx, operation);
|
|
1124
|
+
this.emitRuntimeTurnEvent(task, {
|
|
1125
|
+
type: "client_operation",
|
|
1126
|
+
...operation
|
|
1127
|
+
});
|
|
1128
|
+
}
|
|
1129
|
+
attachIdleProjection(owner, record, conversation = cloneSessionConversation(record), acpxState = record.acpx) {
|
|
1130
|
+
record.acpx = acpxState;
|
|
1131
|
+
owner.projection = {
|
|
1132
|
+
record,
|
|
1133
|
+
conversation
|
|
1134
|
+
};
|
|
1135
|
+
owner.activeTurn = void 0;
|
|
1136
|
+
this.drainPendingSessionUpdates(owner);
|
|
1137
|
+
}
|
|
1138
|
+
drainPendingSessionUpdates(owner) {
|
|
1139
|
+
for (const notification of owner.pendingSessionUpdates.splice(0)) this.routeOwnedSessionUpdate(owner, notification);
|
|
1140
|
+
}
|
|
1141
|
+
async flushSessionOwner(owner) {
|
|
1142
|
+
await owner.client.waitForSessionUpdatesIdle?.().catch(() => {});
|
|
1143
|
+
await owner.checkpoint.flush();
|
|
1144
|
+
}
|
|
1145
|
+
removeRetainedSessionOwner(owner) {
|
|
1146
|
+
if (owner.recordId && this.retainedSessionOwners.get(owner.recordId) === owner) this.retainedSessionOwners.delete(owner.recordId);
|
|
1147
|
+
if (owner.mode === "oneshot" && owner.recordId && this.pendingOneShotRecordIds.get(owner.sessionKey) === owner.recordId) this.pendingOneShotRecordIds.delete(owner.sessionKey);
|
|
1148
|
+
}
|
|
1149
|
+
async readRetainedSessionOwner(record, options) {
|
|
1150
|
+
const owner = this.retainedSessionOwners.get(record.acpxRecordId);
|
|
1151
|
+
if (!owner) return;
|
|
1152
|
+
await this.flushSessionOwner(owner);
|
|
1153
|
+
const projectedRecord = owner.projection?.record;
|
|
1154
|
+
if (projectedRecord && projectedRecord !== record) Object.assign(record, structuredClone(projectedRecord));
|
|
1155
|
+
if (!owner.client.hasReusableSession(record.acpSessionId)) {
|
|
1156
|
+
this.removeRetainedSessionOwner(owner);
|
|
1157
|
+
await this.stopSessionOwner(owner);
|
|
1158
|
+
return;
|
|
1159
|
+
}
|
|
1160
|
+
if (options.consume) this.removeRetainedSessionOwner(owner);
|
|
1161
|
+
return owner;
|
|
1162
|
+
}
|
|
1163
|
+
async closeRetainedSessionOwner(recordId) {
|
|
1164
|
+
const owner = this.retainedSessionOwners.get(recordId);
|
|
1165
|
+
if (!owner) return;
|
|
1166
|
+
this.removeRetainedSessionOwner(owner);
|
|
1167
|
+
await this.stopSessionOwner(owner);
|
|
1168
|
+
}
|
|
1169
|
+
async stopSessionOwner(owner) {
|
|
1170
|
+
const flushAttempt = await settleAttempt(async () => this.flushSessionOwner(owner));
|
|
1171
|
+
const closeAttempt = await settleAttempt(async () => this.closeClient(owner.client));
|
|
1172
|
+
if (!closeAttempt.ok) this.retiringSessionOwners.add(owner);
|
|
1173
|
+
const finalFlushAttempt = await settleAttempt(async () => owner.checkpoint.flush());
|
|
1174
|
+
const clearAttempt = await settleAttempt(() => owner.client.clearEventHandlers());
|
|
1175
|
+
const settleRecordAttempt = await settleAttempt(async () => {
|
|
1176
|
+
if (closeAttempt.ok) await this.settleRetiredSessionRecord(owner);
|
|
1177
|
+
});
|
|
1178
|
+
if (!settleRecordAttempt.ok) this.retiringSessionOwners.add(owner);
|
|
1179
|
+
return firstFailedAttempt([
|
|
1180
|
+
flushAttempt,
|
|
1181
|
+
closeAttempt,
|
|
1182
|
+
finalFlushAttempt,
|
|
1183
|
+
clearAttempt,
|
|
1184
|
+
settleRecordAttempt
|
|
1185
|
+
]);
|
|
1186
|
+
}
|
|
1187
|
+
async retrySessionCleanup(recordId) {
|
|
1188
|
+
for (const owner of this.retiringSessionOwners) if (owner.recordId === recordId) {
|
|
1189
|
+
owner.retirement ??= this.finalizeSessionConnection({
|
|
1190
|
+
client: owner.client,
|
|
1191
|
+
owner
|
|
1192
|
+
}).then(async () => {
|
|
1193
|
+
await this.settleRetiredSessionRecord(owner);
|
|
1194
|
+
this.retiringSessionOwners.delete(owner);
|
|
1195
|
+
}).finally(() => {
|
|
1196
|
+
owner.retirement = void 0;
|
|
1197
|
+
});
|
|
1198
|
+
await owner.retirement;
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
async refreshClosedState(record) {
|
|
1202
|
+
if (!this.closingActiveRecords.has(record.acpxRecordId)) return record.closed === true;
|
|
1203
|
+
const latest = await this.options.sessionStore.load(record.acpxRecordId).catch(() => void 0);
|
|
1204
|
+
record.closed = true;
|
|
1205
|
+
record.closedAt = latest?.closedAt ?? record.closedAt ?? isoNow();
|
|
1206
|
+
if (latest?.acpx?.reset_on_next_ensure === true) record.acpx = {
|
|
1207
|
+
...record.acpx,
|
|
1208
|
+
reset_on_next_ensure: true
|
|
1209
|
+
};
|
|
1210
|
+
return true;
|
|
1211
|
+
}
|
|
1212
|
+
async retainPersistentSessionOwnerAfterTurn(input) {
|
|
1213
|
+
const { record, owner } = input;
|
|
1214
|
+
if (!this.canRetainPersistentSessionOwner(owner, record)) return false;
|
|
1215
|
+
const previousOwner = this.retainedSessionOwners.get(record.acpxRecordId);
|
|
1216
|
+
this.retainedSessionOwners.set(record.acpxRecordId, owner);
|
|
1217
|
+
if (previousOwner && previousOwner !== owner) {
|
|
1218
|
+
this.removeRetainedSessionOwner(previousOwner);
|
|
1219
|
+
await this.stopSessionOwner(previousOwner);
|
|
1220
|
+
}
|
|
1221
|
+
return true;
|
|
1222
|
+
}
|
|
1223
|
+
canRetainPersistentSessionOwner(owner, record) {
|
|
1224
|
+
return !this.shuttingDown && owner.mode === "persistent" && !record.closed && !(owner.client.hasUnresolvedPrompt?.() ?? false) && owner.client.hasReusableSession(record.acpSessionId);
|
|
1225
|
+
}
|
|
1226
|
+
resolveMcpServers(session) {
|
|
1227
|
+
const servers = this.options.mcpServers;
|
|
1228
|
+
const { sessionKey, cwd, agentCommand, agentArgv } = session;
|
|
1229
|
+
return [...typeof servers === "function" ? servers({
|
|
1230
|
+
sessionKey,
|
|
1231
|
+
cwd,
|
|
1232
|
+
agentCommand,
|
|
1233
|
+
agentArgv: agentArgv ? [...agentArgv] : void 0
|
|
1234
|
+
}) : servers ?? []];
|
|
1235
|
+
}
|
|
1236
|
+
resolveSessionPermissions(session) {
|
|
1237
|
+
const { sessionKey, cwd, agentCommand, agentArgv } = session;
|
|
1238
|
+
const { permissionMode = this.options.permissionMode, nonInteractivePermissions = this.options.nonInteractivePermissions, permissionPolicy = this.options.permissionPolicy, onPermissionRequest = this.options.onPermissionRequest } = this.options.sessionPermissions?.({
|
|
1239
|
+
sessionKey,
|
|
1240
|
+
cwd,
|
|
1241
|
+
agentCommand,
|
|
1242
|
+
agentArgv: agentArgv ? [...agentArgv] : void 0
|
|
1243
|
+
}) ?? {};
|
|
1244
|
+
return {
|
|
1245
|
+
permissionMode,
|
|
1246
|
+
nonInteractivePermissions,
|
|
1247
|
+
permissionPolicy,
|
|
1248
|
+
onPermissionRequest
|
|
1249
|
+
};
|
|
1250
|
+
}
|
|
1251
|
+
resolveClientCapabilities() {
|
|
1252
|
+
return {
|
|
1253
|
+
fs: this.options.fs,
|
|
1254
|
+
terminal: this.options.terminal
|
|
1255
|
+
};
|
|
1256
|
+
}
|
|
1257
|
+
async withRuntimeControlSession(record, sessionMode, run, replayOptions, authority) {
|
|
1258
|
+
await this.retrySessionCleanup(record.acpxRecordId);
|
|
1259
|
+
assertControlAuthority(authority);
|
|
1260
|
+
const owner = await this.readRetainedSessionOwner(record, { consume: false });
|
|
1261
|
+
assertControlAuthority(authority);
|
|
1262
|
+
if (owner) {
|
|
1263
|
+
const ownedRecord = owner.projection?.record ?? record;
|
|
1264
|
+
try {
|
|
1265
|
+
const value = await run({
|
|
1266
|
+
client: owner.client,
|
|
1267
|
+
sessionId: ownedRecord.acpSessionId,
|
|
1268
|
+
record: ownedRecord
|
|
1269
|
+
});
|
|
1270
|
+
this.refreshOwnedRecordLifecycle(owner, ownedRecord);
|
|
1271
|
+
await owner.checkpoint.checkpoint();
|
|
1272
|
+
return value;
|
|
1273
|
+
} finally {
|
|
1274
|
+
await this.flushSessionOwner(owner);
|
|
1275
|
+
}
|
|
1276
|
+
}
|
|
1277
|
+
let controlClient;
|
|
1278
|
+
let controlledRecord = record;
|
|
1279
|
+
const checkpoint = new LiveSessionCheckpoint({ save: async () => this.options.sessionStore.save(controlledRecord) });
|
|
1280
|
+
try {
|
|
1281
|
+
const result = await settleAttempt(async () => withConnectedSession({
|
|
1282
|
+
sessionRecordId: record.acpxRecordId,
|
|
1283
|
+
loadRecord: async (sessionRecordId) => {
|
|
1284
|
+
controlledRecord = await this.requireRecord(sessionRecordId);
|
|
1285
|
+
this.controlSessionRecords.set(sessionRecordId, {
|
|
1286
|
+
record: controlledRecord,
|
|
1287
|
+
checkpoint
|
|
1288
|
+
});
|
|
1289
|
+
return controlledRecord;
|
|
1290
|
+
},
|
|
1291
|
+
saveRecord: async () => checkpoint.checkpoint(),
|
|
1292
|
+
createClient: (options) => controlClient = this.createClient({
|
|
1293
|
+
...options,
|
|
1294
|
+
processLifecycle: this.options.processLifecycle,
|
|
1295
|
+
processLaunchScope: {
|
|
1296
|
+
kind: "runtime-session",
|
|
1297
|
+
sessionKey: record.name ?? record.acpxRecordId
|
|
1298
|
+
}
|
|
1299
|
+
}),
|
|
1300
|
+
mcpServers: this.resolveMcpServers({
|
|
1301
|
+
...record,
|
|
1302
|
+
sessionKey: record.name ?? record.acpxRecordId
|
|
1303
|
+
}),
|
|
1304
|
+
...this.resolveSessionPermissions({
|
|
1305
|
+
...record,
|
|
1306
|
+
sessionKey: record.name ?? record.acpxRecordId
|
|
1307
|
+
}),
|
|
1308
|
+
...this.resolveClientCapabilities(),
|
|
1309
|
+
elicitationModes: this.options.elicitationModes,
|
|
1310
|
+
verbose: this.options.verbose,
|
|
1311
|
+
timeoutMs: this.options.timeoutMs,
|
|
1312
|
+
resumePolicy: resumePolicyForSessionMode(sessionMode),
|
|
1313
|
+
strictResume: this.exactSessionRecordIds.has(record.acpxRecordId),
|
|
1314
|
+
replacingMode: replayOptions?.replacingMode,
|
|
1315
|
+
replacingConfigOption: replayOptions?.replacingConfigOption,
|
|
1316
|
+
authority,
|
|
1317
|
+
run
|
|
1318
|
+
}));
|
|
1319
|
+
this.controlSessionRecords.delete(record.acpxRecordId);
|
|
1320
|
+
const flushed = await settleAttempt(async () => checkpoint.flush());
|
|
1321
|
+
if (!result.ok) throw result.error;
|
|
1322
|
+
if (!flushed.ok) throw flushed.error;
|
|
1323
|
+
return result.value.value;
|
|
1324
|
+
} finally {
|
|
1325
|
+
this.controlSessionRecords.delete(record.acpxRecordId);
|
|
1326
|
+
if (controlClient) this.liveClients.delete(controlClient);
|
|
1327
|
+
}
|
|
1328
|
+
}
|
|
1329
|
+
refreshOwnedRecordLifecycle(owner, record) {
|
|
1330
|
+
record.lastUsedAt = isoNow();
|
|
1331
|
+
record.closed = false;
|
|
1332
|
+
record.closedAt = void 0;
|
|
1333
|
+
record.protocolVersion = owner.client.initializeResult?.protocolVersion;
|
|
1334
|
+
record.agentCapabilities = owner.client.initializeResult?.agentCapabilities;
|
|
1335
|
+
applyLifecycleSnapshotToRecord(record, owner.client.getAgentLifecycleSnapshot());
|
|
1336
|
+
}
|
|
1337
|
+
async ensureSession(input) {
|
|
1338
|
+
return await this.withEnsureSessionLock(input, async () => {
|
|
1339
|
+
const record = await this.ensureSessionWithOwnership(input);
|
|
1340
|
+
if (input.resumeSessionId && !this.exactSessionRecordIds.has(record.acpxRecordId)) {
|
|
1341
|
+
this.assertRuntimeSessionIdle(record.acpxRecordId);
|
|
1342
|
+
this.exactSessionRecordIds.add(record.acpxRecordId);
|
|
1343
|
+
}
|
|
1344
|
+
return record;
|
|
1345
|
+
});
|
|
1346
|
+
}
|
|
1347
|
+
async withEnsureSessionLock(input, run) {
|
|
1348
|
+
const key = `${input.mode}\0${input.sessionKey}`;
|
|
1349
|
+
return await this.withManagerLock(this.ensureSessionLocks, key, run);
|
|
1350
|
+
}
|
|
1351
|
+
async withManagerLock(locks, key, run, authority) {
|
|
1352
|
+
this.assertOpen();
|
|
1353
|
+
assertControlAuthority(authority);
|
|
1354
|
+
return await this.serializeManagerOperation(locks, key, async () => {
|
|
1355
|
+
this.assertOpen();
|
|
1356
|
+
assertControlAuthority(authority);
|
|
1357
|
+
return await run();
|
|
1358
|
+
});
|
|
1359
|
+
}
|
|
1360
|
+
async serializeManagerOperation(locks, key, run) {
|
|
1361
|
+
const previous = locks.get(key) ?? Promise.resolve();
|
|
1362
|
+
let release;
|
|
1363
|
+
const gate = new Promise((resolve) => {
|
|
1364
|
+
release = resolve;
|
|
1365
|
+
});
|
|
1366
|
+
const tail = previous.then(() => gate);
|
|
1367
|
+
locks.set(key, tail);
|
|
1368
|
+
await previous;
|
|
1369
|
+
try {
|
|
1370
|
+
return await run();
|
|
1371
|
+
} finally {
|
|
1372
|
+
release();
|
|
1373
|
+
if (locks.get(key) === tail) locks.delete(key);
|
|
1374
|
+
}
|
|
1375
|
+
}
|
|
1376
|
+
async ensureSessionWithOwnership(input) {
|
|
1377
|
+
const cwd = path.resolve(input.cwd?.trim() || this.options.cwd);
|
|
1378
|
+
const { agentCommand, agentArgv } = normalizeAgentCommandInput(this.options.agentRegistry.resolve(input.agent));
|
|
1379
|
+
const agent = {
|
|
1380
|
+
cwd,
|
|
1381
|
+
agentCommand,
|
|
1382
|
+
agentArgv
|
|
1383
|
+
};
|
|
1384
|
+
if (input.mode !== "persistent") return await this.acquireRuntimeSession(input, agent);
|
|
1385
|
+
const compatible = await this.reuseCompatiblePersistentSession(input, agent);
|
|
1386
|
+
if (compatible) return compatible;
|
|
1387
|
+
this.assertRuntimeSessionIdle(input.sessionKey);
|
|
1388
|
+
return await this.withManagerLock(this.runtimeOperationLocks, input.sessionKey, async () => this.acquireRuntimeSession(input, agent));
|
|
1389
|
+
}
|
|
1390
|
+
async reuseCompatiblePersistentSession(input, agent) {
|
|
1391
|
+
await this.retrySessionCleanup(input.sessionKey);
|
|
1392
|
+
const controlled = this.controlSessionRecords.get(input.sessionKey);
|
|
1393
|
+
const record = controlled ? controlled.record : await this.findSession(input.sessionKey);
|
|
1394
|
+
if (!record || this.closingActiveRecords.has(input.sessionKey) || !shouldReuseExistingRecord(record, {
|
|
1395
|
+
...agent,
|
|
1396
|
+
resumeSessionId: input.resumeSessionId
|
|
1397
|
+
})) return;
|
|
1398
|
+
if (!record.closed) return record;
|
|
1399
|
+
if (!controlled || this.sessionTasks.has(input.sessionKey)) return;
|
|
1400
|
+
return await this.reuseRuntimeSession({ record }, controlled.checkpoint);
|
|
1401
|
+
}
|
|
1402
|
+
async acquireRuntimeSession(input, agent) {
|
|
1403
|
+
const existing = await this.loadExistingRuntimeSession(input);
|
|
1404
|
+
if (existing && this.canReuseRuntimeSession(input, agent, existing)) return await this.reuseRuntimeSession(existing);
|
|
1405
|
+
await this.closeConflictingPersistentSession(input, existing?.owner);
|
|
1406
|
+
return await this.createOwnedRuntimeSession(input, agent);
|
|
1407
|
+
}
|
|
1408
|
+
async loadExistingRuntimeSession(input) {
|
|
1409
|
+
const existingRecordId = input.mode === "persistent" ? input.sessionKey : this.pendingOneShotRecordIds.get(input.sessionKey);
|
|
1410
|
+
if (!existingRecordId) return;
|
|
1411
|
+
await this.retrySessionCleanup(existingRecordId);
|
|
1412
|
+
let record = await this.findSession(existingRecordId);
|
|
1413
|
+
if (!record) return;
|
|
1414
|
+
const owner = this.retainedSessionOwners.get(record.acpxRecordId);
|
|
1415
|
+
if (owner) {
|
|
1416
|
+
await this.flushSessionOwner(owner);
|
|
1417
|
+
record = owner.projection?.record ?? record;
|
|
1418
|
+
}
|
|
1419
|
+
return {
|
|
1420
|
+
record,
|
|
1421
|
+
owner
|
|
1422
|
+
};
|
|
1423
|
+
}
|
|
1424
|
+
async findSession(sessionKey) {
|
|
1425
|
+
return await this.options.sessionStore.load(sessionKey);
|
|
1426
|
+
}
|
|
1427
|
+
canReuseRuntimeSession(input, agent, existing) {
|
|
1428
|
+
if (!shouldReuseExistingRecord(existing.record, {
|
|
1429
|
+
cwd: agent.cwd,
|
|
1430
|
+
agentCommand: agent.agentCommand,
|
|
1431
|
+
agentArgv: agent.agentArgv,
|
|
1432
|
+
resumeSessionId: input.resumeSessionId
|
|
1433
|
+
})) return false;
|
|
1434
|
+
if (input.mode === "persistent") return true;
|
|
1435
|
+
return Boolean(existing.owner && !existing.record.closed && this.pendingOneShotRecordIds.get(input.sessionKey) === existing.record.acpxRecordId && this.retainedSessionOwners.get(existing.record.acpxRecordId) === existing.owner && isDeepStrictEqual(sessionOptionsFromRecord(existing.record), normalizeSessionOptionShape(input.sessionOptions)));
|
|
1436
|
+
}
|
|
1437
|
+
assertRuntimeSessionIdle(recordId) {
|
|
1438
|
+
if (this.sessionTasks.has(recordId) || this.runtimeOperationLocks.has(recordId)) throw new AcpRuntimeError("ACP_SESSION_INIT_FAILED", `Cannot ensure session ${recordId} with incompatible or closing state while its work is unfinished. Wait for existing work to finish or use a different session key.`);
|
|
1439
|
+
}
|
|
1440
|
+
async reuseRuntimeSession({ record, owner }, checkpoint = owner?.checkpoint) {
|
|
1441
|
+
if (!record.closed && !this.closingActiveRecords.has(record.acpxRecordId)) return record;
|
|
1442
|
+
record.closed = false;
|
|
1443
|
+
record.closedAt = void 0;
|
|
1444
|
+
this.closingActiveRecords.delete(record.acpxRecordId);
|
|
1445
|
+
if (checkpoint) await checkpoint.checkpoint();
|
|
1446
|
+
else await this.options.sessionStore.save(record);
|
|
1447
|
+
return record;
|
|
1448
|
+
}
|
|
1449
|
+
async closeConflictingPersistentSession(input, owner) {
|
|
1450
|
+
if (input.mode === "persistent" && owner?.recordId) {
|
|
1451
|
+
this.removeRetainedSessionOwner(owner);
|
|
1452
|
+
this.retiringSessionOwners.add(owner);
|
|
1453
|
+
await this.retrySessionCleanup(owner.recordId);
|
|
1454
|
+
}
|
|
1455
|
+
}
|
|
1456
|
+
async createOwnedRuntimeSession(input, agent) {
|
|
1457
|
+
const { cwd, agentCommand, agentArgv } = agent;
|
|
1458
|
+
const client = this.createClient({
|
|
1459
|
+
agentCommand,
|
|
1460
|
+
agentArgv,
|
|
1461
|
+
cwd,
|
|
1462
|
+
mcpServers: this.resolveMcpServers({
|
|
1463
|
+
...agent,
|
|
1464
|
+
sessionKey: input.sessionKey
|
|
1465
|
+
}),
|
|
1466
|
+
...this.resolveSessionPermissions({
|
|
1467
|
+
...agent,
|
|
1468
|
+
sessionKey: input.sessionKey
|
|
1469
|
+
}),
|
|
1470
|
+
...this.resolveClientCapabilities(),
|
|
1471
|
+
elicitationModes: this.options.elicitationModes,
|
|
1472
|
+
processLifecycle: this.options.processLifecycle,
|
|
1473
|
+
processLaunchScope: {
|
|
1474
|
+
kind: "runtime-session",
|
|
1475
|
+
sessionKey: input.sessionKey
|
|
1476
|
+
},
|
|
1477
|
+
verbose: this.options.verbose,
|
|
1478
|
+
sessionOptions: input.sessionOptions
|
|
1479
|
+
});
|
|
1480
|
+
const owner = this.createSessionOwner({
|
|
1481
|
+
client,
|
|
1482
|
+
sessionKey: input.sessionKey,
|
|
1483
|
+
mode: input.mode
|
|
1484
|
+
});
|
|
1485
|
+
try {
|
|
1486
|
+
await startRuntimeClient(client, agent, this.options.timeoutMs);
|
|
1487
|
+
this.assertOpen();
|
|
1488
|
+
const session = await createOrLoadRuntimeSession(client, input.resumeSessionId, cwd, this.options.timeoutMs);
|
|
1489
|
+
const record = await this.prepareInitialRuntimeRecord({
|
|
1490
|
+
input,
|
|
1491
|
+
client,
|
|
1492
|
+
owner,
|
|
1493
|
+
agentCommand,
|
|
1494
|
+
agentArgv,
|
|
1495
|
+
cwd,
|
|
1496
|
+
session
|
|
1497
|
+
});
|
|
1498
|
+
await this.retainInitializedSessionOwner(owner, record);
|
|
1499
|
+
if (!input.resumeSessionId) this.exactSessionRecordIds.delete(record.acpxRecordId);
|
|
1500
|
+
return record;
|
|
1501
|
+
} catch (error) {
|
|
1502
|
+
await settleAttempt(async () => this.abandonInitializingSessionOwner(owner));
|
|
1503
|
+
throw error;
|
|
1504
|
+
}
|
|
1505
|
+
}
|
|
1506
|
+
async abandonInitializingSessionOwner(owner) {
|
|
1507
|
+
const record = owner.recordId ? owner.projection?.record : void 0;
|
|
1508
|
+
owner.pendingResetRecord = record;
|
|
1509
|
+
await settleAttempt(() => owner.client.clearEventHandlers());
|
|
1510
|
+
const closeAttempt = await settleAttempt(async () => this.closeClient(owner.client));
|
|
1511
|
+
if (!record) return;
|
|
1512
|
+
this.retiringSessionOwners.add(owner);
|
|
1513
|
+
if (closeAttempt.ok) {
|
|
1514
|
+
await this.settleRetiredSessionRecord(owner);
|
|
1515
|
+
this.retiringSessionOwners.delete(owner);
|
|
1516
|
+
}
|
|
1517
|
+
}
|
|
1518
|
+
async settleRetiredSessionRecord(owner) {
|
|
1519
|
+
const record = owner.pendingResetRecord;
|
|
1520
|
+
if (!record) return;
|
|
1521
|
+
applyLifecycleSnapshotToRecord(record, owner.client.getAgentLifecycleSnapshot());
|
|
1522
|
+
await this.saveClosedRuntimeRecord(record, true);
|
|
1523
|
+
owner.pendingResetRecord = void 0;
|
|
1524
|
+
owner.recordId = void 0;
|
|
1525
|
+
}
|
|
1526
|
+
async prepareInitialRuntimeRecord(params) {
|
|
1527
|
+
const { input, client, owner, agentCommand, agentArgv, cwd, session } = params;
|
|
1528
|
+
const record = createInitialSessionRecord({
|
|
1529
|
+
recordId: createRecordId(input.sessionKey, input.mode),
|
|
1530
|
+
name: input.sessionKey,
|
|
1531
|
+
sessionId: session.sessionId,
|
|
1532
|
+
sessionOrigin: input.resumeSessionId ? "resume" : "new",
|
|
1533
|
+
agentCommand,
|
|
1534
|
+
agentArgv,
|
|
1535
|
+
cwd,
|
|
1536
|
+
agentSessionId: session.agentSessionId
|
|
1537
|
+
});
|
|
1538
|
+
this.closingActiveRecords.delete(record.acpxRecordId);
|
|
1539
|
+
record.protocolVersion = client.initializeResult?.protocolVersion;
|
|
1540
|
+
record.agentCapabilities = client.initializeResult?.agentCapabilities;
|
|
1541
|
+
this.attachIdleProjection(owner, record);
|
|
1542
|
+
applyConfigOptionsToRecord(record, session.sessionResult);
|
|
1543
|
+
const modelApplication = await applyRequestedModelIfAdvertised({
|
|
1544
|
+
client,
|
|
1545
|
+
sessionId: session.sessionId,
|
|
1546
|
+
requestedModel: input.sessionOptions?.model,
|
|
1547
|
+
models: session.sessionResult.models,
|
|
1548
|
+
agentCommand,
|
|
1549
|
+
timeoutMs: this.options.timeoutMs
|
|
1550
|
+
});
|
|
1551
|
+
applyInitialModelSelection(record, session.sessionResult.models, modelApplication);
|
|
1552
|
+
applyLifecycleSnapshotToRecord(record, client.getAgentLifecycleSnapshot());
|
|
1553
|
+
persistSessionOptions(record, input.sessionOptions);
|
|
1554
|
+
return record;
|
|
1555
|
+
}
|
|
1556
|
+
async retainInitializedSessionOwner(owner, record) {
|
|
1557
|
+
owner.recordId = record.acpxRecordId;
|
|
1558
|
+
await owner.checkpoint.checkpoint();
|
|
1559
|
+
this.assertOpen();
|
|
1560
|
+
const previousOwner = this.retainedSessionOwners.get(record.acpxRecordId);
|
|
1561
|
+
this.retainedSessionOwners.set(record.acpxRecordId, owner);
|
|
1562
|
+
if (owner.mode === "oneshot") this.pendingOneShotRecordIds.set(owner.sessionKey, record.acpxRecordId);
|
|
1563
|
+
if (previousOwner && previousOwner !== owner) {
|
|
1564
|
+
this.removeRetainedSessionOwner(previousOwner);
|
|
1565
|
+
await this.stopSessionOwner(previousOwner);
|
|
1566
|
+
}
|
|
1567
|
+
}
|
|
1568
|
+
startTurn(input) {
|
|
1569
|
+
this.assertOpen();
|
|
1570
|
+
let promptInput;
|
|
1571
|
+
try {
|
|
1572
|
+
promptInput = toPromptInput(input.text, input.attachments);
|
|
1573
|
+
} catch (error) {
|
|
1574
|
+
this.trackTask(this.closeRetainedOneShotHandle(input.handle).catch(() => {}));
|
|
1575
|
+
throw error;
|
|
1576
|
+
}
|
|
1577
|
+
const queue = new AsyncEventQueue();
|
|
1578
|
+
const result = createDeferred();
|
|
1579
|
+
const promptStarted = createDeferred();
|
|
1580
|
+
promptStarted.promise.catch(() => {});
|
|
1581
|
+
const sessionReady = createDeferred();
|
|
1582
|
+
sessionReady.promise.catch(() => {});
|
|
1583
|
+
let resultSettled = false;
|
|
1584
|
+
const state = {
|
|
1585
|
+
pendingCancel: false,
|
|
1586
|
+
turnActive: true,
|
|
1587
|
+
activeController: null
|
|
1588
|
+
};
|
|
1589
|
+
let streamClosed = false;
|
|
1590
|
+
const settleResult = (next) => {
|
|
1591
|
+
if (resultSettled) return;
|
|
1592
|
+
resultSettled = true;
|
|
1593
|
+
result.resolve(next);
|
|
1594
|
+
};
|
|
1595
|
+
const closeStream = () => {
|
|
1596
|
+
if (streamClosed) return;
|
|
1597
|
+
streamClosed = true;
|
|
1598
|
+
queue.clear();
|
|
1599
|
+
queue.close();
|
|
1600
|
+
};
|
|
1601
|
+
const requestCancel = async () => {
|
|
1602
|
+
if (state.activeController) return await state.activeController.requestCancelActivePrompt();
|
|
1603
|
+
if (!state.turnActive) return false;
|
|
1604
|
+
state.pendingCancel = true;
|
|
1605
|
+
return true;
|
|
1606
|
+
};
|
|
1607
|
+
const abortHandler = () => {
|
|
1608
|
+
requestCancel().catch(() => {});
|
|
1609
|
+
};
|
|
1610
|
+
if (input.signal && !input.signal.aborted) input.signal.addEventListener("abort", abortHandler, { once: true });
|
|
1611
|
+
this.queueSessionTask(input.handle.acpxRecordId ?? input.handle.sessionKey, async () => this.runRuntimeTurnTask({
|
|
1612
|
+
input,
|
|
1613
|
+
promptInput,
|
|
1614
|
+
queue,
|
|
1615
|
+
promptStarted,
|
|
1616
|
+
sessionReady,
|
|
1617
|
+
state,
|
|
1618
|
+
settleResult,
|
|
1619
|
+
abortHandler
|
|
1620
|
+
}), requestCancel);
|
|
1621
|
+
return {
|
|
1622
|
+
requestId: input.requestId,
|
|
1623
|
+
promptStarted: promptStarted.promise,
|
|
1624
|
+
events: queue.iterate(),
|
|
1625
|
+
result: result.promise,
|
|
1626
|
+
cancel: async () => {
|
|
1627
|
+
await requestCancel();
|
|
1628
|
+
},
|
|
1629
|
+
closeStream: async () => {
|
|
1630
|
+
closeStream();
|
|
1631
|
+
}
|
|
1632
|
+
};
|
|
1633
|
+
}
|
|
1634
|
+
async closeRetainedOneShotHandle(handle) {
|
|
1635
|
+
const recordId = handle.acpxRecordId ?? handle.sessionKey;
|
|
1636
|
+
await this.serializeManagerOperation(this.runtimeOperationLocks, recordId, async () => {
|
|
1637
|
+
if (this.retainedSessionOwners.get(recordId)?.mode === "oneshot") await this.closeRetainedSessionOwner(recordId);
|
|
1638
|
+
});
|
|
1639
|
+
}
|
|
1640
|
+
async runRuntimeTurnTask(task) {
|
|
1641
|
+
let turn;
|
|
1642
|
+
let terminalResult;
|
|
1643
|
+
try {
|
|
1644
|
+
if (this.cancelRuntimeTurnBeforePrompt(task)) {
|
|
1645
|
+
await this.closeRetainedOneShotHandle(task.input.handle);
|
|
1646
|
+
terminalResult = {
|
|
1647
|
+
status: "cancelled",
|
|
1648
|
+
stopReason: "cancelled"
|
|
1649
|
+
};
|
|
1650
|
+
} else {
|
|
1651
|
+
turn = await this.prepareRuntimeTurn(task);
|
|
1652
|
+
const { sessionId } = await this.connectRuntimeTurn(task, turn);
|
|
1653
|
+
this.assertOpen();
|
|
1654
|
+
await this.resolveRuntimeTurnReady(task, turn);
|
|
1655
|
+
if (this.cancelRuntimeTurnBeforePrompt(task)) terminalResult = {
|
|
1656
|
+
status: "cancelled",
|
|
1657
|
+
stopReason: "cancelled"
|
|
1658
|
+
};
|
|
1659
|
+
else {
|
|
1660
|
+
const response = await this.runRuntimePrompt(task, turn, sessionId);
|
|
1661
|
+
this.updateCompletedRuntimeTurn(turn);
|
|
1662
|
+
terminalResult = {
|
|
1663
|
+
status: response.stopReason === "cancelled" ? "cancelled" : "completed",
|
|
1664
|
+
...response.stopReason ? { stopReason: response.stopReason } : {},
|
|
1665
|
+
...response._meta === void 0 ? {} : { _meta: response._meta }
|
|
1666
|
+
};
|
|
1667
|
+
}
|
|
1668
|
+
}
|
|
1669
|
+
} catch (error) {
|
|
1670
|
+
terminalResult = this.handleRuntimeTurnFailure(task, error);
|
|
1671
|
+
}
|
|
1672
|
+
const finalization = await settleAttempt(async () => this.serializeManagerOperation(this.runtimeOperationLocks, task.input.handle.acpxRecordId ?? task.input.handle.sessionKey, async () => this.finalizeRuntimeTurn(task, turn)));
|
|
1673
|
+
if (!finalization.ok) {
|
|
1674
|
+
task.settleResult(this.failRuntimeTurn(task, finalization.error));
|
|
1675
|
+
throw finalization.error;
|
|
1676
|
+
}
|
|
1677
|
+
task.settleResult(terminalResult);
|
|
1678
|
+
}
|
|
1679
|
+
async runRuntimePrompt(task, turn, sessionId) {
|
|
1680
|
+
return await runPromptTurn({
|
|
1681
|
+
client: turn.client,
|
|
1682
|
+
sessionId,
|
|
1683
|
+
prompt: task.promptInput,
|
|
1684
|
+
timeoutMs: task.input.timeoutMs ?? this.options.timeoutMs,
|
|
1685
|
+
conversation: turn.conversation,
|
|
1686
|
+
promptMessageId: turn.promptMessageId,
|
|
1687
|
+
onPromptRequestWritten: () => task.promptStarted.resolve(),
|
|
1688
|
+
onElicitation: task.input.onElicitation,
|
|
1689
|
+
onPermissionRequest: task.input.onPermissionRequest,
|
|
1690
|
+
authority: task.input
|
|
1691
|
+
});
|
|
1692
|
+
}
|
|
1693
|
+
async prepareRuntimeTurn(task) {
|
|
1694
|
+
const recordId = task.input.handle.acpxRecordId ?? task.input.handle.sessionKey;
|
|
1695
|
+
return await this.withManagerLock(this.runtimeOperationLocks, recordId, async () => {
|
|
1696
|
+
await this.retrySessionCleanup(recordId);
|
|
1697
|
+
return await this.prepareRuntimeTurnWithOwnership(task);
|
|
1698
|
+
});
|
|
1699
|
+
}
|
|
1700
|
+
async prepareRuntimeTurnWithOwnership(task) {
|
|
1701
|
+
const { record, retainedOwner, conversation, acpxState, promptMessageId } = await this.prepareRuntimeTurnState(task);
|
|
1702
|
+
try {
|
|
1703
|
+
const client = retainedOwner?.client ?? this.createTurnClient(record);
|
|
1704
|
+
const owner = this.resolveRuntimeTurnOwner(task, record, client, retainedOwner);
|
|
1705
|
+
const turn = this.createRunningRuntimeTurn({
|
|
1706
|
+
record,
|
|
1707
|
+
conversation,
|
|
1708
|
+
acpxState,
|
|
1709
|
+
client,
|
|
1710
|
+
owner,
|
|
1711
|
+
connected: retainedOwner !== void 0,
|
|
1712
|
+
promptMessageId
|
|
1713
|
+
});
|
|
1714
|
+
this.activateRuntimeTurn(task, turn);
|
|
1715
|
+
return turn;
|
|
1716
|
+
} catch (error) {
|
|
1717
|
+
this.restoreBufferedSessionOwner(retainedOwner);
|
|
1718
|
+
throw error;
|
|
1719
|
+
}
|
|
1720
|
+
}
|
|
1721
|
+
async prepareRuntimeTurnState(task) {
|
|
1722
|
+
const { record, retainedOwner } = await this.acquireRuntimeTurnState(task);
|
|
1723
|
+
const conversation = cloneSessionConversation(record);
|
|
1724
|
+
const acpxState = cloneSessionAcpxState(record.acpx);
|
|
1725
|
+
try {
|
|
1726
|
+
const promptStartedAt = isoNow();
|
|
1727
|
+
const promptMessageId = recordPromptSubmission(conversation, task.promptInput, promptStartedAt);
|
|
1728
|
+
record.lastPromptAt = promptStartedAt;
|
|
1729
|
+
record.lastUsedAt = promptStartedAt;
|
|
1730
|
+
record.acpx = acpxState;
|
|
1731
|
+
applyConversation(record, conversation);
|
|
1732
|
+
await this.options.sessionStore.save(record);
|
|
1733
|
+
return {
|
|
1734
|
+
record,
|
|
1735
|
+
retainedOwner,
|
|
1736
|
+
conversation,
|
|
1737
|
+
acpxState,
|
|
1738
|
+
promptMessageId
|
|
1739
|
+
};
|
|
1740
|
+
} catch (error) {
|
|
1741
|
+
this.restoreBufferedSessionOwner(retainedOwner);
|
|
1742
|
+
throw error;
|
|
1743
|
+
}
|
|
1744
|
+
}
|
|
1745
|
+
async acquireRuntimeTurnState(task) {
|
|
1746
|
+
const recordId = task.input.handle.acpxRecordId ?? task.input.handle.sessionKey;
|
|
1747
|
+
let record = await this.requireRecord(recordId);
|
|
1748
|
+
const retainedOwner = await this.readRetainedSessionOwner(record, { consume: false });
|
|
1749
|
+
if (!retainedOwner) return { record };
|
|
1750
|
+
retainedOwner.bufferSessionUpdates = true;
|
|
1751
|
+
try {
|
|
1752
|
+
await retainedOwner.checkpoint.flush();
|
|
1753
|
+
const projection = retainedOwner.projection;
|
|
1754
|
+
if (projection) record = structuredClone(projection.record);
|
|
1755
|
+
return {
|
|
1756
|
+
record,
|
|
1757
|
+
retainedOwner
|
|
1758
|
+
};
|
|
1759
|
+
} catch (error) {
|
|
1760
|
+
this.restoreBufferedSessionOwner(retainedOwner);
|
|
1761
|
+
throw error;
|
|
1762
|
+
}
|
|
1763
|
+
}
|
|
1764
|
+
restoreBufferedSessionOwner(owner) {
|
|
1765
|
+
if (!owner) return;
|
|
1766
|
+
owner.bufferSessionUpdates = false;
|
|
1767
|
+
this.drainPendingSessionUpdates(owner);
|
|
1768
|
+
}
|
|
1769
|
+
resolveRuntimeTurnOwner(task, record, client, retainedOwner) {
|
|
1770
|
+
return retainedOwner ?? this.createSessionOwner({
|
|
1771
|
+
client,
|
|
1772
|
+
sessionKey: record.name ?? task.input.handle.sessionKey,
|
|
1773
|
+
mode: task.input.sessionMode
|
|
1774
|
+
});
|
|
1775
|
+
}
|
|
1776
|
+
createRunningRuntimeTurn(input) {
|
|
1777
|
+
const { record, conversation, acpxState, client, owner, connected, promptMessageId } = input;
|
|
1778
|
+
return {
|
|
1779
|
+
record,
|
|
1780
|
+
conversation,
|
|
1781
|
+
acpxState,
|
|
1782
|
+
client,
|
|
1783
|
+
owner,
|
|
1784
|
+
connected,
|
|
1785
|
+
promptMessageId,
|
|
1786
|
+
activeSessionId: record.acpSessionId
|
|
1787
|
+
};
|
|
1788
|
+
}
|
|
1789
|
+
activateRuntimeTurn(task, turn) {
|
|
1790
|
+
const { owner, record } = turn;
|
|
1791
|
+
this.removeRetainedSessionOwner(owner);
|
|
1792
|
+
owner.recordId = record.acpxRecordId;
|
|
1793
|
+
task.state.activeController = this.buildRuntimeTurnController(task, turn);
|
|
1794
|
+
this.activeControllers.set(record.acpxRecordId, task.state.activeController);
|
|
1795
|
+
owner.projection = void 0;
|
|
1796
|
+
owner.activeTurn = {
|
|
1797
|
+
task,
|
|
1798
|
+
turn
|
|
1799
|
+
};
|
|
1800
|
+
owner.bufferSessionUpdates = false;
|
|
1801
|
+
this.drainPendingSessionUpdates(owner);
|
|
1802
|
+
}
|
|
1803
|
+
createTurnClient(record) {
|
|
1804
|
+
return this.createClient({
|
|
1805
|
+
agentCommand: record.agentCommand,
|
|
1806
|
+
agentArgv: record.agentArgv,
|
|
1807
|
+
cwd: record.cwd,
|
|
1808
|
+
mcpServers: this.resolveMcpServers({
|
|
1809
|
+
...record,
|
|
1810
|
+
sessionKey: record.name ?? record.acpxRecordId
|
|
1811
|
+
}),
|
|
1812
|
+
...this.resolveSessionPermissions({
|
|
1813
|
+
...record,
|
|
1814
|
+
sessionKey: record.name ?? record.acpxRecordId
|
|
1815
|
+
}),
|
|
1816
|
+
...this.resolveClientCapabilities(),
|
|
1817
|
+
elicitationModes: this.options.elicitationModes,
|
|
1818
|
+
processLifecycle: this.options.processLifecycle,
|
|
1819
|
+
processLaunchScope: {
|
|
1820
|
+
kind: "runtime-session",
|
|
1821
|
+
sessionKey: record.name ?? record.acpxRecordId
|
|
1822
|
+
},
|
|
1823
|
+
verbose: this.options.verbose,
|
|
1824
|
+
sessionOptions: sessionOptionsFromRecord(record)
|
|
1825
|
+
});
|
|
1826
|
+
}
|
|
1827
|
+
buildRuntimeTurnController(task, turn) {
|
|
1828
|
+
return {
|
|
1829
|
+
hasActivePrompt: () => turn.client.hasActivePrompt(),
|
|
1830
|
+
requestCancelActivePrompt: async () => await this.requestRuntimeTurnCancel(task, turn),
|
|
1831
|
+
setSessionMode: async (modeId, authority) => {
|
|
1832
|
+
await this.waitForRuntimeControlSession(task, turn);
|
|
1833
|
+
await turn.client.setSessionMode(turn.activeSessionId, modeId, authority);
|
|
1834
|
+
const nextState = cloneSessionAcpxState(turn.acpxState) ?? {};
|
|
1835
|
+
nextState.desired_mode_id = modeId;
|
|
1836
|
+
turn.acpxState = nextState;
|
|
1837
|
+
await turn.owner.checkpoint.checkpoint();
|
|
1838
|
+
},
|
|
1839
|
+
setSessionModel: async (modelId, authority) => {
|
|
1840
|
+
await this.waitForRuntimeControlSession(task, turn);
|
|
1841
|
+
const models = advertisedModelState(turn.acpxState);
|
|
1842
|
+
const resolvedModelId = resolveRequestedModelId({
|
|
1843
|
+
requestedModel: modelId,
|
|
1844
|
+
models,
|
|
1845
|
+
agentCommand: turn.record.agentCommand
|
|
1846
|
+
});
|
|
1847
|
+
const response = await turn.client.setSessionModel(turn.activeSessionId, modelId, models, authority);
|
|
1848
|
+
turn.acpxState = applyModelSelection(turn.acpxState, modelId, response, resolvedModelId);
|
|
1849
|
+
await turn.owner.checkpoint.checkpoint();
|
|
1850
|
+
return response;
|
|
1851
|
+
},
|
|
1852
|
+
setSessionConfigOption: async (configId, value, authority) => {
|
|
1853
|
+
return (await task.state.activeController.setResolvedSessionConfigOption(configId, value, authority)).response;
|
|
1854
|
+
},
|
|
1855
|
+
setResolvedSessionConfigOption: async (configId, value, authority) => await this.setRuntimeResolvedSessionConfigOption(task, turn, configId, value, authority),
|
|
1856
|
+
requestExtension: async (method, params, authority) => {
|
|
1857
|
+
await this.waitForRuntimeControlSession(task, turn);
|
|
1858
|
+
return await turn.client.requestExtension(method, params, authority);
|
|
1859
|
+
}
|
|
1860
|
+
};
|
|
1861
|
+
}
|
|
1862
|
+
async waitForRuntimeControlSession(task, turn) {
|
|
1863
|
+
if (turn.client.hasActivePrompt()) return;
|
|
1864
|
+
await task.sessionReady.promise;
|
|
1865
|
+
}
|
|
1866
|
+
async requestRuntimeTurnCancel(task, turn) {
|
|
1867
|
+
if (turn.client.hasActivePrompt()) return await turn.client.requestCancelActivePrompt();
|
|
1868
|
+
if (!task.state.turnActive) return false;
|
|
1869
|
+
task.state.pendingCancel = true;
|
|
1870
|
+
return true;
|
|
1871
|
+
}
|
|
1872
|
+
async setRuntimeResolvedSessionConfigOption(task, turn, configId, value, authority) {
|
|
1873
|
+
await this.waitForRuntimeControlSession(task, turn);
|
|
1874
|
+
const resolvedConfigId = resolveSupportedConfigOptionId({
|
|
1875
|
+
...turn.record,
|
|
1876
|
+
acpx: turn.acpxState ?? void 0
|
|
1877
|
+
}, configId);
|
|
1878
|
+
const models = advertisedModelState(turn.acpxState);
|
|
1879
|
+
const { modelConfigId, resolvedValue } = resolveRequestedConfigOption({
|
|
1880
|
+
configId: resolvedConfigId,
|
|
1881
|
+
value,
|
|
1882
|
+
models,
|
|
1883
|
+
agentCommand: turn.record.agentCommand
|
|
1884
|
+
});
|
|
1885
|
+
const response = await turn.client.setSessionConfigOption(turn.activeSessionId, resolvedConfigId, value, models, authority);
|
|
1886
|
+
turn.acpxState = applyConfigOptionSelection(turn.acpxState, resolvedConfigId, value, response, modelConfigId, resolvedValue);
|
|
1887
|
+
await turn.owner.checkpoint.checkpoint();
|
|
1888
|
+
return {
|
|
1889
|
+
configId: resolvedConfigId,
|
|
1890
|
+
response
|
|
1891
|
+
};
|
|
1892
|
+
}
|
|
1893
|
+
emitRuntimeTurnEvent(task, payload) {
|
|
1894
|
+
const parsed = runtimeEventFromMessage(payload);
|
|
1895
|
+
if (!parsed) return;
|
|
1896
|
+
task.queue.push(parsed);
|
|
1897
|
+
}
|
|
1898
|
+
async connectRuntimeTurn(task, turn) {
|
|
1899
|
+
if (turn.connected) return {
|
|
1900
|
+
sessionId: turn.record.acpSessionId,
|
|
1901
|
+
resumed: false,
|
|
1902
|
+
loadError: void 0
|
|
1903
|
+
};
|
|
1904
|
+
const loaded = await this.connectRuntimeTurnClient(task, turn);
|
|
1905
|
+
turn.acpxState = cloneSessionAcpxState(turn.record.acpx);
|
|
1906
|
+
turn.connected = true;
|
|
1907
|
+
return loaded;
|
|
1908
|
+
}
|
|
1909
|
+
async connectRuntimeTurnClient(task, turn) {
|
|
1910
|
+
return await connectAndLoadSession({
|
|
1911
|
+
client: turn.client,
|
|
1912
|
+
record: turn.record,
|
|
1913
|
+
resumePolicy: resumePolicyForSessionMode(task.input.sessionMode),
|
|
1914
|
+
strictResume: this.exactSessionRecordIds.has(turn.record.acpxRecordId),
|
|
1915
|
+
timeoutMs: this.options.timeoutMs,
|
|
1916
|
+
promptRecorded: true,
|
|
1917
|
+
activeController: task.state.activeController,
|
|
1918
|
+
onClientAvailable: () => this.publishRuntimeTurnController(task, turn),
|
|
1919
|
+
onConnectedRecord: (connectedRecord) => {
|
|
1920
|
+
connectedRecord.lastPromptAt = isoNow();
|
|
1921
|
+
},
|
|
1922
|
+
onSessionIdResolved: (sessionIdValue) => {
|
|
1923
|
+
turn.activeSessionId = sessionIdValue;
|
|
1924
|
+
}
|
|
1925
|
+
});
|
|
1926
|
+
}
|
|
1927
|
+
publishRuntimeTurnController(task, turn) {
|
|
1928
|
+
const controller = task.state.activeController;
|
|
1929
|
+
if (controller) this.activeControllers.set(turn.record.acpxRecordId, controller);
|
|
1930
|
+
}
|
|
1931
|
+
async resolveRuntimeTurnReady(task, turn) {
|
|
1932
|
+
task.sessionReady.resolve();
|
|
1933
|
+
turn.record.lastRequestId = task.input.requestId;
|
|
1934
|
+
turn.record.lastPromptAt = isoNow();
|
|
1935
|
+
turn.record.closed = false;
|
|
1936
|
+
turn.record.closedAt = void 0;
|
|
1937
|
+
turn.record.lastUsedAt = isoNow();
|
|
1938
|
+
await turn.owner.checkpoint.checkpoint();
|
|
1939
|
+
}
|
|
1940
|
+
cancelRuntimeTurnBeforePrompt(task) {
|
|
1941
|
+
if (!task.state.pendingCancel && !task.input.signal?.aborted) return false;
|
|
1942
|
+
task.state.pendingCancel = false;
|
|
1943
|
+
task.promptStarted.reject(/* @__PURE__ */ new Error("ACP turn cancelled before prompt submission."));
|
|
1944
|
+
return true;
|
|
1945
|
+
}
|
|
1946
|
+
updateCompletedRuntimeTurn(turn) {
|
|
1947
|
+
turn.record.acpSessionId = turn.activeSessionId;
|
|
1948
|
+
reconcileAgentSessionId(turn.record, turn.record.agentSessionId);
|
|
1949
|
+
turn.record.protocolVersion = turn.client.initializeResult?.protocolVersion;
|
|
1950
|
+
turn.record.agentCapabilities = turn.client.initializeResult?.agentCapabilities;
|
|
1951
|
+
}
|
|
1952
|
+
handleRuntimeTurnFailure(task, error) {
|
|
1953
|
+
if (!task.input.signal?.aborted || error !== task.input.signal.reason) return this.failRuntimeTurn(task, error);
|
|
1954
|
+
task.promptStarted.reject(error);
|
|
1955
|
+
task.sessionReady.reject(error);
|
|
1956
|
+
return {
|
|
1957
|
+
status: "cancelled",
|
|
1958
|
+
stopReason: "cancelled"
|
|
1959
|
+
};
|
|
1960
|
+
}
|
|
1961
|
+
failRuntimeTurn(task, error) {
|
|
1962
|
+
task.promptStarted.reject(error);
|
|
1963
|
+
task.sessionReady.reject(error);
|
|
1964
|
+
const normalized = normalizeOutputError(error, { origin: "runtime" });
|
|
1965
|
+
return {
|
|
1966
|
+
status: "failed",
|
|
1967
|
+
error: {
|
|
1968
|
+
message: normalized.message,
|
|
1969
|
+
...normalized.code ? { code: normalized.code } : {},
|
|
1970
|
+
...normalized.detailCode ? { detailCode: normalized.detailCode } : {},
|
|
1971
|
+
...normalized.retryable !== void 0 ? { retryable: normalized.retryable } : {}
|
|
1972
|
+
}
|
|
1973
|
+
};
|
|
1974
|
+
}
|
|
1975
|
+
async finalizeRuntimeTurn(task, turn) {
|
|
1976
|
+
task.state.turnActive = false;
|
|
1977
|
+
const abortHandlerAttempt = await settleAttempt(() => task.input.signal?.removeEventListener("abort", task.abortHandler));
|
|
1978
|
+
const recordAttempt = await settleAttempt(async () => turn ? await this.finalizeRuntimeTurnRecord(turn) : false);
|
|
1979
|
+
let failure = firstFailedAttempt([abortHandlerAttempt, recordAttempt]);
|
|
1980
|
+
let pooled = recordAttempt.ok ? recordAttempt.value : false;
|
|
1981
|
+
if (failure) {
|
|
1982
|
+
this.discardRetainedRuntimeTurnOwner(turn);
|
|
1983
|
+
pooled = false;
|
|
1984
|
+
}
|
|
1985
|
+
const closeAttempt = await settleAttempt(async () => this.closeRuntimeTurnClient(turn, pooled));
|
|
1986
|
+
this.cleanupRuntimeTurn(task, turn);
|
|
1987
|
+
failure ??= firstFailedAttempt([closeAttempt]);
|
|
1988
|
+
if (failure) throw failure.error;
|
|
1989
|
+
}
|
|
1990
|
+
discardRetainedRuntimeTurnOwner(turn) {
|
|
1991
|
+
if (turn) {
|
|
1992
|
+
this.removeRetainedSessionOwner(turn.owner);
|
|
1993
|
+
this.attachFinalRuntimeProjection(turn);
|
|
1994
|
+
}
|
|
1995
|
+
}
|
|
1996
|
+
attachFinalRuntimeProjection(turn) {
|
|
1997
|
+
const current = turn.connected ? turn.acpxState : turn.record.acpx;
|
|
1998
|
+
const state = turn.record.acpx?.reset_on_next_ensure === true ? {
|
|
1999
|
+
...current,
|
|
2000
|
+
reset_on_next_ensure: true
|
|
2001
|
+
} : current;
|
|
2002
|
+
this.attachIdleProjection(turn.owner, turn.record, turn.conversation, state);
|
|
2003
|
+
}
|
|
2004
|
+
async closeRuntimeTurnClient(turn, pooled) {
|
|
2005
|
+
if (!turn || pooled) return;
|
|
2006
|
+
const failure = firstFailedAttempt([
|
|
2007
|
+
await settleAttempt(() => turn.client.clearEventHandlers()),
|
|
2008
|
+
await settleAttempt(async () => this.closeClient(turn.client)),
|
|
2009
|
+
await settleAttempt(async () => this.flushSessionOwner(turn.owner))
|
|
2010
|
+
]);
|
|
2011
|
+
if (failure) {
|
|
2012
|
+
this.retiringSessionOwners.add(turn.owner);
|
|
2013
|
+
throw failure.error;
|
|
2014
|
+
}
|
|
2015
|
+
}
|
|
2016
|
+
cleanupRuntimeTurn(task, turn) {
|
|
2017
|
+
if (turn) {
|
|
2018
|
+
this.activeControllers.delete(turn.record.acpxRecordId);
|
|
2019
|
+
this.closingActiveRecords.delete(turn.record.acpxRecordId);
|
|
2020
|
+
}
|
|
2021
|
+
task.queue.close();
|
|
2022
|
+
}
|
|
2023
|
+
async finalizeRuntimeTurnRecord(turn) {
|
|
2024
|
+
if (!turn.connected) turn.acpxState = cloneSessionAcpxState(turn.record.acpx);
|
|
2025
|
+
await turn.owner.checkpoint.checkpoint();
|
|
2026
|
+
this.attachFinalRuntimeProjection(turn);
|
|
2027
|
+
if (turn.record.closed || !turn.connected) return false;
|
|
2028
|
+
return await this.retainPersistentSessionOwnerAfterTurn({
|
|
2029
|
+
record: turn.record,
|
|
2030
|
+
owner: turn.owner
|
|
2031
|
+
});
|
|
2032
|
+
}
|
|
2033
|
+
async *runTurn(input) {
|
|
2034
|
+
const turn = this.startTurn(input);
|
|
2035
|
+
yield* turn.events;
|
|
2036
|
+
yield legacyTerminalEventFromTurnResult(await turn.result);
|
|
2037
|
+
}
|
|
2038
|
+
getStatus(handle) {
|
|
2039
|
+
this.assertOpen();
|
|
2040
|
+
return this.trackTask(this.readStatus(handle));
|
|
2041
|
+
}
|
|
2042
|
+
async readStatus(handle) {
|
|
2043
|
+
const recordId = handle.acpxRecordId ?? handle.sessionKey;
|
|
2044
|
+
const owner = this.retainedSessionOwners.get(recordId);
|
|
2045
|
+
if (owner) await this.flushSessionOwner(owner);
|
|
2046
|
+
return runtimeStatusFromRecord(await this.requireRecord(recordId));
|
|
2047
|
+
}
|
|
2048
|
+
async setMode(handle, mode, sessionMode = "persistent", authority) {
|
|
2049
|
+
const recordId = handle.acpxRecordId ?? handle.sessionKey;
|
|
2050
|
+
await this.withManagerLock(this.runtimeOperationLocks, recordId, async () => this.setModeWithOwnership(handle, mode, sessionMode, authority), authority);
|
|
2051
|
+
}
|
|
2052
|
+
async setModeWithOwnership(handle, mode, sessionMode, authority) {
|
|
2053
|
+
const record = await this.requireRecord(handle.acpxRecordId ?? handle.sessionKey);
|
|
2054
|
+
assertControlAuthority(authority);
|
|
2055
|
+
const controller = this.activeControllers.get(record.acpxRecordId);
|
|
2056
|
+
if (controller) {
|
|
2057
|
+
await controller.setSessionMode(mode, authority);
|
|
2058
|
+
return;
|
|
2059
|
+
}
|
|
2060
|
+
await this.withRuntimeControlSession(record, sessionMode, async ({ client, sessionId, record: connectedRecord }) => {
|
|
2061
|
+
await client.setSessionMode(sessionId, mode, authority);
|
|
2062
|
+
setDesiredModeId(connectedRecord, mode);
|
|
2063
|
+
}, { replacingMode: true }, authority);
|
|
2064
|
+
}
|
|
2065
|
+
async setModel(handle, model, sessionMode = "persistent", authority) {
|
|
2066
|
+
const recordId = handle.acpxRecordId ?? handle.sessionKey;
|
|
2067
|
+
await this.withManagerLock(this.runtimeOperationLocks, recordId, async () => this.setModelWithOwnership(handle, model, sessionMode, authority), authority);
|
|
2068
|
+
}
|
|
2069
|
+
async setModelWithOwnership(handle, model, sessionMode, authority) {
|
|
2070
|
+
const record = await this.requireRecord(handle.acpxRecordId ?? handle.sessionKey);
|
|
2071
|
+
assertControlAuthority(authority);
|
|
2072
|
+
const controller = this.activeControllers.get(record.acpxRecordId);
|
|
2073
|
+
if (controller) {
|
|
2074
|
+
await controller.setSessionModel(model, authority);
|
|
2075
|
+
return;
|
|
2076
|
+
}
|
|
2077
|
+
await this.withRuntimeControlSession(record, sessionMode, async ({ client, sessionId, record: connectedRecord }) => {
|
|
2078
|
+
const models = advertisedModelState(connectedRecord.acpx);
|
|
2079
|
+
const resolvedModelId = resolveRequestedModelId({
|
|
2080
|
+
requestedModel: model,
|
|
2081
|
+
models,
|
|
2082
|
+
agentCommand: connectedRecord.agentCommand
|
|
2083
|
+
});
|
|
2084
|
+
const response = await client.setSessionModel(sessionId, model, models, authority);
|
|
2085
|
+
connectedRecord.acpx = applyModelSelection(connectedRecord.acpx, model, response, resolvedModelId);
|
|
2086
|
+
}, { replacingConfigOption: { key: "model" } }, authority);
|
|
2087
|
+
}
|
|
2088
|
+
async setConfigOption(handle, key, value, sessionMode = "persistent", authority) {
|
|
2089
|
+
const recordId = handle.acpxRecordId ?? handle.sessionKey;
|
|
2090
|
+
return await this.withManagerLock(this.runtimeOperationLocks, recordId, async () => this.setConfigOptionWithOwnership(handle, key, value, sessionMode, authority), authority);
|
|
2091
|
+
}
|
|
2092
|
+
async setConfigOptionWithOwnership(handle, key, value, sessionMode, authority) {
|
|
2093
|
+
const record = await this.requireRecord(handle.acpxRecordId ?? handle.sessionKey);
|
|
2094
|
+
assertControlAuthority(authority);
|
|
2095
|
+
const controller = this.activeControllers.get(record.acpxRecordId);
|
|
2096
|
+
if (controller) {
|
|
2097
|
+
const { response } = await controller.setResolvedSessionConfigOption(key, value, authority);
|
|
2098
|
+
return response;
|
|
2099
|
+
}
|
|
2100
|
+
return await this.withRuntimeControlSession(record, sessionMode, async ({ client, sessionId, record: connectedRecord }) => {
|
|
2101
|
+
const configId = resolveSupportedConfigOptionId(connectedRecord, key);
|
|
2102
|
+
const models = advertisedModelState(connectedRecord.acpx);
|
|
2103
|
+
const { modelConfigId, resolvedValue } = resolveRequestedConfigOption({
|
|
2104
|
+
configId,
|
|
2105
|
+
value,
|
|
2106
|
+
models,
|
|
2107
|
+
agentCommand: connectedRecord.agentCommand
|
|
2108
|
+
});
|
|
2109
|
+
const response = await client.setSessionConfigOption(sessionId, configId, value, models, authority);
|
|
2110
|
+
connectedRecord.acpx = applyConfigOptionSelection(connectedRecord.acpx, configId, value, response, modelConfigId, resolvedValue);
|
|
2111
|
+
return response;
|
|
2112
|
+
}, { replacingConfigOption: {
|
|
2113
|
+
key,
|
|
2114
|
+
resolve: (connectedRecord) => resolveSupportedConfigOptionId(connectedRecord, key)
|
|
2115
|
+
} }, authority);
|
|
2116
|
+
}
|
|
2117
|
+
async requestExtension(input) {
|
|
2118
|
+
const recordId = input.handle.acpxRecordId ?? input.handle.sessionKey;
|
|
2119
|
+
return await this.withManagerLock(this.runtimeOperationLocks, recordId, async () => {
|
|
2120
|
+
const record = await this.requireRecord(recordId);
|
|
2121
|
+
assertControlAuthority(input);
|
|
2122
|
+
const controller = this.activeControllers.get(record.acpxRecordId);
|
|
2123
|
+
if (controller) return await controller.requestExtension(input.method, input.params, input);
|
|
2124
|
+
return await this.withRuntimeControlSession(record, input.sessionMode ?? "persistent", async ({ client }) => await client.requestExtension(input.method, input.params, input), void 0, input);
|
|
2125
|
+
}, input);
|
|
2126
|
+
}
|
|
2127
|
+
async cancel(handle) {
|
|
2128
|
+
await this.activeControllers.get(handle.acpxRecordId ?? handle.sessionKey)?.requestCancelActivePrompt();
|
|
2129
|
+
}
|
|
2130
|
+
prepareFreshSession(handle) {
|
|
2131
|
+
this.assertOpen();
|
|
2132
|
+
const recordId = handle.acpxRecordId ?? handle.sessionKey;
|
|
2133
|
+
const cancelled = this.cancelSessionTasks(recordId);
|
|
2134
|
+
cancelled.catch(() => {});
|
|
2135
|
+
return this.queueSessionTask(recordId, async () => {
|
|
2136
|
+
const tasks = await cancelled;
|
|
2137
|
+
await Promise.all(tasks.map((task) => task.completion));
|
|
2138
|
+
return await this.withManagerLock(this.runtimeOperationLocks, recordId, async () => this.closeRuntimeSession(handle, "prepare-fresh"));
|
|
2139
|
+
});
|
|
2140
|
+
}
|
|
2141
|
+
close(handle, options = {}) {
|
|
2142
|
+
this.assertOpen();
|
|
2143
|
+
const recordId = handle.acpxRecordId ?? handle.sessionKey;
|
|
2144
|
+
return this.trackTask(this.withManagerLock(this.runtimeOperationLocks, recordId, async () => {
|
|
2145
|
+
return await this.closeRuntimeSession(handle, options.discardPersistentState === true ? "discard" : "release");
|
|
2146
|
+
}));
|
|
2147
|
+
}
|
|
2148
|
+
async closeRuntimeSession(handle, intent) {
|
|
2149
|
+
const recordId = handle.acpxRecordId ?? handle.sessionKey;
|
|
2150
|
+
await this.retrySessionCleanup(recordId);
|
|
2151
|
+
const record = await this.resolveRuntimeRecordForClose(recordId);
|
|
2152
|
+
this.markActiveRuntimeRecordClosing(record);
|
|
2153
|
+
if (intent !== "prepare-fresh") await this.cancelSessionTasks(recordId);
|
|
2154
|
+
const closeFailure = await this.closeRuntimeRecordOwnership(record, intent);
|
|
2155
|
+
if (intent === "discard") {
|
|
2156
|
+
if (closeFailure) throw closeFailure.error;
|
|
2157
|
+
return;
|
|
2158
|
+
}
|
|
2159
|
+
const saveAttempt = await settleAttempt(async () => this.saveClosedRuntimeRecord(record, intent !== "release"));
|
|
2160
|
+
const failure = closeFailure ?? firstFailedAttempt([saveAttempt]);
|
|
2161
|
+
if (failure) throw failure.error;
|
|
2162
|
+
}
|
|
2163
|
+
async saveClosedRuntimeRecord(record, reset) {
|
|
2164
|
+
record.closed = true;
|
|
2165
|
+
record.closedAt = isoNow();
|
|
2166
|
+
if (reset) record.acpx = {
|
|
2167
|
+
...record.acpx,
|
|
2168
|
+
reset_on_next_ensure: true
|
|
2169
|
+
};
|
|
2170
|
+
await this.options.sessionStore.save(record);
|
|
2171
|
+
}
|
|
2172
|
+
async resolveRuntimeRecordForClose(recordId) {
|
|
2173
|
+
const retainedOwner = this.retainedSessionOwners.get(recordId);
|
|
2174
|
+
if (retainedOwner) await this.flushSessionOwner(retainedOwner);
|
|
2175
|
+
return retainedOwner?.projection?.record ?? await this.requireRecord(recordId);
|
|
2176
|
+
}
|
|
2177
|
+
markActiveRuntimeRecordClosing(record) {
|
|
2178
|
+
if (this.activeControllers.has(record.acpxRecordId)) this.closingActiveRecords.add(record.acpxRecordId);
|
|
2179
|
+
}
|
|
2180
|
+
async closeRuntimeRecordOwnership(record, intent) {
|
|
2181
|
+
if (intent === "discard") return await this.closeBackendSession(record);
|
|
2182
|
+
else if (intent === "prepare-fresh") {
|
|
2183
|
+
const owner = this.retainedSessionOwners.get(record.acpxRecordId);
|
|
2184
|
+
if (owner) {
|
|
2185
|
+
this.removeRetainedSessionOwner(owner);
|
|
2186
|
+
this.retiringSessionOwners.add(owner);
|
|
2187
|
+
}
|
|
2188
|
+
await this.retrySessionCleanup(record.acpxRecordId);
|
|
2189
|
+
} else await this.closeRetainedSessionOwner(record.acpxRecordId);
|
|
2190
|
+
}
|
|
2191
|
+
async closeBackendSession(record) {
|
|
2192
|
+
const connection = await this.acquireBackendCloseConnection(record);
|
|
2193
|
+
const requestAttempt = await settleAttempt(async () => {
|
|
2194
|
+
try {
|
|
2195
|
+
await this.requestBackendSessionClose(record, connection);
|
|
2196
|
+
} catch (error) {
|
|
2197
|
+
this.handleBackendSessionCloseError(record, error);
|
|
2198
|
+
}
|
|
2199
|
+
});
|
|
2200
|
+
const owner = connection.owner ?? this.createSessionOwner({
|
|
2201
|
+
client: connection.client,
|
|
2202
|
+
sessionKey: record.acpxRecordId,
|
|
2203
|
+
mode: "persistent"
|
|
2204
|
+
});
|
|
2205
|
+
owner.recordId = record.acpxRecordId;
|
|
2206
|
+
const finalizeAttempt = await settleAttempt(async () => this.finalizeSessionConnection(connection));
|
|
2207
|
+
owner.pendingResetRecord = record;
|
|
2208
|
+
this.retiringSessionOwners.add(owner);
|
|
2209
|
+
if (!finalizeAttempt.ok) throw finalizeAttempt.error;
|
|
2210
|
+
const saveAttempt = await settleAttempt(async () => this.settleRetiredSessionRecord(owner));
|
|
2211
|
+
if (saveAttempt.ok) this.retiringSessionOwners.delete(owner);
|
|
2212
|
+
return firstFailedAttempt([requestAttempt, saveAttempt]);
|
|
2213
|
+
}
|
|
2214
|
+
async finalizeSessionConnection(connection) {
|
|
2215
|
+
const failure = firstFailedAttempt([
|
|
2216
|
+
await settleAttempt(async () => {
|
|
2217
|
+
if (connection.owner) await this.flushSessionOwner(connection.owner);
|
|
2218
|
+
}),
|
|
2219
|
+
await settleAttempt(() => connection.owner?.client.clearEventHandlers()),
|
|
2220
|
+
await settleAttempt(async () => this.closeClient(connection.client)),
|
|
2221
|
+
await settleAttempt(async () => connection.owner?.checkpoint.flush())
|
|
2222
|
+
]);
|
|
2223
|
+
if (failure) throw failure.error;
|
|
2224
|
+
}
|
|
2225
|
+
async acquireBackendCloseConnection(record) {
|
|
2226
|
+
const owner = await this.readRetainedSessionOwner(record, { consume: true });
|
|
2227
|
+
if (owner) return {
|
|
2228
|
+
client: owner.client,
|
|
2229
|
+
owner
|
|
2230
|
+
};
|
|
2231
|
+
return { client: this.createTurnClient(record) };
|
|
2232
|
+
}
|
|
2233
|
+
async requestBackendSessionClose(record, connection) {
|
|
2234
|
+
if (!connection.owner) await withTimeout(connection.client.start(), this.options.timeoutMs);
|
|
2235
|
+
if (!connection.client.supportsCloseSession()) throw new AcpRuntimeError("ACP_BACKEND_UNSUPPORTED_CONTROL", `Agent does not support session/close for ${record.acpxRecordId}.`);
|
|
2236
|
+
await withTimeout(connection.client.closeSession(record.acpSessionId), this.options.timeoutMs);
|
|
2237
|
+
}
|
|
2238
|
+
handleBackendSessionCloseError(record, error) {
|
|
2239
|
+
if (isAcpResourceNotFoundError(error)) return;
|
|
2240
|
+
if (isUnsupportedSessionCloseError(error)) throw new AcpRuntimeError("ACP_BACKEND_UNSUPPORTED_CONTROL", `Agent does not support session/close for ${record.acpxRecordId}.`, { cause: error });
|
|
2241
|
+
throw error;
|
|
2242
|
+
}
|
|
2243
|
+
async requireRecord(sessionId) {
|
|
2244
|
+
const record = await this.options.sessionStore.load(sessionId);
|
|
2245
|
+
if (!record) throw new Error(`ACP session not found: ${sessionId}`);
|
|
2246
|
+
return record;
|
|
2247
|
+
}
|
|
2248
|
+
};
|
|
2249
|
+
// src/runtime/public/file-session-store.ts
|
|
2250
|
+
function safeSessionId(sessionId) {
|
|
2251
|
+
return encodeURIComponent(sessionId);
|
|
2252
|
+
}
|
|
2253
|
+
var FileSessionStore = class {
|
|
2254
|
+
stateDir;
|
|
2255
|
+
constructor(stateDir) {
|
|
2256
|
+
this.stateDir = stateDir;
|
|
2257
|
+
}
|
|
2258
|
+
get sessionDir() {
|
|
2259
|
+
return path.join(this.stateDir, "sessions");
|
|
2260
|
+
}
|
|
2261
|
+
filePath(sessionId) {
|
|
2262
|
+
return path.join(this.sessionDir, `${safeSessionId(sessionId)}.json`);
|
|
2263
|
+
}
|
|
2264
|
+
async ensureDir() {
|
|
2265
|
+
await fs.mkdir(this.sessionDir, {
|
|
2266
|
+
recursive: true,
|
|
2267
|
+
mode: 448
|
|
2268
|
+
});
|
|
2269
|
+
}
|
|
2270
|
+
async load(sessionId) {
|
|
2271
|
+
await this.ensureDir();
|
|
2272
|
+
let payload;
|
|
2273
|
+
try {
|
|
2274
|
+
payload = await fs.readFile(this.filePath(sessionId), "utf8");
|
|
2275
|
+
} catch (error) {
|
|
2276
|
+
if (error.code === "ENOENT") return;
|
|
2277
|
+
throw error;
|
|
2278
|
+
}
|
|
2279
|
+
let parsed;
|
|
2280
|
+
try {
|
|
2281
|
+
parsed = JSON.parse(payload);
|
|
2282
|
+
} catch {
|
|
2283
|
+
return;
|
|
2284
|
+
}
|
|
2285
|
+
const record = parseSessionRecord(parsed);
|
|
2286
|
+
return record?.acpxRecordId === sessionId ? record : void 0;
|
|
2287
|
+
}
|
|
2288
|
+
async save(record) {
|
|
2289
|
+
const persisted = serializeSessionRecordForDisk(record);
|
|
2290
|
+
assertPersistedKeyPolicy(persisted);
|
|
2291
|
+
await writePrivateJsonFile(this.filePath(record.acpxRecordId), persisted);
|
|
2292
|
+
}
|
|
2293
|
+
};
|
|
2294
|
+
function createFileSessionStore(options) {
|
|
2295
|
+
return new FileSessionStore(path.resolve(options.stateDir));
|
|
2296
|
+
}
|
|
2297
|
+
// src/runtime/public/handle-state.ts
|
|
2298
|
+
const ACPX_RUNTIME_HANDLE_PREFIX = "acpx:v2:";
|
|
2299
|
+
function encodeAcpxRuntimeHandleState(state) {
|
|
2300
|
+
const payload = Buffer.from(JSON.stringify(state), "utf8").toString("base64url");
|
|
2301
|
+
return `${ACPX_RUNTIME_HANDLE_PREFIX}${payload}`;
|
|
2302
|
+
}
|
|
2303
|
+
function decodeAcpxRuntimeHandleState(runtimeSessionName) {
|
|
2304
|
+
const trimmed = runtimeSessionName.trim();
|
|
2305
|
+
if (!trimmed.startsWith(ACPX_RUNTIME_HANDLE_PREFIX)) return null;
|
|
2306
|
+
try {
|
|
2307
|
+
const raw = Buffer.from(trimmed.slice(8), "base64url").toString("utf8");
|
|
2308
|
+
const parsed = JSON.parse(raw);
|
|
2309
|
+
const name = asOptionalString(parsed.name);
|
|
2310
|
+
const agent = asOptionalString(parsed.agent);
|
|
2311
|
+
const cwd = asOptionalString(parsed.cwd);
|
|
2312
|
+
const mode = asOptionalString(parsed.mode);
|
|
2313
|
+
if (!name || !agent || !cwd || mode !== "persistent" && mode !== "oneshot") return null;
|
|
2314
|
+
return {
|
|
2315
|
+
name,
|
|
2316
|
+
agent,
|
|
2317
|
+
cwd,
|
|
2318
|
+
mode,
|
|
2319
|
+
acpxRecordId: asOptionalString(parsed.acpxRecordId),
|
|
2320
|
+
backendSessionId: asOptionalString(parsed.backendSessionId),
|
|
2321
|
+
agentSessionId: asOptionalString(parsed.agentSessionId)
|
|
2322
|
+
};
|
|
2323
|
+
} catch {
|
|
2324
|
+
return null;
|
|
2325
|
+
}
|
|
2326
|
+
}
|
|
2327
|
+
function writeHandleState(handle, state) {
|
|
2328
|
+
handle.runtimeSessionName = encodeAcpxRuntimeHandleState(state);
|
|
2329
|
+
handle.cwd = state.cwd;
|
|
2330
|
+
handle.acpxRecordId = state.acpxRecordId;
|
|
2331
|
+
handle.backendSessionId = state.backendSessionId;
|
|
2332
|
+
handle.agentSessionId = state.agentSessionId;
|
|
2333
|
+
}
|
|
2334
|
+
// src/runtime/shared.ts
|
|
2335
|
+
const SHARED_BACKEND = "acpx-shared";
|
|
2336
|
+
function invalidOption(message) {
|
|
2337
|
+
throw new AcpRuntimeError("ACP_INVALID_RUNTIME_OPTION", message);
|
|
2338
|
+
}
|
|
2339
|
+
function sharedHandle(record) {
|
|
2340
|
+
return {
|
|
2341
|
+
backend: SHARED_BACKEND,
|
|
2342
|
+
sessionKey: record.name ?? "",
|
|
2343
|
+
runtimeSessionName: record.acpxRecordId,
|
|
2344
|
+
acpxRecordId: record.acpxRecordId,
|
|
2345
|
+
backendSessionId: record.acpSessionId,
|
|
2346
|
+
agentSessionId: record.agentSessionId,
|
|
2347
|
+
cwd: record.cwd
|
|
2348
|
+
};
|
|
2349
|
+
}
|
|
2350
|
+
function sharedRecordId(handle) {
|
|
2351
|
+
if (handle.backend !== SHARED_BACKEND || !handle.acpxRecordId) return invalidOption("A shared runtime requires a handle from a shared session.");
|
|
2352
|
+
return handle.acpxRecordId;
|
|
2353
|
+
}
|
|
2354
|
+
/**
|
|
2355
|
+
* Shared controls are owner-only. Falling back to a direct connection would
|
|
2356
|
+
* start a second adapter connection for a session another process owns, and
|
|
2357
|
+
* that path may create a fresh provider session when the saved one no longer
|
|
2358
|
+
* loads. Shared turns already refuse that trade; controls refuse it too.
|
|
2359
|
+
*/
|
|
2360
|
+
function requireOwnerDispatch(result, control) {
|
|
2361
|
+
if (result === void 0) throw new AcpRuntimeError("ACP_BACKEND_UNAVAILABLE", `No running owner holds this shared session, so ${control} was not sent. Submit a turn to start an owner, or apply the change with the equivalent acpx command, which connects directly instead of starting one.`);
|
|
2362
|
+
return result;
|
|
2363
|
+
}
|
|
2364
|
+
function turnFailure(error) {
|
|
2365
|
+
const normalized = normalizeOutputError(error, {
|
|
2366
|
+
defaultCode: "RUNTIME",
|
|
2367
|
+
origin: "queue"
|
|
2368
|
+
});
|
|
2369
|
+
if (normalized.detailCode === "QUEUE_REQUEST_CANCELLED") return {
|
|
2370
|
+
status: "cancelled",
|
|
2371
|
+
stopReason: "cancelled"
|
|
2372
|
+
};
|
|
2373
|
+
return {
|
|
2374
|
+
status: "failed",
|
|
2375
|
+
error: {
|
|
2376
|
+
message: normalized.message,
|
|
2377
|
+
code: normalized.code,
|
|
2378
|
+
detailCode: normalized.detailCode,
|
|
2379
|
+
retryable: normalized.retryable
|
|
2380
|
+
}
|
|
2381
|
+
};
|
|
2382
|
+
}
|
|
2383
|
+
/** A client of the CLI's local session owner. Shutdown detaches this client. */
|
|
2384
|
+
var SharedAcpRuntime = class {
|
|
2385
|
+
registry;
|
|
2386
|
+
options;
|
|
2387
|
+
disconnect = new AbortController();
|
|
2388
|
+
pending = /* @__PURE__ */ new Set();
|
|
2389
|
+
controlChains = /* @__PURE__ */ new Map();
|
|
2390
|
+
constructor(options) {
|
|
2391
|
+
for (const name of [
|
|
2392
|
+
"sessionStore",
|
|
2393
|
+
"agentProcessEnv",
|
|
2394
|
+
"agentProcessEnvAllow",
|
|
2395
|
+
"agentProcessEnvBlock",
|
|
2396
|
+
"mcpServers",
|
|
2397
|
+
"sessionPermissions",
|
|
2398
|
+
"processLifecycle",
|
|
2399
|
+
"onPermissionRequest",
|
|
2400
|
+
"onAcpMessage",
|
|
2401
|
+
"elicitationModes",
|
|
2402
|
+
"fs",
|
|
2403
|
+
"terminal"
|
|
2404
|
+
]) if (Object.hasOwn(options, name)) invalidOption(`${name} belongs to the in-process runtime and is not supported by shared sessions.`);
|
|
2405
|
+
this.options = {
|
|
2406
|
+
...options,
|
|
2407
|
+
cwd: path.resolve(options.cwd),
|
|
2408
|
+
authCredentials: options.authCredentials ? { ...options.authCredentials } : void 0
|
|
2409
|
+
};
|
|
2410
|
+
this.registry = options.agentRegistry ?? createAgentRegistry();
|
|
2411
|
+
}
|
|
2412
|
+
assertOpen() {
|
|
2413
|
+
if (this.disconnect.signal.aborted) throw new AcpRuntimeError("ACP_BACKEND_UNAVAILABLE", "Shared ACP runtime is shut down.");
|
|
2414
|
+
}
|
|
2415
|
+
track(task) {
|
|
2416
|
+
this.pending.add(task);
|
|
2417
|
+
task.then(() => this.pending.delete(task), () => this.pending.delete(task));
|
|
2418
|
+
return task;
|
|
2419
|
+
}
|
|
2420
|
+
sessionOptions(input) {
|
|
2421
|
+
if (!input.agent.trim()) invalidOption("ACP agent id is required.");
|
|
2422
|
+
return {
|
|
2423
|
+
...normalizeAgentCommandInput(this.registry.resolve(input.agent)),
|
|
2424
|
+
cwd: path.resolve(input.cwd ?? this.options.cwd),
|
|
2425
|
+
name: input.sessionKey.trim() || void 0
|
|
2426
|
+
};
|
|
2427
|
+
}
|
|
2428
|
+
async findSession(input) {
|
|
2429
|
+
this.assertOpen();
|
|
2430
|
+
const record = await findSession(this.sessionOptions(input));
|
|
2431
|
+
return record ? sharedHandle(record) : void 0;
|
|
2432
|
+
}
|
|
2433
|
+
ensureSession(input) {
|
|
2434
|
+
this.assertOpen();
|
|
2435
|
+
if (input.mode !== "persistent") invalidOption("Shared sessions require persistent mode; use the in-process runtime for oneshot sessions.");
|
|
2436
|
+
const session = this.sessionOptions(input);
|
|
2437
|
+
return this.track(ensureSession({
|
|
2438
|
+
...this.options,
|
|
2439
|
+
...session,
|
|
2440
|
+
walkBoundary: session.cwd,
|
|
2441
|
+
sessionOptions: input.sessionOptions,
|
|
2442
|
+
resumeSessionId: input.resumeSessionId,
|
|
2443
|
+
handleProcessInterrupts: false,
|
|
2444
|
+
signal: this.disconnect.signal
|
|
2445
|
+
}).then(({ record }) => {
|
|
2446
|
+
this.assertOpen();
|
|
2447
|
+
return sharedHandle(record);
|
|
2448
|
+
}));
|
|
2449
|
+
}
|
|
2450
|
+
startTurn(input) {
|
|
2451
|
+
this.assertOpen();
|
|
2452
|
+
if (input.mode !== "prompt" || input.assertActive || input.onPermissionRequest || input.onElicitation) invalidOption("Shared turns support prompt mode and the client's static permission policy; in-process callbacks and steering are unsupported.");
|
|
2453
|
+
if (!input.requestId.trim()) invalidOption("A shared turn requires a requestId.");
|
|
2454
|
+
const sessionId = sharedRecordId(input.handle);
|
|
2455
|
+
const prompt = toPromptInput(input.text, input.attachments);
|
|
2456
|
+
const events = new AsyncEventQueue();
|
|
2457
|
+
const promptStarted = createDeferred();
|
|
2458
|
+
promptStarted.promise.catch(() => {});
|
|
2459
|
+
let accepted = false;
|
|
2460
|
+
let settled = false;
|
|
2461
|
+
let cancelRequested = input.signal?.aborted === true;
|
|
2462
|
+
let cancellation;
|
|
2463
|
+
const cancel = async () => {
|
|
2464
|
+
cancelRequested = true;
|
|
2465
|
+
if (!accepted || settled) return;
|
|
2466
|
+
cancellation ??= tryCancelOnRunningOwner({
|
|
2467
|
+
sessionId,
|
|
2468
|
+
targetRequestId: input.requestId
|
|
2469
|
+
}).then(() => {});
|
|
2470
|
+
await cancellation;
|
|
2471
|
+
};
|
|
2472
|
+
const onAbort = () => {
|
|
2473
|
+
cancel().catch(() => {});
|
|
2474
|
+
};
|
|
2475
|
+
input.signal?.addEventListener("abort", onAbort, { once: true });
|
|
2476
|
+
const run = async () => {
|
|
2477
|
+
if (cancelRequested) return {
|
|
2478
|
+
status: "cancelled",
|
|
2479
|
+
stopReason: "cancelled"
|
|
2480
|
+
};
|
|
2481
|
+
if ((await resolveSessionRecord(sessionId)).closed) throw new AcpRuntimeError("ACP_SESSION_INIT_FAILED", "Shared session is closed; ensure it again before submitting a turn.");
|
|
2482
|
+
if (cancelRequested) return {
|
|
2483
|
+
status: "cancelled",
|
|
2484
|
+
stopReason: "cancelled"
|
|
2485
|
+
};
|
|
2486
|
+
const result = await sendSession({
|
|
2487
|
+
...this.options,
|
|
2488
|
+
sessionId,
|
|
2489
|
+
requestId: input.requestId,
|
|
2490
|
+
prompt: typeof prompt === "string" ? textPrompt(prompt) : prompt,
|
|
2491
|
+
resumePolicy: "same-session-only",
|
|
2492
|
+
requireSharedRuntime: true,
|
|
2493
|
+
signal: this.disconnect.signal,
|
|
2494
|
+
timeoutMs: input.timeoutMs ?? this.options.timeoutMs,
|
|
2495
|
+
queueOwnerArgs: [fileURLToPath(import.meta.resolve("acpx/dist/cli.js")), "__queue-owner"],
|
|
2496
|
+
onQueueAccepted: () => {
|
|
2497
|
+
accepted = true;
|
|
2498
|
+
if (cancelRequested) cancel().catch(() => {});
|
|
2499
|
+
},
|
|
2500
|
+
onPromptStarted: () => promptStarted.resolve(),
|
|
2501
|
+
outputFormatter: {
|
|
2502
|
+
...DISCARD_OUTPUT_FORMATTER,
|
|
2503
|
+
onAcpMessage: (message) => {
|
|
2504
|
+
const event = runtimeEventFromMessage(message);
|
|
2505
|
+
if (event) events.push(event);
|
|
2506
|
+
}
|
|
2507
|
+
},
|
|
2508
|
+
errorEmissionPolicy: { queueErrorAlreadyEmitted: false },
|
|
2509
|
+
waitForCompletion: true
|
|
2510
|
+
});
|
|
2511
|
+
if ("queued" in result) throw new AcpRuntimeError("ACP_TURN_FAILED", "Shared turn ended without a completion result.");
|
|
2512
|
+
return {
|
|
2513
|
+
status: result.stopReason === "cancelled" ? "cancelled" : "completed",
|
|
2514
|
+
stopReason: result.stopReason,
|
|
2515
|
+
_meta: result._meta
|
|
2516
|
+
};
|
|
2517
|
+
};
|
|
2518
|
+
const result = this.track(run().catch(turnFailure).finally(() => {
|
|
2519
|
+
settled = true;
|
|
2520
|
+
promptStarted.reject(new AcpRuntimeError("ACP_TURN_FAILED", "Turn settled before its prompt was written."));
|
|
2521
|
+
input.signal?.removeEventListener("abort", onAbort);
|
|
2522
|
+
events.close();
|
|
2523
|
+
}));
|
|
2524
|
+
return {
|
|
2525
|
+
requestId: input.requestId,
|
|
2526
|
+
promptStarted: promptStarted.promise,
|
|
2527
|
+
events: events.iterate(),
|
|
2528
|
+
result,
|
|
2529
|
+
cancel,
|
|
2530
|
+
closeStream: async () => {
|
|
2531
|
+
events.clear();
|
|
2532
|
+
events.close();
|
|
2533
|
+
}
|
|
2534
|
+
};
|
|
2535
|
+
}
|
|
2536
|
+
async *runTurn(input) {
|
|
2537
|
+
const turn = this.startTurn(input);
|
|
2538
|
+
yield* turn.events;
|
|
2539
|
+
yield legacyTerminalEventFromTurnResult(await turn.result);
|
|
2540
|
+
}
|
|
2541
|
+
async getStatus(input) {
|
|
2542
|
+
this.assertOpen();
|
|
2543
|
+
return runtimeStatusFromRecord(await resolveSessionRecord(sharedRecordId(input.handle)));
|
|
2544
|
+
}
|
|
2545
|
+
async getCapabilities(input) {
|
|
2546
|
+
this.assertOpen();
|
|
2547
|
+
if (!input?.handle) return capabilitiesFromRecord(void 0);
|
|
2548
|
+
return capabilitiesFromRecord(await readSessionRecord(sharedRecordId(input.handle)));
|
|
2549
|
+
}
|
|
2550
|
+
/**
|
|
2551
|
+
* Preserves this client's control order, including caller-side persistence
|
|
2552
|
+
* when talking to older owners. Updated owners checkpoint accepted controls
|
|
2553
|
+
* themselves; serialization here cannot coordinate other legacy callers.
|
|
2554
|
+
*/
|
|
2555
|
+
chainControl(sessionId, run) {
|
|
2556
|
+
const result = (this.controlChains.get(sessionId) ?? Promise.resolve()).then(run, run);
|
|
2557
|
+
const chained = result.then(() => void 0, () => void 0);
|
|
2558
|
+
this.controlChains.set(sessionId, chained);
|
|
2559
|
+
chained.then(() => {
|
|
2560
|
+
if (this.controlChains.get(sessionId) === chained) this.controlChains.delete(sessionId);
|
|
2561
|
+
});
|
|
2562
|
+
return result;
|
|
2563
|
+
}
|
|
2564
|
+
/**
|
|
2565
|
+
* Checks this client's authority locally, then hands the control to the
|
|
2566
|
+
* running owner. The check gates this client's dispatch only; it cannot gate
|
|
2567
|
+
* controls other clients of the same owner send, and it cannot recall a
|
|
2568
|
+
* control the owner already accepted.
|
|
2569
|
+
*/
|
|
2570
|
+
async dispatchControl(input, control, send) {
|
|
2571
|
+
this.assertOpen();
|
|
2572
|
+
const sessionId = sharedRecordId(input.handle);
|
|
2573
|
+
const assertAuthority = () => {
|
|
2574
|
+
this.assertOpen();
|
|
2575
|
+
assertControlAuthority(input);
|
|
2576
|
+
};
|
|
2577
|
+
return await this.track(this.chainControl(sessionId, async () => {
|
|
2578
|
+
assertAuthority();
|
|
2579
|
+
return requireOwnerDispatch(await send(sessionId, assertAuthority), control);
|
|
2580
|
+
}));
|
|
2581
|
+
}
|
|
2582
|
+
async setMode(input) {
|
|
2583
|
+
await this.dispatchControl(input, "session/set_mode", async (sessionId, assertAuthority) => setSessionModeOnOwner({
|
|
2584
|
+
sessionId,
|
|
2585
|
+
modeId: input.mode,
|
|
2586
|
+
timeoutMs: this.options.timeoutMs,
|
|
2587
|
+
assertDispatch: assertAuthority
|
|
2588
|
+
}));
|
|
2589
|
+
}
|
|
2590
|
+
async setModel(input) {
|
|
2591
|
+
await this.dispatchControl(input, "session/set_model", async (sessionId, assertAuthority) => setSessionModelOnOwner({
|
|
2592
|
+
sessionId,
|
|
2593
|
+
modelId: input.model,
|
|
2594
|
+
timeoutMs: this.options.timeoutMs,
|
|
2595
|
+
assertDispatch: assertAuthority
|
|
2596
|
+
}));
|
|
2597
|
+
}
|
|
2598
|
+
async setConfigOption(input) {
|
|
2599
|
+
return (await this.dispatchControl(input, "session/set_config_option", async (sessionId, assertAuthority) => {
|
|
2600
|
+
const configId = resolveSupportedConfigOptionId(await resolveSessionRecord(sessionId), input.key);
|
|
2601
|
+
assertAuthority();
|
|
2602
|
+
return await setSessionConfigOptionOnOwner({
|
|
2603
|
+
sessionId,
|
|
2604
|
+
configId,
|
|
2605
|
+
value: input.value,
|
|
2606
|
+
timeoutMs: this.options.timeoutMs,
|
|
2607
|
+
assertDispatch: assertAuthority
|
|
2608
|
+
});
|
|
2609
|
+
})).response;
|
|
2610
|
+
}
|
|
2611
|
+
watchSession(input) {
|
|
2612
|
+
this.assertOpen();
|
|
2613
|
+
const signal = input.signal ? AbortSignal.any([input.signal, this.disconnect.signal]) : this.disconnect.signal;
|
|
2614
|
+
const recordId = sharedRecordId(input.handle);
|
|
2615
|
+
const record = readSessionRecord(recordId).then((value) => {
|
|
2616
|
+
if (!value || value.acpxRecordId !== recordId) throw new AcpRuntimeError("ACP_SESSION_INIT_FAILED", "Shared session record is unavailable.");
|
|
2617
|
+
return value;
|
|
2618
|
+
});
|
|
2619
|
+
record.catch(() => {});
|
|
2620
|
+
return watchSession({
|
|
2621
|
+
record,
|
|
2622
|
+
cursor: input.cursor,
|
|
2623
|
+
signal
|
|
2624
|
+
});
|
|
2625
|
+
}
|
|
2626
|
+
async cancel(input) {
|
|
2627
|
+
this.assertOpen();
|
|
2628
|
+
await this.track(cancelSessionPrompt({ sessionId: sharedRecordId(input.handle) }));
|
|
2629
|
+
}
|
|
2630
|
+
async close(input) {
|
|
2631
|
+
this.assertOpen();
|
|
2632
|
+
await this.track(closeSession(sharedRecordId(input.handle)));
|
|
2633
|
+
}
|
|
2634
|
+
async shutdown() {
|
|
2635
|
+
this.disconnect.abort(new AcpRuntimeError("ACP_BACKEND_UNAVAILABLE", "Shared client detached; submitted work may still be running."));
|
|
2636
|
+
await Promise.allSettled(this.pending);
|
|
2637
|
+
}
|
|
2638
|
+
};
|
|
2639
|
+
function createSharedAcpRuntime(options) {
|
|
2640
|
+
return new SharedAcpRuntime(options);
|
|
2641
|
+
}
|
|
2642
|
+
// src/runtime.ts
|
|
2643
|
+
const ACPX_BACKEND_ID = "acpx";
|
|
2644
|
+
var AcpxRuntime = class {
|
|
2645
|
+
options;
|
|
2646
|
+
testOptions;
|
|
2647
|
+
healthy = false;
|
|
2648
|
+
shutdownTask;
|
|
2649
|
+
probeTasks = /* @__PURE__ */ new Set();
|
|
2650
|
+
manager = null;
|
|
2651
|
+
managerPromise = null;
|
|
2652
|
+
constructor(options, testOptions) {
|
|
2653
|
+
this.options = options;
|
|
2654
|
+
this.testOptions = testOptions;
|
|
2655
|
+
if (options.agentProcessEnv || options.agentProcessEnvAllow !== void 0 || options.agentProcessEnvBlock !== void 0) this.options = {
|
|
2656
|
+
...options,
|
|
2657
|
+
agentProcessEnv: options.agentProcessEnv ? { ...options.agentProcessEnv } : void 0,
|
|
2658
|
+
agentProcessEnvAllow: snapshotEnvNames("agentProcessEnvAllow", options.agentProcessEnvAllow),
|
|
2659
|
+
agentProcessEnvBlock: snapshotEnvNames("agentProcessEnvBlock", options.agentProcessEnvBlock)
|
|
2660
|
+
};
|
|
2661
|
+
}
|
|
2662
|
+
isHealthy() {
|
|
2663
|
+
return this.healthy;
|
|
2664
|
+
}
|
|
2665
|
+
async probeAvailability() {
|
|
2666
|
+
const report = await this.runProbe();
|
|
2667
|
+
this.healthy = report.ok;
|
|
2668
|
+
}
|
|
2669
|
+
async doctor() {
|
|
2670
|
+
const report = await this.runProbe();
|
|
2671
|
+
this.healthy = report.ok;
|
|
2672
|
+
return {
|
|
2673
|
+
ok: report.ok,
|
|
2674
|
+
code: report.ok ? void 0 : "ACP_BACKEND_UNAVAILABLE",
|
|
2675
|
+
message: report.message,
|
|
2676
|
+
details: normalizeRuntimeDetails(report.details)
|
|
2677
|
+
};
|
|
2678
|
+
}
|
|
2679
|
+
resolveSessionIdentity(input) {
|
|
2680
|
+
const sessionName = input.sessionKey.trim();
|
|
2681
|
+
if (!sessionName) throw new AcpRuntimeError("ACP_SESSION_INIT_FAILED", "ACP session key is required.");
|
|
2682
|
+
const agent = input.agent.trim();
|
|
2683
|
+
if (!agent) throw new AcpRuntimeError("ACP_SESSION_INIT_FAILED", "ACP agent id is required.");
|
|
2684
|
+
return {
|
|
2685
|
+
sessionName,
|
|
2686
|
+
agent
|
|
2687
|
+
};
|
|
2688
|
+
}
|
|
2689
|
+
async findSession(input) {
|
|
2690
|
+
const { sessionName, agent } = this.resolveSessionIdentity(input);
|
|
2691
|
+
const record = await (await this.getManager()).findSession(sessionName);
|
|
2692
|
+
return record ? this.createSessionHandle({
|
|
2693
|
+
sessionKey: input.sessionKey,
|
|
2694
|
+
agent,
|
|
2695
|
+
mode: "persistent"
|
|
2696
|
+
}, record) : void 0;
|
|
2697
|
+
}
|
|
2698
|
+
async ensureSession(input) {
|
|
2699
|
+
const { sessionName, agent } = this.resolveSessionIdentity(input);
|
|
2700
|
+
const record = await (await this.getManager()).ensureSession({
|
|
2701
|
+
sessionKey: sessionName,
|
|
2702
|
+
agent,
|
|
2703
|
+
mode: input.mode,
|
|
2704
|
+
cwd: input.cwd ?? this.options.cwd,
|
|
2705
|
+
resumeSessionId: input.resumeSessionId,
|
|
2706
|
+
sessionOptions: input.sessionOptions
|
|
2707
|
+
});
|
|
2708
|
+
return this.createSessionHandle({
|
|
2709
|
+
...input,
|
|
2710
|
+
agent
|
|
2711
|
+
}, record);
|
|
2712
|
+
}
|
|
2713
|
+
createSessionHandle(input, record) {
|
|
2714
|
+
const handle = {
|
|
2715
|
+
sessionKey: input.sessionKey,
|
|
2716
|
+
backend: ACPX_BACKEND_ID,
|
|
2717
|
+
runtimeSessionName: "",
|
|
2718
|
+
cwd: record.cwd,
|
|
2719
|
+
acpxRecordId: record.acpxRecordId,
|
|
2720
|
+
backendSessionId: record.acpSessionId,
|
|
2721
|
+
agentSessionId: record.agentSessionId
|
|
2722
|
+
};
|
|
2723
|
+
writeHandleState(handle, {
|
|
2724
|
+
name: input.sessionKey.trim(),
|
|
2725
|
+
agent: input.agent,
|
|
2726
|
+
cwd: record.cwd,
|
|
2727
|
+
mode: input.mode,
|
|
2728
|
+
acpxRecordId: record.acpxRecordId,
|
|
2729
|
+
backendSessionId: record.acpSessionId,
|
|
2730
|
+
agentSessionId: record.agentSessionId
|
|
2731
|
+
});
|
|
2732
|
+
return handle;
|
|
2733
|
+
}
|
|
2734
|
+
startTurn(input) {
|
|
2735
|
+
const { handle, state } = this.resolveManagerHandle(input.handle);
|
|
2736
|
+
const turnPromise = this.getManager().then((manager) => manager.startTurn({
|
|
2737
|
+
handle,
|
|
2738
|
+
text: input.text,
|
|
2739
|
+
attachments: input.attachments,
|
|
2740
|
+
mode: input.mode,
|
|
2741
|
+
sessionMode: state.mode,
|
|
2742
|
+
requestId: input.requestId,
|
|
2743
|
+
timeoutMs: input.timeoutMs,
|
|
2744
|
+
signal: input.signal,
|
|
2745
|
+
assertActive: input.assertActive,
|
|
2746
|
+
onElicitation: input.onElicitation,
|
|
2747
|
+
onPermissionRequest: input.onPermissionRequest
|
|
2748
|
+
}));
|
|
2749
|
+
turnPromise.catch(() => {});
|
|
2750
|
+
return {
|
|
2751
|
+
requestId: input.requestId,
|
|
2752
|
+
get promptStarted() {
|
|
2753
|
+
return turnPromise.then((turn) => turn.promptStarted);
|
|
2754
|
+
},
|
|
2755
|
+
events: { async *[Symbol.asyncIterator]() {
|
|
2756
|
+
yield* (await turnPromise).events;
|
|
2757
|
+
} },
|
|
2758
|
+
get result() {
|
|
2759
|
+
return turnPromise.then((turn) => turn.result);
|
|
2760
|
+
},
|
|
2761
|
+
cancel(inputArgs) {
|
|
2762
|
+
return turnPromise.then((turn) => turn.cancel(inputArgs));
|
|
2763
|
+
},
|
|
2764
|
+
closeStream(inputArgs) {
|
|
2765
|
+
return turnPromise.then((turn) => turn.closeStream(inputArgs));
|
|
2766
|
+
}
|
|
2767
|
+
};
|
|
2768
|
+
}
|
|
2769
|
+
async *runTurn(input) {
|
|
2770
|
+
const { handle, state } = this.resolveManagerHandle(input.handle);
|
|
2771
|
+
yield* (await this.getManager()).runTurn({
|
|
2772
|
+
handle,
|
|
2773
|
+
text: input.text,
|
|
2774
|
+
attachments: input.attachments,
|
|
2775
|
+
mode: input.mode,
|
|
2776
|
+
sessionMode: state.mode,
|
|
2777
|
+
requestId: input.requestId,
|
|
2778
|
+
timeoutMs: input.timeoutMs,
|
|
2779
|
+
signal: input.signal,
|
|
2780
|
+
assertActive: input.assertActive,
|
|
2781
|
+
onElicitation: input.onElicitation,
|
|
2782
|
+
onPermissionRequest: input.onPermissionRequest
|
|
2783
|
+
});
|
|
2784
|
+
}
|
|
2785
|
+
async getCapabilities(input) {
|
|
2786
|
+
if (!input?.handle) return capabilitiesFromRecord(void 0);
|
|
2787
|
+
const { handle } = this.resolveManagerHandle(input.handle);
|
|
2788
|
+
return capabilitiesFromRecord(await this.options.sessionStore.load(handle.acpxRecordId ?? handle.sessionKey));
|
|
2789
|
+
}
|
|
2790
|
+
async getStatus(input) {
|
|
2791
|
+
const { handle } = this.resolveManagerHandle(input.handle);
|
|
2792
|
+
return await (await this.getManager()).getStatus(handle);
|
|
2793
|
+
}
|
|
2794
|
+
async setMode(input) {
|
|
2795
|
+
const { handle, state } = this.resolveManagerHandle(input.handle);
|
|
2796
|
+
await (await this.getManager()).setMode(handle, input.mode, state.mode, input);
|
|
2797
|
+
}
|
|
2798
|
+
async setModel(input) {
|
|
2799
|
+
const { handle, state } = this.resolveManagerHandle(input.handle);
|
|
2800
|
+
await (await this.getManager()).setModel(handle, input.model, state.mode, input);
|
|
2801
|
+
}
|
|
2802
|
+
async setConfigOption(input) {
|
|
2803
|
+
const { handle, state } = this.resolveManagerHandle(input.handle);
|
|
2804
|
+
return await (await this.getManager()).setConfigOption(handle, input.key, input.value, state.mode, input);
|
|
2805
|
+
}
|
|
2806
|
+
async requestExtension(input) {
|
|
2807
|
+
const { handle, state } = this.resolveManagerHandle(input.handle);
|
|
2808
|
+
return await (await this.getManager()).requestExtension({
|
|
2809
|
+
...input,
|
|
2810
|
+
handle,
|
|
2811
|
+
sessionMode: input.sessionMode ?? state.mode
|
|
2812
|
+
});
|
|
2813
|
+
}
|
|
2814
|
+
async cancel(input) {
|
|
2815
|
+
const { handle } = this.resolveManagerHandle(input.handle);
|
|
2816
|
+
await (await this.getManager()).cancel(handle);
|
|
2817
|
+
}
|
|
2818
|
+
async prepareFreshSession(input) {
|
|
2819
|
+
const { handle } = this.resolveManagerHandle(input.handle);
|
|
2820
|
+
await (await this.getManager()).prepareFreshSession(handle);
|
|
2821
|
+
}
|
|
2822
|
+
async close(input) {
|
|
2823
|
+
const { handle } = this.resolveManagerHandle(input.handle);
|
|
2824
|
+
await (await this.getManager()).close(handle, { discardPersistentState: input.discardPersistentState });
|
|
2825
|
+
}
|
|
2826
|
+
shutdown() {
|
|
2827
|
+
if (!this.shutdownTask) {
|
|
2828
|
+
this.healthy = false;
|
|
2829
|
+
const managerShutdown = this.managerPromise?.then((manager) => manager.shutdown());
|
|
2830
|
+
this.shutdownTask = Promise.allSettled([managerShutdown, ...this.probeTasks]).then(([manager]) => {
|
|
2831
|
+
if (manager.status === "rejected") throw manager.reason;
|
|
2832
|
+
});
|
|
2833
|
+
}
|
|
2834
|
+
return this.shutdownTask;
|
|
2835
|
+
}
|
|
2836
|
+
async getManager() {
|
|
2837
|
+
if (this.shutdownTask) throw new AcpRuntimeError("ACP_BACKEND_UNAVAILABLE", "ACP runtime is shut down.");
|
|
2838
|
+
if (this.manager) return this.manager;
|
|
2839
|
+
if (!this.managerPromise) this.managerPromise = Promise.resolve(this.testOptions?.managerFactory?.(this.options) ?? new AcpRuntimeManager(this.options)).then((manager) => {
|
|
2840
|
+
this.manager = manager;
|
|
2841
|
+
return manager;
|
|
2842
|
+
});
|
|
2843
|
+
return await this.managerPromise;
|
|
2844
|
+
}
|
|
2845
|
+
async runProbe() {
|
|
2846
|
+
if (this.shutdownTask) throw new AcpRuntimeError("ACP_BACKEND_UNAVAILABLE", "ACP runtime is shut down.");
|
|
2847
|
+
const probe = this.testOptions?.probeRunner?.(this.options) ?? this.getManager().then((manager) => manager.probe());
|
|
2848
|
+
this.probeTasks.add(probe);
|
|
2849
|
+
try {
|
|
2850
|
+
const report = await probe;
|
|
2851
|
+
if (this.shutdownTask) throw new AcpRuntimeError("ACP_BACKEND_UNAVAILABLE", "ACP runtime is shut down.");
|
|
2852
|
+
return report;
|
|
2853
|
+
} finally {
|
|
2854
|
+
this.probeTasks.delete(probe);
|
|
2855
|
+
}
|
|
2856
|
+
}
|
|
2857
|
+
resolveManagerHandle(handle) {
|
|
2858
|
+
const state = this.resolveHandleState(handle);
|
|
2859
|
+
return {
|
|
2860
|
+
handle: {
|
|
2861
|
+
...handle,
|
|
2862
|
+
acpxRecordId: state.acpxRecordId ?? handle.acpxRecordId ?? handle.sessionKey
|
|
2863
|
+
},
|
|
2864
|
+
state
|
|
2865
|
+
};
|
|
2866
|
+
}
|
|
2867
|
+
resolveHandleState(handle) {
|
|
2868
|
+
const decoded = decodeAcpxRuntimeHandleState(handle.runtimeSessionName);
|
|
2869
|
+
if (decoded) return {
|
|
2870
|
+
...decoded,
|
|
2871
|
+
acpxRecordId: decoded.acpxRecordId ?? handle.acpxRecordId,
|
|
2872
|
+
backendSessionId: decoded.backendSessionId ?? handle.backendSessionId,
|
|
2873
|
+
agentSessionId: decoded.agentSessionId ?? handle.agentSessionId
|
|
2874
|
+
};
|
|
2875
|
+
const runtimeSessionName = handle.runtimeSessionName.trim();
|
|
2876
|
+
if (!runtimeSessionName) throw new AcpRuntimeError("ACP_SESSION_INIT_FAILED", "Invalid embedded ACP runtime handle: runtimeSessionName is missing.");
|
|
2877
|
+
return {
|
|
2878
|
+
name: runtimeSessionName,
|
|
2879
|
+
agent: deriveAgentFromSessionKey(handle.sessionKey, DEFAULT_AGENT_NAME),
|
|
2880
|
+
cwd: handle.cwd ?? this.options.cwd,
|
|
2881
|
+
mode: "persistent",
|
|
2882
|
+
acpxRecordId: handle.acpxRecordId,
|
|
2883
|
+
backendSessionId: handle.backendSessionId,
|
|
2884
|
+
agentSessionId: handle.agentSessionId
|
|
2885
|
+
};
|
|
2886
|
+
}
|
|
2887
|
+
};
|
|
2888
|
+
function createAcpRuntime(options) {
|
|
2889
|
+
return new AcpxRuntime(options);
|
|
2890
|
+
}
|
|
2891
|
+
function createRuntimeStore(options) {
|
|
2892
|
+
return createFileSessionStore(options);
|
|
2893
|
+
}
|
|
2894
|
+
export { ACPX_BACKEND_ID, AcpRuntimeError, AcpxRuntime, DEFAULT_AGENT_NAME, REQUESTED_MODEL_UNSUPPORTED_ERROR_CODE, REQUESTED_MODEL_UNSUPPORTED_REASONS, RequestedModelUnsupportedError, SharedAcpRuntime, createAcpRuntime, createAgentRegistry, createFileSessionStore, createRuntimeStore, createSharedAcpRuntime, decodeAcpxRuntimeHandleState, encodeAcpxRuntimeHandleState, inspectAgentModels, isAcpRuntimeError, isRequestedModelUnsupportedError };
|
|
2895
|
+
|
|
2896
|
+
//# sourceMappingURL=runtime.js.map
|