@devframes/hub 0.5.4 → 0.6.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.
@@ -0,0 +1,331 @@
1
+ import { M as JsonRenderer, _ as DevframeDockEntryIcon, c as DevframeCommandsHost, j as JsonRenderSpec, y as DevframeDocksHost } from "./settings-B9YjSEcl.mjs";
2
+ import { CreateHostContextOptions } from "devframe/node";
3
+ import { DevframeHost, DevframeNodeContext, EventEmitter } from "devframe/types";
4
+ import { ChildProcess } from "node:child_process";
5
+
6
+ //#region src/types/messages.d.ts
7
+ type DevframeMessageLevel = 'info' | 'warn' | 'error' | 'success' | 'debug';
8
+ type DevframeMessageEntryFrom = 'server' | 'browser';
9
+ interface DevframeMessageElementPosition {
10
+ /** CSS selector for the element */
11
+ selector?: string;
12
+ /** Bounding box of the element */
13
+ boundingBox?: {
14
+ x: number;
15
+ y: number;
16
+ width: number;
17
+ height: number;
18
+ };
19
+ /** Human-readable description of the element */
20
+ description?: string;
21
+ }
22
+ interface DevframeMessageFilePosition {
23
+ /** Absolute or relative file path */
24
+ file: string;
25
+ /** Line number (1-based) */
26
+ line?: number;
27
+ /** Column number (1-based) */
28
+ column?: number;
29
+ }
30
+ interface DevframeMessageEntry {
31
+ /**
32
+ * Unique identifier for this message entry (auto-generated if not provided)
33
+ */
34
+ id: string;
35
+ /**
36
+ * Short title or summary of the message
37
+ */
38
+ message: string;
39
+ /**
40
+ * Optional detailed description or explanation
41
+ */
42
+ description?: string;
43
+ /**
44
+ * Severity level, determines color and icon
45
+ */
46
+ level: DevframeMessageLevel;
47
+ /**
48
+ * Optional stack trace string
49
+ */
50
+ stacktrace?: string;
51
+ /**
52
+ * Optional DOM element position info (e.g., for a11y issues)
53
+ */
54
+ elementPosition?: DevframeMessageElementPosition;
55
+ /**
56
+ * Optional source file position info (e.g., for lint errors)
57
+ */
58
+ filePosition?: DevframeMessageFilePosition;
59
+ /**
60
+ * Whether this message should also appear as a toast notification
61
+ */
62
+ notify?: boolean;
63
+ /**
64
+ * Origin of the message entry, automatically set by the context
65
+ */
66
+ from: DevframeMessageEntryFrom;
67
+ /**
68
+ * Grouping category (e.g., 'a11y', 'lint', 'runtime', 'test')
69
+ */
70
+ category?: string;
71
+ /**
72
+ * Optional tags/labels for filtering
73
+ */
74
+ labels?: string[];
75
+ /**
76
+ * Time in ms to auto-dismiss the toast notification (client-side)
77
+ */
78
+ autoDismiss?: number;
79
+ /**
80
+ * Time in ms to auto-delete this message entry (server-side)
81
+ */
82
+ autoDelete?: number;
83
+ /**
84
+ * Timestamp when the message was created (auto-generated if not provided)
85
+ */
86
+ timestamp: number;
87
+ /**
88
+ * Status of the message entry (e.g., 'loading' while an operation is in progress).
89
+ * Defaults to 'idle' when not specified.
90
+ */
91
+ status?: 'loading' | 'idle';
92
+ }
93
+ /**
94
+ * Input type for creating a message entry.
95
+ * `id`, `timestamp`, and `from` are auto-filled by the host.
96
+ */
97
+ type DevframeMessageEntryInput = Omit<DevframeMessageEntry, 'id' | 'timestamp' | 'from'> & {
98
+ id?: string;
99
+ timestamp?: number;
100
+ };
101
+ interface DevframeMessageHandle {
102
+ /** The underlying message entry data */
103
+ readonly entry: DevframeMessageEntry;
104
+ /** Shortcut to entry.id */
105
+ readonly id: string;
106
+ /** Partial update of this message entry */
107
+ update: (patch: Partial<DevframeMessageEntryInput>) => Promise<DevframeMessageEntry | undefined>;
108
+ /** Remove this message entry */
109
+ dismiss: () => Promise<void>;
110
+ }
111
+ /**
112
+ * Extra fields accepted by the per-level message shortcuts —
113
+ * everything on {@link DevframeMessageEntryInput} except the
114
+ * `message` and `level` the shortcut itself provides.
115
+ */
116
+ type DevframeMessageShortcutInput = Omit<DevframeMessageEntryInput, 'message' | 'level'>;
117
+ /**
118
+ * Per-level shortcuts shared by the client and the node host —
119
+ * `messages.info('...')` is `messages.add({ message: '...', level: 'info' })`.
120
+ */
121
+ interface DevframeMessagesLevelShortcuts {
122
+ /** Shortcut for `add({ message, level: 'info', ...extra })` */
123
+ info: (message: string, extra?: DevframeMessageShortcutInput) => Promise<DevframeMessageHandle>;
124
+ /** Shortcut for `add({ message, level: 'warn', ...extra })` */
125
+ warn: (message: string, extra?: DevframeMessageShortcutInput) => Promise<DevframeMessageHandle>;
126
+ /** Shortcut for `add({ message, level: 'error', ...extra })` */
127
+ error: (message: string, extra?: DevframeMessageShortcutInput) => Promise<DevframeMessageHandle>;
128
+ /** Shortcut for `add({ message, level: 'success', ...extra })` */
129
+ success: (message: string, extra?: DevframeMessageShortcutInput) => Promise<DevframeMessageHandle>;
130
+ /** Shortcut for `add({ message, level: 'debug', ...extra })` */
131
+ debug: (message: string, extra?: DevframeMessageShortcutInput) => Promise<DevframeMessageHandle>;
132
+ }
133
+ interface DevframeMessagesClient extends DevframeMessagesLevelShortcuts {
134
+ /**
135
+ * Add a message entry. Returns a Promise resolving to a handle for subsequent updates/dismissal.
136
+ * Can be used without `await` for fire-and-forget usage.
137
+ */
138
+ add: (input: DevframeMessageEntryInput) => Promise<DevframeMessageHandle>;
139
+ /** Remove a message entry by id */
140
+ remove: (id: string) => Promise<void>;
141
+ /** Clear all message entries */
142
+ clear: () => Promise<void>;
143
+ }
144
+ /**
145
+ * A snapshot or delta of the message list, as returned by
146
+ * {@link DevframeMessagesHost.listSince}. Consumers apply `removedIds`
147
+ * first, then upsert `entries`, and pass `version` back as `since` on the
148
+ * next call.
149
+ */
150
+ interface DevframeMessagesListDelta {
151
+ /** Entries added or updated since the cursor (or all entries when `full`) */
152
+ entries: DevframeMessageEntry[];
153
+ /** Ids removed since the cursor (empty when `full`) */
154
+ removedIds: string[];
155
+ /** The version cursor — pass back as `since` on the next call */
156
+ version: number;
157
+ /**
158
+ * When `true`, `entries` is the complete snapshot and any locally cached
159
+ * list must be reset before applying it.
160
+ */
161
+ full: boolean;
162
+ }
163
+ interface DevframeMessagesHost extends DevframeMessagesLevelShortcuts {
164
+ readonly entries: Map<string, DevframeMessageEntry>;
165
+ readonly events: EventEmitter<{
166
+ 'message:added': (entry: DevframeMessageEntry) => void;
167
+ 'message:updated': (entry: DevframeMessageEntry) => void;
168
+ 'message:removed': (id: string) => void;
169
+ 'message:cleared': () => void;
170
+ }>;
171
+ /**
172
+ * Add a new message entry. If an entry with the same `id` already exists, it will be updated instead.
173
+ * Returns a handle for subsequent updates/dismissal. Can be used without `await` for fire-and-forget.
174
+ */
175
+ add: (entry: DevframeMessageEntryInput) => Promise<DevframeMessageHandle>;
176
+ /**
177
+ * Update an existing message entry by id (partial update)
178
+ */
179
+ update: (id: string, patch: Partial<DevframeMessageEntryInput>) => Promise<DevframeMessageEntry | undefined>;
180
+ /**
181
+ * Remove a message entry by id
182
+ */
183
+ remove: (id: string) => Promise<void>;
184
+ /**
185
+ * Clear all message entries
186
+ */
187
+ clear: () => Promise<void>;
188
+ /**
189
+ * Read the message list incrementally. Pass the `version` from the
190
+ * previous result as `since` to receive only the entries modified and the
191
+ * ids removed after that point; pass `null`/`undefined` for the initial
192
+ * full snapshot. When the host can no longer compute a reliable delta for
193
+ * the given cursor (trimmed removal history, or a cursor from another host
194
+ * incarnation), the result carries `full: true` with the complete list.
195
+ */
196
+ listSince: (since?: number | null) => DevframeMessagesListDelta;
197
+ }
198
+ //#endregion
199
+ //#region src/types/terminals.d.ts
200
+ interface DevframeTerminalsHost {
201
+ readonly sessions: Map<string, DevframeTerminalSession>;
202
+ readonly events: EventEmitter<{
203
+ 'terminal:session:updated': (session: DevframeTerminalSession) => void;
204
+ }>;
205
+ register: (session: DevframeTerminalSession) => DevframeTerminalSession;
206
+ update: (session: DevframeTerminalSession) => void;
207
+ /**
208
+ * Spawn a read-only child process (pipe-backed, output only). Use this for
209
+ * long-running logs and dev servers that don't need input.
210
+ */
211
+ startChildProcess: (executeOptions: DevframeChildProcessExecuteOptions, terminal: Omit<DevframeTerminalSessionBase, 'status'>) => Promise<DevframeChildProcessTerminalSession>;
212
+ /**
213
+ * Spawn a fully interactive pseudo-terminal (PTY) any plugin can drive:
214
+ * keystrokes via {@link DevframePtyTerminalSession.write}, live layout via
215
+ * {@link DevframePtyTerminalSession.resize}, TUI-capable. The session is
216
+ * marked `interactive`, so a hub-aware terminal UI (e.g. the terminals
217
+ * plugin) surfaces it as writable rather than read-only. Powered by
218
+ * `zigpty` — where its native bindings can't load, it degrades to
219
+ * pipe-based terminal emulation.
220
+ */
221
+ startPtySession: (executeOptions: DevframePtyExecuteOptions, terminal: Omit<DevframeTerminalSessionBase, 'status'>) => Promise<DevframePtyTerminalSession>;
222
+ }
223
+ type DevframeTerminalStatus = 'running' | 'stopped' | 'error';
224
+ interface DevframeTerminalSessionBase {
225
+ id: string;
226
+ title: string;
227
+ description?: string;
228
+ status: DevframeTerminalStatus;
229
+ icon?: DevframeDockEntryIcon;
230
+ /**
231
+ * Whether the session accepts input (keystrokes + resize). `true` for
232
+ * {@link DevframeTerminalsHost.startPtySession} sessions; absent/`false`
233
+ * for pipe-backed, output-only ones. A hub-aware terminal UI reads this to
234
+ * decide whether to enable stdin and wire resize.
235
+ */
236
+ interactive?: boolean;
237
+ }
238
+ interface DevframeTerminalSession extends DevframeTerminalSessionBase {
239
+ buffer?: string[];
240
+ stream?: ReadableStream<string>;
241
+ }
242
+ interface DevframeChildProcessExecuteOptions {
243
+ command: string;
244
+ args: string[];
245
+ cwd?: string;
246
+ env?: Record<string, string>;
247
+ }
248
+ interface DevframeChildProcessTerminalSession extends DevframeTerminalSession {
249
+ type: 'child-process';
250
+ executeOptions: DevframeChildProcessExecuteOptions;
251
+ getChildProcess: () => ChildProcess | undefined;
252
+ terminate: () => Promise<void>;
253
+ restart: () => Promise<void>;
254
+ }
255
+ interface DevframePtyExecuteOptions {
256
+ command: string;
257
+ args?: string[];
258
+ cwd?: string;
259
+ env?: Record<string, string>;
260
+ /** Initial column count. Default: 80. */
261
+ cols?: number;
262
+ /** Initial row count. Default: 24. */
263
+ rows?: number;
264
+ }
265
+ interface DevframePtyTerminalSession extends DevframeTerminalSession {
266
+ type: 'pty';
267
+ interactive: true;
268
+ executeOptions: DevframePtyExecuteOptions;
269
+ /** Send keystrokes / raw input to the PTY. */
270
+ write: (data: string) => void;
271
+ /** Resize the PTY (emits SIGWINCH so TUIs relayout). */
272
+ resize: (cols: number, rows: number) => void;
273
+ /** Current foreground process name, when the backend can resolve it. */
274
+ getProcessName: () => string | undefined;
275
+ terminate: () => Promise<void>;
276
+ restart: () => Promise<void>;
277
+ }
278
+ //#endregion
279
+ //#region src/node/context.d.ts
280
+ declare module 'devframe/types' {
281
+ interface DevframeRpcClientFunctions {
282
+ /**
283
+ * Server→client notification that terminal sessions changed. Broadcast
284
+ * by the hub context; a hub-aware client re-reads terminal state in
285
+ * response. Do not register manually.
286
+ *
287
+ * @internal
288
+ */
289
+ 'devframe:terminals:updated': () => Promise<void>;
290
+ /**
291
+ * Server→client notification that the message list changed. Broadcast
292
+ * by the hub context; a hub-aware client re-reads message state in
293
+ * response. Do not register manually.
294
+ *
295
+ * @internal
296
+ */
297
+ 'devframe:messages:updated': () => Promise<void>;
298
+ }
299
+ }
300
+ /**
301
+ * Hub-augmented node context — extends devframe's framework-neutral
302
+ * `DevframeNodeContext` with the hub-level subsystems (`docks`,
303
+ * `terminals`, `messages`, `commands`) and the `createJsonRenderer`
304
+ * factory.
305
+ *
306
+ * Framework kits further extend this with their own slots (e.g.
307
+ * `viteConfig`, `viteServer`). Host-specific capabilities (editor open,
308
+ * filesystem reveal, etc.) ship as kit-registered RPC functions rather
309
+ * than as part of this surface.
310
+ */
311
+ interface DevframeHubContext extends DevframeNodeContext {
312
+ readonly host: DevframeHost;
313
+ docks: DevframeDocksHost;
314
+ terminals: DevframeTerminalsHost;
315
+ messages: DevframeMessagesHost;
316
+ commands: DevframeCommandsHost;
317
+ /**
318
+ * Create a JsonRenderer handle for building json-render powered UIs.
319
+ */
320
+ createJsonRenderer: (spec: JsonRenderSpec) => JsonRenderer;
321
+ }
322
+ interface CreateHubContextOptions extends CreateHostContextOptions {}
323
+ /**
324
+ * Create a hub-level node context: wraps devframe's `createHostContext`,
325
+ * attaches the hub hosts (`docks`, `terminals`, `messages`, `commands`),
326
+ * registers the hub's built-in RPC commands, and wires the shared-state
327
+ * synchronization that powers a hub-aware client UI.
328
+ */
329
+ declare function createHubContext(options: CreateHubContextOptions): Promise<DevframeHubContext>;
330
+ //#endregion
331
+ 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 };
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
- import { A as JsonRenderer, C as DevframeViewJsonRender, D as RemoteDockOptions, E as RemoteConnectionInfo, F as DevframeMessageFilePosition, I as DevframeMessageHandle, L as DevframeMessageLevel, M as DevframeMessageEntry, N as DevframeMessageEntryFrom, O as JsonRenderElement, P as DevframeMessageEntryInput, R as DevframeMessagesClient, S as DevframeViewIframe, T as DevframeViewLauncherStatus, _ as DevframeDocksHost, a as DevframeChildProcessTerminalSession, b as DevframeViewCustomRender, c as DevframeTerminalStatus, d as DevframeDockEntriesGrouped, f as DevframeDockEntry, g as DevframeDockUserEntry, h as DevframeDockEntryIcon, i as DevframeChildProcessExecuteOptions, j as DevframeMessageElementPosition, k as JsonRenderSpec, l as DevframeTerminalsHost, m as DevframeDockEntryCategory, n as DevframeHubContext, o as DevframeTerminalSession, p as DevframeDockEntryBase, s as DevframeTerminalSessionBase, t as CreateHubContextOptions, u as ClientScriptEntry, v as DevframeViewAction, w as DevframeViewLauncher, x as DevframeViewGroup, y as DevframeViewBuiltin, z as DevframeMessagesHost } from "./context-Dox-G9vt.mjs";
2
- import { a as DevframeCommandHandle, c as DevframeCommandsHost, d as DevframeServerCommandInput, i as DevframeCommandEntry, l as DevframeCommandsHostEvents, n as DevframeClientCommand, o as DevframeCommandKeybinding, r as DevframeCommandBase, s as DevframeCommandShortcutOverrides, t as DevframeDocksUserSettings, u as DevframeServerCommandEntry } from "./settings-Bp5Ax6Os.mjs";
3
- import { C as RpcStreamingChannel, E as Thenable, S as RpcSharedStateHost, T as RpcStreamingHost, _ as RpcBroadcastOptions, a as DevframeDiagnosticsLogger, b as RpcFunctionsHost, c as DevframeRpcClientFunctions, d as DevframeViewHost, f as EntriesToObject, g as PartialWithoutId, h as EventsMap, i as DevframeDiagnosticsHost, l as DevframeRpcServerFunctions, m as EventUnsubscribe, n as DevframeCapabilities, o as DevframeHost, p as EventEmitter, r as DevframeDiagnosticsDefinition, s as DevframeNodeRpcSession, t as ConnectionMeta, u as DevframeRpcSharedStates, v as RpcDefinitionsFilter, w as RpcStreamingChannelOptions, x as RpcSharedStateGetOptions, y as RpcDefinitionsToFunctions } from "./index-BWTfvdqa.mjs";
1
+ 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-DVh4gk8f.mjs";
2
+ import { A as JsonRenderElement, C as DevframeViewGroup, D as DevframeViewLauncherStatus, E as DevframeViewLauncher, M as JsonRenderer, O as RemoteConnectionInfo, S as DevframeViewCustomRender, T as DevframeViewJsonRender, _ as DevframeDockEntryIcon, a as DevframeCommandHandle, b as DevframeViewAction, c as DevframeCommandsHost, d as DevframeServerCommandInput, f as ClientScriptEntry, g as DevframeDockEntryCategory, h as DevframeDockEntryBase, i as DevframeCommandEntry, j as JsonRenderSpec, k as RemoteDockOptions, l as DevframeCommandsHostEvents, m as DevframeDockEntry, n as DevframeClientCommand, o as DevframeCommandKeybinding, p as DevframeDockEntriesGrouped, r as DevframeCommandBase, s as DevframeCommandShortcutOverrides, t as DevframeDocksUserSettings, u as DevframeServerCommandEntry, v as DevframeDockUserEntry, w as DevframeViewIframe, x as DevframeViewBuiltin, y as DevframeDocksHost } from "./settings-B9YjSEcl.mjs";
3
+ import { C as RpcStreamingChannel, E as Thenable, S as RpcSharedStateHost, T as RpcStreamingHost, _ as RpcBroadcastOptions, a as DevframeDiagnosticsLogger, b as RpcFunctionsHost, c as DevframeRpcClientFunctions, d as DevframeViewHost, f as EntriesToObject, g as PartialWithoutId, h as EventsMap, i as DevframeDiagnosticsHost, l as DevframeRpcServerFunctions, m as EventUnsubscribe, n as DevframeCapabilities, o as DevframeHost, p as EventEmitter, r as DevframeDiagnosticsDefinition, s as DevframeNodeRpcSession, t as ConnectionMeta, u as DevframeRpcSharedStates, v as RpcDefinitionsFilter, w as RpcStreamingChannelOptions, x as RpcSharedStateGetOptions, y as RpcDefinitionsToFunctions } from "./index-Dic9q4eN.mjs";
4
4
  import * as _$devframe_rpc0 from "devframe/rpc";
