@devframes/hub 0.7.9 → 0.7.10

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,7 @@
1
- import { S as DevframeMessagesClient, _ as DevframeMessageEntryInput } from "../context-CNKFzYdA.mjs";
2
- import { b as DevframeDockUserEntry, h as DevframeDockEntry, i as DevframeCommandEntry, j as RemoteConnectionInfo, m as DevframeDockEntriesGrouped, n as DevframeClientCommand, o as DevframeCommandKeybinding, t as DevframeDocksUserSettings } from "../settings-C5cAtNdE.mjs";
3
- import "../index-BeoLMW0z.mjs";
1
+ import { b as DevframeDockUserEntry, h as DevframeDockEntry, i as DevframeCommandEntry, j as RemoteConnectionInfo, m as DevframeDockEntriesGrouped, n as DevframeClientCommand, o as DevframeCommandKeybinding, t as DevframeDocksUserSettings } from "../settings-Chx2aDL_.mjs";
2
+ import { DEFAULT_CATEGORIES_ORDER } from "../constants.mjs";
3
+ import { S as DevframeMessagesClient, _ as DevframeMessageEntryInput } from "../context-BBf7f_8F.mjs";
4
+ import "../index-CREpXwAf.mjs";
4
5
  import { DevframeClientRpcHost, DevframeConnectionStatus, DevframeRpcClient, DevframeRpcClientOptions, DevframeRpcContext, RpcClientEvents, RpcClientEvents as RpcClientEvents$1 } from "devframe/client";
5
6
  import { EventEmitter } from "devframe/types";
6
7
  import { SharedState } from "devframe/utils/shared-state";
@@ -150,6 +151,34 @@ interface DocksEntriesContext {
150
151
  * @returns Whether the selection was changed successfully
151
152
  */
152
153
  toggleEntry: (id: string) => Promise<boolean>;
154
+ /**
155
+ * Register a **client-only** dock entry, live in this page and merged with
156
+ * the server-provided docks (`devframe:docks` shared state) into
157
+ * {@link entries}. Unlike a dock registered on the node
158
+ * {@link import('../types/docks').DevframeDocksHost}, it never flows into
159
+ * shared state, so it stays local to this client instead of syncing to the
160
+ * hub or other viewers — for a view a client host synthesizes itself.
161
+ *
162
+ * Throws when `id` already names a client dock, unless `force` is set. A
163
+ * client dock sharing an id with a server dock overrides it in the local
164
+ * merge. Returns a handle to {@link DockRegistration.update patch} or
165
+ * {@link DockRegistration.dispose remove} it.
166
+ */
167
+ register: <T extends DevframeDockEntry>(entry: T, force?: boolean) => DockRegistration<T>;
168
+ /**
169
+ * Replace a previously {@link register client-registered} dock entry, keyed
170
+ * by `id`. Throws when no client dock owns that id.
171
+ */
172
+ update: (entry: DevframeDockUserEntry) => void;
173
+ }
174
+ interface DockRegistration<T extends DevframeDockEntry = DevframeDockEntry> {
175
+ /**
176
+ * Patch the registered client dock in place. The `id` is immutable — passing
177
+ * a differing `id` throws.
178
+ */
179
+ update: (patch: Partial<T>) => void;
180
+ /** Remove the client dock from the local merge. */
181
+ dispose: () => void;
153
182
  }
154
183
  interface DockEntryState {
155
184
  entryMeta: DevframeDockEntry;
@@ -312,4 +341,4 @@ declare function parseRemoteConnection(input?: string): RemoteConnectionInfo | n
312
341
  */
313
342
  declare function connectRemoteDevframe(options?: ConnectRemoteDevframeOptions): Promise<DevframeRpcClient>;
314
343
  //#endregion
315
- export { CLIENT_CONTEXT_KEY, CommandsContext, ConnectRemoteDevframeOptions, DevframeClientContext, DevframeClientHost, DevframeClientHostOptions, type DevframeClientRpcHost, DockClientScriptContext, DockClientType, DockEntryState, DockEntryStateEvents, DockPanelStorage, DockRenderer, DockRendererInstance, DockRendererMountOptions, DockRenderersContext, DocksConnectionContext, DocksContext, DocksEntriesContext, DocksPanelContext, MessagesClientOptions, type RpcClientEvents, WhenClauseContext, connectRemoteDevframe, createDevframeClientHost, createMessagesClient, getDevframeClientContext, parseRemoteConnection, setDevframeClientContext };
344
+ export { CLIENT_CONTEXT_KEY, CommandsContext, ConnectRemoteDevframeOptions, DEFAULT_CATEGORIES_ORDER, DevframeClientContext, DevframeClientHost, DevframeClientHostOptions, type DevframeClientRpcHost, DockClientScriptContext, DockClientType, DockEntryState, DockEntryStateEvents, DockPanelStorage, DockRegistration, DockRenderer, DockRendererInstance, DockRendererMountOptions, DockRenderersContext, DocksConnectionContext, DocksContext, DocksEntriesContext, DocksPanelContext, MessagesClientOptions, type RpcClientEvents, WhenClauseContext, connectRemoteDevframe, createDevframeClientHost, createMessagesClient, getDevframeClientContext, parseRemoteConnection, setDevframeClientContext };
@@ -98,6 +98,8 @@ async function createDevframeClientHost(options = {}) {
98
98
  ]);
99
99
  let selectedId = null;
100
100
  const entryToStateMap = /* @__PURE__ */ new Map();
101
+ const clientDocks = /* @__PURE__ */ new Map();
102
+ const loadScriptsEnabled = options.loadClientScripts ?? true;
101
103
  const panel = createPanelContext(clientType);
102
104
  const docks = createDocksContext();
103
105
  const commands = createCommandsContext();
@@ -147,7 +149,7 @@ async function createDevframeClientHost(options = {}) {
147
149
  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).");
148
150
  setDevframeClientContext(context);
