@wrongstack/core 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-bridge-DaOnnHNW.d.ts → agent-bridge-BkjOkSkD.d.ts} +1 -1
- package/dist/{compactor-CFky6JKM.d.ts → compactor-CTHjZAwf.d.ts} +1 -1
- package/dist/{config-RlhKLjme.d.ts → config-DO2eCKgq.d.ts} +1 -1
- package/dist/{context-B1kBj1lY.d.ts → context-P207fTpo.d.ts} +11 -0
- package/dist/coordination/index.d.ts +10 -891
- package/dist/coordination/index.js +407 -236
- package/dist/coordination/index.js.map +1 -1
- package/dist/defaults/index.d.ts +19 -18
- package/dist/defaults/index.js +2163 -301
- package/dist/defaults/index.js.map +1 -1
- package/dist/{events-BBaKeMfb.d.ts → events-DYAbU84e.d.ts} +41 -1
- package/dist/execution/index.d.ts +19 -13
- package/dist/execution/index.js +15 -6
- package/dist/execution/index.js.map +1 -1
- package/dist/extension/index.d.ts +6 -6
- package/dist/index-BHL8QDCL.d.ts +899 -0
- package/dist/{index-meJRuQtc.d.ts → index-BNzUUDVR.d.ts} +8 -6
- package/dist/index.d.ts +30 -27
- package/dist/index.js +3792 -1466
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/index.d.ts +6 -6
- package/dist/infrastructure/index.js +71 -18
- package/dist/infrastructure/index.js.map +1 -1
- package/dist/kernel/index.d.ts +10 -9
- package/dist/kernel/index.js.map +1 -1
- package/dist/{mcp-servers-Cf4-bJnd.d.ts → mcp-servers-CLkhKdnF.d.ts} +18 -3
- package/dist/models/index.d.ts +2 -2
- package/dist/models/index.js +106 -0
- package/dist/models/index.js.map +1 -1
- package/dist/{multi-agent-D5m66hzB.d.ts → multi-agent-B1Nn9eC0.d.ts} +71 -16
- package/dist/observability/index.d.ts +2 -2
- package/dist/{path-resolver-Bg4OP5fi.d.ts → path-resolver-mPccVA0l.d.ts} +9 -2
- package/dist/{provider-runner-CU9gnU2E.d.ts → provider-runner-D7lHu07L.d.ts} +3 -3
- package/dist/{skill-DayhFUBb.d.ts → retry-policy-CnYVKGPv.d.ts} +2 -28
- package/dist/sdd/index.d.ts +419 -5
- package/dist/sdd/index.js +1580 -1
- package/dist/sdd/index.js.map +1 -1
- package/dist/{secret-scrubber-Dyh5LVYL.d.ts → secret-scrubber-BSgec8CU.d.ts} +1 -1
- package/dist/{secret-scrubber-DyUAWS09.d.ts → secret-scrubber-Buo9zLGs.d.ts} +1 -1
- package/dist/security/index.d.ts +8 -4
- package/dist/security/index.js +24 -5
- package/dist/security/index.js.map +1 -1
- package/dist/{selector-DBEiwXBk.d.ts → selector-B-CGOshv.d.ts} +1 -1
- package/dist/{session-reader-D-z0AgHs.d.ts → session-reader-DmOEmSkq.d.ts} +1 -1
- package/dist/skill-CxuWrsKK.d.ts +29 -0
- package/dist/skills/index.d.ts +136 -0
- package/dist/skills/index.js +478 -0
- package/dist/skills/index.js.map +1 -0
- package/dist/storage/index.d.ts +5 -5
- package/dist/storage/index.js +9 -1
- package/dist/storage/index.js.map +1 -1
- package/dist/{system-prompt-DNetCecu.d.ts → system-prompt-CzY1zrbC.d.ts} +1 -1
- package/dist/{tool-executor-B5bgmEgE.d.ts → tool-executor-CYe5cp5U.d.ts} +4 -4
- package/dist/types/index.d.ts +16 -15
- package/dist/types/index.js +132 -5
- package/dist/types/index.js.map +1 -1
- package/dist/utils/index.d.ts +35 -2
- package/dist/utils/index.js +49 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +5 -1
- package/skills/sdd/SKILL.md +93 -6
- package/skills/skill-creator/SKILL.md +98 -0
package/dist/sdd/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { h as Specification, S as SpecAnalysis, g as SpecValidationResult, l as TaskGraph, m as TaskNode, k as TaskFilter, p as TaskSort, o as TaskProgress, r as TaskType, n as TaskPriority } from '../task-graph-BITvWt4t.js';
|
|
2
|
-
import { E as EventBus } from '../events-
|
|
3
|
-
import { D as DoneCondition } from '../multi-agent-
|
|
4
|
-
import '../context-
|
|
1
|
+
import { h as Specification, S as SpecAnalysis, g as SpecValidationResult, l as TaskGraph, m as TaskNode, k as TaskFilter, p as TaskSort, o as TaskProgress, r as TaskType, n as TaskPriority, e as SpecStatus, f as SpecTemplate, b as SpecRequirement } from '../task-graph-BITvWt4t.js';
|
|
2
|
+
import { E as EventBus } from '../events-DYAbU84e.js';
|
|
3
|
+
import { D as DoneCondition } from '../multi-agent-B1Nn9eC0.js';
|
|
4
|
+
import '../context-P207fTpo.js';
|
|
5
5
|
|
|
6
6
|
declare class SpecParser {
|
|
7
7
|
parse(content: string): Specification;
|
|
@@ -203,4 +203,418 @@ declare class SpecDrivenDev {
|
|
|
203
203
|
}[];
|
|
204
204
|
}
|
|
205
205
|
|
|
206
|
-
|
|
206
|
+
interface SpecStoreOptions {
|
|
207
|
+
/** Directory where spec files are stored. Defaults to `.wrongstack/specs`. */
|
|
208
|
+
baseDir: string;
|
|
209
|
+
}
|
|
210
|
+
interface SpecIndexEntry {
|
|
211
|
+
id: string;
|
|
212
|
+
title: string;
|
|
213
|
+
version: string;
|
|
214
|
+
status: SpecStatus;
|
|
215
|
+
updatedAt: number;
|
|
216
|
+
filePath: string;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* File-backed spec storage. Each spec is a JSON file under `baseDir/`.
|
|
220
|
+
* An index file (`_index.json`) tracks all specs for fast listing.
|
|
221
|
+
*/
|
|
222
|
+
declare class SpecStore {
|
|
223
|
+
private readonly baseDir;
|
|
224
|
+
private readonly indexPath;
|
|
225
|
+
constructor(opts: SpecStoreOptions);
|
|
226
|
+
save(spec: Specification): Promise<void>;
|
|
227
|
+
load(id: string): Promise<Specification | null>;
|
|
228
|
+
list(): Promise<SpecIndexEntry[]>;
|
|
229
|
+
delete(id: string): Promise<boolean>;
|
|
230
|
+
exists(id: string): Promise<boolean>;
|
|
231
|
+
/** Create a new spec with defaults, assign ID, and persist. */
|
|
232
|
+
createDraft(title: string, overview?: string): Promise<Specification>;
|
|
233
|
+
/** Update spec fields and persist. */
|
|
234
|
+
update(id: string, patch: Partial<Omit<Specification, 'id' | 'createdAt'>>): Promise<Specification | null>;
|
|
235
|
+
private filePath;
|
|
236
|
+
private readIndex;
|
|
237
|
+
private updateIndex;
|
|
238
|
+
private removeFromIndex;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
interface TaskGraphStoreOptions {
|
|
242
|
+
/** Directory where task graph files are stored. Defaults to `.wrongstack/task-graphs`. */
|
|
243
|
+
baseDir: string;
|
|
244
|
+
}
|
|
245
|
+
interface TaskGraphIndexEntry {
|
|
246
|
+
id: string;
|
|
247
|
+
specId: string;
|
|
248
|
+
title: string;
|
|
249
|
+
nodeCount: number;
|
|
250
|
+
completedCount: number;
|
|
251
|
+
updatedAt: number;
|
|
252
|
+
filePath: string;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* File-backed task graph storage. Each graph is a JSON file under `baseDir/`.
|
|
256
|
+
* An index file (`_index.json`) tracks all graphs for fast listing.
|
|
257
|
+
*/
|
|
258
|
+
declare class TaskGraphStore {
|
|
259
|
+
private readonly baseDir;
|
|
260
|
+
private readonly indexPath;
|
|
261
|
+
constructor(opts: TaskGraphStoreOptions);
|
|
262
|
+
save(graph: TaskGraph): Promise<void>;
|
|
263
|
+
load(id: string): Promise<TaskGraph | null>;
|
|
264
|
+
list(): Promise<TaskGraphIndexEntry[]>;
|
|
265
|
+
delete(id: string): Promise<boolean>;
|
|
266
|
+
exists(id: string): Promise<boolean>;
|
|
267
|
+
private filePath;
|
|
268
|
+
private readIndex;
|
|
269
|
+
private updateIndex;
|
|
270
|
+
private removeFromIndex;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
type AISpecPhase = 'questioning' | 'spec_review' | 'implementation' | 'task_review' | 'executing' | 'done';
|
|
274
|
+
interface CollectedAnswer {
|
|
275
|
+
question: string;
|
|
276
|
+
answer: string;
|
|
277
|
+
timestamp: number;
|
|
278
|
+
}
|
|
279
|
+
interface AISpecSession {
|
|
280
|
+
id: string;
|
|
281
|
+
phase: AISpecPhase;
|
|
282
|
+
title: string;
|
|
283
|
+
userIntent: string;
|
|
284
|
+
projectContext: string;
|
|
285
|
+
answers: CollectedAnswer[];
|
|
286
|
+
questionCount: number;
|
|
287
|
+
spec?: Specification;
|
|
288
|
+
implementation?: string;
|
|
289
|
+
taskGraphId?: string;
|
|
290
|
+
approved: boolean;
|
|
291
|
+
createdAt: number;
|
|
292
|
+
updatedAt: number;
|
|
293
|
+
}
|
|
294
|
+
interface AISpecBuilderOptions {
|
|
295
|
+
store: SpecStore;
|
|
296
|
+
/** Minimum questions the AI should ask. Default: 2 */
|
|
297
|
+
minQuestions?: number;
|
|
298
|
+
/** Maximum questions before forcing spec generation. Default: 10 */
|
|
299
|
+
maxQuestions?: number;
|
|
300
|
+
/** Project context string (package.json, file structure, etc.) */
|
|
301
|
+
projectContext?: string;
|
|
302
|
+
/** Path to persist session state. If set, session survives process restarts. */
|
|
303
|
+
sessionPath?: string;
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* AI-driven specification builder. Instead of static questions, this builder
|
|
307
|
+
* tracks conversation state and generates prompts that instruct the AI agent
|
|
308
|
+
* to ask contextual questions and build specifications interactively.
|
|
309
|
+
*/
|
|
310
|
+
declare class AISpecBuilder {
|
|
311
|
+
private session;
|
|
312
|
+
private readonly store;
|
|
313
|
+
private readonly minQuestions;
|
|
314
|
+
private readonly maxQuestions;
|
|
315
|
+
private readonly sessionPath?;
|
|
316
|
+
constructor(opts: AISpecBuilderOptions);
|
|
317
|
+
/** Save session state to disk. */
|
|
318
|
+
saveSession(): Promise<void>;
|
|
319
|
+
/** Load session state from disk. Returns true if a session was loaded. */
|
|
320
|
+
loadSession(): Promise<boolean>;
|
|
321
|
+
/** Delete saved session from disk. */
|
|
322
|
+
deleteSession(): Promise<void>;
|
|
323
|
+
/** Auto-save helper — calls saveSession() but never throws. */
|
|
324
|
+
private autoSave;
|
|
325
|
+
/** Start a new session with a title and optional intent. */
|
|
326
|
+
startSession(title: string, intent?: string): void;
|
|
327
|
+
/** Get current session state (readonly). */
|
|
328
|
+
getSession(): Readonly<AISpecSession>;
|
|
329
|
+
/** Get the current phase. */
|
|
330
|
+
getPhase(): AISpecPhase;
|
|
331
|
+
/**
|
|
332
|
+
* Get the AI prompt for the current phase.
|
|
333
|
+
* This prompt is injected into the conversation so the AI agent knows
|
|
334
|
+
* what to do next (ask a question, generate a spec, etc.).
|
|
335
|
+
*/
|
|
336
|
+
getAIPrompt(): string;
|
|
337
|
+
/**
|
|
338
|
+
* Record a question/answer pair from the AI conversation.
|
|
339
|
+
* Call this when the AI asks a question and the user responds.
|
|
340
|
+
*/
|
|
341
|
+
addAnswer(question: string, answer: string): void;
|
|
342
|
+
/**
|
|
343
|
+
* Check if more questions should be asked.
|
|
344
|
+
* Returns false if max reached or if the AI has signaled it has enough info.
|
|
345
|
+
*/
|
|
346
|
+
shouldContinueQuestioning(): boolean;
|
|
347
|
+
/**
|
|
348
|
+
* Check if minimum questions have been asked.
|
|
349
|
+
*/
|
|
350
|
+
hasMetMinimumQuestions(): boolean;
|
|
351
|
+
/**
|
|
352
|
+
* Set the generated specification and move to spec_review phase.
|
|
353
|
+
*/
|
|
354
|
+
setSpec(spec: Specification): void;
|
|
355
|
+
/**
|
|
356
|
+
* Approve the current phase and advance to the next.
|
|
357
|
+
* questioning → spec_review (requires spec to be set)
|
|
358
|
+
* spec_review → implementation
|
|
359
|
+
* implementation → task_review (requires implementation to be set)
|
|
360
|
+
* task_review → executing
|
|
361
|
+
* executing → done
|
|
362
|
+
*/
|
|
363
|
+
approve(): AISpecPhase;
|
|
364
|
+
/**
|
|
365
|
+
* Set the implementation plan text.
|
|
366
|
+
*/
|
|
367
|
+
setImplementation(plan: string): void;
|
|
368
|
+
/**
|
|
369
|
+
* Mark session as done.
|
|
370
|
+
*/
|
|
371
|
+
markDone(): void;
|
|
372
|
+
/**
|
|
373
|
+
* Set the task graph ID for this session.
|
|
374
|
+
*/
|
|
375
|
+
setTaskGraphId(graphId: string): void;
|
|
376
|
+
/**
|
|
377
|
+
* Get the task graph ID for this session.
|
|
378
|
+
*/
|
|
379
|
+
getTaskGraphId(): string | undefined;
|
|
380
|
+
/**
|
|
381
|
+
* Save the current spec to the store.
|
|
382
|
+
*/
|
|
383
|
+
saveSpec(): Promise<Specification>;
|
|
384
|
+
/**
|
|
385
|
+
* Parse a spec from a JSON string (from AI output).
|
|
386
|
+
* Validates and normalizes the structure.
|
|
387
|
+
*/
|
|
388
|
+
parseSpecFromJSON(jsonStr: string): Specification;
|
|
389
|
+
/**
|
|
390
|
+
* Extract JSON from AI output (handles ```json blocks and raw JSON).
|
|
391
|
+
*/
|
|
392
|
+
extractJSON(text: string): string | null;
|
|
393
|
+
/**
|
|
394
|
+
* Detect if AI output contains a spec (JSON block).
|
|
395
|
+
*/
|
|
396
|
+
hasSpecInOutput(text: string): boolean;
|
|
397
|
+
/**
|
|
398
|
+
* Try to parse a spec from AI output text.
|
|
399
|
+
* Returns null if no valid spec found.
|
|
400
|
+
*/
|
|
401
|
+
tryParseSpecFromOutput(text: string): Specification | null;
|
|
402
|
+
/**
|
|
403
|
+
* Extract a JSON array from AI output (for task lists).
|
|
404
|
+
*/
|
|
405
|
+
extractJSONArray(text: string): string | null;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
/**
|
|
409
|
+
* Built-in spec templates for common development scenarios.
|
|
410
|
+
*/
|
|
411
|
+
declare const SPEC_TEMPLATES: SpecTemplate[];
|
|
412
|
+
/**
|
|
413
|
+
* Get a template by ID.
|
|
414
|
+
*/
|
|
415
|
+
declare function getTemplate(id: string): SpecTemplate | undefined;
|
|
416
|
+
/**
|
|
417
|
+
* List all available templates.
|
|
418
|
+
*/
|
|
419
|
+
declare function listTemplates(): Array<{
|
|
420
|
+
id: string;
|
|
421
|
+
name: string;
|
|
422
|
+
description: string;
|
|
423
|
+
}>;
|
|
424
|
+
/**
|
|
425
|
+
* Generate a markdown skeleton from a template.
|
|
426
|
+
*/
|
|
427
|
+
declare function templateToMarkdown(template: SpecTemplate, title?: string): string;
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* Render a task graph as ASCII art for terminal display.
|
|
431
|
+
*/
|
|
432
|
+
declare function renderTaskGraph(graph: TaskGraph, opts?: {
|
|
433
|
+
compact?: boolean;
|
|
434
|
+
}): string;
|
|
435
|
+
/**
|
|
436
|
+
* Render a progress bar.
|
|
437
|
+
*/
|
|
438
|
+
declare function renderProgress(progress: TaskProgress): string;
|
|
439
|
+
/**
|
|
440
|
+
* Render a compact task list (for quick status checks).
|
|
441
|
+
*/
|
|
442
|
+
declare function renderTaskList(graph: TaskGraph): string;
|
|
443
|
+
/**
|
|
444
|
+
* Render spec analysis summary.
|
|
445
|
+
*/
|
|
446
|
+
declare function renderSpecAnalysis(spec: Specification, analysis: {
|
|
447
|
+
completeness: number;
|
|
448
|
+
gaps: string[];
|
|
449
|
+
risks: string[];
|
|
450
|
+
suggestions: string[];
|
|
451
|
+
}): string;
|
|
452
|
+
|
|
453
|
+
/**
|
|
454
|
+
* Enhanced critical path analysis with bottleneck detection,
|
|
455
|
+
* parallel execution groups, and time estimation.
|
|
456
|
+
*/
|
|
457
|
+
interface CriticalPathAnalysis {
|
|
458
|
+
/** Ordered list of critical path task IDs. */
|
|
459
|
+
criticalPath: string[];
|
|
460
|
+
/** Total estimated hours for the critical path. */
|
|
461
|
+
totalHours: number;
|
|
462
|
+
/** Tasks that block the most downstream work. */
|
|
463
|
+
bottlenecks: BottleneckTask[];
|
|
464
|
+
/** Groups of tasks that can run in parallel. */
|
|
465
|
+
parallelGroups: string[][];
|
|
466
|
+
/** Recommended execution order respecting dependencies. */
|
|
467
|
+
executionOrder: string[];
|
|
468
|
+
/** Tasks with no blockers (can start immediately). */
|
|
469
|
+
readyTasks: string[];
|
|
470
|
+
/** Tasks that are blocked and cannot start. */
|
|
471
|
+
blockedTasks: string[];
|
|
472
|
+
}
|
|
473
|
+
interface BottleneckTask {
|
|
474
|
+
taskId: string;
|
|
475
|
+
title: string;
|
|
476
|
+
/** Number of tasks directly or transitively blocked by this task. */
|
|
477
|
+
blockedCount: number;
|
|
478
|
+
/** Total estimated hours of blocked downstream work. */
|
|
479
|
+
blockedHours: number;
|
|
480
|
+
/** Severity score (0-100). */
|
|
481
|
+
severity: number;
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
* Analyze a task graph and return critical path analysis.
|
|
485
|
+
*/
|
|
486
|
+
declare function analyzeCriticalPath(graph: TaskGraph): CriticalPathAnalysis;
|
|
487
|
+
|
|
488
|
+
interface SpecVersion {
|
|
489
|
+
version: string;
|
|
490
|
+
spec: Specification;
|
|
491
|
+
timestamp: number;
|
|
492
|
+
changeDescription?: string;
|
|
493
|
+
}
|
|
494
|
+
interface SpecDiff {
|
|
495
|
+
added: SpecRequirement[];
|
|
496
|
+
removed: SpecRequirement[];
|
|
497
|
+
modified: Array<{
|
|
498
|
+
requirement: SpecRequirement;
|
|
499
|
+
previousVersion: SpecRequirement;
|
|
500
|
+
changes: string[];
|
|
501
|
+
}>;
|
|
502
|
+
summary: string;
|
|
503
|
+
}
|
|
504
|
+
/**
|
|
505
|
+
* Track spec versions and compute diffs between versions.
|
|
506
|
+
*/
|
|
507
|
+
declare class SpecVersioning {
|
|
508
|
+
private versions;
|
|
509
|
+
/** Record a new version of a spec. */
|
|
510
|
+
recordVersion(spec: Specification, changeDescription?: string): SpecVersion;
|
|
511
|
+
/** Get version history for a spec. */
|
|
512
|
+
getHistory(specId: string): SpecVersion[];
|
|
513
|
+
/** Get a specific version of a spec. */
|
|
514
|
+
getVersion(specId: string, version: string): SpecVersion | undefined;
|
|
515
|
+
/** Get the latest version of a spec. */
|
|
516
|
+
getLatest(specId: string): SpecVersion | undefined;
|
|
517
|
+
/** Compute diff between two versions of a spec. */
|
|
518
|
+
diff(oldSpec: Specification, newSpec: Specification): SpecDiff;
|
|
519
|
+
/**
|
|
520
|
+
* Update a task graph incrementally based on spec changes.
|
|
521
|
+
* - Added requirements → new tasks
|
|
522
|
+
* - Removed requirements → remove tasks
|
|
523
|
+
* - Modified requirements → update task descriptions
|
|
524
|
+
* Returns the updated graph and list of changes made.
|
|
525
|
+
*/
|
|
526
|
+
updateTaskGraph(graph: TaskGraph, oldSpec: Specification, newSpec: Specification): {
|
|
527
|
+
graph: TaskGraph;
|
|
528
|
+
changes: string[];
|
|
529
|
+
};
|
|
530
|
+
private compareRequirements;
|
|
531
|
+
private buildTaskDescription;
|
|
532
|
+
private mapReqType;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
interface AutoExecutorOptions {
|
|
536
|
+
tracker: TaskTracker;
|
|
537
|
+
events: EventBus;
|
|
538
|
+
/** Maximum concurrent tasks. Defaults to 1 (sequential). */
|
|
539
|
+
maxConcurrent?: number;
|
|
540
|
+
/** Maximum retry attempts for failed tasks. */
|
|
541
|
+
maxRetries?: number;
|
|
542
|
+
/** Custom task executor function. */
|
|
543
|
+
executeTask: (task: TaskNode, context: TaskExecutionContext) => Promise<TaskExecutionResult>;
|
|
544
|
+
/** Called before each task starts. */
|
|
545
|
+
onTaskStart?: (task: TaskNode) => void;
|
|
546
|
+
/** Called after each task completes. */
|
|
547
|
+
onTaskComplete?: (task: TaskNode, result: TaskExecutionResult) => void;
|
|
548
|
+
/** Called when a task fails. */
|
|
549
|
+
onTaskFail?: (task: TaskNode, error: Error, retryCount: number) => void;
|
|
550
|
+
/** Called when all tasks are done or no more can execute. */
|
|
551
|
+
onDone?: (summary: ExecutionSummary) => void;
|
|
552
|
+
}
|
|
553
|
+
interface TaskExecutionContext {
|
|
554
|
+
/** The spec being implemented. */
|
|
555
|
+
spec: Specification;
|
|
556
|
+
/** The full task graph. */
|
|
557
|
+
graph: TaskGraph;
|
|
558
|
+
/** The current task being executed. */
|
|
559
|
+
task: TaskNode;
|
|
560
|
+
/** Tasks that this task depends on. */
|
|
561
|
+
dependencies: TaskNode[];
|
|
562
|
+
/** Tasks that depend on this task. */
|
|
563
|
+
dependents: TaskNode[];
|
|
564
|
+
/** Retry count for this task (0 = first attempt). */
|
|
565
|
+
retryCount: number;
|
|
566
|
+
}
|
|
567
|
+
interface TaskExecutionResult {
|
|
568
|
+
success: boolean;
|
|
569
|
+
output?: string;
|
|
570
|
+
error?: string;
|
|
571
|
+
/** If true, the task will be retried. */
|
|
572
|
+
retry?: boolean;
|
|
573
|
+
}
|
|
574
|
+
interface ExecutionSummary {
|
|
575
|
+
total: number;
|
|
576
|
+
completed: number;
|
|
577
|
+
failed: number;
|
|
578
|
+
skipped: number;
|
|
579
|
+
retried: number;
|
|
580
|
+
duration: number;
|
|
581
|
+
criticalPath: string[];
|
|
582
|
+
}
|
|
583
|
+
/**
|
|
584
|
+
* Auto-executor that drives task execution with dependency resolution,
|
|
585
|
+
* retry logic, and critical path awareness.
|
|
586
|
+
*/
|
|
587
|
+
declare class AutoExecutor {
|
|
588
|
+
private readonly opts;
|
|
589
|
+
private stopped;
|
|
590
|
+
private retryMap;
|
|
591
|
+
constructor(opts: AutoExecutorOptions);
|
|
592
|
+
/**
|
|
593
|
+
* Execute all tasks in the graph, respecting dependencies.
|
|
594
|
+
*/
|
|
595
|
+
execute(graph: TaskGraph, spec: Specification): Promise<ExecutionSummary>;
|
|
596
|
+
/** Stop execution. */
|
|
597
|
+
stop(): void;
|
|
598
|
+
/** Get tasks that are ready to execute (all dependencies completed). */
|
|
599
|
+
private getReadyTasks;
|
|
600
|
+
/** Execute a single task with retry logic. */
|
|
601
|
+
private executeTaskWithRetry;
|
|
602
|
+
/** Get tasks that this task depends on. */
|
|
603
|
+
private getTaskDependencies;
|
|
604
|
+
/** Get tasks that depend on this task. */
|
|
605
|
+
private getTaskDependents;
|
|
606
|
+
/** Detect deadlock: all remaining tasks are blocked by failed tasks. */
|
|
607
|
+
private detectDeadlock;
|
|
608
|
+
}
|
|
609
|
+
/**
|
|
610
|
+
* Create an auto-executor that works with TaskFlow.
|
|
611
|
+
*/
|
|
612
|
+
declare function createAutoExecutor(opts: {
|
|
613
|
+
tracker: TaskTracker;
|
|
614
|
+
events: EventBus;
|
|
615
|
+
executeTask: AutoExecutorOptions['executeTask'];
|
|
616
|
+
maxConcurrent?: number;
|
|
617
|
+
maxRetries?: number;
|
|
618
|
+
}): AutoExecutor;
|
|
619
|
+
|
|
620
|
+
export { AISpecBuilder, type AISpecBuilderOptions, type AISpecPhase, type AISpecSession, AutoExecutor, type AutoExecutorOptions, type BottleneckTask, type CollectedAnswer, type CriticalPathAnalysis, DefaultTaskStore, type ExecutionSummary, type GeneratedTask, SPEC_TEMPLATES, type SpecDiff, SpecDrivenDev, type SpecDrivenDevOptions, type SpecIndexEntry, SpecParser, SpecStore, type SpecStoreOptions, type SpecVersion, SpecVersioning, type TaskExecutionContext, type TaskExecutionResult, TaskFlow, type TaskFlowEventMap, type TaskFlowEventName, type TaskFlowExecutionContext, type TaskFlowOptions, type TaskFlowPhase, TaskGenerator, type TaskGeneratorOptions, type TaskGraphIndexEntry, TaskGraphStore, type TaskGraphStoreOptions, type TaskStore, TaskTracker, type TaskTrackerOptions, type TaskTransition, analyzeCriticalPath, createAutoExecutor, getTemplate, listTemplates, renderProgress, renderSpecAnalysis, renderTaskGraph, renderTaskList, templateToMarkdown };
|