@tickernelz/paperclip-pro-adapter-utils 2026.925.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -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/composed-run-characterization.test.d.ts +2 -0
- package/dist/acpx-engine/composed-run-characterization.test.d.ts.map +1 -0
- package/dist/acpx-engine/composed-run-characterization.test.js +739 -0
- package/dist/acpx-engine/composed-run-characterization.test.js.map +1 -0
- package/dist/acpx-engine/constants.d.ts +20 -0
- package/dist/acpx-engine/constants.d.ts.map +1 -0
- package/dist/acpx-engine/constants.js +37 -0
- package/dist/acpx-engine/constants.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 +325 -0
- package/dist/acpx-engine/execute.d.ts.map +1 -0
- package/dist/acpx-engine/execute.js +4448 -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 +6694 -0
- package/dist/acpx-engine/execute.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 +151 -0
- package/dist/acpx-engine/remote-spawn-smoke.test.js.map +1 -0
- package/dist/acpx-engine/run-contracts.d.ts +413 -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 +829 -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 +73 -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 +142 -0
- package/dist/acpx-engine/run-site-sandbox.d.ts.map +1 -0
- package/dist/acpx-engine/run-site-sandbox.js +278 -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 +275 -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 +49 -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-characterization.test.d.ts +2 -0
- package/dist/acpx-engine/settlement-characterization.test.d.ts.map +1 -0
- package/dist/acpx-engine/settlement-characterization.test.js +880 -0
- package/dist/acpx-engine/settlement-characterization.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 +184 -0
- package/dist/acpx-engine/spawn-smoke.test.js.map +1 -0
- package/dist/acpx-engine/startup-cancellation.d.ts +8 -0
- package/dist/acpx-engine/startup-cancellation.d.ts.map +1 -0
- package/dist/acpx-engine/startup-cancellation.js +92 -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-characterization.test.d.ts +2 -0
- package/dist/acpx-engine/startup-characterization.test.d.ts.map +1 -0
- package/dist/acpx-engine/startup-characterization.test.js +742 -0
- package/dist/acpx-engine/startup-characterization.test.js.map +1 -0
- package/dist/acpx-engine/startup-timing.d.ts +419 -0
- package/dist/acpx-engine/startup-timing.d.ts.map +1 -0
- package/dist/acpx-engine/startup-timing.js +616 -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/turn-characterization.test.d.ts +2 -0
- package/dist/acpx-engine/turn-characterization.test.d.ts.map +1 -0
- package/dist/acpx-engine/turn-characterization.test.js +566 -0
- package/dist/acpx-engine/turn-characterization.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/billing.d.ts +2 -0
- package/dist/billing.d.ts.map +1 -0
- package/dist/billing.js +16 -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 +14 -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 +38 -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/command-managed-runtime.d.ts +162 -0
- package/dist/command-managed-runtime.d.ts.map +1 -0
- package/dist/command-managed-runtime.js +456 -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 +908 -0
- package/dist/command-managed-runtime.test.js.map +1 -0
- package/dist/command-redaction.d.ts +15 -0
- package/dist/command-redaction.d.ts.map +1 -0
- package/dist/command-redaction.js +97 -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 +80 -0
- package/dist/command-redaction.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 +4 -0
- package/dist/exclude-patterns.d.ts.map +1 -0
- package/dist/exclude-patterns.js +26 -0
- package/dist/exclude-patterns.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 +6522 -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 +1842 -0
- package/dist/execution-target-stdin-race.test.js.map +1 -0
- package/dist/execution-target.d.ts +537 -0
- package/dist/execution-target.d.ts.map +1 -0
- package/dist/execution-target.js +3877 -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 +346 -0
- package/dist/execution-target.test.js.map +1 -0
- package/dist/git-workspace-sync.d.ts +193 -0
- package/dist/git-workspace-sync.d.ts.map +1 -0
- package/dist/git-workspace-sync.js +786 -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 +830 -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 +285 -0
- package/dist/github-launcher-environment.test.js.map +1 -0
- package/dist/github-launcher.d.ts +8 -0
- package/dist/github-launcher.d.ts.map +1 -0
- package/dist/github-launcher.js +127 -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 +166 -0
- package/dist/github-launcher.test.js.map +1 -0
- package/dist/http2-bridge-server.d.ts +465 -0
- package/dist/http2-bridge-server.d.ts.map +1 -0
- package/dist/http2-bridge-server.js +1087 -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 +2129 -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/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/paperclip-runner-permissions.d.ts +110 -0
- package/dist/paperclip-runner-permissions.d.ts.map +1 -0
- package/dist/paperclip-runner-permissions.js +150 -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 +47 -0
- package/dist/paperclip-runner-permissions.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 +2 -0
- package/dist/remote-execution-env.d.ts.map +1 -0
- package/dist/remote-execution-env.js +46 -0
- package/dist/remote-execution-env.js.map +1 -0
- package/dist/remote-managed-runtime.d.ts +45 -0
- package/dist/remote-managed-runtime.d.ts.map +1 -0
- package/dist/remote-managed-runtime.js +183 -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 +294 -0
- package/dist/remote-managed-runtime.test.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 +268 -0
- package/dist/sandbox-callback-bridge.d.ts.map +1 -0
- package/dist/sandbox-callback-bridge.js +2357 -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 +3253 -0
- package/dist/sandbox-callback-bridge.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-runtime.d.ts +417 -0
- package/dist/sandbox-managed-runtime.d.ts.map +1 -0
- package/dist/sandbox-managed-runtime.js +1337 -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 +3746 -0
- package/dist/sandbox-managed-runtime.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 +617 -0
- package/dist/server-utils.d.ts.map +1 -0
- package/dist/server-utils.js +3258 -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 +3047 -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 +165 -0
- package/dist/session-compaction.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-fixture.test.d.ts +2 -0
- package/dist/ssh-fixture.test.d.ts.map +1 -0
- package/dist/ssh-fixture.test.js +832 -0
- package/dist/ssh-fixture.test.js.map +1 -0
- package/dist/ssh.d.ts +124 -0
- package/dist/ssh.d.ts.map +1 -0
- package/dist/ssh.js +1667 -0
- package/dist/ssh.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-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 +780 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/dist/workspace-restore-merge.d.ts +77 -0
- package/dist/workspace-restore-merge.d.ts.map +1 -0
- package/dist/workspace-restore-merge.js +396 -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 +438 -0
- package/dist/workspace-restore-merge.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 +34 -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 +71 -0
- package/dist/workspace-restore-teardown.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/LICENSE +191 -0
- package/node_modules/@agentclientprotocol/sdk/README.md +70 -0
- package/node_modules/@agentclientprotocol/sdk/dist/acp.d.ts +1803 -0
- package/node_modules/@agentclientprotocol/sdk/dist/acp.js +1869 -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 +5036 -0
- package/node_modules/@agentclientprotocol/sdk/dist/acp.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/connection.d.ts +89 -0
- package/node_modules/@agentclientprotocol/sdk/dist/connection.js +490 -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 +507 -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 +221 -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 +112 -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 +33 -0
- package/node_modules/@agentclientprotocol/sdk/dist/http-stream.js +435 -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 +603 -0
- package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.js +1076 -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 +22 -0
- package/node_modules/@agentclientprotocol/sdk/dist/line-buffer.js +64 -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/node-adapter.d.ts +17 -0
- package/node_modules/@agentclientprotocol/sdk/dist/node-adapter.js +426 -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 +499 -0
- package/node_modules/@agentclientprotocol/sdk/dist/node-adapter.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.d.ts +37 -0
- package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.js +474 -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 +535 -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 +69 -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 +82 -0
- package/node_modules/@agentclientprotocol/sdk/dist/protocol.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/guards.gen.d.ts +183 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/guards.gen.js +207 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/guards.gen.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/index.d.ts +51 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/index.js +52 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/index.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/types.gen.d.ts +6219 -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 +15215 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/zod.gen.js +3084 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/zod.gen.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.d.ts +30 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.js +98 -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 +2 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-sse.js +88 -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 +53 -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 +992 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-websocket-upgrade.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server.d.ts +81 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server.js +386 -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 +1116 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/sse.d.ts +4 -0
- package/node_modules/@agentclientprotocol/sdk/dist/sse.js +91 -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.d.ts +35 -0
- package/node_modules/@agentclientprotocol/sdk/dist/stream.js +115 -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/v2/acp.d.ts +957 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.js +1484 -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 +1287 -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 +946 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/guards.gen.js +1046 -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 +42 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/index.js +43 -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 +6208 -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 +33267 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/zod.gen.js +3199 -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 +357 -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 +13 -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 +104 -0
- package/node_modules/@agentclientprotocol/sdk/schema/schema.json +8967 -0
- package/node_modules/@agentclientprotocol/sdk/schema/v2/schema.unstable.json +10242 -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 +503 -0
- package/node_modules/@clack/core/dist/index.mjs +1003 -0
- package/node_modules/@clack/core/package.json +63 -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 +949 -0
- package/node_modules/@clack/prompts/dist/index.mjs +1423 -0
- package/node_modules/@clack/prompts/package.json +67 -0
- package/node_modules/@esbuild/linux-x64/README.md +3 -0
- package/node_modules/@esbuild/linux-x64/bin/esbuild +0 -0
- package/node_modules/@esbuild/linux-x64/package.json +20 -0
- package/node_modules/acpx/LICENSE +21 -0
- package/node_modules/acpx/README.md +424 -0
- package/node_modules/acpx/dist/cli-CxsS1XQp.js +197 -0
- package/node_modules/acpx/dist/cli-CxsS1XQp.js.map +1 -0
- package/node_modules/acpx/dist/cli.d.ts +14 -0
- package/node_modules/acpx/dist/cli.d.ts.map +1 -0
- package/node_modules/acpx/dist/cli.js +2683 -0
- package/node_modules/acpx/dist/cli.js.map +1 -0
- package/node_modules/acpx/dist/client-DwNyFauq.d.ts +192 -0
- package/node_modules/acpx/dist/client-DwNyFauq.d.ts.map +1 -0
- package/node_modules/acpx/dist/flags-Bjq_XQ4-.js +260 -0
- package/node_modules/acpx/dist/flags-Bjq_XQ4-.js.map +1 -0
- package/node_modules/acpx/dist/flows-Db_LZKu9.js +1920 -0
- package/node_modules/acpx/dist/flows-Db_LZKu9.js.map +1 -0
- package/node_modules/acpx/dist/flows.d.ts +318 -0
- package/node_modules/acpx/dist/flows.d.ts.map +1 -0
- package/node_modules/acpx/dist/flows.js +2 -0
- package/node_modules/acpx/dist/live-checkpoint-ClPCSdrW.js +6210 -0
- package/node_modules/acpx/dist/live-checkpoint-ClPCSdrW.js.map +1 -0
- package/node_modules/acpx/dist/output-CjdF5rHk.js +4593 -0
- package/node_modules/acpx/dist/output-CjdF5rHk.js.map +1 -0
- package/node_modules/acpx/dist/runtime.d.ts +472 -0
- package/node_modules/acpx/dist/runtime.d.ts.map +1 -0
- package/node_modules/acpx/dist/runtime.js +1711 -0
- package/node_modules/acpx/dist/runtime.js.map +1 -0
- package/node_modules/acpx/dist/session-options-jkYbBxGE.d.ts +278 -0
- package/node_modules/acpx/dist/session-options-jkYbBxGE.d.ts.map +1 -0
- package/node_modules/acpx/package.json +129 -0
- package/node_modules/acpx/skills/acpx/SKILL.md +617 -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-events/LICENSE +201 -0
- package/node_modules/bare-events/README.md +25 -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 +89 -0
- package/node_modules/bare-events/index.js +397 -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 +79 -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 +2913 -0
- package/node_modules/bare-fs/binding.js +1 -0
- package/node_modules/bare-fs/index.d.ts +1502 -0
- package/node_modules/bare-fs/index.js +2855 -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/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 +19 -0
- package/node_modules/bare-path/binding.c +106 -0
- package/node_modules/bare-path/binding.js +1 -0
- package/node_modules/bare-path/index.d.ts +27 -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 +33 -0
- package/node_modules/bare-url/binding.c +422 -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 +96 -0
- package/node_modules/bare-url/index.js +676 -0
- package/node_modules/bare-url/lib/errors.d.ts +10 -0
- package/node_modules/bare-url/lib/errors.js +33 -0
- package/node_modules/bare-url/lib/url-search-params.d.ts +66 -0
- package/node_modules/bare-url/lib/url-search-params.js +276 -0
- package/node_modules/bare-url/package.json +54 -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 +1172 -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 +2790 -0
- package/node_modules/commander/lib/error.js +36 -0
- package/node_modules/commander/lib/help.js +731 -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 +64 -0
- package/node_modules/commander/typings/index.d.ts +1113 -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/sisteransi/license +21 -0
- package/node_modules/sisteransi/package.json +34 -0
- package/node_modules/sisteransi/readme.md +113 -0
- package/node_modules/sisteransi/src/index.js +58 -0
- package/node_modules/sisteransi/src/sisteransi.d.ts +35 -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/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 +418 -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/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 +264 -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 +342 -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 +190 -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 +2313 -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 +5192 -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 +1280 -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 +1908 -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 +1858 -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 +2669 -0
- package/node_modules/zod/v4/core/schemas.d.cts +1273 -0
- package/node_modules/zod/v4/core/schemas.d.ts +1273 -0
- package/node_modules/zod/v4/core/schemas.js +2606 -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 +949 -0
- package/node_modules/zod/v4/core/util.d.cts +278 -0
- package/node_modules/zod/v4/core/util.d.ts +278 -0
- package/node_modules/zod/v4/core/util.js +859 -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 +50 -0
|
@@ -0,0 +1,1711 @@
|
|
|
1
|
+
import { A as REQUESTED_MODEL_UNSUPPORTED_ERROR_CODE, At as listBuiltInAgents, D as applyLifecycleSnapshotToRecord, E as applyConversation, F as modelStateFromConfigOptions, It as normalizeOutputError, Lt as extractAcpError, M as RequestedModelUnsupportedError, Mt as resolveAgentCommand, O as reconcileAgentSessionId, Ot as withTimeout, P as isRequestedModelUnsupportedError, Rt as isAcpResourceNotFoundError, S as advertisedModelState, T as sessionOptionsFromRecord, Z as assertPersistedKeyPolicy, _ as createSessionConversation, a as applyRequestedModelIfAdvertised, b as recordSessionUpdate, c as setCurrentModelId, d as setDesiredModelId, f as syncAdvertisedModelState, g as cloneSessionConversation, h as cloneSessionAcpxState, i as connectAndLoadSession, j as REQUESTED_MODEL_UNSUPPORTED_REASONS, k as AcpClient, kt as DEFAULT_AGENT_NAME, l as setDesiredConfigOption, m as applyConfigOptionsToState, n as runPromptTurn, o as currentModelIdFromSetModelResponse, ot as parseSessionRecord, p as applyConfigOptionsToRecord, r as withConnectedSession, s as clearDesiredConfigOption, st as serializeSessionRecordForDisk, t as LiveSessionCheckpoint, u as setDesiredModeId, ut as defaultSessionEventLog, v as recordClientOperation, w as persistSessionOptions, wt as textPrompt, x as trimConversationForRuntime, y as recordPromptSubmission } from "./live-checkpoint-ClPCSdrW.js";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import fs from "node:fs/promises";
|
|
4
|
+
import { randomUUID } from "node:crypto";
|
|
5
|
+
//#region src/runtime/public/errors.ts
|
|
6
|
+
var AcpRuntimeError = class extends Error {
|
|
7
|
+
code;
|
|
8
|
+
cause;
|
|
9
|
+
constructor(code, message, options) {
|
|
10
|
+
super(message);
|
|
11
|
+
this.name = "AcpRuntimeError";
|
|
12
|
+
this.code = code;
|
|
13
|
+
this.cause = options?.cause;
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
function isAcpRuntimeError(value) {
|
|
17
|
+
return value instanceof AcpRuntimeError;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/runtime/public/shared.ts
|
|
21
|
+
function isRecord(value) {
|
|
22
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
23
|
+
}
|
|
24
|
+
function asTrimmedString(value) {
|
|
25
|
+
return typeof value === "string" ? value.trim() : "";
|
|
26
|
+
}
|
|
27
|
+
function asString(value) {
|
|
28
|
+
return typeof value === "string" ? value : void 0;
|
|
29
|
+
}
|
|
30
|
+
function asOptionalString(value) {
|
|
31
|
+
return asTrimmedString(value) || void 0;
|
|
32
|
+
}
|
|
33
|
+
function deriveAgentFromSessionKey(sessionKey, fallbackAgent) {
|
|
34
|
+
const match = sessionKey.match(/^agent:([^:]+):/i);
|
|
35
|
+
return (match?.[1] ? asTrimmedString(match[1]) : "") || fallbackAgent;
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region src/runtime/public/events.ts
|
|
39
|
+
const TOOL_OUTPUT_SUMMARY_MAX_CHARS = 500;
|
|
40
|
+
function safeParseJsonObject(line) {
|
|
41
|
+
try {
|
|
42
|
+
const parsed = JSON.parse(line);
|
|
43
|
+
return isRecord(parsed) ? parsed : null;
|
|
44
|
+
} catch {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function asOptionalFiniteNumber(value) {
|
|
49
|
+
return typeof value === "number" && Number.isFinite(value) ? value : void 0;
|
|
50
|
+
}
|
|
51
|
+
function resolveStructuredPromptPayload(parsed) {
|
|
52
|
+
if (asTrimmedString(parsed.method) === "session/update") {
|
|
53
|
+
const params = parsed.params;
|
|
54
|
+
if (isRecord(params) && isRecord(params.update)) {
|
|
55
|
+
const update = params.update;
|
|
56
|
+
const tag = asOptionalString(update.sessionUpdate);
|
|
57
|
+
return {
|
|
58
|
+
type: tag ?? "",
|
|
59
|
+
payload: update,
|
|
60
|
+
...tag ? { tag } : {}
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
const sessionUpdate = asOptionalString(parsed.sessionUpdate);
|
|
65
|
+
if (sessionUpdate) return {
|
|
66
|
+
type: sessionUpdate,
|
|
67
|
+
payload: parsed,
|
|
68
|
+
tag: sessionUpdate
|
|
69
|
+
};
|
|
70
|
+
const type = asTrimmedString(parsed.type);
|
|
71
|
+
const tag = asOptionalString(parsed.tag);
|
|
72
|
+
return {
|
|
73
|
+
type,
|
|
74
|
+
payload: parsed,
|
|
75
|
+
...tag ? { tag } : {}
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
function resolveStatusTextForTag(params) {
|
|
79
|
+
const resolver = STATUS_TEXT_RESOLVERS[params.tag];
|
|
80
|
+
return resolver ? resolver(params.payload) : null;
|
|
81
|
+
}
|
|
82
|
+
const STATUS_TEXT_RESOLVERS = {
|
|
83
|
+
available_commands_update: availableCommandsStatusText,
|
|
84
|
+
current_mode_update: currentModeStatusText,
|
|
85
|
+
config_option_update: configOptionStatusText,
|
|
86
|
+
session_info_update: sessionInfoStatusText,
|
|
87
|
+
plan: planStatusText
|
|
88
|
+
};
|
|
89
|
+
function availableCommandsStatusText(payload) {
|
|
90
|
+
const commands = Array.isArray(payload.availableCommands) ? payload.availableCommands : [];
|
|
91
|
+
return commands.length > 0 ? `available commands updated (${commands.length})` : "available commands updated";
|
|
92
|
+
}
|
|
93
|
+
function currentModeStatusText(payload) {
|
|
94
|
+
const mode = asTrimmedString(payload.currentModeId) || asTrimmedString(payload.modeId) || asTrimmedString(payload.mode);
|
|
95
|
+
return mode ? `mode updated: ${mode}` : "mode updated";
|
|
96
|
+
}
|
|
97
|
+
function configOptionStatusText(payload) {
|
|
98
|
+
const id = asTrimmedString(payload.id) || asTrimmedString(payload.configOptionId);
|
|
99
|
+
const value = asTrimmedString(payload.currentValue) || asTrimmedString(payload.value) || asTrimmedString(payload.optionValue);
|
|
100
|
+
if (id && value) return `config updated: ${id}=${value}`;
|
|
101
|
+
return id ? `config updated: ${id}` : "config updated";
|
|
102
|
+
}
|
|
103
|
+
function sessionInfoStatusText(payload) {
|
|
104
|
+
return asTrimmedString(payload.summary) || asTrimmedString(payload.message) || "session updated";
|
|
105
|
+
}
|
|
106
|
+
function planStatusText(payload) {
|
|
107
|
+
const content = asTrimmedString((Array.isArray(payload.entries) ? payload.entries : []).find((entry) => isRecord(entry))?.content);
|
|
108
|
+
return content ? `plan: ${content}` : null;
|
|
109
|
+
}
|
|
110
|
+
function resolveTextChunk(params) {
|
|
111
|
+
const contentRaw = params.payload.content;
|
|
112
|
+
if (isRecord(contentRaw)) {
|
|
113
|
+
const contentType = asTrimmedString(contentRaw.type);
|
|
114
|
+
if (contentType && contentType !== "text") return null;
|
|
115
|
+
const text = asString(contentRaw.text);
|
|
116
|
+
if (text && text.length > 0) return {
|
|
117
|
+
type: "text_delta",
|
|
118
|
+
text,
|
|
119
|
+
stream: params.stream,
|
|
120
|
+
tag: params.tag
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
const text = asString(params.payload.text);
|
|
124
|
+
if (!text || text.length === 0) return null;
|
|
125
|
+
return {
|
|
126
|
+
type: "text_delta",
|
|
127
|
+
text,
|
|
128
|
+
stream: params.stream,
|
|
129
|
+
tag: params.tag
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
function createTextDeltaEvent(params) {
|
|
133
|
+
if (params.content == null || params.content.length === 0) return null;
|
|
134
|
+
return {
|
|
135
|
+
type: "text_delta",
|
|
136
|
+
text: params.content,
|
|
137
|
+
stream: params.stream,
|
|
138
|
+
...params.tag ? { tag: params.tag } : {}
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
function readFirstString(record, keys) {
|
|
142
|
+
for (const key of keys) {
|
|
143
|
+
const value = asOptionalString(record[key]);
|
|
144
|
+
if (value) return value;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
function readFirstStringArray(record, keys) {
|
|
148
|
+
for (const key of keys) {
|
|
149
|
+
const value = record[key];
|
|
150
|
+
if (!Array.isArray(value)) continue;
|
|
151
|
+
const entries = value.map((entry) => asOptionalString(entry)).filter((entry) => entry !== void 0);
|
|
152
|
+
if (entries.length > 0) return entries;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
function summarizeToolInput(rawInput) {
|
|
156
|
+
if (rawInput == null) return;
|
|
157
|
+
if (typeof rawInput === "string" || typeof rawInput === "number" || typeof rawInput === "boolean") return String(rawInput);
|
|
158
|
+
if (!isRecord(rawInput)) return;
|
|
159
|
+
const command = readFirstString(rawInput, [
|
|
160
|
+
"command",
|
|
161
|
+
"cmd",
|
|
162
|
+
"program"
|
|
163
|
+
]);
|
|
164
|
+
const args = readFirstStringArray(rawInput, ["args", "arguments"]);
|
|
165
|
+
if (command) return [command, ...args ?? []].join(" ");
|
|
166
|
+
return readFirstString(rawInput, [
|
|
167
|
+
"path",
|
|
168
|
+
"file",
|
|
169
|
+
"filePath",
|
|
170
|
+
"filepath",
|
|
171
|
+
"target",
|
|
172
|
+
"uri",
|
|
173
|
+
"url",
|
|
174
|
+
"query",
|
|
175
|
+
"pattern",
|
|
176
|
+
"text",
|
|
177
|
+
"search"
|
|
178
|
+
]);
|
|
179
|
+
}
|
|
180
|
+
function truncateToolSummary(value) {
|
|
181
|
+
if (value.length <= TOOL_OUTPUT_SUMMARY_MAX_CHARS) return value;
|
|
182
|
+
return `${value.slice(0, TOOL_OUTPUT_SUMMARY_MAX_CHARS - 1)}…`;
|
|
183
|
+
}
|
|
184
|
+
function readToolContentText(value) {
|
|
185
|
+
const record = isRecord(value) ? value : void 0;
|
|
186
|
+
if (!record) return;
|
|
187
|
+
if (record.type === "content") return readToolContentText(record.content);
|
|
188
|
+
return toolContentTextReader(String(record.type))?.(record);
|
|
189
|
+
}
|
|
190
|
+
const TOOL_CONTENT_TEXT_READERS = {
|
|
191
|
+
text: (record) => asString(record.text),
|
|
192
|
+
audio: (record) => `[audio] ${asOptionalString(record.mimeType) || "audio"}`,
|
|
193
|
+
resource_link: (record) => asOptionalString(record.title) || asOptionalString(record.name) || asOptionalString(record.uri),
|
|
194
|
+
resource: (record) => {
|
|
195
|
+
const resource = isRecord(record.resource) ? record.resource : void 0;
|
|
196
|
+
return asString(resource?.text) || asOptionalString(resource?.uri);
|
|
197
|
+
},
|
|
198
|
+
diff: (record) => `diff ${asOptionalString(record.path) || "file"}`,
|
|
199
|
+
terminal: (record) => {
|
|
200
|
+
const terminalId = asOptionalString(record.terminalId) || asOptionalString(record.id);
|
|
201
|
+
return terminalId ? `[terminal] ${terminalId}` : "[terminal]";
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
function toolContentTextReader(type) {
|
|
205
|
+
return Object.hasOwn(TOOL_CONTENT_TEXT_READERS, type) ? TOOL_CONTENT_TEXT_READERS[type] : void 0;
|
|
206
|
+
}
|
|
207
|
+
function summarizeToolContent(content) {
|
|
208
|
+
if (!Array.isArray(content)) return;
|
|
209
|
+
const fragments = content.map((entry) => readToolContentText(entry)?.trim()).filter((entry) => Boolean(entry));
|
|
210
|
+
if (fragments.length === 0) return;
|
|
211
|
+
return truncateToolSummary([...new Set(fragments)].join("\n"));
|
|
212
|
+
}
|
|
213
|
+
function summarizeToolOutput(rawOutput) {
|
|
214
|
+
if (rawOutput == null) return;
|
|
215
|
+
if (isScalarToolOutput(rawOutput)) return truncateToolSummary(String(rawOutput));
|
|
216
|
+
const record = isRecord(rawOutput) ? rawOutput : void 0;
|
|
217
|
+
if (!record) return;
|
|
218
|
+
return truncateToolSummary(readFirstString(record, [
|
|
219
|
+
"text",
|
|
220
|
+
"message",
|
|
221
|
+
"error",
|
|
222
|
+
"stdout",
|
|
223
|
+
"stderr",
|
|
224
|
+
"content"
|
|
225
|
+
]) ?? "") || void 0;
|
|
226
|
+
}
|
|
227
|
+
function isScalarToolOutput(value) {
|
|
228
|
+
return typeof value === "string" || typeof value === "number" || typeof value === "boolean";
|
|
229
|
+
}
|
|
230
|
+
function shouldForwardArray(value) {
|
|
231
|
+
return Array.isArray(value);
|
|
232
|
+
}
|
|
233
|
+
function readToolKind(value) {
|
|
234
|
+
const kind = asOptionalString(value);
|
|
235
|
+
return kind && TOOL_KINDS.has(kind) ? kind : void 0;
|
|
236
|
+
}
|
|
237
|
+
const TOOL_KINDS = /* @__PURE__ */ new Set([
|
|
238
|
+
"read",
|
|
239
|
+
"edit",
|
|
240
|
+
"delete",
|
|
241
|
+
"move",
|
|
242
|
+
"search",
|
|
243
|
+
"execute",
|
|
244
|
+
"fetch",
|
|
245
|
+
"think",
|
|
246
|
+
"other"
|
|
247
|
+
]);
|
|
248
|
+
function createToolCallEvent(params) {
|
|
249
|
+
const title = asTrimmedString(params.payload.title) || "tool call";
|
|
250
|
+
const status = asTrimmedString(params.payload.status);
|
|
251
|
+
const inputSummary = summarizeToolInput(params.payload.rawInput);
|
|
252
|
+
const outputSummary = summarizeToolContent(params.payload.content) ?? summarizeToolOutput(params.payload.rawOutput);
|
|
253
|
+
const toolCallId = asOptionalString(params.payload.toolCallId);
|
|
254
|
+
const kind = readToolKind(params.payload.kind);
|
|
255
|
+
const summaryText = status ? `${title} (${status})` : title;
|
|
256
|
+
const detailSummary = params.tag === "tool_call_update" ? outputSummary ?? inputSummary : inputSummary ?? outputSummary;
|
|
257
|
+
const event = {
|
|
258
|
+
type: "tool_call",
|
|
259
|
+
text: detailSummary ? `${summaryText}: ${detailSummary}` : summaryText,
|
|
260
|
+
tag: params.tag,
|
|
261
|
+
title
|
|
262
|
+
};
|
|
263
|
+
assignToolCallEventMetadata(event, params.payload, {
|
|
264
|
+
toolCallId,
|
|
265
|
+
status,
|
|
266
|
+
kind
|
|
267
|
+
});
|
|
268
|
+
return event;
|
|
269
|
+
}
|
|
270
|
+
function assignToolCallEventMetadata(event, payload, values) {
|
|
271
|
+
if (event.type !== "tool_call") return;
|
|
272
|
+
if (values.toolCallId) event.toolCallId = values.toolCallId;
|
|
273
|
+
if (values.status) event.status = values.status;
|
|
274
|
+
if (values.kind) event.kind = values.kind;
|
|
275
|
+
assignForwardedToolPayload(event, payload);
|
|
276
|
+
}
|
|
277
|
+
function assignForwardedToolPayload(event, payload) {
|
|
278
|
+
if (shouldForwardArray(payload.locations)) event.locations = payload.locations;
|
|
279
|
+
if (Object.prototype.hasOwnProperty.call(payload, "rawInput")) event.rawInput = payload.rawInput;
|
|
280
|
+
if (Object.prototype.hasOwnProperty.call(payload, "rawOutput")) event.rawOutput = payload.rawOutput;
|
|
281
|
+
if (shouldForwardArray(payload.content)) event.content = payload.content;
|
|
282
|
+
}
|
|
283
|
+
function parsePromptEventLine(line) {
|
|
284
|
+
const trimmed = line.trim();
|
|
285
|
+
if (!trimmed) return null;
|
|
286
|
+
const parsed = safeParseJsonObject(trimmed);
|
|
287
|
+
if (!parsed) return {
|
|
288
|
+
type: "status",
|
|
289
|
+
text: trimmed
|
|
290
|
+
};
|
|
291
|
+
const structured = resolveStructuredPromptPayload(parsed);
|
|
292
|
+
const type = structured.type;
|
|
293
|
+
const payload = structured.payload;
|
|
294
|
+
const tag = structured.tag;
|
|
295
|
+
const parser = promptEventParser(type);
|
|
296
|
+
return parser ? parser(payload, tag) : null;
|
|
297
|
+
}
|
|
298
|
+
const PROMPT_EVENT_PARSERS = {
|
|
299
|
+
text: (payload, tag) => createTextDeltaEvent({
|
|
300
|
+
content: asString(payload.content),
|
|
301
|
+
stream: "output",
|
|
302
|
+
tag
|
|
303
|
+
}),
|
|
304
|
+
thought: (payload, tag) => createTextDeltaEvent({
|
|
305
|
+
content: asString(payload.content),
|
|
306
|
+
stream: "thought",
|
|
307
|
+
tag
|
|
308
|
+
}),
|
|
309
|
+
tool_call: (payload, tag) => createToolCallEvent({
|
|
310
|
+
payload,
|
|
311
|
+
tag: tag ?? "tool_call"
|
|
312
|
+
}),
|
|
313
|
+
tool_call_update: (payload, tag) => createToolCallEvent({
|
|
314
|
+
payload,
|
|
315
|
+
tag: tag ?? "tool_call_update"
|
|
316
|
+
}),
|
|
317
|
+
agent_message_chunk: (payload) => resolveTextChunk({
|
|
318
|
+
payload,
|
|
319
|
+
stream: "output",
|
|
320
|
+
tag: "agent_message_chunk"
|
|
321
|
+
}),
|
|
322
|
+
agent_thought_chunk: (payload) => resolveTextChunk({
|
|
323
|
+
payload,
|
|
324
|
+
stream: "thought",
|
|
325
|
+
tag: "agent_thought_chunk"
|
|
326
|
+
}),
|
|
327
|
+
usage_update: usageUpdateEvent,
|
|
328
|
+
available_commands_update: availableCommandsUpdateEvent,
|
|
329
|
+
current_mode_update: (payload) => statusUpdateEvent("current_mode_update", payload),
|
|
330
|
+
config_option_update: (payload) => statusUpdateEvent("config_option_update", payload),
|
|
331
|
+
session_info_update: (payload) => statusUpdateEvent("session_info_update", payload),
|
|
332
|
+
plan: (payload) => statusUpdateEvent("plan", payload),
|
|
333
|
+
client_operation: clientOperationEvent,
|
|
334
|
+
update: updateStatusEvent,
|
|
335
|
+
done: () => null,
|
|
336
|
+
error: () => null
|
|
337
|
+
};
|
|
338
|
+
function promptEventParser(type) {
|
|
339
|
+
return Object.hasOwn(PROMPT_EVENT_PARSERS, type) ? PROMPT_EVENT_PARSERS[type] : void 0;
|
|
340
|
+
}
|
|
341
|
+
function usageUpdateEvent(payload) {
|
|
342
|
+
const used = asOptionalFiniteNumber(payload.used);
|
|
343
|
+
const size = asOptionalFiniteNumber(payload.size);
|
|
344
|
+
const meta = isRecord(payload._meta) ? payload._meta : void 0;
|
|
345
|
+
return buildUsageUpdateEvent({
|
|
346
|
+
used,
|
|
347
|
+
size,
|
|
348
|
+
cost: normalizeUsageCost(payload.cost),
|
|
349
|
+
breakdown: normalizeUsageBreakdown(meta?.usage)
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
function buildUsageUpdateEvent(parts) {
|
|
353
|
+
const { used, size, cost, breakdown } = parts;
|
|
354
|
+
return {
|
|
355
|
+
type: "status",
|
|
356
|
+
text: used != null && size != null ? `usage updated: ${used}/${size}` : "usage updated",
|
|
357
|
+
tag: "usage_update",
|
|
358
|
+
...used != null ? { used } : {},
|
|
359
|
+
...size != null ? { size } : {},
|
|
360
|
+
...cost ? { cost } : {},
|
|
361
|
+
...breakdown ? { breakdown } : {}
|
|
362
|
+
};
|
|
363
|
+
}
|
|
364
|
+
function availableCommandsUpdateEvent(payload) {
|
|
365
|
+
const raw = Array.isArray(payload.availableCommands) ? payload.availableCommands : [];
|
|
366
|
+
const availableCommands = [];
|
|
367
|
+
for (const entry of raw) {
|
|
368
|
+
if (!isRecord(entry)) continue;
|
|
369
|
+
const name = asTrimmedString(entry.name);
|
|
370
|
+
if (!name) continue;
|
|
371
|
+
const description = asTrimmedString(entry.description);
|
|
372
|
+
availableCommands.push({
|
|
373
|
+
name,
|
|
374
|
+
...description ? { description } : {},
|
|
375
|
+
hasInput: entry.input != null
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
return {
|
|
379
|
+
type: "status",
|
|
380
|
+
text: availableCommands.length > 0 ? `available commands updated (${availableCommands.length})` : "available commands updated",
|
|
381
|
+
tag: "available_commands_update",
|
|
382
|
+
availableCommands
|
|
383
|
+
};
|
|
384
|
+
}
|
|
385
|
+
function normalizeUsageCost(value) {
|
|
386
|
+
if (!isRecord(value)) return;
|
|
387
|
+
const amount = asOptionalFiniteNumber(value.amount);
|
|
388
|
+
const currency = asTrimmedString(value.currency);
|
|
389
|
+
if (amount == null && !currency) return;
|
|
390
|
+
return {
|
|
391
|
+
...amount != null ? { amount } : {},
|
|
392
|
+
...currency ? { currency } : {}
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
const USAGE_BREAKDOWN_FIELDS = [
|
|
396
|
+
["inputTokens", ["inputTokens", "input_tokens"]],
|
|
397
|
+
["outputTokens", ["outputTokens", "output_tokens"]],
|
|
398
|
+
["cachedReadTokens", [
|
|
399
|
+
"cachedReadTokens",
|
|
400
|
+
"cacheReadInputTokens",
|
|
401
|
+
"cache_read_input_tokens"
|
|
402
|
+
]],
|
|
403
|
+
["cachedWriteTokens", [
|
|
404
|
+
"cachedWriteTokens",
|
|
405
|
+
"cacheCreationInputTokens",
|
|
406
|
+
"cache_creation_input_tokens"
|
|
407
|
+
]],
|
|
408
|
+
["thoughtTokens", ["thoughtTokens", "thought_tokens"]],
|
|
409
|
+
["totalTokens", ["totalTokens", "total_tokens"]]
|
|
410
|
+
];
|
|
411
|
+
function normalizeUsageBreakdown(value) {
|
|
412
|
+
if (!isRecord(value)) return;
|
|
413
|
+
const breakdown = {};
|
|
414
|
+
for (const [key, aliases] of USAGE_BREAKDOWN_FIELDS) {
|
|
415
|
+
const v = firstFiniteNumber(value, aliases);
|
|
416
|
+
if (v != null) breakdown[key] = v;
|
|
417
|
+
}
|
|
418
|
+
return Object.keys(breakdown).length > 0 ? breakdown : void 0;
|
|
419
|
+
}
|
|
420
|
+
function firstFiniteNumber(record, keys) {
|
|
421
|
+
for (const key of keys) {
|
|
422
|
+
const value = asOptionalFiniteNumber(record[key]);
|
|
423
|
+
if (value != null) return value;
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
function statusUpdateEvent(tag, payload) {
|
|
427
|
+
const text = resolveStatusTextForTag({
|
|
428
|
+
tag,
|
|
429
|
+
payload
|
|
430
|
+
});
|
|
431
|
+
if (!text) return null;
|
|
432
|
+
return {
|
|
433
|
+
type: "status",
|
|
434
|
+
text,
|
|
435
|
+
tag
|
|
436
|
+
};
|
|
437
|
+
}
|
|
438
|
+
function clientOperationEvent(payload, tag) {
|
|
439
|
+
const text = [
|
|
440
|
+
asTrimmedString(payload.method) || "operation",
|
|
441
|
+
asTrimmedString(payload.status),
|
|
442
|
+
asTrimmedString(payload.summary)
|
|
443
|
+
].filter(Boolean).join(" ");
|
|
444
|
+
return text ? {
|
|
445
|
+
type: "status",
|
|
446
|
+
text,
|
|
447
|
+
...tag ? { tag } : {}
|
|
448
|
+
} : null;
|
|
449
|
+
}
|
|
450
|
+
function updateStatusEvent(payload, tag) {
|
|
451
|
+
const update = asTrimmedString(payload.update);
|
|
452
|
+
return update ? {
|
|
453
|
+
type: "status",
|
|
454
|
+
text: update,
|
|
455
|
+
...tag ? { tag } : {}
|
|
456
|
+
} : null;
|
|
457
|
+
}
|
|
458
|
+
//#endregion
|
|
459
|
+
//#region src/runtime/engine/reuse-policy.ts
|
|
460
|
+
function shouldReuseExistingRecord(record, params) {
|
|
461
|
+
if (record.acpx?.reset_on_next_ensure === true) return false;
|
|
462
|
+
if (path.resolve(record.cwd) !== path.resolve(params.cwd)) return false;
|
|
463
|
+
if (record.agentCommand !== params.agentCommand) return false;
|
|
464
|
+
if (params.resumeSessionId && record.acpSessionId !== params.resumeSessionId) return false;
|
|
465
|
+
return true;
|
|
466
|
+
}
|
|
467
|
+
//#endregion
|
|
468
|
+
//#region src/runtime/engine/manager.ts
|
|
469
|
+
function createDeferred() {
|
|
470
|
+
let resolve;
|
|
471
|
+
let reject;
|
|
472
|
+
return {
|
|
473
|
+
promise: new Promise((res, rej) => {
|
|
474
|
+
resolve = res;
|
|
475
|
+
reject = rej;
|
|
476
|
+
}),
|
|
477
|
+
resolve,
|
|
478
|
+
reject
|
|
479
|
+
};
|
|
480
|
+
}
|
|
481
|
+
var AsyncEventQueue = class {
|
|
482
|
+
items = [];
|
|
483
|
+
waits = [];
|
|
484
|
+
closed = false;
|
|
485
|
+
push(item) {
|
|
486
|
+
if (this.closed) return;
|
|
487
|
+
const waiter = this.waits.shift();
|
|
488
|
+
if (waiter) {
|
|
489
|
+
waiter.resolve(item);
|
|
490
|
+
return;
|
|
491
|
+
}
|
|
492
|
+
this.items.push(item);
|
|
493
|
+
}
|
|
494
|
+
close() {
|
|
495
|
+
if (this.closed) return;
|
|
496
|
+
this.closed = true;
|
|
497
|
+
for (const waiter of this.waits.splice(0)) waiter.resolve(null);
|
|
498
|
+
}
|
|
499
|
+
clear() {
|
|
500
|
+
this.items.length = 0;
|
|
501
|
+
}
|
|
502
|
+
async next() {
|
|
503
|
+
if (this.items.length > 0) return this.items.shift() ?? null;
|
|
504
|
+
if (this.closed) return null;
|
|
505
|
+
const waiter = createDeferred();
|
|
506
|
+
this.waits.push(waiter);
|
|
507
|
+
return await waiter.promise;
|
|
508
|
+
}
|
|
509
|
+
async *iterate() {
|
|
510
|
+
while (true) {
|
|
511
|
+
const next = await this.next();
|
|
512
|
+
if (!next) return;
|
|
513
|
+
yield next;
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
};
|
|
517
|
+
function isoNow() {
|
|
518
|
+
return (/* @__PURE__ */ new Date()).toISOString();
|
|
519
|
+
}
|
|
520
|
+
function isUnsupportedSessionCloseError(error) {
|
|
521
|
+
const acp = extractAcpError(error);
|
|
522
|
+
if (!acp) return false;
|
|
523
|
+
if (acp.code === -32601 || acp.code === -32602) return true;
|
|
524
|
+
if (acp.code !== -32603 || !acp.data || typeof acp.data !== "object") return false;
|
|
525
|
+
const details = acp.data.details;
|
|
526
|
+
return typeof details === "string" && details.toLowerCase().includes("invalid params");
|
|
527
|
+
}
|
|
528
|
+
function toPromptInput(text, attachments) {
|
|
529
|
+
if (!attachments || attachments.length === 0) return text;
|
|
530
|
+
const blocks = [];
|
|
531
|
+
if (text) blocks.push({
|
|
532
|
+
type: "text",
|
|
533
|
+
text
|
|
534
|
+
});
|
|
535
|
+
for (const attachment of attachments) {
|
|
536
|
+
if (attachment.mediaType.startsWith("image/")) {
|
|
537
|
+
blocks.push({
|
|
538
|
+
type: "image",
|
|
539
|
+
mimeType: attachment.mediaType,
|
|
540
|
+
data: attachment.data
|
|
541
|
+
});
|
|
542
|
+
continue;
|
|
543
|
+
}
|
|
544
|
+
if (attachment.mediaType.startsWith("audio/")) {
|
|
545
|
+
blocks.push({
|
|
546
|
+
type: "audio",
|
|
547
|
+
mimeType: attachment.mediaType,
|
|
548
|
+
data: attachment.data
|
|
549
|
+
});
|
|
550
|
+
continue;
|
|
551
|
+
}
|
|
552
|
+
throw new AcpRuntimeError("ACP_TURN_FAILED", `Unsupported ACP runtime attachment media type: ${attachment.mediaType}`);
|
|
553
|
+
}
|
|
554
|
+
return blocks.length > 0 ? blocks : textPrompt(text);
|
|
555
|
+
}
|
|
556
|
+
function createInitialRecord(params) {
|
|
557
|
+
const now = isoNow();
|
|
558
|
+
return {
|
|
559
|
+
schema: "acpx.session.v1",
|
|
560
|
+
acpxRecordId: params.recordId,
|
|
561
|
+
acpSessionId: params.sessionId,
|
|
562
|
+
agentSessionId: params.agentSessionId,
|
|
563
|
+
agentCommand: params.agentCommand,
|
|
564
|
+
cwd: params.cwd,
|
|
565
|
+
name: params.sessionName,
|
|
566
|
+
createdAt: now,
|
|
567
|
+
lastUsedAt: now,
|
|
568
|
+
lastSeq: 0,
|
|
569
|
+
eventLog: defaultSessionEventLog(params.recordId),
|
|
570
|
+
closed: false,
|
|
571
|
+
closedAt: void 0,
|
|
572
|
+
...createSessionConversation(now),
|
|
573
|
+
acpx: {}
|
|
574
|
+
};
|
|
575
|
+
}
|
|
576
|
+
function createRecordId(sessionKey, mode) {
|
|
577
|
+
if (mode === "persistent") return sessionKey;
|
|
578
|
+
return `${sessionKey}:oneshot:${randomUUID()}`;
|
|
579
|
+
}
|
|
580
|
+
function resumePolicyForSessionMode(mode) {
|
|
581
|
+
return mode === "persistent" ? "same-session-only" : "allow-new";
|
|
582
|
+
}
|
|
583
|
+
function legacyTerminalEventFromTurnResult(result) {
|
|
584
|
+
if (result.status === "failed") return {
|
|
585
|
+
type: "error",
|
|
586
|
+
message: result.error.message,
|
|
587
|
+
...result.error.code ? { code: result.error.code } : {},
|
|
588
|
+
...result.error.detailCode ? { detailCode: result.error.detailCode } : {},
|
|
589
|
+
...result.error.retryable === void 0 ? {} : { retryable: result.error.retryable }
|
|
590
|
+
};
|
|
591
|
+
return {
|
|
592
|
+
type: "done",
|
|
593
|
+
...result.stopReason ? { stopReason: result.stopReason } : {}
|
|
594
|
+
};
|
|
595
|
+
}
|
|
596
|
+
function statusSummary(record) {
|
|
597
|
+
return [
|
|
598
|
+
`session=${record.acpxRecordId}`,
|
|
599
|
+
`backendSessionId=${record.acpSessionId}`,
|
|
600
|
+
record.agentSessionId ? `agentSessionId=${record.agentSessionId}` : null,
|
|
601
|
+
record.pid != null ? `pid=${record.pid}` : null,
|
|
602
|
+
record.closed ? "closed" : "open"
|
|
603
|
+
].filter(Boolean).join(" ");
|
|
604
|
+
}
|
|
605
|
+
function buildModelsField(record) {
|
|
606
|
+
const available = record.acpx?.available_models;
|
|
607
|
+
const currentModelId = record.acpx?.current_model_id;
|
|
608
|
+
if (!available || available.length === 0) return currentModelId === void 0 ? {} : { models: {
|
|
609
|
+
currentModelId,
|
|
610
|
+
availableModelIds: []
|
|
611
|
+
} };
|
|
612
|
+
return { models: {
|
|
613
|
+
...currentModelId !== void 0 ? { currentModelId } : {},
|
|
614
|
+
availableModelIds: [...available]
|
|
615
|
+
} };
|
|
616
|
+
}
|
|
617
|
+
function tokenUsageToBreakdown(usage) {
|
|
618
|
+
if (!usage) return;
|
|
619
|
+
const breakdown = {};
|
|
620
|
+
assignUsageBreakdownField(breakdown, "inputTokens", usage.input_tokens);
|
|
621
|
+
assignUsageBreakdownField(breakdown, "outputTokens", usage.output_tokens);
|
|
622
|
+
assignUsageBreakdownField(breakdown, "cachedReadTokens", usage.cache_read_input_tokens);
|
|
623
|
+
assignUsageBreakdownField(breakdown, "cachedWriteTokens", usage.cache_creation_input_tokens);
|
|
624
|
+
assignUsageBreakdownField(breakdown, "thoughtTokens", usage.thought_tokens);
|
|
625
|
+
assignUsageBreakdownField(breakdown, "totalTokens", usage.total_tokens);
|
|
626
|
+
return Object.keys(breakdown).length > 0 ? breakdown : void 0;
|
|
627
|
+
}
|
|
628
|
+
function assignUsageBreakdownField(breakdown, key, value) {
|
|
629
|
+
if (value !== void 0) breakdown[key] = value;
|
|
630
|
+
}
|
|
631
|
+
function buildUsageField(record) {
|
|
632
|
+
const cumulative = tokenUsageToBreakdown(record.cumulative_token_usage);
|
|
633
|
+
const perRequestEntries = Object.entries(record.request_token_usage ?? {}).map(([id, value]) => [id, tokenUsageToBreakdown(value)]).filter((entry) => entry[1] !== void 0);
|
|
634
|
+
const perRequest = perRequestEntries.length > 0 ? Object.fromEntries(perRequestEntries) : void 0;
|
|
635
|
+
const cost = record.cumulative_cost;
|
|
636
|
+
const usage = {
|
|
637
|
+
...cumulative ? { cumulative } : {},
|
|
638
|
+
...cost ? { cost } : {},
|
|
639
|
+
...perRequest ? { perRequest } : {}
|
|
640
|
+
};
|
|
641
|
+
return Object.keys(usage).length > 0 ? { usage } : {};
|
|
642
|
+
}
|
|
643
|
+
function buildAvailableCommandsField(record) {
|
|
644
|
+
const commands = record.acpx?.available_commands;
|
|
645
|
+
if (!commands || commands.length === 0) return {};
|
|
646
|
+
const availableCommands = commands.map((command) => runtimeAvailableCommand(command)).filter((command) => command !== void 0);
|
|
647
|
+
return availableCommands.length > 0 ? { availableCommands } : {};
|
|
648
|
+
}
|
|
649
|
+
function runtimeAvailableCommand(command) {
|
|
650
|
+
if (typeof command === "string") {
|
|
651
|
+
const name = command.trim();
|
|
652
|
+
return name ? { name } : void 0;
|
|
653
|
+
}
|
|
654
|
+
const record = commandRecord(command);
|
|
655
|
+
if (!record) return;
|
|
656
|
+
const name = trimmedField(record.name);
|
|
657
|
+
if (!name) return;
|
|
658
|
+
const runtimeCommand = { name };
|
|
659
|
+
const description = trimmedField(record.description);
|
|
660
|
+
if (description) runtimeCommand.description = description;
|
|
661
|
+
if (typeof record.has_input === "boolean") runtimeCommand.hasInput = record.has_input;
|
|
662
|
+
return runtimeCommand;
|
|
663
|
+
}
|
|
664
|
+
function commandRecord(value) {
|
|
665
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return;
|
|
666
|
+
return value;
|
|
667
|
+
}
|
|
668
|
+
function trimmedField(value) {
|
|
669
|
+
if (typeof value !== "string") return;
|
|
670
|
+
const trimmed = value.trim();
|
|
671
|
+
return trimmed ? trimmed : void 0;
|
|
672
|
+
}
|
|
673
|
+
function advertisedConfigOptionIds(record) {
|
|
674
|
+
const configOptions = record.acpx?.config_options;
|
|
675
|
+
if (!configOptions) return;
|
|
676
|
+
return new Set(configOptions.map((option) => option.id).filter((id) => typeof id === "string" && id.trim().length > 0));
|
|
677
|
+
}
|
|
678
|
+
function resolveSupportedConfigOptionId(record, configId) {
|
|
679
|
+
const advertisedIds = advertisedConfigOptionIds(record);
|
|
680
|
+
if (!advertisedIds) return configId;
|
|
681
|
+
if (advertisedIds.has(configId)) return configId;
|
|
682
|
+
if (configId === "thinking" && advertisedIds.has("effort")) return "effort";
|
|
683
|
+
const supported = [...advertisedIds].toSorted();
|
|
684
|
+
const supportedText = supported.length > 0 ? supported.join(", ") : "none";
|
|
685
|
+
throw new AcpRuntimeError("ACP_BACKEND_UNSUPPORTED_CONTROL", `ACP session ${record.acpxRecordId} does not advertise config option '${configId}'. Supported config options: ${supportedText}.`);
|
|
686
|
+
}
|
|
687
|
+
function applyConfigOptionResponseToTurn(turn, response) {
|
|
688
|
+
if (!response?.configOptions) return;
|
|
689
|
+
turn.acpxState = applyConfigOptionsToState(turn.acpxState, response.configOptions);
|
|
690
|
+
}
|
|
691
|
+
function applyDesiredConfigOptionToTurn(turn, configId, value) {
|
|
692
|
+
const nextState = cloneSessionAcpxState(turn.acpxState) ?? {};
|
|
693
|
+
if (configId === modelStateFromConfigOptions(nextState.config_options)?.configId) {
|
|
694
|
+
nextState.session_options = {
|
|
695
|
+
...nextState.session_options,
|
|
696
|
+
model: value
|
|
697
|
+
};
|
|
698
|
+
clearDesiredConfigOption(nextState, configId);
|
|
699
|
+
} else if (configId === "mode") nextState.desired_mode_id = value;
|
|
700
|
+
else nextState.desired_config_options = {
|
|
701
|
+
...nextState.desired_config_options,
|
|
702
|
+
[configId]: value
|
|
703
|
+
};
|
|
704
|
+
turn.acpxState = nextState;
|
|
705
|
+
}
|
|
706
|
+
function applyDesiredConfigOptionToRecord(record, configId, value) {
|
|
707
|
+
if (configId === modelStateFromConfigOptions(record.acpx?.config_options)?.configId) setDesiredModelId(record, value, configId);
|
|
708
|
+
else if (configId === "mode") setDesiredModeId(record, value);
|
|
709
|
+
else setDesiredConfigOption(record, configId, value);
|
|
710
|
+
}
|
|
711
|
+
async function createOrLoadRuntimeSession(client, resumeSessionId, cwd) {
|
|
712
|
+
if (resumeSessionId) {
|
|
713
|
+
if (client.supportsResumeSession()) {
|
|
714
|
+
const resumed = await client.resumeSession(resumeSessionId, cwd);
|
|
715
|
+
return {
|
|
716
|
+
sessionId: resumeSessionId,
|
|
717
|
+
agentSessionId: resumed.agentSessionId,
|
|
718
|
+
sessionResult: resumed
|
|
719
|
+
};
|
|
720
|
+
}
|
|
721
|
+
if (!client.supportsLoadSession()) throw new Error(`Agent does not support session/resume or session/load; cannot resume session ${resumeSessionId}`);
|
|
722
|
+
const loaded = await client.loadSession(resumeSessionId, cwd);
|
|
723
|
+
return {
|
|
724
|
+
sessionId: resumeSessionId,
|
|
725
|
+
agentSessionId: loaded.agentSessionId,
|
|
726
|
+
sessionResult: loaded
|
|
727
|
+
};
|
|
728
|
+
}
|
|
729
|
+
const created = await client.createSession(cwd);
|
|
730
|
+
return {
|
|
731
|
+
sessionId: created.sessionId,
|
|
732
|
+
agentSessionId: created.agentSessionId,
|
|
733
|
+
sessionResult: created
|
|
734
|
+
};
|
|
735
|
+
}
|
|
736
|
+
var AcpRuntimeManager = class {
|
|
737
|
+
options;
|
|
738
|
+
deps;
|
|
739
|
+
activeControllers = /* @__PURE__ */ new Map();
|
|
740
|
+
pendingPersistentClients = /* @__PURE__ */ new Map();
|
|
741
|
+
closingActiveRecords = /* @__PURE__ */ new Set();
|
|
742
|
+
constructor(options, deps = {}) {
|
|
743
|
+
this.options = options;
|
|
744
|
+
this.deps = deps;
|
|
745
|
+
}
|
|
746
|
+
createClient(options) {
|
|
747
|
+
const clientOptions = { ...options, onAgentStderr: this.options.onAgentStderr, onAgentSpawn: this.options.onAgentSpawn, spawnCwd: this.options.spawnCwd, inheritProcessEnv: this.options.inheritProcessEnv };
|
|
748
|
+
return this.deps.clientFactory?.(clientOptions) ?? new AcpClient(clientOptions);
|
|
749
|
+
}
|
|
750
|
+
async readPendingPersistentClient(record, options) {
|
|
751
|
+
const pendingClient = this.pendingPersistentClients.get(record.acpxRecordId);
|
|
752
|
+
if (!pendingClient) return;
|
|
753
|
+
if (!pendingClient.hasReusableSession(record.acpSessionId)) {
|
|
754
|
+
this.pendingPersistentClients.delete(record.acpxRecordId);
|
|
755
|
+
await pendingClient.close().catch(() => {});
|
|
756
|
+
return;
|
|
757
|
+
}
|
|
758
|
+
if (options.consume) this.pendingPersistentClients.delete(record.acpxRecordId);
|
|
759
|
+
return pendingClient;
|
|
760
|
+
}
|
|
761
|
+
async closePendingPersistentClient(recordId) {
|
|
762
|
+
const pendingClient = this.pendingPersistentClients.get(recordId);
|
|
763
|
+
if (!pendingClient) return;
|
|
764
|
+
this.pendingPersistentClients.delete(recordId);
|
|
765
|
+
await pendingClient.close().catch(() => {});
|
|
766
|
+
}
|
|
767
|
+
async refreshClosedState(record) {
|
|
768
|
+
if (!this.closingActiveRecords.has(record.acpxRecordId)) return record.closed === true;
|
|
769
|
+
const latest = await this.options.sessionStore.load(record.acpxRecordId).catch(() => void 0);
|
|
770
|
+
record.closed = true;
|
|
771
|
+
record.closedAt = latest?.closedAt ?? record.closedAt ?? isoNow();
|
|
772
|
+
if (latest?.acpx) record.acpx = {
|
|
773
|
+
...record.acpx,
|
|
774
|
+
...latest.acpx
|
|
775
|
+
};
|
|
776
|
+
return true;
|
|
777
|
+
}
|
|
778
|
+
async retainPersistentClientAfterTurn(input) {
|
|
779
|
+
const { record, client } = input;
|
|
780
|
+
if (!!record.acpxRecordId.includes(":oneshot:") || record.closed || !client.hasReusableSession(record.acpSessionId)) return false;
|
|
781
|
+
const previousClient = this.pendingPersistentClients.get(record.acpxRecordId);
|
|
782
|
+
this.pendingPersistentClients.set(record.acpxRecordId, client);
|
|
783
|
+
if (previousClient && previousClient !== client) await previousClient.close().catch(() => {});
|
|
784
|
+
return true;
|
|
785
|
+
}
|
|
786
|
+
async withRuntimeControlSession(record, sessionMode, run) {
|
|
787
|
+
const pendingClient = await this.readPendingPersistentClient(record, { consume: false });
|
|
788
|
+
if (pendingClient) {
|
|
789
|
+
const value = await run({
|
|
790
|
+
client: pendingClient,
|
|
791
|
+
sessionId: record.acpSessionId,
|
|
792
|
+
record
|
|
793
|
+
});
|
|
794
|
+
record.lastUsedAt = isoNow();
|
|
795
|
+
record.closed = false;
|
|
796
|
+
record.closedAt = void 0;
|
|
797
|
+
record.protocolVersion = pendingClient.initializeResult?.protocolVersion;
|
|
798
|
+
record.agentCapabilities = pendingClient.initializeResult?.agentCapabilities;
|
|
799
|
+
applyLifecycleSnapshotToRecord(record, pendingClient.getAgentLifecycleSnapshot());
|
|
800
|
+
return {
|
|
801
|
+
value,
|
|
802
|
+
record
|
|
803
|
+
};
|
|
804
|
+
}
|
|
805
|
+
const result = await withConnectedSession({
|
|
806
|
+
sessionRecordId: record.acpxRecordId,
|
|
807
|
+
loadRecord: async (sessionRecordId) => await this.requireRecord(sessionRecordId),
|
|
808
|
+
saveRecord: async (connectedRecord) => await this.options.sessionStore.save(connectedRecord),
|
|
809
|
+
createClient: (options) => this.createClient(options),
|
|
810
|
+
mcpServers: [...this.options.mcpServers ?? []],
|
|
811
|
+
permissionMode: this.options.permissionMode,
|
|
812
|
+
nonInteractivePermissions: this.options.nonInteractivePermissions,
|
|
813
|
+
onPermissionRequest: this.options.onPermissionRequest,
|
|
814
|
+
verbose: this.options.verbose,
|
|
815
|
+
timeoutMs: this.options.timeoutMs,
|
|
816
|
+
resumePolicy: resumePolicyForSessionMode(sessionMode),
|
|
817
|
+
run
|
|
818
|
+
});
|
|
819
|
+
return {
|
|
820
|
+
value: result.value,
|
|
821
|
+
record: result.record
|
|
822
|
+
};
|
|
823
|
+
}
|
|
824
|
+
async ensureSession(input) {
|
|
825
|
+
const cwd = path.resolve(input.cwd?.trim() || this.options.cwd);
|
|
826
|
+
const agentCommand = this.options.agentRegistry.resolve(input.agent);
|
|
827
|
+
const existing = await this.options.sessionStore.load(input.sessionKey);
|
|
828
|
+
if (input.mode === "persistent" && existing && shouldReuseExistingRecord(existing, {
|
|
829
|
+
cwd,
|
|
830
|
+
agentCommand,
|
|
831
|
+
resumeSessionId: input.resumeSessionId
|
|
832
|
+
})) {
|
|
833
|
+
existing.closed = false;
|
|
834
|
+
existing.closedAt = void 0;
|
|
835
|
+
this.closingActiveRecords.delete(existing.acpxRecordId);
|
|
836
|
+
await this.options.sessionStore.save(existing);
|
|
837
|
+
return existing;
|
|
838
|
+
}
|
|
839
|
+
const client = this.createClient({
|
|
840
|
+
agentCommand,
|
|
841
|
+
cwd,
|
|
842
|
+
mcpServers: [...this.options.mcpServers ?? []],
|
|
843
|
+
permissionMode: this.options.permissionMode,
|
|
844
|
+
nonInteractivePermissions: this.options.nonInteractivePermissions,
|
|
845
|
+
onPermissionRequest: this.options.onPermissionRequest,
|
|
846
|
+
verbose: this.options.verbose,
|
|
847
|
+
sessionOptions: input.sessionOptions
|
|
848
|
+
});
|
|
849
|
+
let keepClientOpen = false;
|
|
850
|
+
try {
|
|
851
|
+
await client.start();
|
|
852
|
+
const session = await createOrLoadRuntimeSession(client, input.resumeSessionId, cwd);
|
|
853
|
+
const record = await this.createAndSaveRuntimeRecord({
|
|
854
|
+
input,
|
|
855
|
+
client,
|
|
856
|
+
agentCommand,
|
|
857
|
+
cwd,
|
|
858
|
+
session
|
|
859
|
+
});
|
|
860
|
+
keepClientOpen = await this.keepPersistentClient(input.mode, record.acpxRecordId, client);
|
|
861
|
+
return record;
|
|
862
|
+
} finally {
|
|
863
|
+
if (!keepClientOpen) await client.close();
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
async createAndSaveRuntimeRecord(params) {
|
|
867
|
+
const { input, client, agentCommand, cwd, session } = params;
|
|
868
|
+
const record = createInitialRecord({
|
|
869
|
+
recordId: createRecordId(input.sessionKey, input.mode),
|
|
870
|
+
sessionName: input.sessionKey,
|
|
871
|
+
sessionId: session.sessionId,
|
|
872
|
+
agentCommand,
|
|
873
|
+
cwd,
|
|
874
|
+
agentSessionId: session.agentSessionId
|
|
875
|
+
});
|
|
876
|
+
this.closingActiveRecords.delete(record.acpxRecordId);
|
|
877
|
+
record.protocolVersion = client.initializeResult?.protocolVersion;
|
|
878
|
+
record.agentCapabilities = client.initializeResult?.agentCapabilities;
|
|
879
|
+
applyConfigOptionsToRecord(record, session.sessionResult);
|
|
880
|
+
const modelApplication = await applyRequestedModelIfAdvertised({
|
|
881
|
+
client,
|
|
882
|
+
sessionId: session.sessionId,
|
|
883
|
+
requestedModel: input.sessionOptions?.model,
|
|
884
|
+
models: session.sessionResult.models,
|
|
885
|
+
agentCommand,
|
|
886
|
+
timeoutMs: this.options.timeoutMs
|
|
887
|
+
});
|
|
888
|
+
applyConfigOptionsToRecord(record, modelApplication.response);
|
|
889
|
+
syncAdvertisedModelState(record, modelApplication.response ? modelStateFromConfigOptions(modelApplication.response.configOptions) : session.sessionResult.models);
|
|
890
|
+
if (modelApplication.applied) setCurrentModelId(record, currentModelIdFromSetModelResponse(modelApplication.response, input.sessionOptions?.model));
|
|
891
|
+
applyLifecycleSnapshotToRecord(record, client.getAgentLifecycleSnapshot());
|
|
892
|
+
persistSessionOptions(record, input.sessionOptions);
|
|
893
|
+
await this.options.sessionStore.save(record);
|
|
894
|
+
return record;
|
|
895
|
+
}
|
|
896
|
+
async keepPersistentClient(mode, recordId, client) {
|
|
897
|
+
if (mode !== "persistent") return false;
|
|
898
|
+
const previousClient = this.pendingPersistentClients.get(recordId);
|
|
899
|
+
this.pendingPersistentClients.set(recordId, client);
|
|
900
|
+
await previousClient?.close().catch(() => {});
|
|
901
|
+
return true;
|
|
902
|
+
}
|
|
903
|
+
startTurn(input) {
|
|
904
|
+
const promptInput = toPromptInput(input.text, input.attachments);
|
|
905
|
+
const queue = new AsyncEventQueue();
|
|
906
|
+
const result = createDeferred();
|
|
907
|
+
const sessionReady = createDeferred();
|
|
908
|
+
sessionReady.promise.catch(() => {});
|
|
909
|
+
let resultSettled = false;
|
|
910
|
+
const state = {
|
|
911
|
+
pendingCancel: false,
|
|
912
|
+
turnActive: true,
|
|
913
|
+
activeController: null
|
|
914
|
+
};
|
|
915
|
+
let streamClosed = false;
|
|
916
|
+
const settleResult = (next) => {
|
|
917
|
+
if (resultSettled) return;
|
|
918
|
+
resultSettled = true;
|
|
919
|
+
result.resolve(next);
|
|
920
|
+
};
|
|
921
|
+
const closeStream = () => {
|
|
922
|
+
if (streamClosed) return;
|
|
923
|
+
streamClosed = true;
|
|
924
|
+
queue.clear();
|
|
925
|
+
queue.close();
|
|
926
|
+
};
|
|
927
|
+
const requestCancel = async () => {
|
|
928
|
+
if (state.activeController) return await state.activeController.requestCancelActivePrompt();
|
|
929
|
+
if (!state.turnActive) return false;
|
|
930
|
+
state.pendingCancel = true;
|
|
931
|
+
return true;
|
|
932
|
+
};
|
|
933
|
+
const abortHandler = () => {
|
|
934
|
+
requestCancel();
|
|
935
|
+
};
|
|
936
|
+
if (input.signal) {
|
|
937
|
+
if (input.signal.aborted) {
|
|
938
|
+
closeStream();
|
|
939
|
+
settleResult({
|
|
940
|
+
status: "cancelled",
|
|
941
|
+
stopReason: "cancelled"
|
|
942
|
+
});
|
|
943
|
+
return {
|
|
944
|
+
requestId: input.requestId,
|
|
945
|
+
events: queue.iterate(),
|
|
946
|
+
result: result.promise,
|
|
947
|
+
cancel: async () => {},
|
|
948
|
+
closeStream: async () => {}
|
|
949
|
+
};
|
|
950
|
+
}
|
|
951
|
+
input.signal.addEventListener("abort", abortHandler, { once: true });
|
|
952
|
+
}
|
|
953
|
+
this.runRuntimeTurnTask({
|
|
954
|
+
input,
|
|
955
|
+
promptInput,
|
|
956
|
+
queue,
|
|
957
|
+
sessionReady,
|
|
958
|
+
state,
|
|
959
|
+
settleResult,
|
|
960
|
+
abortHandler
|
|
961
|
+
});
|
|
962
|
+
return {
|
|
963
|
+
requestId: input.requestId,
|
|
964
|
+
events: queue.iterate(),
|
|
965
|
+
result: result.promise,
|
|
966
|
+
cancel: async () => {
|
|
967
|
+
await requestCancel();
|
|
968
|
+
},
|
|
969
|
+
closeStream: async () => {
|
|
970
|
+
closeStream();
|
|
971
|
+
}
|
|
972
|
+
};
|
|
973
|
+
}
|
|
974
|
+
async runRuntimeTurnTask(task) {
|
|
975
|
+
let turn;
|
|
976
|
+
try {
|
|
977
|
+
turn = await this.prepareRuntimeTurn(task);
|
|
978
|
+
const { sessionId, resumed, loadError } = await this.connectRuntimeTurn(task, turn);
|
|
979
|
+
await this.resolveRuntimeTurnReady(task, turn, resumed, loadError);
|
|
980
|
+
if (this.cancelRuntimeTurnBeforePrompt(task)) return;
|
|
981
|
+
await this.applyPendingRuntimeTurnCancel(task, turn);
|
|
982
|
+
const response = await runPromptTurn({
|
|
983
|
+
client: turn.client,
|
|
984
|
+
sessionId,
|
|
985
|
+
prompt: task.promptInput,
|
|
986
|
+
onTerminalSessionFailure: task.input.onTerminalSessionFailure,
|
|
987
|
+
timeoutMs: task.input.timeoutMs ?? this.options.timeoutMs,
|
|
988
|
+
conversation: turn.conversation,
|
|
989
|
+
promptMessageId: turn.promptMessageId
|
|
990
|
+
});
|
|
991
|
+
await this.saveCompletedRuntimeTurn(turn, response.stopReason);
|
|
992
|
+
task.settleResult({
|
|
993
|
+
status: response.stopReason === "cancelled" ? "cancelled" : "completed",
|
|
994
|
+
...response.stopReason ? { stopReason: response.stopReason } : {}
|
|
995
|
+
});
|
|
996
|
+
} catch (error) {
|
|
997
|
+
this.failRuntimeTurn(task, error);
|
|
998
|
+
} finally {
|
|
999
|
+
await this.finalizeRuntimeTurn(task, turn);
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
async prepareRuntimeTurn(task) {
|
|
1003
|
+
const record = await this.requireRecord(task.input.handle.acpxRecordId ?? task.input.handle.sessionKey);
|
|
1004
|
+
const conversation = cloneSessionConversation(record);
|
|
1005
|
+
let acpxState = cloneSessionAcpxState(record.acpx);
|
|
1006
|
+
const promptStartedAt = isoNow();
|
|
1007
|
+
const promptMessageId = recordPromptSubmission(conversation, task.promptInput, promptStartedAt);
|
|
1008
|
+
trimConversationForRuntime(conversation);
|
|
1009
|
+
record.lastPromptAt = promptStartedAt;
|
|
1010
|
+
record.lastUsedAt = promptStartedAt;
|
|
1011
|
+
record.acpx = acpxState;
|
|
1012
|
+
applyConversation(record, conversation);
|
|
1013
|
+
await this.options.sessionStore.save(record);
|
|
1014
|
+
const pendingClient = await this.readPendingPersistentClient(record, { consume: true });
|
|
1015
|
+
const client = pendingClient ?? this.createTurnClient(record);
|
|
1016
|
+
const turn = {
|
|
1017
|
+
record,
|
|
1018
|
+
conversation,
|
|
1019
|
+
acpxState,
|
|
1020
|
+
liveCheckpoint: this.createRuntimeTurnCheckpoint(record, conversation, () => turn.acpxState),
|
|
1021
|
+
client,
|
|
1022
|
+
pendingClient,
|
|
1023
|
+
promptMessageId,
|
|
1024
|
+
activeSessionId: record.acpSessionId
|
|
1025
|
+
};
|
|
1026
|
+
task.state.activeController = this.buildRuntimeTurnController(task, turn);
|
|
1027
|
+
this.activeControllers.set(record.acpxRecordId, task.state.activeController);
|
|
1028
|
+
this.installRuntimeTurnEventHandlers(task, turn);
|
|
1029
|
+
return turn;
|
|
1030
|
+
}
|
|
1031
|
+
createTurnClient(record) {
|
|
1032
|
+
return this.createClient({
|
|
1033
|
+
agentCommand: record.agentCommand,
|
|
1034
|
+
cwd: record.cwd,
|
|
1035
|
+
mcpServers: [...this.options.mcpServers ?? []],
|
|
1036
|
+
permissionMode: this.options.permissionMode,
|
|
1037
|
+
nonInteractivePermissions: this.options.nonInteractivePermissions,
|
|
1038
|
+
onPermissionRequest: this.options.onPermissionRequest,
|
|
1039
|
+
verbose: this.options.verbose,
|
|
1040
|
+
sessionOptions: sessionOptionsFromRecord(record)
|
|
1041
|
+
});
|
|
1042
|
+
}
|
|
1043
|
+
createRuntimeTurnCheckpoint(record, conversation, readAcpxState) {
|
|
1044
|
+
return new LiveSessionCheckpoint({ save: async () => {
|
|
1045
|
+
record.lastUsedAt = isoNow();
|
|
1046
|
+
record.acpx = readAcpxState();
|
|
1047
|
+
applyConversation(record, conversation);
|
|
1048
|
+
await this.refreshClosedState(record);
|
|
1049
|
+
await this.options.sessionStore.save(record);
|
|
1050
|
+
} });
|
|
1051
|
+
}
|
|
1052
|
+
buildRuntimeTurnController(task, turn) {
|
|
1053
|
+
return {
|
|
1054
|
+
hasActivePrompt: () => turn.client.hasActivePrompt(),
|
|
1055
|
+
requestCancelActivePrompt: async () => await this.requestRuntimeTurnCancel(task, turn),
|
|
1056
|
+
setSessionMode: async (modeId) => {
|
|
1057
|
+
await this.waitForRuntimeControlSession(task, turn);
|
|
1058
|
+
await turn.client.setSessionMode(turn.activeSessionId, modeId);
|
|
1059
|
+
const nextState = cloneSessionAcpxState(turn.acpxState) ?? {};
|
|
1060
|
+
nextState.desired_mode_id = modeId;
|
|
1061
|
+
turn.acpxState = nextState;
|
|
1062
|
+
},
|
|
1063
|
+
setSessionModel: async (modelId) => {
|
|
1064
|
+
await this.waitForRuntimeControlSession(task, turn);
|
|
1065
|
+
const models = advertisedModelState(turn.acpxState);
|
|
1066
|
+
const response = await turn.client.setSessionModel(turn.activeSessionId, modelId, models);
|
|
1067
|
+
applyConfigOptionResponseToTurn(turn, response);
|
|
1068
|
+
const nextState = cloneSessionAcpxState(turn.acpxState) ?? {};
|
|
1069
|
+
nextState.session_options = {
|
|
1070
|
+
...nextState.session_options,
|
|
1071
|
+
model: modelId
|
|
1072
|
+
};
|
|
1073
|
+
nextState.current_model_id = currentModelIdFromSetModelResponse(response, modelId);
|
|
1074
|
+
clearDesiredConfigOption(nextState, models?.configId);
|
|
1075
|
+
turn.acpxState = nextState;
|
|
1076
|
+
return response;
|
|
1077
|
+
},
|
|
1078
|
+
setSessionConfigOption: async (configId, value) => {
|
|
1079
|
+
return (await task.state.activeController.setResolvedSessionConfigOption(configId, value)).response;
|
|
1080
|
+
},
|
|
1081
|
+
setResolvedSessionConfigOption: async (configId, value) => await this.setRuntimeResolvedSessionConfigOption(task, turn, configId, value)
|
|
1082
|
+
};
|
|
1083
|
+
}
|
|
1084
|
+
async waitForRuntimeControlSession(task, turn) {
|
|
1085
|
+
if (turn.client.hasActivePrompt()) return;
|
|
1086
|
+
await task.sessionReady.promise;
|
|
1087
|
+
}
|
|
1088
|
+
async requestRuntimeTurnCancel(task, turn) {
|
|
1089
|
+
if (turn.client.hasActivePrompt()) return await turn.client.requestCancelActivePrompt();
|
|
1090
|
+
if (!task.state.turnActive) return false;
|
|
1091
|
+
task.state.pendingCancel = true;
|
|
1092
|
+
return true;
|
|
1093
|
+
}
|
|
1094
|
+
async setRuntimeResolvedSessionConfigOption(task, turn, configId, value) {
|
|
1095
|
+
await this.waitForRuntimeControlSession(task, turn);
|
|
1096
|
+
const resolvedConfigId = resolveSupportedConfigOptionId({
|
|
1097
|
+
...turn.record,
|
|
1098
|
+
acpx: turn.acpxState ?? void 0
|
|
1099
|
+
}, configId);
|
|
1100
|
+
const response = await turn.client.setSessionConfigOption(turn.activeSessionId, resolvedConfigId, value);
|
|
1101
|
+
this.applyRuntimeConfigOptionState(turn, resolvedConfigId, value, response);
|
|
1102
|
+
return {
|
|
1103
|
+
configId: resolvedConfigId,
|
|
1104
|
+
response
|
|
1105
|
+
};
|
|
1106
|
+
}
|
|
1107
|
+
applyRuntimeConfigOptionState(turn, configId, value, response) {
|
|
1108
|
+
applyConfigOptionResponseToTurn(turn, response);
|
|
1109
|
+
applyDesiredConfigOptionToTurn(turn, configId, value);
|
|
1110
|
+
}
|
|
1111
|
+
installRuntimeTurnEventHandlers(task, turn) {
|
|
1112
|
+
turn.client.setEventHandlers({
|
|
1113
|
+
onSessionUpdate: (notification) => {
|
|
1114
|
+
turn.acpxState = recordSessionUpdate(turn.conversation, turn.acpxState, notification);
|
|
1115
|
+
trimConversationForRuntime(turn.conversation);
|
|
1116
|
+
turn.liveCheckpoint.request();
|
|
1117
|
+
this.emitRuntimeTurnEvent(task, {
|
|
1118
|
+
jsonrpc: "2.0",
|
|
1119
|
+
method: "session/update",
|
|
1120
|
+
params: notification
|
|
1121
|
+
});
|
|
1122
|
+
},
|
|
1123
|
+
onClientOperation: (operation) => {
|
|
1124
|
+
turn.acpxState = recordClientOperation(turn.conversation, turn.acpxState, operation);
|
|
1125
|
+
trimConversationForRuntime(turn.conversation);
|
|
1126
|
+
turn.liveCheckpoint.request();
|
|
1127
|
+
this.emitRuntimeTurnEvent(task, {
|
|
1128
|
+
type: "client_operation",
|
|
1129
|
+
...operation
|
|
1130
|
+
});
|
|
1131
|
+
}
|
|
1132
|
+
});
|
|
1133
|
+
}
|
|
1134
|
+
emitRuntimeTurnEvent(task, payload) {
|
|
1135
|
+
const parsed = parsePromptEventLine(JSON.stringify(payload));
|
|
1136
|
+
if (!parsed) return;
|
|
1137
|
+
task.queue.push(parsed);
|
|
1138
|
+
}
|
|
1139
|
+
async connectRuntimeTurn(task, turn) {
|
|
1140
|
+
const loaded = turn.pendingClient ? {
|
|
1141
|
+
sessionId: turn.record.acpSessionId,
|
|
1142
|
+
resumed: false,
|
|
1143
|
+
loadError: void 0
|
|
1144
|
+
} : await this.connectRuntimeTurnClient(task, turn);
|
|
1145
|
+
turn.acpxState = cloneSessionAcpxState(turn.record.acpx);
|
|
1146
|
+
return loaded;
|
|
1147
|
+
}
|
|
1148
|
+
async connectRuntimeTurnClient(task, turn) {
|
|
1149
|
+
return await connectAndLoadSession({
|
|
1150
|
+
client: turn.client,
|
|
1151
|
+
record: turn.record,
|
|
1152
|
+
resumePolicy: resumePolicyForSessionMode(task.input.sessionMode),
|
|
1153
|
+
timeoutMs: this.options.timeoutMs,
|
|
1154
|
+
activeController: task.state.activeController,
|
|
1155
|
+
onClientAvailable: () => this.publishRuntimeTurnController(task, turn),
|
|
1156
|
+
onConnectedRecord: (connectedRecord) => {
|
|
1157
|
+
connectedRecord.lastPromptAt = isoNow();
|
|
1158
|
+
},
|
|
1159
|
+
onSessionIdResolved: (sessionIdValue) => {
|
|
1160
|
+
turn.activeSessionId = sessionIdValue;
|
|
1161
|
+
}
|
|
1162
|
+
});
|
|
1163
|
+
}
|
|
1164
|
+
publishRuntimeTurnController(task, turn) {
|
|
1165
|
+
const controller = task.state.activeController;
|
|
1166
|
+
if (controller) this.activeControllers.set(turn.record.acpxRecordId, controller);
|
|
1167
|
+
}
|
|
1168
|
+
async resolveRuntimeTurnReady(task, turn, resumed, loadError) {
|
|
1169
|
+
task.sessionReady.resolve();
|
|
1170
|
+
turn.record.lastRequestId = task.input.requestId;
|
|
1171
|
+
turn.record.lastPromptAt = isoNow();
|
|
1172
|
+
turn.record.closed = false;
|
|
1173
|
+
turn.record.closedAt = void 0;
|
|
1174
|
+
turn.record.lastUsedAt = isoNow();
|
|
1175
|
+
await turn.liveCheckpoint.checkpoint();
|
|
1176
|
+
this.emitRuntimeTurnLoadStatus(task, resumed, loadError);
|
|
1177
|
+
}
|
|
1178
|
+
emitRuntimeTurnLoadStatus(task, resumed, loadError) {
|
|
1179
|
+
if (!resumed && !loadError) return;
|
|
1180
|
+
this.emitRuntimeTurnEvent(task, {
|
|
1181
|
+
type: "status",
|
|
1182
|
+
text: loadError ? `session reconnect fallback: ${loadError}` : "session resumed"
|
|
1183
|
+
});
|
|
1184
|
+
}
|
|
1185
|
+
cancelRuntimeTurnBeforePrompt(task) {
|
|
1186
|
+
if (!task.state.pendingCancel && !task.input.signal?.aborted) return false;
|
|
1187
|
+
task.state.pendingCancel = false;
|
|
1188
|
+
task.settleResult({
|
|
1189
|
+
status: "cancelled",
|
|
1190
|
+
stopReason: "cancelled"
|
|
1191
|
+
});
|
|
1192
|
+
return true;
|
|
1193
|
+
}
|
|
1194
|
+
async applyPendingRuntimeTurnCancel(task, turn) {
|
|
1195
|
+
if (!task.state.pendingCancel || !turn.client.hasActivePrompt()) return false;
|
|
1196
|
+
const cancelled = await turn.client.requestCancelActivePrompt();
|
|
1197
|
+
if (cancelled) task.state.pendingCancel = false;
|
|
1198
|
+
return cancelled;
|
|
1199
|
+
}
|
|
1200
|
+
async saveCompletedRuntimeTurn(turn, _stopReason) {
|
|
1201
|
+
turn.record.acpSessionId = turn.activeSessionId;
|
|
1202
|
+
reconcileAgentSessionId(turn.record, turn.record.agentSessionId);
|
|
1203
|
+
turn.record.protocolVersion = turn.client.initializeResult?.protocolVersion;
|
|
1204
|
+
turn.record.agentCapabilities = turn.client.initializeResult?.agentCapabilities;
|
|
1205
|
+
turn.record.acpx = turn.acpxState;
|
|
1206
|
+
applyConversation(turn.record, turn.conversation);
|
|
1207
|
+
applyLifecycleSnapshotToRecord(turn.record, turn.client.getAgentLifecycleSnapshot());
|
|
1208
|
+
await this.options.sessionStore.save(turn.record);
|
|
1209
|
+
}
|
|
1210
|
+
failRuntimeTurn(task, error) {
|
|
1211
|
+
task.sessionReady.reject(error);
|
|
1212
|
+
const normalized = normalizeOutputError(error, { origin: "runtime" });
|
|
1213
|
+
task.settleResult({
|
|
1214
|
+
status: "failed",
|
|
1215
|
+
error: {
|
|
1216
|
+
message: normalized.message,
|
|
1217
|
+
...normalized.code ? { code: normalized.code } : {},
|
|
1218
|
+
...normalized.detailCode ? { detailCode: normalized.detailCode } : {},
|
|
1219
|
+
...normalized.retryable !== void 0 ? { retryable: normalized.retryable } : {}
|
|
1220
|
+
}
|
|
1221
|
+
});
|
|
1222
|
+
}
|
|
1223
|
+
async finalizeRuntimeTurn(task, turn) {
|
|
1224
|
+
task.state.turnActive = false;
|
|
1225
|
+
task.input.signal?.removeEventListener("abort", task.abortHandler);
|
|
1226
|
+
turn?.client.clearEventHandlers();
|
|
1227
|
+
if (!(turn ? await this.finalizeRuntimeTurnRecord(turn) : false)) await turn?.client.close().catch(() => {});
|
|
1228
|
+
if (turn) {
|
|
1229
|
+
this.activeControllers.delete(turn.record.acpxRecordId);
|
|
1230
|
+
this.closingActiveRecords.delete(turn.record.acpxRecordId);
|
|
1231
|
+
}
|
|
1232
|
+
task.queue.close();
|
|
1233
|
+
}
|
|
1234
|
+
async finalizeRuntimeTurnRecord(turn) {
|
|
1235
|
+
applyLifecycleSnapshotToRecord(turn.record, turn.client.getAgentLifecycleSnapshot());
|
|
1236
|
+
turn.record.acpx = turn.acpxState;
|
|
1237
|
+
applyConversation(turn.record, turn.conversation);
|
|
1238
|
+
turn.record.lastUsedAt = isoNow();
|
|
1239
|
+
await turn.liveCheckpoint.flush().catch(() => {});
|
|
1240
|
+
const closed = await this.refreshClosedState(turn.record);
|
|
1241
|
+
await this.options.sessionStore.save(turn.record).catch(() => {});
|
|
1242
|
+
if (closed) return false;
|
|
1243
|
+
return await this.retainPersistentClientAfterTurn({
|
|
1244
|
+
record: turn.record,
|
|
1245
|
+
client: turn.client
|
|
1246
|
+
});
|
|
1247
|
+
}
|
|
1248
|
+
async *runTurn(input) {
|
|
1249
|
+
const turn = this.startTurn(input);
|
|
1250
|
+
yield* turn.events;
|
|
1251
|
+
yield legacyTerminalEventFromTurnResult(await turn.result);
|
|
1252
|
+
}
|
|
1253
|
+
async getStatus(handle) {
|
|
1254
|
+
const record = await this.requireRecord(handle.acpxRecordId ?? handle.sessionKey);
|
|
1255
|
+
return {
|
|
1256
|
+
summary: statusSummary(record),
|
|
1257
|
+
acpxRecordId: record.acpxRecordId,
|
|
1258
|
+
backendSessionId: record.acpSessionId,
|
|
1259
|
+
agentSessionId: record.agentSessionId,
|
|
1260
|
+
...buildModelsField(record),
|
|
1261
|
+
...buildUsageField(record),
|
|
1262
|
+
...buildAvailableCommandsField(record),
|
|
1263
|
+
details: {
|
|
1264
|
+
cwd: record.cwd,
|
|
1265
|
+
lastUsedAt: record.lastUsedAt,
|
|
1266
|
+
closed: record.closed === true,
|
|
1267
|
+
...record.acpx?.config_options !== void 0 ? { configOptions: structuredClone(record.acpx.config_options) } : {}
|
|
1268
|
+
}
|
|
1269
|
+
};
|
|
1270
|
+
}
|
|
1271
|
+
async setMode(handle, mode, sessionMode = "persistent") {
|
|
1272
|
+
const record = await this.requireRecord(handle.acpxRecordId ?? handle.sessionKey);
|
|
1273
|
+
const controller = this.activeControllers.get(record.acpxRecordId);
|
|
1274
|
+
let targetRecord = record;
|
|
1275
|
+
if (controller) await controller.setSessionMode(mode);
|
|
1276
|
+
else targetRecord = (await this.withRuntimeControlSession(record, sessionMode, async ({ client, sessionId }) => {
|
|
1277
|
+
await client.setSessionMode(sessionId, mode);
|
|
1278
|
+
})).record;
|
|
1279
|
+
setDesiredModeId(targetRecord, mode);
|
|
1280
|
+
await this.options.sessionStore.save(targetRecord);
|
|
1281
|
+
}
|
|
1282
|
+
async setConfigOption(handle, key, value, sessionMode = "persistent") {
|
|
1283
|
+
const record = await this.requireRecord(handle.acpxRecordId ?? handle.sessionKey);
|
|
1284
|
+
const controller = this.activeControllers.get(record.acpxRecordId);
|
|
1285
|
+
if (controller) {
|
|
1286
|
+
const { configId, response } = await controller.setResolvedSessionConfigOption(key, value);
|
|
1287
|
+
applyConfigOptionsToRecord(record, response);
|
|
1288
|
+
applyDesiredConfigOptionToRecord(record, configId, value);
|
|
1289
|
+
await this.options.sessionStore.save(record);
|
|
1290
|
+
return;
|
|
1291
|
+
}
|
|
1292
|
+
const result = await this.withRuntimeControlSession(record, sessionMode, async ({ client, sessionId, record: connectedRecord }) => {
|
|
1293
|
+
const configId = resolveSupportedConfigOptionId(connectedRecord, key);
|
|
1294
|
+
applyConfigOptionsToRecord(connectedRecord, await client.setSessionConfigOption(sessionId, configId, value));
|
|
1295
|
+
applyDesiredConfigOptionToRecord(connectedRecord, configId, value);
|
|
1296
|
+
});
|
|
1297
|
+
await this.options.sessionStore.save(result.record);
|
|
1298
|
+
}
|
|
1299
|
+
async cancel(handle) {
|
|
1300
|
+
await this.activeControllers.get(handle.acpxRecordId ?? handle.sessionKey)?.requestCancelActivePrompt();
|
|
1301
|
+
}
|
|
1302
|
+
async close(handle, options = {}) {
|
|
1303
|
+
const record = await this.requireRecord(handle.acpxRecordId ?? handle.sessionKey);
|
|
1304
|
+
if (this.activeControllers.has(record.acpxRecordId)) this.closingActiveRecords.add(record.acpxRecordId);
|
|
1305
|
+
await this.cancel(handle);
|
|
1306
|
+
if (options.discardPersistentState) {
|
|
1307
|
+
await this.closeBackendSession(record);
|
|
1308
|
+
record.acpx = {
|
|
1309
|
+
...record.acpx,
|
|
1310
|
+
reset_on_next_ensure: true
|
|
1311
|
+
};
|
|
1312
|
+
} else await this.closePendingPersistentClient(record.acpxRecordId);
|
|
1313
|
+
record.closed = true;
|
|
1314
|
+
record.closedAt = isoNow();
|
|
1315
|
+
await this.options.sessionStore.save(record);
|
|
1316
|
+
}
|
|
1317
|
+
async closeBackendSession(record) {
|
|
1318
|
+
const pendingClient = await this.readPendingPersistentClient(record, { consume: true });
|
|
1319
|
+
const client = pendingClient ?? this.createClient({
|
|
1320
|
+
agentCommand: record.agentCommand,
|
|
1321
|
+
cwd: record.cwd,
|
|
1322
|
+
mcpServers: [...this.options.mcpServers ?? []],
|
|
1323
|
+
permissionMode: this.options.permissionMode,
|
|
1324
|
+
nonInteractivePermissions: this.options.nonInteractivePermissions,
|
|
1325
|
+
onPermissionRequest: this.options.onPermissionRequest,
|
|
1326
|
+
verbose: this.options.verbose
|
|
1327
|
+
});
|
|
1328
|
+
try {
|
|
1329
|
+
if (!pendingClient) await withTimeout(client.start(), this.options.timeoutMs);
|
|
1330
|
+
if (!client.supportsCloseSession()) throw new AcpRuntimeError("ACP_BACKEND_UNSUPPORTED_CONTROL", `Agent does not support session/close for ${record.acpxRecordId}.`);
|
|
1331
|
+
await withTimeout(client.closeSession(record.acpSessionId), this.options.timeoutMs);
|
|
1332
|
+
} catch (error) {
|
|
1333
|
+
if (isUnsupportedSessionCloseError(error)) throw new AcpRuntimeError("ACP_BACKEND_UNSUPPORTED_CONTROL", `Agent does not support session/close for ${record.acpxRecordId}.`, { cause: error });
|
|
1334
|
+
if (isAcpResourceNotFoundError(error)) return;
|
|
1335
|
+
throw error;
|
|
1336
|
+
} finally {
|
|
1337
|
+
await client.close().catch(() => {});
|
|
1338
|
+
}
|
|
1339
|
+
}
|
|
1340
|
+
async requireRecord(sessionId) {
|
|
1341
|
+
const record = await this.options.sessionStore.load(sessionId);
|
|
1342
|
+
if (!record) throw new Error(`ACP session not found: ${sessionId}`);
|
|
1343
|
+
return record;
|
|
1344
|
+
}
|
|
1345
|
+
};
|
|
1346
|
+
//#endregion
|
|
1347
|
+
//#region src/runtime/public/file-session-store.ts
|
|
1348
|
+
function safeSessionId(sessionId) {
|
|
1349
|
+
return encodeURIComponent(sessionId);
|
|
1350
|
+
}
|
|
1351
|
+
var FileSessionStore = class {
|
|
1352
|
+
stateDir;
|
|
1353
|
+
constructor(stateDir) {
|
|
1354
|
+
this.stateDir = stateDir;
|
|
1355
|
+
}
|
|
1356
|
+
get sessionDir() {
|
|
1357
|
+
return path.join(this.stateDir, "sessions");
|
|
1358
|
+
}
|
|
1359
|
+
filePath(sessionId) {
|
|
1360
|
+
return path.join(this.sessionDir, `${safeSessionId(sessionId)}.json`);
|
|
1361
|
+
}
|
|
1362
|
+
async ensureDir() {
|
|
1363
|
+
await fs.mkdir(this.sessionDir, { recursive: true });
|
|
1364
|
+
}
|
|
1365
|
+
async load(sessionId) {
|
|
1366
|
+
await this.ensureDir();
|
|
1367
|
+
let payload;
|
|
1368
|
+
try {
|
|
1369
|
+
payload = await fs.readFile(this.filePath(sessionId), "utf8");
|
|
1370
|
+
} catch (error) {
|
|
1371
|
+
if (error.code === "ENOENT") return;
|
|
1372
|
+
throw error;
|
|
1373
|
+
}
|
|
1374
|
+
let parsed;
|
|
1375
|
+
try {
|
|
1376
|
+
parsed = JSON.parse(payload);
|
|
1377
|
+
} catch {
|
|
1378
|
+
return;
|
|
1379
|
+
}
|
|
1380
|
+
return parseSessionRecord(parsed) ?? void 0;
|
|
1381
|
+
}
|
|
1382
|
+
async save(record) {
|
|
1383
|
+
await this.ensureDir();
|
|
1384
|
+
const persisted = serializeSessionRecordForDisk(record);
|
|
1385
|
+
assertPersistedKeyPolicy(persisted);
|
|
1386
|
+
const file = this.filePath(record.acpxRecordId);
|
|
1387
|
+
const tempFile = `${file}.${process.pid}.${Date.now()}.tmp`;
|
|
1388
|
+
const payload = JSON.stringify(persisted, null, 2);
|
|
1389
|
+
await fs.writeFile(tempFile, `${payload}\n`, "utf8");
|
|
1390
|
+
await fs.rename(tempFile, file);
|
|
1391
|
+
}
|
|
1392
|
+
};
|
|
1393
|
+
function createFileSessionStore(options) {
|
|
1394
|
+
return new FileSessionStore(path.resolve(options.stateDir));
|
|
1395
|
+
}
|
|
1396
|
+
//#endregion
|
|
1397
|
+
//#region src/runtime/public/handle-state.ts
|
|
1398
|
+
const ACPX_RUNTIME_HANDLE_PREFIX = "acpx:v2:";
|
|
1399
|
+
function encodeAcpxRuntimeHandleState(state) {
|
|
1400
|
+
return `${ACPX_RUNTIME_HANDLE_PREFIX}${Buffer.from(JSON.stringify(state), "utf8").toString("base64url")}`;
|
|
1401
|
+
}
|
|
1402
|
+
function decodeAcpxRuntimeHandleState(runtimeSessionName) {
|
|
1403
|
+
const trimmed = runtimeSessionName.trim();
|
|
1404
|
+
if (!trimmed.startsWith(ACPX_RUNTIME_HANDLE_PREFIX)) return null;
|
|
1405
|
+
try {
|
|
1406
|
+
const raw = Buffer.from(trimmed.slice(8), "base64url").toString("utf8");
|
|
1407
|
+
const parsed = JSON.parse(raw);
|
|
1408
|
+
const name = asOptionalString(parsed.name);
|
|
1409
|
+
const agent = asOptionalString(parsed.agent);
|
|
1410
|
+
const cwd = asOptionalString(parsed.cwd);
|
|
1411
|
+
const mode = asOptionalString(parsed.mode);
|
|
1412
|
+
if (!name || !agent || !cwd || mode !== "persistent" && mode !== "oneshot") return null;
|
|
1413
|
+
return {
|
|
1414
|
+
name,
|
|
1415
|
+
agent,
|
|
1416
|
+
cwd,
|
|
1417
|
+
mode,
|
|
1418
|
+
acpxRecordId: asOptionalString(parsed.acpxRecordId),
|
|
1419
|
+
backendSessionId: asOptionalString(parsed.backendSessionId),
|
|
1420
|
+
agentSessionId: asOptionalString(parsed.agentSessionId)
|
|
1421
|
+
};
|
|
1422
|
+
} catch {
|
|
1423
|
+
return null;
|
|
1424
|
+
}
|
|
1425
|
+
}
|
|
1426
|
+
function writeHandleState(handle, state) {
|
|
1427
|
+
handle.runtimeSessionName = encodeAcpxRuntimeHandleState(state);
|
|
1428
|
+
handle.cwd = state.cwd;
|
|
1429
|
+
handle.acpxRecordId = state.acpxRecordId;
|
|
1430
|
+
handle.backendSessionId = state.backendSessionId;
|
|
1431
|
+
handle.agentSessionId = state.agentSessionId;
|
|
1432
|
+
}
|
|
1433
|
+
//#endregion
|
|
1434
|
+
//#region src/runtime/public/probe.ts
|
|
1435
|
+
function isPrimitiveDetail(value) {
|
|
1436
|
+
return value == null || typeof value === "number" || typeof value === "boolean" || typeof value === "bigint" || typeof value === "symbol";
|
|
1437
|
+
}
|
|
1438
|
+
function formatFunctionDetail(value) {
|
|
1439
|
+
return value.name ? `[Function ${value.name}]` : "[Function]";
|
|
1440
|
+
}
|
|
1441
|
+
function serializeRuntimeDetail(value) {
|
|
1442
|
+
const seen = /* @__PURE__ */ new WeakSet();
|
|
1443
|
+
return JSON.stringify(value, (_key, nested) => {
|
|
1444
|
+
if (nested instanceof Error) return nested.message || nested.name;
|
|
1445
|
+
if (nested && typeof nested === "object") {
|
|
1446
|
+
if (seen.has(nested)) return "[Circular]";
|
|
1447
|
+
seen.add(nested);
|
|
1448
|
+
}
|
|
1449
|
+
return nested;
|
|
1450
|
+
}) ?? "undefined";
|
|
1451
|
+
}
|
|
1452
|
+
function formatRuntimeDetail(value) {
|
|
1453
|
+
if (value instanceof Error) return value.message || value.name;
|
|
1454
|
+
if (typeof value === "string") return value;
|
|
1455
|
+
if (isPrimitiveDetail(value)) return String(value);
|
|
1456
|
+
if (typeof value === "function") return formatFunctionDetail(value);
|
|
1457
|
+
try {
|
|
1458
|
+
return serializeRuntimeDetail(value);
|
|
1459
|
+
} catch {
|
|
1460
|
+
return "unserializable object";
|
|
1461
|
+
}
|
|
1462
|
+
}
|
|
1463
|
+
function normalizeRuntimeDetails(details) {
|
|
1464
|
+
return details?.map((detail) => formatRuntimeDetail(detail));
|
|
1465
|
+
}
|
|
1466
|
+
async function probeRuntime(options, deps = {}) {
|
|
1467
|
+
const agentName = options.probeAgent?.trim() || "codex";
|
|
1468
|
+
const agentCommand = options.agentRegistry.resolve(agentName);
|
|
1469
|
+
const client = createProbeClient(options, agentCommand, deps);
|
|
1470
|
+
try {
|
|
1471
|
+
await client.start();
|
|
1472
|
+
return {
|
|
1473
|
+
ok: true,
|
|
1474
|
+
message: "embedded ACP runtime ready",
|
|
1475
|
+
details: [
|
|
1476
|
+
`agent=${agentName}`,
|
|
1477
|
+
`command=${agentCommand}`,
|
|
1478
|
+
`cwd=${options.cwd}`,
|
|
1479
|
+
...client.initializeResult?.protocolVersion ? [`protocolVersion=${client.initializeResult.protocolVersion}`] : []
|
|
1480
|
+
]
|
|
1481
|
+
};
|
|
1482
|
+
} catch (error) {
|
|
1483
|
+
return {
|
|
1484
|
+
ok: false,
|
|
1485
|
+
message: "embedded ACP runtime probe failed",
|
|
1486
|
+
details: [
|
|
1487
|
+
`agent=${agentName}`,
|
|
1488
|
+
`command=${agentCommand}`,
|
|
1489
|
+
`cwd=${options.cwd}`,
|
|
1490
|
+
formatRuntimeDetail(error)
|
|
1491
|
+
]
|
|
1492
|
+
};
|
|
1493
|
+
} finally {
|
|
1494
|
+
await client.close().catch(() => {});
|
|
1495
|
+
}
|
|
1496
|
+
}
|
|
1497
|
+
function createProbeClient(options, agentCommand, deps) {
|
|
1498
|
+
const clientOptions = {
|
|
1499
|
+
agentCommand,
|
|
1500
|
+
cwd: options.cwd,
|
|
1501
|
+
mcpServers: [...options.mcpServers ?? []],
|
|
1502
|
+
permissionMode: options.permissionMode,
|
|
1503
|
+
nonInteractivePermissions: options.nonInteractivePermissions,
|
|
1504
|
+
verbose: options.verbose
|
|
1505
|
+
};
|
|
1506
|
+
return deps.clientFactory?.(clientOptions) ?? new AcpClient(clientOptions);
|
|
1507
|
+
}
|
|
1508
|
+
//#endregion
|
|
1509
|
+
//#region src/runtime.ts
|
|
1510
|
+
const ACPX_BACKEND_ID = "acpx";
|
|
1511
|
+
const ACPX_CAPABILITIES = { controls: [
|
|
1512
|
+
"session/set_mode",
|
|
1513
|
+
"session/set_config_option",
|
|
1514
|
+
"session/status"
|
|
1515
|
+
] };
|
|
1516
|
+
function createAgentRegistry(params) {
|
|
1517
|
+
return {
|
|
1518
|
+
resolve(agentName) {
|
|
1519
|
+
return resolveAgentCommand(agentName, params?.overrides);
|
|
1520
|
+
},
|
|
1521
|
+
list() {
|
|
1522
|
+
return listBuiltInAgents(params?.overrides);
|
|
1523
|
+
}
|
|
1524
|
+
};
|
|
1525
|
+
}
|
|
1526
|
+
var AcpxRuntime = class {
|
|
1527
|
+
options;
|
|
1528
|
+
testOptions;
|
|
1529
|
+
healthy = false;
|
|
1530
|
+
manager = null;
|
|
1531
|
+
managerPromise = null;
|
|
1532
|
+
constructor(options, testOptions) {
|
|
1533
|
+
this.options = options;
|
|
1534
|
+
this.testOptions = testOptions;
|
|
1535
|
+
}
|
|
1536
|
+
isHealthy() {
|
|
1537
|
+
return this.healthy;
|
|
1538
|
+
}
|
|
1539
|
+
async probeAvailability() {
|
|
1540
|
+
const report = await this.runProbe();
|
|
1541
|
+
this.healthy = report.ok;
|
|
1542
|
+
}
|
|
1543
|
+
async doctor() {
|
|
1544
|
+
const report = await this.runProbe();
|
|
1545
|
+
this.healthy = report.ok;
|
|
1546
|
+
return {
|
|
1547
|
+
ok: report.ok,
|
|
1548
|
+
code: report.ok ? void 0 : "ACP_BACKEND_UNAVAILABLE",
|
|
1549
|
+
message: report.message,
|
|
1550
|
+
details: normalizeRuntimeDetails(report.details)
|
|
1551
|
+
};
|
|
1552
|
+
}
|
|
1553
|
+
async ensureSession(input) {
|
|
1554
|
+
const sessionName = input.sessionKey.trim();
|
|
1555
|
+
if (!sessionName) throw new AcpRuntimeError("ACP_SESSION_INIT_FAILED", "ACP session key is required.");
|
|
1556
|
+
const agent = input.agent.trim();
|
|
1557
|
+
if (!agent) throw new AcpRuntimeError("ACP_SESSION_INIT_FAILED", "ACP agent id is required.");
|
|
1558
|
+
const record = await (await this.getManager()).ensureSession({
|
|
1559
|
+
sessionKey: sessionName,
|
|
1560
|
+
agent,
|
|
1561
|
+
mode: input.mode,
|
|
1562
|
+
cwd: input.cwd ?? this.options.cwd,
|
|
1563
|
+
resumeSessionId: input.resumeSessionId,
|
|
1564
|
+
sessionOptions: input.sessionOptions
|
|
1565
|
+
});
|
|
1566
|
+
const handle = {
|
|
1567
|
+
sessionKey: input.sessionKey,
|
|
1568
|
+
backend: ACPX_BACKEND_ID,
|
|
1569
|
+
runtimeSessionName: "",
|
|
1570
|
+
cwd: record.cwd,
|
|
1571
|
+
acpxRecordId: record.acpxRecordId,
|
|
1572
|
+
backendSessionId: record.acpSessionId,
|
|
1573
|
+
agentSessionId: record.agentSessionId
|
|
1574
|
+
};
|
|
1575
|
+
writeHandleState(handle, {
|
|
1576
|
+
name: sessionName,
|
|
1577
|
+
agent,
|
|
1578
|
+
cwd: record.cwd,
|
|
1579
|
+
mode: input.mode,
|
|
1580
|
+
acpxRecordId: record.acpxRecordId,
|
|
1581
|
+
backendSessionId: record.acpSessionId,
|
|
1582
|
+
agentSessionId: record.agentSessionId
|
|
1583
|
+
});
|
|
1584
|
+
return handle;
|
|
1585
|
+
}
|
|
1586
|
+
startTurn(input) {
|
|
1587
|
+
const { handle, state } = this.resolveManagerHandle(input.handle);
|
|
1588
|
+
const turnPromise = this.getManager().then((manager) => manager.startTurn({
|
|
1589
|
+
handle,
|
|
1590
|
+
text: input.text,
|
|
1591
|
+
onTerminalSessionFailure: input.onTerminalSessionFailure,
|
|
1592
|
+
attachments: input.attachments,
|
|
1593
|
+
mode: input.mode,
|
|
1594
|
+
sessionMode: state.mode,
|
|
1595
|
+
requestId: input.requestId,
|
|
1596
|
+
timeoutMs: input.timeoutMs,
|
|
1597
|
+
signal: input.signal
|
|
1598
|
+
}));
|
|
1599
|
+
return {
|
|
1600
|
+
requestId: input.requestId,
|
|
1601
|
+
events: { async *[Symbol.asyncIterator]() {
|
|
1602
|
+
yield* (await turnPromise).events;
|
|
1603
|
+
} },
|
|
1604
|
+
get result() {
|
|
1605
|
+
return turnPromise.then((turn) => turn.result);
|
|
1606
|
+
},
|
|
1607
|
+
cancel(inputArgs) {
|
|
1608
|
+
return turnPromise.then((turn) => turn.cancel(inputArgs));
|
|
1609
|
+
},
|
|
1610
|
+
closeStream(inputArgs) {
|
|
1611
|
+
return turnPromise.then((turn) => turn.closeStream(inputArgs));
|
|
1612
|
+
}
|
|
1613
|
+
};
|
|
1614
|
+
}
|
|
1615
|
+
async *runTurn(input) {
|
|
1616
|
+
const { handle, state } = this.resolveManagerHandle(input.handle);
|
|
1617
|
+
yield* (await this.getManager()).runTurn({
|
|
1618
|
+
handle,
|
|
1619
|
+
text: input.text,
|
|
1620
|
+
onTerminalSessionFailure: input.onTerminalSessionFailure,
|
|
1621
|
+
attachments: input.attachments,
|
|
1622
|
+
mode: input.mode,
|
|
1623
|
+
sessionMode: state.mode,
|
|
1624
|
+
requestId: input.requestId,
|
|
1625
|
+
timeoutMs: input.timeoutMs,
|
|
1626
|
+
signal: input.signal
|
|
1627
|
+
});
|
|
1628
|
+
}
|
|
1629
|
+
async getCapabilities(input) {
|
|
1630
|
+
if (!input?.handle) return ACPX_CAPABILITIES;
|
|
1631
|
+
const { handle } = this.resolveManagerHandle(input.handle);
|
|
1632
|
+
const record = await this.options.sessionStore.load(handle.acpxRecordId ?? handle.sessionKey);
|
|
1633
|
+
if (!record?.acpx?.config_options) return ACPX_CAPABILITIES;
|
|
1634
|
+
const configOptionKeys = Array.from(new Set(record.acpx.config_options.map((option) => option.id).filter((id) => typeof id === "string" && id.trim().length > 0)));
|
|
1635
|
+
return {
|
|
1636
|
+
...ACPX_CAPABILITIES,
|
|
1637
|
+
...configOptionKeys.length > 0 ? { configOptionKeys } : {}
|
|
1638
|
+
};
|
|
1639
|
+
}
|
|
1640
|
+
async getStatus(input) {
|
|
1641
|
+
const { handle } = this.resolveManagerHandle(input.handle);
|
|
1642
|
+
return await (await this.getManager()).getStatus(handle);
|
|
1643
|
+
}
|
|
1644
|
+
async setMode(input) {
|
|
1645
|
+
const { handle, state } = this.resolveManagerHandle(input.handle);
|
|
1646
|
+
await (await this.getManager()).setMode(handle, input.mode, state.mode);
|
|
1647
|
+
}
|
|
1648
|
+
async setConfigOption(input) {
|
|
1649
|
+
const { handle, state } = this.resolveManagerHandle(input.handle);
|
|
1650
|
+
await (await this.getManager()).setConfigOption(handle, input.key, input.value, state.mode);
|
|
1651
|
+
}
|
|
1652
|
+
async cancel(input) {
|
|
1653
|
+
const { handle } = this.resolveManagerHandle(input.handle);
|
|
1654
|
+
await (await this.getManager()).cancel(handle);
|
|
1655
|
+
}
|
|
1656
|
+
async close(input) {
|
|
1657
|
+
const { handle } = this.resolveManagerHandle(input.handle);
|
|
1658
|
+
await (await this.getManager()).close(handle, { discardPersistentState: input.discardPersistentState });
|
|
1659
|
+
}
|
|
1660
|
+
async getManager() {
|
|
1661
|
+
if (this.manager) return this.manager;
|
|
1662
|
+
if (!this.managerPromise) this.managerPromise = Promise.resolve(this.testOptions?.managerFactory?.(this.options) ?? new AcpRuntimeManager(this.options)).then((manager) => {
|
|
1663
|
+
this.manager = manager;
|
|
1664
|
+
return manager;
|
|
1665
|
+
});
|
|
1666
|
+
return await this.managerPromise;
|
|
1667
|
+
}
|
|
1668
|
+
async runProbe() {
|
|
1669
|
+
return await (this.testOptions?.probeRunner?.(this.options) ?? probeRuntime(this.options));
|
|
1670
|
+
}
|
|
1671
|
+
resolveManagerHandle(handle) {
|
|
1672
|
+
const state = this.resolveHandleState(handle);
|
|
1673
|
+
return {
|
|
1674
|
+
handle: {
|
|
1675
|
+
...handle,
|
|
1676
|
+
acpxRecordId: state.acpxRecordId ?? handle.acpxRecordId ?? handle.sessionKey
|
|
1677
|
+
},
|
|
1678
|
+
state
|
|
1679
|
+
};
|
|
1680
|
+
}
|
|
1681
|
+
resolveHandleState(handle) {
|
|
1682
|
+
const decoded = decodeAcpxRuntimeHandleState(handle.runtimeSessionName);
|
|
1683
|
+
if (decoded) return {
|
|
1684
|
+
...decoded,
|
|
1685
|
+
acpxRecordId: decoded.acpxRecordId ?? handle.acpxRecordId,
|
|
1686
|
+
backendSessionId: decoded.backendSessionId ?? handle.backendSessionId,
|
|
1687
|
+
agentSessionId: decoded.agentSessionId ?? handle.agentSessionId
|
|
1688
|
+
};
|
|
1689
|
+
const runtimeSessionName = handle.runtimeSessionName.trim();
|
|
1690
|
+
if (!runtimeSessionName) throw new AcpRuntimeError("ACP_SESSION_INIT_FAILED", "Invalid embedded ACP runtime handle: runtimeSessionName is missing.");
|
|
1691
|
+
return {
|
|
1692
|
+
name: runtimeSessionName,
|
|
1693
|
+
agent: deriveAgentFromSessionKey(handle.sessionKey, DEFAULT_AGENT_NAME),
|
|
1694
|
+
cwd: handle.cwd ?? this.options.cwd,
|
|
1695
|
+
mode: "persistent",
|
|
1696
|
+
acpxRecordId: handle.acpxRecordId,
|
|
1697
|
+
backendSessionId: handle.backendSessionId,
|
|
1698
|
+
agentSessionId: handle.agentSessionId
|
|
1699
|
+
};
|
|
1700
|
+
}
|
|
1701
|
+
};
|
|
1702
|
+
function createAcpRuntime(options) {
|
|
1703
|
+
return new AcpxRuntime(options);
|
|
1704
|
+
}
|
|
1705
|
+
function createRuntimeStore(options) {
|
|
1706
|
+
return createFileSessionStore(options);
|
|
1707
|
+
}
|
|
1708
|
+
//#endregion
|
|
1709
|
+
export { ACPX_BACKEND_ID, AcpRuntimeError, AcpxRuntime, DEFAULT_AGENT_NAME, REQUESTED_MODEL_UNSUPPORTED_ERROR_CODE, REQUESTED_MODEL_UNSUPPORTED_REASONS, RequestedModelUnsupportedError, createAcpRuntime, createAgentRegistry, createFileSessionStore, createRuntimeStore, decodeAcpxRuntimeHandleState, encodeAcpxRuntimeHandleState, isAcpRuntimeError, isRequestedModelUnsupportedError };
|
|
1710
|
+
|
|
1711
|
+
//# sourceMappingURL=runtime.js.map
|