@wrongstack/core 0.300.0 → 0.301.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.
Files changed (144) hide show
  1. package/dist/chronicle/index.d.ts +2 -0
  2. package/dist/chronicle/index.js +297 -10
  3. package/dist/chronicle/project-server.js +253 -15
  4. package/dist/chronicle/sqlite-compaction.d.ts +20 -0
  5. package/dist/chronicle/sqlite-journal.d.ts +57 -0
  6. package/dist/coordination/agents/capability-manifest.d.ts +7 -0
  7. package/dist/coordination/agents/index.d.ts +3 -2
  8. package/dist/coordination/agents/index.js +818 -570
  9. package/dist/coordination/agents/project-agent-identity.d.ts +6 -6
  10. package/dist/coordination/agents/role-skills.d.ts +1 -1
  11. package/dist/coordination/agents/types.d.ts +6 -0
  12. package/dist/coordination/director.d.ts +2 -2
  13. package/dist/coordination/index.js +6778 -6438
  14. package/dist/coordination/mail-tools.d.ts +3 -3
  15. package/dist/coordination/mailbox-project-server.js +3 -4
  16. package/dist/coordination/mailbox-types.d.ts +6 -0
  17. package/dist/core/agent-response.d.ts +5 -1
  18. package/dist/core/agent-tools.d.ts +3 -0
  19. package/dist/core/context.d.ts +20 -0
  20. package/dist/core/index.d.ts +8 -7
  21. package/dist/core/index.js +893 -284
  22. package/dist/core/instruction-template.d.ts +6 -3
  23. package/dist/core/next-steps-slot.d.ts +88 -0
  24. package/dist/core/system-prompt-builder.d.ts +5 -3
  25. package/dist/core/system-prompt-memory-skills.d.ts +1 -0
  26. package/dist/core/system-prompt-skill-bodies.d.ts +3 -3
  27. package/dist/defaults/index.js +9796 -8897
  28. package/dist/design/index.js +11 -3
  29. package/dist/execution/auto-compaction-middleware.d.ts +17 -0
  30. package/dist/execution/autonomy-brain.d.ts +8 -2
  31. package/dist/execution/brain-runtime.d.ts +3 -1
  32. package/dist/execution/compaction-core.d.ts +41 -2
  33. package/dist/execution/council-brain.d.ts +37 -2
  34. package/dist/execution/council-orchestrator.d.ts +2 -2
  35. package/dist/execution/index.d.ts +11 -10
  36. package/dist/execution/index.js +5178 -4077
  37. package/dist/execution/tool-executor.d.ts +4 -1
  38. package/dist/execution/topic-shift-advisor.d.ts +53 -0
  39. package/dist/extension/index.js +8 -2
  40. package/dist/extension/registry.d.ts +8 -1
  41. package/dist/goal/index.js +11 -3
  42. package/dist/hooks/index.js +42 -9
  43. package/dist/hooks/runner.d.ts +12 -1
  44. package/dist/hq/index.js +41 -17
  45. package/dist/hq/publisher.d.ts +21 -3
  46. package/dist/index.d.ts +21 -20
  47. package/dist/index.js +10887 -8053
  48. package/dist/infrastructure/index.js +108 -21
  49. package/dist/kernel/events/session-events.d.ts +13 -0
  50. package/dist/kernel/events/tool-events.d.ts +3 -3
  51. package/dist/models/index.d.ts +1 -0
  52. package/dist/models/index.js +17 -0
  53. package/dist/models/provider-credentials.d.ts +54 -0
  54. package/dist/plugin/index.d.ts +1 -0
  55. package/dist/plugin/index.js +2024 -502
  56. package/dist/plugins/auto-review-plugin.d.ts +3 -0
  57. package/dist/plugins/cloud-config-sync-plugin.d.ts +22 -0
  58. package/dist/plugins/review-claim-registry.d.ts +23 -8
  59. package/dist/plugins/review-types.d.ts +2 -0
  60. package/dist/registry/index.js +109 -74
  61. package/dist/registry/tool-registry.d.ts +15 -0
  62. package/dist/security/capabilities.d.ts +2 -0
  63. package/dist/security/index.d.ts +1 -1
  64. package/dist/security/index.js +9 -2
  65. package/dist/security/readonly-permission-policy.d.ts +20 -0
  66. package/dist/session-registry-atomic-file.d.ts +32 -5
  67. package/dist/skills/frontmatter.d.ts +6 -0
  68. package/dist/skills/index.js +22 -5
  69. package/dist/storage/cloud-config-sync/sanitize.d.ts +54 -0
  70. package/dist/storage/cloud-config-sync.d.ts +87 -0
  71. package/dist/storage/index.d.ts +1 -0
  72. package/dist/storage/index.js +854 -66
  73. package/dist/tools/index.d.ts +1 -1
  74. package/dist/tools/index.js +511 -234
  75. package/dist/tools/one-shot-llm-tool.d.ts +1 -0
  76. package/dist/tools/plugin-manager.d.ts +27 -0
  77. package/dist/types/config/mcp-features.d.ts +18 -11
  78. package/dist/types/config/root.d.ts +8 -1
  79. package/dist/types/config/runtime.d.ts +20 -6
  80. package/dist/types/config/skills-fleet-brain.d.ts +12 -4
  81. package/dist/types/config/tools.d.ts +16 -0
  82. package/dist/types/context-window.d.ts +1 -0
  83. package/dist/types/hooks.d.ts +14 -0
  84. package/dist/types/index.d.ts +2 -2
  85. package/dist/types/index.js +1 -0
  86. package/dist/types/multi-agent.d.ts +2 -0
  87. package/dist/types/one-shot-llm.d.ts +16 -0
  88. package/dist/types/provider.d.ts +16 -0
  89. package/dist/types/runtime-capability-manifest.d.ts +168 -0
  90. package/dist/types/skill.d.ts +5 -0
  91. package/dist/types/system-prompt.d.ts +3 -1
  92. package/dist/types/tool-executor.d.ts +8 -1
  93. package/dist/utils/context-breakdown.d.ts +8 -2
  94. package/dist/utils/index.d.ts +1 -1
  95. package/dist/utils/index.js +141 -31
  96. package/dist/utils/regex-guard.d.ts +16 -2
  97. package/dist/utils/sage-output-block.d.ts +7 -10
  98. package/dist/utils/wstack-paths.d.ts +11 -3
  99. package/instructions/agents/browser.md +1 -4
  100. package/instructions/agents/e2e.md +17 -15
  101. package/instructions/agents/ios.md +3 -3
  102. package/instructions/agents/search.md +1 -1
  103. package/instructions/autonomy/goal-preamble.md +4 -4
  104. package/instructions/coordination/director-preamble.md +2 -3
  105. package/instructions/coordination/subagent-baseline.md +3 -1
  106. package/instructions/leader-after-task.md +12 -0
  107. package/instructions/llm/chimera-review.md +1 -1
  108. package/instructions/modes/audit-lite.md +1 -1
  109. package/instructions/sections/tool/common-patterns.md +18 -2
  110. package/instructions/sections/tool/mailbox-compact.md +1 -1
  111. package/instructions/sections/tool/mailbox-full.md +1 -1
  112. package/instructions/system-lite.md +10 -0
  113. package/instructions/system-pro.md +23 -14
  114. package/instructions/system.md +22 -13
  115. package/package.json +3 -3
  116. package/skills/api-design/SKILL.md +3 -0
  117. package/skills/audit-log/SKILL.md +2 -0
  118. package/skills/auto-review/SKILL.md +6 -1
  119. package/skills/bug-hunter/SKILL.md +4 -1
  120. package/skills/chimera/SKILL.md +3 -0
  121. package/skills/data-governance/SKILL.md +3 -0
  122. package/skills/design-system/SKILL.md +5 -2
  123. package/skills/docker-deploy/SKILL.md +2 -0
  124. package/skills/git-flow/SKILL.md +2 -0
  125. package/skills/mailbox-bridge/SKILL.md +3 -0
  126. package/skills/mnemosyne/SKILL.md +2 -0
  127. package/skills/multi-agent/SKILL.md +4 -1
  128. package/skills/node-modern/SKILL.md +4 -1
  129. package/skills/observability/SKILL.md +3 -0
  130. package/skills/output-standards/SKILL.md +2 -0
  131. package/skills/plugin-author/SKILL.md +4 -1
  132. package/skills/prompt-engineering/SKILL.md +3 -1
  133. package/skills/react-modern/SKILL.md +6 -3
  134. package/skills/refactor-planner/SKILL.md +2 -0
  135. package/skills/research-web/SKILL.md +3 -0
  136. package/skills/sdd/SKILL.md +3 -1
  137. package/skills/security-scanner/SKILL.md +3 -0
  138. package/skills/skill-creator/SKILL.md +2 -0
  139. package/skills/tech-stack/SKILL.md +3 -0
  140. package/skills/testing/SKILL.md +4 -1
  141. package/skills/typescript-strict/SKILL.md +4 -1
  142. package/skills/wrongstack-kanban/SKILL.md +6 -3
  143. package/skills/wrongstack-mailbox/SKILL.md +4 -1
  144. package/skills/wrongstack-mailbox-mcp/SKILL.md +10 -8
