@devframes/hub 0.9.4 → 0.9.6

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.
@@ -1,6 +1,6 @@
1
- import { E as DevframeMessagesClient, x as DevframeMessageEntryInput } from "../context-BVkxwz5k.mjs";
1
+ import { E as DevframeMessagesClient, x as DevframeMessageEntryInput } from "../context-D5JSW_X5.mjs";
2
2
  import { N as NavTarget, P as RemoteConnectionInfo, S as DevframeDockUserEntry, _ as DevframeDockEntry, a as DevframeCommandEntry, b as DevframeDockEntryIcon, g as DevframeDockEntriesGrouped, k as DevframeViewIframe, n as DevframeClientCommand, p as ClientScriptEntry, s as DevframeCommandKeybinding, t as DevframeDocksUserSettings } from "../settings-D7whfcx2.mjs";
3
- import "../index-CyEyZHB3.mjs";
3
+ import "../index-DhxIxS-Q.mjs";
4
4
  import { DevframeClientRpcHost, DevframeConnection, DevframeConnectionStatus, DevframeRpcClient, DevframeRpcClientOptions, DevframeRpcContext, RpcClientEvents, RpcClientEvents as RpcClientEvents$1 } from "devframe/client";
5
5
  import { EventEmitter } from "devframe/types";
6
6
  import { SharedState } from "devframe/utils/shared-state";
@@ -144,7 +144,7 @@ interface CreateDockRenderersContextOptions {
144
144
  }
145
145
  /**
146
146
  * Build the {@link DockRenderersContext} shared by every hub-aware client —
147
- * `createDevframeClientHost` and viewers that assemble their own context
147
+ * `createDevframeClientRuntime` and hub UI providers that assemble their own context
148
148
  * (`@devframes/hub-ui`) both delegate here so local-first resolution, lazy
149
149
  * manifest imports, and the typed mount result behave identically everywhere.
150
150
  */
@@ -162,7 +162,7 @@ interface DockPanelStorage {
162
162
  }
163
163
  /**
164
164
  * Per-tab UI state of the dock panel, distinct from the browser-shared geometry
165
- * in {@link DockPanelStorage}. A viewer persists this to `sessionStorage` so a
165
+ * in {@link DockPanelStorage}. A hub UI provider persists this to `sessionStorage` so a
166
166
  * reload (or the RPC auth handshake that follows one) restores the panel to
167
167
  * exactly where the developer left it — which dock was open, and the
168
168
  * address-bar route of that dock's iframe. Kept `sessionStorage`-scoped (not
@@ -208,7 +208,7 @@ interface DocksContext extends DevframeRpcContext {
208
208
  */
209
209
  readonly when: WhenClauseContext;
210
210
  /**
211
- * The live connection status of the underlying devframe client, so a viewer
211
+ * The live connection status of the underlying RPC client, so a hub UI provider
212
212
  * can render one central connection indicator for every docked plugin
213
213
  * instead of each plugin surfacing its own.
214
214
  */
