🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@devframes/hub

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@devframes/hub - npm Package Compare versions

Comparing version
0.6.0
to
0.6.1
+375
dist/context-BIZOsyvH.d.mts
import { M as JsonRenderSpec, N as JsonRenderer, b as DevframeDocksHost, c as DevframeCommandsHost, f as BuiltinDocksOptions, v as DevframeDockEntryIcon } from "./settings-DJs3n2p1.mjs";
import { CreateHostContextOptions } from "devframe/node";
import { DevframeHost, DevframeNodeContext, EventEmitter } from "devframe/types";
import { ChildProcess } from "node:child_process";
//#region src/types/messages.d.ts
type DevframeMessageLevel = 'info' | 'warn' | 'error' | 'success' | 'debug';
type DevframeMessageEntryFrom = 'server' | 'browser';
interface DevframeMessageElementPosition {
/** CSS selector for the element */
selector?: string;
/** Bounding box of the element */
boundingBox?: {
x: number;
y: number;
width: number;
height: number;
};
/** Human-readable description of the element */
description?: string;
}
interface DevframeMessageFilePosition {
/** Absolute or relative file path */
file: string;
/** Line number (1-based) */
line?: number;
/** Column number (1-based) */
column?: number;
}
interface DevframeMessageEntry {
/**
* Unique identifier for this message entry (auto-generated if not provided)
*/
id: string;
/**
* Short title or summary of the message
*/
message: string;
/**
* Optional detailed description or explanation
*/
description?: string;
/**
* Severity level, determines color and icon
*/
level: DevframeMessageLevel;
/**
* Optional stack trace string
*/
stacktrace?: string;
/**
* Optional DOM element position info (e.g., for a11y issues)
*/
elementPosition?: DevframeMessageElementPosition;
/**
* Optional source file position info (e.g., for lint errors)
*/
filePosition?: DevframeMessageFilePosition;
/**
* Whether this message should also appear as a toast notification
*/
notify?: boolean;
/**
* Origin of the message entry, automatically set by the context
*/
from: DevframeMessageEntryFrom;
/**
* Grouping category (e.g., 'a11y', 'lint', 'runtime', 'test')
*/
category?: string;
/**
* Optional tags/labels for filtering
*/
labels?: string[];
/**
* Time in ms to auto-dismiss the toast notification (client-side)
*/
autoDismiss?: number;
/**
* Time in ms to auto-delete this message entry (server-side)
*/
autoDelete?: number;
/**
* Timestamp when the message was created (auto-generated if not provided)
*/
timestamp: number;
/**
* Status of the message entry (e.g., 'loading' while an operation is in progress).
* Defaults to 'idle' when not specified.
*/
status?: 'loading' | 'idle';
}
/**
* Input type for creating a message entry.
* `id`, `timestamp`, and `from` are auto-filled by the host.
*/
type DevframeMessageEntryInput = Omit<DevframeMessageEntry, 'id' | 'timestamp' | 'from'> & {
id?: string;
timestamp?: number;
};
interface DevframeMessageHandle {
/** The underlying message entry data */
readonly entry: DevframeMessageEntry;
/** Shortcut to entry.id */
readonly id: string;
/** Partial update of this message entry */
update: (patch: Partial<DevframeMessageEntryInput>) => Promise<DevframeMessageEntry | undefined>;
/** Remove this message entry */
dismiss: () => Promise<void>;
}
/**
* Extra fields accepted by the per-level message shortcuts —
* everything on {@link DevframeMessageEntryInput} except the
* `message` and `level` the shortcut itself provides.
*/
type DevframeMessageShortcutInput = Omit<DevframeMessageEntryInput, 'message' | 'level'>;
/**
* Per-level shortcuts shared by the client and the node host —
* `messages.info('...')` is `messages.add({ message: '...', level: 'info' })`.
*/
interface DevframeMessagesLevelShortcuts {
/** Shortcut for `add({ message, level: 'info', ...extra })` */
info: (message: string, extra?: DevframeMessageShortcutInput) => Promise<DevframeMessageHandle>;
/** Shortcut for `add({ message, level: 'warn', ...extra })` */
warn: (message: string, extra?: DevframeMessageShortcutInput) => Promise<DevframeMessageHandle>;
/** Shortcut for `add({ message, level: 'error', ...extra })` */
error: (message: string, extra?: DevframeMessageShortcutInput) => Promise<DevframeMessageHandle>;
/** Shortcut for `add({ message, level: 'success', ...extra })` */
success: (message: string, extra?: DevframeMessageShortcutInput) => Promise<DevframeMessageHandle>;
/** Shortcut for `add({ message, level: 'debug', ...extra })` */
debug: (message: string, extra?: DevframeMessageShortcutInput) => Promise<DevframeMessageHandle>;
}
interface DevframeMessagesClient extends DevframeMessagesLevelShortcuts {
/**
* Add a message entry. Returns a Promise resolving to a handle for subsequent updates/dismissal.
* Can be used without `await` for fire-and-forget usage.
*/
add: (input: DevframeMessageEntryInput) => Promise<DevframeMessageHandle>;
/** Remove a message entry by id */
remove: (id: string) => Promise<void>;
/** Clear all message entries */
clear: () => Promise<void>;
}
/**
* A snapshot or delta of the message list, as returned by
* {@link DevframeMessagesHost.listSince}. Consumers apply `removedIds`
* first, then upsert `entries`, and pass `version` back as `since` on the
* next call.
*/
interface DevframeMessagesListDelta {
/** Entries added or updated since the cursor (or all entries when `full`) */
entries: DevframeMessageEntry[];
/** Ids removed since the cursor (empty when `full`) */
removedIds: string[];
/** The version cursor — pass back as `since` on the next call */
version: number;
/**
* When `true`, `entries` is the complete snapshot and any locally cached
* list must be reset before applying it.
*/
full: boolean;
}
interface DevframeMessagesHost extends DevframeMessagesLevelShortcuts {
readonly entries: Map<string, DevframeMessageEntry>;
readonly events: EventEmitter<{
'message:added': (entry: DevframeMessageEntry) => void;
'message:updated': (entry: DevframeMessageEntry) => void;
'message:removed': (id: string) => void;
'message:cleared': () => void;
}>;
/**
* Add a new message entry. If an entry with the same `id` already exists, it will be updated instead.
* Returns a handle for subsequent updates/dismissal. Can be used without `await` for fire-and-forget.
*/
add: (entry: DevframeMessageEntryInput) => Promise<DevframeMessageHandle>;
/**
* Update an existing message entry by id (partial update)
*/
update: (id: string, patch: Partial<DevframeMessageEntryInput>) => Promise<DevframeMessageEntry | undefined>;
/**
* Remove a message entry by id
*/
remove: (id: string) => Promise<void>;
/**
* Clear all message entries
*/
clear: () => Promise<void>;
/**
* Read the message list incrementally. Pass the `version` from the
* previous result as `since` to receive only the entries modified and the
* ids removed after that point; pass `null`/`undefined` for the initial
* full snapshot. When the host can no longer compute a reliable delta for
* the given cursor (trimmed removal history, or a cursor from another host
* incarnation), the result carries `full: true` with the complete list.
*/
listSince: (since?: number | null) => DevframeMessagesListDelta;
}
//#endregion
//#region src/types/terminals.d.ts
interface DevframeTerminalsHost {
readonly sessions: Map<string, DevframeTerminalSession>;
readonly events: EventEmitter<{
'terminal:session:updated': (session: DevframeTerminalSession) => void;
}>;
register: (session: DevframeTerminalSession) => DevframeTerminalSession;
update: (session: DevframeTerminalSession) => void;
/**
* Spawn a read-only child process (pipe-backed, output only). Use this for
* long-running logs and dev servers that don't need input.
*/
startChildProcess: (executeOptions: DevframeChildProcessExecuteOptions, terminal: Omit<DevframeTerminalSessionBase, 'status'>) => Promise<DevframeChildProcessTerminalSession>;
/**
* Spawn a fully interactive pseudo-terminal (PTY) any plugin can drive:
* keystrokes via {@link DevframePtyTerminalSession.write}, live layout via
* {@link DevframePtyTerminalSession.resize}, TUI-capable. The session is
* marked `interactive`, so a hub-aware terminal UI (e.g. the terminals
* plugin) surfaces it as writable rather than read-only. Powered by
* `zigpty` — where its native bindings can't load, it degrades to
* pipe-based terminal emulation.
*/
startPtySession: (executeOptions: DevframePtyExecuteOptions, terminal: Omit<DevframeTerminalSessionBase, 'status'>) => Promise<DevframePtyTerminalSession>;
}
type DevframeTerminalStatus = 'running' | 'stopped' | 'error';
interface DevframeTerminalSessionBase {
id: string;
title: string;
description?: string;
status: DevframeTerminalStatus;
icon?: DevframeDockEntryIcon;
/**
* Whether the session accepts input (keystrokes + resize). `true` for
* {@link DevframeTerminalsHost.startPtySession} sessions; absent/`false`
* for pipe-backed, output-only ones. A hub-aware terminal UI reads this to
* decide whether to enable stdin and wire resize.
*/
interactive?: boolean;
}
interface DevframeTerminalSession extends DevframeTerminalSessionBase {
buffer?: string[];
stream?: ReadableStream<string>;
}
interface DevframeChildProcessExecuteOptions {
command: string;
args: string[];
cwd?: string;
env?: Record<string, string>;
}
/**
* The settled outcome of a {@link DevframeChildProcessTerminalSession} run —
* stdout/stderr captured separately (unlike the session's merged display
* `stream`), plus the process's exit code (`undefined` if it was killed by a
* signal before exiting).
*/
interface DevframeChildProcessOutput {
stdout: string;
stderr: string;
exitCode: number | undefined;
}
/**
* A live handle on a child process's outcome — mirrors the ergonomics of
* `tinyexec`'s `Result` (a promise-like paired with synchronous accessors) so
* callers migrating from a `tinyexec`/`execa`-based subprocess API (e.g.
* Nuxt DevTools' `startSubprocess().getResult()`) can adopt
* {@link DevframeTerminalsHost.startChildProcess} with minimal changes.
* `await`ing it (or calling `.then()`) resolves once the process exits, with
* the full captured {@link DevframeChildProcessOutput}.
*/
interface DevframeChildProcessResult extends PromiseLike<DevframeChildProcessOutput> {
readonly pid: number | undefined;
/** `undefined` while the process is still running. */
readonly exitCode: number | undefined;
readonly killed: boolean;
kill: (signal?: NodeJS.Signals | number) => boolean;
}
interface DevframeChildProcessTerminalSession extends DevframeTerminalSession {
type: 'child-process';
executeOptions: DevframeChildProcessExecuteOptions;
getChildProcess: () => ChildProcess | undefined;
/**
* Get a live handle on the current run's outcome. Reflects the most recent
* `restart()` — call it again after restarting to track the new run.
*/
getResult: () => DevframeChildProcessResult;
terminate: () => Promise<void>;
restart: () => Promise<void>;
}
interface DevframePtyExecuteOptions {
command: string;
args?: string[];
cwd?: string;
env?: Record<string, string>;
/** Initial column count. Default: 80. */
cols?: number;
/** Initial row count. Default: 24. */
rows?: number;
}
interface DevframePtyTerminalSession extends DevframeTerminalSession {
type: 'pty';
interactive: true;
executeOptions: DevframePtyExecuteOptions;
/** Send keystrokes / raw input to the PTY. */
write: (data: string) => void;
/** Resize the PTY (emits SIGWINCH so TUIs relayout). */
resize: (cols: number, rows: number) => void;
/** Current foreground process name, when the backend can resolve it. */
getProcessName: () => string | undefined;
terminate: () => Promise<void>;
restart: () => Promise<void>;
}
//#endregion
//#region src/node/context.d.ts
declare module 'devframe/types' {
interface DevframeRpcClientFunctions {
/**
* Server→client notification that terminal sessions changed. Broadcast
* by the hub context; a hub-aware client re-reads terminal state in
* response. Do not register manually.
*
* @internal
*/
'devframe:terminals:updated': () => Promise<void>;
/**
* Server→client notification that the message list changed. Broadcast
* by the hub context; a hub-aware client re-reads message state in
* response. Do not register manually.
*
* @internal
*/
'devframe:messages:updated': () => Promise<void>;
}
}
/**
* Hub-augmented node context — extends devframe's framework-neutral
* `DevframeNodeContext` with the hub-level subsystems (`docks`,
* `terminals`, `messages`, `commands`) and the `createJsonRenderer`
* factory.
*
* Framework kits further extend this with their own slots (e.g.
* `viteConfig`, `viteServer`). Host-specific capabilities (editor open,
* filesystem reveal, etc.) ship as kit-registered RPC functions rather
* than as part of this surface.
*/
interface DevframeHubContext extends DevframeNodeContext {
readonly host: DevframeHost;
docks: DevframeDocksHost;
terminals: DevframeTerminalsHost;
messages: DevframeMessagesHost;
commands: DevframeCommandsHost;
/**
* Create a JsonRenderer handle for building json-render powered UIs.
*/
createJsonRenderer: (spec: JsonRenderSpec) => JsonRenderer;
}
interface CreateHubContextOptions extends CreateHostContextOptions {
/**
* Gate the hub's synthesized built-in dock entries (`~terminals`,
* `~messages`, `~settings`). Each entry defaults to present; set one to
* `false` to suppress it — e.g. when mounting `@devframes/plugin-terminals`
* or `@devframes/plugin-messages`, which replace the built-in tabs.
*
* Omitting this option keeps all three built-ins.
*
* @default { terminals: true, messages: true, settings: true }
*/
builtinDocks?: BuiltinDocksOptions;
}
/**
* Create a hub-level node context: wraps devframe's `createHostContext`,
* attaches the hub hosts (`docks`, `terminals`, `messages`, `commands`),
* registers the hub's built-in RPC commands, and wires the shared-state
* synchronization that powers a hub-aware client UI.
*/
declare function createHubContext(options: CreateHubContextOptions): Promise<DevframeHubContext>;
//#endregion
export { DevframeMessagesHost as C, DevframeMessagesClient as S, DevframeMessagesListDelta as T, DevframeMessageEntryInput as _, DevframeChildProcessOutput as a, DevframeMessageLevel as b, DevframePtyExecuteOptions as c, DevframeTerminalSessionBase as d, DevframeTerminalStatus as f, DevframeMessageEntryFrom as g, DevframeMessageEntry as h, DevframeChildProcessExecuteOptions as i, DevframePtyTerminalSession as l, DevframeMessageElementPosition as m, DevframeHubContext as n, DevframeChildProcessResult as o, DevframeTerminalsHost as p, createHubContext as r, DevframeChildProcessTerminalSession as s, CreateHubContextOptions as t, DevframeTerminalSession as u, DevframeMessageFilePosition as v, DevframeMessagesLevelShortcuts as w, DevframeMessageShortcutInput as x, DevframeMessageHandle as y };
+1
-1

