@invergent/agent-chat-react 2.15.6 → 2.15.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +120 -170
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +120 -170
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -10458,7 +10458,7 @@ function SessionPaneCard({
|
|
|
10458
10458
|
// and cancelling the bottom from a className leaves both rules live,
|
|
10459
10459
|
// and which corner wins comes down to stylesheet order rather than
|
|
10460
10460
|
// intent -- which is how the stacked cards kept round bottoms.
|
|
10461
|
-
"flex w-full items-center gap-3 border
|
|
10461
|
+
"flex w-full items-center gap-3 border px-3 pt-3.5 pb-5 text-left transition-colors hover:border-t-3 hover:border-r-3 hover:border-l-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
10462
10462
|
className
|
|
10463
10463
|
),
|
|
10464
10464
|
children: [
|
|
@@ -13032,7 +13032,7 @@ function ChatThread({
|
|
|
13032
13032
|
subtitle: paneCards.browser.subtitle,
|
|
13033
13033
|
thumbnail: paneCards.browser.thumbnail,
|
|
13034
13034
|
onOpen: paneCards.browser.onOpen,
|
|
13035
|
-
className: "w-auto rounded-t-xl border-b-0 -mb-
|
|
13035
|
+
className: "w-auto rounded-t-xl border-input border-[2px] border-b-0 -mb-[10px]"
|
|
13036
13036
|
}
|
|
13037
13037
|
),
|
|
13038
13038
|
paneCards.files && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -13045,14 +13045,14 @@ function ChatThread({
|
|
|
13045
13045
|
count: paneCards.files.count,
|
|
13046
13046
|
expanded: paneCards.files.open,
|
|
13047
13047
|
onOpen: paneCards.files.onToggle,
|
|
13048
|
-
className: "w-auto rounded-t-xl border-b-0 -mb-
|
|
13048
|
+
className: "w-auto rounded-t-xl border-input border-[2px] border-b-0 -mb-[10px]"
|
|
13049
13049
|
}
|
|
13050
13050
|
),
|
|
13051
13051
|
paneCards.files.open && /* @__PURE__ */ jsxRuntime.jsx(
|
|
13052
13052
|
"div",
|
|
13053
13053
|
{
|
|
13054
13054
|
"data-testid": "files-accordion",
|
|
13055
|
-
className: "-mb-
|
|
13055
|
+
className: "-mb-[10px] flex h-72 min-h-0 flex-col overflow-hidden border border-b-0 border-line",
|
|
13056
13056
|
children: paneCards.files.panel
|
|
13057
13057
|
}
|
|
13058
13058
|
)
|
|
@@ -18769,7 +18769,7 @@ function FileTree({
|
|
|
18769
18769
|
return /* @__PURE__ */ jsxRuntime.jsx(FileTreeContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
18770
18770
|
"div",
|
|
18771
18771
|
{
|
|
18772
|
-
className: cn("rounded-lg border
|
|
18772
|
+
className: cn("rounded-lg border text-base", className),
|
|
18773
18773
|
role: "tree",
|
|
18774
18774
|
...props,
|
|
18775
18775
|
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-2", children })
|
|
@@ -18893,9 +18893,6 @@ function FileTreeFile({
|
|
|
18893
18893
|
);
|
|
18894
18894
|
}
|
|
18895
18895
|
var SKELETON_WIDTHS2 = [75, 60, 90, 65, 80, 70, 85, 55];
|
|
18896
|
-
var DEFAULT_WIDTH2 = 400;
|
|
18897
|
-
var MIN_WIDTH = 300;
|
|
18898
|
-
var MAX_WIDTH = 900;
|
|
18899
18896
|
function collectExpandedPaths(entries, depth = 0) {
|
|
18900
18897
|
const paths = [];
|
|
18901
18898
|
for (const entry of entries) {
|
|
@@ -19006,8 +19003,7 @@ function WorkspacePanel({
|
|
|
19006
19003
|
onSelectedPathChange,
|
|
19007
19004
|
onOpenFile,
|
|
19008
19005
|
refreshSignal = 0,
|
|
19009
|
-
disabled = false
|
|
19010
|
-
fillParent = false
|
|
19006
|
+
disabled = false
|
|
19011
19007
|
}) {
|
|
19012
19008
|
const fileInputRef = react.useRef(null);
|
|
19013
19009
|
const [entries, setEntries] = react.useState([]);
|
|
@@ -19017,12 +19013,7 @@ function WorkspacePanel({
|
|
|
19017
19013
|
const [uploading, setUploading] = react.useState(false);
|
|
19018
19014
|
const [deleteTarget, setDeleteTarget] = react.useState(null);
|
|
19019
19015
|
const [expandedPaths, setExpandedPaths] = react.useState(/* @__PURE__ */ new Set());
|
|
19020
|
-
const [width, setWidth] = react.useState(DEFAULT_WIDTH2);
|
|
19021
|
-
const narrow = useIsMobile();
|
|
19022
19016
|
const sessionIdRef = react.useRef(sessionId);
|
|
19023
|
-
const isResizing = react.useRef(false);
|
|
19024
|
-
const startX = react.useRef(0);
|
|
19025
|
-
const startWidth = react.useRef(DEFAULT_WIDTH2);
|
|
19026
19017
|
sessionIdRef.current = sessionId;
|
|
19027
19018
|
const fetchTree = react.useCallback(async () => {
|
|
19028
19019
|
if (!sessionId) {
|
|
@@ -19141,171 +19132,131 @@ function WorkspacePanel({
|
|
|
19141
19132
|
sessionId
|
|
19142
19133
|
]
|
|
19143
19134
|
);
|
|
19144
|
-
|
|
19145
|
-
|
|
19146
|
-
|
|
19147
|
-
|
|
19148
|
-
|
|
19149
|
-
|
|
19150
|
-
|
|
19151
|
-
|
|
19152
|
-
|
|
19153
|
-
|
|
19154
|
-
|
|
19155
|
-
|
|
19156
|
-
|
|
19157
|
-
|
|
19158
|
-
|
|
19159
|
-
|
|
19160
|
-
|
|
19161
|
-
|
|
19162
|
-
|
|
19163
|
-
|
|
19164
|
-
|
|
19165
|
-
isResizing.current = false;
|
|
19166
|
-
document.body.style.cursor = "";
|
|
19167
|
-
document.body.style.userSelect = "";
|
|
19168
|
-
};
|
|
19169
|
-
window.addEventListener("mousemove", onMouseMove);
|
|
19170
|
-
window.addEventListener("mouseup", onMouseUp);
|
|
19171
|
-
return () => {
|
|
19172
|
-
window.removeEventListener("mousemove", onMouseMove);
|
|
19173
|
-
window.removeEventListener("mouseup", onMouseUp);
|
|
19174
|
-
};
|
|
19175
|
-
}, []);
|
|
19176
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
19177
|
-
"aside",
|
|
19178
|
-
{
|
|
19179
|
-
"data-testid": "workspace-panel",
|
|
19180
|
-
className: cn(
|
|
19181
|
-
"relative z-10 flex h-full min-h-0 flex-col overflow-hidden bg-card",
|
|
19182
|
-
// Filling a parent means the parent draws the frame; a border
|
|
19183
|
-
// here would double against it.
|
|
19184
|
-
!fillParent && "border-l border-muted-foreground/20",
|
|
19185
|
-
(fillParent || narrow) && "w-full"
|
|
19186
|
-
),
|
|
19187
|
-
style: fillParent || narrow ? void 0 : { width, minWidth: MIN_WIDTH, maxWidth: MAX_WIDTH },
|
|
19188
|
-
children: [
|
|
19189
|
-
!(fillParent || narrow) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
19190
|
-
"div",
|
|
19191
|
-
{
|
|
19192
|
-
className: "absolute inset-y-0 left-0 z-20 w-1.5 cursor-col-resize transition-colors hover:bg-primary/20 active:bg-primary/30",
|
|
19193
|
-
onMouseDown: onResizeStart
|
|
19194
|
-
}
|
|
19195
|
-
),
|
|
19196
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
19197
|
-
"input",
|
|
19198
|
-
{
|
|
19199
|
-
ref: fileInputRef,
|
|
19200
|
-
type: "file",
|
|
19201
|
-
multiple: true,
|
|
19202
|
-
className: "hidden",
|
|
19203
|
-
disabled,
|
|
19204
|
-
onChange: (event) => {
|
|
19205
|
-
if (event.target.files) void handleUpload(event.target.files);
|
|
19206
|
-
}
|
|
19207
|
-
}
|
|
19208
|
-
),
|
|
19209
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-end gap-2 border-b border-line px-3 py-1.5", children: [
|
|
19210
|
-
/* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
|
|
19211
|
-
/* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
19212
|
-
Button,
|
|
19213
|
-
{
|
|
19214
|
-
variant: "ghost",
|
|
19215
|
-
size: "icon-sm",
|
|
19216
|
-
onClick: () => fileInputRef.current?.click(),
|
|
19217
|
-
disabled: disabled || !sessionId || uploading,
|
|
19218
|
-
"aria-label": "Upload files",
|
|
19219
|
-
children: uploading ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2Icon, { className: "size-4 animate-spin" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.UploadIcon, { className: "size-4" })
|
|
19135
|
+
return (
|
|
19136
|
+
// Always fills its parent: the panel is the body of the Files
|
|
19137
|
+
// accordion, which owns the frame and the height. The side-drawer
|
|
19138
|
+
// it used to be — resize handle, min/max width, its own left
|
|
19139
|
+
// border — went away with the drawer.
|
|
19140
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
19141
|
+
"aside",
|
|
19142
|
+
{
|
|
19143
|
+
"data-testid": "workspace-panel",
|
|
19144
|
+
className: "relative z-10 flex h-full border-input border-[2px] pb-[10px] border-b-0 min-h-0 w-full flex-col overflow-hidden",
|
|
19145
|
+
children: [
|
|
19146
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
19147
|
+
"input",
|
|
19148
|
+
{
|
|
19149
|
+
ref: fileInputRef,
|
|
19150
|
+
type: "file",
|
|
19151
|
+
multiple: true,
|
|
19152
|
+
className: "hidden",
|
|
19153
|
+
disabled,
|
|
19154
|
+
onChange: (event) => {
|
|
19155
|
+
if (event.target.files) void handleUpload(event.target.files);
|
|
19220
19156
|
}
|
|
19221
|
-
|
|
19222
|
-
|
|
19157
|
+
}
|
|
19158
|
+
),
|
|
19159
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-end gap-2 border-b border-line px-3 py-1.5", children: [
|
|
19160
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
|
|
19161
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
19162
|
+
Button,
|
|
19163
|
+
{
|
|
19164
|
+
variant: "ghost",
|
|
19165
|
+
size: "icon-sm",
|
|
19166
|
+
onClick: () => fileInputRef.current?.click(),
|
|
19167
|
+
disabled: disabled || !sessionId || uploading,
|
|
19168
|
+
"aria-label": "Upload files",
|
|
19169
|
+
children: uploading ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2Icon, { className: "size-4 animate-spin" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.UploadIcon, { className: "size-4" })
|
|
19170
|
+
}
|
|
19171
|
+
) }),
|
|
19172
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { side: "bottom", children: "Upload files" })
|
|
19173
|
+
] }),
|
|
19174
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
|
|
19175
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
19176
|
+
Button,
|
|
19177
|
+
{
|
|
19178
|
+
variant: "ghost",
|
|
19179
|
+
size: "icon-sm",
|
|
19180
|
+
onClick: () => void fetchTree(),
|
|
19181
|
+
disabled: !sessionId || treeLoading,
|
|
19182
|
+
"aria-label": "Refresh workspace",
|
|
19183
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
19184
|
+
lucideReact.RefreshCwIcon,
|
|
19185
|
+
{
|
|
19186
|
+
className: cn("size-4", treeLoading && "animate-spin")
|
|
19187
|
+
}
|
|
19188
|
+
)
|
|
19189
|
+
}
|
|
19190
|
+
) }),
|
|
19191
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { side: "bottom", children: "Refresh" })
|
|
19192
|
+
] })
|
|
19223
19193
|
] }),
|
|
19224
|
-
/* @__PURE__ */ jsxRuntime.
|
|
19225
|
-
|
|
19226
|
-
|
|
19194
|
+
notice && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-b border-line px-3 py-2 text-xs text-muted-foreground", children: notice }),
|
|
19195
|
+
/* @__PURE__ */ jsxRuntime.jsx(ScrollArea, { className: "min-h-0 flex-1", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-1 py-1", children: [
|
|
19196
|
+
treeLoading && entries.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-1 p-2", children: Array.from({ length: 8 }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
19197
|
+
Skeleton,
|
|
19227
19198
|
{
|
|
19228
|
-
|
|
19229
|
-
|
|
19230
|
-
|
|
19231
|
-
|
|
19232
|
-
|
|
19199
|
+
className: "h-5 rounded",
|
|
19200
|
+
style: {
|
|
19201
|
+
width: `${SKELETON_WIDTHS2[index % SKELETON_WIDTHS2.length]}%`
|
|
19202
|
+
}
|
|
19203
|
+
},
|
|
19204
|
+
index
|
|
19205
|
+
)) }),
|
|
19206
|
+
treeError && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-2 p-3 text-sm text-destructive", children: [
|
|
19207
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircleIcon, { className: "mt-0.5 size-4 shrink-0" }),
|
|
19208
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: treeError })
|
|
19209
|
+
] }),
|
|
19210
|
+
!treeLoading && !treeError && entries.length === 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-4 py-8 text-center text-sm text-faint", children: [
|
|
19211
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { children: "No workspace files" }),
|
|
19212
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
19213
|
+
Button,
|
|
19214
|
+
{
|
|
19215
|
+
variant: "outline",
|
|
19216
|
+
size: "sm",
|
|
19217
|
+
className: "mt-3 gap-1.5",
|
|
19218
|
+
onClick: () => fileInputRef.current?.click(),
|
|
19219
|
+
disabled: disabled || !sessionId,
|
|
19220
|
+
children: [
|
|
19221
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.UploadIcon, { className: "size-3.5" }),
|
|
19222
|
+
"Upload files"
|
|
19223
|
+
]
|
|
19224
|
+
}
|
|
19225
|
+
)
|
|
19226
|
+
] }),
|
|
19227
|
+
entries.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
19228
|
+
FileTree,
|
|
19229
|
+
{
|
|
19230
|
+
expanded: expandedPaths,
|
|
19231
|
+
onExpandedChange: setExpandedPaths,
|
|
19232
|
+
selectedPath,
|
|
19233
|
+
onSelect: handleSelect,
|
|
19234
|
+
className: "rounded-none border-0",
|
|
19233
19235
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
19234
|
-
|
|
19236
|
+
RenderEntries,
|
|
19235
19237
|
{
|
|
19236
|
-
|
|
19238
|
+
entries,
|
|
19239
|
+
onDelete: setDeleteTarget,
|
|
19240
|
+
downloadUrlFor: (path) => sessionId ? adapter.getWorkspaceDownloadUrl({ sessionId, path }) : "#"
|
|
19237
19241
|
}
|
|
19238
19242
|
)
|
|
19239
19243
|
}
|
|
19240
|
-
) }),
|
|
19241
|
-
/* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { side: "bottom", children: "Refresh" })
|
|
19242
|
-
] })
|
|
19243
|
-
] }),
|
|
19244
|
-
notice && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-b border-line px-3 py-2 text-xs text-muted-foreground", children: notice }),
|
|
19245
|
-
/* @__PURE__ */ jsxRuntime.jsx(ScrollArea, { className: "min-h-0 flex-1", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-1 py-1", children: [
|
|
19246
|
-
treeLoading && entries.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-1 p-2", children: Array.from({ length: 8 }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
19247
|
-
Skeleton,
|
|
19248
|
-
{
|
|
19249
|
-
className: "h-5 rounded",
|
|
19250
|
-
style: {
|
|
19251
|
-
width: `${SKELETON_WIDTHS2[index % SKELETON_WIDTHS2.length]}%`
|
|
19252
|
-
}
|
|
19253
|
-
},
|
|
19254
|
-
index
|
|
19255
|
-
)) }),
|
|
19256
|
-
treeError && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-2 p-3 text-sm text-destructive", children: [
|
|
19257
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircleIcon, { className: "mt-0.5 size-4 shrink-0" }),
|
|
19258
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: treeError })
|
|
19259
|
-
] }),
|
|
19260
|
-
!treeLoading && !treeError && entries.length === 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-4 py-8 text-center text-sm text-faint", children: [
|
|
19261
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { children: "No workspace files" }),
|
|
19262
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
19263
|
-
Button,
|
|
19264
|
-
{
|
|
19265
|
-
variant: "outline",
|
|
19266
|
-
size: "sm",
|
|
19267
|
-
className: "mt-3 gap-1.5",
|
|
19268
|
-
onClick: () => fileInputRef.current?.click(),
|
|
19269
|
-
disabled: disabled || !sessionId,
|
|
19270
|
-
children: [
|
|
19271
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.UploadIcon, { className: "size-3.5" }),
|
|
19272
|
-
"Upload files"
|
|
19273
|
-
]
|
|
19274
|
-
}
|
|
19275
19244
|
)
|
|
19276
|
-
] }),
|
|
19277
|
-
|
|
19278
|
-
|
|
19245
|
+
] }) }),
|
|
19246
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
19247
|
+
ConfirmDialog2,
|
|
19279
19248
|
{
|
|
19280
|
-
|
|
19281
|
-
|
|
19282
|
-
|
|
19283
|
-
|
|
19284
|
-
|
|
19285
|
-
|
|
19286
|
-
RenderEntries,
|
|
19287
|
-
{
|
|
19288
|
-
entries,
|
|
19289
|
-
onDelete: setDeleteTarget,
|
|
19290
|
-
downloadUrlFor: (path) => sessionId ? adapter.getWorkspaceDownloadUrl({ sessionId, path }) : "#"
|
|
19291
|
-
}
|
|
19292
|
-
)
|
|
19249
|
+
open: deleteTarget !== null,
|
|
19250
|
+
title: "Delete file?",
|
|
19251
|
+
description: `This will permanently delete ${deleteTarget?.split("/").pop() ?? "this file"} from the workspace.`,
|
|
19252
|
+
confirmLabel: "Delete",
|
|
19253
|
+
onConfirm: () => deleteTarget ? handleDelete(deleteTarget) : Promise.resolve(),
|
|
19254
|
+
onCancel: () => setDeleteTarget(null)
|
|
19293
19255
|
}
|
|
19294
19256
|
)
|
|
19295
|
-
]
|
|
19296
|
-
|
|
19297
|
-
|
|
19298
|
-
{
|
|
19299
|
-
open: deleteTarget !== null,
|
|
19300
|
-
title: "Delete file?",
|
|
19301
|
-
description: `This will permanently delete ${deleteTarget?.split("/").pop() ?? "this file"} from the workspace.`,
|
|
19302
|
-
confirmLabel: "Delete",
|
|
19303
|
-
onConfirm: () => deleteTarget ? handleDelete(deleteTarget) : Promise.resolve(),
|
|
19304
|
-
onCancel: () => setDeleteTarget(null)
|
|
19305
|
-
}
|
|
19306
|
-
)
|
|
19307
|
-
]
|
|
19308
|
-
}
|
|
19257
|
+
]
|
|
19258
|
+
}
|
|
19259
|
+
)
|
|
19309
19260
|
);
|
|
19310
19261
|
}
|
|
19311
19262
|
function ConfirmDialog2({
|
|
@@ -19636,8 +19587,7 @@ function AgentChat({
|
|
|
19636
19587
|
onSelectedPathChange: handleSelectedPathChange,
|
|
19637
19588
|
onOpenFile: handleOpenFilePreview,
|
|
19638
19589
|
refreshSignal: runtime.workspaceRefreshKey,
|
|
19639
|
-
disabled: effectiveDisabled
|
|
19640
|
-
fillParent: true
|
|
19590
|
+
disabled: effectiveDisabled
|
|
19641
19591
|
}
|
|
19642
19592
|
)
|
|
19643
19593
|
} : null
|