@pellux/goodvibes-sdk 0.37.2 → 0.38.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 (159) hide show
  1. package/dist/contracts/artifacts/operator-contract.json +1 -1
  2. package/dist/events/communication.d.ts +21 -1
  3. package/dist/events/communication.d.ts.map +1 -1
  4. package/dist/platform/agents/message-bus-core.d.ts +7 -0
  5. package/dist/platform/agents/message-bus-core.d.ts.map +1 -1
  6. package/dist/platform/agents/message-bus-core.js +2 -1
  7. package/dist/platform/agents/orchestrator-runner.d.ts +37 -1
  8. package/dist/platform/agents/orchestrator-runner.d.ts.map +1 -1
  9. package/dist/platform/agents/orchestrator-runner.js +158 -7
  10. package/dist/platform/agents/orchestrator.d.ts +40 -0
  11. package/dist/platform/agents/orchestrator.d.ts.map +1 -1
  12. package/dist/platform/agents/orchestrator.js +29 -0
  13. package/dist/platform/agents/turn-knowledge-injection.d.ts +107 -0
  14. package/dist/platform/agents/turn-knowledge-injection.d.ts.map +1 -0
  15. package/dist/platform/agents/turn-knowledge-injection.js +152 -0
  16. package/dist/platform/agents/wrfc-controller.d.ts +23 -0
  17. package/dist/platform/agents/wrfc-controller.d.ts.map +1 -1
  18. package/dist/platform/agents/wrfc-controller.js +55 -0
  19. package/dist/platform/config/manager.d.ts +9 -0
  20. package/dist/platform/config/manager.d.ts.map +1 -1
  21. package/dist/platform/config/manager.js +15 -0
  22. package/dist/platform/core/adaptive-planner.d.ts +50 -0
  23. package/dist/platform/core/adaptive-planner.d.ts.map +1 -1
  24. package/dist/platform/core/adaptive-planner.js +49 -0
  25. package/dist/platform/core/index.d.ts +1 -0
  26. package/dist/platform/core/index.d.ts.map +1 -1
  27. package/dist/platform/core/index.js +1 -0
  28. package/dist/platform/core/orchestrator-runtime.d.ts +11 -0
  29. package/dist/platform/core/orchestrator-runtime.d.ts.map +1 -1
  30. package/dist/platform/core/orchestrator-turn-loop.d.ts +28 -1
  31. package/dist/platform/core/orchestrator-turn-loop.d.ts.map +1 -1
  32. package/dist/platform/core/orchestrator-turn-loop.js +115 -3
  33. package/dist/platform/core/orchestrator.d.ts +61 -0
  34. package/dist/platform/core/orchestrator.d.ts.map +1 -1
  35. package/dist/platform/core/orchestrator.js +74 -1
  36. package/dist/platform/core/plan-proposal.d.ts +165 -0
  37. package/dist/platform/core/plan-proposal.d.ts.map +1 -0
  38. package/dist/platform/core/plan-proposal.js +296 -0
  39. package/dist/platform/knowledge/knowledge-api.d.ts +26 -0
  40. package/dist/platform/knowledge/knowledge-api.d.ts.map +1 -1
  41. package/dist/platform/knowledge/knowledge-api.js +11 -0
  42. package/dist/platform/orchestration/budget.d.ts +22 -0
  43. package/dist/platform/orchestration/budget.d.ts.map +1 -0
  44. package/dist/platform/orchestration/budget.js +35 -0
  45. package/dist/platform/orchestration/cancellation.d.ts +31 -0
  46. package/dist/platform/orchestration/cancellation.d.ts.map +1 -0
  47. package/dist/platform/orchestration/cancellation.js +25 -0
  48. package/dist/platform/orchestration/controller-compat.d.ts +32 -0
  49. package/dist/platform/orchestration/controller-compat.d.ts.map +1 -0
  50. package/dist/platform/orchestration/controller-compat.js +13 -0
  51. package/dist/platform/orchestration/dirty-guard.d.ts +32 -0
  52. package/dist/platform/orchestration/dirty-guard.d.ts.map +1 -0
  53. package/dist/platform/orchestration/dirty-guard.js +147 -0
  54. package/dist/platform/orchestration/engine.d.ts +57 -0
  55. package/dist/platform/orchestration/engine.d.ts.map +1 -0
  56. package/dist/platform/orchestration/engine.js +418 -0
  57. package/dist/platform/orchestration/index.d.ts +18 -0
  58. package/dist/platform/orchestration/index.d.ts.map +1 -0
  59. package/dist/platform/orchestration/index.js +10 -0
  60. package/dist/platform/orchestration/persistence.d.ts +24 -0
  61. package/dist/platform/orchestration/persistence.d.ts.map +1 -0
  62. package/dist/platform/orchestration/persistence.js +176 -0
  63. package/dist/platform/orchestration/phase-runner.d.ts +87 -0
  64. package/dist/platform/orchestration/phase-runner.d.ts.map +1 -0
  65. package/dist/platform/orchestration/phase-runner.js +274 -0
  66. package/dist/platform/orchestration/scheduler.d.ts +45 -0
  67. package/dist/platform/orchestration/scheduler.d.ts.map +1 -0
  68. package/dist/platform/orchestration/scheduler.js +57 -0
  69. package/dist/platform/orchestration/types.d.ts +250 -0
  70. package/dist/platform/orchestration/types.d.ts.map +1 -0
  71. package/dist/platform/orchestration/types.js +15 -0
  72. package/dist/platform/runtime/emitters/communication.d.ts +11 -0
  73. package/dist/platform/runtime/emitters/communication.d.ts.map +1 -1
  74. package/dist/platform/runtime/emitters/communication.js +9 -0
  75. package/dist/platform/runtime/feature-flags/flags.d.ts.map +1 -1
  76. package/dist/platform/runtime/feature-flags/flags.js +17 -0
  77. package/dist/platform/runtime/fleet/adapters/agent.d.ts +56 -0
  78. package/dist/platform/runtime/fleet/adapters/agent.d.ts.map +1 -0
  79. package/dist/platform/runtime/fleet/adapters/agent.js +143 -0
  80. package/dist/platform/runtime/fleet/adapters/automation.d.ts +30 -0
  81. package/dist/platform/runtime/fleet/adapters/automation.d.ts.map +1 -0
  82. package/dist/platform/runtime/fleet/adapters/automation.js +41 -0
  83. package/dist/platform/runtime/fleet/adapters/background-process.d.ts +12 -0
  84. package/dist/platform/runtime/fleet/adapters/background-process.d.ts.map +1 -0
  85. package/dist/platform/runtime/fleet/adapters/background-process.js +46 -0
  86. package/dist/platform/runtime/fleet/adapters/code-index.d.ts +21 -0
  87. package/dist/platform/runtime/fleet/adapters/code-index.d.ts.map +1 -0
  88. package/dist/platform/runtime/fleet/adapters/code-index.js +44 -0
  89. package/dist/platform/runtime/fleet/adapters/orchestration.d.ts +47 -0
  90. package/dist/platform/runtime/fleet/adapters/orchestration.d.ts.map +1 -0
  91. package/dist/platform/runtime/fleet/adapters/orchestration.js +225 -0
  92. package/dist/platform/runtime/fleet/adapters/schedule.d.ts +14 -0
  93. package/dist/platform/runtime/fleet/adapters/schedule.d.ts.map +1 -0
  94. package/dist/platform/runtime/fleet/adapters/schedule.js +28 -0
  95. package/dist/platform/runtime/fleet/adapters/trigger.d.ts +12 -0
  96. package/dist/platform/runtime/fleet/adapters/trigger.d.ts.map +1 -0
  97. package/dist/platform/runtime/fleet/adapters/trigger.js +22 -0
  98. package/dist/platform/runtime/fleet/adapters/watcher.d.ts +13 -0
  99. package/dist/platform/runtime/fleet/adapters/watcher.d.ts.map +1 -0
  100. package/dist/platform/runtime/fleet/adapters/watcher.js +47 -0
  101. package/dist/platform/runtime/fleet/adapters/workflow.d.ts +11 -0
  102. package/dist/platform/runtime/fleet/adapters/workflow.d.ts.map +1 -0
  103. package/dist/platform/runtime/fleet/adapters/workflow.js +34 -0
  104. package/dist/platform/runtime/fleet/adapters/wrfc.d.ts +22 -0
  105. package/dist/platform/runtime/fleet/adapters/wrfc.d.ts.map +1 -0
  106. package/dist/platform/runtime/fleet/adapters/wrfc.js +228 -0
  107. package/dist/platform/runtime/fleet/index.d.ts +10 -0
  108. package/dist/platform/runtime/fleet/index.d.ts.map +1 -0
  109. package/dist/platform/runtime/fleet/index.js +6 -0
  110. package/dist/platform/runtime/fleet/registry.d.ts +113 -0
  111. package/dist/platform/runtime/fleet/registry.d.ts.map +1 -0
  112. package/dist/platform/runtime/fleet/registry.js +630 -0
  113. package/dist/platform/runtime/fleet/types.d.ts +199 -0
  114. package/dist/platform/runtime/fleet/types.d.ts.map +1 -0
  115. package/dist/platform/runtime/fleet/types.js +2 -0
  116. package/dist/platform/runtime/runtime-knowledge-api.d.ts +1 -1
  117. package/dist/platform/runtime/runtime-knowledge-api.d.ts.map +1 -1
  118. package/dist/platform/runtime/runtime-knowledge-api.js +1 -0
  119. package/dist/platform/runtime/services.d.ts +46 -0
  120. package/dist/platform/runtime/services.d.ts.map +1 -1
  121. package/dist/platform/runtime/services.js +78 -0
  122. package/dist/platform/state/code-index-chunking.d.ts +49 -0
  123. package/dist/platform/state/code-index-chunking.d.ts.map +1 -0
  124. package/dist/platform/state/code-index-chunking.js +111 -0
  125. package/dist/platform/state/code-index-db.d.ts +53 -0
  126. package/dist/platform/state/code-index-db.d.ts.map +1 -0
  127. package/dist/platform/state/code-index-db.js +101 -0
  128. package/dist/platform/state/code-index-store.d.ts +175 -0
  129. package/dist/platform/state/code-index-store.d.ts.map +1 -0
  130. package/dist/platform/state/code-index-store.js +612 -0
  131. package/dist/platform/state/index.d.ts +4 -2
  132. package/dist/platform/state/index.d.ts.map +1 -1
  133. package/dist/platform/state/index.js +2 -1
  134. package/dist/platform/state/knowledge-injection.d.ts +23 -0
  135. package/dist/platform/state/knowledge-injection.d.ts.map +1 -1
  136. package/dist/platform/state/knowledge-injection.js +34 -19
  137. package/dist/platform/state/memory-vector-store.d.ts +1 -13
  138. package/dist/platform/state/memory-vector-store.d.ts.map +1 -1
  139. package/dist/platform/state/memory-vector-store.js +6 -38
  140. package/dist/platform/state/sqlite-vec-loader.d.ts +25 -0
  141. package/dist/platform/state/sqlite-vec-loader.d.ts.map +1 -0
  142. package/dist/platform/state/sqlite-vec-loader.js +43 -0
  143. package/dist/platform/tools/agent/manager.d.ts +128 -1
  144. package/dist/platform/tools/agent/manager.d.ts.map +1 -1
  145. package/dist/platform/tools/agent/manager.js +137 -1
  146. package/dist/platform/tools/exec/runtime.d.ts.map +1 -1
  147. package/dist/platform/tools/exec/runtime.js +139 -44
  148. package/dist/platform/tools/exec/schema.d.ts +2 -0
  149. package/dist/platform/tools/exec/schema.d.ts.map +1 -1
  150. package/dist/platform/tools/fetch/runtime.d.ts +7 -0
  151. package/dist/platform/tools/fetch/runtime.d.ts.map +1 -1
  152. package/dist/platform/tools/fetch/runtime.js +8 -6
  153. package/dist/platform/tools/registry.d.ts +9 -3
  154. package/dist/platform/tools/registry.d.ts.map +1 -1
  155. package/dist/platform/tools/registry.js +9 -3
  156. package/dist/platform/types/tools.d.ts +14 -1
  157. package/dist/platform/types/tools.d.ts.map +1 -1
  158. package/dist/platform/version.js +1 -1
  159. package/package.json +17 -9
