@voltro/client 0.85.0 → 0.87.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 +5987 -0
- package/THIRD-PARTY-NOTICES.md +1125 -34
- package/dist/analyticsCatalog.js +47 -0
- package/dist/apiConnectivity.js +33 -0
- package/dist/apiRoleTransports.js +48 -0
- package/dist/apiRuntime.js +145 -0
- package/dist/apiSocketTracker.js +21 -0
- package/dist/apiSupervisor.js +136 -0
- package/dist/authRefresh.js +20 -0
- package/dist/awaitResolvedApi.js +23 -0
- package/dist/bootstrap.d.ts +1153 -0
- package/dist/bootstrap.js +8 -0
- package/dist/cellMerger.js +6 -0
- package/dist/clientDiagnostics.js +94 -0
- package/dist/clientErrorBus.js +16 -0
- package/dist/clientScheduler.js +31 -0
- package/dist/connectionPrerequisite.js +70 -0
- package/dist/connectionScope.js +47 -0
- package/dist/connectionSetupController.js +206 -0
- package/dist/createHooks.js +15 -0
- package/dist/deepLink.js +69 -0
- package/dist/filters.js +58 -0
- package/dist/form.d.ts +37 -4
- package/dist/form.js +7 -2
- package/dist/formBinding.js +325 -0
- package/dist/formData.js +127 -0
- package/dist/formFlashId.js +4 -0
- package/dist/formRejection.js +23 -0
- package/dist/formSource.js +13 -0
- package/dist/frameworkRuntimesContext.js +8 -0
- package/dist/globalContext.js +10 -0
- package/dist/index.d.ts +152 -27
- package/dist/index.js +87 -4121
- package/dist/liveRowSort.js +66 -0
- package/dist/mutationConnectionSetup.js +16 -0
- package/dist/mutationIdentity.js +10 -0
- package/dist/mutationSerialExecution.js +53 -0
- package/dist/mutationsBus.js +40 -0
- package/dist/onlineSource.js +13 -0
- package/dist/outbox.js +213 -0
- package/dist/outboxHttp.js +104 -0
- package/dist/outboxState.js +43 -0
- package/dist/permissions.js +20 -0
- package/dist/platform.js +121 -0
- package/dist/preloadSeed.js +47 -0
- package/dist/provider.js +22 -0
- package/dist/query.js +12 -2
- package/dist/recoveryCoordinator.js +195 -0
- package/dist/recoveryRetry.js +24 -0
- package/dist/richText.js +176 -0
- package/dist/rpcErrorBus.js +39 -0
- package/dist/rpcErrorKind.js +13 -0
- package/dist/runRpc.js +12 -0
- package/dist/runtime.d.ts +49 -3
- package/dist/runtime.js +16 -126
- package/dist/runtimeCapabilities.js +44 -0
- package/dist/runtimeContext.js +49 -0
- package/dist/schemaFields.js +219 -0
- package/dist/scopeMembership.js +12 -0
- package/dist/seedResolvers.js +7 -0
- package/dist/sequence.js +65 -0
- package/dist/serverRequest.js +28 -0
- package/dist/serviceClient.js +129 -0
- package/dist/squashRpcCause.js +8 -0
- package/dist/stableKey.js +21 -0
- package/dist/store.js +288 -0
- package/dist/storeStorage.js +28 -0
- package/dist/subscriptionCache.js +724 -0
- package/dist/tagWalk.js +23 -0
- package/dist/traceBus.js +10 -0
- package/dist/tracking.js +40 -0
- package/dist/uploadProgress.js +21 -0
- package/dist/useAction.js +101 -0
- package/dist/useAgent.js +53 -0
- package/dist/useAgentChat.js +43 -0
- package/dist/useAgentStream.js +64 -0
- package/dist/useApiOnline.js +14 -0
- package/dist/useCapabilityManifest.js +105 -0
- package/dist/useConnectionSetup.js +28 -0
- package/dist/useConnectionStatus.js +38 -0
- package/dist/useConnections.js +107 -0
- package/dist/useDataCopilot.js +24 -0
- package/dist/useDataTable.js +34 -0
- package/dist/useDerived.js +22 -0
- package/dist/useEvent.js +98 -0
- package/dist/useFormBinding.js +478 -0
- package/dist/useLocalQuery.js +59 -0
- package/dist/useMutation.js +214 -0
- package/dist/useOnRpcError.js +13 -0
- package/dist/usePreloadedSubscription.js +18 -0
- package/dist/usePreview.js +14 -0
- package/dist/useProvenance.js +51 -0
- package/dist/useQueryField.js +34 -0
- package/dist/useRecord.js +12 -0
- package/dist/useRefreshSubscriptions.js +22 -0
- package/dist/useResourceCan.js +18 -0
- package/dist/useResumableAgentStream.js +75 -0
- package/dist/useRpcCaller.js +17 -0
- package/dist/useSequence.js +25 -0
- package/dist/useSkeleton.js +13 -0
- package/dist/useSubscription.js +98 -0
- package/dist/useSubscriptionHealth.js +32 -0
- package/dist/useTranscription.js +51 -0
- package/dist/useUndo.js +33 -0
- package/dist/useUndoLog.js +44 -0
- package/dist/useUpload.js +296 -0
- package/dist/useWindowedSubscription.js +65 -0
- package/dist/useWorkflow.js +284 -0
- package/dist/useWorkflowRunState.js +93 -0
- package/dist/validation.js +39 -0
- package/dist/validationMessages.js +5 -0
- package/package.json +7 -2
- package/dist/authRefresh-DmfSoCca.js +0 -360
- package/dist/formData-BfpBt7BQ.js +0 -769
- package/dist/queryOnce-D5Y4V1SB.js +0 -55
- package/dist/runRpc-Zfz3w709.js +0 -1172
package/dist/index.d.ts
CHANGED
|
@@ -4,12 +4,18 @@ 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 { DEV_ACTIVITY_EVENT } from '@voltro/protocol';
|
|
8
|
+
import { DevActivityMessage } from '@voltro/protocol';
|
|
7
9
|
import { DragEvent as DragEvent_2 } from 'react';
|
|
8
10
|
import { Effect } from 'effect';
|
|
11
|
+
import { encodeNativeFormCapture } from '@voltro/protocol';
|
|
9
12
|
import { errorMessage } from '@voltro/protocol';
|
|
10
13
|
import { errorTag } from '@voltro/protocol';
|
|
11
14
|
import { EventDescriptor as EventDescriptor_2 } from '@voltro/protocol';
|
|
12
15
|
import { Fiber } from 'effect';
|
|
16
|
+
import { FORM_CAPTURE_FIELD } from '@voltro/protocol';
|
|
17
|
+
import { FORM_CAPTURE_META_NAME } from '@voltro/protocol';
|
|
18
|
+
import { formCaptureSource } from '@voltro/protocol';
|
|
13
19
|
import { JsonSchemaDocument } from '@voltro/protocol';
|
|
14
20
|
import { jsonSchemaDocumentOf } from '@voltro/protocol';
|
|
15
21
|
import { jsonSchemaOf } from '@voltro/protocol';
|
|
@@ -24,6 +30,7 @@ import { PairingStorage } from '@voltro/protocol';
|
|
|
24
30
|
import { parsePairingLink } from '@voltro/protocol';
|
|
25
31
|
import { ReactElement } from 'react';
|
|
26
32
|
import { ReactNode } from 'react';
|
|
33
|
+
import { readFormCaptureSource } from '@voltro/protocol';
|
|
27
34
|
import { readPairing } from '@voltro/protocol';
|
|
28
35
|
import { Rpc } from 'effect/rpc';
|
|
29
36
|
import { RpcClient } from 'effect/rpc';
|
|
@@ -231,6 +238,8 @@ export declare interface ApiHandle {
|
|
|
231
238
|
readonly errorBus: RpcErrorBus;
|
|
232
239
|
/** Stable UI/raw transport recovery state for this logical api. */
|
|
233
240
|
readonly recovery?: RecoveryCoordinator;
|
|
241
|
+
/** Identity lifetime captured when this transport was built. */
|
|
242
|
+
readonly subjectSignal?: AbortSignal;
|
|
234
243
|
}
|
|
235
244
|
|
|
236
245
|
/**
|
|
@@ -285,6 +294,8 @@ export declare interface ApiHooks<P extends ProcedureTypeMap> {
|
|
|
285
294
|
readonly useAction: <Tag extends ActionTag<P>>(tag: Tag) => ActionState<ProcedureInput<P[Tag]>, ProcedureOutput<P[Tag]>>;
|
|
286
295
|
}
|
|
287
296
|
|
|
297
|
+
export declare type ApiSocketIssue = 'close' | 'error' | 'connect-timeout';
|
|
298
|
+
|
|
288
299
|
export { applyPairing }
|
|
289
300
|
|
|
290
301
|
/**
|
|
@@ -417,6 +428,8 @@ export declare interface BuildApiRuntimeOptions {
|
|
|
417
428
|
readonly generation?: number;
|
|
418
429
|
/** WebSocket URL of the api (`ws(s)://host:port/ws`). */
|
|
419
430
|
readonly wsUrl: string;
|
|
431
|
+
/** Captured deployment role endpoint manifest; partition this group's transports by tag/workload. */
|
|
432
|
+
readonly roleEndpoints?: unknown;
|
|
420
433
|
/**
|
|
421
434
|
* The api's rpc group, as the ERASED `RpcGroup.Any`.
|
|
422
435
|
*
|
|
@@ -475,6 +488,8 @@ export declare interface BuiltApiRuntime {
|
|
|
475
488
|
readonly client: RpcClient.RpcClient<Rpc.Any, RpcClientError.RpcClientError>;
|
|
476
489
|
readonly errorBus: RpcErrorBus;
|
|
477
490
|
readonly recovery: RecoveryCoordinator;
|
|
491
|
+
/** Identity lifetime captured when this transport was built. */
|
|
492
|
+
readonly subjectSignal?: AbortSignal;
|
|
478
493
|
}
|
|
479
494
|
|
|
480
495
|
declare interface CacheEntry {
|
|
@@ -1012,7 +1027,8 @@ export declare interface DataTableState<Row> {
|
|
|
1012
1027
|
* Decide, from the DECLARED access and the subject's global scopes, whether the
|
|
1013
1028
|
* caller may invoke a procedure. Pure — the matcher core, mirroring the
|
|
1014
1029
|
* server's `checkGuards`: entries are ANDed, `mode` controls AND/OR within one
|
|
1015
|
-
* entry
|
|
1030
|
+
* entry. `admin:full` satisfies scope and relationship checks, but cannot
|
|
1031
|
+
* establish registered-account identity from scopes alone.
|
|
1016
1032
|
*
|
|
1017
1033
|
* `guards === undefined` (neither `guards:` nor `openAccess:`) is `unknown`,
|
|
1018
1034
|
* not `allowed`: an undeclared procedure is refused outright under
|
|
@@ -1145,6 +1161,10 @@ export declare const defineTracking: <P = Record<string, unknown>>(name: string,
|
|
|
1145
1161
|
*/
|
|
1146
1162
|
export declare const deriveEntityAdmins: (manifest: CapabilityManifest) => ReadonlyArray<EntityAdminSpec>;
|
|
1147
1163
|
|
|
1164
|
+
export { DEV_ACTIVITY_EVENT }
|
|
1165
|
+
|
|
1166
|
+
export { DevActivityMessage }
|
|
1167
|
+
|
|
1148
1168
|
export declare const disableClientDiagnosticsPersistence: () => void;
|
|
1149
1169
|
|
|
1150
1170
|
/**
|
|
@@ -1214,6 +1234,13 @@ export declare const emptyRichTextDocument: RichTextDocument;
|
|
|
1214
1234
|
*/
|
|
1215
1235
|
export declare const enableClientDiagnosticsPersistence: (storage: ClientDiagnosticsStorage) => void;
|
|
1216
1236
|
|
|
1237
|
+
/** Encode only a declared public tagged error. Run in the schema's own module graph,
|
|
1238
|
+
* including a production SSR bundle. Defects, invalid values, service-dependent
|
|
1239
|
+
* codecs and oversized errors contribute no structured form state. */
|
|
1240
|
+
export declare const encodeFormRejection: (schema: Schema.Top | undefined, error: unknown) => unknown;
|
|
1241
|
+
|
|
1242
|
+
export { encodeNativeFormCapture }
|
|
1243
|
+
|
|
1217
1244
|
export declare const enqueueEntry: (queue: Outbox, id: string, tag: string, input: unknown, stamp?: string) => Outbox;
|
|
1218
1245
|
|
|
1219
1246
|
/**
|
|
@@ -1446,20 +1473,23 @@ export declare type FilterKind = 'text' | 'select' | 'multi-select' | 'number-ra
|
|
|
1446
1473
|
* input field → one FilterDescriptor. Pure. */
|
|
1447
1474
|
export declare const filtersFromSchema: (schema: Schema.Top) => ReadonlyArray<FilterDescriptor>;
|
|
1448
1475
|
|
|
1476
|
+
export { FORM_CAPTURE_FIELD }
|
|
1477
|
+
|
|
1478
|
+
export { FORM_CAPTURE_META_NAME }
|
|
1479
|
+
|
|
1449
1480
|
/** DOM id of the JSON script the 422 re-render embeds (survives the
|
|
1450
1481
|
* `interactive:'none'` strip — it is neither `type="module"` nor `src`). */
|
|
1451
1482
|
export declare const FORM_FLASH_SCRIPT_ID = "__voltro_form_flash__";
|
|
1452
1483
|
|
|
1453
|
-
/** Hidden field carrying the form's instance key (multi-form pages). */
|
|
1454
1484
|
export declare const FORM_KEY_FIELD = "__voltro_form";
|
|
1455
1485
|
|
|
1456
|
-
/** URL prefix the web listener mounts the no-JS endpoint under. */
|
|
1457
1486
|
export declare const FORM_PATH_PREFIX = "/form/";
|
|
1458
1487
|
|
|
1459
|
-
/** Hidden field carrying the declared success-redirect path. */
|
|
1460
1488
|
export declare const FORM_REDIRECT_FIELD = "__voltro_redirect";
|
|
1461
1489
|
|
|
1462
|
-
/** The
|
|
1490
|
+
/** The original page, distinct from an optional success redirect. */
|
|
1491
|
+
export declare const FORM_SOURCE_FIELD = "__voltro_source";
|
|
1492
|
+
|
|
1463
1493
|
export declare const formActionPath: (mutationTag: string) => string;
|
|
1464
1494
|
|
|
1465
1495
|
/** A field ARRAY (`entries[]`): items + structural operations + per-item
|
|
@@ -1539,6 +1569,8 @@ export declare const FormBindingProvider: <Input extends Record<string, unknown>
|
|
|
1539
1569
|
readonly children?: ReactNode;
|
|
1540
1570
|
}) => ReactElement;
|
|
1541
1571
|
|
|
1572
|
+
export { formCaptureSource }
|
|
1573
|
+
|
|
1542
1574
|
/**
|
|
1543
1575
|
* Convert posted form entries into the input object the mutation's schema
|
|
1544
1576
|
* decodes — the shape `validateFields` (and the RPC payload) expects.
|
|
@@ -1630,6 +1662,11 @@ export declare interface FormFlashPayload {
|
|
|
1630
1662
|
readonly errors: Readonly<Record<string, string>>;
|
|
1631
1663
|
/** A non-field error (the RPC refused after valid input: guard, server). */
|
|
1632
1664
|
readonly formError?: string;
|
|
1665
|
+
/** JSON encoded through the procedure's declared error schema. Private to
|
|
1666
|
+
* this failed submit; never a publication or permission proof. */
|
|
1667
|
+
readonly rejection?: unknown;
|
|
1668
|
+
/** Admitted original page for repeated native errors and late hydration. */
|
|
1669
|
+
readonly sourcePath?: string;
|
|
1633
1670
|
}
|
|
1634
1671
|
|
|
1635
1672
|
/** A mutation's input as the form binding's value shape. A struct input is its
|
|
@@ -1645,6 +1682,9 @@ declare type FormInput<P extends ProcedureTypeMap, Tag extends keyof P> = Proced
|
|
|
1645
1682
|
*/
|
|
1646
1683
|
export declare const formSections: (fields: ReadonlyArray<FieldDescriptor>) => ReadonlyArray<FieldSection>;
|
|
1647
1684
|
|
|
1685
|
+
/** Admit a local source page; native form endpoints cannot be their own source. */
|
|
1686
|
+
export declare const formSourcePath: (raw: unknown) => string | undefined;
|
|
1687
|
+
|
|
1648
1688
|
/** The full form state, engine + mutation, in ONE place — a save button reads
|
|
1649
1689
|
* `canSubmit`/`pending`, a dialog closes on `isSubmitSuccessful`, a banner
|
|
1650
1690
|
* listens to `submitError`. */
|
|
@@ -1707,11 +1747,27 @@ export declare interface FrameworkRuntimes {
|
|
|
1707
1747
|
* keeps working; absent means "already connected", which is the safe reading.
|
|
1708
1748
|
*/
|
|
1709
1749
|
readonly demand?: (apiName: string) => void;
|
|
1750
|
+
/**
|
|
1751
|
+
* One read through an api's client — the browser half of a loader's
|
|
1752
|
+
* `ctx.query`. Supplied by the host that builds the rpc runtime
|
|
1753
|
+
* (`VoltroRuntimeProvider`), not by this context: the read reaches the rpc
|
|
1754
|
+
* client and with it the Effect runtime, and an app that mounts no api must
|
|
1755
|
+
* not load either just because its router can ask. Absent → `ctx.query` is
|
|
1756
|
+
* `undefined` in the browser, as it is for an app without apis.
|
|
1757
|
+
*/
|
|
1758
|
+
readonly queryOnce?: QueryOnce;
|
|
1759
|
+
/**
|
|
1760
|
+
* Resolves once the rpc runtime behind these apis is loaded. A host that
|
|
1761
|
+
* loads it on demand (the web boot keeps it out of an app's first load and
|
|
1762
|
+
* fetches it with the first route that reads data) supplies it; absent means
|
|
1763
|
+
* the runtime is already there.
|
|
1764
|
+
*/
|
|
1765
|
+
readonly ready?: () => Promise<void>;
|
|
1710
1766
|
}
|
|
1711
1767
|
|
|
1712
1768
|
export declare const FrameworkRuntimesContext: Context<FrameworkRuntimes | null>;
|
|
1713
1769
|
|
|
1714
|
-
export declare const FrameworkRuntimesProvider: ({ apis, children, demand, }: FrameworkRuntimesProviderProps) => ReactNode;
|
|
1770
|
+
export declare const FrameworkRuntimesProvider: ({ apis, children, demand, queryOnce, }: FrameworkRuntimesProviderProps) => ReactNode;
|
|
1715
1771
|
|
|
1716
1772
|
export declare interface FrameworkRuntimesProviderProps {
|
|
1717
1773
|
readonly apis: ReadonlyMap<string, ApiHandle>;
|
|
@@ -1721,6 +1777,9 @@ export declare interface FrameworkRuntimesProviderProps {
|
|
|
1721
1777
|
* `web.api.connect: 'lazy'`; a foreign host may omit it, which reads as
|
|
1722
1778
|
* "already connected". */
|
|
1723
1779
|
readonly demand?: (apiName: string) => void;
|
|
1780
|
+
/** Passed straight through to the context for loader reads in the browser —
|
|
1781
|
+
* see `FrameworkRuntimes.queryOnce`. The web boot supplies `queryOnce`. */
|
|
1782
|
+
readonly queryOnce?: QueryOnce;
|
|
1724
1783
|
}
|
|
1725
1784
|
|
|
1726
1785
|
/** One browser-safe key per logical mutation, stable across its resends. */
|
|
@@ -1926,6 +1985,22 @@ export declare interface LocalQueryOptions<Row> {
|
|
|
1926
1985
|
readonly limit?: number;
|
|
1927
1986
|
}
|
|
1928
1987
|
|
|
1988
|
+
export declare const makeApiRoleSocketTracker: (group: RpcGroup.Any, wsUrl: string, endpoints: unknown, onOpen: () => void, onIssue: (kind: ApiSocketIssue) => void) => {
|
|
1989
|
+
begin: (url: string) => {
|
|
1990
|
+
open: () => void;
|
|
1991
|
+
issue: (kind: ApiSocketIssue) => void;
|
|
1992
|
+
};
|
|
1993
|
+
};
|
|
1994
|
+
|
|
1995
|
+
/** One supervisor edge for a logical API, latest physical attempt per endpoint.
|
|
1996
|
+
* Raw open is supervisor/backstop evidence only; protocol leases stay separate. */
|
|
1997
|
+
export declare const makeApiSocketTracker: (urls: ReadonlyArray<string>, onOpen: () => void, onIssue: (kind: ApiSocketIssue) => void) => {
|
|
1998
|
+
begin: (url: string) => {
|
|
1999
|
+
open: () => void;
|
|
2000
|
+
issue: (kind: ApiSocketIssue) => void;
|
|
2001
|
+
};
|
|
2002
|
+
};
|
|
2003
|
+
|
|
1929
2004
|
export declare const makePreloadSeedBag: () => PreloadSeedBag;
|
|
1930
2005
|
|
|
1931
2006
|
/* Excluded from this release type: makeProtocolOpenRecovery */
|
|
@@ -1936,11 +2011,13 @@ export declare const makeStoreSeedBag: () => StoreSeedBag;
|
|
|
1936
2011
|
* The access a procedure DECLARES, as data — the same declaration the server
|
|
1937
2012
|
* enforces, mirrored from @voltro/cli's `SerialisedGuard`.
|
|
1938
2013
|
*
|
|
1939
|
-
*
|
|
2014
|
+
* The variants describe the three states an access decision has. `open` is the
|
|
1940
2015
|
* erased form of `openAccess: '<why>'`; it is a DECISION, and distinguishing it
|
|
1941
2016
|
* from "nobody declared anything" is the whole reason it travels.
|
|
1942
2017
|
*/
|
|
1943
2018
|
export declare type ManifestGuard = {
|
|
2019
|
+
readonly kind: 'upgraded';
|
|
2020
|
+
} | {
|
|
1944
2021
|
readonly kind: 'scope';
|
|
1945
2022
|
readonly scope: ReadonlyArray<string>;
|
|
1946
2023
|
/** `all` — every scope; `any` — at least one. */
|
|
@@ -2015,6 +2092,7 @@ export declare interface MountedApi {
|
|
|
2015
2092
|
readonly group: RpcGroup.Any;
|
|
2016
2093
|
readonly descriptors: ClientDescriptorMap;
|
|
2017
2094
|
readonly wsUrl: string;
|
|
2095
|
+
readonly roleEndpoints?: unknown;
|
|
2018
2096
|
readonly headers?: ResolvableHeaders | undefined;
|
|
2019
2097
|
readonly recovery?: RecoveryOptions | undefined;
|
|
2020
2098
|
/** Durable local mirror, resolved per transport generation — see
|
|
@@ -2551,6 +2629,14 @@ export declare interface QueryFiltersState<Row> {
|
|
|
2551
2629
|
readonly error: unknown | undefined;
|
|
2552
2630
|
}
|
|
2553
2631
|
|
|
2632
|
+
/** `queryOnce`'s shape, declared here so this module stays free of it. */
|
|
2633
|
+
export declare type QueryOnce = (handleRef: {
|
|
2634
|
+
readonly current: {
|
|
2635
|
+
readonly runtime: unknown;
|
|
2636
|
+
readonly client: unknown;
|
|
2637
|
+
};
|
|
2638
|
+
}, apiName: string, tag: string, input: Record<string, unknown> | undefined, signal?: AbortSignal) => Promise<unknown>;
|
|
2639
|
+
|
|
2554
2640
|
/**
|
|
2555
2641
|
* Resolve `tag(input)` once on the api behind `handleRef`: a query to the data
|
|
2556
2642
|
* of its first snapshot, a mutation or action to its result.
|
|
@@ -2576,6 +2662,8 @@ export declare type RawTransportStatus = 'connected' | 'disconnected';
|
|
|
2576
2662
|
/** The current answer, outside React. */
|
|
2577
2663
|
export declare const readApiOnline: (apiName?: string) => boolean;
|
|
2578
2664
|
|
|
2665
|
+
export { readFormCaptureSource }
|
|
2666
|
+
|
|
2579
2667
|
export { readPairing }
|
|
2580
2668
|
|
|
2581
2669
|
/**
|
|
@@ -2609,6 +2697,12 @@ export declare interface RecordState<R> {
|
|
|
2609
2697
|
readonly error: unknown | undefined;
|
|
2610
2698
|
}
|
|
2611
2699
|
|
|
2700
|
+
/** Recover edits made to one native form before its JavaScript booted.
|
|
2701
|
+
* Uses the ordinary native schema mapper; only changed, editable controls
|
|
2702
|
+
* replace initial values. Hidden metadata and unrelated forms stay intact.
|
|
2703
|
+
* Call once when initializing state, never as a submission or authority check. */
|
|
2704
|
+
export declare const recoverNativeFormValues: (schema: Schema.Top, formKey: string, values: Readonly<Record<string, unknown>>) => Readonly<Record<string, unknown>>;
|
|
2705
|
+
|
|
2612
2706
|
/**
|
|
2613
2707
|
* State owned by one logical API, not by one socket or one React hook.
|
|
2614
2708
|
*
|
|
@@ -2624,6 +2718,13 @@ export declare class RecoveryCoordinator {
|
|
|
2624
2718
|
get options(): ResolvedRecoveryOptions;
|
|
2625
2719
|
/** Ends on login/logout, tenant change or API disposal, not ordinary reconnect. */
|
|
2626
2720
|
get subjectSignal(): AbortSignal;
|
|
2721
|
+
/** Hydration values belong to the initial subject only. Once identity may
|
|
2722
|
+
* have changed, a later generation/remount must obtain its own snapshot.
|
|
2723
|
+
* Ordinary transport recovery does not cross this boundary. */
|
|
2724
|
+
getPreloadSeedPermission: () => boolean;
|
|
2725
|
+
/** A whole-cache resnapshot can follow same-socket re-authentication. Its
|
|
2726
|
+
* replacement reads must not reuse the original server-rendered values. */
|
|
2727
|
+
invalidatePreloadSeeds(): void;
|
|
2627
2728
|
getSnapshot: () => RecoverySnapshot;
|
|
2628
2729
|
/** The SSR / hydration snapshot — see INITIAL_RECOVERY_SNAPSHOT. Stable by
|
|
2629
2730
|
* reference, so both renders agree and React swaps to the live one after. */
|
|
@@ -2655,7 +2756,7 @@ export declare class RecoveryCoordinator {
|
|
|
2655
2756
|
* Disabled is final for the current generation and refuses immediately.
|
|
2656
2757
|
*/
|
|
2657
2758
|
reserveMutationReplay(startedAt: number): MutationReplayReservation | undefined;
|
|
2658
|
-
waitForProtocolReady(startedAt: number): Promise<boolean>;
|
|
2759
|
+
waitForProtocolReady(startedAt: number, signal?: AbortSignal): Promise<boolean>;
|
|
2659
2760
|
dispose(): void;
|
|
2660
2761
|
}
|
|
2661
2762
|
|
|
@@ -2793,6 +2894,8 @@ export declare interface ResolvedClient {
|
|
|
2793
2894
|
readonly client: RpcClient.RpcClient<Rpc.Any, RpcClientError.RpcClientError>;
|
|
2794
2895
|
readonly errorBus?: RpcErrorBus;
|
|
2795
2896
|
readonly recovery?: RecoveryCoordinator;
|
|
2897
|
+
/** Identity lifetime captured when this transport was built. */
|
|
2898
|
+
readonly subjectSignal?: AbortSignal;
|
|
2796
2899
|
}
|
|
2797
2900
|
|
|
2798
2901
|
export declare interface ResolvedRecoveryOptions {
|
|
@@ -2955,9 +3058,9 @@ export declare const RICH_TEXT_MARKS: readonly ["bold", "italic", "code", "strik
|
|
|
2955
3058
|
* unbounded tree is a decode bomb on a server thread. */
|
|
2956
3059
|
export declare const RICH_TEXT_MAX_NODES = 5000;
|
|
2957
3060
|
|
|
2958
|
-
export declare type RichTextBlock = typeof
|
|
3061
|
+
export declare type RichTextBlock = typeof RichTextBlockSchema.Type;
|
|
2959
3062
|
|
|
2960
|
-
declare const
|
|
3063
|
+
declare const RichTextBlockSchema: Schema.Union<readonly [Schema.Struct<{
|
|
2961
3064
|
readonly type: Schema.Literal<"paragraph">;
|
|
2962
3065
|
readonly content: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
2963
3066
|
readonly type: Schema.Literal<"text">;
|
|
@@ -3044,8 +3147,6 @@ declare const RichTextBlock_2: Schema.Union<readonly [Schema.Struct<{
|
|
|
3044
3147
|
readonly text: Schema.String;
|
|
3045
3148
|
}>]>;
|
|
3046
3149
|
|
|
3047
|
-
declare type RichTextBlock = typeof RichTextBlock_2.Type;
|
|
3048
|
-
|
|
3049
3150
|
/**
|
|
3050
3151
|
* The rich-text field's value. Use it directly in a mutation input:
|
|
3051
3152
|
*
|
|
@@ -3147,9 +3248,9 @@ export declare const RichTextDocument: Schema.Struct<{
|
|
|
3147
3248
|
|
|
3148
3249
|
export declare type RichTextDocument = typeof RichTextDocument.Type;
|
|
3149
3250
|
|
|
3150
|
-
export declare type RichTextInline = typeof
|
|
3251
|
+
export declare type RichTextInline = typeof RichTextInlineSchema.Type;
|
|
3151
3252
|
|
|
3152
|
-
declare const
|
|
3253
|
+
declare const RichTextInlineSchema: Schema.Union<readonly [Schema.Struct<{
|
|
3153
3254
|
readonly type: Schema.Literal<"text">;
|
|
3154
3255
|
readonly text: Schema.String;
|
|
3155
3256
|
readonly marks: Schema.optional<Schema.$Array<Schema.Literals<readonly ["bold", "italic", "code", "strike"]>>>;
|
|
@@ -3163,11 +3264,9 @@ declare const RichTextInline_2: Schema.Union<readonly [Schema.Struct<{
|
|
|
3163
3264
|
}>>;
|
|
3164
3265
|
}>]>;
|
|
3165
3266
|
|
|
3166
|
-
declare type
|
|
3167
|
-
|
|
3168
|
-
export declare type RichTextListItem = typeof RichTextListItem_2.Type;
|
|
3267
|
+
export declare type RichTextListItem = typeof RichTextListItemSchema.Type;
|
|
3169
3268
|
|
|
3170
|
-
declare const
|
|
3269
|
+
declare const RichTextListItemSchema: Schema.Struct<{
|
|
3171
3270
|
readonly type: Schema.Literal<"listItem">;
|
|
3172
3271
|
readonly content: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
3173
3272
|
readonly type: Schema.Literal<"text">;
|
|
@@ -3184,8 +3283,6 @@ declare const RichTextListItem_2: Schema.Struct<{
|
|
|
3184
3283
|
}>]>>;
|
|
3185
3284
|
}>;
|
|
3186
3285
|
|
|
3187
|
-
declare type RichTextListItem = typeof RichTextListItem_2.Type;
|
|
3188
|
-
|
|
3189
3286
|
export declare type RichTextMark = (typeof RICH_TEXT_MARKS)[number];
|
|
3190
3287
|
|
|
3191
3288
|
/** The document's text, with no markers — for search indexing, excerpts and
|
|
@@ -3196,6 +3293,13 @@ export declare const richTextToPlainText: (value: unknown) => string;
|
|
|
3196
3293
|
* when the label field is absent. Exported for direct testing + reuse. */
|
|
3197
3294
|
export declare const rowsToOptions: (rows: ReadonlyArray<Record<string, unknown>>, labelField: string, valueField: string) => ReadonlyArray<FieldOption>;
|
|
3198
3295
|
|
|
3296
|
+
export declare interface RpcCaller {
|
|
3297
|
+
/** Call one rpc by tag. Rejects with the server's typed error; `signal` interrupts the call. */
|
|
3298
|
+
call(tag: string, input: unknown, options?: {
|
|
3299
|
+
readonly signal?: AbortSignal | undefined;
|
|
3300
|
+
}): Promise<unknown>;
|
|
3301
|
+
}
|
|
3302
|
+
|
|
3199
3303
|
/** What the client can prove about a unary call's server-side result. */
|
|
3200
3304
|
export declare type RpcCallOutcome = 'not-applicable' | 'not-started' | 'known' | 'unknown';
|
|
3201
3305
|
|
|
@@ -3443,6 +3547,8 @@ export declare interface ServerRequestContextValue {
|
|
|
3443
3547
|
* would add a fiber fork the client boot does not have, and every
|
|
3444
3548
|
* ancestor arity difference shifts every useId in the app. */
|
|
3445
3549
|
readonly formFlash?: FormFlashPayload;
|
|
3550
|
+
/** Public captured build/class selection, never a credential or write permit. */
|
|
3551
|
+
readonly formSource?: string;
|
|
3446
3552
|
}
|
|
3447
3553
|
|
|
3448
3554
|
export declare const ServerRequestProvider: ({ value, children, }: {
|
|
@@ -4202,11 +4308,10 @@ export declare interface SubscriptionMeta {
|
|
|
4202
4308
|
readonly revision: number;
|
|
4203
4309
|
/** Wall-clock ms when the most recent delta was emitted; undefined for snapshots / optimistic. */
|
|
4204
4310
|
readonly emittedAt: number | undefined;
|
|
4205
|
-
/**
|
|
4206
|
-
*
|
|
4207
|
-
*
|
|
4208
|
-
*
|
|
4209
|
-
* `useOnRpcError` for connection-level UX.
|
|
4311
|
+
/** Subscription refusal or terminal non-transport stream failure.
|
|
4312
|
+
* After a snapshot, data remains available alongside the error. Check it
|
|
4313
|
+
* before presenting retained data as current/live. Transport interruptions
|
|
4314
|
+
* preserve delivered data and report through recovery health/error buses.
|
|
4210
4315
|
*
|
|
4211
4316
|
* A cold-start failure is its own STATE: `loading` is `false`, `failed` is
|
|
4212
4317
|
* `true`, and this field is non-optional there (see
|
|
@@ -4406,8 +4511,12 @@ export declare interface SupervisorHandle {
|
|
|
4406
4511
|
readonly dispose: () => void;
|
|
4407
4512
|
/** Force a fresh ws connect for every api (carrying the browser's current
|
|
4408
4513
|
* cookies) so a cookie-based login re-resolves the authenticated Subject
|
|
4409
|
-
* in place, without a page reload.
|
|
4410
|
-
|
|
4514
|
+
* in place, without a page reload. Resolves once every api runs on a
|
|
4515
|
+
* runtime built after this call (or the supervisor is gone): a call made
|
|
4516
|
+
* after that goes out as the next Subject. Never rejects; a failing build
|
|
4517
|
+
* keeps retrying and the promise waits for the one that lands. Resolves
|
|
4518
|
+
* at once for UI-only (no-api) apps. */
|
|
4519
|
+
readonly reconnect: () => Promise<void>;
|
|
4411
4520
|
/** Re-resolve `authHeaders` and rebuild the transport, SAME subject — for a
|
|
4412
4521
|
* rotated token on a long-lived tab. Unlike `reconnect()` this seeds the new
|
|
4413
4522
|
* cache from the old one, because nobody's entitlement changed. */
|
|
@@ -4638,6 +4747,9 @@ export declare interface UndoLogEntry {
|
|
|
4638
4747
|
readonly createdAt: string;
|
|
4639
4748
|
}
|
|
4640
4749
|
|
|
4750
|
+
/** The error for an api name nothing mounted — one wording for every host. */
|
|
4751
|
+
export declare const unknownApiError: (name: string, known: Iterable<string>) => Error;
|
|
4752
|
+
|
|
4641
4753
|
/** How the running code gets replaced: a service worker, a desktop updater,
|
|
4642
4754
|
* an OTA bundle. `apply` is the restart/reload; callers gate it on an empty
|
|
4643
4755
|
* outbox. */
|
|
@@ -4703,6 +4815,10 @@ export declare interface UploadOptions {
|
|
|
4703
4815
|
readonly tags?: ReadonlyArray<string>;
|
|
4704
4816
|
readonly alt?: string;
|
|
4705
4817
|
readonly caption?: string;
|
|
4818
|
+
/** Stable identity for one through-app transfer. Reuse unchanged bytes and metadata
|
|
4819
|
+
* after an uncertain acknowledgement. Requires native operation storage.
|
|
4820
|
+
* uploadMany accepts an explicit identity only when it contains one file. */
|
|
4821
|
+
readonly operationId?: string;
|
|
4706
4822
|
/** rpc tag of the ticket-minting action. Default `'storage.mintUploadTicket'`
|
|
4707
4823
|
* — override for a namespaced storage plugin instance. */
|
|
4708
4824
|
readonly mintTag?: string;
|
|
@@ -4933,6 +5049,9 @@ export declare interface UseFormBindingOptions<Input> {
|
|
|
4933
5049
|
readonly schema?: Schema.Top;
|
|
4934
5050
|
/** Initial field values. */
|
|
4935
5051
|
readonly defaults?: Partial<Input>;
|
|
5052
|
+
/** Native form identity for recovering browser edits before bootstrap.
|
|
5053
|
+
* Defaults to the failed POST's key, then the mutation tag. */
|
|
5054
|
+
readonly formKey?: string;
|
|
4936
5055
|
/** The failed no-JS POST's payload for THIS form (`useFormFlash` from
|
|
4937
5056
|
* @voltro/web resolves it, SSR and client alike). When present it seeds
|
|
4938
5057
|
* the initial values + field errors, so the 422 re-render shows the
|
|
@@ -5017,6 +5136,9 @@ export declare interface UseFormBindingOptions<Input> {
|
|
|
5017
5136
|
readonly subscribe?: 'all' | 'fields';
|
|
5018
5137
|
}
|
|
5019
5138
|
|
|
5139
|
+
/** Relay the server-rendered public source pin for native POST and hydration. */
|
|
5140
|
+
export declare const useFormCapture: () => string | undefined;
|
|
5141
|
+
|
|
5020
5142
|
/**
|
|
5021
5143
|
* Narrow per-field subscription — the render-performance half of the engine.
|
|
5022
5144
|
*
|
|
@@ -5201,6 +5323,9 @@ export declare interface UseResourceCanState {
|
|
|
5201
5323
|
|
|
5202
5324
|
export declare const useResumableAgentStream: <E = unknown>(apiName: string, rpcTag: string, options?: ResumableAgentStreamOptions<E>) => ResumableAgentStreamControls<E>;
|
|
5203
5325
|
|
|
5326
|
+
/** A stable `RpcCaller` for one api. The same object across renders; each call reads the latest handle. */
|
|
5327
|
+
export declare const useRpcCaller: (apiName: string) => RpcCaller;
|
|
5328
|
+
|
|
5204
5329
|
/** A schema-owned form for actions, parent plans, and local saves. It uses the
|
|
5205
5330
|
* same validation/field engine without connecting to an API or inventing a tag. */
|
|
5206
5331
|
export declare const useSchemaFormBinding: <Input extends Record<string, unknown>, Encoded, Output>(options: Omit<UseFormBindingOptions<Input>, "schema" | "onSubmit"> & {
|