@voltro/client 0.69.1 → 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/index.d.ts CHANGED
@@ -19,8 +19,14 @@ import { Stream } from 'effect';
19
19
  import { SubscriptionEvent } from '@voltro/protocol';
20
20
  import { TargetRelations } from '@voltro/protocol';
21
21
  import { UIEvent as UIEvent_2 } from 'react';
22
+ import { WorkflowControlIntent } from '@voltro/protocol';
23
+ import { WorkflowControlReadInput } from '@voltro/protocol';
24
+ import { WorkflowControlResult } from '@voltro/protocol';
22
25
  import { WorkflowDomainEventRow } from '@voltro/protocol';
23
26
  import { WorkflowEventDeliveryRow } from '@voltro/protocol';
27
+ import { WorkflowQueuedCancelInput } from '@voltro/protocol';
28
+ import { WorkflowQueuedCancellationResult } from '@voltro/protocol';
29
+ import { WorkflowQueuedControlTarget } from '@voltro/protocol';
24
30
  import { WorkflowRunEventRow } from '@voltro/protocol';
25
31
  import { WorkflowRunHandle } from '@voltro/protocol';
26
32
  import { WorkflowRunRow } from '@voltro/protocol';
@@ -1741,6 +1747,12 @@ export declare interface MutationReplayReservation {
1741
1747
  readonly release: () => void;
1742
1748
  }
1743
1749
 
