@devframes/hub 0.9.0-beta.3 → 0.9.0-beta.7
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.
- package/dist/client/index.d.mts +3 -4
- package/dist/constants.d.mts +12 -2
- package/dist/constants.mjs +14 -1
- package/dist/{context-AFIDBT5K.mjs → context-BWL13DdL.mjs} +2 -1
- package/dist/{context-C9Itl_OA.d.mts → context-D5TJIHwp.d.mts} +1 -1
- package/dist/index-coDmWngQ.d.mts +5 -0
- package/dist/index.d.mts +4 -5
- package/dist/node/index.d.mts +2 -3
- package/dist/node/index.mjs +2 -2
- package/dist/node/initiate.d.mts +2 -3
- package/dist/node/initiate.mjs +4 -9
- package/dist/{commands-CpkDWufe.d.mts → settings-DfrRa9Wf.d.mts} +33 -1
- package/dist/types/index.d.mts +4 -5
- package/package.json +3 -3
- package/dist/index-CZT5a0Rr.d.mts +0 -6
- package/dist/settings-CVQyYXhv.d.mts +0 -34
package/dist/client/index.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { E as DevframeMessagesClient, x as DevframeMessageEntryInput } from "../context-
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import "../index-CZT5a0Rr.mjs";
|
|
1
|
+
import { E as DevframeMessagesClient, x as DevframeMessageEntryInput } from "../context-D5TJIHwp.mjs";
|
|
2
|
+
import { N as NavTarget, P as RemoteConnectionInfo, S as DevframeDockUserEntry, _ as DevframeDockEntry, a as DevframeCommandEntry, b as DevframeDockEntryIcon, g as DevframeDockEntriesGrouped, k as DevframeViewIframe, n as DevframeClientCommand, p as ClientScriptEntry, s as DevframeCommandKeybinding, t as DevframeDocksUserSettings } from "../settings-DfrRa9Wf.mjs";
|
|
3
|
+
import "../index-coDmWngQ.mjs";
|
|
5
4
|
import { DevframeClientRpcHost, DevframeConnection, DevframeConnectionStatus, DevframeRpcClient, DevframeRpcClientOptions, DevframeRpcContext, RpcClientEvents, RpcClientEvents as RpcClientEvents$1 } from "devframe/client";
|
|
6
5
|
import { EventEmitter } from "devframe/types";
|
|
7
6
|
import { SharedState } from "devframe/utils/shared-state";
|
package/dist/constants.d.mts
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
|
-
import { t as DevframeDocksUserSettings } from "./settings-
|
|
1
|
+
import { t as DevframeDocksUserSettings } from "./settings-DfrRa9Wf.mjs";
|
|
2
2
|
export * from "devframe/constants";
|
|
3
3
|
//#region src/constants.d.ts
|
|
4
|
+
/** Default mount base for a hub instance — one namespace, one catch-all. */
|
|
5
|
+
declare const DEVFRAMES_HUB_BASE = "/__devframes/";
|
|
6
|
+
/**
|
|
7
|
+
* Normalize a hub mount base to an absolute path with leading and trailing
|
|
8
|
+
* slashes (e.g. `devframes` → `/devframes/`), collapsing any doubled
|
|
9
|
+
* slashes the input introduced. The one implementation every hub-aware
|
|
10
|
+
* host (`@devframes/hub` itself, and the Vite/Nuxt/Next adapters) resolves
|
|
11
|
+
* `options.base` through.
|
|
12
|
+
*/
|
|
13
|
+
declare function normalizeHubBase(base: string): string;
|
|
4
14
|
/**
|
|
5
15
|
* The default ordering weight for each known dock category — lower sorts
|
|
6
16
|
* earlier. Downstream viewers (e.g. `@vitejs/devtools-kit`) import this as the
|
|
@@ -21,4 +31,4 @@ declare const DEFAULT_CATEGORIES_ORDER: Record<string, number>;
|
|
|
21
31
|
declare const DOCK_RENDERERS_STATE_KEY = "devframe:dock-renderers";
|
|
22
32
|
declare const DEFAULT_STATE_USER_SETTINGS: () => DevframeDocksUserSettings;
|
|
23
33
|
//#endregion
|
|
24
|
-
export { DEFAULT_CATEGORIES_ORDER, DEFAULT_STATE_USER_SETTINGS, DOCK_RENDERERS_STATE_KEY };
|
|
34
|
+
export { DEFAULT_CATEGORIES_ORDER, DEFAULT_STATE_USER_SETTINGS, DEVFRAMES_HUB_BASE, DOCK_RENDERERS_STATE_KEY, normalizeHubBase };
|
package/dist/constants.mjs
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
|
+
import { cleanDoubleSlashes, withLeadingSlash, withTrailingSlash } from "ufo";
|
|
1
2
|
export * from "devframe/constants";
|
|
2
3
|
//#region src/constants.ts
|
|
4
|
+
/** Default mount base for a hub instance — one namespace, one catch-all. */
|
|
5
|
+
const DEVFRAMES_HUB_BASE = "/__devframes/";
|
|
6
|
+
/**
|
|
7
|
+
* Normalize a hub mount base to an absolute path with leading and trailing
|
|
8
|
+
* slashes (e.g. `devframes` → `/devframes/`), collapsing any doubled
|
|
9
|
+
* slashes the input introduced. The one implementation every hub-aware
|
|
10
|
+
* host (`@devframes/hub` itself, and the Vite/Nuxt/Next adapters) resolves
|
|
11
|
+
* `options.base` through.
|
|
12
|
+
*/
|
|
13
|
+
function normalizeHubBase(base) {
|
|
14
|
+
return cleanDoubleSlashes(withTrailingSlash(withLeadingSlash(base)));
|
|
15
|
+
}
|
|
3
16
|
/**
|
|
4
17
|
* The default ordering weight for each known dock category — lower sorts
|
|
5
18
|
* earlier. Downstream viewers (e.g. `@vitejs/devtools-kit`) import this as the
|
|
@@ -37,4 +50,4 @@ const DEFAULT_STATE_USER_SETTINGS = () => ({
|
|
|
37
50
|
commandShortcuts: {}
|
|
38
51
|
});
|
|
39
52
|
//#endregion
|
|
40
|
-
export { DEFAULT_CATEGORIES_ORDER, DEFAULT_STATE_USER_SETTINGS, DOCK_RENDERERS_STATE_KEY };
|
|
53
|
+
export { DEFAULT_CATEGORIES_ORDER, DEFAULT_STATE_USER_SETTINGS, DEVFRAMES_HUB_BASE, DOCK_RENDERERS_STATE_KEY, normalizeHubBase };
|
|
@@ -920,7 +920,8 @@ async function installDevframe(ctx, d, options = {}) {
|
|
|
920
920
|
name: d.name,
|
|
921
921
|
base
|
|
922
922
|
});
|
|
923
|
-
|
|
923
|
+
const distSource = d.cli.distDir;
|
|
924
|
+
ctx.views.hostStatic(base, typeof distSource === "string" ? resolve(distSource) : distSource);
|
|
924
925
|
}
|
|
925
926
|
ctx.docks.register({
|
|
926
927
|
id,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as DevframeDockEntryIcon, k as DevframeViewIframe, l as DevframeCommandsHost, m as DevframeDockActivation, w as DevframeDocksHost } from "./settings-DfrRa9Wf.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";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import "./context-D5TJIHwp.mjs";
|
|
2
|
+
import "./settings-DfrRa9Wf.mjs";
|
|
3
|
+
import { RpcDefinitionsFilter, RpcDefinitionsToFunctions } from "devframe/rpc";
|
|
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
|
+
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,7 +1,6 @@
|
|
|
1
|
-
import { C as DevframeMessageHandle, D as DevframeMessagesHost, E as DevframeMessagesClient, O as DevframeMessagesLevelShortcuts, S as DevframeMessageFilePosition, T as DevframeMessageShortcutInput, _ as DevframeMessageCommandAction, a as DevframeChildProcessExecuteOptions, b as DevframeMessageEntryFrom, c as DevframeChildProcessTerminalSession, d as DevframeTerminalSession, f as DevframeTerminalSessionBase, g as DevframeMessageActivateAction, h as DevframeMessageAction, k as DevframeMessagesListDelta, l as DevframePtyExecuteOptions, m as DevframeTerminalsHost, n as DevframeHubContext, o as DevframeChildProcessOutput, p as DevframeTerminalStatus, s as DevframeChildProcessResult, t as CreateHubContextOptions, u as DevframePtyTerminalSession, v as DevframeMessageElementPosition, w as DevframeMessageLevel, x as DevframeMessageEntryInput, y as DevframeMessageEntry } from "./context-
|
|
2
|
-
import { A as
|
|
3
|
-
import { t as
|
|
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-CZT5a0Rr.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-D5TJIHwp.mjs";
|
|
2
|
+
import { A as DevframeViewLauncher, C as DevframeDocksActiveState, D as DevframeViewCustomRender, E as DevframeViewBuiltin, F as RemoteDockOptions, M as FrameSubTabsConfig, N as NavTarget, O as DevframeViewGroup, P as RemoteConnectionInfo, S as DevframeDockUserEntry, T as DevframeViewAction, _ as DevframeDockEntry, a as DevframeCommandEntry, b as DevframeDockEntryIcon, c as DevframeCommandShortcutOverrides, d as DevframeServerCommandEntry, f as DevframeServerCommandInput, g as DevframeDockEntriesGrouped, h as DevframeDockBadgeVariant, i as DevframeCommandBase, j as DevframeViewLauncherStatus, k as DevframeViewIframe, l as DevframeCommandsHost, m as DevframeDockActivation, n as DevframeClientCommand, o as DevframeCommandHandle, p as ClientScriptEntry, r as DevframeCommandAgentOptions, s as DevframeCommandKeybinding, t as DevframeDocksUserSettings, u as DevframeCommandsHostEvents, v as DevframeDockEntryBase, w as DevframeDocksHost, x as DevframeDockEntryRegistry, y as DevframeDockEntryCategory } from "./settings-DfrRa9Wf.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-coDmWngQ.mjs";
|
|
5
4
|
import { WhenContext, WhenExpression } from "devframe/utils/when";
|
|
6
5
|
//#region src/define.d.ts
|
|
7
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>;
|
|
@@ -13,4 +12,4 @@ declare function defineDockEntry<const T extends DevframeDockUserEntry, const W
|
|
|
13
12
|
visibility?: WhenExpression<WhenContext, V>;
|
|
14
13
|
}): T;
|
|
15
14
|
//#endregion
|
|
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
|
|
15
|
+
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 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 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, defineCommand, defineDockEntry, defineHubRpcFunction };
|
package/dist/node/index.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
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-
|
|
2
|
-
import {
|
|
3
|
-
import { t as DevframeDocksUserSettings } from "../settings-CVQyYXhv.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-D5TJIHwp.mjs";
|
|
2
|
+
import { S as DevframeDockUserEntry, _ as DevframeDockEntry, d as DevframeServerCommandEntry, f as DevframeServerCommandInput, l as DevframeCommandsHost$1, o as DevframeCommandHandle, p as ClientScriptEntry, t as DevframeDocksUserSettings, w as DevframeDocksHost$1 } from "../settings-DfrRa9Wf.mjs";
|
|
4
3
|
import { RpcFunctionDefinitionAny } from "devframe/rpc";
|
|
5
4
|
import { SharedState } from "devframe/utils/shared-state";
|
|
6
5
|
//#region src/node/host-commands.d.ts
|
package/dist/node/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { _ as DevframeCommandsHost, a as hubMessagesAdd, c as hubMessagesUpdate, d as hubTerminalsRestart, f as hubTerminalsTerminate, g as DevframeDocksHost, h as DevframeMessagesHost, i as hubDocksActivate, l as hubTerminalsRemove, m as DevframeTerminalsHost, n as builtinHubRpcDeclarations, o as hubMessagesClear, p as hubTerminalsWrite, r as hubCommandsExecute, s as hubMessagesRemove, t as createHubContext, u as hubTerminalsResize } from "../context-
|
|
1
|
+
import { _ as DevframeCommandsHost, a as hubMessagesAdd, c as hubMessagesUpdate, d as hubTerminalsRestart, f as hubTerminalsTerminate, g as DevframeDocksHost, h as DevframeMessagesHost, i as hubDocksActivate, l as hubTerminalsRemove, m as DevframeTerminalsHost, n as builtinHubRpcDeclarations, o as hubMessagesClear, p as hubTerminalsWrite, r as hubCommandsExecute, s as hubMessagesRemove, t as createHubContext, u as hubTerminalsResize } from "../context-BWL13DdL.mjs";
|
|
2
|
+
import "ufo";
|
|
2
3
|
import "pathe";
|
|
3
4
|
import "node:process";
|
|
4
5
|
import { builtinModules } from "node:module";
|
|
5
6
|
import "node:fs";
|
|
6
|
-
import "ufo";
|
|
7
7
|
import "node:url";
|
|
8
8
|
import assert from "node:assert";
|
|
9
9
|
import "node:path";
|
package/dist/node/initiate.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { i as InstallDevframeOptions, n as DevframeHubContext, t as CreateHubContextOptions } from "../context-
|
|
1
|
+
import { i as InstallDevframeOptions, n as DevframeHubContext, t as CreateHubContextOptions } from "../context-D5TJIHwp.mjs";
|
|
2
|
+
import { DEVFRAMES_HUB_BASE } from "../constants.mjs";
|
|
2
3
|
import { DevframeInstanceRecord } from "devframe/internal";
|
|
3
4
|
import { ConnectionMeta, DevframeDefinition, DevframeSseOptions, DevframeStorageScope, DevframeWsOptions, McpRouteOptions } from "devframe/types";
|
|
4
5
|
import { DevframeAuthHandler } from "devframe/node/auth";
|
|
@@ -15,8 +16,6 @@ interface HubDevframeEntry {
|
|
|
15
16
|
}
|
|
16
17
|
type Thenable<T> = T | Promise<T>;
|
|
17
18
|
type Arrayable<T> = T | readonly T[];
|
|
18
|
-
/** Default mount base for a hub instance — one namespace, one catch-all. */
|
|
19
|
-
declare const DEVFRAMES_HUB_BASE = "/__devframes/";
|
|
20
19
|
/**
|
|
21
20
|
* One dock-type → prebuilt renderer-module registration for
|
|
22
21
|
* {@link InitHubOptions.renderers}. The hub serves the module at
|
package/dist/node/initiate.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { DOCK_RENDERERS_STATE_KEY } from "../constants.mjs";
|
|
2
|
-
import { t as createHubContext, v as diagnostics } from "../context-
|
|
1
|
+
import { DEVFRAMES_HUB_BASE, DOCK_RENDERERS_STATE_KEY, normalizeHubBase } from "../constants.mjs";
|
|
2
|
+
import { t as createHubContext, v as diagnostics } from "../context-BWL13DdL.mjs";
|
|
3
|
+
import { joinURL, withTrailingSlash, withoutLeadingSlash } from "ufo";
|
|
3
4
|
import { DEVFRAME_CONNECTION_META_FILENAME, DEVFRAME_DOCK_IMPORTS_FILENAME, DEVFRAME_MCP_ROUTE, DEVFRAME_WS_ROUTE } from "devframe/constants";
|
|
4
5
|
import { createH3DevframeHost, createInstanceShell, resolveInstanceRegister } from "devframe/internal";
|
|
5
6
|
import { resolve } from "pathe";
|
|
6
7
|
import process from "node:process";
|
|
7
8
|
import { existsSync } from "node:fs";
|
|
8
|
-
import { cleanDoubleSlashes, joinURL, withLeadingSlash, withTrailingSlash, withoutLeadingSlash } from "ufo";
|
|
9
9
|
import { readFile } from "node:fs/promises";
|
|
10
10
|
import { mountStaticHandler } from "devframe/utils/serve-static";
|
|
11
11
|
import { H3 } from "h3";
|
|
@@ -13,8 +13,6 @@ import { H3 } from "h3";
|
|
|
13
13
|
function normalizeDevframeEntry(entry) {
|
|
14
14
|
return "devframe" in entry ? entry : { devframe: entry };
|
|
15
15
|
}
|
|
16
|
-
/** Default mount base for a hub instance — one namespace, one catch-all. */
|
|
17
|
-
const DEVFRAMES_HUB_BASE = "/__devframes/";
|
|
18
16
|
/** Content-type for a UI asset key, inferred from its file extension. */
|
|
19
17
|
function assetContentType(key) {
|
|
20
18
|
if (key.endsWith(".json")) return "application/json; charset=utf-8";
|
|
@@ -45,9 +43,6 @@ function resolveDevframesInput(input) {
|
|
|
45
43
|
return (Array.isArray(resolved) ? resolved : [resolved]).filter((slot) => slot != null).map(normalizeDevframeEntry);
|
|
46
44
|
})).then((arrays) => arrays.flat());
|
|
47
45
|
}
|
|
48
|
-
function normalizeBase(base) {
|
|
49
|
-
return cleanDoubleSlashes(withTrailingSlash(withLeadingSlash(base)));
|
|
50
|
-
}
|
|
51
46
|
/**
|
|
52
47
|
* Validate the renderer-module registrations fail-fast: route-safe types
|
|
53
48
|
* (each becomes the `<base>__renderers/<type>.mjs` URL segment), one module
|
|
@@ -107,7 +102,7 @@ function renderClientImportsModule(ctx) {
|
|
|
107
102
|
* through {@link HubInstance.attach}.
|
|
108
103
|
*/
|
|
109
104
|
function initHub(options) {
|
|
110
|
-
const base =
|
|
105
|
+
const base = normalizeHubBase(options.base);
|
|
111
106
|
const baseNoSlash = base.slice(0, -1);
|
|
112
107
|
const app = new H3();
|
|
113
108
|
const cwd = options.cwd ?? process.cwd();
|
|
@@ -574,4 +574,36 @@ interface DevframeCommandShortcutOverrides {
|
|
|
574
574
|
[commandId: string]: DevframeCommandKeybinding[];
|
|
575
575
|
}
|
|
576
576
|
//#endregion
|
|
577
|
-
|
|
577
|
+
//#region src/types/settings.d.ts
|
|
578
|
+
/**
|
|
579
|
+
* Persisted per-user dock + command settings, synced over the
|
|
580
|
+
* `devframe:user-settings` shared state. The generic base carries the hub's
|
|
581
|
+
* own dock-registry and command model that every viewer shares; a viewer
|
|
582
|
+
* augments it with its own reference-UI toggles via declaration merging:
|
|
583
|
+
*
|
|
584
|
+
* ```ts
|
|
585
|
+
* declare module '@devframes/hub/types' {
|
|
586
|
+
* interface DevframeDocksUserSettings {
|
|
587
|
+
* myViewerToggle?: boolean
|
|
588
|
+
* }
|
|
589
|
+
* }
|
|
590
|
+
* ```
|
|
591
|
+
*
|
|
592
|
+
* Augmented fields are optional so the hub's `DEFAULT_STATE_USER_SETTINGS()`
|
|
593
|
+
* (which knows nothing about them) stays assignable — an absent value reads
|
|
594
|
+
* as the viewer's documented default.
|
|
595
|
+
*/
|
|
596
|
+
interface DevframeDocksUserSettings {
|
|
597
|
+
/** Ids of dock entries the user has hidden from the bar. */
|
|
598
|
+
docksHidden: string[];
|
|
599
|
+
/** Category ids the user has collapsed/hidden on the bar. */
|
|
600
|
+
docksCategoriesHidden: string[];
|
|
601
|
+
/** Ids of dock entries the user has pinned. */
|
|
602
|
+
docksPinned: string[];
|
|
603
|
+
/** Per-entry sort weight overriding the registry's default order. */
|
|
604
|
+
docksCustomOrder: Record<string, number>;
|
|
605
|
+
/** Per-command keybinding overrides (empty array = shortcut disabled). */
|
|
606
|
+
commandShortcuts: DevframeCommandShortcutOverrides;
|
|
607
|
+
}
|
|
608
|
+
//#endregion
|
|
609
|
+
export { DevframeViewLauncher as A, DevframeDocksActiveState as C, DevframeViewCustomRender as D, DevframeViewBuiltin as E, RemoteDockOptions as F, FrameSubTabsConfig as M, NavTarget as N, DevframeViewGroup as O, RemoteConnectionInfo as P, DevframeDockUserEntry as S, DevframeViewAction 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, DevframeViewLauncherStatus as j, DevframeViewIframe 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, DevframeDocksHost as w, DevframeDockEntryRegistry as x, DevframeDockEntryCategory as y };
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { C as DevframeMessageHandle, D as DevframeMessagesHost, E as DevframeMessagesClient, O as DevframeMessagesLevelShortcuts, S as DevframeMessageFilePosition, T as DevframeMessageShortcutInput, _ as DevframeMessageCommandAction, a as DevframeChildProcessExecuteOptions, b as DevframeMessageEntryFrom, c as DevframeChildProcessTerminalSession, d as DevframeTerminalSession, f as DevframeTerminalSessionBase, g as DevframeMessageActivateAction, h as DevframeMessageAction, k as DevframeMessagesListDelta, l as DevframePtyExecuteOptions, m as DevframeTerminalsHost, n as DevframeHubContext, o as DevframeChildProcessOutput, p as DevframeTerminalStatus, s as DevframeChildProcessResult, t as CreateHubContextOptions, u as DevframePtyTerminalSession, v as DevframeMessageElementPosition, w as DevframeMessageLevel, x as DevframeMessageEntryInput, y as DevframeMessageEntry } from "../context-
|
|
2
|
-
import { A as
|
|
3
|
-
import { t as
|
|
4
|
-
|
|
5
|
-
export { ClientScriptEntry, type ConnectionMeta, type CreateHubContextOptions, type DevframeCapabilities, DevframeChildProcessExecuteOptions, DevframeChildProcessOutput, DevframeChildProcessResult, DevframeChildProcessTerminalSession, DevframeClientCommand, DevframeCommandAgentOptions, DevframeCommandBase, DevframeCommandEntry, DevframeCommandHandle, DevframeCommandKeybinding, DevframeCommandShortcutOverrides, DevframeCommandsHost, DevframeCommandsHostEvents, type DevframeDiagnosticsDefinition, type DevframeDiagnosticsHost, type DevframeDiagnosticsLogger, DevframeDockActivation, DevframeDockBadgeVariant, DevframeDockEntriesGrouped, DevframeDockEntry, DevframeDockEntryBase, DevframeDockEntryCategory, DevframeDockEntryIcon, DevframeDockEntryRegistry, DevframeDockUserEntry, DevframeDocksActiveState, DevframeDocksHost, DevframeDocksUserSettings, type DevframeHost, type DevframeHubContext, DevframeMessageAction, DevframeMessageActivateAction, DevframeMessageCommandAction, DevframeMessageElementPosition, DevframeMessageEntry, DevframeMessageEntryFrom, DevframeMessageEntryInput, DevframeMessageFilePosition, DevframeMessageHandle, DevframeMessageLevel, DevframeMessageShortcutInput, DevframeMessagesClient, DevframeMessagesHost, DevframeMessagesLevelShortcuts, DevframeMessagesListDelta, type DevframeNodeRpcSession, DevframePtyExecuteOptions, DevframePtyTerminalSession, type DevframeRpcClientFunctions, type DevframeRpcServerFunctions, type DevframeRpcSharedStates, DevframeServerCommandEntry, DevframeServerCommandInput, DevframeTerminalSession, DevframeTerminalSessionBase, DevframeTerminalStatus, DevframeTerminalsHost, DevframeViewAction, DevframeViewBuiltin, DevframeViewCustomRender, DevframeViewGroup, type DevframeViewHost, DevframeViewIframe, DevframeViewLauncher, DevframeViewLauncherStatus, type EntriesToObject, type EventEmitter, type EventUnsubscribe, type EventsMap, FrameSubTabsConfig, NavTarget, 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 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-D5TJIHwp.mjs";
|
|
2
|
+
import { A as DevframeViewLauncher, C as DevframeDocksActiveState, D as DevframeViewCustomRender, E as DevframeViewBuiltin, F as RemoteDockOptions, M as FrameSubTabsConfig, N as NavTarget, O as DevframeViewGroup, P as RemoteConnectionInfo, S as DevframeDockUserEntry, T as DevframeViewAction, _ as DevframeDockEntry, a as DevframeCommandEntry, b as DevframeDockEntryIcon, c as DevframeCommandShortcutOverrides, d as DevframeServerCommandEntry, f as DevframeServerCommandInput, g as DevframeDockEntriesGrouped, h as DevframeDockBadgeVariant, i as DevframeCommandBase, j as DevframeViewLauncherStatus, k as DevframeViewIframe, l as DevframeCommandsHost, m as DevframeDockActivation, n as DevframeClientCommand, o as DevframeCommandHandle, p as ClientScriptEntry, r as DevframeCommandAgentOptions, s as DevframeCommandKeybinding, t as DevframeDocksUserSettings, u as DevframeCommandsHostEvents, v as DevframeDockEntryBase, w as DevframeDocksHost, x as DevframeDockEntryRegistry, y as DevframeDockEntryCategory } from "../settings-DfrRa9Wf.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-coDmWngQ.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, DevframeDockUserEntry, DevframeDocksActiveState, DevframeDocksHost, DevframeDocksUserSettings, type DevframeHost, type DevframeHubContext, DevframeMessageAction, DevframeMessageActivateAction, DevframeMessageCommandAction, DevframeMessageElementPosition, DevframeMessageEntry, DevframeMessageEntryFrom, DevframeMessageEntryInput, DevframeMessageFilePosition, DevframeMessageHandle, DevframeMessageLevel, DevframeMessageShortcutInput, DevframeMessagesClient, DevframeMessagesHost, DevframeMessagesLevelShortcuts, DevframeMessagesListDelta, type DevframeNodeRpcSession, DevframePtyExecuteOptions, DevframePtyTerminalSession, type DevframeRpcClientFunctions, type DevframeRpcServerFunctions, type DevframeRpcSharedStates, DevframeServerCommandEntry, DevframeServerCommandInput, DevframeTerminalSession, DevframeTerminalSessionBase, DevframeTerminalStatus, DevframeTerminalsHost, DevframeViewAction, DevframeViewBuiltin, DevframeViewCustomRender, DevframeViewGroup, type DevframeViewHost, DevframeViewIframe, DevframeViewLauncher, DevframeViewLauncherStatus, type EventEmitter, type EventUnsubscribe, type EventsMap, FrameSubTabsConfig, NavTarget, RemoteConnectionInfo, RemoteDockOptions, type RpcBroadcastOptions, type RpcDefinitionsFilter, type RpcDefinitionsToFunctions, type RpcFunctionsHost, type RpcSharedStateGetOptions, type RpcSharedStateHost, type RpcStreamingChannel, type RpcStreamingChannelOptions, type RpcStreamingHost };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devframes/hub",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.9.0-beta.
|
|
4
|
+
"version": "0.9.0-beta.7",
|
|
5
5
|
"description": "Hub layer that orchestrates devframe docks, terminals, messages, and commands on any host.",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"dist"
|
|
35
35
|
],
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"devframe": "0.9.0-beta.
|
|
37
|
+
"devframe": "0.9.0-beta.7"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@standard-schema/spec": "^1.1.0",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"mlly": "^1.8.2",
|
|
54
54
|
"tsdown": "^0.22.14",
|
|
55
55
|
"valibot": "^1.4.2",
|
|
56
|
-
"devframe": "0.9.0-beta.
|
|
56
|
+
"devframe": "0.9.0-beta.7"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"build": "tsdown",
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import "./context-C9Itl_OA.mjs";
|
|
2
|
-
import "./commands-CpkDWufe.mjs";
|
|
3
|
-
import "./settings-CVQyYXhv.mjs";
|
|
4
|
-
import { RpcDefinitionsFilter, RpcDefinitionsToFunctions } from "devframe/rpc";
|
|
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";
|
|
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 };
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { s as DevframeCommandShortcutOverrides } from "./commands-CpkDWufe.mjs";
|
|
2
|
-
//#region src/types/settings.d.ts
|
|
3
|
-
/**
|
|
4
|
-
* Persisted per-user dock + command settings, synced over the
|
|
5
|
-
* `devframe:user-settings` shared state. The generic base carries the hub's
|
|
6
|
-
* own dock-registry and command model that every viewer shares; a viewer
|
|
7
|
-
* augments it with its own reference-UI toggles via declaration merging:
|
|
8
|
-
*
|
|
9
|
-
* ```ts
|
|
10
|
-
* declare module '@devframes/hub/types' {
|
|
11
|
-
* interface DevframeDocksUserSettings {
|
|
12
|
-
* myViewerToggle?: boolean
|
|
13
|
-
* }
|
|
14
|
-
* }
|
|
15
|
-
* ```
|
|
16
|
-
*
|
|
17
|
-
* Augmented fields are optional so the hub's `DEFAULT_STATE_USER_SETTINGS()`
|
|
18
|
-
* (which knows nothing about them) stays assignable — an absent value reads
|
|
19
|
-
* as the viewer's documented default.
|
|
20
|
-
*/
|
|
21
|
-
interface DevframeDocksUserSettings {
|
|
22
|
-
/** Ids of dock entries the user has hidden from the bar. */
|
|
23
|
-
docksHidden: string[];
|
|
24
|
-
/** Category ids the user has collapsed/hidden on the bar. */
|
|
25
|
-
docksCategoriesHidden: string[];
|
|
26
|
-
/** Ids of dock entries the user has pinned. */
|
|
27
|
-
docksPinned: string[];
|
|
28
|
-
/** Per-entry sort weight overriding the registry's default order. */
|
|
29
|
-
docksCustomOrder: Record<string, number>;
|
|
30
|
-
/** Per-command keybinding overrides (empty array = shortcut disabled). */
|
|
31
|
-
commandShortcuts: DevframeCommandShortcutOverrides;
|
|
32
|
-
}
|
|
33
|
-
//#endregion
|
|
34
|
-
export { DevframeDocksUserSettings as t };
|