@automate.ax/api-contract 0.61.1 → 0.62.1

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 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
- order: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
1127
+ ordered: import("zod").ZodBoolean;
1128
1128
  outcomeSeq: import("zod").ZodNumber;
1129
1129
  policy: import("zod").ZodLiteral<"correlate">;
1130
- streamName: import("zod").ZodString;
1131
- streamNames: import("zod").ZodArray<import("zod").ZodString>;
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
- order: z.ZodOptional<z.ZodArray<z.ZodString>>;
64
+ ordered: z.ZodBoolean;
65
65
  outcomeSeq: z.ZodNumber;
66
66
  policy: z.ZodLiteral<"correlate">;
67
- streamName: z.ZodString;
68
- streamNames: z.ZodArray<z.ZodString>;
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
- order: z.ZodOptional<z.ZodArray<z.ZodString>>;
367
+ ordered: z.ZodBoolean;
368
368
  outcomeSeq: z.ZodNumber;
369
369
  policy: z.ZodLiteral<"correlate">;
370
- streamName: z.ZodString;
371
- streamNames: z.ZodArray<z.ZodString>;
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 CORRELATION_STREAM_NAMES_SCHEMA = z
145
+ const CORRELATION_STREAM_ORIGINS_SCHEMA = z
146
146
  .string()
147
147
  .min(1)
148
148
  .array()
149
- .min(2)
150
- .refine((names) => new Set(names).size === names.length, {
151
- message: "Correlation stream names must be unique.",
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
- order: CORRELATION_STREAM_NAMES_SCHEMA.optional(),
154
+ ordered: z.boolean(),
156
155
  outcomeSeq: OUTCOME_SEQUENCE_SCHEMA,
157
156
  policy: z.literal("correlate"),
158
- streamName: z.string().min(1),
159
- streamNames: CORRELATION_STREAM_NAMES_SCHEMA,
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 (!entry.streamNames.includes(entry.streamName)) {
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 order must name every stream exactly once.",
175
- path: ["order"],
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.61.1",
3
+ "version": "0.62.1",
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.61.1",
31
+ "@automate.ax/codec": "0.62.1",
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 CORRELATION_STREAM_NAMES_SCHEMA = z
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
- order: CORRELATION_STREAM_NAMES_SCHEMA.optional(),
172
+ ordered: z.boolean(),
174
173
  outcomeSeq: OUTCOME_SEQUENCE_SCHEMA,
175
174
  policy: z.literal("correlate"),
176
- streamName: z.string().min(1),
177
- streamNames: CORRELATION_STREAM_NAMES_SCHEMA,
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 (!entry.streamNames.includes(entry.streamName)) {
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 order must name every stream exactly once.",
195
- path: ["order"],
182
+ message: "Correlation stream index must identify an input stream.",
183
+ path: ["streamIndex"],
196
184
  })
197
185
  }
198
186
  })