@devframes/hub 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,7 @@
1
- import { k as DevframeMessagesClient, w as DevframeMessageEntryInput } from "../context-DM9oJvHH.mjs";
2
- import { A as DevframeViewIframe, C as DevframeDockUserEntry, F as RemoteConnectionInfo, P as NavTarget, S as DevframeDockPanelState, _ as DevframeDockEntry, a as DevframeCommandEntry, b as DevframeDockEntryIcon, g as DevframeDockEntriesGrouped, n as DevframeClientCommand, p as ClientScriptEntry, s as DevframeCommandKeybinding, t as DevframeDocksUserSettings } from "../settings-Dx8_shF9.mjs";
3
- import "../index-DPLrAsh-.mjs";
1
+ import { A as DevframeViewIframe, C as DevframeDockUserEntry, F as RemoteConnectionInfo, P as NavTarget, S as DevframeDockPanelState, _ as DevframeDockEntry, a as DevframeCommandEntry, b as DevframeDockEntryIcon, g as DevframeDockEntriesGrouped, n as DevframeClientCommand, p as ClientScriptEntry, s as DevframeCommandKeybinding, t as DevframeDocksUserSettings } from "../settings-BpxU31UN.mjs";
2
+ import { n as resolveTitle, t as matchLocale } from "../locale-C8hXdrjj.mjs";
3
+ import { k as DevframeMessagesClient, w as DevframeMessageEntryInput } from "../context-zQ5RBdmP.mjs";
4
+ import "../index-Dt6LiB-1.mjs";
4
5
  import { DevframeClientRpcHost, DevframeConnection, 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";
@@ -773,4 +774,4 @@ export declare function parseRemoteConnection(input?: string): RemoteConnectionI
773
774
  */
774
775
  export declare function connectRemoteDevframe(options?: ConnectRemoteDevframeOptions): Promise<DevframeRpcClient>;
775
776
  //#endregion
776
- export { CLIENT_CONTEXT_KEY, type DevframeClientRpcHost, type RpcClientEvents };
777
+ export { CLIENT_CONTEXT_KEY, type DevframeClientRpcHost, type RpcClientEvents, matchLocale, resolveTitle };
@@ -1,3 +1,4 @@
1
+ import { n as resolveTitle, t as matchLocale } from "../locale-BbVtoVI6.mjs";
1
2
  import { i as DOCK_RENDERERS_STATE_KEY, n as DEFAULT_STATE_USER_SETTINGS, o as HUB_EVENTS, t as DEFAULT_CATEGORIES_ORDER } from "../constants-BSPQmlA1.mjs";
2
3
  import { a as resolveClientModuleSpecifier, n as stripRemoteConnectionFromUrl, r as clientScriptFailureHint, t as buildRemoteConnectionUrl } from "../remote-url-UClKLQ5_.mjs";
3
4
  import { DEVFRAME_EVENTS, REMOTE_CONNECTION_KEY } from "devframe/constants";
@@ -586,6 +587,8 @@ async function createDevframeClientRuntime(options = {}) {
586
587
  rpc.sharedState.get(DOCK_RENDERERS_STATE_KEY, { initialValue: {} })
587
588
  ]);
588
589
  let selectedId = null;
590
+ /** Bumped by every `switchEntry` call, so a stale one can tell it was superseded. */
591
+ let switchRequest = 0;
589
592
  const entryToStateMap = /* @__PURE__ */ new Map();
590
593
  const clientDocks = /* @__PURE__ */ new Map();
591
594
  const frameNavAdapters = /* @__PURE__ */ new Map();
@@ -814,7 +817,9 @@ async function createDevframeClientRuntime(options = {}) {
814
817
  if (next !== null && !entryToStateMap.has(next)) return false;
815
818
  const entry = entryToStateMap.get(next ?? "")?.entryMeta;
816
819
  if (entry && loadScriptsEnabled && !rpc.isTrusted) return false;
820
+ const request = ++switchRequest;
817
821
  if (entry?.type === "iframe" && entry.clientScript && loadScriptsEnabled && !await preparePageScript(entry)) return false;
822
+ if (request !== switchRequest) return false;
818
823
  const previous = selectedId;
819
824
  selectedId = next;
820
825
  panel.session.selectedDockId = next;
@@ -1147,4 +1152,4 @@ async function connectRemoteDevframe(options = {}) {
1147
1152
  });
