@qredence/fleet 0.5.0 → 0.5.5

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 (122) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +8 -1
  3. package/bin/fleet-prime.mjs +6 -0
  4. package/dist/web/client/assets/action-swap-roll-DX5o_33Q.js +1 -0
  5. package/dist/web/client/assets/artifacts-panel-C3yewUBP.js +1 -0
  6. package/dist/web/client/assets/artifacts-utils-N_kUFbz2.js +1 -0
  7. package/dist/web/client/assets/bot-Bs7QWJ2q.js +1 -0
  8. package/dist/web/client/assets/{chat-C64Sv6V-.js → chat-W-yOMyG_.js} +5 -5
  9. package/dist/web/client/assets/chat-command-palette-D0xDK1j4.js +1 -0
  10. package/dist/web/client/assets/command-CQzrtjyj.js +2 -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-B0Y7ou0U.js} +28 -30
  13. package/dist/web/client/assets/generative-text-renderer-SS9c1kNX.js +6 -0
  14. package/dist/web/client/assets/globals-D_Hy9bT1.css +2 -0
  15. package/dist/web/client/assets/horizontal-resize-C1TpRLNC.js +1 -0
  16. package/dist/web/client/assets/index-C9FloFgj.js +12 -0
  17. package/dist/web/client/assets/{input-Clyn18XG.js → input-CqC82Agz.js} +1 -1
  18. package/dist/web/client/assets/{input-group-MxDAWX3j.js → input-group-H0TG-mkU.js} +1 -1
  19. package/dist/web/client/assets/ipython-tool-BrMePqD-.js +3 -0
  20. package/dist/web/client/assets/markdown-DG7pUdsX.js +2 -0
  21. package/dist/web/client/assets/{markdown-code-pIaEVDUU.js → markdown-code-BgMzpy7O.js} +1 -1
  22. package/dist/web/client/assets/notify-Duj26eeZ.js +1 -0
  23. package/dist/web/client/assets/{openui-renderer-NLUpAS3h.js → openui-renderer-CCfQqUfE.js} +5 -5
  24. package/dist/web/client/assets/openui-utils-DawGoQNp.js +1 -0
  25. package/dist/web/client/assets/prime-agent-artifacts-C-g1VPiW.js +5 -0
  26. package/dist/web/client/assets/{provider-catalog-Gx9qaHBM.js → provider-catalog-BZhZuKSz.js} +1 -1
  27. package/dist/web/client/assets/provider-label-jKm8v18u.js +1 -0
  28. package/dist/web/client/assets/range-65lubOFp.js +2 -0
  29. package/dist/web/client/assets/repl-panel-CCh4ly7J.js +1 -0
  30. package/dist/web/client/assets/resource-helpers-ULlyU8qK.js +2 -0
  31. package/dist/web/client/assets/resources-panel-DSU7VGX2.js +1 -0
  32. package/dist/web/client/assets/routes-DSTyx_J0.js +16 -0
  33. package/dist/web/client/assets/session-insights-panel-CQdT90Op.js +1 -0
  34. package/dist/web/client/assets/settings-dialog-CkfpTKfM.js +1 -0
  35. package/dist/web/client/assets/skeleton-loaders-fStjEeRP.js +1 -0
  36. package/dist/web/client/assets/square-terminal-BYTN_I86.js +1 -0
  37. package/dist/web/client/assets/subagent-chat-panel-D-qw4uWb.js +1 -0
  38. package/dist/web/client/assets/subagent-transcript-C7oRwEEP.js +1 -0
  39. package/dist/web/client/assets/subagents-panel-aSMWZP9p.js +1 -0
  40. package/dist/web/client/assets/{switch-ojzdMno9.js → switch-BFEBpUEU.js} +1 -1
  41. package/dist/web/client/assets/{tool-result-QvhjpNGX.js → tool-result-C2NvnN32.js} +3 -3
  42. package/dist/web/client/assets/ui-preferences-DUEFuJFj.js +1 -0
  43. package/dist/web/client/assets/workspace-panel-CjdXlEvd.js +1 -0
  44. package/dist/web/client/assets/workspace-path-nav-C0AQNZyy.js +1 -0
  45. package/dist/web/server/{_tanstack-start-manifest_v-uZddQetG-MNZGQOSA.js → _tanstack-start-manifest_v-DZc7dwm7-6ZQLGXB7.js} +23 -16
  46. package/dist/web/server/{artifacts-panel-knpQvJ-q-WJLZ76QB.js → artifacts-panel-Bt7YUzm4-NCBMXJ25.js} +39 -72
  47. package/dist/web/server/{chat-command-palette-CPv5GmGJ-22J32S6P.js → chat-command-palette-Co1L3rUY-RQLNME4T.js} +43 -20
  48. package/dist/web/server/{chunk-5277VI3D.js → chunk-2V6B62OF.js} +213 -275
  49. package/dist/web/server/{chunk-W7LNJCRJ.js → chunk-3HUI75QM.js} +75 -67
  50. package/dist/web/server/{chunk-I3FDTJFO.js → chunk-46VQY7SG.js} +6 -87
  51. package/dist/web/server/{chunk-PRT4QYOB.js → chunk-4UBOIY2S.js} +2 -35
  52. package/dist/web/server/{chunk-WTYNN6EV.js → chunk-54II5QXQ.js} +23 -1
  53. package/dist/web/server/chunk-56HSKUBD.js +1805 -0
  54. package/dist/web/server/{chunk-RPROZ2JC.js → chunk-5RQ6QAZX.js} +133 -133
  55. package/dist/web/server/{chunk-APN3LVRT.js → chunk-6D524OCJ.js} +201 -204
  56. package/dist/web/server/chunk-6GMKRR3C.js +161 -0
  57. package/dist/web/server/chunk-74QOI457.js +45 -0
  58. package/dist/web/server/{chunk-UBUXV2TW.js → chunk-AECEK3K7.js} +8 -8
  59. package/dist/web/server/chunk-AQ66E5OW.js +33 -0
  60. package/dist/web/server/{chunk-JD6EWZCU.js → chunk-AWFOBHH4.js} +50 -50
  61. package/dist/web/server/{chunk-MK3P3OBZ.js → chunk-BEMDNODD.js} +5 -5
  62. package/dist/web/server/{chunk-X2TUFLTP.js → chunk-BLVCDQ7E.js} +438 -438
  63. package/dist/web/server/chunk-FZRBAPUM.js +48 -0
  64. package/dist/web/server/chunk-G5BCQQ5N.js +34 -0
  65. package/dist/web/server/chunk-KOIPYBJF.js +3773 -0
  66. package/dist/web/server/{chunk-XYYNYFFD.js → chunk-LSIHVSUT.js} +2 -2
  67. package/dist/web/server/{chunk-KVHPE5XH.js → chunk-MDYA4NXK.js} +22 -8
  68. package/dist/web/server/chunk-NFRJDPB3.js +52 -0
  69. package/dist/web/server/chunk-P66QQWUM.js +67 -0
  70. package/dist/web/server/{chunk-4KFMONRT.js → chunk-PDRD2X5G.js} +9 -9
  71. package/dist/web/server/{chunk-XXNFEXDU.js → chunk-QJBEWT4E.js} +2 -70
  72. package/dist/web/server/{chunk-AQWTGP35.js → chunk-RX62LUDV.js} +8 -8
  73. package/dist/web/server/chunk-SR65ARVS.js +192 -0
  74. package/dist/web/server/{chunk-WK7CQS2N.js → chunk-SZ65K4CO.js} +48 -48
  75. package/dist/web/server/{chunk-C7EKOPZU.js → chunk-TO3YPLNZ.js} +89 -89
  76. package/dist/web/server/{chunk-IFV5M33X.js → chunk-UKINNXJY.js} +12 -26
  77. package/dist/web/server/chunk-VGDP4YDU.js +401 -0
  78. package/dist/web/server/{fleet-pi-tool-renderer-5vYFNeZS-IHKMLT7W.js → chunk-VRLTWOVJ.js} +46 -393
  79. package/dist/web/server/{chunk-KDSISV4P.js → chunk-WN77JNYY.js} +2 -50
  80. package/dist/web/server/{chunk-OADQILSQ.js → chunk-WZNZQNI4.js} +267 -3667
  81. package/dist/web/server/{chunk-KAWYGHDN.js → chunk-XFVL5ITL.js} +2354 -2314
  82. package/dist/web/server/{chunk-ZX3XOSYO.js → chunk-XLCTCC4W.js} +3 -3
  83. package/dist/web/server/{chunk-TTQ75CXC.js → chunk-Y4MHIA7B.js} +97 -40
  84. package/dist/web/server/fleet-pi-tool-renderer-CE45vM6T-2UQN6RJM.js +37 -0
  85. package/dist/web/server/{fork-picker-dialog-BZzfxdQd-C6SPHFAW.js → fork-picker-dialog-DCzuGelH-TN2Q5OXI.js} +5 -5
  86. package/dist/web/server/{markdown-Ct_q4D-z-VFWZRBTY.js → markdown-Boni3lHk-AZGKDNAR.js} +1 -1
  87. package/dist/web/server/{markdown-code-C_ih1bX1-5CIWT3CH.js → markdown-code-BrWukbg3-D2GN4Y77.js} +2 -2
  88. package/dist/web/server/{openui-renderer-BT5jL0Yf-XYLLN5U6.js → openui-renderer-c36_GYes-HX46N4M5.js} +14 -13
  89. package/dist/web/server/repl-panel-D9E8nkQy-L45ZNG2V.js +118 -0
  90. package/dist/web/server/{resources-panel-DNCVHTIg-PJYMXVGE.js → resources-panel-CwKh4U9f-D3VDEMDW.js} +6 -6
  91. package/dist/web/server/{router-DDxOMz3K-HRBXILHM.js → router-_ZpegqiQ-QIE44PIB.js} +1811 -1334
  92. package/dist/web/server/{routes-BX4Tv-6R-FHIZYUWW.js → routes-Ct81-8Tq-LHRMOS7R.js} +3958 -4534
  93. package/dist/web/server/server.js +3 -3
  94. package/dist/web/server/{session-insights-panel-gYkkAE8H-W4O74Z7H.js → session-insights-panel-BHZyKDTo-LRMAMA3O.js} +5 -3
  95. package/dist/web/server/{settings-dialog-BTBFLQ1P-ZENQ4KWK.js → settings-dialog-B4uUS6f--AZ4I4ZOT.js} +179 -193
  96. package/dist/web/server/{start-CLAD7RcD-56S4BWMM.js → start-BYVnok_H-IA6TWGA3.js} +1 -1
  97. package/dist/web/server/subagent-chat-panel-C97S3WID-DLOAD5TG.js +63 -0
  98. package/dist/web/server/subagents-panel-iHpvMIZy-LI6XK66M.js +181 -0
  99. package/dist/web/server/{chunk-5SZXUN3Y.js → workspace-panel-CHPoiXEo-YB4WS3MK.js} +29 -16
  100. package/package.json +15 -7
  101. package/dist/web/client/assets/artifacts-panel-8TyrNBM_.js +0 -1
  102. package/dist/web/client/assets/chat-command-palette-HpsmKfLO.js +0 -1
  103. package/dist/web/client/assets/collapsible-WCSnxhr2.js +0 -1
  104. package/dist/web/client/assets/command-DgfiCKcY.js +0 -2
  105. package/dist/web/client/assets/globals-BmxtUHFx.css +0 -2
  106. package/dist/web/client/assets/horizontal-resize-B76jjn5v.js +0 -1
  107. package/dist/web/client/assets/index-0pBr_bKy.js +0 -12
  108. package/dist/web/client/assets/markdown-BXWmNJo7.js +0 -2
  109. package/dist/web/client/assets/prime-agent-artifacts-k9JiTDZM.js +0 -5
  110. package/dist/web/client/assets/provider-brand-icon-VCebsuTD.js +0 -1
  111. package/dist/web/client/assets/range-KAaLzImH.js +0 -2
  112. package/dist/web/client/assets/resources-panel-BWuKeyrb.js +0 -1
  113. package/dist/web/client/assets/routes-BPRw0UzV.js +0 -20
  114. package/dist/web/client/assets/session-insights-panel-CPymkzZT.js +0 -1
  115. package/dist/web/client/assets/settings-dialog-6p8mjg8t.js +0 -1
  116. package/dist/web/client/assets/shared-DAI9OAw0.js +0 -2
  117. package/dist/web/client/assets/skeleton-loaders-qxIkJKCA.js +0 -1
  118. package/dist/web/client/assets/workspace-panel-C67-fqw4.js +0 -1
  119. package/dist/web/client/assets/workspace-path-nav-BrQHo6es.js +0 -9
  120. package/dist/web/server/chunk-KJ4UUAEU.js +0 -83
  121. package/dist/web/server/chunk-NGI44XRR.js +0 -334
  122. package/dist/web/server/workspace-panel-BNAXF57q-EQCBPEG4.js +0 -28
