@crewlethq/ui 0.153.0 → 0.154.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.
Files changed (98) hide show
  1. package/dist/AgentHandoffPanel/index.js +9 -9
  2. package/dist/AppShell/index.js +3 -3
  3. package/dist/ArrangeList/index.js +2 -2
  4. package/dist/ArtifactBar/index.js +1 -1
  5. package/dist/ArtifactCard/index.js +2 -2
  6. package/dist/AuthLayout/index.js +1 -1
  7. package/dist/BriefCard/index.js +1 -1
  8. package/dist/ChatThread/index.js +3 -3
  9. package/dist/Combobox/index.js +2 -2
  10. package/dist/CommandPalette/index.js +5 -5
  11. package/dist/CommentThread/index.js +9 -9
  12. package/dist/Composer/index.js +5 -5
  13. package/dist/DataGrid/index.js +6 -6
  14. package/dist/DataTable/index.js +4 -4
  15. package/dist/DataView/index.js +6 -6
  16. package/dist/DatasetSource/index.js +1 -1
  17. package/dist/DeepWorkCard/index.js +1 -1
  18. package/dist/DocTabsEditor/index.js +6 -6
  19. package/dist/DockColumn/index.js +1 -1
  20. package/dist/DurationField/index.js +5 -5
  21. package/dist/EditingStatus/index.js +2 -2
  22. package/dist/EntityList/index.js +1 -1
  23. package/dist/InlineEditor/index.js +3 -3
  24. package/dist/KeyValueRows/index.js +3 -3
  25. package/dist/ListInput/index.js +6 -6
  26. package/dist/NumberField/index.js +3 -3
  27. package/dist/OpenInAppCard/index.js +2 -2
  28. package/dist/OrgTable/index.js +8 -8
  29. package/dist/PrincipalPicker/index.js +3 -3
  30. package/dist/ProposalCard/index.js +3 -3
  31. package/dist/RailList/index.js +6 -6
  32. package/dist/RefusalCard/index.js +1 -1
  33. package/dist/ResultTableCard/index.js +1 -1
  34. package/dist/RichEditor/index.js +2 -2
  35. package/dist/SectionFrame/index.js +3 -3
  36. package/dist/Select/index.js +2 -2
  37. package/dist/SendKeys/index.js +2 -2
  38. package/dist/SettingForm/index.js +3 -3
  39. package/dist/SettingsTable/index.js +1 -1
  40. package/dist/SetupWizard/index.js +1 -1
  41. package/dist/ShareDialog/index.js +5 -5
  42. package/dist/SheetColumnEditor/index.js +7 -7
  43. package/dist/SidebarNav/index.js +2 -2
  44. package/dist/SlideFilmstrip/index.js +4 -4
  45. package/dist/StatusCard/index.js +1 -1
  46. package/dist/Switcher/index.js +5 -5
  47. package/dist/TableCells/index.js +1 -1
  48. package/dist/TimeRangePicker/index.js +4 -4
  49. package/dist/TimeWindowPicker/index.js +5 -5
  50. package/dist/ToolCallLog/ToolCallLog.d.ts +97 -0
  51. package/dist/ToolCallLog/index.d.ts +3 -0
  52. package/dist/ToolCallLog/index.js +22 -0
  53. package/dist/ToolCallLog-WSK6TEGH.css +288 -0
  54. package/dist/TreeCanvas/index.js +2 -2
  55. package/dist/TreeGrid/index.js +7 -7
  56. package/dist/ValueField/index.js +4 -4
  57. package/dist/chunk-4U5ATJPP.js +194 -0
  58. package/dist/{chunk-DWXTJWCJ.js → chunk-5V2DNF3F.js} +3 -3
  59. package/dist/{chunk-6BGD32C5.js → chunk-7DLIVPK4.js} +2 -2
  60. package/dist/{chunk-D33K2BCZ.js → chunk-C6F5HISC.js} +1 -1
  61. package/dist/{chunk-CJAPAIJG.js → chunk-CFVKNEGM.js} +2 -2
  62. package/dist/{chunk-3Q5USPLM.js → chunk-CSLONHHB.js} +1 -1
  63. package/dist/{chunk-ITZAWYRG.js → chunk-DBXXJOGQ.js} +1 -1
  64. package/dist/{chunk-F6OYNO7O.js → chunk-E6STS4FD.js} +2 -2
  65. package/dist/{chunk-QRUQOITJ.js → chunk-GMHP5KXF.js} +1 -1
  66. package/dist/{chunk-M4VA76JF.js → chunk-MTJ7KNHZ.js} +3 -3
  67. package/dist/{chunk-JUZKRHQB.js → chunk-PPQ3VJUE.js} +1 -1
  68. package/dist/{chunk-S4ADDFRT.js → chunk-S53XH4SS.js} +1 -1
  69. package/dist/{chunk-OX332RI7.js → chunk-SZU2JNJN.js} +1 -1
  70. package/dist/{chunk-RUKSDKG5.js → chunk-WA4BKMRI.js} +1 -1
  71. package/dist/{chunk-CA62YCFK.js → chunk-WTWYN7Z5.js} +1 -1
  72. package/dist/{chunk-U3ZUZ7VU.js → chunk-Z2YOBQHX.js} +2 -2
  73. package/dist/{chunk-ECYA6XZL.js → chunk-ZPD4XF4H.js} +2 -2
  74. package/dist/generated/index.d.ts +1 -0
  75. package/dist/generated/index.js +84 -83
  76. package/dist/index.js +84 -83
  77. package/dist/styles.css +291 -0
  78. package/package.json +3 -3
  79. package/dist/{Editor-LGZMJEUD.js → Editor-VMQ5DK6H.js} +3 -3
  80. package/dist/{chunk-N3R2POGO.js → chunk-2E4MAF6Z.js} +1 -1
  81. package/dist/{chunk-7FY7L6WD.js → chunk-46YFRLA2.js} +1 -1
  82. package/dist/{chunk-KRF3GQ63.js → chunk-6N53ZWRM.js} +1 -1
  83. package/dist/{chunk-Q3SHCEXN.js → chunk-77J2YS55.js} +1 -1
  84. package/dist/{chunk-VXTRPLNB.js → chunk-BFJE3C7Q.js} +1 -1
  85. package/dist/{chunk-657WR3MX.js → chunk-D5UVJL4I.js} +1 -1
  86. package/dist/{chunk-TTUFOH2Y.js → chunk-FNX3YS55.js} +1 -1
  87. package/dist/{chunk-O2J5PSWI.js → chunk-FYJAWS4E.js} +1 -1
  88. package/dist/{chunk-7CVV3DQC.js → chunk-GTJR4APZ.js} +1 -1
  89. package/dist/{chunk-RXHY5T2Z.js → chunk-KJBDOWG7.js} +1 -1
  90. package/dist/{chunk-EDQHZOU3.js → chunk-LPTQN7RS.js} +1 -1
  91. package/dist/{chunk-2DASEYUG.js → chunk-MC5JMA2T.js} +0 -0
  92. package/dist/{chunk-PW6QXVIX.js → chunk-STYJH473.js} +2 -2
  93. package/dist/{chunk-WAF36OFS.js → chunk-T3BIW52Y.js} +1 -1
  94. package/dist/{chunk-7FWYJCKT.js → chunk-WCV44AYD.js} +1 -1
  95. package/dist/{chunk-YWPUT6JQ.js → chunk-YBUUPA5R.js} +1 -1
  96. package/dist/{chunk-5ORAUELE.js → chunk-YGMCXWRA.js} +1 -1
  97. package/dist/{chunk-NG6GEBSJ.js → chunk-YRMDDNFY.js} +1 -1
  98. package/dist/{chunk-UZMXC5T6.js → chunk-YUVQUJND.js} +1 -1
