@qredence/fleet 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +8 -1
  3. package/dist/web/client/assets/artifacts-panel-CX62LQ13.js +1 -0
  4. package/dist/web/client/assets/artifacts-utils-N_kUFbz2.js +1 -0
  5. package/dist/web/client/assets/bot-Bs7QWJ2q.js +1 -0
  6. package/dist/web/client/assets/{chat-C64Sv6V-.js → chat-CsepBQwy.js} +5 -5
  7. package/dist/web/client/assets/{chat-command-palette-HpsmKfLO.js → chat-command-palette-C4sSf8Kg.js} +1 -1
  8. package/dist/web/client/assets/collapsible-DmyYcezk.js +1 -0
  9. package/dist/web/client/assets/command-CB6emP8m.js +2 -0
  10. package/dist/web/client/assets/conversation-turns-ByFoWPXe.js +6 -0
  11. package/dist/web/client/assets/ease-vFBiNFNK.js +9 -0
  12. package/dist/web/client/assets/{fleet-pi-tool-renderer-ZKiX6Ob_.js → fleet-pi-tool-renderer-BD_ZAjlG.js} +28 -30
  13. package/dist/web/client/assets/globals-CqqQdk2S.css +2 -0
  14. package/dist/web/client/assets/horizontal-resize-C1TpRLNC.js +1 -0
  15. package/dist/web/client/assets/index-DweoFRMs.js +12 -0
  16. package/dist/web/client/assets/{input-Clyn18XG.js → input-CqC82Agz.js} +1 -1
  17. package/dist/web/client/assets/{input-group-MxDAWX3j.js → input-group-H0TG-mkU.js} +1 -1
  18. package/dist/web/client/assets/ipython-tool-BfeIa0nK.js +3 -0
  19. package/dist/web/client/assets/markdown-DG7pUdsX.js +2 -0
  20. package/dist/web/client/assets/{markdown-code-pIaEVDUU.js → markdown-code-BgMzpy7O.js} +1 -1
  21. package/dist/web/client/assets/notify-Duj26eeZ.js +1 -0
  22. package/dist/web/client/assets/{openui-renderer-NLUpAS3h.js → openui-renderer-DlUo6ehT.js} +5 -5
  23. package/dist/web/client/assets/openui-utils-DawGoQNp.js +1 -0
  24. package/dist/web/client/assets/prime-agent-artifacts-CHGb5V_j.js +5 -0
  25. package/dist/web/client/assets/{provider-catalog-Gx9qaHBM.js → provider-catalog-BZhZuKSz.js} +1 -1
  26. package/dist/web/client/assets/provider-label-jKm8v18u.js +1 -0
  27. package/dist/web/client/assets/range-vSJ7Ux_5.js +2 -0
  28. package/dist/web/client/assets/repl-panel-DiGS6uCw.js +1 -0
  29. package/dist/web/client/assets/resource-helpers-ULlyU8qK.js +2 -0
  30. package/dist/web/client/assets/resources-panel-DSU7VGX2.js +1 -0
  31. package/dist/web/client/assets/routes-CxlNCi_v.js +16 -0
  32. package/dist/web/client/assets/session-insights-panel-DwmwiikS.js +1 -0
  33. package/dist/web/client/assets/settings-dialog-CkfpTKfM.js +1 -0
  34. package/dist/web/client/assets/skeleton-loaders-fStjEeRP.js +1 -0
  35. package/dist/web/client/assets/square-terminal-BYTN_I86.js +1 -0
  36. package/dist/web/client/assets/subagents-panel-DGnsK6Nx.js +1 -0
  37. package/dist/web/client/assets/{switch-ojzdMno9.js → switch-BFEBpUEU.js} +1 -1
  38. package/dist/web/client/assets/{tool-result-QvhjpNGX.js → tool-result-CBzwwUE9.js} +3 -3
  39. package/dist/web/client/assets/ui-preferences-DUEFuJFj.js +1 -0
  40. package/dist/web/client/assets/workspace-panel-CjdXlEvd.js +1 -0
  41. package/dist/web/client/assets/workspace-path-nav-C0AQNZyy.js +1 -0
  42. package/dist/web/server/{_tanstack-start-manifest_v-uZddQetG-MNZGQOSA.js → _tanstack-start-manifest_v-bDUlyKY0-KFW35JRO.js} +23 -16
  43. package/dist/web/server/{artifacts-panel-knpQvJ-q-WJLZ76QB.js → artifacts-panel-D9w1DHAN-FGRDCYU2.js} +37 -70
  44. package/dist/web/server/{chat-command-palette-CPv5GmGJ-22J32S6P.js → chat-command-palette-BaenPkCN-BHSOPGU4.js} +16 -14
  45. package/dist/web/server/{chunk-OADQILSQ.js → chunk-2U7PWSJX.js} +49 -47
  46. package/dist/web/server/{chunk-ZX3XOSYO.js → chunk-3GSFXWL5.js} +2 -2
  47. package/dist/web/server/{chunk-IFV5M33X.js → chunk-3IKSPTYI.js} +12 -26
  48. package/dist/web/server/{chunk-W7LNJCRJ.js → chunk-44IVTHDV.js} +18 -10
  49. package/dist/web/server/{chunk-I3FDTJFO.js → chunk-46VQY7SG.js} +6 -87
  50. package/dist/web/server/{chunk-WTYNN6EV.js → chunk-54II5QXQ.js} +23 -1
  51. package/dist/web/server/{chunk-PRT4QYOB.js → chunk-5AVQZ4AZ.js} +1 -35
  52. package/dist/web/server/chunk-6GMKRR3C.js +161 -0
  53. package/dist/web/server/chunk-74QOI457.js +45 -0
  54. package/dist/web/server/chunk-AQ66E5OW.js +33 -0
  55. package/dist/web/server/{chunk-TTQ75CXC.js → chunk-AZZHUVJR.js} +88 -23
  56. package/dist/web/server/{chunk-KAWYGHDN.js → chunk-B2F6MLVZ.js} +23 -1
  57. package/dist/web/server/{chunk-C7EKOPZU.js → chunk-DO3TVNGA.js} +87 -87
  58. package/dist/web/server/chunk-EIVNRYP3.js +48 -0
  59. package/dist/web/server/{chunk-UBUXV2TW.js → chunk-FBOO3G67.js} +6 -6
  60. package/dist/web/server/{chunk-MK3P3OBZ.js → chunk-FVWDJNXR.js} +5 -5
  61. package/dist/web/server/chunk-G5BCQQ5N.js +34 -0
  62. package/dist/web/server/{chunk-4KFMONRT.js → chunk-H64JLONZ.js} +9 -9
  63. package/dist/web/server/{chunk-KDSISV4P.js → chunk-HBZ6YKRB.js} +2 -50
  64. package/dist/web/server/{chunk-5277VI3D.js → chunk-KPNGZR2R.js} +12 -74
  65. package/dist/web/server/chunk-M2FGGPNA.js +376 -0
  66. package/dist/web/server/{chunk-KVHPE5XH.js → chunk-MDYA4NXK.js} +22 -8
  67. package/dist/web/server/chunk-NFRJDPB3.js +52 -0
  68. package/dist/web/server/chunk-P66QQWUM.js +67 -0
  69. package/dist/web/server/{fleet-pi-tool-renderer-5vYFNeZS-IHKMLT7W.js → chunk-PCJ5EKFE.js} +40 -392
  70. package/dist/web/server/{chunk-APN3LVRT.js → chunk-PWK2HJIV.js} +27 -30
  71. package/dist/web/server/{chunk-XXNFEXDU.js → chunk-QJBEWT4E.js} +2 -70
  72. package/dist/web/server/{chunk-JD6EWZCU.js → chunk-VHCAD46L.js} +48 -48
  73. package/dist/web/server/chunk-Y6LJ4WBI.js +1797 -0
  74. package/dist/web/server/{chunk-NGI44XRR.js → chunk-ZEVZFLIY.js} +1 -1
  75. package/dist/web/server/fleet-pi-tool-renderer-lJvZWmBJ-4M5YI6VS.js +35 -0
  76. package/dist/web/server/{fork-picker-dialog-BZzfxdQd-C6SPHFAW.js → fork-picker-dialog-BZzfxdQd-Y725VJ7G.js} +2 -2
  77. package/dist/web/server/{markdown-Ct_q4D-z-VFWZRBTY.js → markdown-Boni3lHk-AZGKDNAR.js} +1 -1
  78. package/dist/web/server/{markdown-code-C_ih1bX1-5CIWT3CH.js → markdown-code-BrWukbg3-D2GN4Y77.js} +2 -2
  79. package/dist/web/server/{openui-renderer-BT5jL0Yf-XYLLN5U6.js → openui-renderer-Cg4RSE9k-7BTJIYZJ.js} +12 -11
  80. package/dist/web/server/repl-panel-BEQrC2ef-V3YEZ7EO.js +117 -0
  81. package/dist/web/server/{resources-panel-DNCVHTIg-PJYMXVGE.js → resources-panel-CwKh4U9f-D3VDEMDW.js} +6 -6
  82. package/dist/web/server/{router-DDxOMz3K-HRBXILHM.js → router-CEahIUpn-SRG7XKIH.js} +131 -21
  83. package/dist/web/server/{routes-BX4Tv-6R-FHIZYUWW.js → routes-BznemByz-F4DJAYIM.js} +1371 -2499
  84. package/dist/web/server/server.js +2 -2
  85. package/dist/web/server/{session-insights-panel-gYkkAE8H-W4O74Z7H.js → session-insights-panel-JfeTHE0d-3HZB3ZWI.js} +2 -2
  86. package/dist/web/server/{settings-dialog-BTBFLQ1P-ZENQ4KWK.js → settings-dialog-DgeBMORv-7SRSENPM.js} +47 -61
  87. package/dist/web/server/subagents-panel-CzZe3co7-2VZ5JTWF.js +332 -0
  88. package/dist/web/server/{chunk-5SZXUN3Y.js → workspace-panel-y54P79_B-VPIYUXF6.js} +29 -16
  89. package/package.json +11 -3
  90. package/dist/web/client/assets/artifacts-panel-8TyrNBM_.js +0 -1
  91. package/dist/web/client/assets/collapsible-WCSnxhr2.js +0 -1
  92. package/dist/web/client/assets/command-DgfiCKcY.js +0 -2
  93. package/dist/web/client/assets/globals-BmxtUHFx.css +0 -2
  94. package/dist/web/client/assets/horizontal-resize-B76jjn5v.js +0 -1
  95. package/dist/web/client/assets/index-0pBr_bKy.js +0 -12
  96. package/dist/web/client/assets/markdown-BXWmNJo7.js +0 -2
  97. package/dist/web/client/assets/prime-agent-artifacts-k9JiTDZM.js +0 -5
  98. package/dist/web/client/assets/provider-brand-icon-VCebsuTD.js +0 -1
  99. package/dist/web/client/assets/range-KAaLzImH.js +0 -2
  100. package/dist/web/client/assets/resources-panel-BWuKeyrb.js +0 -1
  101. package/dist/web/client/assets/routes-BPRw0UzV.js +0 -20
  102. package/dist/web/client/assets/session-insights-panel-CPymkzZT.js +0 -1
  103. package/dist/web/client/assets/settings-dialog-6p8mjg8t.js +0 -1
  104. package/dist/web/client/assets/shared-DAI9OAw0.js +0 -2
  105. package/dist/web/client/assets/skeleton-loaders-qxIkJKCA.js +0 -1
  106. package/dist/web/client/assets/workspace-panel-C67-fqw4.js +0 -1
  107. package/dist/web/client/assets/workspace-path-nav-BrQHo6es.js +0 -9
  108. package/dist/web/server/chunk-KJ4UUAEU.js +0 -83
  109. package/dist/web/server/workspace-panel-BNAXF57q-EQCBPEG4.js +0 -28
  110. package/dist/web/server/{chunk-AQWTGP35.js → chunk-FE4KN6T2.js} +5 -5
