@e4779/pi-fabric 0.117.2-fork.31 → 0.131.4-fork.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -6
- package/THIRD_PARTY_NOTICES.md +6 -14
- package/dist/activity/store.d.ts +2 -1
- package/dist/activity/store.d.ts.map +1 -1
- package/dist/actors/binding-store.d.ts +13 -0
- package/dist/actors/binding-store.d.ts.map +1 -1
- package/dist/actors/directory.d.ts.map +1 -1
- package/dist/actors/feedback.d.ts +5 -0
- package/dist/actors/feedback.d.ts.map +1 -0
- package/dist/actors/global-registry.d.ts +8 -0
- package/dist/actors/global-registry.d.ts.map +1 -1
- package/dist/actors/host-event-payload.d.ts +14 -0
- package/dist/actors/host-event-payload.d.ts.map +1 -1
- package/dist/actors/manager.d.ts +4 -3
- package/dist/actors/manager.d.ts.map +1 -1
- package/dist/actors/mesh-monitor.d.ts +2 -0
- package/dist/actors/mesh-monitor.d.ts.map +1 -1
- package/dist/actors/name-policy.d.ts +3 -0
- package/dist/actors/name-policy.d.ts.map +1 -0
- package/dist/actors/registry-store.d.ts +14 -5
- package/dist/actors/registry-store.d.ts.map +1 -1
- package/dist/actors/store-read.d.ts +16 -0
- package/dist/actors/store-read.d.ts.map +1 -0
- package/dist/agents/agent-files.d.ts +80 -0
- package/dist/agents/agent-files.d.ts.map +1 -0
- package/dist/agents/agent-files.js +327 -0
- package/dist/agents/agent-files.js.map +7 -0
- package/dist/agents/child-skills.d.ts +60 -0
- package/dist/agents/child-skills.d.ts.map +1 -0
- package/dist/agents/child-skills.js +94 -0
- package/dist/agents/child-skills.js.map +7 -0
- package/dist/agents/clone-first-worktree.d.ts +6 -0
- package/dist/agents/clone-first-worktree.d.ts.map +1 -1
- package/dist/agents/completion-inbox.d.ts.map +1 -1
- package/dist/agents/cow-clone.d.ts.map +1 -1
- package/dist/agents/handoff.d.ts +12 -2
- package/dist/agents/handoff.d.ts.map +1 -1
- package/dist/agents/herdr-status.d.ts +26 -0
- package/dist/agents/herdr-status.d.ts.map +1 -0
- package/dist/agents/herdr-status.js +161 -0
- package/dist/agents/herdr-status.js.map +7 -0
- package/dist/agents/hosted-run.d.ts +20 -4
- package/dist/agents/hosted-run.d.ts.map +1 -1
- package/dist/agents/manager.d.ts +18 -2
- package/dist/agents/manager.d.ts.map +1 -1
- package/dist/agents/model-pin-guard.d.ts +27 -0
- package/dist/agents/model-pin-guard.d.ts.map +1 -0
- package/dist/agents/model-pin-guard.js +86 -0
- package/dist/agents/model-pin-guard.js.map +7 -0
- package/dist/agents/model-pin.d.ts +25 -0
- package/dist/agents/model-pin.d.ts.map +1 -0
- package/dist/agents/provider-bridge.d.ts +7 -6
- package/dist/agents/provider-bridge.d.ts.map +1 -1
- package/dist/agents/provider-bridge.js +33 -5
- package/dist/agents/provider-bridge.js.map +3 -3
- package/dist/agents/request.d.ts.map +1 -1
- package/dist/agents/result.d.ts.map +1 -1
- package/dist/agents/result.js +1 -1
- package/dist/agents/runner-notice.d.ts.map +1 -1
- package/dist/agents/runner-protocol.d.ts +8 -0
- package/dist/agents/runner-protocol.d.ts.map +1 -1
- package/dist/agents/service-schema.d.ts.map +1 -1
- package/dist/agents/transports/herdr-core-socket.d.ts +13 -0
- package/dist/agents/transports/herdr-core-socket.d.ts.map +1 -0
- package/dist/agents/transports/herdr-core-transport.d.ts +10 -0
- package/dist/agents/transports/herdr-core-transport.d.ts.map +1 -0
- package/dist/agents/transports/herdr-socket.d.ts +12 -0
- package/dist/agents/transports/herdr-socket.d.ts.map +1 -0
- package/dist/agents/transports/herdr-transport.d.ts.map +1 -1
- package/dist/agents/types.d.ts +51 -0
- package/dist/agents/types.d.ts.map +1 -1
- package/dist/agents/worker-recovery.d.ts +75 -0
- package/dist/agents/worker-recovery.d.ts.map +1 -0
- package/dist/agents/worktree-manager.d.ts.map +1 -1
- package/dist/agents.js +12 -11
- package/dist/agents.js.map +2 -2
- package/dist/audit/details.d.ts +38 -1
- package/dist/audit/details.d.ts.map +1 -1
- package/dist/audit/projection.d.ts.map +1 -1
- package/dist/audit/trace-schema.d.ts +50 -0
- package/dist/audit/trace-schema.d.ts.map +1 -0
- package/dist/audit/trace.d.ts +2 -48
- package/dist/audit/trace.d.ts.map +1 -1
- package/dist/chunks/chunk-2RWNVCFD.js +483 -0
- package/dist/chunks/chunk-2RWNVCFD.js.map +7 -0
- package/dist/chunks/chunk-2SCMGO2Z.js +16 -0
- package/dist/chunks/chunk-2SCMGO2Z.js.map +7 -0
- package/dist/chunks/chunk-35EEGOH3.js +324 -0
- package/dist/chunks/chunk-35EEGOH3.js.map +7 -0
- package/dist/chunks/{chunk-UTOBAZ5T.js → chunk-37NIOSVU.js} +1 -1
- package/dist/chunks/chunk-37NIOSVU.js.map +7 -0
- package/dist/chunks/chunk-3IJEQBFS.js +25 -0
- package/dist/chunks/chunk-3IJEQBFS.js.map +7 -0
- package/dist/chunks/{chunk-EHQQ4KCX.js → chunk-3MOY6WIB.js} +84 -19
- package/dist/chunks/chunk-3MOY6WIB.js.map +7 -0
- package/dist/chunks/chunk-3VK6UGAN.js +64 -0
- package/dist/chunks/chunk-3VK6UGAN.js.map +7 -0
- package/dist/chunks/{chunk-ROTCDDOV.js → chunk-3XT5WHSG.js} +59 -119
- package/dist/chunks/chunk-3XT5WHSG.js.map +7 -0
- package/dist/chunks/{chunk-FIDUHKMM.js → chunk-4BYS4ZLY.js} +16 -16
- package/dist/chunks/chunk-4BYS4ZLY.js.map +7 -0
- package/dist/chunks/{chunk-UOM37PE4.js → chunk-4PBW54I2.js} +162 -92
- package/dist/chunks/chunk-4PBW54I2.js.map +7 -0
- package/dist/chunks/{chunk-ZEXCKK4K.js → chunk-4WKD3YM3.js} +3 -3
- package/dist/chunks/{chunk-PK4NIJEV.js → chunk-4XMXFHAR.js} +62 -3
- package/dist/chunks/chunk-4XMXFHAR.js.map +7 -0
- package/dist/chunks/{chunk-4EW7GVUR.js → chunk-56NMRVTV.js} +589 -377
- package/dist/chunks/chunk-56NMRVTV.js.map +7 -0
- package/dist/chunks/chunk-5QJFDKPN.js +179 -0
- package/dist/chunks/chunk-5QJFDKPN.js.map +7 -0
- package/dist/chunks/{chunk-P7CBPPHY.js → chunk-6GWDGTHC.js} +5 -5
- package/dist/chunks/{chunk-P7CBPPHY.js.map → chunk-6GWDGTHC.js.map} +1 -1
- package/dist/chunks/chunk-6HO2IUQ5.js +104 -0
- package/dist/chunks/chunk-6HO2IUQ5.js.map +7 -0
- package/dist/chunks/chunk-6OGYPHNQ.js +62 -0
- package/dist/chunks/chunk-6OGYPHNQ.js.map +7 -0
- package/dist/chunks/{chunk-G4TLWHRS.js → chunk-7N7IC3Z2.js} +4 -3
- package/dist/chunks/{chunk-G4TLWHRS.js.map → chunk-7N7IC3Z2.js.map} +2 -2
- package/dist/chunks/{chunk-5XBYFSI5.js → chunk-7YNE4NB2.js} +2 -2
- package/dist/chunks/chunk-ASOJYFKU.js +1316 -0
- package/dist/chunks/chunk-ASOJYFKU.js.map +7 -0
- package/dist/chunks/{chunk-NTC2MCB6.js → chunk-B5L3X3ID.js} +1 -1
- package/dist/chunks/{chunk-NTC2MCB6.js.map → chunk-B5L3X3ID.js.map} +1 -1
- package/dist/chunks/chunk-BIBRWZWQ.js +325 -0
- package/dist/chunks/chunk-BIBRWZWQ.js.map +7 -0
- package/dist/chunks/{chunk-K6QXUGS5.js → chunk-BMAEZNZ5.js} +2 -1
- package/dist/chunks/{chunk-FSB2VIRZ.js → chunk-CBIV747V.js} +14 -3
- package/dist/chunks/chunk-CBIV747V.js.map +7 -0
- package/dist/chunks/{chunk-CCHZXF6K.js → chunk-CXYJJ3HZ.js} +3 -3
- package/dist/chunks/{chunk-R2XQ6AHT.js → chunk-DGERP4VL.js} +22 -10
- package/dist/chunks/chunk-DGERP4VL.js.map +7 -0
- package/dist/chunks/{chunk-C7Z6F3SO.js → chunk-DGUXJSYA.js} +64 -33
- package/dist/chunks/chunk-DGUXJSYA.js.map +7 -0
- package/dist/chunks/chunk-F2LGSRIN.js +38 -0
- package/dist/chunks/chunk-F2LGSRIN.js.map +7 -0
- package/dist/chunks/chunk-F6A6MQ6G.js +609 -0
- package/dist/chunks/chunk-F6A6MQ6G.js.map +7 -0
- package/dist/chunks/{chunk-IR3PIHJM.js → chunk-FK73YJKV.js} +67 -2
- package/dist/chunks/chunk-FK73YJKV.js.map +7 -0
- package/dist/chunks/{chunk-XCEEQ5AB.js → chunk-G2DZJ5LK.js} +1607 -1567
- package/dist/chunks/chunk-G2DZJ5LK.js.map +7 -0
- package/dist/chunks/{chunk-VYQV5JRT.js → chunk-GJVKEHDL.js} +2 -2
- package/dist/chunks/chunk-GJVKEHDL.js.map +7 -0
- package/dist/chunks/{chunk-TIIIHPHF.js → chunk-GS67KDMV.js} +2 -2
- package/dist/chunks/{chunk-D5NYNIST.js → chunk-H57KPL3V.js} +5 -5
- package/dist/chunks/{chunk-KVYNGDGC.js → chunk-HFDJWLMS.js} +6 -6
- package/dist/chunks/{chunk-KVYNGDGC.js.map → chunk-HFDJWLMS.js.map} +1 -1
- package/dist/chunks/{chunk-INRXG4J5.js → chunk-HGD75NZY.js} +2 -2
- package/dist/chunks/{chunk-CRRUW26I.js → chunk-HRDMBGMY.js} +12 -12
- package/dist/chunks/{chunk-CRRUW26I.js.map → chunk-HRDMBGMY.js.map} +2 -2
- package/dist/chunks/{chunk-GO32KSEZ.js → chunk-HRVYXRWZ.js} +85 -10
- package/dist/chunks/chunk-HRVYXRWZ.js.map +7 -0
- package/dist/chunks/{chunk-MLLYR3Y6.js → chunk-HSEZPCL5.js} +19 -78
- package/dist/chunks/chunk-HSEZPCL5.js.map +7 -0
- package/dist/chunks/chunk-JMUUNW2H.js +65 -0
- package/dist/chunks/chunk-JMUUNW2H.js.map +7 -0
- package/dist/chunks/{chunk-UXIBKMUM.js → chunk-KIFOEBYJ.js} +4 -4
- package/dist/chunks/{chunk-3FJUP3GV.js → chunk-L6H46CPY.js} +2 -2
- package/dist/chunks/{chunk-SPCJXN4K.js → chunk-LKYLD5SN.js} +298 -65
- package/dist/chunks/chunk-LKYLD5SN.js.map +7 -0
- package/dist/chunks/{chunk-K7J2ABAZ.js → chunk-LRSZFYUC.js} +92 -32
- package/dist/chunks/chunk-LRSZFYUC.js.map +7 -0
- package/dist/chunks/{chunk-GIK2WNAK.js → chunk-LZ2ZXOCU.js} +112 -23
- package/dist/chunks/chunk-LZ2ZXOCU.js.map +7 -0
- package/dist/chunks/{chunk-FUY6XVRX.js → chunk-MPMEK3IQ.js} +2 -2
- package/dist/chunks/{chunk-HP5P7NBO.js → chunk-MSDL7U6Q.js} +4 -4
- package/dist/chunks/{chunk-ASSLHWZS.js → chunk-MX53BRAC.js} +2 -2
- package/dist/chunks/chunk-N7ZAK2PB.js +132 -0
- package/dist/chunks/chunk-N7ZAK2PB.js.map +7 -0
- package/dist/chunks/{chunk-VSDUSNIA.js → chunk-NBIYYMKS.js} +8 -2
- package/dist/chunks/chunk-NBIYYMKS.js.map +7 -0
- package/dist/chunks/chunk-NENQZCGW.js +45 -0
- package/dist/chunks/chunk-NENQZCGW.js.map +7 -0
- package/dist/chunks/chunk-NJHJKINP.js +47 -0
- package/dist/chunks/chunk-NJHJKINP.js.map +7 -0
- package/dist/chunks/{chunk-U366I5K2.js → chunk-NQ7IWEIF.js} +18 -6
- package/dist/chunks/chunk-NQ7IWEIF.js.map +7 -0
- package/dist/chunks/{chunk-ZQMBS5SH.js → chunk-OJ4HAALD.js} +15 -12
- package/dist/chunks/chunk-OJ4HAALD.js.map +7 -0
- package/dist/chunks/chunk-OZCJU3PZ.js +33 -0
- package/dist/chunks/chunk-OZCJU3PZ.js.map +7 -0
- package/dist/chunks/chunk-P3DCXKL3.js +40 -0
- package/dist/chunks/chunk-P3DCXKL3.js.map +7 -0
- package/dist/chunks/chunk-P7YSPKTM.js +294 -0
- package/dist/chunks/chunk-P7YSPKTM.js.map +7 -0
- package/dist/chunks/chunk-PQVUMJ5J.js +223 -0
- package/dist/chunks/chunk-PQVUMJ5J.js.map +7 -0
- package/dist/chunks/chunk-PUBHBEYO.js +84 -0
- package/dist/chunks/chunk-PUBHBEYO.js.map +7 -0
- package/dist/chunks/{chunk-P4KH4S4S.js → chunk-QGTD3LAZ.js} +5 -20
- package/dist/chunks/chunk-QGTD3LAZ.js.map +7 -0
- package/dist/chunks/{chunk-TIJ3YQXX.js → chunk-QOEOKW2X.js} +2 -2
- package/dist/chunks/{chunk-TIJ3YQXX.js.map → chunk-QOEOKW2X.js.map} +1 -1
- package/dist/chunks/{chunk-QT4W5YVB.js → chunk-RAA3FAYZ.js} +2 -2
- package/dist/chunks/{chunk-3UGN25XS.js → chunk-RKJPBTBB.js} +98 -1664
- package/dist/chunks/chunk-RKJPBTBB.js.map +7 -0
- package/dist/chunks/{chunk-WJJXODAB.js → chunk-RLKRZXSX.js} +8 -1
- package/dist/chunks/{chunk-WJJXODAB.js.map → chunk-RLKRZXSX.js.map} +2 -2
- package/dist/chunks/chunk-RWKQ5SRW.js +129 -0
- package/dist/chunks/chunk-RWKQ5SRW.js.map +7 -0
- package/dist/chunks/chunk-SW25R47N.js +71 -0
- package/dist/chunks/chunk-SW25R47N.js.map +7 -0
- package/dist/chunks/{chunk-EKODKR6Y.js → chunk-TEMKDJJY.js} +148 -72
- package/dist/chunks/chunk-TEMKDJJY.js.map +7 -0
- package/dist/chunks/{chunk-EFETPXU2.js → chunk-TJZYM2SP.js} +118 -237
- package/dist/chunks/chunk-TJZYM2SP.js.map +7 -0
- package/dist/chunks/{chunk-53N2I4QA.js → chunk-TXCNZCZP.js} +2 -2
- package/dist/chunks/{chunk-LNASO4VT.js → chunk-U6Y6TKJL.js} +45 -20
- package/dist/chunks/chunk-U6Y6TKJL.js.map +7 -0
- package/dist/chunks/chunk-UD7LFV43.js +28 -0
- package/dist/chunks/chunk-UD7LFV43.js.map +7 -0
- package/dist/chunks/{chunk-7QKKLBHJ.js → chunk-UPMWLOKL.js} +10 -1
- package/dist/chunks/{chunk-7QKKLBHJ.js.map → chunk-UPMWLOKL.js.map} +2 -2
- package/dist/chunks/chunk-V4OW2ULC.js +422 -0
- package/dist/chunks/chunk-V4OW2ULC.js.map +7 -0
- package/dist/chunks/{chunk-FE6NOAO7.js → chunk-VGRUWTMG.js} +1993 -659
- package/dist/chunks/chunk-VGRUWTMG.js.map +7 -0
- package/dist/chunks/{chunk-PYFJW3HC.js → chunk-W5FEHVZA.js} +2 -16
- package/dist/chunks/{chunk-PYFJW3HC.js.map → chunk-W5FEHVZA.js.map} +3 -3
- package/dist/chunks/chunk-WKFRGICG.js +101 -0
- package/dist/chunks/chunk-WKFRGICG.js.map +7 -0
- package/dist/chunks/{chunk-LEU5CDSL.js → chunk-XFOSUGLU.js} +5 -5
- package/dist/chunks/{chunk-MZUC6LLH.js → chunk-XMYG2TKR.js} +4 -4
- package/dist/chunks/{chunk-MZUC6LLH.js.map → chunk-XMYG2TKR.js.map} +1 -1
- package/dist/chunks/chunk-YC65P7ZO.js +57 -0
- package/dist/chunks/chunk-YC65P7ZO.js.map +7 -0
- package/dist/chunks/{chunk-5UBRGTVN.js → chunk-ZHROHNEE.js} +31 -15
- package/dist/chunks/chunk-ZHROHNEE.js.map +7 -0
- package/dist/cli/decisions.d.ts.map +1 -1
- package/dist/cli/decisions.js +15 -3
- package/dist/cli/decisions.js.map +2 -2
- package/dist/cli/mesh.js +4 -3
- package/dist/cli/mesh.js.map +1 -1
- package/dist/commands/fabric-handler.d.ts +7 -0
- package/dist/commands/fabric-handler.d.ts.map +1 -0
- package/dist/commands/fabric-handler.js +916 -0
- package/dist/commands/fabric-handler.js.map +7 -0
- package/dist/commands/fabric.d.ts +11 -1
- package/dist/commands/fabric.d.ts.map +1 -1
- package/dist/compaction/claim-events.d.ts +61 -0
- package/dist/compaction/claim-events.d.ts.map +1 -0
- package/dist/compaction/claim-events.js +210 -0
- package/dist/compaction/claim-events.js.map +7 -0
- package/dist/compaction/claim.d.ts +51 -0
- package/dist/compaction/claim.d.ts.map +1 -0
- package/dist/compaction/hook.d.ts +28 -2
- package/dist/compaction/hook.d.ts.map +1 -1
- package/dist/compaction/hook.js +12 -7
- package/dist/compaction/owner.js +9 -8
- package/dist/compaction/trace-events.d.ts +1 -1
- package/dist/compaction/trace-events.d.ts.map +1 -1
- package/dist/components/configuration.js +6 -6
- package/dist/components/effect-scope.d.ts.map +1 -1
- package/dist/config.d.ts +40 -3
- package/dist/config.d.ts.map +1 -1
- package/dist/core/action-arguments.d.ts.map +1 -1
- package/dist/core/action-policy-hooks.d.ts +69 -0
- package/dist/core/action-policy-hooks.d.ts.map +1 -0
- package/dist/core/action-registry.d.ts +31 -10
- package/dist/core/action-registry.d.ts.map +1 -1
- package/dist/core/action-registry.js +12 -9
- package/dist/core/approval-controller.d.ts +23 -3
- package/dist/core/approval-controller.d.ts.map +1 -1
- package/dist/core/atomic-write.d.ts +164 -0
- package/dist/core/atomic-write.d.ts.map +1 -1
- package/dist/core/call-presentation.d.ts +14 -0
- package/dist/core/call-presentation.d.ts.map +1 -0
- package/dist/core/child-tool-allowlist.d.ts +17 -1
- package/dist/core/child-tool-allowlist.d.ts.map +1 -1
- package/dist/core/compact-controller.d.ts +34 -0
- package/dist/core/compact-controller.d.ts.map +1 -1
- package/dist/core/core-override-guidance.d.ts +3 -1
- package/dist/core/core-override-guidance.d.ts.map +1 -1
- package/dist/core/file-lock.d.ts.map +1 -1
- package/dist/core/foreground-tools.d.ts +4 -1
- package/dist/core/foreground-tools.d.ts.map +1 -1
- package/dist/core/host-policy.d.ts +43 -0
- package/dist/core/host-policy.d.ts.map +1 -0
- package/dist/core/host-sdk-runtime.d.ts.map +1 -1
- package/dist/core/host-sdk.d.ts.map +1 -1
- package/dist/core/host-sdk.js +1 -1
- package/dist/core/managed-host-guidance.d.ts +5 -0
- package/dist/core/managed-host-guidance.d.ts.map +1 -0
- package/dist/core/model-aliases.d.ts +22 -0
- package/dist/core/model-aliases.d.ts.map +1 -0
- package/dist/core/model-resolution.d.ts +41 -20
- package/dist/core/model-resolution.d.ts.map +1 -1
- package/dist/core/native-tool-result.d.ts +1 -0
- package/dist/core/native-tool-result.d.ts.map +1 -1
- package/dist/core/program-tasks.d.ts +52 -0
- package/dist/core/program-tasks.d.ts.map +1 -0
- package/dist/core/prompt-guidance.d.ts +5 -0
- package/dist/core/prompt-guidance.d.ts.map +1 -0
- package/dist/core/prompt-guidance.js +159 -0
- package/dist/core/prompt-guidance.js.map +7 -0
- package/dist/core/provider-operations.d.ts.map +1 -1
- package/dist/core/provider-operations.js +60 -108
- package/dist/core/provider-operations.js.map +3 -3
- package/dist/core/shell-inbox.d.ts.map +1 -1
- package/dist/core/shell-jobs.d.ts +7 -5
- package/dist/core/shell-jobs.d.ts.map +1 -1
- package/dist/core/shell-timing.d.ts.map +1 -1
- package/dist/core/skill-prompt.d.ts +1 -1
- package/dist/core/skill-prompt.d.ts.map +1 -1
- package/dist/core/skill-references.d.ts +1 -1
- package/dist/core/skill-references.d.ts.map +1 -1
- package/dist/core/system-guidance.d.ts.map +1 -1
- package/dist/core/tool-result-proxy.d.ts.map +1 -1
- package/dist/decisions/command.d.ts +2 -1
- package/dist/decisions/command.d.ts.map +1 -1
- package/dist/decisions/command.js +40 -12
- package/dist/decisions/command.js.map +2 -2
- package/dist/decisions/events.d.ts +12 -0
- package/dist/decisions/events.d.ts.map +1 -0
- package/dist/decisions/events.js +130 -0
- package/dist/decisions/events.js.map +7 -0
- package/dist/decisions/host.d.ts +31 -3
- package/dist/decisions/host.d.ts.map +1 -1
- package/dist/decisions/render.d.ts +44 -0
- package/dist/decisions/render.d.ts.map +1 -0
- package/dist/decisions/store.d.ts +8 -0
- package/dist/decisions/store.d.ts.map +1 -1
- package/dist/durable/agent.d.ts +8 -0
- package/dist/durable/agent.d.ts.map +1 -1
- package/dist/durable/extension-load-error.d.ts +8 -0
- package/dist/durable/extension-load-error.d.ts.map +1 -0
- package/dist/durable/session.d.ts +1 -0
- package/dist/durable/session.d.ts.map +1 -1
- package/dist/durable/worker-host.d.ts +10 -1
- package/dist/durable/worker-host.d.ts.map +1 -1
- package/dist/durable/worker-host.js +10 -1181
- package/dist/durable/worker-host.js.map +4 -4
- package/dist/durable/worker-options.d.ts +3 -0
- package/dist/durable/worker-options.d.ts.map +1 -1
- package/dist/durable/worker-role-seed.d.ts +82 -0
- package/dist/durable/worker-role-seed.d.ts.map +1 -0
- package/dist/durable/worker.js +43 -4
- package/dist/durable/worker.js.map +2 -2
- package/dist/durable-controls.d.ts.map +1 -1
- package/dist/durable-extension-wasm.d.ts +8 -0
- package/dist/durable-extension-wasm.d.ts.map +1 -0
- package/dist/durable-extension-wasm.js +32 -0
- package/dist/durable-extension-wasm.js.map +7 -0
- package/dist/durable-extension.d.ts +94 -0
- package/dist/durable-extension.d.ts.map +1 -0
- package/dist/durable-extension.js +649 -0
- package/dist/durable-extension.js.map +7 -0
- package/dist/durable-host.d.ts +8 -0
- package/dist/durable-host.d.ts.map +1 -0
- package/dist/durable-host.js +20 -0
- package/dist/durable-host.js.map +7 -0
- package/dist/durable-journal.d.ts +94 -0
- package/dist/durable-journal.d.ts.map +1 -0
- package/dist/durable.d.ts.map +1 -1
- package/dist/durable.js +13 -10
- package/dist/durable.js.map +2 -2
- package/dist/entropy/index.js +12 -10
- package/dist/entropy/pool-store.d.ts.map +1 -1
- package/dist/execution-service.d.ts +14 -0
- package/dist/execution-service.d.ts.map +1 -1
- package/dist/extension-bootstrap.d.ts.map +1 -1
- package/dist/extension-bootstrap.js +28 -27
- package/dist/extension-bootstrap.js.map +2 -2
- package/dist/extension-copy.d.ts +21 -0
- package/dist/extension-copy.d.ts.map +1 -0
- package/dist/extension-copy.js +90 -0
- package/dist/extension-copy.js.map +7 -0
- package/dist/extension.d.ts +1 -1
- package/dist/extension.d.ts.map +1 -1
- package/dist/fabric-exec-arguments.d.ts.map +1 -1
- package/dist/fabric-exec-tool.d.ts +2 -1
- package/dist/fabric-exec-tool.d.ts.map +1 -1
- package/dist/fabric-runtime-state.d.ts +19 -0
- package/dist/fabric-runtime-state.d.ts.map +1 -1
- package/dist/fabric-runtime-state.js +2205 -839
- package/dist/fabric-runtime-state.js.map +4 -4
- package/dist/fabric-state.d.ts +44 -1
- package/dist/fabric-state.d.ts.map +1 -1
- package/dist/feedback.d.ts +5 -0
- package/dist/feedback.d.ts.map +1 -0
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +88 -53
- package/dist/index.js.map +2 -2
- package/dist/jev/client.js +2 -2
- package/dist/jev/manager.d.ts +3 -0
- package/dist/jev/manager.d.ts.map +1 -1
- package/dist/jev/observation.d.ts +1 -1
- package/dist/jev/observation.js +6 -6
- package/dist/jev-fabric/bridge.d.ts.map +1 -1
- package/dist/jev.js +11 -12
- package/dist/main-agent.d.ts +2 -1
- package/dist/main-agent.d.ts.map +1 -1
- package/dist/managed-host.d.ts +13 -0
- package/dist/managed-host.d.ts.map +1 -1
- package/dist/memory/digest.js +2 -2
- package/dist/memory/discovery.js +6 -7
- package/dist/memory/file-worker.js +10 -11
- package/dist/memory/file-worker.js.map +1 -1
- package/dist/memory/normalize.js +5 -6
- package/dist/memory/search.js +7 -8
- package/dist/memory/worker-provider.js +11 -12
- package/dist/memory.js +11 -12
- package/dist/memory.js.map +1 -1
- package/dist/mesh/grants.d.ts +3 -3
- package/dist/mesh/grants.d.ts.map +1 -1
- package/dist/mesh/store.d.ts +8 -0
- package/dist/mesh/store.d.ts.map +1 -1
- package/dist/native-codemode.d.ts.map +1 -1
- package/dist/native-tool-catalog.d.ts.map +1 -1
- package/dist/native-tool-catalog.js +12 -3
- package/dist/native-tool-catalog.js.map +2 -2
- package/dist/programs/host.d.ts +18 -6
- package/dist/programs/host.d.ts.map +1 -1
- package/dist/programs/host.js +71 -47
- package/dist/programs/host.js.map +2 -2
- package/dist/programs/source.d.ts +11 -0
- package/dist/programs/source.d.ts.map +1 -1
- package/dist/programs/store.d.ts.map +1 -1
- package/dist/protocol.d.ts +504 -8
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +41 -11
- package/dist/provider-globals.d.ts +13 -0
- package/dist/provider-globals.d.ts.map +1 -0
- package/dist/providers/agents-actions.d.ts.map +1 -1
- package/dist/providers/agents-provider.d.ts +3 -0
- package/dist/providers/agents-provider.d.ts.map +1 -1
- package/dist/providers/captured-tools-provider.d.ts +5 -0
- package/dist/providers/captured-tools-provider.d.ts.map +1 -1
- package/dist/providers/compact-provider.d.ts +4 -1
- package/dist/providers/compact-provider.d.ts.map +1 -1
- package/dist/providers/components-provider.d.ts.map +1 -1
- package/dist/providers/decisions-provider.d.ts +9 -1
- package/dist/providers/decisions-provider.d.ts.map +1 -1
- package/dist/providers/jev-provider.d.ts +1 -1
- package/dist/providers/jev-provider.js +11 -12
- package/dist/providers/memory-provider.js +10 -11
- package/dist/providers/pi-tools-provider.d.ts +14 -0
- package/dist/providers/pi-tools-provider.d.ts.map +1 -1
- package/dist/providers/programs-provider.d.ts.map +1 -1
- package/dist/providers/sessions-provider.d.ts +7 -0
- package/dist/providers/sessions-provider.d.ts.map +1 -1
- package/dist/repeat-guard.d.ts +7 -6
- package/dist/repeat-guard.d.ts.map +1 -1
- package/dist/residency/actor-client.js +3 -3
- package/dist/residency/client.d.ts +15 -0
- package/dist/residency/client.d.ts.map +1 -1
- package/dist/residency/host.d.ts.map +1 -1
- package/dist/residency/host.js +34 -23
- package/dist/residency/launcher.js +1 -1
- package/dist/residency/pi-entry.js +34 -23
- package/dist/residency/pi-entry.js.map +1 -1
- package/dist/residency/protocol.d.ts +2 -0
- package/dist/residency/protocol.d.ts.map +1 -1
- package/dist/runners.js +11 -1
- package/dist/runners.js.map +2 -2
- package/dist/runtime/core-override-guest-types.js +2 -2
- package/dist/runtime/cpython-child-source.d.ts.map +1 -1
- package/dist/runtime/cpython-runtime.d.ts.map +1 -1
- package/dist/runtime/cpython-runtime.js +51 -21
- package/dist/runtime/cpython-runtime.js.map +2 -2
- package/dist/runtime/deadline-pause.d.ts +2 -0
- package/dist/runtime/deadline-pause.d.ts.map +1 -1
- package/dist/runtime/dynamic-guest-types.d.ts.map +1 -1
- package/dist/runtime/dynamic-guest-types.js +2 -1
- package/dist/runtime/exec-journal.d.ts +73 -0
- package/dist/runtime/exec-journal.d.ts.map +1 -0
- package/dist/runtime/exec-journal.js +335 -0
- package/dist/runtime/exec-journal.js.map +7 -0
- package/dist/runtime/guest-types.d.ts +3 -2
- package/dist/runtime/guest-types.d.ts.map +1 -1
- package/dist/runtime/guest-types.js +1 -1
- package/dist/runtime/journal-shim.d.ts +3 -0
- package/dist/runtime/journal-shim.d.ts.map +1 -0
- package/dist/runtime/kernel.d.ts +95 -1
- package/dist/runtime/kernel.d.ts.map +1 -1
- package/dist/runtime/monty-bridge.d.ts +6 -2
- package/dist/runtime/monty-bridge.d.ts.map +1 -1
- package/dist/runtime/monty-runtime.d.ts.map +1 -1
- package/dist/runtime/monty-runtime.js +27 -15
- package/dist/runtime/monty-runtime.js.map +2 -2
- package/dist/runtime/native-codemode-guest.d.ts.map +1 -1
- package/dist/runtime/node-process-runtime.d.ts.map +1 -1
- package/dist/runtime/node-process-runtime.js +7 -5
- package/dist/runtime/quickjs-runtime.d.ts +7 -1
- package/dist/runtime/quickjs-runtime.d.ts.map +1 -1
- package/dist/runtime/quickjs-runtime.js +5 -4
- package/dist/runtime/sha256.d.ts +4 -0
- package/dist/runtime/sha256.d.ts.map +1 -0
- package/dist/runtime/transpile.d.ts +8 -0
- package/dist/runtime/transpile.d.ts.map +1 -0
- package/dist/runtime/type-checker.d.ts +1 -7
- package/dist/runtime/type-checker.d.ts.map +1 -1
- package/dist/runtime/type-checker.js +4 -2
- package/dist/runtime/typescript-kernel.js +13 -10
- package/dist/runtime/typescript-kernel.js.map +1 -1
- package/dist/runtime-state-builtins.d.ts.map +1 -1
- package/dist/speculation/scanner.js +1 -1
- package/dist/speculation/store.d.ts +7 -16
- package/dist/speculation/store.d.ts.map +1 -1
- package/dist/speculation/types.d.ts +1 -0
- package/dist/speculation/types.d.ts.map +1 -1
- package/dist/storage/retention.d.ts.map +1 -1
- package/dist/topology/participant-directory.d.ts +26 -1
- package/dist/topology/participant-directory.d.ts.map +1 -1
- package/dist/topology/peer-presence.d.ts.map +1 -1
- package/dist/topology/peer-settle.js +11 -0
- package/dist/topology/peer-settle.js.map +7 -0
- package/dist/topology/session-label-settings.d.ts +13 -0
- package/dist/topology/session-label-settings.d.ts.map +1 -0
- package/dist/topology/session-label.d.ts +60 -0
- package/dist/topology/session-label.d.ts.map +1 -0
- package/dist/topology/types.d.ts +27 -0
- package/dist/topology/types.d.ts.map +1 -1
- package/dist/type-error-guidance.js +1 -1
- package/dist/ui/controller.d.ts +1 -0
- package/dist/ui/controller.d.ts.map +1 -1
- package/dist/ui/conversation-chrome.d.ts.map +1 -1
- package/dist/ui/conversation-chrome.js +3 -2
- package/dist/ui/conversation-commands.d.ts +1 -1
- package/dist/ui/conversation-commands.d.ts.map +1 -1
- package/dist/ui/conversation-native-reader.js +2 -2
- package/dist/ui/conversation-selection.d.ts +4 -1
- package/dist/ui/conversation-selection.d.ts.map +1 -1
- package/dist/ui/conversation-targets.d.ts.map +1 -1
- package/dist/ui/conversation-targets.js +2 -2
- package/dist/ui/conversation.d.ts +25 -24
- package/dist/ui/conversation.d.ts.map +1 -1
- package/dist/ui/conversation.js +170 -339
- package/dist/ui/conversation.js.map +2 -2
- package/dist/ui/core-tool-render.d.ts +1 -0
- package/dist/ui/core-tool-render.d.ts.map +1 -1
- package/dist/ui/dashboard-model.d.ts.map +1 -1
- package/dist/ui/dashboard.d.ts.map +1 -1
- package/dist/ui/dashboard.js +23 -16
- package/dist/ui/dashboard.js.map +2 -2
- package/dist/ui/fabric-render.d.ts +7 -0
- package/dist/ui/fabric-render.d.ts.map +1 -1
- package/dist/ui/footer-dock.d.ts +48 -0
- package/dist/ui/footer-dock.d.ts.map +1 -0
- package/dist/ui/format.d.ts +7 -0
- package/dist/ui/format.d.ts.map +1 -1
- package/dist/ui/settings-sections-lifecycle.d.ts.map +1 -1
- package/dist/ui/settings-sections-presentation.d.ts.map +1 -1
- package/dist/ui/settings-values.d.ts +2 -1
- package/dist/ui/settings-values.d.ts.map +1 -1
- package/dist/ui/settings.js +60 -19
- package/dist/ui/settings.js.map +2 -2
- package/dist/ui/shell-hang-keys.d.ts +8 -1
- package/dist/ui/shell-hang-keys.d.ts.map +1 -1
- package/dist/ui/shell-tasks.d.ts +2 -2
- package/dist/ui/shell-tasks.d.ts.map +1 -1
- package/dist/ui/shell-tasks.js +27 -94
- package/dist/ui/shell-tasks.js.map +2 -2
- package/dist/ui/snapshot.d.ts.map +1 -1
- package/dist/ui/terminal-title.d.ts +41 -0
- package/dist/ui/terminal-title.d.ts.map +1 -0
- package/dist/ui/types.d.ts +4 -0
- package/dist/ui/types.d.ts.map +1 -1
- package/dist/ui/widget-keys.d.ts +5 -0
- package/dist/ui/widget-keys.d.ts.map +1 -0
- package/dist/ui/widget.d.ts +40 -18
- package/dist/ui/widget.d.ts.map +1 -1
- package/dist/ui/word-diff/line-emphasis.js +1603 -0
- package/dist/ui/word-diff/line-emphasis.js.map +7 -0
- package/dist/util.d.ts +2 -0
- package/dist/util.d.ts.map +1 -1
- package/dist/verified/authority.d.ts +2 -2
- package/dist/verified/authority.d.ts.map +1 -1
- package/dist/verified/budget.d.ts +4 -0
- package/dist/verified/budget.d.ts.map +1 -0
- package/dist/verified/generated/actor-name.d.ts +4 -0
- package/dist/verified/generated/actor-name.js +17 -0
- package/dist/verified/generated/authority.d.ts +4 -0
- package/dist/verified/generated/authority.js +28 -0
- package/dist/verified/generated/budget.d.ts +4 -0
- package/dist/verified/generated/budget.js +17 -0
- package/dist/verified/generated/compaction.d.ts +4 -0
- package/dist/verified/generated/compaction.js +19 -0
- package/dist/verified/generated/grants.d.ts +4 -0
- package/dist/verified/generated/grants.js +17 -0
- package/dist/verified/generated/lifecycle.d.ts +4 -0
- package/dist/verified/generated/lifecycle.js +50 -0
- package/dist/verified/generated/manifest.json +137 -48
- package/dist/verified/generated/policy.d.ts +17 -0
- package/dist/verified/generated/policy.js +211 -0
- package/dist/verified/generated/provider.d.ts +4 -0
- package/dist/verified/generated/provider.js +18 -0
- package/dist/verified/generated/resources.d.ts +6 -0
- package/dist/verified/generated/resources.js +73 -0
- package/dist/verified/generated/speculation.d.ts +6 -0
- package/dist/verified/generated/speculation.js +48 -0
- package/dist/verified/generated/storage.d.ts +4 -0
- package/dist/verified/generated/storage.js +18 -0
- package/dist/verified/grants.d.ts +22 -0
- package/dist/verified/grants.d.ts.map +1 -0
- package/dist/verified/lifecycle.d.ts +31 -0
- package/dist/verified/lifecycle.d.ts.map +1 -0
- package/dist/verified/machine.d.ts +18 -0
- package/dist/verified/machine.d.ts.map +1 -0
- package/dist/verified/memory.d.ts +1 -1
- package/dist/verified/memory.d.ts.map +1 -1
- package/dist/verified/nat.d.ts +1 -1
- package/dist/verified/nat.d.ts.map +1 -1
- package/dist/verified/policy.d.ts +17 -5
- package/dist/verified/policy.d.ts.map +1 -1
- package/dist/verified/provider.d.ts +22 -0
- package/dist/verified/provider.d.ts.map +1 -0
- package/dist/verified/resources.d.ts +21 -7
- package/dist/verified/resources.d.ts.map +1 -1
- package/dist/verified/speculation.d.ts +36 -0
- package/dist/verified/speculation.d.ts.map +1 -0
- package/dist/verified/storage.d.ts.map +1 -1
- package/dist/worker/missing-install.d.ts +8 -0
- package/dist/worker/missing-install.d.ts.map +1 -0
- package/dist/worker/options.d.ts.map +1 -1
- package/dist/worker/options.js +25 -0
- package/dist/worker/options.js.map +2 -2
- package/dist/worker/prompt-lifecycle.d.ts +16 -0
- package/dist/worker/prompt-lifecycle.d.ts.map +1 -0
- package/dist/worker/prompt-lifecycle.js +90 -0
- package/dist/worker/prompt-lifecycle.js.map +7 -0
- package/dist/worker/questions.d.ts +15 -3
- package/dist/worker/questions.d.ts.map +1 -1
- package/dist/worker/questions.js +53 -8
- package/dist/worker/questions.js.map +2 -2
- package/dist/worker/recovery-watchdog.d.ts +22 -0
- package/dist/worker/recovery-watchdog.d.ts.map +1 -1
- package/dist/worker/recovery-watchdog.js +116 -1
- package/dist/worker/recovery-watchdog.js.map +2 -2
- package/dist/worker/result.js +1 -1
- package/dist/worker/result.js.map +2 -2
- package/dist/worker.js +131 -21
- package/dist/worker.js.map +2 -2
- package/docs/actor-name-policy-handoff.md +5 -0
- package/docs/agents.md +172 -22
- package/docs/architecture.md +5 -1
- package/docs/audit-trace.md +2 -1
- package/docs/background-tasks.md +126 -28
- package/docs/codemode-parity.md +2 -2
- package/docs/compaction.md +21 -5
- package/docs/components.md +1 -1
- package/docs/configuration.md +113 -66
- package/docs/decisions.md +92 -10
- package/docs/durable-extension.md +121 -0
- package/docs/durable-pi.md +306 -6
- package/docs/extractive-history.md +3 -1
- package/docs/interface.md +22 -17
- package/docs/jev.md +2 -2
- package/docs/kernels.md +1 -1
- package/{node_modules/pi-coralbricks-provider/LICENSE → docs/licenses/gdp-wired-mit.txt} +1 -1
- package/docs/managed-host-migration.md +50 -0
- package/docs/programmatic-compaction.md +216 -6
- package/docs/programs.md +23 -1
- package/docs/prompt-cache.md +4 -2
- package/docs/provider-capabilities.md +15 -14
- package/docs/providers.md +99 -3
- package/docs/shell-composition.md +15 -0
- package/docs/short-lock-protocol.md +90 -0
- package/docs/skills.md +5 -1
- package/docs/speculation.md +6 -0
- package/docs/verified-kernels.md +309 -220
- package/package.json +45 -24
- package/proofs/actor-name.ts +27 -0
- package/proofs/authority.ts +62 -0
- package/proofs/budget.ts +24 -0
- package/proofs/compaction.ts +51 -0
- package/proofs/grants.ts +39 -0
- package/proofs/index.ts +40 -0
- package/proofs/kernel.ts +44 -0
- package/proofs/lifecycle.ts +128 -0
- package/proofs/policy.ts +195 -0
- package/proofs/provider.ts +52 -0
- package/proofs/resources.ts +160 -0
- package/proofs/speculation.ts +69 -0
- package/proofs/storage.ts +66 -0
- package/scripts/verified-kernels.ts +141 -0
- package/skillsets/python/fabric-council/SKILL.md +94 -20
- package/skillsets/python/fabric-exec/SKILL.md +2 -2
- package/skillsets/python/fabric-exec/references/agents.md +10 -4
- package/skillsets/python/fabric-fusion/SKILL.md +1 -1
- package/skillsets/python/fabric-guide/SKILL.md +1 -1
- package/skillsets/typescript/fabric-council/SKILL.md +110 -22
- package/skillsets/typescript/fabric-exec/SKILL.md +7 -7
- package/skillsets/typescript/fabric-exec/references/agents.md +17 -8
- package/skillsets/typescript/fabric-fusion/SKILL.md +1 -1
- package/skillsets/typescript/fabric-guide/SKILL.md +1 -1
- package/LAWS.bend +0 -502
- package/PROOF.bend +0 -452
- package/dist/chunks/chunk-3UGN25XS.js.map +0 -7
- package/dist/chunks/chunk-4EW7GVUR.js.map +0 -7
- package/dist/chunks/chunk-5UBRGTVN.js.map +0 -7
- package/dist/chunks/chunk-BN7F52EG.js +0 -525
- package/dist/chunks/chunk-BN7F52EG.js.map +0 -7
- package/dist/chunks/chunk-C7Z6F3SO.js.map +0 -7
- package/dist/chunks/chunk-DK35W6U7.js +0 -259
- package/dist/chunks/chunk-DK35W6U7.js.map +0 -7
- package/dist/chunks/chunk-EFETPXU2.js.map +0 -7
- package/dist/chunks/chunk-EHQQ4KCX.js.map +0 -7
- package/dist/chunks/chunk-EKODKR6Y.js.map +0 -7
- package/dist/chunks/chunk-FE6NOAO7.js.map +0 -7
- package/dist/chunks/chunk-FIDUHKMM.js.map +0 -7
- package/dist/chunks/chunk-FSB2VIRZ.js.map +0 -7
- package/dist/chunks/chunk-GIK2WNAK.js.map +0 -7
- package/dist/chunks/chunk-GO32KSEZ.js.map +0 -7
- package/dist/chunks/chunk-IR3PIHJM.js.map +0 -7
- package/dist/chunks/chunk-ITVLKXCI.js +0 -266
- package/dist/chunks/chunk-ITVLKXCI.js.map +0 -7
- package/dist/chunks/chunk-K7J2ABAZ.js.map +0 -7
- package/dist/chunks/chunk-KJZAOENY.js +0 -212
- package/dist/chunks/chunk-KJZAOENY.js.map +0 -7
- package/dist/chunks/chunk-LNASO4VT.js.map +0 -7
- package/dist/chunks/chunk-MLLYR3Y6.js.map +0 -7
- package/dist/chunks/chunk-P4KH4S4S.js.map +0 -7
- package/dist/chunks/chunk-PK4NIJEV.js.map +0 -7
- package/dist/chunks/chunk-Q2JQ3RYZ.js +0 -99
- package/dist/chunks/chunk-Q2JQ3RYZ.js.map +0 -7
- package/dist/chunks/chunk-R2XQ6AHT.js.map +0 -7
- package/dist/chunks/chunk-ROTCDDOV.js.map +0 -7
- package/dist/chunks/chunk-SPCJXN4K.js.map +0 -7
- package/dist/chunks/chunk-U366I5K2.js.map +0 -7
- package/dist/chunks/chunk-UKMQK5VP.js +0 -231
- package/dist/chunks/chunk-UKMQK5VP.js.map +0 -7
- package/dist/chunks/chunk-UOM37PE4.js.map +0 -7
- package/dist/chunks/chunk-UTOBAZ5T.js.map +0 -7
- package/dist/chunks/chunk-VSDUSNIA.js.map +0 -7
- package/dist/chunks/chunk-VTK2FEH7.js +0 -229
- package/dist/chunks/chunk-VTK2FEH7.js.map +0 -7
- package/dist/chunks/chunk-VYQV5JRT.js.map +0 -7
- package/dist/chunks/chunk-XCEEQ5AB.js.map +0 -7
- package/dist/chunks/chunk-ZLNJDTCN.js +0 -226
- package/dist/chunks/chunk-ZLNJDTCN.js.map +0 -7
- package/dist/chunks/chunk-ZQMBS5SH.js.map +0 -7
- package/dist/ui/conversation-shortcut.d.ts +0 -3
- package/dist/ui/conversation-shortcut.d.ts.map +0 -1
- package/dist/ui/widget-activity.d.ts +0 -21
- package/dist/ui/widget-activity.d.ts.map +0 -1
- package/dist/verified/generated/authority-kernel.d.ts +0 -10
- package/dist/verified/generated/authority-kernel.js +0 -127
- package/dist/verified/generated/kernel.d.ts +0 -31
- package/dist/verified/generated/kernel.js +0 -389
- package/dist/verified/generated/lifecycle-kernel.d.ts +0 -7
- package/dist/verified/generated/lifecycle-kernel.js +0 -164
- package/dist/verified/generated/provider-kernel.d.ts +0 -9
- package/dist/verified/generated/provider-kernel.js +0 -87
- package/dist/verified/generated/storage-kernel.d.ts +0 -11
- package/dist/verified/generated/storage-kernel.js +0 -107
- package/docs/licenses/bend-apache-2.0.txt +0 -202
- package/node_modules/pi-coralbricks-provider/README.md +0 -306
- package/node_modules/pi-coralbricks-provider/auth.ts +0 -30
- package/node_modules/pi-coralbricks-provider/custom-models.json +0 -1
- package/node_modules/pi-coralbricks-provider/deprecated-models.json +0 -1
- package/node_modules/pi-coralbricks-provider/guard.ts +0 -155
- package/node_modules/pi-coralbricks-provider/index.ts +0 -662
- package/node_modules/pi-coralbricks-provider/models.json +0 -88
- package/node_modules/pi-coralbricks-provider/package.json +0 -74
- package/node_modules/pi-coralbricks-provider/park.ts +0 -122
- package/node_modules/pi-coralbricks-provider/patch.json +0 -34
- package/node_modules/pi-coralbricks-provider/scripts/update-models.js +0 -658
- package/node_modules/pi-coralbricks-provider/settings.ts +0 -143
- package/node_modules/pi-coralbricks-provider/sync-policy.ts +0 -309
- package/proofs/abi.json +0 -308
- package/proofs/authority-abi.json +0 -7
- package/proofs/authority-kernel.bend +0 -23
- package/proofs/authority-proof.bend +0 -74
- package/proofs/authority-spec.bend +0 -30
- package/proofs/authority-state.bend +0 -43
- package/proofs/authority-types.d.ts +0 -3
- package/proofs/kernel.bend +0 -139
- package/proofs/lifecycle-abi.json +0 -3
- package/proofs/lifecycle-kernel.bend +0 -11
- package/proofs/lifecycle-proof.bend +0 -249
- package/proofs/lifecycle-spec.bend +0 -261
- package/proofs/lifecycle-types.d.ts +0 -4
- package/proofs/lifecycle.bend +0 -119
- package/proofs/provider-abi.json +0 -4
- package/proofs/provider-kernel.bend +0 -14
- package/proofs/provider-plans.bend +0 -28
- package/proofs/provider-spec.bend +0 -14
- package/proofs/provider-types.d.ts +0 -5
- package/proofs/resource-proof.bend +0 -633
- package/proofs/resource-spec.bend +0 -133
- package/proofs/resources.bend +0 -160
- package/proofs/state-kernel.bend +0 -17
- package/proofs/state-plans.bend +0 -40
- package/proofs/state-proof.bend +0 -42
- package/proofs/state-spec.bend +0 -26
- package/proofs/storage-abi.json +0 -3
- package/proofs/storage-kernel.bend +0 -11
- package/proofs/storage-plans.bend +0 -100
- package/proofs/storage-proof.bend +0 -176
- package/proofs/storage-spec.bend +0 -70
- package/proofs/storage-types.d.ts +0 -8
- package/proofs/types.d.ts +0 -7
- package/scripts/test-verified-kernels.mjs +0 -107
- package/scripts/verified-kernels.mjs +0 -176
- /package/dist/chunks/{chunk-ZEXCKK4K.js.map → chunk-4WKD3YM3.js.map} +0 -0
- /package/dist/chunks/{chunk-5XBYFSI5.js.map → chunk-7YNE4NB2.js.map} +0 -0
- /package/dist/chunks/{chunk-K6QXUGS5.js.map → chunk-BMAEZNZ5.js.map} +0 -0
- /package/dist/chunks/{chunk-CCHZXF6K.js.map → chunk-CXYJJ3HZ.js.map} +0 -0
- /package/dist/chunks/{chunk-TIIIHPHF.js.map → chunk-GS67KDMV.js.map} +0 -0
- /package/dist/chunks/{chunk-D5NYNIST.js.map → chunk-H57KPL3V.js.map} +0 -0
- /package/dist/chunks/{chunk-INRXG4J5.js.map → chunk-HGD75NZY.js.map} +0 -0
- /package/dist/chunks/{chunk-UXIBKMUM.js.map → chunk-KIFOEBYJ.js.map} +0 -0
- /package/dist/chunks/{chunk-3FJUP3GV.js.map → chunk-L6H46CPY.js.map} +0 -0
- /package/dist/chunks/{chunk-FUY6XVRX.js.map → chunk-MPMEK3IQ.js.map} +0 -0
- /package/dist/chunks/{chunk-HP5P7NBO.js.map → chunk-MSDL7U6Q.js.map} +0 -0
- /package/dist/chunks/{chunk-ASSLHWZS.js.map → chunk-MX53BRAC.js.map} +0 -0
- /package/dist/chunks/{chunk-QT4W5YVB.js.map → chunk-RAA3FAYZ.js.map} +0 -0
- /package/dist/chunks/{chunk-53N2I4QA.js.map → chunk-TXCNZCZP.js.map} +0 -0
- /package/dist/chunks/{chunk-LEU5CDSL.js.map → chunk-XFOSUGLU.js.map} +0 -0
|
@@ -0,0 +1,609 @@
|
|
|
1
|
+
// src/core/atomic-write.ts
|
|
2
|
+
import { randomUUID } from "node:crypto";
|
|
3
|
+
import fs from "node:fs";
|
|
4
|
+
import os from "node:os";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
var RETRYABLE_RENAME_CODES = /* @__PURE__ */ new Set(["EPERM", "EACCES", "EEXIST", "EBUSY"]);
|
|
7
|
+
var errorCode = (error) => typeof error === "object" && error !== null && "code" in error ? String(error.code) : void 0;
|
|
8
|
+
var blockingSleep = (() => {
|
|
9
|
+
try {
|
|
10
|
+
const buffer = new Int32Array(new SharedArrayBuffer(4));
|
|
11
|
+
return (ms) => {
|
|
12
|
+
Atomics.wait(buffer, 0, 0, ms);
|
|
13
|
+
};
|
|
14
|
+
} catch {
|
|
15
|
+
return void 0;
|
|
16
|
+
}
|
|
17
|
+
})();
|
|
18
|
+
var syncSleep = (ms) => blockingSleep?.(ms);
|
|
19
|
+
var renameAtomic = (source, target, options) => {
|
|
20
|
+
const attempts = Math.max(1, options?.renameRetries ?? 8);
|
|
21
|
+
const delay = options?.renameRetryDelayMs ?? 25;
|
|
22
|
+
for (let attempt = 1; attempt <= attempts; attempt++) {
|
|
23
|
+
try {
|
|
24
|
+
fs.renameSync(source, target);
|
|
25
|
+
return;
|
|
26
|
+
} catch (error) {
|
|
27
|
+
const code = errorCode(error);
|
|
28
|
+
if (attempt === attempts || code === void 0 || !RETRYABLE_RENAME_CODES.has(code)) {
|
|
29
|
+
throw error;
|
|
30
|
+
}
|
|
31
|
+
syncSleep(delay * attempt);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
var unsupportedDirectoryFsyncCodes = (platform) => /* @__PURE__ */ new Set(["EINVAL", "ENOTSUP", "EISDIR", ...platform === "win32" ? ["EPERM", "EACCES"] : []]);
|
|
36
|
+
var UNSUPPORTED_DIRECTORY_FSYNC_CODES = unsupportedDirectoryFsyncCodes(process.platform);
|
|
37
|
+
var fsyncDirectory = (directory) => {
|
|
38
|
+
let descriptor;
|
|
39
|
+
try {
|
|
40
|
+
descriptor = fs.openSync(directory, "r");
|
|
41
|
+
fs.fsyncSync(descriptor);
|
|
42
|
+
} catch (error) {
|
|
43
|
+
const code = errorCode(error);
|
|
44
|
+
if (code === void 0 || !UNSUPPORTED_DIRECTORY_FSYNC_CODES.has(code)) throw error;
|
|
45
|
+
} finally {
|
|
46
|
+
if (descriptor !== void 0) fs.closeSync(descriptor);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
var directoryBarriers = (directory, durabilityRoot) => {
|
|
50
|
+
const resolved = path.resolve(directory);
|
|
51
|
+
const boundary = durabilityRoot === void 0 ? path.parse(resolved).root : path.resolve(durabilityRoot);
|
|
52
|
+
const relative = path.relative(boundary, resolved);
|
|
53
|
+
if (relative === ".." || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative)) {
|
|
54
|
+
throw new Error("durabilityRoot must contain the target directory");
|
|
55
|
+
}
|
|
56
|
+
const parents = [];
|
|
57
|
+
for (let current = resolved; ; current = path.dirname(current)) {
|
|
58
|
+
const parent = path.dirname(current);
|
|
59
|
+
if (parents.at(-1) !== parent) parents.push(parent);
|
|
60
|
+
if (path.relative(boundary, current) === "") return parents;
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
var mkdirDurable = (directory, mode, fsync, durabilityRoot) => {
|
|
64
|
+
if (!fsync) {
|
|
65
|
+
fs.mkdirSync(directory, { recursive: true, mode });
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
const parents = directoryBarriers(directory, durabilityRoot);
|
|
69
|
+
if (durabilityRoot !== void 0 && !fs.statSync(parents.at(-1)).isDirectory()) {
|
|
70
|
+
throw new Error("durabilityRoot parent must be an existing durable directory");
|
|
71
|
+
}
|
|
72
|
+
fs.mkdirSync(directory, { recursive: true, mode });
|
|
73
|
+
for (const parent of parents) fsyncDirectory(parent);
|
|
74
|
+
};
|
|
75
|
+
var fsyncDirectoryAsync = async (directory) => {
|
|
76
|
+
let handle;
|
|
77
|
+
try {
|
|
78
|
+
handle = await fs.promises.open(directory, "r");
|
|
79
|
+
await handle.sync();
|
|
80
|
+
} catch (error) {
|
|
81
|
+
const code = errorCode(error);
|
|
82
|
+
if (code === void 0 || !UNSUPPORTED_DIRECTORY_FSYNC_CODES.has(code)) throw error;
|
|
83
|
+
} finally {
|
|
84
|
+
await handle?.close();
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
var mkdirDurableAsync = async (directory, mode, fsync, durabilityRoot) => {
|
|
88
|
+
if (!fsync) {
|
|
89
|
+
await fs.promises.mkdir(directory, { recursive: true, mode });
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
const parents = directoryBarriers(directory, durabilityRoot);
|
|
93
|
+
if (durabilityRoot !== void 0 && !(await fs.promises.stat(parents.at(-1))).isDirectory()) {
|
|
94
|
+
throw new Error("durabilityRoot parent must be an existing durable directory");
|
|
95
|
+
}
|
|
96
|
+
await fs.promises.mkdir(directory, { recursive: true, mode });
|
|
97
|
+
for (const parent of parents) await fsyncDirectoryAsync(parent);
|
|
98
|
+
};
|
|
99
|
+
var writeFileAtomic = (filePath, contents, options) => {
|
|
100
|
+
mkdirDurable(path.dirname(filePath), options?.dirMode ?? 448, options?.fsync === true, options?.durabilityRoot);
|
|
101
|
+
const temporary = `${filePath}.${process.pid}.${randomUUID()}.tmp`;
|
|
102
|
+
try {
|
|
103
|
+
if (options?.fsync) {
|
|
104
|
+
const descriptor = fs.openSync(temporary, "wx", options.mode ?? 384);
|
|
105
|
+
try {
|
|
106
|
+
fs.writeFileSync(descriptor, contents, "utf8");
|
|
107
|
+
fs.fsyncSync(descriptor);
|
|
108
|
+
} finally {
|
|
109
|
+
fs.closeSync(descriptor);
|
|
110
|
+
}
|
|
111
|
+
} else {
|
|
112
|
+
fs.writeFileSync(temporary, contents, {
|
|
113
|
+
encoding: "utf8",
|
|
114
|
+
mode: options?.mode ?? 384
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
renameAtomic(temporary, filePath, options);
|
|
118
|
+
if (options?.fsync) fsyncDirectory(path.dirname(filePath));
|
|
119
|
+
} finally {
|
|
120
|
+
fs.rmSync(temporary, { force: true });
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
var writeJsonAtomic = (filePath, value, options) => {
|
|
124
|
+
const space = options?.space;
|
|
125
|
+
const serialized = JSON.stringify(value, null, space) + (options?.newline === true ? "\n" : "");
|
|
126
|
+
writeFileAtomic(filePath, serialized, options);
|
|
127
|
+
};
|
|
128
|
+
var asyncSleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
129
|
+
var renameAtomicAsync = async (source, target, options) => {
|
|
130
|
+
const attempts = Math.max(1, options?.renameRetries ?? 8);
|
|
131
|
+
const delay = options?.renameRetryDelayMs ?? 25;
|
|
132
|
+
for (let attempt = 1; attempt <= attempts; attempt++) {
|
|
133
|
+
try {
|
|
134
|
+
await fs.promises.rename(source, target);
|
|
135
|
+
return;
|
|
136
|
+
} catch (error) {
|
|
137
|
+
const code = errorCode(error);
|
|
138
|
+
if (attempt === attempts || code === void 0 || !RETRYABLE_RENAME_CODES.has(code)) {
|
|
139
|
+
throw error;
|
|
140
|
+
}
|
|
141
|
+
await asyncSleep(delay * attempt);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
var writeFileAtomicAsync = async (filePath, contents, options) => {
|
|
146
|
+
await mkdirDurableAsync(path.dirname(filePath), options?.dirMode ?? 448, options?.fsync === true, options?.durabilityRoot);
|
|
147
|
+
const temporary = `${filePath}.${process.pid}.${randomUUID()}.tmp`;
|
|
148
|
+
try {
|
|
149
|
+
if (options?.fsync) {
|
|
150
|
+
const handle = await fs.promises.open(temporary, "wx", options.mode ?? 384);
|
|
151
|
+
try {
|
|
152
|
+
await handle.writeFile(contents, "utf8");
|
|
153
|
+
await handle.sync();
|
|
154
|
+
} finally {
|
|
155
|
+
await handle.close();
|
|
156
|
+
}
|
|
157
|
+
} else {
|
|
158
|
+
await fs.promises.writeFile(temporary, contents, {
|
|
159
|
+
encoding: "utf8",
|
|
160
|
+
mode: options?.mode ?? 384
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
await renameAtomicAsync(temporary, filePath, options);
|
|
164
|
+
if (options?.fsync) await fsyncDirectoryAsync(path.dirname(filePath));
|
|
165
|
+
} finally {
|
|
166
|
+
await fs.promises.rm(temporary, { force: true });
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
var writeJsonAtomicAsync = async (filePath, value, options) => {
|
|
170
|
+
const space = options?.space;
|
|
171
|
+
const serialized = JSON.stringify(value, null, space) + (options?.newline === true ? "\n" : "");
|
|
172
|
+
await writeFileAtomicAsync(filePath, serialized, options);
|
|
173
|
+
};
|
|
174
|
+
var OWNER_HEARTBEAT_INTERVAL_MS = 1e4;
|
|
175
|
+
var OWNER_HEARTBEAT_TTL_MS = 45e3;
|
|
176
|
+
var SHORT_LOCK_MAX_HOLD_MS = 10 * 6e4;
|
|
177
|
+
var PID_START_TOLERANCE_MS = 2e3;
|
|
178
|
+
var CLOCK_TICKS_PER_SECOND = 100;
|
|
179
|
+
var MAX_IDENTITY_JSON_CHARS = 1024;
|
|
180
|
+
var readTrimmed = (file) => {
|
|
181
|
+
try {
|
|
182
|
+
const value = fs.readFileSync(file, "utf8").trim();
|
|
183
|
+
return value === "" ? void 0 : value;
|
|
184
|
+
} catch {
|
|
185
|
+
return void 0;
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
var bootTimeSeconds = null;
|
|
189
|
+
var readBootTimeSeconds = () => {
|
|
190
|
+
if (bootTimeSeconds !== null) return bootTimeSeconds;
|
|
191
|
+
const line = readTrimmed("/proc/stat")?.split("\n").find((entry) => entry.startsWith("btime "));
|
|
192
|
+
const value = Number(line?.slice("btime ".length).trim());
|
|
193
|
+
bootTimeSeconds = Number.isSafeInteger(value) && value > 0 ? value : void 0;
|
|
194
|
+
return bootTimeSeconds;
|
|
195
|
+
};
|
|
196
|
+
var parseProcStartedAt = (stat, bootSeconds) => {
|
|
197
|
+
const fields = stat.slice(stat.lastIndexOf(")") + 2).split(" ");
|
|
198
|
+
const ticks = Number(fields[19]);
|
|
199
|
+
if (!Number.isSafeInteger(ticks) || ticks < 0) return void 0;
|
|
200
|
+
return bootSeconds * 1e3 + Math.round(ticks * 1e3 / CLOCK_TICKS_PER_SECOND);
|
|
201
|
+
};
|
|
202
|
+
var procStartedAt = (pid) => {
|
|
203
|
+
if (process.platform !== "linux") return void 0;
|
|
204
|
+
const boot = readBootTimeSeconds();
|
|
205
|
+
const stat = readTrimmed(`/proc/${pid}/stat`);
|
|
206
|
+
return boot === void 0 || stat === void 0 ? void 0 : parseProcStartedAt(stat, boot);
|
|
207
|
+
};
|
|
208
|
+
var signalProbe = (pid) => {
|
|
209
|
+
if (!Number.isSafeInteger(pid) || pid <= 0) return "dead";
|
|
210
|
+
try {
|
|
211
|
+
process.kill(pid, 0);
|
|
212
|
+
return "alive";
|
|
213
|
+
} catch (error) {
|
|
214
|
+
const code = errorCode(error);
|
|
215
|
+
if (code === "ESRCH") return "dead";
|
|
216
|
+
return code === "EPERM" ? "alive" : "unknown";
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
var cachedIdentity;
|
|
220
|
+
var currentOwnerIdentity = () => {
|
|
221
|
+
if (cachedIdentity) return { ...cachedIdentity };
|
|
222
|
+
let pidNamespace;
|
|
223
|
+
let bootId;
|
|
224
|
+
let startedAt;
|
|
225
|
+
if (process.platform === "linux") {
|
|
226
|
+
try {
|
|
227
|
+
pidNamespace = fs.readlinkSync("/proc/self/ns/pid");
|
|
228
|
+
} catch {
|
|
229
|
+
pidNamespace = void 0;
|
|
230
|
+
}
|
|
231
|
+
bootId = readTrimmed("/proc/sys/kernel/random/boot_id");
|
|
232
|
+
if (bootId !== void 0) startedAt = procStartedAt("self");
|
|
233
|
+
if (startedAt === void 0) bootId = void 0;
|
|
234
|
+
}
|
|
235
|
+
cachedIdentity = {
|
|
236
|
+
pid: process.pid,
|
|
237
|
+
hostname: os.hostname(),
|
|
238
|
+
...pidNamespace === void 0 ? {} : { pidNamespace },
|
|
239
|
+
...bootId === void 0 ? {} : { bootId },
|
|
240
|
+
startedAt: startedAt ?? Math.round(performance.timeOrigin)
|
|
241
|
+
};
|
|
242
|
+
return { ...cachedIdentity };
|
|
243
|
+
};
|
|
244
|
+
var boundedString = (value, max) => typeof value === "string" && value.length > 0 && value.length <= max;
|
|
245
|
+
var ownerIdentityFields = (value) => {
|
|
246
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) return void 0;
|
|
247
|
+
const record = value;
|
|
248
|
+
if (!boundedString(record.hostname, 255)) return void 0;
|
|
249
|
+
if (record.pidNamespace !== void 0 && !boundedString(record.pidNamespace, 128)) return void 0;
|
|
250
|
+
if (record.bootId !== void 0 && !boundedString(record.bootId, 128)) return void 0;
|
|
251
|
+
if (typeof record.startedAt !== "number" || !Number.isFinite(record.startedAt)) return void 0;
|
|
252
|
+
return {
|
|
253
|
+
hostname: record.hostname,
|
|
254
|
+
...record.pidNamespace === void 0 ? {} : { pidNamespace: record.pidNamespace },
|
|
255
|
+
...record.bootId === void 0 ? {} : { bootId: record.bootId },
|
|
256
|
+
startedAt: record.startedAt
|
|
257
|
+
};
|
|
258
|
+
};
|
|
259
|
+
var encodeOwnerIdentityLine = () => {
|
|
260
|
+
const { pid: _pid, ...identity } = currentOwnerIdentity();
|
|
261
|
+
return JSON.stringify(identity);
|
|
262
|
+
};
|
|
263
|
+
var decodeOwnerIdentityLine = (line) => {
|
|
264
|
+
if (!line || line.length > MAX_IDENTITY_JSON_CHARS || !line.startsWith("{")) return void 0;
|
|
265
|
+
try {
|
|
266
|
+
return ownerIdentityFields(JSON.parse(line));
|
|
267
|
+
} catch {
|
|
268
|
+
return void 0;
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
var heartbeatField = (value) => typeof value === "object" && value !== null && typeof value.heartbeatAt === "number" && Number.isFinite(value.heartbeatAt) ? value.heartbeatAt : void 0;
|
|
272
|
+
var ownerHeartbeatFields = (now = Date.now()) => {
|
|
273
|
+
const { pid: _pid, ...identity } = currentOwnerIdentity();
|
|
274
|
+
return { identity, heartbeatAt: now };
|
|
275
|
+
};
|
|
276
|
+
var recordOwnerLiveness = (record, options = {}) => {
|
|
277
|
+
if (typeof record !== "object" || record === null) return "dead";
|
|
278
|
+
const { pid, identity: rawIdentity } = record;
|
|
279
|
+
if (typeof pid !== "number") return "dead";
|
|
280
|
+
const identity = ownerIdentityFields(rawIdentity);
|
|
281
|
+
const heartbeatAt = heartbeatField(record);
|
|
282
|
+
return ownerLiveness(identity ? { ...identity, pid } : { pid }, {
|
|
283
|
+
...options,
|
|
284
|
+
...heartbeatAt === void 0 ? {} : { heartbeatAt }
|
|
285
|
+
});
|
|
286
|
+
};
|
|
287
|
+
var ownerLiveness = (record, options = {}) => {
|
|
288
|
+
const probes = options.probes ?? {};
|
|
289
|
+
const signal = probes.signal ?? signalProbe;
|
|
290
|
+
if (typeof record.hostname !== "string") {
|
|
291
|
+
return options.legacyAlive ? options.legacyAlive(record.pid) ? "alive" : "dead" : signal(record.pid);
|
|
292
|
+
}
|
|
293
|
+
const self = (probes.self ?? currentOwnerIdentity)();
|
|
294
|
+
const sameHost = record.hostname === self.hostname;
|
|
295
|
+
if (sameHost && record.pidNamespace === self.pidNamespace && record.bootId === self.bootId) {
|
|
296
|
+
const answer = signal(record.pid);
|
|
297
|
+
if (answer !== "alive") return answer;
|
|
298
|
+
if (record.bootId !== void 0 && record.startedAt !== void 0) {
|
|
299
|
+
const actual = (probes.processStartedAt ?? procStartedAt)(record.pid);
|
|
300
|
+
if (actual !== void 0 && Math.abs(actual - record.startedAt) > PID_START_TOLERANCE_MS) {
|
|
301
|
+
return "dead";
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
return "alive";
|
|
305
|
+
}
|
|
306
|
+
if (options.heartbeatAt !== void 0) {
|
|
307
|
+
const now = (probes.now ?? Date.now)();
|
|
308
|
+
return now - options.heartbeatAt <= (options.heartbeatTtlMs ?? OWNER_HEARTBEAT_TTL_MS) ? "alive" : "dead";
|
|
309
|
+
}
|
|
310
|
+
if (sameHost && record.bootId !== void 0 && self.bootId !== void 0 && record.bootId !== self.bootId) return "dead";
|
|
311
|
+
return "unknown";
|
|
312
|
+
};
|
|
313
|
+
var lockOwnerLiveness = (pid, createdAt, identityLine, options = {}) => {
|
|
314
|
+
const identity = decodeOwnerIdentityLine(identityLine);
|
|
315
|
+
return ownerLiveness(identity ? { ...identity, pid } : { pid }, {
|
|
316
|
+
...options,
|
|
317
|
+
...Number.isFinite(createdAt) ? { heartbeatAt: createdAt } : {},
|
|
318
|
+
heartbeatTtlMs: options.maxHoldMs ?? SHORT_LOCK_MAX_HOLD_MS
|
|
319
|
+
});
|
|
320
|
+
};
|
|
321
|
+
var lockOwnerProvablyDead = (pid, identityLine, options = {}) => {
|
|
322
|
+
if (!Number.isSafeInteger(pid) || pid <= 0) return false;
|
|
323
|
+
const identity = decodeOwnerIdentityLine(identityLine);
|
|
324
|
+
if (!identity) return false;
|
|
325
|
+
const self = (options.probes?.self ?? currentOwnerIdentity)();
|
|
326
|
+
if (identity.hostname !== self.hostname || identity.pidNamespace !== self.pidNamespace || identity.bootId !== self.bootId) return false;
|
|
327
|
+
return ownerLiveness(
|
|
328
|
+
{ ...identity, pid },
|
|
329
|
+
options.probes === void 0 ? {} : { probes: options.probes }
|
|
330
|
+
) === "dead";
|
|
331
|
+
};
|
|
332
|
+
var CLAIM_INFIX = ".reap-";
|
|
333
|
+
var SHORT_LOCK_RELEASE_RETRY_MS = 25;
|
|
334
|
+
var CLAIM_SWEEP_INTERVAL_MS = 1e3;
|
|
335
|
+
var RELEASE_SPIN_ATTEMPT_CAP = 1e4;
|
|
336
|
+
var DIGITS = /^\d+$/;
|
|
337
|
+
var formatShortLockOwner = (token) => `${token}
|
|
338
|
+
${process.pid}
|
|
339
|
+
${Date.now()}
|
|
340
|
+
${encodeOwnerIdentityLine()}
|
|
341
|
+
`;
|
|
342
|
+
var parseShortLockOwner = (text) => {
|
|
343
|
+
const [token = "", pidText = "", createdText = "", identityLine] = text.split("\n").map((line) => line.trim());
|
|
344
|
+
const pid = DIGITS.test(pidText) ? Number(pidText) : Number.NaN;
|
|
345
|
+
const createdAt = DIGITS.test(createdText) ? Number(createdText) : Number.NaN;
|
|
346
|
+
return {
|
|
347
|
+
token,
|
|
348
|
+
...Number.isSafeInteger(pid) && pid > 0 ? { pid } : {},
|
|
349
|
+
...Number.isSafeInteger(createdAt) ? { createdAt } : {},
|
|
350
|
+
...identityLine ? { identityLine } : {}
|
|
351
|
+
};
|
|
352
|
+
};
|
|
353
|
+
var shortLockReapable = (ownerText, lockModifiedAt, options) => {
|
|
354
|
+
const now = (options.probes?.now ?? Date.now)();
|
|
355
|
+
const owner = parseShortLockOwner(ownerText ?? "");
|
|
356
|
+
const since = owner.createdAt !== void 0 && owner.createdAt <= now ? owner.createdAt : lockModifiedAt;
|
|
357
|
+
if (since === void 0) return false;
|
|
358
|
+
const age = now - since;
|
|
359
|
+
if (owner.pid === void 0) return age > options.staleMs;
|
|
360
|
+
if (age <= options.staleMs) {
|
|
361
|
+
return lockOwnerProvablyDead(
|
|
362
|
+
owner.pid,
|
|
363
|
+
owner.identityLine,
|
|
364
|
+
options.probes === void 0 ? {} : { probes: options.probes }
|
|
365
|
+
);
|
|
366
|
+
}
|
|
367
|
+
const ceiling = Math.max(SHORT_LOCK_MAX_HOLD_MS, options.staleMs);
|
|
368
|
+
if (age > ceiling) return true;
|
|
369
|
+
return lockOwnerLiveness(owner.pid, since, owner.identityLine, {
|
|
370
|
+
...options.legacyAlive === void 0 ? {} : { legacyAlive: options.legacyAlive },
|
|
371
|
+
...options.probes === void 0 ? {} : { probes: options.probes },
|
|
372
|
+
maxHoldMs: ceiling
|
|
373
|
+
}) === "dead";
|
|
374
|
+
};
|
|
375
|
+
var readOwnerText = (directory) => {
|
|
376
|
+
try {
|
|
377
|
+
return fs.readFileSync(path.join(directory, "owner"), "utf8");
|
|
378
|
+
} catch {
|
|
379
|
+
return void 0;
|
|
380
|
+
}
|
|
381
|
+
};
|
|
382
|
+
var modifiedAt = (directory) => {
|
|
383
|
+
try {
|
|
384
|
+
return fs.statSync(directory).mtimeMs;
|
|
385
|
+
} catch {
|
|
386
|
+
return void 0;
|
|
387
|
+
}
|
|
388
|
+
};
|
|
389
|
+
var ownerToken = (directory) => readOwnerText(directory)?.split("\n", 1)[0];
|
|
390
|
+
var lockInode = (directory) => {
|
|
391
|
+
try {
|
|
392
|
+
const { dev, ino } = fs.lstatSync(directory, { bigint: true });
|
|
393
|
+
return { dev, ino };
|
|
394
|
+
} catch {
|
|
395
|
+
return void 0;
|
|
396
|
+
}
|
|
397
|
+
};
|
|
398
|
+
var sameInode = (left, right) => left.dev === right.dev && left.ino === right.ino;
|
|
399
|
+
var LINK_UNSUPPORTED_CODES = /* @__PURE__ */ new Set(["EPERM", "ENOTSUP", "EXDEV", "ENOSYS"]);
|
|
400
|
+
var publishShortLockOwner = (temporary, ownerPath) => {
|
|
401
|
+
try {
|
|
402
|
+
fs.linkSync(temporary, ownerPath);
|
|
403
|
+
} catch (error) {
|
|
404
|
+
const code = errorCode(error);
|
|
405
|
+
if (code === "EEXIST") return false;
|
|
406
|
+
if (code === void 0 || !LINK_UNSUPPORTED_CODES.has(code)) throw error;
|
|
407
|
+
try {
|
|
408
|
+
fs.lstatSync(ownerPath);
|
|
409
|
+
return false;
|
|
410
|
+
} catch (ownerError) {
|
|
411
|
+
if (errorCode(ownerError) !== "ENOENT") throw ownerError;
|
|
412
|
+
}
|
|
413
|
+
renameAtomic(temporary, ownerPath);
|
|
414
|
+
return true;
|
|
415
|
+
}
|
|
416
|
+
try {
|
|
417
|
+
fs.unlinkSync(temporary);
|
|
418
|
+
} catch {
|
|
419
|
+
}
|
|
420
|
+
return true;
|
|
421
|
+
};
|
|
422
|
+
var claimPath = (lock) => `${lock}${CLAIM_INFIX}${process.pid}-t${Date.now()}-${randomUUID()}`;
|
|
423
|
+
var listClaims = (lock, strict = false) => {
|
|
424
|
+
const prefix = `${path.basename(lock)}${CLAIM_INFIX}`;
|
|
425
|
+
try {
|
|
426
|
+
return fs.readdirSync(path.dirname(lock)).filter((name) => name.startsWith(prefix)).map((name) => path.join(path.dirname(lock), name));
|
|
427
|
+
} catch (error) {
|
|
428
|
+
if (strict) throw error;
|
|
429
|
+
return [];
|
|
430
|
+
}
|
|
431
|
+
};
|
|
432
|
+
var tryAcquireShortLock = (lock, ownerText) => {
|
|
433
|
+
try {
|
|
434
|
+
fs.mkdirSync(lock, { mode: 448 });
|
|
435
|
+
} catch (error) {
|
|
436
|
+
if (errorCode(error) === "EEXIST") return false;
|
|
437
|
+
throw error;
|
|
438
|
+
}
|
|
439
|
+
const created = lockInode(lock);
|
|
440
|
+
const temporary = path.join(lock, `owner.${process.pid}.${randomUUID()}.tmp`);
|
|
441
|
+
try {
|
|
442
|
+
fs.writeFileSync(temporary, ownerText, { encoding: "utf8", mode: 384 });
|
|
443
|
+
if (publishShortLockOwner(temporary, path.join(lock, "owner"))) {
|
|
444
|
+
try {
|
|
445
|
+
const claims = listClaims(lock, true);
|
|
446
|
+
const canonical = lockInode(lock);
|
|
447
|
+
if (claims.length === 0 && created !== void 0 && canonical !== void 0 && sameInode(created, canonical) && readOwnerText(lock) === ownerText) return true;
|
|
448
|
+
} catch {
|
|
449
|
+
}
|
|
450
|
+
releaseShortLock(lock, parseShortLockOwner(ownerText).token, 0);
|
|
451
|
+
return false;
|
|
452
|
+
}
|
|
453
|
+
} catch (error) {
|
|
454
|
+
if (errorCode(error) === "ENOENT") return false;
|
|
455
|
+
try {
|
|
456
|
+
fs.rmSync(temporary, { force: true });
|
|
457
|
+
fs.rmdirSync(lock);
|
|
458
|
+
} catch {
|
|
459
|
+
}
|
|
460
|
+
throw error;
|
|
461
|
+
}
|
|
462
|
+
try {
|
|
463
|
+
fs.rmSync(temporary, { force: true });
|
|
464
|
+
} catch {
|
|
465
|
+
}
|
|
466
|
+
return false;
|
|
467
|
+
};
|
|
468
|
+
var reapLockByRenameClaim = (lock, verify, expected = lockInode(lock)) => {
|
|
469
|
+
if (expected === void 0) return false;
|
|
470
|
+
const claim = claimPath(lock);
|
|
471
|
+
try {
|
|
472
|
+
fs.renameSync(lock, claim);
|
|
473
|
+
} catch {
|
|
474
|
+
return false;
|
|
475
|
+
}
|
|
476
|
+
const claimed = lockInode(claim);
|
|
477
|
+
if (claimed === void 0 || !sameInode(claimed, expected)) {
|
|
478
|
+
try {
|
|
479
|
+
fs.renameSync(claim, lock);
|
|
480
|
+
} catch {
|
|
481
|
+
}
|
|
482
|
+
return false;
|
|
483
|
+
}
|
|
484
|
+
if (!verify(claim)) {
|
|
485
|
+
try {
|
|
486
|
+
fs.renameSync(claim, lock);
|
|
487
|
+
} catch {
|
|
488
|
+
if (verify(claim)) fs.rmSync(claim, { recursive: true, force: true });
|
|
489
|
+
}
|
|
490
|
+
return false;
|
|
491
|
+
}
|
|
492
|
+
fs.rmSync(claim, { recursive: true, force: true });
|
|
493
|
+
return true;
|
|
494
|
+
};
|
|
495
|
+
var lastClaimSweep = /* @__PURE__ */ new Map();
|
|
496
|
+
var sweepStaleLockClaims = (lock, staleMs, now = Date.now()) => {
|
|
497
|
+
let removed = 0;
|
|
498
|
+
for (const claim of listClaims(lock)) {
|
|
499
|
+
const stamp = /-t(\d{1,15})-[^-]/.exec(path.basename(claim).slice(path.basename(lock).length + CLAIM_INFIX.length));
|
|
500
|
+
let since = stamp ? Number(stamp[1]) : Number.NaN;
|
|
501
|
+
if (!Number.isSafeInteger(since)) {
|
|
502
|
+
try {
|
|
503
|
+
since = fs.lstatSync(claim).mtimeMs;
|
|
504
|
+
} catch {
|
|
505
|
+
continue;
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
if (now - since <= staleMs) continue;
|
|
509
|
+
let owner;
|
|
510
|
+
try {
|
|
511
|
+
owner = fs.readFileSync(path.join(claim, "owner"), "utf8");
|
|
512
|
+
} catch (error) {
|
|
513
|
+
if (errorCode(error) !== "ENOENT") continue;
|
|
514
|
+
}
|
|
515
|
+
if (!shortLockReapable(owner, modifiedAt(claim), { staleMs, probes: { now: () => now } })) continue;
|
|
516
|
+
try {
|
|
517
|
+
fs.rmSync(claim, { recursive: true, force: true });
|
|
518
|
+
removed += 1;
|
|
519
|
+
} catch {
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
return removed;
|
|
523
|
+
};
|
|
524
|
+
var reapStaleShortLock = (lock, options) => {
|
|
525
|
+
try {
|
|
526
|
+
const now = Date.now();
|
|
527
|
+
if (now - (lastClaimSweep.get(lock) ?? 0) >= CLAIM_SWEEP_INTERVAL_MS) {
|
|
528
|
+
lastClaimSweep.set(lock, now);
|
|
529
|
+
if (lastClaimSweep.size > 256) lastClaimSweep.delete(lastClaimSweep.keys().next().value);
|
|
530
|
+
sweepStaleLockClaims(lock, options.staleMs, now);
|
|
531
|
+
}
|
|
532
|
+
const judged = lockInode(lock);
|
|
533
|
+
if (judged === void 0) return false;
|
|
534
|
+
const owner = readOwnerText(lock);
|
|
535
|
+
const lockModifiedAt = modifiedAt(lock);
|
|
536
|
+
if (lockModifiedAt === void 0) return false;
|
|
537
|
+
if (!shortLockReapable(owner, lockModifiedAt, options)) return false;
|
|
538
|
+
if (readOwnerText(lock) !== owner) return false;
|
|
539
|
+
return reapLockByRenameClaim(lock, (claimed) => readOwnerText(claimed) === owner && shortLockReapable(owner, modifiedAt(claimed), options), judged);
|
|
540
|
+
} catch {
|
|
541
|
+
return false;
|
|
542
|
+
}
|
|
543
|
+
};
|
|
544
|
+
var takeOwnLock = (lock, source, token) => {
|
|
545
|
+
if (ownerToken(source) !== token) return false;
|
|
546
|
+
const trash = claimPath(lock);
|
|
547
|
+
try {
|
|
548
|
+
fs.renameSync(source, trash);
|
|
549
|
+
} catch {
|
|
550
|
+
return false;
|
|
551
|
+
}
|
|
552
|
+
if (ownerToken(trash) === token) {
|
|
553
|
+
fs.rmSync(trash, { recursive: true, force: true });
|
|
554
|
+
return true;
|
|
555
|
+
}
|
|
556
|
+
try {
|
|
557
|
+
fs.renameSync(trash, source);
|
|
558
|
+
} catch {
|
|
559
|
+
}
|
|
560
|
+
return false;
|
|
561
|
+
};
|
|
562
|
+
var releaseShortLock = (lock, token, retryMs = SHORT_LOCK_RELEASE_RETRY_MS) => {
|
|
563
|
+
const deadline = Date.now() + retryMs;
|
|
564
|
+
for (let attempt = 0; ; attempt++) {
|
|
565
|
+
try {
|
|
566
|
+
if (takeOwnLock(lock, lock, token)) return true;
|
|
567
|
+
for (const claim of listClaims(lock)) {
|
|
568
|
+
if (takeOwnLock(lock, claim, token)) return true;
|
|
569
|
+
}
|
|
570
|
+
} catch {
|
|
571
|
+
}
|
|
572
|
+
if (blockingSleep !== void 0) {
|
|
573
|
+
if (attempt >= retryMs) return false;
|
|
574
|
+
blockingSleep(1);
|
|
575
|
+
} else if (attempt >= RELEASE_SPIN_ATTEMPT_CAP || Date.now() >= deadline) {
|
|
576
|
+
return false;
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
};
|
|
580
|
+
var startOwnerHeartbeat = (refresh, intervalMs = OWNER_HEARTBEAT_INTERVAL_MS) => {
|
|
581
|
+
const timer = setInterval(() => {
|
|
582
|
+
try {
|
|
583
|
+
refresh(Date.now());
|
|
584
|
+
} catch {
|
|
585
|
+
}
|
|
586
|
+
}, intervalMs);
|
|
587
|
+
timer.unref?.();
|
|
588
|
+
return () => clearInterval(timer);
|
|
589
|
+
};
|
|
590
|
+
|
|
591
|
+
export {
|
|
592
|
+
renameAtomic,
|
|
593
|
+
fsyncDirectory,
|
|
594
|
+
mkdirDurable,
|
|
595
|
+
writeFileAtomic,
|
|
596
|
+
writeJsonAtomic,
|
|
597
|
+
writeJsonAtomicAsync,
|
|
598
|
+
currentOwnerIdentity,
|
|
599
|
+
ownerIdentityFields,
|
|
600
|
+
ownerHeartbeatFields,
|
|
601
|
+
recordOwnerLiveness,
|
|
602
|
+
ownerLiveness,
|
|
603
|
+
formatShortLockOwner,
|
|
604
|
+
tryAcquireShortLock,
|
|
605
|
+
reapStaleShortLock,
|
|
606
|
+
releaseShortLock,
|
|
607
|
+
startOwnerHeartbeat
|
|
608
|
+
};
|
|
609
|
+
//# sourceMappingURL=chunk-F6A6MQ6G.js.map
|