@@ -1,2 +0,2 @@

import { b as DevframeMessagesClient, h as DevframeMessageEntryInput } from "../context-CXN9eDXS.mjs";
import { S as DevframeMessagesClient, _ as DevframeMessageEntryInput } from "../context-BIZOsyvH.mjs";
import { h as DevframeDockEntry, i as DevframeCommandEntry, k as RemoteConnectionInfo, m as DevframeDockEntriesGrouped, n as DevframeClientCommand, o as DevframeCommandKeybinding, t as DevframeDocksUserSettings, y as DevframeDockUserEntry } from "../settings-DJs3n2p1.mjs";

@@ -3,0 +3,0 @@ import { DevframeClientRpcHost, DevframeRpcClient, DevframeRpcClientOptions, DevframeRpcContext, RpcClientEvents } from "devframe/client";

@@ -1,2 +0,2 @@

import { C as DevframeMessagesListDelta, S as DevframeMessagesLevelShortcuts, _ as DevframeMessageHandle, a as DevframeChildProcessTerminalSession, b as DevframeMessagesClient, c as DevframeTerminalSession, d as DevframeTerminalsHost, f as DevframeMessageElementPosition, g as DevframeMessageFilePosition, h as DevframeMessageEntryInput, i as DevframeChildProcessExecuteOptions, l as DevframeTerminalSessionBase, m as DevframeMessageEntryFrom, n as DevframeHubContext, o as DevframePtyExecuteOptions, p as DevframeMessageEntry, s as DevframePtyTerminalSession, t as CreateHubContextOptions, u as DevframeTerminalStatus, v as DevframeMessageLevel, x as DevframeMessagesHost, y as DevframeMessageShortcutInput } from "./context-CXN9eDXS.mjs";
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-BIZOsyvH.mjs";
import { A as RemoteDockOptions, C as DevframeViewCustomRender, D as DevframeViewLauncher, E as DevframeViewJsonRender, M as JsonRenderSpec, N as JsonRenderer, O as DevframeViewLauncherStatus, S as DevframeViewBuiltin, T as DevframeViewIframe, _ as DevframeDockEntryCategory, a as DevframeCommandHandle, b as DevframeDocksHost, c as DevframeCommandsHost, d as DevframeServerCommandInput, f as BuiltinDocksOptions, g as DevframeDockEntryBase, h as DevframeDockEntry, i as DevframeCommandEntry, j as JsonRenderElement, k as RemoteConnectionInfo, l as DevframeCommandsHostEvents, m as DevframeDockEntriesGrouped, n as DevframeClientCommand, o as DevframeCommandKeybinding, p as ClientScriptEntry, r as DevframeCommandBase, s as DevframeCommandShortcutOverrides, t as DevframeDocksUserSettings, u as DevframeServerCommandEntry, v as DevframeDockEntryIcon, w as DevframeViewGroup, x as DevframeViewAction, y as DevframeDockUserEntry } from "./settings-DJs3n2p1.mjs";

