@codexview/react 0.1.1

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.
Files changed (35) hide show
  1. package/README.md +56 -0
  2. package/dist/components/CodexTranscript.d.ts +41 -0
  3. package/dist/components/ErrorBlock.d.ts +7 -0
  4. package/dist/components/ExecBlock.d.ts +9 -0
  5. package/dist/components/ItemErrorBoundary.d.ts +16 -0
  6. package/dist/components/Markdown.d.ts +20 -0
  7. package/dist/components/MessageBubble.d.ts +10 -0
  8. package/dist/components/PatchBlock.d.ts +9 -0
  9. package/dist/components/RawEventBlock.d.ts +7 -0
  10. package/dist/components/ReasoningBlock.d.ts +11 -0
  11. package/dist/components/SearchBlock.d.ts +10 -0
  12. package/dist/components/StatusBar.d.ts +10 -0
  13. package/dist/components/TodoListBlock.d.ts +9 -0
  14. package/dist/components/ToolCallBlock.d.ts +9 -0
  15. package/dist/components/TurnContainer.d.ts +7 -0
  16. package/dist/components/_shared.d.ts +2 -0
  17. package/dist/components/icons.d.ts +16 -0
  18. package/dist/hooks/useCodexTranscript.d.ts +10 -0
  19. package/dist/hooks/useSmoothStream.d.ts +7 -0
  20. package/dist/index.d.ts +38 -0
  21. package/dist/index.js +13520 -0
  22. package/dist/index.js.map +1 -0
  23. package/dist/reducer/status.d.ts +2 -0
  24. package/dist/reducer/transcript.d.ts +4 -0
  25. package/dist/styles.css +493 -0
  26. package/dist/types/events.d.ts +164 -0
  27. package/dist/types/model.d.ts +75 -0
  28. package/docs/api.md +156 -0
  29. package/docs/changelog.md +40 -0
  30. package/docs/events.md +65 -0
  31. package/docs/integration-agentweb.md +112 -0
  32. package/docs/styling.md +81 -0
  33. package/docs/superpowers/plans/2026-05-15-codexview-implementation.md +3903 -0
  34. package/docs/superpowers/specs/2026-05-15-codexview-design.md +661 -0
  35. package/package.json +84 -0
