@tangle-network/sandbox-ui 0.3.11 → 0.3.13

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 (37) hide show
  1. package/README.md +7 -1
  2. package/dist/auth.js +2 -3
  3. package/dist/{chunk-CREVWUCA.js → chunk-DJEZKF5A.js} +3 -2
  4. package/dist/chunk-DLCFZDGX.js +182 -0
  5. package/dist/{chunk-FOQTE67I.js → chunk-FJLS7PNT.js} +9 -4
  6. package/dist/chunk-HXEA7L2T.js +1401 -0
  7. package/dist/{chunk-6NYG2R7V.js → chunk-HYLTXGOI.js} +1 -1
  8. package/dist/{chunk-MCGKDCOR.js → chunk-IW2JZCOC.js} +55 -14
  9. package/dist/{chunk-PCTEG6HR.js → chunk-OHMO7NUX.js} +2 -4
  10. package/dist/{chunk-DMYYQXPN.js → chunk-SMBF6HB5.js} +646 -465
  11. package/dist/dashboard.d.ts +1 -1
  12. package/dist/dashboard.js +40 -6
  13. package/dist/{document-editor-pane-AFBP2KFT.js → document-editor-pane-5TN2VWGZ.js} +1 -1
  14. package/dist/{document-editor-pane-Xnl8SmA7.d.ts → document-editor-pane-A70-EhdQ.d.ts} +1 -1
  15. package/dist/editor.d.ts +2 -2
  16. package/dist/editor.js +1 -1
  17. package/dist/files.d.ts +1 -1
  18. package/dist/files.js +1 -1
  19. package/dist/hooks.d.ts +1 -1
  20. package/dist/hooks.js +2 -2
  21. package/dist/index-D7_ZDkwB.d.ts +375 -0
  22. package/dist/index.d.ts +5 -3
  23. package/dist/index.js +74 -16
  24. package/dist/pages.d.ts +12 -2
  25. package/dist/pages.js +60 -5
  26. package/dist/primitives.js +4 -6
  27. package/dist/sdk-hooks.js +1 -1
  28. package/dist/terminal.d.ts +2 -2
  29. package/dist/terminal.js +9 -39
  30. package/dist/{use-pty-session-DeZSxOCN.d.ts → use-pty-session-COzVkhtc.d.ts} +1 -1
  31. package/dist/workspace.d.ts +3 -1
  32. package/dist/workspace.js +2 -2
  33. package/package.json +1 -1
  34. package/dist/chunk-B26TQ7SA.js +0 -47
  35. package/dist/chunk-BOBXH6CH.js +0 -10981
  36. package/dist/chunk-GRYHFH5O.js +0 -110
  37. package/dist/index-BJIPTCKk.d.ts +0 -264
package/dist/index.js CHANGED
@@ -2,12 +2,26 @@ import {
2
2
  copyText,
3
3
  timeAgo
4
4
  } from "./chunk-QD4QE5P5.js";
