@tonyclaw/agent-inspector 2.0.1 → 2.0.3
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 +344 -53
- package/.output/nitro.json +1 -1
- package/.output/public/assets/{CompareDrawer-sVLGhCO3.js → CompareDrawer-D5A4bTfV.js} +1 -1
- package/.output/public/assets/ProxyViewerContainer-Da0jpBkp.js +101 -0
- package/.output/public/assets/{ReplayDialog-DxbFUqNW.js → ReplayDialog-CxUk_TF0.js} +1 -1
- package/.output/public/assets/{RequestAnatomy-CSmGQa_g.js → RequestAnatomy-DIlzjgjJ.js} +1 -1
- package/.output/public/assets/ResponseView-DQCuKJ1G.js +1 -0
- package/.output/public/assets/{StreamingChunkSequence-BzqpY0TN.js → StreamingChunkSequence-DHk4SGGL.js} +1 -1
- package/.output/public/assets/_sessionId-dY1TTl7N.js +1 -0
- package/.output/public/assets/index-D7wwbwly.css +1 -0
- package/.output/public/assets/index-FqQZbfl2.js +1 -0
- package/.output/public/assets/{json-viewer-CKNMihlh.js → json-viewer-BbU0n8eM.js} +1 -1
- package/.output/public/assets/{main-yWf8dv9w.js → main-CZT_F-gu.js} +2 -2
- package/.output/server/_libs/lucide-react.mjs +8 -8
- package/.output/server/{_sessionId-DfHd0gd8.mjs → _sessionId-B-s9P7fJ.mjs} +2 -2
- package/.output/server/_ssr/{CompareDrawer-DGYAUWgF.mjs → CompareDrawer-C08L3UOO.mjs} +4 -4
- package/.output/server/_ssr/{ProxyViewerContainer-fawglkTo.mjs → ProxyViewerContainer-CMWl3Ijy.mjs} +414 -70
- package/.output/server/_ssr/{ReplayDialog-B4vlKa2W.mjs → ReplayDialog-CPDo9_G5.mjs} +4 -4
- package/.output/server/_ssr/{RequestAnatomy-BNQvEIZK.mjs → RequestAnatomy-D9wt_K1E.mjs} +3 -3
- package/.output/server/_ssr/{ResponseView-X6X6G16_.mjs → ResponseView-DXaL7nY3.mjs} +4 -4
- package/.output/server/_ssr/{StreamingChunkSequence-BPVN3MnF.mjs → StreamingChunkSequence-B_hudZyb.mjs} +3 -3
- package/.output/server/_ssr/{index-CXmpc2X5.mjs → index-CuE_BN86.mjs} +2 -2
- package/.output/server/_ssr/index.mjs +2 -2
- package/.output/server/_ssr/{json-viewer-3XC3eq4R.mjs → json-viewer-Ci6kkjde.mjs} +2 -2
- package/.output/server/_ssr/{router-C0B2qvIM.mjs → router-BemxgIg7.mjs} +402 -131
- package/.output/server/{_tanstack-start-manifest_v-7tfsmd2I.mjs → _tanstack-start-manifest_v--L1_b4sd.mjs} +1 -1
- package/.output/server/index.mjs +62 -62
- package/README.md +50 -7
- package/package.json +3 -2
- package/scripts/setup-codex-skill.mjs +38 -0
- package/scripts/setup-windows-runtime.mjs +4 -3
- package/src/cli/onboard.ts +175 -68
- package/src/cli/templates/codex-skill-onboard.ts +210 -0
- package/src/components/providers/ProviderCard.tsx +2 -27
- package/src/components/providers/ProvidersPanel.tsx +16 -0
- package/src/components/proxy-viewer/AgentTraceSummary.tsx +218 -0
- package/src/components/proxy-viewer/ConversationGroup.tsx +6 -0
- package/src/components/proxy-viewer/ToolTraceEvents.tsx +33 -0
- package/src/components/proxy-viewer/TurnGroup.tsx +11 -1
- package/src/components/proxy-viewer/viewerState.ts +177 -0
- package/src/knowledge/openclawClient.ts +34 -5
- package/src/knowledge/openclawGatewayClient.ts +237 -0
- package/src/knowledge/openclawMarkdown.ts +146 -0
- package/src/lib/providerTestPrompt.ts +78 -0
- package/src/proxy/chunkStorage.ts +3 -4
- package/src/proxy/logger.ts +8 -15
- package/src/proxy/store.ts +8 -16
- package/src/routes/api/providers.$providerId.test.log.ts +7 -99
- package/.output/public/assets/ProxyViewerContainer-p9QvzZ6U.js +0 -101
- package/.output/public/assets/ResponseView-B5f89c8Z.js +0 -1
- package/.output/public/assets/_sessionId-BF7ftHV3.js +0 -1
- package/.output/public/assets/index-BU0PpLby.js +0 -1
- package/.output/public/assets/index-CpWG2hFn.css +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createFileRoute } from "@tanstack/react-router";
|
|
2
2
|
import { getProvider, getModelUsageName } from "../../proxy/providers";
|
|
3
|
-
import { appendLogEntry } from "../../proxy/logger";
|
|
4
3
|
import { addTestLogEntry } from "../../proxy/store";
|
|
4
|
+
import { buildProviderTestRequestBody } from "../../lib/providerTestPrompt";
|
|
5
5
|
import {
|
|
6
6
|
ProviderTestResultsSchema,
|
|
7
7
|
type ProviderTestResult as TestResult,
|
|
@@ -12,38 +12,6 @@ function hasSuccessField(result: ProviderTestState): result is TestResult {
|
|
|
12
12
|
return Object.prototype.hasOwnProperty.call(result, "success");
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
function createTestLogEntry(
|
|
16
|
-
providerName: string,
|
|
17
|
-
path: string,
|
|
18
|
-
body: string,
|
|
19
|
-
upstreamUrl: string,
|
|
20
|
-
result: TestResult,
|
|
21
|
-
isTest: boolean,
|
|
22
|
-
): Record<string, unknown> {
|
|
23
|
-
return {
|
|
24
|
-
timestamp: new Date().toISOString(),
|
|
25
|
-
id: `test-${Date.now()}`,
|
|
26
|
-
method: "POST",
|
|
27
|
-
path,
|
|
28
|
-
model: isTest ? result.model : undefined,
|
|
29
|
-
sessionId: null,
|
|
30
|
-
rawRequestBody: body,
|
|
31
|
-
responseStatus: result.success ? 200 : 500,
|
|
32
|
-
responseText: result.rawResponse ?? JSON.stringify(result),
|
|
33
|
-
inputTokens: result.inputTokens ?? null,
|
|
34
|
-
outputTokens: result.outputTokens ?? null,
|
|
35
|
-
elapsedMs: result.latencyMs ?? 0,
|
|
36
|
-
streaming: result.streaming ?? false,
|
|
37
|
-
userAgent: "provider-test",
|
|
38
|
-
origin: null,
|
|
39
|
-
upstreamUrl,
|
|
40
|
-
error: result.success ? null : (result.error?.message ?? String(result.error)),
|
|
41
|
-
isTest: true,
|
|
42
|
-
providerName,
|
|
43
|
-
headers: result.requestHeaders ?? {},
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
|
|
47
15
|
async function logModelResults(
|
|
48
16
|
displayName: string,
|
|
49
17
|
providerName: string,
|
|
@@ -63,12 +31,7 @@ async function logModelResults(
|
|
|
63
31
|
const nonStreamingResult = nsResult;
|
|
64
32
|
const streamingResult = sResult;
|
|
65
33
|
|
|
66
|
-
const requestBody = JSON.stringify(
|
|
67
|
-
model: usageModel,
|
|
68
|
-
messages: [{ role: "user", content: "say hello and briefly introduce yourself" }],
|
|
69
|
-
max_tokens: 1024,
|
|
70
|
-
});
|
|
71
|
-
const upstreamUrl = `${anthropicUrl}/v1/messages`;
|
|
34
|
+
const requestBody = JSON.stringify(buildProviderTestRequestBody(usageModel, "non-streaming"));
|
|
72
35
|
|
|
73
36
|
await addTestLogEntry({
|
|
74
37
|
timestamp: new Date().toISOString(),
|
|
@@ -93,24 +56,10 @@ async function logModelResults(
|
|
|
93
56
|
headers: nonStreamingResult.requestHeaders ?? {},
|
|
94
57
|
});
|
|
95
58
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
providerName,
|
|
99
|
-
"/v1/messages",
|
|
100
|
-
requestBody,
|
|
101
|
-
upstreamUrl,
|
|
102
|
-
nonStreamingResult,
|
|
103
|
-
true,
|
|
104
|
-
),
|
|
59
|
+
const streamingRequestBody = JSON.stringify(
|
|
60
|
+
buildProviderTestRequestBody(usageModel, "streaming"),
|
|
105
61
|
);
|
|
106
62
|
|
|
107
|
-
const streamingRequestBody = JSON.stringify({
|
|
108
|
-
model: usageModel,
|
|
109
|
-
messages: [{ role: "user", content: "say hello" }],
|
|
110
|
-
max_tokens: 256,
|
|
111
|
-
stream: true,
|
|
112
|
-
});
|
|
113
|
-
|
|
114
63
|
await addTestLogEntry({
|
|
115
64
|
timestamp: new Date().toISOString(),
|
|
116
65
|
method: "POST",
|
|
@@ -134,17 +83,6 @@ async function logModelResults(
|
|
|
134
83
|
providerName,
|
|
135
84
|
headers: streamingResult.requestHeaders ?? {},
|
|
136
85
|
});
|
|
137
|
-
|
|
138
|
-
appendLogEntry(
|
|
139
|
-
createTestLogEntry(
|
|
140
|
-
providerName,
|
|
141
|
-
"/v1/messages",
|
|
142
|
-
streamingRequestBody,
|
|
143
|
-
upstreamUrl,
|
|
144
|
-
streamingResult,
|
|
145
|
-
true,
|
|
146
|
-
),
|
|
147
|
-
);
|
|
148
86
|
}
|
|
149
87
|
}
|
|
150
88
|
|
|
@@ -155,12 +93,7 @@ async function logModelResults(
|
|
|
155
93
|
const nonStreamingResult = nsResult;
|
|
156
94
|
const streamingResult = sResult;
|
|
157
95
|
|
|
158
|
-
const requestBody = JSON.stringify(
|
|
159
|
-
model: usageModel,
|
|
160
|
-
messages: [{ role: "user", content: "say hello and briefly introduce yourself" }],
|
|
161
|
-
max_tokens: 1024,
|
|
162
|
-
});
|
|
163
|
-
const upstreamUrl = `${openaiUrl}/v1/chat/completions`;
|
|
96
|
+
const requestBody = JSON.stringify(buildProviderTestRequestBody(usageModel, "non-streaming"));
|
|
164
97
|
|
|
165
98
|
await addTestLogEntry({
|
|
166
99
|
timestamp: new Date().toISOString(),
|
|
@@ -185,24 +118,10 @@ async function logModelResults(
|
|
|
185
118
|
headers: nonStreamingResult.requestHeaders ?? {},
|
|
186
119
|
});
|
|
187
120
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
providerName,
|
|
191
|
-
"/v1/chat/completions",
|
|
192
|
-
requestBody,
|
|
193
|
-
upstreamUrl,
|
|
194
|
-
nonStreamingResult,
|
|
195
|
-
true,
|
|
196
|
-
),
|
|
121
|
+
const streamingRequestBody = JSON.stringify(
|
|
122
|
+
buildProviderTestRequestBody(usageModel, "streaming"),
|
|
197
123
|
);
|
|
198
124
|
|
|
199
|
-
const streamingRequestBody = JSON.stringify({
|
|
200
|
-
model: usageModel,
|
|
201
|
-
messages: [{ role: "user", content: "say hello" }],
|
|
202
|
-
max_tokens: 256,
|
|
203
|
-
stream: true,
|
|
204
|
-
});
|
|
205
|
-
|
|
206
125
|
await addTestLogEntry({
|
|
207
126
|
timestamp: new Date().toISOString(),
|
|
208
127
|
method: "POST",
|
|
@@ -226,17 +145,6 @@ async function logModelResults(
|
|
|
226
145
|
providerName,
|
|
227
146
|
headers: streamingResult.requestHeaders ?? {},
|
|
228
147
|
});
|
|
229
|
-
|
|
230
|
-
appendLogEntry(
|
|
231
|
-
createTestLogEntry(
|
|
232
|
-
providerName,
|
|
233
|
-
"/v1/chat/completions",
|
|
234
|
-
streamingRequestBody,
|
|
235
|
-
upstreamUrl,
|
|
236
|
-
streamingResult,
|
|
237
|
-
true,
|
|
238
|
-
),
|
|
239
|
-
);
|
|
240
148
|
}
|
|
241
149
|
}
|
|
242
150
|
}
|