@voltro/protocol 0.70.0 → 0.71.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/apikey.d.ts CHANGED
@@ -210,6 +210,11 @@ declare const Subject: Schema.Union<[Schema.Struct<{
210
210
  type: Schema.Literal<["serviceAccount"]>;
211
211
  id: typeof Schema.String;
212
212
  tenantId: typeof Schema.String;
213
+ /** Application actor used for audit columns; null means machine work with
214
+ * no application actor. Identity only, never a permission grant. */
215
+ auditActorId: Schema.optionalWith<Schema.NullOr<typeof Schema.String>, {
216
+ exact: true;
217
+ }>;
213
218
  scopes: Schema.optional<Schema.Array$<typeof Schema.String>>;
214
219
  metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
215
220
  }>, Schema.Struct<{
package/dist/index.d.ts CHANGED
@@ -3667,6 +3667,13 @@ export declare interface PluginInspectRequest {
3667
3667
  }
3668
3668
 
3669
3669
  export declare type PluginInspectResponse = {
3670
+ readonly kind: 'bytes';
3671
+ readonly status?: number;
3672
+ readonly contentType: string;
3673
+ readonly byteStream: PluginHttpRouteByteStream;
3674
+ /** Download metadata; transport-owned auth/CORS headers cannot be overridden. */
3675
+ readonly headers?: Readonly<Record<string, string>>;
3676
+ } | {
3670
3677
  readonly kind: 'json';
3671
3678
  readonly status?: number;
3672
3679
  readonly data: unknown;
@@ -4082,7 +4089,7 @@ export declare type PluginUninstallHook = (ctx: PluginLifecycleContext) => Effec
4082
4089
 
4083
4090
  /** The runtime-erased form of `PolicyGuardSpec` — a relationship check. */
4084
4091
  export declare interface PolicyCheckSpec {
4085
- readonly action: string;
4092
+ readonly action: string | ((input: unknown) => string);
4086
4093
  readonly resourceType: string;
4087
4094
  readonly resource: (input: unknown) => string | undefined;
4088
4095
  }
@@ -4127,7 +4134,7 @@ export declare type PolicyGuardResolver = (req: PolicyGuardRequest) => Effect.Ef
4127
4134
  */
4128
4135
  export declare interface PolicyGuardSpec<Input = unknown> {
4129
4136
  /** The action to authorize, as named in the resource policy's `actions`. */
4130
- readonly action: string;
4137
+ readonly action: string | ((input: Input) => string);
4131
4138
  /** Which registered resource policy governs the check. */
4132
4139
  readonly resourceType: string;
4133
4140
  /** PURE `input → resource id`. Returning undefined DENIES — an unidentifiable
@@ -4167,6 +4174,26 @@ export declare const PROTOCOL_VERSION: 1;
4167
4174
 
4168
4175
  export declare type ProtocolVersion = typeof PROTOCOL_VERSION;
4169
4176
 
4177
+ /** The generated TypeScript client, as the app declares it. */
4178
+ export declare interface PublicApiClientConfig {
4179
+ /** The npm package name. Default `@app/api-client`. */
4180
+ readonly package?: string;
4181
+ /** Where the package is written, relative to the app root. Default `sdk/typescript`. */
4182
+ readonly out?: string;
4183
+ /** `'plain'` — the Promise client, no Effect anywhere; `'effect'` — the
4184
+ * Effect service; `'both'` — `.` plain and `./effect` Effect, with `effect`
4185
+ * an optional peer. Default `'both'`. */
4186
+ readonly flavor?: 'plain' | 'effect' | 'both';
4187
+ /** The package's `license` field (an SPDX id). */
4188
+ readonly license?: string;
4189
+ /** The package's version. Default `0.1.0`. */
4190
+ readonly packageVersion?: string;
4191
+ /** Generate for ONE API version (`'v2'`). */
4192
+ readonly apiVersion?: string;
4193
+ /** The client's default base URL. */
4194
+ readonly baseUrl?: string;
4195
+ }
4196
+
4170
4197
  /** The `publicApi:` block of an api `app.config.ts`, and the shape of a
4171
4198
  * descriptor's `publicApi.format` override (every field optional there). */
4172
4199
  export declare interface PublicApiProfileConfig {
@@ -4180,6 +4207,28 @@ export declare interface PublicApiProfileConfig {
4180
4207
  readonly cursorParam?: string;
4181
4208
  readonly naming?: RestNaming;
4182
4209
  readonly etag?: boolean;
4210
+ /** `'required'`: `voltro doctor` reports a projection without a
4211
+ * `description` and an input/output field without a `description`
4212
+ * annotation — so a new projection does not reach the surface without text.
4213
+ * Default `'optional'`. */
4214
+ readonly docs?: 'required' | 'optional';
4215
+ /**
4216
+ * Files `voltro dev` writes beside `rpcGroup.generated.ts` on every boot, from
4217
+ * the mounted surface: `'openapi'` (`openapi.generated.json`) and the
4218
+ * collections — `'postman'`, `'bruno'`, `'insomnia'`, `'hoppscotch'` — as
4219
+ * committed, generated files, so a review diff shows the surface change and
4220
+ * a client imported once cannot drift; `'typescript'` keeps the generated
4221
+ * client package (`client`) written the same way. Off by default.
4222
+ */
4223
+ readonly artifacts?: ReadonlyArray<'openapi' | 'postman' | 'bruno' | 'insomnia' | 'hoppscotch' | 'typescript'>;
4224
+ /**
4225
+ * The app's decision about its generated TypeScript client — what
4226
+ * `voltro build api --target typescript` (and `voltro api-client build`)
4227
+ * produces without flags, and what `voltro dev` keeps written when
4228
+ * `artifacts` names `'typescript'`. `voltro api-client set …` writes this
4229
+ * block; a flag on the command line overrides a field for one run.
4230
+ */
4231
+ readonly client?: PublicApiClientConfig;
4183
4232
  }
4184
4233
 
4185
4234
  export declare type PublicApiProfileName = 'rpc' | 'standard' | 'jsonapi';
@@ -4189,6 +4238,18 @@ export declare interface PublicApiSpec {
4189
4238
  readonly method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
4190
4239
  /** Derived from the tag + version when omitted: `/<version>/<tag-as-path>`. */
4191
4240
  readonly path?: string;
4241
+ /**
4242
+ * Derive method and path from the resource instead of writing them — the
4243
+ * convention `crud.*` already follows, opt-in per descriptor. `'teams'` on a
4244
+ * query whose input carries `teamId` or `id` → `GET /v1/teams/{teamId}`,
4245
+ * without one → `GET /v1/teams`; on a mutation whose `target.op` is
4246
+ * `insert` → `POST /v1/teams`, `update` → `PATCH /v1/teams/{teamId}`,
4247
+ * `delete` → `DELETE /v1/teams/{teamId}`; an action, or a mutation without
4248
+ * a target, → `POST /v1/teams/{teamId}/<verb>` (the tag's last segment) when
4249
+ * the input carries the id, else `POST /v1/teams/<verb>`. An explicit
4250
+ * `method` or `path` wins over the derivation.
4251
+ */
4252
+ readonly resource?: string;
4192
4253
  /** Path version segment; multiple versions coexist as separate descriptors. */
4193
4254
  readonly version?: string;
4194
4255
  /** Additional API-key scopes required ON TOP of the handler's RBAC. */
@@ -4518,6 +4579,11 @@ export declare const requireScope: (subject: Subject, scope: string) => Effect.E
4518
4579
  /** Drop every registration. Tests only — production registers once at module load. */
4519
4580
  export declare const resetPluginAliases: () => void;
4520
4581
 
4582
+ /** Resolve the input-selected action once. Invalid selectors deny rather than
4583
+ * widening to any action the subject happens to hold. Also used when an
4584
+ * approval persists the resolved guard for its later recheck. */
4585
+ export declare const resolvePolicyAction: (guard: PolicyCheckSpec, input: unknown) => string;
4586
+
4521
4587
  /**
4522
4588
  * The format one projection speaks: the app profile, then its building-block
4523
4589
  * overrides, then the descriptor's own `format`. A named profile is a
@@ -4781,6 +4847,9 @@ declare interface RestRouteProjection {
4781
4847
  readonly kind: 'query' | 'mutation' | 'action';
4782
4848
  readonly version: string;
4783
4849
  readonly security: 'required' | 'optional' | 'none';
4850
+ /** `publicApi.idempotent` — the route honours `Idempotency-Key` (under the
4851
+ * app's idempotency binding); a client sends one per attempt. */
4852
+ readonly idempotent: boolean;
4784
4853
  readonly input: Schema.Schema.All;
4785
4854
  /** The wire names of the input fields bound from the path. */
4786
4855
  readonly pathParams: ReadonlyArray<string>;
@@ -5350,6 +5419,11 @@ export declare const Subject: Schema.Union<[Schema.Struct<{
5350
5419
  type: Schema.Literal<["serviceAccount"]>;
5351
5420
  id: typeof Schema.String;
5352
5421
  tenantId: typeof Schema.String;
5422
+ /** Application actor used for audit columns; null means machine work with
5423
+ * no application actor. Identity only, never a permission grant. */
5424
+ auditActorId: Schema.optionalWith<Schema.NullOr<typeof Schema.String>, {
5425
+ exact: true;
5426
+ }>;
5353
5427
  scopes: Schema.optional<Schema.Array$<typeof Schema.String>>;
5354
5428
  metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
5355
5429
  }>, Schema.Struct<{
@@ -5383,6 +5457,11 @@ export declare const Subject: Schema.Union<[Schema.Struct<{
5383
5457
 
5384
5458
  export declare type Subject = typeof Subject.Type;
5385
5459
 
5460
+ /** Resolve an application audit actor from server-established identity.
5461
+ * Explicit null on a scoped machine identity survives persistence; it grants
5462
+ * no authority and must not be inferred from user-provided metadata. */
5463
+ export declare const subjectAuditActorId: (subject: Subject) => string | null;
5464
+
5386
5465
  export declare const SubjectIdentity: Schema.Union<[Schema.Struct<{
5387
5466
  type: Schema.Literal<["user"]>;
5388
5467
  id: typeof Schema.String;
@@ -5398,6 +5477,9 @@ export declare const SubjectIdentity: Schema.Union<[Schema.Struct<{
5398
5477
  id: typeof Schema.String;
5399
5478
  tenantId: typeof Schema.String;
5400
5479
  metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
5480
+ auditActorId: Schema.optionalWith<Schema.NullOr<typeof Schema.String>, {
5481
+ exact: true;
5482
+ }>;
5401
5483
  }>, Schema.Struct<{
5402
5484
  type: Schema.Literal<["anonymous"]>;
5403
5485
  id: typeof Schema.Null;
@@ -5482,6 +5564,7 @@ declare const SubjectService_base: Context.TagClass<SubjectService, "@voltro/Sub
5482
5564
  readonly metadata?: {
5483
5565
  readonly [x: string]: unknown;
5484
5566
  } | undefined;
5567
+ readonly auditActorId?: string | null;
5485
5568
  } | {
5486
5569
  readonly type: "anonymous";
5487
5570
  readonly id: null;
@@ -6644,15 +6727,110 @@ export declare const WorkflowAccessProperty: unique symbol;
6644
6727
  export declare const workflowCancelDescriptor: ActionProcedureDescriptor<"__voltro.workflow.cancel", Schema.Struct<{
6645
6728
  workflowName: typeof Schema.String;
6646
6729
  executionId: typeof Schema.String;
6647
- }>, Schema.Struct<{
6648
- ok: typeof Schema.Boolean;
6649
- }>, typeof Schema.Never>;
6730
+ control: Schema.optional<Schema.Struct<{
6731
+ requestId: typeof Schema.NonEmptyString;
6732
+ cause: Schema.optionalWith<Schema.Struct<{
6733
+ reason: typeof Schema.NonEmptyString;
6734
+ detail: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
6735
+ }>, {
6736
+ exact: true;
6737
+ }>;
6738
+ }>>;
6739
+ }>, Schema.filter<Schema.Struct<{
6740
+ operation: Schema.Literal<["cancel", "resume"]>;
6741
+ kind: Schema.Literal<["accepted", "confirmed", "unknown", "already-terminal"]>;
6742
+ requestId: Schema.NullOr<typeof Schema.NonEmptyString>;
6743
+ snapshot: Schema.Struct<{
6744
+ id: typeof Schema.String;
6745
+ workflowName: typeof Schema.String;
6746
+ executionId: typeof Schema.String;
6747
+ status: Schema.Union<[Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<["unknown"]>]>;
6748
+ output: Schema.optional<typeof Schema.Unknown>;
6749
+ error: Schema.optional<Schema.Struct<{
6750
+ tag: Schema.NullOr<typeof Schema.String>;
6751
+ message: typeof Schema.String;
6752
+ }>>;
6753
+ }>;
6754
+ }>>, typeof Schema.Never>;
6650
6755
 
6651
6756
  export declare const WorkflowControlInputSchema: Schema.Struct<{
6652
6757
  workflowName: typeof Schema.String;
6653
6758
  executionId: typeof Schema.String;
6759
+ control: Schema.optional<Schema.Struct<{
6760
+ requestId: typeof Schema.NonEmptyString;
6761
+ cause: Schema.optionalWith<Schema.Struct<{
6762
+ reason: typeof Schema.NonEmptyString;
6763
+ detail: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
6764
+ }>, {
6765
+ exact: true;
6766
+ }>;
6767
+ }>>;
6654
6768
  }>;
6655
6769
 
6770
+ export declare type WorkflowControlIntent = Schema.Schema.Type<typeof WorkflowControlIntentSchema>;
6771
+
6772
+ /** Stable caller-owned intent for retry after an uncertain transport result. */
6773
+ export declare const WorkflowControlIntentSchema: Schema.Struct<{
6774
+ requestId: typeof Schema.NonEmptyString;
6775
+ cause: Schema.optionalWith<Schema.Struct<{
6776
+ reason: typeof Schema.NonEmptyString;
6777
+ detail: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
6778
+ }>, {
6779
+ exact: true;
6780
+ }>;
6781
+ }>;
6782
+
6783
+ export declare const workflowControlQueryDescriptor: QueryProcedureDescriptor<"__voltro.workflow.control", Schema.Struct<{
6784
+ workflowName: typeof Schema.NonEmptyString;
6785
+ executionId: typeof Schema.NonEmptyString;
6786
+ operation: Schema.Literal<["cancel", "resume"]>;
6787
+ requestId: typeof Schema.NonEmptyString;
6788
+ }>, Schema.filter<Schema.Struct<{
6789
+ operation: Schema.Literal<["cancel", "resume"]>;
6790
+ kind: Schema.Literal<["accepted", "confirmed", "unknown", "already-terminal"]>;
6791
+ requestId: Schema.NullOr<typeof Schema.NonEmptyString>;
6792
+ snapshot: Schema.Struct<{
6793
+ id: typeof Schema.String;
6794
+ workflowName: typeof Schema.String;
6795
+ executionId: typeof Schema.String;
6796
+ status: Schema.Union<[Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<["unknown"]>]>;
6797
+ output: Schema.optional<typeof Schema.Unknown>;
6798
+ error: Schema.optional<Schema.Struct<{
6799
+ tag: Schema.NullOr<typeof Schema.String>;
6800
+ message: typeof Schema.String;
6801
+ }>>;
6802
+ }>;
6803
+ }>>, typeof Schema.Never>;
6804
+
6805
+ export declare type WorkflowControlReadInput = Schema.Schema.Type<typeof WorkflowControlReadInputSchema>;
6806
+
6807
+ export declare const WorkflowControlReadInputSchema: Schema.Struct<{
6808
+ workflowName: typeof Schema.NonEmptyString;
6809
+ executionId: typeof Schema.NonEmptyString;
6810
+ operation: Schema.Literal<["cancel", "resume"]>;
6811
+ requestId: typeof Schema.NonEmptyString;
6812
+ }>;
6813
+
6814
+ export declare type WorkflowControlResult = Schema.Schema.Type<typeof WorkflowControlResultSchema>;
6815
+
6816
+ /** Acceptance is not execution completion; null means no resident receipt. */
6817
+ export declare const WorkflowControlResultSchema: Schema.filter<Schema.Struct<{
6818
+ operation: Schema.Literal<["cancel", "resume"]>;
6819
+ kind: Schema.Literal<["accepted", "confirmed", "unknown", "already-terminal"]>;
6820
+ requestId: Schema.NullOr<typeof Schema.NonEmptyString>;
6821
+ snapshot: Schema.Struct<{
6822
+ id: typeof Schema.String;
6823
+ workflowName: typeof Schema.String;
6824
+ executionId: typeof Schema.String;
6825
+ status: Schema.Union<[Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<["unknown"]>]>;
6826
+ output: Schema.optional<typeof Schema.Unknown>;
6827
+ error: Schema.optional<Schema.Struct<{
6828
+ tag: Schema.NullOr<typeof Schema.String>;
6829
+ message: typeof Schema.String;
6830
+ }>>;
6831
+ }>;
6832
+ }>>;
6833
+
6656
6834
  export declare type WorkflowDomainEventRow = Schema.Schema.Type<typeof WorkflowDomainEventRowSchema>;
6657
6835
 
6658
6836
  export declare const WorkflowDomainEventRowSchema: Schema.Struct<{
@@ -6725,12 +6903,230 @@ export declare type WorkflowParentClosePolicy = Schema.Schema.Type<typeof Workfl
6725
6903
 
6726
6904
  export declare const WorkflowParentClosePolicySchema: Schema.Literal<["cancel", "terminate", "abandon"]>;
6727
6905
 
6906
+ export declare const workflowQueuedCancelDescriptor: ActionProcedureDescriptor<"__voltro.workflow.queued.cancel", Schema.Struct<{
6907
+ cause: Schema.optionalWith<Schema.Struct<{
6908
+ reason: typeof Schema.NonEmptyString;
6909
+ detail: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
6910
+ }>, {
6911
+ exact: true;
6912
+ }>;
6913
+ workflowName: typeof Schema.NonEmptyString;
6914
+ receiptId: typeof Schema.NonEmptyString;
6915
+ requestId: typeof Schema.NonEmptyString;
6916
+ }>, Schema.filter<Schema.Struct<{
6917
+ operation: Schema.Literal<["cancel"]>;
6918
+ workflowName: typeof Schema.NonEmptyString;
6919
+ receiptId: typeof Schema.NonEmptyString;
6920
+ requestId: Schema.NullOr<typeof Schema.NonEmptyString>;
6921
+ kind: Schema.Literal<["accepted", "confirmed", "unknown", "already-terminal"]>;
6922
+ observation: Schema.Union<[Schema.Struct<{
6923
+ kind: Schema.Literal<["pending"]>;
6924
+ }>, Schema.Struct<{
6925
+ kind: Schema.Literal<["admission"]>;
6926
+ outcome: Schema.Union<[Schema.Union<[Schema.Struct<{
6927
+ kind: Schema.Literal<["dropped"]>;
6928
+ at: typeof Schema.Number;
6929
+ retryAfterMs: typeof Schema.Number;
6930
+ }>, Schema.Struct<{
6931
+ kind: Schema.Literal<["skipped"]>;
6932
+ at: typeof Schema.Number;
6933
+ executionId: typeof Schema.String;
6934
+ runId: typeof Schema.String;
6935
+ }>, Schema.Struct<{
6936
+ kind: Schema.Literal<["superseded"]>;
6937
+ at: typeof Schema.Number;
6938
+ }>, Schema.Struct<{
6939
+ kind: Schema.Literal<["cancelled"]>;
6940
+ at: typeof Schema.Number;
6941
+ }>, Schema.Struct<{
6942
+ kind: Schema.Literal<["abandoned"]>;
6943
+ at: typeof Schema.Number;
6944
+ failureId: typeof Schema.NonEmptyString;
6945
+ }>]>, Schema.Struct<{
6946
+ kind: Schema.Literal<["rejected"]>;
6947
+ failureId: typeof Schema.NonEmptyString;
6948
+ }>]>;
6949
+ }>, Schema.Struct<{
6950
+ kind: Schema.Literal<["execution"]>;
6951
+ snapshot: Schema.Struct<{
6952
+ id: typeof Schema.String;
6953
+ workflowName: typeof Schema.String;
6954
+ executionId: typeof Schema.String;
6955
+ status: Schema.Union<[Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<["unknown"]>]>;
6956
+ output: Schema.optional<typeof Schema.Unknown>;
6957
+ error: Schema.optional<Schema.Struct<{
6958
+ tag: Schema.NullOr<typeof Schema.String>;
6959
+ message: typeof Schema.String;
6960
+ }>>;
6961
+ }>;
6962
+ }>, Schema.Struct<{
6963
+ kind: Schema.Literal<["unavailable"]>;
6964
+ reason: Schema.Literal<["missing-request", "missing-run", "unconfirmed-generation", "unbound-submission"]>;
6965
+ }>]>;
6966
+ }>>, typeof Schema.Never>;
6967
+
6968
+ export declare type WorkflowQueuedCancelInput = typeof WorkflowQueuedCancelInputSchema.Type;
6969
+
6970
+ export declare const WorkflowQueuedCancelInputSchema: Schema.Struct<{
6971
+ cause: Schema.optionalWith<Schema.Struct<{
6972
+ reason: typeof Schema.NonEmptyString;
6973
+ detail: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
6974
+ }>, {
6975
+ exact: true;
6976
+ }>;
6977
+ workflowName: typeof Schema.NonEmptyString;
6978
+ receiptId: typeof Schema.NonEmptyString;
6979
+ requestId: typeof Schema.NonEmptyString;
6980
+ }>;
6981
+
6982
+ export declare type WorkflowQueuedCancellationResult = typeof WorkflowQueuedCancellationResultSchema.Type;
6983
+
6984
+ /** A queued caller has a receipt before any execution exists. Keep admission
6985
+ * evidence separate from an observed execution rather than fabricating IDs. */
6986
+ export declare const WorkflowQueuedCancellationResultSchema: Schema.filter<Schema.Struct<{
6987
+ operation: Schema.Literal<["cancel"]>;
6988
+ workflowName: typeof Schema.NonEmptyString;
6989
+ receiptId: typeof Schema.NonEmptyString;
6990
+ requestId: Schema.NullOr<typeof Schema.NonEmptyString>;
6991
+ kind: Schema.Literal<["accepted", "confirmed", "unknown", "already-terminal"]>;
6992
+ observation: Schema.Union<[Schema.Struct<{
6993
+ kind: Schema.Literal<["pending"]>;
6994
+ }>, Schema.Struct<{
6995
+ kind: Schema.Literal<["admission"]>;
6996
+ outcome: Schema.Union<[Schema.Union<[Schema.Struct<{
6997
+ kind: Schema.Literal<["dropped"]>;
6998
+ at: typeof Schema.Number;
6999
+ retryAfterMs: typeof Schema.Number;
7000
+ }>, Schema.Struct<{
7001
+ kind: Schema.Literal<["skipped"]>;
7002
+ at: typeof Schema.Number;
7003
+ executionId: typeof Schema.String;
7004
+ runId: typeof Schema.String;
7005
+ }>, Schema.Struct<{
7006
+ kind: Schema.Literal<["superseded"]>;
7007
+ at: typeof Schema.Number;
7008
+ }>, Schema.Struct<{
7009
+ kind: Schema.Literal<["cancelled"]>;
7010
+ at: typeof Schema.Number;
7011
+ }>, Schema.Struct<{
7012
+ kind: Schema.Literal<["abandoned"]>;
7013
+ at: typeof Schema.Number;
7014
+ failureId: typeof Schema.NonEmptyString;
7015
+ }>]>, Schema.Struct<{
7016
+ kind: Schema.Literal<["rejected"]>;
7017
+ failureId: typeof Schema.NonEmptyString;
7018
+ }>]>;
7019
+ }>, Schema.Struct<{
7020
+ kind: Schema.Literal<["execution"]>;
7021
+ snapshot: Schema.Struct<{
7022
+ id: typeof Schema.String;
7023
+ workflowName: typeof Schema.String;
7024
+ executionId: typeof Schema.String;
7025
+ status: Schema.Union<[Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<["unknown"]>]>;
7026
+ output: Schema.optional<typeof Schema.Unknown>;
7027
+ error: Schema.optional<Schema.Struct<{
7028
+ tag: Schema.NullOr<typeof Schema.String>;
7029
+ message: typeof Schema.String;
7030
+ }>>;
7031
+ }>;
7032
+ }>, Schema.Struct<{
7033
+ kind: Schema.Literal<["unavailable"]>;
7034
+ reason: Schema.Literal<["missing-request", "missing-run", "unconfirmed-generation", "unbound-submission"]>;
7035
+ }>]>;
7036
+ }>>;
7037
+
7038
+ export declare const workflowQueuedControlQueryDescriptor: QueryProcedureDescriptor<"__voltro.workflow.queued.control", Schema.Struct<{
7039
+ workflowName: typeof Schema.NonEmptyString;
7040
+ receiptId: typeof Schema.NonEmptyString;
7041
+ requestId: typeof Schema.NonEmptyString;
7042
+ }>, Schema.filter<Schema.Struct<{
7043
+ operation: Schema.Literal<["cancel"]>;
7044
+ workflowName: typeof Schema.NonEmptyString;
7045
+ receiptId: typeof Schema.NonEmptyString;
7046
+ requestId: Schema.NullOr<typeof Schema.NonEmptyString>;
7047
+ kind: Schema.Literal<["accepted", "confirmed", "unknown", "already-terminal"]>;
7048
+ observation: Schema.Union<[Schema.Struct<{
7049
+ kind: Schema.Literal<["pending"]>;
7050
+ }>, Schema.Struct<{
7051
+ kind: Schema.Literal<["admission"]>;
7052
+ outcome: Schema.Union<[Schema.Union<[Schema.Struct<{
7053
+ kind: Schema.Literal<["dropped"]>;
7054
+ at: typeof Schema.Number;
7055
+ retryAfterMs: typeof Schema.Number;
7056
+ }>, Schema.Struct<{
7057
+ kind: Schema.Literal<["skipped"]>;
7058
+ at: typeof Schema.Number;
7059
+ executionId: typeof Schema.String;
7060
+ runId: typeof Schema.String;
7061
+ }>, Schema.Struct<{
7062
+ kind: Schema.Literal<["superseded"]>;
7063
+ at: typeof Schema.Number;
7064
+ }>, Schema.Struct<{
7065
+ kind: Schema.Literal<["cancelled"]>;
7066
+ at: typeof Schema.Number;
7067
+ }>, Schema.Struct<{
7068
+ kind: Schema.Literal<["abandoned"]>;
7069
+ at: typeof Schema.Number;
7070
+ failureId: typeof Schema.NonEmptyString;
7071
+ }>]>, Schema.Struct<{
7072
+ kind: Schema.Literal<["rejected"]>;
7073
+ failureId: typeof Schema.NonEmptyString;
7074
+ }>]>;
7075
+ }>, Schema.Struct<{
7076
+ kind: Schema.Literal<["execution"]>;
7077
+ snapshot: Schema.Struct<{
7078
+ id: typeof Schema.String;
7079
+ workflowName: typeof Schema.String;
7080
+ executionId: typeof Schema.String;
7081
+ status: Schema.Union<[Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<["unknown"]>]>;
7082
+ output: Schema.optional<typeof Schema.Unknown>;
7083
+ error: Schema.optional<Schema.Struct<{
7084
+ tag: Schema.NullOr<typeof Schema.String>;
7085
+ message: typeof Schema.String;
7086
+ }>>;
7087
+ }>;
7088
+ }>, Schema.Struct<{
7089
+ kind: Schema.Literal<["unavailable"]>;
7090
+ reason: Schema.Literal<["missing-request", "missing-run", "unconfirmed-generation", "unbound-submission"]>;
7091
+ }>]>;
7092
+ }>>, typeof Schema.Never>;
7093
+
7094
+ export declare type WorkflowQueuedControlTarget = typeof WorkflowQueuedControlTargetSchema.Type;
7095
+
7096
+ export declare const WorkflowQueuedControlTargetSchema: Schema.Struct<{
7097
+ workflowName: typeof Schema.NonEmptyString;
7098
+ receiptId: typeof Schema.NonEmptyString;
7099
+ requestId: typeof Schema.NonEmptyString;
7100
+ }>;
7101
+
6728
7102
  export declare const workflowResumeDescriptor: ActionProcedureDescriptor<"__voltro.workflow.resume", Schema.Struct<{
6729
7103
  workflowName: typeof Schema.String;
6730
7104
  executionId: typeof Schema.String;
6731
- }>, Schema.Struct<{
6732
- ok: typeof Schema.Boolean;
6733
- }>, typeof Schema.Never>;
7105
+ control: Schema.optional<Schema.Struct<{
7106
+ requestId: typeof Schema.NonEmptyString;
7107
+ cause: Schema.optionalWith<Schema.Struct<{
7108
+ reason: typeof Schema.NonEmptyString;
7109
+ detail: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
7110
+ }>, {
7111
+ exact: true;
7112
+ }>;
7113
+ }>>;
7114
+ }>, Schema.filter<Schema.Struct<{
7115
+ operation: Schema.Literal<["cancel", "resume"]>;
7116
+ kind: Schema.Literal<["accepted", "confirmed", "unknown", "already-terminal"]>;
7117
+ requestId: Schema.NullOr<typeof Schema.NonEmptyString>;
7118
+ snapshot: Schema.Struct<{
7119
+ id: typeof Schema.String;
7120
+ workflowName: typeof Schema.String;
7121
+ executionId: typeof Schema.String;
7122
+ status: Schema.Union<[Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<["unknown"]>]>;
7123
+ output: Schema.optional<typeof Schema.Unknown>;
7124
+ error: Schema.optional<Schema.Struct<{
7125
+ tag: Schema.NullOr<typeof Schema.String>;
7126
+ message: typeof Schema.String;
7127
+ }>>;
7128
+ }>;
7129
+ }>>, typeof Schema.Never>;
6734
7130
 
6735
7131
  export declare type WorkflowRunEventRow = Schema.Schema.Type<typeof WorkflowRunEventRowSchema>;
6736
7132
 
@@ -6761,7 +7157,7 @@ export declare type WorkflowRunHandle = Schema.Schema.Type<typeof WorkflowRunHan
6761
7157
 
6762
7158
  export declare const WorkflowRunHandleSchema: Schema.Struct<{
6763
7159
  /** Stable handle callers pass to `useWorkflowRun(...)`. The durable execution
6764
- * id for a started run; the pending-intent id for a queued one. */
7160
+ * id for a started run; the durable caller-receipt id for a queued one. */
6765
7161
  id: typeof Schema.String;
6766
7162
  /** Workflow tag, e.g. `notes.summarise`. */
6767
7163
  workflowName: typeof Schema.String;
@@ -6781,6 +7177,7 @@ export declare const WorkflowRunHandleSchema: Schema.Struct<{
6781
7177
  executionId: Schema.NullOr<typeof Schema.String>;
6782
7178
  /**
6783
7179
  * `running` — the engine has it; starting is fire-and-return.
7180
+ * `succeeded` — a blocking start observed successful completion.
6784
7181
  * `queued` — flow control deferred it; see `deferral.dueAt`.
6785
7182
  * `dropped` — over a `rateLimit` cap. It will NOT run.
6786
7183
  * `skipped` — a `singleton: { mode: 'skip' }` key was held; `executionId`
@@ -6793,7 +7190,7 @@ export declare const WorkflowRunHandleSchema: Schema.Struct<{
6793
7190
  * a fresh start; a schedule keyed per day ran once and reported forty-seven
6794
7191
  * "starts" that were replays. See `workflow()`'s `idempotencyKey` doc.
6795
7192
  */
6796
- status: Schema.Literal<["running", "queued", "dropped", "skipped", "replayed"]>;
7193
+ status: Schema.Literal<["running", "succeeded", "queued", "dropped", "skipped", "replayed"]>;
6797
7194
  deferral: Schema.optional<Schema.Struct<{
6798
7195
  /** `debounce` | `batch` | `throttle` | `concurrency` | `paused` |
6799
7196
  * `rateLimit` | `singleton`. */
@@ -6869,6 +7266,21 @@ export declare const WorkflowRunsInputSchema: Schema.Struct<{
6869
7266
  limit: Schema.optional<typeof Schema.Number>;
6870
7267
  }>;
6871
7268
 
7269
+ export declare type WorkflowRunSnapshot = Schema.Schema.Type<typeof WorkflowRunSnapshotSchema>;
7270
+
7271
+ /** Observed execution state, distinct from admission/start handles. */
7272
+ export declare const WorkflowRunSnapshotSchema: Schema.Struct<{
7273
+ id: typeof Schema.String;
7274
+ workflowName: typeof Schema.String;
7275
+ executionId: typeof Schema.String;
7276
+ status: Schema.Union<[Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<["unknown"]>]>;
7277
+ output: Schema.optional<typeof Schema.Unknown>;
7278
+ error: Schema.optional<Schema.Struct<{
7279
+ tag: Schema.NullOr<typeof Schema.String>;
7280
+ message: typeof Schema.String;
7281
+ }>>;
7282
+ }>;
7283
+
6872
7284
  export declare const workflowRunsQueryDescriptor: QueryProcedureDescriptor<"__voltro.workflow.runs", Schema.Struct<{
6873
7285
  tag: Schema.optional<typeof Schema.String>;
6874
7286
  status: Schema.optional<Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>>;
@@ -6979,6 +7391,31 @@ export declare const WorkflowStartDeferralSchema: Schema.Struct<{
6979
7391
  intentId: Schema.NullOr<typeof Schema.String>;
6980
7392
  }>;
6981
7393
 
7394
+ export declare type WorkflowStartTerminalOutcome = typeof WorkflowStartTerminalOutcomeSchema.Type;
7395
+
7396
+ /** A settled admission outcome is not a terminal execution snapshot. In the
7397
+ * skipped case the identities belong to the incumbent, not to a new run. */
7398
+ export declare const WorkflowStartTerminalOutcomeSchema: Schema.Union<[Schema.Struct<{
7399
+ kind: Schema.Literal<["dropped"]>;
7400
+ at: typeof Schema.Number;
7401
+ retryAfterMs: typeof Schema.Number;
7402
+ }>, Schema.Struct<{
7403
+ kind: Schema.Literal<["skipped"]>;
7404
+ at: typeof Schema.Number;
7405
+ executionId: typeof Schema.String;
7406
+ runId: typeof Schema.String;
7407
+ }>, Schema.Struct<{
7408
+ kind: Schema.Literal<["superseded"]>;
7409
+ at: typeof Schema.Number;
7410
+ }>, Schema.Struct<{
7411
+ kind: Schema.Literal<["cancelled"]>;
7412
+ at: typeof Schema.Number;
7413
+ }>, Schema.Struct<{
7414
+ kind: Schema.Literal<["abandoned"]>;
7415
+ at: typeof Schema.Number;
7416
+ failureId: typeof Schema.NonEmptyString;
7417
+ }>]>;
7418
+
6982
7419
  /**
6983
7420
  * Per-step plugin interceptor. Wraps every `step()` (==
6984
7421
  * `Activity.make`) invocation inside a workflow body. Composed
@@ -7026,7 +7463,7 @@ export declare const workflowToRpc: <const Name extends string, Payload extends
7026
7463
  readonly errorSchema: Schema.Schema.All;
7027
7464
  }, extraErrors?: ExtraErrors) => Rpc.Rpc<Name, Payload extends Schema.Struct.Fields ? Schema.Struct<Payload> : Payload, Schema.Struct<{
7028
7465
  /** Stable handle callers pass to `useWorkflowRun(...)`. The durable execution
7029
- * id for a started run; the pending-intent id for a queued one. */
7466
+ * id for a started run; the durable caller-receipt id for a queued one. */
7030
7467
  id: typeof Schema.String;
7031
7468
  /** Workflow tag, e.g. `notes.summarise`. */
7032
7469
  workflowName: typeof Schema.String;
@@ -7046,6 +7483,7 @@ export declare const workflowToRpc: <const Name extends string, Payload extends
7046
7483
  executionId: Schema.NullOr<typeof Schema.String>;
7047
7484
  /**
7048
7485
  * `running` — the engine has it; starting is fire-and-return.
7486
+ * `succeeded` — a blocking start observed successful completion.
7049
7487
  * `queued` — flow control deferred it; see `deferral.dueAt`.
7050
7488
  * `dropped` — over a `rateLimit` cap. It will NOT run.
7051
7489
  * `skipped` — a `singleton: { mode: 'skip' }` key was held; `executionId`
@@ -7058,7 +7496,7 @@ export declare const workflowToRpc: <const Name extends string, Payload extends
7058
7496
  * a fresh start; a schedule keyed per day ran once and reported forty-seven
7059
7497
  * "starts" that were replays. See `workflow()`'s `idempotencyKey` doc.
7060
7498
  */
7061
- status: Schema.Literal<["running", "queued", "dropped", "skipped", "replayed"]>;
7499
+ status: Schema.Literal<["running", "succeeded", "queued", "dropped", "skipped", "replayed"]>;
7062
7500
  deferral: Schema.optional<Schema.Struct<{
7063
7501
  /** `debounce` | `batch` | `throttle` | `concurrency` | `paused` |
7064
7502
  * `rateLimit` | `singleton`. */