@wrongstack/core 0.1.9 → 0.2.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-DmBiCipY.d.ts +33 -0
- package/dist/compactor-DSl2FK7a.d.ts +17 -0
- package/dist/config-DXrqb41m.d.ts +193 -0
- package/dist/{provider-txgB0Oq9.d.ts → context-u0bryklF.d.ts} +540 -472
- package/dist/coordination/index.d.ts +892 -0
- package/dist/coordination/index.js +2869 -0
- package/dist/coordination/index.js.map +1 -0
- package/dist/defaults/index.d.ts +34 -2309
- package/dist/defaults/index.js +5610 -4608
- package/dist/defaults/index.js.map +1 -1
- package/dist/events-B6Q03pTu.d.ts +290 -0
- package/dist/execution/index.d.ts +260 -0
- package/dist/execution/index.js +1625 -0
- package/dist/execution/index.js.map +1 -0
- package/dist/index.d.ts +81 -11
- package/dist/index.js +7727 -6174
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/index.d.ts +10 -0
- package/dist/infrastructure/index.js +575 -0
- package/dist/infrastructure/index.js.map +1 -0
- package/dist/input-reader-E-ffP2ee.d.ts +12 -0
- package/dist/kernel/index.d.ts +15 -4
- package/dist/kernel/index.js.map +1 -1
- package/dist/logger-BH6AE0W9.d.ts +24 -0
- package/dist/logger-BMQgxvdy.d.ts +12 -0
- package/dist/mcp-servers-BA1Ofmfj.d.ts +100 -0
- package/dist/memory-CEXuo7sz.d.ts +16 -0
- package/dist/mode-CV077NjV.d.ts +27 -0
- package/dist/models/index.d.ts +60 -0
- package/dist/models/index.js +621 -0
- package/dist/models/index.js.map +1 -0
- package/dist/models-registry-DqzwpBQy.d.ts +46 -0
- package/dist/models-registry-Y2xbog0E.d.ts +95 -0
- package/dist/multi-agent-BDfkxL5C.d.ts +351 -0
- package/dist/observability/index.d.ts +353 -0
- package/dist/observability/index.js +691 -0
- package/dist/observability/index.js.map +1 -0
- package/dist/observability-BhnVLBLS.d.ts +67 -0
- package/dist/path-resolver-CPRj4bFY.d.ts +10 -0
- package/dist/path-resolver-Crkt8wTQ.d.ts +54 -0
- package/dist/plugin-CoYYZKdn.d.ts +447 -0
- package/dist/renderer-0A2ZEtca.d.ts +158 -0
- package/dist/sdd/index.d.ts +206 -0
- package/dist/sdd/index.js +864 -0
- package/dist/sdd/index.js.map +1 -0
- package/dist/secret-scrubber-3TLUkiCV.d.ts +31 -0
- package/dist/secret-scrubber-CwYliRWd.d.ts +54 -0
- package/dist/secret-vault-DoISxaKO.d.ts +19 -0
- package/dist/security/index.d.ts +46 -0
- package/dist/security/index.js +536 -0
- package/dist/security/index.js.map +1 -0
- package/dist/selector-BRqzvugb.d.ts +51 -0
- package/dist/session-reader-C3x96CDR.d.ts +150 -0
- package/dist/skill-Bx8jxznf.d.ts +72 -0
- package/dist/storage/index.d.ts +540 -0
- package/dist/storage/index.js +1802 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/{system-prompt-vAB0F54-.d.ts → system-prompt-CG9jU5-5.d.ts} +9 -1
- package/dist/task-graph-BITvWt4t.d.ts +160 -0
- package/dist/tool-executor-CYdZdtno.d.ts +97 -0
- package/dist/types/index.d.ts +26 -4
- package/dist/types/index.js +1787 -4
- package/dist/types/index.js.map +1 -1
- package/dist/utils/index.d.ts +49 -2
- package/dist/utils/index.js +100 -2
- package/dist/utils/index.js.map +1 -1
- package/package.json +34 -2
- package/dist/mode-Pjt5vMS6.d.ts +0 -815
- package/dist/session-reader-9sOTgmeC.d.ts +0 -1087
|
@@ -0,0 +1,206 @@
|
|
|
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-B6Q03pTu.js';
|
|
3
|
+
import { D as DoneCondition } from '../multi-agent-BDfkxL5C.js';
|
|
4
|
+
import '../context-u0bryklF.js';
|
|
5
|
+
|
|
6
|
+
declare class SpecParser {
|
|
7
|
+
parse(content: string): Specification;
|
|
8
|
+
private extractTitle;
|
|
9
|
+
private extractVersion;
|
|
10
|
+
private extractOverview;
|
|
11
|
+
private extractSections;
|
|
12
|
+
private extractRequirements;
|
|
13
|
+
private parseRequirementLine;
|
|
14
|
+
private mapSectionType;
|
|
15
|
+
analyze(spec: Specification): SpecAnalysis;
|
|
16
|
+
validate(spec: Specification): SpecValidationResult;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface TaskStore {
|
|
20
|
+
saveGraph(graph: TaskGraph): Promise<void>;
|
|
21
|
+
loadGraph(id: string): Promise<TaskGraph | null>;
|
|
22
|
+
listGraphs(): Promise<{
|
|
23
|
+
id: string;
|
|
24
|
+
title: string;
|
|
25
|
+
updatedAt: number;
|
|
26
|
+
}[]>;
|
|
27
|
+
deleteGraph(id: string): Promise<void>;
|
|
28
|
+
}
|
|
29
|
+
interface TaskTrackerOptions {
|
|
30
|
+
store: TaskStore;
|
|
31
|
+
/**
|
|
32
|
+
* Called when an in-the-background persistence (`saveGraph`) rejects.
|
|
33
|
+
* The synchronous TaskTracker methods (addNode/addEdge/updateNodeStatus)
|
|
34
|
+
* fire-and-forget their writes; without this, a failing store silently
|
|
35
|
+
* loses graph mutations. Defaults to a console.warn.
|
|
36
|
+
*/
|
|
37
|
+
onPersistError?: (err: unknown) => void;
|
|
38
|
+
}
|
|
39
|
+
interface TaskTransition {
|
|
40
|
+
from: TaskNode['status'];
|
|
41
|
+
to: TaskNode['status'];
|
|
42
|
+
timestamp: number;
|
|
43
|
+
reason?: string;
|
|
44
|
+
}
|
|
45
|
+
declare class TaskTracker {
|
|
46
|
+
private readonly opts;
|
|
47
|
+
private graph;
|
|
48
|
+
private transitions;
|
|
49
|
+
constructor(opts: TaskTrackerOptions);
|
|
50
|
+
createGraph(specId: string, title: string): Promise<TaskGraph>;
|
|
51
|
+
loadGraph(id: string): Promise<TaskGraph | null>;
|
|
52
|
+
addNode(node: Omit<TaskNode, 'id' | 'createdAt' | 'updatedAt'>): TaskNode;
|
|
53
|
+
addEdge(from: string, to: string, type?: TaskGraph['edges'][0]['type']): void;
|
|
54
|
+
updateNodeStatus(id: string, status: TaskNode['status'], reason?: string): void;
|
|
55
|
+
getNode(id: string): TaskNode | undefined;
|
|
56
|
+
getAllNodes(filter?: TaskFilter, sort?: TaskSort): TaskNode[];
|
|
57
|
+
getChildren(parentId: string): TaskNode[];
|
|
58
|
+
getDependents(taskId: string): string[];
|
|
59
|
+
getBlockers(taskId: string): string[];
|
|
60
|
+
canStart(taskId: string): boolean;
|
|
61
|
+
getProgress(): TaskProgress;
|
|
62
|
+
getTransitions(taskId?: string): TaskTransition[];
|
|
63
|
+
private unblockDependents;
|
|
64
|
+
private checkAndBlockIfNeeded;
|
|
65
|
+
/**
|
|
66
|
+
* Fire-and-forget persistence with attached error handler.
|
|
67
|
+
* Synchronous mutators (addNode/addEdge/updateNodeStatus) use this to
|
|
68
|
+
* avoid forcing an async cascade through every caller; if the store
|
|
69
|
+
* rejects, the configured `onPersistError` is invoked so failures are
|
|
70
|
+
* surfaced instead of swallowed by an unhandled promise rejection.
|
|
71
|
+
*/
|
|
72
|
+
private persist;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
interface TaskGeneratorOptions {
|
|
76
|
+
taskTracker: TaskTracker;
|
|
77
|
+
}
|
|
78
|
+
interface GeneratedTask {
|
|
79
|
+
specRequirementId?: string;
|
|
80
|
+
title: string;
|
|
81
|
+
description: string;
|
|
82
|
+
type: TaskType;
|
|
83
|
+
priority: TaskPriority;
|
|
84
|
+
estimateHours?: number;
|
|
85
|
+
tags?: string[];
|
|
86
|
+
}
|
|
87
|
+
declare class TaskGenerator {
|
|
88
|
+
private readonly opts;
|
|
89
|
+
constructor(opts: TaskGeneratorOptions);
|
|
90
|
+
generateFromSpec(spec: Specification): Promise<TaskGraph>;
|
|
91
|
+
private createTaskFromRequirement;
|
|
92
|
+
private createTaskFromEndpoint;
|
|
93
|
+
private buildDescription;
|
|
94
|
+
private mapRequirementType;
|
|
95
|
+
private estimateHours;
|
|
96
|
+
private estimateForEndpoint;
|
|
97
|
+
generateSubtasks(parentTaskId: string, spec: Specification): Promise<void>;
|
|
98
|
+
}
|
|
99
|
+
declare class DefaultTaskStore implements TaskStore {
|
|
100
|
+
private graphs;
|
|
101
|
+
saveGraph(graph: TaskGraph): Promise<void>;
|
|
102
|
+
loadGraph(id: string): Promise<TaskGraph | null>;
|
|
103
|
+
listGraphs(): Promise<{
|
|
104
|
+
id: string;
|
|
105
|
+
title: string;
|
|
106
|
+
updatedAt: number;
|
|
107
|
+
}[]>;
|
|
108
|
+
deleteGraph(id: string): Promise<void>;
|
|
109
|
+
private cloneGraph;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Extended event map used internally by TaskFlow and multi-agent components.
|
|
114
|
+
* These events are emitted on the injected EventBus and are a subset of
|
|
115
|
+
* the full EventMap — they do not require a separate registration.
|
|
116
|
+
*/
|
|
117
|
+
interface TaskFlowEventMap {
|
|
118
|
+
'phase.change': {
|
|
119
|
+
from: TaskFlowPhase;
|
|
120
|
+
to: TaskFlowPhase;
|
|
121
|
+
};
|
|
122
|
+
'task.started': {
|
|
123
|
+
taskId: string;
|
|
124
|
+
};
|
|
125
|
+
'task.completed': {
|
|
126
|
+
taskId: string;
|
|
127
|
+
result?: unknown;
|
|
128
|
+
};
|
|
129
|
+
'task.failed': {
|
|
130
|
+
taskId: string;
|
|
131
|
+
error: string;
|
|
132
|
+
};
|
|
133
|
+
'task.review': {
|
|
134
|
+
taskId: string;
|
|
135
|
+
};
|
|
136
|
+
'spec.analyzed': {
|
|
137
|
+
analysis: SpecAnalysis;
|
|
138
|
+
};
|
|
139
|
+
progress: {
|
|
140
|
+
percent: number;
|
|
141
|
+
message: string;
|
|
142
|
+
};
|
|
143
|
+
done: {
|
|
144
|
+
graph: TaskGraph;
|
|
145
|
+
};
|
|
146
|
+
error: {
|
|
147
|
+
phase: TaskFlowPhase;
|
|
148
|
+
error: Error;
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
type TaskFlowPhase = 'idle' | 'parsing' | 'analyzing' | 'generating' | 'executing' | 'reviewing' | 'completing' | 'done' | 'failed';
|
|
152
|
+
type TaskFlowEventName = keyof TaskFlowEventMap;
|
|
153
|
+
interface TaskFlowOptions {
|
|
154
|
+
tracker: TaskTracker;
|
|
155
|
+
events: EventBus;
|
|
156
|
+
doneCondition?: DoneCondition;
|
|
157
|
+
maxConcurrent?: number;
|
|
158
|
+
}
|
|
159
|
+
interface TaskFlowExecutionContext {
|
|
160
|
+
executeTask: (task: TaskNode) => Promise<unknown>;
|
|
161
|
+
onTaskComplete?: (task: TaskNode, result: unknown) => void;
|
|
162
|
+
onTaskFail?: (task: TaskNode, error: Error) => void;
|
|
163
|
+
}
|
|
164
|
+
declare class TaskFlow {
|
|
165
|
+
private readonly opts;
|
|
166
|
+
private phase;
|
|
167
|
+
private spec;
|
|
168
|
+
private graph;
|
|
169
|
+
private stopped;
|
|
170
|
+
constructor(opts: TaskFlowOptions);
|
|
171
|
+
private emit;
|
|
172
|
+
fromSpec(specContent: string): Promise<TaskGraph>;
|
|
173
|
+
execute(ctx: TaskFlowExecutionContext): Promise<TaskGraph>;
|
|
174
|
+
reviewTask(taskId: string, approved: boolean, comment?: string): Promise<void>;
|
|
175
|
+
stop(): void;
|
|
176
|
+
getPhase(): TaskFlowPhase;
|
|
177
|
+
getGraph(): TaskGraph | null;
|
|
178
|
+
getSpec(): Specification | null;
|
|
179
|
+
private setPhase;
|
|
180
|
+
private getExecutableTasks;
|
|
181
|
+
private executeSingleTask;
|
|
182
|
+
private checkDoneCondition;
|
|
183
|
+
private emitProgress;
|
|
184
|
+
}
|
|
185
|
+
interface SpecDrivenDevOptions {
|
|
186
|
+
workingDirectory: string;
|
|
187
|
+
events: EventBus;
|
|
188
|
+
doneCondition?: DoneCondition;
|
|
189
|
+
}
|
|
190
|
+
declare class SpecDrivenDev {
|
|
191
|
+
private store;
|
|
192
|
+
private tracker;
|
|
193
|
+
private readonly events;
|
|
194
|
+
private flows;
|
|
195
|
+
constructor(opts: SpecDrivenDevOptions);
|
|
196
|
+
createFlow(specContent: string, options?: Partial<TaskFlowOptions>): Promise<TaskFlow>;
|
|
197
|
+
getTracker(): TaskTracker;
|
|
198
|
+
getFlow(graphId: string): TaskFlow | undefined;
|
|
199
|
+
listFlows(): {
|
|
200
|
+
id: string;
|
|
201
|
+
title: string;
|
|
202
|
+
phase: TaskFlowPhase;
|
|
203
|
+
}[];
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export { DefaultTaskStore, type GeneratedTask, SpecDrivenDev, type SpecDrivenDevOptions, SpecParser, TaskFlow, type TaskFlowEventMap, type TaskFlowEventName, type TaskFlowExecutionContext, type TaskFlowOptions, type TaskFlowPhase, TaskGenerator, type TaskGeneratorOptions, type TaskStore, TaskTracker, type TaskTrackerOptions, type TaskTransition };
|