@lumenflow/initiatives 2.18.2 → 2.19.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 (41) hide show
  1. package/dist/initiative-orchestrator.d.ts +19 -469
  2. package/dist/initiative-orchestrator.d.ts.map +1 -1
  3. package/dist/initiative-orchestrator.js +25 -1783
  4. package/dist/initiative-orchestrator.js.map +1 -1
  5. package/dist/orchestrator/checkpoint.d.ts +105 -0
  6. package/dist/orchestrator/checkpoint.d.ts.map +1 -0
  7. package/dist/orchestrator/checkpoint.js +444 -0
  8. package/dist/orchestrator/checkpoint.js.map +1 -0
  9. package/dist/orchestrator/execution-planning.d.ts +50 -0
  10. package/dist/orchestrator/execution-planning.d.ts.map +1 -0
  11. package/dist/orchestrator/execution-planning.js +364 -0
  12. package/dist/orchestrator/execution-planning.js.map +1 -0
  13. package/dist/orchestrator/formatting.d.ts +101 -0
  14. package/dist/orchestrator/formatting.d.ts.map +1 -0
  15. package/dist/orchestrator/formatting.js +415 -0
  16. package/dist/orchestrator/formatting.js.map +1 -0
  17. package/dist/orchestrator/index.d.ts +14 -0
  18. package/dist/orchestrator/index.d.ts.map +1 -0
  19. package/dist/orchestrator/index.js +14 -0
  20. package/dist/orchestrator/index.js.map +1 -0
  21. package/dist/orchestrator/initiative-loading.d.ts +30 -0
  22. package/dist/orchestrator/initiative-loading.d.ts.map +1 -0
  23. package/dist/orchestrator/initiative-loading.js +51 -0
  24. package/dist/orchestrator/initiative-loading.js.map +1 -0
  25. package/dist/orchestrator/lane-policy.d.ts +44 -0
  26. package/dist/orchestrator/lane-policy.d.ts.map +1 -0
  27. package/dist/orchestrator/lane-policy.js +129 -0
  28. package/dist/orchestrator/lane-policy.js.map +1 -0
  29. package/dist/orchestrator/shared.d.ts +49 -0
  30. package/dist/orchestrator/shared.d.ts.map +1 -0
  31. package/dist/orchestrator/shared.js +57 -0
  32. package/dist/orchestrator/shared.js.map +1 -0
  33. package/dist/orchestrator/spawn-status.d.ts +56 -0
  34. package/dist/orchestrator/spawn-status.d.ts.map +1 -0
  35. package/dist/orchestrator/spawn-status.js +95 -0
  36. package/dist/orchestrator/spawn-status.js.map +1 -0
  37. package/dist/orchestrator/types.d.ts +148 -0
  38. package/dist/orchestrator/types.d.ts.map +1 -0
  39. package/dist/orchestrator/types.js +9 -0
  40. package/dist/orchestrator/types.js.map +1 -0
  41. package/package.json +2 -2
@@ -1,478 +1,28 @@
1
1
  /**
2
- * Initiative Orchestrator (WU-1581, WU-1821)
2
+ * Initiative Orchestrator (WU-1581, WU-1821, WU-1648)
3
3
  *
4
- * Core orchestration logic for parallel agent execution of initiative WUs.
5
- * Builds execution plans based on WU dependencies and manages wave-based execution.
4
+ * Thin composition layer that re-exports domain modules for initiative orchestration.
5
+ * Actual logic lives in the orchestrator/ subdirectory, split by domain responsibility:
6
6
  *
7
- * Architecture:
8
- * - Loads initiative(s) and their WUs
9
- * - Builds dependency graph for topological ordering
10
- * - Groups independent WUs into parallel execution waves
11
- * - Generates spawn commands for agent delegation
12
- *
13
- * WU-1821 additions:
14
- * - Checkpoint-per-wave pattern for context management
15
- * - Wave manifest files for idempotent resumption
16
- * - Compact output for token discipline
7
+ * - orchestrator/types.ts -- Shared type definitions
8
+ * - orchestrator/shared.ts -- Shared utilities (hasStamp, getAllDependencies)
9
+ * - orchestrator/execution-planning.ts -- Wave-based execution plan building
10
+ * - orchestrator/checkpoint.ts -- Checkpoint mode, wave manifests, auto-detection
11
+ * - orchestrator/formatting.ts -- Output formatting (plans, progress, spawn XML)
12
+ * - orchestrator/spawn-status.ts -- WU spawn status checking
13
+ * - orchestrator/lane-policy.ts -- Lane lock policy management
14
+ * - orchestrator/initiative-loading.ts -- Initiative/WU loading
17
15
  *
18
16
  * @see {@link packages/@lumenflow/cli/src/orchestrate-initiative.ts} - CLI entry point
19
17
  * @see {@link packages/@lumenflow/cli/src/lib/initiative-yaml.ts} - Initiative loading
20
18
  * @see {@link packages/@lumenflow/cli/src/lib/dependency-graph.ts} - Dependency graph utilities
21
19
  */