5
+ import {
6
+ CollaboratorsList,
7
+ DocumentEditorPane,
8
+ EditorProvider,
9
+ EditorToolbar,
10
+ TiptapEditor,
11
+ useAwareness,
12
+ useCollaboratorPresence,
13
+ useCollaborators,
14
+ useDocumentChanges,
15
+ useEditorConnection,
16
+ useEditorContext,
17
+ useYjsState
18
+ } from "./chunk-HXEA7L2T.js";
5
19
  import {
6
20
  AuthHeader,
7
21
  GitHubLoginButton,
8
22
  LoginLayout,
9
23
  UserMenu
10
- } from "./chunk-PCTEG6HR.js";
24
+ } from "./chunk-OHMO7NUX.js";
11
25
  import {
12
26
  createAuthFetcher,
13
27
  useApiKey,
@@ -15,7 +29,7 @@ import {
15
29
  } from "./chunk-FJSVPBKY.js";
16
30
  import {
17
31
  usePtySession
18
- } from "./chunk-GRYHFH5O.js";
32
+ } from "./chunk-DLCFZDGX.js";
19
33
  import {
20
34
  RealtimeSessionRegistry,
21
35
  useDropdownMenu,
@@ -25,7 +39,7 @@ import {
25
39
  useSessionStream,
26
40
  useSidecarAuth,
27
41
  useToolCallStream
28
- } from "./chunk-FOQTE67I.js";
42
+ } from "./chunk-FJLS7PNT.js";
29
43
  import {
30
44
  DropZone,
31
45
  Label,
@@ -50,11 +64,6 @@ import {
50
64
  UploadProgress,
51
65
  useToast
52
66
  } from "./chunk-CSIXZEKN.js";
53
- import {
54
- Avatar,
55
- AvatarFallback,
56
- AvatarImage
57
- } from "./chunk-B26TQ7SA.js";
58
67
  import {
59
68
  Dialog,
60
69
  DialogClose,
@@ -89,7 +98,7 @@ import {
89
98
  StatusBar,
90
99
  TerminalPanel,
91
100
  WorkspaceLayout
92
- } from "./chunk-CREVWUCA.js";
101
+ } from "./chunk-DJEZKF5A.js";
93
102
  import "./chunk-OEX7NZE3.js";
94
103
  import {
95
104
  EmptyState,
@@ -158,7 +167,7 @@ import {
158
167
  FileTabs,
159
168
  FileTree,
160
169
  filterFileTree
161
- } from "./chunk-6NYG2R7V.js";
170
+ } from "./chunk-HYLTXGOI.js";
162
171
  import {
163
172
  ArtifactPane
164
173
  } from "./chunk-W4LM3QYZ.js";
@@ -168,7 +177,6 @@ import {
168
177
  Markdown
169
178
  } from "./chunk-LTFK464G.js";
170
179
  import {
171
- AppSidebar,
172
180
  BackendSelector,
173
181
  ClusterStatusBar,
174
182
  CreditBalance,
@@ -176,13 +184,31 @@ import {
176
184
  InvoiceTable,
177
185
  NewSandboxCard,
178
186
  PlanCards,
187
+ ProfileAvatar,
179
188
  ProfileComparison,
180
189
  ProfileSelector,
190
+ RailButton,
191
+ RailModeButton,
192
+ RailSeparator,
181
193
  ResourceMeter,
194
+ SIDEBAR_PANEL_WIDTH,
195
+ SIDEBAR_RAIL_WIDTH,
196
+ SIDEBAR_TOTAL_WIDTH,
182
197
  SandboxCard,
183
198
  SandboxTable,
184
- VariantList
185
- } from "./chunk-DMYYQXPN.js";
199
+ Sidebar,
200
+ SidebarContent,
201
+ SidebarPanel,
202
+ SidebarPanelContent,
203
+ SidebarPanelHeader,
204
+ SidebarProvider,
205
+ SidebarRail,
206
+ SidebarRailFooter,
207
+ SidebarRailHeader,
208
+ SidebarRailNav,
209
+ VariantList,
210
+ useSidebar
211
+ } from "./chunk-SMBF6HB5.js";
186
212
  import {
187
213
  BillingDashboard,
188
214
  PricingPage,
@@ -193,6 +219,9 @@ import {
193
219
  TangleKnot
194
220
  } from "./chunk-OKCIKTXQ.js";
195
221
  import {
222
+ Avatar,
223
+ AvatarFallback,
224
+ AvatarImage,
196
225
  DropdownMenu,
197
226
  DropdownMenuCheckboxItem,
198
227
  DropdownMenuContent,
@@ -208,7 +237,7 @@ import {
208
237
  DropdownMenuSubContent,
209
238
  DropdownMenuSubTrigger,
210
239
  DropdownMenuTrigger
211
- } from "./chunk-MCGKDCOR.js";
240
+ } from "./chunk-IW2JZCOC.js";
212
241
  import {
213
242
  Progress,
214
243
  Skeleton,
@@ -320,7 +349,6 @@ function ThemeToggle() {
320
349
  export {
321
350
  AgentTimeline,
322
351
  AgentWorkbench,
323
- AppSidebar,
324
352
  ArtifactPane,
325
353
  AuditResults,
326
354
  AuthHeader,
@@ -343,6 +371,7 @@ export {
343
371
  ClusterStatusBar,
344
372
  CodeBlock2 as CodeBlock,
345
373
  CodeBlock as CodeBlockDisplay,
374
+ CollaboratorsList,
346
375
  CommandPreview,
347
376
  CopyButton,
348
377
  CreditBalance,
@@ -359,6 +388,7 @@ export {
359
388
  DialogTrigger,
360
389
  DiffPreview,
361
390
  DirectoryPane,
391
+ DocumentEditorPane,
362
392
  DropZone,
363
393
  DropdownMenu,
364
394
  DropdownMenuCheckboxItem,
@@ -375,6 +405,8 @@ export {
375
405
  DropdownMenuSubContent,
376
406
  DropdownMenuSubTrigger,
377
407
  DropdownMenuTrigger,
408
+ EditorProvider,
409
+ EditorToolbar,
378
410
  EmptyState,
379
411
  ExpandedToolDetail,
380
412
  FileArtifactPane,
@@ -398,14 +430,21 @@ export {
398
430
  OpenUIArtifactRenderer,
399
431
  PlanCards,
400
432
  PricingPage as PricingCards,
433
+ ProfileAvatar,
401
434
  ProfileComparison,
402
435
  ProfileSelector,
403
436
  Progress,
404
437
  QuestionPreview,
438
+ RailButton,
439
+ RailModeButton,
440
+ RailSeparator,
405
441
  RealtimeSessionRegistry,
406
442
  ResourceMeter,
407
443
  RunGroup,
408
444
  RuntimePane,
445
+ SIDEBAR_PANEL_WIDTH,
446
+ SIDEBAR_RAIL_WIDTH,
447
+ SIDEBAR_TOTAL_WIDTH,
409
448
  SandboxCard,
410
449
  SandboxTable,
411
450
  SandboxWorkbench,
@@ -421,6 +460,16 @@ export {
421
460
  SelectValue,
422
461
  SessionActivityMonitor,
423
462
  SessionSidebar,
463
+ Sidebar,
464
+ SidebarContent,
465
+ SidebarPanel,
466
+ SidebarPanelContent,
467
+ SidebarPanelHeader,
468
+ SidebarProvider,
469
+ SidebarRail,
470
+ SidebarRailFooter,
471
+ SidebarRailHeader,
472
+ SidebarRailNav,
424
473
  Skeleton,
425
474
  SkeletonCard,
426
475
  SkeletonTable,
@@ -450,6 +499,7 @@ export {
450
499
  Textarea,
451
500
  ThemeToggle,
452
501
  ThinkingIndicator,
502
+ TiptapEditor,
453
503
  ToastContainer,
454
504
  ToastProvider,
455
505
  ToolCallFeed,
@@ -479,7 +529,13 @@ export {
479
529
  useApiKey,
480
530
  useAuth,
481
531
  useAutoScroll,
532
+ useAwareness,
533
+ useCollaboratorPresence,
534
+ useCollaborators,
535
+ useDocumentChanges,
482
536
  useDropdownMenu,
537
+ useEditorConnection,
538
+ useEditorContext,
483
539
  usePtySession,
484
540
  useRealtimeSession,
485
541
  useRunCollapseState,
@@ -487,8 +543,10 @@ export {
487
543
  useSSEStream,
488
544
  useSdkSession,
489
545
  useSessionStream,
546
+ useSidebar,
490
547
  useSidecarAuth,
491
548
  useTheme,
492
549
  useToast,
493
- useToolCallStream
550
+ useToolCallStream,
551
+ useYjsState
494
552
  };
package/dist/pages.d.ts CHANGED
@@ -28,8 +28,14 @@ interface EnvironmentOption {
28
28
  icon: React.ReactNode;
29
29
  color: string;
30
30
  }
31
+ interface EnvironmentEntry {
32
+ id: string;
33
+ description?: string;
34
+ version?: string;
35
+ }
31
36
  interface ProvisioningWizardProps {
32
37
  environments?: EnvironmentOption[];
38
+ onLoadEnvironments?: () => Promise<EnvironmentEntry[]>;
33
39
  onSubmit?: (config: ProvisioningConfig) => void;
34
40
  onBack?: () => void;
35
41
  className?: string;
@@ -42,7 +48,11 @@ interface ProvisioningConfig {
42
48
  modelTier: string;
43
49
  systemPrompt: string;
44
50
  }
45
- declare function ProvisioningWizard({ environments, onSubmit, onBack, className, }: ProvisioningWizardProps): react_jsx_runtime.JSX.Element;
51
+ declare function resolveEnvironment(env: {
52
+ id: string;
53
+ description?: string;
54
+ }): EnvironmentOption;
55
+ declare function ProvisioningWizard({ environments: environmentsProp, onLoadEnvironments, onSubmit, onBack, className, }: ProvisioningWizardProps): react_jsx_runtime.JSX.Element;
46
56
 
47
57
  type ProductVariant = "sandbox";
48
58
  interface StandalonePricingPageProps {
@@ -111,4 +121,4 @@ interface ProfilesPageProps {
111
121
  }
112
122
  declare function ProfilesPage({ apiClient, tier, maxProfiles, onCompareClick, title, }: ProfilesPageProps): react_jsx_runtime.JSX.Element;
113
123
 
114
- export { BillingPage, type BillingPageData, type BillingPageProps, type EnvironmentOption, type ProductVariant$1 as ProductVariant, type Profile, type ProfileFormData, type ProfileMetrics, ProfilesPage, type ProfilesPageProps, type ProvisioningConfig, ProvisioningWizard, type ProvisioningWizardProps, StandalonePricingPage, type StandalonePricingPageProps };
124
+ export { BillingPage, type BillingPageData, type BillingPageProps, type EnvironmentEntry, type EnvironmentOption, type ProductVariant$1 as ProductVariant, type Profile, type ProfileFormData, type ProfileMetrics, ProfilesPage, type ProfilesPageProps, type ProvisioningConfig, ProvisioningWizard, type ProvisioningWizardProps, StandalonePricingPage, type StandalonePricingPageProps, resolveEnvironment };
package/dist/pages.js CHANGED
@@ -299,6 +299,37 @@ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
299
299
  function MaterialIcon({ name, className }) {
300
300
  return /* @__PURE__ */ jsx2("span", { className: cn("material-symbols-outlined", className), style: { fontVariationSettings: "'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24" }, children: name });
301
301
  }
302
+ var STACK_DISPLAY = {
303
+ universal: { name: "Universal", abbr: "U", color: "violet", textClass: "text-violet-400", bgClass: "bg-violet-500/10" },
304
+ ethereum: { name: "Ethereum", abbr: "\u039E", color: "blue", textClass: "text-blue-400", bgClass: "bg-blue-500/10" },
305
+ solana: { name: "Solana", abbr: "S", color: "green", textClass: "text-green-400", bgClass: "bg-green-500/10" },
306
+ tangle: { name: "Tangle", abbr: "T", color: "purple", textClass: "text-purple-400", bgClass: "bg-purple-500/10" },
307
+ "ai-sdk": { name: "AI SDK", abbr: "AI", color: "cyan", textClass: "text-cyan-400", bgClass: "bg-cyan-500/10" },
308
+ rust: { name: "Rust", abbr: "Rs", color: "orange", textClass: "text-orange-400", bgClass: "bg-orange-500/10" }
309
+ };
310
+ function resolveEnvironment(env) {
311
+ const display = STACK_DISPLAY[env.id];
312
+ const name = display?.name ?? (env.id.length > 0 ? env.id.charAt(0).toUpperCase() + env.id.slice(1).replace(/-/g, " ") : "Unknown");
313
+ const abbr = display?.abbr ?? (env.id.length > 0 ? env.id[0].toUpperCase() : "?");
314
+ const color = display?.color ?? "slate";
315
+ const textClass = display?.textClass ?? "text-slate-400";
316
+ return {
317
+ id: env.id,
318
+ name,
319
+ description: env.description ?? `${name} development environment`,
320
+ icon: /* @__PURE__ */ jsx2("span", { className: `${textClass} text-2xl font-bold`, children: abbr }),
321
+ color
322
+ };
323
+ }
324
+ var COLOR_BG_CLASS = {
325
+ green: "bg-green-500/10",
326
+ blue: "bg-blue-500/10",
327
+ orange: "bg-orange-500/10",
328
+ violet: "bg-violet-500/10",
329
+ purple: "bg-purple-500/10",
330
+ cyan: "bg-cyan-500/10",
331
+ slate: "bg-slate-500/10"
332
+ };
302
333
  var defaultEnvironments = [
303
334
  { id: "node", name: "Node.js", description: "v20.x LTS with optimized runtime for asynchronous event-driven agents.", icon: /* @__PURE__ */ jsx2("span", { className: "text-green-400 text-2xl font-bold", children: "N" }), color: "green" },
304
335
  { id: "python", name: "Python", description: "v3.11 pre-installed with PyTorch and common data science libraries.", icon: /* @__PURE__ */ jsx2("span", { className: "text-blue-400 text-2xl font-bold", children: "Py" }), color: "blue" },
@@ -316,13 +347,36 @@ function calcCost(cpu, ram) {
316
347
  return cost.toFixed(2);
317
348
  }
318
349
  function ProvisioningWizard({
319
- environments = defaultEnvironments,
350
+ environments: environmentsProp,
351
+ onLoadEnvironments,
320
352
  onSubmit,
321
353
  onBack,
322
354
  className
323
355
  }) {
356
+ const [environments, setEnvironments] = React2.useState(
357
+ environmentsProp ?? defaultEnvironments
358
+ );
359
+ const [loading, setLoading] = React2.useState(!environmentsProp && !!onLoadEnvironments);
324
360
  const [step, setStep] = React2.useState(0);
325
361
  const [selectedEnv, setSelectedEnv] = React2.useState(environments[0]?.id ?? "");
362
+ const onLoadRef = React2.useRef(onLoadEnvironments);
363
+ onLoadRef.current = onLoadEnvironments;
364
+ React2.useEffect(() => {
365
+ if (environmentsProp || !onLoadRef.current) return;
366
+ let cancelled = false;
367
+ onLoadRef.current().then((entries) => {
368
+ if (cancelled || !entries?.length) return;
369
+ const resolved = entries.map(resolveEnvironment);
370
+ setEnvironments(resolved);
371
+ setSelectedEnv(resolved[0].id);
372
+ }).catch(() => {
373
+ }).finally(() => {
374
+ if (!cancelled) setLoading(false);
375
+ });
376
+ return () => {
377
+ cancelled = true;
378
+ };
379
+ }, [environmentsProp]);
326
380
  const [cpuCores, setCpuCores] = React2.useState(4);
327
381
  const [ramGB, setRamGB] = React2.useState(16);
328
382
  const [storageGB, setStorageGB] = React2.useState(128);
@@ -357,7 +411,7 @@ function ProvisioningWizard({
357
411
  /* @__PURE__ */ jsx2("div", { className: "w-10 h-10 rounded-lg bg-md3-primary/10 flex items-center justify-center text-md3-primary", children: /* @__PURE__ */ jsx2(MaterialIcon, { name: "layers" }) }),
358
412
  /* @__PURE__ */ jsx2("h2", { className: "text-xl font-bold", children: "Environment Selection" })
359
413
  ] }),
360
- /* @__PURE__ */ jsx2("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4", children: environments.map((env) => /* @__PURE__ */ jsxs2(
414
+ loading ? /* @__PURE__ */ jsx2("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4", children: [1, 2, 3].map((i) => /* @__PURE__ */ jsx2("div", { className: "h-32 rounded-xl bg-surface-container animate-pulse" }, i)) }) : /* @__PURE__ */ jsx2("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4", children: environments.map((env) => /* @__PURE__ */ jsxs2(
361
415
  "button",
362
416
  {
363
417
  type: "button",
@@ -368,7 +422,7 @@ function ProvisioningWizard({
368
422
  ),
369
423
  children: [
370
424
  /* @__PURE__ */ jsxs2("div", { className: "flex justify-between items-start mb-4", children: [
371
- /* @__PURE__ */ jsx2("div", { className: cn("w-12 h-12 rounded-full flex items-center justify-center", `bg-${env.color}-500/10`), children: env.icon }),
425
+ /* @__PURE__ */ jsx2("div", { className: cn("w-12 h-12 rounded-full flex items-center justify-center", COLOR_BG_CLASS[env.color] ?? "bg-slate-500/10"), children: env.icon }),
372
426
  /* @__PURE__ */ jsx2("div", { className: cn("w-5 h-5 rounded-full border-2 flex items-center justify-center", selectedEnv === env.id ? "border-md3-primary" : "border-outline-variant/30"), children: selectedEnv === env.id && /* @__PURE__ */ jsx2("div", { className: "w-2.5 h-2.5 bg-md3-primary rounded-full" }) })
373
427
  ] }),
374
428
  /* @__PURE__ */ jsx2("h3", { className: "font-bold text-lg mb-1", children: env.name }),
@@ -546,7 +600,7 @@ function ProvisioningWizard({
546
600
  /* @__PURE__ */ jsxs2("div", { className: "text-slate-300", children: [
547
601
  /* @__PURE__ */ jsx2("span", { className: "text-violet-400", children: "\u2713" }),
548
602
  " Platform: ",
549
- /* @__PURE__ */ jsx2("span", { className: "text-white", children: environments.find((e) => e.id === selectedEnv)?.name ?? "Node.js" })
603
+ /* @__PURE__ */ jsx2("span", { className: "text-white", children: environments.find((e) => e.id === selectedEnv)?.name ?? selectedEnv })
550
604
  ] }),
551
605
  /* @__PURE__ */ jsxs2("div", { className: "text-slate-300", children: [
552
606
  /* @__PURE__ */ jsx2("span", { className: "text-violet-400", children: "\u2713" }),
@@ -1502,5 +1556,6 @@ export {
1502
1556
  BillingPage,
1503
1557
  ProfilesPage,
1504
1558
  ProvisioningWizard,
1505
- StandalonePricingPage
1559
+ StandalonePricingPage,
1560
+ resolveEnvironment
1506
1561
  };
@@ -22,11 +22,6 @@ import {
22
22
  UploadProgress,
23
23
  useToast
24
24
  } from "./chunk-CSIXZEKN.js";
25
- import {
26
- Avatar,
27
- AvatarFallback,
28
- AvatarImage
29
- } from "./chunk-B26TQ7SA.js";
30
25
  import {
31
26
  Dialog,
32
27
  DialogClose,
@@ -65,6 +60,9 @@ import {
65
60
  TangleKnot
66
61
  } from "./chunk-OKCIKTXQ.js";
67
62
  import {
63
+ Avatar,
64
+ AvatarFallback,
65
+ AvatarImage,
68
66
  DropdownMenu,
69
67
  DropdownMenuCheckboxItem,
70
68
  DropdownMenuContent,
@@ -80,7 +78,7 @@ import {
80
78
  DropdownMenuSubContent,
81
79
  DropdownMenuSubTrigger,
82
80
  DropdownMenuTrigger
83
- } from "./chunk-MCGKDCOR.js";
81
+ } from "./chunk-IW2JZCOC.js";
84
82
  import {
85
83
  Progress,
86
84
  Skeleton,
package/dist/sdk-hooks.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  useSessionStream,
8
8
  useSidecarAuth,
9
9
  useToolCallStream
10
- } from "./chunk-FOQTE67I.js";
10
+ } from "./chunk-FJLS7PNT.js";
11
11
  import "./chunk-CCKNIAS7.js";
12
12
  import "./chunk-OEX7NZE3.js";
13
13
  import {
@@ -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",
@@ -61,7 +61,7 @@ interface UsePtySessionReturn {
61
61
  * Protocol:
62
62
  * - POST /terminals → create session → { data: { sessionId } }
63
63
  * - GET /terminals/{id}/stream → SSE output (raw PTY with ANSI codes)
64
- * - POST /terminals/{id}/execute → send command { command: "..." }
64
+ * - POST /terminals/{id}/input → send input { data: "..." }
65
65
  * - DELETE /terminals/{id} → close session
66
66
  */
67
67
  declare function usePtySession({ apiUrl, token, onData }: UsePtySessionOptions): UsePtySessionReturn;
@@ -145,6 +145,8 @@ interface RuntimePaneProps {
145
145
  subtitle?: string;
146
146
  statusBanner?: StatusBannerProps;
147
147
  statusBar?: StatusBarProps;
148
+ /** When provided, replaces the entire 2-column grid with custom content (e.g. a full-pane TerminalView). */
149
+ content?: React.ReactNode;
148
150
  terminal?: TerminalProps;
149
151
  audit?: React.ReactNode;
150
152
  inspector?: React.ReactNode;
@@ -155,7 +157,7 @@ interface RuntimePaneProps {
155
157
  * RuntimePane — shared operating surface for sandbox session state, terminal
156
158
  * output, audit results, and runtime metadata.
157
159
  */
158
- declare function RuntimePane({ title, subtitle, statusBanner, statusBar, terminal, audit, inspector, footer, className, }: RuntimePaneProps): react_jsx_runtime.JSX.Element;
160
+ declare function RuntimePane({ title, subtitle, statusBanner, statusBar, content, terminal, audit, inspector, footer, className, }: RuntimePaneProps): react_jsx_runtime.JSX.Element;
159
161
 
160
162
  interface SessionSidebarItem {
161
163
  id: string;
package/dist/workspace.js CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  StatusBar,
11
11
  TerminalPanel,
12
12
  WorkspaceLayout
13
- } from "./chunk-CREVWUCA.js";
13
+ } from "./chunk-DJEZKF5A.js";
14
14
  import "./chunk-OEX7NZE3.js";
15
15
  import "./chunk-MUOL44AE.js";
16
16
  import "./chunk-6H3EFUUC.js";
@@ -21,7 +21,7 @@ import "./chunk-CJ2RYVZH.js";
21
21
  import "./chunk-BX6AQMUS.js";
22
22
  import "./chunk-YDBXQQLC.js";
23
23
  import "./chunk-TQN3VR4F.js";
24
- import "./chunk-6NYG2R7V.js";
24
+ import "./chunk-HYLTXGOI.js";
25
25
  import {
26
26
  ArtifactPane
27
27
  } from "./chunk-W4LM3QYZ.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/sandbox-ui",
3
- "version": "0.3.11",
3
+ "version": "0.3.13",
4
4
  "description": "Unified UI component library for Tangle Sandbox — primitives, chat, dashboard, terminal, editor, and workspace components",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,47 +0,0 @@
1
- import {
2
- cn
3
- } from "./chunk-RQHJBTEU.js";
4
-
5
- // src/primitives/avatar.tsx
6
- import * as AvatarPrimitive from "@radix-ui/react-avatar";
7
- import * as React from "react";
8
- import { jsx } from "react/jsx-runtime";
9
- var Avatar = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
10
- AvatarPrimitive.Root,
11
- {
12
- ref,
13
- className: cn(
14
- "relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
15
- className
16
- ),
17
- ...props
18
- }
19
- ));
20
- Avatar.displayName = AvatarPrimitive.Root.displayName;
21
- var AvatarImage = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
22
- AvatarPrimitive.Image,
23
- {
24
- ref,
25
- className: cn("aspect-square h-full w-full", className),
26
- ...props
27
- }
28
- ));
29
- AvatarImage.displayName = AvatarPrimitive.Image.displayName;
30
- var AvatarFallback = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
31
- AvatarPrimitive.Fallback,
32
- {
33
- ref,
34
- className: cn(
35
- "flex h-full w-full items-center justify-center rounded-full bg-muted font-medium text-sm",
36
- className
37
- ),
38
- ...props
39
- }
40
- ));
41
- AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
42
-
43
- export {
44
- Avatar,
45
- AvatarImage,
46
- AvatarFallback
47
- };