5
5
  import { WhenContext, WhenExpression } from "devframe/utils/when";
6
6
 
@@ -14,4 +14,4 @@ declare function defineDockEntry<const T extends DevframeDockUserEntry, const W
14
14
  }): T;
15
15
  declare function defineJsonRenderSpec(spec: JsonRenderSpec): JsonRenderSpec;
16
16
  //#endregion
17
- export { ClientScriptEntry, ConnectionMeta, CreateHubContextOptions, DevframeCapabilities, DevframeChildProcessExecuteOptions, DevframeChildProcessTerminalSession, DevframeClientCommand, DevframeCommandBase, DevframeCommandEntry, DevframeCommandHandle, DevframeCommandKeybinding, DevframeCommandShortcutOverrides, DevframeCommandsHost, DevframeCommandsHostEvents, DevframeDiagnosticsDefinition, DevframeDiagnosticsHost, DevframeDiagnosticsLogger, DevframeDockEntriesGrouped, DevframeDockEntry, DevframeDockEntryBase, DevframeDockEntryCategory, DevframeDockEntryIcon, DevframeDockUserEntry, DevframeDocksHost, DevframeDocksUserSettings, DevframeHost, DevframeHubContext, DevframeMessageElementPosition, DevframeMessageEntry, DevframeMessageEntryFrom, DevframeMessageEntryInput, DevframeMessageFilePosition, DevframeMessageHandle, DevframeMessageLevel, DevframeMessagesClient, DevframeMessagesHost, DevframeNodeRpcSession, DevframeRpcClientFunctions, DevframeRpcServerFunctions, DevframeRpcSharedStates, DevframeServerCommandEntry, DevframeServerCommandInput, DevframeTerminalSession, DevframeTerminalSessionBase, DevframeTerminalStatus, DevframeTerminalsHost, DevframeViewAction, DevframeViewBuiltin, DevframeViewCustomRender, DevframeViewGroup, DevframeViewHost, DevframeViewIframe, DevframeViewJsonRender, DevframeViewLauncher, DevframeViewLauncherStatus, EntriesToObject, EventEmitter, EventUnsubscribe, EventsMap, JsonRenderElement, JsonRenderSpec, JsonRenderer, PartialWithoutId, RemoteConnectionInfo, RemoteDockOptions, RpcBroadcastOptions, RpcDefinitionsFilter, RpcDefinitionsToFunctions, RpcFunctionsHost, RpcSharedStateGetOptions, RpcSharedStateHost, RpcStreamingChannel, RpcStreamingChannelOptions, RpcStreamingHost, Thenable, defineCommand, defineDockEntry, defineHubRpcFunction, defineJsonRenderSpec };
17
+ export { ClientScriptEntry, ConnectionMeta, CreateHubContextOptions, DevframeCapabilities, DevframeChildProcessExecuteOptions, DevframeChildProcessTerminalSession, DevframeClientCommand, DevframeCommandBase, DevframeCommandEntry, DevframeCommandHandle, DevframeCommandKeybinding, DevframeCommandShortcutOverrides, DevframeCommandsHost, DevframeCommandsHostEvents, DevframeDiagnosticsDefinition, DevframeDiagnosticsHost, DevframeDiagnosticsLogger, DevframeDockEntriesGrouped, DevframeDockEntry, DevframeDockEntryBase, DevframeDockEntryCategory, DevframeDockEntryIcon, DevframeDockUserEntry, DevframeDocksHost, DevframeDocksUserSettings, DevframeHost, DevframeHubContext, DevframeMessageElementPosition, DevframeMessageEntry, DevframeMessageEntryFrom, DevframeMessageEntryInput, DevframeMessageFilePosition, DevframeMessageHandle, DevframeMessageLevel, DevframeMessageShortcutInput, DevframeMessagesClient, DevframeMessagesHost, DevframeMessagesLevelShortcuts, DevframeMessagesListDelta, DevframeNodeRpcSession, DevframePtyExecuteOptions, DevframePtyTerminalSession, DevframeRpcClientFunctions, DevframeRpcServerFunctions, DevframeRpcSharedStates, DevframeServerCommandEntry, DevframeServerCommandInput, DevframeTerminalSession, DevframeTerminalSessionBase, DevframeTerminalStatus, DevframeTerminalsHost, DevframeViewAction, DevframeViewBuiltin, DevframeViewCustomRender, DevframeViewGroup, DevframeViewHost, DevframeViewIframe, DevframeViewJsonRender, DevframeViewLauncher, DevframeViewLauncherStatus, EntriesToObject, EventEmitter, EventUnsubscribe, EventsMap, JsonRenderElement, JsonRenderSpec, JsonRenderer, PartialWithoutId, RemoteConnectionInfo, RemoteDockOptions, RpcBroadcastOptions, RpcDefinitionsFilter, RpcDefinitionsToFunctions, RpcFunctionsHost, RpcSharedStateGetOptions, RpcSharedStateHost, RpcStreamingChannel, RpcStreamingChannelOptions, RpcStreamingHost, Thenable, defineCommand, defineDockEntry, defineHubRpcFunction, defineJsonRenderSpec };
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { i as defineJsonRenderSpec, n as defineDockEntry, r as defineHubRpcFunction, t as defineCommand } from "./define-tHP6fX6A.mjs";
1
+ import { i as defineJsonRenderSpec, n as defineDockEntry, r as defineHubRpcFunction, t as defineCommand } from "./define-Dp-x6d09.mjs";
2
2
  export { defineCommand, defineDockEntry, defineHubRpcFunction, defineJsonRenderSpec };