@@ -1 +1 @@
1
- {"version":3,"file":"orchestrator-runtime.d.ts","sour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AAgB,uBAAuB,CAAC,QAAQ,EAAE,wBAAwB,GAAG,gBAAgB,CAK5F;AAED,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,wBAAwB,EAClC,oBAAoB,EAAE,IAAI,CAAC,eAAe,EAAE,YAAY,CAAC,GACxD,IAAI,CAAC,eAAe,EAAE,YAAY,CAAC,CAErC;AAED,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACb,OAAO,8BAA8B,EAAE,cAAc,CAMvD"}
@@ -13,6 +13,7 @@ import type { ModelDefinition } from '../providers/registry.js';
13
13
  import type { FavoritesStore } from '../providers/favorites.js';
14
14
  import type { AgentManager } from '../tools/agent/index.js';
15
15
  import type { ExecutionPlanManager } from './execution-plan.js';
16
+ import { type TurnInjectionRecord, type TurnKnowledgeRegistrySource } from '../agents/turn-knowledge-injection.js';
16
17
  interface HookDispatcherLike {
17
18
  fire(event: HookEvent): Promise<HookResult>;
18
19
  }
@@ -27,7 +28,7 @@ export interface OrchestratorTurnLoopContext {
27
28
  readonly runtimeBus: RuntimeEventBus | null;
28
29
  readonly agentManager: Pick<AgentManager, 'list' | 'spawn'>;
29
30
  readonly configManager: Pick<ConfigManager, 'get'>;
30
- readonly providerRegistry: Pick<ProviderRegistry, 'require' | 'getCurrentModel' | 'getForModel' | 'getTokenLimitsForModel'>;
31
+ readonly providerRegistry: Pick<ProviderRegistry, 'require' | 'getCurrentModel' | 'getForModel' | 'getTokenLimitsForModel' | 'getContextWindowForModel'>;
31
32
  readonly favoritesStore?: Pick<FavoritesStore, 'recordUsage'> | undefined;
32
33
  readonly cacheHitTracker: Pick<CacheHitTracker, 'getMetrics'>;
33
34
  readonly helperModel: HelperModel;
@@ -58,6 +59,32 @@ export interface OrchestratorTurnLoopContext {
58
59
  cacheRead: number;
59
60
  cacheWrite: number;
60
61
  };
62
+ /**
63
+ * Wave-5 (wo805) per-turn passive-injection wiring for the MAIN interactive session —
64
+ * the sibling of wo801's agents/orchestrator-runner.ts runAgentTask wiring, gated on the
65
+ * SAME `agent-passive-knowledge-injection` feature flag (its description already
66
+ * promised "the EVOLVING main-session conversation" coverage; see
67
+ * runtime/feature-flags/flags.ts). `memoryRegistry` undefined is a hard no-op, matching
68
+ * the agent path. Budget/floor default to the same derived defaults
69
+ * (defaultTurnKnowledgeBudgetTokens / DEFAULT_TURN_KNOWLEDGE_RELEVANCE_FLOOR) when
70
+ * omitted.
71
+ */
72
+ readonly memoryRegistry?: TurnKnowledgeRegistrySource | undefined;
73
+ readonly isPassiveKnowledgeInjectionEnabled: () => boolean;
74
+ readonly passiveKnowledgeInjectionBudgetTokens?: number | undefined;
75
+ readonly passiveKnowledgeInjectionRelevanceFloor?: number | undefined;
76
+ /**
77
+ * The main session has no spawn-time `AgentRecord.knowledgeInjections` baseline, so this
78
+ * starts empty and grows monotonically for the life of the Orchestrator — no record is
79
+ * ever surfaced twice across the whole interactive session (mirrors wo801's
80
+ * knowledgeIdsAlreadySurfaced, but session-lifetime instead of one-agent-run-lifetime).
81
+ */
82
+ readonly getAlreadyInjectedKnowledgeIds: () => readonly string[];
83
+ readonly addInjectedKnowledgeIds: (ids: readonly string[]) => void;
84
+ /** Bounded ring (see recordTurnInjection) backing Orchestrator.getTurnInjections(). */
85
+ readonly recordTurnKnowledgeInjection: (record: TurnInjectionRecord) => void;
86
+ /** Monotonic per-Orchestrator-lifetime sequence number for TurnInjectionRecord.turn. */
87
+ readonly nextTurnKnowledgeSequence: () => number;
61
88
  }