@@ -0,0 +1,288 @@
1
+ /*
2
+ * ToolCallLog: an agent's run as rows in a well, a code block's surface. Tool
3
+ * rows are a status mark, the tool, its key argument in mono and a duration;
4
+ * the agent's own words read as sans narration between them.
5
+ */
6
+
7
+ .crewlet-tool-call-log {
8
+ display: flex;
9
+ flex-direction: column;
10
+ min-width: 0;
11
+ border: 1px solid var(--color-border-default);
12
+ border-radius: var(--radius-md);
13
+ background: var(--color-surface-subtle);
14
+ overflow: hidden;
15
+ }
16
+
17
+ /* Straight in a card it takes the card's surface, as a code block does. */
18
+ .crewlet-card > .crewlet-tool-call-log {
19
+ border: 0;
20
+ border-radius: var(--radius-none);
21
+ background: transparent;
22
+ }
23
+
24
+ .crewlet-tool-call-log__header {
25
+ display: flex;
26
+ align-items: center;
27
+ justify-content: space-between;
28
+ gap: var(--spacing-3);
29
+ min-height: var(--size-row-md);
30
+ padding: var(--spacing-1) var(--spacing-2) var(--spacing-1) var(--spacing-3);
31
+ border-bottom: 1px solid var(--color-border-default);
32
+ }
33
+
34
+ .crewlet-tool-call-log__title {
35
+ display: flex;
36
+ flex-wrap: wrap;
37
+ align-items: baseline;
38
+ column-gap: var(--spacing-2);
39
+ min-width: 0;
40
+ }
41
+
42
+ .crewlet-tool-call-log__label {
43
+ font-size: var(--font-size-compact);
44
+ font-weight: var(--font-weight-semibold);
45
+ color: var(--color-text-primary);
46
+ }
47
+
48
+ .crewlet-tool-call-log__caption {
49
+ min-width: 0;
50
+ font-size: var(--font-size-xs);
51
+ color: var(--color-text-tertiary);
52
+ overflow-wrap: anywhere;
53
+ }
54
+
55
+ .crewlet-tool-call-log__copy {
56
+ flex: none;
57
+ }
58
+
59
+ /* Grows with its rows up to the bound, then scrolls inside the thread. */
60
+ .crewlet-tool-call-log__body {
61
+ display: flex;
62
+ flex-direction: column;
63
+ min-height: 0;
64
+ max-height: var(--crewlet-tool-call-log-max-height, 28rem);
65
+ }
66
+
67
+ .crewlet-tool-call-log__thread .crewlet-chat-thread__items {
68
+ gap: var(--spacing-1);
69
+ padding: var(--spacing-2) var(--spacing-3);
70
+ }
71
+
72
+ /* Room for the focus ring of the first and last rows' controls. */
73
+ .crewlet-tool-call-log__thread .crewlet-chat-thread__scroller {
74
+ scroll-padding-block: var(--spacing-2);
75
+ }
76
+
77
+ .crewlet-tool-call-log__call,
78
+ .crewlet-tool-call-log__group {
79
+ --crewlet-tool-call-log-gutter: calc(14px + var(--spacing-2));
80
+
81
+ display: flex;
82
+ flex-direction: column;
83
+ gap: calc(var(--spacing-1) / 2);
84
+ min-width: 0;
85
+ padding-block: calc(var(--spacing-1) / 2);
86
+ }
87
+
88
+ .crewlet-tool-call-log__head {
89
+ display: grid;
90
+ grid-template-columns: auto auto minmax(0, 1fr) auto;
91
+ align-items: center;
92
+ column-gap: var(--spacing-2);
93
+ min-width: 0;
94
+ min-height: var(--size-target-min);
95
+ }
96
+
97
+ .crewlet-tool-call-log__mark {
98
+ display: inline-flex;
99
+ align-items: center;
100
+ justify-content: center;
101
+ width: 14px;
102
+ color: var(--color-text-tertiary);
103
+ }
104
+
105
+ .crewlet-tool-call-log__mark-glyph {
106
+ display: inline-flex;
107
+ }
108
+
109
+ .crewlet-tool-call-log__mark--ok {
110
+ color: var(--color-feedback-success-ink);
111
+ }
112
+
113
+ .crewlet-tool-call-log__mark--error {
114
+ color: var(--color-feedback-danger-ink);
115
+ }
116
+
117
+ .crewlet-tool-call-log__mark--running {
118
+ color: var(--color-text-secondary);
119
+ }
120
+
121
+ .crewlet-tool-call-log__tool {
122
+ font-size: var(--font-size-compact);
123
+ font-weight: var(--font-weight-semibold);
124
+ line-height: var(--font-line-height-snug);
125
+ color: var(--color-text-primary);
126
+ white-space: nowrap;
127
+ }
128
+
129
+ /* One line, cut to fit: the whole argument is its title and the open input. */
130
+ .crewlet-tool-call-log__detail {
131
+ min-width: 0;
132
+ overflow: hidden;
133
+ font-family: var(--font-family-mono);
134
+ font-size: var(--font-size-xs);
135
+ line-height: var(--font-line-height-snug);
136
+ color: var(--color-text-secondary);
137
+ text-overflow: ellipsis;
138
+ white-space: nowrap;
139
+ }
140
+
141
+ .crewlet-tool-call-log__duration {
142
+ font-size: var(--font-size-xs);
143
+ font-variant-numeric: tabular-nums;
144
+ color: var(--color-text-tertiary);
145
+ white-space: nowrap;
146
+ }
147
+
148
+ .crewlet-tool-call-log__error,
149
+ .crewlet-tool-call-log__more,
150
+ .crewlet-tool-call-log__full {
151
+ margin: 0;
152
+ margin-inline-start: var(--crewlet-tool-call-log-gutter);
153
+ }
154
+
155
+ .crewlet-tool-call-log__error {
156
+ min-width: 0;
157
+ font-family: var(--font-family-mono);
158
+ font-size: var(--font-size-xs);
159
+ line-height: var(--font-line-height-normal);
160
+ color: var(--color-feedback-danger-ink);
161
+ white-space: pre-wrap;
162
+ overflow-wrap: anywhere;
163
+ }
164
+
165
+ /* A run's count of failures is words, not output. */
166
+ .crewlet-tool-call-log__error--count {
167
+ font-family: var(--font-family-sans);
168
+ }
169
+
170
+ /* A quiet text control: the words and a chevron, the kit's focus ring. */
171
+ .crewlet-tool-call-log__more,
172
+ .crewlet-tool-call-log__group-toggle {
173
+ display: inline-flex;
174
+ align-items: center;
175
+ gap: var(--spacing-1);
176
+ min-width: 0;
177
+ min-height: var(--size-target-min);
178
+ padding: 0 var(--spacing-1);
179
+ border: 0;
180
+ border-radius: var(--radius-xs);
181
+ background: transparent;
182
+ font: inherit;
183
+ cursor: pointer;
184
+ }
185
+
186
+ .crewlet-tool-call-log__more {
187
+ align-self: flex-start;
188
+ margin-inline-start: calc(var(--crewlet-tool-call-log-gutter) - var(--spacing-1));
189
+ font-size: var(--font-size-xs);
190
+ line-height: var(--font-line-height-normal);
191
+ color: var(--color-text-link-quiet);
192
+ }
193
+
194
+ .crewlet-tool-call-log__group-toggle {
195
+ margin-inline: calc(var(--spacing-1) * -1) 0;
196
+ color: inherit;
197
+ }
198
+
199
+ .crewlet-tool-call-log__more:hover,
200
+ .crewlet-tool-call-log__group-toggle:hover {
201
+ background: var(--color-surface-hover);
202
+ }
203
+
204
+ .crewlet-tool-call-log__more:focus-visible,
205
+ .crewlet-tool-call-log__group-toggle:focus-visible {
206
+ outline: 2px solid var(--color-focus);
207
+ outline-offset: 0;
208
+ }
209
+
210
+ .crewlet-tool-call-log__chevron {
211
+ display: inline-flex;
212
+ color: var(--color-text-tertiary);
213
+ }
214
+
215
+ .crewlet-tool-call-log__full[hidden],
216
+ .crewlet-tool-call-log__members[hidden] {
217
+ display: none;
218
+ }
219
+
220
+ .crewlet-tool-call-log__input {
221
+ margin: var(--spacing-1) 0 0;
222
+ padding: var(--spacing-2);
223
+ border-radius: var(--radius-sm);
224
+ background: var(--color-surface-inset);
225
+ font-family: var(--font-family-mono);
226
+ font-size: var(--font-size-xs);
227
+ line-height: var(--font-line-height-normal);
228
+ color: var(--color-text-secondary);
229
+ white-space: pre-wrap;
230
+ overflow-wrap: anywhere;
231
+ }
232
+
233
+ .crewlet-tool-call-log__unkept {
234
+ margin: var(--spacing-1) 0 0;
235
+ font-size: var(--font-size-xs);
236
+ color: var(--color-text-tertiary);
237
+ }
238
+
239
+ .crewlet-tool-call-log__members {
240
+ display: flex;
241
+ flex-direction: column;
242
+ min-width: 0;
243
+ margin-inline-start: var(--crewlet-tool-call-log-gutter);
244
+ padding-inline-start: var(--spacing-2);
245
+ border-inline-start: 1px solid var(--color-border-default);
246
+ }
247
+
248
+ /* Narration: the agent's own words, sans and primary, set off from the rows. */
249
+ .crewlet-tool-call-log__say {
250
+ margin: var(--spacing-1) 0;
251
+ font-family: var(--font-family-sans);
252
+ font-size: var(--font-size-compact);
253
+ line-height: var(--font-line-height-body);
254
+ color: var(--color-text-primary);
255
+ white-space: pre-wrap;
256
+ overflow-wrap: anywhere;
257
+ }
258
+
259
+ .crewlet-tool-call-log__note {
260
+ display: flex;
261
+ align-items: flex-start;
262
+ gap: var(--spacing-2);
263
+ margin: var(--spacing-1) 0;
264
+ font-size: var(--font-size-xs);
265
+ line-height: var(--font-line-height-normal);
266
+ color: var(--color-text-tertiary);
267
+ white-space: pre-wrap;
268
+ overflow-wrap: anywhere;
269
+ }
270
+
271
+ .crewlet-tool-call-log__note-mark {
272
+ display: inline-flex;
273
+ flex: none;
274
+ height: calc(var(--font-size-xs) * var(--font-line-height-normal));
275
+ align-items: center;
276
+ }
277
+
278
+ .crewlet-tool-call-log__note-text {
279
+ min-width: 0;
280
+ }
281
+
282
+ .crewlet-tool-call-log__note--warning {
283
+ color: var(--color-feedback-warning-ink);
284
+ }
285
+
286
+ .crewlet-tool-call-log__note--danger {
287
+ color: var(--color-feedback-danger-ink);
288
+ }
@@ -2,11 +2,11 @@ export { TREE_ADD_MARK_MIN_ZOOM, TreeCanvas } from '../chunk-HHTAGV5R.js';
2
2
  import '../chunk-MY374UUD.js';
