@powerhousedao/connect-core 6.2.3-dev.81 → 6.2.3-dev.83

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.
@@ -0,0 +1,365 @@
1
+ import "./runtime-config-D3YPhYyj.js";
2
+ import { BrowserReactorClientModule, PHStore, SwitchboardBackend, WorkerReactorClientModule } from "@powerhousedao/reactor-browser";
3
+ import { PHConnectCollection, PHConnectRemoteBackend, PHConnectRuntimeDefaultDrive, PHReactorClientMode } from "@powerhousedao/shared/clis";
4
+ import { DocumentDriveDocument } from "@powerhousedao/shared/document-drive";
5
+ import { DocumentModelModule, ISigner } from "@powerhousedao/shared/document-model";
6
+ import { DriveCollectionId, IReactorClient, ReactorInfo } from "@powerhousedao/reactor";
7
+ import { CollectionRequirementsInput, ReactorReach, RoutableBackendConfig, RouterDiagnostic, RoutingClientOptions, RoutingReactorClient } from "@powerhousedao/reactor-router";
8
+ import { DocumentModelLib } from "document-model";
9
+ //#endregion
10
+ //#region src/runtime/runtime-flag.d.ts
11
+ type RuntimeFlagInput = {
12
+ configFlag: boolean;
13
+ queryParam?: string | null;
14
+ storedValue?: string | null;
15
+ };
16
+ declare function resolveRuntimeFlag(input: RuntimeFlagInput): boolean;
17
+ type RuntimeFlagKeys = {
18
+ queryKey: string;
19
+ storageKey: string;
20
+ readConfigFlag: () => boolean;
21
+ };
22
+ declare function isRuntimeFlagEnabled(keys: RuntimeFlagKeys): boolean;
23
+ //#endregion
24
+ //#region src/runtime/multi-reactor-flag.d.ts
25
+ declare function isMultiReactorEnabled(): boolean;
26
+ //#endregion
27
+ //#region src/runtime/reactor-worker-flag.d.ts
28
+ declare const REACTOR_WORKER_QUERY_KEY = "reactorWorker";
29
+ declare const REACTOR_WORKER_STORAGE_KEY = "ph:reactorWorker";
30
+ type ReactorWorkerFlagInput = RuntimeFlagInput;
31
+ declare function resolveReactorWorkerEnabled(input: ReactorWorkerFlagInput): boolean;
32
+ declare function isReactorWorkerEnabled(): boolean;
33
+ //#endregion
34
+ //#region src/runtime/reactor-client-mode.d.ts
35
+ /**
36
+ * Which of the four reactor clients Connect boots. Standardized by the
37
+ * multi-reactor work; this resolves the single selector Connect acts on:
38
+ *
39
+ * in-process | worker | remote | router
40
+ *
41
+ * Precedence: an explicit `?reactorClient=` query override (kept in
42
+ * localStorage so it survives a reload), then a stored override, then the
43
+ * served `connect.instance.reactorClient` (projected from the host's reactor
44
+ * backends), then the LEGACY booleans — so a config that only sets
45
+ * reactorWorker/multiReactor behaves exactly as before.
46
+ *
47
+ * `remote` is the only mode that builds NO local reactor (no PGlite): it is a
48
+ * pure client to a remote Switchboard. `router` keeps the local reactor and
49
+ * adds remote backends; `worker`/`in-process` are the local reactor alone.
50
+ */
51
+ type ReactorClientMode = PHReactorClientMode;
52
+ declare const REACTOR_CLIENT_QUERY_KEY = "reactorClient";
53
+ declare const REACTOR_CLIENT_STORAGE_KEY = "ph:reactorClient";
54
+ declare function resolveReactorClientMode(): ReactorClientMode;
55
+ //#endregion
56
+ //#region src/runtime/drive-placement.d.ts
57
+ /** The router backend of the reactor in this browser. */
58
+ declare const LOCAL_BACKEND_NAME = "connect-local";
59
+ /** A drive the host keeps on a switchboard, and where its config opens it. */
60
+ type SwitchboardDrive = {
61
+ /** The host's name for it: its address's slug, or a collection's key. */
62
+ slug: string;
63
+ url: string;
64
+ /** The switchboard's backend. */
65
+ remote: string;
66
+ /** `remote` (no copy here) or `LOCAL_BACKEND_NAME` (a synced copy). */
67
+ configured: string;
68
+ /** Not a default drive: its address may not be the one it is served at. */
69
+ collection: boolean;
70
+ };
71
+ /** A switchboard drive with the names callers reach it by. */
72
+ type ResolvedSwitchboardDrive = SwitchboardDrive & {
73
+ id?: string;
74
+ servedSlug?: string;
75
+ };
76
+ /** A drive this browser moved away from its host config. */
77
+ type PlacementEntry = {
78
+ slug: string;
79
+ backend: string;
80
+ configWas: string;
81
+ };
82
+ type PlacementConfig = {
83
+ drives?: {
84
+ defaultDrives?: readonly PHConnectRuntimeDefaultDrive[];
85
+ };
86
+ instance?: {
87
+ remoteBackends?: readonly PHConnectRemoteBackend[];
88
+ collections?: Record<string, PHConnectCollection>;
89
+ };
90
+ };
91
+ declare function keepsLocalCopy(drive: PHConnectRuntimeDefaultDrive): boolean;
92
+ /** Remote default drives with a backend, then collections. */
93
+ declare function switchboardDrives(config: PlacementConfig): SwitchboardDrive[];
94
+ /** Stale: no such drive, a backend it can't open on, back to config, or a changed config value. */
95
+ declare function applyPlacementEntries(drives: readonly SwitchboardDrive[], entries: readonly PlacementEntry[]): {
96
+ applied: PlacementEntry[];
97
+ stale: PlacementEntry[];
98
+ };
99
+ /** A served slug names a declared one as is, or hashed (`<slug>-<8 hex>`). */
100
+ declare function servesSlug(declared: string, served: string): boolean;
101
+ type DriveNames = {
102
+ id: string;
103
+ slug: string;
104
+ };
105
+ type ResolveSwitchboardDrivesOptions = {
106
+ timeoutMs?: number;
107
+ /** A collection whose address does not answer: find it among its switchboard's drives. */
108
+ findServed?: (drive: SwitchboardDrive) => Promise<DriveNames | undefined>;
109
+ };
110
+ /** An unreachable drive keeps only the slug in its address. */
111
+ declare function resolveSwitchboardDrives(drives: readonly SwitchboardDrive[], fetchInfo: (url: string) => Promise<DriveNames>, { timeoutMs, findServed }?: ResolveSwitchboardDrivesOptions): Promise<ResolvedSwitchboardDrive[]>;
112
+ /** The address the drive is served at. */
113
+ declare function servedUrl(drive: ResolvedSwitchboardDrive): string;
114
+ /** The keys a placement is installed under: the id and the served slug. */
115
+ declare function placementKeys(drive: ResolvedSwitchboardDrive): string[];
116
+ type SyncRemotes = {
117
+ list(): readonly {
118
+ meta: {
119
+ name: string;
120
+ collectionId: DriveCollectionId;
121
+ };
122
+ }[];
123
+ remove(name: string): Promise<void>;
124
+ };
125
+ /** Drops the sync remote of every given drive; its local data is left unread. */
126
+ declare function removeLocalCopies(sync: SyncRemotes, resolved: readonly {
127
+ id?: string;
128
+ }[]): Promise<void>;
129
+ declare namespace multi_reactor_d_exports {
130
+ export { ConnectRoutingClient, LOCAL_BACKEND_NAME, LoadedDocumentModels, LocalReactorModule, MultiReactorParams, PLACE_ON_LOCAL, PLACE_ON_REMOTE, REMOTE_BACKEND_NAME, SwitchboardRemote, buildMultiReactorClient, deriveSwitchboardGraphqlUrl, localFacts, localReach };
131
+ }
132
+ declare const REMOTE_BACKEND_NAME = "switchboard-remote";
133
+ type LocalReactorModule = BrowserReactorClientModule | WorkerReactorClientModule;
134
+ /** Only the tab's reactor is inspectable here, so new collections land on it. */
135
+ declare const PLACE_ON_LOCAL: CollectionRequirementsInput;
136
+ declare function localReach(kind: LocalReactorModule["kind"]): ReactorReach;
137
+ /** Read at every refresh, never kept: a rebuilt reactor reports its own. */
138
+ declare function localFacts(module: LocalReactorModule): () => Promise<ReactorInfo>;
139
+ /** `<origin>[/<prefix>]/d/<slug>` -> `<origin>[/<prefix>]/graphql`. */
140
+ declare function deriveSwitchboardGraphqlUrl(remoteDriveUrl: string): string | undefined;
141
+ /** A switchboard the router reaches, by its router backend name. */
142
+ type SwitchboardRemote = {
143
+ name: string;
144
+ graphqlUrl: string;
145
+ };
146
+ /** The loaded document models, or a getter that reads the current ones. */
147
+ type LoadedDocumentModels = readonly DocumentModelModule[] | (() => readonly DocumentModelModule[]);
148
+ type MultiReactorParams = {
149
+ /** The local module, built and ready. Undefined builds a REMOTE-ONLY router
150
+ * (no local backend → no local reactor, no PGlite): the `remote` client. */
151
+ module: LocalReactorModule | undefined;
152
+ /** One per switchboard; `remoteGraphqlUrl` alone is one named `switchboard-remote`. */
153
+ remotes?: readonly SwitchboardRemote[];
154
+ remoteGraphqlUrl?: string;
155
+ /** Collection key or drive id -> backend; names no backend here are dropped. */
156
+ collections?: Readonly<Record<string, string>>;
157
+ /** Signs routed writes; unsigned (anonymous) without one. */
158
+ signer?: ISigner;
159
+ /** Signing models when the local module exposes no registry; the router asks the local reactor (or, remote-only, the loaded set). */
160
+ documentModelModules: LoadedDocumentModels;
161
+ onDiagnostic?: RouterDiagnostic;
162
+ };
163
+ /** Remote-only placement: the Switchboard serves every collection. (It offers
164
+ * no inspection surface over GraphQL, so PLACE_ON_LOCAL's `inspectable`
165
+ * requirement must NOT apply, or no backend would be eligible.) */
166
+ declare const PLACE_ON_REMOTE: CollectionRequirementsInput;
167
+ /** The router Connect installs, with Connect's handling of credentials and id checks. */
168
+ declare class ConnectRoutingClient extends RoutingReactorClient {
169
+ private readonly remotes;
170
+ constructor(backends: readonly RoutableBackendConfig[], options: RoutingClientOptions, remotes: readonly SwitchboardBackend[], hasLocal: boolean);
171
+ /** Renown's sign-in and sign-out call this on whatever client is installed. */
172
+ notifyCredentialsChanged(): void;
173
+ }
174
+ /**
175
+ * Build the Connect routing client. With a local `module` it is the router
176
+ * over the tab's reactor (primary) and the Switchboard; WITHOUT one it is the
177
+ * `remote` client — a remote-only router whose single backend is the
178
+ * Switchboard, so no local reactor (and no PGlite) is built. Either way the
179
+ * result is a full IReactorClient the app graph consumes unchanged.
180
+ */
181
+ declare function buildMultiReactorClient(params: MultiReactorParams): Promise<ConnectRoutingClient>;
182
+ //#endregion
183
+ //#region src/runtime/app-reactor-client.d.ts
184
+ type MultiReactorModule = typeof multi_reactor_d_exports;
185
+ type AppReactorClientParams = {
186
+ mode: ReactorClientMode;
187
+ /** Built, and ready (the worker has started up). Undefined in `remote`
188
+ * mode, where no local reactor is built. */
189
+ module: LocalReactorModule | undefined;
190
+ /** The fallback switchboard when `remoteBackends` is empty. */
191
+ remoteDriveUrl: string | undefined;
192
+ /** One per switchboard, by host key; `url` is a drive address on it. */
193
+ remoteBackends?: readonly {
194
+ name: string;
195
+ url: string;
196
+ }[];
197
+ /** Config placements known at build time; later ones go through `setConfiguredPlacement`. */
198
+ collections?: Readonly<Record<string, string>>;
199
+ /** Signs routed writes; unsigned (anonymous) without one. */
200
+ signer?: ISigner;
201
+ documentModelModules: LoadedDocumentModels;
202
+ loadRouter?: () => Promise<MultiReactorModule>;
203
+ };
204
+ /** What a mode builds in the tab; `remote` builds no local reactor (no PGlite). */
205
+ type ReactorClientPlan = {
206
+ mode: ReactorClientMode;
207
+ /** `router`: the local reactor plus remote backends. */
208
+ multiReactor: boolean;
209
+ needsLocalReactor: boolean;
210
+ /** The local reactor runs in the shared worker. */
211
+ localAsWorker: boolean;
212
+ };
213
+ declare function planReactorClient(mode?: ReactorClientMode): ReactorClientPlan;
214
+ /** Builds the tab's reactor, e.g. Connect's PGlite or worker reactor. */
215
+ type LocalReactorFactory = (plan: ReactorClientPlan) => Promise<LocalReactorModule>;
216
+ type CreateAppReactorClientOptions = Omit<AppReactorClientParams, "mode" | "module"> & {
217
+ plan?: ReactorClientPlan;
218
+ /** Called only when the plan needs a local reactor. */
219
+ localReactor?: LocalReactorFactory;
220
+ };
221
+ /** Builds the local reactor the plan needs, then selects the app's client. */
222
+ declare function createAppReactorClient(options: CreateAppReactorClientOptions): Promise<{
223
+ plan: ReactorClientPlan;
224
+ module: LocalReactorModule | undefined;
225
+ client: IReactorClient;
226
+ router: ConnectRoutingClient | undefined;
227
+ }>;
228
+ /**
229
+ * Pick the client for the resolved mode:
230
+ * - `in-process` / `worker`: the local client, router module never loaded.
231
+ * - `router`: the local reactor plus remote backends.
232
+ * - `remote`: a remote-only router — a full IReactorClient that proxies to
233
+ * the Switchboard over GraphQL with NO local reactor (no PGlite).
234
+ */
235
+ declare function selectAppReactorClient(params: AppReactorClientParams): Promise<IReactorClient>;
236
+ /**
237
+ * A Switchboard that cannot answer must not fail boot: list the tab's drives.
238
+ *
239
+ * A Switchboard that REFUSES the caller (401/403) must not fail boot either:
240
+ * the refusal is recorded (`backendAuth`) so the root view shows the sign-in
241
+ * gate, and the drive list is empty until the user is someone the backend
242
+ * accepts. A remote-only client has no local drives to fall back on.
243
+ */
244
+ declare function getAppDrives(client: IReactorClient, local: IReactorClient): Promise<DocumentDriveDocument[]>;
245
+ /**
246
+ * The boot refresh of the drives store. It lists through `getAppDrives`
247
+ * whichever client is in use, so a Switchboard that refuses the caller is
248
+ * recorded for the sign-in gate here too: the remote-only client is its own
249
+ * `local`, and a bare `refreshReactorDataClient` would let the 401 escape
250
+ * and fail the boot before the gate can render.
251
+ */
252
+ declare function refreshAppDrives(client: IReactorClient, local: IReactorClient): Promise<void>;
253
+ /**
254
+ * Lists the drives again as the caller the tab now is, through the clients
255
+ * boot left in the store: after a sign-in landing or a sign-out that followed
256
+ * a backend's refusal. Nothing to do before boot has set a client.
257
+ */
258
+ declare function relistAppDrives(): Promise<void>;
259
+ //#endregion
260
+ //#region src/runtime/drive-placements.d.ts
261
+ /** A collection by its declared slug among its switchboard's drives, e.g. one served hashed. */
262
+ declare function findServedDrive(router: Pick<RoutingReactorClient, "backends">, drive: SwitchboardDrive): Promise<{
263
+ id: string;
264
+ slug: string;
265
+ } | undefined>;
266
+ /** Where a drive opens given its stored move, if any: the move, else the host config. */
267
+ declare function effectiveBackend(drive: SwitchboardDrive, entry: PlacementEntry | undefined): string;
268
+ /** A drive opening on `backend` reads its copy here, which must arrive first. */
269
+ declare function needsCopy(backend: string): boolean;
270
+ /** A copy has caught up once every scope is at least at the source's revision. */
271
+ declare function caughtUp(local: Readonly<Record<string, number>>, source: Readonly<Record<string, number>>): boolean;
272
+ /** Where this browser keeps its moves; per origin, so every tab shares it. */
273
+ interface PlacementStore {
274
+ list(): Promise<PlacementEntry[]>;
275
+ put(entry: PlacementEntry): Promise<void>;
276
+ delete(slug: string): Promise<void>;
277
+ }
278
+ /** The router's two placement layers. */
279
+ type PlacementRouter = {
280
+ setPlacement(key: string, backend: string | undefined): void;
281
+ setConfiguredPlacement(key: string, backend: string | undefined): void;
282
+ };
283
+ type PlacementSync = SyncRemotes & {
284
+ /** Adds a sync remote for the drive. */
285
+ add(url: string, driveId: string): Promise<void>;
286
+ /** Bounded wait until the local copy holds what `remote` holds; rejects when it does not. */
287
+ untilCopied(driveId: string, remote: string): Promise<void>;
288
+ };
289
+ type DrivePlacement = {
290
+ drive: ResolvedSwitchboardDrive;
291
+ /** Where the drive opens in this browser now. */
292
+ backend: string;
293
+ /** This browser moved it away from the host config. */
294
+ moved: boolean;
295
+ /** A move is running. */
296
+ busy: boolean;
297
+ /** Where a running move takes the drive. */
298
+ movingTo?: string;
299
+ };
300
+ /** Config placement plus this browser's moves: store, then sync remote, then router. */
301
+ declare class DrivePlacements {
302
+ readonly drives: readonly SwitchboardDrive[];
303
+ private readonly store;
304
+ private readonly sync;
305
+ private applied;
306
+ private resolved;
307
+ private router;
308
+ private readonly busy;
309
+ private attached;
310
+ private readonly listeners;
311
+ private snapshot;
312
+ constructor(drives: readonly SwitchboardDrive[], applied: readonly PlacementEntry[], store: PlacementStore, sync: PlacementSync);
313
+ /** Reads the store and drops the entries the config has overtaken (O2). */
314
+ static load(drives: readonly SwitchboardDrive[], store: PlacementStore, sync: PlacementSync): Promise<DrivePlacements>;
315
+ /** Where `drive` opens in this browser: a move, else the config. */
316
+ backendOf(drive: SwitchboardDrive): string;
317
+ /** Whether a remote default drive at `url` keeps a copy here. */
318
+ keepsCopy(url: string): boolean;
319
+ /** Drives that open on their switchboard with no copy here. */
320
+ placed(): SwitchboardDrive[];
321
+ /** Collections this browser keeps a copy of; default drives are added with the others. */
322
+ keptCollections(): ResolvedSwitchboardDrive[];
323
+ /** Installs both layers for every drive the router can be told about. */
324
+ attach(router: PlacementRouter | undefined, resolved: readonly ResolvedSwitchboardDrive[]): void;
325
+ /**
326
+ * Attaches, follows the moves other tabs made since `load`, then brings
327
+ * the sync remotes in line; returns the collections to keep a copy of.
328
+ */
329
+ start(router: PlacementRouter | undefined, resolved: readonly ResolvedSwitchboardDrive[], syncsDrives: boolean): Promise<ResolvedSwitchboardDrive[]>;
330
+ /** The drive's placement in this browser; undefined for a drive the host does not place on a switchboard. */
331
+ placementOf(driveId: string): DrivePlacement | undefined;
332
+ subscribe(listener: () => void): () => void;
333
+ /** Opens the drive on `backend` in this browser: its switchboard, or a copy here. */
334
+ move(driveId: string, backend: string): Promise<void>;
335
+ /** Back to where the host config opens the drive. */
336
+ reset(driveId: string): Promise<void>;
337
+ /** Re-reads the store after another tab moved a drive; true when something changed. */
338
+ reload(): Promise<boolean>;
339
+ /** A copy kept by another tab is routed here only once it has arrived. */
340
+ private follow;
341
+ private readMoves;
342
+ private record;
343
+ private install;
344
+ private notify;
345
+ }
346
+ //#endregion
347
+ //#region src/runtime/ph-store.d.ts
348
+ /** The app's PH store: the active one, else a new one bound to `window.ph`.
349
+ * Values set on `window.ph` before carry over. */
350
+ declare function getConnectPHStore(): PHStore;
351
+ //#endregion
352
+ //#region src/runtime/local-package.d.ts
353
+ /** A module namespace, as `import * as pkg` or Vite HMR hands it over. */
354
+ type ModuleNamespace = Record<string, any> & {
355
+ [Symbol.toStringTag]: "Module";
356
+ };
357
+ type LocalPackage = DocumentModelLib<any> | ModuleNamespace;
358
+ /** The package itself, or a loader (`() => import("./index.js")`) that keeps it off the boot path. */
359
+ type LocalPackageSource = LocalPackage | (() => Promise<LocalPackage>);
360
+ /** Starts loading the project's package; a loader runs once, here. */
361
+ declare function loadLocalPackage(source: LocalPackageSource | undefined): DocumentModelLib | Promise<DocumentModelLib> | undefined;
362
+ //#endregion
363
+ export { resolveRuntimeFlag as $, ResolvedSwitchboardDrive as A, REACTOR_CLIENT_QUERY_KEY as B, relistAppDrives as C, LOCAL_BACKEND_NAME as D, LocalReactorModule as E, removeLocalCopies as F, REACTOR_WORKER_STORAGE_KEY as G, ReactorClientMode as H, resolveSwitchboardDrives as I, resolveReactorWorkerEnabled as J, ReactorWorkerFlagInput as K, servedUrl as L, applyPlacementEntries as M, keepsLocalCopy as N, PlacementEntry as O, placementKeys as P, isRuntimeFlagEnabled as Q, servesSlug as R, refreshAppDrives as S, LoadedDocumentModels as T, resolveReactorClientMode as U, REACTOR_CLIENT_STORAGE_KEY as V, REACTOR_WORKER_QUERY_KEY as W, RuntimeFlagInput as X, isMultiReactorEnabled as Y, RuntimeFlagKeys as Z, LocalReactorFactory as _, getConnectPHStore as a, getAppDrives as b, PlacementRouter as c, caughtUp as d, effectiveBackend as f, CreateAppReactorClientOptions as g, AppReactorClientParams as h, loadLocalPackage as i, SwitchboardDrive as j, ResolveSwitchboardDrivesOptions as k, PlacementStore as l, needsCopy as m, LocalPackageSource as n, DrivePlacement as o, findServedDrive as p, isReactorWorkerEnabled as q, ModuleNamespace as r, DrivePlacements as s, LocalPackage as t, PlacementSync as u, ReactorClientPlan as v, selectAppReactorClient as w, planReactorClient as x, createAppReactorClient as y, switchboardDrives as z };
364
+ export {};
365
+ //# sourceMappingURL=index-ZFFeYX4A.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-ZFFeYX4A.d.ts","names":[],"sources":["../src/runtime/runtime-flag.ts","../src/runtime/multi-reactor-flag.ts","../src/runtime/reactor-worker-flag.ts","../src/runtime/reactor-client-mode.ts","../src/runtime/drive-placement.ts","../src/runtime/multi-reactor.ts","../src/runtime/app-reactor-client.ts","../src/runtime/drive-placements.ts","../src/runtime/ph-store.ts","../src/runtime/local-package.ts"],"mappings":"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"}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { A as isRuntimeFlagEnabled, C as REACTOR_WORKER_STORAGE_KEY, D as isMultiReactorEnabled, E as resolveReactorWorkerEnabled, O as RuntimeFlagInput, S as REACTOR_WORKER_QUERY_KEY, T as isReactorWorkerEnabled, _ as LocalReactorModule, a as getConnectPHStore, b as ReactorClientMode, c as LocalReactorFactory, d as getAppDrives, f as planReactorClient, g as LoadedDocumentModels, h as selectAppReactorClient, i as loadLocalPackage, j as resolveRuntimeFlag, k as RuntimeFlagKeys, l as ReactorClientPlan, m as relistAppDrives, n as LocalPackageSource, o as AppReactorClientParams, p as refreshAppDrives, r as ModuleNamespace, s as CreateAppReactorClientOptions, t as LocalPackage, u as createAppReactorClient, v as REACTOR_CLIENT_QUERY_KEY, w as ReactorWorkerFlagInput, x as resolveReactorClientMode, y as REACTOR_CLIENT_STORAGE_KEY } from "./index-BMlma368.js";
1
+ import { $ as resolveRuntimeFlag, A as ResolvedSwitchboardDrive, B as REACTOR_CLIENT_QUERY_KEY, C as relistAppDrives, D as LOCAL_BACKEND_NAME, E as LocalReactorModule, F as removeLocalCopies, G as REACTOR_WORKER_STORAGE_KEY, H as ReactorClientMode, I as resolveSwitchboardDrives, J as resolveReactorWorkerEnabled, K as ReactorWorkerFlagInput, L as servedUrl, M as applyPlacementEntries, N as keepsLocalCopy, O as PlacementEntry, P as placementKeys, Q as isRuntimeFlagEnabled, R as servesSlug, S as refreshAppDrives, T as LoadedDocumentModels, U as resolveReactorClientMode, V as REACTOR_CLIENT_STORAGE_KEY, W as REACTOR_WORKER_QUERY_KEY, X as RuntimeFlagInput, Y as isMultiReactorEnabled, Z as RuntimeFlagKeys, _ as LocalReactorFactory, a as getConnectPHStore, b as getAppDrives, c as PlacementRouter, d as caughtUp, f as effectiveBackend, g as CreateAppReactorClientOptions, h as AppReactorClientParams, i as loadLocalPackage, j as SwitchboardDrive, k as ResolveSwitchboardDrivesOptions, l as PlacementStore, m as needsCopy, n as LocalPackageSource, o as DrivePlacement, p as findServedDrive, q as isReactorWorkerEnabled, r as ModuleNamespace, s as DrivePlacements, t as LocalPackage, u as PlacementSync, v as ReactorClientPlan, w as selectAppReactorClient, x as planReactorClient, y as createAppReactorClient, z as switchboardDrives } from "./index-ZFFeYX4A.js";
2
2
  import { A as useDriveRouteData, B as ConnectConfigHooks, C as holdConnectRoutes, D as DRIVE_ROUTE_ID, E as removeConnectRoutes, F as DriveRouteData, G as ConnectPluginUi, H as ConnectPluginContext, I as DriveRouteParams, J as ConnectModals, K as ConnectRouteUi, L as isDriveNotFound, M as ConnectRouterContext, N as DriveLoaderOptions, O as DriveRouteView, P as DriveNotFoundData, R as loadDrive, S as connectRoutesSettled, T as registerPackageRoutes, U as ConnectPluginDefinition, V as ConnectPlugin, W as ConnectPluginFactory, Y as ModalOutlet, _ as ConnectRoutes, a as bindConnectRouter, b as addConnectRoutes, c as applyConnectPluginUi, d as mergeConnectPluginUi, f as resetConnectPluginUi, g as ConnectRootRoute, h as APP_ROUTE_ID, i as ConnectRouterOptions, j as useDriveRouteIds, k as NODE_ROUTE_ID, l as getConnectPluginUi, m as ConnectRouteRegistration, n as ConnectRouterBundle, o as createConnectRouter, q as CORE_MODAL_VIEWS, r as ConnectRouterFor, s as ConnectPluginUiSet, t as ConnectRouter, u as loadConnectPluginUi, v as HOME_ROUTE_ID, w as registerConnectRoutes, x as connectRoutes, y as PackageRoute, z as loadNode } from "./connect-router-11uRIT3z.js";