@@ -0,0 +1,181 @@
1
+ import {
2
+ SubagentTranscriptView
3
+ } from "./chunk-SR65ARVS.js";
4
+ import {
5
+ orderedRlmChildren,
6
+ rlmStatusIcon
7
+ } from "./chunk-56HSKUBD.js";
8
+ import "./chunk-VRLTWOVJ.js";
9
+ import "./chunk-3HUI75QM.js";
10
+ import "./chunk-P66QQWUM.js";
11
+ import "./chunk-FZRBAPUM.js";
12
+ import "./chunk-SZ65K4CO.js";
13
+ import "./chunk-DBXYBYBP.js";
14
+ import "./chunk-5WZFFNFY.js";
15
+ import {
16
+ Bot
17
+ } from "./chunk-74QOI457.js";
18
+ import "./chunk-2H6A6Z7F.js";
19
+ import "./chunk-YRWVQ7BW.js";
20
+ import "./chunk-4UBOIY2S.js";
21
+ import "./chunk-UKINNXJY.js";
22
+ import "./chunk-6D524OCJ.js";
23
+ import "./chunk-QJBEWT4E.js";
24
+ import "./chunk-FAGDMGLK.js";
25
+ import "./chunk-6RJYXDSD.js";
26
+ import "./chunk-PKCTG7EW.js";
27
+ import {
28
+ ChevronRight
29
+ } from "./chunk-7QCDOBZ3.js";
30
+ import "./chunk-NFRJDPB3.js";
31
+ import "./chunk-LESNF5O4.js";
32
+ import "./chunk-QLY3L4A2.js";
33
+ import "./chunk-NLIUTTKL.js";
34
+ import {
35
+ Button
36
+ } from "./chunk-5RQ6QAZX.js";
37
+ import "./chunk-LSIHVSUT.js";
38
+ import "./chunk-BLVCDQ7E.js";
39
+ import "./chunk-ST5I2PLN.js";
40
+ import "./chunk-7APYEQIO.js";
41
+ import "./chunk-VGDP4YDU.js";
42
+ import "./chunk-G5BCQQ5N.js";
43
+ import "./chunk-BYXBJQAS.js";
44
+ import "./chunk-E26EAQIM.js";
45
+ import {
46
+ cn
47
+ } from "./chunk-DJMHPJBP.js";
48
+ import "./chunk-UQVZJSZZ.js";
49
+ import "./chunk-JDCCC7A7.js";
50
+ import "./chunk-L547YHC4.js";
51
+ import "./chunk-MLKGABMK.js";
52
+
53
+ // web/app/dist/server/assets/subagents-panel-iHpvMIZy.js
54
+ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
55
+ import { jsx, jsxs } from "react/jsx-runtime";
56
+ function SubagentsPanelContent({ agents, loadSession, onOpenTab, parentSessionId, tree }) {
57
+ const ordered = useMemo(() => orderedRlmChildren(agents, tree), [agents, tree]);
58
+ const [selectedAgentId, setSelectedAgentId] = useState(null);
59
+ const [transcripts, setTranscripts] = useState({});
60
+ const requestVersions = useRef(/* @__PURE__ */ new Map());
61
+ const selectedAgent = ordered.find((agent) => agent.id === selectedAgentId) ?? ordered[0];
62
+ useEffect(() => {
63
+ if (selectedAgentId && ordered.some((agent) => agent.id === selectedAgentId)) return;
64
+ setSelectedAgentId(ordered[0]?.id ?? null);
65
+ }, [ordered, selectedAgentId]);
66
+ const loadTranscript = useCallback(async (agent, force = false) => {
67
+ if (!parentSessionId) return;
68
+ const requestKey = `${parentSessionId}:${agent.id}:${agent.status}:${agent.timestamp}:${agent.activeSessionId ?? ""}`;
69
+ const current = transcripts[agent.id];
70
+ if (!force && current?.requestKey === requestKey) return;
71
+ const version = (requestVersions.current.get(agent.id) ?? 0) + 1;
72
+ requestVersions.current.set(agent.id, version);
73
+ setTranscripts((previous) => ({
74
+ ...previous,
75
+ [agent.id]: {
76
+ requestKey,
77
+ status: "loading",
78
+ messages: []
79
+ }
80
+ }));
81
+ try {
82
+ const response = await loadSession(parentSessionId, agent.id);
83
+ if (requestVersions.current.get(agent.id) !== version) return;
84
+ setTranscripts((previous) => ({
85
+ ...previous,
86
+ [agent.id]: {
87
+ requestKey,
88
+ status: "ready",
89
+ messages: response.messages,
90
+ presentation: response.presentation
91
+ }
92
+ }));
93
+ } catch (error) {
94
+ if (requestVersions.current.get(agent.id) !== version) return;
95
+ setTranscripts((previous) => ({
96
+ ...previous,
97
+ [agent.id]: {
98
+ requestKey,
99
+ status: "error",
100
+ messages: [],
101
+ error: error instanceof Error ? error : new Error(String(error))
102
+ }
103
+ }));
104
+ }
105
+ }, [
106
+ loadSession,
107
+ parentSessionId,
108
+ transcripts
109
+ ]);
110
+ useEffect(() => {
111
+ if (selectedAgent) loadTranscript(selectedAgent);
112
+ }, [loadTranscript, selectedAgent]);
113
+ if (ordered.length === 0) return /* @__PURE__ */ jsx("section", {
114
+ "aria-label": "Subagents",
115
+ className: "flex min-h-36 items-center rounded-md border border-dashed border-border/70 px-4 text-center text-[12px] leading-5 text-foreground/45",
116
+ children: "Subagent threads will appear here when Prime delegates work."
117
+ });
118
+ return /* @__PURE__ */ jsxs("section", {
119
+ "aria-label": "Subagents",
120
+ className: "space-y-2 pb-1",
121
+ children: [
122
+ /* @__PURE__ */ jsxs("div", {
123
+ className: "flex min-w-0 items-center gap-2 rounded-sm bg-foreground/5 px-2 py-1.5",
124
+ children: [
125
+ /* @__PURE__ */ jsx(Bot, { className: "size-3.5 shrink-0 text-foreground/45" }),
126
+ /* @__PURE__ */ jsx("span", {
127
+ className: "min-w-0 flex-1 truncate text-label font-medium text-foreground/70",
128
+ children: "Invoked subagents"
129
+ }),
130
+ /* @__PURE__ */ jsx("span", {
131
+ className: "shrink-0 text-[10px] text-foreground/40",
132
+ children: ordered.length
133
+ })
134
+ ]
135
+ }),
136
+ /* @__PURE__ */ jsx("div", {
137
+ className: "space-y-0.5",
138
+ "data-testid": "subagent-thread-list",
139
+ children: ordered.map((agent) => {
140
+ const selected = agent.id === selectedAgent?.id;
141
+ return /* @__PURE__ */ jsxs(Button, {
142
+ type: "button",
143
+ variant: "ghost",
144
+ size: "sm",
145
+ "aria-pressed": selected,
146
+ className: cn("flex w-full min-w-0 items-center gap-2 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-foreground/5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", selected && "bg-foreground/8"),
147
+ style: { paddingLeft: `${8 + Math.max(0, agent.depth ?? 0) * 12}px` },
148
+ onClick: () => {
149
+ setSelectedAgentId(agent.id);
150
+ onOpenTab?.(agent.id);
151
+ },
152
+ children: [
153
+ /* @__PURE__ */ jsx("span", {
154
+ className: "shrink-0",
155
+ children: rlmStatusIcon(agent.status)
156
+ }),
157
+ /* @__PURE__ */ jsx("span", {
158
+ className: "min-w-0 flex-1 truncate text-xs text-foreground/80",
159
+ children: agent.label
160
+ }),
161
+ /* @__PURE__ */ jsx(ChevronRight, { className: "size-3 shrink-0 text-foreground/30" }),
162
+ /* @__PURE__ */ jsx("span", {
163
+ className: "shrink-0 text-[10px] capitalize text-foreground/45",
164
+ children: agent.status
165
+ })
166
+ ]
167
+ }, agent.id);
168
+ })
169
+ }),
170
+ selectedAgent ? /* @__PURE__ */ jsx(SubagentTranscriptView, {
171
+ child: selectedAgent,
172
+ parentSessionId,
173
+ transcript: transcripts[selectedAgent.id],
174
+ onRefresh: () => void loadTranscript(selectedAgent, true)
175
+ }) : null
176
+ ]
177
+ });
178
+ }
179
+ export {
180
+ SubagentsPanelContent
181
+ };
@@ -1,6 +1,3 @@
1
- import {
2
- HardDrive
3
- } from "./chunk-HUX64PWB.js";
4
1
  import {
5
2
  File,
6
3
  FolderOpen,
@@ -11,43 +8,60 @@ import {
11
8
  readStoredWidth,
12
9
  startHorizontalResize,
13
10
  storeStoredWidth
14
- } from "./chunk-MK3P3OBZ.js";
11
+ } from "./chunk-BEMDNODD.js";
12
+ import "./chunk-QK4CHLVV.js";
13
+ import {
14
+ isPathWithinScope
15
+ } from "./chunk-P66QQWUM.js";
16
+ import {
17
+ Folder
18
+ } from "./chunk-OLG5DQ7V.js";
19
+ import {
20
+ HardDrive
21
+ } from "./chunk-HUX64PWB.js";
15
22
  import {
16
23
  AnimatePresence,
17
24
  EASE_OUT,
18
25
  SPRING_LAYOUT,
19
26
  SPRING_SWAP,
20
- isPathWithinScope,
21
27
  motion,
22
28
  useReducedMotion
23
- } from "./chunk-XXNFEXDU.js";
24
- import {
25
- Folder
26
- } from "./chunk-OLG5DQ7V.js";
29
+ } from "./chunk-QJBEWT4E.js";
30
+ import "./chunk-FAGDMGLK.js";
27
31
  import {
28
32
  ChevronRight
29
33
  } from "./chunk-7QCDOBZ3.js";
