@tangle-network/sandbox-ui 0.4.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/dist/auth.js +3 -3
  2. package/dist/chat.d.ts +1 -1
  3. package/dist/chat.js +11 -9
  4. package/dist/{chunk-ZP6GSX4D.js → chunk-565V6JTN.js} +26 -50
  5. package/dist/chunk-5CEMHKBP.js +72 -0
  6. package/dist/{chunk-FOQTE67I.js → chunk-5F4NX5R2.js} +10 -5
  7. package/dist/{chunk-MVYFNPAH.js → chunk-7DVFZEVW.js} +298 -272
  8. package/dist/{chunk-MUOL44AE.js → chunk-BRBTD7RH.js} +6 -6
  9. package/dist/{chunk-SSKVYXCR.js → chunk-DCPYTL4W.js} +62 -79
  10. package/dist/chunk-DLCFZDGX.js +182 -0
  11. package/dist/{chunk-HXEA7L2T.js → chunk-FFOXUHOF.js} +10 -10
  12. package/dist/chunk-H5XYSFYE.js +228 -0
  13. package/dist/{chunk-TQN3VR4F.js → chunk-JP725R4W.js} +2 -2
  14. package/dist/{chunk-CJ2RYVZH.js → chunk-NTSRY4GW.js} +68 -10
  15. package/dist/{chunk-DQYODCBN.js → chunk-P24K22CV.js} +57 -66
  16. package/dist/{chunk-GVUW4VDD.js → chunk-R3IU37AW.js} +161 -229
  17. package/dist/chunk-TDYQBLL5.js +127 -0
  18. package/dist/{chunk-HWLX5NME.js → chunk-TSE423UF.js} +12 -12
  19. package/dist/{chunk-YDBXQQLC.js → chunk-VBWY44UU.js} +30 -76
  20. package/dist/{chunk-IW2JZCOC.js → chunk-WBQ7VULC.js} +7 -7
  21. package/dist/{chunk-72UEKFZ2.js → chunk-WC7QTWPN.js} +65 -42
  22. package/dist/{chunk-HYLTXGOI.js → chunk-WQH233GF.js} +5 -5
  23. package/dist/{chunk-CCKNIAS7.js → chunk-XBR3IP7B.js} +2 -2
  24. package/dist/{chunk-OHMO7NUX.js → chunk-XTPAWK7L.js} +20 -31
  25. package/dist/{chunk-SULQQJPB.js → chunk-YS66Q3RC.js} +1 -1
  26. package/dist/{chunk-FRGMMANX.js → chunk-YYGECNZZ.js} +3 -3
  27. package/dist/dashboard.d.ts +2 -2
  28. package/dist/dashboard.js +6 -6
  29. package/dist/{document-editor-pane-5TN2VWGZ.js → document-editor-pane-JNXPANWM.js} +2 -2
  30. package/dist/editor.js +2 -2
  31. package/dist/files.js +2 -2
  32. package/dist/globals.css +129 -95
  33. package/dist/hooks.d.ts +2 -2
  34. package/dist/hooks.js +5 -5
  35. package/dist/{index-tTfThG0n.d.ts → index-BT_-ecpc.d.ts} +11 -10
  36. package/dist/index.d.ts +16 -23
  37. package/dist/index.js +27 -26
  38. package/dist/markdown.d.ts +14 -17
  39. package/dist/markdown.js +1 -1
  40. package/dist/openui.js +5 -5
  41. package/dist/pages.d.ts +10 -3
  42. package/dist/pages.js +147 -184
  43. package/dist/primitives.d.ts +8 -5
  44. package/dist/primitives.js +8 -8
  45. package/dist/run.d.ts +1 -1
  46. package/dist/run.js +4 -4
  47. package/dist/sdk-hooks.d.ts +1 -1
  48. package/dist/sdk-hooks.js +4 -4
  49. package/dist/styles.css +129 -95
  50. package/dist/terminal.d.ts +2 -2
  51. package/dist/terminal.js +13 -43
  52. package/dist/tokens.css +299 -179
  53. package/dist/{tool-call-feed-D5Ume-Pt.d.ts → tool-call-feed-Bs3MyQMT.d.ts} +3 -1
  54. package/dist/{usage-chart-CY9xo3KX.d.ts → usage-chart-XCoB_7Xu.d.ts} +1 -2
  55. package/dist/{use-pty-session-DeZSxOCN.d.ts → use-pty-session-COzVkhtc.d.ts} +1 -1
  56. package/dist/workspace.d.ts +3 -1
  57. package/dist/workspace.js +11 -11
  58. package/package.json +14 -2
  59. package/dist/chunk-GRYHFH5O.js +0 -110
  60. package/dist/chunk-LTFK464G.js +0 -103
  61. package/dist/chunk-MXCSSOGH.js +0 -105