@@ -1,5 +1,5 @@
1
- import { I as DevframeMessageHandle, M as DevframeMessageEntry, P as DevframeMessageEntryInput, S as DevframeViewIframe, _ as DevframeDocksHost$1, a as DevframeChildProcessTerminalSession, f as DevframeDockEntry, g as DevframeDockUserEntry, i as DevframeChildProcessExecuteOptions, l as DevframeTerminalsHost$1, n as DevframeHubContext, o as DevframeTerminalSession, r as createHubContext, s as DevframeTerminalSessionBase, t as CreateHubContextOptions, u as ClientScriptEntry, z as DevframeMessagesHost$1 } from "../context-Dox-G9vt.mjs";
2
- import { a as DevframeCommandHandle, c as DevframeCommandsHost$1, d as DevframeServerCommandInput, t as DevframeDocksUserSettings, u as DevframeServerCommandEntry } from "../settings-Bp5Ax6Os.mjs";
1
+ 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-DVh4gk8f.mjs";
2
+ import { a as DevframeCommandHandle, c as DevframeCommandsHost$1, d as DevframeServerCommandInput, f as ClientScriptEntry, m as DevframeDockEntry, t as DevframeDocksUserSettings, u as DevframeServerCommandEntry, v as DevframeDockUserEntry, w as DevframeViewIframe, y as DevframeDocksHost$1 } from "../settings-B9YjSEcl.mjs";
3
3
  import * as _$devframe_rpc0 from "devframe/rpc";
