devframe 0.1.22 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/README.md +20 -77
  2. package/dist/{_shared-DcJX9-Az.mjs → _shared-C_yZKUmx.mjs} +3 -3
  3. package/dist/adapters/build.d.mts +1 -1
  4. package/dist/adapters/build.mjs +5 -6
  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 +2 -2
  11. package/dist/adapters/mcp.mjs +73 -18
  12. package/dist/client/index.d.mts +5 -7
  13. package/dist/client/index.mjs +10 -23
  14. package/dist/colors-DS7k8ljB.mjs +123 -0
  15. package/dist/{context-DBd794Rn.d.mts → context-BaX-SZti.d.mts} +1 -1
  16. package/dist/{dev-BGpTpYiR.mjs → dev-CA0-8Amw.mjs} +14 -18
  17. package/dist/{devframe-DulcIxwu.d.mts → devframe-BXZUBuy6.d.mts} +12 -28
  18. package/dist/{diagnostics-BFhNNmST.mjs → diagnostics-Cg9ycFIM.mjs} +2 -2
  19. package/dist/hash-CIBte1yS.mjs +263 -0
  20. package/dist/{adapters → helpers}/vite.d.mts +7 -8
  21. package/dist/{adapters → helpers}/vite.mjs +8 -9
  22. package/dist/{context-DUibxhrR.mjs → host-h3-CpYkiCIU.mjs} +36 -14
  23. package/dist/{index-DB2Ie0Or.d.mts → index-BO4daMzR.d.mts} +51 -3
  24. package/dist/index.d.mts +4 -4
  25. package/dist/{launch-editor-KA_21J1T.mjs → launch-editor-1dAC7Uk5.mjs} +9 -9
  26. package/dist/node/auth.d.mts +2 -2
  27. package/dist/node/auth.mjs +2 -2
  28. package/dist/node/index.d.mts +12 -44
  29. package/dist/node/index.mjs +4 -6
  30. package/dist/node/internal.d.mts +5 -5
  31. package/dist/node/internal.mjs +4 -4
  32. package/dist/{open-DmFp0qZA.mjs → open-CWL4Zasd.mjs} +26 -21
  33. package/dist/recipes/open-helpers.d.mts +1 -1
  34. package/dist/recipes/open-helpers.mjs +2 -2
  35. package/dist/rpc/index.d.mts +3 -3
  36. package/dist/rpc/index.mjs +2 -2
  37. package/dist/rpc/transports/ws-client.d.mts +1 -1
  38. package/dist/rpc/transports/ws-client.mjs +2 -2
  39. package/dist/rpc/transports/ws-server.d.mts +1 -1
  40. package/dist/rpc/transports/ws-server.mjs +2 -2
  41. package/dist/{rpc-CkZuoz-m.mjs → rpc-BlVCyk9W.mjs} +138 -14
  42. package/dist/{server-zKEDxgqD.d.mts → server-CgqyJG9m.d.mts} +5 -5
  43. package/dist/{server-ma8-ZVyX.mjs → server-G1ymmN3_.mjs} +3 -3
  44. package/dist/{shared-state-DCDs0e7y.mjs → shared-state-q9-1EOSX.mjs} +1 -1
  45. package/dist/{storage-CNC38eU-.mjs → storage-BaLJK6e_.mjs} +3 -3
  46. package/dist/{structured-clone-DcDc2Dds.mjs → structured-clone-CD2l4fI3.mjs} +1 -1
  47. package/dist/{transports-BnCs4rj9.mjs → transports-BLwT342H.mjs} +1 -1
  48. package/dist/types/index.d.mts +4 -4
  49. package/dist/types/index.mjs +1 -10
  50. package/dist/{types-4rdUEi2R.d.mts → types-ip8THGH1.d.mts} +21 -5
  51. package/dist/utils/colors.mjs +1 -1
  52. package/dist/utils/events.d.mts +1 -1
  53. package/dist/utils/hash.mjs +1 -1
  54. package/dist/utils/human-id.mjs +1 -1
  55. package/dist/utils/launch-editor.mjs +1 -1
  56. package/dist/utils/open.mjs +1 -1
  57. package/dist/utils/serve-static.d.mts +13 -3
  58. package/dist/utils/serve-static.mjs +41 -20
  59. package/dist/utils/shared-state.d.mts +1 -1
  60. package/dist/utils/shared-state.mjs +1 -1
  61. package/dist/utils/streaming-channel.d.mts +1 -1
  62. package/dist/utils/structured-clone.mjs +1 -1
  63. package/dist/utils/when.d.mts +1 -1
  64. package/dist/utils/when.mjs +1 -1
  65. package/dist/{ws-client-Bavoya6-.d.mts → ws-client-DFUf-xgm.d.mts} +1 -1
  66. package/dist/{ws-server-DjvlwLuM.d.mts → ws-server-kW8RZXTw.d.mts} +1 -1
  67. package/package.json +18 -11
  68. package/skills/devframe/SKILL.md +24 -21
  69. package/skills/devframe/templates/spa-devframe.ts +2 -2
  70. package/dist/colors-Bl4W18Mh.mjs +0 -123
  71. package/dist/hash-BHZbo80D.mjs +0 -126
  72. package/dist/host-h3-Dz8YnFgu.mjs +0 -24
  73. package/dist/static-dump-D7AvjrgL.mjs +0 -80
  74. /package/dist/{human-id-adtUWQLr.mjs → human-id-mPh1HcFO.mjs} +0 -0
  75. /package/dist/{revoke-DIMz1r7-.mjs → revoke-CWSPBbJH.mjs} +0 -0