@@ -22,7 +22,7 @@ import {
22
22
  ToastProvider,
23
23
  UploadProgress,
24
24
  useToast
25
- } from "./chunk-SSKVYXCR.js";
25
+ } from "./chunk-DCPYTL4W.js";
26
26
  import {
27
27
  Dialog,
28
28
  DialogClose,
@@ -34,7 +34,7 @@ import {
34
34
  DialogPortal,
35
35
  DialogTitle,
36
36
  DialogTrigger
37
- } from "./chunk-SULQQJPB.js";
37
+ } from "./chunk-YS66Q3RC.js";
38
38
  import {
39
39
  Tabs,
40
40
  TabsContent,
@@ -45,7 +45,7 @@ import {
45
45
  EmptyState,
46
46
  Input,
47
47
  Textarea
48
- } from "./chunk-MUOL44AE.js";
48
+ } from "./chunk-BRBTD7RH.js";
49
49
  import {
50
50
  Table,
51
51
  TableBody,
@@ -55,7 +55,7 @@ import {
55
55
  TableHead,
56
56
  TableHeader,
57
57
  TableRow
58
- } from "./chunk-TQN3VR4F.js";
58
+ } from "./chunk-JP725R4W.js";
59
59
  import {
60
60
  Logo,
61
61
  TangleKnot
@@ -79,13 +79,13 @@ import {
79
79
  DropdownMenuSubContent,
80
80
  DropdownMenuSubTrigger,
81
81
  DropdownMenuTrigger
82
- } from "./chunk-IW2JZCOC.js";
82
+ } from "./chunk-WBQ7VULC.js";
83
83
  import {
84
84
  Progress,
85
85
  Skeleton,
86
86
  SkeletonCard,
87
87
  SkeletonTable
88
- } from "./chunk-FRGMMANX.js";
88
+ } from "./chunk-YYGECNZZ.js";
89
89
  import {
90
90
  Badge,
91
91
  Card,
@@ -95,11 +95,11 @@ import {
95
95
  CardHeader,
96
96
  CardTitle,
97
97
  badgeVariants
98
- } from "./chunk-MXCSSOGH.js";
98
+ } from "./chunk-TDYQBLL5.js";
99
99
  import {
100
100
  Button,
101
101
  buttonVariants
102
- } from "./chunk-HWLX5NME.js";
102
+ } from "./chunk-TSE423UF.js";
103
103
  import "./chunk-RQHJBTEU.js";
104
104
  export {
105
105
  Avatar,
package/dist/run.d.ts CHANGED
@@ -1,6 +1,6 @@
1
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-DM5M_T9h.js';
2
2
  import * as react_jsx_runtime from 'react/jsx-runtime';
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';
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-Bs3MyQMT.js';
4
4
  import 'react';
5
5
  import './run-CtFZ6s-D.js';
6
6
  import './parts-CyGkM6Fp.js';
package/dist/run.js CHANGED
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  ToolCallFeed,
3
3
  parseToolEvent
4
- } from "./chunk-CCKNIAS7.js";
4
+ } from "./chunk-XBR3IP7B.js";
5
5
  import {
6
6
  ExpandedToolDetail,
7
7
  InlineThinkingItem,
8
8
  InlineToolItem,
9
9
  LiveDuration,
10
10
  RunGroup
11
- } from "./chunk-72UEKFZ2.js";
11
+ } from "./chunk-WC7QTWPN.js";
12
12
  import "./chunk-HRMUF35V.js";