@@ -0,0 +1,376 @@
1
+ import {
2
+ createLucideIcon
3
+ } from "./chunk-E26EAQIM.js";
4
+ import {
5
+ cn
6
+ } from "./chunk-DJMHPJBP.js";
7
+
8
+ // web/app/dist/server/assets/ipython-tool-DYRA1Gao.js
9
+ import React, { memo, useEffect, useMemo, useRef, useState } from "react";
10
+ import { jsx, jsxs } from "react/jsx-runtime";
11
+ var CodeXml = createLucideIcon("code-xml", [
12
+ ["path", {
13
+ d: "m18 16 4-4-4-4",
14
+ key: "1inbqp"
15
+ }],
16
+ ["path", {
17
+ d: "m6 8-4 4 4 4",
18
+ key: "15zrgr"
19
+ }],
20
+ ["path", {
21
+ d: "m14.5 4-5 16",
22
+ key: "e7oirm"
23
+ }]
24
+ ]);
25
+ function ToolTextShimmerComponent({ children, as: Component = "p", className, duration = 2, spread = 100, delay = 0 }) {
26
+ const style = {
27
+ "--an-shimmer-duration": `${duration}s`,
28
+ "--an-shimmer-spread": `${spread}px`,
29
+ animationDelay: delay > 0 ? `${delay}s` : void 0,
30
+ animationDuration: `${duration}s`,
31
+ animationIterationCount: "infinite",
32
+ animationTimingFunction: "linear"
33
+ };
34
+ return /* @__PURE__ */ jsx(Component, {
35
+ className: cn("an-text-shimmer", "an-text-shimmer--active", className),
36
+ style,
37
+ children
38
+ });
39
+ }
40
+ var ToolTextShimmer = React.memo(ToolTextShimmerComponent);
41
+ function useToolComplete(isAnimating, duration, onComplete) {
42
+ const onCompleteRef = useRef(onComplete);
43
+ useEffect(() => {
44
+ onCompleteRef.current = onComplete;
45
+ }, [onComplete]);
46
+ useEffect(() => {
47
+ if (!isAnimating) return;
48
+ const t = setTimeout(() => onCompleteRef.current(), duration);
49
+ return () => clearTimeout(t);
50
+ }, [isAnimating, duration]);
51
+ }
52
+ function calculateDiffStatsFromPatch(patches) {
53
+ let addedLines = 0;
54
+ let removedLines = 0;
55
+ for (const patch of patches) {
56
+ if (!patch.lines) continue;
57
+ for (const line of patch.lines) if (line.startsWith("+")) addedLines++;
58
+ else if (line.startsWith("-")) removedLines++;
59
+ }
60
+ if (addedLines === 0 && removedLines === 0) return void 0;
61
+ const parts = [];
62
+ if (addedLines > 0) parts.push(`+${addedLines}`);
63
+ if (removedLines > 0) parts.push(`-${removedLines}`);
64
+ return parts.join(" ");
65
+ }
66
+ function getDiffLinesFromPatch(patches) {
67
+ const result = [];
68
+ for (const patch of patches) {
69
+ if (!patch.lines) continue;
70
+ for (const line of patch.lines) if (line.startsWith("+")) result.push({
71
+ type: "add",
72
+ content: line.slice(1)
73
+ });
74
+ else if (line.startsWith("-")) result.push({
75
+ type: "remove",
76
+ content: line.slice(1)
77
+ });
78
+ else if (line.startsWith(" ")) result.push({
79
+ type: "context",
80
+ content: line.slice(1)
81
+ });
82
+ }
83
+ return result;
84
+ }
85
+ function mapToolStateToStepState(aiState) {
86
+ return aiState === "result" ? "complete" : "animating";
87
+ }
88
+ function mapToolNameToVariant(toolName) {
89
+ const lower = toolName.toLowerCase();
90
+ if (lower === "thinking" || lower === "reasoning") return "thinking";
91
+ if (lower === "websearch" || lower === "web_search" || lower === "grep" || lower === "glob" || lower === "webfetch" || lower === "web_fetch") return "search";
92
+ }
93
+ function extractToolDetail(toolName, args) {
94
+ switch (toolName) {
95
+ case "Bash":
96
+ return args?.command ? String(args.command).slice(0, 80) : "";
97
+ case "Edit":
98
+ case "Write":
99
+ case "Read":
100
+ return args?.file_path ? String(args.file_path).split("/").pop() ?? "" : "";
101
+ case "Grep":
102
+ return args?.pattern ? String(args.pattern) : "";
103
+ case "Glob":
104
+ return args?.pattern ? String(args.pattern) : "";
105
+ case "WebSearch":
106
+ case "web_search":
107
+ return args?.query ? String(args.query) : "";
108
+ case "WebFetch":
109
+ case "web_fetch":
110
+ return args?.url ? String(args.url).slice(0, 60) : "";
111
+ default:
112
+ return "";
113
+ }
114
+ }
115
+ function mapToolInvocationToStep(toolCallId, toolInvocation) {
116
+ const { toolName, args = {}, result } = toolInvocation;
117
+ const step = {
118
+ id: toolCallId,
119
+ type: "tool-call",
120
+ toolName: toolName === "PlanWrite" ? "Plan" : toolName === "TodoWrite" ? "Todo" : toolName,
121
+ toolDetail: extractToolDetail(toolName, args),
122
+ duration: Number.MAX_SAFE_INTEGER,
123
+ toolVariant: mapToolNameToVariant(toolName)
124
+ };
125
+ if (toolName === "Bash") {
126
+ step.bashCommand = args?.command ? String(args.command) : void 0;
127
+ if (toolInvocation.state === "result" && result) {
128
+ if (typeof result === "string") {
129
+ step.bashOutput = result;
130
+ step.bashSuccess = true;
131
+ } else if (typeof result === "object") {
132
+ const stdout = typeof result?.stdout === "string" ? result.stdout : typeof result?.output === "string" ? result.output : "";
133
+ const stderr = typeof result?.stderr === "string" ? result.stderr : "";
134
+ step.bashOutput = [stdout, stderr].filter(Boolean).join(stdout && stderr ? "\n" : "");
135
+ const exitCode = result?.exitCode ?? result?.exit_code;
136
+ step.bashSuccess = exitCode === void 0 ? true : exitCode === 0;
137
+ } else {
138
+ step.bashOutput = JSON.stringify(result);
139
+ step.bashSuccess = true;
140
+ }
141
+ }
142
+ }
143
+ if (toolName === "Edit" || toolName === "Write" || toolName === "Read") step.filePath = args?.file_path ? String(args.file_path) : void 0;
144
+ if (toolName === "Write") {
145
+ const content = typeof result?.content === "string" ? result.content : typeof args?.content === "string" ? args.content : "";
146
+ if (content) {
147
+ const lines = content.split("\n");
148
+ step.diffStats = `+${lines.length}`;
149
+ step.diffLines = lines.map((line) => ({
150
+ type: "add",
151
+ content: line
152
+ }));
153
+ }
154
+ }
155
+ if (toolName === "Edit" && Array.isArray(result?.structuredPatch)) {
156
+ step.diffStats = calculateDiffStatsFromPatch(result.structuredPatch);
157
+ step.diffLines = getDiffLinesFromPatch(result.structuredPatch);
158
+ }
159
+ if (toolName === "WebSearch" || toolName === "web_search" || toolName === "Grep" || toolName === "Glob") {
160
+ step.searchQuery = args?.query ?? args?.pattern ? String(args?.query ?? args?.pattern) : void 0;
161
+ step.searchSource = toolName === "WebSearch" || toolName === "web_search" ? "web" : "code";
162
+ }
163
+ if (toolName.toLowerCase() === "thinking" || toolName.toLowerCase() === "reasoning") {
164
+ const fromArgs = typeof args?.thought === "string" ? args.thought : typeof args?.text === "string" ? args.text : void 0;
165
+ const fromResult = typeof result === "string" ? result : result && typeof result === "object" && typeof result.text === "string" ? result.text : typeof result === "object" && result && typeof result.thought === "string" ? result.thought : void 0;
166
+ step.thoughtContent = fromArgs ?? fromResult;
167
+ }
168
+ return step;
169
+ }
170
+ function resolveToolPartState(partState) {
171
+ if (partState === "output-available") return "result";
172
+ if (partState === "input-streaming") return "partial-call";
173
+ return "call";
174
+ }
175
+ function adaptToolPart(part, toolName) {
176
+ const state = resolveToolPartState(part.state);
177
+ return {
178
+ step: mapToolInvocationToStep(part.toolCallId ?? part.id ?? toolName.toLowerCase(), {
179
+ toolName,
180
+ args: part.input ?? part.args ?? {},
181
+ state,
182
+ result: part.output ?? part.result
183
+ }),
184
+ stepState: mapToolStateToStepState(state)
185
+ };
186
+ }
187
+ var ToolApprovalFooter = memo(function ToolApprovalFooter2({ isPending, approveLabel, rejectLabel, onApprove, onReject }) {
188
+ const [decision, setDecision] = useState(null);
189
+ const approveText = decision === "approved" ? "Approved" : approveLabel ?? "Next";
190
+ const rejectText = decision === "rejected" ? "Skipped" : rejectLabel ?? "Skip";
191
+ const handleApprove = () => {
192
+ if (decision) return;
193
+ setDecision("approved");
194
+ onApprove?.();
195
+ };
196
+ const handleReject = () => {
197
+ if (decision) return;
198
+ setDecision("rejected");
199
+ onReject?.();
200
+ };
201
+ const statusConfig = useMemo(() => {
202
+ if (decision === "approved") return {
203
+ label: "Waiting",
204
+ dots: true
205
+ };
206
+ if (decision === "rejected") return {
207
+ label: "Canceled",
208
+ dots: false
209
+ };
210
+ if (isPending) return {
211
+ label: "Starting",
212
+ dots: true
213
+ };
214
+ return null;
215
+ }, [decision, isPending]);
216
+ return /* @__PURE__ */ jsxs("div", {
217
+ className: "flex items-center justify-between border-t border-border bg-an-tool-background py-1 pr-2 pl-3",
218
+ children: [statusConfig ? /* @__PURE__ */ jsxs("span", {
219
+ className: "text-xs text-an-tool-color-muted",
220
+ children: [statusConfig.label, statusConfig.dots && /* @__PURE__ */ jsxs("span", {
221
+ className: "inline-flex",
222
+ "aria-hidden": "true",
223
+ children: [
224
+ /* @__PURE__ */ jsx("span", {
225
+ className: "animate-[loading-dots_1.4s_infinite_0.2s] text-an-tool-color-muted",
226
+ children: "."
227
+ }),
228
+ /* @__PURE__ */ jsx("span", {
229
+ className: "animate-[loading-dots_1.4s_infinite_0.4s] text-an-tool-color-muted",
230
+ children: "."
231
+ }),
232
+ /* @__PURE__ */ jsx("span", {
233
+ className: "animate-[loading-dots_1.4s_infinite_0.6s] text-an-tool-color-muted",
234
+ children: "."
235
+ })
236
+ ]
237
+ })]
238
+ }) : /* @__PURE__ */ jsx("span", { "aria-hidden": "true" }), /* @__PURE__ */ jsxs("div", {
239
+ className: "flex gap-1",
240
+ children: [/* @__PURE__ */ jsx("button", {
241
+ type: "button",
242
+ onClick: handleReject,
243
+ disabled: Boolean(decision),
244
+ className: "h-5 rounded-[4px] px-1.5 text-xs text-muted-foreground transition-[background-color,color,transform] duration-150 hover:bg-muted/50 hover:text-an-tool-color active:scale-[0.98] disabled:opacity-60 disabled:hover:bg-transparent disabled:active:scale-100",
245
+ children: rejectText
246
+ }), /* @__PURE__ */ jsx("button", {
247
+ type: "button",
248
+ onClick: handleApprove,
249
+ disabled: Boolean(decision),
250
+ className: "h-5 rounded-[4px] bg-an-primary-color px-1.5 text-xs font-medium text-an-send-button-color transition-[background-color,transform] duration-150 hover:bg-an-primary-color/90 active:scale-[0.98] disabled:opacity-60 disabled:hover:bg-an-primary-color disabled:active:scale-100",
251
+ children: approveText
252
+ })]
253
+ })]
254
+ });
255
+ });
256
+ function getInputCode(part) {
257
+ const input = part.input ?? part.args ?? {};
258
+ if (typeof input.code === "string") return input.code;
259
+ return "";
260
+ }
261
+ function getOutputDetails(part) {
262
+ const out = part.output ?? part.result;
263
+ if (!out || typeof out !== "object") return void 0;
264
+ return out;
265
+ }
266
+ function firstNonEmpty(...candidates) {
267
+ for (const c of candidates) if (c && c.trim()) return c;
268
+ return "";
269
+ }
270
+ function IpythonCellCard({ step, state, onComplete, approval, cellIndex, part }) {
271
+ useToolComplete(state === "animating", step.duration, onComplete);
272
+ const isPending = state === "animating";
273
+ const code = getInputCode(part);
274
+ const details = getOutputDetails(part);
275
+ const isBashCell = code.trimStart().startsWith("%%bash");
276
+ const cellLabel = cellIndex !== void 0 ? `In [${cellIndex}]` : "IPython";
277
+ const displayOutput = firstNonEmpty(details?.result, details?.stdout, details?.stderr, details?.error?.evalue);
278
+ const hasError = Boolean(details?.error) || Boolean(details?.errorEname) || details?.status === "error";
279
+ return /* @__PURE__ */ jsxs("div", {
280
+ className: "overflow-hidden rounded-an-tool-border-radius border border-border bg-an-tool-background",
281
+ children: [
282
+ /* @__PURE__ */ jsxs("div", {
283
+ className: "flex h-7 items-center justify-between pr-2 pl-2.5",
284
+ children: [/* @__PURE__ */ jsxs("div", {
285
+ className: "flex min-w-0 items-center gap-1.5 overflow-hidden",
286
+ children: [/* @__PURE__ */ jsxs("span", {
287
+ className: "inline-flex items-center gap-1 rounded-sm bg-muted px-1.5 py-0.5 font-mono text-[10px] leading-none text-muted-foreground uppercase",
288
+ children: [/* @__PURE__ */ jsx(CodeXml, { className: "h-3 w-3" }), isBashCell ? "shell" : "python"]
289
+ }), isPending ? /* @__PURE__ */ jsx(ToolTextShimmer, {
290
+ as: "span",
291
+ duration: 1.2,
292
+ className: "m-0 inline-flex h-full items-center truncate text-xs leading-none",
293
+ children: "Running cell"
294
+ }) : /* @__PURE__ */ jsxs("span", {
295
+ className: "truncate text-xs text-muted-foreground",
296
+ children: [hasError ? "Cell failed" : "Ran cell", details?.kernelRestarted && " \xB7 kernel restarted"]
297
+ })]
298
+ }), isPending && /* @__PURE__ */ jsx("svg", {
299
+ className: "h-3 w-3 shrink-0 animate-spin text-muted-foreground",
300
+ viewBox: "0 0 16 16",
301
+ fill: "none",
302
+ children: /* @__PURE__ */ jsx("circle", {
303
+ cx: "8",
304
+ cy: "8",
305
+ r: "6",
306
+ stroke: "currentColor",
307
+ strokeWidth: "1.5",
308
+ strokeDasharray: "28",
309
+ strokeDashoffset: "7",
310
+ strokeLinecap: "round"
311
+ })
312
+ })]
313
+ }),
314
+ /* @__PURE__ */ jsxs("div", {
315
+ className: "overflow-hidden border-t border-border bg-background px-2.5 py-1.5 font-mono text-[12px] leading-[16px]",
316
+ children: [/* @__PURE__ */ jsxs("div", {
317
+ className: "break-all whitespace-pre-wrap",
318
+ children: [/* @__PURE__ */ jsxs("span", {
319
+ className: "mr-2 text-cyan-600 select-none dark:text-cyan-400",
320
+ children: [cellLabel, ":"]
321
+ }), /* @__PURE__ */ jsx("span", {
322
+ className: "text-foreground",
323
+ children: code
324
+ })]
325
+ }), !isPending && displayOutput && /* @__PURE__ */ jsx("div", {
326
+ className: `mt-1 max-h-[160px] overflow-hidden whitespace-pre-line ${hasError ? "text-red-600 dark:text-red-400" : "text-muted-foreground"}`,
327
+ children: displayOutput
328
+ })]
329
+ }),
330
+ approval && /* @__PURE__ */ jsx(ToolApprovalFooter, {
331
+ isPending,
332
+ ...approval
333
+ })
334
+ ]
335
+ });
336
+ }
337
+ var cellCounterByToolCallId = /* @__PURE__ */ new Map();
338
+ var lastCellIndex = 0;
339
+ function nextCellIndex(toolCallId) {
340
+ if (!toolCallId) return ++lastCellIndex;
341
+ const existing = cellCounterByToolCallId.get(toolCallId);
342
+ if (existing) return existing;
343
+ const next = ++lastCellIndex;
344
+ cellCounterByToolCallId.set(toolCallId, next);
345
+ return next;
346
+ }
347
+ var IpythonTool = memo(function IpythonTool2({ part }) {
348
+ const approval = part.input?.approval ?? part.args?.approval;
349
+ const { step, stepState } = adaptToolPart(part, "IPython");
350
+ const cellIndex = nextCellIndex(part.toolCallId);
351
+ const noop = () => {
352
+ };
353
+ return /* @__PURE__ */ jsx(IpythonCellCard, {
354
+ step,
355
+ state: stepState,
356
+ onComplete: noop,
357
+ approval,
358
+ cellIndex,
359
+ part
360
+ });
361
+ });
362
+
363
+ export {
364
+ CodeXml,
365
+ ToolTextShimmer,
366
+ useToolComplete,
367
+ adaptToolPart,
368
+ ToolApprovalFooter,
369
+ IpythonTool
370
+ };
371
+ /**
372
+ * @license lucide-react v1.33.0 - ISC
373
+ *
374
+ * This source code is licensed under the ISC license.
375
+ * See the LICENSE file in the root directory of this source tree.
376
+ */
@@ -8,8 +8,8 @@ import {
8
8
  __exportAll
9
9
  } from "./chunk-L547YHC4.js";