149
151
  const loadedScripts = /* @__PURE__ */ new Set();
150
- if (options.loadClientScripts ?? true) {
152
+ if (loadScriptsEnabled) {
151
153
  loadClientScripts();
152
154
  disposers.push(docksState.on("updated", loadClientScripts));
153
155
  }
@@ -169,8 +171,24 @@ async function createDevframeClientHost(options = {}) {
169
171
  events: createEventEmitter()
170
172
  };
171
173
  }
174
+ function currentEntries() {
175
+ const server = docksState.value();
176
+ if (clientDocks.size === 0) return server;
177
+ const merged = [];
178
+ const seen = /* @__PURE__ */ new Set();
179
+ for (const entry of server) {
180
+ merged.push(clientDocks.get(entry.id) ?? entry);
181
+ seen.add(entry.id);
182
+ }
183
+ for (const [id, entry] of clientDocks) if (!seen.has(id)) merged.push(entry);
184
+ return merged;
185
+ }
186
+ function refreshEntries() {
187
+ reconcileEntries();
188
+ if (loadScriptsEnabled) loadClientScripts();
189
+ }
172
190
  function reconcileEntries() {
173
- const entries = docksState.value();
191
+ const entries = currentEntries();
174
192
  const seen = /* @__PURE__ */ new Set();
175
193
  for (const meta of entries) {
176
194
  seen.add(meta.id);
@@ -203,7 +221,32 @@ async function createDevframeClientHost(options = {}) {
203
221
  settings,
204
222
  getStateById: (id) => entryToStateMap.get(id),
205
223
  switchEntry,
206
- toggleEntry: (id) => selectedId === id ? switchEntry(null) : switchEntry(id)
224
+ toggleEntry: (id) => selectedId === id ? switchEntry(null) : switchEntry(id),
225
+ register(entry, force) {
226
+ if (clientDocks.has(entry.id) && !force) throw new Error(`[@devframes/hub] a client dock "${entry.id}" is already registered — pass force to overwrite`);
227
+ clientDocks.set(entry.id, entry);
228
+ refreshEntries();
229
+ return {
230
+ update: (patch) => {
231
+ if (patch.id && patch.id !== entry.id) throw new Error(`[@devframes/hub] cannot change a dock id ("${entry.id}" → "${patch.id}")`);
232
+ const existing = clientDocks.get(entry.id);
233
+ if (!existing) throw new Error(`[@devframes/hub] client dock "${entry.id}" was removed — register it again to update`);
234
+ clientDocks.set(entry.id, {
235
+ ...existing,
236
+ ...patch
237
+ });
238
+ refreshEntries();
239
+ },
240
+ dispose: () => {
241
+ if (clientDocks.delete(entry.id)) refreshEntries();
242
+ }
243
+ };
244
+ },
245
+ update(entry) {
246
+ if (!clientDocks.has(entry.id)) throw new Error(`[@devframes/hub] no client dock "${entry.id}" to update — register it first`);
247
+ clientDocks.set(entry.id, entry);
248
+ refreshEntries();
249
+ }
207
250
  };
208
251
  }
209
252
  async function switchEntry(id) {
@@ -293,7 +336,7 @@ async function createDevframeClientHost(options = {}) {
293
336
  return entry.action ?? entry.renderer ?? entry.clientScript;
294
337
  }
295
338
  function loadClientScripts() {
296
- for (const entry of docksState.value()) {
339
+ for (const entry of currentEntries()) {
297
340
  const script = clientScriptOf(entry);
298
341
  if (!script?.importFrom || loadedScripts.has(entry.id)) continue;
299
342
  loadedScripts.add(entry.id);
@@ -344,9 +387,12 @@ function createPanelContext(clientType) {
344
387
  };
345
388
  }
346
389
  function groupByCategory(entries) {
390
+ const groupsById = /* @__PURE__ */ new Map();
391
+ for (const entry of entries) if (entry.type === "group") groupsById.set(entry.id, entry);
347
392
  const groups = /* @__PURE__ */ new Map();
348
393
  for (const entry of entries) {
349
- const category = entry.category ?? "default";
394
+ const resolvedGroup = entry.groupId ? groupsById.get(entry.groupId) : void 0;
395
+ const category = resolvedGroup ? resolvedGroup.category ?? "default" : entry.category ?? "default";
350
396
  let list = groups.get(category);
351
397
  if (!list) {
352
398
  list = [];
@@ -442,4 +488,4 @@ async function connectRemoteDevframe(options = {}) {
442
488
  });
443
489
  }
444
490
  //#endregion
445
- export { CLIENT_CONTEXT_KEY, connectRemoteDevframe, createDevframeClientHost, createMessagesClient, getDevframeClientContext, parseRemoteConnection, setDevframeClientContext };
491
+ export { CLIENT_CONTEXT_KEY, DEFAULT_CATEGORIES_ORDER, connectRemoteDevframe, createDevframeClientHost, createMessagesClient, getDevframeClientContext, parseRemoteConnection, setDevframeClientContext };
@@ -1,6 +1,16 @@
1
- import { t as DevframeDocksUserSettings } from "./settings-C5cAtNdE.mjs";
1
+ import { t as DevframeDocksUserSettings } from "./settings-Chx2aDL_.mjs";
2
2
  export * from "devframe/constants";
3
3
  //#region src/constants.d.ts
4
+ /**
5
+ * The default ordering weight for each known dock category — lower sorts
6
+ * earlier. Downstream viewers (e.g. `@vitejs/devtools-kit`) import this as the
7
+ * single source of truth so the hub and its viewers agree on category order.
8
+ * `framework` sorts first; `~builtin` (the viewer's own built-in views) last.
9
+ *
10
+ * The buckets read from "closest to your app" → "platform / analysis" →
11
+ * "peripheral". Gaps between the weights are intentional: a kit can interleave
12
+ * its own categories (or override these) without editing this table.
13
+ */
4
14
  declare const DEFAULT_CATEGORIES_ORDER: Record<string, number>;
5
15
  declare const DEFAULT_STATE_USER_SETTINGS: () => DevframeDocksUserSettings;
6
16
  //#endregion
@@ -1,11 +1,25 @@
1
1
  export * from "devframe/constants";
2
2
  //#region src/constants.ts
3
+ /**
4
+ * The default ordering weight for each known dock category — lower sorts
5
+ * earlier. Downstream viewers (e.g. `@vitejs/devtools-kit`) import this as the
6
+ * single source of truth so the hub and its viewers agree on category order.
7
+ * `framework` sorts first; `~builtin` (the viewer's own built-in views) last.
8
+ *
9
+ * The buckets read from "closest to your app" → "platform / analysis" →
10
+ * "peripheral". Gaps between the weights are intentional: a kit can interleave
11
+ * its own categories (or override these) without editing this table.
12
+ */
3
13
  const DEFAULT_CATEGORIES_ORDER = {
14
+ "framework": -100,
4
15
  "default": 0,
5
16
  "app": 100,
6
- "framework": 200,
17
+ "ui": 150,
18
+ "data": 250,
7
19
  "web": 300,
20
+ "performance": 350,
8
21
  "advanced": 400,
22
+ "docs": 500,
9
23
  "~builtin": 1e3
10
24
  };
11
25
  const DEFAULT_STATE_USER_SETTINGS = () => ({
@@ -1,4 +1,4 @@
1
- import { F as JsonRenderer, P as JsonRenderSpec, S as DevframeDocksHost, c as DevframeCommandsHost, p as DevframeDockActivation, v as DevframeDockEntryIcon } from "./settings-C5cAtNdE.mjs";
1
+ import { F as JsonRenderer, P as JsonRenderSpec, S as DevframeDocksHost, c as DevframeCommandsHost, p as DevframeDockActivation, v as DevframeDockEntryIcon } from "./settings-Chx2aDL_.mjs";
2
2
  import { CreateHostContextOptions } from "devframe/node";
3
3
  import { DevframeHost, DevframeNodeContext, EventEmitter } from "devframe/types";
4
4
  import { ChildProcess } from "node:child_process";
@@ -1,5 +1,5 @@
1
- import "./context-CNKFzYdA.mjs";
2
- import "./settings-C5cAtNdE.mjs";
1
+ import "./settings-Chx2aDL_.mjs";
2
+ import "./context-BBf7f_8F.mjs";
3
3
  import { RpcDefinitionsFilter, RpcDefinitionsToFunctions } from "devframe/rpc";
4
4
  import { ConnectionMeta as ConnectionMeta$1, DevframeCapabilities, DevframeDiagnosticsDefinition, DevframeDiagnosticsHost, DevframeDiagnosticsLogger, DevframeHost as DevframeHost$1, DevframeNodeRpcSession, DevframeRpcClientFunctions, DevframeRpcServerFunctions, DevframeRpcSharedStates, DevframeViewHost, EntriesToObject, EventEmitter as EventEmitter$1, EventUnsubscribe, EventsMap, PartialWithoutId, RpcBroadcastOptions, RpcFunctionsHost, RpcSharedStateGetOptions, RpcSharedStateHost, RpcStreamingChannel, RpcStreamingChannelOptions, RpcStreamingHost, Thenable } from "devframe/types";
5
5
  export { RpcStreamingChannel as C, Thenable as E, RpcSharedStateHost as S, RpcStreamingHost as T, RpcBroadcastOptions as _, DevframeDiagnosticsLogger as a, RpcFunctionsHost as b, DevframeRpcClientFunctions as c, DevframeViewHost as d, EntriesToObject as f, PartialWithoutId as g, EventsMap as h, DevframeDiagnosticsHost as i, DevframeRpcServerFunctions as l, EventUnsubscribe as m, DevframeCapabilities as n, DevframeHost$1 as o, EventEmitter$1 as p, DevframeDiagnosticsDefinition as r, DevframeNodeRpcSession as s, ConnectionMeta$1 as t, DevframeRpcSharedStates as u, RpcDefinitionsFilter as v, RpcStreamingChannelOptions as w, RpcSharedStateGetOptions as x, RpcDefinitionsToFunctions as y };
package/dist/index.d.mts CHANGED
@@ -1,6 +1,7 @@
1
- import { C as DevframeMessagesHost, S as DevframeMessagesClient, T as DevframeMessagesListDelta, _ as DevframeMessageEntryInput, a as DevframeChildProcessOutput, b as DevframeMessageLevel, c as DevframePtyExecuteOptions, d as DevframeTerminalSessionBase, f as DevframeTerminalStatus, g as DevframeMessageEntryFrom, h as DevframeMessageEntry, i as DevframeChildProcessExecuteOptions, l as DevframePtyTerminalSession, m as DevframeMessageElementPosition, n as DevframeHubContext, o as DevframeChildProcessResult, p as DevframeTerminalsHost, s as DevframeChildProcessTerminalSession, t as CreateHubContextOptions, u as DevframeTerminalSession, v as DevframeMessageFilePosition, w as DevframeMessagesLevelShortcuts, x as DevframeMessageShortcutInput, y as DevframeMessageHandle } from "./context-CNKFzYdA.mjs";
2
- import { A as DevframeViewLauncherStatus, C as DevframeViewAction, D as DevframeViewIframe, E as DevframeViewGroup, F as JsonRenderer, M as RemoteDockOptions, N as JsonRenderElement, O as DevframeViewJsonRender, P as JsonRenderSpec, S as DevframeDocksHost, T as DevframeViewCustomRender, _ as DevframeDockEntryCategory, a as DevframeCommandHandle, b as DevframeDockUserEntry, c as DevframeCommandsHost, d as DevframeServerCommandInput, f as ClientScriptEntry, g as DevframeDockEntryBase, h as DevframeDockEntry, i as DevframeCommandEntry, j as RemoteConnectionInfo, k as DevframeViewLauncher, l as DevframeCommandsHostEvents, m as DevframeDockEntriesGrouped, n as DevframeClientCommand, o as DevframeCommandKeybinding, p as DevframeDockActivation, r as DevframeCommandBase, s as DevframeCommandShortcutOverrides, t as DevframeDocksUserSettings, u as DevframeServerCommandEntry, v as DevframeDockEntryIcon, w as DevframeViewBuiltin, x as DevframeDocksActiveState, y as DevframeDockEntryRegistry } from "./settings-C5cAtNdE.mjs";
3
- import { C as RpcStreamingChannel, E as Thenable, S as RpcSharedStateHost, T as RpcStreamingHost, _ as RpcBroadcastOptions, a as DevframeDiagnosticsLogger, b as RpcFunctionsHost, c as DevframeRpcClientFunctions, d as DevframeViewHost, f as EntriesToObject, g as PartialWithoutId, h as EventsMap, i as DevframeDiagnosticsHost, l as DevframeRpcServerFunctions, m as EventUnsubscribe, n as DevframeCapabilities, o as DevframeHost, p as EventEmitter, r as DevframeDiagnosticsDefinition, s as DevframeNodeRpcSession, t as ConnectionMeta, u as DevframeRpcSharedStates, v as RpcDefinitionsFilter, w as RpcStreamingChannelOptions, x as RpcSharedStateGetOptions, y as RpcDefinitionsToFunctions } from "./index-BeoLMW0z.mjs";
1
+ import { A as DevframeViewLauncherStatus, C as DevframeViewAction, D as DevframeViewIframe, E as DevframeViewGroup, F as JsonRenderer, M as RemoteDockOptions, N as JsonRenderElement, O as DevframeViewJsonRender, P as JsonRenderSpec, S as DevframeDocksHost, T as DevframeViewCustomRender, _ as DevframeDockEntryCategory, a as DevframeCommandHandle, b as DevframeDockUserEntry, c as DevframeCommandsHost, d as DevframeServerCommandInput, f as ClientScriptEntry, g as DevframeDockEntryBase, h as DevframeDockEntry, i as DevframeCommandEntry, j as RemoteConnectionInfo, k as DevframeViewLauncher, l as DevframeCommandsHostEvents, m as DevframeDockEntriesGrouped, n as DevframeClientCommand, o as DevframeCommandKeybinding, p as DevframeDockActivation, r as DevframeCommandBase, s as DevframeCommandShortcutOverrides, t as DevframeDocksUserSettings, u as DevframeServerCommandEntry, v as DevframeDockEntryIcon, w as DevframeViewBuiltin, x as DevframeDocksActiveState, y as DevframeDockEntryRegistry } from "./settings-Chx2aDL_.mjs";
2
+ import { DEFAULT_CATEGORIES_ORDER } from "./constants.mjs";
3
+ import { C as DevframeMessagesHost, S as DevframeMessagesClient, T as DevframeMessagesListDelta, _ as DevframeMessageEntryInput, a as DevframeChildProcessOutput, b as DevframeMessageLevel, c as DevframePtyExecuteOptions, d as DevframeTerminalSessionBase, f as DevframeTerminalStatus, g as DevframeMessageEntryFrom, h as DevframeMessageEntry, i as DevframeChildProcessExecuteOptions, l as DevframePtyTerminalSession, m as DevframeMessageElementPosition, n as DevframeHubContext, o as DevframeChildProcessResult, p as DevframeTerminalsHost, s as DevframeChildProcessTerminalSession, t as CreateHubContextOptions, u as DevframeTerminalSession, v as DevframeMessageFilePosition, w as DevframeMessagesLevelShortcuts, x as DevframeMessageShortcutInput, y as DevframeMessageHandle } from "./context-BBf7f_8F.mjs";
4
+ import { C as RpcStreamingChannel, E as Thenable, S as RpcSharedStateHost, T as RpcStreamingHost, _ as RpcBroadcastOptions, a as DevframeDiagnosticsLogger, b as RpcFunctionsHost, c as DevframeRpcClientFunctions, d as DevframeViewHost, f as EntriesToObject, g as PartialWithoutId, h as EventsMap, i as DevframeDiagnosticsHost, l as DevframeRpcServerFunctions, m as EventUnsubscribe, n as DevframeCapabilities, o as DevframeHost, p as EventEmitter, r as DevframeDiagnosticsDefinition, s as DevframeNodeRpcSession, t as ConnectionMeta, u as DevframeRpcSharedStates, v as RpcDefinitionsFilter, w as RpcStreamingChannelOptions, x as RpcSharedStateGetOptions, y as RpcDefinitionsToFunctions } from "./index-CREpXwAf.mjs";
4
5
  import { WhenContext, WhenExpression } from "devframe/utils/when";
5
6
  //#region src/define.d.ts
6
7
  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>;
@@ -19,4 +20,4 @@ declare function defineDockEntry<const T extends DevframeDockUserEntry, const W
19
20
  */
20
21
  declare function defineJsonRenderSpec(spec: JsonRenderSpec): JsonRenderSpec;
21
22
  //#endregion
22
- export { type ClientScriptEntry, type ConnectionMeta, type CreateHubContextOptions, type DevframeCapabilities, type DevframeChildProcessExecuteOptions, type DevframeChildProcessOutput, type DevframeChildProcessResult, type DevframeChildProcessTerminalSession, type DevframeClientCommand, type DevframeCommandBase, type DevframeCommandEntry, type DevframeCommandHandle, type DevframeCommandKeybinding, type DevframeCommandShortcutOverrides, type DevframeCommandsHost, type DevframeCommandsHostEvents, type DevframeDiagnosticsDefinition, type DevframeDiagnosticsHost, type DevframeDiagnosticsLogger, type DevframeDockActivation, type DevframeDockEntriesGrouped, type DevframeDockEntry, type DevframeDockEntryBase, type DevframeDockEntryCategory, type DevframeDockEntryIcon, type DevframeDockEntryRegistry, type DevframeDockUserEntry, type DevframeDocksActiveState, type DevframeDocksHost, type DevframeDocksUserSettings, type DevframeHost, type DevframeHubContext, type DevframeMessageElementPosition, type DevframeMessageEntry, type DevframeMessageEntryFrom, type DevframeMessageEntryInput, type DevframeMessageFilePosition, type DevframeMessageHandle, type DevframeMessageLevel, type DevframeMessageShortcutInput, type DevframeMessagesClient, type DevframeMessagesHost, type DevframeMessagesLevelShortcuts, type DevframeMessagesListDelta, type DevframeNodeRpcSession, type DevframePtyExecuteOptions, type DevframePtyTerminalSession, type DevframeRpcClientFunctions, type DevframeRpcServerFunctions, type DevframeRpcSharedStates, type DevframeServerCommandEntry, type DevframeServerCommandInput, type DevframeTerminalSession, type DevframeTerminalSessionBase, type DevframeTerminalStatus, type DevframeTerminalsHost, type DevframeViewAction, type DevframeViewBuiltin, type DevframeViewCustomRender, type DevframeViewGroup, type DevframeViewHost, type DevframeViewIframe, type DevframeViewJsonRender, type DevframeViewLauncher, type DevframeViewLauncherStatus, type EntriesToObject, type EventEmitter, type EventUnsubscribe, type EventsMap, type JsonRenderElement, type JsonRenderSpec, type JsonRenderer, type PartialWithoutId, type RemoteConnectionInfo, type RemoteDockOptions, type RpcBroadcastOptions, type RpcDefinitionsFilter, type RpcDefinitionsToFunctions, type RpcFunctionsHost, type RpcSharedStateGetOptions, type RpcSharedStateHost, type RpcStreamingChannel, type RpcStreamingChannelOptions, type RpcStreamingHost, type Thenable, defineCommand, defineDockEntry, defineHubRpcFunction, defineJsonRenderSpec };
23
+ export { type ClientScriptEntry, type ConnectionMeta, type CreateHubContextOptions, DEFAULT_CATEGORIES_ORDER, type DevframeCapabilities, type DevframeChildProcessExecuteOptions, type DevframeChildProcessOutput, type DevframeChildProcessResult, type DevframeChildProcessTerminalSession, type DevframeClientCommand, type DevframeCommandBase, type DevframeCommandEntry, type DevframeCommandHandle, type DevframeCommandKeybinding, type DevframeCommandShortcutOverrides, type DevframeCommandsHost, type DevframeCommandsHostEvents, type DevframeDiagnosticsDefinition, type DevframeDiagnosticsHost, type DevframeDiagnosticsLogger, type DevframeDockActivation, type DevframeDockEntriesGrouped, type DevframeDockEntry, type DevframeDockEntryBase, type DevframeDockEntryCategory, type DevframeDockEntryIcon, type DevframeDockEntryRegistry, type DevframeDockUserEntry, type DevframeDocksActiveState, type DevframeDocksHost, type DevframeDocksUserSettings, type DevframeHost, type DevframeHubContext, type DevframeMessageElementPosition, type DevframeMessageEntry, type DevframeMessageEntryFrom, type DevframeMessageEntryInput, type DevframeMessageFilePosition, type DevframeMessageHandle, type DevframeMessageLevel, type DevframeMessageShortcutInput, type DevframeMessagesClient, type DevframeMessagesHost, type DevframeMessagesLevelShortcuts, type DevframeMessagesListDelta, type DevframeNodeRpcSession, type DevframePtyExecuteOptions, type DevframePtyTerminalSession, type DevframeRpcClientFunctions, type DevframeRpcServerFunctions, type DevframeRpcSharedStates, type DevframeServerCommandEntry, type DevframeServerCommandInput, type DevframeTerminalSession, type DevframeTerminalSessionBase, type DevframeTerminalStatus, type DevframeTerminalsHost, type DevframeViewAction, type DevframeViewBuiltin, type DevframeViewCustomRender, type DevframeViewGroup, type DevframeViewHost, type DevframeViewIframe, type DevframeViewJsonRender, type DevframeViewLauncher, type DevframeViewLauncherStatus, type EntriesToObject, type EventEmitter, type EventUnsubscribe, type EventsMap, type JsonRenderElement, type JsonRenderSpec, type JsonRenderer, type PartialWithoutId, type RemoteConnectionInfo, type RemoteDockOptions, type RpcBroadcastOptions, type RpcDefinitionsFilter, type RpcDefinitionsToFunctions, type RpcFunctionsHost, type RpcSharedStateGetOptions, type RpcSharedStateHost, type RpcStreamingChannel, type RpcStreamingChannelOptions, type RpcStreamingHost, type Thenable, defineCommand, defineDockEntry, defineHubRpcFunction, defineJsonRenderSpec };
package/dist/index.mjs CHANGED
@@ -1,2 +1,3 @@
1
+ import { DEFAULT_CATEGORIES_ORDER } from "./constants.mjs";
1
2
  import { i as defineJsonRenderSpec, n as defineDockEntry, r as defineHubRpcFunction, t as defineCommand } from "./define-Pbx8dsKz.mjs";
2
- export { defineCommand, defineDockEntry, defineHubRpcFunction, defineJsonRenderSpec };
3
+ export { DEFAULT_CATEGORIES_ORDER, defineCommand, defineDockEntry, defineHubRpcFunction, defineJsonRenderSpec };
@@ -1,5 +1,6 @@
1
- import { C as DevframeMessagesHost$1, T as DevframeMessagesListDelta, _ as DevframeMessageEntryInput, c as DevframePtyExecuteOptions, d as DevframeTerminalSessionBase, h as DevframeMessageEntry, i as DevframeChildProcessExecuteOptions, l as DevframePtyTerminalSession, n as DevframeHubContext, p as DevframeTerminalsHost$1, r as createHubContext, s as DevframeChildProcessTerminalSession, t as CreateHubContextOptions, u as DevframeTerminalSession, x as DevframeMessageShortcutInput, y as DevframeMessageHandle } from "../context-CNKFzYdA.mjs";
2
- import { D as DevframeViewIframe, S as DevframeDocksHost$1, a as DevframeCommandHandle, b as DevframeDockUserEntry, c as DevframeCommandsHost$1, d as DevframeServerCommandInput, f as ClientScriptEntry, h as DevframeDockEntry, t as DevframeDocksUserSettings, u as DevframeServerCommandEntry } from "../settings-C5cAtNdE.mjs";
1
+ import { D as DevframeViewIframe, S as DevframeDocksHost$1, a as DevframeCommandHandle, b as DevframeDockUserEntry, c as DevframeCommandsHost$1, d as DevframeServerCommandInput, f as ClientScriptEntry, h as DevframeDockEntry, t as DevframeDocksUserSettings, u as DevframeServerCommandEntry } from "../settings-Chx2aDL_.mjs";
2
+ import { DEFAULT_CATEGORIES_ORDER } from "../constants.mjs";
3
+ import { C as DevframeMessagesHost$1, T as DevframeMessagesListDelta, _ as DevframeMessageEntryInput, c as DevframePtyExecuteOptions, d as DevframeTerminalSessionBase, h as DevframeMessageEntry, i as DevframeChildProcessExecuteOptions, l as DevframePtyTerminalSession, n as DevframeHubContext, p as DevframeTerminalsHost$1, r as createHubContext, s as DevframeChildProcessTerminalSession, t as CreateHubContextOptions, u as DevframeTerminalSession, x as DevframeMessageShortcutInput, y as DevframeMessageHandle } from "../context-BBf7f_8F.mjs";
3
4
  import { RpcFunctionDefinitionAny } from "devframe/rpc";
4
5
  import { DevframeDefinition } from "devframe/types";
5
6
  import { SharedState } from "devframe/utils/shared-state";
@@ -382,4 +383,4 @@ declare const builtinHubRpcDeclarations: readonly RpcFunctionDefinitionAny[];
382
383
  */
383
384
  declare function createSimpleClientScript(fn: string | ((ctx: any) => void)): ClientScriptEntry;
384
385
  //#endregion
385
- export { CreateHubContextOptions, DevframeCommandsHost, DevframeDocksHost, DevframeHubContext, DevframeMessagesHost, DevframeTerminalsHost, MountDevframeOptions, builtinHubRpcDeclarations, createHubContext, createSimpleClientScript, hubCommandsExecute, hubDocksActivate, hubMessagesAdd, hubMessagesClear, hubMessagesRemove, hubMessagesUpdate, hubTerminalsRemove, hubTerminalsResize, hubTerminalsRestart, hubTerminalsTerminate, hubTerminalsWrite, mountDevframe };
386
+ export { CreateHubContextOptions, DEFAULT_CATEGORIES_ORDER, DevframeCommandsHost, DevframeDocksHost, DevframeHubContext, DevframeMessagesHost, DevframeTerminalsHost, MountDevframeOptions, builtinHubRpcDeclarations, createHubContext, createSimpleClientScript, hubCommandsExecute, hubDocksActivate, hubMessagesAdd, hubMessagesClear, hubMessagesRemove, hubMessagesUpdate, hubTerminalsRemove, hubTerminalsResize, hubTerminalsRestart, hubTerminalsTerminate, hubTerminalsWrite, mountDevframe };
@@ -1,5 +1,5 @@
1
+ import { DEFAULT_CATEGORIES_ORDER, DEFAULT_STATE_USER_SETTINGS } from "../constants.mjs";
1
2
  import { r as defineHubRpcFunction } from "../define-Pbx8dsKz.mjs";
2
- import { DEFAULT_STATE_USER_SETTINGS } from "../constants.mjs";
3
3
  import { REMOTE_CONNECTION_KEY } from "devframe/constants";
4
4
  import { createEventEmitter } from "devframe/utils/events";
5
5
  import { createHostContext, createStorage } from "devframe/node";
@@ -6611,4 +6611,4 @@ function createSimpleClientScript(fn) {
6611
6611
  };
6612
6612
  }
6613
6613
  //#endregion
6614
- export { DevframeCommandsHost, DevframeDocksHost, DevframeMessagesHost, DevframeTerminalsHost, builtinHubRpcDeclarations, createHubContext, createSimpleClientScript, hubCommandsExecute, hubDocksActivate, hubMessagesAdd, hubMessagesClear, hubMessagesRemove, hubMessagesUpdate, hubTerminalsRemove, hubTerminalsResize, hubTerminalsRestart, hubTerminalsTerminate, hubTerminalsWrite, mountDevframe };
6614
+ export { DEFAULT_CATEGORIES_ORDER, DevframeCommandsHost, DevframeDocksHost, DevframeMessagesHost, DevframeTerminalsHost, builtinHubRpcDeclarations, createHubContext, createSimpleClientScript, hubCommandsExecute, hubDocksActivate, hubMessagesAdd, hubMessagesClear, hubMessagesRemove, hubMessagesUpdate, hubTerminalsRemove, hubTerminalsResize, hubTerminalsRestart, hubTerminalsTerminate, hubTerminalsWrite, mountDevframe };
@@ -76,7 +76,7 @@ interface DevframeDockActivation {
76
76
  interface DevframeDocksActiveState {
77
77
  activation: DevframeDockActivation | null;
78
78
  }
79
- type DevframeDockEntryCategory = 'app' | 'framework' | 'web' | 'advanced' | 'default' | '~builtin' | (string & {});
79
+ type DevframeDockEntryCategory = 'framework' | 'app' | 'ui' | 'data' | 'web' | 'performance' | 'advanced' | 'docs' | 'default' | '~builtin' | (string & {});
80
80
  type DevframeDockEntryIcon = string | {
81
81
  light: string;
82
82
  dark: string;
@@ -92,7 +92,19 @@ interface DevframeDockEntryBase {
92
92
  */
93
93
  defaultOrder?: number;
94
94
  /**
95
- * The category of the entry
95
+ * The category of the entry — a field with a dual role that depends on
96
+ * whether {@link groupId} resolves to a registered {@link DevframeViewGroup}:
97
+ *
98
+ * - **Ungrouped (or orphan) entry** — `category` is the entry's OUTER bucket
99
+ * on the dock bar, ordered by {@link import('../constants').DEFAULT_CATEGORIES_ORDER}.
100
+ * - **Grouped entry** (a `groupId` that resolves to a registered group) —
101
+ * the OUTER bucket is instead the group's own `category`, and this field is
102
+ * reinterpreted as the entry's IN-GROUP sub-category, used to sub-divide and
103
+ * sort members inside the group's popover / sub-navigation.
104
+ *
105
+ * Falls back to `'default'` when omitted — both as an outer bucket and, for a
106
+ * grouped member, as its in-group sub-bucket.
107
+ *
96
108
  * @default 'default'
97
109
  */
98
110
  category?: DevframeDockEntryCategory;
@@ -118,8 +130,14 @@ interface DevframeDockEntryBase {
118
130
  *
119
131
  * This is a flat pointer — membership, not containment. The entry stays an
120
132
  * independently-registered, top-level entry; only its rendering is grouped
121
- * downstream. If the referenced group is never registered, the entry renders
122
- * as a normal top-level entry (orphan tolerance).
133
+ * downstream.
134
+ *
135
+ * When the referenced group **is** registered, it supplies the entry's OUTER
136
+ * dock-bar category (the group's own {@link category}), and this entry's own
137
+ * {@link category} is reinterpreted as its IN-GROUP sub-category. When the
138
+ * referenced group is **never** registered, the entry renders as a normal
139
+ * top-level entry and falls back to using its own {@link category} as the
140
+ * outer bucket (orphan tolerance).
123
141
  *
124
142
  * @see {@link DevframeViewGroup}
125
143
  */
@@ -282,6 +300,12 @@ interface DevframeViewJsonRender extends DevframeDockEntryBase {
282
300
  * through the same `register`/`update`/`values` machinery as every other entry,
283
301
  * keyed by `id`.
284
302
  *
303
+ * The group's `category` is the OUTER bucket for the group button itself AND
304
+ * for every one of its members — a member's own `category` no longer decides
305
+ * its outer bucket, but is reinterpreted as an in-group sub-category that
306
+ * sub-divides and sorts members inside this group. A group with no `category`
307
+ * buckets itself and its members under `'default'`.
308
+ *
285
309
  * Grouping is one level deep: a group entry must not itself set `groupId`.
286
310
  */
287
311
  interface DevframeViewGroup extends DevframeDockEntryBase {
@@ -1,4 +1,4 @@
1
- import { C as DevframeMessagesHost, S as DevframeMessagesClient, T as DevframeMessagesListDelta, _ as DevframeMessageEntryInput, a as DevframeChildProcessOutput, b as DevframeMessageLevel, c as DevframePtyExecuteOptions, d as DevframeTerminalSessionBase, f as DevframeTerminalStatus, g as DevframeMessageEntryFrom, h as DevframeMessageEntry, i as DevframeChildProcessExecuteOptions, l as DevframePtyTerminalSession, m as DevframeMessageElementPosition, n as DevframeHubContext, o as DevframeChildProcessResult, p as DevframeTerminalsHost, s as DevframeChildProcessTerminalSession, t as CreateHubContextOptions, u as DevframeTerminalSession, v as DevframeMessageFilePosition, w as DevframeMessagesLevelShortcuts, x as DevframeMessageShortcutInput, y as DevframeMessageHandle } from "../context-CNKFzYdA.mjs";
2
- import { A as DevframeViewLauncherStatus, C as DevframeViewAction, D as DevframeViewIframe, E as DevframeViewGroup, F as JsonRenderer, M as RemoteDockOptions, N as JsonRenderElement, O as DevframeViewJsonRender, P as JsonRenderSpec, S as DevframeDocksHost, T as DevframeViewCustomRender, _ as DevframeDockEntryCategory, a as DevframeCommandHandle, b as DevframeDockUserEntry, c as DevframeCommandsHost, d as DevframeServerCommandInput, f as ClientScriptEntry, g as DevframeDockEntryBase, h as DevframeDockEntry, i as DevframeCommandEntry, j as RemoteConnectionInfo, k as DevframeViewLauncher, l as DevframeCommandsHostEvents, m as DevframeDockEntriesGrouped, n as DevframeClientCommand, o as DevframeCommandKeybinding, p as DevframeDockActivation, r as DevframeCommandBase, s as DevframeCommandShortcutOverrides, t as DevframeDocksUserSettings, u as DevframeServerCommandEntry, v as DevframeDockEntryIcon, w as DevframeViewBuiltin, x as DevframeDocksActiveState, y as DevframeDockEntryRegistry } from "../settings-C5cAtNdE.mjs";
3
- import { C as RpcStreamingChannel, E as Thenable, S as RpcSharedStateHost, T as RpcStreamingHost, _ as RpcBroadcastOptions, a as DevframeDiagnosticsLogger, b as RpcFunctionsHost, c as DevframeRpcClientFunctions, d as DevframeViewHost, f as EntriesToObject, g as PartialWithoutId, h as EventsMap, i as DevframeDiagnosticsHost, l as DevframeRpcServerFunctions, m as EventUnsubscribe, n as DevframeCapabilities, o as DevframeHost, p as EventEmitter, r as DevframeDiagnosticsDefinition, s as DevframeNodeRpcSession, t as ConnectionMeta, u as DevframeRpcSharedStates, v as RpcDefinitionsFilter, w as RpcStreamingChannelOptions, x as RpcSharedStateGetOptions, y as RpcDefinitionsToFunctions } from "../index-BeoLMW0z.mjs";
1
+ import { A as DevframeViewLauncherStatus, C as DevframeViewAction, D as DevframeViewIframe, E as DevframeViewGroup, F as JsonRenderer, M as RemoteDockOptions, N as JsonRenderElement, O as DevframeViewJsonRender, P as JsonRenderSpec, S as DevframeDocksHost, T as DevframeViewCustomRender, _ as DevframeDockEntryCategory, a as DevframeCommandHandle, b as DevframeDockUserEntry, c as DevframeCommandsHost, d as DevframeServerCommandInput, f as ClientScriptEntry, g as DevframeDockEntryBase, h as DevframeDockEntry, i as DevframeCommandEntry, j as RemoteConnectionInfo, k as DevframeViewLauncher, l as DevframeCommandsHostEvents, m as DevframeDockEntriesGrouped, n as DevframeClientCommand, o as DevframeCommandKeybinding, p as DevframeDockActivation, r as DevframeCommandBase, s as DevframeCommandShortcutOverrides, t as DevframeDocksUserSettings, u as DevframeServerCommandEntry, v as DevframeDockEntryIcon, w as DevframeViewBuiltin, x as DevframeDocksActiveState, y as DevframeDockEntryRegistry } from "../settings-Chx2aDL_.mjs";
2
+ import { C as DevframeMessagesHost, S as DevframeMessagesClient, T as DevframeMessagesListDelta, _ as DevframeMessageEntryInput, a as DevframeChildProcessOutput, b as DevframeMessageLevel, c as DevframePtyExecuteOptions, d as DevframeTerminalSessionBase, f as DevframeTerminalStatus, g as DevframeMessageEntryFrom, h as DevframeMessageEntry, i as DevframeChildProcessExecuteOptions, l as DevframePtyTerminalSession, m as DevframeMessageElementPosition, n as DevframeHubContext, o as DevframeChildProcessResult, p as DevframeTerminalsHost, s as DevframeChildProcessTerminalSession, t as CreateHubContextOptions, u as DevframeTerminalSession, v as DevframeMessageFilePosition, w as DevframeMessagesLevelShortcuts, x as DevframeMessageShortcutInput, y as DevframeMessageHandle } from "../context-BBf7f_8F.mjs";
3
+ import { C as RpcStreamingChannel, E as Thenable, S as RpcSharedStateHost, T as RpcStreamingHost, _ as RpcBroadcastOptions, a as DevframeDiagnosticsLogger, b as RpcFunctionsHost, c as DevframeRpcClientFunctions, d as DevframeViewHost, f as EntriesToObject, g as PartialWithoutId, h as EventsMap, i as DevframeDiagnosticsHost, l as DevframeRpcServerFunctions, m as EventUnsubscribe, n as DevframeCapabilities, o as DevframeHost, p as EventEmitter, r as DevframeDiagnosticsDefinition, s as DevframeNodeRpcSession, t as ConnectionMeta, u as DevframeRpcSharedStates, v as RpcDefinitionsFilter, w as RpcStreamingChannelOptions, x as RpcSharedStateGetOptions, y as RpcDefinitionsToFunctions } from "../index-CREpXwAf.mjs";
4
4
  export { ClientScriptEntry, type ConnectionMeta, type CreateHubContextOptions, type DevframeCapabilities, DevframeChildProcessExecuteOptions, DevframeChildProcessOutput, DevframeChildProcessResult, DevframeChildProcessTerminalSession, DevframeClientCommand, DevframeCommandBase, DevframeCommandEntry, DevframeCommandHandle, DevframeCommandKeybinding, DevframeCommandShortcutOverrides, DevframeCommandsHost, DevframeCommandsHostEvents, type DevframeDiagnosticsDefinition, type DevframeDiagnosticsHost, type DevframeDiagnosticsLogger, DevframeDockActivation, DevframeDockEntriesGrouped, DevframeDockEntry, DevframeDockEntryBase, DevframeDockEntryCategory, DevframeDockEntryIcon, DevframeDockEntryRegistry, DevframeDockUserEntry, DevframeDocksActiveState, DevframeDocksHost, DevframeDocksUserSettings, type DevframeHost, type DevframeHubContext, 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, DevframeViewJsonRender, DevframeViewLauncher, DevframeViewLauncherStatus, type EntriesToObject, type EventEmitter, type EventUnsubscribe, type EventsMap, JsonRenderElement, JsonRenderSpec, JsonRenderer, type PartialWithoutId, RemoteConnectionInfo, RemoteDockOptions, type RpcBroadcastOptions, type RpcDefinitionsFilter, type RpcDefinitionsToFunctions, type RpcFunctionsHost, type RpcSharedStateGetOptions, type RpcSharedStateHost, type RpcStreamingChannel, type RpcStreamingChannelOptions, type RpcStreamingHost, type Thenable };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@devframes/hub",
3
3
  "type": "module",
4
- "version": "0.7.9",
4
+ "version": "0.7.10",
5
5
  "description": "Framework-neutral hub layer for devframe — docks, terminals, messages, commands.",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -33,7 +33,7 @@
33
33
  "dist"
34
34
  ],
35
35
  "peerDependencies": {
36
- "devframe": "0.7.9"
36
+ "devframe": "0.7.10"
37
37
  },
38
38
  "dependencies": {
39
39
  "birpc": "^4.0.0",
@@ -48,7 +48,7 @@
48
48
  "@types/node": "^26.1.1",
49
49
  "mlly": "^1.8.2",
50
50
  "tsdown": "^0.22.12",
51
- "devframe": "0.7.9"
51
+ "devframe": "0.7.10"
52
52
  },
53
53
  "scripts": {
54
54
  "build": "tsdown",