@devframes/hub 0.8.1 → 0.9.0-beta.1

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 { C as DevframeDocksHost, L as JsonRenderSpec, R as JsonRenderer, l as DevframeCommandsHost, m as DevframeDockActivation, y as DevframeDockEntryIcon } from "./settings-Byh48aCd.mjs";
1
+ import { D as DevframeViewIframe, S as DevframeDocksHost, c as DevframeCommandsHost, p as DevframeDockActivation, v as DevframeDockEntryIcon } from "./commands-CAcTUSlj.mjs";
2
2
  import { CreateHostContextOptions } from "devframe/node";
3
- import { DevframeHost, DevframeNodeContext, EventEmitter } from "devframe/types";
3
+ import { DevframeDefinition, DevframeHost, DevframeNodeContext, EventEmitter } from "devframe/types";
4
4
  import { ChildProcess } from "node:child_process";
5
5
  //#region src/types/messages.d.ts
6
6
  type DevframeMessageLevel = 'info' | 'warn' | 'error' | 'success' | 'debug';
@@ -47,7 +47,25 @@ interface DevframeMessageActivateAction {
47
47
  params?: Record<string, unknown>;
48
48
  };
49
49
  }
50
- type DevframeMessageAction = DevframeMessageActivateAction;
50
+ /**
51
+ * `'command'` invokes a command from the hub's command registry (the same
52
+ * registry backing the command palette) by `command.id`, spreading
53
+ * `command.params` as its positional arguments, via the hub's
54
+ * `hub:commands:execute` RPC.
55
+ */
56
+ interface DevframeMessageCommandAction {
57
+ /** Stable id for the action within its entry. */
58
+ id: string;
59
+ /** Button label shown in the messages panel. */
60
+ label: string;
61
+ kind: 'command';
62
+ /** The command to invoke, plus an optional list of positional arguments. */
63
+ command: {
64
+ id: string;
65
+ params?: unknown[];
66
+ };
67
+ }
68
+ type DevframeMessageAction = DevframeMessageActivateAction | DevframeMessageCommandAction;
51
69
  interface DevframeMessageEntry {
52
70
  /**
53
71
  * Unique identifier for this message entry (auto-generated if not provided)
@@ -319,6 +337,7 @@ interface DevframeChildProcessTerminalSession extends DevframeTerminalSession {
319
337
  */
320
338
  getResult: () => DevframeChildProcessResult;
321
339
  terminate: () => Promise<void>;
340
+ /** Throws `DF8206` once the session's output stream has closed (after a natural exit or `terminate()`) — drop it with `ctx.terminals.remove(session)` and start a fresh session instead. */
322
341
  restart: () => Promise<void>;
323
342
  }
