@automate.ax/api-contract 0.132.0 → 0.134.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.
@@ -131,7 +131,7 @@ export declare const automationExecutionOutputSchema: z.ZodObject<{
131
131
  }, z.core.$strip>>;
132
132
  }, z.core.$strip>;
133
133
  export declare const automationManagementInvocationInputSchema: z.ZodIntersection<z.ZodObject<{
134
- automationId: z.ZodString;
134
+ automation: z.ZodString;
135
135
  entrypoint: z.ZodDefault<z.ZodString>;
136
136
  idempotencyKey: z.ZodOptional<z.ZodString>;
137
137
  payload: z.ZodCustom<import("@automate.ax/codec/rpc").CodecEnvelope, import("@automate.ax/codec/rpc").CodecEnvelope>;
@@ -147,7 +147,7 @@ export declare const automationManagementInvocationInputSchema: z.ZodIntersectio
147
147
  }, z.core.$strip>]>>;
148
148
  export declare const automationContract: {
149
149
  get: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
150
- automationId: z.ZodString;
150
+ automation: z.ZodString;
151
151
  }, z.core.$strip>, z.ZodObject<{
152
152
  accountBindings: z.ZodArray<z.ZodObject<{
153
153
  account: z.ZodNullable<z.ZodObject<{
@@ -199,7 +199,7 @@ export declare const automationContract: {
199
199
  updatedAt: z.ZodDate;
200
200
  }, z.core.$strip>, Record<never, never>, Record<never, never>>;
201
201
  getExecution: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
202
- automationId: z.ZodString;
202
+ automation: z.ZodString;
203
203
  executionId: z.ZodString;
204
204
  }, z.core.$strip>, z.ZodObject<{
205
205
  id: z.ZodString;
@@ -266,7 +266,7 @@ export declare const automationContract: {
266
266
  }, z.core.$strip>>;
267
267
  }, z.core.$strip>, Record<never, never>, Record<never, never>>;
268
268
  invoke: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodIntersection<z.ZodObject<{
269
- automationId: z.ZodString;
269
+ automation: z.ZodString;
270
270
  entrypoint: z.ZodDefault<z.ZodString>;
271
271
  idempotencyKey: z.ZodOptional<z.ZodString>;
272
272
  payload: z.ZodCustom<import("@automate.ax/codec/rpc").CodecEnvelope, import("@automate.ax/codec/rpc").CodecEnvelope>;
@@ -347,7 +347,7 @@ export declare const automationContract: {
347
347
  }, z.core.$strip>;
348
348
  }, z.core.$strip>, Record<never, never>, Record<never, never>>;
349
349
  listExecutions: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
350
- automationId: z.ZodString;
350
+ automation: z.ZodString;
351
351
  limit: z.ZodDefault<z.ZodNumber>;
352
352
  }, z.core.$strip>, z.ZodArray<z.ZodObject<{
353
353
  createdAt: z.ZodDate;
@@ -362,7 +362,7 @@ export declare const automationContract: {
362
362
  }>;
363
363
  }, z.core.$strip>>, Record<never, never>, Record<never, never>>;
364
364
  update: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
365
- automationId: z.ZodString;
365
+ automation: z.ZodString;
366
366
  enabled: z.ZodBoolean;
367
367
  }, z.core.$strip>, z.ZodObject<{
368
368
  txid: z.ZodNumber;
@@ -116,9 +116,13 @@ export const automationExecutionOutputSchema = automationExecutionSummarySchema
116
116
  })
117
117
  .array(),
118
118
  });
119
+ const AUTOMATION_SELECTOR_SCHEMA = z
120
+ .string()
121
+ .min(1)
122
+ .describe("Exact automation ID or unique active deployed description. IDs take precedence.");
119
123
  export const automationManagementInvocationInputSchema = z
