@voltro/client 0.89.1 → 0.90.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/CHANGELOG.md +1835 -0
- package/README.md +22 -0
- package/dist/analytics.d.ts +68 -0
- package/dist/analytics.js +1 -0
- package/dist/awaitResolvedApi.js +45 -19
- package/dist/bootstrap.d.ts +0 -115
- package/dist/connectionSetupController.js +93 -61
- package/dist/index.d.ts +148 -162
- package/dist/index.js +87 -85
- package/dist/invocationWait.js +14 -0
- package/dist/mutationsBus.js +92 -35
- package/dist/outbox.js +147 -118
- package/dist/outboxState.js +7 -0
- package/dist/query.js +3 -10
- package/dist/rpcCallOnce.js +30 -0
- package/dist/rpcDeclared.js +7 -0
- package/dist/runRpc.js +9 -6
- package/dist/runtime.d.ts +16 -116
- package/dist/runtime.js +16 -16
- package/dist/traceBus.js +7 -1
- package/dist/unknownRpcTag.js +7 -0
- package/dist/uploadBytes.js +83 -0
- package/dist/uploadClient.js +153 -0
- package/dist/useAction.js +146 -72
- package/dist/useMutation.js +220 -133
- package/dist/useRpcCaller.js +74 -12
- package/dist/useRpcInvocationOwner.js +29 -0
- package/dist/useSubscription.js +52 -49
- package/dist/useTranscription.js +114 -42
- package/dist/useUpload.js +160 -242
- package/dist/useWorkflow.js +111 -246
- package/dist/workflowClient.js +126 -0
- package/package.json +7 -2
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { ClientDescriptor } from '@voltro/protocol';
|
|
|
4
4
|
import { ClipboardEvent as ClipboardEvent_2 } from 'react';
|
|
5
5
|
import { Context } from 'react';
|
|
6
6
|
import { createRowPatchApplier } from '@voltro/protocol';
|
|
7
|
+
import { DEFAULT_WEBHOOK_INSPECT_LIST } from '@voltro/protocol/inspect';
|
|
7
8
|
import { DEV_ACTIVITY_EVENT } from '@voltro/protocol';
|
|
8
9
|
import { DevActivityMessage } from '@voltro/protocol';
|
|
9
10
|
import { DragEvent as DragEvent_2 } from 'react';
|
|
@@ -16,11 +17,15 @@ import { Fiber } from 'effect';
|
|
|
16
17
|
import { FORM_CAPTURE_FIELD } from '@voltro/protocol';
|
|
17
18
|
import { FORM_CAPTURE_META_NAME } from '@voltro/protocol';
|
|
18
19
|
import { formCaptureSource } from '@voltro/protocol';
|
|
20
|
+
import { isWebhookEventActivity } from '@voltro/protocol/inspect';
|
|
21
|
+
import { isWebhookInspectActivityStatus } from '@voltro/protocol/inspect';
|
|
22
|
+
import { isWebhookInspectPagination } from '@voltro/protocol/inspect';
|
|
19
23
|
import { JsonSchemaDocument } from '@voltro/protocol';
|
|
20
24
|
import { jsonSchemaDocumentOf } from '@voltro/protocol';
|
|
21
25
|
import { jsonSchemaOf } from '@voltro/protocol';
|
|
22
26
|
import { JsonSchemaOptions } from '@voltro/protocol';
|
|
23
27
|
import { ManagedRuntime } from 'effect';
|
|
28
|
+
import { MAX_WEBHOOK_INSPECT_OFFSET } from '@voltro/protocol/inspect';
|
|
24
29
|
import { Pairing } from '@voltro/protocol';
|
|
25
30
|
import { PAIRING_HOST } from '@voltro/protocol';
|
|
26
31
|
import { PAIRING_SCHEME } from '@voltro/protocol';
|
|
@@ -43,6 +48,13 @@ import { Stream } from 'effect';
|
|
|
43
48
|
import { SubscriptionEvent } from '@voltro/protocol';
|
|
44
49
|
import { TargetRelations } from '@voltro/protocol';
|
|
45
50
|
import { UIEvent as UIEvent_2 } from 'react';
|
|
51
|
+
import { WebhookEventActivity } from '@voltro/protocol/inspect';
|
|
52
|
+
import { WebhookInspectActivityStatus } from '@voltro/protocol/inspect';
|
|
53
|
+
import { WebhookInspectListInput } from '@voltro/protocol/inspect';
|
|
54
|
+
import { WebhookInspectListRequest } from '@voltro/protocol/inspect';
|
|
55
|
+
import { webhookInspectListRequest } from '@voltro/protocol/inspect';
|
|
56
|
+
import { WebhookInspectPage } from '@voltro/protocol/inspect';
|
|
57
|
+
import { WebhookInspectPagination } from '@voltro/protocol/inspect';
|
|
46
58
|
import { WebSocketConstructorOptions } from 'effect/socket/Socket';
|
|
47
59
|
import { WorkflowControlIntent } from '@voltro/protocol';
|
|
48
60
|
import { WorkflowControlReadInput } from '@voltro/protocol';
|
|
@@ -63,14 +75,21 @@ import { WorkflowUpdateResult } from '@voltro/protocol';
|
|
|
63
75
|
* (a per-resource guard, or an undeclared decision). */
|
|
64
76
|
export declare type AccessDecision = 'allowed' | 'denied' | 'unknown';
|
|
65
77
|
|
|
78
|
+
export declare interface ActionOptions<Input, Output> extends MutateOptions<Input, Output> {
|
|
79
|
+
/** Withdraw this local call and its callbacks. Before RPC construction no
|
|
80
|
+
* request starts; a started remote operation may still commit. */
|
|
81
|
+
readonly signal?: AbortSignal;
|
|
82
|
+
}
|
|
83
|
+
|
|
66
84
|
export declare interface ActionState<Input, Output> {
|
|
67
85
|
/** Invoke the action.
|
|
68
86
|
*
|
|
69
|
-
* Takes
|
|
87
|
+
* Takes mutation callbacks plus a local `signal` through `ActionOptions`, including the
|
|
70
88
|
* load-bearing semantic: supplying an error handler (`onError` or
|
|
71
89
|
* `notify.error`) marks the failure HANDLED, so `run` resolves with
|
|
72
|
-
* `undefined` instead of rejecting
|
|
73
|
-
*
|
|
90
|
+
* `undefined` instead of rejecting. A call whose Subject or mounted lifetime
|
|
91
|
+
* ended rejects even with these options, without invoking old callbacks or
|
|
92
|
+
* notifications. A remotely started action may still have committed.
|
|
74
93
|
*
|
|
75
94
|
* The asymmetry this closes was arbitrary: roughly half of a real app's
|
|
76
95
|
* write sites are actions, and they were the half that could not use the
|
|
@@ -82,7 +101,7 @@ export declare interface ActionState<Input, Output> {
|
|
|
82
101
|
* multi-step sequences want the bare `run(input)` and a real try/catch. */
|
|
83
102
|
readonly run: {
|
|
84
103
|
(input: Input): Promise<Output>;
|
|
85
|
-
(input: Input, options:
|
|
104
|
+
(input: Input, options: ActionOptions<Input, Output>): Promise<Output | undefined>;
|
|
86
105
|
};
|
|
87
106
|
/** True while a call is in flight. */
|
|
88
107
|
readonly pending: boolean;
|
|
@@ -701,7 +720,8 @@ export declare type CellMerger = (column: string, prevValue: unknown, update: un
|
|
|
701
720
|
|
|
702
721
|
export declare const clearClientDiagnostics: () => void;
|
|
703
722
|
|
|
704
|
-
/** Clear
|
|
723
|
+
/** Clear all retained rows and release their Subject listeners. Old invocation
|
|
724
|
+
* handles cannot settle a later row, including one with the same id. */
|
|
705
725
|
export declare const clearMutations: () => void;
|
|
706
726
|
|
|
707
727
|
export { clearPairing }
|
|
@@ -810,6 +830,17 @@ export declare interface ClientTraceEvent {
|
|
|
810
830
|
|
|
811
831
|
declare type ClientTraceListener = (event: ClientTraceEvent) => void;
|
|
812
832
|
|
|
833
|
+
/** A traced call whose server answered with a failure its descriptor declares (a typed refusal the
|
|
834
|
+
* caller can handle, `kind: 'handler'`), not a defect or a transport loss. The dev trace bridge
|
|
835
|
+
* logs that trace's errored spans as a refusal instead of surfacing them as errors. */
|
|
836
|
+
export declare interface ClientTraceRefusal {
|
|
837
|
+
readonly traceId: string;
|
|
838
|
+
/** RPC tag (e.g. `'social.request'`). */
|
|
839
|
+
readonly tag: string;
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
declare type ClientTraceRefusalListener = (event: ClientTraceRefusal) => void;
|
|
843
|
+
|
|
813
844
|
/** A compensation that itself failed. Surfaced rather than swallowed: the app
|
|
814
845
|
* now has an orphan it may need to reconcile, and hiding that is how orphans
|
|
815
846
|
* become permanent. */
|
|
@@ -897,7 +928,6 @@ export declare const CONNECTIONS_LIST_TAG = "__voltro.connections.list";
|
|
|
897
928
|
* deliberately not an input: outgoing and replacement runtimes share health.
|
|
898
929
|
*/
|
|
899
930
|
declare class ConnectionScope {
|
|
900
|
-
#private;
|
|
901
931
|
readonly getSnapshot: () => ConnectionLease | undefined;
|
|
902
932
|
readonly subscribe: (listener: () => void) => (() => void);
|
|
903
933
|
begin(): ConnectionAttempt;
|
|
@@ -1093,6 +1123,8 @@ export declare interface DeepLinkSource {
|
|
|
1093
1123
|
readonly subscribe: (onUrl: (url: string) => void) => () => void;
|
|
1094
1124
|
}
|
|
1095
1125
|
|
|
1126
|
+
export { DEFAULT_WEBHOOK_INSPECT_LIST }
|
|
1127
|
+
|
|
1096
1128
|
/**
|
|
1097
1129
|
* Exponential backoff from 1 s, capped at 30 s, jittered into the upper half of
|
|
1098
1130
|
* each step — the same curve `@voltro/local-first`'s sync client uses for CRDT
|
|
@@ -1788,7 +1820,7 @@ export declare const freshIdempotencyKey: () => string;
|
|
|
1788
1820
|
/** The registered notifier, if any. */
|
|
1789
1821
|
export declare const getMutationNotifier: () => MutationNotifier | undefined;
|
|
1790
1822
|
|
|
1791
|
-
/**
|
|
1823
|
+
/** Stable current snapshot. Previously copied payloads cannot be recalled. */
|
|
1792
1824
|
export declare const getMutations: () => ReadonlyArray<MutationEvent>;
|
|
1793
1825
|
|
|
1794
1826
|
/**
|
|
@@ -1931,6 +1963,12 @@ export declare const isUnauthenticated: (error: unknown) => boolean;
|
|
|
1931
1963
|
*/
|
|
1932
1964
|
export declare const isUnresolvedApi: (handle: ApiHandle) => boolean;
|
|
1933
1965
|
|
|
1966
|
+
export { isWebhookEventActivity }
|
|
1967
|
+
|
|
1968
|
+
export { isWebhookInspectActivityStatus }
|
|
1969
|
+
|
|
1970
|
+
export { isWebhookInspectPagination }
|
|
1971
|
+
|
|
1934
1972
|
export { JsonSchemaDocument }
|
|
1935
1973
|
|
|
1936
1974
|
export { jsonSchemaDocumentOf }
|
|
@@ -2070,6 +2108,8 @@ export declare const matchFirstDeepLink: (descriptors: ReadonlyArray<DeepLinkDes
|
|
|
2070
2108
|
readonly params: Record<string, string>;
|
|
2071
2109
|
} | null;
|
|
2072
2110
|
|
|
2111
|
+
export { MAX_WEBHOOK_INSPECT_OFFSET }
|
|
2112
|
+
|
|
2073
2113
|
/** A token store over process memory — a test double, and the honest answer
|
|
2074
2114
|
* for a shell whose secure store is not wired yet (it survives nothing). */
|
|
2075
2115
|
export declare const memoryTokenStore: () => TokenStore;
|
|
@@ -2103,8 +2143,8 @@ export declare interface MountedApi {
|
|
|
2103
2143
|
export declare interface MutateOptions<Input, Output> {
|
|
2104
2144
|
/** Ran after the server confirms the write. */
|
|
2105
2145
|
readonly onSuccess?: (output: Output, input: Input) => void;
|
|
2106
|
-
/** Ran on failure. Providing it
|
|
2107
|
-
*
|
|
2146
|
+
/** Ran on a current-owner failure. Providing it handles that error, resolving
|
|
2147
|
+
* with `undefined`. Lifetime invalidation rejects without invoking old callbacks. */
|
|
2108
2148
|
readonly onError?: (error: unknown, input: Input) => void;
|
|
2109
2149
|
/** Declarative sugar over the app-wide notifier (see `setMutationNotifier`).
|
|
2110
2150
|
* Values are passed through verbatim — resolve i18n yourself. Setting
|
|
@@ -2132,6 +2172,9 @@ export declare interface MutationBuilder<Input, Output> extends MutationState<In
|
|
|
2132
2172
|
}
|
|
2133
2173
|
|
|
2134
2174
|
export declare interface MutationEvent {
|
|
2175
|
+
/** Original API Subject lifetime; consumers retaining a selected row must
|
|
2176
|
+
* observe its revocation even after ring eviction. Contains no identity data. */
|
|
2177
|
+
readonly subjectSignal: AbortSignal;
|
|
2135
2178
|
/** Procedure kind used to group invocations in devtools. Defaults to mutation. */
|
|
2136
2179
|
readonly kind?: 'mutation' | 'action';
|
|
2137
2180
|
/** Stable id of the mutation invocation. Matches the cache's
|
|
@@ -2144,10 +2187,14 @@ export declare interface MutationEvent {
|
|
|
2144
2187
|
/** Status — published as 'pending' on start, transitions to
|
|
2145
2188
|
* 'success' or 'error' on settle. */
|
|
2146
2189
|
readonly status: MutationStatus;
|
|
2147
|
-
/**
|
|
2190
|
+
/** Input value; undefined when inputOmitted is set. */
|
|
2148
2191
|
readonly input: unknown;
|
|
2192
|
+
/** Input deliberately omitted by the declared client-history policy. */
|
|
2193
|
+
readonly inputOmitted?: true | undefined;
|
|
2149
2194
|
/** Resolved output on success. */
|
|
2150
2195
|
readonly output?: unknown;
|
|
2196
|
+
/** Successful one-time output intentionally omitted from this feed. */
|
|
2197
|
+
readonly outputOmitted?: true | undefined;
|
|
2151
2198
|
/** Thrown / rejected error on failure. */
|
|
2152
2199
|
readonly error?: unknown;
|
|
2153
2200
|
/** Wall-clock ms when the mutation started. */
|
|
@@ -2158,6 +2205,12 @@ export declare interface MutationEvent {
|
|
|
2158
2205
|
readonly durationMs?: number;
|
|
2159
2206
|
}
|
|
2160
2207
|
|
|
2208
|
+
/** Opaque publication handle. Clearing, eviction or Subject retirement makes
|
|
2209
|
+
* settlement a no-op, even if a new invocation reuses the displayed id. */
|
|
2210
|
+
export declare interface MutationInvocation {
|
|
2211
|
+
readonly settle: (outcome: MutationOutcome) => void;
|
|
2212
|
+
}
|
|
2213
|
+
|
|
2161
2214
|
/** The app's toast/notification sink. Deliberately NOT baked to any library —
|
|
2162
2215
|
* register your own once at boot (sonner, react-hot-toast, a custom banner). */
|
|
2163
2216
|
export declare interface MutationNotifier {
|
|
@@ -2165,6 +2218,16 @@ export declare interface MutationNotifier {
|
|
|
2165
2218
|
readonly error: (message: string) => void;
|
|
2166
2219
|
}
|
|
2167
2220
|
|
|
2221
|
+
/** One final outcome for one diagnostic invocation. */
|
|
2222
|
+
export declare type MutationOutcome = {
|
|
2223
|
+
readonly status: 'success';
|
|
2224
|
+
readonly output: unknown;
|
|
2225
|
+
readonly outputOmitted?: true | undefined;
|
|
2226
|
+
} | {
|
|
2227
|
+
readonly status: 'error';
|
|
2228
|
+
readonly error: unknown;
|
|
2229
|
+
};
|
|
2230
|
+
|
|
2168
2231
|
export declare interface MutationReplayReservation {
|
|
2169
2232
|
/** Re-check immediately before sending: identity, capability and transport may have changed while waiting. */
|
|
2170
2233
|
readonly isValid: () => boolean;
|
|
@@ -2181,13 +2244,16 @@ export declare class MutationSerialExecutionError extends Error {
|
|
|
2181
2244
|
export declare interface MutationState<Input, Output> {
|
|
2182
2245
|
/** Run the mutation. With no options it rejects on failure (unchanged).
|
|
2183
2246
|
* With an error handler (`onError` / `notify.error`) the failure is handled
|
|
2184
|
-
* and the promise resolves with `undefined` instead.
|
|
2247
|
+
* and the promise resolves with `undefined` instead. A retired Subject/view
|
|
2248
|
+
* rejects even with handlers; previously started remote work may have committed. */
|
|
2185
2249
|
readonly mutate: {
|
|
2186
2250
|
(input: Input): Promise<Output>;
|
|
2187
2251
|
(input: Input, options: MutateOptions<Input, Output>): Promise<Output | undefined>;
|
|
2188
2252
|
};
|
|
2189
2253
|
readonly pending: boolean;
|
|
2190
2254
|
readonly error: unknown | undefined;
|
|
2255
|
+
/** Last retained result. One-time outputs remain undefined here; use the
|
|
2256
|
+
* explicit mutate() promise/onSuccess and keep only necessary local state. */
|
|
2191
2257
|
readonly data: Output | undefined;
|
|
2192
2258
|
}
|
|
2193
2259
|
|
|
@@ -2212,6 +2278,14 @@ export declare interface NotificationSurface {
|
|
|
2212
2278
|
}) => Promise<void>;
|
|
2213
2279
|
}
|
|
2214
2280
|
|
|
2281
|
+
/** Retire only framework-owned feed inputs when a policy becomes known.
|
|
2282
|
+
* Application copies and offline journals are separate owners. */
|
|
2283
|
+
export declare const omitMutationInputs: (apiName: string, tag: string) => void;
|
|
2284
|
+
|
|
2285
|
+
/** Forget framework-owned previous outputs when a declaration becomes one-time.
|
|
2286
|
+
* Already explicitly copied application data is outside this feed's ownership. */
|
|
2287
|
+
export declare const omitMutationOutputs: (apiName: string, tag: string) => void;
|
|
2288
|
+
|
|
2215
2289
|
/** A reachability signal: a synchronous read plus change notifications. */
|
|
2216
2290
|
export declare interface OnlineSource {
|
|
2217
2291
|
readonly read: () => boolean;
|
|
@@ -2278,7 +2352,9 @@ export declare const OUTBOX_SYNC_TAG = "voltro:outbox";
|
|
|
2278
2352
|
|
|
2279
2353
|
export declare interface OutboxControls {
|
|
2280
2354
|
readonly queue: Outbox;
|
|
2281
|
-
readonly enqueue: (tag: string, input: unknown
|
|
2355
|
+
readonly enqueue: (tag: string, input: unknown, options?: {
|
|
2356
|
+
readonly stamp?: string;
|
|
2357
|
+
}) => void;
|
|
2282
2358
|
readonly replay: () => Promise<void>;
|
|
2283
2359
|
readonly online: boolean;
|
|
2284
2360
|
readonly pending: number;
|
|
@@ -2286,6 +2362,9 @@ export declare interface OutboxControls {
|
|
|
2286
2362
|
/** Resolve a conflicted entry with a new input (see {@link resolveConflictEntry})
|
|
2287
2363
|
* and replay immediately when online. */
|
|
2288
2364
|
readonly resolveConflict: (id: string, input: unknown) => void;
|
|
2365
|
+
/** Abandon only a known conflict, then resume its successors. Returns false
|
|
2366
|
+
* for pending, failed, sent or absent writes; never confirms an unknown result. */
|
|
2367
|
+
readonly discardConflict: (id: string) => boolean;
|
|
2289
2368
|
}
|
|
2290
2369
|
|
|
2291
2370
|
export declare interface OutboxEntry {
|
|
@@ -2606,6 +2685,8 @@ export declare const publishClientError: (event: ClientErrorEvent) => void;
|
|
|
2606
2685
|
/** Publish a started client trace. Cheap + sync; safe on the hot path. */
|
|
2607
2686
|
export declare const publishClientTrace: (event: ClientTraceEvent) => void;
|
|
2608
2687
|
|
|
2688
|
+
export declare const publishClientTraceRefusal: (event: ClientTraceRefusal) => void;
|
|
2689
|
+
|
|
2609
2690
|
/** What `useSubscription` hands back as `data` for one tag. */
|
|
2610
2691
|
declare type QueryData<P extends ProcedureTypeMap, Tag extends keyof P> = WithOptimistic<ProcedureOutput<P[Tag]>>;
|
|
2611
2692
|
|
|
@@ -2655,6 +2736,13 @@ export declare const queryOnce: (handleRef: {
|
|
|
2655
2736
|
readonly current: ResolvableHandle;
|
|
2656
2737
|
}, apiName: string, tag: string, input: Record<string, unknown> | undefined, signal?: AbortSignal) => Promise<unknown>;
|
|
2657
2738
|
|
|
2739
|
+
/** One snapshot from a registered query, without retaining a subscription. */
|
|
2740
|
+
export declare interface QueryRpcCaller extends RpcCaller {
|
|
2741
|
+
query(tag: string, input?: Record<string, unknown>, options?: {
|
|
2742
|
+
readonly signal?: AbortSignal | undefined;
|
|
2743
|
+
}): Promise<unknown>;
|
|
2744
|
+
}
|
|
2745
|
+
|
|
2658
2746
|
declare type QueryTag<P extends ProcedureTypeMap> = TagsOfKind<P, 'query'>;
|
|
2659
2747
|
|
|
2660
2748
|
export declare type RawTransportStatus = 'connected' | 'disconnected';
|
|
@@ -2713,7 +2801,6 @@ export declare const recoverNativeFormValues: (schema: Schema.Top, formKey: stri
|
|
|
2713
2801
|
* retain the complete sequence.
|
|
2714
2802
|
*/
|
|
2715
2803
|
export declare class RecoveryCoordinator {
|
|
2716
|
-
#private;
|
|
2717
2804
|
constructor(apiName: string, options?: RecoveryOptions, scheduler?: Partial<RecoveryScheduler>);
|
|
2718
2805
|
get options(): ResolvedRecoveryOptions;
|
|
2719
2806
|
/** Ends on login/logout, tenant change or API disposal, not ordinary reconnect. */
|
|
@@ -3298,6 +3385,13 @@ export declare interface RpcCaller {
|
|
|
3298
3385
|
call(tag: string, input: unknown, options?: {
|
|
3299
3386
|
readonly signal?: AbortSignal | undefined;
|
|
3300
3387
|
}): Promise<unknown>;
|
|
3388
|
+
/** Hold a query through the current API's cache. The borrower owns withdrawal. */
|
|
3389
|
+
subscribe?(tag: string, input: unknown, handlers: {
|
|
3390
|
+
readonly onValue: (value: unknown) => void;
|
|
3391
|
+
readonly onError?: (error: unknown) => void;
|
|
3392
|
+
}): {
|
|
3393
|
+
readonly unsubscribe: () => void;
|
|
3394
|
+
};
|
|
3301
3395
|
}
|
|
3302
3396
|
|
|
3303
3397
|
/** What the client can prove about a unary call's server-side result. */
|
|
@@ -3332,7 +3426,6 @@ export declare interface RpcError {
|
|
|
3332
3426
|
}
|
|
3333
3427
|
|
|
3334
3428
|
export declare class RpcErrorBus {
|
|
3335
|
-
#private;
|
|
3336
3429
|
/** Subscribe. Returns an unsubscribe function. */
|
|
3337
3430
|
on(listener: RpcErrorListener): () => void;
|
|
3338
3431
|
/** Emit. Pipeline code (useMutation / subscriptionCache) calls this. */
|
|
@@ -3587,22 +3680,6 @@ export declare const setStoreSeedResolver: (resolver: (() => StoreSeedBag | null
|
|
|
3587
3680
|
*/
|
|
3588
3681
|
export declare const setStoreStorage: (provider: StoreStorageProvider | null) => void;
|
|
3589
3682
|
|
|
3590
|
-
/**
|
|
3591
|
-
* Transition a pending mutation to 'success' or 'error'. Updates the
|
|
3592
|
-
* existing entry in-place (preserves order in the buffer) so the
|
|
3593
|
-
* panel doesn't shuffle while the user is reading it.
|
|
3594
|
-
*
|
|
3595
|
-
* No-op if no pending entry matches `id` (e.g. the start event was
|
|
3596
|
-
* dropped from the ring after a long session).
|
|
3597
|
-
*/
|
|
3598
|
-
export declare const settleMutation: (id: string, outcome: {
|
|
3599
|
-
readonly status: "success";
|
|
3600
|
-
readonly output: unknown;
|
|
3601
|
-
} | {
|
|
3602
|
-
readonly status: "error";
|
|
3603
|
-
readonly error: unknown;
|
|
3604
|
-
}) => void;
|
|
3605
|
-
|
|
3606
3683
|
/**
|
|
3607
3684
|
* Shallow equality over own enumerable entries — the comparator a selector that
|
|
3608
3685
|
* BUILDS something needs.
|
|
@@ -3653,15 +3730,12 @@ export declare const stableKey: (key: ReadonlyArray<unknown>) => string;
|
|
|
3653
3730
|
*/
|
|
3654
3731
|
export declare const startApiSupervisor: (options: SupervisorOptions) => SupervisorHandle;
|
|
3655
3732
|
|
|
3656
|
-
/**
|
|
3657
|
-
*
|
|
3658
|
-
*
|
|
3659
|
-
*
|
|
3660
|
-
*
|
|
3661
|
-
|
|
3662
|
-
* make room.
|
|
3663
|
-
*/
|
|
3664
|
-
export declare const startMutation: (args: Pick<MutationEvent, "id" | "apiName" | "tag" | "input" | "kind">) => void;
|
|
3733
|
+
/** Start a diagnostic invocation owned by its original API Subject. The
|
|
3734
|
+
* caller supplies the actual Subject lifetime, never a request/cancel signal.
|
|
3735
|
+
* Pending and settled rows retire together when that Subject ends. The returned
|
|
3736
|
+
* handle settles only this invocation once; a retired start publishes nothing.
|
|
3737
|
+
* Up to 100 rows are retained, newest first. */
|
|
3738
|
+
export declare const startMutation: (args: Pick<MutationEvent, "id" | "apiName" | "tag" | "input" | "kind" | "outputOmitted" | "inputOmitted">, subject: AbortSignal) => MutationInvocation;
|
|
3665
3739
|
|
|
3666
3740
|
declare interface Step {
|
|
3667
3741
|
readonly name: string;
|
|
@@ -3889,6 +3963,9 @@ export declare const subscribeClientDiagnostics: (listener: () => void) => (() =
|
|
|
3889
3963
|
/** Subscribe to client errors. Returns an unsubscribe fn. */
|
|
3890
3964
|
export declare const subscribeClientErrors: (listener: ClientErrorListener) => (() => void);
|
|
3891
3965
|
|
|
3966
|
+
/** Subscribe to declared refusals of traced calls. Returns an unsubscribe fn. */
|
|
3967
|
+
export declare const subscribeClientTraceRefusals: (listener: ClientTraceRefusalListener) => () => void;
|
|
3968
|
+
|
|
3892
3969
|
/** Subscribe to started client traces. Returns an unsubscribe fn. */
|
|
3893
3970
|
export declare const subscribeClientTraces: (listener: ClientTraceListener) => () => void;
|
|
3894
3971
|
|
|
@@ -3898,36 +3975,7 @@ export declare const subscribeMutations: (cb: () => void) => (() => void);
|
|
|
3898
3975
|
export declare const subscribeStoreHistory: (listener: Listener) => (() => void);
|
|
3899
3976
|
|
|
3900
3977
|
export declare class SubscriptionCache {
|
|
3901
|
-
private readonly entries;
|
|
3902
|
-
private readonly entriesByTable;
|
|
3903
|
-
private readonly entriesByTag;
|
|
3904
|
-
private readonly entriesByMutation;
|
|
3905
|
-
private readonly patchMemberships;
|
|
3906
|
-
private readonly entryOrder;
|
|
3907
|
-
private orderedMemberships;
|
|
3908
|
-
private nextEntryOrder;
|
|
3909
|
-
/** Standing optimistic intents, by mutation id — see `autoApply`. */
|
|
3910
|
-
private readonly intents;
|
|
3911
|
-
private readonly tableRows;
|
|
3912
|
-
private readonly anyListeners;
|
|
3913
|
-
private readonly tableListeners;
|
|
3914
|
-
private readonly refreshing;
|
|
3915
|
-
/**
|
|
3916
|
-
* Same-subject runtime replacement. A mutation may settle against the cache
|
|
3917
|
-
* it started on after React has already switched to the replacement cache.
|
|
3918
|
-
* Keep this link one-way so staging and settlement follow the visible data
|
|
3919
|
-
* without retaining an old cache from the new runtime.
|
|
3920
|
-
*/
|
|
3921
|
-
private successor;
|
|
3922
|
-
private readonly inactiveTtlMs;
|
|
3923
|
-
private readonly onChangeHook;
|
|
3924
|
-
private readonly errorBus;
|
|
3925
|
-
private readonly mirror;
|
|
3926
|
-
private readonly mergeCell;
|
|
3927
|
-
private readonly apiName;
|
|
3928
|
-
private readonly recoveryStuckMs;
|
|
3929
3978
|
constructor(options?: SubscriptionCacheOptions);
|
|
3930
|
-
private diagnose;
|
|
3931
3979
|
/**
|
|
3932
3980
|
* Register a subscriber. The cache forks the underlying fiber on the
|
|
3933
3981
|
* first subscriber and re-uses it for the rest. Returns the snapshot
|
|
@@ -3991,31 +4039,6 @@ export declare class SubscriptionCache {
|
|
|
3991
4039
|
* resolve briefly exposes a stale base before the server delta lands.
|
|
3992
4040
|
*/
|
|
3993
4041
|
confirmByMutation(mutationId: string): void;
|
|
3994
|
-
/**
|
|
3995
|
-
* The confirmed-patch window expired: a committed write never got its
|
|
3996
|
-
* superseding server event. Re-issue the affected subscriptions instead of
|
|
3997
|
-
* discarding the write's preview.
|
|
3998
|
-
*
|
|
3999
|
-
* Three things are load-bearing, and each was a way to reintroduce the bug:
|
|
4000
|
-
*
|
|
4001
|
-
* - **The patch is KEPT across the resync.** `refreshAll` already
|
|
4002
|
-
* establishes that shape ("the new base snapshot will land on top of
|
|
4003
|
-
* them"). Clearing it here would be the revert again, wearing a longer
|
|
4004
|
-
* word.
|
|
4005
|
-
* - **A stub entry — no `fetch`, no `runtime` — is left ALONE.** There is
|
|
4006
|
-
* nothing to re-issue, and the only other option is to show a base the
|
|
4007
|
-
* client knows is stale. Keeping the patch is the honest state.
|
|
4008
|
-
* - **It is LOUD.** The reporter found the jump only by reading minified
|
|
4009
|
-
* source, because in the UI it is indistinguishable from "the server did
|
|
4010
|
-
* not save it" — and that is the false trail they followed first. This
|
|
4011
|
-
* goes to the error bus, so it reaches `voltro logs` rather than only a
|
|
4012
|
-
* console nobody has open.
|
|
4013
|
-
*
|
|
4014
|
-
* No second timer is armed: this runs once per mutation, from the one
|
|
4015
|
-
* `confirmByMutation` scheduled it, so a server that never echoes cannot put
|
|
4016
|
-
* the client into a resync loop.
|
|
4017
|
-
*/
|
|
4018
|
-
private resyncUnechoedMutation;
|
|
4019
4042
|
/**
|
|
4020
4043
|
* Auto-derive optimistic patches from a mutation's declared target(s).
|
|
4021
4044
|
* Iterates every cache entry whose `source` table matches a target's
|
|
@@ -4039,10 +4062,6 @@ export declare class SubscriptionCache {
|
|
|
4039
4062
|
* {@link SubscriptionCache.autoApply}). Carried to a same-subject
|
|
4040
4063
|
* replacement cache, so a stager can tell "already staged" from "new". */
|
|
4041
4064
|
hasIntent(mutationId: string): boolean;
|
|
4042
|
-
private applyIntent;
|
|
4043
|
-
private applyStandingIntents;
|
|
4044
|
-
/** Drop a specific patch by id. */
|
|
4045
|
-
private revertPatch;
|
|
4046
4065
|
/**
|
|
4047
4066
|
* Read the current snapshot for a key WITHOUT subscribing. If the
|
|
4048
4067
|
* entry doesn't exist, returns the "empty" snapshot (data=undefined,
|
|
@@ -4089,40 +4108,6 @@ export declare class SubscriptionCache {
|
|
|
4089
4108
|
* patches. Coalesce refreshes until that request answers or fails; never
|
|
4090
4109
|
* interrupt an initial read merely because another refresh was requested. */
|
|
4091
4110
|
refresh(key: ReadonlyArray<unknown>): boolean;
|
|
4092
|
-
/* Excluded from this release type: resumeTransportFailures */
|
|
4093
|
-
/**
|
|
4094
|
-
* The stall watchdog for one re-issued entry: `recoveryStuckMs` after the
|
|
4095
|
-
* re-issue with neither snapshot nor delta, the entry is reported stuck and
|
|
4096
|
-
* its subscribers are notified.
|
|
4097
|
-
*
|
|
4098
|
-
* That is a finding only if the watchdog itself ran on time. A browser
|
|
4099
|
-
* throttles timers in a hidden tab — to a one-second grid, then a one-minute
|
|
4100
|
-
* grid — so a timer there fires whenever the tab next wakes, and it used to
|
|
4101
|
-
* report the interval it was ARMED with as the interval waited. A delivery
|
|
4102
|
-
* queued behind the same throttling then arrived a moment after the warning
|
|
4103
|
-
* and the invalidation, under the same attempt: the watchdog had measured
|
|
4104
|
-
* its own delay and called it a stall.
|
|
4105
|
-
*
|
|
4106
|
-
* So the watchdog compares its due time with its fire time. Late beyond the
|
|
4107
|
-
* tolerance, or firing in a hidden tab, it does not judge: it records ONE
|
|
4108
|
-
* `recovery-timer-late` for the attempt (with how late, and whether hidden)
|
|
4109
|
-
* and re-arms. The first on-time fire in a visible tab decides — which gives
|
|
4110
|
-
* a delivery `recoveryStuckMs` of unthrottled time once the tab is looked at
|
|
4111
|
-
* again, and reports a real stall within that.
|
|
4112
|
-
*/
|
|
4113
|
-
private armRecoveryWatchdog;
|
|
4114
|
-
/**
|
|
4115
|
-
* Re-issue ONE entry's subscription: interrupt the fiber, reset the base,
|
|
4116
|
-
* re-fork through the saved `fetch`.
|
|
4117
|
-
*
|
|
4118
|
-
* Extracted so `refreshAll` and the confirmed-patch resync cannot disagree
|
|
4119
|
-
* about it — and the thing they must agree on is that **optimistic patches
|
|
4120
|
-
* survive**. For a re-auth they belong to in-flight mutations; for the resync
|
|
4121
|
-
* they describe a write the server has already committed. Dropping them here
|
|
4122
|
-
* would be a revert with a longer name, which is the defect the resync exists
|
|
4123
|
-
* to remove.
|
|
4124
|
-
*/
|
|
4125
|
-
private reissue;
|
|
4126
4111
|
/**
|
|
4127
4112
|
* Seed this (fresh) cache with the last-known-good rows held by the cache it
|
|
4128
4113
|
* REPLACES, so a transport rebuild degrades to STALE DATA rather than to
|
|
@@ -4162,21 +4147,6 @@ export declare class SubscriptionCache {
|
|
|
4162
4147
|
* Returns the number of entries seeded (diagnostics / tests).
|
|
4163
4148
|
*/
|
|
4164
4149
|
seedStaleFrom(previous: SubscriptionCache): number;
|
|
4165
|
-
private create;
|
|
4166
|
-
private createStub;
|
|
4167
|
-
private freshState;
|
|
4168
|
-
private startFiber;
|
|
4169
|
-
private sourceTables;
|
|
4170
|
-
private addIndex;
|
|
4171
|
-
private removeIndex;
|
|
4172
|
-
private orderedEntries;
|
|
4173
|
-
private indexSource;
|
|
4174
|
-
private appendPatch;
|
|
4175
|
-
private replacePatches;
|
|
4176
|
-
private indexPatches;
|
|
4177
|
-
private registerEntry;
|
|
4178
|
-
private unindexEntry;
|
|
4179
|
-
private invalidate;
|
|
4180
4150
|
/**
|
|
4181
4151
|
* Every row of `table` this cache holds — the client's local replica of the
|
|
4182
4152
|
* table: the union of the rows of every entry sourced on that table ALONE
|
|
@@ -4190,12 +4160,6 @@ export declare class SubscriptionCache {
|
|
|
4190
4160
|
subscribeTable(table: string, listener: () => void): () => void;
|
|
4191
4161
|
/** Call `listener` after any entry changed. Returns the unsubscribe. */
|
|
4192
4162
|
subscribeAny(listener: () => void): () => void;
|
|
4193
|
-
private getSnapshot;
|
|
4194
|
-
private unsubscribe;
|
|
4195
|
-
/** Start (or restart) the inactive-TTL countdown for `entry`: unless
|
|
4196
|
-
* something subscribes first, interrupt its fiber and drop it. Shared by
|
|
4197
|
-
* the last-subscriber-out path and by `seedStaleFrom`'s unclaimed seeds. */
|
|
4198
|
-
private scheduleEviction;
|
|
4199
4163
|
}
|
|
4200
4164
|
|
|
4201
4165
|
export declare interface SubscriptionCacheOptions {
|
|
@@ -4660,10 +4624,11 @@ export declare interface TranscriptionState {
|
|
|
4660
4624
|
readonly progress: number | undefined;
|
|
4661
4625
|
readonly result: TranscriptionView | undefined;
|
|
4662
4626
|
readonly error: unknown | undefined;
|
|
4663
|
-
/** Upload the file, then transcribe it.
|
|
4627
|
+
/** Upload the file, then transcribe it. One current intent per hook;
|
|
4628
|
+
* another call rejects before work until completion, cancel or reset. */
|
|
4664
4629
|
readonly transcribe: (file: File | Blob) => Promise<TranscriptionView>;
|
|
4665
|
-
/**
|
|
4666
|
-
*
|
|
4630
|
+
/** Withdraw the local intent and clear the view to idle. A transcription
|
|
4631
|
+
* already handed to the server may still complete. */
|
|
4667
4632
|
readonly cancel: () => void;
|
|
4668
4633
|
readonly reset: () => void;
|
|
4669
4634
|
}
|
|
@@ -4782,13 +4747,13 @@ export declare interface UploadHandle {
|
|
|
4782
4747
|
readonly upload: (file: File | Blob, opts?: UploadOptions) => Promise<UploadResult>;
|
|
4783
4748
|
/** Upload many with bounded concurrency; resolves in input order. */
|
|
4784
4749
|
readonly uploadMany: (files: ReadonlyArray<File | Blob>, opts?: UploadOptions) => Promise<ReadonlyArray<UploadResult>>;
|
|
4785
|
-
/** Aggregate progress across
|
|
4750
|
+
/** Aggregate file progress across overlapping current batches, 0..1. */
|
|
4786
4751
|
readonly progress: number;
|
|
4787
4752
|
readonly status: UploadStatus;
|
|
4788
4753
|
readonly error: unknown | undefined;
|
|
4789
4754
|
/** Abort every in-flight upload (rejects their promises with AbortError). */
|
|
4790
4755
|
readonly cancel: () => void;
|
|
4791
|
-
/**
|
|
4756
|
+
/** Withdraw local uploads and clear status/error/progress back to idle. */
|
|
4792
4757
|
readonly reset: () => void;
|
|
4793
4758
|
/** Drop-handler: extracts files from a drag event + uploads them. Spread
|
|
4794
4759
|
* `dropzoneProps` onto a container, or call this directly. */
|
|
@@ -4847,9 +4812,9 @@ export declare interface UploadOptions {
|
|
|
4847
4812
|
/** Chunk/part size (bytes) for `prefer:'resumable'`/`'multipart'`. Server
|
|
4848
4813
|
* default (5 MiB) if omitted; multipart clamps to the S3 5 MiB minimum. */
|
|
4849
4814
|
readonly chunkSize?: number;
|
|
4850
|
-
/**
|
|
4815
|
+
/** Finite safe integer >= 1; max parallel uploads per `uploadMany`. Default 3. */
|
|
4851
4816
|
readonly concurrency?: number;
|
|
4852
|
-
/**
|
|
4817
|
+
/** Finite safe integer >= 0; retry attempts per file. Default 1. */
|
|
4853
4818
|
readonly retries?: number;
|
|
4854
4819
|
}
|
|
4855
4820
|
|
|
@@ -5323,8 +5288,14 @@ export declare interface UseResourceCanState {
|
|
|
5323
5288
|
|
|
5324
5289
|
export declare const useResumableAgentStream: <E = unknown>(apiName: string, rpcTag: string, options?: ResumableAgentStreamOptions<E>) => ResumableAgentStreamControls<E>;
|
|
5325
5290
|
|
|
5326
|
-
/** A stable
|
|
5327
|
-
|
|
5291
|
+
/** A stable caller and one-snapshot query reader for one API Subject. Its borrower
|
|
5292
|
+
* may use it for same-Subject cleanup after view unmount or API selection changes;
|
|
5293
|
+
* identity changes retire it. */
|
|
5294
|
+
export declare const useRpcCaller: (apiName: string) => QueryRpcCaller;
|
|
5295
|
+
|
|
5296
|
+
/** `true` when `rpcTag` is in the client group of `apiName`, `false` when it is not, and
|
|
5297
|
+
* `undefined` while the api has not resolved its client group yet. */
|
|
5298
|
+
export declare const useRpcDeclared: (apiName: string, rpcTag: string) => boolean | undefined;
|
|
5328
5299
|
|
|
5329
5300
|
/** A schema-owned form for actions, parent plans, and local saves. It uses the
|
|
5330
5301
|
* same validation/field engine without connecting to an API or inventing a tag. */
|
|
@@ -5431,7 +5402,8 @@ export declare interface UseTranscriptionOptions {
|
|
|
5431
5402
|
* model runs. Its input is `{ storageRef }` plus whatever `extra` is passed.
|
|
5432
5403
|
*/
|
|
5433
5404
|
readonly action: string;
|
|
5434
|
-
/** Extra input
|
|
5405
|
+
/** Extra input captured before upload — a language hint, a thread id.
|
|
5406
|
+
* `storageRef` is reserved for the uploaded file. Keep nested schema values immutable. */
|
|
5435
5407
|
readonly extra?: Readonly<Record<string, unknown>>;
|
|
5436
5408
|
}
|
|
5437
5409
|
|
|
@@ -5554,6 +5526,20 @@ export declare const validationStatus: (args: {
|
|
|
5554
5526
|
readonly skipEmpty?: boolean;
|
|
5555
5527
|
}) => AsyncValidationResult;
|
|
5556
5528
|
|
|
5529
|
+
export { WebhookEventActivity }
|
|
5530
|
+
|
|
5531
|
+
export { WebhookInspectActivityStatus }
|
|
5532
|
+
|
|
5533
|
+
export { WebhookInspectListInput }
|
|
5534
|
+
|
|
5535
|
+
export { WebhookInspectListRequest }
|
|
5536
|
+
|
|
5537
|
+
export { webhookInspectListRequest }
|
|
5538
|
+
|
|
5539
|
+
export { WebhookInspectPage }
|
|
5540
|
+
|
|
5541
|
+
export { WebhookInspectPagination }
|
|
5542
|
+
|
|
5557
5543
|
export { WebSocketConstructorOptions }
|
|
5558
5544
|
|
|
5559
5545
|
/** The default widget kinds the framework can render from a schema. `'custom'`
|