@tangle-network/sandbox-ui 0.113.6 → 0.114.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.
Files changed (106) hide show
  1. package/dist/WorkflowGraph-B-NsdYz_.js +1961 -0
  2. package/dist/assets.d.ts +214 -206
  3. package/dist/assets.js +1057 -908
  4. package/dist/auth-CWe17Hly.js +37 -0
  5. package/dist/auth.d.ts +2 -30
  6. package/dist/auth.js +2 -15
  7. package/dist/chat-BOvFAe6p.js +903 -0
  8. package/dist/chat.d.ts +2 -230
  9. package/dist/chat.js +2 -34
  10. package/dist/connectors.d.ts +52 -49
  11. package/dist/connectors.js +595 -643
  12. package/dist/dashboard-CZ3VgNPR.js +4969 -0
  13. package/dist/dashboard.d.ts +4 -1297
  14. package/dist/dashboard.js +4 -152
  15. package/dist/editor.d.ts +2 -1
  16. package/dist/editor.js +2 -31
  17. package/dist/files.d.ts +2 -6
  18. package/dist/files.js +2 -33
  19. package/dist/globals.css +63 -3
  20. package/dist/hooks.d.ts +146 -148
  21. package/dist/hooks.js +222 -55
  22. package/dist/index-CKRaj1pM.d.ts +776 -0
  23. package/dist/index-CXX5IpH2.d.ts +2 -0
  24. package/dist/index-DPePq7c8.d.ts +1340 -0
  25. package/dist/index-DiyLLZuJ.d.ts +230 -0
  26. package/dist/index-DvmZLMT1.d.ts +30 -0
  27. package/dist/index-I8ZLVtHd.d.ts +330 -0
  28. package/dist/index-PRM636Ex.d.ts +86 -0
  29. package/dist/index.d.ts +21 -33
  30. package/dist/index.js +21 -701
  31. package/dist/info-panel-C9cqDzOL.js +594 -0
  32. package/dist/integrations.d.ts +133 -139
  33. package/dist/integrations.js +491 -673
  34. package/dist/markdown.d.ts +2 -1
  35. package/dist/markdown.js +2 -13
  36. package/dist/model-I-NIxeM-.js +1250 -0
  37. package/dist/model-brand-B9A4H9pJ.d.ts +98 -0
  38. package/dist/model-brand-hMyDTUqB.js +624 -0
  39. package/dist/motion-DkyBRJb9.js +37 -0
  40. package/dist/openui.d.ts +2 -1
  41. package/dist/openui.js +2 -7
  42. package/dist/pages.d.ts +307 -300
  43. package/dist/pages.js +4404 -4181
  44. package/dist/primitives-Dh1vG6J3.js +113 -0
  45. package/dist/primitives.d.ts +2 -74
  46. package/dist/primitives.js +2 -204
  47. package/dist/provider-logo-DjqmConF.js +311 -0
  48. package/dist/run.d.ts +2 -1
  49. package/dist/run.js +2 -23
  50. package/dist/sdk-hooks.d.ts +3 -4
  51. package/dist/sdk-hooks.js +3 -31
  52. package/dist/sidecar-DgH_vQ6m.d.ts +9 -0
  53. package/dist/stores.d.ts +14 -15
  54. package/dist/stores.js +13 -81
  55. package/dist/styles.css +63 -3
  56. package/dist/template-card-L-4gmjx2.d.ts +90 -0
  57. package/dist/terminal-CN9ZgHRt.js +197 -0
  58. package/dist/terminal.d.ts +60 -60
  59. package/dist/terminal.js +2 -10
  60. package/dist/tokens.css +51 -0
  61. package/dist/types.d.ts +4 -11
  62. package/dist/types.js +0 -1
  63. package/dist/use-pty-session-C8cE0adT.js +669 -0
  64. package/dist/use-sidecar-auth-CCTJcrq7.d.ts +145 -0
  65. package/dist/use-sidecar-auth-DkdcufOz.js +742 -0
  66. package/dist/utils-DzWbktWG.js +2 -0
  67. package/dist/utils.d.ts +2 -1
  68. package/dist/utils.js +2 -37
  69. package/dist/workbench-BCaCKl-J.js +8347 -0
  70. package/dist/workbench.d.ts +2 -310
  71. package/dist/workbench.js +2 -44
  72. package/dist/workflows.d.ts +341 -339
  73. package/dist/workflows.js +74 -109
  74. package/dist/workspace-B6AtI6ld.js +2510 -0
  75. package/dist/workspace.d.ts +2 -761
  76. package/dist/workspace.js +2 -51
  77. package/package.json +46 -40
  78. package/dist/WorkflowGraph-2QOORYIR.js +0 -1722
  79. package/dist/chunk-2BUPSB7O.js +0 -0
  80. package/dist/chunk-3KBNPQQF.js +0 -2697
  81. package/dist/chunk-3LIXVEEE.js +0 -279
  82. package/dist/chunk-72UF2H5H.js +0 -707
  83. package/dist/chunk-AI25G5MX.js +0 -944
  84. package/dist/chunk-ANSC5AFC.js +0 -314
  85. package/dist/chunk-AZ3AWMTM.js +0 -8
  86. package/dist/chunk-BGVEHENC.js +0 -10
  87. package/dist/chunk-CZ7CSFO4.js +0 -39
  88. package/dist/chunk-DYXXYGS4.js +0 -4700
  89. package/dist/chunk-EI44GEQ5.js +0 -6
  90. package/dist/chunk-IACRDXER.js +0 -219
  91. package/dist/chunk-IOB2PW5Z.js +0 -55
  92. package/dist/chunk-M4K7ZGR2.js +0 -24
  93. package/dist/chunk-MYZAW4RX.js +0 -665
  94. package/dist/chunk-OMUIPJQZ.js +0 -555
  95. package/dist/chunk-RQZRXKMR.js +0 -398
  96. package/dist/chunk-SOKKTB7W.js +0 -230
  97. package/dist/chunk-TADGS4Q7.js +0 -1010
  98. package/dist/chunk-UCQNOUN3.js +0 -7964
  99. package/dist/chunk-ULPLRBMF.js +0 -34
  100. package/dist/chunk-WID73FPH.js +0 -89
  101. package/dist/chunk-X3YXP7FG.js +0 -38
  102. package/dist/logo-DiAjq759.d.ts +0 -15
  103. package/dist/model-brand-BNnaUKKZ.d.ts +0 -99
  104. package/dist/ports-list-CDIvTNnX.d.ts +0 -17
  105. package/dist/sdk-hooks-Djkjq4cp.d.ts +0 -145
  106. package/dist/template-card-Bn-Bw5xC.d.ts +0 -87