3
3
  import '../chunk-JD5K6Y7Q.js';
4
4
  import '../chunk-CUEPPDBC.js';
5
- import '../chunk-SK4BIFTG.js';
6
- import '../chunk-COS6LJ4K.js';
7
5
  import '../chunk-VBBLHS2Y.js';
8
6
  import '../chunk-IMF3CPTY.js';
9
7
  import '../chunk-XSPCITPN.js';
8
+ import '../chunk-SK4BIFTG.js';
9
+ import '../chunk-COS6LJ4K.js';
10
10
  import '../chunk-KM5OKCW6.js';
11
11
  import '../chunk-TDFLCUBE.js';
12
12
  import '../chunk-BFZAGIXR.js';
@@ -1,22 +1,22 @@
1
- export { TreeGrid } from '../chunk-RUKSDKG5.js';
1
+ export { TreeGrid } from '../chunk-WA4BKMRI.js';
2
2
  import '../chunk-MY374UUD.js';
3
- import '../chunk-Q3SHCEXN.js';
3
+ import '../chunk-77J2YS55.js';
4
4
  import '../chunk-HU56GCZ7.js';
5
5
  import '../chunk-CUEPPDBC.js';
6
+ import '../chunk-JMBPMSNI.js';
6
7
  import '../chunk-WFAJYBLX.js';
