@automate.ax/api-contract 0.61.1 → 0.62.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 +3 -3
- package/dist/runtime.d.ts +6 -6
- package/dist/runtime.js +10 -20
- package/package.json +2 -2
- package/src/runtime.ts +9 -21
package/dist/index.d.ts
CHANGED
|
@@ -1124,11 +1124,11 @@ export declare const contract: {
|
|
|
1124
1124
|
signalDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
|
|
1125
1125
|
slot: import("zod").ZodNumber;
|
|
1126
1126
|
key: import("zod").ZodOptional<import("zod").ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>;
|
|
1127
|
-
|
|
1127
|
+
ordered: import("zod").ZodBoolean;
|
|
1128
1128
|
outcomeSeq: import("zod").ZodNumber;
|
|
1129
1129
|
policy: import("zod").ZodLiteral<"correlate">;
|
|
1130
|
-
|
|
1131
|
-
|
|
1130
|
+
streamIndex: import("zod").ZodNumber;
|
|
1131
|
+
streamOrigins: import("zod").ZodArray<import("zod").ZodArray<import("zod").ZodString>>;
|
|
1132
1132
|
ttl: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber]>>;
|
|
1133
1133
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
1134
1134
|
actionDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
|
package/dist/runtime.d.ts
CHANGED
|
@@ -61,11 +61,11 @@ declare const COORDINATION_OFFER_SCHEMA: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
61
61
|
signalDependencyIds: z.ZodArray<z.ZodString>;
|
|
62
62
|
slot: z.ZodNumber;
|
|
63
63
|
key: z.ZodOptional<z.ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>;
|
|
64
|
-
|
|
64
|
+
ordered: z.ZodBoolean;
|
|
65
65
|
outcomeSeq: z.ZodNumber;
|
|
66
66
|
policy: z.ZodLiteral<"correlate">;
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
streamIndex: z.ZodNumber;
|
|
68
|
+
streamOrigins: z.ZodArray<z.ZodArray<z.ZodString>>;
|
|
69
69
|
ttl: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
70
70
|
}, z.core.$strip>, z.ZodObject<{
|
|
71
71
|
actionDependencyIds: z.ZodArray<z.ZodString>;
|
|
@@ -364,11 +364,11 @@ export declare const runtimeContract: {
|
|
|
364
364
|
signalDependencyIds: z.ZodArray<z.ZodString>;
|
|
365
365
|
slot: z.ZodNumber;
|
|
366
366
|
key: z.ZodOptional<z.ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>;
|
|
367
|
-
|
|
367
|
+
ordered: z.ZodBoolean;
|
|
368
368
|
outcomeSeq: z.ZodNumber;
|
|
369
369
|
policy: z.ZodLiteral<"correlate">;
|
|
370
|
-
|
|
371
|
-
|
|
370
|
+
streamIndex: z.ZodNumber;
|
|
371
|
+
streamOrigins: z.ZodArray<z.ZodArray<z.ZodString>>;
|
|
372
372
|
ttl: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
373
373
|
}, z.core.$strip>, z.ZodObject<{
|
|
374
374
|
actionDependencyIds: z.ZodArray<z.ZodString>;
|
package/dist/runtime.js
CHANGED
|
@@ -142,37 +142,27 @@ const COORDINATION_DURATION_SCHEMA = z.union([
|
|
|
142
142
|
z.string().min(1),
|
|
143
143
|
z.number().nonnegative(),
|
|
144
144
|
]);
|
|
145
|
-
const
|
|
145
|
+
const CORRELATION_STREAM_ORIGINS_SCHEMA = z
|
|
146
146
|
.string()
|
|
147
147
|
.min(1)
|
|
148
148
|
.array()
|
|
149
|
-
.min(
|
|
150
|
-
.
|
|
151
|
-
|
|
152
|
-
});
|
|
149
|
+
.min(1)
|
|
150
|
+
.array()
|
|
151
|
+
.min(2);
|
|
153
152
|
const CORRELATION_OFFER_SCHEMA = SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
|
|
154
153
|
key: encodableSchema,
|
|
155
|
-
|
|
154
|
+
ordered: z.boolean(),
|
|
156
155
|
outcomeSeq: OUTCOME_SEQUENCE_SCHEMA,
|
|
157
156
|
policy: z.literal("correlate"),
|
|
158
|
-
|
|
159
|
-
|
|
157
|
+
streamIndex: z.number().int().nonnegative(),
|
|
158
|
+
streamOrigins: CORRELATION_STREAM_ORIGINS_SCHEMA,
|
|
160
159
|
ttl: z.union([z.string().min(1), z.number().nonnegative()]).optional(),
|
|
161
160
|
}).superRefine((entry, context) => {
|
|
162
|
-
if (
|
|
163
|
-
context.addIssue({
|
|
164
|
-
code: "custom",
|
|
165
|
-
message: "Correlation stream must be included in streamNames.",
|
|
166
|
-
path: ["streamName"],
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
if (entry.order &&
|
|
170
|
-
(entry.order.length !== entry.streamNames.length ||
|
|
171
|
-
entry.order.some((name) => !entry.streamNames.includes(name)))) {
|
|
161
|
+
if (entry.streamIndex >= entry.streamOrigins.length) {
|
|
172
162
|
context.addIssue({
|
|
173
163
|
code: "custom",
|
|
174
|
-
message: "Correlation
|
|
175
|
-
path: ["
|
|
164
|
+
message: "Correlation stream index must identify an input stream.",
|
|
165
|
+
path: ["streamIndex"],
|
|
176
166
|
});
|
|
177
167
|
}
|
|
178
168
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automate.ax/api-contract",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.62.0",
|
|
4
4
|
"description": "Public oRPC contract for the Automate.ax API.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@ai-sdk/gateway": "^4.0.46",
|
|
31
|
-
"@automate.ax/codec": "0.
|
|
31
|
+
"@automate.ax/codec": "0.62.0",
|
|
32
32
|
"@orpc/contract": "1.15.0",
|
|
33
33
|
"fast-json-stable-stringify": "^2.1.0",
|
|
34
34
|
"zod": "^4.3.6"
|
package/src/runtime.ts
CHANGED
|
@@ -159,40 +159,28 @@ const COORDINATION_DURATION_SCHEMA = z.union([
|
|
|
159
159
|
z.string().min(1),
|
|
160
160
|
z.number().nonnegative(),
|
|
161
161
|
])
|
|
162
|
-
const
|
|
162
|
+
const CORRELATION_STREAM_ORIGINS_SCHEMA = z
|
|
163
163
|
.string()
|
|
164
164
|
.min(1)
|
|
165
165
|
.array()
|
|
166
|
+
.min(1)
|
|
167
|
+
.array()
|
|
166
168
|
.min(2)
|
|
167
|
-
.refine((names) => new Set(names).size === names.length, {
|
|
168
|
-
message: "Correlation stream names must be unique.",
|
|
169
|
-
})
|
|
170
169
|
|
|
171
170
|
const CORRELATION_OFFER_SCHEMA = SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
|
|
172
171
|
key: encodableSchema,
|
|
173
|
-
|
|
172
|
+
ordered: z.boolean(),
|
|
174
173
|
outcomeSeq: OUTCOME_SEQUENCE_SCHEMA,
|
|
175
174
|
policy: z.literal("correlate"),
|
|
176
|
-
|
|
177
|
-
|
|
175
|
+
streamIndex: z.number().int().nonnegative(),
|
|
176
|
+
streamOrigins: CORRELATION_STREAM_ORIGINS_SCHEMA,
|
|
178
177
|
ttl: z.union([z.string().min(1), z.number().nonnegative()]).optional(),
|
|
179
178
|
}).superRefine((entry, context) => {
|
|
180
|
-
if (
|
|
181
|
-
context.addIssue({
|
|
182
|
-
code: "custom",
|
|
183
|
-
message: "Correlation stream must be included in streamNames.",
|
|
184
|
-
path: ["streamName"],
|
|
185
|
-
})
|
|
186
|
-
}
|
|
187
|
-
if (
|
|
188
|
-
entry.order &&
|
|
189
|
-
(entry.order.length !== entry.streamNames.length ||
|
|
190
|
-
entry.order.some((name) => !entry.streamNames.includes(name)))
|
|
191
|
-
) {
|
|
179
|
+
if (entry.streamIndex >= entry.streamOrigins.length) {
|
|
192
180
|
context.addIssue({
|
|
193
181
|
code: "custom",
|
|
194
|
-
message: "Correlation
|
|
195
|
-
path: ["
|
|
182
|
+
message: "Correlation stream index must identify an input stream.",
|
|
183
|
+
path: ["streamIndex"],
|
|
196
184
|
})
|
|
197
185
|
}
|
|
198
186
|
})
|