langchain_agentx_stream_ui 0.5.0 → 0.6.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.
- package/dist/{chunk-ME5T6YSV.js → chunk-4OISGUFR.js} +5 -5
- package/dist/chunk-4OISGUFR.js.map +1 -0
- package/dist/{chunk-GBY5DJ7L.js → chunk-4RIOBLGB.js} +1 -1
- package/dist/chunk-4RIOBLGB.js.map +1 -0
- package/dist/{chunk-TCKOXX7O.js → chunk-4TG4TGIL.js} +7 -5
- package/dist/chunk-4TG4TGIL.js.map +1 -0
- package/dist/{chunk-6Z4ZF36Z.js → chunk-DP7V33X7.js} +1 -1
- package/dist/chunk-DP7V33X7.js.map +1 -0
- package/dist/{chunk-JAOJAGMM.js → chunk-RYUOZTUI.js} +19 -29
- package/dist/chunk-RYUOZTUI.js.map +1 -0
- package/dist/{chunk-FL2G7SV3.js → chunk-ZR37OKV6.js} +302 -93
- package/dist/chunk-ZR37OKV6.js.map +1 -0
- package/dist/default.css +107 -18
- package/dist/index.js +150 -105
- package/dist/index.js.map +1 -1
- package/dist/multi-session.js +6 -6
- package/dist/tools-presentation.js +2 -2
- package/dist/tools.js +4 -4
- package/dist/virtual.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-6Z4ZF36Z.js.map +0 -1
- package/dist/chunk-FL2G7SV3.js.map +0 -1
- package/dist/chunk-GBY5DJ7L.js.map +0 -1
- package/dist/chunk-JAOJAGMM.js.map +0 -1
- package/dist/chunk-ME5T6YSV.js.map +0 -1
- package/dist/chunk-TCKOXX7O.js.map +0 -1
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
resolveEditDiffText,
|
|
14
14
|
truncateCommand,
|
|
15
15
|
truncateLines
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-4RIOBLGB.js";
|
|
17
17
|
|
|
18
18
|
// src/view/tools/toolNames.ts
|
|
19
19
|
var Read = "Read";
|
|
@@ -626,7 +626,7 @@ function AgentProgressLines({
|
|
|
626
626
|
`${index}:${line.text}`
|
|
627
627
|
)),
|
|
628
628
|
hiddenToolUseCount > 0 && mode !== "full" ? /* @__PURE__ */ jsxs("div", { className: "lax-agent-progress__line lax-agent-progress__line--more", children: [
|
|
629
|
-
/* @__PURE__ */ jsx("span", { className: "lax-agent-progress__gutter", "aria-hidden": true, children:
|
|
629
|
+
/* @__PURE__ */ jsx("span", { className: "lax-agent-progress__gutter", "aria-hidden": true, children: AGENT_PROGRESS_INDENT }),
|
|
630
630
|
/* @__PURE__ */ jsxs(
|
|
631
631
|
"button",
|
|
632
632
|
{
|
|
@@ -664,6 +664,37 @@ function toolInputFromCall(call) {
|
|
|
664
664
|
}
|
|
665
665
|
return null;
|
|
666
666
|
}
|
|
667
|
+
function shortenTranscriptPath(filePath, max = 52) {
|
|
668
|
+
const normalized = displayPath(filePath);
|
|
669
|
+
if (!normalized) return "";
|
|
670
|
+
if (normalized.length <= max) return normalized;
|
|
671
|
+
const parts = normalized.split("/").filter(Boolean);
|
|
672
|
+
if (parts.length >= 2) {
|
|
673
|
+
const tail = `${parts[parts.length - 2]}/${parts[parts.length - 1]}`;
|
|
674
|
+
if (tail.length + 2 <= max) return `\u2026/${tail}`;
|
|
675
|
+
}
|
|
676
|
+
return truncatePreview2(normalized, max);
|
|
677
|
+
}
|
|
678
|
+
function withShortenedPaths(toolName, toolInput) {
|
|
679
|
+
const next = { ...toolInput };
|
|
680
|
+
if (toolName === "Read" || toolName === "Glob" || toolName === "Grep") {
|
|
681
|
+
if (typeof next.path === "string" && next.path.trim()) {
|
|
682
|
+
next.path = shortenTranscriptPath(next.path.trim());
|
|
683
|
+
}
|
|
684
|
+
if (typeof next.file_path === "string" && next.file_path.trim()) {
|
|
685
|
+
next.file_path = shortenTranscriptPath(next.file_path.trim());
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
if (toolName === "Write" || toolName === "Edit") {
|
|
689
|
+
const raw = String(next.file_path ?? next.path ?? "").trim();
|
|
690
|
+
if (raw && !isPlanFilePath(raw)) {
|
|
691
|
+
const short = shortenTranscriptPath(raw);
|
|
692
|
+
if ("file_path" in next) next.file_path = short;
|
|
693
|
+
else next.path = short;
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
return next;
|
|
697
|
+
}
|
|
667
698
|
function formatAssistantToolLine(toolName, step, toolInput) {
|
|
668
699
|
const name = toolName.trim() || "Tool";
|
|
669
700
|
if (name === "Bash" && toolInput) {
|
|
@@ -671,63 +702,164 @@ function formatAssistantToolLine(toolName, step, toolInput) {
|
|
|
671
702
|
if (cmd) return formatSubagentToolProgressLine("Bash", { toolInput: { command: cmd } });
|
|
672
703
|
}
|
|
673
704
|
if (["Read", "Write", "Edit", "Glob", "Grep"].includes(name) && toolInput) {
|
|
674
|
-
return formatSubagentToolProgressLine(name, {
|
|
705
|
+
return formatSubagentToolProgressLine(name, {
|
|
706
|
+
toolInput: withShortenedPaths(name, toolInput)
|
|
707
|
+
});
|
|
675
708
|
}
|
|
676
709
|
if (typeof step === "number") return `${name} step ${step}`;
|
|
677
710
|
return name;
|
|
678
711
|
}
|
|
712
|
+
var READ_LINES_FROM_RE = /Read\s+(\d+)\s+lines\s+from/i;
|
|
713
|
+
var READ_LINES_RE = /Read\s+(\d+)\s+lines\b/i;
|
|
714
|
+
var WROTE_LINES_RE = /Wrote\s+(\d+)\s+lines/i;
|
|
715
|
+
var REPLACED_RE = /Replaced\s+(\d+)\s+occurrence/i;
|
|
716
|
+
var NUMBERED_DUMP_RE = /^\s*\d+\t/m;
|
|
717
|
+
function firstMeaningfulLine(text) {
|
|
718
|
+
for (const line of text.split("\n")) {
|
|
719
|
+
const t = line.trim();
|
|
720
|
+
if (t) return t;
|
|
721
|
+
}
|
|
722
|
+
return "";
|
|
723
|
+
}
|
|
724
|
+
function countNonEmptyLines(text) {
|
|
725
|
+
return text.split("\n").filter((line) => line.trim().length > 0).length;
|
|
726
|
+
}
|
|
727
|
+
function condenseTranscriptToolResult(content, toolName) {
|
|
728
|
+
const trimmed = content.trim();
|
|
729
|
+
if (!trimmed) {
|
|
730
|
+
return { text: `${(toolName ?? "tool").trim() || "tool"} result`, variant: "default" };
|
|
731
|
+
}
|
|
732
|
+
const first = firstMeaningfulLine(trimmed);
|
|
733
|
+
if (/^Error\b/i.test(first) || /^error\b/i.test(first)) {
|
|
734
|
+
return { text: truncatePreview2(first, 120), variant: "error" };
|
|
735
|
+
}
|
|
736
|
+
if (/File unchanged/i.test(trimmed)) {
|
|
737
|
+
return { text: "File unchanged", variant: "dim" };
|
|
738
|
+
}
|
|
739
|
+
if (/File created successfully/i.test(trimmed) || /^File created\b/i.test(first)) {
|
|
740
|
+
return { text: "File created", variant: "dim" };
|
|
741
|
+
}
|
|
742
|
+
const replaced = trimmed.match(REPLACED_RE);
|
|
743
|
+
if (replaced) {
|
|
744
|
+
const n = replaced[1] ?? "1";
|
|
745
|
+
return {
|
|
746
|
+
text: n === "1" ? "Updated 1 occurrence" : `Updated ${n} occurrences`,
|
|
747
|
+
variant: "dim"
|
|
748
|
+
};
|
|
749
|
+
}
|
|
750
|
+
const wrote = trimmed.match(WROTE_LINES_RE);
|
|
751
|
+
if (wrote) {
|
|
752
|
+
return { text: `Wrote ${wrote[1]} lines`, variant: "dim" };
|
|
753
|
+
}
|
|
754
|
+
const readFrom = trimmed.match(READ_LINES_FROM_RE);
|
|
755
|
+
if (readFrom) {
|
|
756
|
+
return { text: `Read ${readFrom[1]} lines`, variant: "dim" };
|
|
757
|
+
}
|
|
758
|
+
const readLines = trimmed.match(READ_LINES_RE);
|
|
759
|
+
if (readLines && (NUMBERED_DUMP_RE.test(trimmed) || trimmed.includes("\n"))) {
|
|
760
|
+
return { text: `Read ${readLines[1]} lines`, variant: "dim" };
|
|
761
|
+
}
|
|
762
|
+
const name = (toolName ?? "").trim();
|
|
763
|
+
const multiLine = trimmed.includes("\n") || trimmed.length > 160;
|
|
764
|
+
if (multiLine) {
|
|
765
|
+
if (name === "Read" || NUMBERED_DUMP_RE.test(trimmed) || /^#\s/m.test(trimmed)) {
|
|
766
|
+
const n = countNonEmptyLines(
|
|
767
|
+
trimmed.replace(READ_LINES_FROM_RE, "").replace(/^\([^\)]*\)\s*/m, "")
|
|
768
|
+
);
|
|
769
|
+
const dumpLines = trimmed.split("\n").filter((line) => NUMBERED_DUMP_RE.test(line)).length;
|
|
770
|
+
const lineCount = dumpLines > 0 ? dumpLines : Math.max(n, 1);
|
|
771
|
+
return { text: `Read ${lineCount} lines`, variant: "dim" };
|
|
772
|
+
}
|
|
773
|
+
if (name === "Write") {
|
|
774
|
+
return { text: "File created", variant: "dim" };
|
|
775
|
+
}
|
|
776
|
+
if (name === "Edit") {
|
|
777
|
+
return { text: "Updated", variant: "dim" };
|
|
778
|
+
}
|
|
779
|
+
return { text: truncatePreview2(first, 120), variant: "dim" };
|
|
780
|
+
}
|
|
781
|
+
return { text: truncatePreview2(first, 120), variant: "default" };
|
|
782
|
+
}
|
|
679
783
|
function renderUserToolResult(message) {
|
|
784
|
+
const toolName = String(message.name ?? message.tool_name ?? "").trim() || void 0;
|
|
680
785
|
const content = message.content;
|
|
681
|
-
if (typeof content === "string"
|
|
682
|
-
|
|
786
|
+
if (typeof content === "string") {
|
|
787
|
+
const condensed = condenseTranscriptToolResult(content, toolName);
|
|
788
|
+
return { kind: "result", text: condensed.text, variant: condensed.variant };
|
|
683
789
|
}
|
|
684
790
|
if (content != null && typeof content !== "string") {
|
|
685
791
|
try {
|
|
686
|
-
|
|
792
|
+
const condensed = condenseTranscriptToolResult(JSON.stringify(content), toolName);
|
|
793
|
+
return { kind: "result", text: condensed.text, variant: condensed.variant };
|
|
687
794
|
} catch {
|
|
688
|
-
|
|
795
|
+
const condensed = condenseTranscriptToolResult(String(content), toolName);
|
|
796
|
+
return { kind: "result", text: condensed.text, variant: condensed.variant };
|
|
689
797
|
}
|
|
690
798
|
}
|
|
691
|
-
|
|
692
|
-
|
|
799
|
+
return {
|
|
800
|
+
kind: "result",
|
|
801
|
+
text: `${toolName ?? "tool"} result`,
|
|
802
|
+
variant: "default"
|
|
803
|
+
};
|
|
693
804
|
}
|
|
694
|
-
function
|
|
805
|
+
function renderTranscriptLaneLines(entries) {
|
|
806
|
+
const pendingCalls = [];
|
|
695
807
|
const lines = [];
|
|
696
|
-
const
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
808
|
+
const flushPendingCalls = () => {
|
|
809
|
+
while (pendingCalls.length > 0) {
|
|
810
|
+
const call = pendingCalls.shift();
|
|
811
|
+
if (call && call.text.length > 0) lines.push(call);
|
|
812
|
+
}
|
|
813
|
+
};
|
|
814
|
+
for (const entry of entries) {
|
|
815
|
+
if (entry.messageKind === "assistant") {
|
|
816
|
+
const toolCalls = toolCallsFromAssistant(entry.message);
|
|
817
|
+
if (toolCalls.length > 0) {
|
|
818
|
+
for (const call of toolCalls) {
|
|
819
|
+
const callName = String(call.name ?? entry.toolName ?? "Tool").trim();
|
|
820
|
+
const text2 = formatAssistantToolLine(
|
|
821
|
+
callName,
|
|
822
|
+
entry.step,
|
|
823
|
+
toolInputFromCall(call)
|
|
824
|
+
);
|
|
825
|
+
if (text2.length > 0) {
|
|
826
|
+
pendingCalls.push({ kind: "call", text: text2 });
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
continue;
|
|
705
830
|
}
|
|
706
|
-
|
|
831
|
+
flushPendingCalls();
|
|
832
|
+
const text = String(entry.message.content ?? "").trim();
|
|
833
|
+
if (text) {
|
|
834
|
+
lines.push({ kind: "call", text: truncatePreview2(text, 240) });
|
|
835
|
+
}
|
|
836
|
+
continue;
|
|
707
837
|
}
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
838
|
+
if (entry.messageKind === "user") {
|
|
839
|
+
const result = renderUserToolResult(entry.message);
|
|
840
|
+
if (result.text.length === 0) continue;
|
|
841
|
+
const paired = pendingCalls.shift();
|
|
842
|
+
if (paired && paired.text.length > 0) {
|
|
843
|
+
lines.push(paired);
|
|
844
|
+
}
|
|
845
|
+
lines.push(result);
|
|
711
846
|
}
|
|
712
|
-
return lines;
|
|
713
|
-
}
|
|
714
|
-
if (messageKind === "user") {
|
|
715
|
-
lines.push(renderUserToolResult(message));
|
|
716
847
|
}
|
|
848
|
+
flushPendingCalls();
|
|
717
849
|
return lines;
|
|
718
850
|
}
|
|
719
851
|
|
|
720
852
|
// src/view/tools/agent/SubagentTranscriptBlock.tsx
|
|
721
853
|
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
854
|
+
function gutterForKind(kind) {
|
|
855
|
+
return kind === "call" ? AGENT_PROGRESS_GUTTER : AGENT_PROGRESS_INDENT;
|
|
856
|
+
}
|
|
722
857
|
function SubagentTranscriptBlock({
|
|
723
858
|
entries,
|
|
724
859
|
dataSource = "transcript-lane"
|
|
725
860
|
}) {
|
|
726
861
|
if (entries.length === 0) return null;
|
|
727
|
-
const rendered =
|
|
728
|
-
for (const entry of entries) {
|
|
729
|
-
rendered.push(...renderTranscriptEntryLines(entry));
|
|
730
|
-
}
|
|
862
|
+
const rendered = renderTranscriptLaneLines(entries);
|
|
731
863
|
if (rendered.length === 0) return null;
|
|
732
864
|
return /* @__PURE__ */ jsx2(
|
|
733
865
|
"div",
|
|
@@ -735,16 +867,52 @@ function SubagentTranscriptBlock({
|
|
|
735
867
|
className: "lax-agent-progress lax-agent-progress--transcript",
|
|
736
868
|
"data-testid": "lax-subagent-transcript-lane",
|
|
737
869
|
"data-source": dataSource,
|
|
738
|
-
children: rendered.map((
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
870
|
+
children: rendered.map((line, index) => /* @__PURE__ */ jsxs2(
|
|
871
|
+
"div",
|
|
872
|
+
{
|
|
873
|
+
className: "lax-agent-progress__line",
|
|
874
|
+
"data-kind": line.kind,
|
|
875
|
+
"data-variant": line.variant ?? "default",
|
|
876
|
+
children: [
|
|
877
|
+
/* @__PURE__ */ jsx2("span", { className: "lax-agent-progress__gutter", "aria-hidden": true, children: gutterForKind(line.kind) }),
|
|
878
|
+
/* @__PURE__ */ jsx2("span", { className: "lax-agent-progress__text", children: line.text })
|
|
879
|
+
]
|
|
880
|
+
},
|
|
881
|
+
`${index}:${line.kind}:${line.text}`
|
|
882
|
+
))
|
|
742
883
|
}
|
|
743
884
|
);
|
|
744
885
|
}
|
|
745
886
|
|
|
746
887
|
// src/view/tools/agent/AgentToolBody.tsx
|
|
747
888
|
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
889
|
+
function TranscriptFallbackLines({ text }) {
|
|
890
|
+
const lines = text.split("\n").map((line) => line.trimEnd()).filter((line) => line.length > 0);
|
|
891
|
+
if (lines.length === 0) return null;
|
|
892
|
+
return /* @__PURE__ */ jsxs3(
|
|
893
|
+
"div",
|
|
894
|
+
{
|
|
895
|
+
className: "lax-agent-progress lax-agent-progress--transcript",
|
|
896
|
+
"data-source": "trace-fallback",
|
|
897
|
+
"data-testid": "lax-agent-transcript-fallback",
|
|
898
|
+
children: [
|
|
899
|
+
/* @__PURE__ */ jsx3("div", { className: "lax-agent-progress__label", children: "Transcript" }),
|
|
900
|
+
lines.map((line, index) => /* @__PURE__ */ jsxs3(
|
|
901
|
+
"div",
|
|
902
|
+
{
|
|
903
|
+
className: "lax-agent-progress__line",
|
|
904
|
+
"data-kind": "call",
|
|
905
|
+
children: [
|
|
906
|
+
/* @__PURE__ */ jsx3("span", { className: "lax-agent-progress__gutter", "aria-hidden": true, children: AGENT_PROGRESS_GUTTER }),
|
|
907
|
+
/* @__PURE__ */ jsx3("span", { className: "lax-agent-progress__text", children: line })
|
|
908
|
+
]
|
|
909
|
+
},
|
|
910
|
+
`${index}:${line}`
|
|
911
|
+
))
|
|
912
|
+
]
|
|
913
|
+
}
|
|
914
|
+
);
|
|
915
|
+
}
|
|
748
916
|
function AgentToolBody({
|
|
749
917
|
result,
|
|
750
918
|
bodyMode,
|
|
@@ -798,17 +966,7 @@ function AgentToolBody({
|
|
|
798
966
|
}
|
|
799
967
|
) : null,
|
|
800
968
|
showTranscriptLane ? /* @__PURE__ */ jsx3(SubagentTranscriptBlock, { entries: transcriptLane, dataSource: "transcript-lane" }) : null,
|
|
801
|
-
showTranscriptFallback ? /* @__PURE__ */
|
|
802
|
-
"div",
|
|
803
|
-
{
|
|
804
|
-
className: "lax-agent-progress lax-agent-progress--transcript",
|
|
805
|
-
"data-source": "trace-fallback",
|
|
806
|
-
children: [
|
|
807
|
-
/* @__PURE__ */ jsx3("div", { className: "lax-agent-progress__label", children: "Transcript" }),
|
|
808
|
-
/* @__PURE__ */ jsx3(TruncatedContent, { text: transcriptFallback, mode: "full" })
|
|
809
|
-
]
|
|
810
|
-
}
|
|
811
|
-
) : null
|
|
969
|
+
showTranscriptFallback ? /* @__PURE__ */ jsx3(TranscriptFallbackLines, { text: transcriptFallback }) : null
|
|
812
970
|
] });
|
|
813
971
|
}
|
|
814
972
|
|
|
@@ -963,8 +1121,50 @@ function EditToolBody({
|
|
|
963
1121
|
) });
|
|
964
1122
|
}
|
|
965
1123
|
|
|
966
|
-
// src/view/tools/
|
|
1124
|
+
// src/view/tools/presentation/toolHints.ts
|
|
1125
|
+
function parseToolResultHints(hints) {
|
|
1126
|
+
if (hints == null) return [];
|
|
1127
|
+
if (typeof hints === "string") {
|
|
1128
|
+
const trimmed = hints.trim();
|
|
1129
|
+
return trimmed ? [trimmed] : [];
|
|
1130
|
+
}
|
|
1131
|
+
if (!Array.isArray(hints)) return [];
|
|
1132
|
+
const messages = [];
|
|
1133
|
+
for (const item of hints) {
|
|
1134
|
+
if (typeof item === "string") {
|
|
1135
|
+
const trimmed = item.trim();
|
|
1136
|
+
if (trimmed) messages.push(trimmed);
|
|
1137
|
+
continue;
|
|
1138
|
+
}
|
|
1139
|
+
if (item && typeof item === "object") {
|
|
1140
|
+
const message = item.message;
|
|
1141
|
+
if (typeof message === "string") {
|
|
1142
|
+
const trimmed = message.trim();
|
|
1143
|
+
if (trimmed) messages.push(trimmed);
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
return messages;
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
// src/view/tools/presentation/ToolResultHints.tsx
|
|
967
1151
|
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
1152
|
+
function ToolResultHints({ hints }) {
|
|
1153
|
+
const messages = parseToolResultHints(hints);
|
|
1154
|
+
if (messages.length === 0) return null;
|
|
1155
|
+
return /* @__PURE__ */ jsx7("div", { className: "lax-tool-body__hints", "data-testid": "lax-tool-result-hints", children: messages.map((message) => /* @__PURE__ */ jsx7(
|
|
1156
|
+
"div",
|
|
1157
|
+
{
|
|
1158
|
+
className: "lax-tool-body__block lax-tool-body__block--hint",
|
|
1159
|
+
"data-variant": "dim",
|
|
1160
|
+
children: /* @__PURE__ */ jsx7("p", { className: "lax-tool-body__hint-text", children: message })
|
|
1161
|
+
},
|
|
1162
|
+
message
|
|
1163
|
+
)) });
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1166
|
+
// src/view/tools/glob/GlobToolBody.tsx
|
|
1167
|
+
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
968
1168
|
function buildGlobBodyText(result) {
|
|
969
1169
|
const d = asDisplayRecord(result?.display);
|
|
970
1170
|
if (d?.type === "file_list") {
|
|
@@ -993,21 +1193,24 @@ function GlobToolBody({
|
|
|
993
1193
|
onBodyModeChange
|
|
994
1194
|
}) {
|
|
995
1195
|
if (result?.error) {
|
|
996
|
-
return /* @__PURE__ */
|
|
1196
|
+
return /* @__PURE__ */ jsx8("div", { className: "lax-tool-body lax-tool-body--glob", children: /* @__PURE__ */ jsx8("div", { className: "lax-tool-body__block", "data-variant": "error", children: /* @__PURE__ */ jsx8("pre", { className: "lax-tool-body__text", children: result.error.message }) }) });
|
|
997
1197
|
}
|
|
998
1198
|
const bodyText = buildGlobBodyText(result);
|
|
999
|
-
return /* @__PURE__ */
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1199
|
+
return /* @__PURE__ */ jsxs5("div", { className: "lax-tool-body lax-tool-body--glob", children: [
|
|
1200
|
+
/* @__PURE__ */ jsx8(
|
|
1201
|
+
TruncatedContent,
|
|
1202
|
+
{
|
|
1203
|
+
text: bodyText,
|
|
1204
|
+
mode: bodyMode,
|
|
1205
|
+
onExpand: () => onBodyModeChange?.("full")
|
|
1206
|
+
}
|
|
1207
|
+
),
|
|
1208
|
+
/* @__PURE__ */ jsx8(ToolResultHints, { hints: result?.hints })
|
|
1209
|
+
] });
|
|
1007
1210
|
}
|
|
1008
1211
|
|
|
1009
1212
|
// src/view/tools/grep/GrepToolBody.tsx
|
|
1010
|
-
import { jsx as
|
|
1213
|
+
import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1011
1214
|
function buildGrepBodyText(result) {
|
|
1012
1215
|
const d = asDisplayRecord(result?.display);
|
|
1013
1216
|
if (d?.type === "search_results") {
|
|
@@ -1036,23 +1239,26 @@ function GrepToolBody({
|
|
|
1036
1239
|
onBodyModeChange
|
|
1037
1240
|
}) {
|
|
1038
1241
|
if (result?.error) {
|
|
1039
|
-
return /* @__PURE__ */
|
|
1242
|
+
return /* @__PURE__ */ jsx9("div", { className: "lax-tool-body lax-tool-body--grep", children: /* @__PURE__ */ jsx9("div", { className: "lax-tool-body__block", "data-variant": "error", children: /* @__PURE__ */ jsx9("pre", { className: "lax-tool-body__text", children: result.error.message }) }) });
|
|
1040
1243
|
}
|
|
1041
1244
|
const bodyText = buildGrepBodyText(result);
|
|
1042
|
-
return /* @__PURE__ */
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1245
|
+
return /* @__PURE__ */ jsxs6("div", { className: "lax-tool-body lax-tool-body--grep", children: [
|
|
1246
|
+
/* @__PURE__ */ jsx9(
|
|
1247
|
+
TruncatedContent,
|
|
1248
|
+
{
|
|
1249
|
+
text: bodyText,
|
|
1250
|
+
mode: bodyMode,
|
|
1251
|
+
onExpand: () => onBodyModeChange?.("full")
|
|
1252
|
+
}
|
|
1253
|
+
),
|
|
1254
|
+
/* @__PURE__ */ jsx9(ToolResultHints, { hints: result?.hints })
|
|
1255
|
+
] });
|
|
1050
1256
|
}
|
|
1051
1257
|
|
|
1052
1258
|
// src/view/tools/read/ReadToolBody.tsx
|
|
1053
|
-
import { Fragment, jsx as
|
|
1259
|
+
import { Fragment, jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1054
1260
|
var LINES_RANGE_RE = /lines (\d+)-(\d+) of (\d+)/i;
|
|
1055
|
-
var
|
|
1261
|
+
var READ_LINES_RE2 = /Read (\d+) lines from/i;
|
|
1056
1262
|
var EMPTY_RE = /\(empty file\)/i;
|
|
1057
1263
|
var NOTEBOOK_RE = /Read notebook.*?(\d+) cells/i;
|
|
1058
1264
|
var IMAGE_RE = /Read image/i;
|
|
@@ -1096,7 +1302,7 @@ function formatReadBodySummary(display, summary) {
|
|
|
1096
1302
|
if (range) {
|
|
1097
1303
|
return `Read lines ${range[1]}\u2013${range[2]} of ${range[3]}`;
|
|
1098
1304
|
}
|
|
1099
|
-
const readLines = text.match(
|
|
1305
|
+
const readLines = text.match(READ_LINES_RE2);
|
|
1100
1306
|
if (readLines) return `Read ${readLines[1]} lines`;
|
|
1101
1307
|
if (text.length > 500) {
|
|
1102
1308
|
const lineCount = text.split("\n").length;
|
|
@@ -1133,18 +1339,18 @@ function ReadToolBody({
|
|
|
1133
1339
|
};
|
|
1134
1340
|
const textBlocks = buildTextBlocks();
|
|
1135
1341
|
const hasMore = content && bodyMode === "preview" && content.split("\n").length > MAX_PREVIEW_LINES;
|
|
1136
|
-
return /* @__PURE__ */
|
|
1137
|
-
/* @__PURE__ */
|
|
1138
|
-
content ? isMarkdown ? /* @__PURE__ */
|
|
1342
|
+
return /* @__PURE__ */ jsxs7("div", { className: "lax-tool-body lax-tool-body--read", children: [
|
|
1343
|
+
/* @__PURE__ */ jsx10("div", { className: "lax-tool-body__summary", children: bodyLine }),
|
|
1344
|
+
content ? isMarkdown ? /* @__PURE__ */ jsx10(
|
|
1139
1345
|
MarkdownBlock,
|
|
1140
1346
|
{
|
|
1141
1347
|
text: content,
|
|
1142
1348
|
mode: bodyMode,
|
|
1143
1349
|
onExpand: () => onBodyModeChange?.("full")
|
|
1144
1350
|
}
|
|
1145
|
-
) : /* @__PURE__ */
|
|
1146
|
-
/* @__PURE__ */
|
|
1147
|
-
hasMore ? /* @__PURE__ */
|
|
1351
|
+
) : /* @__PURE__ */ jsxs7(Fragment, { children: [
|
|
1352
|
+
/* @__PURE__ */ jsx10(BodyBlockList, { blocks: textBlocks }),
|
|
1353
|
+
hasMore ? /* @__PURE__ */ jsxs7(
|
|
1148
1354
|
"button",
|
|
1149
1355
|
{
|
|
1150
1356
|
type: "button",
|
|
@@ -1158,16 +1364,16 @@ function ReadToolBody({
|
|
|
1158
1364
|
}
|
|
1159
1365
|
) : null
|
|
1160
1366
|
] }) : null,
|
|
1161
|
-
result?.truncated ? /* @__PURE__ */
|
|
1162
|
-
result?.overflow_file ? /* @__PURE__ */
|
|
1367
|
+
result?.truncated ? /* @__PURE__ */ jsx10("div", { className: "lax-tool-card__truncated", children: "\u7ED3\u679C\u5DF2\u622A\u65AD" }) : null,
|
|
1368
|
+
result?.overflow_file ? /* @__PURE__ */ jsxs7("div", { className: "lax-tool-card__overflow", children: [
|
|
1163
1369
|
"\u5B8C\u6574\u8F93\u51FA\uFF1A",
|
|
1164
|
-
/* @__PURE__ */
|
|
1370
|
+
/* @__PURE__ */ jsx10("code", { children: result.overflow_file })
|
|
1165
1371
|
] }) : null
|
|
1166
1372
|
] });
|
|
1167
1373
|
}
|
|
1168
1374
|
|
|
1169
1375
|
// src/view/tools/skill/SkillToolBody.tsx
|
|
1170
|
-
import { jsx as
|
|
1376
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
1171
1377
|
var MAX_BODY_LINES = 20;
|
|
1172
1378
|
function SkillToolBody({
|
|
1173
1379
|
result,
|
|
@@ -1175,16 +1381,16 @@ function SkillToolBody({
|
|
|
1175
1381
|
onBodyModeChange
|
|
1176
1382
|
}) {
|
|
1177
1383
|
if (result?.error) {
|
|
1178
|
-
return /* @__PURE__ */
|
|
1384
|
+
return /* @__PURE__ */ jsx11("div", { className: "lax-tool-body lax-tool-body--skill", children: /* @__PURE__ */ jsx11("div", { className: "lax-tool-body__block", "data-variant": "error", children: /* @__PURE__ */ jsx11("pre", { className: "lax-tool-body__text", children: result.error.message }) }) });
|
|
1179
1385
|
}
|
|
1180
1386
|
const text = result?.summary?.trim() ?? "";
|
|
1181
1387
|
if (!text) {
|
|
1182
|
-
return /* @__PURE__ */
|
|
1388
|
+
return /* @__PURE__ */ jsx11("div", { className: "lax-tool-body lax-tool-body--skill", children: /* @__PURE__ */ jsx11("div", { className: "lax-tool-body__block", "data-variant": "dim", children: /* @__PURE__ */ jsx11("pre", { className: "lax-tool-body__text", children: "(done)" }) }) });
|
|
1183
1389
|
}
|
|
1184
1390
|
const { text: truncated, truncated: was } = truncateLines(text, MAX_BODY_LINES);
|
|
1185
1391
|
const bodyText = was ? `${truncated}
|
|
1186
1392
|
\u2026 \u5DF2\u622A\u65AD` : truncated;
|
|
1187
|
-
return /* @__PURE__ */
|
|
1393
|
+
return /* @__PURE__ */ jsx11("div", { className: "lax-tool-body lax-tool-body--skill", children: /* @__PURE__ */ jsx11(
|
|
1188
1394
|
TruncatedContent,
|
|
1189
1395
|
{
|
|
1190
1396
|
text: bodyText,
|
|
@@ -1196,7 +1402,7 @@ function SkillToolBody({
|
|
|
1196
1402
|
}
|
|
1197
1403
|
|
|
1198
1404
|
// src/view/tools/webfetch/WebFetchToolBody.tsx
|
|
1199
|
-
import { jsx as
|
|
1405
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
1200
1406
|
var RECEIVED_RE = /Received\s+.+/i;
|
|
1201
1407
|
var MAX_BODY_LINES2 = 15;
|
|
1202
1408
|
function buildWebFetchBody(result) {
|
|
@@ -1225,10 +1431,10 @@ function WebFetchToolBody({
|
|
|
1225
1431
|
onBodyModeChange
|
|
1226
1432
|
}) {
|
|
1227
1433
|
if (result?.error) {
|
|
1228
|
-
return /* @__PURE__ */
|
|
1434
|
+
return /* @__PURE__ */ jsx12("div", { className: "lax-tool-body lax-tool-body--webfetch", children: /* @__PURE__ */ jsx12("div", { className: "lax-tool-body__block", "data-variant": "error", children: /* @__PURE__ */ jsx12("pre", { className: "lax-tool-body__text", children: result.error.message }) }) });
|
|
1229
1435
|
}
|
|
1230
1436
|
const bodyText = buildWebFetchBody(result);
|
|
1231
|
-
return /* @__PURE__ */
|
|
1437
|
+
return /* @__PURE__ */ jsx12("div", { className: "lax-tool-body lax-tool-body--webfetch", children: /* @__PURE__ */ jsx12(
|
|
1232
1438
|
TruncatedContent,
|
|
1233
1439
|
{
|
|
1234
1440
|
text: bodyText,
|
|
@@ -1240,7 +1446,7 @@ function WebFetchToolBody({
|
|
|
1240
1446
|
}
|
|
1241
1447
|
|
|
1242
1448
|
// src/view/tools/websearch/WebSearchToolBody.tsx
|
|
1243
|
-
import { jsx as
|
|
1449
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
1244
1450
|
var MAX_BODY_LINES3 = 15;
|
|
1245
1451
|
function buildWebSearchBody(result) {
|
|
1246
1452
|
const d = asDisplayRecord(result?.display);
|
|
@@ -1265,10 +1471,10 @@ function WebSearchToolBody({
|
|
|
1265
1471
|
onBodyModeChange
|
|
1266
1472
|
}) {
|
|
1267
1473
|
if (result?.error) {
|
|
1268
|
-
return /* @__PURE__ */
|
|
1474
|
+
return /* @__PURE__ */ jsx13("div", { className: "lax-tool-body lax-tool-body--websearch", children: /* @__PURE__ */ jsx13("div", { className: "lax-tool-body__block", "data-variant": "error", children: /* @__PURE__ */ jsx13("pre", { className: "lax-tool-body__text", children: result.error.message }) }) });
|
|
1269
1475
|
}
|
|
1270
1476
|
const bodyText = buildWebSearchBody(result);
|
|
1271
|
-
return /* @__PURE__ */
|
|
1477
|
+
return /* @__PURE__ */ jsx13("div", { className: "lax-tool-body lax-tool-body--websearch", children: /* @__PURE__ */ jsx13(
|
|
1272
1478
|
TruncatedContent,
|
|
1273
1479
|
{
|
|
1274
1480
|
text: bodyText,
|
|
@@ -1280,7 +1486,7 @@ function WebSearchToolBody({
|
|
|
1280
1486
|
}
|
|
1281
1487
|
|
|
1282
1488
|
// src/view/tools/write/WriteToolBody.tsx
|
|
1283
|
-
import { jsx as
|
|
1489
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
1284
1490
|
function buildWriteBodyText(input, display, summary) {
|
|
1285
1491
|
const d = asDisplayRecord(display);
|
|
1286
1492
|
const inp = asInputRecord(input);
|
|
@@ -1322,7 +1528,7 @@ function WriteToolBody({
|
|
|
1322
1528
|
onBodyModeChange
|
|
1323
1529
|
}) {
|
|
1324
1530
|
if (result?.error) {
|
|
1325
|
-
return /* @__PURE__ */
|
|
1531
|
+
return /* @__PURE__ */ jsx14("div", { className: "lax-tool-body lax-tool-body--write", children: /* @__PURE__ */ jsx14("div", { className: "lax-tool-body__block", "data-variant": "error", children: /* @__PURE__ */ jsx14("pre", { className: "lax-tool-body__text", children: result.error.message }) }) });
|
|
1326
1532
|
}
|
|
1327
1533
|
const body = buildWriteBodyText(
|
|
1328
1534
|
input,
|
|
@@ -1330,7 +1536,7 @@ function WriteToolBody({
|
|
|
1330
1536
|
result?.summary ?? ""
|
|
1331
1537
|
);
|
|
1332
1538
|
if (body.kind === "diff") {
|
|
1333
|
-
return /* @__PURE__ */
|
|
1539
|
+
return /* @__PURE__ */ jsx14("div", { className: "lax-tool-body lax-tool-body--write", children: /* @__PURE__ */ jsx14(
|
|
1334
1540
|
DiffView,
|
|
1335
1541
|
{
|
|
1336
1542
|
diff: body.text,
|
|
@@ -1339,7 +1545,7 @@ function WriteToolBody({
|
|
|
1339
1545
|
}
|
|
1340
1546
|
) });
|
|
1341
1547
|
}
|
|
1342
|
-
return /* @__PURE__ */
|
|
1548
|
+
return /* @__PURE__ */ jsx14("div", { className: "lax-tool-body lax-tool-body--write", children: /* @__PURE__ */ jsx14(
|
|
1343
1549
|
TruncatedContent,
|
|
1344
1550
|
{
|
|
1345
1551
|
text: body.text,
|
|
@@ -1390,6 +1596,8 @@ export {
|
|
|
1390
1596
|
numField,
|
|
1391
1597
|
formatEditTitle,
|
|
1392
1598
|
formatWriteTitle,
|
|
1599
|
+
AGENT_PROGRESS_GUTTER,
|
|
1600
|
+
AGENT_PROGRESS_INDENT,
|
|
1393
1601
|
coerceSubagentProgressEntries,
|
|
1394
1602
|
extractLastToolInfoFromProgress,
|
|
1395
1603
|
formatAgentTitle,
|
|
@@ -1399,6 +1607,7 @@ export {
|
|
|
1399
1607
|
AskUserQuestionToolBody,
|
|
1400
1608
|
BashToolBody,
|
|
1401
1609
|
EditToolBody,
|
|
1610
|
+
ToolResultHints,
|
|
1402
1611
|
GlobToolBody,
|
|
1403
1612
|
GrepToolBody,
|
|
1404
1613
|
ReadToolBody,
|
|
@@ -1409,4 +1618,4 @@ export {
|
|
|
1409
1618
|
ToolDisplayRegistry,
|
|
1410
1619
|
createDefaultToolRegistry
|
|
1411
1620
|
};
|
|
1412
|
-
//# sourceMappingURL=chunk-
|
|
1621
|
+
//# sourceMappingURL=chunk-ZR37OKV6.js.map
|