1148
1153
  }
1149
1154
  //#endregion
1150
- export { CLIENT_CONTEXT_KEY, FRAME_NAV_CHANNEL, FRAME_NAV_VERSION, attachFrameNavClient, buildRemoteDevframeUrl, clientScriptFailureHint, connectRemoteDevframe, createDevframeClientRuntime, createDockRenderersContext, createMessagesClient, getDevframeClientContext, parseRemoteConnection, resolveClientModuleSpecifier, resolveDockIcon, resolveDockUrl, setDevframeClientContext, stripRemoteConnectionFromUrl, watchFrameLocation };
1155
+ export { CLIENT_CONTEXT_KEY, FRAME_NAV_CHANNEL, FRAME_NAV_VERSION, attachFrameNavClient, buildRemoteDevframeUrl, clientScriptFailureHint, connectRemoteDevframe, createDevframeClientRuntime, createDockRenderersContext, createMessagesClient, getDevframeClientContext, matchLocale, parseRemoteConnection, resolveClientModuleSpecifier, resolveDockIcon, resolveDockUrl, resolveTitle, setDevframeClientContext, stripRemoteConnectionFromUrl, watchFrameLocation };
@@ -1,4 +1,4 @@
1
- import { t as DevframeDocksUserSettings } from "./settings-Dx8_shF9.mjs";
1
+ import { t as DevframeDocksUserSettings } from "./settings-BpxU31UN.mjs";
2
2
  //#region src/events.d.ts
