@tangle-network/sandbox-ui 0.117.3 → 0.118.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.
@@ -2,7 +2,7 @@ import { r as modelBrandFor, t as ModelBrandStack } from "./model-brand-hMyDTUqB
2
2
  import { a as buildWorkflowGraph, c as triggerNodeIndex, d as providerLabel, f as shortModel, g as fmtTokens, h as fmtDuration, l as wfEdgeId, m as fmtCost, o as isStructuralKind, p as clampPreview, t as COMPACT_NODE_SIZE, u as worstSeverity } from "./model-I-NIxeM-.js";
3
3
  import { t as ProviderIcon } from "./provider-logo-BiuiO_c2.js";
4
4
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
- import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
5
+ import { createContext, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
6
6
  import { AlertTriangle, Bell, Box, Cable, Camera, Circle, Clock, Code, GitBranch, Maximize2, Minimize2, Plus, Repeat, ScanSearch, Sparkles, UserCheck, Webhook, X, Zap } from "lucide-react";
7
7
  import { Background, BaseEdge, Controls, EdgeLabelRenderer, Handle, MarkerType, Panel, Position, ReactFlow, getSmoothStepPath, getViewportForBounds, useEdgesState, useNodesState } from "@xyflow/react";
8
8
  import "@xyflow/react/dist/style.css";
@@ -949,21 +949,34 @@ const lerp = (a, b, t) => a + (b - a) * t;
949
949
  /** The layout tween's easing — gentle into and out of the motion, so neither
950
950
  * end of the morph reads as a snap. */
951
951
  const easeInOutCubic = (t) => t < .5 ? 4 * t * t * t : 1 - (-2 * t + 2) ** 3 / 2;
952
- /** Tracks the app's dark/light class so React Flow's chrome (edges, controls,
953
- * background) themes with the rest of the app. */
954
- function useColorMode() {
955
- const [mode, setMode] = useState(() => typeof document !== "undefined" && document.documentElement.classList.contains("dark") ? "dark" : "light");
956
- useEffect(() => {
957
- const el = document.documentElement;
958
- const update = () => setMode(el.classList.contains("dark") ? "dark" : "light");
952
+ /** React Flow adds its own .light/.dark class below the graph wrapper. Read
953
+ * that wrapper's inherited scheme so a nested WorkspaceLayout theme wins over
954
+ * the page root without React Flow's class influencing the answer. */
955
+ function currentColorMode(anchor) {
956
+ if (typeof document === "undefined" || typeof window === "undefined") return "light";
957
+ const scheme = window.getComputedStyle(anchor ?? document.documentElement).colorScheme;
958
+ if (scheme.startsWith("dark")) return "dark";
959
+ if (scheme.startsWith("light")) return "light";
960
+ return (anchor ?? document.documentElement).closest(".dark") ? "dark" : "light";
961
+ }
962
+ function useColorMode(wrapperRef, hasGraph) {
963
+ const [mode, setMode] = useState(() => currentColorMode(null));
964
+ useLayoutEffect(() => {
965
+ const anchor = hasGraph ? wrapperRef.current : null;
966
+ const update = () => setMode(currentColorMode(anchor));
959
967
  update();
960
968
  const observer = new MutationObserver(update);
961
- observer.observe(el, {
969
+ for (let el = anchor ?? document.documentElement; el; el = el.parentElement) observer.observe(el, {
962
970
  attributes: true,
963
- attributeFilter: ["class"]
971
+ attributeFilter: [
972
+ "class",
973
+ "data-theme",
974
+ "data-sandbox-theme",
975
+ "style"
976
+ ]
964
977
  });
965
978
  return () => observer.disconnect();
966
- }, []);
979
+ }, [wrapperRef, hasGraph]);
967
980
  return mode;
968
981
  }
969
982
  /** Flow direction for the current graph, so the node component can place its
@@ -1608,7 +1621,6 @@ function WorkflowGraph({ yaml, variant = "full", direction = "LR", defaultCompac
1608
1621
  const insertAtNode = editable ? onNodeInsert : void 0;
1609
1622
  const addTrigger = editable ? onTriggerAdd : void 0;
1610
1623
  const deleteTrigger = editable ? onTriggerDelete : void 0;
1611
- const colorMode = useColorMode();
1612
1624
  const isPreview = variant === "preview";
1613
1625
  const [userCompact, setUserCompact] = useState(defaultCompact ?? nodeState === void 0);
1614
1626
  /**
@@ -1646,6 +1658,7 @@ function WorkflowGraph({ yaml, variant = "full", direction = "LR", defaultCompac
1646
1658
  insertArmed,
1647
1659
  declaredEdges
1648
1660
  ]);
1661
+ const colorMode = useColorMode(wrapperRef, !structural.error && structural.nodes.length > 0);
1649
1662
  const nodeBoxes = useMemo(() => structural.nodes.map((node) => ({
1650
1663
  x: node.position.x,
1651
1664
  y: node.position.y,
package/dist/chat.js CHANGED
@@ -1,2 +1,2 @@
1
- import { a as ThinkingIndicator, c as createFetchTransport, d as AgentProfilePicker, f as DEFAULT_REASONING_LEVEL_OPTIONS, i as MessageList, l as modelProvider, m as ReasoningLevelPicker, n as ChatContainer, o as UserMessage, p as HARNESS_REASONING_OPTIONS, r as ChatMessage, s as ArtifactAgentDock, t as AgentTimeline, u as snapHarnessToModel } from "./chat-Ci6Xi1rd.js";
1
+ import { a as ThinkingIndicator, c as createFetchTransport, d as AgentProfilePicker, f as DEFAULT_REASONING_LEVEL_OPTIONS, i as MessageList, l as modelProvider, m as ReasoningLevelPicker, n as ChatContainer, o as UserMessage, p as HARNESS_REASONING_OPTIONS, r as ChatMessage, s as ArtifactAgentDock, t as AgentTimeline, u as snapHarnessToModel } from "./chat-Xqhcoxmw.js";
2
2
  export { AgentProfilePicker, AgentTimeline, ArtifactAgentDock, ChatContainer, ChatMessage, DEFAULT_REASONING_LEVEL_OPTIONS, HARNESS_REASONING_OPTIONS, MessageList, ReasoningLevelPicker, ThinkingIndicator, UserMessage, createFetchTransport, modelProvider, snapHarnessToModel };
@@ -1,2 +1,2 @@
1
- import { t as AgentMessagingConnection } from "./connections-DDRGYDvF.js";
1
+ import { t as AgentMessagingConnection } from "./connections-C5DxYxvz.js";
2
2
  export { AgentMessagingConnection };
@@ -2,8 +2,8 @@ import { t as cn$1 } from "./utils-DzWbktWG.js";
2
2
  import { Badge, Button, EmptyState, Input } from "@tangle-network/ui/primitives";
3
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
4
  import { useEffect, useMemo, useRef, useState } from "react";
5
- import { focusField } from "@tangle-network/ui/utils";
6
5
  import { Blocks, Check, ChevronDown, ChevronRight, Copy, Search } from "lucide-react";
6
+ import { focusField } from "@tangle-network/ui/utils";
7
7
  //#region src/connectors/integration-step-yaml.ts
8
8
  function asSchemaObject(value) {
9
9
  return typeof value === "object" && value !== null ? value : null;
@@ -1,4 +1,4 @@
1
- import { Wt as Logo, o as Button$1 } from "./primitives-BnVvXgcl.js";
1
+ import { Wt as Logo, o as Button$1 } from "./primitives-N-59i3-7.js";
2
2
  import { t as cn$1 } from "./utils-DzWbktWG.js";
3
3
  import { n as MOTION_SURFACE, r as MOTION_TRAVEL, t as MOTION_CONTROL } from "./motion-DkyBRJb9.js";
4
4
  import { i as moonshot_default } from "./model-brand-hMyDTUqB.js";
@@ -7,10 +7,10 @@ import { Avatar, AvatarFallback, AvatarImage, Badge, Button, DropdownMenu, Dropd
7
7
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
8
  import * as React$1 from "react";
9
9
  import { useEffect, useRef, useState } from "react";
10
- import { focusField, focusFieldWithin, focusRing, focusRingInset, timeAgo } from "@tangle-network/ui/utils";
11
10
  import { createPortal } from "react-dom";
12
11
  import { Activity, BarChart2, Bell, Bot, Box, Camera, Check, CheckCircle2, ChevronDown, ChevronLeft, ChevronRight, Clock, Code2, Copy, Cpu, DollarSign, Download, ExternalLink, File, FileEdit, FilePlus, FileText, GitBranch, GitCommit, Globe, HardDrive, Key, Layers, Loader2, MemoryStick, MessageSquare, Monitor, MoreHorizontal, MoreVertical, Network, PanelLeft, Play, Plug, Plus, Power, PowerOff, RefreshCw, RotateCcw, Server, Settings, ShieldAlert, Skull, Terminal, Timer, Trash2, User, Users, Wrench, X, XCircle } from "lucide-react";
13
- import * as Select$1 from "@radix-ui/react-select";
12
+ import { focusField, focusFieldWithin, focusRing, focusRingInset, timeAgo } from "@tangle-network/ui/utils";
13
+ import * as Select from "@radix-ui/react-select";
14
14
  //#region src/dashboard/sidebar-context.tsx
15
15
  const PANEL_OPEN_KEY = "sandbox-sidebar-panel-open";
16
16
  const RAIL_COLLAPSED_KEY = "sandbox-sidebar-rail-collapsed";
@@ -2415,7 +2415,7 @@ function BackendSelector({ backends, selected, onChange, variant = "pill", label
2415
2415
  const current = backends.find((b) => b.type === selected);
2416
2416
  const triggerText = current?.label ?? placeholder;
2417
2417
  const ariaLabel = label ? `${label}: ${triggerText}` : triggerText;
2418
- const trigger = variant === "pill" ? /* @__PURE__ */ jsxs(Select$1.Trigger, {
2418
+ const trigger = variant === "pill" ? /* @__PURE__ */ jsxs(Select.Trigger, {
2419
2419
  "aria-label": ariaLabel,
2420
2420
  className: cn$1("inline-flex h-8 items-center gap-1.5 rounded-lg border border-[var(--md3-outline-variant)] bg-surface-container", "px-2.5 text-xs font-medium text-foreground shadow-sm", "transition-colors duration-[var(--transition-fast)]", "hover:border-[var(--md3-outline-variant)] hover:bg-surface-container-high", focusRing, "data-[state=open]:border-[var(--md3-outline)] data-[state=open]:bg-surface-container-high", "disabled:opacity-50 disabled:cursor-not-allowed", triggerClassName),
2421
2421
  children: [
@@ -2428,12 +2428,12 @@ function BackendSelector({ backends, selected, onChange, variant = "pill", label
2428
2428
  className: "sr-only",
2429
2429
  children: current.description
2430
2430
  }),
2431
- /* @__PURE__ */ jsx(Select$1.Icon, {
2431
+ /* @__PURE__ */ jsx(Select.Icon, {
2432
2432
  asChild: true,
2433
2433
  children: /* @__PURE__ */ jsx(ChevronDown, { className: "h-3 w-3 shrink-0 text-muted-foreground transition-transform duration-[var(--transition-fast)] data-[state=open]:rotate-180" })
2434
2434
  })
2435
2435
  ]
2436
- }) : /* @__PURE__ */ jsxs(Select$1.Trigger, {
2436
+ }) : /* @__PURE__ */ jsxs(Select.Trigger, {
2437
2437
  "aria-label": ariaLabel,
2438
2438
  className: cn$1("flex w-full items-center justify-between gap-2 rounded-[var(--radius-md)]", "border border-[var(--md3-outline-variant)] bg-surface-container px-3 py-2.5 text-sm text-left", "transition-colors duration-[var(--transition-fast)]", "hover:border-[var(--md3-outline-variant)] hover:bg-surface-container-high", focusRing, "data-[state=open]:border-[var(--md3-outline)] data-[state=open]:bg-surface-container-high", "disabled:opacity-50 disabled:cursor-not-allowed", triggerClassName),
2439
2439
  children: [/* @__PURE__ */ jsxs("span", {
@@ -2449,7 +2449,7 @@ function BackendSelector({ backends, selected, onChange, variant = "pill", label
2449
2449
  children: current.description
2450
2450
  })
2451
2451
  ]
2452
- }), /* @__PURE__ */ jsx(Select$1.Icon, {
2452
+ }), /* @__PURE__ */ jsx(Select.Icon, {
2453
2453
  asChild: true,
2454
2454
  children: /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-[var(--transition-fast)] data-[state=open]:rotate-180" })
2455
2455
  })]
@@ -2459,16 +2459,16 @@ function BackendSelector({ backends, selected, onChange, variant = "pill", label
2459
2459
  children: [variant === "field" && label && /* @__PURE__ */ jsx("label", {
2460
2460
  className: "block text-xs font-medium text-muted-foreground uppercase tracking-[0.06em]",
2461
2461
  children: label
2462
- }), /* @__PURE__ */ jsxs(Select$1.Root, {
2462
+ }), /* @__PURE__ */ jsxs(Select.Root, {
2463
2463
  value: selected,
2464
2464
  onValueChange: onChange,
2465
- children: [trigger, /* @__PURE__ */ jsx(Select$1.Portal, { children: /* @__PURE__ */ jsx(Select$1.Content, {
2465
+ children: [trigger, /* @__PURE__ */ jsx(Select.Portal, { children: /* @__PURE__ */ jsx(Select.Content, {
2466
2466
  position: "popper",
2467
2467
  sideOffset: 4,
2468
2468
  className: cn$1("z-50 max-h-[var(--radix-select-content-available-height)] overflow-hidden", variant === "pill" ? "min-w-[240px] max-w-[320px]" : "w-[var(--radix-select-trigger-width)]", "rounded-[var(--radius-md)] border border-[var(--md3-outline-variant)]", "bg-surface-container-highest shadow-[0_8px_30px_rgba(0,0,0,0.45)] ring-1 ring-[#ffffff14]", "data-[state=open]:animate-in data-[state=closed]:animate-out", "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95", "data-[side=bottom]:slide-in-from-top-1"),
2469
- children: /* @__PURE__ */ jsx(Select$1.Viewport, {
2469
+ children: /* @__PURE__ */ jsx(Select.Viewport, {
2470
2470
  className: "max-h-[min(24rem,calc(var(--radix-select-content-available-height)-2px))] overflow-y-auto overscroll-contain p-1",
2471
- children: backends.map((backend) => /* @__PURE__ */ jsxs(Select$1.Item, {
2471
+ children: backends.map((backend) => /* @__PURE__ */ jsxs(Select.Item, {
2472
2472
  value: backend.type,
2473
2473
  className: cn$1("relative flex cursor-pointer select-none items-start gap-2.5 rounded-[var(--radius-sm)]", "px-3 py-2 text-sm outline-none", "transition-colors duration-[var(--transition-fast)]", "hover:bg-accent/50 focus:bg-accent/50", "data-[state=checked]:bg-[var(--accent-surface-soft)] data-[state=checked]:text-[var(--brand-primary)]"),
2474
2474
  children: [backend.icon && /* @__PURE__ */ jsx("span", {
@@ -2476,7 +2476,7 @@ function BackendSelector({ backends, selected, onChange, variant = "pill", label
2476
2476
  children: backend.icon
2477
2477
  }), /* @__PURE__ */ jsxs("span", {
2478
2478
  className: "flex min-w-0 flex-col",
2479
- children: [/* @__PURE__ */ jsx(Select$1.ItemText, { children: /* @__PURE__ */ jsx("span", {
2479
+ children: [/* @__PURE__ */ jsx(Select.ItemText, { children: /* @__PURE__ */ jsx("span", {
2480
2480
  className: "font-medium",
2481
2481
  children: backend.label
2482
2482
  }) }), backend.description && /* @__PURE__ */ jsx("span", {
package/dist/dashboard.js CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as SidebarRailNav, A as ResourceMeter, B as RailFlyout, C as InvoiceTable, D as canAdminSandbox, E as SandboxCard, F as CreditBalance, G as Sidebar, H as RailModeButton, I as ProfileAvatar, J as SidebarPanelContent, K as SidebarContent, L as RailButton, M as INSUFFICIENT_BALANCE_CODE, N as OutOfCreditsModal, O as ActivityFeed, P as parseInsufficientBalance, Q as SidebarRailHeader, R as RailCollapseToggle, S as PlanCards, T as NewSandboxCard, U as RailSeparator, V as RailHeader, W as RailThemeToggle, X as SidebarRail, Y as SidebarPanelHeader, Z as SidebarRailFooter, _ as HarnessPicker, a as ProcessList, at as SIDEBAR_TOTAL_WIDTH, b as HarnessLogo, c as UsageSummary, d as MetricAreaChart, et as RailTooltip, f as ProfileComparison, g as HARNESS_OPTIONS, h as DashboardLayout, i as NetworkConfig, it as SIDEBAR_RAIL_WIDTH, j as ClusterStatusBar, k as ResourceSnapshot, l as SystemLogsViewer, m as SidebarLayout, n as SnapshotList, nt as SIDEBAR_PANEL_WIDTH, o as PortsList, ot as SidebarProvider, p as ProfileSelector, q as SidebarPanel, r as BackendConfig, rt as SIDEBAR_RAIL_LABELED_WIDTH, s as GitPanel, st as useSidebar, t as PromoBanner, tt as SIDEBAR_MOBILE_WIDTH, u as VariantList, v as chatCapableHarnesses, w as SandboxTable, x as BackendSelector, y as HARNESS_BRAND, z as RailExpandable } from "./dashboard-DdUTq0so.js";
1
+ import { $ as SidebarRailNav, A as ResourceMeter, B as RailFlyout, C as InvoiceTable, D as canAdminSandbox, E as SandboxCard, F as CreditBalance, G as Sidebar, H as RailModeButton, I as ProfileAvatar, J as SidebarPanelContent, K as SidebarContent, L as RailButton, M as INSUFFICIENT_BALANCE_CODE, N as OutOfCreditsModal, O as ActivityFeed, P as parseInsufficientBalance, Q as SidebarRailHeader, R as RailCollapseToggle, S as PlanCards, T as NewSandboxCard, U as RailSeparator, V as RailHeader, W as RailThemeToggle, X as SidebarRail, Y as SidebarPanelHeader, Z as SidebarRailFooter, _ as HarnessPicker, a as ProcessList, at as SIDEBAR_TOTAL_WIDTH, b as HarnessLogo, c as UsageSummary, d as MetricAreaChart, et as RailTooltip, f as ProfileComparison, g as HARNESS_OPTIONS, h as DashboardLayout, i as NetworkConfig, it as SIDEBAR_RAIL_WIDTH, j as ClusterStatusBar, k as ResourceSnapshot, l as SystemLogsViewer, m as SidebarLayout, n as SnapshotList, nt as SIDEBAR_PANEL_WIDTH, o as PortsList, ot as SidebarProvider, p as ProfileSelector, q as SidebarPanel, r as BackendConfig, rt as SIDEBAR_RAIL_LABELED_WIDTH, s as GitPanel, st as useSidebar, t as PromoBanner, tt as SIDEBAR_MOBILE_WIDTH, u as VariantList, v as chatCapableHarnesses, w as SandboxTable, x as BackendSelector, y as HARNESS_BRAND, z as RailExpandable } from "./dashboard-D4un5GtD.js";
2
2
  import { n as canonicalModelId, r as modelBrandFor, t as ModelBrandStack } from "./model-brand-hMyDTUqB.js";
3
3
  import { a as formatPrice, i as PricingPage, n as TemplateCard, o as BillingDashboard, r as UsageChart, t as InfoPanel } from "./info-panel-C9cqDzOL.js";
4
4
  export { ActivityFeed, BackendConfig, BackendSelector, BillingDashboard, ClusterStatusBar, CreditBalance, DashboardLayout, GitPanel, HARNESS_BRAND, HARNESS_OPTIONS, HarnessLogo, HarnessPicker, INSUFFICIENT_BALANCE_CODE, InfoPanel, InvoiceTable, MetricAreaChart, ModelBrandStack, NetworkConfig, NewSandboxCard, OutOfCreditsModal, PlanCards, PortsList, PricingPage, ProcessList, ProfileAvatar, ProfileComparison, ProfileSelector, PromoBanner, RailButton, RailCollapseToggle, RailExpandable, RailFlyout, RailHeader, RailModeButton, RailSeparator, RailThemeToggle, RailTooltip, ResourceMeter, ResourceSnapshot, SIDEBAR_MOBILE_WIDTH, SIDEBAR_PANEL_WIDTH, SIDEBAR_RAIL_LABELED_WIDTH, SIDEBAR_RAIL_WIDTH, SIDEBAR_TOTAL_WIDTH, SandboxCard, SandboxTable, Sidebar, SidebarContent, SidebarLayout, SidebarPanel, SidebarPanelContent, SidebarPanelHeader, SidebarProvider, SidebarRail, SidebarRailFooter, SidebarRailHeader, SidebarRailNav, SnapshotList, SystemLogsViewer, TemplateCard, UsageChart, UsageSummary, VariantList, canAdminSandbox, canonicalModelId, chatCapableHarnesses, formatPrice, modelBrandFor, parseInsufficientBalance, useSidebar };