devframe 0.1.22 → 0.2.0

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 (61) hide show
  1. package/README.md +3 -4
  2. package/dist/{_shared-DcJX9-Az.mjs → _shared-BrKv3CYt.mjs} +3 -3
  3. package/dist/adapters/build.d.mts +1 -1
  4. package/dist/adapters/build.mjs +5 -5
  5. package/dist/adapters/cli.d.mts +3 -3
  6. package/dist/adapters/cli.mjs +2 -2
  7. package/dist/adapters/dev.d.mts +7 -7
  8. package/dist/adapters/dev.mjs +1 -1
  9. package/dist/adapters/embedded.d.mts +1 -1
  10. package/dist/adapters/mcp.d.mts +1 -1
  11. package/dist/adapters/mcp.mjs +2 -2
  12. package/dist/client/index.d.mts +2 -4
  13. package/dist/client/index.mjs +7 -16
  14. package/dist/colors-DS7k8ljB.mjs +123 -0
  15. package/dist/{context-DUibxhrR.mjs → context-BBi2IQDm.mjs} +12 -13
  16. package/dist/{context-DBd794Rn.d.mts → context-DRa0wGsC.d.mts} +1 -1
  17. package/dist/{dev-BGpTpYiR.mjs → dev-CewNNE2R.mjs} +14 -17
  18. package/dist/{devframe-DulcIxwu.d.mts → devframe-R5Ex5K5L.d.mts} +10 -26
  19. package/dist/{diagnostics-BFhNNmST.mjs → diagnostics-Cg9ycFIM.mjs} +2 -2
  20. package/dist/hash-CIBte1yS.mjs +263 -0
  21. package/dist/{adapters → helpers}/vite.d.mts +7 -8
  22. package/dist/{adapters → helpers}/vite.mjs +8 -9
  23. package/dist/index.d.mts +2 -2
  24. package/dist/{launch-editor-KA_21J1T.mjs → launch-editor-CX_n_0SS.mjs} +9 -9
  25. package/dist/node/auth.d.mts +2 -2
  26. package/dist/node/index.d.mts +8 -9
  27. package/dist/node/index.mjs +4 -4
  28. package/dist/node/internal.d.mts +5 -5
  29. package/dist/node/internal.mjs +2 -2
  30. package/dist/{open-DmFp0qZA.mjs → open-B2ah1IKK.mjs} +26 -21
  31. package/dist/recipes/open-helpers.mjs +2 -2
  32. package/dist/rpc/index.mjs +1 -1
  33. package/dist/rpc/transports/ws-client.mjs +1 -1
  34. package/dist/rpc/transports/ws-server.mjs +1 -1
  35. package/dist/{rpc-CkZuoz-m.mjs → rpc-DAzoVCR0.mjs} +3 -3
  36. package/dist/{server-ma8-ZVyX.mjs → server-DOk4grlJ.mjs} +3 -3
  37. package/dist/{server-zKEDxgqD.d.mts → server-DzKz023G.d.mts} +5 -5
  38. package/dist/{shared-state-DCDs0e7y.mjs → shared-state-q9-1EOSX.mjs} +1 -1
  39. package/dist/{static-dump-D7AvjrgL.mjs → static-dump-C67bCuse.mjs} +1 -1
  40. package/dist/{storage-CNC38eU-.mjs → storage-CNvfBGQ5.mjs} +3 -3
  41. package/dist/{structured-clone-DcDc2Dds.mjs → structured-clone-CD2l4fI3.mjs} +1 -1
  42. package/dist/types/index.d.mts +2 -2
  43. package/dist/types/index.mjs +1 -10
  44. package/dist/utils/colors.mjs +1 -1
  45. package/dist/utils/events.d.mts +1 -1
  46. package/dist/utils/hash.mjs +1 -1
  47. package/dist/utils/launch-editor.mjs +1 -1
  48. package/dist/utils/open.mjs +1 -1
  49. package/dist/utils/serve-static.d.mts +13 -3
  50. package/dist/utils/serve-static.mjs +41 -20
  51. package/dist/utils/shared-state.d.mts +1 -1
  52. package/dist/utils/shared-state.mjs +1 -1
  53. package/dist/utils/streaming-channel.d.mts +1 -1
  54. package/dist/utils/structured-clone.mjs +1 -1
  55. package/dist/utils/when.d.mts +1 -1
  56. package/dist/utils/when.mjs +1 -1
  57. package/package.json +18 -11
  58. package/skills/devframe/SKILL.md +23 -20
  59. package/skills/devframe/templates/spa-devframe.ts +2 -2
  60. package/dist/colors-Bl4W18Mh.mjs +0 -123
  61. package/dist/hash-BHZbo80D.mjs +0 -126
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # devframe
2
2
 
3
- Framework-neutral foundation for building generic DevTools. Describe one devframe — its RPC, its data, its SPA, its CLI shape — and deploy the same definition through any of seven adapters.
3
+ Framework- and build-tool-agnostic foundation for building generic DevTools. Define your devtool once — its RPC, its data, its SPA, its CLI shape — and deploy the same definition anywhere through a set of pluggable adapters.
4
4
 