3
3
  /**
4
4
  * Centralized registry of every event, broadcast, RPC method, shared-state
@@ -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-29tNOFia.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-BDyn3MWb.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,4 +1,4 @@
1
- import { A as DevframeViewIframe, T as DevframeDocksHost, b as DevframeDockEntryIcon, l as DevframeCommandsHost, m as DevframeDockActivation } from "./settings-Dx8_shF9.mjs";
1
+ import { A as DevframeViewIframe, T as DevframeDocksHost, b as DevframeDockEntryIcon, l as DevframeCommandsHost, m as DevframeDockActivation } from "./settings-BpxU31UN.mjs";
2
2
  import { CreateHostContextOptions } from "devframe/node";
3
3
  import { DevframeDefinition, DevframeHost, DevframeNodeContext, EventEmitter } from "devframe/types";
4
4
  import { ChildProcess } from "node:child_process";
@@ -1,5 +1,5 @@
1
- import "./context-DM9oJvHH.mjs";
2
- import "./settings-Dx8_shF9.mjs";
1
+ import "./settings-BpxU31UN.mjs";
2
+ import "./context-zQ5RBdmP.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";
5
5
  export { RpcStreamingHost as S, RpcFunctionsHost as _, DevframeHost$1 as a, RpcStreamingChannel as b, DevframeRpcServerFunctions as c, EventEmitter$1 as d, EventUnsubscribe as f, RpcDefinitionsToFunctions as g, RpcDefinitionsFilter as h, DevframeDiagnosticsLogger as i, DevframeRpcSharedStates as l, RpcBroadcastOptions as m, DevframeCapabilities as n, DevframeNodeRpcSession as o, EventsMap as p, DevframeDiagnosticsHost as r, DevframeRpcClientFunctions as s, ConnectionMeta$1 as t, DevframeViewHost as u, RpcSharedStateGetOptions as v, RpcStreamingChannelOptions as x, RpcSharedStateHost as y };
package/dist/index.d.mts CHANGED
@@ -1,6 +1,7 @@
1
- import { A as DevframeMessagesHost, C as DevframeMessageEntryFrom, D as DevframeMessageLevel, E as DevframeMessageHandle, M as DevframeMessagesListDelta, O as DevframeMessageShortcutInput, S as DevframeMessageEntry, T as DevframeMessageFilePosition, _ as DevframeTerminalsHost, b as DevframeMessageCommandAction, c as DevframeChildProcessResult, d as DevframePtyOutput, f as DevframePtyResult, g as DevframeTerminalStatus, h as DevframeTerminalSessionBase, j as DevframeMessagesLevelShortcuts, k as DevframeMessagesClient, l as DevframeChildProcessTerminalSession, m as DevframeTerminalSession, n as DevframeHubContext, o as DevframeChildProcessExecuteOptions, p as DevframePtyTerminalSession, s as DevframeChildProcessOutput, t as CreateHubContextOptions, u as DevframePtyExecuteOptions, v as DevframeMessageAction, w as DevframeMessageEntryInput, x as DevframeMessageElementPosition, y as DevframeMessageActivateAction } from "./context-DM9oJvHH.mjs";
2
- import { A as DevframeViewIframe, C as DevframeDockUserEntry, D as DevframeViewBuiltin, E as DevframeViewAction, F as RemoteConnectionInfo, I as RemoteDockOptions, M as DevframeViewLauncherStatus, N as FrameSubTabsConfig, O as DevframeViewCustomRender, P as NavTarget, S as DevframeDockPanelState, T as DevframeDocksHost, _ 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 DevframeViewLauncher, k as DevframeViewGroup, 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 DevframeDocksActiveState, x as DevframeDockEntryRegistry, y as DevframeDockEntryCategory } from "./settings-Dx8_shF9.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-DPLrAsh-.mjs";
1
+ import { A as DevframeViewIframe, C as DevframeDockUserEntry, D as DevframeViewBuiltin, E as DevframeViewAction, F as RemoteConnectionInfo, I as RemoteDockOptions, L as DevframeTitleLocales, M as DevframeViewLauncherStatus, N as FrameSubTabsConfig, O as DevframeViewCustomRender, P as NavTarget, R as DevframeTitled, S as DevframeDockPanelState, T as DevframeDocksHost, _ 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 DevframeViewLauncher, k as DevframeViewGroup, 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 DevframeDocksActiveState, x as DevframeDockEntryRegistry, y as DevframeDockEntryCategory } from "./settings-BpxU31UN.mjs";
2
+ import { n as resolveTitle, t as matchLocale } from "./locale-C8hXdrjj.mjs";
3
+ import { A as DevframeMessagesHost, C as DevframeMessageEntryFrom, D as DevframeMessageLevel, E as DevframeMessageHandle, M as DevframeMessagesListDelta, O as DevframeMessageShortcutInput, S as DevframeMessageEntry, T as DevframeMessageFilePosition, _ as DevframeTerminalsHost, b as DevframeMessageCommandAction, c as DevframeChildProcessResult, d as DevframePtyOutput, f as DevframePtyResult, g as DevframeTerminalStatus, h as DevframeTerminalSessionBase, j as DevframeMessagesLevelShortcuts, k as DevframeMessagesClient, l as DevframeChildProcessTerminalSession, m as DevframeTerminalSession, n as DevframeHubContext, o as DevframeChildProcessExecuteOptions, p as DevframePtyTerminalSession, s as DevframeChildProcessOutput, t as CreateHubContextOptions, u as DevframePtyExecuteOptions, v as DevframeMessageAction, w as DevframeMessageEntryInput, x as DevframeMessageElementPosition, y as DevframeMessageActivateAction } from "./context-zQ5RBdmP.mjs";
4
+ 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-Dt6LiB-1.mjs";
4
5
  import { WhenContext, WhenExpression } from "devframe/utils/when";
5
6
  //#region src/define.d.ts
6
7
  export 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>;
@@ -12,4 +13,4 @@ export declare function defineDockEntry<const T extends DevframeDockUserEntry, c
12
13
  visibility?: WhenExpression<WhenContext, V>;
13
14
  }): T;
14
15
  //#endregion
15
- export type { ClientScriptEntry, ConnectionMeta, CreateHubContextOptions, DevframeCapabilities, DevframeChildProcessExecuteOptions, DevframeChildProcessOutput, DevframeChildProcessResult, DevframeChildProcessTerminalSession, DevframeClientCommand, DevframeCommandAgentOptions, DevframeCommandBase, DevframeCommandEntry, DevframeCommandHandle, DevframeCommandKeybinding, DevframeCommandShortcutOverrides, DevframeCommandsHost, DevframeCommandsHostEvents, DevframeDiagnosticsHost, DevframeDiagnosticsLogger, DevframeDockActivation, DevframeDockBadgeVariant, DevframeDockEntriesGrouped, DevframeDockEntry, DevframeDockEntryBase, DevframeDockEntryCategory, DevframeDockEntryIcon, DevframeDockEntryRegistry, DevframeDockPanelState, DevframeDockUserEntry, DevframeDocksActiveState, DevframeDocksHost, DevframeDocksUserSettings, DevframeHost, DevframeHubContext, DevframeMessageAction, DevframeMessageActivateAction, DevframeMessageCommandAction, DevframeMessageElementPosition, DevframeMessageEntry, DevframeMessageEntryFrom, DevframeMessageEntryInput, DevframeMessageFilePosition, DevframeMessageHandle, DevframeMessageLevel, DevframeMessageShortcutInput, DevframeMessagesClient, DevframeMessagesHost, DevframeMessagesLevelShortcuts, DevframeMessagesListDelta, DevframeNodeRpcSession, DevframePtyExecuteOptions, DevframePtyOutput, DevframePtyResult, DevframePtyTerminalSession, DevframeRpcClientFunctions, DevframeRpcServerFunctions, DevframeRpcSharedStates, DevframeServerCommandEntry, DevframeServerCommandInput, DevframeTerminalSession, DevframeTerminalSessionBase, DevframeTerminalStatus, DevframeTerminalsHost, DevframeViewAction, DevframeViewBuiltin, DevframeViewCustomRender, DevframeViewGroup, DevframeViewHost, DevframeViewIframe, DevframeViewLauncher, DevframeViewLauncherStatus, EventEmitter, EventUnsubscribe, EventsMap, FrameSubTabsConfig, NavTarget, RemoteConnectionInfo, RemoteDockOptions, RpcBroadcastOptions, RpcDefinitionsFilter, RpcDefinitionsToFunctions, RpcFunctionsHost, RpcSharedStateGetOptions, RpcSharedStateHost, RpcStreamingChannel, RpcStreamingChannelOptions, RpcStreamingHost };
16
+ export { type ClientScriptEntry, type ConnectionMeta, type CreateHubContextOptions, type DevframeCapabilities, type DevframeChildProcessExecuteOptions, type DevframeChildProcessOutput, type DevframeChildProcessResult, type DevframeChildProcessTerminalSession, type DevframeClientCommand, type DevframeCommandAgentOptions, type DevframeCommandBase, type DevframeCommandEntry, type DevframeCommandHandle, type DevframeCommandKeybinding, type DevframeCommandShortcutOverrides, type DevframeCommandsHost, type DevframeCommandsHostEvents, type DevframeDiagnosticsHost, type DevframeDiagnosticsLogger, type DevframeDockActivation, type DevframeDockBadgeVariant, type DevframeDockEntriesGrouped, type DevframeDockEntry, type DevframeDockEntryBase, type DevframeDockEntryCategory, type DevframeDockEntryIcon, type DevframeDockEntryRegistry, type DevframeDockPanelState, type DevframeDockUserEntry, type DevframeDocksActiveState, type DevframeDocksHost, type DevframeDocksUserSettings, type DevframeHost, type DevframeHubContext, type DevframeMessageAction, type DevframeMessageActivateAction, type DevframeMessageCommandAction, 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 DevframePtyOutput, type DevframePtyResult, type DevframePtyTerminalSession, type DevframeRpcClientFunctions, type DevframeRpcServerFunctions, type DevframeRpcSharedStates, type DevframeServerCommandEntry, type DevframeServerCommandInput, type DevframeTerminalSession, type DevframeTerminalSessionBase, type DevframeTerminalStatus, type DevframeTerminalsHost, type DevframeTitleLocales, type DevframeTitled, type DevframeViewAction, type DevframeViewBuiltin, type DevframeViewCustomRender, type DevframeViewGroup, type DevframeViewHost, type DevframeViewIframe, type DevframeViewLauncher, type DevframeViewLauncherStatus, type EventEmitter, type EventUnsubscribe, type EventsMap, type FrameSubTabsConfig, type NavTarget, type RemoteConnectionInfo, type RemoteDockOptions, type RpcBroadcastOptions, type RpcDefinitionsFilter, type RpcDefinitionsToFunctions, type RpcFunctionsHost, type RpcSharedStateGetOptions, type RpcSharedStateHost, type RpcStreamingChannel, type RpcStreamingChannelOptions, type RpcStreamingHost, matchLocale, resolveTitle };
package/dist/index.mjs CHANGED
@@ -1,2 +1,3 @@
1
1
  import { n as defineDockEntry, r as defineHubRpcFunction, t as defineCommand } from "./define-Ceekw2EO.mjs";
2
- export { defineCommand, defineDockEntry, defineHubRpcFunction };
2
+ import { n as resolveTitle, t as matchLocale } from "./locale-BbVtoVI6.mjs";
3
+ export { defineCommand, defineDockEntry, defineHubRpcFunction, matchLocale, resolveTitle };
@@ -0,0 +1,28 @@
1
+ //#region src/locale.ts
2
+ /**
3
+ * Pick the tag in `available` closest to `tag`: exact match first, then
4
+ * the Traditional Chinese family (`zh-Hant`, `zh-HK`, `zh-MO` → `zh-TW`),
5
+ * then the first tag sharing the language (`pt-PT` → `pt-BR`, `en-GB` → `en`).
6
+ */
7
+ function matchLocale(tag, available) {
8
+ if (!tag) return void 0;
9
+ const tags = [...available];
10
+ const wanted = tag.toLowerCase();
11
+ const exact = tags.find((code) => code.toLowerCase() === wanted);
12
+ if (exact) return exact;
13
+ const [language, ...rest] = wanted.split("-");
14
+ if (language === "zh" && rest.some((part) => part === "hant" || part === "hk" || part === "mo" || part === "tw")) {
15
+ const traditional = tags.find((code) => code.toLowerCase() === "zh-tw");
16
+ if (traditional) return traditional;
17
+ }
18
+ return tags.find((code) => code.toLowerCase().split("-")[0] === language);
19
+ }
20
+ /** The `title` of a dock entry, command or launcher in `locale`, else its default `title`. */
21
+ function resolveTitle(titled, locale) {
22
+ const locales = titled.titleLocales;
23
+ if (!locales) return titled.title;
24
+ const matched = matchLocale(locale, Object.keys(locales));
25
+ return matched ? locales[matched] : titled.title;
26
+ }
27
+ //#endregion
28
+ export { resolveTitle as n, matchLocale as t };
@@ -0,0 +1,12 @@
1
+ import { R as DevframeTitled } from "./settings-BpxU31UN.mjs";
2
+ //#region src/locale.d.ts
3
+ /**
4
+ * Pick the tag in `available` closest to `tag`: exact match first, then
5
+ * the Traditional Chinese family (`zh-Hant`, `zh-HK`, `zh-MO` → `zh-TW`),
6
+ * then the first tag sharing the language (`pt-PT` → `pt-BR`, `en-GB` → `en`).
7
+ */
8
+ declare function matchLocale(tag: string | undefined, available: Iterable<string>): string | undefined;
9
+ /** The `title` of a dock entry, command or launcher in `locale`, else its default `title`. */
10
+ declare function resolveTitle(titled: DevframeTitled, locale: string | undefined): string;
11
+ //#endregion
12
+ export { resolveTitle as n, matchLocale as t };
@@ -1,4 +1,4 @@
1
- import { n as DevframeHubContext, t as CreateHubContextOptions } from "../context-DM9oJvHH.mjs";
1
+ import { n as DevframeHubContext, t as CreateHubContextOptions } from "../context-zQ5RBdmP.mjs";
2
2
  import { DevframeHubUi, DevframesInput, DockRendererRegistration } from "./initiate.mjs";