4
4
  import { RpcFunctionDefinitionAny } from "devframe/rpc";
5
5
  import { DevframeDefinition } from "devframe/types";
@@ -59,12 +59,25 @@ declare class DevframeMessagesHost implements DevframeMessagesHost$1 {
59
59
  }>;
60
60
  private _autoDeleteTimers;
61
61
  private _clock;
62
+ /**
63
+ * The tick of the newest removal record dropped from the capped
64
+ * `removals` log — cursors older than this can't get a reliable delta
65
+ * and fall back to a full snapshot in {@link listSince}.
66
+ */
67
+ private _removalsTrimmedAt;
62
68
  private _tick;
69
+ private _recordRemoval;
63
70
  constructor(context: DevframeHubContext);
64
71
  add(input: DevframeMessageEntryInput): Promise<DevframeMessageHandle>;
65
72
  update(id: string, patch: Partial<DevframeMessageEntryInput>): Promise<DevframeMessageEntry | undefined>;
66
73
  remove(id: string): Promise<void>;
74
+ info(message: string, extra?: DevframeMessageShortcutInput): Promise<DevframeMessageHandle>;
75
+ warn(message: string, extra?: DevframeMessageShortcutInput): Promise<DevframeMessageHandle>;
76
+ error(message: string, extra?: DevframeMessageShortcutInput): Promise<DevframeMessageHandle>;
77
+ success(message: string, extra?: DevframeMessageShortcutInput): Promise<DevframeMessageHandle>;
78
+ debug(message: string, extra?: DevframeMessageShortcutInput): Promise<DevframeMessageHandle>;
67
79
  clear(): Promise<void>;
