@automate.ax/api-contract 0.87.0 → 0.87.2
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/automation.d.ts +3 -3
- package/dist/automation.js +4 -4
- package/dist/deployment.d.ts +2 -2
- package/dist/index.d.ts +50 -54
- package/dist/runtime-protocol.d.ts +1 -1
- package/dist/runtime-protocol.js +1 -1
- package/dist/runtime.d.ts +627 -53
- package/dist/runtime.js +148 -63
- package/package.json +3 -3
- package/src/automation.ts +4 -4
- package/src/runtime-protocol.ts +1 -1
- package/src/runtime.ts +278 -162
package/dist/runtime.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { encodableSchema, isSensitivityMask, } from "@automate.ax/codec";
|
|
2
|
+
import { codecEnvelopeSchema } from "@automate.ax/codec/rpc";
|
|
2
3
|
import { oc } from "@orpc/contract";
|
|
3
4
|
import stableStringify from "fast-json-stable-stringify";
|
|
4
5
|
import * as z from "zod";
|
|
@@ -16,30 +17,11 @@ export const AUTOMATION_LOG_MAX_ENTRIES = 1_000;
|
|
|
16
17
|
export const AUTOMATION_TRACE_MAX_SPANS = 250;
|
|
17
18
|
export const AUTOMATION_OBSERVABILITY_MAX_FIELDS = 64;
|
|
18
19
|
export const AUTOMATION_OBSERVABILITY_MAX_ENCODED_BYTES = 64 * 1_024;
|
|
19
|
-
const RUNTIME_BLOB_JSON_SERIALIZER_TYPE = 8;
|
|
20
|
-
/** Blob wrappers that should use oRPC's native multipart serialization. */
|
|
21
|
-
const runtimeBlobTransportValues = new WeakSet();
|
|
22
|
-
/** Preserves Blob media types while oRPC carries the bytes as multipart data. */
|
|
23
|
-
export const runtimeBlobJsonSerializer = {
|
|
24
|
-
type: RUNTIME_BLOB_JSON_SERIALIZER_TYPE,
|
|
25
|
-
condition: (value) => value instanceof Blob && !runtimeBlobTransportValues.has(value),
|
|
26
|
-
serialize(value) {
|
|
27
|
-
const transportValue = new Blob([value]);
|
|
28
|
-
runtimeBlobTransportValues.add(transportValue);
|
|
29
|
-
return { transportValue, type: value.type };
|
|
30
|
-
},
|
|
31
|
-
deserialize(value) {
|
|
32
|
-
const { transportValue, type } = z
|
|
33
|
-
.object({ transportValue: z.instanceof(Blob), type: z.string() })
|
|
34
|
-
.parse(value);
|
|
35
|
-
return new Blob([transportValue], { type });
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
20
|
export const AUTOMATION_LOG_MAX_MESSAGE_LENGTH = 16_384;
|
|
39
21
|
export const AUTOMATION_TRACE_MAX_NAME_LENGTH = 256;
|
|
40
22
|
const OUTCOME_SEQUENCE_SCHEMA = z.number().int().positive();
|
|
41
23
|
const HOOK_SCOPE_PATH_SCHEMA = z.number().int().nonnegative().array();
|
|
42
|
-
const
|
|
24
|
+
export const runtimeObservabilityFieldsSchema = z
|
|
43
25
|
.record(z.string().min(1).max(128), encodableSchema)
|
|
44
26
|
.refine((fields) => Object.keys(fields).length <= AUTOMATION_OBSERVABILITY_MAX_FIELDS, `Observability fields may contain at most ${AUTOMATION_OBSERVABILITY_MAX_FIELDS} entries.`);
|
|
45
27
|
const LOG_INDEX_SCHEMA = z
|
|
@@ -99,15 +81,13 @@ export const automationInvocationOutputSchema = z.object({
|
|
|
99
81
|
id: z.string(),
|
|
100
82
|
runAt: z.date(),
|
|
101
83
|
});
|
|
102
|
-
|
|
103
|
-
.object({
|
|
84
|
+
const AUTOMATION_INVOCATION_BASE_SCHEMA = z.object({
|
|
104
85
|
entrypoint: z
|
|
105
86
|
.string()
|
|
106
87
|
.min(1)
|
|
107
88
|
.default(AUTOMATION_INVOCATION_DEFAULT_ENTRYPOINT),
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
.and(z.union([
|
|
89
|
+
});
|
|
90
|
+
const AUTOMATION_INVOCATION_TARGET_SCHEMA = z.union([
|
|
111
91
|
z.object({
|
|
112
92
|
automationId: z.string().min(1),
|
|
113
93
|
automationName: z.never().optional(),
|
|
@@ -116,7 +96,14 @@ export const automationInvocationInputSchema = z
|
|
|
116
96
|
automationId: z.never().optional(),
|
|
117
97
|
automationName: z.string().min(1),
|
|
118
98
|
}),
|
|
119
|
-
])
|
|
99
|
+
]);
|
|
100
|
+
export const automationInvocationInputSchema = AUTOMATION_INVOCATION_BASE_SCHEMA.extend({ payload: encodableSchema })
|
|
101
|
+
.and(AUTOMATION_INVOCATION_TARGET_SCHEMA)
|
|
102
|
+
.and(automationInvocationScheduleSchema);
|
|
103
|
+
const AUTOMATION_INVOCATION_TRANSPORT_INPUT_SCHEMA = AUTOMATION_INVOCATION_BASE_SCHEMA.extend({
|
|
104
|
+
payload: codecEnvelopeSchema,
|
|
105
|
+
})
|
|
106
|
+
.and(AUTOMATION_INVOCATION_TARGET_SCHEMA)
|
|
120
107
|
.and(automationInvocationScheduleSchema);
|
|
121
108
|
const SIGNAL_DERIVATION_NODE_SCHEMA = z.discriminatedUnion("type", [
|
|
122
109
|
z.object({
|
|
@@ -237,8 +224,8 @@ const CORRELATION_STREAM_ORIGINS_SCHEMA = z
|
|
|
237
224
|
.min(1)
|
|
238
225
|
.array()
|
|
239
226
|
.min(2);
|
|
240
|
-
const
|
|
241
|
-
key:
|
|
227
|
+
const createCorrelationOfferSchema = (keySchema) => SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
|
|
228
|
+
key: keySchema,
|
|
242
229
|
ordered: z.boolean(),
|
|
243
230
|
outcomeSeq: OUTCOME_SEQUENCE_SCHEMA,
|
|
244
231
|
policy: z.literal("correlate"),
|
|
@@ -254,9 +241,9 @@ const CORRELATION_OFFER_SCHEMA = SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
|
|
|
254
241
|
});
|
|
255
242
|
}
|
|
256
243
|
});
|
|
257
|
-
const
|
|
244
|
+
const createCollectionOfferSchema = (keySchema) => SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
|
|
258
245
|
count: z.number().int().positive(),
|
|
259
|
-
key:
|
|
246
|
+
key: keySchema,
|
|
260
247
|
outcomeSeq: OUTCOME_SEQUENCE_SCHEMA,
|
|
261
248
|
policy: z.literal("collect"),
|
|
262
249
|
position: z.number().int().nonnegative().optional(),
|
|
@@ -268,8 +255,8 @@ const FANOUT_OFFER_SCHEMA = SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
|
|
|
268
255
|
outcomeSeq: OUTCOME_SEQUENCE_SCHEMA,
|
|
269
256
|
policy: z.literal("fanout"),
|
|
270
257
|
});
|
|
271
|
-
const
|
|
272
|
-
key:
|
|
258
|
+
const createFunnelOfferSchema = (keySchema) => SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
|
|
259
|
+
key: keySchema,
|
|
273
260
|
maxBurstDuration: COORDINATION_DURATION_SCHEMA.optional(),
|
|
274
261
|
minGap: COORDINATION_DURATION_SCHEMA.optional(),
|
|
275
262
|
minQuietPeriod: COORDINATION_DURATION_SCHEMA.optional(),
|
|
@@ -308,7 +295,8 @@ const FUNNEL_OFFER_SCHEMA = SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
|
|
|
308
295
|
path: ["until"],
|
|
309
296
|
});
|
|
310
297
|
}
|
|
311
|
-
if (offer.selection !== "all" &&
|
|
298
|
+
if (offer.selection !== "all" &&
|
|
299
|
+
offer.selection !== offer.primaryPosition) {
|
|
312
300
|
context.addIssue({
|
|
313
301
|
code: "custom",
|
|
314
302
|
message: "A selecting funnel must inherit conflicting values from its selected occurrence.",
|
|
@@ -323,6 +311,9 @@ const FUNNEL_OFFER_SCHEMA = SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
|
|
|
323
311
|
});
|
|
324
312
|
}
|
|
325
313
|
});
|
|
314
|
+
const COLLECTION_OFFER_SCHEMA = createCollectionOfferSchema(encodableSchema);
|
|
315
|
+
const CORRELATION_OFFER_SCHEMA = createCorrelationOfferSchema(encodableSchema);
|
|
316
|
+
const FUNNEL_OFFER_SCHEMA = createFunnelOfferSchema(encodableSchema);
|
|
326
317
|
const RACE_OFFER_BASE_SCHEMA = SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
|
|
327
318
|
cohortActionDependencyIds: z.string().array(),
|
|
328
319
|
cohortEventDependencyIds: z.string().array(),
|
|
@@ -354,6 +345,13 @@ const COORDINATION_OFFER_SCHEMA = z.union([
|
|
|
354
345
|
FUNNEL_OFFER_SCHEMA,
|
|
355
346
|
RACE_OFFER_SCHEMA,
|
|
356
347
|
]);
|
|
348
|
+
const COORDINATION_OFFER_TRANSPORT_SCHEMA = z.union([
|
|
349
|
+
createCollectionOfferSchema(codecEnvelopeSchema),
|
|
350
|
+
createCorrelationOfferSchema(codecEnvelopeSchema),
|
|
351
|
+
FANOUT_OFFER_SCHEMA,
|
|
352
|
+
createFunnelOfferSchema(codecEnvelopeSchema),
|
|
353
|
+
RACE_OFFER_SCHEMA,
|
|
354
|
+
]);
|
|
357
355
|
const SIGNAL_INVOCATION_SCHEMA = z.union([
|
|
358
356
|
SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
|
|
359
357
|
outcomeSeq: OUTCOME_SEQUENCE_SCHEMA.optional(),
|
|
@@ -420,6 +418,27 @@ const ACTION_VALUE_OUTCOME_SCHEMA = z.union([
|
|
|
420
418
|
status: z.literal("succeeded"),
|
|
421
419
|
}),
|
|
422
420
|
]);
|
|
421
|
+
const ACTION_VALUE_TRANSPORT_OUTCOME_SCHEMA = z.union([
|
|
422
|
+
ACTION_VALUE_OUTCOME_BASE_SCHEMA.extend({
|
|
423
|
+
outcomeSeq: OUTCOME_SEQUENCE_SCHEMA,
|
|
424
|
+
status: z.literal("failed"),
|
|
425
|
+
failure: automationErrorSchema,
|
|
426
|
+
}),
|
|
427
|
+
ACTION_VALUE_OUTCOME_BASE_SCHEMA.extend({
|
|
428
|
+
reason: z.literal("closed-dependency"),
|
|
429
|
+
status: z.literal("skipped"),
|
|
430
|
+
}),
|
|
431
|
+
ACTION_VALUE_OUTCOME_BASE_SCHEMA.extend({
|
|
432
|
+
failure: automationErrorSchema,
|
|
433
|
+
reason: z.literal("failed-dependency"),
|
|
434
|
+
status: z.literal("skipped"),
|
|
435
|
+
}),
|
|
436
|
+
ACTION_VALUE_OUTCOME_BASE_SCHEMA.extend({
|
|
437
|
+
output: codecEnvelopeSchema,
|
|
438
|
+
outputSensitivity: sensitivityMaskSchema.nullable().optional(),
|
|
439
|
+
status: z.literal("succeeded"),
|
|
440
|
+
}),
|
|
441
|
+
]);
|
|
423
442
|
const SIGNAL_VALUE_OUTCOME_BASE_SCHEMA = z.object({
|
|
424
443
|
contextId: z.string(),
|
|
425
444
|
outcomeSeq: OUTCOME_SEQUENCE_SCHEMA,
|
|
@@ -456,6 +475,19 @@ const SIGNAL_VALUE_OUTCOME_SCHEMA = z.union([
|
|
|
456
475
|
status: z.literal("succeeded"),
|
|
457
476
|
}),
|
|
458
477
|
]);
|
|
478
|
+
const SIGNAL_VALUE_TRANSPORT_OUTCOME_SCHEMA = z.union([
|
|
479
|
+
SIGNAL_VALUE_OUTCOME_BASE_SCHEMA.extend({ status: z.literal("open") }),
|
|
480
|
+
SIGNAL_VALUE_OUTCOME_BASE_SCHEMA.extend({ status: z.literal("closed") }),
|
|
481
|
+
SIGNAL_VALUE_OUTCOME_BASE_SCHEMA.extend({
|
|
482
|
+
failure: automationErrorSchema,
|
|
483
|
+
status: z.literal("failed"),
|
|
484
|
+
}),
|
|
485
|
+
SIGNAL_VALUE_OUTCOME_BASE_SCHEMA.extend({
|
|
486
|
+
output: codecEnvelopeSchema.optional(),
|
|
487
|
+
selectedIndex: z.number().int().nonnegative().optional(),
|
|
488
|
+
status: z.literal("succeeded"),
|
|
489
|
+
}),
|
|
490
|
+
]);
|
|
459
491
|
const RUNTIME_VALUE_CONTEXT_SCHEMA = z.object({
|
|
460
492
|
actionOutputs: ACTION_VALUE_OUTCOME_SCHEMA.array(),
|
|
461
493
|
coordinationSelections: COORDINATION_SELECTION_SCHEMA.array(),
|
|
@@ -474,6 +506,24 @@ const RUNTIME_VALUE_CONTEXT_SCHEMA = z.object({
|
|
|
474
506
|
.array(),
|
|
475
507
|
signalOutputs: SIGNAL_VALUE_OUTCOME_SCHEMA.array(),
|
|
476
508
|
});
|
|
509
|
+
const RUNTIME_VALUE_TRANSPORT_CONTEXT_SCHEMA = z.object({
|
|
510
|
+
actionOutputs: ACTION_VALUE_TRANSPORT_OUTCOME_SCHEMA.array(),
|
|
511
|
+
coordinationSelections: COORDINATION_SELECTION_SCHEMA.array(),
|
|
512
|
+
contextId: z.string(),
|
|
513
|
+
contextParents: RUNTIME_CONTEXT_PARENT_SCHEMA.array(),
|
|
514
|
+
events: z
|
|
515
|
+
.object({
|
|
516
|
+
automationEventId: z.string(),
|
|
517
|
+
contextId: z.string(),
|
|
518
|
+
outcomeSeq: OUTCOME_SEQUENCE_SCHEMA,
|
|
519
|
+
payload: codecEnvelopeSchema,
|
|
520
|
+
scopePath: HOOK_SCOPE_PATH_SCHEMA,
|
|
521
|
+
slot: z.number().int(),
|
|
522
|
+
timestamp: z.date(),
|
|
523
|
+
})
|
|
524
|
+
.array(),
|
|
525
|
+
signalOutputs: SIGNAL_VALUE_TRANSPORT_OUTCOME_SCHEMA.array(),
|
|
526
|
+
});
|
|
477
527
|
const RUNTIME_RUN_CONTEXT_SCHEMA = z.object({
|
|
478
528
|
actions: ACTION_RUN_INVOCATION_SCHEMA.array(),
|
|
479
529
|
contextId: z.string(),
|
|
@@ -504,6 +554,21 @@ const TARGET_ACTION_SCHEMA = z.union([
|
|
|
504
554
|
status: z.enum(["failed", "skipped", "succeeded"]),
|
|
505
555
|
}),
|
|
506
556
|
]);
|
|
557
|
+
const TARGET_ACTION_TRANSPORT_SCHEMA = z.union([
|
|
558
|
+
z.object({
|
|
559
|
+
context: RUNTIME_VALUE_TRANSPORT_CONTEXT_SCHEMA,
|
|
560
|
+
id: z.string(),
|
|
561
|
+
scopePath: HOOK_SCOPE_PATH_SCHEMA,
|
|
562
|
+
slot: z.number().int(),
|
|
563
|
+
status: z.literal("pending"),
|
|
564
|
+
}),
|
|
565
|
+
z.object({
|
|
566
|
+
id: z.string(),
|
|
567
|
+
scopePath: HOOK_SCOPE_PATH_SCHEMA,
|
|
568
|
+
slot: z.number().int(),
|
|
569
|
+
status: z.enum(["failed", "skipped", "succeeded"]),
|
|
570
|
+
}),
|
|
571
|
+
]);
|
|
507
572
|
const AI_WARNING_SCHEMA = z.discriminatedUnion("type", [
|
|
508
573
|
z.object({
|
|
509
574
|
details: z.string().optional(),
|
|
@@ -604,6 +669,15 @@ export const generationResultSchema = z.object({
|
|
|
604
669
|
usage: GENERATION_USAGE_SCHEMA,
|
|
605
670
|
warnings: AI_WARNING_SCHEMA.array().optional(),
|
|
606
671
|
});
|
|
672
|
+
const RUNTIME_GENERATION_RESULT_SCHEMA = generationResultSchema
|
|
673
|
+
.omit({ output: true, providerMetadata: true, usage: true })
|
|
674
|
+
.extend({
|
|
675
|
+
output: codecEnvelopeSchema,
|
|
676
|
+
providerMetadata: codecEnvelopeSchema,
|
|
677
|
+
usage: GENERATION_USAGE_SCHEMA.omit({ raw: true }).extend({
|
|
678
|
+
raw: codecEnvelopeSchema,
|
|
679
|
+
}),
|
|
680
|
+
});
|
|
607
681
|
const RUNTIME_GENERATION_OUTPUT_SCHEMA = z
|
|
608
682
|
.object({
|
|
609
683
|
description: z.string().optional(),
|
|
@@ -697,6 +771,37 @@ export const platformImageGenerationInputSchema = imageGenerationInputSchema.ext
|
|
|
697
771
|
export const platformImageGenerationStartSchema = z.object({
|
|
698
772
|
key: z.string().min(1),
|
|
699
773
|
});
|
|
774
|
+
const PLATFORM_IMAGE_GENERATION_TRANSPORT_INPUT_SCHEMA = platformImageGenerationInputSchema.omit({ prompt: true }).extend({
|
|
775
|
+
prompt: codecEnvelopeSchema,
|
|
776
|
+
});
|
|
777
|
+
const ACTION_COMPLETION_SCHEMA = z.union([
|
|
778
|
+
z.object({
|
|
779
|
+
reason: z.literal("closed-dependency"),
|
|
780
|
+
status: z.literal("skipped"),
|
|
781
|
+
}),
|
|
782
|
+
z.object({
|
|
783
|
+
failure: automationErrorSchema,
|
|
784
|
+
reason: z.literal("failed-dependency"),
|
|
785
|
+
status: z.literal("skipped"),
|
|
786
|
+
}),
|
|
787
|
+
z.object({
|
|
788
|
+
failure: automationErrorSchema,
|
|
789
|
+
status: z.literal("failed"),
|
|
790
|
+
}),
|
|
791
|
+
z.object({
|
|
792
|
+
output: encodableSchema,
|
|
793
|
+
status: z.literal("succeeded"),
|
|
794
|
+
}),
|
|
795
|
+
]);
|
|
796
|
+
const ACTION_COMPLETION_TRANSPORT_SCHEMA = z.union([
|
|
797
|
+
ACTION_COMPLETION_SCHEMA.options[0],
|
|
798
|
+
ACTION_COMPLETION_SCHEMA.options[1],
|
|
799
|
+
ACTION_COMPLETION_SCHEMA.options[2],
|
|
800
|
+
z.object({
|
|
801
|
+
output: codecEnvelopeSchema,
|
|
802
|
+
status: z.literal("succeeded"),
|
|
803
|
+
}),
|
|
804
|
+
]);
|
|
700
805
|
/**
|
|
701
806
|
* Hashes one coordinator definition exactly as the runtime stores it.
|
|
702
807
|
*
|
|
@@ -724,32 +829,12 @@ export const runtimeContract = {
|
|
|
724
829
|
commit: oc
|
|
725
830
|
.input(z.object({
|
|
726
831
|
actionInvocations: ACTION_INVOCATION_SCHEMA.array(),
|
|
727
|
-
coordinationOffers:
|
|
832
|
+
coordinationOffers: COORDINATION_OFFER_TRANSPORT_SCHEMA.array(),
|
|
728
833
|
settled: z.boolean(),
|
|
729
834
|
signalInvocations: SIGNAL_INVOCATION_SCHEMA.array(),
|
|
730
835
|
}))
|
|
731
836
|
.output(z.void()),
|
|
732
|
-
completeAction: oc
|
|
733
|
-
.input(z.union([
|
|
734
|
-
z.object({
|
|
735
|
-
reason: z.literal("closed-dependency"),
|
|
736
|
-
status: z.literal("skipped"),
|
|
737
|
-
}),
|
|
738
|
-
z.object({
|
|
739
|
-
failure: automationErrorSchema,
|
|
740
|
-
reason: z.literal("failed-dependency"),
|
|
741
|
-
status: z.literal("skipped"),
|
|
742
|
-
}),
|
|
743
|
-
z.object({
|
|
744
|
-
failure: automationErrorSchema,
|
|
745
|
-
status: z.literal("failed"),
|
|
746
|
-
}),
|
|
747
|
-
z.object({
|
|
748
|
-
output: encodableSchema,
|
|
749
|
-
status: z.literal("succeeded"),
|
|
750
|
-
}),
|
|
751
|
-
]))
|
|
752
|
-
.output(z.void()),
|
|
837
|
+
completeAction: oc.input(ACTION_COMPLETION_TRANSPORT_SCHEMA).output(z.void()),
|
|
753
838
|
completeTraceSpan: oc
|
|
754
839
|
.input(z
|
|
755
840
|
.object({
|
|
@@ -766,27 +851,27 @@ export const runtimeContract = {
|
|
|
766
851
|
.output(z.void()),
|
|
767
852
|
generate: oc
|
|
768
853
|
.input(RUNTIME_GENERATION_INPUT_SCHEMA)
|
|
769
|
-
.output(
|
|
854
|
+
.output(RUNTIME_GENERATION_RESULT_SCHEMA),
|
|
770
855
|
startImageGeneration: oc
|
|
771
|
-
.input(
|
|
856
|
+
.input(PLATFORM_IMAGE_GENERATION_TRANSPORT_INPUT_SCHEMA)
|
|
772
857
|
.output(platformImageGenerationStartSchema),
|
|
773
858
|
createCallbackToken: oc
|
|
774
859
|
.input(z.object({ endpointKey: z.string().min(1) }))
|
|
775
860
|
.output(z.string()),
|
|
776
861
|
invokeAutomation: oc
|
|
777
|
-
.input(
|
|
862
|
+
.input(AUTOMATION_INVOCATION_TRANSPORT_INPUT_SCHEMA)
|
|
778
863
|
.output(automationInvocationOutputSchema),
|
|
779
864
|
load: oc.output(z.object({
|
|
780
865
|
context: RUNTIME_RUN_CONTEXT_SCHEMA,
|
|
781
866
|
finalAttempt: z.boolean(),
|
|
782
|
-
targetAction:
|
|
867
|
+
targetAction: TARGET_ACTION_TRANSPORT_SCHEMA.optional(),
|
|
783
868
|
})),
|
|
784
869
|
loadValues: oc
|
|
785
870
|
.input(SIGNAL_DEPENDENCIES_SCHEMA.omit({
|
|
786
871
|
scopePath: true,
|
|
787
872
|
slot: true,
|
|
788
873
|
}))
|
|
789
|
-
.output(
|
|
874
|
+
.output(RUNTIME_VALUE_TRANSPORT_CONTEXT_SCHEMA),
|
|
790
875
|
resolveAccountInput: oc
|
|
791
876
|
.input(z.strictObject({
|
|
792
877
|
binding: z.string().min(1),
|
|
@@ -800,7 +885,7 @@ export const runtimeContract = {
|
|
|
800
885
|
sendOutput: oc
|
|
801
886
|
.input(z.object({
|
|
802
887
|
output: z.object({
|
|
803
|
-
data:
|
|
888
|
+
data: codecEnvelopeSchema,
|
|
804
889
|
type: z.string().min(1),
|
|
805
890
|
}),
|
|
806
891
|
outputIndex: z.number().int().nonnegative(),
|
|
@@ -809,7 +894,7 @@ export const runtimeContract = {
|
|
|
809
894
|
.output(z.void()),
|
|
810
895
|
sendLog: oc
|
|
811
896
|
.input(z.object({
|
|
812
|
-
fields:
|
|
897
|
+
fields: codecEnvelopeSchema.optional(),
|
|
813
898
|
level: z.enum(["debug", "info", "warn", "error"]),
|
|
814
899
|
logIndex: LOG_INDEX_SCHEMA,
|
|
815
900
|
message: z.string().min(1).max(AUTOMATION_LOG_MAX_MESSAGE_LENGTH),
|
|
@@ -820,7 +905,7 @@ export const runtimeContract = {
|
|
|
820
905
|
.output(z.void()),
|
|
821
906
|
startTraceSpan: oc
|
|
822
907
|
.input(z.object({
|
|
823
|
-
attributes:
|
|
908
|
+
attributes: codecEnvelopeSchema.optional(),
|
|
824
909
|
name: z.string().min(1).max(AUTOMATION_TRACE_MAX_NAME_LENGTH),
|
|
825
910
|
sensitivity: sensitivityMaskSchema.optional(),
|
|
826
911
|
parentSpanIndex: TRACE_SPAN_INDEX_SCHEMA.optional(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automate.ax/api-contract",
|
|
3
|
-
"version": "0.87.
|
|
3
|
+
"version": "0.87.2",
|
|
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.87.
|
|
35
|
-
"@automate.ax/integration-contracts": "0.87.
|
|
34
|
+
"@automate.ax/codec": "0.87.2",
|
|
35
|
+
"@automate.ax/integration-contracts": "0.87.2",
|
|
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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { codecEnvelopeSchema } from "@automate.ax/codec/rpc"
|
|
2
2
|
import { sensitivityMaskSchema } from "./runtime"
|
|
3
3
|
import { oc } from "@orpc/contract"
|
|
4
4
|
import * as z from "zod"
|
|
@@ -95,7 +95,7 @@ export const automationContract = {
|
|
|
95
95
|
hasOutput: z.boolean(),
|
|
96
96
|
id: z.string(),
|
|
97
97
|
name: z.string(),
|
|
98
|
-
output:
|
|
98
|
+
output: codecEnvelopeSchema.optional(),
|
|
99
99
|
outputSensitivity: sensitivityMaskSchema.nullable().optional(),
|
|
100
100
|
slot: z.number().int().nonnegative(),
|
|
101
101
|
status: z.enum(["pending", "succeeded", "skipped", "failed"]),
|
|
@@ -105,7 +105,7 @@ export const automationContract = {
|
|
|
105
105
|
.object({
|
|
106
106
|
createdAt: z.date(),
|
|
107
107
|
id: z.string(),
|
|
108
|
-
payload:
|
|
108
|
+
payload: codecEnvelopeSchema,
|
|
109
109
|
type: z.string(),
|
|
110
110
|
})
|
|
111
111
|
.array(),
|
|
@@ -113,7 +113,7 @@ export const automationContract = {
|
|
|
113
113
|
.object({
|
|
114
114
|
actionInvocationId: z.string(),
|
|
115
115
|
createdAt: z.date(),
|
|
116
|
-
data:
|
|
116
|
+
data: codecEnvelopeSchema,
|
|
117
117
|
id: z.string(),
|
|
118
118
|
sensitivity: sensitivityMaskSchema.nullable().optional(),
|
|
119
119
|
outputIndex: z.number().int().nonnegative(),
|
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 = 2
|