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
@@ -7,7 +7,7 @@ import { fileURLToPath } from "node:url";
7
7
  import childProcess, { execFile } from "node:child_process";
8
8
  import fs$1, { constants } from "node:fs/promises";
9
9
  import { Buffer } from "node:buffer";
10
- //#region ../../../node_modules/.pnpm/is-docker@3.0.0/node_modules/is-docker/index.js
10
+ //#region ../../node_modules/.pnpm/is-docker@3.0.0/node_modules/is-docker/index.js
11
11
  let isDockerCached;
12
12
  function hasDockerEnv() {
13
13
  try {
@@ -29,7 +29,7 @@ function isDocker() {
29
29
  return isDockerCached;
30
30
  }
31
31
  //#endregion
32
- //#region ../../../node_modules/.pnpm/is-inside-container@1.0.0/node_modules/is-inside-container/index.js
32
+ //#region ../../node_modules/.pnpm/is-inside-container@1.0.0/node_modules/is-inside-container/index.js
33
33
  let cachedResult;
34
34
  const hasContainerEnv = () => {
35
35
  try {
@@ -44,7 +44,7 @@ function isInsideContainer() {
44
44
  return cachedResult;
45
45
  }
46
46
  //#endregion
47
- //#region ../../../node_modules/.pnpm/is-wsl@3.1.0/node_modules/is-wsl/index.js
47
+ //#region ../../node_modules/.pnpm/is-wsl@3.1.1/node_modules/is-wsl/index.js
48
48
  const isWsl = () => {
49
49
  if (process.platform !== "linux") return false;
50
50
  if (os.release().toLowerCase().includes("microsoft")) {
@@ -52,14 +52,14 @@ const isWsl = () => {
52
52
  return true;
53
53
  }
54
54
  try {
55
- return fs.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft") ? !isInsideContainer() : false;
56
- } catch {
57
- return false;
58
- }
55
+ if (fs.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft")) return !isInsideContainer();
56
+ } catch {}
57
+ if (fs.existsSync("/proc/sys/fs/binfmt_misc/WSLInterop") || fs.existsSync("/run/WSL")) return !isInsideContainer();
58
+ return false;
59
59
  };
60
60
  var is_wsl_default = process.env.__IS_WSL_TEST__ ? isWsl : isWsl();
61
61
  //#endregion
62
- //#region ../../../node_modules/.pnpm/powershell-utils@0.1.0/node_modules/powershell-utils/index.js
62
+ //#region ../../node_modules/.pnpm/powershell-utils@0.1.0/node_modules/powershell-utils/index.js
63
63
  const execFile$2 = promisify(childProcess.execFile);
64
64
  const powerShellPath$1 = () => `${process.env.SYSTEMROOT || process.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
65
65
  const executePowerShell = async (command, options = {}) => {
@@ -80,7 +80,7 @@ executePowerShell.argumentsPrefix = [
80
80
  executePowerShell.encodeCommand = (command) => Buffer.from(command, "utf16le").toString("base64");
81
81
  executePowerShell.escapeArgument = (value) => `'${String(value).replaceAll("'", "''")}'`;
82
82
  //#endregion
83
- //#region ../../../node_modules/.pnpm/wsl-utils@0.3.1/node_modules/wsl-utils/utilities.js
83
+ //#region ../../node_modules/.pnpm/wsl-utils@0.3.1/node_modules/wsl-utils/utilities.js
84
84
  function parseMountPointFromConfig(content) {
85
85
  for (const line of content.split("\n")) {
86
86
  if (/^\s*#/.test(line)) continue;
@@ -90,7 +90,7 @@ function parseMountPointFromConfig(content) {
90
90
  }
91
91
  }
92
92
  //#endregion
93
- //#region ../../../node_modules/.pnpm/wsl-utils@0.3.1/node_modules/wsl-utils/index.js
93
+ //#region ../../node_modules/.pnpm/wsl-utils@0.3.1/node_modules/wsl-utils/index.js
94
94
  const execFile$1 = promisify(childProcess.execFile);
95
95
  const wslDrivesMountPoint = (() => {
96
96
  const defaultMountPoint = "/mnt/";
@@ -143,7 +143,7 @@ const convertWslPathToWindows = async (path) => {
143
143
  }
144
144
  };
145
145
  //#endregion
146
- //#region ../../../node_modules/.pnpm/define-lazy-prop@3.0.0/node_modules/define-lazy-prop/index.js
146
+ //#region ../../node_modules/.pnpm/define-lazy-prop@3.0.0/node_modules/define-lazy-prop/index.js
147
147
  function defineLazyProperty(object, propertyName, valueGetter) {
148
148
  const define = (value) => Object.defineProperty(object, propertyName, {
149
149
  value,
@@ -165,7 +165,7 @@ function defineLazyProperty(object, propertyName, valueGetter) {
165
165
  return object;
166
166
  }
167
167
  //#endregion
168
- //#region ../../../node_modules/.pnpm/default-browser-id@5.0.1/node_modules/default-browser-id/index.js
168
+ //#region ../../node_modules/.pnpm/default-browser-id@5.0.1/node_modules/default-browser-id/index.js
169
169
  const execFileAsync$3 = promisify(execFile);
170
170
  async function defaultBrowserId() {
171
171
  if (process.platform !== "darwin") throw new Error("macOS only");
@@ -179,7 +179,7 @@ async function defaultBrowserId() {
179
179
  return browserId;
180
180
  }
181
181
  //#endregion
182
- //#region ../../../node_modules/.pnpm/run-applescript@7.1.0/node_modules/run-applescript/index.js
182
+ //#region ../../node_modules/.pnpm/run-applescript@7.1.0/node_modules/run-applescript/index.js
183
183
  const execFileAsync$2 = promisify(execFile);
184
184
  async function runAppleScript(script, { humanReadableOutput = true, signal } = {}) {
185
185
  if (process.platform !== "darwin") throw new Error("macOS only");
@@ -194,12 +194,12 @@ async function runAppleScript(script, { humanReadableOutput = true, signal } = {
194
194
  return stdout.trim();
195
195
  }
196
196
  //#endregion
197
- //#region ../../../node_modules/.pnpm/bundle-name@4.1.0/node_modules/bundle-name/index.js
197
+ //#region ../../node_modules/.pnpm/bundle-name@4.1.0/node_modules/bundle-name/index.js
198
198
  async function bundleName(bundleId) {
199
199
  return runAppleScript(`tell application "Finder" to set app_path to application file id "${bundleId}" as string\ntell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`);
200
200
  }
201
201
  //#endregion
202
- //#region ../../../node_modules/.pnpm/default-browser@5.4.0/node_modules/default-browser/windows.js
202
+ //#region ../../node_modules/.pnpm/default-browser@5.5.0/node_modules/default-browser/windows.js
203
203
  const execFileAsync$1 = promisify(execFile);
204
204
  const windowsBrowserProgIds = {
205
205
  MSEdgeHTM: {
@@ -279,12 +279,17 @@ async function defaultBrowser$1(_execFileAsync = execFileAsync$1) {
279
279
  const match = /ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(stdout);
280
280
  if (!match) throw new UnknownBrowserError(`Cannot find Windows browser in stdout: ${JSON.stringify(stdout)}`);
281
281
  const { id } = match.groups;
282
- const browser = windowsBrowserProgIds[id];
283
- if (!browser) throw new UnknownBrowserError(`Unknown browser ID: ${id}`);
284
- return browser;
282
+ const dotIndex = id.lastIndexOf(".");
283
+ const hyphenIndex = id.lastIndexOf("-");
284
+ const baseIdByDot = dotIndex === -1 ? void 0 : id.slice(0, dotIndex);
285
+ const baseIdByHyphen = hyphenIndex === -1 ? void 0 : id.slice(0, hyphenIndex);
286
+ return windowsBrowserProgIds[id] ?? windowsBrowserProgIds[baseIdByDot] ?? windowsBrowserProgIds[baseIdByHyphen] ?? {
287
+ name: id,
288
+ id
289
+ };
285
290
  }
286
291
  //#endregion
287
- //#region ../../../node_modules/.pnpm/default-browser@5.4.0/node_modules/default-browser/index.js
292
+ //#region ../../node_modules/.pnpm/default-browser@5.5.0/node_modules/default-browser/index.js
288
293
  const execFileAsync = promisify(execFile);
289
294
  const titleize = (string) => string.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x) => x.toUpperCase());
290
295
  async function defaultBrowser() {
@@ -311,10 +316,10 @@ async function defaultBrowser() {
311
316
  throw new Error("Only macOS, Linux, and Windows are supported");
312
317
  }
313
318
  //#endregion
314
- //#region ../../../node_modules/.pnpm/is-in-ssh@1.0.0/node_modules/is-in-ssh/index.js
319
+ //#region ../../node_modules/.pnpm/is-in-ssh@1.0.0/node_modules/is-in-ssh/index.js
315
320
  const isInSsh = Boolean(process.env.SSH_CONNECTION || process.env.SSH_CLIENT || process.env.SSH_TTY);
316
321
  //#endregion
317
- //#region ../../../node_modules/.pnpm/open@11.0.0/node_modules/open/index.js
322
+ //#region ../../node_modules/.pnpm/open@11.0.0/node_modules/open/index.js
318
323
  const fallbackAttemptSymbol = Symbol("fallbackAttempt");
319
324
  const __dirname = import.meta.url ? path.dirname(fileURLToPath(import.meta.url)) : "";
320
325
  const localXdgOpenPath = path.join(__dirname, "xdg-open");
@@ -1,6 +1,6 @@
1
1
  import { n as defineRpcFunction } from "../define-CW9gLnyG.mjs";
2
- import { t as launchEditor } from "../launch-editor-KA_21J1T.mjs";
3
- import { t as open } from "../open-DmFp0qZA.mjs";
2
+ import { t as launchEditor } from "../launch-editor-CX_n_0SS.mjs";
3
+ import { t as open } from "../open-B2ah1IKK.mjs";
4
4
  import * as v from "valibot";
5
5
  //#region src/recipes/open-helpers.ts
6
6
  /**
@@ -1,4 +1,4 @@
1
- import { a as validateDefinitions, c as getRpcResolvedSetupResult, i as validateDefinition, l as RpcCacheManager, n as dumpFunctions, o as RpcFunctionsCollectorBase, r as getDefinitionsWithDumps, s as getRpcHandler, t as createClientFromDump } from "../rpc-CkZuoz-m.mjs";
1
+ import { a as validateDefinitions, c as getRpcResolvedSetupResult, i as validateDefinition, l as RpcCacheManager, n as dumpFunctions, o as RpcFunctionsCollectorBase, r as getDefinitionsWithDumps, s as getRpcHandler, t as createClientFromDump } from "../rpc-DAzoVCR0.mjs";
2
2
  import { n as strictJsonStringify, t as STRUCTURED_CLONE_PREFIX } from "../serialization-CwO31axa.mjs";
3
3
  import { n as defineRpcFunction, t as createDefineWrapperWithContext } from "../define-CW9gLnyG.mjs";
4
4
  export { RpcCacheManager, RpcFunctionsCollectorBase, STRUCTURED_CLONE_PREFIX, createClientFromDump, createDefineWrapperWithContext, defineRpcFunction, dumpFunctions, getDefinitionsWithDumps, getRpcHandler, getRpcResolvedSetupResult, strictJsonStringify, validateDefinition, validateDefinitions };
@@ -1,5 +1,5 @@
1
1
  import { n as strictJsonStringify } from "../../serialization-CwO31axa.mjs";
2
- import { i as structuredCloneStringify, n as structuredCloneParse } from "../../structured-clone-DcDc2Dds.mjs";
2
+ import { i as structuredCloneStringify, n as structuredCloneParse } from "../../structured-clone-CD2l4fI3.mjs";
3
3
  //#region src/rpc/transports/ws-client.ts
4
4
  function NOOP() {}
5
5
  const EMPTY_DEFS = /* @__PURE__ */ new Map();
@@ -1,5 +1,5 @@
1
1
  import { n as strictJsonStringify } from "../../serialization-CwO31axa.mjs";
2
- import { i as structuredCloneStringify, n as structuredCloneParse } from "../../structured-clone-DcDc2Dds.mjs";
2
+ import { i as structuredCloneStringify, n as structuredCloneParse } from "../../structured-clone-CD2l4fI3.mjs";
3
3
  import { createServer } from "node:https";
4
4
  import { WebSocketServer } from "ws";
5
5
  //#region src/rpc/transports/ws-server.ts
@@ -1,4 +1,4 @@
1
- import { t as hash } from "./hash-BHZbo80D.mjs";
1
+ import { t as hash } from "./hash-CIBte1yS.mjs";
2
2
  import { i as logger } from "./serialization-CwO31axa.mjs";
3
3
  //#region src/rpc/cache.ts
4
4
  /**
@@ -129,7 +129,7 @@ function assertAgentJsonSerializable(fn) {
129
129
  if (fn.agent && fn.jsonSerializable !== true) throw logger.DF0019({ name: fn.name }).throw();
130
130
  }
131
131
  //#endregion
132
- //#region ../../../node_modules/.pnpm/yocto-queue@1.2.2/node_modules/yocto-queue/index.js
132
+ //#region ../../node_modules/.pnpm/yocto-queue@1.2.2/node_modules/yocto-queue/index.js
133
133
  var Node = class {
134
134
  value;
135
135
  next;
@@ -187,7 +187,7 @@ var Queue = class {
187
187
  }
188
188
  };
189
189
  //#endregion
190
- //#region ../../../node_modules/.pnpm/p-limit@7.3.0/node_modules/p-limit/index.js
190
+ //#region ../../node_modules/.pnpm/p-limit@7.3.0/node_modules/p-limit/index.js
191
191
  function pLimit(concurrency) {
192
192
  let rejectOnClear = false;
193
193
  if (typeof concurrency === "object") ({concurrency, rejectOnClear = false} = concurrency);
@@ -3,7 +3,7 @@ import { attachWsRpcTransport } from "./rpc/transports/ws-server.mjs";
3
3
  import { WebSocketServer } from "ws";
4
4
  import { AsyncLocalStorage } from "node:async_hooks";
5
5
  import { createServer } from "node:http";
6
- import { createApp, toNodeListener } from "h3";
6
+ import { H3, toNodeHandler } from "h3";
7
7
  //#region src/node/server.ts
8
8
  /**
9
9
  * Compose an h3 + WebSocket server for a devframe context. The RPC
@@ -13,8 +13,8 @@ import { createApp, toNodeListener } from "h3";
13
13
  async function startHttpAndWs(options) {
14
14
  const { context, port } = options;
15
15
  const bindHost = options.host ?? "localhost";
16
- const app = options.app ?? createApp();
17
- const httpServer = createServer(toNodeListener(app));
16
+ const app = options.app ?? new H3();
17
+ const httpServer = createServer(toNodeHandler(app));
18
18
  const wss = new WebSocketServer({ server: httpServer });
19
19
  const rpcHost = context.rpc;
20
20
  const asyncStorage = new AsyncLocalStorage();
@@ -1,7 +1,7 @@
1
- import { Q as DevToolsRpcServerFunctions, Z as DevToolsRpcClientFunctions, y as DevToolsNodeContext } from "./devframe-DulcIxwu.mjs";
1
+ import { U as DevToolsRpcClientFunctions, W as DevToolsRpcServerFunctions, d as DevToolsNodeContext } from "./devframe-R5Ex5K5L.mjs";
2
2
  import { BirpcGroup } from "birpc";
3
3
  import { WebSocketServer } from "ws";
4
- import { App } from "h3";
4
+ import { H3 } from "h3";
5
5
 
6
6
  //#region src/node/server.d.ts
7
7
  interface StartHttpAndWsOptions {
@@ -13,7 +13,7 @@ interface StartHttpAndWsOptions {
13
13
  * when provided, callers can add their own routes (static handlers,
14
14
  * auth middleware, etc.) first.
15
15
  */
16
- app?: App;
16
+ app?: H3;
17
17
  /**
18
18
  * When `false`, the RPC server is started without a trust handshake.
19
19
  * Intended for single-user localhost tools where an auth round-trip
@@ -33,14 +33,14 @@ interface StartHttpAndWsOptions {
33
33
  onReady?: (info: {
34
34
  origin: string;
35
35
  port: number;
36
- app: App;
36
+ app: H3;
37
37
  }) => void | Promise<void>;
38
38
  }
39
39
  interface StartedServer {
40
40
  /** Listening origin, e.g. `http://localhost:9999`. */
41
41
  origin: string;
42
42
  port: number;
43
- app: App;
43
+ app: H3;
44
44
  wss: WebSocketServer;
45
45
  rpcGroup: BirpcGroup<DevToolsRpcClientFunctions, DevToolsRpcServerFunctions, false>;
46
46
  close: () => Promise<void>;
@@ -1,6 +1,6 @@
1
1
  import { createEventEmitter } from "./utils/events.mjs";
2
2
  import { nanoid } from "./utils/nanoid.mjs";
3
- //#region ../../../node_modules/.pnpm/immer@11.1.8/node_modules/immer/dist/immer.mjs
3
+ //#region ../../node_modules/.pnpm/immer@11.1.8/node_modules/immer/dist/immer.mjs
4
4
  var NOTHING = Symbol.for("immer-nothing");
5
5
  var DRAFTABLE = Symbol.for("immer-draftable");
6
6
  var DRAFT_STATE = Symbol.for("immer-state");
@@ -1,4 +1,4 @@
1
- import { n as dumpFunctions, s as getRpcHandler } from "./rpc-CkZuoz-m.mjs";
1
+ import { n as dumpFunctions, s as getRpcHandler } from "./rpc-DAzoVCR0.mjs";
2
2
  import { DEVTOOLS_RPC_DUMP_DIRNAME } from "./constants.mjs";
3
3
  //#region src/node/static-dump.ts
4
4
  function makeDumpKey(name) {
@@ -1,8 +1,8 @@
1
- import { n as logger } from "./diagnostics-BFhNNmST.mjs";
2
- import { t as createSharedState } from "./shared-state-DCDs0e7y.mjs";
1
+ import { n as logger } from "./diagnostics-Cg9ycFIM.mjs";
2
+ import { t as createSharedState } from "./shared-state-q9-1EOSX.mjs";
3
3
  import fs from "node:fs";
4
4
  import { dirname } from "pathe";
5
- //#region ../../../node_modules/.pnpm/perfect-debounce@2.1.0/node_modules/perfect-debounce/dist/index.mjs
5
+ //#region ../../node_modules/.pnpm/perfect-debounce@2.1.0/node_modules/perfect-debounce/dist/index.mjs
6
6
  const DEBOUNCE_DEFAULTS = { trailing: true };
7
7
  /**
8
8
  Debounce functions
@@ -1,4 +1,4 @@
1
- //#region ../../../node_modules/.pnpm/structured-clone-es@2.0.0/node_modules/structured-clone-es/dist/index.mjs
1
+ //#region ../../node_modules/.pnpm/structured-clone-es@2.0.0/node_modules/structured-clone-es/dist/index.mjs
2
2
  const env = typeof self === "object" ? self : globalThis;
3
3
  function deserializer($, _) {
4
4
  const as = (out, index) => {
@@ -1,4 +1,4 @@
1
- import { $ as DevToolsRpcSharedStates, C as RpcSharedStateGetOptions, D as RpcStreamingHost, E as RpcStreamingChannelOptions, J as EntriesToObject, Q as DevToolsRpcServerFunctions, S as RpcFunctionsHost, T as RpcStreamingChannel, X as Thenable, Y as PartialWithoutId, Z as DevToolsRpcClientFunctions, _ as ConnectionMeta, a as DevframeRuntime, at as AgentManifest, b as DevToolsNodeRpcSession, c as DevtoolBrowserContext, ct as AgentResourceInput, d as DevtoolDeploymentKind, dt as DevToolsAgentHost, et as DevToolsHost, f as DevtoolRuntime, ft as DevToolsAgentHostEvents, g as defineDevtool, h as defineDevframe, ht as EventsMap, i as DevframeDeploymentKind, it as AgentHandle, l as DevtoolCliOptions, lt as AgentTool, m as DevtoolSpaOptions, mt as EventUnsubscribe, n as DevframeCliOptions, nt as DevToolsDiagnosticsHost, o as DevframeSetupInfo, ot as AgentResource, p as DevtoolSetupInfo, pt as EventEmitter, q as DevToolsViewHost, r as DevframeDefinition, rt as DevToolsDiagnosticsLogger, s as DevframeSpaOptions, st as AgentResourceContent, t as DevframeBrowserContext, tt as DevToolsDiagnosticsDefinition, u as DevtoolDefinition, ut as AgentToolInput, v as DevToolsCapabilities, w as RpcSharedStateHost, x as RpcBroadcastOptions, y as DevToolsNodeContext } from "../devframe-DulcIxwu.mjs";
1
+ import { $ as AgentResourceContent, B as EntriesToObject, G as DevToolsRpcSharedStates, H as Thenable, J as DevToolsDiagnosticsHost, K as DevToolsHost, Q as AgentResource, U as DevToolsRpcClientFunctions, V as PartialWithoutId, W as DevToolsRpcServerFunctions, X as AgentHandle, Y as DevToolsDiagnosticsLogger, Z as AgentManifest, _ as RpcStreamingChannel, a as DevframeRuntime, at as EventEmitter, c as defineDevframe, d as DevToolsNodeContext, et as AgentResourceInput, f as DevToolsNodeRpcSession, g as RpcSharedStateHost, h as RpcSharedStateGetOptions, i as DevframeDeploymentKind, it as DevToolsAgentHostEvents, l as ConnectionMeta, m as RpcFunctionsHost, n as DevframeCliOptions, nt as AgentToolInput, o as DevframeSetupInfo, ot as EventUnsubscribe, p as RpcBroadcastOptions, q as DevToolsDiagnosticsDefinition, r as DevframeDefinition, rt as DevToolsAgentHost, s as DevframeSpaOptions, st as EventsMap, t as DevframeBrowserContext, tt as AgentTool, u as DevToolsCapabilities, v as RpcStreamingChannelOptions, y as RpcStreamingHost, z as DevToolsViewHost } from "../devframe-R5Ex5K5L.mjs";
2
2
  import { m as RpcFunctionAgentOptions } from "../types-4rdUEi2R.mjs";
3
3
  import { t as DevToolsNodeRpcSessionMeta } from "../ws-server-DjvlwLuM.mjs";
4
- export { AgentHandle, AgentManifest, AgentResource, AgentResourceContent, AgentResourceInput, AgentTool, AgentToolInput, ConnectionMeta, DevToolsAgentHost, DevToolsAgentHostEvents, DevToolsCapabilities, DevToolsDiagnosticsDefinition, DevToolsDiagnosticsHost, DevToolsDiagnosticsLogger, DevToolsHost, DevToolsNodeContext, DevToolsNodeRpcSession, DevToolsNodeRpcSessionMeta, DevToolsRpcClientFunctions, DevToolsRpcServerFunctions, DevToolsRpcSharedStates, DevToolsViewHost, DevframeBrowserContext, DevframeCliOptions, DevframeDefinition, DevframeDeploymentKind, DevframeRuntime, DevframeSetupInfo, DevframeSpaOptions, DevtoolBrowserContext, DevtoolCliOptions, DevtoolDefinition, DevtoolDeploymentKind, DevtoolRuntime, DevtoolSetupInfo, DevtoolSpaOptions, EntriesToObject, EventEmitter, EventUnsubscribe, EventsMap, PartialWithoutId, RpcBroadcastOptions, RpcFunctionAgentOptions, RpcFunctionsHost, RpcSharedStateGetOptions, RpcSharedStateHost, RpcStreamingChannel, RpcStreamingChannelOptions, RpcStreamingHost, Thenable, defineDevframe, defineDevtool };
4
+ export { AgentHandle, AgentManifest, AgentResource, AgentResourceContent, AgentResourceInput, AgentTool, AgentToolInput, ConnectionMeta, DevToolsAgentHost, DevToolsAgentHostEvents, DevToolsCapabilities, DevToolsDiagnosticsDefinition, DevToolsDiagnosticsHost, DevToolsDiagnosticsLogger, DevToolsHost, DevToolsNodeContext, DevToolsNodeRpcSession, DevToolsNodeRpcSessionMeta, DevToolsRpcClientFunctions, DevToolsRpcServerFunctions, DevToolsRpcSharedStates, DevToolsViewHost, DevframeBrowserContext, DevframeCliOptions, DevframeDefinition, DevframeDeploymentKind, DevframeRuntime, DevframeSetupInfo, DevframeSpaOptions, EntriesToObject, EventEmitter, EventUnsubscribe, EventsMap, PartialWithoutId, RpcBroadcastOptions, RpcFunctionAgentOptions, RpcFunctionsHost, RpcSharedStateGetOptions, RpcSharedStateHost, RpcStreamingChannel, RpcStreamingChannelOptions, RpcStreamingHost, Thenable, defineDevframe };
@@ -2,14 +2,5 @@
2
2
  function defineDevframe(d) {
3
3
  return d;
4
4
  }
5
- let warnedDefineDevtool = false;
6
- /** @deprecated Use `defineDevframe`. */
7
- function defineDevtool(d) {
8
- if (!warnedDefineDevtool) {
9
- warnedDefineDevtool = true;
10
- console.warn("[devframe] `defineDevtool` is deprecated; use `defineDevframe` instead.");
11
- }
12
- return d;
13
- }
14
5
  //#endregion
15
- export { defineDevframe, defineDevtool };
6
+ export { defineDevframe };
@@ -1,2 +1,2 @@
1
- import { t as colors } from "../colors-Bl4W18Mh.mjs";
1
+ import { t as colors } from "../colors-DS7k8ljB.mjs";
2
2
  export { colors };
@@ -1,4 +1,4 @@
1
- import { ht as EventsMap, pt as EventEmitter } from "../devframe-DulcIxwu.mjs";
1
+ import { at as EventEmitter, st as EventsMap } from "../devframe-R5Ex5K5L.mjs";
2
2
 
3
3
  //#region src/utils/events.d.ts
4
4
  /**
@@ -1,2 +1,2 @@
1
- import { t as hash } from "../hash-BHZbo80D.mjs";
1
+ import { t as hash } from "../hash-CIBte1yS.mjs";
2
2
  export { hash };
@@ -1,2 +1,2 @@
1
- import { t as launchEditor } from "../launch-editor-KA_21J1T.mjs";
1
+ import { t as launchEditor } from "../launch-editor-CX_n_0SS.mjs";
2
2
  export { launchEditor };
@@ -1,2 +1,2 @@
1
- import { t as open } from "../open-DmFp0qZA.mjs";
1
+ import { t as open } from "../open-B2ah1IKK.mjs";
2
2
  export { open };
@@ -1,5 +1,5 @@
1
1
  import { IncomingMessage, ServerResponse } from "node:http";
2
- import { EventHandler, EventHandlerRequest } from "h3";
2
+ import { EventHandler, H3 } from "h3";
3
3
 
4
4
  //#region src/utils/serve-static.d.ts
5
5
  interface ServeStaticOptions {
@@ -17,7 +17,17 @@ interface ServeStaticOptions {
17
17
  * file extension falls back to `<dir>/index.html` so client-side routing
18
18
  * works.
19
19
  */
20
- declare function serveStaticHandler(dir: string, options?: ServeStaticOptions): EventHandler<EventHandlerRequest>;
20
+ declare function serveStaticHandler(dir: string, options?: ServeStaticOptions): EventHandler;
21
+ /**
22
+ * Mount {@link serveStaticHandler} on an h3 app at `base`, handling the
23
+ * route pattern and prefix-stripping required by h3 v2.
24
+ *
25
+ * h3 v2's `app.use(base, handler)` only matches the exact `base` path and
26
+ * does not strip the prefix from `event.url.pathname`. Static serving
27
+ * needs both subpath matching (`/base/**`) and the URL stripped so the
28
+ * file resolver sees paths relative to `dir` — this helper bundles both.
29
+ */
30
+ declare function mountStaticHandler(app: H3, base: string, dir: string, options?: ServeStaticOptions): void;
21
31
  /**
22
32
  * Connect/Express-style Node middleware variant of {@link serveStaticHandler}.
23
33
  *
@@ -27,4 +37,4 @@ declare function serveStaticHandler(dir: string, options?: ServeStaticOptions):
27
37
  */
28
38
  declare function serveStaticNodeMiddleware(dir: string, options?: ServeStaticOptions): (req: IncomingMessage, res: ServerResponse, next?: (err?: Error) => void) => void;
29
39
  //#endregion
30
- export { ServeStaticOptions, serveStaticHandler, serveStaticNodeMiddleware };
40
+ export { ServeStaticOptions, mountStaticHandler, serveStaticHandler, serveStaticNodeMiddleware };
@@ -1,7 +1,8 @@
1
1
  import { createReadStream } from "node:fs";
2
2
  import { extname, join, normalize, resolve, sep } from "pathe";
3
- import { defineEventHandler, sendStream, setResponseHeader, setResponseStatus } from "h3";
3
+ import { defineHandler, withBase } from "h3";
4
4
  import { stat } from "node:fs/promises";
5
+ import { Readable } from "node:stream";
5
6
  import { lookup } from "mrmime";
6
7
  //#region src/utils/serve-static.ts
7
8
  const HTML_EXTENSIONS = [".html", ".htm"];
@@ -55,11 +56,16 @@ function contentTypeFor(abs) {
55
56
  if (type === "text/html") return "text/html; charset=utf-8";
56
57
  return type;
57
58
  }
58
- function setStaticHeaders(res, file) {
59
- res.setHeader("Content-Type", contentTypeFor(file.abs));
60
- res.setHeader("Content-Length", file.size);
61
- res.setHeader("Last-Modified", file.mtime.toUTCString());
62
- res.setHeader("Cache-Control", "no-store");
59
+ function staticHeadersFor(file) {
60
+ return {
61
+ "Content-Type": contentTypeFor(file.abs),
62
+ "Content-Length": String(file.size),
63
+ "Last-Modified": file.mtime.toUTCString(),
64
+ "Cache-Control": "no-store"
65
+ };
66
+ }
67
+ function applyStaticHeadersToNode(res, file) {
68
+ for (const [k, v] of Object.entries(staticHeadersFor(file))) res.setHeader(k, v);
63
69
  }
64
70
  function normalizeOptions(options) {
65
71
  return {
@@ -79,27 +85,42 @@ function normalizeOptions(options) {
79
85
  function serveStaticHandler(dir, options) {
80
86
  const absDir = resolve(dir);
81
87
  const opts = normalizeOptions(options);
82
- return defineEventHandler(async (event) => {
83
- const method = event.node.req.method;
88
+ return defineHandler(async (event) => {
89
+ const method = event.req.method;
84
90
  if (method !== "GET" && method !== "HEAD") {
85
- setResponseStatus(event, 405);
86
- setResponseHeader(event, "Allow", "GET, HEAD");
91
+ event.res.status = 405;
92
+ event.res.headers.set("Allow", "GET, HEAD");
87
93
  return "";
88
94
  }
89
- const file = await resolveTarget(absDir, event.node.req.url ?? "/", opts.indexNames, opts.single);
95
+ const file = await resolveTarget(absDir, event.url.pathname, opts.indexNames, opts.single);
90
96
  if (!file) {
91
- setResponseStatus(event, 404);
92
- return "";
93
- }
94
- setStaticHeaders(event.node.res, file);
95
- if (method === "HEAD") {
96
- event.node.res.end();
97
+ event.res.status = 404;
97
98
  return "";
98
99
  }
99
- return sendStream(event, createReadStream(file.abs));
100
+ for (const [k, v] of Object.entries(staticHeadersFor(file))) event.res.headers.set(k, v);
101
+ if (method === "HEAD") return "";
102
+ return Readable.toWeb(createReadStream(file.abs));
100
103
  });
101
104
  }
102
105
  /**
106
+ * Mount {@link serveStaticHandler} on an h3 app at `base`, handling the
107
+ * route pattern and prefix-stripping required by h3 v2.
108
+ *
109
+ * h3 v2's `app.use(base, handler)` only matches the exact `base` path and
110
+ * does not strip the prefix from `event.url.pathname`. Static serving
111
+ * needs both subpath matching (`/base/**`) and the URL stripped so the
112
+ * file resolver sees paths relative to `dir` — this helper bundles both.
113
+ */
114
+ function mountStaticHandler(app, base, dir, options) {
115
+ const trimmed = base.replace(/\/$/, "");
116
+ const handler = serveStaticHandler(dir, options);
117
+ if (trimmed === "") {
118
+ app.use("/**", handler);
119
+ return;
120
+ }
121
+ app.use(`${trimmed}/**`, withBase(trimmed, handler));
122
+ }
123
+ /**
103
124
  * Connect/Express-style Node middleware variant of {@link serveStaticHandler}.
104
125
  *
105
126
  * Use when mounting onto `viteServer.middlewares.use(base, …)` or any other
@@ -132,7 +153,7 @@ function serveStaticNodeMiddleware(dir, options) {
132
153
  res.end();
133
154
  return;
134
155
  }
135
- setStaticHeaders(res, file);
156
+ applyStaticHeadersToNode(res, file);
136
157
  if (method === "HEAD") {
137
158
  res.end();
138
159
  return;
@@ -149,4 +170,4 @@ function serveStaticNodeMiddleware(dir, options) {
149
170
  };
150
171
  }
151
172
  //#endregion
152
- export { serveStaticHandler, serveStaticNodeMiddleware };
173
+ export { mountStaticHandler, serveStaticHandler, serveStaticNodeMiddleware };
@@ -1,2 +1,2 @@
1
- import { B as ImmutableObject, G as SharedStatePatch, H as SharedState, K as createSharedState, L as Immutable, R as ImmutableArray, U as SharedStateEvents, V as ImmutableSet, W as SharedStateOptions, z as ImmutableMap } from "../devframe-DulcIxwu.mjs";
1
+ import { A as ImmutableArray, F as SharedStateEvents, I as SharedStateOptions, L as SharedStatePatch, M as ImmutableObject, N as ImmutableSet, P as SharedState, R as createSharedState, j as ImmutableMap, k as Immutable } from "../devframe-R5Ex5K5L.mjs";
2
2
  export { Immutable, ImmutableArray, ImmutableMap, ImmutableObject, ImmutableSet, SharedState, SharedStateEvents, SharedStateOptions, SharedStatePatch, createSharedState };
@@ -1,2 +1,2 @@
1
- import { t as createSharedState } from "../shared-state-DCDs0e7y.mjs";
1
+ import { t as createSharedState } from "../shared-state-q9-1EOSX.mjs";
2
2
  export { createSharedState };
@@ -1,2 +1,2 @@
1
- import { A as CreateStreamSinkOptions, F as createStreamReader, I as createStreamSink, M as StreamReader, N as StreamSink, O as BufferedChunk, P as StreamSinkEvents, j as StreamErrorPayload, k as CreateStreamReaderOptions } from "../devframe-DulcIxwu.mjs";
1
+ import { C as StreamErrorPayload, D as createStreamReader, E as StreamSinkEvents, O as createStreamSink, S as CreateStreamSinkOptions, T as StreamSink, b as BufferedChunk, w as StreamReader, x as CreateStreamReaderOptions } from "../devframe-R5Ex5K5L.mjs";
2
2
  export { BufferedChunk, CreateStreamReaderOptions, CreateStreamSinkOptions, StreamErrorPayload, StreamReader, StreamSink, StreamSinkEvents, createStreamReader, createStreamSink };
@@ -1,2 +1,2 @@
1
- import { i as structuredCloneStringify, n as structuredCloneParse, r as structuredCloneSerialize, t as structuredCloneDeserialize } from "../structured-clone-DcDc2Dds.mjs";
1
+ import { i as structuredCloneStringify, n as structuredCloneParse, r as structuredCloneSerialize, t as structuredCloneDeserialize } from "../structured-clone-CD2l4fI3.mjs";
2
2
  export { structuredCloneDeserialize, structuredCloneParse, structuredCloneSerialize, structuredCloneStringify };
@@ -1,4 +1,4 @@
1
- //#region ../../../node_modules/.pnpm/whenexpr@0.1.2/node_modules/whenexpr/dist/index.d.mts
1
+ //#region ../../node_modules/.pnpm/whenexpr@0.1.2/node_modules/whenexpr/dist/index.d.mts
2
2
  //#region src/paths.d.ts
3
3
  /**
4
4
  * Union of valid context paths for `T` — both flat keys (`keyof T`) and
@@ -1,4 +1,4 @@
1
- //#region ../../../node_modules/.pnpm/whenexpr@0.1.2/node_modules/whenexpr/dist/index.mjs
1
+ //#region ../../node_modules/.pnpm/whenexpr@0.1.2/node_modules/whenexpr/dist/index.mjs
2
2
  const OPS = [
3
3
  "===",
4
4
  "!==",
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "devframe",
3
3
  "type": "module",
4
- "version": "0.1.22",
4
+ "version": "0.2.0",
5
5
  "description": "Framework for building generic DevTools",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
8
- "homepage": "https://github.com/vitejs/devtools#readme",
8
+ "homepage": "https://github.com/devframes/devframe#readme",
9
9
  "repository": {
10
- "directory": "devframe/packages/devframe",
10
+ "directory": "packages/devframe",
11
11
  "type": "git",
12
- "url": "git+https://github.com/vitejs/devtools.git"
12
+ "url": "git+https://github.com/devframes/devframe.git"
13
13
  },
14
- "bugs": "https://github.com/vitejs/devtools/issues",
14
+ "bugs": "https://github.com/devframes/devframe/issues",
15
15
  "keywords": [
16
16
  "devtools",
17
17
  "rpc",
@@ -25,9 +25,9 @@
25
25
  "./adapters/dev": "./dist/adapters/dev.mjs",
26
26
  "./adapters/embedded": "./dist/adapters/embedded.mjs",
27
27
  "./adapters/mcp": "./dist/adapters/mcp.mjs",
28
- "./adapters/vite": "./dist/adapters/vite.mjs",
29
28
  "./client": "./dist/client/index.mjs",
30
29
  "./constants": "./dist/constants.mjs",
30
+ "./helpers/vite": "./dist/helpers/vite.mjs",
31
31
  "./node": "./dist/node/index.mjs",
32
32
  "./node/auth": "./dist/node/auth.mjs",
33
33
  "./node/internal": "./dist/node/internal.mjs",
@@ -70,7 +70,7 @@
70
70
  "@valibot/to-json-schema": "^1.7.0",
71
71
  "birpc": "^4.0.0",
72
72
  "cac": "^7.0.0",
73
- "h3": "^1.15.11",
73
+ "h3": "2.0.1-rc.22",
74
74
  "logs-sdk": "^0.0.6",
75
75
  "mrmime": "^2.0.1",
76
76
  "pathe": "^2.0.3",
@@ -79,19 +79,26 @@
79
79
  },
80
80
  "devDependencies": {
81
81
  "@modelcontextprotocol/sdk": "^1.29.0",
82
- "ansis": "^4.2.0",
82
+ "ansis": "^4.3.0",
83
+ "get-port-please": "^3.2.0",
84
+ "human-id": "^4.1.3",
83
85
  "immer": "^11.1.8",
84
86
  "launch-editor": "^2.13.2",
87
+ "mlly": "^1.8.2",
88
+ "obug": "^2.1.1",
85
89
  "ohash": "^2.0.11",
86
90
  "open": "^11.0.0",
91
+ "p-limit": "^7.3.0",
92
+ "perfect-debounce": "^2.1.0",
87
93
  "structured-clone-es": "^2.0.0",
88
94
  "tsdown": "^0.22.0",
95
+ "ua-parser-modern": "^0.1.1",
89
96
  "whenexpr": "^0.1.2"
90
97
  },
91
98
  "inlinedDependencies": {
92
- "ansis": "4.2.0",
99
+ "ansis": "4.3.0",
93
100
  "bundle-name": "4.1.0",
94
- "default-browser": "5.4.0",
101
+ "default-browser": "5.5.0",
95
102
  "default-browser-id": "5.0.1",
96
103
  "define-lazy-prop": "3.0.0",
97
104
  "get-port-please": "3.2.0",
@@ -100,7 +107,7 @@
100
107
  "is-docker": "3.0.0",
101
108
  "is-in-ssh": "1.0.0",
102
109
  "is-inside-container": "1.0.0",
103
- "is-wsl": "3.1.0",
110
+ "is-wsl": "3.1.1",
104
111
  "launch-editor": "2.13.2",
105
112
  "obug": "2.1.1",
106
113
  "ohash": "2.0.11",