@tonyclaw/agent-inspector 2.1.18 → 2.1.20
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/nitro.json +1 -1
- package/.output/public/assets/{CompareDrawer-Fqqw5Lci.js → CompareDrawer-BRCSDHn3.js} +1 -1
- package/.output/public/assets/ProxyViewerContainer-v5Lmx35X.js +106 -0
- package/.output/public/assets/{ReplayDialog-hYhz_i6W.js → ReplayDialog-Dkez3vxu.js} +1 -1
- package/.output/public/assets/{RequestAnatomy-CTuWbtwC.js → RequestAnatomy-CHBODGDF.js} +1 -1
- package/.output/public/assets/{ResponseView-CsZ7S5Gv.js → ResponseView-Dk2dJY-B.js} +2 -2
- package/.output/public/assets/{StreamingChunkSequence-PIbJMotU.js → StreamingChunkSequence-gZpqWwKK.js} +1 -1
- package/.output/public/assets/_sessionId-DziA4ZD4.js +1 -0
- package/.output/public/assets/{index-F7mynwuH.js → index-B1-V3HCD.js} +1 -1
- package/.output/public/assets/index-ChgjUix0.css +1 -0
- package/.output/public/assets/index-DkHcxpXi.js +1 -0
- package/.output/public/assets/{json-viewer-DCXtNmmD.js → json-viewer-CtvzeDPb.js} +1 -1
- package/.output/public/assets/{main-BJZf7_Ib.js → main-CgmDEMGA.js} +2 -2
- package/.output/server/{_sessionId-DjSHDNh8.mjs → _sessionId-CbsSRLSa.mjs} +2 -2
- package/.output/server/_ssr/{CompareDrawer-Dal52IFo.mjs → CompareDrawer-BiSslksi.mjs} +2 -2
- package/.output/server/_ssr/{ProxyViewerContainer-CVqFZGff.mjs → ProxyViewerContainer-DIN2AjhM.mjs} +216 -183
- package/.output/server/_ssr/{ReplayDialog-BOEgdMes.mjs → ReplayDialog-DzoWpTis.mjs} +3 -3
- package/.output/server/_ssr/{RequestAnatomy-gch7_vCV.mjs → RequestAnatomy-D2tbgAPn.mjs} +2 -2
- package/.output/server/_ssr/{ResponseView-lEWPy-H4.mjs → ResponseView-BFP7zo8Z.mjs} +2 -2
- package/.output/server/_ssr/{StreamingChunkSequence-DnudbJ1O.mjs → StreamingChunkSequence-BfiRZW_k.mjs} +2 -2
- package/.output/server/_ssr/{index-Cza8zDrW.mjs → index-OlcgE4Tl.mjs} +2 -2
- package/.output/server/_ssr/index.mjs +2 -2
- package/.output/server/_ssr/{json-viewer-C2lIVEX3.mjs → json-viewer-DmhEr-jg.mjs} +2 -2
- package/.output/server/_ssr/{router-bF9uzd1k.mjs → router-BMdwHLHh.mjs} +80 -21
- package/.output/server/{_tanstack-start-manifest_v-ErvW-mtr.mjs → _tanstack-start-manifest_v-CL4qjwkQ.mjs} +1 -1
- package/.output/server/index.mjs +77 -77
- package/package.json +1 -1
- package/src/components/groups/GroupsDialog.tsx +71 -10
- package/src/components/proxy-viewer/ConversationGroupList.tsx +11 -11
- package/src/components/proxy-viewer/ConversationHeader.tsx +7 -7
- package/src/components/proxy-viewer/LogEntry.tsx +15 -26
- package/src/components/proxy-viewer/LogEntryHeader.tsx +11 -14
- package/src/components/proxy-viewer/RequestToolsPanel.tsx +15 -15
- package/src/components/proxy-viewer/ThreadConnector.tsx +3 -3
- package/src/components/proxy-viewer/ToolTraceEvents.tsx +1 -1
- package/src/components/proxy-viewer/TurnGroup.tsx +10 -14
- package/src/lib/groupContract.ts +6 -0
- package/src/proxy/groupStore.ts +24 -0
- package/src/routes/api/groups.ts +41 -1
- package/src/services/groups.ts +8 -0
- package/.output/public/assets/ProxyViewerContainer-CP_RzwW9.js +0 -106
- package/.output/public/assets/_sessionId-CUGA9qU3.js +0 -1
- package/.output/public/assets/index-G4dTUobw.js +0 -1
- package/.output/public/assets/index-gvYkgMPF.css +0 -1
package/src/proxy/groupStore.ts
CHANGED
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
type CreateInspectorGroupInput,
|
|
13
13
|
type DeleteInspectorGroupOptions,
|
|
14
14
|
type DeleteInspectorGroupResponse,
|
|
15
|
+
type DeleteInspectorGroupsResponse,
|
|
15
16
|
type InspectorGroup,
|
|
16
17
|
type InspectorGroupEvidence,
|
|
17
18
|
type InspectorGroupMember,
|
|
@@ -203,6 +204,29 @@ export function deleteGroup(
|
|
|
203
204
|
};
|
|
204
205
|
}
|
|
205
206
|
|
|
207
|
+
export function deleteGroups(
|
|
208
|
+
options: DeleteInspectorGroupOptions = {},
|
|
209
|
+
): DeleteInspectorGroupsResponse {
|
|
210
|
+
const parsed = DeleteInspectorGroupOptionsSchema.parse(options);
|
|
211
|
+
const groups = readGroups();
|
|
212
|
+
const deletedGroups = groups.map((group) => {
|
|
213
|
+
const evidencePath = evidenceDirectoryFor(group);
|
|
214
|
+
return {
|
|
215
|
+
groupId: group.id,
|
|
216
|
+
deleted: true,
|
|
217
|
+
evidenceDeleted: removeEvidenceDirectory(evidencePath, parsed.deleteEvidence === true),
|
|
218
|
+
evidencePath,
|
|
219
|
+
};
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
writeGroups([]);
|
|
223
|
+
|
|
224
|
+
return {
|
|
225
|
+
deleted: deletedGroups.length,
|
|
226
|
+
groups: deletedGroups,
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
|
|
206
230
|
function matchesExistingMember(
|
|
207
231
|
member: InspectorGroupMember,
|
|
208
232
|
memberId: string,
|
package/src/routes/api/groups.ts
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { createFileRoute } from "@tanstack/react-router";
|
|
2
2
|
import { CreateInspectorGroupInputSchema } from "../../lib/groupContract";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
createInspectorGroup,
|
|
5
|
+
deleteInspectorGroups,
|
|
6
|
+
listInspectorGroups,
|
|
7
|
+
} from "../../services/groups";
|
|
4
8
|
|
|
5
9
|
type JsonBodyResult = { ok: true; value: unknown } | { ok: false };
|
|
10
|
+
type DeleteEvidenceFlagResult = { ok: true; value: boolean | undefined } | { ok: false };
|
|
6
11
|
|
|
7
12
|
async function readJsonBody(request: Request): Promise<JsonBodyResult> {
|
|
8
13
|
try {
|
|
@@ -14,6 +19,26 @@ async function readJsonBody(request: Request): Promise<JsonBodyResult> {
|
|
|
14
19
|
}
|
|
15
20
|
}
|
|
16
21
|
|
|
22
|
+
function readDeleteEvidenceFlag(request: Request): DeleteEvidenceFlagResult {
|
|
23
|
+
try {
|
|
24
|
+
const value = new URL(request.url).searchParams.get("deleteEvidence");
|
|
25
|
+
switch (value) {
|
|
26
|
+
case null:
|
|
27
|
+
return { ok: true, value: undefined };
|
|
28
|
+
case "1":
|
|
29
|
+
case "true":
|
|
30
|
+
return { ok: true, value: true };
|
|
31
|
+
case "0":
|
|
32
|
+
case "false":
|
|
33
|
+
return { ok: true, value: false };
|
|
34
|
+
default:
|
|
35
|
+
return { ok: false };
|
|
36
|
+
}
|
|
37
|
+
} catch {
|
|
38
|
+
return { ok: false };
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
17
42
|
export const Route = createFileRoute("/api/groups")({
|
|
18
43
|
server: {
|
|
19
44
|
handlers: {
|
|
@@ -34,6 +59,21 @@ export const Route = createFileRoute("/api/groups")({
|
|
|
34
59
|
|
|
35
60
|
return Response.json(createInspectorGroup(parsed.data), { status: 201 });
|
|
36
61
|
},
|
|
62
|
+
DELETE: ({ request }: { request: Request }) => {
|
|
63
|
+
const deleteEvidence = readDeleteEvidenceFlag(request);
|
|
64
|
+
if (!deleteEvidence.ok) {
|
|
65
|
+
return Response.json(
|
|
66
|
+
{ error: "deleteEvidence must be one of true, false, 1, or 0" },
|
|
67
|
+
{ status: 400 },
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return Response.json(
|
|
72
|
+
deleteInspectorGroups({
|
|
73
|
+
deleteEvidence: deleteEvidence.value,
|
|
74
|
+
}),
|
|
75
|
+
);
|
|
76
|
+
},
|
|
37
77
|
},
|
|
38
78
|
},
|
|
39
79
|
});
|
package/src/services/groups.ts
CHANGED
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
type CreateInspectorGroupInput,
|
|
4
4
|
type DeleteInspectorGroupOptions,
|
|
5
5
|
type DeleteInspectorGroupResponse,
|
|
6
|
+
type DeleteInspectorGroupsResponse,
|
|
6
7
|
type GroupEvidenceExportOptions,
|
|
7
8
|
type GroupEvidenceExportResult,
|
|
8
9
|
type GroupEvidenceReadResponse,
|
|
@@ -20,6 +21,7 @@ import {
|
|
|
20
21
|
addGroupSession,
|
|
21
22
|
createGroup,
|
|
22
23
|
deleteGroup,
|
|
24
|
+
deleteGroups,
|
|
23
25
|
getGroup,
|
|
24
26
|
listGroups,
|
|
25
27
|
updateGroup,
|
|
@@ -63,6 +65,12 @@ export function deleteInspectorGroup(
|
|
|
63
65
|
return serviceOk(result);
|
|
64
66
|
}
|
|
65
67
|
|
|
68
|
+
export function deleteInspectorGroups(
|
|
69
|
+
options: DeleteInspectorGroupOptions,
|
|
70
|
+
): DeleteInspectorGroupsResponse {
|
|
71
|
+
return deleteGroups(options);
|
|
72
|
+
}
|
|
73
|
+
|
|
66
74
|
export function readInspectorGroupSessions(groupId: string): ServiceResult<GroupSessionsRead> {
|
|
67
75
|
const group = getGroup(groupId);
|
|
68
76
|
if (group === null) return serviceError("not-found", 404, "Group not found");
|