1750
+ export declare class MutationSerialExecutionError extends Error {
1751
+ readonly reason: 'capacity' | 'scope-changed' | 'unknown-predecessor' | 'invalid-key';
1752
+ readonly _tag = "MutationSerialExecutionError";
1753
+ constructor(reason: 'capacity' | 'scope-changed' | 'unknown-predecessor' | 'invalid-key');
1754
+ }
1755
+
1744
1756
  export declare interface MutationState<Input, Output> {
1745
1757
  /** Run the mutation. With no options it rejects on failure (unchanged).
1746
1758
  * With an error handler (`onError` / `notify.error`) the failure is handled
@@ -2552,46 +2564,46 @@ export declare const RichTextDocument: Schema.refine<{
2552
2564
  readonly content: readonly ({
2553
2565
  readonly type: "paragraph";
2554
2566
  readonly content: readonly ({
2555
- readonly text: string;
2556
2567
  readonly type: "text";
2568
+ readonly text: string;
2557
2569
  readonly marks?: readonly ("bold" | "strike" | "code" | "italic")[] | undefined;
2558
2570
  } | {
2559
2571
  readonly type: "link";
2560
2572
  readonly href: string;
2561
2573
  readonly content: readonly {
2562
- readonly text: string;
2563
2574
  readonly type: "text";
2575
+ readonly text: string;
2564
2576
  readonly marks?: readonly ("bold" | "strike" | "code" | "italic")[] | undefined;
2565
2577
  }[];
2566
2578
  })[];
2567
2579
  } | {
2568
2580
  readonly type: "heading";
2569
- readonly level: 1 | 2 | 3;
2581
+ readonly level: 2 | 1 | 3;
2570
2582
  readonly content: readonly ({
2571
- readonly text: string;
2572
2583
  readonly type: "text";
2584
+ readonly text: string;
2573
2585
  readonly marks?: readonly ("bold" | "strike" | "code" | "italic")[] | undefined;
2574
2586
  } | {
2575
2587
  readonly type: "link";
2576
2588
  readonly href: string;
2577
2589
  readonly content: readonly {
2578
- readonly text: string;
2579
2590
  readonly type: "text";
2591
+ readonly text: string;
2580
2592
  readonly marks?: readonly ("bold" | "strike" | "code" | "italic")[] | undefined;
2581
2593
  }[];
2582
2594
  })[];
2583
2595
  } | {
2584
2596
  readonly type: "blockquote";
2585
2597
  readonly content: readonly ({
2586
- readonly text: string;
2587
2598
  readonly type: "text";
2599
+ readonly text: string;
2588
2600
  readonly marks?: readonly ("bold" | "strike" | "code" | "italic")[] | undefined;
2589
2601
  } | {
2590
2602
  readonly type: "link";
2591
2603
  readonly href: string;
2592
2604
  readonly content: readonly {
2593
- readonly text: string;
2594
2605
  readonly type: "text";
2606
+ readonly text: string;
2595
2607
  readonly marks?: readonly ("bold" | "strike" | "code" | "italic")[] | undefined;
2596
2608
  }[];
2597
2609
  })[];
@@ -2600,15 +2612,15 @@ export declare const RichTextDocument: Schema.refine<{
2600
2612
  readonly content: readonly {
2601
2613
  readonly type: "listItem";
2602
2614
  readonly content: readonly ({
2603
- readonly text: string;
2604
2615
  readonly type: "text";
2616
+ readonly text: string;
2605
2617
  readonly marks?: readonly ("bold" | "strike" | "code" | "italic")[] | undefined;
2606
2618
  } | {
2607
2619
  readonly type: "link";
2608
2620
  readonly href: string;
2609
2621
  readonly content: readonly {
2610
- readonly text: string;
2611
2622
  readonly type: "text";
2623
+ readonly text: string;
2612
2624
  readonly marks?: readonly ("bold" | "strike" | "code" | "italic")[] | undefined;
2613
2625
  }[];
2614
2626
  })[];
@@ -2618,22 +2630,22 @@ export declare const RichTextDocument: Schema.refine<{
2618
2630
  readonly content: readonly {
2619
2631
  readonly type: "listItem";
2620
2632
  readonly content: readonly ({
2621
- readonly text: string;
2622
2633
  readonly type: "text";
2634
+ readonly text: string;
2623
2635
  readonly marks?: readonly ("bold" | "strike" | "code" | "italic")[] | undefined;
2624
2636
  } | {
2625
2637
  readonly type: "link";
2626
2638
  readonly href: string;
2627
2639
  readonly content: readonly {
2628
- readonly text: string;
2629
2640
  readonly type: "text";
2641
+ readonly text: string;
2630
2642
  readonly marks?: readonly ("bold" | "strike" | "code" | "italic")[] | undefined;
2631
2643
  }[];
2632
2644
  })[];
2633
2645
  }[];
2634
2646
  } | {
2635
- readonly text: string;
2636
2647
  readonly type: "codeBlock";
2648
+ readonly text: string;
2637
2649
  })[];
2638
2650
  }, Schema.Struct<{
2639
2651
  type: Schema.Literal<["doc"]>;
@@ -3351,6 +3363,7 @@ export declare const subscribeStoreHistory: (listener: Listener) => (() => void)
3351
3363
 
3352
3364
  export declare class SubscriptionCache {
3353
3365
  private readonly entries;
3366
+ private readonly refreshing;
3354
3367
  /**
3355
3368
  * Same-subject runtime replacement. A mutation may settle against the cache
3356
3369
  * it started on after React has already switched to the replacement cache.
@@ -3516,6 +3529,10 @@ export declare class SubscriptionCache {
3516
3529
  * promote naturally on their next subscriber.
3517
3530
  */
3518
3531
  refreshAll(runtime: AnyRuntime): void;
3532
+ /** Refresh one active query without clearing its visible data or optimistic
3533
+ * patches. Coalesce refreshes until that request answers or fails; never
3534
+ * interrupt an initial read merely because another refresh was requested. */
3535
+ refresh(key: ReadonlyArray<unknown>): boolean;
3519
3536
  /* Excluded from this release type: resumeTransportFailures */
3520
3537
  /**
3521
3538
  * The stall watchdog for one re-issued entry: `recoveryStuckMs` after the
@@ -4563,6 +4580,10 @@ export declare interface UseQueryFiltersOptions {
4563
4580
 
4564
4581
  export declare const useRecord: <R = Record<string, unknown>>(apiName: string, queryTag: string, input?: Readonly<Record<string, unknown>>) => RecordState<R>;
4565
4582
 
4583
+ /** Refresh just this input of this query, retaining its rendered data. Returns
4584
+ * false while the current read is pending or when nobody subscribes to it. */
4585
+ export declare const useRefreshSubscription: (apiName: string, tag: string, input: Readonly<Record<string, unknown>>) => (() => boolean);
4586
+
4566
4587
  export declare const useRefreshSubscriptions: (apiName: string) => (() => void);
4567
4588
 
4568
4589
  /**
@@ -4597,6 +4618,13 @@ export declare interface UseResourceCanState {
4597
4618
 
4598
4619
  export declare const useResumableAgentStream: <E = unknown>(apiName: string, rpcTag: string, options?: ResumableAgentStreamOptions<E>) => ResumableAgentStreamControls<E>;
4599
4620
 
4621
+ /** A schema-owned form for actions, parent plans, and local saves. It uses the
4622
+ * same validation/field engine without connecting to an API or inventing a tag. */
4623
+ export declare const useSchemaFormBinding: <Input extends Record<string, unknown>, Encoded, Output>(options: Omit<UseFormBindingOptions<Input>, "schema" | "onSubmit"> & {
4624
+ readonly schema: Schema.Schema<Input, Encoded>;
4625
+ readonly onSubmit: (input: Input) => Output | Promise<Output>;
4626
+ }) => FormBinding<Input, Output>;
4627
+
4600
4628
  /**
4601
4629
  * @param options Sequence-wide defaults — most usefully `onError`, which fires
4602
4630
  * once per failed sequence instead of once per step.
@@ -4970,8 +4998,11 @@ export declare interface WorkflowSignalState {
4970
4998
 
4971
4999
  export declare interface WorkflowState<Payload, Messages extends WorkflowClientMessages = WorkflowClientMessages> {
4972
5000
  readonly start: (payload: Payload) => Promise<WorkflowRunHandle>;
4973
- readonly cancel: (run: Pick<WorkflowRunHandle, 'workflowName' | 'executionId'>) => Promise<void>;
4974
- readonly resume: (run: Pick<WorkflowRunHandle, 'workflowName' | 'executionId'>) => Promise<void>;
5001
+ readonly cancelQueued: (input: WorkflowQueuedCancelInput) => Promise<WorkflowQueuedCancellationResult>;
5002
+ readonly readQueuedCancellation: (target: WorkflowQueuedControlTarget) => Promise<WorkflowQueuedCancellationResult>;
5003
+ readonly readControl: (target: WorkflowControlReadInput) => Promise<WorkflowControlResult>;
5004
+ readonly cancel: (run: Pick<WorkflowRunHandle, 'workflowName' | 'executionId'>, control?: WorkflowControlIntent) => Promise<WorkflowControlResult>;
5005
+ readonly resume: (run: Pick<WorkflowRunHandle, 'workflowName' | 'executionId'>, control?: WorkflowControlIntent) => Promise<WorkflowControlResult>;
4975
5006
  readonly signal: <Name extends string>(run: Pick<WorkflowRunHandle, 'id'>, signalName: Name, payload?: SignalPayload<Messages, Name>) => Promise<{
4976
5007
  readonly eventId: string;
4977
5008
  }>;