@tangle-network/sandbox-ui 0.13.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.
- package/dist/auth.d.ts +1 -74
- package/dist/auth.js +1 -4
- package/dist/chat.d.ts +1 -136
- package/dist/chat.js +2 -15
- package/dist/chunk-2BUPSB7O.js +0 -0
- package/dist/chunk-3J6FG3FJ.js +18 -0
- package/dist/chunk-76IQLPW2.js +206 -0
- package/dist/chunk-7ZA5SEK3.js +239 -0
- package/dist/{chunk-ESVYBDGA.js → chunk-AG7QDC2Q.js} +182 -2
- package/dist/chunk-AHBZCBDO.js +2960 -0
- package/dist/chunk-AZ3AWMTM.js +8 -0
- package/dist/chunk-CMY7W45U.js +380 -0
- package/dist/{chunk-QMU2PWOU.js → chunk-DNZ4DTNA.js} +71 -17
- package/dist/chunk-EI44GEQ5.js +6 -0
- package/dist/{chunk-5OQ27N57.js → chunk-GPT7VKK6.js} +34 -38
- package/dist/chunk-JBGKGLD7.js +16 -0
- package/dist/chunk-NJNME4J4.js +14 -0
- package/dist/chunk-QPAJR74X.js +20 -0
- package/dist/chunk-TK46XFLM.js +28 -0
- package/dist/chunk-WID73FPH.js +89 -0
- package/dist/chunk-YVXK4XRO.js +30 -0
- package/dist/dashboard.d.ts +538 -4
- package/dist/dashboard.js +15 -886
- package/dist/editor.d.ts +1 -120
- package/dist/editor.js +1 -5
- package/dist/files.d.ts +1 -129
- package/dist/files.js +2 -7
- package/dist/globals.css +5 -1265
- package/dist/hooks.d.ts +114 -11
- package/dist/hooks.js +17 -88
- package/dist/index.d.ts +24 -99
- package/dist/index.js +247 -252
- package/dist/markdown.d.ts +1 -29
- package/dist/markdown.js +2 -2
- package/dist/openui.d.ts +8 -115
- package/dist/openui.js +1 -6
- package/dist/pages.d.ts +1 -2
- package/dist/pages.js +68 -66
- package/dist/primitives.d.ts +14 -49
- package/dist/primitives.js +69 -77
- package/dist/run.d.ts +1 -14
- package/dist/run.js +2 -22
- package/dist/sdk-hooks.d.ts +3 -283
- package/dist/sdk-hooks.js +10 -14
- package/dist/stores.d.ts +2 -14
- package/dist/stores.js +11 -39
- package/dist/styles.css +5 -1265
- package/dist/{usage-chart-CPTcNlGs.d.ts → template-card-UhV3pmRC.d.ts} +16 -1
- package/dist/terminal.js +39 -2
- package/dist/types.d.ts +11 -8
- package/dist/types.js +1 -0
- package/dist/utils.d.ts +1 -44
- package/dist/utils.js +6 -12
- package/dist/workspace.d.ts +5 -10
- package/dist/workspace.js +3 -19
- package/package.json +23 -54
- package/dist/active-sessions-store-CeOmXgv5.d.ts +0 -85
- package/dist/artifact-pane-Bh45Ssco.d.ts +0 -24
- package/dist/branding-DCi5VEik.d.ts +0 -13
- package/dist/button-CMQuQEW_.d.ts +0 -17
- package/dist/chat-container-f4yEs6KN.d.ts +0 -106
- package/dist/chunk-34A66VBG.js +0 -214
- package/dist/chunk-34I7UFSX.js +0 -92
- package/dist/chunk-36QY2W5G.js +0 -802
- package/dist/chunk-4CLN43XT.js +0 -45
- package/dist/chunk-54SQQMMM.js +0 -156
- package/dist/chunk-66EZOYZR.js +0 -102
- package/dist/chunk-BX6AQMUS.js +0 -183
- package/dist/chunk-DI3NZ5ZX.js +0 -192
- package/dist/chunk-DPGIXDAI.js +0 -220
- package/dist/chunk-DXMIEK4K.js +0 -1426
- package/dist/chunk-GSZA3TSY.js +0 -79
- package/dist/chunk-HB5Y37YU.js +0 -54
- package/dist/chunk-LQNEZDRM.js +0 -109
- package/dist/chunk-MA7YKRUP.js +0 -131
- package/dist/chunk-MKTSMWVD.js +0 -109
- package/dist/chunk-MQXABZTB.js +0 -1348
- package/dist/chunk-MT5FJ3ZT.js +0 -186
- package/dist/chunk-NKUPJC34.js +0 -2070
- package/dist/chunk-OEX7NZE3.js +0 -321
- package/dist/chunk-OKLQVY3Y.js +0 -139
- package/dist/chunk-Q56BYXQF.js +0 -61
- package/dist/chunk-QD4QE5P5.js +0 -40
- package/dist/chunk-QDH5GEGY.js +0 -630
- package/dist/chunk-QID2OOMG.js +0 -133
- package/dist/chunk-RQHJBTEU.js +0 -10
- package/dist/chunk-T7HMZEVO.js +0 -216
- package/dist/chunk-U6QTHMY6.js +0 -1290
- package/dist/chunk-US6JKJKH.js +0 -124
- package/dist/chunk-VX3XOUEB.js +0 -63
- package/dist/chunk-XLG757B6.js +0 -933
- package/dist/chunk-ZMNSRDMH.js +0 -127
- package/dist/chunk-ZNCEM5CD.js +0 -316
- package/dist/document-editor-pane-A70-EhdQ.d.ts +0 -124
- package/dist/document-editor-pane-TLPVRBBU.js +0 -11
- package/dist/expanded-tool-detail-Dh99mcbY.d.ts +0 -63
- package/dist/file-tabs-BLfxfmAH.d.ts +0 -51
- package/dist/parts-CyGkM6Fp.d.ts +0 -50
- package/dist/run-CtFZ6s-D.d.ts +0 -41
- package/dist/sidebar-drop-zone-tDBsuOH5.d.ts +0 -301
- package/dist/sidecar-CFU2W9j1.d.ts +0 -8
- package/dist/template-card-BAtvcAkU.d.ts +0 -18
- package/dist/tool-call-feed-Bs3MyQMT.d.ts +0 -68
- package/dist/tool-display-Ct9nFAzJ.d.ts +0 -32
- package/dist/use-sandbox-metrics-B64diPqN.d.ts +0 -141
- package/dist/variant-list-BrHYcBCk.d.ts +0 -540
package/dist/chunk-ZMNSRDMH.js
DELETED
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
cn
|
|
3
|
-
} from "./chunk-RQHJBTEU.js";
|
|
4
|
-
|
|
5
|
-
// src/primitives/card.tsx
|
|
6
|
-
import * as React from "react";
|
|
7
|
-
import { jsx } from "react/jsx-runtime";
|
|
8
|
-
var Card = React.forwardRef(({ className, variant = "default", hover = false, ...props }, ref) => {
|
|
9
|
-
const variants = {
|
|
10
|
-
default: "bg-card border-border",
|
|
11
|
-
elevated: "bg-muted/50 border-border shadow-[var(--shadow-card)]",
|
|
12
|
-
glass: "bg-card/80 backdrop-blur-xl border-border shadow-[var(--shadow-card)]",
|
|
13
|
-
sandbox: "bg-muted/50 border-primary/20 shadow-[var(--shadow-accent)]"
|
|
14
|
-
};
|
|
15
|
-
return /* @__PURE__ */ jsx(
|
|
16
|
-
"div",
|
|
17
|
-
{
|
|
18
|
-
ref,
|
|
19
|
-
className: cn(
|
|
20
|
-
"rounded-[var(--radius-lg)] border text-card-foreground transition-[border-color,box-shadow]",
|
|
21
|
-
"duration-[var(--transition-default)]",
|
|
22
|
-
variants[variant],
|
|
23
|
-
hover && "cursor-pointer hover:border-primary/30",
|
|
24
|
-
className
|
|
25
|
-
),
|
|
26
|
-
...props
|
|
27
|
-
}
|
|
28
|
-
);
|
|
29
|
-
});
|
|
30
|
-
Card.displayName = "Card";
|
|
31
|
-
var CardHeader = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
32
|
-
"div",
|
|
33
|
-
{
|
|
34
|
-
ref,
|
|
35
|
-
className: cn("flex flex-col space-y-1 p-4", className),
|
|
36
|
-
...props
|
|
37
|
-
}
|
|
38
|
-
));
|
|
39
|
-
CardHeader.displayName = "CardHeader";
|
|
40
|
-
var CardTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
41
|
-
"h3",
|
|
42
|
-
{
|
|
43
|
-
ref,
|
|
44
|
-
className: cn("font-semibold leading-none tracking-tight", className),
|
|
45
|
-
...props
|
|
46
|
-
}
|
|
47
|
-
));
|
|
48
|
-
CardTitle.displayName = "CardTitle";
|
|
49
|
-
var CardDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
50
|
-
"p",
|
|
51
|
-
{
|
|
52
|
-
ref,
|
|
53
|
-
className: cn("text-muted-foreground text-sm", className),
|
|
54
|
-
...props
|
|
55
|
-
}
|
|
56
|
-
));
|
|
57
|
-
CardDescription.displayName = "CardDescription";
|
|
58
|
-
var CardContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("p-4 pt-0", className), ...props }));
|
|
59
|
-
CardContent.displayName = "CardContent";
|
|
60
|
-
var CardFooter = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
61
|
-
"div",
|
|
62
|
-
{
|
|
63
|
-
ref,
|
|
64
|
-
className: cn("flex items-center p-6 pt-0", className),
|
|
65
|
-
...props
|
|
66
|
-
}
|
|
67
|
-
));
|
|
68
|
-
CardFooter.displayName = "CardFooter";
|
|
69
|
-
|
|
70
|
-
// src/primitives/badge.tsx
|
|
71
|
-
import { cva } from "class-variance-authority";
|
|
72
|
-
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
73
|
-
var badgeVariants = cva(
|
|
74
|
-
"inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 font-medium text-xs transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
75
|
-
{
|
|
76
|
-
variants: {
|
|
77
|
-
variant: {
|
|
78
|
-
default: "border-transparent bg-primary text-primary-foreground",
|
|
79
|
-
secondary: "border-transparent bg-secondary text-secondary-foreground",
|
|
80
|
-
destructive: "border-transparent bg-destructive/15 border-destructive/25 text-destructive",
|
|
81
|
-
outline: "text-foreground border-border",
|
|
82
|
-
success: "border-[var(--surface-success-border)] bg-[var(--surface-success-bg)] text-[var(--surface-success-text)]",
|
|
83
|
-
warning: "border-[var(--surface-warning-border)] bg-[var(--surface-warning-bg)] text-[var(--surface-warning-text)]",
|
|
84
|
-
error: "border-[var(--surface-danger-border)] bg-[var(--surface-danger-bg)] text-[var(--surface-danger-text)]",
|
|
85
|
-
info: "border-[var(--surface-info-border)] bg-[var(--surface-info-bg)] text-[var(--surface-info-text)]",
|
|
86
|
-
sandbox: "border-border bg-[var(--accent-surface-soft)] text-[var(--accent-text)]",
|
|
87
|
-
/* Operational status variants */
|
|
88
|
-
running: "border-[var(--surface-teal-border)] bg-[var(--surface-teal-bg)] text-[var(--surface-teal-text)]",
|
|
89
|
-
creating: "border-[var(--surface-violet-border)] bg-[var(--surface-violet-bg)] text-[var(--surface-violet-text)]",
|
|
90
|
-
stopped: "border-[var(--surface-warning-border)] bg-[var(--surface-warning-bg)] text-[var(--surface-warning-text)]",
|
|
91
|
-
warm: "border-[var(--surface-orange-border)] bg-[var(--surface-orange-bg)] text-[var(--surface-orange-text)]",
|
|
92
|
-
cold: "border-[var(--surface-info-border)] bg-[var(--surface-info-bg)] text-[var(--surface-info-text)]",
|
|
93
|
-
deleted: "border-[var(--surface-neutral-border)] bg-[var(--surface-neutral-bg)] text-[var(--surface-neutral-text)]"
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
defaultVariants: {
|
|
97
|
-
variant: "default"
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
);
|
|
101
|
-
var statusDotClass = {
|
|
102
|
-
running: "status-dot status-dot-running",
|
|
103
|
-
creating: "status-dot status-dot-creating",
|
|
104
|
-
stopped: "status-dot status-dot-stopped",
|
|
105
|
-
warm: "status-dot status-dot-warm",
|
|
106
|
-
cold: "status-dot status-dot-cold",
|
|
107
|
-
error: "status-dot status-dot-error",
|
|
108
|
-
deleted: "status-dot status-dot-deleted"
|
|
109
|
-
};
|
|
110
|
-
function Badge({ className, variant, dot, children, ...props }) {
|
|
111
|
-
const dotClass = dot && variant ? statusDotClass[variant] : null;
|
|
112
|
-
return /* @__PURE__ */ jsxs("div", { className: cn(badgeVariants({ variant }), className), ...props, children: [
|
|
113
|
-
dotClass && /* @__PURE__ */ jsx2("span", { className: dotClass, "aria-hidden": true }),
|
|
114
|
-
children
|
|
115
|
-
] });
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
export {
|
|
119
|
-
Card,
|
|
120
|
-
CardHeader,
|
|
121
|
-
CardTitle,
|
|
122
|
-
CardDescription,
|
|
123
|
-
CardContent,
|
|
124
|
-
CardFooter,
|
|
125
|
-
badgeVariants,
|
|
126
|
-
Badge
|
|
127
|
-
};
|
package/dist/chunk-ZNCEM5CD.js
DELETED
|
@@ -1,316 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Table,
|
|
3
|
-
TableBody,
|
|
4
|
-
TableCell,
|
|
5
|
-
TableHead,
|
|
6
|
-
TableHeader,
|
|
7
|
-
TableRow
|
|
8
|
-
} from "./chunk-34I7UFSX.js";
|
|
9
|
-
import {
|
|
10
|
-
CodeBlock,
|
|
11
|
-
Markdown
|
|
12
|
-
} from "./chunk-T7HMZEVO.js";
|
|
13
|
-
import {
|
|
14
|
-
Badge,
|
|
15
|
-
Card,
|
|
16
|
-
CardContent,
|
|
17
|
-
CardDescription,
|
|
18
|
-
CardHeader,
|
|
19
|
-
CardTitle
|
|
20
|
-
} from "./chunk-ZMNSRDMH.js";
|
|
21
|
-
import {
|
|
22
|
-
Button
|
|
23
|
-
} from "./chunk-MKTSMWVD.js";
|
|
24
|
-
import {
|
|
25
|
-
cn
|
|
26
|
-
} from "./chunk-RQHJBTEU.js";
|
|
27
|
-
|
|
28
|
-
// src/primitives/code-block.tsx
|
|
29
|
-
import { jsx } from "react/jsx-runtime";
|
|
30
|
-
function InlineCode({ className, children, ...props }) {
|
|
31
|
-
return /* @__PURE__ */ jsx(
|
|
32
|
-
"code",
|
|
33
|
-
{
|
|
34
|
-
className: cn(
|
|
35
|
-
"rounded border border-border bg-card px-1.5 py-0.5 font-mono text-[0.85em] text-[var(--code-keyword)]",
|
|
36
|
-
className
|
|
37
|
-
),
|
|
38
|
-
...props,
|
|
39
|
-
children
|
|
40
|
-
}
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// src/openui/openui-artifact-renderer.tsx
|
|
45
|
-
import { Fragment } from "react";
|
|
46
|
-
import { Minus } from "lucide-react";
|
|
47
|
-
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
48
|
-
var NODE_TYPES = /* @__PURE__ */ new Set([
|
|
49
|
-
"heading",
|
|
50
|
-
"text",
|
|
51
|
-
"badge",
|
|
52
|
-
"stat",
|
|
53
|
-
"key_value",
|
|
54
|
-
"code",
|
|
55
|
-
"markdown",
|
|
56
|
-
"table",
|
|
57
|
-
"actions",
|
|
58
|
-
"separator",
|
|
59
|
-
"stack",
|
|
60
|
-
"grid",
|
|
61
|
-
"card"
|
|
62
|
-
]);
|
|
63
|
-
var GAP_STYLES = {
|
|
64
|
-
sm: "gap-2",
|
|
65
|
-
md: "gap-4",
|
|
66
|
-
lg: "gap-6"
|
|
67
|
-
};
|
|
68
|
-
var GRID_STYLES = {
|
|
69
|
-
1: "grid-cols-1",
|
|
70
|
-
2: "grid-cols-1 md:grid-cols-2",
|
|
71
|
-
3: "grid-cols-1 md:grid-cols-3",
|
|
72
|
-
4: "grid-cols-1 md:grid-cols-2 xl:grid-cols-4"
|
|
73
|
-
};
|
|
74
|
-
var ALIGN_STYLES = {
|
|
75
|
-
start: "items-start",
|
|
76
|
-
center: "items-center",
|
|
77
|
-
end: "items-end",
|
|
78
|
-
stretch: "items-stretch"
|
|
79
|
-
};
|
|
80
|
-
function formatValue(value) {
|
|
81
|
-
if (value === null || value === void 0) {
|
|
82
|
-
return /* @__PURE__ */ jsx2("span", { className: "text-muted-foreground", children: "\u2014" });
|
|
83
|
-
}
|
|
84
|
-
if (typeof value === "boolean") {
|
|
85
|
-
return value ? "Yes" : "No";
|
|
86
|
-
}
|
|
87
|
-
return value;
|
|
88
|
-
}
|
|
89
|
-
function asArray(value) {
|
|
90
|
-
return Array.isArray(value) ? value : [];
|
|
91
|
-
}
|
|
92
|
-
function isOpenUIComponentNode(value) {
|
|
93
|
-
return typeof value === "object" && value !== null && "type" in value && typeof value.type === "string" && NODE_TYPES.has(value.type);
|
|
94
|
-
}
|
|
95
|
-
function renderActions(actions, onAction) {
|
|
96
|
-
if (actions.length === 0) return null;
|
|
97
|
-
return /* @__PURE__ */ jsx2("div", { className: "flex flex-wrap items-center gap-2", children: actions.map((action) => /* @__PURE__ */ jsx2(
|
|
98
|
-
Button,
|
|
99
|
-
{
|
|
100
|
-
type: "button",
|
|
101
|
-
size: "sm",
|
|
102
|
-
variant: action.tone ?? "outline",
|
|
103
|
-
disabled: action.disabled,
|
|
104
|
-
onClick: () => {
|
|
105
|
-
action.onPress?.();
|
|
106
|
-
onAction?.(action);
|
|
107
|
-
},
|
|
108
|
-
children: action.label
|
|
109
|
-
},
|
|
110
|
-
action.id
|
|
111
|
-
)) });
|
|
112
|
-
}
|
|
113
|
-
function renderNode(node, onAction) {
|
|
114
|
-
switch (node.type) {
|
|
115
|
-
case "heading": {
|
|
116
|
-
const level = node.level ?? 2;
|
|
117
|
-
const HeadingTag = `h${level}`;
|
|
118
|
-
return /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
119
|
-
node.kicker && /* @__PURE__ */ jsx2("div", { className: "text-[10px] font-semibold uppercase tracking-[0.16em] text-muted-foreground", children: node.kicker }),
|
|
120
|
-
/* @__PURE__ */ jsx2(
|
|
121
|
-
HeadingTag,
|
|
122
|
-
{
|
|
123
|
-
className: cn(
|
|
124
|
-
"font-semibold tracking-tight text-foreground",
|
|
125
|
-
level === 1 && "text-2xl",
|
|
126
|
-
level === 2 && "text-xl",
|
|
127
|
-
level === 3 && "text-lg",
|
|
128
|
-
level === 4 && "text-base"
|
|
129
|
-
),
|
|
130
|
-
children: node.text
|
|
131
|
-
}
|
|
132
|
-
),
|
|
133
|
-
node.meta && /* @__PURE__ */ jsx2("p", { className: "text-sm text-muted-foreground", children: node.meta })
|
|
134
|
-
] });
|
|
135
|
-
}
|
|
136
|
-
case "text":
|
|
137
|
-
return /* @__PURE__ */ jsx2(
|
|
138
|
-
"p",
|
|
139
|
-
{
|
|
140
|
-
className: cn(
|
|
141
|
-
"text-sm leading-6 text-foreground",
|
|
142
|
-
node.tone === "muted" && "text-muted-foreground",
|
|
143
|
-
node.tone === "success" && "text-[var(--surface-success-text)]",
|
|
144
|
-
node.tone === "warning" && "text-[var(--surface-warning-text)]",
|
|
145
|
-
node.tone === "error" && "text-[var(--surface-danger-text)]",
|
|
146
|
-
node.mono && "font-mono text-[13px]"
|
|
147
|
-
),
|
|
148
|
-
children: node.text
|
|
149
|
-
}
|
|
150
|
-
);
|
|
151
|
-
case "badge":
|
|
152
|
-
return /* @__PURE__ */ jsx2(Badge, { variant: node.tone ?? "outline", children: node.label });
|
|
153
|
-
case "stat":
|
|
154
|
-
return /* @__PURE__ */ jsx2(Card, { variant: "glass", className: "border-border shadow-[var(--shadow-card)]", children: /* @__PURE__ */ jsxs(CardContent, { className: "space-y-2 p-4", children: [
|
|
155
|
-
/* @__PURE__ */ jsx2("div", { className: "text-xs uppercase tracking-[0.12em] text-muted-foreground", children: node.label }),
|
|
156
|
-
/* @__PURE__ */ jsx2("div", { className: "text-2xl font-semibold tracking-tight text-foreground", children: node.value }),
|
|
157
|
-
node.change && /* @__PURE__ */ jsx2(
|
|
158
|
-
"div",
|
|
159
|
-
{
|
|
160
|
-
className: cn(
|
|
161
|
-
"text-xs",
|
|
162
|
-
node.tone === "success" && "text-[var(--surface-success-text)]",
|
|
163
|
-
node.tone === "warning" && "text-[var(--surface-warning-text)]",
|
|
164
|
-
node.tone === "error" && "text-[var(--surface-danger-text)]",
|
|
165
|
-
node.tone === "info" && "text-[var(--surface-info-text)]",
|
|
166
|
-
!node.tone || node.tone === "default" ? "text-muted-foreground" : void 0
|
|
167
|
-
),
|
|
168
|
-
children: node.change
|
|
169
|
-
}
|
|
170
|
-
)
|
|
171
|
-
] }) });
|
|
172
|
-
case "key_value":
|
|
173
|
-
if (asArray(node.items).length === 0) {
|
|
174
|
-
return null;
|
|
175
|
-
}
|
|
176
|
-
return /* @__PURE__ */ jsx2("dl", { className: "grid gap-3 sm:grid-cols-2", children: asArray(node.items).map((item, index) => /* @__PURE__ */ jsxs(
|
|
177
|
-
"div",
|
|
178
|
-
{
|
|
179
|
-
className: "rounded-[var(--radius-lg)] border border-border bg-card px-4 py-3",
|
|
180
|
-
children: [
|
|
181
|
-
/* @__PURE__ */ jsx2("dt", { className: "text-[11px] uppercase tracking-[0.12em] text-muted-foreground", children: item.label }),
|
|
182
|
-
/* @__PURE__ */ jsx2(
|
|
183
|
-
"dd",
|
|
184
|
-
{
|
|
185
|
-
className: cn(
|
|
186
|
-
"mt-1 text-sm font-medium text-foreground",
|
|
187
|
-
item.tone === "muted" && "text-foreground"
|
|
188
|
-
),
|
|
189
|
-
children: formatValue(item.value)
|
|
190
|
-
}
|
|
191
|
-
)
|
|
192
|
-
]
|
|
193
|
-
},
|
|
194
|
-
item.id ?? `${item.label}-${index}`
|
|
195
|
-
)) });
|
|
196
|
-
case "code":
|
|
197
|
-
return /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
198
|
-
node.title && /* @__PURE__ */ jsx2("div", { className: "text-xs uppercase tracking-[0.12em] text-muted-foreground", children: node.title }),
|
|
199
|
-
/* @__PURE__ */ jsx2(
|
|
200
|
-
CodeBlock,
|
|
201
|
-
{
|
|
202
|
-
code: node.code,
|
|
203
|
-
language: node.language,
|
|
204
|
-
showLineNumbers: node.showLineNumbers,
|
|
205
|
-
className: "border-border bg-background"
|
|
206
|
-
}
|
|
207
|
-
)
|
|
208
|
-
] });
|
|
209
|
-
case "markdown":
|
|
210
|
-
return /* @__PURE__ */ jsx2("div", { className: "rounded-[var(--radius-lg)] border border-border bg-card p-5", children: /* @__PURE__ */ jsx2(Markdown, { className: "prose-sm max-w-none", children: node.content }) });
|
|
211
|
-
case "table":
|
|
212
|
-
if (asArray(node.columns).length === 0) {
|
|
213
|
-
return null;
|
|
214
|
-
}
|
|
215
|
-
return /* @__PURE__ */ jsxs("div", { className: "overflow-hidden rounded-[var(--radius-lg)] border border-border bg-card", children: [
|
|
216
|
-
/* @__PURE__ */ jsxs(Table, { children: [
|
|
217
|
-
/* @__PURE__ */ jsx2(TableHeader, { children: /* @__PURE__ */ jsx2(TableRow, { className: "border-border", children: asArray(node.columns).map((column) => /* @__PURE__ */ jsx2(
|
|
218
|
-
TableHead,
|
|
219
|
-
{
|
|
220
|
-
className: cn(
|
|
221
|
-
"h-10 text-[11px] uppercase tracking-[0.1em] text-muted-foreground",
|
|
222
|
-
column.align === "right" && "text-right"
|
|
223
|
-
),
|
|
224
|
-
children: column.header
|
|
225
|
-
},
|
|
226
|
-
column.key
|
|
227
|
-
)) }) }),
|
|
228
|
-
/* @__PURE__ */ jsx2(TableBody, { children: asArray(node.rows).map((row, rowIndex) => /* @__PURE__ */ jsx2(TableRow, { className: "border-border", children: asArray(node.columns).map((column) => /* @__PURE__ */ jsx2(
|
|
229
|
-
TableCell,
|
|
230
|
-
{
|
|
231
|
-
className: cn(
|
|
232
|
-
"py-3 text-sm text-foreground",
|
|
233
|
-
column.align === "right" && "text-right tabular-nums"
|
|
234
|
-
),
|
|
235
|
-
children: formatValue(row[column.key])
|
|
236
|
-
},
|
|
237
|
-
column.key
|
|
238
|
-
)) }, rowIndex)) })
|
|
239
|
-
] }),
|
|
240
|
-
node.caption && /* @__PURE__ */ jsx2("div", { className: "border-t border-border px-4 py-2 text-xs text-muted-foreground", children: node.caption })
|
|
241
|
-
] });
|
|
242
|
-
case "actions":
|
|
243
|
-
return renderActions(asArray(node.actions), onAction);
|
|
244
|
-
case "separator":
|
|
245
|
-
return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
246
|
-
/* @__PURE__ */ jsx2("div", { className: "h-px flex-1 bg-border" }),
|
|
247
|
-
node.label && /* @__PURE__ */ jsx2("span", { className: "text-[10px] uppercase tracking-[0.14em] text-muted-foreground", children: node.label }),
|
|
248
|
-
/* @__PURE__ */ jsx2("div", { className: "h-px flex-1 bg-border" })
|
|
249
|
-
] });
|
|
250
|
-
case "stack":
|
|
251
|
-
if (asArray(node.children).length === 0) {
|
|
252
|
-
return null;
|
|
253
|
-
}
|
|
254
|
-
return /* @__PURE__ */ jsx2(
|
|
255
|
-
"div",
|
|
256
|
-
{
|
|
257
|
-
className: cn(
|
|
258
|
-
"flex",
|
|
259
|
-
node.direction === "row" ? "flex-row" : "flex-col",
|
|
260
|
-
GAP_STYLES[node.gap ?? "md"],
|
|
261
|
-
ALIGN_STYLES[node.align ?? "stretch"],
|
|
262
|
-
node.wrap && "flex-wrap"
|
|
263
|
-
),
|
|
264
|
-
children: asArray(node.children).map((child, index) => /* @__PURE__ */ jsx2(Fragment, { children: renderNode(child, onAction) }, child.id ?? `${child.type}-${index}`))
|
|
265
|
-
}
|
|
266
|
-
);
|
|
267
|
-
case "grid":
|
|
268
|
-
if (asArray(node.children).length === 0) {
|
|
269
|
-
return null;
|
|
270
|
-
}
|
|
271
|
-
return /* @__PURE__ */ jsx2("div", { className: cn("grid", GRID_STYLES[node.columns ?? 2], GAP_STYLES[node.gap ?? "md"]), children: asArray(node.children).map((child, index) => /* @__PURE__ */ jsx2(Fragment, { children: renderNode(child, onAction) }, child.id ?? `${child.type}-${index}`)) });
|
|
272
|
-
case "card":
|
|
273
|
-
return /* @__PURE__ */ jsxs(Card, { variant: "glass", className: "border-border shadow-[var(--shadow-card)]", children: [
|
|
274
|
-
(node.eyebrow || node.title || node.description || node.badge || asArray(node.actions).length > 0) && /* @__PURE__ */ jsxs(CardHeader, { className: "gap-2 p-4 pb-0", children: [
|
|
275
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-3", children: [
|
|
276
|
-
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1 space-y-1", children: [
|
|
277
|
-
node.eyebrow && /* @__PURE__ */ jsx2("div", { className: "text-[10px] font-semibold uppercase tracking-[0.16em] text-muted-foreground", children: node.eyebrow }),
|
|
278
|
-
node.title && /* @__PURE__ */ jsx2(CardTitle, { className: "text-base text-foreground", children: node.title }),
|
|
279
|
-
node.description && /* @__PURE__ */ jsx2(CardDescription, { className: "text-muted-foreground", children: node.description })
|
|
280
|
-
] }),
|
|
281
|
-
node.badge && /* @__PURE__ */ jsx2(Badge, { variant: node.badge.tone ?? "outline", children: node.badge.label })
|
|
282
|
-
] }),
|
|
283
|
-
asArray(node.actions).length > 0 && renderActions(asArray(node.actions), onAction)
|
|
284
|
-
] }),
|
|
285
|
-
asArray(node.children).length > 0 && /* @__PURE__ */ jsx2(CardContent, { className: "space-y-4 p-4", children: asArray(node.children).map((child, index) => /* @__PURE__ */ jsx2(Fragment, { children: renderNode(child, onAction) }, child.id ?? `${child.type}-${index}`)) })
|
|
286
|
-
] });
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
function OpenUIArtifactRenderer({
|
|
290
|
-
schema,
|
|
291
|
-
onAction,
|
|
292
|
-
className
|
|
293
|
-
}) {
|
|
294
|
-
const nodes = (Array.isArray(schema) ? schema : [schema]).filter(isOpenUIComponentNode);
|
|
295
|
-
if (nodes.length === 0) {
|
|
296
|
-
return /* @__PURE__ */ jsx2(
|
|
297
|
-
"div",
|
|
298
|
-
{
|
|
299
|
-
className: cn(
|
|
300
|
-
"flex min-h-[6rem] items-center justify-center rounded-[var(--radius-xl)] border border-dashed border-border bg-card p-5 text-center",
|
|
301
|
-
className
|
|
302
|
-
),
|
|
303
|
-
children: /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
304
|
-
/* @__PURE__ */ jsx2("div", { className: "mx-auto flex h-10 w-10 items-center justify-center rounded-full bg-muted/50 text-muted-foreground", children: /* @__PURE__ */ jsx2(Minus, { className: "h-4 w-4" }) }),
|
|
305
|
-
/* @__PURE__ */ jsx2("div", { className: "text-sm font-medium text-foreground", children: "No view was generated." })
|
|
306
|
-
] })
|
|
307
|
-
}
|
|
308
|
-
);
|
|
309
|
-
}
|
|
310
|
-
return /* @__PURE__ */ jsx2("div", { className: cn("space-y-4", className), children: nodes.map((node, index) => /* @__PURE__ */ jsx2(Fragment, { children: renderNode(node, onAction) }, node.id ?? `${node.type}-${index}`)) });
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
export {
|
|
314
|
-
InlineCode,
|
|
315
|
-
OpenUIArtifactRenderer
|
|
316
|
-
};
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
import { A as ArtifactPaneProps } from './artifact-pane-Bh45Ssco.js';
|
|
4
|
-
import { HocuspocusProvider } from '@hocuspocus/provider';
|
|
5
|
-
import * as Y from 'yjs';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Connection state for the Hocuspocus provider.
|
|
9
|
-
*/
|
|
10
|
-
type ConnectionState = "disconnected" | "connecting" | "connected" | "synced";
|
|
11
|
-
/**
|
|
12
|
-
* Collaborator information from awareness.
|
|
13
|
-
*/
|
|
14
|
-
interface Collaborator {
|
|
15
|
-
clientId: number;
|
|
16
|
-
user: {
|
|
17
|
-
name: string;
|
|
18
|
-
color: string;
|
|
19
|
-
userId?: string;
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Editor context value exposed to children.
|
|
24
|
-
*/
|
|
25
|
-
interface EditorContextValue {
|
|
26
|
-
/** The Y.Doc instance for collaboration */
|
|
27
|
-
doc: Y.Doc;
|
|
28
|
-
/** The Hocuspocus provider instance */
|
|
29
|
-
provider: HocuspocusProvider | null;
|
|
30
|
-
/** Current connection state */
|
|
31
|
-
connectionState: ConnectionState;
|
|
32
|
-
/** List of active collaborators */
|
|
33
|
-
collaborators: Collaborator[];
|
|
34
|
-
/** Whether the document is synced with the server */
|
|
35
|
-
isSynced: boolean;
|
|
36
|
-
/** Connect to the collaboration server */
|
|
37
|
-
connect: () => void;
|
|
38
|
-
/** Disconnect from the collaboration server */
|
|
39
|
-
disconnect: () => void;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* User information for presence/awareness.
|
|
43
|
-
*/
|
|
44
|
-
interface EditorUser {
|
|
45
|
-
name: string;
|
|
46
|
-
color?: string;
|
|
47
|
-
userId?: string;
|
|
48
|
-
}
|
|
49
|
-
interface EditorTokenRefreshResult {
|
|
50
|
-
token: string;
|
|
51
|
-
expiresAt?: number;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Props for EditorProvider.
|
|
55
|
-
*/
|
|
56
|
-
interface EditorProviderProps {
|
|
57
|
-
/** WebSocket URL for the Hocuspocus server */
|
|
58
|
-
websocketUrl: string;
|
|
59
|
-
/** Document name (e.g., "doc:my-document") */
|
|
60
|
-
documentName: string;
|
|
61
|
-
/** JWT token for authentication */
|
|
62
|
-
token: string;
|
|
63
|
-
/** Unix timestamp (seconds) when the current token expires */
|
|
64
|
-
tokenExpiresAt?: number;
|
|
65
|
-
/** Current user information for awareness */
|
|
66
|
-
user: EditorUser;
|
|
67
|
-
/** Auto-connect on mount (default: true) */
|
|
68
|
-
autoConnect?: boolean;
|
|
69
|
-
/** Reconnect on disconnect (default: true) */
|
|
70
|
-
autoReconnect?: boolean;
|
|
71
|
-
/** Max reconnect attempts (default: 5) */
|
|
72
|
-
maxReconnectAttempts?: number;
|
|
73
|
-
/** Callback when connection state changes */
|
|
74
|
-
onConnectionChange?: (state: ConnectionState) => void;
|
|
75
|
-
/** Callback when sync completes */
|
|
76
|
-
onSync?: () => void;
|
|
77
|
-
/** Callback on authentication error */
|
|
78
|
-
onAuthError?: (error: Error) => void;
|
|
79
|
-
/** Optional token refresh callback used before reconnect/auth retry */
|
|
80
|
-
onRefreshToken?: () => Promise<EditorTokenRefreshResult | string>;
|
|
81
|
-
/** Children components */
|
|
82
|
-
children: ReactNode;
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* EditorProvider wraps children with Hocuspocus collaboration context.
|
|
86
|
-
* Manages WebSocket connection, Y.Doc, and awareness state.
|
|
87
|
-
*/
|
|
88
|
-
declare function EditorProvider({ websocketUrl, documentName, token, tokenExpiresAt, user, autoConnect, autoReconnect, maxReconnectAttempts, onConnectionChange, onSync, onAuthError, onRefreshToken, children, }: EditorProviderProps): react_jsx_runtime.JSX.Element;
|
|
89
|
-
/**
|
|
90
|
-
* Hook to access the editor context.
|
|
91
|
-
* Must be used within an EditorProvider.
|
|
92
|
-
*/
|
|
93
|
-
declare function useEditorContext(): EditorContextValue;
|
|
94
|
-
|
|
95
|
-
type DocumentEditorMode = "preview" | "edit";
|
|
96
|
-
type DocumentEditorBackend = "local" | "collaborative";
|
|
97
|
-
interface DocumentEditorPaneCollaborationConfig extends Omit<EditorProviderProps, "children"> {
|
|
98
|
-
}
|
|
99
|
-
interface DocumentEditorPaneProps extends Omit<ArtifactPaneProps, "children" | "tabs" | "toolbar" | "emptyState"> {
|
|
100
|
-
tabs?: ArtifactPaneProps["tabs"];
|
|
101
|
-
toolbar?: ReactNode;
|
|
102
|
-
markdown?: string;
|
|
103
|
-
mode?: DocumentEditorMode;
|
|
104
|
-
defaultMode?: DocumentEditorMode;
|
|
105
|
-
onModeChange?: (mode: DocumentEditorMode) => void;
|
|
106
|
-
backend?: DocumentEditorBackend;
|
|
107
|
-
placeholder?: string;
|
|
108
|
-
autoFocus?: boolean;
|
|
109
|
-
readOnly?: boolean;
|
|
110
|
-
onChange?: (markdown: string) => void;
|
|
111
|
-
onSave?: (markdown: string) => Promise<void> | void;
|
|
112
|
-
saving?: boolean;
|
|
113
|
-
saveLabel?: string;
|
|
114
|
-
previewClassName?: string;
|
|
115
|
-
editorClassName?: string;
|
|
116
|
-
collaboration?: DocumentEditorPaneCollaborationConfig;
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* DocumentEditorPane — reusable markdown document surface with preview/edit
|
|
120
|
-
* modes and optional collaborative editing backed by Yjs/Hocuspocus.
|
|
121
|
-
*/
|
|
122
|
-
declare function DocumentEditorPane({ eyebrow, title, subtitle, meta, headerActions, footer, className, contentClassName, tabs, toolbar, markdown, mode, defaultMode, onModeChange, backend, placeholder, autoFocus, readOnly, onChange, onSave, saving, saveLabel, previewClassName, editorClassName, collaboration, }: DocumentEditorPaneProps): react_jsx_runtime.JSX.Element;
|
|
123
|
-
|
|
124
|
-
export { type Collaborator as C, type DocumentEditorBackend as D, type EditorContextValue as E, type ConnectionState as a, type DocumentEditorMode as b, DocumentEditorPane as c, type DocumentEditorPaneCollaborationConfig as d, type DocumentEditorPaneProps as e, EditorProvider as f, type EditorProviderProps as g, type EditorUser as h, type EditorTokenRefreshResult as i, useEditorContext as u };
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
-
import { R as Run } from './run-CtFZ6s-D.js';
|
|
5
|
-
import { a as SessionPart, b as ToolPart, R as ReasoningPart } from './parts-CyGkM6Fp.js';
|
|
6
|
-
import { A as AgentBranding } from './branding-DCi5VEik.js';
|
|
7
|
-
import { C as CustomToolRenderer } from './tool-display-Ct9nFAzJ.js';
|
|
8
|
-
|
|
9
|
-
interface RunGroupProps {
|
|
10
|
-
run: Run;
|
|
11
|
-
partMap: Record<string, SessionPart[]>;
|
|
12
|
-
collapsed: boolean;
|
|
13
|
-
onToggle: () => void;
|
|
14
|
-
branding?: AgentBranding;
|
|
15
|
-
renderToolDetail?: CustomToolRenderer;
|
|
16
|
-
headerActions?: ReactNode;
|
|
17
|
-
renderToolActions?: (part: ToolPart, options: {
|
|
18
|
-
run: Run;
|
|
19
|
-
messageId: string;
|
|
20
|
-
partIndex: number;
|
|
21
|
-
}) => ReactNode;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Collapsible container for a consecutive group of assistant messages (a "run").
|
|
25
|
-
* Shows a summary header with stats and renders tool/thinking/text parts.
|
|
26
|
-
*/
|
|
27
|
-
declare const RunGroup: React.MemoExoticComponent<({ run, partMap, collapsed, onToggle, branding, renderToolDetail, headerActions, renderToolActions, }: RunGroupProps) => react_jsx_runtime.JSX.Element | null>;
|
|
28
|
-
|
|
29
|
-
interface InlineToolItemProps {
|
|
30
|
-
part: ToolPart;
|
|
31
|
-
renderToolDetail?: CustomToolRenderer;
|
|
32
|
-
groupPosition?: "single" | "first" | "middle" | "last";
|
|
33
|
-
className?: string;
|
|
34
|
-
contentClassName?: string;
|
|
35
|
-
actions?: ReactNode;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Compact single-line tool call display (32px height).
|
|
39
|
-
* Shows icon, title, description, duration, and status indicator.
|
|
40
|
-
* Expands on click to show ExpandedToolDetail.
|
|
41
|
-
*/
|
|
42
|
-
declare const InlineToolItem: React.MemoExoticComponent<({ part, renderToolDetail, groupPosition, className, contentClassName, actions, }: InlineToolItemProps) => react_jsx_runtime.JSX.Element>;
|
|
43
|
-
|
|
44
|
-
interface InlineThinkingItemProps {
|
|
45
|
-
part: ReasoningPart;
|
|
46
|
-
defaultOpen?: boolean;
|
|
47
|
-
autoCollapse?: boolean;
|
|
48
|
-
className?: string;
|
|
49
|
-
contentClassName?: string;
|
|
50
|
-
}
|
|
51
|
-
declare const InlineThinkingItem: React.MemoExoticComponent<({ part, defaultOpen, autoCollapse, className, contentClassName, }: InlineThinkingItemProps) => react_jsx_runtime.JSX.Element>;
|
|
52
|
-
|
|
53
|
-
interface ExpandedToolDetailProps {
|
|
54
|
-
part: ToolPart;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Renders full tool details when a tool item is expanded.
|
|
58
|
-
* Dispatches to specialised previews (CommandPreview, WriteFilePreview)
|
|
59
|
-
* or falls back to a generic input/output code view.
|
|
60
|
-
*/
|
|
61
|
-
declare const ExpandedToolDetail: React.MemoExoticComponent<({ part }: ExpandedToolDetailProps) => react_jsx_runtime.JSX.Element>;
|
|
62
|
-
|
|
63
|
-
export { ExpandedToolDetail as E, InlineThinkingItem as I, RunGroup as R, type ExpandedToolDetailProps as a, type InlineThinkingItemProps as b, InlineToolItem as c, type InlineToolItemProps as d, type RunGroupProps as e };
|