@tangle-network/sandbox-ui 0.14.0 → 0.15.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.
Files changed (104) hide show
  1. package/dist/auth.d.ts +1 -74
  2. package/dist/auth.js +1 -4
  3. package/dist/chat.d.ts +1 -136
  4. package/dist/chat.js +2 -15
  5. package/dist/chunk-2BUPSB7O.js +0 -0
  6. package/dist/chunk-3J6FG3FJ.js +18 -0
  7. package/dist/chunk-76IQLPW2.js +206 -0
  8. package/dist/chunk-7ZA5SEK3.js +239 -0
  9. package/dist/chunk-AHBZCBDO.js +2960 -0
  10. package/dist/chunk-AZ3AWMTM.js +8 -0
  11. package/dist/chunk-CMY7W45U.js +380 -0
  12. package/dist/{chunk-QMU2PWOU.js → chunk-DNZ4DTNA.js} +71 -17
  13. package/dist/chunk-EI44GEQ5.js +6 -0
  14. package/dist/{chunk-5OQ27N57.js → chunk-GPT7VKK6.js} +34 -38
  15. package/dist/chunk-JBGKGLD7.js +16 -0
  16. package/dist/chunk-NJNME4J4.js +14 -0
  17. package/dist/chunk-QPAJR74X.js +20 -0
  18. package/dist/chunk-TK46XFLM.js +28 -0
  19. package/dist/chunk-WID73FPH.js +89 -0
  20. package/dist/chunk-YVXK4XRO.js +30 -0
  21. package/dist/dashboard.d.ts +538 -4
  22. package/dist/dashboard.js +15 -886
  23. package/dist/editor.d.ts +1 -120
  24. package/dist/editor.js +1 -5
  25. package/dist/files.d.ts +1 -129
  26. package/dist/files.js +2 -7
  27. package/dist/globals.css +2 -1265
  28. package/dist/hooks.d.ts +114 -11
  29. package/dist/hooks.js +17 -88
  30. package/dist/index.d.ts +24 -99
  31. package/dist/index.js +247 -252
  32. package/dist/markdown.d.ts +1 -29
  33. package/dist/markdown.js +2 -2
  34. package/dist/openui.d.ts +8 -115
  35. package/dist/openui.js +1 -6
  36. package/dist/pages.d.ts +1 -2
  37. package/dist/pages.js +68 -66
  38. package/dist/primitives.d.ts +14 -49
  39. package/dist/primitives.js +69 -77
  40. package/dist/run.d.ts +1 -14
  41. package/dist/run.js +2 -22
  42. package/dist/sdk-hooks.d.ts +3 -283
  43. package/dist/sdk-hooks.js +10 -14
  44. package/dist/stores.d.ts +2 -14
  45. package/dist/stores.js +11 -39
  46. package/dist/styles.css +2 -1265
  47. package/dist/{usage-chart-CPTcNlGs.d.ts → template-card-UhV3pmRC.d.ts} +16 -1
  48. package/dist/types.d.ts +11 -8
  49. package/dist/types.js +1 -0
  50. package/dist/utils.d.ts +1 -44
  51. package/dist/utils.js +6 -12
  52. package/dist/workspace.d.ts +5 -10
  53. package/dist/workspace.js +3 -19
  54. package/package.json +19 -54
  55. package/dist/active-sessions-store-CeOmXgv5.d.ts +0 -85
  56. package/dist/artifact-pane-Bh45Ssco.d.ts +0 -24
  57. package/dist/branding-DCi5VEik.d.ts +0 -13
  58. package/dist/button-CMQuQEW_.d.ts +0 -17
  59. package/dist/chat-container-f4yEs6KN.d.ts +0 -106
  60. package/dist/chunk-34A66VBG.js +0 -214
  61. package/dist/chunk-34I7UFSX.js +0 -92
  62. package/dist/chunk-36QY2W5G.js +0 -802
  63. package/dist/chunk-4CLN43XT.js +0 -45
  64. package/dist/chunk-54SQQMMM.js +0 -156
  65. package/dist/chunk-66EZOYZR.js +0 -102
  66. package/dist/chunk-BX6AQMUS.js +0 -183
  67. package/dist/chunk-DI3NZ5ZX.js +0 -192
  68. package/dist/chunk-DPGIXDAI.js +0 -220
  69. package/dist/chunk-DXMIEK4K.js +0 -1426
  70. package/dist/chunk-GSZA3TSY.js +0 -79
  71. package/dist/chunk-HB5Y37YU.js +0 -54
  72. package/dist/chunk-LQNEZDRM.js +0 -109
  73. package/dist/chunk-MA7YKRUP.js +0 -131
  74. package/dist/chunk-MKTSMWVD.js +0 -109
  75. package/dist/chunk-MQXABZTB.js +0 -1348
  76. package/dist/chunk-MT5FJ3ZT.js +0 -186
  77. package/dist/chunk-NKUPJC34.js +0 -2070
  78. package/dist/chunk-OEX7NZE3.js +0 -321
  79. package/dist/chunk-OKLQVY3Y.js +0 -139
  80. package/dist/chunk-Q56BYXQF.js +0 -61
  81. package/dist/chunk-QD4QE5P5.js +0 -40
  82. package/dist/chunk-QDH5GEGY.js +0 -630
  83. package/dist/chunk-QID2OOMG.js +0 -133
  84. package/dist/chunk-RQHJBTEU.js +0 -10
  85. package/dist/chunk-T7HMZEVO.js +0 -216
  86. package/dist/chunk-U6QTHMY6.js +0 -1290
  87. package/dist/chunk-US6JKJKH.js +0 -124
  88. package/dist/chunk-VX3XOUEB.js +0 -63
  89. package/dist/chunk-XLG757B6.js +0 -933
  90. package/dist/chunk-ZMNSRDMH.js +0 -127
  91. package/dist/chunk-ZNCEM5CD.js +0 -316
  92. package/dist/document-editor-pane-A70-EhdQ.d.ts +0 -124
  93. package/dist/document-editor-pane-TLPVRBBU.js +0 -11
  94. package/dist/expanded-tool-detail-Dh99mcbY.d.ts +0 -63
  95. package/dist/file-tabs-BLfxfmAH.d.ts +0 -51
  96. package/dist/parts-CyGkM6Fp.d.ts +0 -50
  97. package/dist/run-CtFZ6s-D.d.ts +0 -41
  98. package/dist/sidebar-drop-zone-tDBsuOH5.d.ts +0 -301
  99. package/dist/sidecar-CFU2W9j1.d.ts +0 -8
  100. package/dist/template-card-BAtvcAkU.d.ts +0 -18
  101. package/dist/tool-call-feed-Bs3MyQMT.d.ts +0 -68
  102. package/dist/tool-display-Ct9nFAzJ.d.ts +0 -32
  103. package/dist/use-sandbox-metrics-DWc0k9Xm.d.ts +0 -153
  104. package/dist/variant-list-BrHYcBCk.d.ts +0 -540