3
3
  import { DevframeServiceInput, DevframeStorageScope } from "devframe/types";
4
4
  //#region src/node/build.d.ts
@@ -1,5 +1,5 @@
1
- import { A as DevframeMessagesHost$1, E as DevframeMessageHandle, M as DevframeMessagesListDelta, O as DevframeMessageShortcutInput, S as DevframeMessageEntry, _ as DevframeTerminalsHost$1, a as InstallDevframeOptions, h as DevframeTerminalSessionBase, i as createHubContext, l as DevframeChildProcessTerminalSession, m as DevframeTerminalSession, n as DevframeHubContext, o as DevframeChildProcessExecuteOptions, p as DevframePtyTerminalSession, r as HubMountedFrame, t as CreateHubContextOptions, u as DevframePtyExecuteOptions, w as DevframeMessageEntryInput } from "../context-DM9oJvHH.mjs";
2
- import { C as DevframeDockUserEntry, T as DevframeDocksHost$1, _ as DevframeDockEntry, d as DevframeServerCommandEntry, f as DevframeServerCommandInput, l as DevframeCommandsHost$1, o as DevframeCommandHandle, p as ClientScriptEntry, t as DevframeDocksUserSettings } from "../settings-Dx8_shF9.mjs";
1
+ import { C as DevframeDockUserEntry, T as DevframeDocksHost$1, _ as DevframeDockEntry, d as DevframeServerCommandEntry, f as DevframeServerCommandInput, l as DevframeCommandsHost$1, o as DevframeCommandHandle, p as ClientScriptEntry, t as DevframeDocksUserSettings } from "../settings-BpxU31UN.mjs";
2
+ import { A as DevframeMessagesHost$1, E as DevframeMessageHandle, M as DevframeMessagesListDelta, O as DevframeMessageShortcutInput, S as DevframeMessageEntry, _ as DevframeTerminalsHost$1, a as InstallDevframeOptions, h as DevframeTerminalSessionBase, i as createHubContext, l as DevframeChildProcessTerminalSession, m as DevframeTerminalSession, n as DevframeHubContext, o as DevframeChildProcessExecuteOptions, p as DevframePtyTerminalSession, r as HubMountedFrame, t as CreateHubContextOptions, u as DevframePtyExecuteOptions, w as DevframeMessageEntryInput } from "../context-zQ5RBdmP.mjs";
3
3
  import { RpcFunctionDefinitionAny } from "devframe/rpc";