22
- import type { InitiativeDoc, WUEntry } from './initiative-yaml.js';
23
- /**
24
- * Options for checkpoint mode resolution.
25
- */
26
- export interface CheckpointOptions {
27
- checkpointPerWave?: boolean;
28
- noCheckpoint?: boolean;
29
- dryRun?: boolean;
30
- }
31
- /**
32
- * Result of checkpoint mode resolution.
33
- */
34
- export interface CheckpointModeResult {
35
- enabled: boolean;
36
- source: 'explicit' | 'override' | 'auto' | 'dryrun';
37
- reason?: string;
38
- }
39
- /**
40
- * Result of auto-detection for checkpoint mode.
41
- */
42
- export interface AutoCheckpointResult {
43
- autoEnabled: boolean;
44
- reason: string;
45
- pendingCount: number;
46
- waveCount: number;
47
- }
48
- /**
49
- * Skipped WU entry with reason.
50
- */
51
- export interface SkippedWUEntry {
52
- id: string;
53
- reason: string;
54
- }
55
- /**
56
- * Deferred WU entry with blockers.
57
- */
58
- export interface DeferredWUEntry {
59
- id: string;
60
- blockedBy: string[];
61
- reason: string;
62
- }
63
- /**
64
- * Execution plan result.
65
- */
66
- export interface ExecutionPlan {
67
- waves: WUEntry[][];
68
- skipped: string[];
69
- skippedWithReasons: SkippedWUEntry[];
70
- deferred: DeferredWUEntry[];
71
- }
72
- /**
73
- * Progress statistics for WUs.
74
- */
75
- export interface ProgressStats {
76
- total: number;
77
- done: number;
78
- active: number;
79
- pending: number;
80
- blocked: number;
81
- percentage: number;
82
- }
83
- /**
84
- * Bottleneck WU entry.
85
- */
86
- export interface BottleneckWU {
87
- id: string;
88
- title: string;
89
- blocksCount: number;
90
- }
91
- /**
92
- * Wave manifest WU entry.
93
- */
94
- export interface WaveManifestWU {
95
- id: string;
96
- lane?: string;
97
- status?: string;
98
- }
99
- /**
100
- * Wave manifest structure.
101
- */
102
- export interface WaveManifest {
103
- initiative: string;
104
- wave: number;
105
- created_at?: string;
106
- wus: WaveManifestWU[];
107
- lane_validation?: string;
108
- done_criteria?: string;
109
- }
110
- /**
111
- * Checkpoint wave result.
112
- */
113
- export interface CheckpointWaveResult {
114
- initiative: string;
115
- wave: number;
116
- wus: WaveManifestWU[];
117
- manifestPath: string | null;
118
- blockedBy?: string[];
119
- waitingMessage?: string;
120
- dryRun?: boolean;
121
- }
122
- /**
123
- * Dependency filter result.
124
- */
125
- export interface DependencyFilterResult {
126
- spawnable: WUEntry[];
127
- blocked: WUEntry[];
128
- blockingDeps: string[];
129
- waitingMessage: string;
130
- }
131
- /**
132
- * Log prefix for orchestrator messages.
133
- */
134
- declare const LOG_PREFIX = "[orchestrate:initiative]";
135
- /**
136
- * WU-1828: Auto-detection thresholds for checkpoint mode.
137
- *
138
- * These thresholds determine when checkpoint mode is automatically enabled
139
- * to prevent "prompt too long" errors for large initiatives.
140
- *
141
- * @type {{WU_COUNT: number, WAVE_COUNT: number}}
142
- */
143
- export declare const CHECKPOINT_AUTO_THRESHOLDS: {
144
- /** Auto-enable checkpoint mode if pending WU count exceeds this (>3 = 4+) */
145
- WU_COUNT: number;
146
- /** Auto-enable checkpoint mode if wave count exceeds this (>2 = 3+) */
147
- WAVE_COUNT: number;
148
- };
149
- /**
150
- * WU-1200: Get the status string used in wave manifests for WUs.
151
- *
152
- * Returns 'queued' instead of 'spawned' to prevent confusion.
153
- * A WU is 'queued' in the manifest when the spawn prompt is output,
154
- * but it's not actually 'spawned' until an agent claims it.
155
- *
156
- * @returns {string} The manifest WU status ('queued')
157
- */
158
- export declare function getManifestWUStatus(): string;
159
- /**
160
- * WU-1200: Check if a WU has actually been spawned (agent launched).
161
- *
162
- * This checks the WU YAML status, not the wave manifest. A WU is considered
163
- * "actually spawned" only if:
164
- * - Its YAML status is 'in_progress' (agent has claimed it)
165
- * - OR its YAML status is 'done' (agent has completed it)
166
- *
167
- * Wave manifests can have stale 'spawned' statuses from previous runs where
168
- * the prompt was output but no agent was ever invoked. This function provides
169
- * the authoritative check based on YAML status.
170
- *
171
- * @param {string} wuId - WU ID (e.g., 'WU-001')
172
- * @returns {boolean} True if the WU is actually in progress or done
173
- */
174
- export declare function isWUActuallySpawned(wuId: string): boolean;
175
- /**
176
- * WU-1200: Get spawn candidates with YAML status verification.
177
- *
178
- * Filters WUs to find candidates that can be spawned, checking YAML status
179
- * instead of relying solely on wave manifests. This prevents stale manifests
180
- * from blocking new orchestration runs.
181
- *
182
- * A WU is a spawn candidate if:
183
- * - Its YAML status is 'ready' (not in_progress, done, blocked, etc.)
184
- * - It's in the provided WU list (part of the initiative)
185
- *
186
- * This function ignores wave manifest status because:
187
- * - Manifests can be stale (prompt output but agent never launched)
188
- * - YAML status is the authoritative source of truth
189
- *
190
- * @param {string} _initId - Initiative ID (for logging/context, not used for filtering)
191
- * @param {Array<{id: string, doc: object}>} wus - WUs to filter
192
- * @returns {Array<{id: string, doc: object}>} WUs that can be spawned
193
- */
194
- export declare function getSpawnCandidatesWithYAMLCheck(_initId: string, wus: WUEntry[]): WUEntry[];
195
- /**
196
- * Load initiative and its WUs.
197
- *
198
- * @param {string} initRef - Initiative ID or slug
199
- * @returns {{initiative: object, wus: Array<{id: string, doc: object}>}}
200
- * @throws {Error} If initiative not found
201
- */
202
- export declare function loadInitiativeWUs(initRef: string): {
203
- initiative: InitiativeDoc;
204
- wus: WUEntry[];
205
- };
206
- /**
207
- * Load multiple initiatives and combine their WUs.
208
- *
209
- * Used for cross-initiative parallel execution.
210
- *
211
- * @param {string[]} initRefs - Array of initiative IDs or slugs
212
- * @returns {Array<{id: string, doc: object}>} Combined WUs from all initiatives
213
- * @throws {Error} If any initiative not found
214
- */
215
- export declare function loadMultipleInitiatives(initRefs: string[]): WUEntry[];
216
- /**
217
- * Build execution plan from WUs.
218
- *
219
- * Groups WUs into waves based on dependencies:
220
- * - Wave 0: All WUs with no blockers (can run in parallel)
221
- * - Wave 1: WUs blocked by wave 0 WUs only
222
- * - Wave N: WUs blocked by wave N-1 WUs
223
- *
224
- * WU-2430: Enhanced filtering:
225
- * - Only schedules status: ready WUs (not blocked/in_progress)
226
- * - Reports skipped WUs with reasons (skippedWithReasons)
227
- * - Defers WUs with unstamped external dependencies (deferred)
228
- *
229
- * @param {Array<{id: string, doc: object}>} wus - WUs to plan
230
- * @returns {{waves: Array<Array<{id: string, doc: object}>>, skipped: string[], skippedWithReasons: Array<{id: string, reason: string}>, deferred: Array<{id: string, blockedBy: string[], reason: string}>}}
231
- * @throws {Error} If circular dependencies detected
232
- */
233
- export declare function buildExecutionPlan(wus: WUEntry[]): ExecutionPlan;
234
- /**
235
- * Build execution plan from WUs asynchronously.
236
- *
237
- * @param {Array<{id: string, doc: object}>} wus - WUs to plan
238
- * @returns {Promise<ExecutionPlan>}
239
- */
240
- export declare function buildExecutionPlanAsync(wus: WUEntry[]): Promise<ExecutionPlan>;
241
- /**
242
- * WU-1828: Determine if checkpoint mode should be auto-enabled based on initiative size.
243
- *
244
- * Auto-detection triggers checkpoint mode when:
245
- * - Pending WU count exceeds WU_COUNT threshold (>3)
246
- * - OR wave count exceeds WAVE_COUNT threshold (>2)
247
- *
248
- * This prevents "prompt too long" errors for large initiatives by using
249
- * checkpoint-per-wave execution instead of polling mode.
250
- *
251
- * @param {Array<{id: string, doc: object}>} wus - WUs to analyse
252
- * @returns {{autoEnabled: boolean, reason: string, pendingCount: number, waveCount: number}}
253
- */
254
- export declare function shouldAutoEnableCheckpoint(wus: WUEntry[]): AutoCheckpointResult;
255
- /**
256
- * WU-1828: Determine if checkpoint mode should be auto-enabled based on initiative size asynchronously.
257
- *
258
- * @param {Array<{id: string, doc: object}>} wus - WUs to analyse
259
- * @returns {Promise<{autoEnabled: boolean, reason: string, pendingCount: number, waveCount: number}>}
260
- */
261
- export declare function shouldAutoEnableCheckpointAsync(wus: WUEntry[]): Promise<AutoCheckpointResult>;
262
- /**
263
- * WU-1828: Resolve checkpoint mode from CLI flags and auto-detection.
264
- * WU-2430: Updated to suppress auto-detection in dry-run mode.
265
- *
266
- * Flag precedence:
267
- * 1. --checkpoint-per-wave (-c): Explicitly enables checkpoint mode
268
- * 2. --no-checkpoint: Explicitly disables checkpoint mode (overrides auto-detection)
269
- * 3. --dry-run: Suppresses auto-detection (dry-run uses polling mode for preview)
270
- * 4. Auto-detection: Enabled based on initiative size if no explicit flags
271
- *
272
- * @param {{checkpointPerWave?: boolean, noCheckpoint?: boolean, dryRun?: boolean}} options - CLI options
273
- * @param {Array<{id: string, doc: object}>} wus - WUs for auto-detection
274
- * @returns {{enabled: boolean, source: 'explicit'|'override'|'auto'|'dryrun', reason?: string}}
275
- */
276
- export declare function resolveCheckpointMode(options: CheckpointOptions, wus: WUEntry[]): CheckpointModeResult;
277
- /**
278
- * WU-1828: Resolve checkpoint mode from CLI flags and auto-detection asynchronously.
279
- *
280
- * @param {{checkpointPerWave?: boolean, noCheckpoint?: boolean, dryRun?: boolean}} options - CLI options
281
- * @param {Array<{id: string, doc: object}>} wus - WUs for auto-detection
282
- * @returns {Promise<{enabled: boolean, source: 'explicit'|'override'|'auto'|'dryrun', reason?: string}>}
283
- */
284
- export declare function resolveCheckpointModeAsync(options: CheckpointOptions, wus: WUEntry[]): Promise<CheckpointModeResult>;
285
- /**
286
- * Get bottleneck WUs from a set of WUs based on how many downstream WUs they block.
287
- * A bottleneck is a WU that blocks multiple other WUs.
288
- *
289
- * @param {Array<{id: string, doc: object}>} wus - WUs to analyse
290
- * @param {number} [limit=5] - Maximum number of bottlenecks to return
291
- * @returns {Array<{id: string, title: string, blocksCount: number}>} Bottleneck WUs sorted by impact
292
- */
293
- export declare function getBottleneckWUs(wus: WUEntry[], limit?: number): BottleneckWU[];
294
- /**
295
- * Format execution plan for display.
296
- *
297
- * WU-2430: Enhanced to show skippedWithReasons and deferred WUs.
298
- *
299
- * @param {object} initiative - Initiative document
300
- * @param {{waves: Array<Array<{id: string, doc: object}>>, skipped: string[], skippedWithReasons?: Array<{id: string, reason: string}>, deferred?: Array<{id: string, blockedBy: string[], reason: string}>}} plan - Execution plan
301
- * @returns {string} Formatted plan output
302
- */
303
- export declare function formatExecutionPlan(initiative: InitiativeDoc, plan: ExecutionPlan): string;
304
- /**
305
- * Generate spawn commands for a wave of WUs.
306
- *
307
- * @param {Array<{id: string, doc: object}>} wave - WUs in the wave
308
- * @returns {string[]} Array of spawn command strings
309
- */
310
- export declare function generateSpawnCommands(wave: WUEntry[]): string[];
311
- /**
312
- * Calculate progress statistics for WUs.
313
- *
314
- * @param {Array<{id: string, doc: object}>} wus - WUs to calculate progress for
315
- * @returns {{total: number, done: number, active: number, pending: number, blocked: number, percentage: number}}
316
- */
317
- export declare function calculateProgress(wus: WUEntry[]): ProgressStats;
318
- /**
319
- * Format progress for display.
320
- *
321
- * @param {{total: number, done: number, active: number, pending: number, blocked: number, percentage: number}} progress
322
- * @returns {string} Formatted progress string
323
- */
324
- export declare function formatProgress(progress: ProgressStats): string;
325
- /**
326
- * WU-2040: Filter WUs by dependency stamp status.
327
- * WU-1251: Now checks both blocked_by AND dependencies arrays.
328
- *
329
- * A WU is only spawnable if ALL its dependencies have stamps.
330
- * This implements the wait-for-completion pattern per Anthropic multi-agent research.
331
- *
332
- * @param {Array<{id: string, doc: {blocked_by?: string[], dependencies?: string[], lane: string, status: string}}>} candidates - WU candidates
333
- * @returns {{spawnable: Array<object>, blocked: Array<object>, blockingDeps: string[], waitingMessage: string}}
334
- */
335
- export declare function filterByDependencyStamps(candidates: WUEntry[]): DependencyFilterResult;
336
- /**
337
- * Validate checkpoint-per-wave flag combinations.
338
- *
339
- * WU-1828: Extended to validate --no-checkpoint flag combinations.
340
- *
341
- * @param {{checkpointPerWave?: boolean, dryRun?: boolean, noCheckpoint?: boolean}} options - CLI options
342
- * @throws {Error} If invalid flag combination
343
- */
344
- export declare function validateCheckpointFlags(options: CheckpointOptions): void;
345
- /**
346
- * Build a checkpoint wave for an initiative.
347
- *
348
- * WU-1821: Creates a wave manifest file and returns spawn candidates.
349
- * Implements idempotency: skips WUs with stamps or already in previous manifests.
350
- *
351
- * Idempotency precedence (single source of truth):
352
- * 1. Stamp (highest): .lumenflow/stamps/WU-XXXX.done exists → WU is done
353
- * 2. Manifest: WU already in previous wave manifest → skip
354
- * 3. Status: Only spawn status: ready WUs
355
- *
356
- * @param {string} initRef - Initiative ID or slug
357
- * @returns {{wave: number, wus: Array<{id: string, lane: string, status: string}>, manifestPath: string, initiative: string}|null}
358
- * Wave data or null if all WUs complete
359
- */
360
- export declare function buildCheckpointWave(initRef: string, options?: CheckpointOptions): CheckpointWaveResult | null;
361
- /**
362
- * Format checkpoint wave output with Task invocations.
363
- *
364
- * WU-1821: Token discipline - keep output minimal for context management.
365
- * WU-2040: Output full Task invocation blocks instead of pnpm wu:spawn meta-prompts.
366
- * WU-2280: Prevent false wave spawned confusion - use markdown code blocks and ACTION REQUIRED banner.
367
- * WU-2430: Handle dry-run mode - indicate preview mode clearly.
368
- *
369
- * @param {{initiative: string, wave: number, wus: Array<{id: string, lane: string}>, manifestPath: string, blockedBy?: string[], waitingMessage?: string, dryRun?: boolean}} waveData
370
- * @returns {string} Formatted output with embedded Task invocations
371
- */
372
- export declare function formatCheckpointOutput(waveData: CheckpointWaveResult): string;
373
- /**
374
- * WU-2027: Generate embedded spawn prompt for a WU.
375
- *
376
- * Instead of outputting a meta-prompt like "Run: pnpm wu:spawn --id WU-XXX",
377
- * this function runs the spawn logic internally and returns the full ~3KB
378
- * prompt content ready for embedding in a Task invocation.
379
- *
380
- * This follows Anthropic guidance that sub-agent prompts must be fully
381
- * self-contained to prevent delegation failures.
382
- *
383
- * @param {string} wuId - WU ID (e.g., 'WU-001')
384
- * @returns {string} Escaped spawn prompt content ready for XML embedding
385
- * @throws {Error} If WU file not found or cannot be parsed
386
- */
387
- export declare function generateEmbeddedSpawnPrompt(wuId: string): string;
388
- /**
389
- * WU-2027: Format a Task invocation with embedded spawn content for a WU.
390
- *
391
- * Creates a complete Task tool invocation block with the full spawn prompt
392
- * embedded directly, rather than a meta-prompt referencing wu:spawn.
393
- *
394
- * @param {{id: string, doc: object}} wu - WU with id and YAML doc
395
- * @returns {string} Complete Task invocation with embedded spawn content
396
- */
397
- export declare function formatTaskInvocationWithEmbeddedSpawn(wu: WUEntry): string;
398
- /**
399
- * WU-2027: Format execution plan with embedded spawns (no meta-prompts).
400
- * WU-2280: Updated to use markdown code blocks and ACTION REQUIRED banner.
401
- *
402
- * Generates Task invocation blocks for all WUs in the execution plan,
403
- * with full spawn content embedded directly. This replaces the meta-prompt
404
- * pattern that was causing delegation failures.
405
- *
406
- * @param {{waves: Array<Array<{id: string, doc: object}>>, skipped: string[]}} plan - Execution plan
407
- * @returns {string} Formatted output with embedded Task invocations
408
- */
409
- export declare function formatExecutionPlanWithEmbeddedSpawns(plan: ExecutionPlan): string;
410
- /**
411
- * WU-1326: Lock policy type for lane configuration.
412
- *
413
- * - 'all' (default): Blocked WUs hold lane lock (current behavior)
414
- * - 'active': Blocked WUs do NOT hold lane lock (only in_progress holds)
415
- * - 'none': No WIP checking at all (unlimited parallel WUs in lane)
416
- */
417
- export type LockPolicy = 'all' | 'active' | 'none';
418
- /**
419
- * WU-1326: Lane configuration with lock_policy.
420
- */
421
- export interface LaneConfig {
422
- lock_policy?: LockPolicy;
423
- wip_limit?: number;
424
- }
425
- /**
426
- * WU-1326: Options for lock_policy-aware execution plan building.
427
- */
428
- export interface LockPolicyOptions {
429
- laneConfigs?: Record<string, LaneConfig>;
430
- }
431
- /**
432
- * WU-1326: Lane availability result for policy-aware status display.
433
- */
434
- export interface LaneAvailabilityResult {
435
- available: boolean;
436
- policy: LockPolicy;
437
- occupiedBy?: string;
438
- blockedCount: number;
439
- inProgressCount: number;
440
- }
441
- /**
442
- * WU-1326: Get lock_policy for a lane from configuration.
443
- *
444
- * Returns the lock_policy from config if specified, otherwise defaults to 'all'
445
- * for backward compatibility.
446
- *
447
- * @param {string} lane - Lane name (e.g., 'Framework: Core')
448
- * @param {Record<string, LaneConfig> | undefined} laneConfigs - Lane configurations
449
- * @returns {LockPolicy} The lock_policy for the lane ('all' | 'active' | 'none')
450
- */
451
- export declare function getLockPolicyForLane(lane: string, laneConfigs?: Record<string, LaneConfig>): LockPolicy;
452
- /**
453
- * WU-1326: Build execution plan respecting lock_policy per lane.
454
- *
455
- * This is an enhanced version of buildExecutionPlan that respects lock_policy
456
- * when determining lane occupancy for wave building.
457
- *
458
- * When policy=active, blocked WUs do NOT prevent ready WUs in the same lane
459
- * from being scheduled in the same wave.
460
- *
461
- * @param {Array<{id: string, doc: object}>} wus - WUs to plan
462
- * @param {LockPolicyOptions} options - Lock policy options including laneConfigs
463
- * @returns {ExecutionPlan} Execution plan with waves, skipped, and deferred WUs
464
- */
465
- export declare function buildExecutionPlanWithLockPolicy(wus: WUEntry[], options?: LockPolicyOptions): ExecutionPlan;
466
- /**
467
- * WU-1326: Get lane availability respecting lock_policy.
468
- *
469
- * Returns availability status for each lane based on current WU states
470
- * and configured lock_policy.
471
- *
472
- * @param {Array<{id: string, doc: object}>} wus - WUs to check
473
- * @param {LockPolicyOptions} options - Lock policy options
474
- * @returns {Record<string, LaneAvailabilityResult>} Lane availability map
475
- */
476
- export declare function getLaneAvailability(wus: WUEntry[], options?: LockPolicyOptions): Record<string, LaneAvailabilityResult>;
477
- export { LOG_PREFIX };
20
+ export type { CheckpointOptions, CheckpointModeResult, AutoCheckpointResult, SkippedWUEntry, DeferredWUEntry, ExecutionPlan, ProgressStats, BottleneckWU, WaveManifestWU, WaveManifest, CheckpointWaveResult, DependencyFilterResult, LockPolicy, LaneConfig, LockPolicyOptions, LaneAvailabilityResult, } from './orchestrator/types.js';
21
+ export { LOG_PREFIX } from './orchestrator/shared.js';
22
+ export { buildExecutionPlan, buildExecutionPlanAsync, buildExecutionPlanWithLockPolicy, } from './orchestrator/execution-planning.js';
23
+ export { CHECKPOINT_AUTO_THRESHOLDS, filterByDependencyStamps, shouldAutoEnableCheckpoint, shouldAutoEnableCheckpointAsync, resolveCheckpointMode, resolveCheckpointModeAsync, validateCheckpointFlags, buildCheckpointWave, } from './orchestrator/checkpoint.js';
24
+ export { formatExecutionPlan, generateSpawnCommands, calculateProgress, formatProgress, getBottleneckWUs, formatCheckpointOutput, generateEmbeddedSpawnPrompt, formatTaskInvocationWithEmbeddedSpawn, formatExecutionPlanWithEmbeddedSpawns, } from './orchestrator/formatting.js';
25
+ export { getManifestWUStatus, isWUActuallySpawned, getSpawnCandidatesWithYAMLCheck, } from './orchestrator/spawn-status.js';
26
+ export { getLockPolicyForLane, getLaneAvailability } from './orchestrator/lane-policy.js';
27
+ export { loadInitiativeWUs, loadMultipleInitiatives } from './orchestrator/initiative-loading.js';
478
28
  //# sourceMappingURL=initiative-orchestrator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"initiative-orchestrator.d.ts","sourceRoot":"","sources":["../src/initiative-orchestrator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEnE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,UAAU,GAAG,UAAU,GAAG,MAAM,GAAG,QAAQ,CAAC;IACpD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,OAAO,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,EA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,"file":"initiative-orchestrator.d.ts","sourceRoot":"","sources":["../src/initiative-orchestrator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,YAAY,EACV,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACpB,cAAc,EACd,eAAe,EACf,aAAa,EACb,aAAa,EACb,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,oBAAoB,EACpB,sBAAsB,EACtB,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAGtD,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,gCAAgC,GACjC,MAAM,sCAAsC,CAAC;AAG9C,OAAO,EACL,0BAA0B,EAC1B,wBAAwB,EACxB,0BAA0B,EAC1B,+BAA+B,EAC/B,qBAAqB,EACrB,0BAA0B,EAC1B,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,2BAA2B,EAC3B,qCAAqC,EACrC,qCAAqC,GACtC,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,+BAA+B,GAChC,MAAM,gCAAgC,CAAC;AAGxC,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAG1F,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC"}