@automate.ax/api-contract 0.138.0 → 0.139.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/deployment.d.ts +2 -2
- package/dist/index.d.ts +111 -5
- package/dist/runtime-protocol.d.ts +1 -1
- package/dist/runtime-protocol.js +1 -1
- package/dist/runtime.d.ts +212 -0
- package/dist/runtime.js +46 -0
- package/package.json +3 -3
- package/src/runtime-protocol.ts +1 -1
- package/src/runtime.ts +60 -0
package/dist/deployment.d.ts
CHANGED
|
@@ -113,7 +113,7 @@ export declare const deploymentContract: {
|
|
|
113
113
|
UNSUPPORTED_RUNTIME_PROTOCOL: {
|
|
114
114
|
readonly data: z.ZodObject<{
|
|
115
115
|
receivedVersion: z.ZodNullable<z.ZodNumber>;
|
|
116
|
-
supportedVersion: z.ZodLiteral<
|
|
116
|
+
supportedVersion: z.ZodLiteral<5>;
|
|
117
117
|
}, z.core.$strip>;
|
|
118
118
|
readonly message: "The automation bundle uses an unsupported runtime protocol.";
|
|
119
119
|
readonly status: 400;
|
|
@@ -289,7 +289,7 @@ export declare const deploymentContract: {
|
|
|
289
289
|
UNSUPPORTED_RUNTIME_PROTOCOL: {
|
|
290
290
|
readonly data: z.ZodObject<{
|
|
291
291
|
receivedVersion: z.ZodNullable<z.ZodNumber>;
|
|
292
|
-
supportedVersion: z.ZodLiteral<
|
|
292
|
+
supportedVersion: z.ZodLiteral<5>;
|
|
293
293
|
}, z.core.$strip>;
|
|
294
294
|
readonly message: "The automation bundle uses an unsupported runtime protocol.";
|
|
295
295
|
readonly status: 400;
|
package/dist/index.d.ts
CHANGED
|
@@ -754,7 +754,7 @@ export declare const publicContract: {
|
|
|
754
754
|
UNSUPPORTED_RUNTIME_PROTOCOL: {
|
|
755
755
|
readonly data: import("zod").ZodObject<{
|
|
756
756
|
receivedVersion: import("zod").ZodNullable<import("zod").ZodNumber>;
|
|
757
|
-
supportedVersion: import("zod").ZodLiteral<
|
|
757
|
+
supportedVersion: import("zod").ZodLiteral<5>;
|
|
758
758
|
}, import("zod/v4/core").$strip>;
|
|
759
759
|
readonly message: "The automation bundle uses an unsupported runtime protocol.";
|
|
760
760
|
readonly status: 400;
|
|
@@ -1167,7 +1167,7 @@ export declare const firstPartyContract: {
|
|
|
1167
1167
|
UNSUPPORTED_RUNTIME_PROTOCOL: {
|
|
1168
1168
|
readonly data: import("zod").ZodObject<{
|
|
1169
1169
|
receivedVersion: import("zod").ZodNullable<import("zod").ZodNumber>;
|
|
1170
|
-
supportedVersion: import("zod").ZodLiteral<
|
|
1170
|
+
supportedVersion: import("zod").ZodLiteral<5>;
|
|
1171
1171
|
}, import("zod/v4/core").$strip>;
|
|
1172
1172
|
readonly message: "The automation bundle uses an unsupported runtime protocol.";
|
|
1173
1173
|
readonly status: 400;
|
|
@@ -1343,7 +1343,7 @@ export declare const firstPartyContract: {
|
|
|
1343
1343
|
UNSUPPORTED_RUNTIME_PROTOCOL: {
|
|
1344
1344
|
readonly data: import("zod").ZodObject<{
|
|
1345
1345
|
receivedVersion: import("zod").ZodNullable<import("zod").ZodNumber>;
|
|
1346
|
-
supportedVersion: import("zod").ZodLiteral<
|
|
1346
|
+
supportedVersion: import("zod").ZodLiteral<5>;
|
|
1347
1347
|
}, import("zod/v4/core").$strip>;
|
|
1348
1348
|
readonly message: "The automation bundle uses an unsupported runtime protocol.";
|
|
1349
1349
|
readonly status: 400;
|
|
@@ -6138,6 +6138,16 @@ export declare const contract: {
|
|
|
6138
6138
|
roots: import("zod").ZodArray<import("zod").ZodNumber>;
|
|
6139
6139
|
}, import("zod/v4/core").$strip>>;
|
|
6140
6140
|
key: import("zod").ZodCustom<import("@automate.ax/codec/rpc").CodecEnvelope, import("@automate.ax/codec/rpc").CodecEnvelope>;
|
|
6141
|
+
inputPolicies: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
|
|
6142
|
+
consumption: import("zod").ZodEnum<{
|
|
6143
|
+
consume: "consume";
|
|
6144
|
+
retain: "retain";
|
|
6145
|
+
}>;
|
|
6146
|
+
selection: import("zod").ZodEnum<{
|
|
6147
|
+
oldest: "oldest";
|
|
6148
|
+
latest: "latest";
|
|
6149
|
+
}>;
|
|
6150
|
+
}, import("zod/v4/core").$strip>>>;
|
|
6141
6151
|
occurrenceTtl: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber]>>;
|
|
6142
6152
|
ordered: import("zod").ZodBoolean;
|
|
6143
6153
|
outcomeSeq: import("zod").ZodNumber;
|
|
@@ -6145,6 +6155,38 @@ export declare const contract: {
|
|
|
6145
6155
|
streamIndex: import("zod").ZodNumber;
|
|
6146
6156
|
streamOrigins: import("zod").ZodArray<import("zod").ZodArray<import("zod").ZodString>>;
|
|
6147
6157
|
ttl: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber]>>;
|
|
6158
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
6159
|
+
actionDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
|
|
6160
|
+
eventDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
|
|
6161
|
+
scopePath: import("zod").ZodArray<import("zod").ZodNumber>;
|
|
6162
|
+
signalDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
|
|
6163
|
+
slot: import("zod").ZodNumber;
|
|
6164
|
+
derivation: import("zod").ZodNullable<import("zod").ZodObject<{
|
|
6165
|
+
nodes: import("zod").ZodArray<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
6166
|
+
id: import("zod").ZodString;
|
|
6167
|
+
source: import("zod").ZodEnum<{
|
|
6168
|
+
action: "action";
|
|
6169
|
+
event: "event";
|
|
6170
|
+
signal: "signal";
|
|
6171
|
+
}>;
|
|
6172
|
+
type: import("zod").ZodLiteral<"source">;
|
|
6173
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
6174
|
+
inputs: import("zod").ZodArray<import("zod").ZodNumber>;
|
|
6175
|
+
property: import("zod").ZodString;
|
|
6176
|
+
type: import("zod").ZodLiteral<"property">;
|
|
6177
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
6178
|
+
inputs: import("zod").ZodArray<import("zod").ZodNumber>;
|
|
6179
|
+
type: import("zod").ZodLiteral<"transform">;
|
|
6180
|
+
}, import("zod/v4/core").$strip>], "type">>;
|
|
6181
|
+
roots: import("zod").ZodArray<import("zod").ZodNumber>;
|
|
6182
|
+
}, import("zod/v4/core").$strip>>;
|
|
6183
|
+
key: import("zod").ZodCustom<import("@automate.ax/codec/rpc").CodecEnvelope, import("@automate.ax/codec/rpc").CodecEnvelope>;
|
|
6184
|
+
limit: import("zod").ZodNumber;
|
|
6185
|
+
outcomeSeq: import("zod").ZodNumber;
|
|
6186
|
+
policy: import("zod").ZodLiteral<"concurrent">;
|
|
6187
|
+
releaseScopePath: import("zod").ZodArray<import("zod").ZodNumber>;
|
|
6188
|
+
releaseSlot: import("zod").ZodNumber;
|
|
6189
|
+
sourceOrigins: import("zod").ZodArray<import("zod").ZodString>;
|
|
6148
6190
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
6149
6191
|
actionDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
|
|
6150
6192
|
eventDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
|
|
@@ -6249,6 +6291,40 @@ export declare const contract: {
|
|
|
6249
6291
|
outcomeSeq: import("zod").ZodNumber;
|
|
6250
6292
|
policy: import("zod").ZodLiteral<"merge">;
|
|
6251
6293
|
selectedIndex: import("zod").ZodNumber;
|
|
6294
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
6295
|
+
actionDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
|
|
6296
|
+
eventDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
|
|
6297
|
+
scopePath: import("zod").ZodArray<import("zod").ZodNumber>;
|
|
6298
|
+
signalDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
|
|
6299
|
+
slot: import("zod").ZodNumber;
|
|
6300
|
+
derivation: import("zod").ZodNullable<import("zod").ZodObject<{
|
|
6301
|
+
nodes: import("zod").ZodArray<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
6302
|
+
id: import("zod").ZodString;
|
|
6303
|
+
source: import("zod").ZodEnum<{
|
|
6304
|
+
action: "action";
|
|
6305
|
+
event: "event";
|
|
6306
|
+
signal: "signal";
|
|
6307
|
+
}>;
|
|
6308
|
+
type: import("zod").ZodLiteral<"source">;
|
|
6309
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
6310
|
+
inputs: import("zod").ZodArray<import("zod").ZodNumber>;
|
|
6311
|
+
property: import("zod").ZodString;
|
|
6312
|
+
type: import("zod").ZodLiteral<"property">;
|
|
6313
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
6314
|
+
inputs: import("zod").ZodArray<import("zod").ZodNumber>;
|
|
6315
|
+
type: import("zod").ZodLiteral<"transform">;
|
|
6316
|
+
}, import("zod/v4/core").$strip>], "type">>;
|
|
6317
|
+
roots: import("zod").ZodArray<import("zod").ZodNumber>;
|
|
6318
|
+
}, import("zod/v4/core").$strip>>;
|
|
6319
|
+
interval: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber]>;
|
|
6320
|
+
key: import("zod").ZodCustom<import("@automate.ax/codec/rpc").CodecEnvelope, import("@automate.ax/codec/rpc").CodecEnvelope>;
|
|
6321
|
+
limit: import("zod").ZodNumber;
|
|
6322
|
+
outcomeSeq: import("zod").ZodNumber;
|
|
6323
|
+
overflow: import("zod").ZodEnum<{
|
|
6324
|
+
drop: "drop";
|
|
6325
|
+
wait: "wait";
|
|
6326
|
+
}>;
|
|
6327
|
+
policy: import("zod").ZodLiteral<"rateLimit">;
|
|
6252
6328
|
}, import("zod/v4/core").$strip>, import("zod").ZodUnion<readonly [import("zod").ZodObject<{
|
|
6253
6329
|
actionDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
|
|
6254
6330
|
eventDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
|
|
@@ -6386,6 +6462,36 @@ export declare const contract: {
|
|
|
6386
6462
|
releaseScopePath: import("zod").ZodArray<import("zod").ZodNumber>;
|
|
6387
6463
|
releaseSlot: import("zod").ZodNumber;
|
|
6388
6464
|
sourceOrigins: import("zod").ZodArray<import("zod").ZodString>;
|
|
6465
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
6466
|
+
actionDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
|
|
6467
|
+
eventDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
|
|
6468
|
+
scopePath: import("zod").ZodArray<import("zod").ZodNumber>;
|
|
6469
|
+
signalDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
|
|
6470
|
+
slot: import("zod").ZodNumber;
|
|
6471
|
+
derivation: import("zod").ZodNullable<import("zod").ZodObject<{
|
|
6472
|
+
nodes: import("zod").ZodArray<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
6473
|
+
id: import("zod").ZodString;
|
|
6474
|
+
source: import("zod").ZodEnum<{
|
|
6475
|
+
action: "action";
|
|
6476
|
+
event: "event";
|
|
6477
|
+
signal: "signal";
|
|
6478
|
+
}>;
|
|
6479
|
+
type: import("zod").ZodLiteral<"source">;
|
|
6480
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
6481
|
+
inputs: import("zod").ZodArray<import("zod").ZodNumber>;
|
|
6482
|
+
property: import("zod").ZodString;
|
|
6483
|
+
type: import("zod").ZodLiteral<"property">;
|
|
6484
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
6485
|
+
inputs: import("zod").ZodArray<import("zod").ZodNumber>;
|
|
6486
|
+
type: import("zod").ZodLiteral<"transform">;
|
|
6487
|
+
}, import("zod/v4/core").$strip>], "type">>;
|
|
6488
|
+
roots: import("zod").ZodArray<import("zod").ZodNumber>;
|
|
6489
|
+
}, import("zod/v4/core").$strip>>;
|
|
6490
|
+
count: import("zod").ZodNumber;
|
|
6491
|
+
key: import("zod").ZodCustom<import("@automate.ax/codec/rpc").CodecEnvelope, import("@automate.ax/codec/rpc").CodecEnvelope>;
|
|
6492
|
+
outcomeSeq: import("zod").ZodNumber;
|
|
6493
|
+
policy: import("zod").ZodLiteral<"take">;
|
|
6494
|
+
ttl: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber]>>;
|
|
6389
6495
|
}, import("zod/v4/core").$strip>]>>;
|
|
6390
6496
|
observedFrontier: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
6391
6497
|
boundaryCount: import("zod").ZodNumber;
|
|
@@ -7348,7 +7454,7 @@ export declare const contract: {
|
|
|
7348
7454
|
UNSUPPORTED_RUNTIME_PROTOCOL: {
|
|
7349
7455
|
readonly data: import("zod").ZodObject<{
|
|
7350
7456
|
receivedVersion: import("zod").ZodNullable<import("zod").ZodNumber>;
|
|
7351
|
-
supportedVersion: import("zod").ZodLiteral<
|
|
7457
|
+
supportedVersion: import("zod").ZodLiteral<5>;
|
|
7352
7458
|
}, import("zod/v4/core").$strip>;
|
|
7353
7459
|
readonly message: "The automation bundle uses an unsupported runtime protocol.";
|
|
7354
7460
|
readonly status: 400;
|
|
@@ -7524,7 +7630,7 @@ export declare const contract: {
|
|
|
7524
7630
|
UNSUPPORTED_RUNTIME_PROTOCOL: {
|
|
7525
7631
|
readonly data: import("zod").ZodObject<{
|
|
7526
7632
|
receivedVersion: import("zod").ZodNullable<import("zod").ZodNumber>;
|
|
7527
|
-
supportedVersion: import("zod").ZodLiteral<
|
|
7633
|
+
supportedVersion: import("zod").ZodLiteral<5>;
|
|
7528
7634
|
}, import("zod/v4/core").$strip>;
|
|
7529
7635
|
readonly message: "The automation bundle uses an unsupported runtime protocol.";
|
|
7530
7636
|
readonly status: 400;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Runtime protocol required by newly built automation bundles. */
|
|
2
|
-
export declare const AUTOMATION_RUNTIME_PROTOCOL_VERSION =
|
|
2
|
+
export declare const AUTOMATION_RUNTIME_PROTOCOL_VERSION = 5;
|
package/dist/runtime-protocol.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Runtime protocol required by newly built automation bundles. */
|
|
2
|
-
export const AUTOMATION_RUNTIME_PROTOCOL_VERSION =
|
|
2
|
+
export const AUTOMATION_RUNTIME_PROTOCOL_VERSION = 5;
|
package/dist/runtime.d.ts
CHANGED
|
@@ -142,6 +142,16 @@ declare const COORDINATION_OFFER_SCHEMA: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
142
142
|
roots: z.ZodArray<z.ZodNumber>;
|
|
143
143
|
}, z.core.$strip>>;
|
|
144
144
|
key: z.ZodOptional<z.ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>;
|
|
145
|
+
inputPolicies: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
146
|
+
consumption: z.ZodEnum<{
|
|
147
|
+
consume: "consume";
|
|
148
|
+
retain: "retain";
|
|
149
|
+
}>;
|
|
150
|
+
selection: z.ZodEnum<{
|
|
151
|
+
oldest: "oldest";
|
|
152
|
+
latest: "latest";
|
|
153
|
+
}>;
|
|
154
|
+
}, z.core.$strip>>>;
|
|
145
155
|
occurrenceTtl: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
146
156
|
ordered: z.ZodBoolean;
|
|
147
157
|
outcomeSeq: z.ZodNumber;
|
|
@@ -149,6 +159,38 @@ declare const COORDINATION_OFFER_SCHEMA: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
149
159
|
streamIndex: z.ZodNumber;
|
|
150
160
|
streamOrigins: z.ZodArray<z.ZodArray<z.ZodString>>;
|
|
151
161
|
ttl: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
162
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
163
|
+
actionDependencyIds: z.ZodArray<z.ZodString>;
|
|
164
|
+
eventDependencyIds: z.ZodArray<z.ZodString>;
|
|
165
|
+
scopePath: z.ZodArray<z.ZodNumber>;
|
|
166
|
+
signalDependencyIds: z.ZodArray<z.ZodString>;
|
|
167
|
+
slot: z.ZodNumber;
|
|
168
|
+
derivation: z.ZodNullable<z.ZodObject<{
|
|
169
|
+
nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
170
|
+
id: z.ZodString;
|
|
171
|
+
source: z.ZodEnum<{
|
|
172
|
+
action: "action";
|
|
173
|
+
event: "event";
|
|
174
|
+
signal: "signal";
|
|
175
|
+
}>;
|
|
176
|
+
type: z.ZodLiteral<"source">;
|
|
177
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
178
|
+
inputs: z.ZodArray<z.ZodNumber>;
|
|
179
|
+
property: z.ZodString;
|
|
180
|
+
type: z.ZodLiteral<"property">;
|
|
181
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
182
|
+
inputs: z.ZodArray<z.ZodNumber>;
|
|
183
|
+
type: z.ZodLiteral<"transform">;
|
|
184
|
+
}, z.core.$strip>], "type">>;
|
|
185
|
+
roots: z.ZodArray<z.ZodNumber>;
|
|
186
|
+
}, z.core.$strip>>;
|
|
187
|
+
key: z.ZodOptional<z.ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>;
|
|
188
|
+
limit: z.ZodNumber;
|
|
189
|
+
outcomeSeq: z.ZodNumber;
|
|
190
|
+
policy: z.ZodLiteral<"concurrent">;
|
|
191
|
+
releaseScopePath: z.ZodArray<z.ZodNumber>;
|
|
192
|
+
releaseSlot: z.ZodNumber;
|
|
193
|
+
sourceOrigins: z.ZodArray<z.ZodString>;
|
|
152
194
|
}, z.core.$strip>, z.ZodObject<{
|
|
153
195
|
actionDependencyIds: z.ZodArray<z.ZodString>;
|
|
154
196
|
eventDependencyIds: z.ZodArray<z.ZodString>;
|
|
@@ -253,6 +295,40 @@ declare const COORDINATION_OFFER_SCHEMA: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
253
295
|
outcomeSeq: z.ZodNumber;
|
|
254
296
|
policy: z.ZodLiteral<"merge">;
|
|
255
297
|
selectedIndex: z.ZodNumber;
|
|
298
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
299
|
+
actionDependencyIds: z.ZodArray<z.ZodString>;
|
|
300
|
+
eventDependencyIds: z.ZodArray<z.ZodString>;
|
|
301
|
+
scopePath: z.ZodArray<z.ZodNumber>;
|
|
302
|
+
signalDependencyIds: z.ZodArray<z.ZodString>;
|
|
303
|
+
slot: z.ZodNumber;
|
|
304
|
+
derivation: z.ZodNullable<z.ZodObject<{
|
|
305
|
+
nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
306
|
+
id: z.ZodString;
|
|
307
|
+
source: z.ZodEnum<{
|
|
308
|
+
action: "action";
|
|
309
|
+
event: "event";
|
|
310
|
+
signal: "signal";
|
|
311
|
+
}>;
|
|
312
|
+
type: z.ZodLiteral<"source">;
|
|
313
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
314
|
+
inputs: z.ZodArray<z.ZodNumber>;
|
|
315
|
+
property: z.ZodString;
|
|
316
|
+
type: z.ZodLiteral<"property">;
|
|
317
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
318
|
+
inputs: z.ZodArray<z.ZodNumber>;
|
|
319
|
+
type: z.ZodLiteral<"transform">;
|
|
320
|
+
}, z.core.$strip>], "type">>;
|
|
321
|
+
roots: z.ZodArray<z.ZodNumber>;
|
|
322
|
+
}, z.core.$strip>>;
|
|
323
|
+
interval: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
324
|
+
key: z.ZodOptional<z.ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>;
|
|
325
|
+
limit: z.ZodNumber;
|
|
326
|
+
outcomeSeq: z.ZodNumber;
|
|
327
|
+
overflow: z.ZodEnum<{
|
|
328
|
+
drop: "drop";
|
|
329
|
+
wait: "wait";
|
|
330
|
+
}>;
|
|
331
|
+
policy: z.ZodLiteral<"rateLimit">;
|
|
256
332
|
}, z.core.$strip>, z.ZodUnion<readonly [z.ZodObject<{
|
|
257
333
|
actionDependencyIds: z.ZodArray<z.ZodString>;
|
|
258
334
|
eventDependencyIds: z.ZodArray<z.ZodString>;
|
|
@@ -390,6 +466,36 @@ declare const COORDINATION_OFFER_SCHEMA: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
390
466
|
releaseScopePath: z.ZodArray<z.ZodNumber>;
|
|
391
467
|
releaseSlot: z.ZodNumber;
|
|
392
468
|
sourceOrigins: z.ZodArray<z.ZodString>;
|
|
469
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
470
|
+
actionDependencyIds: z.ZodArray<z.ZodString>;
|
|
471
|
+
eventDependencyIds: z.ZodArray<z.ZodString>;
|
|
472
|
+
scopePath: z.ZodArray<z.ZodNumber>;
|
|
473
|
+
signalDependencyIds: z.ZodArray<z.ZodString>;
|
|
474
|
+
slot: z.ZodNumber;
|
|
475
|
+
derivation: z.ZodNullable<z.ZodObject<{
|
|
476
|
+
nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
477
|
+
id: z.ZodString;
|
|
478
|
+
source: z.ZodEnum<{
|
|
479
|
+
action: "action";
|
|
480
|
+
event: "event";
|
|
481
|
+
signal: "signal";
|
|
482
|
+
}>;
|
|
483
|
+
type: z.ZodLiteral<"source">;
|
|
484
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
485
|
+
inputs: z.ZodArray<z.ZodNumber>;
|
|
486
|
+
property: z.ZodString;
|
|
487
|
+
type: z.ZodLiteral<"property">;
|
|
488
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
489
|
+
inputs: z.ZodArray<z.ZodNumber>;
|
|
490
|
+
type: z.ZodLiteral<"transform">;
|
|
491
|
+
}, z.core.$strip>], "type">>;
|
|
492
|
+
roots: z.ZodArray<z.ZodNumber>;
|
|
493
|
+
}, z.core.$strip>>;
|
|
494
|
+
count: z.ZodNumber;
|
|
495
|
+
key: z.ZodOptional<z.ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>;
|
|
496
|
+
outcomeSeq: z.ZodNumber;
|
|
497
|
+
policy: z.ZodLiteral<"take">;
|
|
498
|
+
ttl: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
393
499
|
}, z.core.$strip>]>;
|
|
394
500
|
/** One validated durable coordination offer sent by the automation runtime. */
|
|
395
501
|
export type RuntimeCoordinationOffer = z.output<typeof COORDINATION_OFFER_SCHEMA>;
|
|
@@ -1440,6 +1546,16 @@ export declare const runtimeContract: {
|
|
|
1440
1546
|
roots: z.ZodArray<z.ZodNumber>;
|
|
1441
1547
|
}, z.core.$strip>>;
|
|
1442
1548
|
key: z.ZodCustom<import("@automate.ax/codec/rpc").CodecEnvelope, import("@automate.ax/codec/rpc").CodecEnvelope>;
|
|
1549
|
+
inputPolicies: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1550
|
+
consumption: z.ZodEnum<{
|
|
1551
|
+
consume: "consume";
|
|
1552
|
+
retain: "retain";
|
|
1553
|
+
}>;
|
|
1554
|
+
selection: z.ZodEnum<{
|
|
1555
|
+
oldest: "oldest";
|
|
1556
|
+
latest: "latest";
|
|
1557
|
+
}>;
|
|
1558
|
+
}, z.core.$strip>>>;
|
|
1443
1559
|
occurrenceTtl: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
1444
1560
|
ordered: z.ZodBoolean;
|
|
1445
1561
|
outcomeSeq: z.ZodNumber;
|
|
@@ -1447,6 +1563,38 @@ export declare const runtimeContract: {
|
|
|
1447
1563
|
streamIndex: z.ZodNumber;
|
|
1448
1564
|
streamOrigins: z.ZodArray<z.ZodArray<z.ZodString>>;
|
|
1449
1565
|
ttl: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
1566
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1567
|
+
actionDependencyIds: z.ZodArray<z.ZodString>;
|
|
1568
|
+
eventDependencyIds: z.ZodArray<z.ZodString>;
|
|
1569
|
+
scopePath: z.ZodArray<z.ZodNumber>;
|
|
1570
|
+
signalDependencyIds: z.ZodArray<z.ZodString>;
|
|
1571
|
+
slot: z.ZodNumber;
|
|
1572
|
+
derivation: z.ZodNullable<z.ZodObject<{
|
|
1573
|
+
nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1574
|
+
id: z.ZodString;
|
|
1575
|
+
source: z.ZodEnum<{
|
|
1576
|
+
action: "action";
|
|
1577
|
+
event: "event";
|
|
1578
|
+
signal: "signal";
|
|
1579
|
+
}>;
|
|
1580
|
+
type: z.ZodLiteral<"source">;
|
|
1581
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1582
|
+
inputs: z.ZodArray<z.ZodNumber>;
|
|
1583
|
+
property: z.ZodString;
|
|
1584
|
+
type: z.ZodLiteral<"property">;
|
|
1585
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1586
|
+
inputs: z.ZodArray<z.ZodNumber>;
|
|
1587
|
+
type: z.ZodLiteral<"transform">;
|
|
1588
|
+
}, z.core.$strip>], "type">>;
|
|
1589
|
+
roots: z.ZodArray<z.ZodNumber>;
|
|
1590
|
+
}, z.core.$strip>>;
|
|
1591
|
+
key: z.ZodCustom<import("@automate.ax/codec/rpc").CodecEnvelope, import("@automate.ax/codec/rpc").CodecEnvelope>;
|
|
1592
|
+
limit: z.ZodNumber;
|
|
1593
|
+
outcomeSeq: z.ZodNumber;
|
|
1594
|
+
policy: z.ZodLiteral<"concurrent">;
|
|
1595
|
+
releaseScopePath: z.ZodArray<z.ZodNumber>;
|
|
1596
|
+
releaseSlot: z.ZodNumber;
|
|
1597
|
+
sourceOrigins: z.ZodArray<z.ZodString>;
|
|
1450
1598
|
}, z.core.$strip>, z.ZodObject<{
|
|
1451
1599
|
actionDependencyIds: z.ZodArray<z.ZodString>;
|
|
1452
1600
|
eventDependencyIds: z.ZodArray<z.ZodString>;
|
|
@@ -1551,6 +1699,40 @@ export declare const runtimeContract: {
|
|
|
1551
1699
|
outcomeSeq: z.ZodNumber;
|
|
1552
1700
|
policy: z.ZodLiteral<"merge">;
|
|
1553
1701
|
selectedIndex: z.ZodNumber;
|
|
1702
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1703
|
+
actionDependencyIds: z.ZodArray<z.ZodString>;
|
|
1704
|
+
eventDependencyIds: z.ZodArray<z.ZodString>;
|
|
1705
|
+
scopePath: z.ZodArray<z.ZodNumber>;
|
|
1706
|
+
signalDependencyIds: z.ZodArray<z.ZodString>;
|
|
1707
|
+
slot: z.ZodNumber;
|
|
1708
|
+
derivation: z.ZodNullable<z.ZodObject<{
|
|
1709
|
+
nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1710
|
+
id: z.ZodString;
|
|
1711
|
+
source: z.ZodEnum<{
|
|
1712
|
+
action: "action";
|
|
1713
|
+
event: "event";
|
|
1714
|
+
signal: "signal";
|
|
1715
|
+
}>;
|
|
1716
|
+
type: z.ZodLiteral<"source">;
|
|
1717
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1718
|
+
inputs: z.ZodArray<z.ZodNumber>;
|
|
1719
|
+
property: z.ZodString;
|
|
1720
|
+
type: z.ZodLiteral<"property">;
|
|
1721
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1722
|
+
inputs: z.ZodArray<z.ZodNumber>;
|
|
1723
|
+
type: z.ZodLiteral<"transform">;
|
|
1724
|
+
}, z.core.$strip>], "type">>;
|
|
1725
|
+
roots: z.ZodArray<z.ZodNumber>;
|
|
1726
|
+
}, z.core.$strip>>;
|
|
1727
|
+
interval: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
1728
|
+
key: z.ZodCustom<import("@automate.ax/codec/rpc").CodecEnvelope, import("@automate.ax/codec/rpc").CodecEnvelope>;
|
|
1729
|
+
limit: z.ZodNumber;
|
|
1730
|
+
outcomeSeq: z.ZodNumber;
|
|
1731
|
+
overflow: z.ZodEnum<{
|
|
1732
|
+
drop: "drop";
|
|
1733
|
+
wait: "wait";
|
|
1734
|
+
}>;
|
|
1735
|
+
policy: z.ZodLiteral<"rateLimit">;
|
|
1554
1736
|
}, z.core.$strip>, z.ZodUnion<readonly [z.ZodObject<{
|
|
1555
1737
|
actionDependencyIds: z.ZodArray<z.ZodString>;
|
|
1556
1738
|
eventDependencyIds: z.ZodArray<z.ZodString>;
|
|
@@ -1688,6 +1870,36 @@ export declare const runtimeContract: {
|
|
|
1688
1870
|
releaseScopePath: z.ZodArray<z.ZodNumber>;
|
|
1689
1871
|
releaseSlot: z.ZodNumber;
|
|
1690
1872
|
sourceOrigins: z.ZodArray<z.ZodString>;
|
|
1873
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1874
|
+
actionDependencyIds: z.ZodArray<z.ZodString>;
|
|
1875
|
+
eventDependencyIds: z.ZodArray<z.ZodString>;
|
|
1876
|
+
scopePath: z.ZodArray<z.ZodNumber>;
|
|
1877
|
+
signalDependencyIds: z.ZodArray<z.ZodString>;
|
|
1878
|
+
slot: z.ZodNumber;
|
|
1879
|
+
derivation: z.ZodNullable<z.ZodObject<{
|
|
1880
|
+
nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1881
|
+
id: z.ZodString;
|
|
1882
|
+
source: z.ZodEnum<{
|
|
1883
|
+
action: "action";
|
|
1884
|
+
event: "event";
|
|
1885
|
+
signal: "signal";
|
|
1886
|
+
}>;
|
|
1887
|
+
type: z.ZodLiteral<"source">;
|
|
1888
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1889
|
+
inputs: z.ZodArray<z.ZodNumber>;
|
|
1890
|
+
property: z.ZodString;
|
|
1891
|
+
type: z.ZodLiteral<"property">;
|
|
1892
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1893
|
+
inputs: z.ZodArray<z.ZodNumber>;
|
|
1894
|
+
type: z.ZodLiteral<"transform">;
|
|
1895
|
+
}, z.core.$strip>], "type">>;
|
|
1896
|
+
roots: z.ZodArray<z.ZodNumber>;
|
|
1897
|
+
}, z.core.$strip>>;
|
|
1898
|
+
count: z.ZodNumber;
|
|
1899
|
+
key: z.ZodCustom<import("@automate.ax/codec/rpc").CodecEnvelope, import("@automate.ax/codec/rpc").CodecEnvelope>;
|
|
1900
|
+
outcomeSeq: z.ZodNumber;
|
|
1901
|
+
policy: z.ZodLiteral<"take">;
|
|
1902
|
+
ttl: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
1691
1903
|
}, z.core.$strip>]>>;
|
|
1692
1904
|
observedFrontier: z.ZodOptional<z.ZodObject<{
|
|
1693
1905
|
boundaryCount: z.ZodNumber;
|
package/dist/runtime.js
CHANGED
|
@@ -222,6 +222,10 @@ const CORRELATION_STREAM_ORIGINS_SCHEMA = z
|
|
|
222
222
|
.min(1)
|
|
223
223
|
.array()
|
|
224
224
|
.min(2);
|
|
225
|
+
const CORRELATION_INPUT_POLICY_SCHEMA = z.object({
|
|
226
|
+
consumption: z.enum(["consume", "retain"]),
|
|
227
|
+
selection: z.enum(["oldest", "latest"]),
|
|
228
|
+
});
|
|
225
229
|
const MERGE_INPUT_ORIGINS_SCHEMA = z
|
|
226
230
|
.string()
|
|
227
231
|
.min(1)
|
|
@@ -231,6 +235,7 @@ const MERGE_INPUT_ORIGINS_SCHEMA = z
|
|
|
231
235
|
.min(2);
|
|
232
236
|
const createCorrelationOfferSchema = (keySchema) => SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
|
|
233
237
|
key: keySchema,
|
|
238
|
+
inputPolicies: CORRELATION_INPUT_POLICY_SCHEMA.array().min(2).optional(),
|
|
234
239
|
occurrenceTtl: COORDINATION_DURATION_SCHEMA.optional(),
|
|
235
240
|
ordered: z.boolean(),
|
|
236
241
|
outcomeSeq: OUTCOME_SEQUENCE_SCHEMA,
|
|
@@ -247,6 +252,29 @@ const createCorrelationOfferSchema = (keySchema) => SIGNAL_INVOCATION_DEPENDENCI
|
|
|
247
252
|
path: ["streamIndex"],
|
|
248
253
|
});
|
|
249
254
|
}
|
|
255
|
+
if (entry.inputPolicies &&
|
|
256
|
+
entry.inputPolicies.length !== entry.streamOrigins.length) {
|
|
257
|
+
context.addIssue({
|
|
258
|
+
code: "custom",
|
|
259
|
+
message: "Correlation input policies must match the input streams.",
|
|
260
|
+
path: ["inputPolicies"],
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
});
|
|
264
|
+
const createTakeOfferSchema = (keySchema) => SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
|
|
265
|
+
count: z.number().int().positive(),
|
|
266
|
+
key: keySchema,
|
|
267
|
+
outcomeSeq: OUTCOME_SEQUENCE_SCHEMA,
|
|
268
|
+
policy: z.literal("take"),
|
|
269
|
+
ttl: COORDINATION_DURATION_SCHEMA.optional(),
|
|
270
|
+
});
|
|
271
|
+
const createRateLimitOfferSchema = (keySchema) => SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
|
|
272
|
+
interval: COORDINATION_DURATION_SCHEMA,
|
|
273
|
+
key: keySchema,
|
|
274
|
+
limit: z.number().int().positive(),
|
|
275
|
+
outcomeSeq: OUTCOME_SEQUENCE_SCHEMA,
|
|
276
|
+
overflow: z.enum(["drop", "wait"]),
|
|
277
|
+
policy: z.literal("rateLimit"),
|
|
250
278
|
});
|
|
251
279
|
const MERGE_OFFER_SCHEMA = SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
|
|
252
280
|
inputOrigins: MERGE_INPUT_ORIGINS_SCHEMA,
|
|
@@ -265,6 +293,15 @@ const createSerializationOfferSchema = (keySchema) => SIGNAL_INVOCATION_DEPENDEN
|
|
|
265
293
|
releaseSlot: z.number().int().nonnegative(),
|
|
266
294
|
sourceOrigins: z.string().min(1).array(),
|
|
267
295
|
});
|
|
296
|
+
const createConcurrencyOfferSchema = (keySchema) => SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
|
|
297
|
+
key: keySchema,
|
|
298
|
+
limit: z.number().int().positive(),
|
|
299
|
+
outcomeSeq: OUTCOME_SEQUENCE_SCHEMA,
|
|
300
|
+
policy: z.literal("concurrent"),
|
|
301
|
+
releaseScopePath: HOOK_SCOPE_PATH_SCHEMA,
|
|
302
|
+
releaseSlot: z.number().int().nonnegative(),
|
|
303
|
+
sourceOrigins: z.string().min(1).array(),
|
|
304
|
+
});
|
|
268
305
|
const createCollectionOfferSchema = (keySchema) => SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
|
|
269
306
|
count: z.number().int().positive(),
|
|
270
307
|
key: keySchema,
|
|
@@ -342,6 +379,9 @@ const COLLECTION_OFFER_SCHEMA = createCollectionOfferSchema(encodableSchema);
|
|
|
342
379
|
const CORRELATION_OFFER_SCHEMA = createCorrelationOfferSchema(encodableSchema);
|
|
343
380
|
const FUNNEL_OFFER_SCHEMA = createFunnelOfferSchema(encodableSchema);
|
|
344
381
|
const SERIALIZATION_OFFER_SCHEMA = createSerializationOfferSchema(encodableSchema);
|
|
382
|
+
const CONCURRENCY_OFFER_SCHEMA = createConcurrencyOfferSchema(encodableSchema);
|
|
383
|
+
const RATE_LIMIT_OFFER_SCHEMA = createRateLimitOfferSchema(encodableSchema);
|
|
384
|
+
const TAKE_OFFER_SCHEMA = createTakeOfferSchema(encodableSchema);
|
|
345
385
|
const RACE_OFFER_BASE_SCHEMA = SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
|
|
346
386
|
cohortActionDependencyIds: z.string().array(),
|
|
347
387
|
cohortEventDependencyIds: z.string().array(),
|
|
@@ -369,20 +409,26 @@ const RACE_OFFER_SCHEMA = z
|
|
|
369
409
|
const COORDINATION_OFFER_SCHEMA = z.union([
|
|
370
410
|
COLLECTION_OFFER_SCHEMA,
|
|
371
411
|
CORRELATION_OFFER_SCHEMA,
|
|
412
|
+
CONCURRENCY_OFFER_SCHEMA,
|
|
372
413
|
FANOUT_OFFER_SCHEMA,
|
|
373
414
|
FUNNEL_OFFER_SCHEMA,
|
|
374
415
|
MERGE_OFFER_SCHEMA,
|
|
416
|
+
RATE_LIMIT_OFFER_SCHEMA,
|
|
375
417
|
RACE_OFFER_SCHEMA,
|
|
376
418
|
SERIALIZATION_OFFER_SCHEMA,
|
|
419
|
+
TAKE_OFFER_SCHEMA,
|
|
377
420
|
]);
|
|
378
421
|
const COORDINATION_OFFER_TRANSPORT_SCHEMA = z.union([
|
|
379
422
|
createCollectionOfferSchema(codecEnvelopeSchema),
|
|
380
423
|
createCorrelationOfferSchema(codecEnvelopeSchema),
|
|
424
|
+
createConcurrencyOfferSchema(codecEnvelopeSchema),
|
|
381
425
|
FANOUT_OFFER_SCHEMA,
|
|
382
426
|
createFunnelOfferSchema(codecEnvelopeSchema),
|
|
383
427
|
MERGE_OFFER_SCHEMA,
|
|
428
|
+
createRateLimitOfferSchema(codecEnvelopeSchema),
|
|
384
429
|
RACE_OFFER_SCHEMA,
|
|
385
430
|
createSerializationOfferSchema(codecEnvelopeSchema),
|
|
431
|
+
createTakeOfferSchema(codecEnvelopeSchema),
|
|
386
432
|
]);
|
|
387
433
|
const SIGNAL_INVOCATION_SCHEMA = z.union([
|
|
388
434
|
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.139.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.139.0",
|
|
35
|
+
"@automate.ax/integration-contracts": "0.139.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-protocol.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Runtime protocol required by newly built automation bundles. */
|
|
2
|
-
export const AUTOMATION_RUNTIME_PROTOCOL_VERSION =
|
|
2
|
+
export const AUTOMATION_RUNTIME_PROTOCOL_VERSION = 5
|
package/src/runtime.ts
CHANGED
|
@@ -273,6 +273,10 @@ const CORRELATION_STREAM_ORIGINS_SCHEMA = z
|
|
|
273
273
|
.min(1)
|
|
274
274
|
.array()
|
|
275
275
|
.min(2)
|
|
276
|
+
const CORRELATION_INPUT_POLICY_SCHEMA = z.object({
|
|
277
|
+
consumption: z.enum(["consume", "retain"]),
|
|
278
|
+
selection: z.enum(["oldest", "latest"]),
|
|
279
|
+
})
|
|
276
280
|
|
|
277
281
|
const MERGE_INPUT_ORIGINS_SCHEMA = z
|
|
278
282
|
.string()
|
|
@@ -287,6 +291,7 @@ const createCorrelationOfferSchema = <TKeySchema extends z.ZodType>(
|
|
|
287
291
|
) =>
|
|
288
292
|
SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
|
|
289
293
|
key: keySchema,
|
|
294
|
+
inputPolicies: CORRELATION_INPUT_POLICY_SCHEMA.array().min(2).optional(),
|
|
290
295
|
occurrenceTtl: COORDINATION_DURATION_SCHEMA.optional(),
|
|
291
296
|
ordered: z.boolean(),
|
|
292
297
|
outcomeSeq: OUTCOME_SEQUENCE_SCHEMA,
|
|
@@ -304,6 +309,39 @@ const createCorrelationOfferSchema = <TKeySchema extends z.ZodType>(
|
|
|
304
309
|
path: ["streamIndex"],
|
|
305
310
|
})
|
|
306
311
|
}
|
|
312
|
+
if (
|
|
313
|
+
entry.inputPolicies &&
|
|
314
|
+
entry.inputPolicies.length !== entry.streamOrigins.length
|
|
315
|
+
) {
|
|
316
|
+
context.addIssue({
|
|
317
|
+
code: "custom",
|
|
318
|
+
message: "Correlation input policies must match the input streams.",
|
|
319
|
+
path: ["inputPolicies"],
|
|
320
|
+
})
|
|
321
|
+
}
|
|
322
|
+
})
|
|
323
|
+
|
|
324
|
+
const createTakeOfferSchema = <TKeySchema extends z.ZodType>(
|
|
325
|
+
keySchema: TKeySchema,
|
|
326
|
+
) =>
|
|
327
|
+
SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
|
|
328
|
+
count: z.number().int().positive(),
|
|
329
|
+
key: keySchema,
|
|
330
|
+
outcomeSeq: OUTCOME_SEQUENCE_SCHEMA,
|
|
331
|
+
policy: z.literal("take"),
|
|
332
|
+
ttl: COORDINATION_DURATION_SCHEMA.optional(),
|
|
333
|
+
})
|
|
334
|
+
|
|
335
|
+
const createRateLimitOfferSchema = <TKeySchema extends z.ZodType>(
|
|
336
|
+
keySchema: TKeySchema,
|
|
337
|
+
) =>
|
|
338
|
+
SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
|
|
339
|
+
interval: COORDINATION_DURATION_SCHEMA,
|
|
340
|
+
key: keySchema,
|
|
341
|
+
limit: z.number().int().positive(),
|
|
342
|
+
outcomeSeq: OUTCOME_SEQUENCE_SCHEMA,
|
|
343
|
+
overflow: z.enum(["drop", "wait"]),
|
|
344
|
+
policy: z.literal("rateLimit"),
|
|
307
345
|
})
|
|
308
346
|
|
|
309
347
|
const MERGE_OFFER_SCHEMA = SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
|
|
@@ -328,6 +366,19 @@ const createSerializationOfferSchema = <TKeySchema extends z.ZodType>(
|
|
|
328
366
|
sourceOrigins: z.string().min(1).array(),
|
|
329
367
|
})
|
|
330
368
|
|
|
369
|
+
const createConcurrencyOfferSchema = <TKeySchema extends z.ZodType>(
|
|
370
|
+
keySchema: TKeySchema,
|
|
371
|
+
) =>
|
|
372
|
+
SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
|
|
373
|
+
key: keySchema,
|
|
374
|
+
limit: z.number().int().positive(),
|
|
375
|
+
outcomeSeq: OUTCOME_SEQUENCE_SCHEMA,
|
|
376
|
+
policy: z.literal("concurrent"),
|
|
377
|
+
releaseScopePath: HOOK_SCOPE_PATH_SCHEMA,
|
|
378
|
+
releaseSlot: z.number().int().nonnegative(),
|
|
379
|
+
sourceOrigins: z.string().min(1).array(),
|
|
380
|
+
})
|
|
381
|
+
|
|
331
382
|
const createCollectionOfferSchema = <TKeySchema extends z.ZodType>(
|
|
332
383
|
keySchema: TKeySchema,
|
|
333
384
|
) =>
|
|
@@ -425,6 +476,9 @@ const CORRELATION_OFFER_SCHEMA = createCorrelationOfferSchema(encodableSchema)
|
|
|
425
476
|
const FUNNEL_OFFER_SCHEMA = createFunnelOfferSchema(encodableSchema)
|
|
426
477
|
const SERIALIZATION_OFFER_SCHEMA =
|
|
427
478
|
createSerializationOfferSchema(encodableSchema)
|
|
479
|
+
const CONCURRENCY_OFFER_SCHEMA = createConcurrencyOfferSchema(encodableSchema)
|
|
480
|
+
const RATE_LIMIT_OFFER_SCHEMA = createRateLimitOfferSchema(encodableSchema)
|
|
481
|
+
const TAKE_OFFER_SCHEMA = createTakeOfferSchema(encodableSchema)
|
|
428
482
|
|
|
429
483
|
const RACE_OFFER_BASE_SCHEMA = SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
|
|
430
484
|
cohortActionDependencyIds: z.string().array(),
|
|
@@ -455,21 +509,27 @@ const RACE_OFFER_SCHEMA = z
|
|
|
455
509
|
const COORDINATION_OFFER_SCHEMA = z.union([
|
|
456
510
|
COLLECTION_OFFER_SCHEMA,
|
|
457
511
|
CORRELATION_OFFER_SCHEMA,
|
|
512
|
+
CONCURRENCY_OFFER_SCHEMA,
|
|
458
513
|
FANOUT_OFFER_SCHEMA,
|
|
459
514
|
FUNNEL_OFFER_SCHEMA,
|
|
460
515
|
MERGE_OFFER_SCHEMA,
|
|
516
|
+
RATE_LIMIT_OFFER_SCHEMA,
|
|
461
517
|
RACE_OFFER_SCHEMA,
|
|
462
518
|
SERIALIZATION_OFFER_SCHEMA,
|
|
519
|
+
TAKE_OFFER_SCHEMA,
|
|
463
520
|
])
|
|
464
521
|
|
|
465
522
|
const COORDINATION_OFFER_TRANSPORT_SCHEMA = z.union([
|
|
466
523
|
createCollectionOfferSchema(codecEnvelopeSchema),
|
|
467
524
|
createCorrelationOfferSchema(codecEnvelopeSchema),
|
|
525
|
+
createConcurrencyOfferSchema(codecEnvelopeSchema),
|
|
468
526
|
FANOUT_OFFER_SCHEMA,
|
|
469
527
|
createFunnelOfferSchema(codecEnvelopeSchema),
|
|
470
528
|
MERGE_OFFER_SCHEMA,
|
|
529
|
+
createRateLimitOfferSchema(codecEnvelopeSchema),
|
|
471
530
|
RACE_OFFER_SCHEMA,
|
|
472
531
|
createSerializationOfferSchema(codecEnvelopeSchema),
|
|
532
|
+
createTakeOfferSchema(codecEnvelopeSchema),
|
|
473
533
|
])
|
|
474
534
|
|
|
475
535
|
/** One validated durable coordination offer sent by the automation runtime. */
|