4
4
  import { SharedState } from "devframe/utils/shared-state";
5
5
  //#region src/node/host-commands.d.ts
@@ -1,5 +1,5 @@
1
- import { a as InstallDevframeOptions, n as DevframeHubContext, t as CreateHubContextOptions } from "../context-DM9oJvHH.mjs";
2
- import { r as DEVFRAMES_HUB_BASE } from "../constants-29tNOFia.mjs";
1
+ import { a as InstallDevframeOptions, n as DevframeHubContext, t as CreateHubContextOptions } from "../context-zQ5RBdmP.mjs";
2
+ import { r as DEVFRAMES_HUB_BASE } from "../constants-BDyn3MWb.mjs";
3
3
  import { DevframeInstanceRecord } from "devframe/internal";
4
4
  import { Buffer } from "node:buffer";
5
5
  import { AuthBannerFunction } from "devframe/recipes/interactive-auth";
@@ -1,4 +1,18 @@
1
1
  import { ConnectionMeta, EventEmitter } from "devframe/types";
2
+ //#region src/types/locale.d.ts
3
+ /**
4
+ * Translations of a `title`, keyed by BCP 47 tag (`'zh-CN'`, `'ja'`). The
5
+ * plain `title` stays the default and is what a reader shows when no tag
6
+ * matches, so a registrant adds languages without breaking a reader that
7
+ * ignores this field. Resolve with `resolveTitle()` from `@devframes/hub`.
8
+ */
9
+ type DevframeTitleLocales = Record<string, string>;
10
+ /** Anything carrying a `title` with optional translations: a dock entry, a command, a launcher. */
11
+ interface DevframeTitled {
12
+ title: string;
13
+ titleLocales?: DevframeTitleLocales;
14
+ }
15
+ //#endregion
2
16
  //#region ../../node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/dist/index.d.ts
