@automate.ax/api-contract 0.131.2 → 0.133.0
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/index.d.ts +61 -1
- package/dist/runtime.d.ts +122 -2
- package/dist/runtime.js +29 -0
- package/package.json +3 -3
- package/src/runtime.ts +36 -0
package/dist/index.d.ts
CHANGED
|
@@ -6213,6 +6213,35 @@ export declare const contract: {
|
|
|
6213
6213
|
}>;
|
|
6214
6214
|
ttl: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber]>>;
|
|
6215
6215
|
until: import("zod").ZodOptional<import("zod").ZodDate>;
|
|
6216
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
6217
|
+
actionDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
|
|
6218
|
+
eventDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
|
|
6219
|
+
scopePath: import("zod").ZodArray<import("zod").ZodNumber>;
|
|
6220
|
+
signalDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
|
|
6221
|
+
slot: import("zod").ZodNumber;
|
|
6222
|
+
derivation: import("zod").ZodNullable<import("zod").ZodObject<{
|
|
6223
|
+
nodes: import("zod").ZodArray<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
6224
|
+
id: import("zod").ZodString;
|
|
6225
|
+
source: import("zod").ZodEnum<{
|
|
6226
|
+
action: "action";
|
|
6227
|
+
event: "event";
|
|
6228
|
+
signal: "signal";
|
|
6229
|
+
}>;
|
|
6230
|
+
type: import("zod").ZodLiteral<"source">;
|
|
6231
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
6232
|
+
inputs: import("zod").ZodArray<import("zod").ZodNumber>;
|
|
6233
|
+
property: import("zod").ZodString;
|
|
6234
|
+
type: import("zod").ZodLiteral<"property">;
|
|
6235
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
6236
|
+
inputs: import("zod").ZodArray<import("zod").ZodNumber>;
|
|
6237
|
+
type: import("zod").ZodLiteral<"transform">;
|
|
6238
|
+
}, import("zod/v4/core").$strip>], "type">>;
|
|
6239
|
+
roots: import("zod").ZodArray<import("zod").ZodNumber>;
|
|
6240
|
+
}, import("zod/v4/core").$strip>>;
|
|
6241
|
+
inputOrigins: import("zod").ZodArray<import("zod").ZodArray<import("zod").ZodString>>;
|
|
6242
|
+
outcomeSeq: import("zod").ZodNumber;
|
|
6243
|
+
policy: import("zod").ZodLiteral<"merge">;
|
|
6244
|
+
selectedIndex: import("zod").ZodNumber;
|
|
6216
6245
|
}, import("zod/v4/core").$strip>, import("zod").ZodUnion<readonly [import("zod").ZodObject<{
|
|
6217
6246
|
actionDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
|
|
6218
6247
|
eventDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
|
|
@@ -6319,7 +6348,38 @@ export declare const contract: {
|
|
|
6319
6348
|
scopeOrigins: import("zod").ZodArray<import("zod").ZodString>;
|
|
6320
6349
|
selectedIndex: import("zod").ZodNumber;
|
|
6321
6350
|
status: import("zod").ZodLiteral<"succeeded">;
|
|
6322
|
-
}, import("zod/v4/core").$strip>]
|
|
6351
|
+
}, import("zod/v4/core").$strip>]>, import("zod").ZodObject<{
|
|
6352
|
+
actionDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
|
|
6353
|
+
eventDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
|
|
6354
|
+
scopePath: import("zod").ZodArray<import("zod").ZodNumber>;
|
|
6355
|
+
signalDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
|
|
6356
|
+
slot: import("zod").ZodNumber;
|
|
6357
|
+
derivation: import("zod").ZodNullable<import("zod").ZodObject<{
|
|
6358
|
+
nodes: import("zod").ZodArray<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
6359
|
+
id: import("zod").ZodString;
|
|
6360
|
+
source: import("zod").ZodEnum<{
|
|
6361
|
+
action: "action";
|
|
6362
|
+
event: "event";
|
|
6363
|
+
signal: "signal";
|
|
6364
|
+
}>;
|
|
6365
|
+
type: import("zod").ZodLiteral<"source">;
|
|
6366
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
6367
|
+
inputs: import("zod").ZodArray<import("zod").ZodNumber>;
|
|
6368
|
+
property: import("zod").ZodString;
|
|
6369
|
+
type: import("zod").ZodLiteral<"property">;
|
|
6370
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
6371
|
+
inputs: import("zod").ZodArray<import("zod").ZodNumber>;
|
|
6372
|
+
type: import("zod").ZodLiteral<"transform">;
|
|
6373
|
+
}, import("zod/v4/core").$strip>], "type">>;
|
|
6374
|
+
roots: import("zod").ZodArray<import("zod").ZodNumber>;
|
|
6375
|
+
}, import("zod/v4/core").$strip>>;
|
|
6376
|
+
key: import("zod").ZodCustom<import("@automate.ax/codec/rpc").CodecEnvelope, import("@automate.ax/codec/rpc").CodecEnvelope>;
|
|
6377
|
+
outcomeSeq: import("zod").ZodNumber;
|
|
6378
|
+
policy: import("zod").ZodLiteral<"serialize">;
|
|
6379
|
+
releaseScopePath: import("zod").ZodArray<import("zod").ZodNumber>;
|
|
6380
|
+
releaseSlot: import("zod").ZodNumber;
|
|
6381
|
+
sourceOrigins: import("zod").ZodArray<import("zod").ZodString>;
|
|
6382
|
+
}, import("zod/v4/core").$strip>]>>;
|
|
6323
6383
|
observedFrontier: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
6324
6384
|
boundaryCount: import("zod").ZodNumber;
|
|
6325
6385
|
outcomeSeq: import("zod").ZodNumber;
|
package/dist/runtime.d.ts
CHANGED
|
@@ -227,6 +227,35 @@ declare const COORDINATION_OFFER_SCHEMA: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
227
227
|
}>;
|
|
228
228
|
ttl: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
229
229
|
until: z.ZodOptional<z.ZodDate>;
|
|
230
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
231
|
+
actionDependencyIds: z.ZodArray<z.ZodString>;
|
|
232
|
+
eventDependencyIds: z.ZodArray<z.ZodString>;
|
|
233
|
+
scopePath: z.ZodArray<z.ZodNumber>;
|
|
234
|
+
signalDependencyIds: z.ZodArray<z.ZodString>;
|
|
235
|
+
slot: z.ZodNumber;
|
|
236
|
+
derivation: z.ZodNullable<z.ZodObject<{
|
|
237
|
+
nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
238
|
+
id: z.ZodString;
|
|
239
|
+
source: z.ZodEnum<{
|
|
240
|
+
action: "action";
|
|
241
|
+
event: "event";
|
|
242
|
+
signal: "signal";
|
|
243
|
+
}>;
|
|
244
|
+
type: z.ZodLiteral<"source">;
|
|
245
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
246
|
+
inputs: z.ZodArray<z.ZodNumber>;
|
|
247
|
+
property: z.ZodString;
|
|
248
|
+
type: z.ZodLiteral<"property">;
|
|
249
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
250
|
+
inputs: z.ZodArray<z.ZodNumber>;
|
|
251
|
+
type: z.ZodLiteral<"transform">;
|
|
252
|
+
}, z.core.$strip>], "type">>;
|
|
253
|
+
roots: z.ZodArray<z.ZodNumber>;
|
|
254
|
+
}, z.core.$strip>>;
|
|
255
|
+
inputOrigins: z.ZodArray<z.ZodArray<z.ZodString>>;
|
|
256
|
+
outcomeSeq: z.ZodNumber;
|
|
257
|
+
policy: z.ZodLiteral<"merge">;
|
|
258
|
+
selectedIndex: z.ZodNumber;
|
|
230
259
|
}, z.core.$strip>, z.ZodUnion<readonly [z.ZodObject<{
|
|
231
260
|
actionDependencyIds: z.ZodArray<z.ZodString>;
|
|
232
261
|
eventDependencyIds: z.ZodArray<z.ZodString>;
|
|
@@ -333,7 +362,38 @@ declare const COORDINATION_OFFER_SCHEMA: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
333
362
|
scopeOrigins: z.ZodArray<z.ZodString>;
|
|
334
363
|
selectedIndex: z.ZodNumber;
|
|
335
364
|
status: z.ZodLiteral<"succeeded">;
|
|
336
|
-
}, z.core.$strip>]
|
|
365
|
+
}, z.core.$strip>]>, z.ZodObject<{
|
|
366
|
+
actionDependencyIds: z.ZodArray<z.ZodString>;
|
|
367
|
+
eventDependencyIds: z.ZodArray<z.ZodString>;
|
|
368
|
+
scopePath: z.ZodArray<z.ZodNumber>;
|
|
369
|
+
signalDependencyIds: z.ZodArray<z.ZodString>;
|
|
370
|
+
slot: z.ZodNumber;
|
|
371
|
+
derivation: z.ZodNullable<z.ZodObject<{
|
|
372
|
+
nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
373
|
+
id: z.ZodString;
|
|
374
|
+
source: z.ZodEnum<{
|
|
375
|
+
action: "action";
|
|
376
|
+
event: "event";
|
|
377
|
+
signal: "signal";
|
|
378
|
+
}>;
|
|
379
|
+
type: z.ZodLiteral<"source">;
|
|
380
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
381
|
+
inputs: z.ZodArray<z.ZodNumber>;
|
|
382
|
+
property: z.ZodString;
|
|
383
|
+
type: z.ZodLiteral<"property">;
|
|
384
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
385
|
+
inputs: z.ZodArray<z.ZodNumber>;
|
|
386
|
+
type: z.ZodLiteral<"transform">;
|
|
387
|
+
}, z.core.$strip>], "type">>;
|
|
388
|
+
roots: z.ZodArray<z.ZodNumber>;
|
|
389
|
+
}, z.core.$strip>>;
|
|
390
|
+
key: z.ZodOptional<z.ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>;
|
|
391
|
+
outcomeSeq: z.ZodNumber;
|
|
392
|
+
policy: z.ZodLiteral<"serialize">;
|
|
393
|
+
releaseScopePath: z.ZodArray<z.ZodNumber>;
|
|
394
|
+
releaseSlot: z.ZodNumber;
|
|
395
|
+
sourceOrigins: z.ZodArray<z.ZodString>;
|
|
396
|
+
}, z.core.$strip>]>;
|
|
337
397
|
/** One validated durable coordination offer sent by the automation runtime. */
|
|
338
398
|
export type RuntimeCoordinationOffer = z.output<typeof COORDINATION_OFFER_SCHEMA>;
|
|
339
399
|
declare const RUNTIME_VALUE_CONTEXT_SCHEMA: z.ZodObject<{
|
|
@@ -1463,6 +1523,35 @@ export declare const runtimeContract: {
|
|
|
1463
1523
|
}>;
|
|
1464
1524
|
ttl: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
1465
1525
|
until: z.ZodOptional<z.ZodDate>;
|
|
1526
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1527
|
+
actionDependencyIds: z.ZodArray<z.ZodString>;
|
|
1528
|
+
eventDependencyIds: z.ZodArray<z.ZodString>;
|
|
1529
|
+
scopePath: z.ZodArray<z.ZodNumber>;
|
|
1530
|
+
signalDependencyIds: z.ZodArray<z.ZodString>;
|
|
1531
|
+
slot: z.ZodNumber;
|
|
1532
|
+
derivation: z.ZodNullable<z.ZodObject<{
|
|
1533
|
+
nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1534
|
+
id: z.ZodString;
|
|
1535
|
+
source: z.ZodEnum<{
|
|
1536
|
+
action: "action";
|
|
1537
|
+
event: "event";
|
|
1538
|
+
signal: "signal";
|
|
1539
|
+
}>;
|
|
1540
|
+
type: z.ZodLiteral<"source">;
|
|
1541
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1542
|
+
inputs: z.ZodArray<z.ZodNumber>;
|
|
1543
|
+
property: z.ZodString;
|
|
1544
|
+
type: z.ZodLiteral<"property">;
|
|
1545
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1546
|
+
inputs: z.ZodArray<z.ZodNumber>;
|
|
1547
|
+
type: z.ZodLiteral<"transform">;
|
|
1548
|
+
}, z.core.$strip>], "type">>;
|
|
1549
|
+
roots: z.ZodArray<z.ZodNumber>;
|
|
1550
|
+
}, z.core.$strip>>;
|
|
1551
|
+
inputOrigins: z.ZodArray<z.ZodArray<z.ZodString>>;
|
|
1552
|
+
outcomeSeq: z.ZodNumber;
|
|
1553
|
+
policy: z.ZodLiteral<"merge">;
|
|
1554
|
+
selectedIndex: z.ZodNumber;
|
|
1466
1555
|
}, z.core.$strip>, z.ZodUnion<readonly [z.ZodObject<{
|
|
1467
1556
|
actionDependencyIds: z.ZodArray<z.ZodString>;
|
|
1468
1557
|
eventDependencyIds: z.ZodArray<z.ZodString>;
|
|
@@ -1569,7 +1658,38 @@ export declare const runtimeContract: {
|
|
|
1569
1658
|
scopeOrigins: z.ZodArray<z.ZodString>;
|
|
1570
1659
|
selectedIndex: z.ZodNumber;
|
|
1571
1660
|
status: z.ZodLiteral<"succeeded">;
|
|
1572
|
-
}, z.core.$strip>]
|
|
1661
|
+
}, z.core.$strip>]>, z.ZodObject<{
|
|
1662
|
+
actionDependencyIds: z.ZodArray<z.ZodString>;
|
|
1663
|
+
eventDependencyIds: z.ZodArray<z.ZodString>;
|
|
1664
|
+
scopePath: z.ZodArray<z.ZodNumber>;
|
|
1665
|
+
signalDependencyIds: z.ZodArray<z.ZodString>;
|
|
1666
|
+
slot: z.ZodNumber;
|
|
1667
|
+
derivation: z.ZodNullable<z.ZodObject<{
|
|
1668
|
+
nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1669
|
+
id: z.ZodString;
|
|
1670
|
+
source: z.ZodEnum<{
|
|
1671
|
+
action: "action";
|
|
1672
|
+
event: "event";
|
|
1673
|
+
signal: "signal";
|
|
1674
|
+
}>;
|
|
1675
|
+
type: z.ZodLiteral<"source">;
|
|
1676
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1677
|
+
inputs: z.ZodArray<z.ZodNumber>;
|
|
1678
|
+
property: z.ZodString;
|
|
1679
|
+
type: z.ZodLiteral<"property">;
|
|
1680
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1681
|
+
inputs: z.ZodArray<z.ZodNumber>;
|
|
1682
|
+
type: z.ZodLiteral<"transform">;
|
|
1683
|
+
}, z.core.$strip>], "type">>;
|
|
1684
|
+
roots: z.ZodArray<z.ZodNumber>;
|
|
1685
|
+
}, z.core.$strip>>;
|
|
1686
|
+
key: z.ZodCustom<import("@automate.ax/codec/rpc").CodecEnvelope, import("@automate.ax/codec/rpc").CodecEnvelope>;
|
|
1687
|
+
outcomeSeq: z.ZodNumber;
|
|
1688
|
+
policy: z.ZodLiteral<"serialize">;
|
|
1689
|
+
releaseScopePath: z.ZodArray<z.ZodNumber>;
|
|
1690
|
+
releaseSlot: z.ZodNumber;
|
|
1691
|
+
sourceOrigins: z.ZodArray<z.ZodString>;
|
|
1692
|
+
}, z.core.$strip>]>>;
|
|
1573
1693
|
observedFrontier: z.ZodOptional<z.ZodObject<{
|
|
1574
1694
|
boundaryCount: z.ZodNumber;
|
|
1575
1695
|
outcomeSeq: z.ZodNumber;
|
package/dist/runtime.js
CHANGED
|
@@ -235,6 +235,13 @@ const CORRELATION_STREAM_ORIGINS_SCHEMA = z
|
|
|
235
235
|
.min(1)
|
|
236
236
|
.array()
|
|
237
237
|
.min(2);
|
|
238
|
+
const MERGE_INPUT_ORIGINS_SCHEMA = z
|
|
239
|
+
.string()
|
|
240
|
+
.min(1)
|
|
241
|
+
.array()
|
|
242
|
+
.min(1)
|
|
243
|
+
.array()
|
|
244
|
+
.min(2);
|
|
238
245
|
const createCorrelationOfferSchema = (keySchema) => SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
|
|
239
246
|
key: keySchema,
|
|
240
247
|
ordered: z.boolean(),
|
|
@@ -252,6 +259,23 @@ const createCorrelationOfferSchema = (keySchema) => SIGNAL_INVOCATION_DEPENDENCI
|
|
|
252
259
|
});
|
|
253
260
|
}
|
|
254
261
|
});
|
|
262
|
+
const MERGE_OFFER_SCHEMA = SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
|
|
263
|
+
inputOrigins: MERGE_INPUT_ORIGINS_SCHEMA,
|
|
264
|
+
outcomeSeq: OUTCOME_SEQUENCE_SCHEMA,
|
|
265
|
+
policy: z.literal("merge"),
|
|
266
|
+
selectedIndex: z.number().int().nonnegative(),
|
|
267
|
+
}).refine((offer) => offer.selectedIndex < offer.inputOrigins.length, {
|
|
268
|
+
message: "Merge input must identify a declared input.",
|
|
269
|
+
path: ["selectedIndex"],
|
|
270
|
+
});
|
|
271
|
+
const createSerializationOfferSchema = (keySchema) => SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
|
|
272
|
+
key: keySchema,
|
|
273
|
+
outcomeSeq: OUTCOME_SEQUENCE_SCHEMA,
|
|
274
|
+
policy: z.literal("serialize"),
|
|
275
|
+
releaseScopePath: HOOK_SCOPE_PATH_SCHEMA,
|
|
276
|
+
releaseSlot: z.number().int().nonnegative(),
|
|
277
|
+
sourceOrigins: z.string().min(1).array(),
|
|
278
|
+
});
|
|
255
279
|
const createCollectionOfferSchema = (keySchema) => SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
|
|
256
280
|
count: z.number().int().positive(),
|
|
257
281
|
key: keySchema,
|
|
@@ -325,6 +349,7 @@ const createFunnelOfferSchema = (keySchema) => SIGNAL_INVOCATION_DEPENDENCIES_SC
|
|
|
325
349
|
const COLLECTION_OFFER_SCHEMA = createCollectionOfferSchema(encodableSchema);
|
|
326
350
|
const CORRELATION_OFFER_SCHEMA = createCorrelationOfferSchema(encodableSchema);
|
|
327
351
|
const FUNNEL_OFFER_SCHEMA = createFunnelOfferSchema(encodableSchema);
|
|
352
|
+
const SERIALIZATION_OFFER_SCHEMA = createSerializationOfferSchema(encodableSchema);
|
|
328
353
|
const RACE_OFFER_BASE_SCHEMA = SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
|
|
329
354
|
cohortActionDependencyIds: z.string().array(),
|
|
330
355
|
cohortEventDependencyIds: z.string().array(),
|
|
@@ -354,14 +379,18 @@ const COORDINATION_OFFER_SCHEMA = z.union([
|
|
|
354
379
|
CORRELATION_OFFER_SCHEMA,
|
|
355
380
|
FANOUT_OFFER_SCHEMA,
|
|
356
381
|
FUNNEL_OFFER_SCHEMA,
|
|
382
|
+
MERGE_OFFER_SCHEMA,
|
|
357
383
|
RACE_OFFER_SCHEMA,
|
|
384
|
+
SERIALIZATION_OFFER_SCHEMA,
|
|
358
385
|
]);
|
|
359
386
|
const COORDINATION_OFFER_TRANSPORT_SCHEMA = z.union([
|
|
360
387
|
createCollectionOfferSchema(codecEnvelopeSchema),
|
|
361
388
|
createCorrelationOfferSchema(codecEnvelopeSchema),
|
|
362
389
|
FANOUT_OFFER_SCHEMA,
|
|
363
390
|
createFunnelOfferSchema(codecEnvelopeSchema),
|
|
391
|
+
MERGE_OFFER_SCHEMA,
|
|
364
392
|
RACE_OFFER_SCHEMA,
|
|
393
|
+
createSerializationOfferSchema(codecEnvelopeSchema),
|
|
365
394
|
]);
|
|
366
395
|
const SIGNAL_INVOCATION_SCHEMA = z.union([
|
|
367
396
|
SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automate.ax/api-contract",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.133.0",
|
|
4
4
|
"description": "Public oRPC contract for the Automate.ax API.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@ai-sdk/gateway": "4.0.46",
|
|
34
|
-
"@automate.ax/codec": "0.
|
|
35
|
-
"@automate.ax/integration-contracts": "0.
|
|
34
|
+
"@automate.ax/codec": "0.133.0",
|
|
35
|
+
"@automate.ax/integration-contracts": "0.133.0",
|
|
36
36
|
"@orpc/contract": "1.15.0",
|
|
37
37
|
"fast-json-stable-stringify": "^2.1.0",
|
|
38
38
|
"zod": "^4.3.6"
|
package/src/runtime.ts
CHANGED
|
@@ -286,6 +286,14 @@ const CORRELATION_STREAM_ORIGINS_SCHEMA = z
|
|
|
286
286
|
.array()
|
|
287
287
|
.min(2)
|
|
288
288
|
|
|
289
|
+
const MERGE_INPUT_ORIGINS_SCHEMA = z
|
|
290
|
+
.string()
|
|
291
|
+
.min(1)
|
|
292
|
+
.array()
|
|
293
|
+
.min(1)
|
|
294
|
+
.array()
|
|
295
|
+
.min(2)
|
|
296
|
+
|
|
289
297
|
const createCorrelationOfferSchema = <TKeySchema extends z.ZodType>(
|
|
290
298
|
keySchema: TKeySchema,
|
|
291
299
|
) =>
|
|
@@ -307,6 +315,28 @@ const createCorrelationOfferSchema = <TKeySchema extends z.ZodType>(
|
|
|
307
315
|
}
|
|
308
316
|
})
|
|
309
317
|
|
|
318
|
+
const MERGE_OFFER_SCHEMA = SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
|
|
319
|
+
inputOrigins: MERGE_INPUT_ORIGINS_SCHEMA,
|
|
320
|
+
outcomeSeq: OUTCOME_SEQUENCE_SCHEMA,
|
|
321
|
+
policy: z.literal("merge"),
|
|
322
|
+
selectedIndex: z.number().int().nonnegative(),
|
|
323
|
+
}).refine((offer) => offer.selectedIndex < offer.inputOrigins.length, {
|
|
324
|
+
message: "Merge input must identify a declared input.",
|
|
325
|
+
path: ["selectedIndex"],
|
|
326
|
+
})
|
|
327
|
+
|
|
328
|
+
const createSerializationOfferSchema = <TKeySchema extends z.ZodType>(
|
|
329
|
+
keySchema: TKeySchema,
|
|
330
|
+
) =>
|
|
331
|
+
SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
|
|
332
|
+
key: keySchema,
|
|
333
|
+
outcomeSeq: OUTCOME_SEQUENCE_SCHEMA,
|
|
334
|
+
policy: z.literal("serialize"),
|
|
335
|
+
releaseScopePath: HOOK_SCOPE_PATH_SCHEMA,
|
|
336
|
+
releaseSlot: z.number().int().nonnegative(),
|
|
337
|
+
sourceOrigins: z.string().min(1).array(),
|
|
338
|
+
})
|
|
339
|
+
|
|
310
340
|
const createCollectionOfferSchema = <TKeySchema extends z.ZodType>(
|
|
311
341
|
keySchema: TKeySchema,
|
|
312
342
|
) =>
|
|
@@ -397,6 +427,8 @@ const createFunnelOfferSchema = <TKeySchema extends z.ZodType>(
|
|
|
397
427
|
const COLLECTION_OFFER_SCHEMA = createCollectionOfferSchema(encodableSchema)
|
|
398
428
|
const CORRELATION_OFFER_SCHEMA = createCorrelationOfferSchema(encodableSchema)
|
|
399
429
|
const FUNNEL_OFFER_SCHEMA = createFunnelOfferSchema(encodableSchema)
|
|
430
|
+
const SERIALIZATION_OFFER_SCHEMA =
|
|
431
|
+
createSerializationOfferSchema(encodableSchema)
|
|
400
432
|
|
|
401
433
|
const RACE_OFFER_BASE_SCHEMA = SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
|
|
402
434
|
cohortActionDependencyIds: z.string().array(),
|
|
@@ -429,7 +461,9 @@ const COORDINATION_OFFER_SCHEMA = z.union([
|
|
|
429
461
|
CORRELATION_OFFER_SCHEMA,
|
|
430
462
|
FANOUT_OFFER_SCHEMA,
|
|
431
463
|
FUNNEL_OFFER_SCHEMA,
|
|
464
|
+
MERGE_OFFER_SCHEMA,
|
|
432
465
|
RACE_OFFER_SCHEMA,
|
|
466
|
+
SERIALIZATION_OFFER_SCHEMA,
|
|
433
467
|
])
|
|
434
468
|
|
|
435
469
|
const COORDINATION_OFFER_TRANSPORT_SCHEMA = z.union([
|
|
@@ -437,7 +471,9 @@ const COORDINATION_OFFER_TRANSPORT_SCHEMA = z.union([
|
|
|
437
471
|
createCorrelationOfferSchema(codecEnvelopeSchema),
|
|
438
472
|
FANOUT_OFFER_SCHEMA,
|
|
439
473
|
createFunnelOfferSchema(codecEnvelopeSchema),
|
|
474
|
+
MERGE_OFFER_SCHEMA,
|
|
440
475
|
RACE_OFFER_SCHEMA,
|
|
476
|
+
createSerializationOfferSchema(codecEnvelopeSchema),
|
|
441
477
|
])
|
|
442
478
|
|
|
443
479
|
/** One validated durable coordination offer sent by the automation runtime. */
|