324
343
  interface DevframePtyExecuteOptions {
@@ -342,9 +361,27 @@ interface DevframePtyTerminalSession extends DevframeTerminalSession {
342
361
  /** Current foreground process name, when the backend can resolve it. */
343
362
  getProcessName: () => string | undefined;
344
363
  terminate: () => Promise<void>;
364
+ /** Throws `DF8206` once the session's output stream has closed (after a natural exit or `terminate()`) — drop it with `ctx.terminals.remove(session)` and start a fresh session instead. */
345
365
  restart: () => Promise<void>;
346
366
  }
347
367
  //#endregion
368
+ //#region src/node/install-devframe.d.ts
369
+ interface InstallDevframeOptions {
370
+ /**
371
+ * Mount path override. Defaults to `d.basePath` or `/__${d.id}/`.
372
+ */
373
+ base?: string;
374
+ /**
375
+ * Per-mount overrides for the auto-synthesized iframe dock entry. Use
376
+ * this to customize the entry's `category`, override the icon, hide it
377
+ * via `when` (or only its dock-bar button via `visibility`), etc. Takes
378
+ * precedence over the definition's own {@link DevframeDefinition.dock}
379
+ * defaults. Cannot change `id`, `type`, or `url` — those are derived from
380
+ * the devframe definition.
381
+ */
382
+ dock?: Partial<Omit<DevframeViewIframe, 'id' | 'type' | 'url'>>;
383
+ }
384
+ //#endregion
348
385
  //#region src/node/context.d.ts
349
386
  declare module 'devframe/types' {
350
387
  interface DevframeRpcClientFunctions {
@@ -419,17 +456,15 @@ declare module 'devframe/types' {
419
456
  /**
420
457
  * Hub-augmented node context — extends devframe's framework-neutral
421
458
  * `DevframeNodeContext` with the hub-level subsystems (`docks`,
422
- * `terminals`, `messages`, `commands`) and the deprecated
423
- * `createJsonRenderer` compatibility factory.
459
+ * `terminals`, `messages`, `commands`).
424
460
  *
425
461
  * Framework kits further extend this with their own slots (e.g.
426
462
  * `viteConfig`, `viteServer`). Host-specific capabilities (editor open,
427
463
  * filesystem reveal, etc.) ship as kit-registered RPC functions rather
428
- * than as part of this surface. JSON-render itself is not part of the hub:
429
- * it is an opt-in integration (`@devframes/json-render`) that augments any
430
- * devframe context and contributes its own dock type — prefer
431
- * `createJsonRenderView` from `@devframes/json-render/node` over the
432
- * deprecated factory below.
464
+ * than as part of this surface. JSON-render is an opt-in integration
465
+ * (`@devframes/json-render`) that augments any devframe context and
466
+ * contributes its own dock type — use `createJsonRenderView` from
467
+ * `@devframes/json-render/node`.
433
468
  */
434
469
  interface DevframeHubContext extends DevframeNodeContext {
435
470
  readonly host: DevframeHost;
@@ -438,15 +473,13 @@ interface DevframeHubContext extends DevframeNodeContext {
438
473
  messages: DevframeMessagesHost;
439
474
  commands: DevframeCommandsHost;
440
475
  /**
441
- * Create a `JsonRenderer` handle for building json-render powered UIs.
442
- *
443
- * @deprecated json-render moved out of the hub into the opt-in
444
- * `@devframes/json-render` integration in 0.7. This factory is kept
445
- * working (not just type-compatible) for the 0.7 series so existing call
446
- * sites don't break — use `createJsonRenderView(ctx, { id, spec })` from
447
- * `@devframes/json-render/node` instead. Will be removed in 0.8.
476
+ * Install a {@link DevframeDefinition} into this hub: serve its SPA at the
477
+ * resolved base, synthesize an iframe dock from its metadata, and run its
478
+ * `setup(ctx)`. The imperative counterpart to `initHub`'s declarative
479
+ * `devframes` list — call it from a hub host's `configure(ctx)`, or wherever
480
+ * you hold the context, to plug an extra devframe in.
448
481
  */
449
- createJsonRenderer: (spec: JsonRenderSpec) => JsonRenderer;
482
+ install: (devframe: DevframeDefinition, options?: InstallDevframeOptions) => Promise<void>;
450
483
  }
451
484
  /**
452
485
  * Options for {@link createHubContext} — devframe's
@@ -462,4 +495,4 @@ interface CreateHubContextOptions extends CreateHostContextOptions {}
462
495
  */
463
496
  declare function createHubContext(options: CreateHubContextOptions): Promise<DevframeHubContext>;
464
497
  //#endregion
465
- export { DevframeMessageShortcutInput as C, DevframeMessagesListDelta as D, DevframeMessagesLevelShortcuts as E, DevframeMessageLevel as S, DevframeMessagesHost as T, DevframeMessageEntry as _, DevframeChildProcessOutput as a, DevframeMessageFilePosition as b, DevframePtyExecuteOptions as c, DevframeTerminalSessionBase as d, DevframeTerminalStatus as f, DevframeMessageElementPosition as g, DevframeMessageActivateAction as h, DevframeChildProcessExecuteOptions as i, DevframePtyTerminalSession as l, DevframeMessageAction as m, DevframeHubContext as n, DevframeChildProcessResult as o, DevframeTerminalsHost as p, createHubContext as r, DevframeChildProcessTerminalSession as s, CreateHubContextOptions as t, DevframeTerminalSession as u, DevframeMessageEntryFrom as v, DevframeMessagesClient as w, DevframeMessageHandle as x, DevframeMessageEntryInput as y };
498
+ export { DevframeMessageHandle as C, DevframeMessagesHost as D, DevframeMessagesClient as E, DevframeMessagesLevelShortcuts as O, DevframeMessageFilePosition as S, DevframeMessageShortcutInput as T, DevframeMessageCommandAction as _, DevframeChildProcessExecuteOptions as a, DevframeMessageEntryFrom as b, DevframeChildProcessTerminalSession as c, DevframeTerminalSession as d, DevframeTerminalSessionBase as f, DevframeMessageActivateAction as g, DevframeMessageAction as h, InstallDevframeOptions as i, DevframeMessagesListDelta as k, DevframePtyExecuteOptions as l, DevframeTerminalsHost as m, DevframeHubContext as n, DevframeChildProcessOutput as o, DevframeTerminalStatus as p, createHubContext as r, DevframeChildProcessResult as s, CreateHubContextOptions as t, DevframePtyTerminalSession as u, DevframeMessageElementPosition as v, DevframeMessageLevel as w, DevframeMessageEntryInput as x, DevframeMessageEntry as y };
@@ -0,0 +1,11 @@
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 };
@@ -0,0 +1,221 @@
1
+ import "node:path";
2
+ import "node:fs/promises";
3
+ import { createServer } from "node:net";
4
+ import { networkInterfaces } from "node:os";
5
+ //#region ../../node_modules/.pnpm/get-port-please@3.2.0/node_modules/get-port-please/dist/index.mjs
6
+ const unsafePorts = /* @__PURE__ */ new Set([
7
+ 1,
8
+ 7,
9
+ 9,
10
+ 11,
11
+ 13,
12
+ 15,
13
+ 17,
14
+ 19,
15
+ 20,
16
+ 21,
17
+ 22,
18
+ 23,
19
+ 25,
20
+ 37,
21
+ 42,
22
+ 43,
23
+ 53,
24
+ 69,
25
+ 77,
26
+ 79,
27
+ 87,
28
+ 95,
29
+ 101,
30
+ 102,
31
+ 103,
32
+ 104,
33
+ 109,
34
+ 110,
35
+ 111,
36
+ 113,
37
+ 115,
38
+ 117,
39
+ 119,
40
+ 123,
41
+ 135,
42
+ 137,
43
+ 139,
44
+ 143,
45
+ 161,
46
+ 179,
47
+ 389,
48
+ 427,
49
+ 465,
50
+ 512,
51
+ 513,
52
+ 514,
53
+ 515,
54
+ 526,
55
+ 530,
56
+ 531,
57
+ 532,
58
+ 540,
59
+ 548,
60
+ 554,
61
+ 556,
62
+ 563,
63
+ 587,
64
+ 601,
65
+ 636,
66
+ 989,
67
+ 990,
68
+ 993,
69
+ 995,
70
+ 1719,
71
+ 1720,
72
+ 1723,
73
+ 2049,
74
+ 3659,
75
+ 4045,
76
+ 5060,
77
+ 5061,
78
+ 6e3,
79
+ 6566,
80
+ 6665,
81
+ 6666,
82
+ 6667,
83
+ 6668,
84
+ 6669,
85
+ 6697,
86
+ 10080
87
+ ]);
88
+ function isUnsafePort(port) {
89
+ return unsafePorts.has(port);
90
+ }
91
+ function isSafePort(port) {
92
+ return !isUnsafePort(port);
93
+ }
94
+ var GetPortError = class extends Error {
95
+ constructor(message, opts) {
96
+ super(message, opts);
97
+ this.message = message;
98
+ }
99
+ name = "GetPortError";
100
+ };
101
+ function _log(verbose, message) {
102
+ if (verbose) console.log(`[get-port] ${message}`);
103
+ }
104
+ function _generateRange(from, to) {
105
+ if (to < from) return [];
106
+ const r = [];
107
+ for (let index = from; index <= to; index++) r.push(index);
108
+ return r;
109
+ }
110
+ function _tryPort(port, host) {
111
+ return new Promise((resolve) => {
112
+ const server = createServer();
113
+ server.unref();
114
+ server.on("error", () => {
115
+ resolve(false);
116
+ });
117
+ server.listen({
118
+ port,
119
+ host
120
+ }, () => {
121
+ const { port: port2 } = server.address();
122
+ server.close(() => {
123
+ resolve(isSafePort(port2) && port2);
124
+ });
125
+ });
126
+ });
127
+ }
128
+ function _getLocalHosts(additional) {
129
+ const hosts = new Set(additional);
130
+ for (const _interface of Object.values(networkInterfaces())) for (const config of _interface || []) if (config.address && !config.internal && !config.address.startsWith("fe80::") && !config.address.startsWith("169.254")) hosts.add(config.address);
131
+ return [...hosts];
132
+ }
133
+ async function _findPort(ports, host) {
134
+ for (const port of ports) {
135
+ const r = await _tryPort(port, host);
136
+ if (r) return r;
137
+ }
138
+ }
139
+ function _fmtOnHost(hostname) {
140
+ return hostname ? `on host ${JSON.stringify(hostname)}` : "on any host";
141
+ }
142
+ const HOSTNAME_RE = /^(?!-)[\d.:A-Za-z-]{1,63}(?<!-)$/;
143
+ function _validateHostname(hostname, _public, verbose) {
144
+ if (hostname && !HOSTNAME_RE.test(hostname)) {
145
+ const fallbackHost = _public ? "0.0.0.0" : "127.0.0.1";
146
+ _log(verbose, `Invalid hostname: ${JSON.stringify(hostname)}. Using ${JSON.stringify(fallbackHost)} as fallback.`);
147
+ return fallbackHost;
148
+ }
149
+ return hostname;
150
+ }
151
+ async function getPort(_userOptions = {}) {
152
+ if (typeof _userOptions === "number" || typeof _userOptions === "string") _userOptions = { port: Number.parseInt(_userOptions + "") || 0 };
153
+ const _port = Number(_userOptions.port ?? process.env.PORT);
154
+ const _userSpecifiedAnyPort = Boolean(_userOptions.port || _userOptions.ports?.length || _userOptions.portRange?.length);
155
+ const options = {
156
+ random: _port === 0,
157
+ ports: [],
158
+ portRange: [],
159
+ alternativePortRange: _userSpecifiedAnyPort ? [] : [3e3, 3100],
160
+ verbose: false,
161
+ ..._userOptions,
162
+ port: _port,
163
+ host: _validateHostname(_userOptions.host ?? process.env.HOST, _userOptions.public, _userOptions.verbose)
164
+ };
165
+ if (options.random && !_userSpecifiedAnyPort) return getRandomPort(options.host);
166
+ const portsToCheck = [
167
+ options.port,
168
+ ...options.ports,
169
+ ..._generateRange(...options.portRange)
170
+ ].filter((port) => {
171
+ if (!port) return false;
172
+ if (!isSafePort(port)) {
173
+ _log(options.verbose, `Ignoring unsafe port: ${port}`);
174
+ return false;
175
+ }
176
+ return true;
177
+ });
178
+ if (portsToCheck.length === 0) portsToCheck.push(3e3);
179
+ let availablePort = await _findPort(portsToCheck, options.host);
180
+ if (!availablePort && options.alternativePortRange.length > 0) {
181
+ availablePort = await _findPort(_generateRange(...options.alternativePortRange), options.host);
182
+ if (portsToCheck.length > 0) {
183
+ let message = `Unable to find an available port (tried ${portsToCheck.join("-")} ${_fmtOnHost(options.host)}).`;
184
+ if (availablePort) message += ` Using alternative port ${availablePort}.`;
185
+ _log(options.verbose, message);
186
+ }
187
+ }
188
+ if (!availablePort && _userOptions.random !== false) {
189
+ availablePort = await getRandomPort(options.host);
190
+ if (availablePort) _log(options.verbose, `Using random port ${availablePort}`);
191
+ }
192
+ if (!availablePort) {
193
+ const triedRanges = [
194
+ options.port,
195
+ options.portRange.join("-"),
196
+ options.alternativePortRange.join("-")
197
+ ].filter(Boolean).join(", ");
198
+ throw new GetPortError(`Unable to find an available port ${_fmtOnHost(options.host)} (tried ${triedRanges})`);
199
+ }
200
+ return availablePort;
201
+ }
202
+ async function getRandomPort(host) {
203
+ const port = await checkPort(0, host);
204
+ if (port === false) throw new GetPortError(`Unable to find a random port ${_fmtOnHost(host)}`);
205
+ return port;
206
+ }
207
+ async function checkPort(port, host = process.env.HOST, verbose) {
208
+ if (!host) host = _getLocalHosts([void 0, "0.0.0.0"]);
209
+ if (!Array.isArray(host)) return _tryPort(port, host);
210
+ for (const _host of host) {
211
+ const _port = await _tryPort(port, _host);
212
+ if (_port === false) {
213
+ if (port < 1024 && verbose) _log(verbose, `Unable to listen to the privileged port ${port} ${_fmtOnHost(_host)}`);
214
+ return false;
215
+ }
216
+ if (port === 0 && _port !== 0) port = _port;
217
+ }
218
+ return port;
219
+ }
220
+ //#endregion
221
+ export { getPort };
@@ -1,5 +1,6 @@
1
- import "./settings-Byh48aCd.mjs";
2
- import "./context-Cw5sDVoA.mjs";
1
+ import "./context-Dz0j8Eyg.mjs";
2
+ import "./commands-CAcTUSlj.mjs";
3
+ import "./settings-B1qJ47d5.mjs";
3
4
  import { RpcDefinitionsFilter, RpcDefinitionsToFunctions } from "devframe/rpc";
4
5
  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
6
  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,7 +1,7 @@
1
- import { A as DevframeViewLauncher, C as DevframeDocksHost, D as DevframeViewGroup, E as DevframeViewCustomRender, F as RemoteDockOptions, I as JsonRenderElement, L as JsonRenderSpec, M as FrameSubTabsConfig, N as NavTarget, O as DevframeViewIframe, P as RemoteConnectionInfo, R as JsonRenderer, S as DevframeDocksActiveState, T as DevframeViewBuiltin, _ as DevframeDockEntryBase, a as DevframeCommandEntry, b as DevframeDockEntryRegistry, c as DevframeCommandShortcutOverrides, d as DevframeServerCommandEntry, f as DevframeServerCommandInput, g as DevframeDockEntry, h as DevframeDockEntriesGrouped, i as DevframeCommandBase, j as DevframeViewLauncherStatus, k as DevframeViewJsonRender, 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 DevframeDockEntryCategory, w as DevframeViewAction, x as DevframeDockUserEntry, y as DevframeDockEntryIcon } from "./settings-Byh48aCd.mjs";
2
- import { DEFAULT_CATEGORIES_ORDER } from "./constants.mjs";
3
- import { C as DevframeMessageShortcutInput, D as DevframeMessagesListDelta, E as DevframeMessagesLevelShortcuts, S as DevframeMessageLevel, T as DevframeMessagesHost, _ as DevframeMessageEntry, a as DevframeChildProcessOutput, b as DevframeMessageFilePosition, c as DevframePtyExecuteOptions, d as DevframeTerminalSessionBase, f as DevframeTerminalStatus, g as DevframeMessageElementPosition, h as DevframeMessageActivateAction, i as DevframeChildProcessExecuteOptions, l as DevframePtyTerminalSession, m as DevframeMessageAction, n as DevframeHubContext, o as DevframeChildProcessResult, p as DevframeTerminalsHost, s as DevframeChildProcessTerminalSession, t as CreateHubContextOptions, u as DevframeTerminalSession, v as DevframeMessageEntryFrom, w as DevframeMessagesClient, x as DevframeMessageHandle, y as DevframeMessageEntryInput } from "./context-Cw5sDVoA.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-Bx3T-R7i.mjs";
1
+ import { C as DevframeMessageHandle, D as DevframeMessagesHost, E as DevframeMessagesClient, O as DevframeMessagesLevelShortcuts, S as DevframeMessageFilePosition, T as DevframeMessageShortcutInput, _ as DevframeMessageCommandAction, a as DevframeChildProcessExecuteOptions, b as DevframeMessageEntryFrom, c as DevframeChildProcessTerminalSession, d as DevframeTerminalSession, f as DevframeTerminalSessionBase, g as DevframeMessageActivateAction, h as DevframeMessageAction, k as DevframeMessagesListDelta, l as DevframePtyExecuteOptions, m as DevframeTerminalsHost, n as DevframeHubContext, o as DevframeChildProcessOutput, p as DevframeTerminalStatus, s as DevframeChildProcessResult, t as CreateHubContextOptions, u as DevframePtyTerminalSession, v as DevframeMessageElementPosition, w as DevframeMessageLevel, x as DevframeMessageEntryInput, y as DevframeMessageEntry } from "./context-Dz0j8Eyg.mjs";
2
+ import { A as FrameSubTabsConfig, C as DevframeViewAction, D as DevframeViewIframe, E as DevframeViewGroup, M as RemoteConnectionInfo, N as RemoteDockOptions, 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 NavTarget, k as DevframeViewLauncherStatus, l as DevframeCommandsHostEvents, m as DevframeDockEntriesGrouped, n as DevframeCommandAgentOptions, o as DevframeCommandKeybinding, p as DevframeDockActivation, r as DevframeCommandBase, s as DevframeCommandShortcutOverrides, t as DevframeClientCommand, u as DevframeServerCommandEntry, v as DevframeDockEntryIcon, w as DevframeViewBuiltin, x as DevframeDocksActiveState, y as DevframeDockEntryRegistry } from "./commands-CAcTUSlj.mjs";
3
+ import { t as DevframeDocksUserSettings } from "./settings-B1qJ47d5.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-p4BktGvQ.mjs";
5
5
  import { WhenContext, WhenExpression } from "devframe/utils/when";
6
6
  //#region src/define.d.ts
7
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>;
@@ -12,13 +12,5 @@ declare function defineDockEntry<const T extends DevframeDockUserEntry, const W
12
12
  when?: WhenExpression<WhenContext, W>;
13
13
  visibility?: WhenExpression<WhenContext, V>;
14
14
  }): T;
15
- /**
16
- * @deprecated json-render moved out of the hub into the opt-in
17
- * `@devframes/json-render` integration in 0.7. This identity helper is kept
18
- * so existing imports keep compiling — pass your spec directly to
19
- * `createJsonRenderView` (from `@devframes/json-render/node`) instead.
20
- * Removed in 0.8.
21
- */
22
- declare function defineJsonRenderSpec(spec: JsonRenderSpec): JsonRenderSpec;
23
15
  //#endregion
24
- export { type ClientScriptEntry, type ConnectionMeta, type CreateHubContextOptions, DEFAULT_CATEGORIES_ORDER, 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 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 DevframeMessageAction, type DevframeMessageActivateAction, 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 FrameSubTabsConfig, type JsonRenderElement, type JsonRenderSpec, type JsonRenderer, type NavTarget, 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 };
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 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 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 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 FrameSubTabsConfig, type NavTarget, 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 };
package/dist/index.mjs CHANGED
@@ -1,3 +1,2 @@
1
- import { DEFAULT_CATEGORIES_ORDER } from "./constants.mjs";
2
- import { i as defineJsonRenderSpec, n as defineDockEntry, r as defineHubRpcFunction, t as defineCommand } from "./define-Pbx8dsKz.mjs";
3
- export { DEFAULT_CATEGORIES_ORDER, defineCommand, defineDockEntry, defineHubRpcFunction, defineJsonRenderSpec };
1
+ import { n as defineDockEntry, r as defineHubRpcFunction, t as defineCommand } from "./define-Ceekw2EO.mjs";
2
+ export { defineCommand, defineDockEntry, defineHubRpcFunction };
@@ -1,8 +1,7 @@
1
- import { C as DevframeDocksHost$1, O as DevframeViewIframe, d as DevframeServerCommandEntry, f as DevframeServerCommandInput, g as DevframeDockEntry, l as DevframeCommandsHost$1, o as DevframeCommandHandle, p as ClientScriptEntry, t as DevframeDocksUserSettings, x as DevframeDockUserEntry } from "../settings-Byh48aCd.mjs";
2
- import { DEFAULT_CATEGORIES_ORDER } from "../constants.mjs";
3
- import { C as DevframeMessageShortcutInput, D as DevframeMessagesListDelta, T as DevframeMessagesHost$1, _ as DevframeMessageEntry, c as DevframePtyExecuteOptions, d as DevframeTerminalSessionBase, 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 DevframeMessageHandle, y as DevframeMessageEntryInput } from "../context-Cw5sDVoA.mjs";
1
+ import { C as DevframeMessageHandle, D as DevframeMessagesHost$1, T as DevframeMessageShortcutInput, a as DevframeChildProcessExecuteOptions, c as DevframeChildProcessTerminalSession, d as DevframeTerminalSession, f as DevframeTerminalSessionBase, i as InstallDevframeOptions, k as DevframeMessagesListDelta, l as DevframePtyExecuteOptions, m as DevframeTerminalsHost$1, n as DevframeHubContext, r as createHubContext, t as CreateHubContextOptions, u as DevframePtyTerminalSession, x as DevframeMessageEntryInput, y as DevframeMessageEntry } from "../context-Dz0j8Eyg.mjs";
2
+ import { S as DevframeDocksHost$1, a as DevframeCommandHandle, b as DevframeDockUserEntry, c as DevframeCommandsHost$1, d as DevframeServerCommandInput, f as ClientScriptEntry, h as DevframeDockEntry, u as DevframeServerCommandEntry } from "../commands-CAcTUSlj.mjs";
3
+ import { t as DevframeDocksUserSettings } from "../settings-B1qJ47d5.mjs";
4
4
  import { RpcFunctionDefinitionAny } from "devframe/rpc";
5
- import { DevframeDefinition } from "devframe/types";
6
5
  import { SharedState } from "devframe/utils/shared-state";
7
6
  //#region src/node/host-commands.d.ts
8
7
  declare class DevframeCommandsHost implements DevframeCommandsHost$1 {
@@ -120,34 +119,6 @@ declare class DevframeTerminalsHost implements DevframeTerminalsHost$1 {
120
119
  startPtySession(executeOptions: DevframePtyExecuteOptions, terminal: Omit<DevframeTerminalSessionBase, 'status'>): Promise<DevframePtyTerminalSession>;
121
120
  }
122
121
  //#endregion
123
- //#region src/node/mount-devframe.d.ts
124
- interface MountDevframeOptions {
125
- /**
126
- * Mount path override. Defaults to `d.basePath` or `/__${d.id}/`.
127
- */
128
- base?: string;
129
- /**
130
- * Per-mount overrides for the auto-synthesized iframe dock entry. Use
131
- * this to customize the entry's `category`, override the icon, hide it
132
- * via `when` (or only its dock-bar button via `visibility`), etc. Takes
133
- * precedence over the definition's own {@link DevframeDefinition.dock}
134
- * defaults. Cannot change `id`, `type`, or `url` — those are derived from
135
- * the devframe definition.
136
- */
137
- dock?: Partial<Omit<DevframeViewIframe, 'id' | 'type' | 'url'>>;
138
- }
139
- /**
140
- * Framework-neutral primitive — mounts a {@link DevframeDefinition} as a
141
- * dock inside a hub-aware context: serves the devframe's SPA at the
142
- * resolved base path, synthesizes an iframe dock entry from the
143
- * definition's metadata, and runs the definition's `setup(ctx)`.
144
- *
145
- * Framework kits wrap this with their own plugin/middleware machinery —
146
- * e.g. `@vitejs/devtools-kit`'s `createPluginFromDevframe` returns a
147
- * Vite `Plugin` whose `devtools.setup` ultimately delegates here.
148
- */
149
- declare function mountDevframe(ctx: DevframeHubContext, d: DevframeDefinition, options?: MountDevframeOptions): Promise<void>;
150
- //#endregion
151
122
  //#region src/node/rpc-builtins.d.ts
152
123
  /**
153
124
  * `hub:commands:execute` — Invoke a registered server command by id. The
@@ -401,4 +372,4 @@ declare const builtinHubRpcDeclarations: readonly RpcFunctionDefinitionAny[];
401
372
  */
402
373
  declare function createSimpleClientScript(fn: string | ((ctx: any) => void)): ClientScriptEntry;
403
374
  //#endregion
404
- 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 };
375
+ export { CreateHubContextOptions, DevframeCommandsHost, DevframeDocksHost, DevframeHubContext, DevframeMessagesHost, DevframeTerminalsHost, type InstallDevframeOptions, builtinHubRpcDeclarations, createHubContext, createSimpleClientScript, hubCommandsExecute, hubDocksActivate, hubMessagesAdd, hubMessagesClear, hubMessagesRemove, hubMessagesUpdate, hubTerminalsRemove, hubTerminalsResize, hubTerminalsRestart, hubTerminalsTerminate, hubTerminalsWrite };