@tangle-network/sandbox-ui 0.27.1 → 0.29.0
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/{chunk-I3IVCGND.js → chunk-AUFV7766.js} +118 -26
- package/dist/{chunk-LGCOOUIX.js → chunk-F2M5MN7K.js} +133 -7
- package/dist/dashboard.d.ts +50 -2
- package/dist/dashboard.js +3 -1
- package/dist/globals.css +6 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +15 -3
- package/dist/styles.css +6 -0
- package/dist/workspace.d.ts +153 -3
- package/dist/workspace.js +13 -3
- package/package.json +1 -1
|
@@ -813,10 +813,69 @@ function RuntimePane({
|
|
|
813
813
|
}
|
|
814
814
|
|
|
815
815
|
// src/workspace/session-sidebar.tsx
|
|
816
|
-
import { useCallback, useMemo as useMemo3, useRef as
|
|
816
|
+
import { useCallback as useCallback2, useImperativeHandle, useMemo as useMemo3, useRef as useRef4, useState as useState4 } from "react";
|
|
817
817
|
import { ArrowLeft, FolderTree, MessageSquareText, Plus, Search as Search2, Settings, Sparkles } from "lucide-react";
|
|
818
818
|
import { useNavbarSessions } from "@tangle-network/ui/stores";
|
|
819
|
+
|
|
820
|
+
// src/workspace/session-optimistic.ts
|
|
821
|
+
import { useCallback, useEffect as useEffect3, useRef as useRef3, useState as useState3 } from "react";
|
|
822
|
+
var SESSION_CREATED_EVENT = "sandbox-thread-created";
|
|
823
|
+
function dispatchSessionCreated(detail, eventName = SESSION_CREATED_EVENT) {
|
|
824
|
+
if (typeof window === "undefined") return;
|
|
825
|
+
window.dispatchEvent(new CustomEvent(eventName, { detail }));
|
|
826
|
+
}
|
|
827
|
+
function toItem(detail) {
|
|
828
|
+
return { updatedAt: /* @__PURE__ */ new Date(), ...detail };
|
|
829
|
+
}
|
|
830
|
+
function useOptimisticSessionItems(items, options = {}) {
|
|
831
|
+
const { listenForCreate = true, eventName = SESSION_CREATED_EVENT } = options;
|
|
832
|
+
const [optimisticItems, setOptimisticItems] = useState3(items);
|
|
833
|
+
useEffect3(() => {
|
|
834
|
+
setOptimisticItems(items);
|
|
835
|
+
}, [items]);
|
|
836
|
+
const add = useCallback((detail) => {
|
|
837
|
+
const next = toItem(detail);
|
|
838
|
+
setOptimisticItems((prev) => [next, ...prev.filter((item) => item.id !== next.id)]);
|
|
839
|
+
}, []);
|
|
840
|
+
const update = useCallback((id, patch) => {
|
|
841
|
+
setOptimisticItems(
|
|
842
|
+
(prev) => prev.map((item) => item.id === id ? { ...item, ...patch } : item)
|
|
843
|
+
);
|
|
844
|
+
}, []);
|
|
845
|
+
const remove = useCallback((id) => {
|
|
846
|
+
setOptimisticItems((prev) => prev.filter((item) => item.id !== id));
|
|
847
|
+
}, []);
|
|
848
|
+
const reset = useCallback(() => setOptimisticItems(items), [items]);
|
|
849
|
+
const addRef = useRef3(add);
|
|
850
|
+
addRef.current = add;
|
|
851
|
+
useEffect3(() => {
|
|
852
|
+
if (!listenForCreate || typeof window === "undefined") return;
|
|
853
|
+
function onCreated(event) {
|
|
854
|
+
const detail = event.detail;
|
|
855
|
+
if (!detail?.id || !detail.title) return;
|
|
856
|
+
addRef.current(detail);
|
|
857
|
+
}
|
|
858
|
+
window.addEventListener(eventName, onCreated);
|
|
859
|
+
return () => window.removeEventListener(eventName, onCreated);
|
|
860
|
+
}, [listenForCreate, eventName]);
|
|
861
|
+
return {
|
|
862
|
+
items: optimisticItems,
|
|
863
|
+
controller: { add, update, remove, reset }
|
|
864
|
+
};
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
// src/workspace/session-sidebar.tsx
|
|
819
868
|
import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
869
|
+
var NO_CONTROLLER = {
|
|
870
|
+
add: () => {
|
|
871
|
+
},
|
|
872
|
+
update: () => {
|
|
873
|
+
},
|
|
874
|
+
remove: () => {
|
|
875
|
+
},
|
|
876
|
+
reset: () => {
|
|
877
|
+
}
|
|
878
|
+
};
|
|
820
879
|
function statusDot(status) {
|
|
821
880
|
switch (status) {
|
|
822
881
|
case "running":
|
|
@@ -888,24 +947,24 @@ function navigateToHref(href) {
|
|
|
888
947
|
window.location.assign(href);
|
|
889
948
|
}
|
|
890
949
|
function useResizable(defaultWidth, min, max, onChange) {
|
|
891
|
-
const [width, setWidth] =
|
|
892
|
-
const dragging =
|
|
893
|
-
const startX =
|
|
894
|
-
const startW =
|
|
895
|
-
const onPointerDown =
|
|
950
|
+
const [width, setWidth] = useState4(defaultWidth);
|
|
951
|
+
const dragging = useRef4(false);
|
|
952
|
+
const startX = useRef4(0);
|
|
953
|
+
const startW = useRef4(0);
|
|
954
|
+
const onPointerDown = useCallback2((e) => {
|
|
896
955
|
dragging.current = true;
|
|
897
956
|
startX.current = e.clientX;
|
|
898
957
|
startW.current = width;
|
|
899
958
|
e.currentTarget.setPointerCapture(e.pointerId);
|
|
900
959
|
}, [width]);
|
|
901
|
-
const onPointerMove =
|
|
960
|
+
const onPointerMove = useCallback2((e) => {
|
|
902
961
|
if (!dragging.current) return;
|
|
903
962
|
const delta = e.clientX - startX.current;
|
|
904
963
|
const next = Math.min(max, Math.max(min, startW.current + delta));
|
|
905
964
|
setWidth(next);
|
|
906
965
|
onChange?.(next);
|
|
907
966
|
}, [min, max, onChange]);
|
|
908
|
-
const onPointerUp =
|
|
967
|
+
const onPointerUp = useCallback2(() => {
|
|
909
968
|
dragging.current = false;
|
|
910
969
|
}, []);
|
|
911
970
|
return { width, onPointerDown, onPointerMove, onPointerUp };
|
|
@@ -933,18 +992,32 @@ function SessionSidebar({
|
|
|
933
992
|
minWidth = 200,
|
|
934
993
|
maxWidth = 400,
|
|
935
994
|
onWidthChange,
|
|
936
|
-
renderItemActions
|
|
995
|
+
renderItemActions,
|
|
996
|
+
optimistic = false,
|
|
997
|
+
optimisticRef
|
|
937
998
|
}) {
|
|
938
|
-
const [query, setQuery] =
|
|
939
|
-
const [activeFilterId, setActiveFilterId] =
|
|
999
|
+
const [query, setQuery] = useState4("");
|
|
1000
|
+
const [activeFilterId, setActiveFilterId] = useState4(defaultFilterId ?? filters[0]?.id ?? "all");
|
|
1001
|
+
const optimisticOptions = typeof optimistic === "object" ? optimistic : void 0;
|
|
1002
|
+
const optimisticState = useOptimisticSessionItems(
|
|
1003
|
+
items,
|
|
1004
|
+
optimistic === false ? { listenForCreate: false } : optimisticOptions
|
|
1005
|
+
);
|
|
1006
|
+
const optimisticEnabled = optimistic !== false;
|
|
1007
|
+
const effectiveItems = optimisticEnabled ? optimisticState.items : items;
|
|
1008
|
+
useImperativeHandle(
|
|
1009
|
+
optimisticRef,
|
|
1010
|
+
() => optimisticEnabled ? optimisticState.controller : NO_CONTROLLER,
|
|
1011
|
+
[optimisticEnabled, optimisticState.controller]
|
|
1012
|
+
);
|
|
940
1013
|
const activeSessions = useNavbarSessions(projectId);
|
|
941
1014
|
const sessionsById = useMemo3(
|
|
942
1015
|
() => new Map(activeSessions.map((session) => [session.sessionId, session])),
|
|
943
1016
|
[activeSessions]
|
|
944
1017
|
);
|
|
945
1018
|
const orderedItems = useMemo3(
|
|
946
|
-
() => sortItems(
|
|
947
|
-
[
|
|
1019
|
+
() => sortItems(effectiveItems, sessionsById),
|
|
1020
|
+
[effectiveItems, sessionsById]
|
|
948
1021
|
);
|
|
949
1022
|
const visibleItems = useMemo3(() => {
|
|
950
1023
|
const normalizedQuery = query.trim().toLowerCase();
|
|
@@ -998,7 +1071,7 @@ function SessionSidebar({
|
|
|
998
1071
|
] })
|
|
999
1072
|
] }) }),
|
|
1000
1073
|
(enableSearch && items.length > 0 || filters.length > 0) && /* @__PURE__ */ jsxs7("div", { className: "shrink-0 border-b border-border px-3 py-2.5", children: [
|
|
1001
|
-
enableSearch &&
|
|
1074
|
+
enableSearch && effectiveItems.length > 0 && /* @__PURE__ */ jsxs7("div", { className: "relative", children: [
|
|
1002
1075
|
/* @__PURE__ */ jsx7(Search2, { className: "pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
|
|
1003
1076
|
/* @__PURE__ */ jsx7(
|
|
1004
1077
|
"input",
|
|
@@ -1136,6 +1209,20 @@ function SessionSidebar({
|
|
|
1136
1209
|
);
|
|
1137
1210
|
}
|
|
1138
1211
|
|
|
1212
|
+
// src/workspace/shell-revalidation.ts
|
|
1213
|
+
function createShellShouldRevalidate(options = {}) {
|
|
1214
|
+
const appPathPrefix = options.appPathPrefix ?? "/app";
|
|
1215
|
+
return function shouldRevalidate(args) {
|
|
1216
|
+
const { currentUrl, nextUrl, formMethod, defaultShouldRevalidate } = args;
|
|
1217
|
+
if (formMethod && formMethod !== "GET") return true;
|
|
1218
|
+
if (currentUrl.pathname !== nextUrl.pathname && currentUrl.pathname.startsWith(appPathPrefix) && nextUrl.pathname.startsWith(appPathPrefix)) {
|
|
1219
|
+
return false;
|
|
1220
|
+
}
|
|
1221
|
+
return defaultShouldRevalidate;
|
|
1222
|
+
};
|
|
1223
|
+
}
|
|
1224
|
+
var shellShouldRevalidate = createShellShouldRevalidate();
|
|
1225
|
+
|
|
1139
1226
|
// src/workspace/session-activity-monitor.tsx
|
|
1140
1227
|
import { Activity, AlertCircle as AlertCircle2, LoaderCircle, MessageSquareText as MessageSquareText2 } from "lucide-react";
|
|
1141
1228
|
import {
|
|
@@ -1238,7 +1325,7 @@ function SessionActivityMonitor({
|
|
|
1238
1325
|
}
|
|
1239
1326
|
|
|
1240
1327
|
// src/workspace/sandbox-workbench.tsx
|
|
1241
|
-
import { useEffect as
|
|
1328
|
+
import { useEffect as useEffect4, useMemo as useMemo4, useState as useState5 } from "react";
|
|
1242
1329
|
import {
|
|
1243
1330
|
Bot,
|
|
1244
1331
|
Boxes,
|
|
@@ -1438,10 +1525,10 @@ function SandboxWorkbench({
|
|
|
1438
1525
|
emptyArtifactState,
|
|
1439
1526
|
className
|
|
1440
1527
|
}) {
|
|
1441
|
-
const [uncontrolledArtifactId, setUncontrolledArtifactId] =
|
|
1528
|
+
const [uncontrolledArtifactId, setUncontrolledArtifactId] = useState5(
|
|
1442
1529
|
activeArtifactId ?? artifacts[0]?.id
|
|
1443
1530
|
);
|
|
1444
|
-
|
|
1531
|
+
useEffect4(() => {
|
|
1445
1532
|
if (activeArtifactId !== void 0) return;
|
|
1446
1533
|
setUncontrolledArtifactId((current) => {
|
|
1447
1534
|
if (artifacts.length === 0) return void 0;
|
|
@@ -1593,7 +1680,7 @@ function AgentWorkbench(props) {
|
|
|
1593
1680
|
}
|
|
1594
1681
|
|
|
1595
1682
|
// src/workspace/audit-results.tsx
|
|
1596
|
-
import { useState as
|
|
1683
|
+
import { useState as useState6 } from "react";
|
|
1597
1684
|
import { CheckCircle as CheckCircle2, XCircle, ChevronRight, Shield } from "lucide-react";
|
|
1598
1685
|
import { jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1599
1686
|
function AuditResults({ forms, crossFormChecks = [], overallScore, className }) {
|
|
@@ -1624,7 +1711,7 @@ function AuditResults({ forms, crossFormChecks = [], overallScore, className })
|
|
|
1624
1711
|
] });
|
|
1625
1712
|
}
|
|
1626
1713
|
function FormAuditCard({ form }) {
|
|
1627
|
-
const [expanded, setExpanded] =
|
|
1714
|
+
const [expanded, setExpanded] = useState6(form.failed > 0);
|
|
1628
1715
|
const allPassed = form.failed === 0 && form.found;
|
|
1629
1716
|
return /* @__PURE__ */ jsxs10("div", { className: "rounded-[var(--radius-md)] border border-border overflow-hidden", children: [
|
|
1630
1717
|
/* @__PURE__ */ jsxs10(
|
|
@@ -1762,7 +1849,7 @@ function TaskBoard({
|
|
|
1762
1849
|
}
|
|
1763
1850
|
|
|
1764
1851
|
// src/workspace/calendar-view.tsx
|
|
1765
|
-
import { useState as
|
|
1852
|
+
import { useState as useState7, useMemo as useMemo6 } from "react";
|
|
1766
1853
|
import { Fragment as Fragment3, jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1767
1854
|
function toDateKey(d) {
|
|
1768
1855
|
return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, "0")}-${String(d.getDate()).padStart(2, "0")}`;
|
|
@@ -1806,11 +1893,11 @@ function CalendarView({
|
|
|
1806
1893
|
}) {
|
|
1807
1894
|
const today = /* @__PURE__ */ new Date();
|
|
1808
1895
|
const todayKey = toDateKey(today);
|
|
1809
|
-
const [internalMonth, setInternalMonth] =
|
|
1896
|
+
const [internalMonth, setInternalMonth] = useState7({
|
|
1810
1897
|
year: today.getFullYear(),
|
|
1811
1898
|
month: today.getMonth()
|
|
1812
1899
|
});
|
|
1813
|
-
const [internalSelectedDay, setInternalSelectedDay] =
|
|
1900
|
+
const [internalSelectedDay, setInternalSelectedDay] = useState7(
|
|
1814
1901
|
todayKey
|
|
1815
1902
|
);
|
|
1816
1903
|
const viewYear = controlledYear ?? internalMonth.year;
|
|
@@ -1983,7 +2070,7 @@ function CalendarView({
|
|
|
1983
2070
|
}
|
|
1984
2071
|
|
|
1985
2072
|
// src/workspace/approval-queue.tsx
|
|
1986
|
-
import { useState as
|
|
2073
|
+
import { useState as useState8, useMemo as useMemo7 } from "react";
|
|
1987
2074
|
import { jsx as jsx13, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1988
2075
|
function ApprovalQueue({
|
|
1989
2076
|
items,
|
|
@@ -1998,9 +2085,9 @@ function ApprovalQueue({
|
|
|
1998
2085
|
emptyState,
|
|
1999
2086
|
showResolved: controlledShowResolved
|
|
2000
2087
|
}) {
|
|
2001
|
-
const [rejectingId, setRejectingId] =
|
|
2002
|
-
const [rejectReason, setRejectReason] =
|
|
2003
|
-
const [showResolved, setShowResolved] =
|
|
2088
|
+
const [rejectingId, setRejectingId] = useState8(null);
|
|
2089
|
+
const [rejectReason, setRejectReason] = useState8("");
|
|
2090
|
+
const [showResolved, setShowResolved] = useState8(controlledShowResolved ?? false);
|
|
2004
2091
|
const pending = useMemo7(
|
|
2005
2092
|
() => items.filter((a) => a.status === "pending"),
|
|
2006
2093
|
[items]
|
|
@@ -2209,7 +2296,12 @@ export {
|
|
|
2209
2296
|
StatusBar,
|
|
2210
2297
|
TerminalPanel,
|
|
2211
2298
|
RuntimePane,
|
|
2299
|
+
SESSION_CREATED_EVENT,
|
|
2300
|
+
dispatchSessionCreated,
|
|
2301
|
+
useOptimisticSessionItems,
|
|
2212
2302
|
SessionSidebar,
|
|
2303
|
+
createShellShouldRevalidate,
|
|
2304
|
+
shellShouldRevalidate,
|
|
2213
2305
|
SessionActivityMonitor,
|
|
2214
2306
|
SandboxWorkbench,
|
|
2215
2307
|
AgentWorkbench,
|
|
@@ -246,6 +246,94 @@ function RailButton({ icon: Icon, label, isActive, badge, onClick, className, sh
|
|
|
246
246
|
}
|
|
247
247
|
return /* @__PURE__ */ jsx2("button", { type: "button", onClick, title: label, className: classes, children: content });
|
|
248
248
|
}
|
|
249
|
+
function RailFlyout({
|
|
250
|
+
icon: Icon,
|
|
251
|
+
label,
|
|
252
|
+
isActive,
|
|
253
|
+
showLabel,
|
|
254
|
+
title,
|
|
255
|
+
children,
|
|
256
|
+
className
|
|
257
|
+
}) {
|
|
258
|
+
const [open, setOpen] = React2.useState(false);
|
|
259
|
+
const ref = React2.useRef(null);
|
|
260
|
+
React2.useEffect(() => {
|
|
261
|
+
if (!open) return;
|
|
262
|
+
const onPointer = (e) => {
|
|
263
|
+
if (ref.current && !ref.current.contains(e.target)) setOpen(false);
|
|
264
|
+
};
|
|
265
|
+
const onKey = (e) => {
|
|
266
|
+
if (e.key === "Escape") setOpen(false);
|
|
267
|
+
};
|
|
268
|
+
document.addEventListener("mousedown", onPointer);
|
|
269
|
+
document.addEventListener("keydown", onKey);
|
|
270
|
+
return () => {
|
|
271
|
+
document.removeEventListener("mousedown", onPointer);
|
|
272
|
+
document.removeEventListener("keydown", onKey);
|
|
273
|
+
};
|
|
274
|
+
}, [open]);
|
|
275
|
+
const triggerClasses = cn(
|
|
276
|
+
"group relative flex shrink-0 items-center rounded-xl transition-all duration-200",
|
|
277
|
+
showLabel ? "w-full justify-start px-3 h-11 gap-3" : "w-11 h-11 justify-center",
|
|
278
|
+
"hover:bg-[var(--accent-surface-soft)] hover:text-[var(--accent-text)]",
|
|
279
|
+
"active:scale-95 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary",
|
|
280
|
+
isActive || open ? "bg-[var(--accent-surface-strong)] text-[var(--accent-text)]" : "text-muted-foreground",
|
|
281
|
+
className
|
|
282
|
+
);
|
|
283
|
+
return /* @__PURE__ */ jsxs("div", { ref, className: cn("relative", showLabel && "w-full"), children: [
|
|
284
|
+
/* @__PURE__ */ jsxs(
|
|
285
|
+
"button",
|
|
286
|
+
{
|
|
287
|
+
type: "button",
|
|
288
|
+
title: label,
|
|
289
|
+
"aria-haspopup": "menu",
|
|
290
|
+
"aria-expanded": open,
|
|
291
|
+
onClick: () => setOpen((v) => !v),
|
|
292
|
+
className: triggerClasses,
|
|
293
|
+
children: [
|
|
294
|
+
/* @__PURE__ */ jsx2(Icon, { className: "h-5 w-5 shrink-0" }),
|
|
295
|
+
showLabel && /* @__PURE__ */ jsx2("span", { className: "text-sm font-medium", children: label }),
|
|
296
|
+
showLabel && /* @__PURE__ */ jsx2(
|
|
297
|
+
ChevronRightIcon,
|
|
298
|
+
{
|
|
299
|
+
className: cn(
|
|
300
|
+
"ml-auto h-4 w-4 shrink-0 text-muted-foreground/60 transition-transform duration-200",
|
|
301
|
+
open && "rotate-180"
|
|
302
|
+
)
|
|
303
|
+
}
|
|
304
|
+
)
|
|
305
|
+
]
|
|
306
|
+
}
|
|
307
|
+
),
|
|
308
|
+
open && // Anchored to the right edge of the rail item; full-height-independent
|
|
309
|
+
// floating card. `onClickCapture` closes after a child link/button fires
|
|
310
|
+
// so selecting a sub-surface dismisses the flyout.
|
|
311
|
+
/* @__PURE__ */ jsxs(
|
|
312
|
+
"div",
|
|
313
|
+
{
|
|
314
|
+
role: "menu",
|
|
315
|
+
onClickCapture: (e) => {
|
|
316
|
+
const el = e.target;
|
|
317
|
+
if (el.closest("a,button")) setOpen(false);
|
|
318
|
+
},
|
|
319
|
+
className: cn(
|
|
320
|
+
"absolute top-0 z-50 min-w-[12rem] rounded-xl border border-border bg-card p-1.5 shadow-lg",
|
|
321
|
+
showLabel ? "left-full ml-2" : "left-full ml-2"
|
|
322
|
+
),
|
|
323
|
+
children: [
|
|
324
|
+
/* @__PURE__ */ jsx2("p", { className: "px-2 pb-1 pt-1 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/70 select-none", children: title ?? label }),
|
|
325
|
+
children
|
|
326
|
+
]
|
|
327
|
+
}
|
|
328
|
+
)
|
|
329
|
+
] });
|
|
330
|
+
}
|
|
331
|
+
function ChevronRightIcon({ className }) {
|
|
332
|
+
return /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className, children: [
|
|
333
|
+
/* @__PURE__ */ jsx2("title", { children: "Expand" }),
|
|
334
|
+
/* @__PURE__ */ jsx2("path", { d: "m9 18 6-6-6-6" })
|
|
335
|
+
] });
|
|
336
|
+
}
|
|
249
337
|
function RailModeButton({ mode, icon, label, badge, className, showLabel }) {
|
|
250
338
|
const { panelOpen, mode: currentMode, switchMode } = useSidebar();
|
|
251
339
|
return /* @__PURE__ */ jsx2(
|
|
@@ -1585,6 +1673,7 @@ function SidebarLayoutInner({
|
|
|
1585
1673
|
panel,
|
|
1586
1674
|
logo,
|
|
1587
1675
|
logoHref,
|
|
1676
|
+
railHeaderContent,
|
|
1588
1677
|
user,
|
|
1589
1678
|
isLoading = false,
|
|
1590
1679
|
onLogout,
|
|
@@ -1608,7 +1697,7 @@ function SidebarLayoutInner({
|
|
|
1608
1697
|
return /* @__PURE__ */ jsxs13("div", { className: cn("min-h-screen bg-background text-foreground", className), children: [
|
|
1609
1698
|
/* @__PURE__ */ jsx14("div", { className: cn(hideBelow && HIDE_BELOW_CLASS[hideBelow]), children: /* @__PURE__ */ jsxs13(Sidebar, { className: sidebarClassName, children: [
|
|
1610
1699
|
/* @__PURE__ */ jsxs13(SidebarRail, { children: [
|
|
1611
|
-
logo !== void 0 && /* @__PURE__ */ jsx14(SidebarRailHeader, { className: railLabels ? "justify-start px-4" : void 0
|
|
1700
|
+
(railHeaderContent !== void 0 || logo !== void 0) && /* @__PURE__ */ jsx14(SidebarRailHeader, { className: cn(railLabels && (railHeaderContent !== void 0 ? "px-2" : "justify-start px-4")), children: railHeaderContent !== void 0 ? railHeaderContent : /* @__PURE__ */ jsx14(
|
|
1612
1701
|
Link,
|
|
1613
1702
|
{
|
|
1614
1703
|
href: logoHref,
|
|
@@ -1617,8 +1706,44 @@ function SidebarLayoutInner({
|
|
|
1617
1706
|
children: logo
|
|
1618
1707
|
}
|
|
1619
1708
|
) }),
|
|
1620
|
-
/* @__PURE__ */ jsx14(SidebarRailNav, { className: railLabels ? "px-2" : void 0, children: navItems.map(
|
|
1621
|
-
(item
|
|
1709
|
+
/* @__PURE__ */ jsx14(SidebarRailNav, { className: railLabels ? "px-2" : void 0, children: navItems.map((item) => {
|
|
1710
|
+
if (item.flyoutItems && item.flyoutItems.length > 0) {
|
|
1711
|
+
const activeSet = new Set(item.flyoutActiveIds ?? []);
|
|
1712
|
+
return /* @__PURE__ */ jsx14(
|
|
1713
|
+
RailFlyout,
|
|
1714
|
+
{
|
|
1715
|
+
icon: item.icon,
|
|
1716
|
+
label: item.label,
|
|
1717
|
+
title: item.label,
|
|
1718
|
+
showLabel: railLabels,
|
|
1719
|
+
isActive: activeId === item.id || item.flyoutItems.some((f) => activeSet.has(f.id)),
|
|
1720
|
+
children: item.flyoutItems.map((f) => {
|
|
1721
|
+
const FIcon = f.icon;
|
|
1722
|
+
const active = activeSet.has(f.id);
|
|
1723
|
+
return /* @__PURE__ */ jsxs13(
|
|
1724
|
+
Link,
|
|
1725
|
+
{
|
|
1726
|
+
href: f.href,
|
|
1727
|
+
to: f.href,
|
|
1728
|
+
onClick: handleNavClick,
|
|
1729
|
+
...f.prefetch !== void 0 ? { prefetch: f.prefetch } : {},
|
|
1730
|
+
className: cn(
|
|
1731
|
+
"flex h-9 items-center gap-2.5 rounded-lg px-2.5 text-sm transition-colors",
|
|
1732
|
+
active ? "bg-[var(--accent-surface-strong)] font-medium text-[var(--accent-text)]" : "text-muted-foreground hover:bg-[var(--accent-surface-soft)] hover:text-[var(--accent-text)]"
|
|
1733
|
+
),
|
|
1734
|
+
children: [
|
|
1735
|
+
/* @__PURE__ */ jsx14(FIcon, { className: "h-4 w-4 shrink-0" }),
|
|
1736
|
+
/* @__PURE__ */ jsx14("span", { className: "truncate", children: f.label })
|
|
1737
|
+
]
|
|
1738
|
+
},
|
|
1739
|
+
f.id
|
|
1740
|
+
);
|
|
1741
|
+
})
|
|
1742
|
+
},
|
|
1743
|
+
item.id
|
|
1744
|
+
);
|
|
1745
|
+
}
|
|
1746
|
+
return item.togglesPanel ? /* @__PURE__ */ jsx14(
|
|
1622
1747
|
RailButton,
|
|
1623
1748
|
{
|
|
1624
1749
|
icon: item.icon,
|
|
@@ -1637,8 +1762,8 @@ function SidebarLayoutInner({
|
|
|
1637
1762
|
onClick: handleNavClick,
|
|
1638
1763
|
...item.prefetch !== void 0 ? { prefetch: item.prefetch } : {}
|
|
1639
1764
|
}
|
|
1640
|
-
) }, item.id)
|
|
1641
|
-
) }),
|
|
1765
|
+
) }, item.id);
|
|
1766
|
+
}) }),
|
|
1642
1767
|
(railFooter !== void 0 || hasProfile) && /* @__PURE__ */ jsxs13(SidebarRailFooter, { className: cn("border-t border-border pt-2", railLabels && "items-stretch px-2"), children: [
|
|
1643
1768
|
railFooter,
|
|
1644
1769
|
hasProfile && (() => {
|
|
@@ -2225,13 +2350,13 @@ function VariantList({
|
|
|
2225
2350
|
|
|
2226
2351
|
// src/dashboard/system-logs.tsx
|
|
2227
2352
|
import { Terminal as Terminal3 } from "lucide-react";
|
|
2228
|
-
import { useEffect as useEffect3, useRef as
|
|
2353
|
+
import { useEffect as useEffect3, useRef as useRef3, useState as useState5 } from "react";
|
|
2229
2354
|
import { jsx as jsx18, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2230
2355
|
function SystemLogsViewer({ apiUrl, token, className }) {
|
|
2231
2356
|
const [logs, setLogs] = useState5([]);
|
|
2232
2357
|
const [error, setError] = useState5(null);
|
|
2233
2358
|
const [isFollowing, setIsFollowing] = useState5(true);
|
|
2234
|
-
const scrollRef =
|
|
2359
|
+
const scrollRef = useRef3(null);
|
|
2235
2360
|
useEffect3(() => {
|
|
2236
2361
|
let timeoutId;
|
|
2237
2362
|
let backoff = 2e3;
|
|
@@ -3107,6 +3232,7 @@ export {
|
|
|
3107
3232
|
SidebarRailFooter,
|
|
3108
3233
|
RailSeparator,
|
|
3109
3234
|
RailButton,
|
|
3235
|
+
RailFlyout,
|
|
3110
3236
|
RailModeButton,
|
|
3111
3237
|
SidebarPanel,
|
|
3112
3238
|
SidebarPanelHeader,
|
package/dist/dashboard.d.ts
CHANGED
|
@@ -69,6 +69,29 @@ interface RailButtonProps {
|
|
|
69
69
|
children?: React.ReactNode;
|
|
70
70
|
}
|
|
71
71
|
declare function RailButton({ icon: Icon, label, isActive, badge, onClick, className, showLabel, asChild, children }: RailButtonProps): react_jsx_runtime.JSX.Element;
|
|
72
|
+
interface RailFlyoutProps {
|
|
73
|
+
icon: React.ComponentType<{
|
|
74
|
+
className?: string;
|
|
75
|
+
}>;
|
|
76
|
+
label: string;
|
|
77
|
+
/** Highlight the trigger (e.g. when a child route is active). */
|
|
78
|
+
isActive?: boolean;
|
|
79
|
+
/** Show the label text beside the icon (labeled rail) vs. icon-only. */
|
|
80
|
+
showLabel?: boolean;
|
|
81
|
+
/** Heading rendered at the top of the open flyout. Defaults to `label`. */
|
|
82
|
+
title?: string;
|
|
83
|
+
/** Flyout body — the sub-surfaces revealed when the item is opened. */
|
|
84
|
+
children: React.ReactNode;
|
|
85
|
+
className?: string;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* A rail entry that reveals its sub-surfaces in a small panel anchored to the
|
|
89
|
+
* RIGHT of the rail item, rather than pushing the rail open with an inline
|
|
90
|
+
* accordion. Opens on click, closes on outside-click, Escape, or selecting an
|
|
91
|
+
* item inside it. Use for a single "door" (e.g. Studio) that fronts several
|
|
92
|
+
* related destinations without permanently spending rail height on them.
|
|
93
|
+
*/
|
|
94
|
+
declare function RailFlyout({ icon: Icon, label, isActive, showLabel, title, children, className, }: RailFlyoutProps): react_jsx_runtime.JSX.Element;
|
|
72
95
|
interface RailModeButtonProps {
|
|
73
96
|
mode: string;
|
|
74
97
|
icon: React.ComponentType<{
|
|
@@ -533,16 +556,34 @@ interface DashboardLayoutProps {
|
|
|
533
556
|
}
|
|
534
557
|
declare function DashboardLayout({ defaultPanelOpen, defaultMode, ...props }: DashboardLayoutProps): react_jsx_runtime.JSX.Element;
|
|
535
558
|
|
|
559
|
+
/** A sub-destination revealed inside a nav item's right-flyout. */
|
|
560
|
+
interface SidebarLayoutFlyoutItem {
|
|
561
|
+
id: string;
|
|
562
|
+
label: string;
|
|
563
|
+
icon: React.ComponentType<{
|
|
564
|
+
className?: string;
|
|
565
|
+
}>;
|
|
566
|
+
href: string;
|
|
567
|
+
prefetch?: "none" | "intent" | "render" | "viewport";
|
|
568
|
+
}
|
|
536
569
|
interface SidebarLayoutNavItem {
|
|
537
570
|
id: string;
|
|
538
571
|
label: string;
|
|
539
572
|
icon: React.ComponentType<{
|
|
540
573
|
className?: string;
|
|
541
574
|
}>;
|
|
542
|
-
/** Destination for link items. Omit when `togglesPanel` is set. */
|
|
575
|
+
/** Destination for link items. Omit when `togglesPanel` or `flyoutItems` is set. */
|
|
543
576
|
href?: string;
|
|
544
577
|
/** Render this item as the panel toggle instead of a link. */
|
|
545
578
|
togglesPanel?: boolean;
|
|
579
|
+
/**
|
|
580
|
+
* Render this item as a right-flyout "door" fronting these sub-destinations
|
|
581
|
+
* instead of a link. The flyout opens to the right of the rail item. Takes
|
|
582
|
+
* precedence over `href`/`togglesPanel`.
|
|
583
|
+
*/
|
|
584
|
+
flyoutItems?: SidebarLayoutFlyoutItem[];
|
|
585
|
+
/** Ids of `flyoutItems` whose route is currently active (drives the door highlight). */
|
|
586
|
+
flyoutActiveIds?: string[];
|
|
546
587
|
badge?: number;
|
|
547
588
|
/**
|
|
548
589
|
* React Router prefetch behavior for this link, forwarded to the underlying
|
|
@@ -563,6 +604,13 @@ interface SidebarLayoutProps {
|
|
|
563
604
|
logo?: React.ReactNode;
|
|
564
605
|
/** Destination for the logo link. */
|
|
565
606
|
logoHref?: string;
|
|
607
|
+
/**
|
|
608
|
+
* Content rendered in the rail header in place of the logo link — e.g. a
|
|
609
|
+
* project/workspace switcher. Spans the header so the app's primary
|
|
610
|
+
* orientation control sits at the top of the rail. When set, `logo`/`logoHref`
|
|
611
|
+
* are ignored. The header keeps its `h-14` height for cross-view alignment.
|
|
612
|
+
*/
|
|
613
|
+
railHeaderContent?: React.ReactNode;
|
|
566
614
|
user?: SidebarUser | null;
|
|
567
615
|
isLoading?: boolean;
|
|
568
616
|
onLogout?: () => void;
|
|
@@ -850,4 +898,4 @@ interface InfoPanelProps {
|
|
|
850
898
|
}
|
|
851
899
|
declare function InfoPanel({ label, title, description, className }: InfoPanelProps): react_jsx_runtime.JSX.Element;
|
|
852
900
|
|
|
853
|
-
export { ActivityFeed, type ActivityFeedProps, type ActivityItem, BackendConfig, type BackendConfigProps, type BackendStatusData, ClusterStatusBar, type ClusterStatusBarProps, type ClusterStatusItem, CreditBalance, type CreditBalanceProps, DashboardLayout, type DashboardLayoutProps, type Profile as DashboardProfile, type SnapshotInfo as DashboardSnapshotInfo, type DashboardUser, type ExposedPort, type GitCommitData, GitPanel, type GitPanelProps, type GitStatusData, HARNESS_BRAND, type HarnessBrand, HarnessLogo, type HarnessLogoProps, HarnessType, INSUFFICIENT_BALANCE_CODE, InfoPanel, type InfoPanelProps, type InsufficientBalance, type Invoice, InvoiceTable, type InvoiceTableProps, type McpServer, MetricAreaChart, type MetricAreaChartProps, type MetricChartPoint, type MetricChartTone, type NavItem, NetworkConfig, type NetworkConfigData, type NetworkConfigProps, NewSandboxCard, type NewSandboxCardProps, OutOfCreditsModal, type OutOfCreditsModalProps, type PlanCardData, PlanCards, type PlanCardsProps, type PlanFeature, PortsList, type PortsListProps, type ProcessInfo, ProcessList, type ProcessListProps, type ProductVariant, ProfileAvatar, type ProfileAvatarProps, ProfileComparison, type ProfileComparisonProps, ProfileSelector, type ProfileSelectorProps, PromoBanner, type PromoBannerProps, RailButton, type RailButtonProps, RailModeButton, type RailModeButtonProps, RailSeparator, type RailSeparatorProps, ResourceMeter, type ResourceMeterProps, ResourceSnapshot, type ResourceSnapshotItem, type ResourceSnapshotProps, SIDEBAR_MOBILE_WIDTH, SIDEBAR_PANEL_WIDTH, SIDEBAR_RAIL_WIDTH, SIDEBAR_TOTAL_WIDTH, SandboxCard, type SandboxCardData, type SandboxCardProps, type SandboxStatus, SandboxTable, type SandboxTableProps, Sidebar, SidebarContent, type SidebarContentProps, SidebarLayout, type SidebarLayoutNavItem, type SidebarLayoutProps, SidebarPanel, SidebarPanelContent, type SidebarPanelContentProps, SidebarPanelHeader, type SidebarPanelHeaderProps, type SidebarPanelProps, type SidebarProps, SidebarProvider, type SidebarProviderProps, SidebarRail, SidebarRailFooter, type SidebarRailFooterProps, SidebarRailHeader, type SidebarRailHeaderProps, SidebarRailNav, type SidebarRailNavProps, type SidebarRailProps, type SidebarUser, SnapshotList, type SnapshotListProps, SystemLogsViewer, type SystemLogsViewerProps, type TeamRole, UsageSummary, type UsageSummaryData, type UsageSummaryProps, type Variant, VariantList, type VariantListProps, type VariantOutcome, type VariantStatus, canAdminSandbox, parseInsufficientBalance, useSidebar };
|
|
901
|
+
export { ActivityFeed, type ActivityFeedProps, type ActivityItem, BackendConfig, type BackendConfigProps, type BackendStatusData, ClusterStatusBar, type ClusterStatusBarProps, type ClusterStatusItem, CreditBalance, type CreditBalanceProps, DashboardLayout, type DashboardLayoutProps, type Profile as DashboardProfile, type SnapshotInfo as DashboardSnapshotInfo, type DashboardUser, type ExposedPort, type GitCommitData, GitPanel, type GitPanelProps, type GitStatusData, HARNESS_BRAND, type HarnessBrand, HarnessLogo, type HarnessLogoProps, HarnessType, INSUFFICIENT_BALANCE_CODE, InfoPanel, type InfoPanelProps, type InsufficientBalance, type Invoice, InvoiceTable, type InvoiceTableProps, type McpServer, MetricAreaChart, type MetricAreaChartProps, type MetricChartPoint, type MetricChartTone, type NavItem, NetworkConfig, type NetworkConfigData, type NetworkConfigProps, NewSandboxCard, type NewSandboxCardProps, OutOfCreditsModal, type OutOfCreditsModalProps, type PlanCardData, PlanCards, type PlanCardsProps, type PlanFeature, PortsList, type PortsListProps, type ProcessInfo, ProcessList, type ProcessListProps, type ProductVariant, ProfileAvatar, type ProfileAvatarProps, ProfileComparison, type ProfileComparisonProps, ProfileSelector, type ProfileSelectorProps, PromoBanner, type PromoBannerProps, RailButton, type RailButtonProps, RailFlyout, type RailFlyoutProps, RailModeButton, type RailModeButtonProps, RailSeparator, type RailSeparatorProps, ResourceMeter, type ResourceMeterProps, ResourceSnapshot, type ResourceSnapshotItem, type ResourceSnapshotProps, SIDEBAR_MOBILE_WIDTH, SIDEBAR_PANEL_WIDTH, SIDEBAR_RAIL_WIDTH, SIDEBAR_TOTAL_WIDTH, SandboxCard, type SandboxCardData, type SandboxCardProps, type SandboxStatus, SandboxTable, type SandboxTableProps, Sidebar, SidebarContent, type SidebarContentProps, SidebarLayout, type SidebarLayoutFlyoutItem, type SidebarLayoutNavItem, type SidebarLayoutProps, SidebarPanel, SidebarPanelContent, type SidebarPanelContentProps, SidebarPanelHeader, type SidebarPanelHeaderProps, type SidebarPanelProps, type SidebarProps, SidebarProvider, type SidebarProviderProps, SidebarRail, SidebarRailFooter, type SidebarRailFooterProps, SidebarRailHeader, type SidebarRailHeaderProps, SidebarRailNav, type SidebarRailNavProps, type SidebarRailProps, type SidebarUser, SnapshotList, type SnapshotListProps, SystemLogsViewer, type SystemLogsViewerProps, type TeamRole, UsageSummary, type UsageSummaryData, type UsageSummaryProps, type Variant, VariantList, type VariantListProps, type VariantOutcome, type VariantStatus, canAdminSandbox, parseInsufficientBalance, useSidebar };
|
package/dist/dashboard.js
CHANGED
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
ProfileSelector,
|
|
20
20
|
PromoBanner,
|
|
21
21
|
RailButton,
|
|
22
|
+
RailFlyout,
|
|
22
23
|
RailModeButton,
|
|
23
24
|
RailSeparator,
|
|
24
25
|
ResourceMeter,
|
|
@@ -47,7 +48,7 @@ import {
|
|
|
47
48
|
canAdminSandbox,
|
|
48
49
|
parseInsufficientBalance,
|
|
49
50
|
useSidebar
|
|
50
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-F2M5MN7K.js";
|
|
51
52
|
import {
|
|
52
53
|
BillingDashboard,
|
|
53
54
|
InfoPanel,
|
|
@@ -106,6 +107,7 @@ export {
|
|
|
106
107
|
ProfileSelector,
|
|
107
108
|
PromoBanner,
|
|
108
109
|
RailButton,
|
|
110
|
+
RailFlyout,
|
|
109
111
|
RailModeButton,
|
|
110
112
|
RailSeparator,
|
|
111
113
|
ResourceMeter,
|
package/dist/globals.css
CHANGED
|
@@ -406,6 +406,9 @@
|
|
|
406
406
|
.left-\[50\%\] {
|
|
407
407
|
left: 50%;
|
|
408
408
|
}
|
|
409
|
+
.left-full {
|
|
410
|
+
left: 100%;
|
|
411
|
+
}
|
|
409
412
|
.z-0 {
|
|
410
413
|
z-index: 0;
|
|
411
414
|
}
|
|
@@ -1102,6 +1105,9 @@
|
|
|
1102
1105
|
.min-w-\[8rem\] {
|
|
1103
1106
|
min-width: 8rem;
|
|
1104
1107
|
}
|
|
1108
|
+
.min-w-\[12rem\] {
|
|
1109
|
+
min-width: 12rem;
|
|
1110
|
+
}
|
|
1105
1111
|
.min-w-\[20px\] {
|
|
1106
1112
|
min-width: 20px;
|
|
1107
1113
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export { ArtifactPane, ArtifactPaneProps, Avatar, AvatarFallback, AvatarImage, Badge, BadgeProps, Button, ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CodeBlock, CodeBlockProps, CopyButton, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropZone, DropZoneProps, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, EmptyStateProps, InlineCode, InlineCodeProps, Input, InputProps, Label, Progress, SegmentedControl, SegmentedControlOption, SegmentedControlProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, SidebarDropZone, SidebarDropZoneProps, Skeleton, SkeletonCard, SkeletonTable, StatCard, StatCardProps, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TerminalDisplay, TerminalCursor as TerminalDisplayCursor, TerminalInput as TerminalDisplayInput, TerminalLine as TerminalDisplayLine, Textarea, TextareaProps, ThemeToggle, Toast, ToastContainer, ToastProvider, UploadFile, UploadProgress, UploadProgressProps, badgeVariants, buttonVariants, useTheme, useToast } from '@tangle-network/ui/primitives';
|
|
2
2
|
export { Logo, LogoProps, TangleKnot } from './primitives.js';
|
|
3
3
|
export { CodeBlock as CodeBlockDisplay, Markdown, MarkdownProps } from '@tangle-network/ui/markdown';
|
|
4
|
-
export { AgentWorkbench, ApprovalConfidenceStat, ApprovalItem, ApprovalQueue, ApprovalQueueProps, AuditCheck, AuditResults, AuditResultsProps, BannerType, CalendarEvent, CalendarView, CalendarViewProps, ContextBadge, DirectoryPane, DirectoryPaneProps, FormAudit, RuntimePane, RuntimePaneProps, SandboxWorkbench, SandboxWorkbenchArtifact, SandboxWorkbenchCustomArtifact, SandboxWorkbenchFileArtifact, SandboxWorkbenchLayoutOptions, SandboxWorkbenchMarkdownArtifact, SandboxWorkbenchOpenUIArtifact, SandboxWorkbenchProps, SandboxWorkbenchSessionProps, SessionActivityMonitor, SessionActivityMonitorProps, SessionSidebar, SessionSidebarBadge, SessionSidebarFilter, SessionSidebarItem, SessionSidebarLink, SessionSidebarProps, StatusBanner, StatusBannerProps, StatusBar, StatusBarProps, TaskBoard, TaskBoardColumn, TaskBoardItem, TaskBoardProps, TerminalLine, TerminalPanel, TerminalProps, WorkspaceLayout, WorkspaceLayoutProps } from './workspace.js';
|
|
4
|
+
export { AgentWorkbench, ApprovalConfidenceStat, ApprovalItem, ApprovalQueue, ApprovalQueueProps, AuditCheck, AuditResults, AuditResultsProps, BannerType, CalendarEvent, CalendarView, CalendarViewProps, ContextBadge, DirectoryPane, DirectoryPaneProps, FormAudit, RuntimePane, RuntimePaneProps, SESSION_CREATED_EVENT, SandboxWorkbench, SandboxWorkbenchArtifact, SandboxWorkbenchCustomArtifact, SandboxWorkbenchFileArtifact, SandboxWorkbenchLayoutOptions, SandboxWorkbenchMarkdownArtifact, SandboxWorkbenchOpenUIArtifact, SandboxWorkbenchProps, SandboxWorkbenchSessionProps, SessionActivityMonitor, SessionActivityMonitorProps, SessionCreatedDetail, SessionOptimisticController, SessionSidebar, SessionSidebarBadge, SessionSidebarFilter, SessionSidebarItem, SessionSidebarLink, SessionSidebarProps, ShellShouldRevalidateArgs, ShellShouldRevalidateOptions, StatusBanner, StatusBannerProps, StatusBar, StatusBarProps, TaskBoard, TaskBoardColumn, TaskBoardItem, TaskBoardProps, TerminalLine, TerminalPanel, TerminalProps, UseOptimisticSessionItemsOptions, WorkspaceLayout, WorkspaceLayoutProps, createShellShouldRevalidate, dispatchSessionCreated, shellShouldRevalidate, useOptimisticSessionItems } from './workspace.js';
|
|
5
5
|
export { OpenUIAction, OpenUIActionsNode, OpenUIArtifactRenderer, OpenUIArtifactRendererProps, OpenUIBadgeNode, OpenUICardNode, OpenUICodeNode, OpenUIComponentNode, OpenUIGridNode, OpenUIHeadingNode, OpenUIKeyValueNode, OpenUIMarkdownNode, OpenUIPrimitive, OpenUISeparatorNode, OpenUIStackNode, OpenUIStatNode, OpenUITableNode, OpenUITextNode } from '@tangle-network/ui/openui';
|
|
6
6
|
export { AgentTimeline, AgentTimelineArtifactItem, AgentTimelineCustomItem, AgentTimelineItem, AgentTimelineMessageItem, AgentTimelineProps, AgentTimelineStatusItem, AgentTimelineTone, AgentTimelineToolGroupItem, AgentTimelineToolItem, ChatContainer, ChatContainerProps, ChatInput, ChatInputProps, ChatMessage, ChatMessageProps, MessageList, MessageListProps, MessageRole, PendingFile, ThinkingIndicator, ThinkingIndicatorProps, UserMessage, UserMessageProps } from '@tangle-network/ui/chat';
|
|
7
7
|
export { AgentSessionControls, AgentSessionControlsProps, AgentSessionHarnessControl, AgentSessionModelControl, AgentSessionReasoningControl, ArtifactAgentDock, ArtifactAgentDockProps, ArtifactAgentDockTransport, ArtifactDockMessage, ArtifactDockStreamEvent, ArtifactKind, ArtifactScope, DEFAULT_REASONING_LEVEL_OPTIONS, HARNESS_MODEL_POLICIES, ReasoningLevel, ReasoningLevelOption, ReasoningLevelPicker, ReasoningLevelPickerProps, createFetchTransport, isModelCompatibleWithHarness, modelProvider, snapHarnessToModel, snapModelToHarness } from './chat.js';
|
|
8
8
|
export { ExpandedToolDetail, ExpandedToolDetailProps, InlineThinkingItem, InlineThinkingItemProps, InlineToolItem, InlineToolItemProps, LiveDuration, RunGroup, RunGroupProps } from '@tangle-network/ui/run';
|
|
9
9
|
export { CommandPreview, DiffPreview, GlobResultsPreview, GrepResultsPreview, QuestionPreview, WebSearchPreview, WriteFilePreview } from '@tangle-network/ui/tool-previews';
|
|
10
10
|
export { FileArtifactPane, FileArtifactPaneProps, FileNode, FilePreview, FilePreviewProps, FileTabData, FileTabs, FileTabsProps, FileTree, FileTreeProps, FileTreeVisibilityOptions, RichFileTree, RichFileTreeGitEntry, RichFileTreeGitStatus, RichFileTreeProps, RichFileTreeThemeVars, filterFileTree } from '@tangle-network/ui/files';
|
|
11
|
-
export { ActivityFeed, ActivityFeedProps, ActivityItem, BackendConfig, BackendConfigProps, BackendStatusData, ClusterStatusBar, ClusterStatusBarProps, ClusterStatusItem, CreditBalance, CreditBalanceProps, DashboardLayout, DashboardLayoutProps, DashboardProfile, DashboardSnapshotInfo, DashboardUser, ExposedPort, GitCommitData, GitPanel, GitPanelProps, GitStatusData, HARNESS_BRAND, HarnessBrand, HarnessLogo, HarnessLogoProps, INSUFFICIENT_BALANCE_CODE, InfoPanel, InfoPanelProps, InsufficientBalance, Invoice, InvoiceTable, InvoiceTableProps, McpServer, MetricAreaChart, MetricAreaChartProps, MetricChartPoint, MetricChartTone, NavItem, NetworkConfig, NetworkConfigData, NetworkConfigProps, NewSandboxCard, NewSandboxCardProps, OutOfCreditsModal, OutOfCreditsModalProps, PlanCardData, PlanCards, PlanCardsProps, PlanFeature, PortsList, PortsListProps, ProcessInfo, ProcessList, ProcessListProps, ProductVariant, ProfileAvatar, ProfileAvatarProps, ProfileComparison, ProfileComparisonProps, ProfileSelector, ProfileSelectorProps, PromoBanner, PromoBannerProps, RailButton, RailButtonProps, RailModeButton, RailModeButtonProps, RailSeparator, RailSeparatorProps, ResourceMeter, ResourceMeterProps, ResourceSnapshot, ResourceSnapshotItem, ResourceSnapshotProps, SIDEBAR_MOBILE_WIDTH, SIDEBAR_PANEL_WIDTH, SIDEBAR_RAIL_WIDTH, SIDEBAR_TOTAL_WIDTH, SandboxCard, SandboxCardData, SandboxCardProps, SandboxStatus, SandboxTable, SandboxTableProps, Sidebar, SidebarContent, SidebarContentProps, SidebarLayout, SidebarLayoutNavItem, SidebarLayoutProps, SidebarPanel, SidebarPanelContent, SidebarPanelContentProps, SidebarPanelHeader, SidebarPanelHeaderProps, SidebarPanelProps, SidebarProps, SidebarProvider, SidebarProviderProps, SidebarRail, SidebarRailFooter, SidebarRailFooterProps, SidebarRailHeader, SidebarRailHeaderProps, SidebarRailNav, SidebarRailNavProps, SidebarRailProps, SidebarUser, SnapshotList, SnapshotListProps, SystemLogsViewer, SystemLogsViewerProps, TeamRole, UsageSummary, UsageSummaryData, UsageSummaryProps, Variant, VariantList, VariantListProps, VariantOutcome, VariantStatus, canAdminSandbox, parseInsufficientBalance, useSidebar } from './dashboard.js';
|
|
11
|
+
export { ActivityFeed, ActivityFeedProps, ActivityItem, BackendConfig, BackendConfigProps, BackendStatusData, ClusterStatusBar, ClusterStatusBarProps, ClusterStatusItem, CreditBalance, CreditBalanceProps, DashboardLayout, DashboardLayoutProps, DashboardProfile, DashboardSnapshotInfo, DashboardUser, ExposedPort, GitCommitData, GitPanel, GitPanelProps, GitStatusData, HARNESS_BRAND, HarnessBrand, HarnessLogo, HarnessLogoProps, INSUFFICIENT_BALANCE_CODE, InfoPanel, InfoPanelProps, InsufficientBalance, Invoice, InvoiceTable, InvoiceTableProps, McpServer, MetricAreaChart, MetricAreaChartProps, MetricChartPoint, MetricChartTone, NavItem, NetworkConfig, NetworkConfigData, NetworkConfigProps, NewSandboxCard, NewSandboxCardProps, OutOfCreditsModal, OutOfCreditsModalProps, PlanCardData, PlanCards, PlanCardsProps, PlanFeature, PortsList, PortsListProps, ProcessInfo, ProcessList, ProcessListProps, ProductVariant, ProfileAvatar, ProfileAvatarProps, ProfileComparison, ProfileComparisonProps, ProfileSelector, ProfileSelectorProps, PromoBanner, PromoBannerProps, RailButton, RailButtonProps, RailFlyout, RailFlyoutProps, RailModeButton, RailModeButtonProps, RailSeparator, RailSeparatorProps, ResourceMeter, ResourceMeterProps, ResourceSnapshot, ResourceSnapshotItem, ResourceSnapshotProps, SIDEBAR_MOBILE_WIDTH, SIDEBAR_PANEL_WIDTH, SIDEBAR_RAIL_WIDTH, SIDEBAR_TOTAL_WIDTH, SandboxCard, SandboxCardData, SandboxCardProps, SandboxStatus, SandboxTable, SandboxTableProps, Sidebar, SidebarContent, SidebarContentProps, SidebarLayout, SidebarLayoutFlyoutItem, SidebarLayoutNavItem, SidebarLayoutProps, SidebarPanel, SidebarPanelContent, SidebarPanelContentProps, SidebarPanelHeader, SidebarPanelHeaderProps, SidebarPanelProps, SidebarProps, SidebarProvider, SidebarProviderProps, SidebarRail, SidebarRailFooter, SidebarRailFooterProps, SidebarRailHeader, SidebarRailHeaderProps, SidebarRailNav, SidebarRailNavProps, SidebarRailProps, SidebarUser, SnapshotList, SnapshotListProps, SystemLogsViewer, SystemLogsViewerProps, TeamRole, UsageSummary, UsageSummaryData, UsageSummaryProps, Variant, VariantList, VariantListProps, VariantOutcome, VariantStatus, canAdminSandbox, parseInsufficientBalance, useSidebar } from './dashboard.js';
|
|
12
12
|
export { B as Backend, a as BackendSelector, b as BackendSelectorProps, H as HARNESS_OPTIONS, c as HarnessPicker, d as HarnessPickerProps, e as HarnessType, f as chatCapableHarnesses } from './harness-picker-lyeEncN4.js';
|
|
13
13
|
export { D as DEFAULT_FEATURED_MODEL_IDS, M as ModelInfo, a as ModelPicker, b as ModelPickerProps, c as ModelPickerVariant, d as canonicalModelId, e as dedupeModels, f as formatContext, g as formatPricing, m as modelDedupKey } from './model-picker-Cmisf9Y8.js';
|
|
14
14
|
export { B as BillingBalance, a as BillingDashboard, b as BillingDashboardProps, c as BillingSubscription, d as BillingUsage, P as PricingPage, e as PricingPageProps, f as PricingTier, T as TemplateCard, g as TemplateCardData, h as TemplateCardProps, U as UsageChart, i as UsageChartProps, j as UsageDataPoint, k as formatPrice } from './template-card-UhV3pmRC.js';
|
package/dist/index.js
CHANGED
|
@@ -120,6 +120,7 @@ import {
|
|
|
120
120
|
CalendarView,
|
|
121
121
|
DirectoryPane,
|
|
122
122
|
RuntimePane,
|
|
123
|
+
SESSION_CREATED_EVENT,
|
|
123
124
|
SandboxWorkbench,
|
|
124
125
|
SessionActivityMonitor,
|
|
125
126
|
SessionSidebar,
|
|
@@ -127,8 +128,12 @@ import {
|
|
|
127
128
|
StatusBar,
|
|
128
129
|
TaskBoard,
|
|
129
130
|
TerminalPanel,
|
|
130
|
-
WorkspaceLayout
|
|
131
|
-
|
|
131
|
+
WorkspaceLayout,
|
|
132
|
+
createShellShouldRevalidate,
|
|
133
|
+
dispatchSessionCreated,
|
|
134
|
+
shellShouldRevalidate,
|
|
135
|
+
useOptimisticSessionItems
|
|
136
|
+
} from "./chunk-AUFV7766.js";
|
|
132
137
|
import {
|
|
133
138
|
OpenUIArtifactRenderer
|
|
134
139
|
} from "./chunk-AZ3AWMTM.js";
|
|
@@ -161,6 +166,7 @@ import {
|
|
|
161
166
|
ProfileSelector,
|
|
162
167
|
PromoBanner,
|
|
163
168
|
RailButton,
|
|
169
|
+
RailFlyout,
|
|
164
170
|
RailModeButton,
|
|
165
171
|
RailSeparator,
|
|
166
172
|
ResourceMeter,
|
|
@@ -189,7 +195,7 @@ import {
|
|
|
189
195
|
canAdminSandbox,
|
|
190
196
|
parseInsufficientBalance,
|
|
191
197
|
useSidebar
|
|
192
|
-
} from "./chunk-
|
|
198
|
+
} from "./chunk-F2M5MN7K.js";
|
|
193
199
|
import {
|
|
194
200
|
BillingDashboard,
|
|
195
201
|
InfoPanel,
|
|
@@ -431,6 +437,7 @@ export {
|
|
|
431
437
|
PromoBanner,
|
|
432
438
|
QuestionPreview,
|
|
433
439
|
RailButton,
|
|
440
|
+
RailFlyout,
|
|
434
441
|
RailModeButton,
|
|
435
442
|
RailSeparator,
|
|
436
443
|
RealtimeSessionRegistry,
|
|
@@ -440,6 +447,7 @@ export {
|
|
|
440
447
|
RichFileTree,
|
|
441
448
|
RunGroup,
|
|
442
449
|
RuntimePane,
|
|
450
|
+
SESSION_CREATED_EVENT,
|
|
443
451
|
SIDEBAR_MOBILE_WIDTH,
|
|
444
452
|
SIDEBAR_PANEL_WIDTH,
|
|
445
453
|
SIDEBAR_RAIL_WIDTH,
|
|
@@ -532,8 +540,10 @@ export {
|
|
|
532
540
|
copyText,
|
|
533
541
|
createAuthFetcher,
|
|
534
542
|
createFetchTransport,
|
|
543
|
+
createShellShouldRevalidate,
|
|
535
544
|
dedupeModels,
|
|
536
545
|
disconnectSession,
|
|
546
|
+
dispatchSessionCreated,
|
|
537
547
|
filterFileTree,
|
|
538
548
|
formatBytes,
|
|
539
549
|
formatContext,
|
|
@@ -567,6 +577,7 @@ export {
|
|
|
567
577
|
setActiveSessionError,
|
|
568
578
|
setActiveSessionRunning,
|
|
569
579
|
setForegroundActiveSession,
|
|
580
|
+
shellShouldRevalidate,
|
|
570
581
|
snapHarnessToModel,
|
|
571
582
|
snapModelToHarness,
|
|
572
583
|
timeAgo,
|
|
@@ -586,6 +597,7 @@ export {
|
|
|
586
597
|
useHasBackgroundRunningSessions,
|
|
587
598
|
useLiveTime,
|
|
588
599
|
useNavbarSessions,
|
|
600
|
+
useOptimisticSessionItems,
|
|
589
601
|
useProjectActivity,
|
|
590
602
|
useProjectSessions,
|
|
591
603
|
usePtySession,
|
package/dist/styles.css
CHANGED
|
@@ -406,6 +406,9 @@
|
|
|
406
406
|
.left-\[50\%\] {
|
|
407
407
|
left: 50%;
|
|
408
408
|
}
|
|
409
|
+
.left-full {
|
|
410
|
+
left: 100%;
|
|
411
|
+
}
|
|
409
412
|
.z-0 {
|
|
410
413
|
z-index: 0;
|
|
411
414
|
}
|
|
@@ -1102,6 +1105,9 @@
|
|
|
1102
1105
|
.min-w-\[8rem\] {
|
|
1103
1106
|
min-width: 8rem;
|
|
1104
1107
|
}
|
|
1108
|
+
.min-w-\[12rem\] {
|
|
1109
|
+
min-width: 12rem;
|
|
1110
|
+
}
|
|
1105
1111
|
.min-w-\[20px\] {
|
|
1106
1112
|
min-width: 20px;
|
|
1107
1113
|
}
|
package/dist/workspace.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
2
|
+
import { ReactNode, Ref } from 'react';
|
|
3
3
|
export { ArtifactPane, ArtifactPaneProps } from '@tangle-network/ui/primitives';
|
|
4
4
|
import { FileNode, FileTreeVisibilityOptions, FileTabData } from '@tangle-network/ui/files';
|
|
5
5
|
import { SessionProjectKey, ActiveSessionStatus, ActiveSessionRecord } from '@tangle-network/ui/stores';
|
|
@@ -160,6 +160,67 @@ interface RuntimePaneProps {
|
|
|
160
160
|
*/
|
|
161
161
|
declare function RuntimePane({ title, subtitle, statusBanner, statusBar, content, terminal, audit, inspector, footer, className, }: RuntimePaneProps): react_jsx_runtime.JSX.Element;
|
|
162
162
|
|
|
163
|
+
/**
|
|
164
|
+
* Optimistic session/thread list: reflect a just-created / renamed / deleted
|
|
165
|
+
* item in the sidebar INSTANTLY, before the server loader round-trips.
|
|
166
|
+
*
|
|
167
|
+
* The shell loader is the source of truth and reconciles in the background
|
|
168
|
+
* (typically the app calls `useRevalidator().revalidate()` after its mutation
|
|
169
|
+
* fetch settles). Until that lands, a local mirror of the loader items carries
|
|
170
|
+
* the optimistic edit so a delete / rename / new-thread does not feel broken
|
|
171
|
+
* for the duration of a D1 round-trip.
|
|
172
|
+
*
|
|
173
|
+
* Two ways to drive it, usable together:
|
|
174
|
+
* 1. A window `CustomEvent` (default name {@link SESSION_CREATED_EVENT}) — the
|
|
175
|
+
* surface that creates a thread (often a different route from the sidebar's
|
|
176
|
+
* route) dispatches it; the sidebar prepends the item with no prop wiring.
|
|
177
|
+
* 2. The imperative {@link SessionOptimisticController} returned here — the
|
|
178
|
+
* sidebar's own action handlers (rename / delete / pin) call it directly.
|
|
179
|
+
*/
|
|
180
|
+
/** Default window-event name for "a session/thread was just created". */
|
|
181
|
+
declare const SESSION_CREATED_EVENT = "sandbox-thread-created";
|
|
182
|
+
/**
|
|
183
|
+
* Payload of a {@link SESSION_CREATED_EVENT}. Only `id` + `title` are required;
|
|
184
|
+
* everything else mirrors {@link SessionSidebarItem}. `updatedAt` defaults to
|
|
185
|
+
* now so the new item sorts to the top.
|
|
186
|
+
*/
|
|
187
|
+
interface SessionCreatedDetail extends Partial<Omit<SessionSidebarItem, "id" | "title">> {
|
|
188
|
+
id: string;
|
|
189
|
+
title: string;
|
|
190
|
+
}
|
|
191
|
+
/** Dispatch the shared "session created" event so any mounted sidebar updates. */
|
|
192
|
+
declare function dispatchSessionCreated(detail: SessionCreatedDetail, eventName?: string): void;
|
|
193
|
+
/** Imperative handle for driving optimistic edits from a mutation handler. */
|
|
194
|
+
interface SessionOptimisticController {
|
|
195
|
+
/** Prepend (or move to top) an item — call before the create fetch settles. */
|
|
196
|
+
add: (item: SessionCreatedDetail) => void;
|
|
197
|
+
/** Patch an existing item in place — e.g. a rename or category change. */
|
|
198
|
+
update: (id: string, patch: Partial<SessionSidebarItem>) => void;
|
|
199
|
+
/** Drop an item — call before the delete fetch settles. */
|
|
200
|
+
remove: (id: string) => void;
|
|
201
|
+
/** Discard all optimistic edits and snap back to the loader items. */
|
|
202
|
+
reset: () => void;
|
|
203
|
+
}
|
|
204
|
+
interface UseOptimisticSessionItemsOptions {
|
|
205
|
+
/**
|
|
206
|
+
* Listen for the shared window create-event and prepend its item. Set `false`
|
|
207
|
+
* to drive optimistic state purely through the imperative controller.
|
|
208
|
+
* Defaults to `true`.
|
|
209
|
+
*/
|
|
210
|
+
listenForCreate?: boolean;
|
|
211
|
+
/** Override the window event name to listen for. */
|
|
212
|
+
eventName?: string;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Mirror `items` with optimistic add/update/remove on top. The mirror re-syncs
|
|
216
|
+
* whenever `items` changes (the loader is authoritative), so an optimistic edit
|
|
217
|
+
* is naturally superseded once the server result arrives.
|
|
218
|
+
*/
|
|
219
|
+
declare function useOptimisticSessionItems(items: SessionSidebarItem[], options?: UseOptimisticSessionItemsOptions): {
|
|
220
|
+
items: SessionSidebarItem[];
|
|
221
|
+
controller: SessionOptimisticController;
|
|
222
|
+
};
|
|
223
|
+
|
|
163
224
|
interface SessionSidebarItem {
|
|
164
225
|
id: string;
|
|
165
226
|
title: string;
|
|
@@ -218,8 +279,97 @@ interface SessionSidebarProps {
|
|
|
218
279
|
session: ActiveSessionRecord | null;
|
|
219
280
|
isActive: boolean;
|
|
220
281
|
}) => ReactNode;
|
|
282
|
+
/**
|
|
283
|
+
* Opt into optimistic item updates: the sidebar keeps a local mirror of
|
|
284
|
+
* `items` so a just-created / renamed / deleted thread shows instantly,
|
|
285
|
+
* before the loader round-trips. Pass `true` for defaults, or an options
|
|
286
|
+
* object to tune the window create-event. Off by default — existing callers
|
|
287
|
+
* render `items` verbatim and are unaffected.
|
|
288
|
+
*/
|
|
289
|
+
optimistic?: boolean | UseOptimisticSessionItemsOptions;
|
|
290
|
+
/**
|
|
291
|
+
* Ref to the imperative optimistic controller (`add` / `update` / `remove` /
|
|
292
|
+
* `reset`). Drive optimistic edits from the consumer's own rename/delete/pin
|
|
293
|
+
* handlers. Only populated when `optimistic` is enabled.
|
|
294
|
+
*/
|
|
295
|
+
optimisticRef?: Ref<SessionOptimisticController | null>;
|
|
221
296
|
}
|
|
222
|
-
declare function SessionSidebar({ title, subtitle, projectId, items, currentItemId, createLabel, onCreate, onSelectItem, onSelectLink, links, className, emptyMessage, searchPlaceholder, enableSearch, activityMonitor, filters, defaultFilterId, resizable, defaultWidth, minWidth, maxWidth, onWidthChange, renderItemActions, }: SessionSidebarProps): react_jsx_runtime.JSX.Element;
|
|
297
|
+
declare function SessionSidebar({ title, subtitle, projectId, items, currentItemId, createLabel, onCreate, onSelectItem, onSelectLink, links, className, emptyMessage, searchPlaceholder, enableSearch, activityMonitor, filters, defaultFilterId, resizable, defaultWidth, minWidth, maxWidth, onWidthChange, renderItemActions, optimistic, optimisticRef, }: SessionSidebarProps): react_jsx_runtime.JSX.Element;
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* Snappy in-app navigation: a shared `shouldRevalidate` rule for the agent-app
|
|
301
|
+
* shell route(s) that own the workspace-list / sidebar loader.
|
|
302
|
+
*
|
|
303
|
+
* The shell loader (user + workspace list, sidebar state) runs on every
|
|
304
|
+
* navigation, but its data does not change just by moving between in-app pages.
|
|
305
|
+
* Refetching it on every internal GET nav adds a loader round-trip to each
|
|
306
|
+
* click — on Cloudflare Workers + D1 (HTTP-proxied) that is a visible stall.
|
|
307
|
+
*
|
|
308
|
+
* This helper encodes the rule that makes nav feel instant WITHOUT stranding
|
|
309
|
+
* freshly-mutated data:
|
|
310
|
+
*
|
|
311
|
+
* - Non-GET navigation (form submit / action) → always revalidate.
|
|
312
|
+
* - Internal app→app navigation that CHANGES the path → skip revalidation.
|
|
313
|
+
* - Imperative `useRevalidator().revalidate()` (which targets the SAME url,
|
|
314
|
+
* so `currentUrl.pathname === nextUrl.pathname`) → revalidate. Creating a
|
|
315
|
+
* project / thread typically goes through a raw `fetch`, so a same-url
|
|
316
|
+
* revalidate is the ONLY way the new row reaches the shell loader; the
|
|
317
|
+
* same-path carve-out below is what keeps that working. Suppressing it is
|
|
318
|
+
* the project-switcher regression — do not "simplify" it away.
|
|
319
|
+
* - Anything else (cross-path-prefix nav, entering/leaving the app) →
|
|
320
|
+
* defer to `defaultShouldRevalidate`.
|
|
321
|
+
*
|
|
322
|
+
* Framework-agnostic by design: sandbox-ui does not depend on react-router, so
|
|
323
|
+
* this takes a plain args object. The shape is a structural subset of
|
|
324
|
+
* react-router's `ShouldRevalidateFunctionArgs`, so an app can wire it as a
|
|
325
|
+
* route export with no adapter:
|
|
326
|
+
*
|
|
327
|
+
* ```ts
|
|
328
|
+
* // app/routes/app.tsx
|
|
329
|
+
* import { shellShouldRevalidate } from "@tangle-network/sandbox-ui/workspace";
|
|
330
|
+
* export const shouldRevalidate = shellShouldRevalidate;
|
|
331
|
+
* ```
|
|
332
|
+
*
|
|
333
|
+
* `shouldRevalidate` MUST be a per-app react-router route export — it cannot be
|
|
334
|
+
* exported FROM a library on the app's behalf — so the "out of the box" win is
|
|
335
|
+
* the one-line re-export above instead of every app re-deriving the rule (and
|
|
336
|
+
* re-introducing the same-url bug).
|
|
337
|
+
*/
|
|
338
|
+
/**
|
|
339
|
+
* The subset of react-router's `ShouldRevalidateFunctionArgs` this rule reads.
|
|
340
|
+
* Kept structural so callers can pass the full react-router args object as-is.
|
|
341
|
+
*/
|
|
342
|
+
interface ShellShouldRevalidateArgs {
|
|
343
|
+
currentUrl: URL;
|
|
344
|
+
nextUrl: URL;
|
|
345
|
+
formMethod?: string;
|
|
346
|
+
defaultShouldRevalidate: boolean;
|
|
347
|
+
}
|
|
348
|
+
interface ShellShouldRevalidateOptions {
|
|
349
|
+
/**
|
|
350
|
+
* Path prefix that marks "inside the app shell". Internal navigation between
|
|
351
|
+
* two paths under this prefix skips the shell-loader refetch. Defaults to
|
|
352
|
+
* `"/app"`.
|
|
353
|
+
*/
|
|
354
|
+
appPathPrefix?: string;
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Build a `shouldRevalidate` function for the shell route under `appPathPrefix`.
|
|
358
|
+
* Use this when the app mounts under a non-default prefix; otherwise prefer the
|
|
359
|
+
* ready-made {@link shellShouldRevalidate} export.
|
|
360
|
+
*/
|
|
361
|
+
declare function createShellShouldRevalidate(options?: ShellShouldRevalidateOptions): (args: ShellShouldRevalidateArgs) => boolean;
|
|
362
|
+
/**
|
|
363
|
+
* Ready-made shell `shouldRevalidate` for apps mounted under `/app`. Wire it as
|
|
364
|
+
* a one-line route export:
|
|
365
|
+
*
|
|
366
|
+
* ```ts
|
|
367
|
+
* export const shouldRevalidate = shellShouldRevalidate;
|
|
368
|
+
* ```
|
|
369
|
+
*
|
|
370
|
+
* For a non-`/app` prefix, use {@link createShellShouldRevalidate}.
|
|
371
|
+
*/
|
|
372
|
+
declare const shellShouldRevalidate: (args: ShellShouldRevalidateArgs) => boolean;
|
|
223
373
|
|
|
224
374
|
interface SessionActivityMonitorProps {
|
|
225
375
|
className?: string;
|
|
@@ -478,4 +628,4 @@ interface ApprovalQueueProps {
|
|
|
478
628
|
*/
|
|
479
629
|
declare function ApprovalQueue({ items, className, onApprove, onReject, renderItemDetail, renderTypeBadge, renderStats, canResolve, header, emptyState, showResolved: controlledShowResolved, }: ApprovalQueueProps): react_jsx_runtime.JSX.Element;
|
|
480
630
|
|
|
481
|
-
export { AgentWorkbench, type ApprovalConfidenceStat, type ApprovalItem, ApprovalQueue, type ApprovalQueueProps, type AuditCheck, AuditResults, type AuditResultsProps, type BannerType, type CalendarEvent, CalendarView, type CalendarViewProps, type ContextBadge, DirectoryPane, type DirectoryPaneProps, type FormAudit, RuntimePane, type RuntimePaneProps, SandboxWorkbench, type SandboxWorkbenchArtifact, type SandboxWorkbenchCustomArtifact, type SandboxWorkbenchFileArtifact, type SandboxWorkbenchLayoutOptions, type SandboxWorkbenchMarkdownArtifact, type SandboxWorkbenchOpenUIArtifact, type SandboxWorkbenchProps, type SandboxWorkbenchSessionProps, SessionActivityMonitor, type SessionActivityMonitorProps, SessionSidebar, type SessionSidebarBadge, type SessionSidebarFilter, type SessionSidebarItem, type SessionSidebarLink, type SessionSidebarProps, StatusBanner, type StatusBannerProps, StatusBar, type StatusBarProps, TaskBoard, type TaskBoardColumn, type TaskBoardItem, type TaskBoardProps, type TerminalLine, TerminalPanel, type TerminalProps, WorkspaceLayout, type WorkspaceLayoutProps };
|
|
631
|
+
export { AgentWorkbench, type ApprovalConfidenceStat, type ApprovalItem, ApprovalQueue, type ApprovalQueueProps, type AuditCheck, AuditResults, type AuditResultsProps, type BannerType, type CalendarEvent, CalendarView, type CalendarViewProps, type ContextBadge, DirectoryPane, type DirectoryPaneProps, type FormAudit, RuntimePane, type RuntimePaneProps, SESSION_CREATED_EVENT, SandboxWorkbench, type SandboxWorkbenchArtifact, type SandboxWorkbenchCustomArtifact, type SandboxWorkbenchFileArtifact, type SandboxWorkbenchLayoutOptions, type SandboxWorkbenchMarkdownArtifact, type SandboxWorkbenchOpenUIArtifact, type SandboxWorkbenchProps, type SandboxWorkbenchSessionProps, SessionActivityMonitor, type SessionActivityMonitorProps, type SessionCreatedDetail, type SessionOptimisticController, SessionSidebar, type SessionSidebarBadge, type SessionSidebarFilter, type SessionSidebarItem, type SessionSidebarLink, type SessionSidebarProps, type ShellShouldRevalidateArgs, type ShellShouldRevalidateOptions, StatusBanner, type StatusBannerProps, StatusBar, type StatusBarProps, TaskBoard, type TaskBoardColumn, type TaskBoardItem, type TaskBoardProps, type TerminalLine, TerminalPanel, type TerminalProps, type UseOptimisticSessionItemsOptions, WorkspaceLayout, type WorkspaceLayoutProps, createShellShouldRevalidate, dispatchSessionCreated, shellShouldRevalidate, useOptimisticSessionItems };
|
package/dist/workspace.js
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
CalendarView,
|
|
7
7
|
DirectoryPane,
|
|
8
8
|
RuntimePane,
|
|
9
|
+
SESSION_CREATED_EVENT,
|
|
9
10
|
SandboxWorkbench,
|
|
10
11
|
SessionActivityMonitor,
|
|
11
12
|
SessionSidebar,
|
|
@@ -13,8 +14,12 @@ import {
|
|
|
13
14
|
StatusBar,
|
|
14
15
|
TaskBoard,
|
|
15
16
|
TerminalPanel,
|
|
16
|
-
WorkspaceLayout
|
|
17
|
-
|
|
17
|
+
WorkspaceLayout,
|
|
18
|
+
createShellShouldRevalidate,
|
|
19
|
+
dispatchSessionCreated,
|
|
20
|
+
shellShouldRevalidate,
|
|
21
|
+
useOptimisticSessionItems
|
|
22
|
+
} from "./chunk-AUFV7766.js";
|
|
18
23
|
import "./chunk-EI44GEQ5.js";
|
|
19
24
|
export {
|
|
20
25
|
AgentWorkbench,
|
|
@@ -24,6 +29,7 @@ export {
|
|
|
24
29
|
CalendarView,
|
|
25
30
|
DirectoryPane,
|
|
26
31
|
RuntimePane,
|
|
32
|
+
SESSION_CREATED_EVENT,
|
|
27
33
|
SandboxWorkbench,
|
|
28
34
|
SessionActivityMonitor,
|
|
29
35
|
SessionSidebar,
|
|
@@ -31,5 +37,9 @@ export {
|
|
|
31
37
|
StatusBar,
|
|
32
38
|
TaskBoard,
|
|
33
39
|
TerminalPanel,
|
|
34
|
-
WorkspaceLayout
|
|
40
|
+
WorkspaceLayout,
|
|
41
|
+
createShellShouldRevalidate,
|
|
42
|
+
dispatchSessionCreated,
|
|
43
|
+
shellShouldRevalidate,
|
|
44
|
+
useOptimisticSessionItems
|
|
35
45
|
};
|
package/package.json
CHANGED