@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,1920 @@
|
|
|
1
|
+
import { d as createSessionWithClient, f as cancelSessionPrompt, o as runOnce, s as sendSessionDirect, t as createOutputFormatter } from "./output-CjdF5rHk.js";
|
|
2
|
+
import { Ct as promptToDisplayText, Dt as withInterrupt, Et as TimeoutError, Jt as SESSION_RECORD_SCHEMA, Kt as PERMISSION_MODES, Ot as withTimeout, Tt as InterruptedError, Y as resolveSessionRecord, _ as createSessionConversation, b as recordSessionUpdate, h as cloneSessionAcpxState, ut as defaultSessionEventLog, v as recordClientOperation, wt as textPrompt, y as recordPromptSubmission } from "./live-checkpoint-ClPCSdrW.js";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import fs from "node:fs/promises";
|
|
5
|
+
import os from "node:os";
|
|
6
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
7
|
+
import { ZodError, z } from "zod";
|
|
8
|
+
import { spawn } from "node:child_process";
|
|
9
|
+
//#region src/flows/authoring.ts
|
|
10
|
+
const FLOW_DEFINITION_BRAND = Symbol.for("acpx.flow.definition");
|
|
11
|
+
function markDefinedFlow(definition) {
|
|
12
|
+
if (isDefinedFlow(definition)) return definition;
|
|
13
|
+
Object.defineProperty(definition, FLOW_DEFINITION_BRAND, {
|
|
14
|
+
value: true,
|
|
15
|
+
enumerable: false,
|
|
16
|
+
configurable: false,
|
|
17
|
+
writable: false
|
|
18
|
+
});
|
|
19
|
+
return definition;
|
|
20
|
+
}
|
|
21
|
+
function isDefinedFlow(value) {
|
|
22
|
+
return value != null && typeof value === "object" && value[FLOW_DEFINITION_BRAND] === true;
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/flows/schema.ts
|
|
26
|
+
const FLOW_NODE_TYPES = [
|
|
27
|
+
"acp",
|
|
28
|
+
"compute",
|
|
29
|
+
"action",
|
|
30
|
+
"checkpoint"
|
|
31
|
+
];
|
|
32
|
+
const finiteNonNegativeNumberSchema = z.number().finite().nonnegative();
|
|
33
|
+
const nonEmptyTrimmedStringSchema = z.string().refine((value) => value.trim().length > 0, { message: "must not be empty" });
|
|
34
|
+
function extensibleObject(shape) {
|
|
35
|
+
return z.object(shape).passthrough();
|
|
36
|
+
}
|
|
37
|
+
function functionSchema(label) {
|
|
38
|
+
return z.custom((value) => typeof value === "function", { message: `${label} must be a function` });
|
|
39
|
+
}
|
|
40
|
+
const flowNodeCommonShape = {
|
|
41
|
+
timeoutMs: finiteNonNegativeNumberSchema.optional(),
|
|
42
|
+
heartbeatMs: finiteNonNegativeNumberSchema.optional(),
|
|
43
|
+
statusDetail: z.string().optional()
|
|
44
|
+
};
|
|
45
|
+
const flowPermissionRequirementsSchema = extensibleObject({
|
|
46
|
+
requiredMode: z.enum(PERMISSION_MODES),
|
|
47
|
+
requireExplicitGrant: z.boolean().optional(),
|
|
48
|
+
reason: nonEmptyTrimmedStringSchema.optional()
|
|
49
|
+
});
|
|
50
|
+
const flowRunDefinitionSchema = extensibleObject({ title: z.union([z.string(), functionSchema("run.title")]).optional() });
|
|
51
|
+
const acpSessionSchema = extensibleObject({
|
|
52
|
+
handle: z.string().optional(),
|
|
53
|
+
isolated: z.boolean().optional()
|
|
54
|
+
});
|
|
55
|
+
const acpNodeSchema = extensibleObject({
|
|
56
|
+
...flowNodeCommonShape,
|
|
57
|
+
nodeType: z.literal("acp"),
|
|
58
|
+
profile: z.string().optional(),
|
|
59
|
+
cwd: z.union([z.string(), functionSchema("cwd")]).optional(),
|
|
60
|
+
session: acpSessionSchema.optional(),
|
|
61
|
+
prompt: functionSchema("prompt"),
|
|
62
|
+
parse: functionSchema("parse").optional()
|
|
63
|
+
});
|
|
64
|
+
const computeNodeSchema = extensibleObject({
|
|
65
|
+
...flowNodeCommonShape,
|
|
66
|
+
nodeType: z.literal("compute"),
|
|
67
|
+
run: functionSchema("run")
|
|
68
|
+
});
|
|
69
|
+
const functionActionNodeSchema = extensibleObject({
|
|
70
|
+
...flowNodeCommonShape,
|
|
71
|
+
nodeType: z.literal("action"),
|
|
72
|
+
run: functionSchema("run")
|
|
73
|
+
});
|
|
74
|
+
const shellActionNodeSchema = extensibleObject({
|
|
75
|
+
...flowNodeCommonShape,
|
|
76
|
+
nodeType: z.literal("action"),
|
|
77
|
+
exec: functionSchema("exec"),
|
|
78
|
+
parse: functionSchema("parse").optional()
|
|
79
|
+
}).refine((node) => !hasOwn(node, "run"), { message: "shell action nodes must not define run" });
|
|
80
|
+
const checkpointNodeSchema = extensibleObject({
|
|
81
|
+
...flowNodeCommonShape,
|
|
82
|
+
nodeType: z.literal("checkpoint"),
|
|
83
|
+
summary: z.string().optional(),
|
|
84
|
+
run: functionSchema("run").optional()
|
|
85
|
+
});
|
|
86
|
+
const directFlowEdgeSchema = extensibleObject({
|
|
87
|
+
from: z.string(),
|
|
88
|
+
to: z.string()
|
|
89
|
+
});
|
|
90
|
+
const switchFlowEdgeSchema = extensibleObject({
|
|
91
|
+
from: z.string(),
|
|
92
|
+
switch: extensibleObject({
|
|
93
|
+
on: z.string(),
|
|
94
|
+
cases: z.record(z.string(), z.string())
|
|
95
|
+
})
|
|
96
|
+
});
|
|
97
|
+
const flowDefinitionSchema = extensibleObject({
|
|
98
|
+
name: nonEmptyTrimmedStringSchema,
|
|
99
|
+
run: flowRunDefinitionSchema.optional(),
|
|
100
|
+
permissions: flowPermissionRequirementsSchema.optional(),
|
|
101
|
+
startAt: z.string(),
|
|
102
|
+
nodes: z.record(z.string(), z.unknown()),
|
|
103
|
+
edges: z.array(z.unknown())
|
|
104
|
+
});
|
|
105
|
+
const flowNodeTypeSchema = z.object({ nodeType: z.enum(FLOW_NODE_TYPES) });
|
|
106
|
+
function assertValidFlowDefinitionShape(flow) {
|
|
107
|
+
const parsed = parseWithSchema("flow definition", flowDefinitionSchema, flow);
|
|
108
|
+
for (const [nodeId, node] of Object.entries(parsed.nodes)) assertValidFlowNodeDefinitionShape(node, `flow node "${nodeId}"`);
|
|
109
|
+
parsed.edges.forEach((edge, index) => {
|
|
110
|
+
assertValidFlowEdgeShape(edge, `flow definition: edges.${index}`);
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
function assertValidAcpNodeDefinition(node) {
|
|
114
|
+
parseWithSchema("acp node definition", acpNodeSchema, node);
|
|
115
|
+
}
|
|
116
|
+
function assertValidComputeNodeDefinition(node) {
|
|
117
|
+
parseWithSchema("compute node definition", computeNodeSchema, node);
|
|
118
|
+
}
|
|
119
|
+
function assertValidActionNodeDefinition(node) {
|
|
120
|
+
assertValidActionNodeDefinitionShape(node, "action node definition");
|
|
121
|
+
}
|
|
122
|
+
function assertValidShellActionNodeDefinition(node) {
|
|
123
|
+
parseWithSchema("shell action node definition", shellActionNodeSchema, node);
|
|
124
|
+
}
|
|
125
|
+
function assertValidCheckpointNodeDefinition(node) {
|
|
126
|
+
parseWithSchema("checkpoint node definition", checkpointNodeSchema, node);
|
|
127
|
+
}
|
|
128
|
+
function assertValidFlowNodeDefinitionShape(node, label) {
|
|
129
|
+
const { nodeType } = parseWithSchema(label, flowNodeTypeSchema, node);
|
|
130
|
+
switch (nodeType) {
|
|
131
|
+
case "acp":
|
|
132
|
+
parseWithSchema(label, acpNodeSchema, node);
|
|
133
|
+
return;
|
|
134
|
+
case "compute":
|
|
135
|
+
parseWithSchema(label, computeNodeSchema, node);
|
|
136
|
+
return;
|
|
137
|
+
case "action":
|
|
138
|
+
assertValidActionNodeDefinitionShape(node, label);
|
|
139
|
+
return;
|
|
140
|
+
case "checkpoint":
|
|
141
|
+
parseWithSchema(label, checkpointNodeSchema, node);
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
function assertValidActionNodeDefinitionShape(node, label) {
|
|
146
|
+
const hasRun = hasOwn(node, "run");
|
|
147
|
+
const hasExec = hasOwn(node, "exec");
|
|
148
|
+
if (hasRun === hasExec) throw new Error(`Invalid ${label}: action nodes must define exactly one of run or exec`);
|
|
149
|
+
if (hasExec) {
|
|
150
|
+
parseWithSchema(label, shellActionNodeSchema, node);
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
parseWithSchema(label, functionActionNodeSchema, node);
|
|
154
|
+
}
|
|
155
|
+
function assertValidFlowEdgeShape(edge, label) {
|
|
156
|
+
const hasTo = hasOwn(edge, "to");
|
|
157
|
+
if (hasTo === hasOwn(edge, "switch")) throw new Error(`Invalid ${label}: edge must define exactly one of to or switch`);
|
|
158
|
+
if (hasTo) {
|
|
159
|
+
parseWithSchema(label, directFlowEdgeSchema, edge);
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
parseWithSchema(label, switchFlowEdgeSchema, edge);
|
|
163
|
+
}
|
|
164
|
+
function parseWithSchema(label, schema, value) {
|
|
165
|
+
try {
|
|
166
|
+
return schema.parse(value);
|
|
167
|
+
} catch (error) {
|
|
168
|
+
if (error instanceof ZodError) throw new Error(formatValidationError(label, error), { cause: error });
|
|
169
|
+
throw error;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
function formatValidationError(label, error) {
|
|
173
|
+
return `Invalid ${label}: ${Array.from(new Set(error.issues.flatMap((issue) => formatIssue(issue)))).join("; ")}`;
|
|
174
|
+
}
|
|
175
|
+
function formatIssue(issue, parentPath = []) {
|
|
176
|
+
const path = [...parentPath, ...issue.path.map(String)];
|
|
177
|
+
if (issue.code === "invalid_union") return issue.errors.flatMap((branch) => branch.flatMap((nestedIssue) => formatIssue(nestedIssue, path)));
|
|
178
|
+
const renderedPath = path.join(".");
|
|
179
|
+
return [renderedPath ? `${renderedPath}: ${issue.message}` : issue.message];
|
|
180
|
+
}
|
|
181
|
+
function hasOwn(value, key) {
|
|
182
|
+
return value != null && typeof value === "object" && Object.prototype.hasOwnProperty.call(value, key);
|
|
183
|
+
}
|
|
184
|
+
//#endregion
|
|
185
|
+
//#region src/flows/definition.ts
|
|
186
|
+
function defineFlow(definition) {
|
|
187
|
+
assertValidFlowDefinitionShape(definition);
|
|
188
|
+
return markDefinedFlow(definition);
|
|
189
|
+
}
|
|
190
|
+
function acp(definition) {
|
|
191
|
+
const node = {
|
|
192
|
+
nodeType: "acp",
|
|
193
|
+
...definition
|
|
194
|
+
};
|
|
195
|
+
assertValidAcpNodeDefinition(node);
|
|
196
|
+
return node;
|
|
197
|
+
}
|
|
198
|
+
function compute(definition) {
|
|
199
|
+
const node = {
|
|
200
|
+
nodeType: "compute",
|
|
201
|
+
...definition
|
|
202
|
+
};
|
|
203
|
+
assertValidComputeNodeDefinition(node);
|
|
204
|
+
return node;
|
|
205
|
+
}
|
|
206
|
+
function action(definition) {
|
|
207
|
+
const node = {
|
|
208
|
+
nodeType: "action",
|
|
209
|
+
...definition
|
|
210
|
+
};
|
|
211
|
+
assertValidActionNodeDefinition(node);
|
|
212
|
+
return node;
|
|
213
|
+
}
|
|
214
|
+
function shell(definition) {
|
|
215
|
+
const node = {
|
|
216
|
+
nodeType: "action",
|
|
217
|
+
...definition
|
|
218
|
+
};
|
|
219
|
+
assertValidShellActionNodeDefinition(node);
|
|
220
|
+
return node;
|
|
221
|
+
}
|
|
222
|
+
function checkpoint(definition = {}) {
|
|
223
|
+
const node = {
|
|
224
|
+
nodeType: "checkpoint",
|
|
225
|
+
...definition
|
|
226
|
+
};
|
|
227
|
+
assertValidCheckpointNodeDefinition(node);
|
|
228
|
+
return node;
|
|
229
|
+
}
|
|
230
|
+
//#endregion
|
|
231
|
+
//#region src/flows/executors/shell.ts
|
|
232
|
+
function formatShellActionSummary(spec) {
|
|
233
|
+
return `shell: ${renderShellCommand(spec.command, spec.args ?? [])}`;
|
|
234
|
+
}
|
|
235
|
+
function renderShellCommand(command, args) {
|
|
236
|
+
const renderedArgs = args.map((arg) => JSON.stringify(arg)).join(" ");
|
|
237
|
+
return renderedArgs.length > 0 ? `${command} ${renderedArgs}` : command;
|
|
238
|
+
}
|
|
239
|
+
function createShellFailureError(spec, args, exitCode, signal, stderr) {
|
|
240
|
+
const status = signal ? `signal ${signal}` : `exit ${String(exitCode)}`;
|
|
241
|
+
const details = stderr.length > 0 ? `\n${stderr.trim()}` : "";
|
|
242
|
+
return /* @__PURE__ */ new Error(`Shell action failed (${renderShellCommand(spec.command, args)}): ${status}${details}`);
|
|
243
|
+
}
|
|
244
|
+
function rejectIfShellFailed(spec, args, result, timedOut) {
|
|
245
|
+
if (timedOut) return new TimeoutError(spec.timeoutMs ?? 0);
|
|
246
|
+
if (((result.exitCode ?? 0) !== 0 || result.signal != null) && spec.allowNonZeroExit !== true) return createShellFailureError(spec, args, result.exitCode, result.signal, result.stderr);
|
|
247
|
+
}
|
|
248
|
+
async function runShellAction(spec) {
|
|
249
|
+
const cwd = spec.cwd ?? process.cwd();
|
|
250
|
+
const args = spec.args ?? [];
|
|
251
|
+
const startMs = Date.now();
|
|
252
|
+
const child = spawn(spec.command, args, {
|
|
253
|
+
cwd,
|
|
254
|
+
env: {
|
|
255
|
+
...process.env,
|
|
256
|
+
...spec.env
|
|
257
|
+
},
|
|
258
|
+
shell: spec.shell,
|
|
259
|
+
stdio: [
|
|
260
|
+
"pipe",
|
|
261
|
+
"pipe",
|
|
262
|
+
"pipe"
|
|
263
|
+
],
|
|
264
|
+
windowsHide: true
|
|
265
|
+
});
|
|
266
|
+
let stdout = "";
|
|
267
|
+
let stderr = "";
|
|
268
|
+
let timedOut = false;
|
|
269
|
+
let timeout;
|
|
270
|
+
const finish = new Promise((resolve, reject) => {
|
|
271
|
+
child.stdout.setEncoding("utf8");
|
|
272
|
+
child.stderr.setEncoding("utf8");
|
|
273
|
+
child.stdout.on("data", (chunk) => {
|
|
274
|
+
stdout += chunk;
|
|
275
|
+
});
|
|
276
|
+
child.stderr.on("data", (chunk) => {
|
|
277
|
+
stderr += chunk;
|
|
278
|
+
});
|
|
279
|
+
child.once("error", reject);
|
|
280
|
+
child.once("exit", (exitCode, signal) => {
|
|
281
|
+
const result = {
|
|
282
|
+
command: spec.command,
|
|
283
|
+
args,
|
|
284
|
+
cwd,
|
|
285
|
+
stdout,
|
|
286
|
+
stderr,
|
|
287
|
+
combinedOutput: `${stdout}${stderr}`,
|
|
288
|
+
exitCode,
|
|
289
|
+
signal,
|
|
290
|
+
durationMs: Date.now() - startMs
|
|
291
|
+
};
|
|
292
|
+
const error = rejectIfShellFailed(spec, args, result, timedOut);
|
|
293
|
+
if (error) {
|
|
294
|
+
reject(error);
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
resolve(result);
|
|
298
|
+
});
|
|
299
|
+
});
|
|
300
|
+
if (spec.stdin != null) child.stdin.write(spec.stdin);
|
|
301
|
+
child.stdin.end();
|
|
302
|
+
if (spec.timeoutMs != null && spec.timeoutMs > 0) timeout = setTimeout(() => {
|
|
303
|
+
timedOut = true;
|
|
304
|
+
child.kill("SIGTERM");
|
|
305
|
+
setTimeout(() => {
|
|
306
|
+
child.kill("SIGKILL");
|
|
307
|
+
}, 1e3).unref();
|
|
308
|
+
}, spec.timeoutMs);
|
|
309
|
+
try {
|
|
310
|
+
return await finish;
|
|
311
|
+
} finally {
|
|
312
|
+
if (timeout) clearTimeout(timeout);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
//#endregion
|
|
316
|
+
//#region src/flows/graph.ts
|
|
317
|
+
function validateFlowDefinition(flow) {
|
|
318
|
+
assertValidFlowDefinitionShape(flow);
|
|
319
|
+
if (!flow.nodes[flow.startAt]) throw new Error(`Flow start node is missing: ${flow.startAt}`);
|
|
320
|
+
const outgoingEdges = /* @__PURE__ */ new Set();
|
|
321
|
+
for (const edge of flow.edges) validateFlowEdge(flow, edge, outgoingEdges);
|
|
322
|
+
}
|
|
323
|
+
function assertKnownFlowNode(flow, nodeId, description) {
|
|
324
|
+
if (!flow.nodes[nodeId]) throw new Error(`${description}: ${nodeId}`);
|
|
325
|
+
}
|
|
326
|
+
function validateFlowEdge(flow, edge, outgoingEdges) {
|
|
327
|
+
assertKnownFlowNode(flow, edge.from, "Flow edge references unknown from-node");
|
|
328
|
+
if (outgoingEdges.has(edge.from)) throw new Error(`Flow node must not declare multiple outgoing edges: ${edge.from}`);
|
|
329
|
+
outgoingEdges.add(edge.from);
|
|
330
|
+
if ("to" in edge) {
|
|
331
|
+
assertKnownFlowNode(flow, edge.to, "Flow edge references unknown to-node");
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
for (const target of Object.values(edge.switch.cases)) assertKnownFlowNode(flow, target, "Flow switch references unknown to-node");
|
|
335
|
+
}
|
|
336
|
+
function resolveNext(edges, from, output, result) {
|
|
337
|
+
const edge = edges.find((candidate) => candidate.from === from);
|
|
338
|
+
if (!edge) return null;
|
|
339
|
+
if ("to" in edge) return edge.to;
|
|
340
|
+
const value = getBySwitchPath(output, result, edge.switch.on);
|
|
341
|
+
if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") throw new Error(`Flow switch value must be scalar for ${edge.switch.on}`);
|
|
342
|
+
const next = edge.switch.cases[String(value)];
|
|
343
|
+
if (!next) throw new Error(`No flow switch case for ${edge.switch.on}=${JSON.stringify(value)}`);
|
|
344
|
+
return next;
|
|
345
|
+
}
|
|
346
|
+
function resolveNextForOutcome(edges, from, result) {
|
|
347
|
+
const edge = edges.find((candidate) => candidate.from === from);
|
|
348
|
+
if (!edge || "to" in edge) return null;
|
|
349
|
+
if (!edge.switch.on.startsWith("$result.")) return null;
|
|
350
|
+
const value = getBySwitchPath(void 0, result, edge.switch.on);
|
|
351
|
+
if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") throw new Error(`Flow switch value must be scalar for ${edge.switch.on}`);
|
|
352
|
+
const next = edge.switch.cases[String(value)];
|
|
353
|
+
if (!next) throw new Error(`No flow switch case for ${edge.switch.on}=${JSON.stringify(value)}`);
|
|
354
|
+
return next;
|
|
355
|
+
}
|
|
356
|
+
function getBySwitchPath(output, result, jsonPath) {
|
|
357
|
+
if (jsonPath.startsWith("$result.")) return getByPath(result, `$.${jsonPath.slice(8)}`);
|
|
358
|
+
if (jsonPath.startsWith("$output.")) return getByPath(output, `$.${jsonPath.slice(8)}`);
|
|
359
|
+
return getByPath(output, jsonPath);
|
|
360
|
+
}
|
|
361
|
+
function getByPath(value, jsonPath) {
|
|
362
|
+
if (!jsonPath.startsWith("$.")) throw new Error(`Unsupported JSON path: ${jsonPath}`);
|
|
363
|
+
return jsonPath.slice(2).split(".").reduce((current, key) => {
|
|
364
|
+
if (current == null || typeof current !== "object") return;
|
|
365
|
+
return current[key];
|
|
366
|
+
}, value);
|
|
367
|
+
}
|
|
368
|
+
//#endregion
|
|
369
|
+
//#region src/flows/runtime-support.ts
|
|
370
|
+
function isoNow$1() {
|
|
371
|
+
return (/* @__PURE__ */ new Date()).toISOString();
|
|
372
|
+
}
|
|
373
|
+
function persistRunFailure(store, runDir, state, error) {
|
|
374
|
+
if (state.finishedAt !== void 0 && (state.status === "failed" || state.status === "timed_out")) return Promise.resolve();
|
|
375
|
+
state.status = error instanceof TimeoutError ? "timed_out" : "failed";
|
|
376
|
+
state.updatedAt = isoNow$1();
|
|
377
|
+
state.finishedAt = state.updatedAt;
|
|
378
|
+
state.error = error instanceof Error ? error.message : String(error);
|
|
379
|
+
state.statusDetail = state.currentNode ? `Failed in ${state.currentNode}: ${state.error}` : state.error;
|
|
380
|
+
return store.writeSnapshot(runDir, state, {
|
|
381
|
+
scope: "run",
|
|
382
|
+
type: "run_failed",
|
|
383
|
+
payload: {
|
|
384
|
+
status: state.status,
|
|
385
|
+
error: state.error
|
|
386
|
+
}
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
function makeFlowNodeContext(state, input, services) {
|
|
390
|
+
return {
|
|
391
|
+
input,
|
|
392
|
+
outputs: state.outputs,
|
|
393
|
+
results: state.results,
|
|
394
|
+
state,
|
|
395
|
+
services
|
|
396
|
+
};
|
|
397
|
+
}
|
|
398
|
+
function markNodeStarted(state, nodeId, attemptId, nodeType, startedAt, detail) {
|
|
399
|
+
state.status = "running";
|
|
400
|
+
state.waitingOn = void 0;
|
|
401
|
+
state.currentNode = nodeId;
|
|
402
|
+
state.currentAttemptId = attemptId;
|
|
403
|
+
state.currentNodeType = nodeType;
|
|
404
|
+
state.currentNodeStartedAt = startedAt;
|
|
405
|
+
state.lastHeartbeatAt = startedAt;
|
|
406
|
+
state.statusDetail = detail ?? `Running ${nodeType} node ${nodeId}`;
|
|
407
|
+
}
|
|
408
|
+
function clearActiveNode(state, detail) {
|
|
409
|
+
state.currentNode = void 0;
|
|
410
|
+
state.currentAttemptId = void 0;
|
|
411
|
+
state.currentNodeType = void 0;
|
|
412
|
+
state.currentNodeStartedAt = void 0;
|
|
413
|
+
state.lastHeartbeatAt = void 0;
|
|
414
|
+
state.statusDetail = detail;
|
|
415
|
+
}
|
|
416
|
+
function updateStatusDetail(state, detail) {
|
|
417
|
+
if (!detail) return;
|
|
418
|
+
state.statusDetail = detail;
|
|
419
|
+
}
|
|
420
|
+
async function finalizeStepTrace(store, runDir, state, nodeId, attemptId, output, baseTrace) {
|
|
421
|
+
const trace = baseTrace ? structuredClone(baseTrace) : {};
|
|
422
|
+
if (output !== void 0) {
|
|
423
|
+
const inlineOutput = toInlineOutput(output);
|
|
424
|
+
if (inlineOutput !== void 0) trace.outputInline = inlineOutput;
|
|
425
|
+
else trace.outputArtifact = await store.writeArtifact(runDir, state, output, {
|
|
426
|
+
mediaType: outputArtifactMediaType(output),
|
|
427
|
+
extension: outputArtifactExtension(output),
|
|
428
|
+
nodeId,
|
|
429
|
+
attemptId
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
return Object.keys(trace).length > 0 ? trace : null;
|
|
433
|
+
}
|
|
434
|
+
function normalizePromptInput(prompt) {
|
|
435
|
+
return typeof prompt === "string" ? textPrompt(prompt) : prompt;
|
|
436
|
+
}
|
|
437
|
+
async function resolveNodeCwd(defaultCwd, cwd, context) {
|
|
438
|
+
if (typeof cwd === "function") {
|
|
439
|
+
const resolved = await cwd(context) ?? defaultCwd;
|
|
440
|
+
return path.resolve(defaultCwd, resolved);
|
|
441
|
+
}
|
|
442
|
+
return path.resolve(defaultCwd, cwd ?? defaultCwd);
|
|
443
|
+
}
|
|
444
|
+
function resolveShellActionCwd(defaultCwd, cwd) {
|
|
445
|
+
return path.resolve(defaultCwd, cwd ?? defaultCwd);
|
|
446
|
+
}
|
|
447
|
+
function summarizePrompt(promptText, explicitDetail) {
|
|
448
|
+
if (explicitDetail) return explicitDetail;
|
|
449
|
+
const line = promptText.split("\n").map((candidate) => candidate.trim()).find((candidate) => candidate.length > 0);
|
|
450
|
+
if (!line) return "Running ACP prompt";
|
|
451
|
+
return `ACP: ${line.length > 120 ? `${line.slice(0, 117)}...` : line}`;
|
|
452
|
+
}
|
|
453
|
+
function createQuietCaptureOutput() {
|
|
454
|
+
const chunks = [];
|
|
455
|
+
return {
|
|
456
|
+
formatter: createOutputFormatter("quiet", { stdout: { write(chunk) {
|
|
457
|
+
chunks.push(chunk);
|
|
458
|
+
} } }),
|
|
459
|
+
read: () => chunks.join("").trim()
|
|
460
|
+
};
|
|
461
|
+
}
|
|
462
|
+
async function resolveFlowRunTitle(flow, input, flowPath) {
|
|
463
|
+
const titleDefinition = flow.run?.title;
|
|
464
|
+
if (titleDefinition === void 0) return;
|
|
465
|
+
return normalizeFlowRunTitle(typeof titleDefinition === "function" ? await Promise.resolve(titleDefinition({
|
|
466
|
+
input,
|
|
467
|
+
flowName: flow.name,
|
|
468
|
+
flowPath
|
|
469
|
+
})) : titleDefinition);
|
|
470
|
+
}
|
|
471
|
+
function normalizeFlowRunTitle(value) {
|
|
472
|
+
const trimmed = value?.trim();
|
|
473
|
+
return trimmed ? trimmed : void 0;
|
|
474
|
+
}
|
|
475
|
+
function createRunId(flowName) {
|
|
476
|
+
return `${isoNow$1().replaceAll(":", "").replaceAll(".", "")}-${slugifyAsciiIdPart(flowName)}-${randomUUID().slice(0, 8)}`;
|
|
477
|
+
}
|
|
478
|
+
function createSessionBindingKey(agentCommand, cwd, handle) {
|
|
479
|
+
return `${agentCommand}::${cwd}::${handle}`;
|
|
480
|
+
}
|
|
481
|
+
function createSessionName(flowName, handle, cwd, runId) {
|
|
482
|
+
return `${flowName}-${handle}-${stableShortHash(cwd)}-${runId.slice(-8)}`;
|
|
483
|
+
}
|
|
484
|
+
function createSessionBundleId(handle, key) {
|
|
485
|
+
return `${slugifyAsciiIdPart(handle) || "session"}-${stableShortHash(key)}`;
|
|
486
|
+
}
|
|
487
|
+
function slugifyAsciiIdPart(value) {
|
|
488
|
+
let slug = "";
|
|
489
|
+
let lastWasSeparator = false;
|
|
490
|
+
for (const char of value) {
|
|
491
|
+
const safeChar = toLowerAsciiAlphaNumeric(char);
|
|
492
|
+
if (safeChar) {
|
|
493
|
+
slug += safeChar;
|
|
494
|
+
lastWasSeparator = false;
|
|
495
|
+
continue;
|
|
496
|
+
}
|
|
497
|
+
if (slug.length > 0 && !lastWasSeparator) {
|
|
498
|
+
slug += "-";
|
|
499
|
+
lastWasSeparator = true;
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
return lastWasSeparator ? slug.slice(0, -1) : slug;
|
|
503
|
+
}
|
|
504
|
+
function toLowerAsciiAlphaNumeric(char) {
|
|
505
|
+
const code = char.charCodeAt(0);
|
|
506
|
+
if (code >= 48 && code <= 57) return char;
|
|
507
|
+
if (code >= 65 && code <= 90) return String.fromCharCode(code + 32);
|
|
508
|
+
if (code >= 97 && code <= 122) return char;
|
|
509
|
+
return null;
|
|
510
|
+
}
|
|
511
|
+
function createIsolatedSessionBinding(flowName, runId, attemptId, profile, agent) {
|
|
512
|
+
const key = `isolated::${attemptId}`;
|
|
513
|
+
const handle = "isolated";
|
|
514
|
+
return {
|
|
515
|
+
key,
|
|
516
|
+
handle,
|
|
517
|
+
bundleId: createSessionBundleId(`${handle}-${attemptId}`, `${key}::${agent.cwd}`),
|
|
518
|
+
name: `${flowName}-${attemptId}-${runId.slice(-8)}`,
|
|
519
|
+
profile,
|
|
520
|
+
agentName: agent.agentName,
|
|
521
|
+
agentCommand: agent.agentCommand,
|
|
522
|
+
cwd: agent.cwd,
|
|
523
|
+
acpxRecordId: key,
|
|
524
|
+
acpSessionId: key
|
|
525
|
+
};
|
|
526
|
+
}
|
|
527
|
+
function createSyntheticSessionRecord(options) {
|
|
528
|
+
return {
|
|
529
|
+
schema: SESSION_RECORD_SCHEMA,
|
|
530
|
+
acpxRecordId: options.binding.acpxRecordId,
|
|
531
|
+
acpSessionId: options.binding.acpSessionId,
|
|
532
|
+
agentSessionId: options.binding.agentSessionId,
|
|
533
|
+
agentCommand: options.binding.agentCommand,
|
|
534
|
+
cwd: options.binding.cwd,
|
|
535
|
+
name: options.binding.name,
|
|
536
|
+
createdAt: options.createdAt,
|
|
537
|
+
lastUsedAt: options.updatedAt,
|
|
538
|
+
lastSeq: options.lastSeq,
|
|
539
|
+
lastRequestId: void 0,
|
|
540
|
+
eventLog: defaultSessionEventLog(options.binding.acpxRecordId),
|
|
541
|
+
closed: true,
|
|
542
|
+
closedAt: options.updatedAt,
|
|
543
|
+
title: options.conversation.title,
|
|
544
|
+
messages: options.conversation.messages,
|
|
545
|
+
updated_at: options.conversation.updated_at,
|
|
546
|
+
cumulative_token_usage: options.conversation.cumulative_token_usage,
|
|
547
|
+
cumulative_cost: options.conversation.cumulative_cost,
|
|
548
|
+
request_token_usage: options.conversation.request_token_usage,
|
|
549
|
+
acpx: options.acpxState
|
|
550
|
+
};
|
|
551
|
+
}
|
|
552
|
+
function createNodeResult(options) {
|
|
553
|
+
return {
|
|
554
|
+
attemptId: options.attemptId,
|
|
555
|
+
nodeId: options.nodeId,
|
|
556
|
+
nodeType: options.nodeType,
|
|
557
|
+
outcome: options.outcome,
|
|
558
|
+
startedAt: options.startedAt,
|
|
559
|
+
finishedAt: options.finishedAt,
|
|
560
|
+
durationMs: new Date(options.finishedAt).getTime() - new Date(options.startedAt).getTime(),
|
|
561
|
+
output: options.output,
|
|
562
|
+
error: options.error
|
|
563
|
+
};
|
|
564
|
+
}
|
|
565
|
+
function outcomeForError(error) {
|
|
566
|
+
if (error instanceof TimeoutError) return "timed_out";
|
|
567
|
+
if (error instanceof InterruptedError) return "cancelled";
|
|
568
|
+
return "failed";
|
|
569
|
+
}
|
|
570
|
+
function stableShortHash(value) {
|
|
571
|
+
return createHash("sha1").update(value).digest("hex").slice(0, 8);
|
|
572
|
+
}
|
|
573
|
+
function nextAttemptId(attemptCounts, nodeId) {
|
|
574
|
+
const next = (attemptCounts.get(nodeId) ?? 0) + 1;
|
|
575
|
+
attemptCounts.set(nodeId, next);
|
|
576
|
+
return `${nodeId}#${next}`;
|
|
577
|
+
}
|
|
578
|
+
function createNodeOutcomePayload(result, trace) {
|
|
579
|
+
return {
|
|
580
|
+
nodeType: result.nodeType,
|
|
581
|
+
outcome: result.outcome,
|
|
582
|
+
durationMs: result.durationMs,
|
|
583
|
+
error: result.error ?? null,
|
|
584
|
+
...trace
|
|
585
|
+
};
|
|
586
|
+
}
|
|
587
|
+
function attachStepTrace(error, trace) {
|
|
588
|
+
const attached = error instanceof Error ? error : new Error(typeof error === "string" ? error : String(error));
|
|
589
|
+
attached.flowStepTrace = trace;
|
|
590
|
+
return attached;
|
|
591
|
+
}
|
|
592
|
+
function extractAttachedStepTrace(error) {
|
|
593
|
+
if (!(error instanceof Error)) return;
|
|
594
|
+
return error.flowStepTrace;
|
|
595
|
+
}
|
|
596
|
+
function toInlineOutput(value) {
|
|
597
|
+
if (value == null || typeof value === "number" || typeof value === "boolean") return value;
|
|
598
|
+
if (typeof value === "string") return isInlineSerializableText(value) ? value : void 0;
|
|
599
|
+
try {
|
|
600
|
+
if (isInlineSerializableText(JSON.stringify(value))) return value;
|
|
601
|
+
} catch {
|
|
602
|
+
return;
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
function isInlineSerializableText(value) {
|
|
606
|
+
return value.length <= 200 && !value.includes("\n");
|
|
607
|
+
}
|
|
608
|
+
function outputArtifactMediaType(value) {
|
|
609
|
+
return typeof value === "string" ? "text/plain" : "application/json";
|
|
610
|
+
}
|
|
611
|
+
function outputArtifactExtension(value) {
|
|
612
|
+
return typeof value === "string" ? "txt" : "json";
|
|
613
|
+
}
|
|
614
|
+
function findConversationDeltaStart(before, after) {
|
|
615
|
+
const maxOverlap = Math.min(before.length, after.length);
|
|
616
|
+
for (let overlap = maxOverlap; overlap >= 0; overlap -= 1) {
|
|
617
|
+
let matches = true;
|
|
618
|
+
for (let index = 0; index < overlap; index += 1) {
|
|
619
|
+
const beforeMessage = before[before.length - overlap + index];
|
|
620
|
+
const afterMessage = after[index];
|
|
621
|
+
if (!deepEqualJson(beforeMessage, afterMessage)) {
|
|
622
|
+
matches = false;
|
|
623
|
+
break;
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
if (matches) return overlap;
|
|
627
|
+
}
|
|
628
|
+
return 0;
|
|
629
|
+
}
|
|
630
|
+
function deepEqualJson(left, right) {
|
|
631
|
+
return JSON.stringify(left) === JSON.stringify(right);
|
|
632
|
+
}
|
|
633
|
+
//#endregion
|
|
634
|
+
//#region src/flows/store.ts
|
|
635
|
+
const FLOW_BUNDLE_SCHEMA = "acpx.flow-run-bundle.v1";
|
|
636
|
+
const FLOW_TRACE_SCHEMA = "acpx.flow-trace-event.v1";
|
|
637
|
+
const FLOW_SNAPSHOT_SCHEMA = "acpx.flow-definition-snapshot.v1";
|
|
638
|
+
const MANIFEST_PATH = "manifest.json";
|
|
639
|
+
const FLOW_SNAPSHOT_PATH = "flow.json";
|
|
640
|
+
const TRACE_PATH = "trace.ndjson";
|
|
641
|
+
const PROJECTIONS_DIR = "projections";
|
|
642
|
+
const RUN_PROJECTION_PATH = "projections/run.json";
|
|
643
|
+
const LIVE_PROJECTION_PATH = "projections/live.json";
|
|
644
|
+
const STEPS_PROJECTION_PATH = "projections/steps.json";
|
|
645
|
+
const SESSIONS_DIR = "sessions";
|
|
646
|
+
const ARTIFACTS_DIR = "artifacts";
|
|
647
|
+
function flowRunsBaseDir(homeDir = os.homedir()) {
|
|
648
|
+
return path.join(homeDir, ".acpx", "flows", "runs");
|
|
649
|
+
}
|
|
650
|
+
var FlowRunStore = class {
|
|
651
|
+
outputRoot;
|
|
652
|
+
traceSeqByRun = /* @__PURE__ */ new Map();
|
|
653
|
+
sessionSeqByBundle = /* @__PURE__ */ new Map();
|
|
654
|
+
manifestByRun = /* @__PURE__ */ new Map();
|
|
655
|
+
appendChainByPath = /* @__PURE__ */ new Map();
|
|
656
|
+
constructor(outputRoot = flowRunsBaseDir()) {
|
|
657
|
+
this.outputRoot = outputRoot;
|
|
658
|
+
}
|
|
659
|
+
async createRunDir(runId) {
|
|
660
|
+
const runDir = path.join(this.outputRoot, runId);
|
|
661
|
+
await fs.mkdir(path.join(runDir, PROJECTIONS_DIR), { recursive: true });
|
|
662
|
+
await fs.mkdir(path.join(runDir, SESSIONS_DIR), { recursive: true });
|
|
663
|
+
await fs.mkdir(path.join(runDir, ARTIFACTS_DIR), { recursive: true });
|
|
664
|
+
this.traceSeqByRun.set(runDir, 0);
|
|
665
|
+
return runDir;
|
|
666
|
+
}
|
|
667
|
+
async initializeRunBundle(runDir, options) {
|
|
668
|
+
const snapshot = createFlowDefinitionSnapshot(options.flow);
|
|
669
|
+
const manifest = {
|
|
670
|
+
schema: FLOW_BUNDLE_SCHEMA,
|
|
671
|
+
runId: options.state.runId,
|
|
672
|
+
flowName: options.state.flowName,
|
|
673
|
+
runTitle: options.state.runTitle,
|
|
674
|
+
flowPath: options.state.flowPath,
|
|
675
|
+
startedAt: options.state.startedAt,
|
|
676
|
+
finishedAt: options.state.finishedAt,
|
|
677
|
+
status: options.state.status,
|
|
678
|
+
traceSchema: FLOW_TRACE_SCHEMA,
|
|
679
|
+
paths: {
|
|
680
|
+
flow: FLOW_SNAPSHOT_PATH,
|
|
681
|
+
trace: TRACE_PATH,
|
|
682
|
+
runProjection: RUN_PROJECTION_PATH,
|
|
683
|
+
liveProjection: LIVE_PROJECTION_PATH,
|
|
684
|
+
stepsProjection: STEPS_PROJECTION_PATH,
|
|
685
|
+
sessionsDir: SESSIONS_DIR,
|
|
686
|
+
artifactsDir: ARTIFACTS_DIR
|
|
687
|
+
},
|
|
688
|
+
sessions: []
|
|
689
|
+
};
|
|
690
|
+
this.manifestByRun.set(runDir, manifest);
|
|
691
|
+
await writeJsonAtomic(this.resolveRunPath(runDir, FLOW_SNAPSHOT_PATH), snapshot);
|
|
692
|
+
await writeJsonAtomic(this.resolveRunPath(runDir, MANIFEST_PATH), manifest);
|
|
693
|
+
await writeJsonAtomic(this.resolveRunPath(runDir, RUN_PROJECTION_PATH), options.state);
|
|
694
|
+
await writeJsonAtomic(this.resolveRunPath(runDir, LIVE_PROJECTION_PATH), createLiveState(options.state));
|
|
695
|
+
await writeJsonAtomic(this.resolveRunPath(runDir, STEPS_PROJECTION_PATH), options.state.steps);
|
|
696
|
+
await ensureFile(this.resolveRunPath(runDir, TRACE_PATH));
|
|
697
|
+
await this.appendTrace(runDir, options.state, {
|
|
698
|
+
scope: "run",
|
|
699
|
+
type: "run_started",
|
|
700
|
+
payload: {
|
|
701
|
+
flowName: options.state.flowName,
|
|
702
|
+
...options.state.runTitle ? { runTitle: options.state.runTitle } : {},
|
|
703
|
+
...options.state.flowPath ? { flowPath: options.state.flowPath } : {},
|
|
704
|
+
...options.inputArtifact ? { inputArtifact: options.inputArtifact } : {}
|
|
705
|
+
}
|
|
706
|
+
});
|
|
707
|
+
}
|
|
708
|
+
async writeSnapshot(runDir, state, event) {
|
|
709
|
+
state.updatedAt = isoNow();
|
|
710
|
+
await writeJsonAtomic(this.resolveRunPath(runDir, RUN_PROJECTION_PATH), state);
|
|
711
|
+
await writeJsonAtomic(this.resolveRunPath(runDir, LIVE_PROJECTION_PATH), createLiveState(state));
|
|
712
|
+
await writeJsonAtomic(this.resolveRunPath(runDir, STEPS_PROJECTION_PATH), state.steps);
|
|
713
|
+
await this.writeManifest(runDir, state);
|
|
714
|
+
await this.appendTrace(runDir, state, event);
|
|
715
|
+
}
|
|
716
|
+
async writeLive(runDir, state, event) {
|
|
717
|
+
state.updatedAt = isoNow();
|
|
718
|
+
await writeJsonAtomic(this.resolveRunPath(runDir, LIVE_PROJECTION_PATH), createLiveState(state));
|
|
719
|
+
await this.writeManifest(runDir, state);
|
|
720
|
+
await this.appendTrace(runDir, state, event);
|
|
721
|
+
}
|
|
722
|
+
async appendTrace(runDir, state, event) {
|
|
723
|
+
const traceEvent = {
|
|
724
|
+
seq: this.nextTraceSeq(runDir),
|
|
725
|
+
at: isoNow(),
|
|
726
|
+
runId: state.runId,
|
|
727
|
+
...event
|
|
728
|
+
};
|
|
729
|
+
await this.appendJsonLine(this.resolveRunPath(runDir, TRACE_PATH), traceEvent);
|
|
730
|
+
return traceEvent;
|
|
731
|
+
}
|
|
732
|
+
async writeArtifact(runDir, state, content, options) {
|
|
733
|
+
const buffer = toArtifactBuffer(content, options.mediaType);
|
|
734
|
+
const sha256 = createHash("sha256").update(buffer).digest("hex");
|
|
735
|
+
const relativePath = path.posix.join(ARTIFACTS_DIR, `sha256-${sha256}${normalizeArtifactExtension(options.extension)}`);
|
|
736
|
+
const filePath = this.resolveRunPath(runDir, relativePath);
|
|
737
|
+
await fs.mkdir(path.dirname(filePath), { recursive: true });
|
|
738
|
+
try {
|
|
739
|
+
await fs.access(filePath);
|
|
740
|
+
} catch {
|
|
741
|
+
await fs.writeFile(filePath, buffer);
|
|
742
|
+
}
|
|
743
|
+
const artifact = {
|
|
744
|
+
path: relativePath,
|
|
745
|
+
mediaType: options.mediaType,
|
|
746
|
+
bytes: buffer.byteLength,
|
|
747
|
+
sha256
|
|
748
|
+
};
|
|
749
|
+
if (options.emitTrace !== false) await this.appendTrace(runDir, state, {
|
|
750
|
+
scope: "artifact",
|
|
751
|
+
type: "artifact_written",
|
|
752
|
+
nodeId: options.nodeId,
|
|
753
|
+
attemptId: options.attemptId,
|
|
754
|
+
sessionId: options.sessionId,
|
|
755
|
+
artifact,
|
|
756
|
+
payload: { artifact }
|
|
757
|
+
});
|
|
758
|
+
return artifact;
|
|
759
|
+
}
|
|
760
|
+
async ensureSessionBundle(runDir, state, binding, record) {
|
|
761
|
+
const sessionDir = this.resolveRunPath(runDir, sessionDirPath(binding.bundleId));
|
|
762
|
+
await fs.mkdir(sessionDir, { recursive: true });
|
|
763
|
+
await writeJsonAtomic(path.join(sessionDir, "binding.json"), binding);
|
|
764
|
+
await ensureFile(path.join(sessionDir, "events.ndjson"));
|
|
765
|
+
if (record) await this.writeSessionRecord(runDir, state, binding, record);
|
|
766
|
+
const manifest = this.getManifest(runDir, state);
|
|
767
|
+
const isNew = !manifest.sessions.find((entry) => entry.id === binding.bundleId);
|
|
768
|
+
if (isNew) {
|
|
769
|
+
const entry = {
|
|
770
|
+
id: binding.bundleId,
|
|
771
|
+
handle: binding.handle,
|
|
772
|
+
bindingPath: path.posix.join(sessionDirPath(binding.bundleId), "binding.json"),
|
|
773
|
+
recordPath: path.posix.join(sessionDirPath(binding.bundleId), "record.json"),
|
|
774
|
+
eventsPath: path.posix.join(sessionDirPath(binding.bundleId), "events.ndjson")
|
|
775
|
+
};
|
|
776
|
+
manifest.sessions.push(entry);
|
|
777
|
+
await writeJsonAtomic(this.resolveRunPath(runDir, MANIFEST_PATH), manifest);
|
|
778
|
+
}
|
|
779
|
+
if (isNew) await this.appendTrace(runDir, state, {
|
|
780
|
+
scope: "session",
|
|
781
|
+
type: "session_bound",
|
|
782
|
+
sessionId: binding.bundleId,
|
|
783
|
+
payload: {
|
|
784
|
+
sessionId: binding.bundleId,
|
|
785
|
+
handle: binding.handle,
|
|
786
|
+
bindingArtifact: {
|
|
787
|
+
path: path.posix.join(sessionDirPath(binding.bundleId), "binding.json"),
|
|
788
|
+
mediaType: "application/json",
|
|
789
|
+
sha256: await fileSha256(path.join(sessionDir, "binding.json"))
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
});
|
|
793
|
+
}
|
|
794
|
+
async writeSessionRecord(runDir, _state, binding, record) {
|
|
795
|
+
const bundledRecord = createBundledSessionRecord(binding, record, this.sessionSeqByBundle.get(`${runDir}::${binding.bundleId}`) ?? 0);
|
|
796
|
+
await writeJsonAtomic(this.resolveRunPath(runDir, path.posix.join(sessionDirPath(binding.bundleId), "record.json")), bundledRecord);
|
|
797
|
+
}
|
|
798
|
+
async appendSessionEvent(runDir, binding, direction, message) {
|
|
799
|
+
const sessionKey = `${runDir}::${binding.bundleId}`;
|
|
800
|
+
const seq = (this.sessionSeqByBundle.get(sessionKey) ?? 0) + 1;
|
|
801
|
+
this.sessionSeqByBundle.set(sessionKey, seq);
|
|
802
|
+
await this.appendJsonLine(this.resolveRunPath(runDir, path.posix.join(sessionDirPath(binding.bundleId), "events.ndjson")), {
|
|
803
|
+
seq,
|
|
804
|
+
at: isoNow(),
|
|
805
|
+
direction,
|
|
806
|
+
message
|
|
807
|
+
});
|
|
808
|
+
return seq;
|
|
809
|
+
}
|
|
810
|
+
getManifest(runDir, state) {
|
|
811
|
+
const existing = this.manifestByRun.get(runDir);
|
|
812
|
+
if (existing) {
|
|
813
|
+
existing.startedAt = state.startedAt;
|
|
814
|
+
existing.finishedAt = state.finishedAt;
|
|
815
|
+
existing.status = state.status;
|
|
816
|
+
existing.flowPath = state.flowPath;
|
|
817
|
+
existing.flowName = state.flowName;
|
|
818
|
+
existing.runTitle = state.runTitle;
|
|
819
|
+
return existing;
|
|
820
|
+
}
|
|
821
|
+
const created = {
|
|
822
|
+
schema: FLOW_BUNDLE_SCHEMA,
|
|
823
|
+
runId: state.runId,
|
|
824
|
+
flowName: state.flowName,
|
|
825
|
+
runTitle: state.runTitle,
|
|
826
|
+
flowPath: state.flowPath,
|
|
827
|
+
startedAt: state.startedAt,
|
|
828
|
+
finishedAt: state.finishedAt,
|
|
829
|
+
status: state.status,
|
|
830
|
+
traceSchema: FLOW_TRACE_SCHEMA,
|
|
831
|
+
paths: {
|
|
832
|
+
flow: FLOW_SNAPSHOT_PATH,
|
|
833
|
+
trace: TRACE_PATH,
|
|
834
|
+
runProjection: RUN_PROJECTION_PATH,
|
|
835
|
+
liveProjection: LIVE_PROJECTION_PATH,
|
|
836
|
+
stepsProjection: STEPS_PROJECTION_PATH,
|
|
837
|
+
sessionsDir: SESSIONS_DIR,
|
|
838
|
+
artifactsDir: ARTIFACTS_DIR
|
|
839
|
+
},
|
|
840
|
+
sessions: []
|
|
841
|
+
};
|
|
842
|
+
this.manifestByRun.set(runDir, created);
|
|
843
|
+
return created;
|
|
844
|
+
}
|
|
845
|
+
async writeManifest(runDir, state) {
|
|
846
|
+
const manifest = this.getManifest(runDir, state);
|
|
847
|
+
await writeJsonAtomic(this.resolveRunPath(runDir, MANIFEST_PATH), manifest);
|
|
848
|
+
}
|
|
849
|
+
nextTraceSeq(runDir) {
|
|
850
|
+
const next = (this.traceSeqByRun.get(runDir) ?? 0) + 1;
|
|
851
|
+
this.traceSeqByRun.set(runDir, next);
|
|
852
|
+
return next;
|
|
853
|
+
}
|
|
854
|
+
resolveRunPath(runDir, relativePath) {
|
|
855
|
+
return path.join(runDir, ...relativePath.split("/"));
|
|
856
|
+
}
|
|
857
|
+
async appendJsonLine(filePath, value) {
|
|
858
|
+
const tracked = (this.appendChainByPath.get(filePath) ?? Promise.resolve()).then(async () => {
|
|
859
|
+
await fs.mkdir(path.dirname(filePath), { recursive: true });
|
|
860
|
+
await fs.appendFile(filePath, `${JSON.stringify(value)}\n`, "utf8");
|
|
861
|
+
}).finally(() => {
|
|
862
|
+
if (this.appendChainByPath.get(filePath) === tracked) this.appendChainByPath.delete(filePath);
|
|
863
|
+
});
|
|
864
|
+
this.appendChainByPath.set(filePath, tracked);
|
|
865
|
+
await tracked;
|
|
866
|
+
}
|
|
867
|
+
};
|
|
868
|
+
function createLiveState(state) {
|
|
869
|
+
return {
|
|
870
|
+
runId: state.runId,
|
|
871
|
+
flowName: state.flowName,
|
|
872
|
+
runTitle: state.runTitle,
|
|
873
|
+
flowPath: state.flowPath,
|
|
874
|
+
startedAt: state.startedAt,
|
|
875
|
+
finishedAt: state.finishedAt,
|
|
876
|
+
updatedAt: state.updatedAt,
|
|
877
|
+
status: state.status,
|
|
878
|
+
currentNode: state.currentNode,
|
|
879
|
+
currentAttemptId: state.currentAttemptId,
|
|
880
|
+
currentNodeType: state.currentNodeType,
|
|
881
|
+
currentNodeStartedAt: state.currentNodeStartedAt,
|
|
882
|
+
lastHeartbeatAt: state.lastHeartbeatAt,
|
|
883
|
+
statusDetail: state.statusDetail,
|
|
884
|
+
waitingOn: state.waitingOn,
|
|
885
|
+
error: state.error,
|
|
886
|
+
sessionBindings: state.sessionBindings
|
|
887
|
+
};
|
|
888
|
+
}
|
|
889
|
+
function createFlowDefinitionSnapshot(flow) {
|
|
890
|
+
return {
|
|
891
|
+
schema: FLOW_SNAPSHOT_SCHEMA,
|
|
892
|
+
name: flow.name,
|
|
893
|
+
...flow.run?.title !== void 0 ? { run: { hasTitle: true } } : {},
|
|
894
|
+
...flow.permissions ? { permissions: structuredClone(flow.permissions) } : {},
|
|
895
|
+
startAt: flow.startAt,
|
|
896
|
+
nodes: Object.fromEntries(Object.entries(flow.nodes).map(([nodeId, node]) => [nodeId, snapshotNode(node)])),
|
|
897
|
+
edges: structuredClone(flow.edges)
|
|
898
|
+
};
|
|
899
|
+
}
|
|
900
|
+
function snapshotNode(node) {
|
|
901
|
+
const common = snapshotCommonNodeFields(node);
|
|
902
|
+
switch (node.nodeType) {
|
|
903
|
+
case "acp": return snapshotAcpNode(node, common);
|
|
904
|
+
case "compute": return {
|
|
905
|
+
...common,
|
|
906
|
+
hasRun: true
|
|
907
|
+
};
|
|
908
|
+
case "action": {
|
|
909
|
+
const actionExecution = "exec" in node ? "shell" : "function";
|
|
910
|
+
return {
|
|
911
|
+
...common,
|
|
912
|
+
actionExecution,
|
|
913
|
+
hasRun: "run" in node,
|
|
914
|
+
hasExec: "exec" in node,
|
|
915
|
+
hasParse: "parse" in node && typeof node.parse === "function"
|
|
916
|
+
};
|
|
917
|
+
}
|
|
918
|
+
case "checkpoint": return {
|
|
919
|
+
...common,
|
|
920
|
+
...node.summary ? { summary: node.summary } : {},
|
|
921
|
+
hasRun: typeof node.run === "function"
|
|
922
|
+
};
|
|
923
|
+
}
|
|
924
|
+
throw new Error(`Unsupported flow node type: ${String(node)}`);
|
|
925
|
+
}
|
|
926
|
+
function snapshotCommonNodeFields(node) {
|
|
927
|
+
return {
|
|
928
|
+
nodeType: node.nodeType,
|
|
929
|
+
...node.timeoutMs !== void 0 ? { timeoutMs: node.timeoutMs } : {},
|
|
930
|
+
...node.heartbeatMs !== void 0 ? { heartbeatMs: node.heartbeatMs } : {},
|
|
931
|
+
...node.statusDetail ? { statusDetail: node.statusDetail } : {}
|
|
932
|
+
};
|
|
933
|
+
}
|
|
934
|
+
function snapshotAcpNode(node, common) {
|
|
935
|
+
return {
|
|
936
|
+
...common,
|
|
937
|
+
...node.profile ? { profile: node.profile } : {},
|
|
938
|
+
session: {
|
|
939
|
+
...node.session?.handle ? { handle: node.session.handle } : {},
|
|
940
|
+
...node.session?.isolated ? { isolated: true } : {}
|
|
941
|
+
},
|
|
942
|
+
cwd: snapshotCwd(node.cwd),
|
|
943
|
+
hasPrompt: true,
|
|
944
|
+
hasParse: typeof node.parse === "function"
|
|
945
|
+
};
|
|
946
|
+
}
|
|
947
|
+
function snapshotCwd(cwd) {
|
|
948
|
+
if (typeof cwd === "function") return { mode: "dynamic" };
|
|
949
|
+
if (typeof cwd === "string") return {
|
|
950
|
+
mode: "static",
|
|
951
|
+
value: cwd
|
|
952
|
+
};
|
|
953
|
+
return { mode: "default" };
|
|
954
|
+
}
|
|
955
|
+
function createBundledSessionRecord(binding, record, bundleLastSeq) {
|
|
956
|
+
return {
|
|
957
|
+
...structuredClone(record),
|
|
958
|
+
lastSeq: bundleLastSeq,
|
|
959
|
+
eventLog: {
|
|
960
|
+
...structuredClone(record.eventLog),
|
|
961
|
+
active_path: path.posix.join(sessionDirPath(binding.bundleId), "events.ndjson"),
|
|
962
|
+
segment_count: 1,
|
|
963
|
+
max_segments: 1
|
|
964
|
+
}
|
|
965
|
+
};
|
|
966
|
+
}
|
|
967
|
+
async function writeJsonAtomic(filePath, value) {
|
|
968
|
+
const tempPath = `${filePath}.${process.pid}.${Date.now()}.${randomUUID()}.tmp`;
|
|
969
|
+
const payload = JSON.stringify(value, null, 2);
|
|
970
|
+
await fs.mkdir(path.dirname(filePath), { recursive: true });
|
|
971
|
+
await fs.writeFile(tempPath, `${payload}\n`, "utf8");
|
|
972
|
+
await fs.rename(tempPath, filePath);
|
|
973
|
+
}
|
|
974
|
+
async function ensureFile(filePath) {
|
|
975
|
+
await fs.mkdir(path.dirname(filePath), { recursive: true });
|
|
976
|
+
await fs.appendFile(filePath, "", "utf8");
|
|
977
|
+
}
|
|
978
|
+
async function fileSha256(filePath) {
|
|
979
|
+
const payload = await fs.readFile(filePath);
|
|
980
|
+
return createHash("sha256").update(payload).digest("hex");
|
|
981
|
+
}
|
|
982
|
+
function toArtifactBuffer(content, mediaType) {
|
|
983
|
+
if (typeof content === "string") return Buffer.from(content, "utf8");
|
|
984
|
+
if (Buffer.isBuffer(content)) return content;
|
|
985
|
+
if (content instanceof Uint8Array) return Buffer.from(content);
|
|
986
|
+
if (mediaType === "application/json") return Buffer.from(`${JSON.stringify(content, null, 2)}\n`, "utf8");
|
|
987
|
+
return Buffer.from(String(content), "utf8");
|
|
988
|
+
}
|
|
989
|
+
function normalizeArtifactExtension(extension) {
|
|
990
|
+
if (!extension) return "";
|
|
991
|
+
return extension.startsWith(".") ? extension : `.${extension}`;
|
|
992
|
+
}
|
|
993
|
+
function sessionDirPath(bundleId) {
|
|
994
|
+
return path.posix.join(SESSIONS_DIR, bundleId);
|
|
995
|
+
}
|
|
996
|
+
function isoNow() {
|
|
997
|
+
return (/* @__PURE__ */ new Date()).toISOString();
|
|
998
|
+
}
|
|
999
|
+
//#endregion
|
|
1000
|
+
//#region src/flows/runtime.ts
|
|
1001
|
+
const DEFAULT_FLOW_HEARTBEAT_MS = 5e3;
|
|
1002
|
+
const DEFAULT_FLOW_STEP_TIMEOUT_MS = 15 * 6e4;
|
|
1003
|
+
var FlowRunner = class {
|
|
1004
|
+
resolveAgent;
|
|
1005
|
+
defaultCwd;
|
|
1006
|
+
permissionMode;
|
|
1007
|
+
mcpServers;
|
|
1008
|
+
nonInteractivePermissions;
|
|
1009
|
+
permissionPolicy;
|
|
1010
|
+
authCredentials;
|
|
1011
|
+
authPolicy;
|
|
1012
|
+
timeoutMs;
|
|
1013
|
+
defaultNodeTimeoutMs;
|
|
1014
|
+
verbose;
|
|
1015
|
+
suppressSdkConsoleErrors;
|
|
1016
|
+
sessionOptions;
|
|
1017
|
+
services;
|
|
1018
|
+
store;
|
|
1019
|
+
pendingPersistentSessionClients = /* @__PURE__ */ new Map();
|
|
1020
|
+
constructor(options) {
|
|
1021
|
+
this.resolveAgent = options.resolveAgent;
|
|
1022
|
+
this.defaultCwd = options.resolveAgent(void 0).cwd;
|
|
1023
|
+
this.permissionMode = options.permissionMode;
|
|
1024
|
+
this.mcpServers = options.mcpServers;
|
|
1025
|
+
this.nonInteractivePermissions = options.nonInteractivePermissions;
|
|
1026
|
+
this.permissionPolicy = options.permissionPolicy;
|
|
1027
|
+
this.authCredentials = options.authCredentials;
|
|
1028
|
+
this.authPolicy = options.authPolicy;
|
|
1029
|
+
this.timeoutMs = options.timeoutMs;
|
|
1030
|
+
this.defaultNodeTimeoutMs = options.defaultNodeTimeoutMs ?? options.timeoutMs ?? DEFAULT_FLOW_STEP_TIMEOUT_MS;
|
|
1031
|
+
this.verbose = options.verbose;
|
|
1032
|
+
this.suppressSdkConsoleErrors = options.suppressSdkConsoleErrors;
|
|
1033
|
+
this.sessionOptions = options.sessionOptions;
|
|
1034
|
+
this.services = options.services ?? {};
|
|
1035
|
+
this.store = new FlowRunStore(options.outputRoot);
|
|
1036
|
+
}
|
|
1037
|
+
async run(flow, input, options = {}) {
|
|
1038
|
+
validateFlowDefinition(flow);
|
|
1039
|
+
const runId = createRunId(flow.name);
|
|
1040
|
+
const runTitle = await resolveFlowRunTitle(flow, input, options.flowPath);
|
|
1041
|
+
const runDir = await this.store.createRunDir(runId);
|
|
1042
|
+
const state = {
|
|
1043
|
+
runId,
|
|
1044
|
+
flowName: flow.name,
|
|
1045
|
+
runTitle,
|
|
1046
|
+
flowPath: options.flowPath,
|
|
1047
|
+
startedAt: isoNow$1(),
|
|
1048
|
+
updatedAt: isoNow$1(),
|
|
1049
|
+
status: "running",
|
|
1050
|
+
input,
|
|
1051
|
+
outputs: {},
|
|
1052
|
+
results: {},
|
|
1053
|
+
steps: [],
|
|
1054
|
+
sessionBindings: {}
|
|
1055
|
+
};
|
|
1056
|
+
const inputArtifact = await this.store.writeArtifact(runDir, state, input, {
|
|
1057
|
+
mediaType: "application/json",
|
|
1058
|
+
extension: "json",
|
|
1059
|
+
emitTrace: false
|
|
1060
|
+
});
|
|
1061
|
+
await this.store.initializeRunBundle(runDir, {
|
|
1062
|
+
flow,
|
|
1063
|
+
state,
|
|
1064
|
+
inputArtifact
|
|
1065
|
+
});
|
|
1066
|
+
try {
|
|
1067
|
+
return await withInterrupt(async () => await this.executeFlowRun(flow, input, runDir, state), async () => {
|
|
1068
|
+
await persistRunFailure(this.store, runDir, state, new InterruptedError());
|
|
1069
|
+
});
|
|
1070
|
+
} finally {
|
|
1071
|
+
await this.closePendingPersistentSessionClients();
|
|
1072
|
+
}
|
|
1073
|
+
}
|
|
1074
|
+
async executeFlowRun(flow, input, runDir, state) {
|
|
1075
|
+
let current = flow.startAt;
|
|
1076
|
+
const attemptCounts = /* @__PURE__ */ new Map();
|
|
1077
|
+
try {
|
|
1078
|
+
while (current) {
|
|
1079
|
+
const step = await this.executeFlowStep(flow, input, runDir, state, current, attemptCounts);
|
|
1080
|
+
const waiting = await this.maybeCompleteCheckpointStep(runDir, state, step);
|
|
1081
|
+
if (waiting) return waiting;
|
|
1082
|
+
await this.recordFlowStepOutcome(runDir, state, step);
|
|
1083
|
+
current = this.resolveNextNode(flow, step);
|
|
1084
|
+
}
|
|
1085
|
+
return await this.completeFlowRun(runDir, state);
|
|
1086
|
+
} catch (error) {
|
|
1087
|
+
await persistRunFailure(this.store, runDir, state, error);
|
|
1088
|
+
throw error;
|
|
1089
|
+
}
|
|
1090
|
+
}
|
|
1091
|
+
async executeFlowStep(flow, input, runDir, state, nodeId, attemptCounts) {
|
|
1092
|
+
const node = flow.nodes[nodeId];
|
|
1093
|
+
if (!node) throw new Error(`Unknown flow node: ${nodeId}`);
|
|
1094
|
+
const attemptId = nextAttemptId(attemptCounts, nodeId);
|
|
1095
|
+
const startedAt = isoNow$1();
|
|
1096
|
+
markNodeStarted(state, nodeId, attemptId, node.nodeType, startedAt, node.statusDetail);
|
|
1097
|
+
await this.writeNodeStartedSnapshot(runDir, state, nodeId, attemptId, node);
|
|
1098
|
+
return await this.executeStartedFlowStep({
|
|
1099
|
+
flow,
|
|
1100
|
+
input,
|
|
1101
|
+
runDir,
|
|
1102
|
+
state,
|
|
1103
|
+
nodeId,
|
|
1104
|
+
node,
|
|
1105
|
+
attemptId,
|
|
1106
|
+
startedAt
|
|
1107
|
+
});
|
|
1108
|
+
}
|
|
1109
|
+
async writeNodeStartedSnapshot(runDir, state, nodeId, attemptId, node) {
|
|
1110
|
+
await this.store.writeSnapshot(runDir, state, {
|
|
1111
|
+
scope: "node",
|
|
1112
|
+
type: "node_started",
|
|
1113
|
+
nodeId,
|
|
1114
|
+
attemptId,
|
|
1115
|
+
payload: {
|
|
1116
|
+
nodeType: node.nodeType,
|
|
1117
|
+
...node.timeoutMs !== void 0 ? { timeoutMs: node.timeoutMs ?? this.defaultNodeTimeoutMs } : { timeoutMs: this.defaultNodeTimeoutMs },
|
|
1118
|
+
...state.statusDetail ? { statusDetail: state.statusDetail } : {}
|
|
1119
|
+
}
|
|
1120
|
+
});
|
|
1121
|
+
}
|
|
1122
|
+
async executeStartedFlowStep(params) {
|
|
1123
|
+
const context = makeFlowNodeContext(params.state, params.input, this.services);
|
|
1124
|
+
try {
|
|
1125
|
+
const executed = await this.executeNode(params.runDir, params.state, params.flow, params.nodeId, params.node, context);
|
|
1126
|
+
return await this.createSuccessfulFlowStep(params, executed);
|
|
1127
|
+
} catch (error) {
|
|
1128
|
+
return await this.createFailedFlowStep(params, error);
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
1131
|
+
async createSuccessfulFlowStep(params, executed) {
|
|
1132
|
+
const trace = await finalizeStepTrace(this.store, params.runDir, params.state, params.nodeId, params.attemptId, executed.output, executed.trace);
|
|
1133
|
+
const nodeResult = createNodeResult({
|
|
1134
|
+
attemptId: params.attemptId,
|
|
1135
|
+
nodeId: params.nodeId,
|
|
1136
|
+
nodeType: params.node.nodeType,
|
|
1137
|
+
outcome: "ok",
|
|
1138
|
+
startedAt: params.startedAt,
|
|
1139
|
+
finishedAt: isoNow$1(),
|
|
1140
|
+
output: executed.output
|
|
1141
|
+
});
|
|
1142
|
+
params.state.results[params.nodeId] = nodeResult;
|
|
1143
|
+
return {
|
|
1144
|
+
...executed,
|
|
1145
|
+
trace,
|
|
1146
|
+
nodeResult,
|
|
1147
|
+
attemptId: params.attemptId,
|
|
1148
|
+
nodeId: params.nodeId,
|
|
1149
|
+
node: params.node,
|
|
1150
|
+
startedAt: params.startedAt,
|
|
1151
|
+
state: params.state
|
|
1152
|
+
};
|
|
1153
|
+
}
|
|
1154
|
+
async createFailedFlowStep(params, error) {
|
|
1155
|
+
const trace = await finalizeStepTrace(this.store, params.runDir, params.state, params.nodeId, params.attemptId, void 0, extractAttachedStepTrace(error) ?? null);
|
|
1156
|
+
const nodeResult = createNodeResult({
|
|
1157
|
+
attemptId: params.attemptId,
|
|
1158
|
+
nodeId: params.nodeId,
|
|
1159
|
+
nodeType: params.node.nodeType,
|
|
1160
|
+
outcome: outcomeForError(error),
|
|
1161
|
+
startedAt: params.startedAt,
|
|
1162
|
+
finishedAt: isoNow$1(),
|
|
1163
|
+
error: error instanceof Error ? error.message : String(error)
|
|
1164
|
+
});
|
|
1165
|
+
params.state.results[params.nodeId] = nodeResult;
|
|
1166
|
+
return {
|
|
1167
|
+
output: void 0,
|
|
1168
|
+
promptText: null,
|
|
1169
|
+
rawText: null,
|
|
1170
|
+
sessionInfo: null,
|
|
1171
|
+
agentInfo: null,
|
|
1172
|
+
trace,
|
|
1173
|
+
nodeResult,
|
|
1174
|
+
executionError: error,
|
|
1175
|
+
attemptId: params.attemptId,
|
|
1176
|
+
nodeId: params.nodeId,
|
|
1177
|
+
node: params.node,
|
|
1178
|
+
startedAt: params.startedAt,
|
|
1179
|
+
state: params.state
|
|
1180
|
+
};
|
|
1181
|
+
}
|
|
1182
|
+
async maybeCompleteCheckpointStep(runDir, state, step) {
|
|
1183
|
+
if (step.nodeResult.outcome !== "ok" || step.node.nodeType !== "checkpoint") return;
|
|
1184
|
+
state.outputs[step.nodeId] = step.output;
|
|
1185
|
+
state.waitingOn = step.nodeId;
|
|
1186
|
+
state.updatedAt = isoNow$1();
|
|
1187
|
+
state.status = "waiting";
|
|
1188
|
+
await this.recordFlowStepOutcome(runDir, state, step, {
|
|
1189
|
+
sessionInfo: null,
|
|
1190
|
+
agentInfo: null,
|
|
1191
|
+
statusDetail: step.output?.summary ?? step.nodeId
|
|
1192
|
+
});
|
|
1193
|
+
return {
|
|
1194
|
+
runDir,
|
|
1195
|
+
state
|
|
1196
|
+
};
|
|
1197
|
+
}
|
|
1198
|
+
resolveNextNode(flow, step) {
|
|
1199
|
+
if (step.nodeResult.outcome === "ok") {
|
|
1200
|
+
step.state.outputs[step.nodeId] = step.output;
|
|
1201
|
+
return resolveNext(flow.edges, step.nodeId, step.output, step.nodeResult);
|
|
1202
|
+
}
|
|
1203
|
+
const next = resolveNextForOutcome(flow.edges, step.nodeId, step.nodeResult);
|
|
1204
|
+
if (next) return next;
|
|
1205
|
+
throw step.executionError;
|
|
1206
|
+
}
|
|
1207
|
+
async completeFlowRun(runDir, state) {
|
|
1208
|
+
state.status = "completed";
|
|
1209
|
+
state.finishedAt = isoNow$1();
|
|
1210
|
+
state.updatedAt = state.finishedAt;
|
|
1211
|
+
clearActiveNode(state);
|
|
1212
|
+
await this.store.writeSnapshot(runDir, state, {
|
|
1213
|
+
scope: "run",
|
|
1214
|
+
type: "run_completed",
|
|
1215
|
+
payload: { status: state.status }
|
|
1216
|
+
});
|
|
1217
|
+
return {
|
|
1218
|
+
runDir,
|
|
1219
|
+
state
|
|
1220
|
+
};
|
|
1221
|
+
}
|
|
1222
|
+
async recordFlowStepOutcome(runDir, state, step, overrides = {}) {
|
|
1223
|
+
state.updatedAt = isoNow$1();
|
|
1224
|
+
clearActiveNode(state, overrides.statusDetail);
|
|
1225
|
+
state.steps.push({
|
|
1226
|
+
attemptId: step.attemptId,
|
|
1227
|
+
nodeId: step.nodeId,
|
|
1228
|
+
nodeType: step.node.nodeType,
|
|
1229
|
+
outcome: step.nodeResult.outcome,
|
|
1230
|
+
startedAt: step.startedAt,
|
|
1231
|
+
finishedAt: step.nodeResult.finishedAt,
|
|
1232
|
+
promptText: step.promptText,
|
|
1233
|
+
rawText: step.rawText,
|
|
1234
|
+
output: step.output,
|
|
1235
|
+
error: step.nodeResult.error,
|
|
1236
|
+
session: overrides.sessionInfo ?? step.sessionInfo,
|
|
1237
|
+
agent: overrides.agentInfo ?? step.agentInfo,
|
|
1238
|
+
...step.trace ? { trace: step.trace } : {}
|
|
1239
|
+
});
|
|
1240
|
+
await this.store.writeSnapshot(runDir, state, {
|
|
1241
|
+
scope: "node",
|
|
1242
|
+
type: "node_outcome",
|
|
1243
|
+
nodeId: step.nodeId,
|
|
1244
|
+
attemptId: step.attemptId,
|
|
1245
|
+
payload: createNodeOutcomePayload(step.nodeResult, step.trace)
|
|
1246
|
+
});
|
|
1247
|
+
}
|
|
1248
|
+
async executeNode(runDir, state, flow, nodeId, node, context) {
|
|
1249
|
+
switch (node.nodeType) {
|
|
1250
|
+
case "compute": return await this.executeComputeNode(runDir, state, node, context);
|
|
1251
|
+
case "action": return await this.executeActionNode(runDir, state, node, context);
|
|
1252
|
+
case "checkpoint": return await this.executeCheckpointNode(runDir, state, nodeId, node, context);
|
|
1253
|
+
case "acp": return await this.executeAcpNode(runDir, state, flow, node, context);
|
|
1254
|
+
default: throw new Error(`Unsupported flow node: ${String(node)}`);
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1257
|
+
async executeComputeNode(runDir, state, node, context) {
|
|
1258
|
+
const nodeTimeoutMs = node.timeoutMs ?? this.defaultNodeTimeoutMs;
|
|
1259
|
+
return {
|
|
1260
|
+
output: await this.runWithHeartbeat(runDir, state, state.currentNode ?? "", node, nodeTimeoutMs, async () => await Promise.resolve(node.run(context))),
|
|
1261
|
+
promptText: null,
|
|
1262
|
+
rawText: null,
|
|
1263
|
+
sessionInfo: null,
|
|
1264
|
+
agentInfo: null,
|
|
1265
|
+
trace: null
|
|
1266
|
+
};
|
|
1267
|
+
}
|
|
1268
|
+
async executeActionNode(runDir, state, node, context) {
|
|
1269
|
+
const nodeTimeoutMs = node.timeoutMs ?? this.defaultNodeTimeoutMs;
|
|
1270
|
+
if ("run" in node) return {
|
|
1271
|
+
output: await this.runWithHeartbeat(runDir, state, state.currentNode ?? "", node, nodeTimeoutMs, async () => await Promise.resolve(node.run(context))),
|
|
1272
|
+
promptText: null,
|
|
1273
|
+
rawText: null,
|
|
1274
|
+
sessionInfo: null,
|
|
1275
|
+
agentInfo: null,
|
|
1276
|
+
trace: { action: { actionType: "function" } }
|
|
1277
|
+
};
|
|
1278
|
+
const { output, rawText, trace } = await this.runWithHeartbeat(runDir, state, state.currentNode ?? "", node, nodeTimeoutMs, async () => {
|
|
1279
|
+
const execution = await Promise.resolve(node.exec(context));
|
|
1280
|
+
const effectiveExecution = {
|
|
1281
|
+
...execution,
|
|
1282
|
+
cwd: resolveShellActionCwd(this.defaultCwd, execution.cwd),
|
|
1283
|
+
timeoutMs: execution.timeoutMs ?? nodeTimeoutMs
|
|
1284
|
+
};
|
|
1285
|
+
updateStatusDetail(state, formatShellActionSummary(effectiveExecution));
|
|
1286
|
+
await this.store.writeLive(runDir, state, {
|
|
1287
|
+
scope: "node",
|
|
1288
|
+
type: "node_heartbeat",
|
|
1289
|
+
nodeId: state.currentNode,
|
|
1290
|
+
attemptId: state.currentAttemptId,
|
|
1291
|
+
payload: { statusDetail: state.statusDetail }
|
|
1292
|
+
});
|
|
1293
|
+
await this.store.appendTrace(runDir, state, {
|
|
1294
|
+
scope: "action",
|
|
1295
|
+
type: "action_prepared",
|
|
1296
|
+
nodeId: state.currentNode,
|
|
1297
|
+
attemptId: state.currentAttemptId,
|
|
1298
|
+
payload: { action: {
|
|
1299
|
+
actionType: "shell",
|
|
1300
|
+
command: effectiveExecution.command,
|
|
1301
|
+
args: effectiveExecution.args ?? [],
|
|
1302
|
+
cwd: effectiveExecution.cwd
|
|
1303
|
+
} }
|
|
1304
|
+
});
|
|
1305
|
+
const result = await runShellAction(effectiveExecution);
|
|
1306
|
+
const stdoutArtifact = await this.store.writeArtifact(runDir, state, result.stdout, {
|
|
1307
|
+
mediaType: "text/plain",
|
|
1308
|
+
extension: "txt",
|
|
1309
|
+
nodeId: state.currentNode,
|
|
1310
|
+
attemptId: state.currentAttemptId
|
|
1311
|
+
});
|
|
1312
|
+
const stderrArtifact = await this.store.writeArtifact(runDir, state, result.stderr, {
|
|
1313
|
+
mediaType: "text/plain",
|
|
1314
|
+
extension: "txt",
|
|
1315
|
+
nodeId: state.currentNode,
|
|
1316
|
+
attemptId: state.currentAttemptId
|
|
1317
|
+
});
|
|
1318
|
+
await this.store.appendTrace(runDir, state, {
|
|
1319
|
+
scope: "action",
|
|
1320
|
+
type: "action_completed",
|
|
1321
|
+
nodeId: state.currentNode,
|
|
1322
|
+
attemptId: state.currentAttemptId,
|
|
1323
|
+
payload: {
|
|
1324
|
+
action: {
|
|
1325
|
+
actionType: "shell",
|
|
1326
|
+
command: result.command,
|
|
1327
|
+
args: result.args,
|
|
1328
|
+
cwd: result.cwd,
|
|
1329
|
+
exitCode: result.exitCode,
|
|
1330
|
+
signal: result.signal,
|
|
1331
|
+
durationMs: result.durationMs
|
|
1332
|
+
},
|
|
1333
|
+
stdoutArtifact,
|
|
1334
|
+
stderrArtifact
|
|
1335
|
+
}
|
|
1336
|
+
});
|
|
1337
|
+
const trace = {
|
|
1338
|
+
action: {
|
|
1339
|
+
actionType: "shell",
|
|
1340
|
+
command: result.command,
|
|
1341
|
+
args: result.args,
|
|
1342
|
+
cwd: result.cwd,
|
|
1343
|
+
exitCode: result.exitCode,
|
|
1344
|
+
signal: result.signal,
|
|
1345
|
+
durationMs: result.durationMs
|
|
1346
|
+
},
|
|
1347
|
+
stdoutArtifact,
|
|
1348
|
+
stderrArtifact
|
|
1349
|
+
};
|
|
1350
|
+
let parsedOutput;
|
|
1351
|
+
try {
|
|
1352
|
+
parsedOutput = node.parse ? await node.parse(result, context) : result;
|
|
1353
|
+
} catch (error) {
|
|
1354
|
+
throw attachStepTrace(error, trace);
|
|
1355
|
+
}
|
|
1356
|
+
return {
|
|
1357
|
+
output: parsedOutput,
|
|
1358
|
+
rawText: result.combinedOutput,
|
|
1359
|
+
trace
|
|
1360
|
+
};
|
|
1361
|
+
});
|
|
1362
|
+
return {
|
|
1363
|
+
output,
|
|
1364
|
+
promptText: null,
|
|
1365
|
+
rawText,
|
|
1366
|
+
sessionInfo: null,
|
|
1367
|
+
agentInfo: null,
|
|
1368
|
+
trace
|
|
1369
|
+
};
|
|
1370
|
+
}
|
|
1371
|
+
async executeCheckpointNode(runDir, state, nodeId, node, context) {
|
|
1372
|
+
const nodeTimeoutMs = node.timeoutMs ?? this.defaultNodeTimeoutMs;
|
|
1373
|
+
return {
|
|
1374
|
+
output: typeof node.run === "function" ? await this.runWithHeartbeat(runDir, state, state.currentNode ?? "", node, nodeTimeoutMs, async () => await Promise.resolve(node.run?.(context))) : {
|
|
1375
|
+
checkpoint: nodeId,
|
|
1376
|
+
summary: node.summary ?? nodeId
|
|
1377
|
+
},
|
|
1378
|
+
promptText: null,
|
|
1379
|
+
rawText: null,
|
|
1380
|
+
sessionInfo: null,
|
|
1381
|
+
agentInfo: null,
|
|
1382
|
+
trace: null
|
|
1383
|
+
};
|
|
1384
|
+
}
|
|
1385
|
+
async executeAcpNode(runDir, state, flow, node, context) {
|
|
1386
|
+
const nodeTimeoutMs = node.timeoutMs ?? this.defaultNodeTimeoutMs;
|
|
1387
|
+
let boundSession = null;
|
|
1388
|
+
return await this.runWithHeartbeat(runDir, state, state.currentNode ?? "", node, nodeTimeoutMs, async () => {
|
|
1389
|
+
const prepared = await this.prepareAcpPrompt(runDir, state, node, context, nodeTimeoutMs);
|
|
1390
|
+
if (node.session?.isolated) return await this.executeIsolatedAcpPrompt(runDir, state, flow, node, context, prepared);
|
|
1391
|
+
boundSession = await this.ensureSessionBinding(runDir, state, flow, node, prepared.agentInfo, nodeTimeoutMs);
|
|
1392
|
+
return await this.executePersistentAcpPrompt(runDir, state, node, context, prepared, boundSession);
|
|
1393
|
+
}, async () => {
|
|
1394
|
+
if (!boundSession) return;
|
|
1395
|
+
await cancelSessionPrompt({ sessionId: boundSession.acpxRecordId });
|
|
1396
|
+
});
|
|
1397
|
+
}
|
|
1398
|
+
async prepareAcpPrompt(runDir, state, node, context, nodeTimeoutMs) {
|
|
1399
|
+
const resolvedAgent = this.resolveAgent(node.profile);
|
|
1400
|
+
const agentInfo = {
|
|
1401
|
+
...resolvedAgent,
|
|
1402
|
+
cwd: await resolveNodeCwd(resolvedAgent.cwd, node.cwd, context)
|
|
1403
|
+
};
|
|
1404
|
+
const prompt = normalizePromptInput(await Promise.resolve(node.prompt(context)));
|
|
1405
|
+
const promptText = promptToDisplayText(prompt);
|
|
1406
|
+
updateStatusDetail(state, summarizePrompt(promptText, node.statusDetail));
|
|
1407
|
+
await this.writeAcpPromptHeartbeat(runDir, state);
|
|
1408
|
+
return {
|
|
1409
|
+
agentInfo,
|
|
1410
|
+
prompt,
|
|
1411
|
+
promptText,
|
|
1412
|
+
promptArtifact: await this.store.writeArtifact(runDir, state, promptText, {
|
|
1413
|
+
mediaType: "text/plain",
|
|
1414
|
+
extension: "txt",
|
|
1415
|
+
nodeId: state.currentNode,
|
|
1416
|
+
attemptId: state.currentAttemptId
|
|
1417
|
+
}),
|
|
1418
|
+
nodeTimeoutMs
|
|
1419
|
+
};
|
|
1420
|
+
}
|
|
1421
|
+
async writeAcpPromptHeartbeat(runDir, state) {
|
|
1422
|
+
await this.store.writeLive(runDir, state, {
|
|
1423
|
+
scope: "node",
|
|
1424
|
+
type: "node_heartbeat",
|
|
1425
|
+
nodeId: state.currentNode,
|
|
1426
|
+
attemptId: state.currentAttemptId,
|
|
1427
|
+
payload: { statusDetail: state.statusDetail }
|
|
1428
|
+
});
|
|
1429
|
+
}
|
|
1430
|
+
async executeIsolatedAcpPrompt(runDir, state, flow, node, context, prepared) {
|
|
1431
|
+
const binding = createIsolatedSessionBinding(flow.name, state.runId, state.currentAttemptId ?? randomUUID(), node.profile, prepared.agentInfo);
|
|
1432
|
+
await this.initializeIsolatedSessionBundle(runDir, state, binding);
|
|
1433
|
+
await this.appendAcpPromptPreparedTrace(runDir, state, binding, prepared.promptArtifact);
|
|
1434
|
+
const prompt = await this.runIsolatedPrompt(runDir, state, binding, prepared.agentInfo, prepared.prompt, prepared.nodeTimeoutMs);
|
|
1435
|
+
return await this.finishAcpPrompt(runDir, state, node, context, prepared, prompt, binding);
|
|
1436
|
+
}
|
|
1437
|
+
async initializeIsolatedSessionBundle(runDir, state, binding) {
|
|
1438
|
+
const timestamp = state.currentNodeStartedAt ?? isoNow$1();
|
|
1439
|
+
const initialRecord = createSyntheticSessionRecord({
|
|
1440
|
+
binding,
|
|
1441
|
+
createdAt: timestamp,
|
|
1442
|
+
updatedAt: timestamp,
|
|
1443
|
+
conversation: createSessionConversation(timestamp),
|
|
1444
|
+
acpxState: void 0,
|
|
1445
|
+
lastSeq: 0
|
|
1446
|
+
});
|
|
1447
|
+
await this.store.ensureSessionBundle(runDir, state, binding, initialRecord);
|
|
1448
|
+
}
|
|
1449
|
+
async executePersistentAcpPrompt(runDir, state, node, context, prepared, binding) {
|
|
1450
|
+
await this.appendAcpPromptPreparedTrace(runDir, state, binding, prepared.promptArtifact);
|
|
1451
|
+
const prompt = await this.runPersistentPrompt(runDir, state, binding, prepared.prompt, prepared.nodeTimeoutMs);
|
|
1452
|
+
return await this.finishAcpPrompt(runDir, state, node, context, prepared, prompt, prompt.sessionInfo);
|
|
1453
|
+
}
|
|
1454
|
+
async appendAcpPromptPreparedTrace(runDir, state, binding, promptArtifact) {
|
|
1455
|
+
await this.store.appendTrace(runDir, state, {
|
|
1456
|
+
scope: "acp",
|
|
1457
|
+
type: "acp_prompt_prepared",
|
|
1458
|
+
nodeId: state.currentNode,
|
|
1459
|
+
attemptId: state.currentAttemptId,
|
|
1460
|
+
sessionId: binding.bundleId,
|
|
1461
|
+
payload: {
|
|
1462
|
+
sessionId: binding.bundleId,
|
|
1463
|
+
promptArtifact
|
|
1464
|
+
}
|
|
1465
|
+
});
|
|
1466
|
+
}
|
|
1467
|
+
async finishAcpPrompt(runDir, state, node, context, prepared, prompt, sessionInfo) {
|
|
1468
|
+
const rawResponseArtifact = await this.writeAcpRawResponseArtifact(runDir, state, prompt, sessionInfo);
|
|
1469
|
+
await this.appendAcpResponseParsedTrace(runDir, state, prompt, sessionInfo, rawResponseArtifact);
|
|
1470
|
+
const trace = {
|
|
1471
|
+
sessionId: sessionInfo.bundleId,
|
|
1472
|
+
promptArtifact: prepared.promptArtifact,
|
|
1473
|
+
rawResponseArtifact,
|
|
1474
|
+
conversation: prompt.conversation
|
|
1475
|
+
};
|
|
1476
|
+
return {
|
|
1477
|
+
output: await this.parseAcpOutput(node, context, prompt.rawText, trace),
|
|
1478
|
+
promptText: prepared.promptText,
|
|
1479
|
+
rawText: prompt.rawText,
|
|
1480
|
+
sessionInfo,
|
|
1481
|
+
agentInfo: prepared.agentInfo,
|
|
1482
|
+
trace
|
|
1483
|
+
};
|
|
1484
|
+
}
|
|
1485
|
+
async writeAcpRawResponseArtifact(runDir, state, prompt, sessionInfo) {
|
|
1486
|
+
return await this.store.writeArtifact(runDir, state, prompt.rawText, {
|
|
1487
|
+
mediaType: "text/plain",
|
|
1488
|
+
extension: "txt",
|
|
1489
|
+
nodeId: state.currentNode,
|
|
1490
|
+
attemptId: state.currentAttemptId,
|
|
1491
|
+
sessionId: sessionInfo.bundleId
|
|
1492
|
+
});
|
|
1493
|
+
}
|
|
1494
|
+
async appendAcpResponseParsedTrace(runDir, state, prompt, sessionInfo, rawResponseArtifact) {
|
|
1495
|
+
await this.store.appendTrace(runDir, state, {
|
|
1496
|
+
scope: "acp",
|
|
1497
|
+
type: "acp_response_parsed",
|
|
1498
|
+
nodeId: state.currentNode,
|
|
1499
|
+
attemptId: state.currentAttemptId,
|
|
1500
|
+
sessionId: sessionInfo.bundleId,
|
|
1501
|
+
payload: {
|
|
1502
|
+
sessionId: sessionInfo.bundleId,
|
|
1503
|
+
conversation: prompt.conversation,
|
|
1504
|
+
rawResponseArtifact
|
|
1505
|
+
}
|
|
1506
|
+
});
|
|
1507
|
+
}
|
|
1508
|
+
async parseAcpOutput(node, context, rawText, trace) {
|
|
1509
|
+
try {
|
|
1510
|
+
return node.parse ? await node.parse(rawText, context) : rawText;
|
|
1511
|
+
} catch (error) {
|
|
1512
|
+
throw attachStepTrace(error, trace);
|
|
1513
|
+
}
|
|
1514
|
+
}
|
|
1515
|
+
async runWithHeartbeat(runDir, state, nodeId, node, timeoutMs, run, onTimeout) {
|
|
1516
|
+
const heartbeatMs = Math.max(0, Math.round(node.heartbeatMs ?? DEFAULT_FLOW_HEARTBEAT_MS));
|
|
1517
|
+
let timer;
|
|
1518
|
+
let active = true;
|
|
1519
|
+
const heartbeat = async () => {
|
|
1520
|
+
if (!active) return;
|
|
1521
|
+
state.lastHeartbeatAt = isoNow$1();
|
|
1522
|
+
state.updatedAt = state.lastHeartbeatAt;
|
|
1523
|
+
await this.store.writeLive(runDir, state, {
|
|
1524
|
+
scope: "node",
|
|
1525
|
+
type: "node_heartbeat",
|
|
1526
|
+
nodeId,
|
|
1527
|
+
attemptId: state.currentAttemptId,
|
|
1528
|
+
payload: { statusDetail: state.statusDetail }
|
|
1529
|
+
});
|
|
1530
|
+
};
|
|
1531
|
+
if (heartbeatMs > 0) timer = setInterval(() => {
|
|
1532
|
+
heartbeat();
|
|
1533
|
+
}, heartbeatMs);
|
|
1534
|
+
try {
|
|
1535
|
+
return await withTimeout(run(), timeoutMs);
|
|
1536
|
+
} catch (error) {
|
|
1537
|
+
if (error instanceof TimeoutError && onTimeout) await onTimeout().catch(() => {});
|
|
1538
|
+
throw error;
|
|
1539
|
+
} finally {
|
|
1540
|
+
active = false;
|
|
1541
|
+
if (timer) clearInterval(timer);
|
|
1542
|
+
}
|
|
1543
|
+
}
|
|
1544
|
+
async ensureSessionBinding(runDir, state, flow, node, agent, timeoutMs) {
|
|
1545
|
+
const handle = node.session?.handle ?? "main";
|
|
1546
|
+
const key = createSessionBindingKey(agent.agentCommand, agent.cwd, handle);
|
|
1547
|
+
const existing = state.sessionBindings[key];
|
|
1548
|
+
if (existing) {
|
|
1549
|
+
await this.store.ensureSessionBundle(runDir, state, existing);
|
|
1550
|
+
return existing;
|
|
1551
|
+
}
|
|
1552
|
+
const name = createSessionName(flow.name, handle, agent.cwd, state.runId);
|
|
1553
|
+
const created = await createSessionWithClient({
|
|
1554
|
+
agentCommand: agent.agentCommand,
|
|
1555
|
+
cwd: agent.cwd,
|
|
1556
|
+
name,
|
|
1557
|
+
mcpServers: this.mcpServers,
|
|
1558
|
+
permissionMode: this.permissionMode,
|
|
1559
|
+
nonInteractivePermissions: this.nonInteractivePermissions,
|
|
1560
|
+
permissionPolicy: this.permissionPolicy,
|
|
1561
|
+
authCredentials: this.authCredentials,
|
|
1562
|
+
authPolicy: this.authPolicy,
|
|
1563
|
+
timeoutMs,
|
|
1564
|
+
verbose: this.verbose,
|
|
1565
|
+
sessionOptions: this.sessionOptions
|
|
1566
|
+
});
|
|
1567
|
+
const binding = {
|
|
1568
|
+
key,
|
|
1569
|
+
handle,
|
|
1570
|
+
bundleId: createSessionBundleId(handle, key),
|
|
1571
|
+
name,
|
|
1572
|
+
profile: node.profile,
|
|
1573
|
+
agentName: agent.agentName,
|
|
1574
|
+
agentCommand: agent.agentCommand,
|
|
1575
|
+
cwd: agent.cwd,
|
|
1576
|
+
acpxRecordId: created.record.acpxRecordId,
|
|
1577
|
+
acpSessionId: created.record.acpSessionId,
|
|
1578
|
+
agentSessionId: created.record.agentSessionId
|
|
1579
|
+
};
|
|
1580
|
+
state.sessionBindings[key] = binding;
|
|
1581
|
+
this.pendingPersistentSessionClients.set(binding.key, created.client);
|
|
1582
|
+
await this.store.ensureSessionBundle(runDir, state, binding, created.record);
|
|
1583
|
+
return binding;
|
|
1584
|
+
}
|
|
1585
|
+
async refreshSessionBinding(binding) {
|
|
1586
|
+
const record = await resolveSessionRecord(binding.acpxRecordId);
|
|
1587
|
+
return {
|
|
1588
|
+
...binding,
|
|
1589
|
+
acpSessionId: record.acpSessionId,
|
|
1590
|
+
agentSessionId: record.agentSessionId
|
|
1591
|
+
};
|
|
1592
|
+
}
|
|
1593
|
+
async runPersistentPrompt(runDir, state, binding, prompt, timeoutMs) {
|
|
1594
|
+
const capture = createQuietCaptureOutput();
|
|
1595
|
+
const beforeRecord = await resolveSessionRecord(binding.acpxRecordId);
|
|
1596
|
+
let eventStartSeq;
|
|
1597
|
+
let eventEndSeq;
|
|
1598
|
+
const pendingEventWrites = [];
|
|
1599
|
+
const initialClient = this.pendingPersistentSessionClients.get(binding.key);
|
|
1600
|
+
if (initialClient) this.pendingPersistentSessionClients.delete(binding.key);
|
|
1601
|
+
try {
|
|
1602
|
+
await sendSessionDirect({
|
|
1603
|
+
sessionId: binding.acpxRecordId,
|
|
1604
|
+
prompt,
|
|
1605
|
+
resumePolicy: "same-session-only",
|
|
1606
|
+
mcpServers: this.mcpServers,
|
|
1607
|
+
permissionMode: this.permissionMode,
|
|
1608
|
+
nonInteractivePermissions: this.nonInteractivePermissions,
|
|
1609
|
+
permissionPolicy: this.permissionPolicy,
|
|
1610
|
+
authCredentials: this.authCredentials,
|
|
1611
|
+
authPolicy: this.authPolicy,
|
|
1612
|
+
outputFormatter: capture.formatter,
|
|
1613
|
+
onAcpMessage: (direction, message) => {
|
|
1614
|
+
const pending = this.store.appendSessionEvent(runDir, binding, direction, message).then((seq) => {
|
|
1615
|
+
eventStartSeq = eventStartSeq === void 0 ? seq : Math.min(eventStartSeq, seq);
|
|
1616
|
+
eventEndSeq = eventEndSeq === void 0 ? seq : Math.max(eventEndSeq, seq);
|
|
1617
|
+
});
|
|
1618
|
+
pendingEventWrites.push(pending);
|
|
1619
|
+
},
|
|
1620
|
+
suppressSdkConsoleErrors: this.suppressSdkConsoleErrors,
|
|
1621
|
+
timeoutMs,
|
|
1622
|
+
verbose: this.verbose,
|
|
1623
|
+
client: initialClient
|
|
1624
|
+
});
|
|
1625
|
+
await Promise.all(pendingEventWrites);
|
|
1626
|
+
const sessionInfo = await this.refreshSessionBinding(binding);
|
|
1627
|
+
state.sessionBindings[sessionInfo.key] = sessionInfo;
|
|
1628
|
+
await this.store.ensureSessionBundle(runDir, state, sessionInfo);
|
|
1629
|
+
const afterRecord = await resolveSessionRecord(sessionInfo.acpxRecordId);
|
|
1630
|
+
await this.store.writeSessionRecord(runDir, state, sessionInfo, afterRecord);
|
|
1631
|
+
const messageStartResolved = findConversationDeltaStart(beforeRecord.messages, afterRecord.messages);
|
|
1632
|
+
return {
|
|
1633
|
+
rawText: capture.read(),
|
|
1634
|
+
sessionInfo,
|
|
1635
|
+
conversation: {
|
|
1636
|
+
sessionId: sessionInfo.bundleId,
|
|
1637
|
+
messageStart: messageStartResolved,
|
|
1638
|
+
messageEnd: Math.max(messageStartResolved, afterRecord.messages.length - 1),
|
|
1639
|
+
eventStartSeq: eventStartSeq ?? (() => {
|
|
1640
|
+
throw new Error(`Missing ACP event capture for session ${sessionInfo.bundleId}`);
|
|
1641
|
+
})(),
|
|
1642
|
+
eventEndSeq: eventEndSeq ?? (() => {
|
|
1643
|
+
throw new Error(`Missing ACP event capture for session ${sessionInfo.bundleId}`);
|
|
1644
|
+
})()
|
|
1645
|
+
}
|
|
1646
|
+
};
|
|
1647
|
+
} finally {
|
|
1648
|
+
if (initialClient) await initialClient.close().catch(() => {});
|
|
1649
|
+
}
|
|
1650
|
+
}
|
|
1651
|
+
async closePendingPersistentSessionClients() {
|
|
1652
|
+
const pendingClients = [...this.pendingPersistentSessionClients.values()];
|
|
1653
|
+
this.pendingPersistentSessionClients.clear();
|
|
1654
|
+
await Promise.all(pendingClients.map(async (client) => {
|
|
1655
|
+
await client.close().catch(() => {});
|
|
1656
|
+
}));
|
|
1657
|
+
}
|
|
1658
|
+
async runIsolatedPrompt(runDir, state, binding, agent, prompt, timeoutMs) {
|
|
1659
|
+
const capture = createQuietCaptureOutput();
|
|
1660
|
+
const conversation = createSessionConversation(state.currentNodeStartedAt ?? isoNow$1());
|
|
1661
|
+
let acpxState;
|
|
1662
|
+
recordPromptSubmission(conversation, prompt, state.currentNodeStartedAt ?? isoNow$1());
|
|
1663
|
+
let eventStartSeq;
|
|
1664
|
+
let eventEndSeq;
|
|
1665
|
+
const pendingEventWrites = [];
|
|
1666
|
+
const result = await runOnce({
|
|
1667
|
+
agentCommand: agent.agentCommand,
|
|
1668
|
+
cwd: agent.cwd,
|
|
1669
|
+
prompt,
|
|
1670
|
+
mcpServers: this.mcpServers,
|
|
1671
|
+
permissionMode: this.permissionMode,
|
|
1672
|
+
nonInteractivePermissions: this.nonInteractivePermissions,
|
|
1673
|
+
permissionPolicy: this.permissionPolicy,
|
|
1674
|
+
authCredentials: this.authCredentials,
|
|
1675
|
+
authPolicy: this.authPolicy,
|
|
1676
|
+
outputFormatter: capture.formatter,
|
|
1677
|
+
onAcpMessage: (direction, message) => {
|
|
1678
|
+
const pending = this.store.appendSessionEvent(runDir, binding, direction, message).then((seq) => {
|
|
1679
|
+
eventStartSeq = eventStartSeq === void 0 ? seq : Math.min(eventStartSeq, seq);
|
|
1680
|
+
eventEndSeq = eventEndSeq === void 0 ? seq : Math.max(eventEndSeq, seq);
|
|
1681
|
+
});
|
|
1682
|
+
pendingEventWrites.push(pending);
|
|
1683
|
+
},
|
|
1684
|
+
onSessionUpdate: (notification) => {
|
|
1685
|
+
acpxState = recordSessionUpdate(conversation, acpxState, notification);
|
|
1686
|
+
},
|
|
1687
|
+
onClientOperation: (operation) => {
|
|
1688
|
+
acpxState = recordClientOperation(conversation, acpxState, operation);
|
|
1689
|
+
},
|
|
1690
|
+
suppressSdkConsoleErrors: this.suppressSdkConsoleErrors,
|
|
1691
|
+
timeoutMs,
|
|
1692
|
+
verbose: this.verbose,
|
|
1693
|
+
sessionOptions: this.sessionOptions
|
|
1694
|
+
});
|
|
1695
|
+
await Promise.all(pendingEventWrites);
|
|
1696
|
+
const sessionInfo = {
|
|
1697
|
+
...binding,
|
|
1698
|
+
acpxRecordId: result.sessionId,
|
|
1699
|
+
acpSessionId: result.sessionId
|
|
1700
|
+
};
|
|
1701
|
+
await this.store.ensureSessionBundle(runDir, state, sessionInfo);
|
|
1702
|
+
const syntheticRecord = createSyntheticSessionRecord({
|
|
1703
|
+
binding: sessionInfo,
|
|
1704
|
+
createdAt: state.currentNodeStartedAt ?? isoNow$1(),
|
|
1705
|
+
updatedAt: conversation.updated_at,
|
|
1706
|
+
conversation,
|
|
1707
|
+
acpxState: cloneSessionAcpxState(acpxState),
|
|
1708
|
+
lastSeq: eventEndSeq ?? 0
|
|
1709
|
+
});
|
|
1710
|
+
await this.store.writeSessionRecord(runDir, state, sessionInfo, syntheticRecord);
|
|
1711
|
+
return {
|
|
1712
|
+
rawText: capture.read(),
|
|
1713
|
+
sessionInfo,
|
|
1714
|
+
conversation: {
|
|
1715
|
+
sessionId: sessionInfo.bundleId,
|
|
1716
|
+
messageStart: 0,
|
|
1717
|
+
messageEnd: Math.max(0, conversation.messages.length - 1),
|
|
1718
|
+
eventStartSeq: eventStartSeq ?? (() => {
|
|
1719
|
+
throw new Error(`Missing ACP event capture for session ${sessionInfo.bundleId}`);
|
|
1720
|
+
})(),
|
|
1721
|
+
eventEndSeq: eventEndSeq ?? (() => {
|
|
1722
|
+
throw new Error(`Missing ACP event capture for session ${sessionInfo.bundleId}`);
|
|
1723
|
+
})()
|
|
1724
|
+
}
|
|
1725
|
+
};
|
|
1726
|
+
}
|
|
1727
|
+
};
|
|
1728
|
+
//#endregion
|
|
1729
|
+
//#region src/flows/json.ts
|
|
1730
|
+
function normalizeJsonText(text) {
|
|
1731
|
+
if (typeof text === "string") return text.trim();
|
|
1732
|
+
if (text == null) return "";
|
|
1733
|
+
if (typeof text === "number" || typeof text === "boolean" || typeof text === "bigint" || typeof text === "symbol") return String(text).trim();
|
|
1734
|
+
return "";
|
|
1735
|
+
}
|
|
1736
|
+
function parseJsonObject(text, options = {}) {
|
|
1737
|
+
const trimmed = normalizeJsonText(text);
|
|
1738
|
+
if (!trimmed) throw new Error("Expected JSON output, got empty text");
|
|
1739
|
+
const mode = options.mode ?? "compat";
|
|
1740
|
+
const direct = tryParse(trimmed);
|
|
1741
|
+
if (direct.ok) return direct.value;
|
|
1742
|
+
const fenced = parseFencedJsonIfAllowed(trimmed, mode);
|
|
1743
|
+
if (fenced.ok) return fenced.value;
|
|
1744
|
+
if (mode === "compat") {
|
|
1745
|
+
const balanced = parseBalancedJsonCandidate(trimmed);
|
|
1746
|
+
if (balanced.ok) return balanced.value;
|
|
1747
|
+
}
|
|
1748
|
+
throw new Error(`Could not parse JSON from assistant output:\n${trimmed}`);
|
|
1749
|
+
}
|
|
1750
|
+
function parseFencedJsonIfAllowed(text, mode) {
|
|
1751
|
+
if (mode !== "fenced" && mode !== "compat") return { ok: false };
|
|
1752
|
+
const fencedText = extractFencedJsonText(text);
|
|
1753
|
+
return fencedText === null ? { ok: false } : tryParse(fencedText);
|
|
1754
|
+
}
|
|
1755
|
+
function parseBalancedJsonCandidate(text) {
|
|
1756
|
+
for (const candidate of extractBalancedJsonCandidates(text)) {
|
|
1757
|
+
const parsed = tryParse(candidate);
|
|
1758
|
+
if (parsed.ok) return parsed;
|
|
1759
|
+
}
|
|
1760
|
+
return { ok: false };
|
|
1761
|
+
}
|
|
1762
|
+
function parseStrictJsonObject(text) {
|
|
1763
|
+
return parseJsonObject(text, { mode: "strict" });
|
|
1764
|
+
}
|
|
1765
|
+
function extractJsonObject(text) {
|
|
1766
|
+
return parseJsonObject(text, { mode: "compat" });
|
|
1767
|
+
}
|
|
1768
|
+
function tryParse(text) {
|
|
1769
|
+
try {
|
|
1770
|
+
return {
|
|
1771
|
+
ok: true,
|
|
1772
|
+
value: JSON.parse(text)
|
|
1773
|
+
};
|
|
1774
|
+
} catch {
|
|
1775
|
+
return { ok: false };
|
|
1776
|
+
}
|
|
1777
|
+
}
|
|
1778
|
+
function extractFencedJsonText(text) {
|
|
1779
|
+
const openingFenceIndex = text.indexOf("```");
|
|
1780
|
+
if (openingFenceIndex === -1) return null;
|
|
1781
|
+
let contentStart = openingFenceIndex + 3;
|
|
1782
|
+
if (text.slice(contentStart, contentStart + 4).toLowerCase() === "json" && isFenceWhitespace(text[contentStart + 4])) contentStart += 4;
|
|
1783
|
+
while (isFenceWhitespace(text[contentStart])) contentStart += 1;
|
|
1784
|
+
const closingFenceIndex = text.indexOf("```", contentStart);
|
|
1785
|
+
if (closingFenceIndex === -1) return null;
|
|
1786
|
+
return text.slice(contentStart, closingFenceIndex).trim();
|
|
1787
|
+
}
|
|
1788
|
+
function isFenceWhitespace(char) {
|
|
1789
|
+
return char === " " || char === "\n" || char === "\r" || char === " ";
|
|
1790
|
+
}
|
|
1791
|
+
function extractBalancedJsonCandidates(text) {
|
|
1792
|
+
const candidates = [];
|
|
1793
|
+
for (let index = 0; index < text.length; index += 1) {
|
|
1794
|
+
if (text[index] !== "{" && text[index] !== "[") continue;
|
|
1795
|
+
const result = scanBalanced(text, index);
|
|
1796
|
+
if (result) candidates.push(result);
|
|
1797
|
+
}
|
|
1798
|
+
return candidates;
|
|
1799
|
+
}
|
|
1800
|
+
function scanBalanced(text, startIndex) {
|
|
1801
|
+
const stack = [];
|
|
1802
|
+
let inString = false;
|
|
1803
|
+
let escaped = false;
|
|
1804
|
+
for (let index = startIndex; index < text.length; index += 1) {
|
|
1805
|
+
const char = text[index];
|
|
1806
|
+
if (inString) {
|
|
1807
|
+
const next = scanStringChar(char, escaped);
|
|
1808
|
+
escaped = next.escaped;
|
|
1809
|
+
inString = next.inString;
|
|
1810
|
+
continue;
|
|
1811
|
+
}
|
|
1812
|
+
if (char === "\"") {
|
|
1813
|
+
inString = true;
|
|
1814
|
+
continue;
|
|
1815
|
+
}
|
|
1816
|
+
const result = scanBalancedToken(text, startIndex, index, char, stack);
|
|
1817
|
+
if (result !== SCAN_CONTINUE) return result;
|
|
1818
|
+
}
|
|
1819
|
+
return null;
|
|
1820
|
+
}
|
|
1821
|
+
const SCAN_CONTINUE = Symbol("scan-continue");
|
|
1822
|
+
function scanBalancedToken(text, startIndex, index, char, stack) {
|
|
1823
|
+
if (char === "{" || char === "[") {
|
|
1824
|
+
stack.push(char);
|
|
1825
|
+
return SCAN_CONTINUE;
|
|
1826
|
+
}
|
|
1827
|
+
if (char !== "}" && char !== "]") return SCAN_CONTINUE;
|
|
1828
|
+
if (!balancedClosingTokenMatches(stack.at(-1), char)) return null;
|
|
1829
|
+
stack.pop();
|
|
1830
|
+
return stack.length === 0 ? text.slice(startIndex, index + 1) : SCAN_CONTINUE;
|
|
1831
|
+
}
|
|
1832
|
+
function balancedClosingTokenMatches(open, close) {
|
|
1833
|
+
if (open === "{") return close === "}";
|
|
1834
|
+
if (open === "[") return close === "]";
|
|
1835
|
+
return false;
|
|
1836
|
+
}
|
|
1837
|
+
function scanStringChar(char, escaped) {
|
|
1838
|
+
if (escaped) return {
|
|
1839
|
+
escaped: false,
|
|
1840
|
+
inString: true
|
|
1841
|
+
};
|
|
1842
|
+
if (char === "\\") return {
|
|
1843
|
+
escaped: true,
|
|
1844
|
+
inString: true
|
|
1845
|
+
};
|
|
1846
|
+
return {
|
|
1847
|
+
escaped: false,
|
|
1848
|
+
inString: char !== "\""
|
|
1849
|
+
};
|
|
1850
|
+
}
|
|
1851
|
+
//#endregion
|
|
1852
|
+
//#region src/flows/decision.ts
|
|
1853
|
+
const DEFAULT_FIELD = "route";
|
|
1854
|
+
const SIMPLE_FIELD_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
1855
|
+
function decision(definition) {
|
|
1856
|
+
const { question, choices, field: fieldOverride, ...acpOptions } = definition;
|
|
1857
|
+
const field = normalizeField(fieldOverride);
|
|
1858
|
+
assertValidChoices(choices);
|
|
1859
|
+
const allowed = new Set(choices);
|
|
1860
|
+
return acp({
|
|
1861
|
+
...acpOptions,
|
|
1862
|
+
async prompt(context) {
|
|
1863
|
+
return formatDecisionPrompt(typeof question === "function" ? await question(context) : question, choices, field);
|
|
1864
|
+
},
|
|
1865
|
+
parse(text) {
|
|
1866
|
+
const raw = extractJsonObject(text);
|
|
1867
|
+
if (raw === null || typeof raw !== "object" || Array.isArray(raw)) throw new Error(`Decision response must be a JSON object, got ${typeof raw}`);
|
|
1868
|
+
const value = raw[field];
|
|
1869
|
+
if (typeof value !== "string" || !allowed.has(value)) {
|
|
1870
|
+
const allowedLabels = choices.map((choice) => JSON.stringify(choice)).join(", ");
|
|
1871
|
+
throw new Error(`Decision returned invalid ${field}=${JSON.stringify(value)}; expected one of ${allowedLabels}`);
|
|
1872
|
+
}
|
|
1873
|
+
return raw;
|
|
1874
|
+
}
|
|
1875
|
+
});
|
|
1876
|
+
}
|
|
1877
|
+
function decisionEdge(args) {
|
|
1878
|
+
const field = normalizeField(args.field);
|
|
1879
|
+
assertValidChoices(args.choices);
|
|
1880
|
+
for (const choice of args.choices) if (!Object.hasOwn(args.cases, choice)) throw new Error(`Decision edge is missing case for choice ${JSON.stringify(choice)}`);
|
|
1881
|
+
return {
|
|
1882
|
+
from: args.from,
|
|
1883
|
+
switch: {
|
|
1884
|
+
on: `$.${field}`,
|
|
1885
|
+
cases: args.cases
|
|
1886
|
+
}
|
|
1887
|
+
};
|
|
1888
|
+
}
|
|
1889
|
+
function assertValidChoices(choices) {
|
|
1890
|
+
if (choices.length === 0) throw new Error("Decision choices must include at least one value");
|
|
1891
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1892
|
+
for (const choice of choices) {
|
|
1893
|
+
if (typeof choice !== "string" || choice.length === 0) throw new Error("Decision choices must be non-empty strings");
|
|
1894
|
+
if (seen.has(choice)) throw new Error(`Decision choices must be unique; duplicate ${JSON.stringify(choice)}`);
|
|
1895
|
+
seen.add(choice);
|
|
1896
|
+
}
|
|
1897
|
+
}
|
|
1898
|
+
function normalizeField(fieldOverride) {
|
|
1899
|
+
const field = fieldOverride ?? DEFAULT_FIELD;
|
|
1900
|
+
if (!SIMPLE_FIELD_PATTERN.test(field)) throw new Error(`Decision field must be a simple JSON key matching ${SIMPLE_FIELD_PATTERN.source}`);
|
|
1901
|
+
return field;
|
|
1902
|
+
}
|
|
1903
|
+
function formatDecisionPrompt(question, choices, field) {
|
|
1904
|
+
const allowed = choices.map((choice) => JSON.stringify(choice)).join(" | ");
|
|
1905
|
+
return [
|
|
1906
|
+
question,
|
|
1907
|
+
"",
|
|
1908
|
+
"Return exactly one JSON object with this shape:",
|
|
1909
|
+
"{",
|
|
1910
|
+
` ${JSON.stringify(field)}: ${allowed},`,
|
|
1911
|
+
" \"reason\": \"short justification\"",
|
|
1912
|
+
"}",
|
|
1913
|
+
"",
|
|
1914
|
+
"Do not include any other text outside the JSON object."
|
|
1915
|
+
].join("\n");
|
|
1916
|
+
}
|
|
1917
|
+
//#endregion
|
|
1918
|
+
export { parseStrictJsonObject as a, validateFlowDefinition as c, checkpoint as d, compute as f, isDefinedFlow as h, parseJsonObject as i, acp as l, shell as m, decisionEdge as n, FlowRunner as o, defineFlow as p, extractJsonObject as r, flowRunsBaseDir as s, decision as t, action as u };
|
|
1919
|
+
|
|
1920
|
+
//# sourceMappingURL=flows-Db_LZKu9.js.map
|