@vercel/factory 0.0.12 → 0.0.14
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/README.md +1 -1
- package/dist/api.d.mts +225 -0
- package/dist/api.mjs +312 -0
- package/dist/api.mjs.map +1 -0
- package/dist/{approval-DdvEKLiE.mjs → approval-JX2Px9IC.mjs} +2 -2
- package/dist/{approval-DdvEKLiE.mjs.map → approval-JX2Px9IC.mjs.map} +1 -1
- package/dist/blob/index.d.mts +4 -3
- package/dist/blob/index.mjs +21 -15
- package/dist/blob/index.mjs.map +1 -1
- package/dist/budget-DzSiIA4t.mjs +42 -0
- package/dist/budget-DzSiIA4t.mjs.map +1 -0
- package/dist/build-factory.d.mts +1 -1
- package/dist/build-factory.mjs +1 -1
- package/dist/change-D2U6v7Ek.mjs +554 -0
- package/dist/change-D2U6v7Ek.mjs.map +1 -0
- package/dist/communication-Kd9nU5RP.mjs +30 -0
- package/dist/communication-Kd9nU5RP.mjs.map +1 -0
- package/dist/connectors/index.d.mts +3 -2
- package/dist/connectors/index.mjs +53 -26
- package/dist/connectors/index.mjs.map +1 -1
- package/dist/connectors/slack.d.mts +17 -6
- package/dist/connectors/slack.mjs +99 -32
- package/dist/connectors/slack.mjs.map +1 -1
- package/dist/coordination-Cq08hb1l.mjs +76 -0
- package/dist/coordination-Cq08hb1l.mjs.map +1 -0
- package/dist/dispatch-BaZS3PT8.d.mts +76 -0
- package/dist/{driver-CrZsy7sm.d.mts → driver-BC0Mt5KG.d.mts} +2 -2
- package/dist/driver-Bbd25rNM.mjs.map +1 -1
- package/dist/engine-DFHU2Pe-.d.mts +781 -0
- package/dist/engine-WaUM2cGA.mjs +1068 -0
- package/dist/engine-WaUM2cGA.mjs.map +1 -0
- package/dist/eve/index.d.mts +289 -153
- package/dist/eve/index.mjs +378 -89
- package/dist/eve/index.mjs.map +1 -1
- package/dist/{factory-config-ifd3JxiU.mjs → factory-config-BoRXOw43.mjs} +23 -22
- package/dist/factory-config-BoRXOw43.mjs.map +1 -0
- package/dist/{factory-config-Bu4mklm9.d.mts → factory-config-D2yU3G0c.d.mts} +21 -2
- package/dist/{github-wThBfbm-.d.mts → github-C5HNBN6p.d.mts} +34 -3
- package/dist/github.d.mts +2 -2
- package/dist/github.mjs +61 -1
- package/dist/github.mjs.map +1 -1
- package/dist/{id-DwCihQr4.mjs → id-BLIkCVue.mjs} +4 -2
- package/dist/{id-DwCihQr4.mjs.map → id-BLIkCVue.mjs.map} +1 -1
- package/dist/index-Bw6hggoH.d.mts +40 -0
- package/dist/index.d.mts +291 -61
- package/dist/index.mjs +140 -783
- package/dist/index.mjs.map +1 -1
- package/dist/postgres/index.d.mts +1 -1
- package/dist/task-CcOyOJ3k.mjs +154 -0
- package/dist/task-CcOyOJ3k.mjs.map +1 -0
- package/package.json +5 -1
- package/dist/approval-CIXB8IF8.d.mts +0 -522
- package/dist/change-CFNGXVqD.mjs +0 -230
- package/dist/change-CFNGXVqD.mjs.map +0 -1
- package/dist/factory-config-ifd3JxiU.mjs.map +0 -1
- package/dist/index-Cy4jfXh5.d.mts +0 -67
- package/dist/signal-CHVEmzvI.d.mts +0 -59
|
@@ -1,522 +0,0 @@
|
|
|
1
|
-
import { i as StoreDriver } from "./driver-CrZsy7sm.mjs";
|
|
2
|
-
import { c as ReplyTo, n as SignalOutcome, r as SignalSource, t as Signal } from "./signal-CHVEmzvI.mjs";
|
|
3
|
-
import { z } from "zod";
|
|
4
|
-
//#region src/schema/id.d.ts
|
|
5
|
-
declare const factoryIdSchema: z.ZodString;
|
|
6
|
-
declare const repositoryIdSchema: z.ZodString;
|
|
7
|
-
declare const signalIdSchema: z.ZodString;
|
|
8
|
-
declare const taskIdSchema: z.ZodString;
|
|
9
|
-
declare const changeIdSchema: z.ZodString;
|
|
10
|
-
declare const receiptIdSchema: z.ZodString;
|
|
11
|
-
declare const repositoryIdsSchema: z.ZodArray<z.ZodString>;
|
|
12
|
-
type FactoryId = z.infer<typeof factoryIdSchema>;
|
|
13
|
-
type RepositoryId = z.infer<typeof repositoryIdSchema>;
|
|
14
|
-
type SignalId = z.infer<typeof signalIdSchema>;
|
|
15
|
-
type TaskId = z.infer<typeof taskIdSchema>;
|
|
16
|
-
type ChangeId = z.infer<typeof changeIdSchema>;
|
|
17
|
-
type ReceiptId = z.infer<typeof receiptIdSchema>;
|
|
18
|
-
//#endregion
|
|
19
|
-
//#region src/schema/change.d.ts
|
|
20
|
-
declare const levelSchema: z.ZodEnum<{
|
|
21
|
-
low: "low";
|
|
22
|
-
medium: "medium";
|
|
23
|
-
high: "high";
|
|
24
|
-
}>;
|
|
25
|
-
declare const changeStateSchema: z.ZodEnum<{
|
|
26
|
-
verifying: "verifying";
|
|
27
|
-
ready: "ready";
|
|
28
|
-
merged: "merged";
|
|
29
|
-
deployed: "deployed";
|
|
30
|
-
rolled_out: "rolled_out";
|
|
31
|
-
rolled_back: "rolled_back";
|
|
32
|
-
closed: "closed";
|
|
33
|
-
}>;
|
|
34
|
-
declare const changeEvidenceSchema: z.ZodObject<{
|
|
35
|
-
reproVerified: z.ZodBoolean;
|
|
36
|
-
testsAdded: z.ZodNumber;
|
|
37
|
-
checksGreen: z.ZodBoolean;
|
|
38
|
-
attackPassed: z.ZodBoolean;
|
|
39
|
-
scopeMatches: z.ZodBoolean;
|
|
40
|
-
previewUrl: z.ZodOptional<z.ZodURL>;
|
|
41
|
-
}, z.core.$strict>;
|
|
42
|
-
declare const changeSchema: z.ZodObject<{
|
|
43
|
-
schemaVersion: z.ZodLiteral<1>;
|
|
44
|
-
id: z.ZodString;
|
|
45
|
-
repositoryId: z.ZodString;
|
|
46
|
-
taskId: z.ZodOptional<z.ZodString>;
|
|
47
|
-
groupId: z.ZodOptional<z.ZodString>;
|
|
48
|
-
prNumber: z.ZodNumber;
|
|
49
|
-
prUrl: z.ZodURL;
|
|
50
|
-
author: z.ZodString;
|
|
51
|
-
risk: z.ZodEnum<{
|
|
52
|
-
low: "low";
|
|
53
|
-
medium: "medium";
|
|
54
|
-
high: "high";
|
|
55
|
-
}>;
|
|
56
|
-
confidence: z.ZodEnum<{
|
|
57
|
-
low: "low";
|
|
58
|
-
medium: "medium";
|
|
59
|
-
high: "high";
|
|
60
|
-
}>;
|
|
61
|
-
evidence: z.ZodObject<{
|
|
62
|
-
reproVerified: z.ZodBoolean;
|
|
63
|
-
testsAdded: z.ZodNumber;
|
|
64
|
-
checksGreen: z.ZodBoolean;
|
|
65
|
-
attackPassed: z.ZodBoolean;
|
|
66
|
-
scopeMatches: z.ZodBoolean;
|
|
67
|
-
previewUrl: z.ZodOptional<z.ZodURL>;
|
|
68
|
-
}, z.core.$strict>;
|
|
69
|
-
state: z.ZodEnum<{
|
|
70
|
-
verifying: "verifying";
|
|
71
|
-
ready: "ready";
|
|
72
|
-
merged: "merged";
|
|
73
|
-
deployed: "deployed";
|
|
74
|
-
rolled_out: "rolled_out";
|
|
75
|
-
rolled_back: "rolled_back";
|
|
76
|
-
closed: "closed";
|
|
77
|
-
}>;
|
|
78
|
-
mergeSha: z.ZodOptional<z.ZodString>;
|
|
79
|
-
decidedBy: z.ZodOptional<z.ZodString>;
|
|
80
|
-
createdAt: z.ZodISODateTime;
|
|
81
|
-
updatedAt: z.ZodISODateTime;
|
|
82
|
-
}, z.core.$strict>;
|
|
83
|
-
type Level = z.infer<typeof levelSchema>;
|
|
84
|
-
type ChangeState = z.infer<typeof changeStateSchema>;
|
|
85
|
-
type ChangeEvidence = z.infer<typeof changeEvidenceSchema>;
|
|
86
|
-
type Change = z.infer<typeof changeSchema>;
|
|
87
|
-
//#endregion
|
|
88
|
-
//#region src/schema/receipt.d.ts
|
|
89
|
-
/** States the engine writes on transitions. Any vocabulary value is valid. */
|
|
90
|
-
declare const standardReceiptStates: readonly ["approved", "rejected", "dispatched", "succeeded", "failed", "needs_human", "cancelled", "settled", "ready", "merged", "deployed", "rolled_out", "rolled_back"];
|
|
91
|
-
/** Phases the standard loop uses. Any vocabulary value is valid. */
|
|
92
|
-
declare const standardReceiptPhases: readonly ["approval", "budget", "dispatch", "implementation", "verification", "pull_request", "cleanup"];
|
|
93
|
-
/** Kinds the standard loop writes: the standard task kinds plus "change". */
|
|
94
|
-
declare const standardReceiptKinds: readonly ["coordination", "code_change", "verification", "investigation", "question", "change"];
|
|
95
|
-
declare const receiptStateSchema: z.ZodString;
|
|
96
|
-
declare const receiptPhaseSchema: z.ZodString;
|
|
97
|
-
declare const receiptKindSchema: z.ZodString;
|
|
98
|
-
declare const costSchema: z.ZodObject<{
|
|
99
|
-
totalUsd: z.ZodNumber;
|
|
100
|
-
}, z.core.$strict>;
|
|
101
|
-
declare const receiptSchema: z.ZodObject<{
|
|
102
|
-
schemaVersion: z.ZodLiteral<1>;
|
|
103
|
-
receiptId: z.ZodString;
|
|
104
|
-
repositoryIds: z.ZodArray<z.ZodString>;
|
|
105
|
-
taskId: z.ZodOptional<z.ZodString>;
|
|
106
|
-
changeId: z.ZodOptional<z.ZodString>;
|
|
107
|
-
kind: z.ZodString;
|
|
108
|
-
state: z.ZodString;
|
|
109
|
-
phase: z.ZodOptional<z.ZodString>;
|
|
110
|
-
reason: z.ZodOptional<z.ZodString>;
|
|
111
|
-
attempt: z.ZodNumber;
|
|
112
|
-
cost: z.ZodOptional<z.ZodObject<{
|
|
113
|
-
totalUsd: z.ZodNumber;
|
|
114
|
-
}, z.core.$strict>>;
|
|
115
|
-
decidedBy: z.ZodOptional<z.ZodString>;
|
|
116
|
-
recordedAt: z.ZodISODateTime;
|
|
117
|
-
}, z.core.$strict>;
|
|
118
|
-
type ReceiptState = z.infer<typeof receiptStateSchema>;
|
|
119
|
-
type ReceiptPhase = z.infer<typeof receiptPhaseSchema>;
|
|
120
|
-
type ReceiptKind = z.infer<typeof receiptKindSchema>;
|
|
121
|
-
type Cost = z.infer<typeof costSchema>;
|
|
122
|
-
type Receipt = z.infer<typeof receiptSchema>;
|
|
123
|
-
//#endregion
|
|
124
|
-
//#region src/schema/repository.d.ts
|
|
125
|
-
declare const repositorySlugSchema: z.ZodString;
|
|
126
|
-
declare const repositorySchema: z.ZodObject<{
|
|
127
|
-
schemaVersion: z.ZodLiteral<1>;
|
|
128
|
-
id: z.ZodString;
|
|
129
|
-
slug: z.ZodString;
|
|
130
|
-
defaultBranch: z.ZodString;
|
|
131
|
-
enabled: z.ZodBoolean;
|
|
132
|
-
dependsOn: z.ZodArray<z.ZodString>;
|
|
133
|
-
devbox: z.ZodOptional<z.ZodObject<{
|
|
134
|
-
projectId: z.ZodString;
|
|
135
|
-
teamId: z.ZodString;
|
|
136
|
-
snapshot: z.ZodOptional<z.ZodString>;
|
|
137
|
-
}, z.core.$strict>>;
|
|
138
|
-
connectedAt: z.ZodISODateTime;
|
|
139
|
-
}, z.core.$strict>;
|
|
140
|
-
type RepositorySlug = z.infer<typeof repositorySlugSchema>;
|
|
141
|
-
type Repository = z.infer<typeof repositorySchema>;
|
|
142
|
-
//#endregion
|
|
143
|
-
//#region src/schema/task.d.ts
|
|
144
|
-
/**
|
|
145
|
-
* Kinds the standard loop understands. Any vocabulary value is valid; the
|
|
146
|
-
* kind-scoped rules below apply only to these standard kinds.
|
|
147
|
-
*/
|
|
148
|
-
declare const standardTaskKinds: readonly ["coordination", "code_change", "verification", "investigation", "question"];
|
|
149
|
-
declare const taskKindSchema: z.ZodString;
|
|
150
|
-
declare const taskStateSchema: z.ZodEnum<{
|
|
151
|
-
queued: "queued";
|
|
152
|
-
running: "running";
|
|
153
|
-
verifying: "verifying";
|
|
154
|
-
succeeded: "succeeded";
|
|
155
|
-
failed: "failed";
|
|
156
|
-
needs_human: "needs_human";
|
|
157
|
-
cancelled: "cancelled";
|
|
158
|
-
}>;
|
|
159
|
-
declare const taskApprovalSchema: z.ZodEnum<{
|
|
160
|
-
required: "required";
|
|
161
|
-
granted: "granted";
|
|
162
|
-
denied: "denied";
|
|
163
|
-
}>;
|
|
164
|
-
declare const taskExecutionRepositoryIdsSchema: z.ZodTuple<[z.ZodString], null>;
|
|
165
|
-
declare const coordinationRepositoryIdsSchema: z.ZodTuple<[z.ZodString, z.ZodString], z.ZodString>;
|
|
166
|
-
declare const harnessSchema: z.ZodString;
|
|
167
|
-
declare const taskOriginSchema: z.ZodObject<{
|
|
168
|
-
signalId: z.ZodOptional<z.ZodString>;
|
|
169
|
-
parentTaskId: z.ZodOptional<z.ZodString>;
|
|
170
|
-
operator: z.ZodOptional<z.ZodString>;
|
|
171
|
-
}, z.core.$strict>;
|
|
172
|
-
declare const taskDevboxSchema: z.ZodObject<{
|
|
173
|
-
devboxId: z.ZodString;
|
|
174
|
-
remoteId: z.ZodString;
|
|
175
|
-
harness: z.ZodString;
|
|
176
|
-
}, z.core.$strict>;
|
|
177
|
-
declare const taskQuestionSchema: z.ZodObject<{
|
|
178
|
-
text: z.ZodString;
|
|
179
|
-
options: z.ZodArray<z.ZodString>;
|
|
180
|
-
answer: z.ZodOptional<z.ZodString>;
|
|
181
|
-
answeredBy: z.ZodOptional<z.ZodString>;
|
|
182
|
-
}, z.core.$strict>;
|
|
183
|
-
declare const taskSchema: z.ZodObject<{
|
|
184
|
-
schemaVersion: z.ZodLiteral<1>;
|
|
185
|
-
id: z.ZodString;
|
|
186
|
-
repositoryIds: z.ZodArray<z.ZodString>;
|
|
187
|
-
kind: z.ZodString;
|
|
188
|
-
area: z.ZodOptional<z.ZodString>;
|
|
189
|
-
state: z.ZodEnum<{
|
|
190
|
-
queued: "queued";
|
|
191
|
-
running: "running";
|
|
192
|
-
verifying: "verifying";
|
|
193
|
-
succeeded: "succeeded";
|
|
194
|
-
failed: "failed";
|
|
195
|
-
needs_human: "needs_human";
|
|
196
|
-
cancelled: "cancelled";
|
|
197
|
-
}>;
|
|
198
|
-
approval: z.ZodOptional<z.ZodEnum<{
|
|
199
|
-
required: "required";
|
|
200
|
-
granted: "granted";
|
|
201
|
-
denied: "denied";
|
|
202
|
-
}>>;
|
|
203
|
-
origin: z.ZodObject<{
|
|
204
|
-
signalId: z.ZodOptional<z.ZodString>;
|
|
205
|
-
parentTaskId: z.ZodOptional<z.ZodString>;
|
|
206
|
-
operator: z.ZodOptional<z.ZodString>;
|
|
207
|
-
}, z.core.$strict>;
|
|
208
|
-
dependsOn: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
209
|
-
replyTo: z.ZodObject<{
|
|
210
|
-
channel: z.ZodString;
|
|
211
|
-
address: z.ZodString;
|
|
212
|
-
}, z.core.$strict>;
|
|
213
|
-
devbox: z.ZodOptional<z.ZodObject<{
|
|
214
|
-
devboxId: z.ZodString;
|
|
215
|
-
remoteId: z.ZodString;
|
|
216
|
-
harness: z.ZodString;
|
|
217
|
-
}, z.core.$strict>>;
|
|
218
|
-
attempt: z.ZodNumber;
|
|
219
|
-
reservedUsd: z.ZodOptional<z.ZodNumber>;
|
|
220
|
-
settledUsd: z.ZodOptional<z.ZodNumber>;
|
|
221
|
-
question: z.ZodOptional<z.ZodObject<{
|
|
222
|
-
text: z.ZodString;
|
|
223
|
-
options: z.ZodArray<z.ZodString>;
|
|
224
|
-
answer: z.ZodOptional<z.ZodString>;
|
|
225
|
-
answeredBy: z.ZodOptional<z.ZodString>;
|
|
226
|
-
}, z.core.$strict>>;
|
|
227
|
-
changeId: z.ZodOptional<z.ZodString>;
|
|
228
|
-
reportRef: z.ZodOptional<z.ZodString>;
|
|
229
|
-
createdAt: z.ZodISODateTime;
|
|
230
|
-
updatedAt: z.ZodISODateTime;
|
|
231
|
-
}, z.core.$strict>;
|
|
232
|
-
type TaskApproval = z.infer<typeof taskApprovalSchema>;
|
|
233
|
-
type TaskKind = z.infer<typeof taskKindSchema>;
|
|
234
|
-
type TaskState = z.infer<typeof taskStateSchema>;
|
|
235
|
-
type Task = z.infer<typeof taskSchema>;
|
|
236
|
-
//#endregion
|
|
237
|
-
//#region src/store/engine.d.ts
|
|
238
|
-
/** An approval decision that does not apply to the task's current approval or state. */
|
|
239
|
-
declare class ApprovalError extends Error {
|
|
240
|
-
readonly taskId: TaskId;
|
|
241
|
-
readonly reason: string;
|
|
242
|
-
constructor(taskId: TaskId, reason: string);
|
|
243
|
-
}
|
|
244
|
-
declare class ChangeAssociationError extends Error {
|
|
245
|
-
readonly taskId: TaskId;
|
|
246
|
-
readonly repositoryId: RepositoryId;
|
|
247
|
-
readonly reason: string;
|
|
248
|
-
constructor(taskId: TaskId, repositoryId: RepositoryId, reason: string);
|
|
249
|
-
}
|
|
250
|
-
interface CreateSignalInput {
|
|
251
|
-
repositoryId: RepositoryId;
|
|
252
|
-
source: SignalSource;
|
|
253
|
-
deliveryId: string;
|
|
254
|
-
replyTo: ReplyTo;
|
|
255
|
-
payload: unknown;
|
|
256
|
-
}
|
|
257
|
-
interface DecideSignalOptions {
|
|
258
|
-
detail?: string;
|
|
259
|
-
reason?: string;
|
|
260
|
-
}
|
|
261
|
-
interface CreateTaskInput {
|
|
262
|
-
repositoryIds: RepositoryId[];
|
|
263
|
-
kind: Task["kind"];
|
|
264
|
-
origin: Task["origin"];
|
|
265
|
-
replyTo: ReplyTo;
|
|
266
|
-
/** Same key creates one task and returns it on workflow retries. */
|
|
267
|
-
dedupeKey?: string;
|
|
268
|
-
area?: string;
|
|
269
|
-
changeId?: ChangeId;
|
|
270
|
-
dependsOn?: TaskId[];
|
|
271
|
-
question?: Task["question"];
|
|
272
|
-
/** Stamp the task as needing a human decision before dispatch. */
|
|
273
|
-
approval?: "required";
|
|
274
|
-
}
|
|
275
|
-
interface ApprovalDecision {
|
|
276
|
-
/** Authenticated operator making the decision. */
|
|
277
|
-
by: string;
|
|
278
|
-
reason?: string;
|
|
279
|
-
}
|
|
280
|
-
type TaskPatch = Partial<Pick<Task, "devbox" | "changeId" | "reportRef" | "reservedUsd" | "settledUsd" | "question">>;
|
|
281
|
-
interface TaskTransitionOptions {
|
|
282
|
-
patch?: TaskPatch;
|
|
283
|
-
reason?: string;
|
|
284
|
-
}
|
|
285
|
-
interface CreateChangeInput {
|
|
286
|
-
repositoryId: RepositoryId;
|
|
287
|
-
taskId?: TaskId;
|
|
288
|
-
groupId?: TaskId;
|
|
289
|
-
prNumber: number;
|
|
290
|
-
prUrl: string;
|
|
291
|
-
author: string;
|
|
292
|
-
risk: Level;
|
|
293
|
-
confidence: Level;
|
|
294
|
-
evidence: Change["evidence"];
|
|
295
|
-
}
|
|
296
|
-
type ChangePatch = Partial<Pick<Change, "confidence" | "evidence" | "decidedBy" | "mergeSha">>;
|
|
297
|
-
interface ChangeTransitionOptions {
|
|
298
|
-
patch?: ChangePatch;
|
|
299
|
-
reason?: string;
|
|
300
|
-
}
|
|
301
|
-
interface AppendReceiptInput {
|
|
302
|
-
repositoryIds: RepositoryId[];
|
|
303
|
-
taskId?: TaskId;
|
|
304
|
-
changeId?: ChangeId;
|
|
305
|
-
kind: string;
|
|
306
|
-
state: string;
|
|
307
|
-
phase?: string;
|
|
308
|
-
reason?: string;
|
|
309
|
-
attempt?: number;
|
|
310
|
-
cost?: Cost;
|
|
311
|
-
decidedBy?: string;
|
|
312
|
-
/** Same key twice appends one receipt and returns the existing one. */
|
|
313
|
-
dedupeKey?: string;
|
|
314
|
-
}
|
|
315
|
-
interface FactoryStores {
|
|
316
|
-
driverName: string;
|
|
317
|
-
repositories: {
|
|
318
|
-
put(repository: Repository): Promise<Repository>;
|
|
319
|
-
get(id: RepositoryId): Promise<Repository | null>;
|
|
320
|
-
list(): Promise<Repository[]>;
|
|
321
|
-
};
|
|
322
|
-
signals: {
|
|
323
|
-
create(input: CreateSignalInput): Promise<Signal>;
|
|
324
|
-
get(id: SignalId): Promise<Signal | null>;
|
|
325
|
-
decide(id: SignalId, outcome: SignalOutcome, options?: DecideSignalOptions): Promise<Signal>;
|
|
326
|
-
list(): Promise<Signal[]>;
|
|
327
|
-
};
|
|
328
|
-
tasks: {
|
|
329
|
-
create(input: CreateTaskInput): Promise<Task>;
|
|
330
|
-
get(id: TaskId): Promise<Task | null>;
|
|
331
|
-
transition(id: TaskId, to: TaskState, options?: TaskTransitionOptions): Promise<Task>;
|
|
332
|
-
/** Grant a required approval. The task stays queued; dispatch may now take it. */
|
|
333
|
-
approve(id: TaskId, decision: ApprovalDecision): Promise<Task>;
|
|
334
|
-
/** Deny a required approval. The task is cancelled with the reason. */
|
|
335
|
-
reject(id: TaskId, decision: ApprovalDecision): Promise<Task>;
|
|
336
|
-
list(): Promise<Task[]>;
|
|
337
|
-
};
|
|
338
|
-
changes: {
|
|
339
|
-
create(input: CreateChangeInput): Promise<Change>;
|
|
340
|
-
get(id: ChangeId): Promise<Change | null>;
|
|
341
|
-
transition(id: ChangeId, to: ChangeState, options?: ChangeTransitionOptions): Promise<Change>;
|
|
342
|
-
list(): Promise<Change[]>;
|
|
343
|
-
};
|
|
344
|
-
receipts: {
|
|
345
|
-
append(input: AppendReceiptInput): Promise<Receipt>;
|
|
346
|
-
get(id: string): Promise<Receipt | null>;
|
|
347
|
-
list(): Promise<Receipt[]>;
|
|
348
|
-
};
|
|
349
|
-
}
|
|
350
|
-
interface CreateStoresOptions {
|
|
351
|
-
driver: StoreDriver;
|
|
352
|
-
now?: () => string;
|
|
353
|
-
}
|
|
354
|
-
declare function createStores(options: CreateStoresOptions): FactoryStores;
|
|
355
|
-
//#endregion
|
|
356
|
-
//#region src/schema/finding.d.ts
|
|
357
|
-
declare const findingPrioritySchema: z.ZodEnum<{
|
|
358
|
-
P0: "P0";
|
|
359
|
-
P1: "P1";
|
|
360
|
-
P2: "P2";
|
|
361
|
-
P3: "P3";
|
|
362
|
-
}>;
|
|
363
|
-
declare const findingCategorySchema: z.ZodEnum<{
|
|
364
|
-
security: "security";
|
|
365
|
-
correctness: "correctness";
|
|
366
|
-
reliability: "reliability";
|
|
367
|
-
performance: "performance";
|
|
368
|
-
compatibility: "compatibility";
|
|
369
|
-
accessibility: "accessibility";
|
|
370
|
-
documentation: "documentation";
|
|
371
|
-
maintainability: "maintainability";
|
|
372
|
-
testing: "testing";
|
|
373
|
-
usability: "usability";
|
|
374
|
-
}>;
|
|
375
|
-
declare const findingVerificationLevelSchema: z.ZodEnum<{
|
|
376
|
-
unverified: "unverified";
|
|
377
|
-
supported: "supported";
|
|
378
|
-
confirmed: "confirmed";
|
|
379
|
-
}>;
|
|
380
|
-
declare const findingVerificationMethodSchema: z.ZodEnum<{
|
|
381
|
-
documentation: "documentation";
|
|
382
|
-
code_inspection: "code_inspection";
|
|
383
|
-
static_analysis: "static_analysis";
|
|
384
|
-
manual_reproduction: "manual_reproduction";
|
|
385
|
-
unit_test: "unit_test";
|
|
386
|
-
integration_test: "integration_test";
|
|
387
|
-
e2e_test: "e2e_test";
|
|
388
|
-
runtime_observation: "runtime_observation";
|
|
389
|
-
}>;
|
|
390
|
-
/**
|
|
391
|
-
* What was done to check the finding. Forces a reporter to distinguish "I
|
|
392
|
-
* think this is a problem" from "I demonstrated it", which is the axis a human
|
|
393
|
-
* approving fixes cares about most.
|
|
394
|
-
*/
|
|
395
|
-
declare const findingVerificationSchema: z.ZodObject<{
|
|
396
|
-
level: z.ZodEnum<{
|
|
397
|
-
unverified: "unverified";
|
|
398
|
-
supported: "supported";
|
|
399
|
-
confirmed: "confirmed";
|
|
400
|
-
}>;
|
|
401
|
-
method: z.ZodEnum<{
|
|
402
|
-
documentation: "documentation";
|
|
403
|
-
code_inspection: "code_inspection";
|
|
404
|
-
static_analysis: "static_analysis";
|
|
405
|
-
manual_reproduction: "manual_reproduction";
|
|
406
|
-
unit_test: "unit_test";
|
|
407
|
-
integration_test: "integration_test";
|
|
408
|
-
e2e_test: "e2e_test";
|
|
409
|
-
runtime_observation: "runtime_observation";
|
|
410
|
-
}>;
|
|
411
|
-
summary: z.ZodString;
|
|
412
|
-
limitations: z.ZodOptional<z.ZodString>;
|
|
413
|
-
}, z.core.$strict>;
|
|
414
|
-
/** A single problem found in a repository, as a scanner or agent reports it. */
|
|
415
|
-
declare const findingSchema: z.ZodObject<{
|
|
416
|
-
title: z.ZodString;
|
|
417
|
-
body: z.ZodString;
|
|
418
|
-
path: z.ZodOptional<z.ZodString>;
|
|
419
|
-
line: z.ZodOptional<z.ZodNumber>;
|
|
420
|
-
endLine: z.ZodOptional<z.ZodNumber>;
|
|
421
|
-
priority: z.ZodEnum<{
|
|
422
|
-
P0: "P0";
|
|
423
|
-
P1: "P1";
|
|
424
|
-
P2: "P2";
|
|
425
|
-
P3: "P3";
|
|
426
|
-
}>;
|
|
427
|
-
category: z.ZodEnum<{
|
|
428
|
-
security: "security";
|
|
429
|
-
correctness: "correctness";
|
|
430
|
-
reliability: "reliability";
|
|
431
|
-
performance: "performance";
|
|
432
|
-
compatibility: "compatibility";
|
|
433
|
-
accessibility: "accessibility";
|
|
434
|
-
documentation: "documentation";
|
|
435
|
-
maintainability: "maintainability";
|
|
436
|
-
testing: "testing";
|
|
437
|
-
usability: "usability";
|
|
438
|
-
}>;
|
|
439
|
-
verification: z.ZodObject<{
|
|
440
|
-
level: z.ZodEnum<{
|
|
441
|
-
unverified: "unverified";
|
|
442
|
-
supported: "supported";
|
|
443
|
-
confirmed: "confirmed";
|
|
444
|
-
}>;
|
|
445
|
-
method: z.ZodEnum<{
|
|
446
|
-
documentation: "documentation";
|
|
447
|
-
code_inspection: "code_inspection";
|
|
448
|
-
static_analysis: "static_analysis";
|
|
449
|
-
manual_reproduction: "manual_reproduction";
|
|
450
|
-
unit_test: "unit_test";
|
|
451
|
-
integration_test: "integration_test";
|
|
452
|
-
e2e_test: "e2e_test";
|
|
453
|
-
runtime_observation: "runtime_observation";
|
|
454
|
-
}>;
|
|
455
|
-
summary: z.ZodString;
|
|
456
|
-
limitations: z.ZodOptional<z.ZodString>;
|
|
457
|
-
}, z.core.$strict>;
|
|
458
|
-
tool: z.ZodOptional<z.ZodString>;
|
|
459
|
-
ruleId: z.ZodOptional<z.ZodString>;
|
|
460
|
-
}, z.core.$strict>;
|
|
461
|
-
type FindingPriority = z.infer<typeof findingPrioritySchema>;
|
|
462
|
-
type FindingCategory = z.infer<typeof findingCategorySchema>;
|
|
463
|
-
type FindingVerification = z.infer<typeof findingVerificationSchema>;
|
|
464
|
-
type Finding = z.infer<typeof findingSchema>;
|
|
465
|
-
/**
|
|
466
|
-
* Stable identity of a finding across scans, used as the signal's delivery id
|
|
467
|
-
* so re-reporting is a no-op instead of a second task. A scanner finding is
|
|
468
|
-
* the same problem when the same tool reports the same rule on the same file;
|
|
469
|
-
* its title is model-written prose and changes between runs, so it is left
|
|
470
|
-
* out. Without a rule id the title is all there is, normalised.
|
|
471
|
-
*/
|
|
472
|
-
declare function findingFingerprint(repositoryId: string, finding: Finding): string;
|
|
473
|
-
//#endregion
|
|
474
|
-
//#region src/approval.d.ts
|
|
475
|
-
/**
|
|
476
|
-
* One approval rule. Every listed field must match for the rule to apply;
|
|
477
|
-
* absent fields match anything. Rules are evaluated first-match.
|
|
478
|
-
*/
|
|
479
|
-
declare const approvalRuleSchema: z.ZodObject<{
|
|
480
|
-
source: z.ZodOptional<z.ZodString>;
|
|
481
|
-
kind: z.ZodOptional<z.ZodString>;
|
|
482
|
-
priority: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
483
|
-
P0: "P0";
|
|
484
|
-
P1: "P1";
|
|
485
|
-
P2: "P2";
|
|
486
|
-
P3: "P3";
|
|
487
|
-
}>>>;
|
|
488
|
-
require: z.ZodBoolean;
|
|
489
|
-
}, z.core.$strict>;
|
|
490
|
-
declare const approvalPolicySchema: z.ZodArray<z.ZodObject<{
|
|
491
|
-
source: z.ZodOptional<z.ZodString>;
|
|
492
|
-
kind: z.ZodOptional<z.ZodString>;
|
|
493
|
-
priority: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
494
|
-
P0: "P0";
|
|
495
|
-
P1: "P1";
|
|
496
|
-
P2: "P2";
|
|
497
|
-
P3: "P3";
|
|
498
|
-
}>>>;
|
|
499
|
-
require: z.ZodBoolean;
|
|
500
|
-
}, z.core.$strict>>;
|
|
501
|
-
type ApprovalRule = z.infer<typeof approvalRuleSchema>;
|
|
502
|
-
type ApprovalPolicy = z.infer<typeof approvalPolicySchema>;
|
|
503
|
-
/**
|
|
504
|
-
* The default: fixes for security findings wait for a human; everything else
|
|
505
|
-
* runs as it always has. Handoffs between agents (verification) never wait,
|
|
506
|
-
* because a human already approved the work they continue.
|
|
507
|
-
*/
|
|
508
|
-
declare const defaultApprovalPolicy: ApprovalPolicy;
|
|
509
|
-
interface ApprovalSubject {
|
|
510
|
-
source?: string;
|
|
511
|
-
kind: string;
|
|
512
|
-
priority?: FindingPriority;
|
|
513
|
-
}
|
|
514
|
-
/**
|
|
515
|
-
* Decide at task-creation time whether a task needs approval. Pure: the answer
|
|
516
|
-
* is stamped on the task and never re-evaluated, so a later policy change
|
|
517
|
-
* cannot silently release work a human was expecting to see.
|
|
518
|
-
*/
|
|
519
|
-
declare function requiresApproval(policy: ApprovalPolicy, subject: ApprovalSubject): boolean;
|
|
520
|
-
//#endregion
|
|
521
|
-
export { Cost as $, FactoryStores as A, repositoryIdsSchema as At, standardTaskKinds as B, ChangePatch as C, RepositoryId as Ct, CreateStoresOptions as D, factoryIdSchema as Dt, CreateSignalInput as E, changeIdSchema as Et, TaskApproval as F, taskOriginSchema as G, taskDevboxSchema as H, TaskKind as I, taskStateSchema as J, taskQuestionSchema as K, TaskState as L, TaskTransitionOptions as M, taskIdSchema as Mt, createStores as N, CreateTaskInput as O, receiptIdSchema as Ot, Task as P, repositorySlugSchema as Q, coordinationRepositoryIdsSchema as R, ChangeAssociationError as S, ReceiptId as St, CreateChangeInput as T, TaskId as Tt, taskExecutionRepositoryIdsSchema as U, taskApprovalSchema as V, taskKindSchema as W, RepositorySlug as X, Repository as Y, repositorySchema as Z, findingVerificationMethodSchema as _, changeSchema as _t, approvalRuleSchema as a, receiptKindSchema as at, ApprovalDecision as b, ChangeId as bt, Finding as c, receiptStateSchema as ct, FindingVerification as d, standardReceiptStates as dt, Receipt as et, findingCategorySchema as f, Change as ft, findingVerificationLevelSchema as g, changeEvidenceSchema as gt, findingSchema as h, Level as ht, approvalPolicySchema as i, costSchema as it, TaskPatch as j, signalIdSchema as jt, DecideSignalOptions as k, repositoryIdSchema as kt, FindingCategory as l, standardReceiptKinds as lt, findingPrioritySchema as m, ChangeState as mt, ApprovalRule as n, ReceiptPhase as nt, defaultApprovalPolicy as o, receiptPhaseSchema as ot, findingFingerprint as p, ChangeEvidence as pt, taskSchema as q, ApprovalSubject as r, ReceiptState as rt, requiresApproval as s, receiptSchema as st, ApprovalPolicy as t, ReceiptKind as tt, FindingPriority as u, standardReceiptPhases as ut, findingVerificationSchema as v, changeStateSchema as vt, ChangeTransitionOptions as w, SignalId as wt, ApprovalError as x, FactoryId as xt, AppendReceiptInput as y, levelSchema as yt, harnessSchema as z };
|
|
522
|
-
//# sourceMappingURL=approval-CIXB8IF8.d.mts.map
|