@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
package/dist/agents.js
ADDED
|
@@ -0,0 +1,761 @@
|
|
|
1
|
+
import {
|
|
2
|
+
validateAgentResult
|
|
3
|
+
} from "./chunks/chunk-3QECYQGA.js";
|
|
4
|
+
import {
|
|
5
|
+
AGENTS_ACTION_DESCRIPTORS,
|
|
6
|
+
normalizeAgentRunRequest
|
|
7
|
+
} from "./chunks/chunk-2PZWDVJB.js";
|
|
8
|
+
import {
|
|
9
|
+
actionArgNormalizer
|
|
10
|
+
} from "./chunks/chunk-NQOEHX62.js";
|
|
11
|
+
import {
|
|
12
|
+
AgentAdmission,
|
|
13
|
+
assertAgentTask,
|
|
14
|
+
beginAgentSettlement,
|
|
15
|
+
createAgentLifecycle,
|
|
16
|
+
finishAgentSettlement,
|
|
17
|
+
terminalAgentStatuses,
|
|
18
|
+
waitForAgent
|
|
19
|
+
} from "./chunks/chunk-AYBIR4YV.js";
|
|
20
|
+
import "./chunks/chunk-OTCASLY2.js";
|
|
21
|
+
import "./chunks/chunk-MGWQOKBV.js";
|
|
22
|
+
import "./chunks/chunk-3H7SDWZI.js";
|
|
23
|
+
|
|
24
|
+
// src/agents/service-schema.ts
|
|
25
|
+
import { Value } from "typebox/value";
|
|
26
|
+
var native = (name) => {
|
|
27
|
+
const descriptor = AGENTS_ACTION_DESCRIPTORS.find((entry) => entry.name === name);
|
|
28
|
+
if (!descriptor) throw new Error(`Missing native agent descriptor: ${name}`);
|
|
29
|
+
return structuredClone(descriptor);
|
|
30
|
+
};
|
|
31
|
+
var run = native("run");
|
|
32
|
+
var properties = { ...run.inputSchema.properties };
|
|
33
|
+
for (const key of ["transport", "persona"]) delete properties[key];
|
|
34
|
+
Object.assign(properties, {
|
|
35
|
+
runner: { type: "string", enum: ["pi"] },
|
|
36
|
+
kernel: { type: "string", enum: ["typescript", "inherit"] },
|
|
37
|
+
extensions: { type: "boolean", const: true },
|
|
38
|
+
worktree: { type: "boolean", const: false },
|
|
39
|
+
timeoutMs: { type: "number", minimum: 1 },
|
|
40
|
+
cwd: { type: "string", description: "Host-authorized placement selector; never resolved by Fabric" },
|
|
41
|
+
images: { type: "array", items: { type: "object", properties: { type: { const: "image" }, data: { type: "string" }, mimeType: { type: "string" } }, required: ["type", "data", "mimeType"], additionalProperties: false } },
|
|
42
|
+
systemPrompt: { type: "string" }
|
|
43
|
+
});
|
|
44
|
+
var runSchema = { type: "object", properties, required: ["task"], additionalProperties: false };
|
|
45
|
+
var spawnSchema = { type: "object", properties: { ...properties, residency: { type: "string", enum: ["session", "durable"] } }, required: ["task"], additionalProperties: false };
|
|
46
|
+
var id = { type: "string", minLength: 1 };
|
|
47
|
+
var object = (properties2, required = []) => ({ type: "object", properties: properties2, required, additionalProperties: false });
|
|
48
|
+
function agentServiceDescriptors(capabilities = {}) {
|
|
49
|
+
const descriptors2 = [
|
|
50
|
+
{ ...run, description: "Run one host-authorized Pi child and wait for its result or pause", inputSchema: runSchema },
|
|
51
|
+
{ ...native("spawn"), description: "Admit one host-authorized Pi child, or residency durable for an independent host worker", inputSchema: spawnSchema },
|
|
52
|
+
...["wait", "join", "status", "stop"].map((name) => ({ ...native(name), inputSchema: object({ id }, ["id"]) })),
|
|
53
|
+
{ ...native("list"), description: "List only the authenticated caller's direct children", inputSchema: object({}) }
|
|
54
|
+
];
|
|
55
|
+
if (capabilities.steer) descriptors2.push({ ...native("steer"), inputSchema: object({ id, message: { type: "string", minLength: 1 } }, ["id", "message"]) });
|
|
56
|
+
if (capabilities.followUp) descriptors2.push({ ...native("followUp"), inputSchema: object({ id, message: { type: "string", minLength: 1 } }, ["id", "message"]) });
|
|
57
|
+
if (capabilities.compact) descriptors2.push({ ...native("compact"), inputSchema: object({ id, instructions: { type: "string" } }, ["id"]) });
|
|
58
|
+
if (capabilities.resume) descriptors2.push({ name: "resume", description: "Continue a paused, completed or failed direct child from its host checkpoint and wait for result or pause", risk: "agent", inputSchema: object({ id, task: { type: "string", minLength: 1 } }, ["id"]) });
|
|
59
|
+
if (capabilities.topology) {
|
|
60
|
+
descriptors2.push(
|
|
61
|
+
{ ...native("sessions"), inputSchema: object({}) },
|
|
62
|
+
{ ...native("peers"), inputSchema: object({}) },
|
|
63
|
+
{ ...native("self"), inputSchema: object({}) },
|
|
64
|
+
{ ...native("members"), inputSchema: object({}) },
|
|
65
|
+
{ ...native("create"), description: "Create a lasting session peer in this project", inputSchema: object({ name: { type: "string", minLength: 1 }, instructions: { type: "string" }, task: { type: "string" } }, ["name"]) },
|
|
66
|
+
{ ...native("remove"), description: "Stop and remove a lasting session peer created in this project", inputSchema: object({ id: { type: "string", minLength: 1 }, name: { type: "string" } }, ["id"]) }
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
return descriptors2;
|
|
70
|
+
}
|
|
71
|
+
var descriptors = agentServiceDescriptors({ steer: true, compact: true, resume: true });
|
|
72
|
+
var normalize = actionArgNormalizer(() => descriptors);
|
|
73
|
+
function agentServiceArgs(action, input) {
|
|
74
|
+
const descriptor = descriptors.find((entry) => entry.name === action);
|
|
75
|
+
if (!descriptor) throw new Error(`Unsupported hosted agents action: ${action}`);
|
|
76
|
+
const args = normalize(action, input);
|
|
77
|
+
if (!Value.Check(descriptor.inputSchema, args)) {
|
|
78
|
+
const reasons = [...Value.Errors(descriptor.inputSchema, args)].slice(0, 5).map((error) => `${error.instancePath}: ${error.message}`);
|
|
79
|
+
throw new Error(`Invalid hosted agents.${action} arguments: ${reasons.join("; ")}`);
|
|
80
|
+
}
|
|
81
|
+
return args;
|
|
82
|
+
}
|
|
83
|
+
function normalizeAgentServiceRequest(input) {
|
|
84
|
+
const { residency, ...rest } = input;
|
|
85
|
+
const args = agentServiceArgs("run", rest);
|
|
86
|
+
const request = normalizeAgentRunRequest(args, { runner: "pi", timeoutMs: 0 });
|
|
87
|
+
if (args.images !== void 0) request.images = structuredClone(args.images);
|
|
88
|
+
if (args.systemPrompt !== void 0) request.systemPrompt = args.systemPrompt;
|
|
89
|
+
if (residency === "session" || residency === "durable") request.residency = residency;
|
|
90
|
+
assertAgentTask(request);
|
|
91
|
+
return structuredClone(request);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// src/agents/service.ts
|
|
95
|
+
var copy = (value) => structuredClone(value);
|
|
96
|
+
var publicRecord = (record) => {
|
|
97
|
+
const keys = ["id", "rootId", "parentId", "depth", "generation", "name", "task", "status", "runner", "kernel", "cwd", "model", "thinking", "recursive", "startedAt", "updatedAt", "finishedAt", "currentTool", "turns", "toolCalls", "text", "value", "error", "usage", "sessionId"];
|
|
98
|
+
return copy(Object.fromEntries(keys.filter((key) => record[key] !== void 0).map((key) => [key, record[key]])));
|
|
99
|
+
};
|
|
100
|
+
var errorText = (error) => error instanceof Error ? error.message : String(error);
|
|
101
|
+
var idle = () => ({ settled: true, result: void 0, resolve: void 0, release() {
|
|
102
|
+
}, abortSignal: void 0, abortHandler: void 0 });
|
|
103
|
+
var AgentService = class {
|
|
104
|
+
#options;
|
|
105
|
+
#entries = /* @__PURE__ */ new Map();
|
|
106
|
+
#admission;
|
|
107
|
+
#pending = /* @__PURE__ */ new Map();
|
|
108
|
+
#closing = new AbortController();
|
|
109
|
+
#close;
|
|
110
|
+
#suspend;
|
|
111
|
+
#suspended = false;
|
|
112
|
+
#sequence = 0;
|
|
113
|
+
#publication = Promise.resolve();
|
|
114
|
+
capabilities;
|
|
115
|
+
constructor(options) {
|
|
116
|
+
if (!options.rootId) throw new Error("Agent service requires a trusted rootId");
|
|
117
|
+
for (const [key, value] of Object.entries({ maxStarts: options.maxStarts ?? 8, maxDepth: options.maxDepth ?? 3, maxConcurrent: options.maxConcurrent ?? 4 })) {
|
|
118
|
+
if (!Number.isSafeInteger(value) || value < 1) throw new Error(`${key} must be a positive integer`);
|
|
119
|
+
}
|
|
120
|
+
this.#options = { ...options, port: options.port };
|
|
121
|
+
this.#admission = new AgentAdmission(options.maxConcurrent ?? 4, options.maxStarts ?? 8, options.maxDepth ?? 3);
|
|
122
|
+
this.capabilities = Object.freeze({
|
|
123
|
+
steer: Boolean(options.port.steer || options.topology),
|
|
124
|
+
compact: Boolean(options.port.compact),
|
|
125
|
+
resume: Boolean(options.port.resume),
|
|
126
|
+
followUp: Boolean(options.port.followUp || options.topology),
|
|
127
|
+
topology: Boolean(options.topology)
|
|
128
|
+
});
|
|
129
|
+
if (options.snapshot) this.#restore(options.snapshot);
|
|
130
|
+
}
|
|
131
|
+
snapshot() {
|
|
132
|
+
return copy({
|
|
133
|
+
version: 1,
|
|
134
|
+
rootId: this.#options.rootId,
|
|
135
|
+
starts: this.#admission.starts,
|
|
136
|
+
sequence: this.#sequence,
|
|
137
|
+
records: [...this.#entries.values()].map(({ request, record }) => ({ request, record }))
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
async run(callerId, request, signal) {
|
|
141
|
+
const handle = await this.spawn(callerId, request, signal);
|
|
142
|
+
return this.wait(callerId, handle.id, signal);
|
|
143
|
+
}
|
|
144
|
+
async spawn(callerId, request, signal) {
|
|
145
|
+
const normalized = normalizeAgentServiceRequest(request);
|
|
146
|
+
if (normalized.residency === "durable") {
|
|
147
|
+
await this.#authorize(callerId);
|
|
148
|
+
const dispatch = this.#topology().dispatch;
|
|
149
|
+
if (!dispatch) throw new Error("Durable hosted spawn is unavailable");
|
|
150
|
+
const record = await dispatch({ callerId, request: normalized, ...signal ? { signal } : {} });
|
|
151
|
+
await this.#authorize(callerId);
|
|
152
|
+
return copy(record);
|
|
153
|
+
}
|
|
154
|
+
return this.#start(callerId, normalized, void 0, signal);
|
|
155
|
+
}
|
|
156
|
+
async wait(callerId, id2, signal) {
|
|
157
|
+
await this.#authorize(callerId);
|
|
158
|
+
const entry = this.#child(callerId, id2);
|
|
159
|
+
const result = entry.lifecycle.result ?? Promise.resolve(copy(entry.record));
|
|
160
|
+
const record = await waitForAgent(result, signal);
|
|
161
|
+
await this.#authorize(callerId);
|
|
162
|
+
return publicRecord(record);
|
|
163
|
+
}
|
|
164
|
+
/** Alias for wait; authorization and cancellation semantics are identical. */
|
|
165
|
+
join(callerId, id2, signal) {
|
|
166
|
+
return this.wait(callerId, id2, signal);
|
|
167
|
+
}
|
|
168
|
+
async status(callerId, id2) {
|
|
169
|
+
await this.#authorize(callerId);
|
|
170
|
+
return publicRecord(this.#child(callerId, id2).record);
|
|
171
|
+
}
|
|
172
|
+
async list(callerId) {
|
|
173
|
+
await this.#authorize(callerId);
|
|
174
|
+
return [...this.#entries.values()].filter((entry) => entry.record.parentId === callerId).map((entry) => publicRecord(entry.record));
|
|
175
|
+
}
|
|
176
|
+
async stop(callerId, id2) {
|
|
177
|
+
await this.#authorize(callerId);
|
|
178
|
+
const result = await this.#stop(this.#child(callerId, id2));
|
|
179
|
+
await this.#authorize(callerId);
|
|
180
|
+
return publicRecord(result);
|
|
181
|
+
}
|
|
182
|
+
async steer(callerId, id2, message) {
|
|
183
|
+
if (!message.trim()) throw new Error("Steering message must not be empty");
|
|
184
|
+
const child = this.#ownedChild(callerId, id2);
|
|
185
|
+
if (child) {
|
|
186
|
+
if (!this.#options.port.steer) throw new Error("Hosted agents.steer is unsupported");
|
|
187
|
+
return this.#control(callerId, child.record.id, "steer", (request) => this.#options.port.steer({ ...request, message }));
|
|
188
|
+
}
|
|
189
|
+
return this.#deliver(callerId, id2, "steer", message);
|
|
190
|
+
}
|
|
191
|
+
async followUp(callerId, id2, message) {
|
|
192
|
+
if (!message.trim()) throw new Error("Follow-up message must not be empty");
|
|
193
|
+
const child = this.#ownedChild(callerId, id2);
|
|
194
|
+
if (child) {
|
|
195
|
+
if (!this.#options.port.followUp) throw new Error("Hosted agents.followUp is unsupported");
|
|
196
|
+
if (child.record.status === "running" && !child.stopping) {
|
|
197
|
+
return this.#control(callerId, child.record.id, "followUp", (request) => this.#options.port.followUp({ ...request, message }));
|
|
198
|
+
}
|
|
199
|
+
await this.#authorize(callerId);
|
|
200
|
+
await this.#options.port.followUp({ ...this.#identity(child), message });
|
|
201
|
+
await this.#authorize(callerId);
|
|
202
|
+
return publicRecord(child.record);
|
|
203
|
+
}
|
|
204
|
+
return this.#deliver(callerId, id2, "followUp", message);
|
|
205
|
+
}
|
|
206
|
+
async sessions(callerId) {
|
|
207
|
+
await this.#authorize(callerId);
|
|
208
|
+
return copy(await this.#topology().sessions());
|
|
209
|
+
}
|
|
210
|
+
async peers(callerId) {
|
|
211
|
+
await this.#authorize(callerId);
|
|
212
|
+
return copy(await this.#topology().peers(callerId));
|
|
213
|
+
}
|
|
214
|
+
async self(callerId) {
|
|
215
|
+
await this.#authorize(callerId);
|
|
216
|
+
if (this.#options.topology) return copy(await this.#options.topology.self(callerId));
|
|
217
|
+
const child = callerId === this.#options.rootId ? void 0 : this.#entries.get(callerId);
|
|
218
|
+
return {
|
|
219
|
+
id: callerId,
|
|
220
|
+
name: child?.record.name ?? "main",
|
|
221
|
+
kind: callerId === this.#options.rootId ? "root" : "agent",
|
|
222
|
+
status: child?.record.status ?? "running",
|
|
223
|
+
capabilities: callerId === this.#options.rootId ? ["steer", "followUp", "stop"] : ["steer", "followUp", "stop"]
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
async create(callerId, request, signal) {
|
|
227
|
+
if (!request.name.trim()) throw new Error("Peer name is required");
|
|
228
|
+
await this.#authorize(callerId);
|
|
229
|
+
const create = this.#topology().create;
|
|
230
|
+
if (!create) throw new Error("Hosted agents.create is unavailable");
|
|
231
|
+
const record = await create({ callerId, name: request.name.trim(), ...request.instructions ? { instructions: request.instructions } : {}, ...request.task ? { task: request.task } : {}, ...signal ? { signal } : {} });
|
|
232
|
+
await this.#authorize(callerId);
|
|
233
|
+
return copy(record);
|
|
234
|
+
}
|
|
235
|
+
async remove(callerId, id2, name, signal) {
|
|
236
|
+
if (!id2.trim()) throw new Error("Peer id is required");
|
|
237
|
+
await this.#authorize(callerId);
|
|
238
|
+
const remove = this.#topology().remove;
|
|
239
|
+
if (!remove) throw new Error("Hosted agents.remove is unavailable");
|
|
240
|
+
const record = await remove({ callerId, id: id2, ...name ? { name } : {}, ...signal ? { signal } : {} });
|
|
241
|
+
await this.#authorize(callerId);
|
|
242
|
+
return copy(record);
|
|
243
|
+
}
|
|
244
|
+
async members(callerId) {
|
|
245
|
+
await this.#authorize(callerId);
|
|
246
|
+
const sessions = this.#options.topology ? copy(await this.#options.topology.sessions()) : [];
|
|
247
|
+
const seen = new Set(sessions.map((item) => item.id));
|
|
248
|
+
const children = [];
|
|
249
|
+
for (const entry of this.#entries.values()) {
|
|
250
|
+
if (seen.has(entry.record.id)) continue;
|
|
251
|
+
children.push({
|
|
252
|
+
id: entry.record.id,
|
|
253
|
+
name: entry.record.name,
|
|
254
|
+
kind: "agent",
|
|
255
|
+
status: entry.record.status,
|
|
256
|
+
capabilities: ["steer", "followUp", "stop"]
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
return [...sessions, ...children];
|
|
260
|
+
}
|
|
261
|
+
async compact(callerId, id2, instructions) {
|
|
262
|
+
if (!this.#options.port.compact) throw new Error("Hosted agents.compact is unsupported");
|
|
263
|
+
return this.#control(callerId, id2, "compact", (request) => this.#options.port.compact({ ...request, ...instructions !== void 0 ? { instructions } : {} }));
|
|
264
|
+
}
|
|
265
|
+
async resume(callerId, id2, task, signal) {
|
|
266
|
+
if (!this.#options.port.resume) throw new Error("Hosted agents.resume is unsupported");
|
|
267
|
+
await this.#authorize(callerId);
|
|
268
|
+
const entry = this.#child(callerId, id2);
|
|
269
|
+
if (!["paused", "completed", "failed"].includes(entry.record.status) || !entry.lifecycle.settled || entry.resuming || entry.stopping) throw new Error("Only an idle paused, completed or failed agent can resume");
|
|
270
|
+
entry.resuming = true;
|
|
271
|
+
try {
|
|
272
|
+
const request = normalizeAgentServiceRequest({ ...entry.request, ...task !== void 0 ? { task } : {} });
|
|
273
|
+
await this.#start(callerId, request, entry, signal);
|
|
274
|
+
return await this.wait(callerId, id2, signal);
|
|
275
|
+
} finally {
|
|
276
|
+
entry.resuming = false;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
/** Natural root completion waits for all background descendants without fencing live parents. */
|
|
280
|
+
async drain() {
|
|
281
|
+
for (; ; ) {
|
|
282
|
+
const work = [...this.#pending.values()];
|
|
283
|
+
for (const entry of this.#entries.values()) {
|
|
284
|
+
if (entry.lifecycle.result && entry.done) work.push(entry.done);
|
|
285
|
+
}
|
|
286
|
+
if (work.length === 0) return;
|
|
287
|
+
await Promise.allSettled(work);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
/** Host-only graceful pause. The port, not the owner signal, quiesces participant effects. */
|
|
291
|
+
suspend() {
|
|
292
|
+
if (this.#suspend) return this.#suspend;
|
|
293
|
+
if (this.#closing.signal.aborted) return Promise.reject(new Error("Agent service is closed"));
|
|
294
|
+
if (!this.#options.port.pause && [...this.#entries.values()].some((entry) => !entry.lifecycle.settled)) {
|
|
295
|
+
return Promise.reject(new Error("Hosted agent suspension requires port.pause"));
|
|
296
|
+
}
|
|
297
|
+
this.#suspended = true;
|
|
298
|
+
for (const entry of this.#entries.values()) {
|
|
299
|
+
if (!entry.lifecycle.settled && !terminalAgentStatuses.has(entry.record.status)) entry.suspendRequested = true;
|
|
300
|
+
}
|
|
301
|
+
for (const controller of this.#pending.keys()) controller.abort();
|
|
302
|
+
this.#suspend = (async () => {
|
|
303
|
+
const roots = [...this.#entries.values()].filter((entry) => entry.record.parentId === this.#options.rootId);
|
|
304
|
+
const paused = await Promise.allSettled(roots.map((entry) => this.#pause(entry)));
|
|
305
|
+
await Promise.allSettled([...this.#pending.values()]);
|
|
306
|
+
const errors = paused.filter((result) => result.status === "rejected");
|
|
307
|
+
if (errors.length) throw new AggregateError(errors.map((result) => result.reason), "Agent suspension failed");
|
|
308
|
+
await this.drain();
|
|
309
|
+
})();
|
|
310
|
+
return this.#suspend;
|
|
311
|
+
}
|
|
312
|
+
async #pause(entry) {
|
|
313
|
+
const children = [...this.#entries.values()].filter((child) => child.record.parentId === entry.record.id);
|
|
314
|
+
const paused = await Promise.allSettled(children.map((child) => this.#pause(child)));
|
|
315
|
+
const errors = paused.filter((result) => result.status === "rejected").map((result) => result.reason);
|
|
316
|
+
if (errors.length) throw new AggregateError(errors, "Agent descendant suspension failed");
|
|
317
|
+
if (entry.executing && !entry.stopping) {
|
|
318
|
+
entry.pauseAck = Promise.resolve().then(async () => {
|
|
319
|
+
if (entry.executing && !entry.stopping) await this.#options.port.pause(this.#identity(entry));
|
|
320
|
+
});
|
|
321
|
+
try {
|
|
322
|
+
await entry.pauseAck;
|
|
323
|
+
} catch (error) {
|
|
324
|
+
throw new AggregateError([...errors, error], "Agent pause acknowledgment failed");
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
await entry.done;
|
|
328
|
+
}
|
|
329
|
+
close() {
|
|
330
|
+
if (this.#close) return this.#close;
|
|
331
|
+
this.#closing.abort();
|
|
332
|
+
for (const controller of this.#pending.keys()) controller.abort();
|
|
333
|
+
this.#close = (async () => {
|
|
334
|
+
const errors = [];
|
|
335
|
+
const stopped = await Promise.allSettled([...this.#entries.values()].map((entry) => this.#stop(entry, true)));
|
|
336
|
+
for (const result of stopped) if (result.status === "rejected") errors.push(result.reason);
|
|
337
|
+
await Promise.allSettled([...this.#pending.values()]);
|
|
338
|
+
if (errors.length) throw new AggregateError(errors, "Agent shutdown failed");
|
|
339
|
+
})();
|
|
340
|
+
return this.#close;
|
|
341
|
+
}
|
|
342
|
+
#start(callerId, request, previous, signal) {
|
|
343
|
+
const controller = new AbortController();
|
|
344
|
+
const abort = () => controller.abort();
|
|
345
|
+
signal?.addEventListener("abort", abort, { once: true });
|
|
346
|
+
if (signal?.aborted || this.#closing.signal.aborted || this.#suspended) controller.abort();
|
|
347
|
+
const operation = (async () => {
|
|
348
|
+
let release;
|
|
349
|
+
try {
|
|
350
|
+
await this.#authorize(callerId);
|
|
351
|
+
const depth = this.#depth(callerId);
|
|
352
|
+
if (controller.signal.aborted) throw new Error("Operation aborted");
|
|
353
|
+
if (depth > this.#admission.maxDepth) throw new Error(`Fabric agent depth limit reached (${this.#admission.maxDepth})`);
|
|
354
|
+
const id2 = previous?.record.id ?? crypto.randomUUID().replaceAll("-", "");
|
|
355
|
+
const generation = (previous?.record.generation ?? 0) + 1;
|
|
356
|
+
const prepare = { id: id2, generation, rootId: this.#options.rootId, parentId: callerId, depth, request: copy(request), signal: controller.signal };
|
|
357
|
+
const binding = await this.#options.port.prepare?.(prepare);
|
|
358
|
+
release = await this.#admission.acquire(callerId, controller.signal);
|
|
359
|
+
await this.#authorize(callerId);
|
|
360
|
+
this.#depth(callerId);
|
|
361
|
+
if (controller.signal.aborted || this.#closing.signal.aborted || previous?.stopping) throw new Error("Agent admission aborted");
|
|
362
|
+
this.#admission.admit(depth);
|
|
363
|
+
const now = Date.now();
|
|
364
|
+
const record = previous ? {
|
|
365
|
+
...previous.record,
|
|
366
|
+
task: request.task,
|
|
367
|
+
status: "queued",
|
|
368
|
+
generation: previous.record.generation + 1,
|
|
369
|
+
text: "",
|
|
370
|
+
turns: 0,
|
|
371
|
+
toolCalls: 0,
|
|
372
|
+
updatedAt: now
|
|
373
|
+
} : {
|
|
374
|
+
id: id2,
|
|
375
|
+
rootId: this.#options.rootId,
|
|
376
|
+
parentId: callerId,
|
|
377
|
+
depth,
|
|
378
|
+
generation: 1,
|
|
379
|
+
name: (request.name ?? request.task.split("\n", 1)[0] ?? "Fabric agent").replace(/[\r\n\t]+/g, " ").trim().slice(0, 60) || "Fabric agent",
|
|
380
|
+
task: request.task,
|
|
381
|
+
status: "queued",
|
|
382
|
+
runner: "pi",
|
|
383
|
+
kernel: "typescript",
|
|
384
|
+
startedAt: now,
|
|
385
|
+
updatedAt: now,
|
|
386
|
+
turns: 0,
|
|
387
|
+
toolCalls: 0,
|
|
388
|
+
text: "",
|
|
389
|
+
usage: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, cost: 0 },
|
|
390
|
+
...request.model ? { model: request.model } : {},
|
|
391
|
+
...request.thinking ? { thinking: request.thinking } : {},
|
|
392
|
+
...request.cwd !== void 0 ? { cwd: request.cwd } : {},
|
|
393
|
+
...request.recursive !== void 0 ? { recursive: request.recursive } : {}
|
|
394
|
+
};
|
|
395
|
+
delete record.finishedAt;
|
|
396
|
+
delete record.error;
|
|
397
|
+
delete record.value;
|
|
398
|
+
delete record.currentTool;
|
|
399
|
+
const entry = previous ?? { request, record, lifecycle: idle(), controller };
|
|
400
|
+
entry.request = copy(request);
|
|
401
|
+
entry.record = record;
|
|
402
|
+
entry.controller = controller;
|
|
403
|
+
entry.lifecycle = createAgentLifecycle(release);
|
|
404
|
+
release = void 0;
|
|
405
|
+
this.#entries.set(record.id, entry);
|
|
406
|
+
this.#pending.delete(controller);
|
|
407
|
+
signal?.removeEventListener("abort", abort);
|
|
408
|
+
let acknowledge;
|
|
409
|
+
const admitted = new Promise((resolve) => {
|
|
410
|
+
acknowledge = resolve;
|
|
411
|
+
});
|
|
412
|
+
entry.done = this.#drive(entry, binding, Boolean(previous), acknowledge);
|
|
413
|
+
await admitted;
|
|
414
|
+
await this.#authorize(callerId);
|
|
415
|
+
return publicRecord(record);
|
|
416
|
+
} finally {
|
|
417
|
+
release?.();
|
|
418
|
+
signal?.removeEventListener("abort", abort);
|
|
419
|
+
}
|
|
420
|
+
})();
|
|
421
|
+
this.#pending.set(controller, operation);
|
|
422
|
+
void operation.finally(() => this.#pending.delete(controller)).catch(() => {
|
|
423
|
+
});
|
|
424
|
+
return operation;
|
|
425
|
+
}
|
|
426
|
+
async #drive(entry, binding, resume, admitted) {
|
|
427
|
+
const generation = entry.record.generation;
|
|
428
|
+
let timer;
|
|
429
|
+
let timeout = false;
|
|
430
|
+
let responded = false;
|
|
431
|
+
try {
|
|
432
|
+
await this.#publish("admitted", entry);
|
|
433
|
+
admitted();
|
|
434
|
+
await this.#authorize(entry.record.parentId);
|
|
435
|
+
if (entry.controller.signal.aborted) throw new Error("Agent start aborted");
|
|
436
|
+
entry.record.status = "running";
|
|
437
|
+
await this.#publish("running", entry);
|
|
438
|
+
await this.#authorize(entry.record.parentId);
|
|
439
|
+
if (entry.controller.signal.aborted) throw new Error("Agent start aborted");
|
|
440
|
+
const request = {
|
|
441
|
+
...this.#identity(entry),
|
|
442
|
+
depth: entry.record.depth,
|
|
443
|
+
request: copy(entry.request),
|
|
444
|
+
signal: entry.controller.signal,
|
|
445
|
+
binding,
|
|
446
|
+
...entry.record.checkpoint !== void 0 ? { checkpoint: copy(entry.record.checkpoint) } : {},
|
|
447
|
+
emit: async (event) => {
|
|
448
|
+
const assertCurrent = () => {
|
|
449
|
+
if (!entry.executing || entry.lifecycle.settled || entry.controller.signal.aborted || entry.record.generation !== generation || entry.record.status !== "running") throw new Error("Stale agent execution event");
|
|
450
|
+
};
|
|
451
|
+
assertCurrent();
|
|
452
|
+
if (event.type !== "checkpoint" && event.type !== "progress") throw new Error("Unsupported agent execution event");
|
|
453
|
+
const saved = copy(event);
|
|
454
|
+
await this.#publish(saved.type, entry, void 0, () => {
|
|
455
|
+
if (saved.type === "checkpoint") entry.record.checkpoint = saved.checkpoint;
|
|
456
|
+
else {
|
|
457
|
+
for (const key of ["text", "turns", "toolCalls", "currentTool", "usage"]) {
|
|
458
|
+
if (saved[key] !== void 0) Object.assign(entry.record, { [key]: saved[key] });
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
}, assertCurrent);
|
|
462
|
+
}
|
|
463
|
+
};
|
|
464
|
+
if (entry.request.timeoutMs) timer = setTimeout(() => {
|
|
465
|
+
if (entry.suspendRequested) return;
|
|
466
|
+
timeout = true;
|
|
467
|
+
void this.#stop(entry).catch(() => {
|
|
468
|
+
});
|
|
469
|
+
}, entry.request.timeoutMs);
|
|
470
|
+
const execute = resume ? this.#options.port.resume : this.#options.port.execute;
|
|
471
|
+
entry.executing = true;
|
|
472
|
+
let response;
|
|
473
|
+
try {
|
|
474
|
+
response = await execute.call(this.#options.port, request);
|
|
475
|
+
} finally {
|
|
476
|
+
entry.executing = false;
|
|
477
|
+
}
|
|
478
|
+
if (!["completed", "failed", "stopped", "timed_out", "paused"].includes(response.status)) throw new Error("Invalid agent execution response status");
|
|
479
|
+
await this.#authorize(entry.record.parentId, response.status === "paused" ? { checkpoint: true } : void 0);
|
|
480
|
+
if (entry.record.generation !== generation || entry.lifecycle.settled) throw new Error("Stale agent execution response");
|
|
481
|
+
this.#applyResponse(entry, response);
|
|
482
|
+
responded = true;
|
|
483
|
+
} catch (error) {
|
|
484
|
+
entry.record.status = "failed";
|
|
485
|
+
entry.record.error = errorText(error);
|
|
486
|
+
} finally {
|
|
487
|
+
admitted();
|
|
488
|
+
if (timer) clearTimeout(timer);
|
|
489
|
+
await Promise.allSettled([...entry.controls ?? [], ...entry.stopAck ? [entry.stopAck] : [], ...entry.pauseAck ? [entry.pauseAck] : []]);
|
|
490
|
+
if (entry.suspendRequested && !entry.controller.signal.aborted) {
|
|
491
|
+
entry.record.status = "paused";
|
|
492
|
+
delete entry.record.error;
|
|
493
|
+
delete entry.record.finishedAt;
|
|
494
|
+
}
|
|
495
|
+
if (entry.controller.signal.aborted) {
|
|
496
|
+
if (entry.stopReason === "close") {
|
|
497
|
+
if (!responded || !["completed", "failed"].includes(entry.record.status)) {
|
|
498
|
+
entry.record.status = "paused";
|
|
499
|
+
delete entry.record.error;
|
|
500
|
+
}
|
|
501
|
+
} else entry.record.status = timeout ? "timed_out" : "stopped";
|
|
502
|
+
}
|
|
503
|
+
try {
|
|
504
|
+
await this.#options.port.cleanup?.(this.#identity(entry));
|
|
505
|
+
} catch (error) {
|
|
506
|
+
entry.record.status = "failed";
|
|
507
|
+
entry.record.error = `Agent cleanup failed: ${errorText(error)}`;
|
|
508
|
+
}
|
|
509
|
+
validateAgentResult(entry.record, entry.request.schema);
|
|
510
|
+
delete entry.record.currentTool;
|
|
511
|
+
if (terminalAgentStatuses.has(entry.record.status)) entry.record.finishedAt = Date.now();
|
|
512
|
+
if (beginAgentSettlement(entry.lifecycle)) {
|
|
513
|
+
try {
|
|
514
|
+
await this.#publish("settled", entry);
|
|
515
|
+
} catch (error) {
|
|
516
|
+
entry.record.status = "failed";
|
|
517
|
+
entry.record.error = `Agent publication failed: ${errorText(error)}`;
|
|
518
|
+
}
|
|
519
|
+
finishAgentSettlement(entry.lifecycle, copy(entry.record));
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
#applyResponse(entry, response) {
|
|
524
|
+
entry.record.status = response.status;
|
|
525
|
+
for (const key of ["text", "value", "error", "usage", "checkpoint", "sessionId"]) {
|
|
526
|
+
if (response[key] !== void 0) Object.assign(entry.record, { [key]: copy(response[key]) });
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
#stop(entry, preservePaused = false) {
|
|
530
|
+
if (entry.stopping) return entry.stopping;
|
|
531
|
+
entry.stopReason = preservePaused ? "close" : "stop";
|
|
532
|
+
const work = (async () => {
|
|
533
|
+
const active = !entry.lifecycle.settled;
|
|
534
|
+
entry.controller.abort();
|
|
535
|
+
const descendants = [...this.#entries.values()].filter((child) => child.record.parentId === entry.record.id);
|
|
536
|
+
const operations = descendants.map((child) => this.#stop(child, preservePaused));
|
|
537
|
+
if (active && this.#options.port.stop) {
|
|
538
|
+
entry.stopAck = Promise.resolve().then(() => this.#options.port.stop(this.#identity(entry)));
|
|
539
|
+
operations.push(entry.stopAck);
|
|
540
|
+
}
|
|
541
|
+
if (entry.done) operations.push(entry.done);
|
|
542
|
+
const settled = await Promise.allSettled(operations);
|
|
543
|
+
if (entry.record.status === "paused" && !preservePaused) {
|
|
544
|
+
entry.record.status = "stopped";
|
|
545
|
+
entry.record.finishedAt = Date.now();
|
|
546
|
+
await this.#publish("settled", entry);
|
|
547
|
+
}
|
|
548
|
+
const errors = settled.filter((result) => result.status === "rejected");
|
|
549
|
+
if (errors.length) throw new AggregateError(errors.map((result) => result.reason), "Agent stop failed");
|
|
550
|
+
return publicRecord(entry.record);
|
|
551
|
+
})();
|
|
552
|
+
entry.stopping = work;
|
|
553
|
+
return work;
|
|
554
|
+
}
|
|
555
|
+
async #control(callerId, id2, control, invoke) {
|
|
556
|
+
await this.#authorize(callerId);
|
|
557
|
+
const entry = this.#child(callerId, id2);
|
|
558
|
+
if (entry.record.status !== "running" || entry.stopping) throw new Error("Agent is not running");
|
|
559
|
+
const generation = entry.record.generation;
|
|
560
|
+
const pending = Promise.resolve().then(async () => {
|
|
561
|
+
await this.#authorize(callerId);
|
|
562
|
+
if (entry.record.generation !== generation || entry.controller.signal.aborted || entry.lifecycle.settled) throw new Error("Stale agent control");
|
|
563
|
+
await invoke(this.#identity(entry));
|
|
564
|
+
});
|
|
565
|
+
(entry.controls ??= /* @__PURE__ */ new Set()).add(pending);
|
|
566
|
+
try {
|
|
567
|
+
await pending;
|
|
568
|
+
} finally {
|
|
569
|
+
entry.controls.delete(pending);
|
|
570
|
+
}
|
|
571
|
+
await this.#authorize(callerId);
|
|
572
|
+
if (entry.record.generation !== generation || entry.controller.signal.aborted) throw new Error("Stale agent control acknowledgment");
|
|
573
|
+
await this.#publish("control", entry, control);
|
|
574
|
+
return publicRecord(entry.record);
|
|
575
|
+
}
|
|
576
|
+
#identity(entry) {
|
|
577
|
+
const { id: id2, rootId, parentId, generation } = entry.record;
|
|
578
|
+
return { id: id2, rootId, parentId, generation };
|
|
579
|
+
}
|
|
580
|
+
async #authorize(callerId, boundary) {
|
|
581
|
+
if (callerId !== this.#options.rootId && !this.#entries.has(callerId)) throw new Error("Unknown agent caller");
|
|
582
|
+
if (this.#suspended && !boundary?.checkpoint) throw new Error("Agent service is paused");
|
|
583
|
+
await this.#options.assertAuthority?.(callerId, boundary);
|
|
584
|
+
if (this.#suspended && !boundary?.checkpoint) throw new Error("Agent service is paused");
|
|
585
|
+
}
|
|
586
|
+
#child(callerId, id2) {
|
|
587
|
+
const entry = this.#ownedChild(callerId, id2);
|
|
588
|
+
if (!entry) throw new Error(`Unknown direct child agent: ${id2}`);
|
|
589
|
+
return entry;
|
|
590
|
+
}
|
|
591
|
+
#ownedChild(callerId, id2) {
|
|
592
|
+
const entry = this.#entries.get(id2);
|
|
593
|
+
return entry && entry.record.parentId === callerId ? entry : void 0;
|
|
594
|
+
}
|
|
595
|
+
#topology() {
|
|
596
|
+
if (!this.#options.topology) throw new Error("Hosted agent topology is unavailable");
|
|
597
|
+
return this.#options.topology;
|
|
598
|
+
}
|
|
599
|
+
async #deliver(callerId, id2, operation, message) {
|
|
600
|
+
const topology = this.#topology();
|
|
601
|
+
await this.#authorize(callerId);
|
|
602
|
+
const target = id2 === "main" ? this.#options.rootId : id2;
|
|
603
|
+
const record = await topology.deliver({ callerId, id: target, operation, message });
|
|
604
|
+
await this.#authorize(callerId);
|
|
605
|
+
return copy(record);
|
|
606
|
+
}
|
|
607
|
+
#depth(callerId) {
|
|
608
|
+
if (this.#closing.signal.aborted) throw new Error("Agent service is closed");
|
|
609
|
+
if (this.#suspended) throw new Error("Agent service is paused");
|
|
610
|
+
if (callerId === this.#options.rootId) return 1;
|
|
611
|
+
const parent = this.#entries.get(callerId);
|
|
612
|
+
if (!parent || parent.record.status !== "running" || parent.stopping || parent.controller.signal.aborted || parent.request.recursive === false) throw new Error("Agent parent cannot admit children");
|
|
613
|
+
return parent.record.depth + 1;
|
|
614
|
+
}
|
|
615
|
+
async #publish(type, entry, control, update, assertCurrent) {
|
|
616
|
+
const boundary = type === "checkpoint" || type === "settled" ? { checkpoint: true } : void 0;
|
|
617
|
+
const generation = entry.record.generation;
|
|
618
|
+
await this.#authorize(entry.record.parentId, boundary);
|
|
619
|
+
const publication = this.#publication.then(async () => {
|
|
620
|
+
await this.#authorize(entry.record.parentId, boundary);
|
|
621
|
+
if (entry.record.generation !== generation) throw new Error("Stale agent publication");
|
|
622
|
+
assertCurrent?.();
|
|
623
|
+
update?.();
|
|
624
|
+
entry.record.updatedAt = Date.now();
|
|
625
|
+
const event = { version: 1, sequence: ++this.#sequence, type, record: copy(entry.record), ...control ? { control } : {} };
|
|
626
|
+
await this.#options.onEvent?.(event);
|
|
627
|
+
});
|
|
628
|
+
this.#publication = publication.catch(() => {
|
|
629
|
+
});
|
|
630
|
+
await publication;
|
|
631
|
+
}
|
|
632
|
+
#restore(snapshot) {
|
|
633
|
+
const saved = copy(snapshot);
|
|
634
|
+
const newRoot = this.#options.restorePolicy === "new-root";
|
|
635
|
+
if (newRoot && saved.rootId !== this.#options.rootId) {
|
|
636
|
+
const oldRoot = saved.rootId;
|
|
637
|
+
saved.rootId = this.#options.rootId;
|
|
638
|
+
for (const { record } of saved.records) {
|
|
639
|
+
if (record.rootId !== oldRoot) throw new Error("Invalid agent snapshot root");
|
|
640
|
+
record.rootId = saved.rootId;
|
|
641
|
+
if (record.parentId === oldRoot) record.parentId = saved.rootId;
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
if (saved.version !== 1 || saved.rootId !== this.#options.rootId || !Number.isSafeInteger(saved.starts) || saved.starts < 0 || !newRoot && saved.starts > this.#admission.maxStarts || !Number.isSafeInteger(saved.sequence) || saved.sequence < 0 || !Array.isArray(saved.records)) throw new Error("Invalid agent service snapshot");
|
|
645
|
+
let generations = 0;
|
|
646
|
+
for (const item of saved.records) {
|
|
647
|
+
const request = normalizeAgentServiceRequest(item.request);
|
|
648
|
+
const record = item.record;
|
|
649
|
+
if (!record.id || record.id === saved.rootId || this.#entries.has(record.id) || record.rootId !== saved.rootId || !Number.isSafeInteger(record.depth) || record.depth < 1 || record.depth > this.#admission.maxDepth || !Number.isSafeInteger(record.generation) || record.generation < 1 || !["queued", "running", "paused", ...terminalAgentStatuses].includes(record.status)) throw new Error("Invalid agent snapshot record");
|
|
650
|
+
generations += record.generation;
|
|
651
|
+
if (record.status === "running" || record.status === "queued") {
|
|
652
|
+
record.status = "paused";
|
|
653
|
+
delete record.finishedAt;
|
|
654
|
+
}
|
|
655
|
+
this.#entries.set(record.id, { request, record, lifecycle: idle(), controller: new AbortController() });
|
|
656
|
+
}
|
|
657
|
+
for (const { record } of this.#entries.values()) {
|
|
658
|
+
const parent = this.#entries.get(record.parentId);
|
|
659
|
+
if (record.parentId === saved.rootId ? record.depth !== 1 : !parent || parent.record.depth + 1 !== record.depth) throw new Error("Invalid agent snapshot lineage");
|
|
660
|
+
}
|
|
661
|
+
if (saved.starts > generations) throw new Error("Invalid agent snapshot admission count");
|
|
662
|
+
this.#admission.starts = newRoot ? 0 : saved.starts;
|
|
663
|
+
this.#sequence = saved.sequence;
|
|
664
|
+
}
|
|
665
|
+
};
|
|
666
|
+
|
|
667
|
+
// src/agents/service-provider.ts
|
|
668
|
+
function createAgentServiceHandler(service, callerId) {
|
|
669
|
+
return async (action, input, signal) => {
|
|
670
|
+
const args = agentServiceArgs(action, input);
|
|
671
|
+
switch (action) {
|
|
672
|
+
case "run":
|
|
673
|
+
return service.run(callerId, args, signal);
|
|
674
|
+
case "spawn":
|
|
675
|
+
return service.spawn(callerId, args, signal);
|
|
676
|
+
case "join":
|
|
677
|
+
case "wait":
|
|
678
|
+
return service.wait(callerId, args.id, signal);
|
|
679
|
+
case "status":
|
|
680
|
+
return service.status(callerId, args.id);
|
|
681
|
+
case "list":
|
|
682
|
+
return service.list(callerId);
|
|
683
|
+
case "stop":
|
|
684
|
+
return service.stop(callerId, args.id);
|
|
685
|
+
case "steer":
|
|
686
|
+
return service.steer(callerId, args.id, args.message);
|
|
687
|
+
case "followUp":
|
|
688
|
+
return service.followUp(callerId, args.id, args.message);
|
|
689
|
+
case "compact":
|
|
690
|
+
return service.compact(callerId, args.id, args.instructions);
|
|
691
|
+
case "resume":
|
|
692
|
+
return service.resume(callerId, args.id, args.task, signal);
|
|
693
|
+
case "sessions":
|
|
694
|
+
return service.sessions(callerId);
|
|
695
|
+
case "peers":
|
|
696
|
+
return service.peers(callerId);
|
|
697
|
+
case "self":
|
|
698
|
+
return service.self(callerId);
|
|
699
|
+
case "members":
|
|
700
|
+
return service.members(callerId);
|
|
701
|
+
case "create":
|
|
702
|
+
return service.create(callerId, args, signal);
|
|
703
|
+
case "remove":
|
|
704
|
+
return service.remove(callerId, args.id, args.name, signal);
|
|
705
|
+
default:
|
|
706
|
+
throw new Error(`Unsupported hosted agents action: ${String(action)}`);
|
|
707
|
+
}
|
|
708
|
+
};
|
|
709
|
+
}
|
|
710
|
+
function createAgentServiceClient(dispatch, capabilities = {}) {
|
|
711
|
+
const record = (action, args, signal) => dispatch(action, args, signal);
|
|
712
|
+
return {
|
|
713
|
+
capabilities: Object.freeze({ ...capabilities }),
|
|
714
|
+
dispatch,
|
|
715
|
+
run: (request, signal) => record("run", request, signal),
|
|
716
|
+
spawn: (request, signal) => record("spawn", request, signal),
|
|
717
|
+
wait: (id2, signal) => record("wait", { id: id2 }, signal),
|
|
718
|
+
join: (id2, signal) => record("wait", { id: id2 }, signal),
|
|
719
|
+
status: (id2) => record("status", { id: id2 }),
|
|
720
|
+
list: () => dispatch("list", {}),
|
|
721
|
+
stop: (id2) => record("stop", { id: id2 }),
|
|
722
|
+
steer: (id2, message) => record("steer", { id: id2, message }),
|
|
723
|
+
compact: (id2, instructions) => record("compact", { id: id2, ...instructions !== void 0 ? { instructions } : {} }),
|
|
724
|
+
resume: (id2, task, signal) => record("resume", { id: id2, ...task !== void 0 ? { task } : {} }, signal),
|
|
725
|
+
followUp: (id2, message) => record("followUp", { id: id2, message }),
|
|
726
|
+
sessions: () => dispatch("sessions", {}),
|
|
727
|
+
peers: () => dispatch("peers", {}),
|
|
728
|
+
self: () => dispatch("self", {}),
|
|
729
|
+
members: () => dispatch("members", {}),
|
|
730
|
+
create: (request, signal) => dispatch("create", request, signal),
|
|
731
|
+
remove: (id2, name, signal) => dispatch("remove", { id: id2, ...name !== void 0 ? { name } : {} }, signal)
|
|
732
|
+
};
|
|
733
|
+
}
|
|
734
|
+
function createAgentsProvider(client) {
|
|
735
|
+
const descriptors2 = agentServiceDescriptors(client.capabilities);
|
|
736
|
+
const allowed = new Set(descriptors2.map((descriptor) => descriptor.name));
|
|
737
|
+
const validate = (action, args) => {
|
|
738
|
+
if (!allowed.has(action)) throw new Error(`Unsupported hosted agents action: ${action}`);
|
|
739
|
+
return agentServiceArgs(action, args);
|
|
740
|
+
};
|
|
741
|
+
return {
|
|
742
|
+
name: "agents",
|
|
743
|
+
description: "Fabric host-authorized Pi agents",
|
|
744
|
+
list: async () => structuredClone(descriptors2),
|
|
745
|
+
describe: async (name) => structuredClone(descriptors2.find((descriptor) => descriptor.name === name)),
|
|
746
|
+
prepareArguments: (action, args) => validate(action, args),
|
|
747
|
+
invoke: async (action, args, context) => client.dispatch(action, validate(action, args), context.signal)
|
|
748
|
+
};
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
// src/agents.ts
|
|
752
|
+
var HOSTED_AGENTS_PROTOCOL_VERSION = 1;
|
|
753
|
+
export {
|
|
754
|
+
AgentService,
|
|
755
|
+
HOSTED_AGENTS_PROTOCOL_VERSION,
|
|
756
|
+
agentServiceDescriptors,
|
|
757
|
+
createAgentServiceClient,
|
|
758
|
+
createAgentServiceHandler,
|
|
759
|
+
createAgentsProvider
|
|
760
|
+
};
|
|
761
|
+
//# sourceMappingURL=agents.js.map
|