@tonyclaw/llm-inspector 1.19.1 → 1.19.2
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 +146 -37
- package/.output/nitro.json +1 -1
- package/.output/public/assets/{CompareDrawer-DtERUdIt.js → CompareDrawer-BzTsEelr.js} +1 -1
- package/.output/public/assets/{ProxyViewerContainer-DfxRK7Nt.js → ProxyViewerContainer-BHm-n-_W.js} +9 -9
- package/.output/public/assets/{ReplayDialog-VMsGnJSI.js → ReplayDialog-Dxxo80xO.js} +1 -1
- package/.output/public/assets/{RequestAnatomy-Cx_vluvK.js → RequestAnatomy-D-swiaii.js} +1 -1
- package/.output/public/assets/{ResponseView-5F8Ms5z4.js → ResponseView-DvdH2bGk.js} +1 -1
- package/.output/public/assets/{StreamingChunkSequence-CKDCWfu9.js → StreamingChunkSequence-D_RzgyKq.js} +1 -1
- package/.output/public/assets/_sessionId-DdODJCYY.js +1 -0
- package/.output/public/assets/{index-DeJyypsp.css → index-Bqi9RAGS.css} +1 -1
- package/.output/public/assets/index-EvnsNPOK.js +1 -0
- package/.output/public/assets/{json-viewer-CztuZ9cT.js → json-viewer-DIHZbEId.js} +1 -1
- package/.output/public/assets/{main-CR9IJlz1.js → main-Br2EjrqZ.js} +2 -2
- package/.output/server/{_sessionId-DvWQaDEm.mjs → _sessionId-CPkCxTP8.mjs} +4 -3
- package/.output/server/_ssr/{CompareDrawer-C5FsxSDS.mjs → CompareDrawer-DKHgXC5-.mjs} +4 -4
- package/.output/server/_ssr/{ProxyViewerContainer-v0cvR8f5.mjs → ProxyViewerContainer-B41D-2Eo.mjs} +57 -9
- package/.output/server/_ssr/{ReplayDialog-C3KOv9OW.mjs → ReplayDialog-D2piRWb0.mjs} +5 -5
- package/.output/server/_ssr/{RequestAnatomy-BYRe33eG.mjs → RequestAnatomy-Ce7QdQNP.mjs} +4 -3
- package/.output/server/_ssr/{ResponseView-va7yQDeL.mjs → ResponseView-D50UPv-r.mjs} +5 -5
- package/.output/server/_ssr/{StreamingChunkSequence-BJlI-gWl.mjs → StreamingChunkSequence-CDlNFS3Z.mjs} +4 -4
- package/.output/server/_ssr/{index-CS0fA2GT.mjs → index-DhAQxjnZ.mjs} +4 -3
- package/.output/server/_ssr/index.mjs +2 -2
- package/.output/server/_ssr/{json-viewer-Dg8rqrxL.mjs → json-viewer-BZRjG_f7.mjs} +4 -4
- package/.output/server/_ssr/{router-D_Boe9Bu.mjs → router-yP98-Gq-.mjs} +126 -105
- package/.output/server/{_tanstack-start-manifest_v-KFXyNRGC.mjs → _tanstack-start-manifest_v-d4a4xlOi.mjs} +1 -1
- package/.output/server/index.mjs +65 -65
- package/README.md +22 -0
- package/package.json +3 -1
- package/src/cli/detect-tools.ts +1 -0
- package/src/cli/templates/skill-onboard.ts +6 -6
- package/src/cli.ts +152 -35
- package/src/components/ProxyViewerContainer.tsx +52 -0
- package/src/components/proxy-viewer/LogEntryHeader.tsx +1 -0
- package/src/proxy/logFinalizer.ts +7 -3
- package/src/proxy/sessionProcess.ts +14 -7
- package/src/proxy/sessionSupervisor.ts +3 -2
- package/src/proxy/socketTracker.ts +19 -7
- package/styles/globals.css +14 -7
- package/.output/public/assets/_sessionId-C-aKd1Ky.js +0 -1
- package/.output/public/assets/index-B8ttyigz.js +0 -1
|
@@ -3,7 +3,7 @@ import { writeChunks } from "./chunkStorage";
|
|
|
3
3
|
import { formatForPath } from "./formats";
|
|
4
4
|
import { appendLogEntry, logger } from "./logger";
|
|
5
5
|
import type { CapturedLog } from "./schemas";
|
|
6
|
-
import { getSessionProcess } from "./sessionProcess";
|
|
6
|
+
import { getSessionProcess, isSessionProcessAvailable } from "./sessionProcess";
|
|
7
7
|
import { finalizeLogUpdate } from "./store";
|
|
8
8
|
|
|
9
9
|
type BaseFinalizeLogJob = {
|
|
@@ -209,17 +209,21 @@ export function commitFinalizeLogResult(result: FinalizeLogResult): void {
|
|
|
209
209
|
|
|
210
210
|
// ── Routing ─────────────────────────────────────────────────────
|
|
211
211
|
// FINALIZER_RUNTIME selects the execution backend:
|
|
212
|
-
// "process" → per-session child process (
|
|
212
|
+
// "process" → per-session child process (max isolation)
|
|
213
213
|
// "worker" → shared Worker Thread pool
|
|
214
214
|
// "inline" → synchronous in-process (debug / fallback)
|
|
215
|
+
// The default is "process" only when its worker entry exists. Production
|
|
216
|
+
// bundles that do not emit the standalone worker entry fall back to "inline"
|
|
217
|
+
// instead of repeatedly spawning a failing child process.
|
|
215
218
|
// For backward compatibility, FINALIZER_USE_WORKER=0 forces "inline".
|
|
216
219
|
|
|
217
220
|
const RUNTIME: "process" | "worker" | "inline" = (() => {
|
|
218
221
|
if (process.env["FINALIZER_USE_WORKER"] === "0") return "inline";
|
|
219
222
|
const mode = process.env["FINALIZER_RUNTIME"];
|
|
223
|
+
if (mode === "process") return "process";
|
|
220
224
|
if (mode === "worker") return "worker";
|
|
221
225
|
if (mode === "inline") return "inline";
|
|
222
|
-
return "process";
|
|
226
|
+
return isSessionProcessAvailable() ? "process" : "inline";
|
|
223
227
|
})();
|
|
224
228
|
|
|
225
229
|
function executeBuildInSessionProcess(job: FinalizeLogJob): Promise<FinalizeLogResult> {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { spawn, type ChildProcess } from "node:child_process";
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
2
4
|
import { logger } from "./logger";
|
|
3
5
|
import type { FinalizeLogJob, FinalizeLogResult } from "./logFinalizer";
|
|
4
6
|
|
|
@@ -12,6 +14,14 @@ type PendingJob = {
|
|
|
12
14
|
reject: (err: Error) => void;
|
|
13
15
|
};
|
|
14
16
|
|
|
17
|
+
function resolveSessionWorkerPath(): string {
|
|
18
|
+
return fileURLToPath(new URL("./sessionWorkerEntry.ts", import.meta.url));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function isSessionProcessAvailable(): boolean {
|
|
22
|
+
return existsSync(resolveSessionWorkerPath());
|
|
23
|
+
}
|
|
24
|
+
|
|
15
25
|
export class SessionProcess {
|
|
16
26
|
private child: ChildProcess | null = null;
|
|
17
27
|
private pending = new Map<string, PendingJob>();
|
|
@@ -30,14 +40,11 @@ export class SessionProcess {
|
|
|
30
40
|
private ensureRunning(): ChildProcess {
|
|
31
41
|
if (this.child !== null && this.child.connected) return this.child;
|
|
32
42
|
|
|
33
|
-
const
|
|
34
|
-
// On Windows, the path from URL.pathname starts with "/" which needs to
|
|
35
|
-
// be stripped when it's a drive letter path (e.g. "/C:/..." → "C:/...")
|
|
36
|
-
const resolvedPath =
|
|
37
|
-
process.platform === "win32" && entryPath.startsWith("/") ? entryPath.slice(1) : entryPath;
|
|
43
|
+
const resolvedPath = resolveSessionWorkerPath();
|
|
38
44
|
|
|
39
|
-
this.child =
|
|
45
|
+
this.child = spawn(process.execPath, [...process.execArgv, resolvedPath], {
|
|
40
46
|
stdio: ["pipe", "pipe", "pipe", "ipc"],
|
|
47
|
+
windowsHide: true,
|
|
41
48
|
});
|
|
42
49
|
|
|
43
50
|
this.restartCount += 1;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { CapturedLog } from "./schemas";
|
|
2
|
+
import { isSessionProcessAvailable } from "./sessionProcess";
|
|
2
3
|
|
|
3
4
|
export const PROVIDER_TEST_SESSION_ID = "provider-test";
|
|
4
5
|
|
|
@@ -21,10 +22,10 @@ export type SessionRuntimeMode = "in-process" | "worker-thread" | "child-process
|
|
|
21
22
|
function getRuntimeMode(): SessionRuntimeMode {
|
|
22
23
|
if (process.env["FINALIZER_USE_WORKER"] === "0") return "in-process";
|
|
23
24
|
const mode = process.env["FINALIZER_RUNTIME"];
|
|
25
|
+
if (mode === "process") return "child-process";
|
|
24
26
|
if (mode === "worker") return "worker-thread";
|
|
25
27
|
if (mode === "inline") return "in-process";
|
|
26
|
-
|
|
27
|
-
return "child-process";
|
|
28
|
+
return isSessionProcessAvailable() ? "child-process" : "in-process";
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
export type SessionSnapshot = {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { exec } from "node:child_process";
|
|
1
|
+
import { exec, execFile } from "node:child_process";
|
|
2
2
|
import { promisify } from "node:util";
|
|
3
3
|
import { logger } from "./logger";
|
|
4
4
|
|
|
5
5
|
const execAsync = promisify(exec);
|
|
6
|
+
const execFileAsync = promisify(execFile);
|
|
6
7
|
|
|
7
8
|
type ClientInfo = {
|
|
8
9
|
port: number | null;
|
|
@@ -78,9 +79,15 @@ async function lookupClientInfo(port: number): Promise<ClientInfo> {
|
|
|
78
79
|
` Write-Output "$pid|$cmd"`,
|
|
79
80
|
`}`,
|
|
80
81
|
].join("; ");
|
|
81
|
-
const { stdout } = await
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
const { stdout } = await execFileAsync(
|
|
83
|
+
"powershell.exe",
|
|
84
|
+
["-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-Command", psScript],
|
|
85
|
+
{
|
|
86
|
+
windowsHide: true,
|
|
87
|
+
timeout: 3000,
|
|
88
|
+
maxBuffer: 64 * 1024,
|
|
89
|
+
},
|
|
90
|
+
);
|
|
84
91
|
const trimmed = stdout.trim();
|
|
85
92
|
if (trimmed === "") {
|
|
86
93
|
return { port, pid: null, cwd: null, projectFolder: null };
|
|
@@ -164,9 +171,14 @@ async function lookupProcessInfo(
|
|
|
164
171
|
|
|
165
172
|
try {
|
|
166
173
|
if (platform === "win32") {
|
|
167
|
-
const { stdout } = await
|
|
168
|
-
|
|
169
|
-
{
|
|
174
|
+
const { stdout } = await execFileAsync(
|
|
175
|
+
"wmic.exe",
|
|
176
|
+
["process", "where", `processid=${pid}`, "get", "commandline", "/value"],
|
|
177
|
+
{
|
|
178
|
+
windowsHide: true,
|
|
179
|
+
timeout: 3000,
|
|
180
|
+
maxBuffer: 64 * 1024,
|
|
181
|
+
},
|
|
170
182
|
);
|
|
171
183
|
const lines = stdout.trim().split("\n").filter(Boolean);
|
|
172
184
|
for (const line of lines) {
|
package/styles/globals.css
CHANGED
|
@@ -165,13 +165,20 @@
|
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
-
@media (prefers-reduced-motion: reduce) {
|
|
169
|
-
.animate-crab-piano-pop {
|
|
170
|
-
animation: none !important;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
|
|
168
|
+
@media (prefers-reduced-motion: reduce) {
|
|
169
|
+
.animate-crab-piano-pop {
|
|
170
|
+
animation: none !important;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
[data-deep-link-highlight="true"] {
|
|
175
|
+
background: color-mix(in oklch, var(--chart-2) 18%, transparent);
|
|
176
|
+
box-shadow:
|
|
177
|
+
inset 0 0 0 1px color-mix(in oklch, var(--chart-2) 65%, transparent),
|
|
178
|
+
0 0 0 3px color-mix(in oklch, var(--chart-2) 20%, transparent);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
@layer base {
|
|
175
182
|
* {
|
|
176
183
|
@apply border-border outline-ring/50;
|
|
177
184
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{R as s,j as e}from"./main-CR9IJlz1.js";import{P as i}from"./ProxyViewerContainer-DfxRK7Nt.js";function t(){const{sessionId:o}=s.useParams();return e.jsx(i,{initialSessionId:o},o)}export{t as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{P as o}from"./ProxyViewerContainer-DfxRK7Nt.js";import"./main-CR9IJlz1.js";const r=o;export{r as component};
|