@devframes/hub 0.7.6 → 0.7.8

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 { S as DevframeMessagesClient, _ as DevframeMessageEntryInput } from "../context-ChGTyDu-.mjs";
2
- import { A as RemoteConnectionInfo, b as DevframeDockUserEntry, h as DevframeDockEntry, i as DevframeCommandEntry, m as DevframeDockEntriesGrouped, n as DevframeClientCommand, o as DevframeCommandKeybinding, t as DevframeDocksUserSettings } from "../settings-ywInLQJ3.mjs";
3
- import "../index-BCVXXhEH.mjs";
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";
4
4
  import { DevframeClientRpcHost, 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";
@@ -1,4 +1,4 @@
1
- import { t as DevframeDocksUserSettings } from "./settings-ywInLQJ3.mjs";
1
+ import { t as DevframeDocksUserSettings } from "./settings-C5cAtNdE.mjs";
2
2
  export * from "devframe/constants";
3
3
  //#region src/constants.d.ts
4
4
  declare const DEFAULT_CATEGORIES_ORDER: Record<string, number>;
@@ -1,4 +1,4 @@
1
- import { S as DevframeDocksHost, c as DevframeCommandsHost, p as DevframeDockActivation, v as DevframeDockEntryIcon } from "./settings-ywInLQJ3.mjs";
1
+ import { F as JsonRenderer, P as JsonRenderSpec, S as DevframeDocksHost, c as DevframeCommandsHost, p as DevframeDockActivation, v as DevframeDockEntryIcon } from "./settings-C5cAtNdE.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";
@@ -392,14 +392,17 @@ declare module 'devframe/types' {
392
392
  /**
393
393
  * Hub-augmented node context — extends devframe's framework-neutral
394
394
  * `DevframeNodeContext` with the hub-level subsystems (`docks`,
395
- * `terminals`, `messages`, `commands`).
395
+ * `terminals`, `messages`, `commands`) and the deprecated
396
+ * `createJsonRenderer` compatibility factory.
396
397
  *
397
398
  * Framework kits further extend this with their own slots (e.g.
398
399
  * `viteConfig`, `viteServer`). Host-specific capabilities (editor open,
399
400
  * filesystem reveal, etc.) ship as kit-registered RPC functions rather
400
- * than as part of this surface. JSON-render is not part of the hub: it is
401
- * an opt-in integration (`@devframes/json-render`) that augments any
402
- * devframe context and contributes its own dock type.
401
+ * than as part of this surface. JSON-render itself is not part of the hub:
402
+ * it is an opt-in integration (`@devframes/json-render`) that augments any
403
+ * devframe context and contributes its own dock type — prefer
404
+ * `createJsonRenderView` from `@devframes/json-render/node` over the
405
+ * deprecated factory below.
403
406
  */
404
407
  interface DevframeHubContext extends DevframeNodeContext {
405
408
  readonly host: DevframeHost;
@@ -407,6 +410,16 @@ interface DevframeHubContext extends DevframeNodeContext {
407
410
  terminals: DevframeTerminalsHost;
408
411
  messages: DevframeMessagesHost;
409
412
  commands: DevframeCommandsHost;
413
+ /**
414
+ * Create a `JsonRenderer` handle for building json-render powered UIs.
415
+ *
416
+ * @deprecated json-render moved out of the hub into the opt-in
417
+ * `@devframes/json-render` integration in 0.7. This factory is kept
418
+ * working (not just type-compatible) for the 0.7 series so existing call
419
+ * sites don't break — use `createJsonRenderView(ctx, { id, spec })` from
420
+ * `@devframes/json-render/node` instead. Will be removed in 0.8.
421
+ */
422
+ createJsonRenderer: (spec: JsonRenderSpec) => JsonRenderer;
410
423
  }
411
424
  /**
412
425
  * Options for {@link createHubContext} — devframe's
@@ -0,0 +1,21 @@
1
+ import { createDefineWrapperWithContext } from "devframe/rpc";
2
+ //#region src/define.ts
3
+ const defineHubRpcFunction = createDefineWrapperWithContext();
4
+ function defineCommand(command) {
5
+ return command;
6
+ }
7
+ function defineDockEntry(entry) {
8
+ return entry;
9
+ }
10
+ /**
11
+ * @deprecated json-render moved out of the hub into the opt-in
12
+ * `@devframes/json-render` integration in 0.7. This identity helper is kept
13
+ * so existing imports keep compiling — pass your spec directly to
14
+ * `createJsonRenderView` (from `@devframes/json-render/node`) instead.
15
+ * Removed in 0.8.
16
+ */
17
+ function defineJsonRenderSpec(spec) {
18
+ return spec;
19
+ }
20
+ //#endregion
21
+ export { defineJsonRenderSpec as i, defineDockEntry as n, defineHubRpcFunction as r, defineCommand as t };
@@ -1,5 +1,5 @@
1
- import "./context-ChGTyDu-.mjs";
2
- import "./settings-ywInLQJ3.mjs";
1
+ import "./context-CNKFzYdA.mjs";
2
+ import "./settings-C5cAtNdE.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,6 @@
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-ChGTyDu-.mjs";
2
- import { A as RemoteConnectionInfo, C as DevframeViewAction, D as DevframeViewIframe, E as DevframeViewGroup, O as DevframeViewLauncher, 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 RemoteDockOptions, k as DevframeViewLauncherStatus, 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-ywInLQJ3.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-BCVXXhEH.mjs";
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";
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>;
@@ -10,5 +10,13 @@ declare function defineCommand<const W extends string = ''>(command: Omit<Devfra
10
10
  declare function defineDockEntry<const T extends DevframeDockUserEntry, const W extends string = ''>(entry: Omit<T, 'when'> & {
11
11
  when?: WhenExpression<WhenContext, W>;
12
12
  }): T;
13
+ /**
14
+ * @deprecated json-render moved out of the hub into the opt-in
15
+ * `@devframes/json-render` integration in 0.7. This identity helper is kept
16
+ * so existing imports keep compiling — pass your spec directly to
17
+ * `createJsonRenderView` (from `@devframes/json-render/node`) instead.
18
+ * Removed in 0.8.
19
+ */
20
+ declare function defineJsonRenderSpec(spec: JsonRenderSpec): JsonRenderSpec;
13
21
  //#endregion
14
- 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 DevframeViewLauncher, type DevframeViewLauncherStatus, type EntriesToObject, type EventEmitter, type EventUnsubscribe, type EventsMap, 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 };
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 };
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { n as defineDockEntry, r as defineHubRpcFunction, t as defineCommand } from "./define-Ceekw2EO.mjs";
2
- export { defineCommand, defineDockEntry, defineHubRpcFunction };
1
+ import { i as defineJsonRenderSpec, n as defineDockEntry, r as defineHubRpcFunction, t as defineCommand } from "./define-Pbx8dsKz.mjs";
2
+ export { defineCommand, defineDockEntry, defineHubRpcFunction, defineJsonRenderSpec };
@@ -1,5 +1,5 @@
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-ChGTyDu-.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-ywInLQJ3.mjs";
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";
3
3
  import { RpcFunctionDefinitionAny } from "devframe/rpc";
4
4
  import { DevframeDefinition } from "devframe/types";
5
5
  import { SharedState } from "devframe/utils/shared-state";
@@ -1,4 +1,4 @@
1
- import { r as defineHubRpcFunction } from "../define-Ceekw2EO.mjs";
1
+ import { r as defineHubRpcFunction } from "../define-Pbx8dsKz.mjs";
2
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";
@@ -1023,6 +1023,25 @@ async function createHubContext(options) {
1023
1023
  context.messages = messages;
1024
1024
  context.commands = commands;
1025
1025
  await docks.init();
1026
+ let jsonRenderCounter = 0;
1027
+ context.createJsonRenderer = (initialSpec) => {
1028
+ const stateKey = `devframe:json-render:${jsonRenderCounter++}`;
1029
+ const statePromise = context.rpc.sharedState.get(stateKey, { initialValue: initialSpec });
1030
+ return {
1031
+ _stateKey: stateKey,
1032
+ async updateSpec(spec) {
1033
+ (await statePromise).mutate(() => spec);
1034
+ },
1035
+ async updateState(newState) {
1036
+ (await statePromise).mutate((draft) => {
1037
+ draft.state = {
1038
+ ...draft.state,
1039
+ ...newState
1040
+ };
1041
+ });
1042
+ }
1043
+ };
1044
+ };
1026
1045
  const debounceMs = options.mode === "build" ? 0 : 10;
1027
1046
  const docksSharedState = await context.rpc.sharedState.get("devframe:docks", { initialValue: [] });
1028
1047
  const refreshDocks = debounce(() => {
@@ -1,4 +1,36 @@
1
1
  import { ConnectionMeta, EventEmitter } from "devframe/types";
2
+ //#region src/types/json-render.d.ts
3
+ /** @deprecated Use `DevframeJsonRenderSpec`'s element shape from `@devframes/json-render` instead. Removed in 0.8. */
4
+ interface JsonRenderElement {
5
+ type: string;
6
+ props?: Record<string, unknown>;
7
+ children?: string[];
8
+ /** json-render event bindings (e.g. `{ press: { action: "my:action" } }`) */
9
+ on?: Record<string, unknown>;
10
+ /** json-render visibility condition */
11
+ visible?: unknown;
12
+ /** json-render repeat binding */
13
+ repeat?: unknown;
14
+ /** Allow additional json-render element fields */
15
+ [key: string]: unknown;
16
+ }
17
+ /** @deprecated Use `DevframeJsonRenderSpec` from `@devframes/json-render` instead. Removed in 0.8. */
18
+ interface JsonRenderSpec {
19
+ root: string;
20
+ elements: Record<string, JsonRenderElement>;
21
+ /** Initial client-side state model for $state/$bindState expressions */
22
+ state?: Record<string, unknown>;
23
+ }
24
+ /** @deprecated Use `JsonRenderView` from `@devframes/json-render` instead. Removed in 0.8. */
25
+ interface JsonRenderer {
26
+ /** Replace the entire spec */
27
+ updateSpec: (spec: JsonRenderSpec) => void | Promise<void>;
28
+ /** Update json-render state values (shallow merge into spec.state) */
29
+ updateState: (state: Record<string, unknown>) => void | Promise<void>;
30
+ /** Internal: shared state key used by the client to subscribe */
31
+ readonly _stateKey: string;
32
+ }
33
+ //#endregion
2
34
  //#region src/types/docks.d.ts
3
35
  interface DevframeDocksHost {
4
36
  readonly views: Map<string, DevframeDockUserEntry>;
@@ -226,6 +258,20 @@ interface DevframeViewBuiltin extends DevframeDockEntryBase {
226
258
  type: '~builtin';
227
259
  id: string;
228
260
  }
261
+ /**
262
+ * @deprecated json-render moved out of the hub into the opt-in
263
+ * `@devframes/json-render` integration in 0.7, which contributes its own
264
+ * `'json-render'` entry (carrying a serializable view ref, not a live
265
+ * `JsonRenderer` handle) to {@link DevframeDockEntryRegistry} via declaration
266
+ * merging. This type is kept for compatibility but is no longer a member of
267
+ * {@link DevframeDockUserEntry} — use `@devframes/json-render/hub` instead.
268
+ * Removed in 0.8.
269
+ */
270
+ interface DevframeViewJsonRender extends DevframeDockEntryBase {
271
+ type: 'json-render';
272
+ /** JsonRenderer handle created by the deprecated ctx.createJsonRenderer() */
273
+ ui: JsonRenderer;
274
+ }
229
275
  /**
230
276
  * A dock group: a single dock-bar button that collapses every entry whose
231
277
  * {@link DevframeDockEntryBase.groupId} matches this group's `id`.
@@ -405,4 +451,4 @@ interface DevframeDocksUserSettings {
405
451
  commandShortcuts: DevframeCommandShortcutOverrides;
406
452
  }
407
453
  //#endregion
408
- export { RemoteConnectionInfo as A, DevframeViewAction as C, DevframeViewIframe as D, DevframeViewGroup as E, DevframeViewLauncher as O, DevframeDocksHost as S, DevframeViewCustomRender as T, DevframeDockEntryCategory as _, DevframeCommandHandle as a, DevframeDockUserEntry as b, DevframeCommandsHost as c, DevframeServerCommandInput as d, ClientScriptEntry as f, DevframeDockEntryBase as g, DevframeDockEntry as h, DevframeCommandEntry as i, RemoteDockOptions as j, DevframeViewLauncherStatus as k, DevframeCommandsHostEvents as l, DevframeDockEntriesGrouped as m, DevframeClientCommand as n, DevframeCommandKeybinding as o, DevframeDockActivation as p, DevframeCommandBase as r, DevframeCommandShortcutOverrides as s, DevframeDocksUserSettings as t, DevframeServerCommandEntry as u, DevframeDockEntryIcon as v, DevframeViewBuiltin as w, DevframeDocksActiveState as x, DevframeDockEntryRegistry as y };
454
+ export { DevframeViewLauncherStatus as A, DevframeViewAction as C, DevframeViewIframe as D, DevframeViewGroup as E, JsonRenderer as F, RemoteDockOptions as M, JsonRenderElement as N, DevframeViewJsonRender as O, JsonRenderSpec as P, DevframeDocksHost as S, DevframeViewCustomRender as T, DevframeDockEntryCategory as _, DevframeCommandHandle as a, DevframeDockUserEntry as b, DevframeCommandsHost as c, DevframeServerCommandInput as d, ClientScriptEntry as f, DevframeDockEntryBase as g, DevframeDockEntry as h, DevframeCommandEntry as i, RemoteConnectionInfo as j, DevframeViewLauncher as k, DevframeCommandsHostEvents as l, DevframeDockEntriesGrouped as m, DevframeClientCommand as n, DevframeCommandKeybinding as o, DevframeDockActivation as p, DevframeCommandBase as r, DevframeCommandShortcutOverrides as s, DevframeDocksUserSettings as t, DevframeServerCommandEntry as u, DevframeDockEntryIcon as v, DevframeViewBuiltin as w, DevframeDocksActiveState as x, DevframeDockEntryRegistry as y };
@@ -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-ChGTyDu-.mjs";
2
- import { A as RemoteConnectionInfo, C as DevframeViewAction, D as DevframeViewIframe, E as DevframeViewGroup, O as DevframeViewLauncher, 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 RemoteDockOptions, k as DevframeViewLauncherStatus, 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-ywInLQJ3.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-BCVXXhEH.mjs";
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, DevframeViewLauncher, DevframeViewLauncherStatus, type EntriesToObject, type EventEmitter, type EventUnsubscribe, type EventsMap, type PartialWithoutId, RemoteConnectionInfo, RemoteDockOptions, type RpcBroadcastOptions, type RpcDefinitionsFilter, type RpcDefinitionsToFunctions, type RpcFunctionsHost, type RpcSharedStateGetOptions, type RpcSharedStateHost, type RpcStreamingChannel, type RpcStreamingChannelOptions, type RpcStreamingHost, type Thenable };
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";
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.6",
4
+ "version": "0.7.8",
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.6"
36
+ "devframe": "0.7.8"
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.6"
51
+ "devframe": "0.7.8"
52
52
  },
53
53
  "scripts": {
54
54
  "build": "tsdown",
@@ -1,11 +0,0 @@
1
- import { createDefineWrapperWithContext } from "devframe/rpc";
2
- //#region src/define.ts
3
- const defineHubRpcFunction = createDefineWrapperWithContext();
4
- function defineCommand(command) {
5
- return command;
6
- }
7
- function defineDockEntry(entry) {
8
- return entry;
9
- }
10
- //#endregion
11
- export { defineDockEntry as n, defineHubRpcFunction as r, defineCommand as t };