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,647 @@
|
|
|
1
|
+
import {
|
|
2
|
+
readFabricBranchSummaryDetails,
|
|
3
|
+
readFabricProjectionTrace
|
|
4
|
+
} from "./chunk-4HQDSTHN.js";
|
|
5
|
+
|
|
6
|
+
// src/memory/normalize.ts
|
|
7
|
+
import fs from "node:fs";
|
|
8
|
+
var DEFAULT_MEMORY_INDEX_PRIVACY = {
|
|
9
|
+
indexThinking: false,
|
|
10
|
+
indexToolOutput: true
|
|
11
|
+
};
|
|
12
|
+
var privacyPolicy = (options = {}) => ({
|
|
13
|
+
indexThinking: options.indexThinking ?? DEFAULT_MEMORY_INDEX_PRIVACY.indexThinking,
|
|
14
|
+
indexToolOutput: options.indexToolOutput ?? DEFAULT_MEMORY_INDEX_PRIVACY.indexToolOutput
|
|
15
|
+
});
|
|
16
|
+
var truncate = (text, max) => {
|
|
17
|
+
const scalarLimit = Math.max(0, Math.floor(max));
|
|
18
|
+
if (scalarLimit >= text.length) return { text, truncated: false };
|
|
19
|
+
let scalarCount = 0;
|
|
20
|
+
let utf16End = 0;
|
|
21
|
+
for (const scalar of text) {
|
|
22
|
+
if (scalarCount >= scalarLimit) return { text: text.slice(0, utf16End), truncated: true };
|
|
23
|
+
utf16End += scalar.length;
|
|
24
|
+
scalarCount += 1;
|
|
25
|
+
}
|
|
26
|
+
return { text, truncated: false };
|
|
27
|
+
};
|
|
28
|
+
var asString = (value) => typeof value === "string" ? value : value === void 0 || value === null ? "" : String(value);
|
|
29
|
+
var joinTextParts = (parts) => {
|
|
30
|
+
const out = [];
|
|
31
|
+
for (const part of parts) {
|
|
32
|
+
if (part === null || typeof part !== "object") continue;
|
|
33
|
+
const record = part;
|
|
34
|
+
if (record.type === "text" && typeof record.text === "string") {
|
|
35
|
+
out.push(record.text);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return out.join("\n");
|
|
39
|
+
};
|
|
40
|
+
var summarizeArgs = (args, max = 400) => {
|
|
41
|
+
let serialized;
|
|
42
|
+
try {
|
|
43
|
+
serialized = JSON.stringify(args) ?? "";
|
|
44
|
+
} catch {
|
|
45
|
+
serialized = String(args);
|
|
46
|
+
}
|
|
47
|
+
const bounded = truncate(serialized, max);
|
|
48
|
+
return bounded.truncated ? `${bounded.text}\u2026` : bounded.text;
|
|
49
|
+
};
|
|
50
|
+
var collectPathArguments = (value, key, paths) => {
|
|
51
|
+
if (typeof value === "string") {
|
|
52
|
+
if (key !== null && /(?:file|path)s?$/i.test(key) && value.trim()) paths.push(value.trim());
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (Array.isArray(value)) {
|
|
56
|
+
for (const item of value) collectPathArguments(item, key, paths);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
if (value === null || typeof value !== "object") return;
|
|
60
|
+
for (const [childKey, childValue] of Object.entries(value)) {
|
|
61
|
+
collectPathArguments(childValue, childKey, paths);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
var extractFilesTouched = (raw) => {
|
|
65
|
+
if (asString(raw.type) !== "message") return [];
|
|
66
|
+
const message = raw.message;
|
|
67
|
+
if (!message || asString(message.role) !== "assistant" || !Array.isArray(message.content)) return [];
|
|
68
|
+
const paths = [];
|
|
69
|
+
for (const block of message.content) {
|
|
70
|
+
if (block === null || typeof block !== "object") continue;
|
|
71
|
+
const record = block;
|
|
72
|
+
if (record.type === "toolCall") collectPathArguments(record.arguments, null, paths);
|
|
73
|
+
}
|
|
74
|
+
return [...new Set(paths)];
|
|
75
|
+
};
|
|
76
|
+
var TRACE_OPERATION_MAX_BYTES = 96 * 1024;
|
|
77
|
+
var SESSION_HEADER_SCAN_LINES = 8;
|
|
78
|
+
var OMP_FILE_REFS = /* @__PURE__ */ new Set(["omp.read", "omp.grep", "omp.find", "omp.ls", "omp.edit", "omp.write"]);
|
|
79
|
+
var traceFilesTouched = (ref, tool, args) => {
|
|
80
|
+
if (!OMP_FILE_REFS.has(ref) || ref !== `omp.${tool}`) return [];
|
|
81
|
+
const path = args.path ?? args.file ?? args.dir;
|
|
82
|
+
return typeof path === "string" && path.trim() ? [path.trim()] : [];
|
|
83
|
+
};
|
|
84
|
+
var boundedTraceOperation = (parentEntryId, operation, includeToolOutput) => {
|
|
85
|
+
const address = `${parentEntryId}/${operation.sequence}`;
|
|
86
|
+
const normalized = {
|
|
87
|
+
address,
|
|
88
|
+
parentEntryId,
|
|
89
|
+
sequence: operation.sequence,
|
|
90
|
+
tool: operation.tool,
|
|
91
|
+
ref: operation.ref,
|
|
92
|
+
...operation.provider ? { provider: operation.provider } : {},
|
|
93
|
+
...operation.action ? { action: operation.action } : {},
|
|
94
|
+
args: operation.args,
|
|
95
|
+
outcome: operation.outcome,
|
|
96
|
+
...operation.error !== void 0 ? { error: operation.error } : {},
|
|
97
|
+
...includeToolOutput && operation.result !== void 0 ? { result: operation.result } : {},
|
|
98
|
+
...!includeToolOutput && operation.result !== void 0 ? { resultOmitted: true } : {}
|
|
99
|
+
};
|
|
100
|
+
if (Buffer.byteLength(JSON.stringify(normalized), "utf8") > TRACE_OPERATION_MAX_BYTES && normalized.result !== void 0) {
|
|
101
|
+
delete normalized.result;
|
|
102
|
+
normalized.resultOmitted = true;
|
|
103
|
+
}
|
|
104
|
+
return normalized;
|
|
105
|
+
};
|
|
106
|
+
var traceChildren = (raw, base, policy) => {
|
|
107
|
+
if (base.type !== "message" || base.role !== "toolResult" || base.toolName !== "fabric_exec") return [];
|
|
108
|
+
const message = raw.message;
|
|
109
|
+
if (!message || typeof message !== "object" || Array.isArray(message)) return [];
|
|
110
|
+
const nested = readFabricProjectionTrace(message.details);
|
|
111
|
+
if (!nested || nested.source !== "trace" || base.entryId === null) return [];
|
|
112
|
+
return nested.operations.map((operation) => {
|
|
113
|
+
const normalized = boundedTraceOperation(base.entryId, operation, policy.indexToolOutput);
|
|
114
|
+
const filesTouched = traceFilesTouched(normalized.ref, normalized.tool, normalized.args);
|
|
115
|
+
const text = `Fabric operation ${normalized.ref}
|
|
116
|
+
${JSON.stringify(normalized)}`;
|
|
117
|
+
return {
|
|
118
|
+
sessionFile: base.sessionFile,
|
|
119
|
+
sessionId: base.sessionId,
|
|
120
|
+
entryId: normalized.address,
|
|
121
|
+
parentId: base.parentId,
|
|
122
|
+
type: "fabric_operation",
|
|
123
|
+
role: "fabricOperation",
|
|
124
|
+
toolName: normalized.tool,
|
|
125
|
+
text,
|
|
126
|
+
timestamp: base.timestamp,
|
|
127
|
+
isError: normalized.outcome !== "succeeded",
|
|
128
|
+
truncated: false,
|
|
129
|
+
parentEntryId: base.entryId,
|
|
130
|
+
operationAddress: normalized.address,
|
|
131
|
+
ref: normalized.ref,
|
|
132
|
+
...normalized.provider ? { provider: normalized.provider } : {},
|
|
133
|
+
...normalized.action ? { action: normalized.action } : {},
|
|
134
|
+
outcome: normalized.outcome,
|
|
135
|
+
operation: normalized,
|
|
136
|
+
...filesTouched.length > 0 ? { filesTouched } : {}
|
|
137
|
+
};
|
|
138
|
+
});
|
|
139
|
+
};
|
|
140
|
+
var branchDetails = (raw) => {
|
|
141
|
+
const type = asString(raw.type);
|
|
142
|
+
const message = raw.message;
|
|
143
|
+
const messageRecord = message && typeof message === "object" && !Array.isArray(message) ? message : void 0;
|
|
144
|
+
if (type !== "branch_summary" && !(type === "message" && asString(messageRecord?.role) === "branchSummary")) {
|
|
145
|
+
return void 0;
|
|
146
|
+
}
|
|
147
|
+
return readFabricBranchSummaryDetails(raw.details) ?? readFabricBranchSummaryDetails(messageRecord?.details);
|
|
148
|
+
};
|
|
149
|
+
var branchFilesTouched = (fact) => {
|
|
150
|
+
const paths = [];
|
|
151
|
+
collectPathArguments(fact.args, null, paths);
|
|
152
|
+
return [...new Set(paths)];
|
|
153
|
+
};
|
|
154
|
+
var branchFactChild = (fact, base, carrierFromId, policy) => {
|
|
155
|
+
const carrierEntryId = base.entryId;
|
|
156
|
+
const carrierParentId = base.parentId;
|
|
157
|
+
const common = {
|
|
158
|
+
sessionFile: base.sessionFile,
|
|
159
|
+
sessionId: base.sessionId,
|
|
160
|
+
entryId: fact.address,
|
|
161
|
+
parentId: base.parentId,
|
|
162
|
+
type: "fabric_branch_fact",
|
|
163
|
+
timestamp: base.timestamp,
|
|
164
|
+
truncated: false,
|
|
165
|
+
parentEntryId: carrierEntryId,
|
|
166
|
+
factAddress: fact.address,
|
|
167
|
+
carrierEntryId,
|
|
168
|
+
carrierParentId,
|
|
169
|
+
carrierFromId
|
|
170
|
+
};
|
|
171
|
+
const normalizedFact = {
|
|
172
|
+
kind: fact.kind,
|
|
173
|
+
address: fact.address,
|
|
174
|
+
entryId: fact.entryId,
|
|
175
|
+
subordinal: fact.subordinal,
|
|
176
|
+
carrierEntryId,
|
|
177
|
+
carrierParentId,
|
|
178
|
+
carrierFromId,
|
|
179
|
+
...fact.kind === "user" ? { text: fact.text } : {},
|
|
180
|
+
...fact.kind === "customMessage" ? {
|
|
181
|
+
text: fact.text,
|
|
182
|
+
customType: fact.customType,
|
|
183
|
+
display: fact.display
|
|
184
|
+
} : {},
|
|
185
|
+
...fact.kind === "phase" ? { phase: fact.phase } : {},
|
|
186
|
+
...fact.kind === "fabricRun" ? {
|
|
187
|
+
name: fact.name,
|
|
188
|
+
...fact.description !== void 0 ? { description: fact.description } : {},
|
|
189
|
+
outcome: fact.outcome
|
|
190
|
+
} : {},
|
|
191
|
+
...fact.kind === "operation" ? {
|
|
192
|
+
ref: fact.ref,
|
|
193
|
+
...fact.provider ? { provider: fact.provider } : {},
|
|
194
|
+
...fact.action ? { action: fact.action } : {},
|
|
195
|
+
tool: fact.tool,
|
|
196
|
+
args: fact.args,
|
|
197
|
+
outcome: fact.outcome,
|
|
198
|
+
...fact.error !== void 0 ? { error: fact.error } : {},
|
|
199
|
+
...policy.indexToolOutput && fact.result !== void 0 ? { result: fact.result } : {}
|
|
200
|
+
} : {}
|
|
201
|
+
};
|
|
202
|
+
if (fact.kind === "user") {
|
|
203
|
+
return {
|
|
204
|
+
...common,
|
|
205
|
+
role: "branchUser",
|
|
206
|
+
toolName: null,
|
|
207
|
+
text: fact.text,
|
|
208
|
+
isError: false,
|
|
209
|
+
branchFact: normalizedFact
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
if (fact.kind === "customMessage") {
|
|
213
|
+
return {
|
|
214
|
+
...common,
|
|
215
|
+
role: "branchCustomMessage",
|
|
216
|
+
toolName: null,
|
|
217
|
+
text: fact.customType ? `[${fact.customType}] ${fact.text}` : fact.text,
|
|
218
|
+
isError: false,
|
|
219
|
+
branchFact: normalizedFact
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
if (fact.kind === "phase") {
|
|
223
|
+
return {
|
|
224
|
+
...common,
|
|
225
|
+
role: "fabricPhase",
|
|
226
|
+
toolName: null,
|
|
227
|
+
text: `Fabric phase ${fact.phase}`,
|
|
228
|
+
isError: false,
|
|
229
|
+
branchFact: normalizedFact
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
if (fact.kind === "fabricRun") {
|
|
233
|
+
const description = fact.description ? ` \u2014 ${fact.description}` : "";
|
|
234
|
+
return {
|
|
235
|
+
...common,
|
|
236
|
+
role: "fabricRun",
|
|
237
|
+
toolName: "fabric_exec",
|
|
238
|
+
text: `Fabric run ${fact.name}${description} \u2192 ${fact.outcome}`,
|
|
239
|
+
isError: fact.outcome !== "succeeded",
|
|
240
|
+
operationAddress: fact.address,
|
|
241
|
+
ref: "fabric_exec",
|
|
242
|
+
outcome: fact.outcome,
|
|
243
|
+
branchFact: normalizedFact
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
const operation = {
|
|
247
|
+
address: fact.address,
|
|
248
|
+
parentEntryId: fact.entryId,
|
|
249
|
+
subordinal: fact.subordinal,
|
|
250
|
+
tool: fact.tool,
|
|
251
|
+
ref: fact.ref,
|
|
252
|
+
...fact.provider ? { provider: fact.provider } : {},
|
|
253
|
+
...fact.action ? { action: fact.action } : {},
|
|
254
|
+
args: fact.args,
|
|
255
|
+
outcome: fact.outcome,
|
|
256
|
+
...fact.error !== void 0 ? { error: fact.error } : {},
|
|
257
|
+
...policy.indexToolOutput && fact.result !== void 0 ? { result: fact.result } : {},
|
|
258
|
+
...!policy.indexToolOutput && fact.result !== void 0 ? { resultOmitted: true } : {}
|
|
259
|
+
};
|
|
260
|
+
if (Buffer.byteLength(JSON.stringify(operation), "utf8") > TRACE_OPERATION_MAX_BYTES && operation.result !== void 0) {
|
|
261
|
+
delete operation.result;
|
|
262
|
+
operation.resultOmitted = true;
|
|
263
|
+
}
|
|
264
|
+
const filesTouched = branchFilesTouched(fact);
|
|
265
|
+
return {
|
|
266
|
+
...common,
|
|
267
|
+
role: "fabricOperation",
|
|
268
|
+
toolName: fact.tool,
|
|
269
|
+
text: `Fabric branch operation ${fact.ref}
|
|
270
|
+
${JSON.stringify(operation)}`,
|
|
271
|
+
isError: fact.outcome !== "succeeded",
|
|
272
|
+
operationAddress: fact.address,
|
|
273
|
+
ref: fact.ref,
|
|
274
|
+
...fact.provider ? { provider: fact.provider } : {},
|
|
275
|
+
...fact.action ? { action: fact.action } : {},
|
|
276
|
+
outcome: fact.outcome,
|
|
277
|
+
operation,
|
|
278
|
+
branchFact: normalizedFact,
|
|
279
|
+
...filesTouched.length > 0 ? { filesTouched } : {}
|
|
280
|
+
};
|
|
281
|
+
};
|
|
282
|
+
var extractFullText = (raw, options = {}) => {
|
|
283
|
+
const policy = privacyPolicy(options);
|
|
284
|
+
const type = asString(raw.type);
|
|
285
|
+
if (type === "message") {
|
|
286
|
+
const message = raw.message;
|
|
287
|
+
if (!message || typeof message !== "object") return "";
|
|
288
|
+
const role = asString(message.role);
|
|
289
|
+
const content = message.content;
|
|
290
|
+
if (role === "user") {
|
|
291
|
+
if (typeof content === "string") return content;
|
|
292
|
+
if (Array.isArray(content)) return joinTextParts(content);
|
|
293
|
+
return "";
|
|
294
|
+
}
|
|
295
|
+
if (role === "assistant") {
|
|
296
|
+
const parts = [];
|
|
297
|
+
if (Array.isArray(content)) {
|
|
298
|
+
for (const block of content) {
|
|
299
|
+
if (block === null || typeof block !== "object") continue;
|
|
300
|
+
const record = block;
|
|
301
|
+
if (record.type === "text" && typeof record.text === "string") parts.push(record.text);
|
|
302
|
+
else if (policy.indexThinking && record.type === "thinking" && typeof record.thinking === "string") {
|
|
303
|
+
parts.push(record.thinking);
|
|
304
|
+
} else if (record.type === "toolCall") {
|
|
305
|
+
const name = asString(record.name);
|
|
306
|
+
parts.push(`Tool: ${name}(${summarizeArgs(record.arguments)})`);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
const errorMessage = asString(message.errorMessage);
|
|
311
|
+
if (errorMessage) parts.push(`Error: ${errorMessage}`);
|
|
312
|
+
return parts.join("\n");
|
|
313
|
+
}
|
|
314
|
+
if (role === "toolResult") {
|
|
315
|
+
const toolName = asString(message.toolName);
|
|
316
|
+
let body = "";
|
|
317
|
+
if (Array.isArray(message.content)) body = joinTextParts(message.content);
|
|
318
|
+
else if (typeof message.content === "string") body = message.content;
|
|
319
|
+
const errorSuffix = message.isError === true ? " [error]" : "";
|
|
320
|
+
const prefix = toolName ? `toolResult(${toolName})${errorSuffix}` : `toolResult${errorSuffix}`;
|
|
321
|
+
return policy.indexToolOutput && body ? `${prefix}: ${body}` : prefix;
|
|
322
|
+
}
|
|
323
|
+
if (role === "bashExecution") {
|
|
324
|
+
const command = asString(message.command);
|
|
325
|
+
const output = asString(message.output);
|
|
326
|
+
const exit = message.exitCode;
|
|
327
|
+
const exitSuffix = typeof exit === "number" ? ` [exit ${exit}]` : "";
|
|
328
|
+
return policy.indexToolOutput && output ? `bash$ ${command}${exitSuffix}
|
|
329
|
+
${output}` : `bash$ ${command}${exitSuffix}`;
|
|
330
|
+
}
|
|
331
|
+
if (role === "custom") {
|
|
332
|
+
const customType = asString(message.customType);
|
|
333
|
+
let body = "";
|
|
334
|
+
if (typeof message.content === "string") body = message.content;
|
|
335
|
+
else if (Array.isArray(message.content)) body = joinTextParts(message.content);
|
|
336
|
+
return customType ? `[${customType}] ${body}` : body;
|
|
337
|
+
}
|
|
338
|
+
if (role === "compactionSummary") return `compaction: ${asString(message.summary)}`;
|
|
339
|
+
if (role === "branchSummary") return "";
|
|
340
|
+
return "";
|
|
341
|
+
}
|
|
342
|
+
if (type === "compaction") return `compaction: ${asString(raw.summary)}`;
|
|
343
|
+
if (type === "branch_summary") return "";
|
|
344
|
+
if (type === "custom_message") {
|
|
345
|
+
let body = "";
|
|
346
|
+
if (typeof raw.content === "string") body = raw.content;
|
|
347
|
+
else if (Array.isArray(raw.content)) body = joinTextParts(raw.content);
|
|
348
|
+
const customType = asString(raw.customType);
|
|
349
|
+
return customType ? `[${customType}] ${body}` : body;
|
|
350
|
+
}
|
|
351
|
+
return "";
|
|
352
|
+
};
|
|
353
|
+
var entryRoleAndTool = (raw) => {
|
|
354
|
+
const type = asString(raw.type);
|
|
355
|
+
if (type === "message") {
|
|
356
|
+
const message = raw.message;
|
|
357
|
+
if (!message || typeof message !== "object") return { role: null, toolName: null, isError: false };
|
|
358
|
+
const role = asString(message.role) || null;
|
|
359
|
+
let toolName = null;
|
|
360
|
+
if (role === "toolResult") toolName = asString(message.toolName) || null;
|
|
361
|
+
else if (role === "bashExecution") toolName = "bash";
|
|
362
|
+
else if (role === "assistant" && Array.isArray(message.content)) {
|
|
363
|
+
for (const block of message.content) {
|
|
364
|
+
if (block === null || typeof block !== "object") continue;
|
|
365
|
+
const record = block;
|
|
366
|
+
if (record.type === "toolCall" && typeof record.name === "string") {
|
|
367
|
+
toolName = record.name;
|
|
368
|
+
break;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
const isError = Boolean(message.isError);
|
|
373
|
+
return { role, toolName, isError };
|
|
374
|
+
}
|
|
375
|
+
if (type === "compaction") return { role: "compaction", toolName: null, isError: false };
|
|
376
|
+
if (type === "branch_summary") return { role: "branchSummary", toolName: null, isError: false };
|
|
377
|
+
if (type === "custom_message") return { role: "custom", toolName: null, isError: false };
|
|
378
|
+
return { role: null, toolName: null, isError: false };
|
|
379
|
+
};
|
|
380
|
+
var parseTimestamp = (raw) => {
|
|
381
|
+
if (typeof raw === "number" && Number.isFinite(raw)) return raw;
|
|
382
|
+
if (typeof raw === "string") {
|
|
383
|
+
const parsed = Date.parse(raw);
|
|
384
|
+
return Number.isNaN(parsed) ? null : parsed;
|
|
385
|
+
}
|
|
386
|
+
if (raw && typeof raw === "object") {
|
|
387
|
+
const record = raw;
|
|
388
|
+
const entryTimestamp = parseTimestamp(record.timestamp);
|
|
389
|
+
if (entryTimestamp !== null) return entryTimestamp;
|
|
390
|
+
const message = record.message;
|
|
391
|
+
if (message) return parseTimestamp(message.timestamp);
|
|
392
|
+
}
|
|
393
|
+
return null;
|
|
394
|
+
};
|
|
395
|
+
var normalizeSession = (sessionFile, maxEntryChars, options = {}) => {
|
|
396
|
+
let content;
|
|
397
|
+
try {
|
|
398
|
+
content = fs.readFileSync(sessionFile, "utf8");
|
|
399
|
+
} catch {
|
|
400
|
+
return { entries: [], header: null, indexCoverage: { complete: false, reasons: ["source_unavailable"] } };
|
|
401
|
+
}
|
|
402
|
+
const lines = content.split("\n");
|
|
403
|
+
let header = null;
|
|
404
|
+
const entries = [];
|
|
405
|
+
const reasons = /* @__PURE__ */ new Set();
|
|
406
|
+
const seenBranchFactAddresses = /* @__PURE__ */ new Set();
|
|
407
|
+
const policy = privacyPolicy(options);
|
|
408
|
+
for (const reason of options.lineage?.coverageReasons ?? []) reasons.add(reason);
|
|
409
|
+
let index = 0;
|
|
410
|
+
let rawOrdinal = 0;
|
|
411
|
+
let sessionId = "";
|
|
412
|
+
for (const line of lines) {
|
|
413
|
+
const trimmed = line.trim();
|
|
414
|
+
if (!trimmed) continue;
|
|
415
|
+
let raw;
|
|
416
|
+
try {
|
|
417
|
+
raw = JSON.parse(trimmed);
|
|
418
|
+
} catch {
|
|
419
|
+
continue;
|
|
420
|
+
}
|
|
421
|
+
if (asString(raw.type) === "session") {
|
|
422
|
+
sessionId = asString(raw.id);
|
|
423
|
+
header = {
|
|
424
|
+
sessionId,
|
|
425
|
+
cwd: asString(raw.cwd),
|
|
426
|
+
...typeof raw.parentSession === "string" ? { parentSession: raw.parentSession } : {}
|
|
427
|
+
};
|
|
428
|
+
continue;
|
|
429
|
+
}
|
|
430
|
+
const type = asString(raw.type);
|
|
431
|
+
const ordinal = rawOrdinal;
|
|
432
|
+
rawOrdinal += 1;
|
|
433
|
+
if (options.lineage && options.lineage.entryOrdinals !== null && !options.lineage.entryOrdinals.has(ordinal)) {
|
|
434
|
+
continue;
|
|
435
|
+
}
|
|
436
|
+
if (type !== "message" && type !== "compaction" && type !== "branch_summary" && type !== "custom_message") {
|
|
437
|
+
continue;
|
|
438
|
+
}
|
|
439
|
+
const { role, toolName, isError } = entryRoleAndTool(raw);
|
|
440
|
+
const filesTouched = extractFilesTouched(raw);
|
|
441
|
+
const fullText = extractFullText(raw, policy);
|
|
442
|
+
const { text, truncated } = truncate(fullText, maxEntryChars);
|
|
443
|
+
if (!text.trim() && role === null) continue;
|
|
444
|
+
const entryId = typeof raw.id === "string" ? raw.id : null;
|
|
445
|
+
const parentId = typeof raw.parentId === "string" ? raw.parentId : null;
|
|
446
|
+
const base = {
|
|
447
|
+
sessionFile,
|
|
448
|
+
sessionId: sessionId || "",
|
|
449
|
+
entryId,
|
|
450
|
+
parentId,
|
|
451
|
+
type,
|
|
452
|
+
role,
|
|
453
|
+
toolName,
|
|
454
|
+
text,
|
|
455
|
+
timestamp: parseTimestamp(raw),
|
|
456
|
+
isError,
|
|
457
|
+
truncated,
|
|
458
|
+
...filesTouched.length > 0 ? { filesTouched } : {}
|
|
459
|
+
};
|
|
460
|
+
entries.push({ ...base, index });
|
|
461
|
+
if (truncated) reasons.add("max_entry_chars");
|
|
462
|
+
index += 1;
|
|
463
|
+
for (const child of traceChildren(raw, base, policy)) {
|
|
464
|
+
const bounded = truncate(child.text, maxEntryChars);
|
|
465
|
+
entries.push({ ...child, index, text: bounded.text, truncated: bounded.truncated });
|
|
466
|
+
if (bounded.truncated) reasons.add("max_entry_chars");
|
|
467
|
+
index += 1;
|
|
468
|
+
}
|
|
469
|
+
const details = branchDetails(raw);
|
|
470
|
+
if (details && base.entryId !== null) {
|
|
471
|
+
const localAddresses = /* @__PURE__ */ new Set();
|
|
472
|
+
const duplicateAddress = details.facts.find((fact) => {
|
|
473
|
+
if (localAddresses.has(fact.address)) return true;
|
|
474
|
+
localAddresses.add(fact.address);
|
|
475
|
+
return false;
|
|
476
|
+
});
|
|
477
|
+
if (duplicateAddress) {
|
|
478
|
+
reasons.add("duplicate_branch_fact_address");
|
|
479
|
+
if (duplicateAddress.kind === "operation") reasons.add("duplicate_operation_address");
|
|
480
|
+
} else {
|
|
481
|
+
const message = raw.message;
|
|
482
|
+
const messageRecord = message && typeof message === "object" && !Array.isArray(message) ? message : void 0;
|
|
483
|
+
const carrierFromId = typeof raw.fromId === "string" ? raw.fromId : typeof messageRecord?.fromId === "string" ? messageRecord.fromId : null;
|
|
484
|
+
for (const fact of details.facts) {
|
|
485
|
+
if (seenBranchFactAddresses.has(fact.address)) continue;
|
|
486
|
+
seenBranchFactAddresses.add(fact.address);
|
|
487
|
+
const child = branchFactChild(fact, base, carrierFromId, policy);
|
|
488
|
+
const bounded = truncate(child.text, maxEntryChars);
|
|
489
|
+
entries.push({ ...child, index, text: bounded.text, truncated: bounded.truncated });
|
|
490
|
+
if (bounded.truncated) reasons.add("max_entry_chars");
|
|
491
|
+
index += 1;
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
const entryIds = /* @__PURE__ */ new Set();
|
|
497
|
+
const operationAddresses = /* @__PURE__ */ new Set();
|
|
498
|
+
for (const entry of entries) {
|
|
499
|
+
if (entry.entryId !== null) {
|
|
500
|
+
if (entryIds.has(entry.entryId)) reasons.add("duplicate_entry_id");
|
|
501
|
+
entryIds.add(entry.entryId);
|
|
502
|
+
}
|
|
503
|
+
if (entry.operationAddress !== void 0) {
|
|
504
|
+
if (operationAddresses.has(entry.operationAddress)) reasons.add("duplicate_operation_address");
|
|
505
|
+
operationAddresses.add(entry.operationAddress);
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
const sortedReasons = [...reasons].sort();
|
|
509
|
+
return {
|
|
510
|
+
entries,
|
|
511
|
+
header,
|
|
512
|
+
indexCoverage: { complete: sortedReasons.length === 0, reasons: sortedReasons }
|
|
513
|
+
};
|
|
514
|
+
};
|
|
515
|
+
var readSessionHeader = (sessionFile) => {
|
|
516
|
+
try {
|
|
517
|
+
const fd = fs.openSync(sessionFile, "r");
|
|
518
|
+
const buffer = Buffer.alloc(65536);
|
|
519
|
+
const bytesRead = fs.readSync(fd, buffer, 0, buffer.length, 0);
|
|
520
|
+
fs.closeSync(fd);
|
|
521
|
+
const slice = buffer.subarray(0, bytesRead).toString("utf8");
|
|
522
|
+
const lines = slice.split("\n");
|
|
523
|
+
const complete = slice.endsWith("\n") ? lines.length : lines.length - 1;
|
|
524
|
+
for (let index = 0; index < Math.min(complete, SESSION_HEADER_SCAN_LINES); index++) {
|
|
525
|
+
const line = lines[index]?.trim();
|
|
526
|
+
if (!line) continue;
|
|
527
|
+
let raw;
|
|
528
|
+
try {
|
|
529
|
+
raw = JSON.parse(line);
|
|
530
|
+
} catch {
|
|
531
|
+
continue;
|
|
532
|
+
}
|
|
533
|
+
if (asString(raw.type) !== "session") continue;
|
|
534
|
+
return {
|
|
535
|
+
sessionId: asString(raw.id),
|
|
536
|
+
cwd: asString(raw.cwd),
|
|
537
|
+
...typeof raw.parentSession === "string" ? { parentSession: raw.parentSession } : {}
|
|
538
|
+
};
|
|
539
|
+
}
|
|
540
|
+
return null;
|
|
541
|
+
} catch {
|
|
542
|
+
return null;
|
|
543
|
+
}
|
|
544
|
+
};
|
|
545
|
+
var expandSessionEntry = (sessionFile, index, options = {}) => {
|
|
546
|
+
const { entries } = normalizeSession(sessionFile, Number.MAX_SAFE_INTEGER, options);
|
|
547
|
+
return entries.find((entry) => entry.index === index)?.text ?? null;
|
|
548
|
+
};
|
|
549
|
+
var toExpandedSessionEntry = (entry) => ({
|
|
550
|
+
index: entry.index,
|
|
551
|
+
entryId: entry.entryId,
|
|
552
|
+
parentId: entry.parentId,
|
|
553
|
+
type: entry.type,
|
|
554
|
+
role: entry.role,
|
|
555
|
+
timestamp: entry.timestamp,
|
|
556
|
+
isError: entry.isError,
|
|
557
|
+
text: entry.text,
|
|
558
|
+
...entry.parentEntryId !== void 0 ? { parentEntryId: entry.parentEntryId } : {},
|
|
559
|
+
...entry.operationAddress ? { operationAddress: entry.operationAddress } : {},
|
|
560
|
+
...entry.toolName ? { toolName: entry.toolName } : {},
|
|
561
|
+
...entry.ref ? { ref: entry.ref } : {},
|
|
562
|
+
...entry.provider ? { provider: entry.provider } : {},
|
|
563
|
+
...entry.action ? { action: entry.action } : {},
|
|
564
|
+
...entry.outcome ? { outcome: entry.outcome } : {},
|
|
565
|
+
...entry.filesTouched ? { filesTouched: entry.filesTouched } : {},
|
|
566
|
+
...entry.operation ? { operation: entry.operation } : {},
|
|
567
|
+
...entry.branchFact ? { branchFact: entry.branchFact } : {},
|
|
568
|
+
...entry.factAddress ? { factAddress: entry.factAddress } : {},
|
|
569
|
+
...entry.carrierEntryId ? { carrierEntryId: entry.carrierEntryId } : {},
|
|
570
|
+
...entry.carrierParentId !== void 0 ? { carrierParentId: entry.carrierParentId } : {},
|
|
571
|
+
...entry.carrierFromId !== void 0 ? { carrierFromId: entry.carrierFromId } : {}
|
|
572
|
+
});
|
|
573
|
+
var expandNormalizedEntries = (entries, selection) => {
|
|
574
|
+
const indices = new Set(selection.indices ?? []);
|
|
575
|
+
const entryIds = new Set(selection.entryIds ?? []);
|
|
576
|
+
const operationAddresses = new Set(selection.operationAddresses ?? []);
|
|
577
|
+
const range = selection.entryRange;
|
|
578
|
+
return entries.filter(
|
|
579
|
+
(entry) => indices.has(entry.index) || entry.entryId !== null && entryIds.has(entry.entryId) || entry.operationAddress !== void 0 && operationAddresses.has(entry.operationAddress) || range !== void 0 && entry.index >= range.first && entry.index <= range.last
|
|
580
|
+
).map(toExpandedSessionEntry);
|
|
581
|
+
};
|
|
582
|
+
var expandSessionEntries = (sessionFile, selection, options = {}) => {
|
|
583
|
+
const { entries } = normalizeSession(sessionFile, Number.MAX_SAFE_INTEGER, options);
|
|
584
|
+
return expandNormalizedEntries(entries, selection);
|
|
585
|
+
};
|
|
586
|
+
var expandSessionEntriesChecked = (sessionFileOrEntries, selection, options = {}) => {
|
|
587
|
+
const entries = typeof sessionFileOrEntries === "string" ? normalizeSession(sessionFileOrEntries, Number.MAX_SAFE_INTEGER, options).entries : sessionFileOrEntries;
|
|
588
|
+
const requestedEntryIds = new Set(selection.entryIds ?? []);
|
|
589
|
+
const requestedOperationAddresses = new Set(selection.operationAddresses ?? []);
|
|
590
|
+
const entryIdCounts = new Map([...requestedEntryIds].map((address) => [address, 0]));
|
|
591
|
+
const operationAddressCounts = new Map(
|
|
592
|
+
[...requestedOperationAddresses].map((address) => [address, 0])
|
|
593
|
+
);
|
|
594
|
+
for (const entry of entries) {
|
|
595
|
+
if (entry.entryId !== null && requestedEntryIds.has(entry.entryId)) {
|
|
596
|
+
entryIdCounts.set(entry.entryId, (entryIdCounts.get(entry.entryId) ?? 0) + 1);
|
|
597
|
+
}
|
|
598
|
+
if (entry.operationAddress !== void 0 && requestedOperationAddresses.has(entry.operationAddress)) {
|
|
599
|
+
operationAddressCounts.set(
|
|
600
|
+
entry.operationAddress,
|
|
601
|
+
(operationAddressCounts.get(entry.operationAddress) ?? 0) + 1
|
|
602
|
+
);
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
for (const address of requestedEntryIds) {
|
|
606
|
+
const matches = entryIdCounts.get(address) ?? 0;
|
|
607
|
+
if (matches !== 1) {
|
|
608
|
+
return {
|
|
609
|
+
expanded: [],
|
|
610
|
+
error: {
|
|
611
|
+
code: matches === 0 ? "address_not_found" : "ambiguous_address",
|
|
612
|
+
message: matches === 0 ? `Entry address ${JSON.stringify(address)} was not found.` : `Entry address ${JSON.stringify(address)} resolves to ${matches} records.`,
|
|
613
|
+
addressType: "entry_id",
|
|
614
|
+
address,
|
|
615
|
+
matches
|
|
616
|
+
}
|
|
617
|
+
};
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
for (const address of requestedOperationAddresses) {
|
|
621
|
+
const matches = operationAddressCounts.get(address) ?? 0;
|
|
622
|
+
if (matches !== 1) {
|
|
623
|
+
return {
|
|
624
|
+
expanded: [],
|
|
625
|
+
error: {
|
|
626
|
+
code: matches === 0 ? "address_not_found" : "ambiguous_address",
|
|
627
|
+
message: matches === 0 ? `Operation address ${JSON.stringify(address)} was not found.` : `Operation address ${JSON.stringify(address)} resolves to ${matches} records.`,
|
|
628
|
+
addressType: "operation_address",
|
|
629
|
+
address,
|
|
630
|
+
matches
|
|
631
|
+
}
|
|
632
|
+
};
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
return { expanded: expandNormalizedEntries(entries, selection) };
|
|
636
|
+
};
|
|
637
|
+
|
|
638
|
+
export {
|
|
639
|
+
DEFAULT_MEMORY_INDEX_PRIVACY,
|
|
640
|
+
extractFullText,
|
|
641
|
+
normalizeSession,
|
|
642
|
+
readSessionHeader,
|
|
643
|
+
expandSessionEntry,
|
|
644
|
+
expandSessionEntries,
|
|
645
|
+
expandSessionEntriesChecked
|
|
646
|
+
};
|
|
647
|
+
//# sourceMappingURL=chunk-6QBPSZJ5.js.map
|