@crewlethq/ui 0.152.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.
- package/README.md +9 -1
- package/dist/AgentHandoffPanel/index.js +9 -9
- package/dist/AppShell/index.js +3 -3
- package/dist/ArrangeList/index.js +2 -2
- package/dist/ArtifactBar/index.js +1 -1
- package/dist/ArtifactCard/index.js +2 -2
- package/dist/AuthLayout/index.js +1 -1
- package/dist/BriefCard/index.js +1 -1
- package/dist/ChangeList/index.js +2 -2
- package/dist/ChatThread/index.js +3 -3
- package/dist/Combobox/index.js +2 -2
- package/dist/CommandPalette/index.js +5 -5
- package/dist/CommentThread/index.js +9 -9
- package/dist/Composer/index.js +5 -5
- package/dist/DataGrid/index.js +6 -6
- package/dist/DataTable/index.js +4 -4
- package/dist/DataView/index.js +6 -6
- package/dist/DatasetSource/index.js +1 -1
- package/dist/DeepWorkCard/index.js +1 -1
- package/dist/DiffList/index.js +1 -1
- package/dist/{DiffList-3JNPLQ2E.css → DiffList-57M6YCNS.css} +6 -7
- package/dist/DiffView/DiffView.d.ts +60 -35
- package/dist/DiffView/diff.d.ts +9 -41
- package/dist/DiffView/index.d.ts +7 -3
- package/dist/DiffView/index.js +1 -1
- package/dist/DiffView/lineDiff.d.ts +58 -0
- package/dist/DiffView/wordDiff.d.ts +47 -0
- package/dist/DiffView-J55CPJDX.css +224 -0
- package/dist/DocTabsEditor/index.js +6 -6
- package/dist/DockColumn/index.js +1 -1
- package/dist/DurationField/index.js +5 -5
- package/dist/EditingStatus/index.js +2 -2
- package/dist/EntityList/index.js +1 -1
- package/dist/InlineEditor/index.js +3 -3
- package/dist/KeyValueRows/index.js +3 -3
- package/dist/ListInput/index.js +6 -6
- package/dist/NumberField/index.js +3 -3
- package/dist/OpenInAppCard/index.js +2 -2
- package/dist/OrgTable/index.js +8 -8
- package/dist/PrincipalPicker/index.js +3 -3
- package/dist/ProposalCard/index.js +6 -6
- package/dist/RailList/index.js +5 -5
- package/dist/RefusalCard/index.js +1 -1
- package/dist/ResultTableCard/index.js +1 -1
- package/dist/RichEditor/index.js +1 -1
- package/dist/SectionFrame/index.js +3 -3
- package/dist/Select/index.js +2 -2
- package/dist/SendKeys/index.js +2 -2
- package/dist/SettingForm/index.js +3 -3
- package/dist/SettingsTable/index.js +1 -1
- package/dist/SetupWizard/index.js +1 -1
- package/dist/ShareDialog/index.js +5 -5
- package/dist/SheetColumnEditor/index.js +7 -7
- package/dist/SidebarNav/index.js +2 -2
- package/dist/SlideFilmstrip/index.js +4 -4
- package/dist/StatusCard/index.js +1 -1
- package/dist/Switcher/index.js +5 -5
- package/dist/TableCells/index.js +1 -1
- package/dist/TimeRangePicker/index.js +4 -4
- package/dist/TimeWindowPicker/index.js +5 -5
- package/dist/ToolCallLog/ToolCallLog.d.ts +97 -0
- package/dist/ToolCallLog/index.d.ts +3 -0
- package/dist/ToolCallLog/index.js +22 -0
- package/dist/ToolCallLog-WSK6TEGH.css +288 -0
- package/dist/TreeCanvas/index.js +2 -2
- package/dist/TreeGrid/index.js +7 -7
- package/dist/ValueField/index.js +4 -4
- package/dist/VersionCompare/VersionCompare.d.ts +3 -4
- package/dist/VersionCompare/index.js +2 -2
- package/dist/{chunk-5DLBGF6I.js → chunk-2YAK37D6.js} +1 -1
- package/dist/chunk-4U5ATJPP.js +194 -0
- package/dist/chunk-4YLN5QVL.js +803 -0
- package/dist/{chunk-DWXTJWCJ.js → chunk-5V2DNF3F.js} +3 -3
- package/dist/{chunk-6BGD32C5.js → chunk-7DLIVPK4.js} +2 -2
- package/dist/{chunk-RGJB34YN.js → chunk-7XUP32RY.js} +1 -1
- package/dist/{chunk-D33K2BCZ.js → chunk-C6F5HISC.js} +1 -1
- package/dist/{chunk-CJAPAIJG.js → chunk-CFVKNEGM.js} +2 -2
- package/dist/{chunk-3Q5USPLM.js → chunk-CSLONHHB.js} +1 -1
- package/dist/{chunk-ITZAWYRG.js → chunk-DBXXJOGQ.js} +1 -1
- package/dist/{chunk-F6OYNO7O.js → chunk-E6STS4FD.js} +2 -2
- package/dist/{chunk-QRUQOITJ.js → chunk-GMHP5KXF.js} +1 -1
- package/dist/{chunk-M4VA76JF.js → chunk-MTJ7KNHZ.js} +3 -3
- package/dist/{chunk-NB53SAL4.js → chunk-NOZD547E.js} +1 -1
- package/dist/{chunk-GFNCMSYS.js → chunk-PPQ3VJUE.js} +1 -1
- package/dist/{chunk-S4ADDFRT.js → chunk-S53XH4SS.js} +1 -1
- package/dist/{chunk-OX332RI7.js → chunk-SZU2JNJN.js} +1 -1
- package/dist/{chunk-OMVGWZ3V.js → chunk-V3HP2HOI.js} +24 -19
- package/dist/{chunk-RUKSDKG5.js → chunk-WA4BKMRI.js} +1 -1
- package/dist/{chunk-CA62YCFK.js → chunk-WTWYN7Z5.js} +1 -1
- package/dist/{chunk-U3ZUZ7VU.js → chunk-Z2YOBQHX.js} +2 -2
- package/dist/{chunk-ECYA6XZL.js → chunk-ZPD4XF4H.js} +2 -2
- package/dist/generated/index.d.ts +1 -0
- package/dist/generated/index.js +77 -76
- package/dist/index.js +77 -76
- package/dist/styles.css +466 -42
- package/package.json +3 -3
- package/dist/DiffView-ZI5C25Q3.css +0 -90
- package/dist/chunk-F4CM5KD3.js +0 -187
- package/dist/{Editor-FXREHINI.js → Editor-VMQ5DK6H.js} +2 -2
- package/dist/{chunk-N3R2POGO.js → chunk-2E4MAF6Z.js} +1 -1
- package/dist/{chunk-7FY7L6WD.js → chunk-46YFRLA2.js} +1 -1
- package/dist/{chunk-KRF3GQ63.js → chunk-6N53ZWRM.js} +1 -1
- package/dist/{chunk-Q3SHCEXN.js → chunk-77J2YS55.js} +1 -1
- package/dist/{chunk-VXTRPLNB.js → chunk-BFJE3C7Q.js} +1 -1
- package/dist/{chunk-657WR3MX.js → chunk-D5UVJL4I.js} +1 -1
- package/dist/{chunk-TTUFOH2Y.js → chunk-FNX3YS55.js} +1 -1
- package/dist/{chunk-O2J5PSWI.js → chunk-FYJAWS4E.js} +1 -1
- package/dist/{chunk-7CVV3DQC.js → chunk-GTJR4APZ.js} +1 -1
- package/dist/{chunk-RXHY5T2Z.js → chunk-KJBDOWG7.js} +1 -1
- package/dist/{chunk-EDQHZOU3.js → chunk-LPTQN7RS.js} +1 -1
- package/dist/{chunk-2DASEYUG.js → chunk-MC5JMA2T.js} +0 -0
- package/dist/{chunk-PW6QXVIX.js → chunk-STYJH473.js} +2 -2
- package/dist/{chunk-WAF36OFS.js → chunk-T3BIW52Y.js} +1 -1
- package/dist/{chunk-7FWYJCKT.js → chunk-WCV44AYD.js} +1 -1
- package/dist/{chunk-YWPUT6JQ.js → chunk-YBUUPA5R.js} +1 -1
- package/dist/{chunk-5ORAUELE.js → chunk-YGMCXWRA.js} +1 -1
- package/dist/{chunk-NG6GEBSJ.js → chunk-YRMDDNFY.js} +1 -1
- package/dist/{chunk-UZMXC5T6.js → chunk-YUVQUJND.js} +1 -1
package/dist/TreeCanvas/index.js
CHANGED
|
@@ -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';
|
package/dist/TreeGrid/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
export { TreeGrid } from '../chunk-
|
|
1
|
+
export { TreeGrid } from '../chunk-WA4BKMRI.js';
|
|
2
2
|
import '../chunk-MY374UUD.js';
|
|
3
|
-
import '../chunk-
|
|
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';
|
package/dist/ValueField/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export { REFERENCE_NAME_PATTERN, ValueField, completeReference, isWholeReference, rankReferences, referenceAt, urlSchemeOf } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
import '../chunk-
|
|
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';
|
|
@@ -65,10 +65,9 @@ export interface VersionCompareProps {
|
|
|
65
65
|
* reader picked first, so a comparison reads forward in time. The host orders
|
|
66
66
|
* the two before it hands them over.
|
|
67
67
|
*
|
|
68
|
-
* THE CHANGES LENS IS A [DiffView] when the host hands
|
|
69
|
-
*
|
|
70
|
-
* changed") rather than drawn as a pane of unmarked lines that
|
|
71
|
-
* that failed to load. A comparison that is not two texts, such as the files
|
|
68
|
+
* THE CHANGES LENS IS A [DiffView] of the two texts when the host hands them
|
|
69
|
+
* over, with its counts above it; two identical texts are said in words
|
|
70
|
+
* ("Nothing changed") rather than drawn as a pane of unmarked lines. A comparison that is not two texts, such as the files
|
|
72
71
|
* of two releases, is drawn by the host in `changes`.
|
|
73
72
|
*
|
|
74
73
|
* A LENS THAT CANNOT BE DRAWN IS ABSENT, not offered and then empty: a first
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { VERSION_COMPARE_LABELS, VERSION_COMPARE_LENSES, VersionCompare } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { VERSION_COMPARE_LABELS, VERSION_COMPARE_LENSES, VersionCompare } from '../chunk-V3HP2HOI.js';
|
|
2
|
+
import '../chunk-4YLN5QVL.js';
|
|
3
3
|
import '../chunk-B3UJKLVI.js';
|
|
4
4
|
import '../chunk-GMXOZEF5.js';
|
|
5
5
|
import '../chunk-XJU53WMW.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RefusalStrip, ReceiptStrip } from './chunk-OAD4AXYJ.js';
|
|
2
|
-
import { ChangeList } from './chunk-
|
|
2
|
+
import { ChangeList } from './chunk-NOZD547E.js';
|
|
3
3
|
import { StatusCard } from './chunk-NWKH5FF7.js';
|
|
4
4
|
import { Callout } from './chunk-CWACQEPP.js';
|
|
5
5
|
import { toInstant, formatUntil, useNow, formatExact, toISO } from './chunk-GBKBME7Q.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 };
|