@tonyclaw/agent-inspector 2.0.0 → 2.0.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.
- package/.output/cli.js +9 -1
- package/.output/nitro.json +1 -1
- package/.output/public/assets/{CompareDrawer-CU5ZrWcL.js → CompareDrawer-sVLGhCO3.js} +1 -1
- package/.output/public/assets/{ProxyViewerContainer-pEBqVp1d.js → ProxyViewerContainer-p9QvzZ6U.js} +4 -4
- package/.output/public/assets/{ReplayDialog-F58yNg5j.js → ReplayDialog-DxbFUqNW.js} +1 -1
- package/.output/public/assets/{RequestAnatomy-C9lT0qE_.js → RequestAnatomy-CSmGQa_g.js} +1 -1
- package/.output/public/assets/{ResponseView-DHJq6bnz.js → ResponseView-B5f89c8Z.js} +1 -1
- package/.output/public/assets/{StreamingChunkSequence-BTgfpFUT.js → StreamingChunkSequence-BzqpY0TN.js} +1 -1
- package/.output/public/assets/_sessionId-BF7ftHV3.js +1 -0
- package/.output/public/assets/index-BU0PpLby.js +1 -0
- package/.output/public/assets/{json-viewer-CZVYLR8j.js → json-viewer-CKNMihlh.js} +1 -1
- package/.output/public/assets/{main-DHs7FBK3.js → main-yWf8dv9w.js} +2 -2
- package/.output/server/{_sessionId-wMLPvC5g.mjs → _sessionId-DfHd0gd8.mjs} +2 -2
- package/.output/server/_ssr/{CompareDrawer-BU4V0uVf.mjs → CompareDrawer-DGYAUWgF.mjs} +3 -3
- package/.output/server/_ssr/{ProxyViewerContainer-BnRwFEnn.mjs → ProxyViewerContainer-fawglkTo.mjs} +9 -9
- package/.output/server/_ssr/{ReplayDialog-C7dn9pd_.mjs → ReplayDialog-B4vlKa2W.mjs} +4 -4
- package/.output/server/_ssr/{RequestAnatomy-C1rWpe9-.mjs → RequestAnatomy-BNQvEIZK.mjs} +2 -2
- package/.output/server/_ssr/{ResponseView-hGpPaYsf.mjs → ResponseView-X6X6G16_.mjs} +3 -3
- package/.output/server/_ssr/{StreamingChunkSequence-BRWI1r_G.mjs → StreamingChunkSequence-BPVN3MnF.mjs} +3 -3
- package/.output/server/_ssr/{index-BKURLVPz.mjs → index-CXmpc2X5.mjs} +2 -2
- package/.output/server/_ssr/index.mjs +2 -2
- package/.output/server/_ssr/{json-viewer-BBd2DtQP.mjs → json-viewer-3XC3eq4R.mjs} +2 -2
- package/.output/server/_ssr/{router-BcZ0D6AB.mjs → router-C0B2qvIM.mjs} +2 -2
- package/.output/server/{_tanstack-start-manifest_v-1y8ZVxRI.mjs → _tanstack-start-manifest_v-7tfsmd2I.mjs} +1 -1
- package/.output/server/index.mjs +60 -60
- package/README.md +13 -0
- package/package.json +8 -2
- package/scripts/setup-windows-runtime.mjs +73 -0
- package/src/assets/agent-inspector.ico +0 -0
- package/src/cli.ts +18 -2
- package/.output/public/assets/_sessionId-DsNRbnNm.js +0 -1
- package/.output/public/assets/index-DmBV8Gve.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tonyclaw/agent-inspector",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Agent observability and knowledge capture layer for AI coding tools.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -37,14 +37,17 @@
|
|
|
37
37
|
"!src/**/*.stories.tsx",
|
|
38
38
|
"!src/**/__fixtures__",
|
|
39
39
|
"!src/routeTree.gen.ts",
|
|
40
|
+
"scripts/setup-windows-runtime.mjs",
|
|
40
41
|
"styles",
|
|
41
|
-
".output"
|
|
42
|
+
".output",
|
|
43
|
+
"!.output/*.exe"
|
|
42
44
|
],
|
|
43
45
|
"scripts": {
|
|
44
46
|
"dev": "vite dev",
|
|
45
47
|
"start": "node .output/cli.js",
|
|
46
48
|
"build": "vite build && bun build:cli",
|
|
47
49
|
"build:cli": "npx esbuild src/cli.ts --bundle --platform=node --target=node18 --format=esm --outfile=.output/cli.js",
|
|
50
|
+
"postinstall": "node scripts/setup-windows-runtime.mjs",
|
|
48
51
|
"prepublishOnly": "npm run build",
|
|
49
52
|
"typecheck": "tsc --noEmit",
|
|
50
53
|
"lint": "eslint .",
|
|
@@ -81,6 +84,9 @@
|
|
|
81
84
|
"tw-animate-css": "^1.4.0",
|
|
82
85
|
"zod": "^4.3.6"
|
|
83
86
|
},
|
|
87
|
+
"optionalDependencies": {
|
|
88
|
+
"rcedit": "4.0.1"
|
|
89
|
+
},
|
|
84
90
|
"devDependencies": {
|
|
85
91
|
"@biomejs/biome": "^2.3.14",
|
|
86
92
|
"@cfworker/json-schema": "^4.1.1",
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { copyFile, mkdir, readFile } from "node:fs/promises";
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
3
|
+
import { createRequire } from "node:module";
|
|
4
|
+
import { dirname, join } from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
|
|
7
|
+
const require = createRequire(import.meta.url);
|
|
8
|
+
const scriptDir = dirname(fileURLToPath(import.meta.url));
|
|
9
|
+
const packageRoot = dirname(scriptDir);
|
|
10
|
+
const outputDir = join(packageRoot, ".output");
|
|
11
|
+
const serverEntry = join(outputDir, "server", "index.mjs");
|
|
12
|
+
const brandedRuntime = join(outputDir, "agent-inspector.exe");
|
|
13
|
+
const iconPath = join(packageRoot, "src", "assets", "agent-inspector.ico");
|
|
14
|
+
|
|
15
|
+
function normalizeWindowsVersion(version) {
|
|
16
|
+
const numericParts = version
|
|
17
|
+
.split(".")
|
|
18
|
+
.map((part) => Number.parseInt(part.replace(/\D.*$/, ""), 10))
|
|
19
|
+
.filter((part) => Number.isInteger(part) && part >= 0);
|
|
20
|
+
return [...numericParts, 0, 0, 0, 0].slice(0, 4).join(".");
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
async function readPackageVersion() {
|
|
24
|
+
const packageJson = JSON.parse(await readFile(join(packageRoot, "package.json"), "utf8"));
|
|
25
|
+
return typeof packageJson.version === "string" ? packageJson.version : "0.0.0";
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function shouldSkip() {
|
|
29
|
+
return (
|
|
30
|
+
process.platform !== "win32" ||
|
|
31
|
+
process.env["AGENT_INSPECTOR_SKIP_WINDOWS_RUNTIME"] === "1" ||
|
|
32
|
+
!existsSync(serverEntry) ||
|
|
33
|
+
!existsSync(iconPath) ||
|
|
34
|
+
!existsSync(process.execPath)
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
async function main() {
|
|
39
|
+
if (shouldSkip()) return;
|
|
40
|
+
|
|
41
|
+
const version = await readPackageVersion();
|
|
42
|
+
const windowsVersion = normalizeWindowsVersion(version);
|
|
43
|
+
const rcedit = require("rcedit");
|
|
44
|
+
|
|
45
|
+
await mkdir(outputDir, { recursive: true });
|
|
46
|
+
await copyFile(process.execPath, brandedRuntime);
|
|
47
|
+
await rcedit(brandedRuntime, {
|
|
48
|
+
icon: iconPath,
|
|
49
|
+
"file-version": windowsVersion,
|
|
50
|
+
"product-version": windowsVersion,
|
|
51
|
+
"version-string": {
|
|
52
|
+
CompanyName: "TonyClaw",
|
|
53
|
+
FileDescription: "Agent Inspector",
|
|
54
|
+
InternalName: "Agent Inspector",
|
|
55
|
+
OriginalFilename: "agent-inspector.exe",
|
|
56
|
+
ProductName: "Agent Inspector",
|
|
57
|
+
ProductVersion: version,
|
|
58
|
+
LegalCopyright: "Copyright (c) TonyClaw",
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
console.log("Generated Windows branded runtime: .output/agent-inspector.exe");
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
try {
|
|
66
|
+
await main();
|
|
67
|
+
} catch (error) {
|
|
68
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
69
|
+
console.warn(`Skipping Windows branded runtime generation: ${message}`);
|
|
70
|
+
if (process.env["AGENT_INSPECTOR_REQUIRE_WINDOWS_RUNTIME"] === "1") {
|
|
71
|
+
process.exitCode = 1;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
Binary file
|
package/src/cli.ts
CHANGED
|
@@ -10,6 +10,9 @@ const __dirname = dirname(__filename);
|
|
|
10
10
|
|
|
11
11
|
const DEFAULT_PORT = 25947;
|
|
12
12
|
const LOCAL_PROBE_TIMEOUT_MS = 2000;
|
|
13
|
+
const BRANDED_WINDOWS_RUNTIME_EXE = "agent-inspector.exe";
|
|
14
|
+
|
|
15
|
+
process.title = "Agent Inspector";
|
|
13
16
|
|
|
14
17
|
/**
|
|
15
18
|
* Subcommand router. The legacy one-liner UX (`agent-inspector` with no args,
|
|
@@ -123,6 +126,18 @@ function waitForProcessExit(child: ChildProcess): Promise<number> {
|
|
|
123
126
|
});
|
|
124
127
|
}
|
|
125
128
|
|
|
129
|
+
type ServerCommand = {
|
|
130
|
+
command: string;
|
|
131
|
+
args: string[];
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
function resolveServerCommand(outputDir: string, serverPath: string): ServerCommand {
|
|
135
|
+
const brandedRuntime = join(outputDir, BRANDED_WINDOWS_RUNTIME_EXE);
|
|
136
|
+
return process.platform === "win32" && existsSync(brandedRuntime)
|
|
137
|
+
? { command: brandedRuntime, args: [serverPath] }
|
|
138
|
+
: { command: process.execPath, args: [serverPath] };
|
|
139
|
+
}
|
|
140
|
+
|
|
126
141
|
async function runStart(args: string[]): Promise<void> {
|
|
127
142
|
const envPort = process.env["PORT"];
|
|
128
143
|
const portDefault = envPort !== undefined ? Number(envPort) : DEFAULT_PORT;
|
|
@@ -298,8 +313,9 @@ async function runStart(args: string[]): Promise<void> {
|
|
|
298
313
|
// Compute server path
|
|
299
314
|
const outputDir = __dirname;
|
|
300
315
|
const serverPath = join(outputDir, "../.output/server/index.mjs");
|
|
316
|
+
const serverCommand = resolveServerCommand(outputDir, serverPath);
|
|
301
317
|
|
|
302
|
-
// Start server with
|
|
318
|
+
// Start the server with the branded Windows runtime when postinstall created it.
|
|
303
319
|
const serverEnv = { ...process.env };
|
|
304
320
|
if (configDir !== undefined) {
|
|
305
321
|
// Normalize MSYS / Git Bash paths to Windows native form.
|
|
@@ -323,7 +339,7 @@ async function runStart(args: string[]): Promise<void> {
|
|
|
323
339
|
if (providersJson !== undefined) {
|
|
324
340
|
serverEnv["AGENT_INSPECTOR_PROVIDERS_JSON"] = providersJson;
|
|
325
341
|
}
|
|
326
|
-
const serverProcess = spawn(
|
|
342
|
+
const serverProcess = spawn(serverCommand.command, serverCommand.args, {
|
|
327
343
|
stdio: background ? ["ignore", "ignore", "ignore"] : "inherit",
|
|
328
344
|
detached: background,
|
|
329
345
|
env: serverEnv,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{R as s,j as e}from"./main-DHs7FBK3.js";import{P as i}from"./ProxyViewerContainer-pEBqVp1d.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-pEBqVp1d.js";import"./main-DHs7FBK3.js";const r=o;export{r as component};
|