7
8
  import '../chunk-WSIJDWUG.js';
8
- import '../chunk-JMBPMSNI.js';
9
9
  import '../chunk-BRMJPZC4.js';
10
10
  import '../chunk-PPUR46MK.js';
11
+ import '../chunk-IMF3CPTY.js';
12
+ import '../chunk-XSPCITPN.js';
13
+ import '../chunk-SK4BIFTG.js';
14
+ import '../chunk-COS6LJ4K.js';
11
15
  import '../chunk-XQMRSL7Z.js';
12
16
  import '../chunk-NICEDVZM.js';
13
17
  import '../chunk-JLKO7PSK.js';
14
18
  import '../chunk-PJV5HVZY.js';
15
19
  import '../chunk-TEXK4RK6.js';
16
- import '../chunk-SK4BIFTG.js';
17
- import '../chunk-COS6LJ4K.js';
18
- import '../chunk-IMF3CPTY.js';
19
- import '../chunk-XSPCITPN.js';
20
20
  import '../chunk-KM5OKCW6.js';
21
21
  import '../chunk-TDFLCUBE.js';
22
22
  import '../chunk-BFZAGIXR.js';
@@ -1,13 +1,13 @@
1
- export { REFERENCE_NAME_PATTERN, ValueField, completeReference, isWholeReference, rankReferences, referenceAt, urlSchemeOf } from '../chunk-CJAPAIJG.js';
2
- import '../chunk-657WR3MX.js';
3
- import '../chunk-7FWYJCKT.js';
1
+ export { REFERENCE_NAME_PATTERN, ValueField, completeReference, isWholeReference, rankReferences, referenceAt, urlSchemeOf } from '../chunk-CFVKNEGM.js';
2
+ import '../chunk-D5UVJL4I.js';
3
+ import '../chunk-WCV44AYD.js';
4
4
  import '../chunk-KW7T23RT.js';
5
+ import '../chunk-2YTOOH3A.js';
5
6
  import '../chunk-XQMRSL7Z.js';