10
10
 
11
- // web/app/dist/server/assets/markdown-Ct_q4D-z.js
12
- import { Suspense, lazy } from "react";
11
+ // web/app/dist/server/assets/markdown-Boni3lHk.js
12
+ import { Fragment, Suspense, isValidElement, lazy } from "react";
13
13
  import { jsx } from "react/jsx-runtime";
14
14
  var markdown_exports = /* @__PURE__ */ __exportAll({
15
15
  Markdown: () => Markdown,
@@ -18,7 +18,7 @@ var markdown_exports = /* @__PURE__ */ __exportAll({
18
18
  markdownComponents: () => markdownComponents,
19
19
  normalizeCodeFenceLanguages: () => normalizeCodeFenceLanguages
20
20
  });
21
- var LazyHighlightedMarkdown = lazy(() => import("./markdown-code-C_ih1bX1-5CIWT3CH.js").then(({ HighlightedMarkdown }) => ({ default: HighlightedMarkdown })));
21
+ var LazyHighlightedMarkdown = lazy(() => import("./markdown-code-BrWukbg3-D2GN4Y77.js").then(({ HighlightedMarkdown }) => ({ default: HighlightedMarkdown })));
22
22
  function fixNumberedListBreaks(text) {
23
23
  return text.replace(/^(\d+)\.\s*\n+\s*\n*/gm, "$1. ");
24
24
  }
@@ -48,6 +48,16 @@ function normalizeCodeFenceLanguages(text) {
48
48
  });
49
49
  }
