@tangle-network/sandbox-ui 0.2.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/README.md +68 -0
- package/dist/auth.d.ts +57 -0
- package/dist/auth.js +14 -0
- package/dist/branding-DCi5VEik.d.ts +13 -0
- package/dist/button-BidTtuRS.d.ts +15 -0
- package/dist/chat.d.ts +121 -0
- package/dist/chat.js +25 -0
- package/dist/chunk-2UHPE5T7.js +201 -0
- package/dist/chunk-4EIWPJMJ.js +545 -0
- package/dist/chunk-6MQIDUPA.js +502 -0
- package/dist/chunk-B26TQ7SA.js +47 -0
- package/dist/chunk-E6FS7R4X.js +109 -0
- package/dist/chunk-GRYHFH5O.js +110 -0
- package/dist/chunk-HMND7JPA.js +868 -0
- package/dist/chunk-HRMUF35V.js +19 -0
- package/dist/chunk-HYEAX3DC.js +822 -0
- package/dist/chunk-KMXV7DDX.js +174 -0
- package/dist/chunk-KYY2X6LY.js +318 -0
- package/dist/chunk-L6ZDH5F4.js +334 -0
- package/dist/chunk-LTFK464G.js +103 -0
- package/dist/chunk-M34OA6PQ.js +233 -0
- package/dist/chunk-M6VLC32S.js +219 -0
- package/dist/chunk-MCGKDCOR.js +173 -0
- package/dist/chunk-NI2EI43H.js +294 -0
- package/dist/chunk-OU4TRNQZ.js +173 -0
- package/dist/chunk-QD4QE5P5.js +40 -0
- package/dist/chunk-QSQBDR3N.js +180 -0
- package/dist/chunk-RQHJBTEU.js +10 -0
- package/dist/chunk-U62G5TS7.js +472 -0
- package/dist/chunk-ZOL2TR5M.js +475 -0
- package/dist/dashboard.d.ts +111 -0
- package/dist/dashboard.js +26 -0
- package/dist/editor.d.ts +196 -0
- package/dist/editor.js +713 -0
- package/dist/expanded-tool-detail-OkXGqTHe.d.ts +52 -0
- package/dist/files.d.ts +66 -0
- package/dist/files.js +11 -0
- package/dist/hooks.d.ts +22 -0
- package/dist/hooks.js +107 -0
- package/dist/index.d.ts +107 -0
- package/dist/index.js +551 -0
- package/dist/markdown.d.ts +55 -0
- package/dist/markdown.js +17 -0
- package/dist/pages.d.ts +89 -0
- package/dist/pages.js +1181 -0
- package/dist/parts-CyGkM6Fp.d.ts +50 -0
- package/dist/primitives.d.ts +189 -0
- package/dist/primitives.js +161 -0
- package/dist/run-CtFZ6s-D.d.ts +41 -0
- package/dist/run.d.ts +14 -0
- package/dist/run.js +29 -0
- package/dist/sidecar-CFU2W9j1.d.ts +8 -0
- package/dist/stores.d.ts +28 -0
- package/dist/stores.js +49 -0
- package/dist/terminal.d.ts +44 -0
- package/dist/terminal.js +160 -0
- package/dist/tool-call-feed-D5Ume-Pt.d.ts +66 -0
- package/dist/tool-display-BvsVW_Ur.d.ts +32 -0
- package/dist/types.d.ts +6 -0
- package/dist/types.js +0 -0
- package/dist/usage-chart-DINgSVL5.d.ts +60 -0
- package/dist/use-sidecar-auth-Bb0-w3lX.d.ts +339 -0
- package/dist/utils.d.ts +28 -0
- package/dist/utils.js +28 -0
- package/dist/workspace.d.ts +113 -0
- package/dist/workspace.js +15 -0
- package/package.json +174 -0
- package/src/styles/globals.css +230 -0
- package/src/styles/tokens.css +73 -0
- package/tailwind.config.cjs +99 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,551 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AuthHeader,
|
|
3
|
+
GitHubLoginButton,
|
|
4
|
+
UserMenu
|
|
5
|
+
} from "./chunk-OU4TRNQZ.js";
|
|
6
|
+
import {
|
|
7
|
+
createAuthFetcher,
|
|
8
|
+
useApiKey,
|
|
9
|
+
useAuth,
|
|
10
|
+
useDropdownMenu,
|
|
11
|
+
useSSEStream,
|
|
12
|
+
useSessionStream,
|
|
13
|
+
useSidecarAuth,
|
|
14
|
+
useToolCallStream
|
|
15
|
+
} from "./chunk-HYEAX3DC.js";
|
|
16
|
+
import {
|
|
17
|
+
usePtySession
|
|
18
|
+
} from "./chunk-GRYHFH5O.js";
|
|
19
|
+
import {
|
|
20
|
+
copyText,
|
|
21
|
+
timeAgo
|
|
22
|
+
} from "./chunk-QD4QE5P5.js";
|
|
23
|
+
import {
|
|
24
|
+
Label,
|
|
25
|
+
Select,
|
|
26
|
+
SelectContent,
|
|
27
|
+
SelectGroup,
|
|
28
|
+
SelectItem,
|
|
29
|
+
SelectLabel,
|
|
30
|
+
SelectScrollDownButton,
|
|
31
|
+
SelectScrollUpButton,
|
|
32
|
+
SelectSeparator,
|
|
33
|
+
SelectTrigger,
|
|
34
|
+
SelectValue,
|
|
35
|
+
StatCard,
|
|
36
|
+
Switch,
|
|
37
|
+
Table,
|
|
38
|
+
TableBody,
|
|
39
|
+
TableCaption,
|
|
40
|
+
TableCell,
|
|
41
|
+
TableFooter,
|
|
42
|
+
TableHead,
|
|
43
|
+
TableHeader,
|
|
44
|
+
TableRow,
|
|
45
|
+
ToastContainer,
|
|
46
|
+
ToastProvider,
|
|
47
|
+
useToast
|
|
48
|
+
} from "./chunk-ZOL2TR5M.js";
|
|
49
|
+
import {
|
|
50
|
+
Avatar,
|
|
51
|
+
AvatarFallback,
|
|
52
|
+
AvatarImage
|
|
53
|
+
} from "./chunk-B26TQ7SA.js";
|
|
54
|
+
import {
|
|
55
|
+
Dialog,
|
|
56
|
+
DialogClose,
|
|
57
|
+
DialogContent,
|
|
58
|
+
DialogDescription,
|
|
59
|
+
DialogFooter,
|
|
60
|
+
DialogHeader,
|
|
61
|
+
DialogOverlay,
|
|
62
|
+
DialogPortal,
|
|
63
|
+
DialogTitle,
|
|
64
|
+
DialogTrigger,
|
|
65
|
+
EmptyState,
|
|
66
|
+
Input,
|
|
67
|
+
Tabs,
|
|
68
|
+
TabsContent,
|
|
69
|
+
TabsList,
|
|
70
|
+
TabsTrigger,
|
|
71
|
+
Textarea
|
|
72
|
+
} from "./chunk-NI2EI43H.js";
|
|
73
|
+
import {
|
|
74
|
+
ChatContainer,
|
|
75
|
+
ChatInput,
|
|
76
|
+
ChatMessage,
|
|
77
|
+
ChatMessageList,
|
|
78
|
+
MessageList,
|
|
79
|
+
ThinkingIndicator,
|
|
80
|
+
UserMessage
|
|
81
|
+
} from "./chunk-U62G5TS7.js";
|
|
82
|
+
import {
|
|
83
|
+
useAutoScroll,
|
|
84
|
+
useRunCollapseState,
|
|
85
|
+
useRunGroups
|
|
86
|
+
} from "./chunk-KMXV7DDX.js";
|
|
87
|
+
import {
|
|
88
|
+
ToolCallFeed,
|
|
89
|
+
ToolCallGroup,
|
|
90
|
+
ToolCallStep,
|
|
91
|
+
parseToolEvent
|
|
92
|
+
} from "./chunk-M6VLC32S.js";
|
|
93
|
+
import {
|
|
94
|
+
CommandPreview,
|
|
95
|
+
ExpandedToolDetail,
|
|
96
|
+
InlineThinkingItem,
|
|
97
|
+
InlineToolItem,
|
|
98
|
+
RunGroup,
|
|
99
|
+
WriteFilePreview
|
|
100
|
+
} from "./chunk-6MQIDUPA.js";
|
|
101
|
+
import {
|
|
102
|
+
CodeBlock,
|
|
103
|
+
CopyButton,
|
|
104
|
+
Markdown
|
|
105
|
+
} from "./chunk-LTFK464G.js";
|
|
106
|
+
import {
|
|
107
|
+
SimpleMarkdown,
|
|
108
|
+
simpleMarkdownStyles
|
|
109
|
+
} from "./chunk-M34OA6PQ.js";
|
|
110
|
+
import {
|
|
111
|
+
formatDuration,
|
|
112
|
+
truncateText
|
|
113
|
+
} from "./chunk-HRMUF35V.js";
|
|
114
|
+
import {
|
|
115
|
+
TOOL_CATEGORY_ICONS,
|
|
116
|
+
getToolCategory,
|
|
117
|
+
getToolDisplayMetadata,
|
|
118
|
+
getToolErrorText
|
|
119
|
+
} from "./chunk-QSQBDR3N.js";
|
|
120
|
+
import {
|
|
121
|
+
AuditResults,
|
|
122
|
+
StatusBanner,
|
|
123
|
+
StatusBar,
|
|
124
|
+
TerminalPanel,
|
|
125
|
+
WorkspaceLayout
|
|
126
|
+
} from "./chunk-KYY2X6LY.js";
|
|
127
|
+
import {
|
|
128
|
+
FilePreview,
|
|
129
|
+
FileTabs,
|
|
130
|
+
FileTree
|
|
131
|
+
} from "./chunk-L6ZDH5F4.js";
|
|
132
|
+
import {
|
|
133
|
+
BackendSelector,
|
|
134
|
+
DashboardLayout,
|
|
135
|
+
Logo,
|
|
136
|
+
ProfileComparison,
|
|
137
|
+
ProfileSelector,
|
|
138
|
+
TangleKnot,
|
|
139
|
+
ThemeToggle,
|
|
140
|
+
VariantList,
|
|
141
|
+
useTheme
|
|
142
|
+
} from "./chunk-HMND7JPA.js";
|
|
143
|
+
import {
|
|
144
|
+
BillingDashboard,
|
|
145
|
+
PricingPage,
|
|
146
|
+
UsageChart
|
|
147
|
+
} from "./chunk-4EIWPJMJ.js";
|
|
148
|
+
import {
|
|
149
|
+
DropdownMenu,
|
|
150
|
+
DropdownMenuCheckboxItem,
|
|
151
|
+
DropdownMenuContent,
|
|
152
|
+
DropdownMenuGroup,
|
|
153
|
+
DropdownMenuItem,
|
|
154
|
+
DropdownMenuLabel,
|
|
155
|
+
DropdownMenuPortal,
|
|
156
|
+
DropdownMenuRadioGroup,
|
|
157
|
+
DropdownMenuRadioItem,
|
|
158
|
+
DropdownMenuSeparator,
|
|
159
|
+
DropdownMenuShortcut,
|
|
160
|
+
DropdownMenuSub,
|
|
161
|
+
DropdownMenuSubContent,
|
|
162
|
+
DropdownMenuSubTrigger,
|
|
163
|
+
DropdownMenuTrigger
|
|
164
|
+
} from "./chunk-MCGKDCOR.js";
|
|
165
|
+
import {
|
|
166
|
+
Badge,
|
|
167
|
+
Card,
|
|
168
|
+
CardContent,
|
|
169
|
+
CardDescription,
|
|
170
|
+
CardFooter,
|
|
171
|
+
CardHeader,
|
|
172
|
+
CardTitle,
|
|
173
|
+
Progress,
|
|
174
|
+
Skeleton,
|
|
175
|
+
SkeletonCard,
|
|
176
|
+
SkeletonTable,
|
|
177
|
+
badgeVariants
|
|
178
|
+
} from "./chunk-2UHPE5T7.js";
|
|
179
|
+
import {
|
|
180
|
+
Button,
|
|
181
|
+
buttonVariants
|
|
182
|
+
} from "./chunk-E6FS7R4X.js";
|
|
183
|
+
import {
|
|
184
|
+
cn
|
|
185
|
+
} from "./chunk-RQHJBTEU.js";
|
|
186
|
+
|
|
187
|
+
// src/primitives/code-block.tsx
|
|
188
|
+
import { clsx } from "clsx";
|
|
189
|
+
import { useState } from "react";
|
|
190
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
191
|
+
function CodeBlock2({
|
|
192
|
+
code,
|
|
193
|
+
language,
|
|
194
|
+
showCopy = true,
|
|
195
|
+
showLineNumbers = false,
|
|
196
|
+
className,
|
|
197
|
+
...props
|
|
198
|
+
}) {
|
|
199
|
+
const [copied, setCopied] = useState(false);
|
|
200
|
+
const handleCopy = async () => {
|
|
201
|
+
await navigator.clipboard.writeText(code);
|
|
202
|
+
setCopied(true);
|
|
203
|
+
setTimeout(() => setCopied(false), 2e3);
|
|
204
|
+
};
|
|
205
|
+
const lines = code.split("\n");
|
|
206
|
+
return /* @__PURE__ */ jsxs("div", { className: "group relative", children: [
|
|
207
|
+
/* @__PURE__ */ jsx(
|
|
208
|
+
"pre",
|
|
209
|
+
{
|
|
210
|
+
className: clsx(
|
|
211
|
+
"overflow-x-auto rounded-lg border border-[#262626] bg-[#0a0a0a] p-4 font-mono text-sm",
|
|
212
|
+
className
|
|
213
|
+
),
|
|
214
|
+
...props,
|
|
215
|
+
children: /* @__PURE__ */ jsx("code", { className: language ? `language-${language}` : void 0, children: showLineNumbers ? /* @__PURE__ */ jsx("table", { className: "w-full", children: /* @__PURE__ */ jsx("tbody", { children: lines.map((line, i) => /* @__PURE__ */ jsxs("tr", { children: [
|
|
216
|
+
/* @__PURE__ */ jsx("td", { className: "w-8 select-none pr-4 text-right text-[#525252]", children: i + 1 }),
|
|
217
|
+
/* @__PURE__ */ jsx("td", { className: "text-[#a1a1a1]", children: line || " " })
|
|
218
|
+
] }, i)) }) }) : /* @__PURE__ */ jsx("span", { className: "text-[#a1a1a1]", children: code }) })
|
|
219
|
+
}
|
|
220
|
+
),
|
|
221
|
+
showCopy && /* @__PURE__ */ jsx(
|
|
222
|
+
"button",
|
|
223
|
+
{
|
|
224
|
+
onClick: handleCopy,
|
|
225
|
+
className: clsx(
|
|
226
|
+
"absolute top-2 right-2 rounded px-2 py-1 text-xs",
|
|
227
|
+
"bg-[#262626] text-[#a1a1a1] hover:bg-[#363636] hover:text-white",
|
|
228
|
+
"opacity-0 transition-opacity group-hover:opacity-100"
|
|
229
|
+
),
|
|
230
|
+
children: copied ? "Copied!" : "Copy"
|
|
231
|
+
}
|
|
232
|
+
)
|
|
233
|
+
] });
|
|
234
|
+
}
|
|
235
|
+
function InlineCode({ className, children, ...props }) {
|
|
236
|
+
return /* @__PURE__ */ jsx(
|
|
237
|
+
"code",
|
|
238
|
+
{
|
|
239
|
+
className: clsx(
|
|
240
|
+
"rounded border border-[#262626] bg-[#1a1a1a] px-1.5 py-0.5 font-mono text-sm",
|
|
241
|
+
className
|
|
242
|
+
),
|
|
243
|
+
...props,
|
|
244
|
+
children
|
|
245
|
+
}
|
|
246
|
+
);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// src/primitives/terminal-display.tsx
|
|
250
|
+
import * as React from "react";
|
|
251
|
+
import { useEffect, useRef } from "react";
|
|
252
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
253
|
+
var TerminalDisplay = React.forwardRef(
|
|
254
|
+
({
|
|
255
|
+
className,
|
|
256
|
+
variant = "default",
|
|
257
|
+
title = "Terminal",
|
|
258
|
+
showHeader = true,
|
|
259
|
+
autoScroll = true,
|
|
260
|
+
maxHeight = "400px",
|
|
261
|
+
children,
|
|
262
|
+
...props
|
|
263
|
+
}, ref) => {
|
|
264
|
+
const containerRef = useRef(null);
|
|
265
|
+
useEffect(() => {
|
|
266
|
+
if (autoScroll && containerRef.current) {
|
|
267
|
+
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
268
|
+
}
|
|
269
|
+
}, [autoScroll]);
|
|
270
|
+
const variants = {
|
|
271
|
+
default: "border-border",
|
|
272
|
+
sandbox: "border-purple-500/20 shadow-lg shadow-purple-500/5"
|
|
273
|
+
};
|
|
274
|
+
const dotColors = {
|
|
275
|
+
default: ["bg-red-500", "bg-yellow-500", "bg-green-500"],
|
|
276
|
+
sandbox: ["bg-red-500", "bg-yellow-500", "bg-purple-500"]
|
|
277
|
+
};
|
|
278
|
+
return /* @__PURE__ */ jsxs2(
|
|
279
|
+
"div",
|
|
280
|
+
{
|
|
281
|
+
ref,
|
|
282
|
+
className: cn(
|
|
283
|
+
"overflow-hidden rounded-xl border bg-[#0a0a0a] font-mono text-sm",
|
|
284
|
+
variants[variant],
|
|
285
|
+
className
|
|
286
|
+
),
|
|
287
|
+
...props,
|
|
288
|
+
children: [
|
|
289
|
+
showHeader && /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-2 border-border/50 border-b bg-card/30 px-4 py-3", children: [
|
|
290
|
+
/* @__PURE__ */ jsx2("div", { className: "flex gap-1.5", children: dotColors[variant].map((color) => /* @__PURE__ */ jsx2(
|
|
291
|
+
"div",
|
|
292
|
+
{
|
|
293
|
+
className: cn("h-3 w-3 rounded-full", color)
|
|
294
|
+
},
|
|
295
|
+
color
|
|
296
|
+
)) }),
|
|
297
|
+
/* @__PURE__ */ jsx2("span", { className: "ml-2 text-muted-foreground text-xs", children: title })
|
|
298
|
+
] }),
|
|
299
|
+
/* @__PURE__ */ jsx2(
|
|
300
|
+
"div",
|
|
301
|
+
{
|
|
302
|
+
ref: containerRef,
|
|
303
|
+
className: "overflow-auto p-4",
|
|
304
|
+
style: { maxHeight },
|
|
305
|
+
children
|
|
306
|
+
}
|
|
307
|
+
)
|
|
308
|
+
]
|
|
309
|
+
}
|
|
310
|
+
);
|
|
311
|
+
}
|
|
312
|
+
);
|
|
313
|
+
TerminalDisplay.displayName = "TerminalDisplay";
|
|
314
|
+
var TerminalLine = React.forwardRef(
|
|
315
|
+
({ className, type = "output", prompt = "$", timestamp, children, ...props }, ref) => {
|
|
316
|
+
const typeStyles = {
|
|
317
|
+
input: "text-foreground",
|
|
318
|
+
output: "text-muted-foreground",
|
|
319
|
+
error: "text-red-400",
|
|
320
|
+
success: "text-green-400",
|
|
321
|
+
info: "text-blue-400",
|
|
322
|
+
thinking: "text-yellow-400 animate-pulse",
|
|
323
|
+
command: "text-foreground",
|
|
324
|
+
warning: "text-yellow-400"
|
|
325
|
+
};
|
|
326
|
+
return /* @__PURE__ */ jsxs2(
|
|
327
|
+
"div",
|
|
328
|
+
{
|
|
329
|
+
ref,
|
|
330
|
+
className: cn(
|
|
331
|
+
"flex items-start gap-2 py-0.5 leading-relaxed",
|
|
332
|
+
typeStyles[type],
|
|
333
|
+
className
|
|
334
|
+
),
|
|
335
|
+
...props,
|
|
336
|
+
children: [
|
|
337
|
+
(type === "input" || type === "command") && /* @__PURE__ */ jsx2("span", { className: "shrink-0 select-none text-green-400", children: prompt }),
|
|
338
|
+
type === "thinking" && /* @__PURE__ */ jsx2("span", { className: "shrink-0 select-none", children: "..." }),
|
|
339
|
+
timestamp && /* @__PURE__ */ jsxs2("span", { className: "shrink-0 select-none text-muted-foreground/50", children: [
|
|
340
|
+
"[",
|
|
341
|
+
timestamp,
|
|
342
|
+
"]"
|
|
343
|
+
] }),
|
|
344
|
+
/* @__PURE__ */ jsx2("span", { className: "whitespace-pre-wrap break-all", children })
|
|
345
|
+
]
|
|
346
|
+
}
|
|
347
|
+
);
|
|
348
|
+
}
|
|
349
|
+
);
|
|
350
|
+
TerminalLine.displayName = "TerminalLine";
|
|
351
|
+
var TerminalCursor = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2(
|
|
352
|
+
"span",
|
|
353
|
+
{
|
|
354
|
+
ref,
|
|
355
|
+
className: cn(
|
|
356
|
+
"ml-0.5 inline-block h-4 w-2 animate-pulse bg-foreground",
|
|
357
|
+
className
|
|
358
|
+
),
|
|
359
|
+
...props
|
|
360
|
+
}
|
|
361
|
+
));
|
|
362
|
+
TerminalCursor.displayName = "TerminalCursor";
|
|
363
|
+
var TerminalInput = React.forwardRef(
|
|
364
|
+
({ className, onSubmit, variant = "default", ...props }, ref) => {
|
|
365
|
+
const [value, setValue] = React.useState("");
|
|
366
|
+
const handleKeyDown = (e) => {
|
|
367
|
+
if (e.key === "Enter" && value.trim() && onSubmit) {
|
|
368
|
+
onSubmit(value.trim());
|
|
369
|
+
setValue("");
|
|
370
|
+
}
|
|
371
|
+
};
|
|
372
|
+
const variants = {
|
|
373
|
+
default: "border-border focus-within:border-muted-foreground",
|
|
374
|
+
sandbox: "border-purple-500/20 focus-within:border-purple-500/50"
|
|
375
|
+
};
|
|
376
|
+
return /* @__PURE__ */ jsxs2(
|
|
377
|
+
"div",
|
|
378
|
+
{
|
|
379
|
+
className: cn(
|
|
380
|
+
"flex items-center rounded-lg border bg-[#0a0a0a] px-4 py-2.5 font-mono text-sm transition-colors",
|
|
381
|
+
variants[variant],
|
|
382
|
+
className
|
|
383
|
+
),
|
|
384
|
+
children: [
|
|
385
|
+
/* @__PURE__ */ jsx2("span", { className: "mr-2 select-none text-green-400", children: "$" }),
|
|
386
|
+
/* @__PURE__ */ jsx2(
|
|
387
|
+
"input",
|
|
388
|
+
{
|
|
389
|
+
ref,
|
|
390
|
+
type: "text",
|
|
391
|
+
value,
|
|
392
|
+
onChange: (e) => setValue(e.target.value),
|
|
393
|
+
onKeyDown: handleKeyDown,
|
|
394
|
+
className: "flex-1 bg-transparent text-foreground outline-none placeholder:text-muted-foreground",
|
|
395
|
+
...props
|
|
396
|
+
}
|
|
397
|
+
),
|
|
398
|
+
/* @__PURE__ */ jsx2(TerminalCursor, {})
|
|
399
|
+
]
|
|
400
|
+
}
|
|
401
|
+
);
|
|
402
|
+
}
|
|
403
|
+
);
|
|
404
|
+
TerminalInput.displayName = "TerminalInput";
|
|
405
|
+
export {
|
|
406
|
+
AuditResults,
|
|
407
|
+
AuthHeader,
|
|
408
|
+
Avatar,
|
|
409
|
+
AvatarFallback,
|
|
410
|
+
AvatarImage,
|
|
411
|
+
BackendSelector,
|
|
412
|
+
Badge,
|
|
413
|
+
BillingDashboard,
|
|
414
|
+
Button,
|
|
415
|
+
Card,
|
|
416
|
+
CardContent,
|
|
417
|
+
CardDescription,
|
|
418
|
+
CardFooter,
|
|
419
|
+
CardHeader,
|
|
420
|
+
CardTitle,
|
|
421
|
+
ChatContainer,
|
|
422
|
+
ChatInput,
|
|
423
|
+
ChatMessage,
|
|
424
|
+
ChatMessageList,
|
|
425
|
+
CodeBlock,
|
|
426
|
+
CodeBlock2 as CodeBlockDisplay,
|
|
427
|
+
CommandPreview,
|
|
428
|
+
CopyButton,
|
|
429
|
+
DashboardLayout,
|
|
430
|
+
Dialog,
|
|
431
|
+
DialogClose,
|
|
432
|
+
DialogContent,
|
|
433
|
+
DialogDescription,
|
|
434
|
+
DialogFooter,
|
|
435
|
+
DialogHeader,
|
|
436
|
+
DialogOverlay,
|
|
437
|
+
DialogPortal,
|
|
438
|
+
DialogTitle,
|
|
439
|
+
DialogTrigger,
|
|
440
|
+
DropdownMenu,
|
|
441
|
+
DropdownMenuCheckboxItem,
|
|
442
|
+
DropdownMenuContent,
|
|
443
|
+
DropdownMenuGroup,
|
|
444
|
+
DropdownMenuItem,
|
|
445
|
+
DropdownMenuLabel,
|
|
446
|
+
DropdownMenuPortal,
|
|
447
|
+
DropdownMenuRadioGroup,
|
|
448
|
+
DropdownMenuRadioItem,
|
|
449
|
+
DropdownMenuSeparator,
|
|
450
|
+
DropdownMenuShortcut,
|
|
451
|
+
DropdownMenuSub,
|
|
452
|
+
DropdownMenuSubContent,
|
|
453
|
+
DropdownMenuSubTrigger,
|
|
454
|
+
DropdownMenuTrigger,
|
|
455
|
+
EmptyState,
|
|
456
|
+
ExpandedToolDetail,
|
|
457
|
+
FilePreview,
|
|
458
|
+
FileTabs,
|
|
459
|
+
FileTree,
|
|
460
|
+
GitHubLoginButton,
|
|
461
|
+
InlineCode,
|
|
462
|
+
InlineThinkingItem,
|
|
463
|
+
InlineToolItem,
|
|
464
|
+
Input,
|
|
465
|
+
Label,
|
|
466
|
+
Logo,
|
|
467
|
+
Markdown,
|
|
468
|
+
MessageList,
|
|
469
|
+
PricingPage as PricingCards,
|
|
470
|
+
ProfileComparison,
|
|
471
|
+
ProfileSelector,
|
|
472
|
+
Progress,
|
|
473
|
+
RunGroup,
|
|
474
|
+
Select,
|
|
475
|
+
SelectContent,
|
|
476
|
+
SelectGroup,
|
|
477
|
+
SelectItem,
|
|
478
|
+
SelectLabel,
|
|
479
|
+
SelectScrollDownButton,
|
|
480
|
+
SelectScrollUpButton,
|
|
481
|
+
SelectSeparator,
|
|
482
|
+
SelectTrigger,
|
|
483
|
+
SelectValue,
|
|
484
|
+
SimpleMarkdown,
|
|
485
|
+
Skeleton,
|
|
486
|
+
SkeletonCard,
|
|
487
|
+
SkeletonTable,
|
|
488
|
+
StatCard,
|
|
489
|
+
StatusBanner,
|
|
490
|
+
StatusBar,
|
|
491
|
+
Switch,
|
|
492
|
+
TOOL_CATEGORY_ICONS,
|
|
493
|
+
Table,
|
|
494
|
+
TableBody,
|
|
495
|
+
TableCaption,
|
|
496
|
+
TableCell,
|
|
497
|
+
TableFooter,
|
|
498
|
+
TableHead,
|
|
499
|
+
TableHeader,
|
|
500
|
+
TableRow,
|
|
501
|
+
Tabs,
|
|
502
|
+
TabsContent,
|
|
503
|
+
TabsList,
|
|
504
|
+
TabsTrigger,
|
|
505
|
+
TangleKnot,
|
|
506
|
+
TerminalDisplay,
|
|
507
|
+
TerminalCursor as TerminalDisplayCursor,
|
|
508
|
+
TerminalInput as TerminalDisplayInput,
|
|
509
|
+
TerminalLine as TerminalDisplayLine,
|
|
510
|
+
TerminalPanel,
|
|
511
|
+
Textarea,
|
|
512
|
+
ThemeToggle,
|
|
513
|
+
ThinkingIndicator,
|
|
514
|
+
ToastContainer,
|
|
515
|
+
ToastProvider,
|
|
516
|
+
ToolCallFeed,
|
|
517
|
+
ToolCallGroup,
|
|
518
|
+
ToolCallStep,
|
|
519
|
+
UsageChart,
|
|
520
|
+
UserMenu,
|
|
521
|
+
UserMessage,
|
|
522
|
+
VariantList,
|
|
523
|
+
WorkspaceLayout,
|
|
524
|
+
WriteFilePreview,
|
|
525
|
+
badgeVariants,
|
|
526
|
+
buttonVariants,
|
|
527
|
+
cn,
|
|
528
|
+
copyText,
|
|
529
|
+
createAuthFetcher,
|
|
530
|
+
formatDuration,
|
|
531
|
+
getToolCategory,
|
|
532
|
+
getToolDisplayMetadata,
|
|
533
|
+
getToolErrorText,
|
|
534
|
+
parseToolEvent,
|
|
535
|
+
simpleMarkdownStyles,
|
|
536
|
+
timeAgo,
|
|
537
|
+
truncateText,
|
|
538
|
+
useApiKey,
|
|
539
|
+
useAuth,
|
|
540
|
+
useAutoScroll,
|
|
541
|
+
useDropdownMenu,
|
|
542
|
+
usePtySession,
|
|
543
|
+
useRunCollapseState,
|
|
544
|
+
useRunGroups,
|
|
545
|
+
useSSEStream,
|
|
546
|
+
useSessionStream,
|
|
547
|
+
useSidecarAuth,
|
|
548
|
+
useTheme,
|
|
549
|
+
useToast,
|
|
550
|
+
useToolCallStream
|
|
551
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* SimpleMarkdown — lightweight markdown renderer with Tangle styling.
|
|
7
|
+
*
|
|
8
|
+
* GFM tables, fenced code blocks with syntax highlighting,
|
|
9
|
+
* lists, links, blockquotes, headings. Tangle dark theme.
|
|
10
|
+
* No external dependencies (no react-markdown).
|
|
11
|
+
*/
|
|
12
|
+
interface SimpleMarkdownProps {
|
|
13
|
+
content: string;
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Lightweight markdown renderer — no external dependency.
|
|
18
|
+
* Handles the common patterns: headings, bold, italic, code, links, lists, tables, blockquotes.
|
|
19
|
+
* For full GFM, consumers can swap in react-markdown at the app level.
|
|
20
|
+
*/
|
|
21
|
+
declare function SimpleMarkdown({ content, className }: SimpleMarkdownProps): react_jsx_runtime.JSX.Element;
|
|
22
|
+
/**
|
|
23
|
+
* CSS for the markdown renderer. Import this in your app's global styles
|
|
24
|
+
* or include via <style> tag.
|
|
25
|
+
*/
|
|
26
|
+
declare const simpleMarkdownStyles = "\n.tangle-prose {\n font-family: var(--font-sans);\n color: var(--text-primary);\n font-size: 0.9375rem;\n line-height: 1.6;\n}\n.tangle-prose p { margin: 0.5em 0; }\n.tangle-prose p:last-child { margin-bottom: 0; }\n.tangle-h1 { font-size: 1.5rem; font-weight: 700; margin: 1em 0 0.5em; }\n.tangle-h2 { font-size: 1.25rem; font-weight: 700; margin: 1em 0 0.5em; }\n.tangle-h3 { font-size: 1.1rem; font-weight: 600; margin: 0.75em 0 0.4em; }\n.tangle-h4, .tangle-h5, .tangle-h6 { font-size: 1rem; font-weight: 600; margin: 0.5em 0 0.3em; }\n.tangle-inline-code {\n font-family: var(--font-mono);\n font-size: 0.85em;\n background: var(--bg-input);\n border: 1px solid var(--border-subtle);\n border-radius: 4px;\n padding: 0.15em 0.4em;\n}\n.tangle-code-block {\n position: relative;\n margin: 0.75em 0;\n background: var(--bg-input);\n border: 1px solid var(--border-subtle);\n border-radius: var(--radius-md);\n overflow: hidden;\n}\n.tangle-code-lang {\n position: absolute;\n top: 8px;\n right: 12px;\n font-family: var(--font-mono);\n font-size: 11px;\n color: var(--text-muted);\n text-transform: uppercase;\n letter-spacing: 0.05em;\n}\n.tangle-code-block pre {\n margin: 0;\n padding: 1rem;\n overflow-x: auto;\n font-family: var(--font-mono);\n font-size: 13px;\n line-height: 1.55;\n color: var(--text-secondary);\n}\n.tangle-link {\n color: var(--brand-cool);\n text-decoration: none;\n}\n.tangle-link:hover { text-decoration: underline; }\n.tangle-blockquote {\n border-left: 3px solid var(--border-accent);\n padding: 0.5em 1em;\n margin: 0.5em 0;\n color: var(--text-secondary);\n}\n.tangle-list {\n margin: 0.5em 0;\n padding-left: 1.5em;\n}\n.tangle-list li { margin: 0.2em 0; }\n.tangle-list-ordered { list-style-type: decimal; }\n.tangle-table-wrap { overflow-x: auto; margin: 0.75em 0; }\n.tangle-table {\n width: 100%;\n border-collapse: collapse;\n font-size: 0.875rem;\n}\n.tangle-table th {\n text-align: left;\n padding: 0.5em 0.75em;\n border-bottom: 2px solid var(--border-default);\n font-weight: 600;\n color: var(--text-secondary);\n white-space: nowrap;\n}\n.tangle-table td {\n padding: 0.4em 0.75em;\n border-bottom: 1px solid var(--border-subtle);\n color: var(--text-secondary);\n}\n.tangle-table tr:hover td { background: var(--bg-hover); }\n.tangle-hr {\n border: none;\n border-top: 1px solid var(--border-subtle);\n margin: 1em 0;\n}\nstrong { font-weight: 700; }\nem { font-style: italic; }\n";
|
|
27
|
+
|
|
28
|
+
interface MarkdownProps {
|
|
29
|
+
children: string;
|
|
30
|
+
className?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Renders Markdown content with GFM support, XSS sanitisation, and
|
|
34
|
+
* custom code block rendering via our CodeBlock component.
|
|
35
|
+
*/
|
|
36
|
+
declare const Markdown: React.MemoExoticComponent<({ children, className }: MarkdownProps) => react_jsx_runtime.JSX.Element>;
|
|
37
|
+
|
|
38
|
+
interface CodeBlockProps extends HTMLAttributes<HTMLDivElement> {
|
|
39
|
+
code: string;
|
|
40
|
+
language?: string;
|
|
41
|
+
children?: ReactNode;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Syntax-highlighted code block with copy button.
|
|
45
|
+
*
|
|
46
|
+
* Falls back to plain `<pre><code>` — syntax highlighting can be provided
|
|
47
|
+
* by the consuming app via CSS (e.g. Shiki themes applied externally).
|
|
48
|
+
*/
|
|
49
|
+
declare const CodeBlock: React.MemoExoticComponent<({ code, language, className, children, ...props }: CodeBlockProps) => react_jsx_runtime.JSX.Element>;
|
|
50
|
+
/** Copy-to-clipboard button for use inside CodeBlock. */
|
|
51
|
+
declare const CopyButton: React.MemoExoticComponent<({ text }: {
|
|
52
|
+
text: string;
|
|
53
|
+
}) => react_jsx_runtime.JSX.Element>;
|
|
54
|
+
|
|
55
|
+
export { CodeBlock, type CodeBlockProps, CopyButton, Markdown, type MarkdownProps, SimpleMarkdown, type SimpleMarkdownProps, simpleMarkdownStyles };
|
package/dist/markdown.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CodeBlock,
|
|
3
|
+
CopyButton,
|
|
4
|
+
Markdown
|
|
5
|
+
} from "./chunk-LTFK464G.js";
|
|
6
|
+
import {
|
|
7
|
+
SimpleMarkdown,
|
|
8
|
+
simpleMarkdownStyles
|
|
9
|
+
} from "./chunk-M34OA6PQ.js";
|
|
10
|
+
import "./chunk-RQHJBTEU.js";
|
|
11
|
+
export {
|
|
12
|
+
CodeBlock,
|
|
13
|
+
CopyButton,
|
|
14
|
+
Markdown,
|
|
15
|
+
SimpleMarkdown,
|
|
16
|
+
simpleMarkdownStyles
|
|
17
|
+
};
|
package/dist/pages.d.ts
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { B as BillingSubscription, a as BillingBalance, b as BillingUsage, U as UsageDataPoint, P as PricingTier } from './usage-chart-DINgSVL5.js';
|
|
3
|
+
|
|
4
|
+
type ProductVariant$1 = "sandbox";
|
|
5
|
+
interface BillingPageData {
|
|
6
|
+
subscription: BillingSubscription | null;
|
|
7
|
+
balance: BillingBalance;
|
|
8
|
+
usage: BillingUsage;
|
|
9
|
+
usageHistory: UsageDataPoint[];
|
|
10
|
+
tiers: PricingTier[];
|
|
11
|
+
}
|
|
12
|
+
interface BillingPageProps {
|
|
13
|
+
variant?: ProductVariant$1;
|
|
14
|
+
initialData?: BillingPageData;
|
|
15
|
+
apiBasePath?: string;
|
|
16
|
+
onManageSubscription?: () => void;
|
|
17
|
+
onAddCredits?: () => void;
|
|
18
|
+
onSelectTier?: (tierId: string) => void;
|
|
19
|
+
fetchBillingData?: () => Promise<BillingPageData>;
|
|
20
|
+
}
|
|
21
|
+
declare function BillingPage({ variant, initialData, apiBasePath, onManageSubscription, onAddCredits, onSelectTier, fetchBillingData, }: BillingPageProps): react_jsx_runtime.JSX.Element;
|
|
22
|
+
|
|
23
|
+
type ProductVariant = "sandbox";
|
|
24
|
+
interface StandalonePricingPageProps {
|
|
25
|
+
variant?: ProductVariant;
|
|
26
|
+
initialTiers?: PricingTier[];
|
|
27
|
+
apiBasePath?: string;
|
|
28
|
+
onSelectTier?: (tierId: string, billingPeriod: "monthly" | "yearly") => void;
|
|
29
|
+
fetchTiers?: () => Promise<PricingTier[]>;
|
|
30
|
+
title?: string;
|
|
31
|
+
subtitle?: string;
|
|
32
|
+
}
|
|
33
|
+
declare function StandalonePricingPage({ variant, initialTiers, apiBasePath, onSelectTier, fetchTiers, title, subtitle, }: StandalonePricingPageProps): react_jsx_runtime.JSX.Element;
|
|
34
|
+
|
|
35
|
+
interface ProfileMetrics {
|
|
36
|
+
total_runs: number;
|
|
37
|
+
success_rate: number;
|
|
38
|
+
avg_duration_ms: number;
|
|
39
|
+
avg_tokens_used?: number;
|
|
40
|
+
last_run_at?: string;
|
|
41
|
+
}
|
|
42
|
+
interface Profile {
|
|
43
|
+
id: string;
|
|
44
|
+
name: string;
|
|
45
|
+
description?: string;
|
|
46
|
+
extends?: string;
|
|
47
|
+
model?: string;
|
|
48
|
+
system_prompt?: string;
|
|
49
|
+
instructions?: string[];
|
|
50
|
+
tags?: string[];
|
|
51
|
+
is_builtin?: boolean;
|
|
52
|
+
is_public?: boolean;
|
|
53
|
+
metrics?: ProfileMetrics;
|
|
54
|
+
created_at?: string;
|
|
55
|
+
updated_at?: string;
|
|
56
|
+
}
|
|
57
|
+
interface ProfileFormData {
|
|
58
|
+
name: string;
|
|
59
|
+
description?: string;
|
|
60
|
+
extends?: string;
|
|
61
|
+
model?: string;
|
|
62
|
+
system_prompt?: string;
|
|
63
|
+
instructions?: string[];
|
|
64
|
+
tags?: string[];
|
|
65
|
+
is_public?: boolean;
|
|
66
|
+
}
|
|
67
|
+
interface ProfilesPageProps {
|
|
68
|
+
/** API client for profile operations */
|
|
69
|
+
apiClient: {
|
|
70
|
+
listProfiles: () => Promise<{
|
|
71
|
+
builtin: Profile[];
|
|
72
|
+
custom: Profile[];
|
|
73
|
+
}>;
|
|
74
|
+
createProfile: (data: ProfileFormData) => Promise<Profile>;
|
|
75
|
+
updateProfile: (id: string, data: Partial<ProfileFormData>) => Promise<Profile>;
|
|
76
|
+
deleteProfile: (id: string) => Promise<void>;
|
|
77
|
+
};
|
|
78
|
+
/** User's subscription tier for limit enforcement */
|
|
79
|
+
tier?: "free" | "starter" | "pro" | "enterprise";
|
|
80
|
+
/** Maximum profiles allowed for current tier */
|
|
81
|
+
maxProfiles?: number;
|
|
82
|
+
/** Callback when navigating to profile comparison */
|
|
83
|
+
onCompareClick?: (profiles: Profile[]) => void;
|
|
84
|
+
/** Custom page title */
|
|
85
|
+
title?: string;
|
|
86
|
+
}
|
|
87
|
+
declare function ProfilesPage({ apiClient, tier, maxProfiles, onCompareClick, title, }: ProfilesPageProps): react_jsx_runtime.JSX.Element;
|
|
88
|
+
|
|
89
|
+
export { BillingPage, type BillingPageData, type BillingPageProps, type ProductVariant$1 as ProductVariant, type Profile, type ProfileFormData, type ProfileMetrics, ProfilesPage, type ProfilesPageProps, StandalonePricingPage, type StandalonePricingPageProps };
|