13
13
  import {
14
14
  ToolCallGroup,
15
15
  ToolCallStep
16
- } from "./chunk-CJ2RYVZH.js";
16
+ } from "./chunk-NTSRY4GW.js";
17
17
  import "./chunk-BX6AQMUS.js";
18
- import "./chunk-LTFK464G.js";
18
+ import "./chunk-H5XYSFYE.js";
19
19
  import "./chunk-RQHJBTEU.js";
20
20
  export {
21
21
  ExpandedToolDetail,
@@ -3,7 +3,7 @@ import { RefObject } from 'react';
3
3
  import { G as GroupedMessage, R as Run } from './run-CtFZ6s-D.js';
4
4
  import { S as SessionMessage, a as SessionPart } from './parts-CyGkM6Fp.js';
5
5
  import { R as RegisterActiveSessionOptions, g as ActiveSessionTransportMode, c as ActiveSessionConnectionState } from './active-sessions-store-CeOmXgv5.js';
6
- import { F as FeedSegment } from './tool-call-feed-D5Ume-Pt.js';
6
+ import { F as FeedSegment } from './tool-call-feed-Bs3MyQMT.js';
7
7
  import 'nanostores';
8
8
  import 'react/jsx-runtime';
9
9
 
package/dist/sdk-hooks.js CHANGED
@@ -7,17 +7,17 @@ import {
7
7
  useSessionStream,
8
8
  useSidecarAuth,
9
9
  useToolCallStream
10
- } from "./chunk-FOQTE67I.js";
11
- import "./chunk-CCKNIAS7.js";
10
+ } from "./chunk-5F4NX5R2.js";
11
+ import "./chunk-XBR3IP7B.js";
12
12
  import "./chunk-OEX7NZE3.js";
13
13
  import {
14
14
  useAutoScroll,
15
15
  useRunCollapseState,
16
16
  useRunGroups
17
17
  } from "./chunk-CNWVHQFY.js";
18
- import "./chunk-CJ2RYVZH.js";
18
+ import "./chunk-NTSRY4GW.js";
19
19
  import "./chunk-BX6AQMUS.js";
20
- import "./chunk-LTFK464G.js";
20
+ import "./chunk-H5XYSFYE.js";
21
21
  import "./chunk-RQHJBTEU.js";
