@e4779/pi-fabric 0.117.2-fork.31 → 0.131.0-fork.32
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 +12 -5
- 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/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/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-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 +36 -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-3FJUP3GV.js → chunk-36XQFTEN.js} +2 -2
- 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-3PKZSIRA.js +1312 -0
- package/dist/chunks/chunk-3PKZSIRA.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-K7J2ABAZ.js → chunk-4KX6BIPL.js} +91 -31
- package/dist/chunks/chunk-4KX6BIPL.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-GIK2WNAK.js → chunk-5BOTHX47.js} +109 -20
- package/dist/chunks/chunk-5BOTHX47.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-GO32KSEZ.js → chunk-7CIES6X2.js} +84 -9
- package/dist/chunks/chunk-7CIES6X2.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-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-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-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-MLLYR3Y6.js → chunk-HSEZPCL5.js} +19 -78
- package/dist/chunks/chunk-HSEZPCL5.js.map +7 -0
- package/dist/chunks/{chunk-LNASO4VT.js → chunk-IOGDTIGN.js} +44 -19
- package/dist/chunks/chunk-IOGDTIGN.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-SPCJXN4K.js → chunk-LKYLD5SN.js} +298 -65
- package/dist/chunks/chunk-LKYLD5SN.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-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-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-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-UD7LFV43.js +28 -0
- package/dist/chunks/chunk-UD7LFV43.js.map +7 -0
- package/dist/chunks/{chunk-ASSLHWZS.js → chunk-UFMYN5TA.js} +2 -2
- 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-VNWQIGQL.js} +1820 -649
- package/dist/chunks/chunk-VNWQIGQL.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-XCEEQ5AB.js → chunk-WGMCNCP6.js} +1567 -1564
- package/dist/chunks/chunk-WGMCNCP6.js.map +7 -0
- package/dist/chunks/chunk-WKFRGICG.js +101 -0
- package/dist/chunks/chunk-WKFRGICG.js.map +7 -0
- package/dist/chunks/{chunk-3UGN25XS.js → chunk-WWTGWGH7.js} +80 -1662
- package/dist/chunks/chunk-WWTGWGH7.js.map +7 -0
- package/dist/chunks/{chunk-5UBRGTVN.js → chunk-X7QETPBC.js} +31 -15
- package/dist/chunks/chunk-X7QETPBC.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-EKODKR6Y.js → chunk-YHFWMAQ5.js} +1 -24
- package/dist/chunks/chunk-YHFWMAQ5.js.map +7 -0
- package/dist/chunks/{chunk-C7Z6F3SO.js → chunk-ZFWICFNJ.js} +27 -20
- package/dist/chunks/{chunk-C7Z6F3SO.js.map → chunk-ZFWICFNJ.js.map} +2 -2
- 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 +39 -2
- 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/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 +10 -8
- 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 +2125 -786
- 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/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/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.d.ts.map +1 -1
- package/dist/ui/dashboard.js +17 -13
- package/dist/ui/dashboard.js.map +2 -2
- package/dist/ui/fabric-render.d.ts +6 -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 +1 -0
- package/dist/ui/settings-values.d.ts.map +1 -1
- package/dist/ui/settings.js +59 -18
- 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 +34 -16
- 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 +164 -17
- package/docs/architecture.md +5 -1
- package/docs/audit-trace.md +2 -1
- package/docs/background-tasks.md +102 -16
- package/docs/codemode-parity.md +2 -2
- package/docs/compaction.md +21 -5
- package/docs/components.md +1 -1
- package/docs/configuration.md +111 -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 +20 -17
- package/docs/jev.md +1 -1
- 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 +92 -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 +109 -22
- package/skillsets/typescript/fabric-exec/SKILL.md +7 -7
- package/skillsets/typescript/fabric-exec/references/agents.md +12 -3
- 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-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-3FJUP3GV.js.map → chunk-36XQFTEN.js.map} +0 -0
- /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-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-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-ASSLHWZS.js.map → chunk-UFMYN5TA.js.map} +0 -0
- /package/dist/chunks/{chunk-LEU5CDSL.js.map → chunk-XFOSUGLU.js.map} +0 -0
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
|
-
FABRIC_LIFECYCLE_EVENTS
|
|
3
|
-
|
|
2
|
+
FABRIC_LIFECYCLE_EVENTS,
|
|
3
|
+
aliasThinking,
|
|
4
|
+
assertExactModelRequest
|
|
5
|
+
} from "./chunk-V4OW2ULC.js";
|
|
6
|
+
import {
|
|
7
|
+
MAX_COMPACTION_INSTRUCTIONS_CHARS,
|
|
8
|
+
MAX_PRESERVE_ITEMS,
|
|
9
|
+
MAX_PRESERVE_ITEM_CHARS
|
|
10
|
+
} from "./chunk-HGD75NZY.js";
|
|
4
11
|
import {
|
|
5
12
|
FABRIC_ACTOR_HOST_EVENTS
|
|
6
13
|
} from "./chunk-IIPKG52D.js";
|
|
7
|
-
import {
|
|
8
|
-
aliasThinking
|
|
9
|
-
} from "./chunk-ZLNJDTCN.js";
|
|
10
14
|
import {
|
|
11
15
|
isFabricThinking,
|
|
12
16
|
normalizeThinkingBounds
|
|
13
17
|
} from "./chunk-V73NIH6B.js";
|
|
14
|
-
import {
|
|
15
|
-
MAX_COMPACTION_INSTRUCTIONS_CHARS,
|
|
16
|
-
MAX_PRESERVE_ITEMS,
|
|
17
|
-
MAX_PRESERVE_ITEM_CHARS
|
|
18
|
-
} from "./chunk-INRXG4J5.js";
|
|
19
18
|
import {
|
|
20
19
|
isFabricRunnerId
|
|
21
20
|
} from "./chunk-6QVQXGMR.js";
|
|
@@ -24,6 +23,11 @@ import {
|
|
|
24
23
|
var RUNNER_ID_SOURCE = "^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$";
|
|
25
24
|
var runProperties = {
|
|
26
25
|
task: { type: "string", description: "A self-contained task for the child agent" },
|
|
26
|
+
agent: {
|
|
27
|
+
type: "string",
|
|
28
|
+
minLength: 1,
|
|
29
|
+
description: "Name of an agent file (see agents.definitions()) whose instructions, model, tools, thinking and runtimes.fabric settings fill this request. Any field passed here wins over the file. An unknown name fails before the child starts."
|
|
30
|
+
},
|
|
27
31
|
name: { type: "string" },
|
|
28
32
|
runner: {
|
|
29
33
|
type: "string",
|
|
@@ -42,12 +46,22 @@ var runProperties = {
|
|
|
42
46
|
},
|
|
43
47
|
model: {
|
|
44
48
|
type: "string",
|
|
45
|
-
description: 'Pi provider/id copied from agents.models({ runner: "pi" }), a configured models.aliases name, or a search term resolved to the closest authenticated model (recency from pi-model-sort breaks ties). Reuse returned keys; never infer version numbers from agent names. Exact keys win; near-miss IDs resolve to the closest visible model on the same provider. Handles report the canonical model. Claude runtime value or Veda backend model/alias are forwarded verbatim.'
|
|
49
|
+
description: 'Pi provider/id copied from agents.models({ runner: "pi" }), a configured models.aliases name, or a search term resolved to the closest authenticated model (recency from pi-model-sort breaks ties). Reuse returned keys; never infer version numbers from agent names. Exact keys win; near-miss IDs resolve to the closest visible model on the same provider. Handles report the canonical model. Claude runtime value or Veda backend model/alias are forwarded verbatim. Set modelMatch: "exact" to turn off aliases and near-miss resolution.'
|
|
50
|
+
},
|
|
51
|
+
modelMatch: {
|
|
52
|
+
type: "string",
|
|
53
|
+
enum: ["exact"],
|
|
54
|
+
description: 'Pi runners only (pi, pi-durable). "exact" selects a listed provider/id without aliases, closest or fuzzy matching, or alias thinking; invalid selectors and other runners are refused before launch. Admission is strict and a child guard detects model switches and some payload rewrites. This is not a security guarantee or final-dispatch enforcement: later hooks, unknown API payloads, providers and extension-made calls can route data elsewhere; attribution checks may detect drift only after a call. Do not rely on it to prevent data disclosure. Omit for default resolution.'
|
|
46
55
|
},
|
|
47
56
|
persona: {
|
|
48
57
|
type: "string",
|
|
49
58
|
description: "Veda persona name for this run, such as frontend, reviewer, worker, or a custom persona."
|
|
50
59
|
},
|
|
60
|
+
holdQuestions: {
|
|
61
|
+
type: "boolean",
|
|
62
|
+
const: true,
|
|
63
|
+
description: `Hold this run's routed questions for a person. Each question becomes a root-held Fabric decision with a 30-day deadline (the longest allowed); only this run waits until it is answered (/fabric decisions, pi-fabric decisions answer, or decisions.answer from the main session). Needs agents.childQuestions "route" and a runner that declares questions; refused otherwise. The run's timeoutMs still applies.`
|
|
64
|
+
},
|
|
51
65
|
thinking: {
|
|
52
66
|
type: "string",
|
|
53
67
|
enum: ["off", "minimal", "low", "medium", "high", "xhigh", "max"]
|
|
@@ -120,7 +134,22 @@ var runProperties = {
|
|
|
120
134
|
schema: { type: "object", description: "Optional JSON Schema for validated structured output" },
|
|
121
135
|
systemPrompt: {
|
|
122
136
|
type: "string",
|
|
123
|
-
description: "Optional extra system prompt body for this child run.
|
|
137
|
+
description: "Optional extra system prompt body for this child run. Fabric places it ahead of any component guidance. Pi and Claude runners append the result with --append-system-prompt, and Veda receives it as a <system_instructions> block in its prompt. Useful for reliability-focused prompt rules on models with weak behavioral defaults."
|
|
138
|
+
},
|
|
139
|
+
skills: {
|
|
140
|
+
anyOf: [
|
|
141
|
+
{ type: "boolean", const: false },
|
|
142
|
+
{ type: "array", items: { type: "string", minLength: 1, maxLength: 128, pattern: "^[^/\\\\]+$" }, maxItems: 64 },
|
|
143
|
+
{
|
|
144
|
+
type: "object",
|
|
145
|
+
properties: {
|
|
146
|
+
preload: { type: "array", items: { type: "string", minLength: 1, maxLength: 128, pattern: "^[^/\\\\]+$" }, maxItems: 64 },
|
|
147
|
+
inherit: { type: "boolean" }
|
|
148
|
+
},
|
|
149
|
+
additionalProperties: false
|
|
150
|
+
}
|
|
151
|
+
],
|
|
152
|
+
description: "Pi runners only: the child's skills, by name, resolved against this session's skills. false: no skills. A list: those skills preloaded in full, plus this session's other skills. { preload, inherit: false }: only the preloaded skills. Omit to keep the child's own skill discovery. An unknown name fails before launch."
|
|
124
153
|
},
|
|
125
154
|
persistSession: {
|
|
126
155
|
type: "boolean",
|
|
@@ -155,7 +184,14 @@ var actorInvocationProperties = {
|
|
|
155
184
|
};
|
|
156
185
|
var spawnSchema = {
|
|
157
186
|
...runSchema,
|
|
158
|
-
properties: {
|
|
187
|
+
properties: {
|
|
188
|
+
...runProperties,
|
|
189
|
+
residency: residencySchema,
|
|
190
|
+
queue: {
|
|
191
|
+
type: "boolean",
|
|
192
|
+
description: 'Return a handle with status "queued" at once instead of waiting inside this call for a free agents.maxConcurrent slot. The run starts when a slot frees, even after this program ends; wait, status, list, and stop accept the id meanwhile, and stop cancels it without launching. Validation errors still reject the call. Omitted or false keeps the default: spawn waits for a slot.'
|
|
193
|
+
}
|
|
194
|
+
}
|
|
159
195
|
};
|
|
160
196
|
var handoffCompactionSchema = {
|
|
161
197
|
anyOf: [
|
|
@@ -211,6 +247,12 @@ var idSchema = {
|
|
|
211
247
|
required: ["id"],
|
|
212
248
|
additionalProperties: false
|
|
213
249
|
};
|
|
250
|
+
var parkResultSchema = (requested) => ({
|
|
251
|
+
type: "object",
|
|
252
|
+
properties: { id: { type: "string" }, requested: { const: requested } },
|
|
253
|
+
required: ["id", "requested"],
|
|
254
|
+
additionalProperties: false
|
|
255
|
+
});
|
|
214
256
|
var lifecycleEventSchema = {
|
|
215
257
|
type: "string",
|
|
216
258
|
enum: [...FABRIC_LIFECYCLE_EVENTS]
|
|
@@ -300,6 +342,22 @@ var AGENTS_ACTION_DESCRIPTORS = [
|
|
|
300
342
|
inputSchema: { type: "object", properties: {}, additionalProperties: false },
|
|
301
343
|
risk: "read"
|
|
302
344
|
},
|
|
345
|
+
{
|
|
346
|
+
name: "departed",
|
|
347
|
+
description: "List root Pi sessions that are no longer live, newest first: status stopped (closed cleanly) or lost (lease expired without closing), with sessionId, cwd, label and lastSeenAt. Live sessions are never included.",
|
|
348
|
+
inputSchema: {
|
|
349
|
+
type: "object",
|
|
350
|
+
properties: { limit: { type: "number", minimum: 1 } },
|
|
351
|
+
additionalProperties: false
|
|
352
|
+
},
|
|
353
|
+
risk: "read"
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
name: "definitions",
|
|
357
|
+
description: "List the named agent files that agents.run and agents.spawn accept in agent: name, description, path, scope (user or project), the file it shadows, and warnings for ignored fields. A file that cannot be read appears with an error.",
|
|
358
|
+
inputSchema: { type: "object", properties: {}, additionalProperties: false },
|
|
359
|
+
risk: "read"
|
|
360
|
+
},
|
|
303
361
|
{
|
|
304
362
|
name: "peers",
|
|
305
363
|
description: "List other live root Pi sessions sharing this project mesh. The dashboard-owning session remains Main; these targets are named peers.",
|
|
@@ -342,12 +400,18 @@ var AGENTS_ACTION_DESCRIPTORS = [
|
|
|
342
400
|
},
|
|
343
401
|
{
|
|
344
402
|
name: "models",
|
|
345
|
-
description: "List models exposed by the selected runner. Claude models are enumerated from the installed Claude Code runtime, not hard-coded.",
|
|
403
|
+
description: "List models exposed by the selected runner. Claude models are enumerated from the installed Claude Code runtime, not hard-coded. Pass model to look up one exact key instead of reading the whole list. Veda returns an empty list: pass its backend model or alias directly as model.",
|
|
346
404
|
inputSchema: {
|
|
347
405
|
type: "object",
|
|
348
406
|
properties: {
|
|
349
407
|
runner: { type: "string", pattern: RUNNER_ID_SOURCE, maxLength: 64 },
|
|
350
|
-
refresh: { type: "boolean" }
|
|
408
|
+
refresh: { type: "boolean" },
|
|
409
|
+
model: {
|
|
410
|
+
type: "string",
|
|
411
|
+
minLength: 1,
|
|
412
|
+
maxLength: 256,
|
|
413
|
+
description: "Exact model key (the key field of an unfiltered entry, e.g. provider/id or claude/<value>). Returns only the entries whose key matches exactly and case-sensitively, with no alias or fuzzy resolution; an unknown key returns []."
|
|
414
|
+
}
|
|
351
415
|
},
|
|
352
416
|
additionalProperties: false
|
|
353
417
|
},
|
|
@@ -376,6 +440,20 @@ var AGENTS_ACTION_DESCRIPTORS = [
|
|
|
376
440
|
inputSchema: idSchema,
|
|
377
441
|
risk: "agent"
|
|
378
442
|
},
|
|
443
|
+
{
|
|
444
|
+
name: "sleep",
|
|
445
|
+
description: "Park an idle hosted run in this session. Only runners that declare the sleep capability accept it. The run stays running and status shows sleeping: true once the runner reports it.",
|
|
446
|
+
inputSchema: idSchema,
|
|
447
|
+
outputSchema: parkResultSchema("sleep"),
|
|
448
|
+
risk: "agent"
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
name: "wake",
|
|
452
|
+
description: "Resume a hosted run in this session that agents.sleep parked. Needs the runner's sleep capability.",
|
|
453
|
+
inputSchema: idSchema,
|
|
454
|
+
outputSchema: parkResultSchema("wake"),
|
|
455
|
+
risk: "agent"
|
|
456
|
+
},
|
|
379
457
|
{
|
|
380
458
|
name: "cleanup",
|
|
381
459
|
description: "Remove a completed agent's run files and optional Git worktree",
|
|
@@ -392,7 +470,7 @@ var AGENTS_ACTION_DESCRIPTORS = [
|
|
|
392
470
|
},
|
|
393
471
|
{
|
|
394
472
|
name: "create",
|
|
395
|
-
description: 'Create a persistent actor with independently selected session or project storage. Use scope "global" to save a reusable project-independent template instead of a live actor.',
|
|
473
|
+
description: 'Create a persistent actor with independently selected session or project storage. A stopped live actor with the same name must be explicitly removed first. Use scope "global" to save a reusable project-independent template instead of a live actor.',
|
|
396
474
|
inputSchema: {
|
|
397
475
|
type: "object",
|
|
398
476
|
properties: {
|
|
@@ -551,7 +629,7 @@ var AGENTS_ACTION_DESCRIPTORS = [
|
|
|
551
629
|
},
|
|
552
630
|
{
|
|
553
631
|
name: "compact",
|
|
554
|
-
description: "Request an advisory compaction of a running Pi-runner child agent's context at its next safe boundary (between its own turns), preserving the child's accumulated context. Rejected for Claude
|
|
632
|
+
description: "Request an advisory compaction of a running Pi-runner child agent's context at its next safe boundary (between its own turns), preserving the child's accumulated context. Rejected for Claude and Veda children and for registered runners without the compaction capability. The child pi core applies the compaction; Fabric only forwards the intent.",
|
|
555
633
|
inputSchema: {
|
|
556
634
|
type: "object",
|
|
557
635
|
properties: {
|
|
@@ -768,7 +846,13 @@ var AGENTS_ACTION_DESCRIPTORS = [
|
|
|
768
846
|
];
|
|
769
847
|
|
|
770
848
|
// src/agents/request.ts
|
|
771
|
-
var stringArray = (value) =>
|
|
849
|
+
var stringArray = (value) => {
|
|
850
|
+
if (value === void 0) return void 0;
|
|
851
|
+
if (!Array.isArray(value) || !value.every((entry) => typeof entry === "string")) {
|
|
852
|
+
throw new Error("Agent tools must be an array of strings");
|
|
853
|
+
}
|
|
854
|
+
return [...value];
|
|
855
|
+
};
|
|
772
856
|
var checkedKernel = (value) => {
|
|
773
857
|
if (value === void 0 || value === "inherit" || value === "typescript" || value === "python") return value;
|
|
774
858
|
throw new Error(`Invalid Fabric agent kernel: ${String(value)}`);
|
|
@@ -776,13 +860,14 @@ var checkedKernel = (value) => {
|
|
|
776
860
|
var normalizeAgentRunRequest = (args, defaults, options = {}) => {
|
|
777
861
|
const transport = args.transport === "auto" || args.transport === "process" || args.transport === "tmux" || args.transport === "screen" || args.transport === "localterm" || args.transport === "herdr" ? args.transport : void 0;
|
|
778
862
|
const requestedModel = typeof args.model === "string" ? args.model : typeof defaults.model === "string" ? defaults.model : void 0;
|
|
779
|
-
const thinking = isFabricThinking(args.thinking) ? args.thinking : aliasThinking(defaults.models?.aliases, requestedModel ?? "");
|
|
863
|
+
const thinking = isFabricThinking(args.thinking) ? args.thinking : args.modelMatch === void 0 ? aliasThinking(defaults.models?.aliases, requestedModel ?? "") : void 0;
|
|
780
864
|
const tools = stringArray(args.tools);
|
|
781
865
|
const timeoutMs = typeof args.timeoutMs === "number" && Number.isFinite(args.timeoutMs) && args.timeoutMs > defaults.timeoutMs ? args.timeoutMs : void 0;
|
|
782
866
|
if (args.runner !== void 0 && !isFabricRunnerId(args.runner)) {
|
|
783
867
|
throw new Error(`Invalid Fabric agent runner: ${JSON.stringify(args.runner)}`);
|
|
784
868
|
}
|
|
785
869
|
const runner = args.runner ?? defaults.runner;
|
|
870
|
+
assertExactModelRequest({ modelMatch: args.modelMatch, runner, model: args.model });
|
|
786
871
|
const inheritedModel = (runner === "pi" || runner === "pi-durable") && !defaults.model && defaults.inheritedModel ? `${defaults.inheritedModel.provider}/${defaults.inheritedModel.id}` : void 0;
|
|
787
872
|
const kernel = checkedKernel(args.kernel);
|
|
788
873
|
const thinkingBounds = args.thinkingBounds === void 0 ? void 0 : normalizeThinkingBounds(args.thinkingBounds, "thinkingBounds");
|
|
@@ -796,6 +881,10 @@ var normalizeAgentRunRequest = (args, defaults, options = {}) => {
|
|
|
796
881
|
...typeof args.name === "string" ? { name: args.name } : {},
|
|
797
882
|
...transport ? { transport } : {},
|
|
798
883
|
...typeof args.model === "string" ? { model: args.model } : inheritedModel ? { model: inheritedModel } : {},
|
|
884
|
+
...args.modelMatch === "exact" ? { modelMatch: "exact" } : {},
|
|
885
|
+
// Shape is checked fail-closed by the manager; only a literal true holds.
|
|
886
|
+
...args.holdQuestions !== void 0 && args.holdQuestions !== false ? { holdQuestions: args.holdQuestions } : {},
|
|
887
|
+
...args.queue === true ? { queue: true } : {},
|
|
799
888
|
...typeof args.persona === "string" && args.persona.trim() ? { persona: args.persona.trim() } : {},
|
|
800
889
|
...thinking ? { thinking } : {},
|
|
801
890
|
...thinkingBounds ? { thinkingBounds } : {},
|
|
@@ -822,4 +911,4 @@ export {
|
|
|
822
911
|
AGENTS_ACTION_DESCRIPTORS,
|
|
823
912
|
normalizeAgentRunRequest
|
|
824
913
|
};
|
|
825
|
-
//# sourceMappingURL=chunk-
|
|
914
|
+
//# sourceMappingURL=chunk-5BOTHX47.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/providers/agents-actions.ts", "../../src/agents/request.ts"],
|
|
4
|
+
"sourcesContent": ["import { FABRIC_ACTOR_HOST_EVENTS } from \"../actors/types.js\";\nimport {\n MAX_COMPACTION_INSTRUCTIONS_CHARS,\n MAX_PRESERVE_ITEM_CHARS,\n MAX_PRESERVE_ITEMS,\n} from \"../compaction/instructions.js\";\nimport { FABRIC_LIFECYCLE_EVENTS } from \"../lifecycle/types.js\";\nimport type { FabricActionDescriptor } from \"../protocol.js\";\n\n// RUNNER_ID_PATTERN (src/agents/runner-registry.ts) as source text; kept in sync by a test.\nconst RUNNER_ID_SOURCE = \"^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$\";\n\nconst runProperties = {\n task: { type: \"string\", description: \"A self-contained task for the child agent\" },\n agent: {\n type: \"string\",\n minLength: 1,\n description: \"Name of an agent file (see agents.definitions()) whose instructions, model, tools, thinking and runtimes.fabric settings fill this request. Any field passed here wins over the file. An unknown name fails before the child starts.\",\n },\n name: { type: \"string\" },\n runner: {\n type: \"string\",\n pattern: RUNNER_ID_SOURCE,\n maxLength: 64,\n description: \"Execution harness: pi-durable (default), pi, claude, veda, or a runner registered through pi-fabric/runners. Defaults to agents.runner.\",\n },\n kernel: {\n type: \"string\",\n enum: [\"typescript\", \"python\", \"inherit\"],\n description: \"Fabric execution language. Omitted/inherit uses the caller executor.kernel; concrete choices require Pi with extensions enabled. Python uses the configured backend; CPython is native execution.\",\n },\n transport: {\n type: \"string\",\n enum: [\"auto\", \"process\", \"tmux\", \"screen\", \"localterm\", \"herdr\"],\n },\n model: {\n type: \"string\",\n description:\n \"Pi provider/id copied from agents.models({ runner: \\\"pi\\\" }), a configured models.aliases name, or a search term resolved to the closest authenticated model (recency from pi-model-sort breaks ties). Reuse returned keys; never infer version numbers from agent names. Exact keys win; near-miss IDs resolve to the closest visible model on the same provider. Handles report the canonical model. Claude runtime value or Veda backend model/alias are forwarded verbatim. Set modelMatch: \\\"exact\\\" to turn off aliases and near-miss resolution.\",\n },\n modelMatch: {\n type: \"string\",\n enum: [\"exact\"],\n description:\n \"Pi runners only (pi, pi-durable). \\\"exact\\\" selects a listed provider/id without aliases, closest or fuzzy matching, or alias thinking; invalid selectors and other runners are refused before launch. Admission is strict and a child guard detects model switches and some payload rewrites. This is not a security guarantee or final-dispatch enforcement: later hooks, unknown API payloads, providers and extension-made calls can route data elsewhere; attribution checks may detect drift only after a call. Do not rely on it to prevent data disclosure. Omit for default resolution.\",\n },\n persona: {\n type: \"string\",\n description: \"Veda persona name for this run, such as frontend, reviewer, worker, or a custom persona.\",\n },\n holdQuestions: {\n type: \"boolean\",\n const: true,\n description:\n \"Hold this run's routed questions for a person. Each question becomes a root-held Fabric decision with a 30-day deadline (the longest allowed); only this run waits until it is answered (/fabric decisions, pi-fabric decisions answer, or decisions.answer from the main session). Needs agents.childQuestions \\\"route\\\" and a runner that declares questions; refused otherwise. The run's timeoutMs still applies.\",\n },\n thinking: {\n type: \"string\",\n enum: [\"off\", \"minimal\", \"low\", \"medium\", \"high\", \"xhigh\", \"max\"],\n },\n thinkingBounds: {\n type: \"object\",\n properties: {\n min: { type: \"string\", enum: [\"off\", \"minimal\", \"low\", \"medium\", \"high\", \"xhigh\", \"max\"] },\n max: { type: \"string\", enum: [\"off\", \"minimal\", \"low\", \"medium\", \"high\", \"xhigh\", \"max\"] },\n },\n additionalProperties: false,\n description: \"Optional child thinking bounds; must lie inside this session's bounds (omitted ends inherit). Child Fabric sessions never widen them. thinking outside the effective bounds is clamped and reported as requestedThinking.\",\n },\n tools: { type: \"array\", items: { type: \"string\" } },\n timeoutMs: {\n type: \"number\",\n description:\n \"Optional longer wall-clock limit in milliseconds. Omit to use agents.timeoutMs (60 minutes by default); values below the configured default are ignored.\",\n },\n extensions: { type: \"boolean\" },\n recursive: { type: \"boolean\" },\n cwd: {\n type: \"string\",\n description: \"Filesystem execution directory for leaf or recursive Pi runs; relative paths resolve from the caller cwd. Does not change project/mesh ownership or grant target project trust.\",\n },\n worktree: { type: \"boolean\" },\n worktreeSetup: {\n type: \"string\",\n maxLength: 8192,\n description: \"Shell command run in a new worktree before the child starts; overrides agents.worktree.setup. Non-zero exit fails the run.\",\n },\n seed: {\n type: \"string\",\n enum: [\"task\", \"branch\", \"snippet\"],\n description: \"Child context (Pi only). task (default): the task alone. branch: a non-blocking fork of this conversation up to its last completed turn, then the task. snippet: the last seedMessages user/assistant texts prefixed to the task.\",\n },\n seedMessages: { type: \"integer\", minimum: 1, maximum: 50, description: \"snippet only; default 12\" },\n readOnly: { type: \"boolean\", description: \"Pi only: refuse write/edit (and shell unless shell: \\\"unconfined\\\") in the child\" },\n writableRoots: {\n type: \"array\",\n items: { type: \"string\", maxLength: 4096 },\n maxItems: 32,\n description: \"Pi only: confine write/edit to these directories (relative to the child cwd; default the cwd). Shell is refused unless shell: \\\"unconfined\\\".\",\n },\n scope: {\n type: \"object\",\n properties: {\n grants: {\n type: \"array\",\n maxItems: 64,\n items: {\n type: \"object\",\n properties: {\n resource: { type: \"string\", minLength: 3, maxLength: 512 },\n actions: { type: \"array\", minItems: 1, maxItems: 3, items: { type: \"string\", enum: [\"read\", \"write\", \"execute\"] } },\n },\n required: [\"resource\", \"actions\"],\n additionalProperties: false,\n },\n },\n },\n required: [\"grants\"],\n additionalProperties: false,\n description: \"Narrow this session's host-issued scope for the child (each grant must be covered by a parent grant; resource <ns>:<path>, <ns>:<path>/*, <ns>:<path>/**, <ns>:*). Omit to inherit it; refused in an unscoped session.\",\n },\n shell: {\n type: \"string\",\n enum: [\"deny\", \"unconfined\"],\n description: \"With a write policy, bash is refused by default; unconfined allows it and is not a sandbox\",\n },\n schema: { type: \"object\", description: \"Optional JSON Schema for validated structured output\" },\n systemPrompt: {\n type: \"string\",\n description: \"Optional extra system prompt body for this child run. Fabric places it ahead of any component guidance. Pi and Claude runners append the result with --append-system-prompt, and Veda receives it as a <system_instructions> block in its prompt. Useful for reliability-focused prompt rules on models with weak behavioral defaults.\",\n },\n skills: {\n anyOf: [\n { type: \"boolean\", const: false },\n { type: \"array\", items: { type: \"string\", minLength: 1, maxLength: 128, pattern: \"^[^/\\\\\\\\]+$\" }, maxItems: 64 },\n {\n type: \"object\",\n properties: {\n preload: { type: \"array\", items: { type: \"string\", minLength: 1, maxLength: 128, pattern: \"^[^/\\\\\\\\]+$\" }, maxItems: 64 },\n inherit: { type: \"boolean\" },\n },\n additionalProperties: false,\n },\n ],\n description: \"Pi runners only: the child's skills, by name, resolved against this session's skills. false: no skills. A list: those skills preloaded in full, plus this session's other skills. { preload, inherit: false }: only the preloaded skills. Omit to keep the child's own skill discovery. An unknown name fails before launch.\",\n },\n persistSession: {\n type: \"boolean\",\n description: \"Claude runner only: persist the Claude Code transcript for hook-based observability. Defaults to false.\",\n },\n};\n\nconst runSchema = {\n type: \"object\",\n properties: runProperties,\n required: [\"task\"],\n additionalProperties: false,\n};\n\nconst residencySchema = {\n type: \"string\",\n enum: [\"session\", \"durable\"],\n description: \"session stops with the current Pi host; durable transfers execution to Fabric's hidden resident host.\",\n};\n\nconst actorBindingScopeSchema = {\n type: \"string\",\n enum: [\"session\", \"project\"],\n description: \"session (default) changes only this Pi session; project pins the shared actor default and requires ownership.\",\n};\n\nconst actorInvocationProperties = {\n id: { type: \"string\" },\n message: { type: \"string\" },\n data: {},\n model: {\n ...runProperties.model,\n description: \"Optional model pinned only for this actor activation.\",\n },\n thinking: runProperties.thinking,\n};\n\nconst spawnSchema = {\n ...runSchema,\n properties: {\n ...runProperties,\n residency: residencySchema,\n queue: {\n type: \"boolean\",\n description:\n \"Return a handle with status \\\"queued\\\" at once instead of waiting inside this call for a free agents.maxConcurrent slot. The run starts when a slot frees, even after this program ends; wait, status, list, and stop accept the id meanwhile, and stop cancels it without launching. Validation errors still reject the call. Omitted or false keeps the default: spawn waits for a slot.\",\n },\n },\n};\n\nconst handoffCompactionSchema = {\n anyOf: [\n { type: \"boolean\" },\n {\n type: \"object\",\n properties: {\n instructions: {\n type: \"string\",\n maxLength: MAX_COMPACTION_INSTRUCTIONS_CHARS,\n description: \"Custom compaction instructions for the inherited trajectory\",\n },\n preserve: {\n type: \"array\",\n items: { type: \"string\", maxLength: MAX_PRESERVE_ITEM_CHARS },\n maxItems: MAX_PRESERVE_ITEMS,\n description: \"Explicit bounded facts the trajectory summary must preserve\",\n },\n },\n additionalProperties: false,\n },\n ],\n description:\n \"Compact the inherited trajectory with Fabric's deterministic compactor before the executor resumes it. `true` applies the default summary; an object customizes instructions and bounded preserve facts. Omitted keeps the full raw trajectory.\",\n};\n\nconst handoffSchema = {\n type: \"object\",\n properties: {\n task: {\n type: \"string\",\n description: \"Optional instructions for the executor in addition to the inherited trajectory\",\n },\n name: runProperties.name,\n kernel: runProperties.kernel,\n transport: runProperties.transport,\n model: {\n ...runProperties.model,\n description: \"Explicit Pi provider/id target that will continue the inherited trajectory\",\n },\n thinking: runProperties.thinking,\n tools: runProperties.tools,\n timeoutMs: runProperties.timeoutMs,\n extensions: runProperties.extensions,\n recursive: runProperties.recursive,\n schema: runProperties.schema,\n compact: handoffCompactionSchema,\n },\n required: [\"model\"],\n additionalProperties: false,\n};\n\nconst idSchema = {\n type: \"object\",\n properties: { id: { type: \"string\" } },\n required: [\"id\"],\n additionalProperties: false,\n};\n\nconst parkResultSchema = (requested: \"sleep\" | \"wake\") => ({\n type: \"object\",\n properties: { id: { type: \"string\" }, requested: { const: requested } },\n required: [\"id\", \"requested\"],\n additionalProperties: false,\n});\n\nconst lifecycleEventSchema = {\n type: \"string\",\n enum: [...FABRIC_LIFECYCLE_EVENTS],\n};\n\nexport const AGENTS_ACTION_DESCRIPTORS: FabricActionDescriptor[] = [\n {\n name: \"run\",\n description: \"Run a child agent through Pi or Claude Code and wait for its final result\",\n inputSchema: runSchema,\n risk: \"agent\",\n },\n {\n name: \"handoff\",\n description:\n \"Schedule a Pi trajectory handoff after the current outer fabric_exec result, then wait for implementation at that boundary\",\n inputSchema: handoffSchema,\n risk: \"agent\",\n },\n {\n name: \"spawn\",\n description:\n \"Start a child agent through Pi or Claude Code and return a handle immediately. For independent launches, await Promise.allSettled and inspect every result so one rejection does not abort pending sibling calls at program exit. Unread detached results are batched at the next safe turn boundary (or wake idle Main) when agents.notifyOnComplete is enabled. wait/join and terminal status acknowledge results and retract pending notifications. Use wait when this program needs the result; do not poll status in a loop.\",\n inputSchema: spawnSchema,\n risk: \"agent\",\n },\n {\n name: \"wait\",\n description: \"Wait for a previously spawned child agent and acknowledge its result, suppressing a duplicate completion notification\",\n effect: { kind: \"emission\", ordering: \"commutative\", resources: [\"agents.completions\"] },\n inputSchema: idSchema,\n risk: \"read\",\n },\n {\n name: \"join\",\n description: \"Alias for agents.wait: wait for a previously spawned child agent with the same progress and completion-notification behavior\",\n effect: { kind: \"emission\", ordering: \"commutative\", resources: [\"agents.completions\"] },\n inputSchema: idSchema,\n risk: \"read\",\n },\n {\n name: \"status\",\n description: \"Get the latest status of any known project participant. A terminal child-agent result acknowledges its pending completion notification; running status does not.\",\n effect: { kind: \"emission\", ordering: \"commutative\", resources: [\"agents.completions\"] },\n inputSchema: idSchema,\n risk: \"read\",\n },\n {\n name: \"list\",\n description: \"List agent participants locally, across the current lineage, or across the project\",\n inputSchema: {\n type: \"object\",\n properties: { scope: { type: \"string\", enum: [\"local\", \"lineage\", \"project\"] } },\n additionalProperties: false,\n },\n risk: \"read\",\n },\n {\n name: \"members\",\n description: \"List the unified project topology of roots, agents, and actors\",\n inputSchema: {\n type: \"object\",\n properties: {\n scope: { type: \"string\", enum: [\"local\", \"lineage\", \"project\"] },\n kinds: {\n type: \"array\",\n items: { type: \"string\", enum: [\"root\", \"agent\", \"actor\"] },\n },\n includeStale: { type: \"boolean\" },\n },\n additionalProperties: false,\n },\n risk: \"read\",\n },\n {\n name: \"self\",\n description: \"Return this caller's intrinsic participant identity in the unified topology\",\n inputSchema: { type: \"object\", properties: {}, additionalProperties: false },\n risk: \"read\",\n },\n {\n name: \"main\",\n description:\n \"Return the root user-facing Main Pi agent target. The stable alias main is also accepted by agents.steer and agents.followUp.\",\n inputSchema: { type: \"object\", properties: {}, additionalProperties: false },\n risk: \"read\",\n },\n {\n name: \"sessions\",\n description: \"List all live root Pi session agents in the project, including the current lineage root and peers, with symmetric participant identities.\",\n inputSchema: { type: \"object\", properties: {}, additionalProperties: false },\n risk: \"read\",\n },\n {\n name: \"departed\",\n description: \"List root Pi sessions that are no longer live, newest first: status stopped (closed cleanly) or lost (lease expired without closing), with sessionId, cwd, label and lastSeenAt. Live sessions are never included.\",\n inputSchema: {\n type: \"object\",\n properties: { limit: { type: \"number\", minimum: 1 } },\n additionalProperties: false,\n },\n risk: \"read\",\n },\n {\n name: \"definitions\",\n description: \"List the named agent files that agents.run and agents.spawn accept in agent: name, description, path, scope (user or project), the file it shadows, and warnings for ignored fields. A file that cannot be read appears with an error.\",\n inputSchema: { type: \"object\", properties: {}, additionalProperties: false },\n risk: \"read\",\n },\n {\n name: \"peers\",\n description: \"List other live root Pi sessions sharing this project mesh. The dashboard-owning session remains Main; these targets are named peers.\",\n inputSchema: { type: \"object\", properties: {}, additionalProperties: false },\n risk: \"read\",\n },\n {\n name: \"subscribe\",\n description:\n \"Create a durable source-qualified participant lifecycle subscription. Events are delivered to Main by default or to another participant through steer/follow-up routing.\",\n inputSchema: {\n type: \"object\",\n properties: {\n from: { type: \"string\", description: \"Exact source participant id; main means this lineage root\" },\n events: { type: \"array\", minItems: 1, items: lifecycleEventSchema },\n to: { type: \"string\", description: \"Target participant id; defaults to main\" },\n delivery: { type: \"string\", enum: [\"steer\", \"followUp\"] },\n triggerTurn: { type: \"boolean\" },\n once: { type: \"boolean\" },\n },\n required: [\"from\", \"events\", \"delivery\", \"triggerTurn\"],\n additionalProperties: false,\n },\n risk: \"agent\",\n },\n {\n name: \"subscriptions\",\n description: \"List durable participant lifecycle subscriptions, optionally filtered by source or target\",\n inputSchema: {\n type: \"object\",\n properties: { from: { type: \"string\" }, to: { type: \"string\" } },\n additionalProperties: false,\n },\n risk: \"read\",\n },\n {\n name: \"unsubscribe\",\n description: \"Remove a participant lifecycle subscription\",\n inputSchema: idSchema,\n risk: \"agent\",\n },\n {\n name: \"models\",\n description:\n \"List models exposed by the selected runner. Claude models are enumerated from the installed Claude Code runtime, not hard-coded. Pass model to look up one exact key instead of reading the whole list. Veda returns an empty list: pass its backend model or alias directly as model.\",\n inputSchema: {\n type: \"object\",\n properties: {\n runner: { type: \"string\", pattern: RUNNER_ID_SOURCE, maxLength: 64 },\n refresh: { type: \"boolean\" },\n model: {\n type: \"string\",\n minLength: 1,\n maxLength: 256,\n description:\n \"Exact model key (the key field of an unfiltered entry, e.g. provider/id or claude/<value>). Returns only the entries whose key matches exactly and case-sensitively, with no alias or fuzzy resolution; an unknown key returns [].\",\n },\n },\n additionalProperties: false,\n },\n risk: \"execute\",\n },\n {\n name: \"switchModel\",\n description:\n \"Switch Main's live Pi session model in place. The model selector accepts an exact provider/id, a configured models.aliases name (alias chains try each target in order until one is authenticated), an exact model id, or a search term; inexact terms resolve to the closest match, preferring recently used models (via pi-model-sort usage, when present).\",\n inputSchema: {\n type: \"object\",\n properties: {\n model: {\n type: \"string\",\n description: \"provider/id, alias name, or search term\",\n },\n provider: { type: \"string\" },\n },\n required: [\"model\"],\n additionalProperties: false,\n },\n risk: \"agent\",\n },\n {\n name: \"stop\",\n description: \"Stop a local or remotely owned agent or actor that advertises the stop capability\",\n inputSchema: idSchema,\n risk: \"agent\",\n },\n {\n name: \"sleep\",\n description:\n \"Park an idle hosted run in this session. Only runners that declare the sleep capability accept it. The run stays running and status shows sleeping: true once the runner reports it.\",\n inputSchema: idSchema,\n outputSchema: parkResultSchema(\"sleep\"),\n risk: \"agent\",\n },\n {\n name: \"wake\",\n description: \"Resume a hosted run in this session that agents.sleep parked. Needs the runner's sleep capability.\",\n inputSchema: idSchema,\n outputSchema: parkResultSchema(\"wake\"),\n risk: \"agent\",\n },\n {\n name: \"cleanup\",\n description: \"Remove a completed agent's run files and optional Git worktree\",\n inputSchema: {\n type: \"object\",\n properties: {\n id: { type: \"string\" },\n deleteBranch: { type: \"boolean\" },\n },\n required: [\"id\"],\n additionalProperties: false,\n },\n risk: \"write\",\n },\n {\n name: \"create\",\n description:\n 'Create a persistent actor with independently selected session or project storage. A stopped live actor with the same name must be explicitly removed first. Use scope \"global\" to save a reusable project-independent template instead of a live actor.',\n inputSchema: {\n type: \"object\",\n properties: {\n name: { type: \"string\" },\n instructions: { type: \"string\" },\n events: {\n type: \"array\",\n items: {\n type: \"string\",\n enum: [...FABRIC_ACTOR_HOST_EVENTS],\n },\n },\n topics: { type: \"array\", items: { type: \"string\" } },\n delivery: {\n type: \"string\",\n enum: [\"mailbox\", \"steer\", \"followUp\", \"nextTurn\"],\n },\n responseMode: { type: \"string\", enum: [\"text\", \"directive\"] },\n triggerTurn: { type: \"boolean\" },\n coalesce: { type: \"boolean\" },\n residency: residencySchema,\n runner: runProperties.runner,\n kernel: runProperties.kernel,\n model: runProperties.model,\n thinking: runProperties.thinking,\n tools: runProperties.tools,\n transport: runProperties.transport,\n timeoutMs: runProperties.timeoutMs,\n extensions: runProperties.extensions,\n requires: {\n type: \"array\",\n maxItems: 128,\n description: \"Exact Fabric provider.action refs committed before every actor run. Object entries may be optional.\",\n items: {\n oneOf: [\n { type: \"string\", minLength: 3, maxLength: 256 },\n {\n type: \"object\",\n properties: {\n ref: { type: \"string\", minLength: 3, maxLength: 256 },\n optional: { type: \"boolean\" },\n },\n required: [\"ref\"],\n additionalProperties: false,\n },\n ],\n },\n },\n validWhile: {\n type: \"object\",\n properties: { version: { const: 1 }, source: { type: \"string\" } },\n required: [\"version\", \"source\"],\n additionalProperties: false,\n },\n scope: {\n type: \"string\",\n enum: [\"session\", \"project\", \"global\"],\n description: \"session isolates the actor to the root Pi session; project shares it across sessions; global creates a non-live template.\",\n },\n },\n required: [\"name\", \"instructions\"],\n oneOf: [\n {\n properties: {\n delivery: { const: \"mailbox\" },\n triggerTurn: { const: false },\n },\n },\n {\n properties: {\n delivery: { const: \"nextTurn\" },\n triggerTurn: { const: false },\n },\n required: [\"delivery\"],\n },\n {\n properties: { delivery: { enum: [\"steer\", \"followUp\"] } },\n required: [\"delivery\", \"triggerTurn\"],\n },\n ],\n additionalProperties: false,\n },\n risk: \"agent\",\n },\n {\n name: \"ask\",\n description: \"Send a message to a persistent actor through its live owner and wait for its next response. Optional model/thinking values apply only to this activation.\",\n inputSchema: {\n type: \"object\",\n properties: actorInvocationProperties,\n required: [\"id\", \"message\"],\n additionalProperties: false,\n },\n risk: \"agent\",\n },\n {\n name: \"tell\",\n description: \"Queue a message through a persistent actor's live owner without waiting. Optional model/thinking values apply only to this activation.\",\n inputSchema: {\n type: \"object\",\n properties: actorInvocationProperties,\n required: [\"id\", \"message\"],\n additionalProperties: false,\n },\n risk: \"agent\",\n },\n {\n name: \"steer\",\n description:\n \"Steer Main, a running one-shot agent between turns, or a persistent actor through its mailbox. The stable id alias main targets the root user-facing Pi session. Non-local targets route over the project mesh.\",\n inputSchema: {\n type: \"object\",\n properties: { id: { type: \"string\" }, message: { type: \"string\" }, data: {} },\n required: [\"id\", \"message\"],\n additionalProperties: false,\n },\n risk: \"agent\",\n },\n {\n name: \"followUp\",\n description:\n \"Queue a follow-up for Main or a running one-shot agent, or enqueue a persistent actor mailbox message. The stable id alias main targets the root user-facing Pi session. Non-local targets route over the project mesh.\",\n inputSchema: {\n type: \"object\",\n properties: { id: { type: \"string\" }, message: { type: \"string\" }, data: {} },\n required: [\"id\", \"message\"],\n additionalProperties: false,\n },\n risk: \"agent\",\n },\n {\n name: \"setSteeringMode\",\n description:\n \"Set how queued steer messages are delivered to a running one-shot agent: all at once after the current turn, or one per turn (default). Local agent only.\",\n inputSchema: {\n type: \"object\",\n properties: {\n id: { type: \"string\" },\n mode: { type: \"string\", enum: [\"all\", \"one-at-a-time\"] },\n },\n required: [\"id\", \"mode\"],\n additionalProperties: false,\n },\n risk: \"agent\",\n },\n {\n name: \"setFollowUpMode\",\n description:\n \"Set how queued follow-up messages are delivered to a one-shot agent: all when it finishes, or one per completion (default). Local agent only.\",\n inputSchema: {\n type: \"object\",\n properties: {\n id: { type: \"string\" },\n mode: { type: \"string\", enum: [\"all\", \"one-at-a-time\"] },\n },\n required: [\"id\", \"mode\"],\n additionalProperties: false,\n },\n risk: \"agent\",\n },\n {\n name: \"compact\",\n description:\n \"Request an advisory compaction of a running Pi-runner child agent's context at its next safe boundary (between its own turns), preserving the child's accumulated context. Rejected for Claude and Veda children and for registered runners without the compaction capability. The child pi core applies the compaction; Fabric only forwards the intent.\",\n inputSchema: {\n type: \"object\",\n properties: {\n id: { type: \"string\" },\n instructions: {\n type: \"string\",\n description: \"Optional custom compaction instructions forwarded to the child pi\",\n },\n },\n required: [\"id\"],\n additionalProperties: false,\n },\n risk: \"agent\",\n },\n {\n name: \"actorStatus\",\n description: \"Read one persistent actor's status\",\n inputSchema: idSchema,\n risk: \"read\",\n },\n {\n name: \"actors\",\n description:\n 'List persistent actors. Default scope \"project\" lists live actors in this Fabric session; scope \"global\" lists project-independent templates in the global registry.',\n inputSchema: {\n type: \"object\",\n properties: { scope: { type: \"string\", enum: [\"project\", \"global\"] } },\n additionalProperties: false,\n },\n risk: \"read\",\n },\n {\n name: \"messages\",\n description: \"Read a persistent actor's bounded inbox and outbox history\",\n inputSchema: {\n type: \"object\",\n properties: { id: { type: \"string\" }, limit: { type: \"number\", minimum: 1 } },\n required: [\"id\"],\n additionalProperties: false,\n },\n risk: \"read\",\n },\n {\n name: \"setModel\",\n description:\n \"Change or clear a persistent actor model binding. Session scope is the default; project scope explicitly pins the shared definition default.\",\n inputSchema: {\n type: \"object\",\n properties: {\n id: { type: \"string\" },\n model: { type: \"string\" },\n scope: actorBindingScopeSchema,\n },\n required: [\"id\"],\n additionalProperties: false,\n },\n risk: \"agent\",\n },\n {\n name: \"setThinking\",\n description:\n \"Change or clear a persistent actor reasoning-effort binding. Session scope is the default; project scope explicitly pins the shared definition default.\",\n inputSchema: {\n type: \"object\",\n properties: {\n id: { type: \"string\" },\n thinking: runProperties.thinking,\n scope: actorBindingScopeSchema,\n },\n required: [\"id\"],\n additionalProperties: false,\n },\n risk: \"agent\",\n },\n {\n name: \"setTools\",\n description:\n \"Replace a persistent actor's tool allowlist. Takes effect on its next queued message; an empty list disables optional tools.\",\n inputSchema: {\n type: \"object\",\n properties: {\n id: { type: \"string\" },\n tools: runProperties.tools,\n scope: { type: \"string\", enum: [\"project\", \"global\"] },\n },\n required: [\"id\", \"tools\"],\n additionalProperties: false,\n },\n risk: \"agent\",\n },\n {\n name: \"setEvents\",\n description: \"Replace a persistent actor's session-bound Pi and synthetic tool_error event subscriptions\",\n inputSchema: {\n type: \"object\",\n properties: {\n id: { type: \"string\" },\n events: {\n type: \"array\",\n items: {\n type: \"string\",\n enum: [...FABRIC_ACTOR_HOST_EVENTS],\n },\n },\n },\n required: [\"id\", \"events\"],\n additionalProperties: false,\n },\n risk: \"agent\",\n },\n {\n name: \"setDeliveryPolicy\",\n description:\n \"Replace a project actor or global template delivery policy. steer/followUp require an explicit triggerTurn choice; mailbox/nextTurn require false.\",\n inputSchema: {\n type: \"object\",\n properties: {\n id: { type: \"string\" },\n delivery: {\n type: \"string\",\n enum: [\"mailbox\", \"steer\", \"followUp\", \"nextTurn\"],\n },\n triggerTurn: { type: \"boolean\" },\n scope: { type: \"string\", enum: [\"project\", \"global\"] },\n },\n required: [\"id\", \"delivery\", \"triggerTurn\"],\n additionalProperties: false,\n },\n risk: \"agent\",\n },\n {\n name: \"clearMessages\",\n description: \"Clear a persistent actor's recorded message history\",\n inputSchema: idSchema,\n risk: \"write\",\n },\n {\n name: \"remove\",\n description:\n 'Stop and remove a persistent actor. Default scope \"project\" removes a live project actor; scope \"global\" removes a project-independent template from the global registry.',\n inputSchema: {\n type: \"object\",\n properties: {\n id: { type: \"string\" },\n scope: { type: \"string\", enum: [\"project\", \"global\"] },\n },\n required: [\"id\"],\n additionalProperties: false,\n },\n risk: \"agent\",\n },\n {\n name: \"setInstructions\",\n description:\n 'Replace an actor\\'s default instruction (its persona / system-prompt body). Default scope \"project\" edits a live project actor; scope \"global\" edits a project-independent template. Takes effect on the actor\\'s next queued message.',\n inputSchema: {\n type: \"object\",\n properties: {\n id: { type: \"string\" },\n instructions: { type: \"string\" },\n scope: { type: \"string\", enum: [\"project\", \"global\"] },\n },\n required: [\"id\", \"instructions\"],\n additionalProperties: false,\n },\n risk: \"agent\",\n },\n {\n name: \"import\",\n description:\n \"Import a project-independent template from the global registry into the current project as a fresh live actor with no inherited history (no messages, session, or run logs). Identify the template by id or name; optionally rename the imported actor with \\\"as\\\" to avoid colliding with a live actor.\",\n inputSchema: {\n type: \"object\",\n properties: {\n id: { type: \"string\", description: \"Template id or name (one of id/name required)\" },\n name: { type: \"string\", description: \"Template name (one of id/name required)\" },\n as: { type: \"string\", description: \"Optional new name for the imported live actor\" },\n },\n additionalProperties: false,\n },\n risk: \"agent\",\n },\n {\n name: \"export\",\n description:\n \"Export a live project actor's definition to the global registry as a project-independent template, without any history (no messages, session, or run logs). Throws on a name collision unless overwrite is true.\",\n inputSchema: {\n type: \"object\",\n properties: {\n id: { type: \"string\" },\n overwrite: { type: \"boolean\" },\n },\n required: [\"id\"],\n additionalProperties: false,\n },\n risk: \"write\",\n },\n {\n name: \"log\",\n description:\n \"Read an actor or agent run's LLM/agent log: the actor's session transcript (session.jsonl) and/or a retained run's event stream (events.jsonl: tool calls, model responses, usage). Actors retain their last runs so logs survive after success.\",\n inputSchema: {\n type: \"object\",\n properties: {\n id: { type: \"string\", description: \"Actor ID/name or agent run ID\" },\n type: {\n type: \"string\",\n enum: [\"session\", \"run\", \"all\"],\n description:\n \"session = actor session transcript (default for actors); run = last retained run's events; all = both\",\n },\n lines: { type: \"number\", minimum: 1, description: \"Page line limit (default 200)\" },\n before: {\n type: \"number\",\n minimum: 0,\n description: \"Exclusive line cursor returned by a previous page to load older entries\",\n },\n runId: { type: \"string\", description: \"Specific retained run (default: actor's last run)\" },\n },\n required: [\"id\"],\n additionalProperties: false,\n },\n risk: \"read\",\n },\n];\n", "import type { AgentRunRequest } from \"./types.js\";\nimport { isFabricThinking, normalizeThinkingBounds } from \"../thinking.js\";\nimport { aliasThinking, assertExactModelRequest, type FabricModelAliases } from \"../core/model-resolution.js\";\nimport { isFabricRunnerId } from \"./runner-registry.js\";\n\nconst stringArray = (value: unknown): string[] | undefined => {\n if (value === undefined) return undefined;\n if (!Array.isArray(value) || !value.every((entry) => typeof entry === \"string\")) {\n throw new Error(\"Agent tools must be an array of strings\");\n }\n return [...value];\n};\nconst checkedKernel = (value: unknown): AgentRunRequest[\"kernel\"] => {\n if (value === undefined || value === \"inherit\" || value === \"typescript\" || value === \"python\") return value;\n throw new Error(`Invalid Fabric agent kernel: ${String(value)}`);\n};\n\nexport const normalizeAgentRunRequest = (\n args: Record<string, unknown>,\n defaults: {runner: NonNullable<AgentRunRequest[\"runner\"]>; model?: string; timeoutMs: number; inheritedModel?: {provider: string; id: string}; models?: {aliases?: FabricModelAliases}},\n options: {allowCwd?: boolean} = {},\n): AgentRunRequest => {\n const transport =\n args.transport === \"auto\" ||\n args.transport === \"process\" ||\n args.transport === \"tmux\" ||\n args.transport === \"screen\" ||\n args.transport === \"localterm\" ||\n args.transport === \"herdr\"\n ? args.transport\n : undefined;\n // An explicit call or actor level always wins; otherwise an alias can carry\n // the intended effort for the model it selects (e.g. a \"cheap\" alias that is\n // both cheaper and shallower), and the global agents.thinking default applies\n // last, inside the manager.\n const requestedModel =\n typeof args.model === \"string\"\n ? args.model\n : typeof defaults.model === \"string\"\n ? defaults.model\n : undefined;\n // An exact-match request never consults aliases, so no alias level applies either.\n const thinking = isFabricThinking(args.thinking)\n ? args.thinking\n : args.modelMatch === undefined\n ? aliasThinking(defaults.models?.aliases, requestedModel ?? \"\")\n : undefined;\n const tools = stringArray(args.tools);\n const timeoutMs = typeof args.timeoutMs === \"number\" && Number.isFinite(args.timeoutMs) && args.timeoutMs > defaults.timeoutMs ? args.timeoutMs : undefined;\n if (args.runner !== undefined && !isFabricRunnerId(args.runner)) {\n throw new Error(`Invalid Fabric agent runner: ${JSON.stringify(args.runner)}`);\n }\n const runner = args.runner ?? defaults.runner;\n assertExactModelRequest({ modelMatch: args.modelMatch, runner, model: args.model });\n const inheritedModel =\n (runner === \"pi\" || runner === \"pi-durable\") && !defaults.model && defaults.inheritedModel\n ? `${defaults.inheritedModel.provider}/${defaults.inheritedModel.id}`\n : undefined;\n const kernel = checkedKernel(args.kernel);\n const thinkingBounds = args.thinkingBounds === undefined\n ? undefined\n : normalizeThinkingBounds(args.thinkingBounds, \"thinkingBounds\");\n if (args.recursive === true && args.extensions === false) {\n throw new Error(\"Recursive Fabric requires extensions enabled; omit recursive or extensions: false\");\n }\n return {\n task: String(args.task),\n runner,\n ...(kernel !== undefined ? { kernel } : {}),\n ...(typeof args.name === \"string\" ? { name: args.name } : {}),\n ...(transport ? { transport } : {}),\n ...(typeof args.model === \"string\"\n ? { model: args.model }\n : inheritedModel\n ? { model: inheritedModel }\n : {}),\n ...(args.modelMatch === \"exact\" ? { modelMatch: \"exact\" as const } : {}),\n // Shape is checked fail-closed by the manager; only a literal true holds.\n ...(args.holdQuestions !== undefined && args.holdQuestions !== false\n ? { holdQuestions: args.holdQuestions as true }\n : {}),\n ...(args.queue === true ? { queue: true as const } : {}),\n ...(typeof args.persona === \"string\" && args.persona.trim()\n ? { persona: args.persona.trim() }\n : {}),\n ...(thinking ? { thinking } : {}),\n ...(thinkingBounds ? { thinkingBounds } : {}),\n ...(tools ? { tools } : {}),\n ...(timeoutMs !== undefined ? { timeoutMs } : {}),\n ...(typeof args.extensions === \"boolean\"\n ? { extensions: args.extensions }\n : args.recursive === true ? { extensions: true } : {}),\n ...(typeof args.recursive === \"boolean\" ? { recursive: args.recursive } : {}),\n ...(options.allowCwd !== false && typeof args.cwd === \"string\" ? { cwd: args.cwd } : {}),\n ...(typeof args.worktree === \"boolean\" ? { worktree: args.worktree } : {}),\n ...(args.worktreeSetup !== undefined ? { worktreeSetup: args.worktreeSetup as string } : {}),\n // Shapes are checked fail-closed by the manager before launch.\n ...(args.readOnly !== undefined ? { readOnly: args.readOnly as boolean } : {}),\n ...(args.writableRoots !== undefined ? { writableRoots: args.writableRoots as string[] } : {}),\n ...(args.shell !== undefined ? { shell: args.shell as \"deny\" | \"unconfined\" } : {}),\n ...(args.scope !== undefined ? { scope: args.scope as NonNullable<AgentRunRequest[\"scope\"]> } : {}),\n ...(args.residency === \"session\" || args.residency === \"durable\"\n ? { residency: args.residency }\n : {}),\n ...(typeof args.persistSession === \"boolean\"\n ? { persistSession: args.persistSession }\n : {}),\n ...(typeof args.schema === \"object\" && args.schema !== null && !Array.isArray(args.schema)\n ? { schema: args.schema as Record<string, unknown> }\n : {}),\n ...(typeof args.systemPrompt === \"string\" && args.systemPrompt.trim()\n ? { systemPrompt: args.systemPrompt }\n : {}),\n };\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAUA,IAAM,mBAAmB;AAEzB,IAAM,gBAAgB;AAAA,EACpB,MAAM,EAAE,MAAM,UAAU,aAAa,4CAA4C;AAAA,EACjF,OAAO;AAAA,IACL,MAAM;AAAA,IACN,WAAW;AAAA,IACX,aAAa;AAAA,EACf;AAAA,EACA,MAAM,EAAE,MAAM,SAAS;AAAA,EACvB,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,WAAW;AAAA,IACX,aAAa;AAAA,EACf;AAAA,EACA,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,MAAM,CAAC,cAAc,UAAU,SAAS;AAAA,IACxC,aAAa;AAAA,EACf;AAAA,EACA,WAAW;AAAA,IACT,MAAM;AAAA,IACN,MAAM,CAAC,QAAQ,WAAW,QAAQ,UAAU,aAAa,OAA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node:path";
|
|
5
|
+
var DURABLE_WORKER_POLICY_ENTRY_TYPE = "context-aware.policy.v1";
|
|
6
|
+
var DURABLE_WORKER_DECLARED_BY = "pi-fabric/durable-worker";
|
|
7
|
+
var SESSION_HEADER_VERSION = 3;
|
|
8
|
+
var NO_FOLLOW = fs.constants.O_NOFOLLOW ?? 0;
|
|
9
|
+
var DIRECTORY_FLAG = fs.constants.O_DIRECTORY ?? 0;
|
|
10
|
+
var TEMP_NAME = /^tmp-[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}\.jsonl$/;
|
|
11
|
+
var currentUid = () => typeof process.getuid === "function" ? process.getuid() : void 0;
|
|
12
|
+
var workerRolePolicyData = () => ({
|
|
13
|
+
schemaVersion: 1,
|
|
14
|
+
layer: "host",
|
|
15
|
+
declaredBy: DURABLE_WORKER_DECLARED_BY,
|
|
16
|
+
values: { sessionRole: "worker" }
|
|
17
|
+
});
|
|
18
|
+
var workerRoleEntry = (id, parentId, timestamp) => ({
|
|
19
|
+
type: "custom",
|
|
20
|
+
customType: DURABLE_WORKER_POLICY_ENTRY_TYPE,
|
|
21
|
+
data: workerRolePolicyData(),
|
|
22
|
+
id,
|
|
23
|
+
parentId,
|
|
24
|
+
timestamp
|
|
25
|
+
});
|
|
26
|
+
var declaredRole = (entry) => {
|
|
27
|
+
if (entry.type !== "custom" || entry.customType !== DURABLE_WORKER_POLICY_ENTRY_TYPE) return void 0;
|
|
28
|
+
const data = entry.data;
|
|
29
|
+
return data?.schemaVersion === 1 && data.layer === "host" ? data.values?.sessionRole : void 0;
|
|
30
|
+
};
|
|
31
|
+
var declareWorkerSessionRole = (sessionManager) => {
|
|
32
|
+
const roles = sessionManager.getBranch().map(declaredRole).filter((role) => role !== void 0);
|
|
33
|
+
if (roles.at(-1) === "worker") return "already-seeded";
|
|
34
|
+
sessionManager.appendCustomEntry(DURABLE_WORKER_POLICY_ENTRY_TYPE, workerRolePolicyData());
|
|
35
|
+
return "seeded";
|
|
36
|
+
};
|
|
37
|
+
var freshEntryId = (taken) => {
|
|
38
|
+
let id = randomUUID().slice(0, 8);
|
|
39
|
+
while (taken.has(id)) id = randomUUID().slice(0, 8);
|
|
40
|
+
return id;
|
|
41
|
+
};
|
|
42
|
+
var sessionHeader = (cwd, timestamp) => ({
|
|
43
|
+
type: "session",
|
|
44
|
+
version: SESSION_HEADER_VERSION,
|
|
45
|
+
id: randomUUID(),
|
|
46
|
+
timestamp,
|
|
47
|
+
cwd
|
|
48
|
+
});
|
|
49
|
+
var jsonLines = (lines) => lines.map((line) => JSON.stringify(line)).join("\n") + "\n";
|
|
50
|
+
var assertPrivateDirectory = (directory, label) => {
|
|
51
|
+
const stat = fs.lstatSync(directory);
|
|
52
|
+
if (stat.isSymbolicLink() || !stat.isDirectory()) {
|
|
53
|
+
throw new Error(`${label} must be a real directory, not a link: ${directory}`);
|
|
54
|
+
}
|
|
55
|
+
const uid = currentUid();
|
|
56
|
+
if (uid !== void 0 && stat.uid !== uid) throw new Error(`${label} is not owned by this user: ${directory}`);
|
|
57
|
+
return stat;
|
|
58
|
+
};
|
|
59
|
+
var securePrivateRunDirectory = (runDirectory) => {
|
|
60
|
+
const stat = assertPrivateDirectory(runDirectory, "Run directory");
|
|
61
|
+
if (process.platform === "win32" || (stat.mode & 18) === 0) return;
|
|
62
|
+
const fd = fs.openSync(runDirectory, fs.constants.O_RDONLY | DIRECTORY_FLAG | NO_FOLLOW);
|
|
63
|
+
try {
|
|
64
|
+
const opened = fs.fstatSync(fd);
|
|
65
|
+
const uid = currentUid();
|
|
66
|
+
if (!opened.isDirectory() || opened.ino !== stat.ino || opened.dev !== stat.dev || uid !== void 0 && opened.uid !== uid) {
|
|
67
|
+
throw new Error(`Run directory changed while opening: ${runDirectory}`);
|
|
68
|
+
}
|
|
69
|
+
fs.fchmodSync(fd, opened.mode & 4095 & ~18);
|
|
70
|
+
if ((fs.fstatSync(fd).mode & 18) !== 0) {
|
|
71
|
+
throw new Error(`Run directory is still writable by group or others after tightening: ${runDirectory}`);
|
|
72
|
+
}
|
|
73
|
+
} finally {
|
|
74
|
+
fs.closeSync(fd);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
var ensureSessionFolder = (runDirectory, name) => {
|
|
78
|
+
const directory = path.join(runDirectory, name);
|
|
79
|
+
try {
|
|
80
|
+
fs.mkdirSync(directory, { mode: 448 });
|
|
81
|
+
} catch (error) {
|
|
82
|
+
if (error.code !== "EEXIST") throw error;
|
|
83
|
+
}
|
|
84
|
+
const stat = assertPrivateDirectory(directory, "Durable session folder");
|
|
85
|
+
if (process.platform !== "win32" && (stat.mode & 511) !== 448) {
|
|
86
|
+
const fd = fs.openSync(directory, fs.constants.O_RDONLY | DIRECTORY_FLAG | NO_FOLLOW);
|
|
87
|
+
try {
|
|
88
|
+
const opened = fs.fstatSync(fd);
|
|
89
|
+
if (!opened.isDirectory() || opened.ino !== stat.ino || opened.dev !== stat.dev) {
|
|
90
|
+
throw new Error(`Durable session folder changed while opening: ${directory}`);
|
|
91
|
+
}
|
|
92
|
+
fs.fchmodSync(fd, 448);
|
|
93
|
+
} finally {
|
|
94
|
+
fs.closeSync(fd);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return directory;
|
|
98
|
+
};
|
|
99
|
+
var reclaimLeftoverTemps = (folder, file) => {
|
|
100
|
+
const stat = fs.lstatSync(file);
|
|
101
|
+
if (!stat.isFile() || stat.nlink < 2) return;
|
|
102
|
+
for (const name of fs.readdirSync(folder)) {
|
|
103
|
+
if (!TEMP_NAME.test(name)) continue;
|
|
104
|
+
const candidate = path.join(folder, name);
|
|
105
|
+
try {
|
|
106
|
+
const other = fs.lstatSync(candidate);
|
|
107
|
+
if (other.isFile() && other.ino === stat.ino && other.dev === stat.dev) fs.unlinkSync(candidate);
|
|
108
|
+
} catch {
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
var secureSessionFile = (folder, file) => {
|
|
113
|
+
const stat = fs.lstatSync(file);
|
|
114
|
+
const uid = currentUid();
|
|
115
|
+
if (!stat.isFile() || stat.isSymbolicLink()) throw new Error(`Session file must be a regular file: ${file}`);
|
|
116
|
+
if (uid !== void 0 && stat.uid !== uid) throw new Error(`Session file is not owned by this user: ${file}`);
|
|
117
|
+
reclaimLeftoverTemps(folder, file);
|
|
118
|
+
const fd = fs.openSync(file, fs.constants.O_RDONLY | NO_FOLLOW);
|
|
119
|
+
try {
|
|
120
|
+
const opened = fs.fstatSync(fd);
|
|
121
|
+
if (!opened.isFile() || opened.dev !== stat.dev || opened.ino !== stat.ino || uid !== void 0 && opened.uid !== uid) {
|
|
122
|
+
throw new Error(`Session file changed while opening: ${file}`);
|
|
123
|
+
}
|
|
124
|
+
if (opened.nlink !== 1) throw new Error(`Session file has external hard links: ${file}`);
|
|
125
|
+
if (process.platform !== "win32" && (opened.mode & 4095) !== 384) {
|
|
126
|
+
fs.fchmodSync(fd, 384);
|
|
127
|
+
if ((fs.fstatSync(fd).mode & 4095) !== 384) throw new Error(`Session file permissions could not be secured: ${file}`);
|
|
128
|
+
}
|
|
129
|
+
} finally {
|
|
130
|
+
fs.closeSync(fd);
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
var createDurableSessionFile = (runDirectory, cwd, hooks = {}) => {
|
|
134
|
+
securePrivateRunDirectory(runDirectory);
|
|
135
|
+
const folder = ensureSessionFolder(runDirectory, "durable-session");
|
|
136
|
+
const file = path.join(folder, "session.jsonl");
|
|
137
|
+
let exists = true;
|
|
138
|
+
try {
|
|
139
|
+
fs.lstatSync(file);
|
|
140
|
+
} catch (error) {
|
|
141
|
+
if (error.code !== "ENOENT") throw error;
|
|
142
|
+
exists = false;
|
|
143
|
+
}
|
|
144
|
+
if (exists) {
|
|
145
|
+
secureSessionFile(folder, file);
|
|
146
|
+
return file;
|
|
147
|
+
}
|
|
148
|
+
const timestamp = (/* @__PURE__ */ new Date()).toISOString();
|
|
149
|
+
const temporary = path.join(folder, `tmp-${randomUUID()}.jsonl`);
|
|
150
|
+
try {
|
|
151
|
+
const fd = fs.openSync(temporary, fs.constants.O_WRONLY | fs.constants.O_CREAT | fs.constants.O_EXCL | NO_FOLLOW, 384);
|
|
152
|
+
try {
|
|
153
|
+
if (process.platform !== "win32") fs.fchmodSync(fd, 384);
|
|
154
|
+
fs.writeSync(fd, jsonLines([sessionHeader(cwd, timestamp), workerRoleEntry(randomUUID().slice(0, 8), null, timestamp)]));
|
|
155
|
+
fs.fsyncSync(fd);
|
|
156
|
+
} finally {
|
|
157
|
+
fs.closeSync(fd);
|
|
158
|
+
}
|
|
159
|
+
hooks.beforeLink?.();
|
|
160
|
+
try {
|
|
161
|
+
fs.linkSync(temporary, file);
|
|
162
|
+
} catch (error) {
|
|
163
|
+
if (error.code !== "EEXIST") throw error;
|
|
164
|
+
}
|
|
165
|
+
} finally {
|
|
166
|
+
fs.rmSync(temporary, { force: true });
|
|
167
|
+
}
|
|
168
|
+
secureSessionFile(folder, file);
|
|
169
|
+
return file;
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
export {
|
|
173
|
+
DURABLE_WORKER_POLICY_ENTRY_TYPE,
|
|
174
|
+
workerRoleEntry,
|
|
175
|
+
declareWorkerSessionRole,
|
|
176
|
+
freshEntryId,
|
|
177
|
+
createDurableSessionFile
|
|
178
|
+
};
|
|
179
|
+
//# sourceMappingURL=chunk-5QJFDKPN.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/durable/worker-role-seed.ts"],
|
|
4
|
+
"sourcesContent": ["import { randomUUID } from \"node:crypto\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\n\n/**\n * Tell a Fabric-owned pi-durable child's session that it is a worker.\n *\n * A context-aware extension reads `sessionRole` from `context-aware.policy.v1` custom\n * entries on the active branch of the session record, replaying them in order\n * (a later entry wins per path). Without one it behaves as a session with a user\n * at a terminal (compaction seed sent as a user message, model rewrite, cache\n * listing, mid-reply compaction). Delegation extensions write the same entry for their\n * workers. Fabric imports neither, so the wire shape is restated here\n * as plain JSON. This module uses node:fs only: the worker process must not load\n * the Pi SDK.\n *\n * Design: create complete, never edit. Fabric writes the entry only into a\n * session file it creates, in the same write that creates the file, as the ROOT\n * of the tree (the first entry after the header, `parentId: null`). Every entry\n * Pi appends, and every branch a later navigation or fork reaches, then descends\n * from it. The worker never appends to, rewrites, or parses an existing session\n * file, and a caller-supplied session file is never written at all.\n *\n * Threat model: a process running as the same user is trusted, because it can\n * already write every session file; same-user races (swapping a folder, adding\n * a hard link between a check and a write) are out of scope. This module guards\n * against other users and accidental links: before it creates anything it\n * requires the run directory to be a real directory owned by this user, removes\n * group and other write from it, and creates the folder without following links.\n */\nexport const DURABLE_WORKER_POLICY_ENTRY_TYPE = \"context-aware.policy.v1\";\nexport const DURABLE_WORKER_DECLARED_BY = \"pi-fabric/durable-worker\";\n\n// Pi migrates an older header and rewrites the file; a newer Pi never reads this as newer than itself.\nconst SESSION_HEADER_VERSION = 3;\nconst NO_FOLLOW = fs.constants.O_NOFOLLOW ?? 0;\nconst DIRECTORY_FLAG = fs.constants.O_DIRECTORY ?? 0;\n/** The only temp name this module writes: lowercase UUID v4. src/storage/retention.ts accepts exactly this shape. */\nconst TEMP_NAME = /^tmp-[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}\\.jsonl$/;\n\nconst currentUid = (): number | undefined => (typeof process.getuid === \"function\" ? process.getuid() : undefined);\n\n/** The one payload of the worker-role entry: plain JSON, shared by every writer. */\nconst workerRolePolicyData = () => ({\n schemaVersion: 1,\n layer: \"host\",\n declaredBy: DURABLE_WORKER_DECLARED_BY,\n values: { sessionRole: \"worker\" },\n});\n\n/** The one builder for the worker-role entry: plain JSON, shared by the durable-session writer and the seed writers. */\nexport const workerRoleEntry = (id: string, parentId: string | null, timestamp: string) => ({\n type: \"custom\",\n customType: DURABLE_WORKER_POLICY_ENTRY_TYPE,\n data: workerRolePolicyData(),\n id,\n parentId,\n timestamp,\n});\n\n/** The structural slice of a Pi `SessionManager` that `declareWorkerSessionRole` needs. */\nexport interface WorkerRoleSessionManager {\n appendCustomEntry(customType: string, data?: unknown): unknown;\n getBranch(): ReadonlyArray<{ type: string; customType?: string; data?: unknown }>;\n}\n\nconst declaredRole = (entry: { type: string; customType?: string; data?: unknown }): unknown => {\n if (entry.type !== \"custom\" || entry.customType !== DURABLE_WORKER_POLICY_ENTRY_TYPE) return undefined;\n const data = entry.data as { schemaVersion?: unknown; layer?: unknown; values?: { sessionRole?: unknown } } | undefined;\n return data?.schemaVersion === 1 && data.layer === \"host\" ? data.values?.sessionRole : undefined;\n};\n\n/**\n * For an embedding host that owns its session: add the worker-role entry to an open\n * `SessionManager` before the first prompt. It appends, so call it on a new session if\n * the entry should be the tree root. Idempotent: returns \"already-seeded\" when an entry\n * on the active branch most recently declares the worker role, and \"seeded\" after writing one.\n */\nexport const declareWorkerSessionRole = (sessionManager: WorkerRoleSessionManager): \"seeded\" | \"already-seeded\" => {\n const roles = sessionManager.getBranch().map(declaredRole).filter(role => role !== undefined);\n if (roles.at(-1) === \"worker\") return \"already-seeded\";\n sessionManager.appendCustomEntry(DURABLE_WORKER_POLICY_ENTRY_TYPE, workerRolePolicyData());\n return \"seeded\";\n};\n\n/** An entry id Pi would accept (8 hex characters) that no existing entry uses. */\nexport const freshEntryId = (taken: ReadonlySet<string>): string => {\n let id = randomUUID().slice(0, 8);\n while (taken.has(id)) id = randomUUID().slice(0, 8);\n return id;\n};\n\nconst sessionHeader = (cwd: string, timestamp: string) => ({\n type: \"session\", version: SESSION_HEADER_VERSION, id: randomUUID(), timestamp, cwd,\n});\n\nconst jsonLines = (lines: readonly unknown[]): string => lines.map((line) => JSON.stringify(line)).join(\"\\n\") + \"\\n\";\n\n/** A real directory (never a link) owned by this user, or an error before anything is written. */\nconst assertPrivateDirectory = (directory: string, label: string): fs.Stats => {\n const stat = fs.lstatSync(directory);\n if (stat.isSymbolicLink() || !stat.isDirectory()) {\n throw new Error(`${label} must be a real directory, not a link: ${directory}`);\n }\n const uid = currentUid();\n if (uid !== undefined && stat.uid !== uid) throw new Error(`${label} is not owned by this user: ${directory}`);\n return stat;\n};\n\n/**\n * The run directory must be a real directory (not a link) owned by this user, or\n * the launch fails before anything is written. If group or others can write it\n * (mode & 0o022), tighten it through a descriptor opened without following links\n * and verified to be the directory just checked. The manager creates it 0700, but\n * a run directory from an earlier Fabric or a test harness may not be. After\n * tightening no other user can add or swap entries; anything already inside is\n * refused by the owner and link checks on durable-session and by\n * O_EXCL | O_NOFOLLOW on the temp file.\n */\nconst securePrivateRunDirectory = (runDirectory: string): void => {\n const stat = assertPrivateDirectory(runDirectory, \"Run directory\");\n if (process.platform === \"win32\" || (stat.mode & 0o022) === 0) return;\n const fd = fs.openSync(runDirectory, fs.constants.O_RDONLY | DIRECTORY_FLAG | NO_FOLLOW);\n try {\n const opened = fs.fstatSync(fd);\n const uid = currentUid();\n if (!opened.isDirectory() || opened.ino !== stat.ino || opened.dev !== stat.dev || (uid !== undefined && opened.uid !== uid)) {\n throw new Error(`Run directory changed while opening: ${runDirectory}`);\n }\n fs.fchmodSync(fd, (opened.mode & 0o7777) & ~0o022);\n if ((fs.fstatSync(fd).mode & 0o022) !== 0) {\n throw new Error(`Run directory is still writable by group or others after tightening: ${runDirectory}`);\n }\n } finally {\n fs.closeSync(fd);\n }\n};\n\n/** Create `<run>/<name>` without following a link, or accept an existing real directory owned by this user. */\nconst ensureSessionFolder = (runDirectory: string, name: string): string => {\n const directory = path.join(runDirectory, name);\n try {\n fs.mkdirSync(directory, { mode: 0o700 }); // not recursive: the run directory must already exist\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== \"EEXIST\") throw error;\n }\n const stat = assertPrivateDirectory(directory, \"Durable session folder\");\n if (process.platform !== \"win32\" && (stat.mode & 0o777) !== 0o700) {\n // Through a descriptor opened without following links, so a link swapped in now cannot redirect the chmod.\n const fd = fs.openSync(directory, fs.constants.O_RDONLY | DIRECTORY_FLAG | NO_FOLLOW);\n try {\n const opened = fs.fstatSync(fd);\n if (!opened.isDirectory() || opened.ino !== stat.ino || opened.dev !== stat.dev) {\n throw new Error(`Durable session folder changed while opening: ${directory}`);\n }\n fs.fchmodSync(fd, 0o700);\n } finally {\n fs.closeSync(fd);\n }\n }\n return directory;\n};\n\n/** A crash between link and unlink leaves the temp as a second name for session.jsonl; remove only our own temp names. */\nconst reclaimLeftoverTemps = (folder: string, file: string): void => {\n const stat = fs.lstatSync(file);\n if (!stat.isFile() || stat.nlink < 2) return;\n for (const name of fs.readdirSync(folder)) {\n if (!TEMP_NAME.test(name)) continue;\n const candidate = path.join(folder, name);\n try {\n const other = fs.lstatSync(candidate);\n if (other.isFile() && other.ino === stat.ino && other.dev === stat.dev) fs.unlinkSync(candidate);\n } catch { /* another attempt removed it first */ }\n }\n};\n\n/** Validate existing files and link-race winners before returning them to Pi. */\nconst secureSessionFile = (folder: string, file: string): void => {\n const stat = fs.lstatSync(file);\n const uid = currentUid();\n if (!stat.isFile() || stat.isSymbolicLink()) throw new Error(`Session file must be a regular file: ${file}`);\n if (uid !== undefined && stat.uid !== uid) throw new Error(`Session file is not owned by this user: ${file}`);\n reclaimLeftoverTemps(folder, file);\n const fd = fs.openSync(file, fs.constants.O_RDONLY | NO_FOLLOW);\n try {\n const opened = fs.fstatSync(fd);\n if (!opened.isFile() || opened.dev !== stat.dev || opened.ino !== stat.ino || (uid !== undefined && opened.uid !== uid)) {\n throw new Error(`Session file changed while opening: ${file}`);\n }\n if (opened.nlink !== 1) throw new Error(`Session file has external hard links: ${file}`);\n if (process.platform !== \"win32\" && (opened.mode & 0o7777) !== 0o600) {\n fs.fchmodSync(fd, 0o600);\n if ((fs.fstatSync(fd).mode & 0o7777) !== 0o600) throw new Error(`Session file permissions could not be secured: ${file}`);\n }\n } finally {\n fs.closeSync(fd);\n }\n};\n\n/**\n * Create the durable child's private session file, or reuse the existing one.\n *\n * Nothing is created unless the run directory is a real directory owned by this\n * user; group and other write are removed from it first. The folder is created under the existing\n * run directory without following links. A new file appears already complete (Pi\n * header, then the worker-role entry as the tree root): the content goes to\n * `tmp-<uuid>.jsonl` in the same folder (exclusive create, no link following),\n * is synced, then hard-linked to `session.jsonl`. Exactly one concurrent creator\n * wins the link; the others validate the winner's file. Existing files must be\n * regular, owned by this user and have no external hard links; their permissions\n * are tightened to 0600 if necessary, without changing their content. A crash\n * leaves at most a stray `tmp-<uuid>.jsonl`, possibly as a\n * second name for `session.jsonl`; a relaunch removes it and run retention\n * reclaims the pair with the run.\n */\nexport const createDurableSessionFile = (\n runDirectory: string,\n cwd: string,\n hooks: { beforeLink?: () => void } = {},\n): string => {\n securePrivateRunDirectory(runDirectory);\n const folder = ensureSessionFolder(runDirectory, \"durable-session\");\n const file = path.join(folder, \"session.jsonl\");\n let exists = true;\n try {\n fs.lstatSync(file);\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== \"ENOENT\") throw error;\n exists = false;\n }\n if (exists) {\n secureSessionFile(folder, file);\n return file;\n }\n const timestamp = new Date().toISOString();\n const temporary = path.join(folder, `tmp-${randomUUID()}.jsonl`);\n try {\n const fd = fs.openSync(temporary, fs.constants.O_WRONLY | fs.constants.O_CREAT | fs.constants.O_EXCL | NO_FOLLOW, 0o600);\n try {\n if (process.platform !== \"win32\") fs.fchmodSync(fd, 0o600); // independent of umask\n fs.writeSync(fd, jsonLines([sessionHeader(cwd, timestamp), workerRoleEntry(randomUUID().slice(0, 8), null, timestamp)]));\n fs.fsyncSync(fd);\n } finally {\n fs.closeSync(fd);\n }\n hooks.beforeLink?.();\n try {\n fs.linkSync(temporary, file);\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== \"EEXIST\") throw error; // another attempt created it: keep theirs\n }\n } finally {\n fs.rmSync(temporary, { force: true });\n }\n secureSessionFile(folder, file); // validate the winner and reclaim its leftover temp\n return file;\n};\n"],
|
|
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