6
7
  import '../chunk-NICEDVZM.js';
7
8
  import '../chunk-JLKO7PSK.js';
8
9
  import '../chunk-PJV5HVZY.js';
9
10
  import '../chunk-TEXK4RK6.js';
10
- import '../chunk-2YTOOH3A.js';
11
11
  import '../chunk-KM5OKCW6.js';
12
12
  import '../chunk-TDFLCUBE.js';
13
13
  import '../chunk-BFZAGIXR.js';
@@ -0,0 +1,194 @@
1
+ import { CopyButton } from './chunk-IRGS5FEC.js';
2
+ import { ChatThread } from './chunk-KJBDOWG7.js';
3
+ import { Spinner } from './chunk-XSPCITPN.js';
4
+ import { VisuallyHidden } from './chunk-RRRK2KB6.js';
5
+ import { cx } from './chunk-ODEQTPFM.js';
6
+ import './ToolCallLog-WSK6TEGH.css';
7
+ import { useState, useId } from 'react';
8
+ import { CircleAlertGlyph, TriangleAlertGlyph, ChevronDownGlyph, ChevronRightGlyph, CircleCheckGlyph, CircleXGlyph, CircleDashedGlyph } from '@crewlethq/icons/glyphs';
9
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
10
+
11
+ function toolCallDuration(ms) {
12
+ if (ms < 1e3) return `${Math.max(0, Math.round(ms))}ms`;
13
+ if (ms < 6e4) return `${(ms / 1e3).toFixed(ms < 1e4 ? 1 : 0)}s`;
14
+ const seconds = Math.round(ms / 1e3);
15
+ if (seconds < 3600) return `${Math.floor(seconds / 60)}m ${seconds % 60}s`;
16
+ return `${Math.floor(seconds / 3600)}h ${Math.floor(seconds % 3600 / 60)}m`;
17
+ }
18
+ var count = (n, one, many) => n === 1 ? `1 ${one}` : `${n.toLocaleString()} ${many}`;
19
+ var TOOL_CALL_LOG_LABELS = {
20
+ moreLines: (n) => count(n, "more line", "more lines"),
21
+ showFull: "Show in full",
22
+ showLess: "Show less",
23
+ unkept: (n) => `${count(n, "more line was", "more lines were")} not kept.`,
24
+ group: (tool, n) => `${tool} \xB7 ${count(n, "call", "calls")}`,
25
+ failedIn: (n) => `${n.toLocaleString()} failed`,
26
+ running: "Running",
27
+ ok: "Succeeded",
28
+ error: "Failed",
29
+ unknown: "No result",
30
+ duration: toolCallDuration,
31
+ jumpToLatest: "Jump to latest",
32
+ newItems: (n) => count(n, "new entry", "new entries"),
33
+ copy: "Copy",
34
+ copied: "Copied"
35
+ };
36
+ function toolCallRows(entries, groupAt) {
37
+ const rows = [];
38
+ let run = [];
39
+ const flush = () => {
40
+ if (run.length >= Math.max(2, groupAt)) {
41
+ rows.push({ kind: "group", key: run[0].key, tool: run[0].group ?? run[0].tool, calls: run });
42
+ } else {
43
+ for (const entry of run) rows.push({ kind: "entry", entry });
44
+ }
45
+ run = [];
46
+ };
47
+ for (const entry of entries) {
48
+ if (entry.kind === "call") {
49
+ const by = entry.group ?? entry.tool;
50
+ const prior = run[0];
51
+ if (prior && (prior.group ?? prior.tool) !== by) flush();
52
+ run.push(entry);
53
+ continue;
54
+ }
55
+ flush();
56
+ rows.push({ kind: "entry", entry });
57
+ }
58
+ flush();
59
+ return rows;
60
+ }
61
+ function ToolCallLog({
62
+ entries,
63
+ label,
64
+ live = false,
65
+ copyText,
66
+ maxHeight,
67
+ groupAt = 3,
68
+ caption,
69
+ labels: overrides,
70
+ className
71
+ }) {
72
+ const labels = overrides ? { ...TOOL_CALL_LOG_LABELS, ...overrides } : TOOL_CALL_LOG_LABELS;
73
+ const rows = toolCallRows(entries, groupAt);
74
+ const style = maxHeight === void 0 ? void 0 : { "--crewlet-tool-call-log-max-height": typeof maxHeight === "number" ? `${maxHeight}px` : maxHeight };
75
+ return /* @__PURE__ */ jsxs("div", { className: cx("crewlet-tool-call-log", className), style, children: [
76
+ /* @__PURE__ */ jsxs("div", { className: "crewlet-tool-call-log__header", children: [
77
+ /* @__PURE__ */ jsxs("span", { className: "crewlet-tool-call-log__title", children: [
78
+ /* @__PURE__ */ jsx("span", { className: "crewlet-tool-call-log__label", children: label }),
79
+ caption ? /* @__PURE__ */ jsx("span", { className: "crewlet-tool-call-log__caption", children: caption }) : null
80
+ ] }),
81
+ copyText === void 0 ? null : /* @__PURE__ */ jsx(CopyButton, { text: copyText, label: labels.copy, copiedLabel: labels.copied, className: "crewlet-tool-call-log__copy" })
82
+ ] }),
83
+ /* @__PURE__ */ jsx("div", { className: "crewlet-tool-call-log__body", children: /* @__PURE__ */ jsx(
84
+ ChatThread,
85
+ {
86
+ label,
87
+ busy: live,
88
+ flush: true,
89
+ labels: { jumpToLatest: labels.jumpToLatest, newItems: labels.newItems },
90
+ className: "crewlet-tool-call-log__thread",
91
+ children: rows.map(
92
+ (row) => row.kind === "group" ? /* @__PURE__ */ jsx(CallGroup, { tool: row.tool, calls: row.calls, labels }, `g:${row.key}`) : /* @__PURE__ */ jsx(EntryRow, { entry: row.entry, labels }, row.entry.key)
93
+ )
94
+ }
95
+ ) })
96
+ ] });
97
+ }
98
+ function EntryRow({ entry, labels }) {
99
+ if (entry.kind === "call") return /* @__PURE__ */ jsx(CallRow, { call: entry, labels });
100
+ if (entry.kind === "say") return /* @__PURE__ */ jsx("p", { className: "crewlet-tool-call-log__say", children: entry.text });
101
+ const tone = entry.tone ?? "neutral";
102
+ return /* @__PURE__ */ jsxs("p", { className: cx("crewlet-tool-call-log__note", `crewlet-tool-call-log__note--${tone}`), children: [
103
+ tone === "neutral" ? null : /* @__PURE__ */ jsx("span", { className: "crewlet-tool-call-log__note-mark", "aria-hidden": "true", children: tone === "danger" ? /* @__PURE__ */ jsx(CircleAlertGlyph, { size: "sm" }) : /* @__PURE__ */ jsx(TriangleAlertGlyph, { size: "sm" }) }),
104
+ /* @__PURE__ */ jsx("span", { className: "crewlet-tool-call-log__note-text", children: entry.text })
105
+ ] });
106
+ }
107
+ function StatusMark({ status, labels }) {
108
+ const words = { running: labels.running, ok: labels.ok, error: labels.error, unknown: labels.unknown }[status];
109
+ return /* @__PURE__ */ jsxs("span", { className: cx("crewlet-tool-call-log__mark", `crewlet-tool-call-log__mark--${status}`), children: [
110
+ /* @__PURE__ */ jsx("span", { className: "crewlet-tool-call-log__mark-glyph", "aria-hidden": "true", children: status === "running" ? /* @__PURE__ */ jsx(Spinner, { size: "sm" }) : status === "ok" ? /* @__PURE__ */ jsx(CircleCheckGlyph, { size: "sm" }) : status === "error" ? /* @__PURE__ */ jsx(CircleXGlyph, { size: "sm" }) : /* @__PURE__ */ jsx(CircleDashedGlyph, { size: "sm" }) }),
111
+ /* @__PURE__ */ jsx(VisuallyHidden, { children: words })
112
+ ] });
113
+ }
114
+ function inputBeyondDetail(call) {
115
+ if (call.input === void 0) return false;
116
+ const input = call.input.replace(/\n+$/, "");
117
+ return input !== "" && input.trim() !== (call.detail ?? "").trim();
118
+ }
119
+ function CallRow({ call, labels }) {
120
+ const [open, setOpen] = useState(false);
121
+ const id = useId();
122
+ const input = call.input?.replace(/\n+$/, "") ?? "";
123
+ const more = inputBeyondDetail(call);
124
+ const extra = input.split("\n").length - 1;
125
+ return /* @__PURE__ */ jsxs("div", { className: "crewlet-tool-call-log__call", "data-status": call.status, children: [
126
+ /* @__PURE__ */ jsxs("div", { className: "crewlet-tool-call-log__head", children: [
127
+ /* @__PURE__ */ jsx(StatusMark, { status: call.status, labels }),
128
+ /* @__PURE__ */ jsx("span", { className: "crewlet-tool-call-log__tool", children: call.tool }),
129
+ call.detail ? /* @__PURE__ */ jsx("span", { className: "crewlet-tool-call-log__detail", title: call.detail, children: call.detail }) : /* @__PURE__ */ jsx("span", { className: "crewlet-tool-call-log__detail" }),
130
+ call.durationMs === void 0 ? null : /* @__PURE__ */ jsx("span", { className: "crewlet-tool-call-log__duration", children: labels.duration(call.durationMs) })
131
+ ] }),
132
+ call.status === "error" && call.error ? /* @__PURE__ */ jsx("p", { className: "crewlet-tool-call-log__error", children: call.error }) : null,
133
+ more ? /* @__PURE__ */ jsxs(Fragment, { children: [
134
+ /* @__PURE__ */ jsxs(
135
+ "button",
136
+ {
137
+ type: "button",
138
+ className: "crewlet-tool-call-log__more",
139
+ "aria-expanded": open,
140
+ "aria-controls": id,
141
+ onClick: () => setOpen((was) => !was),
142
+ children: [
143
+ /* @__PURE__ */ jsx("span", { className: "crewlet-tool-call-log__chevron", "aria-hidden": "true", children: open ? /* @__PURE__ */ jsx(ChevronDownGlyph, { size: "xs" }) : /* @__PURE__ */ jsx(ChevronRightGlyph, { size: "xs" }) }),
144
+ open ? labels.showLess : extra > 0 ? labels.moreLines(extra) : labels.showFull
145
+ ]
146
+ }
147
+ ),
148
+ /* @__PURE__ */ jsxs("div", { id, className: "crewlet-tool-call-log__full", hidden: !open, children: [
149
+ /* @__PURE__ */ jsx("pre", { className: "crewlet-tool-call-log__input", children: input }),
150
+ call.inputUnkept && call.inputUnkept > 0 ? /* @__PURE__ */ jsx("p", { className: "crewlet-tool-call-log__unkept", children: labels.unkept(call.inputUnkept) }) : null
151
+ ] })
152
+ ] }) : null
153
+ ] });
154
+ }
155
+ function groupStatus(calls) {
156
+ if (calls.some((c) => c.status === "running")) return "running";
157
+ if (calls.some((c) => c.status === "error")) return "error";
158
+ if (calls.every((c) => c.status === "ok")) return "ok";
159
+ return "unknown";
160
+ }
161
+ function CallGroup({ tool, calls, labels }) {
162
+ const [open, setOpen] = useState(false);
163
+ const id = useId();
164
+ const failed = calls.filter((c) => c.status === "error").length;
165
+ const timed = calls.every((c) => c.durationMs !== void 0);
166
+ const total = timed ? calls.reduce((sum, c) => sum + (c.durationMs ?? 0), 0) : void 0;
167
+ const status = groupStatus(calls);
168
+ const last = calls.at(-1);
169
+ return /* @__PURE__ */ jsxs("div", { className: "crewlet-tool-call-log__group", "data-status": status, children: [
170
+ /* @__PURE__ */ jsxs("div", { className: "crewlet-tool-call-log__head", children: [
171
+ /* @__PURE__ */ jsx(StatusMark, { status, labels }),
172
+ /* @__PURE__ */ jsxs(
173
+ "button",
174
+ {
175
+ type: "button",
176
+ className: "crewlet-tool-call-log__group-toggle",
177
+ "aria-expanded": open,
178
+ "aria-controls": id,
179
+ onClick: () => setOpen((was) => !was),
180
+ children: [
181
+ /* @__PURE__ */ jsx("span", { className: "crewlet-tool-call-log__tool", children: labels.group(tool, calls.length) }),
182
+ /* @__PURE__ */ jsx("span", { className: "crewlet-tool-call-log__chevron", "aria-hidden": "true", children: open ? /* @__PURE__ */ jsx(ChevronDownGlyph, { size: "xs" }) : /* @__PURE__ */ jsx(ChevronRightGlyph, { size: "xs" }) })
183
+ ]
184
+ }
185
+ ),
186
+ !open && last?.detail ? /* @__PURE__ */ jsx("span", { className: "crewlet-tool-call-log__detail", title: last.detail, children: last.detail }) : /* @__PURE__ */ jsx("span", { className: "crewlet-tool-call-log__detail" }),
187
+ total === void 0 ? null : /* @__PURE__ */ jsx("span", { className: "crewlet-tool-call-log__duration", children: labels.duration(total) })
188
+ ] }),
189
+ failed > 0 ? /* @__PURE__ */ jsx("p", { className: "crewlet-tool-call-log__error crewlet-tool-call-log__error--count", children: labels.failedIn(failed) }) : null,
190
+ /* @__PURE__ */ jsx("div", { id, className: "crewlet-tool-call-log__members", hidden: !open, children: open ? calls.map((call) => /* @__PURE__ */ jsx(CallRow, { call, labels }, call.key)) : null })
191
+ ] });
192
+ }
193
+
194
+ export { TOOL_CALL_LOG_LABELS, ToolCallLog, toolCallDuration };
@@ -1,15 +1,15 @@
1
1
  import { PageHeader } from './chunk-FPDIHEM4.js';