22
22
  export {
23
23
  RealtimeSessionRegistry,
package/dist/styles.css CHANGED
@@ -1,8 +1,9 @@
1
1
  @import "./tokens.css";
2
2
 
3
- @tailwind base;
4
- @tailwind components;
5
- @tailwind utilities;
3
+ /* Geist (UI) + Geist Mono (code) + Outfit (display) — via Google Fonts */
4
+ @import url("https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500;600&family=Outfit:wght@400;500;600;700&display=swap");
5
+
6
+ @import "tailwindcss";
6
7
 
7
8
  @layer base {
8
9
  :root {
@@ -15,31 +16,39 @@
15
16
  }
16
17
 
17
18
  body {
18
- @apply antialiased;
19
+ -webkit-font-smoothing: antialiased;
20
+ -moz-osx-font-smoothing: grayscale;
19
21
  background-color: hsl(var(--background));
20
22
  color: hsl(var(--foreground));
21
23
  font-family: var(--font-sans);
22
24
  font-feature-settings:
23
25
  "rlig" 1,
24
- "calt" 1;
26
+ "calt" 1,
27
+ "ss01" 1;
28
+ }
29
+
30
+ ::selection {
31
+ background: rgba(56, 178, 172, 0.22);
32
+ color: hsl(var(--hsl-foreground));
25
33
  }
26
34
 
27
35
  /* Custom scrollbar */
28
36
  ::-webkit-scrollbar {
29
- width: 8px;
30
- height: 8px;
37
+ width: 6px;
38
+ height: 6px;
31
39
  }
32
40
 
33
41
  ::-webkit-scrollbar-track {
34
- @apply bg-transparent;
42
+ background: transparent;
35
43
  }
36
44
 
37
45
  ::-webkit-scrollbar-thumb {
38
- @apply bg-border rounded-full;
46
+ background: hsl(var(--border) / 0.7);
47
+ border-radius: 3px;
39
48
  }
40
49
 
41
50
  ::-webkit-scrollbar-thumb:hover {
42
- @apply bg-muted-foreground/50;
51
+ background: hsl(var(--muted-foreground) / 0.4);
43
52
  }
44
53
  }
45
54
 
@@ -47,30 +56,109 @@
47
56
  /* Gradient text -- Tangle default accent */
48
57
  .text-gradient-sandbox {
49
58
  background-image: var(--tangle-gradient);
50
- @apply bg-clip-text text-transparent;
59
+ background-clip: text;
60
+ -webkit-background-clip: text;
61
+ color: transparent;
51
62
  }
52
63
 
53
64
  /* Glow effects */
54
65
  .glow-sandbox {
55
- box-shadow: 0 0 40px -10px hsl(var(--sandbox) / 0.4);
66
+ box-shadow: 0 0 48px -10px hsl(var(--sandbox) / 0.45);
67
+ }
68
+
69
+ /* Solid depth cards */
70
+ .glass-card {
71
+ background: var(--depth-2);
72
+ border: 1px solid var(--border-subtle);
73
+ transition: border-color var(--transition-default), box-shadow var(--transition-default);
56
74
  }
57
75
 
58
- /* Glass effect */
76
+ .glass-card:hover {
77
+ border-color: var(--border-default);
78
+ }
79
+
80
+ .glass-card-strong {
81
+ background: var(--depth-3);
82
+ border: 1px solid var(--border-subtle);
83
+ }
84
+
85
+ /* Legacy alias */
59
86
  .glass {
60
- backdrop-filter: blur(24px);
61
- background-color: hsl(var(--card) / 0.8);
62
- border: 1px solid hsl(var(--border) / 0.5);
87
+ background-color: var(--depth-2);
88
+ border: 1px solid var(--border-subtle);
89
+ }
90
+
91
+ /* Atmospheric mesh gradient background */
92
+ .bg-mesh {
93
+ position: relative;
94
+ }
95
+
96
+ .bg-mesh::before {
97
+ content: '';
98
+ position: absolute;
99
+ inset: 0;
100
+ background:
101
+ radial-gradient(ellipse 80% 50% at 20% 40%, var(--mesh-teal), transparent),
102
+ radial-gradient(ellipse 60% 40% at 80% 20%, var(--mesh-violet), transparent),
103
+ radial-gradient(ellipse 50% 60% at 50% 80%, var(--mesh-blue), transparent);
104
+ pointer-events: none;
105
+ z-index: 0;
63
106
  }
64
107
 
65
108
  /* Subtle noise texture */
66
109
  .noise {
67
- background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
68
- opacity: 0.02;
110
+ background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.025'/%3E%3C/svg%3E");
111
+ pointer-events: none;
112
+ }
113
+
114
+ /* Status dots — operational state indicators */
115
+ .status-dot {
116
+ width: 8px;
117
+ height: 8px;
118
+ border-radius: 50%;
119
+ display: inline-block;
120
+ flex-shrink: 0;
121
+ }
122
+
123
+ .status-dot-running {
124
+ background: var(--status-running);
125
+ box-shadow: var(--shadow-status-running);
126
+ }
127
+
128
+ .status-dot-creating {
129
+ background: var(--status-creating);
130
+ animation: status-pulse 2s ease-in-out infinite;
131
+ }
132
+
133
+ .status-dot-stopped {
134
+ background: var(--status-stopped);
135
+ }
136
+
137
+ .status-dot-warm {
138
+ background: var(--status-warm);
139
+ }
140
+
141
+ .status-dot-cold {
142
+ background: var(--status-cold);
143
+ }
144
+
145
+ .status-dot-error {
146
+ background: var(--status-error);
147
+ box-shadow: var(--shadow-status-error);
148
+ }
149
+
150
+ .status-dot-deleted {
151
+ background: var(--status-deleted);
152
+ opacity: 0.6;
69
153
  }
70
154
 
71
- /* Terminal styling */
155
+ /* Terminal cursor */
72
156
  .terminal-cursor {
73
- @apply inline-block w-2 h-5 bg-foreground animate-pulse;
157
+ display: inline-block;
158
+ width: 0.5rem;
159
+ height: 1.25rem;
160
+ background-color: hsl(var(--foreground));
161
+ animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
74
162
  }
75
163
 
76
164
  /* Shimmer animation */
@@ -85,95 +173,41 @@
85
173
  animation: shimmer 2s infinite;
86
174
  }
