@tangle-network/sandbox-ui 0.20.3 → 0.21.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.
@@ -0,0 +1,147 @@
1
+ import {
2
+ cn
3
+ } from "./chunk-EI44GEQ5.js";
4
+
5
+ // src/dashboard/backend-selector.tsx
6
+ import { ChevronDown } from "lucide-react";
7
+ import * as Select from "@radix-ui/react-select";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
+ function BackendSelector({
10
+ backends,
11
+ selected,
12
+ onChange,
13
+ label = "Model",
14
+ placeholder = "Select a model",
15
+ className
16
+ }) {
17
+ const current = backends.find((b) => b.type === selected);
18
+ return /* @__PURE__ */ jsxs("div", { className: cn("space-y-1.5", className), children: [
19
+ label && /* @__PURE__ */ jsx("label", { className: "block text-xs font-medium text-muted-foreground uppercase tracking-[0.06em]", children: label }),
20
+ /* @__PURE__ */ jsxs(Select.Root, { value: selected, onValueChange: onChange, children: [
21
+ /* @__PURE__ */ jsxs(
22
+ Select.Trigger,
23
+ {
24
+ className: cn(
25
+ "flex w-full items-center justify-between gap-2 rounded-[var(--radius-md)]",
26
+ "border border-border bg-card",
27
+ "px-3 py-2.5 text-sm text-left",
28
+ "transition-colors duration-[var(--transition-fast)]",
29
+ "hover:border-primary/20 hover:bg-accent/30",
30
+ "focus:outline-none focus:border-primary/30",
31
+ "data-[state=open]:border-primary/30 data-[state=open]:bg-accent/30"
32
+ ),
33
+ children: [
34
+ /* @__PURE__ */ jsx("div", { className: "min-w-0 flex-1", children: current ? /* @__PURE__ */ jsxs("div", { children: [
35
+ /* @__PURE__ */ jsx("span", { className: "font-medium text-foreground", children: current.label }),
36
+ current.description && /* @__PURE__ */ jsx("span", { className: "ml-2 text-xs text-muted-foreground", children: current.description })
37
+ ] }) : /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: placeholder }) }),
38
+ /* @__PURE__ */ jsx(Select.Icon, { asChild: true, 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" }) })
39
+ ]
40
+ }
41
+ ),
42
+ /* @__PURE__ */ jsx(Select.Portal, { children: /* @__PURE__ */ jsx(
43
+ Select.Content,
44
+ {
45
+ position: "popper",
46
+ sideOffset: 4,
47
+ className: cn(
48
+ "z-50 w-[var(--radix-select-trigger-width)] overflow-hidden",
49
+ "rounded-[var(--radius-md)] border border-border",
50
+ "bg-card shadow-[var(--shadow-dropdown)]",
51
+ "data-[state=open]:animate-in data-[state=closed]:animate-out",
52
+ "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
53
+ "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
54
+ "data-[side=bottom]:slide-in-from-top-1"
55
+ ),
56
+ children: /* @__PURE__ */ jsx(Select.Viewport, { className: "p-1", children: backends.map((backend) => /* @__PURE__ */ jsxs(
57
+ Select.Item,
58
+ {
59
+ value: backend.type,
60
+ className: cn(
61
+ "relative flex cursor-pointer select-none flex-col rounded-[var(--radius-sm)]",
62
+ "px-3 py-2.5 text-sm outline-none",
63
+ "transition-colors duration-[var(--transition-fast)]",
64
+ "hover:bg-accent/50 focus:bg-accent/50",
65
+ "data-[state=checked]:bg-[var(--accent-surface-soft)] data-[state=checked]:text-[var(--brand-primary)]"
66
+ ),
67
+ children: [
68
+ /* @__PURE__ */ jsx(Select.ItemText, { children: /* @__PURE__ */ jsx("span", { className: "font-medium", children: backend.label }) }),
69
+ backend.description && /* @__PURE__ */ jsx("span", { className: "mt-0.5 text-xs text-muted-foreground data-[state=checked]:text-[var(--accent-text)]", children: backend.description })
70
+ ]
71
+ },
72
+ backend.type
73
+ )) })
74
+ }
75
+ ) })
76
+ ] })
77
+ ] });
78
+ }
79
+
80
+ // src/dashboard/harness-picker.tsx
81
+ import { jsx as jsx2 } from "react/jsx-runtime";
82
+ var HARNESS_OPTIONS = [
83
+ {
84
+ type: "opencode",
85
+ label: "OpenCode",
86
+ description: "Default agent \u2014 broad model support, deterministic streaming"
87
+ },
88
+ {
89
+ type: "claude-code",
90
+ label: "Claude Code",
91
+ description: "Native Claude skills and tools (requires ANTHROPIC_API_KEY)"
92
+ },
93
+ {
94
+ type: "codex",
95
+ label: "Codex",
96
+ description: "OpenAI Codex CLI (requires OPENAI_API_KEY)"
97
+ },
98
+ {
99
+ type: "amp",
100
+ label: "AMP",
101
+ description: "Sourcegraph AMP agent"
102
+ },
103
+ {
104
+ type: "factory-droids",
105
+ label: "Factory Droids",
106
+ description: "Factory Droid agent"
107
+ },
108
+ {
109
+ type: "cli-base",
110
+ label: "CLI base (no agent)",
111
+ description: "Shell tools only \u2014 for non-AI scheduled tasks"
112
+ }
113
+ ];
114
+ function HarnessPicker({
115
+ value,
116
+ onChange,
117
+ available,
118
+ optionsOverride,
119
+ label = "Agent harness",
120
+ ...rest
121
+ }) {
122
+ const allowed = new Set(available ?? HARNESS_OPTIONS.map((h) => h.type));
123
+ const backends = HARNESS_OPTIONS.filter((h) => allowed.has(h.type)).map((h) => {
124
+ const override = optionsOverride?.[h.type];
125
+ return {
126
+ type: h.type,
127
+ label: override?.label ?? h.label,
128
+ description: override?.description ?? h.description
129
+ };
130
+ });
131
+ return /* @__PURE__ */ jsx2(
132
+ BackendSelector,
133
+ {
134
+ backends,
135
+ selected: value,
136
+ onChange: (next) => onChange(next),
137
+ label,
138
+ ...rest
139
+ }
140
+ );
141
+ }
142
+
143
+ export {
144
+ BackendSelector,
145
+ HARNESS_OPTIONS,
146
+ HarnessPicker
147
+ };