@automate.ax/api-contract 0.54.0 → 0.56.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/runtime.d.ts CHANGED
@@ -223,6 +223,23 @@ export declare const runtimeContract: {
223
223
  reason: z.ZodLiteral<"failed-dependency">;
224
224
  status: z.ZodLiteral<"skipped">;
225
225
  }, z.core.$strip>]>>>;
226
+ collectionEntries: z.ZodDefault<z.ZodArray<z.ZodObject<{
227
+ actionDependencyIds: z.ZodArray<z.ZodString>;
228
+ eventDependencyIds: z.ZodArray<z.ZodString>;
229
+ signalDependencyIds: z.ZodArray<z.ZodString>;
230
+ slot: z.ZodNumber;
231
+ count: z.ZodNumber;
232
+ key: z.ZodOptional<z.ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>;
233
+ outcomeSeq: z.ZodNumber;
234
+ primaryPosition: z.ZodEnum<{
235
+ first: "first";
236
+ last: "last";
237
+ }>;
238
+ ttl: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
239
+ parameterActionDependencyIds: z.ZodArray<z.ZodString>;
240
+ parameterEventDependencyIds: z.ZodArray<z.ZodString>;
241
+ parameterSignalDependencyIds: z.ZodArray<z.ZodString>;
242
+ }, z.core.$strip>>>;
226
243
  correlationEntries: z.ZodDefault<z.ZodArray<z.ZodObject<{
227
244
  actionDependencyIds: z.ZodArray<z.ZodString>;
228
245
  eventDependencyIds: z.ZodArray<z.ZodString>;
@@ -262,6 +279,23 @@ export declare const runtimeContract: {
262
279
  selectedIndex: z.ZodOptional<z.ZodNumber>;
263
280
  status: z.ZodLiteral<"open">;
264
281
  }, z.core.$strip>]>>>;
282
+ windowEntries: z.ZodDefault<z.ZodArray<z.ZodObject<{
283
+ actionDependencyIds: z.ZodArray<z.ZodString>;
284
+ eventDependencyIds: z.ZodArray<z.ZodString>;
285
+ signalDependencyIds: z.ZodArray<z.ZodString>;
286
+ slot: z.ZodNumber;
287
+ duration: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
288
+ key: z.ZodOptional<z.ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>;
289
+ outcomeSeq: z.ZodNumber;
290
+ primaryPosition: z.ZodEnum<{
291
+ first: "first";
292
+ last: "last";
293
+ }>;
294
+ ttl: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
295
+ parameterActionDependencyIds: z.ZodArray<z.ZodString>;
296
+ parameterEventDependencyIds: z.ZodArray<z.ZodString>;
297
+ parameterSignalDependencyIds: z.ZodArray<z.ZodString>;
298
+ }, z.core.$strip>>>;
265
299
  }, z.core.$strip>, z.ZodVoid, Record<never, never>, Record<never, never>>;