87
175
 
88
- @keyframes shimmer {
89
- 0% {
90
- background-position: -200% 0;
91
- }
92
- 100% {
93
- background-position: 200% 0;
94
- }
95
- }
96
-
97
176
  /* Fade in animation */
98
177
  .animate-in {
99
- animation: fade-in 0.3s ease-out;
100
- }
101
-
102
- @keyframes fade-in {
103
- from {
104
- opacity: 0;
105
- transform: translateY(10px);
106
- }
107
- to {
108
- opacity: 1;
109
- transform: translateY(0);
110
- }
178
+ animation: fade-in 0.25s ease-out;
111
179
  }
112
180
 
113
181
  /* Pulse ring animation */
114
182
  .pulse-ring {
115
- @apply relative;
183
+ position: relative;
116
184
  }
117
185
 
118
186
  .pulse-ring::before {
119
187
  content: "";
120
- @apply absolute inset-0 rounded-full;
188
+ position: absolute;
189
+ inset: 0;
190
+ border-radius: 9999px;
121
191
  animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
122
192
  }
123
193
 
194
+ @keyframes shimmer {
195
+ 0% { background-position: -200% 0; }
196
+ 100% { background-position: 200% 0; }
197
+ }
198
+
199
+ @keyframes fade-in {
200
+ from { opacity: 0; transform: translateY(8px); }
201
+ to { opacity: 1; transform: translateY(0); }
202
+ }
203
+
124
204
  @keyframes pulse-ring {
125
- 0%,
126
- 100% {
127
- box-shadow: 0 0 0 0 currentColor;
128
- opacity: 0.4;
129
- }
130
- 50% {
131
- box-shadow: 0 0 0 8px currentColor;
132
- opacity: 0;
133
- }
205
+ 0%, 100% { box-shadow: 0 0 0 0 currentColor; opacity: 0.4; }
206
+ 50% { box-shadow: 0 0 0 8px currentColor; opacity: 0; }
134
207
  }
135
- }
136
208
 