5
- Part of the [Vite DevTools](https://devtools.vite.dev) monorepo. Full documentation: [https://devfra.me/](https://devfra.me/).
5
+ Full documentation: [https://devfra.me/](https://devfra.me/).
6
6
 
7
7
  ## Install
8
8
 
@@ -38,8 +38,7 @@ await createCli(devframe).parse()
38
38
  |---------|----------|
39
39
  | `cli` | Standalone CLI tool with `dev` / `build` / `mcp` subcommands. |
40
40
  | `build` | Generates a static, self-contained SPA snapshot. |
41
- | `vite` | Runs as a Vite plugin alongside the host app's dev server. |
42
- | `kit` | Mounts into the DevTools Kit aggregator. |
41
+ | `vite` | Mounts the devframe into Vite DevTools (or any compatible host) via `@vitejs/devtools-kit`. |
43
42
  | `embedded` | Overlays inside another devtool's UI. |
44
43
  | `mcp` | Surfaces the devframe's RPC to coding agents over MCP. |
45
44
 
@@ -1,9 +1,9 @@
1
1
  //#region src/adapters/_shared.ts
2
2
  /**
3
3
  * Resolve the mount base path for a devframe's SPA. Hosted adapters
4
- * (`vite`, `kit`, `embedded`) default to `/__<id>/` so they don't
5
- * collide with the host app; standalone adapters (`cli`, `spa`,
6
- * `build`) default to `/` because they own the origin.
4
+ * (`vite`, `embedded`) default to `/__<id>/` so they don't collide
5
+ * with the host app; standalone adapters (`cli`, `spa`, `build`)
6
+ * default to `/` because they own the origin.
7
7
  *
8
8
  * The devframe author can override with `basePath` on the definition.
9
9
  */
@@ -1,4 +1,4 @@
1
- import { r as DevframeDefinition } from "../devframe-DulcIxwu.mjs";
1
+ import { r as DevframeDefinition } from "../devframe-R5Ex5K5L.mjs";
2
2
 
3
3
  //#region src/adapters/build.d.ts
4
4
  interface CreateBuildOptions {
@@ -1,11 +1,11 @@
1
1
  import { n as strictJsonStringify } from "../serialization-CwO31axa.mjs";
2
- import { i as structuredCloneStringify } from "../structured-clone-DcDc2Dds.mjs";
3
- import { t as colors } from "../colors-Bl4W18Mh.mjs";
4
- import { t as createHostContext } from "../context-DUibxhrR.mjs";
2
+ import { i as structuredCloneStringify } from "../structured-clone-CD2l4fI3.mjs";
3
+ import { t as colors } from "../colors-DS7k8ljB.mjs";
4
+ import { t as createHostContext } from "../context-BBi2IQDm.mjs";
5
5
  import { t as createH3DevToolsHost } from "../host-h3-Dz8YnFgu.mjs";
6
6
  import { DEVTOOLS_CONNECTION_META_FILENAME, DEVTOOLS_RPC_DUMP_DIRNAME, DEVTOOLS_RPC_DUMP_MANIFEST_FILENAME } from "../constants.mjs";
7
- import { t as collectStaticRpcDump } from "../static-dump-D7AvjrgL.mjs";
8
- import { n as resolveBasePath } from "../_shared-DcJX9-Az.mjs";
7
+ import { t as collectStaticRpcDump } from "../static-dump-C67bCuse.mjs";
8
+ import { n as resolveBasePath } from "../_shared-BrKv3CYt.mjs";
9
9
  import { existsSync } from "node:fs";
10
10
  import process from "node:process";
11
11
  import { dirname, resolve } from "pathe";
@@ -1,5 +1,5 @@
1
- import { _t as InferCliFlags, gt as CliFlagsSchema, r as DevframeDefinition, vt as defineCliFlags, yt as parseCliFlags } from "../devframe-DulcIxwu.mjs";
2
- import { App } from "h3";
1
+ import { ct as CliFlagsSchema, dt as parseCliFlags, lt as InferCliFlags, r as DevframeDefinition, ut as defineCliFlags } from "../devframe-R5Ex5K5L.mjs";
2
+ import { H3 } from "h3";
3
3
  import { CAC } from "cac";
4
4
 
5
5
  //#region src/adapters/cli.d.ts
@@ -19,7 +19,7 @@ interface CreateCliOptions {
19
19
  onReady?: (info: {
20
20
  origin: string;
21
21
  port: number;
22
- app: App;
22
+ app: H3;
23
23
  }) => void | Promise<void>;
24
24
  }
25
25
  interface CliHandle {
@@ -1,6 +1,6 @@
1
- import { t as colors } from "../colors-Bl4W18Mh.mjs";
1
+ import { t as colors } from "../colors-DS7k8ljB.mjs";
2
2
  import { createBuild } from "./build.mjs";
3
- import { n as resolveDevServerPort, t as createDevServer } from "../dev-BGpTpYiR.mjs";
3
+ import { n as resolveDevServerPort, t as createDevServer } from "../dev-CewNNE2R.mjs";
4
4
  import process from "node:process";
5
5
  import cac from "cac";
6
6
  import { safeParse } from "valibot";
@@ -1,6 +1,6 @@
1
- import { r as DevframeDefinition } from "../devframe-DulcIxwu.mjs";
2
- import { n as StartedServer } from "../server-zKEDxgqD.mjs";
3
- import { App } from "h3";
1
+ import { r as DevframeDefinition } from "../devframe-R5Ex5K5L.mjs";
2
+ import { n as StartedServer } from "../server-DzKz023G.mjs";
3
+ import { H3 } from "h3";
4
4
 
5
5
  //#region src/adapters/dev.d.ts
6
6
  interface CreateDevServerOptions {
@@ -23,7 +23,7 @@ interface CreateDevServerOptions {
23
23
  * `def.cli?.distDir` is set, the dev server runs in **bridge mode** —
24
24
  * only `__connection.json` and the WS endpoint are mounted; the SPA
25
25
  * is expected to be hosted elsewhere (e.g. by a parent Vite/Nuxt
26
- * dev server via `createVitePlugin({ devMiddleware })`).
26
+ * dev server via `viteDevBridge({ devMiddleware })`).
27
27
  */
28
28
  distDir?: string;
29
29
  /**
@@ -37,7 +37,7 @@ interface CreateDevServerOptions {
37
37
  * middleware (auth, logging, extra static assets) before devframe's
38
38
  * own handlers.
39
39
  */
40
- app?: App;
40
+ app?: H3;
41
41
  /**
42
42
  * Auto-open the browser. When `undefined` the resolution falls
43
43
  * through to `flags.open` (incl. string path) and finally
@@ -52,7 +52,7 @@ interface CreateDevServerOptions {
52
52
  onReady?: (info: {
53
53
  origin: string;
54
54
  port: number;
55
- app: App;
55
+ app: H3;
56
56
  }) => void | Promise<void>;
57
57
  }
58
58
  interface ResolveDevServerPortOptions {
@@ -78,7 +78,7 @@ declare function resolveDevServerPort(def: DevframeDefinition, options?: Resolve
78
78
  * server runs in **bridge mode**: only `__connection.json` and the WS
79
79
  * endpoint are mounted, with no SPA mount. The SPA is expected to be
80
80
  * hosted elsewhere (e.g. by a parent Vite/Nuxt dev server) — see
81
- * `createVitePlugin({ devMiddleware })`.
81
+ * `viteDevBridge({ devMiddleware })`.
82
82
  *
83
83
  * Returns the underlying {@link StartedServer} handle so callers can
84
84
  * close it gracefully (SIGINT, hot-reload, test teardown).
@@ -1,2 +1,2 @@
1
- import { n as resolveDevServerPort, t as createDevServer } from "../dev-BGpTpYiR.mjs";
1
+ import { n as resolveDevServerPort, t as createDevServer } from "../dev-CewNNE2R.mjs";
2
2
  export { createDevServer, resolveDevServerPort };
@@ -1,4 +1,4 @@
1
- import { r as DevframeDefinition, y as DevToolsNodeContext } from "../devframe-DulcIxwu.mjs";
1
+ import { d as DevToolsNodeContext, r as DevframeDefinition } from "../devframe-R5Ex5K5L.mjs";
2
2
 
3
3
  //#region src/adapters/embedded.d.ts
4
4
  interface CreateEmbeddedOptions {
@@ -1,4 +1,4 @@
1
- import { r as DevframeDefinition } from "../devframe-DulcIxwu.mjs";
1
+ import { r as DevframeDefinition } from "../devframe-R5Ex5K5L.mjs";
2
2
  import { Server } from "@modelcontextprotocol/sdk/server/index.js";
3
3
 
4
4
  //#region src/node/mcp/build-server.d.ts
@@ -1,5 +1,5 @@
1
- import { n as logger } from "../diagnostics-BFhNNmST.mjs";
2
- import { t as createHostContext } from "../context-DUibxhrR.mjs";
1
+ import { n as logger } from "../diagnostics-Cg9ycFIM.mjs";
2
+ import { t as createHostContext } from "../context-BBi2IQDm.mjs";
3
3
  import { homedir } from "node:os";
4
4
  import process from "node:process";
5
5
  import { join } from "pathe";
@@ -1,4 +1,4 @@
1
- import { M as StreamReader, N as StreamSink, Q as DevToolsRpcServerFunctions, Z as DevToolsRpcClientFunctions, _ as ConnectionMeta, pt as EventEmitter, w as RpcSharedStateHost } from "../devframe-DulcIxwu.mjs";
1
+ import { T as StreamSink, U as DevToolsRpcClientFunctions, W as DevToolsRpcServerFunctions, at as EventEmitter, g as RpcSharedStateHost, l as ConnectionMeta, w as StreamReader } from "../devframe-R5Ex5K5L.mjs";
2
2
  import { m as RpcCacheOptions, p as RpcCacheManager } from "../index-DB2Ie0Or.mjs";
3
3
  import { S as RpcFunctionsCollector } from "../types-4rdUEi2R.mjs";
4
4
  import { t as WsRpcChannelOptions } from "../ws-client-Bavoya6-.mjs";
@@ -133,7 +133,5 @@ declare function getDevToolsRpcClient(options?: DevToolsRpcClientOptions): Promi
133
133
  //#endregion
134
134
  //#region src/client/index.d.ts
135
135
  declare const connectDevframe: typeof getDevToolsRpcClient;
136
- /** @deprecated Use `connectDevframe`. */
137
- declare function connectDevtool(...args: Parameters<typeof getDevToolsRpcClient>): ReturnType<typeof getDevToolsRpcClient>;
138
136
  //#endregion
139
- export { DevToolsClientRpcHost, DevToolsRpcClient, DevToolsRpcClientCall, DevToolsRpcClientCallEvent, DevToolsRpcClientCallOptional, DevToolsRpcClientMode, DevToolsRpcClientOptions, DevToolsRpcContext, RpcClientEvents, RpcStreamingClientHost, StreamingSubscribeOptions, connectDevframe, connectDevtool, createRpcStreamingClientHost, getDevToolsRpcClient };
137
+ export { DevToolsClientRpcHost, DevToolsRpcClient, DevToolsRpcClientCall, DevToolsRpcClientCallEvent, DevToolsRpcClientCallOptional, DevToolsRpcClientMode, DevToolsRpcClientOptions, DevToolsRpcContext, RpcClientEvents, RpcStreamingClientHost, StreamingSubscribeOptions, connectDevframe, createRpcStreamingClientHost, getDevToolsRpcClient };
@@ -1,10 +1,10 @@
1
- import { t as hash } from "../hash-BHZbo80D.mjs";
2
- import { l as RpcCacheManager, o as RpcFunctionsCollectorBase } from "../rpc-CkZuoz-m.mjs";
1
+ import { t as hash } from "../hash-CIBte1yS.mjs";
2
+ import { l as RpcCacheManager, o as RpcFunctionsCollectorBase } from "../rpc-DAzoVCR0.mjs";
3
3
  import { createRpcClient } from "../rpc/client.mjs";
4
- import { t as structuredCloneDeserialize } from "../structured-clone-DcDc2Dds.mjs";
4
+ import { t as structuredCloneDeserialize } from "../structured-clone-CD2l4fI3.mjs";
5
5
  import { createWsRpcChannel } from "../rpc/transports/ws-client.mjs";
6
6
  import { createEventEmitter } from "../utils/events.mjs";
7
- import { t as createSharedState } from "../shared-state-DCDs0e7y.mjs";
7
+ import { t as createSharedState } from "../shared-state-q9-1EOSX.mjs";
8
8
  import { createStreamReader, createStreamSink } from "../utils/streaming-channel.mjs";
9
9
  import { DEVTOOLS_CONNECTION_META_FILENAME, DEVTOOLS_RPC_DUMP_MANIFEST_FILENAME } from "../constants.mjs";
10
10
  import { t as humanId } from "../human-id-adtUWQLr.mjs";
@@ -277,7 +277,7 @@ function createRpcStreamingClientHost(rpc) {
277
277
  };
278
278
  }
279
279
  //#endregion
280
- //#region ../../../node_modules/.pnpm/ua-parser-modern@0.1.1/node_modules/ua-parser-modern/dist/index.mjs
280
+ //#region ../../node_modules/.pnpm/ua-parser-modern@0.1.1/node_modules/ua-parser-modern/dist/index.mjs
281
281
  const EMPTY = "";
282
282
  const UNKNOWN = "?";
283
283
  const MAJOR = "major";
@@ -1500,7 +1500,7 @@ function createWsRpcClientMode(options) {
1500
1500
  let clear = () => {};
1501
1501
  await Promise.race([trustedPromise.promise.then(clear), new Promise((resolve, reject) => {
1502
1502
  const id = setTimeout(() => {
1503
- reject(/* @__PURE__ */ new Error("[Vite DevTools] Timeout waiting for rpc to be trusted"));
1503
+ reject(/* @__PURE__ */ new Error("[devframe] Timeout waiting for rpc to be trusted"));
1504
1504
  }, timeout);
1505
1505
  clear = () => clearTimeout(id);
1506
1506
  })]);
@@ -1660,14 +1660,5 @@ async function getDevToolsRpcClient(options = {}) {
1660
1660
  //#endregion
1661
1661
  //#region src/client/index.ts
1662
1662
  const connectDevframe = getDevToolsRpcClient;
1663
- let warnedConnectDevtool = false;
1664
- /** @deprecated Use `connectDevframe`. */
1665
- function connectDevtool(...args) {
1666
- if (!warnedConnectDevtool) {
1667
- warnedConnectDevtool = true;
1668
- console.warn("[devframe] `connectDevtool` is deprecated; use `connectDevframe` instead.");
1669
- }
1670
- return getDevToolsRpcClient(...args);
1671
- }
1672
1663
  //#endregion
1673
- export { connectDevframe, connectDevtool, createRpcStreamingClientHost, getDevToolsRpcClient };
1664
+ export { connectDevframe, createRpcStreamingClientHost, getDevToolsRpcClient };
@@ -0,0 +1,123 @@
1
+ import { r as __toESM, t as __commonJSMin } from "./chunk-e9Ob2GDo.mjs";
2
+ //#endregion
3
+ //#region ../../node_modules/.pnpm/ansis@4.3.0/node_modules/ansis/index.mjs
4
+ var import_ansis = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
5
+ let e, r, { defineProperty: t, setPrototypeOf: n, create: l, keys: o } = Object, i = "", { round: s, max: f } = Math, u = (e) => {
6
+ let r = /([a-f\d]{3,6})/i.exec(e)?.[1], t = r?.length, n = parseInt(6 ^ t ? 3 ^ t ? "0" : r[0] + r[0] + r[1] + r[1] + r[2] + r[2] : r, 16);
7
+ return [
8
+ n >> 16 & 255,
9
+ n >> 8 & 255,
10
+ 255 & n
11
+ ];
12
+ }, a = (e, r, t) => e ^ r || r ^ t ? 16 + 36 * s(e / 51) + 6 * s(r / 51) + s(t / 51) : 8 > e ? 16 : e > 248 ? 231 : s(24 * (e - 8) / 247) + 232, c = (e) => {
13
+ let r, t, n, l, o;
14
+ return 8 > e ? 30 + e : 16 > e ? 82 + e : (232 > e ? (o = (e -= 16) % 36, r = (e / 36 | 0) / 5, t = (o / 6 | 0) / 5, n = o % 6 / 5) : r = t = n = (10 * (e - 232) + 8) / 255, l = 2 * f(r, t, n), l ? 30 + (s(n) << 2 | s(t) << 1 | s(r)) + (2 ^ l ? 0 : 60) : 30);
15
+ }, g = {
16
+ open: i,
17
+ close: i
18
+ }, b = 39, d = 49, p = {}, $ = ({ p: e }, { open: t = "", close: l = "", f: o }) => {
19
+ let s = (e, ...r) => {
20
+ if (!e) {
21
+ if (t && t === l) return t;
22
+ if ((e ?? i) === i) return i;
23
+ }
24
+ let n, f = s.p, u = f.o, a = f.c, c = o ? o(e, ...r) : e.raw ? String.raw({ raw: e }, ...r) : i + e;
25
+ if (c.includes("\x1B")) for (; f; f = f.p) {
26
+ let { t: e, l: r } = f, t = r.length, l = i, o = 0;
27
+ if (t) for (; ~(n = c.indexOf(r, o)); o = n + t) l += c.slice(o, n) + e;
28
+ c = l + c.slice(o);
29
+ }
30
+ return u + (c.includes("\n") ? c.replace(/(\r?\n)/g, a + "$1" + u) : c) + a;
31
+ }, f = t, u = l;
32
+ return e && (f = e.o + t, u = l + e.c), n(s, r), s.p = {
33
+ t,
34
+ l,
35
+ o: s.open = f,
36
+ c: s.close = u,
37
+ p: e
38
+ }, s;
39
+ };
40
+ const h = new function s(f = globalThis) {
41
+ let h, y, m = "number" == typeof f ? f : ((r) => {
42
+ let t = r.process ?? {}, n = t.argv ?? [], l = t.env ?? {}, i = 0;
43
+ try {
44
+ i = ((r, t, n) => (e = t.TERM, {
45
+ "24bit": 3,
46
+ truecolor: 3,
47
+ ansi256: 2,
48
+ ansi: 1
49
+ }[t.COLORTERM] || (t.CI ? /,GITHUB/.test(n) ? 3 : 1 : (t.PM2_HOME || /edge/.test(t.NEXT_RUNTIME) || r.stdout?.isTTY) && "dumb" !== e ? "win32" === r.platform ? 3 : /-256/.test(e) ? 2 : 1 : 0)))(t, l, "," + o(l).join(","));
50
+ } catch (e) {
51
+ l = {};
52
+ }
53
+ let s, f = i || 1, u = "FORCE_COLOR", a = {
54
+ false: 0,
55
+ 0: 0,
56
+ 1: 1,
57
+ 2: 2,
58
+ 3: 3
59
+ }[l[u]] ?? f, c = -1;
60
+ for (s of n) /^--color=?(true|always)?$/.test(s) && (c = f), /^--(no-color|color=(false|never))$/.test(s) && (c = 0);
61
+ return r.window?.chrome ? 3 : u in l ? a : ~c ? c : l.NO_COLOR ? 0 : i;
62
+ })(f), w = {
63
+ Ansis: s,
64
+ level: m,
65
+ isSupported: () => v,
66
+ strip: (e) => e.replace(/[›][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, i),
67
+ extend(e) {
68
+ for (let r in e) {
69
+ let t = e[r], n = (typeof t)[0];
70
+ "s" === n && (O(B(r), I(...u(t))), t = H(...u(t))), O(r, t, "f" === n);
71
+ }
72
+ return n(w, r = l({}, p)), w;
73
+ }
74
+ }, O = (e, r, n) => {
75
+ p[e] = { get() {
76
+ let l = n ? (...e) => $(this, r(...e)) : $(this, r);
77
+ return t(this, e, { value: l }), l;
78
+ } };
79
+ }, v = m > 0, _ = (e, r) => v ? {
80
+ open: `[${e}m`,
81
+ close: `[${r}m`
82
+ } : g, k = (e) => (r) => e(...u(r)), x = (e, r) => (t, n, l) => _(`${e}8;2;${t};${n};${l}`, r), R = (e) => (r, t, n) => e(a(r, t, n)), A = (e, r) => (t, n, l) => _(c(a(t, n, l)) + e, r), B = (e) => "bg" + e[0].toUpperCase() + e.slice(1), C = "Bright", H = x(3, b), I = x(4, d), P = (e) => _("38;5;" + e, b), S = (e) => _("48;5;" + e, d);
83
+ return 2 === m ? (H = R(P), I = R(S)) : 1 === m && (H = A(0, b), I = A(10, d), P = (e) => _(c(e), b), S = (e) => _(c(e) + 10, d)), y = {
84
+ fg: P,
85
+ bg: S,
86
+ rgb: H,
87
+ bgRgb: I,
88
+ hex: k(H),
89
+ bgHex: k(I),
90
+ visible: g,
91
+ reset: _(0, 0),
92
+ bold: _(1, 22),
93
+ dim: _(2, 22),
94
+ italic: _(3, 23),
95
+ underline: _(4, 24),
96
+ inverse: _(7, 27),
97
+ hidden: _(8, 28),
98
+ strikethrough: _(9, 29),
99
+ link: { f: (e, r = e) => v ? `]8;;${e}${r}]8;;` : r != e ? `${r} (​${e}​)` : e }
100
+ }, "gray,black,red,green,yellow,blue,magenta,cyan,white".split(",").map(((e, r) => {
101
+ h = B(e), r ? (y[e + C] = _(89 + r, b), y[h + C] = _(99 + r, d)) : r = 61, y[e] = _(29 + r, b), y[h] = _(39 + r, d);
102
+ })), w.extend(y);
103
+ }();
104
+ module.exports = h.default = h;
105
+ })))(), 1);
106
+ var ansis_default = import_ansis.default;
107
+ const { Ansis, fg, bg, rgb, bgRgb, hex, bgHex, reset, inverse, hidden, visible, link, bold, dim, italic, underline, strikethrough, black, red, green, yellow, blue, magenta, cyan, white, gray, redBright, greenBright, yellowBright, blueBright, magentaBright, cyanBright, whiteBright, bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite, bgGray, bgRedBright, bgGreenBright, bgYellowBright, bgBlueBright, bgMagentaBright, bgCyanBright, bgWhiteBright } = import_ansis.default;
108
+ //#endregion
109
+ //#region src/utils/colors.ts
110
+ const colors = {
111
+ blue: ansis_default.blue,
112
+ cyan: ansis_default.cyan,
113
+ gray: ansis_default.gray,
114
+ green: ansis_default.green,
115
+ red: ansis_default.red,
116
+ yellow: ansis_default.yellow,
117
+ bold: ansis_default.bold,
118
+ dim: ansis_default.dim,
119
+ reset: ansis_default.reset,
120
+ underline: ansis_default.underline
121
+ };
122
+ //#endregion
123
+ export { colors as t };
@@ -1,10 +1,10 @@
1
- import { o as RpcFunctionsCollectorBase } from "./rpc-CkZuoz-m.mjs";
1
+ import { o as RpcFunctionsCollectorBase } from "./rpc-DAzoVCR0.mjs";
2
2
  import { r as diagnostics } from "./serialization-CwO31axa.mjs";
3
3
  import { defineRpcFunction } from "./index.mjs";
4
- import { t as colors$1 } from "./colors-Bl4W18Mh.mjs";
5
- import { n as logger, t as diagnostics$1 } from "./diagnostics-BFhNNmST.mjs";
4
+ import { t as colors$1 } from "./colors-DS7k8ljB.mjs";
5
+ import { n as logger, t as diagnostics$1 } from "./diagnostics-Cg9ycFIM.mjs";
6
6
  import { createEventEmitter } from "./utils/events.mjs";
7
- import { t as createSharedState } from "./shared-state-DCDs0e7y.mjs";
7
+ import { t as createSharedState } from "./shared-state-q9-1EOSX.mjs";
8
8
  import { createStreamReader, createStreamSink } from "./utils/streaming-channel.mjs";
9
9
  import { consoleReporter, createLogger, defineDiagnostics } from "logs-sdk";
10
10
  import { ansiFormatter } from "logs-sdk/formatters/ansi";
@@ -212,7 +212,7 @@ var DevToolsDiagnosticsHost = class {
212
212
  }
213
213
  };
214
214
  //#endregion
215
- //#region ../../../node_modules/.pnpm/obug@2.1.1/node_modules/obug/dist/core.js
215
+ //#region ../../node_modules/.pnpm/obug@2.1.1/node_modules/obug/dist/core.js
216
216
  function coerce(value) {
217
217
  if (value instanceof Error) return value.stack || value.message;
218
218
  return value;
@@ -325,7 +325,7 @@ function enabled(name) {
325
325
  return false;
326
326
  }
327
327
  //#endregion
328
- //#region ../../../node_modules/.pnpm/obug@2.1.1/node_modules/obug/dist/node.js
328
+ //#region ../../node_modules/.pnpm/obug@2.1.1/node_modules/obug/dist/node.js
329
329
  const colors = process.stderr.getColorDepth && process.stderr.getColorDepth() > 2 ? [
330
330
  20,
331
331
  21,
@@ -999,13 +999,12 @@ const BUILTIN_AGENT_RPC = [
999
999
  //#endregion
1000
1000
  //#region src/node/context.ts
1001
1001
  /**
1002
- * Framework-neutral core of the DevTools node context. Wires the RPC
1003
- * host, view (HTTP file-serving) host, diagnostics, and agent
1004
- * subsystems. Hub-level subsystems (`docks`, `terminals`, `messages`,
1005
- * `commands`, `createJsonRenderer`) are owned by
1006
- * `@vitejs/devtools-kit` its `createKitContext` wraps this and
1007
- * attaches them when the devframe is mounted into a multi-integration
1008
- * hub.
1002
+ * Framework- and build-tool-agnostic core of the DevTools node context.
1003
+ * Wires the RPC host, view (HTTP file-serving) host, diagnostics, and
1004
+ * agent subsystems. Host adapters can wrap this to augment `ctx` with
1005
+ * extra surfaces for example, `@vitejs/devtools-kit`'s
1006
+ * `createKitContext` attaches `docks`, `terminals`, `messages`,
1007
+ * `commands`, and `createJsonRenderer` when mounted into Vite DevTools.
1009
1008
  */
1010
1009
  async function createHostContext(options) {
1011
1010
  const { cwd, workspaceRoot = cwd, mode, host, builtinRpcDeclarations = [] } = options;
@@ -1,4 +1,4 @@
1
- import { H as SharedState, y as DevToolsNodeContext } from "./devframe-DulcIxwu.mjs";
1
+ import { P as SharedState, d as DevToolsNodeContext } from "./devframe-R5Ex5K5L.mjs";
2
2
 
3
3
  //#region src/node/internal/context.d.ts
4
4
  interface InternalAnonymousAuthStorage {
@@ -1,16 +1,16 @@
1
- import { t as createHostContext } from "./context-DUibxhrR.mjs";
1
+ import { t as createHostContext } from "./context-BBi2IQDm.mjs";
2
2
  import { t as createH3DevToolsHost } from "./host-h3-Dz8YnFgu.mjs";
3
- import { t as startHttpAndWs } from "./server-ma8-ZVyX.mjs";
3
+ import { t as startHttpAndWs } from "./server-DOk4grlJ.mjs";
4
4
  import { DEVTOOLS_CONNECTION_META_FILENAME } from "./constants.mjs";
5
- import { n as resolveBasePath, t as normalizeBasePath } from "./_shared-DcJX9-Az.mjs";
6
- import { t as open } from "./open-DmFp0qZA.mjs";
7
- import { serveStaticHandler } from "./utils/serve-static.mjs";
5
+ import { n as resolveBasePath, t as normalizeBasePath } from "./_shared-BrKv3CYt.mjs";
6
+ import { t as open } from "./open-B2ah1IKK.mjs";
7
+ import { mountStaticHandler } from "./utils/serve-static.mjs";
8
8
  import { networkInterfaces } from "node:os";
9
9
  import process$1 from "node:process";
10
10
  import { resolve } from "pathe";
11
- import { createApp, eventHandler } from "h3";
11
+ import { H3 } from "h3";
12
12
  import { createServer } from "node:net";
13
- //#region ../../../node_modules/.pnpm/get-port-please@3.2.0/node_modules/get-port-please/dist/index.mjs
13
+ //#region ../../node_modules/.pnpm/get-port-please@3.2.0/node_modules/get-port-please/dist/index.mjs
14
14
  const unsafePorts = /* @__PURE__ */ new Set([
15
15
  1,
16
16
  7,
@@ -254,7 +254,7 @@ async function resolveDevServerPort(def, options = {}) {
254
254
  * server runs in **bridge mode**: only `__connection.json` and the WS
255
255
  * endpoint are mounted, with no SPA mount. The SPA is expected to be
256
256
  * hosted elsewhere (e.g. by a parent Vite/Nuxt dev server) — see
257
- * `createVitePlugin({ devMiddleware })`.
257
+ * `viteDevBridge({ devMiddleware })`.
258
258
  *
259
259
  * Returns the underlying {@link StartedServer} handle so callers can
260
260
  * close it gracefully (SIGINT, hot-reload, test teardown).
@@ -269,12 +269,12 @@ async function createDevServer(def, options = {}) {
269
269
  const port = options.port ?? await resolveDevServerPort(def, { host });
270
270
  const flags = options.flags ?? {};
271
271
  const basePath = options.basePath ? normalizeBasePath(options.basePath) : resolveBasePath(def, "standalone");
272
- const app = options.app ?? createApp();
272
+ const app = options.app ?? new H3();
273
273
  const h3Host = createH3DevToolsHost({
274
274
  origin: `http://${host}:${port}`,
275
275
  appName: def.id,
276
276
  mount: (base, dir) => {
277
- app.use(base, serveStaticHandler(dir));
277
+ mountStaticHandler(app, base, dir);
278
278
  }
279
279
  });
280
280
  const ctx = await createHostContext({
@@ -285,14 +285,11 @@ async function createDevServer(def, options = {}) {
285
285
  const setupInfo = { flags };
286
286
  await def.setup(ctx, setupInfo);
287
287
  const connectionMetaPath = `${basePath}${DEVTOOLS_CONNECTION_META_FILENAME}`;
288
- app.use(connectionMetaPath, eventHandler((event) => {
289
- event.node.res.setHeader("Content-Type", "application/json");
290
- return event.node.res.end(JSON.stringify({
291
- backend: "websocket",
292
- websocket: port
293
- }));
288
+ app.use(connectionMetaPath, () => ({
289
+ backend: "websocket",
290
+ websocket: port
294
291
  }));
295
- if (distDir) app.use(basePath, serveStaticHandler(resolve(distDir)));
292
+ if (distDir) mountStaticHandler(app, basePath, resolve(distDir));
296
293
  return startHttpAndWs({
297
294
  context: ctx,
298
295
  host,
@@ -866,11 +866,11 @@ interface DevToolsCapabilities {
866
866
  views?: boolean;
867
867
  }
868
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.
869
+ * Framework- and build-tool-agnostic node context — RPC + diagnostics +
870
+ * agent + the view-host (HTTP file-serving). Host adapters can wrap this
871
+ * to add their own surfaces; for example, `@vitejs/devtools-kit`'s
872
+ * `createKitContext` adds `docks`, `terminals`, `messages`, and
873
+ * `commands` when mounted into Vite DevTools.
874
874
  */
875
875
  interface DevToolsNodeContext {
876
876
  readonly workspaceRoot: string;
@@ -924,11 +924,11 @@ interface ConnectionMeta {
924
924
  }
925
925
  //#endregion
926
926
  //#region src/types/devframe.d.ts
927
- type DevframeRuntime = 'cli' | 'build' | 'spa' | 'vite' | 'kit' | 'embedded';
927
+ type DevframeRuntime = 'cli' | 'build' | 'spa' | 'vite' | 'embedded';
928
928
  /**
929
929
  * Classification of how a devframe is being deployed. Hosted adapters
930
- * (`vite`, `kit`, `embedded`) share their origin with a host app and
931
- * must namespace their mount path under `/__<id>/`. Standalone adapters
930
+ * (`vite`, `embedded`) share their origin with a host app and must
931
+ * namespace their mount path under `/__<id>/`. Standalone adapters
932
932
  * (`cli`, `spa`, `build`) own the origin and default to `/`.
933
933
  */
934
934
  type DevframeDeploymentKind = 'standalone' | 'hosted';
@@ -1030,7 +1030,7 @@ interface DevframeDefinition {
1030
1030
  /**
1031
1031
  * Mount path override. Defaults depend on the adapter:
1032
1032
  * `/` for standalone (`cli` / `spa` / `build`), `/__<id>/` for hosted
1033
- * (`vite` / `kit` / `embedded`).
1033
+ * (`vite` / `embedded`).
1034
1034
  */
1035
1035
  basePath?: string;
1036
1036
  capabilities?: {
@@ -1046,21 +1046,5 @@ interface DevframeDefinition {
1046
1046
  spa?: DevframeSpaOptions;
1047
1047
  }
1048
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;
1065
1049
  //#endregion
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 };
1050
+ export { AgentResourceContent 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, DevToolsDiagnosticsHost as J, DevToolsHost as K, SharedStatePatch as L, ImmutableObject as M, ImmutableSet as N, createStreamSink as O, SharedState as P, AgentResource as Q, createSharedState as R, CreateStreamSinkOptions as S, StreamSink as T, DevToolsRpcClientFunctions as U, PartialWithoutId as V, DevToolsRpcServerFunctions as W, AgentHandle as X, DevToolsDiagnosticsLogger as Y, AgentManifest as Z, RpcStreamingChannel as _, DevframeRuntime as a, EventEmitter as at, BufferedChunk as b, defineDevframe as c, CliFlagsSchema as ct, DevToolsNodeContext as d, parseCliFlags as dt, AgentResourceInput as et, DevToolsNodeRpcSession as f, RpcSharedStateHost as g, RpcSharedStateGetOptions as h, DevframeDeploymentKind as i, DevToolsAgentHostEvents as it, ImmutableMap as j, Immutable as k, ConnectionMeta as l, InferCliFlags as lt, RpcFunctionsHost as m, DevframeCliOptions as n, AgentToolInput as nt, DevframeSetupInfo as o, EventUnsubscribe as ot, RpcBroadcastOptions as p, DevToolsDiagnosticsDefinition as q, DevframeDefinition as r, DevToolsAgentHost as rt, DevframeSpaOptions as s, EventsMap as st, DevframeBrowserContext as t, AgentTool as tt, DevToolsCapabilities as u, defineCliFlags as ut, RpcStreamingChannelOptions as v, StreamReader as w, CreateStreamReaderOptions as x, RpcStreamingHost as y, DevToolsViewHost as z };
@@ -1,4 +1,4 @@
1
- import { t as colors } from "./colors-Bl4W18Mh.mjs";
1
+ import { t as colors } from "./colors-DS7k8ljB.mjs";
2
2
  import { consoleReporter, createLogger, defineDiagnostics } from "logs-sdk";
3
3
  import { ansiFormatter } from "logs-sdk/formatters/ansi";
4
4
  //#region src/node/diagnostics.ts
@@ -42,7 +42,7 @@ const diagnostics = defineDiagnostics({
42
42
  },
43
43
  DF0033: {
44
44
  message: (p) => `Failed to start dev RPC bridge for "${p.id}": ${p.reason}`,
45
- hint: "Verify the bridge port is free and the devframe setup function does not throw. Pin a port via `cli.port` / `cli.portRange` on the definition, or via `devMiddleware.port` on `createVitePlugin`.",
45
+ hint: "Verify the bridge port is free and the devframe setup function does not throw. Pin a port via `cli.port` / `cli.portRange` on the definition, or via `devMiddleware.port` on `viteDevBridge`.",
46
46
  level: "warn"
47
47
  }
48
48
  }