agenttrace-journal 0.0.0-stage → 0.1.0
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/LICENSE +21 -0
- package/README.md +73 -2
- package/bin/agenttrace.js +32 -0
- package/bin/server.js +197 -0
- package/dist/capture.d.ts +6 -0
- package/dist/capture.js +69 -0
- package/dist/files.d.ts +1 -0
- package/dist/files.js +37 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.js +246 -0
- package/dist/store.d.ts +12 -0
- package/dist/store.js +42 -0
- package/dist/types.d.ts +109 -0
- package/dist/types.js +1 -0
- package/package.json +34 -4
- package/viewer/app.js +481 -0
- package/viewer/index.html +341 -0
- package/viewer/style.css +97 -0
- package/viewer/trace-data.js +124 -0
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@300..800&family=Inter+Tight:wght@400..800&family=Instrument+Serif:ital@0;1&family=JetBrains+Mono:wght@400..700&family=DM+Sans:opsz,wght@9..40,300..800&family=Space+Grotesk:wght@300..700&family=Playfair+Display:wght@400..800&family=Geist:wght@300..800&family=Geist+Mono&family=Manrope:wght@300..800&family=Fraunces:opsz,wght@9..144,300..800&display=swap">
|
|
7
|
+
<title>AgentTrace</title>
|
|
8
|
+
<link rel="stylesheet" href="/style.css">
|
|
9
|
+
<script type="module" src="/app.js"></script>
|
|
10
|
+
</head>
|
|
11
|
+
<body>
|
|
12
|
+
<div id="initial-loading" class="__root __fill" style="min-width:1440px">
|
|
13
|
+
<div data-frame="Viewer – Loading" style="width: 1440px; height: 900px; background: #ffffff; position: relative; overflow: hidden; display: flex; flex-direction: column">
|
|
14
|
+
<div data-name="App" class="pa" style="width: 100%; height: 900px; display: flex; flex-direction: column; background: var(--bg); overflow: hidden">
|
|
15
|
+
<div style="height: 48px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border-bottom: 1px solid var(--border)">
|
|
16
|
+
<div style="display: flex; align-items: center; gap: 8px">
|
|
17
|
+
<svg width="20" height="20" viewBox="0 0 22 22"><rect x="2" y="12" width="4" height="8" fill="#000"></rect><rect x="9" y="7" width="4" height="13" fill="#000"></rect><rect x="16" y="2" width="4" height="18" fill="#00d603"></rect></svg>
|
|
18
|
+
<span style="font: 600 15px/1 var(--font-sans); letter-spacing: -.01em">AgentTrace</span>
|
|
19
|
+
</div>
|
|
20
|
+
<span class="mono" style="font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 8px">
|
|
21
|
+
<svg class="spin" width="14" height="14" viewBox="0 0 14 14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"><path d="M7 1.5a5.5 5.5 0 1 1-5.5 5.5"></path></svg>
|
|
22
|
+
Reading traces…
|
|
23
|
+
</span>
|
|
24
|
+
</div>
|
|
25
|
+
<div style="display: flex; flex: 1; min-height: 0">
|
|
26
|
+
<aside style="width: 320px; flex: none; border-right: 1px solid var(--border); padding-top: 16px; display: flex; flex-direction: column">
|
|
27
|
+
<div style="padding: 0 24px 12px"><span style="font: 600 14px/1 var(--font-sans)">Runs</span></div>
|
|
28
|
+
<div class="inp">
|
|
29
|
+
<svg data-icon="search" width="16" height="16" viewBox="0 0 24 24" fill="none"><path d="M17 17L21 21" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M19 11C19 6.58172 15.4183 3 11 3C6.58172 3 3 6.58172 3 11C3 15.4183 6.58172 19 11 19C15.4183 19 19 15.4183 19 11Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path></svg>
|
|
30
|
+
Search by run name or ID
|
|
31
|
+
</div>
|
|
32
|
+
<div style="height: 12px"></div>
|
|
33
|
+
<div class="pl" style="display: flex; flex-direction: column">
|
|
34
|
+
<div style="height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px">
|
|
35
|
+
<div>
|
|
36
|
+
<div class="sk" style="width: 150px; height: 13px"></div>
|
|
37
|
+
<div class="sk" style="width: 84px; height: 10px; margin-top: 10px"></div>
|
|
38
|
+
</div>
|
|
39
|
+
<div class="sk" style="width: 62px; height: 11px"></div>
|
|
40
|
+
</div>
|
|
41
|
+
<div style="height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px">
|
|
42
|
+
<div>
|
|
43
|
+
<div class="sk" style="width: 112px; height: 13px"></div>
|
|
44
|
+
<div class="sk" style="width: 84px; height: 10px; margin-top: 10px"></div>
|
|
45
|
+
</div>
|
|
46
|
+
<div class="sk" style="width: 62px; height: 11px"></div>
|
|
47
|
+
</div>
|
|
48
|
+
<div style="height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px">
|
|
49
|
+
<div>
|
|
50
|
+
<div class="sk" style="width: 138px; height: 13px"></div>
|
|
51
|
+
<div class="sk" style="width: 84px; height: 10px; margin-top: 10px"></div>
|
|
52
|
+
</div>
|
|
53
|
+
<div class="sk" style="width: 62px; height: 11px"></div>
|
|
54
|
+
</div>
|
|
55
|
+
<div style="height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px">
|
|
56
|
+
<div>
|
|
57
|
+
<div class="sk" style="width: 164px; height: 13px"></div>
|
|
58
|
+
<div class="sk" style="width: 84px; height: 10px; margin-top: 10px"></div>
|
|
59
|
+
</div>
|
|
60
|
+
<div class="sk" style="width: 62px; height: 11px"></div>
|
|
61
|
+
</div>
|
|
62
|
+
<div style="height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px">
|
|
63
|
+
<div>
|
|
64
|
+
<div class="sk" style="width: 126px; height: 13px"></div>
|
|
65
|
+
<div class="sk" style="width: 84px; height: 10px; margin-top: 10px"></div>
|
|
66
|
+
</div>
|
|
67
|
+
<div class="sk" style="width: 62px; height: 11px"></div>
|
|
68
|
+
</div>
|
|
69
|
+
<div style="height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px">
|
|
70
|
+
<div>
|
|
71
|
+
<div class="sk" style="width: 146px; height: 13px"></div>
|
|
72
|
+
<div class="sk" style="width: 84px; height: 10px; margin-top: 10px"></div>
|
|
73
|
+
</div>
|
|
74
|
+
<div class="sk" style="width: 62px; height: 11px"></div>
|
|
75
|
+
</div>
|
|
76
|
+
<div style="height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px">
|
|
77
|
+
<div>
|
|
78
|
+
<div class="sk" style="width: 120px; height: 13px"></div>
|
|
79
|
+
<div class="sk" style="width: 84px; height: 10px; margin-top: 10px"></div>
|
|
80
|
+
</div>
|
|
81
|
+
<div class="sk" style="width: 62px; height: 11px"></div>
|
|
82
|
+
</div>
|
|
83
|
+
<div style="height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px">
|
|
84
|
+
<div>
|
|
85
|
+
<div class="sk" style="width: 156px; height: 13px"></div>
|
|
86
|
+
<div class="sk" style="width: 84px; height: 10px; margin-top: 10px"></div>
|
|
87
|
+
</div>
|
|
88
|
+
<div class="sk" style="width: 62px; height: 11px"></div>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
</aside>
|
|
92
|
+
<main class="pl" style="flex: 1; padding: 28px 32px 0">
|
|
93
|
+
<div style="display: flex; justify-content: space-between">
|
|
94
|
+
<div>
|
|
95
|
+
<div class="sk" style="width: 300px; height: 26px"></div>
|
|
96
|
+
<div class="sk" style="width: 230px; height: 12px; margin-top: 14px"></div>
|
|
97
|
+
</div>
|
|
98
|
+
<div class="sk" style="width: 116px; height: 32px"></div>
|
|
99
|
+
</div>
|
|
100
|
+
<div style="display: grid; grid-template-columns: repeat(6,1fr); margin-top: 36px; padding-bottom: 20px; border-bottom: 1px solid var(--border)">
|
|
101
|
+
<div>
|
|
102
|
+
<div class="sk" style="width: 64px; height: 11px"></div>
|
|
103
|
+
<div class="sk" style="width: 80px; height: 20px; margin-top: 10px"></div>
|
|
104
|
+
</div>
|
|
105
|
+
<div>
|
|
106
|
+
<div class="sk" style="width: 76px; height: 11px"></div>
|
|
107
|
+
<div class="sk" style="width: 80px; height: 20px; margin-top: 10px"></div>
|
|
108
|
+
</div>
|
|
109
|
+
<div>
|
|
110
|
+
<div class="sk" style="width: 84px; height: 11px"></div>
|
|
111
|
+
<div class="sk" style="width: 80px; height: 20px; margin-top: 10px"></div>
|
|
112
|
+
</div>
|
|
113
|
+
<div>
|
|
114
|
+
<div class="sk" style="width: 90px; height: 11px"></div>
|
|
115
|
+
<div class="sk" style="width: 80px; height: 20px; margin-top: 10px"></div>
|
|
116
|
+
</div>
|
|
117
|
+
<div>
|
|
118
|
+
<div class="sk" style="width: 104px; height: 11px"></div>
|
|
119
|
+
<div class="sk" style="width: 40px; height: 20px; margin-top: 10px"></div>
|
|
120
|
+
</div>
|
|
121
|
+
<div>
|
|
122
|
+
<div class="sk" style="width: 48px; height: 11px"></div>
|
|
123
|
+
<div class="sk" style="width: 40px; height: 20px; margin-top: 10px"></div>
|
|
124
|
+
</div>
|
|
125
|
+
</div>
|
|
126
|
+
<div class="sk" style="width: 72px; height: 14px; margin-top: 24px"></div>
|
|
127
|
+
<div style="margin-top: 28px; display: flex; flex-direction: column; gap: 22px">
|
|
128
|
+
<div style="display: flex; gap: 24px; align-items: center">
|
|
129
|
+
<div class="sk" style="width: 44px; height: 11px"></div>
|
|
130
|
+
<div class="sk" style="width: 80px; height: 11px"></div>
|
|
131
|
+
<div class="sk" style="width: 340px; height: 12px"></div>
|
|
132
|
+
</div>
|
|
133
|
+
<div style="display: flex; gap: 24px; align-items: center">
|
|
134
|
+
<div class="sk" style="width: 44px; height: 11px"></div>
|
|
135
|
+
<div class="sk" style="width: 80px; height: 11px"></div>
|
|
136
|
+
<div class="sk" style="width: 520px; height: 12px"></div>
|
|
137
|
+
</div>
|
|
138
|
+
<div style="display: flex; gap: 24px; align-items: center">
|
|
139
|
+
<div class="sk" style="width: 44px; height: 11px"></div>
|
|
140
|
+
<div class="sk" style="width: 80px; height: 11px"></div>
|
|
141
|
+
<div class="sk" style="width: 210px; height: 12px"></div>
|
|
142
|
+
</div>
|
|
143
|
+
<div style="display: flex; gap: 24px; align-items: center">
|
|
144
|
+
<div class="sk" style="width: 44px; height: 11px"></div>
|
|
145
|
+
<div class="sk" style="width: 80px; height: 11px"></div>
|
|
146
|
+
<div class="sk" style="width: 400px; height: 12px"></div>
|
|
147
|
+
</div>
|
|
148
|
+
<div style="display: flex; gap: 24px; align-items: center">
|
|
149
|
+
<div class="sk" style="width: 44px; height: 11px"></div>
|
|
150
|
+
<div class="sk" style="width: 80px; height: 11px"></div>
|
|
151
|
+
<div class="sk" style="width: 290px; height: 12px"></div>
|
|
152
|
+
</div>
|
|
153
|
+
<div style="display: flex; gap: 24px; align-items: center">
|
|
154
|
+
<div class="sk" style="width: 44px; height: 11px"></div>
|
|
155
|
+
<div class="sk" style="width: 80px; height: 11px"></div>
|
|
156
|
+
<div class="sk" style="width: 460px; height: 12px"></div>
|
|
157
|
+
</div>
|
|
158
|
+
</div>
|
|
159
|
+
</main>
|
|
160
|
+
</div>
|
|
161
|
+
</div>
|
|
162
|
+
</div>
|
|
163
|
+
</div>
|
|
164
|
+
<div id="viewer" hidden class="__root __fill" style="min-width:1440px">
|
|
165
|
+
<div data-frame="Trace Viewer" style="width: 1440px; height: 900px; background: #ffffff; position: relative; overflow: hidden; display: flex; flex-direction: column">
|
|
166
|
+
<div data-name="App" class="pa" style="width: 100%; height: 900px; display: flex; flex-direction: column; background: var(--bg); overflow: hidden">
|
|
167
|
+
<div data-name="Top bar" style="height: 48px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border-bottom: 1px solid var(--border)">
|
|
168
|
+
<div style="display: flex; align-items: center; gap: 8px">
|
|
169
|
+
<svg width="20" height="20" viewBox="0 0 22 22"><rect x="2" y="12" width="4" height="8" fill="#000"></rect><rect x="9" y="7" width="4" height="13" fill="#000"></rect><rect x="16" y="2" width="4" height="18" fill="#00d603"></rect></svg>
|
|
170
|
+
<span style="font: 600 15px/1 var(--font-sans); letter-spacing: -.01em">AgentTrace</span>
|
|
171
|
+
</div>
|
|
172
|
+
<span id="run-source" class="mono" style="font-size: 12px; color: var(--text-3)"></span>
|
|
173
|
+
</div>
|
|
174
|
+
<div style="display: flex; flex: 1; min-height: 0">
|
|
175
|
+
<aside data-name="Run list" style="width: 320px; flex: none; border-right: 1px solid var(--border); display: flex; flex-direction: column; padding-top: 16px">
|
|
176
|
+
<div style="display: flex; justify-content: space-between; align-items: baseline; padding: 0 24px 12px"><span style="font: 600 14px/1 var(--font-sans)">Runs</span><span id="run-count" class="mono" style="font-size: 12px; color: var(--text-3)"></span></div>
|
|
177
|
+
<label class="inp">
|
|
178
|
+
<svg data-icon="search" width="16" height="16" viewBox="0 0 24 24" fill="none"><path d="M17 17L21 21" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M19 11C19 6.58172 15.4183 3 11 3C6.58172 3 3 6.58172 3 11C3 15.4183 6.58172 19 11 19C15.4183 19 19 15.4183 19 11Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path></svg>
|
|
179
|
+
<input id="run-search" type="search" maxlength="256" aria-label="Search by run name or ID" placeholder="Search by run name or ID">
|
|
180
|
+
<button type="button" id="clear-search" class="icon-button" aria-label="Clear search" hidden><svg data-icon="cancel-circle" width="16" height="16" viewBox="0 0 24 24" fill="none" style="color: var(--text-3)"><path d="M22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M14.9994 15L12 12.0003M12 12.0003L9 9M12 12.0003L9.00064 15M12 12.0003L15 9" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path></svg></button>
|
|
181
|
+
</label>
|
|
182
|
+
<div style="height: 12px"></div>
|
|
183
|
+
<nav id="runs" aria-label="Trace runs"></nav>
|
|
184
|
+
<div id="empty-runs" hidden>
|
|
185
|
+
<div style="flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0 40px 80px; gap: 8px">
|
|
186
|
+
<div style="font: 600 14px/1.2 var(--font-sans)">No runs yet</div>
|
|
187
|
+
<div style="font: 400 13px/1.5 var(--font-sans); color: var(--text-2)">Runs show up here as soon as a wrapped agent starts one.</div>
|
|
188
|
+
</div>
|
|
189
|
+
</div>
|
|
190
|
+
<div id="unmatched-runs" hidden>
|
|
191
|
+
<div style="flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0 32px 80px; gap: 8px">
|
|
192
|
+
<div style="font: 600 14px/1.3 var(--font-sans)" id="no-runs-match">No matching runs</div>
|
|
193
|
+
<div style="font: 400 13px/1.5 var(--font-sans); color: var(--text-2)">Search covers run names and trace IDs. Check the spelling or try part of an ID.</div>
|
|
194
|
+
<button type="button" id="clear-results" class="cmd" style="margin-top: 12px">Clear search</button>
|
|
195
|
+
</div>
|
|
196
|
+
</div>
|
|
197
|
+
<button type="button" id="more-runs" class="ldr" hidden>Load older runs</button>
|
|
198
|
+
</aside>
|
|
199
|
+
<main data-name="Run detail" id="run-detail" hidden style="flex: 1; min-width: 0; padding: 24px 32px 0; display: flex; flex-direction: column">
|
|
200
|
+
<div data-name="Overview" style="display: flex; justify-content: space-between; align-items: flex-start">
|
|
201
|
+
<div>
|
|
202
|
+
<div style="display: flex; align-items: center; gap: 14px">
|
|
203
|
+
<h1 id="run-title" style="margin: 0; font: 650 24px/1.1 var(--font-sans); letter-spacing: -.02em"></h1>
|
|
204
|
+
<span id="run-status" class="stt" style="font-size: 13px"></span>
|
|
205
|
+
</div>
|
|
206
|
+
<div class="mono" style="margin-top: 10px; font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 8px">
|
|
207
|
+
<time id="run-time"></time>
|
|
208
|
+
<span>·</span>
|
|
209
|
+
<span id="trace-id"></span>
|
|
210
|
+
<button type="button" id="copy-id" class="icon-button" title="Copy trace ID" aria-label="Copy trace ID"><svg data-icon="copy" width="14" height="14" viewBox="0 0 24 24" fill="none" style="cursor: pointer"><path d="M7 11V9C7 5.70017 7 4.05025 8.02513 3.02513C9.05025 2 10.7002 2 14 2C17.2998 2 18.9497 2 19.9749 3.02513C21 4.05025 21 5.70017 21 9V11C21 14.2998 21 15.9497 19.9749 16.9749C18.9497 18 17.2998 18 14 18C10.7002 18 9.05025 18 8.02513 16.9749C7 15.9497 7 14.2998 7 11Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M3 6V15C3 18.2998 3 19.9497 4.02513 20.9749C5.05025 22 6.70017 22 10 22H17" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path></svg></button>
|
|
211
|
+
<span id="live-info" hidden></span>
|
|
212
|
+
</div>
|
|
213
|
+
</div>
|
|
214
|
+
<a id="export-trace" class="cmd">
|
|
215
|
+
Export JSON
|
|
216
|
+
<svg data-icon="download" width="16" height="16" viewBox="0 0 24 24" fill="none"><path d="M2.99969 17.0002C2.99969 17.9302 2.99969 18.3952 3.10192 18.7767C3.37932 19.8119 4.18796 20.6206 5.22324 20.898C5.60474 21.0002 6.06972 21.0002 6.99969 21.0002L16.9997 21.0002C17.9297 21.0002 18.3947 21.0002 18.7762 20.898C19.8114 20.6206 20.6201 19.8119 20.8975 18.7767C20.9997 18.3952 20.9997 17.9302 20.9997 17.0002" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M16.4998 11.5002C16.4998 11.5002 13.1856 16.0002 11.9997 16.0002C10.8139 16.0002 7.49976 11.5002 7.49976 11.5002M11.9997 15.0002V3.00016" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path></svg>
|
|
217
|
+
</a>
|
|
218
|
+
</div>
|
|
219
|
+
<div data-name="Claim vs evidence" id="claim-evidence" hidden style="margin-top: 20px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden">
|
|
220
|
+
<div style="display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px; border-bottom: 1px solid var(--border); font: 600 13px/1 var(--font-sans); color: var(--danger)">
|
|
221
|
+
<svg data-icon="alert-circle" width="16" height="16" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="10" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></circle><path d="M12 8V12" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M12.125 15.75H12M12.25 15.75C12.25 15.8881 12.1381 16 12 16C11.8619 16 11.75 15.8881 11.75 15.75C11.75 15.6119 11.8619 15.5 12 15.5C12.1381 15.5 12.25 15.6119 12.25 15.75Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path></svg>
|
|
222
|
+
The agent reported success, but a verification failed
|
|
223
|
+
</div>
|
|
224
|
+
<div style="display: grid; grid-template-columns: 1fr 1fr 1fr">
|
|
225
|
+
<div style="padding: 12px 16px; border-right: 1px solid var(--border)">
|
|
226
|
+
<div style="display: flex; gap: 8px; align-items: center; font: 600 13px/1 var(--font-sans)"><span class="mono" style="font-size: 11px; color: var(--text-3)">1</span><span id="artifact-title"></span></div>
|
|
227
|
+
<div class="mono" style="margin-top: 8px; font-size: 12px; color: var(--text-2)"><span id="artifact-path"></span></div>
|
|
228
|
+
</div>
|
|
229
|
+
<div style="padding: 12px 16px; border-right: 1px solid var(--border)">
|
|
230
|
+
<div style="display: flex; gap: 8px; align-items: center; font: 600 13px/1 var(--font-sans); color: var(--danger)"><span class="mono" style="font-size: 11px">2</span><span id="check-title"></span></div>
|
|
231
|
+
<div class="mono" style="margin-top: 8px; font-size: 12px; color: var(--text-2)"><span id="check-error"></span></div>
|
|
232
|
+
</div>
|
|
233
|
+
<div style="padding: 12px 16px">
|
|
234
|
+
<div style="display: flex; gap: 8px; align-items: center; font: 600 13px/1 var(--font-sans)"><span class="mono" style="font-size: 11px; color: var(--text-3)">3</span>Agent reported success</div>
|
|
235
|
+
<div class="mono" style="margin-top: 8px; font-size: 12px; color: var(--text-2)"><span id="claim-message"></span></div>
|
|
236
|
+
</div>
|
|
237
|
+
</div>
|
|
238
|
+
</div>
|
|
239
|
+
<div data-name="Metrics" class="mt" style="margin-top: 20px; display: grid; grid-template-columns: repeat(6,1fr); padding: 14px 0; border-bottom: 1px solid var(--border)">
|
|
240
|
+
<div>
|
|
241
|
+
<div class="l">Duration</div>
|
|
242
|
+
<div class="v">—</div>
|
|
243
|
+
</div>
|
|
244
|
+
<div>
|
|
245
|
+
<div class="l">Input tokens</div>
|
|
246
|
+
<div class="v">—</div>
|
|
247
|
+
</div>
|
|
248
|
+
<div>
|
|
249
|
+
<div class="l">Output tokens</div>
|
|
250
|
+
<div class="v">—</div>
|
|
251
|
+
</div>
|
|
252
|
+
<div>
|
|
253
|
+
<div class="l">Recorded cost</div>
|
|
254
|
+
<div class="v">—</div>
|
|
255
|
+
</div>
|
|
256
|
+
<div>
|
|
257
|
+
<div class="l">Unpriced requests</div>
|
|
258
|
+
<div class="v">—</div>
|
|
259
|
+
</div>
|
|
260
|
+
<div>
|
|
261
|
+
<div class="l">Events</div>
|
|
262
|
+
<div class="v">—</div>
|
|
263
|
+
</div>
|
|
264
|
+
</div>
|
|
265
|
+
<div id="viewer-notice" role="status" hidden></div>
|
|
266
|
+
<div data-name="Activity" id="activity">
|
|
267
|
+
<div style="display: flex; align-items: center; justify-content: space-between; height: 52px">
|
|
268
|
+
<span style="font: 600 14px/1 var(--font-sans)">Activity</span>
|
|
269
|
+
<div style="display: flex; gap: 2px">
|
|
270
|
+
<button type="button" class="chip" data-filter="all" aria-pressed="false">All <span class="ct">0</span></button>
|
|
271
|
+
<button type="button" class="chip" data-filter="model" aria-pressed="false">Model <span class="ct">0</span></button>
|
|
272
|
+
<button type="button" class="chip" data-filter="tool" aria-pressed="false">Tool <span class="ct">0</span></button>
|
|
273
|
+
<button type="button" class="chip" data-filter="command" aria-pressed="false">Command <span class="ct">0</span></button>
|
|
274
|
+
<button type="button" class="chip" data-filter="file" aria-pressed="false">File <span class="ct">0</span></button>
|
|
275
|
+
<button type="button" class="chip" data-filter="verification" aria-pressed="false">Verification <span class="ct">0</span></button>
|
|
276
|
+
<button type="button" class="chip" data-filter="decision" aria-pressed="false">Decision <span class="ct">0</span></button>
|
|
277
|
+
</div>
|
|
278
|
+
</div>
|
|
279
|
+
<div id="activity-scroll">
|
|
280
|
+
<div id="event-columns" class="ev" aria-hidden="true" style="cursor: default; height: 28px"><span class="mono" style="font-size: 11px; color: var(--text-3)">OFFSET</span><span></span><span class="mono" style="font-size: 11px; color: var(--text-3)">TYPE</span><span class="mono" style="font-size: 11px; color: var(--text-3)">NAME</span><span class="mono" style="font-size: 11px; color: var(--text-3)">STATUS</span><span class="mono" style="font-size: 11px; color: var(--text-3); text-align: right">TIME</span></div>
|
|
281
|
+
<div id="events"></div>
|
|
282
|
+
<div id="waiting" hidden style="padding: 16px 12px; font: 400 12px/1 var(--font-mono); color: var(--text-3)">Waiting for the next event…</div>
|
|
283
|
+
</div>
|
|
284
|
+
<div id="unmatched-events" hidden style="flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding-bottom: 140px; gap: 8px">
|
|
285
|
+
<div style="font: 600 14px/1.3 var(--font-sans)" id="filter-title">No matching events</div>
|
|
286
|
+
<div style="font: 400 13px/1.5 var(--font-sans); color: var(--text-2); max-width: 320px" id="filter-description"></div>
|
|
287
|
+
<button type="button" id="show-all" class="cmd" style="margin-top: 12px">Show all events</button>
|
|
288
|
+
</div>
|
|
289
|
+
</div>
|
|
290
|
+
</main>
|
|
291
|
+
<main id="first-run" hidden style="flex: 1; display: flex; align-items: center; justify-content: center; padding-bottom: 60px">
|
|
292
|
+
<div style="width: 560px">
|
|
293
|
+
<h1 style="margin: 0; font: 650 24px/1.1 var(--font-sans); letter-spacing: -.02em">Record your first run</h1>
|
|
294
|
+
<p style="margin: 12px 0 0; font: 400 14px/1.55 var(--font-sans); color: var(--text-2)">Wrap your agent with AgentTrace and run it once. Its tool calls, file changes, commands, decisions and cost will appear here.</p>
|
|
295
|
+
<div style="margin-top: 20px; background: #0c0c0c; border: 1px solid #2a2a2a; overflow: hidden">
|
|
296
|
+
<div style="display: flex; justify-content: space-between; height: 34px; align-items: center; padding: 0 16px; border-bottom: 1px solid #262626; font: 400 12px/1 var(--font-mono); color: #9a9a9a"><span>agent/run.ts</span><span>TypeScript</span></div>
|
|
297
|
+
<pre style="margin: 0; padding: 16px; font: 400 13px/1.7 var(--font-mono); color: #dcdcdc; white-space: pre; overflow: hidden"><span style="color: #b79cf0">import</span> { createTracer } <span style="color: #b79cf0">from</span> <span style="color: #93d3a2">"agenttrace-journal"</span>
|
|
298
|
+
|
|
299
|
+
<span style="color: #b79cf0">const</span> trace = <span style="color: #8ab8f5">createTracer</span>()
|
|
300
|
+
<span style="color: #b79cf0">await</span> trace.<span style="color: #8ab8f5">run</span>(<span style="color: #93d3a2">"my-agent"</span>, () => agent.run())</pre>
|
|
301
|
+
</div>
|
|
302
|
+
<div style="margin-top: 20px; display: flex; align-items: center; gap: 20px"><a class="cmd" href="https://github.com/Willy1231-debug/Agent-trace-SDK#try-it" target="_blank" rel="noopener noreferrer">Open quickstart<svg data-icon="arrow-right" width="16" height="16" viewBox="0 0 24 24" fill="none"><path d="M9.00005 6C9.00005 6 15 10.4189 15 12C15 13.5812 9 18 9 18" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path></svg></a><span style="font: 400 13px/1.3 var(--font-sans); color: var(--text-3)">This page updates when the first run starts.</span></div>
|
|
303
|
+
</div>
|
|
304
|
+
</main>
|
|
305
|
+
<main id="select-run" hidden style="flex: 1; display: flex; align-items: center; justify-content: center; padding-bottom: 60px">
|
|
306
|
+
<div style="text-align: center; max-width: 320px">
|
|
307
|
+
<div style="font: 600 14px/1.3 var(--font-sans)">Select a run</div>
|
|
308
|
+
<div style="margin-top: 8px; font: 400 13px/1.5 var(--font-sans); color: var(--text-3)">Pick a run from the list to see its events and verification results.</div>
|
|
309
|
+
</div>
|
|
310
|
+
</main>
|
|
311
|
+
<main id="unavailable" hidden style="flex: 1; display: flex">
|
|
312
|
+
<div id="trace-error" style="flex: 1; display: flex; align-items: center; justify-content: center; padding-bottom: 120px">
|
|
313
|
+
<div style="width: 460px">
|
|
314
|
+
<div style="display: flex; align-items: center; gap: 8px; font: 600 15px/1.3 var(--font-sans)">
|
|
315
|
+
<svg data-icon="alert-circle" width="18" height="18" viewBox="0 0 24 24" fill="none" style="color: var(--danger)"><circle cx="12" cy="12" r="10" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></circle><path d="M12 8V12" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M12.125 15.75H12M12.25 15.75C12.25 15.8881 12.1381 16 12 16C11.8619 16 11.75 15.8881 11.75 15.75C11.75 15.6119 11.8619 15.5 12 15.5C12.1381 15.5 12.25 15.6119 12.25 15.75Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path></svg>
|
|
316
|
+
<span id="error-title">Trace unavailable</span>
|
|
317
|
+
</div>
|
|
318
|
+
<p id="error-description" style="margin: 12px 0 0; font: 400 14px/1.55 var(--font-sans); color: var(--text-2)">The file for this run couldn’t be read. It may have been moved or deleted, or it’s still being written to disk.</p>
|
|
319
|
+
<div id="error-path" class="mono" style="margin-top: 16px; padding: 10px 12px; background: var(--surface-2); border-radius: 8px; font-size: 12px; color: var(--text-2); word-break: break-all"></div>
|
|
320
|
+
<div style="margin-top: 20px; display: flex; gap: 12px"><button type="button" id="retry" class="cmd p"><svg data-icon="refresh" width="16" height="16" viewBox="0 0 24 24" fill="none"><path d="M20.0092 2V5.13219C20.0092 5.42605 19.6418 5.55908 19.4537 5.33333C17.6226 3.2875 14.9617 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path></svg>Retry</button><button type="button" id="copy-path" class="cmd"><svg data-icon="copy" width="16" height="16" viewBox="0 0 24 24" fill="none"><path d="M7 11V9C7 5.70017 7 4.05025 8.02513 3.02513C9.05025 2 10.7002 2 14 2C17.2998 2 18.9497 2 19.9749 3.02513C21 4.05025 21 5.70017 21 9V11C21 14.2998 21 15.9497 19.9749 16.9749C18.9497 18 17.2998 18 14 18C10.7002 18 9.05025 18 8.02513 16.9749C7 15.9497 7 14.2998 7 11Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M3 6V15C3 18.2998 3 19.9497 4.02513 20.9749C5.05025 22 6.70017 22 10 22H17" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path></svg>Copy path</button></div>
|
|
321
|
+
</div>
|
|
322
|
+
</div>
|
|
323
|
+
</main>
|
|
324
|
+
</div>
|
|
325
|
+
</div>
|
|
326
|
+
</div>
|
|
327
|
+
</div>
|
|
328
|
+
<template id="icon-failed"><svg aria-hidden="true" data-icon="cancel-circle" width="14" height="14" viewBox="0 0 24 24" fill="none"><path d="M22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M14.9994 15L12 12.0003M12 12.0003L9 9M12 12.0003L9.00064 15M12 12.0003L15 9" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path></svg></template>
|
|
329
|
+
<template id="icon-passed"><svg aria-hidden="true" data-icon="checkmark-circle" width="14" height="14" viewBox="0 0 24 24" fill="none"><path d="M22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12Z" stroke="currentColor" stroke-width="1.5"></path><path d="M8 12.75C8 12.75 9.6 13.6625 10.4 15C10.4 15 12.8 9.75 16 8" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path></svg></template>
|
|
330
|
+
<template id="icon-pending"><svg aria-hidden="true" width="14" height="14" viewBox="0 0 14 14" fill="none" stroke="currentColor" stroke-width="1.5" stroke-dasharray="2.4 2.2"><circle cx="7" cy="7" r="5.5"></circle></svg></template>
|
|
331
|
+
<template id="icon-live"><svg aria-hidden="true" class="spin" width="16" height="16" viewBox="0 0 14 14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"><path d="M7 1.5a5.5 5.5 0 1 1-5.5 5.5"></path></svg></template>
|
|
332
|
+
<template id="icon-expand"><svg aria-hidden="true" class="chev" data-icon="chevron-down" width="14" height="14" viewBox="0 0 24 24" fill="none"><path d="M18 9.00005C18 9.00005 13.5811 15 12 15C10.4188 15 6 9 6 9" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path></svg></template>
|
|
333
|
+
<template id="icon-model"><svg aria-hidden="true" data-icon="cpu" width="14" height="14" viewBox="0 0 24 24" fill="none"><path d="M4 12C4 8.22876 4 6.34315 5.17157 5.17157C6.34315 4 8.22876 4 12 4C15.7712 4 17.6569 4 18.8284 5.17157C20 6.34315 20 8.22876 20 12C20 15.7712 20 17.6569 18.8284 18.8284C17.6569 20 15.7712 20 12 20C8.22876 20 6.34315 20 5.17157 18.8284C4 17.6569 4 15.7712 4 12Z" stroke="currentColor" stroke-linejoin="round" stroke-width="1.5"></path><path d="M9.5 2V4" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M14.5 2V4" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M9.5 20V22" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M14.5 20V22" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M13 9L9 13" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M15 13L13 15" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M22 14.5L20 14.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M4 9.5L2 9.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M4 14.5L2 14.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M22 9.5L20 9.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path></svg></template>
|
|
334
|
+
<template id="icon-decision"><svg aria-hidden="true" data-icon="lightbulb" width="14" height="14" viewBox="0 0 24 24" fill="none"><path d="M18.9961 9C18.9961 10.9476 18.2007 12.7095 16.917 13.9785C16.5411 14.35 16.3532 14.5357 16.3363 14.553C15.6101 15.2943 15.4889 15.5876 15.4796 16.6252C15.4793 16.6494 15.48 16.7344 15.4812 16.9043C15.4817 16.9799 15.482 17.0176 15.4812 17.0495C15.4549 18.1098 14.6056 18.9652 13.5456 18.999C13.5137 19 13.4759 19 13.4004 19H10.6207C10.5309 19 10.486 19 10.4481 18.9986C9.40314 18.9589 8.56516 18.1209 8.52547 17.0759C8.52402 17.038 8.52402 16.9931 8.52402 16.9033C8.52402 16.7241 8.52402 16.6345 8.52348 16.6059C8.50393 15.5845 8.38589 15.3019 7.67314 14.5701C7.65312 14.5495 7.46075 14.3594 7.07601 13.9792C5.79184 12.7102 4.99609 10.948 4.99609 9C4.99609 5.13401 8.1301 2 11.9961 2C15.8621 2 18.9961 5.13401 18.9961 9Z" stroke="currentColor" stroke-width="1.5"></path><path d="M9.99609 19V20C9.99609 21.1046 10.8915 22 11.9961 22C13.1007 22 13.9961 21.1046 13.9961 20V19" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M8.49609 16H15.4961" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path></svg></template>
|
|
335
|
+
<template id="icon-tool"><svg aria-hidden="true" data-icon="wrench" width="14" height="14" viewBox="0 0 24 24" fill="none"><path d="M3.74416 16.1113L8.66248 12.5982C9.18807 12.2228 9.5 11.6167 9.5 10.9708V7.5C9.5 4.73858 11.7386 2.5 14.5 2.5H18L14.9811 6.81268C14.7029 7.2102 14.7501 7.75013 15.0932 8.09325L15.9068 8.90675C16.2499 9.24987 16.7898 9.29714 17.1873 9.01888L21.5 6V9.5C21.5 12.2614 19.2614 14.5 16.5 14.5H13.0292C12.3833 14.5 11.7772 14.8119 11.4018 15.3375L7.88869 20.2558C7.33099 21.0366 6.43055 21.5 5.47105 21.5C3.83018 21.5 2.5 20.1698 2.5 18.529C2.5 17.5695 2.96338 16.669 3.74416 16.1113Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path></svg></template>
|
|
336
|
+
<template id="icon-command"><svg aria-hidden="true" data-icon="terminal" width="14" height="14" viewBox="0 0 24 24" fill="none"><path d="M4.00004 17C4.00004 17 9.99999 12.5811 10 11C10 9.41884 4 5 4 5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M12 19H20" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path></svg></template>
|
|
337
|
+
<template id="icon-file"><svg aria-hidden="true" data-icon="file" width="14" height="14" viewBox="0 0 24 24" fill="none"><path d="M8 7L16 7" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M8 11L12 11" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M13 21.5V21C13 18.1716 13 16.7574 13.8787 15.8787C14.7574 15 16.1716 15 19 15H19.5M20 13.3431V10C20 6.22876 20 4.34315 18.8284 3.17157C17.6569 2 15.7712 2 12 2C8.22877 2 6.34315 2 5.17157 3.17157C4 4.34314 4 6.22876 4 10L4 14.5442C4 17.7892 4 19.4117 4.88607 20.5107C5.06508 20.7327 5.26731 20.9349 5.48933 21.1139C6.58831 22 8.21082 22 11.4558 22C12.1614 22 12.5141 22 12.8372 21.886C12.9044 21.8623 12.9702 21.835 13.0345 21.8043C13.3436 21.6564 13.593 21.407 14.0919 20.9081L18.8284 16.1716C19.4065 15.5935 19.6955 15.3045 19.8478 14.9369C20 14.5694 20 14.1606 20 13.3431Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path></svg></template>
|
|
338
|
+
<template id="icon-verification"><svg aria-hidden="true" data-icon="security-check" width="14" height="14" viewBox="0 0 24 24" fill="none"><path d="M18.7088 3.49534C16.8165 2.55382 14.5009 2 12 2C9.4991 2 7.1835 2.55382 5.29116 3.49534C4.36318 3.95706 3.89919 4.18792 3.4496 4.91378C3 5.63965 3 6.34248 3 7.74814V11.2371C3 16.9205 7.54236 20.0804 10.173 21.4338C10.9067 21.8113 11.2735 22 12 22C12.7265 22 13.0933 21.8113 13.8269 21.4338C16.4576 20.0804 21 16.9205 21 11.2371L21 7.74814C21 6.34249 21 5.63966 20.5504 4.91378C20.1008 4.18791 19.6368 3.95706 18.7088 3.49534Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M9 11.5C9 11.5 10.4079 11.7519 11 13.5C11 13.5 12.5 10.5 15 9.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path></svg></template>
|
|
339
|
+
<template id="icon-capture"><svg aria-hidden="true" data-icon="alert-circle" width="16" height="16" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="10" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></circle><path d="M12 8V12" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M12.125 15.75H12M12.25 15.75C12.25 15.8881 12.1381 16 12 16C11.8619 16 11.75 15.8881 11.75 15.75C11.75 15.6119 11.8619 15.5 12 15.5C12.1381 15.5 12.25 15.6119 12.25 15.75Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path></svg></template>
|
|
340
|
+
</body>
|
|
341
|
+
</html>
|
package/viewer/style.css
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
html,body{margin:0}
|
|
2
|
+
html,body{margin:0}
|
|
3
|
+
.__root{--accent:initial;--accent-brush:initial;--accent-hover:initial;--accent-soft:initial;--agent-lch:initial;--canvas-bg:initial;--font-mono:initial;--font-sans:initial;--iz:initial;--menu-bg:initial;--primary:initial;--primary-hover:initial;--primary-text:initial;--seg-on:initial;--ui-bg:initial;--ui-border:initial;--ui-chrome:initial;--ui-faint:initial;--ui-field:initial;--ui-field-hover:initial;--ui-line:initial;--ui-muted:initial;--ui-panel:initial;--ui-seg:initial;--ui-text:initial;--ui-text-2:initial}
|
|
4
|
+
*,*::before,*::after{box-sizing:border-box}
|
|
5
|
+
.__root *{margin:0}
|
|
6
|
+
:where(h1,h2,h3,h4,h5,h6,p,figure,blockquote,ul,ol,dl){margin:0}
|
|
7
|
+
:where(ul,ol){padding:0;list-style:none}
|
|
8
|
+
:where(button,input,select,textarea){font:inherit;color:inherit;letter-spacing:inherit}
|
|
9
|
+
:where(button){background:none;border:0;padding:0;cursor:pointer}
|
|
10
|
+
:where(img,svg,video){display:block;max-width:100%}
|
|
11
|
+
.__root>:where(img,svg,video){max-width:none}
|
|
12
|
+
:where(a){color:inherit;text-decoration:none}
|
|
13
|
+
template{display:none!important}
|
|
14
|
+
.__root{font-family:Inter,ui-sans-serif,system-ui,sans-serif;font-size:14px;line-height:1.4;color:#111;-webkit-font-smoothing:antialiased}
|
|
15
|
+
[contenteditable]{outline:none;cursor:text}.__root{--bg:#ffffff;--surface:#fefefe;--surface-2:#f7f7f7;--border:rgba(0,0,0,0.15);--border-strong:#000000;--text:#0a0a0a;--text-2:#444444;--text-3:#666666;--accent:#00d603;--accent-hover:#00b803;--accent-fg:#0a0a0a;--accent-soft:#e6fbe6;--signal-cyan:#00e5e5;--danger:#d4150c;--danger-soft:#fdeceb;--ink:#000000;--font-sans:'Geist', 'Inter', sans-serif;--font-mono:'Geist Mono', 'JetBrains Mono', monospace}.__root>*{--bg:#ffffff!important;--surface:#fefefe!important;--surface-2:#f7f7f7!important;--border:rgba(0,0,0,0.15)!important;--border-strong:#000000!important;--text:#0a0a0a!important;--text-2:#444444!important;--text-3:#666666!important;--accent:#00d603!important;--accent-hover:#00b803!important;--accent-fg:#0a0a0a!important;--accent-soft:#e6fbe6!important;--signal-cyan:#00e5e5!important;--danger:#d4150c!important;--danger-soft:#fdeceb!important;--ink:#000000!important;--font-sans:'Geist', 'Inter', sans-serif!important;--font-mono:'Geist Mono', 'JetBrains Mono', monospace!important}[data-folio-off]{display:none!important}[data-set],[data-toggle]{cursor:var(--cur-pointer,pointer)}
|
|
16
|
+
.__fill>[data-frame]{width:100%!important}
|
|
17
|
+
.pa{font-family:var(--font-sans);color:var(--text);font-size:13px}
|
|
18
|
+
.pa *{box-sizing:border-box}
|
|
19
|
+
.mono{font-family:var(--font-mono)}
|
|
20
|
+
.run{display:flex;align-items:center;justify-content:space-between;gap:10px;height:56px;padding:0 12px;margin:0 8px;border-radius:8px;cursor:pointer;transition:background .15s}
|
|
21
|
+
.run:hover,.run.sel{background:var(--surface-2)}
|
|
22
|
+
.run .nm{font:400 14px/1.2 var(--font-sans);letter-spacing:-.01em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
23
|
+
.run.sel .nm{font-weight:600}
|
|
24
|
+
.run .tm{font:400 12px/1 var(--font-mono);color:var(--text-3);margin-top:6px;font-variant-numeric:tabular-nums}
|
|
25
|
+
.stt{display:flex;align-items:center;gap:6px;font:400 12px/1 var(--font-sans);color:var(--text-2);white-space:nowrap}
|
|
26
|
+
.stt.bad{color:var(--danger);font-weight:500}
|
|
27
|
+
.chip{height:28px;padding:0 10px;border-radius:6px;display:inline-flex;align-items:center;gap:6px;font:400 13px/1 var(--font-sans);color:var(--text-2);cursor:pointer;transition:background .15s,color .15s;border:0;background:none}
|
|
28
|
+
.chip:hover{background:var(--surface-2);color:var(--text)}
|
|
29
|
+
.chip.on{background:var(--surface-2);color:var(--text);font-weight:600}
|
|
30
|
+
.chip .ct{font:400 11px/1 var(--font-mono);color:var(--text-3)}
|
|
31
|
+
.ev{display:grid;grid-template-columns:64px 14px 104px 1fr 112px 52px;align-items:center;gap:10px;height:36px;padding:0 12px;border-radius:6px;cursor:pointer;transition:background .15s}
|
|
32
|
+
.ev:hover{background:var(--surface-2)}
|
|
33
|
+
.ev.bad{background:var(--danger-soft)}
|
|
34
|
+
.ev .off{font:400 12px/1 var(--font-mono);color:var(--text-3);font-variant-numeric:tabular-nums}
|
|
35
|
+
.ev .ty{display:flex;align-items:center;gap:8px;font:500 12px/1 var(--font-mono);color:var(--text-2)}
|
|
36
|
+
.ev .nmx{font:400 13px/1.2 var(--font-sans);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
37
|
+
.ev .du{font:400 12px/1 var(--font-mono);color:var(--text-3);text-align:right;font-variant-numeric:tabular-nums}
|
|
38
|
+
.chev{color:var(--text-3);transition:transform .2s cubic-bezier(.2,.8,.2,1)}
|
|
39
|
+
.chev.o{transform:rotate(180deg)}
|
|
40
|
+
.dt{display:grid;grid-template-rows:0fr;transition:grid-template-rows .25s cubic-bezier(.2,.8,.2,1)}
|
|
41
|
+
.dt.open{grid-template-rows:1fr}
|
|
42
|
+
.dt>div{overflow:hidden;min-height:0}
|
|
43
|
+
.dbox{margin:0 0 6px 88px;padding:9px 14px;background:var(--surface-2);border-radius:8px;display:grid;grid-template-columns:96px 1fr;gap:2px 12px;font:400 12px/1.5 var(--font-mono)}
|
|
44
|
+
.dbox .l{color:var(--text-3)}
|
|
45
|
+
.dbox .v{color:var(--text);word-break:break-all}
|
|
46
|
+
.cmd{display:inline-flex;align-items:center;height:32px;font:700 13px/1.2 var(--font-mono);letter-spacing:-.02em;text-transform:uppercase;text-decoration:none;cursor:pointer;gap:8px;transition:background .15s,color .15s,transform .1s;white-space:nowrap;background:var(--surface);color:#000;border:1px solid #000;padding:0 10px}
|
|
47
|
+
.cmd:hover{background:#000;color:#fff}
|
|
48
|
+
.cmd:active{transform:translateY(.5px)}
|
|
49
|
+
.inp{display:flex;align-items:center;gap:8px;height:36px;border:1px solid var(--border);border-radius:8px;padding:0 10px;color:var(--text-3);font:400 13px/1 var(--font-sans);margin:0 16px;transition:border-color .15s}
|
|
50
|
+
.inp:hover{border-color:var(--border-strong)}
|
|
51
|
+
.ldr{margin:8px 16px 16px;height:36px;border-radius:8px;display:flex;align-items:center;justify-content:center;gap:8px;font:500 13px/1 var(--font-sans);color:var(--text-2);cursor:pointer;transition:background .15s;border:1px solid var(--border)}
|
|
52
|
+
.ldr:hover{background:var(--surface-2);color:var(--text)}
|
|
53
|
+
.mt .l{font:400 12px/1 var(--font-sans);color:var(--text-3)}
|
|
54
|
+
.mt .v{font:600 18px/1 var(--font-sans);letter-spacing:-.01em;margin-top:8px;font-variant-numeric:tabular-nums}
|
|
55
|
+
.sk{background:var(--surface-2);border-radius:4px}
|
|
56
|
+
@keyframes spin{to{transform:rotate(360deg)}}
|
|
57
|
+
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.55}}
|
|
58
|
+
.spin{animation:spin .9s linear infinite}
|
|
59
|
+
.pl{animation:pulse 1.6s ease-in-out infinite}
|
|
60
|
+
.cmd.p{background:#000;color:#fff}
|
|
61
|
+
.cmd.p:hover{background:#2a2a2a}
|
|
62
|
+
.cmd.dis{border-color:var(--border);color:var(--text-3);background:var(--surface-2);cursor:default}
|
|
63
|
+
|
|
64
|
+
[hidden]{display:none!important}
|
|
65
|
+
#runs{flex:1;min-height:0;overflow:auto}
|
|
66
|
+
.run,.ldr{flex:none}
|
|
67
|
+
#empty-runs,#unmatched-runs{flex:1;display:flex;min-height:0}
|
|
68
|
+
#empty-runs>div,#unmatched-runs>div{width:100%}
|
|
69
|
+
.inp:focus-within{border-color:var(--border-strong)}
|
|
70
|
+
.inp:has(input:disabled){opacity:.6}
|
|
71
|
+
.inp input{flex:1;width:100%;min-width:0;padding:0;border:0;outline:none;background:transparent;color:var(--text)}
|
|
72
|
+
.inp input::placeholder{color:var(--text-3);opacity:1}
|
|
73
|
+
.inp input::-webkit-search-cancel-button{display:none}
|
|
74
|
+
.icon-button{display:inline-flex;flex:none;align-items:center}
|
|
75
|
+
#run-title{overflow-wrap:anywhere}
|
|
76
|
+
#live-info::before{content:"·";margin-right:8px}
|
|
77
|
+
#copy-id:disabled{opacity:.6}
|
|
78
|
+
#activity{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}
|
|
79
|
+
#activity>div:first-child{flex:none}
|
|
80
|
+
#activity-scroll{min-height:0;overflow:auto}
|
|
81
|
+
#event-columns:hover{background:none}
|
|
82
|
+
#events .ev{width:100%;text-align:left}
|
|
83
|
+
.ev.nested{padding-left:36px}
|
|
84
|
+
.ev .nmx.mono{font:400 12px/1.2 var(--font-mono)}
|
|
85
|
+
.ev .parent{color:var(--text-3)}
|
|
86
|
+
.ev.bad .off{color:var(--danger)}
|
|
87
|
+
.ev.bad .ty{color:var(--text)}
|
|
88
|
+
.dt.nested .dbox{margin-left:112px}
|
|
89
|
+
.dbox .v{white-space:pre-wrap}
|
|
90
|
+
#claim-evidence{flex:none}
|
|
91
|
+
#claim-evidence .mono{overflow-wrap:anywhere}
|
|
92
|
+
#viewer-notice{margin-top:8px;color:var(--text-3);font:400 12px/1.5 var(--font-mono)}
|
|
93
|
+
.run-summary{min-width:0}
|
|
94
|
+
.run .tm{display:block}
|
|
95
|
+
#run-detail .mt,#run-detail [data-name="Overview"]{flex:none}
|
|
96
|
+
#trace-error{width:100%}
|
|
97
|
+
#viewer-notice{flex:none}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
const operations = { tool: 'tool', command: 'command', check: 'verification' };
|
|
2
|
+
const categories = { usage: 'model', note: 'decision', claim: 'decision', file: 'file',
|
|
3
|
+
'capture.error': 'capture', 'command.exit': 'command' };
|
|
4
|
+
const money = new Intl.NumberFormat('en-US', {
|
|
5
|
+
style: 'currency', currency: 'USD', maximumFractionDigits: 6,
|
|
6
|
+
});
|
|
7
|
+
const number = new Intl.NumberFormat();
|
|
8
|
+
|
|
9
|
+
export function formatNumber(value) {
|
|
10
|
+
return Number.isFinite(value) ? number.format(value) : '—';
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function formatCost(value) {
|
|
14
|
+
return Number.isFinite(value) ? money.format(value) : '—';
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function formatDuration(value) {
|
|
18
|
+
if (!Number.isFinite(value)) return '—';
|
|
19
|
+
return value < 1000 ? Math.round(value) + ' ms' : (value / 1000).toFixed(1) + ' s';
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function formatValue(value) {
|
|
23
|
+
return typeof value === 'string' ? value : JSON.stringify(value, null, 2);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function operationRow(event, end, exit) {
|
|
27
|
+
const details = [['Operation', event.name]];
|
|
28
|
+
if (event.input !== undefined) {
|
|
29
|
+
details.push([event.kind === 'command' ? 'Arguments' : 'Input', formatValue(event.input)]);
|
|
30
|
+
}
|
|
31
|
+
if (end?.result !== undefined) details.push(['Output', formatValue(end.result)]);
|
|
32
|
+
if (exit) {
|
|
33
|
+
details.push(['Exit code', exit.code === null ? 'Unavailable' : exit.code]);
|
|
34
|
+
if (exit.signal) details.push(['Signal', exit.signal]);
|
|
35
|
+
}
|
|
36
|
+
if (end?.error) details.push(['Error', end.error]);
|
|
37
|
+
const status = end?.status ?? 'open';
|
|
38
|
+
const statusText = exit?.signal ?? (Number.isInteger(exit?.code) ? 'exit ' + exit.code
|
|
39
|
+
: { passed: 'Passed', failed: 'Failed', open: 'Unfinished' }[status]);
|
|
40
|
+
const args = Array.isArray(event.input) ? event.input.filter((arg) => typeof arg === 'string') : [];
|
|
41
|
+
return {
|
|
42
|
+
title: [event.name, ...args].join(' '),
|
|
43
|
+
duration: end?.elapsedMs,
|
|
44
|
+
status,
|
|
45
|
+
statusText,
|
|
46
|
+
details,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function eventRow(event) {
|
|
51
|
+
switch (event.type) {
|
|
52
|
+
case 'usage': {
|
|
53
|
+
const { model, inputTokens, outputTokens, costUsd } = event.usage ?? {};
|
|
54
|
+
return {
|
|
55
|
+
title: model ?? 'Unknown model',
|
|
56
|
+
details: [
|
|
57
|
+
['Tokens', formatNumber(inputTokens) + ' in · ' + formatNumber(outputTokens) + ' out'],
|
|
58
|
+
['Cost', costUsd === undefined ? 'Unpriced' : formatCost(costUsd)],
|
|
59
|
+
],
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
case 'note': return { title: event.message, details: [['Decision', event.message]] };
|
|
63
|
+
case 'claim': return { title: event.message, details: [['Reported', event.message]] };
|
|
64
|
+
case 'file': return {
|
|
65
|
+
title: event.change + ' ' + event.path,
|
|
66
|
+
details: [
|
|
67
|
+
['Path', event.path],
|
|
68
|
+
['Before', event.before ? 'sha256:' + event.before : '—'],
|
|
69
|
+
['After', event.after ? 'sha256:' + event.after : '—'],
|
|
70
|
+
],
|
|
71
|
+
};
|
|
72
|
+
case 'capture.error': return {
|
|
73
|
+
title: event.operation, status: 'failed', statusText: 'Capture error',
|
|
74
|
+
details: [['Capture', event.operation]],
|
|
75
|
+
};
|
|
76
|
+
case 'command.exit': return {
|
|
77
|
+
title: event.signal ?? (event.code === null ? 'Exit code unavailable' : 'Exit code ' + event.code),
|
|
78
|
+
details: [['Exit code', event.code ?? 'Unavailable'], ['Signal', event.signal ?? '—']],
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export function readActivity(trace) {
|
|
84
|
+
const starts = new Map();
|
|
85
|
+
const ends = new Map();
|
|
86
|
+
const exits = new Map();
|
|
87
|
+
const usageTotals = { inputTokens: 0, outputTokens: 0, costUsd: 0, pricedRequests: 0, unpricedRequests: 0 };
|
|
88
|
+
for (const event of trace.events) {
|
|
89
|
+
if (event.type === 'span.start') starts.set(event.id, event);
|
|
90
|
+
if (event.type === 'span.end') ends.set(event.id, event);
|
|
91
|
+
if (event.type === 'command.exit') exits.set(event.parentId, event);
|
|
92
|
+
if (event.type !== 'usage' || !event.usage) continue;
|
|
93
|
+
const { inputTokens, outputTokens, costUsd } = event.usage;
|
|
94
|
+
usageTotals.inputTokens += Number.isFinite(inputTokens) ? inputTokens : 0;
|
|
95
|
+
usageTotals.outputTokens += Number.isFinite(outputTokens) ? outputTokens : 0;
|
|
96
|
+
if (Number.isFinite(costUsd)) {
|
|
97
|
+
usageTotals.costUsd += costUsd;
|
|
98
|
+
usageTotals.pricedRequests++;
|
|
99
|
+
} else usageTotals.unpricedRequests++;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const rows = [];
|
|
103
|
+
const counts = { all: 0, model: 0, tool: 0, command: 0, file: 0, verification: 0, decision: 0, capture: 0 };
|
|
104
|
+
trace.events.forEach((event, index) => {
|
|
105
|
+
const operation = event.type === 'span.start';
|
|
106
|
+
const category = operation ? operations[event.kind] : categories[event.type];
|
|
107
|
+
if (!category || (event.type === 'command.exit' && starts.get(event.parentId)?.kind === 'command')) return;
|
|
108
|
+
const row = operation ? operationRow(event, ends.get(event.id), exits.get(event.id)) : eventRow(event);
|
|
109
|
+
const parent = starts.get(event.parentId)?.name;
|
|
110
|
+
rows.push({ ...row, key: operation ? event.id : event.type + '-' + index, category, parent, event });
|
|
111
|
+
counts[category]++;
|
|
112
|
+
counts.all++;
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
// A claim is an explicit statement, independent of the run's callback result.
|
|
116
|
+
const claim = rows.findLast((row) => row.event.type === 'claim');
|
|
117
|
+
const failedCheck = rows.findLast((row) => row.category === 'verification' && row.status === 'failed');
|
|
118
|
+
const file = failedCheck && rows.slice(0, rows.indexOf(failedCheck)).findLast((row) => row.category === 'file');
|
|
119
|
+
const last = trace.events.at(-1);
|
|
120
|
+
return {
|
|
121
|
+
rows, counts, totals: trace.totals ?? usageTotals, last,
|
|
122
|
+
evidence: claim && failedCheck ? { claim, failedCheck, file } : null,
|
|
123
|
+
};
|
|
124
|
+
}
|