@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
|
@@ -60,22 +60,27 @@ await compact.request({
|
|
|
60
60
|
instructions: "Keep the failing test name and the file map; drop the rest.",
|
|
61
61
|
preserve: ["Auth regression is still open", "tests/auth.test.ts"], // optional
|
|
62
62
|
requestedBy: "model", // optional, default "model"
|
|
63
|
+
seed: "Start phase 2: wire the API", // optional, queued after the commit as a labelled Fabric message
|
|
63
64
|
});
|
|
64
65
|
|
|
65
66
|
// Read the pending intent and the last committed/failed compaction info.
|
|
66
67
|
const status = await compact.status();
|
|
67
|
-
// { pending?: { reason?, instructions?, preserve?, requestedBy, requestedAt },
|
|
68
|
+
// { pending?: { reason?, instructions?, preserve?, seed?, requestedBy, requestedAt },
|
|
68
69
|
// last?: { at, requestedBy, status: "committed"|"cancelled"|"failed",
|
|
69
|
-
// summary?, tokensBefore?, estimatedTokensAfter?, error? },
|
|
70
|
+
// summary?, tokensBefore?, estimatedTokensAfter?, error?, seeded? },
|
|
70
71
|
// lastAuto?: { at, trigger: "headroom"|"tokens"|"ratio", committed },
|
|
71
72
|
// owner: "fabric"|"pi"|"external"|"none",
|
|
72
|
-
// outputReserveTokens
|
|
73
|
+
// outputReserveTokens,
|
|
74
|
+
// claim?: { name, version, branchSummary, actions }, // under a claim
|
|
75
|
+
// ownerStatus? } // owner's own report
|
|
73
76
|
|
|
74
77
|
// Read context pressure. Never compacts; the program decides what to do.
|
|
75
78
|
const pressure = await compact.pressure();
|
|
76
79
|
// { tokens, contextWindow, fraction, headroomTokens,
|
|
77
80
|
// band: "ok"|"warn"|"urgent"|"unknown", outputReserveTokens,
|
|
78
|
-
// thresholdFraction?, thresholdTokens?, owner
|
|
81
|
+
// thresholdFraction?, thresholdTokens?, owner,
|
|
82
|
+
// claim?: { name, version }, // under a claim
|
|
83
|
+
// ownerPressure?: { stage, thresholds? } } // owner's ladder
|
|
79
84
|
|
|
80
85
|
// Keep a bounded focus list in every Fabric summary until it is cleared.
|
|
81
86
|
await compact.carry({ add: ["Auth regression is still open"] });
|
|
@@ -121,8 +126,32 @@ restart, and tree navigation restore it without extra state, and a branch
|
|
|
121
126
|
keeps its own list. A malformed latest entry reads as an empty list. Custom
|
|
122
127
|
entries never enter the model context. The rendered block is bounded to
|
|
123
128
|
3 KiB like the request block; compaction details record
|
|
124
|
-
`carry: { count, renderedOmittedBytes }`. With `compaction.engine: "pi"
|
|
125
|
-
|
|
129
|
+
`carry: { count, renderedOmittedBytes }`. With `compaction.engine: "pi"`, or
|
|
130
|
+
when an extension wins compaction by load order without a claim, the list is
|
|
131
|
+
stored but not rendered. Under a [compaction owner claim](#compaction-owner-claim)
|
|
132
|
+
the list belongs to the owner and Fabric stores nothing.
|
|
133
|
+
|
|
134
|
+
##### Carry update contract
|
|
135
|
+
|
|
136
|
+
Fabric applies one `compact.carry` call to the current list in this order.
|
|
137
|
+
A claim owner that takes `carry` applies the same rules to its own list, so
|
|
138
|
+
the call means the same thing either way.
|
|
139
|
+
|
|
140
|
+
1. Fabric validates the call first. It accepts only `items`, `add`, and
|
|
141
|
+
`remove` (arrays of at most 16 strings of 1 to 2048 characters) and
|
|
142
|
+
`clear` (a boolean).
|
|
143
|
+
2. A call without `items`, `add`, `remove`, or `clear: true` reads the
|
|
144
|
+
list and changes nothing.
|
|
145
|
+
3. `clear: true` starts from an empty list; otherwise the update starts from
|
|
146
|
+
the current list.
|
|
147
|
+
4. `items` replaces the list.
|
|
148
|
+
5. `remove` drops every item exactly equal to one of its strings.
|
|
149
|
+
6. `add` appends, in order, each item that is not already present.
|
|
150
|
+
7. Duplicates are dropped; the first occurrence stays.
|
|
151
|
+
8. The result must hold at most 16 items, each not blank and at most 2048
|
|
152
|
+
characters and 2048 UTF-8 bytes. Otherwise the whole call is rejected
|
|
153
|
+
and the list is unchanged.
|
|
154
|
+
9. Fabric writes no entry when the result equals the current list.
|
|
126
155
|
|
|
127
156
|
With only `instructions` present, Fabric forwards it as ordinary Pi
|
|
128
157
|
`customInstructions`. Manual `/compact` text and programmatic requests then
|
|
@@ -190,7 +219,186 @@ not an automatically inferred conversational objective.
|
|
|
190
219
|
- On any other error, Fabric clears the intent and `last` records
|
|
191
220
|
`status: "failed"` with the message. A synchronous throw from `compact()`
|
|
192
221
|
itself follows the same failure path.
|
|
222
|
+
- A `seed` (at most 8192 characters, not blank) is sent only after
|
|
223
|
+
`onComplete`. Fabric sends it as a labelled custom message, never as a
|
|
224
|
+
user message, because the compaction removes the context that showed a
|
|
225
|
+
program wrote it:
|
|
226
|
+
|
|
227
|
+
```ts
|
|
228
|
+
pi.sendMessage({
|
|
229
|
+
customType: "fabric-compaction-seed",
|
|
230
|
+
content: "A Fabric program requested this continuation when it compacted the context. It is not a message from the user.\n"
|
|
231
|
+
+ `<fabric-compaction-seed>\n${escaped}\n</fabric-compaction-seed>`,
|
|
232
|
+
display: true,
|
|
233
|
+
details: { version: 1 },
|
|
234
|
+
}, { triggerTurn: true, deliverAs: "followUp" });
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
Pi gives the model a custom message as user-role text without its type or
|
|
238
|
+
details, so the first line carries the origin. Fabric escapes `&`, `<`,
|
|
239
|
+
and `>` in the seed, so it cannot close the wrapper, and no slash command
|
|
240
|
+
or template expands. The seed is queued after the compaction commits; a
|
|
241
|
+
prompt submitted during the compaction runs first. Pi defers a
|
|
242
|
+
turn-starting message sent during `agent_settled` until the settle
|
|
243
|
+
finishes, then runs deferred prompts and messages in submission order.
|
|
244
|
+
`last.seeded` is `true` once Fabric handed the seed to Pi. A cancelled
|
|
245
|
+
or failed commit never sends it. The seed applies to Fabric's own
|
|
246
|
+
controller whatever summarizer runs, including `compaction.engine: "pi"`.
|
|
247
|
+
Under a claim the owner receives the seed instead and sends it the same
|
|
248
|
+
way (see below).
|
|
249
|
+
|
|
250
|
+
### Compaction owner claim
|
|
251
|
+
|
|
252
|
+
Another extension can take compaction from Fabric without
|
|
253
|
+
`compaction.engine: "pi"`, which would also hand `/tree` summaries to Pi.
|
|
254
|
+
The owner emits `pi-fabric:compaction-owner:v1`
|
|
255
|
+
(`FABRIC_COMPACTION_OWNER_EVENT` in `pi-fabric/protocol`) from its
|
|
256
|
+
`session_start` handler or later:
|
|
193
257
|
|
|
258
|
+
```ts
|
|
259
|
+
import {
|
|
260
|
+
FABRIC_COMPACTION_OWNER_EVENT,
|
|
261
|
+
type FabricCompactionOwnerClaimV1,
|
|
262
|
+
type FabricCompactionOwnerHandleV1,
|
|
263
|
+
} from "pi-fabric/protocol";
|
|
264
|
+
|
|
265
|
+
let claim: FabricCompactionOwnerHandleV1 | undefined;
|
|
266
|
+
const lifetime = new AbortController();
|
|
267
|
+
pi.on("session_start", (_event, ctx) => {
|
|
268
|
+
// Fabric may answer after emit returns, so wait for the reply with a timeout.
|
|
269
|
+
const giveUp = setTimeout(() => lifetime.abort(), 5_000); // no reply: Fabric is not loaded
|
|
270
|
+
pi.events.emit(FABRIC_COMPACTION_OWNER_EVENT, {
|
|
271
|
+
version: 1,
|
|
272
|
+
type: "claim",
|
|
273
|
+
owner: { name: "example-owner", version: "1.4.0" },
|
|
274
|
+
actions: {
|
|
275
|
+
request: { fields: ["instructions", "preserve", "seed"], handler: (request, { signal }) => focus(request, signal) },
|
|
276
|
+
carry: { fields: ["items", "add", "remove", "clear"], handler: (update) => ({ items: carry(update) }) },
|
|
277
|
+
status: { handler: () => ({ stage: ladder.stage }) },
|
|
278
|
+
pressure: { handler: () => ({ stage: ladder.stage, thresholds: { fold: 0.7, compact: 0.9 } }) },
|
|
279
|
+
cancel: { handler: () => cancelPending() },
|
|
280
|
+
},
|
|
281
|
+
// branchSummary: true, // also take /tree summaries
|
|
282
|
+
signal: lifetime.signal,
|
|
283
|
+
reply: (result) => {
|
|
284
|
+
clearTimeout(giveUp);
|
|
285
|
+
if (!result.ok) {
|
|
286
|
+
ctx.ui.notify(result.error, "warning");
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
if (lifetime.signal.aborted) {
|
|
290
|
+
result.handle.withdraw(); // granted after the claimant gave up
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
claim = result.handle;
|
|
294
|
+
if (result.carry) adoptCarry(result.carry); // Fabric's list at cut-over
|
|
295
|
+
},
|
|
296
|
+
} satisfies FabricCompactionOwnerClaimV1);
|
|
297
|
+
});
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
The first message loads Fabric's claim code, so `reply` is called once, after
|
|
301
|
+
`emit` returns (a Fabric that answers during `emit` is also valid; accept
|
|
302
|
+
both). If it never comes, Fabric is not loaded: abort the claim's `signal` and
|
|
303
|
+
carry on without it. If `{ ok: true }` arrives after you gave up, call
|
|
304
|
+
`handle.withdraw()`. Fabric refuses a claim whose `signal` is already aborted
|
|
305
|
+
when it handles it. It handles messages in the order they were emitted and reads
|
|
306
|
+
each field when it handles the message, so do not change the message after
|
|
307
|
+
emitting it. A message still queued at Fabric's `session_shutdown` is refused:
|
|
308
|
+
a claim gets `{ ok: false, error }` saying Fabric is shutting down. If the
|
|
309
|
+
claim code fails to load, the reply is `{ ok: false, error }` naming the failure.
|
|
310
|
+
|
|
311
|
+
A successful reply is `{ ok: true, handle, carry? }`. `carry` is a frozen
|
|
312
|
+
copy of Fabric's carry-forward items when the claim was made: the list the
|
|
313
|
+
owner takes over, because `compact.carry` now goes to the owner. It is
|
|
314
|
+
absent when Fabric has not started the session yet, which happens when the
|
|
315
|
+
owner's `session_start` handler runs before Fabric's. The owner then reads
|
|
316
|
+
the latest `pi-fabric-compact-carry` custom entry on the branch itself
|
|
317
|
+
(`data: { version: 1, items }`).
|
|
318
|
+
|
|
319
|
+
While the claim is held:
|
|
320
|
+
|
|
321
|
+
- Fabric's `session_before_compact` handler returns nothing, before its
|
|
322
|
+
threshold deferral. Fabric produces no summary and never cancels the
|
|
323
|
+
owner's compaction. The owner's own `session_before_compact` handler
|
|
324
|
+
decides; when it returns nothing, Pi's summarizer runs.
|
|
325
|
+
- Fabric's settled-boundary threshold and headroom trigger stay off.
|
|
326
|
+
- `/tree` summaries stay with Fabric's configured engine unless the claim
|
|
327
|
+
sets `branchSummary: true`.
|
|
328
|
+
- `compact.request`, `compact.carry`, and `compact.cancel` go to the owner.
|
|
329
|
+
Fabric validates arguments as usual, then passes a fresh copy holding only
|
|
330
|
+
the fields the owner declared. An undeclared action or field fails with an
|
|
331
|
+
error naming the owner (`compaction owner example-owner@1.4.0: ...`),
|
|
332
|
+
and nothing is recorded, stored, or forwarded. `request` returns
|
|
333
|
+
`{ requested: true, intent, claim, result? }`. `intent` is a receipt that
|
|
334
|
+
describes what went to the owner; Fabric records none of it, so
|
|
335
|
+
`compact.status().pending` stays empty. `carry` handlers return
|
|
336
|
+
`{ items }` and should apply the [carry update contract](#carry-update-contract)
|
|
337
|
+
to the owner's own list.
|
|
338
|
+
- A request's `seed` reaches the owner only when it declares the `seed`
|
|
339
|
+
field, after the same checks as Fabric's own path. Fabric does not send
|
|
340
|
+
it. Send it after the owner's compaction commits, the way Fabric does: a
|
|
341
|
+
labelled custom message with `{ triggerTurn: true, deliverAs: "followUp" }`
|
|
342
|
+
whose text names its origin, not `sendUserMessage`.
|
|
343
|
+
- `compact.cancel` first clears any intent Fabric recorded before the
|
|
344
|
+
claim. That intent would otherwise commit through the owner at the next
|
|
345
|
+
settle, with Fabric-encoded instructions and Fabric's seed. It then calls
|
|
346
|
+
the owner's `cancel`. The result says which happened:
|
|
347
|
+
`{ cancelled: true, claim, fabricIntentCleared, ownerCancelled, result? }`.
|
|
348
|
+
Without an owner `cancel`, the call succeeds when Fabric had an intent to
|
|
349
|
+
clear and fails otherwise.
|
|
350
|
+
- `compact.status` adds `claim: { name, version, branchSummary, actions }`
|
|
351
|
+
and, when the owner supports `status`, `ownerStatus`. `compact.pressure`
|
|
352
|
+
adds `claim` and `ownerPressure: { stage, thresholds? }` beside Fabric's
|
|
353
|
+
band. Fabric omits its own `thresholdFraction` and `thresholdTokens`
|
|
354
|
+
there because they do not trigger under a claim.
|
|
355
|
+
- Every handler receives `{ context, signal }` (`FabricCompactionOwnerCallV1`):
|
|
356
|
+
`request` and `carry` as the second argument, the others as the only
|
|
357
|
+
one. `context` is the invoking session's extension context when Fabric
|
|
358
|
+
has one. Fabric bounds each handler call at 30 seconds. When the calling program
|
|
359
|
+
is cancelled or the bound passes, Fabric aborts `signal` and fails the
|
|
360
|
+
program call at once with `compaction owner <name>@<version>:
|
|
361
|
+
compact.<action> was cancelled by the calling program` or
|
|
362
|
+
`... did not finish within 30 s`. Stop the work when `signal` aborts.
|
|
363
|
+
- Owner handler results must be JSON of at most 16 KiB. A handler that throws
|
|
364
|
+
or returns an invalid shape fails the call with the owner's name. Pressure
|
|
365
|
+
threshold names `__proto__`, `constructor`, and `prototype` are refused.
|
|
366
|
+
- An expected owner result does not raise Fabric's ownership warning.
|
|
367
|
+
|
|
368
|
+
The handle's `fallback(event, ctx, { carry? })` returns Fabric's
|
|
369
|
+
deterministic summary for a `session_before_compact` event: the same
|
|
370
|
+
compiler, enrichers, and budget as Fabric's own hook, as
|
|
371
|
+
`{ ok: true, compaction }` or `{ ok: false, reason }`. Return
|
|
372
|
+
`{ compaction }` from the owner's handler when its model summary fails.
|
|
373
|
+
`carry` replaces Fabric's stored carry list and must fit the
|
|
374
|
+
`compact.carry` limits. The result carries Fabric's v2 details
|
|
375
|
+
(`compactor: "fabric"`) plus `claimOwner`, the owner's name, so a
|
|
376
|
+
provenance check can tell the owner's fallback from Fabric's own engine,
|
|
377
|
+
which never sets `claimOwner`. The fallback works only while the claim is
|
|
378
|
+
held.
|
|
379
|
+
|
|
380
|
+
One claim at a time. A second claim gets `{ ok: false, error, holder }`,
|
|
381
|
+
and Fabric shows a warning that names both owners. If the claimant's
|
|
382
|
+
`reply` throws, Fabric withdraws the claim it just granted and reports the
|
|
383
|
+
error as a warning (UI notice, else `console.warn`), because the owner never
|
|
384
|
+
received its token. A message with no usable `reply` is also reported as a
|
|
385
|
+
warning and dropped; nothing throws from `emit`. The claim ends when:
|
|
386
|
+
|
|
387
|
+
- the holder calls `handle.withdraw()` or emits
|
|
388
|
+
`{ version: 1, type: "withdraw", token: handle.token, reply? }`. Any other
|
|
389
|
+
token is refused with `{ ok: false, error }` and the claim stays;
|
|
390
|
+
- the claim's `signal` aborts; or
|
|
391
|
+
- Fabric receives `session_shutdown`. Pi sends it on reload, session
|
|
392
|
+
replacement (new, resume, fork), and quit, then loads every extension
|
|
393
|
+
again, so the owner claims again from its next `session_start`. Fabric
|
|
394
|
+
clears the claim first, before any other shutdown work.
|
|
395
|
+
|
|
396
|
+
Withdrawal restores Fabric's engine, thresholds, and `compact.*` behavior.
|
|
397
|
+
Fabric validates the claim and copies only named fields, reading each once:
|
|
398
|
+
`owner.name` and `owner.version` (printable text, at most 128 and 64
|
|
399
|
+
characters), the five known actions with their handlers and known fields,
|
|
400
|
+
`branchSummary`, and `signal`. Unknown keys, actions, or fields are
|
|
401
|
+
rejected with a reply naming the problem.
|
|
194
402
|
### Agent compaction: `agents.compact`
|
|
195
403
|
|
|
196
404
|
```ts
|
|
@@ -268,6 +476,8 @@ see [compaction](compaction.md#headroom-trigger).
|
|
|
268
476
|
| `src/compaction/pressure.ts` | Pure pressure projection from Pi's context usage, the active model, and config. |
|
|
269
477
|
| `src/compaction/carry.ts` | Carry-forward entry codec, update semantics, and summary lines. |
|
|
270
478
|
| `src/compaction/owner.ts` | Compaction owner classification and the once-per-session ownership warning. |
|
|
479
|
+
| `src/compaction/claim.ts` | Compaction owner claim registry: one holder, token withdrawal, abort-signal and shutdown release, and the deterministic fallback. |
|
|
480
|
+
| `src/protocol.ts` | `pi-fabric:compaction-owner:v1` message types and the validating, field-copying reader. |
|
|
271
481
|
| `src/fabric-state.ts` | Constructs the controller with mesh-publish hooks, registers the provider, and resets on re-init or shutdown. |
|
|
272
482
|
| `src/index.ts` | Invokes `state.compact.maybeCommit(context)` in the existing `agent_settled` handler. |
|
|
273
483
|
| `src/agents/types.ts` | Extends `AgentSteerEntry["type"]` with `"compact"` and adds the optional `instructions` field. |
|
package/docs/programs.md
CHANGED
|
@@ -114,7 +114,29 @@ pi.events.emit(FABRIC_PROGRAM_RUN_EVENT, {
|
|
|
114
114
|
});
|
|
115
115
|
```
|
|
116
116
|
|
|
117
|
-
The reply arrives exactly once. A payload without a `reply` function
|
|
117
|
+
The reply arrives exactly once. A payload without a `reply` function makes the listener throw synchronously; Pi's event bus catches and logs that throw, and other listeners still run. A `reply` property whose getter throws cannot be answered: Fabric neither replies nor throws. Other invalid fields, a missing session, an unknown ref, and a failed run all reply `{ ok: false, error }`. The event runs in the live session that Fabric saw at `session_start`.
|
|
118
|
+
|
|
119
|
+
Fabric reads `reply` and the named fields (`ref`, `input`, `requirePromoted`, `signal`) once, when the event arrives, and ignores every other field. A request without `ref` also has `code` read, once. Fabric keeps a JSON copy of `input`, not the caller's object, and makes it last, so a `toJSON` or getter inside `input` cannot change the other fields. A caller that deletes or changes the request or its `input` afterwards changes nothing, and the reply still arrives on the original `reply`. A named field whose getter throws never escapes the listener: Fabric replies `{ ok: false, error: "Invalid program run request: <field> could not be read" }` before any other check, and nothing runs.
|
|
120
|
+
|
|
121
|
+
### Running caller-supplied code
|
|
122
|
+
|
|
123
|
+
A host extension that builds program text itself, such as a program that ships in a package or a small runner it generates per run, can pass the TypeScript text as `code`, with no `ref`. Extensions already run with the user's full permissions, so this adds no new power. Fabric computes the SHA-256 of the code's UTF-8 bytes and records it, so the trace says which text ran.
|
|
124
|
+
|
|
125
|
+
```ts
|
|
126
|
+
import { FABRIC_PROGRAM_RUN_EVENT, type FabricProgramRunReplyV1 } from "pi-fabric/protocol";
|
|
127
|
+
|
|
128
|
+
pi.events.emit(FABRIC_PROGRAM_RUN_EVENT, {
|
|
129
|
+
code: "return { who: input.who };",
|
|
130
|
+
input: { who: "pi-stack" }, // optional, as for a ref run
|
|
131
|
+
reply: (result: FabricProgramRunReplyV1) => {},
|
|
132
|
+
});
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
- A request with `ref` is a saved-program run and ignores `code`. Without `ref`, the request needs `code`. `requirePromoted` applies only to `ref`.
|
|
136
|
+
- Fabric refuses with one `{ ok: false, error }` reply, before running anything, when `code` is empty or longer than 65 536 characters (the saved-program limit), or there is no active session. A session whose kernel is Python also refuses, because the code is TypeScript. So does a session without the `programs` provider, such as a managed embedded host, because the run goes through `programs.run`.
|
|
137
|
+
- The run takes the saved-program path: a one-call host program invokes `programs.run`, which resolves the code in place of a saved record. A policy that denies `programs.run`, through `approvals.execute` or `approvals.actions["programs.run"]`, refuses a `code` request as it refuses a `ref` request. Actions inside the code face their own approvals. The run has the root capability view, `invokedBy: "host"`, and a `pi-fabric-program-run` message labelled `caller-code:<first 12 hex of the hash>`.
|
|
138
|
+
- The trace records one `fabric.program.run` operation with `args: { program: "caller-code:<full sha256>", invokedBy: "host" }`. The reply's `program` and the message details' `program` carry the same value. The message details also carry `source: "caller-code"` and the full `sha256`, never the code. The `:` is outside the characters a program name may use, so no saved program can share this identity.
|
|
139
|
+
- The code is held for that run only and resolves only inside the host run that supplied it, never for a model's `programs.run`. Nothing is written to the program store. The binding lasts for the whole host execution: a saved program that the code runs can itself call `programs.run` with `caller-code:<sha256>` and reach the same code, under the 16-run nesting budget and the same approvals. It is gone when the run ends, whether it succeeded, threw or was aborted.
|
|
118
140
|
|
|
119
141
|
## Mesh-triggered runs
|
|
120
142
|
|
package/docs/prompt-cache.md
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
## Availability and cost
|
|
6
6
|
|
|
7
|
-
Observations work on ordinary Pi sessions now.
|
|
7
|
+
Observations work on ordinary Pi sessions now. **Scoped warming leases** require the optional native `ctx.acquireCacheWarming("idle")` capability, returning an idempotent release function. The inspected stock Pi 0.87.0/0.87.1 and 1.4.0 SDKs do **not** expose that capability, so lease acquisitions return `unsupported`. This does not disable Pi's own idle cache warmer or Fabric's [spilled-shell decision override](background-tasks.md#prompt-cache-warming-while-yielded). Fabric never simulates warming with prompts, changes global settings, or sends a replacement provider request.
|
|
8
8
|
|
|
9
|
-
No configuration switch is needed. Fabric acquires no warming interest until an explicit approved `cache.hold` or trusted component `cache.lease` acquisition. Native warming settings, including Pi's ordinary streaming policy, are unchanged. Acquisition has `agent` risk and may authorize paid native refreshes for the duration. Pi retains request snapshots, model eligibility, retention tiers, economic decisions, scheduling, and native safety windows. A lease cannot force a refresh or guarantee a cache hit.
|
|
9
|
+
No configuration switch is needed. Fabric acquires no warming interest until an explicit approved `cache.hold` or trusted component `cache.lease` acquisition. The one exception is a decision, not an interest: when Pi's own idle warming is already enabled and a spilled shell will wake this agent, Fabric re-prices Pi's idle refresh at certain continuation (see [background tasks](background-tasks.md#prompt-cache-warming-while-yielded)). Native warming settings, including Pi's ordinary streaming policy, are unchanged. Acquisition has `agent` risk and may authorize paid native refreshes for the duration. Pi retains request snapshots, model eligibility, retention tiers, economic decisions, scheduling, and native safety windows. A lease cannot force a refresh or guarantee a cache hit.
|
|
10
10
|
|
|
11
11
|
## Guest API
|
|
12
12
|
|
|
@@ -87,5 +87,7 @@ A future native bounded-admission protocol would be needed before enabling refre
|
|
|
87
87
|
| Managed host exclusion and Schema read-only boundary | `tests/managed-host-runtime.test.ts`, `tests/cache-provider.test.ts` |
|
|
88
88
|
| Node, Monty, and CPython proxy parity | Their targeted runtime suites |
|
|
89
89
|
| Registration/idle stays lazy; compiled artifacts include first-use path | Startup suites, `assert:lazy-graph`, fresh build |
|
|
90
|
+
| Spilled-shell idle override, savings threshold, interruption/error/branch/close exclusions | `tests/shell-inbox.test.ts` |
|
|
91
|
+
| Native 270-second refresh, replay and usage receipt, completion wakeup, default/off/UI-only exclusions, 30-minute horizon | `tests/shell-cache-warming-sdk.test.ts` |
|
|
90
92
|
|
|
91
93
|
No live cache-hit rate, native lease deployment, or strict spend cap is claimed by these checks.
|
|
@@ -35,7 +35,7 @@ Preparation outputs are snapshotted before validation. Approval, tracing and
|
|
|
35
35
|
speculation callbacks receive separate copies, so they cannot change the owned
|
|
36
36
|
validated payload. Shared backing memory is refused, including buffers hidden
|
|
37
37
|
inside maps, typed views, and native WebAssembly memory. This is a tested host
|
|
38
|
-
adapter contract, not a
|
|
38
|
+
adapter contract, not a proof of JavaScript cloning or schema validation.
|
|
39
39
|
|
|
40
40
|
Tickets are one-use. This is not distributed exactly-once execution or an
|
|
41
41
|
idempotency guarantee for independently retried calls. Arguments must be
|
|
@@ -124,24 +124,25 @@ until a valid snapshot is restored. Complete concatenated snapshots retain their
|
|
|
124
124
|
existing newest-complete-snapshot recovery behavior. Invalid, missing, regressed
|
|
125
125
|
relative to retained history, or exhausted clocks fail closed on mutation.
|
|
126
126
|
|
|
127
|
-
Revisions
|
|
128
|
-
|
|
129
|
-
codec, faithful slot observation, history preservation, cooperative lock, atomic
|
|
127
|
+
Revisions are naturals below `2^53`, the bound the compiled gdp-wired runtime
|
|
128
|
+
enforces, so every nonnegative JS-safe integer is representable without limbs.
|
|
129
|
+
The JSON codec, injective string interning, faithful slot observation, history preservation, cooperative lock, atomic
|
|
130
130
|
rename and cache publication remain host assumptions. These plans do not prove
|
|
131
131
|
crash durability, multi-write state transactions or schema filesystem rollback.
|
|
132
132
|
|
|
133
133
|
## Verification boundary
|
|
134
134
|
|
|
135
|
-
|
|
136
|
-
`provider_ticket_consumed`, `provider_replay_refused`,
|
|
135
|
+
Eight laws cover the executable provider ticket machine (`proofs/provider.ts`):
|
|
136
|
+
`provider_plan_safe`, `provider_ticket_consumed`, `provider_replay_refused`,
|
|
137
137
|
`provider_revocation_consumes`, `provider_revoked_refused`,
|
|
138
|
-
`provider_canceled_refused`,
|
|
139
|
-
|
|
140
|
-
|
|
138
|
+
`provider_canceled_refused`, `state_stale_refused`, and
|
|
139
|
+
`provider_admission_complete`. Keys, revisions and payload slots are interned
|
|
140
|
+
names compared by identity. The proof forwards a payload-slot identifier, not a
|
|
141
|
+
formal representation of arbitrary JavaScript arguments or provider code.
|
|
141
142
|
|
|
142
143
|
| Guarantee | Evidence | Boundary |
|
|
143
144
|
| --- | --- | --- |
|
|
144
|
-
| Exact, one-use dispatch plans | Executable laws, pinned generation and artifact receipt,
|
|
145
|
+
| Exact, one-use dispatch plans | Executable gdp-wired laws, pinned generation and artifact receipt, codec tests and refused broken variants | gdp-wired kernel and compiler, interning codec, and interpreter remain trusted |
|
|
145
146
|
| All registry action routes use the gate | Ordinary/scoped/speculative/replay integration tests and bundled smoke | Direct native calls bypass the registry |
|
|
146
147
|
| Exact authority attenuation/use/release | Executable subset, membership, positive acceptance and release laws; forged/cross-registry/retained-generation tests | JS issuer ownership, tuple codec, hashing and parent-abort delivery remain trusted |
|
|
147
148
|
| Binding lifecycle transitions | Executable admission, count-preservation, exact release and close-reservation laws; real-promise and finalizer tests | Host event delivery, private maps and correspondence to provider-owned work remain trusted |
|
|
@@ -152,7 +153,7 @@ not a formal representation of arbitrary JavaScript arguments or provider code.
|
|
|
152
153
|
| Packaging and lazy loading | Artifact checks, stable lazy entry, cold-import and first-use tests | Supported-platform CI and independent review remain necessary |
|
|
153
154
|
|
|
154
155
|
The host issuer, descriptor truthfulness, hash collision resistance, UUID
|
|
155
|
-
uniqueness,
|
|
156
|
+
uniqueness, string interning codec, private-slot fidelity, interpreter, lifecycle event
|
|
156
157
|
observation, approval hooks, metadata/preparation hooks, compiler and JavaScript
|
|
157
158
|
runtime are trusted assumptions. Metadata hooks are not proved effect-free.
|
|
158
159
|
Compiler checking does not replace independent specification or adapter review.
|
|
@@ -170,7 +171,7 @@ and their precise host assumptions.
|
|
|
170
171
|
### Principal and scope
|
|
171
172
|
|
|
172
173
|
The host-issued [principal and scope](providers.md#principal-and-scope) is trusted
|
|
173
|
-
host adapter code in `src/scope.ts`. No
|
|
174
|
+
host adapter code in `src/scope.ts`. No verified kernel checks it. Grammar parsing,
|
|
174
175
|
digest canonicalization, issuance sealing, registry injection, child derivation and
|
|
175
176
|
cache keying are tested JavaScript. Capability views and scopes are independent: a
|
|
176
177
|
view limits which actions a caller can dispatch, and a scope tells providers which
|
|
@@ -208,8 +209,8 @@ bun run benchmark:provider-dispatch
|
|
|
208
209
|
bun run benchmark:startup . ../pi-fovea ../pi-contour
|
|
209
210
|
```
|
|
210
211
|
|
|
211
|
-
|
|
212
|
-
|
|
212
|
+
`gdp-wired` is pinned as an exact devDependency. Normal builds verify artifact
|
|
213
|
+
hashes without loading the prover.
|
|
213
214
|
|
|
214
215
|
The dispatch benchmark measures first use and warm full-registry read calls
|
|
215
216
|
without provider I/O. Each dispatch observes its descriptor again; measure real
|
package/docs/providers.md
CHANGED
|
@@ -95,6 +95,35 @@ Fabric retires the current binding and drops its owner hold, the same path a com
|
|
|
95
95
|
|
|
96
96
|
Optional `generation` pins the withdrawal to one binding: a number matches the binding generation, a string matches the provider binding id (`providerBindingId` in a committed view). Unknown names, generation mismatches, component-owned providers, and managed-host providers are ignored; set `PI_FABRIC_DEBUG=1` to log ignored withdrawals. Component-owned providers withdraw through their component lifecycle.
|
|
97
97
|
|
|
98
|
+
## Program globals and types
|
|
99
|
+
|
|
100
|
+
A Fabric capability provider (the actions a program calls, not a model provider) that another extension registers, directly, through discovery, or through a component's `context.provide()`, becomes a program global named after the provider. This applies in every kernel: QuickJS, Node, Bun, Monty and CPython. For the provider `context` with the action `task_add`:
|
|
101
|
+
|
|
102
|
+
```ts
|
|
103
|
+
await context.task_add({ title: "Write tests" });
|
|
104
|
+
// is exactly
|
|
105
|
+
await tools.call({ ref: "context.task_add", args: { title: "Write tests" } });
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Python calls it as `await context.task_add(title="Write tests")`. The global is a `tools.call`: the same host call, argument validation, authorization, approvals, audit, trace, deadlines, cancellation, and committed capability view. It adds no authority. Policy that denies the `tools.call` denies the global call too.
|
|
109
|
+
|
|
110
|
+
**Types.** Each action's `inputSchema` is its declaration. Before a TypeScript program that uses the global (`context.` or `context[` in its source) runs, Fabric calls the provider's `list()` and renders the schemas into a typed declaration for the global, so an unknown property on a closed schema (`additionalProperties: false`) or a missing required argument fails type checking. Wrong value types follow the policy for `pi.*` and `mcp.*` calls: the type gate lets them through, and the registry validates them against the schema at dispatch. Jev programs type-check strictly and reject them before the program runs. Results are `any`, so moving a call from `tools.call` to the global never adds a type error. Python programs are not type-checked.
|
|
111
|
+
|
|
112
|
+
**Where types apply.** Schema enforce types the global like any TypeScript program. The native codemode profile gets the global but no type check, because native scripts are plain JavaScript. The catalog read keys on the program text. A program that reaches the global by destructuring (`const { task_add } = context`) or by aliasing it skips the read and sees the loose type below. A local binding named `context` shadows the global, as in any TypeScript program.
|
|
113
|
+
|
|
114
|
+
**A provider without declarations** still gets its global, typed loosely: any action, one argument object, validated at dispatch. This applies when the program does not use the global, when `list()` throws, takes longer than 500 ms, or returns no actions, and to actions beyond 128 per provider or beyond the 60,000-character declaration budget. The global must exist whenever the provider does, so a slow or cold catalog never changes whether a program compiles.
|
|
115
|
+
|
|
116
|
+
**Names.** A global name is a lowercase identifier (`a-z`, `0-9`, `_`) of at most 64 characters. A provider never takes a name that is already used. Reserved names are:
|
|
117
|
+
|
|
118
|
+
- every Fabric global in any kernel, such as `tools`, `pi`, `agents`, `mcp`, `memory`, `workflow`, and `print`
|
|
119
|
+
- every built-in provider, including `tasks`, `sessions`, and `native`
|
|
120
|
+
- the prelude names `input` (saved programs) and `program` (Jev)
|
|
121
|
+
- TypeScript keywords, common JavaScript globals, and Python keywords and builtins
|
|
122
|
+
|
|
123
|
+
`src/provider-globals.ts` holds the list, and a test derives it from the kernels. A provider with a hyphenated or reserved name gets no global. With `PI_FABRIC_DEBUG=1`, Fabric logs one warning per name when it mounts such a provider from a direct or discovery registration, for example `[pi-fabric] Fabric provider "workflow" gets no program global: the name clashes with the Fabric program global "workflow"`. `tools.call` still reaches the provider. A program gets at most 64 provider globals, in name order. A later Fabric release can add a global that an existing provider already uses. That provider then loses its global and keeps `tools.call`. New Fabric globals are added to the list in `src/provider-globals.ts`, and the test fails until they are, so the list does not drift from Fabric itself.
|
|
124
|
+
|
|
125
|
+
**Lifetime.** Fabric takes the list of globals when a program starts. A registration or withdrawal applies from the next program. A provider mounted while a program runs is reachable only through `tools.call` in that program. Under a committed capability view, such as a Jev program's `requires`, only the providers that the view binds get globals, typed from the bound actions without a `list()` call. Speculative pre-launch does not cover provider globals.
|
|
126
|
+
|
|
98
127
|
## Tool placement query
|
|
99
128
|
|
|
100
129
|
Extensions that need to know where a tool is reachable this turn can ask synchronously with `FABRIC_TOOL_PLACEMENT_EVENT` (`pi-fabric:tool-placement:v1`), so they need not guess from Fabric's mode:
|
|
@@ -123,6 +152,10 @@ The reply is `{ version: 1, mode, tools }`. `mode` is `"full-code"`, `"enforce"`
|
|
|
123
152
|
|
|
124
153
|
`model` wins when both apply; optional `programCallable` lists the reported `model` tools that a program can also call, such as foreground tools, and is omitted when empty. Omitting `tools` reports every tool registered with Pi; at most 1,024 names of up to 256 characters each are accepted. An invalid query gets no reply. Placement describes state at the time of the query. A later mode change, reload, or tool refresh can change it, so query when you need the answer and do not cache it.
|
|
125
154
|
|
|
155
|
+
## Compaction owner claim
|
|
156
|
+
|
|
157
|
+
An extension that writes its own compaction summaries claims compaction from Fabric with `FABRIC_COMPACTION_OWNER_EVENT` (`pi-fabric:compaction-owner:v1`). Fabric's compactor and thresholds stand down, `compact.*` program calls route to the owner, and the reply carries a handle with `withdraw()` and Fabric's deterministic `fallback()`, plus Fabric's carry list at cut-over. Fabric loads its claim code on the first message, so the reply may arrive after `emit` returns: wait with a timeout, abort the claim's `signal` when giving up, and withdraw a grant that arrives late. Owner handlers receive `{ context, signal }` and are bounded at 30 seconds. One claim is held at a time; withdrawal, the claim's abort signal, or Fabric's `session_shutdown` ends it. See [compaction owner claim](programmatic-compaction.md#compaction-owner-claim).
|
|
158
|
+
|
|
126
159
|
## Invocation costs and guarantees
|
|
127
160
|
|
|
128
161
|
| Access pattern | Work and allocation | Guarantees |
|
|
@@ -174,8 +207,14 @@ pi.events.emit(FABRIC_PROGRAM_RUN_EVENT, {
|
|
|
174
207
|
});
|
|
175
208
|
```
|
|
176
209
|
|
|
210
|
+
To run program text the caller built, pass `code` with no `ref`. The run goes through `programs.run` like a saved program, so the same approval and trace apply; see [Running caller-supplied code](programs.md#running-caller-supplied-code).
|
|
211
|
+
|
|
177
212
|
The run has the same semantics as `/fabric run`: the session's root capability view, the configured approval policy, a `pi-fabric-program-run` transcript message, and `invokedBy: "host"` in the trace. `reply` is called exactly once with `{ ok: true, program, value, logs }` or `{ ok: false, error, program? }`.
|
|
178
213
|
|
|
214
|
+
## Decision request events
|
|
215
|
+
|
|
216
|
+
An extension with no screen to ask on, such as a question tool in a headless session, can hand a question to a person. `pi-fabric:decisions:capability:v1` (`FABRIC_DECISIONS_CAPABILITY_EVENT`) reports whether user-held decisions are available and their limits. `pi-fabric:decisions:request:v1` (`FABRIC_DECISION_REQUEST_EVENT`) raises a `kind: "question"` decision held by `"user"` and responds once a person answers or cancels it, or it expires. Both use the claim/respond shape and are exported from `pi-fabric/protocol`. See [Extension questions](decisions.md#extension-questions) for the fields and guarantees. An extension with a richer question interface can also show Fabric's own decisions: register it with `pi-fabric:question-renderer:register:v1` (`FABRIC_QUESTION_RENDERER_REGISTER_EVENT`); see [Question renderers](decisions.md#question-renderers).
|
|
217
|
+
|
|
179
218
|
## Managed embedded hosts
|
|
180
219
|
|
|
181
220
|
Trusted embedding code can opt into a closed-world provider authority:
|
|
@@ -183,7 +222,7 @@ Trusted embedding code can opt into a closed-world provider authority:
|
|
|
183
222
|
```ts
|
|
184
223
|
import piFabric, { FABRIC_MANAGED_HOST_VERSION } from "pi-fabric";
|
|
185
224
|
|
|
186
|
-
if (FABRIC_MANAGED_HOST_VERSION !==
|
|
225
|
+
if (FABRIC_MANAGED_HOST_VERSION !== 2) throw new Error("Unsupported managed host");
|
|
187
226
|
await piFabric(pi, { managedHost: { providers: ["agents", "memory", "compact"] } });
|
|
188
227
|
// Register all three host-owned implementations using the v1 registration event before activation.
|
|
189
228
|
```
|
|
@@ -196,8 +235,29 @@ idempotent; changing an implementation after activation requires a new host. Pro
|
|
|
196
235
|
one host lifetime, and `close()` is awaited once after final publication withdrawal.
|
|
197
236
|
|
|
198
237
|
Managed mode ignores ambient configuration and fixes execution to full-code TypeScript QuickJS.
|
|
238
|
+
The v2 factory adds optional controls; `{ providers }` alone remains valid:
|
|
239
|
+
|
|
240
|
+
```ts
|
|
241
|
+
await piFabric(pi, { managedHost: {
|
|
242
|
+
providers: ["mcp"],
|
|
243
|
+
foreground: ["ask_user_questions", "ai_todo_write", "run_delegated_task"],
|
|
244
|
+
guidance: "Apply the host's workflow and receipt-reconciliation policy.",
|
|
245
|
+
skillReader: "mcp.files.read",
|
|
246
|
+
executor: { maxCpuSliceMs: 1000 },
|
|
247
|
+
compaction: "pi",
|
|
248
|
+
} });
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
- `foreground` defaults to `[]`. Up to eight exact registered names can remain declared beside `fabric_exec`; Pi exposure, active-set and inherited allowlist checks still apply. Direct calls keep the same `tool_call` hooks and approval ref, prompt-cache fence and [placement reporting](#tool-placement-query). `model-only` tools do not gain a program-callable path.
|
|
252
|
+
- Stable execution guidance names only the host-authorized provider namespaces and is emitted once through the execution-guidance slot. Tool and `code` descriptions stay short and refer to it. `guidance` appends trusted host instructions once to the system prompt; the existing execution guidance slot can still replace the default. Provider registration remains v1: its event and payload do not change.
|
|
253
|
+
- `skillReader` names the host's dotted callable reader, for example `mcp.files.read`. Without it, Fabric omits its skill-loading instruction and delegated-skill hint. Managed hosts supply their own skill resources; Fabric does not contribute bundled coding workflows.
|
|
254
|
+
- `executor.maxCpuSliceMs` defaults to `1000`, must be a positive safe integer, and limits uninterrupted guest CPU, not host-provider execution. Whole-program timeouts remain separate.
|
|
255
|
+
- `compaction` is `"fabric"` by default, preserving existing behavior; `"pi"` leaves compaction to the embedding host and its saved formats.
|
|
256
|
+
|
|
257
|
+
Options are copied when the host is created. Later mutation of the caller's arrays or executor object cannot widen the host policy. See the [migration and changelog](managed-host-migration.md).
|
|
258
|
+
|
|
199
259
|
Native MCP, agent spawning, mesh, filesystem memory discovery, schema effects, speculative work,
|
|
200
|
-
prewalk, repairs, entropy compilation, and model-visible component control are unavailable.
|
|
260
|
+
prewalk, repairs, entropy compilation, Jev, and model-visible component control are unavailable.
|
|
201
261
|
A supplied memory implementation remains discoverable without enabling native memory scanning.
|
|
202
262
|
Every pinned component activation/reload uses the same host replacement; it cannot resurrect a
|
|
203
263
|
native provider. Non-core providers omitted from the host list expose no actions. Pi core calls
|
|
@@ -209,6 +269,36 @@ The host remains responsible for OS isolation, resource loading, broker authoriz
|
|
|
209
269
|
cancellation, and for exposing only trusted extension code. This option does not sandbox arbitrary
|
|
210
270
|
host-side extensions. In particular, do not auto-load plugins from the agent's computer snapshot.
|
|
211
271
|
|
|
272
|
+
## Host policy
|
|
273
|
+
|
|
274
|
+
An extension that embeds Fabric for a restricted agent, such as a worker runner, can narrow that Fabric instance with `FABRIC_HOST_POLICY_EVENT` (`pi-fabric:host-policy:v1`). Unlike `managedHost`, it works for a Fabric that Pi's resource loader loaded, because no factory call is needed. Send it from the host's extension factory, before the instance runs anything. Fabric replies before `emit` returns:
|
|
275
|
+
|
|
276
|
+
```ts
|
|
277
|
+
import { FABRIC_HOST_POLICY_EVENT, type FabricHostPolicyReplyV1 } from "pi-fabric";
|
|
278
|
+
|
|
279
|
+
let reply: FabricHostPolicyReplyV1 | undefined;
|
|
280
|
+
pi.events.emit(FABRIC_HOST_POLICY_EVENT, {
|
|
281
|
+
policy: { owner: "my-host", reason: "read-only worker", deniedTools: ["write", "edit"], allowedRefs: ["agents.status"] },
|
|
282
|
+
reply: (value: FabricHostPolicyReplyV1) => { reply = value; },
|
|
283
|
+
});
|
|
284
|
+
if (!reply?.accepted) {
|
|
285
|
+
// Fabric is absent, too old, already sealed, or refused the policy: do not expose fabric_exec.
|
|
286
|
+
}
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
An accepted reply is `{ version: 1, accepted: true, digest, enforced }`. `enforced` lists every policy field this build enforces. `digest` is a SHA-256 over the accepted policy. A refusal is `{ version: 1, accepted: false, reason }`. Fabric refuses a policy that is malformed, names a field it does not enforce, follows an earlier accepted policy, or arrives after the instance ran a program or a provider call. A request without a `reply` function gets no answer.
|
|
290
|
+
|
|
291
|
+
The policy is sealed on the first program or provider call. It cannot be replaced, widened or added to after that, so no call admitted before the policy can run under it. It lasts as long as the extension instance: a new session on the same instance keeps it, and `/reload` creates a new instance that starts without one.
|
|
292
|
+
|
|
293
|
+
Fabric decides from the `provider.action` ref as the program wrote it, before any provider code runs, including `describe`, `list` and `prepareArguments`. When Fabric repairs a misspelled name, such as `pi.Write` or `pi.save` for `pi.write`, it calls the provider's `describe` and `list` to find the canonical action, then decides again on that action before `prepareArguments` or the provider runs. A repaired name never reaches an action the policy refuses:
|
|
294
|
+
|
|
295
|
+
- `deniedTools` refuses those names through `pi.*` and `extensions.*`. Each entry is a tool name of letters, digits, `_` and `-`. Other `pi.*` and `extensions.*` calls replay Pi `tool_call` hooks, so the host's own guards see them. While a policy is active, a non-read `pi.*` tool fails closed when no hook runner exists.
|
|
296
|
+
- `deniedProviders` refuses whole providers. Each entry must be a valid provider name: lowercase letters, digits, `_` and `-`, starting with a letter. A policy with an entry that breaks either rule, such as `"MCP"` or `"mcp "`, is refused whole.
|
|
297
|
+
- Every other action is refused unless it matches a host `allowedRefs` entry or is one of Fabric's fixed built-in read-only actions. An entry is an exact ref, or a prefix ending in `.*`, such as `mcp.docs.*`. The fixed set is `cache.status`, `compact.pressure`, `compact.status`, `components.describe`, `components.graph`, `components.list`, `components.status`, `memory.expand`, `memory.recall`, `memory.sessions`, `programs.get`, `programs.list`, `schema.status`, `state.get`, `state.history` and `thinking.status`. Third parties cannot register those provider names. Fabric never uses a provider's own `risk` label to allow an action.
|
|
298
|
+
- Native executors (CPython, `node-process`, `bun-process`) are refused, because they run outside every tool hook.
|
|
299
|
+
|
|
300
|
+
Refused actions and providers are left out of listings, search, catalogs and program type declarations.
|
|
301
|
+
|
|
212
302
|
## Principal and scope
|
|
213
303
|
|
|
214
304
|
A host can attach a principal and resource grants to a Fabric session. Fabric propagates them and narrows them for children. Providers and adapters enforce them. A program can never set or widen a principal.
|
|
@@ -317,7 +407,13 @@ export default function resultGuard(pi: ExtensionAPI) {
|
|
|
317
407
|
}
|
|
318
408
|
```
|
|
319
409
|
|
|
320
|
-
If you change only `content`,
|
|
410
|
+
If you change only `content`, a string result becomes the patched text. For a structured result (an array, object, number, boolean, or null), the patch applies as follows:
|
|
411
|
+
|
|
412
|
+
- Patched text that still parses as JSON, as it does after a redactor replaces a secret inside the serialized value, gives the program the parsed value.
|
|
413
|
+
- A cut-off projection keeps the original value. A cut-off projection keeps the start of the JSON text, at least half of the patched text, and drops the rest, as a generic output cap does when it appends a marker. Applying that text would give the program a truncated string where it expects the value. `maxNestedResultChars` still bounds the value.
|
|
414
|
+
- Any other patch replaces the value, as for a string result. A placeholder such as `[REDACTED]` reaches the program as that text, so middleware that hides a result never fails open.
|
|
415
|
+
|
|
416
|
+
To replace a structured result with another value, return the proxy envelope in `details` with a changed `result`, as in the example above. When both fields are patched, a valid changed `details.result` takes precedence. Returning `isError: true` fails the nested provider invocation for any result.
|
|
321
417
|
|
|
322
418
|
Pi core tools and captured extension tools skip this generic proxy, because they already replay their native `tool_call`, `tool_result`, and `tool_execution_*` lifecycle. Nested shell calls still emit their native identity: `pi.bash()` uses `toolName: "bash"`/`isBashToolResult()`, while `pi.powershell()` uses `toolName: "powershell"`/`isPowerShellToolResult()`. Proxied events act as middleware only. They create no separate persisted tool-result messages.
|
|
323
419
|
|
|
@@ -22,6 +22,21 @@ standalone jev-fabric without being rewritten.
|
|
|
22
22
|
Linux). Durable batch tasks still run through `pi.bash` and its middleware;
|
|
23
23
|
interactive children run outside `pi.bash`, so they are unavailable while an
|
|
24
24
|
extension overrides `bash`. This preserves the extension's gate.
|
|
25
|
+
- Extensions that guard the shell in a `tool_call` hook still see interactive
|
|
26
|
+
children. `sessions.open` emits a `bash` `tool_call` with the command (`cmd`,
|
|
27
|
+
or `argv` joined as a shell-quoted line), `cwd` and `parentToolCallId`, and a
|
|
28
|
+
block stops the open before anything starts. `sessions.write` emits one for
|
|
29
|
+
each write to a session that runs a shell, with the text as `command`; a block
|
|
30
|
+
means nothing is written. A `cmd` session always counts as a shell, and so does
|
|
31
|
+
an `argv` with any word that names a shell or a program that hosts one (`sh`,
|
|
32
|
+
`bash`, `zsh` and similar, `env bash`, `ssh`, `sudo`, `tmux`). A command split
|
|
33
|
+
across writes is judged as one line: the hook sees the unfinished line before
|
|
34
|
+
the new text. A hook may rewrite `cmd`, but a rewrite of `argv`, of written
|
|
35
|
+
text or of `cwd` is refused, since none can be replaced after the guard has
|
|
36
|
+
judged it. Writes to other children, such as a REPL or a harness `serve`, send
|
|
37
|
+
data and are not preflighted. The preflight fails closed: a hook that throws refuses the call, sessions are
|
|
38
|
+
refused until extension hooks have initialized, and a confined child whose
|
|
39
|
+
write policy denies the shell cannot open them.
|
|
25
40
|
- A Jev program's interactive `session` children end whenever the program ends.
|
|
26
41
|
`fabric_exec` children stay with the Pi session, like background tasks.
|
|
27
42
|
|