@voltro/protocol 0.74.0 → 0.76.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.
@@ -65,7 +65,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
65
65
  SOFTWARE.
66
66
  ```
67
67
 
68
- ## jose@6.2.10
68
+ ## jose@6.2.12
69
69
 
70
70
  License: MIT
71
71
 
package/dist/index.d.ts CHANGED
@@ -496,7 +496,7 @@ export declare interface AuthenticatedGuardSpec {
496
496
  * an auth resolver before reaching its handler. The application provides
497
497
  * the resolver via `Layer.succeed(AuthMiddleware, AuthMiddleware.of(fn))`,
498
498
  * where `fn` receives `{headers, payload, rpc, clientId}` and returns an
499
- * `Effect<Subject>` — typically by inspecting headers / Bearer token and
499
+ * `Effect<Subject, Unauthenticated>` — typically by inspecting headers / Bearer token and
500
500
  * looking the caller up.
501
501
  *
502
502
  * `provides: SubjectService` means the resolver's return value is placed
@@ -514,6 +514,7 @@ export declare class AuthMiddleware extends AuthMiddleware_base {
514
514
 
515
515
  declare const AuthMiddleware_base: RpcMiddleware.TagClass<AuthMiddleware, "@voltro/AuthMiddleware", {
516
516
  readonly provides: typeof SubjectService;
517
+ readonly failure: typeof Unauthenticated;
517
518
  }>;
518
519
 
519
520
  export declare type AuthRouteHandler = (req: AuthRouteRequest) => Promise<AuthRouteResponse>;
@@ -3844,7 +3845,7 @@ export declare interface PluginLifecycleContext {
3844
3845
  * and the artifact's index — so a store that supports resumable puts stores
3845
3846
  * one object however often the dispatcher is retried. */
3846
3847
  export declare interface PluginMediaPersistCapability {
3847
- readonly put: (args: {
3848
+ readonly put: (args: PluginMediaPersistMetadata & {
3848
3849
  readonly bytes: Uint8Array;
3849
3850
  readonly mediaType: string;
3850
3851
  readonly tenantId: string | null;
@@ -3854,7 +3855,7 @@ export declare interface PluginMediaPersistCapability {
3854
3855
  readonly refId: string;
3855
3856
  }>;
3856
3857
  /** Re-host a provider URL. Absent → the provider's URL is handed on as-is. */
3857
- readonly ingestUrl?: (args: {
3858
+ readonly ingestUrl?: (args: PluginMediaPersistMetadata & {
3858
3859
  readonly url: string;
3859
3860
  readonly tenantId: string | null;
3860
3861
  readonly operationId: string;
@@ -3864,6 +3865,19 @@ export declare interface PluginMediaPersistCapability {
3864
3865
  }>;
3865
3866
  }
3866
3867
 
3868
+ /**
3869
+ * Who a persisted media artifact belongs to, how it is served, and how it is
3870
+ * found again. The dispatcher knows none of this — the caller of `mediaStep`
3871
+ * does — so it rides the queued job and is handed to the store as-is. Without
3872
+ * it every generated artifact landed owner-less, private and untagged, and an
3873
+ * app whose deletion and restore key on owner and tags could not use it.
3874
+ */
3875
+ export declare interface PluginMediaPersistMetadata {
3876
+ readonly ownerId?: string | null;
3877
+ readonly visibility?: 'public' | 'private';
3878
+ readonly tags?: ReadonlyArray<string>;
3879
+ }
3880
+
3867
3881
  export declare interface PluginMigration {
3868
3882
  readonly id: string;
3869
3883
  readonly description?: string;
@@ -6707,8 +6721,14 @@ export declare interface VoltroTableNames {
6707
6721
  /** What a gateway's connection handler receives. Transport-agnostic on
6708
6722
  * purpose — the runtime adapts the platform socket to this. */
6709
6723
  export declare interface WebSocketGatewayConnection {
6710
- /** Send a text or binary frame. */
6724
+ /** Enqueue a bounded text or binary frame; overflow closes the connection. */
6711
6725
  readonly send: (data: string | Uint8Array) => void;
6726
+ /** Await the local transport write, NOT peer receipt. Rejects on close or
6727
+ * overflow. Await each send to propagate backpressure to the producer. */
6728
+ readonly sendAsync: (data: string | Uint8Array) => Promise<void>;
6729
+ /** Aborted on close, expiry, shutdown or setup failure, including while
6730
+ * onConnection is still awaiting an upstream connection. */
6731
+ readonly signal: AbortSignal;
6712
6732
  /** Close the connection (application close codes 4000-4999 are yours). */
6713
6733
  readonly close: (code?: number, reason?: string) => void;
6714
6734
  /** Register a message listener (binary-safe; text arrives as bytes). */
@@ -6736,12 +6756,23 @@ export declare interface WebSocketGatewayRoute {
6736
6756
  * protocol-level auth). A decision somebody wrote down, not a default.
6737
6757
  */
6738
6758
  readonly auth: 'subject' | 'public';
6759
+ /** Per-connection bounds. Inbound size is checked before app dispatch,
6760
+ * not before the platform assembles a WebSocket message. */
6761
+ readonly limits?: {
6762
+ /** Maximum inbound/outbound frame bytes; default 1 MiB. */
6763
+ readonly maxMessageBytes?: number;
6764
+ /** Active plus queued outbound bytes; default 4 MiB. */
6765
+ readonly maxPendingBytes?: number;
6766
+ /** Active plus queued outbound messages; default 64. */
6767
+ readonly maxPendingMessages?: number;
6768
+ };
6739
6769
  /**
6740
6770
  * Runs once per accepted connection. The returned function is the
6741
6771
  * connection's TEARDOWN — taken at construction (the `startOutboxRunner`
6742
6772
  * rule): it runs on client disconnect, on credential expiry, and on
6743
6773
  * server shutdown, so whatever the handler opened cannot outlive the
6744
- * socket.
6774
+ * socket. Message listeners are live during async setup. If setup finishes
6775
+ * after disconnect, its returned teardown still runs exactly once.
6745
6776
  */
6746
6777
  readonly onConnection: (connection: WebSocketGatewayConnection) => void | (() => void) | Promise<void | (() => void)>;
6747
6778
  }
@@ -6819,6 +6850,12 @@ export declare const withRpcTag: <D extends {
6819
6850
  export declare interface WorkflowAccess {
6820
6851
  /** The author's guards, or the erased `openAccess` entry — never both. */
6821
6852
  readonly guards: DeclaredAccess<unknown> | undefined;
6853
+ /** The CONTROL decision: the author's `controls.guards`, or the erased
6854
+ * `controls.openAccess` entry. `undefined` means undecided — wire control
6855
+ * is refused (system and `admin:full` aside). */
6856
+ readonly controls: DeclaredAccess<unknown> | undefined;
6857
+ /** The reason text, when control is open. */
6858
+ readonly controlsOpenAccess: string | undefined;
6822
6859
  readonly openAccess: string | undefined;
6823
6860
  readonly internal: boolean;
6824
6861
  }
@@ -6836,6 +6873,8 @@ export declare const workflowAccessDescriptor: (definition: {
6836
6873
  readonly internal: boolean;
6837
6874
  readonly guards: DeclaredAccess<unknown> | undefined;
6838
6875
  readonly openAccess: string | undefined;
6876
+ /** The CONTROL decision — `undefined` means undecided, and wire control is refused. */
6877
+ readonly controls: DeclaredAccess<unknown> | undefined;
6839
6878
  };
6840
6879
 
6841
6880
  /** What an author writes on `workflow({ … })`. */
@@ -6865,6 +6904,32 @@ export declare interface WorkflowAccessOptions<Payload = unknown> {
6865
6904
  * Cannot be combined with `openAccess` (there is no wire to decide about).
6866
6905
  */
6867
6906
  readonly internal?: boolean;
6907
+ /**
6908
+ * WHO MAY DRIVE a RUN of this workflow over the wire — `cancel`, `signal`,
6909
+ * `update`, `resume`, and the queued forms of cancel. Same vocabulary as
6910
+ * `guards:` / `openAccess:`, and a SEPARATE decision on purpose.
6911
+ *
6912
+ * Starting and driving are different authorities. The approval pattern is
6913
+ * the case that shows it: the customer who may START an order must not be
6914
+ * the one who signals its own approval, and the manager who approves may not
6915
+ * place orders at all. Reusing the start decision would get both wrong.
6916
+ *
6917
+ * Declared with NOTHING, wire control is refused for every caller but the
6918
+ * system and a subject holding `admin:full`. That default is what makes the
6919
+ * app's own guarded surface (`orders.approve`, with its `{ scope }`) the only
6920
+ * way in: the built-in used to hand the same decision to anyone in the
6921
+ * tenant who knew the run id, which is the app's authorization undone by a
6922
+ * procedure the app never wrote.
6923
+ *
6924
+ * A resource-scoped guard reads its id from the RUN's start payload, exactly
6925
+ * as the start guard reads it from the start input:
6926
+ * `controls: { guards: [{ action: 'approve', resourceType: 'order', resource: (p) => p.orderId }] }`.
6927
+ */
6928
+ readonly controls?: {
6929
+ readonly guards?: Guards<Payload>;
6930
+ /** Anyone who may see the run may drive it — and WHY. A reason, never a boolean. */
6931
+ readonly openAccess?: string;
6932
+ };
6868
6933
  }
6869
6934
 
6870
6935
  /** The non-enumerable property a `workflow()` definition carries its decision under. */
@@ -7274,6 +7339,85 @@ export declare const workflowResumeDescriptor: ActionProcedureDescriptor<"__volt
7274
7339
  }>;
7275
7340
  }>>, typeof Schema.Never>;
7276
7341
 
7342
+ export declare type WorkflowRetryCommand = typeof WorkflowRetryCommandSchema.Type;
7343
+
7344
+ /** Transport input for one deliberate retry; ownership is resolved server-side.
7345
+ * The optional override is encoded with the complete workflow payload schema. */
7346
+ export declare const WorkflowRetryCommandSchema: Schema.Struct<{
7347
+ payloadOverride: Schema.optional<typeof Schema.Unknown>;
7348
+ runId: Schema.filter<typeof Schema.NonEmptyString>;
7349
+ requestId: Schema.filter<typeof Schema.NonEmptyString>;
7350
+ }>;
7351
+
7352
+ export declare type WorkflowRetryObservation = typeof WorkflowRetryObservationSchema.Type;
7353
+
7354
+ /** Observation of one durable retry intent. Engine acceptance is not workflow
7355
+ * completion. A prepared identity alone never proves that execution started. */
7356
+ export declare const WorkflowRetryObservationSchema: Schema.Union<[Schema.Struct<{
7357
+ kind: Schema.Literal<["queued"]>;
7358
+ nextAttemptAt: Schema.NullOr<typeof Schema.Number>;
7359
+ requestId: typeof Schema.NonEmptyString;
7360
+ originalRunId: typeof Schema.NonEmptyString;
7361
+ originalExecutionId: typeof Schema.NonEmptyString;
7362
+ workflowName: typeof Schema.NonEmptyString;
7363
+ }>, Schema.filter<Schema.Struct<{
7364
+ kind: Schema.Literal<["accepted"]>;
7365
+ executionId: typeof Schema.NonEmptyString;
7366
+ requestId: typeof Schema.NonEmptyString;
7367
+ originalRunId: typeof Schema.NonEmptyString;
7368
+ originalExecutionId: typeof Schema.NonEmptyString;
7369
+ workflowName: typeof Schema.NonEmptyString;
7370
+ }>>, Schema.filter<Schema.Struct<{
7371
+ kind: Schema.Literal<["unconfirmed"]>;
7372
+ automaticRetryStopped: typeof Schema.Boolean;
7373
+ nextAttemptAt: Schema.NullOr<typeof Schema.Number>;
7374
+ requestId: typeof Schema.NonEmptyString;
7375
+ originalRunId: typeof Schema.NonEmptyString;
7376
+ originalExecutionId: typeof Schema.NonEmptyString;
7377
+ workflowName: typeof Schema.NonEmptyString;
7378
+ }>>, Schema.Struct<{
7379
+ kind: Schema.Literal<["not-started"]>;
7380
+ outcome: Schema.Union<[Schema.Struct<{
7381
+ kind: Schema.Literal<["dropped"]>;
7382
+ at: typeof Schema.Number;
7383
+ retryAfterMs: typeof Schema.Number;
7384
+ }>, Schema.Struct<{
7385
+ kind: Schema.Literal<["skipped"]>;
7386
+ at: typeof Schema.Number;
7387
+ executionId: typeof Schema.String;
7388
+ runId: typeof Schema.String;
7389
+ }>, Schema.Struct<{
7390
+ kind: Schema.Literal<["superseded"]>;
7391
+ at: typeof Schema.Number;
7392
+ }>, Schema.Struct<{
7393
+ kind: Schema.Literal<["cancelled"]>;
7394
+ at: typeof Schema.Number;
7395
+ }>, Schema.Struct<{
7396
+ kind: Schema.Literal<["abandoned"]>;
7397
+ at: typeof Schema.Number;
7398
+ failureId: typeof Schema.NonEmptyString;
7399
+ }>]>;
7400
+ requestId: typeof Schema.NonEmptyString;
7401
+ originalRunId: typeof Schema.NonEmptyString;
7402
+ originalExecutionId: typeof Schema.NonEmptyString;
7403
+ workflowName: typeof Schema.NonEmptyString;
7404
+ }>, Schema.Struct<{
7405
+ kind: Schema.Literal<["rejected"]>;
7406
+ failureId: typeof Schema.NonEmptyString;
7407
+ requestId: typeof Schema.NonEmptyString;
7408
+ originalRunId: typeof Schema.NonEmptyString;
7409
+ originalExecutionId: typeof Schema.NonEmptyString;
7410
+ workflowName: typeof Schema.NonEmptyString;
7411
+ }>]>;
7412
+
7413
+ export declare type WorkflowRetryTarget = typeof WorkflowRetryTargetSchema.Type;
7414
+
7415
+ /** Persist the request ID before sending. Reuse this target after a lost reply. */
7416
+ export declare const WorkflowRetryTargetSchema: Schema.Struct<{
7417
+ runId: Schema.filter<typeof Schema.NonEmptyString>;
7418
+ requestId: Schema.filter<typeof Schema.NonEmptyString>;
7419
+ }>;
7420
+
7277
7421
  export declare type WorkflowRunEventRow = Schema.Schema.Type<typeof WorkflowRunEventRowSchema>;
7278
7422
 
7279
7423
  export declare const WorkflowRunEventRowSchema: Schema.Struct<{