@qredence/fleet 0.7.4 → 0.8.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/CHANGELOG.md +17 -0
- package/README.md +5 -4
- package/bin/fleet-prime.mjs +33 -6
- package/bin/prime-runtime.mjs +79 -0
- package/dist/runtime-manifest.json +32 -0
- package/dist/web/client/assets/DialogTitle-RY2UDuCY.js +1 -0
- package/dist/web/client/assets/FloatingPortal-XC0MCNnD.js +1 -0
- package/dist/web/client/assets/action-swap-BWRUNKQA.js +1 -0
- package/dist/web/client/assets/{alert-dialog-DtXvVhsF.js → alert-dialog-DGNvg0B1.js} +1 -1
- package/dist/web/client/assets/arrow-up-right-CG9RNk4p.js +1 -0
- package/dist/web/client/assets/{artifacts-panel-Bseg97yQ.js → artifacts-panel-BGXpKRJ7.js} +1 -1
- package/dist/web/client/assets/{badge-C--lf3bb.js → badge-DM06QVqB.js} +6 -6
- package/dist/web/client/assets/button-CWYjn8Zk.js +1 -0
- package/dist/web/client/assets/{card-Hngi3HGC.js → card-Dj1SnGUU.js} +1 -1
- package/dist/web/client/assets/{chat-command-palette-D_rm1r9d.js → chat-command-palette-PenyaZBw.js} +1 -1
- package/dist/web/client/assets/code-block-pKKmFZ5w.js +3 -0
- package/dist/web/client/assets/collapsible-Bk6zCsRX.js +1 -0
- package/dist/web/client/assets/{command-CmtCIDdH.js → command-imgUMV3r.js} +1 -1
- package/dist/web/client/assets/{create-project-dialog-m-9aoobN.js → create-project-dialog-C00d5yCq.js} +1 -1
- package/dist/web/client/assets/createBaseUIEventDetails-DIxvaz-Y.js +1 -0
- package/dist/web/client/assets/{dialog-Ddouieuu.js → dialog-zCNOQI63.js} +1 -1
- package/dist/web/client/assets/eye-iNSvs0UA.js +1 -0
- package/dist/web/client/assets/file-code-corner-BkDULqko.js +1 -0
- package/dist/web/client/assets/{fork-picker-dialog-DfGlB17w.js → fork-picker-dialog-Cgi48NnT.js} +1 -1
- package/dist/web/client/assets/globals-BuMuB_ea.css +2 -0
- package/dist/web/client/assets/{index-Bz5W4EOn.js → index-BqBdQGWs.js} +3 -3
- package/dist/web/client/assets/input-7g8_nw-Z.js +1 -0
- package/dist/web/client/assets/{input-group-EPMGh55u.js → input-group-Nq03Qums.js} +1 -1
- package/dist/web/client/assets/{ipython-tool-CMhnRVrC.js → ipython-tool-bieUhw9K.js} +1 -1
- package/dist/web/client/assets/markdown-CvBfbPCn.js +2 -0
- package/dist/web/client/assets/markdown-code-rFOkzN5N.js +4 -0
- package/dist/web/client/assets/{message-queue-Bg2MiJHM.js → message-queue-sSljtjYz.js} +1 -1
- package/dist/web/client/assets/{model-selector-list-BiU_7ivt.js → model-selector-list-Cp687pdm.js} +1 -1
- package/dist/web/client/assets/{notify-DhtmUPfE.js → notify-Cqdu6EV8.js} +1 -1
- package/dist/web/client/assets/{openui-renderer-MIB3JKYa.js → openui-renderer-BdYTcn-_.js} +50 -50
- package/dist/web/client/assets/{prompt-input-Dy-DSPqF.js → prompt-input-CoV1gTUQ.js} +1 -1
- package/dist/web/client/assets/{prompt-suggestions-CrpAiKeB.js → prompt-suggestions-CAY5JI-C.js} +1 -1
- package/dist/web/client/assets/provider-label-QrVOwKBO.js +1 -0
- package/dist/web/client/assets/reasoning-line-DGdPUMwT.js +1 -0
- package/dist/web/client/assets/rehype-katex-DITkIpVl.js +259 -0
- package/dist/web/client/assets/{repl-panel-DN5kZAcB.js → repl-panel-5xgkDXO5.js} +1 -1
- package/dist/web/client/assets/{resources-panel-DD6iWOF3.js → resources-panel-aJCKt9eF.js} +1 -1
- package/dist/web/client/assets/right-panel-registry-BaLZiKny.js +2 -0
- package/dist/web/client/assets/routes-BkFkhfO3.js +16 -0
- package/dist/web/client/assets/select-BhV4ikeN.js +1 -0
- package/dist/web/client/assets/session-activity-panel-Bc4-HSfb.js +1 -0
- package/dist/web/client/assets/session-reasoning-panel-CjJJK_bq.js +1 -0
- package/dist/web/client/assets/session-tool-renderer-C7mYeUOs.js +166 -0
- package/dist/web/client/assets/{session-tree-panel-BBwP_EK2.js → session-tree-panel-By9m9tGB.js} +1 -1
- package/dist/web/client/assets/settings-dialog-Dpt4Ha_m.js +2 -0
- package/dist/web/client/assets/shield-check-7HDd-2Fn.js +1 -0
- package/dist/web/client/assets/{skeleton-DNAr5ULI.js → skeleton-B_Lq2XFl.js} +1 -1
- package/dist/web/client/assets/{skeleton-loaders-B28mF4tJ.js → skeleton-loaders-DWc1eDL3.js} +1 -1
- package/dist/web/client/assets/sparkles-BwVa9zQJ.js +1 -0
- package/dist/web/client/assets/{spinner-CSBXk3Lo.js → spinner-B5TaKP7k.js} +1 -1
- package/dist/web/client/assets/{subagent-chat-panel-DhvBO4dQ.js → subagent-chat-panel-DsPmLZSf.js} +1 -1
- package/dist/web/client/assets/subagent-transcript-CNQ9wGk2.js +1 -0
- package/dist/web/client/assets/{subagents-panel-DRo8Xs6j.js → subagents-panel-gQ9BLfV3.js} +1 -1
- package/dist/web/client/assets/surfaces-BUjUJTyD.js +1 -0
- package/dist/web/client/assets/switch-C7Myu-Dt.js +1 -0
- package/dist/web/client/assets/toast-DlbKi6K-.js +1 -0
- package/dist/web/client/assets/tool-output-normalizer-CADgEiI4.js +4 -0
- package/dist/web/client/assets/tool-part-normalizer-CYK62WZM.js +4 -0
- package/dist/web/client/assets/tool-result-bjAGZ2qm.js +5 -0
- package/dist/web/client/assets/tool-timeline-eNqH1zj7.js +2 -0
- package/dist/web/client/assets/trace-IsV5RRvM.js +1 -0
- package/dist/web/client/assets/ui-preferences-B-PNDkyY.js +1 -0
- package/dist/web/client/assets/use-hover-capable-CLq8BADD.js +1 -0
- package/dist/web/client/assets/useBaseUiId-lKfDDIcw.js +1 -0
- package/dist/web/client/assets/useButton-CvcmqA2s.js +1 -0
- package/dist/web/client/assets/useRender-Bbk_fl72.js +1 -0
- package/dist/web/client/assets/{utils-CFDGLzf6.js → utils-oBThwhjm.js} +1 -1
- package/dist/web/client/assets/{workspace-panel-DdZutYnd.js → workspace-panel-Da5I4p_t.js} +1 -1
- package/dist/web/client/assets/workspace-path-nav-D-77sJ_A.js +2 -0
- package/dist/web/client/assets/wrench-BXX_Ah2s.js +1 -0
- package/dist/web/client/bundle-budget.json +6 -6
- package/dist/web/server/{_tanstack-start-manifest_v-YlngJGUa-YTWBGR7L.js → _tanstack-start-manifest_v-BiNPG4xt-BZTMSM2I.js} +33 -28
- package/dist/web/server/{artifacts-panel-COSC8o7j-GKW2HH2G.js → artifacts-panel-CqGBNU4q-UHNMC7PK.js} +23 -27
- package/dist/web/server/{chat-command-palette-CuOWdzkk-PKZQ5EZP.js → chat-command-palette-B94-zIEz-ES2ZB4ZF.js} +8 -10
- package/dist/web/server/{chunk-GLSR4ZI2.js → chunk-2FHYWKDN.js} +669 -833
- package/dist/web/server/{chunk-EBC7QORX.js → chunk-5GUEYYYO.js} +3680 -2098
- package/dist/web/server/{chunk-GLH2GWMG.js → chunk-7L5PCCYR.js} +411 -306
- package/dist/web/server/{chunk-KHHXJZK7.js → chunk-ABMGW6QH.js} +2784 -1662
- package/dist/web/server/{chunk-36CAMOVG.js → chunk-BAHZXA4D.js} +6 -6
- package/dist/web/server/{chunk-IN2ATSEG.js → chunk-CZLGB3NE.js} +2 -2
- package/dist/web/server/{chunk-WCKKN5BR.js → chunk-E6T36NM5.js} +347 -583
- package/dist/web/server/{chunk-ORCOCCER.js → chunk-EAKPTSWR.js} +4 -4
- package/dist/web/server/chunk-EL2JCDAM.js +270 -0
- package/dist/web/server/{chunk-6GTTTYSE.js → chunk-FB2QLQTN.js} +67 -73
- package/dist/web/server/{chunk-LLO4MNGE.js → chunk-K67IDUAI.js} +24 -26
- package/dist/web/server/{chunk-YU6RHHK6.js → chunk-LQM6QR7S.js} +10 -12
- package/dist/web/server/chunk-LTTBT3J7.js +129 -0
- package/dist/web/server/{chunk-TMQ3MT3D.js → chunk-OAYEN3JV.js} +2 -0
- package/dist/web/server/{chunk-ZUZPJNLY.js → chunk-OSPDNT7S.js} +829 -642
- package/dist/web/server/{chunk-XA7EOCHM.js → chunk-SGAQVAYL.js} +2 -2
- package/dist/web/server/chunk-SI5IQSG4.js +206 -0
- package/dist/web/server/{chunk-AKSDWYJY.js → chunk-SYS5FDNA.js} +5 -5
- package/dist/web/server/{chunk-QSM3BRMA.js → chunk-WSK55TKE.js} +169 -156
- package/dist/web/server/{chunk-BUKOEXE7.js → chunk-YQO36OP6.js} +2 -2
- package/dist/web/server/{create-project-dialog-0-arQpsX-ZELQKHS5.js → create-project-dialog-CFPX6Ihl-EO4XTINS.js} +12 -14
- package/dist/web/server/{dist-7G2NZPF4.js → dist-GQUZLXN5.js} +2 -2
- package/dist/web/server/{dist-E5637ZAY.js → dist-MN5NWCX6.js} +1 -1
- package/dist/web/server/{fork-picker-dialog-fj9p33Mq-I5SA3GLJ.js → fork-picker-dialog-B2RBFzoZ-R6GXPSPL.js} +6 -8
- package/dist/web/server/{markdown-CShfYRVO-RBTK7TRB.js → markdown-BvCfOB26-VDH4YOQD.js} +9 -6
- package/dist/web/server/{markdown-code-BDV_2b2T-6JYA5FWZ.js → markdown-code-SYc-BQvp-MR4FXT5C.js} +48 -9
- package/dist/web/server/{message-queue-BBC843IU-GY4ZIMM4.js → message-queue-D32rLiJo-HEBRGH5B.js} +6 -8
- package/dist/web/server/{model-selector-list-DE6aLNXt-LJZMCYOI.js → model-selector-list-DKzt_xEN-5ZPU6XDY.js} +8 -10
- package/dist/web/server/{openui-renderer-C3aqSKuS-PWLWJFYO.js → openui-renderer-CeVtOdYl-PY37PCJI.js} +12 -14
- package/dist/web/server/{prompt-suggestions-CpTK_fHV-UKJDTLVM.js → prompt-suggestions-CpTK_fHV-Q4ILLZKC.js} +1 -1
- package/dist/web/server/{rehype-katex-IDPYWU6M.js → rehype-katex-CYHGKI6Q.js} +490 -843
- package/dist/web/server/{repl-panel-1kSS1UGd-U64BPA7X.js → repl-panel-1kSS1UGd-DDM5ADGZ.js} +3 -3
- package/dist/web/server/{resources-panel-DWb0eGKa-K4EM3H7Y.js → resources-panel-S4NHlpz7-NF7WYYSR.js} +7 -9
- package/dist/web/server/{router-DZYr-9uT-AEXHEFXF.js → router-DVKxZik_-254GZAJW.js} +5 -6
- package/dist/web/server/{routes-vYxWRhis-AAZ73SNP.js → routes-BTxAklRp-UM7ZTLLP.js} +50 -30
- package/dist/web/server/server.js +2 -2
- package/dist/web/server/session-activity-panel-Bz2GrdMk-PCOXG46X.js +173 -0
- package/dist/web/server/session-reasoning-panel-CpiTdyQz-O3B5CDKS.js +62 -0
- package/dist/web/server/{session-tool-renderer-Dtt74Mts-7YYNSWRV.js → session-tool-renderer-BZiOxtt1-T3ZGAQKX.js} +10 -13
- package/dist/web/server/{session-tree-panel-HNl6R9VZ-4JUF34M7.js → session-tree-panel-CzkE0RFB-P4KWA7S2.js} +7 -9
- package/dist/web/server/{settings-dialog-DGZBA5Z_-6HYFMPNZ.js → settings-dialog-BUgVNpr1-THSYIOZL.js} +18 -21
- package/dist/web/server/{subagent-chat-panel-DuB4hqUk-LDCAJOCL.js → subagent-chat-panel-mw3kEFfK-CDYX7LST.js} +13 -16
- package/dist/web/server/{subagents-panel-wAvx3-Rs-L6UTDFUX.js → subagents-panel-2ZJfYrXG-NDJKHJHD.js} +15 -18
- package/dist/web/server/{workspace-panel-CPzJZwgv-YS7PTI5C.js → workspace-panel-xznrPDLt-QCJRZOF3.js} +7 -9
- package/package.json +2 -2
- package/dist/web/client/assets/DialogTitle-D-zqaHvF.js +0 -1
- package/dist/web/client/assets/FloatingPortal-73ZRZeD9.js +0 -1
- package/dist/web/client/assets/action-swap-BcFwS6is.js +0 -1
- package/dist/web/client/assets/button-BJZe4vNJ.js +0 -1
- package/dist/web/client/assets/chevron-up-CqeJYyZO.js +0 -1
- package/dist/web/client/assets/collapsible-DauSnbYp.js +0 -1
- package/dist/web/client/assets/createBaseUIEventDetails-DklXWq23.js +0 -1
- package/dist/web/client/assets/eye-Cs0lNChA.js +0 -1
- package/dist/web/client/assets/globals-C961mr-b.css +0 -2
- package/dist/web/client/assets/input-Def1xOZz.js +0 -1
- package/dist/web/client/assets/markdown-Big27m-v.js +0 -2
- package/dist/web/client/assets/markdown-code-7L4RiS50.js +0 -3
- package/dist/web/client/assets/provider-label-B_vy60P0.js +0 -1
- package/dist/web/client/assets/rehype-katex-A4PtQgTX.js +0 -259
- package/dist/web/client/assets/right-panel-registry-hKJN__3l.js +0 -2
- package/dist/web/client/assets/routes-C3h32Lj_.js +0 -16
- package/dist/web/client/assets/select-Buvv1tIo.js +0 -1
- package/dist/web/client/assets/session-reasoning-panel-DmEbXOrR.js +0 -1
- package/dist/web/client/assets/session-tool-renderer-Daol5fJw.js +0 -169
- package/dist/web/client/assets/settings-dialog-DYbx3xuq.js +0 -2
- package/dist/web/client/assets/sparkles-D_ANe-HY.js +0 -1
- package/dist/web/client/assets/subagent-transcript-Bx-rHni-.js +0 -1
- package/dist/web/client/assets/surfaces-B8xTOFeK.js +0 -1
- package/dist/web/client/assets/switch-CDfAwEvs.js +0 -1
- package/dist/web/client/assets/terminal-Ceucj7us.js +0 -1
- package/dist/web/client/assets/toast-9zXN-yVk.js +0 -1
- package/dist/web/client/assets/tool-part-normalizer-NbPs9kd1.js +0 -4
- package/dist/web/client/assets/tool-result-BccnO34D.js +0 -4
- package/dist/web/client/assets/tool-timeline-DlBZyd4j.js +0 -1
- package/dist/web/client/assets/ui-preferences-1YaENqef.js +0 -1
- package/dist/web/client/assets/use-hover-capable-MwFjBLZQ.js +0 -1
- package/dist/web/client/assets/workspace-path-nav-BRwuLsFl.js +0 -2
- package/dist/web/client/assets/wrench-BYnD147U.js +0 -1
- package/dist/web/server/chunk-CHSKEU3V.js +0 -166
- package/dist/web/server/chunk-OO7NBFQQ.js +0 -15
- package/dist/web/server/chunk-OXEAXEWD.js +0 -13
- package/dist/web/server/chunk-SIJVVYQT.js +0 -234
- package/dist/web/server/chunk-UQV2NU63.js +0 -163
- package/dist/web/server/chunk-VUBITQ5X.js +0 -653
- package/dist/web/server/session-reasoning-panel-XXU2yIOW-XXCKHISS.js +0 -192
- package/dist/web/server/tool-timeline-BKWsrZHK-3LGCOTPH.js +0 -12
|
@@ -8,53 +8,75 @@ import {
|
|
|
8
8
|
getToolStatus,
|
|
9
9
|
useElapsedTime,
|
|
10
10
|
useToolComplete
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-CZLGB3NE.js";
|
|
12
12
|
import {
|
|
13
13
|
CodeBlock,
|
|
14
14
|
FileDiff,
|
|
15
15
|
ToolResult,
|
|
16
16
|
ToolResultOutput
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import {
|
|
19
|
-
Collapsible$1,
|
|
20
|
-
CollapsibleContent,
|
|
21
|
-
CollapsibleTrigger
|
|
22
|
-
} from "./chunk-VUBITQ5X.js";
|
|
23
|
-
import {
|
|
24
|
-
isSafeExternalUrl
|
|
25
|
-
} from "./chunk-OXEAXEWD.js";
|
|
17
|
+
} from "./chunk-WSK55TKE.js";
|
|
26
18
|
import {
|
|
27
19
|
ActionSwapRollText,
|
|
28
20
|
AgentDisclosure,
|
|
21
|
+
Collapsible$1,
|
|
22
|
+
CollapsibleContent,
|
|
23
|
+
CollapsibleTrigger,
|
|
29
24
|
EASE_IN_OUT,
|
|
30
25
|
EASE_OUT,
|
|
31
26
|
LazyMarkdown,
|
|
32
27
|
SPRING_LAYOUT,
|
|
33
28
|
SPRING_PRESS,
|
|
34
29
|
SPRING_SWAP,
|
|
30
|
+
Trace,
|
|
31
|
+
TraceCollapsible,
|
|
32
|
+
TraceCollapsibleContent,
|
|
33
|
+
TraceCollapsibleTrigger,
|
|
34
|
+
TraceDescription,
|
|
35
|
+
TraceIcon,
|
|
36
|
+
TraceLine,
|
|
37
|
+
TraceTitle,
|
|
38
|
+
isSafeExternalUrl,
|
|
39
|
+
mono,
|
|
40
|
+
normalizeToolPart$1,
|
|
35
41
|
stripSandboxPrefixes,
|
|
36
|
-
|
|
37
|
-
|
|
42
|
+
toolActionIconForName,
|
|
43
|
+
useHoverCapable,
|
|
44
|
+
useRender
|
|
45
|
+
} from "./chunk-5GUEYYYO.js";
|
|
38
46
|
import {
|
|
39
47
|
AnimatePresence,
|
|
40
48
|
m,
|
|
41
49
|
useReducedMotion
|
|
42
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-OSPDNT7S.js";
|
|
51
|
+
import {
|
|
52
|
+
bundledLanguages,
|
|
53
|
+
createHighlighter,
|
|
54
|
+
createJavaScriptRegexEngine,
|
|
55
|
+
createOnigurumaEngine,
|
|
56
|
+
normalizeTheme,
|
|
57
|
+
toHtml
|
|
58
|
+
} from "./chunk-2UGQEBXG.js";
|
|
59
|
+
import {
|
|
60
|
+
__exportAll,
|
|
61
|
+
mergeProps
|
|
62
|
+
} from "./chunk-2FHYWKDN.js";
|
|
43
63
|
import {
|
|
44
|
-
|
|
45
|
-
} from "./chunk-
|
|
64
|
+
cva
|
|
65
|
+
} from "./chunk-FB3UHLLN.js";
|
|
46
66
|
import {
|
|
47
|
-
|
|
67
|
+
ArrowUpRight,
|
|
48
68
|
Check,
|
|
49
69
|
ChevronDown,
|
|
50
70
|
ChevronRight,
|
|
51
71
|
ChevronUp,
|
|
52
72
|
ChevronsDown,
|
|
53
73
|
ChevronsUp,
|
|
74
|
+
Circle,
|
|
54
75
|
CircleAlert,
|
|
76
|
+
CircleCheck,
|
|
77
|
+
CircleDot,
|
|
55
78
|
CircleX,
|
|
56
79
|
Earth,
|
|
57
|
-
ExternalLink,
|
|
58
80
|
Eye,
|
|
59
81
|
FileCodeCorner,
|
|
60
82
|
FilePlus,
|
|
@@ -67,28 +89,18 @@ import {
|
|
|
67
89
|
LogOut,
|
|
68
90
|
MessageCircleQuestionMark,
|
|
69
91
|
RotateCcw,
|
|
92
|
+
Route,
|
|
70
93
|
Search,
|
|
71
94
|
ShieldCheck,
|
|
72
95
|
Sparkles,
|
|
73
96
|
Terminal,
|
|
74
97
|
X
|
|
75
|
-
} from "./chunk-
|
|
76
|
-
import {
|
|
77
|
-
bundledLanguages,
|
|
78
|
-
createHighlighter,
|
|
79
|
-
createJavaScriptRegexEngine,
|
|
80
|
-
createOnigurumaEngine,
|
|
81
|
-
normalizeTheme,
|
|
82
|
-
toHtml
|
|
83
|
-
} from "./chunk-2UGQEBXG.js";
|
|
84
|
-
import {
|
|
85
|
-
__exportAll
|
|
86
|
-
} from "./chunk-OO7NBFQQ.js";
|
|
98
|
+
} from "./chunk-7L5PCCYR.js";
|
|
87
99
|
import {
|
|
88
100
|
cn
|
|
89
|
-
} from "./chunk-
|
|
101
|
+
} from "./chunk-OAYEN3JV.js";
|
|
90
102
|
|
|
91
|
-
// web/app/dist/server/assets/session-tool-renderer-
|
|
103
|
+
// web/app/dist/server/assets/session-tool-renderer-BZiOxtt1.js
|
|
92
104
|
import React, { memo, useCallback as useCallback4, useEffect as useEffect3, useId, useLayoutEffect as useLayoutEffect2, useMemo as useMemo2, useRef as useRef3, useState as useState4 } from "react";
|
|
93
105
|
import { Fragment as Fragment$1, jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
94
106
|
|
|
@@ -12230,7 +12242,7 @@ function MultiFileDiff({ oldFile, newFile, options, editorOptions, editStateKey,
|
|
|
12230
12242
|
});
|
|
12231
12243
|
}
|
|
12232
12244
|
|
|
12233
|
-
// web/app/dist/server/assets/session-tool-renderer-
|
|
12245
|
+
// web/app/dist/server/assets/session-tool-renderer-BZiOxtt1.js
|
|
12234
12246
|
function getFaviconUrl(value) {
|
|
12235
12247
|
try {
|
|
12236
12248
|
return new URL("/favicon.ico", value).toString();
|
|
@@ -12261,27 +12273,29 @@ function CitationFavicon({ url, className }) {
|
|
|
12261
12273
|
}
|
|
12262
12274
|
function CitationRow({ citation, index, idPrefix }) {
|
|
12263
12275
|
const safeUrl = citation.url && isSafeExternalUrl(citation.url) ? citation.url : void 0;
|
|
12264
|
-
const content = /* @__PURE__ */ jsxs3(
|
|
12265
|
-
|
|
12266
|
-
|
|
12267
|
-
|
|
12268
|
-
|
|
12269
|
-
className: "
|
|
12270
|
-
children: citation.title
|
|
12271
|
-
|
|
12272
|
-
|
|
12276
|
+
const content = /* @__PURE__ */ jsxs3(TraceLine, {
|
|
12277
|
+
className: "w-full max-w-full rounded-md px-1.5 py-1 text-sm group-hover/citation:text-foreground",
|
|
12278
|
+
children: [
|
|
12279
|
+
/* @__PURE__ */ jsx7(TraceIcon, { children: /* @__PURE__ */ jsx7(CitationFavicon, { url: citation.url }) }),
|
|
12280
|
+
/* @__PURE__ */ jsxs3(TraceTitle, {
|
|
12281
|
+
className: "font-medium text-foreground/80 transition-colors group-hover/citation:text-foreground",
|
|
12282
|
+
children: [citation.title, safeUrl ? /* @__PURE__ */ jsx7("span", {
|
|
12283
|
+
className: "sr-only",
|
|
12284
|
+
children: " (opens in a new tab)"
|
|
12285
|
+
}) : null]
|
|
12286
|
+
}),
|
|
12287
|
+
citation.domain ? /* @__PURE__ */ jsx7(TraceDescription, {
|
|
12288
|
+
className: "max-w-40 truncate",
|
|
12273
12289
|
children: citation.domain
|
|
12274
|
-
}) : null
|
|
12275
|
-
|
|
12276
|
-
|
|
12277
|
-
className: "flex shrink-0 items-center gap-1.5",
|
|
12278
|
-
children: [/* @__PURE__ */ jsx7("span", {
|
|
12279
|
-
className: "grid size-5 place-items-center rounded-md bg-foreground/[0.05] text-micro font-semibold tabular-nums text-muted-foreground",
|
|
12290
|
+
}) : null,
|
|
12291
|
+
/* @__PURE__ */ jsx7(TraceDescription, {
|
|
12292
|
+
className: "rounded-md bg-foreground/[0.05] px-1.5 py-0.5 text-micro font-semibold",
|
|
12280
12293
|
children: index
|
|
12281
|
-
}),
|
|
12282
|
-
|
|
12283
|
-
|
|
12284
|
-
|
|
12294
|
+
}),
|
|
12295
|
+
safeUrl ? /* @__PURE__ */ jsx7(TraceIcon, { children: /* @__PURE__ */ jsx7(ArrowUpRight, {}) }) : null
|
|
12296
|
+
]
|
|
12297
|
+
});
|
|
12298
|
+
const className = "group/citation block rounded-md outline-none focus-visible:ring-2 focus-visible:ring-ring";
|
|
12285
12299
|
const id = citationTargetId(idPrefix, citation.id);
|
|
12286
12300
|
return safeUrl ? /* @__PURE__ */ jsx7("a", {
|
|
12287
12301
|
id,
|
|
@@ -12300,8 +12314,8 @@ function CitationList({ citations, idPrefix, className }) {
|
|
|
12300
12314
|
const reduce = useReducedMotion() ?? false;
|
|
12301
12315
|
const baseId = useId();
|
|
12302
12316
|
const resolvedPrefix = idPrefix ?? `citation-list-${baseId.replace(/:/g, "")}`;
|
|
12303
|
-
return /* @__PURE__ */ jsx7(
|
|
12304
|
-
className: cn("
|
|
12317
|
+
return /* @__PURE__ */ jsx7(Trace, {
|
|
12318
|
+
className: cn("gap-0.5", className),
|
|
12305
12319
|
children: /* @__PURE__ */ jsx7(AnimatePresence, {
|
|
12306
12320
|
mode: "popLayout",
|
|
12307
12321
|
children: citations.map((citation, index) => /* @__PURE__ */ jsx7(m.div, {
|
|
@@ -12336,9 +12350,7 @@ function CitationList({ citations, idPrefix, className }) {
|
|
|
12336
12350
|
});
|
|
12337
12351
|
}
|
|
12338
12352
|
function Citations({ citations, title = "Sources", open, defaultOpen = false, onOpenChange, idPrefix, className }) {
|
|
12339
|
-
const reduce = useReducedMotion() ?? false;
|
|
12340
12353
|
const baseId = useId();
|
|
12341
|
-
const contentId = `${baseId}-content`;
|
|
12342
12354
|
const resolvedPrefix = idPrefix ?? `citation-${baseId.replace(/:/g, "")}`;
|
|
12343
12355
|
const [internalOpen, setInternalOpen] = useState4(defaultOpen);
|
|
12344
12356
|
const currentOpen = open ?? internalOpen;
|
|
@@ -12346,41 +12358,25 @@ function Citations({ citations, title = "Sources", open, defaultOpen = false, on
|
|
|
12346
12358
|
if (open === void 0) setInternalOpen(next);
|
|
12347
12359
|
onOpenChange?.(next);
|
|
12348
12360
|
}, [onOpenChange, open]);
|
|
12349
|
-
return /* @__PURE__ */
|
|
12350
|
-
className: cn("
|
|
12351
|
-
|
|
12352
|
-
|
|
12353
|
-
"aria-expanded": currentOpen,
|
|
12354
|
-
"aria-controls": contentId,
|
|
12355
|
-
onClick: () => setOpen(!currentOpen),
|
|
12356
|
-
className: "group -ml-1 flex min-h-8 items-center gap-2 rounded-lg px-1 text-left text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",
|
|
12357
|
-
children: [
|
|
12358
|
-
/* @__PURE__ */ jsx7(BookOpenText, { className: "size-4" }),
|
|
12359
|
-
/* @__PURE__ */ jsx7("span", {
|
|
12360
|
-
className: "font-medium",
|
|
12361
|
-
children: title
|
|
12362
|
-
}),
|
|
12363
|
-
/* @__PURE__ */ jsx7("span", {
|
|
12364
|
-
className: "rounded-full bg-muted px-1.5 py-0.5 text-micro font-semibold tabular-nums",
|
|
12365
|
-
children: citations.length
|
|
12366
|
-
}),
|
|
12367
|
-
/* @__PURE__ */ jsx7(m.span, {
|
|
12368
|
-
"aria-hidden": "true",
|
|
12369
|
-
animate: { rotate: currentOpen ? 180 : 0 },
|
|
12370
|
-
transition: reduce ? { duration: 0 } : SPRING_SWAP,
|
|
12371
|
-
className: "text-muted-foreground/60",
|
|
12372
|
-
children: /* @__PURE__ */ jsx7(ChevronDown, { className: "size-3.5" })
|
|
12373
|
-
})
|
|
12374
|
-
]
|
|
12375
|
-
}), /* @__PURE__ */ jsx7(AgentDisclosure, {
|
|
12376
|
-
id: contentId,
|
|
12361
|
+
return /* @__PURE__ */ jsx7(Trace, {
|
|
12362
|
+
className: cn("text-sm", className),
|
|
12363
|
+
"data-testid": "sources-trace",
|
|
12364
|
+
children: /* @__PURE__ */ jsxs3(TraceCollapsible, {
|
|
12377
12365
|
open: currentOpen,
|
|
12378
|
-
|
|
12366
|
+
onOpenChange: setOpen,
|
|
12367
|
+
children: [/* @__PURE__ */ jsx7(TraceCollapsibleTrigger, {
|
|
12368
|
+
"aria-label": `${typeof title === "string" || typeof title === "number" ? title : "Sources"} ${citations.length}`,
|
|
12369
|
+
children: /* @__PURE__ */ jsxs3(TraceLine, { children: [/* @__PURE__ */ jsx7(TraceIcon, { children: /* @__PURE__ */ jsx7(Earth, {}) }), /* @__PURE__ */ jsxs3(TraceTitle, { children: [
|
|
12370
|
+
title,
|
|
12371
|
+
" (",
|
|
12372
|
+
citations.length,
|
|
12373
|
+
")"
|
|
12374
|
+
] })] })
|
|
12375
|
+
}), /* @__PURE__ */ jsx7(TraceCollapsibleContent, { children: /* @__PURE__ */ jsx7(CitationList, {
|
|
12379
12376
|
citations,
|
|
12380
|
-
idPrefix: resolvedPrefix
|
|
12381
|
-
|
|
12382
|
-
|
|
12383
|
-
})]
|
|
12377
|
+
idPrefix: resolvedPrefix
|
|
12378
|
+
}) })]
|
|
12379
|
+
})
|
|
12384
12380
|
});
|
|
12385
12381
|
}
|
|
12386
12382
|
var STATUS_TEXT = {
|
|
@@ -12690,54 +12686,45 @@ function AgentPlan({ steps, activeIndex, className, ...props }) {
|
|
|
12690
12686
|
const total = steps.length;
|
|
12691
12687
|
const completed = !(total > 0) ? 0 : Math.floor(clamp(activeIndex, 0, total));
|
|
12692
12688
|
const allDone = completed >= total;
|
|
12693
|
-
const
|
|
12694
|
-
|
|
12695
|
-
|
|
12696
|
-
|
|
12689
|
+
const occurrences = /* @__PURE__ */ new Map();
|
|
12690
|
+
const stepKeys = steps.map((step) => {
|
|
12691
|
+
const occurrence = occurrences.get(step) ?? 0;
|
|
12692
|
+
occurrences.set(step, occurrence + 1);
|
|
12693
|
+
return `${step}:${occurrence}`;
|
|
12694
|
+
});
|
|
12695
|
+
return /* @__PURE__ */ jsx7(Trace, {
|
|
12696
|
+
"data-testid": "plan-trace",
|
|
12697
|
+
className: cn("max-w-sm", className),
|
|
12697
12698
|
...props,
|
|
12698
|
-
children:
|
|
12699
|
-
|
|
12700
|
-
|
|
12701
|
-
|
|
12702
|
-
|
|
12703
|
-
|
|
12704
|
-
}), /* @__PURE__ */ jsxs3("span", {
|
|
12705
|
-
className: cn(mono, "text-foreground/35 tabular-nums"),
|
|
12699
|
+
children: /* @__PURE__ */ jsxs3(TraceCollapsible, {
|
|
12700
|
+
defaultOpen: true,
|
|
12701
|
+
children: [/* @__PURE__ */ jsx7(TraceCollapsibleTrigger, {
|
|
12702
|
+
"aria-label": props["aria-label"] ?? `Plan: ${completed} of ${total} done`,
|
|
12703
|
+
children: /* @__PURE__ */ jsxs3(TraceLine, {
|
|
12704
|
+
status: allDone ? void 0 : "running",
|
|
12706
12705
|
children: [
|
|
12707
|
-
|
|
12708
|
-
|
|
12709
|
-
|
|
12706
|
+
/* @__PURE__ */ jsx7(TraceIcon, { children: /* @__PURE__ */ jsx7(Route, {}) }),
|
|
12707
|
+
/* @__PURE__ */ jsx7(TraceTitle, { children: "Plan" }),
|
|
12708
|
+
/* @__PURE__ */ jsx7(TraceDescription, {
|
|
12709
|
+
className: cn(mono, "text-xs"),
|
|
12710
|
+
children: `${completed} of ${total} done`
|
|
12711
|
+
})
|
|
12710
12712
|
]
|
|
12711
|
-
})]
|
|
12712
|
-
}),
|
|
12713
|
-
/* @__PURE__ */ jsx7("div", {
|
|
12714
|
-
className: "bg-foreground/[0.06] h-[3px] w-full overflow-hidden rounded-full",
|
|
12715
|
-
children: /* @__PURE__ */ jsx7("span", {
|
|
12716
|
-
className: "bg-foreground/80 block h-full rounded-full transition-[width] duration-500",
|
|
12717
|
-
style: { width: `${progress}%` }
|
|
12718
12713
|
})
|
|
12719
|
-
}),
|
|
12720
|
-
|
|
12721
|
-
|
|
12714
|
+
}), /* @__PURE__ */ jsx7(TraceCollapsibleContent, { children: /* @__PURE__ */ jsx7(Trace, {
|
|
12715
|
+
className: "gap-1",
|
|
12716
|
+
"data-slot": "plan-content",
|
|
12722
12717
|
children: steps.map((step, i) => {
|
|
12723
12718
|
const done = allDone || i < completed;
|
|
12724
12719
|
const active = !allDone && i === completed;
|
|
12725
|
-
return /* @__PURE__ */ jsxs3(
|
|
12726
|
-
|
|
12727
|
-
|
|
12728
|
-
|
|
12729
|
-
|
|
12730
|
-
"aria-hidden": true,
|
|
12731
|
-
className: "bg-foreground/15 size-1.5 rounded-full"
|
|
12732
|
-
})
|
|
12733
|
-
}), /* @__PURE__ */ jsx7("span", {
|
|
12734
|
-
className: cn(done && "text-foreground/40", active && "text-foreground/90", !done && !active && "text-foreground/35"),
|
|
12735
|
-
children: step
|
|
12736
|
-
})]
|
|
12737
|
-
}, step);
|
|
12720
|
+
return /* @__PURE__ */ jsxs3(TraceLine, {
|
|
12721
|
+
"data-plan-step": true,
|
|
12722
|
+
status: active ? "running" : !done ? "pending" : void 0,
|
|
12723
|
+
children: [/* @__PURE__ */ jsx7(TraceIcon, { children: /* @__PURE__ */ jsx7(done ? CircleCheck : active ? CircleDot : Circle, {}) }), /* @__PURE__ */ jsx7(TraceTitle, { children: step })]
|
|
12724
|
+
}, stepKeys[i]);
|
|
12738
12725
|
})
|
|
12739
|
-
})
|
|
12740
|
-
|
|
12726
|
+
}) })]
|
|
12727
|
+
})
|
|
12741
12728
|
});
|
|
12742
12729
|
}
|
|
12743
12730
|
function sessionAgentPlanPresentation(items) {
|
|
@@ -13083,6 +13070,75 @@ function TodoList({ items, title = "To-dos", open, defaultOpen = true, onOpenCha
|
|
|
13083
13070
|
})]
|
|
13084
13071
|
});
|
|
13085
13072
|
}
|
|
13073
|
+
var itemVariants = cva("group/item flex w-full flex-wrap items-center rounded-lg border text-sm transition-colors duration-100 outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50", {
|
|
13074
|
+
variants: {
|
|
13075
|
+
variant: {
|
|
13076
|
+
default: "border-transparent",
|
|
13077
|
+
outline: "border-border",
|
|
13078
|
+
muted: "border-transparent bg-muted/50"
|
|
13079
|
+
},
|
|
13080
|
+
size: {
|
|
13081
|
+
default: "gap-2.5 px-3 py-2.5",
|
|
13082
|
+
sm: "gap-2.5 px-3 py-2.5",
|
|
13083
|
+
xs: "gap-2 px-2.5 py-2"
|
|
13084
|
+
}
|
|
13085
|
+
},
|
|
13086
|
+
defaultVariants: {
|
|
13087
|
+
variant: "default",
|
|
13088
|
+
size: "default"
|
|
13089
|
+
}
|
|
13090
|
+
});
|
|
13091
|
+
function Item({ className, variant = "default", size = "default", render: render2, ...props }) {
|
|
13092
|
+
return useRender({
|
|
13093
|
+
defaultTagName: "div",
|
|
13094
|
+
props: mergeProps({ className: cn(itemVariants({
|
|
13095
|
+
variant,
|
|
13096
|
+
size,
|
|
13097
|
+
className
|
|
13098
|
+
})) }, props),
|
|
13099
|
+
render: render2,
|
|
13100
|
+
state: {
|
|
13101
|
+
slot: "item",
|
|
13102
|
+
variant,
|
|
13103
|
+
size
|
|
13104
|
+
}
|
|
13105
|
+
});
|
|
13106
|
+
}
|
|
13107
|
+
function ItemMedia({ className, ...props }) {
|
|
13108
|
+
return /* @__PURE__ */ jsx7("div", {
|
|
13109
|
+
"data-slot": "item-media",
|
|
13110
|
+
className: cn("flex shrink-0 items-center justify-center [&_svg]:size-4", className),
|
|
13111
|
+
...props
|
|
13112
|
+
});
|
|
13113
|
+
}
|
|
13114
|
+
function ItemContent({ className, ...props }) {
|
|
13115
|
+
return /* @__PURE__ */ jsx7("div", {
|
|
13116
|
+
"data-slot": "item-content",
|
|
13117
|
+
className: cn("flex min-w-0 flex-1 flex-col gap-1", className),
|
|
13118
|
+
...props
|
|
13119
|
+
});
|
|
13120
|
+
}
|
|
13121
|
+
function ItemTitle({ className, ...props }) {
|
|
13122
|
+
return /* @__PURE__ */ jsx7("div", {
|
|
13123
|
+
"data-slot": "item-title",
|
|
13124
|
+
className: cn("text-sm font-medium leading-snug", className),
|
|
13125
|
+
...props
|
|
13126
|
+
});
|
|
13127
|
+
}
|
|
13128
|
+
function ItemDescription({ className, ...props }) {
|
|
13129
|
+
return /* @__PURE__ */ jsx7("p", {
|
|
13130
|
+
"data-slot": "item-description",
|
|
13131
|
+
className: cn("text-sm leading-normal text-muted-foreground", className),
|
|
13132
|
+
...props
|
|
13133
|
+
});
|
|
13134
|
+
}
|
|
13135
|
+
function ItemActions({ className, ...props }) {
|
|
13136
|
+
return /* @__PURE__ */ jsx7("div", {
|
|
13137
|
+
"data-slot": "item-actions",
|
|
13138
|
+
className: cn("flex items-center gap-2", className),
|
|
13139
|
+
...props
|
|
13140
|
+
});
|
|
13141
|
+
}
|
|
13086
13142
|
function getStatusCopy(status) {
|
|
13087
13143
|
if (status === "approving") return "Approving";
|
|
13088
13144
|
if (status === "approved") return "Approved";
|
|
@@ -13115,61 +13171,55 @@ function ToolApproval({ tool, title = "Allow this tool to run?", description, pa
|
|
|
13115
13171
|
if (previousStatus.current === "pending" && status !== "pending") setOpen(false);
|
|
13116
13172
|
previousStatus.current = status;
|
|
13117
13173
|
}, [setOpen, status]);
|
|
13118
|
-
return /* @__PURE__ */ jsxs3(
|
|
13174
|
+
return /* @__PURE__ */ jsxs3(Item, {
|
|
13175
|
+
variant: "outline",
|
|
13176
|
+
size: "sm",
|
|
13119
13177
|
"data-state": status,
|
|
13120
13178
|
"aria-busy": busy,
|
|
13121
|
-
className: cn("
|
|
13122
|
-
children: [
|
|
13179
|
+
className: cn("items-start rounded-2xl bg-muted/20 p-4", className),
|
|
13180
|
+
children: [/* @__PURE__ */ jsx7(ItemMedia, {
|
|
13181
|
+
"aria-hidden": "true",
|
|
13182
|
+
className: cn("mt-0.5 grid size-8 place-items-center rounded-xl border border-border/60 bg-background text-muted-foreground", error && "text-destructive"),
|
|
13183
|
+
children: busy ? /* @__PURE__ */ jsx7(LoaderCircle, { className: cn("size-4", !reduce && "animate-spin") }) : error ? /* @__PURE__ */ jsx7(CircleAlert, { className: "size-4" }) : status === "denied" ? /* @__PURE__ */ jsx7(X, { className: "size-4" }) : status === "approved" || status === "complete" ? /* @__PURE__ */ jsx7(Check, { className: "size-4" }) : /* @__PURE__ */ jsx7(ShieldCheck, { className: "size-4" })
|
|
13184
|
+
}), /* @__PURE__ */ jsxs3(ItemContent, { children: [
|
|
13123
13185
|
/* @__PURE__ */ jsxs3("div", {
|
|
13124
|
-
className: "flex items-start gap-3
|
|
13125
|
-
children: [/* @__PURE__ */
|
|
13126
|
-
|
|
13127
|
-
|
|
13128
|
-
|
|
13129
|
-
|
|
13130
|
-
|
|
13131
|
-
|
|
13132
|
-
|
|
13133
|
-
|
|
13134
|
-
|
|
13135
|
-
|
|
13136
|
-
|
|
13137
|
-
className: "font-medium text-foreground",
|
|
13138
|
-
children: title
|
|
13139
|
-
}), /* @__PURE__ */ jsx7("div", {
|
|
13140
|
-
className: "mt-0.5 truncate font-mono text-xs text-muted-foreground",
|
|
13141
|
-
children: tool
|
|
13142
|
-
})]
|
|
13143
|
-
}), /* @__PURE__ */ jsx7("span", {
|
|
13144
|
-
className: cn("shrink-0 rounded-full border px-2 py-0.5 text-caption font-medium transition-colors", getStatusBadgeClass(status)),
|
|
13145
|
-
children: getStatusCopy(status)
|
|
13146
|
-
})]
|
|
13147
|
-
}),
|
|
13148
|
-
description ? /* @__PURE__ */ jsx7("p", {
|
|
13149
|
-
className: "mt-2 leading-5 text-muted-foreground",
|
|
13150
|
-
children: description
|
|
13151
|
-
}) : null,
|
|
13152
|
-
parameters.length ? /* @__PURE__ */ jsxs3("button", {
|
|
13153
|
-
type: "button",
|
|
13154
|
-
"aria-expanded": currentOpen,
|
|
13155
|
-
"aria-controls": detailsId,
|
|
13156
|
-
onClick: () => setOpen(!currentOpen),
|
|
13157
|
-
className: "mt-2 inline-flex items-center gap-1 rounded-md text-xs font-medium text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",
|
|
13158
|
-
children: ["View details", /* @__PURE__ */ jsx7(m.span, {
|
|
13159
|
-
"aria-hidden": "true",
|
|
13160
|
-
animate: { rotate: currentOpen ? 180 : 0 },
|
|
13161
|
-
transition: reduce ? { duration: 0 } : SPRING_SWAP,
|
|
13162
|
-
children: /* @__PURE__ */ jsx7(ChevronDown, { className: "size-3.5" })
|
|
13163
|
-
})]
|
|
13164
|
-
}) : null
|
|
13165
|
-
]
|
|
13186
|
+
className: "flex min-w-0 items-start justify-between gap-3",
|
|
13187
|
+
children: [/* @__PURE__ */ jsxs3("div", {
|
|
13188
|
+
className: "min-w-0",
|
|
13189
|
+
children: [/* @__PURE__ */ jsx7(ItemTitle, {
|
|
13190
|
+
className: "text-foreground",
|
|
13191
|
+
children: title
|
|
13192
|
+
}), /* @__PURE__ */ jsx7("div", {
|
|
13193
|
+
className: "mt-0.5 truncate font-mono text-xs text-muted-foreground",
|
|
13194
|
+
children: tool
|
|
13195
|
+
})]
|
|
13196
|
+
}), /* @__PURE__ */ jsx7("span", {
|
|
13197
|
+
className: cn("shrink-0 rounded-full border px-2 py-0.5 text-caption font-medium transition-colors", getStatusBadgeClass(status)),
|
|
13198
|
+
children: getStatusCopy(status)
|
|
13166
13199
|
})]
|
|
13167
13200
|
}),
|
|
13201
|
+
description ? /* @__PURE__ */ jsx7(ItemDescription, {
|
|
13202
|
+
className: "mt-1 leading-5",
|
|
13203
|
+
children: description
|
|
13204
|
+
}) : null,
|
|
13205
|
+
parameters.length ? /* @__PURE__ */ jsxs3("button", {
|
|
13206
|
+
type: "button",
|
|
13207
|
+
"aria-expanded": currentOpen,
|
|
13208
|
+
"aria-controls": detailsId,
|
|
13209
|
+
onClick: () => setOpen(!currentOpen),
|
|
13210
|
+
className: "mt-2 inline-flex items-center gap-1 rounded-md text-xs font-medium text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",
|
|
13211
|
+
children: ["View details", /* @__PURE__ */ jsx7(m.span, {
|
|
13212
|
+
"aria-hidden": "true",
|
|
13213
|
+
animate: { rotate: currentOpen ? 180 : 0 },
|
|
13214
|
+
transition: reduce ? { duration: 0 } : SPRING_SWAP,
|
|
13215
|
+
children: /* @__PURE__ */ jsx7(ChevronDown, { className: "size-3.5" })
|
|
13216
|
+
})]
|
|
13217
|
+
}) : null,
|
|
13168
13218
|
/* @__PURE__ */ jsx7(AgentDisclosure, {
|
|
13169
13219
|
id: detailsId,
|
|
13170
13220
|
open: currentOpen,
|
|
13171
13221
|
children: /* @__PURE__ */ jsx7("dl", {
|
|
13172
|
-
className: "
|
|
13222
|
+
className: "mt-3 grid gap-2 rounded-xl border border-border/50 bg-background/70 p-3",
|
|
13173
13223
|
children: parameters.map((parameter) => /* @__PURE__ */ jsxs3("div", {
|
|
13174
13224
|
className: "grid grid-cols-[minmax(0,7rem)_minmax(0,1fr)] items-center gap-3 text-xs",
|
|
13175
13225
|
children: [/* @__PURE__ */ jsx7("dt", {
|
|
@@ -13184,7 +13234,7 @@ function ToolApproval({ tool, title = "Allow this tool to run?", description, pa
|
|
|
13184
13234
|
}),
|
|
13185
13235
|
/* @__PURE__ */ jsx7(AnimatePresence, {
|
|
13186
13236
|
initial: false,
|
|
13187
|
-
children: pending ? /* @__PURE__ */
|
|
13237
|
+
children: pending ? /* @__PURE__ */ jsx7(m.div, {
|
|
13188
13238
|
initial: reduce ? { opacity: 0 } : {
|
|
13189
13239
|
opacity: 0,
|
|
13190
13240
|
y: 4
|
|
@@ -13198,356 +13248,39 @@ function ToolApproval({ tool, title = "Allow this tool to run?", description, pa
|
|
|
13198
13248
|
duration: reduce ? 0.12 : 0.22,
|
|
13199
13249
|
ease: EASE_OUT
|
|
13200
13250
|
},
|
|
13201
|
-
className: "
|
|
13202
|
-
children:
|
|
13203
|
-
|
|
13204
|
-
|
|
13205
|
-
|
|
13206
|
-
|
|
13207
|
-
|
|
13208
|
-
|
|
13209
|
-
|
|
13210
|
-
|
|
13211
|
-
|
|
13212
|
-
|
|
13213
|
-
|
|
13214
|
-
|
|
13215
|
-
|
|
13216
|
-
|
|
13217
|
-
|
|
13218
|
-
|
|
13219
|
-
|
|
13220
|
-
|
|
13221
|
-
|
|
13222
|
-
|
|
13223
|
-
|
|
13224
|
-
|
|
13225
|
-
|
|
13251
|
+
className: "mt-2",
|
|
13252
|
+
children: /* @__PURE__ */ jsxs3(ItemActions, {
|
|
13253
|
+
className: "flex-wrap",
|
|
13254
|
+
children: [
|
|
13255
|
+
/* @__PURE__ */ jsx7(m.button, {
|
|
13256
|
+
type: "button",
|
|
13257
|
+
onClick: onApprove,
|
|
13258
|
+
whileTap: reduce ? void 0 : { scale: 0.96 },
|
|
13259
|
+
transition: SPRING_PRESS,
|
|
13260
|
+
className: "rounded-xl bg-foreground px-3 py-1.5 text-xs font-medium text-background outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
13261
|
+
children: "Allow once"
|
|
13262
|
+
}),
|
|
13263
|
+
onAlwaysAllow ? /* @__PURE__ */ jsx7(m.button, {
|
|
13264
|
+
type: "button",
|
|
13265
|
+
onClick: onAlwaysAllow,
|
|
13266
|
+
whileTap: reduce ? void 0 : { scale: 0.96 },
|
|
13267
|
+
transition: SPRING_PRESS,
|
|
13268
|
+
className: "rounded-xl border border-border/60 bg-background px-3 py-1.5 text-xs font-medium text-foreground outline-none transition-colors hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring",
|
|
13269
|
+
children: "Always allow"
|
|
13270
|
+
}) : null,
|
|
13271
|
+
/* @__PURE__ */ jsx7("button", {
|
|
13272
|
+
type: "button",
|
|
13273
|
+
onClick: onDeny,
|
|
13274
|
+
className: "rounded-xl px-3 py-1.5 text-xs font-medium text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",
|
|
13275
|
+
children: "Deny"
|
|
13276
|
+
})
|
|
13277
|
+
]
|
|
13278
|
+
})
|
|
13226
13279
|
}) : null
|
|
13227
13280
|
})
|
|
13228
|
-
]
|
|
13229
|
-
});
|
|
13230
|
-
}
|
|
13231
|
-
function asRecord(value) {
|
|
13232
|
-
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
|
|
13233
|
-
}
|
|
13234
|
-
function parseRecord(value) {
|
|
13235
|
-
const direct = asRecord(value);
|
|
13236
|
-
if (direct) return direct;
|
|
13237
|
-
if (typeof value !== "string") return void 0;
|
|
13238
|
-
try {
|
|
13239
|
-
return asRecord(JSON.parse(value));
|
|
13240
|
-
} catch {
|
|
13241
|
-
return;
|
|
13242
|
-
}
|
|
13243
|
-
}
|
|
13244
|
-
function getString(record, ...keys) {
|
|
13245
|
-
for (const key of keys) {
|
|
13246
|
-
const value = record?.[key];
|
|
13247
|
-
if (typeof value === "string" && value.trim()) return value;
|
|
13248
|
-
}
|
|
13249
|
-
}
|
|
13250
|
-
function getNumber(record, ...keys) {
|
|
13251
|
-
for (const key of keys) {
|
|
13252
|
-
const value = record?.[key];
|
|
13253
|
-
if (typeof value === "number" && Number.isFinite(value)) return value;
|
|
13254
|
-
if (typeof value === "string" && value.trim()) {
|
|
13255
|
-
const parsed = Number(value);
|
|
13256
|
-
if (Number.isFinite(parsed)) return parsed;
|
|
13257
|
-
}
|
|
13258
|
-
}
|
|
13259
|
-
}
|
|
13260
|
-
function getBoolean(record, ...keys) {
|
|
13261
|
-
for (const key of keys) {
|
|
13262
|
-
const value = record?.[key];
|
|
13263
|
-
if (typeof value === "boolean") return value;
|
|
13264
|
-
}
|
|
13265
|
-
}
|
|
13266
|
-
function stringifyToolValue(value) {
|
|
13267
|
-
if (typeof value === "string") return value;
|
|
13268
|
-
if (value === void 0 || value === null) return "";
|
|
13269
|
-
try {
|
|
13270
|
-
return JSON.stringify(value, null, 2);
|
|
13271
|
-
} catch {
|
|
13272
|
-
return String(value);
|
|
13273
|
-
}
|
|
13274
|
-
}
|
|
13275
|
-
function getOutput(part) {
|
|
13276
|
-
if (part.output !== void 0 && part.output !== null) return part.output;
|
|
13277
|
-
return part.result;
|
|
13278
|
-
}
|
|
13279
|
-
function summarizeOutput(output) {
|
|
13280
|
-
const record = parseRecord(output);
|
|
13281
|
-
const details = parseRecord(record?.details);
|
|
13282
|
-
const fields = {
|
|
13283
|
-
...record ?? {},
|
|
13284
|
-
...details ?? {}
|
|
13285
|
-
};
|
|
13286
|
-
const result = fields.result;
|
|
13287
|
-
const stdout = getString(fields, "stdout", "standardOutput", "standard_output");
|
|
13288
|
-
const stderr = getString(fields, "stderr", "standardError", "standard_error");
|
|
13289
|
-
const errorValue = fields.error ?? fields.errorMessage ?? fields.evalue;
|
|
13290
|
-
const error = errorValue === void 0 ? void 0 : stringifyToolValue(errorValue);
|
|
13291
|
-
const durationMs = getNumber(fields, "durationMs", "duration_ms", "duration");
|
|
13292
|
-
const kernelRestarted = getBoolean(fields, "kernelRestarted", "kernel_restarted");
|
|
13293
|
-
const structuredKeys = /* @__PURE__ */ new Set([
|
|
13294
|
-
"stdout",
|
|
13295
|
-
"stderr",
|
|
13296
|
-
"standardOutput",
|
|
13297
|
-
"standard_output",
|
|
13298
|
-
"standardError",
|
|
13299
|
-
"standard_error",
|
|
13300
|
-
"error",
|
|
13301
|
-
"errorMessage",
|
|
13302
|
-
"evalue",
|
|
13303
|
-
"durationMs",
|
|
13304
|
-
"duration_ms",
|
|
13305
|
-
"duration",
|
|
13306
|
-
"kernelRestarted",
|
|
13307
|
-
"kernel_restarted",
|
|
13308
|
-
"status",
|
|
13309
|
-
"isError"
|
|
13310
|
-
]);
|
|
13311
|
-
const hasStructuredFields = Object.keys(fields).some((key) => !structuredKeys.has(key));
|
|
13312
|
-
return {
|
|
13313
|
-
record,
|
|
13314
|
-
details,
|
|
13315
|
-
stdout,
|
|
13316
|
-
stderr,
|
|
13317
|
-
result,
|
|
13318
|
-
error,
|
|
13319
|
-
durationMs,
|
|
13320
|
-
kernelRestarted,
|
|
13321
|
-
structured: !stdout && !stderr && !error && (typeof result === "object" && result !== null || hasStructuredFields)
|
|
13322
|
-
};
|
|
13323
|
-
}
|
|
13324
|
-
function getOutputSections(summary, output) {
|
|
13325
|
-
const sections = [];
|
|
13326
|
-
if (summary.stdout) sections.push({
|
|
13327
|
-
label: "stdout",
|
|
13328
|
-
content: summary.stdout,
|
|
13329
|
-
language: "text"
|
|
13330
|
-
});
|
|
13331
|
-
if (summary.stderr) sections.push({
|
|
13332
|
-
label: "stderr",
|
|
13333
|
-
content: summary.stderr,
|
|
13334
|
-
language: "text"
|
|
13335
|
-
});
|
|
13336
|
-
if (summary.result !== void 0) sections.push({
|
|
13337
|
-
label: "result",
|
|
13338
|
-
content: stringifyToolValue(summary.result),
|
|
13339
|
-
language: typeof summary.result === "object" && summary.result !== null ? "json" : "text"
|
|
13340
|
-
});
|
|
13341
|
-
if (summary.error) sections.push({
|
|
13342
|
-
label: "error",
|
|
13343
|
-
content: summary.error,
|
|
13344
|
-
language: "text"
|
|
13345
|
-
});
|
|
13346
|
-
if (sections.length > 0) return sections;
|
|
13347
|
-
const record = summary.details ?? summary.record;
|
|
13348
|
-
if (record) {
|
|
13349
|
-
const withoutEnvelope = { ...record };
|
|
13350
|
-
delete withoutEnvelope.details;
|
|
13351
|
-
delete withoutEnvelope.isError;
|
|
13352
|
-
if (Object.keys(withoutEnvelope).length > 0) return [{
|
|
13353
|
-
label: "result",
|
|
13354
|
-
content: stringifyToolValue(withoutEnvelope),
|
|
13355
|
-
language: "json"
|
|
13356
|
-
}];
|
|
13357
|
-
}
|
|
13358
|
-
const fallback = stringifyToolValue(output);
|
|
13359
|
-
return fallback.trim() ? [{
|
|
13360
|
-
label: "output",
|
|
13361
|
-
content: fallback,
|
|
13362
|
-
language: "text"
|
|
13363
|
-
}] : [];
|
|
13364
|
-
}
|
|
13365
|
-
function getOutputContent(summary, output) {
|
|
13366
|
-
return getOutputSections(summary, output).map((section) => `${section.label}
|
|
13367
|
-
${section.content}`).join("\n\n");
|
|
13368
|
-
}
|
|
13369
|
-
function getInput(part) {
|
|
13370
|
-
return parseRecord(part.input) ?? parseRecord(part.args);
|
|
13371
|
-
}
|
|
13372
|
-
function getArray(record, ...keys) {
|
|
13373
|
-
for (const key of keys) {
|
|
13374
|
-
const value = record?.[key];
|
|
13375
|
-
if (Array.isArray(value)) return value;
|
|
13376
|
-
}
|
|
13377
|
-
}
|
|
13378
|
-
function getDiff(input, summary) {
|
|
13379
|
-
return getString(summary.details ?? summary.record, "diff", "patch") ?? getString(input, "diff", "patch");
|
|
13380
|
-
}
|
|
13381
|
-
function getFilePath(input, summary) {
|
|
13382
|
-
return getString(input, "path", "filePath", "filename", "file") ?? getString(summary.details ?? summary.record, "path", "filePath", "filename", "file") ?? "workspace file";
|
|
13383
|
-
}
|
|
13384
|
-
function parseDiffLines(diff) {
|
|
13385
|
-
return diff.split("\n").map((content, index) => ({
|
|
13386
|
-
id: `${index}-${content.slice(0, 16)}`,
|
|
13387
|
-
type: content.startsWith("+") && !content.startsWith("+++") ? "added" : content.startsWith("-") && !content.startsWith("---") ? "removed" : "context",
|
|
13388
|
-
content
|
|
13389
|
-
}));
|
|
13390
|
-
}
|
|
13391
|
-
function getTodos(input, summary) {
|
|
13392
|
-
const output = summary.details ?? summary.record;
|
|
13393
|
-
const plan = parseRecord(input?.plan) ?? parseRecord(output?.plan);
|
|
13394
|
-
const source = getArray(input, "todos") ?? getArray(plan, "todos", "items") ?? getArray(output, "todos", "newTodos", "items");
|
|
13395
|
-
if (!source) return [];
|
|
13396
|
-
return source.flatMap((item, index) => {
|
|
13397
|
-
const record = asRecord(item);
|
|
13398
|
-
if (!record) return [];
|
|
13399
|
-
const title = getString(record, "content", "title", "text", "label");
|
|
13400
|
-
if (!title) return [];
|
|
13401
|
-
const rawStatus = getString(record, "status");
|
|
13402
|
-
const status = rawStatus === "in_progress" || rawStatus === "in-progress" ? "in-progress" : rawStatus === "completed" ? "completed" : rawStatus === "cancelled" ? "cancelled" : "pending";
|
|
13403
|
-
return [{
|
|
13404
|
-
id: `${index}-${title}`,
|
|
13405
|
-
title,
|
|
13406
|
-
status
|
|
13407
|
-
}];
|
|
13408
|
-
});
|
|
13409
|
-
}
|
|
13410
|
-
function getCitations(summary) {
|
|
13411
|
-
const source = getArray(summary.details ?? summary.record, "results", "sources", "citations");
|
|
13412
|
-
if (!source) return [];
|
|
13413
|
-
return source.flatMap((item, index) => {
|
|
13414
|
-
const record = asRecord(item);
|
|
13415
|
-
if (!record) return [];
|
|
13416
|
-
const title = getString(record, "title", "name", "snippet");
|
|
13417
|
-
if (!title) return [];
|
|
13418
|
-
const rawUrl = getString(record, "url", "link");
|
|
13419
|
-
const url = rawUrl && isSafeExternalUrl(rawUrl) ? rawUrl : void 0;
|
|
13420
|
-
return [{
|
|
13421
|
-
id: `${index}-${title}`,
|
|
13422
|
-
title,
|
|
13423
|
-
url,
|
|
13424
|
-
domain: getString(record, "domain", "source")
|
|
13425
|
-
}];
|
|
13281
|
+
] })]
|
|
13426
13282
|
});
|
|
13427
13283
|
}
|
|
13428
|
-
function getImageUrl(summary) {
|
|
13429
|
-
return getString(summary.details ?? summary.record, "url", "imageUrl", "image_url");
|
|
13430
|
-
}
|
|
13431
|
-
function getApproval(input, summary) {
|
|
13432
|
-
return asRecord(input?.approval) ?? asRecord(summary.details?.approval) ?? asRecord(summary.record?.approval);
|
|
13433
|
-
}
|
|
13434
|
-
function toolName(part) {
|
|
13435
|
-
const type = typeof part.type === "string" ? part.type : "Tool";
|
|
13436
|
-
return type.startsWith("tool-") ? type.slice(5) : type;
|
|
13437
|
-
}
|
|
13438
|
-
function resultStatus(part, chatStatus) {
|
|
13439
|
-
const state = typeof part.state === "string" ? part.state : void 0;
|
|
13440
|
-
if (state === "output-error" || state === "error") return "error";
|
|
13441
|
-
if (state === "output-available" || state === "complete" || state === "success") return "success";
|
|
13442
|
-
if (state === "cancelled" || state === "canceled" || state === "aborted" || state === "interrupted") return "cancelled";
|
|
13443
|
-
if (part.error !== void 0) return "error";
|
|
13444
|
-
if (state === "input-streaming" || state === "streaming") return chatStatus === "streaming" ? "running" : "cancelled";
|
|
13445
|
-
if (part.output !== void 0 || part.result !== void 0) return "success";
|
|
13446
|
-
return chatStatus === "streaming" ? "running" : "cancelled";
|
|
13447
|
-
}
|
|
13448
|
-
function languageFor(name, structured) {
|
|
13449
|
-
if (structured || name.toLowerCase().includes("json")) return "json";
|
|
13450
|
-
if (name.toLowerCase().includes("bash") || name.toLowerCase().includes("shell")) return "bash";
|
|
13451
|
-
if (name.toLowerCase().includes("python")) return "python";
|
|
13452
|
-
return "text";
|
|
13453
|
-
}
|
|
13454
|
-
function sourceLanguageFor(name, command) {
|
|
13455
|
-
if (!command) return void 0;
|
|
13456
|
-
const lowerName = name.toLowerCase();
|
|
13457
|
-
if (lowerName.includes("bash") || lowerName.includes("shell")) return "bash";
|
|
13458
|
-
if (lowerName.includes("python")) return /^\s*%%bash(?:\s|$)/im.test(command) ? "bash" : "python";
|
|
13459
|
-
return "text";
|
|
13460
|
-
}
|
|
13461
|
-
function sourceLabelFor(name, language) {
|
|
13462
|
-
if (!language) return void 0;
|
|
13463
|
-
const lowerName = name.toLowerCase();
|
|
13464
|
-
if (lowerName.includes("ipython")) return "IPython";
|
|
13465
|
-
if (lowerName.includes("bash") || lowerName.includes("shell")) return "Bash";
|
|
13466
|
-
if (lowerName.includes("python")) return "Python";
|
|
13467
|
-
if (language === "json") return "JSON";
|
|
13468
|
-
if (language === "text") return "Text";
|
|
13469
|
-
return language.toUpperCase();
|
|
13470
|
-
}
|
|
13471
|
-
var normalizeCache = /* @__PURE__ */ new WeakMap();
|
|
13472
|
-
function normalizeToolPart(part, chatStatus) {
|
|
13473
|
-
if (part && typeof part === "object") {
|
|
13474
|
-
const cached = normalizeCache.get(part);
|
|
13475
|
-
if (cached && cached.chatStatus === chatStatus) return cached.value;
|
|
13476
|
-
const value = normalizeToolPartUncached(part, chatStatus);
|
|
13477
|
-
normalizeCache.set(part, {
|
|
13478
|
-
chatStatus,
|
|
13479
|
-
value
|
|
13480
|
-
});
|
|
13481
|
-
return value;
|
|
13482
|
-
}
|
|
13483
|
-
return normalizeToolPartUncached(part, chatStatus);
|
|
13484
|
-
}
|
|
13485
|
-
function normalizeToolPartUncached(part, chatStatus) {
|
|
13486
|
-
const source = asRecord(part);
|
|
13487
|
-
if (!source) return void 0;
|
|
13488
|
-
const name = toolName(source);
|
|
13489
|
-
const lowerName = name.toLowerCase();
|
|
13490
|
-
const input = getInput(source);
|
|
13491
|
-
const output = getOutput(source);
|
|
13492
|
-
const outputSummary = summarizeOutput(output);
|
|
13493
|
-
const status = resultStatus(source, chatStatus);
|
|
13494
|
-
const command = getString(input, "command", "cmd", "code", "script");
|
|
13495
|
-
const sourceLanguage = sourceLanguageFor(name, command);
|
|
13496
|
-
const metadata = [];
|
|
13497
|
-
if (outputSummary.durationMs !== void 0) metadata.push(`${outputSummary.durationMs}ms`);
|
|
13498
|
-
if (outputSummary.kernelRestarted) metadata.push("kernel restarted");
|
|
13499
|
-
const diff = getDiff(input, outputSummary);
|
|
13500
|
-
const todos = lowerName.includes("todo") || lowerName.includes("plan") ? getTodos(input, outputSummary) : [];
|
|
13501
|
-
const citations = lowerName.includes("search") || lowerName.includes("web") || lowerName.includes("source") || lowerName.includes("citation") ? getCitations(outputSummary) : [];
|
|
13502
|
-
const imageUrl = lowerName.includes("image") || lowerName.includes("generat") ? getImageUrl(outputSummary) : void 0;
|
|
13503
|
-
const approval = getApproval(input, outputSummary);
|
|
13504
|
-
const content = getOutputContent(outputSummary, output);
|
|
13505
|
-
const hasOutputContent = Boolean(content.trim());
|
|
13506
|
-
const id = typeof source.toolCallId === "string" && source.toolCallId ? source.toolCallId : `${name}-${JSON.stringify(input ?? {})}`;
|
|
13507
|
-
let detail;
|
|
13508
|
-
if (todos.length > 0) detail = {
|
|
13509
|
-
kind: "todo",
|
|
13510
|
-
title: lowerName.includes("plan") ? "Plan" : "Todo list",
|
|
13511
|
-
items: todos
|
|
13512
|
-
};
|
|
13513
|
-
else if (citations.length > 0) detail = {
|
|
13514
|
-
kind: "citations",
|
|
13515
|
-
citations
|
|
13516
|
-
};
|
|
13517
|
-
else if (imageUrl) detail = {
|
|
13518
|
-
kind: "image",
|
|
13519
|
-
url: imageUrl
|
|
13520
|
-
};
|
|
13521
|
-
else if (diff && (lowerName.includes("edit") || lowerName.includes("write") || lowerName.includes("patch"))) detail = {
|
|
13522
|
-
kind: "diff",
|
|
13523
|
-
file: getFilePath(input, outputSummary),
|
|
13524
|
-
lines: parseDiffLines(diff),
|
|
13525
|
-
copyText: diff
|
|
13526
|
-
};
|
|
13527
|
-
else if (command || hasOutputContent || approval || metadata.length > 0) detail = {
|
|
13528
|
-
kind: "output",
|
|
13529
|
-
content,
|
|
13530
|
-
language: languageFor(name, outputSummary.structured),
|
|
13531
|
-
structured: outputSummary.structured,
|
|
13532
|
-
sections: getOutputSections(outputSummary, output),
|
|
13533
|
-
sourceCode: command,
|
|
13534
|
-
sourceLanguage,
|
|
13535
|
-
sourceLabel: sourceLabelFor(name, sourceLanguage)
|
|
13536
|
-
};
|
|
13537
|
-
return {
|
|
13538
|
-
id,
|
|
13539
|
-
name,
|
|
13540
|
-
lowerName,
|
|
13541
|
-
status,
|
|
13542
|
-
input,
|
|
13543
|
-
output,
|
|
13544
|
-
outputSummary,
|
|
13545
|
-
command,
|
|
13546
|
-
metadata,
|
|
13547
|
-
approval,
|
|
13548
|
-
detail
|
|
13549
|
-
};
|
|
13550
|
-
}
|
|
13551
13284
|
var QUESTION_CUSTOM_ID = "__custom__";
|
|
13552
13285
|
function optionBadge(idx) {
|
|
13553
13286
|
return String.fromCharCode(65 + idx);
|
|
@@ -14141,8 +13874,8 @@ function EditToolDiffCard({ step, state, onComplete, input, output, isCollapsibl
|
|
|
14141
13874
|
}
|
|
14142
13875
|
var EditTool = memo(function EditTool2({ part, isCollapsible = false, onFilePathClick }) {
|
|
14143
13876
|
const approval = part.input?.approval ?? part.args?.approval;
|
|
14144
|
-
const
|
|
14145
|
-
const { step, stepState } = adaptToolPart(part,
|
|
13877
|
+
const toolName = part.type?.replace("tool-", "") || "Edit";
|
|
13878
|
+
const { step, stepState } = adaptToolPart(part, toolName);
|
|
14146
13879
|
const noop = () => {
|
|
14147
13880
|
};
|
|
14148
13881
|
return /* @__PURE__ */ jsx7(EditToolDiffCard, {
|
|
@@ -14651,8 +14384,8 @@ function normalizeResults(value) {
|
|
|
14651
14384
|
return parsed.length > 0 ? parsed : void 0;
|
|
14652
14385
|
}
|
|
14653
14386
|
var SearchTool = memo(function SearchTool2({ part, results, defaultOpen }) {
|
|
14654
|
-
const
|
|
14655
|
-
const { step, stepState } = adaptToolPart(part,
|
|
14387
|
+
const toolName = part.type?.replace("tool-", "") || "WebSearch";
|
|
14388
|
+
const { step, stepState } = adaptToolPart(part, toolName);
|
|
14656
14389
|
const stepStates = { [step.id]: stepState };
|
|
14657
14390
|
const noop = () => {
|
|
14658
14391
|
};
|
|
@@ -15023,11 +14756,11 @@ function parseMcpToolType(partType) {
|
|
|
15023
14756
|
const separatorIndex = withoutPrefix.indexOf("__");
|
|
15024
14757
|
if (separatorIndex === -1) return null;
|
|
15025
14758
|
const serverName = withoutPrefix.slice(0, separatorIndex);
|
|
15026
|
-
const
|
|
14759
|
+
const toolName = withoutPrefix.slice(separatorIndex + 2);
|
|
15027
14760
|
return {
|
|
15028
14761
|
serverName,
|
|
15029
|
-
toolName
|
|
15030
|
-
displayName:
|
|
14762
|
+
toolName,
|
|
14763
|
+
displayName: toolName.replace(/_/g, " ").replace(/\b\w/g, (c) => c.toUpperCase()).trim(),
|
|
15031
14764
|
category: "other"
|
|
15032
14765
|
};
|
|
15033
14766
|
}
|
|
@@ -15167,57 +14900,82 @@ var ToolGroup = memo(function ToolGroup2({ part, nestedTools = EMPTY_NESTED_TOOL
|
|
|
15167
14900
|
const subtitle = (() => {
|
|
15168
14901
|
if (isPending && hasNestedTools) return streamCounts;
|
|
15169
14902
|
if (!isPending && hasNestedTools) {
|
|
15170
|
-
const
|
|
15171
|
-
if (
|
|
14903
|
+
const summary2 = summarizeNestedTools(nestedTools);
|
|
14904
|
+
if (summary2) return summary2;
|
|
15172
14905
|
}
|
|
15173
14906
|
if (!description) return "";
|
|
15174
14907
|
return description.length > 60 ? `${description.slice(0, 57)}\u2026` : description;
|
|
15175
14908
|
})();
|
|
15176
14909
|
const elapsedTimeDisplay = formatElapsedTime(!isPending && outputDuration ? outputDuration : elapsedMs);
|
|
15177
|
-
|
|
15178
|
-
|
|
15179
|
-
|
|
14910
|
+
const TaskIcon = toolActionIconForName(part.type === "tool-Agent" ? "agent" : "task");
|
|
14911
|
+
const statusText = isPending ? "running" : isInterrupted ? "interrupted" : "done";
|
|
14912
|
+
const summary = isPending && shimmerLabel ? shimmerLabel : completeLabel;
|
|
14913
|
+
const summaryLine = /* @__PURE__ */ jsxs3(TraceLine, {
|
|
14914
|
+
status: isPending ? "running" : void 0,
|
|
14915
|
+
children: [
|
|
14916
|
+
/* @__PURE__ */ jsx7(TraceIcon, { children: /* @__PURE__ */ jsx7(TaskIcon, {}) }),
|
|
14917
|
+
/* @__PURE__ */ jsx7(TraceTitle, { children: isPending && shimmerLabel ? /* @__PURE__ */ jsx7(ToolTextShimmer, {
|
|
14918
|
+
as: "span",
|
|
14919
|
+
duration: 1.2,
|
|
14920
|
+
className: "m-0 inline-flex h-4 items-center leading-none",
|
|
14921
|
+
children: summary
|
|
14922
|
+
}) : summary }),
|
|
14923
|
+
subtitle ? /* @__PURE__ */ jsx7(TraceDescription, {
|
|
14924
|
+
className: "max-w-56 truncate",
|
|
14925
|
+
children: subtitle
|
|
14926
|
+
}) : null,
|
|
14927
|
+
/* @__PURE__ */ jsx7(TraceDescription, { children: statusText }),
|
|
14928
|
+
showElapsed && elapsedTimeDisplay ? /* @__PURE__ */ jsx7(TraceDescription, { children: elapsedTimeDisplay }) : null
|
|
14929
|
+
]
|
|
15180
14930
|
});
|
|
15181
|
-
|
|
15182
|
-
|
|
15183
|
-
|
|
15184
|
-
|
|
15185
|
-
|
|
15186
|
-
|
|
15187
|
-
|
|
15188
|
-
|
|
14931
|
+
const childTrace = /* @__PURE__ */ jsx7(Trace, {
|
|
14932
|
+
className: "gap-1",
|
|
14933
|
+
children: (isPending ? nestedTools.slice(0, Math.max(visibleCount, 0)) : nestedTools).map((nestedPart, idx) => {
|
|
14934
|
+
const derivedPart = isPending ? {
|
|
14935
|
+
...nestedPart,
|
|
14936
|
+
state: idx === visibleCount - 1 ? "input-streaming" : "output-available"
|
|
14937
|
+
} : nestedPart;
|
|
14938
|
+
const nestedMeta = toolRegistry[derivedPart.type];
|
|
14939
|
+
if (!nestedMeta) return null;
|
|
14940
|
+
const { isPending: nestedIsPending, isError: nestedIsError } = getToolStatus(derivedPart, chatStatus);
|
|
14941
|
+
const NestedIcon = nestedMeta.icon;
|
|
14942
|
+
return /* @__PURE__ */ jsxs3(TraceLine, {
|
|
14943
|
+
status: nestedIsPending ? "running" : nestedIsError ? "error" : void 0,
|
|
14944
|
+
children: [
|
|
14945
|
+
/* @__PURE__ */ jsx7(TraceIcon, { children: /* @__PURE__ */ jsx7(NestedIcon, {}) }),
|
|
14946
|
+
/* @__PURE__ */ jsx7(TraceTitle, { children: nestedMeta.title(derivedPart) }),
|
|
14947
|
+
nestedMeta.subtitle?.(derivedPart) ? /* @__PURE__ */ jsx7(TraceDescription, {
|
|
14948
|
+
className: "max-w-56 truncate",
|
|
14949
|
+
children: nestedMeta.subtitle(derivedPart)
|
|
14950
|
+
}) : null
|
|
14951
|
+
]
|
|
14952
|
+
}, derivedPart.toolCallId ?? derivedPart.id ?? `${derivedPart.type}-${nestedMeta.title(derivedPart)}`);
|
|
14953
|
+
})
|
|
14954
|
+
});
|
|
14955
|
+
if (isInterrupted && !part.output) return /* @__PURE__ */ jsx7(Trace, { children: /* @__PURE__ */ jsxs3(TraceLine, { children: [
|
|
14956
|
+
/* @__PURE__ */ jsx7(TraceIcon, { children: /* @__PURE__ */ jsx7(TaskIcon, {}) }),
|
|
14957
|
+
/* @__PURE__ */ jsx7(TraceTitle, { children: interruptedLabel }),
|
|
14958
|
+
/* @__PURE__ */ jsx7(TraceDescription, { children: "interrupted" })
|
|
14959
|
+
] }) });
|
|
14960
|
+
return /* @__PURE__ */ jsx7(Trace, { children: hasNestedTools ? /* @__PURE__ */ jsxs3(TraceCollapsible, {
|
|
14961
|
+
open: expanded,
|
|
14962
|
+
onOpenChange: (next) => {
|
|
15189
14963
|
userToggledRef.current = true;
|
|
15190
|
-
setExpanded(
|
|
14964
|
+
setExpanded(next);
|
|
15191
14965
|
},
|
|
15192
|
-
|
|
15193
|
-
|
|
15194
|
-
children:
|
|
15195
|
-
}) :
|
|
15196
|
-
children: /* @__PURE__ */ jsxs3("div", {
|
|
14966
|
+
children: [/* @__PURE__ */ jsx7(TraceCollapsibleTrigger, {
|
|
14967
|
+
"aria-label": `${summary}: ${subtitle || nestedTools.length} ${statusText}`,
|
|
14968
|
+
children: summaryLine
|
|
14969
|
+
}), /* @__PURE__ */ jsx7(TraceCollapsibleContent, { children: /* @__PURE__ */ jsxs3("div", {
|
|
15197
14970
|
className: "relative",
|
|
15198
14971
|
children: [isPending && expanded && visibleToolCount > maskThreshold && /* @__PURE__ */ jsx7("div", { className: "pointer-events-none absolute inset-x-0 top-0 z-10 h-10 bg-linear-to-b from-background to-transparent" }), /* @__PURE__ */ jsx7("div", {
|
|
15199
14972
|
ref: listRef,
|
|
15200
|
-
className: cn(
|
|
14973
|
+
className: cn(isPending && expanded && visibleToolCount > maskThreshold && "overflow-y-auto"),
|
|
15201
14974
|
style: isPending && expanded && visibleToolCount > maskThreshold ? { height: `${streamHeight}px` } : void 0,
|
|
15202
|
-
children:
|
|
15203
|
-
const derivedPart = isPending ? {
|
|
15204
|
-
...nestedPart,
|
|
15205
|
-
state: idx === visibleCount - 1 ? "input-streaming" : "output-available"
|
|
15206
|
-
} : nestedPart;
|
|
15207
|
-
const nestedMeta = toolRegistry[derivedPart.type];
|
|
15208
|
-
if (!nestedMeta) return null;
|
|
15209
|
-
const { isPending: nestedIsPending, isError: nestedIsError } = getToolStatus(derivedPart, chatStatus);
|
|
15210
|
-
return /* @__PURE__ */ jsx7(GenericTool, {
|
|
15211
|
-
icon: nestedMeta.icon,
|
|
15212
|
-
title: nestedMeta.title(derivedPart),
|
|
15213
|
-
subtitle: nestedMeta.subtitle?.(derivedPart),
|
|
15214
|
-
isPending: nestedIsPending,
|
|
15215
|
-
isError: nestedIsError
|
|
15216
|
-
}, derivedPart.toolCallId ?? derivedPart.id ?? `${derivedPart.type}-${nestedMeta.title(derivedPart)}`);
|
|
15217
|
-
})
|
|
14975
|
+
children: childTrace
|
|
15218
14976
|
})]
|
|
15219
|
-
})
|
|
15220
|
-
});
|
|
14977
|
+
}) })]
|
|
14978
|
+
}) : summaryLine });
|
|
15221
14979
|
});
|
|
15222
14980
|
function deriveToolStatus(part, chatStatus) {
|
|
15223
14981
|
if (part.state === "input-streaming") return "streaming";
|
|
@@ -15289,10 +15047,10 @@ var ToolRenderer = memo(function ToolRenderer2({ part, nestedTools, chatStatus,
|
|
|
15289
15047
|
});
|
|
15290
15048
|
}
|
|
15291
15049
|
if (toolRenderers && partType.startsWith("tool-")) {
|
|
15292
|
-
const
|
|
15293
|
-
const CustomRenderer = toolRenderers[
|
|
15050
|
+
const toolName2 = partType.slice(5);
|
|
15051
|
+
const CustomRenderer = toolRenderers[toolName2];
|
|
15294
15052
|
if (CustomRenderer) return /* @__PURE__ */ jsx7(CustomRenderer, {
|
|
15295
|
-
name:
|
|
15053
|
+
name: toolName2,
|
|
15296
15054
|
input: part.input ?? {},
|
|
15297
15055
|
output: part.output ?? part.result,
|
|
15298
15056
|
status: deriveToolStatus(part, chatStatus)
|
|
@@ -15308,10 +15066,10 @@ var ToolRenderer = memo(function ToolRenderer2({ part, nestedTools, chatStatus,
|
|
|
15308
15066
|
isError: isError2
|
|
15309
15067
|
});
|
|
15310
15068
|
}
|
|
15311
|
-
const
|
|
15069
|
+
const toolName = partType.startsWith("tool-") ? partType.slice(5) : partType;
|
|
15312
15070
|
const { isPending, isError } = getToolStatus(part, chatStatus);
|
|
15313
15071
|
return /* @__PURE__ */ jsx7(GenericTool, {
|
|
15314
|
-
title: isPending ? `Running ${
|
|
15072
|
+
title: isPending ? `Running ${toolName}` : toolName,
|
|
15315
15073
|
isPending,
|
|
15316
15074
|
isError
|
|
15317
15075
|
});
|
|
@@ -15358,7 +15116,7 @@ function SourceBlock({ code, language, languageLabel, status }) {
|
|
|
15358
15116
|
wrap: true
|
|
15359
15117
|
});
|
|
15360
15118
|
}
|
|
15361
|
-
var SessionToolRenderer = memo(function SessionToolRenderer2({ part, nestedTools, chatStatus, toolRenderers }) {
|
|
15119
|
+
var SessionToolRenderer = memo(function SessionToolRenderer2({ part, nestedTools, chatStatus, toolRenderers, insideTrace = false }) {
|
|
15362
15120
|
const partType = part.type;
|
|
15363
15121
|
if (partType === "tool-Thinking" || partType === "tool-FleetReasoning") return null;
|
|
15364
15122
|
const renderFallback = () => /* @__PURE__ */ jsx7(ToolRenderer, {
|
|
@@ -15368,7 +15126,7 @@ var SessionToolRenderer = memo(function SessionToolRenderer2({ part, nestedTools
|
|
|
15368
15126
|
toolRenderers
|
|
15369
15127
|
});
|
|
15370
15128
|
if (!partType.startsWith("tool-")) return renderFallback();
|
|
15371
|
-
const normalized = normalizeToolPart(part, chatStatus);
|
|
15129
|
+
const normalized = normalizeToolPart$1(part, chatStatus);
|
|
15372
15130
|
if (!normalized || normalized.lowerName === "question") return renderFallback();
|
|
15373
15131
|
const { detail, status } = normalized;
|
|
15374
15132
|
if (!detail) return renderFallback();
|
|
@@ -15416,16 +15174,8 @@ var SessionToolRenderer = memo(function SessionToolRenderer2({ part, nestedTools
|
|
|
15416
15174
|
defaultOpen: status === "running"
|
|
15417
15175
|
});
|
|
15418
15176
|
const content = detail.content || "No output.";
|
|
15419
|
-
|
|
15420
|
-
|
|
15421
|
-
title: normalized.name,
|
|
15422
|
-
status,
|
|
15423
|
-
kind: normalized.lowerName.includes("bash") || normalized.lowerName.includes("shell") || normalized.lowerName.includes("python") ? "terminal" : "custom",
|
|
15424
|
-
meta: normalized.metadata.length > 0 ? normalized.metadata.join(" \xB7 ") : void 0,
|
|
15425
|
-
defaultOpen: status === "running",
|
|
15426
|
-
collapseOnComplete: false,
|
|
15427
|
-
maxHeight: 240,
|
|
15428
|
-
copyText: content,
|
|
15177
|
+
const details = /* @__PURE__ */ jsxs3("div", {
|
|
15178
|
+
className: "flex min-w-0 flex-col gap-2",
|
|
15429
15179
|
children: [
|
|
15430
15180
|
detail.sourceCode ? /* @__PURE__ */ jsx7(SourceBlock, {
|
|
15431
15181
|
code: detail.sourceCode,
|
|
@@ -15436,6 +15186,7 @@ var SessionToolRenderer = memo(function SessionToolRenderer2({ part, nestedTools
|
|
|
15436
15186
|
detail.sections.map((section) => /* @__PURE__ */ jsx7(ToolResultOutput, {
|
|
15437
15187
|
language: section.language,
|
|
15438
15188
|
label: section.label,
|
|
15189
|
+
error: section.label === "reported-error",
|
|
15439
15190
|
children: section.content
|
|
15440
15191
|
}, section.label)),
|
|
15441
15192
|
/* @__PURE__ */ jsx7(Approval, {
|
|
@@ -15445,6 +15196,19 @@ var SessionToolRenderer = memo(function SessionToolRenderer2({ part, nestedTools
|
|
|
15445
15196
|
})
|
|
15446
15197
|
]
|
|
15447
15198
|
});
|
|
15199
|
+
if (insideTrace) return details;
|
|
15200
|
+
return /* @__PURE__ */ jsx7(ToolResult, {
|
|
15201
|
+
tool: "Prime",
|
|
15202
|
+
title: normalized.name,
|
|
15203
|
+
status,
|
|
15204
|
+
kind: normalized.lowerName.includes("bash") || normalized.lowerName.includes("shell") || normalized.lowerName.includes("python") ? "terminal" : "custom",
|
|
15205
|
+
meta: normalized.metadata.length > 0 ? normalized.metadata.join(" \xB7 ") : void 0,
|
|
15206
|
+
defaultOpen: status === "running",
|
|
15207
|
+
collapseOnComplete: false,
|
|
15208
|
+
maxHeight: 240,
|
|
15209
|
+
copyText: content,
|
|
15210
|
+
children: details
|
|
15211
|
+
});
|
|
15448
15212
|
});
|
|
15449
15213
|
|
|
15450
15214
|
export {
|