@wrongstack/core 0.285.0 → 0.287.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/dist/autophase/phase-orchestrator.d.ts.map +1 -1
- package/dist/boot.d.ts.map +1 -1
- package/dist/coordination/agent-monitor.d.ts +29 -0
- package/dist/coordination/agent-monitor.d.ts.map +1 -1
- package/dist/coordination/autonomous-brain.d.ts +0 -2
- package/dist/coordination/autonomous-brain.d.ts.map +1 -1
- package/dist/coordination/autonomous-coordinator.d.ts +4 -0
- package/dist/coordination/autonomous-coordinator.d.ts.map +1 -1
- package/dist/coordination/brain-ledger.d.ts +142 -0
- package/dist/coordination/brain-ledger.d.ts.map +1 -0
- package/dist/coordination/brain-monitor.d.ts +46 -2
- package/dist/coordination/brain-monitor.d.ts.map +1 -1
- package/dist/coordination/brain.d.ts +43 -0
- package/dist/coordination/brain.d.ts.map +1 -1
- package/dist/coordination/delegate-tool.d.ts +8 -14
- package/dist/coordination/delegate-tool.d.ts.map +1 -1
- package/dist/coordination/director/director-btw-notes.d.ts +20 -0
- package/dist/coordination/director/director-btw-notes.d.ts.map +1 -0
- package/dist/coordination/director/director-collab.d.ts +40 -0
- package/dist/coordination/director/director-collab.d.ts.map +1 -0
- package/dist/coordination/director.d.ts +28 -9
- package/dist/coordination/director.d.ts.map +1 -1
- package/dist/coordination/fleet-manager.d.ts +21 -0
- package/dist/coordination/fleet-manager.d.ts.map +1 -1
- package/dist/coordination/fleet.d.ts +6 -7
- package/dist/coordination/fleet.d.ts.map +1 -1
- package/dist/coordination/global-mailbox.d.ts +96 -21
- package/dist/coordination/global-mailbox.d.ts.map +1 -1
- package/dist/coordination/icoordinator.d.ts +1 -3
- package/dist/coordination/icoordinator.d.ts.map +1 -1
- package/dist/coordination/index.d.ts +2 -1
- package/dist/coordination/index.d.ts.map +1 -1
- package/dist/coordination/index.js +2176 -806
- package/dist/coordination/index.js.map +4 -4
- package/dist/coordination/knowledge-graph.d.ts +13 -1
- package/dist/coordination/knowledge-graph.d.ts.map +1 -1
- package/dist/coordination/mail-tools.d.ts.map +1 -1
- package/dist/coordination/mailbox-actions.d.ts +12 -13
- package/dist/coordination/mailbox-actions.d.ts.map +1 -1
- package/dist/coordination/mailbox-constants.d.ts +64 -0
- package/dist/coordination/mailbox-constants.d.ts.map +1 -0
- package/dist/coordination/mailbox-events.d.ts +32 -0
- package/dist/coordination/mailbox-events.d.ts.map +1 -0
- package/dist/coordination/mailbox-message-codec.d.ts +28 -0
- package/dist/coordination/mailbox-message-codec.d.ts.map +1 -0
- package/dist/coordination/mailbox-types.d.ts +130 -5
- package/dist/coordination/mailbox-types.d.ts.map +1 -1
- package/dist/coordination/mailbox.d.ts +21 -2
- package/dist/coordination/mailbox.d.ts.map +1 -1
- package/dist/coordination/package-author-tracker.d.ts.map +1 -1
- package/dist/coordination/subagent-result-tool.d.ts.map +1 -1
- package/dist/core/agent-loop.d.ts.map +1 -1
- package/dist/core/agent-response.d.ts +10 -1
- package/dist/core/agent-response.d.ts.map +1 -1
- package/dist/core/agent-tools.d.ts.map +1 -1
- package/dist/core/agent.d.ts +8 -0
- package/dist/core/agent.d.ts.map +1 -1
- package/dist/core/context.d.ts +25 -0
- package/dist/core/context.d.ts.map +1 -1
- package/dist/core/conversation-state.d.ts +6 -0
- package/dist/core/conversation-state.d.ts.map +1 -1
- package/dist/core/fallback-model.d.ts.map +1 -1
- package/dist/core/mailbox-loop.d.ts +12 -5
- package/dist/core/mailbox-loop.d.ts.map +1 -1
- package/dist/core/system-prompt-builder.d.ts +14 -6
- package/dist/core/system-prompt-builder.d.ts.map +1 -1
- package/dist/defaults/index.d.ts +0 -1
- package/dist/defaults/index.d.ts.map +1 -1
- package/dist/defaults/index.js +1690 -1998
- package/dist/defaults/index.js.map +4 -4
- package/dist/execution/auto-compaction-middleware.d.ts +8 -1
- package/dist/execution/auto-compaction-middleware.d.ts.map +1 -1
- package/dist/execution/autonomous-runner.d.ts +7 -1
- package/dist/execution/autonomous-runner.d.ts.map +1 -1
- package/dist/execution/autonomy-brain.d.ts +72 -11
- package/dist/execution/autonomy-brain.d.ts.map +1 -1
- package/dist/execution/brain-chain.d.ts +53 -0
- package/dist/execution/brain-chain.d.ts.map +1 -0
- package/dist/execution/brain-evaluation.d.ts +66 -0
- package/dist/execution/brain-evaluation.d.ts.map +1 -0
- package/dist/execution/brain-runtime.d.ts +171 -0
- package/dist/execution/brain-runtime.d.ts.map +1 -0
- package/dist/execution/compaction-core.d.ts.map +1 -1
- package/dist/execution/council-brain.d.ts +79 -0
- package/dist/execution/council-brain.d.ts.map +1 -0
- package/dist/execution/council-orchestrator.d.ts +32 -0
- package/dist/execution/council-orchestrator.d.ts.map +1 -0
- package/dist/execution/council-personas.d.ts +19 -0
- package/dist/execution/council-personas.d.ts.map +1 -0
- package/dist/execution/council-profiles.d.ts +34 -0
- package/dist/execution/council-profiles.d.ts.map +1 -0
- package/dist/execution/council-prompts.d.ts +21 -0
- package/dist/execution/council-prompts.d.ts.map +1 -0
- package/dist/execution/council-resolution.d.ts +57 -0
- package/dist/execution/council-resolution.d.ts.map +1 -0
- package/dist/execution/design-kit-loader.d.ts.map +1 -1
- package/dist/execution/enhance-recovery.d.ts +35 -0
- package/dist/execution/enhance-recovery.d.ts.map +1 -0
- package/dist/execution/error-handler.d.ts.map +1 -1
- package/dist/execution/eternal-autonomy.d.ts +12 -0
- package/dist/execution/eternal-autonomy.d.ts.map +1 -1
- package/dist/execution/index.d.ts +11 -1
- package/dist/execution/index.d.ts.map +1 -1
- package/dist/execution/index.js +3076 -526
- package/dist/execution/index.js.map +4 -4
- package/dist/execution/intelligent-compactor.d.ts +18 -7
- package/dist/execution/intelligent-compactor.d.ts.map +1 -1
- package/dist/execution/one-shot-llm.d.ts +52 -0
- package/dist/execution/one-shot-llm.d.ts.map +1 -0
- package/dist/execution/parallel-eternal-engine.d.ts +12 -0
- package/dist/execution/parallel-eternal-engine.d.ts.map +1 -1
- package/dist/execution/prompt-enhancer.d.ts +23 -4
- package/dist/execution/prompt-enhancer.d.ts.map +1 -1
- package/dist/execution/prompt-enhancer.js +24 -6
- package/dist/execution/prompt-enhancer.js.map +2 -2
- package/dist/execution/selective-compactor.d.ts +4 -4
- package/dist/execution/strategy-compactor.d.ts +7 -0
- package/dist/execution/strategy-compactor.d.ts.map +1 -1
- package/dist/execution/tool-executor.d.ts +19 -5
- package/dist/execution/tool-executor.d.ts.map +1 -1
- package/dist/hooks/registry.d.ts.map +1 -1
- package/dist/hooks/runner.d.ts.map +1 -1
- package/dist/hooks/shell-executor.d.ts.map +1 -1
- package/dist/hq/alerts.d.ts +5 -0
- package/dist/hq/alerts.d.ts.map +1 -1
- package/dist/hq/auth-store.d.ts +38 -10
- package/dist/hq/auth-store.d.ts.map +1 -1
- package/dist/hq/commands.d.ts +8 -4
- package/dist/hq/commands.d.ts.map +1 -1
- package/dist/hq/cost-bridge.d.ts +5 -3
- package/dist/hq/cost-bridge.d.ts.map +1 -1
- package/dist/hq/factory.d.ts +3 -0
- package/dist/hq/factory.d.ts.map +1 -1
- package/dist/hq/fleet-bridge.d.ts.map +1 -1
- package/dist/hq/index.d.ts +0 -1
- package/dist/hq/index.d.ts.map +1 -1
- package/dist/hq/index.js +1016 -283
- package/dist/hq/index.js.map +4 -4
- package/dist/hq/persistence.d.ts +42 -0
- package/dist/hq/persistence.d.ts.map +1 -1
- package/dist/hq/protocol/brain.d.ts +24 -0
- package/dist/hq/protocol/brain.d.ts.map +1 -0
- package/dist/hq/protocol/browser.d.ts +12 -0
- package/dist/hq/protocol/browser.d.ts.map +1 -0
- package/dist/hq/protocol/client.d.ts +69 -0
- package/dist/hq/protocol/client.d.ts.map +1 -0
- package/dist/hq/protocol/core.d.ts +130 -0
- package/dist/hq/protocol/core.d.ts.map +1 -0
- package/dist/hq/protocol/fleet.d.ts +73 -0
- package/dist/hq/protocol/fleet.d.ts.map +1 -0
- package/dist/hq/protocol/mailbox.d.ts +76 -0
- package/dist/hq/protocol/mailbox.d.ts.map +1 -0
- package/dist/hq/protocol/mcp.d.ts +51 -0
- package/dist/hq/protocol/mcp.d.ts.map +1 -0
- package/dist/hq/protocol/project.d.ts +26 -0
- package/dist/hq/protocol/project.d.ts.map +1 -0
- package/dist/hq/protocol/session.d.ts +153 -0
- package/dist/hq/protocol/session.d.ts.map +1 -0
- package/dist/hq/protocol/tool.d.ts +31 -0
- package/dist/hq/protocol/tool.d.ts.map +1 -0
- package/dist/hq/protocol.d.ts +10 -559
- package/dist/hq/protocol.d.ts.map +1 -1
- package/dist/hq/publisher.d.ts +4 -0
- package/dist/hq/publisher.d.ts.map +1 -1
- package/dist/index.d.ts +24 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7676 -3432
- package/dist/index.js.map +4 -4
- package/dist/infrastructure/index.js +13 -11
- package/dist/infrastructure/index.js.map +2 -2
- package/dist/infrastructure/token-counter.d.ts.map +1 -1
- package/dist/kernel/events/agent-events.d.ts +283 -0
- package/dist/kernel/events/agent-events.d.ts.map +1 -0
- package/dist/kernel/events/brain-events.d.ts +176 -0
- package/dist/kernel/events/brain-events.d.ts.map +1 -0
- package/dist/kernel/events/fleet-events.d.ts +39 -0
- package/dist/kernel/events/fleet-events.d.ts.map +1 -0
- package/dist/kernel/events/memory-events.d.ts +165 -0
- package/dist/kernel/events/memory-events.d.ts.map +1 -0
- package/dist/kernel/events/provider-events.d.ts +98 -0
- package/dist/kernel/events/provider-events.d.ts.map +1 -0
- package/dist/kernel/events/sdd-events.d.ts +118 -0
- package/dist/kernel/events/sdd-events.d.ts.map +1 -0
- package/dist/kernel/events/session-events.d.ts +227 -0
- package/dist/kernel/events/session-events.d.ts.map +1 -0
- package/dist/kernel/events/tool-events.d.ts +185 -0
- package/dist/kernel/events/tool-events.d.ts.map +1 -0
- package/dist/kernel/events/worktree-events.d.ts +58 -0
- package/dist/kernel/events/worktree-events.d.ts.map +1 -0
- package/dist/kernel/events.d.ts +12 -1282
- package/dist/kernel/events.d.ts.map +1 -1
- package/dist/kernel/index.js +22 -2
- package/dist/kernel/index.js.map +2 -2
- package/dist/kernel/run-controller.d.ts +15 -0
- package/dist/kernel/run-controller.d.ts.map +1 -1
- package/dist/mailbox-attach.d.ts.map +1 -1
- package/dist/models/index.js +19 -6
- package/dist/models/index.js.map +2 -2
- package/dist/models/llm-selector.d.ts +7 -0
- package/dist/models/llm-selector.d.ts.map +1 -1
- package/dist/observability/index.js +16 -15
- package/dist/observability/index.js.map +2 -2
- package/dist/plugins/auto-review-plugin.d.ts +36 -0
- package/dist/plugins/auto-review-plugin.d.ts.map +1 -0
- package/dist/plugins/chimera-plugin.d.ts +8 -0
- package/dist/plugins/chimera-plugin.d.ts.map +1 -1
- package/dist/security/index.d.ts +1 -0
- package/dist/security/index.d.ts.map +1 -1
- package/dist/security/index.js +260 -23
- package/dist/security/index.js.map +4 -4
- package/dist/security/permission-policy-schema.d.ts +77 -0
- package/dist/security/permission-policy-schema.d.ts.map +1 -0
- package/dist/security/permission-policy.d.ts +5 -0
- package/dist/security/permission-policy.d.ts.map +1 -1
- package/dist/security/secret-scrubber.d.ts.map +1 -1
- package/dist/security/secret-vault.d.ts +9 -0
- package/dist/security/secret-vault.d.ts.map +1 -1
- package/dist/session-registry.d.ts.map +1 -1
- package/dist/skills/index.js.map +2 -2
- package/dist/storage/config-loader.d.ts +10 -0
- package/dist/storage/config-loader.d.ts.map +1 -1
- package/dist/storage/goal-kanban.d.ts +69 -0
- package/dist/storage/goal-kanban.d.ts.map +1 -0
- package/dist/storage/goal-store.d.ts +1 -1
- package/dist/storage/goal-store.d.ts.map +1 -1
- package/dist/storage/index.d.ts +1 -1
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +572 -879
- package/dist/storage/index.js.map +4 -4
- package/dist/storage/memory-consolidator.d.ts +9 -1
- package/dist/storage/memory-consolidator.d.ts.map +1 -1
- package/dist/storage/plan-store.d.ts +1 -1
- package/dist/storage/plan-store.d.ts.map +1 -1
- package/dist/storage/queue-store.d.ts +4 -0
- package/dist/storage/queue-store.d.ts.map +1 -1
- package/dist/storage/session-store.d.ts +9 -0
- package/dist/storage/session-store.d.ts.map +1 -1
- package/dist/storage/task-store.d.ts +1 -1
- package/dist/storage/task-store.d.ts.map +1 -1
- package/dist/storage/todos-checkpoint.d.ts +2 -2
- package/dist/storage/todos-checkpoint.d.ts.map +1 -1
- package/dist/tools/council-tool.d.ts +25 -0
- package/dist/tools/council-tool.d.ts.map +1 -0
- package/dist/tools/index.d.ts +2 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +1884 -12
- package/dist/tools/index.js.map +4 -4
- package/dist/tools/one-shot-llm-tool.d.ts +51 -0
- package/dist/tools/one-shot-llm-tool.d.ts.map +1 -0
- package/dist/types/config.d.ts +236 -4
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/context-window.d.ts.map +1 -1
- package/dist/types/council.d.ts +134 -0
- package/dist/types/council.d.ts.map +1 -0
- package/dist/types/default-config.d.ts +3 -3
- package/dist/types/hooks.d.ts +14 -0
- package/dist/types/hooks.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +40 -8
- package/dist/types/index.js.map +3 -3
- package/dist/types/multi-agent.d.ts +8 -0
- package/dist/types/multi-agent.d.ts.map +1 -1
- package/dist/types/observability.d.ts +5 -0
- package/dist/types/observability.d.ts.map +1 -1
- package/dist/types/one-shot-llm.d.ts +128 -0
- package/dist/types/one-shot-llm.d.ts.map +1 -0
- package/dist/types/plugin.d.ts +6 -0
- package/dist/types/plugin.d.ts.map +1 -1
- package/dist/types/provider.d.ts +17 -0
- package/dist/types/provider.d.ts.map +1 -1
- package/dist/types/system-prompt.d.ts +2 -1
- package/dist/types/system-prompt.d.ts.map +1 -1
- package/dist/types/tool-executor.d.ts +10 -0
- package/dist/types/tool-executor.d.ts.map +1 -1
- package/dist/types/tool.d.ts +7 -0
- package/dist/types/tool.d.ts.map +1 -1
- package/dist/utils/atomic-write.d.ts.map +1 -1
- package/dist/utils/glob-expand.d.ts.map +1 -1
- package/dist/utils/incoming-images.d.ts +39 -0
- package/dist/utils/incoming-images.d.ts.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +156 -11
- package/dist/utils/index.js.map +4 -4
- package/dist/utils/tool-wire-compact.d.ts +1 -0
- package/dist/utils/tool-wire-compact.d.ts.map +1 -1
- package/dist/utils/wstack-paths.d.ts +20 -4
- package/dist/utils/wstack-paths.d.ts.map +1 -1
- package/dist/worktree/worktree-manager.d.ts +13 -4
- package/dist/worktree/worktree-manager.d.ts.map +1 -1
- package/instructions/agents/browser.md +25 -16
- package/instructions/cli/next-task-predictor.md +5 -3
- package/instructions/coordination/subagent-baseline.md +17 -2
- package/instructions/leader-after-task.md +19 -8
- package/instructions/llm/council-judge.md +19 -0
- package/instructions/llm/council-voter.md +22 -0
- package/instructions/modes/architect.md +14 -9
- package/instructions/modes/audit-lite.md +9 -7
- package/instructions/modes/brief-system.md +12 -12
- package/instructions/modes/brief.md +7 -5
- package/instructions/modes/code-auditor.md +13 -8
- package/instructions/modes/code-reviewer.md +13 -8
- package/instructions/modes/debug-lite.md +7 -6
- package/instructions/modes/debugger.md +13 -9
- package/instructions/modes/devops.md +13 -9
- package/instructions/modes/plan-lite.md +7 -6
- package/instructions/modes/refactor-lite.md +7 -6
- package/instructions/modes/refactorer.md +14 -9
- package/instructions/modes/research-lite.md +8 -6
- package/instructions/modes/research-web.md +18 -55
- package/instructions/modes/review-lite.md +7 -6
- package/instructions/modes/teach-system.md +15 -15
- package/instructions/modes/teach.md +13 -12
- package/instructions/modes/test-lite.md +6 -5
- package/instructions/modes/tester.md +13 -9
- package/instructions/modes/ui-design.md +14 -8
- package/instructions/sections/tool/commit-hygiene.md +1 -7
- package/instructions/sections/tool/common-patterns.md +7 -1
- package/instructions/sections/tool/delegation-full.md +3 -31
- package/instructions/sections/tool/mailbox-compact.md +1 -1
- package/instructions/sections/tool/mailbox-full.md +6 -22
- package/instructions/system.md +294 -8
- package/package.json +2 -2
- package/skills/docker-deploy/SKILL.md +1 -1
- package/skills/mailbox-bridge/SKILL.md +16 -7
- package/skills/output-standards/SKILL.md +16 -16
- package/skills/wrongstack-mailbox/SKILL.md +57 -12
- package/dist/coordination/director-construction.d.ts +0 -90
- package/dist/coordination/director-construction.d.ts.map +0 -1
- package/dist/hq/agent-bridge.d.ts +0 -27
- package/dist/hq/agent-bridge.d.ts.map +0 -1
- package/dist/plugins/git-plugin.d.ts +0 -15
- package/dist/plugins/git-plugin.d.ts.map +0 -1
- package/dist/plugins/observability-plugin.d.ts +0 -19
- package/dist/plugins/observability-plugin.d.ts.map +0 -1
- package/dist/plugins/plan-plugin.d.ts +0 -16
- package/dist/plugins/plan-plugin.d.ts.map +0 -1
- package/dist/storage/memory-store.d.ts +0 -119
- package/dist/storage/memory-store.d.ts.map +0 -1
|
@@ -2,7 +2,7 @@ import type { Context } from '../core/context.js';
|
|
|
2
2
|
import type { EventBus } from '../kernel/events.js';
|
|
3
3
|
import type { MiddlewareHandler } from '../kernel/pipeline.js';
|
|
4
4
|
import type { SessionEventBridge } from '../storage/session-event-bridge.js';
|
|
5
|
-
import type { Compactor } from '../types/compactor.js';
|
|
5
|
+
import type { CompactReport, Compactor } from '../types/compactor.js';
|
|
6
6
|
import type { ContextWindowAggressiveOn, ContextWindowPolicy } from '../types/context-window.js';
|
|
7
7
|
export interface ContextWindowBudgetSnapshot {
|
|
8
8
|
maxContext: number;
|
|
@@ -22,6 +22,12 @@ export interface AutoCompactionOptions {
|
|
|
22
22
|
policyProvider?: (ctx: Context) => Pick<ContextWindowPolicy, 'thresholds' | 'aggressiveOn'> | null | undefined;
|
|
23
23
|
/** Optional bridge for writing compaction events into the persistent session log. */
|
|
24
24
|
sessionBridge?: SessionEventBridge | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Optional callback fired after successful compaction with the report.
|
|
27
|
+
* Receives the CompactReport so callers can feed the collapsed digest
|
|
28
|
+
* to memory consolidation, logging, or other side effects.
|
|
29
|
+
*/
|
|
30
|
+
onCompact?: ((report: CompactReport) => void) | undefined;
|
|
25
31
|
}
|
|
26
32
|
/**
|
|
27
33
|
* Pipeline middleware that monitors context token load and automatically
|
|
@@ -53,6 +59,7 @@ export declare class AutoCompactionMiddleware {
|
|
|
53
59
|
private readonly failureMode;
|
|
54
60
|
private readonly policyProvider?;
|
|
55
61
|
private readonly sessionBridge?;
|
|
62
|
+
private readonly onCompact?;
|
|
56
63
|
/**
|
|
57
64
|
* Once a compaction attempt reduces nothing (preserveK protects everything,
|
|
58
65
|
* no oversized tool_results remain to elide), retrying on every iteration
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto-compaction-middleware.d.ts","sourceRoot":"","sources":["../../src/execution/auto-compaction-middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"auto-compaction-middleware.d.ts","sourceRoot":"","sources":["../../src/execution/auto-compaction-middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,KAAK,EAAE,y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xB;;;;OAIG;IACH,OAAO,CAAC,mBAAmB;IAS3B,OAAO,CAAC,aAAa;YAYP,OAAO;CA4HtB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Agent, RunResult } from '../core/agent.js';
|
|
2
2
|
import type { Context } from '../core/context.js';
|
|
3
|
+
import type { Logger } from '../types/logger.js';
|
|
3
4
|
import type { DoneCondition } from '../types/multi-agent.js';
|
|
4
5
|
type AutonomousResult = RunResult & {
|
|
5
6
|
toolCalls: number;
|
|
@@ -14,7 +15,10 @@ export interface DoneCheckResult {
|
|
|
14
15
|
export declare class DoneConditionChecker {
|
|
15
16
|
private readonly condition;
|
|
16
17
|
private readonly compiledRegex;
|
|
17
|
-
|
|
18
|
+
private readonly logger;
|
|
19
|
+
constructor(condition: DoneCondition, opts?: {
|
|
20
|
+
logger?: Logger | undefined;
|
|
21
|
+
});
|
|
18
22
|
check(state: {
|
|
19
23
|
iterations: number;
|
|
20
24
|
toolCalls: number;
|
|
@@ -38,6 +42,8 @@ export interface AutonomousRunnerOptions {
|
|
|
38
42
|
* re-invocation needed). The runner still provides iteration/timeouts.
|
|
39
43
|
*/
|
|
40
44
|
enableAutonomousContinue?: boolean | undefined;
|
|
45
|
+
/** Logger for structured warnings. Falls back to console.warn when omitted. */
|
|
46
|
+
logger?: Logger | undefined;
|
|
41
47
|
}
|
|
42
48
|
export declare class AutonomousRunner {
|
|
43
49
|
private readonly opts;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autonomous-runner.d.ts","sourceRoot":"","sources":["../../src/execution/autonomous-runner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAI7D,KAAK,gBAAgB,GAAG,SAAS,GAAG;IAAE,SAA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QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,GAAG,eAAe,CA0DxG;CACF;AAED,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,aAAa,CAAC;IAC7B,kBAAkB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACpF,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAC,CAAC,GAAG,SAAS,CAAC;IAC5D;;;;;OAKG;IACH,wBAAwB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/C,+EAA+E;IAC/E,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B;AAED,qBAAa,gBAAgB;IAOf,OAAO,CAAC,QAAQ,CAAC,IAAI;IANjC,OAAO,CAAC,UAAU,CAAK;IACvB,OAAO,CAAC,SAAS,CAAK;IACtB,OAAO,CAAC,UAAU,CAAC,CAAqB;IACxC,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAuB;IAEnD,YAA6B,IAAI,EAAE,uBAAuB,EAEzD;IAEK,GAAG,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAgCrC;YAEa,OAAO;IA6GrB,IAAI,IAAI,IAAI,CAEX;CACF"}
|
|
@@ -28,11 +28,27 @@
|
|
|
28
28
|
*/
|
|
29
29
|
import type { Provider } from '../types/provider.js';
|
|
30
30
|
import type { BrainArbiter, BrainDecision, BrainDecisionRequest } from '../coordination/brain.js';
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
/** One (provider, model) pair the Brain may call for a decision. */
|
|
32
|
+
export interface BrainLlmTarget {
|
|
33
33
|
provider: Provider;
|
|
34
|
-
/** Model to use for decisions (should be fast + cheap). */
|
|
35
34
|
model: string;
|
|
35
|
+
/** Display label for logs/status (e.g. "anthropic/claude-haiku"). */
|
|
36
|
+
label?: string | undefined;
|
|
37
|
+
}
|
|
38
|
+
export interface AutonomyBrainOptions {
|
|
39
|
+
/** LLM provider for decision-making. Ignored when `targets` is non-empty. */
|
|
40
|
+
provider?: Provider | undefined;
|
|
41
|
+
/** Model to use for decisions (should be fast + cheap). Ignored when `targets` is non-empty. */
|
|
42
|
+
model?: string | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Ordered LLM pool. With `strategy: 'fallback'` (default) the first target
|
|
45
|
+
* is primary and later ones are tried in order when a call fails/times
|
|
46
|
+
* out; with 'round-robin' successive decisions rotate the starting target.
|
|
47
|
+
* At least one of `targets` / (`provider` + `model`) must be provided.
|
|
48
|
+
*/
|
|
49
|
+
targets?: BrainLlmTarget[] | undefined;
|
|
50
|
+
/** Pool selection strategy. Default 'fallback'. */
|
|
51
|
+
strategy?: 'fallback' | 'round-robin' | undefined;
|
|
36
52
|
/** Maximum risk level the brain will auto-decide. Default: 'high'.
|
|
37
53
|
* 'low' — only auto-decide low-risk questions
|
|
38
54
|
* 'medium' — auto-decide low/medium
|
|
@@ -42,6 +58,12 @@ export interface AutonomyBrainOptions {
|
|
|
42
58
|
maxAutoRisk?: 'low' | 'medium' | 'high' | 'all' | undefined;
|
|
43
59
|
/** Timeout for each decision call (ms). Default: 15_000. */
|
|
44
60
|
decisionTimeoutMs?: number | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* Decision-history digest for the LLM prompt (typically
|
|
63
|
+
* `BrainDecisionLedger.digestFor`): how similar past decisions went and
|
|
64
|
+
* how they turned out. Appended to the user message when non-empty.
|
|
65
|
+
*/
|
|
66
|
+
getDecisionDigest?: ((request: BrainDecisionRequest) => string | undefined) | undefined;
|
|
45
67
|
/**
|
|
46
68
|
* Called after every decision with a human-readable summary.
|
|
47
69
|
* Use this to log decisions into chat history, journal, or status line.
|
|
@@ -64,18 +86,38 @@ export interface TieredBrainArbiterOptions {
|
|
|
64
86
|
* entirely (everything the policy can't answer goes to the human).
|
|
65
87
|
*/
|
|
66
88
|
getMaxAutoRisk?: (() => BrainAutoRisk) | undefined;
|
|
89
|
+
/**
|
|
90
|
+
* Multi-LLM council (createCouncilBrainArbiter). When present, requests at
|
|
91
|
+
* or above the council risk floor are decided by the council INSTEAD of
|
|
92
|
+
* the single-LLM layer. Council answers AND denies are terminal — a panel
|
|
93
|
+
* that considered the question and refused is a real decision, not a
|
|
94
|
+
* failure. Only `ask_human` (quorum not met / judge unavailable) falls
|
|
95
|
+
* through to the escalation tier.
|
|
96
|
+
*/
|
|
97
|
+
council?: BrainArbiter | undefined;
|
|
98
|
+
/** Live council risk floor. Default 'high'. Read on every decision. */
|
|
99
|
+
getCouncilMinRisk?: (() => 'medium' | 'high' | 'critical') | undefined;
|
|
67
100
|
}
|
|
68
101
|
/**
|
|
69
|
-
* The standard Brain positioning: policy first, LLM second,
|
|
102
|
+
* The standard Brain positioning: policy first, LLM/council second,
|
|
103
|
+
* escalation last.
|
|
70
104
|
*
|
|
71
105
|
* 1. POLICY — deterministic DefaultBrainArbiter (low-risk fast path,
|
|
72
|
-
* fallback semantics).
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
106
|
+
* fallback semantics). Denies and option-backed answers pass through
|
|
107
|
+
* untouched. A fallback-produced `continue` answer (no optionId, the
|
|
108
|
+
* request declared `fallback: 'continue'`) is only PROVISIONAL: it
|
|
109
|
+
* means "nobody could decide", not "this is the right call", so the
|
|
110
|
+
* LLM tier still gets consulted within the ceiling. Historically it
|
|
111
|
+
* short-circuited here, which meant e.g. goal-completion checks never
|
|
112
|
+
* reached the LLM at all.
|
|
113
|
+
* 2. COUNCIL — requests at/above the council floor (default 'high') are
|
|
114
|
+
* decided by the multi-LLM council when one is wired.
|
|
115
|
+
* 3. LLM — everything else within the live ceiling goes to the
|
|
116
|
+
* single-LLM autonomous brain. Only a real `answer` short-circuits;
|
|
117
|
+
* denials/failures fall through.
|
|
118
|
+
* 4. ESCALATION — anything left escalates. Callers wrap this in
|
|
119
|
+
* `EscalationRoutingBrainArbiter` (interactive prompt or headless
|
|
120
|
+
* terminal policy) or the legacy `HumanEscalatingBrainArbiter`.
|
|
79
121
|
*/
|
|
80
122
|
export declare function createTieredBrainArbiter(opts: TieredBrainArbiterOptions): BrainArbiter;
|
|
81
123
|
/**
|
|
@@ -87,4 +129,23 @@ export declare function createAutonomyBrain(opts: AutonomyBrainOptions): BrainAr
|
|
|
87
129
|
* Format a decision as a human-readable one-liner for chat history.
|
|
88
130
|
*/
|
|
89
131
|
export declare function formatDecisionSummary(decision: BrainDecision, request: BrainDecisionRequest): string;
|
|
132
|
+
/**
|
|
133
|
+
* Render a decision request as the user message for a Brain LLM call.
|
|
134
|
+
* Shared by the single-LLM tier and every council voter so all of them see
|
|
135
|
+
* the same question/context/options shape.
|
|
136
|
+
*/
|
|
137
|
+
export declare function buildBrainUserMessage(request: BrainDecisionRequest): string;
|
|
138
|
+
/** Append a decision-history digest to a Brain user message (shared shape). */
|
|
139
|
+
export declare function withDecisionDigest(user: string, digest: string | undefined): string;
|
|
140
|
+
/**
|
|
141
|
+
* One Brain LLM call against a single target. Throws on transport failure,
|
|
142
|
+
* timeout, or abort — callers own the pool/fallback semantics.
|
|
143
|
+
*/
|
|
144
|
+
export declare function completeBrainLlm(target: BrainLlmTarget, input: {
|
|
145
|
+
system: string;
|
|
146
|
+
user: string;
|
|
147
|
+
timeoutMs: number;
|
|
148
|
+
maxTokens?: number | undefined;
|
|
149
|
+
}): Promise<string>;
|
|
150
|
+
export declare function parseOptionDecision(rawText: string, options: NonNullable<BrainDecisionRequest['options']>): BrainDecision | null;
|
|
90
151
|
//# sourceMappingURL=autonomy-brain.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autonomy-brain.d.ts","sourceRoot":"","sources":["../../src/execution/autonomy-brain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAIlG,MAAM,WAAW,oBAAoB;IACnC,
|
|
1
|
+
{"version":3,"file":"autonomy-brain.d.ts","sourceRoot":"","sources":["../../src/execution/autonomy-brain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAIlG,oEAAoE;AACpE,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,QAAQ,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5B;AAED,MAAM,WAAW,oBAAoB;IACnC,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IAChC,gGAAgG;IAChG,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B;;;;;OAKG;IACH,OAAO,CAAC,EAAE,cAAc,EAAE,GAAG,SAAS,CAAC;IACvC,mDAAmD;IACnD,QAAQ,CAAC,EAAE,UAAU,GAAG,aAAa,GAAG,SAAS,CAAC;IAClD;;;;;OAKG;IACH,WAAW,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,GAAG,SAAS,CAAC;IAC5D,4DAA4D;IAC5D,iBAAiB,CAAC,EAAE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,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAGnF;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,cAAc,EACtB,KAAK,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GACzF,OAAO,CAAC,MAAM,CAAC,CAYjB;AAmED,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,WAAW,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC,GACpD,aAAa,GAAG,IAAI,CAuCtB"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Brain tier assembly — turns `Config.brain` into the concrete LLM tiers
|
|
3
|
+
* (single-LLM pool + optional multi-LLM council) that
|
|
4
|
+
* `createTieredBrainArbiter` composes. Shared by every host that wires a
|
|
5
|
+
* Brain (CLI/TUI in `wiring/brain-and-orchestration.ts`, the standalone
|
|
6
|
+
* WebUI server in `backend-services.ts`) so the config surface behaves
|
|
7
|
+
* identically everywhere.
|
|
8
|
+
*
|
|
9
|
+
* Hosts differ only in HOW a provider id becomes a `Provider` instance, so
|
|
10
|
+
* that is the one injected dependency (`resolveProvider`). Unresolvable
|
|
11
|
+
* pool/council entries are skipped — one bad ref never takes the Brain down.
|
|
12
|
+
*
|
|
13
|
+
* @module brain-chain
|
|
14
|
+
*/
|
|
15
|
+
import type { BrainArbiter, BrainDecisionRequest } from '../coordination/brain.js';
|
|
16
|
+
import type { BrainConfig } from '../types/config.js';
|
|
17
|
+
import type { Provider } from '../types/provider.js';
|
|
18
|
+
export interface BrainTierAssemblyOptions {
|
|
19
|
+
/** `config.brain` — undefined assembles the legacy session-model single tier. */
|
|
20
|
+
brainConfig: BrainConfig | undefined;
|
|
21
|
+
/** The session's provider id (`config.provider`). */
|
|
22
|
+
defaultProviderId: string;
|
|
23
|
+
/** Live session provider — read per decision so `/setmodel` switches apply. */
|
|
24
|
+
sessionProvider: () => Provider;
|
|
25
|
+
/** Live session model id — read per decision. */
|
|
26
|
+
sessionModel: () => string;
|
|
27
|
+
/**
|
|
28
|
+
* Resolve a NON-default provider id to a Provider instance. May throw or
|
|
29
|
+
* return null; the entry is then skipped.
|
|
30
|
+
*/
|
|
31
|
+
resolveProvider: (providerId: string, model: string) => Provider | null;
|
|
32
|
+
/**
|
|
33
|
+
* Decision-history digest (typically `BrainDecisionLedger.digestFor`) —
|
|
34
|
+
* injected into both the single-LLM and council prompts so the Brain
|
|
35
|
+
* learns from the outcomes of its past similar decisions.
|
|
36
|
+
*/
|
|
37
|
+
getDecisionDigest?: ((request: BrainDecisionRequest) => string | undefined) | undefined;
|
|
38
|
+
}
|
|
39
|
+
export interface BrainTierAssembly {
|
|
40
|
+
/** Single-LLM tier for `TieredBrainArbiterOptions.autonomous`. */
|
|
41
|
+
autonomous: BrainArbiter;
|
|
42
|
+
/** Council tier for `TieredBrainArbiterOptions.council` (undefined = disabled). */
|
|
43
|
+
council: BrainArbiter | undefined;
|
|
44
|
+
/** Live council risk floor for `TieredBrainArbiterOptions.getCouncilMinRisk`. */
|
|
45
|
+
getCouncilMinRisk: () => 'medium' | 'high' | 'critical';
|
|
46
|
+
/** Human-readable pool labels for status surfaces; empty = session model. */
|
|
47
|
+
poolLabels: string[];
|
|
48
|
+
/** Human-readable council seat labels; empty = council disabled. */
|
|
49
|
+
councilLabels: string[];
|
|
50
|
+
}
|
|
51
|
+
/** Assemble the LLM tiers of the Brain chain from `Config.brain`. */
|
|
52
|
+
export declare function assembleBrainTiers(opts: BrainTierAssemblyOptions): BrainTierAssembly;
|
|
53
|
+
//# sourceMappingURL=brain-chain.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brain-chain.d.ts","sourceRoot":"","sources":["../../src/execution/brain-chain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEnF,OAAO,KAAK,EAAE,WAAW,EAAmB,MAAM,oBAAoB,CAAC;AACvE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAWrD,MAAM,WAAW,wBAAwB;IACvC,iFAAiF;IACjF,WAAW,EAAE,WAAW,GAAG,SAAS,CAAC;IACrC,qDAAqD;IACrD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,+EAA+E;IAC/E,eAAe,EAAE,MAAM,QAAQ,CAAC;IAChC,iDAAiD;IACjD,YAAY,EAAE,MAAM,MAAM,CAAC;IAC3B;;;OAGG;IACH,eAAe,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,QAAQ,GAAG,IAAI,CAAC;IACxE;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,oBAAoB,KAAK,MAAM,GAAG,SAAS,CAAC,GAAG,SAAS,CAAC;CACzF;AAED,MAAM,WAAW,iBAAiB;IAChC,kEAAkE;IAClE,UAAU,EAAE,YAAY,CAAC;IACzB,mFAAmF;IACnF,OAAO,EAAE,YAAY,GAAG,SAAS,CAAC;IAClC,iFAAiF;IACjF,iBAAiB,EAAE,MAAM,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;IACxD,6EAA6E;IAC7E,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,oEAAoE;IACpE,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,qEAAqE;AACrE,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,wBAAwB,GAAG,iBAAiB,CAqGpF"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { BrainArbiter, BrainDecision, BrainDecisionRequest } from '../coordination/brain.js';
|
|
2
|
+
export declare const BRAIN_EVALUATION_CASE_VERSION: 1;
|
|
3
|
+
export interface BrainEvaluationExpectations {
|
|
4
|
+
/** Restrict the accepted decision variants for this case. */
|
|
5
|
+
allowedDecisionTypes?: BrainDecision['type'][] | undefined;
|
|
6
|
+
/** Exact option ids that may be selected. Every id must exist in the request. */
|
|
7
|
+
allowedOptionIds?: string[] | undefined;
|
|
8
|
+
/** Options that represent an unsafe allowance and must fail the case. */
|
|
9
|
+
unsafeOptionIds?: string[] | undefined;
|
|
10
|
+
/** Require an answer to carry an exact option id. */
|
|
11
|
+
requireOptionId?: boolean | undefined;
|
|
12
|
+
/** Whether ask_human is acceptable rather than an unnecessary escalation. */
|
|
13
|
+
allowEscalation?: boolean | undefined;
|
|
14
|
+
}
|
|
15
|
+
/** Versioned, JSON-serializable fixture for side-effect-free Brain evaluation. */
|
|
16
|
+
export interface BrainEvaluationCaseV1 {
|
|
17
|
+
version: typeof BRAIN_EVALUATION_CASE_VERSION;
|
|
18
|
+
id: string;
|
|
19
|
+
description?: string | undefined;
|
|
20
|
+
request: BrainDecisionRequest;
|
|
21
|
+
expectations?: BrainEvaluationExpectations | undefined;
|
|
22
|
+
}
|
|
23
|
+
export type BrainEvaluationFailureCode = 'invalid_fixture' | 'arbiter_error' | 'unexpected_decision_type' | 'invalid_option_id' | 'missing_option_id' | 'disallowed_option_id' | 'unsafe_option_id' | 'unexpected_escalation';
|
|
24
|
+
export interface BrainEvaluationFailure {
|
|
25
|
+
code: BrainEvaluationFailureCode;
|
|
26
|
+
message: string;
|
|
27
|
+
}
|
|
28
|
+
export interface BrainEvaluationCaseResult {
|
|
29
|
+
caseId: string;
|
|
30
|
+
passed: boolean;
|
|
31
|
+
decision?: BrainDecision | undefined;
|
|
32
|
+
failures: BrainEvaluationFailure[];
|
|
33
|
+
latencyMs: number;
|
|
34
|
+
}
|
|
35
|
+
export interface BrainEvaluationMetrics {
|
|
36
|
+
totalCases: number;
|
|
37
|
+
passedCases: number;
|
|
38
|
+
failedCases: number;
|
|
39
|
+
optionDecisionCount: number;
|
|
40
|
+
invalidOptionCount: number;
|
|
41
|
+
validOptionRate: number;
|
|
42
|
+
unsafeAllowanceCount: number;
|
|
43
|
+
unnecessaryEscalationCount: number;
|
|
44
|
+
averageLatencyMs: number;
|
|
45
|
+
}
|
|
46
|
+
export interface BrainEvaluationReport {
|
|
47
|
+
version: typeof BRAIN_EVALUATION_CASE_VERSION;
|
|
48
|
+
results: BrainEvaluationCaseResult[];
|
|
49
|
+
metrics: BrainEvaluationMetrics;
|
|
50
|
+
}
|
|
51
|
+
export type BrainEvaluationCaseValidation = {
|
|
52
|
+
ok: true;
|
|
53
|
+
value: BrainEvaluationCaseV1;
|
|
54
|
+
} | {
|
|
55
|
+
ok: false;
|
|
56
|
+
diagnostics: string[];
|
|
57
|
+
};
|
|
58
|
+
/** Validate a fixture loaded from JSON before any arbiter is invoked. */
|
|
59
|
+
export declare function validateBrainEvaluationCase(value: unknown): BrainEvaluationCaseValidation;
|
|
60
|
+
/**
|
|
61
|
+
* Replay evaluation fixtures through a Brain arbiter without applying the
|
|
62
|
+
* returned decisions. The runner has no dispatch, terminate, permission, or
|
|
63
|
+
* tool-execution callback, so a result can only be measured and reported.
|
|
64
|
+
*/
|
|
65
|
+
export declare function runBrainEvaluation(arbiter: BrainArbiter, cases: readonly unknown[]): Promise<BrainEvaluationReport>;
|
|
66
|
+
//# sourceMappingURL=brain-evaluation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brain-evaluation.d.ts","sourceRoot":"","sources":["../../src/execution/brain-evaluation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAElG,eAAO,MAAM,6BAA6B,EAAG,CAAU,CAAC;AAExD,MAAM,WAAW,2BAA2B;IAC1C,6DAA6D;IAC7D,oBAAoB,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,EAAE,GAAG,SAAS,CAAC;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AAE,MAAM,CAAC;IACnC,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,OAAO,6BAA6B,CAAC;IAC9C,OAAO,EAAE,yBAAyB,EAAE,CAAC;IACrC,OAAO,EAAE,sBAAsB,CAAC;CACjC;AAED,MAAM,MAAM,6BAA6B,GACrC;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,qBAAqB,CAAA;CAAE,GAC1C;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,WAAW,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAUzC,yEAAyE;AACzE,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,OAAO,GAAG,6BAA6B,CAsGzF;AA4DD;;;;GAIG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,YAAY,EACrB,KAAK,EAAE,SAAS,OAAO,EAAE,GACxB,OAAO,CAAC,qBAAqB,CAAC,CA0FhC"}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BrainRuntime — the live, rebuildable owner of `config.brain`.
|
|
3
|
+
*
|
|
4
|
+
* The Brain chain used to be assembled once at boot; every knob except the
|
|
5
|
+
* risk ceiling and escalation mode was frozen until restart. This module
|
|
6
|
+
* makes the whole `BrainConfig` surface live-editable AND persistable from
|
|
7
|
+
* any host surface (/brain subcommands, TUI Brain panel, WebUI BrainSection):
|
|
8
|
+
*
|
|
9
|
+
* - `arbiter` is a STABLE delegating handle (`decide` reads a mutable
|
|
10
|
+
* `current`), so hosts wrap it once in their EscalationRouting/Observable
|
|
11
|
+
* layers and no consumer ever needs a rebind after a settings change.
|
|
12
|
+
* - `apply(patch)` normalizes + validates the patch, commits it, rebuilds
|
|
13
|
+
* the tier chain when a structural knob changed (pool, council, timeout,
|
|
14
|
+
* ledger guard), and persists through an injected callback — core never
|
|
15
|
+
* touches config files itself.
|
|
16
|
+
* - `getSnapshot()` is the JSON-safe truth both UIs render: configured
|
|
17
|
+
* values plus derived facts (resolved pool/council labels, EFFECTIVE
|
|
18
|
+
* council enablement, session-model fallback).
|
|
19
|
+
*
|
|
20
|
+
* Persistence contract: `config.brain` is on the in-project deny list, so
|
|
21
|
+
* the injected `persist` MUST write the GLOBAL config. A persist failure
|
|
22
|
+
* never rolls back the live change; it is reported via the returned promise.
|
|
23
|
+
*
|
|
24
|
+
* @module brain-runtime
|
|
25
|
+
*/
|
|
26
|
+
import { type BrainArbiter, type BrainDecisionRequest, type BrainEscalationMode } from '../coordination/brain.js';
|
|
27
|
+
import type { BrainConfig, BrainCouncilVoterConfig, BrainModelEntry } from '../types/config.js';
|
|
28
|
+
import type { Provider } from '../types/provider.js';
|
|
29
|
+
import { type BrainAutoRisk } from './autonomy-brain.js';
|
|
30
|
+
export type BrainCouncilMinRisk = 'medium' | 'high' | 'critical';
|
|
31
|
+
export type BrainPoolStrategy = 'fallback' | 'round-robin';
|
|
32
|
+
/** JSON-safe view of the live Brain configuration + derived facts. */
|
|
33
|
+
export interface BrainConfigSnapshot {
|
|
34
|
+
mode: BrainEscalationMode;
|
|
35
|
+
maxAutoRisk: BrainAutoRisk;
|
|
36
|
+
/** Configured pool entries (normalized). Empty = session model. */
|
|
37
|
+
models: BrainModelEntry[];
|
|
38
|
+
strategy: BrainPoolStrategy;
|
|
39
|
+
decisionTimeoutMs: number | undefined;
|
|
40
|
+
humanTimeoutMs: number | undefined;
|
|
41
|
+
council: {
|
|
42
|
+
/** EFFECTIVE enablement (default rule `voters >= 2` applied). */
|
|
43
|
+
enabled: boolean;
|
|
44
|
+
/** Raw configured value (undefined = default rule decides). */
|
|
45
|
+
configured: boolean | undefined;
|
|
46
|
+
minRisk: BrainCouncilMinRisk;
|
|
47
|
+
/** Explicitly configured voters; seats derived from the pool are visible via `councilLabels`. */
|
|
48
|
+
voters: BrainCouncilVoterConfig[];
|
|
49
|
+
quorum: number | undefined;
|
|
50
|
+
approval: number | undefined;
|
|
51
|
+
judge: BrainModelEntry | undefined;
|
|
52
|
+
};
|
|
53
|
+
ledger: {
|
|
54
|
+
enabled: boolean;
|
|
55
|
+
autoDenyAfterFailures: number | undefined;
|
|
56
|
+
path: string | undefined;
|
|
57
|
+
};
|
|
58
|
+
/** Resolved pool labels from the LAST assembly (may be fewer than `models` — unresolvable refs are skipped). */
|
|
59
|
+
poolLabels: string[];
|
|
60
|
+
/** Resolved council seat labels; empty = council effectively disabled. */
|
|
61
|
+
councilLabels: string[];
|
|
62
|
+
usingSessionModel: boolean;
|
|
63
|
+
}
|
|
64
|
+
/** Council sub-patch. Arrays REPLACE; `null` clears back to the default. */
|
|
65
|
+
export interface BrainCouncilPatch {
|
|
66
|
+
enabled?: boolean | null | undefined;
|
|
67
|
+
minRisk?: BrainCouncilMinRisk | null | undefined;
|
|
68
|
+
voters?: Array<string | BrainCouncilVoterConfig> | null | undefined;
|
|
69
|
+
quorum?: number | null | undefined;
|
|
70
|
+
approval?: number | null | undefined;
|
|
71
|
+
judge?: string | BrainModelEntry | null | undefined;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Partial update for the live Brain config. Omitted fields are untouched,
|
|
75
|
+
* `null` clears a field back to its default, arrays replace wholesale.
|
|
76
|
+
*/
|
|
77
|
+
export interface BrainConfigPatch {
|
|
78
|
+
mode?: BrainEscalationMode | undefined;
|
|
79
|
+
maxAutoRisk?: BrainAutoRisk | undefined;
|
|
80
|
+
models?: Array<string | BrainModelEntry> | null | undefined;
|
|
81
|
+
strategy?: BrainPoolStrategy | null | undefined;
|
|
82
|
+
decisionTimeoutMs?: number | null | undefined;
|
|
83
|
+
humanTimeoutMs?: number | null | undefined;
|
|
84
|
+
council?: BrainCouncilPatch | null | undefined;
|
|
85
|
+
ledger?: {
|
|
86
|
+
enabled?: boolean | undefined;
|
|
87
|
+
autoDenyAfterFailures?: number | null | undefined;
|
|
88
|
+
} | null | undefined;
|
|
89
|
+
}
|
|
90
|
+
/** Host-owned ledger controller — the runtime never touches ledger files. */
|
|
91
|
+
export interface BrainRuntimeLedgerHost {
|
|
92
|
+
getPath: () => string | undefined;
|
|
93
|
+
isEnabled: () => boolean;
|
|
94
|
+
/** Host starts/stops its BrainDecisionLedger instance. */
|
|
95
|
+
setEnabled: (enabled: boolean) => void;
|
|
96
|
+
failureStreakFor?: ((request: Pick<BrainDecisionRequest, 'source' | 'question' | 'id'>) => number) | undefined;
|
|
97
|
+
getDecisionDigest?: ((request: BrainDecisionRequest) => string | undefined) | undefined;
|
|
98
|
+
}
|
|
99
|
+
export interface BrainRuntimeOptions {
|
|
100
|
+
/** Boot-time `config.brain`. Invalid entries are dropped leniently here (apply() is strict). */
|
|
101
|
+
initialConfig: BrainConfig | undefined;
|
|
102
|
+
/** The session's provider id (`config.provider`). */
|
|
103
|
+
defaultProviderId: string;
|
|
104
|
+
/** Live session provider — read per decision so `/setmodel` switches apply. */
|
|
105
|
+
sessionProvider: () => Provider;
|
|
106
|
+
/** Live session model id — read per decision. */
|
|
107
|
+
sessionModel: () => string;
|
|
108
|
+
/** Resolve a NON-default provider id. May throw / return null → entry skipped. */
|
|
109
|
+
resolveProvider: (providerId: string, model: string) => Provider | null;
|
|
110
|
+
ledger?: BrainRuntimeLedgerHost | undefined;
|
|
111
|
+
/**
|
|
112
|
+
* Injected writer for the canonical `BrainConfig`. MUST target the global
|
|
113
|
+
* config (`config.brain` is denied in project scope). Absent = live-only.
|
|
114
|
+
*/
|
|
115
|
+
persist?: ((config: BrainConfig) => Promise<void>) | undefined;
|
|
116
|
+
/** Fired after every successful apply, with the fresh snapshot. */
|
|
117
|
+
onApplied?: ((snapshot: BrainConfigSnapshot) => void) | undefined;
|
|
118
|
+
}
|
|
119
|
+
export interface BrainApplyResult {
|
|
120
|
+
snapshot: BrainConfigSnapshot;
|
|
121
|
+
/** Resolves `{ok: true}` immediately when persistence was skipped or absent. */
|
|
122
|
+
persisted: Promise<{
|
|
123
|
+
ok: boolean;
|
|
124
|
+
error?: string | undefined;
|
|
125
|
+
}>;
|
|
126
|
+
}
|
|
127
|
+
export interface BrainRuntime {
|
|
128
|
+
/** STABLE arbiter handle — the inner tier chain swaps on `apply`. */
|
|
129
|
+
arbiter: BrainArbiter;
|
|
130
|
+
getMode(): BrainEscalationMode;
|
|
131
|
+
getMaxAutoRisk(): BrainAutoRisk;
|
|
132
|
+
getHumanTimeoutMs(): number | undefined;
|
|
133
|
+
getSnapshot(): BrainConfigSnapshot;
|
|
134
|
+
/** Canonical shape written to `config.brain` (compact string refs where lossless). */
|
|
135
|
+
getConfig(): BrainConfig;
|
|
136
|
+
/** Live-apply synchronously; persistence (default on) is async best-effort. */
|
|
137
|
+
apply(patch: BrainConfigPatch, opts?: {
|
|
138
|
+
persist?: boolean | undefined;
|
|
139
|
+
}): BrainApplyResult;
|
|
140
|
+
}
|
|
141
|
+
export interface BrainDefaultsContext {
|
|
142
|
+
/** The session's fallback chain (`config.fallbackModels`) — seeds the default pool. */
|
|
143
|
+
fallbackModels?: readonly string[] | undefined;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Product defaults for hosts that want a minimum-human Brain out of the box
|
|
147
|
+
* (CLI/TUI wiring and the standalone WebUI server both apply this before
|
|
148
|
+
* `createBrainRuntime`). Only FILLS GAPS — every explicitly configured field
|
|
149
|
+
* wins, so existing `config.brain` blocks are untouched by updates.
|
|
150
|
+
*
|
|
151
|
+
* - `models` → the user's own `fallbackModels` chain (never hardcoded
|
|
152
|
+
* model ids; every install has different providers). With ≥2 entries the
|
|
153
|
+
* council auto-derives from the pool, so multi-model users get a council
|
|
154
|
+
* by default.
|
|
155
|
+
* - `mode` → 'headless': decisions never block on a human; the terminal
|
|
156
|
+
* policy (safe default / deny) is the escalation of last resort.
|
|
157
|
+
* - `maxAutoRisk` → adaptive: 'all' when a council can convene (critical
|
|
158
|
+
* questions get a multi-model panel), otherwise 'high' (critical
|
|
159
|
+
* questions resolve via the conservative terminal policy instead of a
|
|
160
|
+
* single unchecked model).
|
|
161
|
+
* - `humanTimeoutMs` → 120s: if the user explicitly switches back to
|
|
162
|
+
* 'interactive', an unanswered prompt still auto-resolves instead of
|
|
163
|
+
* hanging an unattended run forever. Set `humanTimeoutMs: 0` to restore
|
|
164
|
+
* the legacy wait-indefinitely behavior.
|
|
165
|
+
*
|
|
166
|
+
* NOTE deliberately NOT persisted anywhere — resolved at boot, so existing
|
|
167
|
+
* users pick these up on update without any config migration/write.
|
|
168
|
+
*/
|
|
169
|
+
export declare function resolveBrainConfigDefaults(brain: BrainConfig | undefined, ctx?: BrainDefaultsContext): BrainConfig;
|
|
170
|
+
export declare function createBrainRuntime(opts: BrainRuntimeOptions): BrainRuntime;
|
|
171
|
+
//# sourceMappingURL=brain-runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brain-runtime.d.ts","sourceRoot":"","sources":["../../src/execution/brain-runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EAEzB,MAAM,0BAA0B,CAAC;AAGlC,OAAO,KAAK,EAAE,WAAW,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAChG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,KAAK,aAAa,EAA4B,MAAM,qBAAqB,CAAC;AAGnF,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;AACjE,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,aAAa,CAAC;AAE3D,sEAAsE;AACtE,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,mBAAmB,CAAC;IAC1B,WAAW,EAAE,aAAa,CAAC;IAC3B,mEAAmE;IACnE,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,iBAAiB,E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,0BAA0B,CACxC,KAAK,EAAE,WAAW,GAAG,SAAS,EAC9B,GAAG,GAAE,oBAAyB,GAC7B,WAAW,CAWb;AA6BD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,mBAAmB,GAAG,YAAY,CAiP1E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compaction-core.d.ts","sourceRoot":"","sources":["../../src/execution/compaction-core.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EACL,qBAAqB,EAGtB,MAAM,4BAA4B,CAAC;AAkHpC;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,8BAAwB,CAAC;AAEtD;;;;;;;;;;;GAWG;AAEH,kDAAkD;AAClD,wBAAgB,cAAc,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAGlD;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CA8CzF;AAiCD,MAAM,WAAW,WAAW;IAC1B,qEAAqE;IACrE,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,SAAS,OAAO,EAAE,EAC5B,IAAI,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAA;CAAE,GAClD,WAAW,
|
|
1
|
+
{"version":3,"file":"compaction-core.d.ts","sourceRoot":"","sources":["../../src/execution/compaction-core.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EACL,qBAAqB,EAGtB,MAAM,4BAA4B,CAAC;AAkHpC;;;;GAIG;AACH,eAAO,MAAM,gBA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;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,GAAG,MAAM,CAuDrE;AAiCD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAS/F;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAczF"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CouncilBrainArbiter — a multi-LLM decision panel for high-stakes questions.
|
|
3
|
+
*
|
|
4
|
+
* Instead of trusting one model's single completion, the council convenes N
|
|
5
|
+
* independent voters (ideally different models/providers), each with a
|
|
6
|
+
* distinct decision persona:
|
|
7
|
+
*
|
|
8
|
+
* - executor — biased toward forward progress; hates stalling.
|
|
9
|
+
* - skeptic — hunts for the reason the proposed action is wrong; may veto.
|
|
10
|
+
* - auditor — cost/waste/budget lens; hates throwing tokens at dead ends.
|
|
11
|
+
*
|
|
12
|
+
* Votes are cast INDEPENDENTLY (no voter sees another's rationale), then
|
|
13
|
+
* tallied with weights. Resolution ladder:
|
|
14
|
+
*
|
|
15
|
+
* 1. QUORUM — fewer than `quorumFraction` of seats returned a valid vote
|
|
16
|
+
* → the council abstains (`ask_human`), letting the escalation tier
|
|
17
|
+
* (human prompt or headless terminal policy) resolve it.
|
|
18
|
+
* 2. VETO — a veto seat explicitly refusing denies the request outright.
|
|
19
|
+
* 3. MAJORITY — the option with the highest total weight wins when it
|
|
20
|
+
* exceeds `approvalFraction` of all cast weight.
|
|
21
|
+
* 4. JUDGE — ties / weak pluralities go to a judge model that sees every
|
|
22
|
+
* vote's rationale and issues the final structured decision. No judge
|
|
23
|
+
* (or judge failure) → abstain (`ask_human`).
|
|
24
|
+
*
|
|
25
|
+
* Optionless (free-text) requests skip the tally: every voter writes an
|
|
26
|
+
* independent stance and the judge synthesizes the final answer; without a
|
|
27
|
+
* judge, the first valid stance wins.
|
|
28
|
+
*
|
|
29
|
+
* The council NEVER blocks on a human itself — its worst case is an
|
|
30
|
+
* `ask_human` abstention that the outer escalation tier resolves.
|
|
31
|
+
*
|
|
32
|
+
* @module council-brain
|
|
33
|
+
*/
|
|
34
|
+
import type { BrainArbiter, BrainDecision, BrainDecisionRequest } from '../coordination/brain.js';
|
|
35
|
+
import { type BrainLlmTarget } from './autonomy-brain.js';
|
|
36
|
+
/** One voting seat on the council. */
|
|
37
|
+
export interface CouncilVoter extends BrainLlmTarget {
|
|
38
|
+
/**
|
|
39
|
+
* Decision lens. Built-ins: 'executor', 'skeptic', 'auditor'. Any other
|
|
40
|
+
* string is injected verbatim as the persona description.
|
|
41
|
+
*/
|
|
42
|
+
persona?: string | undefined;
|
|
43
|
+
/** Vote weight in the tally. Default 1. */
|
|
44
|
+
weight?: number | undefined;
|
|
45
|
+
/** When true, this seat's explicit refusal denies the request outright. */
|
|
46
|
+
veto?: boolean | undefined;
|
|
47
|
+
}
|
|
48
|
+
export interface CouncilBrainOptions {
|
|
49
|
+
voters: CouncilVoter[];
|
|
50
|
+
/** Tie-breaker / synthesizer. Default: none (ties abstain to escalation). */
|
|
51
|
+
judge?: BrainLlmTarget | undefined;
|
|
52
|
+
/** Fraction of seats that must return a valid vote. Default 0.5. */
|
|
53
|
+
quorumFraction?: number | undefined;
|
|
54
|
+
/** Fraction of cast weight the winning option must EXCEED. Default 0.5. */
|
|
55
|
+
approvalFraction?: number | undefined;
|
|
56
|
+
/** Per-voter (and judge) completion timeout in ms. Default 15000. */
|
|
57
|
+
decisionTimeoutMs?: number | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Decision-history digest (typically `BrainDecisionLedger.digestFor`) —
|
|
60
|
+
* appended to every voter's user message so the panel sees how similar
|
|
61
|
+
* past decisions turned out.
|
|
62
|
+
*/
|
|
63
|
+
getDecisionDigest?: ((request: BrainDecisionRequest) => string | undefined) | undefined;
|
|
64
|
+
/** Called with a human-readable summary after every council decision. */
|
|
65
|
+
onDecision?: ((summary: string, decision: BrainDecision, request: BrainDecisionRequest) => void) | undefined;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Synthetic ballot entry that lets any voter refuse every real option. Kept
|
|
69
|
+
* deliberately awkward so it can never collide with a caller option id; if
|
|
70
|
+
* it somehow does, the synthetic entry is skipped for that request.
|
|
71
|
+
*/
|
|
72
|
+
export declare const COUNCIL_REFUSE_OPTION_ID = "council_refuse";
|
|
73
|
+
/**
|
|
74
|
+
* Create a council-of-LLMs Brain arbiter. See the module docs for the
|
|
75
|
+
* resolution ladder. Positioned by `createTieredBrainArbiter` above the
|
|
76
|
+
* single-LLM tier for requests at/above the council risk floor.
|
|
77
|
+
*/
|
|
78
|
+
export declare function createCouncilBrainArbiter(opts: CouncilBrainOptions): BrainArbiter;
|
|
79
|
+
//# sourceMappingURL=council-brain.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"council-brain.d.ts","sourceRoot":"","sources":["../../src/execution/council-brain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EAEb,oBAAoB,EACrB,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,KAAK,cAAc,EAMpB,MAAM,qBAAqB,CAAC;AAE7B,sCAAsC;AACtC,MAAM,WAAW,YAAa,SAAQ,cAAc;IAClD;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,2CAA2C;IAC3C,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,2EAA2E;IAC3E,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC5B;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,YAAY,EA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