@shipfox/client-logs 27.0.1 → 30.0.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.
@@ -1,2 +1,2 @@
1
1
  $ shipfox-swc
2
- Successfully compiled: 14 files with swc (363.25ms)
2
+ Successfully compiled: 14 files with swc (469.52ms)
@@ -1,2 +1 @@
1
1
  $ shipfox-tsc-emit
2
- context canceled
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @shipfox/client-logs
2
2
 
3
+ ## 30.0.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [ca7eb23]
8
+ - Updated dependencies [a7ad0a9]
9
+ - @shipfox/api-logs-dto@20.0.0
10
+ - @shipfox/react-ui@2.3.4
11
+
12
+ ## 29.0.0
13
+
14
+ ### Patch Changes
15
+
16
+ - b416c4c: Preserves existing package behavior while simplifying internal control flow.
17
+ - Updated dependencies [b416c4c]
18
+ - @shipfox/react-ui@2.3.3
19
+ - @shipfox/api-logs-dto@17.0.0
20
+ - @shipfox/client-api@6.0.1
21
+
3
22
  ## 27.0.1
4
23
 
5
24
  ### Patch Changes
@@ -31,272 +31,313 @@ function AgentSessionRowView({ row, resolvedToolCallIds, toolCallNames, indent,
31
31
  };
32
32
  switch(row.kind){
33
33
  case 'message':
34
- return /*#__PURE__*/ _jsx(LogRow, {
35
- lineNumber: null,
36
- timestamp: new Date(row.timestamp),
34
+ return /*#__PURE__*/ _jsx(SessionMessageRow, {
35
+ row: row,
36
+ indent: indent
37
+ });
38
+ case 'thinking':
39
+ return /*#__PURE__*/ _jsx(SessionThinkingRow, {
40
+ row: row,
37
41
  indent: indent,
38
- tone: row.terminalFailure ? 'error' : 'default',
39
- "data-log-terminal-failure": row.terminalFailure ? 'true' : undefined,
40
- children: /*#__PURE__*/ _jsx(LogContent, {
41
- className: "text-foreground-contrast-primary",
42
- children: /*#__PURE__*/ _jsxs("span", {
43
- className: "flex min-w-0 items-start gap-inline",
42
+ disclosure: disclosureProps
43
+ });
44
+ case 'tool-call':
45
+ return /*#__PURE__*/ _jsx(SessionToolCallRow, {
46
+ row: row,
47
+ indent: indent,
48
+ disclosure: disclosureProps,
49
+ resolvedToolCallIds: resolvedToolCallIds
50
+ });
51
+ case 'tool-result':
52
+ return /*#__PURE__*/ _jsx(SessionToolResultRow, {
53
+ row: row,
54
+ indent: indent,
55
+ disclosure: disclosureProps,
56
+ toolCallNames: toolCallNames
57
+ });
58
+ case 'lifecycle':
59
+ return /*#__PURE__*/ _jsx(SessionLifecycleRow, {
60
+ row: row,
61
+ indent: indent
62
+ });
63
+ case 'raw':
64
+ return /*#__PURE__*/ _jsx(SessionRawRow, {
65
+ row: row,
66
+ indent: indent,
67
+ disclosure: disclosureProps
68
+ });
69
+ default:
70
+ return assertNever(row);
71
+ }
72
+ }
73
+ function SessionMessageRow({ row, indent }) {
74
+ return /*#__PURE__*/ _jsx(LogRow, {
75
+ lineNumber: null,
76
+ timestamp: new Date(row.timestamp),
77
+ indent: indent,
78
+ tone: row.terminalFailure ? 'error' : 'default',
79
+ "data-log-terminal-failure": row.terminalFailure ? 'true' : undefined,
80
+ children: /*#__PURE__*/ _jsx(LogContent, {
81
+ className: "text-foreground-contrast-primary",
82
+ children: /*#__PURE__*/ _jsxs("span", {
83
+ className: "flex min-w-0 items-start gap-inline",
84
+ children: [
85
+ /*#__PURE__*/ _jsx(MessageIcon, {
86
+ role: row.role,
87
+ terminalFailure: row.terminalFailure
88
+ }),
89
+ /*#__PURE__*/ _jsxs("span", {
90
+ className: "flex min-w-0 flex-1 flex-col gap-tight",
44
91
  children: [
45
- /*#__PURE__*/ _jsx(MessageIcon, {
46
- role: row.role,
47
- terminalFailure: row.terminalFailure
48
- }),
49
92
  /*#__PURE__*/ _jsxs("span", {
50
- className: "flex min-w-0 flex-1 flex-col gap-tight",
93
+ className: "flex min-w-0 items-center gap-inline",
51
94
  children: [
52
- /*#__PURE__*/ _jsxs("span", {
53
- className: "flex min-w-0 items-center gap-inline",
54
- children: [
55
- /*#__PURE__*/ _jsx(MessageRoleLabel, {
56
- label: row.label,
57
- terminalFailure: row.terminalFailure
58
- }),
59
- /*#__PURE__*/ _jsx(RowMetadata, {
60
- meta: row.meta,
61
- className: "ml-auto flex-none"
62
- })
63
- ]
95
+ /*#__PURE__*/ _jsx(MessageRoleLabel, {
96
+ label: row.label,
97
+ terminalFailure: row.terminalFailure
64
98
  }),
65
- /*#__PURE__*/ _jsx("span", {
66
- className: "block min-w-0",
67
- children: /*#__PURE__*/ _jsx(PreviewText, {
68
- text: row.text
69
- })
99
+ /*#__PURE__*/ _jsx(RowMetadata, {
100
+ meta: row.meta,
101
+ className: "ml-auto flex-none"
70
102
  })
71
103
  ]
104
+ }),
105
+ /*#__PURE__*/ _jsx("span", {
106
+ className: "block min-w-0",
107
+ children: /*#__PURE__*/ _jsx(PreviewText, {
108
+ text: row.text
109
+ })
72
110
  })
73
111
  ]
74
112
  })
75
- })
76
- });
77
- case 'thinking':
78
- return /*#__PURE__*/ _jsxs(LogDisclosure, {
79
- indent: indent,
80
- ...disclosureProps,
81
- children: [
82
- /*#__PURE__*/ _jsx(LogDisclosureTrigger, {
83
- summary: wordSummary(row.text),
84
- timestamp: new Date(row.timestamp),
85
- className: "text-foreground-contrast-secondary",
86
- children: "thinking"
87
- }),
88
- /*#__PURE__*/ _jsx(LogDisclosureContent, {
89
- className: "text-foreground-contrast-secondary",
90
- children: /*#__PURE__*/ _jsx(LogContent, {
91
- className: "text-foreground-contrast-secondary",
92
- children: /*#__PURE__*/ _jsx(PreviewText, {
93
- text: row.text
94
- })
95
- })
96
- })
97
113
  ]
98
- });
99
- case 'tool-call':
100
- {
101
- const awaitingResult = row.id != null && !resolvedToolCallIds.has(row.id);
102
- return /*#__PURE__*/ _jsxs(LogDisclosure, {
103
- indent: indent,
104
- ...disclosureProps,
114
+ })
115
+ })
116
+ });
117
+ }
118
+ function SessionThinkingRow({ row, indent, disclosure }) {
119
+ return /*#__PURE__*/ _jsxs(LogDisclosure, {
120
+ indent: indent,
121
+ ...disclosure,
122
+ children: [
123
+ /*#__PURE__*/ _jsx(LogDisclosureTrigger, {
124
+ summary: wordSummary(row.text),
125
+ timestamp: new Date(row.timestamp),
126
+ className: "text-foreground-contrast-secondary",
127
+ children: "thinking"
128
+ }),
129
+ /*#__PURE__*/ _jsx(LogDisclosureContent, {
130
+ className: "text-foreground-contrast-secondary",
131
+ children: /*#__PURE__*/ _jsx(LogContent, {
132
+ className: "text-foreground-contrast-secondary",
133
+ children: /*#__PURE__*/ _jsx(PreviewText, {
134
+ text: row.text
135
+ })
136
+ })
137
+ })
138
+ ]
139
+ });
140
+ }
141
+ function SessionToolCallRow({ row, indent, disclosure, resolvedToolCallIds }) {
142
+ const awaitingResult = row.id != null && !resolvedToolCallIds.has(row.id);
143
+ return /*#__PURE__*/ _jsxs(LogDisclosure, {
144
+ indent: indent,
145
+ ...disclosure,
146
+ children: [
147
+ /*#__PURE__*/ _jsx(LogDisclosureTrigger, {
148
+ timestamp: new Date(row.timestamp),
149
+ summary: compactPreview(row.summary ?? row.input),
150
+ trailing: awaitingResult ? /*#__PURE__*/ _jsxs("span", {
151
+ className: "inline-flex items-center gap-tight",
105
152
  children: [
106
- /*#__PURE__*/ _jsx(LogDisclosureTrigger, {
107
- timestamp: new Date(row.timestamp),
108
- summary: compactPreview(row.summary ?? row.input),
109
- trailing: awaitingResult ? /*#__PURE__*/ _jsxs("span", {
110
- className: "inline-flex items-center gap-tight",
111
- children: [
112
- /*#__PURE__*/ _jsx(Icon, {
113
- name: "loader4Line",
114
- className: "size-12 motion-safe:animate-spin",
115
- "aria-hidden": "true"
116
- }),
117
- "awaiting result"
118
- ]
119
- }) : null,
120
- children: /*#__PURE__*/ _jsxs("span", {
121
- className: "inline-flex min-w-0 items-center gap-inline",
122
- children: [
123
- /*#__PURE__*/ _jsx(Icon, {
124
- name: "terminalBoxLine",
125
- className: "size-14 flex-none",
126
- "aria-hidden": "true"
127
- }),
128
- /*#__PURE__*/ _jsxs("span", {
129
- className: "truncate",
130
- children: [
131
- "tool ",
132
- row.name
133
- ]
134
- })
135
- ]
136
- })
153
+ /*#__PURE__*/ _jsx(Icon, {
154
+ name: "loader4Line",
155
+ className: "size-12 motion-safe:animate-spin",
156
+ "aria-hidden": "true"
137
157
  }),
138
- /*#__PURE__*/ _jsx(LogDisclosureContent, {
139
- children: row.summary != null ? /*#__PURE__*/ _jsxs(_Fragment, {
140
- children: [
141
- /*#__PURE__*/ _jsx(LogContent, {
142
- children: /*#__PURE__*/ _jsx(PreviewText, {
143
- text: row.summary
144
- })
145
- }),
146
- /*#__PURE__*/ _jsx(LogContent, {
147
- variant: "code",
148
- children: /*#__PURE__*/ _jsx(PreviewText, {
149
- text: row.input
150
- })
151
- })
152
- ]
153
- }) : /*#__PURE__*/ _jsx(LogContent, {
154
- variant: "code",
155
- children: /*#__PURE__*/ _jsx(PreviewText, {
156
- text: row.input
157
- })
158
- })
158
+ "awaiting result"
159
+ ]
160
+ }) : null,
161
+ children: /*#__PURE__*/ _jsxs("span", {
162
+ className: "inline-flex min-w-0 items-center gap-inline",
163
+ children: [
164
+ /*#__PURE__*/ _jsx(Icon, {
165
+ name: "terminalBoxLine",
166
+ className: "size-14 flex-none",
167
+ "aria-hidden": "true"
168
+ }),
169
+ /*#__PURE__*/ _jsxs("span", {
170
+ className: "truncate",
171
+ children: [
172
+ "tool ",
173
+ row.name
174
+ ]
159
175
  })
160
176
  ]
161
- });
162
- }
163
- case 'tool-result':
164
- {
165
- const toolName = row.toolName === 'tool' ? (row.toolCallId != null ? toolCallNames.get(row.toolCallId) : undefined) ?? '(unmatched)' : row.toolName;
166
- return /*#__PURE__*/ _jsxs(LogDisclosure, {
167
- indent: indent,
168
- ...disclosureProps,
177
+ })
178
+ }),
179
+ /*#__PURE__*/ _jsx(LogDisclosureContent, {
180
+ children: row.summary != null ? /*#__PURE__*/ _jsxs(_Fragment, {
169
181
  children: [
170
- /*#__PURE__*/ _jsx(LogDisclosureTrigger, {
171
- timestamp: new Date(row.timestamp),
172
- summary: compactPreview(row.output),
173
- trailing: /*#__PURE__*/ _jsxs("span", {
174
- className: cn('inline-flex items-center gap-tight', row.isError ? 'text-tag-error-icon' : 'text-foreground-contrast-secondary'),
175
- children: [
176
- /*#__PURE__*/ _jsx(Icon, {
177
- name: row.isError ? 'closeCircleLine' : 'checkLine',
178
- className: "size-12",
179
- "aria-hidden": "true"
180
- }),
181
- row.isError ? 'error' : 'ok'
182
- ]
183
- }),
184
- children: /*#__PURE__*/ _jsxs("span", {
185
- className: "inline-flex min-w-0 items-center gap-inline",
186
- children: [
187
- /*#__PURE__*/ _jsx(Icon, {
188
- name: "terminalWindowLine",
189
- className: "size-14 flex-none",
190
- "aria-hidden": "true"
191
- }),
192
- /*#__PURE__*/ _jsxs("span", {
193
- className: "truncate",
194
- children: [
195
- "result ",
196
- toolName
197
- ]
198
- })
199
- ]
182
+ /*#__PURE__*/ _jsx(LogContent, {
183
+ children: /*#__PURE__*/ _jsx(PreviewText, {
184
+ text: row.summary
200
185
  })
201
186
  }),
202
- /*#__PURE__*/ _jsx(LogDisclosureContent, {
203
- children: /*#__PURE__*/ _jsx(LogContent, {
204
- variant: "code",
205
- className: "text-foreground-contrast-primary",
206
- children: /*#__PURE__*/ _jsx(PreviewText, {
207
- text: row.output
208
- })
187
+ /*#__PURE__*/ _jsx(LogContent, {
188
+ variant: "code",
189
+ children: /*#__PURE__*/ _jsx(PreviewText, {
190
+ text: row.input
209
191
  })
210
192
  })
211
193
  ]
212
- });
213
- }
214
- case 'lifecycle':
215
- return /*#__PURE__*/ _jsx(LogRow, {
216
- lineNumber: null,
194
+ }) : /*#__PURE__*/ _jsx(LogContent, {
195
+ variant: "code",
196
+ children: /*#__PURE__*/ _jsx(PreviewText, {
197
+ text: row.input
198
+ })
199
+ })
200
+ })
201
+ ]
202
+ });
203
+ }
204
+ function SessionToolResultRow({ row, indent, disclosure, toolCallNames }) {
205
+ const toolName = row.toolName === 'tool' ? (row.toolCallId != null ? toolCallNames.get(row.toolCallId) : undefined) ?? '(unmatched)' : row.toolName;
206
+ return /*#__PURE__*/ _jsxs(LogDisclosure, {
207
+ indent: indent,
208
+ ...disclosure,
209
+ children: [
210
+ /*#__PURE__*/ _jsx(LogDisclosureTrigger, {
217
211
  timestamp: new Date(row.timestamp),
218
- indent: indent,
219
- tone: row.tone,
220
- "data-log-terminal-failure": row.terminalFailure ? 'true' : undefined,
212
+ summary: compactPreview(row.output),
213
+ trailing: /*#__PURE__*/ _jsxs("span", {
214
+ className: cn('inline-flex items-center gap-tight', row.isError ? 'text-tag-error-icon' : 'text-foreground-contrast-secondary'),
215
+ children: [
216
+ /*#__PURE__*/ _jsx(Icon, {
217
+ name: row.isError ? 'closeCircleLine' : 'checkLine',
218
+ className: "size-12",
219
+ "aria-hidden": "true"
220
+ }),
221
+ row.isError ? 'error' : 'ok'
222
+ ]
223
+ }),
224
+ children: /*#__PURE__*/ _jsxs("span", {
225
+ className: "inline-flex min-w-0 items-center gap-inline",
226
+ children: [
227
+ /*#__PURE__*/ _jsx(Icon, {
228
+ name: "terminalWindowLine",
229
+ className: "size-14 flex-none",
230
+ "aria-hidden": "true"
231
+ }),
232
+ /*#__PURE__*/ _jsxs("span", {
233
+ className: "truncate",
234
+ children: [
235
+ "result ",
236
+ toolName
237
+ ]
238
+ })
239
+ ]
240
+ })
241
+ }),
242
+ /*#__PURE__*/ _jsx(LogDisclosureContent, {
221
243
  children: /*#__PURE__*/ _jsx(LogContent, {
222
- className: "text-foreground-contrast-secondary",
223
- children: /*#__PURE__*/ _jsxs("span", {
224
- className: "inline-flex w-full items-center gap-inline",
244
+ variant: "code",
245
+ className: "text-foreground-contrast-primary",
246
+ children: /*#__PURE__*/ _jsx(PreviewText, {
247
+ text: row.output
248
+ })
249
+ })
250
+ })
251
+ ]
252
+ });
253
+ }
254
+ function SessionLifecycleRow({ row, indent }) {
255
+ return /*#__PURE__*/ _jsx(LogRow, {
256
+ lineNumber: null,
257
+ timestamp: new Date(row.timestamp),
258
+ indent: indent,
259
+ tone: row.tone,
260
+ "data-log-terminal-failure": row.terminalFailure ? 'true' : undefined,
261
+ children: /*#__PURE__*/ _jsx(LogContent, {
262
+ className: "text-foreground-contrast-secondary",
263
+ children: /*#__PURE__*/ _jsxs("span", {
264
+ className: "inline-flex w-full items-center gap-inline",
265
+ children: [
266
+ /*#__PURE__*/ _jsx(Icon, {
267
+ name: "informationLine",
268
+ className: "size-14 flex-none",
269
+ "aria-hidden": "true"
270
+ }),
271
+ /*#__PURE__*/ _jsxs("span", {
272
+ className: "min-w-0",
225
273
  children: [
226
- /*#__PURE__*/ _jsx(Icon, {
227
- name: "informationLine",
228
- className: "size-14 flex-none",
229
- "aria-hidden": "true"
274
+ /*#__PURE__*/ _jsx("span", {
275
+ className: "font-medium",
276
+ children: row.label
230
277
  }),
231
- /*#__PURE__*/ _jsxs("span", {
232
- className: "min-w-0",
278
+ row.detail != null ? /*#__PURE__*/ _jsxs(_Fragment, {
233
279
  children: [
280
+ ' · ',
234
281
  /*#__PURE__*/ _jsx("span", {
235
- className: "font-medium",
236
- children: row.label
237
- }),
238
- row.detail != null ? /*#__PURE__*/ _jsxs(_Fragment, {
239
- children: [
240
- ' · ',
241
- /*#__PURE__*/ _jsx("span", {
242
- className: "text-foreground-contrast-secondary",
243
- children: row.detail
244
- })
245
- ]
246
- }) : null
282
+ className: "text-foreground-contrast-secondary",
283
+ children: row.detail
284
+ })
247
285
  ]
248
- }),
249
- /*#__PURE__*/ _jsx("span", {
250
- "aria-hidden": "true",
251
- className: "h-px flex-1 border-t border-dashed border-current opacity-30"
252
- }),
253
- /*#__PURE__*/ _jsx(RowMetadata, {
254
- meta: row.meta
255
- })
286
+ }) : null
256
287
  ]
257
- })
258
- })
259
- });
260
- case 'raw':
261
- return /*#__PURE__*/ _jsxs(LogDisclosure, {
262
- indent: indent,
263
- ...disclosureProps,
264
- children: [
265
- /*#__PURE__*/ _jsx(LogDisclosureTrigger, {
266
- timestamp: new Date(row.timestamp),
267
- summary: compactPreview(row.raw),
268
- className: "text-foreground-contrast-primary",
269
- children: /*#__PURE__*/ _jsxs("span", {
270
- className: "inline-flex min-w-0 items-center gap-inline",
271
- children: [
272
- /*#__PURE__*/ _jsx(Icon, {
273
- name: "errorWarningLine",
274
- className: "size-14 flex-none text-tag-warning-icon",
275
- "aria-hidden": "true"
276
- }),
277
- /*#__PURE__*/ _jsx("span", {
278
- className: "truncate",
279
- children: row.label
280
- })
281
- ]
282
- })
283
288
  }),
284
- /*#__PURE__*/ _jsx(LogDisclosureContent, {
285
- children: /*#__PURE__*/ _jsx(LogContent, {
286
- variant: "code",
287
- children: /*#__PURE__*/ _jsx(PreviewText, {
288
- text: row.raw
289
- })
290
- })
289
+ /*#__PURE__*/ _jsx("span", {
290
+ "aria-hidden": "true",
291
+ className: "h-px flex-1 border-t border-dashed border-current opacity-30"
292
+ }),
293
+ /*#__PURE__*/ _jsx(RowMetadata, {
294
+ meta: row.meta
291
295
  })
292
296
  ]
293
- });
294
- default:
295
- return assertNever(row);
296
- }
297
+ })
298
+ })
299
+ });
300
+ }
301
+ function SessionRawRow({ row, indent, disclosure }) {
302
+ return /*#__PURE__*/ _jsxs(LogDisclosure, {
303
+ indent: indent,
304
+ ...disclosure,
305
+ children: [
306
+ /*#__PURE__*/ _jsx(LogDisclosureTrigger, {
307
+ timestamp: new Date(row.timestamp),
308
+ summary: compactPreview(row.raw),
309
+ className: "text-foreground-contrast-primary",
310
+ children: /*#__PURE__*/ _jsxs("span", {
311
+ className: "inline-flex min-w-0 items-center gap-inline",
312
+ children: [
313
+ /*#__PURE__*/ _jsx(Icon, {
314
+ name: "errorWarningLine",
315
+ className: "size-14 flex-none text-tag-warning-icon",
316
+ "aria-hidden": "true"
317
+ }),
318
+ /*#__PURE__*/ _jsx("span", {
319
+ className: "truncate",
320
+ children: row.label
321
+ })
322
+ ]
323
+ })
324
+ }),
325
+ /*#__PURE__*/ _jsx(LogDisclosureContent, {
326
+ children: /*#__PURE__*/ _jsx(LogContent, {
327
+ variant: "code",
328
+ children: /*#__PURE__*/ _jsx(PreviewText, {
329
+ text: row.raw
330
+ })
331
+ })
332
+ })
333
+ ]
334
+ });
297
335
  }
298
336
  function MessageIcon({ role, terminalFailure }) {
299
- const name = terminalFailure ? 'closeCircleLine' : role === 'user' ? 'userLine' : role === 'assistant' ? 'robot2Line' : 'message2Line';
337
+ let name = 'message2Line';
338
+ if (terminalFailure) name = 'closeCircleLine';
339
+ else if (role === 'user') name = 'userLine';
340
+ else if (role === 'assistant') name = 'robot2Line';
300
341
  return /*#__PURE__*/ _jsx(Icon, {
301
342
  name: name,
302
343
  className: cn('mt-[2px] size-14 flex-none', terminalFailure ? 'text-tag-error-icon' : 'text-foreground-contrast-secondary'),