@e4779/pi-fabric 0.117.2-fork.31 → 0.131.4-fork.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -6
- package/THIRD_PARTY_NOTICES.md +6 -14
- package/dist/activity/store.d.ts +2 -1
- package/dist/activity/store.d.ts.map +1 -1
- package/dist/actors/binding-store.d.ts +13 -0
- package/dist/actors/binding-store.d.ts.map +1 -1
- package/dist/actors/directory.d.ts.map +1 -1
- package/dist/actors/feedback.d.ts +5 -0
- package/dist/actors/feedback.d.ts.map +1 -0
- package/dist/actors/global-registry.d.ts +8 -0
- package/dist/actors/global-registry.d.ts.map +1 -1
- package/dist/actors/host-event-payload.d.ts +14 -0
- package/dist/actors/host-event-payload.d.ts.map +1 -1
- package/dist/actors/manager.d.ts +4 -3
- package/dist/actors/manager.d.ts.map +1 -1
- package/dist/actors/mesh-monitor.d.ts +2 -0
- package/dist/actors/mesh-monitor.d.ts.map +1 -1
- package/dist/actors/name-policy.d.ts +3 -0
- package/dist/actors/name-policy.d.ts.map +1 -0
- package/dist/actors/registry-store.d.ts +14 -5
- package/dist/actors/registry-store.d.ts.map +1 -1
- package/dist/actors/store-read.d.ts +16 -0
- package/dist/actors/store-read.d.ts.map +1 -0
- package/dist/agents/agent-files.d.ts +80 -0
- package/dist/agents/agent-files.d.ts.map +1 -0
- package/dist/agents/agent-files.js +327 -0
- package/dist/agents/agent-files.js.map +7 -0
- package/dist/agents/child-skills.d.ts +60 -0
- package/dist/agents/child-skills.d.ts.map +1 -0
- package/dist/agents/child-skills.js +94 -0
- package/dist/agents/child-skills.js.map +7 -0
- package/dist/agents/clone-first-worktree.d.ts +6 -0
- package/dist/agents/clone-first-worktree.d.ts.map +1 -1
- package/dist/agents/completion-inbox.d.ts.map +1 -1
- package/dist/agents/cow-clone.d.ts.map +1 -1
- package/dist/agents/handoff.d.ts +12 -2
- package/dist/agents/handoff.d.ts.map +1 -1
- package/dist/agents/herdr-status.d.ts +26 -0
- package/dist/agents/herdr-status.d.ts.map +1 -0
- package/dist/agents/herdr-status.js +161 -0
- package/dist/agents/herdr-status.js.map +7 -0
- package/dist/agents/hosted-run.d.ts +20 -4
- package/dist/agents/hosted-run.d.ts.map +1 -1
- package/dist/agents/manager.d.ts +18 -2
- package/dist/agents/manager.d.ts.map +1 -1
- package/dist/agents/model-pin-guard.d.ts +27 -0
- package/dist/agents/model-pin-guard.d.ts.map +1 -0
- package/dist/agents/model-pin-guard.js +86 -0
- package/dist/agents/model-pin-guard.js.map +7 -0
- package/dist/agents/model-pin.d.ts +25 -0
- package/dist/agents/model-pin.d.ts.map +1 -0
- package/dist/agents/provider-bridge.d.ts +7 -6
- package/dist/agents/provider-bridge.d.ts.map +1 -1
- package/dist/agents/provider-bridge.js +33 -5
- package/dist/agents/provider-bridge.js.map +3 -3
- package/dist/agents/request.d.ts.map +1 -1
- package/dist/agents/result.d.ts.map +1 -1
- package/dist/agents/result.js +1 -1
- package/dist/agents/runner-notice.d.ts.map +1 -1
- package/dist/agents/runner-protocol.d.ts +8 -0
- package/dist/agents/runner-protocol.d.ts.map +1 -1
- package/dist/agents/service-schema.d.ts.map +1 -1
- package/dist/agents/transports/herdr-core-socket.d.ts +13 -0
- package/dist/agents/transports/herdr-core-socket.d.ts.map +1 -0
- package/dist/agents/transports/herdr-core-transport.d.ts +10 -0
- package/dist/agents/transports/herdr-core-transport.d.ts.map +1 -0
- package/dist/agents/transports/herdr-socket.d.ts +12 -0
- package/dist/agents/transports/herdr-socket.d.ts.map +1 -0
- package/dist/agents/transports/herdr-transport.d.ts.map +1 -1
- package/dist/agents/types.d.ts +51 -0
- package/dist/agents/types.d.ts.map +1 -1
- package/dist/agents/worker-recovery.d.ts +75 -0
- package/dist/agents/worker-recovery.d.ts.map +1 -0
- package/dist/agents/worktree-manager.d.ts.map +1 -1
- package/dist/agents.js +12 -11
- package/dist/agents.js.map +2 -2
- package/dist/audit/details.d.ts +38 -1
- package/dist/audit/details.d.ts.map +1 -1
- package/dist/audit/projection.d.ts.map +1 -1
- package/dist/audit/trace-schema.d.ts +50 -0
- package/dist/audit/trace-schema.d.ts.map +1 -0
- package/dist/audit/trace.d.ts +2 -48
- package/dist/audit/trace.d.ts.map +1 -1
- package/dist/chunks/chunk-2RWNVCFD.js +483 -0
- package/dist/chunks/chunk-2RWNVCFD.js.map +7 -0
- package/dist/chunks/chunk-2SCMGO2Z.js +16 -0
- package/dist/chunks/chunk-2SCMGO2Z.js.map +7 -0
- package/dist/chunks/chunk-35EEGOH3.js +324 -0
- package/dist/chunks/chunk-35EEGOH3.js.map +7 -0
- package/dist/chunks/{chunk-UTOBAZ5T.js → chunk-37NIOSVU.js} +1 -1
- package/dist/chunks/chunk-37NIOSVU.js.map +7 -0
- package/dist/chunks/chunk-3IJEQBFS.js +25 -0
- package/dist/chunks/chunk-3IJEQBFS.js.map +7 -0
- package/dist/chunks/{chunk-EHQQ4KCX.js → chunk-3MOY6WIB.js} +84 -19
- package/dist/chunks/chunk-3MOY6WIB.js.map +7 -0
- package/dist/chunks/chunk-3VK6UGAN.js +64 -0
- package/dist/chunks/chunk-3VK6UGAN.js.map +7 -0
- package/dist/chunks/{chunk-ROTCDDOV.js → chunk-3XT5WHSG.js} +59 -119
- package/dist/chunks/chunk-3XT5WHSG.js.map +7 -0
- package/dist/chunks/{chunk-FIDUHKMM.js → chunk-4BYS4ZLY.js} +16 -16
- package/dist/chunks/chunk-4BYS4ZLY.js.map +7 -0
- package/dist/chunks/{chunk-UOM37PE4.js → chunk-4PBW54I2.js} +162 -92
- package/dist/chunks/chunk-4PBW54I2.js.map +7 -0
- package/dist/chunks/{chunk-ZEXCKK4K.js → chunk-4WKD3YM3.js} +3 -3
- package/dist/chunks/{chunk-PK4NIJEV.js → chunk-4XMXFHAR.js} +62 -3
- package/dist/chunks/chunk-4XMXFHAR.js.map +7 -0
- package/dist/chunks/{chunk-4EW7GVUR.js → chunk-56NMRVTV.js} +589 -377
- package/dist/chunks/chunk-56NMRVTV.js.map +7 -0
- package/dist/chunks/chunk-5QJFDKPN.js +179 -0
- package/dist/chunks/chunk-5QJFDKPN.js.map +7 -0
- package/dist/chunks/{chunk-P7CBPPHY.js → chunk-6GWDGTHC.js} +5 -5
- package/dist/chunks/{chunk-P7CBPPHY.js.map → chunk-6GWDGTHC.js.map} +1 -1
- package/dist/chunks/chunk-6HO2IUQ5.js +104 -0
- package/dist/chunks/chunk-6HO2IUQ5.js.map +7 -0
- package/dist/chunks/chunk-6OGYPHNQ.js +62 -0
- package/dist/chunks/chunk-6OGYPHNQ.js.map +7 -0
- package/dist/chunks/{chunk-G4TLWHRS.js → chunk-7N7IC3Z2.js} +4 -3
- package/dist/chunks/{chunk-G4TLWHRS.js.map → chunk-7N7IC3Z2.js.map} +2 -2
- package/dist/chunks/{chunk-5XBYFSI5.js → chunk-7YNE4NB2.js} +2 -2
- package/dist/chunks/chunk-ASOJYFKU.js +1316 -0
- package/dist/chunks/chunk-ASOJYFKU.js.map +7 -0
- package/dist/chunks/{chunk-NTC2MCB6.js → chunk-B5L3X3ID.js} +1 -1
- package/dist/chunks/{chunk-NTC2MCB6.js.map → chunk-B5L3X3ID.js.map} +1 -1
- package/dist/chunks/chunk-BIBRWZWQ.js +325 -0
- package/dist/chunks/chunk-BIBRWZWQ.js.map +7 -0
- package/dist/chunks/{chunk-K6QXUGS5.js → chunk-BMAEZNZ5.js} +2 -1
- package/dist/chunks/{chunk-FSB2VIRZ.js → chunk-CBIV747V.js} +14 -3
- package/dist/chunks/chunk-CBIV747V.js.map +7 -0
- package/dist/chunks/{chunk-CCHZXF6K.js → chunk-CXYJJ3HZ.js} +3 -3
- package/dist/chunks/{chunk-R2XQ6AHT.js → chunk-DGERP4VL.js} +22 -10
- package/dist/chunks/chunk-DGERP4VL.js.map +7 -0
- package/dist/chunks/{chunk-C7Z6F3SO.js → chunk-DGUXJSYA.js} +64 -33
- package/dist/chunks/chunk-DGUXJSYA.js.map +7 -0
- package/dist/chunks/chunk-F2LGSRIN.js +38 -0
- package/dist/chunks/chunk-F2LGSRIN.js.map +7 -0
- package/dist/chunks/chunk-F6A6MQ6G.js +609 -0
- package/dist/chunks/chunk-F6A6MQ6G.js.map +7 -0
- package/dist/chunks/{chunk-IR3PIHJM.js → chunk-FK73YJKV.js} +67 -2
- package/dist/chunks/chunk-FK73YJKV.js.map +7 -0
- package/dist/chunks/{chunk-XCEEQ5AB.js → chunk-G2DZJ5LK.js} +1607 -1567
- package/dist/chunks/chunk-G2DZJ5LK.js.map +7 -0
- package/dist/chunks/{chunk-VYQV5JRT.js → chunk-GJVKEHDL.js} +2 -2
- package/dist/chunks/chunk-GJVKEHDL.js.map +7 -0
- package/dist/chunks/{chunk-TIIIHPHF.js → chunk-GS67KDMV.js} +2 -2
- package/dist/chunks/{chunk-D5NYNIST.js → chunk-H57KPL3V.js} +5 -5
- package/dist/chunks/{chunk-KVYNGDGC.js → chunk-HFDJWLMS.js} +6 -6
- package/dist/chunks/{chunk-KVYNGDGC.js.map → chunk-HFDJWLMS.js.map} +1 -1
- package/dist/chunks/{chunk-INRXG4J5.js → chunk-HGD75NZY.js} +2 -2
- package/dist/chunks/{chunk-CRRUW26I.js → chunk-HRDMBGMY.js} +12 -12
- package/dist/chunks/{chunk-CRRUW26I.js.map → chunk-HRDMBGMY.js.map} +2 -2
- package/dist/chunks/{chunk-GO32KSEZ.js → chunk-HRVYXRWZ.js} +85 -10
- package/dist/chunks/chunk-HRVYXRWZ.js.map +7 -0
- package/dist/chunks/{chunk-MLLYR3Y6.js → chunk-HSEZPCL5.js} +19 -78
- package/dist/chunks/chunk-HSEZPCL5.js.map +7 -0
- package/dist/chunks/chunk-JMUUNW2H.js +65 -0
- package/dist/chunks/chunk-JMUUNW2H.js.map +7 -0
- package/dist/chunks/{chunk-UXIBKMUM.js → chunk-KIFOEBYJ.js} +4 -4
- package/dist/chunks/{chunk-3FJUP3GV.js → chunk-L6H46CPY.js} +2 -2
- package/dist/chunks/{chunk-SPCJXN4K.js → chunk-LKYLD5SN.js} +298 -65
- package/dist/chunks/chunk-LKYLD5SN.js.map +7 -0
- package/dist/chunks/{chunk-K7J2ABAZ.js → chunk-LRSZFYUC.js} +92 -32
- package/dist/chunks/chunk-LRSZFYUC.js.map +7 -0
- package/dist/chunks/{chunk-GIK2WNAK.js → chunk-LZ2ZXOCU.js} +112 -23
- package/dist/chunks/chunk-LZ2ZXOCU.js.map +7 -0
- package/dist/chunks/{chunk-FUY6XVRX.js → chunk-MPMEK3IQ.js} +2 -2
- package/dist/chunks/{chunk-HP5P7NBO.js → chunk-MSDL7U6Q.js} +4 -4
- package/dist/chunks/{chunk-ASSLHWZS.js → chunk-MX53BRAC.js} +2 -2
- package/dist/chunks/chunk-N7ZAK2PB.js +132 -0
- package/dist/chunks/chunk-N7ZAK2PB.js.map +7 -0
- package/dist/chunks/{chunk-VSDUSNIA.js → chunk-NBIYYMKS.js} +8 -2
- package/dist/chunks/chunk-NBIYYMKS.js.map +7 -0
- package/dist/chunks/chunk-NENQZCGW.js +45 -0
- package/dist/chunks/chunk-NENQZCGW.js.map +7 -0
- package/dist/chunks/chunk-NJHJKINP.js +47 -0
- package/dist/chunks/chunk-NJHJKINP.js.map +7 -0
- package/dist/chunks/{chunk-U366I5K2.js → chunk-NQ7IWEIF.js} +18 -6
- package/dist/chunks/chunk-NQ7IWEIF.js.map +7 -0
- package/dist/chunks/{chunk-ZQMBS5SH.js → chunk-OJ4HAALD.js} +15 -12
- package/dist/chunks/chunk-OJ4HAALD.js.map +7 -0
- package/dist/chunks/chunk-OZCJU3PZ.js +33 -0
- package/dist/chunks/chunk-OZCJU3PZ.js.map +7 -0
- package/dist/chunks/chunk-P3DCXKL3.js +40 -0
- package/dist/chunks/chunk-P3DCXKL3.js.map +7 -0
- package/dist/chunks/chunk-P7YSPKTM.js +294 -0
- package/dist/chunks/chunk-P7YSPKTM.js.map +7 -0
- package/dist/chunks/chunk-PQVUMJ5J.js +223 -0
- package/dist/chunks/chunk-PQVUMJ5J.js.map +7 -0
- package/dist/chunks/chunk-PUBHBEYO.js +84 -0
- package/dist/chunks/chunk-PUBHBEYO.js.map +7 -0
- package/dist/chunks/{chunk-P4KH4S4S.js → chunk-QGTD3LAZ.js} +5 -20
- package/dist/chunks/chunk-QGTD3LAZ.js.map +7 -0
- package/dist/chunks/{chunk-TIJ3YQXX.js → chunk-QOEOKW2X.js} +2 -2
- package/dist/chunks/{chunk-TIJ3YQXX.js.map → chunk-QOEOKW2X.js.map} +1 -1
- package/dist/chunks/{chunk-QT4W5YVB.js → chunk-RAA3FAYZ.js} +2 -2
- package/dist/chunks/{chunk-3UGN25XS.js → chunk-RKJPBTBB.js} +98 -1664
- package/dist/chunks/chunk-RKJPBTBB.js.map +7 -0
- package/dist/chunks/{chunk-WJJXODAB.js → chunk-RLKRZXSX.js} +8 -1
- package/dist/chunks/{chunk-WJJXODAB.js.map → chunk-RLKRZXSX.js.map} +2 -2
- package/dist/chunks/chunk-RWKQ5SRW.js +129 -0
- package/dist/chunks/chunk-RWKQ5SRW.js.map +7 -0
- package/dist/chunks/chunk-SW25R47N.js +71 -0
- package/dist/chunks/chunk-SW25R47N.js.map +7 -0
- package/dist/chunks/{chunk-EKODKR6Y.js → chunk-TEMKDJJY.js} +148 -72
- package/dist/chunks/chunk-TEMKDJJY.js.map +7 -0
- package/dist/chunks/{chunk-EFETPXU2.js → chunk-TJZYM2SP.js} +118 -237
- package/dist/chunks/chunk-TJZYM2SP.js.map +7 -0
- package/dist/chunks/{chunk-53N2I4QA.js → chunk-TXCNZCZP.js} +2 -2
- package/dist/chunks/{chunk-LNASO4VT.js → chunk-U6Y6TKJL.js} +45 -20
- package/dist/chunks/chunk-U6Y6TKJL.js.map +7 -0
- package/dist/chunks/chunk-UD7LFV43.js +28 -0
- package/dist/chunks/chunk-UD7LFV43.js.map +7 -0
- package/dist/chunks/{chunk-7QKKLBHJ.js → chunk-UPMWLOKL.js} +10 -1
- package/dist/chunks/{chunk-7QKKLBHJ.js.map → chunk-UPMWLOKL.js.map} +2 -2
- package/dist/chunks/chunk-V4OW2ULC.js +422 -0
- package/dist/chunks/chunk-V4OW2ULC.js.map +7 -0
- package/dist/chunks/{chunk-FE6NOAO7.js → chunk-VGRUWTMG.js} +1993 -659
- package/dist/chunks/chunk-VGRUWTMG.js.map +7 -0
- package/dist/chunks/{chunk-PYFJW3HC.js → chunk-W5FEHVZA.js} +2 -16
- package/dist/chunks/{chunk-PYFJW3HC.js.map → chunk-W5FEHVZA.js.map} +3 -3
- package/dist/chunks/chunk-WKFRGICG.js +101 -0
- package/dist/chunks/chunk-WKFRGICG.js.map +7 -0
- package/dist/chunks/{chunk-LEU5CDSL.js → chunk-XFOSUGLU.js} +5 -5
- package/dist/chunks/{chunk-MZUC6LLH.js → chunk-XMYG2TKR.js} +4 -4
- package/dist/chunks/{chunk-MZUC6LLH.js.map → chunk-XMYG2TKR.js.map} +1 -1
- package/dist/chunks/chunk-YC65P7ZO.js +57 -0
- package/dist/chunks/chunk-YC65P7ZO.js.map +7 -0
- package/dist/chunks/{chunk-5UBRGTVN.js → chunk-ZHROHNEE.js} +31 -15
- package/dist/chunks/chunk-ZHROHNEE.js.map +7 -0
- package/dist/cli/decisions.d.ts.map +1 -1
- package/dist/cli/decisions.js +15 -3
- package/dist/cli/decisions.js.map +2 -2
- package/dist/cli/mesh.js +4 -3
- package/dist/cli/mesh.js.map +1 -1
- package/dist/commands/fabric-handler.d.ts +7 -0
- package/dist/commands/fabric-handler.d.ts.map +1 -0
- package/dist/commands/fabric-handler.js +916 -0
- package/dist/commands/fabric-handler.js.map +7 -0
- package/dist/commands/fabric.d.ts +11 -1
- package/dist/commands/fabric.d.ts.map +1 -1
- package/dist/compaction/claim-events.d.ts +61 -0
- package/dist/compaction/claim-events.d.ts.map +1 -0
- package/dist/compaction/claim-events.js +210 -0
- package/dist/compaction/claim-events.js.map +7 -0
- package/dist/compaction/claim.d.ts +51 -0
- package/dist/compaction/claim.d.ts.map +1 -0
- package/dist/compaction/hook.d.ts +28 -2
- package/dist/compaction/hook.d.ts.map +1 -1
- package/dist/compaction/hook.js +12 -7
- package/dist/compaction/owner.js +9 -8
- package/dist/compaction/trace-events.d.ts +1 -1
- package/dist/compaction/trace-events.d.ts.map +1 -1
- package/dist/components/configuration.js +6 -6
- package/dist/components/effect-scope.d.ts.map +1 -1
- package/dist/config.d.ts +40 -3
- package/dist/config.d.ts.map +1 -1
- package/dist/core/action-arguments.d.ts.map +1 -1
- package/dist/core/action-policy-hooks.d.ts +69 -0
- package/dist/core/action-policy-hooks.d.ts.map +1 -0
- package/dist/core/action-registry.d.ts +31 -10
- package/dist/core/action-registry.d.ts.map +1 -1
- package/dist/core/action-registry.js +12 -9
- package/dist/core/approval-controller.d.ts +23 -3
- package/dist/core/approval-controller.d.ts.map +1 -1
- package/dist/core/atomic-write.d.ts +164 -0
- package/dist/core/atomic-write.d.ts.map +1 -1
- package/dist/core/call-presentation.d.ts +14 -0
- package/dist/core/call-presentation.d.ts.map +1 -0
- package/dist/core/child-tool-allowlist.d.ts +17 -1
- package/dist/core/child-tool-allowlist.d.ts.map +1 -1
- package/dist/core/compact-controller.d.ts +34 -0
- package/dist/core/compact-controller.d.ts.map +1 -1
- package/dist/core/core-override-guidance.d.ts +3 -1
- package/dist/core/core-override-guidance.d.ts.map +1 -1
- package/dist/core/file-lock.d.ts.map +1 -1
- package/dist/core/foreground-tools.d.ts +4 -1
- package/dist/core/foreground-tools.d.ts.map +1 -1
- package/dist/core/host-policy.d.ts +43 -0
- package/dist/core/host-policy.d.ts.map +1 -0
- package/dist/core/host-sdk-runtime.d.ts.map +1 -1
- package/dist/core/host-sdk.d.ts.map +1 -1
- package/dist/core/host-sdk.js +1 -1
- package/dist/core/managed-host-guidance.d.ts +5 -0
- package/dist/core/managed-host-guidance.d.ts.map +1 -0
- package/dist/core/model-aliases.d.ts +22 -0
- package/dist/core/model-aliases.d.ts.map +1 -0
- package/dist/core/model-resolution.d.ts +41 -20
- package/dist/core/model-resolution.d.ts.map +1 -1
- package/dist/core/native-tool-result.d.ts +1 -0
- package/dist/core/native-tool-result.d.ts.map +1 -1
- package/dist/core/program-tasks.d.ts +52 -0
- package/dist/core/program-tasks.d.ts.map +1 -0
- package/dist/core/prompt-guidance.d.ts +5 -0
- package/dist/core/prompt-guidance.d.ts.map +1 -0
- package/dist/core/prompt-guidance.js +159 -0
- package/dist/core/prompt-guidance.js.map +7 -0
- package/dist/core/provider-operations.d.ts.map +1 -1
- package/dist/core/provider-operations.js +60 -108
- package/dist/core/provider-operations.js.map +3 -3
- package/dist/core/shell-inbox.d.ts.map +1 -1
- package/dist/core/shell-jobs.d.ts +7 -5
- package/dist/core/shell-jobs.d.ts.map +1 -1
- package/dist/core/shell-timing.d.ts.map +1 -1
- package/dist/core/skill-prompt.d.ts +1 -1
- package/dist/core/skill-prompt.d.ts.map +1 -1
- package/dist/core/skill-references.d.ts +1 -1
- package/dist/core/skill-references.d.ts.map +1 -1
- package/dist/core/system-guidance.d.ts.map +1 -1
- package/dist/core/tool-result-proxy.d.ts.map +1 -1
- package/dist/decisions/command.d.ts +2 -1
- package/dist/decisions/command.d.ts.map +1 -1
- package/dist/decisions/command.js +40 -12
- package/dist/decisions/command.js.map +2 -2
- package/dist/decisions/events.d.ts +12 -0
- package/dist/decisions/events.d.ts.map +1 -0
- package/dist/decisions/events.js +130 -0
- package/dist/decisions/events.js.map +7 -0
- package/dist/decisions/host.d.ts +31 -3
- package/dist/decisions/host.d.ts.map +1 -1
- package/dist/decisions/render.d.ts +44 -0
- package/dist/decisions/render.d.ts.map +1 -0
- package/dist/decisions/store.d.ts +8 -0
- package/dist/decisions/store.d.ts.map +1 -1
- package/dist/durable/agent.d.ts +8 -0
- package/dist/durable/agent.d.ts.map +1 -1
- package/dist/durable/extension-load-error.d.ts +8 -0
- package/dist/durable/extension-load-error.d.ts.map +1 -0
- package/dist/durable/session.d.ts +1 -0
- package/dist/durable/session.d.ts.map +1 -1
- package/dist/durable/worker-host.d.ts +10 -1
- package/dist/durable/worker-host.d.ts.map +1 -1
- package/dist/durable/worker-host.js +10 -1181
- package/dist/durable/worker-host.js.map +4 -4
- package/dist/durable/worker-options.d.ts +3 -0
- package/dist/durable/worker-options.d.ts.map +1 -1
- package/dist/durable/worker-role-seed.d.ts +82 -0
- package/dist/durable/worker-role-seed.d.ts.map +1 -0
- package/dist/durable/worker.js +43 -4
- package/dist/durable/worker.js.map +2 -2
- package/dist/durable-controls.d.ts.map +1 -1
- package/dist/durable-extension-wasm.d.ts +8 -0
- package/dist/durable-extension-wasm.d.ts.map +1 -0
- package/dist/durable-extension-wasm.js +32 -0
- package/dist/durable-extension-wasm.js.map +7 -0
- package/dist/durable-extension.d.ts +94 -0
- package/dist/durable-extension.d.ts.map +1 -0
- package/dist/durable-extension.js +649 -0
- package/dist/durable-extension.js.map +7 -0
- package/dist/durable-host.d.ts +8 -0
- package/dist/durable-host.d.ts.map +1 -0
- package/dist/durable-host.js +20 -0
- package/dist/durable-host.js.map +7 -0
- package/dist/durable-journal.d.ts +94 -0
- package/dist/durable-journal.d.ts.map +1 -0
- package/dist/durable.d.ts.map +1 -1
- package/dist/durable.js +13 -10
- package/dist/durable.js.map +2 -2
- package/dist/entropy/index.js +12 -10
- package/dist/entropy/pool-store.d.ts.map +1 -1
- package/dist/execution-service.d.ts +14 -0
- package/dist/execution-service.d.ts.map +1 -1
- package/dist/extension-bootstrap.d.ts.map +1 -1
- package/dist/extension-bootstrap.js +28 -27
- package/dist/extension-bootstrap.js.map +2 -2
- package/dist/extension-copy.d.ts +21 -0
- package/dist/extension-copy.d.ts.map +1 -0
- package/dist/extension-copy.js +90 -0
- package/dist/extension-copy.js.map +7 -0
- package/dist/extension.d.ts +1 -1
- package/dist/extension.d.ts.map +1 -1
- package/dist/fabric-exec-arguments.d.ts.map +1 -1
- package/dist/fabric-exec-tool.d.ts +2 -1
- package/dist/fabric-exec-tool.d.ts.map +1 -1
- package/dist/fabric-runtime-state.d.ts +19 -0
- package/dist/fabric-runtime-state.d.ts.map +1 -1
- package/dist/fabric-runtime-state.js +2205 -839
- package/dist/fabric-runtime-state.js.map +4 -4
- package/dist/fabric-state.d.ts +44 -1
- package/dist/fabric-state.d.ts.map +1 -1
- package/dist/feedback.d.ts +5 -0
- package/dist/feedback.d.ts.map +1 -0
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +88 -53
- package/dist/index.js.map +2 -2
- package/dist/jev/client.js +2 -2
- package/dist/jev/manager.d.ts +3 -0
- package/dist/jev/manager.d.ts.map +1 -1
- package/dist/jev/observation.d.ts +1 -1
- package/dist/jev/observation.js +6 -6
- package/dist/jev-fabric/bridge.d.ts.map +1 -1
- package/dist/jev.js +11 -12
- package/dist/main-agent.d.ts +2 -1
- package/dist/main-agent.d.ts.map +1 -1
- package/dist/managed-host.d.ts +13 -0
- package/dist/managed-host.d.ts.map +1 -1
- package/dist/memory/digest.js +2 -2
- package/dist/memory/discovery.js +6 -7
- package/dist/memory/file-worker.js +10 -11
- package/dist/memory/file-worker.js.map +1 -1
- package/dist/memory/normalize.js +5 -6
- package/dist/memory/search.js +7 -8
- package/dist/memory/worker-provider.js +11 -12
- package/dist/memory.js +11 -12
- package/dist/memory.js.map +1 -1
- package/dist/mesh/grants.d.ts +3 -3
- package/dist/mesh/grants.d.ts.map +1 -1
- package/dist/mesh/store.d.ts +8 -0
- package/dist/mesh/store.d.ts.map +1 -1
- package/dist/native-codemode.d.ts.map +1 -1
- package/dist/native-tool-catalog.d.ts.map +1 -1
- package/dist/native-tool-catalog.js +12 -3
- package/dist/native-tool-catalog.js.map +2 -2
- package/dist/programs/host.d.ts +18 -6
- package/dist/programs/host.d.ts.map +1 -1
- package/dist/programs/host.js +71 -47
- package/dist/programs/host.js.map +2 -2
- package/dist/programs/source.d.ts +11 -0
- package/dist/programs/source.d.ts.map +1 -1
- package/dist/programs/store.d.ts.map +1 -1
- package/dist/protocol.d.ts +504 -8
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +41 -11
- package/dist/provider-globals.d.ts +13 -0
- package/dist/provider-globals.d.ts.map +1 -0
- package/dist/providers/agents-actions.d.ts.map +1 -1
- package/dist/providers/agents-provider.d.ts +3 -0
- package/dist/providers/agents-provider.d.ts.map +1 -1
- package/dist/providers/captured-tools-provider.d.ts +5 -0
- package/dist/providers/captured-tools-provider.d.ts.map +1 -1
- package/dist/providers/compact-provider.d.ts +4 -1
- package/dist/providers/compact-provider.d.ts.map +1 -1
- package/dist/providers/components-provider.d.ts.map +1 -1
- package/dist/providers/decisions-provider.d.ts +9 -1
- package/dist/providers/decisions-provider.d.ts.map +1 -1
- package/dist/providers/jev-provider.d.ts +1 -1
- package/dist/providers/jev-provider.js +11 -12
- package/dist/providers/memory-provider.js +10 -11
- package/dist/providers/pi-tools-provider.d.ts +14 -0
- package/dist/providers/pi-tools-provider.d.ts.map +1 -1
- package/dist/providers/programs-provider.d.ts.map +1 -1
- package/dist/providers/sessions-provider.d.ts +7 -0
- package/dist/providers/sessions-provider.d.ts.map +1 -1
- package/dist/repeat-guard.d.ts +7 -6
- package/dist/repeat-guard.d.ts.map +1 -1
- package/dist/residency/actor-client.js +3 -3
- package/dist/residency/client.d.ts +15 -0
- package/dist/residency/client.d.ts.map +1 -1
- package/dist/residency/host.d.ts.map +1 -1
- package/dist/residency/host.js +34 -23
- package/dist/residency/launcher.js +1 -1
- package/dist/residency/pi-entry.js +34 -23
- package/dist/residency/pi-entry.js.map +1 -1
- package/dist/residency/protocol.d.ts +2 -0
- package/dist/residency/protocol.d.ts.map +1 -1
- package/dist/runners.js +11 -1
- package/dist/runners.js.map +2 -2
- package/dist/runtime/core-override-guest-types.js +2 -2
- package/dist/runtime/cpython-child-source.d.ts.map +1 -1
- package/dist/runtime/cpython-runtime.d.ts.map +1 -1
- package/dist/runtime/cpython-runtime.js +51 -21
- package/dist/runtime/cpython-runtime.js.map +2 -2
- package/dist/runtime/deadline-pause.d.ts +2 -0
- package/dist/runtime/deadline-pause.d.ts.map +1 -1
- package/dist/runtime/dynamic-guest-types.d.ts.map +1 -1
- package/dist/runtime/dynamic-guest-types.js +2 -1
- package/dist/runtime/exec-journal.d.ts +73 -0
- package/dist/runtime/exec-journal.d.ts.map +1 -0
- package/dist/runtime/exec-journal.js +335 -0
- package/dist/runtime/exec-journal.js.map +7 -0
- package/dist/runtime/guest-types.d.ts +3 -2
- package/dist/runtime/guest-types.d.ts.map +1 -1
- package/dist/runtime/guest-types.js +1 -1
- package/dist/runtime/journal-shim.d.ts +3 -0
- package/dist/runtime/journal-shim.d.ts.map +1 -0
- package/dist/runtime/kernel.d.ts +95 -1
- package/dist/runtime/kernel.d.ts.map +1 -1
- package/dist/runtime/monty-bridge.d.ts +6 -2
- package/dist/runtime/monty-bridge.d.ts.map +1 -1
- package/dist/runtime/monty-runtime.d.ts.map +1 -1
- package/dist/runtime/monty-runtime.js +27 -15
- package/dist/runtime/monty-runtime.js.map +2 -2
- package/dist/runtime/native-codemode-guest.d.ts.map +1 -1
- package/dist/runtime/node-process-runtime.d.ts.map +1 -1
- package/dist/runtime/node-process-runtime.js +7 -5
- package/dist/runtime/quickjs-runtime.d.ts +7 -1
- package/dist/runtime/quickjs-runtime.d.ts.map +1 -1
- package/dist/runtime/quickjs-runtime.js +5 -4
- package/dist/runtime/sha256.d.ts +4 -0
- package/dist/runtime/sha256.d.ts.map +1 -0
- package/dist/runtime/transpile.d.ts +8 -0
- package/dist/runtime/transpile.d.ts.map +1 -0
- package/dist/runtime/type-checker.d.ts +1 -7
- package/dist/runtime/type-checker.d.ts.map +1 -1
- package/dist/runtime/type-checker.js +4 -2
- package/dist/runtime/typescript-kernel.js +13 -10
- package/dist/runtime/typescript-kernel.js.map +1 -1
- package/dist/runtime-state-builtins.d.ts.map +1 -1
- package/dist/speculation/scanner.js +1 -1
- package/dist/speculation/store.d.ts +7 -16
- package/dist/speculation/store.d.ts.map +1 -1
- package/dist/speculation/types.d.ts +1 -0
- package/dist/speculation/types.d.ts.map +1 -1
- package/dist/storage/retention.d.ts.map +1 -1
- package/dist/topology/participant-directory.d.ts +26 -1
- package/dist/topology/participant-directory.d.ts.map +1 -1
- package/dist/topology/peer-presence.d.ts.map +1 -1
- package/dist/topology/peer-settle.js +11 -0
- package/dist/topology/peer-settle.js.map +7 -0
- package/dist/topology/session-label-settings.d.ts +13 -0
- package/dist/topology/session-label-settings.d.ts.map +1 -0
- package/dist/topology/session-label.d.ts +60 -0
- package/dist/topology/session-label.d.ts.map +1 -0
- package/dist/topology/types.d.ts +27 -0
- package/dist/topology/types.d.ts.map +1 -1
- package/dist/type-error-guidance.js +1 -1
- package/dist/ui/controller.d.ts +1 -0
- package/dist/ui/controller.d.ts.map +1 -1
- package/dist/ui/conversation-chrome.d.ts.map +1 -1
- package/dist/ui/conversation-chrome.js +3 -2
- package/dist/ui/conversation-commands.d.ts +1 -1
- package/dist/ui/conversation-commands.d.ts.map +1 -1
- package/dist/ui/conversation-native-reader.js +2 -2
- package/dist/ui/conversation-selection.d.ts +4 -1
- package/dist/ui/conversation-selection.d.ts.map +1 -1
- package/dist/ui/conversation-targets.d.ts.map +1 -1
- package/dist/ui/conversation-targets.js +2 -2
- package/dist/ui/conversation.d.ts +25 -24
- package/dist/ui/conversation.d.ts.map +1 -1
- package/dist/ui/conversation.js +170 -339
- package/dist/ui/conversation.js.map +2 -2
- package/dist/ui/core-tool-render.d.ts +1 -0
- package/dist/ui/core-tool-render.d.ts.map +1 -1
- package/dist/ui/dashboard-model.d.ts.map +1 -1
- package/dist/ui/dashboard.d.ts.map +1 -1
- package/dist/ui/dashboard.js +23 -16
- package/dist/ui/dashboard.js.map +2 -2
- package/dist/ui/fabric-render.d.ts +7 -0
- package/dist/ui/fabric-render.d.ts.map +1 -1
- package/dist/ui/footer-dock.d.ts +48 -0
- package/dist/ui/footer-dock.d.ts.map +1 -0
- package/dist/ui/format.d.ts +7 -0
- package/dist/ui/format.d.ts.map +1 -1
- package/dist/ui/settings-sections-lifecycle.d.ts.map +1 -1
- package/dist/ui/settings-sections-presentation.d.ts.map +1 -1
- package/dist/ui/settings-values.d.ts +2 -1
- package/dist/ui/settings-values.d.ts.map +1 -1
- package/dist/ui/settings.js +60 -19
- package/dist/ui/settings.js.map +2 -2
- package/dist/ui/shell-hang-keys.d.ts +8 -1
- package/dist/ui/shell-hang-keys.d.ts.map +1 -1
- package/dist/ui/shell-tasks.d.ts +2 -2
- package/dist/ui/shell-tasks.d.ts.map +1 -1
- package/dist/ui/shell-tasks.js +27 -94
- package/dist/ui/shell-tasks.js.map +2 -2
- package/dist/ui/snapshot.d.ts.map +1 -1
- package/dist/ui/terminal-title.d.ts +41 -0
- package/dist/ui/terminal-title.d.ts.map +1 -0
- package/dist/ui/types.d.ts +4 -0
- package/dist/ui/types.d.ts.map +1 -1
- package/dist/ui/widget-keys.d.ts +5 -0
- package/dist/ui/widget-keys.d.ts.map +1 -0
- package/dist/ui/widget.d.ts +40 -18
- package/dist/ui/widget.d.ts.map +1 -1
- package/dist/ui/word-diff/line-emphasis.js +1603 -0
- package/dist/ui/word-diff/line-emphasis.js.map +7 -0
- package/dist/util.d.ts +2 -0
- package/dist/util.d.ts.map +1 -1
- package/dist/verified/authority.d.ts +2 -2
- package/dist/verified/authority.d.ts.map +1 -1
- package/dist/verified/budget.d.ts +4 -0
- package/dist/verified/budget.d.ts.map +1 -0
- package/dist/verified/generated/actor-name.d.ts +4 -0
- package/dist/verified/generated/actor-name.js +17 -0
- package/dist/verified/generated/authority.d.ts +4 -0
- package/dist/verified/generated/authority.js +28 -0
- package/dist/verified/generated/budget.d.ts +4 -0
- package/dist/verified/generated/budget.js +17 -0
- package/dist/verified/generated/compaction.d.ts +4 -0
- package/dist/verified/generated/compaction.js +19 -0
- package/dist/verified/generated/grants.d.ts +4 -0
- package/dist/verified/generated/grants.js +17 -0
- package/dist/verified/generated/lifecycle.d.ts +4 -0
- package/dist/verified/generated/lifecycle.js +50 -0
- package/dist/verified/generated/manifest.json +137 -48
- package/dist/verified/generated/policy.d.ts +17 -0
- package/dist/verified/generated/policy.js +211 -0
- package/dist/verified/generated/provider.d.ts +4 -0
- package/dist/verified/generated/provider.js +18 -0
- package/dist/verified/generated/resources.d.ts +6 -0
- package/dist/verified/generated/resources.js +73 -0
- package/dist/verified/generated/speculation.d.ts +6 -0
- package/dist/verified/generated/speculation.js +48 -0
- package/dist/verified/generated/storage.d.ts +4 -0
- package/dist/verified/generated/storage.js +18 -0
- package/dist/verified/grants.d.ts +22 -0
- package/dist/verified/grants.d.ts.map +1 -0
- package/dist/verified/lifecycle.d.ts +31 -0
- package/dist/verified/lifecycle.d.ts.map +1 -0
- package/dist/verified/machine.d.ts +18 -0
- package/dist/verified/machine.d.ts.map +1 -0
- package/dist/verified/memory.d.ts +1 -1
- package/dist/verified/memory.d.ts.map +1 -1
- package/dist/verified/nat.d.ts +1 -1
- package/dist/verified/nat.d.ts.map +1 -1
- package/dist/verified/policy.d.ts +17 -5
- package/dist/verified/policy.d.ts.map +1 -1
- package/dist/verified/provider.d.ts +22 -0
- package/dist/verified/provider.d.ts.map +1 -0
- package/dist/verified/resources.d.ts +21 -7
- package/dist/verified/resources.d.ts.map +1 -1
- package/dist/verified/speculation.d.ts +36 -0
- package/dist/verified/speculation.d.ts.map +1 -0
- package/dist/verified/storage.d.ts.map +1 -1
- package/dist/worker/missing-install.d.ts +8 -0
- package/dist/worker/missing-install.d.ts.map +1 -0
- package/dist/worker/options.d.ts.map +1 -1
- package/dist/worker/options.js +25 -0
- package/dist/worker/options.js.map +2 -2
- package/dist/worker/prompt-lifecycle.d.ts +16 -0
- package/dist/worker/prompt-lifecycle.d.ts.map +1 -0
- package/dist/worker/prompt-lifecycle.js +90 -0
- package/dist/worker/prompt-lifecycle.js.map +7 -0
- package/dist/worker/questions.d.ts +15 -3
- package/dist/worker/questions.d.ts.map +1 -1
- package/dist/worker/questions.js +53 -8
- package/dist/worker/questions.js.map +2 -2
- package/dist/worker/recovery-watchdog.d.ts +22 -0
- package/dist/worker/recovery-watchdog.d.ts.map +1 -1
- package/dist/worker/recovery-watchdog.js +116 -1
- package/dist/worker/recovery-watchdog.js.map +2 -2
- package/dist/worker/result.js +1 -1
- package/dist/worker/result.js.map +2 -2
- package/dist/worker.js +131 -21
- package/dist/worker.js.map +2 -2
- package/docs/actor-name-policy-handoff.md +5 -0
- package/docs/agents.md +172 -22
- package/docs/architecture.md +5 -1
- package/docs/audit-trace.md +2 -1
- package/docs/background-tasks.md +126 -28
- package/docs/codemode-parity.md +2 -2
- package/docs/compaction.md +21 -5
- package/docs/components.md +1 -1
- package/docs/configuration.md +113 -66
- package/docs/decisions.md +92 -10
- package/docs/durable-extension.md +121 -0
- package/docs/durable-pi.md +306 -6
- package/docs/extractive-history.md +3 -1
- package/docs/interface.md +22 -17
- package/docs/jev.md +2 -2
- package/docs/kernels.md +1 -1
- package/{node_modules/pi-coralbricks-provider/LICENSE → docs/licenses/gdp-wired-mit.txt} +1 -1
- package/docs/managed-host-migration.md +50 -0
- package/docs/programmatic-compaction.md +216 -6
- package/docs/programs.md +23 -1
- package/docs/prompt-cache.md +4 -2
- package/docs/provider-capabilities.md +15 -14
- package/docs/providers.md +99 -3
- package/docs/shell-composition.md +15 -0
- package/docs/short-lock-protocol.md +90 -0
- package/docs/skills.md +5 -1
- package/docs/speculation.md +6 -0
- package/docs/verified-kernels.md +309 -220
- package/package.json +45 -24
- package/proofs/actor-name.ts +27 -0
- package/proofs/authority.ts +62 -0
- package/proofs/budget.ts +24 -0
- package/proofs/compaction.ts +51 -0
- package/proofs/grants.ts +39 -0
- package/proofs/index.ts +40 -0
- package/proofs/kernel.ts +44 -0
- package/proofs/lifecycle.ts +128 -0
- package/proofs/policy.ts +195 -0
- package/proofs/provider.ts +52 -0
- package/proofs/resources.ts +160 -0
- package/proofs/speculation.ts +69 -0
- package/proofs/storage.ts +66 -0
- package/scripts/verified-kernels.ts +141 -0
- package/skillsets/python/fabric-council/SKILL.md +94 -20
- package/skillsets/python/fabric-exec/SKILL.md +2 -2
- package/skillsets/python/fabric-exec/references/agents.md +10 -4
- package/skillsets/python/fabric-fusion/SKILL.md +1 -1
- package/skillsets/python/fabric-guide/SKILL.md +1 -1
- package/skillsets/typescript/fabric-council/SKILL.md +110 -22
- package/skillsets/typescript/fabric-exec/SKILL.md +7 -7
- package/skillsets/typescript/fabric-exec/references/agents.md +17 -8
- package/skillsets/typescript/fabric-fusion/SKILL.md +1 -1
- package/skillsets/typescript/fabric-guide/SKILL.md +1 -1
- package/LAWS.bend +0 -502
- package/PROOF.bend +0 -452
- package/dist/chunks/chunk-3UGN25XS.js.map +0 -7
- package/dist/chunks/chunk-4EW7GVUR.js.map +0 -7
- package/dist/chunks/chunk-5UBRGTVN.js.map +0 -7
- package/dist/chunks/chunk-BN7F52EG.js +0 -525
- package/dist/chunks/chunk-BN7F52EG.js.map +0 -7
- package/dist/chunks/chunk-C7Z6F3SO.js.map +0 -7
- package/dist/chunks/chunk-DK35W6U7.js +0 -259
- package/dist/chunks/chunk-DK35W6U7.js.map +0 -7
- package/dist/chunks/chunk-EFETPXU2.js.map +0 -7
- package/dist/chunks/chunk-EHQQ4KCX.js.map +0 -7
- package/dist/chunks/chunk-EKODKR6Y.js.map +0 -7
- package/dist/chunks/chunk-FE6NOAO7.js.map +0 -7
- package/dist/chunks/chunk-FIDUHKMM.js.map +0 -7
- package/dist/chunks/chunk-FSB2VIRZ.js.map +0 -7
- package/dist/chunks/chunk-GIK2WNAK.js.map +0 -7
- package/dist/chunks/chunk-GO32KSEZ.js.map +0 -7
- package/dist/chunks/chunk-IR3PIHJM.js.map +0 -7
- package/dist/chunks/chunk-ITVLKXCI.js +0 -266
- package/dist/chunks/chunk-ITVLKXCI.js.map +0 -7
- package/dist/chunks/chunk-K7J2ABAZ.js.map +0 -7
- package/dist/chunks/chunk-KJZAOENY.js +0 -212
- package/dist/chunks/chunk-KJZAOENY.js.map +0 -7
- package/dist/chunks/chunk-LNASO4VT.js.map +0 -7
- package/dist/chunks/chunk-MLLYR3Y6.js.map +0 -7
- package/dist/chunks/chunk-P4KH4S4S.js.map +0 -7
- package/dist/chunks/chunk-PK4NIJEV.js.map +0 -7
- package/dist/chunks/chunk-Q2JQ3RYZ.js +0 -99
- package/dist/chunks/chunk-Q2JQ3RYZ.js.map +0 -7
- package/dist/chunks/chunk-R2XQ6AHT.js.map +0 -7
- package/dist/chunks/chunk-ROTCDDOV.js.map +0 -7
- package/dist/chunks/chunk-SPCJXN4K.js.map +0 -7
- package/dist/chunks/chunk-U366I5K2.js.map +0 -7
- package/dist/chunks/chunk-UKMQK5VP.js +0 -231
- package/dist/chunks/chunk-UKMQK5VP.js.map +0 -7
- package/dist/chunks/chunk-UOM37PE4.js.map +0 -7
- package/dist/chunks/chunk-UTOBAZ5T.js.map +0 -7
- package/dist/chunks/chunk-VSDUSNIA.js.map +0 -7
- package/dist/chunks/chunk-VTK2FEH7.js +0 -229
- package/dist/chunks/chunk-VTK2FEH7.js.map +0 -7
- package/dist/chunks/chunk-VYQV5JRT.js.map +0 -7
- package/dist/chunks/chunk-XCEEQ5AB.js.map +0 -7
- package/dist/chunks/chunk-ZLNJDTCN.js +0 -226
- package/dist/chunks/chunk-ZLNJDTCN.js.map +0 -7
- package/dist/chunks/chunk-ZQMBS5SH.js.map +0 -7
- package/dist/ui/conversation-shortcut.d.ts +0 -3
- package/dist/ui/conversation-shortcut.d.ts.map +0 -1
- package/dist/ui/widget-activity.d.ts +0 -21
- package/dist/ui/widget-activity.d.ts.map +0 -1
- package/dist/verified/generated/authority-kernel.d.ts +0 -10
- package/dist/verified/generated/authority-kernel.js +0 -127
- package/dist/verified/generated/kernel.d.ts +0 -31
- package/dist/verified/generated/kernel.js +0 -389
- package/dist/verified/generated/lifecycle-kernel.d.ts +0 -7
- package/dist/verified/generated/lifecycle-kernel.js +0 -164
- package/dist/verified/generated/provider-kernel.d.ts +0 -9
- package/dist/verified/generated/provider-kernel.js +0 -87
- package/dist/verified/generated/storage-kernel.d.ts +0 -11
- package/dist/verified/generated/storage-kernel.js +0 -107
- package/docs/licenses/bend-apache-2.0.txt +0 -202
- package/node_modules/pi-coralbricks-provider/README.md +0 -306
- package/node_modules/pi-coralbricks-provider/auth.ts +0 -30
- package/node_modules/pi-coralbricks-provider/custom-models.json +0 -1
- package/node_modules/pi-coralbricks-provider/deprecated-models.json +0 -1
- package/node_modules/pi-coralbricks-provider/guard.ts +0 -155
- package/node_modules/pi-coralbricks-provider/index.ts +0 -662
- package/node_modules/pi-coralbricks-provider/models.json +0 -88
- package/node_modules/pi-coralbricks-provider/package.json +0 -74
- package/node_modules/pi-coralbricks-provider/park.ts +0 -122
- package/node_modules/pi-coralbricks-provider/patch.json +0 -34
- package/node_modules/pi-coralbricks-provider/scripts/update-models.js +0 -658
- package/node_modules/pi-coralbricks-provider/settings.ts +0 -143
- package/node_modules/pi-coralbricks-provider/sync-policy.ts +0 -309
- package/proofs/abi.json +0 -308
- package/proofs/authority-abi.json +0 -7
- package/proofs/authority-kernel.bend +0 -23
- package/proofs/authority-proof.bend +0 -74
- package/proofs/authority-spec.bend +0 -30
- package/proofs/authority-state.bend +0 -43
- package/proofs/authority-types.d.ts +0 -3
- package/proofs/kernel.bend +0 -139
- package/proofs/lifecycle-abi.json +0 -3
- package/proofs/lifecycle-kernel.bend +0 -11
- package/proofs/lifecycle-proof.bend +0 -249
- package/proofs/lifecycle-spec.bend +0 -261
- package/proofs/lifecycle-types.d.ts +0 -4
- package/proofs/lifecycle.bend +0 -119
- package/proofs/provider-abi.json +0 -4
- package/proofs/provider-kernel.bend +0 -14
- package/proofs/provider-plans.bend +0 -28
- package/proofs/provider-spec.bend +0 -14
- package/proofs/provider-types.d.ts +0 -5
- package/proofs/resource-proof.bend +0 -633
- package/proofs/resource-spec.bend +0 -133
- package/proofs/resources.bend +0 -160
- package/proofs/state-kernel.bend +0 -17
- package/proofs/state-plans.bend +0 -40
- package/proofs/state-proof.bend +0 -42
- package/proofs/state-spec.bend +0 -26
- package/proofs/storage-abi.json +0 -3
- package/proofs/storage-kernel.bend +0 -11
- package/proofs/storage-plans.bend +0 -100
- package/proofs/storage-proof.bend +0 -176
- package/proofs/storage-spec.bend +0 -70
- package/proofs/storage-types.d.ts +0 -8
- package/proofs/types.d.ts +0 -7
- package/scripts/test-verified-kernels.mjs +0 -107
- package/scripts/verified-kernels.mjs +0 -176
- /package/dist/chunks/{chunk-ZEXCKK4K.js.map → chunk-4WKD3YM3.js.map} +0 -0
- /package/dist/chunks/{chunk-5XBYFSI5.js.map → chunk-7YNE4NB2.js.map} +0 -0
- /package/dist/chunks/{chunk-K6QXUGS5.js.map → chunk-BMAEZNZ5.js.map} +0 -0
- /package/dist/chunks/{chunk-CCHZXF6K.js.map → chunk-CXYJJ3HZ.js.map} +0 -0
- /package/dist/chunks/{chunk-TIIIHPHF.js.map → chunk-GS67KDMV.js.map} +0 -0
- /package/dist/chunks/{chunk-D5NYNIST.js.map → chunk-H57KPL3V.js.map} +0 -0
- /package/dist/chunks/{chunk-INRXG4J5.js.map → chunk-HGD75NZY.js.map} +0 -0
- /package/dist/chunks/{chunk-UXIBKMUM.js.map → chunk-KIFOEBYJ.js.map} +0 -0
- /package/dist/chunks/{chunk-3FJUP3GV.js.map → chunk-L6H46CPY.js.map} +0 -0
- /package/dist/chunks/{chunk-FUY6XVRX.js.map → chunk-MPMEK3IQ.js.map} +0 -0
- /package/dist/chunks/{chunk-HP5P7NBO.js.map → chunk-MSDL7U6Q.js.map} +0 -0
- /package/dist/chunks/{chunk-ASSLHWZS.js.map → chunk-MX53BRAC.js.map} +0 -0
- /package/dist/chunks/{chunk-QT4W5YVB.js.map → chunk-RAA3FAYZ.js.map} +0 -0
- /package/dist/chunks/{chunk-53N2I4QA.js.map → chunk-TXCNZCZP.js.map} +0 -0
- /package/dist/chunks/{chunk-LEU5CDSL.js.map → chunk-XFOSUGLU.js.map} +0 -0
|
@@ -0,0 +1,649 @@
|
|
|
1
|
+
import {
|
|
2
|
+
journalShimSource
|
|
3
|
+
} from "./chunks/chunk-SW25R47N.js";
|
|
4
|
+
|
|
5
|
+
// src/durable-extension.ts
|
|
6
|
+
import { Type } from "typebox";
|
|
7
|
+
|
|
8
|
+
// src/runtime/sha256.ts
|
|
9
|
+
var K = new Uint32Array([
|
|
10
|
+
1116352408,
|
|
11
|
+
1899447441,
|
|
12
|
+
3049323471,
|
|
13
|
+
3921009573,
|
|
14
|
+
961987163,
|
|
15
|
+
1508970993,
|
|
16
|
+
2453635748,
|
|
17
|
+
2870763221,
|
|
18
|
+
3624381080,
|
|
19
|
+
310598401,
|
|
20
|
+
607225278,
|
|
21
|
+
1426881987,
|
|
22
|
+
1925078388,
|
|
23
|
+
2162078206,
|
|
24
|
+
2614888103,
|
|
25
|
+
3248222580,
|
|
26
|
+
3835390401,
|
|
27
|
+
4022224774,
|
|
28
|
+
264347078,
|
|
29
|
+
604807628,
|
|
30
|
+
770255983,
|
|
31
|
+
1249150122,
|
|
32
|
+
1555081692,
|
|
33
|
+
1996064986,
|
|
34
|
+
2554220882,
|
|
35
|
+
2821834349,
|
|
36
|
+
2952996808,
|
|
37
|
+
3210313671,
|
|
38
|
+
3336571891,
|
|
39
|
+
3584528711,
|
|
40
|
+
113926993,
|
|
41
|
+
338241895,
|
|
42
|
+
666307205,
|
|
43
|
+
773529912,
|
|
44
|
+
1294757372,
|
|
45
|
+
1396182291,
|
|
46
|
+
1695183700,
|
|
47
|
+
1986661051,
|
|
48
|
+
2177026350,
|
|
49
|
+
2456956037,
|
|
50
|
+
2730485921,
|
|
51
|
+
2820302411,
|
|
52
|
+
3259730800,
|
|
53
|
+
3345764771,
|
|
54
|
+
3516065817,
|
|
55
|
+
3600352804,
|
|
56
|
+
4094571909,
|
|
57
|
+
275423344,
|
|
58
|
+
430227734,
|
|
59
|
+
506948616,
|
|
60
|
+
659060556,
|
|
61
|
+
883997877,
|
|
62
|
+
958139571,
|
|
63
|
+
1322822218,
|
|
64
|
+
1537002063,
|
|
65
|
+
1747873779,
|
|
66
|
+
1955562222,
|
|
67
|
+
2024104815,
|
|
68
|
+
2227730452,
|
|
69
|
+
2361852424,
|
|
70
|
+
2428436474,
|
|
71
|
+
2756734187,
|
|
72
|
+
3204031479,
|
|
73
|
+
3329325298
|
|
74
|
+
]);
|
|
75
|
+
var rotr = (x, n) => x >>> n | x << 32 - n;
|
|
76
|
+
var sha256Hex = (text) => {
|
|
77
|
+
const bytes = new TextEncoder().encode(text);
|
|
78
|
+
const bitLength = bytes.length * 8;
|
|
79
|
+
const padded = new Uint8Array(bytes.length + 9 + 63 >> 6 << 6);
|
|
80
|
+
padded.set(bytes);
|
|
81
|
+
padded[bytes.length] = 128;
|
|
82
|
+
const view = new DataView(padded.buffer);
|
|
83
|
+
view.setUint32(padded.length - 8, Math.floor(bitLength / 2 ** 32));
|
|
84
|
+
view.setUint32(padded.length - 4, bitLength >>> 0);
|
|
85
|
+
const h = new Uint32Array([1779033703, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635, 1541459225]);
|
|
86
|
+
const w = new Uint32Array(64);
|
|
87
|
+
for (let offset = 0; offset < padded.length; offset += 64) {
|
|
88
|
+
for (let i = 0; i < 16; i++) w[i] = view.getUint32(offset + i * 4);
|
|
89
|
+
for (let i = 16; i < 64; i++) {
|
|
90
|
+
const a2 = w[i - 15], b2 = w[i - 2];
|
|
91
|
+
const s0 = rotr(a2, 7) ^ rotr(a2, 18) ^ a2 >>> 3;
|
|
92
|
+
const s1 = rotr(b2, 17) ^ rotr(b2, 19) ^ b2 >>> 10;
|
|
93
|
+
w[i] = w[i - 16] + s0 + w[i - 7] + s1 >>> 0;
|
|
94
|
+
}
|
|
95
|
+
let [a, b, c, d, e, f, g, hh] = h;
|
|
96
|
+
for (let i = 0; i < 64; i++) {
|
|
97
|
+
const t1 = hh + (rotr(e, 6) ^ rotr(e, 11) ^ rotr(e, 25)) + (e & f ^ ~e & g) + K[i] + w[i] >>> 0;
|
|
98
|
+
const t2 = (rotr(a, 2) ^ rotr(a, 13) ^ rotr(a, 22)) + (a & b ^ a & c ^ b & c) >>> 0;
|
|
99
|
+
hh = g;
|
|
100
|
+
g = f;
|
|
101
|
+
f = e;
|
|
102
|
+
e = d + t1 >>> 0;
|
|
103
|
+
d = c;
|
|
104
|
+
c = b;
|
|
105
|
+
b = a;
|
|
106
|
+
a = t1 + t2 >>> 0;
|
|
107
|
+
}
|
|
108
|
+
h[0] = h[0] + a;
|
|
109
|
+
h[1] = h[1] + b;
|
|
110
|
+
h[2] = h[2] + c;
|
|
111
|
+
h[3] = h[3] + d;
|
|
112
|
+
h[4] = h[4] + e;
|
|
113
|
+
h[5] = h[5] + f;
|
|
114
|
+
h[6] = h[6] + g;
|
|
115
|
+
h[7] = h[7] + hh;
|
|
116
|
+
}
|
|
117
|
+
return [...h].map((word) => word.toString(16).padStart(8, "0")).join("");
|
|
118
|
+
};
|
|
119
|
+
var stableValue = (value) => {
|
|
120
|
+
if (Array.isArray(value)) return value.map(stableValue);
|
|
121
|
+
if (value === null || typeof value !== "object") return value;
|
|
122
|
+
return Object.fromEntries(
|
|
123
|
+
Object.entries(value).sort(([left], [right]) => left < right ? -1 : left > right ? 1 : 0).map(([key, nested]) => [key, stableValue(nested)])
|
|
124
|
+
);
|
|
125
|
+
};
|
|
126
|
+
var stableDigest = (value) => sha256Hex(JSON.stringify(stableValue(value)) ?? "null");
|
|
127
|
+
|
|
128
|
+
// src/durable-journal.ts
|
|
129
|
+
var FABRIC_DURABLE_JOURNAL_FORMAT = "pi-fabric.durable-journal.v1";
|
|
130
|
+
var PREVIEW_CHARS = 300;
|
|
131
|
+
var FabricRunDoc = {
|
|
132
|
+
definition: {
|
|
133
|
+
kind: "pi-fabric.exec-run",
|
|
134
|
+
version: 1,
|
|
135
|
+
scope: "task",
|
|
136
|
+
initial: () => ({ header: null, intents: [], completions: [] }),
|
|
137
|
+
checkpointWhen: () => false
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
var FabricDurableJournalRefusal = class extends Error {
|
|
141
|
+
name = "FabricDurableJournalRefusal";
|
|
142
|
+
};
|
|
143
|
+
var refusal = (reason) => new FabricDurableJournalRefusal(`fabric_exec could not resume after an interruption: ${reason}. The program did not run again.`);
|
|
144
|
+
var durableJournalDigest = (args) => stableDigest(args ?? {});
|
|
145
|
+
var callTarget = (ref, args) => ref === "fabric.$call" && typeof args.ref === "string" ? { ref: args.ref, args: args.args ?? {} } : ref === "fabric.$nativeTool" && typeof args.name === "string" ? { ref: args.name, args: args.args ?? {} } : { ref, args };
|
|
146
|
+
var callPreview = (ref, args) => {
|
|
147
|
+
const target = callTarget(ref, args);
|
|
148
|
+
let text = JSON.stringify(target.args) ?? "";
|
|
149
|
+
if (text.length > PREVIEW_CHARS) text = `${text.slice(0, PREVIEW_CHARS)}\u2026`;
|
|
150
|
+
return `${target.ref}(${text})`;
|
|
151
|
+
};
|
|
152
|
+
var plain = (value) => JSON.parse(JSON.stringify(value));
|
|
153
|
+
var toOutcome = (outcome) => outcome.ok ? { ok: true, ...outcome.json === void 0 ? {} : { json: outcome.json } } : { ok: false, message: outcome.message, ...outcome.fields === void 0 ? {} : { fields: outcome.fields } };
|
|
154
|
+
var randomSeed = () => {
|
|
155
|
+
const cryptoApi = globalThis.crypto;
|
|
156
|
+
if (cryptoApi?.getRandomValues) return cryptoApi.getRandomValues(new Uint32Array(1))[0];
|
|
157
|
+
return Math.floor(Math.random() * 2 ** 32);
|
|
158
|
+
};
|
|
159
|
+
var FabricDurableJournal = class _FabricDurableJournal {
|
|
160
|
+
shim;
|
|
161
|
+
startedAt;
|
|
162
|
+
resuming;
|
|
163
|
+
replay;
|
|
164
|
+
#api;
|
|
165
|
+
#context;
|
|
166
|
+
#hooks;
|
|
167
|
+
#intents;
|
|
168
|
+
#completed;
|
|
169
|
+
#next;
|
|
170
|
+
#lastAt;
|
|
171
|
+
constructor(api, context, state, header, resuming, hooks) {
|
|
172
|
+
this.#api = api;
|
|
173
|
+
this.#context = context;
|
|
174
|
+
this.#hooks = hooks;
|
|
175
|
+
this.shim = journalShimSource(header.seed);
|
|
176
|
+
this.startedAt = header.startedAt;
|
|
177
|
+
this.resuming = resuming;
|
|
178
|
+
const completions = [...state.completions].sort((left, right) => left.c - right.c);
|
|
179
|
+
this.replay = completions.map((completion) => ({
|
|
180
|
+
seq: completion.seq,
|
|
181
|
+
ref: completion.ref,
|
|
182
|
+
...completion.t !== void 0 ? { target: completion.t } : {},
|
|
183
|
+
digest: completion.d,
|
|
184
|
+
at: completion.at,
|
|
185
|
+
outcome: completion.o
|
|
186
|
+
}));
|
|
187
|
+
this.#intents = new Map(state.intents.map((intent) => [intent.seq, intent.ref]));
|
|
188
|
+
this.#completed = new Set(completions.map((completion) => completion.seq));
|
|
189
|
+
this.#next = completions.length;
|
|
190
|
+
this.#lastAt = completions.reduce((latest, completion) => Math.max(latest, completion.at), header.startedAt);
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Open the journal of this fabric_exec task: a fresh one on the first run, the recorded one on a rerun.
|
|
194
|
+
* Throws FabricDurableJournalRefusal when the recorded run cannot be trusted to replay.
|
|
195
|
+
*/
|
|
196
|
+
static async open(api, context, identity, engine, hooks) {
|
|
197
|
+
const identityDigest = stableDigest(identity);
|
|
198
|
+
const fresh = { format: FABRIC_DURABLE_JOURNAL_FORMAT, engine, identity: identityDigest, seed: randomSeed(), startedAt: api.now() };
|
|
199
|
+
const opened = await api.commit(async (tx) => {
|
|
200
|
+
const doc = await tx.doc(FabricRunDoc, api.taskId);
|
|
201
|
+
if (doc.header !== null) return { state: plain(doc), resuming: true };
|
|
202
|
+
doc.header = { ...fresh };
|
|
203
|
+
return { state: plain(doc), resuming: false };
|
|
204
|
+
}, context);
|
|
205
|
+
const header = opened.state.header;
|
|
206
|
+
if (opened.resuming) {
|
|
207
|
+
if (header.format !== FABRIC_DURABLE_JOURNAL_FORMAT) throw refusal(`its journal was written in format ${String(header.format)}, which this Fabric cannot replay`);
|
|
208
|
+
if (header.engine !== engine) throw refusal("Fabric's program engine changed since the program started");
|
|
209
|
+
if (header.identity !== identityDigest) throw refusal("the program, its payloads, or its settings changed since it started");
|
|
210
|
+
const positions = opened.state.completions.map((completion) => completion.c).sort((left, right) => left - right);
|
|
211
|
+
const sequences = new Set(opened.state.completions.map((completion) => completion.seq));
|
|
212
|
+
if (positions.some((position, index) => position !== index) || sequences.size !== positions.length) throw refusal("its journal is damaged");
|
|
213
|
+
}
|
|
214
|
+
return new _FabricDurableJournal(api, context, opened.state, header, opened.resuming, hooks);
|
|
215
|
+
}
|
|
216
|
+
/** The recorded tool and provider calls a resume serves without running them again. */
|
|
217
|
+
replayedCalls() {
|
|
218
|
+
return this.replay.filter((delivery) => !delivery.ref.startsWith("fabric.$") || delivery.target !== void 0).length;
|
|
219
|
+
}
|
|
220
|
+
/** Set when the journal stopped the program; the model sees exactly this text. */
|
|
221
|
+
stopReport;
|
|
222
|
+
digest(args) {
|
|
223
|
+
return durableJournalDigest(args);
|
|
224
|
+
}
|
|
225
|
+
/** True when call `seq` was recorded as about to reach its effect. */
|
|
226
|
+
hasIntent(seq) {
|
|
227
|
+
return this.#intents.has(seq);
|
|
228
|
+
}
|
|
229
|
+
/** Commit that call `seq` is about to reach its effect, before it does. */
|
|
230
|
+
async intent(seq, ref) {
|
|
231
|
+
if (this.#intents.has(seq)) return;
|
|
232
|
+
await this.#write((doc) => {
|
|
233
|
+
doc.intents.push({ seq, ref });
|
|
234
|
+
});
|
|
235
|
+
this.#intents.set(seq, ref);
|
|
236
|
+
}
|
|
237
|
+
async complete(seq, ref, args, _value, outcome) {
|
|
238
|
+
const at = Math.max(this.#api.now(), this.#lastAt);
|
|
239
|
+
const target = callTarget(ref, args).ref;
|
|
240
|
+
const c = this.#next++;
|
|
241
|
+
this.#lastAt = at;
|
|
242
|
+
await this.#write((doc) => {
|
|
243
|
+
doc.completions.push({ c, seq, ref, ...target !== ref ? { t: target } : {}, d: durableJournalDigest(args), at, o: toOutcome(outcome) });
|
|
244
|
+
});
|
|
245
|
+
this.#completed.add(seq);
|
|
246
|
+
return at;
|
|
247
|
+
}
|
|
248
|
+
served() {
|
|
249
|
+
}
|
|
250
|
+
frontier(held) {
|
|
251
|
+
const waiting = new Set(held.map((call) => call.seq));
|
|
252
|
+
for (const [seq, ref] of [...this.#intents].sort(([left], [right]) => left - right)) {
|
|
253
|
+
if (!this.#completed.has(seq) && !waiting.has(seq)) {
|
|
254
|
+
this.stopReport = `fabric_exec could not resume after an interruption: the program did not repeat its recorded ${ref} call. No call after the divergence ran.`;
|
|
255
|
+
return { report: this.stopReport };
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
const uncertain = held.find((call) => this.#intents.has(call.seq));
|
|
259
|
+
if (uncertain === void 0) return void 0;
|
|
260
|
+
this.stopReport = maybeRanReport(callPreview(uncertain.ref, uncertain.args), this.replayedCalls());
|
|
261
|
+
return { report: this.stopReport };
|
|
262
|
+
}
|
|
263
|
+
diverged(expected, actual) {
|
|
264
|
+
const instead = actual ? ` (it made ${callPreview(actual.ref, actual.args)} instead)` : "";
|
|
265
|
+
return this.stopReport = `fabric_exec could not resume after an interruption: the program did not repeat its recorded ${expected.target ?? expected.ref} call${instead}. No call after the divergence ran.`;
|
|
266
|
+
}
|
|
267
|
+
async #write(change) {
|
|
268
|
+
try {
|
|
269
|
+
await this.#api.commit(async (tx) => {
|
|
270
|
+
change(await tx.doc(FabricRunDoc, this.#api.taskId));
|
|
271
|
+
}, this.#context);
|
|
272
|
+
} catch (error) {
|
|
273
|
+
this.#hooks.onWriteError(error);
|
|
274
|
+
throw new Error("the journal write failed");
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
var maybeRanReport = (call, replayed) => [
|
|
279
|
+
"fabric_exec was interrupted during this call, which may have run:",
|
|
280
|
+
` ${call}`,
|
|
281
|
+
`${replayed} earlier tool ${replayed === 1 ? "call" : "calls"} finished before the interruption and ${replayed === 1 ? "was" : "were"} replayed from the journal without running again.`,
|
|
282
|
+
"The program stopped here and this call was not repeated. Check whether it took effect, or ask the user, before running it or the rest of the program again."
|
|
283
|
+
].join("\n");
|
|
284
|
+
|
|
285
|
+
// src/durable-extension.ts
|
|
286
|
+
import { renderDeclarations, renderToolSignature, toCodemodeIdentifier } from "@earendil-works/pi-codemode/declarations";
|
|
287
|
+
var FABRIC_DURABLE_DEFAULTS = Object.freeze({
|
|
288
|
+
name: "pi-fabric",
|
|
289
|
+
toolName: "fabric_exec",
|
|
290
|
+
timeoutMs: 3e4,
|
|
291
|
+
memoryLimitBytes: 64 * 1024 * 1024,
|
|
292
|
+
maxLogChars: 2e4,
|
|
293
|
+
maxResultChars: 4e4,
|
|
294
|
+
maxArgumentBytes: 256 * 1024,
|
|
295
|
+
sectionTokenBudget: 3e3
|
|
296
|
+
});
|
|
297
|
+
var PROVIDER_NAME = /^[a-z][a-z0-9_]{0,63}$/;
|
|
298
|
+
var ACTION_NAME = /^[A-Za-z_$][\w$]{0,127}$/;
|
|
299
|
+
var MAX_PENDING_TIMERS = 64;
|
|
300
|
+
var DEFAULT_SEARCH_LIMIT = 8;
|
|
301
|
+
var MAX_LISTED_CALLS = 20;
|
|
302
|
+
var CHARS_PER_TOKEN = 4;
|
|
303
|
+
var TEXT_OUTPUT_SCHEMA = { type: "string" };
|
|
304
|
+
var INTERRUPTED_CODE = "interrupted";
|
|
305
|
+
var FABRIC_DURABLE_ENGINE = `${FABRIC_DURABLE_JOURNAL_FORMAT}/pi-fabric@0.131.2/quickjs-singlefile-0.32`;
|
|
306
|
+
var FabricDurableRefusal = class extends Error {
|
|
307
|
+
name = "FabricDurableRefusal";
|
|
308
|
+
};
|
|
309
|
+
var ProgramStop = class extends Error {
|
|
310
|
+
};
|
|
311
|
+
var NestedToolError = class extends Error {
|
|
312
|
+
};
|
|
313
|
+
var isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
314
|
+
var utf8Bytes = (text) => new TextEncoder().encode(text).length;
|
|
315
|
+
var positive = (value, fallback, label) => {
|
|
316
|
+
const chosen = value ?? fallback;
|
|
317
|
+
if (!Number.isSafeInteger(chosen) || chosen < 1) throw new Error(`createFabricExtension: ${label} must be a positive integer`);
|
|
318
|
+
return chosen;
|
|
319
|
+
};
|
|
320
|
+
var sharedKernel;
|
|
321
|
+
var loadKernel = (wasmModule) => {
|
|
322
|
+
const load = () => import("./runtime/quickjs-runtime.js").then(({ QuickJsRuntime }) => new QuickJsRuntime({ ...wasmModule ? { wasmModule } : {} }));
|
|
323
|
+
if (wasmModule !== void 0) return load();
|
|
324
|
+
sharedKernel ??= load().catch((error) => {
|
|
325
|
+
sharedKernel = void 0;
|
|
326
|
+
throw error;
|
|
327
|
+
});
|
|
328
|
+
return sharedKernel;
|
|
329
|
+
};
|
|
330
|
+
var textOf = (value) => {
|
|
331
|
+
if (typeof value === "string") return value;
|
|
332
|
+
if (!Array.isArray(value)) return "";
|
|
333
|
+
return value.flatMap((item) => isObject(item) && item.type === "text" && typeof item.text === "string" ? [item.text] : []).join("\n");
|
|
334
|
+
};
|
|
335
|
+
var outcomeOf = (name, structured, result) => {
|
|
336
|
+
const value = structured ? result.structuredOutput : textOf(result.structuredOutput);
|
|
337
|
+
if (!result.isError || structured && value !== void 0) return { ok: true, value: value ?? null };
|
|
338
|
+
const message = structured ? "" : value;
|
|
339
|
+
const diagnostics = result.diagnostics.filter((item) => item.severity === "error").map((item) => item.message).join("\n");
|
|
340
|
+
return { ok: false, message: message || diagnostics || `Tool ${name} failed` };
|
|
341
|
+
};
|
|
342
|
+
var words = (text) => text.toLowerCase().split(/[^a-z0-9]+/).filter((word) => word.length > 1);
|
|
343
|
+
var searchCatalog = (tools, query, limit) => {
|
|
344
|
+
const terms = words(query);
|
|
345
|
+
return tools.map((tool, index) => {
|
|
346
|
+
const name = new Set(words(tool.name));
|
|
347
|
+
const description = new Set(words(tool.description));
|
|
348
|
+
const score = terms.reduce((sum, term) => sum + (name.has(term) ? 3 : 0) + (description.has(term) ? 1 : 0), 0);
|
|
349
|
+
return { tool, index, score };
|
|
350
|
+
}).filter((entry) => entry.score > 0).sort((a, b) => b.score - a.score || a.index - b.index).slice(0, limit).map(({ tool }) => ({ name: tool.name, description: tool.description }));
|
|
351
|
+
};
|
|
352
|
+
var schemaOf = (value) => isObject(value) ? value : {};
|
|
353
|
+
var notCalled = async () => {
|
|
354
|
+
throw new Error("declaration only");
|
|
355
|
+
};
|
|
356
|
+
var declaredTool = (tool) => ({
|
|
357
|
+
name: tool.name,
|
|
358
|
+
execute: notCalled,
|
|
359
|
+
description: tool.description,
|
|
360
|
+
inputSchema: schemaOf(tool.parameters),
|
|
361
|
+
outputSchema: schemaOf(tool.structuredOutputSchema ?? TEXT_OUTPUT_SCHEMA)
|
|
362
|
+
});
|
|
363
|
+
var describeToolText = (tool) => `${tool.description.trim()}
|
|
364
|
+
|
|
365
|
+
\`\`\`ts
|
|
366
|
+
declare const tools: { ${renderToolSignature(declaredTool(tool))} };
|
|
367
|
+
\`\`\``;
|
|
368
|
+
var selectDeclarations = (tools, budgetTokens) => {
|
|
369
|
+
const entries = tools.map((tool, index) => {
|
|
370
|
+
const declared = declaredTool(tool);
|
|
371
|
+
return { index, declared, cost: Math.ceil(renderDeclarations({ tools: [declared] }).length / CHARS_PER_TOKEN) };
|
|
372
|
+
});
|
|
373
|
+
let remaining = budgetTokens;
|
|
374
|
+
const shown = /* @__PURE__ */ new Set();
|
|
375
|
+
for (const entry of [...entries].sort((a, b) => a.cost - b.cost || a.index - b.index)) {
|
|
376
|
+
if (entry.cost > remaining) break;
|
|
377
|
+
remaining -= entry.cost;
|
|
378
|
+
shown.add(entry.index);
|
|
379
|
+
}
|
|
380
|
+
return { tools: entries.filter((entry) => shown.has(entry.index)).map((entry) => entry.declared), cut: shown.size < entries.length };
|
|
381
|
+
};
|
|
382
|
+
var providerDeclarations = (providers) => [...providers].flatMap(([provider, granted]) => Object.keys(granted.actions).filter((action) => ACTION_NAME.test(action)).map((action) => ({
|
|
383
|
+
name: `${provider}.${action}`,
|
|
384
|
+
execute: notCalled,
|
|
385
|
+
inputSchema: { type: "object", additionalProperties: true }
|
|
386
|
+
})));
|
|
387
|
+
var describeCalls = (calls) => {
|
|
388
|
+
if (calls.length === 0) return "No nested calls were made.";
|
|
389
|
+
const listed = calls.slice(0, MAX_LISTED_CALLS).map((call) => `${call.name} (${call.ok === void 0 ? "unfinished" : call.ok ? "ok" : "failed"})`);
|
|
390
|
+
const more = calls.length > MAX_LISTED_CALLS ? `, and ${calls.length - MAX_LISTED_CALLS} more` : "";
|
|
391
|
+
return `Nested calls made before the error (they are not undone): ${listed.join(", ")}${more}.`;
|
|
392
|
+
};
|
|
393
|
+
var withExecutionSignal = (context, signal) => ({
|
|
394
|
+
abortSignal: context.abortSignal === void 0 ? signal : AbortSignal.any([context.abortSignal, signal]),
|
|
395
|
+
get telemetry() {
|
|
396
|
+
return context.telemetry;
|
|
397
|
+
},
|
|
398
|
+
value: (key) => context.value(key),
|
|
399
|
+
toString: () => context.toString()
|
|
400
|
+
});
|
|
401
|
+
var cut = (text, max, what) => text.length <= max ? text : `${text.slice(0, max)}
|
|
402
|
+
[${what} truncated: ${max} of ${text.length} characters shown]`;
|
|
403
|
+
function createFabricExtension(options = {}) {
|
|
404
|
+
const d = FABRIC_DURABLE_DEFAULTS;
|
|
405
|
+
const name = options.name ?? d.name;
|
|
406
|
+
const toolName = options.toolName ?? d.toolName;
|
|
407
|
+
const timeoutMs = positive(options.timeoutMs, d.timeoutMs, "timeoutMs");
|
|
408
|
+
const memoryLimitBytes = positive(options.memoryLimitBytes, d.memoryLimitBytes, "memoryLimitBytes");
|
|
409
|
+
const maxLogChars = positive(options.maxLogChars, d.maxLogChars, "maxLogChars");
|
|
410
|
+
const maxResultChars = positive(options.maxResultChars, d.maxResultChars, "maxResultChars");
|
|
411
|
+
const maxArgumentBytes = positive(options.maxArgumentBytes, d.maxArgumentBytes, "maxArgumentBytes");
|
|
412
|
+
const sectionTokenBudget = positive(options.sectionTokenBudget, d.sectionTokenBudget, "sectionTokenBudget");
|
|
413
|
+
const toolAllowlist = options.tools === void 0 ? void 0 : new Set(options.tools);
|
|
414
|
+
const providers = /* @__PURE__ */ new Map();
|
|
415
|
+
for (const [provider, granted] of Object.entries(options.providers ?? {})) {
|
|
416
|
+
if (!PROVIDER_NAME.test(provider)) throw new Error(`Invalid Fabric provider name: ${provider}`);
|
|
417
|
+
providers.set(provider, granted);
|
|
418
|
+
}
|
|
419
|
+
const report = (error, info) => {
|
|
420
|
+
try {
|
|
421
|
+
options.onError?.(error, info);
|
|
422
|
+
} catch {
|
|
423
|
+
}
|
|
424
|
+
};
|
|
425
|
+
const grantedTools = (callable) => callable.filter((tool2) => tool2.name !== toolName && (toolAllowlist === void 0 || toolAllowlist.has(tool2.name)));
|
|
426
|
+
const copyArguments = (value, target) => {
|
|
427
|
+
if (value === void 0) value = {};
|
|
428
|
+
if (!isObject(value)) throw new FabricDurableRefusal(`${target} takes one argument object`);
|
|
429
|
+
const json = JSON.stringify(value);
|
|
430
|
+
if (utf8Bytes(json) > maxArgumentBytes) {
|
|
431
|
+
throw new FabricDurableRefusal(`${target} arguments exceed ${maxArgumentBytes} bytes`);
|
|
432
|
+
}
|
|
433
|
+
return JSON.parse(json);
|
|
434
|
+
};
|
|
435
|
+
const hostCall = (api, context, calls, journal, stop, stopped) => {
|
|
436
|
+
const info = { conversationId: api.conversationId, callId: api.callId };
|
|
437
|
+
let catalog;
|
|
438
|
+
const tools = () => catalog ??= api.agent(context).then((agent) => grantedTools(agent.callable));
|
|
439
|
+
const granted = async (toolNameArg) => {
|
|
440
|
+
const tool2 = typeof toolNameArg === "string" ? (await tools()).find((item) => item.name === toolNameArg) ?? (await tools()).find((item) => toCodemodeIdentifier(item.name) === toolNameArg) : void 0;
|
|
441
|
+
if (tool2 === void 0) throw new FabricDurableRefusal(`Tool not granted by this host: ${String(toolNameArg)}`);
|
|
442
|
+
return tool2;
|
|
443
|
+
};
|
|
444
|
+
const grantedAction = (ref) => {
|
|
445
|
+
if (typeof ref !== "string") throw new FabricDurableRefusal("Fabric ref must be a string");
|
|
446
|
+
const dot = ref.indexOf(".");
|
|
447
|
+
const provider = dot < 0 ? ref : ref.slice(0, dot);
|
|
448
|
+
const actionName = dot < 0 ? "" : ref.slice(dot + 1);
|
|
449
|
+
const grantedProvider = providers.get(provider);
|
|
450
|
+
if (grantedProvider === void 0) throw new FabricDurableRefusal(`Fabric provider not granted by this host: ${provider}`);
|
|
451
|
+
const entry = ACTION_NAME.test(actionName) && Object.hasOwn(grantedProvider.actions, actionName) ? grantedProvider.actions[actionName] : void 0;
|
|
452
|
+
const action = typeof entry === "function" ? entry : isObject(entry) && typeof entry.run === "function" ? entry.run : void 0;
|
|
453
|
+
if (action === void 0) throw new FabricDurableRefusal(`Fabric action not granted by this host: ${ref}`);
|
|
454
|
+
return { ref, action, repeatable: typeof entry === "object" && entry.repeatable === true };
|
|
455
|
+
};
|
|
456
|
+
const checkActive = (signal) => {
|
|
457
|
+
if (stopped()) throw new ProgramStop("fabric_exec stopped");
|
|
458
|
+
context.abortSignal?.throwIfAborted();
|
|
459
|
+
signal.throwIfAborted();
|
|
460
|
+
};
|
|
461
|
+
const runAction = async (ref, args, seq, signal) => {
|
|
462
|
+
const { ref: resolved, action, repeatable } = grantedAction(ref);
|
|
463
|
+
const copied = copyArguments(args, resolved);
|
|
464
|
+
if (!repeatable && journal !== void 0 && seq !== void 0) await journal.intent(seq, resolved);
|
|
465
|
+
checkActive(signal);
|
|
466
|
+
try {
|
|
467
|
+
const value = await action(copied, { api, context: withExecutionSignal(context, signal) });
|
|
468
|
+
return value === void 0 ? null : JSON.parse(JSON.stringify(value));
|
|
469
|
+
} catch (error) {
|
|
470
|
+
if (error instanceof FabricDurableRefusal) throw new FabricDurableRefusal(error.message);
|
|
471
|
+
report(error, info);
|
|
472
|
+
throw new FabricDurableRefusal(`Fabric action ${resolved} failed`);
|
|
473
|
+
}
|
|
474
|
+
};
|
|
475
|
+
const dispatch = async (ref, args, signal, _humanWait, call) => {
|
|
476
|
+
switch (ref) {
|
|
477
|
+
case "fabric.$piAllTools":
|
|
478
|
+
return (await tools()).map((tool2) => {
|
|
479
|
+
const jsName = toCodemodeIdentifier(tool2.name);
|
|
480
|
+
return { name: tool2.name, description: tool2.description, ...jsName === tool2.name ? {} : { jsName } };
|
|
481
|
+
});
|
|
482
|
+
case "fabric.$piSearch": {
|
|
483
|
+
if (typeof args.query !== "string") throw new FabricDurableRefusal("searchTools() expects a query string");
|
|
484
|
+
const limit = args.limit ?? DEFAULT_SEARCH_LIMIT;
|
|
485
|
+
if (typeof limit !== "number" || !Number.isSafeInteger(limit) || limit < 1) throw new FabricDurableRefusal("searchTools() limit must be a positive integer");
|
|
486
|
+
return searchCatalog(await tools(), args.query, limit);
|
|
487
|
+
}
|
|
488
|
+
case "fabric.$piDescribe": {
|
|
489
|
+
const tool2 = await granted(args.name);
|
|
490
|
+
return describeToolText(tool2);
|
|
491
|
+
}
|
|
492
|
+
case "fabric.$nativeTool": {
|
|
493
|
+
const tool2 = await granted(args.name);
|
|
494
|
+
const copied = copyArguments(args.args, tool2.name);
|
|
495
|
+
const record = { name: tool2.name };
|
|
496
|
+
calls.push(record);
|
|
497
|
+
let result;
|
|
498
|
+
try {
|
|
499
|
+
checkActive(signal);
|
|
500
|
+
result = await api.executeTool(tool2.name, copied, withExecutionSignal(context, signal), call === void 0 ? {} : { key: `f${call.seq}` });
|
|
501
|
+
} catch (error) {
|
|
502
|
+
if (call !== void 0 && error instanceof Error && /already made with another tool or other arguments/.test(error.message)) {
|
|
503
|
+
stop(`fabric_exec could not resume after an interruption: the program did not repeat its recorded call ${call.seq + 1}. No call after the divergence ran.`);
|
|
504
|
+
}
|
|
505
|
+
throw error;
|
|
506
|
+
}
|
|
507
|
+
if (result.diagnostics.some((item) => item.code === INTERRUPTED_CODE)) {
|
|
508
|
+
stop(maybeRanReport(callPreview("fabric.$nativeTool", { name: tool2.name, args: copied }), journal?.replayedCalls() ?? 0));
|
|
509
|
+
}
|
|
510
|
+
const outcome = outcomeOf(tool2.name, tool2.structuredOutputSchema !== void 0, result);
|
|
511
|
+
record.ok = outcome.ok;
|
|
512
|
+
if (!outcome.ok) throw new NestedToolError(outcome.message);
|
|
513
|
+
return outcome.value;
|
|
514
|
+
}
|
|
515
|
+
case "fabric.$providers":
|
|
516
|
+
return [...providers].map(([provider, entry]) => ({ name: provider, description: entry.description ?? "", actions: Object.keys(entry.actions) }));
|
|
517
|
+
case "fabric.$call":
|
|
518
|
+
return runAction(args.ref, args.args, call?.seq, signal);
|
|
519
|
+
default:
|
|
520
|
+
throw new FabricDurableRefusal(`Not available in this durable host: ${ref}`);
|
|
521
|
+
}
|
|
522
|
+
};
|
|
523
|
+
return async (ref, args, ...rest) => {
|
|
524
|
+
if (stopped()) throw new ProgramStop("fabric_exec stopped");
|
|
525
|
+
try {
|
|
526
|
+
checkActive(rest[0]);
|
|
527
|
+
return await dispatch(ref, args, ...rest);
|
|
528
|
+
} catch (error) {
|
|
529
|
+
if (error instanceof FabricDurableRefusal || error instanceof NestedToolError || error instanceof ProgramStop) throw error;
|
|
530
|
+
report(error, info);
|
|
531
|
+
throw new FabricDurableRefusal("Fabric host call failed");
|
|
532
|
+
}
|
|
533
|
+
};
|
|
534
|
+
};
|
|
535
|
+
const formatResult = (result, calls, stopReport) => {
|
|
536
|
+
if (stopReport !== void 0) return { output: [{ type: "text", text: cut(stopReport, maxResultChars, `${toolName} output`) }], isError: true };
|
|
537
|
+
const parts = [...result.logs];
|
|
538
|
+
const failed = result.terminationReason !== "completed";
|
|
539
|
+
if (failed) {
|
|
540
|
+
parts.push(`Error (${result.terminationReason}): ${result.error ?? "program failed"}`, describeCalls(calls));
|
|
541
|
+
} else if (result.value !== void 0) {
|
|
542
|
+
parts.push(typeof result.value === "string" ? result.value : JSON.stringify(result.value, null, 2));
|
|
543
|
+
}
|
|
544
|
+
const text = cut(parts.join("\n") || "(no result)", maxResultChars, `${toolName} output`);
|
|
545
|
+
return { output: [{ type: "text", text }], ...failed ? { isError: true } : {} };
|
|
546
|
+
};
|
|
547
|
+
const internalError = {
|
|
548
|
+
output: [{ type: "text", text: `${toolName} failed with an internal error. The program may not have run.` }],
|
|
549
|
+
isError: true
|
|
550
|
+
};
|
|
551
|
+
const tool = {
|
|
552
|
+
name: toolName,
|
|
553
|
+
description: "Run a TypeScript program in a sandbox. `tools.<name>(args)` calls this conversation's tools and returns their output; run independent calls together with Promise.all. `searchTools(query)` and `describeTool(name)` find tools the prompt does not list. `print()` logs; the program's return value is the result. No files, shell or network.",
|
|
554
|
+
parameters: Type.Object({
|
|
555
|
+
code: Type.String({ description: "TypeScript function body; top-level await and return are supported." }),
|
|
556
|
+
payloads: Type.Optional(Type.Record(Type.String(), Type.String(), { description: "Named strings readable as \u03C0.<key>." }))
|
|
557
|
+
}),
|
|
558
|
+
// Rerun after a restart: the journal serves every recorded result, nested calls keep their keys, and a call that
|
|
559
|
+
// may have taken effect stops the program instead of running twice.
|
|
560
|
+
replay: "safe",
|
|
561
|
+
// Programs cannot start programs.
|
|
562
|
+
callers: ["model"],
|
|
563
|
+
// This tool cuts its own output with a notice; the Harness limit only stops a runaway.
|
|
564
|
+
outputLimits: { maxBytes: maxResultChars * 4 + 4096, maxLines: 1e6 },
|
|
565
|
+
async execute(args, api, context) {
|
|
566
|
+
try {
|
|
567
|
+
const input = args;
|
|
568
|
+
const runtime = options.runtime ?? await loadKernel(options.quickJsWasmModule);
|
|
569
|
+
const calls = [];
|
|
570
|
+
const info = { conversationId: api.conversationId, callId: api.callId };
|
|
571
|
+
const identity = {
|
|
572
|
+
code: input.code,
|
|
573
|
+
payloads: input.payloads ?? {},
|
|
574
|
+
limits: [timeoutMs, memoryLimitBytes, maxLogChars],
|
|
575
|
+
tools: toolAllowlist === void 0 ? null : [...toolAllowlist].sort(),
|
|
576
|
+
providers: [...providers].map(([provider, entry]) => [provider, Object.keys(entry.actions).sort()])
|
|
577
|
+
};
|
|
578
|
+
let journal;
|
|
579
|
+
try {
|
|
580
|
+
journal = await FabricDurableJournal.open(api, context, identity, FABRIC_DURABLE_ENGINE, { onWriteError: (error) => report(error, info) });
|
|
581
|
+
} catch (error) {
|
|
582
|
+
if (error instanceof FabricDurableJournalRefusal) return { output: [{ type: "text", text: error.message }], isError: true };
|
|
583
|
+
throw error;
|
|
584
|
+
}
|
|
585
|
+
let stopReport;
|
|
586
|
+
const halt = new AbortController();
|
|
587
|
+
const stop = (text) => {
|
|
588
|
+
stopReport ??= text;
|
|
589
|
+
halt.abort(new Error(text));
|
|
590
|
+
throw new ProgramStop(text);
|
|
591
|
+
};
|
|
592
|
+
const signal = context.abortSignal === void 0 ? halt.signal : AbortSignal.any([context.abortSignal, halt.signal]);
|
|
593
|
+
const sandbox = {
|
|
594
|
+
journal,
|
|
595
|
+
timeoutMs,
|
|
596
|
+
memoryLimitBytes,
|
|
597
|
+
maxLogChars,
|
|
598
|
+
maxPendingTimers: MAX_PENDING_TIMERS,
|
|
599
|
+
codemodeProfile: "native",
|
|
600
|
+
nativeToolsEnabled: true,
|
|
601
|
+
nativeStoreEnabled: false,
|
|
602
|
+
providerGlobals: [...providers.keys()],
|
|
603
|
+
...input.payloads === void 0 ? {} : { strings: { ...input.payloads } },
|
|
604
|
+
signal
|
|
605
|
+
};
|
|
606
|
+
let settled = false;
|
|
607
|
+
try {
|
|
608
|
+
const result = await runtime.execute(input.code, hostCall(api, withExecutionSignal(context, signal), calls, journal, stop, () => settled || stopReport !== void 0), sandbox);
|
|
609
|
+
return formatResult(result, calls, stopReport ?? journal.stopReport);
|
|
610
|
+
} finally {
|
|
611
|
+
settled = true;
|
|
612
|
+
halt.abort(new Error("fabric_exec execution ended"));
|
|
613
|
+
}
|
|
614
|
+
} catch (error) {
|
|
615
|
+
report(error, { conversationId: api.conversationId, callId: api.callId });
|
|
616
|
+
return internalError;
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
};
|
|
620
|
+
const guidance = {
|
|
621
|
+
key: "fabric",
|
|
622
|
+
render: (input) => {
|
|
623
|
+
const callable = grantedTools(input.agent.callable);
|
|
624
|
+
const listed = callable.filter((item) => item.deferred !== true);
|
|
625
|
+
const { tools: shown, cut: budgetCut } = selectDeclarations(listed, sectionTokenBudget);
|
|
626
|
+
const hidden = budgetCut || listed.length < callable.length;
|
|
627
|
+
const granted = [...providers.keys()];
|
|
628
|
+
const declarations = renderDeclarations({ tools: shown, globals: providerDeclarations(providers) });
|
|
629
|
+
return [
|
|
630
|
+
`Use ${toolName} to batch several tool calls in one TypeScript program and return only the compact result.`,
|
|
631
|
+
callable.length === 0 ? "Programs can call no tools here." : "Tools programs can call (`await tools.<name>(args)`):",
|
|
632
|
+
...declarations === "" ? [] : ["```ts", declarations, "```"],
|
|
633
|
+
...hidden ? ["Some tools are not listed: find them with `searchTools(query)` and read one with `describeTool(name)`."] : [],
|
|
634
|
+
granted.length ? `Granted providers: ${granted.map((provider) => {
|
|
635
|
+
const about = providers.get(provider)?.description?.trim();
|
|
636
|
+
return about ? `${provider} (${about})` : provider;
|
|
637
|
+
}).join(", ")}.` : "No Fabric providers are available."
|
|
638
|
+
].join("\n");
|
|
639
|
+
}
|
|
640
|
+
};
|
|
641
|
+
return { name, tools: [tool], sections: [guidance] };
|
|
642
|
+
}
|
|
643
|
+
export {
|
|
644
|
+
FABRIC_DURABLE_DEFAULTS,
|
|
645
|
+
FABRIC_DURABLE_ENGINE,
|
|
646
|
+
FabricDurableRefusal,
|
|
647
|
+
createFabricExtension
|
|
648
|
+
};
|
|
649
|
+
//# sourceMappingURL=durable-extension.js.map
|