@pugi/sdk 0.1.0-alpha.3
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 +29 -0
- package/dist/agent-contracts.d.ts +311 -0
- package/dist/agent-contracts.js +67 -0
- package/dist/audit-trace.d.ts +387 -0
- package/dist/audit-trace.js +44 -0
- package/dist/device-flow.d.ts +98 -0
- package/dist/device-flow.js +55 -0
- package/dist/engine-adapter.d.ts +376 -0
- package/dist/engine-adapter.js +47 -0
- package/dist/engine-loop.d.ts +457 -0
- package/dist/engine-loop.js +342 -0
- package/dist/handoff.d.ts +605 -0
- package/dist/handoff.js +76 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +10 -0
- package/dist/mcp-schemas.d.ts +27 -0
- package/dist/mcp-schemas.js +11 -0
- package/dist/permission-rules.d.ts +65 -0
- package/dist/permission-rules.js +35 -0
- package/dist/transport.d.ts +559 -0
- package/dist/transport.js +482 -0
- package/package.json +47 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Yurii Bulakh
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# @pugi/sdk
|
|
2
|
+
|
|
3
|
+
Shared contracts + zod schemas used by the Pugi CLI, docs, and the Anvil
|
|
4
|
+
runtime backend. This package is a peer dependency of [`@pugi/cli`](https://www.npmjs.com/package/@pugi/cli);
|
|
5
|
+
end users rarely install it directly.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @pugi/sdk
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { engineLoopRequestSchema } from '@pugi/sdk';
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Full contract surface: `agent-contracts`, `audit-trace`, `device-flow`
|
|
20
|
+
(RFC 8628), `engine-adapter`, `engine-loop`, `handoff`, `mcp-schemas`,
|
|
21
|
+
`permission-rules`, `transport`.
|
|
22
|
+
|
|
23
|
+
## Versioning
|
|
24
|
+
|
|
25
|
+
`@pugi/sdk` ships in lockstep with `@pugi/cli` — minor/patch bumps are
|
|
26
|
+
shared. Until 1.0 the SDK API surface is alpha-stable; breaking changes
|
|
27
|
+
are recorded in [the CLI README](https://github.com/pugi-io/pugi).
|
|
28
|
+
|
|
29
|
+
License: MIT.
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const artifactKindSchema: z.ZodEnum<["brief", "prd_lite", "execution_graph", "risk_review", "acceptance_criteria", "diff", "review_verdict", "test_result", "debug_export"]>;
|
|
3
|
+
export type ArtifactKind = z.infer<typeof artifactKindSchema>;
|
|
4
|
+
export declare const artifactRefSchema: z.ZodObject<{
|
|
5
|
+
id: z.ZodString;
|
|
6
|
+
kind: z.ZodEnum<["brief", "prd_lite", "execution_graph", "risk_review", "acceptance_criteria", "diff", "review_verdict", "test_result", "debug_export"]>;
|
|
7
|
+
path: z.ZodOptional<z.ZodString>;
|
|
8
|
+
uri: z.ZodOptional<z.ZodString>;
|
|
9
|
+
title: z.ZodString;
|
|
10
|
+
sha256: z.ZodOptional<z.ZodString>;
|
|
11
|
+
createdAt: z.ZodString;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
id: string;
|
|
14
|
+
kind: "brief" | "prd_lite" | "execution_graph" | "risk_review" | "acceptance_criteria" | "diff" | "review_verdict" | "test_result" | "debug_export";
|
|
15
|
+
title: string;
|
|
16
|
+
createdAt: string;
|
|
17
|
+
path?: string | undefined;
|
|
18
|
+
uri?: string | undefined;
|
|
19
|
+
sha256?: string | undefined;
|
|
20
|
+
}, {
|
|
21
|
+
id: string;
|
|
22
|
+
kind: "brief" | "prd_lite" | "execution_graph" | "risk_review" | "acceptance_criteria" | "diff" | "review_verdict" | "test_result" | "debug_export";
|
|
23
|
+
title: string;
|
|
24
|
+
createdAt: string;
|
|
25
|
+
path?: string | undefined;
|
|
26
|
+
uri?: string | undefined;
|
|
27
|
+
sha256?: string | undefined;
|
|
28
|
+
}>;
|
|
29
|
+
export type ArtifactRef = z.infer<typeof artifactRefSchema>;
|
|
30
|
+
export declare const ideaBriefSchema: z.ZodObject<{
|
|
31
|
+
id: z.ZodString;
|
|
32
|
+
prompt: z.ZodString;
|
|
33
|
+
targetUser: z.ZodOptional<z.ZodString>;
|
|
34
|
+
currentStatusQuo: z.ZodOptional<z.ZodString>;
|
|
35
|
+
narrowestWedge: z.ZodOptional<z.ZodString>;
|
|
36
|
+
risks: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
37
|
+
acceptanceCriteria: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
38
|
+
artifacts: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
39
|
+
id: z.ZodString;
|
|
40
|
+
kind: z.ZodEnum<["brief", "prd_lite", "execution_graph", "risk_review", "acceptance_criteria", "diff", "review_verdict", "test_result", "debug_export"]>;
|
|
41
|
+
path: z.ZodOptional<z.ZodString>;
|
|
42
|
+
uri: z.ZodOptional<z.ZodString>;
|
|
43
|
+
title: z.ZodString;
|
|
44
|
+
sha256: z.ZodOptional<z.ZodString>;
|
|
45
|
+
createdAt: z.ZodString;
|
|
46
|
+
}, "strip", z.ZodTypeAny, {
|
|
47
|
+
id: string;
|
|
48
|
+
kind: "brief" | "prd_lite" | "execution_graph" | "risk_review" | "acceptance_criteria" | "diff" | "review_verdict" | "test_result" | "debug_export";
|
|
49
|
+
title: string;
|
|
50
|
+
createdAt: string;
|
|
51
|
+
path?: string | undefined;
|
|
52
|
+
uri?: string | undefined;
|
|
53
|
+
sha256?: string | undefined;
|
|
54
|
+
}, {
|
|
55
|
+
id: string;
|
|
56
|
+
kind: "brief" | "prd_lite" | "execution_graph" | "risk_review" | "acceptance_criteria" | "diff" | "review_verdict" | "test_result" | "debug_export";
|
|
57
|
+
title: string;
|
|
58
|
+
createdAt: string;
|
|
59
|
+
path?: string | undefined;
|
|
60
|
+
uri?: string | undefined;
|
|
61
|
+
sha256?: string | undefined;
|
|
62
|
+
}>, "many">>;
|
|
63
|
+
}, "strip", z.ZodTypeAny, {
|
|
64
|
+
id: string;
|
|
65
|
+
prompt: string;
|
|
66
|
+
risks: string[];
|
|
67
|
+
acceptanceCriteria: string[];
|
|
68
|
+
artifacts: {
|
|
69
|
+
id: string;
|
|
70
|
+
kind: "brief" | "prd_lite" | "execution_graph" | "risk_review" | "acceptance_criteria" | "diff" | "review_verdict" | "test_result" | "debug_export";
|
|
71
|
+
title: string;
|
|
72
|
+
createdAt: string;
|
|
73
|
+
path?: string | undefined;
|
|
74
|
+
uri?: string | undefined;
|
|
75
|
+
sha256?: string | undefined;
|
|
76
|
+
}[];
|
|
77
|
+
targetUser?: string | undefined;
|
|
78
|
+
currentStatusQuo?: string | undefined;
|
|
79
|
+
narrowestWedge?: string | undefined;
|
|
80
|
+
}, {
|
|
81
|
+
id: string;
|
|
82
|
+
prompt: string;
|
|
83
|
+
targetUser?: string | undefined;
|
|
84
|
+
currentStatusQuo?: string | undefined;
|
|
85
|
+
narrowestWedge?: string | undefined;
|
|
86
|
+
risks?: string[] | undefined;
|
|
87
|
+
acceptanceCriteria?: string[] | undefined;
|
|
88
|
+
artifacts?: {
|
|
89
|
+
id: string;
|
|
90
|
+
kind: "brief" | "prd_lite" | "execution_graph" | "risk_review" | "acceptance_criteria" | "diff" | "review_verdict" | "test_result" | "debug_export";
|
|
91
|
+
title: string;
|
|
92
|
+
createdAt: string;
|
|
93
|
+
path?: string | undefined;
|
|
94
|
+
uri?: string | undefined;
|
|
95
|
+
sha256?: string | undefined;
|
|
96
|
+
}[] | undefined;
|
|
97
|
+
}>;
|
|
98
|
+
export type IdeaBrief = z.infer<typeof ideaBriefSchema>;
|
|
99
|
+
export declare const executionGraphNodeSchema: z.ZodObject<{
|
|
100
|
+
id: z.ZodString;
|
|
101
|
+
title: z.ZodString;
|
|
102
|
+
kind: z.ZodEnum<["research", "plan", "code", "review", "test", "ship"]>;
|
|
103
|
+
dependsOn: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
104
|
+
owner: z.ZodOptional<z.ZodString>;
|
|
105
|
+
status: z.ZodDefault<z.ZodEnum<["pending", "in_progress", "done", "blocked"]>>;
|
|
106
|
+
acceptanceCriteria: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
107
|
+
}, "strip", z.ZodTypeAny, {
|
|
108
|
+
status: "pending" | "in_progress" | "done" | "blocked";
|
|
109
|
+
id: string;
|
|
110
|
+
kind: "code" | "plan" | "research" | "review" | "test" | "ship";
|
|
111
|
+
title: string;
|
|
112
|
+
acceptanceCriteria: string[];
|
|
113
|
+
dependsOn: string[];
|
|
114
|
+
owner?: string | undefined;
|
|
115
|
+
}, {
|
|
116
|
+
id: string;
|
|
117
|
+
kind: "code" | "plan" | "research" | "review" | "test" | "ship";
|
|
118
|
+
title: string;
|
|
119
|
+
status?: "pending" | "in_progress" | "done" | "blocked" | undefined;
|
|
120
|
+
acceptanceCriteria?: string[] | undefined;
|
|
121
|
+
dependsOn?: string[] | undefined;
|
|
122
|
+
owner?: string | undefined;
|
|
123
|
+
}>;
|
|
124
|
+
export type ExecutionGraphNode = z.infer<typeof executionGraphNodeSchema>;
|
|
125
|
+
export declare const executionGraphSchema: z.ZodObject<{
|
|
126
|
+
id: z.ZodString;
|
|
127
|
+
title: z.ZodString;
|
|
128
|
+
nodes: z.ZodArray<z.ZodObject<{
|
|
129
|
+
id: z.ZodString;
|
|
130
|
+
title: z.ZodString;
|
|
131
|
+
kind: z.ZodEnum<["research", "plan", "code", "review", "test", "ship"]>;
|
|
132
|
+
dependsOn: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
133
|
+
owner: z.ZodOptional<z.ZodString>;
|
|
134
|
+
status: z.ZodDefault<z.ZodEnum<["pending", "in_progress", "done", "blocked"]>>;
|
|
135
|
+
acceptanceCriteria: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
136
|
+
}, "strip", z.ZodTypeAny, {
|
|
137
|
+
status: "pending" | "in_progress" | "done" | "blocked";
|
|
138
|
+
id: string;
|
|
139
|
+
kind: "code" | "plan" | "research" | "review" | "test" | "ship";
|
|
140
|
+
title: string;
|
|
141
|
+
acceptanceCriteria: string[];
|
|
142
|
+
dependsOn: string[];
|
|
143
|
+
owner?: string | undefined;
|
|
144
|
+
}, {
|
|
145
|
+
id: string;
|
|
146
|
+
kind: "code" | "plan" | "research" | "review" | "test" | "ship";
|
|
147
|
+
title: string;
|
|
148
|
+
status?: "pending" | "in_progress" | "done" | "blocked" | undefined;
|
|
149
|
+
acceptanceCriteria?: string[] | undefined;
|
|
150
|
+
dependsOn?: string[] | undefined;
|
|
151
|
+
owner?: string | undefined;
|
|
152
|
+
}>, "many">;
|
|
153
|
+
artifacts: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
154
|
+
id: z.ZodString;
|
|
155
|
+
kind: z.ZodEnum<["brief", "prd_lite", "execution_graph", "risk_review", "acceptance_criteria", "diff", "review_verdict", "test_result", "debug_export"]>;
|
|
156
|
+
path: z.ZodOptional<z.ZodString>;
|
|
157
|
+
uri: z.ZodOptional<z.ZodString>;
|
|
158
|
+
title: z.ZodString;
|
|
159
|
+
sha256: z.ZodOptional<z.ZodString>;
|
|
160
|
+
createdAt: z.ZodString;
|
|
161
|
+
}, "strip", z.ZodTypeAny, {
|
|
162
|
+
id: string;
|
|
163
|
+
kind: "brief" | "prd_lite" | "execution_graph" | "risk_review" | "acceptance_criteria" | "diff" | "review_verdict" | "test_result" | "debug_export";
|
|
164
|
+
title: string;
|
|
165
|
+
createdAt: string;
|
|
166
|
+
path?: string | undefined;
|
|
167
|
+
uri?: string | undefined;
|
|
168
|
+
sha256?: string | undefined;
|
|
169
|
+
}, {
|
|
170
|
+
id: string;
|
|
171
|
+
kind: "brief" | "prd_lite" | "execution_graph" | "risk_review" | "acceptance_criteria" | "diff" | "review_verdict" | "test_result" | "debug_export";
|
|
172
|
+
title: string;
|
|
173
|
+
createdAt: string;
|
|
174
|
+
path?: string | undefined;
|
|
175
|
+
uri?: string | undefined;
|
|
176
|
+
sha256?: string | undefined;
|
|
177
|
+
}>, "many">>;
|
|
178
|
+
}, "strip", z.ZodTypeAny, {
|
|
179
|
+
id: string;
|
|
180
|
+
title: string;
|
|
181
|
+
artifacts: {
|
|
182
|
+
id: string;
|
|
183
|
+
kind: "brief" | "prd_lite" | "execution_graph" | "risk_review" | "acceptance_criteria" | "diff" | "review_verdict" | "test_result" | "debug_export";
|
|
184
|
+
title: string;
|
|
185
|
+
createdAt: string;
|
|
186
|
+
path?: string | undefined;
|
|
187
|
+
uri?: string | undefined;
|
|
188
|
+
sha256?: string | undefined;
|
|
189
|
+
}[];
|
|
190
|
+
nodes: {
|
|
191
|
+
status: "pending" | "in_progress" | "done" | "blocked";
|
|
192
|
+
id: string;
|
|
193
|
+
kind: "code" | "plan" | "research" | "review" | "test" | "ship";
|
|
194
|
+
title: string;
|
|
195
|
+
acceptanceCriteria: string[];
|
|
196
|
+
dependsOn: string[];
|
|
197
|
+
owner?: string | undefined;
|
|
198
|
+
}[];
|
|
199
|
+
}, {
|
|
200
|
+
id: string;
|
|
201
|
+
title: string;
|
|
202
|
+
nodes: {
|
|
203
|
+
id: string;
|
|
204
|
+
kind: "code" | "plan" | "research" | "review" | "test" | "ship";
|
|
205
|
+
title: string;
|
|
206
|
+
status?: "pending" | "in_progress" | "done" | "blocked" | undefined;
|
|
207
|
+
acceptanceCriteria?: string[] | undefined;
|
|
208
|
+
dependsOn?: string[] | undefined;
|
|
209
|
+
owner?: string | undefined;
|
|
210
|
+
}[];
|
|
211
|
+
artifacts?: {
|
|
212
|
+
id: string;
|
|
213
|
+
kind: "brief" | "prd_lite" | "execution_graph" | "risk_review" | "acceptance_criteria" | "diff" | "review_verdict" | "test_result" | "debug_export";
|
|
214
|
+
title: string;
|
|
215
|
+
createdAt: string;
|
|
216
|
+
path?: string | undefined;
|
|
217
|
+
uri?: string | undefined;
|
|
218
|
+
sha256?: string | undefined;
|
|
219
|
+
}[] | undefined;
|
|
220
|
+
}>;
|
|
221
|
+
export type ExecutionGraph = z.infer<typeof executionGraphSchema>;
|
|
222
|
+
export declare const testResultSchema: z.ZodObject<{
|
|
223
|
+
command: z.ZodString;
|
|
224
|
+
status: z.ZodEnum<["passed", "failed", "skipped"]>;
|
|
225
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
226
|
+
outputRef: z.ZodOptional<z.ZodString>;
|
|
227
|
+
}, "strip", z.ZodTypeAny, {
|
|
228
|
+
status: "failed" | "passed" | "skipped";
|
|
229
|
+
command: string;
|
|
230
|
+
durationMs?: number | undefined;
|
|
231
|
+
outputRef?: string | undefined;
|
|
232
|
+
}, {
|
|
233
|
+
status: "failed" | "passed" | "skipped";
|
|
234
|
+
command: string;
|
|
235
|
+
durationMs?: number | undefined;
|
|
236
|
+
outputRef?: string | undefined;
|
|
237
|
+
}>;
|
|
238
|
+
export type TestResult = z.infer<typeof testResultSchema>;
|
|
239
|
+
export declare const reviewVerdictSchema: z.ZodObject<{
|
|
240
|
+
status: z.ZodEnum<["pass", "block"]>;
|
|
241
|
+
summary: z.ZodString;
|
|
242
|
+
findings: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
243
|
+
severity: z.ZodEnum<["low", "medium", "high", "critical"]>;
|
|
244
|
+
title: z.ZodString;
|
|
245
|
+
path: z.ZodOptional<z.ZodString>;
|
|
246
|
+
line: z.ZodOptional<z.ZodNumber>;
|
|
247
|
+
recommendation: z.ZodOptional<z.ZodString>;
|
|
248
|
+
}, "strip", z.ZodTypeAny, {
|
|
249
|
+
title: string;
|
|
250
|
+
severity: "low" | "medium" | "high" | "critical";
|
|
251
|
+
path?: string | undefined;
|
|
252
|
+
line?: number | undefined;
|
|
253
|
+
recommendation?: string | undefined;
|
|
254
|
+
}, {
|
|
255
|
+
title: string;
|
|
256
|
+
severity: "low" | "medium" | "high" | "critical";
|
|
257
|
+
path?: string | undefined;
|
|
258
|
+
line?: number | undefined;
|
|
259
|
+
recommendation?: string | undefined;
|
|
260
|
+
}>, "many">>;
|
|
261
|
+
testsRun: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
262
|
+
command: z.ZodString;
|
|
263
|
+
status: z.ZodEnum<["passed", "failed", "skipped"]>;
|
|
264
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
265
|
+
outputRef: z.ZodOptional<z.ZodString>;
|
|
266
|
+
}, "strip", z.ZodTypeAny, {
|
|
267
|
+
status: "failed" | "passed" | "skipped";
|
|
268
|
+
command: string;
|
|
269
|
+
durationMs?: number | undefined;
|
|
270
|
+
outputRef?: string | undefined;
|
|
271
|
+
}, {
|
|
272
|
+
status: "failed" | "passed" | "skipped";
|
|
273
|
+
command: string;
|
|
274
|
+
durationMs?: number | undefined;
|
|
275
|
+
outputRef?: string | undefined;
|
|
276
|
+
}>, "many">>;
|
|
277
|
+
}, "strip", z.ZodTypeAny, {
|
|
278
|
+
status: "pass" | "block";
|
|
279
|
+
summary: string;
|
|
280
|
+
findings: {
|
|
281
|
+
title: string;
|
|
282
|
+
severity: "low" | "medium" | "high" | "critical";
|
|
283
|
+
path?: string | undefined;
|
|
284
|
+
line?: number | undefined;
|
|
285
|
+
recommendation?: string | undefined;
|
|
286
|
+
}[];
|
|
287
|
+
testsRun: {
|
|
288
|
+
status: "failed" | "passed" | "skipped";
|
|
289
|
+
command: string;
|
|
290
|
+
durationMs?: number | undefined;
|
|
291
|
+
outputRef?: string | undefined;
|
|
292
|
+
}[];
|
|
293
|
+
}, {
|
|
294
|
+
status: "pass" | "block";
|
|
295
|
+
summary: string;
|
|
296
|
+
findings?: {
|
|
297
|
+
title: string;
|
|
298
|
+
severity: "low" | "medium" | "high" | "critical";
|
|
299
|
+
path?: string | undefined;
|
|
300
|
+
line?: number | undefined;
|
|
301
|
+
recommendation?: string | undefined;
|
|
302
|
+
}[] | undefined;
|
|
303
|
+
testsRun?: {
|
|
304
|
+
status: "failed" | "passed" | "skipped";
|
|
305
|
+
command: string;
|
|
306
|
+
durationMs?: number | undefined;
|
|
307
|
+
outputRef?: string | undefined;
|
|
308
|
+
}[] | undefined;
|
|
309
|
+
}>;
|
|
310
|
+
export type ReviewVerdict = z.infer<typeof reviewVerdictSchema>;
|
|
311
|
+
//# sourceMappingURL=agent-contracts.d.ts.map
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const artifactKindSchema = z.enum([
|
|
3
|
+
'brief',
|
|
4
|
+
'prd_lite',
|
|
5
|
+
'execution_graph',
|
|
6
|
+
'risk_review',
|
|
7
|
+
'acceptance_criteria',
|
|
8
|
+
'diff',
|
|
9
|
+
'review_verdict',
|
|
10
|
+
'test_result',
|
|
11
|
+
'debug_export',
|
|
12
|
+
]);
|
|
13
|
+
export const artifactRefSchema = z.object({
|
|
14
|
+
id: z.string().min(1),
|
|
15
|
+
kind: artifactKindSchema,
|
|
16
|
+
path: z.string().min(1).optional(),
|
|
17
|
+
uri: z.string().min(1).optional(),
|
|
18
|
+
title: z.string().min(1),
|
|
19
|
+
sha256: z.string().min(1).optional(),
|
|
20
|
+
createdAt: z.string().datetime(),
|
|
21
|
+
});
|
|
22
|
+
export const ideaBriefSchema = z.object({
|
|
23
|
+
id: z.string().min(1),
|
|
24
|
+
prompt: z.string().min(1),
|
|
25
|
+
targetUser: z.string().min(1).optional(),
|
|
26
|
+
currentStatusQuo: z.string().min(1).optional(),
|
|
27
|
+
narrowestWedge: z.string().min(1).optional(),
|
|
28
|
+
risks: z.array(z.string()).default([]),
|
|
29
|
+
acceptanceCriteria: z.array(z.string()).default([]),
|
|
30
|
+
artifacts: z.array(artifactRefSchema).default([]),
|
|
31
|
+
});
|
|
32
|
+
export const executionGraphNodeSchema = z.object({
|
|
33
|
+
id: z.string().min(1),
|
|
34
|
+
title: z.string().min(1),
|
|
35
|
+
kind: z.enum(['research', 'plan', 'code', 'review', 'test', 'ship']),
|
|
36
|
+
dependsOn: z.array(z.string()).default([]),
|
|
37
|
+
owner: z.string().min(1).optional(),
|
|
38
|
+
status: z.enum(['pending', 'in_progress', 'done', 'blocked']).default('pending'),
|
|
39
|
+
acceptanceCriteria: z.array(z.string()).default([]),
|
|
40
|
+
});
|
|
41
|
+
export const executionGraphSchema = z.object({
|
|
42
|
+
id: z.string().min(1),
|
|
43
|
+
title: z.string().min(1),
|
|
44
|
+
nodes: z.array(executionGraphNodeSchema),
|
|
45
|
+
artifacts: z.array(artifactRefSchema).default([]),
|
|
46
|
+
});
|
|
47
|
+
export const testResultSchema = z.object({
|
|
48
|
+
command: z.string().min(1),
|
|
49
|
+
status: z.enum(['passed', 'failed', 'skipped']),
|
|
50
|
+
durationMs: z.number().int().nonnegative().optional(),
|
|
51
|
+
outputRef: z.string().min(1).optional(),
|
|
52
|
+
});
|
|
53
|
+
export const reviewVerdictSchema = z.object({
|
|
54
|
+
status: z.enum(['pass', 'block']),
|
|
55
|
+
summary: z.string().min(1),
|
|
56
|
+
findings: z
|
|
57
|
+
.array(z.object({
|
|
58
|
+
severity: z.enum(['low', 'medium', 'high', 'critical']),
|
|
59
|
+
title: z.string().min(1),
|
|
60
|
+
path: z.string().min(1).optional(),
|
|
61
|
+
line: z.number().int().positive().optional(),
|
|
62
|
+
recommendation: z.string().min(1).optional(),
|
|
63
|
+
}))
|
|
64
|
+
.default([]),
|
|
65
|
+
testsRun: z.array(testResultSchema).default([]),
|
|
66
|
+
});
|
|
67
|
+
//# sourceMappingURL=agent-contracts.js.map
|