80
+ listSince(since?: number | null): DevframeMessagesListDelta;
68
81
  private _createHandle;
69
82
  }
70
83
  //#endregion
@@ -92,6 +105,7 @@ declare class DevframeTerminalsHost implements DevframeTerminalsHost$1 {
92
105
  remove(session: DevframeTerminalSession): void;
93
106
  private bindStream;
94
107
  startChildProcess(executeOptions: DevframeChildProcessExecuteOptions, terminal: Omit<DevframeTerminalSessionBase, 'status'>): Promise<DevframeChildProcessTerminalSession>;
108
+ startPtySession(executeOptions: DevframePtyExecuteOptions, terminal: Omit<DevframeTerminalSessionBase, 'status'>): Promise<DevframePtyTerminalSession>;
95
109
  }
96
110
  //#endregion
97
111
  //#region src/node/mount-devframe.d.ts
@@ -144,6 +158,114 @@ declare const hubCommandsExecute: {
144
158
  __cache?: WeakMap<object, _$devframe_rpc0.Thenable<_$devframe_rpc0.RpcFunctionSetupResult<[id: string, ...args: any[]], Promise<unknown>>>> | undefined;
145
159
  __promise?: _$devframe_rpc0.Thenable<_$devframe_rpc0.RpcFunctionSetupResult<[id: string, ...args: any[]], Promise<unknown>>> | undefined;
146
160
  };