@@ -1,16 +1,15 @@
1
- import { t as createHostContext } from "./context-DUibxhrR.mjs";
2
- import { t as createH3DevToolsHost } from "./host-h3-Dz8YnFgu.mjs";
3
- import { t as startHttpAndWs } from "./server-ma8-ZVyX.mjs";
4
1
  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";
2
+ import { n as createHostContext, t as createH3DevToolsHost } from "./host-h3-CpYkiCIU.mjs";
3
+ import { t as startHttpAndWs } from "./server-G1ymmN3_.mjs";
4
+ import { n as resolveBasePath, t as normalizeBasePath } from "./_shared-C_yZKUmx.mjs";
5
+ import { t as open } from "./open-CWL4Zasd.mjs";
6
+ import { mountStaticHandler } from "./utils/serve-static.mjs";
8
7
  import { networkInterfaces } from "node:os";
9
8
  import process$1 from "node:process";
10
9
  import { resolve } from "pathe";
11
- import { createApp, eventHandler } from "h3";
10
+ import { H3 } from "h3";
12
11
  import { createServer } from "node:net";
13
- //#region ../../../node_modules/.pnpm/get-port-please@3.2.0/node_modules/get-port-please/dist/index.mjs
12
+ //#region ../../node_modules/.pnpm/get-port-please@3.2.0/node_modules/get-port-please/dist/index.mjs
14
13
  const unsafePorts = /* @__PURE__ */ new Set([
15
14
  1,
16
15
  7,
@@ -254,7 +253,7 @@ async function resolveDevServerPort(def, options = {}) {
254
253
  * server runs in **bridge mode**: only `__connection.json` and the WS
255
254
  * endpoint are mounted, with no SPA mount. The SPA is expected to be
256
255
  * hosted elsewhere (e.g. by a parent Vite/Nuxt dev server) — see
257
- * `createVitePlugin({ devMiddleware })`.
256
+ * `viteDevBridge({ devMiddleware })`.
258
257
  *
259
258
  * Returns the underlying {@link StartedServer} handle so callers can
260
259
  * close it gracefully (SIGINT, hot-reload, test teardown).
@@ -269,12 +268,12 @@ async function createDevServer(def, options = {}) {
269
268
  const port = options.port ?? await resolveDevServerPort(def, { host });
270
269
  const flags = options.flags ?? {};
271
270
  const basePath = options.basePath ? normalizeBasePath(options.basePath) : resolveBasePath(def, "standalone");
272
- const app = options.app ?? createApp();
271
+ const app = options.app ?? new H3();
273
272
  const h3Host = createH3DevToolsHost({
274
273
  origin: `http://${host}:${port}`,
275
274
  appName: def.id,
276
275
  mount: (base, dir) => {
277
- app.use(base, serveStaticHandler(dir));
276
+ mountStaticHandler(app, base, dir);
278
277
  }
279
278
  });
280
279
  const ctx = await createHostContext({
@@ -285,14 +284,11 @@ async function createDevServer(def, options = {}) {
285
284
  const setupInfo = { flags };
286
285
  await def.setup(ctx, setupInfo);
287
286
  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
- }));
287
+ app.use(connectionMetaPath, () => ({
288
+ backend: "websocket",
289
+ websocket: port
294
290
  }));
295
- if (distDir) app.use(basePath, serveStaticHandler(resolve(distDir)));
291
+ if (distDir) mountStaticHandler(app, basePath, resolve(distDir));
296
292
  return startHttpAndWs({
297
293
  context: ctx,
298
294
  host,
@@ -1,5 +1,5 @@
1
- import { f as RpcFunctionsCollectorBase } from "./index-DB2Ie0Or.mjs";
2
- import { t as DevToolsNodeRpcSessionMeta } from "./ws-server-DjvlwLuM.mjs";
1
+ import { S as RpcFunctionsCollectorBase } from "./index-BO4daMzR.mjs";
2
+ import { t as DevToolsNodeRpcSessionMeta } from "./ws-server-kW8RZXTw.mjs";
3
3
  import { Logger, createLogger, defineDiagnostics } from "logs-sdk";
4
4
  import { BirpcReturn } from "birpc";
5
5
  import { CAC } from "cac";
@@ -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
  }
@@ -0,0 +1,263 @@
1
+ //#region ../../node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/shared/ohash.D__AXeF1.mjs
2
+ function serialize(o) {
3
+ return typeof o == "string" ? `'${o}'` : new c().serialize(o);
4
+ }
5
+ const c = /* @__PURE__ */ function() {
6
+ class o {
7
+ #t = /* @__PURE__ */ new Map();
8
+ compare(t, r) {
9
+ const e = typeof t, n = typeof r;
10
+ return e === "string" && n === "string" ? t.localeCompare(r) : e === "number" && n === "number" ? t - r : String.prototype.localeCompare.call(this.serialize(t, true), this.serialize(r, true));
11
+ }
12
+ serialize(t, r) {
13
+ if (t === null) return "null";
14
+ switch (typeof t) {
15
+ case "string": return r ? t : `'${t}'`;
16
+ case "bigint": return `${t}n`;
17
+ case "object": return this.$object(t);
18
+ case "function": return this.$function(t);
19
+ }
20
+ return String(t);
21
+ }
22
+ serializeObject(t) {
23
+ const r = Object.prototype.toString.call(t);
24
+ if (r !== "[object Object]") return this.serializeBuiltInType(r.length < 10 ? `unknown:${r}` : r.slice(8, -1), t);
25
+ const e = t.constructor, n = e === Object || e === void 0 ? "" : e.name;
26
+ if (n !== "" && globalThis[n] === e) return this.serializeBuiltInType(n, t);
27
+ if (typeof t.toJSON == "function") {
28
+ const i = t.toJSON();
29
+ return n + (i !== null && typeof i == "object" ? this.$object(i) : `(${this.serialize(i)})`);
30
+ }
31
+ return this.serializeObjectEntries(n, Object.entries(t));
32
+ }
33
+ serializeBuiltInType(t, r) {
34
+ const e = this["$" + t];
35
+ if (e) return e.call(this, r);
36
+ if (typeof r?.entries == "function") return this.serializeObjectEntries(t, r.entries());
37
+ throw new Error(`Cannot serialize ${t}`);
38
+ }
39
+ serializeObjectEntries(t, r) {
40
+ const e = Array.from(r).sort((i, a) => this.compare(i[0], a[0]));
41
+ let n = `${t}{`;
42
+ for (let i = 0; i < e.length; i++) {
43
+ const [a, l] = e[i];
44
+ n += `${this.serialize(a, true)}:${this.serialize(l)}`, i < e.length - 1 && (n += ",");
45
+ }
46
+ return n + "}";
47
+ }
48
+ $object(t) {
49
+ let r = this.#t.get(t);
50
+ return r === void 0 && (this.#t.set(t, `#${this.#t.size}`), r = this.serializeObject(t), this.#t.set(t, r)), r;
51
+ }
52
+ $function(t) {
53
+ const r = Function.prototype.toString.call(t);
54
+ return r.slice(-15) === "[native code] }" ? `${t.name || ""}()[native]` : `${t.name}(${t.length})${r.replace(/\s*\n\s*/g, "")}`;
55
+ }
56
+ $Array(t) {
57
+ let r = "[";
58
+ for (let e = 0; e < t.length; e++) r += this.serialize(t[e]), e < t.length - 1 && (r += ",");
59
+ return r + "]";
60
+ }
61
+ $Date(t) {
62
+ try {
63
+ return `Date(${t.toISOString()})`;
64
+ } catch {
65
+ return "Date(null)";
66
+ }
67
+ }
68
+ $ArrayBuffer(t) {
69
+ return `ArrayBuffer[${new Uint8Array(t).join(",")}]`;
70
+ }
71
+ $Set(t) {
72
+ return `Set${this.$Array(Array.from(t).sort((r, e) => this.compare(r, e)))}`;
73
+ }
74
+ $Map(t) {
75
+ return this.serializeObjectEntries("Map", t.entries());
76
+ }
77
+ }
78
+ for (const s of [
79
+ "Error",
80
+ "RegExp",
81
+ "URL"
82
+ ]) o.prototype["$" + s] = function(t) {
83
+ return `${s}(${t})`;
84
+ };
85
+ for (const s of [
86
+ "Int8Array",
87
+ "Uint8Array",
88
+ "Uint8ClampedArray",
89
+ "Int16Array",
90
+ "Uint16Array",
91
+ "Int32Array",
92
+ "Uint32Array",
93
+ "Float32Array",
94
+ "Float64Array"
95
+ ]) o.prototype["$" + s] = function(t) {
96
+ return `${s}[${t.join(",")}]`;
97
+ };
98
+ for (const s of ["BigInt64Array", "BigUint64Array"]) o.prototype["$" + s] = function(t) {
99
+ return `${s}[${t.join("n,")}${t.length > 0 ? "n" : ""}]`;
100
+ };
101
+ return o;
102
+ }();
103
+ //#endregion
104
+ //#region ../../node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/crypto/js/index.mjs
105
+ const z = [
106
+ 1779033703,
107
+ -1150833019,
108
+ 1013904242,
109
+ -1521486534,
110
+ 1359893119,
111
+ -1694144372,
112
+ 528734635,
113
+ 1541459225
114
+ ], R = [
115
+ 1116352408,
116
+ 1899447441,
117
+ -1245643825,
118
+ -373957723,
119
+ 961987163,
120
+ 1508970993,
121
+ -1841331548,
122
+ -1424204075,
123
+ -670586216,
124
+ 310598401,
125
+ 607225278,
126
+ 1426881987,
127
+ 1925078388,
128
+ -2132889090,
129
+ -1680079193,
130
+ -1046744716,
131
+ -459576895,
132
+ -272742522,
133
+ 264347078,
134
+ 604807628,
135
+ 770255983,
136
+ 1249150122,
137
+ 1555081692,
138
+ 1996064986,
139
+ -1740746414,
140
+ -1473132947,
141
+ -1341970488,
142
+ -1084653625,
143
+ -958395405,
144
+ -710438585,
145
+ 113926993,
146
+ 338241895,
147
+ 666307205,
148
+ 773529912,
149
+ 1294757372,
150
+ 1396182291,
151
+ 1695183700,
152
+ 1986661051,
153
+ -2117940946,
154
+ -1838011259,
155
+ -1564481375,
156
+ -1474664885,
157
+ -1035236496,
158
+ -949202525,
159
+ -778901479,
160
+ -694614492,
161
+ -200395387,
162
+ 275423344,
163
+ 430227734,
164
+ 506948616,
165
+ 659060556,
166
+ 883997877,
167
+ 958139571,
168
+ 1322822218,
169
+ 1537002063,
170
+ 1747873779,
171
+ 1955562222,
172
+ 2024104815,
173
+ -2067236844,
174
+ -1933114872,
175
+ -1866530822,
176
+ -1538233109,
177
+ -1090935817,
178
+ -965641998
179
+ ], S = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_", r = [];
180
+ var k = class {
181
+ _data = new l();
182
+ _hash = new l([...z]);
183
+ _nDataBytes = 0;
184
+ _minBufferSize = 0;
185
+ finalize(e) {
186
+ e && this._append(e);
187
+ const s = this._nDataBytes * 8, t = this._data.sigBytes * 8;
188
+ return this._data.words[t >>> 5] |= 128 << 24 - t % 32, this._data.words[(t + 64 >>> 9 << 4) + 14] = Math.floor(s / 4294967296), this._data.words[(t + 64 >>> 9 << 4) + 15] = s, this._data.sigBytes = this._data.words.length * 4, this._process(), this._hash;
189
+ }
190
+ _doProcessBlock(e, s) {
191
+ const t = this._hash.words;
192
+ let i = t[0], o = t[1], a = t[2], c = t[3], h = t[4], g = t[5], f = t[6], y = t[7];
193
+ for (let n = 0; n < 64; n++) {
194
+ if (n < 16) r[n] = e[s + n] | 0;
195
+ else {
196
+ const d = r[n - 15], j = (d << 25 | d >>> 7) ^ (d << 14 | d >>> 18) ^ d >>> 3, B = r[n - 2], x = (B << 15 | B >>> 17) ^ (B << 13 | B >>> 19) ^ B >>> 10;
197
+ r[n] = j + r[n - 7] + x + r[n - 16];
198
+ }
199
+ const m = h & g ^ ~h & f, p = i & o ^ i & a ^ o & a, u = (i << 30 | i >>> 2) ^ (i << 19 | i >>> 13) ^ (i << 10 | i >>> 22), b = (h << 26 | h >>> 6) ^ (h << 21 | h >>> 11) ^ (h << 7 | h >>> 25), w = y + b + m + R[n] + r[n], M = u + p;
200
+ y = f, f = g, g = h, h = c + w | 0, c = a, a = o, o = i, i = w + M | 0;
201
+ }
202
+ t[0] = t[0] + i | 0, t[1] = t[1] + o | 0, t[2] = t[2] + a | 0, t[3] = t[3] + c | 0, t[4] = t[4] + h | 0, t[5] = t[5] + g | 0, t[6] = t[6] + f | 0, t[7] = t[7] + y | 0;
203
+ }
204
+ _append(e) {
205
+ typeof e == "string" && (e = l.fromUtf8(e)), this._data.concat(e), this._nDataBytes += e.sigBytes;
206
+ }
207
+ _process(e) {
208
+ let s, t = this._data.sigBytes / 64;
209
+ e ? t = Math.ceil(t) : t = Math.max((t | 0) - this._minBufferSize, 0);
210
+ const i = t * 16, o = Math.min(i * 4, this._data.sigBytes);
211
+ if (i) {
212
+ for (let a = 0; a < i; a += 16) this._doProcessBlock(this._data.words, a);
213
+ s = this._data.words.splice(0, i), this._data.sigBytes -= o;
214
+ }
215
+ return new l(s, o);
216
+ }
217
+ };
218
+ var l = class l {
219
+ words;
220
+ sigBytes;
221
+ constructor(e, s) {
222
+ e = this.words = e || [], this.sigBytes = s === void 0 ? e.length * 4 : s;
223
+ }
224
+ static fromUtf8(e) {
225
+ const s = unescape(encodeURIComponent(e)), t = s.length, i = [];
226
+ for (let o = 0; o < t; o++) i[o >>> 2] |= (s.charCodeAt(o) & 255) << 24 - o % 4 * 8;
227
+ return new l(i, t);
228
+ }
229
+ toBase64() {
230
+ const e = [];
231
+ for (let s = 0; s < this.sigBytes; s += 3) {
232
+ const t = this.words[s >>> 2] >>> 24 - s % 4 * 8 & 255, i = this.words[s + 1 >>> 2] >>> 24 - (s + 1) % 4 * 8 & 255, o = this.words[s + 2 >>> 2] >>> 24 - (s + 2) % 4 * 8 & 255, a = t << 16 | i << 8 | o;
233
+ for (let c = 0; c < 4 && s * 8 + c * 6 < this.sigBytes * 8; c++) e.push(S.charAt(a >>> 6 * (3 - c) & 63));
234
+ }
235
+ return e.join("");
236
+ }
237
+ concat(e) {
238
+ if (this.words[this.sigBytes >>> 2] &= 4294967295 << 32 - this.sigBytes % 4 * 8, this.words.length = Math.ceil(this.sigBytes / 4), this.sigBytes % 4) for (let s = 0; s < e.sigBytes; s++) {
239
+ const t = e.words[s >>> 2] >>> 24 - s % 4 * 8 & 255;
240
+ this.words[this.sigBytes + s >>> 2] |= t << 24 - (this.sigBytes + s) % 4 * 8;
241
+ }
242
+ else for (let s = 0; s < e.sigBytes; s += 4) this.words[this.sigBytes + s >>> 2] = e.words[s >>> 2];
243
+ this.sigBytes += e.sigBytes;
244
+ }
245
+ };
246
+ function digest(_) {
247
+ return new k().finalize(_).toBase64();
248
+ }
249
+ //#endregion
250
+ //#region ../../node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/index.mjs
251
+ function hash$1(input) {
252
+ return digest(serialize(input));
253
+ }
254
+ //#endregion
255
+ //#region src/utils/hash.ts
256
+ /**
257
+ * Stable, deterministic hash of any structured-cloneable value.
258
+ */
259
+ function hash(value) {
260
+ return hash$1(value);
261
+ }
262
+ //#endregion
263
+ export { hash as t };
@@ -1,7 +1,7 @@
1
- import { r as DevframeDefinition } from "../devframe-DulcIxwu.mjs";
1
+ import { r as DevframeDefinition } from "../devframe-BXZUBuy6.mjs";
2
2
 
3
- //#region src/adapters/vite.d.ts
4
- interface CreateVitePluginOptions {
3
+ //#region src/helpers/vite.d.ts
4
+ interface ViteDevBridgeOptions {
5
5
  /**
6
6
  * Mount base. Defaults to `def.basePath ?? '/__<id>/'` for this hosted
7
7
  * adapter — the devframe shares the origin with the host Vite app.
@@ -43,9 +43,8 @@ interface DevframeVitePlugin {
43
43
  closeBundle?: () => void | Promise<void>;
44
44
  }
45
45
  /**
46
- * Vite plugin for hosting a devframe inside a Vite dev server.
47
- *
48
- * Two modes, picked via `options.devMiddleware`:
46
+ * Bridge a devframe into an existing Vite dev server. Returns a Vite
47
+ * plugin with two modes, picked via `options.devMiddleware`:
49
48
  *
50
49
  * - **static-mount mode** (default) — mounts `def.cli.distDir` at
51
50
  * `options.base` with SPA fallback enabled. No RPC server is started.
@@ -61,6 +60,6 @@ interface DevframeVitePlugin {
61
60
  * (Nuxt, Astro, SolidStart, plain Vite apps). For the all-in-one
62
61
  * `dev` / `build` / `mcp` shell, reach for {@link createCli} instead.
63
62
  */
64
- declare function createVitePlugin(d: DevframeDefinition, options?: CreateVitePluginOptions): DevframeVitePlugin;
63
+ declare function viteDevBridge(d: DevframeDefinition, options?: ViteDevBridgeOptions): DevframeVitePlugin;
65
64
  //#endregion
66
- export { CreateVitePluginOptions, DevframeVitePlugin, createVitePlugin };
65
+ export { DevframeVitePlugin, ViteDevBridgeOptions, viteDevBridge };
@@ -1,14 +1,13 @@
1
- import { n as logger } from "../diagnostics-BFhNNmST.mjs";
2
1
  import { DEVTOOLS_CONNECTION_META_FILENAME } from "../constants.mjs";
3
- import { n as resolveBasePath } from "../_shared-DcJX9-Az.mjs";
2
+ import { n as logger } from "../diagnostics-Cg9ycFIM.mjs";
3
+ import { n as resolveBasePath } from "../_shared-C_yZKUmx.mjs";
4
4
  import { serveStaticNodeMiddleware } from "../utils/serve-static.mjs";
5
- import { n as resolveDevServerPort, t as createDevServer } from "../dev-BGpTpYiR.mjs";
5
+ import { n as resolveDevServerPort, t as createDevServer } from "../dev-CA0-8Amw.mjs";
6
6
  import { resolve } from "pathe";
7
- //#region src/adapters/vite.ts
7
+ //#region src/helpers/vite.ts
8
8
  /**
9
- * Vite plugin for hosting a devframe inside a Vite dev server.
10
- *
11
- * Two modes, picked via `options.devMiddleware`:
9
+ * Bridge a devframe into an existing Vite dev server. Returns a Vite
10
+ * plugin with two modes, picked via `options.devMiddleware`:
12
11
  *
13
12
  * - **static-mount mode** (default) — mounts `def.cli.distDir` at
14
13
  * `options.base` with SPA fallback enabled. No RPC server is started.
@@ -24,7 +23,7 @@ import { resolve } from "pathe";
24
23
  * (Nuxt, Astro, SolidStart, plain Vite apps). For the all-in-one
25
24
  * `dev` / `build` / `mcp` shell, reach for {@link createCli} instead.
26
25
  */
27
- function createVitePlugin(d, options = {}) {
26
+ function viteDevBridge(d, options = {}) {
28
27
  const base = normalizeMountBase(options.base ?? resolveBasePath(d, "hosted"));
29
28
  if (!options.devMiddleware) {
30
29
  const distDir = d.cli?.distDir;
@@ -92,4 +91,4 @@ function normalizeMountBase(base) {
92
91
  return out.replace(/\/+/g, "/");
93
92
  }
94
93
  //#endregion
95
- export { createVitePlugin };
94
+ export { viteDevBridge };
@@ -1,16 +1,19 @@
1
- import { o as RpcFunctionsCollectorBase } from "./rpc-CkZuoz-m.mjs";
1
+ import { l as RpcFunctionsCollectorBase } from "./rpc-BlVCyk9W.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";
11
11
  import { isatty } from "node:tty";
12
12
  import { formatWithOptions, inspect } from "node:util";
13
13
  import { existsSync } from "node:fs";
14
+ import { homedir } from "node:os";
15
+ import process$1 from "node:process";
16
+ import { join } from "pathe";
14
17
  //#region src/node/host-agent.ts
15
18
  /**
16
19
  * Framework-neutral host aggregating the agent-exposed surface of a
@@ -212,7 +215,7 @@ var DevToolsDiagnosticsHost = class {
212
215
  }
213
216
  };
214
217
  //#endregion
215
- //#region ../../../node_modules/.pnpm/obug@2.1.1/node_modules/obug/dist/core.js
218
+ //#region ../../node_modules/.pnpm/obug@2.1.1/node_modules/obug/dist/core.js
216
219
  function coerce(value) {
217
220
  if (value instanceof Error) return value.stack || value.message;
218
221
  return value;
@@ -325,7 +328,7 @@ function enabled(name) {
325
328
  return false;
326
329
  }
327
330
  //#endregion
328
- //#region ../../../node_modules/.pnpm/obug@2.1.1/node_modules/obug/dist/node.js
331
+ //#region ../../node_modules/.pnpm/obug@2.1.1/node_modules/obug/dist/node.js
329
332
  const colors = process.stderr.getColorDepth && process.stderr.getColorDepth() > 2 ? [
330
333
  20,
331
334
  21,
@@ -999,13 +1002,12 @@ const BUILTIN_AGENT_RPC = [
999
1002
  //#endregion
1000
1003
  //#region src/node/context.ts
1001
1004
  /**
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.
1005
+ * Framework- and build-tool-agnostic core of the DevTools node context.
1006
+ * Wires the RPC host, view (HTTP file-serving) host, diagnostics, and
1007
+ * agent subsystems. Host adapters can wrap this to augment `ctx` with
1008
+ * extra surfaces for example, `@vitejs/devtools-kit`'s
1009
+ * `createKitContext` attaches `docks`, `terminals`, `messages`,
1010
+ * `commands`, and `createJsonRenderer` when mounted into Vite DevTools.
1009
1011
  */
1010
1012
  async function createHostContext(options) {
1011
1013
  const { cwd, workspaceRoot = cwd, mode, host, builtinRpcDeclarations = [] } = options;
@@ -1031,4 +1033,24 @@ async function createHostContext(options) {
1031
1033
  return context;
1032
1034
  }
1033
1035
  //#endregion
1034
- export { createRpcSharedStateServerHost as a, createRpcStreamingServerHost as i, DevToolsViewHost as n, DevToolsDiagnosticsHost as o, RpcFunctionsHost as r, DevToolsAgentHost as s, createHostContext as t };
1036
+ //#region src/node/host-h3.ts
1037
+ /**
1038
+ * h3-backed {@link DevToolsHost} — used by the standalone CLI adapter.
1039
+ */
1040
+ function createH3DevToolsHost(options) {
1041
+ const workspaceRoot = options.workspaceRoot ?? process$1.cwd();
1042
+ return {
1043
+ mountStatic(base, distDir) {
1044
+ return options.mount?.(base, distDir);
1045
+ },
1046
+ resolveOrigin() {
1047
+ return options.origin;
1048
+ },
1049
+ getStorageDir(scope) {
1050
+ const namespace = `.${options.appName}/devtools`;
1051
+ return scope === "workspace" ? join(workspaceRoot, "node_modules", namespace) : join(homedir(), namespace);
1052
+ }
1053
+ };
1054
+ }
1055
+ //#endregion
1056
+ export { createRpcStreamingServerHost as a, DevToolsAgentHost as c, RpcFunctionsHost as i, createHostContext as n, createRpcSharedStateServerHost as o, DevToolsViewHost as r, DevToolsDiagnosticsHost as s, createH3DevToolsHost as t };
@@ -1,4 +1,4 @@
1
- import { C as RpcReturnSchema, S as RpcFunctionsCollector, b as RpcFunctionSetupResult, c as RpcDumpClientOptions, g as RpcFunctionDefinitionAny, h as RpcFunctionDefinition, i as RpcArgsSchema, l as RpcDumpCollectionOptions, n as BirpcReturn, o as RpcDefinitionsToFunctions, p as RpcDumpStore, x as RpcFunctionType } from "./types-4rdUEi2R.mjs";
1
+ import { C as RpcFunctionsCollector, S as RpcFunctionType, _ as RpcFunctionDefinitionAny, c as RpcDumpClientOptions, g as RpcFunctionDefinition, i as RpcArgsSchema, l as RpcDumpCollectionOptions, m as RpcDumpStore, n as BirpcReturn, o as RpcDefinitionsToFunctions, p as RpcDumpRecordError, w as RpcReturnSchema, x as RpcFunctionSetupResult } from "./types-ip8THGH1.mjs";
2
2
 
3
3
  //#region src/rpc/cache.d.ts
4
4
  interface RpcCacheOptions {
@@ -47,7 +47,7 @@ declare class RpcFunctionsCollectorBase<LocalFunctions extends Record<string, an
47
47
  declare function defineRpcFunction<NAME extends string, TYPE extends RpcFunctionType, ARGS extends any[], RETURN = void, const AS extends RpcArgsSchema | undefined = undefined, const RS extends RpcReturnSchema | undefined = undefined>(definition: RpcFunctionDefinition<NAME, TYPE, ARGS, RETURN, AS, RS>): RpcFunctionDefinition<NAME, TYPE, ARGS, RETURN, AS, RS>;
48
48
  declare function createDefineWrapperWithContext<CONTEXT>(): <NAME extends string, TYPE extends RpcFunctionType, ARGS extends any[], RETURN = void, const AS extends RpcArgsSchema | undefined = undefined, const RS extends RpcReturnSchema | undefined = undefined>(definition: RpcFunctionDefinition<NAME, TYPE, ARGS, RETURN, AS, RS, CONTEXT>) => RpcFunctionDefinition<NAME, TYPE, ARGS, RETURN, AS, RS, CONTEXT>;
49
49
  //#endregion
50
- //#region src/rpc/dumps.d.ts
50
+ //#region src/rpc/dump/index.d.ts
51
51
  /**
52
52
  * Collects pre-computed dumps by executing functions with their defined input combinations.
53
53
  * Static functions without dump config automatically get `{ inputs: [[]] }`.
@@ -75,6 +75,54 @@ declare function createClientFromDump<T extends Record<string, any>>(store: RpcD
75
75
  */
76
76
  declare function getDefinitionsWithDumps<T extends readonly RpcFunctionDefinitionAny[]>(definitions: T): RpcFunctionDefinitionAny[];
77
77
  //#endregion
78
+ //#region src/rpc/dump/error.d.ts
79
+ /**
80
+ * Normalize a thrown value into a plain object suitable for storage in
81
+ * a dump record. Preserves `message`, `name`, `cause`, and any own
82
+ * enumerable properties of an `Error` so consumers reading the dump can
83
+ * reconstruct a richer Error than just `{ message, name }`.
84
+ *
85
+ * Non-`Error` throws are wrapped as `{ name: 'Error', message: String(thrown) }`.
86
+ */
87
+ declare function serializeDumpError(error: unknown): RpcDumpRecordError;
88
+ /**
89
+ * Inverse of {@link serializeDumpError}: rebuild a thrown `Error` from
90
+ * the plain object stored in a dump record. Preserves `cause`, restores
91
+ * the original `name`, and re-attaches any custom own properties.
92
+ */
93
+ declare function reviveDumpError(stored: RpcDumpRecordError): Error;
94
+ //#endregion
95
+ //#region src/rpc/dump/static.d.ts
96
+ type StaticRpcDumpSerialization = 'json' | 'structured-clone';
97
+ interface StaticRpcDumpManifestStaticEntry {
98
+ type: 'static';
99
+ path: string;
100
+ /** Encoder used when this entry's file was written. Default: `'json'`. */
101
+ serialization?: StaticRpcDumpSerialization;
102
+ }
103
+ interface StaticRpcDumpManifestQueryEntry {
104
+ type: 'query';
105
+ records: Record<string, string>;
106
+ fallback?: string;
107
+ /** Encoder used when each record/fallback file was written. Default: `'json'`. */
108
+ serialization?: StaticRpcDumpSerialization;
109
+ }
110
+ type StaticRpcDumpManifestValue = StaticRpcDumpManifestStaticEntry | StaticRpcDumpManifestQueryEntry | any;
111
+ type StaticRpcDumpManifest = Record<string, StaticRpcDumpManifestValue>;
112
+ interface StaticRpcDumpFile {
113
+ /** Whether this file was written via `JSON.stringify` or `structured-clone-es.stringify`. */
114
+ serialization: StaticRpcDumpSerialization;
115
+ /** Function name the file belongs to — used to scope `DF0019` errors during write. */
116
+ fnName: string;
117
+ /** Payload to encode. */
118
+ data: unknown;
119
+ }
120
+ interface StaticRpcDumpCollection {
121
+ manifest: StaticRpcDumpManifest;
122
+ files: Record<string, StaticRpcDumpFile>;
123
+ }
124
+ declare function collectStaticRpcDump(definitions: Iterable<RpcFunctionDefinitionAny>, context: any): Promise<StaticRpcDumpCollection>;
125
+ //#endregion
78
126
  //#region src/rpc/handler.d.ts
79
127
  declare function getRpcResolvedSetupResult<NAME extends string, TYPE extends RpcFunctionType, ARGS extends any[], RETURN = void, CONTEXT = undefined>(definition: RpcFunctionDefinition<NAME, TYPE, ARGS, RETURN, any, any, CONTEXT>, context: CONTEXT): Promise<RpcFunctionSetupResult<ARGS, RETURN>>;
80
128
  declare function getRpcHandler<NAME extends string, TYPE extends RpcFunctionType, ARGS extends any[], RETURN = void, CONTEXT = undefined>(definition: RpcFunctionDefinition<NAME, TYPE, ARGS, RETURN, any, any, CONTEXT>, context: CONTEXT): Promise<(...args: ARGS) => RETURN>;
@@ -136,4 +184,4 @@ declare function validateDefinitions(definitions: readonly RpcFunctionDefinition
136
184
  */
137
185
  declare function validateDefinition(definition: RpcFunctionDefinitionAny): void;
138
186
  //#endregion
139
- export { getRpcHandler as a, dumpFunctions as c, defineRpcFunction as d, RpcFunctionsCollectorBase as f, strictJsonStringify as i, getDefinitionsWithDumps as l, RpcCacheOptions as m, validateDefinitions as n, getRpcResolvedSetupResult as o, RpcCacheManager as p, STRUCTURED_CLONE_PREFIX as r, createClientFromDump as s, validateDefinition as t, createDefineWrapperWithContext as u };
187
+ export { RpcCacheManager as C, RpcFunctionsCollectorBase as S, createClientFromDump as _, getRpcHandler as a, createDefineWrapperWithContext as b, StaticRpcDumpFile as c, StaticRpcDumpManifestStaticEntry as d, StaticRpcDumpManifestValue as f, serializeDumpError as g, reviveDumpError as h, strictJsonStringify as i, StaticRpcDumpManifest as l, collectStaticRpcDump as m, validateDefinitions as n, getRpcResolvedSetupResult as o, StaticRpcDumpSerialization as p, STRUCTURED_CLONE_PREFIX as r, StaticRpcDumpCollection as s, validateDefinition as t, StaticRpcDumpManifestQueryEntry as u, dumpFunctions as v, RpcCacheOptions as w, defineRpcFunction as x, getDefinitionsWithDumps as y };