30
34
  import {
31
35
  Markdown
32
- } from "./chunk-KVHPE5XH.js";
36
+ } from "./chunk-MDYA4NXK.js";
33
37
  import {
38
+ ResourceChipSection,
39
+ ResourceNotice,
34
40
  WorkspacePreviewSkeleton,
35
41
  WorkspaceSkeleton
36
- } from "./chunk-KJ4UUAEU.js";
42
+ } from "./chunk-6GMKRR3C.js";
37
43
  import {
38
- ResourceChipSection,
39
- ResourceNotice,
40
44
  findWorkspaceNode
41
- } from "./chunk-I3FDTJFO.js";
45
+ } from "./chunk-46VQY7SG.js";
42
46
  import {
43
47
  CircleAlert,
44
48
  FileText
45
49
  } from "./chunk-7APYEQIO.js";
50
+ import "./chunk-BSFYTSN6.js";
51
+ import "./chunk-EAJTWMK5.js";
52
+ import "./chunk-ZGFQ7HIX.js";
53
+ import "./chunk-BYXBJQAS.js";
54
+ import "./chunk-E26EAQIM.js";
46
55
  import {
47
56
  cn
48
57
  } from "./chunk-DJMHPJBP.js";
58
+ import "./chunk-N5DKNPIC.js";
59
+ import "./chunk-UQVZJSZZ.js";
60
+ import "./chunk-JDCCC7A7.js";
61
+ import "./chunk-L547YHC4.js";
62
+ import "./chunk-MLKGABMK.js";
49
63
 
50
- // web/app/dist/server/assets/workspace-panel-BNAXF57q.js
64
+ // web/app/dist/server/assets/workspace-panel-CHPoiXEo.js
51
65
  import { Children, Fragment, isValidElement, useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
52
66
  import { jsx, jsxs } from "react/jsx-runtime";
53
67
  function FileTreeFolder(_props) {
@@ -612,7 +626,6 @@ function WorkspacePreview({ emptyDescription, emptyTitle, error, loading, previe
612
626
  })]
613
627
  });
614
628
  }