137
- /* Fonts -- Inter (UI) + JetBrains Mono (code). */
138
- @font-face {
139
- font-family: "Inter";
140
- src: url("https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuLyfAZ9hiA.woff2") format("woff2");
141
- font-weight: 300;
142
- font-style: normal;
143
- font-display: swap;
144
- }
145
- @font-face {
146
- font-family: "Inter";
147
- src: url("https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuLyfAZ9hiA.woff2") format("woff2");
148
- font-weight: 400;
149
- font-style: normal;
150
- font-display: swap;
151
- }
152
- @font-face {
153
- font-family: "Inter";
154
- src: url("https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuI2fAZ9hiA.woff2") format("woff2");
155
- font-weight: 500;
156
- font-style: normal;
157
- font-display: swap;
158
- }
159
- @font-face {
160
- font-family: "Inter";
161
- src: url("https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuFuYAZ9hiA.woff2") format("woff2");
162
- font-weight: 700;
163
- font-style: normal;
164
- font-display: swap;
165
- }
166
- @font-face {
167
- font-family: "JetBrains Mono";
168
- src: url("https://fonts.gstatic.com/s/jetbrainsmono/v18/tDbY2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKxTOlOV.woff2") format("woff2");
169
- font-weight: 400;
170
- font-style: normal;
171
- font-display: swap;
172
- }
173
- @font-face {
174
- font-family: "JetBrains Mono";
175
- src: url("https://fonts.gstatic.com/s/jetbrainsmono/v18/tDbY2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKxTPlOV.woff2") format("woff2");
176
- font-weight: 500;
177
- font-style: normal;
178
- font-display: swap;
209
+ @keyframes status-pulse {
210
+ 0%, 100% { opacity: 1; }
211
+ 50% { opacity: 0.35; }
212
+ }
179
213
  }
@@ -35,10 +35,10 @@ interface TerminalViewProps {
35
35
  title?: string;
36
36
  /** Subtitle shown in the welcome box. Default: "Connected to PTY session". */
37
37
  subtitle?: string;
38
- /** ANSI-escaped prompt string. Default: green "$ ". */
38
+ /** @deprecated No longer used the PTY provides its own prompt. */
39
39
  prompt?: string;
40
40
  }
41
41
  declare const DEFAULT_TERMINAL_THEME: TerminalTheme;
42
- declare function TerminalView({ apiUrl, token, theme, title, subtitle, prompt, }: TerminalViewProps): react_jsx_runtime.JSX.Element;
42
+ declare function TerminalView({ apiUrl, token, theme, title, subtitle, }: TerminalViewProps): react_jsx_runtime.JSX.Element;
43
43
 
44
44
  export { DEFAULT_TERMINAL_THEME, type TerminalTheme, TerminalView, type TerminalViewProps };
package/dist/terminal.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  usePtySession
3
- } from "./chunk-GRYHFH5O.js";
3
+ } from "./chunk-DLCFZDGX.js";
4
4
 
5
5
  // src/terminal/terminal-view.tsx
6
6
  import "@xterm/xterm/css/xterm.css";
@@ -33,23 +33,17 @@ var DEFAULT_TERMINAL_THEME = {
33
33
  brightCyan: "#67e8f9",
34
34
  brightWhite: "#fafafa"
35
35
  };
