@ronkovic/aad 0.3.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/LICENSE +21 -0
- package/README.md +312 -0
- package/bin/aad.js +2 -0
- package/package.json +78 -0
- package/src/__tests__/e2e/pipeline-e2e.test.ts +279 -0
- package/src/__tests__/e2e/resume-e2e.test.ts +200 -0
- package/src/__tests__/integration/cli-smoke.test.ts +175 -0
- package/src/__tests__/integration/pipeline.test.ts +346 -0
- package/src/bun-imports.d.ts +14 -0
- package/src/main.ts +52 -0
- package/src/modules/claude-provider/__tests__/claude-cli.adapter.test.ts +277 -0
- package/src/modules/claude-provider/__tests__/claude-sdk-real-env.test.ts +127 -0
- package/src/modules/claude-provider/__tests__/claude-sdk.adapter.test.ts +347 -0
- package/src/modules/claude-provider/__tests__/effort-strategy.test.ts +212 -0
- package/src/modules/claude-provider/__tests__/provider-registry.test.ts +251 -0
- package/src/modules/claude-provider/__tests__/retry.test.ts +201 -0
- package/src/modules/claude-provider/claude-cli.adapter.ts +156 -0
- package/src/modules/claude-provider/claude-provider.port.ts +35 -0
- package/src/modules/claude-provider/claude-sdk.adapter.ts +217 -0
- package/src/modules/claude-provider/effort-strategy.ts +94 -0
- package/src/modules/claude-provider/index.ts +32 -0
- package/src/modules/claude-provider/provider-registry.ts +92 -0
- package/src/modules/claude-provider/retry.ts +81 -0
- package/src/modules/cli/__tests__/app.test.ts +160 -0
- package/src/modules/cli/__tests__/cleanup.test.ts +111 -0
- package/src/modules/cli/__tests__/commands.test.ts +186 -0
- package/src/modules/cli/__tests__/output.test.ts +329 -0
- package/src/modules/cli/__tests__/resume.test.ts +324 -0
- package/src/modules/cli/__tests__/run.test.ts +168 -0
- package/src/modules/cli/__tests__/shutdown.test.ts +168 -0
- package/src/modules/cli/__tests__/status.test.ts +144 -0
- package/src/modules/cli/app.ts +241 -0
- package/src/modules/cli/commands/cleanup.ts +120 -0
- package/src/modules/cli/commands/resume.ts +156 -0
- package/src/modules/cli/commands/run.ts +322 -0
- package/src/modules/cli/commands/status.ts +101 -0
- package/src/modules/cli/index.ts +29 -0
- package/src/modules/cli/output.ts +256 -0
- package/src/modules/cli/shutdown.ts +122 -0
- package/src/modules/dashboard/__tests__/api-routes.test.ts +204 -0
- package/src/modules/dashboard/__tests__/file-watcher.test.ts +34 -0
- package/src/modules/dashboard/__tests__/server.test.ts +120 -0
- package/src/modules/dashboard/__tests__/sse-broadcaster.test.ts +163 -0
- package/src/modules/dashboard/__tests__/sse-routes.test.ts +58 -0
- package/src/modules/dashboard/__tests__/state-aggregator.test.ts +330 -0
- package/src/modules/dashboard/index.ts +8 -0
- package/src/modules/dashboard/routes/api.ts +84 -0
- package/src/modules/dashboard/routes/sse.ts +37 -0
- package/src/modules/dashboard/server.ts +111 -0
- package/src/modules/dashboard/services/file-watcher.ts +36 -0
- package/src/modules/dashboard/services/sse-broadcaster.ts +81 -0
- package/src/modules/dashboard/services/state-aggregator.ts +132 -0
- package/src/modules/dashboard/ui/dashboard.html +405 -0
- package/src/modules/git-workspace/__tests__/branch-manager.test.ts +335 -0
- package/src/modules/git-workspace/__tests__/git-exec.test.ts +91 -0
- package/src/modules/git-workspace/__tests__/memory-sync.test.ts +273 -0
- package/src/modules/git-workspace/__tests__/merge-service.test.ts +286 -0
- package/src/modules/git-workspace/__tests__/settings-merge.test.ts +163 -0
- package/src/modules/git-workspace/__tests__/worktree-manager.test.ts +247 -0
- package/src/modules/git-workspace/branch-manager.ts +191 -0
- package/src/modules/git-workspace/git-exec.ts +124 -0
- package/src/modules/git-workspace/index.ts +17 -0
- package/src/modules/git-workspace/memory-sync.ts +89 -0
- package/src/modules/git-workspace/merge-service.ts +156 -0
- package/src/modules/git-workspace/settings-merge.ts +95 -0
- package/src/modules/git-workspace/worktree-manager.ts +199 -0
- package/src/modules/logging/__tests__/log-store.test.ts +242 -0
- package/src/modules/logging/__tests__/logger.test.ts +81 -0
- package/src/modules/logging/__tests__/sse-transport.test.ts +93 -0
- package/src/modules/logging/index.ts +7 -0
- package/src/modules/logging/log-store.ts +80 -0
- package/src/modules/logging/logger.ts +55 -0
- package/src/modules/logging/transports/sse-transport.ts +28 -0
- package/src/modules/multi-repo/__tests__/multi-repo-planner.test.ts +93 -0
- package/src/modules/multi-repo/__tests__/repo-context.test.ts +79 -0
- package/src/modules/multi-repo/index.ts +12 -0
- package/src/modules/multi-repo/multi-repo-planner.ts +112 -0
- package/src/modules/multi-repo/repo-context.ts +71 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-81991/progress.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-81991/queue/completed/task-getall-2.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-81991/queue/pending/task-1.json +13 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-81991/queue/pending/task-getall-1.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-81991/queue/pending/task-status-change.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-81991/workers/worker-1.json +5 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-81991/workers/worker-2.json +5 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-82469/progress.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-82469/queue/completed/task-getall-2.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-82469/queue/pending/task-1.json +13 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-82469/queue/pending/task-getall-1.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-82469/queue/pending/task-status-change.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-82469/workers/worker-1.json +5 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-82469/workers/worker-2.json +5 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-85301/progress.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-85301/queue/completed/task-getall-2.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-85301/queue/pending/task-1.json +13 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-85301/queue/pending/task-getall-1.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-85301/queue/pending/task-status-change.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-85301/workers/worker-1.json +5 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-85301/workers/worker-2.json +5 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-85759/progress.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-85759/queue/completed/task-getall-2.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-85759/queue/pending/task-1.json +13 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-85759/queue/pending/task-getall-1.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-85759/queue/pending/task-status-change.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-85759/workers/worker-1.json +5 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-85759/workers/worker-2.json +5 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-86184/progress.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-86184/queue/completed/task-getall-2.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-86184/queue/pending/task-1.json +13 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-86184/queue/pending/task-getall-1.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-86184/queue/pending/task-status-change.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-86184/workers/worker-1.json +5 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-86184/workers/worker-2.json +5 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-88026/progress.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-88026/queue/completed/task-getall-2.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-88026/queue/pending/task-1.json +13 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-88026/queue/pending/task-getall-1.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-88026/queue/pending/task-status-change.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-88026/workers/worker-1.json +5 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-88026/workers/worker-2.json +5 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-89475/progress.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-89475/queue/completed/task-getall-2.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-89475/queue/pending/task-1.json +13 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-89475/queue/pending/task-getall-1.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-89475/queue/pending/task-status-change.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-89475/workers/worker-1.json +5 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-89475/workers/worker-2.json +5 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-89924/progress.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-89924/queue/completed/task-getall-2.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-89924/queue/pending/task-1.json +13 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-89924/queue/pending/task-getall-1.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-89924/queue/pending/task-status-change.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-89924/workers/worker-1.json +5 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-89924/workers/worker-2.json +5 -0
- package/src/modules/persistence/__tests__/file-lock.test.ts +141 -0
- package/src/modules/persistence/__tests__/index.test.ts +38 -0
- package/src/modules/persistence/__tests__/stores.test.ts +594 -0
- package/src/modules/persistence/file-lock.ts +158 -0
- package/src/modules/persistence/fs-run-store.ts +73 -0
- package/src/modules/persistence/fs-task-store.ts +152 -0
- package/src/modules/persistence/fs-worker-store.ts +116 -0
- package/src/modules/persistence/in-memory-stores.ts +98 -0
- package/src/modules/persistence/index.ts +60 -0
- package/src/modules/persistence/stores.port.ts +60 -0
- package/src/modules/planning/__tests__/file-conflict-validator.test.ts +256 -0
- package/src/modules/planning/__tests__/planning-service.test.ts +366 -0
- package/src/modules/planning/__tests__/project-detection.test.ts +707 -0
- package/src/modules/planning/file-conflict-validator.ts +135 -0
- package/src/modules/planning/index.ts +40 -0
- package/src/modules/planning/planning.service.ts +262 -0
- package/src/modules/planning/project-detection.ts +525 -0
- package/src/modules/plugin/__tests__/plugin-loader.test.ts +83 -0
- package/src/modules/plugin/__tests__/plugin-manager.test.ts +187 -0
- package/src/modules/plugin/index.ts +3 -0
- package/src/modules/plugin/plugin-loader.ts +46 -0
- package/src/modules/plugin/plugin-manager.ts +90 -0
- package/src/modules/plugin/plugin.types.ts +37 -0
- package/src/modules/process-manager/__tests__/process-manager.test.ts +210 -0
- package/src/modules/process-manager/__tests__/worker.test.ts +89 -0
- package/src/modules/process-manager/index.ts +5 -0
- package/src/modules/process-manager/process-manager.ts +193 -0
- package/src/modules/process-manager/worker.ts +106 -0
- package/src/modules/task-execution/__tests__/default-spawner.test.ts +154 -0
- package/src/modules/task-execution/__tests__/executor.test.ts +760 -0
- package/src/modules/task-execution/__tests__/implementer-green.test.ts +286 -0
- package/src/modules/task-execution/__tests__/merge-phase.test.ts +368 -0
- package/src/modules/task-execution/__tests__/reviewer.test.ts +302 -0
- package/src/modules/task-execution/__tests__/tester-red.test.ts +281 -0
- package/src/modules/task-execution/__tests__/tester-verify.test.ts +313 -0
- package/src/modules/task-execution/executor.ts +303 -0
- package/src/modules/task-execution/index.ts +45 -0
- package/src/modules/task-execution/phases/default-spawner.ts +49 -0
- package/src/modules/task-execution/phases/implementer-green.ts +100 -0
- package/src/modules/task-execution/phases/merge.ts +122 -0
- package/src/modules/task-execution/phases/reviewer.ts +160 -0
- package/src/modules/task-execution/phases/tester-red.ts +100 -0
- package/src/modules/task-execution/phases/tester-verify.ts +120 -0
- package/src/modules/task-queue/__tests__/dependency-resolver.test.ts +456 -0
- package/src/modules/task-queue/__tests__/dispatcher.test.ts +824 -0
- package/src/modules/task-queue/__tests__/task-plan.test.ts +122 -0
- package/src/modules/task-queue/__tests__/task.test.ts +130 -0
- package/src/modules/task-queue/dependency-resolver.ts +171 -0
- package/src/modules/task-queue/dispatcher.ts +372 -0
- package/src/modules/task-queue/index.ts +16 -0
- package/src/modules/task-queue/task-plan.ts +40 -0
- package/src/modules/task-queue/task.ts +67 -0
- package/src/shared/__tests__/config.test.ts +204 -0
- package/src/shared/__tests__/errors.test.ts +285 -0
- package/src/shared/__tests__/events.test.ts +496 -0
- package/src/shared/__tests__/types.test.ts +360 -0
- package/src/shared/config.ts +133 -0
- package/src/shared/errors.ts +128 -0
- package/src/shared/events.ts +171 -0
- package/src/shared/types.ts +143 -0
- package/tsconfig.json +30 -0
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { EventEmitter } from "node:events";
|
|
2
|
+
import type {
|
|
3
|
+
TaskId,
|
|
4
|
+
WorkerId,
|
|
5
|
+
RunId,
|
|
6
|
+
ProgressState,
|
|
7
|
+
TaskExecutionResult,
|
|
8
|
+
} from "./types";
|
|
9
|
+
|
|
10
|
+
export type AADEvent =
|
|
11
|
+
| {
|
|
12
|
+
type: "task:dispatched";
|
|
13
|
+
taskId: TaskId;
|
|
14
|
+
workerId: WorkerId;
|
|
15
|
+
}
|
|
16
|
+
| {
|
|
17
|
+
type: "task:completed";
|
|
18
|
+
taskId: TaskId;
|
|
19
|
+
result: TaskExecutionResult;
|
|
20
|
+
}
|
|
21
|
+
| {
|
|
22
|
+
type: "task:failed";
|
|
23
|
+
taskId: TaskId;
|
|
24
|
+
error: string;
|
|
25
|
+
}
|
|
26
|
+
| {
|
|
27
|
+
type: "task:stale";
|
|
28
|
+
taskId: TaskId;
|
|
29
|
+
elapsed: number;
|
|
30
|
+
}
|
|
31
|
+
| {
|
|
32
|
+
type: "task:retry";
|
|
33
|
+
taskId: TaskId;
|
|
34
|
+
retryCount: number;
|
|
35
|
+
}
|
|
36
|
+
| {
|
|
37
|
+
type: "worker:idle";
|
|
38
|
+
workerId: WorkerId;
|
|
39
|
+
}
|
|
40
|
+
| {
|
|
41
|
+
type: "worker:started";
|
|
42
|
+
workerId: WorkerId;
|
|
43
|
+
}
|
|
44
|
+
| {
|
|
45
|
+
type: "worker:stopped";
|
|
46
|
+
workerId: WorkerId;
|
|
47
|
+
}
|
|
48
|
+
| {
|
|
49
|
+
type: "worker:busy";
|
|
50
|
+
workerId: WorkerId;
|
|
51
|
+
taskId: TaskId;
|
|
52
|
+
}
|
|
53
|
+
| {
|
|
54
|
+
type: "queue:initialized";
|
|
55
|
+
totalTasks: number;
|
|
56
|
+
}
|
|
57
|
+
| {
|
|
58
|
+
type: "queue:empty";
|
|
59
|
+
}
|
|
60
|
+
| {
|
|
61
|
+
type: "progress:updated";
|
|
62
|
+
state: ProgressState;
|
|
63
|
+
}
|
|
64
|
+
| {
|
|
65
|
+
type: "run:completed";
|
|
66
|
+
runId: RunId;
|
|
67
|
+
}
|
|
68
|
+
| {
|
|
69
|
+
type: "run:failed";
|
|
70
|
+
runId: RunId;
|
|
71
|
+
error: string;
|
|
72
|
+
}
|
|
73
|
+
| {
|
|
74
|
+
type: "log:entry";
|
|
75
|
+
entry: {
|
|
76
|
+
level: string;
|
|
77
|
+
service: string;
|
|
78
|
+
message: string;
|
|
79
|
+
timestamp: number;
|
|
80
|
+
[key: string]: unknown;
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
| {
|
|
84
|
+
type: "planning:started";
|
|
85
|
+
requirementsPath: string;
|
|
86
|
+
}
|
|
87
|
+
| {
|
|
88
|
+
type: "planning:completed";
|
|
89
|
+
taskCount: number;
|
|
90
|
+
}
|
|
91
|
+
| {
|
|
92
|
+
type: "planning:failed";
|
|
93
|
+
error: string;
|
|
94
|
+
}
|
|
95
|
+
| {
|
|
96
|
+
type: "execution:started";
|
|
97
|
+
taskId: TaskId;
|
|
98
|
+
}
|
|
99
|
+
| {
|
|
100
|
+
type: "execution:completed";
|
|
101
|
+
taskId: TaskId;
|
|
102
|
+
duration: number;
|
|
103
|
+
}
|
|
104
|
+
| {
|
|
105
|
+
type: "execution:phase:started";
|
|
106
|
+
taskId: TaskId;
|
|
107
|
+
phase: string;
|
|
108
|
+
}
|
|
109
|
+
| {
|
|
110
|
+
type: "execution:phase:completed";
|
|
111
|
+
taskId: TaskId;
|
|
112
|
+
phase: string;
|
|
113
|
+
duration: number;
|
|
114
|
+
}
|
|
115
|
+
| {
|
|
116
|
+
type: "execution:phase:failed";
|
|
117
|
+
taskId: TaskId;
|
|
118
|
+
phase: string;
|
|
119
|
+
error: string;
|
|
120
|
+
}
|
|
121
|
+
| {
|
|
122
|
+
type: "execution:merge:conflict";
|
|
123
|
+
taskId: TaskId;
|
|
124
|
+
conflictedFiles: string[];
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export type EventType = AADEvent["type"] | "*";
|
|
128
|
+
export type EventListener<T extends AADEvent = AADEvent> = (event: T) => void;
|
|
129
|
+
|
|
130
|
+
export class EventBus {
|
|
131
|
+
private emitter: EventEmitter;
|
|
132
|
+
private listenerMap: WeakMap<EventListener<AADEvent>, EventListener<AADEvent>>;
|
|
133
|
+
|
|
134
|
+
constructor() {
|
|
135
|
+
this.emitter = new EventEmitter();
|
|
136
|
+
this.emitter.setMaxListeners(100);
|
|
137
|
+
this.listenerMap = new WeakMap();
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
on<T extends AADEvent>(
|
|
141
|
+
type: T["type"] | "*",
|
|
142
|
+
listener: EventListener<T>
|
|
143
|
+
): void {
|
|
144
|
+
const wrappedListener = (event: AADEvent): void => {
|
|
145
|
+
try {
|
|
146
|
+
listener(event as T);
|
|
147
|
+
} catch (error) {
|
|
148
|
+
console.error(`EventBus listener error for ${type}:`, error);
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
this.listenerMap.set(listener as EventListener<AADEvent>, wrappedListener);
|
|
153
|
+
this.emitter.on(type, wrappedListener);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
emit(event: AADEvent): void {
|
|
157
|
+
this.emitter.emit(event.type, event);
|
|
158
|
+
this.emitter.emit("*", event);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
off<T extends AADEvent>(
|
|
162
|
+
type: T["type"] | "*",
|
|
163
|
+
listener: EventListener<T>
|
|
164
|
+
): void {
|
|
165
|
+
const wrappedListener = this.listenerMap.get(listener as EventListener<AADEvent>);
|
|
166
|
+
if (wrappedListener) {
|
|
167
|
+
this.emitter.off(type, wrappedListener);
|
|
168
|
+
this.listenerMap.delete(listener as EventListener<AADEvent>);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
// Branded Types
|
|
2
|
+
export type TaskId = string & { readonly __brand: "TaskId" };
|
|
3
|
+
export type WorkerId = string & { readonly __brand: "WorkerId" };
|
|
4
|
+
export type RunId = string & { readonly __brand: "RunId" };
|
|
5
|
+
|
|
6
|
+
export function createTaskId(id: string): TaskId {
|
|
7
|
+
if (!id || id.trim() === "") {
|
|
8
|
+
throw new Error("TaskId cannot be empty");
|
|
9
|
+
}
|
|
10
|
+
return id as TaskId;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function createWorkerId(id: string): WorkerId {
|
|
14
|
+
if (!id || id.trim() === "") {
|
|
15
|
+
throw new Error("WorkerId cannot be empty");
|
|
16
|
+
}
|
|
17
|
+
return id as WorkerId;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function createRunId(id: string): RunId {
|
|
21
|
+
if (!id || id.trim() === "") {
|
|
22
|
+
throw new Error("RunId cannot be empty");
|
|
23
|
+
}
|
|
24
|
+
return id as RunId;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Task Status
|
|
28
|
+
export type TaskStatus = "pending" | "running" | "completed" | "failed";
|
|
29
|
+
|
|
30
|
+
// Effort Levels
|
|
31
|
+
export type EffortLevel = "low" | "medium" | "high";
|
|
32
|
+
|
|
33
|
+
// Phase Names
|
|
34
|
+
export type PhaseName =
|
|
35
|
+
| "splitter"
|
|
36
|
+
| "tester"
|
|
37
|
+
| "implementer"
|
|
38
|
+
| "reviewer"
|
|
39
|
+
| "merge-resolver";
|
|
40
|
+
|
|
41
|
+
// Progress State
|
|
42
|
+
export interface ProgressState {
|
|
43
|
+
total: number;
|
|
44
|
+
pending: number;
|
|
45
|
+
running: number;
|
|
46
|
+
completed: number;
|
|
47
|
+
failed: number;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Task Execution Result
|
|
51
|
+
export interface TaskExecutionResult {
|
|
52
|
+
taskId: TaskId;
|
|
53
|
+
status: TaskStatus;
|
|
54
|
+
duration: number;
|
|
55
|
+
output?: string;
|
|
56
|
+
error?: string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// RepoName branded type
|
|
60
|
+
export type RepoName = string & { readonly __brand: "RepoName" };
|
|
61
|
+
|
|
62
|
+
export function createRepoName(name: string): RepoName {
|
|
63
|
+
if (!name || name.trim() === "") {
|
|
64
|
+
throw new Error("RepoName cannot be empty");
|
|
65
|
+
}
|
|
66
|
+
if (!/^[a-zA-Z0-9_-]+$/.test(name)) {
|
|
67
|
+
throw new Error("RepoName must contain only alphanumeric characters, hyphens, and underscores");
|
|
68
|
+
}
|
|
69
|
+
return name as RepoName;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Task (full domain model)
|
|
73
|
+
export interface Task {
|
|
74
|
+
taskId: TaskId;
|
|
75
|
+
title: string;
|
|
76
|
+
description: string;
|
|
77
|
+
filesToModify: string[];
|
|
78
|
+
dependsOn: TaskId[];
|
|
79
|
+
priority: number;
|
|
80
|
+
status: TaskStatus;
|
|
81
|
+
workerId?: WorkerId;
|
|
82
|
+
startTime?: string;
|
|
83
|
+
endTime?: string;
|
|
84
|
+
retryCount: number;
|
|
85
|
+
failureReason?: string;
|
|
86
|
+
repoName?: RepoName;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Worker Status
|
|
90
|
+
export type WorkerStatus = "idle" | "busy" | "stopped";
|
|
91
|
+
|
|
92
|
+
export interface Worker {
|
|
93
|
+
workerId: WorkerId;
|
|
94
|
+
status: WorkerStatus;
|
|
95
|
+
currentTask: TaskId | null;
|
|
96
|
+
pid?: number;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// Run State
|
|
100
|
+
export interface RunState {
|
|
101
|
+
runId: RunId;
|
|
102
|
+
parentBranch: string;
|
|
103
|
+
totalTasks: number;
|
|
104
|
+
pending: number;
|
|
105
|
+
running: number;
|
|
106
|
+
completed: number;
|
|
107
|
+
failed: number;
|
|
108
|
+
startTime: string;
|
|
109
|
+
endTime?: string;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// Task Plan
|
|
113
|
+
export interface TaskPlan {
|
|
114
|
+
runId: RunId;
|
|
115
|
+
parentBranch: string;
|
|
116
|
+
title?: string;
|
|
117
|
+
description?: string;
|
|
118
|
+
tasks: Task[];
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// Test Framework Types
|
|
122
|
+
export type TestFramework =
|
|
123
|
+
| "bun-test"
|
|
124
|
+
| "vitest"
|
|
125
|
+
| "jest"
|
|
126
|
+
| "mocha"
|
|
127
|
+
| "pytest"
|
|
128
|
+
| "go-test"
|
|
129
|
+
| "cargo"
|
|
130
|
+
| "maven"
|
|
131
|
+
| "gradle"
|
|
132
|
+
| "unknown";
|
|
133
|
+
|
|
134
|
+
// Workspace Info (from project detection)
|
|
135
|
+
export interface WorkspaceInfo {
|
|
136
|
+
path: string;
|
|
137
|
+
language: string;
|
|
138
|
+
packageManager: string;
|
|
139
|
+
framework: string;
|
|
140
|
+
testFramework: TestFramework;
|
|
141
|
+
orm?: string;
|
|
142
|
+
architecturePattern?: string;
|
|
143
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"lib": ["ESNext"],
|
|
4
|
+
"target": "ESNext",
|
|
5
|
+
"module": "Preserve",
|
|
6
|
+
"moduleDetection": "force",
|
|
7
|
+
"allowJs": true,
|
|
8
|
+
|
|
9
|
+
"moduleResolution": "bundler",
|
|
10
|
+
"allowImportingTsExtensions": true,
|
|
11
|
+
"verbatimModuleSyntax": true,
|
|
12
|
+
"noEmit": true,
|
|
13
|
+
|
|
14
|
+
"strict": true,
|
|
15
|
+
"skipLibCheck": true,
|
|
16
|
+
"noFallthroughCasesInSwitch": true,
|
|
17
|
+
"noUncheckedIndexedAccess": true,
|
|
18
|
+
"noImplicitOverride": true,
|
|
19
|
+
"noUnusedLocals": true,
|
|
20
|
+
"noUnusedParameters": true,
|
|
21
|
+
|
|
22
|
+
"paths": {
|
|
23
|
+
"@aad/shared/*": ["./src/shared/*"],
|
|
24
|
+
"@aad/*": ["./src/modules/*"]
|
|
25
|
+
},
|
|
26
|
+
"baseUrl": "."
|
|
27
|
+
},
|
|
28
|
+
"include": ["src/**/*.ts"],
|
|
29
|
+
"exclude": ["node_modules", "dist"]
|
|
30
|
+
}
|