@@ -1,6 +0,0 @@
1
- // src/lib/utils.ts
2
- import { cn } from "@tangle-network/ui/utils";
3
-
4
- export {
5
- cn
6
- };
@@ -1,219 +0,0 @@
1
- import {
2
- usePtySession
3
- } from "./chunk-MYZAW4RX.js";
4
-
5
- // src/terminal/terminal-view.tsx
6
- import "@xterm/xterm/css/xterm.css";
7
- import { useEffect, useRef, useCallback, useMemo } from "react";
8
- import { Terminal } from "@xterm/xterm";
9
- import { FitAddon } from "@xterm/addon-fit";
10
- import { WebLinksAddon } from "@xterm/addon-web-links";
11
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
12
- var DEFAULT_TERMINAL_THEME = {
13
- background: "#0c0c0e",
14
- foreground: "#d4d4d8",
15
- cursor: "#34d399",
16
- cursorAccent: "#0c0c0e",
17
- selectionBackground: "#7c3aed33",
18
- selectionForeground: "#d4d4d8",
19
- black: "#18181b",
20
- red: "#ef4444",
21
- green: "#34d399",
22
- yellow: "#fbbf24",
23
- blue: "#60a5fa",
24
- magenta: "#a78bfa",
25
- cyan: "#22d3ee",
26
- white: "#d4d4d8",
27
- brightBlack: "#52525b",
28
- brightRed: "#f87171",
29
- brightGreen: "#6ee7b7",
30
- brightYellow: "#fde68a",
31
- brightBlue: "#93c5fd",
32
- brightMagenta: "#c4b5fd",
33
- brightCyan: "#67e8f9",
34
- brightWhite: "#fafafa"
35
- };
36
- function TerminalView({
37
- apiUrl,
38
- token,
39
- theme,
40
- title = "Terminal",
41
- subtitle = "Connected to PTY session",
42
- isActive = true,
43
- connectionId,
44
- incarnationId,
45
- control,
46
- fontSize = 13
47
- }) {
48
- const resolvedTheme = useMemo(
49
- () => ({ ...DEFAULT_TERMINAL_THEME, ...theme }),
50
- [theme]
51
- );
52
- const resolvedFontSize = Number.isFinite(fontSize) && fontSize > 0 ? fontSize : 13;
53
- const fontSizeRef = useRef(resolvedFontSize);
54
- fontSizeRef.current = resolvedFontSize;
55
- const containerRef = useRef(null);
56
- const termRef = useRef(null);
57
- const fitAddonRef = useRef(null);
58
- const pendingWritesRef = useRef([]);
59
- const writeRafRef = useRef(null);
60
- const onData = useCallback((data) => {
61
- if (!data) return;
62
- pendingWritesRef.current.push(data);
63
- if (writeRafRef.current !== null) return;
64
- writeRafRef.current = requestAnimationFrame(() => {
65
- writeRafRef.current = null;
66
- const chunks = pendingWritesRef.current;
67
- if (chunks.length === 0) return;
68
- pendingWritesRef.current = [];
69
- termRef.current?.write(chunks.length === 1 ? chunks[0] : chunks.join(""));
70
- });
71
- }, []);
72
- const { isConnected, error, sendCommand, resizeTerminal, reconnect } = usePtySession({
73
- apiUrl,
74
- token,
75
- onData,
76
- connectionId,
77
- incarnationId,
78
- control
79
- });
80
- useEffect(() => {
81
- if (!containerRef.current) return;
82
- const term = new Terminal({
83
- theme: resolvedTheme,
84
- fontFamily: '"JetBrains Mono", "Fira Code", "Cascadia Code", Menlo, monospace',
85
- fontSize: fontSizeRef.current,
86
- lineHeight: 1.4,
87
- cursorBlink: true,
88
- cursorStyle: "bar",
89
- scrollback: 5e3,
90
- convertEol: true,
91
- allowProposedApi: true
92
- });
93
- const fitAddon = new FitAddon();
94
- const webLinksAddon = new WebLinksAddon();
95
- term.loadAddon(fitAddon);
96
- term.loadAddon(webLinksAddon);
97
- term.open(containerRef.current);
98
- let webglAddon = null;
99
- let webglCancelled = false;
100
- void (async () => {
101
- try {
102
- const mod = await import("@xterm/addon-webgl");
103
- if (webglCancelled) return;
104
- try {
105
- const addon = new mod.WebglAddon();
106
- addon.onContextLoss(() => {
107
- webglAddon?.dispose();
108
- webglAddon = null;
109
- });
110
- webglAddon = addon;
111
- term.loadAddon(addon);
112
- } catch {
113
- }
114
- } catch {
115
- }
116
- })();
117
- requestAnimationFrame(() => {
118
- fitAddon.fit();
119
- });
120
- termRef.current = term;
121
- fitAddonRef.current = fitAddon;
122
- term.onData((data) => {
123
- if (data === "\f") {
124
- termRef.current?.clear();
125
- sendCommand("\r").catch(console.error);
126
- return;
127
- }
128
- sendCommand(data).catch((err) => {
129
- termRef.current?.writeln(
130
- `\r
131
- \x1B[31m${err instanceof Error ? err.message : "Send failed"}\x1B[0m`
132
- );
133
- });
134
- });
135
- term.onResize(({ cols, rows }) => {
136
- resizeTerminal(cols, rows).catch(console.error);
137
- });
138
- const ro = new ResizeObserver(() => {
139
- requestAnimationFrame(() => {
140
- fitAddon.fit();
141
- });
142
- });
143
- ro.observe(containerRef.current);
144
- return () => {
145
- webglCancelled = true;
146
- ro.disconnect();
147
- if (writeRafRef.current !== null) {
148
- cancelAnimationFrame(writeRafRef.current);
149
- writeRafRef.current = null;
150
- }
151
- pendingWritesRef.current = [];
152
- webglAddon?.dispose();
153
- term.dispose();
154
- termRef.current = null;
155
- fitAddonRef.current = null;
156
- };
157
- }, [sendCommand, resizeTerminal, title, subtitle]);
158
- useEffect(() => {
159
- if (termRef.current) {
160
- termRef.current.options.theme = resolvedTheme;
161
- }
162
- }, [resolvedTheme]);
163
- useEffect(() => {
164
- const term = termRef.current;
165
- if (!term || term.options.fontSize === resolvedFontSize) return;
166
- term.options.fontSize = resolvedFontSize;
167
- const rafId = requestAnimationFrame(() => fitAddonRef.current?.fit());
168
- return () => cancelAnimationFrame(rafId);
169
- }, [resolvedFontSize]);
170
- useEffect(() => {
171
- if (isConnected && termRef.current) {
172
- resizeTerminal(termRef.current.cols, termRef.current.rows).catch(console.error);
173
- if (isActive) {
174
- termRef.current.focus();
175
- }
176
- }
177
- }, [isConnected, resizeTerminal, isActive]);
178
- useEffect(() => {
179
- if (isActive && termRef.current && fitAddonRef.current) {
180
- setTimeout(() => {
181
- fitAddonRef.current?.fit();
182
- termRef.current?.focus();
183
- }, 50);
184
- }
185
- }, [isActive]);
186
- return /* @__PURE__ */ jsxs(
187
- "div",
188
- {
189
- className: "relative h-full w-full group cursor-text",
190
- onClick: () => termRef.current?.focus(),
191
- children: [
192
- /* @__PURE__ */ jsx(
193
- "div",
194
- {
195
- ref: containerRef,
196
- className: "h-full w-full overflow-hidden relative z-0",
197
- style: { backgroundColor: resolvedTheme.background }
198
- }
199
- ),
200
- (!isConnected || error) && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-surface-container-lowest", children: /* @__PURE__ */ jsx("div", { className: "text-center", children: error ? /* @__PURE__ */ jsxs(Fragment, { children: [
201
- /* @__PURE__ */ jsx("p", { className: "text-sm text-[var(--surface-danger-text)] mb-3", children: error }),
202
- /* @__PURE__ */ jsx(
203
- "button",
204
- {
205
- onClick: reconnect,
206
- className: "text-sm text-[var(--surface-success-text)] hover:opacity-80 underline cursor-pointer",
207
- children: "Retry connection"
208
- }
209
- )
210
- ] }) : /* @__PURE__ */ jsx("p", { className: "text-[13px] text-muted-foreground", children: "Connecting to terminal..." }) }) })
211
- ]
212
- }
213
- );
214
- }
215
-
216
- export {
217
- DEFAULT_TERMINAL_THEME,
218
- TerminalView
219
- };
@@ -1,55 +0,0 @@
1
- // src/auth/index.ts
2
- import {
3
- AuthHeader,
4
- GitHubLoginButton,
5
- LoginLayout,
6
- UserMenu
7
- } from "@tangle-network/ui/auth";
8
-
9
- // src/auth/tangle-login-button.tsx
10
- import { Button } from "@tangle-network/ui/primitives";
11
- import { cn } from "@tangle-network/ui/utils";
12
- import { jsx, jsxs } from "react/jsx-runtime";
13
- function TangleMark({ className }) {
14
- return /* @__PURE__ */ jsx(
15
- "svg",
16
- {
17
- className,
18
- viewBox: "0 0 24 24",
19
- fill: "currentColor",
20
- "aria-hidden": "true",
21
- children: /* @__PURE__ */ jsx("path", { d: "M4 5h16v3.2h-6.4V19h-3.2V8.2H4V5z" })
22
- }
23
- );
24
- }
25
- function TangleLoginButton({
26
- authUrl = "/auth/tangle",
27
- variant = "default",
28
- className,
29
- children,
30
- ...props
31
- }) {
32
- return /* @__PURE__ */ jsxs(
33
- Button,
34
- {
35
- variant,
36
- className: cn("gap-2", className),
37
- onClick: () => {
38
- window.location.href = authUrl;
39
- },
40
- ...props,
41
- children: [
42
- /* @__PURE__ */ jsx(TangleMark, { className: "h-5 w-5" }),
43
- children ?? "Sign in with Tangle"
44
- ]
45
- }
46
- );
47
- }
48
-
49
- export {
50
- TangleLoginButton,
51
- AuthHeader,
52
- GitHubLoginButton,
53
- LoginLayout,
54
- UserMenu
55
- };
@@ -1,24 +0,0 @@
1
- // src/run/index.ts
2
- import {
3
- ExpandedToolDetail,
4
- InlineThinkingItem,
5
- InlineToolItem,
6
- LiveDuration,
7
- RunGroup,
8
- RunRowShell,
9
- RunRowStatusDot,
10
- ToolCallFeed,
11
- parseToolEvent
12
- } from "@tangle-network/ui/run";
13
-
14
- export {
15
- ExpandedToolDetail,
16
- InlineThinkingItem,
17
- InlineToolItem,
18
- LiveDuration,
19
- RunGroup,
20
- RunRowShell,
21
- RunRowStatusDot,
22
- ToolCallFeed,
23
- parseToolEvent
24
- };