3
3
  import { a as DrivePending, i as DocumentViewProps, n as ContentOutlet, o as DriveViewProps, r as DRIVE_PENDING_MS, t as CONTENT_VIEW_ID } from "./route-components-1XyfosoL.js";
4
4
  import { $ as disposeConnectAppRouter, A as stringifyConnectSearch, B as ConnectCoreApp, C as useSidebarMode, D as connectSearchMiddlewares, E as GLOBAL_SEARCH_PARAMS, F as CoreRouteOptions, G as isCoreView, H as CoreNotFound, I as coreRouteOptions, J as markNavigationClick, K as PERF_STORAGE_KEY, L as ModalDialog, M as validateDriveSearch, N as bindConnectScroll, O as definedSearch, P as connectScrollRestoration, Q as ConnectAppRouterOptions, R as ModalFrameProps, S as useNavRoutes, T as FEATURE_FLAG_PARAM_PREFIX, U as coreModals, V as CoreError, W as coreView, X as routerPerfEnabled, Y as markRouterNavigations, Z as createConnectNavigation, _ as ConnectNavItem, a as SETTINGS_ROUTE_ID, b as navRoutes, c as redirectToSettingsTab, d as settingsTabsOf, et as getConnectAppRouter, f as settingsTitle, g as ConnectChrome, h as useSettingsTabs, i as ConnectSettingsTab, j as validateConnectSearch, k as parseConnectSearch, l as setSettingsRoute, m as useForgetSettingsOpenedFrom, n as driveTitle, nt as CreateDocumentTarget, o as SettingsTabEntry, p as showsSettingsTab, q as ROUTER_MEASURES, r as notFoundTitle, rt as useCreateDocumentTarget, s as keepOpenedFrom, t as appTitle, tt as useIsColdStart, u as settingsTabs, v as NavRouteEntry, w as ConnectSearch, x as useConnectChrome, y as SidebarMode, z as useModalFrame } from "./index-Bfl1VYdj.js";
