@mandujs/core 0.54.6 → 0.54.7
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/package.json +1 -1
- package/src/agent/__tests__/context.test.ts +237 -237
- package/src/agent/types.ts +308 -308
- package/src/agent/verify.ts +406 -406
- package/src/router/client-entry.test.ts +48 -1
- package/src/router/client-entry.ts +179 -0
- package/src/router/fs-scanner.ts +21 -8
package/src/agent/types.ts
CHANGED
|
@@ -1,308 +1,308 @@
|
|
|
1
|
-
import type { DiagnoseReport } from "../diagnose";
|
|
2
|
-
|
|
3
|
-
export type AgentWorkflowStep = "context" | "plan" | "apply" | "verify" | "repair";
|
|
4
|
-
|
|
5
|
-
export type AgentDiagnosticSeverity = "info" | "warning" | "error" | "fatal";
|
|
6
|
-
|
|
7
|
-
export interface AgentSuggestedFix {
|
|
8
|
-
type: "run_command" | "create_file" | "modify_file" | "manual";
|
|
9
|
-
command?: string;
|
|
10
|
-
path?: string;
|
|
11
|
-
description: string;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export interface AgentDiagnostic {
|
|
15
|
-
code: string;
|
|
16
|
-
severity: AgentDiagnosticSeverity;
|
|
17
|
-
title: string;
|
|
18
|
-
file?: string;
|
|
19
|
-
line?: number;
|
|
20
|
-
cause: string;
|
|
21
|
-
suggestedFix?: AgentSuggestedFix;
|
|
22
|
-
docs?: string;
|
|
23
|
-
repairable: boolean;
|
|
24
|
-
source: string;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export interface AgentProjectSummary {
|
|
28
|
-
name: string | null;
|
|
29
|
-
version: string | null;
|
|
30
|
-
root: string;
|
|
31
|
-
packageManager: string;
|
|
32
|
-
configFile: string | null;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export interface AgentRouteSummary {
|
|
36
|
-
id: string;
|
|
37
|
-
pattern: string;
|
|
38
|
-
kind: "page" | "api" | "metadata" | string;
|
|
39
|
-
module: string;
|
|
40
|
-
methods?: string[];
|
|
41
|
-
hydration?: {
|
|
42
|
-
strategy?: string;
|
|
43
|
-
priority?: string;
|
|
44
|
-
};
|
|
45
|
-
hasClientModule: boolean;
|
|
46
|
-
hasContractModule: boolean;
|
|
47
|
-
layoutDepth: number;
|
|
48
|
-
metadataKind?: string;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export interface AgentArtifactSummary {
|
|
52
|
-
path: string;
|
|
53
|
-
kind: "partial" | "island" | "slot" | "contract";
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export interface AgentGuardSummary {
|
|
57
|
-
preset: string | null;
|
|
58
|
-
customRules: number;
|
|
59
|
-
ruleOverrides: number;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export interface AgentEnvFileSummary {
|
|
63
|
-
path: string;
|
|
64
|
-
kind: "template" | "local" | "production" | "test" | "unknown";
|
|
65
|
-
redacted: true;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export interface AgentGitSummary {
|
|
69
|
-
branch: string | null;
|
|
70
|
-
changedFiles: string[];
|
|
71
|
-
statusAvailable: boolean;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export interface AgentCommandMap {
|
|
75
|
-
context: string;
|
|
76
|
-
manifest: string;
|
|
77
|
-
plan: string;
|
|
78
|
-
apply: string;
|
|
79
|
-
verify: string;
|
|
80
|
-
repair: string;
|
|
81
|
-
sync: string;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export interface AgentWorkflowCommand {
|
|
85
|
-
step: AgentWorkflowStep;
|
|
86
|
-
command: string;
|
|
87
|
-
purpose: string;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
export interface AgentContext {
|
|
91
|
-
schemaVersion: 1;
|
|
92
|
-
framework: "mandu";
|
|
93
|
-
generatedAt: string;
|
|
94
|
-
project: AgentProjectSummary;
|
|
95
|
-
routeSource: "manifest" | "scanner" | "none";
|
|
96
|
-
routes: AgentRouteSummary[];
|
|
97
|
-
pages: AgentRouteSummary[];
|
|
98
|
-
apis: AgentRouteSummary[];
|
|
99
|
-
metadataRoutes: AgentRouteSummary[];
|
|
100
|
-
partials: AgentArtifactSummary[];
|
|
101
|
-
islands: AgentArtifactSummary[];
|
|
102
|
-
slots: AgentArtifactSummary[];
|
|
103
|
-
contracts: AgentArtifactSummary[];
|
|
104
|
-
guards: AgentGuardSummary;
|
|
105
|
-
env: AgentEnvFileSummary[];
|
|
106
|
-
deploy: {
|
|
107
|
-
intentFile: string | null;
|
|
108
|
-
targets: string[];
|
|
109
|
-
};
|
|
110
|
-
commands: AgentCommandMap;
|
|
111
|
-
agentWorkflow: {
|
|
112
|
-
canonical: AgentWorkflowStep[];
|
|
113
|
-
recommended: AgentWorkflowCommand[];
|
|
114
|
-
};
|
|
115
|
-
diagnose?: Pick<DiagnoseReport, "healthy" | "errorCount" | "warningCount" | "summary">;
|
|
116
|
-
diagnostics: AgentDiagnostic[];
|
|
117
|
-
git: AgentGitSummary;
|
|
118
|
-
warnings: string[];
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
export interface AgentManifest {
|
|
122
|
-
schemaVersion: 1;
|
|
123
|
-
framework: "mandu";
|
|
124
|
-
generatedAt: string;
|
|
125
|
-
project: AgentProjectSummary;
|
|
126
|
-
routeSource: AgentContext["routeSource"];
|
|
127
|
-
routes: AgentRouteSummary[];
|
|
128
|
-
apis: AgentRouteSummary[];
|
|
129
|
-
layouts: string[];
|
|
130
|
-
partials: AgentArtifactSummary[];
|
|
131
|
-
islands: AgentArtifactSummary[];
|
|
132
|
-
slots: AgentArtifactSummary[];
|
|
133
|
-
contracts: AgentArtifactSummary[];
|
|
134
|
-
guards: AgentGuardSummary;
|
|
135
|
-
env: AgentEnvFileSummary[];
|
|
136
|
-
deploy: AgentContext["deploy"];
|
|
137
|
-
commands: AgentCommandMap;
|
|
138
|
-
agentWorkflow: AgentContext["agentWorkflow"];
|
|
139
|
-
warnings: string[];
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
export interface BuildAgentContextOptions {
|
|
143
|
-
includeDiagnose?: boolean;
|
|
144
|
-
includeGit?: boolean;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
export interface AgentVerifyCheck {
|
|
148
|
-
id: string;
|
|
149
|
-
label: string;
|
|
150
|
-
ok: boolean;
|
|
151
|
-
severity: AgentDiagnosticSeverity;
|
|
152
|
-
diagnostics: number;
|
|
153
|
-
details?: Record<string, unknown>;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
export interface AgentSuggestedCommand {
|
|
157
|
-
command: string;
|
|
158
|
-
reason: string;
|
|
159
|
-
required: boolean;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
export interface AgentVerifyReport {
|
|
163
|
-
schemaVersion: 1;
|
|
164
|
-
framework: "mandu";
|
|
165
|
-
generatedAt: string;
|
|
166
|
-
project: AgentProjectSummary;
|
|
167
|
-
changedFiles: string[];
|
|
168
|
-
gitAvailable: boolean;
|
|
169
|
-
notes: string[];
|
|
170
|
-
ok: boolean;
|
|
171
|
-
checks: AgentVerifyCheck[];
|
|
172
|
-
diagnostics: AgentDiagnostic[];
|
|
173
|
-
suggestedCommands: AgentSuggestedCommand[];
|
|
174
|
-
nextRepairInput: string;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
export interface BuildAgentVerifyOptions {
|
|
178
|
-
changedOnly?: boolean;
|
|
179
|
-
includeDiagnose?: boolean;
|
|
180
|
-
includeGuard?: boolean;
|
|
181
|
-
includeContract?: boolean;
|
|
182
|
-
includeGit?: boolean;
|
|
183
|
-
base?: string;
|
|
184
|
-
staged?: boolean;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
export type AgentRepairStatus = "ready" | "nothing_to_repair" | "input_missing";
|
|
188
|
-
|
|
189
|
-
export interface AgentRepairAction {
|
|
190
|
-
diagnosticCode: string;
|
|
191
|
-
kind: "run_command" | "manual" | "patch";
|
|
192
|
-
description: string;
|
|
193
|
-
command?: string;
|
|
194
|
-
file?: string;
|
|
195
|
-
safeToApply: boolean;
|
|
196
|
-
applied: boolean;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
export interface AgentRepairReport {
|
|
200
|
-
schemaVersion: 1;
|
|
201
|
-
framework: "mandu";
|
|
202
|
-
generatedAt: string;
|
|
203
|
-
ok: boolean;
|
|
204
|
-
status: AgentRepairStatus;
|
|
205
|
-
sourceReport: string;
|
|
206
|
-
diagnostics: AgentDiagnostic[];
|
|
207
|
-
actions: AgentRepairAction[];
|
|
208
|
-
appliedActions: AgentRepairAction[];
|
|
209
|
-
warnings: string[];
|
|
210
|
-
nextVerifyCommand: string;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
export interface BuildAgentRepairOptions {
|
|
214
|
-
from?: string;
|
|
215
|
-
apply?: boolean;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
export type AgentDomain =
|
|
219
|
-
| "route"
|
|
220
|
-
| "api"
|
|
221
|
-
| "contract"
|
|
222
|
-
| "slot"
|
|
223
|
-
| "hydration"
|
|
224
|
-
| "guard"
|
|
225
|
-
| "testing"
|
|
226
|
-
| "deploy"
|
|
227
|
-
| "design"
|
|
228
|
-
| "docs"
|
|
229
|
-
| "db"
|
|
230
|
-
| "unknown";
|
|
231
|
-
|
|
232
|
-
export interface AgentPlanRisk {
|
|
233
|
-
level: "low" | "medium" | "high";
|
|
234
|
-
reason: string;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
export interface AgentPlan {
|
|
238
|
-
schemaVersion: 1;
|
|
239
|
-
framework: "mandu";
|
|
240
|
-
generatedAt: string;
|
|
241
|
-
intent: string;
|
|
242
|
-
domains: AgentDomain[];
|
|
243
|
-
filesToRead: string[];
|
|
244
|
-
filesToCreate: string[];
|
|
245
|
-
filesToModify: string[];
|
|
246
|
-
mcpTools: string[];
|
|
247
|
-
risks: AgentPlanRisk[];
|
|
248
|
-
verification: AgentSuggestedCommand[];
|
|
249
|
-
notes: string[];
|
|
250
|
-
executable: false;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
export interface BuildAgentPlanOptions {
|
|
254
|
-
intent: string;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
export interface AgentApplyReport {
|
|
258
|
-
schemaVersion: 1;
|
|
259
|
-
framework: "mandu";
|
|
260
|
-
generatedAt: string;
|
|
261
|
-
ok: boolean;
|
|
262
|
-
dryRun: boolean;
|
|
263
|
-
sourcePlan: string;
|
|
264
|
-
intent: string;
|
|
265
|
-
domains: AgentDomain[];
|
|
266
|
-
actions: Array<{
|
|
267
|
-
kind: "mcp_tool" | "read_file" | "manual_edit" | "verify";
|
|
268
|
-
description: string;
|
|
269
|
-
tool?: string;
|
|
270
|
-
file?: string;
|
|
271
|
-
command?: string;
|
|
272
|
-
applied: false;
|
|
273
|
-
}>;
|
|
274
|
-
warnings: string[];
|
|
275
|
-
nextVerifyCommand: string;
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
export interface BuildAgentApplyOptions {
|
|
279
|
-
from?: string;
|
|
280
|
-
dryRun?: boolean;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
export type AgentSyncTarget = "codex" | "claude" | "gemini" | "all";
|
|
284
|
-
|
|
285
|
-
export interface AgentSyncFile {
|
|
286
|
-
target: Exclude<AgentSyncTarget, "all">;
|
|
287
|
-
path: string;
|
|
288
|
-
action: "created" | "updated" | "unchanged" | "planned";
|
|
289
|
-
bytes: number;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
export interface AgentSyncReport {
|
|
293
|
-
schemaVersion: 1;
|
|
294
|
-
framework: "mandu";
|
|
295
|
-
generatedAt: string;
|
|
296
|
-
ok: boolean;
|
|
297
|
-
target: AgentSyncTarget;
|
|
298
|
-
profile: "agent-core";
|
|
299
|
-
workflow: AgentWorkflowStep[];
|
|
300
|
-
files: AgentSyncFile[];
|
|
301
|
-
warnings: string[];
|
|
302
|
-
nextCommands: AgentSuggestedCommand[];
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
export interface BuildAgentSyncOptions {
|
|
306
|
-
target?: AgentSyncTarget;
|
|
307
|
-
dryRun?: boolean;
|
|
308
|
-
}
|
|
1
|
+
import type { DiagnoseReport } from "../diagnose";
|
|
2
|
+
|
|
3
|
+
export type AgentWorkflowStep = "context" | "plan" | "apply" | "verify" | "repair";
|
|
4
|
+
|
|
5
|
+
export type AgentDiagnosticSeverity = "info" | "warning" | "error" | "fatal";
|
|
6
|
+
|
|
7
|
+
export interface AgentSuggestedFix {
|
|
8
|
+
type: "run_command" | "create_file" | "modify_file" | "manual";
|
|
9
|
+
command?: string;
|
|
10
|
+
path?: string;
|
|
11
|
+
description: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface AgentDiagnostic {
|
|
15
|
+
code: string;
|
|
16
|
+
severity: AgentDiagnosticSeverity;
|
|
17
|
+
title: string;
|
|
18
|
+
file?: string;
|
|
19
|
+
line?: number;
|
|
20
|
+
cause: string;
|
|
21
|
+
suggestedFix?: AgentSuggestedFix;
|
|
22
|
+
docs?: string;
|
|
23
|
+
repairable: boolean;
|
|
24
|
+
source: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface AgentProjectSummary {
|
|
28
|
+
name: string | null;
|
|
29
|
+
version: string | null;
|
|
30
|
+
root: string;
|
|
31
|
+
packageManager: string;
|
|
32
|
+
configFile: string | null;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface AgentRouteSummary {
|
|
36
|
+
id: string;
|
|
37
|
+
pattern: string;
|
|
38
|
+
kind: "page" | "api" | "metadata" | string;
|
|
39
|
+
module: string;
|
|
40
|
+
methods?: string[];
|
|
41
|
+
hydration?: {
|
|
42
|
+
strategy?: string;
|
|
43
|
+
priority?: string;
|
|
44
|
+
};
|
|
45
|
+
hasClientModule: boolean;
|
|
46
|
+
hasContractModule: boolean;
|
|
47
|
+
layoutDepth: number;
|
|
48
|
+
metadataKind?: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface AgentArtifactSummary {
|
|
52
|
+
path: string;
|
|
53
|
+
kind: "partial" | "island" | "slot" | "contract";
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface AgentGuardSummary {
|
|
57
|
+
preset: string | null;
|
|
58
|
+
customRules: number;
|
|
59
|
+
ruleOverrides: number;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface AgentEnvFileSummary {
|
|
63
|
+
path: string;
|
|
64
|
+
kind: "template" | "local" | "production" | "test" | "unknown";
|
|
65
|
+
redacted: true;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface AgentGitSummary {
|
|
69
|
+
branch: string | null;
|
|
70
|
+
changedFiles: string[];
|
|
71
|
+
statusAvailable: boolean;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface AgentCommandMap {
|
|
75
|
+
context: string;
|
|
76
|
+
manifest: string;
|
|
77
|
+
plan: string;
|
|
78
|
+
apply: string;
|
|
79
|
+
verify: string;
|
|
80
|
+
repair: string;
|
|
81
|
+
sync: string;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface AgentWorkflowCommand {
|
|
85
|
+
step: AgentWorkflowStep;
|
|
86
|
+
command: string;
|
|
87
|
+
purpose: string;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface AgentContext {
|
|
91
|
+
schemaVersion: 1;
|
|
92
|
+
framework: "mandu";
|
|
93
|
+
generatedAt: string;
|
|
94
|
+
project: AgentProjectSummary;
|
|
95
|
+
routeSource: "manifest" | "scanner" | "none";
|
|
96
|
+
routes: AgentRouteSummary[];
|
|
97
|
+
pages: AgentRouteSummary[];
|
|
98
|
+
apis: AgentRouteSummary[];
|
|
99
|
+
metadataRoutes: AgentRouteSummary[];
|
|
100
|
+
partials: AgentArtifactSummary[];
|
|
101
|
+
islands: AgentArtifactSummary[];
|
|
102
|
+
slots: AgentArtifactSummary[];
|
|
103
|
+
contracts: AgentArtifactSummary[];
|
|
104
|
+
guards: AgentGuardSummary;
|
|
105
|
+
env: AgentEnvFileSummary[];
|
|
106
|
+
deploy: {
|
|
107
|
+
intentFile: string | null;
|
|
108
|
+
targets: string[];
|
|
109
|
+
};
|
|
110
|
+
commands: AgentCommandMap;
|
|
111
|
+
agentWorkflow: {
|
|
112
|
+
canonical: AgentWorkflowStep[];
|
|
113
|
+
recommended: AgentWorkflowCommand[];
|
|
114
|
+
};
|
|
115
|
+
diagnose?: Pick<DiagnoseReport, "healthy" | "errorCount" | "warningCount" | "summary">;
|
|
116
|
+
diagnostics: AgentDiagnostic[];
|
|
117
|
+
git: AgentGitSummary;
|
|
118
|
+
warnings: string[];
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export interface AgentManifest {
|
|
122
|
+
schemaVersion: 1;
|
|
123
|
+
framework: "mandu";
|
|
124
|
+
generatedAt: string;
|
|
125
|
+
project: AgentProjectSummary;
|
|
126
|
+
routeSource: AgentContext["routeSource"];
|
|
127
|
+
routes: AgentRouteSummary[];
|
|
128
|
+
apis: AgentRouteSummary[];
|
|
129
|
+
layouts: string[];
|
|
130
|
+
partials: AgentArtifactSummary[];
|
|
131
|
+
islands: AgentArtifactSummary[];
|
|
132
|
+
slots: AgentArtifactSummary[];
|
|
133
|
+
contracts: AgentArtifactSummary[];
|
|
134
|
+
guards: AgentGuardSummary;
|
|
135
|
+
env: AgentEnvFileSummary[];
|
|
136
|
+
deploy: AgentContext["deploy"];
|
|
137
|
+
commands: AgentCommandMap;
|
|
138
|
+
agentWorkflow: AgentContext["agentWorkflow"];
|
|
139
|
+
warnings: string[];
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export interface BuildAgentContextOptions {
|
|
143
|
+
includeDiagnose?: boolean;
|
|
144
|
+
includeGit?: boolean;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export interface AgentVerifyCheck {
|
|
148
|
+
id: string;
|
|
149
|
+
label: string;
|
|
150
|
+
ok: boolean;
|
|
151
|
+
severity: AgentDiagnosticSeverity;
|
|
152
|
+
diagnostics: number;
|
|
153
|
+
details?: Record<string, unknown>;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export interface AgentSuggestedCommand {
|
|
157
|
+
command: string;
|
|
158
|
+
reason: string;
|
|
159
|
+
required: boolean;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export interface AgentVerifyReport {
|
|
163
|
+
schemaVersion: 1;
|
|
164
|
+
framework: "mandu";
|
|
165
|
+
generatedAt: string;
|
|
166
|
+
project: AgentProjectSummary;
|
|
167
|
+
changedFiles: string[];
|
|
168
|
+
gitAvailable: boolean;
|
|
169
|
+
notes: string[];
|
|
170
|
+
ok: boolean;
|
|
171
|
+
checks: AgentVerifyCheck[];
|
|
172
|
+
diagnostics: AgentDiagnostic[];
|
|
173
|
+
suggestedCommands: AgentSuggestedCommand[];
|
|
174
|
+
nextRepairInput: string;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export interface BuildAgentVerifyOptions {
|
|
178
|
+
changedOnly?: boolean;
|
|
179
|
+
includeDiagnose?: boolean;
|
|
180
|
+
includeGuard?: boolean;
|
|
181
|
+
includeContract?: boolean;
|
|
182
|
+
includeGit?: boolean;
|
|
183
|
+
base?: string;
|
|
184
|
+
staged?: boolean;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export type AgentRepairStatus = "ready" | "nothing_to_repair" | "input_missing";
|
|
188
|
+
|
|
189
|
+
export interface AgentRepairAction {
|
|
190
|
+
diagnosticCode: string;
|
|
191
|
+
kind: "run_command" | "manual" | "patch";
|
|
192
|
+
description: string;
|
|
193
|
+
command?: string;
|
|
194
|
+
file?: string;
|
|
195
|
+
safeToApply: boolean;
|
|
196
|
+
applied: boolean;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export interface AgentRepairReport {
|
|
200
|
+
schemaVersion: 1;
|
|
201
|
+
framework: "mandu";
|
|
202
|
+
generatedAt: string;
|
|
203
|
+
ok: boolean;
|
|
204
|
+
status: AgentRepairStatus;
|
|
205
|
+
sourceReport: string;
|
|
206
|
+
diagnostics: AgentDiagnostic[];
|
|
207
|
+
actions: AgentRepairAction[];
|
|
208
|
+
appliedActions: AgentRepairAction[];
|
|
209
|
+
warnings: string[];
|
|
210
|
+
nextVerifyCommand: string;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export interface BuildAgentRepairOptions {
|
|
214
|
+
from?: string;
|
|
215
|
+
apply?: boolean;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
export type AgentDomain =
|
|
219
|
+
| "route"
|
|
220
|
+
| "api"
|
|
221
|
+
| "contract"
|
|
222
|
+
| "slot"
|
|
223
|
+
| "hydration"
|
|
224
|
+
| "guard"
|
|
225
|
+
| "testing"
|
|
226
|
+
| "deploy"
|
|
227
|
+
| "design"
|
|
228
|
+
| "docs"
|
|
229
|
+
| "db"
|
|
230
|
+
| "unknown";
|
|
231
|
+
|
|
232
|
+
export interface AgentPlanRisk {
|
|
233
|
+
level: "low" | "medium" | "high";
|
|
234
|
+
reason: string;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
export interface AgentPlan {
|
|
238
|
+
schemaVersion: 1;
|
|
239
|
+
framework: "mandu";
|
|
240
|
+
generatedAt: string;
|
|
241
|
+
intent: string;
|
|
242
|
+
domains: AgentDomain[];
|
|
243
|
+
filesToRead: string[];
|
|
244
|
+
filesToCreate: string[];
|
|
245
|
+
filesToModify: string[];
|
|
246
|
+
mcpTools: string[];
|
|
247
|
+
risks: AgentPlanRisk[];
|
|
248
|
+
verification: AgentSuggestedCommand[];
|
|
249
|
+
notes: string[];
|
|
250
|
+
executable: false;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
export interface BuildAgentPlanOptions {
|
|
254
|
+
intent: string;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
export interface AgentApplyReport {
|
|
258
|
+
schemaVersion: 1;
|
|
259
|
+
framework: "mandu";
|
|
260
|
+
generatedAt: string;
|
|
261
|
+
ok: boolean;
|
|
262
|
+
dryRun: boolean;
|
|
263
|
+
sourcePlan: string;
|
|
264
|
+
intent: string;
|
|
265
|
+
domains: AgentDomain[];
|
|
266
|
+
actions: Array<{
|
|
267
|
+
kind: "mcp_tool" | "read_file" | "manual_edit" | "verify";
|
|
268
|
+
description: string;
|
|
269
|
+
tool?: string;
|
|
270
|
+
file?: string;
|
|
271
|
+
command?: string;
|
|
272
|
+
applied: false;
|
|
273
|
+
}>;
|
|
274
|
+
warnings: string[];
|
|
275
|
+
nextVerifyCommand: string;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
export interface BuildAgentApplyOptions {
|
|
279
|
+
from?: string;
|
|
280
|
+
dryRun?: boolean;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
export type AgentSyncTarget = "codex" | "claude" | "gemini" | "all";
|
|
284
|
+
|
|
285
|
+
export interface AgentSyncFile {
|
|
286
|
+
target: Exclude<AgentSyncTarget, "all">;
|
|
287
|
+
path: string;
|
|
288
|
+
action: "created" | "updated" | "unchanged" | "planned";
|
|
289
|
+
bytes: number;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
export interface AgentSyncReport {
|
|
293
|
+
schemaVersion: 1;
|
|
294
|
+
framework: "mandu";
|
|
295
|
+
generatedAt: string;
|
|
296
|
+
ok: boolean;
|
|
297
|
+
target: AgentSyncTarget;
|
|
298
|
+
profile: "agent-core";
|
|
299
|
+
workflow: AgentWorkflowStep[];
|
|
300
|
+
files: AgentSyncFile[];
|
|
301
|
+
warnings: string[];
|
|
302
|
+
nextCommands: AgentSuggestedCommand[];
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
export interface BuildAgentSyncOptions {
|
|
306
|
+
target?: AgentSyncTarget;
|
|
307
|
+
dryRun?: boolean;
|
|
308
|
+
}
|