@@ -16,2 +16,2 @@ 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-Dic9q4eN.mjs";

//#endregion
export { type BuiltinDocksOptions, type ClientScriptEntry, type ConnectionMeta, type CreateHubContextOptions, type DevframeCapabilities, type DevframeChildProcessExecuteOptions, 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 DevframeDockEntriesGrouped, type DevframeDockEntry, type DevframeDockEntryBase, type DevframeDockEntryCategory, type DevframeDockEntryIcon, type DevframeDockUserEntry, 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 };
export { type BuiltinDocksOptions, 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 DevframeDockEntriesGrouped, type DevframeDockEntry, type DevframeDockEntryBase, type DevframeDockEntryCategory, type DevframeDockEntryIcon, type DevframeDockUserEntry, 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 };

@@ -1,2 +0,2 @@

import { C as DevframeMessagesListDelta, _ as DevframeMessageHandle, a as DevframeChildProcessTerminalSession, c as DevframeTerminalSession, d as DevframeTerminalsHost$1, h as DevframeMessageEntryInput, i as DevframeChildProcessExecuteOptions, l as DevframeTerminalSessionBase, n as DevframeHubContext, o as DevframePtyExecuteOptions, p as DevframeMessageEntry, r as createHubContext, s as DevframePtyTerminalSession, t as CreateHubContextOptions, x as DevframeMessagesHost$1, y as DevframeMessageShortcutInput } from "../context-CXN9eDXS.mjs";
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-BIZOsyvH.mjs";
import { T as DevframeViewIframe, a as DevframeCommandHandle, b as DevframeDocksHost$1, c as DevframeCommandsHost$1, d as DevframeServerCommandInput, f as BuiltinDocksOptions, h as DevframeDockEntry, p as ClientScriptEntry, t as DevframeDocksUserSettings, u as DevframeServerCommandEntry, y as DevframeDockUserEntry } from "../settings-DJs3n2p1.mjs";