266
300
  completeAction: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodUnion<readonly [z.ZodObject<{
267
301
  reason: z.ZodLiteral<"closed-dependency">;
@@ -418,6 +452,7 @@ export declare const runtimeContract: {
418
452
  signalDependencyIds: z.ZodArray<z.ZodString>;
419
453
  slot: z.ZodNumber;
420
454
  actionInvocationId: z.ZodString;
455
+ contextId: z.ZodString;
421
456
  status: z.ZodLiteral<"pending">;
422
457
  }, z.core.$strip>, z.ZodObject<{
423
458
  actionDependencyIds: z.ZodArray<z.ZodString>;
@@ -428,6 +463,7 @@ export declare const runtimeContract: {
428
463
  signalDependencyIds: z.ZodArray<z.ZodString>;
429
464
  slot: z.ZodNumber;
430
465
  actionInvocationId: z.ZodString;
466
+ contextId: z.ZodString;
431
467
  failure: z.ZodObject<{
432
468
  message: z.ZodString;
433
469
  name: z.ZodString;
@@ -443,6 +479,7 @@ export declare const runtimeContract: {
443
479
  signalDependencyIds: z.ZodArray<z.ZodString>;
444
480
  slot: z.ZodNumber;
445
481
  actionInvocationId: z.ZodString;
482
+ contextId: z.ZodString;
446
483
  outcomeSeq: z.ZodNumber;
447
484
  reason: z.ZodLiteral<"closed-dependency">;
448
485
  status: z.ZodLiteral<"skipped">;
@@ -455,6 +492,7 @@ export declare const runtimeContract: {
455
492
  signalDependencyIds: z.ZodArray<z.ZodString>;
456
493
  slot: z.ZodNumber;
457
494
  actionInvocationId: z.ZodString;
495
+ contextId: z.ZodString;
458
496
  failure: z.ZodObject<{
459
497
  message: z.ZodString;
460
498
  name: z.ZodString;
@@ -471,12 +509,20 @@ export declare const runtimeContract: {
471
509
  signalDependencyIds: z.ZodArray<z.ZodString>;
472
510
  slot: z.ZodNumber;
473
511
  actionInvocationId: z.ZodString;
512
+ contextId: z.ZodString;
474
513
  outcomeSeq: z.ZodNumber;
475
514
  status: z.ZodLiteral<"succeeded">;
476
515
  }, z.core.$strip>]>>;
477
516
  contextId: z.ZodString;
517
+ contextParents: z.ZodArray<z.ZodObject<{
518
+ contextId: z.ZodString;
519
+ isPrimary: z.ZodBoolean;
520
+ parentContextId: z.ZodString;
521
+ position: z.ZodNumber;
522
+ }, z.core.$strip>>;
478
523
  events: z.ZodArray<z.ZodObject<{
479
524
  automationEventId: z.ZodString;
525
+ contextId: z.ZodString;
480
526
  outcomeSeq: z.ZodNumber;
481
527
  slot: z.ZodNumber;
482
528
  }, z.core.$strip>>;
@@ -485,6 +531,7 @@ export declare const runtimeContract: {
485
531
  eventDependencyIds: z.ZodArray<z.ZodString>;
486
532
  signalDependencyIds: z.ZodArray<z.ZodString>;
487
533
  slot: z.ZodNumber;
534
+ contextId: z.ZodString;
488
535
  outcomeSeq: z.ZodNumber;
489
536
  signalInvocationId: z.ZodString;
490
537
  selectedIndex: z.ZodOptional<z.ZodNumber>;
@@ -494,6 +541,7 @@ export declare const runtimeContract: {
494
541
  eventDependencyIds: z.ZodArray<z.ZodString>;
495
542
  signalDependencyIds: z.ZodArray<z.ZodString>;
496
543
  slot: z.ZodNumber;
544
+ contextId: z.ZodString;
497
545
  outcomeSeq: z.ZodNumber;
498
546
  signalInvocationId: z.ZodString;
499
547
  status: z.ZodLiteral<"closed">;
@@ -502,6 +550,7 @@ export declare const runtimeContract: {
502
550
  eventDependencyIds: z.ZodArray<z.ZodString>;
503
551
  signalDependencyIds: z.ZodArray<z.ZodString>;
504
552
  slot: z.ZodNumber;
553
+ contextId: z.ZodString;
505
554
  outcomeSeq: z.ZodNumber;
506
555
  signalInvocationId: z.ZodString;
507
556
  failure: z.ZodObject<{
@@ -514,6 +563,7 @@ export declare const runtimeContract: {
514
563
  eventDependencyIds: z.ZodArray<z.ZodString>;
515
564
  signalDependencyIds: z.ZodArray<z.ZodString>;
516
565
  slot: z.ZodNumber;
566
+ contextId: z.ZodString;
517
567
  outcomeSeq: z.ZodNumber;
518
568
  signalInvocationId: z.ZodString;
519
569
  status: z.ZodLiteral<"succeeded">;
@@ -524,8 +574,9 @@ export declare const runtimeContract: {
524
574
  context: z.ZodObject<{
525
575
  actionOutputs: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
526
576
  actionInvocationId: z.ZodString;
527
- outcomeSeq: z.ZodNumber;
577
+ contextId: z.ZodString;
528
578
  slot: z.ZodNumber;
579
+ outcomeSeq: z.ZodNumber;
529
580
  status: z.ZodLiteral<"failed">;
530
581
  failure: z.ZodObject<{
531
582
  message: z.ZodString;
@@ -533,46 +584,68 @@ export declare const runtimeContract: {
533
584
  }, z.core.$strip>;
534
585
  }, z.core.$strip>, z.ZodObject<{
535
586
  actionInvocationId: z.ZodString;
587
+ contextId: z.ZodString;
536
588
  outcomeSeq: z.ZodNumber;
537
- reason: z.ZodLiteral<"closed-dependency">;
538
589
  slot: z.ZodNumber;
590
+ reason: z.ZodLiteral<"closed-dependency">;
539
591
  status: z.ZodLiteral<"skipped">;
540
592
  }, z.core.$strip>, z.ZodObject<{
541
593
  actionInvocationId: z.ZodString;
594
+ contextId: z.ZodString;
595
+ outcomeSeq: z.ZodNumber;
596
+ slot: z.ZodNumber;
542
597
  failure: z.ZodObject<{
543
598
  message: z.ZodString;
544
599
  name: z.ZodString;
545
600
  }, z.core.$strip>;
546
- outcomeSeq: z.ZodNumber;
547
601
  reason: z.ZodLiteral<"failed-dependency">;
548
- slot: z.ZodNumber;
549
602
  status: z.ZodLiteral<"skipped">;
550
603
  }, z.core.$strip>, z.ZodObject<{
551
604
  actionInvocationId: z.ZodString;
605
+ contextId: z.ZodString;
552
606
  outcomeSeq: z.ZodNumber;
553
- output: z.ZodOptional<z.ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>;
554
607
  slot: z.ZodNumber;
608
+ output: z.ZodOptional<z.ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>;
555
609
  status: z.ZodLiteral<"succeeded">;
556
610
  }, z.core.$strip>]>>;
611
+ bufferGroups: z.ZodArray<z.ZodObject<{
612
+ items: z.ZodArray<z.ZodObject<{
613
+ actionDependencyIds: z.ZodArray<z.ZodString>;
614
+ eventDependencyIds: z.ZodArray<z.ZodString>;
615
+ signalDependencyIds: z.ZodArray<z.ZodString>;
616
+ contextId: z.ZodString;
617
+ }, z.core.$strip>>;
618
+ signalInvocationId: z.ZodString;
619
+ }, z.core.$strip>>;
557
620
  contextId: z.ZodString;
621
+ contextParents: z.ZodArray<z.ZodObject<{
622
+ contextId: z.ZodString;
623
+ isPrimary: z.ZodBoolean;
624
+ parentContextId: z.ZodString;
625
+ position: z.ZodNumber;
626
+ }, z.core.$strip>>;
558
627
  events: z.ZodArray<z.ZodObject<{
559
628
  automationEventId: z.ZodString;
629
+ contextId: z.ZodString;
560
630
  outcomeSeq: z.ZodNumber;
561
631
  payload: z.ZodOptional<z.ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>;
562
632
  slot: z.ZodNumber;
563
633
  }, z.core.$strip>>;
564
634
  signalOutputs: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
635
+ contextId: z.ZodString;
565
636
  outcomeSeq: z.ZodNumber;
566
637
  signalInvocationId: z.ZodString;
567
638
  slot: z.ZodNumber;
568
639
  selectedIndex: z.ZodOptional<z.ZodNumber>;
569
640
  status: z.ZodLiteral<"open">;
570
641
  }, z.core.$strip>, z.ZodObject<{
642
+ contextId: z.ZodString;
571
643
  outcomeSeq: z.ZodNumber;
572
644
  signalInvocationId: z.ZodString;
573
645
  slot: z.ZodNumber;
574
646
  status: z.ZodLiteral<"closed">;
575
647
  }, z.core.$strip>, z.ZodObject<{
648
+ contextId: z.ZodString;
576
649
  outcomeSeq: z.ZodNumber;
577
650
  signalInvocationId: z.ZodString;
578
651
  slot: z.ZodNumber;
@@ -582,6 +655,7 @@ export declare const runtimeContract: {
582
655
  }, z.core.$strip>;
583
656
  status: z.ZodLiteral<"failed">;
584
657
  }, z.core.$strip>, z.ZodObject<{
658
+ contextId: z.ZodString;
585
659
  outcomeSeq: z.ZodNumber;
586
660
  signalInvocationId: z.ZodString;
587
661
  slot: z.ZodNumber;
@@ -609,8 +683,9 @@ export declare const runtimeContract: {
609
683
  }, z.core.$strip>, z.ZodObject<{
610
684
  actionOutputs: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
611
685
  actionInvocationId: z.ZodString;
612
- outcomeSeq: z.ZodNumber;
686
+ contextId: z.ZodString;
613
687
  slot: z.ZodNumber;
688
+ outcomeSeq: z.ZodNumber;
614
689
  status: z.ZodLiteral<"failed">;
615
690
  failure: z.ZodObject<{
616
691
  message: z.ZodString;
@@ -618,46 +693,68 @@ export declare const runtimeContract: {
618
693
  }, z.core.$strip>;
619
694
  }, z.core.$strip>, z.ZodObject<{
620
695
  actionInvocationId: z.ZodString;
696
+ contextId: z.ZodString;
621
697
  outcomeSeq: z.ZodNumber;
622
- reason: z.ZodLiteral<"closed-dependency">;
623
698
  slot: z.ZodNumber;
699
+ reason: z.ZodLiteral<"closed-dependency">;
624
700
  status: z.ZodLiteral<"skipped">;
625
701
  }, z.core.$strip>, z.ZodObject<{
626
702
  actionInvocationId: z.ZodString;
703
+ contextId: z.ZodString;
704
+ outcomeSeq: z.ZodNumber;
705
+ slot: z.ZodNumber;
627
706
  failure: z.ZodObject<{
628
707
  message: z.ZodString;
629
708
  name: z.ZodString;
630
709
  }, z.core.$strip>;
631
- outcomeSeq: z.ZodNumber;
632
710
  reason: z.ZodLiteral<"failed-dependency">;
633
- slot: z.ZodNumber;
634
711
  status: z.ZodLiteral<"skipped">;
635
712
  }, z.core.$strip>, z.ZodObject<{
636
713
  actionInvocationId: z.ZodString;
714
+ contextId: z.ZodString;
637
715
  outcomeSeq: z.ZodNumber;
638
- output: z.ZodOptional<z.ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>;
639
716
  slot: z.ZodNumber;
717
+ output: z.ZodOptional<z.ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>;
640
718
  status: z.ZodLiteral<"succeeded">;
641
719
  }, z.core.$strip>]>>;
720
+ bufferGroups: z.ZodArray<z.ZodObject<{
721
+ items: z.ZodArray<z.ZodObject<{
722
+ actionDependencyIds: z.ZodArray<z.ZodString>;
723
+ eventDependencyIds: z.ZodArray<z.ZodString>;
724
+ signalDependencyIds: z.ZodArray<z.ZodString>;
725
+ contextId: z.ZodString;
726
+ }, z.core.$strip>>;
727
+ signalInvocationId: z.ZodString;
728
+ }, z.core.$strip>>;
642
729
  contextId: z.ZodString;
730
+ contextParents: z.ZodArray<z.ZodObject<{
731
+ contextId: z.ZodString;
732
+ isPrimary: z.ZodBoolean;
733
+ parentContextId: z.ZodString;
734
+ position: z.ZodNumber;
735
+ }, z.core.$strip>>;
643
736
  events: z.ZodArray<z.ZodObject<{
644
737
  automationEventId: z.ZodString;
738
+ contextId: z.ZodString;
645
739
  outcomeSeq: z.ZodNumber;
646
740
  payload: z.ZodOptional<z.ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>;
647
741
  slot: z.ZodNumber;
648
742
  }, z.core.$strip>>;
649
743
  signalOutputs: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
744
+ contextId: z.ZodString;
650
745
  outcomeSeq: z.ZodNumber;
651
746
  signalInvocationId: z.ZodString;
652
747
  slot: z.ZodNumber;
653
748
  selectedIndex: z.ZodOptional<z.ZodNumber>;
654
749
  status: z.ZodLiteral<"open">;
655
750
  }, z.core.$strip>, z.ZodObject<{
751
+ contextId: z.ZodString;
656
752
  outcomeSeq: z.ZodNumber;
657
753
  signalInvocationId: z.ZodString;
658
754
  slot: z.ZodNumber;
659
755
  status: z.ZodLiteral<"closed">;
660
756
  }, z.core.$strip>, z.ZodObject<{
757
+ contextId: z.ZodString;
661
758
  outcomeSeq: z.ZodNumber;
662
759
  signalInvocationId: z.ZodString;
663
760
  slot: z.ZodNumber;
@@ -667,6 +764,7 @@ export declare const runtimeContract: {
667
764
  }, z.core.$strip>;
668
765
  status: z.ZodLiteral<"failed">;
669
766
  }, z.core.$strip>, z.ZodObject<{
767
+ contextId: z.ZodString;
670
768
  outcomeSeq: z.ZodNumber;
671
769
  signalInvocationId: z.ZodString;
672
770
  slot: z.ZodNumber;
package/dist/runtime.js CHANGED
@@ -80,6 +80,7 @@ const ACTION_INVOCATION_SCHEMA = z.union([
80
80
  ]);
81
81
  const ACTION_RUN_INVOCATION_BASE_SCHEMA = ACTION_INVOCATION_BASE_SCHEMA.extend({
82
82
  actionInvocationId: z.string(),
83
+ contextId: z.string(),
83
84
  });
84
85
  const ACTION_RUN_INVOCATION_SCHEMA = z.union([
85
86
  ACTION_RUN_INVOCATION_BASE_SCHEMA.extend({ status: z.literal("pending") }),
@@ -110,14 +111,59 @@ const SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA = z.object({
110
111
  signalDependencyIds: z.string().array(),
111
112
  slot: z.number().int().nonnegative(),
112
113
  });
114
+ const BUFFER_PARAMETER_DEPENDENCIES_SCHEMA = z.object({
115
+ parameterActionDependencyIds: z.string().array(),
116
+ parameterEventDependencyIds: z.string().array(),
117
+ parameterSignalDependencyIds: z.string().array(),
118
+ });
119
+ const BUFFER_PRIMARY_POSITION_SCHEMA = z.enum(["first", "last"]);
120
+ const CORRELATION_STREAM_NAMES_SCHEMA = z
121
+ .string()
122
+ .min(1)
123
+ .array()
124
+ .min(2)
125
+ .refine((names) => new Set(names).size === names.length, {
126
+ message: "Correlation stream names must be unique.",
127
+ });
113
128
  const CORRELATION_ENTRY_SCHEMA = SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
114
129
  key: encodableSchema,
115
- order: z.string().min(1).array().min(2).optional(),
130
+ order: CORRELATION_STREAM_NAMES_SCHEMA.optional(),
116
131
  outcomeSeq: OUTCOME_SEQUENCE_SCHEMA,
117
132
  streamName: z.string().min(1),
118
- streamNames: z.string().min(1).array().min(2),
133
+ streamNames: CORRELATION_STREAM_NAMES_SCHEMA,
119
134
  ttl: z.union([z.string().min(1), z.number().nonnegative()]).optional(),
135
+ }).superRefine((entry, context) => {
136
+ if (!entry.streamNames.includes(entry.streamName)) {
137
+ context.addIssue({
138
+ code: "custom",
139
+ message: "Correlation stream must be included in streamNames.",
140
+ path: ["streamName"],
141
+ });
142
+ }
143
+ if (entry.order &&
144
+ (entry.order.length !== entry.streamNames.length ||
145
+ entry.order.some((name) => !entry.streamNames.includes(name)))) {
146
+ context.addIssue({
147
+ code: "custom",
148
+ message: "Correlation order must name every stream exactly once.",
149
+ path: ["order"],
150
+ });
151
+ }
120
152
  });
153
+ const COLLECTION_ENTRY_SCHEMA = SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
154
+ count: z.number().int().positive(),
155
+ key: encodableSchema,
156
+ outcomeSeq: OUTCOME_SEQUENCE_SCHEMA,
157
+ primaryPosition: BUFFER_PRIMARY_POSITION_SCHEMA,
158
+ ttl: z.union([z.string().min(1), z.number().nonnegative()]).optional(),
159
+ }).extend(BUFFER_PARAMETER_DEPENDENCIES_SCHEMA.shape);
160
+ const WINDOW_ENTRY_SCHEMA = SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
161
+ duration: z.union([z.string().min(1), z.number().nonnegative()]),
162
+ key: encodableSchema,
163
+ outcomeSeq: OUTCOME_SEQUENCE_SCHEMA,
164
+ primaryPosition: BUFFER_PRIMARY_POSITION_SCHEMA,
165
+ ttl: z.union([z.string().min(1), z.number().nonnegative()]).optional(),
166
+ }).extend(BUFFER_PARAMETER_DEPENDENCIES_SCHEMA.shape);
121
167
  const SIGNAL_INVOCATION_SCHEMA = z.union([
122
168
  SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
123
169
  outcomeSeq: OUTCOME_SEQUENCE_SCHEMA.optional(),
@@ -134,6 +180,7 @@ const SIGNAL_INVOCATION_SCHEMA = z.union([
134
180
  }),
135
181
  ]);
136
182
  const SIGNAL_BATCH_OUTCOME_BASE_SCHEMA = SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
183
+ contextId: z.string(),
137
184
  outcomeSeq: OUTCOME_SEQUENCE_SCHEMA,
138
185
  signalInvocationId: z.string(),
139
186
  });
@@ -149,42 +196,50 @@ const SIGNAL_BATCH_OUTCOME_SCHEMA = z.union([
149
196
  }),
150
197
  SIGNAL_BATCH_OUTCOME_BASE_SCHEMA.extend({ status: z.literal("succeeded") }),
151
198
  ]);
199
+ const ACTION_VALUE_OUTCOME_BASE_SCHEMA = z.object({
200
+ actionInvocationId: z.string(),
201
+ contextId: z.string(),
202
+ outcomeSeq: OUTCOME_SEQUENCE_SCHEMA,
203
+ slot: z.number().int(),
204
+ });
152
205
  const ACTION_VALUE_OUTCOME_SCHEMA = z.union([
153
- z.object({
154
- actionInvocationId: z.string(),
206
+ ACTION_VALUE_OUTCOME_BASE_SCHEMA.extend({
155
207
  outcomeSeq: OUTCOME_SEQUENCE_SCHEMA,
156
- slot: z.number().int(),
157
208
  status: z.literal("failed"),
158
209
  failure: SIGNAL_FAILURE_SCHEMA,
159
210
  }),
160
- z.object({
161
- actionInvocationId: z.string(),
162
- outcomeSeq: OUTCOME_SEQUENCE_SCHEMA,
211
+ ACTION_VALUE_OUTCOME_BASE_SCHEMA.extend({
163
212
  reason: z.literal("closed-dependency"),
164
- slot: z.number().int(),
165
213
  status: z.literal("skipped"),
166
214
  }),
167
- z.object({
168
- actionInvocationId: z.string(),
215
+ ACTION_VALUE_OUTCOME_BASE_SCHEMA.extend({
169
216
  failure: SIGNAL_FAILURE_SCHEMA,
170
- outcomeSeq: OUTCOME_SEQUENCE_SCHEMA,
171
217
  reason: z.literal("failed-dependency"),
172
- slot: z.number().int(),
173
218
  status: z.literal("skipped"),
174
219
  }),
175
- z.object({
176
- actionInvocationId: z.string(),
177
- outcomeSeq: OUTCOME_SEQUENCE_SCHEMA,
220
+ ACTION_VALUE_OUTCOME_BASE_SCHEMA.extend({
178
221
  output: encodableSchema,
179
- slot: z.number().int(),
180
222
  status: z.literal("succeeded"),
181
223
  }),
182
224
  ]);
183
225
  const SIGNAL_VALUE_OUTCOME_BASE_SCHEMA = z.object({
226
+ contextId: z.string(),
184
227
  outcomeSeq: OUTCOME_SEQUENCE_SCHEMA,
185
228
  signalInvocationId: z.string(),
186
229
  slot: z.number().int(),
187
230
  });
231
+ const RUNTIME_CONTEXT_PARENT_SCHEMA = z.object({
232
+ contextId: z.string(),
233
+ isPrimary: z.boolean(),
234
+ parentContextId: z.string(),
235
+ position: z.number().int().nonnegative(),
236
+ });
237
+ const BUFFER_VALUE_GROUP_SCHEMA = z.object({
238
+ items: SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.omit({ slot: true })
239
+ .extend({ contextId: z.string() })
240
+ .array(),
241
+ signalInvocationId: z.string(),
242
+ });
188
243
  const SIGNAL_VALUE_OUTCOME_SCHEMA = z.union([
189
244
  SIGNAL_VALUE_OUTCOME_BASE_SCHEMA.extend({
190
245
  selectedIndex: z.number().int().nonnegative().optional(),
@@ -202,10 +257,13 @@ const SIGNAL_VALUE_OUTCOME_SCHEMA = z.union([
202
257
  ]);
203
258
  const RUNTIME_VALUE_CONTEXT_SCHEMA = z.object({
204
259
  actionOutputs: ACTION_VALUE_OUTCOME_SCHEMA.array(),
260
+ bufferGroups: BUFFER_VALUE_GROUP_SCHEMA.array(),
205
261
  contextId: z.string(),
262
+ contextParents: RUNTIME_CONTEXT_PARENT_SCHEMA.array(),
206
263
  events: z
207
264
  .object({
208
265
  automationEventId: z.string(),
266
+ contextId: z.string(),
209
267
  outcomeSeq: OUTCOME_SEQUENCE_SCHEMA,
210
268
  payload: encodableSchema,
211
269
  slot: z.number().int(),
@@ -216,9 +274,11 @@ const RUNTIME_VALUE_CONTEXT_SCHEMA = z.object({
216
274
  const RUNTIME_RUN_CONTEXT_SCHEMA = z.object({
217
275
  actions: ACTION_RUN_INVOCATION_SCHEMA.array(),
218
276
  contextId: z.string(),
277
+ contextParents: RUNTIME_CONTEXT_PARENT_SCHEMA.array(),
219
278
  events: z
220
279
  .object({
221
280
  automationEventId: z.string(),
281
+ contextId: z.string(),
222
282
  outcomeSeq: OUTCOME_SEQUENCE_SCHEMA,
223
283
  slot: z.number().int(),
224
284
  })
@@ -357,9 +417,11 @@ export const runtimeContract = {
357
417
  commit: oc
358
418
  .input(z.object({
359
419
  actionInvocations: ACTION_INVOCATION_SCHEMA.array().default([]),
420
+ collectionEntries: COLLECTION_ENTRY_SCHEMA.array().default([]),
360
421
  correlationEntries: CORRELATION_ENTRY_SCHEMA.array().default([]),
361
422
  settled: z.boolean().default(true),
362
423
  signalInvocations: SIGNAL_INVOCATION_SCHEMA.array().default([]),
424
+ windowEntries: WINDOW_ENTRY_SCHEMA.array().default([]),
363
425
  }))
364
426
  .output(z.void()),
365
427
  completeAction: oc
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automate.ax/api-contract",
3
- "version": "0.54.0",
3
+ "version": "0.56.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.54.0",
31
+ "@automate.ax/codec": "0.56.0",
32
32
  "@orpc/contract": "1.15.0",
33
33
  "zod": "^4.3.6"
34
34
  },
package/src/automation.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import { encodableSchema } from "@automate.ax/codec"
2
2
  import { oc } from "@orpc/contract"
3
3
  import { z } from "zod"
4
- import { deploymentTriggerInfoSchema } from "./deployment"
5
4
 
6
5
  export const automationExecutionStatusSchema = z.enum([
7
6
  "running",
@@ -24,34 +23,6 @@ const EXECUTION_SUMMARY_SCHEMA = z.object({
24
23
  })
25
24
 
26
25
  export const automationContract = {
27
- get: oc
28
- .input(
29
- z.object({
30
- automationId: z.string(),
31
- projectId: z.string(),
32
- }),
33
- )
34
- .output(
35
- z.object({
36
- activeDeployment: z.object({
37
- createdAt: z.date(),
38
- git: z
39
- .object({
40
- commitSha: z.string(),
41
- dirty: z.boolean(),
42
- repositoryUrl: z.string(),
43
- })
44
- .nullable(),
45
- id: z.string(),
46
- }),
47
- createdAt: z.date(),
48
- description: z.string(),
49
- id: z.string(),
50
- identityKey: z.string(),
51
- triggers: deploymentTriggerInfoSchema.array(),
52
- updatedAt: z.date(),
53
- }),
54
- ),
55
26
  getExecution: oc
56
27
  .input(
57
28
  z.object({
package/src/deployment.ts CHANGED
@@ -4,54 +4,6 @@ import { z } from "zod"
4
4
  /** SDK compatibility version used to select the immutable runtime image. */
5
5
  export const AUTOMATION_SDK_VERSION = "2"
6
6
 
7
- export type HttpTriggerScope = "trigger" | "automation" | "project"
8
-
9
- export interface HttpTriggerEndpointOptions {
10
- appOrigin: string
11
- automationId: string
12
- hookSlot: number
13
- projectId: string
14
- scope: HttpTriggerScope
15
- }
16
-
17
- /**
18
- * Returns the public URL for one deployed HTTP trigger.
19
- *
20
- * @param options - Public origin and trigger identity.
21
- */
22
- export function getHttpTriggerEndpoint(options: HttpTriggerEndpointOptions) {
23
- return new URL(
24
- `/x/${getHttpTriggerEndpointKey(options)}/`,
25
- options.appOrigin,
26
- ).toString()
27
- }
28
-
29
- /**
30
- * Returns the durable endpoint identity for one configured HTTP scope.
31
- *
32
- * @param options - Trigger and owning resource identity.
33
- */
34
- export function getHttpTriggerEndpointKey(
35
- options: Omit<HttpTriggerEndpointOptions, "appOrigin">,
36
- ) {
37
- if (options.scope === "project") return options.projectId
38
- if (options.scope === "automation") return options.automationId
39
- return `${options.automationId}:${options.hookSlot}`
40
- }
41
-
42
- export const deploymentTriggerInfoSchema = z.object({
43
- details: z
44
- .object({
45
- label: z.string(),
46
- value: z.string(),
47
- })
48
- .array(),
49
- name: z.string(),
50
- type: z.string(),
51
- })
52
-
53
- export type DeploymentTriggerInfo = z.infer<typeof deploymentTriggerInfoSchema>
54
-
55
7
  const DEPLOYMENT_STATUS_SCHEMA = z.enum([
56
8
  "planning",
57
9
  "awaiting_authorization",
@@ -74,6 +26,7 @@ const DEPLOYMENT_IN_PROGRESS_ERROR = {
74
26
  const GIT_SOURCE_SCHEMA = z.object({
75
27
  commitSha: z.string().regex(/^[0-9a-f]{40}(?:[0-9a-f]{24})?$/),
76
28
  dirty: z.boolean(),
29
+ projectPath: z.string(),
77
30
  repositoryUrl: z.string().min(1),
78
31
  })
79
32
 
@@ -132,7 +85,13 @@ export const deploymentContract = {
132
85
  description: z.string(),
133
86
  id: z.string(),
134
87
  identityKey: z.string(),
135
- triggers: deploymentTriggerInfoSchema.array(),
88
+ subscriptions: z
89
+ .object({
90
+ config: z.json(),
91
+ eventType: z.string(),
92
+ hookSlot: z.number().int().nonnegative(),
93
+ })
94
+ .array(),
136
95
  })
137
96
  .array(),
138
97
  createdAt: z.date(),
package/src/index.ts CHANGED
@@ -10,15 +10,7 @@ import { projectContract } from "./project"
10
10
  import { runtimeContract } from "./runtime"
11
11
 
12
12
  export { automationExecutionStatusSchema } from "./automation"
13
- export {
14
- AUTOMATION_SDK_VERSION,
15
- deploymentTriggerInfoSchema,
16
- getHttpTriggerEndpoint,
17
- getHttpTriggerEndpointKey,
18
- type DeploymentTriggerInfo,
19
- type HttpTriggerEndpointOptions,
20
- type HttpTriggerScope,
21
- } from "./deployment"
13
+ export { AUTOMATION_SDK_VERSION } from "./deployment"
22
14
  export { integrationAccountOutputSchema } from "./account"
23
15
  export {
24
16
  AUTOMATION_INVOCATION_DEFAULT_ENTRYPOINT,