@@ -0,0 +1,2 @@
1
+ import { TranscriptModel, TranscriptStatus } from '../types/model.js';
2
+ export declare function inferStatus(model: TranscriptModel): TranscriptStatus;
@@ -0,0 +1,4 @@
1
+ import { ChatStreamEvent } from '../types/events.js';
2
+ import { TranscriptModel, EMPTY_MODEL } from '../types/model.js';
3
+ export declare function reduceTranscript(prev: TranscriptModel, event: ChatStreamEvent): TranscriptModel;
4
+ export { EMPTY_MODEL };
@@ -0,0 +1,493 @@
1
+ :root,
2
+ .codexview-root {
3
+ --cv-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
4
+ --cv-font-mono: ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, monospace;
5
+ --cv-font-size: 14px;
6
+ --cv-line-height: 1.55;
7
+ --cv-radius: 12px;
8
+ --cv-radius-sm: 8px;
9
+ --cv-spacing-xs: 4px;
10
+ --cv-spacing-sm: 8px;
11
+ --cv-spacing-md: 12px;
12
+ --cv-spacing-lg: 16px;
13
+
14
+ --cv-text: #1f2328;
15
+ --cv-text-muted: #6e7781;
16
+ --cv-text-inverse: #ffffff;
17
+ --cv-bg: #ffffff;
18
+ --cv-bg-raised: #f6f8fa;
19
+ --cv-bg-user-bubble: #2f6feb;
20
+ --cv-bg-assistant-bubble: #f6f8fa;
21
+ --cv-bg-code: #0d1117;
22
+ --cv-fg-code: #e6edf3;
23
+ --cv-border: #d0d7de;
24
+ --cv-axis-color: #d0d7de;
25
+ --cv-shimmer-color: rgba(31, 35, 40, 0.08);
26
+
27
+ --cv-status-pending: #6e7781;
28
+ --cv-status-running: #2f6feb;
29
+ --cv-status-completed: #1a7f37;
30
+ --cv-status-failed: #cf222e;
31
+ --cv-status-stopped: #6e7781;
32
+
33
+ --cv-diff-add-bg: #ddf4e4;
34
+ --cv-diff-del-bg: #ffebe9;
35
+ }
36
+ .cv-TurnContainer-module_turn_K9u-z {
37
+ padding: var(--cv-spacing-md) var(--cv-spacing-lg);
38
+ display: flex;
39
+ flex-direction: column;
40
+ gap: var(--cv-spacing-sm);
41
+ }
42
+ .cv-TurnContainer-module_axis_l5p4N {
43
+ position: relative;
44
+ padding-left: var(--cv-spacing-lg);
45
+ border-left: 2px solid var(--cv-axis-color);
46
+ display: flex;
47
+ flex-direction: column;
48
+ gap: var(--cv-spacing-sm);
49
+ }
50
+ .cv-TurnContainer-module_turn_K9u-z[data-turn-status='running'] .cv-TurnContainer-module_axis_l5p4N { border-left-color: var(--cv-status-running); }
51
+ .cv-TurnContainer-module_turn_K9u-z[data-turn-status='failed'] .cv-TurnContainer-module_axis_l5p4N { border-left-color: var(--cv-status-failed); }
52
+ .cv-TurnContainer-module_turn_K9u-z[data-turn-status='aborted'] .cv-TurnContainer-module_axis_l5p4N { border-left-color: var(--cv-status-stopped); }
53
+ .cv-Markdown-module_md_aJpGj {
54
+ font-family: var(--cv-font-family);
55
+ font-size: var(--cv-font-size);
56
+ line-height: var(--cv-line-height);
57
+ color: var(--cv-text);
58
+ /* Isolate from any `white-space: pre-wrap` on an ancestor — otherwise the
59
+ * `\n` characters that react-markdown leaves between block siblings
60
+ * (`</p>\n<ul>`) become visible blank lines around lists, code blocks, etc. */
61
+ white-space: normal;
62
+ }
63
+ .cv-Markdown-module_md_aJpGj > :first-child { margin-top: 0; }
64
+ .cv-Markdown-module_md_aJpGj > :last-child { margin-bottom: 0; }
65
+ .cv-Markdown-module_md_aJpGj p { margin: 0 0 0.6em; white-space: pre-wrap; }
66
+ .cv-Markdown-module_md_aJpGj h1, .cv-Markdown-module_md_aJpGj h2, .cv-Markdown-module_md_aJpGj h3, .cv-Markdown-module_md_aJpGj h4 {
67
+ margin: 0.8em 0 0.3em;
68
+ line-height: 1.3;
69
+ font-weight: 600;
70
+ }
71
+ .cv-Markdown-module_md_aJpGj h1 { font-size: 1.25em; }
72
+ .cv-Markdown-module_md_aJpGj h2 { font-size: 1.15em; }
73
+ .cv-Markdown-module_md_aJpGj h3 { font-size: 1.05em; }
74
+ .cv-Markdown-module_md_aJpGj h4 { font-size: 1em; }
75
+ .cv-Markdown-module_md_aJpGj ul, .cv-Markdown-module_md_aJpGj ol { padding-left: 1.4em; margin: 0.3em 0 0.6em; }
76
+ .cv-Markdown-module_md_aJpGj li { margin: 0.15em 0; }
77
+ .cv-Markdown-module_md_aJpGj li > p { margin: 0; }
78
+ .cv-Markdown-module_md_aJpGj a { color: var(--cv-status-running); text-decoration: underline; }
79
+ .cv-Markdown-module_md_aJpGj code {
80
+ font-family: var(--cv-font-mono);
81
+ font-size: 0.88em;
82
+ background: var(--cv-bg-raised);
83
+ padding: 1px 5px;
84
+ border-radius: 3px;
85
+ }
86
+ .cv-Markdown-module_md_aJpGj pre {
87
+ margin: 0.4em 0 0.7em;
88
+ padding: var(--cv-spacing-sm);
89
+ background: var(--cv-bg-code);
90
+ color: var(--cv-fg-code);
91
+ border-radius: var(--cv-radius-sm);
92
+ overflow-x: auto;
93
+ font-size: 0.85em;
94
+ }
95
+ .cv-Markdown-module_md_aJpGj pre code {
96
+ background: transparent;
97
+ padding: 0;
98
+ font-size: inherit;
99
+ color: inherit;
100
+ }
101
+ .cv-Markdown-module_md_aJpGj blockquote {
102
+ margin: 0.4em 0;
103
+ padding: 0.1em 0.8em;
104
+ border-left: 3px solid var(--cv-border);
105
+ color: var(--cv-text-muted);
106
+ }
107
+ .cv-Markdown-module_md_aJpGj hr {
108
+ border: none;
109
+ border-top: 1px solid var(--cv-border);
110
+ margin: 0.8em 0;
111
+ }
112
+ .cv-Markdown-module_md_aJpGj table {
113
+ border-collapse: collapse;
114
+ width: auto;
115
+ font-size: 0.92em;
116
+ margin: 0.4em 0 0.7em;
117
+ }
118
+ .cv-Markdown-module_md_aJpGj th, .cv-Markdown-module_md_aJpGj td {
119
+ border: 1px solid var(--cv-border);
120
+ padding: 4px 8px;
121
+ text-align: left;
122
+ }
123
+ .cv-Markdown-module_md_aJpGj th { background: var(--cv-bg-raised); font-weight: 600; }
124
+ .cv-Markdown-module_md_aJpGj img { max-width: 100%; height: auto; border-radius: var(--cv-radius-sm); }
125
+
126
+ .cv-Markdown-module_plain_920I0 {
127
+ white-space: pre-wrap;
128
+ word-break: break-word;
129
+ }
130
+
131
+ .cv-Markdown-module_directive_oMfF9 {
132
+ display: inline-flex;
133
+ align-items: center;
134
+ gap: 6px;
135
+ margin: 4px 0;
136
+ padding: 2px 9px 2px 7px;
137
+ font-size: 0.82em;
138
+ line-height: 1.5;
139
+ color: var(--cv-text-muted);
140
+ background: var(--cv-bg-raised);
141
+ border: 1px solid var(--cv-border);
142
+ border-radius: 999px;
143
+ text-decoration: none;
144
+ white-space: nowrap;
145
+ max-width: 100%;
146
+ overflow: hidden;
147
+ text-overflow: ellipsis;
148
+ }
149
+ a.cv-Markdown-module_directive_oMfF9:hover {
150
+ color: var(--cv-text);
151
+ border-color: var(--cv-status-running);
152
+ }
153
+ .cv-Markdown-module_directiveIcon_p2NKB {
154
+ font-size: 0.95em;
155
+ color: var(--cv-status-completed, var(--cv-status-running));
156
+ line-height: 1;
157
+ }
158
+ .cv-Markdown-module_directiveLabel_sCtAz {
159
+ color: var(--cv-text);
160
+ font-weight: 500;
161
+ }
162
+ .cv-Markdown-module_directiveCwd_lctnI {
163
+ color: var(--cv-text-muted);
164
+ font-family: var(--cv-font-mono);
165
+ font-size: 0.92em;
166
+ opacity: 0.75;
167
+ }
168
+ .cv-Markdown-module_directiveCwd_lctnI::before { content: '·'; margin-right: 4px; opacity: 0.6; }
169
+ .cv-MessageBubble-module_bubble_p3YO4 {
170
+ max-width: 80%;
171
+ padding: var(--cv-spacing-sm) var(--cv-spacing-md);
172
+ border-radius: var(--cv-radius);
173
+ white-space: pre-wrap;
174
+ word-break: break-word;
175
+ }
176
+ .cv-MessageBubble-module_bubble_p3YO4[data-role='user'] {
177
+ align-self: flex-end;
178
+ background: var(--cv-bg-user-bubble);
179
+ color: var(--cv-text-inverse);
180
+ }
181
+ .cv-MessageBubble-module_bubble_p3YO4[data-role='assistant'] {
182
+ background: var(--cv-bg-assistant-bubble);
183
+ color: var(--cv-text);
184
+ }
185
+ .cv-MessageBubble-module_caret_X01-n {
186
+ display: inline-block;
187
+ margin-left: 2px;
188
+ animation: cv-MessageBubble-module_cv-blink_Wlgqq 1s steps(2) infinite;
189
+ }
190
+ @keyframes cv-MessageBubble-module_cv-blink_Wlgqq { 50% { opacity: 0; } }
191
+ @media (prefers-reduced-motion: reduce) { .cv-MessageBubble-module_caret_X01-n { animation: none; } }
192
+ .cv-ReasoningBlock-module_block_TXeXs {
193
+ border-left: 2px solid var(--cv-border);
194
+ padding-left: var(--cv-spacing-sm);
195
+ }
196
+ .cv-ReasoningBlock-module_summary_0DCmn {
197
+ display: inline-flex;
198
+ align-items: center;
199
+ gap: var(--cv-spacing-xs);
200
+ cursor: pointer;
201
+ color: var(--cv-text-muted);
202
+ font-style: italic;
203
+ list-style: none;
204
+ }
205
+ .cv-ReasoningBlock-module_summary_0DCmn::-webkit-details-marker { display: none; }
206
+ .cv-ReasoningBlock-module_body_hXsT2 {
207
+ margin-top: var(--cv-spacing-xs);
208
+ color: var(--cv-text-muted);
209
+ font-style: italic;
210
+ white-space: pre-wrap;
211
+ }
212
+ .cv-ToolCallBlock-module_block_dNRp9 {
213
+ border: 1px solid var(--cv-border);
214
+ border-radius: var(--cv-radius-sm);
215
+ padding: var(--cv-spacing-sm);
216
+ background: var(--cv-bg-raised);
217
+ display: flex;
218
+ flex-direction: column;
219
+ gap: var(--cv-spacing-xs);
220
+ }
221
+ .cv-ToolCallBlock-module_block_dNRp9[data-status='pending'] { border-left: 3px solid var(--cv-status-pending); }
222
+ .cv-ToolCallBlock-module_block_dNRp9[data-status='running'] { border-left: 3px solid var(--cv-status-running); }
223
+ .cv-ToolCallBlock-module_block_dNRp9[data-status='completed'] { border-left: 3px solid var(--cv-status-completed); }
224
+ .cv-ToolCallBlock-module_block_dNRp9[data-status='failed'] { border-left: 3px solid var(--cv-status-failed); }
225
+ .cv-ToolCallBlock-module_block_dNRp9[data-status='stopped'] { border-left: 3px solid var(--cv-status-stopped); }
226
+
227
+ .cv-ToolCallBlock-module_header_--wWa {
228
+ display: flex;
229
+ align-items: center;
230
+ gap: var(--cv-spacing-xs);
231
+ cursor: pointer;
232
+ list-style: none;
233
+ }
234
+ .cv-ToolCallBlock-module_header_--wWa::-webkit-details-marker { display: none; }
235
+ .cv-ToolCallBlock-module_header_--wWa::before {
236
+ content: '›';
237
+ display: inline-block;
238
+ width: 12px;
239
+ color: var(--cv-text-muted);
240
+ transform: rotate(0deg);
241
+ transition: transform 120ms ease;
242
+ }
243
+ .cv-ToolCallBlock-module_block_dNRp9[open] > .cv-ToolCallBlock-module_header_--wWa::before { transform: rotate(90deg); }
244
+ .cv-ToolCallBlock-module_title_F75hj { font-weight: 600; }
245
+ .cv-ToolCallBlock-module_statusChip_srL2P { margin-left: auto; font-size: 0.75rem; color: var(--cv-text-muted); }
246
+ .cv-ToolCallBlock-module_label_T8ftn { font-size: 0.75rem; color: var(--cv-text-muted); }
247
+ .cv-ToolCallBlock-module_body_4IH9O {
248
+ display: flex;
249
+ flex-direction: column;
250
+ gap: var(--cv-spacing-xs);
251
+ margin-top: var(--cv-spacing-xs);
252
+ }
253
+ .cv-ToolCallBlock-module_code_4TYxX {
254
+ background: var(--cv-bg-code); color: var(--cv-fg-code);
255
+ padding: var(--cv-spacing-sm); border-radius: var(--cv-radius-sm);
256
+ font-family: var(--cv-font-mono); font-size: 0.8rem; overflow-x: auto;
257
+ white-space: pre-wrap;
258
+ }
259
+ .cv-ToolCallBlock-module_error_n7qO- { color: var(--cv-status-failed); font-family: var(--cv-font-mono); font-size: 0.8rem; }
260
+ .cv-ToolCallBlock-module_result_BmMtL summary { cursor: pointer; font-size: 0.75rem; color: var(--cv-text-muted); }
261
+ .cv-ExecBlock-module_block_GHBDd {
262
+ background: var(--cv-bg-code);
263
+ color: var(--cv-fg-code);
264
+ border-radius: var(--cv-radius-sm);
265
+ padding: var(--cv-spacing-sm);
266
+ display: flex; flex-direction: column; gap: var(--cv-spacing-xs);
267
+ font-family: var(--cv-font-mono); font-size: 0.85rem;
268
+ overflow: hidden;
269
+ }
270
+ .cv-ExecBlock-module_header_-s9DN {
271
+ display: flex;
272
+ align-items: center;
273
+ gap: var(--cv-spacing-xs);
274
+ cursor: pointer;
275
+ list-style: none;
276
+ }
277
+ .cv-ExecBlock-module_header_-s9DN::-webkit-details-marker { display: none; }
278
+ .cv-ExecBlock-module_header_-s9DN::before {
279
+ content: '›';
280
+ display: inline-block;
281
+ width: 12px;
282
+ color: var(--cv-text-muted);
283
+ transform: rotate(0deg);
284
+ transition: transform 120ms ease;
285
+ }
286
+ .cv-ExecBlock-module_block_GHBDd[open] > .cv-ExecBlock-module_header_-s9DN::before { transform: rotate(90deg); }
287
+ .cv-ExecBlock-module_body_cKLAV { display: flex; flex-direction: column; gap: var(--cv-spacing-xs); margin-top: var(--cv-spacing-xs); }
288
+ .cv-ExecBlock-module_cmd_KpfNN { white-space: pre-wrap; word-break: break-word; flex: 1; }
289
+ .cv-ExecBlock-module_exit_H-E6L { font-size: 0.75rem; opacity: 0.7; }
290
+ .cv-ExecBlock-module_stdout_IHwS1 { white-space: pre-wrap; word-break: break-word; }
291
+ .cv-ExecBlock-module_stderr_-DESS { white-space: pre-wrap; word-break: break-word; color: var(--cv-status-failed); }
292
+ .cv-ExecBlock-module_shimmer_e98BB {
293
+ height: 4px; border-radius: 2px;
294
+ background: linear-gradient(90deg, transparent, var(--cv-shimmer-color), transparent);
295
+ background-size: 200% 100%;
296
+ animation: cv-ExecBlock-module_cv-shimmer_dfHrd 1.4s linear infinite;
297
+ }
298
+ @keyframes cv-ExecBlock-module_cv-shimmer_dfHrd {
299
+ from { background-position: -100% 0; }
300
+ to { background-position: 100% 0; }
301
+ }
302
+ @media (prefers-reduced-motion: reduce) { .cv-ExecBlock-module_shimmer_e98BB { animation: none; } }
303
+ .cv-SearchBlock-module_block_1e-lg { display: flex; flex-direction: column; gap: var(--cv-spacing-xs); }
304
+ .cv-SearchBlock-module_header_US9Dx {
305
+ display: flex;
306
+ align-items: center;
307
+ gap: var(--cv-spacing-xs);
308
+ font-weight: 500;
309
+ cursor: pointer;
310
+ list-style: none;
311
+ }
312
+ .cv-SearchBlock-module_header_US9Dx::-webkit-details-marker { display: none; }
313
+ .cv-SearchBlock-module_header_US9Dx::before {
314
+ content: '›';
315
+ display: inline-block;
316
+ width: 12px;
317
+ color: var(--cv-text-muted);
318
+ transform: rotate(0deg);
319
+ transition: transform 120ms ease;
320
+ }
321
+ .cv-SearchBlock-module_block_1e-lg[open] > .cv-SearchBlock-module_header_US9Dx::before { transform: rotate(90deg); }
322
+ .cv-SearchBlock-module_body_ejMnH { display: flex; flex-direction: column; gap: var(--cv-spacing-xs); margin-top: var(--cv-spacing-xs); }
323
+ .cv-SearchBlock-module_query_-MKAZ { color: var(--cv-text); }
324
+ .cv-SearchBlock-module_results_98bPq { padding-left: var(--cv-spacing-md); margin: 0; }
325
+ .cv-SearchBlock-module_results_98bPq li { margin-bottom: var(--cv-spacing-xs); }
326
+ .cv-SearchBlock-module_results_98bPq a { color: var(--cv-status-running); text-decoration: underline; }
327
+ .cv-SearchBlock-module_snippet_5UfAk { margin: 2px 0 0; color: var(--cv-text-muted); font-size: 0.85rem; }
328
+ .cv-SearchBlock-module_more_87QEd {
329
+ align-self: flex-start;
330
+ background: none; border: none; cursor: pointer;
331
+ color: var(--cv-status-running); padding: 0; font-size: 0.85rem;
332
+ }
333
+ .cv-PatchBlock-module_block_hODNV { display: flex; flex-direction: column; gap: var(--cv-spacing-xs); }
334
+ .cv-PatchBlock-module_header_hKbgB {
335
+ display: flex;
336
+ align-items: center;
337
+ gap: var(--cv-spacing-xs);
338
+ font-weight: 500;
339
+ cursor: pointer;
340
+ list-style: none;
341
+ }
342
+ .cv-PatchBlock-module_header_hKbgB::-webkit-details-marker { display: none; }
343
+ .cv-PatchBlock-module_header_hKbgB::before {
344
+ content: '›';
345
+ display: inline-block;
346
+ width: 12px;
347
+ color: var(--cv-text-muted);
348
+ transform: rotate(0deg);
349
+ transition: transform 120ms ease;
350
+ }
351
+ .cv-PatchBlock-module_block_hODNV[open] > .cv-PatchBlock-module_header_hKbgB::before { transform: rotate(90deg); }
352
+ .cv-PatchBlock-module_files_RTnl0 { list-style: none; padding: 0; margin: var(--cv-spacing-xs) 0 0; display: flex; flex-direction: column; gap: 2px; }
353
+ .cv-PatchBlock-module_files_RTnl0 summary { display: flex; align-items: center; gap: var(--cv-spacing-xs); cursor: pointer; padding: 2px 0; }
354
+ .cv-PatchBlock-module_tag_9PGRP { font-size: 0.7rem; padding: 1px 6px; border-radius: 4px; background: var(--cv-bg-raised); color: var(--cv-text-muted); }
355
+ .cv-PatchBlock-module_tag_9PGRP[data-kind='added'] { background: var(--cv-diff-add-bg); color: var(--cv-status-completed); }
356
+ .cv-PatchBlock-module_tag_9PGRP[data-kind='deleted'] { background: var(--cv-diff-del-bg); color: var(--cv-status-failed); }
357
+ .cv-PatchBlock-module_diff_zboyM {
358
+ background: var(--cv-bg-code); color: var(--cv-fg-code);
359
+ padding: var(--cv-spacing-sm); border-radius: var(--cv-radius-sm);
360
+ font-family: var(--cv-font-mono); font-size: 0.8rem;
361
+ white-space: pre-wrap; overflow-x: auto;
362
+ }
363
+ .cv-PatchBlock-module_add_Y2VHb { background: var(--cv-diff-add-bg); color: #032b14; }
364
+ .cv-PatchBlock-module_del_i2akI { background: var(--cv-diff-del-bg); color: #67060c; }
365
+ .cv-TodoListBlock-module_block_JRgID {
366
+ border-left: 3px solid var(--cv-status-running);
367
+ padding: var(--cv-spacing-sm) var(--cv-spacing-md);
368
+ background: var(--cv-bg-raised);
369
+ border-radius: var(--cv-radius-sm);
370
+ }
371
+ .cv-TodoListBlock-module_block_JRgID[data-status='completed'] { border-left-color: var(--cv-status-completed); }
372
+ .cv-TodoListBlock-module_block_JRgID[data-status='failed'] { border-left-color: var(--cv-status-failed); }
373
+
374
+ .cv-TodoListBlock-module_summary_W3C5h {
375
+ display: inline-flex;
376
+ align-items: center;
377
+ gap: var(--cv-spacing-xs);
378
+ cursor: pointer;
379
+ font-weight: 500;
380
+ list-style: none;
381
+ }
382
+ .cv-TodoListBlock-module_summary_W3C5h::-webkit-details-marker { display: none; }
383
+ .cv-TodoListBlock-module_icon_TwtNR { font-size: 14px; }
384
+
385
+ .cv-TodoListBlock-module_list_YIRUN {
386
+ list-style: none;
387
+ padding: var(--cv-spacing-xs) 0 0;
388
+ margin: 0;
389
+ display: flex;
390
+ flex-direction: column;
391
+ gap: 2px;
392
+ }
393
+ .cv-TodoListBlock-module_entry_KfZlY {
394
+ display: flex;
395
+ align-items: flex-start;
396
+ gap: var(--cv-spacing-xs);
397
+ padding: 2px 0;
398
+ font-size: 0.9rem;
399
+ }
400
+ .cv-TodoListBlock-module_entry_KfZlY[data-completed='true'] .cv-TodoListBlock-module_text_SxUVW {
401
+ color: var(--cv-text-muted);
402
+ text-decoration: line-through;
403
+ }
404
+ .cv-TodoListBlock-module_check_t7lTt { font-family: var(--cv-font-mono); }
405
+ .cv-TodoListBlock-module_text_SxUVW { white-space: pre-wrap; word-break: break-word; flex: 1; }
406
+ .cv-ErrorBlock-module_block_TlAYA {
407
+ display: flex;
408
+ align-items: center;
409
+ gap: var(--cv-spacing-xs);
410
+ padding: var(--cv-spacing-sm) var(--cv-spacing-md);
411
+ background: var(--cv-diff-del-bg);
412
+ color: var(--cv-status-failed);
413
+ border-radius: var(--cv-radius-sm);
414
+ border-left: 3px solid var(--cv-status-failed);
415
+ font-size: 0.9rem;
416
+ }
417
+ .cv-ErrorBlock-module_message_hJ57N { white-space: pre-wrap; word-break: break-word; }
418
+ .cv-RawEventBlock-module_block_SSjbJ { border: 1px dashed var(--cv-border); border-radius: var(--cv-radius-sm); padding: var(--cv-spacing-xs) var(--cv-spacing-sm); background: var(--cv-bg-raised); }
419
+ .cv-RawEventBlock-module_summary_cjM7J { display: flex; align-items: center; gap: var(--cv-spacing-xs); cursor: pointer; color: var(--cv-text-muted); list-style: none; }
420
+ .cv-RawEventBlock-module_summary_cjM7J::-webkit-details-marker { display: none; }
421
+ .cv-RawEventBlock-module_code_WK6CT {
422
+ margin: var(--cv-spacing-xs) 0 0;
423
+ background: var(--cv-bg-code); color: var(--cv-fg-code);
424
+ padding: var(--cv-spacing-sm); border-radius: var(--cv-radius-sm);
425
+ font-family: var(--cv-font-mono); font-size: 0.8rem; white-space: pre-wrap;
426
+ }
427
+ .cv-StatusBar-module_bar_fBXHf {
428
+ display: flex;
429
+ align-items: center;
430
+ gap: var(--cv-spacing-sm);
431
+ padding: var(--cv-spacing-sm) var(--cv-spacing-md);
432
+ border-bottom: 1px solid var(--cv-border);
433
+ background: var(--cv-bg-raised);
434
+ font-size: 0.875rem;
435
+ }
436
+ .cv-StatusBar-module_bar_fBXHf[data-status='working'] { color: var(--cv-status-running); }
437
+ .cv-StatusBar-module_bar_fBXHf[data-status='completed'] { color: var(--cv-status-completed); }
438
+ .cv-StatusBar-module_bar_fBXHf[data-status='failed'] { color: var(--cv-status-failed); }
439
+ .cv-StatusBar-module_bar_fBXHf[data-status='stopped'] { color: var(--cv-status-stopped); }
440
+
441
+ .cv-StatusBar-module_pulse_t8PkB {
442
+ width: 8px;
443
+ height: 8px;
444
+ border-radius: 50%;
445
+ background: currentColor;
446
+ animation: cv-StatusBar-module_cv-pulse_clFHA 1.4s ease-in-out infinite;
447
+ }
448
+ @keyframes cv-StatusBar-module_cv-pulse_clFHA {
449
+ 0%, 100% { opacity: 1; transform: scale(1); }
450
+ 50% { opacity: 0.4; transform: scale(0.8); }
451
+ }
452
+ @media (prefers-reduced-motion: reduce) {
453
+ .cv-StatusBar-module_pulse_t8PkB { animation: none; opacity: 1; }
454
+ }
455
+ .cv-StatusBar-module_label_4CK2X { font-weight: 500; }
456
+ .cv-StatusBar-module_errorDetails_MEtRk { margin-left: auto; max-width: 50%; }
457
+ .cv-StatusBar-module_errorDetails_MEtRk summary { cursor: pointer; }
458
+ .cv-StatusBar-module_errorDetails_MEtRk pre { font-size: 0.75rem; overflow-x: auto; }
459
+ .cv-reset-module_root_dBpwH {
460
+ all: initial;
461
+ display: block;
462
+ font-family: var(--cv-font-family);
463
+ font-size: var(--cv-font-size);
464
+ line-height: var(--cv-line-height);
465
+ color: var(--cv-text);
466
+ background: var(--cv-bg);
467
+ box-sizing: border-box;
468
+ }
469
+ .cv-reset-module_root_dBpwH *,
470
+ .cv-reset-module_root_dBpwH *::before,
471
+ .cv-reset-module_root_dBpwH *::after {
472
+ box-sizing: inherit;
473
+ }
474
+ .cv-CodexTranscript-module_root_q2BZd {
475
+ display: flex; flex-direction: column;
476
+ background: var(--cv-bg);
477
+ color: var(--cv-text);
478
+ min-height: 0;
479
+ }
480
+ .cv-CodexTranscript-module_list_5O-5s { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
481
+ .cv-CodexTranscript-module_empty_ACH87 {
482
+ padding: var(--cv-spacing-lg);
483
+ color: var(--cv-text-muted);
484
+ text-align: center;
485
+ font-size: 0.9rem;
486
+ }
487
+ .cv-CodexTranscript-module_omitted_xwSHT {
488
+ padding: var(--cv-spacing-xs) var(--cv-spacing-md);
489
+ font-size: 0.75rem;
490
+ color: var(--cv-text-muted);
491
+ background: var(--cv-bg-raised);
492
+ text-align: center;
493
+ }
@@ -0,0 +1,164 @@
1
+ /**
2
+ * Token usage emitted by `turn_completed`.
3
+ */
4
+ export interface TokenUsage {
5
+ inputTokens: number;
6
+ outputTokens: number;
7
+ cachedInputTokens?: number;
8
+ reasoningOutputTokens?: number;
9
+ }
10
+ /** Result of a single web search hit. */
11
+ export interface SearchResult {
12
+ title: string;
13
+ url: string;
14
+ snippet?: string;
15
+ }
16
+ /** Single file in a patch_apply result. */
17
+ export interface PatchFile {
18
+ path: string;
19
+ status: 'added' | 'modified' | 'deleted';
20
+ /** Unified git diff text. Optional because some events only carry metadata. */
21
+ diff?: string;
22
+ }
23
+ /**
24
+ * The discriminated union of events CodexView consumes.
25
+ *
26
+ * Source of truth: agentweb `backend/src/codex/eventMap.ts` `NormalizedEvent`.
27
+ * This file is the contract boundary — it intentionally re-declares the shapes
28
+ * so that consumers don't have to depend on agentweb internals.
29
+ */
30
+ export type ChatStreamEvent = {
31
+ type: 'thread_started';
32
+ threadId: string;
33
+ at: number;
34
+ } | {
35
+ type: 'turn_started';
36
+ turnId: string;
37
+ at: number;
38
+ } | {
39
+ type: 'turn_completed';
40
+ turnId: string;
41
+ at: number;
42
+ usage?: TokenUsage;
43
+ } | {
44
+ type: 'turn_failed';
45
+ turnId: string;
46
+ at: number;
47
+ error: {
48
+ message: string;
49
+ code?: string;
50
+ };
51
+ } | {
52
+ type: 'turn_aborted';
53
+ turnId: string;
54
+ at: number;
55
+ reason?: string;
56
+ } | {
57
+ type: 'user_message';
58
+ turnId: string;
59
+ itemId: string;
60
+ text: string;
61
+ at: number;
62
+ } | {
63
+ type: 'agent_message';
64
+ turnId: string;
65
+ itemId: string;
66
+ text: string;
67
+ partial: boolean;
68
+ at: number;
69
+ } | {
70
+ type: 'reasoning';
71
+ turnId: string;
72
+ itemId: string;
73
+ text: string;
74
+ partial: boolean;
75
+ at: number;
76
+ } | {
77
+ type: 'function_call';
78
+ turnId: string;
79
+ callId: string;
80
+ name: string;
81
+ args: unknown;
82
+ at: number;
83
+ } | {
84
+ type: 'function_call_output';
85
+ turnId: string;
86
+ callId: string;
87
+ output?: unknown;
88
+ error?: string;
89
+ at: number;
90
+ } | {
91
+ type: 'exec_command_begin';
92
+ turnId: string;
93
+ callId: string;
94
+ command: string;
95
+ at: number;
96
+ } | {
97
+ type: 'exec_command_end';
98
+ turnId: string;
99
+ callId: string;
100
+ exit: number;
101
+ stdout: string;
102
+ stderr: string;
103
+ durationMs: number;
104
+ at: number;
105
+ } | {
106
+ type: 'mcp_tool_call';
107
+ turnId: string;
108
+ callId: string;
109
+ server: string;
110
+ name: string;
111
+ args: unknown;
112
+ at: number;
113
+ } | {
114
+ type: 'mcp_tool_call_output';
115
+ turnId: string;
116
+ callId: string;
117
+ output?: unknown;
118
+ error?: string;
119
+ at: number;
120
+ } | {
121
+ type: 'web_search_call';
122
+ turnId: string;
123
+ callId: string;
124
+ query: string;
125
+ at: number;
126
+ } | {
127
+ type: 'web_search_end';
128
+ turnId: string;
129
+ callId: string;
130
+ results: SearchResult[];
131
+ at: number;
132
+ } | {
133
+ type: 'patch_apply_end';
134
+ turnId: string;
135
+ callId: string;
136
+ files: PatchFile[];
137
+ ok: boolean;
138
+ at: number;
139
+ } | {
140
+ type: 'todo_list';
141
+ turnId: string;
142
+ itemId: string;
143
+ items: TodoEntry[];
144
+ at: number;
145
+ } | {
146
+ type: 'error_item';
147
+ turnId: string;
148
+ itemId: string;
149
+ message: string;
150
+ at: number;
151
+ } | {
152
+ type: 'raw';
153
+ turnId?: string;
154
+ itemId?: string;
155
+ payload: unknown;
156
+ at: number;
157
+ };
158
+ /** A single entry in a plan / todo list. */
159
+ export interface TodoEntry {
160
+ text: string;
161
+ completed: boolean;
162
+ }
163
+ /** Helpful narrowing alias. */
164
+ export type ChatStreamEventType = ChatStreamEvent['type'];