@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.js CHANGED
@@ -10160,7 +10160,7 @@ function SessionPaneCard({
10160
10160
  // and cancelling the bottom from a className leaves both rules live,
10161
10161
  // and which corner wins comes down to stylesheet order rather than
10162
10162
  // intent -- which is how the stacked cards kept round bottoms.
10163
- "flex w-full items-center gap-3 border border-line px-3 py-3.5 text-left transition-colors hover:bg-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
10163
+ "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",
10164
10164
  className
10165
10165
  ),
10166
10166
  children: [
@@ -12713,7 +12713,7 @@ function ChatThread({
12713
12713
  subtitle: paneCards.browser.subtitle,
12714
12714
  thumbnail: paneCards.browser.thumbnail,
12715
12715
  onOpen: paneCards.browser.onOpen,
12716
- className: "w-auto rounded-t-xl border-b-0 -mb-px"
12716
+ className: "w-auto rounded-t-xl border-input border-[2px] border-b-0 -mb-[10px]"
12717
12717
  }
12718
12718
  ),
12719
12719
  paneCards.files && /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -12726,14 +12726,14 @@ function ChatThread({
12726
12726
  count: paneCards.files.count,
12727
12727
  expanded: paneCards.files.open,
12728
12728
  onOpen: paneCards.files.onToggle,
12729
- className: "w-auto rounded-t-xl border-b-0 -mb-px"
12729
+ className: "w-auto rounded-t-xl border-input border-[2px] border-b-0 -mb-[10px]"
12730
12730
  }
12731
12731
  ),
12732
12732
  paneCards.files.open && /* @__PURE__ */ jsx(
12733
12733
  "div",
12734
12734
  {
12735
12735
  "data-testid": "files-accordion",
12736
- className: "-mb-px flex h-72 min-h-0 flex-col overflow-hidden border border-b-0 border-line",
12736
+ className: "-mb-[10px] flex h-72 min-h-0 flex-col overflow-hidden border border-b-0 border-line",
12737
12737
  children: paneCards.files.panel
12738
12738
  }
12739
12739
  )
@@ -18433,7 +18433,7 @@ function FileTree({
18433
18433
  return /* @__PURE__ */ jsx(FileTreeContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(
18434
18434
  "div",
18435
18435
  {
18436
- className: cn("rounded-lg border bg-card text-base", className),
18436
+ className: cn("rounded-lg border text-base", className),
18437
18437
  role: "tree",
18438
18438
  ...props,
18439
18439
  children: /* @__PURE__ */ jsx("div", { className: "p-2", children })
@@ -18557,9 +18557,6 @@ function FileTreeFile({
18557
18557
  );
18558
18558
  }
18559
18559
  var SKELETON_WIDTHS2 = [75, 60, 90, 65, 80, 70, 85, 55];
18560
- var DEFAULT_WIDTH2 = 400;
18561
- var MIN_WIDTH = 300;
18562
- var MAX_WIDTH = 900;
18563
18560
  function collectExpandedPaths(entries, depth = 0) {
18564
18561
  const paths = [];
18565
18562
  for (const entry of entries) {
@@ -18670,8 +18667,7 @@ function WorkspacePanel({
18670
18667
  onSelectedPathChange,
18671
18668
  onOpenFile,
18672
18669
  refreshSignal = 0,
18673
- disabled = false,
18674
- fillParent = false
18670
+ disabled = false
18675
18671
  }) {
18676
18672
  const fileInputRef = useRef(null);
18677
18673
  const [entries, setEntries] = useState([]);
@@ -18681,12 +18677,7 @@ function WorkspacePanel({
18681
18677
  const [uploading, setUploading] = useState(false);
18682
18678
  const [deleteTarget, setDeleteTarget] = useState(null);
18683
18679
  const [expandedPaths, setExpandedPaths] = useState(/* @__PURE__ */ new Set());
18684
- const [width, setWidth] = useState(DEFAULT_WIDTH2);
18685
- const narrow = useIsMobile();
18686
18680
  const sessionIdRef = useRef(sessionId);
18687
- const isResizing = useRef(false);
18688
- const startX = useRef(0);
18689
- const startWidth = useRef(DEFAULT_WIDTH2);
18690
18681
  sessionIdRef.current = sessionId;
18691
18682
  const fetchTree = useCallback(async () => {
18692
18683
  if (!sessionId) {
@@ -18805,171 +18796,131 @@ function WorkspacePanel({
18805
18796
  sessionId
18806
18797
  ]
18807
18798
  );
18808
- const onResizeStart = useCallback(
18809
- (event) => {
18810
- event.preventDefault();
18811
- isResizing.current = true;
18812
- startX.current = event.clientX;
18813
- startWidth.current = width;
18814
- document.body.style.cursor = "col-resize";
18815
- document.body.style.userSelect = "none";
18816
- },
18817
- [width]
18818
- );
18819
- useEffect(() => {
18820
- const onMouseMove = (event) => {
18821
- if (!isResizing.current) return;
18822
- const delta = startX.current - event.clientX;
18823
- setWidth(
18824
- Math.min(MAX_WIDTH, Math.max(MIN_WIDTH, startWidth.current + delta))
18825
- );
18826
- };
18827
- const onMouseUp = () => {
18828
- if (!isResizing.current) return;
18829
- isResizing.current = false;
18830
- document.body.style.cursor = "";
18831
- document.body.style.userSelect = "";
18832
- };
18833
- window.addEventListener("mousemove", onMouseMove);
18834
- window.addEventListener("mouseup", onMouseUp);
18835
- return () => {
18836
- window.removeEventListener("mousemove", onMouseMove);
18837
- window.removeEventListener("mouseup", onMouseUp);
18838
- };
18839
- }, []);
18840
- return /* @__PURE__ */ jsxs(
18841
- "aside",
18842
- {
18843
- "data-testid": "workspace-panel",
18844
- className: cn(
18845
- "relative z-10 flex h-full min-h-0 flex-col overflow-hidden bg-card",
18846
- // Filling a parent means the parent draws the frame; a border
18847
- // here would double against it.
18848
- !fillParent && "border-l border-muted-foreground/20",
18849
- (fillParent || narrow) && "w-full"
18850
- ),
18851
- style: fillParent || narrow ? void 0 : { width, minWidth: MIN_WIDTH, maxWidth: MAX_WIDTH },
18852
- children: [
18853
- !(fillParent || narrow) && /* @__PURE__ */ jsx(
18854
- "div",
18855
- {
18856
- 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",
18857
- onMouseDown: onResizeStart
18858
- }
18859
- ),
18860
- /* @__PURE__ */ jsx(
18861
- "input",
18862
- {
18863
- ref: fileInputRef,
18864
- type: "file",
18865
- multiple: true,
18866
- className: "hidden",
18867
- disabled,
18868
- onChange: (event) => {
18869
- if (event.target.files) void handleUpload(event.target.files);
18870
- }
18871
- }
18872
- ),
18873
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-end gap-2 border-b border-line px-3 py-1.5", children: [
18874
- /* @__PURE__ */ jsxs(Tooltip, { children: [
18875
- /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
18876
- Button,
18877
- {
18878
- variant: "ghost",
18879
- size: "icon-sm",
18880
- onClick: () => fileInputRef.current?.click(),
18881
- disabled: disabled || !sessionId || uploading,
18882
- "aria-label": "Upload files",
18883
- children: uploading ? /* @__PURE__ */ jsx(Loader2Icon, { className: "size-4 animate-spin" }) : /* @__PURE__ */ jsx(UploadIcon, { className: "size-4" })
18799
+ return (
18800
+ // Always fills its parent: the panel is the body of the Files
18801
+ // accordion, which owns the frame and the height. The side-drawer
18802
+ // it used to be — resize handle, min/max width, its own left
18803
+ // border — went away with the drawer.
18804
+ /* @__PURE__ */ jsxs(
18805
+ "aside",
18806
+ {
18807
+ "data-testid": "workspace-panel",
18808
+ 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",
18809
+ children: [
18810
+ /* @__PURE__ */ jsx(
18811
+ "input",
18812
+ {
18813
+ ref: fileInputRef,
18814
+ type: "file",
18815
+ multiple: true,
18816
+ className: "hidden",
18817
+ disabled,
18818
+ onChange: (event) => {
18819
+ if (event.target.files) void handleUpload(event.target.files);
18884
18820
  }
18885
- ) }),
18886
- /* @__PURE__ */ jsx(TooltipContent, { side: "bottom", children: "Upload files" })
18821
+ }
18822
+ ),
18823
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-end gap-2 border-b border-line px-3 py-1.5", children: [
18824
+ /* @__PURE__ */ jsxs(Tooltip, { children: [
18825
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
18826
+ Button,
18827
+ {
18828
+ variant: "ghost",
18829
+ size: "icon-sm",
18830
+ onClick: () => fileInputRef.current?.click(),
18831
+ disabled: disabled || !sessionId || uploading,
18832
+ "aria-label": "Upload files",
18833
+ children: uploading ? /* @__PURE__ */ jsx(Loader2Icon, { className: "size-4 animate-spin" }) : /* @__PURE__ */ jsx(UploadIcon, { className: "size-4" })
18834
+ }
18835
+ ) }),
18836
+ /* @__PURE__ */ jsx(TooltipContent, { side: "bottom", children: "Upload files" })
18837
+ ] }),
18838
+ /* @__PURE__ */ jsxs(Tooltip, { children: [
18839
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
18840
+ Button,
18841
+ {
18842
+ variant: "ghost",
18843
+ size: "icon-sm",
18844
+ onClick: () => void fetchTree(),
18845
+ disabled: !sessionId || treeLoading,
18846
+ "aria-label": "Refresh workspace",
18847
+ children: /* @__PURE__ */ jsx(
18848
+ RefreshCwIcon,
18849
+ {
18850
+ className: cn("size-4", treeLoading && "animate-spin")
18851
+ }
18852
+ )
18853
+ }
18854
+ ) }),
18855
+ /* @__PURE__ */ jsx(TooltipContent, { side: "bottom", children: "Refresh" })
18856
+ ] })
18887
18857
  ] }),
18888
- /* @__PURE__ */ jsxs(Tooltip, { children: [
18889
- /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
18890
- Button,
18858
+ notice && /* @__PURE__ */ jsx("div", { className: "border-b border-line px-3 py-2 text-xs text-muted-foreground", children: notice }),
18859
+ /* @__PURE__ */ jsx(ScrollArea, { className: "min-h-0 flex-1", children: /* @__PURE__ */ jsxs("div", { className: "px-1 py-1", children: [
18860
+ treeLoading && entries.length === 0 && /* @__PURE__ */ jsx("div", { className: "space-y-1 p-2", children: Array.from({ length: 8 }).map((_, index) => /* @__PURE__ */ jsx(
18861
+ Skeleton,
18891
18862
  {
18892
- variant: "ghost",
18893
- size: "icon-sm",
18894
- onClick: () => void fetchTree(),
18895
- disabled: !sessionId || treeLoading,
18896
- "aria-label": "Refresh workspace",
18863
+ className: "h-5 rounded",
18864
+ style: {
18865
+ width: `${SKELETON_WIDTHS2[index % SKELETON_WIDTHS2.length]}%`
18866
+ }
18867
+ },
18868
+ index
18869
+ )) }),
18870
+ treeError && /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2 p-3 text-sm text-destructive", children: [
18871
+ /* @__PURE__ */ jsx(AlertCircleIcon, { className: "mt-0.5 size-4 shrink-0" }),
18872
+ /* @__PURE__ */ jsx("span", { children: treeError })
18873
+ ] }),
18874
+ !treeLoading && !treeError && entries.length === 0 && /* @__PURE__ */ jsxs("div", { className: "px-4 py-8 text-center text-sm text-faint", children: [
18875
+ /* @__PURE__ */ jsx("p", { children: "No workspace files" }),
18876
+ /* @__PURE__ */ jsxs(
18877
+ Button,
18878
+ {
18879
+ variant: "outline",
18880
+ size: "sm",
18881
+ className: "mt-3 gap-1.5",
18882
+ onClick: () => fileInputRef.current?.click(),
18883
+ disabled: disabled || !sessionId,
18884
+ children: [
18885
+ /* @__PURE__ */ jsx(UploadIcon, { className: "size-3.5" }),
18886
+ "Upload files"
18887
+ ]
18888
+ }
18889
+ )
18890
+ ] }),
18891
+ entries.length > 0 && /* @__PURE__ */ jsx(
18892
+ FileTree,
18893
+ {
18894
+ expanded: expandedPaths,
18895
+ onExpandedChange: setExpandedPaths,
18896
+ selectedPath,
18897
+ onSelect: handleSelect,
18898
+ className: "rounded-none border-0",
18897
18899
  children: /* @__PURE__ */ jsx(
18898
- RefreshCwIcon,
18900
+ RenderEntries,
18899
18901
  {
18900
- className: cn("size-4", treeLoading && "animate-spin")
18902
+ entries,
18903
+ onDelete: setDeleteTarget,
18904
+ downloadUrlFor: (path) => sessionId ? adapter.getWorkspaceDownloadUrl({ sessionId, path }) : "#"
18901
18905
  }
18902
18906
  )
18903
18907
  }
18904
- ) }),
18905
- /* @__PURE__ */ jsx(TooltipContent, { side: "bottom", children: "Refresh" })
18906
- ] })
18907
- ] }),
18908
- notice && /* @__PURE__ */ jsx("div", { className: "border-b border-line px-3 py-2 text-xs text-muted-foreground", children: notice }),
18909
- /* @__PURE__ */ jsx(ScrollArea, { className: "min-h-0 flex-1", children: /* @__PURE__ */ jsxs("div", { className: "px-1 py-1", children: [
18910
- treeLoading && entries.length === 0 && /* @__PURE__ */ jsx("div", { className: "space-y-1 p-2", children: Array.from({ length: 8 }).map((_, index) => /* @__PURE__ */ jsx(
18911
- Skeleton,
18912
- {
18913
- className: "h-5 rounded",
18914
- style: {
18915
- width: `${SKELETON_WIDTHS2[index % SKELETON_WIDTHS2.length]}%`
18916
- }
18917
- },
18918
- index
18919
- )) }),
18920
- treeError && /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2 p-3 text-sm text-destructive", children: [
18921
- /* @__PURE__ */ jsx(AlertCircleIcon, { className: "mt-0.5 size-4 shrink-0" }),
18922
- /* @__PURE__ */ jsx("span", { children: treeError })
18923
- ] }),
18924
- !treeLoading && !treeError && entries.length === 0 && /* @__PURE__ */ jsxs("div", { className: "px-4 py-8 text-center text-sm text-faint", children: [
18925
- /* @__PURE__ */ jsx("p", { children: "No workspace files" }),
18926
- /* @__PURE__ */ jsxs(
18927
- Button,
18928
- {
18929
- variant: "outline",
18930
- size: "sm",
18931
- className: "mt-3 gap-1.5",
18932
- onClick: () => fileInputRef.current?.click(),
18933
- disabled: disabled || !sessionId,
18934
- children: [
18935
- /* @__PURE__ */ jsx(UploadIcon, { className: "size-3.5" }),
18936
- "Upload files"
18937
- ]
18938
- }
18939
18908
  )
18940
- ] }),
18941
- entries.length > 0 && /* @__PURE__ */ jsx(
18942
- FileTree,
18909
+ ] }) }),
18910
+ /* @__PURE__ */ jsx(
18911
+ ConfirmDialog2,
18943
18912
  {
18944
- expanded: expandedPaths,
18945
- onExpandedChange: setExpandedPaths,
18946
- selectedPath,
18947
- onSelect: handleSelect,
18948
- className: "rounded-none border-0",
18949
- children: /* @__PURE__ */ jsx(
18950
- RenderEntries,
18951
- {
18952
- entries,
18953
- onDelete: setDeleteTarget,
18954
- downloadUrlFor: (path) => sessionId ? adapter.getWorkspaceDownloadUrl({ sessionId, path }) : "#"
18955
- }
18956
- )
18913
+ open: deleteTarget !== null,
18914
+ title: "Delete file?",
18915
+ description: `This will permanently delete ${deleteTarget?.split("/").pop() ?? "this file"} from the workspace.`,
18916
+ confirmLabel: "Delete",
18917
+ onConfirm: () => deleteTarget ? handleDelete(deleteTarget) : Promise.resolve(),
18918
+ onCancel: () => setDeleteTarget(null)
18957
18919
  }
18958
18920
  )
18959
- ] }) }),
18960
- /* @__PURE__ */ jsx(
18961
- ConfirmDialog2,
18962
- {
18963
- open: deleteTarget !== null,
18964
- title: "Delete file?",
18965
- description: `This will permanently delete ${deleteTarget?.split("/").pop() ?? "this file"} from the workspace.`,
18966
- confirmLabel: "Delete",
18967
- onConfirm: () => deleteTarget ? handleDelete(deleteTarget) : Promise.resolve(),
18968
- onCancel: () => setDeleteTarget(null)
18969
- }
18970
- )
18971
- ]
18972
- }
18921
+ ]
18922
+ }
18923
+ )
18973
18924
  );
18974
18925
  }
18975
18926
  function ConfirmDialog2({
@@ -19297,8 +19248,7 @@ function AgentChat({
19297
19248
  onSelectedPathChange: handleSelectedPathChange,
19298
19249
  onOpenFile: handleOpenFilePreview,
19299
19250
  refreshSignal: runtime.workspaceRefreshKey,
19300
- disabled: effectiveDisabled,
19301
- fillParent: true
19251
+ disabled: effectiveDisabled
19302
19252
  }
19303
19253
  )
19304
19254
  } : null