161
+ /**
162
+ * `hub:messages:add` — Add a message from a browser client into the hub's
163
+ * messages subsystem. Marked `from: 'browser'`. Returns the serializable
164
+ * entry (the mutation handle stays server-side).
165
+ *
166
+ * Pairs with the client-side {@link import('../client').createDevframeClientHost}
167
+ * context, whose `messages` client dispatches through these built-ins so a
168
+ * dock client script can report into the same feed the server writes to.
169
+ */
170
+ declare const hubMessagesAdd: {
171
+ name: "hub:messages:add";
172
+ type?: "action" | undefined;
173
+ cacheable?: boolean;
174
+ args?: undefined;
175
+ returns?: undefined;
176
+ jsonSerializable?: boolean;
177
+ agent?: _$devframe.RpcFunctionAgentOptions;
178
+ setup?: ((context: DevframeHubContext) => _$devframe_rpc0.Thenable<_$devframe_rpc0.RpcFunctionSetupResult<[input: DevframeMessageEntryInput], Promise<DevframeMessageEntry>>>) | undefined;
179
+ handler?: ((input: DevframeMessageEntryInput) => Promise<DevframeMessageEntry>) | undefined;
180
+ dump?: _$devframe_rpc0.RpcDump<[input: DevframeMessageEntryInput], Promise<DevframeMessageEntry>, DevframeHubContext> | undefined;
181
+ snapshot?: boolean;
182
+ __cache?: WeakMap<object, _$devframe_rpc0.Thenable<_$devframe_rpc0.RpcFunctionSetupResult<[input: DevframeMessageEntryInput], Promise<DevframeMessageEntry>>>> | undefined;
183
+ __promise?: _$devframe_rpc0.Thenable<_$devframe_rpc0.RpcFunctionSetupResult<[input: DevframeMessageEntryInput], Promise<DevframeMessageEntry>>> | undefined;
184
+ };
185
+ /** `hub:messages:update` — Patch a message by id; returns the updated entry (or `undefined`). */
186
+ declare const hubMessagesUpdate: {
187
+ name: "hub:messages:update";
188
+ type?: "action" | undefined;
189
+ cacheable?: boolean;
190
+ args?: undefined;
191
+ returns?: undefined;
192
+ jsonSerializable?: boolean;
193
+ agent?: _$devframe.RpcFunctionAgentOptions;
194
+ setup?: ((context: DevframeHubContext) => _$devframe_rpc0.Thenable<_$devframe_rpc0.RpcFunctionSetupResult<[id: string, patch: Partial<DevframeMessageEntryInput>], Promise<DevframeMessageEntry | undefined>>>) | undefined;
195
+ handler?: ((id: string, patch: Partial<DevframeMessageEntryInput>) => Promise<DevframeMessageEntry | undefined>) | undefined;
196
+ dump?: _$devframe_rpc0.RpcDump<[id: string, patch: Partial<DevframeMessageEntryInput>], Promise<DevframeMessageEntry | undefined>, DevframeHubContext> | undefined;
197
+ snapshot?: boolean;
198
+ __cache?: WeakMap<object, _$devframe_rpc0.Thenable<_$devframe_rpc0.RpcFunctionSetupResult<[id: string, patch: Partial<DevframeMessageEntryInput>], Promise<DevframeMessageEntry | undefined>>>> | undefined;
199
+ __promise?: _$devframe_rpc0.Thenable<_$devframe_rpc0.RpcFunctionSetupResult<[id: string, patch: Partial<DevframeMessageEntryInput>], Promise<DevframeMessageEntry | undefined>>> | undefined;
200
+ };
201
+ /** `hub:messages:remove` — Remove a message by id. */
202
+ declare const hubMessagesRemove: {
203
+ name: "hub:messages:remove";
204
+ type?: "action" | undefined;
205
+ cacheable?: boolean;
206
+ args?: undefined;
207
+ returns?: undefined;
208
+ jsonSerializable?: boolean;
209
+ agent?: _$devframe.RpcFunctionAgentOptions;
210
+ setup?: ((context: DevframeHubContext) => _$devframe_rpc0.Thenable<_$devframe_rpc0.RpcFunctionSetupResult<[id: string], Promise<void>>>) | undefined;
211
+ handler?: ((id: string) => Promise<void>) | undefined;
212
+ dump?: _$devframe_rpc0.RpcDump<[id: string], Promise<void>, DevframeHubContext> | undefined;
213
+ snapshot?: boolean;
214
+ __cache?: WeakMap<object, _$devframe_rpc0.Thenable<_$devframe_rpc0.RpcFunctionSetupResult<[id: string], Promise<void>>>> | undefined;
215
+ __promise?: _$devframe_rpc0.Thenable<_$devframe_rpc0.RpcFunctionSetupResult<[id: string], Promise<void>>> | undefined;
216
+ };
217
+ /** `hub:messages:clear` — Remove every message. */
218
+ declare const hubMessagesClear: {
219
+ name: "hub:messages:clear";
220
+ type?: "action" | undefined;
221
+ cacheable?: boolean;
222
+ args?: undefined;
223
+ returns?: undefined;
224
+ jsonSerializable?: boolean;
225
+ agent?: _$devframe.RpcFunctionAgentOptions;
226
+ setup?: ((context: DevframeHubContext) => _$devframe_rpc0.Thenable<_$devframe_rpc0.RpcFunctionSetupResult<[], Promise<void>>>) | undefined;
227
+ handler?: (() => Promise<void>) | undefined;
228
+ dump?: _$devframe_rpc0.RpcDump<[], Promise<void>, DevframeHubContext> | undefined;
229
+ snapshot?: boolean;
230
+ __cache?: WeakMap<object, _$devframe_rpc0.Thenable<_$devframe_rpc0.RpcFunctionSetupResult<[], Promise<void>>>> | undefined;
231
+ __promise?: _$devframe_rpc0.Thenable<_$devframe_rpc0.RpcFunctionSetupResult<[], Promise<void>>> | undefined;
232
+ };
233
+ /**
234
+ * `hub:terminals:write` — Send input to an interactive PTY session spawned
235
+ * via `ctx.terminals.startPtySession`. Lets a hub-aware terminal UI (e.g. the
236
+ * terminals plugin) drive a session owned by another plugin.
237
+ */
238
+ declare const hubTerminalsWrite: {
239
+ name: "hub:terminals:write";
240
+ type?: "action" | undefined;
241
+ cacheable?: boolean;
242
+ args?: undefined;
243
+ returns?: undefined;
244
+ jsonSerializable?: boolean;
245
+ agent?: _$devframe.RpcFunctionAgentOptions;
246
+ setup?: ((context: DevframeHubContext) => _$devframe_rpc0.Thenable<_$devframe_rpc0.RpcFunctionSetupResult<[id: string, data: string], Promise<void>>>) | undefined;
247
+ handler?: ((id: string, data: string) => Promise<void>) | undefined;
248
+ dump?: _$devframe_rpc0.RpcDump<[id: string, data: string], Promise<void>, DevframeHubContext> | undefined;
249
+ snapshot?: boolean;
250
+ __cache?: WeakMap<object, _$devframe_rpc0.Thenable<_$devframe_rpc0.RpcFunctionSetupResult<[id: string, data: string], Promise<void>>>> | undefined;
251
+ __promise?: _$devframe_rpc0.Thenable<_$devframe_rpc0.RpcFunctionSetupResult<[id: string, data: string], Promise<void>>> | undefined;
252
+ };
253
+ /** `hub:terminals:resize` — Resize an interactive PTY session by id. */
254
+ declare const hubTerminalsResize: {
255
+ name: "hub:terminals:resize";
256
+ type?: "action" | undefined;
257
+ cacheable?: boolean;
258
+ args?: undefined;
259
+ returns?: undefined;
260
+ jsonSerializable?: boolean;
261
+ agent?: _$devframe.RpcFunctionAgentOptions;
262
+ setup?: ((context: DevframeHubContext) => _$devframe_rpc0.Thenable<_$devframe_rpc0.RpcFunctionSetupResult<[id: string, cols: number, rows: number], Promise<void>>>) | undefined;
263
+ handler?: ((id: string, cols: number, rows: number) => Promise<void>) | undefined;
264
+ dump?: _$devframe_rpc0.RpcDump<[id: string, cols: number, rows: number], Promise<void>, DevframeHubContext> | undefined;
265
+ snapshot?: boolean;
266
+ __cache?: WeakMap<object, _$devframe_rpc0.Thenable<_$devframe_rpc0.RpcFunctionSetupResult<[id: string, cols: number, rows: number], Promise<void>>>> | undefined;
267
+ __promise?: _$devframe_rpc0.Thenable<_$devframe_rpc0.RpcFunctionSetupResult<[id: string, cols: number, rows: number], Promise<void>>> | undefined;
268
+ };
147
269
  /**
148
270
  * Framework-neutral RPC declarations auto-registered by
149
271
  * {@link createHubContext}. Provide additional RPCs by passing your own
@@ -162,4 +284,4 @@ declare const builtinHubRpcDeclarations: readonly RpcFunctionDefinitionAny[];
162
284
  */
163
285
  declare function createSimpleClientScript(fn: string | ((ctx: any) => void)): ClientScriptEntry;
164
286
  //#endregion
165
- export { CreateHubContextOptions, DevframeCommandsHost, DevframeDocksHost, DevframeHubContext, DevframeMessagesHost, DevframeTerminalsHost, MountDevframeOptions, builtinHubRpcDeclarations, createHubContext, createSimpleClientScript, hubCommandsExecute, mountDevframe };
287
+ export { CreateHubContextOptions, DevframeCommandsHost, DevframeDocksHost, DevframeHubContext, DevframeMessagesHost, DevframeTerminalsHost, MountDevframeOptions, builtinHubRpcDeclarations, createHubContext, createSimpleClientScript, hubCommandsExecute, hubMessagesAdd, hubMessagesClear, hubMessagesRemove, hubMessagesUpdate, hubTerminalsResize, hubTerminalsWrite, mountDevframe };