@tonyclaw/llm-inspector 1.6.2 → 1.7.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.
package/.output/cli.js CHANGED
@@ -4,44 +4,9 @@
4
4
  import { spawn } from "node:child_process";
5
5
  import { fileURLToPath } from "node:url";
6
6
  import { dirname, join } from "node:path";
7
- import { existsSync } from "node:fs";
8
7
  var __filename = fileURLToPath(import.meta.url);
9
8
  var __dirname = dirname(__filename);
10
9
  var DEFAULT_PORT = 25947;
11
- var findBun = () => {
12
- const pathEnv = process.env.PATH ?? "";
13
- const pathDirs = pathEnv.split(process.platform === "win32" ? ";" : ":");
14
- for (const dir of pathDirs) {
15
- const bunPath2 = join(dir, process.platform === "win32" ? "bun.exe" : "bun");
16
- if (existsSync(bunPath2)) {
17
- if (process.platform === "win32" && !bunPath2.endsWith(".exe")) {
18
- const actualPath = join(dir, "node_modules", "bun", "bin", "bun.exe");
19
- if (existsSync(actualPath)) {
20
- return actualPath;
21
- }
22
- }
23
- return bunPath2;
24
- }
25
- }
26
- if (process.platform === "win32") {
27
- const localAppData = process.env.LOCALAPPDATA ?? "";
28
- const appData = process.env.APPDATA ?? "";
29
- const userProfile = process.env.USERPROFILE ?? "";
30
- const commonPaths = [
31
- join(localAppData, "bun", "bin", "bun.exe"),
32
- join(appData, "bun", "bin", "bun.exe"),
33
- join(userProfile, "AppData", "Local", "bun", "bin", "bun.exe"),
34
- join(userProfile, "AppData", "Roaming", "npm", "node_modules", "bun", "bin", "bun.exe"),
35
- join(userProfile, "AppData", "Roaming", "npm", "bun")
36
- ];
37
- for (const bunPath2 of commonPaths) {
38
- if (existsSync(bunPath2)) {
39
- return bunPath2;
40
- }
41
- }
42
- }
43
- return null;
44
- };
45
10
  var envPort = process.env["PORT"];
46
11
  var portDefault = envPort !== void 0 ? Number(envPort) : DEFAULT_PORT;
47
12
  var args = process.argv.slice(2);
