open-multi-agent-kit 0.80.5 → 0.80.7
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/CHANGELOG.md +31 -0
- package/README.md +22 -14
- package/dist/cli/config-selector.d.ts +1 -1
- package/dist/cli/config-selector.d.ts.map +1 -1
- package/dist/cli/config-selector.js +1 -1
- package/dist/cli/config-selector.js.map +1 -1
- package/dist/config.d.ts +5 -9
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +55 -23
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session.d.ts +45 -6
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +197 -13
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts +4 -1
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +5 -5
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/bash-executor.d.ts.map +1 -1
- package/dist/core/bash-executor.js +1 -1
- package/dist/core/bash-executor.js.map +1 -1
- package/dist/core/command-safety.d.ts +11 -0
- package/dist/core/command-safety.d.ts.map +1 -0
- package/dist/core/command-safety.js +528 -0
- package/dist/core/command-safety.js.map +1 -0
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +20 -5
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +99 -1
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +655 -21
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/compaction/pruner-policy.d.ts +84 -0
- package/dist/core/compaction/pruner-policy.d.ts.map +1 -0
- package/dist/core/compaction/pruner-policy.js +273 -0
- package/dist/core/compaction/pruner-policy.js.map +1 -0
- package/dist/core/context-graph-identity-resolution.d.ts +114 -0
- package/dist/core/context-graph-identity-resolution.d.ts.map +1 -0
- package/dist/core/context-graph-identity-resolution.js +127 -0
- package/dist/core/context-graph-identity-resolution.js.map +1 -0
- package/dist/core/context-graph-memory-store.d.ts +153 -0
- package/dist/core/context-graph-memory-store.d.ts.map +1 -0
- package/dist/core/context-graph-memory-store.js +377 -0
- package/dist/core/context-graph-memory-store.js.map +1 -0
- package/dist/core/context-graph-ontology-generation.d.ts +104 -0
- package/dist/core/context-graph-ontology-generation.d.ts.map +1 -0
- package/dist/core/context-graph-ontology-generation.js +135 -0
- package/dist/core/context-graph-ontology-generation.js.map +1 -0
- package/dist/core/context-graph-ontology-registry.d.ts +766 -0
- package/dist/core/context-graph-ontology-registry.d.ts.map +1 -0
- package/dist/core/context-graph-ontology-registry.js +1133 -0
- package/dist/core/context-graph-ontology-registry.js.map +1 -0
- package/dist/core/context-graph-policy.d.ts +68 -0
- package/dist/core/context-graph-policy.d.ts.map +1 -0
- package/dist/core/context-graph-policy.js +221 -0
- package/dist/core/context-graph-policy.js.map +1 -0
- package/dist/core/context-graph-reasoning.d.ts +130 -0
- package/dist/core/context-graph-reasoning.d.ts.map +1 -0
- package/dist/core/context-graph-reasoning.js +442 -0
- package/dist/core/context-graph-reasoning.js.map +1 -0
- package/dist/core/context-graph-retrieval.d.ts +120 -0
- package/dist/core/context-graph-retrieval.d.ts.map +1 -0
- package/dist/core/context-graph-retrieval.js +288 -0
- package/dist/core/context-graph-retrieval.js.map +1 -0
- package/dist/core/contract-verification.d.ts +78 -0
- package/dist/core/contract-verification.d.ts.map +1 -0
- package/dist/core/contract-verification.js +110 -0
- package/dist/core/contract-verification.js.map +1 -0
- package/dist/core/exact-cache-policy.d.ts +100 -0
- package/dist/core/exact-cache-policy.d.ts.map +1 -0
- package/dist/core/exact-cache-policy.js +175 -0
- package/dist/core/exact-cache-policy.js.map +1 -0
- package/dist/core/exec.d.ts +2 -0
- package/dist/core/exec.d.ts.map +1 -1
- package/dist/core/exec.js +1 -0
- package/dist/core/exec.js.map +1 -1
- package/dist/core/export-html/template.js +2 -2
- package/dist/core/extensions/builtin/command-safety-gate.d.ts +77 -0
- package/dist/core/extensions/builtin/command-safety-gate.d.ts.map +1 -0
- package/dist/core/extensions/builtin/command-safety-gate.js +147 -0
- package/dist/core/extensions/builtin/command-safety-gate.js.map +1 -0
- package/dist/core/extensions/loader.d.ts +4 -4
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +94 -56
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +1 -1
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +38 -10
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/freedom/banner.d.ts +14 -0
- package/dist/core/freedom/banner.d.ts.map +1 -0
- package/dist/core/freedom/banner.js +22 -0
- package/dist/core/freedom/banner.js.map +1 -0
- package/dist/core/freedom/config.d.ts +27 -0
- package/dist/core/freedom/config.d.ts.map +1 -0
- package/dist/core/freedom/config.js +216 -0
- package/dist/core/freedom/config.js.map +1 -0
- package/dist/core/freedom/index.d.ts +23 -0
- package/dist/core/freedom/index.d.ts.map +1 -0
- package/dist/core/freedom/index.js +19 -0
- package/dist/core/freedom/index.js.map +1 -0
- package/dist/core/freedom/policy.d.ts +42 -0
- package/dist/core/freedom/policy.d.ts.map +1 -0
- package/dist/core/freedom/policy.js +47 -0
- package/dist/core/freedom/policy.js.map +1 -0
- package/dist/core/freedom/safety-floor.d.ts +73 -0
- package/dist/core/freedom/safety-floor.d.ts.map +1 -0
- package/dist/core/freedom/safety-floor.js +275 -0
- package/dist/core/freedom/safety-floor.js.map +1 -0
- package/dist/core/harness-control-events.d.ts +91 -0
- package/dist/core/harness-control-events.d.ts.map +1 -0
- package/dist/core/harness-control-events.js +514 -0
- package/dist/core/harness-control-events.js.map +1 -0
- package/dist/core/harness-control-replay.d.ts +31 -0
- package/dist/core/harness-control-replay.d.ts.map +1 -0
- package/dist/core/harness-control-replay.js +187 -0
- package/dist/core/harness-control-replay.js.map +1 -0
- package/dist/core/headroom-middleware.d.ts +35 -0
- package/dist/core/headroom-middleware.d.ts.map +1 -0
- package/dist/core/headroom-middleware.js +166 -0
- package/dist/core/headroom-middleware.js.map +1 -0
- package/dist/core/hook-inventory.d.ts +23 -0
- package/dist/core/hook-inventory.d.ts.map +1 -0
- package/dist/core/hook-inventory.js +50 -0
- package/dist/core/hook-inventory.js.map +1 -0
- package/dist/core/keybindings.d.ts +12 -0
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +31 -1
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/lean-context-middleware.d.ts +12 -0
- package/dist/core/lean-context-middleware.d.ts.map +1 -0
- package/dist/core/lean-context-middleware.js +87 -0
- package/dist/core/lean-context-middleware.js.map +1 -0
- package/dist/core/lean-context-policy.d.ts +45 -0
- package/dist/core/lean-context-policy.d.ts.map +1 -0
- package/dist/core/lean-context-policy.js +108 -0
- package/dist/core/lean-context-policy.js.map +1 -0
- package/dist/core/loadout-access-policy.d.ts +41 -0
- package/dist/core/loadout-access-policy.d.ts.map +1 -0
- package/dist/core/loadout-access-policy.js +182 -0
- package/dist/core/loadout-access-policy.js.map +1 -0
- package/dist/core/loadout-runtime.d.ts +84 -0
- package/dist/core/loadout-runtime.d.ts.map +1 -0
- package/dist/core/loadout-runtime.js +157 -0
- package/dist/core/loadout-runtime.js.map +1 -0
- package/dist/core/loadouts.d.ts +147 -0
- package/dist/core/loadouts.d.ts.map +1 -0
- package/dist/core/loadouts.js +442 -0
- package/dist/core/loadouts.js.map +1 -0
- package/dist/core/mcp-inventory.d.ts +74 -0
- package/dist/core/mcp-inventory.d.ts.map +1 -0
- package/dist/core/mcp-inventory.js +156 -0
- package/dist/core/mcp-inventory.js.map +1 -0
- package/dist/core/mcp-presets.d.ts +57 -0
- package/dist/core/mcp-presets.d.ts.map +1 -0
- package/dist/core/mcp-presets.js +81 -0
- package/dist/core/mcp-presets.js.map +1 -0
- package/dist/core/model-registry.d.ts +1 -0
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +40 -17
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +1 -0
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/native-adoption-benchmark.d.ts +166 -0
- package/dist/core/native-adoption-benchmark.d.ts.map +1 -0
- package/dist/core/native-adoption-benchmark.js +624 -0
- package/dist/core/native-adoption-benchmark.js.map +1 -0
- package/dist/core/observability-trace.d.ts +80 -0
- package/dist/core/observability-trace.d.ts.map +1 -0
- package/dist/core/observability-trace.js +140 -0
- package/dist/core/observability-trace.js.map +1 -0
- package/dist/core/orchestration/checkpoint.d.ts +83 -0
- package/dist/core/orchestration/checkpoint.d.ts.map +1 -0
- package/dist/core/orchestration/checkpoint.js +152 -0
- package/dist/core/orchestration/checkpoint.js.map +1 -0
- package/dist/core/orchestration/errors.d.ts +74 -0
- package/dist/core/orchestration/errors.d.ts.map +1 -0
- package/dist/core/orchestration/errors.js +52 -0
- package/dist/core/orchestration/errors.js.map +1 -0
- package/dist/core/orchestration/merge-queue.d.ts +121 -0
- package/dist/core/orchestration/merge-queue.d.ts.map +1 -0
- package/dist/core/orchestration/merge-queue.js +149 -0
- package/dist/core/orchestration/merge-queue.js.map +1 -0
- package/dist/core/orchestration/recovery.d.ts +106 -0
- package/dist/core/orchestration/recovery.d.ts.map +1 -0
- package/dist/core/orchestration/recovery.js +110 -0
- package/dist/core/orchestration/recovery.js.map +1 -0
- package/dist/core/orchestration/replay-ledger.d.ts +76 -0
- package/dist/core/orchestration/replay-ledger.d.ts.map +1 -0
- package/dist/core/orchestration/replay-ledger.js +395 -0
- package/dist/core/orchestration/replay-ledger.js.map +1 -0
- package/dist/core/orchestration/scheduler-state.d.ts +78 -0
- package/dist/core/orchestration/scheduler-state.d.ts.map +1 -0
- package/dist/core/orchestration/scheduler-state.js +185 -0
- package/dist/core/orchestration/scheduler-state.js.map +1 -0
- package/dist/core/orchestration/scheduler-store.d.ts +309 -0
- package/dist/core/orchestration/scheduler-store.d.ts.map +1 -0
- package/dist/core/orchestration/scheduler-store.js +368 -0
- package/dist/core/orchestration/scheduler-store.js.map +1 -0
- package/dist/core/orchestration/sqlite-scheduler-store.d.ts +57 -0
- package/dist/core/orchestration/sqlite-scheduler-store.d.ts.map +1 -0
- package/dist/core/orchestration/sqlite-scheduler-store.js +528 -0
- package/dist/core/orchestration/sqlite-scheduler-store.js.map +1 -0
- package/dist/core/orchestration/transaction-coordinator.d.ts +217 -0
- package/dist/core/orchestration/transaction-coordinator.d.ts.map +1 -0
- package/dist/core/orchestration/transaction-coordinator.js +281 -0
- package/dist/core/orchestration/transaction-coordinator.js.map +1 -0
- package/dist/core/orchestration/verification-contract.d.ts +197 -0
- package/dist/core/orchestration/verification-contract.d.ts.map +1 -0
- package/dist/core/orchestration/verification-contract.js +145 -0
- package/dist/core/orchestration/verification-contract.js.map +1 -0
- package/dist/core/package-composition.d.ts +68 -0
- package/dist/core/package-composition.d.ts.map +1 -0
- package/dist/core/package-composition.js +304 -0
- package/dist/core/package-composition.js.map +1 -0
- package/dist/core/package-gallery.d.ts +124 -0
- package/dist/core/package-gallery.d.ts.map +1 -0
- package/dist/core/package-gallery.js +392 -0
- package/dist/core/package-gallery.js.map +1 -0
- package/dist/core/package-manager.d.ts +69 -0
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +367 -69
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/package-procurement.d.ts +268 -0
- package/dist/core/package-procurement.d.ts.map +1 -0
- package/dist/core/package-procurement.js +697 -0
- package/dist/core/package-procurement.js.map +1 -0
- package/dist/core/package-trial-runtime.d.ts +75 -0
- package/dist/core/package-trial-runtime.d.ts.map +1 -0
- package/dist/core/package-trial-runtime.js +73 -0
- package/dist/core/package-trial-runtime.js.map +1 -0
- package/dist/core/package-trial-sandbox.d.ts +27 -0
- package/dist/core/package-trial-sandbox.d.ts.map +1 -0
- package/dist/core/package-trial-sandbox.js +102 -0
- package/dist/core/package-trial-sandbox.js.map +1 -0
- package/dist/core/policy-overlays-runtime.d.ts +141 -0
- package/dist/core/policy-overlays-runtime.d.ts.map +1 -0
- package/dist/core/policy-overlays-runtime.js +720 -0
- package/dist/core/policy-overlays-runtime.js.map +1 -0
- package/dist/core/read-anchor-registry.d.ts +27 -0
- package/dist/core/read-anchor-registry.d.ts.map +1 -0
- package/dist/core/read-anchor-registry.js +103 -0
- package/dist/core/read-anchor-registry.js.map +1 -0
- package/dist/core/read-anchors.d.ts +110 -0
- package/dist/core/read-anchors.d.ts.map +1 -0
- package/dist/core/read-anchors.js +193 -0
- package/dist/core/read-anchors.js.map +1 -0
- package/dist/core/read-content-cache.d.ts +22 -0
- package/dist/core/read-content-cache.d.ts.map +1 -0
- package/dist/core/read-content-cache.js +79 -0
- package/dist/core/read-content-cache.js.map +1 -0
- package/dist/core/recovery-checkpoint.d.ts +196 -0
- package/dist/core/recovery-checkpoint.d.ts.map +1 -0
- package/dist/core/recovery-checkpoint.js +382 -0
- package/dist/core/recovery-checkpoint.js.map +1 -0
- package/dist/core/resolve-config-value.d.ts +1 -1
- package/dist/core/resolve-config-value.d.ts.map +1 -1
- package/dist/core/resolve-config-value.js +30 -2
- package/dist/core/resolve-config-value.js.map +1 -1
- package/dist/core/resource-loader.d.ts +23 -21
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +93 -15
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/sandbox/backend.d.ts +25 -0
- package/dist/core/sandbox/backend.d.ts.map +1 -0
- package/dist/core/sandbox/backend.js +150 -0
- package/dist/core/sandbox/backend.js.map +1 -0
- package/dist/core/sandbox/env.d.ts +6 -0
- package/dist/core/sandbox/env.d.ts.map +1 -0
- package/dist/core/sandbox/env.js +46 -0
- package/dist/core/sandbox/env.js.map +1 -0
- package/dist/core/sandbox/path-resolver.d.ts +4 -0
- package/dist/core/sandbox/path-resolver.d.ts.map +1 -0
- package/dist/core/sandbox/path-resolver.js +44 -0
- package/dist/core/sandbox/path-resolver.js.map +1 -0
- package/dist/core/sandbox/policy.d.ts +87 -0
- package/dist/core/sandbox/policy.d.ts.map +1 -0
- package/dist/core/sandbox/policy.js +280 -0
- package/dist/core/sandbox/policy.js.map +1 -0
- package/dist/core/sandbox/spawn.d.ts +20 -0
- package/dist/core/sandbox/spawn.d.ts.map +1 -0
- package/dist/core/sandbox/spawn.js +80 -0
- package/dist/core/sandbox/spawn.js.map +1 -0
- package/dist/core/sdk.d.ts +83 -4
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +143 -55
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/semantic-cache-policy.d.ts +45 -0
- package/dist/core/semantic-cache-policy.d.ts.map +1 -0
- package/dist/core/semantic-cache-policy.js +220 -0
- package/dist/core/semantic-cache-policy.js.map +1 -0
- package/dist/core/session-digest.d.ts +57 -0
- package/dist/core/session-digest.d.ts.map +1 -0
- package/dist/core/session-digest.js +193 -0
- package/dist/core/session-digest.js.map +1 -0
- package/dist/core/session-manager.d.ts +2 -2
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +5 -4
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-manager.d.ts +17 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +47 -2
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +4 -1
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/spec-kit/compiler.d.ts +67 -0
- package/dist/core/spec-kit/compiler.d.ts.map +1 -0
- package/dist/core/spec-kit/compiler.js +268 -0
- package/dist/core/spec-kit/compiler.js.map +1 -0
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +25 -7
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/telemetry.d.ts.map +1 -1
- package/dist/core/telemetry.js +1 -1
- package/dist/core/telemetry.js.map +1 -1
- package/dist/core/timings.d.ts +1 -1
- package/dist/core/timings.d.ts.map +1 -1
- package/dist/core/timings.js +2 -2
- package/dist/core/timings.js.map +1 -1
- package/dist/core/tools/bash.d.ts +28 -3
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +53 -10
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit.d.ts +12 -0
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +24 -0
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/find.d.ts +3 -0
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +3 -0
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts +3 -0
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +4 -1
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/index.d.ts +1 -1
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/ls.d.ts +3 -0
- package/dist/core/tools/ls.d.ts.map +1 -1
- package/dist/core/tools/ls.js +3 -0
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/output-accumulator.d.ts.map +1 -1
- package/dist/core/tools/output-accumulator.js +1 -1
- package/dist/core/tools/output-accumulator.js.map +1 -1
- package/dist/core/tools/read.d.ts +13 -0
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +29 -2
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/write.d.ts +3 -0
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +3 -0
- package/dist/core/tools/write.js.map +1 -1
- package/dist/core/transaction-coordinator.d.ts +30 -0
- package/dist/core/transaction-coordinator.d.ts.map +1 -0
- package/dist/core/transaction-coordinator.js +173 -0
- package/dist/core/transaction-coordinator.js.map +1 -0
- package/dist/index.d.ts +19 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -2
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +4 -6
- package/dist/main.js.map +1 -1
- package/dist/migrations.d.ts +35 -0
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +410 -4
- package/dist/migrations.js.map +1 -1
- package/dist/modes/interactive/components/control-panel-gradient-motion.d.ts +28 -0
- package/dist/modes/interactive/components/control-panel-gradient-motion.d.ts.map +1 -0
- package/dist/modes/interactive/components/control-panel-gradient-motion.js +146 -0
- package/dist/modes/interactive/components/control-panel-gradient-motion.js.map +1 -0
- package/dist/modes/interactive/components/control-panel-gradient.d.ts +27 -0
- package/dist/modes/interactive/components/control-panel-gradient.d.ts.map +1 -0
- package/dist/modes/interactive/components/control-panel-gradient.js +127 -0
- package/dist/modes/interactive/components/control-panel-gradient.js.map +1 -0
- package/dist/modes/interactive/components/control-panel.d.ts +56 -0
- package/dist/modes/interactive/components/control-panel.d.ts.map +1 -0
- package/dist/modes/interactive/components/control-panel.js +240 -0
- package/dist/modes/interactive/components/control-panel.js.map +1 -0
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-editor.js +21 -13
- package/dist/modes/interactive/components/custom-editor.js.map +1 -1
- package/dist/modes/interactive/components/earendil-announcement.d.ts.map +1 -1
- package/dist/modes/interactive/components/earendil-announcement.js +1 -1
- package/dist/modes/interactive/components/earendil-announcement.js.map +1 -1
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-editor.js +1 -1
- package/dist/modes/interactive/components/extension-editor.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +8 -0
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/index.d.ts +3 -0
- package/dist/modes/interactive/components/index.d.ts.map +1 -1
- package/dist/modes/interactive/components/index.js +3 -0
- package/dist/modes/interactive/components/index.js.map +1 -1
- package/dist/modes/interactive/components/mcp-selector.d.ts +30 -0
- package/dist/modes/interactive/components/mcp-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/mcp-selector.js +155 -0
- package/dist/modes/interactive/components/mcp-selector.js.map +1 -0
- package/dist/modes/interactive/components/model-selector-state.d.ts +101 -0
- package/dist/modes/interactive/components/model-selector-state.d.ts.map +1 -0
- package/dist/modes/interactive/components/model-selector-state.js +261 -0
- package/dist/modes/interactive/components/model-selector-state.js.map +1 -0
- package/dist/modes/interactive/components/model-selector.d.ts +52 -9
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +212 -66
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +19 -1
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +21 -8
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/skills-selector.d.ts +32 -0
- package/dist/modes/interactive/components/skills-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/skills-selector.js +130 -0
- package/dist/modes/interactive/components/skills-selector.js.map +1 -0
- package/dist/modes/interactive/components/theme-selector.d.ts +1 -0
- package/dist/modes/interactive/components/theme-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/theme-selector.js +10 -1
- package/dist/modes/interactive/components/theme-selector.js.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.d.ts +7 -8
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.js +7 -48
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +13 -2
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +399 -108
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/catppuccin-mocha.json +86 -0
- package/dist/modes/interactive/theme/dracula.json +86 -0
- package/dist/modes/interactive/theme/gruvbox-dark.json +86 -0
- package/dist/modes/interactive/theme/kanagawa-dragon.json +86 -0
- package/dist/modes/interactive/theme/omk-blackboard.json +91 -0
- package/dist/modes/interactive/theme/omk-control-panel.json +91 -0
- package/dist/modes/interactive/theme/omk-freedom-grid.json +91 -0
- package/dist/modes/interactive/theme/omk-neon-ops.json +90 -0
- package/dist/modes/interactive/theme/omk-slate-light.json +91 -0
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +55 -16
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/interactive/theme/tokyo-night-storm.json +86 -0
- package/dist/modes/print-mode.d.ts +2 -2
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +2 -2
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +4 -0
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +114 -49
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/utils/clipboard-image.d.ts.map +1 -1
- package/dist/utils/clipboard-image.js +1 -1
- package/dist/utils/clipboard-image.js.map +1 -1
- package/dist/utils/omk-user-agent.d.ts +2 -0
- package/dist/utils/omk-user-agent.d.ts.map +1 -0
- package/dist/utils/{pi-user-agent.js → omk-user-agent.js} +2 -2
- package/dist/utils/omk-user-agent.js.map +1 -0
- package/dist/utils/tools-manager.d.ts.map +1 -1
- package/dist/utils/tools-manager.js +1 -1
- package/dist/utils/tools-manager.js.map +1 -1
- package/dist/utils/version-check.d.ts +5 -5
- package/dist/utils/version-check.d.ts.map +1 -1
- package/dist/utils/version-check.js +8 -11
- package/dist/utils/version-check.js.map +1 -1
- package/dist/utils/windows-self-update.d.ts.map +1 -1
- package/dist/utils/windows-self-update.js +1 -1
- package/dist/utils/windows-self-update.js.map +1 -1
- package/docs/compaction.md +21 -8
- package/docs/packages.md +47 -6
- package/docs/prompt-templates.md +2 -0
- package/docs/quickstart.md +1 -1
- package/docs/themes.md +10 -2
- package/docs/usage.md +18 -7
- package/examples/README.md +1 -1
- package/examples/extensions/README.md +11 -11
- package/examples/extensions/auto-commit-on-exit.ts +6 -6
- package/examples/extensions/bash-spawn-hook.ts +4 -4
- package/examples/extensions/bookmark.ts +5 -5
- package/examples/extensions/border-status-editor.ts +7 -7
- package/examples/extensions/built-in-tool-renderer.ts +6 -6
- package/examples/extensions/claude-rules.ts +4 -4
- package/examples/extensions/commands.ts +5 -5
- package/examples/extensions/confirm-destructive.ts +3 -3
- package/examples/extensions/custom-compaction.ts +3 -3
- package/examples/extensions/custom-footer.ts +2 -2
- package/examples/extensions/custom-header.ts +5 -5
- package/examples/extensions/custom-provider-anthropic/index.ts +4 -4
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/index.ts +3 -3
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/dirty-repo-guard.ts +7 -7
- package/examples/extensions/doom-overlay/README.md +3 -3
- package/examples/extensions/doom-overlay/doom/build.sh +2 -2
- package/examples/extensions/doom-overlay/doom/doomgeneric_pi.c +1 -1
- package/examples/extensions/doom-overlay/index.ts +3 -3
- package/examples/extensions/dynamic-resources/dynamic.json +1 -1
- package/examples/extensions/dynamic-resources/index.ts +2 -2
- package/examples/extensions/dynamic-tools.ts +4 -4
- package/examples/extensions/event-bus.ts +8 -8
- package/examples/extensions/file-trigger.ts +3 -3
- package/examples/extensions/git-checkpoint.ts +7 -7
- package/examples/extensions/git-merge-and-resolve.ts +14 -14
- package/examples/extensions/github-issue-autocomplete.ts +6 -6
- package/examples/extensions/gondolin/index.ts +16 -16
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/handoff.ts +2 -2
- package/examples/extensions/hello.ts +2 -2
- package/examples/extensions/hidden-thinking-label.ts +4 -4
- package/examples/extensions/inline-bash.ts +5 -5
- package/examples/extensions/input-transform-streaming.ts +5 -5
- package/examples/extensions/input-transform.ts +5 -5
- package/examples/extensions/interactive-shell.ts +3 -3
- package/examples/extensions/mac-system-theme.ts +5 -5
- package/examples/extensions/message-renderer.ts +4 -4
- package/examples/extensions/minimal-mode.ts +9 -9
- package/examples/extensions/modal-editor.ts +3 -3
- package/examples/extensions/model-status.ts +3 -3
- package/examples/extensions/notify.ts +5 -5
- package/examples/extensions/overlay-qa-tests.ts +20 -20
- package/examples/extensions/overlay-test.ts +3 -3
- package/examples/extensions/permission-gate.ts +2 -2
- package/examples/extensions/pirate.ts +4 -4
- package/examples/extensions/plan-mode/index.ts +22 -22
- package/examples/extensions/preset.ts +30 -30
- package/examples/extensions/prompt-customizer.ts +3 -3
- package/examples/extensions/protected-paths.ts +2 -2
- package/examples/extensions/provider-payload.ts +5 -5
- package/examples/extensions/qna.ts +2 -2
- package/examples/extensions/question.ts +2 -2
- package/examples/extensions/questionnaire.ts +2 -2
- package/examples/extensions/rainbow-editor.ts +3 -3
- package/examples/extensions/reload-runtime.ts +4 -4
- package/examples/extensions/rpc-demo.ts +10 -10
- package/examples/extensions/sandbox/index.ts +17 -17
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/send-user-message.ts +13 -13
- package/examples/extensions/session-name.ts +4 -4
- package/examples/extensions/shutdown-command.ts +10 -10
- package/examples/extensions/snake.ts +3 -3
- package/examples/extensions/space-invaders.ts +3 -3
- package/examples/extensions/ssh.ts +12 -12
- package/examples/extensions/status-line.ts +4 -4
- package/examples/extensions/structured-output.ts +2 -2
- package/examples/extensions/subagent/README.md +13 -13
- package/examples/extensions/subagent/agents.ts +2 -2
- package/examples/extensions/subagent/index.ts +53 -21
- package/examples/extensions/summarize.ts +2 -2
- package/examples/extensions/system-prompt-header.ts +3 -3
- package/examples/extensions/tic-tac-toe.ts +15 -15
- package/examples/extensions/timed-confirm.ts +4 -4
- package/examples/extensions/titlebar-spinner.ts +9 -9
- package/examples/extensions/todo.ts +5 -5
- package/examples/extensions/tool-override.ts +5 -5
- package/examples/extensions/tools.ts +10 -10
- package/examples/extensions/trigger-compact.ts +3 -3
- package/examples/extensions/truncated-tool.ts +3 -3
- package/examples/extensions/widget-placement.ts +2 -2
- package/examples/extensions/with-deps/index.ts +2 -2
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/examples/extensions/working-indicator.ts +7 -7
- package/examples/extensions/working-message-test.ts +3 -3
- package/examples/sdk/01-minimal.ts +1 -1
- package/examples/sdk/03-custom-prompt.ts +1 -1
- package/examples/sdk/04-skills.ts +1 -1
- package/examples/sdk/05-tools.ts +1 -1
- package/examples/sdk/06-extensions.ts +11 -11
- package/examples/sdk/07-context-files.ts +2 -0
- package/examples/sdk/08-prompt-templates.ts +1 -1
- package/examples/sdk/09-api-keys-and-oauth.ts +2 -2
- package/examples/sdk/README.md +2 -2
- package/node_modules/@earendil-works/omk-agent-core/README.md +488 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/agent-loop.d.ts +24 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/agent-loop.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/agent-loop.js +553 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/agent-loop.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/agent.d.ts +118 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/agent.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/agent.js +402 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/agent.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/agent-harness.d.ts +95 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/agent-harness.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/agent-harness.js +996 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/agent-harness.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/branch-summarization.d.ts +53 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/branch-summarization.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/branch-summarization.js +175 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/branch-summarization.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/compaction.d.ts +117 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/compaction.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/compaction.js +568 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/compaction.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/utils.d.ts +25 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/utils.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/utils.js +131 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/utils.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/env/nodejs.d.ts +51 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/env/nodejs.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/env/nodejs.js +510 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/env/nodejs.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/messages.d.ts +51 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/messages.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/messages.js +102 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/messages.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/prompt-templates.d.ts +48 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/prompt-templates.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/prompt-templates.js +230 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/prompt-templates.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/jsonl-repo.d.ts +26 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/jsonl-repo.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/jsonl-repo.js +101 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/jsonl-repo.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/jsonl-storage.d.ts +36 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/jsonl-storage.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/jsonl-storage.js +273 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/jsonl-storage.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/memory-repo.d.ts +18 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/memory-repo.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/memory-repo.js +42 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/memory-repo.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/memory-storage.d.ts +25 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/memory-storage.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/memory-storage.js +114 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/memory-storage.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/repo-utils.d.ts +11 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/repo-utils.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/repo-utils.js +39 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/repo-utils.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/session.d.ts +33 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/session.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/session.js +210 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/session.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/uuid.d.ts +2 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/uuid.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/uuid.js +50 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/uuid.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/skills.d.ts +44 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/skills.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/skills.js +311 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/skills.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/system-prompt.d.ts +3 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/system-prompt.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/system-prompt.js +30 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/system-prompt.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/types.d.ts +616 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/types.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/types.js +94 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/types.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/utils/shell-output.d.ts +14 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/utils/shell-output.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/utils/shell-output.js +126 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/utils/shell-output.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/utils/truncate.d.ts +70 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/utils/truncate.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/utils/truncate.js +297 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/utils/truncate.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/index.d.ts +20 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/index.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/index.js +25 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/index.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/node.d.ts +3 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/node.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/node.js +3 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/node.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/proxy.d.ts +69 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/proxy.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/proxy.js +278 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/proxy.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/types.d.ts +393 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/types.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/types.js +2 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/types.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/package.json +60 -0
- package/node_modules/@earendil-works/omk-ai/README.md +1389 -0
- package/node_modules/@earendil-works/omk-ai/dist/api-registry.d.ts +20 -0
- package/node_modules/@earendil-works/omk-ai/dist/api-registry.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/api-registry.js +44 -0
- package/node_modules/@earendil-works/omk-ai/dist/api-registry.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/bedrock-provider.d.ts +5 -0
- package/node_modules/@earendil-works/omk-ai/dist/bedrock-provider.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/bedrock-provider.js +6 -0
- package/node_modules/@earendil-works/omk-ai/dist/bedrock-provider.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/cli.d.ts +3 -0
- package/node_modules/@earendil-works/omk-ai/dist/cli.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/cli.js +130 -0
- package/node_modules/@earendil-works/omk-ai/dist/cli.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/env-api-keys.d.ts +20 -0
- package/node_modules/@earendil-works/omk-ai/dist/env-api-keys.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/env-api-keys.js +199 -0
- package/node_modules/@earendil-works/omk-ai/dist/env-api-keys.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/image-models.d.ts +10 -0
- package/node_modules/@earendil-works/omk-ai/dist/image-models.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/image-models.generated.d.ts +515 -0
- package/node_modules/@earendil-works/omk-ai/dist/image-models.generated.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/image-models.generated.js +517 -0
- package/node_modules/@earendil-works/omk-ai/dist/image-models.generated.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/image-models.js +23 -0
- package/node_modules/@earendil-works/omk-ai/dist/image-models.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/images-api-registry.d.ts +14 -0
- package/node_modules/@earendil-works/omk-ai/dist/images-api-registry.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/images-api-registry.js +22 -0
- package/node_modules/@earendil-works/omk-ai/dist/images-api-registry.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/images.d.ts +4 -0
- package/node_modules/@earendil-works/omk-ai/dist/images.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/images.js +16 -0
- package/node_modules/@earendil-works/omk-ai/dist/images.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/index.d.ts +33 -0
- package/node_modules/@earendil-works/omk-ai/dist/index.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/index.js +21 -0
- package/node_modules/@earendil-works/omk-ai/dist/index.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/models.d.ts +18 -0
- package/node_modules/@earendil-works/omk-ai/dist/models.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/models.generated.d.ts +18762 -0
- package/node_modules/@earendil-works/omk-ai/dist/models.generated.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/models.generated.js +17197 -0
- package/node_modules/@earendil-works/omk-ai/dist/models.generated.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/models.js +78 -0
- package/node_modules/@earendil-works/omk-ai/dist/models.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/oauth.d.ts +2 -0
- package/node_modules/@earendil-works/omk-ai/dist/oauth.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/oauth.js +2 -0
- package/node_modules/@earendil-works/omk-ai/dist/oauth.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/provider-network.d.ts +39 -0
- package/node_modules/@earendil-works/omk-ai/dist/provider-network.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/provider-network.js +170 -0
- package/node_modules/@earendil-works/omk-ai/dist/provider-network.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/amazon-bedrock.d.ts +38 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/amazon-bedrock.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/amazon-bedrock.js +826 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/amazon-bedrock.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/anthropic.d.ts +77 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/anthropic.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/anthropic.js +1123 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/anthropic.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/azure-openai-responses.d.ts +15 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/azure-openai-responses.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/azure-openai-responses.js +221 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/azure-openai-responses.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/cloudflare.d.ts +13 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/cloudflare.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/cloudflare.js +26 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/cloudflare.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/faux.d.ts +56 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/faux.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/faux.js +368 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/faux.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/github-copilot-headers.d.ts +8 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/github-copilot-headers.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/github-copilot-headers.js +29 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/github-copilot-headers.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/google-shared.d.ts +70 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/google-shared.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/google-shared.js +331 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/google-shared.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/google-vertex.d.ts +15 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/google-vertex.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/google-vertex.js +442 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/google-vertex.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/google.d.ts +13 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/google.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/google.js +402 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/google.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/images/openrouter.d.ts +3 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/images/openrouter.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/images/openrouter.js +128 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/images/openrouter.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/images/register-builtins.d.ts +4 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/images/register-builtins.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/images/register-builtins.js +34 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/images/register-builtins.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/mistral.d.ts +25 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/mistral.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/mistral.js +534 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/mistral.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-codex-responses.d.ts +30 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-codex-responses.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-codex-responses.js +1171 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-codex-responses.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-completions.d.ts +19 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-completions.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-completions.js +977 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-completions.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-prompt-cache.d.ts +11 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-prompt-cache.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-prompt-cache.js +22 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-prompt-cache.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-responses-shared.d.ts +18 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-responses-shared.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-responses-shared.js +496 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-responses-shared.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-responses.d.ts +13 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-responses.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-responses.js +233 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-responses.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/register-builtins.d.ts +35 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/register-builtins.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/register-builtins.js +254 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/register-builtins.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/simple-options.d.ts +8 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/simple-options.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/simple-options.js +42 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/simple-options.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/tool-schema.d.ts +13 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/tool-schema.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/tool-schema.js +82 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/tool-schema.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/transform-messages.d.ts +8 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/transform-messages.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/transform-messages.js +184 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/transform-messages.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/session-resources.d.ts +4 -0
- package/node_modules/@earendil-works/omk-ai/dist/session-resources.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/session-resources.js +22 -0
- package/node_modules/@earendil-works/omk-ai/dist/session-resources.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/stream.d.ts +8 -0
- package/node_modules/@earendil-works/omk-ai/dist/stream.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/stream.js +77 -0
- package/node_modules/@earendil-works/omk-ai/dist/stream.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/types.d.ts +570 -0
- package/node_modules/@earendil-works/omk-ai/dist/types.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/types.js +2 -0
- package/node_modules/@earendil-works/omk-ai/dist/types.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/abort-signals.d.ts +6 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/abort-signals.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/abort-signals.js +34 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/abort-signals.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/diagnostics.d.ts +19 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/diagnostics.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/diagnostics.js +25 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/diagnostics.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/event-stream.d.ts +21 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/event-stream.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/event-stream.js +81 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/event-stream.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/hash.d.ts +3 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/hash.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/hash.js +14 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/hash.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/headers.d.ts +2 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/headers.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/headers.js +8 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/headers.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/json-parse.d.ts +16 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/json-parse.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/json-parse.js +113 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/json-parse.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/node-http-proxy.d.ts +10 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/node-http-proxy.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/node-http-proxy.js +97 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/node-http-proxy.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/anthropic.d.ts +25 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/anthropic.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/anthropic.js +335 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/anthropic.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/device-code.d.ts +21 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/device-code.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/device-code.js +56 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/device-code.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/github-copilot.d.ts +30 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/github-copilot.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/github-copilot.js +280 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/github-copilot.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/index.d.ts +58 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/index.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/index.js +122 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/index.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/oauth-page.d.ts +3 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/oauth-page.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/oauth-page.js +105 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/oauth-page.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/openai-codex.d.ts +43 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/openai-codex.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/openai-codex.js +487 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/openai-codex.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/pkce.d.ts +13 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/pkce.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/pkce.js +31 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/pkce.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/types.d.ts +64 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/types.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/types.js +2 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/types.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/overflow.d.ts +57 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/overflow.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/overflow.js +154 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/overflow.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/sanitize-unicode.d.ts +22 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/sanitize-unicode.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/sanitize-unicode.js +26 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/sanitize-unicode.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/typebox-helpers.d.ts +17 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/typebox-helpers.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/typebox-helpers.js +21 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/typebox-helpers.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/validation.d.ts +18 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/validation.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/validation.js +281 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/validation.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/package.json +106 -0
- package/node_modules/@earendil-works/omk-tui/README.md +791 -0
- package/node_modules/@earendil-works/omk-tui/dist/autocomplete.d.ts +54 -0
- package/node_modules/@earendil-works/omk-tui/dist/autocomplete.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/autocomplete.js +632 -0
- package/node_modules/@earendil-works/omk-tui/dist/autocomplete.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/box.d.ts +22 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/box.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/box.js +104 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/box.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/cancellable-loader.d.ts +22 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/cancellable-loader.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/cancellable-loader.js +35 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/cancellable-loader.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/editor.d.ts +249 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/editor.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/editor.js +1857 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/editor.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/image.d.ts +28 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/image.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/image.js +89 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/image.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/input.d.ts +37 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/input.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/input.js +378 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/input.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/loader.d.ts +31 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/loader.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/loader.js +69 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/loader.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/markdown.d.ts +96 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/markdown.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/markdown.js +644 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/markdown.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/select-list.d.ts +50 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/select-list.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/select-list.js +159 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/select-list.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/settings-list.d.ts +50 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/settings-list.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/settings-list.js +185 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/settings-list.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/spacer.d.ts +12 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/spacer.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/spacer.js +23 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/spacer.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/text.d.ts +19 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/text.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/text.js +89 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/text.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/truncated-text.d.ts +13 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/truncated-text.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/truncated-text.js +51 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/truncated-text.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/editor-component.d.ts +39 -0
- package/node_modules/@earendil-works/omk-tui/dist/editor-component.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/editor-component.js +2 -0
- package/node_modules/@earendil-works/omk-tui/dist/editor-component.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/fuzzy.d.ts +16 -0
- package/node_modules/@earendil-works/omk-tui/dist/fuzzy.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/fuzzy.js +110 -0
- package/node_modules/@earendil-works/omk-tui/dist/fuzzy.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/index.d.ts +23 -0
- package/node_modules/@earendil-works/omk-tui/dist/index.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/index.js +32 -0
- package/node_modules/@earendil-works/omk-tui/dist/index.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/keybindings.d.ts +212 -0
- package/node_modules/@earendil-works/omk-tui/dist/keybindings.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/keybindings.js +252 -0
- package/node_modules/@earendil-works/omk-tui/dist/keybindings.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/keys.d.ts +184 -0
- package/node_modules/@earendil-works/omk-tui/dist/keys.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/keys.js +1173 -0
- package/node_modules/@earendil-works/omk-tui/dist/keys.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/kill-ring.d.ts +28 -0
- package/node_modules/@earendil-works/omk-tui/dist/kill-ring.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/kill-ring.js +44 -0
- package/node_modules/@earendil-works/omk-tui/dist/kill-ring.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/native-modifiers.d.ts +3 -0
- package/node_modules/@earendil-works/omk-tui/dist/native-modifiers.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/native-modifiers.js +53 -0
- package/node_modules/@earendil-works/omk-tui/dist/native-modifiers.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/stdin-buffer.d.ts +50 -0
- package/node_modules/@earendil-works/omk-tui/dist/stdin-buffer.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/stdin-buffer.js +361 -0
- package/node_modules/@earendil-works/omk-tui/dist/stdin-buffer.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/terminal-image.d.ts +90 -0
- package/node_modules/@earendil-works/omk-tui/dist/terminal-image.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/terminal-image.js +366 -0
- package/node_modules/@earendil-works/omk-tui/dist/terminal-image.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/terminal.d.ts +113 -0
- package/node_modules/@earendil-works/omk-tui/dist/terminal.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/terminal.js +472 -0
- package/node_modules/@earendil-works/omk-tui/dist/terminal.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/tui.d.ts +242 -0
- package/node_modules/@earendil-works/omk-tui/dist/tui.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/tui.js +1221 -0
- package/node_modules/@earendil-works/omk-tui/dist/tui.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/undo-stack.d.ts +17 -0
- package/node_modules/@earendil-works/omk-tui/dist/undo-stack.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/undo-stack.js +25 -0
- package/node_modules/@earendil-works/omk-tui/dist/undo-stack.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/utils.d.ts +84 -0
- package/node_modules/@earendil-works/omk-tui/dist/utils.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/utils.js +1032 -0
- package/node_modules/@earendil-works/omk-tui/dist/utils.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/word-navigation.d.ts +25 -0
- package/node_modules/@earendil-works/omk-tui/dist/word-navigation.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/word-navigation.js +96 -0
- package/node_modules/@earendil-works/omk-tui/dist/word-navigation.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/native/darwin/prebuilds/darwin-arm64/darwin-modifiers.node +0 -0
- package/node_modules/@earendil-works/omk-tui/native/darwin/prebuilds/darwin-x64/darwin-modifiers.node +0 -0
- package/node_modules/@earendil-works/omk-tui/native/win32/prebuilds/win32-arm64/win32-console-mode.node +0 -0
- package/node_modules/@earendil-works/omk-tui/native/win32/prebuilds/win32-x64/win32-console-mode.node +0 -0
- package/node_modules/@earendil-works/omk-tui/package.json +47 -0
- package/package.json +22 -6
- package/dist/utils/pi-user-agent.d.ts +0 -2
- package/dist/utils/pi-user-agent.d.ts.map +0 -1
- package/dist/utils/pi-user-agent.js.map +0 -1
|
@@ -5,7 +5,10 @@
|
|
|
5
5
|
* and after compaction the session is reloaded.
|
|
6
6
|
*/
|
|
7
7
|
import { completeSimple } from "@earendil-works/omk-ai";
|
|
8
|
+
import { recordHarnessControlEvent } from "../harness-control-events.js";
|
|
8
9
|
import { convertToLlm, createBranchSummaryMessage, createCompactionSummaryMessage, createCustomMessage, } from "../messages.js";
|
|
10
|
+
import { sanitizeMemoryPayload } from "../policy-overlays-runtime.js";
|
|
11
|
+
import { boundConversationTextForSummary } from "../session-digest.js";
|
|
9
12
|
import { buildSessionContext } from "../session-manager.js";
|
|
10
13
|
import { computeFileLists, createFileOps, extractFileOpsFromMessage, formatFileOperations, SUMMARIZATION_SYSTEM_PROMPT, serializeConversation, } from "./utils.js";
|
|
11
14
|
/**
|
|
@@ -13,7 +16,7 @@ import { computeFileLists, createFileOps, extractFileOpsFromMessage, formatFileO
|
|
|
13
16
|
*/
|
|
14
17
|
function extractFileOperations(messages, entries, prevCompactionIndex) {
|
|
15
18
|
const fileOps = createFileOps();
|
|
16
|
-
// Collect from previous compaction's details (if
|
|
19
|
+
// Collect from previous compaction's details (if omk-generated)
|
|
17
20
|
if (prevCompactionIndex >= 0) {
|
|
18
21
|
const prevCompaction = entries[prevCompactionIndex];
|
|
19
22
|
if (!prevCompaction.fromHook && prevCompaction.details) {
|
|
@@ -64,11 +67,14 @@ function getMessageFromEntryForCompaction(entry) {
|
|
|
64
67
|
return getMessageFromEntry(entry);
|
|
65
68
|
}
|
|
66
69
|
export const DEFAULT_COMPACTION_MAX_USAGE_RATIO = 0.9;
|
|
70
|
+
export const DEFAULT_COMPACTION_SUMMARY_INPUT_TOKENS = 80000;
|
|
71
|
+
export const DEFAULT_COMPACTION_RAW_INPUT_CHAR_CEILING = 1_200_000;
|
|
67
72
|
export const DEFAULT_COMPACTION_SETTINGS = {
|
|
68
73
|
enabled: true,
|
|
69
74
|
reserveTokens: 16384,
|
|
70
75
|
keepRecentTokens: 20000,
|
|
71
76
|
maxUsageRatio: DEFAULT_COMPACTION_MAX_USAGE_RATIO,
|
|
77
|
+
summaryInputTokens: DEFAULT_COMPACTION_SUMMARY_INPUT_TOKENS,
|
|
72
78
|
};
|
|
73
79
|
// ============================================================================
|
|
74
80
|
// Token calculation
|
|
@@ -374,6 +380,422 @@ export function findCutPoint(entries, startIndex, endIndex, keepRecentTokens) {
|
|
|
374
380
|
};
|
|
375
381
|
}
|
|
376
382
|
// ============================================================================
|
|
383
|
+
// Summarization Input Packing
|
|
384
|
+
// ============================================================================
|
|
385
|
+
const CHARS_PER_TOKEN_ESTIMATE = 4;
|
|
386
|
+
const SUMMARY_INPUT_PROMPT_OVERHEAD_TOKENS = 2048;
|
|
387
|
+
const SUMMARY_INPUT_TOKENIZER_SAFETY_MARGIN = 512;
|
|
388
|
+
const MIN_SUMMARY_INPUT_TOKENS = 512;
|
|
389
|
+
function estimateTextTokens(text) {
|
|
390
|
+
return Math.ceil(text.length / CHARS_PER_TOKEN_ESTIMATE);
|
|
391
|
+
}
|
|
392
|
+
function isFinitePositiveInteger(value) {
|
|
393
|
+
return value !== undefined && Number.isFinite(value) && value > 0;
|
|
394
|
+
}
|
|
395
|
+
export function resolveSummaryInputTokenBudgetV3(model, maxOutputTokens, options) {
|
|
396
|
+
const configuredSummaryInputTokens = typeof options === "number" ? options : options?.configuredSummaryInputTokens;
|
|
397
|
+
if (configuredSummaryInputTokens !== undefined && configuredSummaryInputTokens <= 0) {
|
|
398
|
+
return { emergency: false, fixedPromptTokens: 0 };
|
|
399
|
+
}
|
|
400
|
+
const configuredBudget = configuredSummaryInputTokens ?? DEFAULT_COMPACTION_SUMMARY_INPUT_TOKENS;
|
|
401
|
+
if (!isFinitePositiveInteger(configuredBudget)) {
|
|
402
|
+
return { emergency: false, fixedPromptTokens: 0 };
|
|
403
|
+
}
|
|
404
|
+
const contextWindow = model.contextWindow > 0 ? Math.floor(model.contextWindow) : Number.POSITIVE_INFINITY;
|
|
405
|
+
if (!Number.isFinite(contextWindow)) {
|
|
406
|
+
return { budgetTokens: Math.floor(configuredBudget), emergency: false, fixedPromptTokens: 0 };
|
|
407
|
+
}
|
|
408
|
+
const fixedPromptTokens = typeof options === "object"
|
|
409
|
+
? estimateTextTokens([
|
|
410
|
+
options.systemPrompt,
|
|
411
|
+
options.basePrompt,
|
|
412
|
+
options.customInstructions,
|
|
413
|
+
options.previousSummary,
|
|
414
|
+
options.wrapperText,
|
|
415
|
+
]
|
|
416
|
+
.filter((value) => typeof value === "string" && value.length > 0)
|
|
417
|
+
.join("\n"))
|
|
418
|
+
: SUMMARY_INPUT_PROMPT_OVERHEAD_TOKENS;
|
|
419
|
+
const safetyMarginTokens = typeof options === "object" ? (options.safetyMarginTokens ?? SUMMARY_INPUT_TOKENIZER_SAFETY_MARGIN) : 0;
|
|
420
|
+
const availableInputTokens = contextWindow - Math.max(0, Math.floor(maxOutputTokens)) - fixedPromptTokens - safetyMarginTokens;
|
|
421
|
+
if (availableInputTokens < MIN_SUMMARY_INPUT_TOKENS) {
|
|
422
|
+
return {
|
|
423
|
+
emergency: true,
|
|
424
|
+
reason: "fixed prompt overhead exceeds viable summarization input budget",
|
|
425
|
+
fixedPromptTokens,
|
|
426
|
+
availableInputTokens,
|
|
427
|
+
};
|
|
428
|
+
}
|
|
429
|
+
return {
|
|
430
|
+
budgetTokens: Math.max(MIN_SUMMARY_INPUT_TOKENS, Math.min(Math.floor(configuredBudget), availableInputTokens)),
|
|
431
|
+
emergency: false,
|
|
432
|
+
fixedPromptTokens,
|
|
433
|
+
availableInputTokens,
|
|
434
|
+
};
|
|
435
|
+
}
|
|
436
|
+
export function resolveSummaryInputTokenBudget(model, maxOutputTokens, options) {
|
|
437
|
+
return resolveSummaryInputTokenBudgetV3(model, maxOutputTokens, options).budgetTokens;
|
|
438
|
+
}
|
|
439
|
+
function scoreSummaryLine(line) {
|
|
440
|
+
const trimmed = line.trim();
|
|
441
|
+
if (trimmed.length === 0)
|
|
442
|
+
return 0;
|
|
443
|
+
let score = 0;
|
|
444
|
+
if (/\b(?:[\w.-]+\/)+[\w.-]+\.(?:ts|tsx|js|jsx|json|md|css|scss|py|rs|go|java|kt|swift|sh|yml|yaml|toml)\b/.test(trimmed)) {
|
|
445
|
+
score += 6;
|
|
446
|
+
}
|
|
447
|
+
if (/\b(?:error|failed|failure|exception|warning|blocked|regression|timeout|overflow|abort)\b/i.test(trimmed) ||
|
|
448
|
+
/(?:오류|실패|경고|차단|회귀|시간 초과|타임아웃)/.test(trimmed)) {
|
|
449
|
+
score += 5;
|
|
450
|
+
}
|
|
451
|
+
if (/\b(?:npm|node|pnpm|yarn|bun|git|gh|tsgo|vitest|biome|pytest|cargo|go test)\b/.test(trimmed)) {
|
|
452
|
+
score += 4;
|
|
453
|
+
}
|
|
454
|
+
if (/^(?:#{1,6}\s|[-*]\s|\d+\.\s|\[[ xX]\]|```)/.test(trimmed)) {
|
|
455
|
+
score += 3;
|
|
456
|
+
}
|
|
457
|
+
if (/\b(?:goal|constraint|decision|next step|todo|changed|created|modified|verified|passed|failed)\b/i.test(trimmed) ||
|
|
458
|
+
/(?:목표|제약|결정|다음 단계|검증|통과|수정|생성|변경|증거)/.test(trimmed)) {
|
|
459
|
+
score += 3;
|
|
460
|
+
}
|
|
461
|
+
if (trimmed.length <= 220) {
|
|
462
|
+
score += 1;
|
|
463
|
+
}
|
|
464
|
+
else if (trimmed.length > 1000) {
|
|
465
|
+
score -= 3;
|
|
466
|
+
}
|
|
467
|
+
return score;
|
|
468
|
+
}
|
|
469
|
+
function selectHighSignalLines(text, budgetChars) {
|
|
470
|
+
if (budgetChars <= 0)
|
|
471
|
+
return "";
|
|
472
|
+
const scoredLines = text
|
|
473
|
+
.split("\n")
|
|
474
|
+
.map((line, index) => ({ index, line, score: scoreSummaryLine(line) }))
|
|
475
|
+
.filter((item) => item.score > 0)
|
|
476
|
+
.sort((a, b) => b.score - a.score || a.index - b.index);
|
|
477
|
+
const selected = [];
|
|
478
|
+
let usedChars = 0;
|
|
479
|
+
for (const item of scoredLines) {
|
|
480
|
+
const lineChars = item.line.length + 1;
|
|
481
|
+
if (usedChars + lineChars > budgetChars)
|
|
482
|
+
continue;
|
|
483
|
+
selected.push({ index: item.index, line: item.line });
|
|
484
|
+
usedChars += lineChars;
|
|
485
|
+
}
|
|
486
|
+
if (selected.length === 0) {
|
|
487
|
+
return text.slice(0, budgetChars);
|
|
488
|
+
}
|
|
489
|
+
return selected
|
|
490
|
+
.sort((a, b) => a.index - b.index)
|
|
491
|
+
.map((item) => item.line)
|
|
492
|
+
.join("\n");
|
|
493
|
+
}
|
|
494
|
+
function scoreSummaryUnit(unit) {
|
|
495
|
+
const lineScores = unit.split("\n").map(scoreSummaryLine);
|
|
496
|
+
const maxLineScore = Math.max(0, ...lineScores);
|
|
497
|
+
const aggregateScore = lineScores.reduce((sum, score) => sum + Math.max(0, score), 0);
|
|
498
|
+
let score = maxLineScore * 2 + Math.min(aggregateScore, 12);
|
|
499
|
+
if (/^```/m.test(unit))
|
|
500
|
+
score += 3;
|
|
501
|
+
if (/^#{1,6}\s/m.test(unit))
|
|
502
|
+
score += 2;
|
|
503
|
+
if (unit.length > 2400)
|
|
504
|
+
score -= 4;
|
|
505
|
+
return score;
|
|
506
|
+
}
|
|
507
|
+
function extractSummaryUnitSignals(text) {
|
|
508
|
+
const signals = new Set();
|
|
509
|
+
for (const match of text.matchAll(/\b(?:[\w.-]+\/)+[\w.-]+\.(?:ts|tsx|js|jsx|json|md|css|scss|py|rs|go|java|kt|swift|sh|yml|yaml|toml)\b/g)) {
|
|
510
|
+
signals.add(`path:${match[0]}`);
|
|
511
|
+
}
|
|
512
|
+
for (const match of text.matchAll(/\b(?:npm|node|pnpm|yarn|bun|git|gh|tsgo|vitest|biome|pytest|cargo|go test)\b[^\n]*/g)) {
|
|
513
|
+
signals.add(`cmd:${match[0].trim().slice(0, 160)}`);
|
|
514
|
+
}
|
|
515
|
+
for (const match of text.matchAll(/\b(?:HCP-\d+|R\d+)\b/g)) {
|
|
516
|
+
signals.add(`id:${match[0]}`);
|
|
517
|
+
}
|
|
518
|
+
for (const match of text.matchAll(/\.omk\/[\w./-]+/g)) {
|
|
519
|
+
signals.add(`evidence:${match[0]}`);
|
|
520
|
+
}
|
|
521
|
+
return [...signals];
|
|
522
|
+
}
|
|
523
|
+
function updateHeadingStack(headingStack, headingLine) {
|
|
524
|
+
const match = headingLine.match(/^(#{1,6})\s+(.+)$/);
|
|
525
|
+
if (!match)
|
|
526
|
+
return headingStack;
|
|
527
|
+
const level = match[1].length;
|
|
528
|
+
const title = match[2].replace(/\s+#+\s*$/, "").trim();
|
|
529
|
+
const nextStack = [...headingStack];
|
|
530
|
+
while (nextStack.length > 0 && nextStack.at(-1).level >= level) {
|
|
531
|
+
nextStack.pop();
|
|
532
|
+
}
|
|
533
|
+
nextStack.push({ level, title });
|
|
534
|
+
return nextStack;
|
|
535
|
+
}
|
|
536
|
+
function inferSummaryUnitStatus(text) {
|
|
537
|
+
if (/^- \[[xX]]/m.test(text) || /\b(?:completed|done|fixed)\b/i.test(text) || /(?:완료|수정됨)/.test(text)) {
|
|
538
|
+
return "done";
|
|
539
|
+
}
|
|
540
|
+
if (/^- \[ ]/m.test(text) || /\b(?:in progress|todo|next)\b/i.test(text) || /(?:진행|다음)/.test(text)) {
|
|
541
|
+
return "in_progress";
|
|
542
|
+
}
|
|
543
|
+
if (/\b(?:blocked|blocker)\b/i.test(text) || /(?:차단|블로커)/.test(text))
|
|
544
|
+
return "blocked";
|
|
545
|
+
if (/\b(?:failed|failure|error|exception|regression)\b/i.test(text) || /(?:실패|오류|회귀)/.test(text)) {
|
|
546
|
+
return "failed";
|
|
547
|
+
}
|
|
548
|
+
if (/\b(?:passed|success|ok)\b/i.test(text) || /(?:통과|성공)/.test(text))
|
|
549
|
+
return "passed";
|
|
550
|
+
return undefined;
|
|
551
|
+
}
|
|
552
|
+
function inferSummaryUnitKind(text, status) {
|
|
553
|
+
const trimmed = text.trim();
|
|
554
|
+
if (status === "blocked")
|
|
555
|
+
return "blocker";
|
|
556
|
+
if (trimmed.startsWith("```"))
|
|
557
|
+
return "code";
|
|
558
|
+
if (/\.omk\/[\w./-]+|\bevidence\b/i.test(text))
|
|
559
|
+
return "evidence";
|
|
560
|
+
if (/\b(?:npm|node|pnpm|yarn|bun|git|gh|tsgo|vitest|biome|pytest|cargo|go test)\b/.test(text))
|
|
561
|
+
return "command";
|
|
562
|
+
if (/^(?:[-*]\s+\[[ xX]])/m.test(text))
|
|
563
|
+
return "checklist";
|
|
564
|
+
if (/^#{1,6}\s/m.test(text))
|
|
565
|
+
return "heading";
|
|
566
|
+
return "text";
|
|
567
|
+
}
|
|
568
|
+
function createSummaryInputSemanticUnit(index, text, sectionPath) {
|
|
569
|
+
const status = inferSummaryUnitStatus(text);
|
|
570
|
+
return {
|
|
571
|
+
index,
|
|
572
|
+
text,
|
|
573
|
+
score: scoreSummaryUnit(text),
|
|
574
|
+
sectionPath,
|
|
575
|
+
kind: inferSummaryUnitKind(text, status),
|
|
576
|
+
refs: extractSummaryUnitSignals(text),
|
|
577
|
+
status,
|
|
578
|
+
};
|
|
579
|
+
}
|
|
580
|
+
export function splitSummaryInputSemanticUnits(text) {
|
|
581
|
+
const lines = text.split("\n");
|
|
582
|
+
const units = [];
|
|
583
|
+
let start = 0;
|
|
584
|
+
let current = [];
|
|
585
|
+
let inFence = false;
|
|
586
|
+
let activeHeadingStack = [];
|
|
587
|
+
let currentSectionPath = [];
|
|
588
|
+
function flush(nextIndex) {
|
|
589
|
+
while (current.length > 0 && current[0]?.trim() === "") {
|
|
590
|
+
current.shift();
|
|
591
|
+
start++;
|
|
592
|
+
}
|
|
593
|
+
while (current.length > 0 && current.at(-1)?.trim() === "") {
|
|
594
|
+
current.pop();
|
|
595
|
+
}
|
|
596
|
+
if (current.length === 0) {
|
|
597
|
+
start = nextIndex;
|
|
598
|
+
currentSectionPath = activeHeadingStack.map((heading) => heading.title);
|
|
599
|
+
return;
|
|
600
|
+
}
|
|
601
|
+
const unitText = current.join("\n");
|
|
602
|
+
units.push(createSummaryInputSemanticUnit(start, unitText, [...currentSectionPath]));
|
|
603
|
+
current = [];
|
|
604
|
+
start = nextIndex;
|
|
605
|
+
currentSectionPath = activeHeadingStack.map((heading) => heading.title);
|
|
606
|
+
}
|
|
607
|
+
for (let index = 0; index < lines.length; index++) {
|
|
608
|
+
const line = lines[index];
|
|
609
|
+
const trimmed = line.trim();
|
|
610
|
+
const startsFence = trimmed.startsWith("```");
|
|
611
|
+
const startsHeading = /^#{1,6}\s/.test(trimmed);
|
|
612
|
+
if (!inFence && startsHeading && current.some((entry) => entry.trim().length > 0)) {
|
|
613
|
+
flush(index);
|
|
614
|
+
}
|
|
615
|
+
if (!inFence && startsHeading) {
|
|
616
|
+
activeHeadingStack = updateHeadingStack(activeHeadingStack, trimmed);
|
|
617
|
+
}
|
|
618
|
+
if (current.length === 0) {
|
|
619
|
+
start = index;
|
|
620
|
+
currentSectionPath = activeHeadingStack.map((heading) => heading.title);
|
|
621
|
+
}
|
|
622
|
+
current.push(line);
|
|
623
|
+
if (startsFence) {
|
|
624
|
+
inFence = !inFence;
|
|
625
|
+
if (!inFence)
|
|
626
|
+
flush(index + 1);
|
|
627
|
+
continue;
|
|
628
|
+
}
|
|
629
|
+
if (!inFence && trimmed.length === 0) {
|
|
630
|
+
flush(index + 1);
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
flush(lines.length);
|
|
634
|
+
return units;
|
|
635
|
+
}
|
|
636
|
+
export function buildSummaryDependencyGraph(units) {
|
|
637
|
+
const edges = [];
|
|
638
|
+
const signalsByIndex = new Map();
|
|
639
|
+
for (const unit of units) {
|
|
640
|
+
signalsByIndex.set(unit.index, new Set(unit.refs));
|
|
641
|
+
}
|
|
642
|
+
for (let i = 0; i < units.length; i++) {
|
|
643
|
+
for (let j = i + 1; j < units.length; j++) {
|
|
644
|
+
const leftUnit = units[i];
|
|
645
|
+
const rightUnit = units[j];
|
|
646
|
+
const left = signalsByIndex.get(leftUnit.index) ?? new Set();
|
|
647
|
+
const right = signalsByIndex.get(rightUnit.index) ?? new Set();
|
|
648
|
+
const shared = [...left].find((signal) => right.has(signal));
|
|
649
|
+
const sameSection = leftUnit.sectionPath.length > 0 && leftUnit.sectionPath.join("/") === rightUnit.sectionPath.join("/");
|
|
650
|
+
if (shared || sameSection) {
|
|
651
|
+
const reason = shared ?? `section:${leftUnit.sectionPath.join("/")}`;
|
|
652
|
+
edges.push({ from: leftUnit.index, to: rightUnit.index, reason });
|
|
653
|
+
edges.push({ from: rightUnit.index, to: leftUnit.index, reason });
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
return { nodes: units, edges };
|
|
658
|
+
}
|
|
659
|
+
export function selectSummaryDependencyClosure(graph, seedIndexes, maxAdditionalNodes = 8) {
|
|
660
|
+
const selected = new Set(seedIndexes);
|
|
661
|
+
const queue = [...seedIndexes];
|
|
662
|
+
while (queue.length > 0 && selected.size < seedIndexes.length + maxAdditionalNodes) {
|
|
663
|
+
const index = queue.shift();
|
|
664
|
+
const neighbors = graph.edges
|
|
665
|
+
.filter((edge) => edge.from === index)
|
|
666
|
+
.map((edge) => edge.to)
|
|
667
|
+
.filter((neighbor) => !selected.has(neighbor));
|
|
668
|
+
for (const neighbor of neighbors) {
|
|
669
|
+
selected.add(neighbor);
|
|
670
|
+
queue.push(neighbor);
|
|
671
|
+
if (selected.size >= seedIndexes.length + maxAdditionalNodes)
|
|
672
|
+
break;
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
return selected;
|
|
676
|
+
}
|
|
677
|
+
function normalizeSummaryNovelty(text) {
|
|
678
|
+
return text
|
|
679
|
+
.toLowerCase()
|
|
680
|
+
.replace(/\b\d+\b/g, "#")
|
|
681
|
+
.replace(/\s+/g, " ")
|
|
682
|
+
.trim();
|
|
683
|
+
}
|
|
684
|
+
export function deduplicateSummaryFactsByNovelty(units) {
|
|
685
|
+
const seen = new Set();
|
|
686
|
+
const result = [];
|
|
687
|
+
for (const unit of units) {
|
|
688
|
+
const sectionKey = unit.sectionPath.join("/");
|
|
689
|
+
const key = [sectionKey, unit.kind, unit.status ?? "", normalizeSummaryNovelty(unit.text)].join("|");
|
|
690
|
+
if (seen.has(key))
|
|
691
|
+
continue;
|
|
692
|
+
seen.add(key);
|
|
693
|
+
result.push(unit);
|
|
694
|
+
}
|
|
695
|
+
return result;
|
|
696
|
+
}
|
|
697
|
+
function selectHighSignalSemanticUnits(text, budgetChars) {
|
|
698
|
+
if (budgetChars <= 0)
|
|
699
|
+
return "";
|
|
700
|
+
const candidateUnits = deduplicateSummaryFactsByNovelty(splitSummaryInputSemanticUnits(text).filter((unit) => unit.score > 0));
|
|
701
|
+
const graph = buildSummaryDependencyGraph(candidateUnits);
|
|
702
|
+
const rankedUnits = [...candidateUnits].sort((a, b) => b.score - a.score || a.index - b.index);
|
|
703
|
+
const seedIndexes = rankedUnits.slice(0, Math.min(12, rankedUnits.length)).map((unit) => unit.index);
|
|
704
|
+
const closureIndexes = selectSummaryDependencyClosure(graph, seedIndexes);
|
|
705
|
+
const units = rankedUnits
|
|
706
|
+
.filter((unit) => closureIndexes.has(unit.index))
|
|
707
|
+
.sort((a, b) => b.score - a.score || a.index - b.index);
|
|
708
|
+
const selected = [];
|
|
709
|
+
let usedChars = 0;
|
|
710
|
+
for (const unit of units) {
|
|
711
|
+
const unitChars = unit.text.length + 2;
|
|
712
|
+
if (unitChars > budgetChars) {
|
|
713
|
+
const excerpt = selectHighSignalLines(unit.text, Math.max(0, budgetChars - usedChars));
|
|
714
|
+
if (excerpt.length > 0) {
|
|
715
|
+
selected.push({ ...unit, text: excerpt });
|
|
716
|
+
usedChars += excerpt.length + 2;
|
|
717
|
+
}
|
|
718
|
+
continue;
|
|
719
|
+
}
|
|
720
|
+
if (usedChars + unitChars > budgetChars)
|
|
721
|
+
continue;
|
|
722
|
+
selected.push(unit);
|
|
723
|
+
usedChars += unitChars;
|
|
724
|
+
}
|
|
725
|
+
if (selected.length === 0) {
|
|
726
|
+
return text.slice(0, budgetChars);
|
|
727
|
+
}
|
|
728
|
+
return selected
|
|
729
|
+
.sort((a, b) => a.index - b.index)
|
|
730
|
+
.map((unit) => unit.text)
|
|
731
|
+
.join("\n\n");
|
|
732
|
+
}
|
|
733
|
+
export const COMPACTION_SANITIZER_MAX_CHARS = 10_000_000;
|
|
734
|
+
export function sanitizeSerializedConversation(text) {
|
|
735
|
+
const sanitized = sanitizeMemoryPayload(text, {
|
|
736
|
+
source: "compaction-summary",
|
|
737
|
+
contentTier: "summary",
|
|
738
|
+
maxChars: COMPACTION_SANITIZER_MAX_CHARS,
|
|
739
|
+
external: false,
|
|
740
|
+
});
|
|
741
|
+
return {
|
|
742
|
+
text: typeof sanitized.payload === "string" ? sanitized.payload : "",
|
|
743
|
+
findings: sanitized.findings,
|
|
744
|
+
};
|
|
745
|
+
}
|
|
746
|
+
function sanitizeCompactionRuntimeText(text) {
|
|
747
|
+
if (text === undefined)
|
|
748
|
+
return undefined;
|
|
749
|
+
return sanitizeSerializedConversation(text).text;
|
|
750
|
+
}
|
|
751
|
+
function sanitizeCompactionRuntimeList(values) {
|
|
752
|
+
const sanitized = values
|
|
753
|
+
.map((value) => sanitizeSerializedConversation(value).text.trim())
|
|
754
|
+
.filter((value) => value.length > 0);
|
|
755
|
+
return [...new Set(sanitized)].sort();
|
|
756
|
+
}
|
|
757
|
+
/**
|
|
758
|
+
* Pack serialized conversation text under a token budget using a deterministic
|
|
759
|
+
* extractive strategy: preserve the opening, recent tail, and high-signal
|
|
760
|
+
* middle lines such as paths, commands, errors, and decisions.
|
|
761
|
+
*/
|
|
762
|
+
export function packSummaryInputForTokenBudget(text, maxInputTokens, maxRawChars = DEFAULT_COMPACTION_RAW_INPUT_CHAR_CEILING) {
|
|
763
|
+
const sanitizedText = sanitizeSerializedConversation(text).text;
|
|
764
|
+
const originalTokens = estimateTextTokens(sanitizedText);
|
|
765
|
+
const boundedText = boundConversationTextForSummary(sanitizedText, maxRawChars);
|
|
766
|
+
const boundedTokens = estimateTextTokens(boundedText);
|
|
767
|
+
const rawWasCompressed = boundedText.length < text.length;
|
|
768
|
+
if (!isFinitePositiveInteger(maxInputTokens) || boundedTokens <= maxInputTokens) {
|
|
769
|
+
return {
|
|
770
|
+
text: boundedText,
|
|
771
|
+
originalTokens,
|
|
772
|
+
packedTokens: boundedTokens,
|
|
773
|
+
omittedTokens: Math.max(0, originalTokens - boundedTokens),
|
|
774
|
+
wasCompressed: rawWasCompressed,
|
|
775
|
+
};
|
|
776
|
+
}
|
|
777
|
+
const targetChars = Math.max(MIN_SUMMARY_INPUT_TOKENS * CHARS_PER_TOKEN_ESTIMATE, Math.floor(maxInputTokens) * 4);
|
|
778
|
+
const marker = `<omk-summary-input-compressed originalTokens="${originalTokens}" targetTokens="${Math.floor(maxInputTokens)}">\nOlder serialized history was packed before summarization. Opening context, high-signal semantic units, and the recent tail were retained; low-signal repeated text was omitted.\n</omk-summary-input-compressed>`;
|
|
779
|
+
const contentBudgetChars = Math.max(512, targetChars - marker.length - 64);
|
|
780
|
+
const headBudgetChars = Math.floor(contentBudgetChars * 0.18);
|
|
781
|
+
const tailBudgetChars = Math.floor(contentBudgetChars * 0.52);
|
|
782
|
+
const middleBudgetChars = Math.max(0, contentBudgetChars - headBudgetChars - tailBudgetChars);
|
|
783
|
+
const headEnd = Math.min(headBudgetChars, boundedText.length);
|
|
784
|
+
const tailStart = Math.max(headEnd, boundedText.length - tailBudgetChars);
|
|
785
|
+
const head = boundedText.slice(0, headEnd);
|
|
786
|
+
const tail = boundedText.slice(tailStart);
|
|
787
|
+
const middle = selectHighSignalSemanticUnits(boundedText.slice(headEnd, tailStart), middleBudgetChars);
|
|
788
|
+
const packedText = [head.trimEnd(), marker, middle.trim(), tail.trimStart()].filter(Boolean).join("\n\n");
|
|
789
|
+
const packedTokens = estimateTextTokens(packedText);
|
|
790
|
+
return {
|
|
791
|
+
text: packedText,
|
|
792
|
+
originalTokens,
|
|
793
|
+
packedTokens,
|
|
794
|
+
omittedTokens: Math.max(0, originalTokens - packedTokens),
|
|
795
|
+
wasCompressed: true,
|
|
796
|
+
};
|
|
797
|
+
}
|
|
798
|
+
// ============================================================================
|
|
377
799
|
// Summarization
|
|
378
800
|
// ============================================================================
|
|
379
801
|
const SUMMARIZATION_PROMPT = `The messages above are a conversation to summarize. Create a structured context checkpoint summary that another LLM will use to continue the work.
|
|
@@ -407,7 +829,12 @@ Use this EXACT format:
|
|
|
407
829
|
- [Any data, examples, or references needed to continue]
|
|
408
830
|
- [Or "(none)" if not applicable]
|
|
409
831
|
|
|
410
|
-
|
|
832
|
+
## Resume Handoff
|
|
833
|
+
- **First action**: [Single concrete next action after compaction]
|
|
834
|
+
- **Re-check before editing**: [Workspace state, files, or commands to verify first; use "(none)" if not needed]
|
|
835
|
+
- **Evidence status**: [Checks/tests already run and results, or "(not run)"]
|
|
836
|
+
|
|
837
|
+
Keep each section concise. Preserve exact file paths, function names, command results, and error messages.`;
|
|
411
838
|
const UPDATE_SUMMARIZATION_PROMPT = `The messages above are NEW conversation messages to incorporate into the existing summary provided in <previous-summary> tags.
|
|
412
839
|
|
|
413
840
|
Update the existing structured summary with new information. RULES:
|
|
@@ -445,7 +872,156 @@ Use this EXACT format:
|
|
|
445
872
|
## Critical Context
|
|
446
873
|
- [Preserve important context, add new if needed]
|
|
447
874
|
|
|
448
|
-
|
|
875
|
+
## Resume Handoff
|
|
876
|
+
- **First action**: [Single concrete next action after compaction]
|
|
877
|
+
- **Re-check before editing**: [Workspace state, files, or commands to verify first; use "(none)" if not needed]
|
|
878
|
+
- **Evidence status**: [Checks/tests already run and results, or "(not run)"]
|
|
879
|
+
|
|
880
|
+
Keep each section concise. Preserve exact file paths, function names, command results, and error messages.`;
|
|
881
|
+
const REQUIRED_SUMMARY_SECTIONS = [
|
|
882
|
+
"## Goal",
|
|
883
|
+
"## Constraints & Preferences",
|
|
884
|
+
"## Progress",
|
|
885
|
+
"### Done",
|
|
886
|
+
"### In Progress",
|
|
887
|
+
"### Blocked",
|
|
888
|
+
"## Key Decisions",
|
|
889
|
+
"## Next Steps",
|
|
890
|
+
"## Critical Context",
|
|
891
|
+
"## Resume Handoff",
|
|
892
|
+
];
|
|
893
|
+
export function parseCompactionSummary(summary) {
|
|
894
|
+
const sections = {};
|
|
895
|
+
for (const heading of REQUIRED_SUMMARY_SECTIONS) {
|
|
896
|
+
const value = extractSection(summary, heading);
|
|
897
|
+
if (value !== undefined)
|
|
898
|
+
sections[heading] = value;
|
|
899
|
+
}
|
|
900
|
+
return {
|
|
901
|
+
sections,
|
|
902
|
+
missingSections: REQUIRED_SUMMARY_SECTIONS.filter((heading) => sections[heading] === undefined),
|
|
903
|
+
};
|
|
904
|
+
}
|
|
905
|
+
function extractSection(summary, heading) {
|
|
906
|
+
const start = summary.indexOf(heading);
|
|
907
|
+
if (start < 0)
|
|
908
|
+
return undefined;
|
|
909
|
+
const nextHeading = summary.slice(start + heading.length).search(/\n#{2,3}\s/);
|
|
910
|
+
if (nextHeading < 0)
|
|
911
|
+
return summary.slice(start + heading.length).trim();
|
|
912
|
+
return summary.slice(start + heading.length, start + heading.length + nextHeading).trim();
|
|
913
|
+
}
|
|
914
|
+
function extractCriticalFactsFromText(text, limit = 12) {
|
|
915
|
+
return text
|
|
916
|
+
.split("\n")
|
|
917
|
+
.map((line) => line.trim())
|
|
918
|
+
.filter((line) => line.length > 0 && scoreSummaryLine(line) >= 4)
|
|
919
|
+
.slice(0, limit);
|
|
920
|
+
}
|
|
921
|
+
export function createEmergencyCompactionHandoff(options) {
|
|
922
|
+
const conversationText = sanitizeCompactionRuntimeText(options.conversationText) ?? "";
|
|
923
|
+
const sanitizedFallbackFacts = options.fallbackFacts?.map((fact) => sanitizeCompactionRuntimeText(fact) ?? "");
|
|
924
|
+
const facts = sanitizedFallbackFacts ?? extractCriticalFactsFromText(conversationText, 16);
|
|
925
|
+
const previousSummary = sanitizeCompactionRuntimeText(options.previousSummary);
|
|
926
|
+
const previousBlocked = previousSummary
|
|
927
|
+
? (extractSection(previousSummary, "### Blocked") ?? extractSection(previousSummary, "## Blocked"))
|
|
928
|
+
: undefined;
|
|
929
|
+
return [
|
|
930
|
+
"## Goal",
|
|
931
|
+
"Deterministic emergency compaction handoff because normal summarization could exceed context budget.",
|
|
932
|
+
"",
|
|
933
|
+
"## Constraints & Preferences",
|
|
934
|
+
`- Emergency reason: ${options.reason}`,
|
|
935
|
+
"- Preserve exact paths, commands, blockers, and evidence before continuing.",
|
|
936
|
+
"",
|
|
937
|
+
"## Progress",
|
|
938
|
+
"### Done",
|
|
939
|
+
"- [x] Created emergency handoff without calling the summarization model.",
|
|
940
|
+
"",
|
|
941
|
+
"### In Progress",
|
|
942
|
+
"- [ ] Re-check workspace state and continue from critical facts.",
|
|
943
|
+
"",
|
|
944
|
+
"### Blocked",
|
|
945
|
+
previousBlocked && previousBlocked.length > 0 ? previousBlocked : "- (none)",
|
|
946
|
+
"",
|
|
947
|
+
"## Key Decisions",
|
|
948
|
+
"- **Emergency handoff**: Avoided forced minimum input budget that could overflow the model context.",
|
|
949
|
+
"",
|
|
950
|
+
"## Next Steps",
|
|
951
|
+
"1. Re-check workspace state before editing.",
|
|
952
|
+
"2. Resume from Critical Context and run verification before completion.",
|
|
953
|
+
"",
|
|
954
|
+
"## Critical Context",
|
|
955
|
+
formatFallbackFacts(facts),
|
|
956
|
+
"",
|
|
957
|
+
"## Resume Handoff",
|
|
958
|
+
"- **First action**: Re-check workspace state and relevant files from Critical Context.",
|
|
959
|
+
"- **Re-check before editing**: git status and target file contents.",
|
|
960
|
+
"- **Evidence status**: emergency handoff generated; downstream checks not run by compaction.",
|
|
961
|
+
].join("\n");
|
|
962
|
+
}
|
|
963
|
+
function formatFallbackFacts(fallbackFacts) {
|
|
964
|
+
if (!fallbackFacts || fallbackFacts.length === 0)
|
|
965
|
+
return "- (not captured)";
|
|
966
|
+
const lines = fallbackFacts
|
|
967
|
+
.map((fact) => sanitizeCompactionRuntimeText(fact)?.trim() ?? "")
|
|
968
|
+
.filter((fact) => fact.length > 0)
|
|
969
|
+
.map((fact) => `- ${fact}`);
|
|
970
|
+
return lines.length > 0 ? lines.join("\n") : "- (not captured)";
|
|
971
|
+
}
|
|
972
|
+
export function validateCompactionSummaryContract(summary, options = {}) {
|
|
973
|
+
const trimmedSummary = (sanitizeCompactionRuntimeText(summary) ?? "").trim();
|
|
974
|
+
const missingSections = REQUIRED_SUMMARY_SECTIONS.filter((section) => !trimmedSummary.includes(section));
|
|
975
|
+
const previousSummary = sanitizeCompactionRuntimeText(options.previousSummary);
|
|
976
|
+
const previousBlocked = previousSummary
|
|
977
|
+
? (extractSection(previousSummary, "### Blocked") ?? extractSection(previousSummary, "## Blocked"))
|
|
978
|
+
: undefined;
|
|
979
|
+
const shouldPreservePreviousBlocked = previousBlocked !== undefined && previousBlocked.length > 0 && !trimmedSummary.includes(previousBlocked);
|
|
980
|
+
if (missingSections.length === 0 && !shouldPreservePreviousBlocked) {
|
|
981
|
+
return { summary: trimmedSummary, wasRepaired: false, missingSections: [] };
|
|
982
|
+
}
|
|
983
|
+
const repairedSections = [trimmedSummary || "## Goal\n(not captured)"];
|
|
984
|
+
if (!trimmedSummary.includes("## Constraints & Preferences")) {
|
|
985
|
+
repairedSections.push("## Constraints & Preferences\n- (not captured)");
|
|
986
|
+
}
|
|
987
|
+
if (!trimmedSummary.includes("## Progress")) {
|
|
988
|
+
repairedSections.push("## Progress");
|
|
989
|
+
}
|
|
990
|
+
if (!trimmedSummary.includes("### Done")) {
|
|
991
|
+
repairedSections.push("### Done\n- [x] (not captured)");
|
|
992
|
+
}
|
|
993
|
+
if (!trimmedSummary.includes("### In Progress")) {
|
|
994
|
+
repairedSections.push("### In Progress\n- [ ] Continue from preserved context");
|
|
995
|
+
}
|
|
996
|
+
if (!trimmedSummary.includes("### Blocked")) {
|
|
997
|
+
repairedSections.push(`### Blocked\n${previousBlocked && previousBlocked.length > 0 ? previousBlocked : "- (none)"}`);
|
|
998
|
+
}
|
|
999
|
+
else if (shouldPreservePreviousBlocked) {
|
|
1000
|
+
repairedSections.push(`### Blocked\n${previousBlocked}`);
|
|
1001
|
+
}
|
|
1002
|
+
if (!trimmedSummary.includes("## Key Decisions")) {
|
|
1003
|
+
repairedSections.push("## Key Decisions\n- **Preserved context**: Summary contract repaired deterministically.");
|
|
1004
|
+
}
|
|
1005
|
+
if (!trimmedSummary.includes("## Next Steps")) {
|
|
1006
|
+
repairedSections.push("## Next Steps\n1. Re-check workspace state before editing.");
|
|
1007
|
+
}
|
|
1008
|
+
if (!trimmedSummary.includes("## Critical Context")) {
|
|
1009
|
+
repairedSections.push(`## Critical Context\n${formatFallbackFacts(options.fallbackFacts)}`);
|
|
1010
|
+
}
|
|
1011
|
+
if (!trimmedSummary.includes("## Resume Handoff")) {
|
|
1012
|
+
repairedSections.push([
|
|
1013
|
+
"## Resume Handoff",
|
|
1014
|
+
"- **First action**: Re-check workspace state and continue the latest requested task.",
|
|
1015
|
+
"- **Re-check before editing**: git status and relevant files from Critical Context.",
|
|
1016
|
+
"- **Evidence status**: (not run)",
|
|
1017
|
+
].join("\n"));
|
|
1018
|
+
}
|
|
1019
|
+
return {
|
|
1020
|
+
summary: repairedSections.join("\n\n"),
|
|
1021
|
+
wasRepaired: true,
|
|
1022
|
+
missingSections,
|
|
1023
|
+
};
|
|
1024
|
+
}
|
|
449
1025
|
function createSummarizationOptions(model, maxTokens, apiKey, headers, signal, thinkingLevel) {
|
|
450
1026
|
const options = { maxTokens, signal, apiKey, headers };
|
|
451
1027
|
if (model.reasoning && thinkingLevel && thinkingLevel !== "off") {
|
|
@@ -464,21 +1040,53 @@ async function completeSummarization(model, context, options, streamFn) {
|
|
|
464
1040
|
* Generate a summary of the conversation using the LLM.
|
|
465
1041
|
* If previousSummary is provided, uses the update prompt to merge.
|
|
466
1042
|
*/
|
|
467
|
-
export async function generateSummary(currentMessages, model, reserveTokens, apiKey, headers, signal, customInstructions, previousSummary, thinkingLevel, streamFn) {
|
|
1043
|
+
export async function generateSummary(currentMessages, model, reserveTokens, apiKey, headers, signal, customInstructions, previousSummary, thinkingLevel, streamFn, summaryInputTokens) {
|
|
468
1044
|
const maxTokens = Math.min(Math.floor(0.8 * reserveTokens), model.maxTokens > 0 ? model.maxTokens : Number.POSITIVE_INFINITY);
|
|
1045
|
+
const sanitizedPreviousSummary = sanitizeCompactionRuntimeText(previousSummary);
|
|
1046
|
+
const sanitizedCustomInstructions = sanitizeCompactionRuntimeText(customInstructions);
|
|
469
1047
|
// Use update prompt if we have a previous summary, otherwise initial prompt
|
|
470
|
-
let basePrompt =
|
|
471
|
-
if (
|
|
472
|
-
basePrompt = `${basePrompt}\n\nAdditional focus: ${
|
|
1048
|
+
let basePrompt = sanitizedPreviousSummary ? UPDATE_SUMMARIZATION_PROMPT : SUMMARIZATION_PROMPT;
|
|
1049
|
+
if (sanitizedCustomInstructions) {
|
|
1050
|
+
basePrompt = `${basePrompt}\n\nAdditional focus: ${sanitizedCustomInstructions}`;
|
|
473
1051
|
}
|
|
474
1052
|
// Serialize conversation to text so model doesn't try to continue it
|
|
475
1053
|
// Convert to LLM messages first (handles custom types like bashExecution, custom, etc.)
|
|
476
1054
|
const llmMessages = convertToLlm(currentMessages);
|
|
477
|
-
const
|
|
1055
|
+
const rawConversationText = serializeConversation(llmMessages);
|
|
1056
|
+
const conversationText = sanitizeSerializedConversation(rawConversationText).text;
|
|
1057
|
+
const summaryInputBudgetResolution = resolveSummaryInputTokenBudgetV3(model, maxTokens, {
|
|
1058
|
+
configuredSummaryInputTokens: summaryInputTokens,
|
|
1059
|
+
basePrompt,
|
|
1060
|
+
previousSummary: sanitizedPreviousSummary,
|
|
1061
|
+
systemPrompt: SUMMARIZATION_SYSTEM_PROMPT,
|
|
1062
|
+
wrapperText: "<conversation></conversation><previous-summary></previous-summary>",
|
|
1063
|
+
});
|
|
1064
|
+
if (summaryInputBudgetResolution.emergency) {
|
|
1065
|
+
const summary = createEmergencyCompactionHandoff({
|
|
1066
|
+
reason: summaryInputBudgetResolution.reason ?? "summary input budget unavailable",
|
|
1067
|
+
conversationText,
|
|
1068
|
+
previousSummary: sanitizedPreviousSummary,
|
|
1069
|
+
});
|
|
1070
|
+
recordHarnessControlEvent("compaction.summary.generated", "completed", {
|
|
1071
|
+
model: model.id,
|
|
1072
|
+
provider: model.provider,
|
|
1073
|
+
maxTokens,
|
|
1074
|
+
emergency: true,
|
|
1075
|
+
reason: summaryInputBudgetResolution.reason,
|
|
1076
|
+
fixedPromptTokens: summaryInputBudgetResolution.fixedPromptTokens,
|
|
1077
|
+
availableInputTokens: summaryInputBudgetResolution.availableInputTokens,
|
|
1078
|
+
});
|
|
1079
|
+
return validateCompactionSummaryContract(summary, {
|
|
1080
|
+
previousSummary: sanitizedPreviousSummary,
|
|
1081
|
+
fallbackFacts: extractCriticalFactsFromText(conversationText),
|
|
1082
|
+
}).summary;
|
|
1083
|
+
}
|
|
1084
|
+
const summaryInputBudget = summaryInputBudgetResolution.budgetTokens;
|
|
1085
|
+
const packedConversation = packSummaryInputForTokenBudget(conversationText, summaryInputBudget);
|
|
478
1086
|
// Build the prompt with conversation wrapped in tags
|
|
479
|
-
let promptText = `<conversation>\n${
|
|
480
|
-
if (
|
|
481
|
-
promptText += `<previous-summary>\n${
|
|
1087
|
+
let promptText = `<conversation>\n${packedConversation.text}\n</conversation>\n\n`;
|
|
1088
|
+
if (sanitizedPreviousSummary) {
|
|
1089
|
+
promptText += `<previous-summary>\n${sanitizedPreviousSummary}\n</previous-summary>\n\n`;
|
|
482
1090
|
}
|
|
483
1091
|
promptText += basePrompt;
|
|
484
1092
|
const summarizationMessages = [
|
|
@@ -497,7 +1105,22 @@ export async function generateSummary(currentMessages, model, reserveTokens, api
|
|
|
497
1105
|
.filter((c) => c.type === "text")
|
|
498
1106
|
.map((c) => c.text)
|
|
499
1107
|
.join("\n");
|
|
500
|
-
|
|
1108
|
+
const validation = validateCompactionSummaryContract(textContent, {
|
|
1109
|
+
previousSummary: sanitizedPreviousSummary,
|
|
1110
|
+
fallbackFacts: extractCriticalFactsFromText(conversationText),
|
|
1111
|
+
});
|
|
1112
|
+
recordHarnessControlEvent("compaction.summary.generated", "completed", {
|
|
1113
|
+
model: model.id,
|
|
1114
|
+
provider: model.provider,
|
|
1115
|
+
maxTokens,
|
|
1116
|
+
summaryInputBudget,
|
|
1117
|
+
packedTokens: packedConversation.packedTokens,
|
|
1118
|
+
omittedTokens: packedConversation.omittedTokens,
|
|
1119
|
+
wasCompressed: packedConversation.wasCompressed,
|
|
1120
|
+
wasRepaired: validation.wasRepaired,
|
|
1121
|
+
missingSections: validation.missingSections,
|
|
1122
|
+
});
|
|
1123
|
+
return validation.summary;
|
|
501
1124
|
}
|
|
502
1125
|
export function prepareCompaction(pathEntries, settings) {
|
|
503
1126
|
if (pathEntries.length > 0 && pathEntries[pathEntries.length - 1].type === "compaction") {
|
|
@@ -595,20 +1218,23 @@ export async function compact(preparation, model, apiKey, headers, customInstruc
|
|
|
595
1218
|
// Generate both summaries in parallel
|
|
596
1219
|
const [historyResult, turnPrefixResult] = await Promise.all([
|
|
597
1220
|
messagesToSummarize.length > 0
|
|
598
|
-
? generateSummary(messagesToSummarize, model, settings.reserveTokens, apiKey, headers, signal, customInstructions, previousSummary, thinkingLevel, streamFn)
|
|
1221
|
+
? generateSummary(messagesToSummarize, model, settings.reserveTokens, apiKey, headers, signal, customInstructions, previousSummary, thinkingLevel, streamFn, settings.summaryInputTokens)
|
|
599
1222
|
: Promise.resolve("No prior history."),
|
|
600
|
-
generateTurnPrefixSummary(turnPrefixMessages, model, settings.reserveTokens, apiKey, headers, signal, thinkingLevel, streamFn),
|
|
1223
|
+
generateTurnPrefixSummary(turnPrefixMessages, model, settings.reserveTokens, apiKey, headers, signal, thinkingLevel, streamFn, settings.summaryInputTokens),
|
|
601
1224
|
]);
|
|
602
1225
|
// Merge into single summary
|
|
603
1226
|
summary = `${historyResult}\n\n---\n\n**Turn Context (split turn):**\n\n${turnPrefixResult}`;
|
|
604
1227
|
}
|
|
605
1228
|
else {
|
|
606
1229
|
// Just generate history summary
|
|
607
|
-
summary = await generateSummary(messagesToSummarize, model, settings.reserveTokens, apiKey, headers, signal, customInstructions, previousSummary, thinkingLevel, streamFn);
|
|
1230
|
+
summary = await generateSummary(messagesToSummarize, model, settings.reserveTokens, apiKey, headers, signal, customInstructions, previousSummary, thinkingLevel, streamFn, settings.summaryInputTokens);
|
|
608
1231
|
}
|
|
609
1232
|
// Compute file lists and append to summary
|
|
610
1233
|
const { readFiles, modifiedFiles } = computeFileLists(fileOps);
|
|
611
|
-
|
|
1234
|
+
const sanitizedReadFiles = sanitizeCompactionRuntimeList(readFiles);
|
|
1235
|
+
const sanitizedModifiedFiles = sanitizeCompactionRuntimeList(modifiedFiles);
|
|
1236
|
+
summary += formatFileOperations(sanitizedReadFiles, sanitizedModifiedFiles);
|
|
1237
|
+
summary = sanitizeCompactionRuntimeText(summary) ?? "";
|
|
612
1238
|
if (!firstKeptEntryId) {
|
|
613
1239
|
throw new Error("First kept entry has no UUID - session may need migration");
|
|
614
1240
|
}
|
|
@@ -616,17 +1242,24 @@ export async function compact(preparation, model, apiKey, headers, customInstruc
|
|
|
616
1242
|
summary,
|
|
617
1243
|
firstKeptEntryId,
|
|
618
1244
|
tokensBefore,
|
|
619
|
-
details: { readFiles, modifiedFiles },
|
|
1245
|
+
details: { readFiles: sanitizedReadFiles, modifiedFiles: sanitizedModifiedFiles },
|
|
620
1246
|
};
|
|
621
1247
|
}
|
|
622
1248
|
/**
|
|
623
1249
|
* Generate a summary for a turn prefix (when splitting a turn).
|
|
624
1250
|
*/
|
|
625
|
-
async function generateTurnPrefixSummary(messages, model, reserveTokens, apiKey, headers, signal, thinkingLevel, streamFn) {
|
|
1251
|
+
async function generateTurnPrefixSummary(messages, model, reserveTokens, apiKey, headers, signal, thinkingLevel, streamFn, summaryInputTokens) {
|
|
626
1252
|
const maxTokens = Math.min(Math.floor(0.5 * reserveTokens), model.maxTokens > 0 ? model.maxTokens : Number.POSITIVE_INFINITY); // Smaller budget for turn prefix
|
|
627
1253
|
const llmMessages = convertToLlm(messages);
|
|
628
|
-
const
|
|
629
|
-
const
|
|
1254
|
+
const rawConversationText = serializeConversation(llmMessages);
|
|
1255
|
+
const conversationText = sanitizeSerializedConversation(rawConversationText).text;
|
|
1256
|
+
const packedConversation = packSummaryInputForTokenBudget(conversationText, resolveSummaryInputTokenBudget(model, maxTokens, {
|
|
1257
|
+
configuredSummaryInputTokens: summaryInputTokens,
|
|
1258
|
+
basePrompt: TURN_PREFIX_SUMMARIZATION_PROMPT,
|
|
1259
|
+
systemPrompt: SUMMARIZATION_SYSTEM_PROMPT,
|
|
1260
|
+
wrapperText: "<conversation></conversation>",
|
|
1261
|
+
}));
|
|
1262
|
+
const promptText = `<conversation>\n${packedConversation.text}\n</conversation>\n\n${TURN_PREFIX_SUMMARIZATION_PROMPT}`;
|
|
630
1263
|
const summarizationMessages = [
|
|
631
1264
|
{
|
|
632
1265
|
role: "user",
|
|
@@ -638,9 +1271,10 @@ async function generateTurnPrefixSummary(messages, model, reserveTokens, apiKey,
|
|
|
638
1271
|
if (response.stopReason === "error") {
|
|
639
1272
|
throw new Error(`Turn prefix summarization failed: ${response.errorMessage || "Unknown error"}`);
|
|
640
1273
|
}
|
|
641
|
-
|
|
1274
|
+
const textContent = response.content
|
|
642
1275
|
.filter((c) => c.type === "text")
|
|
643
1276
|
.map((c) => c.text)
|
|
644
1277
|
.join("\n");
|
|
1278
|
+
return sanitizeCompactionRuntimeText(textContent) ?? "";
|
|
645
1279
|
}
|
|
646
1280
|
//# sourceMappingURL=compaction.js.map
|