36
- var DEFAULT_PROMPT = "\x1B[38;5;48m$\x1B[0m ";
37
36
  function TerminalView({
38
37
  apiUrl,
39
38
  token,
40
39
  theme,
41
40
  title = "Terminal",
42
- subtitle = "Connected to PTY session",
43
- prompt = DEFAULT_PROMPT
41
+ subtitle = "Connected to PTY session"
44
42
  }) {
45
43
  const resolvedTheme = { ...DEFAULT_TERMINAL_THEME, ...theme };
46
44
  const containerRef = useRef(null);
47
45
  const termRef = useRef(null);
48
46
  const fitAddonRef = useRef(null);
49
- const lineBufferRef = useRef("");
50
- const writePrompt = useCallback(() => {
51
- termRef.current?.write("\r\n" + prompt);
52
- }, [prompt]);
53
47
  const onData = useCallback((data) => {
54
48
  termRef.current?.write(data);
55
49
  }, []);
@@ -87,37 +81,13 @@ function TerminalView({
87
81
  term.writeln(`\x1B[38;5;48m\u2502\x1B[0m \x1B[1m${padTitle}\x1B[0m\x1B[38;5;48m\u2502\x1B[0m`);
88
82
  term.writeln(`\x1B[38;5;48m\u2502\x1B[0m ${padSubtitle}\x1B[38;5;48m\u2502\x1B[0m`);
89
83
  term.writeln(`\x1B[38;5;48m\u2570${"\u2500".repeat(41)}\u256F\x1B[0m`);
90
- term.write(prompt);
91
84
  term.onData((data) => {
92
- const code = data.charCodeAt(0);
93
- if (data === "\r") {
94
- const cmd = lineBufferRef.current;
95
- lineBufferRef.current = "";
96
- term.write("\r\n");
97
- if (cmd.trim()) {
98
- sendCommand(cmd).catch((err) => {
99
- term.writeln(`\x1B[31mError: ${err instanceof Error ? err.message : String(err)}\x1B[0m`);
100
- writePrompt();
101
- });
102
- } else {
103
- term.write(prompt);
104
- }
105
- } else if (data === "\x7F" || data === "\b") {
106
- if (lineBufferRef.current.length > 0) {
107
- lineBufferRef.current = lineBufferRef.current.slice(0, -1);
108
- term.write("\b \b");
109
- }
110
- } else if (data === "") {
111
- lineBufferRef.current = "";
112
- term.write("^C");
113
- writePrompt();
114
- } else if (data === "\f") {
115
- term.clear();
116
- term.write(prompt);
117
- } else if (code >= 32) {
118
- lineBufferRef.current += data;
119
- term.write(data);
120
- }
85
+ sendCommand(data).catch((err) => {
86
+ termRef.current?.writeln(
87
+ `\r
88
+ \x1B[31m${err instanceof Error ? err.message : "Send failed"}\x1B[0m`
89
+ );
90
+ });
121
91
  });
122
92
  const ro = new ResizeObserver(() => {
123
93
  requestAnimationFrame(() => {
@@ -131,7 +101,7 @@ function TerminalView({
131
101
  termRef.current = null;
132
102
  fitAddonRef.current = null;
133
103
  };
134
- }, [sendCommand, writePrompt, prompt, resolvedTheme, title, subtitle]);
104
+ }, [sendCommand, resolvedTheme, title, subtitle]);
135
105
  return /* @__PURE__ */ jsxs("div", { className: "relative h-full w-full", children: [
136
106
  /* @__PURE__ */ jsx(
137
107
  "div",
@@ -141,17 +111,17 @@ function TerminalView({
141
111
  style: { backgroundColor: resolvedTheme.background }
142
112
  }
143
113
  ),
144
- (!isConnected || error) && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-black/60 rounded-lg", children: /* @__PURE__ */ jsx("div", { className: "text-center", children: error ? /* @__PURE__ */ jsxs(Fragment, { children: [
145
- /* @__PURE__ */ jsx("p", { className: "text-sm text-red-400 mb-3", children: error }),
114
+ (!isConnected || error) && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-[var(--depth-1)] rounded-lg", children: /* @__PURE__ */ jsx("div", { className: "text-center", children: error ? /* @__PURE__ */ jsxs(Fragment, { children: [
115
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-[var(--surface-danger-text)] mb-3", children: error }),
146
116
  /* @__PURE__ */ jsx(
147
117
  "button",
148
118
  {
149
119
  onClick: reconnect,
150
- className: "text-sm text-emerald-400 hover:text-emerald-300 underline cursor-pointer",
120
+ className: "text-sm text-[var(--surface-success-text)] hover:opacity-80 underline cursor-pointer",
151
121
  children: "Retry connection"
152
122
  }
153
123
  )
154
- ] }) : /* @__PURE__ */ jsx("p", { className: "text-sm text-neutral-400", children: "Connecting to terminal..." }) }) })
124
+ ] }) : /* @__PURE__ */ jsx("p", { className: "text-sm text-[var(--text-muted)]", children: "Connecting to terminal..." }) }) })
155
125
  ] });
156
126
  }
157
127
  export {