@tangle-network/sandbox-ui 0.2.2 → 0.3.4
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 +201 -10
- package/dist/auth.js +2 -2
- package/dist/chat-container-C8eHLw8z.d.ts +67 -0
- package/dist/chat.d.ts +70 -78
- package/dist/chat.js +8 -8
- package/dist/chunk-4F2GJRGU.js +756 -0
- package/dist/{chunk-HYEAX3DC.js → chunk-5LV6DZZF.js} +445 -114
- package/dist/{chunk-QSQBDR3N.js → chunk-BX6AQMUS.js} +5 -2
- package/dist/chunk-CCKNIAS7.js +124 -0
- package/dist/chunk-CJ2RYVZH.js +128 -0
- package/dist/{chunk-KMXV7DDX.js → chunk-CNWVHQFY.js} +1 -1
- package/dist/{chunk-OU4TRNQZ.js → chunk-COCSO7FG.js} +3 -3
- package/dist/chunk-FJSVPBKY.js +85 -0
- package/dist/chunk-FRGMMANX.js +102 -0
- package/dist/{chunk-E6FS7R4X.js → chunk-HWLX5NME.js} +1 -1
- package/dist/chunk-HY5IBRCE.js +1171 -0
- package/dist/chunk-JF6E2DS5.js +610 -0
- package/dist/chunk-MUOL44AE.js +121 -0
- package/dist/chunk-MXCSSOGH.js +105 -0
- package/dist/{chunk-NI2EI43H.js → chunk-PDV7W4NY.js} +9 -124
- package/dist/chunk-QGI5E7JD.js +1106 -0
- package/dist/chunk-TQN3VR4F.js +92 -0
- package/dist/{chunk-SOT2V7TX.js → chunk-TXI4MZAZ.js} +62 -144
- package/dist/chunk-WUR652Y3.js +1140 -0
- package/dist/chunk-YDBXQQLC.js +336 -0
- package/dist/{chunk-4EIWPJMJ.js → chunk-ZP6GSX4D.js} +36 -27
- package/dist/dashboard.d.ts +4 -111
- package/dist/dashboard.js +17 -4
- package/dist/{expanded-tool-detail-OkXGqTHe.d.ts → expanded-tool-detail-BDi_h_dZ.d.ts} +11 -4
- package/dist/file-tabs-CmaoDVBI.d.ts +72 -0
- package/dist/files.d.ts +25 -44
- package/dist/files.js +8 -3
- package/{src/styles → dist}/globals.css +16 -67
- package/dist/hooks.d.ts +5 -4
- package/dist/hooks.js +14 -9
- package/dist/index-BOjBJwzD.d.ts +219 -0
- package/dist/index.d.ts +39 -10
- package/dist/index.js +190 -121
- package/dist/markdown.d.ts +1 -24
- package/dist/markdown.js +1 -7
- package/dist/openui.d.ts +115 -0
- package/dist/openui.js +11 -0
- package/dist/pages.d.ts +3 -2
- package/dist/pages.js +19 -16
- package/dist/primitives.js +25 -19
- package/dist/run.d.ts +2 -2
- package/dist/run.js +8 -7
- package/dist/{use-sidecar-auth-Bb0-w3lX.d.ts → sdk-hooks.d.ts} +61 -72
- package/dist/sdk-hooks.js +29 -0
- package/dist/styles.css +179 -0
- package/dist/tokens.css +275 -0
- package/dist/{tool-display-BvsVW_Ur.d.ts → tool-display-Ct9nFAzJ.d.ts} +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/{usage-chart-DINgSVL5.d.ts → usage-chart-CY9xo3KX.d.ts} +8 -3
- package/dist/use-pty-session-DeZSxOCN.d.ts +69 -0
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +1 -1
- package/dist/workspace.d.ts +171 -33
- package/dist/workspace.js +25 -1
- package/package.json +10 -3
- package/tailwind.config.cjs +39 -0
- package/dist/chunk-2UHPE5T7.js +0 -201
- package/dist/chunk-6MQIDUPA.js +0 -502
- package/dist/chunk-J4OADEUK.js +0 -814
- package/dist/chunk-KYY2X6LY.js +0 -318
- package/dist/chunk-L6ZDH5F4.js +0 -334
- package/dist/chunk-M34OA6PQ.js +0 -233
- package/dist/chunk-M6VLC32S.js +0 -219
- package/dist/chunk-U62G5TS7.js +0 -472
- package/src/styles/tokens.css +0 -73
package/dist/openui.d.ts
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
type OpenUIPrimitive = string | number | boolean | null | undefined;
|
|
5
|
+
interface OpenUIAction {
|
|
6
|
+
id: string;
|
|
7
|
+
label: string;
|
|
8
|
+
tone?: "default" | "secondary" | "outline" | "ghost" | "destructive";
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
onPress?: () => void;
|
|
11
|
+
}
|
|
12
|
+
interface OpenUIBaseNode {
|
|
13
|
+
id?: string;
|
|
14
|
+
}
|
|
15
|
+
interface OpenUIHeadingNode extends OpenUIBaseNode {
|
|
16
|
+
type: "heading";
|
|
17
|
+
text: string;
|
|
18
|
+
level?: 1 | 2 | 3 | 4;
|
|
19
|
+
kicker?: string;
|
|
20
|
+
meta?: string;
|
|
21
|
+
}
|
|
22
|
+
interface OpenUITextNode extends OpenUIBaseNode {
|
|
23
|
+
type: "text";
|
|
24
|
+
text: string;
|
|
25
|
+
tone?: "default" | "muted" | "success" | "warning" | "error";
|
|
26
|
+
mono?: boolean;
|
|
27
|
+
}
|
|
28
|
+
interface OpenUIBadgeNode extends OpenUIBaseNode {
|
|
29
|
+
type: "badge";
|
|
30
|
+
label: string;
|
|
31
|
+
tone?: "default" | "secondary" | "success" | "warning" | "error" | "info" | "sandbox";
|
|
32
|
+
}
|
|
33
|
+
interface OpenUIStatNode extends OpenUIBaseNode {
|
|
34
|
+
type: "stat";
|
|
35
|
+
label: string;
|
|
36
|
+
value: string;
|
|
37
|
+
change?: string;
|
|
38
|
+
tone?: "default" | "success" | "warning" | "error" | "info";
|
|
39
|
+
}
|
|
40
|
+
interface OpenUIKeyValueNode extends OpenUIBaseNode {
|
|
41
|
+
type: "key_value";
|
|
42
|
+
items: Array<{
|
|
43
|
+
id?: string;
|
|
44
|
+
label: string;
|
|
45
|
+
value: ReactNode | OpenUIPrimitive;
|
|
46
|
+
tone?: "default" | "muted";
|
|
47
|
+
}>;
|
|
48
|
+
}
|
|
49
|
+
interface OpenUICodeNode extends OpenUIBaseNode {
|
|
50
|
+
type: "code";
|
|
51
|
+
code: string;
|
|
52
|
+
language?: string;
|
|
53
|
+
title?: string;
|
|
54
|
+
showLineNumbers?: boolean;
|
|
55
|
+
}
|
|
56
|
+
interface OpenUIMarkdownNode extends OpenUIBaseNode {
|
|
57
|
+
type: "markdown";
|
|
58
|
+
content: string;
|
|
59
|
+
}
|
|
60
|
+
interface OpenUITableNode extends OpenUIBaseNode {
|
|
61
|
+
type: "table";
|
|
62
|
+
columns: Array<{
|
|
63
|
+
key: string;
|
|
64
|
+
header: string;
|
|
65
|
+
align?: "left" | "right";
|
|
66
|
+
}>;
|
|
67
|
+
rows: Array<Record<string, ReactNode | OpenUIPrimitive>>;
|
|
68
|
+
caption?: string;
|
|
69
|
+
}
|
|
70
|
+
interface OpenUIActionsNode extends OpenUIBaseNode {
|
|
71
|
+
type: "actions";
|
|
72
|
+
actions: OpenUIAction[];
|
|
73
|
+
}
|
|
74
|
+
interface OpenUISeparatorNode extends OpenUIBaseNode {
|
|
75
|
+
type: "separator";
|
|
76
|
+
label?: string;
|
|
77
|
+
}
|
|
78
|
+
interface OpenUIStackNode extends OpenUIBaseNode {
|
|
79
|
+
type: "stack";
|
|
80
|
+
direction?: "row" | "column";
|
|
81
|
+
gap?: "sm" | "md" | "lg";
|
|
82
|
+
align?: "start" | "center" | "end" | "stretch";
|
|
83
|
+
wrap?: boolean;
|
|
84
|
+
children: OpenUIComponentNode[];
|
|
85
|
+
}
|
|
86
|
+
interface OpenUIGridNode extends OpenUIBaseNode {
|
|
87
|
+
type: "grid";
|
|
88
|
+
columns?: 1 | 2 | 3 | 4;
|
|
89
|
+
gap?: "sm" | "md" | "lg";
|
|
90
|
+
children: OpenUIComponentNode[];
|
|
91
|
+
}
|
|
92
|
+
interface OpenUICardNode extends OpenUIBaseNode {
|
|
93
|
+
type: "card";
|
|
94
|
+
title?: string;
|
|
95
|
+
description?: string;
|
|
96
|
+
eyebrow?: string;
|
|
97
|
+
badge?: OpenUIBadgeNode;
|
|
98
|
+
actions?: OpenUIAction[];
|
|
99
|
+
children?: OpenUIComponentNode[];
|
|
100
|
+
}
|
|
101
|
+
type OpenUIComponentNode = OpenUIActionsNode | OpenUIBadgeNode | OpenUICardNode | OpenUICodeNode | OpenUIGridNode | OpenUIHeadingNode | OpenUIKeyValueNode | OpenUIMarkdownNode | OpenUISeparatorNode | OpenUIStackNode | OpenUIStatNode | OpenUITableNode | OpenUITextNode;
|
|
102
|
+
interface OpenUIArtifactRendererProps {
|
|
103
|
+
schema: OpenUIComponentNode | OpenUIComponentNode[];
|
|
104
|
+
onAction?: (action: OpenUIAction) => void;
|
|
105
|
+
className?: string;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* OpenUIArtifactRenderer — contained renderer for OpenUI-like structured
|
|
109
|
+
* artifact payloads using sandbox-ui primitives and theme tokens. This is an
|
|
110
|
+
* extension surface for generated inspectors/results, not a replacement for
|
|
111
|
+
* the sandbox shell.
|
|
112
|
+
*/
|
|
113
|
+
declare function OpenUIArtifactRenderer({ schema, onAction, className, }: OpenUIArtifactRendererProps): react_jsx_runtime.JSX.Element;
|
|
114
|
+
|
|
115
|
+
export { type OpenUIAction, type OpenUIActionsNode, OpenUIArtifactRenderer, type OpenUIArtifactRendererProps, type OpenUIBadgeNode, type OpenUICardNode, type OpenUICodeNode, type OpenUIComponentNode, type OpenUIGridNode, type OpenUIHeadingNode, type OpenUIKeyValueNode, type OpenUIMarkdownNode, type OpenUIPrimitive, type OpenUISeparatorNode, type OpenUIStackNode, type OpenUIStatNode, type OpenUITableNode, type OpenUITextNode };
|
package/dist/openui.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
OpenUIArtifactRenderer
|
|
3
|
+
} from "./chunk-YDBXQQLC.js";
|
|
4
|
+
import "./chunk-TQN3VR4F.js";
|
|
5
|
+
import "./chunk-LTFK464G.js";
|
|
6
|
+
import "./chunk-MXCSSOGH.js";
|
|
7
|
+
import "./chunk-HWLX5NME.js";
|
|
8
|
+
import "./chunk-RQHJBTEU.js";
|
|
9
|
+
export {
|
|
10
|
+
OpenUIArtifactRenderer
|
|
11
|
+
};
|
package/dist/pages.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
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-
|
|
2
|
+
import { B as BillingSubscription, a as BillingBalance, b as BillingUsage, U as UsageDataPoint, P as PricingTier } from './usage-chart-CY9xo3KX.js';
|
|
3
3
|
|
|
4
4
|
type ProductVariant$1 = "sandbox";
|
|
5
5
|
interface BillingPageData {
|
|
@@ -29,8 +29,9 @@ interface StandalonePricingPageProps {
|
|
|
29
29
|
fetchTiers?: () => Promise<PricingTier[]>;
|
|
30
30
|
title?: string;
|
|
31
31
|
subtitle?: string;
|
|
32
|
+
className?: string;
|
|
32
33
|
}
|
|
33
|
-
declare function StandalonePricingPage({ variant, initialTiers, apiBasePath, onSelectTier, fetchTiers, title, subtitle, }: StandalonePricingPageProps): react_jsx_runtime.JSX.Element;
|
|
34
|
+
declare function StandalonePricingPage({ variant, initialTiers, apiBasePath, onSelectTier, fetchTiers, title, subtitle, className, }: StandalonePricingPageProps): react_jsx_runtime.JSX.Element;
|
|
34
35
|
|
|
35
36
|
interface ProfileMetrics {
|
|
36
37
|
total_runs: number;
|
package/dist/pages.js
CHANGED
|
@@ -5,27 +5,31 @@ import {
|
|
|
5
5
|
DialogFooter,
|
|
6
6
|
DialogHeader,
|
|
7
7
|
DialogTitle,
|
|
8
|
-
EmptyState,
|
|
9
|
-
Input,
|
|
10
8
|
Tabs,
|
|
11
9
|
TabsContent,
|
|
12
10
|
TabsList,
|
|
13
11
|
TabsTrigger
|
|
14
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-PDV7W4NY.js";
|
|
13
|
+
import {
|
|
14
|
+
EmptyState,
|
|
15
|
+
Input
|
|
16
|
+
} from "./chunk-MUOL44AE.js";
|
|
15
17
|
import {
|
|
16
18
|
BillingDashboard,
|
|
17
19
|
PricingPage,
|
|
18
20
|
UsageChart
|
|
19
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-ZP6GSX4D.js";
|
|
20
22
|
import {
|
|
21
|
-
Badge,
|
|
22
|
-
Card,
|
|
23
23
|
Skeleton,
|
|
24
24
|
SkeletonCard
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-FRGMMANX.js";
|
|
26
|
+
import {
|
|
27
|
+
Badge,
|
|
28
|
+
Card
|
|
29
|
+
} from "./chunk-MXCSSOGH.js";
|
|
26
30
|
import {
|
|
27
31
|
Button
|
|
28
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-HWLX5NME.js";
|
|
29
33
|
import {
|
|
30
34
|
cn
|
|
31
35
|
} from "./chunk-RQHJBTEU.js";
|
|
@@ -292,9 +296,8 @@ import * as React2 from "react";
|
|
|
292
296
|
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
293
297
|
var variantColors = {
|
|
294
298
|
sandbox: {
|
|
295
|
-
accent: "text-
|
|
296
|
-
|
|
297
|
-
gradientTo: "to-purple-400"
|
|
299
|
+
accent: "text-[var(--accent-text)]",
|
|
300
|
+
gradient: "bg-[image:var(--accent-gradient-strong)]"
|
|
298
301
|
}
|
|
299
302
|
};
|
|
300
303
|
async function fetchTiersFromApi(apiBasePath) {
|
|
@@ -364,7 +367,8 @@ function StandalonePricingPage({
|
|
|
364
367
|
onSelectTier,
|
|
365
368
|
fetchTiers,
|
|
366
369
|
title = "Simple, transparent pricing",
|
|
367
|
-
subtitle = "Choose the plan that fits your needs. Upgrade or downgrade at any time."
|
|
370
|
+
subtitle = "Choose the plan that fits your needs. Upgrade or downgrade at any time.",
|
|
371
|
+
className
|
|
368
372
|
}) {
|
|
369
373
|
const colors = variantColors[variant];
|
|
370
374
|
const [state, setState] = React2.useState({
|
|
@@ -433,16 +437,15 @@ function StandalonePricingPage({
|
|
|
433
437
|
},
|
|
434
438
|
[]
|
|
435
439
|
);
|
|
436
|
-
return /* @__PURE__ */ jsxs2("div", { className: "w-full space-y-12", children: [
|
|
440
|
+
return /* @__PURE__ */ jsxs2("div", { className: cn("w-full space-y-12", className), children: [
|
|
437
441
|
/* @__PURE__ */ jsxs2("div", { className: "space-y-4 text-center", children: [
|
|
438
442
|
/* @__PURE__ */ jsx2(
|
|
439
443
|
"h1",
|
|
440
444
|
{
|
|
441
445
|
className: cn(
|
|
442
446
|
"font-bold text-4xl tracking-tight sm:text-5xl",
|
|
443
|
-
"bg-
|
|
444
|
-
colors.
|
|
445
|
-
colors.gradientTo
|
|
447
|
+
"bg-clip-text text-transparent",
|
|
448
|
+
colors.gradient
|
|
446
449
|
),
|
|
447
450
|
children: title
|
|
448
451
|
}
|
package/dist/primitives.js
CHANGED
|
@@ -12,14 +12,6 @@ import {
|
|
|
12
12
|
SelectValue,
|
|
13
13
|
StatCard,
|
|
14
14
|
Switch,
|
|
15
|
-
Table,
|
|
16
|
-
TableBody,
|
|
17
|
-
TableCaption,
|
|
18
|
-
TableCell,
|
|
19
|
-
TableFooter,
|
|
20
|
-
TableHead,
|
|
21
|
-
TableHeader,
|
|
22
|
-
TableRow,
|
|
23
15
|
TerminalCursor,
|
|
24
16
|
TerminalDisplay,
|
|
25
17
|
TerminalInput,
|
|
@@ -27,7 +19,7 @@ import {
|
|
|
27
19
|
ToastContainer,
|
|
28
20
|
ToastProvider,
|
|
29
21
|
useToast
|
|
30
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-TXI4MZAZ.js";
|
|
31
23
|
import {
|
|
32
24
|
Avatar,
|
|
33
25
|
AvatarFallback,
|
|
@@ -44,14 +36,26 @@ import {
|
|
|
44
36
|
DialogPortal,
|
|
45
37
|
DialogTitle,
|
|
46
38
|
DialogTrigger,
|
|
47
|
-
EmptyState,
|
|
48
|
-
Input,
|
|
49
39
|
Tabs,
|
|
50
40
|
TabsContent,
|
|
51
41
|
TabsList,
|
|
52
|
-
TabsTrigger
|
|
42
|
+
TabsTrigger
|
|
43
|
+
} from "./chunk-PDV7W4NY.js";
|
|
44
|
+
import {
|
|
45
|
+
EmptyState,
|
|
46
|
+
Input,
|
|
53
47
|
Textarea
|
|
54
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-MUOL44AE.js";
|
|
49
|
+
import {
|
|
50
|
+
Table,
|
|
51
|
+
TableBody,
|
|
52
|
+
TableCaption,
|
|
53
|
+
TableCell,
|
|
54
|
+
TableFooter,
|
|
55
|
+
TableHead,
|
|
56
|
+
TableHeader,
|
|
57
|
+
TableRow
|
|
58
|
+
} from "./chunk-TQN3VR4F.js";
|
|
55
59
|
import {
|
|
56
60
|
Logo,
|
|
57
61
|
TangleKnot
|
|
@@ -73,6 +77,12 @@ import {
|
|
|
73
77
|
DropdownMenuSubTrigger,
|
|
74
78
|
DropdownMenuTrigger
|
|
75
79
|
} from "./chunk-MCGKDCOR.js";
|
|
80
|
+
import {
|
|
81
|
+
Progress,
|
|
82
|
+
Skeleton,
|
|
83
|
+
SkeletonCard,
|
|
84
|
+
SkeletonTable
|
|
85
|
+
} from "./chunk-FRGMMANX.js";
|
|
76
86
|
import {
|
|
77
87
|
Badge,
|
|
78
88
|
Card,
|
|
@@ -81,16 +91,12 @@ import {
|
|
|
81
91
|
CardFooter,
|
|
82
92
|
CardHeader,
|
|
83
93
|
CardTitle,
|
|
84
|
-
Progress,
|
|
85
|
-
Skeleton,
|
|
86
|
-
SkeletonCard,
|
|
87
|
-
SkeletonTable,
|
|
88
94
|
badgeVariants
|
|
89
|
-
} from "./chunk-
|
|
95
|
+
} from "./chunk-MXCSSOGH.js";
|
|
90
96
|
import {
|
|
91
97
|
Button,
|
|
92
98
|
buttonVariants
|
|
93
|
-
} from "./chunk-
|
|
99
|
+
} from "./chunk-HWLX5NME.js";
|
|
94
100
|
import "./chunk-RQHJBTEU.js";
|
|
95
101
|
export {
|
|
96
102
|
Avatar,
|
package/dist/run.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { E as ExpandedToolDetail, a as ExpandedToolDetailProps, I as InlineThinkingItem, b as InlineThinkingItemProps, c as InlineToolItem, d as InlineToolItemProps, R as RunGroup, e as RunGroupProps } from './expanded-tool-detail-
|
|
1
|
+
export { E as ExpandedToolDetail, a as ExpandedToolDetailProps, I as InlineThinkingItem, b as InlineThinkingItemProps, c as InlineToolItem, d as InlineToolItemProps, R as RunGroup, e as RunGroupProps } from './expanded-tool-detail-BDi_h_dZ.js';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
export { F as FeedSegment, T as ToolCallData, a as ToolCallFeed, b as ToolCallFeedProps, c as ToolCallGroup, d as ToolCallGroupProps, e as ToolCallStatus, f as ToolCallStep, g as ToolCallStepProps, h as ToolCallType, p as parseToolEvent } from './tool-call-feed-D5Ume-Pt.js';
|
|
4
4
|
import 'react';
|
|
5
5
|
import './run-CtFZ6s-D.js';
|
|
6
6
|
import './parts-CyGkM6Fp.js';
|
|
7
7
|
import './branding-DCi5VEik.js';
|
|
8
|
-
import './tool-display-
|
|
8
|
+
import './tool-display-Ct9nFAzJ.js';
|
|
9
9
|
|
|
10
10
|
declare function LiveDuration({ startTime }: {
|
|
11
11
|
startTime: number;
|
package/dist/run.js
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ToolCallFeed,
|
|
3
|
-
ToolCallGroup,
|
|
4
|
-
ToolCallStep,
|
|
5
3
|
parseToolEvent
|
|
6
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-CCKNIAS7.js";
|
|
7
5
|
import {
|
|
8
6
|
ExpandedToolDetail,
|
|
9
7
|
InlineThinkingItem,
|
|
10
8
|
InlineToolItem,
|
|
11
9
|
LiveDuration,
|
|
12
10
|
RunGroup
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-LTFK464G.js";
|
|
15
|
-
import "./chunk-M34OA6PQ.js";
|
|
11
|
+
} from "./chunk-WUR652Y3.js";
|
|
16
12
|
import "./chunk-HRMUF35V.js";
|
|
17
|
-
import
|
|
13
|
+
import {
|
|
14
|
+
ToolCallGroup,
|
|
15
|
+
ToolCallStep
|
|
16
|
+
} from "./chunk-CJ2RYVZH.js";
|
|
17
|
+
import "./chunk-BX6AQMUS.js";
|
|
18
|
+
import "./chunk-LTFK464G.js";
|
|
18
19
|
import "./chunk-RQHJBTEU.js";
|
|
19
20
|
export {
|
|
20
21
|
ExpandedToolDetail,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { F as FeedSegment } from './tool-call-feed-D5Ume-Pt.js';
|
|
2
|
-
import { S as SessionMessage, a as SessionPart } from './parts-CyGkM6Fp.js';
|
|
3
|
-
import { G as GroupedMessage, R as Run } from './run-CtFZ6s-D.js';
|
|
4
1
|
import * as React from 'react';
|
|
5
2
|
import { RefObject } from 'react';
|
|
3
|
+
import { G as GroupedMessage, R as Run } from './run-CtFZ6s-D.js';
|
|
4
|
+
import { S as SessionMessage, a as SessionPart } from './parts-CyGkM6Fp.js';
|
|
5
|
+
import { F as FeedSegment } from './tool-call-feed-D5Ume-Pt.js';
|
|
6
|
+
import 'react/jsx-runtime';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* useToolCallStream — parses SSE events into ToolCallFeed segments.
|
|
@@ -32,45 +33,6 @@ interface UseToolCallStreamReturn {
|
|
|
32
33
|
}
|
|
33
34
|
declare function useToolCallStream(): UseToolCallStreamReturn;
|
|
34
35
|
|
|
35
|
-
interface AuthUser {
|
|
36
|
-
customer_id: string;
|
|
37
|
-
email: string;
|
|
38
|
-
name?: string;
|
|
39
|
-
tier: string;
|
|
40
|
-
github?: {
|
|
41
|
-
login: string;
|
|
42
|
-
connected: boolean;
|
|
43
|
-
} | null;
|
|
44
|
-
session_expires_at?: string;
|
|
45
|
-
}
|
|
46
|
-
interface UseAuthOptions {
|
|
47
|
-
apiBaseUrl: string;
|
|
48
|
-
revalidateOnFocus?: boolean;
|
|
49
|
-
shouldRetryOnError?: boolean;
|
|
50
|
-
}
|
|
51
|
-
interface UseAuthResult {
|
|
52
|
-
user: AuthUser | null;
|
|
53
|
-
isLoading: boolean;
|
|
54
|
-
isError: boolean;
|
|
55
|
-
error: Error | null;
|
|
56
|
-
mutate: () => Promise<void>;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Hook for managing authentication state.
|
|
60
|
-
* Fetches user session from the API and provides loading/error states.
|
|
61
|
-
*/
|
|
62
|
-
declare function useAuth({ apiBaseUrl, revalidateOnFocus, shouldRetryOnError, }: UseAuthOptions): UseAuthResult;
|
|
63
|
-
/**
|
|
64
|
-
* Creates a fetcher function that includes auth credentials.
|
|
65
|
-
* Uses both cookie-based session and localStorage API key for backwards compatibility.
|
|
66
|
-
*/
|
|
67
|
-
declare function createAuthFetcher(_apiBaseUrl: string): <T = unknown>(url: string, options?: RequestInit) => Promise<T>;
|
|
68
|
-
/**
|
|
69
|
-
* Hook to get the API key from localStorage.
|
|
70
|
-
* For backwards compatibility with API key-based auth.
|
|
71
|
-
*/
|
|
72
|
-
declare function useApiKey(): string | null;
|
|
73
|
-
|
|
74
36
|
/**
|
|
75
37
|
* SSE Event data structure
|
|
76
38
|
*/
|
|
@@ -194,6 +156,62 @@ interface BotStreamEvent {
|
|
|
194
156
|
timestamp: number;
|
|
195
157
|
}
|
|
196
158
|
|
|
159
|
+
interface SdkSessionAttachment {
|
|
160
|
+
name: string;
|
|
161
|
+
size?: number;
|
|
162
|
+
}
|
|
163
|
+
interface SdkSessionSeed {
|
|
164
|
+
id: string;
|
|
165
|
+
role: SessionMessage["role"];
|
|
166
|
+
createdAt?: number | string | Date;
|
|
167
|
+
content?: string;
|
|
168
|
+
attachments?: SdkSessionAttachment[];
|
|
169
|
+
parts?: SessionPart[];
|
|
170
|
+
}
|
|
171
|
+
interface SdkSessionEvent {
|
|
172
|
+
type: string;
|
|
173
|
+
data?: Record<string, unknown>;
|
|
174
|
+
}
|
|
175
|
+
interface BeginAssistantMessageOptions {
|
|
176
|
+
id?: string;
|
|
177
|
+
role?: Extract<SessionMessage["role"], "assistant" | "system">;
|
|
178
|
+
createdAt?: number | string | Date;
|
|
179
|
+
}
|
|
180
|
+
interface AppendUserMessageOptions {
|
|
181
|
+
id?: string;
|
|
182
|
+
role?: Extract<SessionMessage["role"], "user" | "system">;
|
|
183
|
+
content: string;
|
|
184
|
+
createdAt?: number | string | Date;
|
|
185
|
+
attachments?: SdkSessionAttachment[];
|
|
186
|
+
}
|
|
187
|
+
interface CompleteAssistantMessageOptions {
|
|
188
|
+
messageId?: string;
|
|
189
|
+
finalText?: string;
|
|
190
|
+
}
|
|
191
|
+
interface ApplySdkEventOptions {
|
|
192
|
+
messageId?: string;
|
|
193
|
+
}
|
|
194
|
+
interface UseSdkSessionOptions {
|
|
195
|
+
initialMessages?: SdkSessionSeed[];
|
|
196
|
+
}
|
|
197
|
+
interface UseSdkSessionReturn {
|
|
198
|
+
messages: SessionMessage[];
|
|
199
|
+
partMap: Record<string, SessionPart[]>;
|
|
200
|
+
isStreaming: boolean;
|
|
201
|
+
activeAssistantMessageId: string | null;
|
|
202
|
+
replaceHistory: (messages: SdkSessionSeed[]) => void;
|
|
203
|
+
appendUserMessage: (message: AppendUserMessageOptions) => string;
|
|
204
|
+
beginAssistantMessage: (options?: BeginAssistantMessageOptions) => string;
|
|
205
|
+
applySdkEvent: (event: SdkSessionEvent, options?: ApplySdkEventOptions) => void;
|
|
206
|
+
completeAssistantMessage: (options?: CompleteAssistantMessageOptions) => void;
|
|
207
|
+
failAssistantMessage: (error: string, options?: {
|
|
208
|
+
messageId?: string;
|
|
209
|
+
}) => void;
|
|
210
|
+
setStreaming: (value: boolean) => void;
|
|
211
|
+
reset: () => void;
|
|
212
|
+
}
|
|
213
|
+
declare function useSdkSession({ initialMessages, }?: UseSdkSessionOptions): UseSdkSessionReturn;
|
|
214
|
+
|
|
197
215
|
interface UseRunGroupsOptions {
|
|
198
216
|
messages: SessionMessage[];
|
|
199
217
|
partMap: Record<string, SessionPart[]>;
|
|
@@ -276,35 +294,6 @@ declare function useDropdownMenu(options?: UseDropdownMenuOptions): {
|
|
|
276
294
|
close: () => void;
|
|
277
295
|
};
|
|
278
296
|
|
|
279
|
-
interface UsePtySessionOptions {
|
|
280
|
-
/** Base URL of the sidecar (e.g. "http://localhost:9100"). */
|
|
281
|
-
apiUrl: string;
|
|
282
|
-
/** Bearer token for authentication. */
|
|
283
|
-
token: string;
|
|
284
|
-
/** Called with raw PTY output (may contain ANSI escape codes). */
|
|
285
|
-
onData: (data: string) => void;
|
|
286
|
-
}
|
|
287
|
-
interface UsePtySessionReturn {
|
|
288
|
-
/** Whether the SSE stream is connected and receiving data. */
|
|
289
|
-
isConnected: boolean;
|
|
290
|
-
/** Connection or API error, if any. */
|
|
291
|
-
error: string | null;
|
|
292
|
-
/** Send a command to the PTY session. */
|
|
293
|
-
sendCommand: (command: string) => Promise<void>;
|
|
294
|
-
/** Tear down and reconnect. */
|
|
295
|
-
reconnect: () => void;
|
|
296
|
-
}
|
|
297
|
-
/**
|
|
298
|
-
* Manages a PTY session against the sidecar terminal API.
|
|
299
|
-
*
|
|
300
|
-
* Protocol:
|
|
301
|
-
* - POST /terminals → create session → { data: { sessionId } }
|
|
302
|
-
* - GET /terminals/{id}/stream → SSE output (raw PTY with ANSI codes)
|
|
303
|
-
* - POST /terminals/{id}/execute → send command { command: "..." }
|
|
304
|
-
* - DELETE /terminals/{id} → close session
|
|
305
|
-
*/
|
|
306
|
-
declare function usePtySession({ apiUrl, token, onData }: UsePtySessionOptions): UsePtySessionReturn;
|
|
307
|
-
|
|
308
297
|
interface UseSidecarAuthOptions {
|
|
309
298
|
/** Scoping key for token storage (e.g. botId, sandboxId). */
|
|
310
299
|
resourceId: string;
|
|
@@ -336,4 +325,4 @@ interface SidecarAuth {
|
|
|
336
325
|
*/
|
|
337
326
|
declare function useSidecarAuth({ resourceId, apiUrl, signMessage }: UseSidecarAuthOptions): SidecarAuth;
|
|
338
327
|
|
|
339
|
-
export { type AgentStreamEvent
|
|
328
|
+
export { type AgentStreamEvent, type AppendUserMessageOptions, type ApplySdkEventOptions, type AutomationStreamEvent, type BeginAssistantMessageOptions, type BotStreamEvent, type CompleteAssistantMessageOptions, type ConnectionState, type SSEEvent, type SdkSessionAttachment, type SdkSessionEvent, type SdkSessionSeed, type SessionInfo, type SidecarAuth, type TaskStreamEvent, type TerminalStreamEvent, type UseRunGroupsOptions, type UseSSEStreamOptions, type UseSSEStreamResult, type UseSdkSessionOptions, type UseSdkSessionReturn, type UseSessionStreamOptions, type UseSessionStreamResult, type UseSidecarAuthOptions, type UseToolCallStreamReturn, useAutoScroll, useDropdownMenu, useRunCollapseState, useRunGroups, useSSEStream, useSdkSession, useSessionStream, useSidecarAuth, useToolCallStream };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useDropdownMenu,
|
|
3
|
+
useSSEStream,
|
|
4
|
+
useSdkSession,
|
|
5
|
+
useSessionStream,
|
|
6
|
+
useSidecarAuth,
|
|
7
|
+
useToolCallStream
|
|
8
|
+
} from "./chunk-5LV6DZZF.js";
|
|
9
|
+
import "./chunk-CCKNIAS7.js";
|
|
10
|
+
import {
|
|
11
|
+
useAutoScroll,
|
|
12
|
+
useRunCollapseState,
|
|
13
|
+
useRunGroups
|
|
14
|
+
} from "./chunk-CNWVHQFY.js";
|
|
15
|
+
import "./chunk-CJ2RYVZH.js";
|
|
16
|
+
import "./chunk-BX6AQMUS.js";
|
|
17
|
+
import "./chunk-LTFK464G.js";
|
|
18
|
+
import "./chunk-RQHJBTEU.js";
|
|
19
|
+
export {
|
|
20
|
+
useAutoScroll,
|
|
21
|
+
useDropdownMenu,
|
|
22
|
+
useRunCollapseState,
|
|
23
|
+
useRunGroups,
|
|
24
|
+
useSSEStream,
|
|
25
|
+
useSdkSession,
|
|
26
|
+
useSessionStream,
|
|
27
|
+
useSidecarAuth,
|
|
28
|
+
useToolCallStream
|
|
29
|
+
};
|