@namzu/sdk 34.2.0 → 36.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +171 -0
- package/README.md +2 -6
- package/dist/agents/PipelineAgent.d.ts.map +1 -1
- package/dist/agents/PipelineAgent.js +118 -100
- package/dist/agents/PipelineAgent.js.map +1 -1
- package/dist/agents/ReactiveAgent.d.ts.map +1 -1
- package/dist/agents/ReactiveAgent.js +2 -0
- package/dist/agents/ReactiveAgent.js.map +1 -1
- package/dist/agents/RouterAgent.d.ts.map +1 -1
- package/dist/agents/RouterAgent.js +105 -61
- package/dist/agents/RouterAgent.js.map +1 -1
- package/dist/agents/SupervisorAgent.d.ts.map +1 -1
- package/dist/agents/SupervisorAgent.js +8 -4
- package/dist/agents/SupervisorAgent.js.map +1 -1
- package/dist/agents/budget.d.ts +6 -0
- package/dist/agents/budget.d.ts.map +1 -0
- package/dist/agents/budget.js +33 -0
- package/dist/agents/budget.js.map +1 -0
- package/dist/agents/explore.d.ts +20 -0
- package/dist/agents/explore.d.ts.map +1 -0
- package/dist/agents/explore.js +26 -0
- package/dist/agents/explore.js.map +1 -0
- package/dist/agents/file-definitions.d.ts +80 -0
- package/dist/agents/file-definitions.d.ts.map +1 -0
- package/dist/agents/file-definitions.js +179 -0
- package/dist/agents/file-definitions.js.map +1 -0
- package/dist/agents/index.d.ts +3 -0
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +2 -0
- package/dist/agents/index.js.map +1 -1
- package/dist/bridge/a2a/mapper.d.ts.map +1 -1
- package/dist/bridge/a2a/mapper.js +6 -0
- package/dist/bridge/a2a/mapper.js.map +1 -1
- package/dist/bridge/sse/mapper.d.ts.map +1 -1
- package/dist/bridge/sse/mapper.js +22 -0
- package/dist/bridge/sse/mapper.js.map +1 -1
- package/dist/bus/lock.d.ts.map +1 -1
- package/dist/bus/lock.js +1 -10
- package/dist/bus/lock.js.map +1 -1
- package/dist/compaction/consolidation.d.ts +31 -0
- package/dist/compaction/consolidation.d.ts.map +1 -0
- package/dist/compaction/consolidation.js +63 -0
- package/dist/compaction/consolidation.js.map +1 -0
- package/dist/compaction/factory.d.ts.map +1 -1
- package/dist/compaction/factory.js +3 -0
- package/dist/compaction/factory.js.map +1 -1
- package/dist/compaction/index.d.ts +6 -1
- package/dist/compaction/index.d.ts.map +1 -1
- package/dist/compaction/index.js +6 -0
- package/dist/compaction/index.js.map +1 -1
- package/dist/compaction/manager.d.ts +7 -0
- package/dist/compaction/manager.d.ts.map +1 -1
- package/dist/compaction/manager.js +31 -0
- package/dist/compaction/manager.js.map +1 -1
- package/dist/compaction/plan.d.ts +23 -0
- package/dist/compaction/plan.d.ts.map +1 -1
- package/dist/compaction/plan.js +41 -24
- package/dist/compaction/plan.js.map +1 -1
- package/dist/compaction/salience/bm25.d.ts +26 -0
- package/dist/compaction/salience/bm25.d.ts.map +1 -0
- package/dist/compaction/salience/bm25.js +56 -0
- package/dist/compaction/salience/bm25.js.map +1 -0
- package/dist/compaction/salience/goal.d.ts +21 -0
- package/dist/compaction/salience/goal.d.ts.map +1 -0
- package/dist/compaction/salience/goal.js +32 -0
- package/dist/compaction/salience/goal.js.map +1 -0
- package/dist/compaction/salience/index.d.ts +4 -0
- package/dist/compaction/salience/index.d.ts.map +1 -0
- package/dist/compaction/salience/index.js +4 -0
- package/dist/compaction/salience/index.js.map +1 -0
- package/dist/compaction/salience/minhash.d.ts +17 -0
- package/dist/compaction/salience/minhash.d.ts.map +1 -0
- package/dist/compaction/salience/minhash.js +54 -0
- package/dist/compaction/salience/minhash.js.map +1 -0
- package/dist/compaction/salience/score.d.ts +64 -0
- package/dist/compaction/salience/score.d.ts.map +1 -0
- package/dist/compaction/salience/score.js +256 -0
- package/dist/compaction/salience/score.js.map +1 -0
- package/dist/compaction/salience/tokenize.d.ts +20 -0
- package/dist/compaction/salience/tokenize.d.ts.map +1 -0
- package/dist/compaction/salience/tokenize.js +92 -0
- package/dist/compaction/salience/tokenize.js.map +1 -0
- package/dist/compaction/salience/working-set.d.ts +59 -0
- package/dist/compaction/salience/working-set.d.ts.map +1 -0
- package/dist/compaction/salience/working-set.js +137 -0
- package/dist/compaction/salience/working-set.js.map +1 -0
- package/dist/compaction/serializer.d.ts +2 -0
- package/dist/compaction/serializer.d.ts.map +1 -1
- package/dist/compaction/serializer.js +15 -0
- package/dist/compaction/serializer.js.map +1 -1
- package/dist/compaction/token-estimate.d.ts +13 -0
- package/dist/compaction/token-estimate.d.ts.map +1 -0
- package/dist/compaction/token-estimate.js +58 -0
- package/dist/compaction/token-estimate.js.map +1 -0
- package/dist/compaction/tool-result-editing.d.ts +10 -2
- package/dist/compaction/tool-result-editing.d.ts.map +1 -1
- package/dist/compaction/tool-result-editing.js +22 -24
- package/dist/compaction/tool-result-editing.js.map +1 -1
- package/dist/compaction/types.d.ts +22 -1
- package/dist/compaction/types.d.ts.map +1 -1
- package/dist/compaction/wire.d.ts +3 -1
- package/dist/compaction/wire.d.ts.map +1 -1
- package/dist/compaction/wire.js +2 -0
- package/dist/compaction/wire.js.map +1 -1
- package/dist/config/runtime.d.ts +58 -28
- package/dist/config/runtime.d.ts.map +1 -1
- package/dist/config/runtime.js +13 -1
- package/dist/config/runtime.js.map +1 -1
- package/dist/connector/builtins/http.d.ts.map +1 -1
- package/dist/connector/builtins/http.js +2 -8
- package/dist/connector/builtins/http.js.map +1 -1
- package/dist/connector/builtins/webhook.js +2 -2
- package/dist/connector/builtins/webhook.js.map +1 -1
- package/dist/connector/mcp/adapter.d.ts +2 -0
- package/dist/connector/mcp/adapter.d.ts.map +1 -1
- package/dist/connector/mcp/adapter.js +30 -0
- package/dist/connector/mcp/adapter.js.map +1 -1
- package/dist/connector/tools/adapter.js +2 -2
- package/dist/connector/tools/adapter.js.map +1 -1
- package/dist/connector/tools/definitions.js +2 -2
- package/dist/connector/tools/definitions.js.map +1 -1
- package/dist/constants/compaction/index.d.ts +1 -0
- package/dist/constants/compaction/index.d.ts.map +1 -1
- package/dist/constants/compaction/index.js +1 -0
- package/dist/constants/compaction/index.js.map +1 -1
- package/dist/constants/telemetry/index.d.ts +0 -1
- package/dist/constants/telemetry/index.d.ts.map +1 -1
- package/dist/constants/telemetry/index.js +0 -1
- package/dist/constants/telemetry/index.js.map +1 -1
- package/dist/contracts/a2a.d.ts +5 -5
- package/dist/contracts/api.d.ts +4 -2
- package/dist/contracts/api.d.ts.map +1 -1
- package/dist/contracts/schemas.d.ts +1 -15
- package/dist/contracts/schemas.d.ts.map +1 -1
- package/dist/contracts/schemas.js +5 -20
- package/dist/contracts/schemas.js.map +1 -1
- package/dist/invariants/index.d.ts +1 -1
- package/dist/manager/agent/lifecycle.d.ts +2 -18
- package/dist/manager/agent/lifecycle.d.ts.map +1 -1
- package/dist/manager/agent/lifecycle.js +373 -340
- package/dist/manager/agent/lifecycle.js.map +1 -1
- package/dist/manager/run/persistence.d.ts +3 -0
- package/dist/manager/run/persistence.d.ts.map +1 -1
- package/dist/manager/run/persistence.js +35 -5
- package/dist/manager/run/persistence.js.map +1 -1
- package/dist/plugin/index.d.ts +2 -0
- package/dist/plugin/index.d.ts.map +1 -1
- package/dist/plugin/index.js +1 -0
- package/dist/plugin/index.js.map +1 -1
- package/dist/plugin/shell-hook.d.ts +128 -0
- package/dist/plugin/shell-hook.d.ts.map +1 -0
- package/dist/plugin/shell-hook.js +299 -0
- package/dist/plugin/shell-hook.js.map +1 -0
- package/dist/prompt/coding-agent-doctrine.d.ts +63 -0
- package/dist/prompt/coding-agent-doctrine.d.ts.map +1 -0
- package/dist/prompt/coding-agent-doctrine.js +100 -0
- package/dist/prompt/coding-agent-doctrine.js.map +1 -0
- package/dist/prompt/index.d.ts +2 -0
- package/dist/prompt/index.d.ts.map +1 -1
- package/dist/prompt/index.js +1 -0
- package/dist/prompt/index.js.map +1 -1
- package/dist/provider/errors.d.ts +1 -1
- package/dist/provider/errors.js +1 -1
- package/dist/provider/fallback.d.ts +2 -0
- package/dist/provider/fallback.d.ts.map +1 -1
- package/dist/provider/fallback.js +3 -1
- package/dist/provider/fallback.js.map +1 -1
- package/dist/provider/retry.d.ts +2 -0
- package/dist/provider/retry.d.ts.map +1 -1
- package/dist/provider/retry.js +3 -1
- package/dist/provider/retry.js.map +1 -1
- package/dist/provider/token-budget.d.ts +13 -0
- package/dist/provider/token-budget.d.ts.map +1 -0
- package/dist/provider/token-budget.js +150 -0
- package/dist/provider/token-budget.js.map +1 -0
- package/dist/public-runtime.d.ts +14 -14
- package/dist/public-runtime.d.ts.map +1 -1
- package/dist/public-runtime.js +15 -10
- package/dist/public-runtime.js.map +1 -1
- package/dist/public-tools.d.ts +2 -0
- package/dist/public-tools.d.ts.map +1 -1
- package/dist/public-tools.js +2 -0
- package/dist/public-tools.js.map +1 -1
- package/dist/public-types.d.ts +12 -2
- package/dist/public-types.d.ts.map +1 -1
- package/dist/registry/command/kernel-commands.d.ts.map +1 -1
- package/dist/registry/command/kernel-commands.js +18 -6
- package/dist/registry/command/kernel-commands.js.map +1 -1
- package/dist/registry/tool/execute.d.ts.map +1 -1
- package/dist/registry/tool/execute.js +4 -1
- package/dist/registry/tool/execute.js.map +1 -1
- package/dist/run/LimitChecker.js +1 -1
- package/dist/run/LimitChecker.js.map +1 -1
- package/dist/run/drain.js +1 -1
- package/dist/run/reporter.d.ts.map +1 -1
- package/dist/run/reporter.js +15 -0
- package/dist/run/reporter.js.map +1 -1
- package/dist/run/token-budget.d.ts +108 -0
- package/dist/run/token-budget.d.ts.map +1 -0
- package/dist/run/token-budget.js +591 -0
- package/dist/run/token-budget.js.map +1 -0
- package/dist/runtime/jobs/registry.d.ts +29 -0
- package/dist/runtime/jobs/registry.d.ts.map +1 -1
- package/dist/runtime/jobs/registry.js +98 -18
- package/dist/runtime/jobs/registry.js.map +1 -1
- package/dist/runtime/query/checkpoint.d.ts.map +1 -1
- package/dist/runtime/query/checkpoint.js +10 -3
- package/dist/runtime/query/checkpoint.js.map +1 -1
- package/dist/runtime/query/context.d.ts +2 -26
- package/dist/runtime/query/context.d.ts.map +1 -1
- package/dist/runtime/query/context.js +1 -29
- package/dist/runtime/query/context.js.map +1 -1
- package/dist/runtime/query/executor.d.ts +13 -9
- package/dist/runtime/query/executor.d.ts.map +1 -1
- package/dist/runtime/query/executor.js +144 -55
- package/dist/runtime/query/executor.js.map +1 -1
- package/dist/runtime/query/guard.d.ts.map +1 -1
- package/dist/runtime/query/guard.js +8 -0
- package/dist/runtime/query/guard.js.map +1 -1
- package/dist/runtime/query/index.d.ts +42 -4
- package/dist/runtime/query/index.d.ts.map +1 -1
- package/dist/runtime/query/index.js +153 -52
- package/dist/runtime/query/index.js.map +1 -1
- package/dist/runtime/query/iteration/index.d.ts +3 -3
- package/dist/runtime/query/iteration/index.d.ts.map +1 -1
- package/dist/runtime/query/iteration/index.js +47 -11
- package/dist/runtime/query/iteration/index.js.map +1 -1
- package/dist/runtime/query/iteration/phases/compaction.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/compaction.js +98 -30
- package/dist/runtime/query/iteration/phases/compaction.js.map +1 -1
- package/dist/runtime/query/iteration/phases/context.d.ts +4 -0
- package/dist/runtime/query/iteration/phases/context.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/context.js.map +1 -1
- package/dist/runtime/query/iteration/phases/tool-review.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/tool-review.js +29 -7
- package/dist/runtime/query/iteration/phases/tool-review.js.map +1 -1
- package/dist/runtime/query/iteration/phases/working-memory.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/working-memory.js +25 -15
- package/dist/runtime/query/iteration/phases/working-memory.js.map +1 -1
- package/dist/runtime/query/iteration/stream-turn.d.ts.map +1 -1
- package/dist/runtime/query/iteration/stream-turn.js +10 -5
- package/dist/runtime/query/iteration/stream-turn.js.map +1 -1
- package/dist/runtime/query/plugin-hooks.d.ts +1 -1
- package/dist/runtime/query/plugin-hooks.d.ts.map +1 -1
- package/dist/runtime/query/plugin-hooks.js +20 -1
- package/dist/runtime/query/plugin-hooks.js.map +1 -1
- package/dist/runtime/query/prompt.d.ts.map +1 -1
- package/dist/runtime/query/prompt.js +14 -4
- package/dist/runtime/query/prompt.js.map +1 -1
- package/dist/runtime/query/repeat-call.d.ts +20 -2
- package/dist/runtime/query/repeat-call.d.ts.map +1 -1
- package/dist/runtime/query/repeat-call.js +35 -7
- package/dist/runtime/query/repeat-call.js.map +1 -1
- package/dist/runtime/query/result.d.ts.map +1 -1
- package/dist/runtime/query/result.js +9 -0
- package/dist/runtime/query/result.js.map +1 -1
- package/dist/runtime/query/review-policy.d.ts +142 -0
- package/dist/runtime/query/review-policy.d.ts.map +1 -0
- package/dist/runtime/query/review-policy.js +144 -0
- package/dist/runtime/query/review-policy.js.map +1 -0
- package/dist/runtime/query/run-state.d.ts.map +1 -1
- package/dist/runtime/query/run-state.js +4 -0
- package/dist/runtime/query/run-state.js.map +1 -1
- package/dist/runtime/query/steering.d.ts +4 -0
- package/dist/runtime/query/steering.d.ts.map +1 -1
- package/dist/runtime/query/steering.js +29 -0
- package/dist/runtime/query/steering.js.map +1 -1
- package/dist/runtime/query/token-budget.d.ts +7 -0
- package/dist/runtime/query/token-budget.d.ts.map +1 -0
- package/dist/runtime/query/token-budget.js +101 -0
- package/dist/runtime/query/token-budget.js.map +1 -0
- package/dist/runtime/query/tool-output-budget.d.ts +2 -0
- package/dist/runtime/query/tool-output-budget.d.ts.map +1 -1
- package/dist/runtime/query/tool-output-budget.js +29 -11
- package/dist/runtime/query/tool-output-budget.js.map +1 -1
- package/dist/runtime/query/tool-pause.d.ts.map +1 -1
- package/dist/runtime/query/tool-pause.js +4 -2
- package/dist/runtime/query/tool-pause.js.map +1 -1
- package/dist/runtime/query/tooling.d.ts +4 -0
- package/dist/runtime/query/tooling.d.ts.map +1 -1
- package/dist/runtime/query/tooling.js +4 -0
- package/dist/runtime/query/tooling.js.map +1 -1
- package/dist/sandbox/file-walk-program.d.ts +3 -0
- package/dist/sandbox/file-walk-program.d.ts.map +1 -0
- package/dist/sandbox/file-walk-program.js +94 -0
- package/dist/sandbox/file-walk-program.js.map +1 -0
- package/dist/sandbox/file-walk.d.ts +12 -0
- package/dist/sandbox/file-walk.d.ts.map +1 -0
- package/dist/sandbox/file-walk.js +429 -0
- package/dist/sandbox/file-walk.js.map +1 -0
- package/dist/sandbox/index.d.ts +2 -0
- package/dist/sandbox/index.d.ts.map +1 -1
- package/dist/sandbox/index.js +1 -0
- package/dist/sandbox/index.js.map +1 -1
- package/dist/sandbox/provider/local.d.ts +3 -1
- package/dist/sandbox/provider/local.d.ts.map +1 -1
- package/dist/sandbox/provider/local.js +121 -12
- package/dist/sandbox/provider/local.js.map +1 -1
- package/dist/scheduler/completion-inbox.d.ts +3 -2
- package/dist/scheduler/completion-inbox.d.ts.map +1 -1
- package/dist/scheduler/completion-inbox.js +29 -15
- package/dist/scheduler/completion-inbox.js.map +1 -1
- package/dist/scheduler/delegating.d.ts +1 -0
- package/dist/scheduler/delegating.d.ts.map +1 -1
- package/dist/scheduler/delegating.js +29 -12
- package/dist/scheduler/delegating.js.map +1 -1
- package/dist/scheduler/local.d.ts +1 -0
- package/dist/scheduler/local.d.ts.map +1 -1
- package/dist/scheduler/local.js +4 -7
- package/dist/scheduler/local.js.map +1 -1
- package/dist/session/index.d.ts +0 -1
- package/dist/session/index.d.ts.map +1 -1
- package/dist/session/index.js +0 -1
- package/dist/session/index.js.map +1 -1
- package/dist/session/workspace/path-builder.d.ts.map +1 -1
- package/dist/session/workspace/path-builder.js +5 -4
- package/dist/session/workspace/path-builder.js.map +1 -1
- package/dist/store/feedback/disk.d.ts.map +1 -1
- package/dist/store/feedback/disk.js +4 -6
- package/dist/store/feedback/disk.js.map +1 -1
- package/dist/store/index.d.ts +2 -0
- package/dist/store/index.d.ts.map +1 -1
- package/dist/store/index.js +1 -0
- package/dist/store/index.js.map +1 -1
- package/dist/store/memory/disk.d.ts.map +1 -1
- package/dist/store/memory/disk.js +3 -12
- package/dist/store/memory/disk.js.map +1 -1
- package/dist/store/run/checkpoint-disk.d.ts +3 -3
- package/dist/store/run/checkpoint-disk.d.ts.map +1 -1
- package/dist/store/run/checkpoint-disk.js +14 -26
- package/dist/store/run/checkpoint-disk.js.map +1 -1
- package/dist/store/run/claim-disk.js +1 -1
- package/dist/store/run/conformance.d.ts +1 -1
- package/dist/store/run/conformance.d.ts.map +1 -1
- package/dist/store/run/conformance.js +41 -33
- package/dist/store/run/conformance.js.map +1 -1
- package/dist/store/run/disk.d.ts.map +1 -1
- package/dist/store/run/disk.js +20 -4
- package/dist/store/run/disk.js.map +1 -1
- package/dist/store/run/token-budget-disk.d.ts +37 -0
- package/dist/store/run/token-budget-disk.d.ts.map +1 -0
- package/dist/store/run/token-budget-disk.js +208 -0
- package/dist/store/run/token-budget-disk.js.map +1 -0
- package/dist/store/session/disk.d.ts +4 -13
- package/dist/store/session/disk.d.ts.map +1 -1
- package/dist/store/session/disk.js +34 -31
- package/dist/store/session/disk.js.map +1 -1
- package/dist/store/session/memory.d.ts +2 -0
- package/dist/store/session/memory.d.ts.map +1 -1
- package/dist/store/session/memory.js +41 -2
- package/dist/store/session/memory.js.map +1 -1
- package/dist/store/task/disk.d.ts.map +1 -1
- package/dist/store/task/disk.js +7 -8
- package/dist/store/task/disk.js.map +1 -1
- package/dist/store/topic/memory.d.ts +2 -0
- package/dist/store/topic/memory.d.ts.map +1 -1
- package/dist/store/topic/memory.js +13 -1
- package/dist/store/topic/memory.js.map +1 -1
- package/dist/test-support/ids.d.ts +4 -19
- package/dist/test-support/ids.d.ts.map +1 -1
- package/dist/test-support/ids.js +51 -59
- package/dist/test-support/ids.js.map +1 -1
- package/dist/tools/advisory/index.d.ts.map +1 -1
- package/dist/tools/advisory/index.js +3 -1
- package/dist/tools/advisory/index.js.map +1 -1
- package/dist/tools/builtins/bash.d.ts +2 -0
- package/dist/tools/builtins/bash.d.ts.map +1 -1
- package/dist/tools/builtins/bash.js +224 -70
- package/dist/tools/builtins/bash.js.map +1 -1
- package/dist/tools/builtins/computer-use.d.ts +2 -2
- package/dist/tools/builtins/computer-use.d.ts.map +1 -1
- package/dist/tools/builtins/computer-use.js +4 -2
- package/dist/tools/builtins/computer-use.js.map +1 -1
- package/dist/tools/builtins/edit.js +2 -2
- package/dist/tools/builtins/edit.js.map +1 -1
- package/dist/tools/builtins/glob.d.ts +2 -1
- package/dist/tools/builtins/glob.d.ts.map +1 -1
- package/dist/tools/builtins/glob.js +95 -103
- package/dist/tools/builtins/glob.js.map +1 -1
- package/dist/tools/builtins/grep.d.ts.map +1 -1
- package/dist/tools/builtins/grep.js +155 -111
- package/dist/tools/builtins/grep.js.map +1 -1
- package/dist/tools/builtins/ls.js +4 -4
- package/dist/tools/builtins/ls.js.map +1 -1
- package/dist/tools/builtins/lsp.js +2 -2
- package/dist/tools/builtins/lsp.js.map +1 -1
- package/dist/tools/builtins/read-file.js +2 -2
- package/dist/tools/builtins/read-file.js.map +1 -1
- package/dist/tools/builtins/write-file.js +2 -2
- package/dist/tools/builtins/write-file.js.map +1 -1
- package/dist/tools/coordinator/ask-user-question.d.ts +33 -0
- package/dist/tools/coordinator/ask-user-question.d.ts.map +1 -0
- package/dist/tools/coordinator/ask-user-question.js +237 -0
- package/dist/tools/coordinator/ask-user-question.js.map +1 -0
- package/dist/tools/coordinator/index.d.ts +1 -2
- package/dist/tools/coordinator/index.d.ts.map +1 -1
- package/dist/tools/coordinator/index.js +4 -220
- package/dist/tools/coordinator/index.js.map +1 -1
- package/dist/tools/memory/read.d.ts.map +1 -1
- package/dist/tools/memory/read.js +2 -4
- package/dist/tools/memory/read.js.map +1 -1
- package/dist/tools/paths.d.ts +13 -0
- package/dist/tools/paths.d.ts.map +1 -1
- package/dist/tools/paths.js +53 -0
- package/dist/tools/paths.js.map +1 -1
- package/dist/tools/roster.d.ts +27 -0
- package/dist/tools/roster.d.ts.map +1 -0
- package/dist/tools/roster.js +42 -0
- package/dist/tools/roster.js.map +1 -0
- package/dist/types/agent/base.d.ts +5 -0
- package/dist/types/agent/base.d.ts.map +1 -1
- package/dist/types/agent/pipeline.d.ts +3 -0
- package/dist/types/agent/pipeline.d.ts.map +1 -1
- package/dist/types/agent/router.d.ts +2 -3
- package/dist/types/agent/router.d.ts.map +1 -1
- package/dist/types/agent/scheduler.d.ts +3 -0
- package/dist/types/agent/scheduler.d.ts.map +1 -1
- package/dist/types/agent/task.d.ts +5 -16
- package/dist/types/agent/task.d.ts.map +1 -1
- package/dist/types/agent/task.js.map +1 -1
- package/dist/types/common/index.d.ts.map +1 -1
- package/dist/types/common/index.js +3 -0
- package/dist/types/common/index.js.map +1 -1
- package/dist/types/computer-use/index.d.ts +8 -0
- package/dist/types/computer-use/index.d.ts.map +1 -1
- package/dist/types/computer-use/index.js.map +1 -1
- package/dist/types/hitl/index.d.ts +5 -0
- package/dist/types/hitl/index.d.ts.map +1 -1
- package/dist/types/hitl/index.js.map +1 -1
- package/dist/types/ids/brand.d.ts +5 -47
- package/dist/types/ids/brand.d.ts.map +1 -1
- package/dist/types/ids/brand.js +2 -39
- package/dist/types/ids/brand.js.map +1 -1
- package/dist/types/ids/index.d.ts +59 -69
- package/dist/types/ids/index.d.ts.map +1 -1
- package/dist/types/ids/index.js +12 -10
- package/dist/types/ids/index.js.map +1 -1
- package/dist/types/permission/index.d.ts +9 -0
- package/dist/types/permission/index.d.ts.map +1 -1
- package/dist/types/permission/index.js +9 -1
- package/dist/types/permission/index.js.map +1 -1
- package/dist/types/plugin/index.d.ts +45 -4
- package/dist/types/plugin/index.d.ts.map +1 -1
- package/dist/types/plugin/index.js +7 -0
- package/dist/types/plugin/index.js.map +1 -1
- package/dist/types/run/config.d.ts +3 -0
- package/dist/types/run/config.d.ts.map +1 -1
- package/dist/types/run/emergency.d.ts +5 -0
- package/dist/types/run/emergency.d.ts.map +1 -1
- package/dist/types/run/emergency.js.map +1 -1
- package/dist/types/run/entity.d.ts +6 -2
- package/dist/types/run/entity.d.ts.map +1 -1
- package/dist/types/run/events.d.ts +35 -0
- package/dist/types/run/events.d.ts.map +1 -1
- package/dist/types/run/events.js.map +1 -1
- package/dist/types/run/index.d.ts +1 -0
- package/dist/types/run/index.d.ts.map +1 -1
- package/dist/types/run/index.js +1 -0
- package/dist/types/run/index.js.map +1 -1
- package/dist/types/run/state.d.ts +16 -15
- package/dist/types/run/state.d.ts.map +1 -1
- package/dist/types/run/state.js +41 -22
- package/dist/types/run/state.js.map +1 -1
- package/dist/types/run/stop-reason.d.ts +3 -14
- package/dist/types/run/stop-reason.d.ts.map +1 -1
- package/dist/types/run/token-budget-store.d.ts +29 -0
- package/dist/types/run/token-budget-store.d.ts.map +1 -0
- package/dist/types/run/token-budget-store.js +25 -0
- package/dist/types/run/token-budget-store.js.map +1 -0
- package/dist/types/sandbox/index.d.ts +47 -2
- package/dist/types/sandbox/index.d.ts.map +1 -1
- package/dist/types/sandbox/index.js.map +1 -1
- package/dist/types/session/store.d.ts +8 -0
- package/dist/types/session/store.d.ts.map +1 -1
- package/dist/types/tool/index.d.ts +15 -0
- package/dist/types/tool/index.d.ts.map +1 -1
- package/dist/types/tool/index.js.map +1 -1
- package/dist/utils/frontmatter.d.ts +1 -1
- package/dist/utils/frontmatter.js +1 -1
- package/dist/utils/id-format.d.ts +3 -0
- package/dist/utils/id-format.d.ts.map +1 -0
- package/dist/utils/id-format.js +9 -0
- package/dist/utils/id-format.js.map +1 -0
- package/dist/utils/id.d.ts +65 -32
- package/dist/utils/id.d.ts.map +1 -1
- package/dist/utils/id.js +168 -148
- package/dist/utils/id.js.map +1 -1
- package/dist/utils/log/exception.js +1 -1
- package/dist/utils/log/exception.js.map +1 -1
- package/dist/utils/log/index.d.ts.map +1 -1
- package/dist/utils/log/index.js +1 -2
- package/dist/utils/log/index.js.map +1 -1
- package/dist/utils/log/templates.d.ts.map +1 -1
- package/dist/utils/log/templates.js +0 -1
- package/dist/utils/log/templates.js.map +1 -1
- package/package.json +6 -1
- package/src/agents/AGENTS.md +1 -1
- package/src/agents/PipelineAgent.ts +129 -109
- package/src/agents/ReactiveAgent.ts +2 -0
- package/src/agents/RouterAgent.ts +120 -73
- package/src/agents/SupervisorAgent.ts +12 -4
- package/src/agents/budget.ts +42 -0
- package/src/agents/explore.ts +29 -0
- package/src/agents/file-definitions.ts +237 -0
- package/src/agents/index.ts +15 -0
- package/src/bridge/a2a/mapper.ts +6 -0
- package/src/bridge/sse/mapper.ts +22 -0
- package/src/bus/lock.ts +1 -10
- package/src/compaction/consolidation.ts +79 -0
- package/src/compaction/factory.ts +3 -0
- package/src/compaction/index.ts +34 -4
- package/src/compaction/manager.ts +39 -1
- package/src/compaction/plan.ts +52 -21
- package/src/compaction/salience/bm25.ts +72 -0
- package/src/compaction/salience/goal.ts +44 -0
- package/src/compaction/salience/index.ts +19 -0
- package/src/compaction/salience/minhash.ts +53 -0
- package/src/compaction/salience/score.ts +305 -0
- package/src/compaction/salience/tokenize.ts +89 -0
- package/src/compaction/salience/working-set.ts +187 -0
- package/src/compaction/serializer.ts +16 -0
- package/src/compaction/token-estimate.ts +57 -0
- package/src/compaction/tool-result-editing.ts +28 -26
- package/src/compaction/types.ts +24 -1
- package/src/compaction/wire.ts +5 -1
- package/src/config/runtime.ts +13 -1
- package/src/connector/builtins/http.ts +2 -8
- package/src/connector/builtins/webhook.ts +2 -2
- package/src/connector/mcp/adapter.ts +32 -0
- package/src/connector/tools/adapter.ts +2 -2
- package/src/connector/tools/definitions.ts +2 -2
- package/src/constants/compaction/index.ts +1 -0
- package/src/constants/telemetry/index.ts +0 -1
- package/src/contracts/api.ts +5 -1
- package/src/contracts/schemas.ts +6 -20
- package/src/invariants/index.ts +1 -1
- package/src/manager/agent/lifecycle.ts +380 -352
- package/src/manager/run/persistence.ts +35 -5
- package/src/plugin/index.ts +19 -0
- package/src/plugin/shell-hook.ts +403 -0
- package/src/prompt/coding-agent-doctrine.ts +118 -0
- package/src/prompt/index.ts +8 -0
- package/src/provider/errors.ts +1 -1
- package/src/provider/fallback.ts +4 -1
- package/src/provider/retry.ts +4 -1
- package/src/provider/token-budget.ts +158 -0
- package/src/public-runtime.ts +56 -28
- package/src/public-tools.ts +5 -0
- package/src/public-types.ts +65 -0
- package/src/registry/command/kernel-commands.ts +16 -6
- package/src/registry/tool/execute.ts +4 -1
- package/src/run/LimitChecker.ts +1 -1
- package/src/run/drain.ts +1 -1
- package/src/run/reporter.ts +15 -0
- package/src/run/token-budget.ts +692 -0
- package/src/runtime/jobs/registry.ts +123 -17
- package/src/runtime/query/checkpoint.ts +10 -3
- package/src/runtime/query/context.ts +3 -57
- package/src/runtime/query/executor.ts +181 -71
- package/src/runtime/query/guard.ts +8 -0
- package/src/runtime/query/index.ts +209 -62
- package/src/runtime/query/iteration/index.ts +53 -15
- package/src/runtime/query/iteration/phases/compaction.ts +130 -31
- package/src/runtime/query/iteration/phases/context.ts +4 -0
- package/src/runtime/query/iteration/phases/tool-review.ts +39 -7
- package/src/runtime/query/iteration/phases/working-memory.ts +23 -14
- package/src/runtime/query/iteration/stream-turn.ts +9 -5
- package/src/runtime/query/plugin-hooks.ts +24 -2
- package/src/runtime/query/prompt.ts +21 -4
- package/src/runtime/query/repeat-call.ts +42 -7
- package/src/runtime/query/result.ts +9 -0
- package/src/runtime/query/review-policy.ts +231 -0
- package/src/runtime/query/run-state.ts +4 -0
- package/src/runtime/query/steering.ts +32 -0
- package/src/runtime/query/token-budget.ts +127 -0
- package/src/runtime/query/tool-output-budget.ts +33 -10
- package/src/runtime/query/tool-pause.ts +4 -2
- package/src/runtime/query/tooling.ts +8 -0
- package/src/sandbox/file-walk-program.ts +93 -0
- package/src/sandbox/file-walk.ts +463 -0
- package/src/sandbox/index.ts +2 -0
- package/src/sandbox/provider/local.ts +136 -13
- package/src/scheduler/completion-inbox.ts +29 -19
- package/src/scheduler/delegating.ts +35 -13
- package/src/scheduler/local.ts +5 -7
- package/src/session/index.ts +0 -1
- package/src/session/workspace/path-builder.ts +5 -4
- package/src/store/feedback/disk.ts +4 -6
- package/src/store/index.ts +2 -0
- package/src/store/memory/disk.ts +3 -11
- package/src/store/run/checkpoint-disk.ts +14 -27
- package/src/store/run/claim-disk.ts +1 -1
- package/src/store/run/conformance.ts +55 -39
- package/src/store/run/disk.ts +19 -4
- package/src/store/run/token-budget-disk.ts +247 -0
- package/src/store/session/disk.ts +36 -29
- package/src/store/session/memory.ts +38 -1
- package/src/store/task/disk.ts +7 -8
- package/src/store/topic/memory.ts +13 -1
- package/src/test-support/ids.ts +62 -59
- package/src/tools/advisory/index.ts +3 -1
- package/src/tools/builtins/bash.ts +241 -70
- package/src/tools/builtins/computer-use.ts +6 -2
- package/src/tools/builtins/edit.ts +2 -2
- package/src/tools/builtins/glob.ts +104 -122
- package/src/tools/builtins/grep.ts +166 -132
- package/src/tools/builtins/ls.ts +4 -4
- package/src/tools/builtins/lsp.ts +2 -2
- package/src/tools/builtins/read-file.ts +2 -2
- package/src/tools/builtins/write-file.ts +2 -2
- package/src/tools/coordinator/ask-user-question.ts +284 -0
- package/src/tools/coordinator/index.ts +5 -248
- package/src/tools/memory/read.ts +2 -4
- package/src/tools/paths.ts +64 -0
- package/src/tools/roster.ts +46 -0
- package/src/types/agent/base.ts +6 -0
- package/src/types/agent/pipeline.ts +3 -0
- package/src/types/agent/router.ts +2 -3
- package/src/types/agent/scheduler.ts +4 -0
- package/src/types/agent/task.ts +5 -18
- package/src/types/common/index.ts +3 -0
- package/src/types/computer-use/index.ts +8 -0
- package/src/types/hitl/index.ts +5 -0
- package/src/types/ids/brand.ts +5 -48
- package/src/types/ids/index.ts +66 -75
- package/src/types/permission/index.ts +11 -0
- package/src/types/plugin/index.ts +49 -1
- package/src/types/run/config.ts +3 -0
- package/src/types/run/emergency.ts +5 -0
- package/src/types/run/entity.ts +6 -2
- package/src/types/run/events.ts +37 -0
- package/src/types/run/index.ts +1 -0
- package/src/types/run/state.ts +58 -30
- package/src/types/run/stop-reason.ts +3 -14
- package/src/types/run/token-budget-store.ts +54 -0
- package/src/types/sandbox/index.ts +53 -0
- package/src/types/session/store.ts +8 -0
- package/src/types/tool/index.ts +15 -0
- package/src/utils/frontmatter.ts +1 -1
- package/src/utils/id-format.ts +9 -0
- package/src/utils/id.ts +222 -181
- package/src/utils/log/exception.ts +1 -1
- package/src/utils/log/index.ts +1 -2
- package/src/utils/log/templates.ts +0 -1
- package/dist/session/migration/errors.d.ts +0 -26
- package/dist/session/migration/errors.d.ts.map +0 -1
- package/dist/session/migration/errors.js +0 -22
- package/dist/session/migration/errors.js.map +0 -1
- package/dist/session/migration/filesystem.d.ts +0 -122
- package/dist/session/migration/filesystem.d.ts.map +0 -1
- package/dist/session/migration/filesystem.js +0 -379
- package/dist/session/migration/filesystem.js.map +0 -1
- package/dist/session/migration/id-prefix.d.ts +0 -113
- package/dist/session/migration/id-prefix.d.ts.map +0 -1
- package/dist/session/migration/id-prefix.js +0 -132
- package/dist/session/migration/id-prefix.js.map +0 -1
- package/dist/session/migration/index.d.ts +0 -12
- package/dist/session/migration/index.d.ts.map +0 -1
- package/dist/session/migration/index.js +0 -12
- package/dist/session/migration/index.js.map +0 -1
- package/dist/session/migration/marker.d.ts +0 -57
- package/dist/session/migration/marker.d.ts.map +0 -1
- package/dist/session/migration/marker.js +0 -123
- package/dist/session/migration/marker.js.map +0 -1
- package/src/session/migration/errors.ts +0 -23
- package/src/session/migration/filesystem.ts +0 -468
- package/src/session/migration/id-prefix.ts +0 -166
- package/src/session/migration/index.ts +0 -41
- package/src/session/migration/marker.ts +0 -142
package/dist/compaction/index.js
CHANGED
|
@@ -13,4 +13,10 @@ export { clearStaleToolResults, isClearedToolResult, DEFAULT_KEEP_RECENT_TOOL_RE
|
|
|
13
13
|
// can offer, rather than something that only happens when a threshold trips.
|
|
14
14
|
export { compactNow, compactRegion } from './manual.js';
|
|
15
15
|
export { COMPACTION_HEADER, buildCompactionMessage, isCompactionMessage } from './summary.js';
|
|
16
|
+
// The salience-scored working set: every message scored, the least salient
|
|
17
|
+
// evicted first. See `docs/sdk/salience-working-set.md`.
|
|
18
|
+
export { DEFAULT_SALIENCE_CONFIG, DEFAULT_SALIENCE_WEIGHTS, buildGoal, isStubbedNarration, messageText, planWorkingSet, scoreMessages, } from './salience/index.js';
|
|
19
|
+
export { DEFAULT_SOFT_TARGET, planSalienceWorkingSet } from './plan.js';
|
|
20
|
+
// Episodic → semantic: what a run learned, as the entry a later run searches.
|
|
21
|
+
export { CONSOLIDATION_TAG, consolidationEntry } from './consolidation.js';
|
|
16
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/compaction/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/compaction/index.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAA;AAQzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAElD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAEhD,OAAO,EACN,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,EACtB,2BAA2B,GAC3B,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAA;AAGpD,OAAO,EACN,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EACtB,wBAAwB,EACxB,wBAAwB,GACxB,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAEpD,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAA;AAEpG,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAA;AACxD,OAAO,EACN,8BAA8B,EAC9B,mBAAmB,EACnB,oBAAoB,GACpB,MAAM,qBAAqB,CAAA;AAG5B,OAAO,EACN,qBAAqB,EACrB,mBAAmB,EACnB,gCAAgC,EAChC,0BAA0B,GAC1B,MAAM,0BAA0B,CAAA;AAGjC,4EAA4E;AAC5E,6EAA6E;AAC7E,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAEvD,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAE7F,2EAA2E;AAC3E,yDAAyD;AACzD,OAAO,EACN,uBAAuB,EACvB,wBAAwB,EACxB,SAAS,EACT,kBAAkB,EAClB,WAAW,EACX,cAAc,EACd,aAAa,GACb,MAAM,qBAAqB,CAAA;AAY5B,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAA;AAEvE,8EAA8E;AAC9E,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA"}
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import type { CompactionConfig } from '../config/runtime.js';
|
|
2
2
|
import type { FileAction, PlanSlot, ToolResultSlot, WorkingState } from './types.js';
|
|
3
|
+
/** Pins kept at most; the oldest is dropped past this, and the drop is counted. */
|
|
4
|
+
export declare const MAX_PINS = 40;
|
|
5
|
+
/** Characters one pin may carry; a pin is a fact, not a document. */
|
|
6
|
+
export declare const MAX_PIN_CHARS = 600;
|
|
3
7
|
export declare class WorkingStateManager {
|
|
4
8
|
private state;
|
|
5
9
|
private readonly config;
|
|
6
10
|
constructor(config: CompactionConfig);
|
|
7
11
|
setTask(task: string): void;
|
|
8
12
|
setPlan(plan: PlanSlot[]): void;
|
|
13
|
+
/** Pin a fact under `key`, replacing what that key held; empty text unpins. */
|
|
14
|
+
pin(key: string, text: string, source: string): void;
|
|
15
|
+
unpin(key: string): void;
|
|
9
16
|
trackFile(path: string, action: FileAction): void;
|
|
10
17
|
addDecision(decision: string): void;
|
|
11
18
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/compaction/manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB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,IAAI;IAUpC,SAAS,IAAI,MAAM;IAgBnB,QAAQ,IAAI,YAAY;IAIxB;;;;;;;OAOG;IACH,YAAY,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI;IAIvC,KAAK,IAAI,IAAI;IAIb;;;;;;;;;;;;;;;OAeG;IACH,OAAO,CAAC,gBAAgB;CAsBxB"}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
/** Pins kept at most; the oldest is dropped past this, and the drop is counted. */
|
|
2
|
+
export const MAX_PINS = 40;
|
|
3
|
+
/** Characters one pin may carry; a pin is a fact, not a document. */
|
|
4
|
+
export const MAX_PIN_CHARS = 600;
|
|
1
5
|
function createEmptyState() {
|
|
2
6
|
return {
|
|
3
7
|
task: '',
|
|
4
8
|
plan: [],
|
|
9
|
+
pins: new Map(),
|
|
5
10
|
files: new Map(),
|
|
6
11
|
decisions: [],
|
|
7
12
|
failures: [],
|
|
@@ -26,6 +31,31 @@ export class WorkingStateManager {
|
|
|
26
31
|
setPlan(plan) {
|
|
27
32
|
this.state.plan = plan;
|
|
28
33
|
}
|
|
34
|
+
/** Pin a fact under `key`, replacing what that key held; empty text unpins. */
|
|
35
|
+
pin(key, text, source) {
|
|
36
|
+
const k = key.trim();
|
|
37
|
+
if (k.length === 0)
|
|
38
|
+
return;
|
|
39
|
+
const body = text.trim().slice(0, MAX_PIN_CHARS);
|
|
40
|
+
if (body.length === 0) {
|
|
41
|
+
this.state.pins?.delete(k);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
if (!this.state.pins)
|
|
45
|
+
this.state.pins = new Map();
|
|
46
|
+
this.state.pins.delete(k);
|
|
47
|
+
this.state.pins.set(k, { key: k, text: body, source, updatedAt: Date.now() });
|
|
48
|
+
while (this.state.pins.size > MAX_PINS) {
|
|
49
|
+
const oldest = [...this.state.pins.values()].sort((a, b) => a.updatedAt - b.updatedAt)[0];
|
|
50
|
+
if (!oldest)
|
|
51
|
+
break;
|
|
52
|
+
this.state.pins.delete(oldest.key);
|
|
53
|
+
this.state.evicted.pins = (this.state.evicted.pins ?? 0) + 1;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
unpin(key) {
|
|
57
|
+
this.state.pins?.delete(key.trim());
|
|
58
|
+
}
|
|
29
59
|
trackFile(path, action) {
|
|
30
60
|
const existing = this.state.files.get(path);
|
|
31
61
|
if (existing) {
|
|
@@ -92,6 +122,7 @@ export class WorkingStateManager {
|
|
|
92
122
|
if (this.state.task)
|
|
93
123
|
count++;
|
|
94
124
|
count += this.state.plan.length;
|
|
125
|
+
count += this.state.pins?.size ?? 0;
|
|
95
126
|
count += this.state.files.size;
|
|
96
127
|
count += this.state.decisions.length;
|
|
97
128
|
count += this.state.failures.length;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager.js","sourceRoot":"","sources":["../../src/compaction/manager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"manager.js","sourceRoot":"","sources":["../../src/compaction/manager.ts"],"names":[],"mappings":"AAUA,mFAAmF;AACnF,MAAM,CAAC,MAAM,QAAQ,GAAG,EAAE,CAAA;AAC1B,qEAAqE;AACrE,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAAA;AAEhC,SAAS,gBAAgB;IACxB,OAAO;QACN,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,IAAI,GAAG,EAAmB;QAChC,KAAK,EAAE,IAAI,GAAG,EAAoB;QAClC,SAAS,EAAE,EAAE;QACb,QAAQ,EAAE,EAAE;QACZ,WAAW,EAAE,EAAE;QACf,WAAW,EAAE,EAAE;QACf,WAAW,EAAE,EAAE;QACf,gBAAgB,EAAE,EAAE;QACpB,cAAc,EAAE,EAAE;QAClB,OAAO,EAAE,EAAE;KACX,CAAA;AACF,CAAC;AAED,MAAM,OAAO,mBAAmB;IACvB,KAAK,CAAc;IACV,MAAM,CAAkB;IAEzC,YAAY,MAAwB;QACnC,IAAI,CAAC,MAAM,GAAG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AI,CAAC,KAAK,GAAG,KAAK,CAAA;IACnB,CAAC;IAED,KAAK;QACJ,IAAI,CAAC,KAAK,GAAG,gBAAgB,EAAE,CAAA;IAChC,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACK,gBAAgB,CACvB,IAAY,EACZ,IAAc,EACd,IAAY,EACZ,GAAW;IACX;;;;OAIG;IACH,iBAA0B;QAE1B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACf,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CACzB,iBAAiB,IAAI,IAAI,CAAC,MAAM,CAAC,gBAAgB,EACjD,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CACpB,CAAA;QACD,OAAO,IAAI,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;YAC1B,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,CAAA;YACzB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAA;QAC/D,CAAC;IACF,CAAC;CACD"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CompactionConfig } from '../config/runtime.js';
|
|
2
2
|
import type { Message } from '../types/message/index.js';
|
|
3
|
+
import { type WorkingSetPlan } from './salience/working-set.js';
|
|
3
4
|
/**
|
|
4
5
|
* The compaction decision, with no run attached.
|
|
5
6
|
*
|
|
@@ -38,6 +39,8 @@ export type CompactionPlan = {
|
|
|
38
39
|
readonly kind: 'cleared';
|
|
39
40
|
readonly messages: readonly Message[];
|
|
40
41
|
readonly clearedCount: number;
|
|
42
|
+
/** Assistant narrations cut to their first sentence by the salience pass. */
|
|
43
|
+
readonly stubbedCount?: number;
|
|
41
44
|
readonly charsReclaimed: number;
|
|
42
45
|
readonly reclaimedTokens: number;
|
|
43
46
|
readonly reliefWasEnough: boolean;
|
|
@@ -96,6 +99,26 @@ export interface CompactionPlanInput {
|
|
|
96
99
|
* the phase's copy is gone and its tests point here.
|
|
97
100
|
*/
|
|
98
101
|
export declare function naiveKeepStartByTokens(messages: readonly Message[], budgetTokens: number): number;
|
|
102
|
+
/**
|
|
103
|
+
* The salience pass: score every message and evict the least salient
|
|
104
|
+
* until the context is under `softTarget`. Returned as a `cleared` plan
|
|
105
|
+
* so the phase commits it the way it commits the stale-result pass; the
|
|
106
|
+
* summary path runs after it only when the trigger threshold is still
|
|
107
|
+
* exceeded.
|
|
108
|
+
*/
|
|
109
|
+
/** Where the salience pass holds the context, as a fraction of the window. */
|
|
110
|
+
export declare const DEFAULT_SOFT_TARGET = 0.5;
|
|
111
|
+
export declare function planSalienceWorkingSet(input: {
|
|
112
|
+
readonly messages: readonly Message[];
|
|
113
|
+
readonly config: CompactionConfig;
|
|
114
|
+
readonly contextWindowTokens: number;
|
|
115
|
+
readonly estimatedTokens: number;
|
|
116
|
+
readonly openTasks?: readonly string[];
|
|
117
|
+
}): Extract<CompactionPlan, {
|
|
118
|
+
kind: 'cleared';
|
|
119
|
+
}> & {
|
|
120
|
+
readonly working: WorkingSetPlan;
|
|
121
|
+
};
|
|
99
122
|
export declare function planCompaction(input: CompactionPlanInput): CompactionPlan;
|
|
100
123
|
/**
|
|
101
124
|
* Below this, a pass would summarise almost nothing and pay a model call to
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../src/compaction/plan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../src/compaction/plan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AAIxD,OA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C,KAAK,CAAC,EAAE,OAAO,CAAA;IACxB;;;;;;;OAOG;IACH,QAAQ,CAAC,kBAAkB,CAAC,EAAE,OAAO,CAAA;IACrC;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,mBAAmB,CAAC,EAAE,OAAO,CAAA;CACtC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAajG;AAED;;;;;;GAMG;AACH,8EAA8E;AAC9E,eAAO,MAAM,mBAAmB,MAAM,CAAA;AAEtC,wBAAgB,sBAAsB,CAAC,KAAK,EAAE;IAC7C,QAAQ,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,CAAA;IACrC,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAA;IACjC,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAA;IACpC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAA;IAChC,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CACtC,GAAG,OAAO,CAAC,cAAc,EAAE;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,CAAC,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAA;CAAE,CAyBtF;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,cAAc,CAiHzE;AAED;;;GAGG;AACH,eAAO,MAAM,6BAA6B,IAAI,CAAA"}
|
package/dist/compaction/plan.js
CHANGED
|
@@ -1,27 +1,9 @@
|
|
|
1
|
-
import { CHARS_PER_TOKEN } from '../constants/limits.js';
|
|
2
1
|
import { findSafeTrimIndex } from './dangling.js';
|
|
2
|
+
import { buildGoal } from './salience/goal.js';
|
|
3
|
+
import { scoreMessages } from './salience/score.js';
|
|
4
|
+
import { planWorkingSet } from './salience/working-set.js';
|
|
5
|
+
import { estimateMessageTokens, estimateMessagesTokens } from './token-estimate.js';
|
|
3
6
|
import { clearStaleToolResults } from './tool-result-editing.js';
|
|
4
|
-
/**
|
|
5
|
-
* How many characters a message's content is worth.
|
|
6
|
-
*
|
|
7
|
-
* An image costs far fewer tokens than its base64 length divided by four —
|
|
8
|
-
* but under-counting it to zero is the worse error: it let a run full of
|
|
9
|
-
* screenshots read as an empty context.
|
|
10
|
-
*/
|
|
11
|
-
function measureContentChars(content) {
|
|
12
|
-
if (typeof content === 'string')
|
|
13
|
-
return content.length;
|
|
14
|
-
if (!Array.isArray(content))
|
|
15
|
-
return 0;
|
|
16
|
-
let total = 0;
|
|
17
|
-
for (const block of content) {
|
|
18
|
-
if (block.type === 'text' && typeof block.text === 'string')
|
|
19
|
-
total += block.text.length;
|
|
20
|
-
else if (block.type === 'image' && typeof block.data === 'string')
|
|
21
|
-
total += block.data.length;
|
|
22
|
-
}
|
|
23
|
-
return total;
|
|
24
|
-
}
|
|
25
7
|
/**
|
|
26
8
|
* The last index whose tail fits in `budgetTokens`, walking backwards.
|
|
27
9
|
*
|
|
@@ -43,7 +25,7 @@ export function naiveKeepStartByTokens(messages, budgetTokens) {
|
|
|
43
25
|
let tokens = 0;
|
|
44
26
|
let start = messages.length;
|
|
45
27
|
for (let index = messages.length - 1; index >= 0; index--) {
|
|
46
|
-
const cost =
|
|
28
|
+
const cost = estimateMessageTokens(messages[index]);
|
|
47
29
|
// Checked BEFORE adding, so the boundary never includes a message
|
|
48
30
|
// that pushes the tail over. Adding first and trimming after would
|
|
49
31
|
// admit one oversized message on every run.
|
|
@@ -54,6 +36,41 @@ export function naiveKeepStartByTokens(messages, budgetTokens) {
|
|
|
54
36
|
}
|
|
55
37
|
return start;
|
|
56
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* The salience pass: score every message and evict the least salient
|
|
41
|
+
* until the context is under `softTarget`. Returned as a `cleared` plan
|
|
42
|
+
* so the phase commits it the way it commits the stale-result pass; the
|
|
43
|
+
* summary path runs after it only when the trigger threshold is still
|
|
44
|
+
* exceeded.
|
|
45
|
+
*/
|
|
46
|
+
/** Where the salience pass holds the context, as a fraction of the window. */
|
|
47
|
+
export const DEFAULT_SOFT_TARGET = 0.5;
|
|
48
|
+
export function planSalienceWorkingSet(input) {
|
|
49
|
+
const { config, estimatedTokens, contextWindowTokens: budget } = input;
|
|
50
|
+
const goal = buildGoal(input.messages, {
|
|
51
|
+
...(input.openTasks ? { openTasks: input.openTasks } : {}),
|
|
52
|
+
});
|
|
53
|
+
const scored = scoreMessages(input.messages, {
|
|
54
|
+
goal,
|
|
55
|
+
keepRecentMessages: config.keepRecentMessages,
|
|
56
|
+
});
|
|
57
|
+
const working = planWorkingSet(input.messages, scored, {
|
|
58
|
+
estimatedTokens,
|
|
59
|
+
targetTokens: Math.floor(budget * (config.softTarget ?? DEFAULT_SOFT_TARGET)),
|
|
60
|
+
minToolResultChars: config.minToolResultCharsToClear,
|
|
61
|
+
...(config.preserveToolResultsFrom ? { preserveTools: config.preserveToolResultsFrom } : {}),
|
|
62
|
+
});
|
|
63
|
+
return {
|
|
64
|
+
kind: 'cleared',
|
|
65
|
+
messages: working.messages,
|
|
66
|
+
clearedCount: working.clearedCount,
|
|
67
|
+
stubbedCount: working.stubbedCount,
|
|
68
|
+
charsReclaimed: working.charsReclaimed,
|
|
69
|
+
reclaimedTokens: working.reclaimedTokens,
|
|
70
|
+
reliefWasEnough: (estimatedTokens - working.reclaimedTokens) / budget < config.triggerThreshold,
|
|
71
|
+
working,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
57
74
|
export function planCompaction(input) {
|
|
58
75
|
const { config, estimatedTokens, contextWindowTokens: budget } = input;
|
|
59
76
|
if (!input.skipToolResultClear && config.clearToolResults !== false) {
|
|
@@ -67,7 +84,7 @@ export function planCompaction(input) {
|
|
|
67
84
|
...(config.preserveToolResultsFrom ? { preserveTools: config.preserveToolResultsFrom } : {}),
|
|
68
85
|
});
|
|
69
86
|
if (edit.clearedCount > 0) {
|
|
70
|
-
const reclaimedTokens =
|
|
87
|
+
const reclaimedTokens = estimateMessagesTokens(input.messages) - estimateMessagesTokens(edit.messages);
|
|
71
88
|
// NOT on a forced pass. A forced pass runs because the provider
|
|
72
89
|
// REJECTED the prompt as too long, which is a measurement — and
|
|
73
90
|
// answering it with the same estimate the provider just refuted
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan.js","sourceRoot":"","sources":["../../src/compaction/plan.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plan.js","sourceRoot":"","sources":["../../src/compaction/plan.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAuB,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC/E,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AACnF,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAsFhE;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,sBAAsB,CAAC,QAA4B,EAAE,YAAoB;IACxF,IAAI,MAAM,GAAG,CAAC,CAAA;IACd,IAAI,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAA;IAC3B,KAAK,IAAI,KAAK,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC;QAC3D,MAAM,IAAI,GAAG,qBAAqB,CAAC,QAAQ,CAAC,KAAK,CAAY,CAAC,CAAA;QAC9D,kEAAkE;QAClE,mEAAmE;QACnE,4CAA4C;QAC5C,IAAI,KAAK,GAAG,QAAQ,CAAC,MAAM,IAAI,MAAM,GAAG,IAAI,GAAG,YAAY;YAAE,MAAK;QAClE,MAAM,IAAI,IAAI,CAAA;QACd,KAAK,GAAG,KAAK,CAAA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,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,aAAa,EAAE,cAAc,EAAE,SAAS,EAAE,CAAA;AAClF,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BM25 over the run's own messages.
|
|
3
|
+
*
|
|
4
|
+
* The corpus is small — a few hundred documents at most — so the index
|
|
5
|
+
* is rebuilt from term frequencies each pass rather than maintained
|
|
6
|
+
* incrementally; the arithmetic is the cost of a few string splits. The
|
|
7
|
+
* constants are the textbook ones (k1 = 1.2, b = 0.75). What matters
|
|
8
|
+
* here is not ranking quality against a web corpus but that a message
|
|
9
|
+
* mentioning the goal's identifiers outscores one that does not, and
|
|
10
|
+
* that a term every message contains (the run's own file name, say)
|
|
11
|
+
* stops counting.
|
|
12
|
+
*/
|
|
13
|
+
export interface Bm25Document {
|
|
14
|
+
readonly tf: ReadonlyMap<string, number>;
|
|
15
|
+
readonly length: number;
|
|
16
|
+
}
|
|
17
|
+
export interface Bm25Index {
|
|
18
|
+
readonly documents: readonly Bm25Document[];
|
|
19
|
+
readonly documentFrequency: ReadonlyMap<string, number>;
|
|
20
|
+
readonly averageLength: number;
|
|
21
|
+
}
|
|
22
|
+
export declare function indexDocument(text: string): Bm25Document;
|
|
23
|
+
export declare function buildIndex(documents: readonly Bm25Document[]): Bm25Index;
|
|
24
|
+
/** BM25 score of one document for a query given as tokens. */
|
|
25
|
+
export declare function bm25Score(index: Bm25Index, doc: Bm25Document, queryTokens: readonly string[]): number;
|
|
26
|
+
//# sourceMappingURL=bm25.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bm25.d.ts","sourceRoot":"","sources":["../../../src/compaction/salience/bm25.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,MAAM,WAAW,YAAY;IAC5B,QAAQ,CAAC,EAAE,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACxC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACvB;AAED,MAAM,WAAW,SAAS;IACzB,QAAQ,CAAC,SAAS,EAAE,SAAS,YAAY,EAAE,CAAA;IAC3C,QAAQ,CAAC,iBAAiB,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACvD,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;CAC9B;AAKD,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAGxD;AAED,wBAAgB,UAAU,CAAC,SAAS,EAAE,SAAS,YAAY,EAAE,GAAG,SAAS,CAcxE;AAED,8DAA8D;AAC9D,wBAAgB,SAAS,CACxB,KAAK,EAAE,SAAS,EAChB,GAAG,EAAE,YAAY,EACjB,WAAW,EAAE,SAAS,MAAM,EAAE,GAC5B,MAAM,CAgBR"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BM25 over the run's own messages.
|
|
3
|
+
*
|
|
4
|
+
* The corpus is small — a few hundred documents at most — so the index
|
|
5
|
+
* is rebuilt from term frequencies each pass rather than maintained
|
|
6
|
+
* incrementally; the arithmetic is the cost of a few string splits. The
|
|
7
|
+
* constants are the textbook ones (k1 = 1.2, b = 0.75). What matters
|
|
8
|
+
* here is not ranking quality against a web corpus but that a message
|
|
9
|
+
* mentioning the goal's identifiers outscores one that does not, and
|
|
10
|
+
* that a term every message contains (the run's own file name, say)
|
|
11
|
+
* stops counting.
|
|
12
|
+
*/
|
|
13
|
+
import { termFrequencies, tokenize } from './tokenize.js';
|
|
14
|
+
const K1 = 1.2;
|
|
15
|
+
const B = 0.75;
|
|
16
|
+
export function indexDocument(text) {
|
|
17
|
+
const tokens = tokenize(text);
|
|
18
|
+
return { tf: termFrequencies(tokens), length: tokens.length };
|
|
19
|
+
}
|
|
20
|
+
export function buildIndex(documents) {
|
|
21
|
+
const documentFrequency = new Map();
|
|
22
|
+
let total = 0;
|
|
23
|
+
for (const doc of documents) {
|
|
24
|
+
total += doc.length;
|
|
25
|
+
for (const term of doc.tf.keys()) {
|
|
26
|
+
documentFrequency.set(term, (documentFrequency.get(term) ?? 0) + 1);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
documents,
|
|
31
|
+
documentFrequency,
|
|
32
|
+
averageLength: documents.length === 0 ? 0 : total / documents.length,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/** BM25 score of one document for a query given as tokens. */
|
|
36
|
+
export function bm25Score(index, doc, queryTokens) {
|
|
37
|
+
if (doc.length === 0 || index.documents.length === 0)
|
|
38
|
+
return 0;
|
|
39
|
+
const n = index.documents.length;
|
|
40
|
+
let score = 0;
|
|
41
|
+
const seen = new Set();
|
|
42
|
+
for (const term of queryTokens) {
|
|
43
|
+
if (seen.has(term))
|
|
44
|
+
continue;
|
|
45
|
+
seen.add(term);
|
|
46
|
+
const tf = doc.tf.get(term);
|
|
47
|
+
if (!tf)
|
|
48
|
+
continue;
|
|
49
|
+
const df = index.documentFrequency.get(term) ?? 0;
|
|
50
|
+
const idf = Math.log(1 + (n - df + 0.5) / (df + 0.5));
|
|
51
|
+
const norm = tf + K1 * (1 - B + (B * doc.length) / Math.max(1, index.averageLength));
|
|
52
|
+
score += idf * ((tf * (K1 + 1)) / norm);
|
|
53
|
+
}
|
|
54
|
+
return score;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=bm25.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bm25.js","sourceRoot":"","sources":["../../../src/compaction/salience/bm25.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAazD,MAAM,EAAE,GAAG,GAAG,CAAA;AACd,MAAM,CAAC,GAAG,IAAI,CAAA;AAEd,MAAM,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,GAAG,CAAC,IAAI,CAAC;YAAE,SAAQ;QAC5B,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QACd,MAAM,EAAE,GAAG,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QAC3B,IAAI,CAAC,EAAE;YAAE,SAAQ;QACjB,MAAM,EAAE,GAAG,KAAK,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACjD,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,GAAG,CAAC,GAAG,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAA;QACrD,MAAM,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAA;QACpF,KAAK,IAAI,GAAG,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAA;IACxC,CAAC;IACD,OAAO,KAAK,CAAA;AACb,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The goal vector: what "relevant" is measured against.
|
|
3
|
+
*
|
|
4
|
+
* Not the whole history — that would make every message relevant to
|
|
5
|
+
* itself — but the four things that say what the run is for right now:
|
|
6
|
+
* the first user message (the task), the most recent user turns (the
|
|
7
|
+
* requirements as they were refined), the open items of the task list
|
|
8
|
+
* when the run keeps one, and the latest assistant text (its stated
|
|
9
|
+
* intent). Weighted by repetition rather than a coefficient: the task
|
|
10
|
+
* statement is included twice so a run that has drifted into detail is
|
|
11
|
+
* still scored against what it was asked to do.
|
|
12
|
+
*/
|
|
13
|
+
import type { Message } from '../../types/message/index.js';
|
|
14
|
+
export interface GoalSources {
|
|
15
|
+
/** Titles of task-list items not yet completed, when the host keeps a task store. */
|
|
16
|
+
readonly openTasks?: readonly string[];
|
|
17
|
+
/** How many of the latest user turns count as live requirements. */
|
|
18
|
+
readonly recentUserTurns?: number;
|
|
19
|
+
}
|
|
20
|
+
export declare function buildGoal(messages: readonly Message[], sources?: GoalSources): string;
|
|
21
|
+
//# sourceMappingURL=goal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"goal.d.ts","sourceRoot":"","sources":["../../../src/compaction/salience/goal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA;AAE3D,MAAM,WAAW,WAAW;IAC3B,qFAAqF;IACrF,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACtC,oEAAoE;IACpE,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAA;CACjC;AAED,wBAAgB,SAAS,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,EAAE,OAAO,GAAE,WAAgB,GAAG,MAAM,CAqBzF"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The goal vector: what "relevant" is measured against.
|
|
3
|
+
*
|
|
4
|
+
* Not the whole history — that would make every message relevant to
|
|
5
|
+
* itself — but the four things that say what the run is for right now:
|
|
6
|
+
* the first user message (the task), the most recent user turns (the
|
|
7
|
+
* requirements as they were refined), the open items of the task list
|
|
8
|
+
* when the run keeps one, and the latest assistant text (its stated
|
|
9
|
+
* intent). Weighted by repetition rather than a coefficient: the task
|
|
10
|
+
* statement is included twice so a run that has drifted into detail is
|
|
11
|
+
* still scored against what it was asked to do.
|
|
12
|
+
*/
|
|
13
|
+
export function buildGoal(messages, sources = {}) {
|
|
14
|
+
const users = messages.filter((m) => m.role === 'user' && typeof m.content === 'string');
|
|
15
|
+
const first = users[0]?.content ?? '';
|
|
16
|
+
const recent = users
|
|
17
|
+
.slice(-(sources.recentUserTurns ?? 3))
|
|
18
|
+
.map((m) => m.content)
|
|
19
|
+
.filter((text) => text !== first);
|
|
20
|
+
let latestIntent = '';
|
|
21
|
+
for (let i = messages.length - 1; i >= 0; i -= 1) {
|
|
22
|
+
const m = messages[i];
|
|
23
|
+
if (m.role === 'assistant' && typeof m.content === 'string' && m.content.trim().length > 0) {
|
|
24
|
+
latestIntent = m.content;
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return [first, first, ...recent, ...(sources.openTasks ?? []), latestIntent]
|
|
29
|
+
.filter((part) => part.length > 0)
|
|
30
|
+
.join('\n');
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=goal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"goal.js","sourceRoot":"","sources":["../../../src/compaction/salience/goal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAWH,MAAM,UAAU,SAAS,CAAC,QAA4B,EAAE,UAAuB,EAAE;IAChF,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAC5B,CAAC,CAAC,EAA2C,EAAE,CAC9C,CAAC,CAAC,IAAI,KAAK,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,KAAK,QAAQ,CACnD,CAAA;IACD,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,OAAO,IAAI,EAAE,CAAA;IACrC,MAAM,MAAM,GAAG,KAAK;SAClB,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,eAAe,IAAI,CAAC,CAAC,CAAC;SACtC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;SACrB,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,KAAK,CAAC,CAAA;IAClC,IAAI,YAAY,GAAG,EAAE,CAAA;IACrB,KAAK,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QAClD,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAY,CAAA;QAChC,IAAI,CAAC,CAAC,IAAI,KAAK,WAAW,IAAI,OAAO,CAAC,CAAC,OAAO,KAAK,QAAQ,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC5F,YAAY,GAAG,CAAC,CAAC,OAAO,CAAA;YACxB,MAAK;QACN,CAAC;IACF,CAAC;IACD,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,MAAM,EAAE,GAAG,CAAC,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC,EAAE,YAAY,CAAC;SAC1E,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;SACjC,IAAI,CAAC,IAAI,CAAC,CAAA;AACb,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { buildGoal, type GoalSources } from './goal.js';
|
|
2
|
+
export { DEFAULT_SALIENCE_CONFIG, DEFAULT_SALIENCE_WEIGHTS, type ProtectedReason, type SalienceConfig, type SalienceWeights, type ScoreOptions, type ScoredMessage, messageText, scoreMessages, } from './score.js';
|
|
3
|
+
export { type WorkingSetAction, type WorkingSetOptions, type WorkingSetPlan, isStubbedNarration, planWorkingSet, } from './working-set.js';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/compaction/salience/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAA;AACvD,OAAO,EACN,uBAAuB,EACvB,wBAAwB,EACxB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,WAAW,EACX,aAAa,GACb,MAAM,YAAY,CAAA;AACnB,OAAO,EACN,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,kBAAkB,EAClB,cAAc,GACd,MAAM,kBAAkB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/compaction/salience/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAoB,MAAM,WAAW,CAAA;AACvD,OAAO,EACN,uBAAuB,EACvB,wBAAwB,EAMxB,WAAW,EACX,aAAa,GACb,MAAM,YAAY,CAAA;AACnB,OAAO,EAIN,kBAAkB,EAClB,cAAc,GACd,MAAM,kBAAkB,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Near-duplicate detection with MinHash over word shingles.
|
|
3
|
+
*
|
|
4
|
+
* Two tool results are rarely byte-identical — a timestamp, a duration,
|
|
5
|
+
* a line number moves — and still the same output. Three-word shingles
|
|
6
|
+
* hashed 64 ways give a Jaccard estimate that is stable against those
|
|
7
|
+
* edits and cheap enough to compare every message against every other
|
|
8
|
+
* once per pass at the sizes a run reaches. Hashing is FNV-1a with a
|
|
9
|
+
* per-slot seed; nothing here needs to be cryptographic, only consistent
|
|
10
|
+
* within a process.
|
|
11
|
+
*/
|
|
12
|
+
/** The signature of `tokens`; an empty signature for fewer than one shingle. */
|
|
13
|
+
export declare function minhash(tokens: readonly string[]): Uint32Array;
|
|
14
|
+
/** Estimated Jaccard similarity of two signatures, 0..1. */
|
|
15
|
+
export declare function similarity(a: Uint32Array, b: Uint32Array): number;
|
|
16
|
+
export declare function isEmptySignature(signature: Uint32Array): boolean;
|
|
17
|
+
//# sourceMappingURL=minhash.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"minhash.d.ts","sourceRoot":"","sources":["../../../src/compaction/salience/minhash.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAcH,gFAAgF;AAChF,wBAAgB,OAAO,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,WAAW,CAgB9D;AAED,4DAA4D;AAC5D,wBAAgB,UAAU,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,WAAW,GAAG,MAAM,CAIjE;AAED,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,WAAW,GAAG,OAAO,CAEhE"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Near-duplicate detection with MinHash over word shingles.
|
|
3
|
+
*
|
|
4
|
+
* Two tool results are rarely byte-identical — a timestamp, a duration,
|
|
5
|
+
* a line number moves — and still the same output. Three-word shingles
|
|
6
|
+
* hashed 64 ways give a Jaccard estimate that is stable against those
|
|
7
|
+
* edits and cheap enough to compare every message against every other
|
|
8
|
+
* once per pass at the sizes a run reaches. Hashing is FNV-1a with a
|
|
9
|
+
* per-slot seed; nothing here needs to be cryptographic, only consistent
|
|
10
|
+
* within a process.
|
|
11
|
+
*/
|
|
12
|
+
const HASHES = 64;
|
|
13
|
+
const SHINGLE = 3;
|
|
14
|
+
function fnv1a(text, seed) {
|
|
15
|
+
let hash = (0x811c9dc5 ^ seed) >>> 0;
|
|
16
|
+
for (let i = 0; i < text.length; i += 1) {
|
|
17
|
+
hash ^= text.charCodeAt(i);
|
|
18
|
+
hash = Math.imul(hash, 0x01000193) >>> 0;
|
|
19
|
+
}
|
|
20
|
+
return hash;
|
|
21
|
+
}
|
|
22
|
+
/** The signature of `tokens`; an empty signature for fewer than one shingle. */
|
|
23
|
+
export function minhash(tokens) {
|
|
24
|
+
const signature = new Uint32Array(HASHES).fill(0xffffffff);
|
|
25
|
+
if (tokens.length < SHINGLE) {
|
|
26
|
+
if (tokens.length === 0)
|
|
27
|
+
return signature;
|
|
28
|
+
const single = tokens.join(' ');
|
|
29
|
+
for (let slot = 0; slot < HASHES; slot += 1)
|
|
30
|
+
signature[slot] = fnv1a(single, slot);
|
|
31
|
+
return signature;
|
|
32
|
+
}
|
|
33
|
+
for (let i = 0; i + SHINGLE <= tokens.length; i += 1) {
|
|
34
|
+
const shingle = `${tokens[i]} ${tokens[i + 1]} ${tokens[i + 2]}`;
|
|
35
|
+
for (let slot = 0; slot < HASHES; slot += 1) {
|
|
36
|
+
const h = fnv1a(shingle, slot);
|
|
37
|
+
if (h < signature[slot])
|
|
38
|
+
signature[slot] = h;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return signature;
|
|
42
|
+
}
|
|
43
|
+
/** Estimated Jaccard similarity of two signatures, 0..1. */
|
|
44
|
+
export function similarity(a, b) {
|
|
45
|
+
let same = 0;
|
|
46
|
+
for (let slot = 0; slot < HASHES; slot += 1)
|
|
47
|
+
if (a[slot] === b[slot])
|
|
48
|
+
same += 1;
|
|
49
|
+
return same / HASHES;
|
|
50
|
+
}
|
|
51
|
+
export function isEmptySignature(signature) {
|
|
52
|
+
return signature.every((h) => h === 0xffffffff);
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=minhash.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"minhash.js","sourceRoot":"","sources":["../../../src/compaction/salience/minhash.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,MAAM,GAAG,EAAE,CAAA;AACjB,MAAM,OAAO,GAAG,CAAC,CAAA;AAEjB,SAAS,KAAK,CAAC,IAAY,EAAE,IAAY;IACxC,IAAI,IAAI,GAAG,CAAC,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,CAAA;IACpC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QACzC,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;QAC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AA;AACjB,CAAC;AAED,4DAA4D;AAC5D,MAAM,UAAU,UAAU,CAAC,CAAc,EAAE,CAAc;IACxD,IAAI,IAAI,GAAG,CAAC,CAAA;IACZ,KAAK,IAAI,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,MAAM,EAAE,IAAI,IAAI,CAAC;QAAE,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;YAAE,IAAI,IAAI,CAAC,CAAA;IAC/E,OAAO,IAAI,GAAG,MAAM,CAAA;AACrB,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,SAAsB;IACtD,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,UAAU,CAAC,CAAA;AAChD,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Salience: how much the next step depends on each message.
|
|
3
|
+
*
|
|
4
|
+
* The compaction pass chose what to keep by position — the floor, the
|
|
5
|
+
* last few turns, the last few tool results — and a fact stated in the
|
|
6
|
+
* middle of a long run aged out at the same rate as chatter. This gives
|
|
7
|
+
* every message a number instead, from four things the kernel can
|
|
8
|
+
* observe without a model:
|
|
9
|
+
*
|
|
10
|
+
* recency how many messages ago, decayed with a half-life;
|
|
11
|
+
* relevance BM25 against the goal — the task, the requirements, the
|
|
12
|
+
* open plan items, the latest intent;
|
|
13
|
+
* utility whether it was USED: a tool result whose paths and
|
|
14
|
+
* identifiers reappear in a later tool input or assistant
|
|
15
|
+
* turn; an instruction from the user;
|
|
16
|
+
* redundancy whether a later message says the same thing — a repeated
|
|
17
|
+
* read, the same error twice — so the older copy yields.
|
|
18
|
+
*
|
|
19
|
+
* What no score may cross is stated as `protected`: the leading system
|
|
20
|
+
* run, `retain` markers with the turn they pull in, the most recent
|
|
21
|
+
* turns, and the other half of a tool-call pair. Pure, like `plan.ts`:
|
|
22
|
+
* no run, no logger, no provider, so it can be asked without one.
|
|
23
|
+
*/
|
|
24
|
+
import type { Message } from '../../types/message/index.js';
|
|
25
|
+
export interface SalienceWeights {
|
|
26
|
+
readonly recency: number;
|
|
27
|
+
readonly relevance: number;
|
|
28
|
+
readonly utility: number;
|
|
29
|
+
readonly redundancy: number;
|
|
30
|
+
}
|
|
31
|
+
export declare const DEFAULT_SALIENCE_WEIGHTS: SalienceWeights;
|
|
32
|
+
export interface SalienceConfig {
|
|
33
|
+
/** Messages after which recency has halved. */
|
|
34
|
+
readonly halfLifeMessages: number;
|
|
35
|
+
/** Estimated Jaccard at or above which two messages are the same thing. */
|
|
36
|
+
readonly duplicateThreshold: number;
|
|
37
|
+
readonly weights: SalienceWeights;
|
|
38
|
+
}
|
|
39
|
+
export declare const DEFAULT_SALIENCE_CONFIG: SalienceConfig;
|
|
40
|
+
export type ProtectedReason = 'system-floor' | 'retain' | 'recent' | 'pair';
|
|
41
|
+
export interface ScoredMessage {
|
|
42
|
+
readonly index: number;
|
|
43
|
+
readonly role: Message['role'];
|
|
44
|
+
/** Estimated tokens of the message, including rich content and tool inputs. */
|
|
45
|
+
readonly tokens: number;
|
|
46
|
+
readonly recency: number;
|
|
47
|
+
readonly relevance: number;
|
|
48
|
+
readonly utility: number;
|
|
49
|
+
readonly redundancy: number;
|
|
50
|
+
/** The weighted sum; meaningful only relative to the other messages of the same pass. */
|
|
51
|
+
readonly salience: number;
|
|
52
|
+
readonly protected: ProtectedReason | null;
|
|
53
|
+
}
|
|
54
|
+
export interface ScoreOptions {
|
|
55
|
+
/** The goal vector as text: task statement, requirements, open plan items, latest intent. */
|
|
56
|
+
readonly goal: string;
|
|
57
|
+
/** How many trailing messages are protected as recent. */
|
|
58
|
+
readonly keepRecentMessages: number;
|
|
59
|
+
readonly config?: Partial<SalienceConfig>;
|
|
60
|
+
}
|
|
61
|
+
/** The model-visible text of a message, with an assistant's tool inputs. */
|
|
62
|
+
export declare function messageText(message: Message): string;
|
|
63
|
+
export declare function scoreMessages(messages: readonly Message[], options: ScoreOptions): ScoredMessage[];
|
|
64
|
+
//# sourceMappingURL=score.d.ts.map
|