omp-fabric 0.85.0
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 +170 -0
- package/THIRD_PARTY_NOTICES.md +33 -0
- package/dist/activity/store.d.ts +32 -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/manager.d.ts +175 -0
- package/dist/actors/manager.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/types.d.ts +211 -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 +127 -0
- package/dist/agents/compact-control.js.map +7 -0
- package/dist/agents/constants.d.ts +5 -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.d.ts +19 -0
- package/dist/agents/handoff.d.ts.map +1 -0
- package/dist/agents/manager.d.ts +68 -0
- package/dist/agents/manager.d.ts.map +1 -0
- package/dist/agents/omp-binary.d.ts +7 -0
- package/dist/agents/omp-binary.d.ts.map +1 -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/session-export.d.ts +9 -0
- package/dist/agents/session-export.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 +29 -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 +251 -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/async-settlement.d.ts +4 -0
- package/dist/async-settlement.d.ts.map +1 -0
- package/dist/audit/details.d.ts +82 -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 +95 -0
- package/dist/audit/trace.d.ts.map +1 -0
- package/dist/capture/catalog.d.ts +29 -0
- package/dist/capture/catalog.d.ts.map +1 -0
- package/dist/capture/interceptor.d.ts +21 -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-2GQC324T.js +5001 -0
- package/dist/chunks/chunk-2GQC324T.js.map +7 -0
- package/dist/chunks/chunk-2KEWFW56.js +1229 -0
- package/dist/chunks/chunk-2KEWFW56.js.map +7 -0
- package/dist/chunks/chunk-3J7BKUNG.js +354 -0
- package/dist/chunks/chunk-3J7BKUNG.js.map +7 -0
- package/dist/chunks/chunk-4A4MVZQW.js +253 -0
- package/dist/chunks/chunk-4A4MVZQW.js.map +7 -0
- package/dist/chunks/chunk-4HQDSTHN.js +221 -0
- package/dist/chunks/chunk-4HQDSTHN.js.map +7 -0
- package/dist/chunks/chunk-4LEDA76O.js +688 -0
- package/dist/chunks/chunk-4LEDA76O.js.map +7 -0
- package/dist/chunks/chunk-5GTPD4BA.js +1318 -0
- package/dist/chunks/chunk-5GTPD4BA.js.map +7 -0
- package/dist/chunks/chunk-5IWFSDU5.js +87 -0
- package/dist/chunks/chunk-5IWFSDU5.js.map +7 -0
- package/dist/chunks/chunk-6N4XGAZY.js +21 -0
- package/dist/chunks/chunk-6N4XGAZY.js.map +7 -0
- package/dist/chunks/chunk-6QBPSZJ5.js +647 -0
- package/dist/chunks/chunk-6QBPSZJ5.js.map +7 -0
- package/dist/chunks/chunk-6X6WUU2K.js +73 -0
- package/dist/chunks/chunk-6X6WUU2K.js.map +7 -0
- package/dist/chunks/chunk-7363CD5A.js +38 -0
- package/dist/chunks/chunk-7363CD5A.js.map +7 -0
- package/dist/chunks/chunk-77FQHHZD.js +231 -0
- package/dist/chunks/chunk-77FQHHZD.js.map +7 -0
- package/dist/chunks/chunk-7BIA5BJN.js +112 -0
- package/dist/chunks/chunk-7BIA5BJN.js.map +7 -0
- package/dist/chunks/chunk-7BOAOKWH.js +64 -0
- package/dist/chunks/chunk-7BOAOKWH.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-7VIQNUPS.js +17 -0
- package/dist/chunks/chunk-7VIQNUPS.js.map +7 -0
- package/dist/chunks/chunk-CT2AJ2UI.js +225 -0
- package/dist/chunks/chunk-CT2AJ2UI.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-ED3BRM6P.js +17 -0
- package/dist/chunks/chunk-ED3BRM6P.js.map +7 -0
- package/dist/chunks/chunk-G2IBGGBM.js +42 -0
- package/dist/chunks/chunk-G2IBGGBM.js.map +7 -0
- package/dist/chunks/chunk-GKOFZ76R.js +1596 -0
- package/dist/chunks/chunk-GKOFZ76R.js.map +7 -0
- package/dist/chunks/chunk-HDJBUXDX.js +1102 -0
- package/dist/chunks/chunk-HDJBUXDX.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-JHKOG5GS.js +187 -0
- package/dist/chunks/chunk-JHKOG5GS.js.map +7 -0
- package/dist/chunks/chunk-JP4LIZFT.js +1334 -0
- package/dist/chunks/chunk-JP4LIZFT.js.map +7 -0
- package/dist/chunks/chunk-JSBTB3P6.js +127 -0
- package/dist/chunks/chunk-JSBTB3P6.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-KIH3KLZU.js +95 -0
- package/dist/chunks/chunk-KIH3KLZU.js.map +7 -0
- package/dist/chunks/chunk-KIREBD2V.js +2208 -0
- package/dist/chunks/chunk-KIREBD2V.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-NCPJZXLM.js +57 -0
- package/dist/chunks/chunk-NCPJZXLM.js.map +7 -0
- package/dist/chunks/chunk-OJZNMROB.js +195 -0
- package/dist/chunks/chunk-OJZNMROB.js.map +7 -0
- package/dist/chunks/chunk-OPTP4PSE.js +469 -0
- package/dist/chunks/chunk-OPTP4PSE.js.map +7 -0
- package/dist/chunks/chunk-QPXSCMTG.js +24 -0
- package/dist/chunks/chunk-QPXSCMTG.js.map +7 -0
- package/dist/chunks/chunk-ROKMBLGN.js +1265 -0
- package/dist/chunks/chunk-ROKMBLGN.js.map +7 -0
- package/dist/chunks/chunk-SXMWV447.js +2445 -0
- package/dist/chunks/chunk-SXMWV447.js.map +7 -0
- package/dist/chunks/chunk-T5ZA5YRU.js +786 -0
- package/dist/chunks/chunk-T5ZA5YRU.js.map +7 -0
- package/dist/chunks/chunk-T6OAX4FO.js +1835 -0
- package/dist/chunks/chunk-T6OAX4FO.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-UOSJZXJV.js +142 -0
- package/dist/chunks/chunk-UOSJZXJV.js.map +7 -0
- package/dist/chunks/chunk-UPCARIJP.js +6627 -0
- package/dist/chunks/chunk-UPCARIJP.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-XU5Z4JCQ.js +297 -0
- package/dist/chunks/chunk-XU5Z4JCQ.js.map +7 -0
- package/dist/chunks/chunk-YWEXP724.js +427 -0
- package/dist/chunks/chunk-YWEXP724.js.map +7 -0
- package/dist/chunks/chunk-YZZIKJX6.js +60 -0
- package/dist/chunks/chunk-YZZIKJX6.js.map +7 -0
- package/dist/chunks/chunk-ZNAJDPT7.js +2203 -0
- package/dist/chunks/chunk-ZNAJDPT7.js.map +7 -0
- package/dist/chunks/chunk-ZTM45GH5.js +163 -0
- package/dist/chunks/chunk-ZTM45GH5.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 +98 -0
- package/dist/compaction/hook.d.ts.map +1 -0
- package/dist/compaction/hook.js +19 -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-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 +269 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/core/action-registry.d.ts +159 -0
- package/dist/core/action-registry.d.ts.map +1 -0
- package/dist/core/action-registry.js +17 -0
- package/dist/core/action-registry.js.map +7 -0
- package/dist/core/action-repair.d.ts +20 -0
- package/dist/core/action-repair.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 +30 -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 +13 -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/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/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/omp-bash-error.d.ts +11 -0
- package/dist/core/omp-bash-error.d.ts.map +1 -0
- package/dist/core/omp-tools.d.ts +9 -0
- package/dist/core/omp-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 +6 -0
- package/dist/core/session-context.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 +12 -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 +52 -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 +7 -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 +51 -0
- package/dist/entropy/compiled-surface.d.ts.map +1 -0
- package/dist/entropy/compiler.d.ts +28 -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 +15 -0
- package/dist/entropy/index.d.ts.map +1 -0
- package/dist/entropy/index.js +172 -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/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 +13 -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 +35 -0
- package/dist/entropy/trial.d.ts.map +1 -0
- package/dist/entropy/types.d.ts +158 -0
- package/dist/entropy/types.d.ts.map +1 -0
- package/dist/execution-service.d.ts +63 -0
- package/dist/execution-service.d.ts.map +1 -0
- package/dist/fabric-exec-arguments.d.ts +5 -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 +90 -0
- package/dist/fabric-runtime-state.d.ts.map +1 -0
- package/dist/fabric-runtime-state.js +13060 -0
- package/dist/fabric-runtime-state.js.map +7 -0
- package/dist/fabric-state.d.ts +89 -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 +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5719 -0
- package/dist/index.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/memory/context.d.ts +112 -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 +23 -0
- package/dist/memory/discovery.js.map +7 -0
- package/dist/memory/index.d.ts +107 -0
- package/dist/memory/index.d.ts.map +1 -0
- package/dist/memory/lineage.d.ts +20 -0
- package/dist/memory/lineage.d.ts.map +1 -0
- package/dist/memory/normalize.d.ts +170 -0
- package/dist/memory/normalize.d.ts.map +1 -0
- package/dist/memory/normalize.js +22 -0
- package/dist/memory/normalize.js.map +7 -0
- package/dist/memory/regex.d.ts +19 -0
- package/dist/memory/regex.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 +22 -0
- package/dist/memory/search.js.map +7 -0
- package/dist/memory/tokenize.d.ts +24 -0
- package/dist/memory/tokenize.d.ts.map +1 -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 +60 -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 +45 -0
- package/dist/prewalk/handoff.d.ts.map +1 -0
- package/dist/protocol.d.ts +273 -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-provider.d.ts +59 -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/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 +27 -0
- package/dist/providers/mcp-provider.d.ts.map +1 -0
- package/dist/providers/memory-provider.d.ts +35 -0
- package/dist/providers/memory-provider.d.ts.map +1 -0
- package/dist/providers/memory-provider.js +16 -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/omp-bash-cwd.d.ts +31 -0
- package/dist/providers/omp-bash-cwd.d.ts.map +1 -0
- package/dist/providers/omp-tools-provider.d.ts +15 -0
- package/dist/providers/omp-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/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 +25 -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 +152 -0
- package/dist/residency/launcher.js.map +7 -0
- package/dist/residency/omp-entry.d.ts +3 -0
- package/dist/residency/omp-entry.d.ts.map +1 -0
- package/dist/residency/omp-entry.js +41 -0
- package/dist/residency/omp-entry.js.map +7 -0
- package/dist/residency/protocol.d.ts +119 -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 +291 -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/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 +226 -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 +35 -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/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 +319 -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/quickjs-runtime.d.ts +24 -0
- package/dist/runtime/quickjs-runtime.d.ts.map +1 -0
- package/dist/runtime/quickjs-runtime.js +12 -0
- package/dist/runtime/quickjs-runtime.js.map +7 -0
- package/dist/runtime/type-checker.d.ts +21 -0
- package/dist/runtime/type-checker.d.ts.map +1 -0
- package/dist/runtime/type-checker.js +15 -0
- package/dist/runtime/type-checker.js.map +7 -0
- package/dist/runtime-paths.d.ts +7 -0
- package/dist/runtime-paths.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/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/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 +39 -0
- package/dist/speculation/store.d.ts.map +1 -0
- package/dist/speculation/stream-tap.d.ts +27 -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/code-preview-shell.d.ts +26 -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 +15 -0
- package/dist/ui/conversation-chrome.d.ts.map +1 -0
- package/dist/ui/conversation-chrome.js +10 -0
- package/dist/ui/conversation-chrome.js.map +7 -0
- package/dist/ui/conversation-native-reader.d.ts +106 -0
- package/dist/ui/conversation-native-reader.d.ts.map +1 -0
- package/dist/ui/conversation-native-reader.js +784 -0
- package/dist/ui/conversation-native-reader.js.map +7 -0
- package/dist/ui/conversation-queue-store.d.ts +12 -0
- package/dist/ui/conversation-queue-store.d.ts.map +1 -0
- package/dist/ui/conversation-queue.d.ts +242 -0
- package/dist/ui/conversation-queue.d.ts.map +1 -0
- package/dist/ui/conversation-render.d.ts +45 -0
- package/dist/ui/conversation-render.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 +170 -0
- package/dist/ui/conversation.d.ts.map +1 -0
- package/dist/ui/conversation.js +1868 -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-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 +188 -0
- package/dist/ui/dashboard.d.ts.map +1 -0
- package/dist/ui/dashboard.js +4604 -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 +8 -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 +2 -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/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.d.ts +57 -0
- package/dist/ui/settings.d.ts.map +1 -0
- package/dist/ui/settings.js +1908 -0
- package/dist/ui/settings.js.map +7 -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 +7 -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/symbol-theme.d.ts +3 -0
- package/dist/ui/symbol-theme.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/options.d.ts +3 -0
- package/dist/worker/options.d.ts.map +1 -0
- package/dist/worker/options.js +104 -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 +123 -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 +1061 -0
- package/dist/worker.js.map +7 -0
- package/docs/agents.md +564 -0
- package/docs/architecture.md +139 -0
- package/docs/audit-trace.md +116 -0
- package/docs/certification.md +134 -0
- package/docs/compaction.md +332 -0
- package/docs/component-calculus.md +191 -0
- package/docs/components.md +329 -0
- package/docs/configuration.md +478 -0
- package/docs/entropy.md +396 -0
- package/docs/interface.md +149 -0
- package/docs/memory-recall.md +614 -0
- package/docs/programmatic-compaction.md +207 -0
- package/docs/provider-component-calculus.md +378 -0
- package/docs/providers.md +109 -0
- package/docs/repairs.md +69 -0
- package/docs/residency-runtime.md +82 -0
- package/docs/schema-enforcement.md +166 -0
- package/docs/skills.md +48 -0
- package/docs/speculation.md +132 -0
- package/docs/state-layer.md +197 -0
- package/package.json +116 -0
- package/skills/fabric-advisor/SKILL.md +29 -0
- package/skills/fabric-ambient/SKILL.md +44 -0
- package/skills/fabric-ambient/references/setup.md +90 -0
- package/skills/fabric-council/SKILL.md +94 -0
- package/skills/fabric-exec/SKILL.md +123 -0
- package/skills/fabric-exec/references/agents.md +211 -0
- package/skills/fabric-exec/references/mcp.md +49 -0
- package/skills/fabric-exec/references/mesh.md +51 -0
- package/skills/fabric-fusion/SKILL.md +332 -0
- package/skills/fabric-guide/SKILL.md +28 -0
- package/skills/fabric-rlm/SKILL.md +284 -0
- package/skills/fabric-schema/SKILL.md +121 -0
- package/skills/fabric-spec/SKILL.md +42 -0
- package/skills/fabric-supervisor/SKILL.md +37 -0
- package/skills/fabric-swarm/SKILL.md +80 -0
- package/skills/fabric-workflow/SKILL.md +133 -0
|
@@ -0,0 +1,688 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ActorDirectory,
|
|
3
|
+
AgentManager,
|
|
4
|
+
FabricControlPlane,
|
|
5
|
+
LifecycleBroker,
|
|
6
|
+
MeshStore,
|
|
7
|
+
ParticipantDirectory,
|
|
8
|
+
actorParticipantRecord,
|
|
9
|
+
agentParticipantRecords,
|
|
10
|
+
lifecycleSourceIdentity,
|
|
11
|
+
loadModelUsage,
|
|
12
|
+
useBudgetLedger
|
|
13
|
+
} from "./chunk-UPCARIJP.js";
|
|
14
|
+
import {
|
|
15
|
+
normalizeModelAliases,
|
|
16
|
+
resolveAvailableOmpModel
|
|
17
|
+
} from "./chunk-ROKMBLGN.js";
|
|
18
|
+
import {
|
|
19
|
+
parseFabricOwnedModelGuidance,
|
|
20
|
+
resolveFabricModelGuidance
|
|
21
|
+
} from "./chunk-77FQHHZD.js";
|
|
22
|
+
import {
|
|
23
|
+
RESIDENT_HOST_FORMAT,
|
|
24
|
+
residentDeliveryPrefix,
|
|
25
|
+
residentHostId
|
|
26
|
+
} from "./chunk-ED3BRM6P.js";
|
|
27
|
+
import {
|
|
28
|
+
writeJsonAtomic
|
|
29
|
+
} from "./chunk-KAD7UWT2.js";
|
|
30
|
+
|
|
31
|
+
// src/residency/host.ts
|
|
32
|
+
import { randomUUID } from "node:crypto";
|
|
33
|
+
import fs from "node:fs";
|
|
34
|
+
import path from "node:path";
|
|
35
|
+
import { fileURLToPath } from "node:url";
|
|
36
|
+
var REQUEST_POLL_MS = 50;
|
|
37
|
+
var IDLE_EXIT_MS = 3e4;
|
|
38
|
+
var COMPLETION_MAX_CHARS = 8e3;
|
|
39
|
+
var delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
40
|
+
var atomicWrite = (filePath, value) => {
|
|
41
|
+
writeJsonAtomic(filePath, value, { space: 2 });
|
|
42
|
+
};
|
|
43
|
+
var readJson = (filePath) => {
|
|
44
|
+
try {
|
|
45
|
+
return JSON.parse(fs.readFileSync(filePath, "utf8"));
|
|
46
|
+
} catch {
|
|
47
|
+
return void 0;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
var errorMessage = (error) => error instanceof Error ? error.message : String(error);
|
|
51
|
+
var processAlive = (pid) => {
|
|
52
|
+
if (!Number.isSafeInteger(pid) || pid <= 0) return false;
|
|
53
|
+
try {
|
|
54
|
+
process.kill(pid, 0);
|
|
55
|
+
return true;
|
|
56
|
+
} catch (error) {
|
|
57
|
+
return error instanceof Error && "code" in error && error.code === "EPERM";
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
var ResidentHostAlreadyRunning = class extends Error {
|
|
61
|
+
};
|
|
62
|
+
var parseResidentHostConfigPath = (argv) => {
|
|
63
|
+
const index = argv.indexOf("--config");
|
|
64
|
+
const value = index >= 0 ? argv[index + 1] : void 0;
|
|
65
|
+
if (!value) throw new Error("Missing resident host argument: --config");
|
|
66
|
+
return path.resolve(value);
|
|
67
|
+
};
|
|
68
|
+
var validateResidentHostConfig = (value, configPath) => {
|
|
69
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
70
|
+
throw new Error("Invalid Fabric resident host config");
|
|
71
|
+
}
|
|
72
|
+
const config = value;
|
|
73
|
+
if (config.format !== RESIDENT_HOST_FORMAT || typeof config.rootId !== "string" || typeof config.sessionId !== "string" || typeof config.cwd !== "string" || typeof config.projectRoot !== "string" || typeof config.meshRoot !== "string" || typeof config.actorRoot !== "string" || config.sessionActorRoot !== void 0 && typeof config.sessionActorRoot !== "string" || typeof config.residencyRoot !== "string" || typeof config.fullCodeMode !== "boolean" || typeof config.agents !== "object" || config.agents === null || typeof config.mesh !== "object" || config.mesh === null || typeof config.retention !== "object" || config.retention === null || typeof config.workerPath !== "string" || typeof config.fabricExtensionPath !== "string" || typeof config.ompBinary !== "string" || typeof config.claudeBinary !== "string" || typeof config.vedaBinary !== "string") {
|
|
74
|
+
throw new Error("Fabric resident host config is incomplete");
|
|
75
|
+
}
|
|
76
|
+
if (path.resolve(config.residencyRoot) !== path.dirname(configPath)) {
|
|
77
|
+
throw new Error("Fabric resident host config is outside its residency root");
|
|
78
|
+
}
|
|
79
|
+
if (!config.mesh.enabled) throw new Error("Durable residency requires the Fabric mesh");
|
|
80
|
+
return config;
|
|
81
|
+
};
|
|
82
|
+
var ResidentHost = class {
|
|
83
|
+
constructor(config, onIdle = () => {
|
|
84
|
+
}) {
|
|
85
|
+
this.config = config;
|
|
86
|
+
this.onIdle = onIdle;
|
|
87
|
+
this.hostId = residentHostId(config.rootId);
|
|
88
|
+
this.identity = { id: this.hostId, name: "Fabric resident host", kind: "agent" };
|
|
89
|
+
this.#ownerPath = path.join(config.residencyRoot, "owner.json");
|
|
90
|
+
this.#lockPath = path.join(config.residencyRoot, "host.lock");
|
|
91
|
+
this.#errorPath = path.join(config.residencyRoot, "error.json");
|
|
92
|
+
this.#requestsPath = path.join(config.residencyRoot, "requests");
|
|
93
|
+
this.#processingPath = path.join(config.residencyRoot, "processing");
|
|
94
|
+
this.#responsesPath = path.join(config.residencyRoot, "responses");
|
|
95
|
+
this.#agentsPath = path.join(config.residencyRoot, "agents");
|
|
96
|
+
this.#deliveryPrefix = residentDeliveryPrefix(config.rootId);
|
|
97
|
+
this.mesh = new MeshStore(config.meshRoot, config.mesh.maxEventBytes, config.mesh.maxReadEvents);
|
|
98
|
+
this.participants = new ParticipantDirectory(this.mesh, {
|
|
99
|
+
enabled: true,
|
|
100
|
+
hostId: this.hostId,
|
|
101
|
+
rootId: config.rootId,
|
|
102
|
+
identity: this.identity
|
|
103
|
+
});
|
|
104
|
+
this.control = new FabricControlPlane(this.mesh, this.identity, {
|
|
105
|
+
enabled: true,
|
|
106
|
+
hostId: this.hostId,
|
|
107
|
+
pollMs: config.mesh.actorPollMs
|
|
108
|
+
});
|
|
109
|
+
if (config.agents.budgetUsd > 0) {
|
|
110
|
+
const budgetFile = path.join(config.residencyRoot, "budget.jsonl");
|
|
111
|
+
fs.mkdirSync(path.dirname(budgetFile), { recursive: true, mode: 448 });
|
|
112
|
+
if (!fs.existsSync(budgetFile)) fs.writeFileSync(budgetFile, "", { mode: 384 });
|
|
113
|
+
useBudgetLedger({
|
|
114
|
+
budget: config.agents.budgetUsd,
|
|
115
|
+
file: budgetFile,
|
|
116
|
+
id: this.hostId
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
const guidanceConfigPath = path.join(config.residencyRoot, "config.json");
|
|
120
|
+
const currentConfig = () => readJson(guidanceConfigPath) ?? config;
|
|
121
|
+
const currentModelGuidance = () => parseFabricOwnedModelGuidance(currentConfig().modelGuidance ?? config.modelGuidance);
|
|
122
|
+
const resolveResidentOmpModel = (selector) => {
|
|
123
|
+
const state = currentConfig().models ?? config.models;
|
|
124
|
+
const available = Array.isArray(state?.available) ? state.available.flatMap(
|
|
125
|
+
(candidate) => typeof candidate?.provider === "string" && typeof candidate.id === "string" ? [{
|
|
126
|
+
provider: candidate.provider,
|
|
127
|
+
id: candidate.id,
|
|
128
|
+
...typeof candidate.name === "string" ? { name: candidate.name } : {}
|
|
129
|
+
}] : []
|
|
130
|
+
) : [];
|
|
131
|
+
const query = selector?.trim() || state?.defaultModel?.trim() || "";
|
|
132
|
+
const resolved = resolveAvailableOmpModel(query, {
|
|
133
|
+
aliases: normalizeModelAliases(state?.aliases),
|
|
134
|
+
available,
|
|
135
|
+
lastUsed: loadModelUsage()
|
|
136
|
+
});
|
|
137
|
+
return `${resolved.provider}/${resolved.id}`;
|
|
138
|
+
};
|
|
139
|
+
this.agents = new AgentManager(config.cwd, config.agents, {
|
|
140
|
+
workerPath: config.workerPath,
|
|
141
|
+
fabricExtensionPath: config.fabricExtensionPath,
|
|
142
|
+
ompBinary: config.ompBinary,
|
|
143
|
+
claudeBinary: config.claudeBinary,
|
|
144
|
+
vedaBinary: config.vedaBinary,
|
|
145
|
+
runRoot: path.join(config.residencyRoot, "runs"),
|
|
146
|
+
fullCodeMode: config.fullCodeMode,
|
|
147
|
+
mainAgentId: config.rootId,
|
|
148
|
+
fabricSessionId: config.sessionId,
|
|
149
|
+
meshRoot: config.meshRoot,
|
|
150
|
+
projectRoot: config.projectRoot,
|
|
151
|
+
hostId: this.hostId,
|
|
152
|
+
identityId: this.identity.id,
|
|
153
|
+
retention: config.retention,
|
|
154
|
+
prepareOmpModel: async (model) => resolveResidentOmpModel(model),
|
|
155
|
+
resolveParticipantGuidance: ({ model }) => {
|
|
156
|
+
if (!model) return void 0;
|
|
157
|
+
return resolveFabricModelGuidance(currentModelGuidance(), {
|
|
158
|
+
model,
|
|
159
|
+
target: "participant",
|
|
160
|
+
includeSlots: false
|
|
161
|
+
}).appendText || void 0;
|
|
162
|
+
},
|
|
163
|
+
onLifecycle: (event) => void this.lifecycle?.publish(event).catch(() => void 0),
|
|
164
|
+
onBackgroundComplete: (result) => {
|
|
165
|
+
if (!config.agents.notifyOnComplete) return;
|
|
166
|
+
const durationMs = Math.max(0, (result.finishedAt ?? Date.now()) - result.startedAt);
|
|
167
|
+
const summary = (result.text || result.error || "no result").slice(0, COMPLETION_MAX_CHARS);
|
|
168
|
+
void this.#queueDelivery(
|
|
169
|
+
{ id: result.id, name: result.name, kind: "agent" },
|
|
170
|
+
`Fabric agent ${result.id.slice(0, 8)} ${result.status} after ${Math.round(durationMs / 1e3)}s: ${summary}`,
|
|
171
|
+
"followUp",
|
|
172
|
+
true,
|
|
173
|
+
result
|
|
174
|
+
).catch(() => void 0);
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
const canManageActor = (id) => {
|
|
178
|
+
const participant = this.participants.get(id);
|
|
179
|
+
return participant ? participant.ownerHostId === this.hostId : void 0;
|
|
180
|
+
};
|
|
181
|
+
const lineageAlive = (rootId) => this.participants.get(rootId) !== void 0;
|
|
182
|
+
const actorRoots = config.sessionActorRoot ? { project: config.actorRoot, session: config.sessionActorRoot } : config.mesh.actorScope === "session" ? { project: path.dirname(config.actorRoot), session: config.actorRoot } : { project: config.actorRoot, session: path.join(config.actorRoot, config.sessionId) };
|
|
183
|
+
this.actors = new ActorDirectory([
|
|
184
|
+
config.sessionId,
|
|
185
|
+
this.identity,
|
|
186
|
+
this.mesh,
|
|
187
|
+
config.mesh,
|
|
188
|
+
this.agents,
|
|
189
|
+
({ actor, message, delivery, triggerTurn }) => {
|
|
190
|
+
if (!message.text) return;
|
|
191
|
+
const mode = delivery === "steer" ? "steer" : "followUp";
|
|
192
|
+
const triggers = delivery === "nextTurn" ? false : triggerTurn;
|
|
193
|
+
void this.#queueDelivery(
|
|
194
|
+
{ id: actor.id, name: actor.name, kind: "actor" },
|
|
195
|
+
message.text,
|
|
196
|
+
mode,
|
|
197
|
+
triggers,
|
|
198
|
+
message.data
|
|
199
|
+
).catch(() => void 0);
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
persistent: true,
|
|
203
|
+
canManageActor,
|
|
204
|
+
lineageAlive,
|
|
205
|
+
claimResidency: "durable",
|
|
206
|
+
rootId: config.rootId,
|
|
207
|
+
meshCursorPath: path.join(config.residencyRoot, "actor-mesh-cursor.json"),
|
|
208
|
+
retention: config.retention,
|
|
209
|
+
resolveOmpModel: resolveResidentOmpModel
|
|
210
|
+
}
|
|
211
|
+
], actorRoots, config.mesh.actorScope);
|
|
212
|
+
this.lifecycle = new LifecycleBroker(
|
|
213
|
+
this.mesh,
|
|
214
|
+
this.identity,
|
|
215
|
+
this.participants,
|
|
216
|
+
{
|
|
217
|
+
enabled: true,
|
|
218
|
+
pollMs: config.mesh.actorPollMs,
|
|
219
|
+
maxReadEvents: config.mesh.maxReadEvents
|
|
220
|
+
},
|
|
221
|
+
(subscription, event) => this.#deliverLifecycle(subscription, event)
|
|
222
|
+
);
|
|
223
|
+
}
|
|
224
|
+
hostId;
|
|
225
|
+
identity;
|
|
226
|
+
mesh;
|
|
227
|
+
participants;
|
|
228
|
+
control;
|
|
229
|
+
agents;
|
|
230
|
+
actors;
|
|
231
|
+
lifecycle;
|
|
232
|
+
#ownerPath;
|
|
233
|
+
#lockPath;
|
|
234
|
+
#errorPath;
|
|
235
|
+
#requestsPath;
|
|
236
|
+
#processingPath;
|
|
237
|
+
#responsesPath;
|
|
238
|
+
#agentsPath;
|
|
239
|
+
#deliveryPrefix;
|
|
240
|
+
#token = randomUUID();
|
|
241
|
+
#requestTimer;
|
|
242
|
+
#pollingRequests = false;
|
|
243
|
+
#closed = false;
|
|
244
|
+
#started = false;
|
|
245
|
+
#idleSince = Date.now();
|
|
246
|
+
async start() {
|
|
247
|
+
if (this.#started) return;
|
|
248
|
+
this.#acquireLock();
|
|
249
|
+
this.#started = true;
|
|
250
|
+
fs.mkdirSync(this.#requestsPath, { recursive: true, mode: 448 });
|
|
251
|
+
fs.mkdirSync(this.#processingPath, { recursive: true, mode: 448 });
|
|
252
|
+
fs.mkdirSync(this.#responsesPath, { recursive: true, mode: 448 });
|
|
253
|
+
fs.mkdirSync(this.#agentsPath, { recursive: true, mode: 448 });
|
|
254
|
+
this.#recoverInterruptedRequests();
|
|
255
|
+
const firstSeenAgents = /* @__PURE__ */ new Map();
|
|
256
|
+
this.participants.registerSource(
|
|
257
|
+
() => agentParticipantRecords(
|
|
258
|
+
this.agents.listForUi(),
|
|
259
|
+
this.config.rootId,
|
|
260
|
+
this.hostId,
|
|
261
|
+
this.identity.id,
|
|
262
|
+
this.config.rootId,
|
|
263
|
+
firstSeenAgents
|
|
264
|
+
)
|
|
265
|
+
);
|
|
266
|
+
this.participants.registerSource(
|
|
267
|
+
() => this.actors.listOwned().map(
|
|
268
|
+
(actor) => actorParticipantRecord(
|
|
269
|
+
actor,
|
|
270
|
+
this.config.rootId,
|
|
271
|
+
this.hostId,
|
|
272
|
+
this.identity.id,
|
|
273
|
+
this.config.rootId
|
|
274
|
+
)
|
|
275
|
+
)
|
|
276
|
+
);
|
|
277
|
+
this.agents.subscribeUi(() => this.participants.scheduleRefresh());
|
|
278
|
+
this.actors.subscribe(() => this.participants.scheduleRefresh());
|
|
279
|
+
this.control.start((command, from, signal) => this.#acceptControl(command, from, signal));
|
|
280
|
+
await this.participants.start().catch(() => void 0);
|
|
281
|
+
this.lifecycle.start();
|
|
282
|
+
this.#requestTimer = setInterval(
|
|
283
|
+
() => void this.#pollRequests().catch(() => void 0),
|
|
284
|
+
REQUEST_POLL_MS
|
|
285
|
+
);
|
|
286
|
+
const now = Date.now();
|
|
287
|
+
const owner = {
|
|
288
|
+
format: RESIDENT_HOST_FORMAT,
|
|
289
|
+
hostId: this.hostId,
|
|
290
|
+
pid: process.pid,
|
|
291
|
+
token: this.#token,
|
|
292
|
+
startedAt: now,
|
|
293
|
+
readyAt: now
|
|
294
|
+
};
|
|
295
|
+
atomicWrite(this.#ownerPath, owner);
|
|
296
|
+
fs.rmSync(this.#errorPath, { force: true });
|
|
297
|
+
await this.#pollRequests();
|
|
298
|
+
}
|
|
299
|
+
async close() {
|
|
300
|
+
if (this.#closed) return;
|
|
301
|
+
this.#closed = true;
|
|
302
|
+
if (this.#requestTimer) clearInterval(this.#requestTimer);
|
|
303
|
+
this.#requestTimer = void 0;
|
|
304
|
+
while (this.#pollingRequests) await delay(10);
|
|
305
|
+
await this.participants.quiesce().catch(() => void 0);
|
|
306
|
+
await this.lifecycle.close().catch(() => void 0);
|
|
307
|
+
await this.control.close().catch(() => void 0);
|
|
308
|
+
try {
|
|
309
|
+
await this.actors.close();
|
|
310
|
+
} finally {
|
|
311
|
+
await this.agents.close();
|
|
312
|
+
await this.participants.close().catch(() => void 0);
|
|
313
|
+
this.#releaseLock();
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
async #acceptControl(command, _from, signal) {
|
|
317
|
+
if (command.operation === "cancel") {
|
|
318
|
+
return { accepted: false, error: "Cancel commands are handled by the control plane" };
|
|
319
|
+
}
|
|
320
|
+
if (command.operation === "stop") {
|
|
321
|
+
try {
|
|
322
|
+
await this.agents.stop(command.targetId);
|
|
323
|
+
this.participants.scheduleRefresh();
|
|
324
|
+
return { accepted: true, messageId: command.commandId };
|
|
325
|
+
} catch (error) {
|
|
326
|
+
if (!(error instanceof Error && /Unknown Fabric agent/.test(error.message))) {
|
|
327
|
+
return { accepted: false, error: errorMessage(error) };
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
try {
|
|
331
|
+
if (!this.actors.owns(command.targetId)) {
|
|
332
|
+
return { accepted: false, error: `Resident host does not own ${command.targetId}` };
|
|
333
|
+
}
|
|
334
|
+
await this.actors.stop(command.targetId);
|
|
335
|
+
this.participants.scheduleRefresh();
|
|
336
|
+
return { accepted: true, messageId: command.commandId };
|
|
337
|
+
} catch (error) {
|
|
338
|
+
return { accepted: false, error: errorMessage(error) };
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
const message = command.message?.trim();
|
|
342
|
+
if (!message) return { accepted: false, error: "Fabric control message must not be empty" };
|
|
343
|
+
if (command.operation === "ask") {
|
|
344
|
+
try {
|
|
345
|
+
if (!this.actors.owns(command.targetId)) {
|
|
346
|
+
return { accepted: false, error: `Resident host does not own ${command.targetId}` };
|
|
347
|
+
}
|
|
348
|
+
const result = await this.actors.ask(
|
|
349
|
+
command.targetId,
|
|
350
|
+
message,
|
|
351
|
+
command.data,
|
|
352
|
+
signal,
|
|
353
|
+
command.binding !== void 0 ? { binding: command.binding } : {}
|
|
354
|
+
);
|
|
355
|
+
return { accepted: true, messageId: result.id, result };
|
|
356
|
+
} catch (error) {
|
|
357
|
+
return { accepted: false, error: errorMessage(error) };
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
try {
|
|
361
|
+
this.agents.status(command.targetId);
|
|
362
|
+
const result = command.operation === "steer" ? this.agents.steer(command.targetId, message, command.data) : this.agents.followUp(command.targetId, message, command.data);
|
|
363
|
+
return { accepted: true, messageId: result.messageId };
|
|
364
|
+
} catch (error) {
|
|
365
|
+
if (!(error instanceof Error && /Unknown Fabric agent/.test(error.message))) {
|
|
366
|
+
return { accepted: false, error: errorMessage(error) };
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
try {
|
|
370
|
+
if (!this.actors.owns(command.targetId)) {
|
|
371
|
+
return { accepted: false, error: `Resident host does not own ${command.targetId}` };
|
|
372
|
+
}
|
|
373
|
+
const result = this.actors.tell(
|
|
374
|
+
command.targetId,
|
|
375
|
+
message,
|
|
376
|
+
command.data,
|
|
377
|
+
command.binding !== void 0 ? { binding: command.binding } : {}
|
|
378
|
+
);
|
|
379
|
+
return { accepted: true, messageId: result.messageId };
|
|
380
|
+
} catch (error) {
|
|
381
|
+
return { accepted: false, error: errorMessage(error) };
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
async #deliverLifecycle(subscription, event) {
|
|
385
|
+
const message = `Fabric lifecycle ${event.event} from ${event.source.name} (${event.source.id})${event.status ? ` with status ${event.status}` : ""}.`;
|
|
386
|
+
if (subscription.to === this.config.rootId) {
|
|
387
|
+
await this.#queueDelivery(
|
|
388
|
+
lifecycleSourceIdentity(event.source),
|
|
389
|
+
message,
|
|
390
|
+
subscription.delivery,
|
|
391
|
+
subscription.triggerTurn,
|
|
392
|
+
event
|
|
393
|
+
);
|
|
394
|
+
return;
|
|
395
|
+
}
|
|
396
|
+
try {
|
|
397
|
+
this.agents.status(subscription.to);
|
|
398
|
+
if (subscription.delivery === "steer") this.agents.steer(subscription.to, message, event);
|
|
399
|
+
else this.agents.followUp(subscription.to, message, event);
|
|
400
|
+
return;
|
|
401
|
+
} catch (error) {
|
|
402
|
+
if (!(error instanceof Error && /Unknown Fabric agent/.test(error.message))) throw error;
|
|
403
|
+
}
|
|
404
|
+
try {
|
|
405
|
+
if (this.actors.owns(subscription.to)) {
|
|
406
|
+
this.actors.tell(subscription.to, message, event);
|
|
407
|
+
return;
|
|
408
|
+
}
|
|
409
|
+
} catch {
|
|
410
|
+
}
|
|
411
|
+
const target = this.participants.get(subscription.to);
|
|
412
|
+
if (!target) throw new Error(`Unknown Fabric lifecycle target: ${subscription.to}`);
|
|
413
|
+
await this.control.request(
|
|
414
|
+
target.ownerHostId,
|
|
415
|
+
target.id,
|
|
416
|
+
subscription.delivery,
|
|
417
|
+
{ message, data: event, triggerTurn: subscription.triggerTurn },
|
|
418
|
+
target.ownerIdentityId
|
|
419
|
+
);
|
|
420
|
+
}
|
|
421
|
+
async #queueDelivery(from, message, delivery, triggerTurn, data) {
|
|
422
|
+
const id = randomUUID();
|
|
423
|
+
const record = {
|
|
424
|
+
format: RESIDENT_HOST_FORMAT,
|
|
425
|
+
id,
|
|
426
|
+
rootId: this.config.rootId,
|
|
427
|
+
from,
|
|
428
|
+
delivery,
|
|
429
|
+
triggerTurn,
|
|
430
|
+
message,
|
|
431
|
+
...data === void 0 ? {} : { data },
|
|
432
|
+
createdAt: Date.now()
|
|
433
|
+
};
|
|
434
|
+
try {
|
|
435
|
+
await this.mesh.put({
|
|
436
|
+
key: `${this.#deliveryPrefix}${id}`,
|
|
437
|
+
value: record,
|
|
438
|
+
identity: this.identity,
|
|
439
|
+
ifVersion: 0
|
|
440
|
+
});
|
|
441
|
+
} catch {
|
|
442
|
+
await this.mesh.put({
|
|
443
|
+
key: `${this.#deliveryPrefix}${id}`,
|
|
444
|
+
value: {
|
|
445
|
+
...record,
|
|
446
|
+
message: message.slice(0, Math.max(1, this.config.mesh.eventContextChars)),
|
|
447
|
+
data: { fabricTruncated: true }
|
|
448
|
+
},
|
|
449
|
+
identity: this.identity,
|
|
450
|
+
ifVersion: 0
|
|
451
|
+
});
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
async #pollRequests() {
|
|
455
|
+
if (this.#pollingRequests || this.#closed) return;
|
|
456
|
+
this.#pollingRequests = true;
|
|
457
|
+
try {
|
|
458
|
+
let entries;
|
|
459
|
+
try {
|
|
460
|
+
entries = fs.readdirSync(this.#requestsPath).filter((entry) => entry.endsWith(".json"));
|
|
461
|
+
} catch {
|
|
462
|
+
return;
|
|
463
|
+
}
|
|
464
|
+
for (const entry of entries.slice(0, 32)) {
|
|
465
|
+
const source = path.join(this.#requestsPath, entry);
|
|
466
|
+
const processing = path.join(this.#processingPath, entry);
|
|
467
|
+
try {
|
|
468
|
+
fs.renameSync(source, processing);
|
|
469
|
+
} catch {
|
|
470
|
+
continue;
|
|
471
|
+
}
|
|
472
|
+
await this.#processRequest(processing);
|
|
473
|
+
}
|
|
474
|
+
} finally {
|
|
475
|
+
this.#pollingRequests = false;
|
|
476
|
+
this.#checkIdle();
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
#checkIdle() {
|
|
480
|
+
const activeActor = this.actors.listOwned().some((actor) => actor.residency === "durable" && actor.status !== "stopped");
|
|
481
|
+
const activeAgent = this.agents.listForUi().some((agent) => agent.status === "queued" || agent.status === "running");
|
|
482
|
+
let pendingRequest = false;
|
|
483
|
+
try {
|
|
484
|
+
pendingRequest = fs.readdirSync(this.#requestsPath).some((entry) => entry.endsWith(".json"));
|
|
485
|
+
} catch {
|
|
486
|
+
}
|
|
487
|
+
if (activeActor || activeAgent || pendingRequest) {
|
|
488
|
+
this.#idleSince = Date.now();
|
|
489
|
+
return;
|
|
490
|
+
}
|
|
491
|
+
if (Date.now() - this.#idleSince >= IDLE_EXIT_MS) this.onIdle();
|
|
492
|
+
}
|
|
493
|
+
async #processRequest(filePath) {
|
|
494
|
+
const command = readJson(filePath);
|
|
495
|
+
const requestId = command?.requestId ?? path.basename(filePath, ".json");
|
|
496
|
+
let response;
|
|
497
|
+
try {
|
|
498
|
+
if (command?.format !== RESIDENT_HOST_FORMAT || command.rootId !== this.config.rootId || command.requestId !== requestId) {
|
|
499
|
+
throw new Error("Invalid Fabric residency request");
|
|
500
|
+
}
|
|
501
|
+
if (command.operation === "spawn") {
|
|
502
|
+
if (command.request.sessionSeed || command.request.sessionFile || command.request.actorId || command.request.actorName || command.request.meshRoot || command.request.runnerSessionId || command.request.systemPrompt || command.request.images) {
|
|
503
|
+
throw new Error("Durable agents.spawn accepts only its public task and run settings");
|
|
504
|
+
}
|
|
505
|
+
const handle = await this.agents.spawn({ ...command.request, residency: "durable" });
|
|
506
|
+
this.agents.detachSignal(handle.id);
|
|
507
|
+
const runDirectory = this.agents.runDirectory(handle.id);
|
|
508
|
+
if (!runDirectory) throw new Error(`Resident agent ${handle.id} has no run directory`);
|
|
509
|
+
const worktreeGitRoot = this.agents.worktreeGitRoot(handle.id);
|
|
510
|
+
const metadata = {
|
|
511
|
+
format: RESIDENT_HOST_FORMAT,
|
|
512
|
+
rootId: this.config.rootId,
|
|
513
|
+
id: handle.id,
|
|
514
|
+
runDirectory,
|
|
515
|
+
handle: { ...handle, residency: "durable" },
|
|
516
|
+
...worktreeGitRoot ? { worktreeGitRoot } : {},
|
|
517
|
+
createdAt: Date.now(),
|
|
518
|
+
updatedAt: Date.now()
|
|
519
|
+
};
|
|
520
|
+
atomicWrite(path.join(this.#agentsPath, `${handle.id}.json`), metadata);
|
|
521
|
+
response = {
|
|
522
|
+
format: RESIDENT_HOST_FORMAT,
|
|
523
|
+
requestId,
|
|
524
|
+
ok: true,
|
|
525
|
+
handle: metadata.handle,
|
|
526
|
+
completedAt: Date.now()
|
|
527
|
+
};
|
|
528
|
+
} else if (command.operation === "foreground") {
|
|
529
|
+
this.agents.markForeground(command.id);
|
|
530
|
+
response = {
|
|
531
|
+
format: RESIDENT_HOST_FORMAT,
|
|
532
|
+
requestId,
|
|
533
|
+
ok: true,
|
|
534
|
+
completedAt: Date.now()
|
|
535
|
+
};
|
|
536
|
+
} else if (command.operation === "cleanup") {
|
|
537
|
+
await this.agents.wait(command.id);
|
|
538
|
+
await this.agents.cleanup(command.id, command.deleteBranch);
|
|
539
|
+
fs.rmSync(path.join(this.#agentsPath, `${command.id}.json`), { force: true });
|
|
540
|
+
response = {
|
|
541
|
+
format: RESIDENT_HOST_FORMAT,
|
|
542
|
+
requestId,
|
|
543
|
+
ok: true,
|
|
544
|
+
completedAt: Date.now()
|
|
545
|
+
};
|
|
546
|
+
} else if (command.operation === "createActor") {
|
|
547
|
+
if (command.request.residency !== "durable") {
|
|
548
|
+
throw new Error("Resident host createActor only supports durable residency");
|
|
549
|
+
}
|
|
550
|
+
const actor = await this.actors.create(command.request, { asRegistryOwner: true });
|
|
551
|
+
response = {
|
|
552
|
+
format: RESIDENT_HOST_FORMAT,
|
|
553
|
+
requestId,
|
|
554
|
+
ok: true,
|
|
555
|
+
actor,
|
|
556
|
+
completedAt: Date.now()
|
|
557
|
+
};
|
|
558
|
+
} else {
|
|
559
|
+
if (!this.actors.owns(command.id)) {
|
|
560
|
+
throw new Error(`Resident host does not own ${command.id}`);
|
|
561
|
+
}
|
|
562
|
+
await this.actors.remove(command.id);
|
|
563
|
+
response = {
|
|
564
|
+
format: RESIDENT_HOST_FORMAT,
|
|
565
|
+
requestId,
|
|
566
|
+
ok: true,
|
|
567
|
+
completedAt: Date.now()
|
|
568
|
+
};
|
|
569
|
+
}
|
|
570
|
+
} catch (error) {
|
|
571
|
+
response = {
|
|
572
|
+
format: RESIDENT_HOST_FORMAT,
|
|
573
|
+
requestId,
|
|
574
|
+
ok: false,
|
|
575
|
+
error: errorMessage(error),
|
|
576
|
+
completedAt: Date.now()
|
|
577
|
+
};
|
|
578
|
+
}
|
|
579
|
+
atomicWrite(path.join(this.#responsesPath, `${requestId}.json`), response);
|
|
580
|
+
fs.rmSync(filePath, { force: true });
|
|
581
|
+
this.participants.scheduleRefresh();
|
|
582
|
+
}
|
|
583
|
+
#recoverInterruptedRequests() {
|
|
584
|
+
let entries;
|
|
585
|
+
try {
|
|
586
|
+
entries = fs.readdirSync(this.#processingPath).filter((entry) => entry.endsWith(".json"));
|
|
587
|
+
} catch {
|
|
588
|
+
return;
|
|
589
|
+
}
|
|
590
|
+
for (const entry of entries) {
|
|
591
|
+
const requestId = path.basename(entry, ".json");
|
|
592
|
+
const response = {
|
|
593
|
+
format: RESIDENT_HOST_FORMAT,
|
|
594
|
+
requestId,
|
|
595
|
+
ok: false,
|
|
596
|
+
error: "Fabric residency outcome is indeterminate after resident host restart",
|
|
597
|
+
completedAt: Date.now()
|
|
598
|
+
};
|
|
599
|
+
atomicWrite(path.join(this.#responsesPath, entry), response);
|
|
600
|
+
fs.rmSync(path.join(this.#processingPath, entry), { force: true });
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
#acquireLock() {
|
|
604
|
+
fs.mkdirSync(this.config.residencyRoot, { recursive: true, mode: 448 });
|
|
605
|
+
const existing = readJson(this.#ownerPath);
|
|
606
|
+
if (existing && processAlive(existing.pid)) {
|
|
607
|
+
throw new ResidentHostAlreadyRunning(`Fabric resident host is already running (${existing.pid})`);
|
|
608
|
+
}
|
|
609
|
+
try {
|
|
610
|
+
const descriptor = fs.openSync(this.#lockPath, "wx", 384);
|
|
611
|
+
fs.writeFileSync(descriptor, JSON.stringify({ token: this.#token, pid: process.pid }));
|
|
612
|
+
fs.closeSync(descriptor);
|
|
613
|
+
} catch (error) {
|
|
614
|
+
if (error instanceof Error && "code" in error && error.code === "EEXIST") {
|
|
615
|
+
const locked = readJson(this.#lockPath);
|
|
616
|
+
if (typeof locked?.pid === "number" && processAlive(locked.pid)) {
|
|
617
|
+
throw new ResidentHostAlreadyRunning(`Fabric resident host is starting (${locked.pid})`);
|
|
618
|
+
}
|
|
619
|
+
fs.rmSync(this.#lockPath, { force: true });
|
|
620
|
+
const descriptor = fs.openSync(this.#lockPath, "wx", 384);
|
|
621
|
+
fs.writeFileSync(descriptor, JSON.stringify({ token: this.#token, pid: process.pid }));
|
|
622
|
+
fs.closeSync(descriptor);
|
|
623
|
+
} else {
|
|
624
|
+
throw error;
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
#releaseLock() {
|
|
629
|
+
const lock = readJson(this.#lockPath);
|
|
630
|
+
if (lock?.token === this.#token) fs.rmSync(this.#lockPath, { force: true });
|
|
631
|
+
const owner = readJson(this.#ownerPath);
|
|
632
|
+
if (owner?.token === this.#token) fs.rmSync(this.#ownerPath, { force: true });
|
|
633
|
+
}
|
|
634
|
+
};
|
|
635
|
+
var runResidentHost = async (config, signal) => {
|
|
636
|
+
let finishIdle;
|
|
637
|
+
const idle = new Promise((resolve) => {
|
|
638
|
+
finishIdle = resolve;
|
|
639
|
+
});
|
|
640
|
+
const host = new ResidentHost(config, () => finishIdle?.());
|
|
641
|
+
await host.start();
|
|
642
|
+
if (signal?.aborted) {
|
|
643
|
+
await host.close();
|
|
644
|
+
return;
|
|
645
|
+
}
|
|
646
|
+
await Promise.race([
|
|
647
|
+
idle,
|
|
648
|
+
new Promise((resolve) => {
|
|
649
|
+
const finish = () => resolve();
|
|
650
|
+
signal?.addEventListener("abort", finish, { once: true });
|
|
651
|
+
process.once("SIGTERM", finish);
|
|
652
|
+
process.once("SIGINT", finish);
|
|
653
|
+
})
|
|
654
|
+
]);
|
|
655
|
+
await host.close();
|
|
656
|
+
};
|
|
657
|
+
var runResidentHostFromConfigPath = async (configPath, signal) => {
|
|
658
|
+
let config;
|
|
659
|
+
try {
|
|
660
|
+
config = validateResidentHostConfig(readJson(configPath), configPath);
|
|
661
|
+
await runResidentHost(config, signal);
|
|
662
|
+
} catch (error) {
|
|
663
|
+
if (error instanceof ResidentHostAlreadyRunning) return;
|
|
664
|
+
const residencyRoot = config?.residencyRoot ?? path.dirname(configPath);
|
|
665
|
+
try {
|
|
666
|
+
atomicWrite(path.join(residencyRoot, "error.json"), {
|
|
667
|
+
error: errorMessage(error),
|
|
668
|
+
occurredAt: Date.now()
|
|
669
|
+
});
|
|
670
|
+
} catch {
|
|
671
|
+
}
|
|
672
|
+
throw error;
|
|
673
|
+
}
|
|
674
|
+
};
|
|
675
|
+
var isMain = process.argv[1] && path.resolve(process.argv[1]) === path.resolve(fileURLToPath(import.meta.url));
|
|
676
|
+
if (isMain) {
|
|
677
|
+
const configPath = parseResidentHostConfigPath(process.argv);
|
|
678
|
+
try {
|
|
679
|
+
await runResidentHostFromConfigPath(configPath);
|
|
680
|
+
} catch {
|
|
681
|
+
process.exitCode = 1;
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
export {
|
|
686
|
+
runResidentHostFromConfigPath
|
|
687
|
+
};
|
|
688
|
+
//# sourceMappingURL=chunk-4LEDA76O.js.map
|