2
2
  import { FilterPill } from './chunk-GQQMN6O3.js';
3
- import { DataTable } from './chunk-WAF36OFS.js';
3
+ import { DataTable } from './chunk-T3BIW52Y.js';
4
4
  import { DateTimePicker } from './chunk-7SXCCVUR.js';
5
5
  import { useListbox, useOptionKeys } from './chunk-KW7T23RT.js';
6
6
  import { Toolbar } from './chunk-NPEI2QAN.js';
7
7
  import { Popover } from './chunk-AJFA2XDQ.js';
8
- import { RelativeTime } from './chunk-GBKBME7Q.js';
9
8
  import { Menu } from './chunk-ZMZNKDPO.js';
10
- import { Input } from './chunk-XQMRSL7Z.js';
9
+ import { RelativeTime } from './chunk-GBKBME7Q.js';
11
10
  import { Kbd } from './chunk-VBBLHS2Y.js';
12
11
  import { Button } from './chunk-IMF3CPTY.js';
12
+ import { Input } from './chunk-XQMRSL7Z.js';
13
13
  import { IconButton } from './chunk-KM5OKCW6.js';
14
14
  import { Count } from './chunk-Y5CMDLQM.js';
15
15
  import { VisuallyHidden } from './chunk-RRRK2KB6.js';
