@tonyclaw/agent-inspector 2.1.16 → 2.1.18
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 +57 -13
- package/.output/nitro.json +1 -1
- package/.output/public/assets/{CompareDrawer-Ccrrcx1j.js → CompareDrawer-Fqqw5Lci.js} +1 -1
- package/.output/public/assets/ProxyViewerContainer-CP_RzwW9.js +106 -0
- package/.output/public/assets/{ReplayDialog-C7axhr-l.js → ReplayDialog-hYhz_i6W.js} +1 -1
- package/.output/public/assets/{RequestAnatomy-WOptg8j_.js → RequestAnatomy-CTuWbtwC.js} +1 -1
- package/.output/public/assets/{ResponseView-CSAcxh_M.js → ResponseView-CsZ7S5Gv.js} +2 -2
- package/.output/public/assets/{StreamingChunkSequence-DJS5KhPx.js → StreamingChunkSequence-PIbJMotU.js} +1 -1
- package/.output/public/assets/_sessionId-CUGA9qU3.js +1 -0
- package/.output/public/assets/{index-DMPNh46t.js → index-F7mynwuH.js} +1 -1
- package/.output/public/assets/index-G4dTUobw.js +1 -0
- package/.output/public/assets/index-gvYkgMPF.css +1 -0
- package/.output/public/assets/{json-viewer-inX5QSa3.js → json-viewer-DCXtNmmD.js} +1 -1
- package/.output/public/assets/{main-aCAKYGSD.js → main-BJZf7_Ib.js} +2 -2
- package/.output/server/_libs/lucide-react.mjs +220 -202
- package/.output/server/{_sessionId-C0fhvQnn.mjs → _sessionId-DjSHDNh8.mjs} +2 -2
- package/.output/server/_ssr/{CompareDrawer-CO-Ti5sg.mjs → CompareDrawer-Dal52IFo.mjs} +3 -3
- package/.output/server/_ssr/{ProxyViewerContainer-N4J7uBCX.mjs → ProxyViewerContainer-CVqFZGff.mjs} +1833 -1366
- package/.output/server/_ssr/{ReplayDialog-J1VxC0In.mjs → ReplayDialog-BOEgdMes.mjs} +4 -4
- package/.output/server/_ssr/{RequestAnatomy-DBH-F3rq.mjs → RequestAnatomy-gch7_vCV.mjs} +2 -2
- package/.output/server/_ssr/{ResponseView-DLFwV7Hd.mjs → ResponseView-lEWPy-H4.mjs} +3 -3
- package/.output/server/_ssr/{StreamingChunkSequence-BywmuND0.mjs → StreamingChunkSequence-DnudbJ1O.mjs} +2 -2
- package/.output/server/_ssr/{index-CStymIc0.mjs → index-Cza8zDrW.mjs} +2 -2
- package/.output/server/_ssr/index.mjs +2 -2
- package/.output/server/_ssr/{json-viewer-DlQu0N1x.mjs → json-viewer-C2lIVEX3.mjs} +3 -3
- package/.output/server/_ssr/{router-CQ4Zxhmr.mjs → router-bF9uzd1k.mjs} +939 -113
- package/.output/server/{_tanstack-start-manifest_v-BHeJBGfo.mjs → _tanstack-start-manifest_v-ErvW-mtr.mjs} +1 -1
- package/.output/server/index.mjs +74 -74
- package/README.md +57 -2
- package/package.json +1 -1
- package/src/cli/startupOutput.ts +16 -0
- package/src/cli.ts +61 -15
- package/src/components/ProxyViewer.tsx +395 -64
- package/src/components/providers/ProviderCard.tsx +132 -31
- package/src/components/providers/ProviderForm.tsx +43 -11
- package/src/components/providers/ProvidersPanel.tsx +1 -1
- package/src/components/proxy-viewer/ConversationHeader.tsx +133 -112
- package/src/components/proxy-viewer/LogEntry.tsx +109 -26
- package/src/components/proxy-viewer/LogEntryHeader.tsx +339 -329
- package/src/components/proxy-viewer/ThreadConnector.tsx +49 -46
- package/src/components/proxy-viewer/TurnGroup.tsx +22 -62
- package/src/components/proxy-viewer/bodyHydration.ts +56 -0
- package/src/lib/providerTestContract.ts +56 -10
- package/src/lib/providerTestPrompt.ts +23 -1
- package/src/lib/upstreamUrl.ts +105 -1
- package/src/mcp/server.ts +275 -0
- package/src/mcp/toolHandlers.ts +381 -4
- package/src/proxy/logSearch.ts +3 -0
- package/src/proxy/store.ts +40 -15
- package/src/routes/api/logs.ts +8 -2
- package/src/routes/api/providers.$providerId.test.log.ts +85 -10
- package/.output/public/assets/ProxyViewerContainer-DLqClc9A.js +0 -106
- package/.output/public/assets/_sessionId-DUSalzKH.js +0 -1
- package/.output/public/assets/index-BPpA21dY.css +0 -1
- package/.output/public/assets/index-Bt0Az2I2.js +0 -1
package/src/routes/api/logs.ts
CHANGED
|
@@ -62,6 +62,11 @@ export const Route = createFileRoute("/api/logs")({
|
|
|
62
62
|
}
|
|
63
63
|
const sessionId = url.searchParams.get("sessionId") ?? undefined;
|
|
64
64
|
const model = url.searchParams.get("model") ?? undefined;
|
|
65
|
+
const clientPidResult = parseOptionalPositiveInt(url.searchParams.get("clientPid"));
|
|
66
|
+
if (!clientPidResult.ok) {
|
|
67
|
+
return Response.json({ error: "Invalid clientPid" }, { status: 400 });
|
|
68
|
+
}
|
|
69
|
+
const clientPid = clientPidResult.value ?? undefined;
|
|
65
70
|
const query = url.searchParams.get("q") ?? url.searchParams.get("search");
|
|
66
71
|
const offset = parseNonNegativeInt(url.searchParams.get("offset"), 0);
|
|
67
72
|
if (query !== null) {
|
|
@@ -71,7 +76,7 @@ export const Route = createFileRoute("/api/logs")({
|
|
|
71
76
|
LOG_SEARCH_DEFAULT_SCAN_LIMIT,
|
|
72
77
|
);
|
|
73
78
|
return Response.json(
|
|
74
|
-
await searchLogsPage({ query, sessionId, model, offset, limit, scanLimit }),
|
|
79
|
+
await searchLogsPage({ query, sessionId, model, clientPid, offset, limit, scanLimit }),
|
|
75
80
|
);
|
|
76
81
|
}
|
|
77
82
|
const limit = parsePositiveInt(url.searchParams.get("limit"), 50);
|
|
@@ -94,6 +99,7 @@ export const Route = createFileRoute("/api/logs")({
|
|
|
94
99
|
await listLogsCursorPage({
|
|
95
100
|
sessionId,
|
|
96
101
|
model,
|
|
102
|
+
clientPid,
|
|
97
103
|
limit,
|
|
98
104
|
includeBodies,
|
|
99
105
|
beforeLogId: beforeLogId.value ?? undefined,
|
|
@@ -104,7 +110,7 @@ export const Route = createFileRoute("/api/logs")({
|
|
|
104
110
|
}
|
|
105
111
|
|
|
106
112
|
return Response.json(
|
|
107
|
-
await listLogsPage({ sessionId, model, offset, limit, includeBodies }),
|
|
113
|
+
await listLogsPage({ sessionId, model, clientPid, offset, limit, includeBodies }),
|
|
108
114
|
);
|
|
109
115
|
},
|
|
110
116
|
DELETE: async ({ request }: { request: Request }) => {
|
|
@@ -6,6 +6,7 @@ import { buildProviderTestSessionId } from "../../proxy/sessionSupervisor";
|
|
|
6
6
|
import { buildProviderTestRequestBody } from "../../lib/providerTestPrompt";
|
|
7
7
|
import {
|
|
8
8
|
ProviderTestResultsSchema,
|
|
9
|
+
type ProviderModelTestResults,
|
|
9
10
|
type ProviderTestResult as TestResult,
|
|
10
11
|
type ProviderTestState,
|
|
11
12
|
} from "../../lib/providerTestContract";
|
|
@@ -55,11 +56,9 @@ async function logModelResults(
|
|
|
55
56
|
providerName: string,
|
|
56
57
|
providerSessionId: string,
|
|
57
58
|
anthropicUrl: string | undefined,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
openai: { nonStreaming: ProviderTestState; streaming: ProviderTestState };
|
|
62
|
-
},
|
|
59
|
+
openaiChatUrl: string | undefined,
|
|
60
|
+
openaiResponsesUrl: string | undefined,
|
|
61
|
+
modelResults: ProviderModelTestResults,
|
|
63
62
|
captureFullDetails: boolean,
|
|
64
63
|
): Promise<void> {
|
|
65
64
|
const usageModel = getModelUsageName(displayName, providerName);
|
|
@@ -132,9 +131,9 @@ async function logModelResults(
|
|
|
132
131
|
}
|
|
133
132
|
}
|
|
134
133
|
|
|
135
|
-
if (
|
|
136
|
-
const nsResult = modelResults.
|
|
137
|
-
const sResult = modelResults.
|
|
134
|
+
if (openaiChatUrl !== undefined) {
|
|
135
|
+
const nsResult = modelResults.openaiChat.nonStreaming;
|
|
136
|
+
const sResult = modelResults.openaiChat.streaming;
|
|
138
137
|
if (hasSuccessField(nsResult) && hasSuccessField(sResult)) {
|
|
139
138
|
const nonStreamingResult = nsResult;
|
|
140
139
|
const streamingResult = sResult;
|
|
@@ -199,6 +198,76 @@ async function logModelResults(
|
|
|
199
198
|
});
|
|
200
199
|
}
|
|
201
200
|
}
|
|
201
|
+
|
|
202
|
+
if (openaiResponsesUrl !== undefined) {
|
|
203
|
+
const nsResult = modelResults.openaiResponses.nonStreaming;
|
|
204
|
+
const sResult = modelResults.openaiResponses.streaming;
|
|
205
|
+
if (hasSuccessField(nsResult) && hasSuccessField(sResult)) {
|
|
206
|
+
const nonStreamingResult = nsResult;
|
|
207
|
+
const streamingResult = sResult;
|
|
208
|
+
|
|
209
|
+
const requestBody = JSON.stringify(
|
|
210
|
+
buildProviderTestRequestBody(usageModel, "non-streaming", "responses"),
|
|
211
|
+
);
|
|
212
|
+
|
|
213
|
+
await addTestLogEntry({
|
|
214
|
+
timestamp: new Date().toISOString(),
|
|
215
|
+
method: "POST",
|
|
216
|
+
path: "/v1/responses",
|
|
217
|
+
model: nonStreamingResult.model ?? displayName,
|
|
218
|
+
sessionId: providerSessionId,
|
|
219
|
+
rawRequestBody: requestBody,
|
|
220
|
+
responseStatus: getResultResponseStatus(nonStreamingResult),
|
|
221
|
+
responseText: getResultResponseText(nonStreamingResult),
|
|
222
|
+
inputTokens: nonStreamingResult.inputTokens ?? null,
|
|
223
|
+
outputTokens: nonStreamingResult.outputTokens ?? null,
|
|
224
|
+
cacheCreationInputTokens: null,
|
|
225
|
+
cacheReadInputTokens: nonStreamingResult.cacheReadInputTokens ?? null,
|
|
226
|
+
elapsedMs: nonStreamingResult.latencyMs ?? 0,
|
|
227
|
+
firstChunkMs: null,
|
|
228
|
+
totalStreamMs: null,
|
|
229
|
+
tokensPerSecond: null,
|
|
230
|
+
streaming: false,
|
|
231
|
+
userAgent: "provider-test",
|
|
232
|
+
origin: null,
|
|
233
|
+
apiFormat: "openai",
|
|
234
|
+
isTest: true,
|
|
235
|
+
providerName,
|
|
236
|
+
headers: captureFullDetails ? getResultHeaders(nonStreamingResult) : undefined,
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
const streamingRequestBody = JSON.stringify(
|
|
240
|
+
buildProviderTestRequestBody(usageModel, "streaming", "responses"),
|
|
241
|
+
);
|
|
242
|
+
|
|
243
|
+
await addTestLogEntry({
|
|
244
|
+
timestamp: new Date().toISOString(),
|
|
245
|
+
method: "POST",
|
|
246
|
+
path: "/v1/responses",
|
|
247
|
+
model: streamingResult.model ?? displayName,
|
|
248
|
+
sessionId: providerSessionId,
|
|
249
|
+
rawRequestBody: streamingRequestBody,
|
|
250
|
+
responseStatus: getResultResponseStatus(streamingResult),
|
|
251
|
+
responseText: getResultResponseText(streamingResult),
|
|
252
|
+
inputTokens: streamingResult.inputTokens ?? null,
|
|
253
|
+
outputTokens: streamingResult.outputTokens ?? null,
|
|
254
|
+
cacheCreationInputTokens: null,
|
|
255
|
+
cacheReadInputTokens: streamingResult.cacheReadInputTokens ?? null,
|
|
256
|
+
elapsedMs: getResultTotalStreamMs(streamingResult) ?? 0,
|
|
257
|
+
firstChunkMs: getResultFirstChunkMs(streamingResult),
|
|
258
|
+
totalStreamMs: getResultTotalStreamMs(streamingResult),
|
|
259
|
+
tokensPerSecond: getResultTokensPerSecond(streamingResult),
|
|
260
|
+
streaming: true,
|
|
261
|
+
streamingChunks: captureFullDetails ? streamingResult.streamingChunks : undefined,
|
|
262
|
+
userAgent: "provider-test",
|
|
263
|
+
origin: null,
|
|
264
|
+
apiFormat: "openai",
|
|
265
|
+
isTest: true,
|
|
266
|
+
providerName,
|
|
267
|
+
headers: captureFullDetails ? getResultHeaders(streamingResult) : undefined,
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
}
|
|
202
271
|
}
|
|
203
272
|
|
|
204
273
|
export const Route = createFileRoute("/api/providers/$providerId/test/log")({
|
|
@@ -232,10 +301,15 @@ export const Route = createFileRoute("/api/providers/$providerId/test/log")({
|
|
|
232
301
|
provider.anthropicBaseUrl !== undefined && provider.anthropicBaseUrl.length > 0
|
|
233
302
|
? provider.anthropicBaseUrl
|
|
234
303
|
: undefined;
|
|
235
|
-
const
|
|
304
|
+
const openaiChatUrl =
|
|
236
305
|
provider.openaiBaseUrl !== undefined && provider.openaiBaseUrl.length > 0
|
|
237
306
|
? provider.openaiBaseUrl
|
|
238
307
|
: undefined;
|
|
308
|
+
const openaiResponsesUrl =
|
|
309
|
+
provider.openaiResponsesBaseUrl !== undefined &&
|
|
310
|
+
provider.openaiResponsesBaseUrl.length > 0
|
|
311
|
+
? provider.openaiResponsesBaseUrl
|
|
312
|
+
: undefined;
|
|
239
313
|
|
|
240
314
|
const entries: Promise<void>[] = [];
|
|
241
315
|
if (results.models !== undefined) {
|
|
@@ -246,7 +320,8 @@ export const Route = createFileRoute("/api/providers/$providerId/test/log")({
|
|
|
246
320
|
provider.name,
|
|
247
321
|
providerSessionId,
|
|
248
322
|
anthropicUrl,
|
|
249
|
-
|
|
323
|
+
openaiChatUrl,
|
|
324
|
+
openaiResponsesUrl,
|
|
250
325
|
modelResult,
|
|
251
326
|
captureFullDetails,
|
|
252
327
|
),
|