devframe 0.1.20 → 0.1.21
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/{_shared-S-Ujqz_L.mjs → _shared-iZy45oG3.mjs} +2 -2
- package/dist/adapters/build.d.mts +3 -3
- package/dist/adapters/build.mjs +7 -7
- package/dist/adapters/cli.d.mts +1 -1
- package/dist/adapters/cli.mjs +2 -2
- package/dist/adapters/dev.d.mts +2 -2
- package/dist/adapters/dev.mjs +1 -1
- package/dist/adapters/embedded.d.mts +2 -2
- package/dist/adapters/embedded.mjs +1 -1
- package/dist/adapters/mcp.d.mts +1 -1
- package/dist/adapters/mcp.mjs +4 -3
- package/dist/adapters/vite.d.mts +5 -4
- package/dist/adapters/vite.mjs +4 -3
- package/dist/client/index.d.mts +15 -145
- package/dist/client/index.mjs +3 -12
- package/dist/constants.d.mts +12 -15
- package/dist/constants.mjs +12 -29
- package/dist/context-BJ4r2SmR.mjs +1051 -0
- package/dist/context-internal-Dx_NoSv1.mjs +199 -0
- package/dist/context-internal-saIAfNVw.d.mts +51 -0
- package/dist/{dev-B8i_CBlQ.mjs → dev-CdAy400a.mjs} +6 -6
- package/dist/{devtool-Bm6zZAw5.d.mts → devtool-CNvLs2_Y.d.mts} +37 -538
- package/dist/diagnostics-DxPnRoXO.mjs +51 -0
- package/dist/{human-id-CHS0s28X.mjs → human-id-BLoGo_e5.mjs} +0 -1
- package/dist/{index-BCo03GEF.d.mts → index-CuLRIMto.d.mts} +1 -1
- package/dist/index.d.mts +4 -5
- package/dist/index.mjs +1 -4
- package/dist/internal/index.d.mts +16 -0
- package/dist/internal/index.mjs +3 -0
- package/dist/node/index.d.mts +14 -146
- package/dist/node/index.mjs +7 -6
- package/dist/recipes/open-helpers.d.mts +1 -1
- package/dist/recipes/open-helpers.mjs +1 -1
- package/dist/rpc/index.d.mts +2 -2
- package/dist/rpc/transports/ws-client.d.mts +1 -1
- package/dist/rpc/transports/ws-server.d.mts +1 -1
- package/dist/{server-DksyT-um.d.mts → server-BAqOajx_.d.mts} +1 -1
- package/dist/types/index.d.mts +4 -4
- package/dist/utils/events.d.mts +1 -1
- package/dist/utils/human-id.mjs +1 -1
- package/dist/utils/shared-state.d.mts +1 -1
- package/dist/utils/state.d.mts +1 -1
- package/dist/utils/streaming-channel.d.mts +1 -1
- package/dist/utils/when.d.mts +401 -2
- package/dist/{ws-client-DQySVfF_.d.mts → ws-client-CjPuPFbA.d.mts} +1 -1
- package/dist/{ws-server-VQqESKAs.d.mts → ws-server-C7LnhOHi.d.mts} +1 -1
- package/package.json +2 -5
- package/skills/devframe/SKILL.md +54 -100
- package/skills/devframe/templates/counter-devtool.ts +3 -8
- package/skills/devframe/templates/spa-devtool.ts +2 -7
- package/dist/adapters/kit.d.mts +0 -23
- package/dist/adapters/kit.mjs +0 -16
- package/dist/context-BfvbAyGk.mjs +0 -7215
- package/dist/main-DpINGndA.mjs +0 -601
- package/dist/when-aBBXAEh5.d.mts +0 -401
- package/dist/{host-h3-BMvrFzIJ.mjs → host-h3-9jeHcltx.mjs} +1 -1
- package/dist/{open-BtOOEldu.mjs → open-Dede_w9r.mjs} +4 -4
- /package/dist/{server-qRRM8t3v.mjs → server-CBsxXIH5.mjs} +0 -0
- /package/dist/{static-dump-C1aVSwxY.mjs → static-dump-D5VH8Iqk.mjs} +0 -0
- /package/dist/{transports-BPUzHhI2.mjs → transports-DSV5_5QM.mjs} +0 -0
- /package/dist/{types-ag029cAe.d.mts → types-C5OVe4AC.d.mts} +0 -0
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { g as RpcFunctionsCollectorBase } from "./index-
|
|
2
|
-
import { t as DevToolsNodeRpcSessionMeta } from "./ws-server-
|
|
1
|
+
import { g as RpcFunctionsCollectorBase } from "./index-CuLRIMto.mjs";
|
|
2
|
+
import { t as DevToolsNodeRpcSessionMeta } from "./ws-server-C7LnhOHi.mjs";
|
|
3
3
|
import { Logger, createLogger, defineDiagnostics } from "logs-sdk";
|
|
4
4
|
import { BirpcReturn } from "birpc";
|
|
5
5
|
import { Objectish, Patch, Patch as SharedStatePatch } from "immer";
|
|
6
6
|
import { CAC } from "cac";
|
|
7
7
|
import { GenericSchema, InferOutput } from "valibot";
|
|
8
|
-
import { ChildProcess } from "node:child_process";
|
|
9
8
|
|
|
10
9
|
//#region src/adapters/flags.d.ts
|
|
11
10
|
/**
|
|
@@ -286,127 +285,6 @@ interface DevToolsAgentHost {
|
|
|
286
285
|
getResource: (id: string) => AgentResource | undefined;
|
|
287
286
|
}
|
|
288
287
|
//#endregion
|
|
289
|
-
//#region src/types/commands.d.ts
|
|
290
|
-
interface DevToolsCommandKeybinding {
|
|
291
|
-
/**
|
|
292
|
-
* Keyboard shortcut string.
|
|
293
|
-
* Use "Mod" for platform-aware modifier (Cmd on macOS, Ctrl elsewhere).
|
|
294
|
-
* Examples: "Mod+K", "Mod+Shift+P", "Alt+N"
|
|
295
|
-
*/
|
|
296
|
-
key: string;
|
|
297
|
-
}
|
|
298
|
-
interface DevToolsCommandBase {
|
|
299
|
-
/**
|
|
300
|
-
* Unique namespaced ID, e.g. "vite:open-in-editor"
|
|
301
|
-
*/
|
|
302
|
-
id: string;
|
|
303
|
-
title: string;
|
|
304
|
-
description?: string;
|
|
305
|
-
/**
|
|
306
|
-
* Iconify icon string, e.g. "ph:pencil-duotone"
|
|
307
|
-
*/
|
|
308
|
-
icon?: string;
|
|
309
|
-
category?: string;
|
|
310
|
-
/**
|
|
311
|
-
* Whether to show in command palette. Default: true
|
|
312
|
-
*
|
|
313
|
-
* - `true` — show the command and flatten its children into search results
|
|
314
|
-
* - `false` — hide the command entirely from the palette
|
|
315
|
-
* - `'without-children'` — show the command but don't flatten children into top-level search (children are still accessible via drill-down)
|
|
316
|
-
*/
|
|
317
|
-
showInPalette?: boolean | 'without-children';
|
|
318
|
-
/**
|
|
319
|
-
* Optional context expression for conditional visibility.
|
|
320
|
-
* When set, the command is only shown in the palette and only executable
|
|
321
|
-
* when the expression evaluates to true.
|
|
322
|
-
*
|
|
323
|
-
* Uses the same syntax as keybinding `when` clauses.
|
|
324
|
-
* @example 'clientType == embedded'
|
|
325
|
-
* @example 'dockOpen && !paletteOpen'
|
|
326
|
-
*/
|
|
327
|
-
when?: string;
|
|
328
|
-
/**
|
|
329
|
-
* Default keyboard shortcut(s) for this command
|
|
330
|
-
*/
|
|
331
|
-
keybindings?: DevToolsCommandKeybinding[];
|
|
332
|
-
}
|
|
333
|
-
/**
|
|
334
|
-
* Server command input — what plugins pass to `ctx.commands.register()`.
|
|
335
|
-
*/
|
|
336
|
-
interface DevToolsServerCommandInput extends DevToolsCommandBase {
|
|
337
|
-
/**
|
|
338
|
-
* Handler for this command. Optional if the command only serves as a group for children.
|
|
339
|
-
*/
|
|
340
|
-
handler?: (...args: any[]) => any | Promise<any>;
|
|
341
|
-
/**
|
|
342
|
-
* Static sub-commands. Two levels max (parent → children).
|
|
343
|
-
* Each child must have a globally unique `id`.
|
|
344
|
-
*/
|
|
345
|
-
children?: DevToolsServerCommandInput[];
|
|
346
|
-
}
|
|
347
|
-
/**
|
|
348
|
-
* Serializable server command entry — sent over RPC (no handler).
|
|
349
|
-
*/
|
|
350
|
-
interface DevToolsServerCommandEntry extends DevToolsCommandBase {
|
|
351
|
-
source: 'server';
|
|
352
|
-
children?: DevToolsServerCommandEntry[];
|
|
353
|
-
}
|
|
354
|
-
/**
|
|
355
|
-
* Client command — registered in the webcomponent context.
|
|
356
|
-
*/
|
|
357
|
-
interface DevToolsClientCommand extends DevToolsCommandBase {
|
|
358
|
-
source: 'client';
|
|
359
|
-
/**
|
|
360
|
-
* Action for this command. Optional if the command only serves as a group for children.
|
|
361
|
-
* Return sub-commands for dynamic nested palette menus (runtime submenus).
|
|
362
|
-
*/
|
|
363
|
-
action?: (...args: any[]) => void | DevToolsClientCommand[] | Promise<void | DevToolsClientCommand[]>;
|
|
364
|
-
/**
|
|
365
|
-
* Static sub-commands. Two levels max (parent → children).
|
|
366
|
-
*/
|
|
367
|
-
children?: DevToolsClientCommand[];
|
|
368
|
-
}
|
|
369
|
-
/**
|
|
370
|
-
* Union of command entries visible in the palette.
|
|
371
|
-
*/
|
|
372
|
-
type DevToolsCommandEntry = DevToolsServerCommandEntry | DevToolsClientCommand;
|
|
373
|
-
interface DevToolsCommandHandle {
|
|
374
|
-
readonly id: string;
|
|
375
|
-
update: (patch: Partial<Omit<DevToolsServerCommandInput, 'id'>>) => void;
|
|
376
|
-
unregister: () => void;
|
|
377
|
-
}
|
|
378
|
-
interface DevToolsCommandsHostEvents {
|
|
379
|
-
'command:registered': (command: DevToolsServerCommandEntry) => void;
|
|
380
|
-
'command:unregistered': (id: string) => void;
|
|
381
|
-
}
|
|
382
|
-
interface DevToolsCommandsHost {
|
|
383
|
-
readonly commands: Map<string, DevToolsServerCommandInput>;
|
|
384
|
-
readonly events: EventEmitter<DevToolsCommandsHostEvents>;
|
|
385
|
-
/**
|
|
386
|
-
* Register a command (with optional children).
|
|
387
|
-
*/
|
|
388
|
-
register: (command: DevToolsServerCommandInput) => DevToolsCommandHandle;
|
|
389
|
-
/**
|
|
390
|
-
* Unregister a command by ID (removes parent and all children).
|
|
391
|
-
*/
|
|
392
|
-
unregister: (id: string) => boolean;
|
|
393
|
-
/**
|
|
394
|
-
* Execute a command by ID. Searches top-level and children.
|
|
395
|
-
* Throws if not found or if command has no handler.
|
|
396
|
-
*/
|
|
397
|
-
execute: (id: string, ...args: any[]) => Promise<unknown>;
|
|
398
|
-
/**
|
|
399
|
-
* Returns serializable list (no handlers), preserving tree structure.
|
|
400
|
-
*/
|
|
401
|
-
list: () => DevToolsServerCommandEntry[];
|
|
402
|
-
}
|
|
403
|
-
interface DevToolsCommandShortcutOverrides {
|
|
404
|
-
/**
|
|
405
|
-
* Command ID → keybinding overrides. Empty array = shortcut disabled.
|
|
406
|
-
*/
|
|
407
|
-
[commandId: string]: DevToolsCommandKeybinding[];
|
|
408
|
-
}
|
|
409
|
-
//#endregion
|
|
410
288
|
//#region src/types/diagnostics.d.ts
|
|
411
289
|
/**
|
|
412
290
|
* A diagnostics definition object built with `defineDiagnostics`. Typed as
|
|
@@ -473,183 +351,6 @@ interface DevToolsDiagnosticsHost {
|
|
|
473
351
|
createLogger: typeof createLogger;
|
|
474
352
|
}
|
|
475
353
|
//#endregion
|
|
476
|
-
//#region src/types/docks.d.ts
|
|
477
|
-
interface DevToolsDockHost {
|
|
478
|
-
readonly views: Map<string, DevToolsDockUserEntry>;
|
|
479
|
-
readonly events: EventEmitter<{
|
|
480
|
-
'dock:entry:updated': (entry: DevToolsDockUserEntry) => void;
|
|
481
|
-
}>;
|
|
482
|
-
register: <T extends DevToolsDockUserEntry>(entry: T, force?: boolean) => {
|
|
483
|
-
update: (patch: Partial<T>) => void;
|
|
484
|
-
};
|
|
485
|
-
update: (entry: DevToolsDockUserEntry) => void;
|
|
486
|
-
values: (options?: {
|
|
487
|
-
includeBuiltin?: boolean;
|
|
488
|
-
}) => DevToolsDockEntry[];
|
|
489
|
-
}
|
|
490
|
-
type DevToolsDockEntryCategory = 'app' | 'framework' | 'web' | 'advanced' | 'default' | '~viteplus' | '~builtin';
|
|
491
|
-
type DevToolsDockEntryIcon = string | {
|
|
492
|
-
light: string;
|
|
493
|
-
dark: string;
|
|
494
|
-
};
|
|
495
|
-
interface DevToolsDockEntryBase {
|
|
496
|
-
id: string;
|
|
497
|
-
title: string;
|
|
498
|
-
icon: DevToolsDockEntryIcon;
|
|
499
|
-
/**
|
|
500
|
-
* The default order of the entry in the dock.
|
|
501
|
-
* The higher the number the earlier it appears.
|
|
502
|
-
* @default 0
|
|
503
|
-
*/
|
|
504
|
-
defaultOrder?: number;
|
|
505
|
-
/**
|
|
506
|
-
* The category of the entry
|
|
507
|
-
* @default 'default'
|
|
508
|
-
*/
|
|
509
|
-
category?: DevToolsDockEntryCategory;
|
|
510
|
-
/**
|
|
511
|
-
* Conditional visibility expression.
|
|
512
|
-
* When set, the dock entry is only visible when the expression evaluates to true.
|
|
513
|
-
* Uses the same syntax as command `when` clauses.
|
|
514
|
-
*
|
|
515
|
-
* Set to `'false'` to unconditionally hide the entry.
|
|
516
|
-
*
|
|
517
|
-
* @example 'clientType == embedded'
|
|
518
|
-
* @see {@link import('../utils/when').evaluateWhen}
|
|
519
|
-
*/
|
|
520
|
-
when?: string;
|
|
521
|
-
/**
|
|
522
|
-
* Badge text to display on the dock icon (e.g., unread count)
|
|
523
|
-
*/
|
|
524
|
-
badge?: string;
|
|
525
|
-
}
|
|
526
|
-
interface ClientScriptEntry {
|
|
527
|
-
/**
|
|
528
|
-
* The filepath or module name to import from
|
|
529
|
-
*/
|
|
530
|
-
importFrom: string;
|
|
531
|
-
/**
|
|
532
|
-
* The name to import the module as
|
|
533
|
-
*
|
|
534
|
-
* @default 'default'
|
|
535
|
-
*/
|
|
536
|
-
importName?: string;
|
|
537
|
-
}
|
|
538
|
-
interface DevToolsViewIframe extends DevToolsDockEntryBase {
|
|
539
|
-
type: 'iframe';
|
|
540
|
-
url: string;
|
|
541
|
-
/**
|
|
542
|
-
* The id of the iframe, if multiple tabs is assigned with the same id, the iframe will be shared.
|
|
543
|
-
*
|
|
544
|
-
* When not provided, it would be treated as a unique frame.
|
|
545
|
-
*/
|
|
546
|
-
frameId?: string;
|
|
547
|
-
/**
|
|
548
|
-
* Optional client script to import into the iframe
|
|
549
|
-
*/
|
|
550
|
-
clientScript?: ClientScriptEntry;
|
|
551
|
-
/**
|
|
552
|
-
* Enable remote-UI mode: the core injects a connection descriptor
|
|
553
|
-
* (WS URL + pre-approved auth token) into the iframe URL so a hosted
|
|
554
|
-
* page can connect back via `connectRemoteDevTools()` from
|
|
555
|
-
* `@vitejs/devtools-kit/client` — without needing to ship a dist with
|
|
556
|
-
* the plugin.
|
|
557
|
-
*
|
|
558
|
-
* Requires dev mode (no effect in build mode — no WS server exists).
|
|
559
|
-
* When enabled, the dock is automatically hidden in build mode unless
|
|
560
|
-
* the author provides an explicit `when` clause.
|
|
561
|
-
*
|
|
562
|
-
* @example
|
|
563
|
-
* remote: true
|
|
564
|
-
* remote: { transport: 'query', originLock: false }
|
|
565
|
-
*/
|
|
566
|
-
remote?: boolean | RemoteDockOptions;
|
|
567
|
-
}
|
|
568
|
-
interface RemoteDockOptions {
|
|
569
|
-
/**
|
|
570
|
-
* How to pass the connection descriptor to the hosted page.
|
|
571
|
-
*
|
|
572
|
-
* - `'fragment'` (default): appended as `#vite-devtools-kit-connection=...`.
|
|
573
|
-
* Not sent in HTTP requests or Referer headers — safest for auth tokens.
|
|
574
|
-
* - `'query'`: appended as `?vite-devtools-kit-connection=...`. Use when
|
|
575
|
-
* your hosting platform rewrites fragments or your SPA router repurposes
|
|
576
|
-
* the fragment for navigation. The token will appear in server access
|
|
577
|
-
* logs and outbound Referer headers.
|
|
578
|
-
*
|
|
579
|
-
* @default 'fragment'
|
|
580
|
-
*/
|
|
581
|
-
transport?: 'fragment' | 'query';
|
|
582
|
-
/**
|
|
583
|
-
* Reject WS handshakes whose `Origin` header doesn't match the dock URL
|
|
584
|
-
* origin. Turn off when the same hosted app is served from multiple
|
|
585
|
-
* origins (e.g. preview deploys).
|
|
586
|
-
*
|
|
587
|
-
* @default true
|
|
588
|
-
*/
|
|
589
|
-
originLock?: boolean;
|
|
590
|
-
}
|
|
591
|
-
type DevToolsViewLauncherStatus = 'idle' | 'loading' | 'success' | 'error';
|
|
592
|
-
interface DevToolsViewLauncher extends DevToolsDockEntryBase {
|
|
593
|
-
type: 'launcher';
|
|
594
|
-
launcher: {
|
|
595
|
-
icon?: DevToolsDockEntryIcon;
|
|
596
|
-
title: string;
|
|
597
|
-
status?: DevToolsViewLauncherStatus;
|
|
598
|
-
error?: string;
|
|
599
|
-
description?: string;
|
|
600
|
-
buttonStart?: string;
|
|
601
|
-
buttonLoading?: string;
|
|
602
|
-
onLaunch: () => Promise<void>;
|
|
603
|
-
};
|
|
604
|
-
}
|
|
605
|
-
interface DevToolsViewAction extends DevToolsDockEntryBase {
|
|
606
|
-
type: 'action';
|
|
607
|
-
action: ClientScriptEntry;
|
|
608
|
-
}
|
|
609
|
-
interface DevToolsViewCustomRender extends DevToolsDockEntryBase {
|
|
610
|
-
type: 'custom-render';
|
|
611
|
-
renderer: ClientScriptEntry;
|
|
612
|
-
}
|
|
613
|
-
interface DevToolsViewBuiltin extends DevToolsDockEntryBase {
|
|
614
|
-
type: '~builtin';
|
|
615
|
-
id: '~terminals' | '~messages' | '~client-auth-notice' | '~settings' | '~popup';
|
|
616
|
-
}
|
|
617
|
-
interface JsonRenderElement {
|
|
618
|
-
type: string;
|
|
619
|
-
props?: Record<string, unknown>;
|
|
620
|
-
children?: string[];
|
|
621
|
-
/** json-render event bindings (e.g. `{ press: { action: "my:action" } }`) */
|
|
622
|
-
on?: Record<string, unknown>;
|
|
623
|
-
/** json-render visibility condition */
|
|
624
|
-
visible?: unknown;
|
|
625
|
-
/** json-render repeat binding */
|
|
626
|
-
repeat?: unknown;
|
|
627
|
-
/** Allow additional json-render element fields */
|
|
628
|
-
[key: string]: unknown;
|
|
629
|
-
}
|
|
630
|
-
interface JsonRenderSpec {
|
|
631
|
-
root: string;
|
|
632
|
-
elements: Record<string, JsonRenderElement>;
|
|
633
|
-
/** Initial client-side state model for $state/$bindState expressions */
|
|
634
|
-
state?: Record<string, unknown>;
|
|
635
|
-
}
|
|
636
|
-
interface JsonRenderer {
|
|
637
|
-
/** Replace the entire spec */
|
|
638
|
-
updateSpec: (spec: JsonRenderSpec) => void | Promise<void>;
|
|
639
|
-
/** Update json-render state values (shallow merge into spec.state) */
|
|
640
|
-
updateState: (state: Record<string, unknown>) => void | Promise<void>;
|
|
641
|
-
/** Internal: shared state key used by the client to subscribe */
|
|
642
|
-
readonly _stateKey: string;
|
|
643
|
-
}
|
|
644
|
-
interface DevToolsViewJsonRender extends DevToolsDockEntryBase {
|
|
645
|
-
type: 'json-render';
|
|
646
|
-
/** JsonRenderer handle created by ctx.createJsonRenderer() */
|
|
647
|
-
ui: JsonRenderer;
|
|
648
|
-
}
|
|
649
|
-
type DevToolsDockUserEntry = DevToolsViewIframe | DevToolsViewAction | DevToolsViewCustomRender | DevToolsViewLauncher | DevToolsViewJsonRender;
|
|
650
|
-
type DevToolsDockEntry = DevToolsDockUserEntry | DevToolsViewBuiltin;
|
|
651
|
-
type DevToolsDockEntriesGrouped = [category: string, entries: DevToolsDockEntry[]][];
|
|
652
|
-
//#endregion
|
|
653
354
|
//#region src/types/host.d.ts
|
|
654
355
|
interface DevToolsHost {
|
|
655
356
|
/**
|
|
@@ -686,166 +387,34 @@ interface DevToolsHost {
|
|
|
686
387
|
getStorageDir: (scope: 'workspace' | 'global') => string;
|
|
687
388
|
}
|
|
688
389
|
//#endregion
|
|
689
|
-
//#region src/types/
|
|
690
|
-
|
|
691
|
-
type
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
/** Human-readable description of the element */
|
|
703
|
-
description?: string;
|
|
704
|
-
}
|
|
705
|
-
interface DevToolsMessageFilePosition {
|
|
706
|
-
/** Absolute or relative file path */
|
|
707
|
-
file: string;
|
|
708
|
-
/** Line number (1-based) */
|
|
709
|
-
line?: number;
|
|
710
|
-
/** Column number (1-based) */
|
|
711
|
-
column?: number;
|
|
712
|
-
}
|
|
713
|
-
interface DevToolsMessageEntry {
|
|
714
|
-
/**
|
|
715
|
-
* Unique identifier for this message entry (auto-generated if not provided)
|
|
716
|
-
*/
|
|
717
|
-
id: string;
|
|
718
|
-
/**
|
|
719
|
-
* Short title or summary of the message
|
|
720
|
-
*/
|
|
721
|
-
message: string;
|
|
722
|
-
/**
|
|
723
|
-
* Optional detailed description or explanation
|
|
724
|
-
*/
|
|
725
|
-
description?: string;
|
|
726
|
-
/**
|
|
727
|
-
* Severity level, determines color and icon
|
|
728
|
-
*/
|
|
729
|
-
level: DevToolsMessageLevel;
|
|
730
|
-
/**
|
|
731
|
-
* Optional stack trace string
|
|
732
|
-
*/
|
|
733
|
-
stacktrace?: string;
|
|
734
|
-
/**
|
|
735
|
-
* Optional DOM element position info (e.g., for a11y issues)
|
|
736
|
-
*/
|
|
737
|
-
elementPosition?: DevToolsMessageElementPosition;
|
|
738
|
-
/**
|
|
739
|
-
* Optional source file position info (e.g., for lint errors)
|
|
740
|
-
*/
|
|
741
|
-
filePosition?: DevToolsMessageFilePosition;
|
|
742
|
-
/**
|
|
743
|
-
* Whether this message should also appear as a toast notification
|
|
744
|
-
*/
|
|
745
|
-
notify?: boolean;
|
|
746
|
-
/**
|
|
747
|
-
* Origin of the message entry, automatically set by the context
|
|
748
|
-
*/
|
|
749
|
-
from: DevToolsMessageEntryFrom;
|
|
750
|
-
/**
|
|
751
|
-
* Grouping category (e.g., 'a11y', 'lint', 'runtime', 'test')
|
|
752
|
-
*/
|
|
753
|
-
category?: string;
|
|
754
|
-
/**
|
|
755
|
-
* Optional tags/labels for filtering
|
|
756
|
-
*/
|
|
757
|
-
labels?: string[];
|
|
758
|
-
/**
|
|
759
|
-
* Time in ms to auto-dismiss the toast notification (client-side)
|
|
760
|
-
*/
|
|
761
|
-
autoDismiss?: number;
|
|
762
|
-
/**
|
|
763
|
-
* Time in ms to auto-delete this message entry (server-side)
|
|
764
|
-
*/
|
|
765
|
-
autoDelete?: number;
|
|
766
|
-
/**
|
|
767
|
-
* Timestamp when the message was created (auto-generated if not provided)
|
|
768
|
-
*/
|
|
769
|
-
timestamp: number;
|
|
770
|
-
/**
|
|
771
|
-
* Status of the message entry (e.g., 'loading' while an operation is in progress).
|
|
772
|
-
* Defaults to 'idle' when not specified.
|
|
773
|
-
*/
|
|
774
|
-
status?: 'loading' | 'idle';
|
|
775
|
-
}
|
|
776
|
-
/**
|
|
777
|
-
* Input type for creating a message entry.
|
|
778
|
-
* `id`, `timestamp`, and `from` are auto-filled by the host.
|
|
779
|
-
*/
|
|
780
|
-
type DevToolsMessageEntryInput = Omit<DevToolsMessageEntry, 'id' | 'timestamp' | 'from'> & {
|
|
781
|
-
id?: string;
|
|
782
|
-
timestamp?: number;
|
|
783
|
-
};
|
|
784
|
-
interface DevToolsMessageHandle {
|
|
785
|
-
/** The underlying message entry data */
|
|
786
|
-
readonly entry: DevToolsMessageEntry;
|
|
787
|
-
/** Shortcut to entry.id */
|
|
788
|
-
readonly id: string;
|
|
789
|
-
/** Partial update of this message entry */
|
|
790
|
-
update: (patch: Partial<DevToolsMessageEntryInput>) => Promise<DevToolsMessageEntry | undefined>;
|
|
791
|
-
/** Remove this message entry */
|
|
792
|
-
dismiss: () => Promise<void>;
|
|
390
|
+
//#region src/types/json-render.d.ts
|
|
391
|
+
interface JsonRenderElement {
|
|
392
|
+
type: string;
|
|
393
|
+
props?: Record<string, unknown>;
|
|
394
|
+
children?: string[];
|
|
395
|
+
/** json-render event bindings (e.g. `{ press: { action: "my:action" } }`) */
|
|
396
|
+
on?: Record<string, unknown>;
|
|
397
|
+
/** json-render visibility condition */
|
|
398
|
+
visible?: unknown;
|
|
399
|
+
/** json-render repeat binding */
|
|
400
|
+
repeat?: unknown;
|
|
401
|
+
/** Allow additional json-render element fields */
|
|
402
|
+
[key: string]: unknown;
|
|
793
403
|
}
|
|
794
|
-
interface
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
add: (input: DevToolsMessageEntryInput) => Promise<DevToolsMessageHandle>;
|
|
800
|
-
/** Remove a message entry by id */
|
|
801
|
-
remove: (id: string) => Promise<void>;
|
|
802
|
-
/** Clear all message entries */
|
|
803
|
-
clear: () => Promise<void>;
|
|
404
|
+
interface JsonRenderSpec {
|
|
405
|
+
root: string;
|
|
406
|
+
elements: Record<string, JsonRenderElement>;
|
|
407
|
+
/** Initial client-side state model for $state/$bindState expressions */
|
|
408
|
+
state?: Record<string, unknown>;
|
|
804
409
|
}
|
|
805
|
-
interface
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
}>;
|
|
813
|
-
/**
|
|
814
|
-
* Add a new message entry. If an entry with the same `id` already exists, it will be updated instead.
|
|
815
|
-
* Returns a handle for subsequent updates/dismissal. Can be used without `await` for fire-and-forget.
|
|
816
|
-
*/
|
|
817
|
-
add: (entry: DevToolsMessageEntryInput) => Promise<DevToolsMessageHandle>;
|
|
818
|
-
/**
|
|
819
|
-
* Update an existing message entry by id (partial update)
|
|
820
|
-
*/
|
|
821
|
-
update: (id: string, patch: Partial<DevToolsMessageEntryInput>) => Promise<DevToolsMessageEntry | undefined>;
|
|
822
|
-
/**
|
|
823
|
-
* Remove a message entry by id
|
|
824
|
-
*/
|
|
825
|
-
remove: (id: string) => Promise<void>;
|
|
826
|
-
/**
|
|
827
|
-
* Clear all message entries
|
|
828
|
-
*/
|
|
829
|
-
clear: () => Promise<void>;
|
|
410
|
+
interface JsonRenderer {
|
|
411
|
+
/** Replace the entire spec */
|
|
412
|
+
updateSpec: (spec: JsonRenderSpec) => void | Promise<void>;
|
|
413
|
+
/** Update json-render state values (shallow merge into spec.state) */
|
|
414
|
+
updateState: (state: Record<string, unknown>) => void | Promise<void>;
|
|
415
|
+
/** Internal: shared state key used by the client to subscribe */
|
|
416
|
+
readonly _stateKey: string;
|
|
830
417
|
}
|
|
831
|
-
/** @deprecated alias of {@link DevToolsMessageLevel}. Will be removed in a future release. */
|
|
832
|
-
type DevToolsLogLevel = DevToolsMessageLevel;
|
|
833
|
-
/** @deprecated alias of {@link DevToolsMessageEntryFrom}. Will be removed in a future release. */
|
|
834
|
-
type DevToolsLogEntryFrom = DevToolsMessageEntryFrom;
|
|
835
|
-
/** @deprecated alias of {@link DevToolsMessageElementPosition}. Will be removed in a future release. */
|
|
836
|
-
type DevToolsLogElementPosition = DevToolsMessageElementPosition;
|
|
837
|
-
/** @deprecated alias of {@link DevToolsMessageFilePosition}. Will be removed in a future release. */
|
|
838
|
-
type DevToolsLogFilePosition = DevToolsMessageFilePosition;
|
|
839
|
-
/** @deprecated alias of {@link DevToolsMessageEntry}. Will be removed in a future release. */
|
|
840
|
-
type DevToolsLogEntry = DevToolsMessageEntry;
|
|
841
|
-
/** @deprecated alias of {@link DevToolsMessageEntryInput}. Will be removed in a future release. */
|
|
842
|
-
type DevToolsLogEntryInput = DevToolsMessageEntryInput;
|
|
843
|
-
/** @deprecated alias of {@link DevToolsMessageHandle}. Will be removed in a future release. */
|
|
844
|
-
type DevToolsLogHandle = DevToolsMessageHandle;
|
|
845
|
-
/** @deprecated alias of {@link DevToolsMessagesClient}. Will be removed in a future release. */
|
|
846
|
-
type DevToolsLogsClient = DevToolsMessagesClient;
|
|
847
|
-
/** @deprecated alias of {@link DevToolsMessagesHost}. Will be removed in a future release. */
|
|
848
|
-
type DevToolsLogsHost = DevToolsMessagesHost;
|
|
849
418
|
//#endregion
|
|
850
419
|
//#region src/types/rpc-augments.d.ts
|
|
851
420
|
/**
|
|
@@ -955,53 +524,6 @@ interface DevToolsRpcServerFunctions {
|
|
|
955
524
|
*/
|
|
956
525
|
interface DevToolsRpcSharedStates {}
|
|
957
526
|
//#endregion
|
|
958
|
-
//#region src/types/settings.d.ts
|
|
959
|
-
interface DevToolsDocksUserSettings {
|
|
960
|
-
docksHidden: string[];
|
|
961
|
-
docksCategoriesHidden: string[];
|
|
962
|
-
docksPinned: string[];
|
|
963
|
-
docksCustomOrder: Record<string, number>;
|
|
964
|
-
showIframeAddressBar: boolean;
|
|
965
|
-
closeOnOutsideClick: boolean;
|
|
966
|
-
commandShortcuts: DevToolsCommandShortcutOverrides;
|
|
967
|
-
}
|
|
968
|
-
//#endregion
|
|
969
|
-
//#region src/types/terminals.d.ts
|
|
970
|
-
interface DevToolsTerminalHost {
|
|
971
|
-
readonly sessions: Map<string, DevToolsTerminalSession>;
|
|
972
|
-
readonly events: EventEmitter<{
|
|
973
|
-
'terminal:session:updated': (session: DevToolsTerminalSession) => void;
|
|
974
|
-
}>;
|
|
975
|
-
register: (session: DevToolsTerminalSession) => DevToolsTerminalSession;
|
|
976
|
-
update: (session: DevToolsTerminalSession) => void;
|
|
977
|
-
startChildProcess: (executeOptions: DevToolsChildProcessExecuteOptions, terminal: Omit<DevToolsTerminalSessionBase, 'status'>) => Promise<DevToolsChildProcessTerminalSession>;
|
|
978
|
-
}
|
|
979
|
-
type DevToolsTerminalStatus = 'running' | 'stopped' | 'error';
|
|
980
|
-
interface DevToolsTerminalSessionBase {
|
|
981
|
-
id: string;
|
|
982
|
-
title: string;
|
|
983
|
-
description?: string;
|
|
984
|
-
status: DevToolsTerminalStatus;
|
|
985
|
-
icon?: DevToolsDockEntryIcon;
|
|
986
|
-
}
|
|
987
|
-
interface DevToolsTerminalSession extends DevToolsTerminalSessionBase {
|
|
988
|
-
buffer?: string[];
|
|
989
|
-
stream?: ReadableStream<string>;
|
|
990
|
-
}
|
|
991
|
-
interface DevToolsChildProcessExecuteOptions {
|
|
992
|
-
command: string;
|
|
993
|
-
args: string[];
|
|
994
|
-
cwd?: string;
|
|
995
|
-
env?: Record<string, string>;
|
|
996
|
-
}
|
|
997
|
-
interface DevToolsChildProcessTerminalSession extends DevToolsTerminalSession {
|
|
998
|
-
type: 'child-process';
|
|
999
|
-
executeOptions: DevToolsChildProcessExecuteOptions;
|
|
1000
|
-
getChildProcess: () => ChildProcess | undefined;
|
|
1001
|
-
terminate: () => Promise<void>;
|
|
1002
|
-
restart: () => Promise<void>;
|
|
1003
|
-
}
|
|
1004
|
-
//#endregion
|
|
1005
527
|
//#region src/types/utils.d.ts
|
|
1006
528
|
type Thenable<T> = T | Promise<T>;
|
|
1007
529
|
type EntriesToObject<T extends readonly [string, any][]> = { [K in T[number] as K[0]]: K[1] };
|
|
@@ -1364,6 +886,13 @@ interface DevToolsCapabilities {
|
|
|
1364
886
|
rpc?: boolean;
|
|
1365
887
|
views?: boolean;
|
|
1366
888
|
}
|
|
889
|
+
/**
|
|
890
|
+
* Framework-neutral node context — RPC + diagnostics + agent + the
|
|
891
|
+
* view-host (HTTP file-serving). Hub-level subsystems (docks,
|
|
892
|
+
* terminals, messages, commands) are not part of this surface; they are
|
|
893
|
+
* added by `@vitejs/devtools-kit`'s `createKitContext` when the devtool
|
|
894
|
+
* is mounted into a multi-integration hub.
|
|
895
|
+
*/
|
|
1367
896
|
interface DevToolsNodeContext {
|
|
1368
897
|
readonly workspaceRoot: string;
|
|
1369
898
|
readonly cwd: string;
|
|
@@ -1388,26 +917,12 @@ interface DevToolsNodeContext {
|
|
|
1388
917
|
*/
|
|
1389
918
|
host: DevToolsHost;
|
|
1390
919
|
rpc: RpcFunctionsHost;
|
|
1391
|
-
docks: DevToolsDockHost;
|
|
1392
920
|
views: DevToolsViewHost;
|
|
1393
|
-
utils: DevToolsNodeUtils;
|
|
1394
|
-
terminals: DevToolsTerminalHost;
|
|
1395
|
-
/**
|
|
1396
|
-
* User-facing message subsystem — toast notifications and the
|
|
1397
|
-
* "Messages & Notifications" dock panel. Plugins call
|
|
1398
|
-
* `ctx.messages.add({ ... })` to surface activity to users.
|
|
1399
|
-
*/
|
|
1400
|
-
messages: DevToolsMessagesHost;
|
|
1401
|
-
/**
|
|
1402
|
-
* @deprecated Use `ctx.messages` instead. Will be removed in a future release.
|
|
1403
|
-
*/
|
|
1404
|
-
readonly logs: DevToolsMessagesHost;
|
|
1405
921
|
/**
|
|
1406
922
|
* Structured diagnostics host — wraps `logs-sdk` and lets integrations
|
|
1407
923
|
* register their own coded errors/warnings into the shared logger.
|
|
1408
924
|
*/
|
|
1409
925
|
diagnostics: DevToolsDiagnosticsHost;
|
|
1410
|
-
commands: DevToolsCommandsHost;
|
|
1411
926
|
/**
|
|
1412
927
|
* Agent host — aggregates the agent-exposed surface of this devtool.
|
|
1413
928
|
*
|
|
@@ -1419,15 +934,6 @@ interface DevToolsNodeContext {
|
|
|
1419
934
|
*/
|
|
1420
935
|
createJsonRenderer: (spec: JsonRenderSpec) => JsonRenderer;
|
|
1421
936
|
}
|
|
1422
|
-
interface DevToolsNodeUtils {
|
|
1423
|
-
/**
|
|
1424
|
-
* Create a simple client script from a function or stringified code.
|
|
1425
|
-
*
|
|
1426
|
-
* @deprecated testing helper; prefer a proper importable module.
|
|
1427
|
-
* @experimental
|
|
1428
|
-
*/
|
|
1429
|
-
createSimpleClientScript: (fn: string | ((ctx: any) => void)) => ClientScriptEntry;
|
|
1430
|
-
}
|
|
1431
937
|
interface ConnectionMeta {
|
|
1432
938
|
backend: 'websocket' | 'static';
|
|
1433
939
|
websocket?: number | string;
|
|
@@ -1441,20 +947,13 @@ interface ConnectionMeta {
|
|
|
1441
947
|
*/
|
|
1442
948
|
jsonSerializableMethods?: string[];
|
|
1443
949
|
}
|
|
1444
|
-
interface RemoteConnectionInfo extends ConnectionMeta {
|
|
1445
|
-
backend: 'websocket';
|
|
1446
|
-
websocket: string;
|
|
1447
|
-
v: 1;
|
|
1448
|
-
authToken: string;
|
|
1449
|
-
origin: string;
|
|
1450
|
-
}
|
|
1451
950
|
//#endregion
|
|
1452
951
|
//#region src/types/devtool.d.ts
|
|
1453
952
|
type DevtoolRuntime = 'cli' | 'build' | 'spa' | 'vite' | 'kit' | 'embedded';
|
|
1454
953
|
/**
|
|
1455
954
|
* Classification of how a devtool is being deployed. Hosted adapters
|
|
1456
955
|
* (`vite`, `kit`, `embedded`) share their origin with a host app and
|
|
1457
|
-
* must namespace their mount path under
|
|
956
|
+
* must namespace their mount path under `/__<id>/`. Standalone adapters
|
|
1458
957
|
* (`cli`, `spa`, `build`) own the origin and default to `/`.
|
|
1459
958
|
*/
|
|
1460
959
|
type DevtoolDeploymentKind = 'standalone' | 'hosted';
|
|
@@ -1555,7 +1054,7 @@ interface DevtoolDefinition {
|
|
|
1555
1054
|
version?: string;
|
|
1556
1055
|
/**
|
|
1557
1056
|
* Mount path override. Defaults depend on the adapter:
|
|
1558
|
-
* `/` for standalone (`cli` / `spa` / `build`),
|
|
1057
|
+
* `/` for standalone (`cli` / `spa` / `build`), `/__<id>/` for hosted
|
|
1559
1058
|
* (`vite` / `kit` / `embedded`).
|
|
1560
1059
|
*/
|
|
1561
1060
|
basePath?: string;
|
|
@@ -1573,4 +1072,4 @@ interface DevtoolDefinition {
|
|
|
1573
1072
|
}
|
|
1574
1073
|
declare function defineDevtool(d: DevtoolDefinition): DevtoolDefinition;
|
|
1575
1074
|
//#endregion
|
|
1576
|
-
export {
|
|
1075
|
+
export { AgentHandle as $, ImmutableArray as A, EntriesToObject as B, StreamErrorPayload as C, createStreamReader as D, StreamSinkEvents as E, SharedStateEvents as F, DevToolsRpcSharedStates as G, Thenable as H, SharedStateOptions as I, JsonRenderer as J, JsonRenderElement as K, SharedStatePatch as L, ImmutableObject as M, ImmutableSet as N, createStreamSink as O, SharedState as P, DevToolsDiagnosticsLogger as Q, createSharedState as R, CreateStreamSinkOptions as S, StreamSink as T, DevToolsRpcClientFunctions as U, PartialWithoutId as V, DevToolsRpcServerFunctions as W, DevToolsDiagnosticsDefinition as X, DevToolsHost as Y, DevToolsDiagnosticsHost as Z, RpcStreamingChannel as _, DevtoolRuntime as a, AgentToolInput as at, BufferedChunk as b, defineDevtool as c, EventEmitter as ct, DevToolsNodeContext as d, CliFlagsSchema as dt, AgentManifest as et, DevToolsNodeRpcSession as f, InferCliFlags as ft, RpcSharedStateHost as g, RpcSharedStateGetOptions as h, DevtoolDeploymentKind as i, AgentTool as it, ImmutableMap as j, Immutable as k, ConnectionMeta as l, EventUnsubscribe as lt, RpcFunctionsHost as m, parseCliFlags as mt, DevtoolCliOptions as n, AgentResourceContent as nt, DevtoolSetupInfo as o, DevToolsAgentHost as ot, RpcBroadcastOptions as p, defineCliFlags as pt, JsonRenderSpec as q, DevtoolDefinition as r, AgentResourceInput as rt, DevtoolSpaOptions as s, DevToolsAgentHostEvents as st, DevtoolBrowserContext as t, AgentResource as tt, DevToolsCapabilities as u, EventsMap as ut, RpcStreamingChannelOptions as v, StreamReader as w, CreateStreamReaderOptions as x, RpcStreamingHost as y, DevToolsViewHost as z };
|