50
50
  var SAFE_HREF_PATTERN = /^(https?:|mailto:)/i;
51
+ function containsBlockMarkdownChild(value, imageIsSoleChild) {
52
+ if (!isValidElement(value)) return false;
53
+ const props = value.props;
54
+ if (typeof props !== "object" || props === null) return false;
55
+ const node = "node" in props ? props.node : void 0;
56
+ const tagName = typeof node === "object" && node !== null && "tagName" in node ? node.tagName : void 0;
57
+ if (tagName === "img") return imageIsSoleChild;
58
+ if (tagName === "code" && "data-block" in props) return true;
59
+ return "children" in props && containsBlockMarkdownChild(props.children, imageIsSoleChild);
60
+ }
51
61
  var markdownComponents = {
52
62
  h1: ({ children, ...props }) => /* @__PURE__ */ jsx("h1", {
53
63
  className: "an-md-h1 mt-3 mb-1.5 text-base font-semibold",
@@ -69,11 +79,15 @@ var markdownComponents = {
69
79
  ...props,
70
80
  children
71
81
  }),
72
- p: ({ children, ...props }) => /* @__PURE__ */ jsx("p", {
73
- className: "an-md-p text-sm leading-relaxed text-an-foreground/80",
74
- ...props,
75
- children
76
- }),
82
+ p: ({ children, node, ...props }) => {
83
+ const child = (Array.isArray(children) ? children : [children]).filter((value) => value != null && value !== "");
84
+ if (child.some((value) => containsBlockMarkdownChild(value, child.length === 1))) return /* @__PURE__ */ jsx(Fragment, { children });
85
+ return /* @__PURE__ */ jsx("p", {
86
+ className: "an-md-p text-sm leading-relaxed text-an-foreground/80",
87
+ ...props,
88
+ children
89
+ });
90
+ },
77
91
  ul: ({ children, ...props }) => /* @__PURE__ */ jsx("ul", {
78
92
  className: "an-md-ul mb-2 flex list-outside list-disc flex-col gap-0.5 pl-4 text-sm text-an-foreground/80",
79
93
  ...props,
@@ -0,0 +1,52 @@
1
+ // web/app/dist/server/assets/openui-utils-B007ClQb.js
2
+ var OPENUI_FENCE_PATTERN = /```(?:openui|openui-lang)(?:[ \t]*\r?\n|[ \t]+)([\s\S]*?)```/gi;
3
+ function appendSegment(segments, ordinals, type, content) {
4
+ const ordinal = ordinals[type];
5
+ ordinals[type] += 1;
6
+ segments.push({
7
+ content,
8
+ id: `${type}-${ordinal}`,
9
+ type
10
+ });
11
+ }
12
+ function stripOpenUIWrapper(content) {
13
+ const cleaned = content.trim();
14
+ const fences = Array.from(cleaned.matchAll(OPENUI_FENCE_PATTERN));
15
+ const onlyFence = fences[0];
16
+ if (fences.length === 1 && onlyFence?.index === 0 && onlyFence[0].length === cleaned.length) return onlyFence[1].trim();
17
+ return cleaned;
18
+ }
19
+ function isOpenUIProgram(content) {
20
+ return stripOpenUIWrapper(content).startsWith("root =");
21
+ }
22
+ function segmentOpenUIContent(content) {
23
+ const segments = [];
24
+ const ordinals = {
25
+ markdown: 0,
26
+ openui: 0
27
+ };
28
+ const stripped = stripOpenUIWrapper(content);
29
+ if (stripped.startsWith("root =")) {
30
+ appendSegment(segments, ordinals, "openui", stripped);
31
+ return segments;
32
+ }
33
+ let lastIndex = 0;
34
+ for (const match of content.matchAll(OPENUI_FENCE_PATTERN)) {
35
+ const index = match.index;
36
+ const markdown = content.slice(lastIndex, index);
37
+ if (markdown.trim()) appendSegment(segments, ordinals, "markdown", markdown);
38
+ const openUI = match[1].trim();
39
+ const isOpenUI = isOpenUIProgram(openUI);
40
+ appendSegment(segments, ordinals, isOpenUI ? "openui" : "markdown", isOpenUI ? openUI : match[0]);
41
+ lastIndex = index + match[0].length;
42
+ }
43
+ const trailingMarkdown = content.slice(lastIndex);
44
+ if (trailingMarkdown.trim()) appendSegment(segments, ordinals, "markdown", trailingMarkdown);
45
+ if (segments.length > 0) return segments;
46
+ appendSegment(segments, ordinals, "markdown", content);
47
+ return segments;
48
+ }
49
+
50
+ export {
51
+ segmentOpenUIContent
52
+ };
@@ -0,0 +1,67 @@
1
+ // web/app/dist/server/assets/workspace-path-nav-HpRcJQjc.js
2
+ var WORKSPACE_ROOT = "agent-workspace";
3
+ function collapseWorkspaceSegments(path) {
4
+ const stack = [];
5
+ for (const segment of path.split("/")) {
6
+ if (!segment || segment === ".") continue;
7
+ if (segment === "..") {
8
+ stack.pop();
9
+ continue;
10
+ }
11
+ stack.push(segment);
12
+ }
13
+ return stack.join("/");
14
+ }
15
+ function isPathWithinScope(path, scopePath) {
16
+ if (!scopePath) return true;
17
+ return path === scopePath || path.startsWith(`${scopePath}/`);
18
+ }
19
+ function stripSandboxPrefixes(filePath) {
20
+ for (const prefix of [
21
+ "/project/sandbox/repo/",
22
+ "/project/sandbox/",
23
+ "/project/",
24
+ "/workspace/"
25
+ ]) if (filePath.startsWith(prefix)) return filePath.slice(prefix.length);
26
+ const markerIndex = filePath.indexOf(".21st/worktrees/");
27
+ if (markerIndex !== -1) {
28
+ const segments = filePath.slice(markerIndex + 16).split("/");
29
+ if (segments.length >= 3 && segments[0] && segments[1]) return segments.slice(2).join("/");
30
+ }
31
+ return filePath;
32
+ }
33
+ function findWorkspaceRootIndex(segments) {
34
+ return segments.indexOf(WORKSPACE_ROOT);
35
+ }
36
+ function normalizeWorkspaceFilePath(raw) {
37
+ const trimmed = raw.trim();
38
+ if (!trimmed) return null;
39
+ const normalized = stripSandboxPrefixes(trimmed).replace(/\\/g, "/").replace(/\/+/g, "/");
40
+ if (normalized.startsWith(`${WORKSPACE_ROOT}/`)) {
41
+ const collapsed = collapseWorkspaceSegments(normalized);
42
+ return collapsed.startsWith(`${WORKSPACE_ROOT}/`) ? collapsed : null;
43
+ }
44
+ if (normalized === WORKSPACE_ROOT) return null;
45
+ if (normalized.startsWith("artifacts/")) return `${WORKSPACE_ROOT}/${normalized}`;
46
+ if (normalized.startsWith("/")) {
47
+ const segments = normalized.split("/").filter(Boolean);
48
+ const rootIndex = findWorkspaceRootIndex(segments);
49
+ if (rootIndex >= 0) return segments.slice(rootIndex).join("/");
50
+ return null;
51
+ }
52
+ return null;
53
+ }
54
+ function resolveWorkspacePanelTarget(rawPath) {
55
+ const path = normalizeWorkspaceFilePath(rawPath);
56
+ if (!path) return null;
57
+ return {
58
+ panel: "workspace",
59
+ path
60
+ };
61
+ }
62
+
63
+ export {
64
+ isPathWithinScope,
65
+ stripSandboxPrefixes,
66
+ resolveWorkspacePanelTarget
67
+ };