62
89
  export declare function executeOrchestratorTurnLoop(context: OrchestratorTurnLoopContext): Promise<void>;
63
90
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"orchestrator-turn-loop.d.ts","sourceRoot":"","sources":["../../../src/platform/core/orchestrator-turn-loop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD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AC,MAAM,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAC7E,wFAAwF;IACxF,QAAQ,CAAC,yBAAyB,EAAE,MAAM,MAAM,CAAC;CAClD;AAED,wBAAsB,2BAA2B,CAAC,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,IAAI,CAAC,CA+drG"}
@@ -8,7 +8,18 @@ import { logger } from '../utils/logger.js';
8
8
  import { emitMalformedToolUseWarning, handleFinalResponseOutcome, handleToolResponseOutcome, } from './orchestrator-turn-helpers.js';
9
9
  import { appendGoodVibesRuntimeAwarenessPrompt } from '../tools/goodvibes-runtime/index.js';
10
10
  import { buildWrfcWorkflowRoutingPrompt } from './wrfc-routing.js';
11
+ import { buildPerTurnKnowledgeInjection, defaultTurnKnowledgeBudgetTokens, DEFAULT_TURN_KNOWLEDGE_RELEVANCE_FLOOR, } from '../agents/turn-knowledge-injection.js';
11
12
  const AUTO_SPAWN_FALLBACK_DELAY_MS = 5_000;
