@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ChatMessage
3
- } from "./chunk-5CEMHKBP.js";
3
+ } from "./chunk-GW4GRAWJ.js";
4
4
  import {
5
5
  AgentTimeline,
6
6
  ChatContainer,
@@ -8,15 +8,15 @@ import {
8
8
  MessageList,
9
9
  ThinkingIndicator,
10
10
  UserMessage
11
- } from "./chunk-R3IU37AW.js";
11
+ } from "./chunk-RKXIRRKQ.js";
12
12
  import "./chunk-CNWVHQFY.js";
13
- import "./chunk-WC7QTWPN.js";
13
+ import "./chunk-ZMWWE5RF.js";
14
14
  import "./chunk-HRMUF35V.js";
15
- import "./chunk-NTSRY4GW.js";
15
+ import "./chunk-MJUDMVRU.js";
16
16
  import "./chunk-BX6AQMUS.js";
17
- import "./chunk-VBWY44UU.js";
17
+ import "./chunk-OVNLOE3Y.js";
18
18
  import "./chunk-JP725R4W.js";
19
- import "./chunk-H5XYSFYE.js";
19
+ import "./chunk-3HW53XTH.js";
20
20
  import "./chunk-TDYQBLL5.js";
21
21
  import "./chunk-TSE423UF.js";
22
22
  import "./chunk-RQHJBTEU.js";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  ToolCallGroup,
3
3
  ToolCallStep
4
- } from "./chunk-NTSRY4GW.js";
4
+ } from "./chunk-MJUDMVRU.js";
5
5
  import {
6
6
  Markdown
7
- } from "./chunk-H5XYSFYE.js";
7
+ } from "./chunk-3HW53XTH.js";
8
8
  import {
9
9
  cn
10
10
  } from "./chunk-RQHJBTEU.js";
