devframe 0.1.20 → 0.1.22

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.
Files changed (95) hide show
  1. package/README.md +41 -18
  2. package/dist/{_shared-S-Ujqz_L.mjs → _shared-DcJX9-Az.mjs} +4 -4
  3. package/dist/adapters/build.d.mts +7 -7
  4. package/dist/adapters/build.mjs +15 -14
  5. package/dist/adapters/cli.d.mts +2 -2
  6. package/dist/adapters/cli.mjs +5 -5
  7. package/dist/adapters/dev.d.mts +18 -9
  8. package/dist/adapters/dev.mjs +1 -1
  9. package/dist/adapters/embedded.d.mts +6 -6
  10. package/dist/adapters/embedded.mjs +3 -3
  11. package/dist/adapters/mcp.d.mts +3 -3
  12. package/dist/adapters/mcp.mjs +6 -5
  13. package/dist/adapters/vite.d.mts +46 -12
  14. package/dist/adapters/vite.mjs +81 -17
  15. package/dist/chunk-e9Ob2GDo.mjs +26 -0
  16. package/dist/client/index.d.mts +19 -144
  17. package/dist/client/index.mjs +20 -20
  18. package/dist/colors-Bl4W18Mh.mjs +123 -0
  19. package/dist/constants.d.mts +12 -15
  20. package/dist/constants.mjs +12 -29
  21. package/dist/context-DBd794Rn.d.mts +51 -0
  22. package/dist/context-DUibxhrR.mjs +1034 -0
  23. package/dist/{dev-B8i_CBlQ.mjs → dev-BGpTpYiR.mjs} +20 -21
  24. package/dist/{devtool-Bm6zZAw5.d.mts → devframe-DulcIxwu.d.mts} +59 -569
  25. package/dist/diagnostics-BFhNNmST.mjs +56 -0
  26. package/dist/hash-BHZbo80D.mjs +126 -0
  27. package/dist/{human-id-CHS0s28X.mjs → human-id-adtUWQLr.mjs} +12 -4
  28. package/dist/{index-BCo03GEF.d.mts → index-DB2Ie0Or.d.mts} +2 -3
  29. package/dist/index.d.mts +4 -6
  30. package/dist/index.mjs +2 -8
  31. package/dist/launch-editor-KA_21J1T.mjs +581 -0
  32. package/dist/node/auth.d.mts +44 -0
  33. package/dist/node/auth.mjs +55 -0
  34. package/dist/node/index.d.mts +14 -187
  35. package/dist/node/index.mjs +6 -61
  36. package/dist/node/internal.d.mts +16 -0
  37. package/dist/node/internal.mjs +50 -0
  38. package/dist/{open-BtOOEldu.mjs → open-DmFp0qZA.mjs} +15 -6
  39. package/dist/recipes/open-helpers.d.mts +4 -9
  40. package/dist/recipes/open-helpers.mjs +7 -12
  41. package/dist/revoke-DIMz1r7-.mjs +35 -0
  42. package/dist/rpc/index.d.mts +3 -3
  43. package/dist/rpc/index.mjs +4 -4
  44. package/dist/rpc/transports/ws-client.d.mts +1 -1
  45. package/dist/rpc/transports/ws-client.mjs +2 -1
  46. package/dist/rpc/transports/ws-server.d.mts +1 -1
  47. package/dist/rpc/transports/ws-server.mjs +2 -1
  48. package/dist/{rpc-INbWfHoX.mjs → rpc-CkZuoz-m.mjs} +3 -2
  49. package/dist/{serialization-DwKi05Pn.mjs → serialization-CwO31axa.mjs} +1 -2
  50. package/dist/{server-qRRM8t3v.mjs → server-ma8-ZVyX.mjs} +1 -1
  51. package/dist/{server-DksyT-um.d.mts → server-zKEDxgqD.d.mts} +4 -3
  52. package/dist/shared-state-DCDs0e7y.mjs +928 -0
  53. package/dist/{static-dump-C1aVSwxY.mjs → static-dump-D7AvjrgL.mjs} +1 -1
  54. package/dist/storage-CNC38eU-.mjs +117 -0
  55. package/dist/structured-clone-DcDc2Dds.mjs +221 -0
  56. package/dist/types/index.d.mts +4 -4
  57. package/dist/types/index.mjs +11 -2
  58. package/dist/utils/colors.d.mts +28 -0
  59. package/dist/utils/colors.mjs +2 -0
  60. package/dist/utils/events.d.mts +1 -1
  61. package/dist/utils/hash.d.mts +7 -0
  62. package/dist/utils/hash.mjs +2 -0
  63. package/dist/utils/human-id.d.mts +6 -8
  64. package/dist/utils/human-id.mjs +1 -2
  65. package/dist/utils/launch-editor.d.mts +13 -0
  66. package/dist/utils/launch-editor.mjs +2 -0
  67. package/dist/utils/open.d.mts +16 -0
  68. package/dist/utils/open.mjs +2 -0
  69. package/dist/utils/serve-static.d.mts +30 -0
  70. package/dist/utils/serve-static.mjs +152 -0
  71. package/dist/utils/shared-state.d.mts +1 -1
  72. package/dist/utils/shared-state.mjs +1 -35
  73. package/dist/utils/streaming-channel.d.mts +1 -1
  74. package/dist/utils/structured-clone.d.mts +21 -0
  75. package/dist/utils/structured-clone.mjs +2 -0
  76. package/dist/utils/when.d.mts +384 -2
  77. package/dist/utils/when.mjs +20 -2
  78. package/dist/{ws-client-DQySVfF_.d.mts → ws-client-Bavoya6-.d.mts} +1 -1
  79. package/dist/{ws-server-VQqESKAs.d.mts → ws-server-DjvlwLuM.d.mts} +1 -1
  80. package/package.json +23 -13
  81. package/skills/devframe/SKILL.md +93 -117
  82. package/skills/devframe/templates/{counter-devtool.ts → counter-devframe.ts} +5 -10
  83. package/skills/devframe/templates/{spa-devtool.ts → spa-devframe.ts} +5 -10
  84. package/skills/devframe/templates/vite-client.ts +2 -2
  85. package/dist/adapters/kit.d.mts +0 -23
  86. package/dist/adapters/kit.mjs +0 -16
  87. package/dist/context-BfvbAyGk.mjs +0 -7215
  88. package/dist/main-DpINGndA.mjs +0 -601
  89. package/dist/utils/state.d.mts +0 -50
  90. package/dist/utils/state.mjs +0 -26
  91. package/dist/when-aBBXAEh5.d.mts +0 -401
  92. package/dist/{define-Bb4zh-Dc.mjs → define-CW9gLnyG.mjs} +0 -0
  93. package/dist/{host-h3-BMvrFzIJ.mjs → host-h3-Dz8YnFgu.mjs} +2 -2
  94. /package/dist/{transports-BPUzHhI2.mjs → transports-BnCs4rj9.mjs} +0 -0
  95. /package/dist/{types-ag029cAe.d.mts → types-4rdUEi2R.d.mts} +0 -0
