deadbyte-mcp 0.8.7
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/DEADBYTE-MCP-R27-FINAL/R27-ADMIN-CLOSURE.json +22 -0
- package/DEADBYTE-MCP-R27-FINAL/R27-CLEANUP-FINAL-RECEIPT.json +24 -0
- package/DEADBYTE-MCP-R27-FINAL/R27-FINAL-CLOSURE.json +188 -0
- package/DEADBYTE-MCP-R27-FINAL/R27-SLOT-UPDATE-RECEIPT.json +109 -0
- package/DEADBYTE-MCP.cmd +4 -0
- package/MANIFEST.SHA256 +1389 -0
- package/README.txt +260 -0
- package/bin/WORKER-REGISTRY.txt +12 -0
- package/bin/appcontainer-stage.exe +0 -0
- package/bin/appcontainer-stage.obj +0 -0
- package/bin/bootstrap-advapi32.exe +0 -0
- package/bin/bootstrap-advapi32.obj +0 -0
- package/bin/bootstrap-exitcode.exe +0 -0
- package/bin/bootstrap-exitcode.obj +0 -0
- package/bin/bootstrap-kernel32.exe +0 -0
- package/bin/bootstrap-kernel32.obj +0 -0
- package/bin/child-control-probe.exe +0 -0
- package/bin/child-control-probe.obj +0 -0
- package/bin/child-control-stage.exe +0 -0
- package/bin/child-control-stage.obj +0 -0
- package/bin/contained-reverse-worker.exe +0 -0
- package/bin/contained-reverse-worker.obj +0 -0
- package/bin/contained-transform-worker.exe +0 -0
- package/bin/contained-transform-worker.obj +0 -0
- package/bin/containment-probe.exe +0 -0
- package/bin/containment-probe.obj +0 -0
- package/bin/deadbyte-contain.exe +0 -0
- package/bin/deadbyte-contain.obj +0 -0
- package/bin/deadbyte-exec.exe +0 -0
- package/bin/deadbyte-exec.obj +0 -0
- package/bin/deadbyte-process-host.exe +0 -0
- package/bin/deadbyte-process-host.obj +0 -0
- package/bin/deadbyte-tunnel-host.exe +0 -0
- package/bin/deadbyte-tunnel-host.obj +0 -0
- package/conpty-input-observer.obj +0 -0
- package/controller/DEADBYTE-MCP.cmd +5 -0
- package/controller/README.TXT +127 -0
- package/controller/deadbyte-controller.config.psd1.example +60 -0
- package/controller/deadbyte-controller.ps1 +1090 -0
- package/controller/deadbyte-host-policy.json.example +33 -0
- package/controller/deadbyte-process-policy.json +47 -0
- package/docs/ARCHITECTURE.md +168 -0
- package/docs/AUTHORITY.md +56 -0
- package/docs/CHILD-CONTROL.md +31 -0
- package/docs/CONSTRUCTION-LADDER.md +84 -0
- package/docs/CONTAINMENT.md +92 -0
- package/docs/EXECUTION.md +330 -0
- package/docs/NETWORK.md +64 -0
- package/docs/R221-STRICT-OUTPUT-CONTRACT.md +24 -0
- package/docs/REFERENCES.txt +117 -0
- package/docs/TRUST.md +46 -0
- package/docs/V070-HARDENING.md +48 -0
- package/docs/V071-HOST-PLANE.md +113 -0
- package/docs/V073-TUNNEL-STDIO-COMPAT.md +37 -0
- package/docs/V080-AGENT-RUNTIME.md +101 -0
- package/docs/V080-R23-CODING-AGENT.md +50 -0
- package/docs/V080-R24-AUTONOMOUS-PRODUCTION.md +74 -0
- package/docs/V081-R25-MANUS-CONTROL-SEMANTICS.md +145 -0
- package/docs/V082-R26-RUNTIME-SELF-UPDATE.md +86 -0
- package/docs/V083-R27-IMMUTABLE-RELEASE-SLOTS.md +55 -0
- package/docs/V084-R28-PERSISTENT-NAMED-TUNNEL.md +57 -0
- package/docs/V085-R29-MACHINE-IDENTITY.md +99 -0
- package/docs/superpowers/plans/2026-09-14-r30-process-plane.md +178 -0
- package/docs/superpowers/plans/2026-09-14-r31-process-prerequisite.md +132 -0
- package/docs/superpowers/plans/2026-09-15-r33-audit-chain-npx.md +132 -0
- package/docs/superpowers/specs/2026-09-14-r30-r33-machine-control-design.md +214 -0
- package/docs/superpowers/specs/2026-09-14-r31-r33-final-baseline-successor-design.md +133 -0
- package/docs/superpowers/specs/2026-09-15-r33-audit-chain-npx-design.md +145 -0
- package/mcp-server.mjs +1 -0
- package/miniconpty.obj +0 -0
- package/native/appcontainer-stage.cpp +353 -0
- package/native/bootstrap-advapi32.cpp +70 -0
- package/native/bootstrap-exitcode.cpp +6 -0
- package/native/bootstrap-kernel32.cpp +47 -0
- package/native/child-control-probe.cpp +67 -0
- package/native/child-control-stage.cpp +347 -0
- package/native/contained-network-proof.h +118 -0
- package/native/contained-reverse-worker.cpp +299 -0
- package/native/contained-transform-worker.cpp +312 -0
- package/native/containment-probe.cpp +269 -0
- package/native/deadbyte-contain.cpp +625 -0
- package/native/deadbyte-exec.cpp +966 -0
- package/native/deadbyte-process-host.cpp +340 -0
- package/native/deadbyte-tunnel-host.cpp +109 -0
- package/node_modules/@modelcontextprotocol/client/LICENSE +216 -0
- package/node_modules/@modelcontextprotocol/client/README.md +26 -0
- package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-1b6pVpkg.cjs +7531 -0
- package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-1b6pVpkg.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-97rDpkRx.mjs +7514 -0
- package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-97rDpkRx.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-FOQRM7up.d.cts +1071 -0
- package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-FOQRM7up.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-INpkxUi1.d.mts +1071 -0
- package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-INpkxUi1.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-B3ZJEoRM.d.mts +74 -0
- package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-B3ZJEoRM.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-B3dvjU3F.cjs +986 -0
- package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-B3dvjU3F.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-BylNJ1R5.mjs +981 -0
- package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-BylNJ1R5.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-doTkZbTr.d.cts +74 -0
- package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-doTkZbTr.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/chunk-Bnu9O96Y.cjs +60 -0
- package/node_modules/@modelcontextprotocol/client/dist/chunk-Br0eD_fh.mjs +42 -0
- package/node_modules/@modelcontextprotocol/client/dist/dialects-BGO_ZrYF.cjs +46 -0
- package/node_modules/@modelcontextprotocol/client/dist/dialects-BGO_ZrYF.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/dialects-BOhdv1Fc.mjs +34 -0
- package/node_modules/@modelcontextprotocol/client/dist/dialects-BOhdv1Fc.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/index-CHhhk6PQ.d.cts +2526 -0
- package/node_modules/@modelcontextprotocol/client/dist/index-CHhhk6PQ.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/index-D4xIIEF6.d.mts +2523 -0
- package/node_modules/@modelcontextprotocol/client/dist/index-D4xIIEF6.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/index.cjs +5690 -0
- package/node_modules/@modelcontextprotocol/client/dist/index.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/index.d.cts +3252 -0
- package/node_modules/@modelcontextprotocol/client/dist/index.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/index.d.mts +3252 -0
- package/node_modules/@modelcontextprotocol/client/dist/index.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/index.mjs +5481 -0
- package/node_modules/@modelcontextprotocol/client/dist/index.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.cjs +14 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.d.cts +13 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.d.mts +13 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.mjs +13 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsNode.cjs +14 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsNode.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsNode.d.cts +13 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsNode.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsNode.d.mts +13 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsNode.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsNode.mjs +13 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsNode.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.cjs +21 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.d.cts +13 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.d.mts +13 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.mjs +20 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/src-D_zzAWoS.mjs +7063 -0
- package/node_modules/@modelcontextprotocol/client/dist/src-D_zzAWoS.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/src-NAgB4Mp8.cjs +7431 -0
- package/node_modules/@modelcontextprotocol/client/dist/src-NAgB4Mp8.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/stdio.cjs +217 -0
- package/node_modules/@modelcontextprotocol/client/dist/stdio.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/stdio.d.cts +96 -0
- package/node_modules/@modelcontextprotocol/client/dist/stdio.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/stdio.d.mts +96 -0
- package/node_modules/@modelcontextprotocol/client/dist/stdio.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/stdio.mjs +212 -0
- package/node_modules/@modelcontextprotocol/client/dist/stdio.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/types-DsbMXNFL.d.cts +1099 -0
- package/node_modules/@modelcontextprotocol/client/dist/types-DsbMXNFL.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/types-mS0yxCL0.d.mts +1099 -0
- package/node_modules/@modelcontextprotocol/client/dist/types-mS0yxCL0.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/validators/ajv.cjs +5 -0
- package/node_modules/@modelcontextprotocol/client/dist/validators/ajv.d.cts +2 -0
- package/node_modules/@modelcontextprotocol/client/dist/validators/ajv.d.mts +2 -0
- package/node_modules/@modelcontextprotocol/client/dist/validators/ajv.mjs +3 -0
- package/node_modules/@modelcontextprotocol/client/dist/validators/cfWorker.cjs +3 -0
- package/node_modules/@modelcontextprotocol/client/dist/validators/cfWorker.d.cts +2 -0
- package/node_modules/@modelcontextprotocol/client/dist/validators/cfWorker.d.mts +2 -0
- package/node_modules/@modelcontextprotocol/client/dist/validators/cfWorker.mjs +3 -0
- package/node_modules/@modelcontextprotocol/client/package.json +166 -0
- package/node_modules/@modelcontextprotocol/core/LICENSE +216 -0
- package/node_modules/@modelcontextprotocol/core/README.md +40 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-BWdKR39I.d.mts +8501 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-BWdKR39I.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-CUe6YdwF.mjs +1678 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-CUe6YdwF.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-CfDMXiII.cjs +2899 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-CfDMXiII.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-hYtaIUZm.d.cts +8501 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-hYtaIUZm.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/core/dist/index.cjs +175 -0
- package/node_modules/@modelcontextprotocol/core/dist/index.d.cts +2 -0
- package/node_modules/@modelcontextprotocol/core/dist/index.d.mts +2 -0
- package/node_modules/@modelcontextprotocol/core/dist/index.mjs +3 -0
- package/node_modules/@modelcontextprotocol/core/dist/internal.cjs +201 -0
- package/node_modules/@modelcontextprotocol/core/dist/internal.d.cts +99 -0
- package/node_modules/@modelcontextprotocol/core/dist/internal.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/core/dist/internal.d.mts +99 -0
- package/node_modules/@modelcontextprotocol/core/dist/internal.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/core/dist/internal.mjs +3 -0
- package/node_modules/@modelcontextprotocol/core/package.json +85 -0
- package/node_modules/@modelcontextprotocol/server/LICENSE +216 -0
- package/node_modules/@modelcontextprotocol/server/README.md +30 -0
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CEoC__sr.mjs +7514 -0
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CEoC__sr.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CgI-5L6O.d.mts +1071 -0
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CgI-5L6O.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-FOQRM7up.d.cts +1071 -0
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-FOQRM7up.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-ZaoO9afR.cjs +7531 -0
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-ZaoO9afR.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-BwbPzsdI.cjs +986 -0
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-BwbPzsdI.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-C03CSigr.d.mts +74 -0
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-C03CSigr.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-doTkZbTr.d.cts +74 -0
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-doTkZbTr.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-p3WaZPqB.mjs +981 -0
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-p3WaZPqB.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/chunk-Bnu9O96Y.cjs +60 -0
- package/node_modules/@modelcontextprotocol/server/dist/chunk-Br0eD_fh.mjs +42 -0
- package/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-CLhGwQTn.d.mts +4043 -0
- package/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-CLhGwQTn.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-dBHMsxwf.d.cts +4045 -0
- package/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-dBHMsxwf.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/dialects-D8eXzoGv.cjs +46 -0
- package/node_modules/@modelcontextprotocol/server/dist/dialects-D8eXzoGv.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/dialects-DoSzNhcb.mjs +34 -0
- package/node_modules/@modelcontextprotocol/server/dist/dialects-DoSzNhcb.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/index.cjs +2055 -0
- package/node_modules/@modelcontextprotocol/server/dist/index.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/index.d.cts +739 -0
- package/node_modules/@modelcontextprotocol/server/dist/index.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/index.d.mts +739 -0
- package/node_modules/@modelcontextprotocol/server/dist/index.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/index.mjs +1870 -0
- package/node_modules/@modelcontextprotocol/server/dist/index.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/mcp-D7GmuPnv.cjs +2022 -0
- package/node_modules/@modelcontextprotocol/server/dist/mcp-D7GmuPnv.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs +1931 -0
- package/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.cjs +23 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.cts +11 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.mts +11 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.mjs +22 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsNode.cjs +12 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsNode.d.cts +3 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsNode.d.mts +3 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsNode.mjs +4 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.cjs +30 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.cts +10 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.mts +10 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.mjs +29 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/src-CX2iR2pK.mjs +7606 -0
- package/node_modules/@modelcontextprotocol/server/dist/src-CX2iR2pK.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/src-STyD_Vvf.cjs +8104 -0
- package/node_modules/@modelcontextprotocol/server/dist/src-STyD_Vvf.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/stdio.cjs +564 -0
- package/node_modules/@modelcontextprotocol/server/dist/stdio.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/stdio.d.cts +107 -0
- package/node_modules/@modelcontextprotocol/server/dist/stdio.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/stdio.d.mts +107 -0
- package/node_modules/@modelcontextprotocol/server/dist/stdio.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/stdio.mjs +562 -0
- package/node_modules/@modelcontextprotocol/server/dist/stdio.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/types-DUs7mGBv.d.mts +1099 -0
- package/node_modules/@modelcontextprotocol/server/dist/types-DUs7mGBv.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/types-DsbMXNFL.d.cts +1099 -0
- package/node_modules/@modelcontextprotocol/server/dist/types-DsbMXNFL.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/validators/ajv.cjs +5 -0
- package/node_modules/@modelcontextprotocol/server/dist/validators/ajv.d.cts +2 -0
- package/node_modules/@modelcontextprotocol/server/dist/validators/ajv.d.mts +2 -0
- package/node_modules/@modelcontextprotocol/server/dist/validators/ajv.mjs +3 -0
- package/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.cjs +3 -0
- package/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.d.cts +2 -0
- package/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.d.mts +2 -0
- package/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.mjs +3 -0
- package/node_modules/@modelcontextprotocol/server/package.json +160 -0
- package/node_modules/cross-spawn/LICENSE +21 -0
- package/node_modules/cross-spawn/README.md +89 -0
- package/node_modules/cross-spawn/index.js +39 -0
- package/node_modules/cross-spawn/lib/enoent.js +59 -0
- package/node_modules/cross-spawn/lib/parse.js +91 -0
- package/node_modules/cross-spawn/lib/util/escape.js +47 -0
- package/node_modules/cross-spawn/lib/util/readShebang.js +23 -0
- package/node_modules/cross-spawn/lib/util/resolveCommand.js +52 -0
- package/node_modules/cross-spawn/package.json +73 -0
- package/node_modules/eventsource/LICENSE +22 -0
- package/node_modules/eventsource/README.md +167 -0
- package/node_modules/eventsource/dist/index.cjs +273 -0
- package/node_modules/eventsource/dist/index.cjs.map +1 -0
- package/node_modules/eventsource/dist/index.d.cts +332 -0
- package/node_modules/eventsource/dist/index.d.ts +332 -0
- package/node_modules/eventsource/dist/index.js +273 -0
- package/node_modules/eventsource/dist/index.js.map +1 -0
- package/node_modules/eventsource/package.json +130 -0
- package/node_modules/eventsource/src/EventSource.ts +596 -0
- package/node_modules/eventsource/src/errors.ts +141 -0
- package/node_modules/eventsource/src/index.ts +3 -0
- package/node_modules/eventsource/src/types.ts +152 -0
- package/node_modules/eventsource-parser/LICENSE +21 -0
- package/node_modules/eventsource-parser/README.md +157 -0
- package/node_modules/eventsource-parser/dist/index.cjs +177 -0
- package/node_modules/eventsource-parser/dist/index.cjs.map +1 -0
- package/node_modules/eventsource-parser/dist/index.d.cts +169 -0
- package/node_modules/eventsource-parser/dist/index.d.ts +169 -0
- package/node_modules/eventsource-parser/dist/index.js +177 -0
- package/node_modules/eventsource-parser/dist/index.js.map +1 -0
- package/node_modules/eventsource-parser/dist/stream.cjs +29 -0
- package/node_modules/eventsource-parser/dist/stream.cjs.map +1 -0
- package/node_modules/eventsource-parser/dist/stream.d.cts +134 -0
- package/node_modules/eventsource-parser/dist/stream.d.ts +134 -0
- package/node_modules/eventsource-parser/dist/stream.js +30 -0
- package/node_modules/eventsource-parser/dist/stream.js.map +1 -0
- package/node_modules/eventsource-parser/package.json +92 -0
- package/node_modules/eventsource-parser/src/errors.ts +44 -0
- package/node_modules/eventsource-parser/src/index.ts +8 -0
- package/node_modules/eventsource-parser/src/parse.ts +439 -0
- package/node_modules/eventsource-parser/src/stream.ts +107 -0
- package/node_modules/eventsource-parser/src/types.ts +122 -0
- package/node_modules/eventsource-parser/stream.js +2 -0
- package/node_modules/isexe/.npmignore +2 -0
- package/node_modules/isexe/LICENSE +15 -0
- package/node_modules/isexe/README.md +51 -0
- package/node_modules/isexe/index.js +57 -0
- package/node_modules/isexe/mode.js +41 -0
- package/node_modules/isexe/package.json +31 -0
- package/node_modules/isexe/test/basic.js +221 -0
- package/node_modules/isexe/windows.js +42 -0
- package/node_modules/jose/LICENSE.md +21 -0
- package/node_modules/jose/README.md +150 -0
- package/node_modules/jose/dist/types/index.d.ts +56 -0
- package/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +37 -0
- package/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +54 -0
- package/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +37 -0
- package/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +72 -0
- package/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +43 -0
- package/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +74 -0
- package/node_modules/jose/dist/types/jwk/embedded.d.ts +13 -0
- package/node_modules/jose/dist/types/jwk/thumbprint.d.ts +17 -0
- package/node_modules/jose/dist/types/jwks/local.d.ts +20 -0
- package/node_modules/jose/dist/types/jwks/remote.d.ts +106 -0
- package/node_modules/jose/dist/types/jws/compact/sign.d.ts +25 -0
- package/node_modules/jose/dist/types/jws/compact/verify.d.ts +37 -0
- package/node_modules/jose/dist/types/jws/flattened/sign.d.ts +31 -0
- package/node_modules/jose/dist/types/jws/flattened/verify.d.ts +37 -0
- package/node_modules/jose/dist/types/jws/general/sign.d.ts +52 -0
- package/node_modules/jose/dist/types/jws/general/verify.d.ts +44 -0
- package/node_modules/jose/dist/types/jwt/decrypt.d.ts +41 -0
- package/node_modules/jose/dist/types/jwt/encrypt.d.ts +62 -0
- package/node_modules/jose/dist/types/jwt/sign.d.ts +26 -0
- package/node_modules/jose/dist/types/jwt/unsecured.d.ts +28 -0
- package/node_modules/jose/dist/types/jwt/verify.d.ts +38 -0
- package/node_modules/jose/dist/types/key/export.d.ts +19 -0
- package/node_modules/jose/dist/types/key/generate_key_pair.d.ts +40 -0
- package/node_modules/jose/dist/types/key/generate_secret.d.ts +37 -0
- package/node_modules/jose/dist/types/key/import.d.ts +73 -0
- package/node_modules/jose/dist/types/types.d.ts +871 -0
- package/node_modules/jose/dist/types/util/base64url.d.ts +16 -0
- package/node_modules/jose/dist/types/util/decode_jwt.d.ts +10 -0
- package/node_modules/jose/dist/types/util/decode_protected_header.d.ts +9 -0
- package/node_modules/jose/dist/types/util/errors.d.ts +220 -0
- package/node_modules/jose/dist/webapi/index.js +32 -0
- package/node_modules/jose/dist/webapi/jwe/compact/decrypt.js +9 -0
- package/node_modules/jose/dist/webapi/jwe/compact/encrypt.js +49 -0
- package/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js +15 -0
- package/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js +65 -0
- package/node_modules/jose/dist/webapi/jwe/general/decrypt.js +51 -0
- package/node_modules/jose/dist/webapi/jwe/general/encrypt.js +177 -0
- package/node_modules/jose/dist/webapi/jwk/embedded.js +33 -0
- package/node_modules/jose/dist/webapi/jwk/thumbprint.js +74 -0
- package/node_modules/jose/dist/webapi/jwks/local.js +70 -0
- package/node_modules/jose/dist/webapi/jwks/remote.js +149 -0
- package/node_modules/jose/dist/webapi/jws/compact/sign.js +22 -0
- package/node_modules/jose/dist/webapi/jws/compact/verify.js +9 -0
- package/node_modules/jose/dist/webapi/jws/flattened/sign.js +32 -0
- package/node_modules/jose/dist/webapi/jws/flattened/verify.js +25 -0
- package/node_modules/jose/dist/webapi/jws/general/sign.js +76 -0
- package/node_modules/jose/dist/webapi/jws/general/verify.js +74 -0
- package/node_modules/jose/dist/webapi/jwt/decrypt.js +21 -0
- package/node_modules/jose/dist/webapi/jwt/encrypt.js +72 -0
- package/node_modules/jose/dist/webapi/jwt/sign.js +18 -0
- package/node_modules/jose/dist/webapi/jwt/unsecured.js +43 -0
- package/node_modules/jose/dist/webapi/jwt/verify.js +15 -0
- package/node_modules/jose/dist/webapi/key/export.js +44 -0
- package/node_modules/jose/dist/webapi/key/generate_key_pair.js +52 -0
- package/node_modules/jose/dist/webapi/key/generate_secret.js +41 -0
- package/node_modules/jose/dist/webapi/key/import.js +61 -0
- package/node_modules/jose/dist/webapi/lib/asn1.js +179 -0
- package/node_modules/jose/dist/webapi/lib/base64.js +22 -0
- package/node_modules/jose/dist/webapi/lib/buffer_utils.js +44 -0
- package/node_modules/jose/dist/webapi/lib/content_encryption.js +134 -0
- package/node_modules/jose/dist/webapi/lib/crypto_key.js +28 -0
- package/node_modules/jose/dist/webapi/lib/deflate.js +52 -0
- package/node_modules/jose/dist/webapi/lib/helpers.js +42 -0
- package/node_modules/jose/dist/webapi/lib/invalid_key_input.js +26 -0
- package/node_modules/jose/dist/webapi/lib/is_key_like.js +17 -0
- package/node_modules/jose/dist/webapi/lib/jwe_algorithms.js +107 -0
- package/node_modules/jose/dist/webapi/lib/jwe_decrypt.js +243 -0
- package/node_modules/jose/dist/webapi/lib/jwe_encrypt.js +142 -0
- package/node_modules/jose/dist/webapi/lib/jwk_metadata.js +20 -0
- package/node_modules/jose/dist/webapi/lib/jwk_to_key.js +17 -0
- package/node_modules/jose/dist/webapi/lib/jws_algorithms.js +73 -0
- package/node_modules/jose/dist/webapi/lib/jws_sign.js +85 -0
- package/node_modules/jose/dist/webapi/lib/jws_verify.js +139 -0
- package/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +232 -0
- package/node_modules/jose/dist/webapi/lib/key.js +147 -0
- package/node_modules/jose/dist/webapi/lib/key_algorithm.js +10 -0
- package/node_modules/jose/dist/webapi/lib/key_descriptor.js +7 -0
- package/node_modules/jose/dist/webapi/lib/key_management.js +262 -0
- package/node_modules/jose/dist/webapi/lib/key_options.js +6 -0
- package/node_modules/jose/dist/webapi/lib/options.js +74 -0
- package/node_modules/jose/dist/webapi/lib/signing.js +26 -0
- package/node_modules/jose/dist/webapi/lib/type_checks.js +33 -0
- package/node_modules/jose/dist/webapi/util/base64url.js +39 -0
- package/node_modules/jose/dist/webapi/util/decode_jwt.js +32 -0
- package/node_modules/jose/dist/webapi/util/decode_protected_header.js +24 -0
- package/node_modules/jose/dist/webapi/util/errors.js +99 -0
- package/node_modules/jose/package.json +198 -0
- package/node_modules/path-key/index.d.ts +40 -0
- package/node_modules/path-key/index.js +16 -0
- package/node_modules/path-key/license +9 -0
- package/node_modules/path-key/package.json +39 -0
- package/node_modules/path-key/readme.md +61 -0
- package/node_modules/pkce-challenge/CHANGELOG.md +114 -0
- package/node_modules/pkce-challenge/LICENSE +21 -0
- package/node_modules/pkce-challenge/README.md +55 -0
- package/node_modules/pkce-challenge/dist/index.browser.d.ts +19 -0
- package/node_modules/pkce-challenge/dist/index.browser.js +75 -0
- package/node_modules/pkce-challenge/dist/index.node.cjs +83 -0
- package/node_modules/pkce-challenge/dist/index.node.d.cts +19 -0
- package/node_modules/pkce-challenge/dist/index.node.d.ts +19 -0
- package/node_modules/pkce-challenge/dist/index.node.js +78 -0
- package/node_modules/pkce-challenge/package.json +59 -0
- package/node_modules/shebang-command/index.js +19 -0
- package/node_modules/shebang-command/license +9 -0
- package/node_modules/shebang-command/package.json +34 -0
- package/node_modules/shebang-command/readme.md +34 -0
- package/node_modules/shebang-regex/index.d.ts +22 -0
- package/node_modules/shebang-regex/index.js +2 -0
- package/node_modules/shebang-regex/license +9 -0
- package/node_modules/shebang-regex/package.json +35 -0
- package/node_modules/shebang-regex/readme.md +33 -0
- package/node_modules/which/LICENSE +15 -0
- package/node_modules/which/README.md +54 -0
- package/node_modules/which/bin/node-which +52 -0
- package/node_modules/which/package.json +43 -0
- package/node_modules/which/which.js +125 -0
- package/node_modules/zod/LICENSE +21 -0
- package/node_modules/zod/README.md +191 -0
- package/node_modules/zod/index.cjs +33 -0
- package/node_modules/zod/index.d.cts +4 -0
- package/node_modules/zod/index.d.ts +4 -0
- package/node_modules/zod/index.js +4 -0
- package/node_modules/zod/locales/index.cjs +17 -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 +32 -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 +135 -0
- package/node_modules/zod/src/index.ts +4 -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 +330 -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 +551 -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 +110 -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 +207 -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 +434 -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 +194 -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 +916 -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 +32 -0
- package/node_modules/zod/src/v4/classic/coerce.ts +27 -0
- package/node_modules/zod/src/v4/classic/compat.ts +70 -0
- package/node_modules/zod/src/v4/classic/errors.ts +82 -0
- package/node_modules/zod/src/v4/classic/external.ts +52 -0
- package/node_modules/zod/src/v4/classic/from-json-schema.ts +659 -0
- package/node_modules/zod/src/v4/classic/index.ts +5 -0
- package/node_modules/zod/src/v4/classic/iso.ts +90 -0
- package/node_modules/zod/src/v4/classic/parse.ts +82 -0
- package/node_modules/zod/src/v4/classic/schemas.ts +2672 -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 +59 -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 +216 -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 +54 -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 +326 -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 +573 -0
- package/node_modules/zod/src/v4/classic/tests/codec.test.ts +703 -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/custom.test.ts +40 -0
- package/node_modules/zod/src/v4/classic/tests/date.test.ts +62 -0
- package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +302 -0
- package/node_modules/zod/src/v4/classic/tests/default.test.ts +409 -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 +197 -0
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +694 -0
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +285 -0
- package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +807 -0
- package/node_modules/zod/src/v4/classic/tests/error.test.ts +711 -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 +895 -0
- package/node_modules/zod/src/v4/classic/tests/function.test.ts +360 -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 +39 -0
- package/node_modules/zod/src/v4/classic/tests/hash.test.ts +68 -0
- package/node_modules/zod/src/v4/classic/tests/index.test.ts +939 -0
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +60 -0
- package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +198 -0
- package/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +46 -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 +227 -0
- package/node_modules/zod/src/v4/classic/tests/literal.test.ts +117 -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 +330 -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 +325 -0
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +717 -0
- package/node_modules/zod/src/v4/classic/tests/optional.test.ts +333 -0
- package/node_modules/zod/src/v4/classic/tests/partial.test.ts +450 -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 +74 -0
- package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +26 -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/prototypes.test.ts +23 -0
- package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +252 -0
- package/node_modules/zod/src/v4/classic/tests/record.test.ts +717 -0
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +631 -0
- package/node_modules/zod/src/v4/classic/tests/refine.test.ts +633 -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 +181 -0
- package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +134 -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 +1224 -0
- package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +106 -0
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +771 -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 +3125 -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 +496 -0
- package/node_modules/zod/src/v4/classic/tests/union.test.ts +273 -0
- package/node_modules/zod/src/v4/classic/tests/url.test.ts +13 -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 +1823 -0
- package/node_modules/zod/src/v4/core/checks.ts +1293 -0
- package/node_modules/zod/src/v4/core/config.ts +15 -0
- package/node_modules/zod/src/v4/core/core.ts +153 -0
- package/node_modules/zod/src/v4/core/doc.ts +44 -0
- package/node_modules/zod/src/v4/core/errors.ts +455 -0
- package/node_modules/zod/src/v4/core/index.ts +16 -0
- package/node_modules/zod/src/v4/core/json-schema-generator.ts +126 -0
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +666 -0
- package/node_modules/zod/src/v4/core/json-schema.ts +147 -0
- package/node_modules/zod/src/v4/core/parse.ts +195 -0
- package/node_modules/zod/src/v4/core/regexes.ts +190 -0
- package/node_modules/zod/src/v4/core/registries.ts +105 -0
- package/node_modules/zod/src/v4/core/schemas.ts +4730 -0
- package/node_modules/zod/src/v4/core/standard-schema.ts +159 -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 +215 -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 +181 -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/ru.test.ts +128 -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/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/to-json-schema.ts +622 -0
- package/node_modules/zod/src/v4/core/util.ts +983 -0
- package/node_modules/zod/src/v4/core/versions.ts +5 -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 +115 -0
- package/node_modules/zod/src/v4/locales/az.ts +111 -0
- package/node_modules/zod/src/v4/locales/be.ts +176 -0
- package/node_modules/zod/src/v4/locales/bg.ts +128 -0
- package/node_modules/zod/src/v4/locales/ca.ts +116 -0
- package/node_modules/zod/src/v4/locales/cs.ts +118 -0
- package/node_modules/zod/src/v4/locales/da.ts +123 -0
- package/node_modules/zod/src/v4/locales/de.ts +116 -0
- package/node_modules/zod/src/v4/locales/el.ts +121 -0
- package/node_modules/zod/src/v4/locales/en.ts +123 -0
- package/node_modules/zod/src/v4/locales/eo.ts +118 -0
- package/node_modules/zod/src/v4/locales/es.ts +141 -0
- package/node_modules/zod/src/v4/locales/fa.ts +126 -0
- package/node_modules/zod/src/v4/locales/fi.ts +121 -0
- package/node_modules/zod/src/v4/locales/fr-CA.ts +116 -0
- package/node_modules/zod/src/v4/locales/fr.ts +132 -0
- package/node_modules/zod/src/v4/locales/he.ts +246 -0
- package/node_modules/zod/src/v4/locales/hr.ts +131 -0
- package/node_modules/zod/src/v4/locales/hu.ts +117 -0
- package/node_modules/zod/src/v4/locales/hy.ts +164 -0
- package/node_modules/zod/src/v4/locales/id.ts +115 -0
- package/node_modules/zod/src/v4/locales/index.ts +52 -0
- package/node_modules/zod/src/v4/locales/is.ts +119 -0
- package/node_modules/zod/src/v4/locales/it.ts +116 -0
- package/node_modules/zod/src/v4/locales/ja.ts +114 -0
- package/node_modules/zod/src/v4/locales/ka.ts +123 -0
- package/node_modules/zod/src/v4/locales/kh.ts +7 -0
- package/node_modules/zod/src/v4/locales/km.ts +119 -0
- package/node_modules/zod/src/v4/locales/ko.ts +121 -0
- package/node_modules/zod/src/v4/locales/lt.ts +239 -0
- package/node_modules/zod/src/v4/locales/mk.ts +118 -0
- package/node_modules/zod/src/v4/locales/ms.ts +115 -0
- package/node_modules/zod/src/v4/locales/nl.ts +121 -0
- package/node_modules/zod/src/v4/locales/no.ts +116 -0
- package/node_modules/zod/src/v4/locales/ota.ts +117 -0
- package/node_modules/zod/src/v4/locales/pl.ts +118 -0
- package/node_modules/zod/src/v4/locales/ps.ts +126 -0
- package/node_modules/zod/src/v4/locales/pt.ts +116 -0
- package/node_modules/zod/src/v4/locales/ro.ts +129 -0
- package/node_modules/zod/src/v4/locales/ru.ts +176 -0
- package/node_modules/zod/src/v4/locales/sl.ts +118 -0
- package/node_modules/zod/src/v4/locales/sv.ts +119 -0
- package/node_modules/zod/src/v4/locales/ta.ts +118 -0
- package/node_modules/zod/src/v4/locales/th.ts +119 -0
- package/node_modules/zod/src/v4/locales/tr.ts +111 -0
- package/node_modules/zod/src/v4/locales/ua.ts +7 -0
- package/node_modules/zod/src/v4/locales/uk.ts +117 -0
- package/node_modules/zod/src/v4/locales/ur.ts +119 -0
- package/node_modules/zod/src/v4/locales/uz.ts +117 -0
- package/node_modules/zod/src/v4/locales/vi.ts +117 -0
- package/node_modules/zod/src/v4/locales/yo.ts +124 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +116 -0
- package/node_modules/zod/src/v4/locales/zh-TW.ts +115 -0
- package/node_modules/zod/src/v4/mini/checks.ts +32 -0
- package/node_modules/zod/src/v4/mini/coerce.ts +27 -0
- package/node_modules/zod/src/v4/mini/external.ts +41 -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 +14 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +1947 -0
- package/node_modules/zod/src/v4/mini/tests/apply.test.ts +24 -0
- package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +129 -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 +144 -0
- package/node_modules/zod/src/v4/mini/tests/codec.test.ts +548 -0
- package/node_modules/zod/src/v4/mini/tests/computed.test.ts +36 -0
- package/node_modules/zod/src/v4/mini/tests/error.test.ts +22 -0
- package/node_modules/zod/src/v4/mini/tests/functions.test.ts +5 -0
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +993 -0
- package/node_modules/zod/src/v4/mini/tests/number.test.ts +95 -0
- package/node_modules/zod/src/v4/mini/tests/object.test.ts +227 -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 +325 -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 +352 -0
- package/node_modules/zod/src/v4-mini/index.ts +3 -0
- package/node_modules/zod/v3/ZodError.cjs +138 -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 +133 -0
- package/node_modules/zod/v3/errors.cjs +17 -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 +22 -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 +2 -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 +9 -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 +124 -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 +2 -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 +2 -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 +137 -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 +33 -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 +2 -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 +3777 -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 +3695 -0
- package/node_modules/zod/v4/classic/checks.cjs +33 -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 +47 -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 +61 -0
- package/node_modules/zod/v4/classic/compat.d.cts +50 -0
- package/node_modules/zod/v4/classic/compat.d.ts +50 -0
- package/node_modules/zod/v4/classic/compat.js +31 -0
- package/node_modules/zod/v4/classic/errors.cjs +74 -0
- package/node_modules/zod/v4/classic/errors.d.cts +30 -0
- package/node_modules/zod/v4/classic/errors.d.ts +30 -0
- package/node_modules/zod/v4/classic/errors.js +48 -0
- package/node_modules/zod/v4/classic/external.cjs +73 -0
- package/node_modules/zod/v4/classic/external.d.cts +16 -0
- package/node_modules/zod/v4/classic/external.d.ts +16 -0
- package/node_modules/zod/v4/classic/external.js +20 -0
- package/node_modules/zod/v4/classic/from-json-schema.cjs +625 -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 +599 -0
- package/node_modules/zod/v4/classic/index.cjs +33 -0
- package/node_modules/zod/v4/classic/index.d.cts +4 -0
- package/node_modules/zod/v4/classic/index.d.ts +4 -0
- package/node_modules/zod/v4/classic/index.js +4 -0
- package/node_modules/zod/v4/classic/iso.cjs +60 -0
- package/node_modules/zod/v4/classic/iso.d.cts +22 -0
- package/node_modules/zod/v4/classic/iso.d.ts +22 -0
- package/node_modules/zod/v4/classic/iso.js +30 -0
- package/node_modules/zod/v4/classic/package.json +7 -0
- package/node_modules/zod/v4/classic/parse.cjs +41 -0
- package/node_modules/zod/v4/classic/parse.d.cts +31 -0
- package/node_modules/zod/v4/classic/parse.d.ts +31 -0
- package/node_modules/zod/v4/classic/parse.js +15 -0
- package/node_modules/zod/v4/classic/schemas.cjs +1511 -0
- package/node_modules/zod/v4/classic/schemas.d.cts +767 -0
- package/node_modules/zod/v4/classic/schemas.d.ts +767 -0
- package/node_modules/zod/v4/classic/schemas.js +1395 -0
- package/node_modules/zod/v4/core/api.cjs +1227 -0
- package/node_modules/zod/v4/core/api.d.cts +325 -0
- package/node_modules/zod/v4/core/api.d.ts +325 -0
- package/node_modules/zod/v4/core/api.js +1087 -0
- package/node_modules/zod/v4/core/checks.cjs +601 -0
- package/node_modules/zod/v4/core/checks.d.cts +278 -0
- package/node_modules/zod/v4/core/checks.d.ts +278 -0
- package/node_modules/zod/v4/core/checks.js +575 -0
- package/node_modules/zod/v4/core/core.cjs +85 -0
- package/node_modules/zod/v4/core/core.d.cts +70 -0
- package/node_modules/zod/v4/core/core.d.ts +70 -0
- package/node_modules/zod/v4/core/core.js +78 -0
- package/node_modules/zod/v4/core/doc.cjs +39 -0
- package/node_modules/zod/v4/core/doc.d.cts +14 -0
- package/node_modules/zod/v4/core/doc.d.ts +14 -0
- package/node_modules/zod/v4/core/doc.js +35 -0
- package/node_modules/zod/v4/core/errors.cjs +216 -0
- package/node_modules/zod/v4/core/errors.d.cts +221 -0
- package/node_modules/zod/v4/core/errors.d.ts +221 -0
- package/node_modules/zod/v4/core/errors.js +185 -0
- package/node_modules/zod/v4/core/index.cjs +47 -0
- package/node_modules/zod/v4/core/index.d.cts +16 -0
- package/node_modules/zod/v4/core/index.d.ts +16 -0
- package/node_modules/zod/v4/core/index.js +16 -0
- package/node_modules/zod/v4/core/json-schema-generator.cjs +99 -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 +95 -0
- package/node_modules/zod/v4/core/json-schema-processors.cjs +644 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.cts +49 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.ts +49 -0
- package/node_modules/zod/v4/core/json-schema-processors.js +601 -0
- package/node_modules/zod/v4/core/json-schema.cjs +2 -0
- package/node_modules/zod/v4/core/json-schema.d.cts +88 -0
- package/node_modules/zod/v4/core/json-schema.d.ts +88 -0
- package/node_modules/zod/v4/core/json-schema.js +1 -0
- package/node_modules/zod/v4/core/package.json +7 -0
- package/node_modules/zod/v4/core/parse.cjs +131 -0
- package/node_modules/zod/v4/core/parse.d.cts +49 -0
- package/node_modules/zod/v4/core/parse.d.ts +49 -0
- package/node_modules/zod/v4/core/parse.js +93 -0
- package/node_modules/zod/v4/core/regexes.cjs +172 -0
- package/node_modules/zod/v4/core/regexes.d.cts +85 -0
- package/node_modules/zod/v4/core/regexes.d.ts +85 -0
- package/node_modules/zod/v4/core/regexes.js +139 -0
- package/node_modules/zod/v4/core/registries.cjs +56 -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 +2270 -0
- package/node_modules/zod/v4/core/schemas.d.cts +1184 -0
- package/node_modules/zod/v4/core/schemas.d.ts +1184 -0
- package/node_modules/zod/v4/core/schemas.js +2239 -0
- package/node_modules/zod/v4/core/standard-schema.cjs +2 -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 +457 -0
- package/node_modules/zod/v4/core/to-json-schema.d.cts +114 -0
- package/node_modules/zod/v4/core/to-json-schema.d.ts +114 -0
- package/node_modules/zod/v4/core/to-json-schema.js +448 -0
- package/node_modules/zod/v4/core/util.cjs +734 -0
- package/node_modules/zod/v4/core/util.d.cts +200 -0
- package/node_modules/zod/v4/core/util.d.ts +200 -0
- package/node_modules/zod/v4/core/util.js +674 -0
- package/node_modules/zod/v4/core/versions.cjs +8 -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/index.cjs +22 -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 +3 -0
- package/node_modules/zod/v4/locales/ar.cjs +133 -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 +106 -0
- package/node_modules/zod/v4/locales/az.cjs +132 -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 +105 -0
- package/node_modules/zod/v4/locales/be.cjs +183 -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 +156 -0
- package/node_modules/zod/v4/locales/bg.cjs +147 -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 +120 -0
- package/node_modules/zod/v4/locales/ca.cjs +134 -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 +107 -0
- package/node_modules/zod/v4/locales/cs.cjs +138 -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 +111 -0
- package/node_modules/zod/v4/locales/da.cjs +142 -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 +115 -0
- package/node_modules/zod/v4/locales/de.cjs +135 -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 +108 -0
- package/node_modules/zod/v4/locales/el.cjs +136 -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 +109 -0
- package/node_modules/zod/v4/locales/en.cjs +140 -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 +113 -0
- package/node_modules/zod/v4/locales/eo.cjs +136 -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 +109 -0
- package/node_modules/zod/v4/locales/es.cjs +159 -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 +132 -0
- package/node_modules/zod/v4/locales/fa.cjs +141 -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 +114 -0
- package/node_modules/zod/v4/locales/fi.cjs +139 -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 +112 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +134 -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 +107 -0
- package/node_modules/zod/v4/locales/fr.cjs +152 -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 +125 -0
- package/node_modules/zod/v4/locales/he.cjs +241 -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 +214 -0
- package/node_modules/zod/v4/locales/hr.cjs +149 -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 +122 -0
- package/node_modules/zod/v4/locales/hu.cjs +135 -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 +108 -0
- package/node_modules/zod/v4/locales/hy.cjs +174 -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 +147 -0
- package/node_modules/zod/v4/locales/id.cjs +133 -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 +106 -0
- package/node_modules/zod/v4/locales/index.cjs +111 -0
- package/node_modules/zod/v4/locales/index.d.cts +52 -0
- package/node_modules/zod/v4/locales/index.d.ts +52 -0
- package/node_modules/zod/v4/locales/index.js +52 -0
- package/node_modules/zod/v4/locales/is.cjs +136 -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 +109 -0
- package/node_modules/zod/v4/locales/it.cjs +135 -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 +108 -0
- package/node_modules/zod/v4/locales/ja.cjs +134 -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 +107 -0
- package/node_modules/zod/v4/locales/ka.cjs +139 -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 +112 -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 +137 -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 +110 -0
- package/node_modules/zod/v4/locales/ko.cjs +138 -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 +111 -0
- package/node_modules/zod/v4/locales/lt.cjs +230 -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 +203 -0
- package/node_modules/zod/v4/locales/mk.cjs +136 -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 +109 -0
- package/node_modules/zod/v4/locales/ms.cjs +134 -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 +107 -0
- package/node_modules/zod/v4/locales/nl.cjs +137 -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 +110 -0
- package/node_modules/zod/v4/locales/no.cjs +135 -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 +108 -0
- package/node_modules/zod/v4/locales/ota.cjs +136 -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 +109 -0
- package/node_modules/zod/v4/locales/package.json +7 -0
- package/node_modules/zod/v4/locales/pl.cjs +136 -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 +109 -0
- package/node_modules/zod/v4/locales/ps.cjs +141 -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 +114 -0
- package/node_modules/zod/v4/locales/pt.cjs +135 -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 +108 -0
- package/node_modules/zod/v4/locales/ro.cjs +146 -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 +119 -0
- package/node_modules/zod/v4/locales/ru.cjs +183 -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 +156 -0
- package/node_modules/zod/v4/locales/sl.cjs +136 -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 +109 -0
- package/node_modules/zod/v4/locales/sv.cjs +137 -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 +110 -0
- package/node_modules/zod/v4/locales/ta.cjs +137 -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 +110 -0
- package/node_modules/zod/v4/locales/th.cjs +137 -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 +110 -0
- package/node_modules/zod/v4/locales/tr.cjs +132 -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 +105 -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 +135 -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 +108 -0
- package/node_modules/zod/v4/locales/ur.cjs +137 -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 +110 -0
- package/node_modules/zod/v4/locales/uz.cjs +137 -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 +110 -0
- package/node_modules/zod/v4/locales/vi.cjs +135 -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 +108 -0
- package/node_modules/zod/v4/locales/yo.cjs +134 -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 +107 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +136 -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 +109 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +134 -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 +107 -0
- package/node_modules/zod/v4/mini/checks.cjs +34 -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 +52 -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/external.cjs +63 -0
- package/node_modules/zod/v4/mini/external.d.cts +13 -0
- package/node_modules/zod/v4/mini/external.d.ts +13 -0
- package/node_modules/zod/v4/mini/external.js +14 -0
- package/node_modules/zod/v4/mini/index.cjs +32 -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 +64 -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 +16 -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 +1083 -0
- package/node_modules/zod/v4/mini/schemas.d.cts +445 -0
- package/node_modules/zod/v4/mini/schemas.d.ts +445 -0
- package/node_modules/zod/v4/mini/schemas.js +961 -0
- package/node_modules/zod/v4/package.json +7 -0
- package/node_modules/zod/v4-mini/index.cjs +32 -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 +68 -0
- package/proof/CONTAINMENT-BUILD.txt +163 -0
- package/proof/MCP-SMOKE-STATUS.txt +9 -0
- package/proof/NODE-SYNTAX.txt +4 -0
- package/proof/PROOF.txt +6 -0
- package/proof/SECRET-SCAN.txt +4 -0
- package/proof/SOURCE-GATES.txt +16 -0
- package/proof/STATUS.txt +11 -0
- package/proof/TARGET-V0313-CONTAINMENT-PASS.sha256 +1 -0
- package/proof/TARGET-V0313-CONTAINMENT-PASS.txt +215 -0
- package/proof/TARGET-V040-CONTAINED-IPC-FAIL.sha256 +1 -0
- package/proof/TARGET-V040-CONTAINED-IPC-FAIL.txt +299 -0
- package/proof/TARGET-V041-CONTAINED-CREATEPROCESS-203.sha256 +1 -0
- package/proof/TARGET-V041-CONTAINED-CREATEPROCESS-203.txt +311 -0
- package/proof/TARGET-V042-CONTAINED-CREATEPROCESS-203.sha256 +1 -0
- package/proof/TARGET-V042-CONTAINED-CREATEPROCESS-203.txt +313 -0
- package/proof/TARGET-V043-CONTAINED-CREATEPROCESS-203.sha256 +1 -0
- package/proof/TARGET-V043-CONTAINED-CREATEPROCESS-203.txt +308 -0
- package/proof/TARGET-V044-CONTAINED-PASS.sha256 +1 -0
- package/proof/TARGET-V044-CONTAINED-PASS.txt +432 -0
- package/proof/TARGET-V045-DUAL-OPERATION-PASS.sha256 +1 -0
- package/proof/TARGET-V045-DUAL-OPERATION-PASS.txt +481 -0
- package/proof/TARGET-V046-FIXED-EXECUTABLE-REGISTRY-PASS.sha256 +1 -0
- package/proof/TARGET-V046-FIXED-EXECUTABLE-REGISTRY-PASS.txt +610 -0
- package/proof/TARGET-V047-RUNTIME-MANIFEST-PASS.sha256 +1 -0
- package/proof/TARGET-V047-RUNTIME-MANIFEST-PASS.txt +642 -0
- package/proof/TARGET-V050-BATCH-GATE-PASS.sha256 +1 -0
- package/proof/TARGET-V050-BATCH-GATE-PASS.txt +713 -0
- package/proof/TESTS.txt +686 -0
- package/proof/TRUST-EPHEMERAL.txt +4 -0
- package/proof/V03-FREEZE.txt +27 -0
- package/proof/V041-IPC-HOTFIX.txt +16 -0
- package/proof/V042-ENV-HOTFIX.txt +15 -0
- package/proof/V043-DRIVE-CWD-HOTFIX.txt +14 -0
- package/proof/V044-LOCALAPPDATA-HOTFIX.txt +18 -0
- package/proof/V045-OPERATION-REGISTRY.txt +7 -0
- package/proof/V046-WORKER-REGISTRY.txt +12 -0
- package/proof/V047-WORKER-MANIFEST.txt +18 -0
- package/proof/V050-BATCH-TRUST-CLOSURE.txt +21 -0
- package/proof/V060-ACTIVE-NETWORK-AUTHORITY.txt +29 -0
- package/proof/V070-NODE-SYNTAX.txt +36 -0
- package/proof/V070-NODE-TESTS.txt +752 -0
- package/proof/V070-PACK-DRY-RUN.txt +126 -0
- package/proof/V070-SOURCE-GATE.txt +30 -0
- package/proof/V070-STATIC-SCAN.txt +4 -0
- package/proof/V070-WINDOWS-GATE-PENDING.txt +25 -0
- package/proof/V071-NODE-SYNTAX.txt +1 -0
- package/proof/V071-NODE-TESTS.txt +796 -0
- package/proof/V071-PACK-DRY-RUN.json +656 -0
- package/proof/V071-SOURCE-GATE.txt +16 -0
- package/proof/V071-WINDOWS-GATE-PENDING.txt +24 -0
- package/proof/V073-NODE-SYNTAX.txt +4 -0
- package/proof/V073-SOURCE-GATE.txt +21 -0
- package/proof/V073-STATIC-SCAN.txt +10 -0
- package/proof/V073-WINDOWS-GATE-PENDING.txt +5 -0
- package/proof/VERIFY.txt +7 -0
- package/proof/WINDOWS-CONTAINED-STATUS.txt +5 -0
- package/proof/WINDOWS-CONTAINMENT-STATUS.txt +3 -0
- package/scripts/autonomous-benchmark.mjs +12 -0
- package/scripts/autonomous-build.ps1 +20 -0
- package/scripts/autonomous-tests.ps1 +9 -0
- package/scripts/build-containment.ps1 +279 -0
- package/scripts/coding-live-smoke.mjs +5 -0
- package/scripts/deferred-slot-operation.mjs +84 -0
- package/scripts/final-closure-verify.mjs +159 -0
- package/scripts/final-closure.mjs +106 -0
- package/scripts/gate-windows.ps1 +42 -0
- package/scripts/init-host-policy.ps1 +121 -0
- package/scripts/refresh-process-policy.mjs +68 -0
- package/scripts/release-manifest.mjs +187 -0
- package/scripts/release-parity.mjs +190 -0
- package/scripts/runtime-self-update.mjs +15 -0
- package/scripts/windows-gate-evidence.mjs +52 -0
- package/src/agent-mcp-tools.mjs +158 -0
- package/src/agent-runtime.mjs +874 -0
- package/src/audit-context.mjs +73 -0
- package/src/audit-verify.mjs +93 -0
- package/src/authority-smoke.mjs +117 -0
- package/src/autonomous-mcp-tools.mjs +118 -0
- package/src/autonomous-output-contracts.mjs +125 -0
- package/src/autonomous-planner-contracts.mjs +73 -0
- package/src/autonomous-planner.mjs +290 -0
- package/src/autonomous-policy.mjs +146 -0
- package/src/autonomous-runtime.mjs +993 -0
- package/src/autonomous-supervisor.mjs +86 -0
- package/src/canonical-json.mjs +17 -0
- package/src/coding-mcp-tools.mjs +143 -0
- package/src/coding-output-contracts.mjs +189 -0
- package/src/coding-plane.mjs +657 -0
- package/src/coding-search.mjs +55 -0
- package/src/coding-task-runtime.mjs +725 -0
- package/src/contained-cli.mjs +30 -0
- package/src/contained-executor.mjs +276 -0
- package/src/contained-result.mjs +149 -0
- package/src/contained-smoke.mjs +101 -0
- package/src/containment-bootstrap.mjs +94 -0
- package/src/containment-child-control.mjs +109 -0
- package/src/containment-construction.mjs +107 -0
- package/src/containment-result.mjs +87 -0
- package/src/containment-smoke.mjs +71 -0
- package/src/deadbyte-cli.mjs +55 -0
- package/src/executor.mjs +158 -0
- package/src/hash.mjs +17 -0
- package/src/host-plane.mjs +423 -0
- package/src/ingress-mode.mjs +22 -0
- package/src/invocation.mjs +34 -0
- package/src/machine-fs-mcp-tools.mjs +80 -0
- package/src/machine-fs-output-contracts.mjs +67 -0
- package/src/machine-fs-smoke-client.mjs +134 -0
- package/src/machine-fs.mjs +475 -0
- package/src/machine-identity.mjs +275 -0
- package/src/machine-mcp-tools.mjs +43 -0
- package/src/machine-output-contracts.mjs +58 -0
- package/src/mcp-contained-smoke-client.mjs +139 -0
- package/src/mcp-host-smoke-client.mjs +136 -0
- package/src/mcp-server.mjs +419 -0
- package/src/mcp-smoke-client.mjs +136 -0
- package/src/native-diff.mjs +403 -0
- package/src/observation-mcp-tools.mjs +44 -0
- package/src/observation-output-contracts.mjs +50 -0
- package/src/observation-runtime.mjs +257 -0
- package/src/observation-smoke-client.mjs +97 -0
- package/src/operation-policy.mjs +19 -0
- package/src/output-contracts.mjs +252 -0
- package/src/path-policy.mjs +91 -0
- package/src/process-mcp-tools.mjs +72 -0
- package/src/process-output-contracts.mjs +79 -0
- package/src/process-policy.mjs +150 -0
- package/src/process-runtime.mjs +297 -0
- package/src/process-smoke-client.mjs +124 -0
- package/src/proof-cli.mjs +23 -0
- package/src/proof-worker.mjs +11 -0
- package/src/receipt.mjs +111 -0
- package/src/release-generation.mjs +233 -0
- package/src/release-slot.mjs +293 -0
- package/src/remote-mcp-autonomous-smoke-client.mjs +138 -0
- package/src/remote-mcp-coding-smoke-client.mjs +111 -0
- package/src/remote-mcp-host-smoke-client.mjs +84 -0
- package/src/remote-mcp-machine-smoke-client.mjs +66 -0
- package/src/remote-mcp-r24-disarmed-smoke-client.mjs +38 -0
- package/src/remote-mcp-r33-parity-client.mjs +177 -0
- package/src/remote-mcp-smoke-client.mjs +162 -0
- package/src/request-identity.mjs +63 -0
- package/src/runtime-identity.mjs +33 -0
- package/src/runtime-update.mjs +961 -0
- package/src/text-policy.mjs +9 -0
- package/src/tool-audit.mjs +261 -0
- package/src/trust-init.mjs +21 -0
- package/src/trust.mjs +82 -0
- package/src/tunnel-stdio-compat-smoke.mjs +142 -0
- package/src/tunnel-stdio-compat.mjs +126 -0
- package/src/verifier-cli.mjs +13 -0
- package/src/verifier.mjs +333 -0
- package/src/version.mjs +6 -0
- package/src/worker-registry.mjs +108 -0
- package/test/DEADBYTE-MCP-WRITE-PROBE.txt +5 -0
- package/test/agent-crash-child.mjs +25 -0
- package/test/agent-crash-worker.mjs +19 -0
- package/test/agent-runtime-adversarial.test.mjs +228 -0
- package/test/agent-runtime-crash.test.mjs +76 -0
- package/test/agent-runtime.test.mjs +124 -0
- package/test/agent-task-receipt.test.mjs +73 -0
- package/test/audit-context.test.mjs +50 -0
- package/test/audit-server-integration.test.mjs +30 -0
- package/test/audit-verify.test.mjs +32 -0
- package/test/autonomous-adversarial.test.mjs +329 -0
- package/test/autonomous-live-fixture.test.mjs +10 -0
- package/test/autonomous-loop.test.mjs +188 -0
- package/test/autonomous-output-contract.test.mjs +24 -0
- package/test/autonomous-runtime.test.mjs +93 -0
- package/test/autonomous-supervisor-integration.test.mjs +106 -0
- package/test/cli-entrypoint.test.mjs +34 -0
- package/test/coding-crash.test.mjs +74 -0
- package/test/coding-observation.test.mjs +62 -0
- package/test/coding-plane-adversarial.test.mjs +130 -0
- package/test/coding-plane.test.mjs +93 -0
- package/test/coding-runtime.test.mjs +165 -0
- package/test/contained.test.mjs +931 -0
- package/test/containment.test.mjs +557 -0
- package/test/controller-r21.test.mjs +28 -0
- package/test/controller-r211.test.mjs +21 -0
- package/test/controller-r212.test.mjs +31 -0
- package/test/controller-r24-dns.test.mjs +14 -0
- package/test/controller-r24.test.mjs +32 -0
- package/test/controller-r27.test.mjs +56 -0
- package/test/controller-r29.test.mjs +25 -0
- package/test/controller-r30.test.mjs +30 -0
- package/test/controller.test.mjs +165 -0
- package/test/core.test.mjs +305 -0
- package/test/deferred-slot-operation-behavior.test.mjs +29 -0
- package/test/deferred-slot-operation.test.mjs +18 -0
- package/test/helpers/coding-crash-child.mjs +22 -0
- package/test/host-plane.test.mjs +129 -0
- package/test/machine-fs-mcp-tools.test.mjs +46 -0
- package/test/machine-fs-runtime.test.mjs +105 -0
- package/test/machine-identity.test.mjs +131 -0
- package/test/machine-mcp-integration.test.mjs +88 -0
- package/test/machine-mcp-tools.test.mjs +77 -0
- package/test/mcp-contained-smoke-isolation.test.mjs +14 -0
- package/test/named-tunnel-host.test.mjs +27 -0
- package/test/native-diff.test.mjs +102 -0
- package/test/observation-integration.test.mjs +56 -0
- package/test/observation-mcp-tools.test.mjs +40 -0
- package/test/observation-runtime.test.mjs +123 -0
- package/test/output-schema.test.mjs +86 -0
- package/test/package-boundary.test.mjs +38 -0
- package/test/process-mcp-tools.test.mjs +71 -0
- package/test/process-native.test.mjs +78 -0
- package/test/process-policy-refresh.test.mjs +64 -0
- package/test/process-policy.test.mjs +118 -0
- package/test/process-release-gate.test.mjs +41 -0
- package/test/process-runtime.test.mjs +184 -0
- package/test/process-supervision.test.mjs +24 -0
- package/test/r33-closeout-regression.test.mjs +109 -0
- package/test/r33-finalization.test.mjs +67 -0
- package/test/release-generation.test.mjs +116 -0
- package/test/release-manifest-windows.test.mjs +89 -0
- package/test/release-slot.test.mjs +122 -0
- package/test/release-smoke-isolation.test.mjs +22 -0
- package/test/release-version.test.mjs +35 -0
- package/test/remote-r24-catalog.test.mjs +75 -0
- package/test/runtime-self-update.test.mjs +280 -0
- package/test/standing-grants.test.mjs +77 -0
- package/test/tool-audit.test.mjs +134 -0
- package/test/tunnel-stdio-compat.test.mjs +163 -0
- package/workspaces/autonomous-live/fixture.txt +1 -0
- package/workspaces/demo/input.txt +1 -0
|
@@ -0,0 +1,961 @@
|
|
|
1
|
+
import { createHash, createPrivateKey, createPublicKey, randomBytes, sign as cryptoSign, verify as cryptoVerify } from 'node:crypto';
|
|
2
|
+
import { spawnSync } from 'node:child_process';
|
|
3
|
+
import { existsSync } from 'node:fs';
|
|
4
|
+
import { lstat, mkdir, open, readFile, readdir, rename, rm, writeFile } from 'node:fs/promises';
|
|
5
|
+
import os from 'node:os';
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
import { fileURLToPath } from 'node:url';
|
|
8
|
+
import {
|
|
9
|
+
atomicWriteActivePointer,
|
|
10
|
+
materializeReleaseSlot,
|
|
11
|
+
parseActivePointer,
|
|
12
|
+
parseManifest,
|
|
13
|
+
releaseId,
|
|
14
|
+
renderStableLauncherCmd,
|
|
15
|
+
renderStableLauncherPs1,
|
|
16
|
+
sha256Bytes,
|
|
17
|
+
verifyManifestTree
|
|
18
|
+
} from './release-slot.mjs';
|
|
19
|
+
import { createGenerationBundle, verifyGenerationBundle } from './release-generation.mjs';
|
|
20
|
+
|
|
21
|
+
const HEX64=/^[0-9a-f]{64}$/;
|
|
22
|
+
const SEMVER=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/;
|
|
23
|
+
const RECEIPT_DOMAIN=Buffer.from('DEADBYTE-R27-SLOT-UPDATE-V1\0','utf8');
|
|
24
|
+
const UPDATE_SCHEMA='deadbyte.r27-slot-update-receipt.v1';
|
|
25
|
+
const FAILURE_SCHEMA='deadbyte.r27-slot-update-failure.v1';
|
|
26
|
+
const ROLLBACK_SCHEMA='deadbyte.r31-slot-rollback-receipt.v1';
|
|
27
|
+
const DEFAULT_STATE_ROOT=path.join(os.homedir(),'.deadbyte-mcp');
|
|
28
|
+
const TOP_LAUNCHER=path.join(os.homedir(),'Downloads','DEADBYTE-MCP.cmd');
|
|
29
|
+
const RUNTIME_STABILITY_MS=12000;
|
|
30
|
+
const RUNTIME_STABILITY_POLL_MS=500;
|
|
31
|
+
|
|
32
|
+
const sha256File=async file=>sha256Bytes(await readFile(file));
|
|
33
|
+
const sleep=ms=>new Promise(resolve=>setTimeout(resolve,ms));
|
|
34
|
+
const canonical=value=>Array.isArray(value)?value.map(canonical):value&&typeof value==='object'
|
|
35
|
+
?Object.fromEntries(Object.keys(value).sort().map(key=>[key,canonical(value[key])])):value;
|
|
36
|
+
const canonicalJson=value=>JSON.stringify(canonical(value));
|
|
37
|
+
function normalizePersistentPublicOrigin(value){
|
|
38
|
+
let publicOrigin;
|
|
39
|
+
try { publicOrigin=new URL(String(value)); }
|
|
40
|
+
catch { throw new Error('named tunnel public origin must be one persistent HTTPS origin'); }
|
|
41
|
+
if(publicOrigin.protocol!=='https:'||publicOrigin.username||publicOrigin.password||publicOrigin.search||publicOrigin.hash||publicOrigin.pathname!=='/'||!publicOrigin.hostname) {
|
|
42
|
+
throw new Error('named tunnel public origin must be one persistent HTTPS origin without path, query, fragment, or credentials');
|
|
43
|
+
}
|
|
44
|
+
if(publicOrigin.hostname.toLowerCase().endsWith('.trycloudflare.com')) throw new Error('named tunnel public origin must be persistent; trycloudflare is forbidden');
|
|
45
|
+
return publicOrigin.origin;
|
|
46
|
+
}
|
|
47
|
+
export function parseUpdateArgs(argv){
|
|
48
|
+
const out={stage:null,developmentRoot:null,expectedVersion:null,expectedManifest:null,sourceRoot:null,restoreStandingGrants:false,recoverOfflinePredecessor:false,enableMachineFs:false,enableObservation:false,cloudTransport:null,bridgeBootstrap:null,processPolicyBootstrap:null,hostCommandPins:[]};
|
|
49
|
+
const cloud={},bridge={},processPolicy={},seen=new Set(),hostPinIds=new Set();
|
|
50
|
+
const bridgeFlags=new Map([
|
|
51
|
+
['--bridge-root','root'],['--bridge-script-sha256','scriptSha256']
|
|
52
|
+
]);
|
|
53
|
+
const processPolicyFlags=new Map([
|
|
54
|
+
['--process-policy','path'],['--process-policy-sha256','sha256']
|
|
55
|
+
]);
|
|
56
|
+
const cloudFlags=new Map([
|
|
57
|
+
['--cloud-cloudflared','cloudflaredPath'],['--cloud-cloudflared-sha256','cloudflaredSha256'],
|
|
58
|
+
['--cloud-token-file','tokenFilePath'],['--cloud-token-sha256','tokenFileSha256'],
|
|
59
|
+
['--cloud-child-working-directory','childWorkingDirectory'],['--cloud-public-origin','publicOrigin']
|
|
60
|
+
]);
|
|
61
|
+
const valued=new Set(['--stage','--development-root','--expected-version','--expected-manifest','--source-root','--host-command-pin',...bridgeFlags.keys(),...processPolicyFlags.keys(),...cloudFlags.keys()]);
|
|
62
|
+
for(let index=0;index<argv.length;index++){
|
|
63
|
+
const arg=argv[index];
|
|
64
|
+
if(arg==='--restore-standing-grants'||arg==='--recover-offline-predecessor'||arg==='--enable-machine-fs'||arg==='--enable-observation'){
|
|
65
|
+
if(seen.has(arg)) throw new Error(`duplicate self-update argument '${arg}'`);
|
|
66
|
+
seen.add(arg);
|
|
67
|
+
if(arg==='--restore-standing-grants') out.restoreStandingGrants=true;
|
|
68
|
+
else if(arg==='--recover-offline-predecessor') out.recoverOfflinePredecessor=true;
|
|
69
|
+
else if(arg==='--enable-machine-fs') out.enableMachineFs=true;
|
|
70
|
+
else out.enableObservation=true;
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
if(arg==='--host-command-pin'){
|
|
74
|
+
const value=argv[++index];
|
|
75
|
+
if(!value) throw new Error('--host-command-pin requires command_id=sha256');
|
|
76
|
+
const match=/^([A-Za-z0-9._-]{1,64})=([0-9a-f]{64})$/.exec(value);
|
|
77
|
+
if(!match) throw new Error('host command pin must be command_id=lowercase_sha256');
|
|
78
|
+
const [,commandId,sha256]=match;
|
|
79
|
+
if(hostPinIds.has(commandId)) throw new Error(`duplicate host command pin '${commandId}'`);
|
|
80
|
+
hostPinIds.add(commandId); out.hostCommandPins.push({commandId,sha256}); continue;
|
|
81
|
+
}
|
|
82
|
+
if(!valued.has(arg)) throw new Error(`unknown self-update argument '${arg}'`);
|
|
83
|
+
if(seen.has(arg)) throw new Error(`duplicate self-update argument '${arg}'`);
|
|
84
|
+
seen.add(arg);
|
|
85
|
+
const value=argv[++index];
|
|
86
|
+
if(!value) throw new Error(`${arg} requires a value`);
|
|
87
|
+
if(arg==='--stage') out.stage=path.resolve(value);
|
|
88
|
+
else if(arg==='--development-root') out.developmentRoot=path.resolve(value);
|
|
89
|
+
else if(arg==='--expected-version') out.expectedVersion=value;
|
|
90
|
+
else if(arg==='--expected-manifest') out.expectedManifest=value.toLowerCase();
|
|
91
|
+
else if(arg==='--source-root') out.sourceRoot=path.resolve(value);
|
|
92
|
+
else if(bridgeFlags.has(arg)) bridge[bridgeFlags.get(arg)]=value;
|
|
93
|
+
else if(processPolicyFlags.has(arg)) processPolicy[processPolicyFlags.get(arg)]=value;
|
|
94
|
+
else cloud[cloudFlags.get(arg)]=value;
|
|
95
|
+
}
|
|
96
|
+
if(!out.stage) throw new Error('--stage is required');
|
|
97
|
+
if(!out.developmentRoot) throw new Error('--development-root is required');
|
|
98
|
+
if(!SEMVER.test(String(out.expectedVersion??''))) throw new Error('--expected-version must be SemVer');
|
|
99
|
+
if(!HEX64.test(String(out.expectedManifest??''))) throw new Error('--expected-manifest must be lowercase SHA-256 hex');
|
|
100
|
+
const bridgeFields=[...bridgeFlags.values()],bridgePresent=bridgeFields.filter(key=>bridge[key]!==undefined);
|
|
101
|
+
if(bridgePresent.length!==0&&bridgePresent.length!==bridgeFields.length) throw new Error('bridge bootstrap requires root plus script SHA-256 as one pair');
|
|
102
|
+
if(bridgePresent.length===bridgeFields.length){
|
|
103
|
+
const scriptSha256=String(bridge.scriptSha256).toLowerCase();
|
|
104
|
+
if(!HEX64.test(scriptSha256)) throw new Error('bridge script SHA-256 must be lowercase hex');
|
|
105
|
+
out.bridgeBootstrap={root:path.resolve(bridge.root),scriptSha256};
|
|
106
|
+
}
|
|
107
|
+
const processPolicyFields=[...processPolicyFlags.values()],processPolicyPresent=processPolicyFields.filter(key=>processPolicy[key]!==undefined);
|
|
108
|
+
if(processPolicyPresent.length!==0&&processPolicyPresent.length!==processPolicyFields.length) throw new Error('process policy bootstrap requires path plus SHA-256 as one pair');
|
|
109
|
+
if(processPolicyPresent.length===processPolicyFields.length){
|
|
110
|
+
const sha256=String(processPolicy.sha256).toLowerCase();
|
|
111
|
+
if(!HEX64.test(sha256)) throw new Error('process policy SHA-256 must be lowercase hex');
|
|
112
|
+
out.processPolicyBootstrap={path:path.resolve(processPolicy.path),sha256};
|
|
113
|
+
}
|
|
114
|
+
const cloudFields=[...cloudFlags.values()],present=cloudFields.filter(key=>cloud[key]!==undefined);
|
|
115
|
+
if(present.length!==0&&present.length!==cloudFields.length) throw new Error('named tunnel bootstrap requires cloud path/hash/token/workdir plus persistent public origin');
|
|
116
|
+
if(present.length===cloudFields.length){
|
|
117
|
+
for(const key of ['cloudflaredSha256','tokenFileSha256']) cloud[key]=String(cloud[key]).toLowerCase();
|
|
118
|
+
if(!HEX64.test(cloud.cloudflaredSha256)||!HEX64.test(cloud.tokenFileSha256)) throw new Error('named tunnel dependency SHA-256 must be lowercase hex');
|
|
119
|
+
const publicOrigin=normalizePersistentPublicOrigin(cloud.publicOrigin);
|
|
120
|
+
out.cloudTransport={
|
|
121
|
+
cloudflared:{path:path.resolve(cloud.cloudflaredPath),sha256:cloud.cloudflaredSha256},
|
|
122
|
+
tokenFile:{path:path.resolve(cloud.tokenFilePath),sha256:cloud.tokenFileSha256},
|
|
123
|
+
childWorkingDirectory:path.resolve(cloud.childWorkingDirectory),
|
|
124
|
+
publicOrigin
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
return out;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export function parseRollbackArgs(argv){
|
|
131
|
+
let activationReceipt=null;
|
|
132
|
+
for(let index=0;index<argv.length;index++){
|
|
133
|
+
const arg=argv[index];
|
|
134
|
+
if(arg!=='--rollback-receipt') throw new Error(`unknown rollback argument '${arg}'`);
|
|
135
|
+
if(activationReceipt!==null) throw new Error("duplicate rollback argument '--rollback-receipt'");
|
|
136
|
+
const value=argv[++index];
|
|
137
|
+
if(!value) throw new Error('--rollback-receipt requires a value');
|
|
138
|
+
activationReceipt=path.resolve(value);
|
|
139
|
+
}
|
|
140
|
+
if(!activationReceipt) throw new Error('--rollback-receipt is required');
|
|
141
|
+
return {activationReceipt};
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function powershellPath(){
|
|
145
|
+
return path.join(process.env.SystemRoot||'C:\\Windows','System32','WindowsPowerShell','v1.0','powershell.exe');
|
|
146
|
+
}
|
|
147
|
+
function windowsPowerShellEnvironment(base=process.env){
|
|
148
|
+
const systemRoot=base.SystemRoot||base.SYSTEMROOT||'C:\\Windows';
|
|
149
|
+
const userProfile=base.USERPROFILE||os.homedir();
|
|
150
|
+
const programFiles=base.ProgramFiles||base.PROGRAMFILES||'C:\\Program Files';
|
|
151
|
+
return {...base,PSModulePath:[
|
|
152
|
+
path.join(userProfile,'Documents','WindowsPowerShell','Modules'),
|
|
153
|
+
path.join(programFiles,'WindowsPowerShell','Modules'),
|
|
154
|
+
path.join(systemRoot,'System32','WindowsPowerShell','v1.0','Modules')
|
|
155
|
+
].join(';')};
|
|
156
|
+
}
|
|
157
|
+
function commandEnvironment(exe,base=process.env){
|
|
158
|
+
return path.resolve(exe).toLowerCase()===path.resolve(powershellPath()).toLowerCase()
|
|
159
|
+
?windowsPowerShellEnvironment(base):base;
|
|
160
|
+
}
|
|
161
|
+
function runCaptured(exe,args,{cwd,env,timeoutMs=45000}={}){
|
|
162
|
+
const baseEnv=env??process.env;
|
|
163
|
+
const childEnv=commandEnvironment(exe,baseEnv);
|
|
164
|
+
const result=spawnSync(exe,args,{cwd,env:childEnv,encoding:'utf8',windowsHide:true,timeout:timeoutMs,maxBuffer:16*1024*1024});
|
|
165
|
+
return {status:result.status,signal:result.signal,error:result.error?{code:result.error.code??null,message:result.error.message}:null,stdout:result.stdout??'',stderr:result.stderr??''};
|
|
166
|
+
}
|
|
167
|
+
function assertRun(result,label){
|
|
168
|
+
if(result.error||result.status!==0) throw new Error(`${label} failed status=${result.status} error=${result.error?.message??'none'}\n${result.stderr||result.stdout}`);
|
|
169
|
+
return result.stdout;
|
|
170
|
+
}
|
|
171
|
+
export async function loadPowerShellDataFile(file){
|
|
172
|
+
const env={...process.env,DEADBYTE_R27_CONFIG_READ:path.resolve(file)};
|
|
173
|
+
const command="$ErrorActionPreference='Stop'; $v=Import-PowerShellDataFile -LiteralPath $env:DEADBYTE_R27_CONFIG_READ; $v | ConvertTo-Json -Depth 16 -Compress";
|
|
174
|
+
const result=runCaptured(powershellPath(),['-NoLogo','-NoProfile','-Command',command],{env,timeoutMs:15000});
|
|
175
|
+
const text=assertRun(result,'PowerShell data-file load').trim();
|
|
176
|
+
let value; try { value=JSON.parse(text); } catch(error){ throw new Error(`controller config JSON conversion failed: ${error.message}`); }
|
|
177
|
+
if(!value||typeof value!=='object'||Array.isArray(value)) throw new Error('controller config must be an object');
|
|
178
|
+
return value;
|
|
179
|
+
}
|
|
180
|
+
async function readJson(file){
|
|
181
|
+
const text=(await readFile(file,'utf8')).replace(/^\uFEFF/,'');
|
|
182
|
+
let value; try { value=JSON.parse(text); } catch(error){ throw new Error(`JSON invalid ${file}: ${error.message}`); }
|
|
183
|
+
return value;
|
|
184
|
+
}
|
|
185
|
+
async function atomicBytes(file,bytes){
|
|
186
|
+
await mkdir(path.dirname(file),{recursive:true});
|
|
187
|
+
const temp=`${file}.tmp-${process.pid}-${randomBytes(4).toString('hex')}`;
|
|
188
|
+
const handle=await open(temp,'wx');
|
|
189
|
+
try { await handle.writeFile(bytes); await handle.sync(); } finally { await handle.close(); }
|
|
190
|
+
try { await rename(temp,file); } catch(error){ await rm(temp,{force:true}).catch(()=>{}); throw error; }
|
|
191
|
+
if(sha256Bytes(await readFile(file))!==sha256Bytes(bytes)) throw new Error(`atomic write readback mismatch: ${file}`);
|
|
192
|
+
}
|
|
193
|
+
async function normalizeComponentIdentities(config){
|
|
194
|
+
const next=structuredClone(config);
|
|
195
|
+
for(const name of ['Bridge','Cloud']){
|
|
196
|
+
const spec=next[name];
|
|
197
|
+
if(!spec||typeof spec!=='object') throw new Error(`${name} launch specification missing`);
|
|
198
|
+
if(typeof spec.FilePath!=='string'||!path.isAbsolute(spec.FilePath)) throw new Error(`${name} FilePath must be absolute`);
|
|
199
|
+
const exe=path.resolve(spec.FilePath);
|
|
200
|
+
const stat=await lstat(exe);
|
|
201
|
+
if(!stat.isFile()||stat.isSymbolicLink()) throw new Error(`${name} executable must be a regular file`);
|
|
202
|
+
const actual=await sha256File(exe);
|
|
203
|
+
if(spec.FileSha256!==undefined&&spec.FileSha256!==''&&spec.FileSha256!==actual) throw new Error(`${name} executable pin drift detected`);
|
|
204
|
+
spec.FilePath=exe; spec.FileSha256=actual;
|
|
205
|
+
const dependencies=spec.Dependencies??[];
|
|
206
|
+
if(!Array.isArray(dependencies)||dependencies.length>16) throw new Error(`${name} Dependencies invalid`);
|
|
207
|
+
const normalizedDependencies=[];
|
|
208
|
+
for(const dependency of dependencies){
|
|
209
|
+
const depName=String(dependency?.Name??'');
|
|
210
|
+
const depPath=path.resolve(String(dependency?.Path??''));
|
|
211
|
+
const depHash=String(dependency?.Sha256??'').toLowerCase();
|
|
212
|
+
if(!/^[A-Za-z0-9._-]{1,32}$/.test(depName)||!path.isAbsolute(String(dependency?.Path??''))||!HEX64.test(depHash)) throw new Error(`${name} dependency contract invalid`);
|
|
213
|
+
const depStat=await lstat(depPath); if(!depStat.isFile()||depStat.isSymbolicLink()) throw new Error(`${name} dependency must be a regular file: ${depName}`);
|
|
214
|
+
const depActual=await sha256File(depPath); if(depActual!==depHash) throw new Error(`${name} dependency pin drift detected: ${depName}`);
|
|
215
|
+
normalizedDependencies.push({Name:depName,Path:depPath,Sha256:depHash});
|
|
216
|
+
}
|
|
217
|
+
spec.Dependencies=normalizedDependencies;
|
|
218
|
+
if(name==='Cloud'&&spec.Transport!==undefined){
|
|
219
|
+
const transport=String(spec.Transport);
|
|
220
|
+
const valid=(transport==='deadbyte.named-tunnel.v1'&&normalizedDependencies.length===3)||
|
|
221
|
+
(transport==='deadbyte.named-tunnel.v2'&&normalizedDependencies.length===2);
|
|
222
|
+
if(!valid) throw new Error('Cloud named tunnel transport contract invalid');
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
const bridge=next.Bridge;
|
|
226
|
+
const raw=String(bridge.Arguments??'');
|
|
227
|
+
const normalized=raw.replaceAll('\\','/');
|
|
228
|
+
if(!/^[A-Za-z0-9._/-]+\.(?:mjs|js)$/.test(normalized)||path.posix.isAbsolute(normalized)||normalized.split('/').includes('..')) {
|
|
229
|
+
throw new Error('R27 Bridge Arguments must be one relative .mjs/.js script path');
|
|
230
|
+
}
|
|
231
|
+
if(typeof bridge.WorkingDirectory!=='string'||!path.isAbsolute(bridge.WorkingDirectory)) throw new Error('Bridge WorkingDirectory must be absolute');
|
|
232
|
+
const script=path.resolve(bridge.WorkingDirectory,...normalized.split('/'));
|
|
233
|
+
const scriptStat=await lstat(script);
|
|
234
|
+
if(!scriptStat.isFile()||scriptStat.isSymbolicLink()) throw new Error('Bridge script must be a regular file');
|
|
235
|
+
const scriptHash=await sha256File(script);
|
|
236
|
+
if(bridge.ScriptSha256!==undefined&&bridge.ScriptSha256!==''&&bridge.ScriptSha256!==scriptHash) throw new Error('Bridge script pin drift detected');
|
|
237
|
+
bridge.ScriptPath=script; bridge.ScriptSha256=scriptHash;
|
|
238
|
+
return next;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export async function prepareBridgeSpec(config,bootstrap){
|
|
242
|
+
if(!bootstrap) return structuredClone(config);
|
|
243
|
+
if(typeof bootstrap.root!=='string'||!path.isAbsolute(bootstrap.root)||!HEX64.test(String(bootstrap.scriptSha256??''))) {
|
|
244
|
+
throw new Error('bridge bootstrap requires absolute root plus lowercase script SHA-256');
|
|
245
|
+
}
|
|
246
|
+
const root=path.resolve(bootstrap.root),rootStat=await lstat(root);
|
|
247
|
+
if(!rootStat.isDirectory()||rootStat.isSymbolicLink()) throw new Error('bridge root must be a real directory');
|
|
248
|
+
const packageFile=path.join(root,'package.json'),script=path.join(root,'src','bridge.mjs');
|
|
249
|
+
const packageStat=await lstat(packageFile),scriptStat=await lstat(script);
|
|
250
|
+
if(!packageStat.isFile()||packageStat.isSymbolicLink()) throw new Error('bridge package.json must be a regular file');
|
|
251
|
+
if(!scriptStat.isFile()||scriptStat.isSymbolicLink()) throw new Error('bridge script must be a regular file');
|
|
252
|
+
const pkg=JSON.parse(await readFile(packageFile,'utf8'));
|
|
253
|
+
if(pkg?.name!=='deadbyte-chatgpt-bridge') throw new Error('bridge package identity mismatch');
|
|
254
|
+
const actual=await sha256File(script),expected=String(bootstrap.scriptSha256).toLowerCase();
|
|
255
|
+
if(actual!==expected) throw new Error(`bridge script SHA-256 mismatch: expected ${expected}, found ${actual}`);
|
|
256
|
+
const next=structuredClone(config);
|
|
257
|
+
if(!next.Bridge||typeof next.Bridge!=='object') throw new Error('Bridge launch specification missing');
|
|
258
|
+
next.Bridge.WorkingDirectory=root;
|
|
259
|
+
next.Bridge.Arguments='src\\bridge.mjs';
|
|
260
|
+
next.Bridge.ScriptPath=script;
|
|
261
|
+
next.Bridge.ScriptSha256=actual;
|
|
262
|
+
return next;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
function quoteWindowsArgument(value){
|
|
266
|
+
const text=String(value??'');
|
|
267
|
+
if(text.length<1||/["\r\n\0]/.test(text)) throw new Error('named tunnel argument contains unsafe characters');
|
|
268
|
+
const trailing=(/\\+$/.exec(text)?.[0].length??0);
|
|
269
|
+
return `"${text}${'\\'.repeat(trailing)}"`;
|
|
270
|
+
}
|
|
271
|
+
async function verifyPinnedRegularFile(file,expected,label){
|
|
272
|
+
if(typeof file!=='string'||!path.isAbsolute(file)||!HEX64.test(String(expected??''))) throw new Error(`${label} pin contract invalid`);
|
|
273
|
+
const absolute=path.resolve(file),stat=await lstat(absolute);
|
|
274
|
+
if(!stat.isFile()||stat.isSymbolicLink()) throw new Error(`${label} must be a regular file`);
|
|
275
|
+
const actual=await sha256File(absolute);
|
|
276
|
+
if(actual!==expected) throw new Error(`${label} SHA-256 mismatch: expected ${expected}, found ${actual}`);
|
|
277
|
+
return {path:absolute,sha256:actual};
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
export async function prepareProcessPolicyBootstrap(bootstrap){
|
|
281
|
+
if(!bootstrap) return null;
|
|
282
|
+
const pinned=await verifyPinnedRegularFile(bootstrap.path,bootstrap.sha256,'process policy');
|
|
283
|
+
const policy=await readJson(pinned.path);
|
|
284
|
+
if(policy?.schema!=='deadbyte.process-policy.v1'||policy?.enabled!==true) throw new Error('process policy schema/enabled mismatch');
|
|
285
|
+
return {...pinned,policy};
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
async function preparePinnedCommandPolicy(policy,{commandPins=[],schema,label}={}){
|
|
289
|
+
if(!policy) return {policy:null,repinned:[],matchedCommandIds:[]};
|
|
290
|
+
if(policy.schema!==schema||policy.enabled!==true||!policy.commands||typeof policy.commands!=='object'||Array.isArray(policy.commands)) {
|
|
291
|
+
throw new Error(`${label} policy schema/enabled/commands mismatch`);
|
|
292
|
+
}
|
|
293
|
+
const requested=new Map();
|
|
294
|
+
for(const pin of commandPins){
|
|
295
|
+
const commandId=String(pin?.commandId??''),sha256=String(pin?.sha256??'').toLowerCase();
|
|
296
|
+
if(!/^[A-Za-z0-9._-]{1,64}$/.test(commandId)||!HEX64.test(sha256)) throw new Error(`${label} command pin contract invalid`);
|
|
297
|
+
if(requested.has(commandId)) throw new Error(`duplicate ${label} command pin '${commandId}'`);
|
|
298
|
+
requested.set(commandId,sha256);
|
|
299
|
+
}
|
|
300
|
+
const next=structuredClone(policy),repinned=[],matchedCommandIds=[];
|
|
301
|
+
for(const [commandId,command] of Object.entries(next.commands)){
|
|
302
|
+
const executable=String(command?.executable??''),expected=String(command?.executable_sha256??'').toLowerCase();
|
|
303
|
+
if(!path.isAbsolute(executable)||!HEX64.test(expected)) throw new Error(`${label} command '${commandId}' executable pin contract invalid`);
|
|
304
|
+
const absolute=path.resolve(executable),stat=await lstat(absolute);
|
|
305
|
+
if(!stat.isFile()||stat.isSymbolicLink()) throw new Error(`${label} command '${commandId}' executable must be a regular file`);
|
|
306
|
+
const actual=await sha256File(absolute),explicit=requested.get(commandId);
|
|
307
|
+
if(explicit) matchedCommandIds.push(commandId);
|
|
308
|
+
if(actual!==expected){
|
|
309
|
+
if(!explicit) throw new Error(`${label} command '${commandId}' executable pin drift detected; explicit --host-command-pin ${commandId}=${actual} required`);
|
|
310
|
+
if(explicit!==actual) throw new Error(`${label} command '${commandId}' repin mismatch: supplied ${explicit}, observed ${actual}`);
|
|
311
|
+
command.executable_sha256=actual;
|
|
312
|
+
repinned.push({command_id:commandId,executable:absolute,prior_sha256:expected,new_sha256:actual});
|
|
313
|
+
} else if(explicit&&explicit!==actual){
|
|
314
|
+
throw new Error(`${label} command '${commandId}' repin mismatch: supplied ${explicit}, observed ${actual}`);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
return {policy:next,repinned,matchedCommandIds};
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
export async function prepareHostPolicy(policy,{commandPins=[]}={}){
|
|
321
|
+
if(!policy&&commandPins.length) throw new Error('host command pins supplied but host policy is not configured');
|
|
322
|
+
const result=await preparePinnedCommandPolicy(policy,{commandPins,schema:'deadbyte.host-policy.v1',label:'host'});
|
|
323
|
+
const matched=new Set(result.matchedCommandIds);
|
|
324
|
+
const unknown=commandPins.find(pin=>!matched.has(String(pin?.commandId??'')));
|
|
325
|
+
if(unknown) throw new Error(`unknown host command pin '${unknown.commandId}'`);
|
|
326
|
+
return {policy:result.policy,repinned:result.repinned};
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
export async function prepareAuthorityPolicies({hostPolicy,codingPolicy},{commandPins=[]}={}){
|
|
330
|
+
const host=await preparePinnedCommandPolicy(hostPolicy,{commandPins,schema:'deadbyte.host-policy.v1',label:'host'});
|
|
331
|
+
const coding=await preparePinnedCommandPolicy(codingPolicy,{commandPins,schema:'deadbyte.coding-policy.v1',label:'coding'});
|
|
332
|
+
const matched=new Set([...host.matchedCommandIds,...coding.matchedCommandIds]);
|
|
333
|
+
const unknown=commandPins.find(pin=>!matched.has(String(pin?.commandId??'')));
|
|
334
|
+
if(unknown) throw new Error(`unknown authority command pin '${unknown.commandId}'`);
|
|
335
|
+
return {hostPolicy:host.policy,codingPolicy:coding.policy,hostRepinned:host.repinned,codingRepinned:coding.repinned};
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
export async function prepareNamedTunnelCloudSpec(config,{releaseRoot,bootstrap=null}={}){
|
|
339
|
+
const next=structuredClone(config),cloud=next.Cloud??{};
|
|
340
|
+
const useNamed=bootstrap!==null||cloud.Transport==='deadbyte.named-tunnel.v1'||cloud.Transport==='deadbyte.named-tunnel.v2';
|
|
341
|
+
if(!useNamed) return next;
|
|
342
|
+
const release=path.resolve(releaseRoot),hostPath=path.join(release,'bin','deadbyte-tunnel-host.exe');
|
|
343
|
+
const hostStat=await lstat(hostPath); if(!hostStat.isFile()||hostStat.isSymbolicLink()) throw new Error('named tunnel host must be a regular release file');
|
|
344
|
+
const hostSha256=await sha256File(hostPath);
|
|
345
|
+
if(bootstrap!==null){
|
|
346
|
+
const cloudflared=await verifyPinnedRegularFile(bootstrap.cloudflared.path,bootstrap.cloudflared.sha256,'named tunnel cloudflared');
|
|
347
|
+
const tokenFile=await verifyPinnedRegularFile(bootstrap.tokenFile.path,bootstrap.tokenFile.sha256,'named tunnel token file');
|
|
348
|
+
const childWorkingDirectory=path.resolve(bootstrap.childWorkingDirectory),workStat=await lstat(childWorkingDirectory);
|
|
349
|
+
if(!workStat.isDirectory()||workStat.isSymbolicLink()) throw new Error('named tunnel child working directory must be a real directory');
|
|
350
|
+
next.Cloud={...cloud,FilePath:hostPath,FileSha256:hostSha256,
|
|
351
|
+
Arguments:[cloudflared.path,tokenFile.path,childWorkingDirectory].map(quoteWindowsArgument).join(' '),
|
|
352
|
+
WorkingDirectory:release,Transport:'deadbyte.named-tunnel.v2',Dependencies:[
|
|
353
|
+
{Name:'cloudflared',Path:cloudflared.path,Sha256:cloudflared.sha256},
|
|
354
|
+
{Name:'tunnel-token',Path:tokenFile.path,Sha256:tokenFile.sha256}
|
|
355
|
+
]};
|
|
356
|
+
} else {
|
|
357
|
+
if(cloud.Transport!=='deadbyte.named-tunnel.v2') throw new Error('legacy named tunnel transport requires explicit v2 bootstrap');
|
|
358
|
+
if(!Array.isArray(cloud.Dependencies)||cloud.Dependencies.length!==2) throw new Error('existing named tunnel dependency contract missing');
|
|
359
|
+
next.Cloud={...cloud,FilePath:hostPath,FileSha256:hostSha256,WorkingDirectory:release};
|
|
360
|
+
}
|
|
361
|
+
return next;
|
|
362
|
+
}
|
|
363
|
+
async function ensureStableMcpPath({stateRoot,sourceRoot}){
|
|
364
|
+
const bridgeDir=path.join(stateRoot,'bridge');
|
|
365
|
+
const tokenFile=path.join(bridgeDir,'path-token.txt');
|
|
366
|
+
let token='';
|
|
367
|
+
try { token=(await readFile(tokenFile,'utf8')).trim(); } catch(error){
|
|
368
|
+
if(error?.code!=='ENOENT') throw error;
|
|
369
|
+
if(!sourceRoot) throw new Error('bridge path token missing and no bootstrap source root supplied');
|
|
370
|
+
const legacy=(await readFile(path.join(sourceRoot,'controller','runtime','mcp-path.txt'),'utf8')).trim();
|
|
371
|
+
const match=/^\/mcp\/([0-9a-f]{64})$/.exec(legacy);
|
|
372
|
+
if(!match) throw new Error('legacy MCP path cannot seed stable token');
|
|
373
|
+
token=match[1];
|
|
374
|
+
await mkdir(bridgeDir,{recursive:true});
|
|
375
|
+
await atomicBytes(tokenFile,Buffer.from(`${token}\n`,'ascii'));
|
|
376
|
+
}
|
|
377
|
+
if(!HEX64.test(token)) throw new Error('bridge path token invalid');
|
|
378
|
+
const stableFile=path.join(bridgeDir,'mcp-path.txt');
|
|
379
|
+
const desired=Buffer.from(`/mcp/${token}\n`,'ascii');
|
|
380
|
+
if(existsSync(stableFile)){
|
|
381
|
+
const found=await readFile(stableFile);
|
|
382
|
+
if(!found.equals(desired)) throw new Error('stable MCP path file conflicts with token');
|
|
383
|
+
} else await atomicBytes(stableFile,desired);
|
|
384
|
+
return {path:stableFile,sha256:sha256Bytes(desired)};
|
|
385
|
+
}
|
|
386
|
+
export async function ensureStableMcpUrl({stateRoot,publicOrigin,mcpPathFile}){
|
|
387
|
+
const origin=normalizePersistentPublicOrigin(publicOrigin);
|
|
388
|
+
if(typeof mcpPathFile!=='string'||!path.isAbsolute(mcpPathFile)) throw new Error('stable MCP path file must be absolute');
|
|
389
|
+
const pathStat=await lstat(mcpPathFile);
|
|
390
|
+
if(!pathStat.isFile()||pathStat.isSymbolicLink()) throw new Error('stable MCP path file must be a regular file');
|
|
391
|
+
const mcpPath=(await readFile(mcpPathFile,'ascii')).trim();
|
|
392
|
+
if(!/^\/mcp\/[0-9a-f]{64}$/.test(mcpPath)) throw new Error('stable MCP path file is invalid');
|
|
393
|
+
const bridgeDir=path.join(path.resolve(stateRoot),'bridge'),stableFile=path.join(bridgeDir,'mcp-url.txt');
|
|
394
|
+
const desired=Buffer.from(`${origin}${mcpPath}\n`,'ascii');
|
|
395
|
+
const before=existsSync(stableFile)?await readFile(stableFile):null;
|
|
396
|
+
if(!before||!before.equals(desired)) await atomicBytes(stableFile,desired);
|
|
397
|
+
return {path:stableFile,sha256:sha256Bytes(desired),origin,changed:!before||!before.equals(desired)};
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
async function snapshotFile(file){
|
|
401
|
+
try { const bytes=await readFile(file); return {exists:true,bytes,sha256:sha256Bytes(bytes)}; }
|
|
402
|
+
catch(error){ if(error?.code==='ENOENT') return {exists:false,bytes:null,sha256:null}; throw error; }
|
|
403
|
+
}
|
|
404
|
+
async function restoreFile(file,snapshot){
|
|
405
|
+
if(snapshot.exists) await atomicBytes(file,snapshot.bytes);
|
|
406
|
+
else await rm(file,{force:true});
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
export function parseControllerStatus(text){
|
|
410
|
+
const number=re=>{const match=re.exec(text);return match?Number(match[1]):null;};
|
|
411
|
+
return {
|
|
412
|
+
online:/DEADBYTE MCP = ONLINE/.test(text),
|
|
413
|
+
offline:/DEADBYTE MCP = OFFLINE/.test(text),
|
|
414
|
+
bridge_pid:number(/Bridge PID\s*:\s*(\d+)\s*\[verified\]/),
|
|
415
|
+
cloud_pid:number(/Cloud PID\s*:\s*(\d+)\s*\[verified\]/),
|
|
416
|
+
local_ready:/Local ready\s*:\s*True/.test(text),
|
|
417
|
+
coding_armed:/Coding plane\s*:\s*ARMED \[standing-grant\]/.test(text),
|
|
418
|
+
autonomous_armed:/Autonomous\s*:\s*ARMED \[standing-grant\]/.test(text),
|
|
419
|
+
host_armed:/Host plane\s*:\s*ARMED \[standing-grant\]/.test(text)
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
function controlResult(exe,args,{cwd,env,timeoutMs=45000,stdio='pipe'}={}){
|
|
423
|
+
if(stdio==='ignore'){
|
|
424
|
+
const result=spawnSync(exe,args,{cwd,env:commandEnvironment(exe,env??process.env),windowsHide:true,timeout:timeoutMs,stdio:'ignore'});
|
|
425
|
+
return {status:result.status,signal:result.signal,error:result.error?{code:result.error.code??null,message:result.error.message}:null,stdout:'',stderr:''};
|
|
426
|
+
}
|
|
427
|
+
return runCaptured(exe,args,{cwd,env,timeoutMs});
|
|
428
|
+
}
|
|
429
|
+
export function legacyContext(sourceRoot){
|
|
430
|
+
const root=path.resolve(sourceRoot);
|
|
431
|
+
const candidates=['deadbyte-controller-r26.ps1','deadbyte-controller.ps1'];
|
|
432
|
+
const controller=candidates.map(name=>path.join(root,'controller',name)).find(existsSync);
|
|
433
|
+
if(!controller) throw new Error('legacy controller entry missing');
|
|
434
|
+
return {kind:'legacy',source_root:root,core_root:root,controller_path:controller,
|
|
435
|
+
cwd:root,runtime_root:path.join(root,'controller','runtime'),state_root:null};
|
|
436
|
+
}
|
|
437
|
+
function slotContext(stateRoot,pointer){
|
|
438
|
+
return {kind:'slot',source_root:null,core_root:path.resolve(pointer.release_root),
|
|
439
|
+
controller_path:path.join(pointer.release_root,'controller','deadbyte-controller.ps1'),
|
|
440
|
+
cwd:path.resolve(pointer.release_root),runtime_root:path.join(path.resolve(stateRoot),'runtime'),
|
|
441
|
+
state_root:path.resolve(stateRoot),pointer};
|
|
442
|
+
}
|
|
443
|
+
function launcherPath(stateRoot){ return path.join(path.resolve(stateRoot),'bin','DEADBYTE-MCP.ps1'); }
|
|
444
|
+
function controllerInvocation(ctx,command){
|
|
445
|
+
if(ctx.kind==='slot') return {exe:powershellPath(),args:['-NoLogo','-NoProfile','-ExecutionPolicy','Bypass','-File',launcherPath(ctx.state_root),command],cwd:ctx.state_root};
|
|
446
|
+
return {exe:powershellPath(),args:['-NoLogo','-NoProfile','-ExecutionPolicy','Bypass','-File',ctx.controller_path,command],cwd:ctx.cwd};
|
|
447
|
+
}
|
|
448
|
+
function controllerCaptured(ctx,command,timeoutMs=45000){
|
|
449
|
+
const call=controllerInvocation(ctx,command); const result=controlResult(call.exe,call.args,{cwd:call.cwd,timeoutMs});
|
|
450
|
+
return assertRun(result,`controller ${command}`);
|
|
451
|
+
}
|
|
452
|
+
export function runControllerStartNoCapture(ctx,timeoutMs=45000){
|
|
453
|
+
const call=controllerInvocation(ctx,'start');
|
|
454
|
+
return controlResult(call.exe,call.args,{cwd:call.cwd,timeoutMs,stdio:'ignore'});
|
|
455
|
+
}
|
|
456
|
+
async function readLedger(ctx,name){
|
|
457
|
+
const file=path.join(ctx.runtime_root,`${name}.instance.json`);
|
|
458
|
+
const value=JSON.parse((await readFile(file,'utf8')).replace(/^\uFEFF/,''));
|
|
459
|
+
if(value.schema!=='deadbyte.controller.v1'||value.component!==name||!Number.isInteger(Number(value.pid))||
|
|
460
|
+
!HEX64.test(String(value.instance_nonce))||!HEX64.test(String(value.image_sha256))) {
|
|
461
|
+
throw new Error(`${name} ledger identity invalid`);
|
|
462
|
+
}
|
|
463
|
+
return {schema:value.schema,component:value.component,instance_nonce:String(value.instance_nonce),
|
|
464
|
+
pid:Number(value.pid),creation_time_utc:String(value.creation_time_utc??''),image_path:String(value.image_path??''),
|
|
465
|
+
image_sha256:String(value.image_sha256)};
|
|
466
|
+
}
|
|
467
|
+
function sameGeneration(a,b){
|
|
468
|
+
return a.pid===b.pid&&a.instance_nonce===b.instance_nonce&&a.creation_time_utc===b.creation_time_utc&&a.image_sha256===b.image_sha256;
|
|
469
|
+
}
|
|
470
|
+
function nodeProcesses(){
|
|
471
|
+
const command=`Get-CimInstance Win32_Process -Filter \"Name='node.exe'\" | Select-Object ProcessId,ParentProcessId,CreationDate,ExecutablePath,CommandLine | ConvertTo-Json -Compress`;
|
|
472
|
+
const result=runCaptured(powershellPath(),['-NoLogo','-NoProfile','-Command',command],{timeoutMs:15000});
|
|
473
|
+
const text=assertRun(result,'node process query').trim(); if(!text) return [];
|
|
474
|
+
const parsed=JSON.parse(text); return Array.isArray(parsed)?parsed:[parsed];
|
|
475
|
+
}
|
|
476
|
+
function coreProcess(coreRoot,bridgePid){
|
|
477
|
+
const needle=path.join(coreRoot,'src','mcp-server.mjs').replaceAll('/','\\').toLowerCase();
|
|
478
|
+
const matches=nodeProcesses().filter(item=>Number(item.ParentProcessId)===bridgePid&&String(item.CommandLine??'').toLowerCase().includes(needle));
|
|
479
|
+
if(matches.length!==1) throw new Error(`expected one downstream core for bridge ${bridgePid}, found ${matches.length}`);
|
|
480
|
+
const item=matches[0]; return {pid:Number(item.ProcessId),parent_pid:Number(item.ParentProcessId),creation_date:String(item.CreationDate??''),
|
|
481
|
+
executable_path:String(item.ExecutablePath??''),command_line:String(item.CommandLine??'')};
|
|
482
|
+
}
|
|
483
|
+
async function captureRuntime(ctx){
|
|
484
|
+
const statusText=controllerCaptured(ctx,'status',15000); const status=parseControllerStatus(statusText);
|
|
485
|
+
if(!status.online||!status.bridge_pid||!status.cloud_pid||!status.local_ready) throw new Error(`slot update requires ONLINE runtime: ${statusText}`);
|
|
486
|
+
if(status.host_armed) throw new Error('slot update requires host plane DISARMED');
|
|
487
|
+
if(status.autonomous_armed&&!status.coding_armed) throw new Error('invalid runtime authority: autonomous armed without coding');
|
|
488
|
+
const bridge=await readLedger(ctx,'bridge'); const cloud=await readLedger(ctx,'cloud'); const core=coreProcess(ctx.core_root,status.bridge_pid);
|
|
489
|
+
return {status,status_text:statusText.trim(),bridge,cloud,core};
|
|
490
|
+
}
|
|
491
|
+
async function capturePredecessor(ctx,recoverOfflinePredecessor){
|
|
492
|
+
const statusText=controllerCaptured(ctx,'status',15000),status=parseControllerStatus(statusText);
|
|
493
|
+
if(status.online&&status.bridge_pid&&status.cloud_pid&&status.local_ready){
|
|
494
|
+
const runtime=await captureRuntime(ctx);
|
|
495
|
+
return {mode:'online',status:runtime.status,status_text:runtime.status_text,runtime};
|
|
496
|
+
}
|
|
497
|
+
if(!recoverOfflinePredecessor) throw new Error(`slot update requires ONLINE runtime: ${statusText}`);
|
|
498
|
+
if(!status.offline||status.bridge_pid||status.cloud_pid||status.local_ready) throw new Error(`offline predecessor recovery requires clean OFFLINE controller state: ${statusText}`);
|
|
499
|
+
if(status.host_armed) throw new Error('offline predecessor recovery requires host plane DISARMED');
|
|
500
|
+
if(status.autonomous_armed&&!status.coding_armed) throw new Error('invalid runtime authority: autonomous armed without coding');
|
|
501
|
+
return {mode:'offline-recovery',status,status_text:statusText.trim(),runtime:null};
|
|
502
|
+
}
|
|
503
|
+
async function waitCoreGone(runtime,timeoutMs=10000){
|
|
504
|
+
const started=Date.now();
|
|
505
|
+
while(Date.now()-started<timeoutMs){
|
|
506
|
+
const found=nodeProcesses().find(item=>Number(item.ProcessId)===runtime.core.pid&&String(item.CreationDate??'')===runtime.core.creation_date);
|
|
507
|
+
if(!found) return true; await sleep(250);
|
|
508
|
+
}
|
|
509
|
+
return false;
|
|
510
|
+
}
|
|
511
|
+
async function startAndVerify(ctx,oldRuntime){
|
|
512
|
+
let start=null;
|
|
513
|
+
for(let attempt=1;attempt<=3;attempt+=1){
|
|
514
|
+
start=runControllerStartNoCapture(ctx,45000);
|
|
515
|
+
if(!start.error&&start.status===0) break;
|
|
516
|
+
if(attempt<3) await sleep(1500);
|
|
517
|
+
}
|
|
518
|
+
if(start.error||start.status!==0) throw new Error(`controller start transport failed status=${start.status} error=${start.error?.message??'none'}`);
|
|
519
|
+
let statusText=''; let status=null;
|
|
520
|
+
const started=Date.now();
|
|
521
|
+
while(Date.now()-started<45000){
|
|
522
|
+
try { statusText=controllerCaptured(ctx,'status',15000); status=parseControllerStatus(statusText); if(status.online&&status.bridge_pid&&status.cloud_pid&&status.local_ready) break; }
|
|
523
|
+
catch {} await sleep(500);
|
|
524
|
+
}
|
|
525
|
+
if(!status?.online||!status.bridge_pid||!status.cloud_pid||!status.local_ready) throw new Error(`new runtime failed ONLINE gate: ${statusText}`);
|
|
526
|
+
const bridge=await readLedger(ctx,'bridge'); const cloud=await readLedger(ctx,'cloud'); const core=coreProcess(ctx.core_root,status.bridge_pid);
|
|
527
|
+
if(oldRuntime?.bridge&&sameGeneration(oldRuntime.bridge,bridge)) throw new Error('fresh bridge generation gate failed');
|
|
528
|
+
if(oldRuntime?.cloud&&sameGeneration(oldRuntime.cloud,cloud)) throw new Error('fresh cloud generation gate failed');
|
|
529
|
+
if(oldRuntime?.core&&oldRuntime.core.pid===core.pid&&oldRuntime.core.creation_date===core.creation_date) throw new Error('fresh downstream core generation gate failed');
|
|
530
|
+
return {status,status_text:statusText.trim(),bridge,cloud,core};
|
|
531
|
+
}
|
|
532
|
+
async function stabilizeRuntime(ctx,runtime){
|
|
533
|
+
const started=Date.now(); let probes=0;
|
|
534
|
+
while(Date.now()-started<RUNTIME_STABILITY_MS){
|
|
535
|
+
await sleep(RUNTIME_STABILITY_POLL_MS);
|
|
536
|
+
const statusText=controllerCaptured(ctx,'status',15000),status=parseControllerStatus(statusText);
|
|
537
|
+
if(!status.online||!status.local_ready||status.bridge_pid!==runtime.bridge.pid||status.cloud_pid!==runtime.cloud.pid) {
|
|
538
|
+
throw new Error(`new runtime lost stability gate: ${statusText}`);
|
|
539
|
+
}
|
|
540
|
+
const bridge=await readLedger(ctx,'bridge'),cloud=await readLedger(ctx,'cloud');
|
|
541
|
+
if(!sameGeneration(runtime.bridge,bridge)||!sameGeneration(runtime.cloud,cloud)) throw new Error('new runtime generation changed during stability gate');
|
|
542
|
+
probes++;
|
|
543
|
+
}
|
|
544
|
+
controllerCaptured(ctx,'test',60000);
|
|
545
|
+
const finalText=controllerCaptured(ctx,'status',15000),final=parseControllerStatus(finalText);
|
|
546
|
+
if(!final.online||!final.local_ready||final.bridge_pid!==runtime.bridge.pid||final.cloud_pid!==runtime.cloud.pid) {
|
|
547
|
+
throw new Error(`new runtime failed post-public stability gate: ${finalText}`);
|
|
548
|
+
}
|
|
549
|
+
return {duration_ms:Date.now()-started,probes,public_mcp_gate:'passed'};
|
|
550
|
+
}
|
|
551
|
+
async function verifyPackageRoot(root,expectedVersion,expectedManifest,label){
|
|
552
|
+
const absolute=path.resolve(root); const info=await lstat(absolute);
|
|
553
|
+
if(!info.isDirectory()||info.isSymbolicLink()) throw new Error(`${label} root must be a real directory`);
|
|
554
|
+
const manifestBytes=await readFile(path.join(absolute,'MANIFEST.SHA256'));
|
|
555
|
+
const digest=sha256Bytes(manifestBytes); if(digest!==expectedManifest) throw new Error(`${label} manifest digest mismatch: ${digest}`);
|
|
556
|
+
const entries=parseManifest(manifestBytes.toString('utf8')); await verifyManifestTree(absolute,entries);
|
|
557
|
+
const pkg=await readJson(path.join(absolute,'package.json'));
|
|
558
|
+
if(pkg?.name!=='deadbyte-mcp'||pkg?.version!==expectedVersion) throw new Error(`${label} package identity mismatch`);
|
|
559
|
+
return {root:absolute,manifest_sha256:digest,entries:entries.size};
|
|
560
|
+
}
|
|
561
|
+
async function verifyActiveInstallation(stateRoot,pointer){
|
|
562
|
+
const state=path.resolve(stateRoot); const expectedRelease=path.join(state,'releases',releaseId(pointer.version,pointer.manifest_sha256));
|
|
563
|
+
if(path.resolve(pointer.release_root)!==path.resolve(expectedRelease)) throw new Error('active pointer release root is not content-addressed store path');
|
|
564
|
+
const release=await verifyPackageRoot(pointer.release_root,pointer.version,pointer.manifest_sha256,'active release');
|
|
565
|
+
const generation=await verifyGenerationBundle(pointer.generation_root,pointer.generation_manifest_sha256);
|
|
566
|
+
const expectedConfig=path.join(path.resolve(pointer.generation_root),'controller-config.psd1');
|
|
567
|
+
if(path.resolve(pointer.config_path)!==path.resolve(expectedConfig)) throw new Error('active pointer config path mismatch');
|
|
568
|
+
const currentLauncher=await sha256File(launcherPath(state));
|
|
569
|
+
if(currentLauncher!==pointer.launcher_sha256) throw new Error('active pointer launcher digest mismatch');
|
|
570
|
+
return {release,generation};
|
|
571
|
+
}
|
|
572
|
+
async function loadPointerIfPresent(stateRoot){
|
|
573
|
+
const file=path.join(path.resolve(stateRoot),'active-release.json');
|
|
574
|
+
if(!existsSync(file)) return {file,pointer:null,snapshot:await snapshotFile(file)};
|
|
575
|
+
const snapshot=await snapshotFile(file); const pointer=parseActivePointer(snapshot.bytes.toString('utf8'));
|
|
576
|
+
await verifyActiveInstallation(stateRoot,pointer); return {file,pointer,snapshot};
|
|
577
|
+
}
|
|
578
|
+
async function loadControlInputs({stateRoot,sourceRoot,pointerInfo}){
|
|
579
|
+
let configPath,ctx;
|
|
580
|
+
if(pointerInfo.pointer){
|
|
581
|
+
configPath=pointerInfo.pointer.config_path; ctx=slotContext(stateRoot,pointerInfo.pointer);
|
|
582
|
+
} else {
|
|
583
|
+
if(!sourceRoot) throw new Error('--source-root is required for initial slot migration');
|
|
584
|
+
ctx=legacyContext(sourceRoot); configPath=path.join(ctx.source_root,'controller','deadbyte-controller.config.psd1');
|
|
585
|
+
}
|
|
586
|
+
let config=await loadPowerShellDataFile(configPath); config=await normalizeComponentIdentities(config);
|
|
587
|
+
const codingPath=String(config.CodingPolicyFile??''); const autonomousPath=String(config.AutonomousPolicyFile??''); const hostPath=String(config.HostPolicyFile??''); const processPath=String(config.ProcessPolicyFile??'');
|
|
588
|
+
if(!path.isAbsolute(codingPath)||!path.isAbsolute(autonomousPath)) throw new Error('coding/autonomous policy paths must be absolute');
|
|
589
|
+
if(processPath&&!path.isAbsolute(processPath)) throw new Error('process policy path must be absolute');
|
|
590
|
+
const codingPolicy=await readJson(codingPath); const autonomousPolicy=await readJson(autonomousPath); const hostPolicy=hostPath?await readJson(hostPath):null; const processPolicy=processPath?await readJson(processPath):null;
|
|
591
|
+
const legacyCore=typeof config.CoreRoot==='string'&&config.CoreRoot?path.resolve(config.CoreRoot):ctx.core_root;
|
|
592
|
+
const workspaceRoot=typeof config.WorkspaceRoot==='string'&&config.WorkspaceRoot?path.resolve(config.WorkspaceRoot):path.join(legacyCore,'workspaces');
|
|
593
|
+
return {ctx,configPath,config,codingPolicy,autonomousPolicy,hostPolicy,processPolicy,workspaceRoot};
|
|
594
|
+
}
|
|
595
|
+
export function assertDevelopmentRootSafe(developmentRoot,stateRoot){
|
|
596
|
+
const dev=path.resolve(developmentRoot),state=path.resolve(stateRoot);
|
|
597
|
+
const forbidden=[path.join(state,'releases'),path.join(state,'generations'),path.join(state,'runtime')].map(item=>path.resolve(item).toLowerCase());
|
|
598
|
+
const lower=dev.toLowerCase();
|
|
599
|
+
if(forbidden.some(prefix=>lower===prefix||lower.startsWith(`${prefix}${path.sep}`))) throw new Error('development root cannot live inside immutable/runtime state stores');
|
|
600
|
+
return dev;
|
|
601
|
+
}
|
|
602
|
+
async function workspacePlan(currentWorkspace,stateRoot){
|
|
603
|
+
const source=path.resolve(currentWorkspace),target=path.join(path.resolve(stateRoot),'workspaces');
|
|
604
|
+
if(source.toLowerCase()===path.resolve(target).toLowerCase()) return {source,target,mode:'existing',moved:false};
|
|
605
|
+
const sourceExists=existsSync(source),targetExists=existsSync(target);
|
|
606
|
+
if(targetExists){
|
|
607
|
+
const info=await lstat(target); if(!info.isDirectory()||info.isSymbolicLink()) throw new Error('stable workspace root must be a real directory');
|
|
608
|
+
if(sourceExists) throw new Error(`workspace migration conflict: both source and stable target exist (${source}, ${target})`);
|
|
609
|
+
return {source,target,mode:'target-existing',moved:false};
|
|
610
|
+
}
|
|
611
|
+
if(!sourceExists) return {source,target,mode:'create',moved:false};
|
|
612
|
+
const info=await lstat(source); if(!info.isDirectory()||info.isSymbolicLink()) throw new Error('legacy workspace root must be a real directory');
|
|
613
|
+
if(path.parse(source).root.toLowerCase()!==path.parse(target).root.toLowerCase()) throw new Error('workspace migration requires same-volume rename');
|
|
614
|
+
return {source,target,mode:'rename',moved:false};
|
|
615
|
+
}
|
|
616
|
+
async function applyWorkspacePlan(plan){
|
|
617
|
+
if(plan.mode==='existing'||plan.mode==='target-existing') return plan;
|
|
618
|
+
await mkdir(path.dirname(plan.target),{recursive:true});
|
|
619
|
+
if(plan.mode==='create'){ await mkdir(plan.target,{recursive:false}); plan.created=true; return plan; }
|
|
620
|
+
await rename(plan.source,plan.target); plan.moved=true; return plan;
|
|
621
|
+
}
|
|
622
|
+
async function rollbackWorkspacePlan(plan){
|
|
623
|
+
if(plan.moved&&existsSync(plan.target)&&!existsSync(plan.source)){ await rename(plan.target,plan.source); plan.moved=false; return true; }
|
|
624
|
+
if(plan.created&&existsSync(plan.target)){ await rm(plan.target,{recursive:true,force:true}); plan.created=false; return true; }
|
|
625
|
+
return false;
|
|
626
|
+
}
|
|
627
|
+
async function launcherPlan(stateRoot){
|
|
628
|
+
const bin=path.join(path.resolve(stateRoot),'bin');
|
|
629
|
+
const ps1=path.join(bin,'DEADBYTE-MCP.ps1'),cmd=path.join(bin,'DEADBYTE-MCP.cmd'),top=TOP_LAUNCHER;
|
|
630
|
+
const ps1Bytes=Buffer.from(renderStableLauncherPs1(),'utf8'),cmdBytes=Buffer.from(renderStableLauncherCmd(),'utf8');
|
|
631
|
+
return {ps1,cmd,top,ps1Bytes,cmdBytes,launcher_sha256:sha256Bytes(ps1Bytes),
|
|
632
|
+
snapshots:{ps1:await snapshotFile(ps1),cmd:await snapshotFile(cmd),top:await snapshotFile(top)},installed:false};
|
|
633
|
+
}
|
|
634
|
+
async function installLaunchers(plan){
|
|
635
|
+
await atomicBytes(plan.ps1,plan.ps1Bytes); await atomicBytes(plan.cmd,plan.cmdBytes); await atomicBytes(plan.top,plan.cmdBytes);
|
|
636
|
+
plan.installed=true;
|
|
637
|
+
if(await sha256File(plan.ps1)!==plan.launcher_sha256) throw new Error('stable launcher post-install hash mismatch');
|
|
638
|
+
return plan;
|
|
639
|
+
}
|
|
640
|
+
async function rollbackLaunchers(plan){
|
|
641
|
+
if(!plan?.installed) return false;
|
|
642
|
+
await restoreFile(plan.ps1,plan.snapshots.ps1); await restoreFile(plan.cmd,plan.snapshots.cmd); await restoreFile(plan.top,plan.snapshots.top);
|
|
643
|
+
plan.installed=false; return true;
|
|
644
|
+
}
|
|
645
|
+
async function revokeAuthority(ctx,prior){
|
|
646
|
+
let revoked=false;
|
|
647
|
+
if(prior.autonomous_armed){ controllerCaptured(ctx,'disarmautonomous',15000); revoked=true; }
|
|
648
|
+
if(prior.coding_armed){ controllerCaptured(ctx,'disarmcoding',15000); revoked=true; }
|
|
649
|
+
const status=parseControllerStatus(controllerCaptured(ctx,'status',15000));
|
|
650
|
+
if(status.coding_armed||status.autonomous_armed) throw new Error('standing authority revoke gate failed');
|
|
651
|
+
if(status.host_armed) throw new Error('host plane became armed during revoke');
|
|
652
|
+
return {revoked,status};
|
|
653
|
+
}
|
|
654
|
+
async function restoreStandingAuthority(ctx,prior,enabled){
|
|
655
|
+
if(!enabled){
|
|
656
|
+
const status=parseControllerStatus(controllerCaptured(ctx,'status',15000));
|
|
657
|
+
if(status.coding_armed||status.autonomous_armed) throw new Error('standing authority unexpectedly survived slot switch');
|
|
658
|
+
if(status.host_armed) throw new Error('host plane became armed during slot switch');
|
|
659
|
+
return status;
|
|
660
|
+
}
|
|
661
|
+
if(prior.autonomous_armed&&!prior.coding_armed) throw new Error('invalid prior authority: autonomous armed without coding');
|
|
662
|
+
if(prior.coding_armed) controllerCaptured(ctx,'armcoding',15000);
|
|
663
|
+
if(prior.autonomous_armed) controllerCaptured(ctx,'armautonomous',15000);
|
|
664
|
+
const status=parseControllerStatus(controllerCaptured(ctx,'status',15000));
|
|
665
|
+
if(status.coding_armed!==prior.coding_armed) throw new Error('coding standing-grant restore gate failed');
|
|
666
|
+
if(status.autonomous_armed!==prior.autonomous_armed) throw new Error('autonomous standing-grant restore gate failed');
|
|
667
|
+
if(status.host_armed) throw new Error('host plane became armed during slot switch');
|
|
668
|
+
return status;
|
|
669
|
+
}
|
|
670
|
+
async function stopAndVerify(ctx,runtime){
|
|
671
|
+
const output=controllerCaptured(ctx,'stop',30000);
|
|
672
|
+
if(!(await waitCoreGone(runtime,10000))) throw new Error(`old downstream core ${runtime.core.pid} survived verified stop`);
|
|
673
|
+
const status=parseControllerStatus(controllerCaptured(ctx,'status',15000));
|
|
674
|
+
if(!status.offline) throw new Error(`controller stop did not reach OFFLINE: ${output}`);
|
|
675
|
+
return {output:output.trim(),status};
|
|
676
|
+
}
|
|
677
|
+
async function loadUpdateKey(stateRoot){
|
|
678
|
+
const trust=path.join(path.resolve(stateRoot),'trust');
|
|
679
|
+
const privateKey=createPrivateKey(await readFile(path.join(trust,'ed25519-private.pem')));
|
|
680
|
+
const publicKey=createPublicKey(await readFile(path.join(trust,'ed25519-public.pem'))); const derived=createPublicKey(privateKey);
|
|
681
|
+
if(privateKey.asymmetricKeyType!=='ed25519'||publicKey.asymmetricKeyType!=='ed25519') throw new Error('slot-update trust key must be Ed25519');
|
|
682
|
+
const der=key=>Buffer.from(key.export({type:'spki',format:'der'})); const keyId=sha256Bytes(der(publicKey));
|
|
683
|
+
if(sha256Bytes(der(derived))!==keyId) throw new Error('slot-update private/public key mismatch');
|
|
684
|
+
return {privateKey,publicKey,keyId};
|
|
685
|
+
}
|
|
686
|
+
function signEnvelope(body,key){
|
|
687
|
+
const bodyBytes=Buffer.from(canonicalJson(body),'utf8'); const signature=cryptoSign(null,Buffer.concat([RECEIPT_DOMAIN,bodyBytes]),key.privateKey);
|
|
688
|
+
const envelope={body,body_sha256:sha256Bytes(bodyBytes),attestation:{algorithm:'ed25519',domain:'DEADBYTE-R27-SLOT-UPDATE-V1',key_id:key.keyId,signature_base64:signature.toString('base64')}};
|
|
689
|
+
envelope.receipt_sha256=sha256Bytes(Buffer.from(canonicalJson(envelope),'utf8'));
|
|
690
|
+
if(!cryptoVerify(null,Buffer.concat([RECEIPT_DOMAIN,bodyBytes]),key.publicKey,signature)) throw new Error('slot-update signature self-check failed');
|
|
691
|
+
return envelope;
|
|
692
|
+
}
|
|
693
|
+
export function verifySlotUpdateEnvelope(envelope,publicKey){
|
|
694
|
+
if(!envelope?.body||!envelope?.attestation) return false; const bodyBytes=Buffer.from(canonicalJson(envelope.body),'utf8');
|
|
695
|
+
if(sha256Bytes(bodyBytes)!==envelope.body_sha256) return false; const {receipt_sha256,...unsigned}=envelope;
|
|
696
|
+
if(sha256Bytes(Buffer.from(canonicalJson(unsigned),'utf8'))!==receipt_sha256) return false;
|
|
697
|
+
if(envelope.attestation.algorithm!=='ed25519'||envelope.attestation.domain!=='DEADBYTE-R27-SLOT-UPDATE-V1') return false;
|
|
698
|
+
const keyId=sha256Bytes(Buffer.from(publicKey.export({type:'spki',format:'der'}))); if(keyId!==envelope.attestation.key_id) return false;
|
|
699
|
+
return cryptoVerify(null,Buffer.concat([RECEIPT_DOMAIN,bodyBytes]),publicKey,Buffer.from(envelope.attestation.signature_base64,'base64'));
|
|
700
|
+
}
|
|
701
|
+
async function writeEnvelope(file,body,key){ const envelope=signEnvelope(body,key); await atomicBytes(file,Buffer.from(`${JSON.stringify(envelope,null,2)}\n`,'utf8')); return envelope; }
|
|
702
|
+
async function writeState(file,state,phase,extra={}){
|
|
703
|
+
Object.assign(state,extra,{phase,updated_at_utc:new Date().toISOString()});
|
|
704
|
+
await atomicBytes(file,Buffer.from(`${JSON.stringify(state,null,2)}\n`,'utf8'));
|
|
705
|
+
}
|
|
706
|
+
function generationTuple(runtime){
|
|
707
|
+
if(!runtime) return null;
|
|
708
|
+
return {bridge:{pid:runtime.bridge.pid,instance_nonce:runtime.bridge.instance_nonce,creation_time_utc:runtime.bridge.creation_time_utc,image_sha256:runtime.bridge.image_sha256},
|
|
709
|
+
cloud:{pid:runtime.cloud.pid,instance_nonce:runtime.cloud.instance_nonce,creation_time_utc:runtime.cloud.creation_time_utc,image_sha256:runtime.cloud.image_sha256},
|
|
710
|
+
core:{pid:runtime.core.pid,parent_pid:runtime.core.parent_pid,creation_date:runtime.core.creation_date,command_line:runtime.core.command_line}};
|
|
711
|
+
}
|
|
712
|
+
function publicPointer(pointer){
|
|
713
|
+
if(!pointer) return null;
|
|
714
|
+
return {schema:pointer.schema,release_id:pointer.release_id,version:pointer.version,manifest_sha256:pointer.manifest_sha256,
|
|
715
|
+
release_root:pointer.release_root,generation_root:pointer.generation_root,generation_manifest_sha256:pointer.generation_manifest_sha256,
|
|
716
|
+
launcher_sha256:pointer.launcher_sha256,config_path:pointer.config_path};
|
|
717
|
+
}
|
|
718
|
+
export async function performSlotUpdate({stage,developmentRoot,expectedVersion,expectedManifest,sourceRoot=null,stateRoot=DEFAULT_STATE_ROOT,restoreStandingGrants=false,recoverOfflinePredecessor=false,cloudTransport=null,bridgeBootstrap=null,processPolicyBootstrap=null,enableMachineFs=false,enableObservation=false,hostCommandPins=[]}){
|
|
719
|
+
if(process.platform!=='win32') throw new Error('R27 slot update is Windows-only');
|
|
720
|
+
const state=path.resolve(stateRoot),stageRoot=path.resolve(stage),development=assertDevelopmentRootSafe(developmentRoot,state);
|
|
721
|
+
const key=await loadUpdateKey(state); const updateId=`r27-${expectedManifest.slice(0,16)}-${Date.now().toString(36)}-${randomBytes(4).toString('hex')}`;
|
|
722
|
+
const evidenceDir=path.join(state,'evidence','updates',updateId),statePath=path.join(evidenceDir,'state.json');
|
|
723
|
+
const receiptPath=path.join(evidenceDir,'receipt.json'),failurePath=path.join(evidenceDir,'failure-receipt.json');
|
|
724
|
+
await mkdir(evidenceDir,{recursive:true});
|
|
725
|
+
const journal={schema:'deadbyte.r27-slot-update-state.v1',update_id:updateId,stage_root:stageRoot,development_root:development,
|
|
726
|
+
source_root:sourceRoot?path.resolve(sourceRoot):null,expected_version:expectedVersion,expected_manifest_sha256:expectedManifest,
|
|
727
|
+
restore_standing_grants:restoreStandingGrants,recover_offline_predecessor:recoverOfflinePredecessor,created_at_utc:new Date().toISOString()};
|
|
728
|
+
await writeState(statePath,journal,'initial');
|
|
729
|
+
let pointerInfo=null,control=null,predecessor=null,oldRuntime=null,priorStatus=null,authorityPreparation=null,workspace=null,launchers=null,newPointer=null,newCtx=null;
|
|
730
|
+
let stableMcpUrl=null,mcpUrlSnapshot=null;
|
|
731
|
+
let revoked=false,stopped=false,pointerCommitted=false,newStarted=false;
|
|
732
|
+
try {
|
|
733
|
+
pointerInfo=await loadPointerIfPresent(state);
|
|
734
|
+
const stageVerified=await verifyPackageRoot(stageRoot,expectedVersion,expectedManifest,'stage');
|
|
735
|
+
const developmentVerified=await verifyPackageRoot(development,expectedVersion,expectedManifest,'development');
|
|
736
|
+
const slot=await materializeReleaseSlot({source:stageRoot,stateRoot:state,version:expectedVersion,manifestSha256:expectedManifest});
|
|
737
|
+
control=await loadControlInputs({stateRoot:state,sourceRoot,pointerInfo});
|
|
738
|
+
const processBootstrap=await prepareProcessPolicyBootstrap(processPolicyBootstrap);
|
|
739
|
+
if(processBootstrap){
|
|
740
|
+
control.processPolicy=processBootstrap.policy;
|
|
741
|
+
control.config.ProcessRuntimeEnabled=true;
|
|
742
|
+
}
|
|
743
|
+
if(enableMachineFs){
|
|
744
|
+
if(control.config.CodingRuntimeEnabled!==true) throw new Error('MachineFsRuntimeEnabled requires CodingRuntimeEnabled');
|
|
745
|
+
control.config.MachineFsRuntimeEnabled=true;
|
|
746
|
+
}
|
|
747
|
+
if(enableObservation){
|
|
748
|
+
if(control.config.MachineRuntimeEnabled===false) throw new Error('ObservationRuntimeEnabled requires MachineRuntimeEnabled');
|
|
749
|
+
if(control.config.CodingRuntimeEnabled!==true) throw new Error('ObservationRuntimeEnabled requires CodingRuntimeEnabled');
|
|
750
|
+
control.config.ObservationRuntimeEnabled=true;
|
|
751
|
+
}
|
|
752
|
+
control.config=await prepareBridgeSpec(control.config,bridgeBootstrap);
|
|
753
|
+
control.config=await prepareNamedTunnelCloudSpec(control.config,{releaseRoot:slot.release_root,bootstrap:cloudTransport});
|
|
754
|
+
authorityPreparation=await prepareAuthorityPolicies({hostPolicy:control.hostPolicy,codingPolicy:control.codingPolicy},{commandPins:hostCommandPins});
|
|
755
|
+
control.hostPolicy=authorityPreparation.hostPolicy;
|
|
756
|
+
control.codingPolicy=authorityPreparation.codingPolicy;
|
|
757
|
+
const stableMcp=await ensureStableMcpPath({stateRoot:state,sourceRoot:pointerInfo.pointer?null:sourceRoot});
|
|
758
|
+
control.config.McpPathFile=stableMcp.path;
|
|
759
|
+
if(cloudTransport?.publicOrigin){
|
|
760
|
+
const mcpUrlFile=path.join(state,'bridge','mcp-url.txt');
|
|
761
|
+
mcpUrlSnapshot=await snapshotFile(mcpUrlFile);
|
|
762
|
+
stableMcpUrl=await ensureStableMcpUrl({stateRoot:state,publicOrigin:cloudTransport.publicOrigin,mcpPathFile:stableMcp.path});
|
|
763
|
+
control.config.McpUrlFile=stableMcpUrl.path;
|
|
764
|
+
control.config.McpUrlFileSha256=stableMcpUrl.sha256;
|
|
765
|
+
} else if(control.config.Cloud?.Transport==='deadbyte.named-tunnel.v2') {
|
|
766
|
+
if(typeof control.config.McpUrlFile!=='string'||!path.isAbsolute(control.config.McpUrlFile)||!HEX64.test(String(control.config.McpUrlFileSha256??''))) {
|
|
767
|
+
throw new Error('existing named tunnel v2 requires pinned McpUrlFile before update');
|
|
768
|
+
}
|
|
769
|
+
const pinned=await verifyPinnedRegularFile(control.config.McpUrlFile,control.config.McpUrlFileSha256,'existing named tunnel MCP URL file');
|
|
770
|
+
control.config.McpUrlFile=pinned.path;
|
|
771
|
+
control.config.McpUrlFileSha256=pinned.sha256;
|
|
772
|
+
}
|
|
773
|
+
workspace=await workspacePlan(control.workspaceRoot,state);
|
|
774
|
+
launchers=await launcherPlan(state);
|
|
775
|
+
const generation=await createGenerationBundle({stateRoot:state,releaseRoot:slot.release_root,developmentRoot:development,
|
|
776
|
+
workspaceRoot:workspace.target,releaseId:slot.release_id,currentConfig:control.config,codingPolicy:control.codingPolicy,
|
|
777
|
+
autonomousPolicy:control.autonomousPolicy,hostPolicy:control.hostPolicy,processPolicy:control.processPolicy});
|
|
778
|
+
newPointer={schema:'deadbyte.active-release.v1',release_id:slot.release_id,version:expectedVersion,manifest_sha256:expectedManifest,
|
|
779
|
+
release_root:slot.release_root,generation_root:generation.generation_root,generation_manifest_sha256:generation.generation_manifest_sha256,
|
|
780
|
+
launcher_sha256:launchers.launcher_sha256,config_path:generation.config_path};
|
|
781
|
+
parseActivePointer(JSON.stringify(newPointer));
|
|
782
|
+
await writeState(statePath,journal,'candidate_prepared',{prior_pointer:publicPointer(pointerInfo.pointer),stage:stageVerified,
|
|
783
|
+
development:developmentVerified,release_slot:slot,generation:{generation_id:generation.generation_id,generation_root:generation.generation_root,
|
|
784
|
+
generation_manifest_sha256:generation.generation_manifest_sha256,files:generation.files},workspace:{source:workspace.source,target:workspace.target,mode:workspace.mode},
|
|
785
|
+
stable_mcp_path:{path:stableMcp.path,sha256:stableMcp.sha256},
|
|
786
|
+
stable_mcp_url:stableMcpUrl?{path:stableMcpUrl.path,sha256:stableMcpUrl.sha256,origin:stableMcpUrl.origin,changed:stableMcpUrl.changed}:null,
|
|
787
|
+
bridge:{working_directory:control.config.Bridge.WorkingDirectory,script_path:control.config.Bridge.ScriptPath,script_sha256:control.config.Bridge.ScriptSha256},
|
|
788
|
+
host_repin:{requested:hostCommandPins.length>0,repinned:authorityPreparation.hostRepinned},
|
|
789
|
+
coding_repin:{requested:hostCommandPins.length>0,repinned:authorityPreparation.codingRepinned},new_pointer:publicPointer(newPointer)});
|
|
790
|
+
predecessor=await capturePredecessor(control.ctx,recoverOfflinePredecessor); oldRuntime=predecessor.runtime; priorStatus=predecessor.status;
|
|
791
|
+
await writeState(statePath,journal,'old_runtime_verified',{predecessor_mode:predecessor.mode,old_runtime:generationTuple(oldRuntime),
|
|
792
|
+
prior_authority:{coding_armed:priorStatus.coding_armed,autonomous_armed:priorStatus.autonomous_armed,host_armed:priorStatus.host_armed}});
|
|
793
|
+
const revoke=await revokeAuthority(control.ctx,priorStatus); revoked=revoke.revoked;
|
|
794
|
+
await writeState(statePath,journal,'authority_revoked',{revoked_before_switch:revoked});
|
|
795
|
+
if(oldRuntime){
|
|
796
|
+
const stoppedResult=await stopAndVerify(control.ctx,oldRuntime); stopped=true;
|
|
797
|
+
await writeState(statePath,journal,'old_runtime_stopped',{stop_output:stoppedResult.output});
|
|
798
|
+
} else {
|
|
799
|
+
await writeState(statePath,journal,'old_runtime_stopped',{stop_output:'predecessor already OFFLINE; recovery mode performed no stop'});
|
|
800
|
+
}
|
|
801
|
+
await applyWorkspacePlan(workspace);
|
|
802
|
+
await writeState(statePath,journal,'workspace_ready',{workspace:{source:workspace.source,target:workspace.target,mode:workspace.mode,moved:workspace.moved===true,created:workspace.created===true}});
|
|
803
|
+
await installLaunchers(launchers);
|
|
804
|
+
await writeState(statePath,journal,'launcher_installed',{launcher_sha256:launchers.launcher_sha256,launcher_path:launchers.ps1,top_launcher:launchers.top});
|
|
805
|
+
await atomicWriteActivePointer(pointerInfo.file,newPointer); pointerCommitted=true;
|
|
806
|
+
await writeState(statePath,journal,'pointer_committed',{active_pointer:publicPointer(newPointer)});
|
|
807
|
+
await verifyActiveInstallation(state,newPointer);
|
|
808
|
+
newCtx=slotContext(state,newPointer);
|
|
809
|
+
const newRuntime=await startAndVerify(newCtx,oldRuntime); newStarted=true;
|
|
810
|
+
const stabilization=await stabilizeRuntime(newCtx,newRuntime);
|
|
811
|
+
await writeState(statePath,journal,'fresh_runtime_verified',{new_runtime:generationTuple(newRuntime),stabilization});
|
|
812
|
+
const finalAuthority=await restoreStandingAuthority(newCtx,priorStatus,restoreStandingGrants);
|
|
813
|
+
await writeState(statePath,journal,'authority_verified',{final_authority:{coding_armed:finalAuthority.coding_armed,
|
|
814
|
+
autonomous_armed:finalAuthority.autonomous_armed,host_armed:finalAuthority.host_armed}});
|
|
815
|
+
const body={schema:UPDATE_SCHEMA,update_id:updateId,release_version:expectedVersion,candidate_manifest_sha256:expectedManifest,
|
|
816
|
+
completed_at_utc:new Date().toISOString(),activation_boundary:'active-release-pointer',mechanism:'immutable-release-slot-plus-atomic-pointer-rename',
|
|
817
|
+
predecessor_mode:predecessor.mode,prior_pointer:publicPointer(pointerInfo.pointer),active_pointer:publicPointer(newPointer),release_slot:{release_id:slot.release_id,release_root:slot.release_root,
|
|
818
|
+
adopted:slot.adopted,files:slot.files},generation:{generation_id:generation.generation_id,generation_root:generation.generation_root,
|
|
819
|
+
generation_manifest_sha256:generation.generation_manifest_sha256,adopted:generation.adopted,files:generation.files},
|
|
820
|
+
launcher:{path:launchers.ps1,sha256:launchers.launcher_sha256,top_path:launchers.top},workspace:{root:workspace.target,migrated:workspace.moved===true},
|
|
821
|
+
development_root:development,
|
|
822
|
+
host_repin:{requested:hostCommandPins.length>0,repinned:authorityPreparation.hostRepinned},
|
|
823
|
+
coding_repin:{requested:hostCommandPins.length>0,repinned:authorityPreparation.codingRepinned},old_runtime:generationTuple(oldRuntime),new_runtime:generationTuple(newRuntime),stabilization,
|
|
824
|
+
authority:{prior:{coding_armed:priorStatus.coding_armed,
|
|
825
|
+
autonomous_armed:priorStatus.autonomous_armed,host_armed:priorStatus.host_armed},revoked_before_switch:revoked,restore_requested:restoreStandingGrants,
|
|
826
|
+
final:{coding_armed:finalAuthority.coding_armed,autonomous_armed:finalAuthority.autonomous_armed,host_armed:finalAuthority.host_armed}},rollback_performed:false};
|
|
827
|
+
const receipt=await writeEnvelope(receiptPath,body,key);
|
|
828
|
+
await writeState(statePath,journal,'completed',{receipt_path:receiptPath,receipt_sha256:receipt.receipt_sha256});
|
|
829
|
+
return {ok:true,update_id:updateId,state_path:statePath,receipt_path:receiptPath,receipt_sha256:receipt.receipt_sha256,
|
|
830
|
+
pointer:newPointer,new_runtime:newRuntime,final_authority:finalAuthority,workspace_root:workspace.target};
|
|
831
|
+
} catch(error){
|
|
832
|
+
const rollback={attempted:false,new_runtime_stopped:false,pointer_restored:false,launchers_restored:false,workspace_restored:false,
|
|
833
|
+
mcp_url_restored:false,old_runtime_restarted:false,authority_restored:false,errors:[]};
|
|
834
|
+
try {
|
|
835
|
+
if(pointerCommitted&&newCtx){
|
|
836
|
+
rollback.attempted=true;
|
|
837
|
+
try { controllerCaptured(newCtx,'stop',30000); rollback.new_runtime_stopped=true; }
|
|
838
|
+
catch(stopError){ rollback.errors.push(`stop-new:${stopError.message}`); }
|
|
839
|
+
}
|
|
840
|
+
if(pointerCommitted&&pointerInfo){
|
|
841
|
+
try { await restoreFile(pointerInfo.file,pointerInfo.snapshot); rollback.pointer_restored=true; }
|
|
842
|
+
catch(pointerError){ rollback.errors.push(`pointer:${pointerError.message}`); }
|
|
843
|
+
}
|
|
844
|
+
if(stableMcpUrl?.changed&&mcpUrlSnapshot){
|
|
845
|
+
rollback.attempted=true;
|
|
846
|
+
try { await restoreFile(stableMcpUrl.path,mcpUrlSnapshot); rollback.mcp_url_restored=true; }
|
|
847
|
+
catch(mcpUrlError){ rollback.errors.push(`mcp-url:${mcpUrlError.message}`); }
|
|
848
|
+
}
|
|
849
|
+
if(launchers?.installed){
|
|
850
|
+
try { await rollbackLaunchers(launchers); rollback.launchers_restored=true; }
|
|
851
|
+
catch(launcherError){ rollback.errors.push(`launcher:${launcherError.message}`); }
|
|
852
|
+
}
|
|
853
|
+
if(workspace){
|
|
854
|
+
try { rollback.workspace_restored=await rollbackWorkspacePlan(workspace); }
|
|
855
|
+
catch(workspaceError){ rollback.errors.push(`workspace:${workspaceError.message}`); }
|
|
856
|
+
}
|
|
857
|
+
if(stopped&&control?.ctx){
|
|
858
|
+
try { await startAndVerify(control.ctx,oldRuntime); rollback.old_runtime_restarted=true; }
|
|
859
|
+
catch(startError){ rollback.errors.push(`restart-old:${startError.message}`); }
|
|
860
|
+
}
|
|
861
|
+
const predecessorReadyForAuthorityRestore=!stopped||rollback.old_runtime_restarted;
|
|
862
|
+
if(predecessorReadyForAuthorityRestore&&priorStatus&&restoreStandingGrants){
|
|
863
|
+
try { await restoreStandingAuthority(control.ctx,priorStatus,true); rollback.authority_restored=true; }
|
|
864
|
+
catch(authorityError){ rollback.errors.push(`restore-authority:${authorityError.message}`); }
|
|
865
|
+
}
|
|
866
|
+
} catch(rollbackError){ rollback.errors.push(`rollback:${rollbackError.message}`); }
|
|
867
|
+
const failure={schema:FAILURE_SCHEMA,update_id:updateId,release_version:expectedVersion,candidate_manifest_sha256:expectedManifest,
|
|
868
|
+
failed_at_utc:new Date().toISOString(),phase:journal.phase??'unknown',error:{name:error?.name??'Error',code:error?.code??null,message:String(error?.message??error)},
|
|
869
|
+
predecessor_mode:predecessor?.mode??null,prior_pointer:publicPointer(pointerInfo?.pointer??null),attempted_pointer:publicPointer(newPointer),old_runtime:generationTuple(oldRuntime),rollback};
|
|
870
|
+
await writeState(statePath,journal,'failed',{failure,rollback}).catch(()=>{});
|
|
871
|
+
let failureReceipt=null;
|
|
872
|
+
try { failureReceipt=await writeEnvelope(failurePath,failure,key); await writeState(statePath,journal,'failed_receipted',{failure_receipt_path:failurePath,failure_receipt_sha256:failureReceipt.receipt_sha256}); }
|
|
873
|
+
catch(receiptError){ rollback.errors.push(`failure-receipt:${receiptError.message}`); await writeState(statePath,journal,'failed_unreceipted',{rollback}).catch(()=>{}); }
|
|
874
|
+
const wrapped=new Error(`R27 slot update failed: ${error?.message??error}`); wrapped.cause=error; wrapped.statePath=statePath;
|
|
875
|
+
wrapped.failureReceiptPath=failureReceipt?failurePath:null; throw wrapped;
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
export async function performSlotRollback({activationReceipt,stateRoot=DEFAULT_STATE_ROOT}){
|
|
880
|
+
if(process.platform!=='win32') throw new Error('R31 slot rollback is Windows-only');
|
|
881
|
+
const state=path.resolve(stateRoot),receiptFile=path.resolve(activationReceipt);
|
|
882
|
+
const key=await loadUpdateKey(state);
|
|
883
|
+
const activationEnvelope=await readJson(receiptFile);
|
|
884
|
+
if(!verifySlotUpdateEnvelope(activationEnvelope,key.publicKey)) throw new Error('activation receipt signature invalid');
|
|
885
|
+
if(activationEnvelope.body?.schema!==UPDATE_SCHEMA||activationEnvelope.body?.rollback_performed!==false) throw new Error('activation receipt is not one successful slot activation');
|
|
886
|
+
const priorPointer=parseActivePointer(JSON.stringify(activationEnvelope.body.prior_pointer));
|
|
887
|
+
const activePointer=parseActivePointer(JSON.stringify(activationEnvelope.body.active_pointer));
|
|
888
|
+
const pointerInfo=await loadPointerIfPresent(state);
|
|
889
|
+
if(!pointerInfo.pointer||canonicalJson(publicPointer(pointerInfo.pointer))!==canonicalJson(publicPointer(activePointer))) throw new Error('rollback current pointer does not match signed activation pointer');
|
|
890
|
+
await verifyActiveInstallation(state,priorPointer);
|
|
891
|
+
const currentCtx=slotContext(state,pointerInfo.pointer),currentRuntime=await captureRuntime(currentCtx);
|
|
892
|
+
if(/Process plane\s*:\s*ARMED/.test(currentRuntime.status_text)) controllerCaptured(currentCtx,'disarmprocess',15000);
|
|
893
|
+
const revoked=await revokeAuthority(currentCtx,currentRuntime.status);
|
|
894
|
+
const authorityText=controllerCaptured(currentCtx,'status',15000);
|
|
895
|
+
if(/Process plane\s*:\s*ARMED/.test(authorityText)) throw new Error('process standing authority revoke gate failed');
|
|
896
|
+
const rollbackId=`r31-rollback-${activationEnvelope.receipt_sha256.slice(0,16)}-${Date.now().toString(36)}-${randomBytes(4).toString('hex')}`;
|
|
897
|
+
const evidenceDir=path.join(state,'evidence','updates',rollbackId),statePath=path.join(evidenceDir,'state.json'),receiptPath=path.join(evidenceDir,'receipt.json');
|
|
898
|
+
await mkdir(evidenceDir,{recursive:true});
|
|
899
|
+
const journal={schema:'deadbyte.r31-slot-rollback-state.v1',rollback_id:rollbackId,activation_receipt:path.resolve(receiptFile),
|
|
900
|
+
activation_receipt_sha256:activationEnvelope.receipt_sha256,from_pointer:publicPointer(activePointer),to_pointer:publicPointer(priorPointer),created_at_utc:new Date().toISOString()};
|
|
901
|
+
await writeState(statePath,journal,'verified');
|
|
902
|
+
let stopped=false,pointerCommitted=false,priorCtx=null,priorRuntime=null;
|
|
903
|
+
try {
|
|
904
|
+
await stopAndVerify(currentCtx,currentRuntime); stopped=true;
|
|
905
|
+
await writeState(statePath,journal,'successor_stopped');
|
|
906
|
+
await atomicWriteActivePointer(pointerInfo.file,priorPointer); pointerCommitted=true;
|
|
907
|
+
await verifyActiveInstallation(state,priorPointer);
|
|
908
|
+
await writeState(statePath,journal,'prior_pointer_restored',{active_pointer:publicPointer(priorPointer)});
|
|
909
|
+
priorCtx=slotContext(state,priorPointer);
|
|
910
|
+
priorRuntime=await startAndVerify(priorCtx,currentRuntime);
|
|
911
|
+
const stabilization=await stabilizeRuntime(priorCtx,priorRuntime);
|
|
912
|
+
const finalStatus=parseControllerStatus(controllerCaptured(priorCtx,'status',15000));
|
|
913
|
+
if(finalStatus.coding_armed||finalStatus.autonomous_armed||finalStatus.host_armed) throw new Error('rollback predecessor authority must remain disarmed');
|
|
914
|
+
const body={schema:ROLLBACK_SCHEMA,rollback_id:rollbackId,activation_receipt_sha256:activationEnvelope.receipt_sha256,
|
|
915
|
+
completed_at_utc:new Date().toISOString(),from_pointer:publicPointer(activePointer),active_pointer:publicPointer(priorPointer),
|
|
916
|
+
old_runtime:generationTuple(currentRuntime),new_runtime:generationTuple(priorRuntime),stabilization,authority_revoked:revoked.revoked,rollback_performed:true};
|
|
917
|
+
const receipt=await writeEnvelope(receiptPath,body,key);
|
|
918
|
+
await writeState(statePath,journal,'completed',{receipt_path:receiptPath,receipt_sha256:receipt.receipt_sha256});
|
|
919
|
+
return {ok:true,rollback_id:rollbackId,state_path:statePath,receipt_path:receiptPath,receipt_sha256:receipt.receipt_sha256,pointer:priorPointer,new_runtime:priorRuntime};
|
|
920
|
+
} catch(error){
|
|
921
|
+
const recovery={attempted:false,prior_runtime_stopped:false,successor_pointer_restored:false,successor_runtime_restarted:false,errors:[]};
|
|
922
|
+
if(stopped){
|
|
923
|
+
recovery.attempted=true;
|
|
924
|
+
if(pointerCommitted&&priorCtx){ try { controllerCaptured(priorCtx,'stop',30000); recovery.prior_runtime_stopped=true; } catch(recoveryError){ recovery.errors.push(`stop-prior:${recoveryError.message}`); } }
|
|
925
|
+
if(pointerCommitted){ try { await atomicWriteActivePointer(pointerInfo.file,activePointer); await verifyActiveInstallation(state,activePointer); recovery.successor_pointer_restored=true; } catch(recoveryError){ recovery.errors.push(`restore-pointer:${recoveryError.message}`); } }
|
|
926
|
+
try { await startAndVerify(currentCtx,currentRuntime); recovery.successor_runtime_restarted=true; } catch(recoveryError){ recovery.errors.push(`restart-successor:${recoveryError.message}`); }
|
|
927
|
+
}
|
|
928
|
+
await writeState(statePath,journal,'failed',{error:{name:error?.name??'Error',message:String(error?.message??error)},recovery}).catch(()=>{});
|
|
929
|
+
const wrapped=new Error(`R31 slot rollback failed: ${error?.message??error}`); wrapped.cause=error; wrapped.statePath=statePath; throw wrapped;
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
export async function runSlotUpdateCli(argv=process.argv.slice(2),{stateRoot=DEFAULT_STATE_ROOT}={}){
|
|
934
|
+
if(argv.includes('--rollback-receipt')){
|
|
935
|
+
const args=parseRollbackArgs(argv);
|
|
936
|
+
const result=await performSlotRollback({activationReceipt:args.activationReceipt,stateRoot});
|
|
937
|
+
console.log('R31_SLOT_ROLLBACK_PASS');
|
|
938
|
+
console.log(`ROLLBACK_ID ${result.rollback_id}`); console.log(`RECEIPT_SHA256 ${result.receipt_sha256}`);
|
|
939
|
+
console.log(`STATE_PATH ${result.state_path}`); console.log(`ACTIVE_RELEASE ${result.pointer.release_id}`);
|
|
940
|
+
return result;
|
|
941
|
+
}
|
|
942
|
+
const args=parseUpdateArgs(argv);
|
|
943
|
+
const result=await performSlotUpdate({stage:args.stage,developmentRoot:args.developmentRoot,expectedVersion:args.expectedVersion,
|
|
944
|
+
expectedManifest:args.expectedManifest,sourceRoot:args.sourceRoot,stateRoot,restoreStandingGrants:args.restoreStandingGrants,recoverOfflinePredecessor:args.recoverOfflinePredecessor,
|
|
945
|
+
cloudTransport:args.cloudTransport,bridgeBootstrap:args.bridgeBootstrap,processPolicyBootstrap:args.processPolicyBootstrap,enableMachineFs:args.enableMachineFs,
|
|
946
|
+
enableObservation:args.enableObservation,hostCommandPins:args.hostCommandPins});
|
|
947
|
+
console.log(`R27_SLOT_UPDATE_PASS version=${args.expectedVersion}`);
|
|
948
|
+
console.log(`UPDATE_ID ${result.update_id}`); console.log(`RECEIPT_SHA256 ${result.receipt_sha256}`);
|
|
949
|
+
console.log(`STATE_PATH ${result.state_path}`); console.log(`ACTIVE_RELEASE ${result.pointer.release_id}`);
|
|
950
|
+
return result;
|
|
951
|
+
}
|
|
952
|
+
const invoked=process.argv[1]&&path.resolve(process.argv[1])===path.resolve(fileURLToPath(import.meta.url));
|
|
953
|
+
if(invoked){
|
|
954
|
+
try { await runSlotUpdateCli(); }
|
|
955
|
+
catch(error){
|
|
956
|
+
console.error(`R27_SLOT_UPDATE_FAIL ${error?.message??error}`);
|
|
957
|
+
if(error?.statePath) console.error(`STATE_PATH ${error.statePath}`);
|
|
958
|
+
if(error?.failureReceiptPath) console.error(`FAILURE_RECEIPT_PATH ${error.failureReceiptPath}`);
|
|
959
|
+
process.exitCode=1;
|
|
960
|
+
}
|
|
961
|
+
}
|