120
124
  .object({
121
- automationId: z.string().min(1),
125
+ automation: AUTOMATION_SELECTOR_SCHEMA,
122
126
  entrypoint: z
123
127
  .string()
124
128
  .min(1)
@@ -131,32 +135,32 @@ export const automationContract = {
131
135
  get: oc
132
136
  .route({
133
137
  method: "GET",
134
- path: "/automations/{automationId}",
138
+ path: "/automations/{automation}",
135
139
  operationId: "getAutomation",
136
140
  summary: "Get automation",
137
141
  description: "Returns an active automation with its triggers and integration account bindings.",
138
142
  tags: ["Automations"],
139
143
  })
140
- .input(z.object({ automationId: z.string() }))
144
+ .input(z.object({ automation: AUTOMATION_SELECTOR_SCHEMA }))
141
145
  .output(automationOutputSchema),
142
146
  getExecution: oc
143
147
  .route({
144
148
  method: "GET",
145
- path: "/automations/{automationId}/executions/{executionId}",
149
+ path: "/automations/{automation}/executions/{executionId}",
146
150
  operationId: "getAutomationExecution",
147
151
  summary: "Get automation execution",
148
152
  description: "Returns one execution with decoded events, outputs, actions, and durable logical attempt history.",
149
153
  tags: ["Automations"],
150
154
  })
151
155
  .input(z.object({
152
- automationId: z.string(),
156
+ automation: AUTOMATION_SELECTOR_SCHEMA,
153
157
  executionId: z.string(),
154
158
  }))
155
159
  .output(automationExecutionOutputSchema),
156
160
  invoke: oc
157
161
  .route({
158
162
  method: "POST",
159
- path: "/automations/{automationId}/invocations",
163
+ path: "/automations/{automation}/invocations",
160
164
  operationId: "invokeAutomation",
161
165
  summary: "Invoke automation",
162
166
  description: "Schedules an invocation for an active automation. Runtime callers use the active action as the idempotency identity; other callers must provide idempotencyKey.",
@@ -187,28 +191,28 @@ export const automationContract = {
187
191
  listExecutions: oc
188
192
  .route({
189
193
  method: "GET",
190
- path: "/automations/{automationId}/executions",
194
+ path: "/automations/{automation}/executions",
191
195
  operationId: "listAutomationExecutions",
192
196
  summary: "List automation executions",
193
197
  description: "Lists recent execution summaries for one automation.",
194
198
  tags: ["Automations"],
195
199
  })
196
200
  .input(z.object({
197
- automationId: z.string(),
201
+ automation: AUTOMATION_SELECTOR_SCHEMA,
198
202
  limit: z.number().int().min(1).max(100).default(50),
199
203
  }))
200
204
  .output(automationExecutionSummarySchema.array()),
201
205
  update: oc
202
206
  .route({
203
207
  method: "PATCH",
204
- path: "/automations/{automationId}",
208
+ path: "/automations/{automation}",
205
209
  operationId: "updateAutomation",
206
210
  summary: "Update automation",
207
211
  description: "Enables or disables an automation. Requires project:update.",
208
212
  tags: ["Automations"],
209
213
  })
210
214
  .input(z.object({
211
- automationId: z.string(),
215
+ automation: AUTOMATION_SELECTOR_SCHEMA,
212
216
  enabled: z.boolean(),
213
217
  }))
214
218
  .output(z.object({
package/dist/index.d.ts CHANGED
@@ -271,7 +271,7 @@ export declare const publicContract: {
271
271
  };
272
272
  automation: {
273
273
  get: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
274
- automationId: import("zod").ZodString;
274
+ automation: import("zod").ZodString;
275
275
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
276
276
  accountBindings: import("zod").ZodArray<import("zod").ZodObject<{
277
277
  account: import("zod").ZodNullable<import("zod").ZodObject<{
@@ -323,7 +323,7 @@ export declare const publicContract: {
323
323
  updatedAt: import("zod").ZodDate;
324
324
  }, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
325
325
  getExecution: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
326
- automationId: import("zod").ZodString;
326
+ automation: import("zod").ZodString;
327
327
  executionId: import("zod").ZodString;
328
328
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
329
329
  id: import("zod").ZodString;
@@ -390,7 +390,7 @@ export declare const publicContract: {
390
390
  }, import("zod/v4/core").$strip>>;
391
391
  }, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
392
392
  invoke: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodIntersection<import("zod").ZodObject<{
393
- automationId: import("zod").ZodString;
393
+ automation: import("zod").ZodString;
394
394
  entrypoint: import("zod").ZodDefault<import("zod").ZodString>;
395
395
  idempotencyKey: import("zod").ZodOptional<import("zod").ZodString>;
396
396
  payload: import("zod").ZodCustom<import("@automate.ax/codec/rpc").CodecEnvelope, import("@automate.ax/codec/rpc").CodecEnvelope>;
@@ -471,7 +471,7 @@ export declare const publicContract: {
471
471
  }, import("zod/v4/core").$strip>;
472
472
  }, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
473
473
  listExecutions: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
474
- automationId: import("zod").ZodString;
474
+ automation: import("zod").ZodString;
475
475
  limit: import("zod").ZodDefault<import("zod").ZodNumber>;
476
476
  }, import("zod/v4/core").$strip>, import("zod").ZodArray<import("zod").ZodObject<{
477
477
  createdAt: import("zod").ZodDate;
@@ -486,7 +486,7 @@ export declare const publicContract: {
486
486
  }>;
487
487
  }, import("zod/v4/core").$strip>>, Record<never, never>, Record<never, never>>;
488
488
  update: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
489
- automationId: import("zod").ZodString;
489
+ automation: import("zod").ZodString;
490
490
  enabled: import("zod").ZodBoolean;
491
491
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
492
492
  txid: import("zod").ZodNumber;
@@ -1883,7 +1883,7 @@ export declare const firstPartyContract: {
1883
1883
  };
1884
1884
  automation: {
1885
1885
  get: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
1886
- automationId: import("zod").ZodString;
1886
+ automation: import("zod").ZodString;
1887
1887
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1888
1888
  accountBindings: import("zod").ZodArray<import("zod").ZodObject<{
1889
1889
  account: import("zod").ZodNullable<import("zod").ZodObject<{
@@ -1935,7 +1935,7 @@ export declare const firstPartyContract: {
1935
1935
  updatedAt: import("zod").ZodDate;
1936
1936
  }, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
1937
1937
  getExecution: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
1938
- automationId: import("zod").ZodString;
1938
+ automation: import("zod").ZodString;
1939
1939
  executionId: import("zod").ZodString;
1940
1940
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1941
1941
  id: import("zod").ZodString;
@@ -2002,7 +2002,7 @@ export declare const firstPartyContract: {
2002
2002
  }, import("zod/v4/core").$strip>>;
2003
2003
  }, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
2004
2004
  invoke: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodIntersection<import("zod").ZodObject<{
2005
- automationId: import("zod").ZodString;
2005
+ automation: import("zod").ZodString;
2006
2006
  entrypoint: import("zod").ZodDefault<import("zod").ZodString>;
2007
2007
  idempotencyKey: import("zod").ZodOptional<import("zod").ZodString>;
2008
2008
  payload: import("zod").ZodCustom<import("@automate.ax/codec/rpc").CodecEnvelope, import("@automate.ax/codec/rpc").CodecEnvelope>;
@@ -2083,7 +2083,7 @@ export declare const firstPartyContract: {
2083
2083
  }, import("zod/v4/core").$strip>;
2084
2084
  }, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
2085
2085
  listExecutions: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
2086
- automationId: import("zod").ZodString;
2086
+ automation: import("zod").ZodString;
2087
2087
  limit: import("zod").ZodDefault<import("zod").ZodNumber>;
2088
2088
  }, import("zod/v4/core").$strip>, import("zod").ZodArray<import("zod").ZodObject<{
2089
2089
  createdAt: import("zod").ZodDate;
@@ -2098,7 +2098,7 @@ export declare const firstPartyContract: {
2098
2098
  }>;
2099
2099
  }, import("zod/v4/core").$strip>>, Record<never, never>, Record<never, never>>;
2100
2100
  update: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
2101
- automationId: import("zod").ZodString;
2101
+ automation: import("zod").ZodString;
2102
2102
  enabled: import("zod").ZodBoolean;
2103
2103
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
2104
2104
  txid: import("zod").ZodNumber;
@@ -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;
@@ -6585,16 +6645,11 @@ export declare const contract: {
6585
6645
  createCallbackToken: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
6586
6646
  endpointKey: import("zod").ZodString;
6587
6647
  }, import("zod/v4/core").$strip>, import("zod").ZodString, Record<never, never>, Record<never, never>>;
6588
- invokeAutomation: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodIntersection<import("zod").ZodIntersection<import("zod").ZodObject<{
6648
+ invokeAutomation: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodIntersection<import("zod").ZodObject<{
6649
+ automation: import("zod").ZodString;
6589
6650
  entrypoint: import("zod").ZodDefault<import("zod").ZodString>;
6590
6651
  payload: import("zod").ZodCustom<import("@automate.ax/codec/rpc").CodecEnvelope, import("@automate.ax/codec/rpc").CodecEnvelope>;
6591
6652
  }, import("zod/v4/core").$strip>, import("zod").ZodUnion<readonly [import("zod").ZodObject<{
6592
- automationId: import("zod").ZodString;
6593
- automationName: import("zod").ZodOptional<import("zod").ZodNever>;
6594
- }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
6595
- automationId: import("zod").ZodOptional<import("zod").ZodNever>;
6596
- automationName: import("zod").ZodString;
6597
- }, import("zod/v4/core").$strip>]>>, import("zod").ZodUnion<readonly [import("zod").ZodObject<{
6598
6653
  runAt: import("zod").ZodUnion<readonly [import("zod").ZodDate, import("zod").ZodString, import("zod").ZodNumber]>;
6599
6654
  runIn: import("zod").ZodOptional<import("zod").ZodNever>;
6600
6655
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
@@ -8004,7 +8059,7 @@ export declare const contract: {
8004
8059
  };
8005
8060
  automation: {
8006
8061
  get: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
8007
- automationId: import("zod").ZodString;
8062
+ automation: import("zod").ZodString;
8008
8063
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
8009
8064
  accountBindings: import("zod").ZodArray<import("zod").ZodObject<{
8010
8065
  account: import("zod").ZodNullable<import("zod").ZodObject<{
@@ -8056,7 +8111,7 @@ export declare const contract: {
8056
8111
  updatedAt: import("zod").ZodDate;
8057
8112
  }, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
8058
8113
  getExecution: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
8059
- automationId: import("zod").ZodString;
8114
+ automation: import("zod").ZodString;
8060
8115
  executionId: import("zod").ZodString;
8061
8116
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
8062
8117
  id: import("zod").ZodString;
@@ -8123,7 +8178,7 @@ export declare const contract: {
8123
8178
  }, import("zod/v4/core").$strip>>;
8124
8179
  }, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
8125
8180
  invoke: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodIntersection<import("zod").ZodObject<{
8126
- automationId: import("zod").ZodString;
8181
+ automation: import("zod").ZodString;
8127
8182
  entrypoint: import("zod").ZodDefault<import("zod").ZodString>;
8128
8183
  idempotencyKey: import("zod").ZodOptional<import("zod").ZodString>;
8129
8184
  payload: import("zod").ZodCustom<import("@automate.ax/codec/rpc").CodecEnvelope, import("@automate.ax/codec/rpc").CodecEnvelope>;
@@ -8204,7 +8259,7 @@ export declare const contract: {
8204
8259
  }, import("zod/v4/core").$strip>;
8205
8260
  }, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
8206
8261
  listExecutions: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
8207
- automationId: import("zod").ZodString;
8262
+ automation: import("zod").ZodString;
8208
8263
  limit: import("zod").ZodDefault<import("zod").ZodNumber>;
8209
8264
  }, import("zod/v4/core").$strip>, import("zod").ZodArray<import("zod").ZodObject<{
8210
8265
  createdAt: import("zod").ZodDate;
@@ -8219,7 +8274,7 @@ export declare const contract: {
8219
8274
  }>;
8220
8275
  }, import("zod/v4/core").$strip>>, Record<never, never>, Record<never, never>>;
8221
8276
  update: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
8222
- automationId: import("zod").ZodString;
8277
+ automation: import("zod").ZodString;
8223
8278
  enabled: import("zod").ZodBoolean;
8224
8279
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
8225
8280
  txid: import("zod").ZodNumber;
package/dist/runtime.d.ts CHANGED
@@ -33,16 +33,11 @@ export declare const automationInvocationOutputSchema: z.ZodObject<{
33
33
  id: z.ZodString;
34
34
  runAt: z.ZodDate;
35
35
  }, z.core.$strip>;
36
- export declare const automationInvocationInputSchema: z.ZodIntersection<z.ZodIntersection<z.ZodObject<{
36
+ export declare const automationInvocationInputSchema: z.ZodIntersection<z.ZodObject<{
37
+ automation: z.ZodString;
37
38
  entrypoint: z.ZodDefault<z.ZodString>;
38
39
  payload: z.ZodOptional<z.ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>;
39
40
  }, z.core.$strip>, z.ZodUnion<readonly [z.ZodObject<{
40
- automationId: z.ZodString;
41
- automationName: z.ZodOptional<z.ZodNever>;
42
- }, z.core.$strip>, z.ZodObject<{
43
- automationId: z.ZodOptional<z.ZodNever>;
44
- automationName: z.ZodString;
45
- }, z.core.$strip>]>>, z.ZodUnion<readonly [z.ZodObject<{
46
41
  runAt: z.ZodUnion<readonly [z.ZodDate, z.ZodString, z.ZodNumber]>;
47
42
  runIn: z.ZodOptional<z.ZodNever>;
48
43
  }, z.core.$strip>, z.ZodObject<{
@@ -227,6 +222,35 @@ declare const COORDINATION_OFFER_SCHEMA: z.ZodUnion<readonly [z.ZodObject<{
227
222
  }>;
228
223
  ttl: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
229
224
  until: z.ZodOptional<z.ZodDate>;
225
+ }, z.core.$strip>, z.ZodObject<{
226
+ actionDependencyIds: z.ZodArray<z.ZodString>;
227
+ eventDependencyIds: z.ZodArray<z.ZodString>;
228
+ scopePath: z.ZodArray<z.ZodNumber>;
229
+ signalDependencyIds: z.ZodArray<z.ZodString>;
230
+ slot: z.ZodNumber;
231
+ derivation: z.ZodNullable<z.ZodObject<{
232
+ nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
233
+ id: z.ZodString;
234
+ source: z.ZodEnum<{
235
+ action: "action";
236
+ event: "event";
237
+ signal: "signal";
238
+ }>;
239
+ type: z.ZodLiteral<"source">;
240
+ }, z.core.$strip>, z.ZodObject<{
241
+ inputs: z.ZodArray<z.ZodNumber>;
242
+ property: z.ZodString;
243
+ type: z.ZodLiteral<"property">;
244
+ }, z.core.$strip>, z.ZodObject<{
245
+ inputs: z.ZodArray<z.ZodNumber>;
246
+ type: z.ZodLiteral<"transform">;
247
+ }, z.core.$strip>], "type">>;
248
+ roots: z.ZodArray<z.ZodNumber>;
249
+ }, z.core.$strip>>;
250
+ inputOrigins: z.ZodArray<z.ZodArray<z.ZodString>>;
251
+ outcomeSeq: z.ZodNumber;
252
+ policy: z.ZodLiteral<"merge">;
253
+ selectedIndex: z.ZodNumber;
230
254
  }, z.core.$strip>, z.ZodUnion<readonly [z.ZodObject<{
231
255
  actionDependencyIds: z.ZodArray<z.ZodString>;
232
256
  eventDependencyIds: z.ZodArray<z.ZodString>;
@@ -333,7 +357,38 @@ declare const COORDINATION_OFFER_SCHEMA: z.ZodUnion<readonly [z.ZodObject<{
333
357
  scopeOrigins: z.ZodArray<z.ZodString>;
334
358
  selectedIndex: z.ZodNumber;
335
359
  status: z.ZodLiteral<"succeeded">;
336
- }, z.core.$strip>]>]>;
360
+ }, z.core.$strip>]>, z.ZodObject<{
361
+ actionDependencyIds: z.ZodArray<z.ZodString>;
362
+ eventDependencyIds: z.ZodArray<z.ZodString>;
363
+ scopePath: z.ZodArray<z.ZodNumber>;
364
+ signalDependencyIds: z.ZodArray<z.ZodString>;
365
+ slot: z.ZodNumber;
366
+ derivation: z.ZodNullable<z.ZodObject<{
367
+ nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
368
+ id: z.ZodString;
369
+ source: z.ZodEnum<{
370
+ action: "action";
371
+ event: "event";
372
+ signal: "signal";
373
+ }>;
374
+ type: z.ZodLiteral<"source">;
375
+ }, z.core.$strip>, z.ZodObject<{
376
+ inputs: z.ZodArray<z.ZodNumber>;
377
+ property: z.ZodString;
378
+ type: z.ZodLiteral<"property">;
379
+ }, z.core.$strip>, z.ZodObject<{
380
+ inputs: z.ZodArray<z.ZodNumber>;
381
+ type: z.ZodLiteral<"transform">;
382
+ }, z.core.$strip>], "type">>;
383
+ roots: z.ZodArray<z.ZodNumber>;
384
+ }, z.core.$strip>>;
385
+ key: z.ZodOptional<z.ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>;
386
+ outcomeSeq: z.ZodNumber;
387
+ policy: z.ZodLiteral<"serialize">;
388
+ releaseScopePath: z.ZodArray<z.ZodNumber>;
389
+ releaseSlot: z.ZodNumber;
390
+ sourceOrigins: z.ZodArray<z.ZodString>;
391
+ }, z.core.$strip>]>;
337
392
  /** One validated durable coordination offer sent by the automation runtime. */
338
393
  export type RuntimeCoordinationOffer = z.output<typeof COORDINATION_OFFER_SCHEMA>;
339
394
  declare const RUNTIME_VALUE_CONTEXT_SCHEMA: z.ZodObject<{
@@ -1463,6 +1518,35 @@ export declare const runtimeContract: {
1463
1518
  }>;
1464
1519
  ttl: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
1465
1520
  until: z.ZodOptional<z.ZodDate>;
1521
+ }, z.core.$strip>, z.ZodObject<{
1522
+ actionDependencyIds: z.ZodArray<z.ZodString>;
1523
+ eventDependencyIds: z.ZodArray<z.ZodString>;
1524
+ scopePath: z.ZodArray<z.ZodNumber>;
1525
+ signalDependencyIds: z.ZodArray<z.ZodString>;
1526
+ slot: z.ZodNumber;
1527
+ derivation: z.ZodNullable<z.ZodObject<{
1528
+ nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1529
+ id: z.ZodString;
1530
+ source: z.ZodEnum<{
1531
+ action: "action";
1532
+ event: "event";
1533
+ signal: "signal";
1534
+ }>;
1535
+ type: z.ZodLiteral<"source">;
1536
+ }, z.core.$strip>, z.ZodObject<{
1537
+ inputs: z.ZodArray<z.ZodNumber>;
1538
+ property: z.ZodString;
1539
+ type: z.ZodLiteral<"property">;
1540
+ }, z.core.$strip>, z.ZodObject<{
1541
+ inputs: z.ZodArray<z.ZodNumber>;
1542
+ type: z.ZodLiteral<"transform">;
1543
+ }, z.core.$strip>], "type">>;
1544
+ roots: z.ZodArray<z.ZodNumber>;
1545
+ }, z.core.$strip>>;
1546
+ inputOrigins: z.ZodArray<z.ZodArray<z.ZodString>>;
1547
+ outcomeSeq: z.ZodNumber;
1548
+ policy: z.ZodLiteral<"merge">;
1549
+ selectedIndex: z.ZodNumber;
1466
1550
  }, z.core.$strip>, z.ZodUnion<readonly [z.ZodObject<{
1467
1551
  actionDependencyIds: z.ZodArray<z.ZodString>;
1468
1552
  eventDependencyIds: z.ZodArray<z.ZodString>;
@@ -1569,7 +1653,38 @@ export declare const runtimeContract: {
1569
1653
  scopeOrigins: z.ZodArray<z.ZodString>;
1570
1654
  selectedIndex: z.ZodNumber;
1571
1655
  status: z.ZodLiteral<"succeeded">;
1572
- }, z.core.$strip>]>]>>;
1656
+ }, z.core.$strip>]>, z.ZodObject<{
1657
+ actionDependencyIds: z.ZodArray<z.ZodString>;
1658
+ eventDependencyIds: z.ZodArray<z.ZodString>;
1659
+ scopePath: z.ZodArray<z.ZodNumber>;
1660
+ signalDependencyIds: z.ZodArray<z.ZodString>;
1661
+ slot: z.ZodNumber;
1662
+ derivation: z.ZodNullable<z.ZodObject<{
1663
+ nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1664
+ id: z.ZodString;
1665
+ source: z.ZodEnum<{
1666
+ action: "action";
1667
+ event: "event";
1668
+ signal: "signal";
1669
+ }>;
1670
+ type: z.ZodLiteral<"source">;
1671
+ }, z.core.$strip>, z.ZodObject<{
1672
+ inputs: z.ZodArray<z.ZodNumber>;
1673
+ property: z.ZodString;
1674
+ type: z.ZodLiteral<"property">;
1675
+ }, z.core.$strip>, z.ZodObject<{
1676
+ inputs: z.ZodArray<z.ZodNumber>;
1677
+ type: z.ZodLiteral<"transform">;
1678
+ }, z.core.$strip>], "type">>;
1679
+ roots: z.ZodArray<z.ZodNumber>;
1680
+ }, z.core.$strip>>;
1681
+ key: z.ZodCustom<import("@automate.ax/codec/rpc").CodecEnvelope, import("@automate.ax/codec/rpc").CodecEnvelope>;
1682
+ outcomeSeq: z.ZodNumber;
1683
+ policy: z.ZodLiteral<"serialize">;
1684
+ releaseScopePath: z.ZodArray<z.ZodNumber>;
1685
+ releaseSlot: z.ZodNumber;
1686
+ sourceOrigins: z.ZodArray<z.ZodString>;
1687
+ }, z.core.$strip>]>>;
1573
1688
  observedFrontier: z.ZodOptional<z.ZodObject<{
1574
1689
  boundaryCount: z.ZodNumber;
1575
1690
  outcomeSeq: z.ZodNumber;
@@ -1835,16 +1950,11 @@ export declare const runtimeContract: {
1835
1950
  createCallbackToken: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
1836
1951
  endpointKey: z.ZodString;
1837
1952
  }, z.core.$strip>, z.ZodString, Record<never, never>, Record<never, never>>;
1838
- invokeAutomation: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodIntersection<z.ZodIntersection<z.ZodObject<{
1953
+ invokeAutomation: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodIntersection<z.ZodObject<{
1954
+ automation: z.ZodString;
1839
1955
  entrypoint: z.ZodDefault<z.ZodString>;
1840
1956
  payload: z.ZodCustom<import("@automate.ax/codec/rpc").CodecEnvelope, import("@automate.ax/codec/rpc").CodecEnvelope>;
1841
1957
  }, z.core.$strip>, z.ZodUnion<readonly [z.ZodObject<{
1842
- automationId: z.ZodString;
1843
- automationName: z.ZodOptional<z.ZodNever>;
1844
- }, z.core.$strip>, z.ZodObject<{
1845
- automationId: z.ZodOptional<z.ZodNever>;
1846
- automationName: z.ZodString;
1847
- }, z.core.$strip>]>>, z.ZodUnion<readonly [z.ZodObject<{
1848
1958
  runAt: z.ZodUnion<readonly [z.ZodDate, z.ZodString, z.ZodNumber]>;
1849
1959
  runIn: z.ZodOptional<z.ZodNever>;
1850
1960
  }, z.core.$strip>, z.ZodObject<{
package/dist/runtime.js CHANGED
@@ -79,29 +79,16 @@ export const automationInvocationOutputSchema = z.object({
79
79
  runAt: z.date(),
80
80
  });
81
81
  const AUTOMATION_INVOCATION_BASE_SCHEMA = z.object({
82
+ automation: z.string().min(1),
82
83
  entrypoint: z
83
84
  .string()
84
85
  .min(1)
85
86
  .default(AUTOMATION_INVOCATION_DEFAULT_ENTRYPOINT),
86
87
  });
87
- const AUTOMATION_INVOCATION_TARGET_SCHEMA = z.union([
88
- z.object({
89
- automationId: z.string().min(1),
90
- automationName: z.never().optional(),
91
- }),
92
- z.object({
93
- automationId: z.never().optional(),
94
- automationName: z.string().min(1),
95
- }),
96
- ]);
97
- export const automationInvocationInputSchema = AUTOMATION_INVOCATION_BASE_SCHEMA.extend({ payload: encodableSchema })
98
- .and(AUTOMATION_INVOCATION_TARGET_SCHEMA)
99
- .and(automationInvocationScheduleSchema);
88
+ export const automationInvocationInputSchema = AUTOMATION_INVOCATION_BASE_SCHEMA.extend({ payload: encodableSchema }).and(automationInvocationScheduleSchema);
100
89
  const AUTOMATION_INVOCATION_TRANSPORT_INPUT_SCHEMA = AUTOMATION_INVOCATION_BASE_SCHEMA.extend({
101
90
  payload: codecEnvelopeSchema,
102
- })
103
- .and(AUTOMATION_INVOCATION_TARGET_SCHEMA)
104
- .and(automationInvocationScheduleSchema);
91
+ }).and(automationInvocationScheduleSchema);
105
92
  const SIGNAL_DERIVATION_NODE_SCHEMA = z.discriminatedUnion("type", [
106
93
  z.object({
107
94
  id: z.string().min(1),
@@ -235,6 +222,13 @@ const CORRELATION_STREAM_ORIGINS_SCHEMA = z
235
222
  .min(1)
236
223
  .array()
237
224
  .min(2);
225
+ const MERGE_INPUT_ORIGINS_SCHEMA = z
226
+ .string()
227
+ .min(1)
228
+ .array()
229
+ .min(1)
230
+ .array()
231
+ .min(2);
238
232
  const createCorrelationOfferSchema = (keySchema) => SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
239
233
  key: keySchema,
240
234
  ordered: z.boolean(),
@@ -252,6 +246,23 @@ const createCorrelationOfferSchema = (keySchema) => SIGNAL_INVOCATION_DEPENDENCI
252
246
  });
253
247
  }
254
248
  });
249
+ const MERGE_OFFER_SCHEMA = SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
250
+ inputOrigins: MERGE_INPUT_ORIGINS_SCHEMA,
251
+ outcomeSeq: OUTCOME_SEQUENCE_SCHEMA,
252
+ policy: z.literal("merge"),
253
+ selectedIndex: z.number().int().nonnegative(),
254
+ }).refine((offer) => offer.selectedIndex < offer.inputOrigins.length, {
255
+ message: "Merge input must identify a declared input.",
256
+ path: ["selectedIndex"],
257
+ });
258
+ const createSerializationOfferSchema = (keySchema) => SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
259
+ key: keySchema,
260
+ outcomeSeq: OUTCOME_SEQUENCE_SCHEMA,
261
+ policy: z.literal("serialize"),
262
+ releaseScopePath: HOOK_SCOPE_PATH_SCHEMA,
263
+ releaseSlot: z.number().int().nonnegative(),
264
+ sourceOrigins: z.string().min(1).array(),
265
+ });
255
266
  const createCollectionOfferSchema = (keySchema) => SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
256
267
  count: z.number().int().positive(),
257
268
  key: keySchema,
@@ -325,6 +336,7 @@ const createFunnelOfferSchema = (keySchema) => SIGNAL_INVOCATION_DEPENDENCIES_SC
325
336
  const COLLECTION_OFFER_SCHEMA = createCollectionOfferSchema(encodableSchema);
326
337
  const CORRELATION_OFFER_SCHEMA = createCorrelationOfferSchema(encodableSchema);
327
338
  const FUNNEL_OFFER_SCHEMA = createFunnelOfferSchema(encodableSchema);
339
+ const SERIALIZATION_OFFER_SCHEMA = createSerializationOfferSchema(encodableSchema);
328
340
  const RACE_OFFER_BASE_SCHEMA = SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
329
341
  cohortActionDependencyIds: z.string().array(),
330
342
  cohortEventDependencyIds: z.string().array(),
@@ -354,14 +366,18 @@ const COORDINATION_OFFER_SCHEMA = z.union([
354
366
  CORRELATION_OFFER_SCHEMA,
355
367
  FANOUT_OFFER_SCHEMA,
356
368
  FUNNEL_OFFER_SCHEMA,
369
+ MERGE_OFFER_SCHEMA,
357
370
  RACE_OFFER_SCHEMA,
371
+ SERIALIZATION_OFFER_SCHEMA,
358
372
  ]);
359
373
  const COORDINATION_OFFER_TRANSPORT_SCHEMA = z.union([
360
374
  createCollectionOfferSchema(codecEnvelopeSchema),
361
375
  createCorrelationOfferSchema(codecEnvelopeSchema),
362
376
  FANOUT_OFFER_SCHEMA,
363
377
  createFunnelOfferSchema(codecEnvelopeSchema),
378
+ MERGE_OFFER_SCHEMA,
364
379
  RACE_OFFER_SCHEMA,
380
+ createSerializationOfferSchema(codecEnvelopeSchema),
365
381
  ]);
366
382
  const SIGNAL_INVOCATION_SCHEMA = z.union([
367
383
  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.132.0",
3
+ "version": "0.134.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.132.0",
35
- "@automate.ax/integration-contracts": "0.132.0",
34
+ "@automate.ax/codec": "0.134.0",
35
+ "@automate.ax/integration-contracts": "0.134.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/automation.ts CHANGED
@@ -128,9 +128,16 @@ export const automationExecutionOutputSchema = automationExecutionSummarySchema
128
128
  .array(),
129
129
  })
130
130
 
131
+ const AUTOMATION_SELECTOR_SCHEMA = z
132
+ .string()
133
+ .min(1)
134
+ .describe(
135
+ "Exact automation ID or unique active deployed description. IDs take precedence.",
136
+ )
137
+
131
138
  export const automationManagementInvocationInputSchema = z
132
139
  .object({
133
- automationId: z.string().min(1),
140
+ automation: AUTOMATION_SELECTOR_SCHEMA,
134
141
  entrypoint: z
135
142
  .string()
136
143
  .min(1)
@@ -144,19 +151,19 @@ export const automationContract = {
144
151
  get: oc
145
152
  .route({
146
153
  method: "GET",
147
- path: "/automations/{automationId}",
154
+ path: "/automations/{automation}",
148
155
  operationId: "getAutomation",
149
156
  summary: "Get automation",
150
157
  description:
151
158
  "Returns an active automation with its triggers and integration account bindings.",
152
159
  tags: ["Automations"],
153
160
  })
154
- .input(z.object({ automationId: z.string() }))
161
+ .input(z.object({ automation: AUTOMATION_SELECTOR_SCHEMA }))
155
162
  .output(automationOutputSchema),
156
163
  getExecution: oc
157
164
  .route({
158
165
  method: "GET",
159
- path: "/automations/{automationId}/executions/{executionId}",
166
+ path: "/automations/{automation}/executions/{executionId}",
160
167
  operationId: "getAutomationExecution",
161
168
  summary: "Get automation execution",
162
169
  description:
@@ -165,7 +172,7 @@ export const automationContract = {
165
172
  })
166
173
  .input(
167
174
  z.object({
168
- automationId: z.string(),
175
+ automation: AUTOMATION_SELECTOR_SCHEMA,
169
176
  executionId: z.string(),
170
177
  }),
171
178
  )
@@ -173,7 +180,7 @@ export const automationContract = {
173
180
  invoke: oc
174
181
  .route({
175
182
  method: "POST",
176
- path: "/automations/{automationId}/invocations",
183
+ path: "/automations/{automation}/invocations",
177
184
  operationId: "invokeAutomation",
178
185
  summary: "Invoke automation",
179
186
  description:
@@ -208,7 +215,7 @@ export const automationContract = {
208
215
  listExecutions: oc
209
216
  .route({
210
217
  method: "GET",
211
- path: "/automations/{automationId}/executions",
218
+ path: "/automations/{automation}/executions",
212
219
  operationId: "listAutomationExecutions",
213
220
  summary: "List automation executions",
214
221
  description: "Lists recent execution summaries for one automation.",
@@ -216,7 +223,7 @@ export const automationContract = {
216
223
  })
217
224
  .input(
218
225
  z.object({
219
- automationId: z.string(),
226
+ automation: AUTOMATION_SELECTOR_SCHEMA,
220
227
  limit: z.number().int().min(1).max(100).default(50),
221
228
  }),
222
229
  )
@@ -224,7 +231,7 @@ export const automationContract = {
224
231
  update: oc
225
232
  .route({
226
233
  method: "PATCH",
227
- path: "/automations/{automationId}",
234
+ path: "/automations/{automation}",
228
235
  operationId: "updateAutomation",
229
236
  summary: "Update automation",
230
237
  description:
@@ -233,7 +240,7 @@ export const automationContract = {
233
240
  })
234
241
  .input(
235
242
  z.object({
236
- automationId: z.string(),
243
+ automation: AUTOMATION_SELECTOR_SCHEMA,
237
244
  enabled: z.boolean(),
238
245
  }),
239
246
  )
package/src/runtime.ts CHANGED
@@ -106,33 +106,21 @@ export const automationInvocationOutputSchema = z.object({
106
106
  })
107
107
 
108
108
  const AUTOMATION_INVOCATION_BASE_SCHEMA = z.object({
109
+ automation: z.string().min(1),
109
110
  entrypoint: z
110
111
  .string()
111
112
  .min(1)
112
113
  .default(AUTOMATION_INVOCATION_DEFAULT_ENTRYPOINT),
113
114
  })
114
- const AUTOMATION_INVOCATION_TARGET_SCHEMA = z.union([
115
- z.object({
116
- automationId: z.string().min(1),
117
- automationName: z.never().optional(),
118
- }),
119
- z.object({
120
- automationId: z.never().optional(),
121
- automationName: z.string().min(1),
122
- }),
123
- ])
124
-
125
115
  export const automationInvocationInputSchema =
126
- AUTOMATION_INVOCATION_BASE_SCHEMA.extend({ payload: encodableSchema })
127
- .and(AUTOMATION_INVOCATION_TARGET_SCHEMA)
128
- .and(automationInvocationScheduleSchema)
116
+ AUTOMATION_INVOCATION_BASE_SCHEMA.extend({ payload: encodableSchema }).and(
117
+ automationInvocationScheduleSchema,
118
+ )
129
119
 
130
120
  const AUTOMATION_INVOCATION_TRANSPORT_INPUT_SCHEMA =
131
121
  AUTOMATION_INVOCATION_BASE_SCHEMA.extend({
132
122
  payload: codecEnvelopeSchema,
133
- })
134
- .and(AUTOMATION_INVOCATION_TARGET_SCHEMA)
135
- .and(automationInvocationScheduleSchema)
123
+ }).and(automationInvocationScheduleSchema)
136
124
 
137
125
  const SIGNAL_DERIVATION_NODE_SCHEMA = z.discriminatedUnion("type", [
138
126
  z.object({
@@ -286,6 +274,14 @@ const CORRELATION_STREAM_ORIGINS_SCHEMA = z
286
274
  .array()
287
275
  .min(2)
288
276
 
277
+ const MERGE_INPUT_ORIGINS_SCHEMA = z
278
+ .string()
279
+ .min(1)
280
+ .array()
281
+ .min(1)
282
+ .array()
283
+ .min(2)
284
+
289
285
  const createCorrelationOfferSchema = <TKeySchema extends z.ZodType>(
290
286
  keySchema: TKeySchema,
291
287
  ) =>
@@ -307,6 +303,28 @@ const createCorrelationOfferSchema = <TKeySchema extends z.ZodType>(
307
303
  }
308
304
  })
309
305
 
306
+ const MERGE_OFFER_SCHEMA = SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
307
+ inputOrigins: MERGE_INPUT_ORIGINS_SCHEMA,
308
+ outcomeSeq: OUTCOME_SEQUENCE_SCHEMA,
309
+ policy: z.literal("merge"),
310
+ selectedIndex: z.number().int().nonnegative(),
311
+ }).refine((offer) => offer.selectedIndex < offer.inputOrigins.length, {
312
+ message: "Merge input must identify a declared input.",
313
+ path: ["selectedIndex"],
314
+ })
315
+
316
+ const createSerializationOfferSchema = <TKeySchema extends z.ZodType>(
317
+ keySchema: TKeySchema,
318
+ ) =>
319
+ SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
320
+ key: keySchema,
321
+ outcomeSeq: OUTCOME_SEQUENCE_SCHEMA,
322
+ policy: z.literal("serialize"),
323
+ releaseScopePath: HOOK_SCOPE_PATH_SCHEMA,
324
+ releaseSlot: z.number().int().nonnegative(),
325
+ sourceOrigins: z.string().min(1).array(),
326
+ })
327
+
310
328
  const createCollectionOfferSchema = <TKeySchema extends z.ZodType>(
311
329
  keySchema: TKeySchema,
312
330
  ) =>
@@ -397,6 +415,8 @@ const createFunnelOfferSchema = <TKeySchema extends z.ZodType>(
397
415
  const COLLECTION_OFFER_SCHEMA = createCollectionOfferSchema(encodableSchema)
398
416
  const CORRELATION_OFFER_SCHEMA = createCorrelationOfferSchema(encodableSchema)
399
417
  const FUNNEL_OFFER_SCHEMA = createFunnelOfferSchema(encodableSchema)
418
+ const SERIALIZATION_OFFER_SCHEMA =
419
+ createSerializationOfferSchema(encodableSchema)
400
420
 
401
421
  const RACE_OFFER_BASE_SCHEMA = SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
402
422
  cohortActionDependencyIds: z.string().array(),
@@ -429,7 +449,9 @@ const COORDINATION_OFFER_SCHEMA = z.union([
429
449
  CORRELATION_OFFER_SCHEMA,
430
450
  FANOUT_OFFER_SCHEMA,
431
451
  FUNNEL_OFFER_SCHEMA,
452
+ MERGE_OFFER_SCHEMA,
432
453
  RACE_OFFER_SCHEMA,
454
+ SERIALIZATION_OFFER_SCHEMA,
433
455
  ])
434
456
 
435
457
  const COORDINATION_OFFER_TRANSPORT_SCHEMA = z.union([
@@ -437,7 +459,9 @@ const COORDINATION_OFFER_TRANSPORT_SCHEMA = z.union([
437
459
  createCorrelationOfferSchema(codecEnvelopeSchema),
438
460
  FANOUT_OFFER_SCHEMA,
439
461
  createFunnelOfferSchema(codecEnvelopeSchema),
462
+ MERGE_OFFER_SCHEMA,
440
463
  RACE_OFFER_SCHEMA,
464
+ createSerializationOfferSchema(codecEnvelopeSchema),
441
465
  ])
442
466
 
443
467
  /** One validated durable coordination offer sent by the automation runtime. */