@@ -104,16 +69,11 @@ var openBrowser = (targetUrl) => {
104
69
  if (open) {
105
70
  openBrowser(url);
106
71
  }
107
- var bunPath = findBun();
108
- if (bunPath === null) {
109
- console.error("\nError: bun is not installed or not in PATH.");
110
- console.error("Please install bun from https://bun.sh");
111
- process.exit(1);
112
- }
113
72
  var outputDir = __dirname;
114
73
  var serverPath = join(outputDir, "../.output/server/index.mjs");
115
- var serverProcess = spawn(bunPath, [serverPath], {
74
+ var serverProcess = spawn(process.execPath, [serverPath], {
116
75
  stdio: ["ignore", "inherit", "inherit"],
117
- detached: true
76
+ detached: true,
77
+ env: { ...process.env }
118
78
  });
119
79
  serverProcess.unref();
@@ -1,6 +1,6 @@
1
1
  {
2
- "date": "2026-06-03T07:56:05.905Z",
3
- "preset": "bun",
2
+ "date": "2026-06-03T08:20:50.424Z",
3
+ "preset": "node-server",
4
4
  "framework": {
5
5
  "name": "nitro",
6
6
  "version": ""
@@ -11,7 +11,7 @@
11
11
  "serverEntry": "server/index.mjs",
12
12
  "publicDir": "public",
13
13
  "commands": {
14
- "preview": "bun run ./server/index.mjs"
14
+ "preview": "node ./server/index.mjs"
15
15
  },
16
16
  "config": {}
17
17
  }
@@ -1,6 +1,10 @@
1
1
  import { H as HTTPError, c as toRequest } from "../_libs/h3.mjs";
2
2
  import "../_libs/rou3.mjs";
3
3
  import "../_libs/srvx.mjs";
4
+ import "node:http";
5
+ import "node:stream";
6
+ import "node:https";
7
+ import "node:http2";
4
8
  function fetchViteEnv(viteEnvName, input, init) {
5
9
  const envs = globalThis.__nitro_vite_envs__ || {};
6
10
  const viteEnv = envs[viteEnvName];
@@ -1,5 +1,5 @@
1
1
  import { N as NullProtoObj } from "./rou3.mjs";
2
- import { F as FastURL, a as FastResponse } from "./srvx.mjs";
2
+ import { F as FastURL, N as NodeResponse } from "./srvx.mjs";
3
3
  const kEventNS = "h3.internal.event.";
4
4
  const kEventRes = /* @__PURE__ */ Symbol.for(`${kEventNS}res`);
5
5
  const kEventResHeaders = /* @__PURE__ */ Symbol.for(`${kEventNS}res.headers`);
@@ -162,7 +162,7 @@ var HTTPResponse = class {
162
162
  }
163
163
  };
164
164
  function prepareResponse(val, event, config, nested) {
165
- if (val === kHandled) return new FastResponse(null);
165
+ if (val === kHandled) return new NodeResponse(null);
166
166
  if (val === kNotFound) val = new HTTPError({
167
167
  status: 404,
168
168
  message: `Cannot find any route matching [${event.req.method}] ${event.url}`
@@ -184,7 +184,7 @@ function prepareResponse(val, event, config, nested) {
184
184
  if (!(val instanceof Response)) {
185
185
  const res = prepareResponseBody(val, event, config);
186
186
  const status = res.status || preparedRes?.status;
187
- return new FastResponse(nullBody(event.req.method, status) ? null : res.body, {
187
+ return new NodeResponse(nullBody(event.req.method, status) ? null : res.body, {
188
188
  status,
189
189
  statusText: res.statusText || preparedRes?.statusText,
190
190
  headers: res.headers && preparedHeaders ? mergeHeaders$1(res.headers, preparedHeaders) : res.headers || preparedHeaders
@@ -195,7 +195,7 @@ function prepareResponse(val, event, config, nested) {
195
195
  mergeHeaders$1(val.headers, preparedHeaders, val.headers);
196
196
  return val;
197
197
  } catch {
198
- return new FastResponse(nullBody(event.req.method, val.status) ? null : val.body, {
198
+ return new NodeResponse(nullBody(event.req.method, val.status) ? null : val.body, {
199
199
  status: val.status,
200
200
  statusText: val.statusText,
201
201
  headers: mergeHeaders$1(val.headers, preparedHeaders)
@@ -260,7 +260,7 @@ function nullBody(method, status) {
260
260
  return method === "HEAD" || status === 100 || status === 101 || status === 102 || status === 204 || status === 205 || status === 304;
261
261
  }
262
262
  function errorResponse(error, debug) {
263
- return new FastResponse(JSON.stringify({
263
+ return new NodeResponse(JSON.stringify({
264
264
  ...error.toJSON(),
265
265
  stack: debug && error.stack ? error.stack.split("\n").map((l) => l.trim()) : void 0
266
266
  }, void 0, debug ? 2 : void 0), {
@@ -1,5 +1,5 @@
1
1
  import { N as NullProtoObj } from "./rou3.mjs";
2
- import { F as FastURL, a as FastResponse } from "./srvx.mjs";
2
+ import { F as FastURL, N as NodeResponse } from "./srvx.mjs";
3
3
  const kEventNS = "h3.internal.event.";
4
4
  const kEventRes = /* @__PURE__ */ Symbol.for(`${kEventNS}res`);
5
5
  const kEventResHeaders = /* @__PURE__ */ Symbol.for(`${kEventNS}res.headers`);
@@ -162,7 +162,7 @@ var HTTPResponse = class {
162
162
  }
163
163
  };
164
164
  function prepareResponse(val, event, config, nested) {
165
- if (val === kHandled) return new FastResponse(null);
165
+ if (val === kHandled) return new NodeResponse(null);
166
166
  if (val === kNotFound) val = new HTTPError({
167
167
  status: 404,
168
168
  message: `Cannot find any route matching [${event.req.method}] ${event.url}`
@@ -184,7 +184,7 @@ function prepareResponse(val, event, config, nested) {
184
184
  if (!(val instanceof Response)) {
185
185
  const res = prepareResponseBody(val, event, config);
186
186
  const status = res.status || preparedRes?.status;
187
- return new FastResponse(nullBody(event.req.method, status) ? null : res.body, {
187
+ return new NodeResponse(nullBody(event.req.method, status) ? null : res.body, {
188
188
  status,
189
189
  statusText: res.statusText || preparedRes?.statusText,
190
190
  headers: res.headers && preparedHeaders ? mergeHeaders$1(res.headers, preparedHeaders) : res.headers || preparedHeaders
@@ -195,7 +195,7 @@ function prepareResponse(val, event, config, nested) {
195
195
  mergeHeaders$1(val.headers, preparedHeaders, val.headers);
196
196
  return val;
197
197
  } catch {
198
- return new FastResponse(nullBody(event.req.method, val.status) ? null : val.body, {
198
+ return new NodeResponse(nullBody(event.req.method, val.status) ? null : val.body, {
199
199
  status: val.status,
200
200
  statusText: val.statusText,
201
201
  headers: mergeHeaders$1(val.headers, preparedHeaders)
@@ -260,7 +260,7 @@ function nullBody(method, status) {
260
260
  return method === "HEAD" || status === 100 || status === 101 || status === 102 || status === 204 || status === 205 || status === 304;
261
261
  }
262
262
  function errorResponse(error, debug) {
263
- return new FastResponse(JSON.stringify({
263
+ return new NodeResponse(JSON.stringify({
264
264
  ...error.toJSON(),
265
265
  stack: debug && error.stack ? error.stack.split("\n").map((l) => l.trim()) : void 0
266
266
  }, void 0, debug ? 2 : void 0), {