@@ -66,6 +66,9 @@ function canonicalProjectRoot(absRoot) {
66
66
  const commonDirFile = path.join(gitDir, "commondir");
67
67
  if (!fs.statSync(commonDirFile).isFile()) return checkoutRoot;
68
68
  const commonDir = path.resolve(gitDir, fs.readFileSync(commonDirFile, "utf8").trim());
69
+ const worktreesDir = path.dirname(gitDir);
70
+ if (path.basename(worktreesDir).toLowerCase() !== "worktrees") return checkoutRoot;
71
+ if (path.resolve(worktreesDir, "..") !== commonDir) return checkoutRoot;
69
72
  if (path.basename(commonDir).toLowerCase() !== ".git") return checkoutRoot;
70
73
  return path.dirname(commonDir);
71
74
  } catch {
@@ -88,7 +91,7 @@ function safeProfileName(name) {
88
91
  const safe = (name ?? "").replace(/[/\\:]/g, "_").replace(/\.\./g, "_").trim();
89
92
  return safe || "default";
90
93
  }
91
- function activeProfileName(globalRoot) {
94
+ function bootstrapProfileName(globalRoot) {
92
95
  try {
93
96
  const parsed = JSON.parse(fs.readFileSync(path.join(globalRoot, "config.json"), "utf8"));
94
97
  return safeProfileName(
@@ -106,7 +109,7 @@ function wstackGlobalRoot() {
106
109
  function resolveWstackPaths(opts) {
107
110
  const globalRoot = opts.globalRoot ?? (opts.userHome ? path.join(opts.userHome, ".wrongstack") : wstackGlobalRoot());
108
111
  const homeDir = opts.userHome ?? os.homedir();
109
- const profileName = safeProfileName(opts.profileName ?? activeProfileName(globalRoot));
112
+ const profileName = safeProfileName(opts.profileName ?? bootstrapProfileName(globalRoot));
110
113
  const profileDir = path.join(globalRoot, "profiles", profileName);
111
114
  const hash = projectHash(opts.projectRoot);
112
115
  const slug = projectSlug(opts.projectRoot);
@@ -176,7 +179,12 @@ function resolveWstackPaths(opts) {
176
179
  projectRequirementIntakes: path.join(projectDir, "requirement-intakes"),
177
180
  syncConfig: path.join(profileDir, "sync.json"),
178
181
  configHistoryDir: path.join(globalRoot, "config-history"),
179
- projectStatus: (projectHash2) => path.join(globalRoot, "projects", projectHash2, "status.json")
182
+ projectStatus: (statusProjectSlug) => {
183
+ if (!/^[a-z0-9](?:[a-z0-9-]{0,39})-[a-f0-9]{6}$/.test(statusProjectSlug)) {
184
+ throw new Error(`Invalid project slug: ${statusProjectSlug}`);
185
+ }
186
+ return path.join(globalRoot, "projects", statusProjectSlug, "status.json");
187
+ }
180
188
  };
181
189
  }
182
190
 
@@ -138,6 +138,8 @@ export declare class AutoCompactionMiddleware {
138
138
  * the caller falls back to a fresh walk.
139
139
  */
140
140
  private tryStashedTokens;
141
+ /** Invalidate every token view derived from the pre-rewrite conversation. */
142
+ private invalidateTokenCaches;
141
143
  /**
142
144
  * Returns true when the previous compaction at the same or higher pressure
143
145
  * level reduced nothing and context has not grown materially since. Prevents
@@ -158,6 +160,21 @@ export declare class AutoCompactionMiddleware {
158
160
  private emergencyTrim;
159
161
  /** Preserve-window size from the active policy, defaulting to 6 recent pairs. */
160
162
  private resolvePreserveK;
163
+ /**
164
+ * Aggregate raw acknowledged tool-I/O budget from the active mode.
165
+ *
166
+ * `eliseThreshold` remains the per-result baseline. Multiplying it by the
167
+ * preserve window gives recent multi-tool investigations breathing room;
168
+ * the 12% context cap prevents deep mode or huge custom thresholds from
169
+ * turning that room into another unbounded prompt owner.
170
+ */
171
+ private resolveToolResultRetention;
172
+ /**
173
+ * Number of recent completed tool exchanges kept as semantic receipts.
174
+ * Four receipts per preserve slot retains a useful investigation trail; the
175
+ * absolute bounds keep frugal mode useful and deep mode finite.
176
+ */
177
+ private resolveToolReceiptRetention;
161
178
  }
162
179
  export {};
163
180
  //# sourceMappingURL=auto-compaction-middleware.d.ts.map
@@ -26,11 +26,11 @@
26
26
  * onDecision: (summary) => journal.push(summary),
27
27
  * });
28
28
  */
29
- import type { Provider, Usage } from '../types/provider.js';
30
29
  import { type BrainArbiter, type BrainDecision, type BrainDecisionRequest } from '../coordination/brain.js';
31
30
  import { type BrainHeuristicsConfig } from '../coordination/brain-heuristics.js';
32
- import type { BrainCircuitBreaker } from './brain-circuit.js';
33
31
  import type { EventBus } from '../kernel/events.js';
32
+ import type { Provider, ResponseFormat, Usage } from '../types/provider.js';
33
+ import type { BrainCircuitBreaker } from './brain-circuit.js';
34
34
  /** One (provider, model) pair the Brain may call for a decision. */
35
35
  export interface BrainLlmTarget {
36
36
  provider: Provider;
@@ -249,6 +249,12 @@ export declare function completeBrainLlmDetailed(target: BrainLlmTarget, input:
249
249
  user: string;
250
250
  timeoutMs: number;
251
251
  maxTokens?: number | undefined;
252
+ /**
253
+ * Wire-level response format (e.g. json_object). Callers that parse the
254
+ * response as JSON (the council seats) must pass this through — prompt
255
+ * wording alone does not put a provider into JSON mode.
256
+ */
257
+ responseFormat?: ResponseFormat | undefined;
252
258
  signal?: AbortSignal | undefined;
253
259
  }): Promise<BrainLlmCallResult>;
254
260
  /**
@@ -25,8 +25,8 @@
25
25
  */
26
26
  import { type BrainArbiter, type BrainDecisionRequest, type BrainEscalationMode, type BrainTerminalPolicy } from '../coordination/brain.js';
27
27
  import type { BrainHeuristicsConfig } from '../coordination/brain-heuristics.js';
28
- import type { EventBus } from '../kernel/events.js';
29
28
  import { type BrainRule } from '../coordination/brain-rules.js';
29
+ import type { EventBus } from '../kernel/events.js';
30
30
  import type { BrainConfig, BrainCouncilVoterConfig, BrainModelEntry } from '../types/config.js';
31
31
  import type { Provider } from '../types/provider.js';
32
32
  import { type BrainAutoRisk } from './autonomy-brain.js';
@@ -55,6 +55,7 @@ export interface BrainConfigSnapshot {
55
55
  perCallTimeoutMs: number | undefined;
56
56
  maxConcurrency: number | undefined;
57
57
  distinctness: 'none' | 'model' | 'provider';
58
+ voterMaxTokens: number | undefined;
58
59
  judgeMaxTokens: number | undefined;
59
60
  seats: Array<{
60
61
  persona: string;
@@ -152,6 +153,7 @@ export interface BrainCouncilPatch {
152
153
  perCallTimeoutMs?: number | null | undefined;
153
154
  maxConcurrency?: number | null | undefined;
154
155
  distinctness?: 'none' | 'model' | 'provider' | null | undefined;
156
+ voterMaxTokens?: number | null | undefined;
155
157
  judgeMaxTokens?: number | null | undefined;
156
158
  seats?: Array<{
157
159
  persona: string;
@@ -1,7 +1,7 @@
1
- import type { Message } from '../types/messages.js';
2
1
  import type { Logger } from '../types/logger.js';
2
+ import type { Message } from '../types/messages.js';
3
3
  import { estimateMessageTokens } from '../utils/token-estimate.js';
4
- export { buildSmartDigest, extractText, hasLargeToolResult, hasToolUse, scoreMessage, type ContentScore, } from './compaction-scoring.js';
4
+ export { buildSmartDigest, type ContentScore, extractText, hasLargeToolResult, hasToolUse, scoreMessage, } from './compaction-scoring.js';
5
5
  /** Set the module-level compaction debug logger (called by compactor constructors). */
6
6
  export declare function setCompactionDebugLogger(logger: Logger | undefined): void;
7
7
  /**
@@ -42,6 +42,45 @@ export interface EliseResult {
42
42
  saved: number;
43
43
  changed: boolean;
44
44
  }
45
+ export interface AcknowledgedToolResultElision extends EliseResult {
46
+ /** Raw tool-result blocks replaced with compact receipts. */
47
+ elidedResults: number;
48
+ /** Raw acknowledged tool I/O left verbatim after the pass. */
49
+ retainedTokens: number;
50
+ }
51
+ export interface AcknowledgedToolReceiptCollapse extends EliseResult {
52
+ /** Complete acknowledged tool exchanges folded into the bounded digest. */
53
+ collapsedPairs: number;
54
+ }
55
+ /**
56
+ * Bound raw tool I/O that the model has already consumed successfully.
57
+ *
58
+ * A result is acknowledged only when a later assistant message exists. The
59
+ * trailing tool-result batch therefore stays verbatim until it has actually
60
+ * reached the provider; retries and recovered sessions cannot lose the input
61
+ * needed for their next request. Among acknowledged pairs, the newest raw
62
+ * payloads share `maxRetainedTokens`; older or individually oversized pairs
63
+ * become semantic receipts while their exact payload remains in the session
64
+ * log. Tool ids and provider metadata stay intact so strict provider replay
65
+ * adjacency remains valid.
66
+ */
67
+ export declare function eliseAcknowledgedToolResults(messages: readonly Message[], opts: {
68
+ maxRetainedTokens: number;
69
+ }): AcknowledgedToolResultElision;
70
+ /**
71
+ * Bound the number of acknowledged tool-protocol pairs retained in history.
72
+ *
73
+ * Raw payload elision bounds bytes, but every receipt still leaves an
74
+ * assistant tool_use message and a user tool_result message behind. Long
75
+ * autonomous sessions therefore continued to grow linearly in protocol
76
+ * shells. This pass keeps the newest `maxPairs`, removes both halves of older
77
+ * pairs, drops thinking that existed solely to authorize an omitted tool call,
78
+ * and folds the count into one stable system digest. Surrounding assistant or
79
+ * user text is preserved.
80
+ */
81
+ export declare function collapseAcknowledgedToolReceipts(messages: readonly Message[], opts: {
82
+ maxPairs: number;
83
+ }): AcknowledgedToolReceiptCollapse;
45
84
  /**
46
85
  * Elide oversized tool I/O that falls before the preserve window. Pure:
47
86
  * returns a fresh array (or the same reference when unchanged). Replaces the
@@ -19,10 +19,10 @@
19
19
  * @module council-brain
20
20
  */
21
21
  import type { BrainArbiter, BrainDecisionRequest } from '../coordination/brain.js';
22
- import { type BrainLlmTarget } from './autonomy-brain.js';
23
22
  import type { EventBus } from '../kernel/events.js';
24
23
  import type { CouncilLLMCaller } from '../types/council.js';
25
24
  import type { Provider } from '../types/provider.js';
25
+ import { type BrainLlmTarget } from './autonomy-brain.js';
26
26
  /**
27
27
  * Refusal option id used by the Brain adapter. Re-exported from the
28
28
  * orchestrator so both layers share a single source of truth.
@@ -55,12 +55,25 @@ export interface CouncilBrainOptions {
55
55
  quorumFraction?: number | undefined;
56
56
  /** Winning option weight must exceed this fraction. Default 0.5. */
57
57
  approvalFraction?: number | undefined;
58
- /** Per-voter completion timeout in ms. Default 15 000. */
58
+ /**
59
+ * Per-voter completion timeout in ms. Default
60
+ * {@link BRAIN_COUNCIL_DEFAULT_PER_CALL_TIMEOUT_MS} (45s) — a council
61
+ * convenes for high-stakes decisions only, and reasoning models routinely
62
+ * take longer than the single-LLM tier's 15s before their first token.
63
+ */
59
64
  decisionTimeoutMs?: number | undefined;
60
65
  /** Seats polled concurrently, 1..8. Default 3 (the orchestrator's default). */
61
66
  maxConcurrency?: number | undefined;
62
67
  /** Panel-diversity warning policy. Default 'none'. */
63
68
  distinctness?: 'none' | 'model' | 'provider' | undefined;
69
+ /**
70
+ * Output budget per voter seat call. Default
71
+ * {@link BRAIN_COUNCIL_DEFAULT_VOTER_MAX_TOKENS}. Reasoning models spend
72
+ * their thinking tokens from this same budget, so the orchestrator's
73
+ * generic 300-token default starves them into `invalid` votes (empty or
74
+ * truncated JSON).
75
+ */
76
+ voterMaxTokens?: number | undefined;
64
77
  /** Output budget for the judge call. */
65
78
  judgeMaxTokens?: number | undefined;
66
79
  /** Optional digest of past decisions for context. */
@@ -77,6 +90,28 @@ export interface CouncilBrainOptions {
77
90
  */
78
91
  traceContent?: boolean | undefined;
79
92
  }
93
+ /**
94
+ * Default output budget per Brain-council voter seat.
95
+ *
96
+ * Deliberately larger than the orchestrator's generic 300-token default
97
+ * (`DEFAULT_COUNCIL_VOTER_MAX_TOKENS`): a vote is still just one optionId
98
+ * plus a short rationale, but reasoning models (deepseek-v4, glm, kimi, …)
99
+ * burn their chain-of-thought from the same `maxTokens` budget before any
100
+ * visible text appears. 300 reliably produced empty/truncated responses →
101
+ * `invalid` votes; 2000 leaves room to think and answer. Override via
102
+ * `brain.council.voterMaxTokens`.
103
+ */
104
+ export declare const BRAIN_COUNCIL_DEFAULT_VOTER_MAX_TOKENS = 2000;
105
+ /**
106
+ * Default per-seat completion timeout for the Brain council.
107
+ *
108
+ * Deliberately larger than the single-LLM tier's 15s: the council only
109
+ * convenes for high-stakes questions, and reasoning models on the panel
110
+ * often need more than 15s before their first visible token — at 15s they
111
+ * surfaced as `failed` seats on every convene. Override via
112
+ * `brain.council.perCallTimeoutMs` (or `brain.decisionTimeoutMs`).
113
+ */
114
+ export declare const BRAIN_COUNCIL_DEFAULT_PER_CALL_TIMEOUT_MS = 45000;
80
115
  /**
81
116
  * Build the per-seat LLM caller that wraps `completeBrainLlmDetailed` for
82
117
  * one BrainLlmTarget. Exported so tests can drive the exact production
@@ -1,8 +1,8 @@
1
+ import type { FallbackProfileManager } from '../core/fallback-profile-manager.js';
2
+ import type { Config } from '../types/config.js';
1
3
  import type { CouncilLLMCaller, CouncilQuestion, CouncilResult } from '../types/council.js';
2
4
  import { type CouncilPersonaRegistry } from './council-personas.js';
3
5
  import { type CouncilProfileRegistry } from './council-profiles.js';
4
- import type { FallbackProfileManager } from '../core/fallback-profile-manager.js';
5
- import type { Config } from '../types/config.js';
6
6
  /** Synthetic ballot entry for "refuse every real option". */
7
7
  export declare const COUNCIL_REFUSAL_OPTION_ID = "council_refuse";
8
8
  export declare const DEFAULT_COUNCIL_MAX_CONCURRENCY = 3;
@@ -1,34 +1,35 @@
1
1
  export { AutoCompactionMiddleware, type ContextWindowBudgetSnapshot, } from './auto-compaction-middleware.js';
2
- export { installSubagentAutoCompaction } from './subagent-compaction.js';
3
2
  export { AutonomousRunner, type AutonomousRunnerOptions, type DoneCheckResult, DoneConditionChecker, } from './autonomous-runner.js';
4
3
  export { type AutonomyBrainOptions, type BrainAutoRisk, type BrainLlmTarget, buildBrainUserMessage, completeBrainLlm, createAutonomyBrain, createTieredBrainArbiter, formatDecisionSummary, parseOptionDecision, type TieredBrainArbiterOptions, } from './autonomy-brain.js';
4
+ export { type AutonomyPromptContributorOptions, makeAutonomyPromptContributor, } from './autonomy-prompt-contributor.js';
5
5
  export { assembleBrainTiers, type BrainTierAssembly, type BrainTierAssemblyOptions, } from './brain-chain.js';
6
6
  export { BRAIN_EVALUATION_CASE_VERSION, type BrainEvaluationCaseResult, type BrainEvaluationCaseV1, type BrainEvaluationCaseValidation, type BrainEvaluationExpectations, type BrainEvaluationFailure, type BrainEvaluationFailureCode, type BrainEvaluationMetrics, type BrainEvaluationReport, runBrainEvaluation, validateBrainEvaluationCase, } from './brain-evaluation.js';
7
7
  export { type BrainApplyResult, type BrainConfigPatch, type BrainConfigSnapshot, type BrainCouncilMinRisk, type BrainCouncilPatch, type BrainDefaultsContext, type BrainPoolStrategy, type BrainRuntime, type BrainRuntimeLedgerHost, type BrainRuntimeOptions, createBrainRuntime, resolveBrainConfigDefaults, } from './brain-runtime.js';
8
+ export { type CompactorOptions, HybridCompactor } from './compactor.js';
8
9
  export { COUNCIL_REFUSE_OPTION_ID, type CouncilBrainOptions, type CouncilVoter, createCouncilBrainArbiter, } from './council-brain.js';
9
- export { type CouncilResolution, type CouncilResolutionInput, type CouncilResolutionSeat, type CouncilResolutionVote, resolveCouncilVotes, } from './council-resolution.js';
10
+ export { COUNCIL_REFUSAL_OPTION_ID, CouncilOrchestrator, type CouncilOrchestratorOptions, DEFAULT_COUNCIL_MAX_CONCURRENCY, MAX_COUNCIL_CONCURRENCY, } from './council-orchestrator.js';
10
11
  export { BUILTIN_COUNCIL_PERSONA_IDS, BUILTIN_COUNCIL_PERSONAS, CouncilPersonaRegistry, createCouncilPersonaRegistry, DEFAULT_COUNCIL_PERSONA_REGISTRY, } from './council-personas.js';
11
12
  export { BUILTIN_COUNCIL_PROFILES, CouncilProfileRegistry, createCouncilProfileRegistry, DEFAULT_COUNCIL_APPROVAL_FRACTION, DEFAULT_COUNCIL_JUDGE_MAX_TOKENS, DEFAULT_COUNCIL_OVERALL_TIMEOUT_MS, DEFAULT_COUNCIL_PER_CALL_TIMEOUT_MS, DEFAULT_COUNCIL_PROFILE_REGISTRY, DEFAULT_COUNCIL_QUORUM_FRACTION, DEFAULT_COUNCIL_VOTER_MAX_TOKENS, normalizeCouncilProfile, resolveCouncilProfile, } from './council-profiles.js';
12
13
  export { buildCouncilJudgeSystemPrompt, buildCouncilJudgeUserPrompt, buildCouncilQuestionPrompt, buildCouncilVoterSystemPrompt, buildCouncilVoterUserPrompt, COUNCIL_JUDGE_PROMPT_PATH, COUNCIL_VOTER_PROMPT_PATH, } from './council-prompts.js';
13
- export { COUNCIL_REFUSAL_OPTION_ID, CouncilOrchestrator, type CouncilOrchestratorOptions, DEFAULT_COUNCIL_MAX_CONCURRENCY, MAX_COUNCIL_CONCURRENCY, } from './council-orchestrator.js';
14
- export { type AutonomyPromptContributorOptions, makeAutonomyPromptContributor, } from './autonomy-prompt-contributor.js';
15
- export { type CompactorOptions, HybridCompactor } from './compactor.js';
14
+ export { type CouncilResolution, type CouncilResolutionInput, type CouncilResolutionSeat, type CouncilResolutionVote, resolveCouncilVotes, } from './council-resolution.js';
16
15
  export { activateDesign, clearActiveKit, detectFrontendFile, detectFrontendIntent, getDesignState, installDesignStudioMiddleware, makeDesignDetectToolCallMiddleware, makeDesignDetectUserInputMiddleware, makeDesignStudioRequestMiddleware, setActiveKit, } from './design-detect.js';
17
16
  export { _resetDesignKitLoaderMemo, DefaultDesignKitLoader, type DesignKitLoaderOptions, getDesignKitLoader, resolveBundledDesignKitsDir, } from './design-kit-loader.js';
18
17
  export { _resetDesignRulesCache, clearPersistedActiveKit, designProjectDir, loadActiveKit, loadProjectDesignRules, type PersistedActiveKit, recordKitChoice, } from './design-project-store.js';
18
+ export { nextEnhanceTimeout, resolveConfiguredRefinerRef, resolveEnhanceFallbackRef, } from './enhance-recovery.js';
19
19
  export { buildRecoveryStrategies, DEFAULT_RECOVERY_STRATEGIES, DefaultErrorHandler, type RecoveryStrategy, } from './error-handler.js';
20
20
  export { EternalAutonomyEngine, type EternalAutonomyOptions, type EternalEngineState, type IterationStage, } from './eternal-autonomy.js';
21
21
  export { buildGoalPreamble } from './goal-preamble.js';
22
22
  export { IntelligentCompactor, type IntelligentCompactorOptions } from './intelligent-compactor.js';
23
- export { applyModelRuntime, mergeModelRuntime, type ModelRuntimeMiddlewareOptions, type ResolvedModelRuntime, resolveCacheForRequest, resolveModelRuntime, resolveReasoningForRequest, } from './model-runtime.js';
23
+ export { applyModelRuntime, type ModelRuntimeMiddlewareOptions, mergeModelRuntime, type ResolvedModelRuntime, resolveCacheForRequest, resolveModelRuntime, resolveReasoningForRequest, } from './model-runtime.js';
24
+ export { OneShotOrchestrator } from './one-shot-llm.js';
24
25
  export { type ParallelEngineState, ParallelEternalEngine, type ParallelEternalOptions, type ParallelIterationStage, } from './parallel-eternal-engine.js';
26
+ export { buildRefinerContextSections, DEFAULT_REFINER_RETRY_FEEDBACK, type EnhanceFailureKind, enhanceUserPrompt, gatedEnhancerReasoning, isValidEnglishRefinement, normalizedEqual, parseBilingualEnhancement, recentTextTurns, shouldEnhance, } from './prompt-enhancer.js';
27
+ export { DefaultPromptLoader, type PromptLoaderOptions, renderPrompt } from './prompt-loader.js';
25
28
  export { DefaultRetryPolicy } from './retry-policy.js';
26
29
  export { SelectiveCompactor, type SelectiveCompactorOptions } from './selective-compactor.js';
27
30
  export { DefaultSkillLoader, type SkillLoaderOptions } from './skill-loader.js';
28
- export { DefaultPromptLoader, type PromptLoaderOptions, renderPrompt } from './prompt-loader.js';
29
31
  export { type CompactorStrategy, createStrategyCompactor, type StrategyCompactorOptions, } from './strategy-compactor.js';
32
+ export { installSubagentAutoCompaction } from './subagent-compaction.js';
30
33
  export { ToolExecutor } from './tool-executor.js';
31
- export { OneShotOrchestrator } from './one-shot-llm.js';
32
- export { buildRefinerContextSections, DEFAULT_REFINER_RETRY_FEEDBACK, enhanceUserPrompt, gatedEnhancerReasoning, type EnhanceFailureKind, isValidEnglishRefinement, normalizedEqual, parseBilingualEnhancement, recentTextTurns, shouldEnhance, } from './prompt-enhancer.js';
33
- export { nextEnhanceTimeout, resolveConfiguredRefinerRef, resolveEnhanceFallbackRef, } from './enhance-recovery.js';
34
+ export { startFreshTopicContext, type TopicShiftAdvice, TopicShiftAdvisor, type TopicShiftAdvisorInput, type TopicShiftAdvisorOptions, } from './topic-shift-advisor.js';
34
35
  //# sourceMappingURL=index.d.ts.map