@voltro/client 0.70.0 → 0.71.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.
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';
@@ -3357,6 +3363,7 @@ export declare const subscribeStoreHistory: (listener: Listener) => (() => void)
3357
3363
 
3358
3364
  export declare class SubscriptionCache {
3359
3365
  private readonly entries;
3366
+ private readonly refreshing;
3360
3367
  /**
3361
3368
  * Same-subject runtime replacement. A mutation may settle against the cache
3362
3369
  * it started on after React has already switched to the replacement cache.
@@ -3522,6 +3529,10 @@ export declare class SubscriptionCache {
3522
3529
  * promote naturally on their next subscriber.
3523
3530
  */
3524
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;
3525
3536
  /* Excluded from this release type: resumeTransportFailures */
3526
3537
  /**
3527
3538
  * The stall watchdog for one re-issued entry: `recoveryStuckMs` after the
@@ -4569,6 +4580,10 @@ export declare interface UseQueryFiltersOptions {
4569
4580
 
4570
4581
  export declare const useRecord: <R = Record<string, unknown>>(apiName: string, queryTag: string, input?: Readonly<Record<string, unknown>>) => RecordState<R>;
4571
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
+
4572
4587
  export declare const useRefreshSubscriptions: (apiName: string) => (() => void);
4573
4588
 
4574
4589
  /**
@@ -4603,6 +4618,13 @@ export declare interface UseResourceCanState {
4603
4618
 
4604
4619
  export declare const useResumableAgentStream: <E = unknown>(apiName: string, rpcTag: string, options?: ResumableAgentStreamOptions<E>) => ResumableAgentStreamControls<E>;
4605
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
+
4606
4628
  /**
4607
4629
  * @param options Sequence-wide defaults — most usefully `onError`, which fires
4608
4630
  * once per failed sequence instead of once per step.
@@ -4976,8 +4998,11 @@ export declare interface WorkflowSignalState {
4976
4998
 
4977
4999
  export declare interface WorkflowState<Payload, Messages extends WorkflowClientMessages = WorkflowClientMessages> {
4978
5000
  readonly start: (payload: Payload) => Promise<WorkflowRunHandle>;
4979
- readonly cancel: (run: Pick<WorkflowRunHandle, 'workflowName' | 'executionId'>) => Promise<void>;
4980
- 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>;
4981
5006
  readonly signal: <Name extends string>(run: Pick<WorkflowRunHandle, 'id'>, signalName: Name, payload?: SignalPayload<Messages, Name>) => Promise<{
4982
5007
  readonly eventId: string;
4983
5008
  }>;