@@ -116,8 +116,8 @@ var CodeBlock = memo(
116
116
  className: cn("group relative overflow-hidden rounded-lg border font-mono", bg, className),
117
117
  ...props,
118
118
  children: [
119
- language && /* @__PURE__ */ jsxs("div", { className: cn("flex items-center justify-between border-b px-4 py-1.5", headerBg), children: [
120
- /* @__PURE__ */ jsx("span", { className: cn("text-[11px] font-mono font-medium uppercase tracking-widest", langColor), children: language }),
119
+ language && /* @__PURE__ */ jsxs("div", { className: cn("flex items-center justify-between border-b px-3 py-1", headerBg), children: [
120
+ /* @__PURE__ */ jsx("span", { className: cn("text-[10px] font-mono font-medium uppercase tracking-widest", langColor), children: language }),
121
121
  children
122
122
  ] }),
123
123
  !language && children && /* @__PURE__ */ jsx("div", { className: "absolute right-2 top-2 z-10 flex items-center gap-2 opacity-0 transition-opacity group-hover:opacity-100", children }),
@@ -134,10 +134,10 @@ var CodeBlock = memo(
134
134
  },
135
135
  customStyle: {
136
136
  margin: 0,
137
- padding: "1rem",
137
+ padding: "var(--code-padding-y, 0.625rem) var(--code-padding-x, 0.75rem)",
138
138
  background: "transparent",
139
- fontSize: "0.8125rem",
140
- lineHeight: "1.65",
139
+ fontSize: "var(--code-font-size, 0.8125rem)",
140
+ lineHeight: "var(--code-line-height, 1.5)",
141
141
  overflowX: "auto"
142
142
  },
143
143
  codeTagProps: { style: { fontFamily: "var(--font-mono, 'JetBrains Mono', ui-monospace, monospace)" } },
@@ -165,7 +165,7 @@ var CopyButton = memo(({ text }) => {
165
165
  "button",
166
166
  {
167
167
  onClick: handleCopy,
168
- className: "flex items-center justify-center w-7 h-7 rounded-md bg-[var(--bg-section)] border border-[var(--border-subtle)] hover:border-[var(--border-default)] transition-colors",
168
+ className: "flex items-center justify-center w-6 h-6 rounded-md bg-[var(--bg-section)] border border-[var(--border-subtle)] hover:border-[var(--border-default)] transition-colors",
169
169
  title: "Copy to clipboard",
170
170
  children: copied ? /* @__PURE__ */ jsx(Check, { className: "w-3.5 h-3.5 text-[var(--brand-emerald)]" }) : /* @__PURE__ */ jsx(Copy, { className: "w-3.5 h-3.5 text-[var(--text-muted)]" })
171
171
  }
@@ -370,16 +370,16 @@ function CreditBalance({
370
370
  className
371
371
  }) {
372
372
  const [topUpValue, setTopUpValue] = React2.useState("50.00");
373
- return /* @__PURE__ */ jsxs3("div", { className: cn("bg-[var(--depth-2)] p-8 rounded-xl flex flex-col justify-between border border-[var(--border-subtle)]", className), children: [
373
+ return /* @__PURE__ */ jsxs3("div", { className: cn("bg-[var(--depth-2)] p-5 rounded-xl flex flex-col justify-between border border-[var(--border-subtle)]", className), children: [
374
374
  /* @__PURE__ */ jsxs3("div", { children: [
375
375
  /* @__PURE__ */ jsx4("h3", { className: "text-sm font-semibold text-[var(--text-muted)] uppercase tracking-widest mb-2", children: "Available Credits" }),
376
- /* @__PURE__ */ jsxs3("div", { className: "text-5xl font-extrabold text-[var(--brand-cool)] tracking-tighter mb-3", children: [
376
+ /* @__PURE__ */ jsxs3("div", { className: "text-4xl font-extrabold text-[var(--brand-cool)] tracking-tighter mb-2", children: [
377
377
  "$",
378
378
  amount.toFixed(2)
379
379
  ] }),
380
380
  /* @__PURE__ */ jsx4("p", { className: "text-sm text-[var(--text-muted)] leading-relaxed", children: description })
381
381
  ] }),
382
- onTopUp && /* @__PURE__ */ jsxs3("div", { className: "space-y-3 mt-8", children: [
382
+ onTopUp && /* @__PURE__ */ jsxs3("div", { className: "space-y-2.5 mt-5", children: [
383
383
  /* @__PURE__ */ jsxs3("div", { className: "bg-[var(--depth-1)] border border-[var(--border-subtle)] p-1 rounded-lg flex items-center", children: [
384
384
  /* @__PURE__ */ jsx4(
385
385
  "input",
@@ -465,17 +465,17 @@ import { Check } from "lucide-react";
465
465
  import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
466
466
  function PlanCards({ plans, className }) {
467
467
  return /* @__PURE__ */ jsxs5("section", { className, children: [
468
- /* @__PURE__ */ jsx6("h2", { className: "text-2xl font-bold text-[var(--text-primary)] tracking-tight mb-8 px-2", children: "Subscription Plans" }),
468
+ /* @__PURE__ */ jsx6("h2", { className: "text-2xl font-bold text-[var(--text-primary)] tracking-tight mb-5 px-2", children: "Subscription Plans" }),
469
469
  /* @__PURE__ */ jsx6("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-6", children: plans.map((plan) => /* @__PURE__ */ jsxs5(
470
470
  "div",
471
471
  {
472
472
  className: cn(
473
- "p-8 rounded-xl transition-all relative overflow-hidden border",
473
+ "p-5 rounded-xl transition-all relative overflow-hidden border",
474
474
  plan.popular ? "bg-[var(--depth-3)] border-[var(--border-accent)]" : "bg-[var(--depth-2)] border-[var(--border-subtle)] hover:bg-[var(--depth-3)] hover:border-[var(--border-default)]"
475
475
  ),
476
476
  children: [
477
477
  plan.popular && /* @__PURE__ */ jsx6("div", { className: "absolute top-0 right-0 bg-[var(--accent-surface-soft)] border-l border-b border-[var(--border-accent)] px-4 py-1 text-[10px] font-bold text-[var(--accent-text)] uppercase tracking-widest rounded-bl-lg", children: "Popular" }),
478
- /* @__PURE__ */ jsxs5("div", { className: "mb-6", children: [
478
+ /* @__PURE__ */ jsxs5("div", { className: "mb-4", children: [
479
479
  /* @__PURE__ */ jsx6("div", { className: cn("text-xs font-mono uppercase tracking-widest mb-2", plan.popular ? "text-[var(--brand-cool)]" : "text-[var(--text-muted)]"), children: plan.name }),
480
480
  /* @__PURE__ */ jsxs5("div", { className: "text-3xl font-bold text-[var(--text-primary)]", children: [
481
481
  "$",
@@ -486,7 +486,7 @@ function PlanCards({ plans, className }) {
486
486
  ] })
487
487
  ] })
488
488
  ] }),
489
- /* @__PURE__ */ jsx6("ul", { className: "space-y-3 mb-8 text-sm text-[var(--text-muted)]", children: plan.features.map((f, i) => /* @__PURE__ */ jsxs5("li", { className: "flex items-center gap-2", children: [
489
+ /* @__PURE__ */ jsx6("ul", { className: "space-y-2 mb-5 text-sm text-[var(--text-muted)]", children: plan.features.map((f, i) => /* @__PURE__ */ jsxs5("li", { className: "flex items-center gap-2", children: [
490
490
  /* @__PURE__ */ jsx6(Check, { className: "h-3.5 w-3.5 text-[var(--brand-cool)] shrink-0" }),
491
491
  f.text
492
492
  ] }, i)) }),
@@ -688,8 +688,8 @@ function DashboardLayoutInner({
688
688
  }
689
689
  ),
690
690
  /* @__PURE__ */ jsx7(Sidebar, { className: cn("hidden lg:flex", sidebarClassName), children: sidebarContent }),
691
- /* @__PURE__ */ jsx7(SidebarContent, { className: cn("pt-20 px-8 pb-12 hidden lg:block", contentClassName), children }),
692
- /* @__PURE__ */ jsx7("main", { className: cn("pt-20 px-8 pb-12 min-h-screen lg:hidden", contentClassName), children }),
691
+ /* @__PURE__ */ jsx7(SidebarContent, { className: cn("pt-16 px-6 pb-8 hidden lg:block", contentClassName), children }),
692
+ /* @__PURE__ */ jsx7("main", { className: cn("pt-16 px-6 pb-8 min-h-screen lg:hidden", contentClassName), children }),
693
693
  footer
694
694
  ] });
695
695
  }
@@ -707,21 +707,19 @@ function getBarColor(percent) {
707
707
  function ResourceMeter({ label, value, max = 100, unit, icon, className }) {
708
708
  const percent = max > 0 ? Math.min(value / max * 100, 100) : 0;
709
709
  const barColor = getBarColor(percent);
710
- return /* @__PURE__ */ jsxs7("div", { className: cn("space-y-1.5", className), children: [
711
- /* @__PURE__ */ jsxs7("div", { className: "flex justify-between text-[10px] font-mono text-[var(--text-muted)] uppercase tracking-wide", children: [
712
- /* @__PURE__ */ jsxs7("span", { className: "flex items-center gap-1 text-[var(--text-secondary)]", children: [
713
- icon,
714
- label
715
- ] }),
716
- /* @__PURE__ */ jsx8("span", { className: "tabular-nums", children: unit ? `${value}${unit} / ${max}${unit}` : `${Math.round(percent)}%` })
710
+ return /* @__PURE__ */ jsxs7("div", { className: cn("flex items-center gap-3", className), children: [
711
+ /* @__PURE__ */ jsxs7("span", { className: "flex shrink-0 items-center gap-1 text-[10px] font-mono text-[var(--text-secondary)] uppercase tracking-wide", children: [
712
+ icon,
713
+ label
717
714
  ] }),
718
- /* @__PURE__ */ jsx8("div", { className: "h-1.5 w-full bg-[var(--depth-1)] rounded-full overflow-hidden", children: /* @__PURE__ */ jsx8(
715
+ /* @__PURE__ */ jsx8("div", { className: "h-1.5 min-w-0 flex-1 bg-[var(--depth-1)] rounded-full overflow-hidden", children: /* @__PURE__ */ jsx8(
719
716
  "div",
720
717
  {
721
718
  className: cn("h-full rounded-full transition-all duration-500", barColor),
722
719
  style: { width: `${percent}%` }
723
720
  }
724
- ) })
721
+ ) }),
722
+ /* @__PURE__ */ jsx8("span", { className: "shrink-0 text-[10px] font-mono tabular-nums text-[var(--text-muted)]", children: unit ? `${value}${unit}/${max}${unit}` : `${Math.round(percent)}%` })
725
723
  ] });
726
724
  }
727
725
 
@@ -870,7 +868,7 @@ function NewSandboxCard({ onClick, className }) {
870
868
  type: "button",
871
869
  onClick,
872
870
  className: cn(
873
- "border-2 border-dashed border-[var(--border-subtle)] rounded-xl p-6 flex flex-col items-center justify-center text-center group cursor-pointer hover:border-[var(--border-accent)] hover:bg-[var(--accent-surface-soft)] transition-all duration-300 w-full min-h-[200px]",
871
+ "border-2 border-dashed border-[var(--border-subtle)] rounded-xl p-5 flex flex-col items-center justify-center text-center group cursor-pointer hover:border-[var(--border-accent)] hover:bg-[var(--accent-surface-soft)] transition-all duration-300 w-full min-h-[160px]",
874
872
  className
875
873
  ),
876
874
  children: [
@@ -1278,7 +1276,7 @@ import {
1278
1276
  X,
1279
1277
  XCircle
1280
1278
  } from "lucide-react";
1281
- import { jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
1279
+ import { Fragment as Fragment6, jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
1282
1280
  var statusConfig2 = {
1283
1281
  pending: {
1284
1282
  icon: Clock,
@@ -1362,40 +1360,38 @@ function VariantList({
1362
1360
  isActioning,
1363
1361
  className
1364
1362
  }) {
1365
- return /* @__PURE__ */ jsx13("div", { className: `space-y-3 ${className || ""}`, children: variants.map((variant) => {
1363
+ return /* @__PURE__ */ jsx13("div", { className: `space-y-2 ${className || ""}`, children: variants.map((variant) => {
1366
1364
  const status = statusConfig2[variant.status];
1367
1365
  const StatusIcon = status.icon;
1368
1366
  const isSelected = variant.id === selectedId;
1369
1367
  return /* @__PURE__ */ jsxs12(
1370
1368
  "div",
1371
1369
  {
1372
- className: `cursor-pointer rounded-lg border p-4 transition-colors ${isSelected ? "border-[var(--border-accent)] bg-[var(--accent-surface-soft)]" : "border-[var(--border-subtle)] bg-[var(--depth-2)] hover:border-[var(--border-default)] hover:bg-[var(--depth-3)]"}`,
1370
+ className: `cursor-pointer rounded-lg border px-3 py-2.5 transition-colors ${isSelected ? "border-[var(--border-accent)] bg-[var(--accent-surface-soft)]" : "border-[var(--border-subtle)] bg-[var(--depth-2)] hover:border-[var(--border-default)] hover:bg-[var(--depth-3)]"}`,
1373
1371
  onClick: () => onSelect?.(variant.id),
1374
1372
  children: [
1375
- /* @__PURE__ */ jsxs12("div", { className: "flex items-center justify-between", children: [
1376
- /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-3", children: [
1377
- /* @__PURE__ */ jsxs12(Badge, { className: `${status.bg} ${status.border} ${status.color}`, children: [
1378
- /* @__PURE__ */ jsx13(
1379
- StatusIcon,
1380
- {
1381
- className: `mr-1 h-3 w-3 ${status.animate ? "animate-spin" : ""}`
1382
- }
1383
- ),
1384
- status.label
1385
- ] }),
1386
- /* @__PURE__ */ jsx13("span", { className: "font-medium text-[var(--text-primary)]", children: variant.label }),
1387
- variant.sublabel && /* @__PURE__ */ jsxs12("span", { className: "text-sm text-[var(--text-muted)]", children: [
1388
- "(",
1389
- variant.sublabel,
1390
- ")"
1391
- ] }),
1392
- variant.durationMs && /* @__PURE__ */ jsxs12("span", { className: "flex items-center gap-1 text-sm text-[var(--text-muted)]", children: [
1393
- /* @__PURE__ */ jsx13(Timer, { className: "h-3 w-3" }),
1394
- (variant.durationMs / 1e3).toFixed(2),
1395
- "s"
1396
- ] })
1373
+ /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-2", children: [
1374
+ /* @__PURE__ */ jsxs12(Badge, { className: `shrink-0 ${status.bg} ${status.border} ${status.color}`, children: [
1375
+ /* @__PURE__ */ jsx13(
1376
+ StatusIcon,
1377
+ {
1378
+ className: `mr-1 h-3 w-3 ${status.animate ? "animate-spin" : ""}`
1379
+ }
1380
+ ),
1381
+ status.label
1382
+ ] }),
1383
+ /* @__PURE__ */ jsx13("span", { className: "truncate text-sm font-medium text-[var(--text-primary)]", children: variant.label }),
1384
+ variant.sublabel && /* @__PURE__ */ jsxs12("span", { className: "shrink-0 text-xs text-[var(--text-muted)]", children: [
1385
+ "(",
1386
+ variant.sublabel,
1387
+ ")"
1388
+ ] }),
1389
+ variant.durationMs && /* @__PURE__ */ jsxs12("span", { className: "flex shrink-0 items-center gap-1 text-xs text-[var(--text-muted)]", children: [
1390
+ /* @__PURE__ */ jsx13(Timer, { className: "h-3 w-3" }),
1391
+ (variant.durationMs / 1e3).toFixed(1),
1392
+ "s"
1397
1393
  ] }),
1398
- /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-2", children: [
1394
+ /* @__PURE__ */ jsxs12("div", { className: "ml-auto flex shrink-0 items-center gap-1.5", children: [
1399
1395
  variant.outcome && /* @__PURE__ */ jsx13(
1400
1396
  Badge,
1401
1397
  {
@@ -1403,20 +1399,20 @@ function VariantList({
1403
1399
  children: outcomeConfig[variant.outcome].label
1404
1400
  }
1405
1401
  ),
1406
- variant.status === "completed" && variant.outcome === "pending_review" && onAccept && onReject && /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-2", children: [
1402
+ variant.status === "completed" && variant.outcome === "pending_review" && onAccept && onReject && /* @__PURE__ */ jsxs12(Fragment6, { children: [
1407
1403
  /* @__PURE__ */ jsxs12(
1408
1404
  Button,
1409
1405
  {
1410
1406
  variant: "outline",
1411
1407
  size: "sm",
1412
- className: "border-[var(--surface-success-border)] bg-[var(--surface-success-bg)] text-[var(--surface-success-text)] hover:bg-[var(--surface-success-border)]",
1408
+ className: "h-7 border-[var(--surface-success-border)] bg-[var(--surface-success-bg)] px-2 text-xs text-[var(--surface-success-text)] hover:bg-[var(--surface-success-border)]",
1413
1409
  onClick: (e) => {
1414
1410
  e.stopPropagation();
1415
1411
  onAccept(variant.id);
1416
1412
  },
1417
1413
  disabled: isActioning === variant.id,
1418
1414
  children: [
1419
- /* @__PURE__ */ jsx13(Check3, { className: "mr-1 h-4 w-4" }),
1415
+ /* @__PURE__ */ jsx13(Check3, { className: "mr-1 h-3 w-3" }),
1420
1416
  "Accept"
1421
1417
  ]
1422
1418
  }
@@ -1426,14 +1422,14 @@ function VariantList({
1426
1422
  {
1427
1423
  variant: "outline",
1428
1424
  size: "sm",
1429
- className: "border-[var(--surface-danger-border)] bg-[var(--surface-danger-bg)] text-[var(--surface-danger-text)] hover:bg-[var(--surface-danger-border)]",
1425
+ className: "h-7 border-[var(--surface-danger-border)] bg-[var(--surface-danger-bg)] px-2 text-xs text-[var(--surface-danger-text)] hover:bg-[var(--surface-danger-border)]",
1430
1426
  onClick: (e) => {
1431
1427
  e.stopPropagation();
1432
1428
  onReject(variant.id);
1433
1429
  },
1434
1430
  disabled: isActioning === variant.id,
1435
1431
  children: [
1436
- /* @__PURE__ */ jsx13(X, { className: "mr-1 h-4 w-4" }),
1432
+ /* @__PURE__ */ jsx13(X, { className: "mr-1 h-3 w-3" }),
1437
1433
  "Reject"
1438
1434
  ]
1439
1435
  }
@@ -1444,18 +1440,18 @@ function VariantList({
1444
1440
  {
1445
1441
  variant: "ghost",
1446
1442
  size: "sm",
1447
- className: "text-[var(--text-muted)] hover:text-[var(--text-primary)]",
1443
+ className: "h-7 w-7 p-0 text-[var(--text-muted)] hover:text-[var(--text-primary)]",
1448
1444
  onClick: (e) => {
1449
1445
  e.stopPropagation();
1450
1446
  window.open(variant.detailsUrl, "_blank");
1451
1447
  },
1452
- children: /* @__PURE__ */ jsx13(ExternalLink2, { className: "h-4 w-4" })
1448
+ children: /* @__PURE__ */ jsx13(ExternalLink2, { className: "h-3.5 w-3.5" })
1453
1449
  }
1454
1450
  )
1455
1451
  ] })
1456
1452
  ] }),
1457
- variant.error && /* @__PURE__ */ jsx13("p", { className: "mt-2 text-sm text-[var(--surface-danger-text)]", children: variant.error }),
1458
- variant.summary && /* @__PURE__ */ jsx13("p", { className: "mt-2 line-clamp-2 text-sm text-[var(--text-muted)]", children: variant.summary })
1453
+ variant.error && /* @__PURE__ */ jsx13("p", { className: "mt-1.5 text-xs text-[var(--surface-danger-text)]", children: variant.error }),
1454
+ variant.summary && /* @__PURE__ */ jsx13("p", { className: "mt-1.5 line-clamp-2 text-xs text-[var(--text-muted)]", children: variant.summary })
1459
1455
  ]
1460
1456
  },
1461
1457
  variant.id