@qredence/fleet 0.6.2 → 0.6.3
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 +6 -0
- package/dist/web/client/assets/DialogTitle-DiAm7YNe.js +1 -0
- package/dist/web/client/assets/alert-dialog-CYE37KMM.js +1 -0
- package/dist/web/client/assets/{artifacts-panel-DmQghvw8.js → artifacts-panel-ClDpGWOU.js} +1 -1
- package/dist/web/client/assets/{chat-C24kD2SP.js → chat-BVMnC5Qh.js} +1 -1
- package/dist/web/client/assets/{chat-command-palette-BIwjhE6s.js → chat-command-palette-YuyaJNbi.js} +1 -1
- package/dist/web/client/assets/{citations-BUvM92nt.js → citations-DXqV2NLy.js} +1 -1
- package/dist/web/client/assets/command-Cw4X8Bpk.js +1 -0
- package/dist/web/client/assets/dialog-BzcIOvFC.js +1 -0
- package/dist/web/client/assets/{fork-picker-dialog-CpwEwsxA.js → fork-picker-dialog-BYRr-xTy.js} +1 -1
- package/dist/web/client/assets/git-branch-CTq9aACS.js +1 -0
- package/dist/web/client/assets/globals-BtCXZXL_.css +2 -0
- package/dist/web/client/assets/{index-BGnQeUYE.js → index-B9aXxpOv.js} +2 -2
- package/dist/web/client/assets/{model-selector-list-CRZCXeBf.js → model-selector-list-CHD8lMAl.js} +1 -1
- package/dist/web/client/assets/{openui-renderer-Bkkx5kmA.js → openui-renderer-C4e9FOVR.js} +8 -8
- package/dist/web/client/assets/provider-catalog-ClVvphe0.js +1 -0
- package/dist/web/client/assets/provider-label-CwZ-KDxk.js +1 -0
- package/dist/web/client/assets/right-panel-registry-BnYCffmM.js +2 -0
- package/dist/web/client/assets/routes-DUontXSG.js +16 -0
- package/dist/web/client/assets/{session-tool-renderer-3E3cv8D0.js → session-tool-renderer-Bd3dsE2D.js} +3 -3
- package/dist/web/client/assets/session-tree-panel-CM4_wwrM.js +1 -0
- package/dist/web/client/assets/settings-dialog-DMTD9m6z.js +2 -0
- package/dist/web/client/assets/sparkles-BY5MFyk6.js +1 -0
- package/dist/web/client/assets/{subagent-chat-panel-C5ukYiUx.js → subagent-chat-panel-BESrXxAR.js} +1 -1
- package/dist/web/client/assets/{subagent-transcript-lqNcSVbH.js → subagent-transcript-CAqFJfMj.js} +1 -1
- package/dist/web/client/assets/{subagents-panel-SJKhaVTr.js → subagents-panel-8aKOwWLs.js} +1 -1
- package/dist/web/client/assets/{virtualized-turn-list-BgUgX6tM.js → virtualized-turn-list-mL3ONUUA.js} +3 -3
- package/dist/web/client/bundle-budget.json +6 -6
- package/dist/web/server/{_tanstack-start-manifest_v-BDPifIFN-DTSNCHBX.js → _tanstack-start-manifest_v-Cm8xE-Rb-TMLYN3GY.js} +15 -13
- package/dist/web/server/{artifacts-panel-BN3DgqfV-N73J6N5Y.js → artifacts-panel-CwLVBqyi-CDORJY75.js} +21 -20
- package/dist/web/server/{chat-command-palette-G8awyZRw-2QE7FXGT.js → chat-command-palette-DUha04ia-5OV7WVJZ.js} +11 -9
- package/dist/web/server/{chunk-ZOVXMNJM.js → chunk-3Q3QKLHC.js} +5 -96
- package/dist/web/server/{chunk-6SOMNRAX.js → chunk-ADYZWC5L.js} +12 -12
- package/dist/web/server/{chunk-CW6KZUKT.js → chunk-B2LF64HM.js} +1 -1
- package/dist/web/server/{chunk-YMPJMHXZ.js → chunk-DP26GVWH.js} +3 -2
- package/dist/web/server/chunk-ETCO5KZK.js +113 -0
- package/dist/web/server/{chunk-ENGEUJIH.js → chunk-FMAYMBRS.js} +22 -20
- package/dist/web/server/{chunk-WB2LJC3R.js → chunk-FTLJ66KU.js} +4 -4
- package/dist/web/server/{chunk-OSMP55KI.js → chunk-H5D5DX3K.js} +1 -20
- package/dist/web/server/chunk-HGVJEUV4.js +102 -0
- package/dist/web/server/{chunk-FT74GAAH.js → chunk-KZ35W5M7.js} +27 -27
- package/dist/web/server/{chunk-CCYLHNZJ.js → chunk-O2IC376F.js} +46 -3
- package/dist/web/server/chunk-OMPXUTMX.js +33 -0
- package/dist/web/server/{chunk-BUXJSBE3.js → chunk-RJNGEU6C.js} +1 -1
- package/dist/web/server/{chunk-O2UYZT3Z.js → chunk-T2UTBHJ4.js} +48 -4
- package/dist/web/server/{chunk-NMBH57JT.js → chunk-TU2WNRAL.js} +6 -6
- package/dist/web/server/{chunk-JPDRUSUD.js → chunk-UM3RHJNZ.js} +1 -1
- package/dist/web/server/{chunk-4OTHKQMG.js → chunk-V5IFFLZQ.js} +4 -4
- package/dist/web/server/{chunk-EDAWH2MT.js → chunk-XEG4JTND.js} +2 -2
- package/dist/web/server/{chunk-NCK2FJAD.js → chunk-XSOUURPF.js} +2 -2
- package/dist/web/server/{chunk-ESM7OCRL.js → chunk-YCCF676T.js} +3 -3
- package/dist/web/server/{chunk-JVOW2NWC.js → chunk-YDDDSVNB.js} +7 -100
- package/dist/web/server/{fork-picker-dialog-YKlapaxN-DR5L74ST.js → fork-picker-dialog-DeMiLZtS-WTRTTP64.js} +4 -3
- package/dist/web/server/{message-queue-Demph1x4-RBJUC3AT.js → message-queue-Demph1x4-GGXJUUKO.js} +4 -4
- package/dist/web/server/{model-selector-list-BmzLiCx9-TK6JGGKU.js → model-selector-list-BeGQHwKV-UJYFO4KX.js} +9 -8
- package/dist/web/server/{openui-renderer-moJGf0LA-QCU3PI6H.js → openui-renderer-B4z18Brm-HSMKJ47D.js} +13 -12
- package/dist/web/server/{router-CPdFlpbe-LAD4MNZB.js → router-DfG45nTQ-3VXEUYG5.js} +278 -56
- package/dist/web/server/{routes-hkom6S6L-DUPPQHPY.js → routes-B9F9UfF1-UN2IVBMJ.js} +271 -117
- package/dist/web/server/server.js +2 -2
- package/dist/web/server/{session-tool-renderer-CglQ2ky7-2JVYNZG2.js → session-tool-renderer-CT65wuet-RQBMXHEZ.js} +11 -10
- package/dist/web/server/session-tree-panel-rS0t1wbf-HNA6AJBY.js +229 -0
- package/dist/web/server/{settings-dialog-BCEfmgtP-T3WQEZHB.js → settings-dialog-CqkrDSnm-LFEKSS7Y.js} +38 -34
- package/dist/web/server/{subagent-chat-panel-BTwI1kdB-LKBWA4GD.js → subagent-chat-panel-Cf7QdDqH-DPPSVLSY.js} +18 -17
- package/dist/web/server/{subagents-panel-8Z9_csoV-HYMEEBHB.js → subagents-panel-_JsUw-6t-MZWM5P45.js} +18 -17
- package/package.json +1 -1
- package/dist/web/client/assets/command-Dv96gATQ.js +0 -1
- package/dist/web/client/assets/dialog-BCb4rQh0.js +0 -1
- package/dist/web/client/assets/globals-DCtBkCSD.css +0 -2
- package/dist/web/client/assets/provider-catalog-C0XBIasJ.js +0 -1
- package/dist/web/client/assets/provider-label-Cka0ep0S.js +0 -1
- package/dist/web/client/assets/right-panel-registry-BCW7fQTG.js +0 -2
- package/dist/web/client/assets/routes-BWe5Iz-2.js +0 -16
- package/dist/web/client/assets/settings-dialog-B8lHq2tT.js +0 -2
- package/dist/web/client/assets/sparkles-D8XIY8pN.js +0 -1
- package/dist/web/server/{chunk-43S5N7SH.js → chunk-5RTGRTPD.js} +3 -3
- package/dist/web/server/{chunk-OMEDERPG.js → chunk-S2IBIJIG.js} +3 -3
- package/dist/web/server/{chunk-IXGLKAPN.js → chunk-TR2GA5OF.js} +3 -3
- package/dist/web/server/{workspace-panel-BHEB9nRM-TS62SYBA.js → workspace-panel-BHEB9nRM-Y6KGIVGP.js} +2 -2
|
@@ -1,32 +1,33 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SessionToolRenderer,
|
|
3
3
|
session_tool_renderer_exports
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FMAYMBRS.js";
|
|
5
|
+
import "./chunk-V3S6BVXO.js";
|
|
5
6
|
import "./chunk-2ST2ULW7.js";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-XSOUURPF.js";
|
|
8
|
+
import "./chunk-RXUMFFUV.js";
|
|
9
|
+
import "./chunk-H5D5DX3K.js";
|
|
8
10
|
import "./chunk-XA42CHF2.js";
|
|
9
11
|
import "./chunk-7NZ3FJDA.js";
|
|
12
|
+
import "./chunk-OMPXUTMX.js";
|
|
10
13
|
import "./chunk-JIULUYHT.js";
|
|
11
|
-
import "./chunk-V3S6BVXO.js";
|
|
12
|
-
import "./chunk-RXUMFFUV.js";
|
|
13
14
|
import "./chunk-LY5XOHHU.js";
|
|
14
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-S2IBIJIG.js";
|
|
16
|
+
import "./chunk-UE32PAV2.js";
|
|
15
17
|
import "./chunk-WU6X3GPJ.js";
|
|
16
18
|
import "./chunk-OOXWPL22.js";
|
|
17
19
|
import "./chunk-TNL4YV63.js";
|
|
18
20
|
import "./chunk-O2DUZJYK.js";
|
|
19
21
|
import "./chunk-CAPTFJOC.js";
|
|
20
|
-
import "./chunk-3C4CFCIS.js";
|
|
21
22
|
import "./chunk-K6PTNSCW.js";
|
|
23
|
+
import "./chunk-3C4CFCIS.js";
|
|
22
24
|
import "./chunk-7FK6YEMA.js";
|
|
23
25
|
import "./chunk-7E76R7MB.js";
|
|
24
|
-
import "./chunk-UE32PAV2.js";
|
|
25
26
|
import "./chunk-BQROC4PL.js";
|
|
26
|
-
import "./chunk-4QD4PCVP.js";
|
|
27
|
-
import "./chunk-JBLHIEVG.js";
|
|
28
27
|
import "./chunk-WWJF4RO2.js";
|
|
28
|
+
import "./chunk-4QD4PCVP.js";
|
|
29
29
|
import "./chunk-OVJYUWSQ.js";
|
|
30
|
+
import "./chunk-JBLHIEVG.js";
|
|
30
31
|
import "./chunk-E5HALE4M.js";
|
|
31
32
|
import "./chunk-XJ6TGSUB.js";
|
|
32
33
|
import "./chunk-ST5I2PLN.js";
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AlertDialog,
|
|
3
|
+
AlertDialogCancel,
|
|
4
|
+
AlertDialogContent,
|
|
5
|
+
AlertDialogDescription,
|
|
6
|
+
AlertDialogFooter,
|
|
7
|
+
AlertDialogTitle
|
|
8
|
+
} from "./chunk-HGVJEUV4.js";
|
|
9
|
+
import {
|
|
10
|
+
GitBranch
|
|
11
|
+
} from "./chunk-OMPXUTMX.js";
|
|
12
|
+
import "./chunk-YDDDSVNB.js";
|
|
13
|
+
import {
|
|
14
|
+
Button
|
|
15
|
+
} from "./chunk-HQ5TEXHT.js";
|
|
16
|
+
import "./chunk-TLNZNR7C.js";
|
|
17
|
+
import "./chunk-E5HALE4M.js";
|
|
18
|
+
import "./chunk-XJ6TGSUB.js";
|
|
19
|
+
import "./chunk-4ZIEVI5O.js";
|
|
20
|
+
import {
|
|
21
|
+
cn
|
|
22
|
+
} from "./chunk-CHEC7TWB.js";
|
|
23
|
+
import "./chunk-JDCCC7A7.js";
|
|
24
|
+
import "./chunk-L547YHC4.js";
|
|
25
|
+
import "./chunk-MLKGABMK.js";
|
|
26
|
+
|
|
27
|
+
// web/app/dist/server/assets/session-tree-panel-rS0t1wbf.js
|
|
28
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
29
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
30
|
+
function flattenVisibleNodes(nodes, depth = 0) {
|
|
31
|
+
const rows = [];
|
|
32
|
+
for (const node of nodes) {
|
|
33
|
+
rows.push({
|
|
34
|
+
node,
|
|
35
|
+
depth
|
|
36
|
+
});
|
|
37
|
+
rows.push(...flattenVisibleNodes(node.children, depth + 1));
|
|
38
|
+
}
|
|
39
|
+
return rows;
|
|
40
|
+
}
|
|
41
|
+
function SessionTreeRow({ depth, isSelected, node, onSelect }) {
|
|
42
|
+
return /* @__PURE__ */ jsxs(Button, {
|
|
43
|
+
type: "button",
|
|
44
|
+
variant: "ghost",
|
|
45
|
+
"data-testid": `session-tree-node-${node.id}`,
|
|
46
|
+
onClick: onSelect,
|
|
47
|
+
className: cn("h-auto w-full flex-col items-start gap-0.5 rounded-md px-2 py-1.5 text-left font-normal", isSelected ? "bg-foreground/10 ring-1 ring-foreground/15" : "hover:bg-foreground/6", node.isOnActiveBranch ? "text-foreground/90" : "text-foreground/55"),
|
|
48
|
+
style: {
|
|
49
|
+
marginLeft: `${depth * 12}px`,
|
|
50
|
+
width: `calc(100% - ${depth * 12}px)`
|
|
51
|
+
},
|
|
52
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
53
|
+
className: "flex items-center gap-1.5 text-label leading-5",
|
|
54
|
+
children: [node.isLeaf ? /* @__PURE__ */ jsx("span", {
|
|
55
|
+
"aria-hidden": "true",
|
|
56
|
+
className: "font-semibold text-foreground",
|
|
57
|
+
children: "*"
|
|
58
|
+
}) : null, /* @__PURE__ */ jsx("span", {
|
|
59
|
+
className: "truncate font-medium",
|
|
60
|
+
children: node.preview
|
|
61
|
+
})]
|
|
62
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
63
|
+
className: "truncate font-mono text-caption text-foreground/40",
|
|
64
|
+
children: node.id
|
|
65
|
+
})]
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
function SessionTreePanel({ sessionId, snapshot, loading, error, isStreaming, selectedEntryId, onSelectEntry, onRefresh, onRewind }) {
|
|
69
|
+
const [confirmEntryId, setConfirmEntryId] = useState(null);
|
|
70
|
+
const [confirmExpectedLeafId, setConfirmExpectedLeafId] = useState(null);
|
|
71
|
+
const [confirming, setConfirming] = useState(false);
|
|
72
|
+
const [confirmError, setConfirmError] = useState(null);
|
|
73
|
+
const confirmGenerationRef = useRef(0);
|
|
74
|
+
const rows = useMemo(() => snapshot ? flattenVisibleNodes(snapshot.nodes) : [], [snapshot]);
|
|
75
|
+
const selectedNode = useMemo(() => rows.find((row) => row.node.id === selectedEntryId)?.node, [rows, selectedEntryId]);
|
|
76
|
+
const canRewind = Boolean(selectedNode && snapshot && selectedEntryId && selectedEntryId !== snapshot.leafId && !isStreaming);
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
if (confirmEntryId === null || confirming || confirmError === null) return;
|
|
79
|
+
const nextLeaf = snapshot?.leafId ?? null;
|
|
80
|
+
if (nextLeaf === confirmExpectedLeafId) return;
|
|
81
|
+
setConfirmExpectedLeafId(nextLeaf);
|
|
82
|
+
}, [
|
|
83
|
+
confirmEntryId,
|
|
84
|
+
confirming,
|
|
85
|
+
confirmError,
|
|
86
|
+
confirmExpectedLeafId,
|
|
87
|
+
snapshot?.leafId
|
|
88
|
+
]);
|
|
89
|
+
const resolveMessageId = useCallback((node) => {
|
|
90
|
+
if (!sessionId || node.messageIndex === void 0) return void 0;
|
|
91
|
+
return `${sessionId}-m${node.messageIndex}`;
|
|
92
|
+
}, [sessionId]);
|
|
93
|
+
const clearConfirm = useCallback(() => {
|
|
94
|
+
confirmGenerationRef.current += 1;
|
|
95
|
+
setConfirmEntryId(null);
|
|
96
|
+
setConfirmExpectedLeafId(null);
|
|
97
|
+
setConfirmError(null);
|
|
98
|
+
setConfirming(false);
|
|
99
|
+
}, []);
|
|
100
|
+
useEffect(() => {
|
|
101
|
+
clearConfirm();
|
|
102
|
+
}, [sessionId, clearConfirm]);
|
|
103
|
+
const handleConfirmRewind = useCallback(async () => {
|
|
104
|
+
const entryId = confirmEntryId;
|
|
105
|
+
const leafId = confirmExpectedLeafId;
|
|
106
|
+
if (!entryId) return;
|
|
107
|
+
const generation = ++confirmGenerationRef.current;
|
|
108
|
+
const isCurrent = () => confirmGenerationRef.current === generation;
|
|
109
|
+
setConfirming(true);
|
|
110
|
+
setConfirmError(null);
|
|
111
|
+
try {
|
|
112
|
+
await onRewind(entryId, leafId);
|
|
113
|
+
if (isCurrent()) clearConfirm();
|
|
114
|
+
} catch (caught) {
|
|
115
|
+
if (isCurrent()) setConfirmError(caught instanceof Error ? caught.message : String(caught));
|
|
116
|
+
} finally {
|
|
117
|
+
if (isCurrent()) setConfirming(false);
|
|
118
|
+
}
|
|
119
|
+
}, [
|
|
120
|
+
clearConfirm,
|
|
121
|
+
confirmEntryId,
|
|
122
|
+
confirmExpectedLeafId,
|
|
123
|
+
onRewind
|
|
124
|
+
]);
|
|
125
|
+
const openConfirm = useCallback((entryId) => {
|
|
126
|
+
setConfirmError(null);
|
|
127
|
+
setConfirmEntryId(entryId);
|
|
128
|
+
setConfirmExpectedLeafId(snapshot?.leafId ?? null);
|
|
129
|
+
}, [snapshot?.leafId]);
|
|
130
|
+
if (!sessionId) return /* @__PURE__ */ jsx("section", {
|
|
131
|
+
"aria-label": "Session tree",
|
|
132
|
+
className: "flex min-h-36 items-center rounded-md border border-dashed border-border/70 px-4 text-center text-label leading-5 text-foreground/45",
|
|
133
|
+
children: "Start or open a session to browse its branch history."
|
|
134
|
+
});
|
|
135
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
136
|
+
"aria-label": "Session tree",
|
|
137
|
+
className: "flex min-h-0 flex-1 flex-col gap-3",
|
|
138
|
+
children: [
|
|
139
|
+
/* @__PURE__ */ jsxs("div", {
|
|
140
|
+
className: "flex items-center justify-between gap-2",
|
|
141
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
142
|
+
className: "flex items-center gap-2 text-label text-foreground/70",
|
|
143
|
+
children: [/* @__PURE__ */ jsx(GitBranch, {
|
|
144
|
+
className: "size-4",
|
|
145
|
+
"aria-hidden": "true"
|
|
146
|
+
}), /* @__PURE__ */ jsx("span", { children: "Branch history" })]
|
|
147
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
148
|
+
type: "button",
|
|
149
|
+
size: "sm",
|
|
150
|
+
variant: "outline",
|
|
151
|
+
onClick: onRefresh,
|
|
152
|
+
disabled: loading,
|
|
153
|
+
children: "Refresh"
|
|
154
|
+
})]
|
|
155
|
+
}),
|
|
156
|
+
error ? /* @__PURE__ */ jsx("p", {
|
|
157
|
+
className: "rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-label text-destructive",
|
|
158
|
+
children: error
|
|
159
|
+
}) : null,
|
|
160
|
+
isStreaming ? /* @__PURE__ */ jsx("p", {
|
|
161
|
+
className: "rounded-md border border-border/60 bg-background px-3 py-2 text-label text-foreground/60",
|
|
162
|
+
children: "Finish or stop the current turn before rewinding."
|
|
163
|
+
}) : null,
|
|
164
|
+
/* @__PURE__ */ jsxs("div", {
|
|
165
|
+
"data-testid": "session-tree-list",
|
|
166
|
+
className: "flex min-h-0 flex-1 flex-col gap-1 overflow-y-auto rounded-md border border-border/60 bg-background p-2",
|
|
167
|
+
children: [
|
|
168
|
+
loading && rows.length === 0 ? /* @__PURE__ */ jsx("p", {
|
|
169
|
+
className: "px-2 py-3 text-label text-foreground/45",
|
|
170
|
+
children: "Loading session tree\u2026"
|
|
171
|
+
}) : null,
|
|
172
|
+
!loading && rows.length === 0 ? /* @__PURE__ */ jsx("p", {
|
|
173
|
+
className: "px-2 py-3 text-label text-foreground/45",
|
|
174
|
+
children: "No branch entries yet."
|
|
175
|
+
}) : null,
|
|
176
|
+
rows.map(({ node, depth }) => /* @__PURE__ */ jsx(SessionTreeRow, {
|
|
177
|
+
depth,
|
|
178
|
+
node,
|
|
179
|
+
isSelected: node.id === selectedEntryId,
|
|
180
|
+
onSelect: () => onSelectEntry(node.id, resolveMessageId(node))
|
|
181
|
+
}, node.id))
|
|
182
|
+
]
|
|
183
|
+
}),
|
|
184
|
+
/* @__PURE__ */ jsxs("div", {
|
|
185
|
+
className: "flex items-center justify-between gap-2",
|
|
186
|
+
children: [/* @__PURE__ */ jsxs("p", {
|
|
187
|
+
className: "text-caption text-foreground/45",
|
|
188
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
189
|
+
"aria-hidden": "true",
|
|
190
|
+
children: "*"
|
|
191
|
+
}), " marks the current leaf on the active branch."]
|
|
192
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
193
|
+
type: "button",
|
|
194
|
+
size: "sm",
|
|
195
|
+
disabled: !canRewind,
|
|
196
|
+
onClick: () => selectedEntryId && openConfirm(selectedEntryId),
|
|
197
|
+
children: "Rewind here"
|
|
198
|
+
})]
|
|
199
|
+
}),
|
|
200
|
+
/* @__PURE__ */ jsx(AlertDialog, {
|
|
201
|
+
open: confirmEntryId !== null,
|
|
202
|
+
onOpenChange: (open) => {
|
|
203
|
+
if (!open && !confirming) clearConfirm();
|
|
204
|
+
},
|
|
205
|
+
children: /* @__PURE__ */ jsxs(AlertDialogContent, { children: [
|
|
206
|
+
/* @__PURE__ */ jsx(AlertDialogTitle, { children: "Rewind session?" }),
|
|
207
|
+
/* @__PURE__ */ jsx(AlertDialogDescription, { children: "Later turns on the current branch leave the active session. Rewinding to a user turn follows Prime Agent edit-from-here semantics: the leaf moves to that message's parent so you can resend from there." }),
|
|
208
|
+
confirmError ? /* @__PURE__ */ jsx("p", {
|
|
209
|
+
className: "rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-label text-destructive",
|
|
210
|
+
children: confirmError
|
|
211
|
+
}) : null,
|
|
212
|
+
/* @__PURE__ */ jsxs(AlertDialogFooter, { children: [/* @__PURE__ */ jsx(AlertDialogCancel, {
|
|
213
|
+
disabled: confirming,
|
|
214
|
+
children: "Cancel"
|
|
215
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
216
|
+
type: "button",
|
|
217
|
+
variant: "destructive",
|
|
218
|
+
disabled: confirming,
|
|
219
|
+
onClick: () => void handleConfirmRewind(),
|
|
220
|
+
children: confirming ? "Rewinding\u2026" : "Rewind"
|
|
221
|
+
})] })
|
|
222
|
+
] })
|
|
223
|
+
})
|
|
224
|
+
]
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
export {
|
|
228
|
+
SessionTreePanel
|
|
229
|
+
};
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isModelPatternEnabled,
|
|
3
|
+
modelMatchesPattern,
|
|
4
|
+
modelPattern
|
|
5
|
+
} from "./chunk-WTYNN6EV.js";
|
|
1
6
|
import {
|
|
2
7
|
Keyboard,
|
|
3
8
|
Monitor,
|
|
@@ -5,13 +10,6 @@ import {
|
|
|
5
10
|
Sun
|
|
6
11
|
} from "./chunk-LJ6Y7DBH.js";
|
|
7
12
|
import {
|
|
8
|
-
AlertDialog,
|
|
9
|
-
AlertDialogAction,
|
|
10
|
-
AlertDialogCancel,
|
|
11
|
-
AlertDialogContent,
|
|
12
|
-
AlertDialogDescription,
|
|
13
|
-
AlertDialogFooter,
|
|
14
|
-
AlertDialogTitle,
|
|
15
13
|
ArrowLeft,
|
|
16
14
|
Cpu,
|
|
17
15
|
PROVIDER_METADATA,
|
|
@@ -20,7 +18,12 @@ import {
|
|
|
20
18
|
Spinner,
|
|
21
19
|
Trash2,
|
|
22
20
|
formatProviderLabel
|
|
23
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-3Q3QKLHC.js";
|
|
22
|
+
import {
|
|
23
|
+
applyUiPreferencesToDocument,
|
|
24
|
+
readUiPreferences,
|
|
25
|
+
writeUiPreferences
|
|
26
|
+
} from "./chunk-4EBSM4JR.js";
|
|
24
27
|
import {
|
|
25
28
|
Pencil
|
|
26
29
|
} from "./chunk-M5RSPNYN.js";
|
|
@@ -35,26 +38,16 @@ import {
|
|
|
35
38
|
useChatPanelDataContext,
|
|
36
39
|
useSettingsActionsContext
|
|
37
40
|
} from "./chunk-33QA7BQJ.js";
|
|
38
|
-
import {
|
|
39
|
-
isModelPatternEnabled,
|
|
40
|
-
modelMatchesPattern,
|
|
41
|
-
modelPattern
|
|
42
|
-
} from "./chunk-WTYNN6EV.js";
|
|
43
|
-
import {
|
|
44
|
-
applyUiPreferencesToDocument,
|
|
45
|
-
readUiPreferences,
|
|
46
|
-
writeUiPreferences
|
|
47
|
-
} from "./chunk-4EBSM4JR.js";
|
|
48
41
|
import {
|
|
49
42
|
RefreshCw
|
|
50
43
|
} from "./chunk-OKL5ZRVB.js";
|
|
51
44
|
import {
|
|
52
45
|
notify
|
|
53
|
-
} from "./chunk-
|
|
54
|
-
import "./chunk-UCA4WN66.js";
|
|
46
|
+
} from "./chunk-RJNGEU6C.js";
|
|
55
47
|
import {
|
|
56
48
|
Info
|
|
57
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-TR2GA5OF.js";
|
|
50
|
+
import "./chunk-UCA4WN66.js";
|
|
58
51
|
import {
|
|
59
52
|
Eye
|
|
60
53
|
} from "./chunk-2ST2ULW7.js";
|
|
@@ -62,18 +55,28 @@ import {
|
|
|
62
55
|
ExternalLink,
|
|
63
56
|
Globe,
|
|
64
57
|
Sparkles
|
|
65
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-H5D5DX3K.js";
|
|
66
59
|
import {
|
|
67
60
|
HardDrive
|
|
68
61
|
} from "./chunk-D7ELZVTI.js";
|
|
69
62
|
import "./chunk-SZJUXVWG.js";
|
|
63
|
+
import {
|
|
64
|
+
AlertDialog,
|
|
65
|
+
AlertDialogAction,
|
|
66
|
+
AlertDialogCancel,
|
|
67
|
+
AlertDialogContent,
|
|
68
|
+
AlertDialogDescription,
|
|
69
|
+
AlertDialogFooter,
|
|
70
|
+
AlertDialogTitle
|
|
71
|
+
} from "./chunk-HGVJEUV4.js";
|
|
72
|
+
import "./chunk-OMPXUTMX.js";
|
|
70
73
|
import {
|
|
71
74
|
InputGroup,
|
|
72
75
|
InputGroupAddon,
|
|
73
76
|
InputGroupButton,
|
|
74
77
|
InputGroupInput,
|
|
75
78
|
Textarea
|
|
76
|
-
} from "./chunk-
|
|
79
|
+
} from "./chunk-B2LF64HM.js";
|
|
77
80
|
import {
|
|
78
81
|
Search
|
|
79
82
|
} from "./chunk-JIULUYHT.js";
|
|
@@ -94,7 +97,7 @@ import {
|
|
|
94
97
|
FieldGroup,
|
|
95
98
|
FieldLabel,
|
|
96
99
|
Switch
|
|
97
|
-
} from "./chunk-
|
|
100
|
+
} from "./chunk-FTLJ66KU.js";
|
|
98
101
|
import {
|
|
99
102
|
Select,
|
|
100
103
|
clamp,
|
|
@@ -102,22 +105,29 @@ import {
|
|
|
102
105
|
styleDisableScrollbar,
|
|
103
106
|
useCSPContext,
|
|
104
107
|
useDirection
|
|
105
|
-
} from "./chunk-
|
|
108
|
+
} from "./chunk-ADYZWC5L.js";
|
|
106
109
|
import {
|
|
107
110
|
isCustomProviderId,
|
|
108
111
|
isNamedOccInstanceId,
|
|
109
112
|
isOccProviderId
|
|
110
113
|
} from "./chunk-RJOANOT4.js";
|
|
114
|
+
import "./chunk-WWJF4RO2.js";
|
|
111
115
|
import {
|
|
112
116
|
Input
|
|
113
|
-
} from "./chunk-
|
|
117
|
+
} from "./chunk-5RTGRTPD.js";
|
|
114
118
|
import {
|
|
115
119
|
Dialog,
|
|
116
120
|
DialogContent,
|
|
117
121
|
DialogDescription,
|
|
118
122
|
DialogHeader,
|
|
119
123
|
DialogTitle
|
|
120
|
-
} from "./chunk-
|
|
124
|
+
} from "./chunk-ETCO5KZK.js";
|
|
125
|
+
import {
|
|
126
|
+
Check
|
|
127
|
+
} from "./chunk-4QD4PCVP.js";
|
|
128
|
+
import "./chunk-OVJYUWSQ.js";
|
|
129
|
+
import "./chunk-JBLHIEVG.js";
|
|
130
|
+
import "./chunk-YDDDSVNB.js";
|
|
121
131
|
import {
|
|
122
132
|
Button,
|
|
123
133
|
contains,
|
|
@@ -126,12 +136,6 @@ import {
|
|
|
126
136
|
webkit
|
|
127
137
|
} from "./chunk-HQ5TEXHT.js";
|
|
128
138
|
import "./chunk-TLNZNR7C.js";
|
|
129
|
-
import {
|
|
130
|
-
Check
|
|
131
|
-
} from "./chunk-4QD4PCVP.js";
|
|
132
|
-
import "./chunk-JBLHIEVG.js";
|
|
133
|
-
import "./chunk-WWJF4RO2.js";
|
|
134
|
-
import "./chunk-OVJYUWSQ.js";
|
|
135
139
|
import {
|
|
136
140
|
useBaseUiId
|
|
137
141
|
} from "./chunk-E5HALE4M.js";
|
|
@@ -156,7 +160,7 @@ import "./chunk-JDCCC7A7.js";
|
|
|
156
160
|
import "./chunk-L547YHC4.js";
|
|
157
161
|
import "./chunk-MLKGABMK.js";
|
|
158
162
|
|
|
159
|
-
// web/app/dist/server/assets/settings-dialog-
|
|
163
|
+
// web/app/dist/server/assets/settings-dialog-CqkrDSnm.js
|
|
160
164
|
import * as React$1 from "react";
|
|
161
165
|
import { useCallback, useEffect as useEffect2, useId, useMemo as useMemo2, useRef as useRef2, useState as useState2 } from "react";
|
|
162
166
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -4,43 +4,44 @@ import {
|
|
|
4
4
|
import "./chunk-7CNGNFFK.js";
|
|
5
5
|
import {
|
|
6
6
|
SubagentTranscriptView
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-TU2WNRAL.js";
|
|
8
|
+
import "./chunk-V5IFFLZQ.js";
|
|
9
9
|
import "./chunk-OKL5ZRVB.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-RJNGEU6C.js";
|
|
11
|
+
import "./chunk-TR2GA5OF.js";
|
|
11
12
|
import "./chunk-UCA4WN66.js";
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-FMAYMBRS.js";
|
|
14
|
+
import "./chunk-V3S6BVXO.js";
|
|
14
15
|
import "./chunk-2ST2ULW7.js";
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-XSOUURPF.js";
|
|
17
|
+
import "./chunk-RXUMFFUV.js";
|
|
18
|
+
import "./chunk-H5D5DX3K.js";
|
|
17
19
|
import "./chunk-UDD5W4CR.js";
|
|
18
20
|
import "./chunk-XA42CHF2.js";
|
|
19
21
|
import "./chunk-7NZ3FJDA.js";
|
|
22
|
+
import "./chunk-OMPXUTMX.js";
|
|
20
23
|
import "./chunk-JIULUYHT.js";
|
|
21
|
-
import "./chunk-V3S6BVXO.js";
|
|
22
|
-
import "./chunk-RXUMFFUV.js";
|
|
23
24
|
import "./chunk-LY5XOHHU.js";
|
|
24
25
|
import "./chunk-ZNFXBGLK.js";
|
|
25
|
-
import "./chunk-
|
|
26
|
+
import "./chunk-S2IBIJIG.js";
|
|
27
|
+
import "./chunk-UE32PAV2.js";
|
|
26
28
|
import "./chunk-WU6X3GPJ.js";
|
|
27
29
|
import "./chunk-OOXWPL22.js";
|
|
28
30
|
import "./chunk-TNL4YV63.js";
|
|
29
31
|
import "./chunk-O2DUZJYK.js";
|
|
30
32
|
import "./chunk-CAPTFJOC.js";
|
|
31
|
-
import "./chunk-3C4CFCIS.js";
|
|
32
33
|
import "./chunk-K6PTNSCW.js";
|
|
34
|
+
import "./chunk-3C4CFCIS.js";
|
|
33
35
|
import "./chunk-7FK6YEMA.js";
|
|
34
36
|
import "./chunk-7E76R7MB.js";
|
|
35
|
-
import "./chunk-UE32PAV2.js";
|
|
36
37
|
import "./chunk-NFRJDPB3.js";
|
|
37
38
|
import "./chunk-BQROC4PL.js";
|
|
38
|
-
import "./chunk-HQ5TEXHT.js";
|
|
39
|
-
import "./chunk-TLNZNR7C.js";
|
|
40
|
-
import "./chunk-4QD4PCVP.js";
|
|
41
|
-
import "./chunk-JBLHIEVG.js";
|
|
42
39
|
import "./chunk-WWJF4RO2.js";
|
|
40
|
+
import "./chunk-4QD4PCVP.js";
|
|
43
41
|
import "./chunk-OVJYUWSQ.js";
|
|
42
|
+
import "./chunk-JBLHIEVG.js";
|
|
43
|
+
import "./chunk-HQ5TEXHT.js";
|
|
44
|
+
import "./chunk-TLNZNR7C.js";
|
|
44
45
|
import "./chunk-E5HALE4M.js";
|
|
45
46
|
import "./chunk-XJ6TGSUB.js";
|
|
46
47
|
import "./chunk-ST5I2PLN.js";
|
|
@@ -55,7 +56,7 @@ import "./chunk-JDCCC7A7.js";
|
|
|
55
56
|
import "./chunk-L547YHC4.js";
|
|
56
57
|
import "./chunk-MLKGABMK.js";
|
|
57
58
|
|
|
58
|
-
// web/app/dist/server/assets/subagent-chat-panel-
|
|
59
|
+
// web/app/dist/server/assets/subagent-chat-panel-Cf7QdDqH.js
|
|
59
60
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
60
61
|
function SubagentComposer({ disabled, sending, onSend, onStop, placeholder = "Message this subagent\u2026 (Enter to steer)" }) {
|
|
61
62
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -1,51 +1,52 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SubagentTranscriptView
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TU2WNRAL.js";
|
|
4
4
|
import {
|
|
5
5
|
orderedRlmChildren,
|
|
6
6
|
rlmStatusIcon
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-V5IFFLZQ.js";
|
|
8
8
|
import "./chunk-OKL5ZRVB.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-RJNGEU6C.js";
|
|
10
|
+
import "./chunk-TR2GA5OF.js";
|
|
10
11
|
import {
|
|
11
12
|
Bot
|
|
12
13
|
} from "./chunk-UCA4WN66.js";
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-FMAYMBRS.js";
|
|
15
|
+
import "./chunk-V3S6BVXO.js";
|
|
15
16
|
import "./chunk-2ST2ULW7.js";
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-XSOUURPF.js";
|
|
18
|
+
import "./chunk-RXUMFFUV.js";
|
|
19
|
+
import "./chunk-H5D5DX3K.js";
|
|
18
20
|
import "./chunk-UDD5W4CR.js";
|
|
19
21
|
import "./chunk-XA42CHF2.js";
|
|
20
22
|
import "./chunk-7NZ3FJDA.js";
|
|
23
|
+
import "./chunk-OMPXUTMX.js";
|
|
21
24
|
import "./chunk-JIULUYHT.js";
|
|
22
|
-
import "./chunk-V3S6BVXO.js";
|
|
23
|
-
import "./chunk-RXUMFFUV.js";
|
|
24
25
|
import "./chunk-LY5XOHHU.js";
|
|
25
26
|
import "./chunk-ZNFXBGLK.js";
|
|
26
|
-
import "./chunk-
|
|
27
|
+
import "./chunk-S2IBIJIG.js";
|
|
28
|
+
import "./chunk-UE32PAV2.js";
|
|
27
29
|
import "./chunk-WU6X3GPJ.js";
|
|
28
30
|
import "./chunk-OOXWPL22.js";
|
|
29
31
|
import "./chunk-TNL4YV63.js";
|
|
30
32
|
import "./chunk-O2DUZJYK.js";
|
|
31
33
|
import "./chunk-CAPTFJOC.js";
|
|
34
|
+
import "./chunk-K6PTNSCW.js";
|
|
32
35
|
import {
|
|
33
36
|
ChevronRight
|
|
34
37
|
} from "./chunk-3C4CFCIS.js";
|
|
35
|
-
import "./chunk-K6PTNSCW.js";
|
|
36
38
|
import "./chunk-7FK6YEMA.js";
|
|
37
39
|
import "./chunk-7E76R7MB.js";
|
|
38
|
-
import "./chunk-UE32PAV2.js";
|
|
39
40
|
import "./chunk-NFRJDPB3.js";
|
|
40
41
|
import "./chunk-BQROC4PL.js";
|
|
42
|
+
import "./chunk-WWJF4RO2.js";
|
|
43
|
+
import "./chunk-4QD4PCVP.js";
|
|
44
|
+
import "./chunk-OVJYUWSQ.js";
|
|
45
|
+
import "./chunk-JBLHIEVG.js";
|
|
41
46
|
import {
|
|
42
47
|
Button
|
|
43
48
|
} from "./chunk-HQ5TEXHT.js";
|
|
44
49
|
import "./chunk-TLNZNR7C.js";
|
|
45
|
-
import "./chunk-4QD4PCVP.js";
|
|
46
|
-
import "./chunk-JBLHIEVG.js";
|
|
47
|
-
import "./chunk-WWJF4RO2.js";
|
|
48
|
-
import "./chunk-OVJYUWSQ.js";
|
|
49
50
|
import "./chunk-E5HALE4M.js";
|
|
50
51
|
import "./chunk-XJ6TGSUB.js";
|
|
51
52
|
import "./chunk-ST5I2PLN.js";
|
|
@@ -62,7 +63,7 @@ import "./chunk-JDCCC7A7.js";
|
|
|
62
63
|
import "./chunk-L547YHC4.js";
|
|
63
64
|
import "./chunk-MLKGABMK.js";
|
|
64
65
|
|
|
65
|
-
// web/app/dist/server/assets/subagents-panel-
|
|
66
|
+
// web/app/dist/server/assets/subagents-panel-_JsUw-6t.js
|
|
66
67
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
67
68
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
68
69
|
function SubagentsPanelContent({ agents, loadSession, onOpenTab, parentSessionId, tree }) {
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-CwJFpaho.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{t as r}from"./utils-Brtgag-m.js";import{a as i,n as a,o,r as s,t as c}from"./dialog-BCb4rQh0.js";import{t as l}from"./check-B3LlvM65.js";import{t as u}from"./search-BjcXAUrI.js";import{T as d,g as f,i as p,m,n as h,r as g,t as _}from"./dist-DbHxXSgQ.js";import{n as v,t as y}from"./input-group-D7lAfKHR.js";var b=1,x=.9,S=.8,C=.17,w=.1,T=.999,E=.9999,D=.99,O=/[\\\/_+.#"@\[\(\{&]/,k=/[\\\/_+.#"@\[\(\{&]/g,A=/[\s-]/,j=/[\s-]/g;function M(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?b:D;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=M(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=b:O.test(e.charAt(l-1))?(d*=S,p=e.slice(i,l-1).match(k),p&&i>0&&(d*=T**+p.length)):A.test(e.charAt(l-1))?(d*=x,m=e.slice(i,l-1).match(j),m&&i>0&&(d*=T**+m.length)):(d*=C,i>0&&(d*=T**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=E)),(d<w&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=M(e,t,n,r,l+1,a+2,o),f*w>d&&(d=f*w)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function N(e){return e.toLowerCase().replace(j,` `)}function P(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,M(e,t,N(e),N(t),0,0,{})}var F=e(t(),1),I=`[cmdk-group=""]`,L=`[cmdk-group-items=""]`,ee=`[cmdk-group-heading=""]`,R=`[cmdk-item=""]`,z=`${R}:not([aria-disabled="true"])`,B=`cmdk-item-select`,V=`data-value`,te=(e,t,n)=>P(e,t,n),ne=F.createContext(void 0),H=()=>F.useContext(ne),U=F.createContext(void 0),W=()=>F.useContext(U),G=F.createContext(void 0),K=F.forwardRef((e,t)=>{let n=X(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=X(()=>new Set),i=X(()=>new Map),a=X(()=>new Map),o=X(()=>new Set),s=fe(e),{label:c,children:l,value:u,onValueChange:d,filter:p,shouldFilter:h,loop:g,disablePointerSelection:_=!1,vimBindings:v=!0,...y}=e,b=m(),x=m(),S=m(),C=F.useRef(null),w=me();Y(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,T.emit()}},[u]),Y(()=>{w(6,j)},[]);let T=F.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(S);e?e.focus():(i=document.getElementById(b))==null||i.focus()}if(w(7,()=>{n.current.selectedItemId=M()?.id,T.emit()}),r||w(5,j),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=F.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=M();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:b,inputId:S,labelId:x,listInnerRef:C}),[]);function D(e,t){let r=s.current?.filter??te;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;N().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(L);t?t.appendChild(e.parentElement===t?e:e.closest(`${L} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${L} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=C.current?.querySelector(`${I}[${V}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function k(){let e=N().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(V);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 j(){var e;let t=M();t&&(t.parentElement?.firstChild===t&&((e=t.closest(I)?.querySelector(ee))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function M(){return C.current?.querySelector(`${R}[aria-selected="true"]`)}function N(){return Array.from(C.current?.querySelectorAll(z)||[])}function P(e){let t=N()[e];t&&T.setState(`value`,t.getAttribute(V))}function H(e){var t;let n=M(),r=N(),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(V))}function W(e){let t=M()?.closest(I),n;for(;t&&!n;)t=e>0?ue(t,I):de(t,I),n=t?.querySelector(z);n?T.setState(`value`,n.getAttribute(V)):H(e)}let G=()=>P(N().length-1),K=e=>{e.preventDefault(),e.metaKey?G():e.altKey?W(1):H(1)},q=e=>{e.preventDefault(),e.metaKey?P(0):e.altKey?W(-1):H(-1)};return F.createElement(f.div,{ref:t,tabIndex:-1,...y,"cmdk-root":``,onKeyDown:e=>{var t;(t=y.onKeyDown)==null||t.call(y,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:v&&e.ctrlKey&&K(e);break;case`ArrowDown`:K(e);break;case`p`:case`k`:v&&e.ctrlKey&&q(e);break;case`ArrowUp`:q(e);break;case`Home`:e.preventDefault(),P(0);break;case`End`:e.preventDefault(),G();break;case`Enter`:{e.preventDefault();let t=M();if(t){let e=new Event(B);t.dispatchEvent(e)}}}}},F.createElement(`label`,{"cmdk-label":``,htmlFor:E.inputId,id:E.labelId,style:ge},c),Q(e,e=>F.createElement(U.Provider,{value:T},F.createElement(ne.Provider,{value:E},e))))}),q=F.forwardRef((e,t)=>{let n=m(),r=F.useRef(null),i=F.useContext(G),a=H(),o=fe(e),s=o.current?.forceMount??i?.forceMount;Y(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=pe(n,r,[e.value,e.children,r],e.keywords),l=W(),u=Z(e=>e.value&&e.value===c.current),p=Z(e=>s||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);F.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(B,h),()=>t.removeEventListener(B,h)},[p,e.onSelect,e.disabled]);function h(){var e,t;g(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function g(){l.setState(`value`,c.current,!0)}if(!p)return null;let{disabled:_,value:v,onSelect:y,forceMount:b,keywords:x,...S}=e;return F.createElement(f.div,{ref:d(r,t),...S,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!_,"aria-selected":!!u,"data-disabled":!!_,"data-selected":!!u,onPointerMove:_||a.getDisablePointerSelection()?void 0:g,onClick:_?void 0:h},e.children)}),re=F.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=m(),s=F.useRef(null),c=F.useRef(null),l=m(),u=H(),p=Z(e=>i||u.filter()===!1?!0:!e.search||e.filtered.groups.has(o));Y(()=>u.group(o),[]),pe(o,s,[e.value,e.heading,c]);let h=F.useMemo(()=>({id:o,forceMount:i}),[i]);return F.createElement(f.div,{ref:d(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:!p||void 0},n&&F.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),Q(e,e=>F.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},F.createElement(G.Provider,{value:h},e))))}),ie=F.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=F.useRef(null),a=Z(e=>!e.search);return!n&&!a?null:F.createElement(f.div,{ref:d(i,t),...r,"cmdk-separator":``,role:`separator`})}),ae=F.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=W(),o=Z(e=>e.search),s=Z(e=>e.selectedItemId),c=H();return F.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),F.createElement(f.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)}})}),oe=F.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=F.useRef(null),o=F.useRef(null),s=Z(e=>e.selectedItemId),c=H();return F.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)}}},[]),F.createElement(f.div,{ref:d(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},Q(e,e=>F.createElement(`div`,{ref:d(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),se=F.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return F.createElement(_,{open:n,onOpenChange:r},F.createElement(p,{container:o},F.createElement(g,{"cmdk-overlay":``,className:i}),F.createElement(h,{"aria-label":e.label,"cmdk-dialog":``,className:a},F.createElement(K,{ref:t,...s}))))}),ce=F.forwardRef((e,t)=>Z(e=>e.filtered.count===0)?F.createElement(f.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),le=F.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return F.createElement(f.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},Q(e,e=>F.createElement(`div`,{"aria-hidden":!0},e)))}),J=Object.assign(K,{List:oe,Item:q,Input:ae,Group:re,Separator:ie,Dialog:se,Empty:ce,Loading:le});function ue(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function de(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function fe(e){let t=F.useRef(e);return Y(()=>{t.current=e}),t}var Y=typeof window>`u`?F.useEffect:F.useLayoutEffect;function X(e){let t=F.useRef();return t.current===void 0&&(t.current=e()),t}function Z(e){let t=W(),n=()=>e(t.snapshot());return F.useSyncExternalStore(t.subscribe,n,n)}function pe(e,t,n,r=[]){let i=F.useRef(),a=H();return Y(()=>{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(V,s),i.current=s}),i}var me=()=>{let[e,t]=F.useState(),n=X(()=>new Map);return Y(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function he(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function Q({asChild:e,children:t},n){return e&&F.isValidElement(t)?F.cloneElement(he(t),{ref:t.ref},n(t.props.children)):n(t)}var ge={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},$=n();function _e({className:e,...t}){return(0,$.jsx)(J,{"data-slot":`command`,className:r(`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,$.jsx)(c,{...d,children:(0,$.jsxs)(a,{className:r(`top-1/3 translate-y-0 overflow-hidden !rounded-xl p-0`,l),showCloseButton:u,children:[(0,$.jsxs)(i,{className:`sr-only`,children:[(0,$.jsx)(o,{children:e}),(0,$.jsx)(s,{children:t})]}),(0,$.jsx)(_e,{children:n})]})})}function ye({className:e,...t}){return(0,$.jsx)(`div`,{"data-slot":`command-input-wrapper`,className:`p-1 pb-0`,children:(0,$.jsxs)(y,{className:`!h-8 !rounded-lg border-input/30 bg-input/30 !shadow-none *:data-[slot=input-group-addon]:!pl-2`,children:[(0,$.jsx)(J.Input,{"data-slot":`command-input`,className:r(`w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,e),...t}),(0,$.jsx)(v,{children:(0,$.jsx)(u,{className:`size-4 shrink-0 opacity-50`})})]})})}function be({className:e,...t}){return(0,$.jsx)(J.List,{"data-slot":`command-list`,className:r(`no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none`,e),...t})}function xe({className:e,...t}){return(0,$.jsx)(J.Empty,{"data-slot":`command-empty`,className:r(`py-6 text-center text-sm`,e),...t})}function Se({className:e,...t}){return(0,$.jsx)(J.Group,{"data-slot":`command-group`,className:r(`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 Ce({className:e,...t}){return(0,$.jsx)(J.Separator,{"data-slot":`command-separator`,className:r(`-mx-1 h-px bg-border`,e),...t})}function we({className:e,children:t,...n}){return(0,$.jsxs)(J.Item,{"data-slot":`command-item`,className:r(`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,$.jsx)(l,{className:`ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100`})]})}export{ye as a,Ce as c,Se as i,ve as n,we as o,xe as r,be as s,_e as t};
|