@e4779/pi-fabric 0.92.17-fork.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +181 -0
- package/THIRD_PARTY_NOTICES.md +33 -0
- package/dist/activity/store.d.ts +33 -0
- package/dist/activity/store.d.ts.map +1 -0
- package/dist/activity/types.d.ts +104 -0
- package/dist/activity/types.d.ts.map +1 -0
- package/dist/actors/binding-store.d.ts +17 -0
- package/dist/actors/binding-store.d.ts.map +1 -0
- package/dist/actors/context.d.ts +13 -0
- package/dist/actors/context.d.ts.map +1 -0
- package/dist/actors/delivery-policy.d.ts +8 -0
- package/dist/actors/delivery-policy.d.ts.map +1 -0
- package/dist/actors/directory.d.ts +47 -0
- package/dist/actors/directory.d.ts.map +1 -0
- package/dist/actors/global-registry.d.ts +47 -0
- package/dist/actors/global-registry.d.ts.map +1 -0
- package/dist/actors/host-event-observer.d.ts +5 -0
- package/dist/actors/host-event-observer.d.ts.map +1 -0
- package/dist/actors/host-event-payload.d.ts +14 -0
- package/dist/actors/host-event-payload.d.ts.map +1 -0
- package/dist/actors/log-store.d.ts +22 -0
- package/dist/actors/log-store.d.ts.map +1 -0
- package/dist/actors/manager.d.ts +175 -0
- package/dist/actors/manager.d.ts.map +1 -0
- package/dist/actors/mesh-monitor.d.ts +22 -0
- package/dist/actors/mesh-monitor.d.ts.map +1 -0
- package/dist/actors/predicate.d.ts +7 -0
- package/dist/actors/predicate.d.ts.map +1 -0
- package/dist/actors/registry-store.d.ts +15 -0
- package/dist/actors/registry-store.d.ts.map +1 -0
- package/dist/actors/types.d.ts +218 -0
- package/dist/actors/types.d.ts.map +1 -0
- package/dist/agents/bash-worktree-add.d.ts +24 -0
- package/dist/agents/bash-worktree-add.d.ts.map +1 -0
- package/dist/agents/budget-ledger.d.ts +88 -0
- package/dist/agents/budget-ledger.d.ts.map +1 -0
- package/dist/agents/claude-cli.d.ts +32 -0
- package/dist/agents/claude-cli.d.ts.map +1 -0
- package/dist/agents/claude-cli.js +17 -0
- package/dist/agents/claude-cli.js.map +7 -0
- package/dist/agents/clone-first-worktree.d.ts +17 -0
- package/dist/agents/clone-first-worktree.d.ts.map +1 -0
- package/dist/agents/compact-control.d.ts +32 -0
- package/dist/agents/compact-control.d.ts.map +1 -0
- package/dist/agents/compact-control.js +129 -0
- package/dist/agents/compact-control.js.map +7 -0
- package/dist/agents/constants.d.ts +9 -0
- package/dist/agents/constants.d.ts.map +1 -0
- package/dist/agents/cow-clone.d.ts +8 -0
- package/dist/agents/cow-clone.d.ts.map +1 -0
- package/dist/agents/handoff-completion.d.ts +4 -0
- package/dist/agents/handoff-completion.d.ts.map +1 -0
- package/dist/agents/handoff.d.ts +19 -0
- package/dist/agents/handoff.d.ts.map +1 -0
- package/dist/agents/lifecycle.d.ts +32 -0
- package/dist/agents/lifecycle.d.ts.map +1 -0
- package/dist/agents/manager.d.ts +75 -0
- package/dist/agents/manager.d.ts.map +1 -0
- package/dist/agents/pi-binary.d.ts +7 -0
- package/dist/agents/pi-binary.d.ts.map +1 -0
- package/dist/agents/request.d.ts +13 -0
- package/dist/agents/request.d.ts.map +1 -0
- package/dist/agents/result.d.ts +8 -0
- package/dist/agents/result.d.ts.map +1 -0
- package/dist/agents/result.js +9 -0
- package/dist/agents/result.js.map +7 -0
- package/dist/agents/rm.d.ts +15 -0
- package/dist/agents/rm.d.ts.map +1 -0
- package/dist/agents/semaphore.d.ts +7 -0
- package/dist/agents/semaphore.d.ts.map +1 -0
- package/dist/agents/service-provider.d.ts +9 -0
- package/dist/agents/service-provider.d.ts.map +1 -0
- package/dist/agents/service-schema.d.ts +6 -0
- package/dist/agents/service-schema.d.ts.map +1 -0
- package/dist/agents/service-types.d.ts +192 -0
- package/dist/agents/service-types.d.ts.map +1 -0
- package/dist/agents/service.d.ts +36 -0
- package/dist/agents/service.d.ts.map +1 -0
- package/dist/agents/session-export.d.ts +39 -0
- package/dist/agents/session-export.d.ts.map +1 -0
- package/dist/agents/session-pins.d.ts +24 -0
- package/dist/agents/session-pins.d.ts.map +1 -0
- package/dist/agents/thinking-transfer.d.ts +39 -0
- package/dist/agents/thinking-transfer.d.ts.map +1 -0
- package/dist/agents/transports/herdr-transport.d.ts +10 -0
- package/dist/agents/transports/herdr-transport.d.ts.map +1 -0
- package/dist/agents/transports/localterm-transport.d.ts +7 -0
- package/dist/agents/transports/localterm-transport.d.ts.map +1 -0
- package/dist/agents/transports/process-transport.d.ts +7 -0
- package/dist/agents/transports/process-transport.d.ts.map +1 -0
- package/dist/agents/transports/process-utils.d.ts +33 -0
- package/dist/agents/transports/process-utils.d.ts.map +1 -0
- package/dist/agents/transports/screen-transport.d.ts +7 -0
- package/dist/agents/transports/screen-transport.d.ts.map +1 -0
- package/dist/agents/transports/tmux-transport.d.ts +7 -0
- package/dist/agents/transports/tmux-transport.d.ts.map +1 -0
- package/dist/agents/types.d.ts +280 -0
- package/dist/agents/types.d.ts.map +1 -0
- package/dist/agents/veda-cli.d.ts +22 -0
- package/dist/agents/veda-cli.d.ts.map +1 -0
- package/dist/agents/veda-cli.js +13 -0
- package/dist/agents/veda-cli.js.map +7 -0
- package/dist/agents/worktree-manager.d.ts +14 -0
- package/dist/agents/worktree-manager.d.ts.map +1 -0
- package/dist/agents/worktree-paths.d.ts +5 -0
- package/dist/agents/worktree-paths.d.ts.map +1 -0
- package/dist/agents.d.ts +8 -0
- package/dist/agents.d.ts.map +1 -0
- package/dist/agents.js +761 -0
- package/dist/agents.js.map +7 -0
- package/dist/async-settlement.d.ts +4 -0
- package/dist/async-settlement.d.ts.map +1 -0
- package/dist/audit/details.d.ts +86 -0
- package/dist/audit/details.d.ts.map +1 -0
- package/dist/audit/index.d.ts +4 -0
- package/dist/audit/index.d.ts.map +1 -0
- package/dist/audit/projection.d.ts +20 -0
- package/dist/audit/projection.d.ts.map +1 -0
- package/dist/audit/trace.d.ts +99 -0
- package/dist/audit/trace.d.ts.map +1 -0
- package/dist/capture/catalog.d.ts +30 -0
- package/dist/capture/catalog.d.ts.map +1 -0
- package/dist/capture/interceptor.d.ts +20 -0
- package/dist/capture/interceptor.d.ts.map +1 -0
- package/dist/capture/wrapper.d.ts +15 -0
- package/dist/capture/wrapper.d.ts.map +1 -0
- package/dist/chunks/chunk-2DMJ7MEI.js +1984 -0
- package/dist/chunks/chunk-2DMJ7MEI.js.map +7 -0
- package/dist/chunks/chunk-2PZWDVJB.js +738 -0
- package/dist/chunks/chunk-2PZWDVJB.js.map +7 -0
- package/dist/chunks/chunk-2UQV52II.js +440 -0
- package/dist/chunks/chunk-2UQV52II.js.map +7 -0
- package/dist/chunks/chunk-32BNQ75J.js +1445 -0
- package/dist/chunks/chunk-32BNQ75J.js.map +7 -0
- package/dist/chunks/chunk-3H7SDWZI.js +467 -0
- package/dist/chunks/chunk-3H7SDWZI.js.map +7 -0
- package/dist/chunks/chunk-3MEHEH6B.js +41 -0
- package/dist/chunks/chunk-3MEHEH6B.js.map +7 -0
- package/dist/chunks/chunk-3QECYQGA.js +70 -0
- package/dist/chunks/chunk-3QECYQGA.js.map +7 -0
- package/dist/chunks/chunk-3WIGAX56.js +644 -0
- package/dist/chunks/chunk-3WIGAX56.js.map +7 -0
- package/dist/chunks/chunk-3YZUQESG.js +16 -0
- package/dist/chunks/chunk-3YZUQESG.js.map +7 -0
- package/dist/chunks/chunk-4JETKRFE.js +287 -0
- package/dist/chunks/chunk-4JETKRFE.js.map +7 -0
- package/dist/chunks/chunk-4SSMGBF4.js +93 -0
- package/dist/chunks/chunk-4SSMGBF4.js.map +7 -0
- package/dist/chunks/chunk-5SU3YXBS.js +15 -0
- package/dist/chunks/chunk-5SU3YXBS.js.map +7 -0
- package/dist/chunks/chunk-656HWVFU.js +409 -0
- package/dist/chunks/chunk-656HWVFU.js.map +7 -0
- package/dist/chunks/chunk-7A6NVHB5.js +1242 -0
- package/dist/chunks/chunk-7A6NVHB5.js.map +7 -0
- package/dist/chunks/chunk-7TB7NXSL.js +58 -0
- package/dist/chunks/chunk-7TB7NXSL.js.map +7 -0
- package/dist/chunks/chunk-AAHHYDTO.js +24 -0
- package/dist/chunks/chunk-AAHHYDTO.js.map +7 -0
- package/dist/chunks/chunk-ARLYAW2A.js +95 -0
- package/dist/chunks/chunk-ARLYAW2A.js.map +7 -0
- package/dist/chunks/chunk-AYBIR4YV.js +210 -0
- package/dist/chunks/chunk-AYBIR4YV.js.map +7 -0
- package/dist/chunks/chunk-BOTRGFQQ.js +87 -0
- package/dist/chunks/chunk-BOTRGFQQ.js.map +7 -0
- package/dist/chunks/chunk-CGPK5WHX.js +96 -0
- package/dist/chunks/chunk-CGPK5WHX.js.map +7 -0
- package/dist/chunks/chunk-CI56CW53.js +470 -0
- package/dist/chunks/chunk-CI56CW53.js.map +7 -0
- package/dist/chunks/chunk-CPSW2GW4.js +1466 -0
- package/dist/chunks/chunk-CPSW2GW4.js.map +7 -0
- package/dist/chunks/chunk-CQFP2RCP.js +64 -0
- package/dist/chunks/chunk-CQFP2RCP.js.map +7 -0
- package/dist/chunks/chunk-D5WKZONW.js +797 -0
- package/dist/chunks/chunk-D5WKZONW.js.map +7 -0
- package/dist/chunks/chunk-DLXPTBPL.js +151 -0
- package/dist/chunks/chunk-DLXPTBPL.js.map +7 -0
- package/dist/chunks/chunk-G4LADAYY.js +287 -0
- package/dist/chunks/chunk-G4LADAYY.js.map +7 -0
- package/dist/chunks/chunk-GXNR6NRU.js +447 -0
- package/dist/chunks/chunk-GXNR6NRU.js.map +7 -0
- package/dist/chunks/chunk-IGVDD2HT.js +10 -0
- package/dist/chunks/chunk-IGVDD2HT.js.map +7 -0
- package/dist/chunks/chunk-J2HV2URQ.js +1125 -0
- package/dist/chunks/chunk-J2HV2URQ.js.map +7 -0
- package/dist/chunks/chunk-KAD7UWT2.js +99 -0
- package/dist/chunks/chunk-KAD7UWT2.js.map +7 -0
- package/dist/chunks/chunk-KYXZJNV6.js +227 -0
- package/dist/chunks/chunk-KYXZJNV6.js.map +7 -0
- package/dist/chunks/chunk-LMAVZN7J.js +8 -0
- package/dist/chunks/chunk-LMAVZN7J.js.map +7 -0
- package/dist/chunks/chunk-M3S7XITB.js +110 -0
- package/dist/chunks/chunk-M3S7XITB.js.map +7 -0
- package/dist/chunks/chunk-MGDLRV2R.js +112 -0
- package/dist/chunks/chunk-MGDLRV2R.js.map +7 -0
- package/dist/chunks/chunk-MGWQOKBV.js +30 -0
- package/dist/chunks/chunk-MGWQOKBV.js.map +7 -0
- package/dist/chunks/chunk-N5GUXC6F.js +184 -0
- package/dist/chunks/chunk-N5GUXC6F.js.map +7 -0
- package/dist/chunks/chunk-NQOEHX62.js +215 -0
- package/dist/chunks/chunk-NQOEHX62.js.map +7 -0
- package/dist/chunks/chunk-OKOHRXGF.js +100 -0
- package/dist/chunks/chunk-OKOHRXGF.js.map +7 -0
- package/dist/chunks/chunk-OP2KTYQB.js +286 -0
- package/dist/chunks/chunk-OP2KTYQB.js.map +7 -0
- package/dist/chunks/chunk-OTCASLY2.js +52 -0
- package/dist/chunks/chunk-OTCASLY2.js.map +7 -0
- package/dist/chunks/chunk-PAN6C3JM.js +42 -0
- package/dist/chunks/chunk-PAN6C3JM.js.map +7 -0
- package/dist/chunks/chunk-PH7ZJ27F.js +6873 -0
- package/dist/chunks/chunk-PH7ZJ27F.js.map +7 -0
- package/dist/chunks/chunk-PM5I335G.js +225 -0
- package/dist/chunks/chunk-PM5I335G.js.map +7 -0
- package/dist/chunks/chunk-PSNXUZMY.js +218 -0
- package/dist/chunks/chunk-PSNXUZMY.js.map +7 -0
- package/dist/chunks/chunk-PXAICAUT.js +24 -0
- package/dist/chunks/chunk-PXAICAUT.js.map +7 -0
- package/dist/chunks/chunk-RERA6YWA.js +359 -0
- package/dist/chunks/chunk-RERA6YWA.js.map +7 -0
- package/dist/chunks/chunk-RNOPHITP.js +1720 -0
- package/dist/chunks/chunk-RNOPHITP.js.map +7 -0
- package/dist/chunks/chunk-RRGTKHXZ.js +931 -0
- package/dist/chunks/chunk-RRGTKHXZ.js.map +7 -0
- package/dist/chunks/chunk-SWB2OHYW.js +93 -0
- package/dist/chunks/chunk-SWB2OHYW.js.map +7 -0
- package/dist/chunks/chunk-T3A5GNCW.js +19 -0
- package/dist/chunks/chunk-T3A5GNCW.js.map +7 -0
- package/dist/chunks/chunk-TPLMVELH.js +118 -0
- package/dist/chunks/chunk-TPLMVELH.js.map +7 -0
- package/dist/chunks/chunk-TSRKCXNI.js +17 -0
- package/dist/chunks/chunk-TSRKCXNI.js.map +7 -0
- package/dist/chunks/chunk-U5FYOMG5.js +119 -0
- package/dist/chunks/chunk-U5FYOMG5.js.map +7 -0
- package/dist/chunks/chunk-U6CTHPZC.js +1924 -0
- package/dist/chunks/chunk-U6CTHPZC.js.map +7 -0
- package/dist/chunks/chunk-UDFDF7IY.js +1572 -0
- package/dist/chunks/chunk-UDFDF7IY.js.map +7 -0
- package/dist/chunks/chunk-UKMQK5VP.js +231 -0
- package/dist/chunks/chunk-UKMQK5VP.js.map +7 -0
- package/dist/chunks/chunk-UQ4LTUH4.js +2181 -0
- package/dist/chunks/chunk-UQ4LTUH4.js.map +7 -0
- package/dist/chunks/chunk-UTR3I23Z.js +65 -0
- package/dist/chunks/chunk-UTR3I23Z.js.map +7 -0
- package/dist/chunks/chunk-VPPIJRNZ.js +50 -0
- package/dist/chunks/chunk-VPPIJRNZ.js.map +7 -0
- package/dist/chunks/chunk-VRYEGVHR.js +195 -0
- package/dist/chunks/chunk-VRYEGVHR.js.map +7 -0
- package/dist/chunks/chunk-VRZNFNPB.js +4218 -0
- package/dist/chunks/chunk-VRZNFNPB.js.map +7 -0
- package/dist/chunks/chunk-VXZZJ44D.js +295 -0
- package/dist/chunks/chunk-VXZZJ44D.js.map +7 -0
- package/dist/chunks/chunk-W3FRE4VI.js +297 -0
- package/dist/chunks/chunk-W3FRE4VI.js.map +7 -0
- package/dist/chunks/chunk-WVH324VF.js +60 -0
- package/dist/chunks/chunk-WVH324VF.js.map +7 -0
- package/dist/chunks/chunk-X7G62ZGH.js +151 -0
- package/dist/chunks/chunk-X7G62ZGH.js.map +7 -0
- package/dist/chunks/chunk-XB3RJVT4.js +17 -0
- package/dist/chunks/chunk-XB3RJVT4.js.map +7 -0
- package/dist/chunks/chunk-XT4346N7.js +651 -0
- package/dist/chunks/chunk-XT4346N7.js.map +7 -0
- package/dist/chunks/chunk-Y7KNRAFL.js +1180 -0
- package/dist/chunks/chunk-Y7KNRAFL.js.map +7 -0
- package/dist/chunks/chunk-YK5AZ7CZ.js +692 -0
- package/dist/chunks/chunk-YK5AZ7CZ.js.map +7 -0
- package/dist/chunks/chunk-YU4O6SWQ.js +246 -0
- package/dist/chunks/chunk-YU4O6SWQ.js.map +7 -0
- package/dist/chunks/chunk-YU62DDKK.js +22 -0
- package/dist/chunks/chunk-YU62DDKK.js.map +7 -0
- package/dist/chunks/chunk-Z63R5GVN.js +121 -0
- package/dist/chunks/chunk-Z63R5GVN.js.map +7 -0
- package/dist/chunks/chunk-ZDNGXLEC.js +221 -0
- package/dist/chunks/chunk-ZDNGXLEC.js.map +7 -0
- package/dist/chunks/chunk-ZZ4LHQYJ.js +777 -0
- package/dist/chunks/chunk-ZZ4LHQYJ.js.map +7 -0
- package/dist/commands/fabric.d.ts +17 -0
- package/dist/commands/fabric.d.ts.map +1 -0
- package/dist/compaction/bounds.d.ts +23 -0
- package/dist/compaction/bounds.d.ts.map +1 -0
- package/dist/compaction/branch-details.d.ts +83 -0
- package/dist/compaction/branch-details.d.ts.map +1 -0
- package/dist/compaction/branch-summary.d.ts +9 -0
- package/dist/compaction/branch-summary.d.ts.map +1 -0
- package/dist/compaction/enrichers.d.ts +10 -0
- package/dist/compaction/enrichers.d.ts.map +1 -0
- package/dist/compaction/hook.d.ts +99 -0
- package/dist/compaction/hook.d.ts.map +1 -0
- package/dist/compaction/hook.js +22 -0
- package/dist/compaction/hook.js.map +7 -0
- package/dist/compaction/instructions.d.ts +38 -0
- package/dist/compaction/instructions.d.ts.map +1 -0
- package/dist/compaction/normalize.d.ts +83 -0
- package/dist/compaction/normalize.d.ts.map +1 -0
- package/dist/compaction/projections.d.ts +31 -0
- package/dist/compaction/projections.d.ts.map +1 -0
- package/dist/compaction/qa.d.ts +27 -0
- package/dist/compaction/qa.d.ts.map +1 -0
- package/dist/compaction/render.d.ts +10 -0
- package/dist/compaction/render.d.ts.map +1 -0
- package/dist/compaction/threshold.d.ts +5 -0
- package/dist/compaction/threshold.d.ts.map +1 -0
- package/dist/compaction/trace-events.d.ts +23 -0
- package/dist/compaction/trace-events.d.ts.map +1 -0
- package/dist/components/catalog.d.ts +25 -0
- package/dist/components/catalog.d.ts.map +1 -0
- package/dist/components/effect-policy.d.ts +21 -0
- package/dist/components/effect-policy.d.ts.map +1 -0
- package/dist/components/effect-scope.d.ts +31 -0
- package/dist/components/effect-scope.d.ts.map +1 -0
- package/dist/components/loader.d.ts +27 -0
- package/dist/components/loader.d.ts.map +1 -0
- package/dist/components/model-guidance.d.ts +48 -0
- package/dist/components/model-guidance.d.ts.map +1 -0
- package/dist/components/provider-component.d.ts +31 -0
- package/dist/components/provider-component.d.ts.map +1 -0
- package/dist/components/supervisor.d.ts +29 -0
- package/dist/components/supervisor.d.ts.map +1 -0
- package/dist/components/types.d.ts +140 -0
- package/dist/components/types.d.ts.map +1 -0
- package/dist/config-migrations.d.ts +11 -0
- package/dist/config-migrations.d.ts.map +1 -0
- package/dist/config.d.ts +282 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/core/action-arguments.d.ts +12 -0
- package/dist/core/action-arguments.d.ts.map +1 -0
- package/dist/core/action-registry.d.ts +170 -0
- package/dist/core/action-registry.d.ts.map +1 -0
- package/dist/core/action-registry.js +20 -0
- package/dist/core/action-registry.js.map +7 -0
- package/dist/core/action-repair.d.ts +15 -0
- package/dist/core/action-repair.d.ts.map +1 -0
- package/dist/core/action-result.d.ts +13 -0
- package/dist/core/action-result.d.ts.map +1 -0
- package/dist/core/agent-dir.d.ts +2 -0
- package/dist/core/agent-dir.d.ts.map +1 -0
- package/dist/core/approval-controller.d.ts +31 -0
- package/dist/core/approval-controller.d.ts.map +1 -0
- package/dist/core/atomic-write.d.ts +15 -0
- package/dist/core/atomic-write.d.ts.map +1 -0
- package/dist/core/auto-approval-classifier.d.ts +17 -0
- package/dist/core/auto-approval-classifier.d.ts.map +1 -0
- package/dist/core/call-preview.d.ts +8 -0
- package/dist/core/call-preview.d.ts.map +1 -0
- package/dist/core/child-tool-allowlist.d.ts +3 -0
- package/dist/core/child-tool-allowlist.d.ts.map +1 -0
- package/dist/core/compact-controller.d.ts +42 -0
- package/dist/core/compact-controller.d.ts.map +1 -0
- package/dist/core/core-override-guidance.d.ts +7 -0
- package/dist/core/core-override-guidance.d.ts.map +1 -0
- package/dist/core/damaged-file.d.ts +6 -0
- package/dist/core/damaged-file.d.ts.map +1 -0
- package/dist/core/direct-tool-approval.d.ts +19 -0
- package/dist/core/direct-tool-approval.d.ts.map +1 -0
- package/dist/core/effect-conflict.d.ts +3 -0
- package/dist/core/effect-conflict.d.ts.map +1 -0
- package/dist/core/file-lock.d.ts +12 -0
- package/dist/core/file-lock.d.ts.map +1 -0
- package/dist/core/kernel-skills.d.ts +3 -0
- package/dist/core/kernel-skills.d.ts.map +1 -0
- package/dist/core/model-resolution.d.ts +62 -0
- package/dist/core/model-resolution.d.ts.map +1 -0
- package/dist/core/model-usage.d.ts +8 -0
- package/dist/core/model-usage.d.ts.map +1 -0
- package/dist/core/pi-arguments.d.ts +3 -0
- package/dist/core/pi-arguments.d.ts.map +1 -0
- package/dist/core/pi-bash-error.d.ts +9 -0
- package/dist/core/pi-bash-error.d.ts.map +1 -0
- package/dist/core/pi-tools.d.ts +9 -0
- package/dist/core/pi-tools.d.ts.map +1 -0
- package/dist/core/provider-bindings.d.ts +47 -0
- package/dist/core/provider-bindings.d.ts.map +1 -0
- package/dist/core/proxy-contract.d.ts +18 -0
- package/dist/core/proxy-contract.d.ts.map +1 -0
- package/dist/core/session-context.d.ts +14 -0
- package/dist/core/session-context.d.ts.map +1 -0
- package/dist/core/shell-jobs.d.ts +99 -0
- package/dist/core/shell-jobs.d.ts.map +1 -0
- package/dist/core/skill-block.d.ts +10 -0
- package/dist/core/skill-block.d.ts.map +1 -0
- package/dist/core/skill-dir.d.ts +4 -0
- package/dist/core/skill-dir.d.ts.map +1 -0
- package/dist/core/skill-prompt.d.ts +3 -0
- package/dist/core/skill-prompt.d.ts.map +1 -0
- package/dist/core/skill-references.d.ts +7 -0
- package/dist/core/skill-references.d.ts.map +1 -0
- package/dist/core/stable-hash.d.ts +3 -0
- package/dist/core/stable-hash.d.ts.map +1 -0
- package/dist/core/system-guidance.d.ts +13 -0
- package/dist/core/system-guidance.d.ts.map +1 -0
- package/dist/core/token-math.d.ts +16 -0
- package/dist/core/token-math.d.ts.map +1 -0
- package/dist/core/tool-ownership.d.ts +47 -0
- package/dist/core/tool-ownership.d.ts.map +1 -0
- package/dist/core/tool-result-proxy.d.ts +18 -0
- package/dist/core/tool-result-proxy.d.ts.map +1 -0
- package/dist/entropy/active.d.ts +9 -0
- package/dist/entropy/active.d.ts.map +1 -0
- package/dist/entropy/compiled-store.d.ts +16 -0
- package/dist/entropy/compiled-store.d.ts.map +1 -0
- package/dist/entropy/compiled-surface.d.ts +57 -0
- package/dist/entropy/compiled-surface.d.ts.map +1 -0
- package/dist/entropy/compiler.d.ts +27 -0
- package/dist/entropy/compiler.d.ts.map +1 -0
- package/dist/entropy/corpus.d.ts +22 -0
- package/dist/entropy/corpus.d.ts.map +1 -0
- package/dist/entropy/fingerprint.d.ts +9 -0
- package/dist/entropy/fingerprint.d.ts.map +1 -0
- package/dist/entropy/index.d.ts +16 -0
- package/dist/entropy/index.d.ts.map +1 -0
- package/dist/entropy/index.js +194 -0
- package/dist/entropy/index.js.map +7 -0
- package/dist/entropy/meter.d.ts +10 -0
- package/dist/entropy/meter.d.ts.map +1 -0
- package/dist/entropy/normal-form.d.ts +40 -0
- package/dist/entropy/normal-form.d.ts.map +1 -0
- package/dist/entropy/passes.d.ts +13 -0
- package/dist/entropy/passes.d.ts.map +1 -0
- package/dist/entropy/pool-store.d.ts +15 -0
- package/dist/entropy/pool-store.d.ts.map +1 -0
- package/dist/entropy/pool.d.ts +41 -0
- package/dist/entropy/pool.d.ts.map +1 -0
- package/dist/entropy/presentation.d.ts +12 -0
- package/dist/entropy/presentation.d.ts.map +1 -0
- package/dist/entropy/sessions.d.ts +47 -0
- package/dist/entropy/sessions.d.ts.map +1 -0
- package/dist/entropy/surface.d.ts +30 -0
- package/dist/entropy/surface.d.ts.map +1 -0
- package/dist/entropy/trial.d.ts +38 -0
- package/dist/entropy/trial.d.ts.map +1 -0
- package/dist/entropy/types.d.ts +181 -0
- package/dist/entropy/types.d.ts.map +1 -0
- package/dist/execution-service.d.ts +66 -0
- package/dist/execution-service.d.ts.map +1 -0
- package/dist/fabric-exec-arguments.d.ts +7 -0
- package/dist/fabric-exec-arguments.d.ts.map +1 -0
- package/dist/fabric-exec-tool.d.ts +8 -0
- package/dist/fabric-exec-tool.d.ts.map +1 -0
- package/dist/fabric-runtime-state.d.ts +96 -0
- package/dist/fabric-runtime-state.d.ts.map +1 -0
- package/dist/fabric-runtime-state.js +11928 -0
- package/dist/fabric-runtime-state.js.map +7 -0
- package/dist/fabric-state.d.ts +95 -0
- package/dist/fabric-state.d.ts.map +1 -0
- package/dist/failure-progress.d.ts +3 -0
- package/dist/failure-progress.d.ts.map +1 -0
- package/dist/host-compatibility.d.ts +5 -0
- package/dist/host-compatibility.d.ts.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6094 -0
- package/dist/index.js.map +7 -0
- package/dist/jev/auth.d.ts +5 -0
- package/dist/jev/auth.d.ts.map +1 -0
- package/dist/jev/browser.d.ts +37 -0
- package/dist/jev/browser.d.ts.map +1 -0
- package/dist/jev/browser.js +13 -0
- package/dist/jev/browser.js.map +7 -0
- package/dist/jev/client.d.ts +29 -0
- package/dist/jev/client.d.ts.map +1 -0
- package/dist/jev/client.js +11 -0
- package/dist/jev/client.js.map +7 -0
- package/dist/jev/config.d.ts +17 -0
- package/dist/jev/config.d.ts.map +1 -0
- package/dist/jev/guest-types.d.ts +2 -0
- package/dist/jev/guest-types.d.ts.map +1 -0
- package/dist/jev/manager.d.ts +36 -0
- package/dist/jev/manager.d.ts.map +1 -0
- package/dist/jev/observation.d.ts +59 -0
- package/dist/jev/observation.d.ts.map +1 -0
- package/dist/jev/observation.js +20 -0
- package/dist/jev/observation.js.map +7 -0
- package/dist/jev/types.d.ts +142 -0
- package/dist/jev/types.d.ts.map +1 -0
- package/dist/jev/validation.d.ts +8 -0
- package/dist/jev/validation.d.ts.map +1 -0
- package/dist/jev.d.ts +9 -0
- package/dist/jev.d.ts.map +1 -0
- package/dist/jev.js +49 -0
- package/dist/jev.js.map +7 -0
- package/dist/lifecycle/broker.d.ts +30 -0
- package/dist/lifecycle/broker.d.ts.map +1 -0
- package/dist/lifecycle/delivery-scheduler.d.ts +30 -0
- package/dist/lifecycle/delivery-scheduler.d.ts.map +1 -0
- package/dist/lifecycle/types.d.ts +91 -0
- package/dist/lifecycle/types.d.ts.map +1 -0
- package/dist/log-tail.d.ts +11 -0
- package/dist/log-tail.d.ts.map +1 -0
- package/dist/main-agent.d.ts +70 -0
- package/dist/main-agent.d.ts.map +1 -0
- package/dist/managed-host.d.ts +22 -0
- package/dist/managed-host.d.ts.map +1 -0
- package/dist/mcp.d.ts +9 -0
- package/dist/mcp.d.ts.map +1 -0
- package/dist/mcp.js +21 -0
- package/dist/mcp.js.map +7 -0
- package/dist/memory/client.d.ts +31 -0
- package/dist/memory/client.d.ts.map +1 -0
- package/dist/memory/context.d.ts +114 -0
- package/dist/memory/context.d.ts.map +1 -0
- package/dist/memory/digest.d.ts +48 -0
- package/dist/memory/digest.d.ts.map +1 -0
- package/dist/memory/digest.js +7 -0
- package/dist/memory/digest.js.map +7 -0
- package/dist/memory/discovery.d.ts +43 -0
- package/dist/memory/discovery.d.ts.map +1 -0
- package/dist/memory/discovery.js +25 -0
- package/dist/memory/discovery.js.map +7 -0
- package/dist/memory/expand-service.d.ts +4 -0
- package/dist/memory/expand-service.d.ts.map +1 -0
- package/dist/memory/host-source.d.ts +60 -0
- package/dist/memory/host-source.d.ts.map +1 -0
- package/dist/memory/index.d.ts +113 -0
- package/dist/memory/index.d.ts.map +1 -0
- package/dist/memory/lineage.d.ts +25 -0
- package/dist/memory/lineage.d.ts.map +1 -0
- package/dist/memory/normalize.d.ts +188 -0
- package/dist/memory/normalize.d.ts.map +1 -0
- package/dist/memory/normalize.js +26 -0
- package/dist/memory/normalize.js.map +7 -0
- package/dist/memory/portable.d.ts +66 -0
- package/dist/memory/portable.d.ts.map +1 -0
- package/dist/memory/provider.d.ts +15 -0
- package/dist/memory/provider.d.ts.map +1 -0
- package/dist/memory/recall-service.d.ts +5 -0
- package/dist/memory/recall-service.d.ts.map +1 -0
- package/dist/memory/regex.d.ts +19 -0
- package/dist/memory/regex.d.ts.map +1 -0
- package/dist/memory/request-cache.d.ts +49 -0
- package/dist/memory/request-cache.d.ts.map +1 -0
- package/dist/memory/request-context.d.ts +57 -0
- package/dist/memory/request-context.d.ts.map +1 -0
- package/dist/memory/request-limits.d.ts +8 -0
- package/dist/memory/request-limits.d.ts.map +1 -0
- package/dist/memory/search.d.ts +98 -0
- package/dist/memory/search.d.ts.map +1 -0
- package/dist/memory/search.js +24 -0
- package/dist/memory/search.js.map +7 -0
- package/dist/memory/sessions-service.d.ts +3 -0
- package/dist/memory/sessions-service.d.ts.map +1 -0
- package/dist/memory/source-observation.d.ts +28 -0
- package/dist/memory/source-observation.d.ts.map +1 -0
- package/dist/memory/tokenize.d.ts +24 -0
- package/dist/memory/tokenize.d.ts.map +1 -0
- package/dist/memory.d.ts +8 -0
- package/dist/memory.d.ts.map +1 -0
- package/dist/memory.js +119 -0
- package/dist/memory.js.map +7 -0
- package/dist/mesh/store.d.ts +78 -0
- package/dist/mesh/store.d.ts.map +1 -0
- package/dist/output-budget.d.ts +12 -0
- package/dist/output-budget.d.ts.map +1 -0
- package/dist/prewalk/arm.d.ts +8 -0
- package/dist/prewalk/arm.d.ts.map +1 -0
- package/dist/prewalk/controller.d.ts +66 -0
- package/dist/prewalk/controller.d.ts.map +1 -0
- package/dist/prewalk/fs-drift.d.ts +19 -0
- package/dist/prewalk/fs-drift.d.ts.map +1 -0
- package/dist/prewalk/handoff.d.ts +46 -0
- package/dist/prewalk/handoff.d.ts.map +1 -0
- package/dist/protocol.d.ts +275 -0
- package/dist/protocol.d.ts.map +1 -0
- package/dist/protocol.js +46 -0
- package/dist/protocol.js.map +7 -0
- package/dist/providers/agents-actions.d.ts +3 -0
- package/dist/providers/agents-actions.d.ts.map +1 -0
- package/dist/providers/agents-message-router.d.ts +29 -0
- package/dist/providers/agents-message-router.d.ts.map +1 -0
- package/dist/providers/agents-progress.d.ts +18 -0
- package/dist/providers/agents-progress.d.ts.map +1 -0
- package/dist/providers/agents-provider.d.ts +51 -0
- package/dist/providers/agents-provider.d.ts.map +1 -0
- package/dist/providers/arg-normalization.d.ts +15 -0
- package/dist/providers/arg-normalization.d.ts.map +1 -0
- package/dist/providers/captured-tools-provider.d.ts +23 -0
- package/dist/providers/captured-tools-provider.d.ts.map +1 -0
- package/dist/providers/compact-provider.d.ts +14 -0
- package/dist/providers/compact-provider.d.ts.map +1 -0
- package/dist/providers/components-provider.d.ts +12 -0
- package/dist/providers/components-provider.d.ts.map +1 -0
- package/dist/providers/jev-provider.d.ts +70 -0
- package/dist/providers/jev-provider.d.ts.map +1 -0
- package/dist/providers/jev-provider.js +28 -0
- package/dist/providers/jev-provider.js.map +7 -0
- package/dist/providers/mcp-descriptor-cache.d.ts +47 -0
- package/dist/providers/mcp-descriptor-cache.d.ts.map +1 -0
- package/dist/providers/mcp-provider.d.ts +47 -0
- package/dist/providers/mcp-provider.d.ts.map +1 -0
- package/dist/providers/memory-provider.d.ts +32 -0
- package/dist/providers/memory-provider.d.ts.map +1 -0
- package/dist/providers/memory-provider.js +23 -0
- package/dist/providers/memory-provider.js.map +7 -0
- package/dist/providers/mesh-provider.d.ts +17 -0
- package/dist/providers/mesh-provider.d.ts.map +1 -0
- package/dist/providers/pi-bash-cwd.d.ts +49 -0
- package/dist/providers/pi-bash-cwd.d.ts.map +1 -0
- package/dist/providers/pi-tools-provider.d.ts +25 -0
- package/dist/providers/pi-tools-provider.d.ts.map +1 -0
- package/dist/providers/schema-provider.d.ts +15 -0
- package/dist/providers/schema-provider.d.ts.map +1 -0
- package/dist/providers/state-provider.d.ts +16 -0
- package/dist/providers/state-provider.d.ts.map +1 -0
- package/dist/providers/write-diff-limits.d.ts +5 -0
- package/dist/providers/write-diff-limits.d.ts.map +1 -0
- package/dist/providers/write-preview.d.ts +3 -0
- package/dist/providers/write-preview.d.ts.map +1 -0
- package/dist/ref-names.d.ts +2 -0
- package/dist/ref-names.d.ts.map +1 -0
- package/dist/repairs/active.d.ts +7 -0
- package/dist/repairs/active.d.ts.map +1 -0
- package/dist/repairs/apply.d.ts +7 -0
- package/dist/repairs/apply.d.ts.map +1 -0
- package/dist/repairs/catalog-digest.d.ts +5 -0
- package/dist/repairs/catalog-digest.d.ts.map +1 -0
- package/dist/repairs/classify.d.ts +10 -0
- package/dist/repairs/classify.d.ts.map +1 -0
- package/dist/repairs/compiler.d.ts +33 -0
- package/dist/repairs/compiler.d.ts.map +1 -0
- package/dist/repairs/promote.d.ts +4 -0
- package/dist/repairs/promote.d.ts.map +1 -0
- package/dist/repairs/store.d.ts +10 -0
- package/dist/repairs/store.d.ts.map +1 -0
- package/dist/repairs/types.d.ts +49 -0
- package/dist/repairs/types.d.ts.map +1 -0
- package/dist/repeat-guard.d.ts +25 -0
- package/dist/repeat-guard.d.ts.map +1 -0
- package/dist/residency/actor-client.d.ts +16 -0
- package/dist/residency/actor-client.d.ts.map +1 -0
- package/dist/residency/actor-client.js +9 -0
- package/dist/residency/actor-client.js.map +7 -0
- package/dist/residency/client.d.ts +44 -0
- package/dist/residency/client.d.ts.map +1 -0
- package/dist/residency/host.d.ts +3 -0
- package/dist/residency/host.d.ts.map +1 -0
- package/dist/residency/host.js +32 -0
- package/dist/residency/host.js.map +7 -0
- package/dist/residency/launcher-owner.d.ts +7 -0
- package/dist/residency/launcher-owner.d.ts.map +1 -0
- package/dist/residency/launcher.d.ts +3 -0
- package/dist/residency/launcher.d.ts.map +1 -0
- package/dist/residency/launcher.js +154 -0
- package/dist/residency/launcher.js.map +7 -0
- package/dist/residency/pi-entry.d.ts +3 -0
- package/dist/residency/pi-entry.d.ts.map +1 -0
- package/dist/residency/pi-entry.js +48 -0
- package/dist/residency/pi-entry.js.map +7 -0
- package/dist/residency/protocol.d.ts +122 -0
- package/dist/residency/protocol.d.ts.map +1 -0
- package/dist/run-display.d.ts +3 -0
- package/dist/run-display.d.ts.map +1 -0
- package/dist/runtime/core-override-guest-types.d.ts +15 -0
- package/dist/runtime/core-override-guest-types.d.ts.map +1 -0
- package/dist/runtime/core-override-guest-types.js +9 -0
- package/dist/runtime/core-override-guest-types.js.map +7 -0
- package/dist/runtime/core-tool-properties.d.ts +6 -0
- package/dist/runtime/core-tool-properties.d.ts.map +1 -0
- package/dist/runtime/cpython-child-source.d.ts +2 -0
- package/dist/runtime/cpython-child-source.d.ts.map +1 -0
- package/dist/runtime/cpython-linux-sandbox.d.ts +2 -0
- package/dist/runtime/cpython-linux-sandbox.d.ts.map +1 -0
- package/dist/runtime/cpython-runtime.d.ts +9 -0
- package/dist/runtime/cpython-runtime.d.ts.map +1 -0
- package/dist/runtime/cpython-runtime.js +677 -0
- package/dist/runtime/cpython-runtime.js.map +7 -0
- package/dist/runtime/dynamic-guest-types.d.ts +3 -0
- package/dist/runtime/dynamic-guest-types.d.ts.map +1 -0
- package/dist/runtime/dynamic-guest-types.js +8 -0
- package/dist/runtime/dynamic-guest-types.js.map +7 -0
- package/dist/runtime/guest-code-repair.d.ts +2 -0
- package/dist/runtime/guest-code-repair.d.ts.map +1 -0
- package/dist/runtime/guest-stack-map.d.ts +11 -0
- package/dist/runtime/guest-stack-map.d.ts.map +1 -0
- package/dist/runtime/guest-types.d.ts +40 -0
- package/dist/runtime/guest-types.d.ts.map +1 -0
- package/dist/runtime/guest-types.js +13 -0
- package/dist/runtime/guest-types.js.map +7 -0
- package/dist/runtime/kernel.d.ts +30 -0
- package/dist/runtime/kernel.d.ts.map +1 -0
- package/dist/runtime/monty-bridge.d.ts +4 -0
- package/dist/runtime/monty-bridge.d.ts.map +1 -0
- package/dist/runtime/monty-runtime.d.ts +6 -0
- package/dist/runtime/monty-runtime.d.ts.map +1 -0
- package/dist/runtime/monty-runtime.js +485 -0
- package/dist/runtime/monty-runtime.js.map +7 -0
- package/dist/runtime/monty-source.d.ts +10 -0
- package/dist/runtime/monty-source.d.ts.map +1 -0
- package/dist/runtime/monty-values.d.ts +7 -0
- package/dist/runtime/monty-values.d.ts.map +1 -0
- package/dist/runtime/node-process-child-source.d.ts +2 -0
- package/dist/runtime/node-process-child-source.d.ts.map +1 -0
- package/dist/runtime/node-process-runtime.d.ts +10 -0
- package/dist/runtime/node-process-runtime.d.ts.map +1 -0
- package/dist/runtime/node-process-runtime.js +16 -0
- package/dist/runtime/node-process-runtime.js.map +7 -0
- package/dist/runtime/orchestration.d.ts +3 -0
- package/dist/runtime/orchestration.d.ts.map +1 -0
- package/dist/runtime/python-arguments.d.ts +2 -0
- package/dist/runtime/python-arguments.d.ts.map +1 -0
- package/dist/runtime/python-error-guidance.d.ts +6 -0
- package/dist/runtime/python-error-guidance.d.ts.map +1 -0
- package/dist/runtime/quickjs-runtime.d.ts +8 -0
- package/dist/runtime/quickjs-runtime.d.ts.map +1 -0
- package/dist/runtime/quickjs-runtime.js +15 -0
- package/dist/runtime/quickjs-runtime.js.map +7 -0
- package/dist/runtime/type-checker.d.ts +18 -0
- package/dist/runtime/type-checker.d.ts.map +1 -0
- package/dist/runtime/type-checker.js +11 -0
- package/dist/runtime/type-checker.js.map +7 -0
- package/dist/runtime/typescript-kernel.d.ts +14 -0
- package/dist/runtime/typescript-kernel.d.ts.map +1 -0
- package/dist/runtime/typescript-kernel.js +53 -0
- package/dist/runtime/typescript-kernel.js.map +7 -0
- package/dist/runtime-paths.d.ts +7 -0
- package/dist/runtime-paths.d.ts.map +1 -0
- package/dist/runtime-state-builtins.d.ts +26 -0
- package/dist/runtime-state-builtins.d.ts.map +1 -0
- package/dist/runtime-state-speculation.d.ts +16 -0
- package/dist/runtime-state-speculation.d.ts.map +1 -0
- package/dist/schema/controller.d.ts +35 -0
- package/dist/schema/controller.d.ts.map +1 -0
- package/dist/schema/policy.d.ts +2 -0
- package/dist/schema/policy.d.ts.map +1 -0
- package/dist/schema/types.d.ts +86 -0
- package/dist/schema/types.d.ts.map +1 -0
- package/dist/schema/workspace.d.ts +19 -0
- package/dist/schema/workspace.d.ts.map +1 -0
- package/dist/speculation/eligibility.d.ts +22 -0
- package/dist/speculation/eligibility.d.ts.map +1 -0
- package/dist/speculation/freshness.d.ts +10 -0
- package/dist/speculation/freshness.d.ts.map +1 -0
- package/dist/speculation/partial-json.d.ts +9 -0
- package/dist/speculation/partial-json.d.ts.map +1 -0
- package/dist/speculation/python-scanner.d.ts +7 -0
- package/dist/speculation/python-scanner.d.ts.map +1 -0
- package/dist/speculation/python-scanner.js +166 -0
- package/dist/speculation/python-scanner.js.map +7 -0
- package/dist/speculation/scanner.d.ts +13 -0
- package/dist/speculation/scanner.d.ts.map +1 -0
- package/dist/speculation/scanner.js +182 -0
- package/dist/speculation/scanner.js.map +7 -0
- package/dist/speculation/store.d.ts +41 -0
- package/dist/speculation/store.d.ts.map +1 -0
- package/dist/speculation/stream-tap.d.ts +30 -0
- package/dist/speculation/stream-tap.d.ts.map +1 -0
- package/dist/speculation/types.d.ts +44 -0
- package/dist/speculation/types.d.ts.map +1 -0
- package/dist/state/complexity.d.ts +13 -0
- package/dist/state/complexity.d.ts.map +1 -0
- package/dist/state/evidence-runner.d.ts +17 -0
- package/dist/state/evidence-runner.d.ts.map +1 -0
- package/dist/state/store.d.ts +76 -0
- package/dist/state/store.d.ts.map +1 -0
- package/dist/state/types.d.ts +165 -0
- package/dist/state/types.d.ts.map +1 -0
- package/dist/storage/retention.d.ts +22 -0
- package/dist/storage/retention.d.ts.map +1 -0
- package/dist/thinking.d.ts +19 -0
- package/dist/thinking.d.ts.map +1 -0
- package/dist/topology/control-plane.d.ts +58 -0
- package/dist/topology/control-plane.d.ts.map +1 -0
- package/dist/topology/participant-directory.d.ts +33 -0
- package/dist/topology/participant-directory.d.ts.map +1 -0
- package/dist/topology/peer-settle.d.ts +51 -0
- package/dist/topology/peer-settle.d.ts.map +1 -0
- package/dist/topology/records.d.ts +6 -0
- package/dist/topology/records.d.ts.map +1 -0
- package/dist/topology/types.d.ts +89 -0
- package/dist/topology/types.d.ts.map +1 -0
- package/dist/type-error-guidance.d.ts +3 -0
- package/dist/type-error-guidance.d.ts.map +1 -0
- package/dist/ui/arc-group.d.ts +17 -0
- package/dist/ui/arc-group.d.ts.map +1 -0
- package/dist/ui/border-status-editor.d.ts +22 -0
- package/dist/ui/border-status-editor.d.ts.map +1 -0
- package/dist/ui/code-preview-shell.d.ts +11 -0
- package/dist/ui/code-preview-shell.d.ts.map +1 -0
- package/dist/ui/code-preview.d.ts +53 -0
- package/dist/ui/code-preview.d.ts.map +1 -0
- package/dist/ui/controller.d.ts +20 -0
- package/dist/ui/controller.d.ts.map +1 -0
- package/dist/ui/conversation-chrome.d.ts +16 -0
- package/dist/ui/conversation-chrome.d.ts.map +1 -0
- package/dist/ui/conversation-chrome.js +11 -0
- package/dist/ui/conversation-chrome.js.map +7 -0
- package/dist/ui/conversation-commands.d.ts +12 -0
- package/dist/ui/conversation-commands.d.ts.map +1 -0
- package/dist/ui/conversation-history.d.ts +6 -0
- package/dist/ui/conversation-history.d.ts.map +1 -0
- package/dist/ui/conversation-host.d.ts +7 -0
- package/dist/ui/conversation-host.d.ts.map +1 -0
- package/dist/ui/conversation-host.js +9 -0
- package/dist/ui/conversation-host.js.map +7 -0
- package/dist/ui/conversation-native-reader-checkpoint.d.ts +8 -0
- package/dist/ui/conversation-native-reader-checkpoint.d.ts.map +1 -0
- package/dist/ui/conversation-native-reader-replay.d.ts +10 -0
- package/dist/ui/conversation-native-reader-replay.d.ts.map +1 -0
- package/dist/ui/conversation-native-reader.d.ts +110 -0
- package/dist/ui/conversation-native-reader.d.ts.map +1 -0
- package/dist/ui/conversation-native-reader.js +1050 -0
- package/dist/ui/conversation-native-reader.js.map +7 -0
- package/dist/ui/conversation-queue-store.d.ts +14 -0
- package/dist/ui/conversation-queue-store.d.ts.map +1 -0
- package/dist/ui/conversation-queue.d.ts +244 -0
- package/dist/ui/conversation-queue.d.ts.map +1 -0
- package/dist/ui/conversation-render.d.ts +104 -0
- package/dist/ui/conversation-render.d.ts.map +1 -0
- package/dist/ui/conversation-selection.d.ts +18 -0
- package/dist/ui/conversation-selection.d.ts.map +1 -0
- package/dist/ui/conversation-shortcut.d.ts +3 -0
- package/dist/ui/conversation-shortcut.d.ts.map +1 -0
- package/dist/ui/conversation-targets.d.ts +7 -0
- package/dist/ui/conversation-targets.d.ts.map +1 -0
- package/dist/ui/conversation-targets.js +12 -0
- package/dist/ui/conversation-targets.js.map +7 -0
- package/dist/ui/conversation-transcript.d.ts +25 -0
- package/dist/ui/conversation-transcript.d.ts.map +1 -0
- package/dist/ui/conversation.d.ts +219 -0
- package/dist/ui/conversation.d.ts.map +1 -0
- package/dist/ui/conversation.js +2861 -0
- package/dist/ui/conversation.js.map +7 -0
- package/dist/ui/core-tool-render.d.ts +20 -0
- package/dist/ui/core-tool-render.d.ts.map +1 -0
- package/dist/ui/dashboard-detail.d.ts +68 -0
- package/dist/ui/dashboard-detail.d.ts.map +1 -0
- package/dist/ui/dashboard-fabric-graph.d.ts +50 -0
- package/dist/ui/dashboard-fabric-graph.d.ts.map +1 -0
- package/dist/ui/dashboard-graph-controller.d.ts +52 -0
- package/dist/ui/dashboard-graph-controller.d.ts.map +1 -0
- package/dist/ui/dashboard-modal-controller.d.ts +36 -0
- package/dist/ui/dashboard-modal-controller.d.ts.map +1 -0
- package/dist/ui/dashboard-model.d.ts +111 -0
- package/dist/ui/dashboard-model.d.ts.map +1 -0
- package/dist/ui/dashboard-presentation.d.ts +6 -0
- package/dist/ui/dashboard-presentation.d.ts.map +1 -0
- package/dist/ui/dashboard.d.ts +156 -0
- package/dist/ui/dashboard.d.ts.map +1 -0
- package/dist/ui/dashboard.js +4622 -0
- package/dist/ui/dashboard.js.map +7 -0
- package/dist/ui/diff-background.d.ts +12 -0
- package/dist/ui/diff-background.d.ts.map +1 -0
- package/dist/ui/dynamic-border.d.ts +8 -0
- package/dist/ui/dynamic-border.d.ts.map +1 -0
- package/dist/ui/escape-halt.d.ts +11 -0
- package/dist/ui/escape-halt.d.ts.map +1 -0
- package/dist/ui/fabric-actor-delivery-selector.d.ts +17 -0
- package/dist/ui/fabric-actor-delivery-selector.d.ts.map +1 -0
- package/dist/ui/fabric-actor-tool-selector.d.ts +22 -0
- package/dist/ui/fabric-actor-tool-selector.d.ts.map +1 -0
- package/dist/ui/fabric-code-parser.d.ts +9 -0
- package/dist/ui/fabric-code-parser.d.ts.map +1 -0
- package/dist/ui/fabric-host-event-selector.d.ts +29 -0
- package/dist/ui/fabric-host-event-selector.d.ts.map +1 -0
- package/dist/ui/fabric-model-selector.d.ts +64 -0
- package/dist/ui/fabric-model-selector.d.ts.map +1 -0
- package/dist/ui/fabric-render.d.ts +113 -0
- package/dist/ui/fabric-render.d.ts.map +1 -0
- package/dist/ui/fabric-thinking-selector.d.ts +26 -0
- package/dist/ui/fabric-thinking-selector.d.ts.map +1 -0
- package/dist/ui/fabric-title-hint.d.ts +3 -0
- package/dist/ui/fabric-title-hint.d.ts.map +1 -0
- package/dist/ui/format.d.ts +9 -0
- package/dist/ui/format.d.ts.map +1 -0
- package/dist/ui/handoff-completion.d.ts +3 -0
- package/dist/ui/handoff-completion.d.ts.map +1 -0
- package/dist/ui/highlight.d.ts +69 -0
- package/dist/ui/highlight.d.ts.map +1 -0
- package/dist/ui/model-picker.d.ts +46 -0
- package/dist/ui/model-picker.d.ts.map +1 -0
- package/dist/ui/model-picker.js +17 -0
- package/dist/ui/model-picker.js.map +7 -0
- package/dist/ui/preview-lines.d.ts +16 -0
- package/dist/ui/preview-lines.d.ts.map +1 -0
- package/dist/ui/row-balance.d.ts +29 -0
- package/dist/ui/row-balance.d.ts.map +1 -0
- package/dist/ui/settings-component.d.ts +26 -0
- package/dist/ui/settings-component.d.ts.map +1 -0
- package/dist/ui/settings-rpc.d.ts +15 -0
- package/dist/ui/settings-rpc.d.ts.map +1 -0
- package/dist/ui/settings-section-context.d.ts +18 -0
- package/dist/ui/settings-section-context.d.ts.map +1 -0
- package/dist/ui/settings-sections-agents.d.ts +5 -0
- package/dist/ui/settings-sections-agents.d.ts.map +1 -0
- package/dist/ui/settings-sections-execution.d.ts +8 -0
- package/dist/ui/settings-sections-execution.d.ts.map +1 -0
- package/dist/ui/settings-sections-lifecycle.d.ts +6 -0
- package/dist/ui/settings-sections-lifecycle.d.ts.map +1 -0
- package/dist/ui/settings-sections-presentation.d.ts +6 -0
- package/dist/ui/settings-sections-presentation.d.ts.map +1 -0
- package/dist/ui/settings-sections.d.ts +12 -0
- package/dist/ui/settings-sections.d.ts.map +1 -0
- package/dist/ui/settings-submenus.d.ts +74 -0
- package/dist/ui/settings-submenus.d.ts.map +1 -0
- package/dist/ui/settings-values.d.ts +63 -0
- package/dist/ui/settings-values.d.ts.map +1 -0
- package/dist/ui/settings.d.ts +21 -0
- package/dist/ui/settings.d.ts.map +1 -0
- package/dist/ui/settings.js +1985 -0
- package/dist/ui/settings.js.map +7 -0
- package/dist/ui/shell-hang-keys.d.ts +11 -0
- package/dist/ui/shell-hang-keys.d.ts.map +1 -0
- package/dist/ui/shiki-language.d.ts +7 -0
- package/dist/ui/shiki-language.d.ts.map +1 -0
- package/dist/ui/shiki-theme.d.ts +7 -0
- package/dist/ui/shiki-theme.d.ts.map +1 -0
- package/dist/ui/snapshot.d.ts +17 -0
- package/dist/ui/snapshot.d.ts.map +1 -0
- package/dist/ui/spinner.d.ts +6 -0
- package/dist/ui/spinner.d.ts.map +1 -0
- package/dist/ui/state-file-preview.d.ts +13 -0
- package/dist/ui/state-file-preview.d.ts.map +1 -0
- package/dist/ui/structured.d.ts +9 -0
- package/dist/ui/structured.d.ts.map +1 -0
- package/dist/ui/tool-call-timing.d.ts +2 -0
- package/dist/ui/tool-call-timing.d.ts.map +1 -0
- package/dist/ui/tool-display.d.ts +8 -0
- package/dist/ui/tool-display.d.ts.map +1 -0
- package/dist/ui/topology.d.ts +162 -0
- package/dist/ui/topology.d.ts.map +1 -0
- package/dist/ui/transcript-parser.d.ts +18 -0
- package/dist/ui/transcript-parser.d.ts.map +1 -0
- package/dist/ui/transcript-reader.d.ts +10 -0
- package/dist/ui/transcript-reader.d.ts.map +1 -0
- package/dist/ui/transcript-sanitization.d.ts +14 -0
- package/dist/ui/transcript-sanitization.d.ts.map +1 -0
- package/dist/ui/transcript.d.ts +52 -0
- package/dist/ui/transcript.d.ts.map +1 -0
- package/dist/ui/types.d.ts +84 -0
- package/dist/ui/types.d.ts.map +1 -0
- package/dist/ui/widget.d.ts +16 -0
- package/dist/ui/widget.d.ts.map +1 -0
- package/dist/ui/word-diff/alignment.d.ts +6 -0
- package/dist/ui/word-diff/alignment.d.ts.map +1 -0
- package/dist/ui/word-diff/change-block.d.ts +18 -0
- package/dist/ui/word-diff/change-block.d.ts.map +1 -0
- package/dist/ui/word-diff/changed-line.d.ts +14 -0
- package/dist/ui/word-diff/changed-line.d.ts.map +1 -0
- package/dist/ui/word-diff/emphasis.d.ts +9 -0
- package/dist/ui/word-diff/emphasis.d.ts.map +1 -0
- package/dist/ui/word-diff/line-emphasis.d.ts +7 -0
- package/dist/ui/word-diff/line-emphasis.d.ts.map +1 -0
- package/dist/ui/word-diff/line-matching.d.ts +10 -0
- package/dist/ui/word-diff/line-matching.d.ts.map +1 -0
- package/dist/ui/word-diff/line-similarity.d.ts +16 -0
- package/dist/ui/word-diff/line-similarity.d.ts.map +1 -0
- package/dist/ui/word-diff/normalize.d.ts +3 -0
- package/dist/ui/word-diff/normalize.d.ts.map +1 -0
- package/dist/ui/word-diff/parse.d.ts +17 -0
- package/dist/ui/word-diff/parse.d.ts.map +1 -0
- package/dist/ui/word-diff/range-refinement.d.ts +5 -0
- package/dist/ui/word-diff/range-refinement.d.ts.map +1 -0
- package/dist/ui/word-diff/ranges.d.ts +11 -0
- package/dist/ui/word-diff/ranges.d.ts.map +1 -0
- package/dist/ui/word-diff/smart-filter.d.ts +3 -0
- package/dist/ui/word-diff/smart-filter.d.ts.map +1 -0
- package/dist/ui/word-diff/sparse-line-matching.d.ts +25 -0
- package/dist/ui/word-diff/sparse-line-matching.d.ts.map +1 -0
- package/dist/ui/word-diff/text-boundaries.d.ts +11 -0
- package/dist/ui/word-diff/text-boundaries.d.ts.map +1 -0
- package/dist/ui/word-diff/token-alignment.d.ts +9 -0
- package/dist/ui/word-diff/token-alignment.d.ts.map +1 -0
- package/dist/ui/word-diff/token-text-refinement.d.ts +4 -0
- package/dist/ui/word-diff/token-text-refinement.d.ts.map +1 -0
- package/dist/ui/word-diff/tokens.d.ts +16 -0
- package/dist/ui/word-diff/tokens.d.ts.map +1 -0
- package/dist/ui/word-diff/types.d.ts +10 -0
- package/dist/ui/word-diff/types.d.ts.map +1 -0
- package/dist/util.d.ts +3 -0
- package/dist/util.d.ts.map +1 -0
- package/dist/worker/model-control.d.ts +14 -0
- package/dist/worker/model-control.d.ts.map +1 -0
- package/dist/worker/model-control.js +118 -0
- package/dist/worker/model-control.js.map +7 -0
- package/dist/worker/options.d.ts +3 -0
- package/dist/worker/options.d.ts.map +1 -0
- package/dist/worker/options.js +156 -0
- package/dist/worker/options.js.map +7 -0
- package/dist/worker/run-record.d.ts +22 -0
- package/dist/worker/run-record.d.ts.map +1 -0
- package/dist/worker/run-record.js +124 -0
- package/dist/worker/run-record.js.map +7 -0
- package/dist/worker/session-export.d.ts +45 -0
- package/dist/worker/session-export.d.ts.map +1 -0
- package/dist/worker/session-export.js +91 -0
- package/dist/worker/session-export.js.map +7 -0
- package/dist/worker.d.ts +3 -0
- package/dist/worker.d.ts.map +1 -0
- package/dist/worker.js +1074 -0
- package/dist/worker.js.map +7 -0
- package/docs/agents.md +618 -0
- package/docs/architecture.md +141 -0
- package/docs/audit-trace.md +116 -0
- package/docs/certification.md +166 -0
- package/docs/compaction.md +345 -0
- package/docs/component-calculus.md +191 -0
- package/docs/components.md +330 -0
- package/docs/configuration.md +529 -0
- package/docs/entropy.md +214 -0
- package/docs/interface.md +210 -0
- package/docs/jev.md +289 -0
- package/docs/kernels.md +186 -0
- package/docs/memory-recall.md +664 -0
- package/docs/programmatic-compaction.md +205 -0
- package/docs/provider-component-calculus.md +378 -0
- package/docs/providers.md +163 -0
- package/docs/repairs.md +90 -0
- package/docs/residency-runtime.md +82 -0
- package/docs/schema-enforcement.md +166 -0
- package/docs/skills.md +50 -0
- package/docs/speculation.md +171 -0
- package/docs/state-layer.md +197 -0
- package/package.json +135 -0
- package/skillsets/python/fabric-advisor/SKILL.md +29 -0
- package/skillsets/python/fabric-ambient/SKILL.md +44 -0
- package/skillsets/python/fabric-ambient/references/setup.md +67 -0
- package/skillsets/python/fabric-council/SKILL.md +54 -0
- package/skillsets/python/fabric-exec/SKILL.md +74 -0
- package/skillsets/python/fabric-exec/references/agents.md +65 -0
- package/skillsets/python/fabric-exec/references/mcp.md +23 -0
- package/skillsets/python/fabric-exec/references/mesh.md +27 -0
- package/skillsets/python/fabric-fusion/SKILL.md +112 -0
- package/skillsets/python/fabric-guide/SKILL.md +29 -0
- package/skillsets/python/fabric-jev/SKILL.md +162 -0
- package/skillsets/python/fabric-rlm/SKILL.md +120 -0
- package/skillsets/python/fabric-schema/SKILL.md +55 -0
- package/skillsets/python/fabric-spec/SKILL.md +42 -0
- package/skillsets/python/fabric-supervisor/SKILL.md +37 -0
- package/skillsets/python/fabric-swarm/SKILL.md +40 -0
- package/skillsets/python/fabric-workflow/SKILL.md +62 -0
- package/skillsets/typescript/fabric-advisor/SKILL.md +29 -0
- package/skillsets/typescript/fabric-ambient/SKILL.md +44 -0
- package/skillsets/typescript/fabric-ambient/references/setup.md +90 -0
- package/skillsets/typescript/fabric-council/SKILL.md +94 -0
- package/skillsets/typescript/fabric-exec/SKILL.md +142 -0
- package/skillsets/typescript/fabric-exec/references/agents.md +218 -0
- package/skillsets/typescript/fabric-exec/references/mcp.md +49 -0
- package/skillsets/typescript/fabric-exec/references/mesh.md +51 -0
- package/skillsets/typescript/fabric-fusion/SKILL.md +332 -0
- package/skillsets/typescript/fabric-guide/SKILL.md +29 -0
- package/skillsets/typescript/fabric-jev/SKILL.md +159 -0
- package/skillsets/typescript/fabric-rlm/SKILL.md +284 -0
- package/skillsets/typescript/fabric-schema/SKILL.md +121 -0
- package/skillsets/typescript/fabric-spec/SKILL.md +42 -0
- package/skillsets/typescript/fabric-supervisor/SKILL.md +37 -0
- package/skillsets/typescript/fabric-swarm/SKILL.md +80 -0
- package/skillsets/typescript/fabric-workflow/SKILL.md +133 -0
|
@@ -0,0 +1,931 @@
|
|
|
1
|
+
import {
|
|
2
|
+
sanitizeMcpRefPart
|
|
3
|
+
} from "./chunk-IGVDD2HT.js";
|
|
4
|
+
import {
|
|
5
|
+
stableJsonHash
|
|
6
|
+
} from "./chunk-3YZUQESG.js";
|
|
7
|
+
|
|
8
|
+
// src/providers/mcp-provider.ts
|
|
9
|
+
import path2 from "node:path";
|
|
10
|
+
|
|
11
|
+
// src/providers/mcp-descriptor-cache.ts
|
|
12
|
+
import fs from "node:fs/promises";
|
|
13
|
+
import fsSync from "node:fs";
|
|
14
|
+
import os from "node:os";
|
|
15
|
+
import path from "node:path";
|
|
16
|
+
var MCP_DESCRIPTOR_CACHE_VERSION = 1;
|
|
17
|
+
var expandHome = (input) => {
|
|
18
|
+
if (!input.startsWith("~")) return input;
|
|
19
|
+
const home = os.homedir();
|
|
20
|
+
if (input === "~") return home;
|
|
21
|
+
if (input.startsWith("~/") || input.startsWith("~\\")) {
|
|
22
|
+
return path.join(home, input.slice(2));
|
|
23
|
+
}
|
|
24
|
+
return input;
|
|
25
|
+
};
|
|
26
|
+
var legacyMcporterDir = () => path.join(os.homedir(), ".mcporter");
|
|
27
|
+
var mcporterConfigDir = () => {
|
|
28
|
+
const raw = process.env.XDG_CONFIG_HOME;
|
|
29
|
+
if (raw && raw.trim().length > 0) {
|
|
30
|
+
const resolved = expandHome(raw.trim());
|
|
31
|
+
if (path.isAbsolute(resolved)) return path.join(resolved, "mcporter");
|
|
32
|
+
}
|
|
33
|
+
return legacyMcporterDir();
|
|
34
|
+
};
|
|
35
|
+
var mcporterConfigCandidates = () => {
|
|
36
|
+
const base = mcporterConfigDir();
|
|
37
|
+
const candidates = [path.join(base, "mcporter.json"), path.join(base, "mcporter.jsonc")];
|
|
38
|
+
const legacy = legacyMcporterDir();
|
|
39
|
+
if (base !== legacy) {
|
|
40
|
+
candidates.push(path.join(legacy, "mcporter.json"), path.join(legacy, "mcporter.jsonc"));
|
|
41
|
+
}
|
|
42
|
+
return candidates;
|
|
43
|
+
};
|
|
44
|
+
var pathExists = (filePath) => {
|
|
45
|
+
try {
|
|
46
|
+
fsSync.accessSync(filePath);
|
|
47
|
+
return true;
|
|
48
|
+
} catch {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
var mcpConfigLayerPaths = (rootDir, configPath) => {
|
|
53
|
+
const explicitRaw = configPath ?? process.env.MCPORTER_CONFIG;
|
|
54
|
+
if (explicitRaw && explicitRaw.trim().length > 0) {
|
|
55
|
+
return [path.resolve(expandHome(explicitRaw.trim()))];
|
|
56
|
+
}
|
|
57
|
+
const paths = [];
|
|
58
|
+
const home = mcporterConfigCandidates().find(pathExists);
|
|
59
|
+
if (home) paths.push(home);
|
|
60
|
+
const projectPath = path.resolve(rootDir, "config", "mcporter.json");
|
|
61
|
+
if (pathExists(projectPath)) paths.push(projectPath);
|
|
62
|
+
return paths;
|
|
63
|
+
};
|
|
64
|
+
var statConfigLayers = async (rootDir, configPath) => {
|
|
65
|
+
const stats = await Promise.all(
|
|
66
|
+
mcpConfigLayerPaths(rootDir, configPath).map(async (layerPath) => {
|
|
67
|
+
try {
|
|
68
|
+
const stat = await fs.stat(layerPath);
|
|
69
|
+
return { path: layerPath, mtimeMs: stat.mtimeMs, size: stat.size };
|
|
70
|
+
} catch {
|
|
71
|
+
return void 0;
|
|
72
|
+
}
|
|
73
|
+
})
|
|
74
|
+
);
|
|
75
|
+
return stats.filter((stat) => stat !== void 0);
|
|
76
|
+
};
|
|
77
|
+
var sameConfigLayers = (left, right) => left.length === right.length && left.every((layer, index) => {
|
|
78
|
+
const other = right[index];
|
|
79
|
+
return other !== void 0 && layer.path === other.path && layer.size === other.size && Math.abs(layer.mtimeMs - other.mtimeMs) <= 1;
|
|
80
|
+
});
|
|
81
|
+
var hashServerDefinition = (definition) => stableJsonHash(definition);
|
|
82
|
+
var isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
83
|
+
var parseCachedServer = (value) => {
|
|
84
|
+
if (!isRecord(value)) return void 0;
|
|
85
|
+
const tools = Array.isArray(value.tools) ? value.tools.filter(
|
|
86
|
+
(tool) => isRecord(tool) && typeof tool.name === "string"
|
|
87
|
+
) : void 0;
|
|
88
|
+
if (typeof value.definitionHash !== "string" || tools === void 0) return void 0;
|
|
89
|
+
return {
|
|
90
|
+
definitionHash: value.definitionHash,
|
|
91
|
+
transport: typeof value.transport === "string" ? value.transport : "unknown",
|
|
92
|
+
description: typeof value.description === "string" ? value.description : null,
|
|
93
|
+
fetchedAt: typeof value.fetchedAt === "string" ? value.fetchedAt : "",
|
|
94
|
+
stale: value.stale === true,
|
|
95
|
+
tools
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
var parseCacheFile = (value) => {
|
|
99
|
+
if (!isRecord(value) || value.version !== MCP_DESCRIPTOR_CACHE_VERSION) return void 0;
|
|
100
|
+
if (!Array.isArray(value.layers) || !isRecord(value.servers)) return void 0;
|
|
101
|
+
const layers = value.layers.filter(
|
|
102
|
+
(layer) => isRecord(layer) && typeof layer.path === "string" && typeof layer.mtimeMs === "number" && typeof layer.size === "number"
|
|
103
|
+
);
|
|
104
|
+
return {
|
|
105
|
+
version: MCP_DESCRIPTOR_CACHE_VERSION,
|
|
106
|
+
layers,
|
|
107
|
+
updatedAt: typeof value.updatedAt === "string" ? value.updatedAt : "",
|
|
108
|
+
servers: value.servers
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
var tempCounter = 0;
|
|
112
|
+
var McpDescriptorCacheStore = class {
|
|
113
|
+
constructor(filePath) {
|
|
114
|
+
this.filePath = filePath;
|
|
115
|
+
}
|
|
116
|
+
async load() {
|
|
117
|
+
try {
|
|
118
|
+
const raw = await fs.readFile(this.filePath, "utf8");
|
|
119
|
+
return parseCacheFile(JSON.parse(raw));
|
|
120
|
+
} catch {
|
|
121
|
+
return void 0;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
// Atomic-ish write: temp file then rename, so a concurrent reader either
|
|
125
|
+
// sees the previous cache or the next one, never a torn document.
|
|
126
|
+
async save(file) {
|
|
127
|
+
const directory = path.dirname(this.filePath);
|
|
128
|
+
await fs.mkdir(directory, { recursive: true });
|
|
129
|
+
const tempPath = path.join(
|
|
130
|
+
directory,
|
|
131
|
+
`.mcp-cache-${process.pid}-${Date.now()}-${tempCounter++}.tmp`
|
|
132
|
+
);
|
|
133
|
+
await fs.writeFile(tempPath, JSON.stringify(file, null, 2));
|
|
134
|
+
try {
|
|
135
|
+
await fs.rename(tempPath, this.filePath);
|
|
136
|
+
} catch (error) {
|
|
137
|
+
await fs.rm(tempPath, { force: true }).catch(() => void 0);
|
|
138
|
+
throw error;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
// src/providers/mcp-provider.ts
|
|
144
|
+
var TOOL_METADATA_TTL_MS = 6e4;
|
|
145
|
+
var REVALIDATE_CONCURRENCY = 3;
|
|
146
|
+
var REVALIDATE_SERVER_TIMEOUT_MS = 2e4;
|
|
147
|
+
var MIN_REVALIDATE_SERVER_TIMEOUT_MS = 5e3;
|
|
148
|
+
var NOTIFY_DEBOUNCE_MS = 100;
|
|
149
|
+
var PERSIST_DEBOUNCE_MS = 150;
|
|
150
|
+
var emptyObjectSchema = {
|
|
151
|
+
type: "object",
|
|
152
|
+
properties: {},
|
|
153
|
+
additionalProperties: false
|
|
154
|
+
};
|
|
155
|
+
var managementDescriptors = [
|
|
156
|
+
{
|
|
157
|
+
name: "$servers",
|
|
158
|
+
description: "List MCP servers discovered by mcporter",
|
|
159
|
+
inputSchema: emptyObjectSchema,
|
|
160
|
+
risk: "read",
|
|
161
|
+
namespace: "management"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
name: "$reload",
|
|
165
|
+
description: "Close MCP connections and reload mcporter configuration",
|
|
166
|
+
inputSchema: emptyObjectSchema,
|
|
167
|
+
risk: "network",
|
|
168
|
+
namespace: "management"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
name: "$register",
|
|
172
|
+
description: "Register an ephemeral MCP server in the pooled mcporter runtime",
|
|
173
|
+
inputSchema: {
|
|
174
|
+
type: "object",
|
|
175
|
+
properties: {
|
|
176
|
+
name: { type: "string" },
|
|
177
|
+
description: { type: "string" },
|
|
178
|
+
command: { type: "string" },
|
|
179
|
+
args: { type: "array", items: { type: "string" } },
|
|
180
|
+
cwd: { type: "string" },
|
|
181
|
+
baseUrl: { type: "string" },
|
|
182
|
+
headers: { type: "object", additionalProperties: { type: "string" } },
|
|
183
|
+
env: { type: "object", additionalProperties: { type: "string" } },
|
|
184
|
+
overwrite: { type: "boolean" }
|
|
185
|
+
},
|
|
186
|
+
required: ["name"],
|
|
187
|
+
additionalProperties: false
|
|
188
|
+
},
|
|
189
|
+
risk: "execute",
|
|
190
|
+
namespace: "management"
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
name: "$call",
|
|
194
|
+
description: "Call an MCP tool by explicit server and tool name",
|
|
195
|
+
inputSchema: {
|
|
196
|
+
type: "object",
|
|
197
|
+
properties: {
|
|
198
|
+
server: { type: "string" },
|
|
199
|
+
tool: { type: "string" },
|
|
200
|
+
args: { type: "object", additionalProperties: true }
|
|
201
|
+
},
|
|
202
|
+
required: ["server", "tool"],
|
|
203
|
+
additionalProperties: false
|
|
204
|
+
},
|
|
205
|
+
risk: "network",
|
|
206
|
+
namespace: "management"
|
|
207
|
+
}
|
|
208
|
+
];
|
|
209
|
+
var normalizeSchema = (schema) => typeof schema === "object" && schema !== null && !Array.isArray(schema) ? schema : emptyObjectSchema;
|
|
210
|
+
var normalizeMcpResult = (result) => {
|
|
211
|
+
if (typeof result !== "object" || result === null || Array.isArray(result)) return result;
|
|
212
|
+
const record = result;
|
|
213
|
+
if (!Array.isArray(record.content)) return result;
|
|
214
|
+
const text = record.content.filter(
|
|
215
|
+
(part) => typeof part === "object" && part !== null && part.type === "text" && typeof part.text === "string"
|
|
216
|
+
).map((part) => part.text).join("\n");
|
|
217
|
+
if (record.isError === true) throw new Error(text || "MCP tool returned an error");
|
|
218
|
+
return {
|
|
219
|
+
text,
|
|
220
|
+
content: record.content,
|
|
221
|
+
structuredContent: record.structuredContent ?? null
|
|
222
|
+
};
|
|
223
|
+
};
|
|
224
|
+
var withTimeout = (operation, timeoutMs, onTimeout) => new Promise((resolve, reject) => {
|
|
225
|
+
const timer = setTimeout(() => {
|
|
226
|
+
onTimeout?.();
|
|
227
|
+
reject(new Error(`MCP server listing timed out after ${timeoutMs}ms`));
|
|
228
|
+
}, timeoutMs);
|
|
229
|
+
timer.unref?.();
|
|
230
|
+
operation.then(
|
|
231
|
+
(value) => {
|
|
232
|
+
clearTimeout(timer);
|
|
233
|
+
resolve(value);
|
|
234
|
+
},
|
|
235
|
+
(error) => {
|
|
236
|
+
clearTimeout(timer);
|
|
237
|
+
reject(error);
|
|
238
|
+
}
|
|
239
|
+
);
|
|
240
|
+
});
|
|
241
|
+
var McpProvider = class {
|
|
242
|
+
constructor(cwd, config, options = {}) {
|
|
243
|
+
this.cwd = cwd;
|
|
244
|
+
this.config = config;
|
|
245
|
+
this.#source = options.source;
|
|
246
|
+
this.#store = options.source ? void 0 : options.cache;
|
|
247
|
+
this.#hooks = options.hooks ?? {};
|
|
248
|
+
}
|
|
249
|
+
name = "mcp";
|
|
250
|
+
description = "External MCP tools discovered and pooled by mcporter";
|
|
251
|
+
#runtime;
|
|
252
|
+
#runtimeCreation;
|
|
253
|
+
#toolMetadata = /* @__PURE__ */ new Map();
|
|
254
|
+
#source;
|
|
255
|
+
#store;
|
|
256
|
+
#hooks;
|
|
257
|
+
#generation = 0;
|
|
258
|
+
#closed = false;
|
|
259
|
+
#hydration;
|
|
260
|
+
#layerStats = [];
|
|
261
|
+
#servers = /* @__PURE__ */ new Map();
|
|
262
|
+
#pending = /* @__PURE__ */ new Map();
|
|
263
|
+
#revalidateQueue = [];
|
|
264
|
+
#revalidateQueued = /* @__PURE__ */ new Set();
|
|
265
|
+
#recontacted = /* @__PURE__ */ new Set();
|
|
266
|
+
#revalidating;
|
|
267
|
+
#autoKicked = false;
|
|
268
|
+
#dirtyPersist = false;
|
|
269
|
+
#dirtyNotify = false;
|
|
270
|
+
#persistTimer;
|
|
271
|
+
#notifyTimer;
|
|
272
|
+
get #cacheOn() {
|
|
273
|
+
return !this.#source && this.config.cache.enabled;
|
|
274
|
+
}
|
|
275
|
+
async list(request, context) {
|
|
276
|
+
if (!this.config.enabled) return [];
|
|
277
|
+
if (!this.#cacheOn) return this.#listLegacy(request, context);
|
|
278
|
+
await this.#hydrate();
|
|
279
|
+
this.#kickRevalidation();
|
|
280
|
+
const query = request.query?.toLowerCase();
|
|
281
|
+
const filterQuery = (descriptors) => query ? descriptors.filter(
|
|
282
|
+
(descriptor) => `${descriptor.name} ${descriptor.description}`.toLowerCase().includes(query)
|
|
283
|
+
) : descriptors;
|
|
284
|
+
if (request.namespace) {
|
|
285
|
+
const server = await this.#resolveKnownServer(request.namespace);
|
|
286
|
+
if (!server) return [];
|
|
287
|
+
let entry = this.#servers.get(server);
|
|
288
|
+
if (!entry) {
|
|
289
|
+
entry = await this.#fetchServerTools(server).catch(() => void 0);
|
|
290
|
+
if (!entry) return [];
|
|
291
|
+
}
|
|
292
|
+
return filterQuery(entry.tools.map((tool) => this.#toolDescriptor(server, tool)));
|
|
293
|
+
}
|
|
294
|
+
return [
|
|
295
|
+
...managementDescriptors,
|
|
296
|
+
...filterQuery(this.sliceDescriptors())
|
|
297
|
+
];
|
|
298
|
+
}
|
|
299
|
+
async describe(actionName, context) {
|
|
300
|
+
const management = managementDescriptors.find((descriptor) => descriptor.name === actionName);
|
|
301
|
+
if (management) {
|
|
302
|
+
if (this.#source) throw new Error("MCP management is unavailable for a hosted source");
|
|
303
|
+
return management;
|
|
304
|
+
}
|
|
305
|
+
if (!this.config.enabled) return void 0;
|
|
306
|
+
if (!this.#cacheOn) {
|
|
307
|
+
const descriptor = await this.#describeLegacy(actionName, context);
|
|
308
|
+
if (this.#source && !descriptor) throw new Error(`Unknown hosted MCP action: ${actionName}`);
|
|
309
|
+
return descriptor;
|
|
310
|
+
}
|
|
311
|
+
const parsed = this.#parseToolName(actionName);
|
|
312
|
+
if (!parsed) return void 0;
|
|
313
|
+
await this.#hydrate();
|
|
314
|
+
const server = await this.#resolveKnownServer(parsed.server);
|
|
315
|
+
if (!server) return void 0;
|
|
316
|
+
let entry = this.#servers.get(server);
|
|
317
|
+
let tool = entry ? this.#resolveTool(entry.tools, parsed.tool) : void 0;
|
|
318
|
+
if (!tool) {
|
|
319
|
+
entry = await this.#fetchServerTools(server).catch(() => void 0);
|
|
320
|
+
tool = entry ? this.#resolveTool(entry.tools, parsed.tool) : void 0;
|
|
321
|
+
}
|
|
322
|
+
if (entry?.stale) this.#scheduleRevalidate([server]);
|
|
323
|
+
return tool ? this.#toolDescriptor(server, tool) : void 0;
|
|
324
|
+
}
|
|
325
|
+
async invoke(actionName, args, context) {
|
|
326
|
+
if (!this.config.enabled) throw new Error("MCP support is disabled in Fabric configuration");
|
|
327
|
+
if (this.#source && actionName.startsWith("$")) {
|
|
328
|
+
throw new Error("MCP management is unavailable for a hosted source");
|
|
329
|
+
}
|
|
330
|
+
if (actionName === "$servers") {
|
|
331
|
+
const runtime = await this.#getRuntime();
|
|
332
|
+
return runtime.listServers().map((server) => {
|
|
333
|
+
const definition = runtime.getDefinition(server);
|
|
334
|
+
if (!this.#cacheOn) {
|
|
335
|
+
return {
|
|
336
|
+
name: server,
|
|
337
|
+
description: definition.description ?? null,
|
|
338
|
+
transport: definition.command.kind
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
const entry = this.#servers.get(server);
|
|
342
|
+
return {
|
|
343
|
+
name: server,
|
|
344
|
+
description: definition.description ?? null,
|
|
345
|
+
transport: definition.command.kind,
|
|
346
|
+
tools: entry?.tools.length ?? 0,
|
|
347
|
+
stale: entry === void 0 || entry.stale
|
|
348
|
+
};
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
if (actionName === "$reload") {
|
|
352
|
+
await this.#resetRuntime();
|
|
353
|
+
if (this.#cacheOn) {
|
|
354
|
+
this.#servers.clear();
|
|
355
|
+
this.#pending.clear();
|
|
356
|
+
this.#recontacted.clear();
|
|
357
|
+
this.#hydration = void 0;
|
|
358
|
+
await this.#hydrate();
|
|
359
|
+
this.#kickRevalidation(true);
|
|
360
|
+
}
|
|
361
|
+
return { servers: (await this.#getRuntime()).listServers() };
|
|
362
|
+
}
|
|
363
|
+
if (actionName === "$register") {
|
|
364
|
+
if (!this.config.allowDynamicServers) {
|
|
365
|
+
throw new Error("Dynamic MCP server registration is disabled in Fabric configuration");
|
|
366
|
+
}
|
|
367
|
+
const definition = this.#serverDefinition(args);
|
|
368
|
+
const runtime = await this.#getRuntime();
|
|
369
|
+
runtime.registerDefinition(definition, { overwrite: args.overwrite === true });
|
|
370
|
+
this.#toolMetadata.delete(definition.name);
|
|
371
|
+
if (this.#cacheOn) {
|
|
372
|
+
void this.#hydrate().then(() => {
|
|
373
|
+
this.#servers.delete(definition.name);
|
|
374
|
+
this.#pending.set(definition.name, {
|
|
375
|
+
definitionHash: hashServerDefinition(definition),
|
|
376
|
+
transport: definition.command.kind,
|
|
377
|
+
description: definition.description ?? null,
|
|
378
|
+
ephemeral: true
|
|
379
|
+
});
|
|
380
|
+
this.#scheduleRevalidate([definition.name]);
|
|
381
|
+
}).catch(() => void 0);
|
|
382
|
+
}
|
|
383
|
+
return { registered: definition.name };
|
|
384
|
+
}
|
|
385
|
+
if (actionName === "$call") {
|
|
386
|
+
const server = String(args.server);
|
|
387
|
+
const tool = String(args.tool);
|
|
388
|
+
const toolArgs = typeof args.args === "object" && args.args !== null && !Array.isArray(args.args) ? args.args : {};
|
|
389
|
+
return this.#call(server, tool, toolArgs, context.signal);
|
|
390
|
+
}
|
|
391
|
+
const parsed = this.#parseToolName(actionName);
|
|
392
|
+
if (!parsed) throw new Error(`Invalid MCP action: ${actionName}`);
|
|
393
|
+
return this.#call(parsed.server, parsed.tool, args, context.signal);
|
|
394
|
+
}
|
|
395
|
+
async close() {
|
|
396
|
+
if (this.#closed) return;
|
|
397
|
+
this.#closed = true;
|
|
398
|
+
await this.#source?.close?.();
|
|
399
|
+
this.#revalidateQueue.length = 0;
|
|
400
|
+
this.#revalidateQueued.clear();
|
|
401
|
+
if (this.#notifyTimer) clearTimeout(this.#notifyTimer);
|
|
402
|
+
if (this.#persistTimer) clearTimeout(this.#persistTimer);
|
|
403
|
+
this.#notifyTimer = void 0;
|
|
404
|
+
this.#persistTimer = void 0;
|
|
405
|
+
if (this.#dirtyPersist) await this.#persistNow().catch(() => void 0);
|
|
406
|
+
await this.#resetRuntime();
|
|
407
|
+
}
|
|
408
|
+
// Fire-and-forget session warm-up: hydrate from the descriptor cache, then
|
|
409
|
+
// start the background revalidation policy. Never awaited by session start.
|
|
410
|
+
warmup() {
|
|
411
|
+
if (!this.config.enabled || !this.#cacheOn) return;
|
|
412
|
+
void this.#hydrate().then(() => this.#kickRevalidation()).catch(() => void 0);
|
|
413
|
+
}
|
|
414
|
+
// Provider-fidelity descriptors for everything currently known, cached or
|
|
415
|
+
// ephemeral.
|
|
416
|
+
sliceDescriptors() {
|
|
417
|
+
const descriptors = [];
|
|
418
|
+
for (const [server, entry] of this.#servers) {
|
|
419
|
+
for (const tool of entry.tools) descriptors.push(this.#toolDescriptor(server, tool));
|
|
420
|
+
}
|
|
421
|
+
return descriptors;
|
|
422
|
+
}
|
|
423
|
+
// Test/ops hook: await hydration and any in-flight background revalidation,
|
|
424
|
+
// then flush pending persistence and notifications.
|
|
425
|
+
async settle() {
|
|
426
|
+
await this.#hydrate();
|
|
427
|
+
while (this.#revalidating) await this.#revalidating;
|
|
428
|
+
if (this.#notifyTimer) {
|
|
429
|
+
clearTimeout(this.#notifyTimer);
|
|
430
|
+
this.#notifyTimer = void 0;
|
|
431
|
+
}
|
|
432
|
+
if (this.#dirtyNotify) this.#notifyNow();
|
|
433
|
+
if (this.#persistTimer) {
|
|
434
|
+
clearTimeout(this.#persistTimer);
|
|
435
|
+
this.#persistTimer = void 0;
|
|
436
|
+
}
|
|
437
|
+
if (this.#dirtyPersist) await this.#persistNow().catch(() => void 0);
|
|
438
|
+
}
|
|
439
|
+
async #call(serverName, toolName, args, signal) {
|
|
440
|
+
if (!this.#cacheOn) return this.#callLegacy(serverName, toolName, args, signal);
|
|
441
|
+
if (signal?.aborted) throw new Error("MCP call cancelled");
|
|
442
|
+
await this.#hydrate();
|
|
443
|
+
const server = await this.#resolveKnownServer(serverName);
|
|
444
|
+
if (!server) throw new Error(`Unknown MCP server: ${serverName}`);
|
|
445
|
+
let entry = this.#servers.get(server);
|
|
446
|
+
let tool = entry ? this.#resolveTool(entry.tools, toolName) : void 0;
|
|
447
|
+
if (!tool) {
|
|
448
|
+
entry = await this.#fetchServerTools(server).catch(() => void 0);
|
|
449
|
+
tool = entry ? this.#resolveTool(entry.tools, toolName) : void 0;
|
|
450
|
+
}
|
|
451
|
+
if (signal?.aborted) throw new Error("MCP call cancelled");
|
|
452
|
+
if (!tool) throw new Error(`Unknown MCP tool: ${serverName}.${toolName}`);
|
|
453
|
+
const runtime = await this.#getRuntime();
|
|
454
|
+
const firstContact = !this.#recontacted.has(server);
|
|
455
|
+
if (firstContact) this.#recontacted.add(server);
|
|
456
|
+
const operation = runtime.callTool(server, tool.name, {
|
|
457
|
+
args,
|
|
458
|
+
timeoutMs: this.config.callTimeoutMs,
|
|
459
|
+
disableOAuth: this.config.disableOAuth
|
|
460
|
+
});
|
|
461
|
+
try {
|
|
462
|
+
const result = await this.#withAbort(operation, signal, () => runtime.close(server));
|
|
463
|
+
return normalizeMcpResult(result);
|
|
464
|
+
} catch (error) {
|
|
465
|
+
const existing = this.#servers.get(server);
|
|
466
|
+
if (existing) {
|
|
467
|
+
existing.stale = true;
|
|
468
|
+
this.#schedulePersist();
|
|
469
|
+
this.#scheduleNotify();
|
|
470
|
+
}
|
|
471
|
+
this.#scheduleRevalidate([server]);
|
|
472
|
+
throw error;
|
|
473
|
+
} finally {
|
|
474
|
+
if (firstContact) this.#scheduleRevalidate([server]);
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
async #withAbort(operation, signal, abort) {
|
|
478
|
+
if (!signal) return operation;
|
|
479
|
+
if (signal.aborted) throw new Error("MCP call cancelled");
|
|
480
|
+
return new Promise((resolve, reject) => {
|
|
481
|
+
const onAbort = () => {
|
|
482
|
+
void Promise.resolve(abort()).catch(() => void 0);
|
|
483
|
+
reject(new Error("MCP call cancelled"));
|
|
484
|
+
};
|
|
485
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
486
|
+
void operation.then(
|
|
487
|
+
(value) => {
|
|
488
|
+
signal.removeEventListener("abort", onAbort);
|
|
489
|
+
resolve(value);
|
|
490
|
+
},
|
|
491
|
+
(error) => {
|
|
492
|
+
signal.removeEventListener("abort", onAbort);
|
|
493
|
+
reject(error);
|
|
494
|
+
}
|
|
495
|
+
);
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
// Session-opening hydration: adopt the persisted descriptor cache. Never
|
|
499
|
+
// spawns a server — config-only operations at worst.
|
|
500
|
+
#hydrate() {
|
|
501
|
+
if (!this.#cacheOn) return Promise.resolve();
|
|
502
|
+
this.#hydration ??= this.#hydrateInternal().catch(() => void 0);
|
|
503
|
+
return this.#hydration;
|
|
504
|
+
}
|
|
505
|
+
async #hydrateInternal() {
|
|
506
|
+
const generation = this.#generation;
|
|
507
|
+
const snapshot = this.#store ? await this.#store.load().catch(() => void 0) : void 0;
|
|
508
|
+
this.#layerStats = await statConfigLayers(this.cwd, this.config.configPath);
|
|
509
|
+
if (generation !== this.#generation) return;
|
|
510
|
+
if (snapshot && sameConfigLayers(snapshot.layers, this.#layerStats)) {
|
|
511
|
+
for (const [name, raw] of Object.entries(snapshot.servers)) {
|
|
512
|
+
const parsed = parseCachedServer(raw);
|
|
513
|
+
if (parsed) this.#servers.set(name, this.#toWorking(parsed, false));
|
|
514
|
+
}
|
|
515
|
+
this.#scheduleNotify();
|
|
516
|
+
return;
|
|
517
|
+
}
|
|
518
|
+
try {
|
|
519
|
+
const runtime = await this.#getRuntime();
|
|
520
|
+
for (const definition of runtime.getDefinitions()) {
|
|
521
|
+
const hash = hashServerDefinition(definition);
|
|
522
|
+
const recorded = snapshot?.servers[definition.name];
|
|
523
|
+
const parsed = recorded ? parseCachedServer(recorded) : void 0;
|
|
524
|
+
if (parsed && parsed.definitionHash === hash) {
|
|
525
|
+
this.#servers.set(definition.name, this.#toWorking(parsed, false));
|
|
526
|
+
} else {
|
|
527
|
+
const existing = this.#pending.get(definition.name);
|
|
528
|
+
this.#pending.set(definition.name, {
|
|
529
|
+
definitionHash: hash,
|
|
530
|
+
transport: definition.command.kind,
|
|
531
|
+
description: definition.description ?? null,
|
|
532
|
+
ephemeral: existing?.ephemeral ?? false
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
this.#dirtyPersist = true;
|
|
537
|
+
this.#schedulePersist();
|
|
538
|
+
} catch {
|
|
539
|
+
if (snapshot) {
|
|
540
|
+
for (const [name, raw] of Object.entries(snapshot.servers)) {
|
|
541
|
+
const parsed = parseCachedServer(raw);
|
|
542
|
+
if (parsed && !this.#servers.has(name)) {
|
|
543
|
+
this.#servers.set(name, this.#toWorking(parsed, false));
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
console.warn(
|
|
547
|
+
"[pi-fabric] MCP config could not be parsed; serving last-known cached MCP tools."
|
|
548
|
+
);
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
this.#scheduleNotify();
|
|
552
|
+
}
|
|
553
|
+
#toWorking(cached, ephemeral) {
|
|
554
|
+
return {
|
|
555
|
+
definitionHash: cached.definitionHash,
|
|
556
|
+
transport: cached.transport,
|
|
557
|
+
description: cached.description,
|
|
558
|
+
fetchedAt: cached.fetchedAt,
|
|
559
|
+
stale: cached.stale,
|
|
560
|
+
ephemeral,
|
|
561
|
+
tools: cached.tools.map((tool) => ({ ...tool }))
|
|
562
|
+
};
|
|
563
|
+
}
|
|
564
|
+
#kickRevalidation(forceAll = false) {
|
|
565
|
+
if (this.#closed || !this.#cacheOn) return;
|
|
566
|
+
if (!forceAll && this.#autoKicked) return;
|
|
567
|
+
this.#autoKicked = true;
|
|
568
|
+
const policy = this.config.cache.revalidate;
|
|
569
|
+
if (policy === "off" && !forceAll) return;
|
|
570
|
+
const targets = forceAll || policy === "all" ? [...this.#servers.keys(), ...this.#pending.keys()] : [...this.#pending.keys()];
|
|
571
|
+
this.#scheduleRevalidate(targets);
|
|
572
|
+
}
|
|
573
|
+
#scheduleRevalidate(servers) {
|
|
574
|
+
if (this.#closed || !this.#cacheOn) return;
|
|
575
|
+
for (const server of servers) {
|
|
576
|
+
if (this.#revalidateQueued.has(server)) continue;
|
|
577
|
+
this.#revalidateQueued.add(server);
|
|
578
|
+
this.#revalidateQueue.push(server);
|
|
579
|
+
}
|
|
580
|
+
if (this.#revalidating || this.#revalidateQueue.length === 0) return;
|
|
581
|
+
this.#revalidating = this.#drainRevalidation().catch(() => void 0).finally(() => {
|
|
582
|
+
this.#revalidating = void 0;
|
|
583
|
+
if (this.#revalidateQueue.length > 0 && !this.#closed) this.#scheduleRevalidate([]);
|
|
584
|
+
});
|
|
585
|
+
void this.#revalidating;
|
|
586
|
+
}
|
|
587
|
+
async #drainRevalidation() {
|
|
588
|
+
const generation = this.#generation;
|
|
589
|
+
const deadline = Date.now() + Math.max(1e3, this.config.cache.revalidateBudgetMs);
|
|
590
|
+
const perServerTimeout = Math.max(
|
|
591
|
+
MIN_REVALIDATE_SERVER_TIMEOUT_MS,
|
|
592
|
+
Math.min(REVALIDATE_SERVER_TIMEOUT_MS, this.config.cache.revalidateBudgetMs)
|
|
593
|
+
);
|
|
594
|
+
while (!this.#closed && generation === this.#generation) {
|
|
595
|
+
if (Date.now() > deadline) break;
|
|
596
|
+
const batch = [];
|
|
597
|
+
while (batch.length < REVALIDATE_CONCURRENCY && this.#revalidateQueue.length > 0) {
|
|
598
|
+
const next = this.#revalidateQueue.shift();
|
|
599
|
+
if (next === void 0) break;
|
|
600
|
+
this.#revalidateQueued.delete(next);
|
|
601
|
+
batch.push(next);
|
|
602
|
+
}
|
|
603
|
+
if (batch.length === 0) break;
|
|
604
|
+
const results = await Promise.allSettled(
|
|
605
|
+
batch.map((server) => this.#fetchServerTools(server, perServerTimeout))
|
|
606
|
+
);
|
|
607
|
+
results.forEach((result, index) => {
|
|
608
|
+
if (result.status !== "rejected") return;
|
|
609
|
+
const server = batch[index];
|
|
610
|
+
if (server === void 0) return;
|
|
611
|
+
const existing = this.#servers.get(server);
|
|
612
|
+
if (existing) {
|
|
613
|
+
existing.stale = true;
|
|
614
|
+
this.#schedulePersist();
|
|
615
|
+
this.#scheduleNotify();
|
|
616
|
+
}
|
|
617
|
+
});
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
// Live tool listing for exactly one server; on success updates the working
|
|
621
|
+
// copy and persistence. Used by the background revalidator and by explicit
|
|
622
|
+
// single-server fetches.
|
|
623
|
+
async #fetchServerTools(server, timeoutMs) {
|
|
624
|
+
const generation = this.#generation;
|
|
625
|
+
const runtime = await this.#getRuntime();
|
|
626
|
+
const listing = runtime.listTools(server, {
|
|
627
|
+
includeSchema: true,
|
|
628
|
+
disableOAuth: this.config.disableOAuth
|
|
629
|
+
});
|
|
630
|
+
const tools = timeoutMs === void 0 ? await listing : await withTimeout(listing, timeoutMs, () => {
|
|
631
|
+
void runtime.close(server).catch(() => void 0);
|
|
632
|
+
});
|
|
633
|
+
if (generation !== this.#generation || this.#closed) {
|
|
634
|
+
throw new Error(`MCP server listing superseded: ${server}`);
|
|
635
|
+
}
|
|
636
|
+
let definition;
|
|
637
|
+
try {
|
|
638
|
+
definition = runtime.getDefinition(server);
|
|
639
|
+
} catch {
|
|
640
|
+
this.#pending.delete(server);
|
|
641
|
+
this.#servers.delete(server);
|
|
642
|
+
this.#schedulePersist();
|
|
643
|
+
this.#scheduleNotify();
|
|
644
|
+
throw new Error(`Unknown MCP server: ${server}`);
|
|
645
|
+
}
|
|
646
|
+
const pending = this.#pending.get(server);
|
|
647
|
+
const entry = {
|
|
648
|
+
definitionHash: hashServerDefinition(definition),
|
|
649
|
+
transport: definition.command.kind,
|
|
650
|
+
description: definition.description ?? null,
|
|
651
|
+
fetchedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
652
|
+
stale: false,
|
|
653
|
+
ephemeral: pending?.ephemeral ?? false,
|
|
654
|
+
tools
|
|
655
|
+
};
|
|
656
|
+
this.#servers.set(server, entry);
|
|
657
|
+
this.#pending.delete(server);
|
|
658
|
+
this.#schedulePersist();
|
|
659
|
+
this.#scheduleNotify();
|
|
660
|
+
return entry;
|
|
661
|
+
}
|
|
662
|
+
// Resolve a requested (possibly sanitized) name to the raw server name
|
|
663
|
+
// across the working copy, pending set, and — as a config-only fallback —
|
|
664
|
+
// the runtime's definition list.
|
|
665
|
+
async #resolveKnownServer(requested) {
|
|
666
|
+
if (this.#servers.has(requested) || this.#pending.has(requested)) return requested;
|
|
667
|
+
const known = [...this.#servers.keys(), ...this.#pending.keys()];
|
|
668
|
+
const matches = known.filter((name) => sanitizeMcpRefPart(name) === requested);
|
|
669
|
+
if (matches.length === 1) return matches[0];
|
|
670
|
+
const runtime = await this.#getRuntime();
|
|
671
|
+
const servers = runtime.listServers();
|
|
672
|
+
if (servers.includes(requested)) return requested;
|
|
673
|
+
const sanitized = servers.filter((name) => sanitizeMcpRefPart(name) === requested);
|
|
674
|
+
return sanitized.length === 1 ? sanitized[0] : void 0;
|
|
675
|
+
}
|
|
676
|
+
#schedulePersist() {
|
|
677
|
+
if (!this.#store || this.#closed) return;
|
|
678
|
+
this.#dirtyPersist = true;
|
|
679
|
+
if (this.#persistTimer) return;
|
|
680
|
+
this.#persistTimer = setTimeout(() => {
|
|
681
|
+
this.#persistTimer = void 0;
|
|
682
|
+
void this.#persistNow().catch(() => void 0);
|
|
683
|
+
}, PERSIST_DEBOUNCE_MS);
|
|
684
|
+
this.#persistTimer.unref?.();
|
|
685
|
+
}
|
|
686
|
+
#persistNow() {
|
|
687
|
+
this.#dirtyPersist = false;
|
|
688
|
+
if (!this.#store) return Promise.resolve();
|
|
689
|
+
const servers = {};
|
|
690
|
+
for (const [name, entry] of this.#servers) {
|
|
691
|
+
if (entry.ephemeral) continue;
|
|
692
|
+
servers[name] = {
|
|
693
|
+
definitionHash: entry.definitionHash,
|
|
694
|
+
transport: entry.transport,
|
|
695
|
+
description: entry.description,
|
|
696
|
+
fetchedAt: entry.fetchedAt,
|
|
697
|
+
stale: entry.stale,
|
|
698
|
+
tools: entry.tools.map((tool) => {
|
|
699
|
+
const annotations = tool.annotations;
|
|
700
|
+
return {
|
|
701
|
+
name: tool.name,
|
|
702
|
+
...tool.description !== void 0 ? { description: tool.description } : {},
|
|
703
|
+
...tool.inputSchema !== void 0 ? { inputSchema: tool.inputSchema } : {},
|
|
704
|
+
...tool.outputSchema !== void 0 ? { outputSchema: tool.outputSchema } : {},
|
|
705
|
+
...annotations !== void 0 ? { annotations: { ...annotations } } : {}
|
|
706
|
+
};
|
|
707
|
+
})
|
|
708
|
+
};
|
|
709
|
+
}
|
|
710
|
+
return this.#store.save({
|
|
711
|
+
version: MCP_DESCRIPTOR_CACHE_VERSION,
|
|
712
|
+
layers: this.#layerStats,
|
|
713
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
714
|
+
servers
|
|
715
|
+
});
|
|
716
|
+
}
|
|
717
|
+
#scheduleNotify() {
|
|
718
|
+
if (this.#closed) return;
|
|
719
|
+
this.#dirtyNotify = true;
|
|
720
|
+
if (this.#notifyTimer) return;
|
|
721
|
+
this.#notifyTimer = setTimeout(() => {
|
|
722
|
+
this.#notifyTimer = void 0;
|
|
723
|
+
this.#notifyNow();
|
|
724
|
+
}, NOTIFY_DEBOUNCE_MS);
|
|
725
|
+
this.#notifyTimer.unref?.();
|
|
726
|
+
}
|
|
727
|
+
#notifyNow() {
|
|
728
|
+
if (!this.#dirtyNotify || this.#closed) return;
|
|
729
|
+
this.#dirtyNotify = false;
|
|
730
|
+
try {
|
|
731
|
+
this.#hooks.onSliceChanged?.(this.sliceDescriptors());
|
|
732
|
+
} catch {
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
async #getToolRuntime() {
|
|
736
|
+
if (this.#closed) throw new Error("MCP provider is closed");
|
|
737
|
+
return this.#source ?? this.#getRuntime();
|
|
738
|
+
}
|
|
739
|
+
async #getRuntime() {
|
|
740
|
+
if (this.#source) throw new Error("Hosted MCP cannot construct an ambient runtime");
|
|
741
|
+
if (this.#closed) throw new Error("MCP provider is closed");
|
|
742
|
+
if (this.#runtime) return this.#runtime;
|
|
743
|
+
const generation = this.#generation;
|
|
744
|
+
if (this.#runtimeCreation?.generation === generation) {
|
|
745
|
+
return this.#runtimeCreation.promise;
|
|
746
|
+
}
|
|
747
|
+
const promise = import("mcporter").then(({ createRuntime }) => createRuntime({
|
|
748
|
+
rootDir: this.cwd,
|
|
749
|
+
...this.config.configPath ? { configPath: this.config.configPath } : {},
|
|
750
|
+
clientInfo: { name: "pi-fabric", version: "0.1.0" }
|
|
751
|
+
})).then(async (runtime) => {
|
|
752
|
+
if (this.#closed || generation !== this.#generation) {
|
|
753
|
+
await runtime.close().catch(() => void 0);
|
|
754
|
+
throw new Error("MCP runtime creation was superseded");
|
|
755
|
+
}
|
|
756
|
+
this.#runtime = runtime;
|
|
757
|
+
return runtime;
|
|
758
|
+
});
|
|
759
|
+
const creation = { generation, promise };
|
|
760
|
+
this.#runtimeCreation = creation;
|
|
761
|
+
void promise.finally(() => {
|
|
762
|
+
if (this.#runtimeCreation === creation) this.#runtimeCreation = void 0;
|
|
763
|
+
}).catch(() => void 0);
|
|
764
|
+
return promise;
|
|
765
|
+
}
|
|
766
|
+
async #resetRuntime() {
|
|
767
|
+
this.#generation += 1;
|
|
768
|
+
const runtime = this.#runtime;
|
|
769
|
+
const creation = this.#runtimeCreation?.promise;
|
|
770
|
+
this.#runtime = void 0;
|
|
771
|
+
this.#runtimeCreation = void 0;
|
|
772
|
+
this.#toolMetadata.clear();
|
|
773
|
+
await Promise.allSettled([
|
|
774
|
+
runtime?.close() ?? Promise.resolve(),
|
|
775
|
+
creation?.then(() => void 0, () => void 0) ?? Promise.resolve()
|
|
776
|
+
]);
|
|
777
|
+
}
|
|
778
|
+
#serverDefinition(args) {
|
|
779
|
+
const name = String(args.name ?? "").trim();
|
|
780
|
+
if (!/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/.test(name)) {
|
|
781
|
+
throw new Error("Dynamic MCP server names may contain letters, numbers, dots, underscores, and hyphens");
|
|
782
|
+
}
|
|
783
|
+
const description = typeof args.description === "string" ? args.description : void 0;
|
|
784
|
+
const env = this.#stringRecord(args.env);
|
|
785
|
+
if (typeof args.command === "string" && args.command.trim()) {
|
|
786
|
+
const commandArgs = Array.isArray(args.args) ? args.args.filter((value) => typeof value === "string") : [];
|
|
787
|
+
return {
|
|
788
|
+
name,
|
|
789
|
+
...description ? { description } : {},
|
|
790
|
+
command: {
|
|
791
|
+
kind: "stdio",
|
|
792
|
+
command: args.command,
|
|
793
|
+
args: commandArgs,
|
|
794
|
+
cwd: path2.resolve(this.cwd, typeof args.cwd === "string" ? args.cwd : ".")
|
|
795
|
+
},
|
|
796
|
+
...env ? { env } : {}
|
|
797
|
+
};
|
|
798
|
+
}
|
|
799
|
+
if (typeof args.baseUrl === "string" && args.baseUrl.trim()) {
|
|
800
|
+
const headers = this.#stringRecord(args.headers);
|
|
801
|
+
return {
|
|
802
|
+
name,
|
|
803
|
+
...description ? { description } : {},
|
|
804
|
+
command: {
|
|
805
|
+
kind: "http",
|
|
806
|
+
url: new URL(args.baseUrl),
|
|
807
|
+
...headers ? { headers } : {}
|
|
808
|
+
},
|
|
809
|
+
...env ? { env } : {}
|
|
810
|
+
};
|
|
811
|
+
}
|
|
812
|
+
throw new Error("Dynamic MCP registration requires either command or baseUrl");
|
|
813
|
+
}
|
|
814
|
+
#stringRecord(value) {
|
|
815
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) return void 0;
|
|
816
|
+
const entries = Object.entries(value);
|
|
817
|
+
if (entries.some((entry) => typeof entry[1] !== "string")) {
|
|
818
|
+
throw new Error("MCP environment and header values must be strings");
|
|
819
|
+
}
|
|
820
|
+
return Object.fromEntries(entries);
|
|
821
|
+
}
|
|
822
|
+
#resolveServerName(runtime, requested) {
|
|
823
|
+
const servers = runtime.listServers();
|
|
824
|
+
if (servers.includes(requested)) return requested;
|
|
825
|
+
const matches = servers.filter((server) => sanitizeMcpRefPart(server) === requested);
|
|
826
|
+
return matches.length === 1 ? matches[0] : void 0;
|
|
827
|
+
}
|
|
828
|
+
#resolveTool(tools, requested) {
|
|
829
|
+
const exact = tools.find((tool) => tool.name === requested);
|
|
830
|
+
if (exact) return exact;
|
|
831
|
+
const matches = tools.filter((tool) => sanitizeMcpRefPart(tool.name) === requested);
|
|
832
|
+
return matches.length === 1 ? matches[0] : void 0;
|
|
833
|
+
}
|
|
834
|
+
#parseToolName(actionName) {
|
|
835
|
+
const separator = actionName.indexOf(".");
|
|
836
|
+
if (separator <= 0 || separator === actionName.length - 1) return void 0;
|
|
837
|
+
return { server: actionName.slice(0, separator), tool: actionName.slice(separator + 1) };
|
|
838
|
+
}
|
|
839
|
+
#toolDescriptor(server, tool) {
|
|
840
|
+
const annotations = tool.annotations;
|
|
841
|
+
return {
|
|
842
|
+
name: `${server}.${tool.name}`,
|
|
843
|
+
description: tool.description ?? `${tool.name} on MCP server ${server}`,
|
|
844
|
+
inputSchema: normalizeSchema(tool.inputSchema),
|
|
845
|
+
...tool.outputSchema ? { outputSchema: normalizeSchema(tool.outputSchema) } : {},
|
|
846
|
+
risk: "network",
|
|
847
|
+
namespace: server,
|
|
848
|
+
...annotations ? { annotations: { ...annotations } } : {}
|
|
849
|
+
};
|
|
850
|
+
}
|
|
851
|
+
// Live-everything path preserved for mcp.cache.enabled: false — the
|
|
852
|
+
// pre-cache behavior with its 60s in-process metadata TTL.
|
|
853
|
+
async #listLegacy(request, _context) {
|
|
854
|
+
const runtime = await this.#getToolRuntime();
|
|
855
|
+
const selected = request.namespace ? this.#resolveServerName(runtime, request.namespace) : void 0;
|
|
856
|
+
const servers = request.namespace ? selected ? [selected] : [] : runtime.listServers();
|
|
857
|
+
const settled = await Promise.allSettled(
|
|
858
|
+
servers.map(async (server) => {
|
|
859
|
+
const tools = await this.#listToolsLegacy(runtime, server);
|
|
860
|
+
return tools.map((tool) => this.#toolDescriptor(server, tool));
|
|
861
|
+
})
|
|
862
|
+
);
|
|
863
|
+
const descriptors = settled.flatMap(
|
|
864
|
+
(entry) => entry.status === "fulfilled" ? entry.value : []
|
|
865
|
+
);
|
|
866
|
+
const query = request.query?.toLowerCase();
|
|
867
|
+
const filtered = query ? descriptors.filter(
|
|
868
|
+
(descriptor) => `${descriptor.name} ${descriptor.description}`.toLowerCase().includes(query)
|
|
869
|
+
) : descriptors;
|
|
870
|
+
return request.namespace || this.#source ? filtered : [...managementDescriptors, ...filtered];
|
|
871
|
+
}
|
|
872
|
+
async #describeLegacy(actionName, _context) {
|
|
873
|
+
const parsed = this.#parseToolName(actionName);
|
|
874
|
+
if (!parsed) return void 0;
|
|
875
|
+
const runtime = await this.#getToolRuntime();
|
|
876
|
+
const server = this.#resolveServerName(runtime, parsed.server);
|
|
877
|
+
if (!server) return void 0;
|
|
878
|
+
const tool = await this.#findToolLegacy(runtime, server, parsed.tool);
|
|
879
|
+
return tool ? this.#toolDescriptor(server, tool) : void 0;
|
|
880
|
+
}
|
|
881
|
+
async #callLegacy(serverName, toolName, args, signal) {
|
|
882
|
+
if (signal?.aborted) throw new Error("MCP call cancelled");
|
|
883
|
+
const runtime = await this.#getToolRuntime();
|
|
884
|
+
const server = this.#resolveServerName(runtime, serverName);
|
|
885
|
+
if (!server) throw new Error(`Unknown MCP server: ${serverName}`);
|
|
886
|
+
const tool = await this.#findToolLegacy(runtime, server, toolName);
|
|
887
|
+
if (signal?.aborted) throw new Error("MCP call cancelled");
|
|
888
|
+
if (!tool) throw new Error(`Unknown MCP tool: ${serverName}.${toolName}`);
|
|
889
|
+
const operation = runtime.callTool(server, tool.name, {
|
|
890
|
+
args,
|
|
891
|
+
...this.#source && signal ? { signal } : {},
|
|
892
|
+
timeoutMs: this.config.callTimeoutMs,
|
|
893
|
+
disableOAuth: this.config.disableOAuth
|
|
894
|
+
});
|
|
895
|
+
try {
|
|
896
|
+
const result = await this.#withAbort(operation, signal, () => runtime.close?.(server));
|
|
897
|
+
return normalizeMcpResult(result);
|
|
898
|
+
} catch (error) {
|
|
899
|
+
this.#toolMetadata.delete(server);
|
|
900
|
+
throw error;
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
async #listToolsLegacy(runtime, server, refresh = false) {
|
|
904
|
+
if (this.#source) return this.#source.listTools(server);
|
|
905
|
+
const cached = this.#toolMetadata.get(server);
|
|
906
|
+
if (!refresh && cached && cached.expiresAt > Date.now()) return cached.promise;
|
|
907
|
+
const promise = runtime.listTools(server, {
|
|
908
|
+
includeSchema: true,
|
|
909
|
+
disableOAuth: this.config.disableOAuth
|
|
910
|
+
});
|
|
911
|
+
const entry = { expiresAt: Date.now() + TOOL_METADATA_TTL_MS, promise };
|
|
912
|
+
this.#toolMetadata.set(server, entry);
|
|
913
|
+
try {
|
|
914
|
+
return await promise;
|
|
915
|
+
} catch (error) {
|
|
916
|
+
if (this.#toolMetadata.get(server) === entry) this.#toolMetadata.delete(server);
|
|
917
|
+
throw error;
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
async #findToolLegacy(runtime, server, requested) {
|
|
921
|
+
const cached = this.#resolveTool(await this.#listToolsLegacy(runtime, server), requested);
|
|
922
|
+
if (cached) return cached;
|
|
923
|
+
return this.#resolveTool(await this.#listToolsLegacy(runtime, server, true), requested);
|
|
924
|
+
}
|
|
925
|
+
};
|
|
926
|
+
|
|
927
|
+
export {
|
|
928
|
+
McpDescriptorCacheStore,
|
|
929
|
+
McpProvider
|
|
930
|
+
};
|
|
931
|
+
//# sourceMappingURL=chunk-RRGTKHXZ.js.map
|