@automate.ax/api-contract 0.94.1 → 0.95.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.
@@ -51,8 +51,8 @@ export declare const automationOutputSchema: z.ZodObject<{
51
51
  }, z.core.$strip>;
52
52
  export declare const automationExecutionStatusSchema: z.ZodEnum<{
53
53
  failed: "failed";
54
- settled: "settled";
55
54
  running: "running";
55
+ settled: "settled";
56
56
  }>;
57
57
  export declare const automationContract: {
58
58
  get: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
@@ -114,8 +114,8 @@ export declare const automationContract: {
114
114
  id: z.ZodString;
115
115
  status: z.ZodEnum<{
116
116
  failed: "failed";
117
- settled: "settled";
118
117
  running: "running";
118
+ settled: "settled";
119
119
  }>;
120
120
  createdAt: z.ZodDate;
121
121
  failure: z.ZodNullable<z.ZodType<import("./errors").AutomationErrorValue, import("./errors").AutomationErrorValue, z.core.$ZodTypeInternals<import("./errors").AutomationErrorValue, import("./errors").AutomationErrorValue>>>;
@@ -228,8 +228,8 @@ export declare const automationContract: {
228
228
  settledAt: z.ZodNullable<z.ZodDate>;
229
229
  status: z.ZodEnum<{
230
230
  failed: "failed";
231
- settled: "settled";
232
231
  running: "running";
232
+ settled: "settled";
233
233
  }>;
234
234
  }, z.core.$strip>>, Record<never, never>, Record<never, never>>;
235
235
  update: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- export declare const EXECUTION_DATASET_VERSION = 7;
2
+ export declare const EXECUTION_DATASET_VERSION = 8;
3
3
  export declare const executionDatasetResourceSchema: z.ZodEnum<{
4
4
  automations: "automations";
5
5
  projects: "projects";
@@ -10,6 +10,7 @@ export declare const executionDatasetResourceSchema: z.ZodEnum<{
10
10
  contexts: "contexts";
11
11
  "context-parents": "context-parents";
12
12
  "event-links": "event-links";
13
+ "action-attempts": "action-attempts";
13
14
  "signal-invocations": "signal-invocations";
14
15
  "signal-coordinators": "signal-coordinators";
15
16
  "signal-offers": "signal-offers";
@@ -37,6 +38,7 @@ export declare const executionDatasetManifestSchema: z.ZodObject<{
37
38
  contexts: "contexts";
38
39
  "context-parents": "context-parents";
39
40
  "event-links": "event-links";
41
+ "action-attempts": "action-attempts";
40
42
  "signal-invocations": "signal-invocations";
41
43
  "signal-coordinators": "signal-coordinators";
42
44
  "signal-offers": "signal-offers";
@@ -46,7 +48,7 @@ export declare const executionDatasetManifestSchema: z.ZodObject<{
46
48
  }>;
47
49
  url: z.ZodURL;
48
50
  }, z.core.$strip>>;
49
- schemaVersion: z.ZodLiteral<7>;
51
+ schemaVersion: z.ZodLiteral<8>;
50
52
  scope: z.ZodObject<{
51
53
  organizationId: z.ZodNullable<z.ZodString>;
52
54
  projectId: z.ZodNullable<z.ZodString>;
@@ -75,6 +77,7 @@ export declare const executionDataContract: {
75
77
  contexts: "contexts";
76
78
  "context-parents": "context-parents";
77
79
  "event-links": "event-links";
80
+ "action-attempts": "action-attempts";
78
81
  "signal-invocations": "signal-invocations";
79
82
  "signal-coordinators": "signal-coordinators";
80
83
  "signal-offers": "signal-offers";
@@ -84,7 +87,7 @@ export declare const executionDataContract: {
84
87
  }>;
85
88
  url: z.ZodURL;
86
89
  }, z.core.$strip>>;
87
- schemaVersion: z.ZodLiteral<7>;
90
+ schemaVersion: z.ZodLiteral<8>;
88
91
  scope: z.ZodObject<{
89
92
  organizationId: z.ZodNullable<z.ZodString>;
90
93
  projectId: z.ZodNullable<z.ZodString>;
@@ -1,6 +1,6 @@
1
1
  import { oc } from "@orpc/contract";
2
2
  import { z } from "zod";
3
- export const EXECUTION_DATASET_VERSION = 7;
3
+ export const EXECUTION_DATASET_VERSION = 8;
4
4
  export const executionDatasetResourceSchema = z.enum([
5
5
  "projects",
6
6
  "automations",
@@ -10,6 +10,7 @@ export const executionDatasetResourceSchema = z.enum([
10
10
  "event-links",
11
11
  "events",
12
12
  "actions",
13
+ "action-attempts",
13
14
  "signal-invocations",
14
15
  "signal-coordinators",
15
16
  "signal-offers",
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ export { AUTOMATION_SDK_VERSION, deploymentOutputSchema, deploymentStatusSchema,
4
4
  export { AUTOMATION_RUNTIME_PROTOCOL_VERSION } from "./runtime-protocol.js";
5
5
  export { AUTOMATION_ERROR_CAUSE_DEPTH, automationErrorSchema, type AutomationErrorValue, } from "./errors.js";
6
6
  export { integrationAccountOutputSchema, integrationAccountRevocationImpactOutputSchema, integrationAccountRevocationOutputSchema, integrationServiceOutputSchema, } from "./account.js";
7
- export { AUTOMATION_INVOCATION_DEFAULT_ENTRYPOINT, AUTOMATION_INVOCATION_RESERVED_ENTRYPOINT_PREFIX, AUTOMATION_IMAGE_GENERATION_ENTRYPOINT_PREFIX, AUTOMATION_LOG_MAX_ENTRIES, AUTOMATION_LOG_MAX_MESSAGE_LENGTH, AUTOMATION_OBSERVABILITY_MAX_ENCODED_BYTES, AUTOMATION_OBSERVABILITY_MAX_FIELDS, AUTOMATION_TRACE_MAX_NAME_LENGTH, AUTOMATION_TRACE_MAX_SPANS, DEFAULT_GATEWAY_IMAGE_MODEL_ID, DEFAULT_GATEWAY_MODEL_ID, automationInvocationInputSchema, automationInvocationOutputSchema, automationInvocationScheduleSchema, generationInputSchema, generationResultSchema, imageGenerationInputSchema, imageGenerationCompletionSchema, imageGenerationResultSchema, platformImageGenerationInputSchema, platformImageGenerationStartSchema, hashSignalCoordinatorConfiguration, runtimeContract, type GenerationInput, type GenerationResult, type ImageGenerationInput, type ImageGenerationCompletion, type ImageGenerationResult, type PlatformImageGenerationInput, type RuntimeGenerationInput, type RuntimeCoordinationOffer, } from "./runtime.js";
7
+ export { AUTOMATION_INVOCATION_DEFAULT_ENTRYPOINT, AUTOMATION_INVOCATION_RESERVED_ENTRYPOINT_PREFIX, AUTOMATION_IMAGE_GENERATION_ENTRYPOINT_PREFIX, AUTOMATION_LOG_MAX_ENTRIES, AUTOMATION_LOG_MAX_MESSAGE_LENGTH, AUTOMATION_OBSERVABILITY_MAX_ENCODED_BYTES, AUTOMATION_OBSERVABILITY_MAX_FIELDS, AUTOMATION_TRACE_MAX_NAME_LENGTH, AUTOMATION_TRACE_MAX_SPANS, DEFAULT_GATEWAY_IMAGE_MODEL_ID, DEFAULT_GATEWAY_MODEL_ID, DEFAULT_ACTION_MAX_ATTEMPTS, MAX_ACTION_ATTEMPTS, actionReplaySafetySchema, automationInvocationInputSchema, automationInvocationOutputSchema, automationInvocationScheduleSchema, generationInputSchema, generationResultSchema, imageGenerationInputSchema, imageGenerationCompletionSchema, imageGenerationResultSchema, platformImageGenerationInputSchema, platformImageGenerationStartSchema, hashSignalCoordinatorConfiguration, runtimeContract, type GenerationInput, type GenerationResult, type ImageGenerationInput, type ImageGenerationCompletion, type ImageGenerationResult, type PlatformImageGenerationInput, type RuntimeGenerationInput, type RuntimeCoordinationOffer, type ActionReplaySafety, type RuntimeActionAttemptCompletion, type RuntimeActionAttemptStart, } from "./runtime.js";
8
8
  export type { GatewayImageModelId, GatewayModelId } from "@ai-sdk/gateway";
9
9
  export { createdOrganizationApiKeyOutputSchema, organizationApiKeyOutputSchema, } from "./api-key.js";
10
10
  export { activeSubscriptionOutputSchema, createdInvitationOutputSchema, organizationDetailsOutputSchema, organizationInvitationOutputSchema, organizationMemberOutputSchema, organizationProjectOutputSchema, organizationRoleSchema, organizationSummaryOutputSchema, publicOrganizationOutputSchema, } from "./org.js";
@@ -680,6 +680,7 @@ export declare const publicContract: {
680
680
  contexts: "contexts";
681
681
  "context-parents": "context-parents";
682
682
  "event-links": "event-links";
683
+ "action-attempts": "action-attempts";
683
684
  "signal-invocations": "signal-invocations";
684
685
  "signal-coordinators": "signal-coordinators";
685
686
  "signal-offers": "signal-offers";
@@ -689,7 +690,7 @@ export declare const publicContract: {
689
690
  }>;
690
691
  url: import("zod").ZodURL;
691
692
  }, import("zod/v4/core").$strip>>;
692
- schemaVersion: import("zod").ZodLiteral<7>;
693
+ schemaVersion: import("zod").ZodLiteral<8>;
693
694
  scope: import("zod").ZodObject<{
694
695
  organizationId: import("zod").ZodNullable<import("zod").ZodString>;
695
696
  projectId: import("zod").ZodNullable<import("zod").ZodString>;
@@ -966,8 +967,8 @@ export declare const firstPartyContract: {
966
967
  id: import("zod").ZodString;
967
968
  status: import("zod").ZodEnum<{
968
969
  failed: "failed";
969
- settled: "settled";
970
970
  running: "running";
971
+ settled: "settled";
971
972
  }>;
972
973
  createdAt: import("zod").ZodDate;
973
974
  failure: import("zod").ZodNullable<import("zod").ZodType<import("./errors").AutomationErrorValue, import("./errors").AutomationErrorValue, import("zod/v4/core").$ZodTypeInternals<import("./errors").AutomationErrorValue, import("./errors").AutomationErrorValue>>>;
@@ -1017,8 +1018,8 @@ export declare const firstPartyContract: {
1017
1018
  settledAt: import("zod").ZodNullable<import("zod").ZodDate>;
1018
1019
  status: import("zod").ZodEnum<{
1019
1020
  failed: "failed";
1020
- settled: "settled";
1021
1021
  running: "running";
1022
+ settled: "settled";
1022
1023
  }>;
1023
1024
  }, import("zod/v4/core").$strip>>, Record<never, never>, Record<never, never>>;
1024
1025
  get: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
@@ -2035,6 +2036,7 @@ export declare const firstPartyContract: {
2035
2036
  contexts: "contexts";
2036
2037
  "context-parents": "context-parents";
2037
2038
  "event-links": "event-links";
2039
+ "action-attempts": "action-attempts";
2038
2040
  "signal-invocations": "signal-invocations";
2039
2041
  "signal-coordinators": "signal-coordinators";
2040
2042
  "signal-offers": "signal-offers";
@@ -2044,7 +2046,7 @@ export declare const firstPartyContract: {
2044
2046
  }>;
2045
2047
  url: import("zod").ZodURL;
2046
2048
  }, import("zod/v4/core").$strip>>;
2047
- schemaVersion: import("zod").ZodLiteral<7>;
2049
+ schemaVersion: import("zod").ZodLiteral<8>;
2048
2050
  scope: import("zod").ZodObject<{
2049
2051
  organizationId: import("zod").ZodNullable<import("zod").ZodString>;
2050
2052
  projectId: import("zod").ZodNullable<import("zod").ZodString>;
@@ -3744,6 +3746,7 @@ export declare const contract: {
3744
3746
  description: import("zod").ZodNullable<import("zod").ZodString>;
3745
3747
  eventDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
3746
3748
  inputHash: import("zod").ZodString;
3749
+ maxAttempts: import("zod").ZodDefault<import("zod").ZodNumber>;
3747
3750
  name: import("zod").ZodString;
3748
3751
  outputSensitivity: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodCustom<import("@automate.ax/codec").SensitivityMask, import("@automate.ax/codec").SensitivityMask>>>;
3749
3752
  scopePath: import("zod").ZodArray<import("zod").ZodNumber>;
@@ -3774,6 +3777,7 @@ export declare const contract: {
3774
3777
  description: import("zod").ZodNullable<import("zod").ZodString>;
3775
3778
  eventDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
3776
3779
  inputHash: import("zod").ZodString;
3780
+ maxAttempts: import("zod").ZodDefault<import("zod").ZodNumber>;
3777
3781
  name: import("zod").ZodString;
3778
3782
  outputSensitivity: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodCustom<import("@automate.ax/codec").SensitivityMask, import("@automate.ax/codec").SensitivityMask>>>;
3779
3783
  scopePath: import("zod").ZodArray<import("zod").ZodNumber>;
@@ -3805,6 +3809,7 @@ export declare const contract: {
3805
3809
  description: import("zod").ZodNullable<import("zod").ZodString>;
3806
3810
  eventDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
3807
3811
  inputHash: import("zod").ZodString;
3812
+ maxAttempts: import("zod").ZodDefault<import("zod").ZodNumber>;
3808
3813
  name: import("zod").ZodString;
3809
3814
  outputSensitivity: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodCustom<import("@automate.ax/codec").SensitivityMask, import("@automate.ax/codec").SensitivityMask>>>;
3810
3815
  scopePath: import("zod").ZodArray<import("zod").ZodNumber>;
@@ -4189,6 +4194,20 @@ export declare const contract: {
4189
4194
  output: import("zod").ZodCustom<import("@automate.ax/codec/rpc").CodecEnvelope, import("@automate.ax/codec/rpc").CodecEnvelope>;
4190
4195
  status: import("zod").ZodLiteral<"succeeded">;
4191
4196
  }, import("zod/v4/core").$strip>]>, import("zod").ZodVoid, Record<never, never>, Record<never, never>>;
4197
+ completeActionAttempt: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
4198
+ failure: import("zod").ZodType<import("./errors").AutomationErrorValue, import("./errors").AutomationErrorValue, import("zod/v4/core").$ZodTypeInternals<import("./errors").AutomationErrorValue, import("./errors").AutomationErrorValue>>;
4199
+ status: import("zod").ZodLiteral<"failed">;
4200
+ }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
4201
+ failure: import("zod").ZodType<import("./errors").AutomationErrorValue, import("./errors").AutomationErrorValue, import("zod/v4/core").$ZodTypeInternals<import("./errors").AutomationErrorValue, import("./errors").AutomationErrorValue>>;
4202
+ status: import("zod").ZodLiteral<"indeterminate">;
4203
+ }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
4204
+ failure: import("zod").ZodType<import("./errors").AutomationErrorValue, import("./errors").AutomationErrorValue, import("zod/v4/core").$ZodTypeInternals<import("./errors").AutomationErrorValue, import("./errors").AutomationErrorValue>>;
4205
+ retryAt: import("zod").ZodOptional<import("zod").ZodDate>;
4206
+ status: import("zod").ZodLiteral<"retrying">;
4207
+ }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
4208
+ output: import("zod").ZodCustom<import("@automate.ax/codec/rpc").CodecEnvelope, import("@automate.ax/codec/rpc").CodecEnvelope>;
4209
+ status: import("zod").ZodLiteral<"succeeded">;
4210
+ }, import("zod/v4/core").$strip>], "status">, import("zod").ZodVoid, Record<never, never>, Record<never, never>>;
4192
4211
  completeTraceSpan: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodIntersection<import("zod").ZodObject<{
4193
4212
  completedAt: import("zod").ZodDate;
4194
4213
  spanIndex: import("zod").ZodNumber;
@@ -4343,6 +4362,9 @@ export declare const contract: {
4343
4362
  load: import("@orpc/contract").ContractProcedureBuilderWithOutput<import("@orpc/contract").Schema<unknown, unknown>, import("zod").ZodObject<{
4344
4363
  context: import("zod").ZodObject<{
4345
4364
  actions: import("zod").ZodArray<import("zod").ZodUnion<readonly [import("zod").ZodObject<{
4365
+ description: import("zod").ZodNullable<import("zod").ZodString>;
4366
+ name: import("zod").ZodString;
4367
+ scopePath: import("zod").ZodArray<import("zod").ZodNumber>;
4346
4368
  actionDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
4347
4369
  derivation: import("zod").ZodNullable<import("zod").ZodObject<{
4348
4370
  nodes: import("zod").ZodArray<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
@@ -4363,18 +4385,18 @@ export declare const contract: {
4363
4385
  }, import("zod/v4/core").$strip>], "type">>;
4364
4386
  roots: import("zod").ZodArray<import("zod").ZodNumber>;
4365
4387
  }, import("zod/v4/core").$strip>>;
4366
- description: import("zod").ZodNullable<import("zod").ZodString>;
4367
4388
  eventDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
4368
4389
  inputHash: import("zod").ZodString;
4369
- name: import("zod").ZodString;
4370
4390
  outputSensitivity: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodCustom<import("@automate.ax/codec").SensitivityMask, import("@automate.ax/codec").SensitivityMask>>>;
4371
- scopePath: import("zod").ZodArray<import("zod").ZodNumber>;
4372
4391
  signalDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
4373
4392
  slot: import("zod").ZodNumber;
4374
4393
  actionInvocationId: import("zod").ZodString;
4375
4394
  contextId: import("zod").ZodString;
4376
4395
  status: import("zod").ZodLiteral<"pending">;
4377
4396
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
4397
+ description: import("zod").ZodNullable<import("zod").ZodString>;
4398
+ name: import("zod").ZodString;
4399
+ scopePath: import("zod").ZodArray<import("zod").ZodNumber>;
4378
4400
  actionDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
4379
4401
  derivation: import("zod").ZodNullable<import("zod").ZodObject<{
4380
4402
  nodes: import("zod").ZodArray<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
@@ -4395,12 +4417,9 @@ export declare const contract: {
4395
4417
  }, import("zod/v4/core").$strip>], "type">>;
4396
4418
  roots: import("zod").ZodArray<import("zod").ZodNumber>;
4397
4419
  }, import("zod/v4/core").$strip>>;
4398
- description: import("zod").ZodNullable<import("zod").ZodString>;
4399
4420
  eventDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
4400
4421
  inputHash: import("zod").ZodString;
4401
- name: import("zod").ZodString;
4402
4422
  outputSensitivity: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodCustom<import("@automate.ax/codec").SensitivityMask, import("@automate.ax/codec").SensitivityMask>>>;
4403
- scopePath: import("zod").ZodArray<import("zod").ZodNumber>;
4404
4423
  signalDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
4405
4424
  slot: import("zod").ZodNumber;
4406
4425
  actionInvocationId: import("zod").ZodString;
@@ -4409,6 +4428,9 @@ export declare const contract: {
4409
4428
  outcomeSeq: import("zod").ZodNumber;
4410
4429
  status: import("zod").ZodLiteral<"failed">;
4411
4430
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
4431
+ description: import("zod").ZodNullable<import("zod").ZodString>;
4432
+ name: import("zod").ZodString;
4433
+ scopePath: import("zod").ZodArray<import("zod").ZodNumber>;
4412
4434
  actionDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
4413
4435
  derivation: import("zod").ZodNullable<import("zod").ZodObject<{
4414
4436
  nodes: import("zod").ZodArray<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
@@ -4429,12 +4451,9 @@ export declare const contract: {
4429
4451
  }, import("zod/v4/core").$strip>], "type">>;
4430
4452
  roots: import("zod").ZodArray<import("zod").ZodNumber>;
4431
4453
  }, import("zod/v4/core").$strip>>;
4432
- description: import("zod").ZodNullable<import("zod").ZodString>;
4433
4454
  eventDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
4434
4455
  inputHash: import("zod").ZodString;
4435
- name: import("zod").ZodString;
4436
4456
  outputSensitivity: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodCustom<import("@automate.ax/codec").SensitivityMask, import("@automate.ax/codec").SensitivityMask>>>;
4437
- scopePath: import("zod").ZodArray<import("zod").ZodNumber>;
4438
4457
  signalDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
4439
4458
  slot: import("zod").ZodNumber;
4440
4459
  actionInvocationId: import("zod").ZodString;
@@ -4443,6 +4462,9 @@ export declare const contract: {
4443
4462
  reason: import("zod").ZodLiteral<"closed-dependency">;
4444
4463
  status: import("zod").ZodLiteral<"skipped">;
4445
4464
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
4465
+ description: import("zod").ZodNullable<import("zod").ZodString>;
4466
+ name: import("zod").ZodString;
4467
+ scopePath: import("zod").ZodArray<import("zod").ZodNumber>;
4446
4468
  actionDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
4447
4469
  derivation: import("zod").ZodNullable<import("zod").ZodObject<{
4448
4470
  nodes: import("zod").ZodArray<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
@@ -4463,12 +4485,9 @@ export declare const contract: {
4463
4485
  }, import("zod/v4/core").$strip>], "type">>;
4464
4486
  roots: import("zod").ZodArray<import("zod").ZodNumber>;
4465
4487
  }, import("zod/v4/core").$strip>>;
4466
- description: import("zod").ZodNullable<import("zod").ZodString>;
4467
4488
  eventDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
4468
4489
  inputHash: import("zod").ZodString;
4469
- name: import("zod").ZodString;
4470
4490
  outputSensitivity: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodCustom<import("@automate.ax/codec").SensitivityMask, import("@automate.ax/codec").SensitivityMask>>>;
4471
- scopePath: import("zod").ZodArray<import("zod").ZodNumber>;
4472
4491
  signalDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
4473
4492
  slot: import("zod").ZodNumber;
4474
4493
  actionInvocationId: import("zod").ZodString;
@@ -4478,6 +4497,9 @@ export declare const contract: {
4478
4497
  reason: import("zod").ZodLiteral<"failed-dependency">;
4479
4498
  status: import("zod").ZodLiteral<"skipped">;
4480
4499
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
4500
+ description: import("zod").ZodNullable<import("zod").ZodString>;
4501
+ name: import("zod").ZodString;
4502
+ scopePath: import("zod").ZodArray<import("zod").ZodNumber>;
4481
4503
  actionDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
4482
4504
  derivation: import("zod").ZodNullable<import("zod").ZodObject<{
4483
4505
  nodes: import("zod").ZodArray<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
@@ -4498,12 +4520,9 @@ export declare const contract: {
4498
4520
  }, import("zod/v4/core").$strip>], "type">>;
4499
4521
  roots: import("zod").ZodArray<import("zod").ZodNumber>;
4500
4522
  }, import("zod/v4/core").$strip>>;
4501
- description: import("zod").ZodNullable<import("zod").ZodString>;
4502
4523
  eventDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
4503
4524
  inputHash: import("zod").ZodString;
4504
- name: import("zod").ZodString;
4505
4525
  outputSensitivity: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodCustom<import("@automate.ax/codec").SensitivityMask, import("@automate.ax/codec").SensitivityMask>>>;
4506
- scopePath: import("zod").ZodArray<import("zod").ZodNumber>;
4507
4526
  signalDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
4508
4527
  slot: import("zod").ZodNumber;
4509
4528
  actionInvocationId: import("zod").ZodString;
@@ -4920,6 +4939,18 @@ export declare const contract: {
4920
4939
  secret: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
4921
4940
  serviceId: import("zod").ZodString;
4922
4941
  }, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
4942
+ startActionAttempt: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
4943
+ replaySafety: import("zod").ZodEnum<{
4944
+ safe: "safe";
4945
+ unsafe: "unsafe";
4946
+ }>;
4947
+ }, import("zod/v4/core").$strip>, import("zod").ZodUnion<readonly [import("zod").ZodObject<{
4948
+ attempt: import("zod").ZodNumber;
4949
+ finalAttempt: import("zod").ZodBoolean;
4950
+ status: import("zod").ZodLiteral<"running">;
4951
+ }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
4952
+ status: import("zod").ZodLiteral<"settled">;
4953
+ }, import("zod/v4/core").$strip>]>, Record<never, never>, Record<never, never>>;
4923
4954
  sendOutput: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
4924
4955
  output: import("zod").ZodObject<{
4925
4956
  data: import("zod").ZodCustom<import("@automate.ax/codec/rpc").CodecEnvelope, import("@automate.ax/codec/rpc").CodecEnvelope>;
@@ -4979,8 +5010,8 @@ export declare const contract: {
4979
5010
  id: import("zod").ZodString;
4980
5011
  status: import("zod").ZodEnum<{
4981
5012
  failed: "failed";
4982
- settled: "settled";
4983
5013
  running: "running";
5014
+ settled: "settled";
4984
5015
  }>;
4985
5016
  createdAt: import("zod").ZodDate;
4986
5017
  failure: import("zod").ZodNullable<import("zod").ZodType<import("./errors").AutomationErrorValue, import("./errors").AutomationErrorValue, import("zod/v4/core").$ZodTypeInternals<import("./errors").AutomationErrorValue, import("./errors").AutomationErrorValue>>>;
@@ -5030,8 +5061,8 @@ export declare const contract: {
5030
5061
  settledAt: import("zod").ZodNullable<import("zod").ZodDate>;
5031
5062
  status: import("zod").ZodEnum<{
5032
5063
  failed: "failed";
5033
- settled: "settled";
5034
5064
  running: "running";
5065
+ settled: "settled";
5035
5066
  }>;
5036
5067
  }, import("zod/v4/core").$strip>>, Record<never, never>, Record<never, never>>;
5037
5068
  get: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
@@ -5984,6 +6015,7 @@ export declare const contract: {
5984
6015
  contexts: "contexts";
5985
6016
  "context-parents": "context-parents";
5986
6017
  "event-links": "event-links";
6018
+ "action-attempts": "action-attempts";
5987
6019
  "signal-invocations": "signal-invocations";
5988
6020
  "signal-coordinators": "signal-coordinators";
5989
6021
  "signal-offers": "signal-offers";
@@ -5993,7 +6025,7 @@ export declare const contract: {
5993
6025
  }>;
5994
6026
  url: import("zod").ZodURL;
5995
6027
  }, import("zod/v4/core").$strip>>;
5996
- schemaVersion: import("zod").ZodLiteral<7>;
6028
+ schemaVersion: import("zod").ZodLiteral<8>;
5997
6029
  scope: import("zod").ZodObject<{
5998
6030
  organizationId: import("zod").ZodNullable<import("zod").ZodString>;
5999
6031
  projectId: import("zod").ZodNullable<import("zod").ZodString>;
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@ export { AUTOMATION_SDK_VERSION, deploymentOutputSchema, deploymentStatusSchema,
15
15
  export { AUTOMATION_RUNTIME_PROTOCOL_VERSION } from "./runtime-protocol.js";
16
16
  export { AUTOMATION_ERROR_CAUSE_DEPTH, automationErrorSchema, } from "./errors.js";
17
17
  export { integrationAccountOutputSchema, integrationAccountRevocationImpactOutputSchema, integrationAccountRevocationOutputSchema, integrationServiceOutputSchema, } from "./account.js";
18
- export { AUTOMATION_INVOCATION_DEFAULT_ENTRYPOINT, AUTOMATION_INVOCATION_RESERVED_ENTRYPOINT_PREFIX, AUTOMATION_IMAGE_GENERATION_ENTRYPOINT_PREFIX, AUTOMATION_LOG_MAX_ENTRIES, AUTOMATION_LOG_MAX_MESSAGE_LENGTH, AUTOMATION_OBSERVABILITY_MAX_ENCODED_BYTES, AUTOMATION_OBSERVABILITY_MAX_FIELDS, AUTOMATION_TRACE_MAX_NAME_LENGTH, AUTOMATION_TRACE_MAX_SPANS, DEFAULT_GATEWAY_IMAGE_MODEL_ID, DEFAULT_GATEWAY_MODEL_ID, automationInvocationInputSchema, automationInvocationOutputSchema, automationInvocationScheduleSchema, generationInputSchema, generationResultSchema, imageGenerationInputSchema, imageGenerationCompletionSchema, imageGenerationResultSchema, platformImageGenerationInputSchema, platformImageGenerationStartSchema, hashSignalCoordinatorConfiguration, runtimeContract, } from "./runtime.js";
18
+ export { AUTOMATION_INVOCATION_DEFAULT_ENTRYPOINT, AUTOMATION_INVOCATION_RESERVED_ENTRYPOINT_PREFIX, AUTOMATION_IMAGE_GENERATION_ENTRYPOINT_PREFIX, AUTOMATION_LOG_MAX_ENTRIES, AUTOMATION_LOG_MAX_MESSAGE_LENGTH, AUTOMATION_OBSERVABILITY_MAX_ENCODED_BYTES, AUTOMATION_OBSERVABILITY_MAX_FIELDS, AUTOMATION_TRACE_MAX_NAME_LENGTH, AUTOMATION_TRACE_MAX_SPANS, DEFAULT_GATEWAY_IMAGE_MODEL_ID, DEFAULT_GATEWAY_MODEL_ID, DEFAULT_ACTION_MAX_ATTEMPTS, MAX_ACTION_ATTEMPTS, actionReplaySafetySchema, automationInvocationInputSchema, automationInvocationOutputSchema, automationInvocationScheduleSchema, generationInputSchema, generationResultSchema, imageGenerationInputSchema, imageGenerationCompletionSchema, imageGenerationResultSchema, platformImageGenerationInputSchema, platformImageGenerationStartSchema, hashSignalCoordinatorConfiguration, runtimeContract, } from "./runtime.js";
19
19
  export { createdOrganizationApiKeyOutputSchema, organizationApiKeyOutputSchema, } from "./api-key.js";
20
20
  export { activeSubscriptionOutputSchema, createdInvitationOutputSchema, organizationDetailsOutputSchema, organizationInvitationOutputSchema, organizationMemberOutputSchema, organizationProjectOutputSchema, organizationRoleSchema, organizationSummaryOutputSchema, publicOrganizationOutputSchema, } from "./org.js";
21
21
  export { projectOutputSchema } from "./project.js";
package/dist/runtime.d.ts CHANGED
@@ -76,6 +76,17 @@ export declare const signalDerivationSchema: z.ZodObject<{
76
76
  }, z.core.$strip>;
77
77
  /** Persisted source, property, and opaque transform derivation graph. */
78
78
  export type SignalDerivation = z.infer<typeof signalDerivationSchema>;
79
+ /** Whether replay is safe after an action delivery ends ambiguously. */
80
+ export declare const actionReplaySafetySchema: z.ZodEnum<{
81
+ safe: "safe";
82
+ unsafe: "unsafe";
83
+ }>;
84
+ /** Logical attempts used when an action does not override its bound. */
85
+ export declare const DEFAULT_ACTION_MAX_ATTEMPTS = 3;
86
+ /** Hard platform bound for one action invocation's logical attempts. */
87
+ export declare const MAX_ACTION_ATTEMPTS = 10;
88
+ /** Replay-safety decision made from one action's validated input. */
89
+ export type ActionReplaySafety = z.output<typeof actionReplaySafetySchema>;
79
90
  declare const COORDINATION_OFFER_SCHEMA: z.ZodUnion<readonly [z.ZodObject<{
80
91
  actionDependencyIds: z.ZodArray<z.ZodString>;
81
92
  eventDependencyIds: z.ZodArray<z.ZodString>;
@@ -452,6 +463,9 @@ declare const RUNTIME_VALUE_CONTEXT_SCHEMA: z.ZodObject<{
452
463
  export type RuntimeValueContext = z.output<typeof RUNTIME_VALUE_CONTEXT_SCHEMA>;
453
464
  declare const RUNTIME_RUN_CONTEXT_SCHEMA: z.ZodObject<{
454
465
  actions: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
466
+ description: z.ZodNullable<z.ZodString>;
467
+ name: z.ZodString;
468
+ scopePath: z.ZodArray<z.ZodNumber>;
455
469
  actionDependencyIds: z.ZodArray<z.ZodString>;
456
470
  derivation: z.ZodNullable<z.ZodObject<{
457
471
  nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -472,18 +486,18 @@ declare const RUNTIME_RUN_CONTEXT_SCHEMA: z.ZodObject<{
472
486
  }, z.core.$strip>], "type">>;
473
487
  roots: z.ZodArray<z.ZodNumber>;
474
488
  }, z.core.$strip>>;
475
- description: z.ZodNullable<z.ZodString>;
476
489
  eventDependencyIds: z.ZodArray<z.ZodString>;
477
490
  inputHash: z.ZodString;
478
- name: z.ZodString;
479
491
  outputSensitivity: z.ZodOptional<z.ZodNullable<z.ZodCustom<SensitivityMask, SensitivityMask>>>;
480
- scopePath: z.ZodArray<z.ZodNumber>;
481
492
  signalDependencyIds: z.ZodArray<z.ZodString>;
482
493
  slot: z.ZodNumber;
483
494
  actionInvocationId: z.ZodString;
484
495
  contextId: z.ZodString;
485
496
  status: z.ZodLiteral<"pending">;
486
497
  }, z.core.$strip>, z.ZodObject<{
498
+ description: z.ZodNullable<z.ZodString>;
499
+ name: z.ZodString;
500
+ scopePath: z.ZodArray<z.ZodNumber>;
487
501
  actionDependencyIds: z.ZodArray<z.ZodString>;
488
502
  derivation: z.ZodNullable<z.ZodObject<{
489
503
  nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -504,12 +518,9 @@ declare const RUNTIME_RUN_CONTEXT_SCHEMA: z.ZodObject<{
504
518
  }, z.core.$strip>], "type">>;
505
519
  roots: z.ZodArray<z.ZodNumber>;
506
520
  }, z.core.$strip>>;
507
- description: z.ZodNullable<z.ZodString>;
508
521
  eventDependencyIds: z.ZodArray<z.ZodString>;
509
522
  inputHash: z.ZodString;
510
- name: z.ZodString;
511
523
  outputSensitivity: z.ZodOptional<z.ZodNullable<z.ZodCustom<SensitivityMask, SensitivityMask>>>;
512
- scopePath: z.ZodArray<z.ZodNumber>;
513
524
  signalDependencyIds: z.ZodArray<z.ZodString>;
514
525
  slot: z.ZodNumber;
515
526
  actionInvocationId: z.ZodString;
@@ -518,6 +529,9 @@ declare const RUNTIME_RUN_CONTEXT_SCHEMA: z.ZodObject<{
518
529
  outcomeSeq: z.ZodNumber;
519
530
  status: z.ZodLiteral<"failed">;
520
531
  }, z.core.$strip>, z.ZodObject<{
532
+ description: z.ZodNullable<z.ZodString>;
533
+ name: z.ZodString;
534
+ scopePath: z.ZodArray<z.ZodNumber>;
521
535
  actionDependencyIds: z.ZodArray<z.ZodString>;
522
536
  derivation: z.ZodNullable<z.ZodObject<{
523
537
  nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -538,12 +552,9 @@ declare const RUNTIME_RUN_CONTEXT_SCHEMA: z.ZodObject<{
538
552
  }, z.core.$strip>], "type">>;
539
553
  roots: z.ZodArray<z.ZodNumber>;
540
554
  }, z.core.$strip>>;
541
- description: z.ZodNullable<z.ZodString>;
542
555
  eventDependencyIds: z.ZodArray<z.ZodString>;
543
556
  inputHash: z.ZodString;
544
- name: z.ZodString;
545
557
  outputSensitivity: z.ZodOptional<z.ZodNullable<z.ZodCustom<SensitivityMask, SensitivityMask>>>;
546
- scopePath: z.ZodArray<z.ZodNumber>;
547
558
  signalDependencyIds: z.ZodArray<z.ZodString>;
548
559
  slot: z.ZodNumber;
549
560
  actionInvocationId: z.ZodString;
@@ -552,6 +563,9 @@ declare const RUNTIME_RUN_CONTEXT_SCHEMA: z.ZodObject<{
552
563
  reason: z.ZodLiteral<"closed-dependency">;
553
564
  status: z.ZodLiteral<"skipped">;
554
565
  }, z.core.$strip>, z.ZodObject<{
566
+ description: z.ZodNullable<z.ZodString>;
567
+ name: z.ZodString;
568
+ scopePath: z.ZodArray<z.ZodNumber>;
555
569
  actionDependencyIds: z.ZodArray<z.ZodString>;
556
570
  derivation: z.ZodNullable<z.ZodObject<{
557
571
  nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -572,12 +586,9 @@ declare const RUNTIME_RUN_CONTEXT_SCHEMA: z.ZodObject<{
572
586
  }, z.core.$strip>], "type">>;
573
587
  roots: z.ZodArray<z.ZodNumber>;
574
588
  }, z.core.$strip>>;
575
- description: z.ZodNullable<z.ZodString>;
576
589
  eventDependencyIds: z.ZodArray<z.ZodString>;
577
590
  inputHash: z.ZodString;
578
- name: z.ZodString;
579
591
  outputSensitivity: z.ZodOptional<z.ZodNullable<z.ZodCustom<SensitivityMask, SensitivityMask>>>;
580
- scopePath: z.ZodArray<z.ZodNumber>;
581
592
  signalDependencyIds: z.ZodArray<z.ZodString>;
582
593
  slot: z.ZodNumber;
583
594
  actionInvocationId: z.ZodString;
@@ -587,6 +598,9 @@ declare const RUNTIME_RUN_CONTEXT_SCHEMA: z.ZodObject<{
587
598
  reason: z.ZodLiteral<"failed-dependency">;
588
599
  status: z.ZodLiteral<"skipped">;
589
600
  }, z.core.$strip>, z.ZodObject<{
601
+ description: z.ZodNullable<z.ZodString>;
602
+ name: z.ZodString;
603
+ scopePath: z.ZodArray<z.ZodNumber>;
590
604
  actionDependencyIds: z.ZodArray<z.ZodString>;
591
605
  derivation: z.ZodNullable<z.ZodObject<{
592
606
  nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -607,12 +621,9 @@ declare const RUNTIME_RUN_CONTEXT_SCHEMA: z.ZodObject<{
607
621
  }, z.core.$strip>], "type">>;
608
622
  roots: z.ZodArray<z.ZodNumber>;
609
623
  }, z.core.$strip>>;
610
- description: z.ZodNullable<z.ZodString>;
611
624
  eventDependencyIds: z.ZodArray<z.ZodString>;
612
625
  inputHash: z.ZodString;
613
- name: z.ZodString;
614
626
  outputSensitivity: z.ZodOptional<z.ZodNullable<z.ZodCustom<SensitivityMask, SensitivityMask>>>;
615
- scopePath: z.ZodArray<z.ZodNumber>;
616
627
  signalDependencyIds: z.ZodArray<z.ZodString>;
617
628
  slot: z.ZodNumber;
618
629
  actionInvocationId: z.ZodString;
@@ -1181,6 +1192,31 @@ declare const ACTION_COMPLETION_SCHEMA: z.ZodUnion<readonly [z.ZodObject<{
1181
1192
  }, z.core.$strip>]>;
1182
1193
  /** Terminal action result produced inside an automation runtime. */
1183
1194
  export type RuntimeActionCompletion = z.output<typeof ACTION_COMPLETION_SCHEMA>;
1195
+ declare const ACTION_ATTEMPT_START_RESULT_SCHEMA: z.ZodUnion<readonly [z.ZodObject<{
1196
+ attempt: z.ZodNumber;
1197
+ finalAttempt: z.ZodBoolean;
1198
+ status: z.ZodLiteral<"running">;
1199
+ }, z.core.$strip>, z.ZodObject<{
1200
+ status: z.ZodLiteral<"settled">;
1201
+ }, z.core.$strip>]>;
1202
+ /** Durable logical attempt returned immediately before handler execution. */
1203
+ export type RuntimeActionAttemptStart = z.output<typeof ACTION_ATTEMPT_START_RESULT_SCHEMA>;
1204
+ declare const ACTION_ATTEMPT_COMPLETION_SCHEMA: z.ZodDiscriminatedUnion<[z.ZodObject<{
1205
+ failure: z.ZodType<import("./errors").AutomationErrorValue, import("./errors").AutomationErrorValue, z.core.$ZodTypeInternals<import("./errors").AutomationErrorValue, import("./errors").AutomationErrorValue>>;
1206
+ status: z.ZodLiteral<"failed">;
1207
+ }, z.core.$strip>, z.ZodObject<{
1208
+ failure: z.ZodType<import("./errors").AutomationErrorValue, import("./errors").AutomationErrorValue, z.core.$ZodTypeInternals<import("./errors").AutomationErrorValue, import("./errors").AutomationErrorValue>>;
1209
+ status: z.ZodLiteral<"indeterminate">;
1210
+ }, z.core.$strip>, z.ZodObject<{
1211
+ failure: z.ZodType<import("./errors").AutomationErrorValue, import("./errors").AutomationErrorValue, z.core.$ZodTypeInternals<import("./errors").AutomationErrorValue, import("./errors").AutomationErrorValue>>;
1212
+ retryAt: z.ZodOptional<z.ZodDate>;
1213
+ status: z.ZodLiteral<"retrying">;
1214
+ }, z.core.$strip>, z.ZodObject<{
1215
+ output: z.ZodOptional<z.ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>;
1216
+ status: z.ZodLiteral<"succeeded">;
1217
+ }, z.core.$strip>], "status">;
1218
+ /** Handler outcome for one durable logical action attempt. */
1219
+ export type RuntimeActionAttemptCompletion = z.output<typeof ACTION_ATTEMPT_COMPLETION_SCHEMA>;
1184
1220
  /**
1185
1221
  * Hashes one coordinator definition exactly as the runtime stores it.
1186
1222
  *
@@ -1214,6 +1250,7 @@ export declare const runtimeContract: {
1214
1250
  description: z.ZodNullable<z.ZodString>;
1215
1251
  eventDependencyIds: z.ZodArray<z.ZodString>;
1216
1252
  inputHash: z.ZodString;
1253
+ maxAttempts: z.ZodDefault<z.ZodNumber>;
1217
1254
  name: z.ZodString;
1218
1255
  outputSensitivity: z.ZodOptional<z.ZodNullable<z.ZodCustom<SensitivityMask, SensitivityMask>>>;
1219
1256
  scopePath: z.ZodArray<z.ZodNumber>;
@@ -1244,6 +1281,7 @@ export declare const runtimeContract: {
1244
1281
  description: z.ZodNullable<z.ZodString>;
1245
1282
  eventDependencyIds: z.ZodArray<z.ZodString>;
1246
1283
  inputHash: z.ZodString;
1284
+ maxAttempts: z.ZodDefault<z.ZodNumber>;
1247
1285
  name: z.ZodString;
1248
1286
  outputSensitivity: z.ZodOptional<z.ZodNullable<z.ZodCustom<SensitivityMask, SensitivityMask>>>;
1249
1287
  scopePath: z.ZodArray<z.ZodNumber>;
@@ -1275,6 +1313,7 @@ export declare const runtimeContract: {
1275
1313
  description: z.ZodNullable<z.ZodString>;
1276
1314
  eventDependencyIds: z.ZodArray<z.ZodString>;
1277
1315
  inputHash: z.ZodString;
1316
+ maxAttempts: z.ZodDefault<z.ZodNumber>;
1278
1317
  name: z.ZodString;
1279
1318
  outputSensitivity: z.ZodOptional<z.ZodNullable<z.ZodCustom<SensitivityMask, SensitivityMask>>>;
1280
1319
  scopePath: z.ZodArray<z.ZodNumber>;
@@ -1659,6 +1698,20 @@ export declare const runtimeContract: {
1659
1698
  output: z.ZodCustom<import("@automate.ax/codec/rpc").CodecEnvelope, import("@automate.ax/codec/rpc").CodecEnvelope>;
1660
1699
  status: z.ZodLiteral<"succeeded">;
1661
1700
  }, z.core.$strip>]>, z.ZodVoid, Record<never, never>, Record<never, never>>;
1701
+ completeActionAttempt: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodDiscriminatedUnion<[z.ZodObject<{
1702
+ failure: z.ZodType<import("./errors").AutomationErrorValue, import("./errors").AutomationErrorValue, z.core.$ZodTypeInternals<import("./errors").AutomationErrorValue, import("./errors").AutomationErrorValue>>;
1703
+ status: z.ZodLiteral<"failed">;
1704
+ }, z.core.$strip>, z.ZodObject<{
1705
+ failure: z.ZodType<import("./errors").AutomationErrorValue, import("./errors").AutomationErrorValue, z.core.$ZodTypeInternals<import("./errors").AutomationErrorValue, import("./errors").AutomationErrorValue>>;
1706
+ status: z.ZodLiteral<"indeterminate">;
1707
+ }, z.core.$strip>, z.ZodObject<{
1708
+ failure: z.ZodType<import("./errors").AutomationErrorValue, import("./errors").AutomationErrorValue, z.core.$ZodTypeInternals<import("./errors").AutomationErrorValue, import("./errors").AutomationErrorValue>>;
1709
+ retryAt: z.ZodOptional<z.ZodDate>;
1710
+ status: z.ZodLiteral<"retrying">;
1711
+ }, z.core.$strip>, z.ZodObject<{
1712
+ output: z.ZodCustom<import("@automate.ax/codec/rpc").CodecEnvelope, import("@automate.ax/codec/rpc").CodecEnvelope>;
1713
+ status: z.ZodLiteral<"succeeded">;
1714
+ }, z.core.$strip>], "status">, z.ZodVoid, Record<never, never>, Record<never, never>>;
1662
1715
  completeTraceSpan: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodIntersection<z.ZodObject<{
1663
1716
  completedAt: z.ZodDate;
1664
1717
  spanIndex: z.ZodNumber;
@@ -1813,6 +1866,9 @@ export declare const runtimeContract: {
1813
1866
  load: import("@orpc/contract").ContractProcedureBuilderWithOutput<import("@orpc/contract").Schema<unknown, unknown>, z.ZodObject<{
1814
1867
  context: z.ZodObject<{
1815
1868
  actions: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
1869
+ description: z.ZodNullable<z.ZodString>;
1870
+ name: z.ZodString;
1871
+ scopePath: z.ZodArray<z.ZodNumber>;
1816
1872
  actionDependencyIds: z.ZodArray<z.ZodString>;
1817
1873
  derivation: z.ZodNullable<z.ZodObject<{
1818
1874
  nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -1833,18 +1889,18 @@ export declare const runtimeContract: {
1833
1889
  }, z.core.$strip>], "type">>;
1834
1890
  roots: z.ZodArray<z.ZodNumber>;
1835
1891
  }, z.core.$strip>>;
1836
- description: z.ZodNullable<z.ZodString>;
1837
1892
  eventDependencyIds: z.ZodArray<z.ZodString>;
1838
1893
  inputHash: z.ZodString;
1839
- name: z.ZodString;
1840
1894
  outputSensitivity: z.ZodOptional<z.ZodNullable<z.ZodCustom<SensitivityMask, SensitivityMask>>>;
1841
- scopePath: z.ZodArray<z.ZodNumber>;
1842
1895
  signalDependencyIds: z.ZodArray<z.ZodString>;
1843
1896
  slot: z.ZodNumber;
1844
1897
  actionInvocationId: z.ZodString;
1845
1898
  contextId: z.ZodString;
1846
1899
  status: z.ZodLiteral<"pending">;
1847
1900
  }, z.core.$strip>, z.ZodObject<{
1901
+ description: z.ZodNullable<z.ZodString>;
1902
+ name: z.ZodString;
1903
+ scopePath: z.ZodArray<z.ZodNumber>;
1848
1904
  actionDependencyIds: z.ZodArray<z.ZodString>;
1849
1905
  derivation: z.ZodNullable<z.ZodObject<{
1850
1906
  nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -1865,12 +1921,9 @@ export declare const runtimeContract: {
1865
1921
  }, z.core.$strip>], "type">>;
1866
1922
  roots: z.ZodArray<z.ZodNumber>;
1867
1923
  }, z.core.$strip>>;
1868
- description: z.ZodNullable<z.ZodString>;
1869
1924
  eventDependencyIds: z.ZodArray<z.ZodString>;
1870
1925
  inputHash: z.ZodString;
1871
- name: z.ZodString;
1872
1926
  outputSensitivity: z.ZodOptional<z.ZodNullable<z.ZodCustom<SensitivityMask, SensitivityMask>>>;
1873
- scopePath: z.ZodArray<z.ZodNumber>;
1874
1927
  signalDependencyIds: z.ZodArray<z.ZodString>;
1875
1928
  slot: z.ZodNumber;
1876
1929
  actionInvocationId: z.ZodString;
@@ -1879,6 +1932,9 @@ export declare const runtimeContract: {
1879
1932
  outcomeSeq: z.ZodNumber;
1880
1933
  status: z.ZodLiteral<"failed">;
1881
1934
  }, z.core.$strip>, z.ZodObject<{
1935
+ description: z.ZodNullable<z.ZodString>;
1936
+ name: z.ZodString;
1937
+ scopePath: z.ZodArray<z.ZodNumber>;
1882
1938
  actionDependencyIds: z.ZodArray<z.ZodString>;
1883
1939
  derivation: z.ZodNullable<z.ZodObject<{
1884
1940
  nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -1899,12 +1955,9 @@ export declare const runtimeContract: {
1899
1955
  }, z.core.$strip>], "type">>;
1900
1956
  roots: z.ZodArray<z.ZodNumber>;
1901
1957
  }, z.core.$strip>>;
1902
- description: z.ZodNullable<z.ZodString>;
1903
1958
  eventDependencyIds: z.ZodArray<z.ZodString>;
1904
1959
  inputHash: z.ZodString;
1905
- name: z.ZodString;
1906
1960
  outputSensitivity: z.ZodOptional<z.ZodNullable<z.ZodCustom<SensitivityMask, SensitivityMask>>>;
1907
- scopePath: z.ZodArray<z.ZodNumber>;
1908
1961
  signalDependencyIds: z.ZodArray<z.ZodString>;
1909
1962
  slot: z.ZodNumber;
1910
1963
  actionInvocationId: z.ZodString;
@@ -1913,6 +1966,9 @@ export declare const runtimeContract: {
1913
1966
  reason: z.ZodLiteral<"closed-dependency">;
1914
1967
  status: z.ZodLiteral<"skipped">;
1915
1968
  }, z.core.$strip>, z.ZodObject<{
1969
+ description: z.ZodNullable<z.ZodString>;
1970
+ name: z.ZodString;
1971
+ scopePath: z.ZodArray<z.ZodNumber>;
1916
1972
  actionDependencyIds: z.ZodArray<z.ZodString>;
1917
1973
  derivation: z.ZodNullable<z.ZodObject<{
1918
1974
  nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -1933,12 +1989,9 @@ export declare const runtimeContract: {
1933
1989
  }, z.core.$strip>], "type">>;
1934
1990
  roots: z.ZodArray<z.ZodNumber>;
1935
1991
  }, z.core.$strip>>;
1936
- description: z.ZodNullable<z.ZodString>;
1937
1992
  eventDependencyIds: z.ZodArray<z.ZodString>;
1938
1993
  inputHash: z.ZodString;
1939
- name: z.ZodString;
1940
1994
  outputSensitivity: z.ZodOptional<z.ZodNullable<z.ZodCustom<SensitivityMask, SensitivityMask>>>;
1941
- scopePath: z.ZodArray<z.ZodNumber>;
1942
1995
  signalDependencyIds: z.ZodArray<z.ZodString>;
1943
1996
  slot: z.ZodNumber;
1944
1997
  actionInvocationId: z.ZodString;
@@ -1948,6 +2001,9 @@ export declare const runtimeContract: {
1948
2001
  reason: z.ZodLiteral<"failed-dependency">;
1949
2002
  status: z.ZodLiteral<"skipped">;
1950
2003
  }, z.core.$strip>, z.ZodObject<{
2004
+ description: z.ZodNullable<z.ZodString>;
2005
+ name: z.ZodString;
2006
+ scopePath: z.ZodArray<z.ZodNumber>;
1951
2007
  actionDependencyIds: z.ZodArray<z.ZodString>;
1952
2008
  derivation: z.ZodNullable<z.ZodObject<{
1953
2009
  nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -1968,12 +2024,9 @@ export declare const runtimeContract: {
1968
2024
  }, z.core.$strip>], "type">>;
1969
2025
  roots: z.ZodArray<z.ZodNumber>;
1970
2026
  }, z.core.$strip>>;
1971
- description: z.ZodNullable<z.ZodString>;
1972
2027
  eventDependencyIds: z.ZodArray<z.ZodString>;
1973
2028
  inputHash: z.ZodString;
1974
- name: z.ZodString;
1975
2029
  outputSensitivity: z.ZodOptional<z.ZodNullable<z.ZodCustom<SensitivityMask, SensitivityMask>>>;
1976
- scopePath: z.ZodArray<z.ZodNumber>;
1977
2030
  signalDependencyIds: z.ZodArray<z.ZodString>;
1978
2031
  slot: z.ZodNumber;
1979
2032
  actionInvocationId: z.ZodString;
@@ -2390,6 +2443,18 @@ export declare const runtimeContract: {
2390
2443
  secret: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2391
2444
  serviceId: z.ZodString;
2392
2445
  }, z.core.$strip>, Record<never, never>, Record<never, never>>;
2446
+ startActionAttempt: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
2447
+ replaySafety: z.ZodEnum<{
2448
+ safe: "safe";
2449
+ unsafe: "unsafe";
2450
+ }>;
2451
+ }, z.core.$strip>, z.ZodUnion<readonly [z.ZodObject<{
2452
+ attempt: z.ZodNumber;
2453
+ finalAttempt: z.ZodBoolean;
2454
+ status: z.ZodLiteral<"running">;
2455
+ }, z.core.$strip>, z.ZodObject<{
2456
+ status: z.ZodLiteral<"settled">;
2457
+ }, z.core.$strip>]>, Record<never, never>, Record<never, never>>;
2393
2458
  sendOutput: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
2394
2459
  output: z.ZodObject<{
2395
2460
  data: z.ZodCustom<import("@automate.ax/codec/rpc").CodecEnvelope, import("@automate.ax/codec/rpc").CodecEnvelope>;
package/dist/runtime.js CHANGED
@@ -151,12 +151,24 @@ export const signalDerivationSchema = z
151
151
  }
152
152
  }
153
153
  });
154
+ /** Whether replay is safe after an action delivery ends ambiguously. */
155
+ export const actionReplaySafetySchema = z.enum(["safe", "unsafe"]);
156
+ /** Logical attempts used when an action does not override its bound. */
157
+ export const DEFAULT_ACTION_MAX_ATTEMPTS = 3;
158
+ /** Hard platform bound for one action invocation's logical attempts. */
159
+ export const MAX_ACTION_ATTEMPTS = 10;
154
160
  const ACTION_INVOCATION_BASE_SCHEMA = z.object({
155
161
  actionDependencyIds: z.string().array(),
156
162
  derivation: signalDerivationSchema.nullable(),
157
163
  description: z.string().nullable(),
158
164
  eventDependencyIds: z.string().array(),
159
165
  inputHash: z.string(),
166
+ maxAttempts: z
167
+ .number()
168
+ .int()
169
+ .min(1)
170
+ .max(MAX_ACTION_ATTEMPTS)
171
+ .default(DEFAULT_ACTION_MAX_ATTEMPTS),
160
172
  name: z.string(),
161
173
  outputSensitivity: sensitivityMaskSchema.nullable().optional(),
162
174
  scopePath: HOOK_SCOPE_PATH_SCHEMA,
@@ -175,7 +187,9 @@ const ACTION_INVOCATION_SCHEMA = z.union([
175
187
  status: z.literal("skipped"),
176
188
  }),
177
189
  ]);
178
- const ACTION_RUN_INVOCATION_BASE_SCHEMA = ACTION_INVOCATION_BASE_SCHEMA.extend({
190
+ const ACTION_RUN_INVOCATION_BASE_SCHEMA = ACTION_INVOCATION_BASE_SCHEMA.omit({
191
+ maxAttempts: true,
192
+ }).extend({
179
193
  actionInvocationId: z.string(),
180
194
  contextId: z.string(),
181
195
  });
@@ -802,6 +816,45 @@ const ACTION_COMPLETION_TRANSPORT_SCHEMA = z.union([
802
816
  status: z.literal("succeeded"),
803
817
  }),
804
818
  ]);
819
+ const ACTION_ATTEMPT_START_SCHEMA = z.object({
820
+ replaySafety: actionReplaySafetySchema,
821
+ });
822
+ const ACTION_ATTEMPT_START_RESULT_SCHEMA = z.union([
823
+ z.object({
824
+ attempt: z.number().int().positive(),
825
+ finalAttempt: z.boolean(),
826
+ status: z.literal("running"),
827
+ }),
828
+ z.object({ status: z.literal("settled") }),
829
+ ]);
830
+ const ACTION_ATTEMPT_COMPLETION_SCHEMA = z.discriminatedUnion("status", [
831
+ z.object({
832
+ failure: automationErrorSchema,
833
+ status: z.literal("failed"),
834
+ }),
835
+ z.object({
836
+ failure: automationErrorSchema,
837
+ status: z.literal("indeterminate"),
838
+ }),
839
+ z.object({
840
+ failure: automationErrorSchema,
841
+ retryAt: z.date().optional(),
842
+ status: z.literal("retrying"),
843
+ }),
844
+ z.object({
845
+ output: encodableSchema,
846
+ status: z.literal("succeeded"),
847
+ }),
848
+ ]);
849
+ const ACTION_ATTEMPT_COMPLETION_TRANSPORT_SCHEMA = z.discriminatedUnion("status", [
850
+ ACTION_ATTEMPT_COMPLETION_SCHEMA.options[0],
851
+ ACTION_ATTEMPT_COMPLETION_SCHEMA.options[1],
852
+ ACTION_ATTEMPT_COMPLETION_SCHEMA.options[2],
853
+ z.object({
854
+ output: codecEnvelopeSchema,
855
+ status: z.literal("succeeded"),
856
+ }),
857
+ ]);
805
858
  /**
806
859
  * Hashes one coordinator definition exactly as the runtime stores it.
807
860
  *
@@ -835,6 +888,9 @@ export const runtimeContract = {
835
888
  }))
836
889
  .output(z.void()),
837
890
  completeAction: oc.input(ACTION_COMPLETION_TRANSPORT_SCHEMA).output(z.void()),
891
+ completeActionAttempt: oc
892
+ .input(ACTION_ATTEMPT_COMPLETION_TRANSPORT_SCHEMA)
893
+ .output(z.void()),
838
894
  completeTraceSpan: oc
839
895
  .input(z
840
896
  .object({
@@ -882,6 +938,9 @@ export const runtimeContract = {
882
938
  secret: z.record(z.string(), z.unknown()),
883
939
  serviceId: z.string(),
884
940
  })),
941
+ startActionAttempt: oc
942
+ .input(ACTION_ATTEMPT_START_SCHEMA)
943
+ .output(ACTION_ATTEMPT_START_RESULT_SCHEMA),
885
944
  sendOutput: oc
886
945
  .input(z.object({
887
946
  output: z.object({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automate.ax/api-contract",
3
- "version": "0.94.1",
3
+ "version": "0.95.1",
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.94.1",
35
- "@automate.ax/integration-contracts": "0.94.1",
34
+ "@automate.ax/codec": "0.95.1",
35
+ "@automate.ax/integration-contracts": "0.95.1",
36
36
  "@orpc/contract": "1.15.0",
37
37
  "fast-json-stable-stringify": "^2.1.0",
38
38
  "zod": "^4.3.6"
@@ -1,7 +1,7 @@
1
1
  import { oc } from "@orpc/contract"
2
2
  import { z } from "zod"
3
3
 
4
- export const EXECUTION_DATASET_VERSION = 7
4
+ export const EXECUTION_DATASET_VERSION = 8
5
5
 
6
6
  export const executionDatasetResourceSchema = z.enum([
7
7
  "projects",
@@ -12,6 +12,7 @@ export const executionDatasetResourceSchema = z.enum([
12
12
  "event-links",
13
13
  "events",
14
14
  "actions",
15
+ "action-attempts",
15
16
  "signal-invocations",
16
17
  "signal-coordinators",
17
18
  "signal-offers",
package/src/index.ts CHANGED
@@ -54,6 +54,9 @@ export {
54
54
  AUTOMATION_TRACE_MAX_SPANS,
55
55
  DEFAULT_GATEWAY_IMAGE_MODEL_ID,
56
56
  DEFAULT_GATEWAY_MODEL_ID,
57
+ DEFAULT_ACTION_MAX_ATTEMPTS,
58
+ MAX_ACTION_ATTEMPTS,
59
+ actionReplaySafetySchema,
57
60
  automationInvocationInputSchema,
58
61
  automationInvocationOutputSchema,
59
62
  automationInvocationScheduleSchema,
@@ -74,6 +77,9 @@ export {
74
77
  type PlatformImageGenerationInput,
75
78
  type RuntimeGenerationInput,
76
79
  type RuntimeCoordinationOffer,
80
+ type ActionReplaySafety,
81
+ type RuntimeActionAttemptCompletion,
82
+ type RuntimeActionAttemptStart,
77
83
  } from "./runtime"
78
84
  export type { GatewayImageModelId, GatewayModelId } from "@ai-sdk/gateway"
79
85
  export {
package/src/runtime.ts CHANGED
@@ -187,12 +187,30 @@ export const signalDerivationSchema = z
187
187
  /** Persisted source, property, and opaque transform derivation graph. */
188
188
  export type SignalDerivation = z.infer<typeof signalDerivationSchema>
189
189
 
190
+ /** Whether replay is safe after an action delivery ends ambiguously. */
191
+ export const actionReplaySafetySchema = z.enum(["safe", "unsafe"])
192
+
193
+ /** Logical attempts used when an action does not override its bound. */
194
+ export const DEFAULT_ACTION_MAX_ATTEMPTS = 3
195
+
196
+ /** Hard platform bound for one action invocation's logical attempts. */
197
+ export const MAX_ACTION_ATTEMPTS = 10
198
+
199
+ /** Replay-safety decision made from one action's validated input. */
200
+ export type ActionReplaySafety = z.output<typeof actionReplaySafetySchema>
201
+
190
202
  const ACTION_INVOCATION_BASE_SCHEMA = z.object({
191
203
  actionDependencyIds: z.string().array(),
192
204
  derivation: signalDerivationSchema.nullable(),
193
205
  description: z.string().nullable(),
194
206
  eventDependencyIds: z.string().array(),
195
207
  inputHash: z.string(),
208
+ maxAttempts: z
209
+ .number()
210
+ .int()
211
+ .min(1)
212
+ .max(MAX_ACTION_ATTEMPTS)
213
+ .default(DEFAULT_ACTION_MAX_ATTEMPTS),
196
214
  name: z.string(),
197
215
  outputSensitivity: sensitivityMaskSchema.nullable().optional(),
198
216
  scopePath: HOOK_SCOPE_PATH_SCHEMA,
@@ -213,7 +231,9 @@ const ACTION_INVOCATION_SCHEMA = z.union([
213
231
  }),
214
232
  ])
215
233
 
216
- const ACTION_RUN_INVOCATION_BASE_SCHEMA = ACTION_INVOCATION_BASE_SCHEMA.extend({
234
+ const ACTION_RUN_INVOCATION_BASE_SCHEMA = ACTION_INVOCATION_BASE_SCHEMA.omit({
235
+ maxAttempts: true,
236
+ }).extend({
217
237
  actionInvocationId: z.string(),
218
238
  contextId: z.string(),
219
239
  })
@@ -954,6 +974,62 @@ const ACTION_COMPLETION_TRANSPORT_SCHEMA = z.union([
954
974
  }),
955
975
  ])
956
976
 
977
+ const ACTION_ATTEMPT_START_SCHEMA = z.object({
978
+ replaySafety: actionReplaySafetySchema,
979
+ })
980
+
981
+ const ACTION_ATTEMPT_START_RESULT_SCHEMA = z.union([
982
+ z.object({
983
+ attempt: z.number().int().positive(),
984
+ finalAttempt: z.boolean(),
985
+ status: z.literal("running"),
986
+ }),
987
+ z.object({ status: z.literal("settled") }),
988
+ ])
989
+
990
+ /** Durable logical attempt returned immediately before handler execution. */
991
+ export type RuntimeActionAttemptStart = z.output<
992
+ typeof ACTION_ATTEMPT_START_RESULT_SCHEMA
993
+ >
994
+
995
+ const ACTION_ATTEMPT_COMPLETION_SCHEMA = z.discriminatedUnion("status", [
996
+ z.object({
997
+ failure: automationErrorSchema,
998
+ status: z.literal("failed"),
999
+ }),
1000
+ z.object({
1001
+ failure: automationErrorSchema,
1002
+ status: z.literal("indeterminate"),
1003
+ }),
1004
+ z.object({
1005
+ failure: automationErrorSchema,
1006
+ retryAt: z.date().optional(),
1007
+ status: z.literal("retrying"),
1008
+ }),
1009
+ z.object({
1010
+ output: encodableSchema,
1011
+ status: z.literal("succeeded"),
1012
+ }),
1013
+ ])
1014
+
1015
+ /** Handler outcome for one durable logical action attempt. */
1016
+ export type RuntimeActionAttemptCompletion = z.output<
1017
+ typeof ACTION_ATTEMPT_COMPLETION_SCHEMA
1018
+ >
1019
+
1020
+ const ACTION_ATTEMPT_COMPLETION_TRANSPORT_SCHEMA = z.discriminatedUnion(
1021
+ "status",
1022
+ [
1023
+ ACTION_ATTEMPT_COMPLETION_SCHEMA.options[0],
1024
+ ACTION_ATTEMPT_COMPLETION_SCHEMA.options[1],
1025
+ ACTION_ATTEMPT_COMPLETION_SCHEMA.options[2],
1026
+ z.object({
1027
+ output: codecEnvelopeSchema,
1028
+ status: z.literal("succeeded"),
1029
+ }),
1030
+ ],
1031
+ )
1032
+
957
1033
  /**
958
1034
  * Hashes one coordinator definition exactly as the runtime stores it.
959
1035
  *
@@ -1002,6 +1078,9 @@ export const runtimeContract = {
1002
1078
  )
1003
1079
  .output(z.void()),
1004
1080
  completeAction: oc.input(ACTION_COMPLETION_TRANSPORT_SCHEMA).output(z.void()),
1081
+ completeActionAttempt: oc
1082
+ .input(ACTION_ATTEMPT_COMPLETION_TRANSPORT_SCHEMA)
1083
+ .output(z.void()),
1005
1084
  completeTraceSpan: oc
1006
1085
  .input(
1007
1086
  z
@@ -1061,6 +1140,9 @@ export const runtimeContract = {
1061
1140
  serviceId: z.string(),
1062
1141
  }),
1063
1142
  ),
1143
+ startActionAttempt: oc
1144
+ .input(ACTION_ATTEMPT_START_SCHEMA)
1145
+ .output(ACTION_ATTEMPT_START_RESULT_SCHEMA),
1064
1146
  sendOutput: oc
1065
1147
  .input(
1066
1148
  z.object({