@@ -1,11 +1,9 @@
1
- import { g as RpcFunctionsCollectorBase } from "./index-BCo03GEF.mjs";
2
- import { t as DevToolsNodeRpcSessionMeta } from "./ws-server-VQqESKAs.mjs";
1
+ import { f as RpcFunctionsCollectorBase } from "./index-DB2Ie0Or.mjs";
2
+ import { t as DevToolsNodeRpcSessionMeta } from "./ws-server-DjvlwLuM.mjs";
3
3
  import { Logger, createLogger, defineDiagnostics } from "logs-sdk";
4
4
  import { BirpcReturn } from "birpc";
5
- import { Objectish, Patch, Patch as SharedStatePatch } from "immer";
6
5
  import { CAC } from "cac";
7
6
  import { GenericSchema, InferOutput } from "valibot";
8
- import { ChildProcess } from "node:child_process";
9
7
 
10
8
  //#region src/adapters/flags.d.ts
11
9
  /**
@@ -26,7 +24,7 @@ type CliFlagsSchema = Record<string, GenericSchema>;
26
24
  * config: v.optional(v.string()),
27
25
  * })
28
26
  *
29
- * defineDevtool({
27
+ * defineDevframe({
30
28
  * cli: { flags: appFlags },
31
29
  * setup(ctx, info) {
32
30
  * const flags = info.flags as InferCliFlags<typeof appFlags>
@@ -286,127 +284,6 @@ interface DevToolsAgentHost {
286
284
  getResource: (id: string) => AgentResource | undefined;
287
285
  }
288
286
  //#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
287
  //#region src/types/diagnostics.d.ts
411
288
  /**
412
289
  * A diagnostics definition object built with `defineDiagnostics`. Typed as
@@ -473,183 +350,6 @@ interface DevToolsDiagnosticsHost {
473
350
  createLogger: typeof createLogger;
474
351
  }
475
352
  //#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
353
  //#region src/types/host.d.ts
654
354
  interface DevToolsHost {
655
355
  /**
@@ -686,167 +386,6 @@ interface DevToolsHost {
686
386
  getStorageDir: (scope: 'workspace' | 'global') => string;
687
387
  }
688
388
  //#endregion
689
- //#region src/types/messages.d.ts
690
- type DevToolsMessageLevel = 'info' | 'warn' | 'error' | 'success' | 'debug';
691
- type DevToolsMessageEntryFrom = 'server' | 'browser';
692
- interface DevToolsMessageElementPosition {
693
- /** CSS selector for the element */
694
- selector?: string;
695
- /** Bounding box of the element */
696
- boundingBox?: {
697
- x: number;
698
- y: number;
699
- width: number;
700
- height: number;
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>;
793
- }
794
- interface DevToolsMessagesClient {
795
- /**
796
- * Add a message entry. Returns a Promise resolving to a handle for subsequent updates/dismissal.
797
- * Can be used without `await` for fire-and-forget usage.
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>;
804
- }
805
- interface DevToolsMessagesHost {
806
- readonly entries: Map<string, DevToolsMessageEntry>;
807
- readonly events: EventEmitter<{
808
- 'message:added': (entry: DevToolsMessageEntry) => void;
809
- 'message:updated': (entry: DevToolsMessageEntry) => void;
810
- 'message:removed': (id: string) => void;
811
- 'message:cleared': () => void;
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>;
830
- }
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
- //#endregion
850
389
  //#region src/types/rpc-augments.d.ts
851
390
  /**
852
391
  * To be extended
@@ -955,53 +494,6 @@ interface DevToolsRpcServerFunctions {
955
494
  */
956
495
  interface DevToolsRpcSharedStates {}
957
496
  //#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
497
  //#region src/types/utils.d.ts
1006
498
  type Thenable<T> = T | Promise<T>;
1007
499
  type EntriesToObject<T extends readonly [string, any][]> = { [K in T[number] as K[0]]: K[1] };
@@ -1035,6 +527,15 @@ type ImmutableArray<T> = ReadonlyArray<Immutable<T>>;
1035
527
  type ImmutableMap<K, V> = ReadonlyMap<Immutable<K>, Immutable<V>>;
1036
528
  type ImmutableSet<T> = ReadonlySet<Immutable<T>>;
1037
529
  type ImmutableObject<T> = { readonly [K in keyof T]: Immutable<T[K]> };
530
+ /**
531
+ * Serializable patch describing a single mutation to a `SharedState`.
532
+ * Structurally compatible with JSON-Patch and is safe to send over RPC.
533
+ */
534
+ interface SharedStatePatch {
535
+ op: 'add' | 'remove' | 'replace';
536
+ path: readonly (string | number)[];
537
+ value?: unknown;
538
+ }
1038
539
  /**
1039
540
  * State host that is immutable by default with explicit mutate.
1040
541
  */
@@ -1054,14 +555,14 @@ interface SharedState<T> {
1054
555
  /**
1055
556
  * Apply patches to the state.
1056
557
  */
1057
- patch: (patches: Patch[], syncId?: string) => void;
558
+ patch: (patches: SharedStatePatch[], syncId?: string) => void;
1058
559
  /**
1059
560
  * Sync IDs that have been applied to the state.
1060
561
  */
1061
562
  syncIds: Set<string>;
1062
563
  }
1063
564
  interface SharedStateEvents<T> {
1064
- updated: (fullState: T, patches: Patch[] | undefined, syncId: string) => void;
565
+ updated: (fullState: T, patches: SharedStatePatch[] | undefined, syncId: string) => void;
1065
566
  }
1066
567
  interface SharedStateOptions<T> {
1067
568
  /**
@@ -1075,7 +576,7 @@ interface SharedStateOptions<T> {
1075
576
  */
1076
577
  enablePatches?: boolean;
1077
578
  }
1078
- declare function createSharedState<T extends Objectish>(options: SharedStateOptions<T>): SharedState<T>;
579
+ declare function createSharedState<T extends object>(options: SharedStateOptions<T>): SharedState<T>;
1079
580
  //#endregion
1080
581
  //#region src/utils/streaming-channel.d.ts
1081
582
  /**
@@ -1364,6 +865,13 @@ interface DevToolsCapabilities {
1364
865
  rpc?: boolean;
1365
866
  views?: boolean;
1366
867
  }
868
+ /**
869
+ * Framework-neutral node context — RPC + diagnostics + agent + the
870
+ * view-host (HTTP file-serving). Hub-level subsystems (docks,
871
+ * terminals, messages, commands) are not part of this surface; they are
872
+ * added by `@vitejs/devtools-kit`'s `createKitContext` when the devtool
873
+ * is mounted into a multi-integration hub.
874
+ */
1367
875
  interface DevToolsNodeContext {
1368
876
  readonly workspaceRoot: string;
1369
877
  readonly cwd: string;
@@ -1388,45 +896,18 @@ interface DevToolsNodeContext {
1388
896
  */
1389
897
  host: DevToolsHost;
1390
898
  rpc: RpcFunctionsHost;
1391
- docks: DevToolsDockHost;
1392
899
  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
900
  /**
1406
901
  * Structured diagnostics host — wraps `logs-sdk` and lets integrations
1407
902
  * register their own coded errors/warnings into the shared logger.
1408
903
  */
1409
904
  diagnostics: DevToolsDiagnosticsHost;
1410
- commands: DevToolsCommandsHost;
1411
905
  /**
1412
906
  * Agent host — aggregates the agent-exposed surface of this devtool.
1413
907
  *
1414
908
  * @experimental
1415
909
  */
1416
910
  agent: DevToolsAgentHost;
1417
- /**
1418
- * Create a JsonRenderer handle for building json-render powered UIs.
1419
- */
1420
- createJsonRenderer: (spec: JsonRenderSpec) => JsonRenderer;
1421
- }
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
911
  }
1431
912
  interface ConnectionMeta {
1432
913
  backend: 'websocket' | 'static';
@@ -1441,25 +922,18 @@ interface ConnectionMeta {
1441
922
  */
1442
923
  jsonSerializableMethods?: string[];
1443
924
  }
1444
- interface RemoteConnectionInfo extends ConnectionMeta {
1445
- backend: 'websocket';
1446
- websocket: string;
1447
- v: 1;
1448
- authToken: string;
1449
- origin: string;
1450
- }
1451
925
  //#endregion
1452
- //#region src/types/devtool.d.ts
1453
- type DevtoolRuntime = 'cli' | 'build' | 'spa' | 'vite' | 'kit' | 'embedded';
926
+ //#region src/types/devframe.d.ts
927
+ type DevframeRuntime = 'cli' | 'build' | 'spa' | 'vite' | 'kit' | 'embedded';
1454
928
  /**
1455
- * Classification of how a devtool is being deployed. Hosted adapters
929
+ * Classification of how a devframe is being deployed. Hosted adapters
1456
930
  * (`vite`, `kit`, `embedded`) share their origin with a host app and
1457
- * must namespace their mount path under `/.<id>/`. Standalone adapters
931
+ * must namespace their mount path under `/__<id>/`. Standalone adapters
1458
932
  * (`cli`, `spa`, `build`) own the origin and default to `/`.
1459
933
  */
1460
- type DevtoolDeploymentKind = 'standalone' | 'hosted';
1461
- interface DevtoolCliOptions {
1462
- /** Binary name; default: the devtool's `id`. */
934
+ type DevframeDeploymentKind = 'standalone' | 'hosted';
935
+ interface DevframeCliOptions {
936
+ /** Binary name; default: the devframe's `id`. */
1463
937
  command?: string;
1464
938
  /** Preferred port for the dev server (default 9999). */
1465
939
  port?: number;
@@ -1484,7 +958,7 @@ interface DevtoolCliOptions {
1484
958
  * `devtools.clientAuth` today.
1485
959
  */
1486
960
  auth?: boolean;
1487
- /** Author's SPA dist directory (served as the devtool's UI). */
961
+ /** Author's SPA dist directory (served as the devframe's UI). */
1488
962
  distDir?: string;
1489
963
  /**
1490
964
  * Capability-side CAC hook. Called with the CAC instance after the
@@ -1510,7 +984,7 @@ interface DevtoolCliOptions {
1510
984
  * config: v.optional(v.string()),
1511
985
  * })
1512
986
  *
1513
- * defineDevtool({
987
+ * defineDevframe({
1514
988
  * cli: { flags: appFlags },
1515
989
  * setup(ctx, info) {
1516
990
  * const flags = info.flags as InferCliFlags<typeof appFlags>
@@ -1520,7 +994,7 @@ interface DevtoolCliOptions {
1520
994
  */
1521
995
  flags?: CliFlagsSchema;
1522
996
  }
1523
- interface DevtoolSpaOptions {
997
+ interface DevframeSpaOptions {
1524
998
  base?: string;
1525
999
  /**
1526
1000
  * How the deployed SPA loads its data.
@@ -1530,7 +1004,7 @@ interface DevtoolSpaOptions {
1530
1004
  */
1531
1005
  loader?: 'query' | 'upload' | 'none';
1532
1006
  }
1533
- interface DevtoolBrowserContext {
1007
+ interface DevframeBrowserContext {
1534
1008
  /**
1535
1009
  * The connected RPC client (may be write-disabled in static/spa modes).
1536
1010
  */
@@ -1541,11 +1015,11 @@ interface DevtoolBrowserContext {
1541
1015
  * populate the fields that make sense for their deployment. In
1542
1016
  * particular, `createCli` fills `flags` with the parsed CAC bag.
1543
1017
  */
1544
- interface DevtoolSetupInfo {
1018
+ interface DevframeSetupInfo {
1545
1019
  /** Parsed CLI flags, populated by the CLI adapter. */
1546
1020
  flags?: Record<string, unknown>;
1547
1021
  }
1548
- interface DevtoolDefinition {
1022
+ interface DevframeDefinition {
1549
1023
  id: string;
1550
1024
  name: string;
1551
1025
  icon?: string | {
@@ -1555,7 +1029,7 @@ interface DevtoolDefinition {
1555
1029
  version?: string;
1556
1030
  /**
1557
1031
  * Mount path override. Defaults depend on the adapter:
1558
- * `/` for standalone (`cli` / `spa` / `build`), `/.<id>/` for hosted
1032
+ * `/` for standalone (`cli` / `spa` / `build`), `/__<id>/` for hosted
1559
1033
  * (`vite` / `kit` / `embedded`).
1560
1034
  */
1561
1035
  basePath?: string;
@@ -1565,12 +1039,28 @@ interface DevtoolDefinition {
1565
1039
  spa?: boolean | Record<string, boolean>;
1566
1040
  };
1567
1041
  /** Server-side setup — the primary entrypoint. Runs in every runtime. */
1568
- setup: (ctx: DevToolsNodeContext, info?: DevtoolSetupInfo) => void | Promise<void>;
1042
+ setup: (ctx: DevToolsNodeContext, info?: DevframeSetupInfo) => void | Promise<void>;
1569
1043
  /** Browser-only setup for the SPA adapter (bundled into the client). */
1570
- setupBrowser?: (ctx: DevtoolBrowserContext) => void | Promise<void>;
1571
- cli?: DevtoolCliOptions;
1572
- spa?: DevtoolSpaOptions;
1573
- }
1574
- declare function defineDevtool(d: DevtoolDefinition): DevtoolDefinition;
1044
+ setupBrowser?: (ctx: DevframeBrowserContext) => void | Promise<void>;
1045
+ cli?: DevframeCliOptions;
1046
+ spa?: DevframeSpaOptions;
1047
+ }
1048
+ declare function defineDevframe(d: DevframeDefinition): DevframeDefinition;
1049
+ /** @deprecated Use `DevframeRuntime`. */
1050
+ type DevtoolRuntime = DevframeRuntime;
1051
+ /** @deprecated Use `DevframeDeploymentKind`. */
1052
+ type DevtoolDeploymentKind = DevframeDeploymentKind;
1053
+ /** @deprecated Use `DevframeCliOptions`. */
1054
+ type DevtoolCliOptions = DevframeCliOptions;
1055
+ /** @deprecated Use `DevframeSpaOptions`. */
1056
+ type DevtoolSpaOptions = DevframeSpaOptions;
1057
+ /** @deprecated Use `DevframeBrowserContext`. */
1058
+ type DevtoolBrowserContext = DevframeBrowserContext;
1059
+ /** @deprecated Use `DevframeSetupInfo`. */
1060
+ type DevtoolSetupInfo = DevframeSetupInfo;
1061
+ /** @deprecated Use `DevframeDefinition`. */
1062
+ type DevtoolDefinition = DevframeDefinition;
1063
+ /** @deprecated Use `defineDevframe`. */
1064
+ declare function defineDevtool(d: DevframeDefinition): DevframeDefinition;
1575
1065
  //#endregion
1576
- export { DevToolsRpcServerFunctions as $, AgentManifest as $t, createStreamSink as A, DevToolsViewCustomRender as At, createSharedState as B, DevToolsDiagnosticsHost as Bt, CreateStreamReaderOptions as C, DevToolsDockEntryBase as Ct, StreamSink as D, DevToolsDockUserEntry as Dt, StreamReader as E, DevToolsDockHost as Et, ImmutableSet as F, JsonRenderElement as Ft, DevToolsChildProcessExecuteOptions as G, DevToolsCommandHandle as Gt, EntriesToObject as H, DevToolsClientCommand as Ht, SharedState as I, JsonRenderSpec as It, DevToolsTerminalSession as J, DevToolsCommandsHost as Jt, DevToolsChildProcessTerminalSession as K, DevToolsCommandKeybinding as Kt, SharedStateEvents as L, JsonRenderer as Lt, ImmutableArray as M, DevToolsViewJsonRender as Mt, ImmutableMap as N, DevToolsViewLauncher as Nt, StreamSinkEvents as O, DevToolsViewAction as Ot, ImmutableObject as P, DevToolsViewLauncherStatus as Pt, DevToolsRpcClientFunctions as Q, AgentHandle as Qt, SharedStateOptions as R, RemoteDockOptions as Rt, BufferedChunk as S, DevToolsDockEntry as St, StreamErrorPayload as T, DevToolsDockEntryIcon as Tt, PartialWithoutId as U, DevToolsCommandBase as Ut, DevToolsViewHost as V, DevToolsDiagnosticsLogger as Vt, Thenable as W, DevToolsCommandEntry as Wt, DevToolsTerminalStatus as X, DevToolsServerCommandEntry as Xt, DevToolsTerminalSessionBase as Y, DevToolsCommandsHostEvents as Yt, DevToolsDocksUserSettings as Z, DevToolsServerCommandInput as Zt, RpcSharedStateGetOptions as _, DevToolsMessagesClient as _t, DevtoolRuntime as a, DevToolsAgentHost as an, DevToolsLogFilePosition as at, RpcStreamingChannelOptions as b, ClientScriptEntry as bt, defineDevtool as c, EventUnsubscribe as cn, DevToolsLogsClient as ct, DevToolsNodeContext as d, InferCliFlags as dn, DevToolsMessageEntry as dt, AgentResource as en, DevToolsRpcSharedStates as et, DevToolsNodeUtils as f, defineCliFlags as fn, DevToolsMessageEntryFrom as ft, RpcFunctionsHost as g, DevToolsMessageLevel as gt, RpcBroadcastOptions as h, DevToolsMessageHandle as ht, DevtoolDeploymentKind as i, AgentToolInput as in, DevToolsLogEntryInput as it, Immutable as j, DevToolsViewIframe as jt, createStreamReader as k, DevToolsViewBuiltin as kt, ConnectionMeta as l, EventsMap as ln, DevToolsLogsHost as lt, DevToolsNodeRpcSession as m, DevToolsMessageFilePosition as mt, DevtoolCliOptions as n, AgentResourceInput as nn, DevToolsLogEntry as nt, DevtoolSetupInfo as o, DevToolsAgentHostEvents as on, DevToolsLogHandle as ot, RemoteConnectionInfo as p, parseCliFlags as pn, DevToolsMessageEntryInput as pt, DevToolsTerminalHost as q, DevToolsCommandShortcutOverrides as qt, DevtoolDefinition as r, AgentTool as rn, DevToolsLogEntryFrom as rt, DevtoolSpaOptions as s, EventEmitter as sn, DevToolsLogLevel as st, DevtoolBrowserContext as t, AgentResourceContent as tn, DevToolsLogElementPosition as tt, DevToolsCapabilities as u, CliFlagsSchema as un, DevToolsMessageElementPosition as ut, RpcSharedStateHost as v, DevToolsMessagesHost as vt, CreateStreamSinkOptions as w, DevToolsDockEntryCategory as wt, RpcStreamingHost as x, DevToolsDockEntriesGrouped as xt, RpcStreamingChannel as y, DevToolsHost as yt, SharedStatePatch as z, DevToolsDiagnosticsDefinition as zt };
1066
+ export { DevToolsRpcSharedStates as $, CreateStreamSinkOptions as A, ImmutableObject as B, RpcSharedStateGetOptions as C, RpcStreamingHost as D, RpcStreamingChannelOptions as E, createStreamReader as F, SharedStatePatch as G, SharedState as H, createStreamSink as I, EntriesToObject as J, createSharedState as K, Immutable as L, StreamReader as M, StreamSink as N, BufferedChunk as O, StreamSinkEvents as P, DevToolsRpcServerFunctions as Q, ImmutableArray as R, RpcFunctionsHost as S, RpcStreamingChannel as T, SharedStateEvents as U, ImmutableSet as V, SharedStateOptions as W, Thenable as X, PartialWithoutId as Y, DevToolsRpcClientFunctions as Z, ConnectionMeta as _, InferCliFlags as _t, DevframeRuntime as a, AgentManifest as at, DevToolsNodeRpcSession as b, DevtoolBrowserContext as c, AgentResourceInput as ct, DevtoolDeploymentKind as d, DevToolsAgentHost as dt, DevToolsHost as et, DevtoolRuntime as f, DevToolsAgentHostEvents as ft, defineDevtool as g, CliFlagsSchema as gt, defineDevframe as h, EventsMap as ht, DevframeDeploymentKind as i, AgentHandle as it, StreamErrorPayload as j, CreateStreamReaderOptions as k, DevtoolCliOptions as l, AgentTool as lt, DevtoolSpaOptions as m, EventUnsubscribe as mt, DevframeCliOptions as n, DevToolsDiagnosticsHost as nt, DevframeSetupInfo as o, AgentResource as ot, DevtoolSetupInfo as p, EventEmitter as pt, DevToolsViewHost as q, DevframeDefinition as r, DevToolsDiagnosticsLogger as rt, DevframeSpaOptions as s, AgentResourceContent as st, DevframeBrowserContext as t, DevToolsDiagnosticsDefinition as tt, DevtoolDefinition as u, AgentToolInput as ut, DevToolsCapabilities as v, defineCliFlags as vt, RpcSharedStateHost as w, RpcBroadcastOptions as x, DevToolsNodeContext as y, parseCliFlags as yt, ImmutableMap as z };