615
-
616
629
  export {
617
630
  WorkspacePanelContent
618
631
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qredence/fleet",
3
- "version": "0.5.0",
3
+ "version": "0.5.5",
4
4
  "description": "Fleet Prime: local web interface and launcher for the pinned Prime Agent runtime",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -9,7 +9,7 @@
9
9
  "repository": {
10
10
  "type": "git",
11
11
  "url": "git+https://github.com/Qredence/fleet-prime-agent.git",
12
- "directory": "packages/fleet-prime"
12
+ "directory": "packages/fleet-web"
13
13
  },
14
14
  "keywords": [
15
15
  "ai",
@@ -26,18 +26,26 @@
26
26
  },
27
27
  "files": [
28
28
  "bin",
29
- "dist"
29
+ "dist",
30
+ "CHANGELOG.md",
31
+ "LICENSE",
32
+ "README.md"
30
33
  ],
31
34
  "engines": {
32
35
  "node": ">=22.12.0"
33
36
  },
37
+ "os": [
38
+ "darwin",
39
+ "linux"
40
+ ],
34
41
  "publishConfig": {
35
- "access": "public"
42
+ "access": "public",
43
+ "registry": "https://registry.npmjs.org/"
36
44
  },
37
45
  "dependencies": {
38
- "@earendil-works/pi-agent-core": "https://pub-728493de92a943e2a9b2d17b4719f318.r2.dev/releases/v0.8.1/prime-agent-core-0.8.1.tgz",
39
- "@earendil-works/pi-ai": "https://pub-728493de92a943e2a9b2d17b4719f318.r2.dev/releases/v0.8.1/prime-agent-ai-0.8.1.tgz",
40
- "prime-agent": "https://pub-728493de92a943e2a9b2d17b4719f318.r2.dev/releases/v0.8.1/prime-agent-0.8.1.tgz",
46
+ "@earendil-works/pi-agent-core": "https://pub-728493de92a943e2a9b2d17b4719f318.r2.dev/releases/v0.9.1/prime-agent-core-0.9.1.tgz",
47
+ "@earendil-works/pi-ai": "https://pub-728493de92a943e2a9b2d17b4719f318.r2.dev/releases/v0.9.1/prime-agent-ai-0.9.1.tgz",
48
+ "prime-agent": "https://pub-728493de92a943e2a9b2d17b4719f318.r2.dev/releases/v0.9.1/prime-agent-0.9.1.tgz",
41
49
  "react": "19.2.8",
42
50
  "react-dom": "19.2.8",
43
51
  "use-sync-external-store": "1.6.0"
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./bundle-mjs-DKHVkVWu.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{t as r}from"./button-0At5xSyU.js";import{t as i}from"./createLucideIcon-DwxZHm0M.js";import{i as a,n as o,r as s,t as c}from"./tool-result-QvhjpNGX.js";import{i as l}from"./shared-DAI9OAw0.js";import{t as u}from"./chevron-right-DrJxToLs.js";import{n as d,r as f,t as p}from"./collapsible-WCSnxhr2.js";import{t as m}from"./package-CdcJFPf2.js";import{r as h,t as g}from"./openui-renderer-NLUpAS3h.js";import{K as _}from"./chat-C64Sv6V-.js";import{i as v,n as y,r as b}from"./prime-agent-artifacts-k9JiTDZM.js";import{WorkspacePanelContent as x}from"./workspace-panel-C67-fqw4.js";var S=i(`layout-template`,[[`rect`,{width:`18`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`f1a2em`}],[`rect`,{width:`9`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`jqznyg`}],[`rect`,{width:`5`,height:`7`,x:`16`,y:`14`,rx:`1`,key:`q5h2i8`}]]),C=e(t(),1),w=n(),T=[];function E(e){return e===`running`?`running`:e===`error`?`error`:e===`cancelled`?`cancelled`:`success`}function D(e){return e===`running`?`streaming`:e===`error`?`error`:e===`cancelled`?`cancelled`:`complete`}function O(e){if(typeof e==`string`)return e;if(e==null)return``;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function k(e){let t=typeof e==`object`&&e?e:void 0;if(!t)return e===void 0?[]:[{label:`result`,text:O(e)}];let n=[];for(let e of[`stdout`,`stderr`,`result`,`error`])t[e]!==void 0&&t[e]!==``&&n.push({label:e,text:O(t[e])});let r=t.details??t.output??t.result;if(n.length===0&&r!==e&&n.push(...k(r)),n.length===0&&Array.isArray(t.content)){let e=t.content.flatMap(e=>typeof e==`string`?[e]:typeof e==`object`&&e&&`text`in e&&typeof e.text==`string`?[e.text]:[]).join(``);e&&n.push({label:t.isError===!0?`error`:`stdout`,text:e})}return n.length>0?n:[{label:`result`,text:O(e)}]}function A(e){let t=typeof e.input==`object`&&e.input!==null?e.input:void 0,n=t?.command??t?.code??t?.script;if(!(typeof n!=`string`||!n))return e.kind===`bash`?{code:n,language:`bash`,label:`Bash`}:e.kind===`ipython`?{code:n,language:/^\s*%%bash(?:\s|$)/im.test(n)?`bash`:`python`,label:`IPython`}:e.kind===`diff`?{code:n,language:`text`,label:`Text`}:{code:n,language:`json`,label:`JSON`}}function j(e){if(e.kind!==`openui-html`)return;let t=typeof e.output==`object`&&e.output!==null?e.output:void 0;if(typeof t?.title==`string`&&typeof t.document==`string`)return{title:t.title,document:t.document}}function M({artifact:e,selected:t}){let n=(0,C.useRef)(null);(0,C.useEffect)(()=>{t&&requestAnimationFrame(()=>{n.current?.focus({preventScroll:!0}),n.current?.scrollIntoView({block:`nearest`})})},[t]);let r=j(e);return(0,w.jsxs)(`article`,{ref:n,"data-artifact-id":e.id,tabIndex:-1,className:`min-w-0 rounded-md border border-border/60 bg-background p-2.5 outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:[(0,w.jsxs)(`div`,{className:`mb-2 flex min-w-0 items-center gap-2`,children:[(0,w.jsx)(S,{className:`size-3.5 shrink-0 text-foreground/45`}),(0,w.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs font-medium`,title:e.title,children:e.title||`OpenUI artifact`}),(0,w.jsx)(`span`,{className:`shrink-0 text-[10px] text-foreground/40`,children:e.status})]}),r?(0,w.jsx)(h,{artifact:r}):(0,w.jsxs)(`div`,{role:`alert`,className:`space-y-2 text-xs text-destructive`,children:[(0,w.jsx)(`p`,{children:`OpenUI artifact data is unavailable.`}),(0,w.jsx)(`pre`,{className:`max-h-48 overflow-auto whitespace-pre-wrap break-words rounded bg-foreground/5 p-2 text-foreground/70`,children:O(e.output)})]})]})}function N({artifact:e,selected:t}){let n=(0,C.useRef)(null),r=t||e.status===`running`,[i,l]=(0,C.useState)(r);(0,C.useEffect)(()=>{t&&(l(!0),requestAnimationFrame(()=>{n.current?.focus({preventScroll:!0}),n.current?.scrollIntoView({block:`nearest`})}))},[t]);let u=A(e),d=k(e.output),f=e.kind===`diff`||e.kind===`refinement`?y(e):void 0;return(0,w.jsxs)(`article`,{ref:n,"data-artifact-id":e.id,tabIndex:-1,className:`rounded-md border border-border/60 bg-background px-2.5 py-2 outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:[f?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(s,{file:f.file,lines:f.lines,status:D(e.status),defaultOpen:r,copyText:f.copyText,maxHeight:240}),d.map(e=>(0,w.jsx)(o,{label:e.label,language:`text`,children:e.text},e.label))]}):null,f?null:(0,w.jsx)(c,{tool:e.kind,title:e.title,status:E(e.status),open:i,onOpenChange:l,defaultOpen:r,kind:e.kind===`bash`||e.kind===`ipython`?`terminal`:`custom`,children:(0,w.jsxs)(`div`,{className:`space-y-3`,children:[u?(0,w.jsx)(a,{code:u.code,language:u.language,languageLabel:u.label,showStatus:!1,showLineNumbers:!1,wrap:!0}):null,d.map(e=>(0,w.jsx)(o,{label:e.label,language:`text`,children:e.text},e.label))]})})]})}function P({block:e,expanded:t,isStreaming:n,onOpenUIAction:i,onToggle:a}){return(0,w.jsxs)(p,{open:t,onOpenChange:a,children:[(0,w.jsxs)(f,{render:(0,w.jsx)(r,{variant:`ghost`,size:`sm`,className:`group w-full justify-start gap-1.5 text-left text-label font-normal text-foreground/65 transition-none hover:bg-foreground/5 hover:text-foreground/80`}),children:[(0,w.jsx)(u,{className:`size-3 shrink-0 text-foreground/35 transition-transform group-data-panel-open:rotate-90`}),(0,w.jsx)(S,{className:`size-3.5 shrink-0 text-foreground/35`}),(0,w.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,title:e.component,children:e.component}),(0,w.jsxs)(`span`,{className:`shrink-0 text-[10px] text-foreground/40`,children:[`#`,e.ordinal]})]}),(0,w.jsx)(d,{children:(0,w.jsx)(`div`,{className:`mb-1 mt-0.5 flex min-w-0 flex-col overflow-hidden rounded-md border border-border/60 bg-background px-2.5 py-2`,children:(0,w.jsx)(_,{resetKeys:[e.content],children:(0,w.jsx)(g,{content:e.content,isStreaming:n,messageId:e.blockId,onOpenUIAction:i})})})})]})}function F({error:e,loadWorkspaceFile:t,loading:n,messages:r,onOpenUIAction:i,onSelectedPathChange:a,selectedPath:o,status:s,artifactRuns:c=T,selectedArtifactId:u,workspace:d}){let f=d?v(d.root):void 0,p=(0,C.useMemo)(()=>b(r),[r]),h=(0,C.useMemo)(()=>!d||!f?!1:!!l(d.nodes,f)?.children?.length,[f,d]),[g,_]=(0,C.useState)(null),y=s===`streaming`?p.at(-1)?.blockId:void 0,E=(0,C.useMemo)(()=>c.flatMap(e=>e.artifacts),[c]),D=(0,C.useMemo)(()=>E.filter(e=>e.kind===`openui-html`),[E]),O=(0,C.useMemo)(()=>E.filter(e=>e.kind!==`openui-html`),[E]);return(0,w.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-2 overflow-hidden`,children:[D.length>0?(0,w.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[(0,w.jsxs)(`div`,{className:`mb-2 flex min-w-0 items-center gap-2 rounded-sm bg-foreground/5 px-2 py-1.5`,children:[(0,w.jsx)(S,{className:`size-3.5 shrink-0 text-foreground/45`}),(0,w.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-label font-medium text-foreground/70`,children:`OpenUI artifacts`}),(0,w.jsx)(`span`,{className:`shrink-0 text-[10px] text-foreground/40`,children:D.length})]}),(0,w.jsx)(`div`,{className:`space-y-1`,children:D.map(e=>(0,w.jsx)(M,{artifact:e,selected:e.id===u},e.id))})]}):null,O.length>0?(0,w.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[(0,w.jsxs)(`div`,{className:`mb-2 flex min-w-0 items-center gap-2 rounded-sm bg-foreground/5 px-2 py-1.5`,children:[(0,w.jsx)(m,{className:`size-3.5 shrink-0 text-foreground/45`}),(0,w.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-label font-medium text-foreground/70`,children:`Technical artifacts`}),(0,w.jsx)(`span`,{className:`shrink-0 text-[10px] text-foreground/40`,children:O.length})]}),(0,w.jsx)(`div`,{className:`space-y-1`,children:O.map(e=>(0,w.jsx)(N,{artifact:e,selected:e.id===u},e.id))})]}):null,(0,w.jsxs)(`div`,{className:`flex min-h-0 flex-col`,children:[(0,w.jsxs)(`div`,{className:`mb-2 flex min-w-0 items-center gap-2 rounded-sm bg-foreground/5 px-2 py-1.5`,children:[(0,w.jsx)(S,{className:`size-3.5 shrink-0 text-foreground/45`}),(0,w.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-label font-medium text-foreground/70`,children:`Generative UI`}),(0,w.jsx)(`span`,{className:`shrink-0 text-[10px] text-foreground/40`,children:p.length>0?`${p.length}`:`none yet`})]}),p.length===0?(0,w.jsx)(`p`,{className:`px-2 pb-1 text-[11px] leading-4 text-foreground/40`,children:`OpenUI interfaces the agent generates in this session appear here, and can be re-opened without scrolling the conversation. Files written to agent-workspace/artifacts show below once the agent creates them.`}):(0,w.jsx)(`div`,{className:`flex min-h-0 flex-col gap-0.5 overflow-y-auto`,children:p.map(e=>(0,w.jsx)(P,{block:e,expanded:e.blockId===g,isStreaming:e.blockId===y,onOpenUIAction:i,onToggle:()=>_(t=>t===e.blockId?null:e.blockId)},e.blockId))})]}),h&&(0,w.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,w.jsx)(x,{error:e,loadWorkspaceFile:t,loading:n,onSelectedPathChange:a,previewEmptyDescription:`Choose a report, dataset, trace, or diagram to preview.`,previewEmptyTitle:`Select an artifact`,scopeLabel:`artifacts`,scopePath:f,selectedPath:o,treeTestId:`artifacts-tree`,workspace:d})})]})}export{F as ArtifactsPanelContent};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./bundle-mjs-DKHVkVWu.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{a as r,c as i,d as a,f as o,i as s,l as c,n as l,o as u,r as d,s as f}from"./command-DgfiCKcY.js";import{i as p,n as m,r as h,t as g}from"./sun-BWiZFty0.js";import{l as _}from"./input-group-MxDAWX3j.js";var v=e(t(),1),y=n();function b({open:e,onOpenChange:t,onNewSession:n,onStop:b,onResumeSession:x,onSetRightPanel:S,onThemeChange:C,sessions:w,isStreaming:T,themePreference:E}){let[D,O]=(0,v.useState)(``),[k,A]=(0,v.useState)(e);e!==k&&(A(e),e&&O(``));let j=e=>{e(),t(!1)};return(0,y.jsxs)(l,{open:e,onOpenChange:t,children:[(0,y.jsx)(r,{placeholder:`Type a command or search…`,value:D,onValueChange:O}),(0,y.jsxs)(f,{children:[(0,y.jsx)(d,{children:`No commands found.`}),(0,y.jsxs)(s,{heading:`Actions`,children:[(0,y.jsxs)(u,{onSelect:()=>j(n),keywords:[`new`,`session`,`chat`],children:[(0,y.jsx)(_,{className:`mr-2 size-4`}),(0,y.jsx)(`span`,{children:`New session`})]}),T&&(0,y.jsxs)(u,{onSelect:()=>j(b),keywords:[`stop`,`abort`,`cancel`],children:[(0,y.jsx)(a,{className:`mr-2 size-4`}),(0,y.jsx)(`span`,{children:`Stop generation`})]})]}),(0,y.jsx)(i,{}),(0,y.jsx)(s,{heading:`Panels`,children:c.map(e=>{let t=e.icon;return(0,y.jsxs)(u,{onSelect:()=>j(()=>S(e.id)),keywords:e.commandKeywords,children:[(0,y.jsx)(t,{}),(0,y.jsx)(`span`,{children:e.commandLabel})]},e.id)})}),w.length>0&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(i,{}),(0,y.jsx)(s,{heading:`Sessions`,children:w.map(e=>{let t=e.title;return(0,y.jsxs)(u,{onSelect:()=>j(()=>x(e)),keywords:[`session`,t],children:[(0,y.jsx)(o,{className:`mr-2 size-4`}),(0,y.jsx)(`span`,{className:`truncate`,children:t})]},e.sessionId)})})]}),(0,y.jsx)(i,{}),(0,y.jsxs)(s,{heading:`Theme`,children:[(0,y.jsxs)(u,{onSelect:()=>j(()=>C(`light`)),keywords:[`theme`,`light`],children:[(0,y.jsx)(g,{className:`mr-2 size-4`}),(0,y.jsx)(`span`,{children:`Light`}),E===`light`&&(0,y.jsx)(p,{className:`ml-auto size-3 opacity-50`})]}),(0,y.jsxs)(u,{onSelect:()=>j(()=>C(`dark`)),keywords:[`theme`,`dark`],children:[(0,y.jsx)(m,{className:`mr-2 size-4`}),(0,y.jsx)(`span`,{children:`Dark`}),E===`dark`&&(0,y.jsx)(p,{className:`ml-auto size-3 opacity-50`})]}),(0,y.jsxs)(u,{onSelect:()=>j(()=>C(`system`)),keywords:[`theme`,`system`],children:[(0,y.jsx)(h,{className:`mr-2 size-4`}),(0,y.jsx)(`span`,{children:`System`}),E===`system`&&(0,y.jsx)(p,{className:`ml-auto size-3 opacity-50`})]})]})]})]})}export{b as ChatCommandPalette};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./bundle-mjs-DKHVkVWu.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{_ as r,g as i,h as a,m as o,o as s,p as c,s as l}from"./workspace-path-nav-BrQHo6es.js";import{D as u,F as d,M as f,N as p,O as m,T as h,W as g,_,it as v,j as y,k as b,n as x,p as S,rt as C,tt as w,w as T,y as E}from"./x-BgciQ7_C.js";import{n as D,r as O,t as k}from"./useBaseUiId-B9f7fokB.js";import{t as A}from"./utils-Eg7xtNmV.js";import{t as j}from"./createLucideIcon-DwxZHm0M.js";import{t as M}from"./useControlled-CoY1jSuL.js";var N=j(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),P=j(`file-code-corner`,[[`path`,{d:`M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35`,key:`1wthlu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m5 16-3 3 3 3`,key:`331omg`}],[`path`,{d:`m9 22 3-3-3-3`,key:`lsp7cz`}]]),F=j(`square-terminal`,[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]]),I=j(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),L=n();function R({open:e,openHeight:t=`auto`,className:n,style:r,transition:o,...c}){let l=i()??!1;return(0,L.jsx)(a.div,{...c,"aria-hidden":!e,inert:!e,initial:!1,animate:l?{opacity:+!!e}:{opacity:+!!e,clipPath:e?`inset(0 0 0% 0)`:`inset(0 0 100% 0)`,y:e?0:-4},transition:o??{duration:l?0:e?.22:.14,ease:s},className:A(`overflow-hidden`,n),style:{...r,height:e?t:0,pointerEvents:e?void 0:`none`,transformOrigin:`top`}})}var z=e(t(),1),B={duration:.2,ease:`easeInOut`},V=c,H={duration:.14,ease:s},U=`blur(8px)`,W=`blur(3px)`,G=.025,ee={initial:{opacity:0,y:`105%`,filter:W},animate:(e=0)=>({opacity:1,y:`0%`,filter:`blur(0px)`,transition:{...c,delay:e}}),exit:(e=0)=>({opacity:0,y:`-105%`,filter:W,transition:{duration:.16,ease:s,delay:e*.5}})},te={blur:{initial:{opacity:0,scale:.94,filter:U},animate:{opacity:1,scale:1,filter:`blur(0px)`,transition:B},exit:{opacity:0,scale:.94,filter:U,transition:B}},roll:{initial:{opacity:0,y:`90%`,filter:W},animate:{opacity:1,y:`0%`,filter:`blur(0px)`,transition:V},exit:{opacity:0,y:`-90%`,filter:W,transition:H}}};function ne({value:e,children:t,animation:n=`blur`,className:a}){let s=i(),c=(0,z.useRef)(null),[u,d]=(0,z.useState)();(0,z.useLayoutEffect)(()=>{let e=c.current?.offsetWidth;e&&d(t=>t===e?t:e)});let f=typeof t==`string`?t:null,p=n===`cascade`&&f!==null&&!s,m=n===`cascade`?`roll`:n;return(0,L.jsxs)(`span`,{className:A(`relative inline-block overflow-hidden whitespace-nowrap align-bottom`,a),style:{width:u,transition:s?void 0:`width 220ms ${l}`},children:[(0,L.jsx)(`span`,{ref:c,"aria-hidden":!0,className:`invisible inline-block whitespace-nowrap`,children:t}),p?(0,L.jsx)(`span`,{className:`sr-only`,children:f}):null,(0,L.jsx)(r,{initial:!1,children:p?(0,L.jsx)(o.span,{"aria-hidden":!0,initial:`initial`,animate:`animate`,exit:`exit`,className:`absolute left-0 top-0 inline-block whitespace-pre`,children:f.split(``).map((e,t)=>(0,L.jsx)(o.span,{custom:t*G,variants:ee,className:`inline-block whitespace-pre`,children:e},t))},`cascade-${e}`):(0,L.jsx)(o.span,{variants:te[m],initial:!s&&`initial`,animate:s?{opacity:1,filter:`blur(0px)`,scale:1,y:0}:`animate`,exit:s?void 0:`exit`,className:`absolute left-0 top-0 inline-block`,children:t},`${n}-${e}`)})]})}function re(e){return(0,L.jsx)(ne,{...e,animation:`roll`})}function ie(e){let{open:t,defaultOpen:n,onOpenChange:r,disabled:i}=e,[a,o]=M({controlled:t,default:n,name:`Collapsible`,state:`open`}),{mounted:s,setMounted:c,transitionStatus:l}=D(a,!0,!0),u=k(),[d,f]=z.useState(),p=d===null?void 0:d??u,m=w(e=>{let t=!a,n=x(_,e.nativeEvent);r(t,n),!n.isCanceled&&o(t)});return z.useMemo(()=>({defaultPanelId:u,disabled:i,handleTrigger:m,mounted:s,open:a,panelId:p,setMounted:c,setOpen:o,setPanelIdState:f,transitionStatus:l}),[u,i,m,s,a,p,c,o,f,l])}var K=z.createContext(void 0);function q(){let e=z.useContext(K);if(e===void 0)throw Error(C(15));return e}var J=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=u.startingStyle]=`startingStyle`,e[e.endingStyle=u.endingStyle]=`endingStyle`,e}({}),ae=function(e){return e.panelOpen=`data-panel-open`,e}({}),oe={[J.open]:``},se={[J.closed]:``},ce={open(e){return e?{[ae.panelOpen]:``}:null}},Y={open(e){return e?oe:se},...m},le=z.forwardRef(function(e,t){let{render:n,className:r,defaultOpen:i=!1,disabled:a=!1,onOpenChange:o,open:s,style:c,...l}=e,u=w(o),d=ie({open:s,defaultOpen:i,onOpenChange:u,disabled:a}),f=z.useMemo(()=>({open:d.open,disabled:d.disabled,transitionStatus:d.transitionStatus}),[d.open,d.disabled,d.transitionStatus]),p=z.useMemo(()=>({...d,onOpenChange:u,state:f}),[d,u,f]),m=b(`div`,e,{state:f,ref:t,props:l,stateAttributesMapping:Y});return(0,L.jsx)(K.Provider,{value:p,children:m})}),ue={...ce,...m},de=z.forwardRef(function(e,t){let{panelId:n,open:r,handleTrigger:i,state:a,disabled:o}=q(),{className:s,disabled:c=o,render:l,nativeButton:u=!0,style:d,...f}=e,{getButtonProps:p,buttonRef:m}=E({disabled:c,focusableWhenDisabled:!0,native:u});return b(`button`,e,{state:a,ref:[t,m],props:[{"aria-controls":r?n:void 0,"aria-expanded":r,onClick:i},f,p],stateAttributesMapping:ue})}),X={height:void 0,width:void 0};function fe(e){let{externalRef:t,hiddenUntilFound:n,id:r,keepMounted:i,mounted:a,onOpenChange:o,open:s,setMounted:c,setOpen:l,transitionStatus:u}=e,m=z.useRef(null),g=z.useRef(null),[_,y]=z.useState(X),b=z.useRef(X),C=z.useRef(!1),E=z.useRef(s),D=z.useRef(!1),[k,A]=z.useState(!1),j=z.useRef(null),M=f(t,m),N=O(s),P=h(m),F=!s&&!a,I=k?`idle`:u,L=s&&(E.current||D.current),R=!s&&a&&g.current===`css-animation`&&_.height===void 0&&_.width===void 0?b.current:_,B=n&&F&&g.current!==`css-animation`,V=w((e,t=!0)=>{t&&(b.current=e),y(e)}),H=w(()=>{j.current?.(),j.current=null}),U=w(e=>{H(),j.current=()=>{j.current=null,e()}}),W=w(()=>{s&&a&&g.current===`css-animation`&&(D.current=!0)});v(()=>{!k||u===`starting`||A(!1)},[k,u]),z.useEffect(()=>()=>{W(),H()},[W,H]),v(()=>{let e=m.current;if(!e)return;!s&&j.current&&H();let t=pe(e,L);if(g.current=t,s&&u===`idle`&&E.current&&t===`css-animation`){b.current=Z(e);return}if(s&&u===`starting`){let n=C.current;if(C.current=!1,t===`none`){V(Z(e)),A(!0);return}if(t===`css-transition`){let t=me(e);if(V(Z(e)),!n)return t;let r=$(e,`transition-duration`,`0s`);return U(r),A(!0),t}V(Z(e));let r=$(e,`animation-name`,`none`);if(!n){r();return}let i=$(e,`animation-duration`,`0s`);r(),U(i),A(!0);return}if(!s&&a&&(u===`idle`||u===`starting`)){if(E.current=!1,D.current=!1,t===`none`){V(X,!1),c(!1);return}V(Z(e));return}if(u!==`ending`)return;if(t===`none`){c(!1);return}let n=Z(e);if(!(n.height>0||n.width>0)){c(!1);return}V(n),t===`css-animation`&&$(e,`animation-name`,`none`)()},[a,s,H,V,c,U,L,u]),T({enabled:s&&a&&I===`idle`,open:!0,ref:m,onComplete(){s&&V(X,!1)}}),z.useEffect(()=>{if(s||!a||I!==`ending`||!m.current)return;let e=new AbortController,t=-1;function n(){N.current||(c(!1),V(X,!1))}return t=p.request(()=>{P(n,e.signal)}),()=>{p.cancel(t),e.abort()}},[N,a,s,I,P,V,c]),v(()=>{let e=m.current;!e||!n||!F||e.setAttribute(`hidden`,`until-found`)},[F,n]),z.useEffect(function(){let e=m.current;if(!e)return;function t(e){let t=x(S,e);o(!0,t),!t.isCanceled&&(C.current=!0,l(!0))}return d(e,`beforematch`,t)},[o,l]);let G=i||n||a||s;return{height:R.height,props:{...B?{[J.startingStyle]:``}:void 0,hidden:F,id:r},ref:M,shouldPreventOpenAnimation:L,shouldRender:G,transitionStatus:I,width:R.width}}function Z(e){return{height:e.scrollHeight,width:e.scrollWidth}}function pe(e,t){let n=g(e).getComputedStyle(e),r=(n.animationName.split(`,`).map(e=>e.trim()).some(e=>e!==``&&e!==`none`)||t)&&Q(n.animationDuration),i=Q(n.transitionDuration);return r&&i||i?`css-transition`:r?`css-animation`:`none`}function Q(e){return e.split(`,`).map(e=>e.trim()).some(e=>e!==``&&Number.parseFloat(e)>0)}function $(e,t,n){let r=e.style.getPropertyValue(t),i=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{if(r===``){e.style.removeProperty(t);return}e.style.setProperty(t,r,i)}}function me(e){let t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(t=>{e.style.setProperty(t,`initial`,`important`)});function n(){Object.entries(t).forEach(([t,n])=>{if(n===``){e.style.removeProperty(t);return}e.style.setProperty(t,n)})}let r=p.request(n);return()=>{p.cancel(r),n()}}var he=function(e){return e.collapsiblePanelHeight=`--collapsible-panel-height`,e.collapsiblePanelWidth=`--collapsible-panel-width`,e}({}),ge=z.forwardRef(function(e,t){let{className:n,hiddenUntilFound:r,keepMounted:i,render:a,id:o,style:s,...c}=e,{defaultPanelId:l,mounted:u,onOpenChange:d,open:f,setMounted:p,setPanelIdState:m,setOpen:h,state:g,transitionStatus:_}=q(),x=r??!1,S=i??!1,C=o||void 0,w=C??l;v(()=>(m(e=>C??(e===null?void 0:e)),()=>{m(e=>e===C?null:e)}),[C,m]);let{height:T,props:E,ref:D,shouldPreventOpenAnimation:O,shouldRender:k,transitionStatus:A,width:j}=fe({externalRef:t,hiddenUntilFound:x,id:w,keepMounted:S,mounted:u,onOpenChange:d,open:f,setMounted:p,setOpen:h,transitionStatus:_}),M={...g,transitionStatus:A},N=y(s,M),P=b(`div`,{...e,style:void 0},{state:M,ref:D,props:[E,{style:{[he.collapsiblePanelHeight]:T===void 0?`auto`:`${T}px`,[he.collapsiblePanelWidth]:j===void 0?`auto`:`${j}px`}},c,N?{style:N}:void 0,O?{style:{animationName:`none`}}:void 0],stateAttributesMapping:Y});return k?P:null});function _e({...e}){return(0,L.jsx)(le,{"data-slot":`collapsible`,...e})}function ve({...e}){return(0,L.jsx)(de,{"data-slot":`collapsible-trigger`,...e})}function ye({...e}){return(0,L.jsx)(ge,{"data-slot":`collapsible-content`,...e})}export{R as a,P as c,re as i,N as l,ye as n,I as o,ve as r,F as s,_e as t};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/artifacts-panel-8TyrNBM_.js","assets/rolldown-runtime-hePW80VL.js","assets/bundle-mjs-DKHVkVWu.js","assets/jsx-runtime-NZYk81nU.js","assets/button-0At5xSyU.js","assets/react-dom-Bwxum3ti.js","assets/x-BgciQ7_C.js","assets/createLucideIcon-DwxZHm0M.js","assets/utils-Eg7xtNmV.js","assets/tool-result-QvhjpNGX.js","assets/workspace-path-nav-BrQHo6es.js","assets/layout-gyLzPvVv.js","assets/useControlled-CoY1jSuL.js","assets/chevron-down-BEVGmnSb.js","assets/loader-circle-6JG5RwxH.js","assets/collapsible-WCSnxhr2.js","assets/useBaseUiId-B9f7fokB.js","assets/rotate-ccw-WNFNkKQD.js","assets/preload-helper-Czpn1I53.js","assets/shared-DAI9OAw0.js","assets/file-text-BhQ0ZnoU.js","assets/package-CdcJFPf2.js","assets/plug-Dt6VN0zF.js","assets/chevron-right-DrJxToLs.js","assets/openui-renderer-NLUpAS3h.js","assets/dialog-DZ44tBtH.js","assets/provider-catalog-Gx9qaHBM.js","assets/input-Clyn18XG.js","assets/safe-external-url-Bl_78dpZ.js","assets/card-BKl76a3R.js","assets/chunk-BO2N2NFS-BnzHCiyQ.js","assets/lib-ChrQ49PO.js","assets/character-entities-legacy-Wut6vMuj.js","assets/chat-C64Sv6V-.js","assets/switch-ojzdMno9.js","assets/dist-MNgIFxqY.js","assets/markdown-BXWmNJo7.js","assets/cn-C8c0S2mI.js","assets/prime-agent-artifacts-k9JiTDZM.js","assets/workspace-panel-C67-fqw4.js","assets/horizontal-resize-B76jjn5v.js","assets/folder-BC5p7qK7.js","assets/hard-drive-CHqgr7VQ.js","assets/skeleton-loaders-qxIkJKCA.js","assets/skeleton-CkR2VmWc.js","assets/resources-panel-BWuKeyrb.js","assets/session-insights-panel-CPymkzZT.js"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./bundle-mjs-DKHVkVWu.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{a as r,n as i,o as a,r as o,t as s}from"./dialog-DZ44tBtH.js";import{t as c}from"./utils-Eg7xtNmV.js";import{t as l}from"./createLucideIcon-DwxZHm0M.js";import{n as u}from"./useControlled-CoY1jSuL.js";import{t as d}from"./folder-BC5p7qK7.js";import{t as f}from"./package-CdcJFPf2.js";import{c as p,n as m,o as h,t as g}from"./input-group-MxDAWX3j.js";import{t as _}from"./search-eWVnAJsb.js";import{t as v}from"./preload-helper-Czpn1I53.js";import{t as y}from"./skeleton-CkR2VmWc.js";import{S as b,T as x,h as S,i as C,n as w,r as T,t as E}from"./dist-MNgIFxqY.js";var D=l(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),O=l(`library`,[[`path`,{d:`m16 6 4 14`,key:`ji33uf`}],[`path`,{d:`M12 6v14`,key:`1n7gus`}],[`path`,{d:`M8 8v12`,key:`1gg7y9`}],[`path`,{d:`M4 4v16`,key:`6qkkli`}]]),k=l(`rotate-ccw-clock`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),A=l(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),j=e(t(),1),M=n(),N=(0,j.lazy)(()=>v(async()=>{let{ArtifactsPanelContent:e}=await import(`./artifacts-panel-8TyrNBM_.js`);return{ArtifactsPanelContent:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44])).then(({ArtifactsPanelContent:e})=>({default:e}))),P=(0,j.lazy)(()=>v(async()=>{let{ResourcesPanelContent:e}=await import(`./resources-panel-BWuKeyrb.js`);return{ResourcesPanelContent:e}},__vite__mapDeps([45,3,1,19,7,2,20,21,22,43,44,8])).then(({ResourcesPanelContent:e})=>({default:e}))),F=(0,j.lazy)(()=>v(async()=>{let{SessionInsightsPanel:e}=await import(`./session-insights-panel-CPymkzZT.js`);return{SessionInsightsPanel:e}},__vite__mapDeps([46,3,1])).then(({SessionInsightsPanel:e})=>({default:e}))),I=(0,j.lazy)(()=>v(async()=>{let{WorkspacePanelContent:e}=await import(`./workspace-panel-C67-fqw4.js`);return{WorkspacePanelContent:e}},__vite__mapDeps([39,1,2,3,10,11,8,19,7,20,21,22,23,40,41,42,36,18,30,5,31,37,43,44])).then(({WorkspacePanelContent:e})=>({default:e})));function L(){return(0,M.jsxs)(`div`,{className:`flex min-h-32 flex-col gap-3 p-4`,"aria-label":`Loading panel`,children:[(0,M.jsx)(y,{className:`h-5 w-32`}),(0,M.jsx)(y,{className:`h-20 w-full`})]})}function R(){let e=h();return(0,M.jsx)(j.Suspense,{fallback:(0,M.jsx)(L,{}),children:(0,M.jsx)(F,{activityLabel:e.activityLabel,artifactRuns:e.artifactRuns,chatMode:e.chatMode,messages:e.messages,planLabel:e.planLabel,presentation:e.presentation,queue:e.queue,selectedModelKey:e.selectedModelKey,sessionId:e.sessionId,status:e.status,thinkingLevel:e.thinkingLevel})})}function z(){let e=h(),t=p();return(0,M.jsx)(j.Suspense,{fallback:(0,M.jsx)(L,{}),children:(0,M.jsx)(P,{error:e.resourcesError,loading:e.resourcesLoading,resources:e.resources,workspace:t.workspaceTree})})}function B(){let e=p();return(0,M.jsx)(j.Suspense,{fallback:(0,M.jsx)(L,{}),children:(0,M.jsx)(I,{error:e.workspaceError,loadWorkspaceFile:e.loadWorkspaceFile,loading:e.workspaceLoading,onSelectedPathChange:e.setSelectedWorkspacePath,selectedPath:e.selectedWorkspacePath,workspace:e.workspaceTree})})}function ee(){let e=h(),t=p();return(0,M.jsx)(j.Suspense,{fallback:(0,M.jsx)(L,{}),children:(0,M.jsx)(N,{artifactRuns:e.artifactRuns,error:t.workspaceError,loadWorkspaceFile:t.loadWorkspaceFile,loading:t.workspaceLoading,messages:e.messages,onOpenUIAction:e.onOpenUIAction,onSelectedPathChange:t.setSelectedWorkspacePath,selectedArtifactId:e.selectedArtifactId,selectedPath:t.selectedWorkspacePath,status:e.status,workspace:t.workspaceTree})})}var te={resources:{id:`resources`,order:0,title:`Resources`,ariaLabel:`Resources`,commandLabel:`Open Resources`,commandKeywords:[`resources`,`skills`,`panels`],icon:O,dataTestid:`pi-resources-canvas`,mobileDataTestid:`pi-resources-mobile-panel`,badgeSource:`resources`,loadingSource:`resources`,refreshSource:`resources`,component:z},workspace:{id:`workspace`,order:1,title:`Workspace`,ariaLabel:`Workspace`,commandLabel:`Open Workspace`,commandKeywords:[`workspace`,`files`,`panels`],icon:d,dataTestid:`pi-workspace-canvas`,mobileDataTestid:`pi-workspace-mobile-panel`,badgeSource:void 0,loadingSource:`workspace`,refreshSource:`workspace`,component:B},artifacts:{id:`artifacts`,order:2,title:`Artifacts`,ariaLabel:`Workspace artifacts`,commandLabel:`Open Artifacts`,commandKeywords:[`artifacts`,`reports`,`datasets`,`panels`],icon:f,dataTestid:`pi-artifacts-canvas`,mobileDataTestid:`pi-artifacts-mobile-panel`,badgeSource:`artifacts`,loadingSource:`workspace`,refreshSource:`workspace`,component:ee},"session-insights":{id:`session-insights`,order:3,title:`Session insights`,ariaLabel:`Session insights`,commandLabel:`Open Session Insights`,commandKeywords:[`session`,`insights`,`activity`,`panels`],icon:D,dataTestid:`pi-session-insights-canvas`,mobileDataTestid:`pi-session-insights-mobile-panel`,badgeSource:void 0,loadingSource:void 0,refreshSource:void 0,component:R}},ne=Object.values(te).sort((e,t)=>e.order-t.order);function re(e){return te[e]}var ie=1,ae=.9,oe=.8,se=.17,V=.1,ce=.999,le=.9999,ue=.99,de=/[\\\/_+.#"@\[\(\{&]/,fe=/[\\\/_+.#"@\[\(\{&]/g,pe=/[\s-]/,me=/[\s-]/g;function H(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?ie:ue;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=H(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=ie:de.test(e.charAt(l-1))?(d*=oe,p=e.slice(i,l-1).match(fe),p&&i>0&&(d*=ce**+p.length)):pe.test(e.charAt(l-1))?(d*=ae,m=e.slice(i,l-1).match(me),m&&i>0&&(d*=ce**+m.length)):(d*=se,i>0&&(d*=ce**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=le)),(d<V&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=H(e,t,n,r,l+1,a+2,o),f*V>d&&(d=f*V)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function he(e){return e.toLowerCase().replace(me,` `)}function ge(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,H(e,t,he(e),he(t),0,0,{})}var U=`[cmdk-group=""]`,W=`[cmdk-group-items=""]`,_e=`[cmdk-group-heading=""]`,ve=`[cmdk-item=""]`,ye=`${ve}:not([aria-disabled="true"])`,G=`cmdk-item-select`,K=`data-value`,be=(e,t,n)=>ge(e,t,n),xe=j.createContext(void 0),q=()=>j.useContext(xe),Se=j.createContext(void 0),J=()=>j.useContext(Se),Ce=j.createContext(void 0),we=j.forwardRef((e,t)=>{let n=Z(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=Z(()=>new Set),i=Z(()=>new Map),a=Z(()=>new Map),o=Z(()=>new Set),s=Fe(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,..._}=e,v=b(),y=b(),x=b(),C=j.useRef(null),w=Le();X(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,T.emit()}},[u]),X(()=>{w(6,M)},[]);let T=j.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)A(),O(),w(1,k);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(x);e?e.focus():(i=document.getElementById(v))==null||i.focus()}if(w(7,()=>{n.current.selectedItemId=N()?.id,T.emit()}),r||w(5,M),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}T.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),E=j.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,D(t,r)),w(2,()=>{O(),T.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),w(3,()=>{A(),O(),n.current.value||k(),T.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=N();w(4,()=>{A(),t?.getAttribute(`id`)===e&&k(),T.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:v,inputId:x,labelId:y,listInnerRef:C}),[]);function D(e,t){let r=s.current?.filter??be;return e?r(e,n.current.search,t):0}function O(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=C.current;P().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(W);t?t.appendChild(e.parentElement===t?e:e.closest(`${W} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${W} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=C.current?.querySelector(`${U}[${K}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function k(){let e=P().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(K);T.setState(`value`,e||void 0)}function A(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=D(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function M(){var e;let t=N();t&&(t.parentElement?.firstChild===t&&((e=t.closest(U)?.querySelector(_e))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function N(){return C.current?.querySelector(`${ve}[aria-selected="true"]`)}function P(){return Array.from(C.current?.querySelectorAll(ye)||[])}function F(e){let t=P()[e];t&&T.setState(`value`,t.getAttribute(K))}function I(e){var t;let n=N(),r=P(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&T.setState(`value`,a.getAttribute(K))}function L(e){let t=N()?.closest(U),n;for(;t&&!n;)t=e>0?Ne(t,U):Pe(t,U),n=t?.querySelector(ye);n?T.setState(`value`,n.getAttribute(K)):I(e)}let R=()=>F(P().length-1),z=e=>{e.preventDefault(),e.metaKey?R():e.altKey?L(1):I(1)},B=e=>{e.preventDefault(),e.metaKey?F(0):e.altKey?L(-1):I(-1)};return j.createElement(S.div,{ref:t,tabIndex:-1,..._,"cmdk-root":``,onKeyDown:e=>{var t;(t=_.onKeyDown)==null||t.call(_,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:g&&e.ctrlKey&&z(e);break;case`ArrowDown`:z(e);break;case`p`:case`k`:g&&e.ctrlKey&&B(e);break;case`ArrowUp`:B(e);break;case`Home`:e.preventDefault(),F(0);break;case`End`:e.preventDefault(),R();break;case`Enter`:{e.preventDefault();let t=N();if(t){let e=new Event(G);t.dispatchEvent(e)}}}}},j.createElement(`label`,{"cmdk-label":``,htmlFor:E.inputId,id:E.labelId,style:ze},c),$(e,e=>j.createElement(Se.Provider,{value:T},j.createElement(xe.Provider,{value:E},e))))}),Te=j.forwardRef((e,t)=>{let n=b(),r=j.useRef(null),i=j.useContext(Ce),a=q(),o=Fe(e),s=o.current?.forceMount??i?.forceMount;X(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=Ie(n,r,[e.value,e.children,r],e.keywords),l=J(),u=Q(e=>e.value&&e.value===c.current),d=Q(e=>s||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);j.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(G,f),()=>t.removeEventListener(G,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;p(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function p(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:m,value:h,onSelect:g,forceMount:_,keywords:v,...y}=e;return j.createElement(S.div,{ref:x(r,t),...y,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!m,"aria-selected":!!u,"data-disabled":!!m,"data-selected":!!u,onPointerMove:m||a.getDisablePointerSelection()?void 0:p,onClick:m?void 0:f},e.children)}),Ee=j.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=b(),s=j.useRef(null),c=j.useRef(null),l=b(),u=q(),d=Q(e=>i||u.filter()===!1?!0:!e.search||e.filtered.groups.has(o));X(()=>u.group(o),[]),Ie(o,s,[e.value,e.heading,c]);let f=j.useMemo(()=>({id:o,forceMount:i}),[i]);return j.createElement(S.div,{ref:x(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:!d||void 0},n&&j.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),$(e,e=>j.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},j.createElement(Ce.Provider,{value:f},e))))}),De=j.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=j.useRef(null),a=Q(e=>!e.search);return!n&&!a?null:j.createElement(S.div,{ref:x(i,t),...r,"cmdk-separator":``,role:`separator`})}),Oe=j.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=J(),o=Q(e=>e.search),s=Q(e=>e.selectedItemId),c=q();return j.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),j.createElement(S.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),ke=j.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=j.useRef(null),o=j.useRef(null),s=Q(e=>e.selectedItemId),c=q();return j.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),j.createElement(S.div,{ref:x(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},$(e,e=>j.createElement(`div`,{ref:x(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),Ae=j.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return j.createElement(E,{open:n,onOpenChange:r},j.createElement(C,{container:o},j.createElement(T,{"cmdk-overlay":``,className:i}),j.createElement(w,{"aria-label":e.label,"cmdk-dialog":``,className:a},j.createElement(we,{ref:t,...s}))))}),je=j.forwardRef((e,t)=>Q(e=>e.filtered.count===0)?j.createElement(S.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),Me=j.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return j.createElement(S.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},$(e,e=>j.createElement(`div`,{"aria-hidden":!0},e)))}),Y=Object.assign(we,{List:ke,Item:Te,Input:Oe,Group:Ee,Separator:De,Dialog:Ae,Empty:je,Loading:Me});function Ne(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Pe(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Fe(e){let t=j.useRef(e);return X(()=>{t.current=e}),t}var X=typeof window>`u`?j.useEffect:j.useLayoutEffect;function Z(e){let t=j.useRef();return t.current===void 0&&(t.current=e()),t}function Q(e){let t=J(),n=()=>e(t.snapshot());return j.useSyncExternalStore(t.subscribe,n,n)}function Ie(e,t,n,r=[]){let i=j.useRef(),a=q();return X(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(K,s),i.current=s}),i}var Le=()=>{let[e,t]=j.useState(),n=Z(()=>new Map);return X(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function Re(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function $({asChild:e,children:t},n){return e&&j.isValidElement(t)?j.cloneElement(Re(t),{ref:t.ref},n(t.props.children)):n(t)}var ze={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function Be({className:e,...t}){return(0,M.jsx)(Y,{"data-slot":`command`,className:c(`flex size-full flex-col overflow-hidden !rounded-xl p-1 text-popover-foreground`,e),...t})}function Ve({title:e=`Command Palette`,description:t=`Search for a command to run...`,children:n,className:l,showCloseButton:u=!1,...d}){return(0,M.jsx)(s,{...d,children:(0,M.jsxs)(i,{className:c(`top-1/3 translate-y-0 overflow-hidden !rounded-xl p-0`,l),showCloseButton:u,children:[(0,M.jsxs)(r,{className:`sr-only`,children:[(0,M.jsx)(a,{children:e}),(0,M.jsx)(o,{children:t})]}),(0,M.jsx)(Be,{children:n})]})})}function He({className:e,...t}){return(0,M.jsx)(`div`,{"data-slot":`command-input-wrapper`,className:`p-1 pb-0`,children:(0,M.jsxs)(g,{className:`!h-8 !rounded-lg border-input/30 bg-input/30 !shadow-none *:data-[slot=input-group-addon]:!pl-2`,children:[(0,M.jsx)(Y.Input,{"data-slot":`command-input`,className:c(`w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,e),...t}),(0,M.jsx)(m,{children:(0,M.jsx)(_,{className:`size-4 shrink-0 opacity-50`})})]})})}function Ue({className:e,...t}){return(0,M.jsx)(Y.List,{"data-slot":`command-list`,className:c(`no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none`,e),...t})}function We({className:e,...t}){return(0,M.jsx)(Y.Empty,{"data-slot":`command-empty`,className:c(`py-6 text-center text-sm`,e),...t})}function Ge({className:e,...t}){return(0,M.jsx)(Y.Group,{"data-slot":`command-group`,className:c(`overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground`,e),...t})}function Ke({className:e,...t}){return(0,M.jsx)(Y.Separator,{"data-slot":`command-separator`,className:c(`-mx-1 h-px bg-border`,e),...t})}function qe({className:e,children:t,...n}){return(0,M.jsxs)(Y.Item,{"data-slot":`command-item`,className:c(`group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:!rounded-lg data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground`,e),...n,children:[t,(0,M.jsx)(u,{className:`ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100`})]})}export{He as a,Ke as c,A as d,k as f,Ge as i,ne as l,Ve as n,qe as o,O as p,We as r,Ue as s,Be as t,re as u};