@tonyclaw/agent-inspector 2.0.26 → 2.0.28
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 +169 -13
- package/.output/nitro.json +1 -1
- package/.output/public/assets/{CompareDrawer-DBTFzxG5.js → CompareDrawer-CicCP3Hb.js} +1 -1
- package/.output/public/assets/{ProxyViewerContainer-ivZk8MgE.js → ProxyViewerContainer-BccuA6p5.js} +4 -4
- package/.output/public/assets/{ReplayDialog-syW2hDNE.js → ReplayDialog-Bc8q3ujm.js} +1 -1
- package/.output/public/assets/{RequestAnatomy-BkuRtY9o.js → RequestAnatomy-Coyy3zcH.js} +1 -1
- package/.output/public/assets/{ResponseView-BwyvEvoE.js → ResponseView-BWJzgh0c.js} +1 -1
- package/.output/public/assets/{StreamingChunkSequence-BY4MbPKg.js → StreamingChunkSequence-BSC3uuE5.js} +1 -1
- package/.output/public/assets/_sessionId-9rEF0uSE.js +1 -0
- package/.output/public/assets/index-B9_VaAWl.js +1 -0
- package/.output/public/assets/{main-DKRDRBdd.js → main-Brj0Gn91.js} +2 -2
- package/.output/server/_libs/modelcontextprotocol__server.mjs +228 -0
- package/.output/server/{_sessionId-VDd4N_1B.mjs → _sessionId-DDdyKVG-.mjs} +3 -3
- package/.output/server/_ssr/{CompareDrawer-BQZlxsOC.mjs → CompareDrawer-XSExe2ml.mjs} +2 -2
- package/.output/server/_ssr/{ProxyViewerContainer-njY2oQCc.mjs → ProxyViewerContainer-B5pIiBZN.mjs} +7 -7
- package/.output/server/_ssr/{ReplayDialog-B8lkdAIh.mjs → ReplayDialog-BOAu0ric.mjs} +3 -3
- package/.output/server/_ssr/{RequestAnatomy-CwOTfdwS.mjs → RequestAnatomy-C8Q5lozD.mjs} +2 -2
- package/.output/server/_ssr/{ResponseView-3Iz_mZpd.mjs → ResponseView-a_iJfPUF.mjs} +2 -2
- package/.output/server/_ssr/{StreamingChunkSequence-hmJcQNW5.mjs → StreamingChunkSequence-YMKC0j8U.mjs} +2 -2
- package/.output/server/_ssr/{index-UuTKM4aC.mjs → index-CkDwBPzI.mjs} +2 -2
- package/.output/server/_ssr/index.mjs +2 -2
- package/.output/server/_ssr/{router-C7InHrxE.mjs → router-DXOXdFFM.mjs} +1816 -151
- package/.output/server/_tanstack-start-manifest_v-DPf3uJys.mjs +4 -0
- package/.output/server/index.mjs +64 -64
- package/README.md +55 -1
- package/package.json +1 -1
- package/src/cli/networkHints.ts +150 -0
- package/src/cli.ts +72 -13
- package/src/lib/runContract.ts +162 -0
- package/src/mcp/server.ts +554 -2
- package/src/mcp/toolHandlers.ts +154 -0
- package/src/proxy/evidenceAnalysis.ts +522 -0
- package/src/proxy/evidenceExporter.ts +215 -0
- package/src/proxy/logSearch.ts +118 -0
- package/src/proxy/runFailures.ts +100 -0
- package/src/proxy/runStore.ts +159 -0
- package/src/routes/api/logs.ts +16 -0
- package/src/routes/api/runs.$runId.evidence.ts +62 -0
- package/src/routes/api/runs.$runId.ts +50 -0
- package/src/routes/api/runs.ts +58 -0
- package/.output/public/assets/_sessionId-XlPUgIIb.js +0 -1
- package/.output/public/assets/index-By11a28-.js +0 -1
- package/.output/server/_tanstack-start-manifest_v-B6yfnMHA.mjs +0 -4
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { JsonValueSchema } from "../proxy/schemas";
|
|
3
|
+
import { SessionInfoSchema } from "./sessionInfoContract";
|
|
4
|
+
|
|
5
|
+
export const InspectorRunStatusSchema = z.enum([
|
|
6
|
+
"created",
|
|
7
|
+
"running",
|
|
8
|
+
"completed",
|
|
9
|
+
"failed",
|
|
10
|
+
"cancelled",
|
|
11
|
+
]);
|
|
12
|
+
|
|
13
|
+
export const InspectorRunEvidenceSchema = z.object({
|
|
14
|
+
jsonPath: z.string(),
|
|
15
|
+
markdownPath: z.string(),
|
|
16
|
+
htmlPath: z.string(),
|
|
17
|
+
exportedAt: z.string(),
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export const RunTimelineEventKindSchema = z.enum([
|
|
21
|
+
"run-created",
|
|
22
|
+
"session-started",
|
|
23
|
+
"request",
|
|
24
|
+
"session-finished",
|
|
25
|
+
"evidence-exported",
|
|
26
|
+
]);
|
|
27
|
+
|
|
28
|
+
export const RunTimelineEventSeveritySchema = z.enum(["info", "success", "warning", "error"]);
|
|
29
|
+
|
|
30
|
+
export const RunTimelineEventSchema = z.object({
|
|
31
|
+
timestamp: z.string(),
|
|
32
|
+
kind: RunTimelineEventKindSchema,
|
|
33
|
+
severity: RunTimelineEventSeveritySchema,
|
|
34
|
+
title: z.string(),
|
|
35
|
+
details: z.string(),
|
|
36
|
+
logId: z.number().int().positive().nullable(),
|
|
37
|
+
status: z.number().nullable(),
|
|
38
|
+
model: z.string().nullable(),
|
|
39
|
+
provider: z.string().nullable(),
|
|
40
|
+
latencyMs: z.number().nullable(),
|
|
41
|
+
isStreaming: z.boolean().nullable(),
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
export const FailureCategorySchema = z.enum([
|
|
45
|
+
"none",
|
|
46
|
+
"active",
|
|
47
|
+
"provider-timeout",
|
|
48
|
+
"provider-http-error",
|
|
49
|
+
"provider-auth-error",
|
|
50
|
+
"provider-rate-limit",
|
|
51
|
+
"network-or-container",
|
|
52
|
+
"streaming-mismatch",
|
|
53
|
+
"context-pressure",
|
|
54
|
+
"runtime-task-error",
|
|
55
|
+
"model-output-error",
|
|
56
|
+
"unknown-failure",
|
|
57
|
+
"no-session-data",
|
|
58
|
+
]);
|
|
59
|
+
|
|
60
|
+
export const FailureClassificationSchema = z.object({
|
|
61
|
+
outcome: z.enum(["success", "failure", "active", "unknown"]),
|
|
62
|
+
severity: z.enum(["none", "low", "medium", "high"]),
|
|
63
|
+
category: FailureCategorySchema,
|
|
64
|
+
summary: z.string(),
|
|
65
|
+
evidenceLogIds: z.array(z.number().int().positive()),
|
|
66
|
+
hints: z.array(z.string()),
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
export const JenkinsReportSchema = z.object({
|
|
70
|
+
status: z.enum(["PASS", "FAIL", "RUNNING", "UNKNOWN"]),
|
|
71
|
+
summary: z.string(),
|
|
72
|
+
markdown: z.string(),
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
export const InspectorRunSchema = z.object({
|
|
76
|
+
id: z.string(),
|
|
77
|
+
sessionId: z.string(),
|
|
78
|
+
title: z.string(),
|
|
79
|
+
task: z.string().nullable(),
|
|
80
|
+
project: z.string().nullable(),
|
|
81
|
+
agent: z.string().nullable(),
|
|
82
|
+
status: InspectorRunStatusSchema,
|
|
83
|
+
tags: z.array(z.string()),
|
|
84
|
+
metadata: z.record(z.string(), JsonValueSchema),
|
|
85
|
+
evidence: InspectorRunEvidenceSchema.nullable(),
|
|
86
|
+
createdAt: z.string(),
|
|
87
|
+
updatedAt: z.string(),
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
export const CreateInspectorRunInputSchema = z
|
|
91
|
+
.object({
|
|
92
|
+
runId: z.string().min(1).optional(),
|
|
93
|
+
sessionId: z.string().min(1).optional(),
|
|
94
|
+
title: z.string().min(1).optional(),
|
|
95
|
+
task: z.string().nullable().optional(),
|
|
96
|
+
project: z.string().nullable().optional(),
|
|
97
|
+
agent: z.string().nullable().optional(),
|
|
98
|
+
status: InspectorRunStatusSchema.optional(),
|
|
99
|
+
tags: z.array(z.string()).optional(),
|
|
100
|
+
metadata: z.record(z.string(), JsonValueSchema).optional(),
|
|
101
|
+
})
|
|
102
|
+
.optional();
|
|
103
|
+
|
|
104
|
+
export const UpdateInspectorRunInputSchema = z.object({
|
|
105
|
+
sessionId: z.string().min(1).optional(),
|
|
106
|
+
title: z.string().min(1).optional(),
|
|
107
|
+
task: z.string().nullable().optional(),
|
|
108
|
+
project: z.string().nullable().optional(),
|
|
109
|
+
agent: z.string().nullable().optional(),
|
|
110
|
+
status: InspectorRunStatusSchema.optional(),
|
|
111
|
+
tags: z.array(z.string()).optional(),
|
|
112
|
+
metadata: z.record(z.string(), JsonValueSchema).optional(),
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
export const EvidenceExportOptionsSchema = z
|
|
116
|
+
.object({
|
|
117
|
+
includeHistory: z.boolean().optional(),
|
|
118
|
+
latestLogLimit: z.number().int().positive().max(50).optional(),
|
|
119
|
+
})
|
|
120
|
+
.optional();
|
|
121
|
+
|
|
122
|
+
export const EvidenceExportResultSchema = z.object({
|
|
123
|
+
run: InspectorRunSchema,
|
|
124
|
+
evidence: InspectorRunEvidenceSchema,
|
|
125
|
+
session: SessionInfoSchema.nullable(),
|
|
126
|
+
timeline: z.array(RunTimelineEventSchema),
|
|
127
|
+
classification: FailureClassificationSchema,
|
|
128
|
+
jenkinsReport: JenkinsReportSchema,
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
export const RecentFailureSchema = z.object({
|
|
132
|
+
run: InspectorRunSchema,
|
|
133
|
+
classification: FailureClassificationSchema,
|
|
134
|
+
evidence: InspectorRunEvidenceSchema.nullable(),
|
|
135
|
+
jenkinsReport: JenkinsReportSchema.nullable(),
|
|
136
|
+
sessionId: z.string(),
|
|
137
|
+
inspectorUrl: z.string().nullable(),
|
|
138
|
+
evidenceMarkdownPath: z.string().nullable(),
|
|
139
|
+
updatedAt: z.string(),
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
export const RecentFailuresResponseSchema = z.object({
|
|
143
|
+
failures: z.array(RecentFailureSchema),
|
|
144
|
+
total: z.number().int().nonnegative(),
|
|
145
|
+
limit: z.number().int().positive(),
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
export type InspectorRunStatus = z.infer<typeof InspectorRunStatusSchema>;
|
|
149
|
+
export type InspectorRunEvidence = z.infer<typeof InspectorRunEvidenceSchema>;
|
|
150
|
+
export type RunTimelineEventKind = z.infer<typeof RunTimelineEventKindSchema>;
|
|
151
|
+
export type RunTimelineEventSeverity = z.infer<typeof RunTimelineEventSeveritySchema>;
|
|
152
|
+
export type RunTimelineEvent = z.infer<typeof RunTimelineEventSchema>;
|
|
153
|
+
export type FailureCategory = z.infer<typeof FailureCategorySchema>;
|
|
154
|
+
export type FailureClassification = z.infer<typeof FailureClassificationSchema>;
|
|
155
|
+
export type JenkinsReport = z.infer<typeof JenkinsReportSchema>;
|
|
156
|
+
export type InspectorRun = z.infer<typeof InspectorRunSchema>;
|
|
157
|
+
export type CreateInspectorRunInput = z.infer<typeof CreateInspectorRunInputSchema>;
|
|
158
|
+
export type UpdateInspectorRunInput = z.infer<typeof UpdateInspectorRunInputSchema>;
|
|
159
|
+
export type EvidenceExportOptions = z.infer<typeof EvidenceExportOptionsSchema>;
|
|
160
|
+
export type EvidenceExportResult = z.infer<typeof EvidenceExportResultSchema>;
|
|
161
|
+
export type RecentFailure = z.infer<typeof RecentFailureSchema>;
|
|
162
|
+
export type RecentFailuresResponse = z.infer<typeof RecentFailuresResponseSchema>;
|