@vercel/factory 0.0.13 → 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-JX2Px9IC.mjs +132 -0
- package/dist/approval-JX2Px9IC.mjs.map +1 -0
- 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.mjs +1 -1
- package/dist/{change-CzEAoFVE.mjs → change-D2U6v7Ek.mjs} +10 -76
- 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 +13 -2
- package/dist/connectors/slack.mjs +18 -2
- 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-BJutB0PE.d.mts → driver-BC0Mt5KG.d.mts} +2 -2
- package/dist/driver-Bbd25rNM.mjs.map +1 -1
- package/dist/{dispatch-B77cuPxh.d.mts → engine-DFHU2Pe-.d.mts} +356 -288
- package/dist/engine-WaUM2cGA.mjs +1068 -0
- package/dist/engine-WaUM2cGA.mjs.map +1 -0
- package/dist/eve/index.d.mts +44 -334
- package/dist/eve/index.mjs +51 -38
- package/dist/eve/index.mjs.map +1 -1
- package/dist/{factory-config-BJcjsPKl.mjs → factory-config-BoRXOw43.mjs} +5 -41
- package/dist/factory-config-BoRXOw43.mjs.map +1 -0
- package/dist/{github-DXsxboUL.d.mts → github-C5HNBN6p.d.mts} +11 -3
- package/dist/github.d.mts +2 -2
- package/dist/github.mjs +15 -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 +176 -6
- package/dist/index.mjs +50 -652
- package/dist/index.mjs.map +1 -1
- package/dist/postgres/index.d.mts +1 -1
- package/dist/{approval-CwhTP1XB.mjs → task-CcOyOJ3k.mjs} +18 -133
- package/dist/task-CcOyOJ3k.mjs.map +1 -0
- package/package.json +5 -1
- package/dist/approval-CwhTP1XB.mjs.map +0 -1
- package/dist/change-CzEAoFVE.mjs.map +0 -1
- package/dist/factory-config-BJcjsPKl.mjs.map +0 -1
- package/dist/index-Cy4jfXh5.d.mts +0 -67
- package/dist/signal-CHVEmzvI.d.mts +0 -59
|
@@ -1,6 +1,52 @@
|
|
|
1
|
-
import { i as StoreDriver } from "./driver-
|
|
2
|
-
import { c as ReplyTo, n as SignalOutcome, r as SignalSource, t as Signal } from "./signal-CHVEmzvI.mjs";
|
|
1
|
+
import { i as StoreDriver } from "./driver-BC0Mt5KG.mjs";
|
|
3
2
|
import { z } from "zod";
|
|
3
|
+
//#region src/schema/budget.d.ts
|
|
4
|
+
declare const budgetMonthSchema: z.ZodString;
|
|
5
|
+
declare const budgetLimitsSchema: z.ZodObject<{
|
|
6
|
+
totalUsd: z.ZodNumber;
|
|
7
|
+
investigationUsd: z.ZodNumber;
|
|
8
|
+
perTaskReservationUsd: z.ZodNumber;
|
|
9
|
+
warningPercent: z.ZodNumber;
|
|
10
|
+
perRepositoryUsd: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
11
|
+
}, z.core.$strict>;
|
|
12
|
+
declare const budgetSchema: z.ZodObject<{
|
|
13
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
14
|
+
factoryId: z.ZodString;
|
|
15
|
+
month: z.ZodString;
|
|
16
|
+
limits: z.ZodObject<{
|
|
17
|
+
totalUsd: z.ZodNumber;
|
|
18
|
+
investigationUsd: z.ZodNumber;
|
|
19
|
+
perTaskReservationUsd: z.ZodNumber;
|
|
20
|
+
warningPercent: z.ZodNumber;
|
|
21
|
+
perRepositoryUsd: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
22
|
+
}, z.core.$strict>;
|
|
23
|
+
notices: z.ZodObject<{
|
|
24
|
+
warningAt: z.ZodOptional<z.ZodISODateTime>;
|
|
25
|
+
exhaustedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
26
|
+
}, z.core.$strict>;
|
|
27
|
+
}, z.core.$strict>;
|
|
28
|
+
type BudgetLimits = z.infer<typeof budgetLimitsSchema>;
|
|
29
|
+
type Budget = z.infer<typeof budgetSchema>;
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region src/schema/id.d.ts
|
|
32
|
+
declare const factoryIdSchema: z.ZodString;
|
|
33
|
+
declare const repositoryIdSchema: z.ZodString;
|
|
34
|
+
declare const signalIdSchema: z.ZodString;
|
|
35
|
+
declare const taskIdSchema: z.ZodString;
|
|
36
|
+
declare const changeIdSchema: z.ZodString;
|
|
37
|
+
declare const receiptIdSchema: z.ZodString;
|
|
38
|
+
declare const outboxIdSchema: z.ZodString;
|
|
39
|
+
declare const answerIdSchema: z.ZodString;
|
|
40
|
+
declare const repositoryIdsSchema: z.ZodArray<z.ZodString>;
|
|
41
|
+
type FactoryId = z.infer<typeof factoryIdSchema>;
|
|
42
|
+
type RepositoryId = z.infer<typeof repositoryIdSchema>;
|
|
43
|
+
type SignalId = z.infer<typeof signalIdSchema>;
|
|
44
|
+
type TaskId = z.infer<typeof taskIdSchema>;
|
|
45
|
+
type ChangeId = z.infer<typeof changeIdSchema>;
|
|
46
|
+
type ReceiptId = z.infer<typeof receiptIdSchema>;
|
|
47
|
+
type OutboxId = z.infer<typeof outboxIdSchema>;
|
|
48
|
+
type AnswerId = z.infer<typeof answerIdSchema>;
|
|
49
|
+
//#endregion
|
|
4
50
|
//#region src/schema/task.d.ts
|
|
5
51
|
/**
|
|
6
52
|
* Kinds the standard loop understands. Any vocabulary value is valid; the
|
|
@@ -9,13 +55,13 @@ import { z } from "zod";
|
|
|
9
55
|
declare const standardTaskKinds: readonly ["coordination", "code_change", "verification", "investigation", "question"];
|
|
10
56
|
declare const taskKindSchema: z.ZodString;
|
|
11
57
|
declare const taskStateSchema: z.ZodEnum<{
|
|
58
|
+
succeeded: "succeeded";
|
|
59
|
+
failed: "failed";
|
|
60
|
+
needs_human: "needs_human";
|
|
12
61
|
queued: "queued";
|
|
13
62
|
running: "running";
|
|
14
63
|
stalled: "stalled";
|
|
15
64
|
verifying: "verifying";
|
|
16
|
-
succeeded: "succeeded";
|
|
17
|
-
failed: "failed";
|
|
18
|
-
needs_human: "needs_human";
|
|
19
65
|
cancelled: "cancelled";
|
|
20
66
|
}>;
|
|
21
67
|
declare const taskApprovalSchema: z.ZodEnum<{
|
|
@@ -64,13 +110,13 @@ declare const taskSchema: z.ZodObject<{
|
|
|
64
110
|
kind: z.ZodString;
|
|
65
111
|
area: z.ZodOptional<z.ZodString>;
|
|
66
112
|
state: z.ZodEnum<{
|
|
113
|
+
succeeded: "succeeded";
|
|
114
|
+
failed: "failed";
|
|
115
|
+
needs_human: "needs_human";
|
|
67
116
|
queued: "queued";
|
|
68
117
|
running: "running";
|
|
69
118
|
stalled: "stalled";
|
|
70
119
|
verifying: "verifying";
|
|
71
|
-
succeeded: "succeeded";
|
|
72
|
-
failed: "failed";
|
|
73
|
-
needs_human: "needs_human";
|
|
74
120
|
cancelled: "cancelled";
|
|
75
121
|
}>;
|
|
76
122
|
approval: z.ZodOptional<z.ZodEnum<{
|
|
@@ -116,6 +162,8 @@ declare const taskSchema: z.ZodObject<{
|
|
|
116
162
|
answer: z.ZodOptional<z.ZodString>;
|
|
117
163
|
answeredBy: z.ZodOptional<z.ZodString>;
|
|
118
164
|
}, z.core.$strict>>;
|
|
165
|
+
questionTaskId: z.ZodOptional<z.ZodString>;
|
|
166
|
+
answerEventIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
119
167
|
changeId: z.ZodOptional<z.ZodString>;
|
|
120
168
|
reportRef: z.ZodOptional<z.ZodString>;
|
|
121
169
|
createdAt: z.ZodISODateTime;
|
|
@@ -128,48 +176,128 @@ type TaskUsage = z.infer<typeof taskUsageSchema>;
|
|
|
128
176
|
type ExecutionReference = z.infer<typeof executionReferenceSchema>;
|
|
129
177
|
type Task = z.infer<typeof taskSchema>;
|
|
130
178
|
//#endregion
|
|
131
|
-
//#region src/schema/
|
|
132
|
-
declare const
|
|
133
|
-
declare const repositoryIdSchema: z.ZodString;
|
|
134
|
-
declare const signalIdSchema: z.ZodString;
|
|
135
|
-
declare const taskIdSchema: z.ZodString;
|
|
136
|
-
declare const changeIdSchema: z.ZodString;
|
|
137
|
-
declare const receiptIdSchema: z.ZodString;
|
|
138
|
-
declare const repositoryIdsSchema: z.ZodArray<z.ZodString>;
|
|
139
|
-
type FactoryId = z.infer<typeof factoryIdSchema>;
|
|
140
|
-
type RepositoryId = z.infer<typeof repositoryIdSchema>;
|
|
141
|
-
type SignalId = z.infer<typeof signalIdSchema>;
|
|
142
|
-
type TaskId = z.infer<typeof taskIdSchema>;
|
|
143
|
-
type ChangeId = z.infer<typeof changeIdSchema>;
|
|
144
|
-
type ReceiptId = z.infer<typeof receiptIdSchema>;
|
|
145
|
-
//#endregion
|
|
146
|
-
//#region src/schema/budget.d.ts
|
|
147
|
-
declare const budgetMonthSchema: z.ZodString;
|
|
148
|
-
declare const budgetLimitsSchema: z.ZodObject<{
|
|
149
|
-
totalUsd: z.ZodNumber;
|
|
150
|
-
investigationUsd: z.ZodNumber;
|
|
151
|
-
perTaskReservationUsd: z.ZodNumber;
|
|
152
|
-
warningPercent: z.ZodNumber;
|
|
153
|
-
perRepositoryUsd: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
154
|
-
}, z.core.$strict>;
|
|
155
|
-
declare const budgetSchema: z.ZodObject<{
|
|
179
|
+
//#region src/schema/answer.d.ts
|
|
180
|
+
declare const answerEventSchema: z.ZodObject<{
|
|
156
181
|
schemaVersion: z.ZodLiteral<1>;
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
perRepositoryUsd: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
182
|
+
id: z.ZodString;
|
|
183
|
+
questionTaskId: z.ZodString;
|
|
184
|
+
parentTaskId: z.ZodOptional<z.ZodString>;
|
|
185
|
+
repositoryIds: z.ZodArray<z.ZodString>;
|
|
186
|
+
replyTo: z.ZodObject<{
|
|
187
|
+
channel: z.ZodString;
|
|
188
|
+
address: z.ZodString;
|
|
165
189
|
}, z.core.$strict>;
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
190
|
+
question: z.ZodString;
|
|
191
|
+
answer: z.ZodString;
|
|
192
|
+
answeredBy: z.ZodString;
|
|
193
|
+
recordedAt: z.ZodISODateTime;
|
|
194
|
+
}, z.core.$strict>;
|
|
195
|
+
type AnswerEvent = z.infer<typeof answerEventSchema>;
|
|
196
|
+
//#endregion
|
|
197
|
+
//#region src/schema/session.d.ts
|
|
198
|
+
declare const agentSessionIdSchema: z.ZodString;
|
|
199
|
+
declare const agentSessionSchema: z.ZodObject<{
|
|
200
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
201
|
+
id: z.ZodString;
|
|
202
|
+
owner: z.ZodString;
|
|
203
|
+
agent: z.ZodString;
|
|
204
|
+
repositoryId: z.ZodOptional<z.ZodString>;
|
|
205
|
+
routeId: z.ZodOptional<z.ZodString>;
|
|
206
|
+
message: z.ZodString;
|
|
207
|
+
changeId: z.ZodOptional<z.ZodString>;
|
|
208
|
+
taskId: z.ZodOptional<z.ZodString>;
|
|
209
|
+
execution: z.ZodOptional<z.ZodObject<{
|
|
210
|
+
provider: z.ZodString;
|
|
211
|
+
sessionId: z.ZodString;
|
|
212
|
+
environmentId: z.ZodOptional<z.ZodString>;
|
|
213
|
+
harness: z.ZodOptional<z.ZodString>;
|
|
214
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
215
|
+
}, z.core.$strict>>;
|
|
216
|
+
notifications: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
217
|
+
eventId: z.ZodString;
|
|
218
|
+
repositoryIds: z.ZodArray<z.ZodString>;
|
|
219
|
+
taskId: z.ZodOptional<z.ZodString>;
|
|
220
|
+
changeId: z.ZodOptional<z.ZodString>;
|
|
221
|
+
replyTo: z.ZodObject<{
|
|
222
|
+
channel: z.ZodString;
|
|
223
|
+
address: z.ZodString;
|
|
224
|
+
}, z.core.$strict>;
|
|
225
|
+
outcome: z.ZodEnum<{
|
|
226
|
+
message: "message";
|
|
227
|
+
accepted: "accepted";
|
|
228
|
+
started: "started";
|
|
229
|
+
succeeded: "succeeded";
|
|
230
|
+
failed: "failed";
|
|
231
|
+
needs_human: "needs_human";
|
|
232
|
+
question: "question";
|
|
233
|
+
digest: "digest";
|
|
234
|
+
rolled_back: "rolled_back";
|
|
235
|
+
budget_warning: "budget_warning";
|
|
236
|
+
budget_exhausted: "budget_exhausted";
|
|
237
|
+
}>;
|
|
238
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
239
|
+
}, z.core.$strict>>>;
|
|
240
|
+
createdAt: z.ZodISODateTime;
|
|
241
|
+
}, z.core.$strict>;
|
|
242
|
+
type AgentSession = z.infer<typeof agentSessionSchema>;
|
|
243
|
+
//#endregion
|
|
244
|
+
//#region src/schema/common.d.ts
|
|
245
|
+
declare const SCHEMA_VERSION = 1;
|
|
246
|
+
declare const schemaVersionSchema: z.ZodLiteral<1>;
|
|
247
|
+
declare const isoDateTimeSchema: z.ZodISODateTime;
|
|
248
|
+
declare const usdSchema: z.ZodNumber;
|
|
249
|
+
/**
|
|
250
|
+
* Open vocabulary value. Standard values ship as exported constants; custom
|
|
251
|
+
* values matching the pattern are equally valid.
|
|
252
|
+
*/
|
|
253
|
+
declare const vocabularySchema: z.ZodString;
|
|
254
|
+
declare const replyToSchema: z.ZodObject<{
|
|
255
|
+
channel: z.ZodString;
|
|
256
|
+
address: z.ZodString;
|
|
257
|
+
}, z.core.$strict>;
|
|
258
|
+
type ReplyTo = z.infer<typeof replyToSchema>;
|
|
259
|
+
//#endregion
|
|
260
|
+
//#region src/schema/communication.d.ts
|
|
261
|
+
declare const communicationOutcomes: readonly ["accepted", "started", "succeeded", "failed", "needs_human", "question", "digest", "rolled_back", "budget_warning", "budget_exhausted", "message"];
|
|
262
|
+
declare const communicationOutcomeSchema: z.ZodEnum<{
|
|
263
|
+
message: "message";
|
|
264
|
+
accepted: "accepted";
|
|
265
|
+
started: "started";
|
|
266
|
+
succeeded: "succeeded";
|
|
267
|
+
failed: "failed";
|
|
268
|
+
needs_human: "needs_human";
|
|
269
|
+
question: "question";
|
|
270
|
+
digest: "digest";
|
|
271
|
+
rolled_back: "rolled_back";
|
|
272
|
+
budget_warning: "budget_warning";
|
|
273
|
+
budget_exhausted: "budget_exhausted";
|
|
274
|
+
}>;
|
|
275
|
+
declare const communicationEventSchema: z.ZodObject<{
|
|
276
|
+
eventId: z.ZodString;
|
|
277
|
+
repositoryIds: z.ZodArray<z.ZodString>;
|
|
278
|
+
taskId: z.ZodOptional<z.ZodString>;
|
|
279
|
+
changeId: z.ZodOptional<z.ZodString>;
|
|
280
|
+
replyTo: z.ZodObject<{
|
|
281
|
+
channel: z.ZodString;
|
|
282
|
+
address: z.ZodString;
|
|
169
283
|
}, z.core.$strict>;
|
|
284
|
+
outcome: z.ZodEnum<{
|
|
285
|
+
message: "message";
|
|
286
|
+
accepted: "accepted";
|
|
287
|
+
started: "started";
|
|
288
|
+
succeeded: "succeeded";
|
|
289
|
+
failed: "failed";
|
|
290
|
+
needs_human: "needs_human";
|
|
291
|
+
question: "question";
|
|
292
|
+
digest: "digest";
|
|
293
|
+
rolled_back: "rolled_back";
|
|
294
|
+
budget_warning: "budget_warning";
|
|
295
|
+
budget_exhausted: "budget_exhausted";
|
|
296
|
+
}>;
|
|
297
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
170
298
|
}, z.core.$strict>;
|
|
171
|
-
type
|
|
172
|
-
type
|
|
299
|
+
type CommunicationOutcome = z.infer<typeof communicationOutcomeSchema>;
|
|
300
|
+
type CommunicationEvent = z.infer<typeof communicationEventSchema>;
|
|
173
301
|
//#endregion
|
|
174
302
|
//#region src/schema/change.d.ts
|
|
175
303
|
declare const levelSchema: z.ZodEnum<{
|
|
@@ -178,12 +306,12 @@ declare const levelSchema: z.ZodEnum<{
|
|
|
178
306
|
high: "high";
|
|
179
307
|
}>;
|
|
180
308
|
declare const changeStateSchema: z.ZodEnum<{
|
|
309
|
+
rolled_back: "rolled_back";
|
|
181
310
|
verifying: "verifying";
|
|
182
311
|
ready: "ready";
|
|
183
312
|
merged: "merged";
|
|
184
313
|
deployed: "deployed";
|
|
185
314
|
rolled_out: "rolled_out";
|
|
186
|
-
rolled_back: "rolled_back";
|
|
187
315
|
closed: "closed";
|
|
188
316
|
}>;
|
|
189
317
|
declare const changeEvidenceSchema: z.ZodObject<{
|
|
@@ -222,12 +350,12 @@ declare const changeSchema: z.ZodObject<{
|
|
|
222
350
|
previewUrl: z.ZodOptional<z.ZodURL>;
|
|
223
351
|
}, z.core.$strict>;
|
|
224
352
|
state: z.ZodEnum<{
|
|
353
|
+
rolled_back: "rolled_back";
|
|
225
354
|
verifying: "verifying";
|
|
226
355
|
ready: "ready";
|
|
227
356
|
merged: "merged";
|
|
228
357
|
deployed: "deployed";
|
|
229
358
|
rolled_out: "rolled_out";
|
|
230
|
-
rolled_back: "rolled_back";
|
|
231
359
|
closed: "closed";
|
|
232
360
|
}>;
|
|
233
361
|
mergeSha: z.ZodOptional<z.ZodString>;
|
|
@@ -240,9 +368,103 @@ type ChangeState = z.infer<typeof changeStateSchema>;
|
|
|
240
368
|
type ChangeEvidence = z.infer<typeof changeEvidenceSchema>;
|
|
241
369
|
type Change = z.infer<typeof changeSchema>;
|
|
242
370
|
//#endregion
|
|
371
|
+
//#region src/schema/outbox.d.ts
|
|
372
|
+
declare const outboxStateSchema: z.ZodEnum<{
|
|
373
|
+
pending: "pending";
|
|
374
|
+
delivering: "delivering";
|
|
375
|
+
delivered: "delivered";
|
|
376
|
+
}>;
|
|
377
|
+
declare const outboxMessageSchema: z.ZodObject<{
|
|
378
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
379
|
+
id: z.ZodString;
|
|
380
|
+
event: z.ZodObject<{
|
|
381
|
+
eventId: z.ZodString;
|
|
382
|
+
repositoryIds: z.ZodArray<z.ZodString>;
|
|
383
|
+
taskId: z.ZodOptional<z.ZodString>;
|
|
384
|
+
changeId: z.ZodOptional<z.ZodString>;
|
|
385
|
+
replyTo: z.ZodObject<{
|
|
386
|
+
channel: z.ZodString;
|
|
387
|
+
address: z.ZodString;
|
|
388
|
+
}, z.core.$strict>;
|
|
389
|
+
outcome: z.ZodEnum<{
|
|
390
|
+
message: "message";
|
|
391
|
+
accepted: "accepted";
|
|
392
|
+
started: "started";
|
|
393
|
+
succeeded: "succeeded";
|
|
394
|
+
failed: "failed";
|
|
395
|
+
needs_human: "needs_human";
|
|
396
|
+
question: "question";
|
|
397
|
+
digest: "digest";
|
|
398
|
+
rolled_back: "rolled_back";
|
|
399
|
+
budget_warning: "budget_warning";
|
|
400
|
+
budget_exhausted: "budget_exhausted";
|
|
401
|
+
}>;
|
|
402
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
403
|
+
}, z.core.$strict>;
|
|
404
|
+
state: z.ZodEnum<{
|
|
405
|
+
pending: "pending";
|
|
406
|
+
delivering: "delivering";
|
|
407
|
+
delivered: "delivered";
|
|
408
|
+
}>;
|
|
409
|
+
attempt: z.ZodNumber;
|
|
410
|
+
availableAt: z.ZodISODateTime;
|
|
411
|
+
leaseUntil: z.ZodOptional<z.ZodISODateTime>;
|
|
412
|
+
deliveredAt: z.ZodOptional<z.ZodISODateTime>;
|
|
413
|
+
lastError: z.ZodOptional<z.ZodString>;
|
|
414
|
+
createdAt: z.ZodISODateTime;
|
|
415
|
+
updatedAt: z.ZodISODateTime;
|
|
416
|
+
}, z.core.$strict>;
|
|
417
|
+
type OutboxMessage = z.infer<typeof outboxMessageSchema>;
|
|
418
|
+
declare const outboxQueueSchema: z.ZodObject<{
|
|
419
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
420
|
+
id: z.ZodString;
|
|
421
|
+
messages: z.ZodArray<z.ZodObject<{
|
|
422
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
423
|
+
id: z.ZodString;
|
|
424
|
+
event: z.ZodObject<{
|
|
425
|
+
eventId: z.ZodString;
|
|
426
|
+
repositoryIds: z.ZodArray<z.ZodString>;
|
|
427
|
+
taskId: z.ZodOptional<z.ZodString>;
|
|
428
|
+
changeId: z.ZodOptional<z.ZodString>;
|
|
429
|
+
replyTo: z.ZodObject<{
|
|
430
|
+
channel: z.ZodString;
|
|
431
|
+
address: z.ZodString;
|
|
432
|
+
}, z.core.$strict>;
|
|
433
|
+
outcome: z.ZodEnum<{
|
|
434
|
+
message: "message";
|
|
435
|
+
accepted: "accepted";
|
|
436
|
+
started: "started";
|
|
437
|
+
succeeded: "succeeded";
|
|
438
|
+
failed: "failed";
|
|
439
|
+
needs_human: "needs_human";
|
|
440
|
+
question: "question";
|
|
441
|
+
digest: "digest";
|
|
442
|
+
rolled_back: "rolled_back";
|
|
443
|
+
budget_warning: "budget_warning";
|
|
444
|
+
budget_exhausted: "budget_exhausted";
|
|
445
|
+
}>;
|
|
446
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
447
|
+
}, z.core.$strict>;
|
|
448
|
+
state: z.ZodEnum<{
|
|
449
|
+
pending: "pending";
|
|
450
|
+
delivering: "delivering";
|
|
451
|
+
delivered: "delivered";
|
|
452
|
+
}>;
|
|
453
|
+
attempt: z.ZodNumber;
|
|
454
|
+
availableAt: z.ZodISODateTime;
|
|
455
|
+
leaseUntil: z.ZodOptional<z.ZodISODateTime>;
|
|
456
|
+
deliveredAt: z.ZodOptional<z.ZodISODateTime>;
|
|
457
|
+
lastError: z.ZodOptional<z.ZodString>;
|
|
458
|
+
createdAt: z.ZodISODateTime;
|
|
459
|
+
updatedAt: z.ZodISODateTime;
|
|
460
|
+
}, z.core.$strict>>;
|
|
461
|
+
updatedAt: z.ZodISODateTime;
|
|
462
|
+
}, z.core.$strict>;
|
|
463
|
+
type OutboxQueue = z.infer<typeof outboxQueueSchema>;
|
|
464
|
+
//#endregion
|
|
243
465
|
//#region src/schema/receipt.d.ts
|
|
244
466
|
/** States the engine writes on transitions. Any vocabulary value is valid. */
|
|
245
|
-
declare const standardReceiptStates: readonly ["approved", "rejected", "dispatched", "stalled", "succeeded", "failed", "needs_human", "cancelled", "settled", "ready", "merged", "deployed", "rolled_out", "rolled_back"];
|
|
467
|
+
declare const standardReceiptStates: readonly ["approved", "rejected", "queued", "dispatched", "stalled", "succeeded", "failed", "needs_human", "cancelled", "settled", "verifying", "ready", "merged", "deployed", "rolled_out", "rolled_back"];
|
|
246
468
|
/** Phases the standard loop uses. Any vocabulary value is valid. */
|
|
247
469
|
declare const standardReceiptPhases: readonly ["approval", "budget", "dispatch", "implementation", "verification", "pull_request", "cleanup"];
|
|
248
470
|
/** Kinds the standard loop writes: the standard task kinds plus "change". */
|
|
@@ -295,6 +517,46 @@ declare const repositorySchema: z.ZodObject<{
|
|
|
295
517
|
type RepositorySlug = z.infer<typeof repositorySlugSchema>;
|
|
296
518
|
type Repository = z.infer<typeof repositorySchema>;
|
|
297
519
|
//#endregion
|
|
520
|
+
//#region src/schema/signal.d.ts
|
|
521
|
+
/** Sources used by the standard connectors. Any vocabulary value is valid. */
|
|
522
|
+
declare const standardSignalSources: readonly ["github_issue", "github_pr", "github_pr_comment", "slack", "human", "github_ci_failure", "vercel_deploy_failure", "security_scan", "investigation", "api"];
|
|
523
|
+
declare const signalSourceSchema: z.ZodString;
|
|
524
|
+
declare const signalOutcomeSchema: z.ZodEnum<{
|
|
525
|
+
accepted: "accepted";
|
|
526
|
+
duplicate: "duplicate";
|
|
527
|
+
unactionable: "unactionable";
|
|
528
|
+
low_confidence: "low_confidence";
|
|
529
|
+
ignored: "ignored";
|
|
530
|
+
pending: "pending";
|
|
531
|
+
}>;
|
|
532
|
+
declare const signalSchema: z.ZodObject<{
|
|
533
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
534
|
+
id: z.ZodString;
|
|
535
|
+
repositoryId: z.ZodString;
|
|
536
|
+
source: z.ZodString;
|
|
537
|
+
deliveryId: z.ZodString;
|
|
538
|
+
replyTo: z.ZodObject<{
|
|
539
|
+
channel: z.ZodString;
|
|
540
|
+
address: z.ZodString;
|
|
541
|
+
}, z.core.$strict>;
|
|
542
|
+
payload: z.ZodUnknown;
|
|
543
|
+
receivedAt: z.ZodISODateTime;
|
|
544
|
+
outcome: z.ZodEnum<{
|
|
545
|
+
accepted: "accepted";
|
|
546
|
+
duplicate: "duplicate";
|
|
547
|
+
unactionable: "unactionable";
|
|
548
|
+
low_confidence: "low_confidence";
|
|
549
|
+
ignored: "ignored";
|
|
550
|
+
pending: "pending";
|
|
551
|
+
}>;
|
|
552
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
553
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
554
|
+
decidedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
555
|
+
}, z.core.$strict>;
|
|
556
|
+
type SignalSource = z.infer<typeof signalSourceSchema>;
|
|
557
|
+
type SignalOutcome = z.infer<typeof signalOutcomeSchema>;
|
|
558
|
+
type Signal = z.infer<typeof signalSchema>;
|
|
559
|
+
//#endregion
|
|
298
560
|
//#region src/store/engine.d.ts
|
|
299
561
|
/** An approval decision that does not apply to the task's current approval or state. */
|
|
300
562
|
declare class ApprovalError extends Error {
|
|
@@ -314,6 +576,12 @@ declare class ChangeAssociationError extends Error {
|
|
|
314
576
|
readonly reason: string;
|
|
315
577
|
constructor(taskId: TaskId, repositoryId: RepositoryId, reason: string);
|
|
316
578
|
}
|
|
579
|
+
declare class OutboxEventConflictError extends Error {
|
|
580
|
+
constructor(eventId: string);
|
|
581
|
+
}
|
|
582
|
+
declare class AnswerEventConflictError extends Error {
|
|
583
|
+
constructor(questionTaskId: TaskId);
|
|
584
|
+
}
|
|
317
585
|
interface CreateSignalInput {
|
|
318
586
|
repositoryId: RepositoryId;
|
|
319
587
|
source: SignalSource;
|
|
@@ -344,6 +612,11 @@ interface ApprovalDecision {
|
|
|
344
612
|
by: string;
|
|
345
613
|
reason?: string;
|
|
346
614
|
}
|
|
615
|
+
interface AnswerQuestionInput {
|
|
616
|
+
questionTaskId: TaskId;
|
|
617
|
+
answer: string;
|
|
618
|
+
answeredBy: string;
|
|
619
|
+
}
|
|
347
620
|
type TaskPatch = Partial<Pick<Task, "changeId" | "reportRef" | "reservedUsd" | "reservedAt" | "question">>;
|
|
348
621
|
/** One completed model step's usage, as eve's step.completed event carries it. */
|
|
349
622
|
interface StepUsage {
|
|
@@ -358,6 +631,8 @@ interface StepUsage {
|
|
|
358
631
|
interface TaskTransitionOptions {
|
|
359
632
|
patch?: TaskPatch;
|
|
360
633
|
reason?: string;
|
|
634
|
+
/** Required when a non-question task waits, so validation is a direct read. */
|
|
635
|
+
questionTaskId?: TaskId;
|
|
361
636
|
/**
|
|
362
637
|
* Refuse unless the task is in this state at write time. Closes
|
|
363
638
|
* check-then-act races where the transition would also be legal from the
|
|
@@ -403,8 +678,22 @@ interface AppendReceiptInput {
|
|
|
403
678
|
/** Same key twice appends one receipt and returns the existing one. */
|
|
404
679
|
dedupeKey?: string;
|
|
405
680
|
}
|
|
681
|
+
declare class SessionConflictError extends Error {}
|
|
406
682
|
interface FactoryStores {
|
|
407
683
|
driverName: string;
|
|
684
|
+
sessions: {
|
|
685
|
+
create(input: Omit<AgentSession, "schemaVersion" | "id" | "createdAt" | "execution" | "taskId" | "notifications"> & {
|
|
686
|
+
operationId: string;
|
|
687
|
+
}): Promise<AgentSession>;
|
|
688
|
+
get(id: string): Promise<AgentSession | null>;
|
|
689
|
+
list(): Promise<AgentSession[]>;
|
|
690
|
+
bind(id: string, reference: {
|
|
691
|
+
taskId: TaskId;
|
|
692
|
+
} | {
|
|
693
|
+
execution: ExecutionReference;
|
|
694
|
+
}): Promise<AgentSession>;
|
|
695
|
+
notify(event: CommunicationEvent): Promise<void>;
|
|
696
|
+
};
|
|
408
697
|
repositories: {
|
|
409
698
|
put(repository: Repository): Promise<Repository>;
|
|
410
699
|
get(id: RepositoryId): Promise<Repository | null>;
|
|
@@ -420,6 +709,11 @@ interface FactoryStores {
|
|
|
420
709
|
create(input: CreateTaskInput): Promise<Task>;
|
|
421
710
|
get(id: TaskId): Promise<Task | null>;
|
|
422
711
|
transition(id: TaskId, to: TaskState, options?: TaskTransitionOptions): Promise<Task>;
|
|
712
|
+
answerQuestion(input: AnswerQuestionInput): Promise<{
|
|
713
|
+
answerEvent: AnswerEvent;
|
|
714
|
+
questionTask: Task;
|
|
715
|
+
parentTask: Task | null;
|
|
716
|
+
}>;
|
|
423
717
|
/** Grant a required approval. The task stays queued; dispatch may now take it. */
|
|
424
718
|
approve(id: TaskId, decision: ApprovalDecision): Promise<Task>;
|
|
425
719
|
/** Deny a required approval. The task is cancelled with the reason. */
|
|
@@ -465,6 +759,17 @@ interface FactoryStores {
|
|
|
465
759
|
stamped: boolean;
|
|
466
760
|
}>;
|
|
467
761
|
};
|
|
762
|
+
answers: {
|
|
763
|
+
get(id: AnswerId): Promise<AnswerEvent | null>;
|
|
764
|
+
};
|
|
765
|
+
outbox: {
|
|
766
|
+
enqueue(event: CommunicationEvent): Promise<OutboxMessage>;
|
|
767
|
+
get(id: OutboxId): Promise<OutboxMessage | null>;
|
|
768
|
+
claim(id: OutboxId, leaseMs?: number): Promise<OutboxMessage | null>;
|
|
769
|
+
retry(id: OutboxId, attempt: number, reason: string, delayMs: number): Promise<OutboxMessage | null>;
|
|
770
|
+
complete(id: OutboxId, attempt: number): Promise<OutboxMessage | null>;
|
|
771
|
+
pending(limit?: number): Promise<OutboxMessage[]>;
|
|
772
|
+
};
|
|
468
773
|
}
|
|
469
774
|
interface CreateStoresOptions {
|
|
470
775
|
driver: StoreDriver;
|
|
@@ -472,242 +777,5 @@ interface CreateStoresOptions {
|
|
|
472
777
|
}
|
|
473
778
|
declare function createStores(options: CreateStoresOptions): FactoryStores;
|
|
474
779
|
//#endregion
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
P0: "P0";
|
|
478
|
-
P1: "P1";
|
|
479
|
-
P2: "P2";
|
|
480
|
-
P3: "P3";
|
|
481
|
-
}>;
|
|
482
|
-
declare const findingCategorySchema: z.ZodEnum<{
|
|
483
|
-
security: "security";
|
|
484
|
-
correctness: "correctness";
|
|
485
|
-
reliability: "reliability";
|
|
486
|
-
performance: "performance";
|
|
487
|
-
compatibility: "compatibility";
|
|
488
|
-
accessibility: "accessibility";
|
|
489
|
-
documentation: "documentation";
|
|
490
|
-
maintainability: "maintainability";
|
|
491
|
-
testing: "testing";
|
|
492
|
-
usability: "usability";
|
|
493
|
-
}>;
|
|
494
|
-
declare const findingVerificationLevelSchema: z.ZodEnum<{
|
|
495
|
-
unverified: "unverified";
|
|
496
|
-
supported: "supported";
|
|
497
|
-
confirmed: "confirmed";
|
|
498
|
-
}>;
|
|
499
|
-
declare const findingVerificationMethodSchema: z.ZodEnum<{
|
|
500
|
-
documentation: "documentation";
|
|
501
|
-
code_inspection: "code_inspection";
|
|
502
|
-
static_analysis: "static_analysis";
|
|
503
|
-
manual_reproduction: "manual_reproduction";
|
|
504
|
-
unit_test: "unit_test";
|
|
505
|
-
integration_test: "integration_test";
|
|
506
|
-
e2e_test: "e2e_test";
|
|
507
|
-
runtime_observation: "runtime_observation";
|
|
508
|
-
}>;
|
|
509
|
-
/**
|
|
510
|
-
* What was done to check the finding. Forces a reporter to distinguish "I
|
|
511
|
-
* think this is a problem" from "I demonstrated it", which is the axis a human
|
|
512
|
-
* approving fixes cares about most.
|
|
513
|
-
*/
|
|
514
|
-
declare const findingVerificationSchema: z.ZodObject<{
|
|
515
|
-
level: z.ZodEnum<{
|
|
516
|
-
unverified: "unverified";
|
|
517
|
-
supported: "supported";
|
|
518
|
-
confirmed: "confirmed";
|
|
519
|
-
}>;
|
|
520
|
-
method: z.ZodEnum<{
|
|
521
|
-
documentation: "documentation";
|
|
522
|
-
code_inspection: "code_inspection";
|
|
523
|
-
static_analysis: "static_analysis";
|
|
524
|
-
manual_reproduction: "manual_reproduction";
|
|
525
|
-
unit_test: "unit_test";
|
|
526
|
-
integration_test: "integration_test";
|
|
527
|
-
e2e_test: "e2e_test";
|
|
528
|
-
runtime_observation: "runtime_observation";
|
|
529
|
-
}>;
|
|
530
|
-
summary: z.ZodString;
|
|
531
|
-
limitations: z.ZodOptional<z.ZodString>;
|
|
532
|
-
}, z.core.$strict>;
|
|
533
|
-
/** A single problem found in a repository, as a scanner or agent reports it. */
|
|
534
|
-
declare const findingSchema: z.ZodObject<{
|
|
535
|
-
title: z.ZodString;
|
|
536
|
-
body: z.ZodString;
|
|
537
|
-
path: z.ZodOptional<z.ZodString>;
|
|
538
|
-
line: z.ZodOptional<z.ZodNumber>;
|
|
539
|
-
endLine: z.ZodOptional<z.ZodNumber>;
|
|
540
|
-
priority: z.ZodEnum<{
|
|
541
|
-
P0: "P0";
|
|
542
|
-
P1: "P1";
|
|
543
|
-
P2: "P2";
|
|
544
|
-
P3: "P3";
|
|
545
|
-
}>;
|
|
546
|
-
category: z.ZodEnum<{
|
|
547
|
-
security: "security";
|
|
548
|
-
correctness: "correctness";
|
|
549
|
-
reliability: "reliability";
|
|
550
|
-
performance: "performance";
|
|
551
|
-
compatibility: "compatibility";
|
|
552
|
-
accessibility: "accessibility";
|
|
553
|
-
documentation: "documentation";
|
|
554
|
-
maintainability: "maintainability";
|
|
555
|
-
testing: "testing";
|
|
556
|
-
usability: "usability";
|
|
557
|
-
}>;
|
|
558
|
-
verification: z.ZodObject<{
|
|
559
|
-
level: z.ZodEnum<{
|
|
560
|
-
unverified: "unverified";
|
|
561
|
-
supported: "supported";
|
|
562
|
-
confirmed: "confirmed";
|
|
563
|
-
}>;
|
|
564
|
-
method: z.ZodEnum<{
|
|
565
|
-
documentation: "documentation";
|
|
566
|
-
code_inspection: "code_inspection";
|
|
567
|
-
static_analysis: "static_analysis";
|
|
568
|
-
manual_reproduction: "manual_reproduction";
|
|
569
|
-
unit_test: "unit_test";
|
|
570
|
-
integration_test: "integration_test";
|
|
571
|
-
e2e_test: "e2e_test";
|
|
572
|
-
runtime_observation: "runtime_observation";
|
|
573
|
-
}>;
|
|
574
|
-
summary: z.ZodString;
|
|
575
|
-
limitations: z.ZodOptional<z.ZodString>;
|
|
576
|
-
}, z.core.$strict>;
|
|
577
|
-
tool: z.ZodOptional<z.ZodString>;
|
|
578
|
-
ruleId: z.ZodOptional<z.ZodString>;
|
|
579
|
-
}, z.core.$strict>;
|
|
580
|
-
type FindingPriority = z.infer<typeof findingPrioritySchema>;
|
|
581
|
-
type FindingCategory = z.infer<typeof findingCategorySchema>;
|
|
582
|
-
type FindingVerification = z.infer<typeof findingVerificationSchema>;
|
|
583
|
-
type Finding = z.infer<typeof findingSchema>;
|
|
584
|
-
/**
|
|
585
|
-
* Stable identity of a finding across scans, used as the signal's delivery id
|
|
586
|
-
* so re-reporting is a no-op instead of a second task. A scanner finding is
|
|
587
|
-
* the same problem when the same tool reports the same rule on the same file;
|
|
588
|
-
* its title is model-written prose and changes between runs, so it is left
|
|
589
|
-
* out. Without a rule id the title is all there is, normalised.
|
|
590
|
-
*/
|
|
591
|
-
declare function findingFingerprint(repositoryId: string, finding: Finding): string;
|
|
592
|
-
//#endregion
|
|
593
|
-
//#region src/approval.d.ts
|
|
594
|
-
/**
|
|
595
|
-
* One approval rule. Every listed field must match for the rule to apply;
|
|
596
|
-
* absent fields match anything. Rules are evaluated first-match.
|
|
597
|
-
*/
|
|
598
|
-
declare const approvalRuleSchema: z.ZodObject<{
|
|
599
|
-
source: z.ZodOptional<z.ZodString>;
|
|
600
|
-
kind: z.ZodOptional<z.ZodString>;
|
|
601
|
-
priority: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
602
|
-
P0: "P0";
|
|
603
|
-
P1: "P1";
|
|
604
|
-
P2: "P2";
|
|
605
|
-
P3: "P3";
|
|
606
|
-
}>>>;
|
|
607
|
-
require: z.ZodBoolean;
|
|
608
|
-
}, z.core.$strict>;
|
|
609
|
-
declare const approvalPolicySchema: z.ZodArray<z.ZodObject<{
|
|
610
|
-
source: z.ZodOptional<z.ZodString>;
|
|
611
|
-
kind: z.ZodOptional<z.ZodString>;
|
|
612
|
-
priority: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
613
|
-
P0: "P0";
|
|
614
|
-
P1: "P1";
|
|
615
|
-
P2: "P2";
|
|
616
|
-
P3: "P3";
|
|
617
|
-
}>>>;
|
|
618
|
-
require: z.ZodBoolean;
|
|
619
|
-
}, z.core.$strict>>;
|
|
620
|
-
type ApprovalRule = z.infer<typeof approvalRuleSchema>;
|
|
621
|
-
type ApprovalPolicy = z.infer<typeof approvalPolicySchema>;
|
|
622
|
-
/**
|
|
623
|
-
* The default: fixes for security findings wait for a human; everything else
|
|
624
|
-
* runs as it always has. Handoffs between agents (verification) never wait,
|
|
625
|
-
* because a human already approved the work they continue.
|
|
626
|
-
*/
|
|
627
|
-
declare const defaultApprovalPolicy: ApprovalPolicy;
|
|
628
|
-
interface ApprovalSubject {
|
|
629
|
-
source?: string;
|
|
630
|
-
kind: string;
|
|
631
|
-
priority?: FindingPriority;
|
|
632
|
-
}
|
|
633
|
-
/**
|
|
634
|
-
* Decide at task-creation time whether a task needs approval. Pure: the answer
|
|
635
|
-
* is stamped on the task and never re-evaluated, so a later policy change
|
|
636
|
-
* cannot silently release work a human was expecting to see.
|
|
637
|
-
*/
|
|
638
|
-
declare function requiresApproval(policy: ApprovalPolicy, subject: ApprovalSubject): boolean;
|
|
639
|
-
//#endregion
|
|
640
|
-
//#region src/agent-routes.d.ts
|
|
641
|
-
declare const agentRouteSchema: z.ZodObject<{
|
|
642
|
-
id: z.ZodString;
|
|
643
|
-
agent: z.ZodString;
|
|
644
|
-
taskKind: z.ZodString;
|
|
645
|
-
description: z.ZodString;
|
|
646
|
-
permissions: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
647
|
-
}, z.core.$strict>;
|
|
648
|
-
type AgentRoute = z.infer<typeof agentRouteSchema>;
|
|
649
|
-
type AgentRouteInput = z.input<typeof agentRouteSchema>;
|
|
650
|
-
interface AgentRouteRegistry {
|
|
651
|
-
readonly routes: readonly AgentRoute[];
|
|
652
|
-
get(id: string): AgentRoute | undefined;
|
|
653
|
-
forTaskKind(kind: string): AgentRoute | undefined;
|
|
654
|
-
}
|
|
655
|
-
/**
|
|
656
|
-
* Define the application-owned routes an agent or workflow may select. Route
|
|
657
|
-
* descriptions inform judgment; this validated registry remains the authority.
|
|
658
|
-
*/
|
|
659
|
-
declare function defineAgentRoutes(inputs: readonly AgentRouteInput[]): AgentRouteRegistry;
|
|
660
|
-
//#endregion
|
|
661
|
-
//#region src/dispatch.d.ts
|
|
662
|
-
declare class DispatchRefusedError extends Error {
|
|
663
|
-
readonly taskId: TaskId;
|
|
664
|
-
readonly reason: string;
|
|
665
|
-
constructor(taskId: TaskId, reason: string);
|
|
666
|
-
}
|
|
667
|
-
/**
|
|
668
|
-
* An exhausted budget is definitive, not a retryable refusal: the task has
|
|
669
|
-
* already been failed and receipted when this throws, so it never re-enters
|
|
670
|
-
* the sweep. Operator retry recovers it once budget frees up.
|
|
671
|
-
*/
|
|
672
|
-
declare class BudgetExhaustedError extends Error {
|
|
673
|
-
readonly taskId: TaskId;
|
|
674
|
-
readonly month: string;
|
|
675
|
-
readonly spendUsd: number;
|
|
676
|
-
constructor(taskId: TaskId, month: string, spendUsd: number);
|
|
677
|
-
}
|
|
678
|
-
interface DispatchBudget {
|
|
679
|
-
limits: Pick<BudgetLimits, "totalUsd" | "perTaskReservationUsd">;
|
|
680
|
-
/** Defaults to the current UTC month. */
|
|
681
|
-
month?: string;
|
|
682
|
-
now?: () => Date;
|
|
683
|
-
}
|
|
684
|
-
interface DispatchOptions {
|
|
685
|
-
/**
|
|
686
|
-
* Starts the durable execution for the task (an Eve agent run). Runs after
|
|
687
|
-
* the task has won the queued -> running transition. Returning the
|
|
688
|
-
* provider's execution reference records it on the task so the reconciler
|
|
689
|
-
* can find the run; returning nothing leaves the task reachable only by the
|
|
690
|
-
* stall window.
|
|
691
|
-
*/
|
|
692
|
-
launch: (task: Task) => Promise<ExecutionReference | void>;
|
|
693
|
-
/** How many launches to try before the task fails for good; a failure re-queues for the next sweep. */
|
|
694
|
-
maxLaunchAttempts?: number;
|
|
695
|
-
/**
|
|
696
|
-
* Reserve-before-execution. When set, dispatch refuses definitively once
|
|
697
|
-
* the month's derived spend cannot fit another reservation, and otherwise
|
|
698
|
-
* stamps the reservation in the same write that wins queued -> running.
|
|
699
|
-
*/
|
|
700
|
-
budget?: DispatchBudget;
|
|
701
|
-
}
|
|
702
|
-
declare const DEFAULT_MAX_LAUNCH_ATTEMPTS = 45;
|
|
703
|
-
/**
|
|
704
|
-
* The handshake between recorded work and execution: win the store-gated
|
|
705
|
-
* transition (at most one dispatcher can succeed), then start the run. A
|
|
706
|
-
* launch failure re-queues the task (bumping its attempt) until the attempt
|
|
707
|
-
* limit, then fails it; a crash between the transition and the launch leaves
|
|
708
|
-
* a running task with no execution, which the sweep reaps.
|
|
709
|
-
*/
|
|
710
|
-
declare function dispatchTask(stores: FactoryStores, taskId: TaskId, options: DispatchOptions): Promise<Task>;
|
|
711
|
-
//#endregion
|
|
712
|
-
export { Cost as $, taskSchema as $t, AppendReceiptInput as A, TaskId as At, DecideSignalOptions as B, TaskApproval as Bt, findingCategorySchema as C, budgetMonthSchema as Ct, findingVerificationLevelSchema as D, ReceiptId as Dt, findingSchema as E, FactoryId as Et, ChangeTransitionOptions as F, repositoryIdsSchema as Ft, StepUsage as G, executionReferenceSchema as Gt, FactoryStores as H, TaskState as Ht, CreateChangeInput as I, signalIdSchema as It, createStores as J, taskApprovalSchema as Jt, TaskPatch as K, harnessSchema as Kt, CreateSignalInput as L, taskIdSchema as Lt, ApprovalError as M, factoryIdSchema as Mt, ChangeAssociationError as N, receiptIdSchema as Nt, findingVerificationMethodSchema as O, RepositoryId as Ot, ChangePatch as P, repositoryIdSchema as Pt, repositorySlugSchema as Q, taskQuestionSchema as Qt, CreateStoresOptions as R, ExecutionReference as Rt, FindingVerification as S, budgetLimitsSchema as St, findingPrioritySchema as T, ChangeId as Tt, SettleTaskOptions as U, TaskUsage as Ut, EnsureBudgetInput as V, TaskKind as Vt, SettlementError as W, coordinationRepositoryIdsSchema as Wt, RepositorySlug as X, taskKindSchema as Xt, Repository as Y, taskExecutionRepositoryIdsSchema as Yt, repositorySchema as Z, taskOriginSchema as Zt, defaultApprovalPolicy as _, changeSchema as _t, DispatchRefusedError as a, receiptKindSchema as at, FindingCategory as b, Budget as bt, AgentRouteInput as c, receiptStateSchema as ct, defineAgentRoutes as d, standardReceiptStates as dt, taskStateSchema as en, Receipt as et, ApprovalPolicy as f, Change as ft, approvalRuleSchema as g, changeEvidenceSchema as gt, approvalPolicySchema as h, Level as ht, DispatchOptions as i, costSchema as it, ApprovalDecision as j, changeIdSchema as jt, findingVerificationSchema as k, SignalId as kt, AgentRouteRegistry as l, standardReceiptKinds as lt, ApprovalSubject as m, ChangeState as mt, DEFAULT_MAX_LAUNCH_ATTEMPTS as n, ReceiptPhase as nt, dispatchTask as o, receiptPhaseSchema as ot, ApprovalRule as p, ChangeEvidence as pt, TaskTransitionOptions as q, standardTaskKinds as qt, DispatchBudget as r, ReceiptState as rt, AgentRoute as s, receiptSchema as st, BudgetExhaustedError as t, taskUsageSchema as tn, ReceiptKind as tt, agentRouteSchema as u, standardReceiptPhases as ut, requiresApproval as v, changeStateSchema as vt, findingFingerprint as w, budgetSchema as wt, FindingPriority as x, BudgetLimits as xt, Finding as y, levelSchema as yt, CreateTaskInput as z, Task as zt };
|
|
713
|
-
//# sourceMappingURL=dispatch-B77cuPxh.d.mts.map
|
|
780
|
+
export { Change as $, outboxIdSchema as $t, standardSignalSources as A, coordinationRepositoryIdsSchema as At, costSchema as B, taskStateSchema as Bt, createStores as C, answerEventSchema as Ct, signalOutcomeSchema as D, TaskKind as Dt, SignalSource as E, TaskApproval as Et, Cost as F, taskExecutionRepositoryIdsSchema as Ft, standardReceiptKinds as G, OutboxId as Gt, receiptPhaseSchema as H, AnswerId as Ht, Receipt as I, taskKindSchema as It, OutboxMessage as J, SignalId as Jt, standardReceiptPhases as K, ReceiptId as Kt, ReceiptKind as L, taskOriginSchema as Lt, RepositorySlug as M, harnessSchema as Mt, repositorySchema as N, standardTaskKinds as Nt, signalSchema as O, TaskState as Ot, repositorySlugSchema as P, taskApprovalSchema as Pt, outboxStateSchema as Q, factoryIdSchema as Qt, ReceiptPhase as R, taskQuestionSchema as Rt, TaskTransitionOptions as S, AnswerEvent as St, SignalOutcome as T, Task as Tt, receiptSchema as U, ChangeId as Ut, receiptKindSchema as V, taskUsageSchema as Vt, receiptStateSchema as W, FactoryId as Wt, outboxMessageSchema as X, answerIdSchema as Xt, OutboxQueue as Y, TaskId as Yt, outboxQueueSchema as Z, changeIdSchema as Zt, SessionConflictError as _, usdSchema as _t, ApprovalError as a, Budget as an, changeStateSchema as at, StepUsage as b, agentSessionIdSchema as bt, ChangeTransitionOptions as c, budgetMonthSchema as cn, CommunicationOutcome as ct, CreateStoresOptions as d, communicationOutcomes as dt, receiptIdSchema as en, ChangeEvidence as et, CreateTaskInput as f, ReplyTo as ft, OutboxEventConflictError as g, schemaVersionSchema as gt, FactoryStores as h, replyToSchema as ht, ApprovalDecision as i, taskIdSchema as in, changeSchema as it, Repository as j, executionReferenceSchema as jt, signalSourceSchema as k, TaskUsage as kt, CreateChangeInput as l, budgetSchema as ln, communicationEventSchema as lt, EnsureBudgetInput as m, isoDateTimeSchema as mt, AnswerQuestionInput as n, repositoryIdsSchema as nn, Level as nt, ChangeAssociationError as o, BudgetLimits as on, levelSchema as ot, DecideSignalOptions as p, SCHEMA_VERSION as pt, standardReceiptStates as q, RepositoryId as qt, AppendReceiptInput as r, signalIdSchema as rn, changeEvidenceSchema as rt, ChangePatch as s, budgetLimitsSchema as sn, CommunicationEvent as st, AnswerEventConflictError as t, repositoryIdSchema as tn, ChangeState as tt, CreateSignalInput as u, communicationOutcomeSchema as ut, SettleTaskOptions as v, vocabularySchema as vt, Signal as w, ExecutionReference as wt, TaskPatch as x, agentSessionSchema as xt, SettlementError as y, AgentSession as yt, ReceiptState as z, taskSchema as zt };
|
|
781
|
+
//# sourceMappingURL=engine-DFHU2Pe-.d.mts.map
|