13
+ /**
14
+ * Wave-5 (wo805) per-turn passive-injection headroom clamp for the MAIN interactive
15
+ * session. Mirrors agents/orchestrator-runner.ts's CONTEXT_COMPACT_THRESHOLD (0.85) —
16
+ * deliberately NOT derived from this loop's own configurable `behavior.autoCompactThreshold`
17
+ * (default 80, see config/schema-domain-core.ts), which governs CONVERSATION compaction and
18
+ * can be user-tuned or disabled (0) independently of this feature. Keeping this fixed keeps
19
+ * the injection block's safety margin identical to wo801's regardless of what the operator
20
+ * has configured for compaction.
21
+ */
22
+ const PASSIVE_KNOWLEDGE_INJECTION_CONTEXT_THRESHOLD = 0.85;
12
23
  export async function executeOrchestratorTurnLoop(context) {
13
24
  const helperModel = context.helperModel;
14
25
  const model = context.providerRegistry.getCurrentModel();
@@ -17,6 +28,20 @@ export async function executeOrchestratorTurnLoop(context) {
17
28
  const streamEnabled = context.configManager.get('display.stream');
18
29
  let continueLoop = true;
19
30
  const circuitBreaker = new ConsecutiveErrorBreaker();
31
+ // Wave-5 (wo805): true only for the FIRST LLM call this executeOrchestratorTurnLoop()
32
+ // invocation makes (see the per-iteration gate below for why this is the main loop's
33
+ // analog of wo801's "new user input this turn").
34
+ let isFirstIterationOfThisCall = true;
35
+ // Wave-5 (wo805): the last successfully-built per-turn knowledge block, reused verbatim
36
+ // on tool-continuation iterations of THIS call where nothing new arrived (mirrors
37
+ // wo801's priorTurnKnowledgeBlock) — declared OUTSIDE the while loop so a block built on
38
+ // iteration 1 (the human message that started this runTurn()) stays available to every
39
+ // later tool round of the SAME call, not just the first LLM call. It is composed onto
40
+ // the CURRENT `composedBaseSystemPrompt` fresh every iteration (see
41
+ // composeTurnSystemPrompt below), never written back into any cached base string, so it
42
+ // cannot compound. Reset implicitly to null on every NEW executeOrchestratorTurnLoop()
43
+ // call (a fresh runTurn() always recomputes from scratch on its own iteration 1).
44
+ let turnKnowledgeBlock = null;
20
45
  while (continueLoop) {
21
46
  let streamAccumulated = '';
22
47
  let reasoningAccumulated = '';
@@ -99,6 +124,95 @@ export async function executeOrchestratorTurnLoop(context) {
99
124
  break;
100
125
  }
101
126
  }
127
+ // Wave-5 (wo805): per-turn passive knowledge injection for the MAIN interactive
128
+ // session — the missing counterpart to wo801's agents/orchestrator-runner.ts wiring.
129
+ // `newUserInputThisTurn` mirrors wo801's turn-1/steer-drain gate: it is true exactly
130
+ // on the FIRST LLM call this executeOrchestratorTurnLoop() invocation makes (the fresh
131
+ // human message this runTurn() call was invoked with) and false on every subsequent
132
+ // tool-continuation iteration of the SAME call, since the main session never drains
133
+ // new human input mid-call (handleUserInput queues a second message until the current
134
+ // runTurn() completes — see orchestrator.ts). Retrieval reruns only when
135
+ // newUserInputThisTurn is true; tool-continuation iterations reuse `turnKnowledgeBlock`
136
+ // as-is (declared before the while loop) — exactly wo801's reuse behavior for
137
+ // no-new-input turns, just with a different trigger for what counts as "new".
138
+ const newUserInputThisTurn = isFirstIterationOfThisCall;
139
+ isFirstIterationOfThisCall = false;
140
+ const passiveKnowledgeInjectionEnabled = context.isPassiveKnowledgeInjectionEnabled();
141
+ let knowledgeContextWindow = 0;
142
+ if (passiveKnowledgeInjectionEnabled && context.memoryRegistry) {
143
+ knowledgeContextWindow = context.providerRegistry.getContextWindowForModel(model);
144
+ }
145
+ const baseSystemPromptForCall = appendGoodVibesRuntimeAwarenessPrompt(context.getSystemPrompt());
146
+ const wrfcRoutingPromptForCall = buildWrfcWorkflowRoutingPrompt(context.text);
147
+ const composedBaseSystemPrompt = wrfcRoutingPromptForCall
148
+ ? `${baseSystemPromptForCall}\n\n${wrfcRoutingPromptForCall}`
149
+ : baseSystemPromptForCall;
150
+ if (passiveKnowledgeInjectionEnabled && newUserInputThisTurn && context.memoryRegistry) {
151
+ const configuredBudget = context.passiveKnowledgeInjectionBudgetTokens
152
+ ?? defaultTurnKnowledgeBudgetTokens(knowledgeContextWindow);
153
+ let turnBudgetTokens = configuredBudget;
154
+ if (knowledgeContextWindow > 0) {
155
+ // Clamp to whatever headroom remains under the same fixed safety threshold this
156
+ // block always uses (PASSIVE_KNOWLEDGE_INJECTION_CONTEXT_THRESHOLD) so base+block
157
+ // can never silently exceed it, using LIVE token counts from the
158
+ // post-preflight-compaction conversation state (checkContextWindowPreflight above
159
+ // already ran this iteration) rather than turn-start estimates.
160
+ const msgTokensForBudget = estimateConversationTokens(context.conversation.getMessagesForLLM());
161
+ const sysTokensForBudget = estimateTokens(composedBaseSystemPrompt);
162
+ const threshold = Math.floor(knowledgeContextWindow * PASSIVE_KNOWLEDGE_INJECTION_CONTEXT_THRESHOLD);
163
+ const headroomTokens = threshold - msgTokensForBudget - sysTokensForBudget;
164
+ turnBudgetTokens = Math.max(0, Math.min(configuredBudget, headroomTokens));
165
+ }
166
+ if (turnBudgetTokens > 0) {
167
+ const relevanceFloor = context.passiveKnowledgeInjectionRelevanceFloor ?? DEFAULT_TURN_KNOWLEDGE_RELEVANCE_FLOOR;
168
+ const { block, record: turnInjectionRecord } = buildPerTurnKnowledgeInjection({
169
+ memoryRegistry: context.memoryRegistry,
170
+ // The main session has no frozen "task" distinct from the live conversation —
171
+ // context.text (this call's originating human message) IS this turn's task, and
172
+ // is also the latest user-role message already appended to the conversation
173
+ // before the loop started (see prepareConversationForTurn), so
174
+ // deriveTurnKnowledgeQuery collapses to it with no duplication — the same
175
+ // turn-1 behavior wo801 documents for the agent path.
176
+ task: context.text,
177
+ conversationTail: context.conversation.getMessagesForLLM(),
178
+ budgetTokens: turnBudgetTokens,
179
+ relevanceFloor,
180
+ alreadyInjectedIds: context.getAlreadyInjectedKnowledgeIds(),
181
+ turn: context.nextTurnKnowledgeSequence(),
182
+ });
183
+ turnKnowledgeBlock = block;
184
+ if (turnInjectionRecord.injectedIds.length > 0) {
185
+ context.addInjectedKnowledgeIds(turnInjectionRecord.injectedIds);
186
+ }
187
+ context.recordTurnKnowledgeInjection(turnInjectionRecord);
188
+ }
189
+ else {
190
+ // Hard no-op: no budget headroom this call. Never call into retrieval for a
191
+ // budget already known to be zero, and never keep claiming a stale block from an
192
+ // earlier iteration that no longer fits — clear it so composeTurnSystemPrompt
193
+ // falls back to the base prompt exactly (mirrors wo801's identical branch).
194
+ turnKnowledgeBlock = null;
195
+ }
196
+ }
197
+ // Composed fresh at the call site (never a hoisted `const` reused across calls) so the
198
+ // block is re-validated against LIVE tokens at the instant it is actually sent — the
199
+ // same "never mutate the cached base, recompute at the call site" discipline wo801's
200
+ // composeTurnSystemPrompt established, even though this loop has no in-call
201
+ // context-exceeded retry path to go stale across (compaction here is the PROACTIVE
202
+ // checkContextWindowPreflight above, not a reactive mid-call retry-and-shrink).
203
+ const composeTurnSystemPrompt = (base) => {
204
+ if (!turnKnowledgeBlock)
205
+ return base;
206
+ if (knowledgeContextWindow > 0) {
207
+ const liveMsgTokens = estimateConversationTokens(context.conversation.getMessagesForLLM());
208
+ const liveSysTokens = estimateTokens(base);
209
+ const liveBlockTokens = estimateTokens(turnKnowledgeBlock);
210
+ const threshold = Math.floor(knowledgeContextWindow * PASSIVE_KNOWLEDGE_INJECTION_CONTEXT_THRESHOLD);
211
+ if (liveMsgTokens + liveSysTokens + liveBlockTokens > threshold)
212
+ return base;
213
+ }
214
+ return `${base}\n\n${turnKnowledgeBlock}`;
215
+ };
102
216
  let response;
103
217
  if (context.runtimeBus) {
104
218
  emitLlmRequestStarted(context.runtimeBus, context.emitterContext(context.turnId), {
@@ -111,13 +225,11 @@ export async function executeOrchestratorTurnLoop(context) {
111
225
  const chatStartedAt = Date.now();
112
226
  let chatRetries = 0;
113
227
  try {
114
- const baseSystemPrompt = appendGoodVibesRuntimeAwarenessPrompt(context.getSystemPrompt());
115
- const wrfcRoutingPrompt = buildWrfcWorkflowRoutingPrompt(context.text);
116
228
  response = await provider.chat({
117
229
  model: model.id,
118
230
  messages: context.conversation.getMessagesForLLM(),
119
231
  tools: toolDefinitions.length > 0 ? toolDefinitions : undefined,
120
- systemPrompt: wrfcRoutingPrompt ? `${baseSystemPrompt}\n\n${wrfcRoutingPrompt}` : baseSystemPrompt,
232
+ systemPrompt: composeTurnSystemPrompt(composedBaseSystemPrompt),
121
233
  maxTokens: tokenLimits.maxOutputTokens,
122
234
  reasoningEffort: (() => {
123
235
  const configured = context.configManager.get('provider.reasoningEffort');
@@ -10,6 +10,7 @@ import { WrfcController } from '../agents/wrfc-controller.js';
10
10
  import type { FeatureFlagManager } from '../runtime/feature-flags/manager.js';
11
11
  import type { RuntimeEventBus, TurnInputOrigin } from '../runtime/events/index.js';
12
12
  import { type OrchestratorCoreServices } from './orchestrator-runtime.js';
13
+ import { type TurnInjectionRecord } from '../agents/turn-knowledge-injection.js';
13
14
  /** Minimal interface for hook dispatch — allows any hook dispatcher implementation */
14
15
  interface HookDispatcherLike {
15
16
  fire(event: HookEvent): Promise<HookResult>;
@@ -66,6 +67,19 @@ export interface OrchestratorOptions {
66
67
  * plans, and reply correlation. Defaults to a generated private id.
67
68
  */
68
69
  sessionId?: string | undefined;
70
+ /**
71
+ * Wave-5 (wo805) per-turn passive-injection budget override for the main session,
72
+ * mirroring agents/orchestrator-runner.ts's `passiveKnowledgeInjectionBudgetTokens`.
73
+ * Omitted uses the derived default (defaultTurnKnowledgeBudgetTokens). `0` is a hard
74
+ * no-op, independent of the feature flag's own state.
75
+ */
76
+ passiveKnowledgeInjectionBudgetTokens?: number | undefined;
77
+ /**
78
+ * Wave-5 (wo805) per-turn passive-injection relevance-floor override for the main
79
+ * session, mirroring agents/orchestrator-runner.ts's
80
+ * `passiveKnowledgeInjectionRelevanceFloor`. Omitted uses DEFAULT_TURN_KNOWLEDGE_RELEVANCE_FLOOR.
81
+ */
82
+ passiveKnowledgeInjectionRelevanceFloor?: number | undefined;
69
83
  /** Required runtime service dependencies. */
70
84
  services: {
71
85
  readonly agentManager: Pick<AgentManager, 'list' | 'spawn'>;
@@ -169,6 +183,19 @@ export declare class Orchestrator {
169
183
  private permissionManager;
170
184
  private getSystemPrompt;
171
185
  private hookDispatcher;
186
+ /**
187
+ * Wave-5 (wo805) per-turn passive-injection state for the MAIN interactive session —
188
+ * see core/orchestrator-turn-loop.ts for the retrieval/budget wiring that reads and
189
+ * mutates these. `turnKnowledgeIdsAlreadySurfaced` has no spawn-time baseline (unlike
190
+ * an AgentRecord's `knowledgeInjections`) so it starts empty and grows monotonically
191
+ * for the life of this Orchestrator. `turnInjectionRing` backs the public
192
+ * `getTurnInjections()` accessor.
193
+ */
194
+ private readonly turnKnowledgeIdsAlreadySurfaced;
195
+ private turnInjectionRing;
196
+ private turnKnowledgeSequence;
197
+ private readonly passiveKnowledgeInjectionBudgetTokens;
198
+ private readonly passiveKnowledgeInjectionRelevanceFloor;
172
199
  /**
173
200
  * Construct an Orchestrator using a named-options object.
174
201
  *
@@ -197,6 +224,15 @@ export declare class Orchestrator {
197
224
  */
198
225
  registerDelegateTool(manager: AcpManager): void;
199
226
  getSpinner(): string;
227
+ /**
228
+ * Wave-5 (wo805): bounded ring of per-turn passive-injection honesty records for the
229
+ * MAIN interactive session — the main-session counterpart to `AgentRecord.turnInjections`
230
+ * (wo801). There is no AgentRecord for the primary conversation, so this is the exact
231
+ * accessor a `/recall`-style renderer should read as the main-session default when no
232
+ * agent id is given. See agents/turn-knowledge-injection.ts for the record shape and
233
+ * recordTurnInjection for the ring-eviction policy (same bounded size as the agent path).
234
+ */
235
+ getTurnInjections(): readonly TurnInjectionRecord[];
200
236
  setSystemMessageRouter(router: LowPrioritySystemMessageSink | null): void;
201
237
  enqueueConversationFollowUp(item: ConversationFollowUpItem): void;
202
238
  /** Abort the current in-flight LLM request, if any. */
@@ -267,6 +303,31 @@ export declare class Orchestrator {
267
303
  * has been wired in — safe for tests that omit the optional constructor arg.
268
304
  */
269
305
  private isReconciliationEnabled;
306
+ /**
307
+ * Returns `true` when Wave-5 (wo801/wo805) per-turn passive knowledge injection is
308
+ * active for this session. Shares the SAME `agent-passive-knowledge-injection` flag as
309
+ * the agent path (agents/orchestrator-runner.ts) rather than a sibling main-session
310
+ * flag — the flag's own description already promises "the EVOLVING main-session
311
+ * conversation" coverage (see runtime/feature-flags/flags.ts), so wiring the main loop
312
+ * under the same id completes that promise instead of duplicating a second toggle for
313
+ * what is, from an operator's perspective, one feature.
314
+ *
315
+ * Defaults to `true` (flag `defaultState: 'enabled'`) when no flag manager has been
316
+ * wired in, matching {@link isReconciliationEnabled}'s convention.
317
+ */
318
+ private isPassiveKnowledgeInjectionEnabled;
319
+ /**
320
+ * Wave-5 (wo805): ids never to re-surface in a later per-turn knowledge block. The main
321
+ * session has no spawn-time `AgentRecord.knowledgeInjections` baseline, so this starts
322
+ * empty and grows monotonically for the life of the Orchestrator.
323
+ */
324
+ private getAlreadyInjectedKnowledgeIds;
325
+ /** Wave-5 (wo805): mark ids as surfaced so they are never listed twice this session. */
326
+ private addInjectedKnowledgeIds;
327
+ /** Wave-5 (wo805): append one honesty record to the bounded ring behind {@link getTurnInjections}. */
328
+ private recordTurnKnowledgeInjection;
329
+ /** Wave-5 (wo805): monotonic per-Orchestrator-lifetime sequence number for TurnInjectionRecord.turn. */
330
+ private nextTurnKnowledgeSequence;
270
331
  /**
271
332
  * Reconcile unresolved tool calls at turn end.
272
333
  *
@@ -1 +1 @@
1
- {"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["../../../src/platform/core/orchestrator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGzD,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAG7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAMpD,OAAO,EACL,KAAK,wBAAwB,EAC9B,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAK9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAmBnF,OAAO,EASL,KAAK,wBAAwB,EAC9B,MAAM,2BAA2B,CAAC;AAQnC,sFAAsF;AACtF,UAAU,kBAAkB;IAC1B,IAAI,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;CAC7C;AAMD,UAAU,4BAA4B;IACpC,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,MAAM,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC;CAC/C;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,mBAAmB;IAClC,gDAAgD;IAChD,YAAY,EAAE,m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EAAE,4BAA4B,GAAG,SAAS,GACjD,OAAO,CAAC,IAAI,CAAC;IAsBhB;;;;;OAKG;YACW,iBAAiB;IAQ/B;;;OAGG;IACH,OAAO,CAAC,aAAa;IAUrB,OAAO,CAAC,aAAa;IAqBrB,OAAO,CAAC,YAAY;YAWN,OAAO;IA2BrB;kGAC8F;IAC9F,OAAO,CAAC,gBAAgB;IAwFxB,iEAAiE;YACnD,aAAa;IA2D3B,iFAAiF;YACnE,gBAAgB;IA0B9B,wDAAwD;IACxD,OAAO,CAAC,eAAe;IAwDvB,2GAA2G;IAC3G,OAAO,CAAC,YAAY;IAoDpB;;;;;;;;;;;;OAYG;YACW,2BAA2B;IAyBzC;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAoB7B;;;;;OAKG;IACH,OAAO,CAAC,uBAAuB;IAK/B;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,kCAAkC;IAK1C;;;;OAIG;IACH,OAAO,CAAC,8BAA8B;IAItC,wFAAwF;IACxF,OAAO,CAAC,uBAAuB;IAI/B,sGAAsG;IACtG,OAAO,CAAC,4BAA4B;IAIpC,wGAAwG;IACxG,OAAO,CAAC,yBAAyB;IAIjC;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,4BAA4B;YAetB,gBAAgB;CAU/B"}
@@ -20,6 +20,7 @@ import { checkContextWindowPreflight, emitContextOverflowError, handlePostTurnCo
20
20
  import { createEmitterContext, estimateFreshTurnInputTokens, getCacheHitTracker, getIdempotencyStore, getSessionLineageTracker, normalizeUsage, requireConfigManager, requireProviderRegistry, } from './orchestrator-runtime.js';
21
21
  import { maybeEmitAdaptivePlannerDecision, prepareConversationForTurn, } from './orchestrator-turn-helpers.js';
22
22
  import { executeOrchestratorTurnLoop } from './orchestrator-turn-loop.js';
23
+ import { recordTurnInjection, } from '../agents/turn-knowledge-injection.js';
23
24
  /** Delay (ms) before auto-spawning plan items if the model ends its turn without spawning them. */
24
25
  const AUTO_SPAWN_FALLBACK_DELAY_MS = 5_000;
25
26
  const THINKING_SPINNER_FRAMES = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
@@ -111,6 +112,19 @@ export class Orchestrator {
111
112
  permissionManager;
112
113
  getSystemPrompt;
113
114
  hookDispatcher;
115
+ /**
116
+ * Wave-5 (wo805) per-turn passive-injection state for the MAIN interactive session —
117
+ * see core/orchestrator-turn-loop.ts for the retrieval/budget wiring that reads and
118
+ * mutates these. `turnKnowledgeIdsAlreadySurfaced` has no spawn-time baseline (unlike
119
+ * an AgentRecord's `knowledgeInjections`) so it starts empty and grows monotonically
120
+ * for the life of this Orchestrator. `turnInjectionRing` backs the public
121
+ * `getTurnInjections()` accessor.
122
+ */
123
+ turnKnowledgeIdsAlreadySurfaced = new Set();
124
+ turnInjectionRing = [];
125
+ turnKnowledgeSequence = 0;
126
+ passiveKnowledgeInjectionBudgetTokens;
127
+ passiveKnowledgeInjectionRelevanceFloor;
114
128
  /**
115
129
  * Construct an Orchestrator using a named-options object.
116
130
  *
@@ -132,7 +146,9 @@ export class Orchestrator {
132
146
  * ```
133
147
  */
134
148
  constructor(options) {
135
- const { conversation, getViewportHeight, scrollToEnd, toolRegistry, permissionManager, getSystemPrompt = () => '', hookDispatcher = null, flagManager = null, requestRender = null, runtimeBus = null, sessionId, services, } = options;
149
+ const { conversation, getViewportHeight, scrollToEnd, toolRegistry, permissionManager, getSystemPrompt = () => '', hookDispatcher = null, flagManager = null, requestRender = null, runtimeBus = null, sessionId, passiveKnowledgeInjectionBudgetTokens, passiveKnowledgeInjectionRelevanceFloor, services, } = options;
150
+ this.passiveKnowledgeInjectionBudgetTokens = passiveKnowledgeInjectionBudgetTokens;
151
+ this.passiveKnowledgeInjectionRelevanceFloor = passiveKnowledgeInjectionRelevanceFloor;
136
152
  this.sessionId = sessionId?.trim() || randomUUID();
137
153
  this.conversation = conversation;
138
154
  this.getViewportHeight = getViewportHeight;
@@ -250,6 +266,17 @@ export class Orchestrator {
250
266
  getSpinner() {
251
267
  return THINKING_SPINNER_FRAMES[this.thinkingFrame % THINKING_SPINNER_FRAMES.length];
252
268
  }
269
+ /**
270
+ * Wave-5 (wo805): bounded ring of per-turn passive-injection honesty records for the
271
+ * MAIN interactive session — the main-session counterpart to `AgentRecord.turnInjections`
272
+ * (wo801). There is no AgentRecord for the primary conversation, so this is the exact
273
+ * accessor a `/recall`-style renderer should read as the main-session default when no
274
+ * agent id is given. See agents/turn-knowledge-injection.ts for the record shape and
275
+ * recordTurnInjection for the ring-eviction policy (same bounded size as the agent path).
276
+ */
277
+ getTurnInjections() {
278
+ return this.turnInjectionRing;
279
+ }
253
280
  setSystemMessageRouter(router) {
254
281
  this.systemMessageRouter = router;
255
282
  }
@@ -505,6 +532,14 @@ export class Orchestrator {
505
532
  setLastInputTokens: (value) => { this.lastInputTokens = value; },
506
533
  markTurnFailed: () => { this._turnFailed = true; },
507
534
  usage: this.usage,
535
+ memoryRegistry: this.coreServices.memoryRegistry,
536
+ isPassiveKnowledgeInjectionEnabled: () => this.isPassiveKnowledgeInjectionEnabled(),
537
+ passiveKnowledgeInjectionBudgetTokens: this.passiveKnowledgeInjectionBudgetTokens,
538
+ passiveKnowledgeInjectionRelevanceFloor: this.passiveKnowledgeInjectionRelevanceFloor,
539
+ getAlreadyInjectedKnowledgeIds: () => this.getAlreadyInjectedKnowledgeIds(),
540
+ addInjectedKnowledgeIds: (ids) => { this.addInjectedKnowledgeIds(ids); },
541
+ recordTurnKnowledgeInjection: (record) => { this.recordTurnKnowledgeInjection(record); },
542
+ nextTurnKnowledgeSequence: () => this.nextTurnKnowledgeSequence(),
508
543
  });
509
544
  }
510
545
  /** Phase 3: Post-turn context maintenance (compaction, memory, plan updates). */
@@ -679,6 +714,44 @@ export class Orchestrator {
679
714
  return true;
680
715
  return this.flagManager.isEnabled('tool-result-reconciliation');
681
716
  }
717
+ /**
718
+ * Returns `true` when Wave-5 (wo801/wo805) per-turn passive knowledge injection is
719
+ * active for this session. Shares the SAME `agent-passive-knowledge-injection` flag as
720
+ * the agent path (agents/orchestrator-runner.ts) rather than a sibling main-session
721
+ * flag — the flag's own description already promises "the EVOLVING main-session
722
+ * conversation" coverage (see runtime/feature-flags/flags.ts), so wiring the main loop
723
+ * under the same id completes that promise instead of duplicating a second toggle for
724
+ * what is, from an operator's perspective, one feature.
725
+ *
726
+ * Defaults to `true` (flag `defaultState: 'enabled'`) when no flag manager has been
727
+ * wired in, matching {@link isReconciliationEnabled}'s convention.
728
+ */
729
+ isPassiveKnowledgeInjectionEnabled() {
730
+ if (this.flagManager === null)
731
+ return true;
732
+ return this.flagManager.isEnabled('agent-passive-knowledge-injection');
733
+ }
734
+ /**
735
+ * Wave-5 (wo805): ids never to re-surface in a later per-turn knowledge block. The main
736
+ * session has no spawn-time `AgentRecord.knowledgeInjections` baseline, so this starts
737
+ * empty and grows monotonically for the life of the Orchestrator.
738
+ */
739
+ getAlreadyInjectedKnowledgeIds() {
740
+ return [...this.turnKnowledgeIdsAlreadySurfaced];
741
+ }
742
+ /** Wave-5 (wo805): mark ids as surfaced so they are never listed twice this session. */
743
+ addInjectedKnowledgeIds(ids) {
744
+ for (const id of ids)
745
+ this.turnKnowledgeIdsAlreadySurfaced.add(id);
746
+ }
747
+ /** Wave-5 (wo805): append one honesty record to the bounded ring behind {@link getTurnInjections}. */
748
+ recordTurnKnowledgeInjection(record) {
749
+ this.turnInjectionRing = recordTurnInjection(this.turnInjectionRing, record);
750
+ }
751
+ /** Wave-5 (wo805): monotonic per-Orchestrator-lifetime sequence number for TurnInjectionRecord.turn. */
752
+ nextTurnKnowledgeSequence() {
753
+ return ++this.turnKnowledgeSequence;
754
+ }
682
755
  /**
683
756
  * Reconcile unresolved tool calls at turn end.
684
757
  *
@@ -0,0 +1,165 @@
1
+ /**
2
+ * Plan proposal types + pure assembler.
3
+ *
4
+ * This module turns a loose decomposition (produced by an LLM planning agent,
5
+ * or handed in directly by a caller) into a validated, typed `PlanProposal`.
6
+ * It is intentionally free of I/O and LLM calls: no filesystem access, no
7
+ * agent spawning, no network. It exists so `AdaptivePlanner` can stay a
8
+ * synchronous, deterministic, side-effect-free scorer while still producing
9
+ * a rich, structured artifact that an orchestration engine can render for
10
+ * human approval and (once approved) instantiate.
11
+ *
12
+ * A `PlanProposal` is DATA. It is never instantiated on its own — approval
13
+ * flows through the existing `ProjectPlanningState.executionApproved` gate
14
+ * (see `planProposalToPlanningState` below), and durable persistence reuses
15
+ * `ExecutionPlanManager` (see `planProposalToExecutionPlanItems` below).
16
+ * Neither adapter performs any I/O itself; they only shape data for callers
17
+ * that do.
18
+ */
19
+ import type { ExecutionStrategy } from './adaptive-planner.js';
20
+ import type { PlanItem } from './execution-plan.js';
21
+ import type { ProjectPlanningState } from '../knowledge/project-planning/types.js';
22
+ /** Archetypes a work item can suggest for its executing agent. Open-ended by design. */
23
+ export type WorkItemArchetype = 'engineer' | 'reviewer' | 'tester' | 'researcher' | 'integrator' | string;
24
+ /**
25
+ * A single unit of work inside a proposal.
26
+ *
27
+ * Field shapes deliberately mirror three existing types so downstream bridges
28
+ * are near-1:1 maps rather than translations:
29
+ * - knowledge `ProjectPlanningTask` (approval-render bridge)
30
+ * - knowledge `ProjectWorkPlanTask` (phaseId/dependency naming)
31
+ * - core `PlanItem` (persistence bridge)
32
+ */
33
+ export interface WorkItem {
34
+ id: string;
35
+ title: string;
36
+ brief: string;
37
+ phaseId: string;
38
+ dependsOn: string[];
39
+ suggestedArchetype?: WorkItemArchetype | undefined;
40
+ likelyFiles?: string[] | undefined;
41
+ verification?: string[] | undefined;
42
+ canRunConcurrently?: boolean | undefined;
43
+ needsReview?: boolean | undefined;
44
+ }
45
+ export interface Phase {
46
+ id: string;
47
+ title: string;
48
+ description?: string | undefined;
49
+ order: number;
50
+ }
51
+ /** Where a proposal's decomposition came from. */
52
+ export type PlanProposalSource = 'planner-agent' | 'single-item-fallback' | 'caller-supplied';
53
+ export interface PlanProposal {
54
+ id: string;
55
+ task: string;
56
+ strategy: ExecutionStrategy;
57
+ rationale: string;
58
+ phases: Phase[];
59
+ workItems: WorkItem[];
60
+ createdAt: number;
61
+ source: PlanProposalSource;
62
+ }
63
+ /** The loose JSON shape a planning agent (or a caller) emits, pre-validation. */
64
+ export interface RawDecompositionPhase {
65
+ title: string;
66
+ description?: string | undefined;
67
+ }
68
+ export interface RawDecompositionWorkItem {
69
+ title: string;
70
+ brief: string;
71
+ phase: string;
72
+ dependsOn?: string[] | undefined;
73
+ suggestedArchetype?: string | undefined;
74
+ likelyFiles?: string[] | undefined;
75
+ verification?: string[] | undefined;
76
+ canRunConcurrently?: boolean | undefined;
77
+ needsReview?: boolean | undefined;
78
+ }
79
+ export interface RawDecomposition {
80
+ phases: RawDecompositionPhase[];
81
+ workItems: RawDecompositionWorkItem[];
82
+ }
83
+ /** Kinds of honest-partial issues `assemblePlanProposal` can flag without throwing. */
84
+ export type PlanProposalIssueKind = 'dangling-dependency' | 'dependency-cycle' | 'unresolved-phase';
85
+ export interface PlanProposalIssue {
86
+ readonly kind: PlanProposalIssueKind;
87
+ readonly workItemTitle: string;
88
+ readonly message: string;
89
+ }
90
+ /**
91
+ * Turn a raw decomposition into a validated, typed `PlanProposal`.
92
+ *
93
+ * Never throws. Malformed input degrades to an honest partial result: an
94
+ * unresolved phase reference lands its work item in a synthesized "Unphased"
95
+ * bucket; an unresolved dependency reference is dropped; a dependency cycle
96
+ * is flagged but left in place (no silent edge removal). Every problem is
97
+ * reported via the returned `issues` list rather than an exception.
98
+ *
99
+ * Dependency resolution mirrors `ExecutionPlanManager.replaceItems` exactly:
100
+ * a dep that already looks like a UUID passes through unchecked, otherwise
101
+ * it is resolved by case-insensitive title match, otherwise it is dropped.
102
+ *
103
+ * `source` defaults to `'planner-agent'` (the expected majority caller —
104
+ * `AdaptivePlanner.proposeWorkstream`). Pass `'caller-supplied'` when a
105
+ * non-agent caller hands in its own decomposition directly.
106
+ */
107
+ export declare function assemblePlanProposal(task: string, strategy: ExecutionStrategy, raw: RawDecomposition, source?: Extract<PlanProposalSource, 'planner-agent' | 'caller-supplied'>): {
108
+ proposal: PlanProposal;
109
+ issues: PlanProposalIssue[];
110
+ };
111
+ /**
112
+ * The honest fallback: one phase ("Execute"), one work item whose title and
113
+ * brief both equal the task text, no dependencies. Used whenever decomposition
114
+ * was not warranted (see `AdaptivePlanner.shouldDecompose`) or no raw
115
+ * decomposition is available yet.
116
+ */
117
+ export declare function singleItemProposal(task: string): PlanProposal;
118
+ /**
119
+ * Project a `PlanProposal` into the existing `/plan approve` seam. This is
120
+ * data-only — no store is written here. The caller feeds the result into
121
+ * `ProjectPlanningService.upsertState` (or an equivalent), which is what
122
+ * actually persists it and evaluates readiness.
123
+ *
124
+ * Direction convention for the emitted `ProjectPlanningDependency` records
125
+ * (this type has no prior producer in the codebase to inherit a convention
126
+ * from, so it is fixed here): `fromTaskId` depends on `toTaskId`, i.e. the
127
+ * edge reads "fromTaskId depends on toTaskId" the same way `WorkItem.dependsOn`
128
+ * reads "this item depends on these ids".
129
+ *
130
+ * `ProjectPlanningTask` has no first-class phase concept, so phase
131
+ * membership is preserved in `metadata` rather than dropped silently.
132
+ *
133
+ * `executionApproved` is always `false` here — approval is a separate,
134
+ * explicit step owned by `/plan approve` (planning-runtime.ts), never implied
135
+ * by proposing.
136
+ */
137
+ export declare function planProposalToPlanningState(proposal: PlanProposal): Partial<ProjectPlanningState>;
138
+ /**
139
+ * Project a `PlanProposal` into the plain items `ExecutionPlanManager` deals
140
+ * in. This is a deliberately lossy projection: `PlanItem` has no room for
141
+ * verification/likelyFiles/suggestedArchetype, and those stay in the
142
+ * full-fidelity `ProjectPlanningState` render above. It exists purely so a
143
+ * caller can hand a proposal's items to `ExecutionPlanManager` without
144
+ * re-deriving the phase/description/dependency shape by hand.
145
+ *
146
+ * Dependencies are expressed as WORK ITEM TITLES, not ids, because
147
+ * `ExecutionPlanManager.create()` does not resolve dependency references —
148
+ * only `ExecutionPlanManager.replaceItems()` does, by case-insensitive
149
+ * description match. The intended call sequence at instantiation is
150
+ * therefore:
151
+ *
152
+ * const plan = planManager.create(title, []);
153
+ * const { items } = planProposalToExecutionPlanItems(proposal);
154
+ * planManager.replaceItems(plan.id, items);
155
+ *
156
+ * which reuses `replaceItems`' existing dependency resolver end-to-end
157
+ * instead of re-implementing dependency resolution here. This module defines
158
+ * no scheduler of its own — ready-to-run item selection stays
159
+ * `ExecutionPlanManager.getNextItems`'s job.
160
+ */
161
+ export declare function planProposalToExecutionPlanItems(proposal: PlanProposal): {
162
+ title: string;
163
+ items: Array<Omit<PlanItem, 'id' | 'status'>>;
164
+ };
165
+ //# sourceMappingURL=plan-proposal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan-proposal.d.ts","sourceRoot":"","sources":["../../../src/platform/core/plan-proposal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAEV,oBAAoB,EAErB,MAAM,wCAAwC,CAAC;AAMhD,wFAAwF;AACxF,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,UAAU,GAAG,QAAQ,GAAG,YAAY,GAAG,YAAY,GAAG,MAAM,CAAC;AAE1G;;;;;;;;GAQG;AACH,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,kBAAkB,CAAC,EAAE,iBAAiB,GAAG,SAAS,CAAC;IACnD,WAAW,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IACnC,YAAY,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IACpC,kBAAkB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC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