@roackb2/heddle 1.3.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -4
- package/dist/examples/conversation-engine.js +2 -2
- package/dist/examples/conversation-engine.js.map +1 -1
- package/dist/examples/cyberloop-observer.js +2 -2
- package/dist/examples/cyberloop-observer.js.map +1 -1
- package/dist/examples/heartbeat-scheduler.js +15 -11
- package/dist/examples/heartbeat-scheduler.js.map +1 -1
- package/dist/examples/heartbeat.js +5 -5
- package/dist/examples/heartbeat.js.map +1 -1
- package/dist/examples/host-events.js +4 -4
- package/dist/examples/host-events.js.map +1 -1
- package/dist/examples/programmatic-loop.js +5 -6
- package/dist/examples/programmatic-loop.js.map +1 -1
- package/dist/examples/repo-investigator.js +2 -2
- package/dist/examples/repo-investigator.js.map +1 -1
- package/dist/src/cli/ask.d.ts +1 -1
- package/dist/src/cli/ask.d.ts.map +1 -1
- package/dist/src/cli/ask.js +8 -8
- package/dist/src/cli/ask.js.map +1 -1
- package/dist/src/cli/chat/adapters/slash-command-context.d.ts.map +1 -1
- package/dist/src/cli/chat/adapters/slash-command-context.js +7 -7
- package/dist/src/cli/chat/adapters/slash-command-context.js.map +1 -1
- package/dist/src/cli/chat/components/RuntimeHostInterstitial.d.ts +1 -1
- package/dist/src/cli/chat/components/RuntimeHostInterstitial.d.ts.map +1 -1
- package/dist/src/cli/chat/hooks/controllers/run/tui-agent-turn-result.d.ts.map +1 -1
- package/dist/src/cli/chat/hooks/controllers/run/tui-agent-turn-result.js +4 -4
- package/dist/src/cli/chat/hooks/controllers/run/tui-agent-turn-result.js.map +1 -1
- package/dist/src/cli/chat/hooks/controllers/run/tui-compaction-status.d.ts +2 -3
- package/dist/src/cli/chat/hooks/controllers/run/tui-compaction-status.d.ts.map +1 -1
- package/dist/src/cli/chat/hooks/controllers/run/tui-compaction-status.js.map +1 -1
- package/dist/src/cli/chat/hooks/controllers/run/tui-direct-shell-result.d.ts.map +1 -1
- package/dist/src/cli/chat/hooks/controllers/run/tui-direct-shell-result.js +12 -8
- package/dist/src/cli/chat/hooks/controllers/run/tui-direct-shell-result.js.map +1 -1
- package/dist/src/cli/chat/hooks/controllers/run/tui-direct-shell.d.ts +1 -2
- package/dist/src/cli/chat/hooks/controllers/run/tui-direct-shell.d.ts.map +1 -1
- package/dist/src/cli/chat/hooks/controllers/run/tui-direct-shell.js +6 -7
- package/dist/src/cli/chat/hooks/controllers/run/tui-direct-shell.js.map +1 -1
- package/dist/src/cli/chat/hooks/controllers/run/tui-ordinary-turn.d.ts.map +1 -1
- package/dist/src/cli/chat/hooks/controllers/run/tui-ordinary-turn.js +16 -12
- package/dist/src/cli/chat/hooks/controllers/run/tui-ordinary-turn.js.map +1 -1
- package/dist/src/cli/chat/hooks/controllers/run/tui-run-loop-events.d.ts +1 -1
- package/dist/src/cli/chat/hooks/controllers/run/tui-run-loop-events.d.ts.map +1 -1
- package/dist/src/cli/chat/hooks/controllers/run/tui-tool-approval.d.ts +5 -4
- package/dist/src/cli/chat/hooks/controllers/run/tui-tool-approval.d.ts.map +1 -1
- package/dist/src/cli/chat/hooks/controllers/run/tui-tool-approval.js +7 -8
- package/dist/src/cli/chat/hooks/controllers/run/tui-tool-approval.js.map +1 -1
- package/dist/src/cli/chat/hooks/controllers/useAgentRunController.d.ts.map +1 -1
- package/dist/src/cli/chat/hooks/controllers/useAgentRunController.js +13 -14
- package/dist/src/cli/chat/hooks/controllers/useAgentRunController.js.map +1 -1
- package/dist/src/cli/chat/hooks/controllers/useChatAppController.d.ts.map +1 -1
- package/dist/src/cli/chat/hooks/controllers/useChatAppController.js +11 -7
- package/dist/src/cli/chat/hooks/controllers/useChatAppController.js.map +1 -1
- package/dist/src/cli/chat/hooks/useChatSessions.js +2 -2
- package/dist/src/cli/chat/hooks/useChatSessions.js.map +1 -1
- package/dist/src/cli/chat/hooks/useChatStatusSummary.d.ts +10 -4
- package/dist/src/cli/chat/hooks/useChatStatusSummary.d.ts.map +1 -1
- package/dist/src/cli/chat/hooks/useChatStatusSummary.js +2 -2
- package/dist/src/cli/chat/hooks/useChatStatusSummary.js.map +1 -1
- package/dist/src/cli/chat/hooks/useProjectApprovals.d.ts +2 -2
- package/dist/src/cli/chat/hooks/useProjectApprovals.d.ts.map +1 -1
- package/dist/src/cli/chat/hooks/useProjectApprovals.js +17 -8
- package/dist/src/cli/chat/hooks/useProjectApprovals.js.map +1 -1
- package/dist/src/cli/chat/state/compaction.d.ts +2 -1
- package/dist/src/cli/chat/state/compaction.d.ts.map +1 -1
- package/dist/src/cli/chat/state/compaction.js +1 -1
- package/dist/src/cli/chat/state/compaction.js.map +1 -1
- package/dist/src/cli/chat/submit.d.ts.map +1 -1
- package/dist/src/cli/chat/submit.js +13 -11
- package/dist/src/cli/chat/submit.js.map +1 -1
- package/dist/src/cli/chat/utils/format.d.ts +0 -4
- package/dist/src/cli/chat/utils/format.d.ts.map +1 -1
- package/dist/src/cli/chat/utils/format.js +0 -5
- package/dist/src/cli/chat/utils/format.js.map +1 -1
- package/dist/src/cli/chat/utils/runtime.d.ts +2 -4
- package/dist/src/cli/chat/utils/runtime.d.ts.map +1 -1
- package/dist/src/cli/chat/utils/runtime.js +8 -10
- package/dist/src/cli/chat/utils/runtime.js.map +1 -1
- package/dist/src/cli/heartbeat/output.d.ts +2 -2
- package/dist/src/cli/heartbeat/output.d.ts.map +1 -1
- package/dist/src/cli/heartbeat/output.js +7 -5
- package/dist/src/cli/heartbeat/output.js.map +1 -1
- package/dist/src/cli/heartbeat/store.js +2 -2
- package/dist/src/cli/heartbeat/store.js.map +1 -1
- package/dist/src/cli/heartbeat/task-commands.js +42 -30
- package/dist/src/cli/heartbeat/task-commands.js.map +1 -1
- package/dist/src/cli/heartbeat/types.d.ts +1 -1
- package/dist/src/cli/heartbeat/types.d.ts.map +1 -1
- package/dist/src/cli/heartbeat/worker.d.ts.map +1 -1
- package/dist/src/cli/heartbeat/worker.js +26 -17
- package/dist/src/cli/heartbeat/worker.js.map +1 -1
- package/dist/src/cli/main.js +13 -34
- package/dist/src/cli/main.js.map +1 -1
- package/dist/src/cli/remote/control-plane-client.d.ts +10 -10
- package/dist/src/cli/remote/control-plane-client.d.ts.map +1 -1
- package/dist/src/core/agent/constants.d.ts +4 -0
- package/dist/src/core/agent/constants.d.ts.map +1 -0
- package/dist/src/core/agent/constants.js +4 -0
- package/dist/src/core/agent/constants.js.map +1 -0
- package/dist/src/core/agent/context/index.d.ts +3 -0
- package/dist/src/core/agent/context/index.d.ts.map +1 -0
- package/dist/src/core/agent/context/index.js +2 -0
- package/dist/src/core/agent/context/index.js.map +1 -0
- package/dist/src/core/agent/context/run-context-builder.d.ts +11 -0
- package/dist/src/core/agent/context/run-context-builder.d.ts.map +1 -0
- package/dist/src/core/agent/context/run-context-builder.js +76 -0
- package/dist/src/core/agent/context/run-context-builder.js.map +1 -0
- package/dist/src/core/agent/context/types.d.ts +11 -0
- package/dist/src/core/agent/context/types.d.ts.map +1 -0
- package/dist/src/core/agent/context/types.js +2 -0
- package/dist/src/core/agent/context/types.js.map +1 -0
- package/dist/src/core/agent/finish/index.d.ts +3 -0
- package/dist/src/core/agent/finish/index.d.ts.map +1 -0
- package/dist/src/core/agent/finish/index.js +2 -0
- package/dist/src/core/agent/finish/index.js.map +1 -0
- package/dist/src/core/agent/finish/run-finisher.d.ts +16 -0
- package/dist/src/core/agent/finish/run-finisher.d.ts.map +1 -0
- package/dist/src/core/agent/finish/run-finisher.js +67 -0
- package/dist/src/core/agent/finish/run-finisher.js.map +1 -0
- package/dist/src/core/agent/finish/types.d.ts +23 -0
- package/dist/src/core/agent/finish/types.d.ts.map +1 -0
- package/dist/src/core/agent/finish/types.js +2 -0
- package/dist/src/core/agent/finish/types.js.map +1 -0
- package/dist/src/core/agent/history/history-sanitizer.d.ts +15 -0
- package/dist/src/core/agent/history/history-sanitizer.d.ts.map +1 -0
- package/dist/src/core/agent/history/history-sanitizer.js +40 -0
- package/dist/src/core/agent/history/history-sanitizer.js.map +1 -0
- package/dist/src/core/agent/history/index.d.ts +3 -0
- package/dist/src/core/agent/history/index.d.ts.map +1 -0
- package/dist/src/core/agent/history/index.js +2 -0
- package/dist/src/core/agent/history/index.js.map +1 -0
- package/dist/src/core/agent/history/types.d.ts +16 -0
- package/dist/src/core/agent/history/types.d.ts.map +1 -0
- package/dist/src/core/agent/history/types.js +2 -0
- package/dist/src/core/agent/history/types.js.map +1 -0
- package/dist/src/core/agent/index.d.ts +3 -0
- package/dist/src/core/agent/index.d.ts.map +1 -0
- package/dist/src/core/agent/index.js +2 -0
- package/dist/src/core/agent/index.js.map +1 -0
- package/dist/src/core/agent/memory/index.d.ts +3 -0
- package/dist/src/core/agent/memory/index.d.ts.map +1 -0
- package/dist/src/core/agent/memory/index.js +2 -0
- package/dist/src/core/agent/memory/index.js.map +1 -0
- package/dist/src/core/agent/memory/memory-checkpoint-tracker.d.ts +16 -0
- package/dist/src/core/agent/memory/memory-checkpoint-tracker.d.ts.map +1 -0
- package/dist/src/core/agent/memory/memory-checkpoint-tracker.js +92 -0
- package/dist/src/core/agent/memory/memory-checkpoint-tracker.js.map +1 -0
- package/dist/src/core/agent/memory/types.d.ts +13 -0
- package/dist/src/core/agent/memory/types.d.ts.map +1 -0
- package/dist/src/core/agent/memory/types.js +2 -0
- package/dist/src/core/agent/memory/types.js.map +1 -0
- package/dist/src/core/agent/model/index.d.ts +3 -0
- package/dist/src/core/agent/model/index.d.ts.map +1 -0
- package/dist/src/core/agent/model/index.js +2 -0
- package/dist/src/core/agent/model/index.js.map +1 -0
- package/dist/src/core/agent/model/model-turn-service.d.ts +12 -0
- package/dist/src/core/agent/model/model-turn-service.d.ts.map +1 -0
- package/dist/src/core/agent/model/model-turn-service.js +103 -0
- package/dist/src/core/agent/model/model-turn-service.js.map +1 -0
- package/dist/src/core/agent/model/types.d.ts +12 -0
- package/dist/src/core/agent/model/types.d.ts.map +1 -0
- package/dist/src/core/agent/model/types.js +2 -0
- package/dist/src/core/agent/model/types.js.map +1 -0
- package/dist/src/core/agent/mutation/index.d.ts +3 -0
- package/dist/src/core/agent/mutation/index.d.ts.map +1 -0
- package/dist/src/core/agent/mutation/index.js +2 -0
- package/dist/src/core/agent/mutation/index.js.map +1 -0
- package/dist/src/core/agent/mutation/mutation-tracker.d.ts +20 -0
- package/dist/src/core/agent/mutation/mutation-tracker.d.ts.map +1 -0
- package/dist/src/core/agent/mutation/mutation-tracker.js +75 -0
- package/dist/src/core/agent/mutation/mutation-tracker.js.map +1 -0
- package/dist/src/core/agent/mutation/types.d.ts +13 -0
- package/dist/src/core/agent/mutation/types.d.ts.map +1 -0
- package/dist/src/core/agent/mutation/types.js +2 -0
- package/dist/src/core/agent/mutation/types.js.map +1 -0
- package/dist/src/core/agent/planning/index.d.ts +3 -0
- package/dist/src/core/agent/planning/index.d.ts.map +1 -0
- package/dist/src/core/agent/planning/index.js +2 -0
- package/dist/src/core/agent/planning/index.js.map +1 -0
- package/dist/src/core/agent/planning/plan-state-parser.d.ts +9 -0
- package/dist/src/core/agent/planning/plan-state-parser.d.ts.map +1 -0
- package/dist/src/core/agent/planning/plan-state-parser.js +35 -0
- package/dist/src/core/agent/planning/plan-state-parser.js.map +1 -0
- package/dist/src/core/agent/planning/types.d.ts +7 -0
- package/dist/src/core/agent/planning/types.d.ts.map +1 -0
- package/dist/src/core/agent/planning/types.js +2 -0
- package/dist/src/core/agent/planning/types.js.map +1 -0
- package/dist/src/core/agent/service.d.ts +10 -0
- package/dist/src/core/agent/service.d.ts.map +1 -0
- package/dist/src/core/agent/service.js +44 -0
- package/dist/src/core/agent/service.js.map +1 -0
- package/dist/src/core/agent/tools/index.d.ts +4 -0
- package/dist/src/core/agent/tools/index.d.ts.map +1 -0
- package/dist/src/core/agent/tools/index.js +3 -0
- package/dist/src/core/agent/tools/index.js.map +1 -0
- package/dist/src/core/agent/tools/tool-dispatcher.d.ts +47 -0
- package/dist/src/core/agent/tools/tool-dispatcher.d.ts.map +1 -0
- package/dist/src/core/agent/tools/tool-dispatcher.js +123 -0
- package/dist/src/core/agent/tools/tool-dispatcher.js.map +1 -0
- package/dist/src/core/agent/tools/tool-turn-service.d.ts +13 -0
- package/dist/src/core/agent/tools/tool-turn-service.d.ts.map +1 -0
- package/dist/src/core/agent/tools/tool-turn-service.js +129 -0
- package/dist/src/core/agent/tools/tool-turn-service.js.map +1 -0
- package/dist/src/core/agent/tools/types.d.ts +19 -0
- package/dist/src/core/agent/tools/types.d.ts.map +1 -0
- package/dist/src/core/agent/tools/types.js +2 -0
- package/dist/src/core/agent/tools/types.js.map +1 -0
- package/dist/src/core/agent/types.d.ts +83 -0
- package/dist/src/core/agent/types.d.ts.map +1 -0
- package/dist/src/core/agent/types.js +2 -0
- package/dist/src/core/agent/types.js.map +1 -0
- package/dist/src/core/agent/utils/abort.d.ts +2 -0
- package/dist/src/core/agent/utils/abort.d.ts.map +1 -0
- package/dist/src/core/agent/utils/abort.js +9 -0
- package/dist/src/core/agent/utils/abort.js.map +1 -0
- package/dist/src/core/agent/utils/index.d.ts +4 -0
- package/dist/src/core/agent/utils/index.d.ts.map +1 -0
- package/dist/src/core/agent/utils/index.js +4 -0
- package/dist/src/core/agent/utils/index.js.map +1 -0
- package/dist/src/core/agent/utils/serialization.d.ts +2 -0
- package/dist/src/core/agent/utils/serialization.d.ts.map +1 -0
- package/dist/src/core/agent/utils/serialization.js +11 -0
- package/dist/src/core/agent/utils/serialization.js.map +1 -0
- package/dist/src/core/agent/utils/tool-input.d.ts +3 -0
- package/dist/src/core/agent/utils/tool-input.d.ts.map +1 -0
- package/dist/src/core/agent/{util.js → utils/tool-input.js} +1 -28
- package/dist/src/core/agent/utils/tool-input.js.map +1 -0
- package/dist/src/core/approvals/index.d.ts +5 -0
- package/dist/src/core/approvals/index.d.ts.map +1 -0
- package/dist/src/core/approvals/index.js +4 -0
- package/dist/src/core/approvals/index.js.map +1 -0
- package/dist/src/core/approvals/pending-approval.d.ts +17 -0
- package/dist/src/core/approvals/pending-approval.d.ts.map +1 -0
- package/dist/src/core/approvals/pending-approval.js +27 -0
- package/dist/src/core/approvals/pending-approval.js.map +1 -0
- package/dist/src/core/approvals/policies.d.ts +20 -0
- package/dist/src/core/approvals/policies.d.ts.map +1 -0
- package/dist/src/core/approvals/policies.js +56 -0
- package/dist/src/core/approvals/policies.js.map +1 -0
- package/dist/src/core/approvals/remembered-rules/codec.d.ts +17 -0
- package/dist/src/core/approvals/remembered-rules/codec.d.ts.map +1 -0
- package/dist/src/core/approvals/remembered-rules/codec.js +117 -0
- package/dist/src/core/approvals/remembered-rules/codec.js.map +1 -0
- package/dist/src/core/approvals/remembered-rules/index.d.ts +5 -0
- package/dist/src/core/approvals/remembered-rules/index.d.ts.map +1 -0
- package/dist/src/core/approvals/remembered-rules/index.js +4 -0
- package/dist/src/core/approvals/remembered-rules/index.js.map +1 -0
- package/dist/src/core/approvals/remembered-rules/repository.d.ts +11 -0
- package/dist/src/core/approvals/remembered-rules/repository.d.ts.map +1 -0
- package/dist/src/core/approvals/remembered-rules/repository.js +29 -0
- package/dist/src/core/approvals/remembered-rules/repository.js.map +1 -0
- package/dist/src/core/approvals/remembered-rules/schemas.d.ts +55 -0
- package/dist/src/core/approvals/remembered-rules/schemas.d.ts.map +1 -0
- package/dist/src/core/approvals/remembered-rules/schemas.js +24 -0
- package/dist/src/core/approvals/remembered-rules/schemas.js.map +1 -0
- package/dist/src/core/approvals/remembered-rules/service.d.ts +28 -0
- package/dist/src/core/approvals/remembered-rules/service.d.ts.map +1 -0
- package/dist/src/core/approvals/remembered-rules/service.js +200 -0
- package/dist/src/core/approvals/remembered-rules/service.js.map +1 -0
- package/dist/src/core/approvals/remembered-rules/types.d.ts +12 -0
- package/dist/src/core/approvals/remembered-rules/types.d.ts.map +1 -0
- package/dist/src/core/approvals/remembered-rules/types.js +2 -0
- package/dist/src/core/approvals/remembered-rules/types.js.map +1 -0
- package/dist/src/core/approvals/service.d.ts +13 -0
- package/dist/src/core/approvals/service.d.ts.map +1 -0
- package/dist/src/core/approvals/service.js +45 -0
- package/dist/src/core/approvals/service.js.map +1 -0
- package/dist/src/core/approvals/types.d.ts +24 -1
- package/dist/src/core/approvals/types.d.ts.map +1 -1
- package/dist/src/core/chat/engine/compaction/constants.d.ts +15 -0
- package/dist/src/core/chat/engine/compaction/constants.d.ts.map +1 -0
- package/dist/src/core/chat/engine/compaction/constants.js +15 -0
- package/dist/src/core/chat/engine/compaction/constants.js.map +1 -0
- package/dist/src/core/chat/engine/compaction/context-builder.d.ts +10 -0
- package/dist/src/core/chat/engine/compaction/context-builder.d.ts.map +1 -0
- package/dist/src/core/chat/engine/compaction/context-builder.js +47 -0
- package/dist/src/core/chat/engine/compaction/context-builder.js.map +1 -0
- package/dist/src/core/chat/engine/compaction/index.d.ts +3 -0
- package/dist/src/core/chat/engine/compaction/index.d.ts.map +1 -0
- package/dist/src/core/chat/engine/compaction/index.js +2 -0
- package/dist/src/core/chat/engine/compaction/index.js.map +1 -0
- package/dist/src/core/chat/engine/compaction/service.d.ts +21 -0
- package/dist/src/core/chat/engine/compaction/service.d.ts.map +1 -0
- package/dist/src/core/chat/engine/compaction/service.js +189 -0
- package/dist/src/core/chat/engine/compaction/service.js.map +1 -0
- package/dist/src/core/chat/engine/compaction/split-policy.d.ts +14 -0
- package/dist/src/core/chat/engine/compaction/split-policy.d.ts.map +1 -0
- package/dist/src/core/chat/engine/compaction/split-policy.js +52 -0
- package/dist/src/core/chat/engine/compaction/split-policy.js.map +1 -0
- package/dist/src/core/chat/engine/compaction/summarizer/context-builder.d.ts +9 -0
- package/dist/src/core/chat/engine/compaction/summarizer/context-builder.d.ts.map +1 -0
- package/dist/src/core/chat/engine/compaction/summarizer/context-builder.js +35 -0
- package/dist/src/core/chat/engine/compaction/summarizer/context-builder.js.map +1 -0
- package/dist/src/core/chat/engine/compaction/summarizer/index.d.ts +3 -0
- package/dist/src/core/chat/engine/compaction/summarizer/index.d.ts.map +1 -0
- package/dist/src/core/chat/engine/compaction/summarizer/index.js +2 -0
- package/dist/src/core/chat/engine/compaction/summarizer/index.js.map +1 -0
- package/dist/src/core/chat/engine/compaction/summarizer/prompt.d.ts +2 -0
- package/dist/src/core/chat/engine/compaction/summarizer/prompt.d.ts.map +1 -0
- package/dist/src/core/chat/engine/compaction/summarizer/prompt.js +31 -0
- package/dist/src/core/chat/engine/compaction/summarizer/prompt.js.map +1 -0
- package/dist/src/core/chat/engine/compaction/summarizer/service.d.ts +14 -0
- package/dist/src/core/chat/engine/compaction/summarizer/service.d.ts.map +1 -0
- package/dist/src/core/chat/engine/compaction/summarizer/service.js +70 -0
- package/dist/src/core/chat/engine/compaction/summarizer/service.js.map +1 -0
- package/dist/src/core/chat/engine/compaction/summarizer/types.d.ts +19 -0
- package/dist/src/core/chat/engine/compaction/summarizer/types.d.ts.map +1 -0
- package/dist/src/core/chat/engine/compaction/summarizer/types.js +2 -0
- package/dist/src/core/chat/engine/compaction/summarizer/types.js.map +1 -0
- package/dist/src/core/chat/engine/compaction/summary-message.d.ts +18 -0
- package/dist/src/core/chat/engine/compaction/summary-message.d.ts.map +1 -0
- package/dist/src/core/chat/engine/compaction/summary-message.js +46 -0
- package/dist/src/core/chat/engine/compaction/summary-message.js.map +1 -0
- package/dist/src/core/chat/engine/compaction/text.d.ts +9 -0
- package/dist/src/core/chat/engine/compaction/text.d.ts.map +1 -0
- package/dist/src/core/chat/engine/compaction/text.js +26 -0
- package/dist/src/core/chat/engine/compaction/text.js.map +1 -0
- package/dist/src/core/chat/engine/compaction/token-estimator.d.ts +14 -0
- package/dist/src/core/chat/engine/compaction/token-estimator.d.ts.map +1 -0
- package/dist/src/core/chat/engine/compaction/token-estimator.js +41 -0
- package/dist/src/core/chat/engine/compaction/token-estimator.js.map +1 -0
- package/dist/src/core/chat/engine/compaction/transcript-renderer.d.ts +10 -0
- package/dist/src/core/chat/engine/compaction/transcript-renderer.d.ts.map +1 -0
- package/dist/src/core/chat/engine/compaction/transcript-renderer.js +62 -0
- package/dist/src/core/chat/engine/compaction/transcript-renderer.js.map +1 -0
- package/dist/src/core/chat/engine/compaction/types.d.ts +66 -0
- package/dist/src/core/chat/engine/compaction/types.d.ts.map +1 -0
- package/dist/src/core/chat/engine/compaction/types.js +2 -0
- package/dist/src/core/chat/engine/compaction/types.js.map +1 -0
- package/dist/src/core/chat/engine/index.d.ts +2 -2
- package/dist/src/core/chat/engine/index.d.ts.map +1 -1
- package/dist/src/core/chat/engine/index.js +1 -1
- package/dist/src/core/chat/engine/index.js.map +1 -1
- package/dist/src/core/chat/engine/sessions/archives/file-chat-archive-repository.d.ts +27 -0
- package/dist/src/core/chat/engine/sessions/archives/file-chat-archive-repository.d.ts.map +1 -0
- package/dist/src/core/chat/engine/sessions/archives/file-chat-archive-repository.js +146 -0
- package/dist/src/core/chat/engine/sessions/archives/file-chat-archive-repository.js.map +1 -0
- package/dist/src/core/chat/engine/sessions/archives/index.d.ts +3 -0
- package/dist/src/core/chat/engine/sessions/archives/index.d.ts.map +1 -0
- package/dist/src/core/chat/engine/sessions/archives/index.js +2 -0
- package/dist/src/core/chat/engine/sessions/archives/index.js.map +1 -0
- package/dist/src/core/chat/engine/sessions/archives/types.d.ts +19 -0
- package/dist/src/core/chat/engine/sessions/archives/types.d.ts.map +1 -0
- package/dist/src/core/chat/engine/sessions/archives/types.js +2 -0
- package/dist/src/core/chat/engine/sessions/archives/types.js.map +1 -0
- package/dist/src/core/chat/engine/sessions/leases/index.d.ts +3 -0
- package/dist/src/core/chat/engine/sessions/leases/index.d.ts.map +1 -0
- package/dist/src/core/chat/engine/sessions/leases/index.js +2 -0
- package/dist/src/core/chat/engine/sessions/leases/index.js.map +1 -0
- package/dist/src/core/chat/engine/sessions/leases/leases.d.ts +25 -0
- package/dist/src/core/chat/engine/sessions/leases/leases.d.ts.map +1 -0
- package/dist/src/core/chat/engine/sessions/leases/leases.js +74 -0
- package/dist/src/core/chat/engine/sessions/leases/leases.js.map +1 -0
- package/dist/src/core/chat/engine/sessions/leases/types.d.ts +12 -0
- package/dist/src/core/chat/engine/sessions/leases/types.d.ts.map +1 -0
- package/dist/src/core/chat/engine/sessions/leases/types.js +2 -0
- package/dist/src/core/chat/engine/sessions/leases/types.js.map +1 -0
- package/dist/src/core/chat/engine/sessions/preferences/service.d.ts +2 -2
- package/dist/src/core/chat/engine/sessions/preferences/service.d.ts.map +1 -1
- package/dist/src/core/chat/engine/sessions/preferences/service.js +1 -1
- package/dist/src/core/chat/engine/sessions/preferences/service.js.map +1 -1
- package/dist/src/core/chat/engine/sessions/records/conversation-lines.d.ts +12 -0
- package/dist/src/core/chat/engine/sessions/records/conversation-lines.d.ts.map +1 -0
- package/dist/src/core/chat/engine/sessions/records/conversation-lines.js +28 -0
- package/dist/src/core/chat/engine/sessions/records/conversation-lines.js.map +1 -0
- package/dist/src/core/chat/engine/sessions/records/index.d.ts +5 -0
- package/dist/src/core/chat/engine/sessions/records/index.d.ts.map +1 -0
- package/dist/src/core/chat/engine/sessions/records/index.js +4 -0
- package/dist/src/core/chat/engine/sessions/records/index.js.map +1 -0
- package/dist/src/core/chat/engine/sessions/records/records.d.ts +21 -0
- package/dist/src/core/chat/engine/sessions/records/records.d.ts.map +1 -0
- package/dist/src/core/chat/engine/sessions/records/records.js +91 -0
- package/dist/src/core/chat/engine/sessions/records/records.js.map +1 -0
- package/dist/src/core/chat/engine/sessions/records/titles.d.ts +15 -0
- package/dist/src/core/chat/engine/sessions/records/titles.d.ts.map +1 -0
- package/dist/src/core/chat/engine/sessions/records/titles.js +19 -0
- package/dist/src/core/chat/engine/sessions/records/titles.js.map +1 -0
- package/dist/src/core/chat/engine/sessions/records/types.d.ts +35 -0
- package/dist/src/core/chat/engine/sessions/records/types.d.ts.map +1 -0
- package/dist/src/core/chat/engine/sessions/records/types.js +2 -0
- package/dist/src/core/chat/engine/sessions/records/types.js.map +1 -0
- package/dist/src/core/chat/engine/sessions/repository/chat-session-codec.d.ts +23 -0
- package/dist/src/core/chat/engine/sessions/repository/chat-session-codec.d.ts.map +1 -0
- package/dist/src/core/chat/engine/sessions/repository/chat-session-codec.js +61 -0
- package/dist/src/core/chat/engine/sessions/repository/chat-session-codec.js.map +1 -0
- package/dist/src/core/chat/engine/sessions/repository/chat-session-schemas.d.ts +369 -0
- package/dist/src/core/chat/engine/sessions/repository/chat-session-schemas.d.ts.map +1 -0
- package/dist/src/core/chat/engine/sessions/repository/chat-session-schemas.js +262 -0
- package/dist/src/core/chat/engine/sessions/repository/chat-session-schemas.js.map +1 -0
- package/dist/src/core/chat/engine/sessions/repository/file-chat-session-repository.d.ts +22 -34
- package/dist/src/core/chat/engine/sessions/repository/file-chat-session-repository.d.ts.map +1 -1
- package/dist/src/core/chat/engine/sessions/repository/file-chat-session-repository.js +168 -439
- package/dist/src/core/chat/engine/sessions/repository/file-chat-session-repository.js.map +1 -1
- package/dist/src/core/chat/engine/sessions/repository/index.d.ts +3 -0
- package/dist/src/core/chat/engine/sessions/repository/index.d.ts.map +1 -0
- package/dist/src/core/chat/engine/sessions/repository/index.js +2 -0
- package/dist/src/core/chat/engine/sessions/repository/index.js.map +1 -0
- package/dist/src/core/chat/engine/sessions/repository/types.d.ts +33 -0
- package/dist/src/core/chat/engine/sessions/repository/types.d.ts.map +1 -0
- package/dist/src/core/chat/engine/sessions/repository/types.js +2 -0
- package/dist/src/core/chat/engine/sessions/repository/types.js.map +1 -0
- package/dist/src/core/chat/engine/sessions/service.d.ts +3 -5
- package/dist/src/core/chat/engine/sessions/service.d.ts.map +1 -1
- package/dist/src/core/chat/engine/sessions/service.js +22 -26
- package/dist/src/core/chat/engine/sessions/service.js.map +1 -1
- package/dist/src/core/chat/engine/sessions/types.d.ts +6 -0
- package/dist/src/core/chat/engine/sessions/types.d.ts.map +1 -0
- package/dist/src/core/chat/engine/sessions/types.js +2 -0
- package/dist/src/core/chat/engine/sessions/types.js.map +1 -0
- package/dist/src/core/chat/engine/turns/context/index.d.ts +3 -0
- package/dist/src/core/chat/engine/turns/context/index.d.ts.map +1 -0
- package/dist/src/core/chat/engine/turns/context/index.js +2 -0
- package/dist/src/core/chat/engine/turns/context/index.js.map +1 -0
- package/dist/src/core/chat/engine/turns/context/turn-context-builder.d.ts +8 -0
- package/dist/src/core/chat/engine/turns/context/turn-context-builder.d.ts.map +1 -0
- package/dist/src/core/chat/engine/turns/context/turn-context-builder.js +36 -0
- package/dist/src/core/chat/engine/turns/context/turn-context-builder.js.map +1 -0
- package/dist/src/core/chat/engine/turns/context/types.d.ts +28 -0
- package/dist/src/core/chat/engine/turns/context/types.d.ts.map +1 -0
- package/dist/src/core/chat/engine/turns/context/types.js +2 -0
- package/dist/src/core/chat/engine/turns/context/types.js.map +1 -0
- package/dist/src/core/chat/engine/turns/failure/failure-message-formatter.d.ts +10 -0
- package/dist/src/core/chat/engine/turns/failure/failure-message-formatter.d.ts.map +1 -0
- package/dist/src/core/chat/engine/turns/failure/failure-message-formatter.js +29 -0
- package/dist/src/core/chat/engine/turns/failure/failure-message-formatter.js.map +1 -0
- package/dist/src/core/chat/engine/turns/failure/index.d.ts +3 -0
- package/dist/src/core/chat/engine/turns/failure/index.d.ts.map +1 -0
- package/dist/src/core/chat/engine/turns/failure/index.js +2 -0
- package/dist/src/core/chat/engine/turns/failure/index.js.map +1 -0
- package/dist/src/core/chat/engine/turns/failure/types.d.ts +5 -0
- package/dist/src/core/chat/engine/turns/failure/types.d.ts.map +1 -0
- package/dist/src/core/chat/engine/turns/failure/types.js +2 -0
- package/dist/src/core/chat/engine/turns/failure/types.js.map +1 -0
- package/dist/src/core/chat/engine/turns/host/host-normalizer.d.ts +9 -0
- package/dist/src/core/chat/engine/turns/host/host-normalizer.d.ts.map +1 -0
- package/dist/src/core/chat/engine/turns/host/host-normalizer.js +51 -0
- package/dist/src/core/chat/engine/turns/host/host-normalizer.js.map +1 -0
- package/dist/src/core/chat/engine/turns/host/index.d.ts +3 -0
- package/dist/src/core/chat/engine/turns/host/index.d.ts.map +1 -0
- package/dist/src/core/chat/engine/turns/host/index.js +2 -0
- package/dist/src/core/chat/engine/turns/host/index.js.map +1 -0
- package/dist/src/core/chat/engine/turns/host/types.d.ts +17 -0
- package/dist/src/core/chat/engine/turns/host/types.d.ts.map +1 -0
- package/dist/src/core/chat/engine/turns/host/types.js +2 -0
- package/dist/src/core/chat/engine/turns/host/types.js.map +1 -0
- package/dist/src/core/chat/engine/turns/memory/index.d.ts +3 -0
- package/dist/src/core/chat/engine/turns/memory/index.d.ts.map +1 -0
- package/dist/src/core/chat/engine/turns/memory/index.js +2 -0
- package/dist/src/core/chat/engine/turns/memory/index.js.map +1 -0
- package/dist/src/core/chat/engine/turns/memory/turn-memory-maintenance.d.ts +17 -0
- package/dist/src/core/chat/engine/turns/memory/turn-memory-maintenance.d.ts.map +1 -0
- package/dist/src/core/chat/engine/turns/memory/turn-memory-maintenance.js +126 -0
- package/dist/src/core/chat/engine/turns/memory/turn-memory-maintenance.js.map +1 -0
- package/dist/src/core/chat/engine/turns/memory/types.d.ts +29 -0
- package/dist/src/core/chat/engine/turns/memory/types.d.ts.map +1 -0
- package/dist/src/core/chat/engine/turns/memory/types.js +2 -0
- package/dist/src/core/chat/engine/turns/memory/types.js.map +1 -0
- package/dist/src/core/chat/engine/turns/persistence/index.d.ts +4 -0
- package/dist/src/core/chat/engine/turns/persistence/index.d.ts.map +1 -0
- package/dist/src/core/chat/engine/turns/persistence/index.js +3 -0
- package/dist/src/core/chat/engine/turns/persistence/index.js.map +1 -0
- package/dist/src/core/chat/engine/turns/persistence/turn-artifacts.d.ts +9 -0
- package/dist/src/core/chat/engine/turns/persistence/turn-artifacts.d.ts.map +1 -0
- package/dist/src/core/chat/engine/turns/persistence/turn-artifacts.js +60 -0
- package/dist/src/core/chat/engine/turns/persistence/turn-artifacts.js.map +1 -0
- package/dist/src/core/chat/engine/turns/persistence/turn-persistence-service.d.ts +10 -0
- package/dist/src/core/chat/engine/turns/persistence/turn-persistence-service.d.ts.map +1 -0
- package/dist/src/core/chat/engine/turns/persistence/turn-persistence-service.js +50 -0
- package/dist/src/core/chat/engine/turns/persistence/turn-persistence-service.js.map +1 -0
- package/dist/src/core/chat/engine/turns/persistence/types.d.ts +69 -0
- package/dist/src/core/chat/engine/turns/persistence/types.d.ts.map +1 -0
- package/dist/src/core/chat/engine/turns/persistence/types.js +2 -0
- package/dist/src/core/chat/engine/turns/persistence/types.js.map +1 -0
- package/dist/src/core/chat/engine/turns/preflight/index.d.ts +3 -0
- package/dist/src/core/chat/engine/turns/preflight/index.d.ts.map +1 -0
- package/dist/src/core/chat/engine/turns/preflight/index.js +2 -0
- package/dist/src/core/chat/engine/turns/preflight/index.js.map +1 -0
- package/dist/src/core/chat/engine/turns/preflight/turn-preflight-service.d.ts +14 -0
- package/dist/src/core/chat/engine/turns/preflight/turn-preflight-service.d.ts.map +1 -0
- package/dist/src/core/chat/engine/turns/preflight/turn-preflight-service.js +85 -0
- package/dist/src/core/chat/engine/turns/preflight/turn-preflight-service.js.map +1 -0
- package/dist/src/core/chat/engine/turns/preflight/types.d.ts +48 -0
- package/dist/src/core/chat/engine/turns/preflight/types.d.ts.map +1 -0
- package/dist/src/core/chat/engine/turns/preflight/types.js +2 -0
- package/dist/src/core/chat/engine/turns/preflight/types.js.map +1 -0
- package/dist/src/core/chat/engine/turns/runtime/index.d.ts +3 -0
- package/dist/src/core/chat/engine/turns/runtime/index.d.ts.map +1 -0
- package/dist/src/core/chat/engine/turns/runtime/index.js +2 -0
- package/dist/src/core/chat/engine/turns/runtime/index.js.map +1 -0
- package/dist/src/core/chat/engine/turns/runtime/runtime-resolver.d.ts +14 -0
- package/dist/src/core/chat/engine/turns/runtime/runtime-resolver.d.ts.map +1 -0
- package/dist/src/core/chat/engine/turns/runtime/runtime-resolver.js +69 -0
- package/dist/src/core/chat/engine/turns/runtime/runtime-resolver.js.map +1 -0
- package/dist/src/core/chat/engine/turns/runtime/types.d.ts +24 -0
- package/dist/src/core/chat/engine/turns/runtime/types.d.ts.map +1 -0
- package/dist/src/core/chat/engine/turns/runtime/types.js +2 -0
- package/dist/src/core/chat/engine/turns/runtime/types.js.map +1 -0
- package/dist/src/core/chat/engine/turns/service.d.ts +8 -2
- package/dist/src/core/chat/engine/turns/service.d.ts.map +1 -1
- package/dist/src/core/chat/engine/turns/service.js +139 -25
- package/dist/src/core/chat/engine/turns/service.js.map +1 -1
- package/dist/src/core/chat/engine/turns/trace/index.d.ts +3 -0
- package/dist/src/core/chat/engine/turns/trace/index.d.ts.map +1 -0
- package/dist/src/core/chat/engine/turns/trace/index.js +2 -0
- package/dist/src/core/chat/engine/turns/trace/index.js.map +1 -0
- package/dist/src/core/chat/engine/turns/trace/trace-writer.d.ts +8 -0
- package/dist/src/core/chat/engine/turns/trace/trace-writer.d.ts.map +1 -0
- package/dist/src/core/chat/engine/turns/trace/trace-writer.js +14 -0
- package/dist/src/core/chat/engine/turns/trace/trace-writer.js.map +1 -0
- package/dist/src/core/chat/engine/turns/trace/types.d.ts +6 -0
- package/dist/src/core/chat/engine/turns/trace/types.d.ts.map +1 -0
- package/dist/src/core/chat/engine/turns/trace/types.js +2 -0
- package/dist/src/core/chat/engine/turns/trace/types.js.map +1 -0
- package/dist/src/core/chat/engine/turns/types.d.ts +44 -0
- package/dist/src/core/chat/engine/turns/types.d.ts.map +1 -0
- package/dist/src/core/chat/engine/turns/types.js +2 -0
- package/dist/src/core/chat/engine/turns/types.js.map +1 -0
- package/dist/src/core/chat/engine/types.d.ts +11 -16
- package/dist/src/core/chat/engine/types.d.ts.map +1 -1
- package/dist/src/core/chat/types.d.ts +18 -14
- package/dist/src/core/chat/types.d.ts.map +1 -1
- package/dist/src/core/commands/slash/modules/context.d.ts +2 -2
- package/dist/src/core/commands/slash/modules/context.d.ts.map +1 -1
- package/dist/src/core/commands/slash/modules/heartbeat/heartbeat-commands.d.ts +1 -1
- package/dist/src/core/commands/slash/modules/heartbeat/heartbeat-commands.d.ts.map +1 -1
- package/dist/src/core/commands/slash/modules/heartbeat/heartbeat-commands.js +20 -18
- package/dist/src/core/commands/slash/modules/heartbeat/heartbeat-commands.js.map +1 -1
- package/dist/src/core/heartbeat/checkpoint/index.d.ts +4 -0
- package/dist/src/core/heartbeat/checkpoint/index.d.ts.map +1 -0
- package/dist/src/core/heartbeat/checkpoint/index.js +3 -0
- package/dist/src/core/heartbeat/checkpoint/index.js.map +1 -0
- package/dist/src/core/heartbeat/checkpoint/repository.d.ts +9 -0
- package/dist/src/core/heartbeat/checkpoint/repository.d.ts.map +1 -0
- package/dist/src/core/heartbeat/checkpoint/repository.js +33 -0
- package/dist/src/core/heartbeat/checkpoint/repository.js.map +1 -0
- package/dist/src/core/heartbeat/checkpoint/service.d.ts +5 -0
- package/dist/src/core/heartbeat/checkpoint/service.d.ts.map +1 -0
- package/dist/src/core/heartbeat/checkpoint/service.js +24 -0
- package/dist/src/core/heartbeat/checkpoint/service.js.map +1 -0
- package/dist/src/core/heartbeat/checkpoint/types.d.ts +17 -0
- package/dist/src/core/heartbeat/checkpoint/types.d.ts.map +1 -0
- package/dist/src/core/heartbeat/checkpoint/types.js +2 -0
- package/dist/src/core/heartbeat/checkpoint/types.js.map +1 -0
- package/dist/src/core/heartbeat/index.d.ts +11 -0
- package/dist/src/core/heartbeat/index.d.ts.map +1 -0
- package/dist/src/core/heartbeat/index.js +6 -0
- package/dist/src/core/heartbeat/index.js.map +1 -0
- package/dist/src/core/heartbeat/scheduler/index.d.ts +4 -0
- package/dist/src/core/heartbeat/scheduler/index.d.ts.map +1 -0
- package/dist/src/core/heartbeat/scheduler/index.js +3 -0
- package/dist/src/core/heartbeat/scheduler/index.js.map +1 -0
- package/dist/src/core/heartbeat/scheduler/runner.d.ts +19 -0
- package/dist/src/core/heartbeat/scheduler/runner.d.ts.map +1 -0
- package/dist/src/core/heartbeat/scheduler/runner.js +16 -0
- package/dist/src/core/heartbeat/scheduler/runner.js.map +1 -0
- package/dist/src/core/heartbeat/scheduler/service.d.ts +8 -0
- package/dist/src/core/heartbeat/scheduler/service.d.ts.map +1 -0
- package/dist/src/core/heartbeat/scheduler/service.js +125 -0
- package/dist/src/core/heartbeat/scheduler/service.js.map +1 -0
- package/dist/src/core/{runtime/heartbeat-scheduler.d.ts → heartbeat/scheduler/types.d.ts} +5 -18
- package/dist/src/core/heartbeat/scheduler/types.d.ts.map +1 -0
- package/dist/src/core/heartbeat/scheduler/types.js +2 -0
- package/dist/src/core/heartbeat/scheduler/types.js.map +1 -0
- package/dist/src/core/heartbeat/tasks/index.d.ts +4 -0
- package/dist/src/core/heartbeat/tasks/index.d.ts.map +1 -0
- package/dist/src/core/heartbeat/tasks/index.js +3 -0
- package/dist/src/core/heartbeat/tasks/index.js.map +1 -0
- package/dist/src/core/heartbeat/tasks/repository.d.ts +24 -0
- package/dist/src/core/heartbeat/tasks/repository.d.ts.map +1 -0
- package/dist/src/core/heartbeat/tasks/repository.js +116 -0
- package/dist/src/core/heartbeat/tasks/repository.js.map +1 -0
- package/dist/src/core/heartbeat/tasks/schemas.d.ts +212 -0
- package/dist/src/core/heartbeat/tasks/schemas.d.ts.map +1 -0
- package/dist/src/core/heartbeat/tasks/schemas.js +78 -0
- package/dist/src/core/heartbeat/tasks/schemas.js.map +1 -0
- package/dist/src/core/heartbeat/tasks/task-state.d.ts +33 -0
- package/dist/src/core/heartbeat/tasks/task-state.d.ts.map +1 -0
- package/dist/src/core/heartbeat/tasks/task-state.js +122 -0
- package/dist/src/core/heartbeat/tasks/task-state.js.map +1 -0
- package/dist/src/core/{runtime/heartbeat-task-store.d.ts → heartbeat/tasks/types.d.ts} +24 -29
- package/dist/src/core/heartbeat/tasks/types.d.ts.map +1 -0
- package/dist/src/core/heartbeat/tasks/types.js +2 -0
- package/dist/src/core/heartbeat/tasks/types.js.map +1 -0
- package/dist/src/core/heartbeat/views/index.d.ts +4 -0
- package/dist/src/core/heartbeat/views/index.d.ts.map +1 -0
- package/dist/src/core/heartbeat/views/index.js +3 -0
- package/dist/src/core/heartbeat/views/index.js.map +1 -0
- package/dist/src/core/heartbeat/views/lucid-presenter.d.ts +20 -0
- package/dist/src/core/heartbeat/views/lucid-presenter.d.ts.map +1 -0
- package/dist/src/core/heartbeat/views/lucid-presenter.js +112 -0
- package/dist/src/core/heartbeat/views/lucid-presenter.js.map +1 -0
- package/dist/src/core/heartbeat/views/presenter.d.ts +22 -0
- package/dist/src/core/heartbeat/views/presenter.d.ts.map +1 -0
- package/dist/src/core/heartbeat/views/presenter.js +50 -0
- package/dist/src/core/heartbeat/views/presenter.js.map +1 -0
- package/dist/src/core/{runtime/heartbeat-lucid.d.ts → heartbeat/views/types.d.ts} +24 -8
- package/dist/src/core/heartbeat/views/types.d.ts.map +1 -0
- package/dist/src/core/heartbeat/views/types.js +2 -0
- package/dist/src/core/heartbeat/views/types.js.map +1 -0
- package/dist/src/core/heartbeat/wake/decision.d.ts +13 -0
- package/dist/src/core/heartbeat/wake/decision.d.ts.map +1 -0
- package/dist/src/core/heartbeat/wake/decision.js +24 -0
- package/dist/src/core/heartbeat/wake/decision.js.map +1 -0
- package/dist/src/core/heartbeat/wake/index.d.ts +5 -0
- package/dist/src/core/heartbeat/wake/index.d.ts.map +1 -0
- package/dist/src/core/heartbeat/wake/index.js +4 -0
- package/dist/src/core/heartbeat/wake/index.js.map +1 -0
- package/dist/src/core/heartbeat/wake/prompt.d.ts +11 -0
- package/dist/src/core/heartbeat/wake/prompt.d.ts.map +1 -0
- package/dist/src/core/heartbeat/wake/prompt.js +39 -0
- package/dist/src/core/heartbeat/wake/prompt.js.map +1 -0
- package/dist/src/core/heartbeat/wake/service.d.ts +6 -0
- package/dist/src/core/heartbeat/wake/service.d.ts.map +1 -0
- package/dist/src/core/heartbeat/wake/service.js +75 -0
- package/dist/src/core/heartbeat/wake/service.js.map +1 -0
- package/dist/src/core/heartbeat/wake/types.d.ts +33 -0
- package/dist/src/core/heartbeat/wake/types.d.ts.map +1 -0
- package/dist/src/core/heartbeat/wake/types.js +2 -0
- package/dist/src/core/heartbeat/wake/types.js.map +1 -0
- package/dist/src/core/llm/factory.js +2 -2
- package/dist/src/core/llm/factory.js.map +1 -1
- package/dist/src/core/llm/model-policy.d.ts +1 -1
- package/dist/src/core/llm/model-policy.d.ts.map +1 -1
- package/dist/src/core/memory/maintainer.js +2 -2
- package/dist/src/core/memory/maintainer.js.map +1 -1
- package/dist/src/core/observability/conversation-activity.d.ts +1 -1
- package/dist/src/core/observability/conversation-activity.d.ts.map +1 -1
- package/dist/src/core/runtime/credentials/index.d.ts +3 -0
- package/dist/src/core/runtime/credentials/index.d.ts.map +1 -0
- package/dist/src/core/runtime/credentials/index.js +2 -0
- package/dist/src/core/runtime/credentials/index.js.map +1 -0
- package/dist/src/core/runtime/credentials/service.d.ts +22 -0
- package/dist/src/core/runtime/credentials/service.d.ts.map +1 -0
- package/dist/src/core/runtime/credentials/service.js +83 -0
- package/dist/src/core/runtime/credentials/service.js.map +1 -0
- package/dist/src/core/runtime/credentials/types.d.ts +22 -0
- package/dist/src/core/runtime/credentials/types.d.ts.map +1 -0
- package/dist/src/core/runtime/credentials/types.js +2 -0
- package/dist/src/core/runtime/credentials/types.js.map +1 -0
- package/dist/src/core/runtime/daemon/host-resolver.d.ts +7 -0
- package/dist/src/core/runtime/daemon/host-resolver.d.ts.map +1 -0
- package/dist/src/core/runtime/daemon/host-resolver.js +61 -0
- package/dist/src/core/runtime/daemon/host-resolver.js.map +1 -0
- package/dist/src/core/runtime/daemon/index.d.ts +6 -0
- package/dist/src/core/runtime/daemon/index.d.ts.map +1 -0
- package/dist/src/core/runtime/daemon/index.js +5 -0
- package/dist/src/core/runtime/daemon/index.js.map +1 -0
- package/dist/src/core/runtime/daemon/messages.d.ts +13 -0
- package/dist/src/core/runtime/daemon/messages.d.ts.map +1 -0
- package/dist/src/core/runtime/daemon/messages.js +43 -0
- package/dist/src/core/runtime/daemon/messages.js.map +1 -0
- package/dist/src/core/runtime/daemon/registry-repository.d.ts +12 -0
- package/dist/src/core/runtime/daemon/registry-repository.d.ts.map +1 -0
- package/dist/src/core/runtime/daemon/registry-repository.js +33 -0
- package/dist/src/core/runtime/daemon/registry-repository.js.map +1 -0
- package/dist/src/core/runtime/daemon/registry-service.d.ts +16 -0
- package/dist/src/core/runtime/daemon/registry-service.d.ts.map +1 -0
- package/dist/src/core/runtime/daemon/registry-service.js +141 -0
- package/dist/src/core/runtime/daemon/registry-service.js.map +1 -0
- package/dist/src/core/runtime/daemon/schemas.d.ts +96 -0
- package/dist/src/core/runtime/daemon/schemas.d.ts.map +1 -0
- package/dist/src/core/runtime/daemon/schemas.js +36 -0
- package/dist/src/core/runtime/daemon/schemas.js.map +1 -0
- package/dist/src/core/runtime/daemon/types.d.ts +66 -0
- package/dist/src/core/runtime/daemon/types.d.ts.map +1 -0
- package/dist/src/core/runtime/daemon/types.js +2 -0
- package/dist/src/core/runtime/daemon/types.js.map +1 -0
- package/dist/src/core/runtime/loop/checkpoint.d.ts +33 -0
- package/dist/src/core/runtime/loop/checkpoint.d.ts.map +1 -0
- package/dist/src/core/runtime/loop/checkpoint.js +69 -0
- package/dist/src/core/runtime/loop/checkpoint.js.map +1 -0
- package/dist/src/core/runtime/loop/index.d.ts +4 -0
- package/dist/src/core/runtime/loop/index.d.ts.map +1 -0
- package/dist/src/core/runtime/loop/index.js +3 -0
- package/dist/src/core/runtime/loop/index.js.map +1 -0
- package/dist/src/core/runtime/loop/service.d.ts +11 -0
- package/dist/src/core/runtime/loop/service.d.ts.map +1 -0
- package/dist/src/core/runtime/loop/service.js +179 -0
- package/dist/src/core/runtime/loop/service.js.map +1 -0
- package/dist/src/core/runtime/{events.d.ts → loop/types.d.ts} +38 -38
- package/dist/src/core/runtime/loop/types.d.ts.map +1 -0
- package/dist/src/core/runtime/loop/types.js +2 -0
- package/dist/src/core/runtime/loop/types.js.map +1 -0
- package/dist/src/core/runtime/tools/index.d.ts +3 -0
- package/dist/src/core/runtime/tools/index.d.ts.map +1 -0
- package/dist/src/core/runtime/tools/index.js +2 -0
- package/dist/src/core/runtime/tools/index.js.map +1 -0
- package/dist/src/core/runtime/tools/service.d.ts +11 -0
- package/dist/src/core/runtime/tools/service.d.ts.map +1 -0
- package/dist/src/core/runtime/tools/service.js +54 -0
- package/dist/src/core/runtime/tools/service.js.map +1 -0
- package/dist/src/core/runtime/{default-tools.d.ts → tools/types.d.ts} +2 -4
- package/dist/src/core/runtime/tools/types.d.ts.map +1 -0
- package/dist/src/core/runtime/tools/types.js +2 -0
- package/dist/src/core/runtime/tools/types.js.map +1 -0
- package/dist/src/core/runtime/workspaces/index.d.ts +5 -0
- package/dist/src/core/runtime/workspaces/index.d.ts.map +1 -0
- package/dist/src/core/runtime/workspaces/index.js +4 -0
- package/dist/src/core/runtime/workspaces/index.js.map +1 -0
- package/dist/src/core/runtime/workspaces/repository.d.ts +14 -0
- package/dist/src/core/runtime/workspaces/repository.d.ts.map +1 -0
- package/dist/src/core/runtime/workspaces/repository.js +38 -0
- package/dist/src/core/runtime/workspaces/repository.js.map +1 -0
- package/dist/src/core/runtime/workspaces/schemas.d.ts +42 -0
- package/dist/src/core/runtime/workspaces/schemas.d.ts.map +1 -0
- package/dist/src/core/runtime/workspaces/schemas.js +26 -0
- package/dist/src/core/runtime/workspaces/schemas.js.map +1 -0
- package/dist/src/core/runtime/workspaces/service.d.ts +15 -0
- package/dist/src/core/runtime/workspaces/service.d.ts.map +1 -0
- package/dist/src/core/runtime/workspaces/service.js +177 -0
- package/dist/src/core/runtime/workspaces/service.js.map +1 -0
- package/dist/src/core/runtime/workspaces/types.d.ts +42 -0
- package/dist/src/core/runtime/workspaces/types.d.ts.map +1 -0
- package/dist/src/core/runtime/workspaces/types.js +2 -0
- package/dist/src/core/runtime/workspaces/types.js.map +1 -0
- package/dist/src/core/tools/toolkit.d.ts +1 -1
- package/dist/src/core/tools/toolkit.d.ts.map +1 -1
- package/dist/src/core/tools/toolkits/external-context/view-image.d.ts +1 -1
- package/dist/src/core/tools/toolkits/external-context/view-image.d.ts.map +1 -1
- package/dist/src/core/tools/toolkits/external-context/view-image.js +2 -2
- package/dist/src/core/tools/toolkits/external-context/view-image.js.map +1 -1
- package/dist/src/core/tools/toolkits/external-context/web-search.d.ts +1 -1
- package/dist/src/core/tools/toolkits/external-context/web-search.d.ts.map +1 -1
- package/dist/src/core/tools/toolkits/external-context/web-search.js +2 -2
- package/dist/src/core/tools/toolkits/external-context/web-search.js.map +1 -1
- package/dist/src/core/types.d.ts +1 -1
- package/dist/src/index.d.ts +26 -28
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +13 -15
- package/dist/src/index.js.map +1 -1
- package/dist/src/integrations/cyberloop.d.ts +5 -4
- package/dist/src/integrations/cyberloop.d.ts.map +1 -1
- package/dist/src/integrations/cyberloop.js.map +1 -1
- package/dist/src/server/app.js +5 -5
- package/dist/src/server/app.js.map +1 -1
- package/dist/src/server/features/control-plane/controllers/ask.js +3 -3
- package/dist/src/server/features/control-plane/controllers/ask.js.map +1 -1
- package/dist/src/server/features/control-plane/controllers/chat-session-events.d.ts +1 -1
- package/dist/src/server/features/control-plane/controllers/chat-session-events.d.ts.map +1 -1
- package/dist/src/server/features/control-plane/controllers/chat-session-presenter.d.ts.map +1 -1
- package/dist/src/server/features/control-plane/controllers/chat-session-presenter.js +38 -12
- package/dist/src/server/features/control-plane/controllers/chat-session-presenter.js.map +1 -1
- package/dist/src/server/features/control-plane/controllers/chat-sessions-controller.d.ts +2 -2
- package/dist/src/server/features/control-plane/controllers/chat-sessions-controller.d.ts.map +1 -1
- package/dist/src/server/features/control-plane/controllers/chat-sessions-controller.js +24 -23
- package/dist/src/server/features/control-plane/controllers/chat-sessions-controller.js.map +1 -1
- package/dist/src/server/features/control-plane/controllers/control-plane-state.js +7 -7
- package/dist/src/server/features/control-plane/controllers/control-plane-state.js.map +1 -1
- package/dist/src/server/features/control-plane/controllers/heartbeat.d.ts +6 -5
- package/dist/src/server/features/control-plane/controllers/heartbeat.d.ts.map +1 -1
- package/dist/src/server/features/control-plane/controllers/heartbeat.js +31 -19
- package/dist/src/server/features/control-plane/controllers/heartbeat.js.map +1 -1
- package/dist/src/server/features/control-plane/router.d.ts +7 -7
- package/dist/src/server/features/control-plane/router.js +9 -9
- package/dist/src/server/features/control-plane/router.js.map +1 -1
- package/dist/src/server/features/control-plane/types.d.ts +28 -16
- package/dist/src/server/features/control-plane/types.d.ts.map +1 -1
- package/dist/src/server/index.d.ts.map +1 -1
- package/dist/src/server/index.js +7 -7
- package/dist/src/server/index.js.map +1 -1
- package/dist/src/server/router.d.ts +9 -9
- package/dist/src/server/types.d.ts +2 -2
- package/dist/src/server/types.d.ts.map +1 -1
- package/dist/src/web/assets/{MonacoDiffViewer-D0Ed6GCN.js → MonacoDiffViewer-F3AOHIps.js} +1 -1
- package/dist/src/web/assets/{index-B_9nk8kS.js → index-D6aK1OFb.js} +2 -2
- package/dist/src/web/index.html +1 -1
- package/package.json +7 -7
- package/dist/src/cli/chat/state/approval-rules.d.ts +0 -3
- package/dist/src/cli/chat/state/approval-rules.d.ts.map +0 -1
- package/dist/src/cli/chat/state/approval-rules.js +0 -2
- package/dist/src/cli/chat/state/approval-rules.js.map +0 -1
- package/dist/src/cli/session.d.ts +0 -11
- package/dist/src/cli/session.d.ts.map +0 -1
- package/dist/src/cli/session.js +0 -30
- package/dist/src/cli/session.js.map +0 -1
- package/dist/src/core/agent/history.d.ts +0 -3
- package/dist/src/core/agent/history.d.ts.map +0 -1
- package/dist/src/core/agent/history.js +0 -36
- package/dist/src/core/agent/history.js.map +0 -1
- package/dist/src/core/agent/mutation-tracking.d.ts +0 -13
- package/dist/src/core/agent/mutation-tracking.d.ts.map +0 -1
- package/dist/src/core/agent/mutation-tracking.js +0 -71
- package/dist/src/core/agent/mutation-tracking.js.map +0 -1
- package/dist/src/core/agent/post-mutation.d.ts +0 -8
- package/dist/src/core/agent/post-mutation.d.ts.map +0 -1
- package/dist/src/core/agent/post-mutation.js +0 -9
- package/dist/src/core/agent/post-mutation.js.map +0 -1
- package/dist/src/core/agent/progress-reminders.d.ts +0 -10
- package/dist/src/core/agent/progress-reminders.d.ts.map +0 -1
- package/dist/src/core/agent/progress-reminders.js +0 -13
- package/dist/src/core/agent/progress-reminders.js.map +0 -1
- package/dist/src/core/agent/run-agent.d.ts +0 -41
- package/dist/src/core/agent/run-agent.d.ts.map +0 -1
- package/dist/src/core/agent/run-agent.js +0 -490
- package/dist/src/core/agent/run-agent.js.map +0 -1
- package/dist/src/core/agent/tool-dispatch.d.ts +0 -36
- package/dist/src/core/agent/tool-dispatch.d.ts.map +0 -1
- package/dist/src/core/agent/tool-dispatch.js +0 -120
- package/dist/src/core/agent/tool-dispatch.js.map +0 -1
- package/dist/src/core/agent/util.d.ts +0 -6
- package/dist/src/core/agent/util.d.ts.map +0 -1
- package/dist/src/core/agent/util.js.map +0 -1
- package/dist/src/core/approvals/default-policies.d.ts +0 -10
- package/dist/src/core/approvals/default-policies.d.ts.map +0 -1
- package/dist/src/core/approvals/default-policies.js +0 -37
- package/dist/src/core/approvals/default-policies.js.map +0 -1
- package/dist/src/core/approvals/policy-chain.d.ts +0 -9
- package/dist/src/core/approvals/policy-chain.d.ts.map +0 -1
- package/dist/src/core/approvals/policy-chain.js +0 -36
- package/dist/src/core/approvals/policy-chain.js.map +0 -1
- package/dist/src/core/approvals/remembered-rules.d.ts +0 -22
- package/dist/src/core/approvals/remembered-rules.d.ts.map +0 -1
- package/dist/src/core/approvals/remembered-rules.js +0 -284
- package/dist/src/core/approvals/remembered-rules.js.map +0 -1
- package/dist/src/core/approvals/surface.d.ts +0 -20
- package/dist/src/core/approvals/surface.d.ts.map +0 -1
- package/dist/src/core/approvals/surface.js +0 -22
- package/dist/src/core/approvals/surface.js.map +0 -1
- package/dist/src/core/chat/engine/history/compaction.d.ts +0 -56
- package/dist/src/core/chat/engine/history/compaction.d.ts.map +0 -1
- package/dist/src/core/chat/engine/history/compaction.js +0 -546
- package/dist/src/core/chat/engine/history/compaction.js.map +0 -1
- package/dist/src/core/chat/engine/sessions/archive.d.ts +0 -19
- package/dist/src/core/chat/engine/sessions/archive.d.ts.map +0 -1
- package/dist/src/core/chat/engine/sessions/archive.js +0 -129
- package/dist/src/core/chat/engine/sessions/archive.js.map +0 -1
- package/dist/src/core/chat/engine/sessions/conversation-lines.d.ts +0 -4
- package/dist/src/core/chat/engine/sessions/conversation-lines.d.ts.map +0 -1
- package/dist/src/core/chat/engine/sessions/conversation-lines.js +0 -26
- package/dist/src/core/chat/engine/sessions/conversation-lines.js.map +0 -1
- package/dist/src/core/chat/engine/sessions/lease.d.ts +0 -23
- package/dist/src/core/chat/engine/sessions/lease.d.ts.map +0 -1
- package/dist/src/core/chat/engine/sessions/lease.js +0 -72
- package/dist/src/core/chat/engine/sessions/lease.js.map +0 -1
- package/dist/src/core/chat/engine/sessions/session-record.d.ts +0 -16
- package/dist/src/core/chat/engine/sessions/session-record.d.ts.map +0 -1
- package/dist/src/core/chat/engine/sessions/session-record.js +0 -60
- package/dist/src/core/chat/engine/sessions/session-record.js.map +0 -1
- package/dist/src/core/chat/engine/sessions/title.d.ts +0 -15
- package/dist/src/core/chat/engine/sessions/title.d.ts.map +0 -1
- package/dist/src/core/chat/engine/sessions/title.js +0 -17
- package/dist/src/core/chat/engine/sessions/title.js.map +0 -1
- package/dist/src/core/chat/engine/turns/context.d.ts +0 -27
- package/dist/src/core/chat/engine/turns/context.d.ts.map +0 -1
- package/dist/src/core/chat/engine/turns/context.js +0 -42
- package/dist/src/core/chat/engine/turns/context.js.map +0 -1
- package/dist/src/core/chat/engine/turns/host-bridge.d.ts +0 -37
- package/dist/src/core/chat/engine/turns/host-bridge.d.ts.map +0 -1
- package/dist/src/core/chat/engine/turns/host-bridge.js +0 -20
- package/dist/src/core/chat/engine/turns/host-bridge.js.map +0 -1
- package/dist/src/core/chat/engine/turns/host.d.ts +0 -3
- package/dist/src/core/chat/engine/turns/host.d.ts.map +0 -1
- package/dist/src/core/chat/engine/turns/host.js +0 -42
- package/dist/src/core/chat/engine/turns/host.js.map +0 -1
- package/dist/src/core/chat/engine/turns/memory-maintenance.d.ts +0 -33
- package/dist/src/core/chat/engine/turns/memory-maintenance.d.ts.map +0 -1
- package/dist/src/core/chat/engine/turns/memory-maintenance.js +0 -121
- package/dist/src/core/chat/engine/turns/memory-maintenance.js.map +0 -1
- package/dist/src/core/chat/engine/turns/persistence.d.ts +0 -25
- package/dist/src/core/chat/engine/turns/persistence.d.ts.map +0 -1
- package/dist/src/core/chat/engine/turns/persistence.js +0 -46
- package/dist/src/core/chat/engine/turns/persistence.js.map +0 -1
- package/dist/src/core/chat/engine/turns/preflight.d.ts +0 -56
- package/dist/src/core/chat/engine/turns/preflight.d.ts.map +0 -1
- package/dist/src/core/chat/engine/turns/preflight.js +0 -97
- package/dist/src/core/chat/engine/turns/preflight.js.map +0 -1
- package/dist/src/core/chat/engine/turns/result.d.ts +0 -38
- package/dist/src/core/chat/engine/turns/result.d.ts.map +0 -1
- package/dist/src/core/chat/engine/turns/result.js +0 -62
- package/dist/src/core/chat/engine/turns/result.js.map +0 -1
- package/dist/src/core/chat/engine/turns/run-conversation-turn.d.ts +0 -47
- package/dist/src/core/chat/engine/turns/run-conversation-turn.d.ts.map +0 -1
- package/dist/src/core/chat/engine/turns/run-conversation-turn.js +0 -136
- package/dist/src/core/chat/engine/turns/run-conversation-turn.js.map +0 -1
- package/dist/src/core/chat/engine/turns/runtime.d.ts +0 -28
- package/dist/src/core/chat/engine/turns/runtime.d.ts.map +0 -1
- package/dist/src/core/chat/engine/turns/runtime.js +0 -62
- package/dist/src/core/chat/engine/turns/runtime.js.map +0 -1
- package/dist/src/core/chat/engine/turns/trace.d.ts +0 -3
- package/dist/src/core/chat/engine/turns/trace.d.ts.map +0 -1
- package/dist/src/core/chat/engine/turns/trace.js +0 -9
- package/dist/src/core/chat/engine/turns/trace.js.map +0 -1
- package/dist/src/core/chat/failure-messages.d.ts +0 -6
- package/dist/src/core/chat/failure-messages.d.ts.map +0 -1
- package/dist/src/core/chat/failure-messages.js +0 -24
- package/dist/src/core/chat/failure-messages.js.map +0 -1
- package/dist/src/core/runtime/agent-loop.d.ts +0 -45
- package/dist/src/core/runtime/agent-loop.d.ts.map +0 -1
- package/dist/src/core/runtime/agent-loop.js +0 -200
- package/dist/src/core/runtime/agent-loop.js.map +0 -1
- package/dist/src/core/runtime/api-keys.d.ts +0 -35
- package/dist/src/core/runtime/api-keys.d.ts.map +0 -1
- package/dist/src/core/runtime/api-keys.js +0 -78
- package/dist/src/core/runtime/api-keys.js.map +0 -1
- package/dist/src/core/runtime/daemon-registry.d.ts +0 -44
- package/dist/src/core/runtime/daemon-registry.d.ts.map +0 -1
- package/dist/src/core/runtime/daemon-registry.js +0 -147
- package/dist/src/core/runtime/daemon-registry.js.map +0 -1
- package/dist/src/core/runtime/default-tools.d.ts.map +0 -1
- package/dist/src/core/runtime/default-tools.js +0 -49
- package/dist/src/core/runtime/default-tools.js.map +0 -1
- package/dist/src/core/runtime/events.d.ts.map +0 -1
- package/dist/src/core/runtime/events.js +0 -41
- package/dist/src/core/runtime/events.js.map +0 -1
- package/dist/src/core/runtime/heartbeat-lucid.d.ts.map +0 -1
- package/dist/src/core/runtime/heartbeat-lucid.js +0 -188
- package/dist/src/core/runtime/heartbeat-lucid.js.map +0 -1
- package/dist/src/core/runtime/heartbeat-scheduler.d.ts.map +0 -1
- package/dist/src/core/runtime/heartbeat-scheduler.js +0 -135
- package/dist/src/core/runtime/heartbeat-scheduler.js.map +0 -1
- package/dist/src/core/runtime/heartbeat-store.d.ts +0 -20
- package/dist/src/core/runtime/heartbeat-store.d.ts.map +0 -1
- package/dist/src/core/runtime/heartbeat-store.js +0 -42
- package/dist/src/core/runtime/heartbeat-store.js.map +0 -1
- package/dist/src/core/runtime/heartbeat-task-state.d.ts +0 -5
- package/dist/src/core/runtime/heartbeat-task-state.d.ts.map +0 -1
- package/dist/src/core/runtime/heartbeat-task-state.js +0 -81
- package/dist/src/core/runtime/heartbeat-task-state.js.map +0 -1
- package/dist/src/core/runtime/heartbeat-task-store.d.ts.map +0 -1
- package/dist/src/core/runtime/heartbeat-task-store.js +0 -96
- package/dist/src/core/runtime/heartbeat-task-store.js.map +0 -1
- package/dist/src/core/runtime/heartbeat-views.d.ts +0 -52
- package/dist/src/core/runtime/heartbeat-views.d.ts.map +0 -1
- package/dist/src/core/runtime/heartbeat-views.js +0 -62
- package/dist/src/core/runtime/heartbeat-views.js.map +0 -1
- package/dist/src/core/runtime/heartbeat.d.ts +0 -41
- package/dist/src/core/runtime/heartbeat.d.ts.map +0 -1
- package/dist/src/core/runtime/heartbeat.js +0 -113
- package/dist/src/core/runtime/heartbeat.js.map +0 -1
- package/dist/src/core/runtime/runtime-hosts.d.ts +0 -30
- package/dist/src/core/runtime/runtime-hosts.d.ts.map +0 -1
- package/dist/src/core/runtime/runtime-hosts.js +0 -95
- package/dist/src/core/runtime/runtime-hosts.js.map +0 -1
- package/dist/src/core/runtime/workspaces.d.ts +0 -55
- package/dist/src/core/runtime/workspaces.d.ts.map +0 -1
- package/dist/src/core/runtime/workspaces.js +0 -168
- package/dist/src/core/runtime/workspaces.js.map +0 -1
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export function requestToolApproval(args) {
|
|
2
|
-
const view = args.createView?.(args.call, args.tool)
|
|
3
|
-
?? {
|
|
4
|
-
tool: args.tool.name,
|
|
5
|
-
callId: args.call.id,
|
|
6
|
-
input: args.call.input,
|
|
7
|
-
requestedAt: new Date().toISOString(),
|
|
8
|
-
};
|
|
9
|
-
return new Promise((resolve) => {
|
|
10
|
-
args.storePending?.({ view, resolve });
|
|
11
|
-
args.publish?.(view, args.call, args.tool);
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
export function humanApprovalPolicy(surface) {
|
|
15
|
-
return async (context) => {
|
|
16
|
-
const decision = await surface(context);
|
|
17
|
-
return decision.approved ?
|
|
18
|
-
{ type: 'allow', reason: decision.reason }
|
|
19
|
-
: { type: 'deny', reason: decision.reason };
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=surface.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"surface.js","sourceRoot":"","sources":["../../../../src/core/approvals/surface.ts"],"names":[],"mappings":"AAcA,MAAM,UAAU,mBAAmB,CAAC,IAMnC;IACC,MAAM,IAAI,GACR,IAAI,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC;WACpC;YACD,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI;YACpB,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE;YACpB,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK;YACtB,WAAW,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;SACtC,CAAC;IAEJ,OAAO,IAAI,OAAO,CAAuB,CAAC,OAAO,EAAE,EAAE;QACnD,IAAI,CAAC,YAAY,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;QACvC,IAAI,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,OAA4B;IAC9D,OAAO,KAAK,EAAE,OAAO,EAAE,EAAE;QACvB,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;QACxC,OAAO,QAAQ,CAAC,QAAQ,CAAC,CAAC;YACtB,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE;YAC5C,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;IAChD,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import type { ChatMessage, LlmAdapter, LlmUsage } from '../../../llm/types.js';
|
|
2
|
-
import { type ProviderCredentialSource } from '../../../runtime/api-keys.js';
|
|
3
|
-
import type { ChatArchiveRecord, ChatContextStats } from '../../types.js';
|
|
4
|
-
export type CompactionSummarizerOptions = {
|
|
5
|
-
provider?: 'openai' | 'anthropic' | 'active';
|
|
6
|
-
model?: string;
|
|
7
|
-
apiKey?: string;
|
|
8
|
-
llm?: LlmAdapter;
|
|
9
|
-
credentialSource?: ProviderCredentialSource;
|
|
10
|
-
};
|
|
11
|
-
export type CompactChatHistoryWithArchiveOptions = {
|
|
12
|
-
history: ChatMessage[];
|
|
13
|
-
model: string;
|
|
14
|
-
sessionId: string;
|
|
15
|
-
stateRoot: string;
|
|
16
|
-
usage?: LlmUsage;
|
|
17
|
-
force?: boolean;
|
|
18
|
-
systemContext?: string;
|
|
19
|
-
toolNames?: string[];
|
|
20
|
-
goal?: string;
|
|
21
|
-
summarizer?: CompactionSummarizerOptions;
|
|
22
|
-
onStatusChange?: (event: {
|
|
23
|
-
status: 'running' | 'finished' | 'failed';
|
|
24
|
-
archivePath?: string;
|
|
25
|
-
summaryPath?: string;
|
|
26
|
-
error?: string;
|
|
27
|
-
}) => void;
|
|
28
|
-
};
|
|
29
|
-
export type CompactChatHistoryResult = {
|
|
30
|
-
history: ChatMessage[];
|
|
31
|
-
context: ChatContextStats;
|
|
32
|
-
archives: ChatArchiveRecord[];
|
|
33
|
-
};
|
|
34
|
-
export declare function compactChatHistoryWithArchive(options: CompactChatHistoryWithArchiveOptions): Promise<CompactChatHistoryResult>;
|
|
35
|
-
export declare function compactChatHistory(options: {
|
|
36
|
-
history: ChatMessage[];
|
|
37
|
-
model: string;
|
|
38
|
-
usage?: LlmUsage;
|
|
39
|
-
force?: boolean;
|
|
40
|
-
systemContext?: string;
|
|
41
|
-
toolNames?: string[];
|
|
42
|
-
goal?: string;
|
|
43
|
-
}): {
|
|
44
|
-
history: ChatMessage[];
|
|
45
|
-
context: ChatContextStats;
|
|
46
|
-
};
|
|
47
|
-
export declare function estimateChatHistoryTokens(history: ChatMessage[]): number;
|
|
48
|
-
export declare function isCompactedHistorySummary(message: ChatMessage): boolean;
|
|
49
|
-
export declare function buildCompactionRunningContext(options: {
|
|
50
|
-
history: ChatMessage[];
|
|
51
|
-
previous?: ChatContextStats;
|
|
52
|
-
archiveCount?: number;
|
|
53
|
-
currentSummaryPath?: string;
|
|
54
|
-
lastArchivePath?: string;
|
|
55
|
-
}): ChatContextStats;
|
|
56
|
-
//# sourceMappingURL=compaction.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compaction.d.ts","sourceRoot":"","sources":["../../../../../../src/core/chat/engine/history/compaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE/E,OAAO,EAAiG,KAAK,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAO5K,OAAO,KAAK,EAAuB,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AA2B/F,MAAM,MAAM,2BAA2B,GAAG;IACxC,QAAQ,CAAC,EAAE,QAAQ,GAAG,WAAW,GAAG,QAAQ,CAAC;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,UAAU,CAAC;IACjB,gBAAgB,CAAC,EAAE,wBAAwB,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,oCAAoC,GAAG;IACjD,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,2BAA2B,CAAC;IACzC,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,MAAM,EAAE,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CAC7I,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,OAAO,EAAE,gBAAgB,CAAC;IAC1B,QAAQ,EAAE,iBAAiB,EAAE,CAAC;CAC/B,CAAC;AAEF,wBAAsB,6BAA6B,CACjD,OAAO,EAAE,oCAAoC,GAC5C,OAAO,CAAC,wBAAwB,CAAC,CAsJnC;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE;IAC1C,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG;IAAE,OAAO,EAAE,WAAW,EAAE,CAAC;IAAC,OAAO,EAAE,gBAAgB,CAAA;CAAE,CAwCxD;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,WAAW,EAAE,GAAG,MAAM,CAExE;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAEvE;AAED,wBAAgB,6BAA6B,CAAC,OAAO,EAAE;IACrD,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,gBAAgB,CAUnB"}
|
|
@@ -1,546 +0,0 @@
|
|
|
1
|
-
import { createLlmAdapter, inferProviderFromModel } from '../../../llm/factory.js';
|
|
2
|
-
import { hasProviderCredentialForModel, resolveApiKeyForModel, resolveProviderCredentialSourceForModel } from '../../../runtime/api-keys.js';
|
|
3
|
-
import { estimateBuiltInContextWindow } from '../../../llm/openai-models.js';
|
|
4
|
-
import { credentialModeFromSource, resolveSystemSelectedModel, } from '../../../llm/model-policy.js';
|
|
5
|
-
import { createArchiveId, deriveChatArchivePaths, loadChatArchiveManifest, readArchiveSummaryMarkdown, saveChatArchiveManifest, updateChatArchiveManifest, writeArchivedMessagesJsonl, writeArchiveSummaryMarkdown, } from '../sessions/archive.js';
|
|
6
|
-
const DEFAULT_CONTEXT_WINDOW_ESTIMATE = 200_000;
|
|
7
|
-
const MAX_HISTORY_RATIO = 0.6;
|
|
8
|
-
const MAX_RECENT_HISTORY_RATIO = 0.18;
|
|
9
|
-
const MIN_RECENT_HISTORY_TOKEN_BUDGET = 8_000;
|
|
10
|
-
const MAX_RECENT_HISTORY_TOKEN_BUDGET = 120_000;
|
|
11
|
-
const PREFERRED_RECENT_MESSAGES = 12;
|
|
12
|
-
const PREFERRED_FORCED_RECENT_MESSAGES = 3;
|
|
13
|
-
const MAX_ROLLING_SUMMARY_CHARS = 12_000;
|
|
14
|
-
const MAX_SUMMARIZER_CONTEXT_RATIO = 0.12;
|
|
15
|
-
const MAX_SUMMARIZER_TRANSCRIPT_TOKENS = 32_000;
|
|
16
|
-
const MAX_SUMMARIZER_TRANSCRIPT_CHARS = 96_000;
|
|
17
|
-
const MAX_SUMMARIZER_MESSAGE_CHARS = 2_000;
|
|
18
|
-
const MIN_SUMMARIZER_MESSAGE_CHARS = 80;
|
|
19
|
-
const COMPACTED_HISTORY_MARKER = 'Heddle compacted earlier conversation history.';
|
|
20
|
-
export async function compactChatHistoryWithArchive(options) {
|
|
21
|
-
const estimatedWindow = estimateBuiltInContextWindow(options.model) ?? DEFAULT_CONTEXT_WINDOW_ESTIMATE;
|
|
22
|
-
const maxHistoryTokens = Math.floor(estimatedWindow * MAX_HISTORY_RATIO);
|
|
23
|
-
const recentTokenBudget = resolveRecentHistoryTokenBudget(estimatedWindow);
|
|
24
|
-
const preferredRecentMessages = options.force ? PREFERRED_FORCED_RECENT_MESSAGES : PREFERRED_RECENT_MESSAGES;
|
|
25
|
-
const needsCompaction = estimateChatHistoryTokens(options.history) > maxHistoryTokens
|
|
26
|
-
|| (Boolean(options.force) && countNonCompactedMessages(options.history) > 0);
|
|
27
|
-
if (!needsCompaction) {
|
|
28
|
-
const manifest = loadChatArchiveManifest(options.stateRoot, options.sessionId);
|
|
29
|
-
return {
|
|
30
|
-
history: options.history,
|
|
31
|
-
context: buildContextStats({
|
|
32
|
-
history: options.history,
|
|
33
|
-
usage: options.usage,
|
|
34
|
-
estimatedRequestTokens: estimateRequestTokens({
|
|
35
|
-
history: options.history,
|
|
36
|
-
systemContext: options.systemContext,
|
|
37
|
-
toolNames: options.toolNames ?? [],
|
|
38
|
-
goal: options.goal,
|
|
39
|
-
}),
|
|
40
|
-
archives: manifest.archives,
|
|
41
|
-
currentSummaryPath: manifest.currentSummaryPath,
|
|
42
|
-
}),
|
|
43
|
-
archives: manifest.archives,
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
const splitIndex = findCompactionSplit(options.history, {
|
|
47
|
-
recentTokenBudget,
|
|
48
|
-
preferredRecentMessages,
|
|
49
|
-
stopAtPreferredMessages: Boolean(options.force),
|
|
50
|
-
});
|
|
51
|
-
if (splitIndex <= 0 || splitIndex >= options.history.length) {
|
|
52
|
-
const manifest = loadChatArchiveManifest(options.stateRoot, options.sessionId);
|
|
53
|
-
return {
|
|
54
|
-
history: options.history,
|
|
55
|
-
context: buildContextStats({
|
|
56
|
-
history: options.history,
|
|
57
|
-
usage: options.usage,
|
|
58
|
-
estimatedRequestTokens: estimateRequestTokens({
|
|
59
|
-
history: options.history,
|
|
60
|
-
systemContext: options.systemContext,
|
|
61
|
-
toolNames: options.toolNames ?? [],
|
|
62
|
-
goal: options.goal,
|
|
63
|
-
}),
|
|
64
|
-
archives: manifest.archives,
|
|
65
|
-
currentSummaryPath: manifest.currentSummaryPath,
|
|
66
|
-
}),
|
|
67
|
-
archives: manifest.archives,
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
const archivedMessages = options.history.slice(0, splitIndex);
|
|
71
|
-
const recentMessages = options.history.slice(splitIndex);
|
|
72
|
-
const manifest = loadChatArchiveManifest(options.stateRoot, options.sessionId);
|
|
73
|
-
const previousRollingSummary = (manifest.currentSummaryPath ? readArchiveSummaryMarkdown(manifest.currentSummaryPath, options.stateRoot) : undefined)
|
|
74
|
-
?? extractPriorSummary(options.history);
|
|
75
|
-
const archiveId = createArchiveId();
|
|
76
|
-
const archivePath = writeArchivedMessagesJsonl(options.stateRoot, options.sessionId, archiveId, archivedMessages);
|
|
77
|
-
options.onStatusChange?.({ status: 'running', archivePath });
|
|
78
|
-
try {
|
|
79
|
-
const summarizer = resolveSummarizer(options);
|
|
80
|
-
if (!summarizer.llm) {
|
|
81
|
-
throw new Error(`Missing provider API key for ${summarizer.model}`);
|
|
82
|
-
}
|
|
83
|
-
const rollingSummary = await summarizeChatArchive({
|
|
84
|
-
llm: summarizer.llm,
|
|
85
|
-
summaryModel: summarizer.model,
|
|
86
|
-
sessionId: options.sessionId,
|
|
87
|
-
archivePath,
|
|
88
|
-
manifest,
|
|
89
|
-
previousRollingSummary,
|
|
90
|
-
archivedMessages,
|
|
91
|
-
});
|
|
92
|
-
const summaryPath = writeArchiveSummaryMarkdown(options.stateRoot, options.sessionId, archiveId, rollingSummary);
|
|
93
|
-
const archiveRecord = {
|
|
94
|
-
id: archiveId,
|
|
95
|
-
path: archivePath,
|
|
96
|
-
summaryPath,
|
|
97
|
-
shortDescription: deriveShortDescription(rollingSummary),
|
|
98
|
-
messageCount: countNonCompactedMessages(archivedMessages),
|
|
99
|
-
createdAt: new Date().toISOString(),
|
|
100
|
-
summaryModel: summarizer.model,
|
|
101
|
-
};
|
|
102
|
-
const nextManifest = updateChatArchiveManifest(manifest, archiveRecord);
|
|
103
|
-
saveChatArchiveManifest(options.stateRoot, options.sessionId, nextManifest);
|
|
104
|
-
const compactedHistory = [
|
|
105
|
-
buildCompactedSummaryMessage({
|
|
106
|
-
sessionId: options.sessionId,
|
|
107
|
-
rollingSummary,
|
|
108
|
-
archives: nextManifest.archives,
|
|
109
|
-
}),
|
|
110
|
-
...recentMessages,
|
|
111
|
-
];
|
|
112
|
-
options.onStatusChange?.({
|
|
113
|
-
status: 'finished',
|
|
114
|
-
archivePath: archiveRecord.path,
|
|
115
|
-
summaryPath: archiveRecord.summaryPath,
|
|
116
|
-
});
|
|
117
|
-
return {
|
|
118
|
-
history: compactedHistory,
|
|
119
|
-
context: buildContextStats({
|
|
120
|
-
history: compactedHistory,
|
|
121
|
-
usage: options.usage,
|
|
122
|
-
compactedMessages: archiveRecord.messageCount,
|
|
123
|
-
estimatedRequestTokens: estimateRequestTokens({
|
|
124
|
-
history: compactedHistory,
|
|
125
|
-
systemContext: options.systemContext,
|
|
126
|
-
toolNames: options.toolNames ?? [],
|
|
127
|
-
goal: options.goal,
|
|
128
|
-
}),
|
|
129
|
-
compactedAt: archiveRecord.createdAt,
|
|
130
|
-
archives: nextManifest.archives,
|
|
131
|
-
currentSummaryPath: nextManifest.currentSummaryPath,
|
|
132
|
-
lastArchivePath: archiveRecord.path,
|
|
133
|
-
}),
|
|
134
|
-
archives: nextManifest.archives,
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
catch (error) {
|
|
138
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
139
|
-
options.onStatusChange?.({ status: 'failed', archivePath, error: message });
|
|
140
|
-
return {
|
|
141
|
-
history: options.history,
|
|
142
|
-
context: buildContextStats({
|
|
143
|
-
history: options.history,
|
|
144
|
-
usage: options.usage,
|
|
145
|
-
estimatedRequestTokens: estimateRequestTokens({
|
|
146
|
-
history: options.history,
|
|
147
|
-
systemContext: options.systemContext,
|
|
148
|
-
toolNames: options.toolNames ?? [],
|
|
149
|
-
goal: options.goal,
|
|
150
|
-
}),
|
|
151
|
-
compactionStatus: 'failed',
|
|
152
|
-
compactionError: message,
|
|
153
|
-
archives: manifest.archives,
|
|
154
|
-
currentSummaryPath: manifest.currentSummaryPath,
|
|
155
|
-
lastArchivePath: archivePath,
|
|
156
|
-
}),
|
|
157
|
-
archives: manifest.archives,
|
|
158
|
-
};
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
export function compactChatHistory(options) {
|
|
162
|
-
const estimatedWindow = estimateBuiltInContextWindow(options.model) ?? DEFAULT_CONTEXT_WINDOW_ESTIMATE;
|
|
163
|
-
const maxHistoryTokens = Math.floor(estimatedWindow * MAX_HISTORY_RATIO);
|
|
164
|
-
const recentTokenBudget = resolveRecentHistoryTokenBudget(estimatedWindow);
|
|
165
|
-
const preferredRecentMessages = options.force ? PREFERRED_FORCED_RECENT_MESSAGES : PREFERRED_RECENT_MESSAGES;
|
|
166
|
-
let nextHistory = options.history;
|
|
167
|
-
let compactedMessages = 0;
|
|
168
|
-
while ((estimateChatHistoryTokens(nextHistory) > maxHistoryTokens || (options.force && compactedMessages === 0)) &&
|
|
169
|
-
countNonCompactedMessages(nextHistory) > 1) {
|
|
170
|
-
const splitIndex = findCompactionSplit(nextHistory, {
|
|
171
|
-
recentTokenBudget,
|
|
172
|
-
preferredRecentMessages,
|
|
173
|
-
stopAtPreferredMessages: Boolean(options.force),
|
|
174
|
-
});
|
|
175
|
-
if (splitIndex <= 0 || splitIndex >= nextHistory.length) {
|
|
176
|
-
break;
|
|
177
|
-
}
|
|
178
|
-
compactedMessages += countNonCompactedMessages(nextHistory.slice(0, splitIndex));
|
|
179
|
-
nextHistory = buildLegacyCompactedHistory(nextHistory, splitIndex);
|
|
180
|
-
}
|
|
181
|
-
return {
|
|
182
|
-
history: nextHistory,
|
|
183
|
-
context: buildContextStats({
|
|
184
|
-
history: nextHistory,
|
|
185
|
-
usage: options.usage,
|
|
186
|
-
compactedMessages,
|
|
187
|
-
compactedAt: compactedMessages > 0 ? new Date().toISOString() : undefined,
|
|
188
|
-
estimatedRequestTokens: estimateRequestTokens({
|
|
189
|
-
history: nextHistory,
|
|
190
|
-
systemContext: options.systemContext,
|
|
191
|
-
toolNames: options.toolNames ?? [],
|
|
192
|
-
goal: options.goal,
|
|
193
|
-
}),
|
|
194
|
-
}),
|
|
195
|
-
};
|
|
196
|
-
}
|
|
197
|
-
export function estimateChatHistoryTokens(history) {
|
|
198
|
-
return history.reduce((total, message) => total + estimateMessageTokens(message), 0);
|
|
199
|
-
}
|
|
200
|
-
export function isCompactedHistorySummary(message) {
|
|
201
|
-
return message.role === 'system' && message.content.startsWith(COMPACTED_HISTORY_MARKER);
|
|
202
|
-
}
|
|
203
|
-
export function buildCompactionRunningContext(options) {
|
|
204
|
-
return {
|
|
205
|
-
...options.previous,
|
|
206
|
-
estimatedHistoryTokens: estimateChatHistoryTokens(options.history),
|
|
207
|
-
compactionStatus: 'running',
|
|
208
|
-
compactionError: undefined,
|
|
209
|
-
archiveCount: options.archiveCount ?? options.previous?.archiveCount,
|
|
210
|
-
currentSummaryPath: options.currentSummaryPath ?? options.previous?.currentSummaryPath,
|
|
211
|
-
lastArchivePath: options.lastArchivePath ?? options.previous?.lastArchivePath,
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
|
-
function buildContextStats(options) {
|
|
215
|
-
return {
|
|
216
|
-
estimatedHistoryTokens: estimateChatHistoryTokens(options.history),
|
|
217
|
-
estimatedRequestTokens: options.estimatedRequestTokens,
|
|
218
|
-
lastRunInputTokens: options.usage?.inputTokens,
|
|
219
|
-
lastRunOutputTokens: options.usage?.outputTokens,
|
|
220
|
-
lastRunTotalTokens: options.usage?.totalTokens,
|
|
221
|
-
cachedInputTokens: options.usage?.cachedInputTokens,
|
|
222
|
-
reasoningTokens: options.usage?.reasoningTokens,
|
|
223
|
-
compactedMessages: options.compactedMessages && options.compactedMessages > 0 ? options.compactedMessages : undefined,
|
|
224
|
-
compactedAt: options.compactedAt,
|
|
225
|
-
compactionStatus: options.compactionStatus ?? 'idle',
|
|
226
|
-
compactionError: options.compactionError,
|
|
227
|
-
archiveCount: options.archives?.length || undefined,
|
|
228
|
-
currentSummaryPath: options.currentSummaryPath,
|
|
229
|
-
lastArchivePath: options.lastArchivePath,
|
|
230
|
-
};
|
|
231
|
-
}
|
|
232
|
-
function buildLegacyCompactedHistory(history, splitIndex) {
|
|
233
|
-
const archived = history.slice(0, splitIndex);
|
|
234
|
-
const recent = history.slice(splitIndex);
|
|
235
|
-
const priorSummary = extractPriorSummary(archived);
|
|
236
|
-
const visibleLines = archived
|
|
237
|
-
.filter((message) => !isCompactedHistorySummary(message))
|
|
238
|
-
.flatMap(summarizeMessageForLegacyCompaction)
|
|
239
|
-
.slice(-12);
|
|
240
|
-
const summaryParts = [COMPACTED_HISTORY_MARKER];
|
|
241
|
-
if (priorSummary) {
|
|
242
|
-
summaryParts.push('', 'Earlier compacted summary:', priorSummary);
|
|
243
|
-
}
|
|
244
|
-
if (visibleLines.length > 0) {
|
|
245
|
-
summaryParts.push('', 'More recent archived turns:', ...visibleLines);
|
|
246
|
-
}
|
|
247
|
-
return [{
|
|
248
|
-
role: 'system',
|
|
249
|
-
content: truncateSummary(summaryParts.join('\n')),
|
|
250
|
-
}, ...recent];
|
|
251
|
-
}
|
|
252
|
-
function buildCompactedSummaryMessage(options) {
|
|
253
|
-
const archivePaths = options.archives
|
|
254
|
-
.slice(-8)
|
|
255
|
-
.map((archive) => `- ${archive.path}: ${archive.shortDescription ?? `${archive.messageCount} messages archived`}`);
|
|
256
|
-
const content = [
|
|
257
|
-
COMPACTED_HISTORY_MARKER,
|
|
258
|
-
'',
|
|
259
|
-
`Archive root: ${deriveChatArchivePaths('.', options.sessionId).displayArchivesDir}`,
|
|
260
|
-
'',
|
|
261
|
-
'Current rolling summary:',
|
|
262
|
-
truncateSummary(options.rollingSummary),
|
|
263
|
-
'',
|
|
264
|
-
'Archive index:',
|
|
265
|
-
...(archivePaths.length > 0 ? archivePaths : ['- No archive records found.']),
|
|
266
|
-
'',
|
|
267
|
-
'If exact wording, tool output, or earlier rationale matters, inspect the archive files with normal file tools before relying on this summary.',
|
|
268
|
-
].join('\n');
|
|
269
|
-
return {
|
|
270
|
-
role: 'system',
|
|
271
|
-
content,
|
|
272
|
-
};
|
|
273
|
-
}
|
|
274
|
-
async function summarizeChatArchive(options) {
|
|
275
|
-
const archiveIndex = options.manifest.archives.map((archive) => ({
|
|
276
|
-
id: archive.id,
|
|
277
|
-
path: archive.path,
|
|
278
|
-
summaryPath: archive.summaryPath,
|
|
279
|
-
shortDescription: archive.shortDescription,
|
|
280
|
-
messageCount: archive.messageCount,
|
|
281
|
-
createdAt: archive.createdAt,
|
|
282
|
-
}));
|
|
283
|
-
const transcript = buildSummarizerTranscript(options.archivedMessages, options.summaryModel);
|
|
284
|
-
const response = await options.llm.chat([
|
|
285
|
-
{
|
|
286
|
-
role: 'system',
|
|
287
|
-
content: [
|
|
288
|
-
'You summarize archived coding-agent conversations for later continuation.',
|
|
289
|
-
'Produce markdown with moderate fidelity and no preamble.',
|
|
290
|
-
'Preserve confirmed facts, user intent, concrete file/code references, decisions, commands, verification, risks, and follow-ups.',
|
|
291
|
-
'Use these exact sections when relevant:',
|
|
292
|
-
'# Compacted Conversation Rolling Summary',
|
|
293
|
-
'## User Goals And Preferences',
|
|
294
|
-
'## Work Completed',
|
|
295
|
-
'## Important Decisions',
|
|
296
|
-
'## Files And Code Areas Touched',
|
|
297
|
-
'## Commands And Verification',
|
|
298
|
-
'## Open Questions / Follow-Ups',
|
|
299
|
-
'## Archive Index',
|
|
300
|
-
'## High-Fidelity Details Worth Retrieving',
|
|
301
|
-
'Integrate the previous rolling summary when present.',
|
|
302
|
-
'Do not invent work that did not happen.',
|
|
303
|
-
].join('\n'),
|
|
304
|
-
},
|
|
305
|
-
{
|
|
306
|
-
role: 'user',
|
|
307
|
-
content: [
|
|
308
|
-
`Session: ${options.sessionId}`,
|
|
309
|
-
`New archive path: ${options.archivePath}`,
|
|
310
|
-
'',
|
|
311
|
-
'Previous rolling summary:',
|
|
312
|
-
options.previousRollingSummary?.trim() || '(none)',
|
|
313
|
-
'',
|
|
314
|
-
'Existing archive index JSON:',
|
|
315
|
-
JSON.stringify(archiveIndex, null, 2),
|
|
316
|
-
'',
|
|
317
|
-
'Newly archived transcript:',
|
|
318
|
-
transcript,
|
|
319
|
-
'',
|
|
320
|
-
'Produce the next cumulative rolling summary for the active history. Keep it concise enough for model context, but detailed enough that another agent can reconstruct the work state.',
|
|
321
|
-
].join('\n'),
|
|
322
|
-
},
|
|
323
|
-
], []);
|
|
324
|
-
const content = response.content?.trim();
|
|
325
|
-
if (!content) {
|
|
326
|
-
throw new Error(`Compaction summarizer returned no content for ${options.summaryModel}`);
|
|
327
|
-
}
|
|
328
|
-
return content;
|
|
329
|
-
}
|
|
330
|
-
function resolveSummarizer(options) {
|
|
331
|
-
if (options.summarizer?.llm) {
|
|
332
|
-
return {
|
|
333
|
-
llm: options.summarizer.llm,
|
|
334
|
-
model: options.summarizer.llm.info?.model ?? options.summarizer.model ?? options.model,
|
|
335
|
-
};
|
|
336
|
-
}
|
|
337
|
-
const provider = options.summarizer?.provider === 'active' || !options.summarizer?.provider ?
|
|
338
|
-
inferProviderFromModel(options.model)
|
|
339
|
-
: options.summarizer.provider;
|
|
340
|
-
const model = options.summarizer?.model
|
|
341
|
-
?? resolveSystemSelectedModel({
|
|
342
|
-
purpose: 'chat-compaction',
|
|
343
|
-
provider,
|
|
344
|
-
activeModel: options.model,
|
|
345
|
-
credentialMode: resolveCompactionCredentialMode({
|
|
346
|
-
activeModel: options.model,
|
|
347
|
-
explicitApiKey: options.summarizer?.apiKey,
|
|
348
|
-
credentialSource: options.summarizer?.credentialSource,
|
|
349
|
-
}),
|
|
350
|
-
});
|
|
351
|
-
const apiKey = options.summarizer?.apiKey ?? resolveApiKeyForModel(model);
|
|
352
|
-
if (!hasProviderCredentialForModel(model, {
|
|
353
|
-
apiKey,
|
|
354
|
-
apiKeyProvider: options.summarizer?.apiKey ? 'explicit' : apiKey ? provider : undefined,
|
|
355
|
-
})) {
|
|
356
|
-
return { model };
|
|
357
|
-
}
|
|
358
|
-
return {
|
|
359
|
-
model,
|
|
360
|
-
llm: createLlmAdapter({ model, apiKey }),
|
|
361
|
-
};
|
|
362
|
-
}
|
|
363
|
-
function resolveCompactionCredentialMode(args) {
|
|
364
|
-
return credentialModeFromSource(args.credentialSource ?? resolveProviderCredentialSourceForModel(args.activeModel, {
|
|
365
|
-
apiKey: args.explicitApiKey,
|
|
366
|
-
apiKeyProvider: args.explicitApiKey ? 'explicit' : undefined,
|
|
367
|
-
credentialStorePath: args.credentialStorePath,
|
|
368
|
-
}));
|
|
369
|
-
}
|
|
370
|
-
function extractPriorSummary(history) {
|
|
371
|
-
const summaryMessage = history.find(isCompactedHistorySummary);
|
|
372
|
-
if (!summaryMessage || summaryMessage.role !== 'system') {
|
|
373
|
-
return undefined;
|
|
374
|
-
}
|
|
375
|
-
const content = summaryMessage.content.slice(COMPACTED_HISTORY_MARKER.length).trim();
|
|
376
|
-
return content || undefined;
|
|
377
|
-
}
|
|
378
|
-
function summarizeMessageForLegacyCompaction(message) {
|
|
379
|
-
if (message.role === 'user') {
|
|
380
|
-
return [`User: ${truncateLine(message.content, 220)}`];
|
|
381
|
-
}
|
|
382
|
-
if (message.role === 'assistant') {
|
|
383
|
-
const lines = [`Assistant: ${truncateLine(message.content, 220)}`];
|
|
384
|
-
if (message.toolCalls?.length) {
|
|
385
|
-
lines.push(`Assistant tool calls: ${message.toolCalls.map((call) => call.tool).join(', ')}`);
|
|
386
|
-
}
|
|
387
|
-
return lines;
|
|
388
|
-
}
|
|
389
|
-
if (message.role === 'tool') {
|
|
390
|
-
return [`Tool result recorded for ${message.toolCallId}.`];
|
|
391
|
-
}
|
|
392
|
-
return [];
|
|
393
|
-
}
|
|
394
|
-
function buildSummarizerTranscript(messages, summaryModel) {
|
|
395
|
-
if (messages.length === 0) {
|
|
396
|
-
return '(no archived messages)';
|
|
397
|
-
}
|
|
398
|
-
const transcriptCharBudget = resolveSummarizerTranscriptCharBudget(summaryModel);
|
|
399
|
-
const perMessageBudget = Math.max(MIN_SUMMARIZER_MESSAGE_CHARS, Math.min(MAX_SUMMARIZER_MESSAGE_CHARS, Math.floor(transcriptCharBudget / messages.length) - 80));
|
|
400
|
-
const lines = [
|
|
401
|
-
`Summarizer transcript note: raw archive contains ${messages.length} complete messages.`,
|
|
402
|
-
`Each message below is condensed to fit the summarizer request. Read the archive file when exact wording or full tool output matters.`,
|
|
403
|
-
`Summarizer input budget: about ${Math.floor(transcriptCharBudget / 4).toLocaleString()} estimated text tokens.`,
|
|
404
|
-
];
|
|
405
|
-
let totalChars = lines.join('\n').length;
|
|
406
|
-
for (const [index, message] of messages.entries()) {
|
|
407
|
-
const rendered = `## Message ${index + 1}\n${renderArchivedMessageForSummary(message, perMessageBudget)}`;
|
|
408
|
-
const separator = lines.length > 0 ? '\n\n' : '';
|
|
409
|
-
if (totalChars + separator.length + rendered.length > transcriptCharBudget) {
|
|
410
|
-
lines.push(`\n\nOmitted ${messages.length - index} additional archived messages from summarizer input to stay within request budget. Inspect the raw archive for full detail.`);
|
|
411
|
-
break;
|
|
412
|
-
}
|
|
413
|
-
lines.push(rendered);
|
|
414
|
-
totalChars += separator.length + rendered.length;
|
|
415
|
-
}
|
|
416
|
-
return lines.join('\n\n');
|
|
417
|
-
}
|
|
418
|
-
function resolveSummarizerTranscriptCharBudget(summaryModel) {
|
|
419
|
-
const contextWindow = estimateBuiltInContextWindow(summaryModel) ?? DEFAULT_CONTEXT_WINDOW_ESTIMATE;
|
|
420
|
-
const budgetByContext = Math.floor(contextWindow * MAX_SUMMARIZER_CONTEXT_RATIO);
|
|
421
|
-
const tokenBudget = Math.min(MAX_SUMMARIZER_TRANSCRIPT_TOKENS, budgetByContext);
|
|
422
|
-
return Math.min(MAX_SUMMARIZER_TRANSCRIPT_CHARS, tokenBudget * 4);
|
|
423
|
-
}
|
|
424
|
-
function renderArchivedMessageForSummary(message, maxChars) {
|
|
425
|
-
if (message.role === 'assistant') {
|
|
426
|
-
const parts = [
|
|
427
|
-
'Role: assistant',
|
|
428
|
-
message.content ? `Content excerpt:\n${truncateForSummary(message.content, maxChars)}` : 'Content: (empty)',
|
|
429
|
-
message.toolCalls?.length ?
|
|
430
|
-
`Tool calls:\n${truncateForSummary(JSON.stringify(message.toolCalls, null, 2), maxChars)}`
|
|
431
|
-
: undefined,
|
|
432
|
-
].filter((part) => Boolean(part));
|
|
433
|
-
return parts.join('\n\n');
|
|
434
|
-
}
|
|
435
|
-
if (message.role === 'tool') {
|
|
436
|
-
return [
|
|
437
|
-
'Role: tool',
|
|
438
|
-
`Tool call id: ${message.toolCallId}`,
|
|
439
|
-
`Content excerpt:\n${truncateForSummary(message.content, maxChars)}`,
|
|
440
|
-
].join('\n\n');
|
|
441
|
-
}
|
|
442
|
-
return [
|
|
443
|
-
`Role: ${message.role}`,
|
|
444
|
-
`Content excerpt:\n${truncateForSummary(message.content, maxChars)}`,
|
|
445
|
-
].join('\n\n');
|
|
446
|
-
}
|
|
447
|
-
function deriveShortDescription(summary) {
|
|
448
|
-
const lines = summary
|
|
449
|
-
.split('\n')
|
|
450
|
-
.map((line) => line.trim())
|
|
451
|
-
.filter((line) => line && !line.startsWith('#'));
|
|
452
|
-
const first = lines[0];
|
|
453
|
-
return first ? truncateLine(first, 120) : undefined;
|
|
454
|
-
}
|
|
455
|
-
function truncateSummary(value) {
|
|
456
|
-
if (value.length <= MAX_ROLLING_SUMMARY_CHARS) {
|
|
457
|
-
return value;
|
|
458
|
-
}
|
|
459
|
-
return `${value.slice(0, MAX_ROLLING_SUMMARY_CHARS - 1).trimEnd()}…`;
|
|
460
|
-
}
|
|
461
|
-
function truncateForSummary(value, maxChars) {
|
|
462
|
-
if (value.length <= maxChars) {
|
|
463
|
-
return value;
|
|
464
|
-
}
|
|
465
|
-
return `${value.slice(0, Math.max(0, maxChars - 80)).trimEnd()}\n\n[truncated ${value.length - maxChars} chars; full content is in the raw archive]`;
|
|
466
|
-
}
|
|
467
|
-
function truncateLine(value, maxChars) {
|
|
468
|
-
const compact = value.replace(/\s+/g, ' ').trim();
|
|
469
|
-
if (compact.length <= maxChars) {
|
|
470
|
-
return compact;
|
|
471
|
-
}
|
|
472
|
-
return `${compact.slice(0, maxChars - 1).trimEnd()}…`;
|
|
473
|
-
}
|
|
474
|
-
function countNonCompactedMessages(history) {
|
|
475
|
-
return history.filter((message) => !isCompactedHistorySummary(message)).length;
|
|
476
|
-
}
|
|
477
|
-
function resolveRecentHistoryTokenBudget(contextWindow) {
|
|
478
|
-
return Math.max(MIN_RECENT_HISTORY_TOKEN_BUDGET, Math.min(MAX_RECENT_HISTORY_TOKEN_BUDGET, Math.floor(contextWindow * MAX_RECENT_HISTORY_RATIO)));
|
|
479
|
-
}
|
|
480
|
-
function findCompactionSplit(history, options) {
|
|
481
|
-
let splitIndex = history.length;
|
|
482
|
-
let recentTokens = 0;
|
|
483
|
-
let recentMessages = 0;
|
|
484
|
-
while (splitIndex > 0) {
|
|
485
|
-
if (options.stopAtPreferredMessages && recentMessages >= options.preferredRecentMessages) {
|
|
486
|
-
break;
|
|
487
|
-
}
|
|
488
|
-
const nextMessage = history[splitIndex - 1];
|
|
489
|
-
if (!nextMessage) {
|
|
490
|
-
break;
|
|
491
|
-
}
|
|
492
|
-
const nextTokens = estimateMessageTokens(nextMessage);
|
|
493
|
-
const exceedsBudget = recentTokens + nextTokens > options.recentTokenBudget;
|
|
494
|
-
const reachedPreferredCount = recentMessages >= options.preferredRecentMessages;
|
|
495
|
-
if (recentMessages > 0 && exceedsBudget && reachedPreferredCount) {
|
|
496
|
-
break;
|
|
497
|
-
}
|
|
498
|
-
if (recentMessages > 0 && exceedsBudget && nextTokens > options.recentTokenBudget) {
|
|
499
|
-
break;
|
|
500
|
-
}
|
|
501
|
-
splitIndex--;
|
|
502
|
-
recentTokens += nextTokens;
|
|
503
|
-
if (!isCompactedHistorySummary(nextMessage)) {
|
|
504
|
-
recentMessages++;
|
|
505
|
-
}
|
|
506
|
-
if (recentMessages >= options.preferredRecentMessages && recentTokens >= options.recentTokenBudget) {
|
|
507
|
-
break;
|
|
508
|
-
}
|
|
509
|
-
}
|
|
510
|
-
while (splitIndex > 0 && history[splitIndex]?.role === 'tool') {
|
|
511
|
-
splitIndex--;
|
|
512
|
-
}
|
|
513
|
-
if (splitIndex > 0 && isAssistantToolCallMessage(history[splitIndex - 1])) {
|
|
514
|
-
splitIndex--;
|
|
515
|
-
}
|
|
516
|
-
return splitIndex;
|
|
517
|
-
}
|
|
518
|
-
function estimateMessageTokens(message) {
|
|
519
|
-
if (isCompactedHistorySummary(message)) {
|
|
520
|
-
return estimateTextTokens(message.content) + 12;
|
|
521
|
-
}
|
|
522
|
-
switch (message.role) {
|
|
523
|
-
case 'system':
|
|
524
|
-
case 'user':
|
|
525
|
-
case 'tool':
|
|
526
|
-
return estimateTextTokens(message.content) + 12;
|
|
527
|
-
case 'assistant':
|
|
528
|
-
return estimateTextTokens(message.content) + 12 + (message.toolCalls?.length ?? 0) * 24;
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
function estimateTextTokens(text) {
|
|
532
|
-
return Math.ceil(text.length / 4);
|
|
533
|
-
}
|
|
534
|
-
function estimateRequestTokens(options) {
|
|
535
|
-
const syntheticGoal = options.goal ?? 'Continue from the current conversation.';
|
|
536
|
-
const systemPromptEstimate = estimateTextTokens([
|
|
537
|
-
syntheticGoal,
|
|
538
|
-
options.systemContext ?? '',
|
|
539
|
-
options.toolNames.join(','),
|
|
540
|
-
].join('\n'));
|
|
541
|
-
return systemPromptEstimate + estimateChatHistoryTokens(options.history) + estimateTextTokens(syntheticGoal) + 24;
|
|
542
|
-
}
|
|
543
|
-
function isAssistantToolCallMessage(message) {
|
|
544
|
-
return message?.role === 'assistant' && !!message.toolCalls && message.toolCalls.length > 0;
|
|
545
|
-
}
|
|
546
|
-
//# sourceMappingURL=compaction.js.map
|