@@ -7,5 +7,5 @@ import { i as primeRuntimeConfig, n as getRuntimeConfig, r as loadRuntimeConfig
7
7
  import { n as useBackendAuthGate, t as BackendAuthGateMode } from "./backend-auth-gate-DiFpY5rt.js";
8
8
  import { n as useIsEmbedded, t as getIsEmbedded } from "./embedded-DT1C47F0.js";
9
9
  import { A as NodeView, C as EditorHostProps, D as DirectoryListing, E as HISTORY_PAGE_SIZE, O as DocumentView, S as EditorHost, T as DocumentHistory, _ as CoreRoot, a as CoreRouteError, b as DriveIndex, c as DeleteItemModal, d as DriveAuthRequiredModal, f as LoginModal, g as CoreLayout, h as CoreHeader, i as CoreSettingsPage, k as DriveLayout, l as DocumentVersionUnsupportedModal, m as NotFoundPage, n as PackagesTab, o as ConfirmDocumentUpgradeModal, p as DriveNotFoundPage, r as AppearanceTab, s as CreateDocumentModal, t as ThemeToggle, u as DownloadDocumentWithErrorsModal, v as BackendAuthGate, w as DocumentJson, x as DocumentEditorProps, y as formatModified } from "./index-Beqvfchq.js";
10
- export { APP_ROUTE_ID, type AppReactorClientParams, AppearanceTab, BackendAuthGate, type BackendAuthGateMode, CONTENT_VIEW_ID, CORE_MODAL_VIEWS, ConfirmDocumentUpgradeModal, type ConnectAppRouterOptions, type ConnectChrome, type ConnectConfigHooks, ConnectCoreApp, type ConnectModals, type ConnectNavItem, type ConnectPlugin, type ConnectPluginContext, type ConnectPluginDefinition, type ConnectPluginFactory, type ConnectPluginUi, type ConnectPluginUiSet, type ConnectRootRoute, type ConnectRouteRegistration, type ConnectRouteUi, type ConnectRouter, type ConnectRouterBundle, type ConnectRouterContext, type ConnectRouterFor, type ConnectRouterOptions, type ConnectRoutes, type ConnectSearch, type ConnectSettingsTab, ContentOutlet, CoreError, CoreHeader, CoreLayout, CoreNotFound, CoreRoot, CoreRouteError, type CoreRouteOptions, CoreSettingsPage, type CreateAppReactorClientOptions, CreateDocumentModal, type CreateDocumentTarget, DRIVE_PENDING_MS, DRIVE_ROUTE_ID, DeleteItemModal, DirectoryListing, type DocumentEditorProps, DocumentHistory, DocumentJson, DocumentVersionUnsupportedModal, DocumentView, type DocumentViewProps, DownloadDocumentWithErrorsModal, DriveAuthRequiredModal, DriveIndex, DriveLayout, type DriveLoaderOptions, type DriveNotFoundData, DriveNotFoundPage, DrivePending, type DriveRouteData, type DriveRouteParams, type DriveRouteView, type DriveViewProps, EditorHost, type EditorHostProps, FEATURE_FLAG_PARAM_PREFIX, GLOBAL_SEARCH_PARAMS, HISTORY_PAGE_SIZE, HOME_ROUTE_ID, type LoadedDocumentModels, type LocalPackage, type LocalPackageSource, type LocalReactorFactory, type LocalReactorModule, LoginModal, ModalDialog, type ModalFrameProps, ModalOutlet, type ModuleNamespace, NODE_ROUTE_ID, type NavRouteEntry, NodeView, NotFoundPage, PERF_STORAGE_KEY, type PackageRoute, PackagesTab, REACTOR_CLIENT_QUERY_KEY, REACTOR_CLIENT_STORAGE_KEY, REACTOR_WORKER_QUERY_KEY, REACTOR_WORKER_STORAGE_KEY, ROUTER_MEASURES, type ReactorClientMode, type ReactorClientPlan, type ReactorWorkerFlagInput, type RuntimeFlagInput, type RuntimeFlagKeys, SETTINGS_ROUTE_ID, type SettingsTabEntry, type SidebarMode, ThemeToggle, addConnectRoutes, appTitle, applyComposition, applyConnectPluginUi, bindConnectRouter, bindConnectScroll, connectRoutes, connectRoutesSettled, connectScrollRestoration, connectSearchMiddlewares, coreModals, coreRouteOptions, coreView, createAppReactorClient, createConnectNavigation, createConnectRouter, definedSearch, disposeConnectAppRouter, driveTitle, formatModified, getActivePluginModules, getAppDrives, getConnectAppRouter, getConnectPHStore, getConnectPluginUi, getIsEmbedded, getRuntimeConfig, holdConnectRoutes, isCoreView, isDriveNotFound, isMultiReactorEnabled, isPluginActive, isReactorWorkerEnabled, isRuntimeFlagEnabled, keepOpenedFrom, knownPlugins, loadConnectPluginUi, loadDrive, loadLocalPackage, loadNode, loadRuntimeConfig, markNavigationClick, markRouterNavigations, mergeConnectPluginUi, navRoutes, notFoundTitle, parseConnectSearch, planReactorClient, primeRuntimeConfig, redirectToSettingsTab, refreshAppDrives, registerConnectPlugins, registerConnectRoutes, registerPackageRoutes, relistAppDrives, removeConnectRoutes, resetConnectPluginUi, resolveReactorClientMode, resolveReactorWorkerEnabled, resolveRuntimeFlag, routerPerfEnabled, selectAppReactorClient, setSettingsRoute, settingsTabs, settingsTabsOf, settingsTitle, showsSettingsTab, stringifyConnectSearch, useBackendAuthGate, useConnectChrome, useCreateDocumentTarget, useDriveRouteData, useDriveRouteIds, useForgetSettingsOpenedFrom, useIsColdStart, useIsEmbedded, useModalFrame, useNavRoutes, useSettingsTabs, useSidebarMode, validateConnectSearch, validateDriveSearch };
10
+ export { APP_ROUTE_ID, type AppReactorClientParams, AppearanceTab, BackendAuthGate, type BackendAuthGateMode, CONTENT_VIEW_ID, CORE_MODAL_VIEWS, ConfirmDocumentUpgradeModal, type ConnectAppRouterOptions, type ConnectChrome, type ConnectConfigHooks, ConnectCoreApp, type ConnectModals, type ConnectNavItem, type ConnectPlugin, type ConnectPluginContext, type ConnectPluginDefinition, type ConnectPluginFactory, type ConnectPluginUi, type ConnectPluginUiSet, type ConnectRootRoute, type ConnectRouteRegistration, type ConnectRouteUi, type ConnectRouter, type ConnectRouterBundle, type ConnectRouterContext, type ConnectRouterFor, type ConnectRouterOptions, type ConnectRoutes, type ConnectSearch, type ConnectSettingsTab, ContentOutlet, CoreError, CoreHeader, CoreLayout, CoreNotFound, CoreRoot, CoreRouteError, type CoreRouteOptions, CoreSettingsPage, type CreateAppReactorClientOptions, CreateDocumentModal, type CreateDocumentTarget, DRIVE_PENDING_MS, DRIVE_ROUTE_ID, DeleteItemModal, DirectoryListing, type DocumentEditorProps, DocumentHistory, DocumentJson, DocumentVersionUnsupportedModal, DocumentView, type DocumentViewProps, DownloadDocumentWithErrorsModal, DriveAuthRequiredModal, DriveIndex, DriveLayout, type DriveLoaderOptions, type DriveNotFoundData, DriveNotFoundPage, DrivePending, type DrivePlacement, DrivePlacements, type DriveRouteData, type DriveRouteParams, type DriveRouteView, type DriveViewProps, EditorHost, type EditorHostProps, FEATURE_FLAG_PARAM_PREFIX, GLOBAL_SEARCH_PARAMS, HISTORY_PAGE_SIZE, HOME_ROUTE_ID, LOCAL_BACKEND_NAME, type LoadedDocumentModels, type LocalPackage, type LocalPackageSource, type LocalReactorFactory, type LocalReactorModule, LoginModal, ModalDialog, type ModalFrameProps, ModalOutlet, type ModuleNamespace, NODE_ROUTE_ID, type NavRouteEntry, NodeView, NotFoundPage, PERF_STORAGE_KEY, type PackageRoute, PackagesTab, type PlacementEntry, type PlacementRouter, type PlacementStore, type PlacementSync, REACTOR_CLIENT_QUERY_KEY, REACTOR_CLIENT_STORAGE_KEY, REACTOR_WORKER_QUERY_KEY, REACTOR_WORKER_STORAGE_KEY, ROUTER_MEASURES, type ReactorClientMode, type ReactorClientPlan, type ReactorWorkerFlagInput, type ResolveSwitchboardDrivesOptions, type ResolvedSwitchboardDrive, type RuntimeFlagInput, type RuntimeFlagKeys, SETTINGS_ROUTE_ID, type SettingsTabEntry, type SidebarMode, type SwitchboardDrive, ThemeToggle, addConnectRoutes, appTitle, applyComposition, applyConnectPluginUi, applyPlacementEntries, bindConnectRouter, bindConnectScroll, caughtUp, connectRoutes, connectRoutesSettled, connectScrollRestoration, connectSearchMiddlewares, coreModals, coreRouteOptions, coreView, createAppReactorClient, createConnectNavigation, createConnectRouter, definedSearch, disposeConnectAppRouter, driveTitle, effectiveBackend, findServedDrive, formatModified, getActivePluginModules, getAppDrives, getConnectAppRouter, getConnectPHStore, getConnectPluginUi, getIsEmbedded, getRuntimeConfig, holdConnectRoutes, isCoreView, isDriveNotFound, isMultiReactorEnabled, isPluginActive, isReactorWorkerEnabled, isRuntimeFlagEnabled, keepOpenedFrom, keepsLocalCopy, knownPlugins, loadConnectPluginUi, loadDrive, loadLocalPackage, loadNode, loadRuntimeConfig, markNavigationClick, markRouterNavigations, mergeConnectPluginUi, navRoutes, needsCopy, notFoundTitle, parseConnectSearch, placementKeys, planReactorClient, primeRuntimeConfig, redirectToSettingsTab, refreshAppDrives, registerConnectPlugins, registerConnectRoutes, registerPackageRoutes, relistAppDrives, removeConnectRoutes, removeLocalCopies, resetConnectPluginUi, resolveReactorClientMode, resolveReactorWorkerEnabled, resolveRuntimeFlag, resolveSwitchboardDrives, routerPerfEnabled, selectAppReactorClient, servedUrl, servesSlug, setSettingsRoute, settingsTabs, settingsTabsOf, settingsTitle, showsSettingsTab, stringifyConnectSearch, switchboardDrives, useBackendAuthGate, useConnectChrome, useCreateDocumentTarget, useDriveRouteData, useDriveRouteIds, useForgetSettingsOpenedFrom, useIsColdStart, useIsEmbedded, useModalFrame, useNavRoutes, useSettingsTabs, useSidebarMode, validateConnectSearch, validateDriveSearch };
11
11
  export {};
package/dist/index.js CHANGED
@@ -8,6 +8,6 @@ import { getIsEmbedded, useIsEmbedded } from "./embedded.js";
8
8
  import { getRuntimeConfig, loadRuntimeConfig, primeRuntimeConfig } from "./runtime-config.js";
9
9
  import { n as isPluginActive, t as getActivePluginModules } from "./plugins-x1XqLPzp.js";
10
10
  import { n as resolveRuntimeFlag, t as isRuntimeFlagEnabled } from "./runtime-flag-DvxW_SD4.js";
11
- import { a as planReactorClient, c as selectAppReactorClient, d as resolveReactorClientMode, f as REACTOR_WORKER_QUERY_KEY, g as isMultiReactorEnabled, h as resolveReactorWorkerEnabled, i as getAppDrives, l as REACTOR_CLIENT_QUERY_KEY, m as isReactorWorkerEnabled, n as getConnectPHStore, o as refreshAppDrives, p as REACTOR_WORKER_STORAGE_KEY, r as createAppReactorClient, s as relistAppDrives, t as loadLocalPackage, u as REACTOR_CLIENT_STORAGE_KEY } from "./runtime-D20_LlB_.js";
11
+ import { A as isMultiReactorEnabled, C as REACTOR_CLIENT_QUERY_KEY, D as REACTOR_WORKER_STORAGE_KEY, E as REACTOR_WORKER_QUERY_KEY, O as isReactorWorkerEnabled, S as selectAppReactorClient, T as resolveReactorClientMode, _ as createAppReactorClient, a as effectiveBackend, b as refreshAppDrives, c as LOCAL_BACKEND_NAME, d as placementKeys, f as removeLocalCopies, g as switchboardDrives, h as servesSlug, i as caughtUp, k as resolveReactorWorkerEnabled, l as applyPlacementEntries, m as servedUrl, n as getConnectPHStore, o as findServedDrive, p as resolveSwitchboardDrives, r as DrivePlacements, s as needsCopy, t as loadLocalPackage, u as keepsLocalCopy, v as getAppDrives, w as REACTOR_CLIENT_STORAGE_KEY, x as relistAppDrives, y as planReactorClient } from "./runtime-LvAkxbdf.js";
12
12
  import { t as useBackendAuthGate } from "./backend-auth-gate-DNKg_v4Y.js";
13
- export { APP_ROUTE_ID, AppearanceTab, BackendAuthGate, CONTENT_VIEW_ID, CORE_MODAL_VIEWS, ConfirmDocumentUpgradeModal, ConnectCoreApp, ContentOutlet, CoreError, CoreHeader, CoreLayout, CoreNotFound, CoreRoot, CoreRouteError, CoreSettingsPage, CreateDocumentModal, DRIVE_PENDING_MS, DRIVE_ROUTE_ID, DeleteItemModal, DirectoryListing, DocumentHistory, DocumentJson, DocumentVersionUnsupportedModal, DocumentView, DownloadDocumentWithErrorsModal, DriveAuthRequiredModal, DriveIndex, DriveLayout, DriveNotFoundPage, DrivePending, EditorHost, FEATURE_FLAG_PARAM_PREFIX, GLOBAL_SEARCH_PARAMS, HISTORY_PAGE_SIZE, HOME_ROUTE_ID, LoginModal, ModalDialog, ModalOutlet, NODE_ROUTE_ID, NodeView, NotFoundPage, PERF_STORAGE_KEY, PackagesTab, REACTOR_CLIENT_QUERY_KEY, REACTOR_CLIENT_STORAGE_KEY, REACTOR_WORKER_QUERY_KEY, REACTOR_WORKER_STORAGE_KEY, ROUTER_MEASURES, SETTINGS_ROUTE_ID, ThemeToggle, addConnectRoutes, appTitle, applyComposition, applyConnectPluginUi, bindConnectRouter, bindConnectScroll, connectRoutes, connectRoutesSettled, connectScrollRestoration, connectSearchMiddlewares, coreModals, coreRouteOptions, coreView, createAppReactorClient, createConnectNavigation, createConnectRouter, definedSearch, disposeConnectAppRouter, driveTitle, formatModified, getActivePluginModules, getAppDrives, getConnectAppRouter, getConnectPHStore, getConnectPluginUi, getIsEmbedded, getRuntimeConfig, holdConnectRoutes, isCoreView, isDriveNotFound, isMultiReactorEnabled, isPluginActive, isReactorWorkerEnabled, isRuntimeFlagEnabled, keepOpenedFrom, knownPlugins, loadConnectPluginUi, loadDrive, loadLocalPackage, loadNode, loadRuntimeConfig, markNavigationClick, markRouterNavigations, mergeConnectPluginUi, navRoutes, notFoundTitle, parseConnectSearch, planReactorClient, primeRuntimeConfig, redirectToSettingsTab, refreshAppDrives, registerConnectPlugins, registerConnectRoutes, registerPackageRoutes, relistAppDrives, removeConnectRoutes, resetConnectPluginUi, resolveReactorClientMode, resolveReactorWorkerEnabled, resolveRuntimeFlag, routerPerfEnabled, selectAppReactorClient, setSettingsRoute, settingsTabs, settingsTabsOf, settingsTitle, showsSettingsTab, stringifyConnectSearch, useBackendAuthGate, useConnectChrome, useCreateDocumentTarget, useDriveRouteData, useDriveRouteIds, useForgetSettingsOpenedFrom, useIsColdStart, useIsEmbedded, useModalFrame, useNavRoutes, useSettingsTabs, useSidebarMode, validateConnectSearch, validateDriveSearch };
13
+ export { APP_ROUTE_ID, AppearanceTab, BackendAuthGate, CONTENT_VIEW_ID, CORE_MODAL_VIEWS, ConfirmDocumentUpgradeModal, ConnectCoreApp, ContentOutlet, CoreError, CoreHeader, CoreLayout, CoreNotFound, CoreRoot, CoreRouteError, CoreSettingsPage, CreateDocumentModal, DRIVE_PENDING_MS, DRIVE_ROUTE_ID, DeleteItemModal, DirectoryListing, DocumentHistory, DocumentJson, DocumentVersionUnsupportedModal, DocumentView, DownloadDocumentWithErrorsModal, DriveAuthRequiredModal, DriveIndex, DriveLayout, DriveNotFoundPage, DrivePending, DrivePlacements, EditorHost, FEATURE_FLAG_PARAM_PREFIX, GLOBAL_SEARCH_PARAMS, HISTORY_PAGE_SIZE, HOME_ROUTE_ID, LOCAL_BACKEND_NAME, LoginModal, ModalDialog, ModalOutlet, NODE_ROUTE_ID, NodeView, NotFoundPage, PERF_STORAGE_KEY, PackagesTab, REACTOR_CLIENT_QUERY_KEY, REACTOR_CLIENT_STORAGE_KEY, REACTOR_WORKER_QUERY_KEY, REACTOR_WORKER_STORAGE_KEY, ROUTER_MEASURES, SETTINGS_ROUTE_ID, ThemeToggle, addConnectRoutes, appTitle, applyComposition, applyConnectPluginUi, applyPlacementEntries, bindConnectRouter, bindConnectScroll, caughtUp, connectRoutes, connectRoutesSettled, connectScrollRestoration, connectSearchMiddlewares, coreModals, coreRouteOptions, coreView, createAppReactorClient, createConnectNavigation, createConnectRouter, definedSearch, disposeConnectAppRouter, driveTitle, effectiveBackend, findServedDrive, formatModified, getActivePluginModules, getAppDrives, getConnectAppRouter, getConnectPHStore, getConnectPluginUi, getIsEmbedded, getRuntimeConfig, holdConnectRoutes, isCoreView, isDriveNotFound, isMultiReactorEnabled, isPluginActive, isReactorWorkerEnabled, isRuntimeFlagEnabled, keepOpenedFrom, keepsLocalCopy, knownPlugins, loadConnectPluginUi, loadDrive, loadLocalPackage, loadNode, loadRuntimeConfig, markNavigationClick, markRouterNavigations, mergeConnectPluginUi, navRoutes, needsCopy, notFoundTitle, parseConnectSearch, placementKeys, planReactorClient, primeRuntimeConfig, redirectToSettingsTab, refreshAppDrives, registerConnectPlugins, registerConnectRoutes, registerPackageRoutes, relistAppDrives, removeConnectRoutes, removeLocalCopies, resetConnectPluginUi, resolveReactorClientMode, resolveReactorWorkerEnabled, resolveRuntimeFlag, resolveSwitchboardDrives, routerPerfEnabled, selectAppReactorClient, servedUrl, servesSlug, setSettingsRoute, settingsTabs, settingsTabsOf, settingsTitle, showsSettingsTab, stringifyConnectSearch, switchboardDrives, useBackendAuthGate, useConnectChrome, useCreateDocumentTarget, useDriveRouteData, useDriveRouteIds, useForgetSettingsOpenedFrom, useIsColdStart, useIsEmbedded, useModalFrame, useNavRoutes, useSettingsTabs, useSidebarMode, validateConnectSearch, validateDriveSearch };
@@ -0,0 +1,129 @@
1
+ import { c as LOCAL_BACKEND_NAME } from "./runtime-LvAkxbdf.js";
2
+ import { ambientRenownSigner, ambientRenownTokenProvider, createSwitchboardBackend } from "@powerhousedao/reactor-browser";
3
+ import { logger } from "document-model";
4
+ import { switchboardOfDrive } from "@powerhousedao/shared/host-tokens";
5
+ import { createReactorInspector } from "@powerhousedao/reactor";
6
+ import { FanInPartialFailureError, RoutingReactorClient, fromReactorClient } from "@powerhousedao/reactor-router";
7
+ //#region src/runtime/multi-reactor.ts
8
+ const REMOTE_BACKEND_NAME = "switchboard-remote";
9
+ /** Only the tab's reactor is inspectable here, so new collections land on it. */
10
+ const PLACE_ON_LOCAL = Object.freeze({ inspectable: true });
11
+ function localReach(kind) {
12
+ return kind === "worker" ? {
13
+ hosting: "worker",
14
+ inspection: "rpc"
15
+ } : {
16
+ hosting: "in-process",
17
+ inspection: "direct"
18
+ };
19
+ }
20
+ /** Read at every refresh, never kept: a rebuilt reactor reports its own. */
21
+ function localFacts(module) {
22
+ if (module.kind === "worker") return () => module.inspector.info();
23
+ return async () => {
24
+ const reactorModule = module.reactorModule;
25
+ if (!reactorModule) throw new Error("The in-tab reactor exposes no module to inspect");
26
+ return createReactorInspector(reactorModule).info();
27
+ };
28
+ }
29
+ /** `<origin>[/<prefix>]/d/<slug>` -> `<origin>[/<prefix>]/graphql`. */
30
+ function deriveSwitchboardGraphqlUrl(remoteDriveUrl) {
31
+ return switchboardOfDrive(remoteDriveUrl)?.graphql;
32
+ }
33
+ /** Remote-only placement: the Switchboard serves every collection. (It offers
34
+ * no inspection surface over GraphQL, so PLACE_ON_LOCAL's `inspectable`
35
+ * requirement must NOT apply, or no backend would be eligible.) */
36
+ const PLACE_ON_REMOTE = Object.freeze({});
37
+ /**
38
+ * The local answer stands when only the Switchboard could not answer -- but
39
+ * only when there IS a local backend. Remote-only has nothing to fall back to,
40
+ * so its errors surface. Installed as the router's `answerFailedIdCheck`, so
41
+ * the facade and `write.isDocumentIdTaken` both apply it.
42
+ */
43
+ function localIdCheckAnswer(documentId, error, remoteNames) {
44
+ if (!failedOnlyOnRemote(error, remoteNames)) return;
45
+ logger.warn("The Switchboard could not say whether @id is taken; using the local reactor's answer: @error", documentId, error);
46
+ return false;
47
+ }
48
+ /** The router Connect installs, with Connect's handling of credentials and id checks. */
49
+ var ConnectRoutingClient = class extends RoutingReactorClient {
50
+ remotes;
51
+ constructor(backends, options, remotes, hasLocal) {
52
+ const remoteNames = new Set(remotes.map((remote) => remote.config.name));
53
+ super(backends, {
54
+ ...options,
55
+ answerFailedIdCheck: hasLocal ? (id, error) => localIdCheckAnswer(id, error, remoteNames) : options.answerFailedIdCheck
56
+ });
57
+ this.remotes = remotes;
58
+ }
59
+ /** Renown's sign-in and sign-out call this on whatever client is installed. */
60
+ notifyCredentialsChanged() {
61
+ for (const remote of this.remotes) remote.notifyCredentialsChanged();
62
+ }
63
+ };
64
+ function failedOnlyOnRemote(error, remoteNames) {
65
+ return error instanceof FanInPartialFailureError && error.failures.every((failure) => remoteNames.has(failure.backend));
66
+ }
67
+ /** The remotes to build, one per switchboard: the first link to a base wins. */
68
+ function remotesOf(params) {
69
+ const listed = params.remotes?.length ? params.remotes : params.remoteGraphqlUrl ? [{
70
+ name: REMOTE_BACKEND_NAME,
71
+ graphqlUrl: params.remoteGraphqlUrl
72
+ }] : [];
73
+ const seen = /* @__PURE__ */ new Set();
74
+ return listed.filter((remote) => {
75
+ if (seen.has(remote.graphqlUrl)) {
76
+ logger.warn("@name opens the same switchboard as an earlier backend; skipping it", remote.name);
77
+ return false;
78
+ }
79
+ seen.add(remote.graphqlUrl);
80
+ return true;
81
+ });
82
+ }
83
+ /**
84
+ * Build the Connect routing client. With a local `module` it is the router
85
+ * over the tab's reactor (primary) and the Switchboard; WITHOUT one it is the
86
+ * `remote` client — a remote-only router whose single backend is the
87
+ * Switchboard, so no local reactor (and no PGlite) is built. Either way the
88
+ * result is a full IReactorClient the app graph consumes unchanged.
89
+ */
90
+ async function buildMultiReactorClient(params) {
91
+ const module = params.module;
92
+ const registry = module?.reactorModule?.documentModelRegistry;
93
+ const loaded = params.documentModelModules;
94
+ const loadedModules = typeof loaded === "function" ? loaded : () => loaded;
95
+ const listed = remotesOf(params);
96
+ if (listed.length === 0) throw new Error("A routing client needs at least one switchboard");
97
+ const remotes = listed.map((remote) => createSwitchboardBackend({
98
+ name: remote.name,
99
+ url: remote.graphqlUrl,
100
+ tokenProvider: ambientRenownTokenProvider,
101
+ signer: ambientRenownSigner,
102
+ documentModels: () => registry?.getAllModules() ?? loadedModules(),
103
+ inspection: "none"
104
+ }));
105
+ const remoteBackends = remotes.map((remote) => remote.config);
106
+ const backends = module ? [{
107
+ name: LOCAL_BACKEND_NAME,
108
+ backend: fromReactorClient(module.client),
109
+ facts: localFacts(module),
110
+ reach: localReach(module.kind),
111
+ refusesMisroutes: false
112
+ }, ...remoteBackends] : remoteBackends;
113
+ const names = new Set(backends.map((backend) => backend.name));
114
+ const collections = Object.fromEntries(Object.entries(params.collections ?? {}).filter(([, backend]) => names.has(backend)));
115
+ const router = new ConnectRoutingClient(backends, {
116
+ primaryBackend: module ? LOCAL_BACKEND_NAME : remoteBackends[0].name,
117
+ defaultRequirements: module ? PLACE_ON_LOCAL : PLACE_ON_REMOTE,
118
+ collections,
119
+ signer: params.signer,
120
+ onDiagnostic: params.onDiagnostic,
121
+ documentModelModules: module ? void 0 : loadedModules
122
+ }, remotes, Boolean(module));
123
+ await router.refreshFacts();
124
+ return router;
125
+ }
126
+ //#endregion
127
+ export { ConnectRoutingClient, LOCAL_BACKEND_NAME, PLACE_ON_LOCAL, PLACE_ON_REMOTE, REMOTE_BACKEND_NAME, buildMultiReactorClient, deriveSwitchboardGraphqlUrl, localFacts, localReach };
128
+
129
+ //# sourceMappingURL=multi-reactor-Dvwv69u1.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"multi-reactor-Dvwv69u1.js","names":[],"sources":["../src/runtime/multi-reactor.ts"],"sourcesContent":["import {\n createReactorInspector,\n type ReactorInfo,\n} from \"@powerhousedao/reactor\";\nimport {\n ambientRenownSigner,\n ambientRenownTokenProvider,\n createSwitchboardBackend,\n type BrowserReactorClientModule,\n type SwitchboardBackend,\n type WorkerReactorClientModule,\n} from \"@powerhousedao/reactor-browser\";\nimport {\n FanInPartialFailureError,\n fromReactorClient,\n RoutingReactorClient,\n type CollectionRequirementsInput,\n type ReactorReach,\n type RoutableBackendConfig,\n type RouterDiagnostic,\n type RoutingClientOptions,\n} from \"@powerhousedao/reactor-router\";\nimport type {\n DocumentModelModule,\n ISigner,\n} from \"@powerhousedao/shared/document-model\";\nimport { switchboardOfDrive } from \"@powerhousedao/shared/host-tokens\";\nimport { logger } from \"document-model\";\nimport { LOCAL_BACKEND_NAME } from \"./drive-placement.js\";\n\nexport { LOCAL_BACKEND_NAME } from \"./drive-placement.js\";\nexport const REMOTE_BACKEND_NAME = \"switchboard-remote\";\n\nexport type LocalReactorModule =\n | BrowserReactorClientModule\n | WorkerReactorClientModule;\n\n/** Only the tab's reactor is inspectable here, so new collections land on it. */\nexport const PLACE_ON_LOCAL: CollectionRequirementsInput = Object.freeze({\n inspectable: true,\n});\n\nexport function localReach(kind: LocalReactorModule[\"kind\"]): ReactorReach {\n return kind === \"worker\"\n ? { hosting: \"worker\", inspection: \"rpc\" }\n : { hosting: \"in-process\", inspection: \"direct\" };\n}\n\n/** Read at every refresh, never kept: a rebuilt reactor reports its own. */\nexport function localFacts(\n module: LocalReactorModule,\n): () => Promise<ReactorInfo> {\n if (module.kind === \"worker\") {\n return () => module.inspector.info();\n }\n return async () => {\n const reactorModule = module.reactorModule;\n if (!reactorModule) {\n throw new Error(\"The in-tab reactor exposes no module to inspect\");\n }\n return createReactorInspector(reactorModule).info();\n };\n}\n\n/** `<origin>[/<prefix>]/d/<slug>` -> `<origin>[/<prefix>]/graphql`. */\nexport function deriveSwitchboardGraphqlUrl(\n remoteDriveUrl: string,\n): string | undefined {\n return switchboardOfDrive(remoteDriveUrl)?.graphql;\n}\n\n/** A switchboard the router reaches, by its router backend name. */\nexport type SwitchboardRemote = { name: string; graphqlUrl: string };\n\n/** The loaded document models, or a getter that reads the current ones. */\nexport type LoadedDocumentModels =\n | readonly DocumentModelModule[]\n | (() => readonly DocumentModelModule[]);\n\nexport type MultiReactorParams = {\n /** The local module, built and ready. Undefined builds a REMOTE-ONLY router\n * (no local backend → no local reactor, no PGlite): the `remote` client. */\n module: LocalReactorModule | undefined;\n /** One per switchboard; `remoteGraphqlUrl` alone is one named `switchboard-remote`. */\n remotes?: readonly SwitchboardRemote[];\n remoteGraphqlUrl?: string;\n /** Collection key or drive id -> backend; names no backend here are dropped. */\n collections?: Readonly<Record<string, string>>;\n /** Signs routed writes; unsigned (anonymous) without one. */\n signer?: ISigner;\n /** Signing models when the local module exposes no registry; the router asks the local reactor (or, remote-only, the loaded set). */\n documentModelModules: LoadedDocumentModels;\n onDiagnostic?: RouterDiagnostic;\n};\n\n/** Remote-only placement: the Switchboard serves every collection. (It offers\n * no inspection surface over GraphQL, so PLACE_ON_LOCAL's `inspectable`\n * requirement must NOT apply, or no backend would be eligible.) */\nexport const PLACE_ON_REMOTE: CollectionRequirementsInput = Object.freeze({});\n\n/**\n * The local answer stands when only the Switchboard could not answer -- but\n * only when there IS a local backend. Remote-only has nothing to fall back to,\n * so its errors surface. Installed as the router's `answerFailedIdCheck`, so\n * the facade and `write.isDocumentIdTaken` both apply it.\n */\nfunction localIdCheckAnswer(\n documentId: string,\n error: unknown,\n remoteNames: ReadonlySet<string>,\n): boolean | undefined {\n if (!failedOnlyOnRemote(error, remoteNames)) {\n return undefined;\n }\n logger.warn(\n \"The Switchboard could not say whether @id is taken; using the local reactor's answer: @error\",\n documentId,\n error,\n );\n return false;\n}\n\n/** The router Connect installs, with Connect's handling of credentials and id checks. */\nexport class ConnectRoutingClient extends RoutingReactorClient {\n private readonly remotes: readonly SwitchboardBackend[];\n\n constructor(\n backends: readonly RoutableBackendConfig[],\n options: RoutingClientOptions,\n remotes: readonly SwitchboardBackend[],\n hasLocal: boolean,\n ) {\n const remoteNames = new Set(remotes.map((remote) => remote.config.name));\n super(backends, {\n ...options,\n answerFailedIdCheck: hasLocal\n ? (id, error) => localIdCheckAnswer(id, error, remoteNames)\n : options.answerFailedIdCheck,\n });\n this.remotes = remotes;\n }\n\n /** Renown's sign-in and sign-out call this on whatever client is installed. */\n notifyCredentialsChanged(): void {\n for (const remote of this.remotes) remote.notifyCredentialsChanged();\n }\n}\n\nfunction failedOnlyOnRemote(\n error: unknown,\n remoteNames: ReadonlySet<string>,\n): boolean {\n return (\n error instanceof FanInPartialFailureError &&\n error.failures.every((failure) => remoteNames.has(failure.backend))\n );\n}\n\n/** The remotes to build, one per switchboard: the first link to a base wins. */\nfunction remotesOf(params: MultiReactorParams): SwitchboardRemote[] {\n const listed: readonly SwitchboardRemote[] = params.remotes?.length\n ? params.remotes\n : params.remoteGraphqlUrl\n ? [{ name: REMOTE_BACKEND_NAME, graphqlUrl: params.remoteGraphqlUrl }]\n : [];\n const seen = new Set<string>();\n return listed.filter((remote) => {\n if (seen.has(remote.graphqlUrl)) {\n logger.warn(\n \"@name opens the same switchboard as an earlier backend; skipping it\",\n remote.name,\n );\n return false;\n }\n seen.add(remote.graphqlUrl);\n return true;\n });\n}\n\n/**\n * Build the Connect routing client. With a local `module` it is the router\n * over the tab's reactor (primary) and the Switchboard; WITHOUT one it is the\n * `remote` client — a remote-only router whose single backend is the\n * Switchboard, so no local reactor (and no PGlite) is built. Either way the\n * result is a full IReactorClient the app graph consumes unchanged.\n */\nexport async function buildMultiReactorClient(\n params: MultiReactorParams,\n): Promise<ConnectRoutingClient> {\n const module = params.module;\n const registry = module?.reactorModule?.documentModelRegistry;\n const loaded = params.documentModelModules;\n const loadedModules = typeof loaded === \"function\" ? loaded : () => loaded;\n const listed = remotesOf(params);\n if (listed.length === 0) {\n throw new Error(\"A routing client needs at least one switchboard\");\n }\n // The logged-in Renown user's token and signer, read per request as before.\n const remotes = listed.map((remote) =>\n createSwitchboardBackend({\n name: remote.name,\n url: remote.graphqlUrl,\n tokenProvider: ambientRenownTokenProvider,\n signer: ambientRenownSigner,\n documentModels: () => registry?.getAllModules() ?? loadedModules(),\n inspection: \"none\",\n }),\n );\n const remoteBackends = remotes.map((remote) => remote.config);\n const backends: RoutableBackendConfig[] = module\n ? [\n {\n name: LOCAL_BACKEND_NAME,\n backend: fromReactorClient(module.client),\n facts: localFacts(module),\n reach: localReach(module.kind),\n refusesMisroutes: false,\n },\n ...remoteBackends,\n ]\n : remoteBackends;\n const names = new Set(backends.map((backend) => backend.name));\n const collections = Object.fromEntries(\n Object.entries(params.collections ?? {}).filter(([, backend]) =>\n names.has(backend),\n ),\n );\n const router = new ConnectRoutingClient(\n backends,\n {\n // Remote-only: the first Switchboard is primary; with a local reactor,\n // new collections land on it (inspectable).\n primaryBackend: module ? LOCAL_BACKEND_NAME : remoteBackends[0].name,\n defaultRequirements: module ? PLACE_ON_LOCAL : PLACE_ON_REMOTE,\n collections,\n signer: params.signer,\n onDiagnostic: params.onDiagnostic,\n // The Switchboard serves no models over GraphQL; remote-only uses the loaded set.\n documentModelModules: module ? undefined : loadedModules,\n },\n remotes,\n Boolean(module),\n );\n await router.refreshFacts();\n return router;\n}\n"],"mappings":"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"}