@@ -244,7 +244,7 @@ interface DocksPanelContext {
244
244
  /**
245
245
  * Per-tab session UI state — whether the panel is open, which dock is
246
246
  * selected, and that dock's iframe route. Restored across reloads (and the
247
- * auth handshake that follows one) by a viewer that persists it to
247
+ * auth handshake that follows one) by a hub UI provider that persists it to
248
248
  * `sessionStorage`.
249
249
  */
250
250
  session: DockSessionStorage;
@@ -272,7 +272,7 @@ interface DocksEntriesContext {
272
272
  * The resolved top-level category ordering — `DEFAULT_CATEGORIES_ORDER`,
273
273
  * overridden by every installed devframe's own `dock.categoryOrder`
274
274
  * (`ConnectionMeta.configs.dock.categoryOrder`), overridden again by the
275
- * host page's own `createDevframeClientHost({ categoryOrder })`. Fixed
275
+ * host page's own `createDevframeClientRuntime({ categoryOrder })`. Fixed
276
276
  * for the life of the session — resolved once at boot.
277
277
  */
278
278
  readonly categoryOrder: Record<string, number>;
@@ -299,7 +299,7 @@ interface DocksEntriesContext {
299
299
  * {@link entries}. Unlike a dock registered on the node
300
300
  * {@link import('../types/docks').DevframeDocksHost}, it never flows into
301
301
  * shared state, so it stays local to this client instead of syncing to the
302
- * hub or other viewers — for a view a client host synthesizes itself.
302
+ * hub or other hub UI providers — for a view the client runtime synthesizes itself.
303
303
  *
304
304
  * Throws when `id` already names a client dock, unless `force` is set. A
305
305
  * client dock sharing an id with a server dock overrides it in the local
@@ -393,8 +393,8 @@ declare const CLIENT_CONTEXT_KEY = "__DEVFRAME_HUB_CLIENT_CONTEXT__";
393
393
  declare function getDevframeClientContext(): DevframeClientContext | undefined;
394
394
  /**
395
395
  * Publish the global Devframe client context (or clear it with `undefined`).
396
- * Called by {@link import('./host').createDevframeClientHost}; a dock client
397
- * script or a viewer reads it back with {@link getDevframeClientContext}.
396
+ * Called by {@link import('./host').createDevframeClientRuntime}; a dock client
397
+ * script or a hub UI provider reads it back with {@link getDevframeClientContext}.
398
398
  */
399
399
  declare function setDevframeClientContext(ctx: DevframeClientContext | undefined): void;
400
400
  //#endregion
@@ -483,7 +483,7 @@ declare function watchFrameLocation(options: WatchFrameLocationOptions): () => v
483
483
  //#endregion
484
484
  //#region src/client/frame-nav.d.ts
485
485
  /**
486
- * Shared-iframe soft navigation — the viewer-side half of a host↔iframe
486
+ * Shared-iframe soft navigation — the hub-UI-provider-side half of a host-page↔iframe
487
487
  * `postMessage` protocol.
488
488
  *
489
489
  * An {@link DevframeViewIframe.subTabs anchor} iframe dock owns one live iframe
@@ -603,7 +603,7 @@ interface FrameNavClient {
603
603
  declare function attachFrameNavClient(options: FrameNavClientOptions): FrameNavClient;
604
604
  //#endregion
605
605
  //#region src/client/host.d.ts
606
- interface DevframeClientHostOptions {
606
+ interface DevframeClientRuntimeOptions {
607
607
  /**
608
608
  * An already-connected RPC client. When omitted, one is created via
609
609
  * `connectDevframe(connect)` — pass `connect.baseURL` to point at the hub's
@@ -625,7 +625,7 @@ interface DevframeClientHostOptions {
625
625
  loadClientScripts?: boolean;
626
626
  /**
627
627
  * Resolve a **bare-specifier** client script (`importFrom` naming an npm
628
- * module) to a URL this page can import — a viewer's own policy, winning
628
+ * module) to a URL this page can import — a hub UI provider's own policy, winning
629
629
  * over the host-advertised `ConnectionMeta.configs.dock.clientModuleResolution`
630
630
  * template (return `undefined` to fall through to it). URL specifiers never
631
631
  * reach this hook. E.g. on a Vite-served page:
@@ -660,28 +660,34 @@ interface DevframeClientHostOptions {
660
660
  * @example
661
661
  * ```ts
662
662
  * // Surface `data` tools ahead of `app` tools, hub-wide.
663
- * createDevframeClientHost({ categoryOrder: { data: 50 } })
663
+ * createDevframeClientRuntime({ categoryOrder: { data: 50 } })
664
664
  * ```
665
665
  */
666
666
  categoryOrder?: Record<string, number>;
667
667
  }
668
- interface DevframeClientHost {
669
- /** The assembled, globally-registered client host context. */
668
+ interface DevframeClientRuntime {
669
+ /** The assembled, globally-registered client context. */
670
670
  context: DevframeClientContext;
671
671
  /** Tear down listeners and stop tracking newly-registered client scripts. */
672
672
  dispose: () => void;
673
673
  }
674
674
  /**
675
- * Boot the framework-level client host: connect RPC, assemble the full
675
+ * Boot the client runtime: connect RPC, assemble the full
676
676
  * {@link DevframeClientContext} (panel, docks, commands, when) from the hub's
677
677
  * shared state, publish it at `__DEVFRAME_HUB_CLIENT_CONTEXT__`, and load every
678
678
  * dock entry's client script into this page — the devframe equivalent of the
679
679
  * runtime `@vitejs/devtools-kit` injects into a host app.
680
680
  *
681
- * A viewer keeps rendering its own dock UI (reading the same shared state); this
681
+ * A hub UI provider keeps rendering its own dock UI (reading the same shared state); this
682
682
  * runtime is what gives plugin client scripts a live host context to run in.
683
683
  */
684
- declare function createDevframeClientHost(options?: DevframeClientHostOptions): Promise<DevframeClientHost>;
684
+ declare function createDevframeClientRuntime(options?: DevframeClientRuntimeOptions): Promise<DevframeClientRuntime>;
685
+ /** @deprecated Renamed — use {@link DevframeClientRuntimeOptions}. */
686
+ type DevframeClientHostOptions = DevframeClientRuntimeOptions;
687
+ /** @deprecated Renamed — use {@link DevframeClientRuntime}. */
688
+ type DevframeClientHost = DevframeClientRuntime;
689
+ /** @deprecated Renamed — use {@link createDevframeClientRuntime}. */
690
+ declare const createDevframeClientHost: typeof createDevframeClientRuntime;
685
691
  //#endregion
686
692
  //#region src/client/messages.d.ts
687
693
  interface MessagesClientOptions {
@@ -731,4 +737,4 @@ declare function parseRemoteConnection(input?: string): RemoteConnectionInfo | n
731
737
  */
732
738
  declare function connectRemoteDevframe(options?: ConnectRemoteDevframeOptions): Promise<DevframeRpcClient>;
733
739
  //#endregion
734
- export { CLIENT_CONTEXT_KEY, CommandsContext, ConnectRemoteDevframeOptions, CreateDockRenderersContextOptions, DevframeClientContext, DevframeClientHost, DevframeClientHostOptions, type DevframeClientRpcHost, DockClientScriptContext, DockClientType, DockEntryState, DockEntryStateEvents, DockPanelStorage, DockRegistration, DockRenderer, DockRendererInstance, DockRendererManifest, DockRendererMountOptions, DockRendererMountResult, DockRenderersContext, DockSessionStorage, DocksConnectionContext, DocksContext, DocksEntriesContext, DocksPanelContext, FRAME_NAV_CHANNEL, FRAME_NAV_VERSION, FrameLocationHistory, FrameLocationTarget, FrameLocationWindow, FrameNavClient, FrameNavClientOptions, FrameNavEnvelope, FrameNavFrameMessage, FrameNavHostMessage, FrameNavHostPayload, FrameNavListenTarget, FrameTab, MessagesClientOptions, type RpcClientEvents, WatchFrameLocationOptions, WhenClauseContext, attachFrameNavClient, buildRemoteDevframeUrl, clientScriptFailureHint, connectRemoteDevframe, createDevframeClientHost, createDockRenderersContext, createMessagesClient, getDevframeClientContext, parseRemoteConnection, resolveClientModuleSpecifier, resolveDockIcon, resolveDockUrl, setDevframeClientContext, stripRemoteConnectionFromUrl, watchFrameLocation };
740
+ export { CLIENT_CONTEXT_KEY, CommandsContext, ConnectRemoteDevframeOptions, CreateDockRenderersContextOptions, DevframeClientContext, DevframeClientHost, DevframeClientHostOptions, type DevframeClientRpcHost, DevframeClientRuntime, DevframeClientRuntimeOptions, DockClientScriptContext, DockClientType, DockEntryState, DockEntryStateEvents, DockPanelStorage, DockRegistration, DockRenderer, DockRendererInstance, DockRendererManifest, DockRendererMountOptions, DockRendererMountResult, DockRenderersContext, DockSessionStorage, DocksConnectionContext, DocksContext, DocksEntriesContext, DocksPanelContext, FRAME_NAV_CHANNEL, FRAME_NAV_VERSION, FrameLocationHistory, FrameLocationTarget, FrameLocationWindow, FrameNavClient, FrameNavClientOptions, FrameNavEnvelope, FrameNavFrameMessage, FrameNavHostMessage, FrameNavHostPayload, FrameNavListenTarget, FrameTab, MessagesClientOptions, type RpcClientEvents, WatchFrameLocationOptions, WhenClauseContext, attachFrameNavClient, buildRemoteDevframeUrl, clientScriptFailureHint, connectRemoteDevframe, createDevframeClientHost, createDevframeClientRuntime, createDockRenderersContext, createMessagesClient, getDevframeClientContext, parseRemoteConnection, resolveClientModuleSpecifier, resolveDockIcon, resolveDockUrl, setDevframeClientContext, stripRemoteConnectionFromUrl, watchFrameLocation };
@@ -1,4 +1,4 @@
1
- import { i as DOCK_RENDERERS_STATE_KEY, n as DEFAULT_STATE_USER_SETTINGS, o as HUB_EVENTS, t as DEFAULT_CATEGORIES_ORDER } from "../constants-C2b2cACy.mjs";
1
+ import { i as DOCK_RENDERERS_STATE_KEY, n as DEFAULT_STATE_USER_SETTINGS, o as HUB_EVENTS, t as DEFAULT_CATEGORIES_ORDER } from "../constants-DrF61GFx.mjs";
2
2
  import { a as resolveClientModuleSpecifier, n as stripRemoteConnectionFromUrl, r as clientScriptFailureHint, t as buildRemoteConnectionUrl } from "../remote-url-Bgc7gtsP.mjs";
3
3
  import { REMOTE_CONNECTION_KEY } from "devframe/constants";
4
4
  import { connectDevframe, getDevframeRpcClient, resolveWsUrl } from "devframe/client";
@@ -15,8 +15,8 @@ function getDevframeClientContext() {
15
15
  }
16
16
  /**
17
17
  * Publish the global Devframe client context (or clear it with `undefined`).
18
- * Called by {@link import('./host').createDevframeClientHost}; a dock client
19
- * script or a viewer reads it back with {@link getDevframeClientContext}.
18
+ * Called by {@link import('./host').createDevframeClientRuntime}; a dock client
19
+ * script or a hub UI provider reads it back with {@link getDevframeClientContext}.
20
20
  */
21
21
  function setDevframeClientContext(ctx) {
22
22
  globalThis[CLIENT_CONTEXT_KEY] = ctx;
@@ -153,7 +153,7 @@ function watchFrameLocation(options) {
153
153
  //#endregion
154
154
  //#region src/client/frame-nav.ts
155
155
  /**
156
- * Shared-iframe soft navigation — the viewer-side half of a host↔iframe
156
+ * Shared-iframe soft navigation — the hub-UI-provider-side half of a host-page↔iframe
157
157
  * `postMessage` protocol.
158
158
  *
159
159
  * An {@link DevframeViewIframe.subTabs anchor} iframe dock owns one live iframe
@@ -407,7 +407,7 @@ function createMessagesClient(rpc, options = {}) {
407
407
  //#region src/client/renderers.ts
408
408
  /**
409
409
  * Build the {@link DockRenderersContext} shared by every hub-aware client —
410
- * `createDevframeClientHost` and viewers that assemble their own context
410
+ * `createDevframeClientRuntime` and hub UI providers that assemble their own context
411
411
  * (`@devframes/hub-ui`) both delegate here so local-first resolution, lazy
412
412
  * manifest imports, and the typed mount result behave identically everywhere.
413
413
  */
@@ -501,16 +501,16 @@ const COMMANDS_STATE_KEY = HUB_EVENTS.sharedState.commands;
501
501
  const USER_SETTINGS_STATE_KEY = HUB_EVENTS.sharedState.userSettings;
502
502
  const DOCKS_ACTIVATE_EVENT = HUB_EVENTS.broadcast.docksActivate;
503
503
  /**
504
- * Boot the framework-level client host: connect RPC, assemble the full
504
+ * Boot the client runtime: connect RPC, assemble the full
505
505
  * {@link DevframeClientContext} (panel, docks, commands, when) from the hub's
506
506
  * shared state, publish it at `__DEVFRAME_HUB_CLIENT_CONTEXT__`, and load every
507
507
  * dock entry's client script into this page — the devframe equivalent of the
508
508
  * runtime `@vitejs/devtools-kit` injects into a host app.
509
509
  *
510
- * A viewer keeps rendering its own dock UI (reading the same shared state); this
510
+ * A hub UI provider keeps rendering its own dock UI (reading the same shared state); this
511
511
  * runtime is what gives plugin client scripts a live host context to run in.
512
512
  */
513
- async function createDevframeClientHost(options = {}) {
513
+ async function createDevframeClientRuntime(options = {}) {
514
514
  const clientType = options.clientType ?? "standalone";
515
515
  const rpc = options.rpc ?? await connectDevframe(options.connect);
516
516
  let mountedRenderers;
@@ -575,7 +575,7 @@ async function createDevframeClientHost(options = {}) {
575
575
  type: "action",
576
576
  handler: (activation) => activateHandler(activation)
577
577
  });
578
- if (getDevframeClientContext()) console.warn("[@devframes/hub] A client host context is already published on this page — replacing it. Boot createDevframeClientHost() once per page (e.g. HTML injection combined with a manual import boots it twice).");
578
+ if (getDevframeClientContext()) console.warn("[@devframes/hub] A client context is already published on this page — replacing it. Boot createDevframeClientRuntime() once per page (e.g. HTML injection combined with a manual import boots it twice).");
579
579
  setDevframeClientContext(context);
580
580
  const loadedScripts = /* @__PURE__ */ new Set();
581
581
  if (loadScriptsEnabled) {
@@ -863,6 +863,8 @@ function groupByCategory(entries, categoryOrder) {
863
863
  }
864
864
  return [...groups.entries()].sort(([a], [b]) => (categoryOrder[a] ?? 0) - (categoryOrder[b] ?? 0));
865
865
  }
866
+ /** @deprecated Renamed — use {@link createDevframeClientRuntime}. */
867
+ const createDevframeClientHost = createDevframeClientRuntime;
866
868
  //#endregion
867
869
  //#region src/client/remote.ts
868
870
  function base64UrlDecode(value) {
@@ -971,4 +973,4 @@ async function connectRemoteDevframe(options = {}) {
971
973
  });
972
974
  }
973
975
  //#endregion
974
- export { CLIENT_CONTEXT_KEY, FRAME_NAV_CHANNEL, FRAME_NAV_VERSION, attachFrameNavClient, buildRemoteDevframeUrl, clientScriptFailureHint, connectRemoteDevframe, createDevframeClientHost, createDockRenderersContext, createMessagesClient, getDevframeClientContext, parseRemoteConnection, resolveClientModuleSpecifier, resolveDockIcon, resolveDockUrl, setDevframeClientContext, stripRemoteConnectionFromUrl, watchFrameLocation };
976
+ export { CLIENT_CONTEXT_KEY, FRAME_NAV_CHANNEL, FRAME_NAV_VERSION, attachFrameNavClient, buildRemoteDevframeUrl, clientScriptFailureHint, connectRemoteDevframe, createDevframeClientHost, createDevframeClientRuntime, createDockRenderersContext, createMessagesClient, getDevframeClientContext, parseRemoteConnection, resolveClientModuleSpecifier, resolveDockIcon, resolveDockUrl, setDevframeClientContext, stripRemoteConnectionFromUrl, watchFrameLocation };
@@ -5,7 +5,7 @@ import { t as DevframeDocksUserSettings } from "./settings-D7whfcx2.mjs";
5
5
  * key, and channel name the hub uses — the single source of truth that keeps
6
6
  * these names out of scattered string literals.
7
7
  *
8
- * **Keep this in sync with [`docs/guide/events.md`](../../../docs/guide/events.md)**
8
+ * **Keep this in sync with [`docs/content/8.references/3.events.md`](../../../docs/content/8.references/3.events.md)**
9
9
  * (the Hub Events Reference): every name here appears in that page's tables, and
10
10
  * every name there resolves to an entry here. Add, rename, or remove a name in
11
11
  * both places in the same change, and reference `HUB_EVENTS.*` from call sites
@@ -5,7 +5,7 @@ import { cleanDoubleSlashes, withLeadingSlash, withTrailingSlash } from "ufo";
5
5
  * key, and channel name the hub uses — the single source of truth that keeps
6
6
  * these names out of scattered string literals.
7
7
  *
8
- * **Keep this in sync with [`docs/guide/events.md`](../../../docs/guide/events.md)**
8
+ * **Keep this in sync with [`docs/content/8.references/3.events.md`](../../../docs/content/8.references/3.events.md)**
9
9
  * (the Hub Events Reference): every name here appears in that page's tables, and
10
10
  * every name there resolves to an entry here. Add, rename, or remove a name in
11
11
  * both places in the same change, and reference `HUB_EVENTS.*` from call sites
@@ -1,3 +1,3 @@
1
- import { a as normalizeHubBase, i as DOCK_RENDERERS_STATE_KEY, n as DEFAULT_STATE_USER_SETTINGS, o as HUB_EVENTS, r as DEVFRAMES_HUB_BASE, t as DEFAULT_CATEGORIES_ORDER } from "./constants-CmESZCBq.mjs";
1
+ import { a as normalizeHubBase, i as DOCK_RENDERERS_STATE_KEY, n as DEFAULT_STATE_USER_SETTINGS, o as HUB_EVENTS, r as DEVFRAMES_HUB_BASE, t as DEFAULT_CATEGORIES_ORDER } from "./constants-C5t0DeZ0.mjs";
2
2
  export * from "devframe/constants";
3
3
  export { DEFAULT_CATEGORIES_ORDER, DEFAULT_STATE_USER_SETTINGS, DEVFRAMES_HUB_BASE, DOCK_RENDERERS_STATE_KEY, HUB_EVENTS, normalizeHubBase };
@@ -1,3 +1,3 @@
1
- import { a as normalizeHubBase, i as DOCK_RENDERERS_STATE_KEY, n as DEFAULT_STATE_USER_SETTINGS, o as HUB_EVENTS, r as DEVFRAMES_HUB_BASE, t as DEFAULT_CATEGORIES_ORDER } from "./constants-C2b2cACy.mjs";
1
+ import { a as normalizeHubBase, i as DOCK_RENDERERS_STATE_KEY, n as DEFAULT_STATE_USER_SETTINGS, o as HUB_EVENTS, r as DEVFRAMES_HUB_BASE, t as DEFAULT_CATEGORIES_ORDER } from "./constants-DrF61GFx.mjs";
2
2
  export * from "devframe/constants";
3
3
  export { DEFAULT_CATEGORIES_ORDER, DEFAULT_STATE_USER_SETTINGS, DEVFRAMES_HUB_BASE, DOCK_RENDERERS_STATE_KEY, HUB_EVENTS, normalizeHubBase };
@@ -1,5 +1,5 @@
1
1
  import { r as defineHubRpcFunction } from "./define-Ceekw2EO.mjs";
2
- import { n as DEFAULT_STATE_USER_SETTINGS, o as HUB_EVENTS } from "./constants-C2b2cACy.mjs";
2
+ import { n as DEFAULT_STATE_USER_SETTINGS, o as HUB_EVENTS } from "./constants-DrF61GFx.mjs";
3
3
  import { i as isBareModuleSpecifier, t as buildRemoteConnectionUrl } from "./remote-url-Bgc7gtsP.mjs";
4
4
  import { createEventEmitter } from "devframe/utils/events";
5
5
  import { createHostContext, createStorage } from "devframe/node";
@@ -10,6 +10,7 @@ import { defineDiagnostics } from "devframe/utils/nostics";
10
10
  import { join, resolve } from "pathe";
11
11
  import { nanoid } from "devframe/utils/nanoid";
12
12
  import process from "node:process";
13
+ import { resolveClientAssets } from "devframe";
13
14
  //#region src/node/diagnostics.ts
14
15
  const diagnostics = defineDiagnostics({
15
16
  docsBase: "https://devfra.me/errors",
@@ -60,7 +61,7 @@ const diagnostics = defineDiagnostics({
60
61
  },
61
62
  DF8107: {
62
63
  why: (p) => `Dock activation requested for unknown dock id "${p.id}"`,
63
- fix: "Pass a `dockId` that matches a registered dock entry. The activation is still broadcast, but no viewer will switch to it. Ids are case-sensitive — check for typos, and ensure the target dock is registered before activating it."
64
+ fix: "Pass a `dockId` that matches a registered dock entry. The activation is still broadcast, but no hub UI provider will switch to it. Ids are case-sensitive — check for typos, and ensure the target dock is registered before activating it."
64
65
  },
65
66
  DF8108: {
66
67
  why: (p) => `A renderer module is already registered for dock type "${p.type}"`,
@@ -76,7 +77,7 @@ const diagnostics = defineDiagnostics({
76
77
  },
77
78
  DF8111: {
78
79
  why: (p) => `Dock "${p.id}" declares the bare-specifier client script "${p.specifier}", but this host advertises no client-module resolution — the browser cannot resolve a bare npm specifier natively, so the script will fail to load.`,
79
- fix: "Run under a host that declares `initHub({ clientModuleResolution })` (e.g. Vite's `'/@id/{specifier}'`), ship the script as a self-contained bundle served by URL, or resolve it in the viewer via `createDevframeClientHost({ resolveClientModule })` (then disregard this warning)."
80
+ fix: "Run under a host framework that declares `initHub({ clientModuleResolution })` (e.g. Vite's `'/@id/{specifier}'`), ship the script as a self-contained bundle served by URL, or resolve it in the hub UI provider via `createDevframeClientRuntime({ resolveClientModule })` (then disregard this warning)."
80
81
  },
81
82
  DF8200: { why: (p) => `Terminal session with id "${p.id}" already registered` },
82
83
  DF8201: { why: (p) => `Terminal session with id "${p.id}" not registered` },
@@ -324,7 +325,7 @@ var DevframeDocksHost = class {
324
325
  });
325
326
  }
326
327
  /**
327
- * Warn (don't throw — a viewer-side `resolveClientModule` may still cover
328
+ * Warn (don't throw — a client-runtime `resolveClientModule` override may still cover
328
329
  * it) when a dock declares a **bare-specifier** client script on a host
329
330
  * that advertises no `staticConfig.dock.clientModuleResolution`: the
330
331
  * browser cannot resolve a bare npm specifier natively, so the script is
@@ -935,14 +936,15 @@ async function prepareDevframe(ctx, d, options = {}) {
935
936
  id,
936
937
  basePath: void 0
937
938
  }, "hosted"));
938
- if (d.cli?.distDir) {
939
+ const clientAssets = resolveClientAssets(d);
940
+ if (clientAssets) {
939
941
  if (ctx.host.mountConnectionMeta) await ctx.host.mountConnectionMeta(base);
940
942
  else diagnostics.DF8106({
941
943
  id,
942
944
  name: d.name,
943
945
  base
944
946
  });
945
- const distSource = d.cli.distDir;
947
+ const distSource = clientAssets;
946
948
  ctx.views.hostStatic(base, typeof distSource === "string" ? resolve(distSource) : distSource, d.importMetaUrl);
947
949
  }
948
950
  ctx.docks.register({
@@ -1013,7 +1015,7 @@ const hubCommandsExecute = defineHubRpcFunction({
1013
1015
  * messages subsystem. Marked `from: 'browser'`. Returns the serializable
1014
1016
  * entry (the mutation handle stays server-side).
1015
1017
  *
1016
- * Pairs with the client-side {@link import('../client').createDevframeClientHost}
1018
+ * Pairs with the client-side {@link import('../client').createDevframeClientRuntime}
1017
1019
  * context, whose `messages` client dispatches through these built-ins so a
1018
1020
  * dock client script can report into the same feed the server writes to.
1019
1021
  */
@@ -117,9 +117,10 @@ interface DevframeMessageEntry {
117
117
  */
118
118
  actions?: DevframeMessageAction[];
119
119
  /**
120
- * Time in ms to auto-dismiss the toast notification (client-side)
120
+ * Time in ms to auto-dismiss the toast notification (client-side) or
121
+ * `false` to keep it indefinitely.
121
122
  */
122
- autoDismiss?: number;
123
+ autoDismiss?: number | false;
123
124
  /**
124
125
  * Time in ms to auto-delete this message entry (server-side)
125
126
  */
@@ -1,4 +1,4 @@
1
- import "./context-BVkxwz5k.mjs";
1
+ import "./context-D5JSW_X5.mjs";
2
2
  import "./settings-D7whfcx2.mjs";
3
3
  import { RpcDefinitionsFilter, RpcDefinitionsToFunctions } from "devframe/rpc";
4
4
  import { ConnectionMeta as ConnectionMeta$1, DevframeCapabilities, DevframeDiagnosticsHost, DevframeDiagnosticsLogger, DevframeHost as DevframeHost$1, DevframeNodeRpcSession, DevframeRpcClientFunctions, DevframeRpcServerFunctions, DevframeRpcSharedStates, DevframeViewHost, EventEmitter as EventEmitter$1, EventUnsubscribe, EventsMap, RpcBroadcastOptions, RpcFunctionsHost, RpcSharedStateGetOptions, RpcSharedStateHost, RpcStreamingChannel, RpcStreamingChannelOptions, RpcStreamingHost } from "devframe/types";
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
- import { C as DevframeMessageHandle, D as DevframeMessagesHost, E as DevframeMessagesClient, O as DevframeMessagesLevelShortcuts, S as DevframeMessageFilePosition, T as DevframeMessageShortcutInput, _ as DevframeMessageCommandAction, a as DevframeChildProcessExecuteOptions, b as DevframeMessageEntryFrom, c as DevframeChildProcessTerminalSession, d as DevframeTerminalSession, f as DevframeTerminalSessionBase, g as DevframeMessageActivateAction, h as DevframeMessageAction, k as DevframeMessagesListDelta, l as DevframePtyExecuteOptions, m as DevframeTerminalsHost, n as DevframeHubContext, o as DevframeChildProcessOutput, p as DevframeTerminalStatus, s as DevframeChildProcessResult, t as CreateHubContextOptions, u as DevframePtyTerminalSession, v as DevframeMessageElementPosition, w as DevframeMessageLevel, x as DevframeMessageEntryInput, y as DevframeMessageEntry } from "./context-BVkxwz5k.mjs";
1
+ import { C as DevframeMessageHandle, D as DevframeMessagesHost, E as DevframeMessagesClient, O as DevframeMessagesLevelShortcuts, S as DevframeMessageFilePosition, T as DevframeMessageShortcutInput, _ as DevframeMessageCommandAction, a as DevframeChildProcessExecuteOptions, b as DevframeMessageEntryFrom, c as DevframeChildProcessTerminalSession, d as DevframeTerminalSession, f as DevframeTerminalSessionBase, g as DevframeMessageActivateAction, h as DevframeMessageAction, k as DevframeMessagesListDelta, l as DevframePtyExecuteOptions, m as DevframeTerminalsHost, n as DevframeHubContext, o as DevframeChildProcessOutput, p as DevframeTerminalStatus, s as DevframeChildProcessResult, t as CreateHubContextOptions, u as DevframePtyTerminalSession, v as DevframeMessageElementPosition, w as DevframeMessageLevel, x as DevframeMessageEntryInput, y as DevframeMessageEntry } from "./context-D5JSW_X5.mjs";
2
2
  import { A as DevframeViewLauncher, C as DevframeDocksActiveState, D as DevframeViewCustomRender, E as DevframeViewBuiltin, F as RemoteDockOptions, M as FrameSubTabsConfig, N as NavTarget, O as DevframeViewGroup, P as RemoteConnectionInfo, S as DevframeDockUserEntry, T as DevframeViewAction, _ as DevframeDockEntry, a as DevframeCommandEntry, b as DevframeDockEntryIcon, c as DevframeCommandShortcutOverrides, d as DevframeServerCommandEntry, f as DevframeServerCommandInput, g as DevframeDockEntriesGrouped, h as DevframeDockBadgeVariant, i as DevframeCommandBase, j as DevframeViewLauncherStatus, k as DevframeViewIframe, l as DevframeCommandsHost, m as DevframeDockActivation, n as DevframeClientCommand, o as DevframeCommandHandle, p as ClientScriptEntry, r as DevframeCommandAgentOptions, s as DevframeCommandKeybinding, t as DevframeDocksUserSettings, u as DevframeCommandsHostEvents, v as DevframeDockEntryBase, w as DevframeDocksHost, x as DevframeDockEntryRegistry, y as DevframeDockEntryCategory } from "./settings-D7whfcx2.mjs";
3
- import { S as RpcStreamingHost, _ as RpcFunctionsHost, a as DevframeHost, b as RpcStreamingChannel, c as DevframeRpcServerFunctions, d as EventEmitter, f as EventUnsubscribe, g as RpcDefinitionsToFunctions, h as RpcDefinitionsFilter, i as DevframeDiagnosticsLogger, l as DevframeRpcSharedStates, m as RpcBroadcastOptions, n as DevframeCapabilities, o as DevframeNodeRpcSession, p as EventsMap, r as DevframeDiagnosticsHost, s as DevframeRpcClientFunctions, t as ConnectionMeta, u as DevframeViewHost, v as RpcSharedStateGetOptions, x as RpcStreamingChannelOptions, y as RpcSharedStateHost } from "./index-CyEyZHB3.mjs";
3
+ import { S as RpcStreamingHost, _ as RpcFunctionsHost, a as DevframeHost, b as RpcStreamingChannel, c as DevframeRpcServerFunctions, d as EventEmitter, f as EventUnsubscribe, g as RpcDefinitionsToFunctions, h as RpcDefinitionsFilter, i as DevframeDiagnosticsLogger, l as DevframeRpcSharedStates, m as RpcBroadcastOptions, n as DevframeCapabilities, o as DevframeNodeRpcSession, p as EventsMap, r as DevframeDiagnosticsHost, s as DevframeRpcClientFunctions, t as ConnectionMeta, u as DevframeViewHost, v as RpcSharedStateGetOptions, x as RpcStreamingChannelOptions, y as RpcSharedStateHost } from "./index-DhxIxS-Q.mjs";
4
4
  import { WhenContext, WhenExpression } from "devframe/utils/when";
5
5
  //#region src/define.d.ts
6
6
  declare const defineHubRpcFunction: <NAME extends string, TYPE extends import("devframe/rpc").RpcFunctionType, ARGS extends any[], RETURN = void, const AS extends import("devframe/rpc").RpcArgsSchema | undefined = undefined, const RS extends import("devframe/rpc").RpcReturnSchema | undefined = undefined>(definition: import("devframe/rpc").RpcFunctionDefinition<NAME, TYPE, ARGS, RETURN, AS, RS, DevframeHubContext>) => import("devframe/rpc").RpcFunctionDefinition<NAME, TYPE, ARGS, RETURN, AS, RS, DevframeHubContext>;
@@ -1,4 +1,4 @@
1
- import { C as DevframeMessageHandle, D as DevframeMessagesHost$1, T as DevframeMessageShortcutInput, a as DevframeChildProcessExecuteOptions, c as DevframeChildProcessTerminalSession, d as DevframeTerminalSession, f as DevframeTerminalSessionBase, i as InstallDevframeOptions, k as DevframeMessagesListDelta, l as DevframePtyExecuteOptions, m as DevframeTerminalsHost$1, n as DevframeHubContext, r as createHubContext, t as CreateHubContextOptions, u as DevframePtyTerminalSession, x as DevframeMessageEntryInput, y as DevframeMessageEntry } from "../context-BVkxwz5k.mjs";
1
+ import { C as DevframeMessageHandle, D as DevframeMessagesHost$1, T as DevframeMessageShortcutInput, a as DevframeChildProcessExecuteOptions, c as DevframeChildProcessTerminalSession, d as DevframeTerminalSession, f as DevframeTerminalSessionBase, i as InstallDevframeOptions, k as DevframeMessagesListDelta, l as DevframePtyExecuteOptions, m as DevframeTerminalsHost$1, n as DevframeHubContext, r as createHubContext, t as CreateHubContextOptions, u as DevframePtyTerminalSession, x as DevframeMessageEntryInput, y as DevframeMessageEntry } from "../context-D5JSW_X5.mjs";
2
2
  import { S as DevframeDockUserEntry, _ as DevframeDockEntry, d as DevframeServerCommandEntry, f as DevframeServerCommandInput, l as DevframeCommandsHost$1, o as DevframeCommandHandle, p as ClientScriptEntry, t as DevframeDocksUserSettings, w as DevframeDocksHost$1 } from "../settings-D7whfcx2.mjs";
3
3
  import { RpcFunctionDefinitionAny } from "devframe/rpc";
4
4
  import { SharedState } from "devframe/utils/shared-state";
@@ -52,7 +52,7 @@ declare class DevframeDocksHost implements DevframeDocksHost$1 {
52
52
  update(view: DevframeDockUserEntry): void;
53
53
  activate(dockId: string, params?: Record<string, unknown>): void;
54
54
  /**
55
- * Warn (don't throw — a viewer-side `resolveClientModule` may still cover
55
+ * Warn (don't throw — a client-runtime `resolveClientModule` override may still cover
56
56
  * it) when a dock declares a **bare-specifier** client script on a host
57
57
  * that advertises no `staticConfig.dock.clientModuleResolution`: the
58
58
  * browser cannot resolve a bare npm specifier natively, so the script is
@@ -155,7 +155,7 @@ declare const hubCommandsExecute: {
155
155
  * messages subsystem. Marked `from: 'browser'`. Returns the serializable
156
156
  * entry (the mutation handle stays server-side).
157
157
  *
158
- * Pairs with the client-side {@link import('../client').createDevframeClientHost}
158
+ * Pairs with the client-side {@link import('../client').createDevframeClientRuntime}
159
159
  * context, whose `messages` client dispatches through these built-ins so a
160
160
  * dock client script can report into the same feed the server writes to.
161
161
  */
@@ -1,4 +1,4 @@
1
- import { _ as DevframeDocksHost, a as hubMessagesAdd, c as hubMessagesUpdate, d as hubTerminalsRestart, f as hubTerminalsTerminate, g as DevframeMessagesHost, h as DevframeTerminalsHost, i as hubDocksActivate, l as hubTerminalsRemove, n as builtinHubRpcDeclarations, o as hubMessagesClear, p as hubTerminalsWrite, r as hubCommandsExecute, s as hubMessagesRemove, t as createHubContext, u as hubTerminalsResize, v as DevframeCommandsHost } from "../context-TgU_TKiY.mjs";
1
+ import { _ as DevframeDocksHost, a as hubMessagesAdd, c as hubMessagesUpdate, d as hubTerminalsRestart, f as hubTerminalsTerminate, g as DevframeMessagesHost, h as DevframeTerminalsHost, i as hubDocksActivate, l as hubTerminalsRemove, n as builtinHubRpcDeclarations, o as hubMessagesClear, p as hubTerminalsWrite, r as hubCommandsExecute, s as hubMessagesRemove, t as createHubContext, u as hubTerminalsResize, v as DevframeCommandsHost } from "../context-C3hUUCC1.mjs";
2
2
  import "ufo";
3
3
  import "pathe";
4
4
  import "node:process";
@@ -9,7 +9,7 @@ import assert from "node:assert";
9
9
  import "node:path";
10
10
  import v8 from "node:v8";
11
11
  import { format, inspect } from "node:util";
12
- //#region ../../node_modules/.pnpm/acorn@8.16.0/node_modules/acorn/dist/acorn.mjs
12
+ //#region ../../node_modules/.pnpm/acorn@8.18.0/node_modules/acorn/dist/acorn.mjs
13
13
  var astralIdentifierCodes = [
14
14
  509,
15
15
  0,
@@ -1228,6 +1228,7 @@ function getLineInfo(input, offset) {
1228
1228
  var defaultOptions = {
1229
1229
  ecmaVersion: null,
1230
1230
  sourceType: "script",
1231
+ strict: false,
1231
1232
  onInsertedSemicolon: null,
1232
1233
  onTrailingComma: null,
1233
1234
  allowReserved: null,
@@ -1238,6 +1239,7 @@ var defaultOptions = {
1238
1239
  allowHashBang: false,
1239
1240
  checkPrivateFields: true,
1240
1241
  locations: false,
1242
+ startLocation: null,
1241
1243
  onToken: null,
1242
1244
  onComment: null,
1243
1245
  ranges: false,
@@ -1319,14 +1321,15 @@ var Parser = function Parser(options, input, startPos) {
1319
1321
  this.reservedWordsStrictBind = wordsRegexp(reservedStrict + " " + reservedWords.strictBind);
1320
1322
  this.input = String(input);
1321
1323
  this.containsEsc = false;
1322
- if (startPos) {
1323
- this.pos = startPos;
1324
+ this.pos = startPos || 0;
1325
+ this.curLine = 1;
1326
+ if (options.startLocation) {
1327
+ this.lineStart = this.pos - options.startLocation.column;
1328
+ this.curLine = options.startLocation.line;
1329
+ } else if (startPos) {
1324
1330
  this.lineStart = this.input.lastIndexOf("\n", startPos - 1) + 1;
1325
- this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length;
1326
- } else {
1327
- this.pos = this.lineStart = 0;
1328
- this.curLine = 1;
1329
- }
1331
+ if (this.options.locations) this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length;
1332
+ } else this.lineStart = 0;
1330
1333
  this.type = types$1.eof;
1331
1334
  this.value = null;
1332
1335
  this.start = this.end = this.pos;
@@ -1336,7 +1339,7 @@ var Parser = function Parser(options, input, startPos) {
1336
1339
  this.context = this.initialContext();
1337
1340
  this.exprAllowed = true;
1338
1341
  this.inModule = options.sourceType === "module";
1339
- this.strict = this.inModule || this.strictDirective(this.pos);
1342
+ this.strict = this.inModule || options.strict === true || this.strictDirective(this.pos);
1340
1343
  this.potentialArrowAt = -1;
1341
1344
  this.potentialArrowInForAwait = false;
1342
1345
  this.yieldPos = this.awaitPos = this.awaitIdentPos = 0;
@@ -1362,9 +1365,12 @@ var prototypeAccessors = {
1362
1365
  inClassStaticBlock: { configurable: true }
1363
1366
  };
1364
1367
  Parser.prototype.parse = function parse() {
1368
+ var this$1$1 = this;
1365
1369
  var node = this.options.program || this.startNode();
1366
1370
  this.nextToken();
1367
- return this.parseTopLevel(node);
1371
+ return this.catchStackOverflow(function() {
1372
+ return this$1$1.parseTopLevel(node);
1373
+ });
1368
1374
  };
1369
1375
  prototypeAccessors.inFunction.get = function() {
1370
1376
  return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0;
@@ -1467,6 +1473,14 @@ pp$9.eatContextual = function(name) {
1467
1473
  this.next();
1468
1474
  return true;
1469
1475
  };
1476
+ pp$9.catchStackOverflow = function(f) {
1477
+ try {
1478
+ return f();
1479
+ } catch (e) {
1480
+ if (e instanceof Error && (/\bstack\b.*\b(exceeded|overflow)\b/i.test(e.message) || /\btoo much recursion\b/i.test(e.message))) this.raise(this.start, "Not enough stack space to parse input");
1481
+ else throw e;
1482
+ }
1483
+ };
1470
1484
  pp$9.expectContextual = function(name) {
1471
1485
  if (!this.eatContextual(name)) this.unexpected();
1472
1486
  };
@@ -1522,10 +1536,10 @@ pp$9.isSimpleAssignTarget = function(expr) {
1522
1536
  };
1523
1537
  var pp$8 = Parser.prototype;
1524
1538
  pp$8.parseTopLevel = function(node) {
1525
- var exports = Object.create(null);
1539
+ var exports$1 = Object.create(null);
1526
1540
  if (!node.body) node.body = [];
1527
1541
  while (this.type !== types$1.eof) {
1528
- var stmt = this.parseStatement(null, true, exports);
1542
+ var stmt = this.parseStatement(null, true, exports$1);
1529
1543
  node.body.push(stmt);
1530
1544
  }
1531
1545
  if (this.inModule) for (var i = 0, list = Object.keys(this.undefinedExports); i < list.length; i += 1) {
@@ -1587,7 +1601,13 @@ pp$8.isUsingKeyword = function(isAwaitUsing, isFor) {
1587
1601
  while (isIdentifierChar(ch = this.fullCharCodeAt(next)));
1588
1602
  if (ch === 92) return true;
1589
1603
  var id = this.input.slice(idStart, next);
1590
- if (keywordRelationalOperator.test(id) || isFor && id === "of") return false;
1604
+ if (keywordRelationalOperator.test(id)) return false;
1605
+ if (isFor && !isAwaitUsing && id === "of") {
1606
+ skipWhiteSpace.lastIndex = next;
1607
+ var skipAfterOf = skipWhiteSpace.exec(this.input);
1608
+ next = next + skipAfterOf[0].length;
1609
+ if (this.input.charCodeAt(next) !== 61 || (ch = this.input.charCodeAt(next + 1)) === 61 || ch === 62) return false;
1610
+ }
1591
1611
  return true;
1592
1612
  };
1593
1613
  pp$8.isAwaitUsing = function(isFor) {
@@ -1596,7 +1616,7 @@ pp$8.isAwaitUsing = function(isFor) {
1596
1616
  pp$8.isUsing = function(isFor) {
1597
1617
  return this.isUsingKeyword(false, isFor);
1598
1618
  };
1599
- pp$8.parseStatement = function(context, topLevel, exports) {
1619
+ pp$8.parseStatement = function(context, topLevel, exports$1) {
1600
1620
  var starttype = this.type, node = this.startNode(), kind;
1601
1621
  if (this.isLet(context)) {
1602
1622
  starttype = types$1._var;
@@ -1640,7 +1660,7 @@ pp$8.parseStatement = function(context, topLevel, exports) {
1640
1660
  if (!topLevel) this.raise(this.start, "'import' and 'export' may only appear at the top level");
1641
1661
  if (!this.inModule) this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'");
1642
1662
  }
1643
- return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports);
1663
+ return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports$1);
1644
1664
  default:
1645
1665
  if (this.isAsyncFunction()) {
1646
1666
  if (context) this.unexpected();
@@ -1650,6 +1670,7 @@ pp$8.parseStatement = function(context, topLevel, exports) {
1650
1670
  var usingKind = this.isAwaitUsing(false) ? "await using" : this.isUsing(false) ? "using" : null;
1651
1671
  if (usingKind) {
1652
1672
  if (!this.allowUsing) this.raise(this.start, "Using declaration cannot appear in the top level when source type is `script` or in the bare case statement");
1673
+ if (context) this.raise(this.start, "Using declaration is not allowed in single-statement positions");
1653
1674
  if (usingKind === "await using") {
1654
1675
  if (!this.canAwait) this.raise(this.start, "Await using cannot appear outside of async function");
1655
1676
  this.next();
@@ -1753,11 +1774,10 @@ pp$8.parseForStatement = function(node) {
1753
1774
  };
1754
1775
  pp$8.parseForAfterInit = function(node, init, awaitAt) {
1755
1776
  if ((this.type === types$1._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && init.declarations.length === 1) {
1756
- if (this.options.ecmaVersion >= 9) {
1757
- if (this.type === types$1._in) {
1758
- if (awaitAt > -1) this.unexpected(awaitAt);
1759
- } else node.await = awaitAt > -1;
1760
- }
1777
+ if (this.type === types$1._in) {
1778
+ if ((init.kind === "using" || init.kind === "await using") && !init.declarations[0].init) this.raise(this.start, "Using declaration is not allowed in for-in loops");
1779
+ if (this.options.ecmaVersion >= 9 && awaitAt > -1) this.unexpected(awaitAt);
1780
+ } else if (this.options.ecmaVersion >= 9) node.await = awaitAt > -1;
1761
1781
  return this.parseForIn(node, init);
1762
1782
  }
1763
1783
  if (awaitAt > -1) this.unexpected(awaitAt);
@@ -2165,11 +2185,11 @@ function checkKeyName(node, name) {
2165
2185
  var key = node.key;
2166
2186
  return !computed && (key.type === "Identifier" && key.name === name || key.type === "Literal" && key.value === name);
2167
2187
  }
2168
- pp$8.parseExportAllDeclaration = function(node, exports) {
2188
+ pp$8.parseExportAllDeclaration = function(node, exports$1) {
2169
2189
  if (this.options.ecmaVersion >= 11) {
2170
2190
  if (this.eatContextual("as")) {
2171
2191
  node.exported = this.parseModuleExportName();
2172
- this.checkExport(exports, node.exported, this.lastTokStart);
2192
+ this.checkExport(exports$1, node.exported, this.lastTokStart);
2173
2193
  } else node.exported = null;
2174
2194
  }
2175
2195
  this.expectContextual("from");
@@ -2179,24 +2199,24 @@ pp$8.parseExportAllDeclaration = function(node, exports) {
2179
2199
  this.semicolon();
2180
2200
  return this.finishNode(node, "ExportAllDeclaration");
2181
2201
  };
2182
- pp$8.parseExport = function(node, exports) {
2202
+ pp$8.parseExport = function(node, exports$1) {
2183
2203
  this.next();
2184
- if (this.eat(types$1.star)) return this.parseExportAllDeclaration(node, exports);
2204
+ if (this.eat(types$1.star)) return this.parseExportAllDeclaration(node, exports$1);
2185
2205
  if (this.eat(types$1._default)) {
2186
- this.checkExport(exports, "default", this.lastTokStart);
2206
+ this.checkExport(exports$1, "default", this.lastTokStart);
2187
2207
  node.declaration = this.parseExportDefaultDeclaration();
2188
2208
  return this.finishNode(node, "ExportDefaultDeclaration");
2189
2209
  }
2190
2210
  if (this.shouldParseExportStatement()) {
2191
2211
  node.declaration = this.parseExportDeclaration(node);
2192
- if (node.declaration.type === "VariableDeclaration") this.checkVariableExport(exports, node.declaration.declarations);
2193
- else this.checkExport(exports, node.declaration.id, node.declaration.id.start);
2212
+ if (node.declaration.type === "VariableDeclaration") this.checkVariableExport(exports$1, node.declaration.declarations);
2213
+ else this.checkExport(exports$1, node.declaration.id, node.declaration.id.start);
2194
2214
  node.specifiers = [];
2195
2215
  node.source = null;
2196
2216
  if (this.options.ecmaVersion >= 16) node.attributes = [];
2197
2217
  } else {
2198
2218
  node.declaration = null;
2199
- node.specifiers = this.parseExportSpecifiers(exports);
2219
+ node.specifiers = this.parseExportSpecifiers(exports$1);
2200
2220
  if (this.eatContextual("from")) {
2201
2221
  if (this.type !== types$1.string) this.unexpected();
2202
2222
  node.source = this.parseExprAtom();
@@ -2234,45 +2254,45 @@ pp$8.parseExportDefaultDeclaration = function() {
2234
2254
  return declaration;
2235
2255
  }
2236
2256
  };
2237
- pp$8.checkExport = function(exports, name, pos) {
2238
- if (!exports) return;
2257
+ pp$8.checkExport = function(exports$1, name, pos) {
2258
+ if (!exports$1) return;
2239
2259
  if (typeof name !== "string") name = name.type === "Identifier" ? name.name : name.value;
2240
- if (hasOwn(exports, name)) this.raiseRecoverable(pos, "Duplicate export '" + name + "'");
2241
- exports[name] = true;
2260
+ if (hasOwn(exports$1, name)) this.raiseRecoverable(pos, "Duplicate export '" + name + "'");
2261
+ exports$1[name] = true;
2242
2262
  };
2243
- pp$8.checkPatternExport = function(exports, pat) {
2263
+ pp$8.checkPatternExport = function(exports$1, pat) {
2244
2264
  var type = pat.type;
2245
- if (type === "Identifier") this.checkExport(exports, pat, pat.start);
2265
+ if (type === "Identifier") this.checkExport(exports$1, pat, pat.start);
2246
2266
  else if (type === "ObjectPattern") for (var i = 0, list = pat.properties; i < list.length; i += 1) {
2247
2267
  var prop = list[i];
2248
- this.checkPatternExport(exports, prop);
2268
+ this.checkPatternExport(exports$1, prop);
2249
2269
  }
2250
2270
  else if (type === "ArrayPattern") for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) {
2251
2271
  var elt = list$1[i$1];
2252
- if (elt) this.checkPatternExport(exports, elt);
2272
+ if (elt) this.checkPatternExport(exports$1, elt);
2253
2273
  }
2254
- else if (type === "Property") this.checkPatternExport(exports, pat.value);
2255
- else if (type === "AssignmentPattern") this.checkPatternExport(exports, pat.left);
2256
- else if (type === "RestElement") this.checkPatternExport(exports, pat.argument);
2274
+ else if (type === "Property") this.checkPatternExport(exports$1, pat.value);
2275
+ else if (type === "AssignmentPattern") this.checkPatternExport(exports$1, pat.left);
2276
+ else if (type === "RestElement") this.checkPatternExport(exports$1, pat.argument);
2257
2277
  };
2258
- pp$8.checkVariableExport = function(exports, decls) {
2259
- if (!exports) return;
2278
+ pp$8.checkVariableExport = function(exports$1, decls) {
2279
+ if (!exports$1) return;
2260
2280
  for (var i = 0, list = decls; i < list.length; i += 1) {
2261
2281
  var decl = list[i];
2262
- this.checkPatternExport(exports, decl.id);
2282
+ this.checkPatternExport(exports$1, decl.id);
2263
2283
  }
2264
2284
  };
2265
2285
  pp$8.shouldParseExportStatement = function() {
2266
2286
  return this.type.keyword === "var" || this.type.keyword === "const" || this.type.keyword === "class" || this.type.keyword === "function" || this.isLet() || this.isAsyncFunction();
2267
2287
  };
2268
- pp$8.parseExportSpecifier = function(exports) {
2288
+ pp$8.parseExportSpecifier = function(exports$1) {
2269
2289
  var node = this.startNode();
2270
2290
  node.local = this.parseModuleExportName();
2271
2291
  node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local;
2272
- this.checkExport(exports, node.exported, node.exported.start);
2292
+ this.checkExport(exports$1, node.exported, node.exported.start);
2273
2293
  return this.finishNode(node, "ExportSpecifier");
2274
2294
  };
2275
- pp$8.parseExportSpecifiers = function(exports) {
2295
+ pp$8.parseExportSpecifiers = function(exports$1) {
2276
2296
  var nodes = [], first = true;
2277
2297
  this.expect(types$1.braceL);
2278
2298
  while (!this.eat(types$1.braceR)) {
@@ -2280,7 +2300,7 @@ pp$8.parseExportSpecifiers = function(exports) {
2280
2300
  this.expect(types$1.comma);
2281
2301
  if (this.afterTrailingComma(types$1.braceR)) break;
2282
2302
  } else first = false;
2283
- nodes.push(this.parseExportSpecifier(exports));
2303
+ nodes.push(this.parseExportSpecifier(exports$1));
2284
2304
  }
2285
2305
  return nodes;
2286
2306
  };
@@ -2713,15 +2733,18 @@ pp$5.checkPropClash = function(prop, propHash, refDestructuringErrors) {
2713
2733
  other[kind] = true;
2714
2734
  };
2715
2735
  pp$5.parseExpression = function(forInit, refDestructuringErrors) {
2716
- var startPos = this.start, startLoc = this.startLoc;
2717
- var expr = this.parseMaybeAssign(forInit, refDestructuringErrors);
2718
- if (this.type === types$1.comma) {
2719
- var node = this.startNodeAt(startPos, startLoc);
2720
- node.expressions = [expr];
2721
- while (this.eat(types$1.comma)) node.expressions.push(this.parseMaybeAssign(forInit, refDestructuringErrors));
2722
- return this.finishNode(node, "SequenceExpression");
2723
- }
2724
- return expr;
2736
+ var this$1$1 = this;
2737
+ return this.catchStackOverflow(function() {
2738
+ var startPos = this$1$1.start, startLoc = this$1$1.startLoc;
2739
+ var expr = this$1$1.parseMaybeAssign(forInit, refDestructuringErrors);
2740
+ if (this$1$1.type === types$1.comma) {
2741
+ var node = this$1$1.startNodeAt(startPos, startLoc);
2742
+ node.expressions = [expr];
2743
+ while (this$1$1.eat(types$1.comma)) node.expressions.push(this$1$1.parseMaybeAssign(forInit, refDestructuringErrors));
2744
+ return this$1$1.finishNode(node, "SequenceExpression");
2745
+ }
2746
+ return expr;
2747
+ });
2725
2748
  };
2726
2749
  pp$5.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse) {
2727
2750
  if (this.isContextual("yield")) {
@@ -2767,7 +2790,7 @@ pp$5.parseMaybeConditional = function(forInit, refDestructuringErrors) {
2767
2790
  var startPos = this.start, startLoc = this.startLoc;
2768
2791
  var expr = this.parseExprOps(forInit, refDestructuringErrors);
2769
2792
  if (this.checkExpressionErrors(refDestructuringErrors)) return expr;
2770
- if (this.eat(types$1.question)) {
2793
+ if (!(expr.type === "ArrowFunctionExpression" && expr.start === startPos) && this.eat(types$1.question)) {
2771
2794
  var node = this.startNodeAt(startPos, startLoc);
2772
2795
  node.test = expr;
2773
2796
  node.consequent = this.parseMaybeAssign();
@@ -2843,7 +2866,7 @@ pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forIni
2843
2866
  expr = this.finishNode(node$1, "UpdateExpression");
2844
2867
  }
2845
2868
  }
2846
- if (!incDec && this.eat(types$1.starstar)) {
2869
+ if (!incDec && !(expr.type === "ArrowFunctionExpression" && expr.start === startPos) && this.eat(types$1.starstar)) {
2847
2870
  if (sawUnary) this.unexpected(this.lastTokStart);
2848
2871
  else return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false, false, forInit), "**", false);
2849
2872
  } else return expr;
@@ -3148,6 +3171,7 @@ pp$5.parseNew = function() {
3148
3171
  }
3149
3172
  var startPos = this.start, startLoc = this.startLoc;
3150
3173
  node.callee = this.parseSubscripts(this.parseExprAtom(null, false, true), startPos, startLoc, true, false);
3174
+ if (node.callee.type === "Super") this.raiseRecoverable(startPos, "Invalid use of 'super'");
3151
3175
  if (this.eat(types$1.parenL)) node.arguments = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false);
3152
3176
  else node.arguments = empty;
3153
3177
  return this.finishNode(node, "NewExpression");
@@ -5109,7 +5133,7 @@ pp.readWord = function() {
5109
5133
  };
5110
5134
  Parser.acorn = {
5111
5135
  Parser,
5112
- version: "8.16.0",
5136
+ version: "8.18.0",
5113
5137
  defaultOptions,
5114
5138
  Position,
5115
5139
  SourceLocation,
@@ -1,5 +1,5 @@
1
- import { i as InstallDevframeOptions, n as DevframeHubContext, t as CreateHubContextOptions } from "../context-BVkxwz5k.mjs";
2
- import { r as DEVFRAMES_HUB_BASE } from "../constants-CmESZCBq.mjs";
1
+ import { i as InstallDevframeOptions, n as DevframeHubContext, t as CreateHubContextOptions } from "../context-D5JSW_X5.mjs";
2
+ import { r as DEVFRAMES_HUB_BASE } from "../constants-C5t0DeZ0.mjs";
3
3
  import { DevframeInstanceRecord } from "devframe/internal";
4
4
  import { ConnectionMeta, DevframeDefinition, DevframeServiceInput, DevframeSseOptions, DevframeStorageScope, DevframeWsOptions, McpRouteOptions } from "devframe/types";
5
5
  import { DevframeAuthHandler } from "devframe/node/auth";
@@ -152,7 +152,7 @@ interface InitHubOptions {
152
152
  * `<base>__renderers/<type>.mjs` and published in the renderer manifest;
153
153
  * clients import a module lazily the first time a dock of its `type`
154
154
  * mounts. Renderers registered directly in client code
155
- * (`createDevframeClientHost({ renderers })`) take precedence.
155
+ * (`createDevframeClientRuntime({ renderers })`) take precedence.
156
156
  *
157
157
  * ```ts
158
158
  * import { jsonRenderUiRenderer } from '@devframes/json-render-ui/hub'
@@ -272,7 +272,7 @@ interface HubInstance {
272
272
  context: Promise<DevframeHubContext>;
273
273
  /** The `ConnectionMeta` served at `<base>__connection.json` (and every frame base). */
274
274
  connectionMeta: () => ConnectionMeta;
275
- /** Tear down: WS transport/side-car, MCP sessions. */
275
+ /** Tear down: WS transport/side-car, MCP handler. */
276
276
  close: () => Promise<void>;
277
277
  }
278
278
  /**
@@ -1,9 +1,9 @@
1
- import { a as normalizeHubBase, i as DOCK_RENDERERS_STATE_KEY, r as DEVFRAMES_HUB_BASE } from "../constants-C2b2cACy.mjs";
1
+ import { a as normalizeHubBase, i as DOCK_RENDERERS_STATE_KEY, r as DEVFRAMES_HUB_BASE } from "../constants-DrF61GFx.mjs";
2
2
  import { a as resolveClientModuleSpecifier } from "../remote-url-Bgc7gtsP.mjs";
3
- import { m as prepareDevframe, t as createHubContext, y as diagnostics } from "../context-TgU_TKiY.mjs";
3
+ import { m as prepareDevframe, t as createHubContext, y as diagnostics } from "../context-C3hUUCC1.mjs";
4
4
  import { joinURL, withTrailingSlash, withoutLeadingSlash } from "ufo";
5
5
  import { DEVFRAME_CONNECTION_META_FILENAME, DEVFRAME_DOCK_IMPORTS_FILENAME, DEVFRAME_MCP_ROUTE, DEVFRAME_WS_ROUTE } from "devframe/constants";
6
- import { createH3DevframeHost, createInstanceShell, resolveInstanceRegister } from "devframe/internal";
6
+ import { createH3DevframeHost, createInstanceShell, importRuntimeModule, resolveInstanceRegister } from "devframe/internal";
7
7
  import { resolve } from "pathe";
8
8
  import process from "node:process";
9
9
  import { existsSync } from "node:fs";
@@ -192,18 +192,16 @@ function initHub(options) {
192
192
  for (const run of setups) await run();
193
193
  await options.configure?.(ctx);
194
194
  await options.ui?.setup?.(ctx);
195
- if (rendererRegistrations.length > 0) {
196
- const manifest = {};
197
- for (const registration of rendererRegistrations) manifest[registration.type] = {
198
- importFrom: joinURL(base, "__renderers", `${registration.type}.mjs`),
199
- ...registration.importName ? { importName: registration.importName } : {}
200
- };
201
- (await ctx.rpc.sharedState.get(DOCK_RENDERERS_STATE_KEY, { initialValue: {} })).mutate(() => manifest);
202
- }
195
+ const manifest = {};
196
+ for (const registration of rendererRegistrations) manifest[registration.type] = {
197
+ importFrom: joinURL(base, "__renderers", `${registration.type}.mjs`),
198
+ ...registration.importName ? { importName: registration.importName } : {}
199
+ };
200
+ (await ctx.rpc.sharedState.get(DOCK_RENDERERS_STATE_KEY, { initialValue: {} })).mutate(() => manifest);
203
201
  const mcpConfig = options.mcp === true ? {} : options.mcp;
204
202
  if (!mcpConfig) return { context: ctx };
205
203
  const mcpRoute = withoutLeadingSlash(mcpConfig.path ?? DEVFRAME_MCP_ROUTE);
206
- const { mountMcpHttp } = await import("devframe/adapters/mcp");
204
+ const { mountMcpHttp } = await importRuntimeModule("devframe/adapters/mcp");
207
205
  const mounted = mountMcpHttp(app, ctx, joinURL(base, mcpRoute), {
208
206
  serverName: options.name ?? "devframes-hub",
209
207
  serverVersion: options.version ?? "0.0.0",
@@ -1,4 +1,4 @@
1
- import { C as DevframeMessageHandle, D as DevframeMessagesHost, E as DevframeMessagesClient, O as DevframeMessagesLevelShortcuts, S as DevframeMessageFilePosition, T as DevframeMessageShortcutInput, _ as DevframeMessageCommandAction, a as DevframeChildProcessExecuteOptions, b as DevframeMessageEntryFrom, c as DevframeChildProcessTerminalSession, d as DevframeTerminalSession, f as DevframeTerminalSessionBase, g as DevframeMessageActivateAction, h as DevframeMessageAction, k as DevframeMessagesListDelta, l as DevframePtyExecuteOptions, m as DevframeTerminalsHost, n as DevframeHubContext, o as DevframeChildProcessOutput, p as DevframeTerminalStatus, s as DevframeChildProcessResult, t as CreateHubContextOptions, u as DevframePtyTerminalSession, v as DevframeMessageElementPosition, w as DevframeMessageLevel, x as DevframeMessageEntryInput, y as DevframeMessageEntry } from "../context-BVkxwz5k.mjs";
1
+ import { C as DevframeMessageHandle, D as DevframeMessagesHost, E as DevframeMessagesClient, O as DevframeMessagesLevelShortcuts, S as DevframeMessageFilePosition, T as DevframeMessageShortcutInput, _ as DevframeMessageCommandAction, a as DevframeChildProcessExecuteOptions, b as DevframeMessageEntryFrom, c as DevframeChildProcessTerminalSession, d as DevframeTerminalSession, f as DevframeTerminalSessionBase, g as DevframeMessageActivateAction, h as DevframeMessageAction, k as DevframeMessagesListDelta, l as DevframePtyExecuteOptions, m as DevframeTerminalsHost, n as DevframeHubContext, o as DevframeChildProcessOutput, p as DevframeTerminalStatus, s as DevframeChildProcessResult, t as CreateHubContextOptions, u as DevframePtyTerminalSession, v as DevframeMessageElementPosition, w as DevframeMessageLevel, x as DevframeMessageEntryInput, y as DevframeMessageEntry } from "../context-D5JSW_X5.mjs";
2
2
  import { A as DevframeViewLauncher, C as DevframeDocksActiveState, D as DevframeViewCustomRender, E as DevframeViewBuiltin, F as RemoteDockOptions, M as FrameSubTabsConfig, N as NavTarget, O as DevframeViewGroup, P as RemoteConnectionInfo, S as DevframeDockUserEntry, T as DevframeViewAction, _ as DevframeDockEntry, a as DevframeCommandEntry, b as DevframeDockEntryIcon, c as DevframeCommandShortcutOverrides, d as DevframeServerCommandEntry, f as DevframeServerCommandInput, g as DevframeDockEntriesGrouped, h as DevframeDockBadgeVariant, i as DevframeCommandBase, j as DevframeViewLauncherStatus, k as DevframeViewIframe, l as DevframeCommandsHost, m as DevframeDockActivation, n as DevframeClientCommand, o as DevframeCommandHandle, p as ClientScriptEntry, r as DevframeCommandAgentOptions, s as DevframeCommandKeybinding, t as DevframeDocksUserSettings, u as DevframeCommandsHostEvents, v as DevframeDockEntryBase, w as DevframeDocksHost, x as DevframeDockEntryRegistry, y as DevframeDockEntryCategory } from "../settings-D7whfcx2.mjs";
3
- import { S as RpcStreamingHost, _ as RpcFunctionsHost, a as DevframeHost, b as RpcStreamingChannel, c as DevframeRpcServerFunctions, d as EventEmitter, f as EventUnsubscribe, g as RpcDefinitionsToFunctions, h as RpcDefinitionsFilter, i as DevframeDiagnosticsLogger, l as DevframeRpcSharedStates, m as RpcBroadcastOptions, n as DevframeCapabilities, o as DevframeNodeRpcSession, p as EventsMap, r as DevframeDiagnosticsHost, s as DevframeRpcClientFunctions, t as ConnectionMeta, u as DevframeViewHost, v as RpcSharedStateGetOptions, x as RpcStreamingChannelOptions, y as RpcSharedStateHost } from "../index-CyEyZHB3.mjs";
3
+ import { S as RpcStreamingHost, _ as RpcFunctionsHost, a as DevframeHost, b as RpcStreamingChannel, c as DevframeRpcServerFunctions, d as EventEmitter, f as EventUnsubscribe, g as RpcDefinitionsToFunctions, h as RpcDefinitionsFilter, i as DevframeDiagnosticsLogger, l as DevframeRpcSharedStates, m as RpcBroadcastOptions, n as DevframeCapabilities, o as DevframeNodeRpcSession, p as EventsMap, r as DevframeDiagnosticsHost, s as DevframeRpcClientFunctions, t as ConnectionMeta, u as DevframeViewHost, v as RpcSharedStateGetOptions, x as RpcStreamingChannelOptions, y as RpcSharedStateHost } from "../index-DhxIxS-Q.mjs";
4
4
  export { ClientScriptEntry, type ConnectionMeta, type CreateHubContextOptions, type DevframeCapabilities, DevframeChildProcessExecuteOptions, DevframeChildProcessOutput, DevframeChildProcessResult, DevframeChildProcessTerminalSession, DevframeClientCommand, DevframeCommandAgentOptions, DevframeCommandBase, DevframeCommandEntry, DevframeCommandHandle, DevframeCommandKeybinding, DevframeCommandShortcutOverrides, DevframeCommandsHost, DevframeCommandsHostEvents, type DevframeDiagnosticsHost, type DevframeDiagnosticsLogger, DevframeDockActivation, DevframeDockBadgeVariant, DevframeDockEntriesGrouped, DevframeDockEntry, DevframeDockEntryBase, DevframeDockEntryCategory, DevframeDockEntryIcon, DevframeDockEntryRegistry, DevframeDockUserEntry, DevframeDocksActiveState, DevframeDocksHost, DevframeDocksUserSettings, type DevframeHost, type DevframeHubContext, DevframeMessageAction, DevframeMessageActivateAction, DevframeMessageCommandAction, DevframeMessageElementPosition, DevframeMessageEntry, DevframeMessageEntryFrom, DevframeMessageEntryInput, DevframeMessageFilePosition, DevframeMessageHandle, DevframeMessageLevel, DevframeMessageShortcutInput, DevframeMessagesClient, DevframeMessagesHost, DevframeMessagesLevelShortcuts, DevframeMessagesListDelta, type DevframeNodeRpcSession, DevframePtyExecuteOptions, DevframePtyTerminalSession, type DevframeRpcClientFunctions, type DevframeRpcServerFunctions, type DevframeRpcSharedStates, DevframeServerCommandEntry, DevframeServerCommandInput, DevframeTerminalSession, DevframeTerminalSessionBase, DevframeTerminalStatus, DevframeTerminalsHost, DevframeViewAction, DevframeViewBuiltin, DevframeViewCustomRender, DevframeViewGroup, type DevframeViewHost, DevframeViewIframe, DevframeViewLauncher, DevframeViewLauncherStatus, type EventEmitter, type EventUnsubscribe, type EventsMap, FrameSubTabsConfig, NavTarget, RemoteConnectionInfo, RemoteDockOptions, type RpcBroadcastOptions, type RpcDefinitionsFilter, type RpcDefinitionsToFunctions, type RpcFunctionsHost, type RpcSharedStateGetOptions, type RpcSharedStateHost, type RpcStreamingChannel, type RpcStreamingChannelOptions, type RpcStreamingHost };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@devframes/hub",
3
3
  "type": "module",
4
- "version": "0.9.4",
4
+ "version": "0.9.6",
5
5
  "description": "Hub layer that orchestrates devframe docks, terminals, messages, and commands on any host.",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -34,7 +34,7 @@
34
34
  "dist"
35
35
  ],
36
36
  "peerDependencies": {
37
- "devframe": "0.9.4"
37
+ "devframe": "0.9.6"
38
38
  },
39
39
  "dependencies": {
40
40
  "@standard-schema/spec": "^1.1.0",
@@ -52,7 +52,7 @@
52
52
  "mlly": "^1.8.2",
53
53
  "tsdown": "^0.22.14",
54
54
  "valibot": "^1.4.2",
55
- "devframe": "0.9.4"
55
+ "devframe": "0.9.6"
56
56
  },
57
57
  "scripts": {
58
58
  "build": "tsdown",