3
17
  /** The Standard Typed interface. This is a base type extended by other specs. */
4
18
  interface StandardTypedV1<Input = unknown, Output = Input> {
@@ -143,6 +157,8 @@ type DevframeDockBadgeVariant = 'default' | 'info' | 'success' | 'warning' | 'da
143
157
  interface DevframeDockEntryBase {
144
158
  id: string;
145
159
  title: string;
160
+ /** Translations of `title` by BCP 47 tag; see `resolveTitle()` from `@devframes/hub`. */
161
+ titleLocales?: DevframeTitleLocales;
146
162
  icon: DevframeDockEntryIcon;
147
163
  /**
148
164
  * The default order of the entry in the dock.
@@ -402,6 +418,7 @@ interface DevframeViewLauncher extends DevframeDockEntryBase {
402
418
  launcher: {
403
419
  icon?: DevframeDockEntryIcon;
404
420
  title: string;
421
+ titleLocales?: DevframeTitleLocales;
405
422
  status?: DevframeViewLauncherStatus;
406
423
  error?: string;
407
424
  description?: string;
@@ -561,6 +578,8 @@ interface DevframeCommandBase {
561
578
  */
562
579
  id: string;
563
580
  title: string;
581
+ /** Translations of `title` by BCP 47 tag; see `resolveTitle()` from `@devframes/hub`. */
582
+ titleLocales?: DevframeTitleLocales;
564
583
  description?: string;
565
584
  /**
566
585
  * Icon for the command. Either an Iconify icon string (e.g. "ph:pencil-duotone")
@@ -735,4 +754,4 @@ interface DevframeDocksUserSettings {
735
754
  commandShortcuts: DevframeCommandShortcutOverrides;
736
755
  }
737
756
  //#endregion
738
- export { DevframeViewIframe as A, DevframeDockUserEntry as C, DevframeViewBuiltin as D, DevframeViewAction as E, RemoteConnectionInfo as F, RemoteDockOptions as I, DevframeViewLauncherStatus as M, FrameSubTabsConfig as N, DevframeViewCustomRender as O, NavTarget as P, DevframeDockPanelState as S, DevframeDocksHost as T, DevframeDockEntry as _, DevframeCommandEntry as a, DevframeDockEntryIcon as b, DevframeCommandShortcutOverrides as c, DevframeServerCommandEntry as d, DevframeServerCommandInput as f, DevframeDockEntriesGrouped as g, DevframeDockBadgeVariant as h, DevframeCommandBase as i, DevframeViewLauncher as j, DevframeViewGroup as k, DevframeCommandsHost as l, DevframeDockActivation as m, DevframeClientCommand as n, DevframeCommandHandle as o, ClientScriptEntry as p, DevframeCommandAgentOptions as r, DevframeCommandKeybinding as s, DevframeDocksUserSettings as t, DevframeCommandsHostEvents as u, DevframeDockEntryBase as v, DevframeDocksActiveState as w, DevframeDockEntryRegistry as x, DevframeDockEntryCategory as y };
757
+ export { DevframeViewIframe as A, DevframeDockUserEntry as C, DevframeViewBuiltin as D, DevframeViewAction as E, RemoteConnectionInfo as F, RemoteDockOptions as I, DevframeTitleLocales as L, DevframeViewLauncherStatus as M, FrameSubTabsConfig as N, DevframeViewCustomRender as O, NavTarget as P, DevframeTitled as R, DevframeDockPanelState as S, DevframeDocksHost as T, DevframeDockEntry as _, DevframeCommandEntry as a, DevframeDockEntryIcon as b, DevframeCommandShortcutOverrides as c, DevframeServerCommandEntry as d, DevframeServerCommandInput as f, DevframeDockEntriesGrouped as g, DevframeDockBadgeVariant as h, DevframeCommandBase as i, DevframeViewLauncher as j, DevframeViewGroup as k, DevframeCommandsHost as l, DevframeDockActivation as m, DevframeClientCommand as n, DevframeCommandHandle as o, ClientScriptEntry as p, DevframeCommandAgentOptions as r, DevframeCommandKeybinding as s, DevframeDocksUserSettings as t, DevframeCommandsHostEvents as u, DevframeDockEntryBase as v, DevframeDocksActiveState as w, DevframeDockEntryRegistry as x, DevframeDockEntryCategory as y };
@@ -1,4 +1,4 @@
1
- import { A as DevframeMessagesHost, C as DevframeMessageEntryFrom, D as DevframeMessageLevel, E as DevframeMessageHandle, M as DevframeMessagesListDelta, O as DevframeMessageShortcutInput, S as DevframeMessageEntry, T as DevframeMessageFilePosition, _ as DevframeTerminalsHost, b as DevframeMessageCommandAction, c as DevframeChildProcessResult, d as DevframePtyOutput, f as DevframePtyResult, g as DevframeTerminalStatus, h as DevframeTerminalSessionBase, j as DevframeMessagesLevelShortcuts, k as DevframeMessagesClient, l as DevframeChildProcessTerminalSession, m as DevframeTerminalSession, n as DevframeHubContext, o as DevframeChildProcessExecuteOptions, p as DevframePtyTerminalSession, s as DevframeChildProcessOutput, t as CreateHubContextOptions, u as DevframePtyExecuteOptions, v as DevframeMessageAction, w as DevframeMessageEntryInput, x as DevframeMessageElementPosition, y as DevframeMessageActivateAction } from "../context-DM9oJvHH.mjs";
2
- import { A as DevframeViewIframe, C as DevframeDockUserEntry, D as DevframeViewBuiltin, E as DevframeViewAction, F as RemoteConnectionInfo, I as RemoteDockOptions, M as DevframeViewLauncherStatus, N as FrameSubTabsConfig, O as DevframeViewCustomRender, P as NavTarget, S as DevframeDockPanelState, T as DevframeDocksHost, _ 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 DevframeViewLauncher, k as DevframeViewGroup, 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 DevframeDocksActiveState, x as DevframeDockEntryRegistry, y as DevframeDockEntryCategory } from "../settings-Dx8_shF9.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-DPLrAsh-.mjs";
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, DevframeDockPanelState, 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, DevframePtyOutput, DevframePtyResult, 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 };
1
+ import { A as DevframeViewIframe, C as DevframeDockUserEntry, D as DevframeViewBuiltin, E as DevframeViewAction, F as RemoteConnectionInfo, I as RemoteDockOptions, L as DevframeTitleLocales, M as DevframeViewLauncherStatus, N as FrameSubTabsConfig, O as DevframeViewCustomRender, P as NavTarget, R as DevframeTitled, S as DevframeDockPanelState, T as DevframeDocksHost, _ 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 DevframeViewLauncher, k as DevframeViewGroup, 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 DevframeDocksActiveState, x as DevframeDockEntryRegistry, y as DevframeDockEntryCategory } from "../settings-BpxU31UN.mjs";
2
+ import { A as DevframeMessagesHost, C as DevframeMessageEntryFrom, D as DevframeMessageLevel, E as DevframeMessageHandle, M as DevframeMessagesListDelta, O as DevframeMessageShortcutInput, S as DevframeMessageEntry, T as DevframeMessageFilePosition, _ as DevframeTerminalsHost, b as DevframeMessageCommandAction, c as DevframeChildProcessResult, d as DevframePtyOutput, f as DevframePtyResult, g as DevframeTerminalStatus, h as DevframeTerminalSessionBase, j as DevframeMessagesLevelShortcuts, k as DevframeMessagesClient, l as DevframeChildProcessTerminalSession, m as DevframeTerminalSession, n as DevframeHubContext, o as DevframeChildProcessExecuteOptions, p as DevframePtyTerminalSession, s as DevframeChildProcessOutput, t as CreateHubContextOptions, u as DevframePtyExecuteOptions, v as DevframeMessageAction, w as DevframeMessageEntryInput, x as DevframeMessageElementPosition, y as DevframeMessageActivateAction } from "../context-zQ5RBdmP.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-Dt6LiB-1.mjs";
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, DevframeDockPanelState, 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, DevframePtyOutput, DevframePtyResult, DevframePtyTerminalSession, type DevframeRpcClientFunctions, type DevframeRpcServerFunctions, type DevframeRpcSharedStates, DevframeServerCommandEntry, DevframeServerCommandInput, DevframeTerminalSession, DevframeTerminalSessionBase, DevframeTerminalStatus, DevframeTerminalsHost, DevframeTitleLocales, DevframeTitled, 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": "1.1.0",
4
+ "version": "1.2.0",
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",
@@ -35,8 +35,8 @@
35
35
  "dist"
36
36
  ],
37
37
  "peerDependencies": {
38
- "@devframes/agentic": "1.1.0",
39
- "devframe": "1.1.0"
38
+ "@devframes/agentic": "1.2.0",
39
+ "devframe": "1.2.0"
40
40
  },
41
41
  "peerDependenciesMeta": {
42
42
  "@devframes/agentic": {
@@ -51,10 +51,10 @@
51
51
  "zigpty": "^0.2.1"
52
52
  },
53
53
  "devDependencies": {
54
- "@devframes/agentic": "1.1.0",
54
+ "@devframes/agentic": "1.2.0",
55
55
  "@standard-schema/spec": "^1.1.0",
56
- "@types/node": "^26.6.2",
57
- "devframe": "1.1.0",
56
+ "@types/node": "^26.6.4",
57
+ "devframe": "1.2.0",
58
58
  "get-port-please": "^3.2.0",
59
59
  "tsdown": "^0.23.0",
60
60
  "valibot": "^1.5.0"