@e4779/pi-fabric 0.92.17-fork.3
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/LICENSE +21 -0
- package/README.md +181 -0
- package/THIRD_PARTY_NOTICES.md +33 -0
- package/dist/activity/store.d.ts +33 -0
- package/dist/activity/store.d.ts.map +1 -0
- package/dist/activity/types.d.ts +104 -0
- package/dist/activity/types.d.ts.map +1 -0
- package/dist/actors/binding-store.d.ts +17 -0
- package/dist/actors/binding-store.d.ts.map +1 -0
- package/dist/actors/context.d.ts +13 -0
- package/dist/actors/context.d.ts.map +1 -0
- package/dist/actors/delivery-policy.d.ts +8 -0
- package/dist/actors/delivery-policy.d.ts.map +1 -0
- package/dist/actors/directory.d.ts +47 -0
- package/dist/actors/directory.d.ts.map +1 -0
- package/dist/actors/global-registry.d.ts +47 -0
- package/dist/actors/global-registry.d.ts.map +1 -0
- package/dist/actors/host-event-observer.d.ts +5 -0
- package/dist/actors/host-event-observer.d.ts.map +1 -0
- package/dist/actors/host-event-payload.d.ts +14 -0
- package/dist/actors/host-event-payload.d.ts.map +1 -0
- package/dist/actors/log-store.d.ts +22 -0
- package/dist/actors/log-store.d.ts.map +1 -0
- package/dist/actors/manager.d.ts +175 -0
- package/dist/actors/manager.d.ts.map +1 -0
- package/dist/actors/mesh-monitor.d.ts +22 -0
- package/dist/actors/mesh-monitor.d.ts.map +1 -0
- package/dist/actors/predicate.d.ts +7 -0
- package/dist/actors/predicate.d.ts.map +1 -0
- package/dist/actors/registry-store.d.ts +15 -0
- package/dist/actors/registry-store.d.ts.map +1 -0
- package/dist/actors/types.d.ts +218 -0
- package/dist/actors/types.d.ts.map +1 -0
- package/dist/agents/bash-worktree-add.d.ts +24 -0
- package/dist/agents/bash-worktree-add.d.ts.map +1 -0
- package/dist/agents/budget-ledger.d.ts +88 -0
- package/dist/agents/budget-ledger.d.ts.map +1 -0
- package/dist/agents/claude-cli.d.ts +32 -0
- package/dist/agents/claude-cli.d.ts.map +1 -0
- package/dist/agents/claude-cli.js +17 -0
- package/dist/agents/claude-cli.js.map +7 -0
- package/dist/agents/clone-first-worktree.d.ts +17 -0
- package/dist/agents/clone-first-worktree.d.ts.map +1 -0
- package/dist/agents/compact-control.d.ts +32 -0
- package/dist/agents/compact-control.d.ts.map +1 -0
- package/dist/agents/compact-control.js +129 -0
- package/dist/agents/compact-control.js.map +7 -0
- package/dist/agents/constants.d.ts +9 -0
- package/dist/agents/constants.d.ts.map +1 -0
- package/dist/agents/cow-clone.d.ts +8 -0
- package/dist/agents/cow-clone.d.ts.map +1 -0
- package/dist/agents/handoff-completion.d.ts +4 -0
- package/dist/agents/handoff-completion.d.ts.map +1 -0
- package/dist/agents/handoff.d.ts +19 -0
- package/dist/agents/handoff.d.ts.map +1 -0
- package/dist/agents/lifecycle.d.ts +32 -0
- package/dist/agents/lifecycle.d.ts.map +1 -0
- package/dist/agents/manager.d.ts +75 -0
- package/dist/agents/manager.d.ts.map +1 -0
- package/dist/agents/pi-binary.d.ts +7 -0
- package/dist/agents/pi-binary.d.ts.map +1 -0
- package/dist/agents/request.d.ts +13 -0
- package/dist/agents/request.d.ts.map +1 -0
- package/dist/agents/result.d.ts +8 -0
- package/dist/agents/result.d.ts.map +1 -0
- package/dist/agents/result.js +9 -0
- package/dist/agents/result.js.map +7 -0
- package/dist/agents/rm.d.ts +15 -0
- package/dist/agents/rm.d.ts.map +1 -0
- package/dist/agents/semaphore.d.ts +7 -0
- package/dist/agents/semaphore.d.ts.map +1 -0
- package/dist/agents/service-provider.d.ts +9 -0
- package/dist/agents/service-provider.d.ts.map +1 -0
- package/dist/agents/service-schema.d.ts +6 -0
- package/dist/agents/service-schema.d.ts.map +1 -0
- package/dist/agents/service-types.d.ts +192 -0
- package/dist/agents/service-types.d.ts.map +1 -0
- package/dist/agents/service.d.ts +36 -0
- package/dist/agents/service.d.ts.map +1 -0
- package/dist/agents/session-export.d.ts +39 -0
- package/dist/agents/session-export.d.ts.map +1 -0
- package/dist/agents/session-pins.d.ts +24 -0
- package/dist/agents/session-pins.d.ts.map +1 -0
- package/dist/agents/thinking-transfer.d.ts +39 -0
- package/dist/agents/thinking-transfer.d.ts.map +1 -0
- package/dist/agents/transports/herdr-transport.d.ts +10 -0
- package/dist/agents/transports/herdr-transport.d.ts.map +1 -0
- package/dist/agents/transports/localterm-transport.d.ts +7 -0
- package/dist/agents/transports/localterm-transport.d.ts.map +1 -0
- package/dist/agents/transports/process-transport.d.ts +7 -0
- package/dist/agents/transports/process-transport.d.ts.map +1 -0
- package/dist/agents/transports/process-utils.d.ts +33 -0
- package/dist/agents/transports/process-utils.d.ts.map +1 -0
- package/dist/agents/transports/screen-transport.d.ts +7 -0
- package/dist/agents/transports/screen-transport.d.ts.map +1 -0
- package/dist/agents/transports/tmux-transport.d.ts +7 -0
- package/dist/agents/transports/tmux-transport.d.ts.map +1 -0
- package/dist/agents/types.d.ts +280 -0
- package/dist/agents/types.d.ts.map +1 -0
- package/dist/agents/veda-cli.d.ts +22 -0
- package/dist/agents/veda-cli.d.ts.map +1 -0
- package/dist/agents/veda-cli.js +13 -0
- package/dist/agents/veda-cli.js.map +7 -0
- package/dist/agents/worktree-manager.d.ts +14 -0
- package/dist/agents/worktree-manager.d.ts.map +1 -0
- package/dist/agents/worktree-paths.d.ts +5 -0
- package/dist/agents/worktree-paths.d.ts.map +1 -0
- package/dist/agents.d.ts +8 -0
- package/dist/agents.d.ts.map +1 -0
- package/dist/agents.js +761 -0
- package/dist/agents.js.map +7 -0
- package/dist/async-settlement.d.ts +4 -0
- package/dist/async-settlement.d.ts.map +1 -0
- package/dist/audit/details.d.ts +86 -0
- package/dist/audit/details.d.ts.map +1 -0
- package/dist/audit/index.d.ts +4 -0
- package/dist/audit/index.d.ts.map +1 -0
- package/dist/audit/projection.d.ts +20 -0
- package/dist/audit/projection.d.ts.map +1 -0
- package/dist/audit/trace.d.ts +99 -0
- package/dist/audit/trace.d.ts.map +1 -0
- package/dist/capture/catalog.d.ts +30 -0
- package/dist/capture/catalog.d.ts.map +1 -0
- package/dist/capture/interceptor.d.ts +20 -0
- package/dist/capture/interceptor.d.ts.map +1 -0
- package/dist/capture/wrapper.d.ts +15 -0
- package/dist/capture/wrapper.d.ts.map +1 -0
- package/dist/chunks/chunk-2DMJ7MEI.js +1984 -0
- package/dist/chunks/chunk-2DMJ7MEI.js.map +7 -0
- package/dist/chunks/chunk-2PZWDVJB.js +738 -0
- package/dist/chunks/chunk-2PZWDVJB.js.map +7 -0
- package/dist/chunks/chunk-2UQV52II.js +440 -0
- package/dist/chunks/chunk-2UQV52II.js.map +7 -0
- package/dist/chunks/chunk-32BNQ75J.js +1445 -0
- package/dist/chunks/chunk-32BNQ75J.js.map +7 -0
- package/dist/chunks/chunk-3H7SDWZI.js +467 -0
- package/dist/chunks/chunk-3H7SDWZI.js.map +7 -0
- package/dist/chunks/chunk-3MEHEH6B.js +41 -0
- package/dist/chunks/chunk-3MEHEH6B.js.map +7 -0
- package/dist/chunks/chunk-3QECYQGA.js +70 -0
- package/dist/chunks/chunk-3QECYQGA.js.map +7 -0
- package/dist/chunks/chunk-3WIGAX56.js +644 -0
- package/dist/chunks/chunk-3WIGAX56.js.map +7 -0
- package/dist/chunks/chunk-3YZUQESG.js +16 -0
- package/dist/chunks/chunk-3YZUQESG.js.map +7 -0
- package/dist/chunks/chunk-4JETKRFE.js +287 -0
- package/dist/chunks/chunk-4JETKRFE.js.map +7 -0
- package/dist/chunks/chunk-4SSMGBF4.js +93 -0
- package/dist/chunks/chunk-4SSMGBF4.js.map +7 -0
- package/dist/chunks/chunk-5SU3YXBS.js +15 -0
- package/dist/chunks/chunk-5SU3YXBS.js.map +7 -0
- package/dist/chunks/chunk-656HWVFU.js +409 -0
- package/dist/chunks/chunk-656HWVFU.js.map +7 -0
- package/dist/chunks/chunk-7A6NVHB5.js +1242 -0
- package/dist/chunks/chunk-7A6NVHB5.js.map +7 -0
- package/dist/chunks/chunk-7TB7NXSL.js +58 -0
- package/dist/chunks/chunk-7TB7NXSL.js.map +7 -0
- package/dist/chunks/chunk-AAHHYDTO.js +24 -0
- package/dist/chunks/chunk-AAHHYDTO.js.map +7 -0
- package/dist/chunks/chunk-ARLYAW2A.js +95 -0
- package/dist/chunks/chunk-ARLYAW2A.js.map +7 -0
- package/dist/chunks/chunk-AYBIR4YV.js +210 -0
- package/dist/chunks/chunk-AYBIR4YV.js.map +7 -0
- package/dist/chunks/chunk-BOTRGFQQ.js +87 -0
- package/dist/chunks/chunk-BOTRGFQQ.js.map +7 -0
- package/dist/chunks/chunk-CGPK5WHX.js +96 -0
- package/dist/chunks/chunk-CGPK5WHX.js.map +7 -0
- package/dist/chunks/chunk-CI56CW53.js +470 -0
- package/dist/chunks/chunk-CI56CW53.js.map +7 -0
- package/dist/chunks/chunk-CPSW2GW4.js +1466 -0
- package/dist/chunks/chunk-CPSW2GW4.js.map +7 -0
- package/dist/chunks/chunk-CQFP2RCP.js +64 -0
- package/dist/chunks/chunk-CQFP2RCP.js.map +7 -0
- package/dist/chunks/chunk-D5WKZONW.js +797 -0
- package/dist/chunks/chunk-D5WKZONW.js.map +7 -0
- package/dist/chunks/chunk-DLXPTBPL.js +151 -0
- package/dist/chunks/chunk-DLXPTBPL.js.map +7 -0
- package/dist/chunks/chunk-G4LADAYY.js +287 -0
- package/dist/chunks/chunk-G4LADAYY.js.map +7 -0
- package/dist/chunks/chunk-GXNR6NRU.js +447 -0
- package/dist/chunks/chunk-GXNR6NRU.js.map +7 -0
- package/dist/chunks/chunk-IGVDD2HT.js +10 -0
- package/dist/chunks/chunk-IGVDD2HT.js.map +7 -0
- package/dist/chunks/chunk-J2HV2URQ.js +1125 -0
- package/dist/chunks/chunk-J2HV2URQ.js.map +7 -0
- package/dist/chunks/chunk-KAD7UWT2.js +99 -0
- package/dist/chunks/chunk-KAD7UWT2.js.map +7 -0
- package/dist/chunks/chunk-KYXZJNV6.js +227 -0
- package/dist/chunks/chunk-KYXZJNV6.js.map +7 -0
- package/dist/chunks/chunk-LMAVZN7J.js +8 -0
- package/dist/chunks/chunk-LMAVZN7J.js.map +7 -0
- package/dist/chunks/chunk-M3S7XITB.js +110 -0
- package/dist/chunks/chunk-M3S7XITB.js.map +7 -0
- package/dist/chunks/chunk-MGDLRV2R.js +112 -0
- package/dist/chunks/chunk-MGDLRV2R.js.map +7 -0
- package/dist/chunks/chunk-MGWQOKBV.js +30 -0
- package/dist/chunks/chunk-MGWQOKBV.js.map +7 -0
- package/dist/chunks/chunk-N5GUXC6F.js +184 -0
- package/dist/chunks/chunk-N5GUXC6F.js.map +7 -0
- package/dist/chunks/chunk-NQOEHX62.js +215 -0
- package/dist/chunks/chunk-NQOEHX62.js.map +7 -0
- package/dist/chunks/chunk-OKOHRXGF.js +100 -0
- package/dist/chunks/chunk-OKOHRXGF.js.map +7 -0
- package/dist/chunks/chunk-OP2KTYQB.js +286 -0
- package/dist/chunks/chunk-OP2KTYQB.js.map +7 -0
- package/dist/chunks/chunk-OTCASLY2.js +52 -0
- package/dist/chunks/chunk-OTCASLY2.js.map +7 -0
- package/dist/chunks/chunk-PAN6C3JM.js +42 -0
- package/dist/chunks/chunk-PAN6C3JM.js.map +7 -0
- package/dist/chunks/chunk-PH7ZJ27F.js +6873 -0
- package/dist/chunks/chunk-PH7ZJ27F.js.map +7 -0
- package/dist/chunks/chunk-PM5I335G.js +225 -0
- package/dist/chunks/chunk-PM5I335G.js.map +7 -0
- package/dist/chunks/chunk-PSNXUZMY.js +218 -0
- package/dist/chunks/chunk-PSNXUZMY.js.map +7 -0
- package/dist/chunks/chunk-PXAICAUT.js +24 -0
- package/dist/chunks/chunk-PXAICAUT.js.map +7 -0
- package/dist/chunks/chunk-RERA6YWA.js +359 -0
- package/dist/chunks/chunk-RERA6YWA.js.map +7 -0
- package/dist/chunks/chunk-RNOPHITP.js +1720 -0
- package/dist/chunks/chunk-RNOPHITP.js.map +7 -0
- package/dist/chunks/chunk-RRGTKHXZ.js +931 -0
- package/dist/chunks/chunk-RRGTKHXZ.js.map +7 -0
- package/dist/chunks/chunk-SWB2OHYW.js +93 -0
- package/dist/chunks/chunk-SWB2OHYW.js.map +7 -0
- package/dist/chunks/chunk-T3A5GNCW.js +19 -0
- package/dist/chunks/chunk-T3A5GNCW.js.map +7 -0
- package/dist/chunks/chunk-TPLMVELH.js +118 -0
- package/dist/chunks/chunk-TPLMVELH.js.map +7 -0
- package/dist/chunks/chunk-TSRKCXNI.js +17 -0
- package/dist/chunks/chunk-TSRKCXNI.js.map +7 -0
- package/dist/chunks/chunk-U5FYOMG5.js +119 -0
- package/dist/chunks/chunk-U5FYOMG5.js.map +7 -0
- package/dist/chunks/chunk-U6CTHPZC.js +1924 -0
- package/dist/chunks/chunk-U6CTHPZC.js.map +7 -0
- package/dist/chunks/chunk-UDFDF7IY.js +1572 -0
- package/dist/chunks/chunk-UDFDF7IY.js.map +7 -0
- package/dist/chunks/chunk-UKMQK5VP.js +231 -0
- package/dist/chunks/chunk-UKMQK5VP.js.map +7 -0
- package/dist/chunks/chunk-UQ4LTUH4.js +2181 -0
- package/dist/chunks/chunk-UQ4LTUH4.js.map +7 -0
- package/dist/chunks/chunk-UTR3I23Z.js +65 -0
- package/dist/chunks/chunk-UTR3I23Z.js.map +7 -0
- package/dist/chunks/chunk-VPPIJRNZ.js +50 -0
- package/dist/chunks/chunk-VPPIJRNZ.js.map +7 -0
- package/dist/chunks/chunk-VRYEGVHR.js +195 -0
- package/dist/chunks/chunk-VRYEGVHR.js.map +7 -0
- package/dist/chunks/chunk-VRZNFNPB.js +4218 -0
- package/dist/chunks/chunk-VRZNFNPB.js.map +7 -0
- package/dist/chunks/chunk-VXZZJ44D.js +295 -0
- package/dist/chunks/chunk-VXZZJ44D.js.map +7 -0
- package/dist/chunks/chunk-W3FRE4VI.js +297 -0
- package/dist/chunks/chunk-W3FRE4VI.js.map +7 -0
- package/dist/chunks/chunk-WVH324VF.js +60 -0
- package/dist/chunks/chunk-WVH324VF.js.map +7 -0
- package/dist/chunks/chunk-X7G62ZGH.js +151 -0
- package/dist/chunks/chunk-X7G62ZGH.js.map +7 -0
- package/dist/chunks/chunk-XB3RJVT4.js +17 -0
- package/dist/chunks/chunk-XB3RJVT4.js.map +7 -0
- package/dist/chunks/chunk-XT4346N7.js +651 -0
- package/dist/chunks/chunk-XT4346N7.js.map +7 -0
- package/dist/chunks/chunk-Y7KNRAFL.js +1180 -0
- package/dist/chunks/chunk-Y7KNRAFL.js.map +7 -0
- package/dist/chunks/chunk-YK5AZ7CZ.js +692 -0
- package/dist/chunks/chunk-YK5AZ7CZ.js.map +7 -0
- package/dist/chunks/chunk-YU4O6SWQ.js +246 -0
- package/dist/chunks/chunk-YU4O6SWQ.js.map +7 -0
- package/dist/chunks/chunk-YU62DDKK.js +22 -0
- package/dist/chunks/chunk-YU62DDKK.js.map +7 -0
- package/dist/chunks/chunk-Z63R5GVN.js +121 -0
- package/dist/chunks/chunk-Z63R5GVN.js.map +7 -0
- package/dist/chunks/chunk-ZDNGXLEC.js +221 -0
- package/dist/chunks/chunk-ZDNGXLEC.js.map +7 -0
- package/dist/chunks/chunk-ZZ4LHQYJ.js +777 -0
- package/dist/chunks/chunk-ZZ4LHQYJ.js.map +7 -0
- package/dist/commands/fabric.d.ts +17 -0
- package/dist/commands/fabric.d.ts.map +1 -0
- package/dist/compaction/bounds.d.ts +23 -0
- package/dist/compaction/bounds.d.ts.map +1 -0
- package/dist/compaction/branch-details.d.ts +83 -0
- package/dist/compaction/branch-details.d.ts.map +1 -0
- package/dist/compaction/branch-summary.d.ts +9 -0
- package/dist/compaction/branch-summary.d.ts.map +1 -0
- package/dist/compaction/enrichers.d.ts +10 -0
- package/dist/compaction/enrichers.d.ts.map +1 -0
- package/dist/compaction/hook.d.ts +99 -0
- package/dist/compaction/hook.d.ts.map +1 -0
- package/dist/compaction/hook.js +22 -0
- package/dist/compaction/hook.js.map +7 -0
- package/dist/compaction/instructions.d.ts +38 -0
- package/dist/compaction/instructions.d.ts.map +1 -0
- package/dist/compaction/normalize.d.ts +83 -0
- package/dist/compaction/normalize.d.ts.map +1 -0
- package/dist/compaction/projections.d.ts +31 -0
- package/dist/compaction/projections.d.ts.map +1 -0
- package/dist/compaction/qa.d.ts +27 -0
- package/dist/compaction/qa.d.ts.map +1 -0
- package/dist/compaction/render.d.ts +10 -0
- package/dist/compaction/render.d.ts.map +1 -0
- package/dist/compaction/threshold.d.ts +5 -0
- package/dist/compaction/threshold.d.ts.map +1 -0
- package/dist/compaction/trace-events.d.ts +23 -0
- package/dist/compaction/trace-events.d.ts.map +1 -0
- package/dist/components/catalog.d.ts +25 -0
- package/dist/components/catalog.d.ts.map +1 -0
- package/dist/components/effect-policy.d.ts +21 -0
- package/dist/components/effect-policy.d.ts.map +1 -0
- package/dist/components/effect-scope.d.ts +31 -0
- package/dist/components/effect-scope.d.ts.map +1 -0
- package/dist/components/loader.d.ts +27 -0
- package/dist/components/loader.d.ts.map +1 -0
- package/dist/components/model-guidance.d.ts +48 -0
- package/dist/components/model-guidance.d.ts.map +1 -0
- package/dist/components/provider-component.d.ts +31 -0
- package/dist/components/provider-component.d.ts.map +1 -0
- package/dist/components/supervisor.d.ts +29 -0
- package/dist/components/supervisor.d.ts.map +1 -0
- package/dist/components/types.d.ts +140 -0
- package/dist/components/types.d.ts.map +1 -0
- package/dist/config-migrations.d.ts +11 -0
- package/dist/config-migrations.d.ts.map +1 -0
- package/dist/config.d.ts +282 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/core/action-arguments.d.ts +12 -0
- package/dist/core/action-arguments.d.ts.map +1 -0
- package/dist/core/action-registry.d.ts +170 -0
- package/dist/core/action-registry.d.ts.map +1 -0
- package/dist/core/action-registry.js +20 -0
- package/dist/core/action-registry.js.map +7 -0
- package/dist/core/action-repair.d.ts +15 -0
- package/dist/core/action-repair.d.ts.map +1 -0
- package/dist/core/action-result.d.ts +13 -0
- package/dist/core/action-result.d.ts.map +1 -0
- package/dist/core/agent-dir.d.ts +2 -0
- package/dist/core/agent-dir.d.ts.map +1 -0
- package/dist/core/approval-controller.d.ts +31 -0
- package/dist/core/approval-controller.d.ts.map +1 -0
- package/dist/core/atomic-write.d.ts +15 -0
- package/dist/core/atomic-write.d.ts.map +1 -0
- package/dist/core/auto-approval-classifier.d.ts +17 -0
- package/dist/core/auto-approval-classifier.d.ts.map +1 -0
- package/dist/core/call-preview.d.ts +8 -0
- package/dist/core/call-preview.d.ts.map +1 -0
- package/dist/core/child-tool-allowlist.d.ts +3 -0
- package/dist/core/child-tool-allowlist.d.ts.map +1 -0
- package/dist/core/compact-controller.d.ts +42 -0
- package/dist/core/compact-controller.d.ts.map +1 -0
- package/dist/core/core-override-guidance.d.ts +7 -0
- package/dist/core/core-override-guidance.d.ts.map +1 -0
- package/dist/core/damaged-file.d.ts +6 -0
- package/dist/core/damaged-file.d.ts.map +1 -0
- package/dist/core/direct-tool-approval.d.ts +19 -0
- package/dist/core/direct-tool-approval.d.ts.map +1 -0
- package/dist/core/effect-conflict.d.ts +3 -0
- package/dist/core/effect-conflict.d.ts.map +1 -0
- package/dist/core/file-lock.d.ts +12 -0
- package/dist/core/file-lock.d.ts.map +1 -0
- package/dist/core/kernel-skills.d.ts +3 -0
- package/dist/core/kernel-skills.d.ts.map +1 -0
- package/dist/core/model-resolution.d.ts +62 -0
- package/dist/core/model-resolution.d.ts.map +1 -0
- package/dist/core/model-usage.d.ts +8 -0
- package/dist/core/model-usage.d.ts.map +1 -0
- package/dist/core/pi-arguments.d.ts +3 -0
- package/dist/core/pi-arguments.d.ts.map +1 -0
- package/dist/core/pi-bash-error.d.ts +9 -0
- package/dist/core/pi-bash-error.d.ts.map +1 -0
- package/dist/core/pi-tools.d.ts +9 -0
- package/dist/core/pi-tools.d.ts.map +1 -0
- package/dist/core/provider-bindings.d.ts +47 -0
- package/dist/core/provider-bindings.d.ts.map +1 -0
- package/dist/core/proxy-contract.d.ts +18 -0
- package/dist/core/proxy-contract.d.ts.map +1 -0
- package/dist/core/session-context.d.ts +14 -0
- package/dist/core/session-context.d.ts.map +1 -0
- package/dist/core/shell-jobs.d.ts +99 -0
- package/dist/core/shell-jobs.d.ts.map +1 -0
- package/dist/core/skill-block.d.ts +10 -0
- package/dist/core/skill-block.d.ts.map +1 -0
- package/dist/core/skill-dir.d.ts +4 -0
- package/dist/core/skill-dir.d.ts.map +1 -0
- package/dist/core/skill-prompt.d.ts +3 -0
- package/dist/core/skill-prompt.d.ts.map +1 -0
- package/dist/core/skill-references.d.ts +7 -0
- package/dist/core/skill-references.d.ts.map +1 -0
- package/dist/core/stable-hash.d.ts +3 -0
- package/dist/core/stable-hash.d.ts.map +1 -0
- package/dist/core/system-guidance.d.ts +13 -0
- package/dist/core/system-guidance.d.ts.map +1 -0
- package/dist/core/token-math.d.ts +16 -0
- package/dist/core/token-math.d.ts.map +1 -0
- package/dist/core/tool-ownership.d.ts +47 -0
- package/dist/core/tool-ownership.d.ts.map +1 -0
- package/dist/core/tool-result-proxy.d.ts +18 -0
- package/dist/core/tool-result-proxy.d.ts.map +1 -0
- package/dist/entropy/active.d.ts +9 -0
- package/dist/entropy/active.d.ts.map +1 -0
- package/dist/entropy/compiled-store.d.ts +16 -0
- package/dist/entropy/compiled-store.d.ts.map +1 -0
- package/dist/entropy/compiled-surface.d.ts +57 -0
- package/dist/entropy/compiled-surface.d.ts.map +1 -0
- package/dist/entropy/compiler.d.ts +27 -0
- package/dist/entropy/compiler.d.ts.map +1 -0
- package/dist/entropy/corpus.d.ts +22 -0
- package/dist/entropy/corpus.d.ts.map +1 -0
- package/dist/entropy/fingerprint.d.ts +9 -0
- package/dist/entropy/fingerprint.d.ts.map +1 -0
- package/dist/entropy/index.d.ts +16 -0
- package/dist/entropy/index.d.ts.map +1 -0
- package/dist/entropy/index.js +194 -0
- package/dist/entropy/index.js.map +7 -0
- package/dist/entropy/meter.d.ts +10 -0
- package/dist/entropy/meter.d.ts.map +1 -0
- package/dist/entropy/normal-form.d.ts +40 -0
- package/dist/entropy/normal-form.d.ts.map +1 -0
- package/dist/entropy/passes.d.ts +13 -0
- package/dist/entropy/passes.d.ts.map +1 -0
- package/dist/entropy/pool-store.d.ts +15 -0
- package/dist/entropy/pool-store.d.ts.map +1 -0
- package/dist/entropy/pool.d.ts +41 -0
- package/dist/entropy/pool.d.ts.map +1 -0
- package/dist/entropy/presentation.d.ts +12 -0
- package/dist/entropy/presentation.d.ts.map +1 -0
- package/dist/entropy/sessions.d.ts +47 -0
- package/dist/entropy/sessions.d.ts.map +1 -0
- package/dist/entropy/surface.d.ts +30 -0
- package/dist/entropy/surface.d.ts.map +1 -0
- package/dist/entropy/trial.d.ts +38 -0
- package/dist/entropy/trial.d.ts.map +1 -0
- package/dist/entropy/types.d.ts +181 -0
- package/dist/entropy/types.d.ts.map +1 -0
- package/dist/execution-service.d.ts +66 -0
- package/dist/execution-service.d.ts.map +1 -0
- package/dist/fabric-exec-arguments.d.ts +7 -0
- package/dist/fabric-exec-arguments.d.ts.map +1 -0
- package/dist/fabric-exec-tool.d.ts +8 -0
- package/dist/fabric-exec-tool.d.ts.map +1 -0
- package/dist/fabric-runtime-state.d.ts +96 -0
- package/dist/fabric-runtime-state.d.ts.map +1 -0
- package/dist/fabric-runtime-state.js +11928 -0
- package/dist/fabric-runtime-state.js.map +7 -0
- package/dist/fabric-state.d.ts +95 -0
- package/dist/fabric-state.d.ts.map +1 -0
- package/dist/failure-progress.d.ts +3 -0
- package/dist/failure-progress.d.ts.map +1 -0
- package/dist/host-compatibility.d.ts +5 -0
- package/dist/host-compatibility.d.ts.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6094 -0
- package/dist/index.js.map +7 -0
- package/dist/jev/auth.d.ts +5 -0
- package/dist/jev/auth.d.ts.map +1 -0
- package/dist/jev/browser.d.ts +37 -0
- package/dist/jev/browser.d.ts.map +1 -0
- package/dist/jev/browser.js +13 -0
- package/dist/jev/browser.js.map +7 -0
- package/dist/jev/client.d.ts +29 -0
- package/dist/jev/client.d.ts.map +1 -0
- package/dist/jev/client.js +11 -0
- package/dist/jev/client.js.map +7 -0
- package/dist/jev/config.d.ts +17 -0
- package/dist/jev/config.d.ts.map +1 -0
- package/dist/jev/guest-types.d.ts +2 -0
- package/dist/jev/guest-types.d.ts.map +1 -0
- package/dist/jev/manager.d.ts +36 -0
- package/dist/jev/manager.d.ts.map +1 -0
- package/dist/jev/observation.d.ts +59 -0
- package/dist/jev/observation.d.ts.map +1 -0
- package/dist/jev/observation.js +20 -0
- package/dist/jev/observation.js.map +7 -0
- package/dist/jev/types.d.ts +142 -0
- package/dist/jev/types.d.ts.map +1 -0
- package/dist/jev/validation.d.ts +8 -0
- package/dist/jev/validation.d.ts.map +1 -0
- package/dist/jev.d.ts +9 -0
- package/dist/jev.d.ts.map +1 -0
- package/dist/jev.js +49 -0
- package/dist/jev.js.map +7 -0
- package/dist/lifecycle/broker.d.ts +30 -0
- package/dist/lifecycle/broker.d.ts.map +1 -0
- package/dist/lifecycle/delivery-scheduler.d.ts +30 -0
- package/dist/lifecycle/delivery-scheduler.d.ts.map +1 -0
- package/dist/lifecycle/types.d.ts +91 -0
- package/dist/lifecycle/types.d.ts.map +1 -0
- package/dist/log-tail.d.ts +11 -0
- package/dist/log-tail.d.ts.map +1 -0
- package/dist/main-agent.d.ts +70 -0
- package/dist/main-agent.d.ts.map +1 -0
- package/dist/managed-host.d.ts +22 -0
- package/dist/managed-host.d.ts.map +1 -0
- package/dist/mcp.d.ts +9 -0
- package/dist/mcp.d.ts.map +1 -0
- package/dist/mcp.js +21 -0
- package/dist/mcp.js.map +7 -0
- package/dist/memory/client.d.ts +31 -0
- package/dist/memory/client.d.ts.map +1 -0
- package/dist/memory/context.d.ts +114 -0
- package/dist/memory/context.d.ts.map +1 -0
- package/dist/memory/digest.d.ts +48 -0
- package/dist/memory/digest.d.ts.map +1 -0
- package/dist/memory/digest.js +7 -0
- package/dist/memory/digest.js.map +7 -0
- package/dist/memory/discovery.d.ts +43 -0
- package/dist/memory/discovery.d.ts.map +1 -0
- package/dist/memory/discovery.js +25 -0
- package/dist/memory/discovery.js.map +7 -0
- package/dist/memory/expand-service.d.ts +4 -0
- package/dist/memory/expand-service.d.ts.map +1 -0
- package/dist/memory/host-source.d.ts +60 -0
- package/dist/memory/host-source.d.ts.map +1 -0
- package/dist/memory/index.d.ts +113 -0
- package/dist/memory/index.d.ts.map +1 -0
- package/dist/memory/lineage.d.ts +25 -0
- package/dist/memory/lineage.d.ts.map +1 -0
- package/dist/memory/normalize.d.ts +188 -0
- package/dist/memory/normalize.d.ts.map +1 -0
- package/dist/memory/normalize.js +26 -0
- package/dist/memory/normalize.js.map +7 -0
- package/dist/memory/portable.d.ts +66 -0
- package/dist/memory/portable.d.ts.map +1 -0
- package/dist/memory/provider.d.ts +15 -0
- package/dist/memory/provider.d.ts.map +1 -0
- package/dist/memory/recall-service.d.ts +5 -0
- package/dist/memory/recall-service.d.ts.map +1 -0
- package/dist/memory/regex.d.ts +19 -0
- package/dist/memory/regex.d.ts.map +1 -0
- package/dist/memory/request-cache.d.ts +49 -0
- package/dist/memory/request-cache.d.ts.map +1 -0
- package/dist/memory/request-context.d.ts +57 -0
- package/dist/memory/request-context.d.ts.map +1 -0
- package/dist/memory/request-limits.d.ts +8 -0
- package/dist/memory/request-limits.d.ts.map +1 -0
- package/dist/memory/search.d.ts +98 -0
- package/dist/memory/search.d.ts.map +1 -0
- package/dist/memory/search.js +24 -0
- package/dist/memory/search.js.map +7 -0
- package/dist/memory/sessions-service.d.ts +3 -0
- package/dist/memory/sessions-service.d.ts.map +1 -0
- package/dist/memory/source-observation.d.ts +28 -0
- package/dist/memory/source-observation.d.ts.map +1 -0
- package/dist/memory/tokenize.d.ts +24 -0
- package/dist/memory/tokenize.d.ts.map +1 -0
- package/dist/memory.d.ts +8 -0
- package/dist/memory.d.ts.map +1 -0
- package/dist/memory.js +119 -0
- package/dist/memory.js.map +7 -0
- package/dist/mesh/store.d.ts +78 -0
- package/dist/mesh/store.d.ts.map +1 -0
- package/dist/output-budget.d.ts +12 -0
- package/dist/output-budget.d.ts.map +1 -0
- package/dist/prewalk/arm.d.ts +8 -0
- package/dist/prewalk/arm.d.ts.map +1 -0
- package/dist/prewalk/controller.d.ts +66 -0
- package/dist/prewalk/controller.d.ts.map +1 -0
- package/dist/prewalk/fs-drift.d.ts +19 -0
- package/dist/prewalk/fs-drift.d.ts.map +1 -0
- package/dist/prewalk/handoff.d.ts +46 -0
- package/dist/prewalk/handoff.d.ts.map +1 -0
- package/dist/protocol.d.ts +275 -0
- package/dist/protocol.d.ts.map +1 -0
- package/dist/protocol.js +46 -0
- package/dist/protocol.js.map +7 -0
- package/dist/providers/agents-actions.d.ts +3 -0
- package/dist/providers/agents-actions.d.ts.map +1 -0
- package/dist/providers/agents-message-router.d.ts +29 -0
- package/dist/providers/agents-message-router.d.ts.map +1 -0
- package/dist/providers/agents-progress.d.ts +18 -0
- package/dist/providers/agents-progress.d.ts.map +1 -0
- package/dist/providers/agents-provider.d.ts +51 -0
- package/dist/providers/agents-provider.d.ts.map +1 -0
- package/dist/providers/arg-normalization.d.ts +15 -0
- package/dist/providers/arg-normalization.d.ts.map +1 -0
- package/dist/providers/captured-tools-provider.d.ts +23 -0
- package/dist/providers/captured-tools-provider.d.ts.map +1 -0
- package/dist/providers/compact-provider.d.ts +14 -0
- package/dist/providers/compact-provider.d.ts.map +1 -0
- package/dist/providers/components-provider.d.ts +12 -0
- package/dist/providers/components-provider.d.ts.map +1 -0
- package/dist/providers/jev-provider.d.ts +70 -0
- package/dist/providers/jev-provider.d.ts.map +1 -0
- package/dist/providers/jev-provider.js +28 -0
- package/dist/providers/jev-provider.js.map +7 -0
- package/dist/providers/mcp-descriptor-cache.d.ts +47 -0
- package/dist/providers/mcp-descriptor-cache.d.ts.map +1 -0
- package/dist/providers/mcp-provider.d.ts +47 -0
- package/dist/providers/mcp-provider.d.ts.map +1 -0
- package/dist/providers/memory-provider.d.ts +32 -0
- package/dist/providers/memory-provider.d.ts.map +1 -0
- package/dist/providers/memory-provider.js +23 -0
- package/dist/providers/memory-provider.js.map +7 -0
- package/dist/providers/mesh-provider.d.ts +17 -0
- package/dist/providers/mesh-provider.d.ts.map +1 -0
- package/dist/providers/pi-bash-cwd.d.ts +49 -0
- package/dist/providers/pi-bash-cwd.d.ts.map +1 -0
- package/dist/providers/pi-tools-provider.d.ts +25 -0
- package/dist/providers/pi-tools-provider.d.ts.map +1 -0
- package/dist/providers/schema-provider.d.ts +15 -0
- package/dist/providers/schema-provider.d.ts.map +1 -0
- package/dist/providers/state-provider.d.ts +16 -0
- package/dist/providers/state-provider.d.ts.map +1 -0
- package/dist/providers/write-diff-limits.d.ts +5 -0
- package/dist/providers/write-diff-limits.d.ts.map +1 -0
- package/dist/providers/write-preview.d.ts +3 -0
- package/dist/providers/write-preview.d.ts.map +1 -0
- package/dist/ref-names.d.ts +2 -0
- package/dist/ref-names.d.ts.map +1 -0
- package/dist/repairs/active.d.ts +7 -0
- package/dist/repairs/active.d.ts.map +1 -0
- package/dist/repairs/apply.d.ts +7 -0
- package/dist/repairs/apply.d.ts.map +1 -0
- package/dist/repairs/catalog-digest.d.ts +5 -0
- package/dist/repairs/catalog-digest.d.ts.map +1 -0
- package/dist/repairs/classify.d.ts +10 -0
- package/dist/repairs/classify.d.ts.map +1 -0
- package/dist/repairs/compiler.d.ts +33 -0
- package/dist/repairs/compiler.d.ts.map +1 -0
- package/dist/repairs/promote.d.ts +4 -0
- package/dist/repairs/promote.d.ts.map +1 -0
- package/dist/repairs/store.d.ts +10 -0
- package/dist/repairs/store.d.ts.map +1 -0
- package/dist/repairs/types.d.ts +49 -0
- package/dist/repairs/types.d.ts.map +1 -0
- package/dist/repeat-guard.d.ts +25 -0
- package/dist/repeat-guard.d.ts.map +1 -0
- package/dist/residency/actor-client.d.ts +16 -0
- package/dist/residency/actor-client.d.ts.map +1 -0
- package/dist/residency/actor-client.js +9 -0
- package/dist/residency/actor-client.js.map +7 -0
- package/dist/residency/client.d.ts +44 -0
- package/dist/residency/client.d.ts.map +1 -0
- package/dist/residency/host.d.ts +3 -0
- package/dist/residency/host.d.ts.map +1 -0
- package/dist/residency/host.js +32 -0
- package/dist/residency/host.js.map +7 -0
- package/dist/residency/launcher-owner.d.ts +7 -0
- package/dist/residency/launcher-owner.d.ts.map +1 -0
- package/dist/residency/launcher.d.ts +3 -0
- package/dist/residency/launcher.d.ts.map +1 -0
- package/dist/residency/launcher.js +154 -0
- package/dist/residency/launcher.js.map +7 -0
- package/dist/residency/pi-entry.d.ts +3 -0
- package/dist/residency/pi-entry.d.ts.map +1 -0
- package/dist/residency/pi-entry.js +48 -0
- package/dist/residency/pi-entry.js.map +7 -0
- package/dist/residency/protocol.d.ts +122 -0
- package/dist/residency/protocol.d.ts.map +1 -0
- package/dist/run-display.d.ts +3 -0
- package/dist/run-display.d.ts.map +1 -0
- package/dist/runtime/core-override-guest-types.d.ts +15 -0
- package/dist/runtime/core-override-guest-types.d.ts.map +1 -0
- package/dist/runtime/core-override-guest-types.js +9 -0
- package/dist/runtime/core-override-guest-types.js.map +7 -0
- package/dist/runtime/core-tool-properties.d.ts +6 -0
- package/dist/runtime/core-tool-properties.d.ts.map +1 -0
- package/dist/runtime/cpython-child-source.d.ts +2 -0
- package/dist/runtime/cpython-child-source.d.ts.map +1 -0
- package/dist/runtime/cpython-linux-sandbox.d.ts +2 -0
- package/dist/runtime/cpython-linux-sandbox.d.ts.map +1 -0
- package/dist/runtime/cpython-runtime.d.ts +9 -0
- package/dist/runtime/cpython-runtime.d.ts.map +1 -0
- package/dist/runtime/cpython-runtime.js +677 -0
- package/dist/runtime/cpython-runtime.js.map +7 -0
- package/dist/runtime/dynamic-guest-types.d.ts +3 -0
- package/dist/runtime/dynamic-guest-types.d.ts.map +1 -0
- package/dist/runtime/dynamic-guest-types.js +8 -0
- package/dist/runtime/dynamic-guest-types.js.map +7 -0
- package/dist/runtime/guest-code-repair.d.ts +2 -0
- package/dist/runtime/guest-code-repair.d.ts.map +1 -0
- package/dist/runtime/guest-stack-map.d.ts +11 -0
- package/dist/runtime/guest-stack-map.d.ts.map +1 -0
- package/dist/runtime/guest-types.d.ts +40 -0
- package/dist/runtime/guest-types.d.ts.map +1 -0
- package/dist/runtime/guest-types.js +13 -0
- package/dist/runtime/guest-types.js.map +7 -0
- package/dist/runtime/kernel.d.ts +30 -0
- package/dist/runtime/kernel.d.ts.map +1 -0
- package/dist/runtime/monty-bridge.d.ts +4 -0
- package/dist/runtime/monty-bridge.d.ts.map +1 -0
- package/dist/runtime/monty-runtime.d.ts +6 -0
- package/dist/runtime/monty-runtime.d.ts.map +1 -0
- package/dist/runtime/monty-runtime.js +485 -0
- package/dist/runtime/monty-runtime.js.map +7 -0
- package/dist/runtime/monty-source.d.ts +10 -0
- package/dist/runtime/monty-source.d.ts.map +1 -0
- package/dist/runtime/monty-values.d.ts +7 -0
- package/dist/runtime/monty-values.d.ts.map +1 -0
- package/dist/runtime/node-process-child-source.d.ts +2 -0
- package/dist/runtime/node-process-child-source.d.ts.map +1 -0
- package/dist/runtime/node-process-runtime.d.ts +10 -0
- package/dist/runtime/node-process-runtime.d.ts.map +1 -0
- package/dist/runtime/node-process-runtime.js +16 -0
- package/dist/runtime/node-process-runtime.js.map +7 -0
- package/dist/runtime/orchestration.d.ts +3 -0
- package/dist/runtime/orchestration.d.ts.map +1 -0
- package/dist/runtime/python-arguments.d.ts +2 -0
- package/dist/runtime/python-arguments.d.ts.map +1 -0
- package/dist/runtime/python-error-guidance.d.ts +6 -0
- package/dist/runtime/python-error-guidance.d.ts.map +1 -0
- package/dist/runtime/quickjs-runtime.d.ts +8 -0
- package/dist/runtime/quickjs-runtime.d.ts.map +1 -0
- package/dist/runtime/quickjs-runtime.js +15 -0
- package/dist/runtime/quickjs-runtime.js.map +7 -0
- package/dist/runtime/type-checker.d.ts +18 -0
- package/dist/runtime/type-checker.d.ts.map +1 -0
- package/dist/runtime/type-checker.js +11 -0
- package/dist/runtime/type-checker.js.map +7 -0
- package/dist/runtime/typescript-kernel.d.ts +14 -0
- package/dist/runtime/typescript-kernel.d.ts.map +1 -0
- package/dist/runtime/typescript-kernel.js +53 -0
- package/dist/runtime/typescript-kernel.js.map +7 -0
- package/dist/runtime-paths.d.ts +7 -0
- package/dist/runtime-paths.d.ts.map +1 -0
- package/dist/runtime-state-builtins.d.ts +26 -0
- package/dist/runtime-state-builtins.d.ts.map +1 -0
- package/dist/runtime-state-speculation.d.ts +16 -0
- package/dist/runtime-state-speculation.d.ts.map +1 -0
- package/dist/schema/controller.d.ts +35 -0
- package/dist/schema/controller.d.ts.map +1 -0
- package/dist/schema/policy.d.ts +2 -0
- package/dist/schema/policy.d.ts.map +1 -0
- package/dist/schema/types.d.ts +86 -0
- package/dist/schema/types.d.ts.map +1 -0
- package/dist/schema/workspace.d.ts +19 -0
- package/dist/schema/workspace.d.ts.map +1 -0
- package/dist/speculation/eligibility.d.ts +22 -0
- package/dist/speculation/eligibility.d.ts.map +1 -0
- package/dist/speculation/freshness.d.ts +10 -0
- package/dist/speculation/freshness.d.ts.map +1 -0
- package/dist/speculation/partial-json.d.ts +9 -0
- package/dist/speculation/partial-json.d.ts.map +1 -0
- package/dist/speculation/python-scanner.d.ts +7 -0
- package/dist/speculation/python-scanner.d.ts.map +1 -0
- package/dist/speculation/python-scanner.js +166 -0
- package/dist/speculation/python-scanner.js.map +7 -0
- package/dist/speculation/scanner.d.ts +13 -0
- package/dist/speculation/scanner.d.ts.map +1 -0
- package/dist/speculation/scanner.js +182 -0
- package/dist/speculation/scanner.js.map +7 -0
- package/dist/speculation/store.d.ts +41 -0
- package/dist/speculation/store.d.ts.map +1 -0
- package/dist/speculation/stream-tap.d.ts +30 -0
- package/dist/speculation/stream-tap.d.ts.map +1 -0
- package/dist/speculation/types.d.ts +44 -0
- package/dist/speculation/types.d.ts.map +1 -0
- package/dist/state/complexity.d.ts +13 -0
- package/dist/state/complexity.d.ts.map +1 -0
- package/dist/state/evidence-runner.d.ts +17 -0
- package/dist/state/evidence-runner.d.ts.map +1 -0
- package/dist/state/store.d.ts +76 -0
- package/dist/state/store.d.ts.map +1 -0
- package/dist/state/types.d.ts +165 -0
- package/dist/state/types.d.ts.map +1 -0
- package/dist/storage/retention.d.ts +22 -0
- package/dist/storage/retention.d.ts.map +1 -0
- package/dist/thinking.d.ts +19 -0
- package/dist/thinking.d.ts.map +1 -0
- package/dist/topology/control-plane.d.ts +58 -0
- package/dist/topology/control-plane.d.ts.map +1 -0
- package/dist/topology/participant-directory.d.ts +33 -0
- package/dist/topology/participant-directory.d.ts.map +1 -0
- package/dist/topology/peer-settle.d.ts +51 -0
- package/dist/topology/peer-settle.d.ts.map +1 -0
- package/dist/topology/records.d.ts +6 -0
- package/dist/topology/records.d.ts.map +1 -0
- package/dist/topology/types.d.ts +89 -0
- package/dist/topology/types.d.ts.map +1 -0
- package/dist/type-error-guidance.d.ts +3 -0
- package/dist/type-error-guidance.d.ts.map +1 -0
- package/dist/ui/arc-group.d.ts +17 -0
- package/dist/ui/arc-group.d.ts.map +1 -0
- package/dist/ui/border-status-editor.d.ts +22 -0
- package/dist/ui/border-status-editor.d.ts.map +1 -0
- package/dist/ui/code-preview-shell.d.ts +11 -0
- package/dist/ui/code-preview-shell.d.ts.map +1 -0
- package/dist/ui/code-preview.d.ts +53 -0
- package/dist/ui/code-preview.d.ts.map +1 -0
- package/dist/ui/controller.d.ts +20 -0
- package/dist/ui/controller.d.ts.map +1 -0
- package/dist/ui/conversation-chrome.d.ts +16 -0
- package/dist/ui/conversation-chrome.d.ts.map +1 -0
- package/dist/ui/conversation-chrome.js +11 -0
- package/dist/ui/conversation-chrome.js.map +7 -0
- package/dist/ui/conversation-commands.d.ts +12 -0
- package/dist/ui/conversation-commands.d.ts.map +1 -0
- package/dist/ui/conversation-history.d.ts +6 -0
- package/dist/ui/conversation-history.d.ts.map +1 -0
- package/dist/ui/conversation-host.d.ts +7 -0
- package/dist/ui/conversation-host.d.ts.map +1 -0
- package/dist/ui/conversation-host.js +9 -0
- package/dist/ui/conversation-host.js.map +7 -0
- package/dist/ui/conversation-native-reader-checkpoint.d.ts +8 -0
- package/dist/ui/conversation-native-reader-checkpoint.d.ts.map +1 -0
- package/dist/ui/conversation-native-reader-replay.d.ts +10 -0
- package/dist/ui/conversation-native-reader-replay.d.ts.map +1 -0
- package/dist/ui/conversation-native-reader.d.ts +110 -0
- package/dist/ui/conversation-native-reader.d.ts.map +1 -0
- package/dist/ui/conversation-native-reader.js +1050 -0
- package/dist/ui/conversation-native-reader.js.map +7 -0
- package/dist/ui/conversation-queue-store.d.ts +14 -0
- package/dist/ui/conversation-queue-store.d.ts.map +1 -0
- package/dist/ui/conversation-queue.d.ts +244 -0
- package/dist/ui/conversation-queue.d.ts.map +1 -0
- package/dist/ui/conversation-render.d.ts +104 -0
- package/dist/ui/conversation-render.d.ts.map +1 -0
- package/dist/ui/conversation-selection.d.ts +18 -0
- package/dist/ui/conversation-selection.d.ts.map +1 -0
- package/dist/ui/conversation-shortcut.d.ts +3 -0
- package/dist/ui/conversation-shortcut.d.ts.map +1 -0
- package/dist/ui/conversation-targets.d.ts +7 -0
- package/dist/ui/conversation-targets.d.ts.map +1 -0
- package/dist/ui/conversation-targets.js +12 -0
- package/dist/ui/conversation-targets.js.map +7 -0
- package/dist/ui/conversation-transcript.d.ts +25 -0
- package/dist/ui/conversation-transcript.d.ts.map +1 -0
- package/dist/ui/conversation.d.ts +219 -0
- package/dist/ui/conversation.d.ts.map +1 -0
- package/dist/ui/conversation.js +2861 -0
- package/dist/ui/conversation.js.map +7 -0
- package/dist/ui/core-tool-render.d.ts +20 -0
- package/dist/ui/core-tool-render.d.ts.map +1 -0
- package/dist/ui/dashboard-detail.d.ts +68 -0
- package/dist/ui/dashboard-detail.d.ts.map +1 -0
- package/dist/ui/dashboard-fabric-graph.d.ts +50 -0
- package/dist/ui/dashboard-fabric-graph.d.ts.map +1 -0
- package/dist/ui/dashboard-graph-controller.d.ts +52 -0
- package/dist/ui/dashboard-graph-controller.d.ts.map +1 -0
- package/dist/ui/dashboard-modal-controller.d.ts +36 -0
- package/dist/ui/dashboard-modal-controller.d.ts.map +1 -0
- package/dist/ui/dashboard-model.d.ts +111 -0
- package/dist/ui/dashboard-model.d.ts.map +1 -0
- package/dist/ui/dashboard-presentation.d.ts +6 -0
- package/dist/ui/dashboard-presentation.d.ts.map +1 -0
- package/dist/ui/dashboard.d.ts +156 -0
- package/dist/ui/dashboard.d.ts.map +1 -0
- package/dist/ui/dashboard.js +4622 -0
- package/dist/ui/dashboard.js.map +7 -0
- package/dist/ui/diff-background.d.ts +12 -0
- package/dist/ui/diff-background.d.ts.map +1 -0
- package/dist/ui/dynamic-border.d.ts +8 -0
- package/dist/ui/dynamic-border.d.ts.map +1 -0
- package/dist/ui/escape-halt.d.ts +11 -0
- package/dist/ui/escape-halt.d.ts.map +1 -0
- package/dist/ui/fabric-actor-delivery-selector.d.ts +17 -0
- package/dist/ui/fabric-actor-delivery-selector.d.ts.map +1 -0
- package/dist/ui/fabric-actor-tool-selector.d.ts +22 -0
- package/dist/ui/fabric-actor-tool-selector.d.ts.map +1 -0
- package/dist/ui/fabric-code-parser.d.ts +9 -0
- package/dist/ui/fabric-code-parser.d.ts.map +1 -0
- package/dist/ui/fabric-host-event-selector.d.ts +29 -0
- package/dist/ui/fabric-host-event-selector.d.ts.map +1 -0
- package/dist/ui/fabric-model-selector.d.ts +64 -0
- package/dist/ui/fabric-model-selector.d.ts.map +1 -0
- package/dist/ui/fabric-render.d.ts +113 -0
- package/dist/ui/fabric-render.d.ts.map +1 -0
- package/dist/ui/fabric-thinking-selector.d.ts +26 -0
- package/dist/ui/fabric-thinking-selector.d.ts.map +1 -0
- package/dist/ui/fabric-title-hint.d.ts +3 -0
- package/dist/ui/fabric-title-hint.d.ts.map +1 -0
- package/dist/ui/format.d.ts +9 -0
- package/dist/ui/format.d.ts.map +1 -0
- package/dist/ui/handoff-completion.d.ts +3 -0
- package/dist/ui/handoff-completion.d.ts.map +1 -0
- package/dist/ui/highlight.d.ts +69 -0
- package/dist/ui/highlight.d.ts.map +1 -0
- package/dist/ui/model-picker.d.ts +46 -0
- package/dist/ui/model-picker.d.ts.map +1 -0
- package/dist/ui/model-picker.js +17 -0
- package/dist/ui/model-picker.js.map +7 -0
- package/dist/ui/preview-lines.d.ts +16 -0
- package/dist/ui/preview-lines.d.ts.map +1 -0
- package/dist/ui/row-balance.d.ts +29 -0
- package/dist/ui/row-balance.d.ts.map +1 -0
- package/dist/ui/settings-component.d.ts +26 -0
- package/dist/ui/settings-component.d.ts.map +1 -0
- package/dist/ui/settings-rpc.d.ts +15 -0
- package/dist/ui/settings-rpc.d.ts.map +1 -0
- package/dist/ui/settings-section-context.d.ts +18 -0
- package/dist/ui/settings-section-context.d.ts.map +1 -0
- package/dist/ui/settings-sections-agents.d.ts +5 -0
- package/dist/ui/settings-sections-agents.d.ts.map +1 -0
- package/dist/ui/settings-sections-execution.d.ts +8 -0
- package/dist/ui/settings-sections-execution.d.ts.map +1 -0
- package/dist/ui/settings-sections-lifecycle.d.ts +6 -0
- package/dist/ui/settings-sections-lifecycle.d.ts.map +1 -0
- package/dist/ui/settings-sections-presentation.d.ts +6 -0
- package/dist/ui/settings-sections-presentation.d.ts.map +1 -0
- package/dist/ui/settings-sections.d.ts +12 -0
- package/dist/ui/settings-sections.d.ts.map +1 -0
- package/dist/ui/settings-submenus.d.ts +74 -0
- package/dist/ui/settings-submenus.d.ts.map +1 -0
- package/dist/ui/settings-values.d.ts +63 -0
- package/dist/ui/settings-values.d.ts.map +1 -0
- package/dist/ui/settings.d.ts +21 -0
- package/dist/ui/settings.d.ts.map +1 -0
- package/dist/ui/settings.js +1985 -0
- package/dist/ui/settings.js.map +7 -0
- package/dist/ui/shell-hang-keys.d.ts +11 -0
- package/dist/ui/shell-hang-keys.d.ts.map +1 -0
- package/dist/ui/shiki-language.d.ts +7 -0
- package/dist/ui/shiki-language.d.ts.map +1 -0
- package/dist/ui/shiki-theme.d.ts +7 -0
- package/dist/ui/shiki-theme.d.ts.map +1 -0
- package/dist/ui/snapshot.d.ts +17 -0
- package/dist/ui/snapshot.d.ts.map +1 -0
- package/dist/ui/spinner.d.ts +6 -0
- package/dist/ui/spinner.d.ts.map +1 -0
- package/dist/ui/state-file-preview.d.ts +13 -0
- package/dist/ui/state-file-preview.d.ts.map +1 -0
- package/dist/ui/structured.d.ts +9 -0
- package/dist/ui/structured.d.ts.map +1 -0
- package/dist/ui/tool-call-timing.d.ts +2 -0
- package/dist/ui/tool-call-timing.d.ts.map +1 -0
- package/dist/ui/tool-display.d.ts +8 -0
- package/dist/ui/tool-display.d.ts.map +1 -0
- package/dist/ui/topology.d.ts +162 -0
- package/dist/ui/topology.d.ts.map +1 -0
- package/dist/ui/transcript-parser.d.ts +18 -0
- package/dist/ui/transcript-parser.d.ts.map +1 -0
- package/dist/ui/transcript-reader.d.ts +10 -0
- package/dist/ui/transcript-reader.d.ts.map +1 -0
- package/dist/ui/transcript-sanitization.d.ts +14 -0
- package/dist/ui/transcript-sanitization.d.ts.map +1 -0
- package/dist/ui/transcript.d.ts +52 -0
- package/dist/ui/transcript.d.ts.map +1 -0
- package/dist/ui/types.d.ts +84 -0
- package/dist/ui/types.d.ts.map +1 -0
- package/dist/ui/widget.d.ts +16 -0
- package/dist/ui/widget.d.ts.map +1 -0
- package/dist/ui/word-diff/alignment.d.ts +6 -0
- package/dist/ui/word-diff/alignment.d.ts.map +1 -0
- package/dist/ui/word-diff/change-block.d.ts +18 -0
- package/dist/ui/word-diff/change-block.d.ts.map +1 -0
- package/dist/ui/word-diff/changed-line.d.ts +14 -0
- package/dist/ui/word-diff/changed-line.d.ts.map +1 -0
- package/dist/ui/word-diff/emphasis.d.ts +9 -0
- package/dist/ui/word-diff/emphasis.d.ts.map +1 -0
- package/dist/ui/word-diff/line-emphasis.d.ts +7 -0
- package/dist/ui/word-diff/line-emphasis.d.ts.map +1 -0
- package/dist/ui/word-diff/line-matching.d.ts +10 -0
- package/dist/ui/word-diff/line-matching.d.ts.map +1 -0
- package/dist/ui/word-diff/line-similarity.d.ts +16 -0
- package/dist/ui/word-diff/line-similarity.d.ts.map +1 -0
- package/dist/ui/word-diff/normalize.d.ts +3 -0
- package/dist/ui/word-diff/normalize.d.ts.map +1 -0
- package/dist/ui/word-diff/parse.d.ts +17 -0
- package/dist/ui/word-diff/parse.d.ts.map +1 -0
- package/dist/ui/word-diff/range-refinement.d.ts +5 -0
- package/dist/ui/word-diff/range-refinement.d.ts.map +1 -0
- package/dist/ui/word-diff/ranges.d.ts +11 -0
- package/dist/ui/word-diff/ranges.d.ts.map +1 -0
- package/dist/ui/word-diff/smart-filter.d.ts +3 -0
- package/dist/ui/word-diff/smart-filter.d.ts.map +1 -0
- package/dist/ui/word-diff/sparse-line-matching.d.ts +25 -0
- package/dist/ui/word-diff/sparse-line-matching.d.ts.map +1 -0
- package/dist/ui/word-diff/text-boundaries.d.ts +11 -0
- package/dist/ui/word-diff/text-boundaries.d.ts.map +1 -0
- package/dist/ui/word-diff/token-alignment.d.ts +9 -0
- package/dist/ui/word-diff/token-alignment.d.ts.map +1 -0
- package/dist/ui/word-diff/token-text-refinement.d.ts +4 -0
- package/dist/ui/word-diff/token-text-refinement.d.ts.map +1 -0
- package/dist/ui/word-diff/tokens.d.ts +16 -0
- package/dist/ui/word-diff/tokens.d.ts.map +1 -0
- package/dist/ui/word-diff/types.d.ts +10 -0
- package/dist/ui/word-diff/types.d.ts.map +1 -0
- package/dist/util.d.ts +3 -0
- package/dist/util.d.ts.map +1 -0
- package/dist/worker/model-control.d.ts +14 -0
- package/dist/worker/model-control.d.ts.map +1 -0
- package/dist/worker/model-control.js +118 -0
- package/dist/worker/model-control.js.map +7 -0
- package/dist/worker/options.d.ts +3 -0
- package/dist/worker/options.d.ts.map +1 -0
- package/dist/worker/options.js +156 -0
- package/dist/worker/options.js.map +7 -0
- package/dist/worker/run-record.d.ts +22 -0
- package/dist/worker/run-record.d.ts.map +1 -0
- package/dist/worker/run-record.js +124 -0
- package/dist/worker/run-record.js.map +7 -0
- package/dist/worker/session-export.d.ts +45 -0
- package/dist/worker/session-export.d.ts.map +1 -0
- package/dist/worker/session-export.js +91 -0
- package/dist/worker/session-export.js.map +7 -0
- package/dist/worker.d.ts +3 -0
- package/dist/worker.d.ts.map +1 -0
- package/dist/worker.js +1074 -0
- package/dist/worker.js.map +7 -0
- package/docs/agents.md +618 -0
- package/docs/architecture.md +141 -0
- package/docs/audit-trace.md +116 -0
- package/docs/certification.md +166 -0
- package/docs/compaction.md +345 -0
- package/docs/component-calculus.md +191 -0
- package/docs/components.md +330 -0
- package/docs/configuration.md +529 -0
- package/docs/entropy.md +214 -0
- package/docs/interface.md +210 -0
- package/docs/jev.md +289 -0
- package/docs/kernels.md +186 -0
- package/docs/memory-recall.md +664 -0
- package/docs/programmatic-compaction.md +205 -0
- package/docs/provider-component-calculus.md +378 -0
- package/docs/providers.md +163 -0
- package/docs/repairs.md +90 -0
- package/docs/residency-runtime.md +82 -0
- package/docs/schema-enforcement.md +166 -0
- package/docs/skills.md +50 -0
- package/docs/speculation.md +171 -0
- package/docs/state-layer.md +197 -0
- package/package.json +135 -0
- package/skillsets/python/fabric-advisor/SKILL.md +29 -0
- package/skillsets/python/fabric-ambient/SKILL.md +44 -0
- package/skillsets/python/fabric-ambient/references/setup.md +67 -0
- package/skillsets/python/fabric-council/SKILL.md +54 -0
- package/skillsets/python/fabric-exec/SKILL.md +74 -0
- package/skillsets/python/fabric-exec/references/agents.md +65 -0
- package/skillsets/python/fabric-exec/references/mcp.md +23 -0
- package/skillsets/python/fabric-exec/references/mesh.md +27 -0
- package/skillsets/python/fabric-fusion/SKILL.md +112 -0
- package/skillsets/python/fabric-guide/SKILL.md +29 -0
- package/skillsets/python/fabric-jev/SKILL.md +162 -0
- package/skillsets/python/fabric-rlm/SKILL.md +120 -0
- package/skillsets/python/fabric-schema/SKILL.md +55 -0
- package/skillsets/python/fabric-spec/SKILL.md +42 -0
- package/skillsets/python/fabric-supervisor/SKILL.md +37 -0
- package/skillsets/python/fabric-swarm/SKILL.md +40 -0
- package/skillsets/python/fabric-workflow/SKILL.md +62 -0
- package/skillsets/typescript/fabric-advisor/SKILL.md +29 -0
- package/skillsets/typescript/fabric-ambient/SKILL.md +44 -0
- package/skillsets/typescript/fabric-ambient/references/setup.md +90 -0
- package/skillsets/typescript/fabric-council/SKILL.md +94 -0
- package/skillsets/typescript/fabric-exec/SKILL.md +142 -0
- package/skillsets/typescript/fabric-exec/references/agents.md +218 -0
- package/skillsets/typescript/fabric-exec/references/mcp.md +49 -0
- package/skillsets/typescript/fabric-exec/references/mesh.md +51 -0
- package/skillsets/typescript/fabric-fusion/SKILL.md +332 -0
- package/skillsets/typescript/fabric-guide/SKILL.md +29 -0
- package/skillsets/typescript/fabric-jev/SKILL.md +159 -0
- package/skillsets/typescript/fabric-rlm/SKILL.md +284 -0
- package/skillsets/typescript/fabric-schema/SKILL.md +121 -0
- package/skillsets/typescript/fabric-spec/SKILL.md +42 -0
- package/skillsets/typescript/fabric-supervisor/SKILL.md +37 -0
- package/skillsets/typescript/fabric-swarm/SKILL.md +80 -0
- package/skillsets/typescript/fabric-workflow/SKILL.md +133 -0
|
@@ -0,0 +1,677 @@
|
|
|
1
|
+
import {
|
|
2
|
+
piBashExitMetadata
|
|
3
|
+
} from "../chunks/chunk-PAN6C3JM.js";
|
|
4
|
+
import {
|
|
5
|
+
runAbortable,
|
|
6
|
+
settleWithin
|
|
7
|
+
} from "../chunks/chunk-7TB7NXSL.js";
|
|
8
|
+
import {
|
|
9
|
+
isPiShellRef
|
|
10
|
+
} from "../chunks/chunk-YU62DDKK.js";
|
|
11
|
+
|
|
12
|
+
// src/runtime/cpython-runtime.ts
|
|
13
|
+
import { spawn } from "node:child_process";
|
|
14
|
+
import { randomBytes } from "node:crypto";
|
|
15
|
+
import { constants } from "node:fs";
|
|
16
|
+
import { access, realpath } from "node:fs/promises";
|
|
17
|
+
import net from "node:net";
|
|
18
|
+
import path from "node:path";
|
|
19
|
+
import { StringDecoder } from "node:string_decoder";
|
|
20
|
+
|
|
21
|
+
// src/runtime/cpython-child-source.ts
|
|
22
|
+
var CPYTHON_CHILD_SOURCE = String.raw`
|
|
23
|
+
import sys
|
|
24
|
+
if sys.implementation.name != "cpython" or sys.version_info < (3, 10):
|
|
25
|
+
sys.stderr.write("Fabric requires CPython 3.10 or newer; set executor.cpython.binary to a supported interpreter.\n")
|
|
26
|
+
sys.exit(1)
|
|
27
|
+
|
|
28
|
+
import ast
|
|
29
|
+
import asyncio
|
|
30
|
+
import json
|
|
31
|
+
import math
|
|
32
|
+
import os
|
|
33
|
+
import socket
|
|
34
|
+
import sys
|
|
35
|
+
import traceback
|
|
36
|
+
|
|
37
|
+
_MAX_FRAME = 16 * 1024 * 1024
|
|
38
|
+
_MAX_INTEGER = 9007199254740991
|
|
39
|
+
_pending = {}
|
|
40
|
+
_next_id = 0
|
|
41
|
+
_writer = None
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def _json_value(value):
|
|
45
|
+
if value is None or isinstance(value, (str, bool)):
|
|
46
|
+
return value
|
|
47
|
+
if isinstance(value, int):
|
|
48
|
+
if abs(value) > _MAX_INTEGER:
|
|
49
|
+
raise ValueError("Fabric JSON integers must fit JavaScript's safe integer range; return a string instead")
|
|
50
|
+
return value
|
|
51
|
+
if isinstance(value, float) and math.isfinite(value):
|
|
52
|
+
return value
|
|
53
|
+
if isinstance(value, (list, tuple)):
|
|
54
|
+
return [_json_value(item) for item in value]
|
|
55
|
+
if isinstance(value, dict) and all(isinstance(key, str) for key in value):
|
|
56
|
+
return {key: _json_value(item) for key, item in value.items()}
|
|
57
|
+
raise TypeError("Fabric values must be JSON-compatible (no bytes, non-finite numbers, callables, or custom objects)")
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
async def _send(message):
|
|
61
|
+
data = (json.dumps(_json_value(message), ensure_ascii=True, allow_nan=False) + "\n").encode("utf-8")
|
|
62
|
+
if len(data) > _MAX_FRAME:
|
|
63
|
+
raise ValueError("Fabric IPC frame exceeds 16 MiB")
|
|
64
|
+
_writer.write(data)
|
|
65
|
+
await _writer.drain()
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
class _HostError(Exception):
|
|
69
|
+
def __init__(self, message, bash_exit=None):
|
|
70
|
+
super().__init__(message)
|
|
71
|
+
self.bash_exit = bash_exit
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
async def _call(ref, args):
|
|
75
|
+
global _next_id
|
|
76
|
+
if len(_pending) >= 256:
|
|
77
|
+
raise RuntimeError("Fabric allows at most 256 outstanding host calls")
|
|
78
|
+
_next_id += 1
|
|
79
|
+
call_id = _next_id
|
|
80
|
+
future = asyncio.get_running_loop().create_future()
|
|
81
|
+
_pending[call_id] = future
|
|
82
|
+
try:
|
|
83
|
+
await _send({"type": "call", "id": call_id, "ref": ref, "args": args})
|
|
84
|
+
return await future
|
|
85
|
+
finally:
|
|
86
|
+
_pending.pop(call_id, None)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
async def _responses(reader):
|
|
90
|
+
try:
|
|
91
|
+
while True:
|
|
92
|
+
line = await reader.readline()
|
|
93
|
+
if not line:
|
|
94
|
+
raise RuntimeError("Fabric host IPC closed")
|
|
95
|
+
message = json.loads(line)
|
|
96
|
+
if message.get("type") != "response":
|
|
97
|
+
raise RuntimeError("Invalid Fabric host response")
|
|
98
|
+
future = _pending.get(message.get("id"))
|
|
99
|
+
if future is None or future.done():
|
|
100
|
+
continue
|
|
101
|
+
if message.get("ok") is True:
|
|
102
|
+
future.set_result(message.get("value"))
|
|
103
|
+
else:
|
|
104
|
+
future.set_exception(_HostError(message.get("error", "Host call failed"), message.get("bashExit")))
|
|
105
|
+
except Exception as error:
|
|
106
|
+
for future in tuple(_pending.values()):
|
|
107
|
+
if not future.done():
|
|
108
|
+
future.set_exception(error)
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
_PRIMARY = {"read": "path", "ls": "path", "bash": "command", "powershell": "command", "grep": "pattern", "find": "pattern"}
|
|
112
|
+
_POSITIONAL = {"read": ["path", "offset", "limit"], "ls": ["path", "limit"], "grep": ["pattern", "path", "limit"], "find": ["pattern", "path", "limit"], "write": ["path", "content"], "edit": ["path", "oldText", "newText"], "bash": ["command"], "powershell": ["command"]}
|
|
113
|
+
_DISCOVERY = {"providers", "catalog", "list", "search", "describe", "call", "models", "progress"}
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
def _arguments(ref, positional, keywords):
|
|
117
|
+
args = dict(keywords)
|
|
118
|
+
if not positional:
|
|
119
|
+
return args
|
|
120
|
+
if len(positional) == 1 and isinstance(positional[0], dict):
|
|
121
|
+
if args.keys() & positional[0].keys():
|
|
122
|
+
raise TypeError("Duplicate Fabric argument keys")
|
|
123
|
+
return {**positional[0], **args}
|
|
124
|
+
if ref == "tools.search" and len(positional) == 1 and isinstance(positional[0], str):
|
|
125
|
+
return {**args, "query": positional[0]}
|
|
126
|
+
if ref.startswith("pi."):
|
|
127
|
+
name = ref[3:]
|
|
128
|
+
primary = _PRIMARY.get(name)
|
|
129
|
+
if primary and len(positional) == 2 and isinstance(positional[0], str) and isinstance(positional[1], dict):
|
|
130
|
+
return {**positional[1], **args, primary: positional[0]}
|
|
131
|
+
fields = _POSITIONAL.get(name, [])
|
|
132
|
+
if len(positional) <= len(fields):
|
|
133
|
+
args.update(zip(fields, positional))
|
|
134
|
+
if name == "edit" and ("oldText" in args or "newText" in args):
|
|
135
|
+
args["edits"] = [{key: args.pop(key) for key in ("oldText", "newText") if key in args}]
|
|
136
|
+
return args
|
|
137
|
+
raise TypeError("Fabric calls accept a dictionary or keyword arguments; Pi tools also accept their documented positional arguments")
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
class _Proxy:
|
|
141
|
+
def __init__(self, ref):
|
|
142
|
+
self._ref = ref
|
|
143
|
+
|
|
144
|
+
def __getattr__(self, name):
|
|
145
|
+
if name.startswith("__"):
|
|
146
|
+
raise AttributeError(name)
|
|
147
|
+
return _Proxy(self._ref + "." + name)
|
|
148
|
+
|
|
149
|
+
async def __call__(self, *positional, **keywords):
|
|
150
|
+
ref = self._ref
|
|
151
|
+
args = _arguments(ref, positional, keywords)
|
|
152
|
+
if ref == "pi.edit" and "edits" not in args and ("oldText" in args or "newText" in args):
|
|
153
|
+
args["edits"] = [{key: args.pop(key) for key in ("oldText", "newText") if key in args}]
|
|
154
|
+
if ref.startswith("tools."):
|
|
155
|
+
name = ref[6:]
|
|
156
|
+
if name not in _DISCOVERY:
|
|
157
|
+
raise AttributeError("tools is discovery/generic calls only; use pi for core tools")
|
|
158
|
+
ref = "fabric.$" + name
|
|
159
|
+
if ref in ("pi.bash", "pi.powershell") and "settle" in args and type(args["settle"]) is not bool:
|
|
160
|
+
raise TypeError("pi shell settle must be a boolean; use settle=True or settle=False")
|
|
161
|
+
if ref in ("pi.bash", "pi.powershell") and "background" in args and type(args["background"]) is not bool:
|
|
162
|
+
raise TypeError("pi shell background must be a boolean; use background=True or background=False")
|
|
163
|
+
settle = ref in ("pi.bash", "pi.powershell") and args.pop("settle", False) is True
|
|
164
|
+
try:
|
|
165
|
+
return await _call(ref, args)
|
|
166
|
+
except _HostError as error:
|
|
167
|
+
exit_info = error.bash_exit
|
|
168
|
+
if settle and isinstance(exit_info, dict) and type(exit_info.get("exitCode")) is int and exit_info["exitCode"] > 0 and isinstance(exit_info.get("output"), str):
|
|
169
|
+
return {"ok": False, "output": exit_info["output"], "details": None, "exitCode": exit_info["exitCode"], "error": str(error)}
|
|
170
|
+
raise
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
class _Payloads:
|
|
174
|
+
def __init__(self, values):
|
|
175
|
+
self._values = dict(values)
|
|
176
|
+
|
|
177
|
+
def __getitem__(self, name):
|
|
178
|
+
if name not in self._values:
|
|
179
|
+
raise KeyError("Payload " + repr(name) + " is missing; pass it in fabric_exec.payloads")
|
|
180
|
+
return self._values[name]
|
|
181
|
+
|
|
182
|
+
def __getattr__(self, name):
|
|
183
|
+
return self[name]
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
def _error_text(error, source):
|
|
187
|
+
# Keep user/library frames and exception chaining, not the embedded bridge.
|
|
188
|
+
rendered = traceback.TracebackException.from_exception(error, limit=-24, capture_locals=False)
|
|
189
|
+
lines = source.splitlines()
|
|
190
|
+
pending = [(rendered, error)]
|
|
191
|
+
seen = set()
|
|
192
|
+
while pending:
|
|
193
|
+
current, original = pending.pop()
|
|
194
|
+
if id(current) in seen:
|
|
195
|
+
continue
|
|
196
|
+
seen.add(id(current))
|
|
197
|
+
internal = set()
|
|
198
|
+
tb = original.__traceback__
|
|
199
|
+
while tb is not None:
|
|
200
|
+
if tb.tb_frame.f_globals is globals():
|
|
201
|
+
internal.add((tb.tb_frame.f_code.co_filename, tb.tb_lineno, tb.tb_frame.f_code.co_name))
|
|
202
|
+
tb = tb.tb_next
|
|
203
|
+
frames = []
|
|
204
|
+
for frame in current.stack:
|
|
205
|
+
if (frame.filename, frame.lineno, frame.name) in internal:
|
|
206
|
+
continue
|
|
207
|
+
if frame.filename == "fabric-exec.py":
|
|
208
|
+
line = lines[frame.lineno - 1] if 0 < frame.lineno <= len(lines) else None
|
|
209
|
+
frame = traceback.FrameSummary(frame.filename, frame.lineno,
|
|
210
|
+
"<fabric_exec>" if frame.name == "__fabric_program" else frame.name,
|
|
211
|
+
lookup_line=False, line=line)
|
|
212
|
+
frames.append(frame)
|
|
213
|
+
if isinstance(original, SyntaxError) and original.filename == "fabric-exec.py":
|
|
214
|
+
frames = []
|
|
215
|
+
current.stack = traceback.StackSummary.from_list(frames)
|
|
216
|
+
if current.exc_type is _HostError:
|
|
217
|
+
current.exc_type = RuntimeError
|
|
218
|
+
if len(seen) >= 8:
|
|
219
|
+
current.__cause__ = None
|
|
220
|
+
current.__context__ = None
|
|
221
|
+
if hasattr(current, "exceptions"):
|
|
222
|
+
current.exceptions = None
|
|
223
|
+
continue
|
|
224
|
+
for field in ("__cause__", "__context__"):
|
|
225
|
+
item = getattr(current, field)
|
|
226
|
+
if item is not None:
|
|
227
|
+
pending.append((item, getattr(original, field)))
|
|
228
|
+
pending.extend(zip(getattr(current, "exceptions", None) or [], getattr(original, "exceptions", [])))
|
|
229
|
+
text = "".join(rendered.format())
|
|
230
|
+
if len(text) > 16000:
|
|
231
|
+
text = text[:7900] + "\n[Python traceback truncated]\n" + text[-8000:]
|
|
232
|
+
return text
|
|
233
|
+
|
|
234
|
+
async def _main():
|
|
235
|
+
global _writer
|
|
236
|
+
# Descriptor 3 is a dedicated inherited socket, never stdout/stderr. Windows
|
|
237
|
+
# cannot inherit a socket through stdio, so there the child dials a loopback
|
|
238
|
+
# TCP listener and proves a one-time token from the environment instead.
|
|
239
|
+
port = os.environ.get("FABRIC_IPC_PORT")
|
|
240
|
+
token = os.environ.get("FABRIC_IPC_TOKEN")
|
|
241
|
+
if port and token:
|
|
242
|
+
reader, _writer = await asyncio.open_connection("127.0.0.1", int(port), limit=_MAX_FRAME)
|
|
243
|
+
await _send({"type": "hello", "token": token})
|
|
244
|
+
else:
|
|
245
|
+
channel = socket.socket(fileno=3)
|
|
246
|
+
reader, _writer = await asyncio.open_connection(sock=channel, limit=_MAX_FRAME)
|
|
247
|
+
request = json.loads(await reader.readline())
|
|
248
|
+
if request.get("type") != "execute":
|
|
249
|
+
raise RuntimeError("Invalid Fabric execution request")
|
|
250
|
+
response_task = asyncio.create_task(_responses(reader))
|
|
251
|
+
try:
|
|
252
|
+
# macOS does not provide a dependable address-space limit for CPython.
|
|
253
|
+
# Linux bounds allocations; the parent owns the wall-clock deadline.
|
|
254
|
+
if sys.platform.startswith("linux"):
|
|
255
|
+
import resource
|
|
256
|
+
resource.setrlimit(resource.RLIMIT_AS, (request["memoryLimitBytes"], request["memoryLimitBytes"]))
|
|
257
|
+
source = request["code"]
|
|
258
|
+
parsed = ast.parse(source, filename="fabric-exec.py", mode="exec")
|
|
259
|
+
provided = request.get("strings", {})
|
|
260
|
+
missing = set()
|
|
261
|
+
for node in ast.walk(parsed):
|
|
262
|
+
key = None
|
|
263
|
+
if isinstance(node, ast.Attribute) and isinstance(node.value, ast.Name) and node.value.id in ("π", "payloads") and isinstance(node.ctx, ast.Load):
|
|
264
|
+
key = node.attr
|
|
265
|
+
elif isinstance(node, ast.Subscript) and isinstance(node.value, ast.Name) and node.value.id in ("π", "payloads") and isinstance(node.slice, ast.Constant) and isinstance(node.slice.value, str) and isinstance(node.ctx, ast.Load):
|
|
266
|
+
key = node.slice.value
|
|
267
|
+
if key is not None and key not in provided:
|
|
268
|
+
missing.add(key)
|
|
269
|
+
if missing:
|
|
270
|
+
raise KeyError("Pre-execution check: missing payloads " + ", ".join(sorted(missing)) + "; pass these keys in fabric_exec.payloads")
|
|
271
|
+
function = ast.parse("async def __fabric_program():\n pass\n").body[0]
|
|
272
|
+
function.body = parsed.body or function.body
|
|
273
|
+
function.end_lineno = max(2, len(source.splitlines()))
|
|
274
|
+
program = ast.fix_missing_locations(ast.Module(body=[function], type_ignores=[]))
|
|
275
|
+
namespace = {name: _Proxy(name) for name in ("pi", "tools", "mcp", "extensions", "memory", "state", "schema", "components", "compact", "agents", "mesh")}
|
|
276
|
+
payloads = _Payloads(request.get("strings", {}))
|
|
277
|
+
namespace.update({"π": payloads, "payloads": payloads, "asyncio": asyncio, "__name__": "__fabric_guest__"})
|
|
278
|
+
exec(compile(program, "fabric-exec.py", "exec"), namespace)
|
|
279
|
+
value = await namespace["__fabric_program"]()
|
|
280
|
+
sys.stdout.flush()
|
|
281
|
+
sys.stderr.flush()
|
|
282
|
+
await _send({"type": "result", "result": {"value": value, "terminationReason": "completed"}})
|
|
283
|
+
except BaseException:
|
|
284
|
+
await _send({"type": "result", "result": {"terminationReason": "runtime_error", "error": _error_text(sys.exception() if hasattr(sys, "exception") else sys.exc_info()[1], locals().get("source", ""))}})
|
|
285
|
+
finally:
|
|
286
|
+
response_task.cancel()
|
|
287
|
+
await asyncio.gather(response_task, return_exceptions=True)
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
try:
|
|
291
|
+
asyncio.run(_main())
|
|
292
|
+
except BaseException:
|
|
293
|
+
traceback.print_exc()
|
|
294
|
+
sys.exit(1)
|
|
295
|
+
`;
|
|
296
|
+
|
|
297
|
+
// src/runtime/cpython-linux-sandbox.ts
|
|
298
|
+
var linuxCPythonNetworkFilter = (architecture) => {
|
|
299
|
+
const platform = architecture === "x64" ? { audit: 3221225534, socket: 41, connect: 42, bind: 49, sendto: 44, sendmsg: 46, sendmmsg: 307 } : architecture === "arm64" ? { audit: 3221225655, socket: 198, connect: 203, bind: 200, sendto: 206, sendmsg: 211, sendmmsg: 269 } : void 0;
|
|
300
|
+
if (!platform) throw new Error(`Schema enforce CPython seccomp is unsupported on ${architecture}; no unsandboxed fallback is permitted.`);
|
|
301
|
+
const instructions = [];
|
|
302
|
+
const load = (offset) => {
|
|
303
|
+
instructions.push([32, 0, 0, offset]);
|
|
304
|
+
};
|
|
305
|
+
const equal = (value, yes, no) => {
|
|
306
|
+
instructions.push([21, yes, no, value]);
|
|
307
|
+
};
|
|
308
|
+
const ret = (value) => {
|
|
309
|
+
instructions.push([6, 0, 0, value]);
|
|
310
|
+
};
|
|
311
|
+
const deny = 327681;
|
|
312
|
+
const allow = 2147418112;
|
|
313
|
+
load(4);
|
|
314
|
+
equal(platform.audit, 1, 0);
|
|
315
|
+
ret(2147483648);
|
|
316
|
+
load(0);
|
|
317
|
+
instructions.push([69, 0, 1, 1073741824]);
|
|
318
|
+
ret(deny);
|
|
319
|
+
for (const syscall of [platform.socket, platform.connect, platform.bind, platform.sendmsg, platform.sendmmsg, 425, 426, 427]) {
|
|
320
|
+
equal(syscall, 0, 1);
|
|
321
|
+
ret(deny);
|
|
322
|
+
}
|
|
323
|
+
equal(platform.sendto, 1, 0);
|
|
324
|
+
ret(allow);
|
|
325
|
+
load(48);
|
|
326
|
+
equal(0, 1, 0);
|
|
327
|
+
ret(deny);
|
|
328
|
+
load(52);
|
|
329
|
+
equal(0, 1, 0);
|
|
330
|
+
ret(deny);
|
|
331
|
+
ret(allow);
|
|
332
|
+
const bytes = Buffer.alloc(instructions.length * 8);
|
|
333
|
+
for (const [index, [code, yes, no, value]] of instructions.entries()) {
|
|
334
|
+
bytes.writeUInt16LE(code, index * 8);
|
|
335
|
+
bytes[index * 8 + 2] = yes;
|
|
336
|
+
bytes[index * 8 + 3] = no;
|
|
337
|
+
bytes.writeUInt32LE(value, index * 8 + 4);
|
|
338
|
+
}
|
|
339
|
+
return bytes;
|
|
340
|
+
};
|
|
341
|
+
|
|
342
|
+
// src/runtime/cpython-runtime.ts
|
|
343
|
+
var MAX_FRAME_BYTES = 16 * 1024 * 1024;
|
|
344
|
+
var HOST_SETTLE_MS = 250;
|
|
345
|
+
var MACOS_PROFILE = "(version 1) (deny default) (allow process-exec) (allow process-fork) (allow file-read*) (allow sysctl-read)";
|
|
346
|
+
var record = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
347
|
+
var errorText = (error) => error instanceof Error ? error.message : String(error);
|
|
348
|
+
var executable = async (binary, cwd) => {
|
|
349
|
+
const extensions = process.platform === "win32" ? String(process.env.PATHEXT ?? ".COM;.EXE;.BAT;.CMD").split(";").filter(Boolean) : [];
|
|
350
|
+
const variants = (candidate) => extensions.length && !/\.[A-Za-z0-9]+$/.test(candidate) ? [candidate, ...extensions.map((extension) => candidate + extension)] : [candidate];
|
|
351
|
+
const candidates = path.isAbsolute(binary) || binary.includes("/") || binary.includes("\\") ? [path.resolve(cwd, binary)] : (process.env.PATH ?? "").split(path.delimiter).map((directory) => path.resolve(cwd, directory || ".", binary));
|
|
352
|
+
for (const candidate of candidates) {
|
|
353
|
+
for (const variant of variants(candidate)) {
|
|
354
|
+
try {
|
|
355
|
+
await access(variant, constants.X_OK);
|
|
356
|
+
return await realpath(variant);
|
|
357
|
+
} catch {
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
throw new Error(`CPython executable not found: ${binary}. Install Python 3 or set executor.cpython.binary to a trusted executable's absolute path.`);
|
|
362
|
+
};
|
|
363
|
+
var launch = async (binary, enforce, cwd) => {
|
|
364
|
+
const python = await executable(binary, cwd);
|
|
365
|
+
const args = ["-I", "-B", "-u", "-c", CPYTHON_CHILD_SOURCE];
|
|
366
|
+
if (!enforce) return { command: python, args };
|
|
367
|
+
if (process.platform === "darwin") {
|
|
368
|
+
try {
|
|
369
|
+
await access("/usr/bin/sandbox-exec", constants.X_OK);
|
|
370
|
+
} catch {
|
|
371
|
+
throw new Error("Schema enforce CPython requires /usr/bin/sandbox-exec on macOS; no unsandboxed fallback is permitted.");
|
|
372
|
+
}
|
|
373
|
+
return { command: "/usr/bin/sandbox-exec", args: ["-p", MACOS_PROFILE, python, ...args] };
|
|
374
|
+
}
|
|
375
|
+
if (process.platform === "linux") {
|
|
376
|
+
let bwrap;
|
|
377
|
+
for (const candidate of ["/usr/bin/bwrap", "/bin/bwrap"]) {
|
|
378
|
+
try {
|
|
379
|
+
await access(candidate, constants.X_OK);
|
|
380
|
+
bwrap = candidate;
|
|
381
|
+
break;
|
|
382
|
+
} catch {
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
if (!bwrap) throw new Error("Schema enforce CPython requires bubblewrap (/usr/bin/bwrap). Install bubblewrap and enable unprivileged user namespaces; no unsandboxed fallback is permitted.");
|
|
386
|
+
return {
|
|
387
|
+
command: bwrap,
|
|
388
|
+
args: ["--ro-bind", "/", "/", "--unshare-all", "--die-with-parent", "--new-session", "--proc", "/proc", "--dev", "/dev", "--preserve-fds", "1", "--seccomp", "4", "--chdir", cwd, "--", python, ...args],
|
|
389
|
+
seccomp: linuxCPythonNetworkFilter(process.arch)
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
throw new Error(`Schema enforce CPython has no supported OS sandbox on ${process.platform}; no unsandboxed fallback is permitted.`);
|
|
393
|
+
};
|
|
394
|
+
var createIpcListener = () => new Promise((resolve, reject) => {
|
|
395
|
+
const server = net.createServer();
|
|
396
|
+
const token = randomBytes(32).toString("hex");
|
|
397
|
+
server.once("error", reject);
|
|
398
|
+
server.listen(0, "127.0.0.1", () => {
|
|
399
|
+
const address = server.address();
|
|
400
|
+
if (address === null || typeof address === "string") reject(new Error("Fabric CPython IPC listener failed to bind"));
|
|
401
|
+
else resolve({ server, port: address.port, token });
|
|
402
|
+
});
|
|
403
|
+
});
|
|
404
|
+
var CPythonRuntime = class {
|
|
405
|
+
constructor(binary = "python3", enforce = false) {
|
|
406
|
+
this.binary = binary;
|
|
407
|
+
this.enforce = enforce;
|
|
408
|
+
}
|
|
409
|
+
async execute(code, hostCall, options) {
|
|
410
|
+
const failure = (terminationReason, error) => ({ value: void 0, logs: [], terminationReason, error });
|
|
411
|
+
if (options.signal?.aborted) return failure("aborted", "Execution cancelled");
|
|
412
|
+
if (!Number.isSafeInteger(options.memoryLimitBytes) || options.memoryLimitBytes < 1) {
|
|
413
|
+
return failure("runtime_error", "CPython memory limit must be a positive safe integer");
|
|
414
|
+
}
|
|
415
|
+
if (!Number.isFinite(options.timeoutMs) || options.timeoutMs < 1) return failure("runtime_error", "CPython timeout must be positive");
|
|
416
|
+
const startedAt = Date.now();
|
|
417
|
+
let command;
|
|
418
|
+
try {
|
|
419
|
+
command = await launch(this.binary, this.enforce, options.cwd ?? process.cwd());
|
|
420
|
+
} catch (error) {
|
|
421
|
+
return failure("runtime_error", errorText(error));
|
|
422
|
+
}
|
|
423
|
+
if (options.signal?.aborted) return failure("aborted", "Execution cancelled");
|
|
424
|
+
const ipc = process.platform === "win32" ? await createIpcListener() : void 0;
|
|
425
|
+
return new Promise((resolve) => {
|
|
426
|
+
const hostAbort = new AbortController();
|
|
427
|
+
const hostTasks = /* @__PURE__ */ new Set();
|
|
428
|
+
const callIds = /* @__PURE__ */ new Set();
|
|
429
|
+
const logs = [];
|
|
430
|
+
const partialLogs = ["", ""];
|
|
431
|
+
const decoders = [new StringDecoder("utf8"), new StringDecoder("utf8")];
|
|
432
|
+
const maxLogChars = Math.max(0, options.maxLogChars ?? 1e5);
|
|
433
|
+
let logChars = 0;
|
|
434
|
+
let truncated = false;
|
|
435
|
+
let settled = false;
|
|
436
|
+
let finishing = false;
|
|
437
|
+
let deadline;
|
|
438
|
+
let deadlineAt = startedAt + options.timeoutMs;
|
|
439
|
+
let buffer = Buffer.alloc(0);
|
|
440
|
+
let child;
|
|
441
|
+
try {
|
|
442
|
+
child = spawn(command.command, command.args, {
|
|
443
|
+
cwd: options.cwd ?? process.cwd(),
|
|
444
|
+
// -I ignores PYTHON* and user site packages; -B avoids bytecode writes.
|
|
445
|
+
// Keep ordinary environment for trusted native code, not a false secrecy claim.
|
|
446
|
+
env: ipc ? { ...process.env, FABRIC_IPC_PORT: String(ipc.port), FABRIC_IPC_TOKEN: ipc.token } : process.env,
|
|
447
|
+
detached: process.platform !== "win32",
|
|
448
|
+
stdio: command.seccomp ? ["ignore", "pipe", "pipe", "pipe", "pipe"] : ["ignore", "pipe", "pipe", "pipe"]
|
|
449
|
+
});
|
|
450
|
+
} catch (error) {
|
|
451
|
+
ipc?.server.close();
|
|
452
|
+
resolve(failure("runtime_error", `CPython process failed: ${errorText(error)}`));
|
|
453
|
+
return;
|
|
454
|
+
}
|
|
455
|
+
let channel;
|
|
456
|
+
let expectedToken = ipc?.token;
|
|
457
|
+
let childExited = child.pid === void 0;
|
|
458
|
+
child.once("exit", () => {
|
|
459
|
+
childExited = true;
|
|
460
|
+
});
|
|
461
|
+
const appendLog = (index, text) => {
|
|
462
|
+
if (settled || truncated) return;
|
|
463
|
+
const available = Math.max(0, maxLogChars - logChars);
|
|
464
|
+
const retained = text.slice(0, available);
|
|
465
|
+
logChars += retained.length;
|
|
466
|
+
const lines = ((partialLogs[index] ?? "") + retained).split("\n");
|
|
467
|
+
partialLogs[index] = lines.pop() ?? "";
|
|
468
|
+
for (const line of lines) logs.push(line.replace(/\r$/, ""));
|
|
469
|
+
if (retained.length !== text.length) truncated = true;
|
|
470
|
+
};
|
|
471
|
+
const finish = async (result) => {
|
|
472
|
+
if (settled) return;
|
|
473
|
+
for (let index = 0; index < decoders.length; index++) appendLog(index, decoders[index].end());
|
|
474
|
+
settled = true;
|
|
475
|
+
if (deadline) clearTimeout(deadline);
|
|
476
|
+
options.signal?.removeEventListener("abort", abort);
|
|
477
|
+
if (!hostAbort.signal.aborted) hostAbort.abort(new Error(result.error ?? "CPython execution ended"));
|
|
478
|
+
channel?.destroy();
|
|
479
|
+
ipc?.server.close();
|
|
480
|
+
child.stdout?.destroy();
|
|
481
|
+
child.stderr?.destroy();
|
|
482
|
+
if (child.pid && process.platform !== "win32") {
|
|
483
|
+
try {
|
|
484
|
+
process.kill(-child.pid, "SIGKILL");
|
|
485
|
+
} catch {
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
child.kill("SIGKILL");
|
|
489
|
+
if (!childExited) {
|
|
490
|
+
await new Promise((done) => {
|
|
491
|
+
const timer = setTimeout(done, 250);
|
|
492
|
+
timer.unref?.();
|
|
493
|
+
child.once("exit", () => {
|
|
494
|
+
clearTimeout(timer);
|
|
495
|
+
done();
|
|
496
|
+
});
|
|
497
|
+
});
|
|
498
|
+
}
|
|
499
|
+
for (const text of partialLogs) if (text) logs.push(text);
|
|
500
|
+
if (truncated) logs.push("[Pi Fabric log output truncated]");
|
|
501
|
+
resolve({ ...result, logs });
|
|
502
|
+
};
|
|
503
|
+
const abort = () => void finish({ value: void 0, terminationReason: "aborted", error: "Execution cancelled" });
|
|
504
|
+
const fail = (message) => void finish({ value: void 0, terminationReason: "runtime_error", error: message });
|
|
505
|
+
const scheduleDeadline = () => {
|
|
506
|
+
if (deadline) clearTimeout(deadline);
|
|
507
|
+
deadline = setTimeout(() => void finish({
|
|
508
|
+
value: void 0,
|
|
509
|
+
terminationReason: "timed_out",
|
|
510
|
+
error: `Execution timed out after ${deadlineAt - startedAt}ms`
|
|
511
|
+
}), Math.max(0, deadlineAt - Date.now()));
|
|
512
|
+
deadline.unref?.();
|
|
513
|
+
};
|
|
514
|
+
const send = (message) => {
|
|
515
|
+
if (settled || finishing || !channel || channel.destroyed) return;
|
|
516
|
+
try {
|
|
517
|
+
const frame = JSON.stringify(message) + "\n";
|
|
518
|
+
const bytes = Buffer.byteLength(frame);
|
|
519
|
+
if (bytes > MAX_FRAME_BYTES || channel.writableLength + bytes > MAX_FRAME_BYTES * 2) {
|
|
520
|
+
fail("CPython IPC frame or write buffer exceeds its 16 MiB frame limit");
|
|
521
|
+
return;
|
|
522
|
+
}
|
|
523
|
+
channel.write(frame, (error) => {
|
|
524
|
+
if (error && !settled && !finishing) fail(`CPython IPC failed: ${error.message}`);
|
|
525
|
+
});
|
|
526
|
+
} catch (error) {
|
|
527
|
+
fail(`CPython IPC serialization failed: ${errorText(error)}`);
|
|
528
|
+
}
|
|
529
|
+
};
|
|
530
|
+
const handleMessage = (message) => {
|
|
531
|
+
if (settled || finishing) return;
|
|
532
|
+
if (!record(message)) {
|
|
533
|
+
fail("Invalid CPython IPC message");
|
|
534
|
+
return;
|
|
535
|
+
}
|
|
536
|
+
if (message.type === "result") {
|
|
537
|
+
const result = message.result;
|
|
538
|
+
if (!record(result) || !["completed", "runtime_error"].includes(String(result.terminationReason)) || result.error !== void 0 && typeof result.error !== "string") {
|
|
539
|
+
fail("Invalid CPython terminal result");
|
|
540
|
+
return;
|
|
541
|
+
}
|
|
542
|
+
finishing = true;
|
|
543
|
+
if (result.terminationReason !== "completed") hostAbort.abort(new Error(String(result.error ?? "Python guest failed")));
|
|
544
|
+
void (async () => {
|
|
545
|
+
const done = await settleWithin(hostTasks, HOST_SETTLE_MS);
|
|
546
|
+
if (!done) {
|
|
547
|
+
hostAbort.abort(new Error("Fabric guest execution ended before its host calls settled"));
|
|
548
|
+
await settleWithin(hostTasks, HOST_SETTLE_MS);
|
|
549
|
+
}
|
|
550
|
+
await new Promise((done2) => setImmediate(done2));
|
|
551
|
+
finish({
|
|
552
|
+
value: result.value,
|
|
553
|
+
terminationReason: result.terminationReason,
|
|
554
|
+
...typeof result.error === "string" ? { error: result.error } : {}
|
|
555
|
+
});
|
|
556
|
+
})();
|
|
557
|
+
return;
|
|
558
|
+
}
|
|
559
|
+
if (message.type !== "call" || !Number.isSafeInteger(message.id) || message.id < 1 || typeof message.ref !== "string" || !message.ref || message.ref.length > 512 || !record(message.args) || callIds.has(message.id) || hostTasks.size >= 256) {
|
|
560
|
+
fail("Invalid or excessive CPython host call");
|
|
561
|
+
return;
|
|
562
|
+
}
|
|
563
|
+
const id = message.id;
|
|
564
|
+
const ref = message.ref;
|
|
565
|
+
const args = message.args;
|
|
566
|
+
callIds.add(id);
|
|
567
|
+
try {
|
|
568
|
+
const floor = options.minimumTimeoutMsForHostCall?.(ref, args);
|
|
569
|
+
if (typeof floor === "number" && Number.isFinite(floor) && Date.now() + floor > deadlineAt) {
|
|
570
|
+
deadlineAt = Date.now() + Math.max(1, Math.floor(floor));
|
|
571
|
+
scheduleDeadline();
|
|
572
|
+
}
|
|
573
|
+
} catch (error) {
|
|
574
|
+
fail(`CPython deadline policy failed: ${errorText(error)}`);
|
|
575
|
+
return;
|
|
576
|
+
}
|
|
577
|
+
const task = runAbortable(hostAbort.signal, () => hostCall(ref, args, hostAbort.signal)).then(
|
|
578
|
+
(value) => send({ type: "response", id, ok: true, value }),
|
|
579
|
+
(error) => send({ type: "response", id, ok: false, error: errorText(error), ...isPiShellRef(ref) ? { bashExit: piBashExitMetadata(error) } : {} })
|
|
580
|
+
).finally(() => {
|
|
581
|
+
hostTasks.delete(task);
|
|
582
|
+
callIds.delete(id);
|
|
583
|
+
});
|
|
584
|
+
hostTasks.add(task);
|
|
585
|
+
};
|
|
586
|
+
const onData = (chunk) => {
|
|
587
|
+
if (settled || finishing) return;
|
|
588
|
+
buffer = Buffer.concat([buffer, chunk]);
|
|
589
|
+
if (expectedToken !== void 0) {
|
|
590
|
+
const handshake = buffer.indexOf(10);
|
|
591
|
+
if (handshake === -1) {
|
|
592
|
+
if (buffer.length > 4096) fail("Invalid CPython IPC handshake");
|
|
593
|
+
return;
|
|
594
|
+
}
|
|
595
|
+
let verified = false;
|
|
596
|
+
try {
|
|
597
|
+
const hello = JSON.parse(buffer.subarray(0, handshake).toString("utf8"));
|
|
598
|
+
verified = record(hello) && hello.type === "hello" && hello.token === expectedToken;
|
|
599
|
+
} catch {
|
|
600
|
+
}
|
|
601
|
+
if (!verified) {
|
|
602
|
+
fail("Invalid CPython IPC handshake");
|
|
603
|
+
return;
|
|
604
|
+
}
|
|
605
|
+
buffer = buffer.subarray(handshake + 1);
|
|
606
|
+
expectedToken = void 0;
|
|
607
|
+
send({ type: "execute", code, strings: options.strings ?? {}, memoryLimitBytes: options.memoryLimitBytes });
|
|
608
|
+
if (settled || finishing) return;
|
|
609
|
+
}
|
|
610
|
+
let newline;
|
|
611
|
+
while ((newline = buffer.indexOf(10)) !== -1) {
|
|
612
|
+
if (newline > MAX_FRAME_BYTES) {
|
|
613
|
+
fail("CPython IPC frame exceeds 16 MiB");
|
|
614
|
+
return;
|
|
615
|
+
}
|
|
616
|
+
const frame = buffer.subarray(0, newline).toString("utf8");
|
|
617
|
+
buffer = buffer.subarray(newline + 1);
|
|
618
|
+
try {
|
|
619
|
+
handleMessage(JSON.parse(frame));
|
|
620
|
+
} catch (error) {
|
|
621
|
+
fail(`Invalid CPython IPC: ${errorText(error)}`);
|
|
622
|
+
return;
|
|
623
|
+
}
|
|
624
|
+
if (settled || finishing) return;
|
|
625
|
+
}
|
|
626
|
+
if (buffer.length > MAX_FRAME_BYTES) fail("CPython IPC frame exceeds 16 MiB");
|
|
627
|
+
};
|
|
628
|
+
const attach = (socket) => {
|
|
629
|
+
channel = socket;
|
|
630
|
+
if (socket instanceof net.Socket) socket.setNoDelay(true);
|
|
631
|
+
socket.on("data", onData);
|
|
632
|
+
socket.on("error", (error) => {
|
|
633
|
+
if (!settled && !finishing) fail(`CPython IPC failed: ${error.message}`);
|
|
634
|
+
});
|
|
635
|
+
};
|
|
636
|
+
child.stdout?.on("data", (chunk) => appendLog(0, decoders[0].write(chunk)));
|
|
637
|
+
child.stderr?.on("data", (chunk) => appendLog(1, decoders[1].write(chunk)));
|
|
638
|
+
child.on("error", (error) => fail(`CPython process failed: ${error.message}${this.enforce ? "; OS sandbox is required (no native fallback)" : ""}`));
|
|
639
|
+
child.on("close", (exitCode, signal) => {
|
|
640
|
+
if (settled || finishing) return;
|
|
641
|
+
const diagnostics = [...logs, ...partialLogs].join("\n").slice(-4e3);
|
|
642
|
+
fail(`CPython ${this.enforce ? "sandbox " : ""}process exited before returning a result (${signal ?? exitCode}).${this.enforce ? " Verify OS sandbox availability/user namespaces; no unsandboxed fallback is permitted." : ""}${diagnostics ? `
|
|
643
|
+
${diagnostics}` : ""}`);
|
|
644
|
+
});
|
|
645
|
+
options.signal?.addEventListener("abort", abort, { once: true });
|
|
646
|
+
if (options.signal?.aborted) {
|
|
647
|
+
abort();
|
|
648
|
+
return;
|
|
649
|
+
}
|
|
650
|
+
if (command.seccomp) {
|
|
651
|
+
const filterPipe = child.stdio[4];
|
|
652
|
+
filterPipe.on("error", (error) => {
|
|
653
|
+
if (!settled) fail(`CPython sandbox filter failed: ${error.message}`);
|
|
654
|
+
});
|
|
655
|
+
filterPipe.end(command.seccomp);
|
|
656
|
+
}
|
|
657
|
+
scheduleDeadline();
|
|
658
|
+
if (ipc) {
|
|
659
|
+
ipc.server.on("connection", (socket) => {
|
|
660
|
+
if (channel) {
|
|
661
|
+
socket.destroy();
|
|
662
|
+
return;
|
|
663
|
+
}
|
|
664
|
+
ipc.server.close();
|
|
665
|
+
attach(socket);
|
|
666
|
+
});
|
|
667
|
+
} else {
|
|
668
|
+
attach(child.stdio[3]);
|
|
669
|
+
send({ type: "execute", code, strings: options.strings ?? {}, memoryLimitBytes: options.memoryLimitBytes });
|
|
670
|
+
}
|
|
671
|
+
});
|
|
672
|
+
}
|
|
673
|
+
};
|
|
674
|
+
export {
|
|
675
|
+
CPythonRuntime
|
|
676
|
+
};
|
|
677
|
+
//# sourceMappingURL=cpython-runtime.js.map
|