@tonyclaw/agent-inspector 2.1.11 → 2.1.13
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 +10 -15
- package/.output/nitro.json +1 -1
- package/.output/public/assets/{CompareDrawer-CcwXsZp3.js → CompareDrawer-Cz_1vIpR.js} +1 -1
- package/.output/public/assets/{ProxyViewerContainer-DFFxBlvO.js → ProxyViewerContainer-7QSiluMf.js} +19 -19
- package/.output/public/assets/{ReplayDialog-XXiwmD5o.js → ReplayDialog-sBA1KAYD.js} +1 -1
- package/.output/public/assets/{RequestAnatomy-DTCh37so.js → RequestAnatomy-BjlBT-Cy.js} +1 -1
- package/.output/public/assets/{ResponseView-CbFYw9xP.js → ResponseView-PtEKzml9.js} +1 -1
- package/.output/public/assets/{StreamingChunkSequence-CTLMzUxV.js → StreamingChunkSequence-D2_SMhlE.js} +1 -1
- package/.output/public/assets/_sessionId-DZfB4ruK.js +1 -0
- package/.output/public/assets/index-B-QQLbpz.js +1 -0
- package/.output/public/assets/{main-C-lua4Uq.js → main-Dtspb4Ui.js} +2 -2
- package/.output/server/{_sessionId-CO0WzOBc.mjs → _sessionId-CXDcLuvi.mjs} +2 -2
- package/.output/server/_ssr/{CompareDrawer-_OnPOi0O.mjs → CompareDrawer-CMoCAoeq.mjs} +2 -2
- package/.output/server/_ssr/{ProxyViewerContainer-Bfy-cjD3.mjs → ProxyViewerContainer-BW2vVCBN.mjs} +32 -11
- package/.output/server/_ssr/{ReplayDialog-DBZyQFFR.mjs → ReplayDialog-ChXL1t8H.mjs} +3 -3
- package/.output/server/_ssr/{RequestAnatomy-C7m6HJOG.mjs → RequestAnatomy-DtKzIlfU.mjs} +2 -2
- package/.output/server/_ssr/{ResponseView-CM2nFoqa.mjs → ResponseView-B5I8drzc.mjs} +2 -2
- package/.output/server/_ssr/{StreamingChunkSequence-Dj61jLHa.mjs → StreamingChunkSequence-DvwjQNcO.mjs} +2 -2
- package/.output/server/_ssr/{index-BI_nCxdk.mjs → index-D_ZHtRfl.mjs} +2 -2
- package/.output/server/_ssr/index.mjs +2 -2
- package/.output/server/_ssr/{router-WBmANYRw.mjs → router-DhL9Wp3N.mjs} +213 -28
- package/.output/server/{_tanstack-start-manifest_v-lODJPovZ.mjs → _tanstack-start-manifest_v-BHgoAmxZ.mjs} +1 -1
- package/.output/server/index.mjs +58 -58
- package/package.json +1 -1
- package/src/cli.ts +24 -8
- package/src/components/proxy-viewer/ConversationGroup.tsx +22 -2
- package/src/components/proxy-viewer/LogEntryHeader.tsx +10 -3
- package/src/proxy/identityProxy.ts +2 -10
- package/src/proxy/socketTracker.ts +100 -24
- package/.output/public/assets/_sessionId-DAwcZWfu.js +0 -1
- package/.output/public/assets/index-B6sDoCll.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as reactExports, j as jsxRuntimeExports } from "../_libs/react.mjs";
|
|
2
|
-
import { g as getLogFormatAdapter, f as formatTokens, c as cn, v as getStatusCategory, B as Badge, w as Collapsible, x as CollapsibleTrigger, y as CollapsibleContent, z as ScrollArea, E as JsonViewer, F as safeJsonValue } from "./ProxyViewerContainer-
|
|
3
|
-
import "./router-
|
|
2
|
+
import { g as getLogFormatAdapter, f as formatTokens, c as cn, v as getStatusCategory, B as Badge, w as Collapsible, x as CollapsibleTrigger, y as CollapsibleContent, z as ScrollArea, E as JsonViewer, F as safeJsonValue } from "./ProxyViewerContainer-BW2vVCBN.mjs";
|
|
3
|
+
import "./router-DhL9Wp3N.mjs";
|
|
4
4
|
import "../_libs/modelcontextprotocol__server.mjs";
|
|
5
5
|
import "../_libs/jszip.mjs";
|
|
6
6
|
import { Z as Zap, r as TriangleAlert, ap as CircleStop, B as Brain, C as ChevronDown, f as ChevronRight, m as Terminal } from "../_libs/lucide-react.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as reactExports, j as jsxRuntimeExports } from "../_libs/react.mjs";
|
|
2
|
-
import { m as TooltipProvider, n as Tooltip, o as TooltipTrigger, B as Badge, p as TooltipContent, E as JsonViewer } from "./ProxyViewerContainer-
|
|
3
|
-
import "./router-
|
|
2
|
+
import { m as TooltipProvider, n as Tooltip, o as TooltipTrigger, B as Badge, p as TooltipContent, E as JsonViewer } from "./ProxyViewerContainer-BW2vVCBN.mjs";
|
|
3
|
+
import "./router-DhL9Wp3N.mjs";
|
|
4
4
|
import "../_libs/modelcontextprotocol__server.mjs";
|
|
5
5
|
import "../_libs/jszip.mjs";
|
|
6
6
|
import { C as ChevronDown, f as ChevronRight, L as LoaderCircle } from "../_libs/lucide-react.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { P as ProxyViewerContainer } from "./ProxyViewerContainer-
|
|
1
|
+
import { P as ProxyViewerContainer } from "./ProxyViewerContainer-BW2vVCBN.mjs";
|
|
2
2
|
import "../_libs/react.mjs";
|
|
3
|
-
import "./router-
|
|
3
|
+
import "./router-DhL9Wp3N.mjs";
|
|
4
4
|
import "../_libs/modelcontextprotocol__server.mjs";
|
|
5
5
|
import "../_libs/jszip.mjs";
|
|
6
6
|
import "../_libs/swr.mjs";
|
|
@@ -198,7 +198,7 @@ function getResponse() {
|
|
|
198
198
|
return event.res;
|
|
199
199
|
}
|
|
200
200
|
async function getStartManifest(matchedRoutes) {
|
|
201
|
-
const { tsrStartManifest } = await import("../_tanstack-start-manifest_v-
|
|
201
|
+
const { tsrStartManifest } = await import("../_tanstack-start-manifest_v-BHgoAmxZ.mjs");
|
|
202
202
|
const startManifest = tsrStartManifest();
|
|
203
203
|
const rootRoute = startManifest.routes[rootRouteId] = startManifest.routes[rootRouteId] || {};
|
|
204
204
|
rootRoute.assets = rootRoute.assets || [];
|
|
@@ -776,7 +776,7 @@ let entriesPromise;
|
|
|
776
776
|
let baseManifestPromise;
|
|
777
777
|
let cachedFinalManifestPromise;
|
|
778
778
|
async function loadEntries() {
|
|
779
|
-
const routerEntry = await import("./router-
|
|
779
|
+
const routerEntry = await import("./router-DhL9Wp3N.mjs").then((n) => n.y);
|
|
780
780
|
const startEntry = await import("./start-HYkvq4Ni.mjs");
|
|
781
781
|
return { startEntry, routerEntry };
|
|
782
782
|
}
|
|
@@ -108,7 +108,7 @@ function RootDocument({ children }) {
|
|
|
108
108
|
] })
|
|
109
109
|
] });
|
|
110
110
|
}
|
|
111
|
-
const $$splitComponentImporter$1 = () => import("./index-
|
|
111
|
+
const $$splitComponentImporter$1 = () => import("./index-D_ZHtRfl.mjs");
|
|
112
112
|
const Route$C = createFileRoute("/")({
|
|
113
113
|
component: lazyRouteComponent($$splitComponentImporter$1, "component")
|
|
114
114
|
});
|
|
@@ -151,7 +151,7 @@ function decodeSessionIdFromPath(encoded) {
|
|
|
151
151
|
function getSessionPath(sessionId) {
|
|
152
152
|
return `/session/${encodeSessionIdForPath(sessionId)}`;
|
|
153
153
|
}
|
|
154
|
-
const $$splitComponentImporter = () => import("../_sessionId-
|
|
154
|
+
const $$splitComponentImporter = () => import("../_sessionId-CXDcLuvi.mjs");
|
|
155
155
|
const Route$B = createFileRoute("/session/$sessionId")({
|
|
156
156
|
component: lazyRouteComponent($$splitComponentImporter, "component"),
|
|
157
157
|
parseParams: (params) => ({
|
|
@@ -5150,10 +5150,14 @@ function findProviderByModel(model) {
|
|
|
5150
5150
|
}
|
|
5151
5151
|
const execAsync = promisify(exec);
|
|
5152
5152
|
const execFileAsync = promisify(execFile);
|
|
5153
|
+
const cache = /* @__PURE__ */ new Map();
|
|
5154
|
+
const CACHE_TTL_MS = 5 * 60 * 1e3;
|
|
5155
|
+
const MAX_CACHE_SIZE = 200;
|
|
5153
5156
|
const RemotePortSchema = number().int().min(1).max(65535);
|
|
5154
|
-
object({
|
|
5157
|
+
const SocketSchema = object({
|
|
5155
5158
|
remotePort: RemotePortSchema.nullish()
|
|
5156
5159
|
}).passthrough();
|
|
5160
|
+
const inflight = /* @__PURE__ */ new Map();
|
|
5157
5161
|
const RECENT_CLIENT_TTL_MS = 1e3;
|
|
5158
5162
|
let recentInflight = null;
|
|
5159
5163
|
let recentCache = null;
|
|
@@ -5178,6 +5182,58 @@ function setRecentClientCache(info) {
|
|
|
5178
5182
|
recentCache = info;
|
|
5179
5183
|
recentCacheExpiresAt = Date.now() + RECENT_CLIENT_TTL_MS;
|
|
5180
5184
|
}
|
|
5185
|
+
function evictCacheIfNeeded() {
|
|
5186
|
+
while (cache.size > MAX_CACHE_SIZE) {
|
|
5187
|
+
const oldestKey = cache.keys().next().value;
|
|
5188
|
+
if (oldestKey === void 0) break;
|
|
5189
|
+
cache.delete(oldestKey);
|
|
5190
|
+
}
|
|
5191
|
+
}
|
|
5192
|
+
function getFromCache(port) {
|
|
5193
|
+
const entry = cache.get(port);
|
|
5194
|
+
if (entry && Date.now() < entry.expiresAt) {
|
|
5195
|
+
return { port: entry.port, pid: entry.pid, cwd: entry.cwd, projectFolder: entry.projectFolder };
|
|
5196
|
+
}
|
|
5197
|
+
if (entry) cache.delete(port);
|
|
5198
|
+
return null;
|
|
5199
|
+
}
|
|
5200
|
+
function setCache(port, info) {
|
|
5201
|
+
cache.set(port, { ...info, expiresAt: Date.now() + CACHE_TTL_MS });
|
|
5202
|
+
evictCacheIfNeeded();
|
|
5203
|
+
}
|
|
5204
|
+
function extractRemotePort(request) {
|
|
5205
|
+
const candidateSockets = [];
|
|
5206
|
+
const requestAsUnknown = request;
|
|
5207
|
+
const ctx = pick(requestAsUnknown, "context");
|
|
5208
|
+
const nitro = pick(ctx, "nitro");
|
|
5209
|
+
const node = pick(nitro, "node");
|
|
5210
|
+
const innerReq = pick(node, "req");
|
|
5211
|
+
const sock = pick(innerReq, "socket") ?? pick(innerReq, "connection");
|
|
5212
|
+
if (sock !== void 0) candidateSockets.push(sock);
|
|
5213
|
+
const descriptor = Object.getOwnPropertyDescriptor(request, "socket");
|
|
5214
|
+
if (descriptor !== void 0 && descriptor.get === void 0) {
|
|
5215
|
+
candidateSockets.push(descriptor.value);
|
|
5216
|
+
}
|
|
5217
|
+
const directSocket = pick(requestAsUnknown, "socket");
|
|
5218
|
+
if (directSocket !== void 0) candidateSockets.push(directSocket);
|
|
5219
|
+
const directConnection = pick(requestAsUnknown, "connection");
|
|
5220
|
+
if (directConnection !== void 0) candidateSockets.push(directConnection);
|
|
5221
|
+
for (const candidate of candidateSockets) {
|
|
5222
|
+
const parsed = SocketSchema.safeParse(candidate);
|
|
5223
|
+
if (!parsed.success) continue;
|
|
5224
|
+
const remotePort = parsed.data.remotePort;
|
|
5225
|
+
if (remotePort === void 0 || remotePort === null) continue;
|
|
5226
|
+
return remotePort;
|
|
5227
|
+
}
|
|
5228
|
+
return null;
|
|
5229
|
+
}
|
|
5230
|
+
function isObject(value) {
|
|
5231
|
+
return value !== void 0 && value !== null && typeof value === "object";
|
|
5232
|
+
}
|
|
5233
|
+
function pick(value, key) {
|
|
5234
|
+
if (!isObject(value)) return void 0;
|
|
5235
|
+
return value[key];
|
|
5236
|
+
}
|
|
5181
5237
|
function parseCommandLine(commandLine, sep) {
|
|
5182
5238
|
if (!commandLine) return { cwd: null, projectFolder: null };
|
|
5183
5239
|
const exeMatch = commandLine.match(/^"([^"]+)"/) || commandLine.match(/^([^\s]+)/);
|
|
@@ -5244,31 +5300,19 @@ async function lookupRecentClient() {
|
|
|
5244
5300
|
const platform = process.platform;
|
|
5245
5301
|
try {
|
|
5246
5302
|
if (platform === "win32") {
|
|
5247
|
-
const
|
|
5248
|
-
|
|
5249
|
-
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
|
|
5253
|
-
|
|
5254
|
-
].join("; ");
|
|
5255
|
-
const { stdout: stdout2 } = await execFileAsync(
|
|
5256
|
-
"powershell.exe",
|
|
5257
|
-
["-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-Command", psScript],
|
|
5258
|
-
{ windowsHide: true, timeout: 3e3, maxBuffer: 16 * 1024 }
|
|
5259
|
-
);
|
|
5260
|
-
const trimmed = stdout2.trim();
|
|
5261
|
-
if (trimmed === "") return { port: null, pid: null, cwd: null, projectFolder: null };
|
|
5262
|
-
const [pidStr, portStr] = trimmed.split("|");
|
|
5263
|
-
const pid = parseInt(pidStr ?? "", 10);
|
|
5264
|
-
const clientPort = parseInt(portStr ?? "", 10);
|
|
5265
|
-
if (!Number.isInteger(pid) || pid <= 0) {
|
|
5303
|
+
const { stdout: stdout2 } = await execFileAsync("netstat.exe", ["-ano", "-p", "TCP"], {
|
|
5304
|
+
windowsHide: true,
|
|
5305
|
+
timeout: 2e3,
|
|
5306
|
+
maxBuffer: 2 * 1024 * 1024
|
|
5307
|
+
});
|
|
5308
|
+
const client = pickNewestClientFromWindowsNetstat(stdout2.split("\n"), port);
|
|
5309
|
+
if (client === null) {
|
|
5266
5310
|
return { port: null, pid: null, cwd: null, projectFolder: null };
|
|
5267
5311
|
}
|
|
5268
|
-
const { cwd: cwd2, projectFolder: projectFolder2 } = await lookupProcessInfo(pid);
|
|
5312
|
+
const { cwd: cwd2, projectFolder: projectFolder2 } = await lookupProcessInfo(client.pid);
|
|
5269
5313
|
return {
|
|
5270
|
-
port:
|
|
5271
|
-
pid,
|
|
5314
|
+
port: client.localPort,
|
|
5315
|
+
pid: client.pid,
|
|
5272
5316
|
cwd: cwd2,
|
|
5273
5317
|
projectFolder: projectFolder2
|
|
5274
5318
|
};
|
|
@@ -5313,6 +5357,39 @@ function pickNewestClientPidFromNetstat(lines, proxyPort) {
|
|
|
5313
5357
|
candidates2.sort((a, b) => b.localPort - a.localPort || b.order - a.order);
|
|
5314
5358
|
return candidates2[0]?.pid ?? null;
|
|
5315
5359
|
}
|
|
5360
|
+
function parseAddressPort(address) {
|
|
5361
|
+
const match = address.match(/:(\d+)$/);
|
|
5362
|
+
if (match === null) return null;
|
|
5363
|
+
const parsed = parseInt(match[1] ?? "", 10);
|
|
5364
|
+
if (!Number.isInteger(parsed) || parsed <= 0 || parsed > 65535) return null;
|
|
5365
|
+
return parsed;
|
|
5366
|
+
}
|
|
5367
|
+
function pickNewestClientFromWindowsNetstat(lines, proxyPort) {
|
|
5368
|
+
const proxyToken = `:${proxyPort}`;
|
|
5369
|
+
const candidates2 = [];
|
|
5370
|
+
let order = 0;
|
|
5371
|
+
for (const line of lines) {
|
|
5372
|
+
order++;
|
|
5373
|
+
const cols = line.trim().split(/\s+/);
|
|
5374
|
+
if (cols.length < 5) continue;
|
|
5375
|
+
const localAddr = cols[1] ?? "";
|
|
5376
|
+
const remoteAddr = cols[2] ?? "";
|
|
5377
|
+
const state = cols[3] ?? "";
|
|
5378
|
+
const pidStr = cols[4] ?? "";
|
|
5379
|
+
if (state !== "ESTABLISHED") continue;
|
|
5380
|
+
if (!remoteAddr.endsWith(proxyToken)) continue;
|
|
5381
|
+
const localPort = parseAddressPort(localAddr);
|
|
5382
|
+
if (localPort === null || localPort === proxyPort) continue;
|
|
5383
|
+
const pid = parseInt(pidStr, 10);
|
|
5384
|
+
if (!Number.isInteger(pid) || pid <= 0) continue;
|
|
5385
|
+
candidates2.push({ pid, localPort, order });
|
|
5386
|
+
}
|
|
5387
|
+
if (candidates2.length === 0) return null;
|
|
5388
|
+
candidates2.sort((a, b) => b.localPort - a.localPort || b.order - a.order);
|
|
5389
|
+
const selected = candidates2[0];
|
|
5390
|
+
if (selected === void 0) return null;
|
|
5391
|
+
return { pid: selected.pid, localPort: selected.localPort };
|
|
5392
|
+
}
|
|
5316
5393
|
const CLIENT_HEADERS = {
|
|
5317
5394
|
pid: "x-agent-inspector-client-pid",
|
|
5318
5395
|
port: "x-agent-inspector-client-port",
|
|
@@ -5342,6 +5419,31 @@ function readClientHeaders(request) {
|
|
|
5342
5419
|
async function getClientInfo(request) {
|
|
5343
5420
|
const fromHeaders = readClientHeaders(request);
|
|
5344
5421
|
if (fromHeaders !== null) return fromHeaders;
|
|
5422
|
+
const remotePort = extractRemotePort(request);
|
|
5423
|
+
if (remotePort !== null) {
|
|
5424
|
+
const cachedPort = getFromCache(remotePort);
|
|
5425
|
+
if (cachedPort !== null) return cachedPort;
|
|
5426
|
+
const existingPortLookup = inflight.get(remotePort);
|
|
5427
|
+
if (existingPortLookup !== void 0) return existingPortLookup;
|
|
5428
|
+
const portLookup = lookupClientByPort(remotePort).then((info) => {
|
|
5429
|
+
setCache(remotePort, info);
|
|
5430
|
+
inflight.delete(remotePort);
|
|
5431
|
+
return info;
|
|
5432
|
+
}).catch((err) => {
|
|
5433
|
+
inflight.delete(remotePort);
|
|
5434
|
+
logger.debug(`[socketTracker] Remote-port lookup failed for ${remotePort}:`, String(err));
|
|
5435
|
+
const fallback = {
|
|
5436
|
+
port: remotePort,
|
|
5437
|
+
pid: null,
|
|
5438
|
+
cwd: null,
|
|
5439
|
+
projectFolder: null
|
|
5440
|
+
};
|
|
5441
|
+
setCache(remotePort, fallback);
|
|
5442
|
+
return fallback;
|
|
5443
|
+
});
|
|
5444
|
+
inflight.set(remotePort, portLookup);
|
|
5445
|
+
return portLookup;
|
|
5446
|
+
}
|
|
5345
5447
|
const cached = getRecentClientFromCache();
|
|
5346
5448
|
if (cached !== null) return cached;
|
|
5347
5449
|
const existing = recentInflight;
|
|
@@ -5358,6 +5460,89 @@ async function getClientInfo(request) {
|
|
|
5358
5460
|
recentInflight = promise;
|
|
5359
5461
|
return promise;
|
|
5360
5462
|
}
|
|
5463
|
+
const PORT_LOOKUP_TTL_MS = 5 * 60 * 1e3;
|
|
5464
|
+
const portInfoCache = /* @__PURE__ */ new Map();
|
|
5465
|
+
async function lookupClientByPort(clientPort) {
|
|
5466
|
+
if (!Number.isInteger(clientPort) || clientPort <= 0 || clientPort > 65535) {
|
|
5467
|
+
return { port: null, pid: null, cwd: null, projectFolder: null };
|
|
5468
|
+
}
|
|
5469
|
+
const cached = portInfoCache.get(clientPort);
|
|
5470
|
+
if (cached !== void 0 && Date.now() < cached.expiresAt) {
|
|
5471
|
+
return cached.info;
|
|
5472
|
+
}
|
|
5473
|
+
try {
|
|
5474
|
+
const pid = await lookupPidByLocalPort(clientPort);
|
|
5475
|
+
if (pid === null) {
|
|
5476
|
+
const fallback = {
|
|
5477
|
+
port: clientPort,
|
|
5478
|
+
pid: null,
|
|
5479
|
+
cwd: null,
|
|
5480
|
+
projectFolder: null
|
|
5481
|
+
};
|
|
5482
|
+
portInfoCache.set(clientPort, { info: fallback, expiresAt: Date.now() + PORT_LOOKUP_TTL_MS });
|
|
5483
|
+
return fallback;
|
|
5484
|
+
}
|
|
5485
|
+
const { cwd, projectFolder } = await lookupProcessInfo(pid);
|
|
5486
|
+
const info = { port: clientPort, pid, cwd, projectFolder };
|
|
5487
|
+
portInfoCache.set(clientPort, { info, expiresAt: Date.now() + PORT_LOOKUP_TTL_MS });
|
|
5488
|
+
return info;
|
|
5489
|
+
} catch (err) {
|
|
5490
|
+
logger.debug(`[socketTracker] lookupClientByPort(${clientPort}) failed:`, String(err));
|
|
5491
|
+
return { port: clientPort, pid: null, cwd: null, projectFolder: null };
|
|
5492
|
+
}
|
|
5493
|
+
}
|
|
5494
|
+
async function lookupPidByLocalPort(clientPort) {
|
|
5495
|
+
const platform = process.platform;
|
|
5496
|
+
try {
|
|
5497
|
+
if (platform === "win32") {
|
|
5498
|
+
const { stdout } = await execAsync(
|
|
5499
|
+
`netstat -ano | findstr :${clientPort} | findstr ESTABLISHED`,
|
|
5500
|
+
{ shell: "cmd.exe", timeout: 2e3, windowsHide: true }
|
|
5501
|
+
);
|
|
5502
|
+
const clientToken = `:${clientPort}`;
|
|
5503
|
+
for (const rawLine of stdout.split("\n")) {
|
|
5504
|
+
const line = rawLine.trim();
|
|
5505
|
+
if (line === "") continue;
|
|
5506
|
+
const cols = line.split(/\s+/);
|
|
5507
|
+
if (cols.length < 5) continue;
|
|
5508
|
+
const localAddr = cols[1] ?? "";
|
|
5509
|
+
if (!localAddr.endsWith(clientToken)) continue;
|
|
5510
|
+
const pidStr = cols[cols.length - 1] ?? "";
|
|
5511
|
+
const parsed = parseInt(pidStr, 10);
|
|
5512
|
+
if (Number.isInteger(parsed) && parsed > 0) return parsed;
|
|
5513
|
+
}
|
|
5514
|
+
return null;
|
|
5515
|
+
}
|
|
5516
|
+
try {
|
|
5517
|
+
const { stdout } = await execAsync(
|
|
5518
|
+
`ss -tanp state established 'sport = :${clientPort}' 2>/dev/null | tail -n +2 | head -n 1`,
|
|
5519
|
+
{ shell: "/bin/sh" }
|
|
5520
|
+
);
|
|
5521
|
+
const match = stdout.match(/pid=(\d+)/);
|
|
5522
|
+
if (match !== null) {
|
|
5523
|
+
const parsed = parseInt(match[1] ?? "", 10);
|
|
5524
|
+
if (Number.isInteger(parsed) && parsed > 0) return parsed;
|
|
5525
|
+
}
|
|
5526
|
+
} catch {
|
|
5527
|
+
}
|
|
5528
|
+
try {
|
|
5529
|
+
const { stdout } = await execAsync(
|
|
5530
|
+
`lsof -ti tcp:${clientPort} -sTCP:ESTABLISHED 2>/dev/null`,
|
|
5531
|
+
{
|
|
5532
|
+
shell: "/bin/sh"
|
|
5533
|
+
}
|
|
5534
|
+
);
|
|
5535
|
+
const trimmed = stdout.trim().split("\n")[0] ?? "";
|
|
5536
|
+
const parsed = parseInt(trimmed, 10);
|
|
5537
|
+
if (Number.isInteger(parsed) && parsed > 0) return parsed;
|
|
5538
|
+
} catch {
|
|
5539
|
+
}
|
|
5540
|
+
return null;
|
|
5541
|
+
} catch (err) {
|
|
5542
|
+
logger.debug(`[socketTracker] lookupPidByLocalPort(${clientPort}) failed:`, String(err));
|
|
5543
|
+
return null;
|
|
5544
|
+
}
|
|
5545
|
+
}
|
|
5361
5546
|
const DEFAULT_SLOW_RESPONSE_THRESHOLD_SECONDS = 10;
|
|
5362
5547
|
const MAX_SLOW_RESPONSE_THRESHOLD_SECONDS = 600;
|
|
5363
5548
|
const DEFAULT_PROVIDER_TEST_TIMEOUT_SECONDS = 60;
|
|
@@ -8362,7 +8547,7 @@ const Route$w = createFileRoute("/api/models")({
|
|
|
8362
8547
|
}
|
|
8363
8548
|
}
|
|
8364
8549
|
});
|
|
8365
|
-
const version = "2.1.
|
|
8550
|
+
const version = "2.1.13";
|
|
8366
8551
|
const packageJson = {
|
|
8367
8552
|
version
|
|
8368
8553
|
};
|
|
@@ -15211,11 +15396,11 @@ function outcomeFor(logs) {
|
|
|
15211
15396
|
if (hasPending) return "pending";
|
|
15212
15397
|
return "success";
|
|
15213
15398
|
}
|
|
15214
|
-
function latestPreview(logs,
|
|
15399
|
+
function latestPreview(logs, pick2) {
|
|
15215
15400
|
for (let i = logs.length - 1; i >= 0; i--) {
|
|
15216
15401
|
const log = logs[i];
|
|
15217
15402
|
if (log === void 0) continue;
|
|
15218
|
-
const preview =
|
|
15403
|
+
const preview = pick2(log);
|
|
15219
15404
|
if (preview !== null && preview !== "") {
|
|
15220
15405
|
return preview;
|
|
15221
15406
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const tsrStartManifest = () => ({ "routes": { "__root__": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/__root.tsx", "children": ["/", "/api/alerts", "/api/config", "/api/groups", "/api/health", "/api/logs", "/api/mcp", "/api/models", "/api/providers", "/api/runs", "/api/sessions", "/proxy/$", "/session/$sessionId", "/api/knowledge/candidates", "/api/knowledge/project-context", "/api/knowledge/search", "/api/knowledge/sessions/$sessionId/candidates"], "preloads": ["/assets/main-
|
|
1
|
+
const tsrStartManifest = () => ({ "routes": { "__root__": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/__root.tsx", "children": ["/", "/api/alerts", "/api/config", "/api/groups", "/api/health", "/api/logs", "/api/mcp", "/api/models", "/api/providers", "/api/runs", "/api/sessions", "/proxy/$", "/session/$sessionId", "/api/knowledge/candidates", "/api/knowledge/project-context", "/api/knowledge/search", "/api/knowledge/sessions/$sessionId/candidates"], "preloads": ["/assets/main-Dtspb4Ui.js"], "assets": [] }, "/": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/index.tsx", "assets": [], "preloads": ["/assets/index-B-QQLbpz.js", "/assets/ProxyViewerContainer-7QSiluMf.js"] }, "/api/alerts": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/alerts.ts", "children": ["/api/alerts/summary"] }, "/api/config": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/config.ts", "children": ["/api/config/paths"] }, "/api/groups": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/groups.ts", "children": ["/api/groups/$groupId"] }, "/api/health": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/health.ts" }, "/api/logs": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/logs.ts", "children": ["/api/logs/$id", "/api/logs/import", "/api/logs/stream"] }, "/api/mcp": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/mcp.ts" }, "/api/models": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/models.ts" }, "/api/providers": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/providers.ts", "children": ["/api/providers/$providerId", "/api/providers/export", "/api/providers/import", "/api/providers/scan"] }, "/api/runs": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/runs.ts", "children": ["/api/runs/$runId"] }, "/api/sessions": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/sessions.ts" }, "/proxy/$": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/proxy/$.ts" }, "/session/$sessionId": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/session/$sessionId.tsx", "assets": [], "preloads": ["/assets/_sessionId-DZfB4ruK.js", "/assets/ProxyViewerContainer-7QSiluMf.js"] }, "/api/alerts/summary": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/alerts.summary.ts" }, "/api/config/paths": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/config.paths.ts" }, "/api/groups/$groupId": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/groups.$groupId.ts", "children": ["/api/groups/$groupId/evidence", "/api/groups/$groupId/sessions"] }, "/api/knowledge/candidates": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/knowledge.candidates.ts", "children": ["/api/knowledge/candidates/$candidateId"] }, "/api/knowledge/project-context": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/knowledge.project-context.ts" }, "/api/knowledge/search": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/knowledge.search.ts" }, "/api/logs/$id": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/logs.$id.ts", "children": ["/api/logs/$id/body", "/api/logs/$id/chunks", "/api/logs/$id/replay"] }, "/api/logs/import": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/logs.import.ts" }, "/api/logs/stream": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/logs.stream.ts" }, "/api/providers/$providerId": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/providers.$providerId.ts", "children": ["/api/providers/$providerId/model-metadata", "/api/providers/$providerId/test"] }, "/api/providers/export": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/providers.export.ts" }, "/api/providers/import": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/providers.import.ts" }, "/api/providers/scan": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/providers.scan.ts" }, "/api/runs/$runId": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/runs.$runId.ts", "children": ["/api/runs/$runId/evidence"] }, "/api/groups/$groupId/evidence": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/groups.$groupId.evidence.ts" }, "/api/groups/$groupId/sessions": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/groups.$groupId.sessions.ts" }, "/api/knowledge/candidates/$candidateId": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/knowledge.candidates.$candidateId.ts", "children": ["/api/knowledge/candidates/$candidateId/promote"] }, "/api/logs/$id/body": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/logs.$id.body.ts" }, "/api/logs/$id/chunks": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/logs.$id.chunks.ts" }, "/api/logs/$id/replay": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/logs.$id.replay.ts" }, "/api/providers/$providerId/model-metadata": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/providers.$providerId.model-metadata.ts" }, "/api/providers/$providerId/test": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/providers.$providerId.test.ts", "children": ["/api/providers/$providerId/test/log"] }, "/api/runs/$runId/evidence": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/runs.$runId.evidence.ts" }, "/api/knowledge/candidates/$candidateId/promote": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/knowledge.candidates.$candidateId.promote.ts" }, "/api/knowledge/sessions/$sessionId/candidates": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/knowledge.sessions.$sessionId.candidates.ts" }, "/api/providers/$providerId/test/log": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/providers.$providerId.test.log.ts" } }, "clientEntry": "/assets/main-Dtspb4Ui.js" });
|
|
2
2
|
export {
|
|
3
3
|
tsrStartManifest
|
|
4
4
|
};
|
package/.output/server/index.mjs
CHANGED
|
@@ -38,100 +38,100 @@ const assets = {
|
|
|
38
38
|
"/assets/alibaba-TTwafVwX.svg": {
|
|
39
39
|
"type": "image/svg+xml",
|
|
40
40
|
"etag": '"171b-6dyV5K8QjiaY35sN9qNprh9zDIs"',
|
|
41
|
-
"mtime": "2026-07-
|
|
41
|
+
"mtime": "2026-07-04T05:36:48.779Z",
|
|
42
42
|
"size": 5915,
|
|
43
43
|
"path": "../public/assets/alibaba-TTwafVwX.svg"
|
|
44
44
|
},
|
|
45
|
-
"/assets/
|
|
46
|
-
"type": "image/jpeg",
|
|
47
|
-
"etag": '"1b06-IwivU89ko5UTMUM1/t7hn4sQK9A"',
|
|
48
|
-
"mtime": "2026-07-04T03:38:16.962Z",
|
|
49
|
-
"size": 6918,
|
|
50
|
-
"path": "../public/assets/minimax-BPMzvuL-.jpeg"
|
|
51
|
-
},
|
|
52
|
-
"/assets/ReplayDialog-XXiwmD5o.js": {
|
|
45
|
+
"/assets/CompareDrawer-Cz_1vIpR.js": {
|
|
53
46
|
"type": "text/javascript; charset=utf-8",
|
|
54
|
-
"etag": '"
|
|
55
|
-
"mtime": "2026-07-
|
|
56
|
-
"size":
|
|
57
|
-
"path": "../public/assets/
|
|
47
|
+
"etag": '"49e8-IQAhbCzceTeYxZxKJ3H1D4vN5lI"',
|
|
48
|
+
"mtime": "2026-07-04T05:36:48.779Z",
|
|
49
|
+
"size": 18920,
|
|
50
|
+
"path": "../public/assets/CompareDrawer-Cz_1vIpR.js"
|
|
58
51
|
},
|
|
59
|
-
"/assets/index-
|
|
52
|
+
"/assets/index-B-QQLbpz.js": {
|
|
60
53
|
"type": "text/javascript; charset=utf-8",
|
|
61
|
-
"etag": '"74-
|
|
62
|
-
"mtime": "2026-07-
|
|
54
|
+
"etag": '"74-5Zl3E5e37SnRK730IWxTDix9Cew"',
|
|
55
|
+
"mtime": "2026-07-04T05:36:48.779Z",
|
|
63
56
|
"size": 116,
|
|
64
|
-
"path": "../public/assets/index-
|
|
65
|
-
},
|
|
66
|
-
"/assets/CompareDrawer-CcwXsZp3.js": {
|
|
67
|
-
"type": "text/javascript; charset=utf-8",
|
|
68
|
-
"etag": '"49e8-Pph7DlYDe9TrUe9PrkCiMz3a6ac"',
|
|
69
|
-
"mtime": "2026-07-04T03:38:16.962Z",
|
|
70
|
-
"size": 18920,
|
|
71
|
-
"path": "../public/assets/CompareDrawer-CcwXsZp3.js"
|
|
57
|
+
"path": "../public/assets/index-B-QQLbpz.js"
|
|
72
58
|
},
|
|
73
59
|
"/assets/index-CmtfjQPv.css": {
|
|
74
60
|
"type": "text/css; charset=utf-8",
|
|
75
61
|
"etag": '"1e968-15dLAIs72Zhi4Qe/CRWBTVZ7MtI"',
|
|
76
|
-
"mtime": "2026-07-
|
|
62
|
+
"mtime": "2026-07-04T05:36:48.779Z",
|
|
77
63
|
"size": 125288,
|
|
78
64
|
"path": "../public/assets/index-CmtfjQPv.css"
|
|
79
65
|
},
|
|
80
|
-
"/assets/
|
|
66
|
+
"/assets/ReplayDialog-sBA1KAYD.js": {
|
|
81
67
|
"type": "text/javascript; charset=utf-8",
|
|
82
|
-
"etag": '"
|
|
83
|
-
"mtime": "2026-07-
|
|
84
|
-
"size":
|
|
85
|
-
"path": "../public/assets/
|
|
68
|
+
"etag": '"318c-/uOpj+S8IOxd8JplqqWJ9qOWH3I"',
|
|
69
|
+
"mtime": "2026-07-04T05:36:48.779Z",
|
|
70
|
+
"size": 12684,
|
|
71
|
+
"path": "../public/assets/ReplayDialog-sBA1KAYD.js"
|
|
86
72
|
},
|
|
87
|
-
"/assets/
|
|
73
|
+
"/assets/StreamingChunkSequence-D2_SMhlE.js": {
|
|
88
74
|
"type": "text/javascript; charset=utf-8",
|
|
89
|
-
"etag": '"
|
|
90
|
-
"mtime": "2026-07-
|
|
91
|
-
"size":
|
|
92
|
-
"path": "../public/assets/
|
|
75
|
+
"etag": '"d5c-k/lB4x1Vah+nlw2D1J4Zn+Hqm/o"',
|
|
76
|
+
"mtime": "2026-07-04T05:36:48.781Z",
|
|
77
|
+
"size": 3420,
|
|
78
|
+
"path": "../public/assets/StreamingChunkSequence-D2_SMhlE.js"
|
|
93
79
|
},
|
|
94
|
-
"/assets/
|
|
80
|
+
"/assets/RequestAnatomy-BjlBT-Cy.js": {
|
|
95
81
|
"type": "text/javascript; charset=utf-8",
|
|
96
|
-
"etag": '"
|
|
97
|
-
"mtime": "2026-07-
|
|
98
|
-
"size":
|
|
99
|
-
"path": "../public/assets/
|
|
82
|
+
"etag": '"43f2-aSr44l/LuOOCwx52V5TxpIleLAM"',
|
|
83
|
+
"mtime": "2026-07-04T05:36:48.779Z",
|
|
84
|
+
"size": 17394,
|
|
85
|
+
"path": "../public/assets/RequestAnatomy-BjlBT-Cy.js"
|
|
100
86
|
},
|
|
101
|
-
"/assets/
|
|
102
|
-
"type": "
|
|
103
|
-
"etag": '"
|
|
104
|
-
"mtime": "2026-07-
|
|
105
|
-
"size":
|
|
106
|
-
"path": "../public/assets/
|
|
87
|
+
"/assets/minimax-BPMzvuL-.jpeg": {
|
|
88
|
+
"type": "image/jpeg",
|
|
89
|
+
"etag": '"1b06-IwivU89ko5UTMUM1/t7hn4sQK9A"',
|
|
90
|
+
"mtime": "2026-07-04T05:36:48.779Z",
|
|
91
|
+
"size": 6918,
|
|
92
|
+
"path": "../public/assets/minimax-BPMzvuL-.jpeg"
|
|
107
93
|
},
|
|
108
|
-
"/assets/
|
|
94
|
+
"/assets/main-Dtspb4Ui.js": {
|
|
109
95
|
"type": "text/javascript; charset=utf-8",
|
|
110
|
-
"etag": '"
|
|
111
|
-
"mtime": "2026-07-
|
|
112
|
-
"size":
|
|
113
|
-
"path": "../public/assets/
|
|
96
|
+
"etag": '"512fd-xu5QhSDM+B1+HCE/S55XRSP7mzM"',
|
|
97
|
+
"mtime": "2026-07-04T05:36:48.779Z",
|
|
98
|
+
"size": 332541,
|
|
99
|
+
"path": "../public/assets/main-Dtspb4Ui.js"
|
|
114
100
|
},
|
|
115
101
|
"/assets/zhipuai-BPNAnxo-.svg": {
|
|
116
102
|
"type": "image/svg+xml",
|
|
117
103
|
"etag": '"2bf8-hNaLCTi89nOFCsIIfWpP/jrfo0s"',
|
|
118
|
-
"mtime": "2026-07-
|
|
104
|
+
"mtime": "2026-07-04T05:36:48.779Z",
|
|
119
105
|
"size": 11256,
|
|
120
106
|
"path": "../public/assets/zhipuai-BPNAnxo-.svg"
|
|
121
107
|
},
|
|
108
|
+
"/assets/ResponseView-PtEKzml9.js": {
|
|
109
|
+
"type": "text/javascript; charset=utf-8",
|
|
110
|
+
"etag": '"30d2-PgPHao5hEC1x+egdBk+5Bh5Ykuc"',
|
|
111
|
+
"mtime": "2026-07-04T05:36:48.781Z",
|
|
112
|
+
"size": 12498,
|
|
113
|
+
"path": "../public/assets/ResponseView-PtEKzml9.js"
|
|
114
|
+
},
|
|
122
115
|
"/assets/qwen-CONDcHqt.png": {
|
|
123
116
|
"type": "image/png",
|
|
124
117
|
"etag": '"572c3-cdJAPaHdOvFCGzuaQjagdgOu6XE"',
|
|
125
|
-
"mtime": "2026-07-
|
|
118
|
+
"mtime": "2026-07-04T05:36:48.779Z",
|
|
126
119
|
"size": 357059,
|
|
127
120
|
"path": "../public/assets/qwen-CONDcHqt.png"
|
|
128
121
|
},
|
|
129
|
-
"/assets/
|
|
122
|
+
"/assets/_sessionId-DZfB4ruK.js": {
|
|
123
|
+
"type": "text/javascript; charset=utf-8",
|
|
124
|
+
"etag": '"d2-MK+vvObaH7Ulj3vGGu5D9UigZf8"',
|
|
125
|
+
"mtime": "2026-07-04T05:36:48.779Z",
|
|
126
|
+
"size": 210,
|
|
127
|
+
"path": "../public/assets/_sessionId-DZfB4ruK.js"
|
|
128
|
+
},
|
|
129
|
+
"/assets/ProxyViewerContainer-7QSiluMf.js": {
|
|
130
130
|
"type": "text/javascript; charset=utf-8",
|
|
131
|
-
"etag": '"
|
|
132
|
-
"mtime": "2026-07-
|
|
133
|
-
"size":
|
|
134
|
-
"path": "../public/assets/ProxyViewerContainer-
|
|
131
|
+
"etag": '"c1d99-OTDVU1kkKfVtUjde6m6DdNv1knE"',
|
|
132
|
+
"mtime": "2026-07-04T05:36:48.779Z",
|
|
133
|
+
"size": 794009,
|
|
134
|
+
"path": "../public/assets/ProxyViewerContainer-7QSiluMf.js"
|
|
135
135
|
}
|
|
136
136
|
};
|
|
137
137
|
function readAsset(id) {
|