@@ -1,10 +1,10 @@
1
- import { Select } from './chunk-657WR3MX.js';
1
+ import { Select } from './chunk-D5UVJL4I.js';
2
2
  import { Modal } from './chunk-7PK2Z5JY.js';
3
3
  import { CopyButton } from './chunk-IRGS5FEC.js';
4
4
  import { Callout } from './chunk-CWACQEPP.js';
5
5
  import { PrincipalAvatar } from './chunk-265IX4YA.js';
6
- import { useMediaMatch } from './chunk-COS6LJ4K.js';
7
6
  import { Button } from './chunk-IMF3CPTY.js';
7
+ import { useMediaMatch } from './chunk-COS6LJ4K.js';
8
8
  import { IconButton } from './chunk-KM5OKCW6.js';
9
9
  import { useHeadingLevel, headingTag } from './chunk-PQADV6P6.js';
10
10
  import { cx } from './chunk-ODEQTPFM.js';
@@ -1,4 +1,4 @@
1
- import { SidebarNav } from './chunk-TTUFOH2Y.js';
1
+ import { SidebarNav } from './chunk-FNX3YS55.js';
2
2
  import { VisuallyHidden } from './chunk-RRRK2KB6.js';
3
3
  import { cx } from './chunk-ODEQTPFM.js';