@@ -1,153 +0,0 @@
1
- interface AuthUser {
2
- customer_id: string;
3
- email: string;
4
- name?: string;
5
- tier: string;
6
- github?: {
7
- login: string;
8
- connected: boolean;
9
- } | null;
10
- session_expires_at?: string;
11
- }
12
- interface UseAuthOptions {
13
- apiBaseUrl: string;
14
- revalidateOnFocus?: boolean;
15
- shouldRetryOnError?: boolean;
16
- }
17
- interface UseAuthResult {
18
- user: AuthUser | null;
19
- isLoading: boolean;
20
- isError: boolean;
21
- error: Error | null;
22
- mutate: () => Promise<void>;
23
- }
24
- /**
25
- * Hook for managing authentication state.
26
- * Fetches user session from the API and provides loading/error states.
27
- */
28
- declare function useAuth({ apiBaseUrl, revalidateOnFocus, shouldRetryOnError, }: UseAuthOptions): UseAuthResult;
29
- /**
30
- * Creates a fetcher function that includes auth credentials.
31
- * Uses both cookie-based session and localStorage API key for backwards compatibility.
32
- */
33
- declare function createAuthFetcher(_apiBaseUrl: string): <T = unknown>(url: string, options?: RequestInit) => Promise<T>;
34
- /**
35
- * Hook to get the API key from localStorage.
36
- * For backwards compatibility with API key-based auth.
37
- */
38
- declare function useApiKey(): string | null;
39
-
40
- interface UsePtySessionOptions {
41
- /** Base URL of the sidecar (e.g. "http://localhost:9100"). */
42
- apiUrl: string;
43
- /** Bearer token for authentication. */
44
- token: string;
45
- /** Called with raw PTY output (may contain ANSI escape codes). */
46
- onData: (data: string) => void;
47
- }
48
- interface UsePtySessionReturn {
49
- /** Whether the underlying transport is connected and receiving data. */
50
- isConnected: boolean;
51
- /** Connection or API error, if any. */
52
- error: string | null;
53
- /** Send a command to the PTY session. */
54
- sendCommand: (command: string) => Promise<void>;
55
- /** Safely resize the remote PTY. */
56
- resizeTerminal: (cols: number, rows: number) => Promise<void>;
57
- /** Tear down and reconnect. */
58
- reconnect: () => void;
59
- }
60
- /**
61
- * Manages a PTY session against the sidecar terminal API.
62
- *
63
- * Transport:
64
- * 1. POST /terminals creates the session.
65
- * 2. The hook tries WebSocket: GET /terminals/:id/ws (Upgrade).
66
- * - Server → client: TEXT frames carrying raw PTY output.
67
- * - Client → server: BINARY frames carrying stdin (UTF-8); TEXT
68
- * frames carrying JSON control messages (`{"type":"resize",...}`).
69
- * 3. If the WS does not reach OPEN within WS_OPEN_TIMEOUT_MS, or it
70
- * errors before opening, the hook falls back to SSE+POST:
71
- * - GET /terminals/:id/stream (SSE for output)
72
- * - POST /terminals/:id/input (one batched POST at a time)
73
- * - PATCH /terminals/:id (resize)
74
- * 4. DELETE /terminals/:id closes the session (both transports).
75
- *
76
- * The WS path eliminates the per-keystroke HTTP round-trip that
77
- * dominates typing latency through edge proxies; the HTTP+SSE path is
78
- * preserved as a fallback so the hook keeps working against
79
- * deployments that have not yet shipped the WS endpoint.
80
- */
81
- declare function usePtySession({ apiUrl, token, onData }: UsePtySessionOptions): UsePtySessionReturn;
82
-
83
- /**
84
- * Returns `Date.now()` and re-renders every `intervalMs` so derived
85
- * values like "uptime" tick forward without polling upstream data.
86
- */
87
- declare function useLiveTime(intervalMs?: number): number;
88
-
89
- /**
90
- * Shape returned by the sidecar `/metrics/json` endpoint. Only the
91
- * fields read by this hook are modeled; the sidecar may add more.
92
- */
93
- interface SidecarMetricsPayload {
94
- process?: {
95
- memoryBytes?: {
96
- rss?: number;
97
- heapTotal?: number;
98
- heapUsed?: number;
99
- external?: number;
100
- arrayBuffers?: number;
101
- };
102
- cpuSeconds?: {
103
- user?: number;
104
- system?: number;
105
- };
106
- };
107
- }
108
- interface SandboxMetrics {
109
- /**
110
- * CPU% derived from consecutive samples. `null` on the first sample
111
- * because a delta is required. Can exceed 100 on multi-core hosts.
112
- */
113
- cpuPercent: number | null;
114
- rssBytes: number;
115
- heapUsedBytes: number;
116
- heapTotalBytes: number;
117
- }
118
- interface UseSandboxMetricsOptions {
119
- /** Sandbox API base URL, e.g. `https://api.tangle.tools`. */
120
- apiBaseUrl: string;
121
- /** Sandbox id; when falsy the hook stays idle. */
122
- sandboxId?: string | null;
123
- /**
124
- * Optional bearer token. When omitted the fetch still sends
125
- * credentials so a cookie session can authenticate the proxy.
126
- */
127
- token?: string | null;
128
- /** Pause polling when false. Defaults to true. */
129
- enabled?: boolean;
130
- /** Poll cadence; clamped to a 500ms floor. Defaults to 3000. */
131
- intervalMs?: number;
132
- }
133
- interface UseSandboxMetricsResult {
134
- metrics: SandboxMetrics | null;
135
- /**
136
- * True only until the first successful sample has arrived (or the
137
- * first one after the target `sandboxId` changes). Subsequent polls
138
- * do not flip this back to true, so consumers can gate a spinner
139
- * on it without it flashing on every cycle.
140
- */
141
- loading: boolean;
142
- error: Error | null;
143
- /** Wall-clock ms of the last successful sample, or null. */
144
- lastUpdatedAt: number | null;
145
- }
146
- /**
147
- * Polls the sandbox's sidecar metrics through the API proxy and
148
- * derives a CPU% value from consecutive cumulative-CPU samples. Used
149
- * by the sandbox overview dashboard to drive live CPU/memory panels.
150
- */
151
- declare function useSandboxMetrics({ apiBaseUrl, sandboxId, token, enabled, intervalMs, }: UseSandboxMetricsOptions): UseSandboxMetricsResult;
152
-
153
- export { type AuthUser as A, type SandboxMetrics as S, type UseAuthOptions as U, type SidecarMetricsPayload as a, type UseAuthResult as b, type UsePtySessionOptions as c, type UsePtySessionReturn as d, type UseSandboxMetricsOptions as e, type UseSandboxMetricsResult as f, createAuthFetcher as g, useAuth as h, useLiveTime as i, usePtySession as j, useSandboxMetrics as k, useApiKey as u };
@@ -1,540 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as React from 'react';
3
-
4
- interface SidebarUser {
5
- email: string;
6
- name?: string;
7
- tier?: string;
8
- avatarUrl?: string;
9
- }
10
- interface SidebarProps {
11
- children: React.ReactNode;
12
- className?: string;
13
- style?: React.CSSProperties;
14
- }
15
- declare function Sidebar({ children, className, style }: SidebarProps): react_jsx_runtime.JSX.Element;
16
- interface SidebarRailProps {
17
- children: React.ReactNode;
18
- className?: string;
19
- /**
20
- * Render the rail at the wider mobile-drawer width so labels fit
21
- * beside the icons. Defaults to the 64px icon-only rail used on
22
- * desktop.
23
- */
24
- wide?: boolean;
25
- }
26
- declare function SidebarRail({ children, className, wide }: SidebarRailProps): react_jsx_runtime.JSX.Element;
27
- interface SidebarRailHeaderProps {
28
- children: React.ReactNode;
29
- className?: string;
30
- }
31
- declare function SidebarRailHeader({ children, className }: SidebarRailHeaderProps): react_jsx_runtime.JSX.Element;
32
- interface SidebarRailNavProps {
33
- children: React.ReactNode;
34
- className?: string;
35
- }
36
- declare function SidebarRailNav({ children, className }: SidebarRailNavProps): react_jsx_runtime.JSX.Element;
37
- interface SidebarRailFooterProps {
38
- children: React.ReactNode;
39
- className?: string;
40
- }
41
- declare function SidebarRailFooter({ children, className }: SidebarRailFooterProps): react_jsx_runtime.JSX.Element;
42
- interface RailSeparatorProps {
43
- className?: string;
44
- }
45
- declare function RailSeparator({ className }: RailSeparatorProps): react_jsx_runtime.JSX.Element;
46
- interface RailButtonProps {
47
- icon: React.ComponentType<{
48
- className?: string;
49
- }>;
50
- label: string;
51
- isActive?: boolean;
52
- badge?: number;
53
- onClick?: () => void;
54
- className?: string;
55
- /** Show label text next to icon (for mobile drawer) */
56
- showLabel?: boolean;
57
- }
58
- declare function RailButton({ icon: Icon, label, isActive, badge, onClick, className, showLabel }: RailButtonProps): react_jsx_runtime.JSX.Element;
59
- interface RailModeButtonProps {
60
- mode: string;
61
- icon: React.ComponentType<{
62
- className?: string;
63
- }>;
64
- label: string;
65
- badge?: number;
66
- className?: string;
67
- /** Show label text next to icon (for mobile drawer) */
68
- showLabel?: boolean;
69
- }
70
- declare function RailModeButton({ mode, icon, label, badge, className, showLabel }: RailModeButtonProps): react_jsx_runtime.JSX.Element;
71
- interface SidebarPanelProps {
72
- children: React.ReactNode;
73
- className?: string;
74
- }
75
- declare function SidebarPanel({ children, className }: SidebarPanelProps): react_jsx_runtime.JSX.Element;
76
- interface SidebarPanelHeaderProps {
77
- children?: React.ReactNode;
78
- title?: string;
79
- className?: string;
80
- }
81
- declare function SidebarPanelHeader({ children, title, className }: SidebarPanelHeaderProps): react_jsx_runtime.JSX.Element;
82
- interface SidebarPanelContentProps {
83
- children: React.ReactNode;
84
- className?: string;
85
- }
86
- declare function SidebarPanelContent({ children, className }: SidebarPanelContentProps): react_jsx_runtime.JSX.Element;
87
- interface SidebarContentProps {
88
- children: React.ReactNode;
89
- className?: string;
90
- }
91
- declare function SidebarContent({ children, className }: SidebarContentProps): react_jsx_runtime.JSX.Element;
92
- interface ProfileAvatarProps {
93
- user?: SidebarUser | null;
94
- isLoading?: boolean;
95
- onLogout?: () => void;
96
- onSettingsClick?: () => void;
97
- settingsHref?: string;
98
- /** Extra dropdown items rendered before settings/logout */
99
- children?: React.ReactNode;
100
- className?: string;
101
- LinkComponent?: React.ComponentType<any>;
102
- }
103
- declare function ProfileAvatar({ user, isLoading, onLogout, onSettingsClick, settingsHref, children, className, LinkComponent, }: ProfileAvatarProps): react_jsx_runtime.JSX.Element;
104
-
105
- /** Width constants (px) matching blueprint-agent layout */
106
- declare const SIDEBAR_RAIL_WIDTH = 64;
107
- declare const SIDEBAR_PANEL_WIDTH = 260;
108
- declare const SIDEBAR_TOTAL_WIDTH: number;
109
- /**
110
- * Width of the mobile drawer when the rail is rendered with labels
111
- * (`showLabel` on {@link RailButton}). The standard 64px rail is only
112
- * wide enough for icons; labels need a wider container to avoid truncation.
113
- */
114
- declare const SIDEBAR_MOBILE_WIDTH = 256;
115
- interface SidebarContextValue {
116
- /** Whether the content panel beside the rail is open */
117
- panelOpen: boolean;
118
- setPanelOpen: (open: boolean) => void;
119
- togglePanel: () => void;
120
- /** Current panel mode (app-defined, e.g. "projects", "batches") */
121
- mode: string;
122
- setMode: (mode: string) => void;
123
- /** Switch mode — opens panel if closed, closes if same mode clicked */
124
- switchMode: (mode: string) => void;
125
- /** Whether entire sidebar (rail + panel) is hidden (focus mode) */
126
- hidden: boolean;
127
- setHidden: (hidden: boolean) => void;
128
- /** Computed content margin in px */
129
- contentMargin: number;
130
- /** Whether there are panels at all */
131
- hasPanels: boolean;
132
- }
133
- interface SidebarProviderProps {
134
- defaultPanelOpen?: boolean;
135
- defaultMode?: string;
136
- hasPanels?: boolean;
137
- children: React.ReactNode;
138
- }
139
- declare function SidebarProvider({ defaultPanelOpen, defaultMode, hasPanels, children, }: SidebarProviderProps): react_jsx_runtime.JSX.Element;
140
- declare function useSidebar(): SidebarContextValue;
141
-
142
- interface ClusterStatusItem {
143
- icon?: React.ReactNode;
144
- label: string;
145
- value: React.ReactNode;
146
- valueClass?: string;
147
- }
148
- interface ClusterStatusBarProps {
149
- items: ClusterStatusItem[];
150
- latency?: string;
151
- className?: string;
152
- }
153
- declare function ClusterStatusBar({ items, latency, className }: ClusterStatusBarProps): react_jsx_runtime.JSX.Element | null;
154
-
155
- interface CreditBalanceProps {
156
- amount: number;
157
- description?: string;
158
- onTopUp?: (amount: number) => void;
159
- quickAmounts?: number[];
160
- className?: string;
161
- }
162
- declare function CreditBalance({ amount, description, onTopUp, quickAmounts, className, }: CreditBalanceProps): react_jsx_runtime.JSX.Element;
163
-
164
- interface Invoice {
165
- id: string;
166
- date: string;
167
- amount: number;
168
- status: "paid" | "pending" | "failed";
169
- }
170
- interface InvoiceTableProps {
171
- invoices: Invoice[];
172
- onExportAll?: () => void;
173
- onLoadMore?: () => void;
174
- onViewInvoice?: (id: string) => void;
175
- hasMore?: boolean;
176
- className?: string;
177
- }
178
- declare function InvoiceTable({ invoices, onExportAll, onLoadMore, onViewInvoice, hasMore, className }: InvoiceTableProps): react_jsx_runtime.JSX.Element;
179
-
180
- interface PlanFeature {
181
- text: string;
182
- }
183
- interface PlanCardData {
184
- id: string;
185
- name: string;
186
- price: number;
187
- period?: string;
188
- features: PlanFeature[];
189
- popular?: boolean;
190
- current?: boolean;
191
- ctaLabel?: string;
192
- onSelect?: (id: string) => void;
193
- }
194
- interface PlanCardsProps {
195
- plans: PlanCardData[];
196
- className?: string;
197
- }
198
- declare function PlanCards({ plans, className }: PlanCardsProps): react_jsx_runtime.JSX.Element;
199
-
200
- type ProductVariant = "sandbox";
201
- interface NavItem {
202
- id: string;
203
- label: string;
204
- href?: string;
205
- icon: React.ComponentType<{
206
- className?: string;
207
- }>;
208
- badge?: number;
209
- }
210
- interface DashboardUser {
211
- email: string;
212
- name?: string;
213
- tier?: string;
214
- avatarUrl?: string;
215
- }
216
- interface TopNavLink {
217
- label: string;
218
- href: string;
219
- }
220
- interface PanelConfig {
221
- mode: string;
222
- title: string;
223
- content: React.ReactNode;
224
- }
225
- interface DashboardLayoutProps {
226
- children: React.ReactNode;
227
- variant?: ProductVariant;
228
- /** Navigation items for the rail */
229
- navItems: NavItem[];
230
- /** Nav item IDs that act as panel mode switchers (others are direct links) */
231
- modeItems?: string[];
232
- /** Panel content per mode */
233
- panels?: PanelConfig[];
234
- activeNavId?: string;
235
- user?: DashboardUser | null;
236
- isLoading?: boolean;
237
- onLogout?: () => void;
238
- onSettingsClick?: () => void;
239
- settingsHref?: string;
240
- onNewSandbox?: () => void;
241
- className?: string;
242
- sidebarClassName?: string;
243
- contentClassName?: string;
244
- topNavLinks?: TopNavLink[];
245
- activeTopNavHref?: string;
246
- LinkComponent?: React.ComponentType<any>;
247
- footer?: React.ReactNode;
248
- defaultPanelOpen?: boolean;
249
- defaultMode?: string;
250
- /** Extra content in the rail footer (above profile avatar) */
251
- railFooter?: React.ReactNode;
252
- /** Extra dropdown items in the profile menu */
253
- profileMenuItems?: React.ReactNode;
254
- /** Notification data for the bell dropdown */
255
- notifications?: {
256
- items: {
257
- id: string;
258
- title: string;
259
- message: string;
260
- read: boolean;
261
- createdAt: string;
262
- }[];
263
- unreadCount: number;
264
- onMarkRead?: (id: string) => void;
265
- onMarkAllRead?: () => void;
266
- };
267
- }
268
- declare function DashboardLayout({ defaultPanelOpen, defaultMode, ...props }: DashboardLayoutProps): react_jsx_runtime.JSX.Element;
269
-
270
- interface ResourceMeterProps {
271
- label: string;
272
- value: number;
273
- max?: number;
274
- unit?: string;
275
- icon?: React.ReactNode;
276
- className?: string;
277
- }
278
- declare function ResourceMeter({ label, value, max, unit, icon, className }: ResourceMeterProps): react_jsx_runtime.JSX.Element;
279
-
280
- type SandboxStatus = "running" | "hibernating" | "provisioning" | "stopped" | "failed" | "archived" | "creating";
281
- type TeamRole = "owner" | "admin" | "member" | "viewer";
282
- interface SandboxCardData {
283
- id: string;
284
- name: string;
285
- nodeId?: string;
286
- status: SandboxStatus;
287
- image?: string;
288
- imageIcon?: React.ReactNode;
289
- cpuPercent?: number;
290
- ramUsed?: number;
291
- ramTotal?: number;
292
- provisioningMessage?: string;
293
- provisioningPercent?: number;
294
- archivedAt?: string;
295
- /**
296
- * Populated when the sandbox is shared with a team. Drives a small
297
- * "shared with X" badge in the card header so a user can see at a
298
- * glance which of their sandboxes are personal vs. collaborative.
299
- */
300
- team?: {
301
- id: string;
302
- name?: string;
303
- /** Caller's role in the team — the card uses this to gate the Delete action. */
304
- role: TeamRole;
305
- };
306
- }
307
- interface SandboxCardProps {
308
- sandbox: SandboxCardData;
309
- onOpenIDE?: (id: string) => void;
310
- onOpenTerminal?: (id: string) => void;
311
- onWake?: (id: string) => void;
312
- onRestore?: (id: string) => void;
313
- onDelete?: (id: string) => void;
314
- onStop?: (id: string) => void;
315
- onResume?: (id: string) => void;
316
- onFork?: (id: string) => void;
317
- onKeepAlive?: (id: string) => void;
318
- onUsage?: (id: string) => void;
319
- onHealth?: (id: string) => void;
320
- className?: string;
321
- }
322
- declare function canAdminSandbox(sandbox: SandboxCardData): boolean;
323
- declare function SandboxCard({ sandbox, onOpenIDE, onOpenTerminal, onWake, onRestore, onDelete, onStop, onResume, onFork, onKeepAlive, onUsage, onHealth, className }: SandboxCardProps): react_jsx_runtime.JSX.Element;
324
- interface NewSandboxCardProps {
325
- onClick?: () => void;
326
- className?: string;
327
- }
328
- declare function NewSandboxCard({ onClick, className }: NewSandboxCardProps): react_jsx_runtime.JSX.Element;
329
-
330
- interface SandboxTableProps {
331
- sandboxes: SandboxCardData[];
332
- page?: number;
333
- pageSize?: number;
334
- total?: number;
335
- onPageChange?: (page: number) => void;
336
- onOpenIDE?: (id: string) => void;
337
- onOpenTerminal?: (id: string) => void;
338
- onSSH?: (id: string) => void;
339
- onWake?: (id: string) => void;
340
- onMore?: (id: string) => void;
341
- onDelete?: (id: string) => void;
342
- className?: string;
343
- }
344
- declare function SandboxTable({ sandboxes, page, pageSize, total, onPageChange, onOpenIDE, onOpenTerminal, onSSH, onWake, onMore, onDelete, className, }: SandboxTableProps): react_jsx_runtime.JSX.Element;
345
-
346
- interface Backend {
347
- type: string;
348
- label: string;
349
- description?: string;
350
- }
351
- interface BackendSelectorProps {
352
- backends: Backend[];
353
- selected: string;
354
- onChange: (selected: string) => void;
355
- label?: string;
356
- placeholder?: string;
357
- className?: string;
358
- }
359
- declare function BackendSelector({ backends, selected, onChange, label, placeholder, className, }: BackendSelectorProps): react_jsx_runtime.JSX.Element;
360
-
361
- /**
362
- * Sandbox agent harness types — mirrors `BackendType` from
363
- * `@tangle-network/sandbox` SDK. Kept in lockstep with that enum:
364
- * if the SDK adds a backend, add it here too.
365
- */
366
- type HarnessType = "opencode" | "claude-code" | "codex" | "amp" | "factory-droids" | "cli-base";
367
- interface HarnessOption extends Backend {
368
- type: HarnessType;
369
- }
370
- /**
371
- * Default option list with human-readable copy. Order is curated so the
372
- * recommended choice (`opencode`) appears first; `cli-base` (no agent) last.
373
- */
374
- declare const HARNESS_OPTIONS: readonly HarnessOption[];
375
- interface HarnessPickerProps extends Omit<BackendSelectorProps, "backends" | "selected" | "onChange"> {
376
- value: HarnessType;
377
- onChange: (next: HarnessType) => void;
378
- /** Filter the available harnesses (e.g. by plan tier). Defaults to all. */
379
- available?: ReadonlyArray<HarnessType>;
380
- /** Override or extend the option metadata. Keys are HarnessType. */
381
- optionsOverride?: Partial<Record<HarnessType, Partial<Omit<HarnessOption, "type">>>>;
382
- }
383
- /**
384
- * Type-safe harness/backend selector for sandbox-backed agent products.
385
- *
386
- * Wraps the generic {@link BackendSelector} with the canonical harness list
387
- * baked in, so consumers don't have to re-declare it (or risk drifting from
388
- * the SDK enum).
389
- */
390
- declare function HarnessPicker({ value, onChange, available, optionsOverride, label, ...rest }: HarnessPickerProps): react_jsx_runtime.JSX.Element;
391
-
392
- /**
393
- * Wire-format model entry as returned by `/v1/models` on the Tangle Router
394
- * (and most OpenAI-compatible gateways). Field names match the upstream
395
- * response so consumers can pass `data.data` straight through.
396
- */
397
- interface ModelInfo {
398
- /** Provider-local id, e.g. "gpt-5.4" or "anthropic/claude-sonnet-4-6". */
399
- id: string;
400
- /** Human label (defaults to id if absent). */
401
- name?: string;
402
- /** Provider key, e.g. "openai", "anthropic". Underscored for compat with router. */
403
- _provider?: string;
404
- /** Alternative provider field on some gateways. */
405
- provider?: string;
406
- /**
407
- * Per-token prices in USD as decimal strings. Multiply by 1_000_000 for
408
- * the conventional $/M tokens display.
409
- */
410
- pricing?: {
411
- prompt?: string | null;
412
- completion?: string | null;
413
- };
414
- context_length?: number;
415
- description?: string | null;
416
- architecture?: {
417
- modality?: string;
418
- input_modalities?: string[];
419
- output_modalities?: string[];
420
- };
421
- }
422
- /**
423
- * Curated preset bucket. Three are surfaced by default — they map to typical
424
- * cost/quality tradeoffs without forcing the consumer to pick a specific
425
- * model. `match` resolves the preset against the loaded model list.
426
- */
427
- interface ModelPreset {
428
- id: "fast" | "balanced" | "best" | string;
429
- label: string;
430
- hint: string;
431
- icon?: React.ComponentType<{
432
- className?: string;
433
- }>;
434
- /**
435
- * Pick the canonical model id for this preset given the loaded list.
436
- * Should return undefined if no acceptable model is loaded yet.
437
- */
438
- match: (models: ModelInfo[]) => string | undefined;
439
- }
440
- type ModelPickerVariant = "field" | "pill";
441
- interface ModelPickerProps {
442
- /** Canonical model id (provider-prefixed, e.g. "openai/gpt-5.4"). */
443
- value: string;
444
- onChange: (modelId: string) => void;
445
- /** Models to choose from. Pass `[]` while loading. */
446
- models: ModelInfo[];
447
- /** Show the loading state (overrides empty-list copy). */
448
- loading?: boolean;
449
- /** Recently-used canonical ids to surface at the top. */
450
- recents?: ReadonlyArray<string>;
451
- /**
452
- * Curated presets shown above the full list. Defaults to Fast/Balanced/Best
453
- * resolved against common gpt-5/Claude families.
454
- */
455
- presets?: ReadonlyArray<ModelPreset>;
456
- /** Drop providers from the picker entirely (e.g. "audio", "embedding"). */
457
- excludeProviders?: ReadonlyArray<string>;
458
- /** Restrict to these architectures (e.g. ["text"]). Default: all. */
459
- modalities?: ReadonlyArray<string>;
460
- /** Trigger appearance. "field" = full-width form field; "pill" = inline chat input pill. */
461
- variant?: ModelPickerVariant;
462
- label?: string;
463
- placeholder?: string;
464
- className?: string;
465
- disabled?: boolean;
466
- }
467
- /**
468
- * Resolve the canonical id for a model. Some upstreams already prefix the
469
- * provider in the id (e.g. "anthropic/claude-haiku-4.5"); others put it in
470
- * `_provider` and leave the id bare. Always returns "<provider>/<model>"
471
- * unless the id is already prefixed.
472
- */
473
- declare function canonicalModelId(model: ModelInfo): string;
474
- /** Format $/M tokens. Returns null if pricing is missing or zero. */
475
- declare function formatPricing(pricing: ModelInfo["pricing"]): string | null;
476
- /** Format context length compactly (e.g. 200_000 → "200k"). */
477
- declare function formatContext(ctx: number | undefined): string | null;
478
- declare function ModelPicker({ value, onChange, models, loading, recents, presets, excludeProviders, modalities, variant, label, placeholder, className, disabled, }: ModelPickerProps): react_jsx_runtime.JSX.Element;
479
-
480
- interface Profile {
481
- id: string;
482
- name: string;
483
- description?: string;
484
- is_builtin?: boolean;
485
- extends?: string;
486
- model?: string;
487
- metrics?: {
488
- total_runs: number;
489
- success_rate: number;
490
- avg_duration_ms: number;
491
- };
492
- }
493
- interface ProfileSelectorProps {
494
- profiles: Profile[];
495
- selectedId?: string | null;
496
- onSelect: (profile: Profile | null) => void;
497
- onCreateClick?: () => void;
498
- onManageClick?: () => void;
499
- label?: string;
500
- placeholder?: string;
501
- showMetrics?: boolean;
502
- className?: string;
503
- }
504
- declare function ProfileSelector({ profiles, selectedId, onSelect, onCreateClick, onManageClick, label, placeholder, showMetrics, className, }: ProfileSelectorProps): react_jsx_runtime.JSX.Element;
505
- /**
506
- * Profile performance comparison card.
507
- * Shows metrics from multiple profiles side by side.
508
- */
509
- interface ProfileComparisonProps {
510
- profiles: Profile[];
511
- className?: string;
512
- }
513
- declare function ProfileComparison({ profiles, className, }: ProfileComparisonProps): react_jsx_runtime.JSX.Element | null;
514
-
515
- type VariantStatus = "pending" | "running" | "completed" | "failed" | "cancelled";
516
- type VariantOutcome = "pending_review" | "accepted" | "rejected" | "merged_with_conflicts" | "expired";
517
- interface Variant {
518
- id: string;
519
- label: string;
520
- sublabel?: string;
521
- status: VariantStatus;
522
- outcome?: VariantOutcome;
523
- durationMs?: number;
524
- error?: string;
525
- summary?: string;
526
- /** Link to view variant details (e.g., chat UI) */
527
- detailsUrl?: string;
528
- }
529
- interface VariantListProps {
530
- variants: Variant[];
531
- selectedId?: string | null;
532
- onSelect?: (id: string) => void;
533
- onAccept?: (id: string) => void;
534
- onReject?: (id: string) => void;
535
- isActioning?: string | null;
536
- className?: string;
537
- }
538
- declare function VariantList({ variants, selectedId, onSelect, onAccept, onReject, isActioning, className, }: VariantListProps): react_jsx_runtime.JSX.Element;
539
-
540
- export { SandboxTable as $, type ProfileComparisonProps as A, type Backend as B, ClusterStatusBar as C, DashboardLayout as D, ProfileSelector as E, type ProfileSelectorProps as F, type RailButtonProps as G, HARNESS_OPTIONS as H, type Invoice as I, RailModeButton as J, type RailModeButtonProps as K, RailSeparator as L, type ModelInfo as M, type NavItem as N, type RailSeparatorProps as O, type PanelConfig as P, ResourceMeter as Q, RailButton as R, type ResourceMeterProps as S, SIDEBAR_MOBILE_WIDTH as T, SIDEBAR_PANEL_WIDTH as U, SIDEBAR_RAIL_WIDTH as V, SIDEBAR_TOTAL_WIDTH as W, SandboxCard as X, type SandboxCardData as Y, type SandboxCardProps as Z, type SandboxStatus as _, BackendSelector as a, type SandboxTableProps as a0, Sidebar as a1, SidebarContent as a2, type SidebarContentProps as a3, SidebarPanel as a4, SidebarPanelContent as a5, type SidebarPanelContentProps as a6, SidebarPanelHeader as a7, type SidebarPanelHeaderProps as a8, type SidebarPanelProps as a9, type SidebarProps as aa, SidebarProvider as ab, type SidebarProviderProps as ac, SidebarRail as ad, SidebarRailFooter as ae, type SidebarRailFooterProps as af, SidebarRailHeader as ag, type SidebarRailHeaderProps as ah, SidebarRailNav as ai, type SidebarRailNavProps as aj, type SidebarRailProps as ak, type SidebarUser as al, type TopNavLink as am, VariantList as an, type VariantListProps as ao, canonicalModelId as ap, formatContext as aq, formatPricing as ar, useSidebar as as, type Profile as at, type PlanFeature as au, type TeamRole as av, type Variant as aw, type VariantOutcome as ax, type VariantStatus as ay, canAdminSandbox as az, type BackendSelectorProps as b, type ClusterStatusBarProps as c, type ClusterStatusItem as d, CreditBalance as e, type CreditBalanceProps as f, type DashboardLayoutProps as g, type DashboardUser as h, HarnessPicker as i, type HarnessPickerProps as j, type HarnessType as k, InvoiceTable as l, type InvoiceTableProps as m, ModelPicker as n, type ModelPickerProps as o, type ModelPickerVariant as p, type ModelPreset as q, NewSandboxCard as r, type NewSandboxCardProps as s, type PlanCardData as t, PlanCards as u, type PlanCardsProps as v, type ProductVariant as w, ProfileAvatar as x, type ProfileAvatarProps as y, ProfileComparison as z };