@atolis-hq/wake 0.4.103 → 0.4.105
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/dist/src/activities/agent/agent-activity.js +3 -0
- package/dist/src/activities/contracts/activity.d.ts +16 -0
- package/dist/src/bootstrap/artifact-mcp.js +20 -1
- package/dist/src/bootstrap/config/root-schema.d.ts +16 -0
- package/dist/src/bootstrap/delegation-authority.js +17 -0
- package/dist/src/bootstrap/surface-api-delivery.js +25 -0
- package/dist/src/bootstrap/version.js +1 -1
- package/dist/src/control-plane/application/activation-scheduler-ports.d.ts +3 -1
- package/dist/src/control-plane/application/advance-once-dispatch.js +4 -2
- package/dist/src/execution/application/candidate-workspaces.d.ts +13 -0
- package/dist/src/execution/application/candidate-workspaces.js +75 -0
- package/dist/src/execution/application/execution-service.js +27 -11
- package/dist/src/execution/application/run-lifecycle.js +1 -0
- package/dist/src/execution/contracts/candidate.d.ts +31 -0
- package/dist/src/execution/contracts/candidate.js +40 -0
- package/dist/src/execution/contracts/commands.d.ts +2 -0
- package/dist/src/execution/contracts/events.d.ts +11 -0
- package/dist/src/execution/contracts/events.js +2 -0
- package/dist/src/execution/contracts/repository-assignment.d.ts +5 -0
- package/dist/src/execution/contracts/repository-assignment.js +8 -0
- package/dist/src/execution/contracts/views.d.ts +2 -0
- package/dist/src/execution/contracts/vocabulary.d.ts +5 -0
- package/dist/src/execution/contracts/vocabulary.js +4 -0
- package/dist/src/execution/contracts/workspace.d.ts +6 -0
- package/dist/src/execution/index.d.ts +1 -0
- package/dist/src/execution/index.js +1 -0
- package/dist/src/execution/infrastructure/workspace/git-source.d.ts +2 -2
- package/dist/src/execution/infrastructure/workspace/git-source.js +18 -1
- package/dist/src/execution/infrastructure/workspace/git-workspace.d.ts +2 -4
- package/dist/src/execution/infrastructure/workspace/git-workspace.js +12 -1
- package/dist/src/orchestration/application/conversation-command-reactor.js +25 -0
- package/dist/src/orchestration/application/delegated-work.d.ts +14 -0
- package/dist/src/orchestration/application/delegated-work.js +63 -20
- package/dist/src/orchestration/application/delegation-attention-escalations.d.ts +11 -0
- package/dist/src/orchestration/application/delegation-attention-escalations.js +36 -0
- package/dist/src/orchestration/application/delegation-attention-state.d.ts +53 -0
- package/dist/src/orchestration/application/delegation-attention-state.js +194 -0
- package/dist/src/orchestration/application/delegation-attention.d.ts +58 -0
- package/dist/src/orchestration/application/delegation-attention.js +206 -0
- package/dist/src/orchestration/application/delegation-commands.d.ts +18 -1
- package/dist/src/orchestration/application/delegation-commands.js +18 -1
- package/dist/src/orchestration/application/delegation-gate.d.ts +4 -1
- package/dist/src/orchestration/application/delegation-gate.js +15 -3
- package/dist/src/orchestration/application/delivery-coordinator.d.ts +279 -0
- package/dist/src/orchestration/application/delivery-coordinator.js +213 -0
- package/dist/src/orchestration/application/delivery-facts-reader.d.ts +9 -0
- package/dist/src/orchestration/application/delivery-facts-reader.js +46 -0
- package/dist/src/orchestration/application/delivery-preparation.d.ts +15 -0
- package/dist/src/orchestration/application/delivery-preparation.js +100 -0
- package/dist/src/orchestration/application/delivery-sources.d.ts +10 -0
- package/dist/src/orchestration/application/delivery-sources.js +41 -0
- package/dist/src/orchestration/application/orchestration-repository.d.ts +3 -1
- package/dist/src/orchestration/application/orchestration-repository.js +10 -1
- package/dist/src/orchestration/application/orchestration-service.d.ts +284 -1
- package/dist/src/orchestration/application/orchestration-service.js +71 -5
- package/dist/src/orchestration/contracts/config.d.ts +16 -0
- package/dist/src/orchestration/contracts/config.js +7 -1
- package/dist/src/orchestration/contracts/delegation-ports.d.ts +4 -0
- package/dist/src/orchestration/contracts/delegation.d.ts +76 -2
- package/dist/src/orchestration/contracts/delegation.js +54 -1
- package/dist/src/orchestration/contracts/delivery-ports.d.ts +9 -0
- package/dist/src/orchestration/contracts/delivery-ports.js +1 -0
- package/dist/src/orchestration/contracts/delivery.d.ts +252 -0
- package/dist/src/orchestration/contracts/delivery.js +134 -0
- package/dist/src/orchestration/contracts/event-decoder.js +17 -2
- package/dist/src/orchestration/contracts/event-factory.js +13 -1
- package/dist/src/orchestration/contracts/events.d.ts +23 -1
- package/dist/src/orchestration/contracts/events.js +6 -0
- package/dist/src/orchestration/contracts/views.d.ts +9 -0
- package/dist/src/orchestration/contracts/vocabulary.d.ts +65 -0
- package/dist/src/orchestration/contracts/vocabulary.js +59 -0
- package/dist/src/orchestration/domain/compiler.js +2 -0
- package/dist/src/orchestration/domain/delivery-candidate.d.ts +9 -0
- package/dist/src/orchestration/domain/delivery-candidate.js +92 -0
- package/dist/src/orchestration/domain/delivery-facts.d.ts +83 -0
- package/dist/src/orchestration/domain/delivery-facts.js +34 -0
- package/dist/src/orchestration/domain/delivery-qa.d.ts +32 -0
- package/dist/src/orchestration/domain/delivery-qa.js +77 -0
- package/dist/src/orchestration/domain/delivery-replacement.d.ts +9 -0
- package/dist/src/orchestration/domain/delivery-replacement.js +54 -0
- package/dist/src/orchestration/domain/delivery-selection.d.ts +17 -0
- package/dist/src/orchestration/domain/delivery-selection.js +132 -0
- package/dist/src/orchestration/domain/delivery-workflow-policy.d.ts +4 -0
- package/dist/src/orchestration/domain/delivery-workflow-policy.js +13 -0
- package/dist/src/orchestration/domain/operator-retry-policy.js +24 -13
- package/dist/src/orchestration/domain/workflow-instance-events.d.ts +2 -0
- package/dist/src/orchestration/domain/workflow-instance-events.js +39 -0
- package/dist/src/orchestration/index.d.ts +5 -3
- package/dist/src/orchestration/index.js +3 -2
- package/dist/src/surfaces/api/contracts/work.d.ts +16 -0
- package/dist/src/surfaces/mcp/delegation.js +51 -1
- package/dist/src/surfaces/web-assets/assets/index-BfhxlN_h.js +1192 -0
- package/dist/src/surfaces/web-assets/index.html +1 -1
- package/package.json +1 -1
- package/dist/src/surfaces/web-assets/assets/index-C5R-aWzH.js +0 -1192
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { activationId } from '../../activities/index.js';
|
|
3
3
|
import { workflowInstanceId } from './identifiers.js';
|
|
4
|
-
import { type DelegationConflictCode } from './vocabulary.js';
|
|
4
|
+
import { type DelegationAttentionRejection, type DelegationConflictCode } from './vocabulary.js';
|
|
5
5
|
export declare const delegationPrerequisiteSchema: z.ZodObject<{
|
|
6
6
|
cohortId: z.ZodOptional<z.ZodString>;
|
|
7
7
|
assignmentId: z.ZodString;
|
|
@@ -56,6 +56,10 @@ export declare const delegatedAssignmentSchema: z.ZodObject<{
|
|
|
56
56
|
}>;
|
|
57
57
|
useAsBase: z.ZodOptional<z.ZodBoolean>;
|
|
58
58
|
}, z.core.$strict>>>;
|
|
59
|
+
replaces: z.ZodOptional<z.ZodObject<{
|
|
60
|
+
cohortId: z.ZodString;
|
|
61
|
+
assignmentId: z.ZodString;
|
|
62
|
+
}, z.core.$strict>>;
|
|
59
63
|
outputs: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
60
64
|
name: z.ZodString;
|
|
61
65
|
path: z.ZodString;
|
|
@@ -81,8 +85,8 @@ export declare const delegationSubmissionSchema: z.ZodObject<{
|
|
|
81
85
|
workItemId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../work/index.js").WorkItemId, string>>;
|
|
82
86
|
revisionId: z.ZodString;
|
|
83
87
|
}, z.core.$strict>>;
|
|
84
|
-
assignmentId: z.ZodString;
|
|
85
88
|
criteria: z.ZodArray<z.ZodString>;
|
|
89
|
+
assignmentId: z.ZodString;
|
|
86
90
|
workflowName: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").WorkflowName, string>>;
|
|
87
91
|
repositoryResourceIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
88
92
|
prerequisites: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -97,6 +101,10 @@ export declare const delegationSubmissionSchema: z.ZodObject<{
|
|
|
97
101
|
}>;
|
|
98
102
|
useAsBase: z.ZodOptional<z.ZodBoolean>;
|
|
99
103
|
}, z.core.$strict>>>;
|
|
104
|
+
replaces: z.ZodOptional<z.ZodObject<{
|
|
105
|
+
cohortId: z.ZodString;
|
|
106
|
+
assignmentId: z.ZodString;
|
|
107
|
+
}, z.core.$strict>>;
|
|
100
108
|
outputs: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
101
109
|
name: z.ZodString;
|
|
102
110
|
path: z.ZodString;
|
|
@@ -145,6 +153,10 @@ export declare const delegationReservationSchema: z.ZodObject<{
|
|
|
145
153
|
}>;
|
|
146
154
|
useAsBase: z.ZodOptional<z.ZodBoolean>;
|
|
147
155
|
}, z.core.$strict>>>;
|
|
156
|
+
replaces: z.ZodOptional<z.ZodObject<{
|
|
157
|
+
cohortId: z.ZodString;
|
|
158
|
+
assignmentId: z.ZodString;
|
|
159
|
+
}, z.core.$strict>>;
|
|
148
160
|
outputs: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
149
161
|
name: z.ZodString;
|
|
150
162
|
path: z.ZodString;
|
|
@@ -220,6 +232,68 @@ export declare class DelegationConflictError extends Error {
|
|
|
220
232
|
readonly code: DelegationConflictCode;
|
|
221
233
|
constructor(code: DelegationConflictCode, message: string);
|
|
222
234
|
}
|
|
235
|
+
export declare const delegationAttentionBlockerSchema: z.ZodObject<{
|
|
236
|
+
blockerId: z.ZodString;
|
|
237
|
+
childWorkItemId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../work/index.js").WorkItemId, string>>;
|
|
238
|
+
kind: z.ZodEnum<{
|
|
239
|
+
readonly Failed: "failed";
|
|
240
|
+
readonly Context: "assignment-context";
|
|
241
|
+
}>;
|
|
242
|
+
reason: z.ZodString;
|
|
243
|
+
}, z.core.$strict>;
|
|
244
|
+
export type DelegationAttentionBlocker = z.infer<typeof delegationAttentionBlockerSchema>;
|
|
245
|
+
/** One coalesced assessment of the unresolved reasons, keyed by cohort revision and blockers. */
|
|
246
|
+
export declare const delegationAttentionRequestSchema: z.ZodObject<{
|
|
247
|
+
cohortId: z.ZodString;
|
|
248
|
+
attentionKey: z.ZodString;
|
|
249
|
+
activationId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../activities/index.js").ActivationId, string>>;
|
|
250
|
+
revision: z.ZodNumber;
|
|
251
|
+
blockers: z.ZodArray<z.ZodObject<{
|
|
252
|
+
blockerId: z.ZodString;
|
|
253
|
+
childWorkItemId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../work/index.js").WorkItemId, string>>;
|
|
254
|
+
kind: z.ZodEnum<{
|
|
255
|
+
readonly Failed: "failed";
|
|
256
|
+
readonly Context: "assignment-context";
|
|
257
|
+
}>;
|
|
258
|
+
reason: z.ZodString;
|
|
259
|
+
}, z.core.$strict>>;
|
|
260
|
+
}, z.core.$strict>;
|
|
261
|
+
export type DelegationAttentionRequest = z.infer<typeof delegationAttentionRequestSchema>;
|
|
262
|
+
/** Names the child, blocker and assignment revision; context references are exact revisions. */
|
|
263
|
+
export declare const delegationAttentionReplySchema: z.ZodObject<{
|
|
264
|
+
childWorkItemId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../work/index.js").WorkItemId, string>>;
|
|
265
|
+
blockerId: z.ZodString;
|
|
266
|
+
expectedRevision: z.ZodNumber;
|
|
267
|
+
references: z.ZodArray<z.ZodObject<{
|
|
268
|
+
workItemId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../work/index.js").WorkItemId, string>>;
|
|
269
|
+
revisionId: z.ZodString;
|
|
270
|
+
}, z.core.$strict>>;
|
|
271
|
+
}, z.core.$strict>;
|
|
272
|
+
export type DelegationAttentionReply = z.infer<typeof delegationAttentionReplySchema>;
|
|
273
|
+
export declare const delegationAttentionResponseSchema: z.ZodObject<{
|
|
274
|
+
childWorkItemId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../work/index.js").WorkItemId, string>>;
|
|
275
|
+
blockerId: z.ZodString;
|
|
276
|
+
expectedRevision: z.ZodNumber;
|
|
277
|
+
references: z.ZodArray<z.ZodObject<{
|
|
278
|
+
workItemId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../work/index.js").WorkItemId, string>>;
|
|
279
|
+
revisionId: z.ZodString;
|
|
280
|
+
}, z.core.$strict>>;
|
|
281
|
+
cohortId: z.ZodString;
|
|
282
|
+
attentionKey: z.ZodString;
|
|
283
|
+
}, z.core.$strict>;
|
|
284
|
+
export type DelegationAttentionResponse = z.infer<typeof delegationAttentionResponseSchema>;
|
|
285
|
+
export declare const delegationAttentionResolvedSchema: z.ZodObject<{
|
|
286
|
+
cohortId: z.ZodString;
|
|
287
|
+
attentionKey: z.ZodString;
|
|
288
|
+
activationId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../activities/index.js").ActivationId, string>>;
|
|
289
|
+
escalation: z.ZodOptional<z.ZodString>;
|
|
290
|
+
assessmentFailure: z.ZodOptional<z.ZodString>;
|
|
291
|
+
}, z.core.$strict>;
|
|
292
|
+
/** Rejected replies never resume work; the code names the boundary that refused them. */
|
|
293
|
+
export declare class DelegationAttentionError extends Error {
|
|
294
|
+
readonly code: DelegationAttentionRejection;
|
|
295
|
+
constructor(code: DelegationAttentionRejection, message: string);
|
|
296
|
+
}
|
|
223
297
|
export declare const delegationWaitSchema: z.ZodObject<{
|
|
224
298
|
cohortId: z.ZodString;
|
|
225
299
|
activationId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../activities/index.js").ActivationId, string>>;
|
|
@@ -3,7 +3,7 @@ import { activationId } from '../../activities/index.js';
|
|
|
3
3
|
import { brandedStringSchema } from '../../kernel/index.js';
|
|
4
4
|
import { workItemId } from '../../work/index.js';
|
|
5
5
|
import { workflowInstanceId, workflowName } from './identifiers.js';
|
|
6
|
-
import { DelegationOutputKind, DelegationPrerequisiteCondition, } from './vocabulary.js';
|
|
6
|
+
import { DelegationBlockerKind, DelegationOutputKind, DelegationPrerequisiteCondition, } from './vocabulary.js';
|
|
7
7
|
export const delegationPrerequisiteSchema = z
|
|
8
8
|
.object({
|
|
9
9
|
cohortId: z.string().min(1).optional(),
|
|
@@ -41,6 +41,11 @@ export const delegatedAssignmentSchema = z
|
|
|
41
41
|
context: z.array(delegationRevisionReferenceSchema),
|
|
42
42
|
repository: repositoryAssignmentRequestSchema.optional(),
|
|
43
43
|
prerequisites: z.array(delegationPrerequisiteSchema).optional(),
|
|
44
|
+
/** Names the original required assignment this corrective child replaces. */
|
|
45
|
+
replaces: z
|
|
46
|
+
.object({ cohortId: z.string().min(1), assignmentId: z.string().min(1) })
|
|
47
|
+
.strict()
|
|
48
|
+
.optional(),
|
|
44
49
|
outputs: z
|
|
45
50
|
.array(z.union([
|
|
46
51
|
z.object({ name: z.string().min(1), path: z.string().min(1) }).strict(),
|
|
@@ -143,6 +148,54 @@ export class DelegationConflictError extends Error {
|
|
|
143
148
|
this.name = 'DelegationConflictError';
|
|
144
149
|
}
|
|
145
150
|
}
|
|
151
|
+
export const delegationAttentionBlockerSchema = z
|
|
152
|
+
.object({
|
|
153
|
+
blockerId: z.string().min(1),
|
|
154
|
+
childWorkItemId: brandedStringSchema(workItemId),
|
|
155
|
+
kind: z.enum(DelegationBlockerKind),
|
|
156
|
+
reason: z.string().min(1),
|
|
157
|
+
})
|
|
158
|
+
.strict();
|
|
159
|
+
/** One coalesced assessment of the unresolved reasons, keyed by cohort revision and blockers. */
|
|
160
|
+
export const delegationAttentionRequestSchema = z
|
|
161
|
+
.object({
|
|
162
|
+
cohortId: z.string().min(1),
|
|
163
|
+
attentionKey: z.string().min(1),
|
|
164
|
+
activationId: brandedStringSchema(activationId),
|
|
165
|
+
revision: z.number().int().positive(),
|
|
166
|
+
blockers: z.array(delegationAttentionBlockerSchema).min(1),
|
|
167
|
+
})
|
|
168
|
+
.strict();
|
|
169
|
+
/** Names the child, blocker and assignment revision; context references are exact revisions. */
|
|
170
|
+
export const delegationAttentionReplySchema = z
|
|
171
|
+
.object({
|
|
172
|
+
childWorkItemId: brandedStringSchema(workItemId),
|
|
173
|
+
blockerId: z.string().min(1),
|
|
174
|
+
expectedRevision: z.number().int().positive(),
|
|
175
|
+
references: z.array(delegationRevisionReferenceSchema),
|
|
176
|
+
})
|
|
177
|
+
.strict();
|
|
178
|
+
export const delegationAttentionResponseSchema = delegationAttentionReplySchema
|
|
179
|
+
.extend({ cohortId: z.string().min(1), attentionKey: z.string().min(1) })
|
|
180
|
+
.strict();
|
|
181
|
+
export const delegationAttentionResolvedSchema = z
|
|
182
|
+
.object({
|
|
183
|
+
cohortId: z.string().min(1),
|
|
184
|
+
attentionKey: z.string().min(1),
|
|
185
|
+
activationId: brandedStringSchema(activationId),
|
|
186
|
+
escalation: z.string().min(1).optional(),
|
|
187
|
+
assessmentFailure: z.string().min(1).optional(),
|
|
188
|
+
})
|
|
189
|
+
.strict();
|
|
190
|
+
/** Rejected replies never resume work; the code names the boundary that refused them. */
|
|
191
|
+
export class DelegationAttentionError extends Error {
|
|
192
|
+
code;
|
|
193
|
+
constructor(code, message) {
|
|
194
|
+
super(message);
|
|
195
|
+
this.code = code;
|
|
196
|
+
this.name = 'DelegationAttentionError';
|
|
197
|
+
}
|
|
198
|
+
}
|
|
146
199
|
export const delegationWaitSchema = z
|
|
147
200
|
.object({ cohortId: z.string().min(1), activationId: brandedStringSchema(activationId) })
|
|
148
201
|
.strict();
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CompiledWorkflow } from './config.js';
|
|
2
|
+
import type { DelegationAuthority, DelegationRepositories } from './delegation-ports.js';
|
|
3
|
+
import type { WorkflowInstanceView } from './views.js';
|
|
4
|
+
export interface DeliveryDependencies {
|
|
5
|
+
readonly authority: DelegationAuthority;
|
|
6
|
+
/** Resolves a repository source through the parent's own repository authority. */
|
|
7
|
+
readonly repositories?: DelegationRepositories | undefined;
|
|
8
|
+
readonly definitionFor: (parent: WorkflowInstanceView) => Promise<CompiledWorkflow>;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { StageName } from './identifiers.js';
|
|
3
|
+
import { type DeliveryRejection } from './vocabulary.js';
|
|
4
|
+
export declare const deliveryOutputKeySchema: z.ZodObject<{
|
|
5
|
+
childWorkItemId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../work/index.js").WorkItemId, string>>;
|
|
6
|
+
outputName: z.ZodString;
|
|
7
|
+
}, z.core.$strict>;
|
|
8
|
+
export type DeliveryOutputKey = z.infer<typeof deliveryOutputKeySchema>;
|
|
9
|
+
export declare const deliverySelectionEntrySchema: z.ZodObject<{
|
|
10
|
+
cohortId: z.ZodString;
|
|
11
|
+
assignmentId: z.ZodString;
|
|
12
|
+
output: z.ZodObject<{
|
|
13
|
+
childWorkItemId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../work/index.js").WorkItemId, string>>;
|
|
14
|
+
outputName: z.ZodString;
|
|
15
|
+
}, z.core.$strict>;
|
|
16
|
+
replaces: z.ZodOptional<z.ZodObject<{
|
|
17
|
+
childWorkItemId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../work/index.js").WorkItemId, string>>;
|
|
18
|
+
outputName: z.ZodString;
|
|
19
|
+
}, z.core.$strict>>;
|
|
20
|
+
}, z.core.$strict>;
|
|
21
|
+
/** Agent input: the complete current selection, so an omitted requirement cannot be waived. */
|
|
22
|
+
export declare const deliverySelectionCommandSchema: z.ZodObject<{
|
|
23
|
+
requestId: z.ZodString;
|
|
24
|
+
expectedRevision: z.ZodNumber;
|
|
25
|
+
entries: z.ZodArray<z.ZodObject<{
|
|
26
|
+
cohortId: z.ZodString;
|
|
27
|
+
assignmentId: z.ZodString;
|
|
28
|
+
output: z.ZodObject<{
|
|
29
|
+
childWorkItemId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../work/index.js").WorkItemId, string>>;
|
|
30
|
+
outputName: z.ZodString;
|
|
31
|
+
}, z.core.$strict>;
|
|
32
|
+
replaces: z.ZodOptional<z.ZodObject<{
|
|
33
|
+
childWorkItemId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../work/index.js").WorkItemId, string>>;
|
|
34
|
+
outputName: z.ZodString;
|
|
35
|
+
}, z.core.$strict>>;
|
|
36
|
+
}, z.core.$strict>>;
|
|
37
|
+
}, z.core.$strict>;
|
|
38
|
+
export type DeliverySelectionCommand = z.infer<typeof deliverySelectionCommandSchema>;
|
|
39
|
+
export declare const selectedEntrySchema: z.ZodObject<{
|
|
40
|
+
cohortId: z.ZodString;
|
|
41
|
+
assignmentId: z.ZodString;
|
|
42
|
+
childWorkItemId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../work/index.js").WorkItemId, string>>;
|
|
43
|
+
output: z.ZodObject<{
|
|
44
|
+
name: z.ZodString;
|
|
45
|
+
reference: z.ZodUnion<readonly [z.ZodObject<{
|
|
46
|
+
workItemId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../work/index.js").WorkItemId, string>>;
|
|
47
|
+
revisionId: z.ZodString;
|
|
48
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
49
|
+
workItemId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../work/index.js").WorkItemId, string>>;
|
|
50
|
+
resourceId: z.ZodString;
|
|
51
|
+
repositoryResourceId: z.ZodString;
|
|
52
|
+
revision: z.ZodString;
|
|
53
|
+
branch: z.ZodString;
|
|
54
|
+
pullRequestBase: z.ZodString;
|
|
55
|
+
runId: z.ZodString;
|
|
56
|
+
baseRevision: z.ZodOptional<z.ZodString>;
|
|
57
|
+
merged: z.ZodOptional<z.ZodLiteral<true>>;
|
|
58
|
+
}, z.core.$strict>]>;
|
|
59
|
+
}, z.core.$strict>;
|
|
60
|
+
replaces: z.ZodOptional<z.ZodObject<{
|
|
61
|
+
childWorkItemId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../work/index.js").WorkItemId, string>>;
|
|
62
|
+
outputName: z.ZodString;
|
|
63
|
+
}, z.core.$strict>>;
|
|
64
|
+
}, z.core.$strict>;
|
|
65
|
+
export type SelectedEntry = z.infer<typeof selectedEntrySchema>;
|
|
66
|
+
export declare const deliverySelectionSchema: z.ZodObject<{
|
|
67
|
+
requestId: z.ZodString;
|
|
68
|
+
revision: z.ZodNumber;
|
|
69
|
+
entries: z.ZodArray<z.ZodObject<{
|
|
70
|
+
cohortId: z.ZodString;
|
|
71
|
+
assignmentId: z.ZodString;
|
|
72
|
+
childWorkItemId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../work/index.js").WorkItemId, string>>;
|
|
73
|
+
output: z.ZodObject<{
|
|
74
|
+
name: z.ZodString;
|
|
75
|
+
reference: z.ZodUnion<readonly [z.ZodObject<{
|
|
76
|
+
workItemId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../work/index.js").WorkItemId, string>>;
|
|
77
|
+
revisionId: z.ZodString;
|
|
78
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
79
|
+
workItemId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../work/index.js").WorkItemId, string>>;
|
|
80
|
+
resourceId: z.ZodString;
|
|
81
|
+
repositoryResourceId: z.ZodString;
|
|
82
|
+
revision: z.ZodString;
|
|
83
|
+
branch: z.ZodString;
|
|
84
|
+
pullRequestBase: z.ZodString;
|
|
85
|
+
runId: z.ZodString;
|
|
86
|
+
baseRevision: z.ZodOptional<z.ZodString>;
|
|
87
|
+
merged: z.ZodOptional<z.ZodLiteral<true>>;
|
|
88
|
+
}, z.core.$strict>]>;
|
|
89
|
+
}, z.core.$strict>;
|
|
90
|
+
replaces: z.ZodOptional<z.ZodObject<{
|
|
91
|
+
childWorkItemId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../work/index.js").WorkItemId, string>>;
|
|
92
|
+
outputName: z.ZodString;
|
|
93
|
+
}, z.core.$strict>>;
|
|
94
|
+
}, z.core.$strict>>;
|
|
95
|
+
}, z.core.$strict>;
|
|
96
|
+
export type DeliverySelection = z.infer<typeof deliverySelectionSchema>;
|
|
97
|
+
export declare const candidateSourceInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
98
|
+
kind: z.ZodLiteral<"output">;
|
|
99
|
+
tip: z.ZodObject<{
|
|
100
|
+
childWorkItemId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../work/index.js").WorkItemId, string>>;
|
|
101
|
+
outputName: z.ZodString;
|
|
102
|
+
}, z.core.$strict>;
|
|
103
|
+
includes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
104
|
+
childWorkItemId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../work/index.js").WorkItemId, string>>;
|
|
105
|
+
outputName: z.ZodString;
|
|
106
|
+
}, z.core.$strict>>>;
|
|
107
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
108
|
+
kind: z.ZodLiteral<"retained-ref">;
|
|
109
|
+
ref: z.ZodString;
|
|
110
|
+
revision: z.ZodString;
|
|
111
|
+
contributions: z.ZodArray<z.ZodObject<{
|
|
112
|
+
childWorkItemId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../work/index.js").WorkItemId, string>>;
|
|
113
|
+
outputName: z.ZodString;
|
|
114
|
+
}, z.core.$strict>>;
|
|
115
|
+
}, z.core.$strict>], "kind">;
|
|
116
|
+
export declare const deliveryCandidateCommandSchema: z.ZodObject<{
|
|
117
|
+
candidateId: z.ZodString;
|
|
118
|
+
selectionRevision: z.ZodNumber;
|
|
119
|
+
repositories: z.ZodArray<z.ZodObject<{
|
|
120
|
+
resourceId: z.ZodString;
|
|
121
|
+
source: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
122
|
+
kind: z.ZodLiteral<"output">;
|
|
123
|
+
tip: z.ZodObject<{
|
|
124
|
+
childWorkItemId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../work/index.js").WorkItemId, string>>;
|
|
125
|
+
outputName: z.ZodString;
|
|
126
|
+
}, z.core.$strict>;
|
|
127
|
+
includes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
128
|
+
childWorkItemId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../work/index.js").WorkItemId, string>>;
|
|
129
|
+
outputName: z.ZodString;
|
|
130
|
+
}, z.core.$strict>>>;
|
|
131
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
132
|
+
kind: z.ZodLiteral<"retained-ref">;
|
|
133
|
+
ref: z.ZodString;
|
|
134
|
+
revision: z.ZodString;
|
|
135
|
+
contributions: z.ZodArray<z.ZodObject<{
|
|
136
|
+
childWorkItemId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../work/index.js").WorkItemId, string>>;
|
|
137
|
+
outputName: z.ZodString;
|
|
138
|
+
}, z.core.$strict>>;
|
|
139
|
+
}, z.core.$strict>], "kind">;
|
|
140
|
+
}, z.core.$strict>>;
|
|
141
|
+
recipe: z.ZodOptional<z.ZodString>;
|
|
142
|
+
}, z.core.$strict>;
|
|
143
|
+
export type DeliveryCandidateCommand = z.infer<typeof deliveryCandidateCommandSchema>;
|
|
144
|
+
export declare const candidateRepositorySchema: z.ZodObject<{
|
|
145
|
+
resourceId: z.ZodString;
|
|
146
|
+
revision: z.ZodString;
|
|
147
|
+
pullRequestBase: z.ZodString;
|
|
148
|
+
source: z.ZodUnion<readonly [z.ZodObject<{
|
|
149
|
+
kind: z.ZodLiteral<"output">;
|
|
150
|
+
tip: z.ZodObject<{
|
|
151
|
+
childWorkItemId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../work/index.js").WorkItemId, string>>;
|
|
152
|
+
outputName: z.ZodString;
|
|
153
|
+
}, z.core.$strict>;
|
|
154
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
155
|
+
kind: z.ZodLiteral<"retained-ref">;
|
|
156
|
+
ref: z.ZodString;
|
|
157
|
+
}, z.core.$strict>]>;
|
|
158
|
+
contributions: z.ZodArray<z.ZodObject<{
|
|
159
|
+
childWorkItemId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../work/index.js").WorkItemId, string>>;
|
|
160
|
+
outputName: z.ZodString;
|
|
161
|
+
}, z.core.$strict>>;
|
|
162
|
+
}, z.core.$strict>;
|
|
163
|
+
export declare const deliveryCandidateSchema: z.ZodObject<{
|
|
164
|
+
candidateId: z.ZodString;
|
|
165
|
+
selectionRevision: z.ZodNumber;
|
|
166
|
+
repositories: z.ZodArray<z.ZodObject<{
|
|
167
|
+
resourceId: z.ZodString;
|
|
168
|
+
revision: z.ZodString;
|
|
169
|
+
pullRequestBase: z.ZodString;
|
|
170
|
+
source: z.ZodUnion<readonly [z.ZodObject<{
|
|
171
|
+
kind: z.ZodLiteral<"output">;
|
|
172
|
+
tip: z.ZodObject<{
|
|
173
|
+
childWorkItemId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../work/index.js").WorkItemId, string>>;
|
|
174
|
+
outputName: z.ZodString;
|
|
175
|
+
}, z.core.$strict>;
|
|
176
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
177
|
+
kind: z.ZodLiteral<"retained-ref">;
|
|
178
|
+
ref: z.ZodString;
|
|
179
|
+
}, z.core.$strict>]>;
|
|
180
|
+
contributions: z.ZodArray<z.ZodObject<{
|
|
181
|
+
childWorkItemId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../work/index.js").WorkItemId, string>>;
|
|
182
|
+
outputName: z.ZodString;
|
|
183
|
+
}, z.core.$strict>>;
|
|
184
|
+
}, z.core.$strict>>;
|
|
185
|
+
context: z.ZodArray<z.ZodObject<{
|
|
186
|
+
childWorkItemId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../work/index.js").WorkItemId, string>>;
|
|
187
|
+
outputName: z.ZodString;
|
|
188
|
+
}, z.core.$strict>>;
|
|
189
|
+
criteria: z.ZodArray<z.ZodString>;
|
|
190
|
+
recipe: z.ZodOptional<z.ZodString>;
|
|
191
|
+
}, z.core.$strict>;
|
|
192
|
+
export type DeliveryCandidate = z.infer<typeof deliveryCandidateSchema>;
|
|
193
|
+
export declare const deliveryQaCommandSchema: z.ZodObject<{
|
|
194
|
+
qaId: z.ZodString;
|
|
195
|
+
candidateId: z.ZodString;
|
|
196
|
+
verdict: z.ZodEnum<{
|
|
197
|
+
readonly Pass: "pass";
|
|
198
|
+
readonly Fail: "fail";
|
|
199
|
+
readonly Blocked: "blocked";
|
|
200
|
+
}>;
|
|
201
|
+
revisions: z.ZodArray<z.ZodObject<{
|
|
202
|
+
resourceId: z.ZodString;
|
|
203
|
+
revision: z.ZodString;
|
|
204
|
+
}, z.core.$strict>>;
|
|
205
|
+
environment: z.ZodObject<{
|
|
206
|
+
recipe: z.ZodOptional<z.ZodString>;
|
|
207
|
+
available: z.ZodBoolean;
|
|
208
|
+
}, z.core.$strict>;
|
|
209
|
+
findings: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
210
|
+
evidence: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
211
|
+
workItemId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../work/index.js").WorkItemId, string>>;
|
|
212
|
+
revisionId: z.ZodString;
|
|
213
|
+
}, z.core.$strict>>>;
|
|
214
|
+
}, z.core.$strict>;
|
|
215
|
+
export type DeliveryQaCommand = z.infer<typeof deliveryQaCommandSchema>;
|
|
216
|
+
export declare const deliveryQaSchema: z.ZodObject<{
|
|
217
|
+
qaId: z.ZodString;
|
|
218
|
+
candidateId: z.ZodString;
|
|
219
|
+
verdict: z.ZodEnum<{
|
|
220
|
+
readonly Pass: "pass";
|
|
221
|
+
readonly Fail: "fail";
|
|
222
|
+
readonly Blocked: "blocked";
|
|
223
|
+
}>;
|
|
224
|
+
revisions: z.ZodArray<z.ZodObject<{
|
|
225
|
+
resourceId: z.ZodString;
|
|
226
|
+
revision: z.ZodString;
|
|
227
|
+
}, z.core.$strict>>;
|
|
228
|
+
environment: z.ZodObject<{
|
|
229
|
+
recipe: z.ZodOptional<z.ZodString>;
|
|
230
|
+
available: z.ZodBoolean;
|
|
231
|
+
}, z.core.$strict>;
|
|
232
|
+
findings: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
233
|
+
evidence: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
234
|
+
workItemId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../work/index.js").WorkItemId, string>>;
|
|
235
|
+
revisionId: z.ZodString;
|
|
236
|
+
}, z.core.$strict>>>;
|
|
237
|
+
exhausted: z.ZodOptional<z.ZodBoolean>;
|
|
238
|
+
runId: z.ZodOptional<z.ZodString>;
|
|
239
|
+
activationId: z.ZodOptional<z.ZodString>;
|
|
240
|
+
}, z.core.$strict>;
|
|
241
|
+
export type DeliveryQa = z.infer<typeof deliveryQaSchema>;
|
|
242
|
+
/** A final delivery gate can be reassessed through ordinary operator retry. */
|
|
243
|
+
export interface DeliveryCompletionBlock {
|
|
244
|
+
readonly reason: string;
|
|
245
|
+
readonly deliveryGate: {
|
|
246
|
+
readonly retryStage: StageName;
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
export declare class DeliveryRejectionError extends Error {
|
|
250
|
+
readonly code: DeliveryRejection;
|
|
251
|
+
constructor(code: DeliveryRejection, message: string);
|
|
252
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { brandedStringSchema } from '../../kernel/index.js';
|
|
3
|
+
import { workItemId } from '../../work/index.js';
|
|
4
|
+
import { delegationResultSchema } from './delegation.js';
|
|
5
|
+
import { CandidateSourceKind, QaVerdict } from './vocabulary.js';
|
|
6
|
+
const revision = z.string().regex(/^(?:[a-f0-9]{40}|[a-f0-9]{64})$/i);
|
|
7
|
+
export const deliveryOutputKeySchema = z
|
|
8
|
+
.object({ childWorkItemId: brandedStringSchema(workItemId), outputName: z.string().min(1) })
|
|
9
|
+
.strict();
|
|
10
|
+
export const deliverySelectionEntrySchema = z
|
|
11
|
+
.object({
|
|
12
|
+
/** The original required assignment this entry covers. */
|
|
13
|
+
cohortId: z.string().min(1),
|
|
14
|
+
assignmentId: z.string().min(1),
|
|
15
|
+
output: deliveryOutputKeySchema,
|
|
16
|
+
/** Required exactly when the output is from a replacement; the output selected until now. */
|
|
17
|
+
replaces: deliveryOutputKeySchema.optional(),
|
|
18
|
+
})
|
|
19
|
+
.strict();
|
|
20
|
+
/** Agent input: the complete current selection, so an omitted requirement cannot be waived. */
|
|
21
|
+
export const deliverySelectionCommandSchema = z
|
|
22
|
+
.object({
|
|
23
|
+
requestId: z.string().min(1),
|
|
24
|
+
expectedRevision: z.number().int().nonnegative(),
|
|
25
|
+
entries: z.array(deliverySelectionEntrySchema).min(1),
|
|
26
|
+
})
|
|
27
|
+
.strict();
|
|
28
|
+
const deliveryOutputSchema = delegationResultSchema.shape.outputs.element;
|
|
29
|
+
export const selectedEntrySchema = z
|
|
30
|
+
.object({
|
|
31
|
+
cohortId: z.string().min(1),
|
|
32
|
+
assignmentId: z.string().min(1),
|
|
33
|
+
childWorkItemId: brandedStringSchema(workItemId),
|
|
34
|
+
output: deliveryOutputSchema,
|
|
35
|
+
replaces: deliveryOutputKeySchema.optional(),
|
|
36
|
+
})
|
|
37
|
+
.strict();
|
|
38
|
+
export const deliverySelectionSchema = z
|
|
39
|
+
.object({
|
|
40
|
+
requestId: z.string().min(1),
|
|
41
|
+
revision: z.number().int().positive(),
|
|
42
|
+
entries: z.array(selectedEntrySchema).min(1),
|
|
43
|
+
})
|
|
44
|
+
.strict();
|
|
45
|
+
export const candidateSourceInputSchema = z.discriminatedUnion('kind', [
|
|
46
|
+
z
|
|
47
|
+
.object({
|
|
48
|
+
kind: z.literal(CandidateSourceKind.Output),
|
|
49
|
+
/** The tip; `includes` declares the other selected outputs of an intentional stack. */
|
|
50
|
+
tip: deliveryOutputKeySchema,
|
|
51
|
+
includes: z.array(deliveryOutputKeySchema).optional(),
|
|
52
|
+
})
|
|
53
|
+
.strict(),
|
|
54
|
+
z
|
|
55
|
+
.object({
|
|
56
|
+
kind: z.literal(CandidateSourceKind.RetainedRef),
|
|
57
|
+
ref: z.string().min(1),
|
|
58
|
+
revision,
|
|
59
|
+
contributions: z.array(deliveryOutputKeySchema).min(1),
|
|
60
|
+
})
|
|
61
|
+
.strict(),
|
|
62
|
+
]);
|
|
63
|
+
export const deliveryCandidateCommandSchema = z
|
|
64
|
+
.object({
|
|
65
|
+
candidateId: z.string().regex(/^[a-z0-9][a-z0-9-]{0,62}$/),
|
|
66
|
+
selectionRevision: z.number().int().positive(),
|
|
67
|
+
repositories: z
|
|
68
|
+
.array(z.object({ resourceId: z.string().min(1), source: candidateSourceInputSchema }).strict())
|
|
69
|
+
.min(1),
|
|
70
|
+
/** The configured environment and test recipe QA must follow. */
|
|
71
|
+
recipe: z.string().trim().min(1).optional(),
|
|
72
|
+
})
|
|
73
|
+
.strict();
|
|
74
|
+
export const candidateRepositorySchema = z
|
|
75
|
+
.object({
|
|
76
|
+
resourceId: z.string().min(1),
|
|
77
|
+
revision,
|
|
78
|
+
pullRequestBase: z.string().min(1),
|
|
79
|
+
source: z.union([
|
|
80
|
+
z
|
|
81
|
+
.object({ kind: z.literal(CandidateSourceKind.Output), tip: deliveryOutputKeySchema })
|
|
82
|
+
.strict(),
|
|
83
|
+
z
|
|
84
|
+
.object({ kind: z.literal(CandidateSourceKind.RetainedRef), ref: z.string().min(1) })
|
|
85
|
+
.strict(),
|
|
86
|
+
]),
|
|
87
|
+
contributions: z.array(deliveryOutputKeySchema).min(1),
|
|
88
|
+
})
|
|
89
|
+
.strict();
|
|
90
|
+
export const deliveryCandidateSchema = z
|
|
91
|
+
.object({
|
|
92
|
+
candidateId: z.string().min(1),
|
|
93
|
+
selectionRevision: z.number().int().positive(),
|
|
94
|
+
repositories: z.array(candidateRepositorySchema).min(1),
|
|
95
|
+
/** Non-change outputs (plans, evidence) the candidate was selected with. */
|
|
96
|
+
context: z.array(deliveryOutputKeySchema),
|
|
97
|
+
criteria: z.array(z.string().min(1)),
|
|
98
|
+
recipe: z.string().min(1).optional(),
|
|
99
|
+
})
|
|
100
|
+
.strict();
|
|
101
|
+
export const deliveryQaCommandSchema = z
|
|
102
|
+
.object({
|
|
103
|
+
qaId: z.string().regex(/^[a-z0-9][a-z0-9-]{0,62}$/),
|
|
104
|
+
candidateId: z.string().min(1),
|
|
105
|
+
verdict: z.enum(QaVerdict),
|
|
106
|
+
/** The exact revision per repository the QA run checked; must equal the candidate's set. */
|
|
107
|
+
revisions: z.array(z.object({ resourceId: z.string().min(1), revision }).strict()).min(1),
|
|
108
|
+
environment: z
|
|
109
|
+
.object({ recipe: z.string().min(1).optional(), available: z.boolean() })
|
|
110
|
+
.strict(),
|
|
111
|
+
findings: z.array(z.string().trim().min(1)).default([]),
|
|
112
|
+
evidence: z
|
|
113
|
+
.array(z
|
|
114
|
+
.object({ workItemId: brandedStringSchema(workItemId), revisionId: z.string().min(1) })
|
|
115
|
+
.strict())
|
|
116
|
+
.optional(),
|
|
117
|
+
})
|
|
118
|
+
.strict();
|
|
119
|
+
export const deliveryQaSchema = deliveryQaCommandSchema
|
|
120
|
+
.extend({
|
|
121
|
+
/** Set when this failure used the last descendant slot: the parent must escalate. */
|
|
122
|
+
exhausted: z.boolean().optional(),
|
|
123
|
+
runId: z.string().min(1).optional(),
|
|
124
|
+
activationId: z.string().min(1).optional(),
|
|
125
|
+
})
|
|
126
|
+
.strict();
|
|
127
|
+
export class DeliveryRejectionError extends Error {
|
|
128
|
+
code;
|
|
129
|
+
constructor(code, message) {
|
|
130
|
+
super(message);
|
|
131
|
+
this.code = code;
|
|
132
|
+
this.name = 'DeliveryRejectionError';
|
|
133
|
+
}
|
|
134
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable max-lines */
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { delegationInputsSchema, delegationJoinSchema, delegationReservationSchema, delegationResultSchema, delegationWaitSchema, } from './delegation.js';
|
|
3
|
+
import { delegationAttentionRequestSchema, delegationAttentionResolvedSchema, delegationAttentionResponseSchema, delegationInputsSchema, delegationJoinSchema, delegationReservationSchema, delegationResultSchema, delegationWaitSchema, } from './delegation.js';
|
|
4
|
+
import { deliveryCandidateSchema, deliveryQaSchema, deliverySelectionSchema } from './delivery.js';
|
|
4
5
|
import { eventDataSchema, eventEnvelopeSchema } from '@atolis-hq/eventing';
|
|
5
6
|
import { activationId, ActivityEventType, activityName, ActivityOutcomeKind, PullRequestCheckState, PullRequestMergeability, PullRequestState, } from '../../activities/index.js';
|
|
6
7
|
import { WorkspaceMode } from '../../execution/index.js';
|
|
@@ -223,8 +224,14 @@ const eventSchemas = {
|
|
|
223
224
|
[OrchestrationEventType.DelegationPrerequisiteBlocked]: workflowEnvelope(OrchestrationEventType.DelegationPrerequisiteBlocked, z
|
|
224
225
|
.object({ childWorkItemId: brandedStringSchema(workItemId), reason: z.string().min(1) })
|
|
225
226
|
.strict()),
|
|
227
|
+
[OrchestrationEventType.DelegationAttentionRequested]: workflowEnvelope(OrchestrationEventType.DelegationAttentionRequested, delegationAttentionRequestSchema),
|
|
228
|
+
[OrchestrationEventType.DelegationAttentionResponded]: workflowEnvelope(OrchestrationEventType.DelegationAttentionResponded, delegationAttentionResponseSchema),
|
|
229
|
+
[OrchestrationEventType.DelegationAttentionResolved]: workflowEnvelope(OrchestrationEventType.DelegationAttentionResolved, delegationAttentionResolvedSchema),
|
|
226
230
|
[OrchestrationEventType.DelegationFailed]: workflowEnvelope(OrchestrationEventType.DelegationFailed, z.object({ cohortId: z.string().min(1), reason: z.string().min(1) }).strict()),
|
|
227
231
|
[OrchestrationEventType.DelegationReconciliationFailed]: workflowEnvelope(OrchestrationEventType.DelegationReconciliationFailed, z.object({ cohortId: z.string().min(1), reason: z.string().min(1) }).strict()),
|
|
232
|
+
[OrchestrationEventType.DeliverySelectionRevised]: workflowEnvelope(OrchestrationEventType.DeliverySelectionRevised, deliverySelectionSchema),
|
|
233
|
+
[OrchestrationEventType.DeliveryCandidateRecorded]: workflowEnvelope(OrchestrationEventType.DeliveryCandidateRecorded, deliveryCandidateSchema),
|
|
234
|
+
[OrchestrationEventType.DeliveryQaRecorded]: workflowEnvelope(OrchestrationEventType.DeliveryQaRecorded, deliveryQaSchema),
|
|
228
235
|
[OrchestrationEventType.DelegationReserved]: workflowEnvelope(OrchestrationEventType.DelegationReserved, delegationReservationSchema),
|
|
229
236
|
[OrchestrationEventType.DelegationRegistered]: workflowEnvelope(OrchestrationEventType.DelegationRegistered, z.object({ cohortId: z.string().min(1) }).strict()),
|
|
230
237
|
[OrchestrationEventType.DelegationResultSelected]: workflowEnvelope(OrchestrationEventType.DelegationResultSelected, delegationResultSchema),
|
|
@@ -321,7 +328,15 @@ const eventSchemas = {
|
|
|
321
328
|
[OrchestrationEventType.RepeatCounted]: workflowEnvelope(OrchestrationEventType.RepeatCounted, z.object({ routeId: z.string().min(1), count: z.number().int().positive() }).strict()),
|
|
322
329
|
[OrchestrationEventType.RetryCounted]: workflowEnvelope(OrchestrationEventType.RetryCounted, z.object({ retryKey: z.string().min(1), count: z.number().int().positive() }).strict()),
|
|
323
330
|
[OrchestrationEventType.InstanceCompleted]: workflowEnvelope(OrchestrationEventType.InstanceCompleted, emptySchema),
|
|
324
|
-
[OrchestrationEventType.InstanceBlocked]: workflowEnvelope(OrchestrationEventType.InstanceBlocked, z
|
|
331
|
+
[OrchestrationEventType.InstanceBlocked]: workflowEnvelope(OrchestrationEventType.InstanceBlocked, z
|
|
332
|
+
.object({
|
|
333
|
+
reason: z.string(),
|
|
334
|
+
deliveryGate: z
|
|
335
|
+
.object({ retryStage: brandedStringSchema(stageName) })
|
|
336
|
+
.strict()
|
|
337
|
+
.optional(),
|
|
338
|
+
})
|
|
339
|
+
.strict()),
|
|
325
340
|
[OrchestrationEventType.OperatorRetryRequested]: workflowEnvelope(OrchestrationEventType.OperatorRetryRequested, z
|
|
326
341
|
.object({
|
|
327
342
|
activationId: brandedStringSchema(activationId),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createEventData } from '@atolis-hq/eventing';
|
|
2
2
|
import { OrchestrationEventType, } from './events.js';
|
|
3
3
|
// Exhaustive dispatch preserves the closed event-to-payload mapping.
|
|
4
|
-
// eslint-disable-next-line complexity
|
|
4
|
+
// eslint-disable-next-line complexity, max-lines-per-function
|
|
5
5
|
export function createOrchestrationEventData(input) {
|
|
6
6
|
switch (input.eventType) {
|
|
7
7
|
case OrchestrationEventType.DelegationInputsResolved:
|
|
@@ -12,6 +12,18 @@ export function createOrchestrationEventData(input) {
|
|
|
12
12
|
case OrchestrationEventType.DelegationFailed:
|
|
13
13
|
case OrchestrationEventType.DelegationReconciliationFailed:
|
|
14
14
|
return createEventData(input);
|
|
15
|
+
case OrchestrationEventType.DelegationAttentionRequested:
|
|
16
|
+
return createEventData(input);
|
|
17
|
+
case OrchestrationEventType.DelegationAttentionResponded:
|
|
18
|
+
return createEventData(input);
|
|
19
|
+
case OrchestrationEventType.DelegationAttentionResolved:
|
|
20
|
+
return createEventData(input);
|
|
21
|
+
case OrchestrationEventType.DeliverySelectionRevised:
|
|
22
|
+
return createEventData(input);
|
|
23
|
+
case OrchestrationEventType.DeliveryCandidateRecorded:
|
|
24
|
+
return createEventData(input);
|
|
25
|
+
case OrchestrationEventType.DeliveryQaRecorded:
|
|
26
|
+
return createEventData(input);
|
|
15
27
|
case OrchestrationEventType.DelegationReserved:
|
|
16
28
|
return createEventData(input);
|
|
17
29
|
case OrchestrationEventType.DelegationRegistered:
|