@tangle-network/sandbox-ui 0.5.2 → 0.6.1
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/chat.js +6 -6
- package/dist/{chunk-XBR3IP7B.js → chunk-33W2TLUL.js} +2 -2
- package/dist/{chunk-H5XYSFYE.js → chunk-3HW53XTH.js} +6 -6
- package/dist/{chunk-STHB4N22.js → chunk-6V4XVKFY.js} +50 -54
- package/dist/{chunk-P24K22CV.js → chunk-E2XT3G52.js} +227 -189
- package/dist/{chunk-FFOXUHOF.js → chunk-FNYJFCGU.js} +3 -3
- package/dist/{chunk-5CEMHKBP.js → chunk-GW4GRAWJ.js} +3 -2
- package/dist/{chunk-WQH233GF.js → chunk-KH5UDAJ2.js} +3 -3
- package/dist/{chunk-NTSRY4GW.js → chunk-MJUDMVRU.js} +5 -5
- package/dist/{chunk-5F4NX5R2.js → chunk-MXRQ4MJE.js} +1 -1
- package/dist/{chunk-VBWY44UU.js → chunk-OVNLOE3Y.js} +1 -1
- package/dist/{chunk-R3IU37AW.js → chunk-RKXIRRKQ.js} +19 -22
- package/dist/{chunk-WC7QTWPN.js → chunk-ZMWWE5RF.js} +61 -84
- package/dist/dashboard.js +1 -1
- package/dist/{document-editor-pane-JNXPANWM.js → document-editor-pane-DWWUTTTZ.js} +2 -2
- package/dist/editor.js +2 -2
- package/dist/{expanded-tool-detail-DM5M_T9h.d.ts → expanded-tool-detail-Dh99mcbY.d.ts} +0 -4
- package/dist/files.js +2 -2
- package/dist/hooks.js +4 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.js +12 -12
- package/dist/markdown.js +1 -1
- package/dist/openui.js +2 -2
- package/dist/run.d.ts +1 -1
- package/dist/run.js +4 -4
- package/dist/sdk-hooks.js +4 -4
- package/dist/tokens.css +29 -4
- package/dist/workspace.d.ts +6 -1
- package/dist/workspace.js +7 -7
- package/package.json +1 -1
|
@@ -10,21 +10,21 @@ import {
|
|
|
10
10
|
} from "./chunk-BRBTD7RH.js";
|
|
11
11
|
import {
|
|
12
12
|
ChatContainer
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-RKXIRRKQ.js";
|
|
14
14
|
import {
|
|
15
15
|
OpenUIArtifactRenderer
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-OVNLOE3Y.js";
|
|
17
17
|
import {
|
|
18
18
|
FileArtifactPane,
|
|
19
19
|
FileTree,
|
|
20
20
|
filterFileTree
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-KH5UDAJ2.js";
|
|
22
22
|
import {
|
|
23
23
|
ArtifactPane
|
|
24
24
|
} from "./chunk-W4LM3QYZ.js";
|
|
25
25
|
import {
|
|
26
26
|
Markdown
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-3HW53XTH.js";
|
|
28
28
|
import {
|
|
29
29
|
Badge
|
|
30
30
|
} from "./chunk-TDYQBLL5.js";
|
|
@@ -832,19 +832,19 @@ function RuntimePane({
|
|
|
832
832
|
}
|
|
833
833
|
|
|
834
834
|
// src/workspace/session-sidebar.tsx
|
|
835
|
-
import { useMemo as useMemo3, useState as useState4 } from "react";
|
|
835
|
+
import { useCallback, useMemo as useMemo3, useRef as useRef3, useState as useState4 } from "react";
|
|
836
836
|
import { ArrowLeft, FolderTree, MessageSquareText, Plus, Search as Search2, Settings, Sparkles } from "lucide-react";
|
|
837
837
|
import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
838
|
-
function
|
|
838
|
+
function statusDot(status) {
|
|
839
839
|
switch (status) {
|
|
840
840
|
case "running":
|
|
841
|
-
return "bg-[var(--
|
|
841
|
+
return "bg-[var(--status-running)]";
|
|
842
842
|
case "error":
|
|
843
|
-
return "bg-[var(--
|
|
843
|
+
return "bg-[var(--surface-danger-text)]";
|
|
844
844
|
case "attention-needed":
|
|
845
|
-
return "bg-[var(--
|
|
845
|
+
return "bg-[var(--surface-warning-text)]";
|
|
846
846
|
default:
|
|
847
|
-
return "bg-
|
|
847
|
+
return "bg-muted-foreground/40";
|
|
848
848
|
}
|
|
849
849
|
}
|
|
850
850
|
function iconForLink(icon) {
|
|
@@ -887,24 +887,47 @@ function sortItems(items, sessionStatusById) {
|
|
|
887
887
|
return rightUpdated - leftUpdated;
|
|
888
888
|
});
|
|
889
889
|
}
|
|
890
|
-
function
|
|
890
|
+
function badgeTone(tone = "neutral") {
|
|
891
891
|
switch (tone) {
|
|
892
892
|
case "accent":
|
|
893
|
-
return "border-
|
|
893
|
+
return "border-primary/30 bg-primary/10 text-primary";
|
|
894
894
|
case "success":
|
|
895
|
-
return "border-
|
|
895
|
+
return "border-success/30 bg-success/10 text-success";
|
|
896
896
|
case "warning":
|
|
897
|
-
return "border-
|
|
897
|
+
return "border-warning/30 bg-warning/10 text-warning";
|
|
898
898
|
case "danger":
|
|
899
|
-
return "border-
|
|
899
|
+
return "border-destructive/30 bg-destructive/10 text-destructive";
|
|
900
900
|
default:
|
|
901
|
-
return "border-
|
|
901
|
+
return "border-border bg-muted text-muted-foreground";
|
|
902
902
|
}
|
|
903
903
|
}
|
|
904
904
|
function navigateToHref(href) {
|
|
905
905
|
if (!href || typeof window === "undefined") return;
|
|
906
906
|
window.location.assign(href);
|
|
907
907
|
}
|
|
908
|
+
function useResizable(defaultWidth, min, max, onChange) {
|
|
909
|
+
const [width, setWidth] = useState4(defaultWidth);
|
|
910
|
+
const dragging = useRef3(false);
|
|
911
|
+
const startX = useRef3(0);
|
|
912
|
+
const startW = useRef3(0);
|
|
913
|
+
const onPointerDown = useCallback((e) => {
|
|
914
|
+
dragging.current = true;
|
|
915
|
+
startX.current = e.clientX;
|
|
916
|
+
startW.current = width;
|
|
917
|
+
e.currentTarget.setPointerCapture(e.pointerId);
|
|
918
|
+
}, [width]);
|
|
919
|
+
const onPointerMove = useCallback((e) => {
|
|
920
|
+
if (!dragging.current) return;
|
|
921
|
+
const delta = e.clientX - startX.current;
|
|
922
|
+
const next = Math.min(max, Math.max(min, startW.current + delta));
|
|
923
|
+
setWidth(next);
|
|
924
|
+
onChange?.(next);
|
|
925
|
+
}, [min, max, onChange]);
|
|
926
|
+
const onPointerUp = useCallback(() => {
|
|
927
|
+
dragging.current = false;
|
|
928
|
+
}, []);
|
|
929
|
+
return { width, onPointerDown, onPointerMove, onPointerUp };
|
|
930
|
+
}
|
|
908
931
|
function SessionSidebar({
|
|
909
932
|
title,
|
|
910
933
|
subtitle,
|
|
@@ -923,6 +946,11 @@ function SessionSidebar({
|
|
|
923
946
|
activityMonitor,
|
|
924
947
|
filters = [],
|
|
925
948
|
defaultFilterId,
|
|
949
|
+
resizable = false,
|
|
950
|
+
defaultWidth = 256,
|
|
951
|
+
minWidth = 200,
|
|
952
|
+
maxWidth = 400,
|
|
953
|
+
onWidthChange,
|
|
926
954
|
renderItemActions
|
|
927
955
|
}) {
|
|
928
956
|
const [query, setQuery] = useState4("");
|
|
@@ -958,154 +986,172 @@ function SessionSidebar({
|
|
|
958
986
|
isActive: currentItemId === item.id
|
|
959
987
|
})).length
|
|
960
988
|
])), [currentItemId, filters, orderedItems, sessionsById]);
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
989
|
+
const resize = useResizable(defaultWidth, minWidth, maxWidth, onWidthChange);
|
|
990
|
+
return /* @__PURE__ */ jsxs7(
|
|
991
|
+
"aside",
|
|
992
|
+
{
|
|
993
|
+
className: cn("relative flex shrink-0 flex-col border-r border-border bg-card", className),
|
|
994
|
+
style: { width: resizable ? resize.width : defaultWidth },
|
|
995
|
+
children: [
|
|
996
|
+
/* @__PURE__ */ jsxs7("div", { className: "border-b border-border px-3 py-2.5", children: [
|
|
997
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex items-center justify-between gap-2", children: [
|
|
998
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex items-center gap-2 min-w-0", children: [
|
|
999
|
+
/* @__PURE__ */ jsx7("div", { className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-primary/10 text-primary", children: /* @__PURE__ */ jsx7(MessageSquareText, { className: "h-3 w-3" }) }),
|
|
1000
|
+
/* @__PURE__ */ jsxs7("div", { className: "min-w-0", children: [
|
|
1001
|
+
/* @__PURE__ */ jsx7("div", { className: "truncate text-xs font-semibold text-foreground", children: title }),
|
|
1002
|
+
subtitle && /* @__PURE__ */ jsx7("div", { className: "truncate text-[10px] text-muted-foreground", children: subtitle })
|
|
1003
|
+
] })
|
|
1004
|
+
] }),
|
|
1005
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex items-center gap-1.5 shrink-0", children: [
|
|
1006
|
+
runningCount > 0 && /* @__PURE__ */ jsx7("span", { className: "rounded-full bg-primary/10 px-1.5 py-px text-[10px] font-medium text-primary", children: runningCount }),
|
|
1007
|
+
onCreate && /* @__PURE__ */ jsx7(
|
|
1008
|
+
"button",
|
|
1009
|
+
{
|
|
1010
|
+
type: "button",
|
|
1011
|
+
onClick: onCreate,
|
|
1012
|
+
title: createLabel,
|
|
1013
|
+
className: "flex h-6 w-6 items-center justify-center rounded-md border border-border text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",
|
|
1014
|
+
children: /* @__PURE__ */ jsx7(Plus, { className: "h-3 w-3" })
|
|
1015
|
+
}
|
|
1016
|
+
)
|
|
1017
|
+
] })
|
|
1018
|
+
] }),
|
|
1019
|
+
enableSearch && items.length > 0 && /* @__PURE__ */ jsxs7("div", { className: "relative mt-2", children: [
|
|
1020
|
+
/* @__PURE__ */ jsx7(Search2, { className: "pointer-events-none absolute left-2 top-1/2 h-3 w-3 -translate-y-1/2 text-muted-foreground" }),
|
|
1021
|
+
/* @__PURE__ */ jsx7(
|
|
1022
|
+
"input",
|
|
1023
|
+
{
|
|
1024
|
+
value: query,
|
|
1025
|
+
onChange: (event) => setQuery(event.target.value),
|
|
1026
|
+
placeholder: searchPlaceholder,
|
|
1027
|
+
"aria-label": searchPlaceholder,
|
|
1028
|
+
className: "h-7 w-full rounded-md border border-border bg-background pl-7 pr-2 text-xs text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
|
|
1029
|
+
}
|
|
1030
|
+
)
|
|
1031
|
+
] }),
|
|
1032
|
+
filters.length > 0 && /* @__PURE__ */ jsx7("div", { className: "mt-1.5 flex flex-wrap gap-1", children: filters.map((filter) => {
|
|
1033
|
+
const isSelected = activeFilterId === filter.id;
|
|
1034
|
+
return /* @__PURE__ */ jsxs7(
|
|
1035
|
+
"button",
|
|
1036
|
+
{
|
|
1037
|
+
type: "button",
|
|
1038
|
+
onClick: () => setActiveFilterId(filter.id),
|
|
1039
|
+
className: cn(
|
|
1040
|
+
"inline-flex items-center gap-1 rounded-full border px-2 py-px text-[10px] font-medium transition-colors",
|
|
1041
|
+
isSelected ? "border-primary/30 bg-primary/10 text-primary" : "border-border text-muted-foreground hover:text-foreground"
|
|
1042
|
+
),
|
|
1043
|
+
children: [
|
|
1044
|
+
/* @__PURE__ */ jsx7("span", { children: filter.label }),
|
|
1045
|
+
/* @__PURE__ */ jsx7("span", { className: "text-[9px] opacity-60", children: filterCounts[filter.id] ?? 0 })
|
|
1046
|
+
]
|
|
1047
|
+
},
|
|
1048
|
+
filter.id
|
|
1049
|
+
);
|
|
1050
|
+
}) })
|
|
970
1051
|
] }),
|
|
971
|
-
/* @__PURE__ */
|
|
972
|
-
|
|
973
|
-
|
|
1052
|
+
/* @__PURE__ */ jsx7("nav", { "aria-label": "Sessions", className: "flex-1 overflow-y-auto px-1.5 py-1.5", children: visibleItems.length === 0 ? /* @__PURE__ */ jsx7("div", { className: "rounded-md border border-dashed border-border px-3 py-3 text-xs text-muted-foreground", children: query.trim() ? `No sessions match "${query.trim()}".` : emptyMessage }) : /* @__PURE__ */ jsx7("ul", { className: "space-y-px", children: visibleItems.map((item) => {
|
|
1053
|
+
const session = sessionsById.get(item.id) ?? null;
|
|
1054
|
+
const isActive = currentItemId === item.id;
|
|
1055
|
+
const status = session?.status ?? item.status;
|
|
1056
|
+
const visibleBadges = [
|
|
1057
|
+
...item.isPinned ? [{ id: `${item.id}-pinned`, label: "Pinned", tone: "accent" }] : [],
|
|
1058
|
+
...item.badges ?? []
|
|
1059
|
+
];
|
|
1060
|
+
return /* @__PURE__ */ jsx7("li", { children: /* @__PURE__ */ jsxs7(
|
|
1061
|
+
"div",
|
|
1062
|
+
{
|
|
1063
|
+
className: cn(
|
|
1064
|
+
"group relative flex items-center gap-2 rounded-md px-2 py-1.5 transition-colors",
|
|
1065
|
+
isActive ? "bg-accent text-accent-foreground shadow-[inset_2px_0_0_hsl(var(--primary))]" : "text-foreground hover:bg-accent/50"
|
|
1066
|
+
),
|
|
1067
|
+
children: [
|
|
1068
|
+
/* @__PURE__ */ jsxs7(
|
|
1069
|
+
"button",
|
|
1070
|
+
{
|
|
1071
|
+
type: "button",
|
|
1072
|
+
onClick: () => {
|
|
1073
|
+
if (onSelectItem) {
|
|
1074
|
+
onSelectItem(item);
|
|
1075
|
+
return;
|
|
1076
|
+
}
|
|
1077
|
+
navigateToHref(item.href);
|
|
1078
|
+
},
|
|
1079
|
+
"aria-current": isActive ? "page" : void 0,
|
|
1080
|
+
className: "min-w-0 flex flex-1 items-center gap-2 text-left",
|
|
1081
|
+
children: [
|
|
1082
|
+
/* @__PURE__ */ jsx7("span", { className: cn("h-1.5 w-1.5 shrink-0 rounded-full", statusDot(status)) }),
|
|
1083
|
+
/* @__PURE__ */ jsxs7("div", { className: "min-w-0 flex-1", children: [
|
|
1084
|
+
/* @__PURE__ */ jsx7("div", { className: cn(
|
|
1085
|
+
"truncate text-xs",
|
|
1086
|
+
isActive ? "font-semibold" : "font-medium"
|
|
1087
|
+
), children: item.title }),
|
|
1088
|
+
item.subtitle && /* @__PURE__ */ jsx7("div", { className: "truncate text-[10px] leading-tight text-muted-foreground", children: item.subtitle })
|
|
1089
|
+
] })
|
|
1090
|
+
]
|
|
1091
|
+
}
|
|
1092
|
+
),
|
|
1093
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
1094
|
+
visibleBadges.length > 0 && visibleBadges.slice(0, 1).map((badge) => /* @__PURE__ */ jsx7(
|
|
1095
|
+
"span",
|
|
1096
|
+
{
|
|
1097
|
+
className: cn(
|
|
1098
|
+
"rounded-full border px-1.5 py-px text-[8px] font-semibold uppercase",
|
|
1099
|
+
badgeTone(badge.tone)
|
|
1100
|
+
),
|
|
1101
|
+
children: badge.label
|
|
1102
|
+
},
|
|
1103
|
+
badge.id
|
|
1104
|
+
)),
|
|
1105
|
+
session?.isForeground && /* @__PURE__ */ jsx7("span", { className: "h-1.5 w-1.5 rounded-full bg-primary animate-pulse", title: "Live" }),
|
|
1106
|
+
renderItemActions ? /* @__PURE__ */ jsx7(
|
|
1107
|
+
"div",
|
|
1108
|
+
{
|
|
1109
|
+
className: "opacity-0 transition-opacity group-hover:opacity-100",
|
|
1110
|
+
onClick: (event) => event.stopPropagation(),
|
|
1111
|
+
children: renderItemActions(item, { session, isActive })
|
|
1112
|
+
}
|
|
1113
|
+
) : null
|
|
1114
|
+
] })
|
|
1115
|
+
]
|
|
1116
|
+
}
|
|
1117
|
+
) }, item.id);
|
|
1118
|
+
}) }) }),
|
|
1119
|
+
activityMonitor && /* @__PURE__ */ jsx7("div", { className: "border-t border-border px-2 py-1.5", children: activityMonitor }),
|
|
1120
|
+
links.length > 0 && /* @__PURE__ */ jsx7("nav", { "aria-label": "Workspace sections", className: "border-t border-border px-1.5 py-1.5", children: /* @__PURE__ */ jsx7("div", { className: "space-y-px", children: links.map((link) => {
|
|
1121
|
+
const Icon = iconForLink(link.icon);
|
|
1122
|
+
return /* @__PURE__ */ jsxs7(
|
|
974
1123
|
"button",
|
|
975
1124
|
{
|
|
976
1125
|
type: "button",
|
|
977
|
-
onClick:
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
1126
|
+
onClick: () => {
|
|
1127
|
+
if (onSelectLink) {
|
|
1128
|
+
onSelectLink(link);
|
|
1129
|
+
return;
|
|
1130
|
+
}
|
|
1131
|
+
navigateToHref(link.href);
|
|
1132
|
+
},
|
|
1133
|
+
className: "flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",
|
|
1134
|
+
children: [
|
|
1135
|
+
/* @__PURE__ */ jsx7(Icon, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
1136
|
+
/* @__PURE__ */ jsx7("span", { className: "truncate", children: link.label })
|
|
1137
|
+
]
|
|
1138
|
+
},
|
|
1139
|
+
link.id
|
|
1140
|
+
);
|
|
1141
|
+
}) }) }),
|
|
1142
|
+
resizable && /* @__PURE__ */ jsx7(
|
|
1143
|
+
"div",
|
|
989
1144
|
{
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
1145
|
+
className: "absolute top-0 right-0 bottom-0 w-1 cursor-col-resize hover:bg-primary/20 active:bg-primary/30 transition-colors",
|
|
1146
|
+
onPointerDown: resize.onPointerDown,
|
|
1147
|
+
onPointerMove: resize.onPointerMove,
|
|
1148
|
+
onPointerUp: resize.onPointerUp,
|
|
1149
|
+
title: "Drag to resize"
|
|
995
1150
|
}
|
|
996
1151
|
)
|
|
997
|
-
]
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
return /* @__PURE__ */ jsxs7(
|
|
1001
|
-
"button",
|
|
1002
|
-
{
|
|
1003
|
-
type: "button",
|
|
1004
|
-
onClick: () => setActiveFilterId(filter.id),
|
|
1005
|
-
className: cn(
|
|
1006
|
-
"inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[10px] font-medium transition-colors",
|
|
1007
|
-
isSelected ? "border-[var(--border-accent)] bg-[var(--accent-surface-soft)] text-[var(--accent-text)]" : "border-[var(--border-subtle)] bg-transparent text-[var(--text-muted)] hover:text-[var(--text-secondary)]"
|
|
1008
|
-
),
|
|
1009
|
-
children: [
|
|
1010
|
-
/* @__PURE__ */ jsx7("span", { children: filter.label }),
|
|
1011
|
-
/* @__PURE__ */ jsx7("span", { className: "text-[9px] opacity-70", children: filterCounts[filter.id] ?? 0 })
|
|
1012
|
-
]
|
|
1013
|
-
},
|
|
1014
|
-
filter.id
|
|
1015
|
-
);
|
|
1016
|
-
}) })
|
|
1017
|
-
] }),
|
|
1018
|
-
/* @__PURE__ */ jsx7("nav", { "aria-label": "Sessions", className: "flex-1 overflow-y-auto px-2 py-2", children: visibleItems.length === 0 ? /* @__PURE__ */ jsx7("div", { className: "rounded-[var(--radius-md)] border border-dashed border-[var(--border-subtle)] bg-[var(--bg-section)] px-3 py-4 text-xs text-[var(--text-muted)]", children: query.trim() ? `No sessions match "${query.trim()}".` : emptyMessage }) : /* @__PURE__ */ jsx7("ul", { className: "space-y-1", children: visibleItems.map((item) => {
|
|
1019
|
-
const session = sessionsById.get(item.id) ?? null;
|
|
1020
|
-
const isActive = currentItemId === item.id;
|
|
1021
|
-
const status = session?.status ?? item.status;
|
|
1022
|
-
const visibleBadges = [
|
|
1023
|
-
...item.isPinned ? [{ id: `${item.id}-pinned`, label: "Pinned", tone: "accent" }] : [],
|
|
1024
|
-
...item.badges ?? []
|
|
1025
|
-
];
|
|
1026
|
-
return /* @__PURE__ */ jsx7("li", { children: /* @__PURE__ */ jsxs7(
|
|
1027
|
-
"div",
|
|
1028
|
-
{
|
|
1029
|
-
className: cn(
|
|
1030
|
-
"group flex items-start gap-2 rounded-[var(--radius-md)] border px-2 py-2 transition-colors",
|
|
1031
|
-
isActive ? "border-[var(--border-accent)] bg-[var(--accent-surface-soft)] shadow-[var(--shadow-card)]" : "border-[var(--border-subtle)] bg-transparent hover:border-[var(--border-default)] hover:bg-[var(--bg-section)]"
|
|
1032
|
-
),
|
|
1033
|
-
children: [
|
|
1034
|
-
/* @__PURE__ */ jsxs7(
|
|
1035
|
-
"button",
|
|
1036
|
-
{
|
|
1037
|
-
type: "button",
|
|
1038
|
-
onClick: () => {
|
|
1039
|
-
if (onSelectItem) {
|
|
1040
|
-
onSelectItem(item);
|
|
1041
|
-
return;
|
|
1042
|
-
}
|
|
1043
|
-
navigateToHref(item.href);
|
|
1044
|
-
},
|
|
1045
|
-
"aria-current": isActive ? "page" : void 0,
|
|
1046
|
-
className: "min-w-0 flex flex-1 items-start gap-2.5 text-left",
|
|
1047
|
-
children: [
|
|
1048
|
-
/* @__PURE__ */ jsx7("span", { className: cn("mt-[5px] h-2 w-2 shrink-0 rounded-full", statusClasses(status)) }),
|
|
1049
|
-
/* @__PURE__ */ jsxs7("div", { className: "min-w-0 flex-1", children: [
|
|
1050
|
-
/* @__PURE__ */ jsx7("div", { className: "truncate text-xs font-medium text-[var(--text-primary)]", children: item.title }),
|
|
1051
|
-
item.subtitle && /* @__PURE__ */ jsx7("div", { className: "mt-0.5 truncate text-[11px] leading-tight text-[var(--text-muted)]", children: item.subtitle }),
|
|
1052
|
-
visibleBadges.length > 0 && /* @__PURE__ */ jsx7("div", { className: "mt-1.5 flex flex-wrap items-center gap-1", children: visibleBadges.map((badge) => /* @__PURE__ */ jsx7(
|
|
1053
|
-
"span",
|
|
1054
|
-
{
|
|
1055
|
-
className: cn(
|
|
1056
|
-
"inline-flex items-center rounded-full border px-1.5 py-0.5 text-[9px] font-medium uppercase tracking-[0.06em]",
|
|
1057
|
-
badgeClasses(badge.tone)
|
|
1058
|
-
),
|
|
1059
|
-
children: badge.label
|
|
1060
|
-
},
|
|
1061
|
-
badge.id
|
|
1062
|
-
)) })
|
|
1063
|
-
] })
|
|
1064
|
-
]
|
|
1065
|
-
}
|
|
1066
|
-
),
|
|
1067
|
-
/* @__PURE__ */ jsxs7("div", { className: "flex shrink-0 items-center gap-2", children: [
|
|
1068
|
-
session?.isForeground && /* @__PURE__ */ jsx7(Badge, { className: "rounded-full border-[var(--border-subtle)] bg-[var(--bg-section)] text-[10px] uppercase tracking-[0.14em] text-[var(--text-secondary)]", children: "Live" }),
|
|
1069
|
-
renderItemActions ? /* @__PURE__ */ jsx7(
|
|
1070
|
-
"div",
|
|
1071
|
-
{
|
|
1072
|
-
className: "opacity-70 transition-opacity hover:opacity-100 group-hover:opacity-100",
|
|
1073
|
-
onClick: (event) => event.stopPropagation(),
|
|
1074
|
-
children: renderItemActions(item, {
|
|
1075
|
-
session,
|
|
1076
|
-
isActive
|
|
1077
|
-
})
|
|
1078
|
-
}
|
|
1079
|
-
) : null
|
|
1080
|
-
] })
|
|
1081
|
-
]
|
|
1082
|
-
}
|
|
1083
|
-
) }, item.id);
|
|
1084
|
-
}) }) }),
|
|
1085
|
-
activityMonitor && /* @__PURE__ */ jsx7("div", { className: "border-t border-[var(--border-subtle)] px-2 py-2", children: activityMonitor }),
|
|
1086
|
-
links.length > 0 && /* @__PURE__ */ jsx7("nav", { "aria-label": "Workspace sections", className: "border-t border-[var(--border-subtle)] px-2 py-2", children: /* @__PURE__ */ jsx7("div", { className: "space-y-0.5", children: links.map((link) => {
|
|
1087
|
-
const Icon = iconForLink(link.icon);
|
|
1088
|
-
return /* @__PURE__ */ jsxs7(
|
|
1089
|
-
"button",
|
|
1090
|
-
{
|
|
1091
|
-
type: "button",
|
|
1092
|
-
onClick: () => {
|
|
1093
|
-
if (onSelectLink) {
|
|
1094
|
-
onSelectLink(link);
|
|
1095
|
-
return;
|
|
1096
|
-
}
|
|
1097
|
-
navigateToHref(link.href);
|
|
1098
|
-
},
|
|
1099
|
-
className: "flex w-full items-center gap-2 rounded-[var(--radius-sm)] px-2 py-1.5 text-left text-xs text-[var(--text-muted)] transition-colors hover:bg-[var(--bg-section)] hover:text-[var(--text-primary)]",
|
|
1100
|
-
children: [
|
|
1101
|
-
/* @__PURE__ */ jsx7(Icon, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
1102
|
-
/* @__PURE__ */ jsx7("span", { className: "truncate", children: link.label })
|
|
1103
|
-
]
|
|
1104
|
-
},
|
|
1105
|
-
link.id
|
|
1106
|
-
);
|
|
1107
|
-
}) }) })
|
|
1108
|
-
] });
|
|
1152
|
+
]
|
|
1153
|
+
}
|
|
1154
|
+
);
|
|
1109
1155
|
}
|
|
1110
1156
|
|
|
1111
1157
|
// src/workspace/session-activity-monitor.tsx
|
|
@@ -1113,15 +1159,15 @@ import { Activity, AlertCircle as AlertCircle2, LoaderCircle, MessageSquareText
|
|
|
1113
1159
|
import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1114
1160
|
function SessionStatusDot({ session }) {
|
|
1115
1161
|
if (session.status === "error") {
|
|
1116
|
-
return /* @__PURE__ */ jsx8(AlertCircle2, { className: "h-3
|
|
1162
|
+
return /* @__PURE__ */ jsx8(AlertCircle2, { className: "h-3 w-3 text-destructive" });
|
|
1117
1163
|
}
|
|
1118
1164
|
if (session.status === "running") {
|
|
1119
|
-
return /* @__PURE__ */ jsx8(LoaderCircle, { className: "h-3
|
|
1165
|
+
return /* @__PURE__ */ jsx8(LoaderCircle, { className: "h-3 w-3 animate-spin text-primary" });
|
|
1120
1166
|
}
|
|
1121
1167
|
if (session.status === "attention-needed") {
|
|
1122
|
-
return /* @__PURE__ */ jsx8(Activity, { className: "h-3
|
|
1168
|
+
return /* @__PURE__ */ jsx8(Activity, { className: "h-3 w-3 text-warning" });
|
|
1123
1169
|
}
|
|
1124
|
-
return /* @__PURE__ */ jsx8("span", { className: "h-
|
|
1170
|
+
return /* @__PURE__ */ jsx8("span", { className: "h-1.5 w-1.5 rounded-full bg-muted-foreground/40" });
|
|
1125
1171
|
}
|
|
1126
1172
|
function navigateToSession(session) {
|
|
1127
1173
|
if (!session.href || typeof window === "undefined") return;
|
|
@@ -1141,41 +1187,38 @@ function SessionActivityMonitor({
|
|
|
1141
1187
|
const sessionLookup = Object.keys(sessionsById).length > 0 ? sessionsById : Object.fromEntries(trackedSessions.map((session) => [session.sessionId, session]));
|
|
1142
1188
|
if (projectActivity.length === 0) {
|
|
1143
1189
|
if (compact) return null;
|
|
1144
|
-
return /* @__PURE__ */ jsx8("div", { className: cn("rounded-
|
|
1190
|
+
return /* @__PURE__ */ jsx8("div", { className: cn("rounded-md border border-dashed border-border bg-muted px-3 py-2.5 text-xs text-muted-foreground", className), children: emptyMessage });
|
|
1145
1191
|
}
|
|
1146
|
-
return /* @__PURE__ */ jsxs8("div", { className: cn("space-y-
|
|
1147
|
-
/* @__PURE__ */ jsxs8("div", { className: "flex items-center justify-between
|
|
1148
|
-
/* @__PURE__ */ jsxs8("
|
|
1149
|
-
/* @__PURE__ */ jsx8(Activity, { className: "h-3
|
|
1150
|
-
"Active
|
|
1192
|
+
return /* @__PURE__ */ jsxs8("div", { className: cn("space-y-1.5", className), children: [
|
|
1193
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex items-center justify-between", children: [
|
|
1194
|
+
/* @__PURE__ */ jsxs8("span", { className: "flex items-center gap-1.5 text-[10px] font-medium uppercase tracking-wider text-muted-foreground", children: [
|
|
1195
|
+
/* @__PURE__ */ jsx8(Activity, { className: "h-3 w-3" }),
|
|
1196
|
+
"Active"
|
|
1151
1197
|
] }),
|
|
1152
|
-
totalRunning > 0 && /* @__PURE__ */
|
|
1153
|
-
totalRunning,
|
|
1154
|
-
" running"
|
|
1155
|
-
] })
|
|
1198
|
+
totalRunning > 0 && /* @__PURE__ */ jsx8("span", { className: "rounded-full bg-primary/10 px-1.5 py-px text-[10px] font-medium text-primary", children: totalRunning })
|
|
1156
1199
|
] }),
|
|
1157
|
-
/* @__PURE__ */ jsx8("div", { className: "space-y-
|
|
1200
|
+
/* @__PURE__ */ jsx8("div", { className: "space-y-1", children: projectActivity.map((project) => {
|
|
1158
1201
|
const label = resolveProjectLabel?.(project.projectId, project.projectLabel) ?? project.projectLabel ?? String(project.projectId);
|
|
1159
1202
|
return /* @__PURE__ */ jsxs8(
|
|
1160
1203
|
"div",
|
|
1161
1204
|
{
|
|
1162
|
-
className: "rounded-
|
|
1205
|
+
className: "rounded-md border border-border bg-muted",
|
|
1163
1206
|
children: [
|
|
1164
|
-
/* @__PURE__ */ jsxs8("div", { className: "flex items-center justify-between gap-
|
|
1165
|
-
/* @__PURE__ */ jsxs8("div", { children: [
|
|
1166
|
-
/* @__PURE__ */ jsx8("div", { className: "text-
|
|
1167
|
-
/* @__PURE__ */ jsxs8("div", { className: "text-
|
|
1207
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex items-center justify-between gap-2 px-2.5 py-1.5", children: [
|
|
1208
|
+
/* @__PURE__ */ jsxs8("div", { className: "min-w-0", children: [
|
|
1209
|
+
/* @__PURE__ */ jsx8("div", { className: "truncate text-xs font-medium text-foreground", children: label }),
|
|
1210
|
+
/* @__PURE__ */ jsxs8("div", { className: "text-[10px] text-muted-foreground", children: [
|
|
1168
1211
|
project.activeSessionCount,
|
|
1169
|
-
"
|
|
1212
|
+
" session",
|
|
1170
1213
|
project.activeSessionCount === 1 ? "" : "s"
|
|
1171
1214
|
] })
|
|
1172
1215
|
] }),
|
|
1173
|
-
project.runningSessionIds.length > 0 && /* @__PURE__ */ jsxs8("span", { className: "
|
|
1216
|
+
project.runningSessionIds.length > 0 && /* @__PURE__ */ jsxs8("span", { className: "shrink-0 text-[10px] text-muted-foreground", children: [
|
|
1174
1217
|
project.runningSessionIds.length,
|
|
1175
1218
|
" live"
|
|
1176
1219
|
] })
|
|
1177
1220
|
] }),
|
|
1178
|
-
!compact && project.runningSessionIds.length > 0 && /* @__PURE__ */ jsx8("div", { className: "
|
|
1221
|
+
!compact && project.runningSessionIds.length > 0 && /* @__PURE__ */ jsx8("div", { className: "border-t border-border px-1 py-0.5", children: project.runningSessionIds.map((sessionId) => {
|
|
1179
1222
|
const session = sessionLookup[sessionId];
|
|
1180
1223
|
if (!session) return null;
|
|
1181
1224
|
return /* @__PURE__ */ jsxs8(
|
|
@@ -1189,16 +1232,11 @@ function SessionActivityMonitor({
|
|
|
1189
1232
|
}
|
|
1190
1233
|
navigateToSession(session);
|
|
1191
1234
|
},
|
|
1192
|
-
className: "flex w-full items-center
|
|
1235
|
+
className: "flex w-full items-center gap-2 rounded-sm px-2 py-1 text-left transition-colors hover:bg-accent",
|
|
1193
1236
|
children: [
|
|
1194
|
-
/* @__PURE__ */
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
/* @__PURE__ */ jsx8("div", { className: "truncate text-sm font-medium text-[var(--text-primary)]", children: session.title ?? "Untitled Session" }),
|
|
1198
|
-
/* @__PURE__ */ jsx8("div", { className: "truncate text-xs text-[var(--text-muted)]", children: session.href ?? session.sessionId })
|
|
1199
|
-
] })
|
|
1200
|
-
] }),
|
|
1201
|
-
/* @__PURE__ */ jsx8(MessageSquareText2, { className: "h-4 w-4 shrink-0 text-[var(--text-dim)]" })
|
|
1237
|
+
/* @__PURE__ */ jsx8(SessionStatusDot, { session }),
|
|
1238
|
+
/* @__PURE__ */ jsx8("span", { className: "min-w-0 truncate text-xs text-foreground", children: session.title ?? "Untitled" }),
|
|
1239
|
+
/* @__PURE__ */ jsx8(MessageSquareText2, { className: "ml-auto h-3 w-3 shrink-0 text-muted-foreground" })
|
|
1202
1240
|
]
|
|
1203
1241
|
},
|
|
1204
1242
|
sessionId
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-W4LM3QYZ.js";
|
|
10
10
|
import {
|
|
11
11
|
Markdown
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-3HW53XTH.js";
|
|
13
13
|
import {
|
|
14
14
|
cn
|
|
15
15
|
} from "./chunk-RQHJBTEU.js";
|
|
@@ -933,7 +933,7 @@ function MarkdownDocumentEditor({
|
|
|
933
933
|
"div",
|
|
934
934
|
{
|
|
935
935
|
className: cn(
|
|
936
|
-
"flex min-h-[
|
|
936
|
+
"flex min-h-[14rem] w-full flex-col overflow-hidden rounded-[var(--radius-lg)] border border-[var(--border-subtle)] bg-[var(--bg-input)]",
|
|
937
937
|
className
|
|
938
938
|
),
|
|
939
939
|
children: [
|
|
@@ -1213,7 +1213,7 @@ function CollaborativeDocumentSurface({
|
|
|
1213
1213
|
placeholder,
|
|
1214
1214
|
autoFocus,
|
|
1215
1215
|
readOnly,
|
|
1216
|
-
className: cn("h-full min-h-[
|
|
1216
|
+
className: cn("h-full min-h-[16rem]", className),
|
|
1217
1217
|
onUpdate: (editor) => {
|
|
1218
1218
|
onChange?.(normalizeMarkdown(htmlToMarkdown(editor.getHTML())));
|
|
1219
1219
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Markdown
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3HW53XTH.js";
|
|
4
4
|
import {
|
|
5
5
|
cn
|
|
6
6
|
} from "./chunk-RQHJBTEU.js";
|
|
@@ -40,7 +40,8 @@ function ChatMessage({
|
|
|
40
40
|
"div",
|
|
41
41
|
{
|
|
42
42
|
className: cn(
|
|
43
|
-
"min-w-0 max-w-[85%] space-y-1
|
|
43
|
+
"min-w-0 max-w-[85%] space-y-1 rounded-[var(--radius-lg)] border",
|
|
44
|
+
"px-[var(--chat-message-px)] py-[var(--chat-message-py)]",
|
|
44
45
|
isUser ? "border-[var(--border-accent)] bg-[var(--depth-3)]" : "border-[var(--border-subtle)] bg-[var(--depth-2)]"
|
|
45
46
|
),
|
|
46
47
|
children: [
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-W4LM3QYZ.js";
|
|
4
4
|
import {
|
|
5
5
|
Markdown
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-3HW53XTH.js";
|
|
7
7
|
import {
|
|
8
8
|
cn
|
|
9
9
|
} from "./chunk-RQHJBTEU.js";
|
|
@@ -484,7 +484,7 @@ import { lazy, Suspense } from "react";
|
|
|
484
484
|
import { Download as Download2, X as X3 } from "lucide-react";
|
|
485
485
|
import { Fragment, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
486
486
|
var LazyDocumentEditorPane = lazy(async () => {
|
|
487
|
-
const module = await import("./document-editor-pane-
|
|
487
|
+
const module = await import("./document-editor-pane-DWWUTTTZ.js");
|
|
488
488
|
return { default: module.DocumentEditorPane };
|
|
489
489
|
});
|
|
490
490
|
function FileArtifactPane({
|
|
@@ -556,7 +556,7 @@ function FileArtifactPane({
|
|
|
556
556
|
className,
|
|
557
557
|
tabs: paneTabs,
|
|
558
558
|
headerActions,
|
|
559
|
-
children: /* @__PURE__ */ jsx4("div", { className: "flex min-h-[
|
|
559
|
+
children: /* @__PURE__ */ jsx4("div", { className: "flex min-h-[12rem] items-center justify-center rounded-[var(--radius-lg)] border border-dashed border-[var(--border-subtle)] bg-[var(--bg-section)] text-sm text-[var(--text-muted)]", children: "Loading editor\u2026" })
|
|
560
560
|
}
|
|
561
561
|
),
|
|
562
562
|
children: /* @__PURE__ */ jsx4(
|