@@ -3,0 +3,0 @@ import { RpcFunctionDefinitionAny } from "devframe/rpc";

@@ -1,4 +0,4 @@

import { C as DevframeMessagesListDelta, S as DevframeMessagesLevelShortcuts, _ as DevframeMessageHandle, a as DevframeChildProcessTerminalSession, b as DevframeMessagesClient, c as DevframeTerminalSession, d as DevframeTerminalsHost, f as DevframeMessageElementPosition, g as DevframeMessageFilePosition, h as DevframeMessageEntryInput, i as DevframeChildProcessExecuteOptions, l as DevframeTerminalSessionBase, m as DevframeMessageEntryFrom, n as DevframeHubContext, o as DevframePtyExecuteOptions, p as DevframeMessageEntry, s as DevframePtyTerminalSession, t as CreateHubContextOptions, u as DevframeTerminalStatus, v as DevframeMessageLevel, x as DevframeMessagesHost, y as DevframeMessageShortcutInput } from "../context-CXN9eDXS.mjs";
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-BIZOsyvH.mjs";
import { A as RemoteDockOptions, C as DevframeViewCustomRender, D as DevframeViewLauncher, E as DevframeViewJsonRender, M as JsonRenderSpec, N as JsonRenderer, O as DevframeViewLauncherStatus, S as DevframeViewBuiltin, T as DevframeViewIframe, _ as DevframeDockEntryCategory, a as DevframeCommandHandle, b as DevframeDocksHost, c as DevframeCommandsHost, d as DevframeServerCommandInput, f as BuiltinDocksOptions, g as DevframeDockEntryBase, h as DevframeDockEntry, i as DevframeCommandEntry, j as JsonRenderElement, k as RemoteConnectionInfo, l as DevframeCommandsHostEvents, m as DevframeDockEntriesGrouped, n as DevframeClientCommand, o as DevframeCommandKeybinding, p as ClientScriptEntry, r as DevframeCommandBase, s as DevframeCommandShortcutOverrides, t as DevframeDocksUserSettings, u as DevframeServerCommandEntry, v as DevframeDockEntryIcon, w as DevframeViewGroup, x as DevframeViewAction, y as DevframeDockUserEntry } from "../settings-DJs3n2p1.mjs";
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-Dic9q4eN.mjs";
export { BuiltinDocksOptions, ClientScriptEntry, type ConnectionMeta, type CreateHubContextOptions, type DevframeCapabilities, DevframeChildProcessExecuteOptions, DevframeChildProcessTerminalSession, DevframeClientCommand, DevframeCommandBase, DevframeCommandEntry, DevframeCommandHandle, DevframeCommandKeybinding, DevframeCommandShortcutOverrides, DevframeCommandsHost, DevframeCommandsHostEvents, type DevframeDiagnosticsDefinition, type DevframeDiagnosticsHost, type DevframeDiagnosticsLogger, DevframeDockEntriesGrouped, DevframeDockEntry, DevframeDockEntryBase, DevframeDockEntryCategory, DevframeDockEntryIcon, DevframeDockUserEntry, 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 };
export { BuiltinDocksOptions, 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, DevframeDockEntriesGrouped, DevframeDockEntry, DevframeDockEntryBase, DevframeDockEntryCategory, DevframeDockEntryIcon, DevframeDockUserEntry, 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 };
{
"name": "@devframes/hub",
"type": "module",
"version": "0.6.0",
"version": "0.6.1",
"description": "Framework-neutral hub layer for devframe — docks, terminals, messages, commands.",

@@ -36,3 +36,3 @@ "author": "Anthony Fu <anthonyfu117@hotmail.com>",

"peerDependencies": {
"devframe": "0.6.0"
"devframe": "0.6.1"
},

@@ -52,3 +52,3 @@ "dependencies": {

"tsdown": "^0.22.3",
"devframe": "0.6.0"
"devframe": "0.6.1"
},

@@ -55,0 +55,0 @@ "scripts": {

import { M as JsonRenderSpec, N as JsonRenderer, b as DevframeDocksHost, c as DevframeCommandsHost, f as BuiltinDocksOptions, v as DevframeDockEntryIcon } from "./settings-DJs3n2p1.mjs";
import { CreateHostContextOptions } from "devframe/node";
import { DevframeHost, DevframeNodeContext, EventEmitter } from "devframe/types";
import { ChildProcess } from "node:child_process";
//#region src/types/messages.d.ts
type DevframeMessageLevel = 'info' | 'warn' | 'error' | 'success' | 'debug';
type DevframeMessageEntryFrom = 'server' | 'browser';
interface DevframeMessageElementPosition {
/** CSS selector for the element */
selector?: string;
/** Bounding box of the element */
boundingBox?: {
x: number;
y: number;
width: number;
height: number;
};
/** Human-readable description of the element */
description?: string;
}
interface DevframeMessageFilePosition {
/** Absolute or relative file path */
file: string;
/** Line number (1-based) */
line?: number;
/** Column number (1-based) */
column?: number;
}
interface DevframeMessageEntry {
/**
* Unique identifier for this message entry (auto-generated if not provided)
*/
id: string;
/**
* Short title or summary of the message
*/
message: string;
/**
* Optional detailed description or explanation
*/
description?: string;
/**
* Severity level, determines color and icon
*/
level: DevframeMessageLevel;
/**
* Optional stack trace string
*/
stacktrace?: string;
/**
* Optional DOM element position info (e.g., for a11y issues)
*/
elementPosition?: DevframeMessageElementPosition;
/**
* Optional source file position info (e.g., for lint errors)
*/
filePosition?: DevframeMessageFilePosition;
/**
* Whether this message should also appear as a toast notification
*/
notify?: boolean;
/**
* Origin of the message entry, automatically set by the context
*/
from: DevframeMessageEntryFrom;
/**
* Grouping category (e.g., 'a11y', 'lint', 'runtime', 'test')
*/
category?: string;
/**
* Optional tags/labels for filtering
*/
labels?: string[];
/**
* Time in ms to auto-dismiss the toast notification (client-side)
*/
autoDismiss?: number;
/**
* Time in ms to auto-delete this message entry (server-side)
*/
autoDelete?: number;
/**
* Timestamp when the message was created (auto-generated if not provided)
*/
timestamp: number;
/**
* Status of the message entry (e.g., 'loading' while an operation is in progress).
* Defaults to 'idle' when not specified.
*/
status?: 'loading' | 'idle';
}
/**
* Input type for creating a message entry.
* `id`, `timestamp`, and `from` are auto-filled by the host.
*/
type DevframeMessageEntryInput = Omit<DevframeMessageEntry, 'id' | 'timestamp' | 'from'> & {
id?: string;
timestamp?: number;
};
interface DevframeMessageHandle {
/** The underlying message entry data */
readonly entry: DevframeMessageEntry;
/** Shortcut to entry.id */
readonly id: string;
/** Partial update of this message entry */
update: (patch: Partial<DevframeMessageEntryInput>) => Promise<DevframeMessageEntry | undefined>;
/** Remove this message entry */
dismiss: () => Promise<void>;
}
/**
* Extra fields accepted by the per-level message shortcuts —
* everything on {@link DevframeMessageEntryInput} except the
* `message` and `level` the shortcut itself provides.
*/
type DevframeMessageShortcutInput = Omit<DevframeMessageEntryInput, 'message' | 'level'>;
/**
* Per-level shortcuts shared by the client and the node host —
* `messages.info('...')` is `messages.add({ message: '...', level: 'info' })`.
*/
interface DevframeMessagesLevelShortcuts {
/** Shortcut for `add({ message, level: 'info', ...extra })` */
info: (message: string, extra?: DevframeMessageShortcutInput) => Promise<DevframeMessageHandle>;
/** Shortcut for `add({ message, level: 'warn', ...extra })` */
warn: (message: string, extra?: DevframeMessageShortcutInput) => Promise<DevframeMessageHandle>;
/** Shortcut for `add({ message, level: 'error', ...extra })` */
error: (message: string, extra?: DevframeMessageShortcutInput) => Promise<DevframeMessageHandle>;
/** Shortcut for `add({ message, level: 'success', ...extra })` */
success: (message: string, extra?: DevframeMessageShortcutInput) => Promise<DevframeMessageHandle>;
/** Shortcut for `add({ message, level: 'debug', ...extra })` */
debug: (message: string, extra?: DevframeMessageShortcutInput) => Promise<DevframeMessageHandle>;
}
interface DevframeMessagesClient extends DevframeMessagesLevelShortcuts {
/**
* Add a message entry. Returns a Promise resolving to a handle for subsequent updates/dismissal.
* Can be used without `await` for fire-and-forget usage.
*/
add: (input: DevframeMessageEntryInput) => Promise<DevframeMessageHandle>;
/** Remove a message entry by id */
remove: (id: string) => Promise<void>;
/** Clear all message entries */
clear: () => Promise<void>;
}
/**
* A snapshot or delta of the message list, as returned by
* {@link DevframeMessagesHost.listSince}. Consumers apply `removedIds`
* first, then upsert `entries`, and pass `version` back as `since` on the
* next call.
*/
interface DevframeMessagesListDelta {
/** Entries added or updated since the cursor (or all entries when `full`) */
entries: DevframeMessageEntry[];
/** Ids removed since the cursor (empty when `full`) */
removedIds: string[];
/** The version cursor — pass back as `since` on the next call */
version: number;
/**
* When `true`, `entries` is the complete snapshot and any locally cached
* list must be reset before applying it.
*/
full: boolean;
}
interface DevframeMessagesHost extends DevframeMessagesLevelShortcuts {
readonly entries: Map<string, DevframeMessageEntry>;
readonly events: EventEmitter<{
'message:added': (entry: DevframeMessageEntry) => void;
'message:updated': (entry: DevframeMessageEntry) => void;
'message:removed': (id: string) => void;
'message:cleared': () => void;
}>;
/**
* Add a new message entry. If an entry with the same `id` already exists, it will be updated instead.
* Returns a handle for subsequent updates/dismissal. Can be used without `await` for fire-and-forget.
*/
add: (entry: DevframeMessageEntryInput) => Promise<DevframeMessageHandle>;
/**
* Update an existing message entry by id (partial update)
*/
update: (id: string, patch: Partial<DevframeMessageEntryInput>) => Promise<DevframeMessageEntry | undefined>;
/**
* Remove a message entry by id
*/
remove: (id: string) => Promise<void>;
/**
* Clear all message entries
*/
clear: () => Promise<void>;
/**
* Read the message list incrementally. Pass the `version` from the
* previous result as `since` to receive only the entries modified and the
* ids removed after that point; pass `null`/`undefined` for the initial
* full snapshot. When the host can no longer compute a reliable delta for
* the given cursor (trimmed removal history, or a cursor from another host
* incarnation), the result carries `full: true` with the complete list.
*/
listSince: (since?: number | null) => DevframeMessagesListDelta;
}
//#endregion
//#region src/types/terminals.d.ts
interface DevframeTerminalsHost {
readonly sessions: Map<string, DevframeTerminalSession>;
readonly events: EventEmitter<{
'terminal:session:updated': (session: DevframeTerminalSession) => void;
}>;
register: (session: DevframeTerminalSession) => DevframeTerminalSession;
update: (session: DevframeTerminalSession) => void;
/**
* Spawn a read-only child process (pipe-backed, output only). Use this for
* long-running logs and dev servers that don't need input.
*/
startChildProcess: (executeOptions: DevframeChildProcessExecuteOptions, terminal: Omit<DevframeTerminalSessionBase, 'status'>) => Promise<DevframeChildProcessTerminalSession>;
/**
* Spawn a fully interactive pseudo-terminal (PTY) any plugin can drive:
* keystrokes via {@link DevframePtyTerminalSession.write}, live layout via
* {@link DevframePtyTerminalSession.resize}, TUI-capable. The session is
* marked `interactive`, so a hub-aware terminal UI (e.g. the terminals
* plugin) surfaces it as writable rather than read-only. Powered by
* `zigpty` — where its native bindings can't load, it degrades to
* pipe-based terminal emulation.
*/
startPtySession: (executeOptions: DevframePtyExecuteOptions, terminal: Omit<DevframeTerminalSessionBase, 'status'>) => Promise<DevframePtyTerminalSession>;
}
type DevframeTerminalStatus = 'running' | 'stopped' | 'error';
interface DevframeTerminalSessionBase {
id: string;
title: string;
description?: string;
status: DevframeTerminalStatus;
icon?: DevframeDockEntryIcon;
/**
* Whether the session accepts input (keystrokes + resize). `true` for
* {@link DevframeTerminalsHost.startPtySession} sessions; absent/`false`
* for pipe-backed, output-only ones. A hub-aware terminal UI reads this to
* decide whether to enable stdin and wire resize.
*/
interactive?: boolean;
}
interface DevframeTerminalSession extends DevframeTerminalSessionBase {
buffer?: string[];
stream?: ReadableStream<string>;
}
interface DevframeChildProcessExecuteOptions {
command: string;
args: string[];
cwd?: string;
env?: Record<string, string>;
}
interface DevframeChildProcessTerminalSession extends DevframeTerminalSession {
type: 'child-process';
executeOptions: DevframeChildProcessExecuteOptions;
getChildProcess: () => ChildProcess | undefined;
terminate: () => Promise<void>;
restart: () => Promise<void>;
}
interface DevframePtyExecuteOptions {
command: string;
args?: string[];
cwd?: string;
env?: Record<string, string>;
/** Initial column count. Default: 80. */
cols?: number;
/** Initial row count. Default: 24. */
rows?: number;
}
interface DevframePtyTerminalSession extends DevframeTerminalSession {
type: 'pty';
interactive: true;
executeOptions: DevframePtyExecuteOptions;
/** Send keystrokes / raw input to the PTY. */
write: (data: string) => void;
/** Resize the PTY (emits SIGWINCH so TUIs relayout). */
resize: (cols: number, rows: number) => void;
/** Current foreground process name, when the backend can resolve it. */
getProcessName: () => string | undefined;
terminate: () => Promise<void>;
restart: () => Promise<void>;
}
//#endregion
//#region src/node/context.d.ts
declare module 'devframe/types' {
interface DevframeRpcClientFunctions {
/**
* Server→client notification that terminal sessions changed. Broadcast
* by the hub context; a hub-aware client re-reads terminal state in
* response. Do not register manually.
*
* @internal
*/
'devframe:terminals:updated': () => Promise<void>;
/**
* Server→client notification that the message list changed. Broadcast
* by the hub context; a hub-aware client re-reads message state in
* response. Do not register manually.
*
* @internal
*/
'devframe:messages:updated': () => Promise<void>;
}
}
/**
* Hub-augmented node context — extends devframe's framework-neutral
* `DevframeNodeContext` with the hub-level subsystems (`docks`,
* `terminals`, `messages`, `commands`) and the `createJsonRenderer`
* factory.
*
* Framework kits further extend this with their own slots (e.g.
* `viteConfig`, `viteServer`). Host-specific capabilities (editor open,
* filesystem reveal, etc.) ship as kit-registered RPC functions rather
* than as part of this surface.
*/
interface DevframeHubContext extends DevframeNodeContext {
readonly host: DevframeHost;
docks: DevframeDocksHost;
terminals: DevframeTerminalsHost;
messages: DevframeMessagesHost;
commands: DevframeCommandsHost;
/**
* Create a JsonRenderer handle for building json-render powered UIs.
*/
createJsonRenderer: (spec: JsonRenderSpec) => JsonRenderer;
}
interface CreateHubContextOptions extends CreateHostContextOptions {
/**
* Gate the hub's synthesized built-in dock entries (`~terminals`,
* `~messages`, `~settings`). Each entry defaults to present; set one to
* `false` to suppress it — e.g. when mounting `@devframes/plugin-terminals`
* or `@devframes/plugin-messages`, which replace the built-in tabs.
*
* Omitting this option keeps all three built-ins.
*
* @default { terminals: true, messages: true, settings: true }
*/
builtinDocks?: BuiltinDocksOptions;
}
/**
* Create a hub-level node context: wraps devframe's `createHostContext`,
* attaches the hub hosts (`docks`, `terminals`, `messages`, `commands`),
* registers the hub's built-in RPC commands, and wires the shared-state
* synchronization that powers a hub-aware client UI.
*/
declare function createHubContext(options: CreateHubContextOptions): Promise<DevframeHubContext>;
//#endregion
export { DevframeMessagesListDelta as C, DevframeMessagesLevelShortcuts as S, DevframeMessageHandle as _, DevframeChildProcessTerminalSession as a, DevframeMessagesClient as b, DevframeTerminalSession as c, DevframeTerminalsHost as d, DevframeMessageElementPosition as f, DevframeMessageFilePosition as g, DevframeMessageEntryInput as h, DevframeChildProcessExecuteOptions as i, DevframeTerminalSessionBase as l, DevframeMessageEntryFrom as m, DevframeHubContext as n, DevframePtyExecuteOptions as o, DevframeMessageEntry as p, createHubContext as r, DevframePtyTerminalSession as s, CreateHubContextOptions as t, DevframeTerminalStatus as u, DevframeMessageLevel as v, DevframeMessagesHost as x, DevframeMessageShortcutInput as y };

Sorry, the diff of this file is too big to display