@e4779/pi-fabric 0.92.17-fork.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +181 -0
- package/THIRD_PARTY_NOTICES.md +33 -0
- package/dist/activity/store.d.ts +33 -0
- package/dist/activity/store.d.ts.map +1 -0
- package/dist/activity/types.d.ts +104 -0
- package/dist/activity/types.d.ts.map +1 -0
- package/dist/actors/binding-store.d.ts +17 -0
- package/dist/actors/binding-store.d.ts.map +1 -0
- package/dist/actors/context.d.ts +13 -0
- package/dist/actors/context.d.ts.map +1 -0
- package/dist/actors/delivery-policy.d.ts +8 -0
- package/dist/actors/delivery-policy.d.ts.map +1 -0
- package/dist/actors/directory.d.ts +47 -0
- package/dist/actors/directory.d.ts.map +1 -0
- package/dist/actors/global-registry.d.ts +47 -0
- package/dist/actors/global-registry.d.ts.map +1 -0
- package/dist/actors/host-event-observer.d.ts +5 -0
- package/dist/actors/host-event-observer.d.ts.map +1 -0
- package/dist/actors/host-event-payload.d.ts +14 -0
- package/dist/actors/host-event-payload.d.ts.map +1 -0
- package/dist/actors/log-store.d.ts +22 -0
- package/dist/actors/log-store.d.ts.map +1 -0
- package/dist/actors/manager.d.ts +175 -0
- package/dist/actors/manager.d.ts.map +1 -0
- package/dist/actors/mesh-monitor.d.ts +22 -0
- package/dist/actors/mesh-monitor.d.ts.map +1 -0
- package/dist/actors/predicate.d.ts +7 -0
- package/dist/actors/predicate.d.ts.map +1 -0
- package/dist/actors/registry-store.d.ts +15 -0
- package/dist/actors/registry-store.d.ts.map +1 -0
- package/dist/actors/types.d.ts +218 -0
- package/dist/actors/types.d.ts.map +1 -0
- package/dist/agents/bash-worktree-add.d.ts +24 -0
- package/dist/agents/bash-worktree-add.d.ts.map +1 -0
- package/dist/agents/budget-ledger.d.ts +88 -0
- package/dist/agents/budget-ledger.d.ts.map +1 -0
- package/dist/agents/claude-cli.d.ts +32 -0
- package/dist/agents/claude-cli.d.ts.map +1 -0
- package/dist/agents/claude-cli.js +17 -0
- package/dist/agents/claude-cli.js.map +7 -0
- package/dist/agents/clone-first-worktree.d.ts +17 -0
- package/dist/agents/clone-first-worktree.d.ts.map +1 -0
- package/dist/agents/compact-control.d.ts +32 -0
- package/dist/agents/compact-control.d.ts.map +1 -0
- package/dist/agents/compact-control.js +129 -0
- package/dist/agents/compact-control.js.map +7 -0
- package/dist/agents/constants.d.ts +9 -0
- package/dist/agents/constants.d.ts.map +1 -0
- package/dist/agents/cow-clone.d.ts +8 -0
- package/dist/agents/cow-clone.d.ts.map +1 -0
- package/dist/agents/handoff-completion.d.ts +4 -0
- package/dist/agents/handoff-completion.d.ts.map +1 -0
- package/dist/agents/handoff.d.ts +19 -0
- package/dist/agents/handoff.d.ts.map +1 -0
- package/dist/agents/lifecycle.d.ts +32 -0
- package/dist/agents/lifecycle.d.ts.map +1 -0
- package/dist/agents/manager.d.ts +75 -0
- package/dist/agents/manager.d.ts.map +1 -0
- package/dist/agents/pi-binary.d.ts +7 -0
- package/dist/agents/pi-binary.d.ts.map +1 -0
- package/dist/agents/request.d.ts +13 -0
- package/dist/agents/request.d.ts.map +1 -0
- package/dist/agents/result.d.ts +8 -0
- package/dist/agents/result.d.ts.map +1 -0
- package/dist/agents/result.js +9 -0
- package/dist/agents/result.js.map +7 -0
- package/dist/agents/rm.d.ts +15 -0
- package/dist/agents/rm.d.ts.map +1 -0
- package/dist/agents/semaphore.d.ts +7 -0
- package/dist/agents/semaphore.d.ts.map +1 -0
- package/dist/agents/service-provider.d.ts +9 -0
- package/dist/agents/service-provider.d.ts.map +1 -0
- package/dist/agents/service-schema.d.ts +6 -0
- package/dist/agents/service-schema.d.ts.map +1 -0
- package/dist/agents/service-types.d.ts +192 -0
- package/dist/agents/service-types.d.ts.map +1 -0
- package/dist/agents/service.d.ts +36 -0
- package/dist/agents/service.d.ts.map +1 -0
- package/dist/agents/session-export.d.ts +39 -0
- package/dist/agents/session-export.d.ts.map +1 -0
- package/dist/agents/session-pins.d.ts +24 -0
- package/dist/agents/session-pins.d.ts.map +1 -0
- package/dist/agents/thinking-transfer.d.ts +39 -0
- package/dist/agents/thinking-transfer.d.ts.map +1 -0
- package/dist/agents/transports/herdr-transport.d.ts +10 -0
- package/dist/agents/transports/herdr-transport.d.ts.map +1 -0
- package/dist/agents/transports/localterm-transport.d.ts +7 -0
- package/dist/agents/transports/localterm-transport.d.ts.map +1 -0
- package/dist/agents/transports/process-transport.d.ts +7 -0
- package/dist/agents/transports/process-transport.d.ts.map +1 -0
- package/dist/agents/transports/process-utils.d.ts +33 -0
- package/dist/agents/transports/process-utils.d.ts.map +1 -0
- package/dist/agents/transports/screen-transport.d.ts +7 -0
- package/dist/agents/transports/screen-transport.d.ts.map +1 -0
- package/dist/agents/transports/tmux-transport.d.ts +7 -0
- package/dist/agents/transports/tmux-transport.d.ts.map +1 -0
- package/dist/agents/types.d.ts +280 -0
- package/dist/agents/types.d.ts.map +1 -0
- package/dist/agents/veda-cli.d.ts +22 -0
- package/dist/agents/veda-cli.d.ts.map +1 -0
- package/dist/agents/veda-cli.js +13 -0
- package/dist/agents/veda-cli.js.map +7 -0
- package/dist/agents/worktree-manager.d.ts +14 -0
- package/dist/agents/worktree-manager.d.ts.map +1 -0
- package/dist/agents/worktree-paths.d.ts +5 -0
- package/dist/agents/worktree-paths.d.ts.map +1 -0
- package/dist/agents.d.ts +8 -0
- package/dist/agents.d.ts.map +1 -0
- package/dist/agents.js +761 -0
- package/dist/agents.js.map +7 -0
- package/dist/async-settlement.d.ts +4 -0
- package/dist/async-settlement.d.ts.map +1 -0
- package/dist/audit/details.d.ts +86 -0
- package/dist/audit/details.d.ts.map +1 -0
- package/dist/audit/index.d.ts +4 -0
- package/dist/audit/index.d.ts.map +1 -0
- package/dist/audit/projection.d.ts +20 -0
- package/dist/audit/projection.d.ts.map +1 -0
- package/dist/audit/trace.d.ts +99 -0
- package/dist/audit/trace.d.ts.map +1 -0
- package/dist/capture/catalog.d.ts +30 -0
- package/dist/capture/catalog.d.ts.map +1 -0
- package/dist/capture/interceptor.d.ts +20 -0
- package/dist/capture/interceptor.d.ts.map +1 -0
- package/dist/capture/wrapper.d.ts +15 -0
- package/dist/capture/wrapper.d.ts.map +1 -0
- package/dist/chunks/chunk-2DMJ7MEI.js +1984 -0
- package/dist/chunks/chunk-2DMJ7MEI.js.map +7 -0
- package/dist/chunks/chunk-2PZWDVJB.js +738 -0
- package/dist/chunks/chunk-2PZWDVJB.js.map +7 -0
- package/dist/chunks/chunk-2UQV52II.js +440 -0
- package/dist/chunks/chunk-2UQV52II.js.map +7 -0
- package/dist/chunks/chunk-32BNQ75J.js +1445 -0
- package/dist/chunks/chunk-32BNQ75J.js.map +7 -0
- package/dist/chunks/chunk-3H7SDWZI.js +467 -0
- package/dist/chunks/chunk-3H7SDWZI.js.map +7 -0
- package/dist/chunks/chunk-3MEHEH6B.js +41 -0
- package/dist/chunks/chunk-3MEHEH6B.js.map +7 -0
- package/dist/chunks/chunk-3QECYQGA.js +70 -0
- package/dist/chunks/chunk-3QECYQGA.js.map +7 -0
- package/dist/chunks/chunk-3WIGAX56.js +644 -0
- package/dist/chunks/chunk-3WIGAX56.js.map +7 -0
- package/dist/chunks/chunk-3YZUQESG.js +16 -0
- package/dist/chunks/chunk-3YZUQESG.js.map +7 -0
- package/dist/chunks/chunk-4JETKRFE.js +287 -0
- package/dist/chunks/chunk-4JETKRFE.js.map +7 -0
- package/dist/chunks/chunk-4SSMGBF4.js +93 -0
- package/dist/chunks/chunk-4SSMGBF4.js.map +7 -0
- package/dist/chunks/chunk-5SU3YXBS.js +15 -0
- package/dist/chunks/chunk-5SU3YXBS.js.map +7 -0
- package/dist/chunks/chunk-656HWVFU.js +409 -0
- package/dist/chunks/chunk-656HWVFU.js.map +7 -0
- package/dist/chunks/chunk-7A6NVHB5.js +1242 -0
- package/dist/chunks/chunk-7A6NVHB5.js.map +7 -0
- package/dist/chunks/chunk-7TB7NXSL.js +58 -0
- package/dist/chunks/chunk-7TB7NXSL.js.map +7 -0
- package/dist/chunks/chunk-AAHHYDTO.js +24 -0
- package/dist/chunks/chunk-AAHHYDTO.js.map +7 -0
- package/dist/chunks/chunk-ARLYAW2A.js +95 -0
- package/dist/chunks/chunk-ARLYAW2A.js.map +7 -0
- package/dist/chunks/chunk-AYBIR4YV.js +210 -0
- package/dist/chunks/chunk-AYBIR4YV.js.map +7 -0
- package/dist/chunks/chunk-BOTRGFQQ.js +87 -0
- package/dist/chunks/chunk-BOTRGFQQ.js.map +7 -0
- package/dist/chunks/chunk-CGPK5WHX.js +96 -0
- package/dist/chunks/chunk-CGPK5WHX.js.map +7 -0
- package/dist/chunks/chunk-CI56CW53.js +470 -0
- package/dist/chunks/chunk-CI56CW53.js.map +7 -0
- package/dist/chunks/chunk-CPSW2GW4.js +1466 -0
- package/dist/chunks/chunk-CPSW2GW4.js.map +7 -0
- package/dist/chunks/chunk-CQFP2RCP.js +64 -0
- package/dist/chunks/chunk-CQFP2RCP.js.map +7 -0
- package/dist/chunks/chunk-D5WKZONW.js +797 -0
- package/dist/chunks/chunk-D5WKZONW.js.map +7 -0
- package/dist/chunks/chunk-DLXPTBPL.js +151 -0
- package/dist/chunks/chunk-DLXPTBPL.js.map +7 -0
- package/dist/chunks/chunk-G4LADAYY.js +287 -0
- package/dist/chunks/chunk-G4LADAYY.js.map +7 -0
- package/dist/chunks/chunk-GXNR6NRU.js +447 -0
- package/dist/chunks/chunk-GXNR6NRU.js.map +7 -0
- package/dist/chunks/chunk-IGVDD2HT.js +10 -0
- package/dist/chunks/chunk-IGVDD2HT.js.map +7 -0
- package/dist/chunks/chunk-J2HV2URQ.js +1125 -0
- package/dist/chunks/chunk-J2HV2URQ.js.map +7 -0
- package/dist/chunks/chunk-KAD7UWT2.js +99 -0
- package/dist/chunks/chunk-KAD7UWT2.js.map +7 -0
- package/dist/chunks/chunk-KYXZJNV6.js +227 -0
- package/dist/chunks/chunk-KYXZJNV6.js.map +7 -0
- package/dist/chunks/chunk-LMAVZN7J.js +8 -0
- package/dist/chunks/chunk-LMAVZN7J.js.map +7 -0
- package/dist/chunks/chunk-M3S7XITB.js +110 -0
- package/dist/chunks/chunk-M3S7XITB.js.map +7 -0
- package/dist/chunks/chunk-MGDLRV2R.js +112 -0
- package/dist/chunks/chunk-MGDLRV2R.js.map +7 -0
- package/dist/chunks/chunk-MGWQOKBV.js +30 -0
- package/dist/chunks/chunk-MGWQOKBV.js.map +7 -0
- package/dist/chunks/chunk-N5GUXC6F.js +184 -0
- package/dist/chunks/chunk-N5GUXC6F.js.map +7 -0
- package/dist/chunks/chunk-NQOEHX62.js +215 -0
- package/dist/chunks/chunk-NQOEHX62.js.map +7 -0
- package/dist/chunks/chunk-OKOHRXGF.js +100 -0
- package/dist/chunks/chunk-OKOHRXGF.js.map +7 -0
- package/dist/chunks/chunk-OP2KTYQB.js +286 -0
- package/dist/chunks/chunk-OP2KTYQB.js.map +7 -0
- package/dist/chunks/chunk-OTCASLY2.js +52 -0
- package/dist/chunks/chunk-OTCASLY2.js.map +7 -0
- package/dist/chunks/chunk-PAN6C3JM.js +42 -0
- package/dist/chunks/chunk-PAN6C3JM.js.map +7 -0
- package/dist/chunks/chunk-PH7ZJ27F.js +6873 -0
- package/dist/chunks/chunk-PH7ZJ27F.js.map +7 -0
- package/dist/chunks/chunk-PM5I335G.js +225 -0
- package/dist/chunks/chunk-PM5I335G.js.map +7 -0
- package/dist/chunks/chunk-PSNXUZMY.js +218 -0
- package/dist/chunks/chunk-PSNXUZMY.js.map +7 -0
- package/dist/chunks/chunk-PXAICAUT.js +24 -0
- package/dist/chunks/chunk-PXAICAUT.js.map +7 -0
- package/dist/chunks/chunk-RERA6YWA.js +359 -0
- package/dist/chunks/chunk-RERA6YWA.js.map +7 -0
- package/dist/chunks/chunk-RNOPHITP.js +1720 -0
- package/dist/chunks/chunk-RNOPHITP.js.map +7 -0
- package/dist/chunks/chunk-RRGTKHXZ.js +931 -0
- package/dist/chunks/chunk-RRGTKHXZ.js.map +7 -0
- package/dist/chunks/chunk-SWB2OHYW.js +93 -0
- package/dist/chunks/chunk-SWB2OHYW.js.map +7 -0
- package/dist/chunks/chunk-T3A5GNCW.js +19 -0
- package/dist/chunks/chunk-T3A5GNCW.js.map +7 -0
- package/dist/chunks/chunk-TPLMVELH.js +118 -0
- package/dist/chunks/chunk-TPLMVELH.js.map +7 -0
- package/dist/chunks/chunk-TSRKCXNI.js +17 -0
- package/dist/chunks/chunk-TSRKCXNI.js.map +7 -0
- package/dist/chunks/chunk-U5FYOMG5.js +119 -0
- package/dist/chunks/chunk-U5FYOMG5.js.map +7 -0
- package/dist/chunks/chunk-U6CTHPZC.js +1924 -0
- package/dist/chunks/chunk-U6CTHPZC.js.map +7 -0
- package/dist/chunks/chunk-UDFDF7IY.js +1572 -0
- package/dist/chunks/chunk-UDFDF7IY.js.map +7 -0
- package/dist/chunks/chunk-UKMQK5VP.js +231 -0
- package/dist/chunks/chunk-UKMQK5VP.js.map +7 -0
- package/dist/chunks/chunk-UQ4LTUH4.js +2181 -0
- package/dist/chunks/chunk-UQ4LTUH4.js.map +7 -0
- package/dist/chunks/chunk-UTR3I23Z.js +65 -0
- package/dist/chunks/chunk-UTR3I23Z.js.map +7 -0
- package/dist/chunks/chunk-VPPIJRNZ.js +50 -0
- package/dist/chunks/chunk-VPPIJRNZ.js.map +7 -0
- package/dist/chunks/chunk-VRYEGVHR.js +195 -0
- package/dist/chunks/chunk-VRYEGVHR.js.map +7 -0
- package/dist/chunks/chunk-VRZNFNPB.js +4218 -0
- package/dist/chunks/chunk-VRZNFNPB.js.map +7 -0
- package/dist/chunks/chunk-VXZZJ44D.js +295 -0
- package/dist/chunks/chunk-VXZZJ44D.js.map +7 -0
- package/dist/chunks/chunk-W3FRE4VI.js +297 -0
- package/dist/chunks/chunk-W3FRE4VI.js.map +7 -0
- package/dist/chunks/chunk-WVH324VF.js +60 -0
- package/dist/chunks/chunk-WVH324VF.js.map +7 -0
- package/dist/chunks/chunk-X7G62ZGH.js +151 -0
- package/dist/chunks/chunk-X7G62ZGH.js.map +7 -0
- package/dist/chunks/chunk-XB3RJVT4.js +17 -0
- package/dist/chunks/chunk-XB3RJVT4.js.map +7 -0
- package/dist/chunks/chunk-XT4346N7.js +651 -0
- package/dist/chunks/chunk-XT4346N7.js.map +7 -0
- package/dist/chunks/chunk-Y7KNRAFL.js +1180 -0
- package/dist/chunks/chunk-Y7KNRAFL.js.map +7 -0
- package/dist/chunks/chunk-YK5AZ7CZ.js +692 -0
- package/dist/chunks/chunk-YK5AZ7CZ.js.map +7 -0
- package/dist/chunks/chunk-YU4O6SWQ.js +246 -0
- package/dist/chunks/chunk-YU4O6SWQ.js.map +7 -0
- package/dist/chunks/chunk-YU62DDKK.js +22 -0
- package/dist/chunks/chunk-YU62DDKK.js.map +7 -0
- package/dist/chunks/chunk-Z63R5GVN.js +121 -0
- package/dist/chunks/chunk-Z63R5GVN.js.map +7 -0
- package/dist/chunks/chunk-ZDNGXLEC.js +221 -0
- package/dist/chunks/chunk-ZDNGXLEC.js.map +7 -0
- package/dist/chunks/chunk-ZZ4LHQYJ.js +777 -0
- package/dist/chunks/chunk-ZZ4LHQYJ.js.map +7 -0
- package/dist/commands/fabric.d.ts +17 -0
- package/dist/commands/fabric.d.ts.map +1 -0
- package/dist/compaction/bounds.d.ts +23 -0
- package/dist/compaction/bounds.d.ts.map +1 -0
- package/dist/compaction/branch-details.d.ts +83 -0
- package/dist/compaction/branch-details.d.ts.map +1 -0
- package/dist/compaction/branch-summary.d.ts +9 -0
- package/dist/compaction/branch-summary.d.ts.map +1 -0
- package/dist/compaction/enrichers.d.ts +10 -0
- package/dist/compaction/enrichers.d.ts.map +1 -0
- package/dist/compaction/hook.d.ts +99 -0
- package/dist/compaction/hook.d.ts.map +1 -0
- package/dist/compaction/hook.js +22 -0
- package/dist/compaction/hook.js.map +7 -0
- package/dist/compaction/instructions.d.ts +38 -0
- package/dist/compaction/instructions.d.ts.map +1 -0
- package/dist/compaction/normalize.d.ts +83 -0
- package/dist/compaction/normalize.d.ts.map +1 -0
- package/dist/compaction/projections.d.ts +31 -0
- package/dist/compaction/projections.d.ts.map +1 -0
- package/dist/compaction/qa.d.ts +27 -0
- package/dist/compaction/qa.d.ts.map +1 -0
- package/dist/compaction/render.d.ts +10 -0
- package/dist/compaction/render.d.ts.map +1 -0
- package/dist/compaction/threshold.d.ts +5 -0
- package/dist/compaction/threshold.d.ts.map +1 -0
- package/dist/compaction/trace-events.d.ts +23 -0
- package/dist/compaction/trace-events.d.ts.map +1 -0
- package/dist/components/catalog.d.ts +25 -0
- package/dist/components/catalog.d.ts.map +1 -0
- package/dist/components/effect-policy.d.ts +21 -0
- package/dist/components/effect-policy.d.ts.map +1 -0
- package/dist/components/effect-scope.d.ts +31 -0
- package/dist/components/effect-scope.d.ts.map +1 -0
- package/dist/components/loader.d.ts +27 -0
- package/dist/components/loader.d.ts.map +1 -0
- package/dist/components/model-guidance.d.ts +48 -0
- package/dist/components/model-guidance.d.ts.map +1 -0
- package/dist/components/provider-component.d.ts +31 -0
- package/dist/components/provider-component.d.ts.map +1 -0
- package/dist/components/supervisor.d.ts +29 -0
- package/dist/components/supervisor.d.ts.map +1 -0
- package/dist/components/types.d.ts +140 -0
- package/dist/components/types.d.ts.map +1 -0
- package/dist/config-migrations.d.ts +11 -0
- package/dist/config-migrations.d.ts.map +1 -0
- package/dist/config.d.ts +282 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/core/action-arguments.d.ts +12 -0
- package/dist/core/action-arguments.d.ts.map +1 -0
- package/dist/core/action-registry.d.ts +170 -0
- package/dist/core/action-registry.d.ts.map +1 -0
- package/dist/core/action-registry.js +20 -0
- package/dist/core/action-registry.js.map +7 -0
- package/dist/core/action-repair.d.ts +15 -0
- package/dist/core/action-repair.d.ts.map +1 -0
- package/dist/core/action-result.d.ts +13 -0
- package/dist/core/action-result.d.ts.map +1 -0
- package/dist/core/agent-dir.d.ts +2 -0
- package/dist/core/agent-dir.d.ts.map +1 -0
- package/dist/core/approval-controller.d.ts +31 -0
- package/dist/core/approval-controller.d.ts.map +1 -0
- package/dist/core/atomic-write.d.ts +15 -0
- package/dist/core/atomic-write.d.ts.map +1 -0
- package/dist/core/auto-approval-classifier.d.ts +17 -0
- package/dist/core/auto-approval-classifier.d.ts.map +1 -0
- package/dist/core/call-preview.d.ts +8 -0
- package/dist/core/call-preview.d.ts.map +1 -0
- package/dist/core/child-tool-allowlist.d.ts +3 -0
- package/dist/core/child-tool-allowlist.d.ts.map +1 -0
- package/dist/core/compact-controller.d.ts +42 -0
- package/dist/core/compact-controller.d.ts.map +1 -0
- package/dist/core/core-override-guidance.d.ts +7 -0
- package/dist/core/core-override-guidance.d.ts.map +1 -0
- package/dist/core/damaged-file.d.ts +6 -0
- package/dist/core/damaged-file.d.ts.map +1 -0
- package/dist/core/direct-tool-approval.d.ts +19 -0
- package/dist/core/direct-tool-approval.d.ts.map +1 -0
- package/dist/core/effect-conflict.d.ts +3 -0
- package/dist/core/effect-conflict.d.ts.map +1 -0
- package/dist/core/file-lock.d.ts +12 -0
- package/dist/core/file-lock.d.ts.map +1 -0
- package/dist/core/kernel-skills.d.ts +3 -0
- package/dist/core/kernel-skills.d.ts.map +1 -0
- package/dist/core/model-resolution.d.ts +62 -0
- package/dist/core/model-resolution.d.ts.map +1 -0
- package/dist/core/model-usage.d.ts +8 -0
- package/dist/core/model-usage.d.ts.map +1 -0
- package/dist/core/pi-arguments.d.ts +3 -0
- package/dist/core/pi-arguments.d.ts.map +1 -0
- package/dist/core/pi-bash-error.d.ts +9 -0
- package/dist/core/pi-bash-error.d.ts.map +1 -0
- package/dist/core/pi-tools.d.ts +9 -0
- package/dist/core/pi-tools.d.ts.map +1 -0
- package/dist/core/provider-bindings.d.ts +47 -0
- package/dist/core/provider-bindings.d.ts.map +1 -0
- package/dist/core/proxy-contract.d.ts +18 -0
- package/dist/core/proxy-contract.d.ts.map +1 -0
- package/dist/core/session-context.d.ts +14 -0
- package/dist/core/session-context.d.ts.map +1 -0
- package/dist/core/shell-jobs.d.ts +99 -0
- package/dist/core/shell-jobs.d.ts.map +1 -0
- package/dist/core/skill-block.d.ts +10 -0
- package/dist/core/skill-block.d.ts.map +1 -0
- package/dist/core/skill-dir.d.ts +4 -0
- package/dist/core/skill-dir.d.ts.map +1 -0
- package/dist/core/skill-prompt.d.ts +3 -0
- package/dist/core/skill-prompt.d.ts.map +1 -0
- package/dist/core/skill-references.d.ts +7 -0
- package/dist/core/skill-references.d.ts.map +1 -0
- package/dist/core/stable-hash.d.ts +3 -0
- package/dist/core/stable-hash.d.ts.map +1 -0
- package/dist/core/system-guidance.d.ts +13 -0
- package/dist/core/system-guidance.d.ts.map +1 -0
- package/dist/core/token-math.d.ts +16 -0
- package/dist/core/token-math.d.ts.map +1 -0
- package/dist/core/tool-ownership.d.ts +47 -0
- package/dist/core/tool-ownership.d.ts.map +1 -0
- package/dist/core/tool-result-proxy.d.ts +18 -0
- package/dist/core/tool-result-proxy.d.ts.map +1 -0
- package/dist/entropy/active.d.ts +9 -0
- package/dist/entropy/active.d.ts.map +1 -0
- package/dist/entropy/compiled-store.d.ts +16 -0
- package/dist/entropy/compiled-store.d.ts.map +1 -0
- package/dist/entropy/compiled-surface.d.ts +57 -0
- package/dist/entropy/compiled-surface.d.ts.map +1 -0
- package/dist/entropy/compiler.d.ts +27 -0
- package/dist/entropy/compiler.d.ts.map +1 -0
- package/dist/entropy/corpus.d.ts +22 -0
- package/dist/entropy/corpus.d.ts.map +1 -0
- package/dist/entropy/fingerprint.d.ts +9 -0
- package/dist/entropy/fingerprint.d.ts.map +1 -0
- package/dist/entropy/index.d.ts +16 -0
- package/dist/entropy/index.d.ts.map +1 -0
- package/dist/entropy/index.js +194 -0
- package/dist/entropy/index.js.map +7 -0
- package/dist/entropy/meter.d.ts +10 -0
- package/dist/entropy/meter.d.ts.map +1 -0
- package/dist/entropy/normal-form.d.ts +40 -0
- package/dist/entropy/normal-form.d.ts.map +1 -0
- package/dist/entropy/passes.d.ts +13 -0
- package/dist/entropy/passes.d.ts.map +1 -0
- package/dist/entropy/pool-store.d.ts +15 -0
- package/dist/entropy/pool-store.d.ts.map +1 -0
- package/dist/entropy/pool.d.ts +41 -0
- package/dist/entropy/pool.d.ts.map +1 -0
- package/dist/entropy/presentation.d.ts +12 -0
- package/dist/entropy/presentation.d.ts.map +1 -0
- package/dist/entropy/sessions.d.ts +47 -0
- package/dist/entropy/sessions.d.ts.map +1 -0
- package/dist/entropy/surface.d.ts +30 -0
- package/dist/entropy/surface.d.ts.map +1 -0
- package/dist/entropy/trial.d.ts +38 -0
- package/dist/entropy/trial.d.ts.map +1 -0
- package/dist/entropy/types.d.ts +181 -0
- package/dist/entropy/types.d.ts.map +1 -0
- package/dist/execution-service.d.ts +66 -0
- package/dist/execution-service.d.ts.map +1 -0
- package/dist/fabric-exec-arguments.d.ts +7 -0
- package/dist/fabric-exec-arguments.d.ts.map +1 -0
- package/dist/fabric-exec-tool.d.ts +8 -0
- package/dist/fabric-exec-tool.d.ts.map +1 -0
- package/dist/fabric-runtime-state.d.ts +96 -0
- package/dist/fabric-runtime-state.d.ts.map +1 -0
- package/dist/fabric-runtime-state.js +11928 -0
- package/dist/fabric-runtime-state.js.map +7 -0
- package/dist/fabric-state.d.ts +95 -0
- package/dist/fabric-state.d.ts.map +1 -0
- package/dist/failure-progress.d.ts +3 -0
- package/dist/failure-progress.d.ts.map +1 -0
- package/dist/host-compatibility.d.ts +5 -0
- package/dist/host-compatibility.d.ts.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6094 -0
- package/dist/index.js.map +7 -0
- package/dist/jev/auth.d.ts +5 -0
- package/dist/jev/auth.d.ts.map +1 -0
- package/dist/jev/browser.d.ts +37 -0
- package/dist/jev/browser.d.ts.map +1 -0
- package/dist/jev/browser.js +13 -0
- package/dist/jev/browser.js.map +7 -0
- package/dist/jev/client.d.ts +29 -0
- package/dist/jev/client.d.ts.map +1 -0
- package/dist/jev/client.js +11 -0
- package/dist/jev/client.js.map +7 -0
- package/dist/jev/config.d.ts +17 -0
- package/dist/jev/config.d.ts.map +1 -0
- package/dist/jev/guest-types.d.ts +2 -0
- package/dist/jev/guest-types.d.ts.map +1 -0
- package/dist/jev/manager.d.ts +36 -0
- package/dist/jev/manager.d.ts.map +1 -0
- package/dist/jev/observation.d.ts +59 -0
- package/dist/jev/observation.d.ts.map +1 -0
- package/dist/jev/observation.js +20 -0
- package/dist/jev/observation.js.map +7 -0
- package/dist/jev/types.d.ts +142 -0
- package/dist/jev/types.d.ts.map +1 -0
- package/dist/jev/validation.d.ts +8 -0
- package/dist/jev/validation.d.ts.map +1 -0
- package/dist/jev.d.ts +9 -0
- package/dist/jev.d.ts.map +1 -0
- package/dist/jev.js +49 -0
- package/dist/jev.js.map +7 -0
- package/dist/lifecycle/broker.d.ts +30 -0
- package/dist/lifecycle/broker.d.ts.map +1 -0
- package/dist/lifecycle/delivery-scheduler.d.ts +30 -0
- package/dist/lifecycle/delivery-scheduler.d.ts.map +1 -0
- package/dist/lifecycle/types.d.ts +91 -0
- package/dist/lifecycle/types.d.ts.map +1 -0
- package/dist/log-tail.d.ts +11 -0
- package/dist/log-tail.d.ts.map +1 -0
- package/dist/main-agent.d.ts +70 -0
- package/dist/main-agent.d.ts.map +1 -0
- package/dist/managed-host.d.ts +22 -0
- package/dist/managed-host.d.ts.map +1 -0
- package/dist/mcp.d.ts +9 -0
- package/dist/mcp.d.ts.map +1 -0
- package/dist/mcp.js +21 -0
- package/dist/mcp.js.map +7 -0
- package/dist/memory/client.d.ts +31 -0
- package/dist/memory/client.d.ts.map +1 -0
- package/dist/memory/context.d.ts +114 -0
- package/dist/memory/context.d.ts.map +1 -0
- package/dist/memory/digest.d.ts +48 -0
- package/dist/memory/digest.d.ts.map +1 -0
- package/dist/memory/digest.js +7 -0
- package/dist/memory/digest.js.map +7 -0
- package/dist/memory/discovery.d.ts +43 -0
- package/dist/memory/discovery.d.ts.map +1 -0
- package/dist/memory/discovery.js +25 -0
- package/dist/memory/discovery.js.map +7 -0
- package/dist/memory/expand-service.d.ts +4 -0
- package/dist/memory/expand-service.d.ts.map +1 -0
- package/dist/memory/host-source.d.ts +60 -0
- package/dist/memory/host-source.d.ts.map +1 -0
- package/dist/memory/index.d.ts +113 -0
- package/dist/memory/index.d.ts.map +1 -0
- package/dist/memory/lineage.d.ts +25 -0
- package/dist/memory/lineage.d.ts.map +1 -0
- package/dist/memory/normalize.d.ts +188 -0
- package/dist/memory/normalize.d.ts.map +1 -0
- package/dist/memory/normalize.js +26 -0
- package/dist/memory/normalize.js.map +7 -0
- package/dist/memory/portable.d.ts +66 -0
- package/dist/memory/portable.d.ts.map +1 -0
- package/dist/memory/provider.d.ts +15 -0
- package/dist/memory/provider.d.ts.map +1 -0
- package/dist/memory/recall-service.d.ts +5 -0
- package/dist/memory/recall-service.d.ts.map +1 -0
- package/dist/memory/regex.d.ts +19 -0
- package/dist/memory/regex.d.ts.map +1 -0
- package/dist/memory/request-cache.d.ts +49 -0
- package/dist/memory/request-cache.d.ts.map +1 -0
- package/dist/memory/request-context.d.ts +57 -0
- package/dist/memory/request-context.d.ts.map +1 -0
- package/dist/memory/request-limits.d.ts +8 -0
- package/dist/memory/request-limits.d.ts.map +1 -0
- package/dist/memory/search.d.ts +98 -0
- package/dist/memory/search.d.ts.map +1 -0
- package/dist/memory/search.js +24 -0
- package/dist/memory/search.js.map +7 -0
- package/dist/memory/sessions-service.d.ts +3 -0
- package/dist/memory/sessions-service.d.ts.map +1 -0
- package/dist/memory/source-observation.d.ts +28 -0
- package/dist/memory/source-observation.d.ts.map +1 -0
- package/dist/memory/tokenize.d.ts +24 -0
- package/dist/memory/tokenize.d.ts.map +1 -0
- package/dist/memory.d.ts +8 -0
- package/dist/memory.d.ts.map +1 -0
- package/dist/memory.js +119 -0
- package/dist/memory.js.map +7 -0
- package/dist/mesh/store.d.ts +78 -0
- package/dist/mesh/store.d.ts.map +1 -0
- package/dist/output-budget.d.ts +12 -0
- package/dist/output-budget.d.ts.map +1 -0
- package/dist/prewalk/arm.d.ts +8 -0
- package/dist/prewalk/arm.d.ts.map +1 -0
- package/dist/prewalk/controller.d.ts +66 -0
- package/dist/prewalk/controller.d.ts.map +1 -0
- package/dist/prewalk/fs-drift.d.ts +19 -0
- package/dist/prewalk/fs-drift.d.ts.map +1 -0
- package/dist/prewalk/handoff.d.ts +46 -0
- package/dist/prewalk/handoff.d.ts.map +1 -0
- package/dist/protocol.d.ts +275 -0
- package/dist/protocol.d.ts.map +1 -0
- package/dist/protocol.js +46 -0
- package/dist/protocol.js.map +7 -0
- package/dist/providers/agents-actions.d.ts +3 -0
- package/dist/providers/agents-actions.d.ts.map +1 -0
- package/dist/providers/agents-message-router.d.ts +29 -0
- package/dist/providers/agents-message-router.d.ts.map +1 -0
- package/dist/providers/agents-progress.d.ts +18 -0
- package/dist/providers/agents-progress.d.ts.map +1 -0
- package/dist/providers/agents-provider.d.ts +51 -0
- package/dist/providers/agents-provider.d.ts.map +1 -0
- package/dist/providers/arg-normalization.d.ts +15 -0
- package/dist/providers/arg-normalization.d.ts.map +1 -0
- package/dist/providers/captured-tools-provider.d.ts +23 -0
- package/dist/providers/captured-tools-provider.d.ts.map +1 -0
- package/dist/providers/compact-provider.d.ts +14 -0
- package/dist/providers/compact-provider.d.ts.map +1 -0
- package/dist/providers/components-provider.d.ts +12 -0
- package/dist/providers/components-provider.d.ts.map +1 -0
- package/dist/providers/jev-provider.d.ts +70 -0
- package/dist/providers/jev-provider.d.ts.map +1 -0
- package/dist/providers/jev-provider.js +28 -0
- package/dist/providers/jev-provider.js.map +7 -0
- package/dist/providers/mcp-descriptor-cache.d.ts +47 -0
- package/dist/providers/mcp-descriptor-cache.d.ts.map +1 -0
- package/dist/providers/mcp-provider.d.ts +47 -0
- package/dist/providers/mcp-provider.d.ts.map +1 -0
- package/dist/providers/memory-provider.d.ts +32 -0
- package/dist/providers/memory-provider.d.ts.map +1 -0
- package/dist/providers/memory-provider.js +23 -0
- package/dist/providers/memory-provider.js.map +7 -0
- package/dist/providers/mesh-provider.d.ts +17 -0
- package/dist/providers/mesh-provider.d.ts.map +1 -0
- package/dist/providers/pi-bash-cwd.d.ts +49 -0
- package/dist/providers/pi-bash-cwd.d.ts.map +1 -0
- package/dist/providers/pi-tools-provider.d.ts +25 -0
- package/dist/providers/pi-tools-provider.d.ts.map +1 -0
- package/dist/providers/schema-provider.d.ts +15 -0
- package/dist/providers/schema-provider.d.ts.map +1 -0
- package/dist/providers/state-provider.d.ts +16 -0
- package/dist/providers/state-provider.d.ts.map +1 -0
- package/dist/providers/write-diff-limits.d.ts +5 -0
- package/dist/providers/write-diff-limits.d.ts.map +1 -0
- package/dist/providers/write-preview.d.ts +3 -0
- package/dist/providers/write-preview.d.ts.map +1 -0
- package/dist/ref-names.d.ts +2 -0
- package/dist/ref-names.d.ts.map +1 -0
- package/dist/repairs/active.d.ts +7 -0
- package/dist/repairs/active.d.ts.map +1 -0
- package/dist/repairs/apply.d.ts +7 -0
- package/dist/repairs/apply.d.ts.map +1 -0
- package/dist/repairs/catalog-digest.d.ts +5 -0
- package/dist/repairs/catalog-digest.d.ts.map +1 -0
- package/dist/repairs/classify.d.ts +10 -0
- package/dist/repairs/classify.d.ts.map +1 -0
- package/dist/repairs/compiler.d.ts +33 -0
- package/dist/repairs/compiler.d.ts.map +1 -0
- package/dist/repairs/promote.d.ts +4 -0
- package/dist/repairs/promote.d.ts.map +1 -0
- package/dist/repairs/store.d.ts +10 -0
- package/dist/repairs/store.d.ts.map +1 -0
- package/dist/repairs/types.d.ts +49 -0
- package/dist/repairs/types.d.ts.map +1 -0
- package/dist/repeat-guard.d.ts +25 -0
- package/dist/repeat-guard.d.ts.map +1 -0
- package/dist/residency/actor-client.d.ts +16 -0
- package/dist/residency/actor-client.d.ts.map +1 -0
- package/dist/residency/actor-client.js +9 -0
- package/dist/residency/actor-client.js.map +7 -0
- package/dist/residency/client.d.ts +44 -0
- package/dist/residency/client.d.ts.map +1 -0
- package/dist/residency/host.d.ts +3 -0
- package/dist/residency/host.d.ts.map +1 -0
- package/dist/residency/host.js +32 -0
- package/dist/residency/host.js.map +7 -0
- package/dist/residency/launcher-owner.d.ts +7 -0
- package/dist/residency/launcher-owner.d.ts.map +1 -0
- package/dist/residency/launcher.d.ts +3 -0
- package/dist/residency/launcher.d.ts.map +1 -0
- package/dist/residency/launcher.js +154 -0
- package/dist/residency/launcher.js.map +7 -0
- package/dist/residency/pi-entry.d.ts +3 -0
- package/dist/residency/pi-entry.d.ts.map +1 -0
- package/dist/residency/pi-entry.js +48 -0
- package/dist/residency/pi-entry.js.map +7 -0
- package/dist/residency/protocol.d.ts +122 -0
- package/dist/residency/protocol.d.ts.map +1 -0
- package/dist/run-display.d.ts +3 -0
- package/dist/run-display.d.ts.map +1 -0
- package/dist/runtime/core-override-guest-types.d.ts +15 -0
- package/dist/runtime/core-override-guest-types.d.ts.map +1 -0
- package/dist/runtime/core-override-guest-types.js +9 -0
- package/dist/runtime/core-override-guest-types.js.map +7 -0
- package/dist/runtime/core-tool-properties.d.ts +6 -0
- package/dist/runtime/core-tool-properties.d.ts.map +1 -0
- package/dist/runtime/cpython-child-source.d.ts +2 -0
- package/dist/runtime/cpython-child-source.d.ts.map +1 -0
- package/dist/runtime/cpython-linux-sandbox.d.ts +2 -0
- package/dist/runtime/cpython-linux-sandbox.d.ts.map +1 -0
- package/dist/runtime/cpython-runtime.d.ts +9 -0
- package/dist/runtime/cpython-runtime.d.ts.map +1 -0
- package/dist/runtime/cpython-runtime.js +677 -0
- package/dist/runtime/cpython-runtime.js.map +7 -0
- package/dist/runtime/dynamic-guest-types.d.ts +3 -0
- package/dist/runtime/dynamic-guest-types.d.ts.map +1 -0
- package/dist/runtime/dynamic-guest-types.js +8 -0
- package/dist/runtime/dynamic-guest-types.js.map +7 -0
- package/dist/runtime/guest-code-repair.d.ts +2 -0
- package/dist/runtime/guest-code-repair.d.ts.map +1 -0
- package/dist/runtime/guest-stack-map.d.ts +11 -0
- package/dist/runtime/guest-stack-map.d.ts.map +1 -0
- package/dist/runtime/guest-types.d.ts +40 -0
- package/dist/runtime/guest-types.d.ts.map +1 -0
- package/dist/runtime/guest-types.js +13 -0
- package/dist/runtime/guest-types.js.map +7 -0
- package/dist/runtime/kernel.d.ts +30 -0
- package/dist/runtime/kernel.d.ts.map +1 -0
- package/dist/runtime/monty-bridge.d.ts +4 -0
- package/dist/runtime/monty-bridge.d.ts.map +1 -0
- package/dist/runtime/monty-runtime.d.ts +6 -0
- package/dist/runtime/monty-runtime.d.ts.map +1 -0
- package/dist/runtime/monty-runtime.js +485 -0
- package/dist/runtime/monty-runtime.js.map +7 -0
- package/dist/runtime/monty-source.d.ts +10 -0
- package/dist/runtime/monty-source.d.ts.map +1 -0
- package/dist/runtime/monty-values.d.ts +7 -0
- package/dist/runtime/monty-values.d.ts.map +1 -0
- package/dist/runtime/node-process-child-source.d.ts +2 -0
- package/dist/runtime/node-process-child-source.d.ts.map +1 -0
- package/dist/runtime/node-process-runtime.d.ts +10 -0
- package/dist/runtime/node-process-runtime.d.ts.map +1 -0
- package/dist/runtime/node-process-runtime.js +16 -0
- package/dist/runtime/node-process-runtime.js.map +7 -0
- package/dist/runtime/orchestration.d.ts +3 -0
- package/dist/runtime/orchestration.d.ts.map +1 -0
- package/dist/runtime/python-arguments.d.ts +2 -0
- package/dist/runtime/python-arguments.d.ts.map +1 -0
- package/dist/runtime/python-error-guidance.d.ts +6 -0
- package/dist/runtime/python-error-guidance.d.ts.map +1 -0
- package/dist/runtime/quickjs-runtime.d.ts +8 -0
- package/dist/runtime/quickjs-runtime.d.ts.map +1 -0
- package/dist/runtime/quickjs-runtime.js +15 -0
- package/dist/runtime/quickjs-runtime.js.map +7 -0
- package/dist/runtime/type-checker.d.ts +18 -0
- package/dist/runtime/type-checker.d.ts.map +1 -0
- package/dist/runtime/type-checker.js +11 -0
- package/dist/runtime/type-checker.js.map +7 -0
- package/dist/runtime/typescript-kernel.d.ts +14 -0
- package/dist/runtime/typescript-kernel.d.ts.map +1 -0
- package/dist/runtime/typescript-kernel.js +53 -0
- package/dist/runtime/typescript-kernel.js.map +7 -0
- package/dist/runtime-paths.d.ts +7 -0
- package/dist/runtime-paths.d.ts.map +1 -0
- package/dist/runtime-state-builtins.d.ts +26 -0
- package/dist/runtime-state-builtins.d.ts.map +1 -0
- package/dist/runtime-state-speculation.d.ts +16 -0
- package/dist/runtime-state-speculation.d.ts.map +1 -0
- package/dist/schema/controller.d.ts +35 -0
- package/dist/schema/controller.d.ts.map +1 -0
- package/dist/schema/policy.d.ts +2 -0
- package/dist/schema/policy.d.ts.map +1 -0
- package/dist/schema/types.d.ts +86 -0
- package/dist/schema/types.d.ts.map +1 -0
- package/dist/schema/workspace.d.ts +19 -0
- package/dist/schema/workspace.d.ts.map +1 -0
- package/dist/speculation/eligibility.d.ts +22 -0
- package/dist/speculation/eligibility.d.ts.map +1 -0
- package/dist/speculation/freshness.d.ts +10 -0
- package/dist/speculation/freshness.d.ts.map +1 -0
- package/dist/speculation/partial-json.d.ts +9 -0
- package/dist/speculation/partial-json.d.ts.map +1 -0
- package/dist/speculation/python-scanner.d.ts +7 -0
- package/dist/speculation/python-scanner.d.ts.map +1 -0
- package/dist/speculation/python-scanner.js +166 -0
- package/dist/speculation/python-scanner.js.map +7 -0
- package/dist/speculation/scanner.d.ts +13 -0
- package/dist/speculation/scanner.d.ts.map +1 -0
- package/dist/speculation/scanner.js +182 -0
- package/dist/speculation/scanner.js.map +7 -0
- package/dist/speculation/store.d.ts +41 -0
- package/dist/speculation/store.d.ts.map +1 -0
- package/dist/speculation/stream-tap.d.ts +30 -0
- package/dist/speculation/stream-tap.d.ts.map +1 -0
- package/dist/speculation/types.d.ts +44 -0
- package/dist/speculation/types.d.ts.map +1 -0
- package/dist/state/complexity.d.ts +13 -0
- package/dist/state/complexity.d.ts.map +1 -0
- package/dist/state/evidence-runner.d.ts +17 -0
- package/dist/state/evidence-runner.d.ts.map +1 -0
- package/dist/state/store.d.ts +76 -0
- package/dist/state/store.d.ts.map +1 -0
- package/dist/state/types.d.ts +165 -0
- package/dist/state/types.d.ts.map +1 -0
- package/dist/storage/retention.d.ts +22 -0
- package/dist/storage/retention.d.ts.map +1 -0
- package/dist/thinking.d.ts +19 -0
- package/dist/thinking.d.ts.map +1 -0
- package/dist/topology/control-plane.d.ts +58 -0
- package/dist/topology/control-plane.d.ts.map +1 -0
- package/dist/topology/participant-directory.d.ts +33 -0
- package/dist/topology/participant-directory.d.ts.map +1 -0
- package/dist/topology/peer-settle.d.ts +51 -0
- package/dist/topology/peer-settle.d.ts.map +1 -0
- package/dist/topology/records.d.ts +6 -0
- package/dist/topology/records.d.ts.map +1 -0
- package/dist/topology/types.d.ts +89 -0
- package/dist/topology/types.d.ts.map +1 -0
- package/dist/type-error-guidance.d.ts +3 -0
- package/dist/type-error-guidance.d.ts.map +1 -0
- package/dist/ui/arc-group.d.ts +17 -0
- package/dist/ui/arc-group.d.ts.map +1 -0
- package/dist/ui/border-status-editor.d.ts +22 -0
- package/dist/ui/border-status-editor.d.ts.map +1 -0
- package/dist/ui/code-preview-shell.d.ts +11 -0
- package/dist/ui/code-preview-shell.d.ts.map +1 -0
- package/dist/ui/code-preview.d.ts +53 -0
- package/dist/ui/code-preview.d.ts.map +1 -0
- package/dist/ui/controller.d.ts +20 -0
- package/dist/ui/controller.d.ts.map +1 -0
- package/dist/ui/conversation-chrome.d.ts +16 -0
- package/dist/ui/conversation-chrome.d.ts.map +1 -0
- package/dist/ui/conversation-chrome.js +11 -0
- package/dist/ui/conversation-chrome.js.map +7 -0
- package/dist/ui/conversation-commands.d.ts +12 -0
- package/dist/ui/conversation-commands.d.ts.map +1 -0
- package/dist/ui/conversation-history.d.ts +6 -0
- package/dist/ui/conversation-history.d.ts.map +1 -0
- package/dist/ui/conversation-host.d.ts +7 -0
- package/dist/ui/conversation-host.d.ts.map +1 -0
- package/dist/ui/conversation-host.js +9 -0
- package/dist/ui/conversation-host.js.map +7 -0
- package/dist/ui/conversation-native-reader-checkpoint.d.ts +8 -0
- package/dist/ui/conversation-native-reader-checkpoint.d.ts.map +1 -0
- package/dist/ui/conversation-native-reader-replay.d.ts +10 -0
- package/dist/ui/conversation-native-reader-replay.d.ts.map +1 -0
- package/dist/ui/conversation-native-reader.d.ts +110 -0
- package/dist/ui/conversation-native-reader.d.ts.map +1 -0
- package/dist/ui/conversation-native-reader.js +1050 -0
- package/dist/ui/conversation-native-reader.js.map +7 -0
- package/dist/ui/conversation-queue-store.d.ts +14 -0
- package/dist/ui/conversation-queue-store.d.ts.map +1 -0
- package/dist/ui/conversation-queue.d.ts +244 -0
- package/dist/ui/conversation-queue.d.ts.map +1 -0
- package/dist/ui/conversation-render.d.ts +104 -0
- package/dist/ui/conversation-render.d.ts.map +1 -0
- package/dist/ui/conversation-selection.d.ts +18 -0
- package/dist/ui/conversation-selection.d.ts.map +1 -0
- package/dist/ui/conversation-shortcut.d.ts +3 -0
- package/dist/ui/conversation-shortcut.d.ts.map +1 -0
- package/dist/ui/conversation-targets.d.ts +7 -0
- package/dist/ui/conversation-targets.d.ts.map +1 -0
- package/dist/ui/conversation-targets.js +12 -0
- package/dist/ui/conversation-targets.js.map +7 -0
- package/dist/ui/conversation-transcript.d.ts +25 -0
- package/dist/ui/conversation-transcript.d.ts.map +1 -0
- package/dist/ui/conversation.d.ts +219 -0
- package/dist/ui/conversation.d.ts.map +1 -0
- package/dist/ui/conversation.js +2861 -0
- package/dist/ui/conversation.js.map +7 -0
- package/dist/ui/core-tool-render.d.ts +20 -0
- package/dist/ui/core-tool-render.d.ts.map +1 -0
- package/dist/ui/dashboard-detail.d.ts +68 -0
- package/dist/ui/dashboard-detail.d.ts.map +1 -0
- package/dist/ui/dashboard-fabric-graph.d.ts +50 -0
- package/dist/ui/dashboard-fabric-graph.d.ts.map +1 -0
- package/dist/ui/dashboard-graph-controller.d.ts +52 -0
- package/dist/ui/dashboard-graph-controller.d.ts.map +1 -0
- package/dist/ui/dashboard-modal-controller.d.ts +36 -0
- package/dist/ui/dashboard-modal-controller.d.ts.map +1 -0
- package/dist/ui/dashboard-model.d.ts +111 -0
- package/dist/ui/dashboard-model.d.ts.map +1 -0
- package/dist/ui/dashboard-presentation.d.ts +6 -0
- package/dist/ui/dashboard-presentation.d.ts.map +1 -0
- package/dist/ui/dashboard.d.ts +156 -0
- package/dist/ui/dashboard.d.ts.map +1 -0
- package/dist/ui/dashboard.js +4622 -0
- package/dist/ui/dashboard.js.map +7 -0
- package/dist/ui/diff-background.d.ts +12 -0
- package/dist/ui/diff-background.d.ts.map +1 -0
- package/dist/ui/dynamic-border.d.ts +8 -0
- package/dist/ui/dynamic-border.d.ts.map +1 -0
- package/dist/ui/escape-halt.d.ts +11 -0
- package/dist/ui/escape-halt.d.ts.map +1 -0
- package/dist/ui/fabric-actor-delivery-selector.d.ts +17 -0
- package/dist/ui/fabric-actor-delivery-selector.d.ts.map +1 -0
- package/dist/ui/fabric-actor-tool-selector.d.ts +22 -0
- package/dist/ui/fabric-actor-tool-selector.d.ts.map +1 -0
- package/dist/ui/fabric-code-parser.d.ts +9 -0
- package/dist/ui/fabric-code-parser.d.ts.map +1 -0
- package/dist/ui/fabric-host-event-selector.d.ts +29 -0
- package/dist/ui/fabric-host-event-selector.d.ts.map +1 -0
- package/dist/ui/fabric-model-selector.d.ts +64 -0
- package/dist/ui/fabric-model-selector.d.ts.map +1 -0
- package/dist/ui/fabric-render.d.ts +113 -0
- package/dist/ui/fabric-render.d.ts.map +1 -0
- package/dist/ui/fabric-thinking-selector.d.ts +26 -0
- package/dist/ui/fabric-thinking-selector.d.ts.map +1 -0
- package/dist/ui/fabric-title-hint.d.ts +3 -0
- package/dist/ui/fabric-title-hint.d.ts.map +1 -0
- package/dist/ui/format.d.ts +9 -0
- package/dist/ui/format.d.ts.map +1 -0
- package/dist/ui/handoff-completion.d.ts +3 -0
- package/dist/ui/handoff-completion.d.ts.map +1 -0
- package/dist/ui/highlight.d.ts +69 -0
- package/dist/ui/highlight.d.ts.map +1 -0
- package/dist/ui/model-picker.d.ts +46 -0
- package/dist/ui/model-picker.d.ts.map +1 -0
- package/dist/ui/model-picker.js +17 -0
- package/dist/ui/model-picker.js.map +7 -0
- package/dist/ui/preview-lines.d.ts +16 -0
- package/dist/ui/preview-lines.d.ts.map +1 -0
- package/dist/ui/row-balance.d.ts +29 -0
- package/dist/ui/row-balance.d.ts.map +1 -0
- package/dist/ui/settings-component.d.ts +26 -0
- package/dist/ui/settings-component.d.ts.map +1 -0
- package/dist/ui/settings-rpc.d.ts +15 -0
- package/dist/ui/settings-rpc.d.ts.map +1 -0
- package/dist/ui/settings-section-context.d.ts +18 -0
- package/dist/ui/settings-section-context.d.ts.map +1 -0
- package/dist/ui/settings-sections-agents.d.ts +5 -0
- package/dist/ui/settings-sections-agents.d.ts.map +1 -0
- package/dist/ui/settings-sections-execution.d.ts +8 -0
- package/dist/ui/settings-sections-execution.d.ts.map +1 -0
- package/dist/ui/settings-sections-lifecycle.d.ts +6 -0
- package/dist/ui/settings-sections-lifecycle.d.ts.map +1 -0
- package/dist/ui/settings-sections-presentation.d.ts +6 -0
- package/dist/ui/settings-sections-presentation.d.ts.map +1 -0
- package/dist/ui/settings-sections.d.ts +12 -0
- package/dist/ui/settings-sections.d.ts.map +1 -0
- package/dist/ui/settings-submenus.d.ts +74 -0
- package/dist/ui/settings-submenus.d.ts.map +1 -0
- package/dist/ui/settings-values.d.ts +63 -0
- package/dist/ui/settings-values.d.ts.map +1 -0
- package/dist/ui/settings.d.ts +21 -0
- package/dist/ui/settings.d.ts.map +1 -0
- package/dist/ui/settings.js +1985 -0
- package/dist/ui/settings.js.map +7 -0
- package/dist/ui/shell-hang-keys.d.ts +11 -0
- package/dist/ui/shell-hang-keys.d.ts.map +1 -0
- package/dist/ui/shiki-language.d.ts +7 -0
- package/dist/ui/shiki-language.d.ts.map +1 -0
- package/dist/ui/shiki-theme.d.ts +7 -0
- package/dist/ui/shiki-theme.d.ts.map +1 -0
- package/dist/ui/snapshot.d.ts +17 -0
- package/dist/ui/snapshot.d.ts.map +1 -0
- package/dist/ui/spinner.d.ts +6 -0
- package/dist/ui/spinner.d.ts.map +1 -0
- package/dist/ui/state-file-preview.d.ts +13 -0
- package/dist/ui/state-file-preview.d.ts.map +1 -0
- package/dist/ui/structured.d.ts +9 -0
- package/dist/ui/structured.d.ts.map +1 -0
- package/dist/ui/tool-call-timing.d.ts +2 -0
- package/dist/ui/tool-call-timing.d.ts.map +1 -0
- package/dist/ui/tool-display.d.ts +8 -0
- package/dist/ui/tool-display.d.ts.map +1 -0
- package/dist/ui/topology.d.ts +162 -0
- package/dist/ui/topology.d.ts.map +1 -0
- package/dist/ui/transcript-parser.d.ts +18 -0
- package/dist/ui/transcript-parser.d.ts.map +1 -0
- package/dist/ui/transcript-reader.d.ts +10 -0
- package/dist/ui/transcript-reader.d.ts.map +1 -0
- package/dist/ui/transcript-sanitization.d.ts +14 -0
- package/dist/ui/transcript-sanitization.d.ts.map +1 -0
- package/dist/ui/transcript.d.ts +52 -0
- package/dist/ui/transcript.d.ts.map +1 -0
- package/dist/ui/types.d.ts +84 -0
- package/dist/ui/types.d.ts.map +1 -0
- package/dist/ui/widget.d.ts +16 -0
- package/dist/ui/widget.d.ts.map +1 -0
- package/dist/ui/word-diff/alignment.d.ts +6 -0
- package/dist/ui/word-diff/alignment.d.ts.map +1 -0
- package/dist/ui/word-diff/change-block.d.ts +18 -0
- package/dist/ui/word-diff/change-block.d.ts.map +1 -0
- package/dist/ui/word-diff/changed-line.d.ts +14 -0
- package/dist/ui/word-diff/changed-line.d.ts.map +1 -0
- package/dist/ui/word-diff/emphasis.d.ts +9 -0
- package/dist/ui/word-diff/emphasis.d.ts.map +1 -0
- package/dist/ui/word-diff/line-emphasis.d.ts +7 -0
- package/dist/ui/word-diff/line-emphasis.d.ts.map +1 -0
- package/dist/ui/word-diff/line-matching.d.ts +10 -0
- package/dist/ui/word-diff/line-matching.d.ts.map +1 -0
- package/dist/ui/word-diff/line-similarity.d.ts +16 -0
- package/dist/ui/word-diff/line-similarity.d.ts.map +1 -0
- package/dist/ui/word-diff/normalize.d.ts +3 -0
- package/dist/ui/word-diff/normalize.d.ts.map +1 -0
- package/dist/ui/word-diff/parse.d.ts +17 -0
- package/dist/ui/word-diff/parse.d.ts.map +1 -0
- package/dist/ui/word-diff/range-refinement.d.ts +5 -0
- package/dist/ui/word-diff/range-refinement.d.ts.map +1 -0
- package/dist/ui/word-diff/ranges.d.ts +11 -0
- package/dist/ui/word-diff/ranges.d.ts.map +1 -0
- package/dist/ui/word-diff/smart-filter.d.ts +3 -0
- package/dist/ui/word-diff/smart-filter.d.ts.map +1 -0
- package/dist/ui/word-diff/sparse-line-matching.d.ts +25 -0
- package/dist/ui/word-diff/sparse-line-matching.d.ts.map +1 -0
- package/dist/ui/word-diff/text-boundaries.d.ts +11 -0
- package/dist/ui/word-diff/text-boundaries.d.ts.map +1 -0
- package/dist/ui/word-diff/token-alignment.d.ts +9 -0
- package/dist/ui/word-diff/token-alignment.d.ts.map +1 -0
- package/dist/ui/word-diff/token-text-refinement.d.ts +4 -0
- package/dist/ui/word-diff/token-text-refinement.d.ts.map +1 -0
- package/dist/ui/word-diff/tokens.d.ts +16 -0
- package/dist/ui/word-diff/tokens.d.ts.map +1 -0
- package/dist/ui/word-diff/types.d.ts +10 -0
- package/dist/ui/word-diff/types.d.ts.map +1 -0
- package/dist/util.d.ts +3 -0
- package/dist/util.d.ts.map +1 -0
- package/dist/worker/model-control.d.ts +14 -0
- package/dist/worker/model-control.d.ts.map +1 -0
- package/dist/worker/model-control.js +118 -0
- package/dist/worker/model-control.js.map +7 -0
- package/dist/worker/options.d.ts +3 -0
- package/dist/worker/options.d.ts.map +1 -0
- package/dist/worker/options.js +156 -0
- package/dist/worker/options.js.map +7 -0
- package/dist/worker/run-record.d.ts +22 -0
- package/dist/worker/run-record.d.ts.map +1 -0
- package/dist/worker/run-record.js +124 -0
- package/dist/worker/run-record.js.map +7 -0
- package/dist/worker/session-export.d.ts +45 -0
- package/dist/worker/session-export.d.ts.map +1 -0
- package/dist/worker/session-export.js +91 -0
- package/dist/worker/session-export.js.map +7 -0
- package/dist/worker.d.ts +3 -0
- package/dist/worker.d.ts.map +1 -0
- package/dist/worker.js +1074 -0
- package/dist/worker.js.map +7 -0
- package/docs/agents.md +618 -0
- package/docs/architecture.md +141 -0
- package/docs/audit-trace.md +116 -0
- package/docs/certification.md +166 -0
- package/docs/compaction.md +345 -0
- package/docs/component-calculus.md +191 -0
- package/docs/components.md +330 -0
- package/docs/configuration.md +529 -0
- package/docs/entropy.md +214 -0
- package/docs/interface.md +210 -0
- package/docs/jev.md +289 -0
- package/docs/kernels.md +186 -0
- package/docs/memory-recall.md +664 -0
- package/docs/programmatic-compaction.md +205 -0
- package/docs/provider-component-calculus.md +378 -0
- package/docs/providers.md +163 -0
- package/docs/repairs.md +90 -0
- package/docs/residency-runtime.md +82 -0
- package/docs/schema-enforcement.md +166 -0
- package/docs/skills.md +50 -0
- package/docs/speculation.md +171 -0
- package/docs/state-layer.md +197 -0
- package/package.json +135 -0
- package/skillsets/python/fabric-advisor/SKILL.md +29 -0
- package/skillsets/python/fabric-ambient/SKILL.md +44 -0
- package/skillsets/python/fabric-ambient/references/setup.md +67 -0
- package/skillsets/python/fabric-council/SKILL.md +54 -0
- package/skillsets/python/fabric-exec/SKILL.md +74 -0
- package/skillsets/python/fabric-exec/references/agents.md +65 -0
- package/skillsets/python/fabric-exec/references/mcp.md +23 -0
- package/skillsets/python/fabric-exec/references/mesh.md +27 -0
- package/skillsets/python/fabric-fusion/SKILL.md +112 -0
- package/skillsets/python/fabric-guide/SKILL.md +29 -0
- package/skillsets/python/fabric-jev/SKILL.md +162 -0
- package/skillsets/python/fabric-rlm/SKILL.md +120 -0
- package/skillsets/python/fabric-schema/SKILL.md +55 -0
- package/skillsets/python/fabric-spec/SKILL.md +42 -0
- package/skillsets/python/fabric-supervisor/SKILL.md +37 -0
- package/skillsets/python/fabric-swarm/SKILL.md +40 -0
- package/skillsets/python/fabric-workflow/SKILL.md +62 -0
- package/skillsets/typescript/fabric-advisor/SKILL.md +29 -0
- package/skillsets/typescript/fabric-ambient/SKILL.md +44 -0
- package/skillsets/typescript/fabric-ambient/references/setup.md +90 -0
- package/skillsets/typescript/fabric-council/SKILL.md +94 -0
- package/skillsets/typescript/fabric-exec/SKILL.md +142 -0
- package/skillsets/typescript/fabric-exec/references/agents.md +218 -0
- package/skillsets/typescript/fabric-exec/references/mcp.md +49 -0
- package/skillsets/typescript/fabric-exec/references/mesh.md +51 -0
- package/skillsets/typescript/fabric-fusion/SKILL.md +332 -0
- package/skillsets/typescript/fabric-guide/SKILL.md +29 -0
- package/skillsets/typescript/fabric-jev/SKILL.md +159 -0
- package/skillsets/typescript/fabric-rlm/SKILL.md +284 -0
- package/skillsets/typescript/fabric-schema/SKILL.md +121 -0
- package/skillsets/typescript/fabric-spec/SKILL.md +42 -0
- package/skillsets/typescript/fabric-supervisor/SKILL.md +37 -0
- package/skillsets/typescript/fabric-swarm/SKILL.md +80 -0
- package/skillsets/typescript/fabric-workflow/SKILL.md +133 -0
|
@@ -0,0 +1,1050 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getConversationHost
|
|
3
|
+
} from "../chunks/chunk-5SU3YXBS.js";
|
|
4
|
+
|
|
5
|
+
// src/ui/conversation-native-reader.ts
|
|
6
|
+
import fs2 from "node:fs";
|
|
7
|
+
|
|
8
|
+
// src/ui/conversation-native-reader-replay.ts
|
|
9
|
+
var NativeReaderEventReplay = class {
|
|
10
|
+
#records = /* @__PURE__ */ new Map();
|
|
11
|
+
#partials = /* @__PURE__ */ new Map();
|
|
12
|
+
#queue;
|
|
13
|
+
#next = 0;
|
|
14
|
+
constructor(records = []) {
|
|
15
|
+
for (const record of records) this.append(record);
|
|
16
|
+
}
|
|
17
|
+
append(record) {
|
|
18
|
+
const index = this.#next++;
|
|
19
|
+
if (record.type === "queue_update") {
|
|
20
|
+
if (this.#queue !== void 0) this.#records.delete(this.#queue);
|
|
21
|
+
this.#queue = index;
|
|
22
|
+
}
|
|
23
|
+
if (typeof record.toolCallId === "string") {
|
|
24
|
+
const replacesPartial = record.type === "tool_execution_start" || record.type === "tool_execution_update" && record.partialResult !== null && typeof record.partialResult === "object";
|
|
25
|
+
if (replacesPartial) {
|
|
26
|
+
const previous = this.#partials.get(record.toolCallId);
|
|
27
|
+
if (previous !== void 0) this.#records.delete(previous);
|
|
28
|
+
this.#partials.delete(record.toolCallId);
|
|
29
|
+
if (record.type === "tool_execution_update") this.#partials.set(record.toolCallId, index);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
this.#records.set(index, record);
|
|
33
|
+
}
|
|
34
|
+
records() {
|
|
35
|
+
return this.#records.values();
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// src/ui/conversation-native-reader-checkpoint.ts
|
|
40
|
+
import fs from "node:fs";
|
|
41
|
+
import os from "node:os";
|
|
42
|
+
import path from "node:path";
|
|
43
|
+
import { createHash } from "node:crypto";
|
|
44
|
+
import { deserialize, serialize } from "node:v8";
|
|
45
|
+
var remove = (directory) => {
|
|
46
|
+
try {
|
|
47
|
+
fs.rmSync(directory, { recursive: true, force: true });
|
|
48
|
+
} catch {
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
var abandoned = new FinalizationRegistry(remove);
|
|
52
|
+
var digest = (data) => createHash("sha256").update(data).digest("hex");
|
|
53
|
+
var NativeReaderCheckpoint = class {
|
|
54
|
+
#directory;
|
|
55
|
+
#digest;
|
|
56
|
+
constructor(value) {
|
|
57
|
+
const data = serialize(value);
|
|
58
|
+
this.#digest = digest(data);
|
|
59
|
+
this.#directory = fs.mkdtempSync(path.join(os.tmpdir(), "pi-native-reader-"));
|
|
60
|
+
try {
|
|
61
|
+
fs.chmodSync(this.#directory, 448);
|
|
62
|
+
const temporary = path.join(this.#directory, "pending");
|
|
63
|
+
fs.writeFileSync(temporary, data, { flag: "wx", mode: 384 });
|
|
64
|
+
fs.renameSync(temporary, path.join(this.#directory, "checkpoint"));
|
|
65
|
+
} catch (error) {
|
|
66
|
+
remove(this.#directory);
|
|
67
|
+
throw error;
|
|
68
|
+
}
|
|
69
|
+
abandoned.register(this, this.#directory, this);
|
|
70
|
+
}
|
|
71
|
+
restore() {
|
|
72
|
+
const file = path.join(this.#directory, "checkpoint");
|
|
73
|
+
const descriptor = fs.openSync(file, fs.constants.O_RDONLY | (fs.constants.O_NOFOLLOW ?? 0));
|
|
74
|
+
try {
|
|
75
|
+
const data = fs.readFileSync(descriptor);
|
|
76
|
+
if (digest(data) !== this.#digest) throw new Error("reader checkpoint checksum mismatch");
|
|
77
|
+
return deserialize(data);
|
|
78
|
+
} finally {
|
|
79
|
+
fs.closeSync(descriptor);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
dispose() {
|
|
83
|
+
remove(this.#directory);
|
|
84
|
+
abandoned.unregister(this);
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
// src/ui/conversation-native-reader.ts
|
|
89
|
+
var INITIAL_PAGE_BYTES = 256 * 1024;
|
|
90
|
+
var OLDER_PAGE_BYTES = 256 * 1024;
|
|
91
|
+
var GROWTH_PAGE_BYTES = 1024 * 1024;
|
|
92
|
+
var CLASSIFY_PROBE_BYTES = 4096;
|
|
93
|
+
var MAX_ERROR_CHARS = 200;
|
|
94
|
+
var emptyUsage = () => ({
|
|
95
|
+
input: 0,
|
|
96
|
+
output: 0,
|
|
97
|
+
cacheRead: 0,
|
|
98
|
+
cacheWrite: 0,
|
|
99
|
+
totalTokens: 0,
|
|
100
|
+
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 }
|
|
101
|
+
});
|
|
102
|
+
var parseRecord = (raw) => {
|
|
103
|
+
try {
|
|
104
|
+
const parsed = JSON.parse(raw);
|
|
105
|
+
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) return void 0;
|
|
106
|
+
return parsed;
|
|
107
|
+
} catch {
|
|
108
|
+
return void 0;
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
var isSessionEntry = (value) => typeof value === "object" && value !== null && typeof value.type === "string" && typeof value.id === "string" && (value.parentId === null || typeof value.parentId === "string");
|
|
112
|
+
var messageFingerprint = (message) => {
|
|
113
|
+
if ("content" in message) return JSON.stringify(message.content);
|
|
114
|
+
if ("summary" in message) return JSON.stringify(message.summary);
|
|
115
|
+
return "";
|
|
116
|
+
};
|
|
117
|
+
var messageKey = (message) => {
|
|
118
|
+
if (message.role === "toolResult") return `toolResult:${message.toolCallId}`;
|
|
119
|
+
if (message.role === "assistant") {
|
|
120
|
+
const calls = message.content.filter((block) => block.type === "toolCall").map((block) => block.id);
|
|
121
|
+
if (calls.length > 0) return `assistant:${message.timestamp}:calls:${calls.join(",")}`;
|
|
122
|
+
}
|
|
123
|
+
return `${message.role}:${message.timestamp}:${messageFingerprint(message)}`;
|
|
124
|
+
};
|
|
125
|
+
var clipError = (error) => {
|
|
126
|
+
const text = error instanceof Error ? error.message : String(error);
|
|
127
|
+
return text.length > MAX_ERROR_CHARS ? `${text.slice(0, MAX_ERROR_CHARS)}\u2026` : text;
|
|
128
|
+
};
|
|
129
|
+
var readBackwardPage = (descriptor, end, budget, includeFinalPartialLine) => {
|
|
130
|
+
let windowBudget = Math.max(budget, 1);
|
|
131
|
+
for (; ; ) {
|
|
132
|
+
const candidate = Math.max(0, end - windowBudget);
|
|
133
|
+
const buffer = Buffer.allocUnsafe(end - candidate);
|
|
134
|
+
const bytesRead = fs2.readSync(descriptor, buffer, 0, buffer.length, candidate);
|
|
135
|
+
const data = buffer.subarray(0, Math.max(0, bytesRead));
|
|
136
|
+
if (data.length === 0) return { start: candidate, end: candidate, records: [] };
|
|
137
|
+
const firstNewline = data.indexOf(10);
|
|
138
|
+
if (firstNewline === -1) {
|
|
139
|
+
if (candidate === 0) {
|
|
140
|
+
const raw = data.toString("utf8").replace(/\r$/, "");
|
|
141
|
+
return includeFinalPartialLine && raw && parseRecord(raw) ? { start: 0, end, records: [raw] } : { start: 0, end: 0, records: [] };
|
|
142
|
+
}
|
|
143
|
+
windowBudget = Math.min(windowBudget * 2, end);
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
const alignStart = candidate > 0 ? firstNewline + 1 : 0;
|
|
147
|
+
const records = [];
|
|
148
|
+
let lineStart = alignStart;
|
|
149
|
+
let lastComplete = alignStart;
|
|
150
|
+
for (let index = alignStart; index < data.length; index++) {
|
|
151
|
+
if (data[index] !== 10) continue;
|
|
152
|
+
const raw = data.subarray(lineStart, index).toString("utf8").replace(/\r$/, "");
|
|
153
|
+
if (raw) records.push(raw);
|
|
154
|
+
lineStart = index + 1;
|
|
155
|
+
lastComplete = lineStart;
|
|
156
|
+
}
|
|
157
|
+
if (records.length === 0 && candidate > 0) {
|
|
158
|
+
windowBudget = Math.min(windowBudget * 2, end);
|
|
159
|
+
continue;
|
|
160
|
+
}
|
|
161
|
+
let endOffset = end;
|
|
162
|
+
if (lastComplete < data.length) {
|
|
163
|
+
const tail = data.subarray(lastComplete).toString("utf8").replace(/\r$/, "");
|
|
164
|
+
if (includeFinalPartialLine && tail && parseRecord(tail)) {
|
|
165
|
+
records.push(tail);
|
|
166
|
+
} else {
|
|
167
|
+
endOffset = candidate + lastComplete;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
return { start: candidate + alignStart, end: endOffset, records };
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
var readForwardPage = (descriptor, start, size, budget) => {
|
|
174
|
+
let windowBudget = Math.max(budget, 1);
|
|
175
|
+
for (; ; ) {
|
|
176
|
+
const limit = Math.min(size, start + windowBudget);
|
|
177
|
+
if (limit <= start) return { start, end: start, records: [] };
|
|
178
|
+
const buffer = Buffer.allocUnsafe(limit - start);
|
|
179
|
+
const bytesRead = fs2.readSync(descriptor, buffer, 0, buffer.length, start);
|
|
180
|
+
const data = buffer.subarray(0, Math.max(0, bytesRead));
|
|
181
|
+
if (data.length === 0) return { start, end: start, records: [] };
|
|
182
|
+
const records = [];
|
|
183
|
+
let lineStart = 0;
|
|
184
|
+
let lastComplete = 0;
|
|
185
|
+
for (let index = 0; index < data.length; index++) {
|
|
186
|
+
if (data[index] !== 10) continue;
|
|
187
|
+
const raw = data.subarray(lineStart, index).toString("utf8").replace(/\r$/, "");
|
|
188
|
+
if (raw) records.push(raw);
|
|
189
|
+
lineStart = index + 1;
|
|
190
|
+
lastComplete = lineStart;
|
|
191
|
+
}
|
|
192
|
+
if (lastComplete < data.length) {
|
|
193
|
+
const tail = data.subarray(lastComplete).toString("utf8").replace(/\r$/, "");
|
|
194
|
+
if (limit >= size && tail && parseRecord(tail)) {
|
|
195
|
+
records.push(tail);
|
|
196
|
+
lastComplete = data.length;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
if (lastComplete === 0 && limit < size) {
|
|
200
|
+
windowBudget = Math.min(windowBudget * 2, size - start);
|
|
201
|
+
continue;
|
|
202
|
+
}
|
|
203
|
+
return { start, end: start + lastComplete, records };
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
var classifyFile = (filePath) => {
|
|
207
|
+
let descriptor;
|
|
208
|
+
try {
|
|
209
|
+
const noFollow = typeof fs2.constants.O_NOFOLLOW === "number" ? fs2.constants.O_NOFOLLOW : 0;
|
|
210
|
+
descriptor = fs2.openSync(filePath, fs2.constants.O_RDONLY | noFollow);
|
|
211
|
+
const stat = fs2.fstatSync(descriptor);
|
|
212
|
+
if (!stat.isFile()) return "unreadable";
|
|
213
|
+
const buffer = Buffer.allocUnsafe(Math.max(1, Math.min(CLASSIFY_PROBE_BYTES, stat.size)));
|
|
214
|
+
const bytesRead = fs2.readSync(descriptor, buffer, 0, buffer.length, 0);
|
|
215
|
+
const head = buffer.subarray(0, Math.max(0, bytesRead)).toString("utf8");
|
|
216
|
+
const firstLine = head.split("\n", 1)[0] ?? "";
|
|
217
|
+
const parsed = parseRecord(firstLine);
|
|
218
|
+
return parsed?.type === "session" ? "session" : "events";
|
|
219
|
+
} catch {
|
|
220
|
+
return "unreadable";
|
|
221
|
+
} finally {
|
|
222
|
+
if (descriptor !== void 0) closeQuietly(descriptor);
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
var openDescriptor = (filePath) => {
|
|
226
|
+
try {
|
|
227
|
+
const noFollow = typeof fs2.constants.O_NOFOLLOW === "number" ? fs2.constants.O_NOFOLLOW : 0;
|
|
228
|
+
const descriptor = fs2.openSync(filePath, fs2.constants.O_RDONLY | noFollow);
|
|
229
|
+
const stat = fs2.fstatSync(descriptor);
|
|
230
|
+
if (!stat.isFile()) {
|
|
231
|
+
closeQuietly(descriptor);
|
|
232
|
+
return { error: "not a regular file" };
|
|
233
|
+
}
|
|
234
|
+
return { descriptor, size: stat.size };
|
|
235
|
+
} catch (error) {
|
|
236
|
+
return { error: clipError(error) };
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
var closeQuietly = (descriptor) => {
|
|
240
|
+
try {
|
|
241
|
+
fs2.closeSync(descriptor);
|
|
242
|
+
} catch {
|
|
243
|
+
}
|
|
244
|
+
};
|
|
245
|
+
var NativeConversationReader = class _NativeConversationReader {
|
|
246
|
+
#sourceId = "";
|
|
247
|
+
#status = "";
|
|
248
|
+
#sessionFile;
|
|
249
|
+
#eventsFile;
|
|
250
|
+
#entries = [];
|
|
251
|
+
#entryIds = /* @__PURE__ */ new Set();
|
|
252
|
+
#byId = /* @__PURE__ */ new Map();
|
|
253
|
+
#sessionEntryIds = /* @__PURE__ */ new Set();
|
|
254
|
+
#eventEntryIds = /* @__PURE__ */ new Set();
|
|
255
|
+
#sessionLeafId;
|
|
256
|
+
#eventLeafId;
|
|
257
|
+
#sessionId;
|
|
258
|
+
#streamed = /* @__PURE__ */ new Map();
|
|
259
|
+
#streamedOrder = [];
|
|
260
|
+
#partial;
|
|
261
|
+
#eventReplay = new NativeReaderEventReplay();
|
|
262
|
+
#pendingMessages;
|
|
263
|
+
#partialArgsRaw = /* @__PURE__ */ new Map();
|
|
264
|
+
#tools = /* @__PURE__ */ new Map();
|
|
265
|
+
#windows = /* @__PURE__ */ new Map();
|
|
266
|
+
#followed = true;
|
|
267
|
+
#revision = -1;
|
|
268
|
+
#error;
|
|
269
|
+
#snapshot;
|
|
270
|
+
#treeDirty = true;
|
|
271
|
+
#messagesDirty = true;
|
|
272
|
+
#streamingDirty = true;
|
|
273
|
+
#branch = [];
|
|
274
|
+
#branchMessages = [];
|
|
275
|
+
#messages = [];
|
|
276
|
+
#streaming = { active: false, tools: [] };
|
|
277
|
+
#pathComplete = false;
|
|
278
|
+
#persisted = /* @__PURE__ */ new Set();
|
|
279
|
+
#messageKeys = /* @__PURE__ */ new WeakMap();
|
|
280
|
+
#entryProjections = /* @__PURE__ */ new WeakMap();
|
|
281
|
+
#logClassification;
|
|
282
|
+
#checkpoint;
|
|
283
|
+
#suspendedMetadata;
|
|
284
|
+
#loadedRanges = /* @__PURE__ */ new Map();
|
|
285
|
+
/** Last transcript produced; undefined before the first successful read. */
|
|
286
|
+
get last() {
|
|
287
|
+
this.#resume();
|
|
288
|
+
return this.#snapshot;
|
|
289
|
+
}
|
|
290
|
+
/** True when decoded history is offloaded to a private disk checkpoint. */
|
|
291
|
+
get suspended() {
|
|
292
|
+
return this.#checkpoint !== void 0;
|
|
293
|
+
}
|
|
294
|
+
/** Release decoded history without depending on the original source files. */
|
|
295
|
+
suspend() {
|
|
296
|
+
if (this.#checkpoint) return true;
|
|
297
|
+
if (!this.#snapshot) return false;
|
|
298
|
+
let checkpoint;
|
|
299
|
+
try {
|
|
300
|
+
checkpoint = new NativeReaderCheckpoint(this.#captureState());
|
|
301
|
+
} catch {
|
|
302
|
+
return false;
|
|
303
|
+
}
|
|
304
|
+
const { messages: _messages, entries: _entries, streaming: _streaming, pendingMessages: _pending, ...metadata } = this.#snapshot;
|
|
305
|
+
this.#suspendedMetadata = metadata;
|
|
306
|
+
this.#checkpoint = checkpoint;
|
|
307
|
+
this.#dropDecodedState();
|
|
308
|
+
return true;
|
|
309
|
+
}
|
|
310
|
+
read(source, followLatest = true) {
|
|
311
|
+
const sourceId = typeof source?.id === "string" ? source.id : "";
|
|
312
|
+
const status = typeof source?.status === "string" ? source.status : "";
|
|
313
|
+
const explicitSession = typeof source?.sessionFile === "string" && source.sessionFile ? source.sessionFile : void 0;
|
|
314
|
+
const explicitEvents = typeof source?.eventsFile === "string" && source.eventsFile ? source.eventsFile : void 0;
|
|
315
|
+
const logFile = typeof source?.logFile === "string" ? source.logFile : void 0;
|
|
316
|
+
let sessionFile = explicitSession;
|
|
317
|
+
let eventsFile = explicitEvents;
|
|
318
|
+
let logUnresolved = false;
|
|
319
|
+
if (logFile && logFile !== explicitSession && logFile !== explicitEvents) {
|
|
320
|
+
const kind = this.#classifyLog(logFile);
|
|
321
|
+
if (kind === "session") sessionFile ??= logFile;
|
|
322
|
+
else if (kind === "events") eventsFile ??= logFile;
|
|
323
|
+
else logUnresolved = true;
|
|
324
|
+
}
|
|
325
|
+
if (sourceId === this.#sourceId && sessionFile === this.#sessionFile && !this.#resume()) {
|
|
326
|
+
this.#status = status;
|
|
327
|
+
this.#followed = followLatest !== false;
|
|
328
|
+
if (this.#suspendedMetadata) this.#suspendedMetadata = { ...this.#suspendedMetadata, status };
|
|
329
|
+
if (this.#snapshot.status !== status) {
|
|
330
|
+
this.#snapshot = { ...this.#snapshot, status, revision: ++this.#revision, updatedAt: Date.now() };
|
|
331
|
+
}
|
|
332
|
+
return this.#snapshot;
|
|
333
|
+
}
|
|
334
|
+
if (sourceId !== this.#sourceId || sessionFile !== this.#sessionFile) {
|
|
335
|
+
this.#resetPaths(sourceId, status, sessionFile, eventsFile);
|
|
336
|
+
} else {
|
|
337
|
+
this.#status = status;
|
|
338
|
+
if (eventsFile !== this.#eventsFile) {
|
|
339
|
+
this.#eventsFile = eventsFile;
|
|
340
|
+
this.#resetEventsState();
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
if (logUnresolved) {
|
|
344
|
+
this.#windows.set("events", { head: 0, tail: 0, size: 0, hasOlder: false, unavailable: true });
|
|
345
|
+
this.#setError(logFile ?? "source log unreadable");
|
|
346
|
+
}
|
|
347
|
+
this.#followed = followLatest !== false;
|
|
348
|
+
this.#ingest(this.#followed);
|
|
349
|
+
return this.#snapshot ?? this.#buildSnapshot();
|
|
350
|
+
}
|
|
351
|
+
/** Load older whole-record pages of history. Repeated calls load all of it. */
|
|
352
|
+
loadOlder(pages = 1) {
|
|
353
|
+
if (!this.#resume()) return this.#snapshot;
|
|
354
|
+
if (!this.#snapshot) return void 0;
|
|
355
|
+
for (let page = 0; page < Math.max(1, pages); page++) {
|
|
356
|
+
let progressed = false;
|
|
357
|
+
for (const [kind, filePath] of this.#windowFiles()) {
|
|
358
|
+
if (this.#loadOlderFile(kind, filePath)) progressed = true;
|
|
359
|
+
}
|
|
360
|
+
if (!progressed) break;
|
|
361
|
+
}
|
|
362
|
+
this.#snapshot = this.#buildSnapshot();
|
|
363
|
+
return this.#snapshot;
|
|
364
|
+
}
|
|
365
|
+
/** Consume any records newer than the current window (used when pinned). */
|
|
366
|
+
loadNewer() {
|
|
367
|
+
if (!this.#resume()) return this.#snapshot;
|
|
368
|
+
if (!this.#snapshot) return void 0;
|
|
369
|
+
this.#followed = true;
|
|
370
|
+
this.#ingest(true);
|
|
371
|
+
return this.#snapshot ?? void 0;
|
|
372
|
+
}
|
|
373
|
+
/** Drop the current windows and re-read from the tail of both files. */
|
|
374
|
+
loadLatest() {
|
|
375
|
+
if (!this.#resume()) return this.#snapshot;
|
|
376
|
+
if (!this.#snapshot) return void 0;
|
|
377
|
+
for (const [kind, filePath] of this.#windowFiles()) this.#initWindow(kind, filePath);
|
|
378
|
+
this.#followed = true;
|
|
379
|
+
this.#ingest(true);
|
|
380
|
+
return this.#snapshot ?? void 0;
|
|
381
|
+
}
|
|
382
|
+
/** Drop all cached state for a clean re-read. */
|
|
383
|
+
clear() {
|
|
384
|
+
this.#resetPaths("", "", void 0, void 0);
|
|
385
|
+
}
|
|
386
|
+
#captureState() {
|
|
387
|
+
return {
|
|
388
|
+
entries: this.#entries,
|
|
389
|
+
sessionEntryIds: [...this.#sessionEntryIds],
|
|
390
|
+
eventEntryIds: [...this.#eventEntryIds],
|
|
391
|
+
streamed: this.#streamedOrder.map((key) => this.#streamed.get(key)),
|
|
392
|
+
partial: this.#partial,
|
|
393
|
+
pendingMessages: this.#pendingMessages,
|
|
394
|
+
partialArgsRaw: [...this.#partialArgsRaw],
|
|
395
|
+
tools: [...this.#tools.values()],
|
|
396
|
+
eventRecords: [...this.#eventReplay.records()]
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
|
+
#dropDecodedState() {
|
|
400
|
+
this.#entries = [];
|
|
401
|
+
this.#entryIds.clear();
|
|
402
|
+
this.#byId.clear();
|
|
403
|
+
this.#sessionEntryIds.clear();
|
|
404
|
+
this.#eventEntryIds.clear();
|
|
405
|
+
this.#eventReplay = new NativeReaderEventReplay();
|
|
406
|
+
this.#resetStreamingState();
|
|
407
|
+
this.#treeDirty = true;
|
|
408
|
+
this.#pathComplete = false;
|
|
409
|
+
this.#branch = [];
|
|
410
|
+
this.#branchMessages = [];
|
|
411
|
+
this.#messages = [];
|
|
412
|
+
this.#persisted.clear();
|
|
413
|
+
this.#messageKeys = /* @__PURE__ */ new WeakMap();
|
|
414
|
+
this.#entryProjections = /* @__PURE__ */ new WeakMap();
|
|
415
|
+
this.#snapshot = void 0;
|
|
416
|
+
}
|
|
417
|
+
#restoreState(state) {
|
|
418
|
+
this.#dropDecodedState();
|
|
419
|
+
this.#entries = state.entries;
|
|
420
|
+
for (const entry of state.entries) {
|
|
421
|
+
this.#entryIds.add(entry.id);
|
|
422
|
+
this.#byId.set(entry.id, entry);
|
|
423
|
+
}
|
|
424
|
+
for (const id of state.sessionEntryIds) this.#sessionEntryIds.add(id);
|
|
425
|
+
for (const id of state.eventEntryIds) this.#eventEntryIds.add(id);
|
|
426
|
+
for (const message of state.streamed) this.#foldMessage(message);
|
|
427
|
+
this.#partial = state.partial;
|
|
428
|
+
this.#pendingMessages = state.pendingMessages;
|
|
429
|
+
for (const [index, raw] of state.partialArgsRaw) this.#partialArgsRaw.set(index, raw);
|
|
430
|
+
for (const tool of state.tools) this.#tools.set(tool.toolCallId, tool);
|
|
431
|
+
this.#eventReplay = new NativeReaderEventReplay(state.eventRecords);
|
|
432
|
+
}
|
|
433
|
+
#rememberRange(kind, page) {
|
|
434
|
+
if (page.end <= page.start) return;
|
|
435
|
+
const ranges = [...this.#loadedRanges.get(kind) ?? [], [page.start, page.end]];
|
|
436
|
+
ranges.sort((a, b) => a[0] - b[0]);
|
|
437
|
+
const merged = [];
|
|
438
|
+
for (const range of ranges) {
|
|
439
|
+
const previous = merged.at(-1);
|
|
440
|
+
if (previous && range[0] <= previous[1]) previous[1] = Math.max(previous[1], range[1]);
|
|
441
|
+
else merged.push([...range]);
|
|
442
|
+
}
|
|
443
|
+
this.#loadedRanges.set(kind, merged);
|
|
444
|
+
}
|
|
445
|
+
#restoreLoadedRanges() {
|
|
446
|
+
const restored = new _NativeConversationReader();
|
|
447
|
+
for (const [kind, filePath] of this.#windowFiles()) {
|
|
448
|
+
const ranges = this.#loadedRanges.get(kind);
|
|
449
|
+
if (!ranges?.length) continue;
|
|
450
|
+
const opened = openDescriptor(filePath);
|
|
451
|
+
if (!opened || "error" in opened) throw new Error(`${filePath}: ${opened?.error ?? "unavailable"}`);
|
|
452
|
+
try {
|
|
453
|
+
for (const [head, tail] of ranges) {
|
|
454
|
+
if (opened.size < tail) throw new Error(`${filePath}: loaded range no longer available`);
|
|
455
|
+
let offset = head;
|
|
456
|
+
while (offset < tail) {
|
|
457
|
+
const page = readForwardPage(opened.descriptor, offset, tail, GROWTH_PAGE_BYTES);
|
|
458
|
+
if (page.end <= offset) throw new Error(`${filePath}: incomplete loaded range`);
|
|
459
|
+
restored.#applyRecords(kind, page.records, true);
|
|
460
|
+
offset = page.end;
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
} finally {
|
|
464
|
+
closeQuietly(opened.descriptor);
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
return restored.#captureState();
|
|
468
|
+
}
|
|
469
|
+
#resume() {
|
|
470
|
+
const checkpoint = this.#checkpoint;
|
|
471
|
+
if (!checkpoint) return true;
|
|
472
|
+
let state;
|
|
473
|
+
try {
|
|
474
|
+
try {
|
|
475
|
+
state = checkpoint.restore();
|
|
476
|
+
} catch {
|
|
477
|
+
state = this.#restoreLoadedRanges();
|
|
478
|
+
}
|
|
479
|
+
} catch (error) {
|
|
480
|
+
const reason = clipError(`Unable to restore reader history: ${clipError(error)}`);
|
|
481
|
+
if (this.#snapshot?.error !== reason) {
|
|
482
|
+
this.#snapshot = {
|
|
483
|
+
...this.#suspendedMetadata,
|
|
484
|
+
messages: [],
|
|
485
|
+
entries: [],
|
|
486
|
+
streaming: { active: false, tools: [] },
|
|
487
|
+
revision: ++this.#revision,
|
|
488
|
+
unavailable: {
|
|
489
|
+
...this.#sessionFile ? { sessionFile: true } : {},
|
|
490
|
+
...this.#eventsFile ? { eventsFile: true } : {}
|
|
491
|
+
},
|
|
492
|
+
error: reason,
|
|
493
|
+
updatedAt: Date.now()
|
|
494
|
+
};
|
|
495
|
+
}
|
|
496
|
+
return false;
|
|
497
|
+
}
|
|
498
|
+
this.#restoreState(state);
|
|
499
|
+
this.#checkpoint = void 0;
|
|
500
|
+
this.#suspendedMetadata = void 0;
|
|
501
|
+
checkpoint.dispose();
|
|
502
|
+
this.#snapshot = this.#buildSnapshot();
|
|
503
|
+
return true;
|
|
504
|
+
}
|
|
505
|
+
#windowFiles() {
|
|
506
|
+
const files = [];
|
|
507
|
+
if (this.#sessionFile) files.push(["session", this.#sessionFile]);
|
|
508
|
+
if (this.#eventsFile) files.push(["events", this.#eventsFile]);
|
|
509
|
+
return files;
|
|
510
|
+
}
|
|
511
|
+
#setError(detail) {
|
|
512
|
+
this.#error = clipError(detail);
|
|
513
|
+
}
|
|
514
|
+
#resetPaths(sourceId, status, sessionFile, eventsFile) {
|
|
515
|
+
this.#checkpoint?.dispose();
|
|
516
|
+
this.#checkpoint = void 0;
|
|
517
|
+
this.#suspendedMetadata = void 0;
|
|
518
|
+
this.#loadedRanges.clear();
|
|
519
|
+
this.#sourceId = sourceId;
|
|
520
|
+
this.#status = status;
|
|
521
|
+
this.#sessionFile = sessionFile;
|
|
522
|
+
this.#eventsFile = eventsFile;
|
|
523
|
+
this.#entries = [];
|
|
524
|
+
this.#entryIds.clear();
|
|
525
|
+
this.#byId.clear();
|
|
526
|
+
this.#sessionEntryIds.clear();
|
|
527
|
+
this.#eventEntryIds.clear();
|
|
528
|
+
this.#sessionLeafId = void 0;
|
|
529
|
+
this.#eventLeafId = void 0;
|
|
530
|
+
this.#sessionId = void 0;
|
|
531
|
+
this.#eventReplay = new NativeReaderEventReplay();
|
|
532
|
+
this.#resetStreamingState();
|
|
533
|
+
this.#windows.clear();
|
|
534
|
+
this.#treeDirty = true;
|
|
535
|
+
this.#messagesDirty = true;
|
|
536
|
+
this.#branch = [];
|
|
537
|
+
this.#branchMessages = [];
|
|
538
|
+
this.#messages = [];
|
|
539
|
+
this.#persisted.clear();
|
|
540
|
+
this.#messageKeys = /* @__PURE__ */ new WeakMap();
|
|
541
|
+
this.#entryProjections = /* @__PURE__ */ new WeakMap();
|
|
542
|
+
this.#error = void 0;
|
|
543
|
+
this.#snapshot = void 0;
|
|
544
|
+
for (const [kind, filePath] of this.#windowFiles()) this.#initWindow(kind, filePath);
|
|
545
|
+
}
|
|
546
|
+
#resetStreamingState() {
|
|
547
|
+
this.#messagesDirty = true;
|
|
548
|
+
this.#streamingDirty = true;
|
|
549
|
+
this.#streaming = { active: false, tools: [] };
|
|
550
|
+
this.#pendingMessages = void 0;
|
|
551
|
+
this.#streamed.clear();
|
|
552
|
+
this.#streamedOrder = [];
|
|
553
|
+
this.#partial = void 0;
|
|
554
|
+
this.#partialArgsRaw.clear();
|
|
555
|
+
this.#tools.clear();
|
|
556
|
+
}
|
|
557
|
+
#resetEventsState() {
|
|
558
|
+
this.#treeDirty = true;
|
|
559
|
+
this.#eventReplay = new NativeReaderEventReplay();
|
|
560
|
+
this.#resetStreamingState();
|
|
561
|
+
this.#eventLeafId = void 0;
|
|
562
|
+
for (const id of this.#eventEntryIds) {
|
|
563
|
+
if (this.#sessionEntryIds.has(id)) continue;
|
|
564
|
+
this.#entryIds.delete(id);
|
|
565
|
+
const entry = this.#byId.get(id);
|
|
566
|
+
if (entry) {
|
|
567
|
+
this.#byId.delete(id);
|
|
568
|
+
const index = this.#entries.indexOf(entry);
|
|
569
|
+
if (index >= 0) this.#entries.splice(index, 1);
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
this.#eventEntryIds.clear();
|
|
573
|
+
this.#windows.delete("events");
|
|
574
|
+
this.#loadedRanges.delete("events");
|
|
575
|
+
this.#error = void 0;
|
|
576
|
+
if (this.#eventsFile) this.#initWindow("events", this.#eventsFile);
|
|
577
|
+
}
|
|
578
|
+
#initWindow(kind, filePath) {
|
|
579
|
+
const opened = openDescriptor(filePath);
|
|
580
|
+
if (!opened || "error" in opened) {
|
|
581
|
+
this.#windows.set(kind, {
|
|
582
|
+
head: 0,
|
|
583
|
+
tail: 0,
|
|
584
|
+
size: 0,
|
|
585
|
+
hasOlder: false,
|
|
586
|
+
unavailable: true
|
|
587
|
+
});
|
|
588
|
+
if (opened && "error" in opened) this.#setError(`${filePath}: ${opened.error}`);
|
|
589
|
+
return;
|
|
590
|
+
}
|
|
591
|
+
try {
|
|
592
|
+
const page = readBackwardPage(opened.descriptor, opened.size, INITIAL_PAGE_BYTES, kind === "events");
|
|
593
|
+
this.#applyRecords(kind, page.records, true);
|
|
594
|
+
this.#rememberRange(kind, page);
|
|
595
|
+
this.#windows.set(kind, {
|
|
596
|
+
head: page.start,
|
|
597
|
+
tail: page.end,
|
|
598
|
+
size: opened.size,
|
|
599
|
+
hasOlder: page.start > 0,
|
|
600
|
+
unavailable: false
|
|
601
|
+
});
|
|
602
|
+
} catch (error) {
|
|
603
|
+
this.#windows.set(kind, {
|
|
604
|
+
head: 0,
|
|
605
|
+
tail: 0,
|
|
606
|
+
size: 0,
|
|
607
|
+
hasOlder: false,
|
|
608
|
+
unavailable: true
|
|
609
|
+
});
|
|
610
|
+
this.#setError(`${filePath}: ${clipError(error)}`);
|
|
611
|
+
} finally {
|
|
612
|
+
closeQuietly(opened.descriptor);
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
#loadOlderFile(kind, filePath) {
|
|
616
|
+
const window = this.#windows.get(kind);
|
|
617
|
+
if (!window || !window.hasOlder || window.head <= 0) return false;
|
|
618
|
+
const opened = openDescriptor(filePath);
|
|
619
|
+
if (!opened) return false;
|
|
620
|
+
if ("error" in opened) {
|
|
621
|
+
window.unavailable = true;
|
|
622
|
+
this.#setError(`${filePath}: ${opened.error}`);
|
|
623
|
+
return false;
|
|
624
|
+
}
|
|
625
|
+
try {
|
|
626
|
+
const page = readBackwardPage(opened.descriptor, window.head, OLDER_PAGE_BYTES, false);
|
|
627
|
+
if (page.start >= window.head) return false;
|
|
628
|
+
this.#applyRecords(kind, page.records, false);
|
|
629
|
+
this.#rememberRange(kind, page);
|
|
630
|
+
window.head = page.start;
|
|
631
|
+
window.hasOlder = page.start > 0;
|
|
632
|
+
window.unavailable = false;
|
|
633
|
+
return true;
|
|
634
|
+
} finally {
|
|
635
|
+
closeQuietly(opened.descriptor);
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
#growFile(kind, filePath, followLatest) {
|
|
639
|
+
const window = this.#windows.get(kind);
|
|
640
|
+
if (!window) return false;
|
|
641
|
+
const opened = openDescriptor(filePath);
|
|
642
|
+
if (!opened) return false;
|
|
643
|
+
if ("error" in opened) {
|
|
644
|
+
window.unavailable = true;
|
|
645
|
+
this.#setError(`${filePath}: ${opened.error}`);
|
|
646
|
+
return false;
|
|
647
|
+
}
|
|
648
|
+
try {
|
|
649
|
+
window.size = opened.size;
|
|
650
|
+
window.unavailable = false;
|
|
651
|
+
if (!followLatest || opened.size <= window.tail) return false;
|
|
652
|
+
const page = readForwardPage(opened.descriptor, window.tail, opened.size, GROWTH_PAGE_BYTES);
|
|
653
|
+
if (page.end <= window.tail) return false;
|
|
654
|
+
this.#applyRecords(kind, page.records, true);
|
|
655
|
+
this.#rememberRange(kind, page);
|
|
656
|
+
window.tail = Math.max(window.tail, page.end);
|
|
657
|
+
return true;
|
|
658
|
+
} finally {
|
|
659
|
+
closeQuietly(opened.descriptor);
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
#ingest(followLatest) {
|
|
663
|
+
for (const [kind, filePath] of this.#windowFiles()) {
|
|
664
|
+
this.#growFile(kind, filePath, followLatest);
|
|
665
|
+
}
|
|
666
|
+
this.#snapshot = this.#buildSnapshot();
|
|
667
|
+
}
|
|
668
|
+
#applyRecords(kind, records, updateLeaf) {
|
|
669
|
+
const parsed = records.map(parseRecord).filter((record) => record !== void 0);
|
|
670
|
+
if (kind === "session") {
|
|
671
|
+
for (const record of parsed) this.#applySessionRecord(record, updateLeaf);
|
|
672
|
+
return;
|
|
673
|
+
}
|
|
674
|
+
if (updateLeaf) {
|
|
675
|
+
for (const record of parsed) {
|
|
676
|
+
this.#eventReplay.append(record);
|
|
677
|
+
this.#applyEventRecord(record);
|
|
678
|
+
}
|
|
679
|
+
} else {
|
|
680
|
+
const replay = new NativeReaderEventReplay(parsed);
|
|
681
|
+
for (const record of this.#eventReplay.records()) replay.append(record);
|
|
682
|
+
this.#eventReplay = replay;
|
|
683
|
+
this.#resetStreamingState();
|
|
684
|
+
this.#eventLeafId = void 0;
|
|
685
|
+
for (const record of replay.records()) this.#applyEventRecord(record);
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
#applySessionRecord(record, updateLeaf) {
|
|
689
|
+
if (record.type === "session") {
|
|
690
|
+
if (typeof record.id === "string") this.#sessionId = record.id;
|
|
691
|
+
return;
|
|
692
|
+
}
|
|
693
|
+
if (!isSessionEntry(record)) return;
|
|
694
|
+
this.#appendEntry(record, "session", updateLeaf);
|
|
695
|
+
}
|
|
696
|
+
// Entry list order is irrelevant: path construction walks byId from the leaf,
|
|
697
|
+
// so older pages and live folds can append in any order.
|
|
698
|
+
#appendEntry(entry, origin, updateLeaf = true) {
|
|
699
|
+
this.#treeDirty = true;
|
|
700
|
+
this.#messagesDirty = true;
|
|
701
|
+
if (this.#entryIds.has(entry.id)) {
|
|
702
|
+
const existing = this.#byId.get(entry.id);
|
|
703
|
+
if (existing && existing !== entry) {
|
|
704
|
+
const replacement = { ...existing, ...entry };
|
|
705
|
+
this.#entries[this.#entries.indexOf(existing)] = replacement;
|
|
706
|
+
this.#byId.set(entry.id, replacement);
|
|
707
|
+
}
|
|
708
|
+
(origin === "session" ? this.#sessionEntryIds : this.#eventEntryIds).add(entry.id);
|
|
709
|
+
if (updateLeaf) {
|
|
710
|
+
if (origin === "session") this.#sessionLeafId = entry.id;
|
|
711
|
+
else this.#eventLeafId = entry.id;
|
|
712
|
+
}
|
|
713
|
+
return;
|
|
714
|
+
}
|
|
715
|
+
this.#entryIds.add(entry.id);
|
|
716
|
+
this.#byId.set(entry.id, entry);
|
|
717
|
+
(origin === "session" ? this.#sessionEntryIds : this.#eventEntryIds).add(entry.id);
|
|
718
|
+
this.#entries.push(entry);
|
|
719
|
+
if (!updateLeaf) return;
|
|
720
|
+
if (origin === "session") this.#sessionLeafId = entry.id;
|
|
721
|
+
else this.#eventLeafId = entry.id;
|
|
722
|
+
}
|
|
723
|
+
#applyEventRecord(event) {
|
|
724
|
+
switch (event.type) {
|
|
725
|
+
case "queue_update": {
|
|
726
|
+
const strings = (value) => Array.isArray(value) ? value.filter((item) => typeof item === "string") : [];
|
|
727
|
+
this.#pendingMessages = { steering: strings(event.steering), followUp: strings(event.followUp) };
|
|
728
|
+
return;
|
|
729
|
+
}
|
|
730
|
+
case "message_start": {
|
|
731
|
+
const message = event.message;
|
|
732
|
+
if (!message || typeof message !== "object") return;
|
|
733
|
+
if (message.role === "assistant") {
|
|
734
|
+
this.#streamingDirty = true;
|
|
735
|
+
this.#partial = {
|
|
736
|
+
...message,
|
|
737
|
+
content: message.content.map((part) => ({ ...part })),
|
|
738
|
+
usage: message.usage ?? emptyUsage(),
|
|
739
|
+
stopReason: message.stopReason && message.stopReason !== "pending" ? message.stopReason : "pending"
|
|
740
|
+
};
|
|
741
|
+
} else {
|
|
742
|
+
this.#foldMessage(message);
|
|
743
|
+
}
|
|
744
|
+
return;
|
|
745
|
+
}
|
|
746
|
+
case "message_update":
|
|
747
|
+
this.#applyPartialDelta(event);
|
|
748
|
+
return;
|
|
749
|
+
case "message_end": {
|
|
750
|
+
const message = event.message;
|
|
751
|
+
if (!message || typeof message !== "object") return;
|
|
752
|
+
if (message.role === "assistant") {
|
|
753
|
+
this.#streamingDirty = true;
|
|
754
|
+
this.#partial = void 0;
|
|
755
|
+
this.#partialArgsRaw.clear();
|
|
756
|
+
}
|
|
757
|
+
this.#foldMessage(message);
|
|
758
|
+
return;
|
|
759
|
+
}
|
|
760
|
+
case "tool_execution_start": {
|
|
761
|
+
if (typeof event.toolCallId !== "string") return;
|
|
762
|
+
this.#streamingDirty = true;
|
|
763
|
+
const args = event.args;
|
|
764
|
+
this.#tools.set(event.toolCallId, {
|
|
765
|
+
toolCallId: event.toolCallId,
|
|
766
|
+
toolName: typeof event.toolName === "string" ? event.toolName : "",
|
|
767
|
+
...args !== void 0 ? { args } : {},
|
|
768
|
+
status: "running",
|
|
769
|
+
executionStarted: true,
|
|
770
|
+
argsComplete: true
|
|
771
|
+
});
|
|
772
|
+
return;
|
|
773
|
+
}
|
|
774
|
+
case "tool_execution_update": {
|
|
775
|
+
const tool = this.#toolFor(event);
|
|
776
|
+
if (!tool) return;
|
|
777
|
+
this.#streamingDirty = true;
|
|
778
|
+
const partial = event.partialResult;
|
|
779
|
+
if (partial && typeof partial === "object") {
|
|
780
|
+
tool.partial = {
|
|
781
|
+
...Array.isArray(partial.content) ? { content: partial.content } : {},
|
|
782
|
+
...partial.details !== void 0 ? { details: partial.details } : {}
|
|
783
|
+
};
|
|
784
|
+
}
|
|
785
|
+
return;
|
|
786
|
+
}
|
|
787
|
+
case "tool_execution_end": {
|
|
788
|
+
const tool = this.#toolFor(event);
|
|
789
|
+
if (!tool) return;
|
|
790
|
+
this.#streamingDirty = true;
|
|
791
|
+
const result = event.result;
|
|
792
|
+
if (result && typeof result === "object") {
|
|
793
|
+
tool.result = {
|
|
794
|
+
...Array.isArray(result.content) ? { content: result.content } : {},
|
|
795
|
+
...result.details !== void 0 ? { details: result.details } : {}
|
|
796
|
+
};
|
|
797
|
+
}
|
|
798
|
+
tool.isError = event.isError === true;
|
|
799
|
+
tool.status = event.isError === true ? "failed" : "completed";
|
|
800
|
+
tool.executionStarted = true;
|
|
801
|
+
tool.argsComplete = true;
|
|
802
|
+
return;
|
|
803
|
+
}
|
|
804
|
+
case "turn_end": {
|
|
805
|
+
const message = event.message;
|
|
806
|
+
if (message && typeof message === "object") this.#foldMessage(message);
|
|
807
|
+
if (Array.isArray(event.toolResults)) {
|
|
808
|
+
for (const result of event.toolResults) {
|
|
809
|
+
if (result && typeof result === "object") this.#foldMessage(result);
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
return;
|
|
813
|
+
}
|
|
814
|
+
case "agent_end": {
|
|
815
|
+
if (!Array.isArray(event.messages)) return;
|
|
816
|
+
for (const message of event.messages) {
|
|
817
|
+
if (message && typeof message === "object") this.#foldMessage(message);
|
|
818
|
+
}
|
|
819
|
+
return;
|
|
820
|
+
}
|
|
821
|
+
case "entry_appended": {
|
|
822
|
+
if (isSessionEntry(event.entry)) this.#appendEntry(event.entry, "events");
|
|
823
|
+
return;
|
|
824
|
+
}
|
|
825
|
+
default:
|
|
826
|
+
return;
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
#toolFor(event) {
|
|
830
|
+
if (typeof event.toolCallId !== "string") return void 0;
|
|
831
|
+
const previous = this.#tools.get(event.toolCallId);
|
|
832
|
+
if (!previous) return void 0;
|
|
833
|
+
const tool = { ...previous };
|
|
834
|
+
this.#tools.set(event.toolCallId, tool);
|
|
835
|
+
return tool;
|
|
836
|
+
}
|
|
837
|
+
#applyPartialDelta(event) {
|
|
838
|
+
const delta = event.assistantMessageEvent;
|
|
839
|
+
if (!delta || typeof delta !== "object") return;
|
|
840
|
+
this.#streamingDirty = true;
|
|
841
|
+
if (!this.#partial) {
|
|
842
|
+
this.#partial = {
|
|
843
|
+
role: "assistant",
|
|
844
|
+
content: [],
|
|
845
|
+
api: "",
|
|
846
|
+
provider: "",
|
|
847
|
+
model: "",
|
|
848
|
+
usage: emptyUsage(),
|
|
849
|
+
stopReason: "pending",
|
|
850
|
+
timestamp: Date.now()
|
|
851
|
+
};
|
|
852
|
+
}
|
|
853
|
+
const partial = this.#partial;
|
|
854
|
+
if (event.usage && typeof event.usage === "object") {
|
|
855
|
+
partial.usage = event.usage;
|
|
856
|
+
}
|
|
857
|
+
const contentIndex = typeof delta.contentIndex === "number" ? delta.contentIndex : 0;
|
|
858
|
+
switch (delta.type) {
|
|
859
|
+
case "text_start":
|
|
860
|
+
partial.content[contentIndex] = { type: "text", text: "" };
|
|
861
|
+
return;
|
|
862
|
+
case "text_delta": {
|
|
863
|
+
const block = partial.content[contentIndex];
|
|
864
|
+
const text = typeof delta.delta === "string" ? delta.delta : "";
|
|
865
|
+
partial.content[contentIndex] = {
|
|
866
|
+
type: "text",
|
|
867
|
+
text: (block?.type === "text" ? block.text : "") + text
|
|
868
|
+
};
|
|
869
|
+
return;
|
|
870
|
+
}
|
|
871
|
+
case "text_end": {
|
|
872
|
+
if (typeof delta.content === "string") {
|
|
873
|
+
partial.content[contentIndex] = { type: "text", text: delta.content };
|
|
874
|
+
}
|
|
875
|
+
return;
|
|
876
|
+
}
|
|
877
|
+
case "thinking_start":
|
|
878
|
+
partial.content[contentIndex] = { type: "thinking", thinking: "" };
|
|
879
|
+
return;
|
|
880
|
+
case "thinking_delta": {
|
|
881
|
+
const block = partial.content[contentIndex];
|
|
882
|
+
const text = typeof delta.delta === "string" ? delta.delta : "";
|
|
883
|
+
partial.content[contentIndex] = {
|
|
884
|
+
type: "thinking",
|
|
885
|
+
thinking: (block?.type === "thinking" ? block.thinking : "") + text
|
|
886
|
+
};
|
|
887
|
+
return;
|
|
888
|
+
}
|
|
889
|
+
case "thinking_end": {
|
|
890
|
+
if (typeof delta.content === "string") {
|
|
891
|
+
partial.content[contentIndex] = { type: "thinking", thinking: delta.content };
|
|
892
|
+
}
|
|
893
|
+
return;
|
|
894
|
+
}
|
|
895
|
+
case "toolcall_start": {
|
|
896
|
+
this.#partialArgsRaw.delete(contentIndex);
|
|
897
|
+
partial.content[contentIndex] = {
|
|
898
|
+
type: "toolCall",
|
|
899
|
+
id: typeof delta.id === "string" ? delta.id : "",
|
|
900
|
+
name: typeof delta.toolName === "string" ? delta.toolName : "",
|
|
901
|
+
arguments: {}
|
|
902
|
+
};
|
|
903
|
+
return;
|
|
904
|
+
}
|
|
905
|
+
case "toolcall_delta": {
|
|
906
|
+
const raw = typeof delta.delta === "string" ? delta.delta : "";
|
|
907
|
+
if (!raw) return;
|
|
908
|
+
const accumulated = (this.#partialArgsRaw.get(contentIndex) ?? "") + raw;
|
|
909
|
+
this.#partialArgsRaw.set(contentIndex, accumulated);
|
|
910
|
+
const parsed = parseRecord(accumulated);
|
|
911
|
+
const block = partial.content[contentIndex];
|
|
912
|
+
if (block?.type === "toolCall" && parsed) partial.content[contentIndex] = { ...block, arguments: parsed };
|
|
913
|
+
return;
|
|
914
|
+
}
|
|
915
|
+
case "toolcall_end": {
|
|
916
|
+
const toolCall = delta.toolCall;
|
|
917
|
+
if (toolCall && typeof toolCall === "object") partial.content[contentIndex] = toolCall;
|
|
918
|
+
this.#partialArgsRaw.delete(contentIndex);
|
|
919
|
+
return;
|
|
920
|
+
}
|
|
921
|
+
default:
|
|
922
|
+
return;
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
#foldMessage(message) {
|
|
926
|
+
if (!message || typeof message !== "object" || typeof message.role !== "string") return;
|
|
927
|
+
const key = this.#messageKey(message);
|
|
928
|
+
if (this.#streamed.has(key)) return;
|
|
929
|
+
this.#messagesDirty = true;
|
|
930
|
+
this.#streamed.set(key, message);
|
|
931
|
+
this.#streamedOrder.push(key);
|
|
932
|
+
}
|
|
933
|
+
#messageKey(message) {
|
|
934
|
+
let key = this.#messageKeys.get(message);
|
|
935
|
+
if (key === void 0) {
|
|
936
|
+
key = messageKey(message);
|
|
937
|
+
this.#messageKeys.set(message, key);
|
|
938
|
+
}
|
|
939
|
+
return key;
|
|
940
|
+
}
|
|
941
|
+
#classifyLog(filePath) {
|
|
942
|
+
const cached = this.#logClassification;
|
|
943
|
+
try {
|
|
944
|
+
const stat = fs2.lstatSync(filePath);
|
|
945
|
+
if (cached?.path === filePath && stat.isFile() && cached.dev === stat.dev && cached.ino === stat.ino && cached.size > 0 && (stat.size > cached.size || stat.size === cached.size && stat.mtimeMs === cached.mtimeMs)) {
|
|
946
|
+
return cached.kind;
|
|
947
|
+
}
|
|
948
|
+
const kind = classifyFile(filePath);
|
|
949
|
+
if (kind !== "unreadable") {
|
|
950
|
+
this.#logClassification = { path: filePath, kind, dev: stat.dev, ino: stat.ino, size: stat.size, mtimeMs: stat.mtimeMs };
|
|
951
|
+
return kind;
|
|
952
|
+
}
|
|
953
|
+
} catch {
|
|
954
|
+
}
|
|
955
|
+
return cached?.path === filePath ? cached.kind : "unreadable";
|
|
956
|
+
}
|
|
957
|
+
#buildSnapshot() {
|
|
958
|
+
const sessionWindow = this.#windows.get("session");
|
|
959
|
+
const eventsWindow = this.#windows.get("events");
|
|
960
|
+
const hasMore = (sessionWindow?.hasOlder ?? false) || (eventsWindow?.hasOlder ?? false);
|
|
961
|
+
const hasNewer = !this.#followed && (sessionWindow !== void 0 && sessionWindow.tail < sessionWindow.size || eventsWindow !== void 0 && eventsWindow.tail < eventsWindow.size);
|
|
962
|
+
const leafId = this.#sessionLeafId ?? this.#eventLeafId ?? null;
|
|
963
|
+
if (this.#treeDirty) {
|
|
964
|
+
this.#pathComplete = leafId !== null && this.#pathReachesRoot(leafId);
|
|
965
|
+
const branch = leafId !== null ? getConversationHost().buildContextEntries(this.#entries, leafId, this.#byId) : [];
|
|
966
|
+
const projections = branch.map((entry) => {
|
|
967
|
+
let projected = this.#entryProjections.get(entry);
|
|
968
|
+
if (!projected) {
|
|
969
|
+
projected = {
|
|
970
|
+
entry: {
|
|
971
|
+
entryId: entry.id,
|
|
972
|
+
parentId: entry.parentId,
|
|
973
|
+
entryType: entry.type,
|
|
974
|
+
timestamp: entry.timestamp,
|
|
975
|
+
...entry.type === "message" ? { message: entry.message } : {},
|
|
976
|
+
entry
|
|
977
|
+
},
|
|
978
|
+
messages: getConversationHost().sessionEntryToContextMessages(entry)
|
|
979
|
+
};
|
|
980
|
+
this.#entryProjections.set(entry, projected);
|
|
981
|
+
}
|
|
982
|
+
return projected;
|
|
983
|
+
});
|
|
984
|
+
this.#branch = projections.map((projection) => projection.entry);
|
|
985
|
+
this.#branchMessages = projections.flatMap((projection) => projection.messages);
|
|
986
|
+
this.#persisted = new Set(this.#entries.flatMap((entry) => entry.type === "message" ? [this.#messageKey(entry.message)] : []));
|
|
987
|
+
this.#treeDirty = false;
|
|
988
|
+
this.#messagesDirty = true;
|
|
989
|
+
}
|
|
990
|
+
if (this.#messagesDirty) {
|
|
991
|
+
const streamed = this.#streamedOrder.filter((key) => !this.#persisted.has(key)).map((key) => this.#streamed.get(key));
|
|
992
|
+
this.#messages = [...this.#branchMessages, ...streamed];
|
|
993
|
+
this.#messagesDirty = false;
|
|
994
|
+
}
|
|
995
|
+
if (this.#streamingDirty) {
|
|
996
|
+
const tools = [...this.#tools.values()];
|
|
997
|
+
const partialAssistant = this.#partial ? { ...this.#partial, content: [...this.#partial.content] } : void 0;
|
|
998
|
+
this.#streaming = {
|
|
999
|
+
active: partialAssistant !== void 0 || tools.some((tool) => tool.status === "running"),
|
|
1000
|
+
...partialAssistant ? { partialAssistant } : {},
|
|
1001
|
+
tools
|
|
1002
|
+
};
|
|
1003
|
+
this.#streamingDirty = false;
|
|
1004
|
+
}
|
|
1005
|
+
const historyComplete = !hasMore && this.#pathComplete && (sessionWindow?.head ?? 0) === 0 && (eventsWindow?.head ?? 0) === 0;
|
|
1006
|
+
const unavailable = {};
|
|
1007
|
+
if (sessionWindow?.unavailable) unavailable.sessionFile = true;
|
|
1008
|
+
if (eventsWindow?.unavailable) unavailable.eventsFile = true;
|
|
1009
|
+
const hasUnavailable = unavailable.sessionFile || unavailable.eventsFile;
|
|
1010
|
+
const error = hasUnavailable ? this.#error : void 0;
|
|
1011
|
+
const previous = this.#snapshot;
|
|
1012
|
+
if (previous && previous.messages === this.#messages && previous.entries === this.#branch && previous.streaming === this.#streaming && previous.pendingMessages === this.#pendingMessages && previous.leafId === leafId && previous.sourceId === this.#sourceId && previous.status === this.#status && previous.sessionFile === this.#sessionFile && previous.eventsFile === this.#eventsFile && previous.sessionId === this.#sessionId && previous.historyComplete === historyComplete && previous.hasMore === hasMore && previous.hasNewer === hasNewer && previous.unavailable?.sessionFile === unavailable.sessionFile && previous.unavailable?.eventsFile === unavailable.eventsFile && previous.error === error) return previous;
|
|
1013
|
+
return {
|
|
1014
|
+
messages: this.#messages,
|
|
1015
|
+
revision: ++this.#revision,
|
|
1016
|
+
entries: this.#branch,
|
|
1017
|
+
streaming: this.#streaming,
|
|
1018
|
+
...this.#pendingMessages ? { pendingMessages: this.#pendingMessages } : {},
|
|
1019
|
+
leafId,
|
|
1020
|
+
sourceId: this.#sourceId,
|
|
1021
|
+
status: this.#status,
|
|
1022
|
+
...this.#sessionFile ? { sessionFile: this.#sessionFile } : {},
|
|
1023
|
+
...this.#eventsFile ? { eventsFile: this.#eventsFile } : {},
|
|
1024
|
+
...this.#sessionId ? { sessionId: this.#sessionId } : {},
|
|
1025
|
+
historyComplete,
|
|
1026
|
+
hasMore,
|
|
1027
|
+
hasNewer,
|
|
1028
|
+
...hasUnavailable ? { unavailable } : {},
|
|
1029
|
+
...error ? { error } : {},
|
|
1030
|
+
updatedAt: Date.now()
|
|
1031
|
+
};
|
|
1032
|
+
}
|
|
1033
|
+
#pathReachesRoot(leafId) {
|
|
1034
|
+
let current = this.#byId.get(leafId);
|
|
1035
|
+
if (!current) return false;
|
|
1036
|
+
const guard = /* @__PURE__ */ new Set();
|
|
1037
|
+
while (current.parentId !== null) {
|
|
1038
|
+
if (guard.has(current.id)) return true;
|
|
1039
|
+
guard.add(current.id);
|
|
1040
|
+
const parent = this.#byId.get(current.parentId);
|
|
1041
|
+
if (!parent) return false;
|
|
1042
|
+
current = parent;
|
|
1043
|
+
}
|
|
1044
|
+
return true;
|
|
1045
|
+
}
|
|
1046
|
+
};
|
|
1047
|
+
export {
|
|
1048
|
+
NativeConversationReader
|
|
1049
|
+
};
|
|
1050
|
+
//# sourceMappingURL=conversation-native-reader.js.map
|