4
4
  import './SectionFrame-M62UUVFQ.css';
@@ -1,5 +1,5 @@
1
- import { Select } from './chunk-657WR3MX.js';
2
- import { Combobox } from './chunk-7FWYJCKT.js';
1
+ import { Select } from './chunk-D5UVJL4I.js';
2
+ import { Combobox } from './chunk-WCV44AYD.js';
3
3
  import { FormField, Textarea, InputAffix } from './chunk-XQMRSL7Z.js';
4
4
  import './Input-YVCNNTYT.css';
5
5
  import './VisuallyHidden-OUYVMKEH.css';
@@ -1,4 +1,4 @@
1
- import { TreeGrid } from './chunk-RUKSDKG5.js';
1
+ import { TreeGrid } from './chunk-WA4BKMRI.js';
2
2
  import { OrgLabel } from './chunk-PFP5HHZF.js';
3
3
  import { createTreeModel, treeParent } from './chunk-MY374UUD.js';
4
4
  import { AddPill } from './chunk-5W3EYO5Q.js';
@@ -1,4 +1,4 @@
1
- import { Combobox } from './chunk-7FWYJCKT.js';
1
+ import { Combobox } from './chunk-WCV44AYD.js';
2
2
  import { PRINCIPAL_KINDS, PrincipalAvatar } from './chunk-265IX4YA.js';
3
3
  import { cx } from './chunk-ODEQTPFM.js';
4
4
  import './PrincipalPicker-P6UYHDJR.css';
@@ -1,8 +1,8 @@
1
- import { Select } from './chunk-657WR3MX.js';
1
+ import { Select } from './chunk-D5UVJL4I.js';
2
2
  import { today, shiftMonth, CalendarGrid, compareDays } from './chunk-EE3DJMSQ.js';
3
3
  import { Popover } from './chunk-AJFA2XDQ.js';
4
- import { Input } from './chunk-XQMRSL7Z.js';
5
4
  import { Button } from './chunk-IMF3CPTY.js';
5
+ import { Input } from './chunk-XQMRSL7Z.js';
6
6
  import { IconButton } from './chunk-KM5OKCW6.js';
7
7
  import { isComposing } from './chunk-EDPMHSLZ.js';
8
8
  import { useFocusModality } from './chunk-4ITETIGZ.js';
@@ -1,4 +1,4 @@
1
- import { useSendOnEnter, SendKeysHint } from './chunk-UZMXC5T6.js';
1
+ import { useSendOnEnter, SendKeysHint } from './chunk-YUVQUJND.js';
2
2
  import { Textarea } from './chunk-XQMRSL7Z.js';
3
3
  import { VisuallyHidden } from './chunk-RRRK2KB6.js';
4
4
  import { cx } from './chunk-ODEQTPFM.js';
@@ -1,12 +1,12 @@
1
- import { Select } from './chunk-657WR3MX.js';
1
+ import { Select } from './chunk-D5UVJL4I.js';
2
2
  import { SHEET_LABELS, SHEET_COLUMN_TYPES, optionHue, retypeColumn } from './chunk-LFSIKGRQ.js';
3
3
  import { HueSwatch } from './chunk-E3JUS3CR.js';
4
4
  import { NODE_HUES, NODE_HUE_NAMES } from './chunk-AYKXMIOR.js';
5
- import { Checkbox } from './chunk-BRMJPZC4.js';
6
5
  import { Menu } from './chunk-ZMZNKDPO.js';
7
- import { FormField, Input } from './chunk-XQMRSL7Z.js';
6
+ import { Checkbox } from './chunk-BRMJPZC4.js';
8
7
  import { Kbd } from './chunk-VBBLHS2Y.js';
9
8
  import { Button } from './chunk-IMF3CPTY.js';
9
+ import { FormField, Input } from './chunk-XQMRSL7Z.js';
10
10
  import { IconButton } from './chunk-KM5OKCW6.js';
11
11
  import { VisuallyHidden } from './chunk-RRRK2KB6.js';
12
12
  import { cx } from './chunk-ODEQTPFM.js';
@@ -9,7 +9,7 @@ import { jsx } from 'react/jsx-runtime';
9
9
  var engine = null;
10
10
  var loading = null;
11
11
  function loadEngine() {
12
- loading ??= import('./Editor-LGZMJEUD.js').then(
12
+ loading ??= import('./Editor-VMQ5DK6H.js').then(
13
13
  (module) => {
14
14
  engine = module.Editor;
15
15
  return engine;
@@ -1,6 +1,6 @@
1
1
  import { Timeline } from './chunk-XDUXAQIS.js';
2
2
  import { Section } from './chunk-WFCWPXJN.js';
3
- import { Composer } from './chunk-QRUQOITJ.js';
3
+ import { Composer } from './chunk-GMHP5KXF.js';
4
4
  import { Disclosure } from './chunk-D5O64CVE.js';
5
5
  import { ArtifactPanel } from './chunk-HIDOUXLD.js';
6
6
  import { Button } from './chunk-IMF3CPTY.js';
@@ -1,4 +1,4 @@
1
- import { Select } from './chunk-657WR3MX.js';
1
+ import { Select } from './chunk-D5UVJL4I.js';
2
2
  import { typedNumber, NumberField } from './chunk-DDGHRDGV.js';
3
3
  import { PresetChips } from './chunk-6QWSGM4W.js';
4
4
  import { cx } from './chunk-ODEQTPFM.js';