@tangle-network/sandbox-ui 0.113.7 → 0.115.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 (107) hide show
  1. package/README.md +40 -0
  2. package/dist/WorkflowGraph-B-NsdYz_.js +1961 -0
  3. package/dist/assets.d.ts +214 -206
  4. package/dist/assets.js +1057 -908
  5. package/dist/auth-CWe17Hly.js +37 -0
  6. package/dist/auth.d.ts +2 -30
  7. package/dist/auth.js +2 -15
  8. package/dist/chat-BOvFAe6p.js +903 -0
  9. package/dist/chat.d.ts +2 -230
  10. package/dist/chat.js +2 -34
  11. package/dist/connectors.d.ts +52 -49
  12. package/dist/connectors.js +595 -643
  13. package/dist/dashboard-CZ3VgNPR.js +4969 -0
  14. package/dist/dashboard.d.ts +4 -1297
  15. package/dist/dashboard.js +4 -152
  16. package/dist/editor.d.ts +2 -1
  17. package/dist/editor.js +2 -31
  18. package/dist/files.d.ts +2 -6
  19. package/dist/files.js +2 -33
  20. package/dist/globals.css +75 -3
  21. package/dist/hooks.d.ts +146 -148
  22. package/dist/hooks.js +222 -55
  23. package/dist/index-CKRaj1pM.d.ts +776 -0
  24. package/dist/index-CXX5IpH2.d.ts +2 -0
  25. package/dist/index-CesPlOyx.d.ts +367 -0
  26. package/dist/index-DPePq7c8.d.ts +1340 -0
  27. package/dist/index-DiyLLZuJ.d.ts +230 -0
  28. package/dist/index-DvmZLMT1.d.ts +30 -0
  29. package/dist/index-PRM636Ex.d.ts +86 -0
  30. package/dist/index.d.ts +21 -33
  31. package/dist/index.js +21 -701
  32. package/dist/info-panel-C9cqDzOL.js +594 -0
  33. package/dist/integrations.d.ts +133 -141
  34. package/dist/integrations.js +491 -673
  35. package/dist/markdown.d.ts +2 -1
  36. package/dist/markdown.js +2 -13
  37. package/dist/model-I-NIxeM-.js +1250 -0
  38. package/dist/model-brand-B9A4H9pJ.d.ts +98 -0
  39. package/dist/model-brand-hMyDTUqB.js +624 -0
  40. package/dist/motion-DkyBRJb9.js +37 -0
  41. package/dist/openui.d.ts +2 -1
  42. package/dist/openui.js +2 -7
  43. package/dist/pages.d.ts +307 -300
  44. package/dist/pages.js +4404 -4181
  45. package/dist/primitives-Dh1vG6J3.js +113 -0
  46. package/dist/primitives.d.ts +2 -74
  47. package/dist/primitives.js +2 -204
  48. package/dist/provider-logo-DjqmConF.js +311 -0
  49. package/dist/run.d.ts +2 -1
  50. package/dist/run.js +2 -23
  51. package/dist/sdk-hooks.d.ts +3 -4
  52. package/dist/sdk-hooks.js +3 -31
  53. package/dist/sidecar-DgH_vQ6m.d.ts +9 -0
  54. package/dist/stores.d.ts +14 -15
  55. package/dist/stores.js +13 -81
  56. package/dist/styles.css +75 -3
  57. package/dist/template-card-L-4gmjx2.d.ts +90 -0
  58. package/dist/terminal-CN9ZgHRt.js +197 -0
  59. package/dist/terminal.d.ts +60 -60
  60. package/dist/terminal.js +2 -10
  61. package/dist/tokens.css +51 -0
  62. package/dist/types.d.ts +4 -11
  63. package/dist/types.js +0 -1
  64. package/dist/use-pty-session-C8cE0adT.js +669 -0
  65. package/dist/use-sidecar-auth-CCTJcrq7.d.ts +145 -0
  66. package/dist/use-sidecar-auth-DkdcufOz.js +742 -0
  67. package/dist/utils-DzWbktWG.js +2 -0
  68. package/dist/utils.d.ts +2 -1
  69. package/dist/utils.js +2 -37
  70. package/dist/workbench-ztU44Jt2.js +8455 -0
  71. package/dist/workbench.d.ts +2 -310
  72. package/dist/workbench.js +2 -44
  73. package/dist/workflows.d.ts +341 -339
  74. package/dist/workflows.js +74 -109
  75. package/dist/workspace-B6AtI6ld.js +2510 -0
  76. package/dist/workspace.d.ts +2 -761
  77. package/dist/workspace.js +2 -51
  78. package/package.json +46 -40
  79. package/dist/WorkflowGraph-2QOORYIR.js +0 -1722
  80. package/dist/chunk-2BUPSB7O.js +0 -0
  81. package/dist/chunk-3KBNPQQF.js +0 -2697
  82. package/dist/chunk-3LIXVEEE.js +0 -279
  83. package/dist/chunk-72UF2H5H.js +0 -707
  84. package/dist/chunk-AI25G5MX.js +0 -944
  85. package/dist/chunk-ANSC5AFC.js +0 -314
  86. package/dist/chunk-AZ3AWMTM.js +0 -8
  87. package/dist/chunk-BGVEHENC.js +0 -10
  88. package/dist/chunk-CZ7CSFO4.js +0 -39
  89. package/dist/chunk-DYXXYGS4.js +0 -4700
  90. package/dist/chunk-EI44GEQ5.js +0 -6
  91. package/dist/chunk-IACRDXER.js +0 -219
  92. package/dist/chunk-IOB2PW5Z.js +0 -55
  93. package/dist/chunk-M4K7ZGR2.js +0 -24
  94. package/dist/chunk-MYZAW4RX.js +0 -665
  95. package/dist/chunk-OMUIPJQZ.js +0 -555
  96. package/dist/chunk-RQZRXKMR.js +0 -398
  97. package/dist/chunk-SOKKTB7W.js +0 -230
  98. package/dist/chunk-TADGS4Q7.js +0 -1010
  99. package/dist/chunk-UCQNOUN3.js +0 -7964
  100. package/dist/chunk-ULPLRBMF.js +0 -34
  101. package/dist/chunk-WID73FPH.js +0 -89
  102. package/dist/chunk-X3YXP7FG.js +0 -38
  103. package/dist/logo-DiAjq759.d.ts +0 -15
  104. package/dist/model-brand-BNnaUKKZ.d.ts +0 -99
  105. package/dist/ports-list-CDIvTNnX.d.ts +0 -17
  106. package/dist/sdk-hooks-Djkjq4cp.d.ts +0 -145
  107. package/dist/template-card-Bn-Bw5xC.d.ts +0 -87
@@ -1,761 +1,2 @@
1
- import * as React$1 from 'react';
2
- import { ReactNode, HTMLAttributes, Ref } from 'react';
3
- export { ArtifactPane, ArtifactPaneProps } from '@tangle-network/ui/primitives';
4
- import { FileNode, FileTreeVisibilityOptions, FileTabData } from '@tangle-network/ui/files';
5
- import { SessionProjectKey, ActiveSessionStatus, ActiveSessionRecord } from '@tangle-network/ui/stores';
6
- import { LucideIcon } from 'lucide-react';
7
- import { ChatContainerProps } from '@tangle-network/ui/chat';
8
- import { OpenUIComponentNode, OpenUIAction } from '@tangle-network/ui/openui';
9
-
10
- interface WorkspaceLayoutProps {
11
- /** Left sidebar content (file tree, navigation) */
12
- left?: ReactNode;
13
- /** Left sidebar header */
14
- leftHeader?: ReactNode;
15
- /** Center main content */
16
- center: ReactNode;
17
- /** Center header (session name, etc.) */
18
- centerHeader?: ReactNode;
19
- /** Center footer (input bar) */
20
- centerFooter?: ReactNode;
21
- /** Right panel content (preview, editor) */
22
- right?: ReactNode;
23
- /** Right panel header */
24
- rightHeader?: ReactNode;
25
- /** Bottom panel (terminal) */
26
- bottom?: ReactNode;
27
- /** Bottom panel header */
28
- bottomHeader?: ReactNode;
29
- /** Default left panel state */
30
- defaultLeftOpen?: boolean;
31
- /** Default right panel state */
32
- defaultRightOpen?: boolean;
33
- /** Default bottom panel state */
34
- defaultBottomOpen?: boolean;
35
- /** Default left panel width in px */
36
- defaultLeftWidth?: number;
37
- /** Default right panel width in px */
38
- defaultRightWidth?: number;
39
- /** Default bottom panel height in px */
40
- defaultBottomHeight?: number;
41
- /** Minimum left panel width in px */
42
- minLeftWidth?: number;
43
- /** Maximum left panel width in px */
44
- maxLeftWidth?: number;
45
- /** Minimum right panel width in px */
46
- minRightWidth?: number;
47
- /** Maximum right panel width in px */
48
- maxRightWidth?: number;
49
- /**
50
- * Width in px the center column keeps on desktop. When the shell is too
51
- * narrow for the stored pane widths, the right pane yields down to its
52
- * minimum first, then the left; the stored widths return when room does.
53
- */
54
- minCenterWidth?: number;
55
- /** Minimum bottom panel height in px */
56
- minBottomHeight?: number;
57
- /** Maximum bottom panel height in px */
58
- maxBottomHeight?: number;
59
- /** Persist panel state and sizes in localStorage */
60
- persistenceKey?: string;
61
- /** Disable resize handles */
62
- resizable?: boolean;
63
- /** Visual theme for sandbox surfaces */
64
- theme?: "vault";
65
- /** Density mode for control sizing */
66
- density?: "comfortable" | "compact";
67
- /** Accessible label for the left panel */
68
- leftLabel?: string;
69
- /** Accessible label for the right panel */
70
- rightLabel?: string;
71
- /** Accessible label for the bottom panel */
72
- bottomLabel?: string;
73
- /**
74
- * Controlled open state for the left pane. Omit to keep the pane
75
- * uncontrolled (`defaultLeftOpen`, persisted under `persistenceKey`).
76
- */
77
- leftOpen?: boolean;
78
- /** Called with the next state whenever the layout would open or close the left pane. */
79
- onLeftOpenChange?: (open: boolean) => void;
80
- /** Controlled open state for the right pane; see `leftOpen`. */
81
- rightOpen?: boolean;
82
- /** Called with the next state whenever the layout would open or close the right pane. */
83
- onRightOpenChange?: (open: boolean) => void;
84
- /**
85
- * ⌘B / Ctrl+B toggles the left pane and ⌘E / Ctrl+E the right pane. A
86
- * chord with Alt or Shift, or one fired while an input, textarea, select, or
87
- * contentEditable has focus, is left to the page. Off by default.
88
- */
89
- keyboardShortcuts?: boolean;
90
- /**
91
- * Replaces the default "Open left panel" button at the top-left of the
92
- * center pane while a left pane is provided but closed.
93
- */
94
- leftCollapsedControl?: ReactNode;
95
- /** Extra classes for the left pane's scrolling content wrapper, e.g. `py-0` so a rail owns its own gutter. */
96
- leftContentClassName?: string;
97
- /** Extra classes for the right pane's scrolling content wrapper. */
98
- rightContentClassName?: string;
99
- /**
100
- * `always` (default) keeps the center header row whenever a side or bottom
101
- * pane exists, so pane headers line up across the shell even while the row
102
- * is empty. `auto` renders the row only while it has content: a
103
- * `centerHeader`, or an open-pane toggle for a closed pane.
104
- */
105
- centerHeaderVisibility?: "always" | "auto";
106
- className?: string;
107
- }
108
- declare function WorkspaceLayout({ left, leftHeader, center, centerHeader, centerFooter, right, rightHeader, bottom, bottomHeader, defaultLeftOpen, defaultRightOpen, defaultBottomOpen, defaultLeftWidth, defaultRightWidth, defaultBottomHeight, minLeftWidth, maxLeftWidth, minRightWidth, maxRightWidth, minCenterWidth, minBottomHeight, maxBottomHeight, persistenceKey, resizable, theme, density, leftLabel, rightLabel, bottomLabel, leftOpen: leftOpenProp, onLeftOpenChange, rightOpen: rightOpenProp, onRightOpenChange, keyboardShortcuts, leftCollapsedControl, leftContentClassName, rightContentClassName, centerHeaderVisibility, className, }: WorkspaceLayoutProps): React$1.JSX.Element;
109
-
110
- type WorkspacePaneHeaderProps = HTMLAttributes<HTMLDivElement>;
111
- /**
112
- * The shared 56px header row for top-level workspace panes and drawers.
113
- * Bottom runtime panels intentionally use their own compact header.
114
- */
115
- declare function WorkspacePaneHeader({ className, ...props }: WorkspacePaneHeaderProps): React$1.JSX.Element;
116
-
117
- interface DirectoryPaneProps {
118
- root: FileNode;
119
- selectedPath?: string;
120
- onSelect?: (path: string, node: FileNode) => void;
121
- onRefresh?: () => void;
122
- onUpload?: () => void;
123
- title?: string;
124
- subtitle?: string;
125
- defaultExpanded?: boolean;
126
- searchPlaceholder?: string;
127
- visibility?: FileTreeVisibilityOptions;
128
- className?: string;
129
- }
130
- /**
131
- * DirectoryPane — searchable file-system navigation surface for sandbox
132
- * sessions.
133
- */
134
- declare function DirectoryPane({ root, selectedPath, onSelect, onRefresh, onUpload, title, subtitle, defaultExpanded, searchPlaceholder, visibility, className, }: DirectoryPaneProps): React$1.JSX.Element;
135
-
136
- /**
137
- * StatusBanner — full-width notification banner for connection/provisioning states.
138
- */
139
- type BannerType = "provisioning" | "connecting" | "error" | "warning" | "success" | "info";
140
- interface StatusBannerProps {
141
- type: BannerType;
142
- message: string;
143
- detail?: string;
144
- onDismiss?: () => void;
145
- className?: string;
146
- }
147
- declare function StatusBanner({ type, message, detail, onDismiss, className }: StatusBannerProps): React$1.JSX.Element;
148
-
149
- /**
150
- * StatusBar — compact bottom bar: connection state, file/artifact context
151
- * badges, credits. The active model lives in the input box, not here.
152
- */
153
- interface ContextBadge {
154
- id: string;
155
- label: string;
156
- count?: number;
157
- }
158
- interface StatusBarProps {
159
- /** @deprecated The model now lives in the input box; the status bar no longer
160
- * renders it. Retained so existing callers keep type-checking. */
161
- modelLabel?: string;
162
- /** @deprecated See `modelLabel`. */
163
- onModelClick?: () => void;
164
- credits?: number;
165
- contextBadges?: ContextBadge[];
166
- onRemoveBadge?: (id: string) => void;
167
- status?: "connected" | "connecting" | "disconnected" | "provisioning";
168
- className?: string;
169
- }
170
- declare function StatusBar({ credits, contextBadges, onRemoveBadge, status, className, }: StatusBarProps): React$1.JSX.Element;
171
-
172
- /**
173
- * Terminal — read-only terminal output panel.
174
- *
175
- * Shows agent's bash command output with basic ANSI color support.
176
- * Collapsible, auto-scrolls to bottom.
177
- */
178
- interface TerminalLine {
179
- id: string;
180
- text: string;
181
- type: "command" | "stdout" | "stderr" | "system";
182
- timestamp?: number;
183
- }
184
- interface TerminalProps {
185
- lines: TerminalLine[];
186
- title?: string;
187
- isCollapsed?: boolean;
188
- onToggle?: () => void;
189
- onClose?: () => void;
190
- maxHeight?: number;
191
- className?: string;
192
- }
193
- declare function TerminalPanel({ lines, title, isCollapsed, onToggle, onClose, maxHeight, className, }: TerminalProps): React$1.JSX.Element;
194
-
195
- interface RuntimePaneProps {
196
- title?: string;
197
- subtitle?: string;
198
- statusBanner?: StatusBannerProps;
199
- statusBar?: StatusBarProps;
200
- /** When provided, replaces the entire 2-column grid with custom content (e.g. a full-pane TerminalView). */
201
- content?: React.ReactNode;
202
- terminal?: TerminalProps;
203
- audit?: React.ReactNode;
204
- inspector?: React.ReactNode;
205
- footer?: React.ReactNode;
206
- className?: string;
207
- }
208
- /**
209
- * RuntimePane — shared operating surface for sandbox session state, terminal
210
- * output, audit results, and runtime metadata.
211
- */
212
- declare function RuntimePane({ title, subtitle, statusBanner, statusBar, content, terminal, audit, inspector, footer, className, }: RuntimePaneProps): React$1.JSX.Element;
213
-
214
- /**
215
- * Optimistic session/thread list: reflect a just-created / renamed / deleted
216
- * item in the sidebar INSTANTLY, before the server loader round-trips.
217
- *
218
- * The shell loader is the source of truth and reconciles in the background
219
- * (typically the app calls `useRevalidator().revalidate()` after its mutation
220
- * fetch settles). Until that lands, a local mirror of the loader items carries
221
- * the optimistic edit so a delete / rename / new-thread does not feel broken
222
- * for the duration of a D1 round-trip.
223
- *
224
- * Two ways to drive it, usable together:
225
- * 1. A window `CustomEvent` (default name {@link SESSION_CREATED_EVENT}) — the
226
- * surface that creates a thread (often a different route from the sidebar's
227
- * route) dispatches it; the sidebar prepends the item with no prop wiring.
228
- * 2. The imperative {@link SessionOptimisticController} returned here — the
229
- * sidebar's own action handlers (rename / delete / pin) call it directly.
230
- */
231
- /** Default window-event name for "a session/thread was just created". */
232
- declare const SESSION_CREATED_EVENT = "sandbox-thread-created";
233
- /**
234
- * Payload of a {@link SESSION_CREATED_EVENT}. Only `id` + `title` are required;
235
- * everything else mirrors {@link SessionSidebarItem}. `updatedAt` defaults to
236
- * now so the new item sorts to the top.
237
- */
238
- interface SessionCreatedDetail extends Partial<Omit<SessionSidebarItem, "id" | "title">> {
239
- id: string;
240
- title: string;
241
- }
242
- /** Dispatch the shared "session created" event so any mounted sidebar updates. */
243
- declare function dispatchSessionCreated(detail: SessionCreatedDetail, eventName?: string): void;
244
- /** Imperative handle for driving optimistic edits from a mutation handler. */
245
- interface SessionOptimisticController {
246
- /** Prepend (or move to top) an item — call before the create fetch settles. */
247
- add: (item: SessionCreatedDetail) => void;
248
- /** Patch an existing item in place — e.g. a rename or category change. */
249
- update: (id: string, patch: Partial<SessionSidebarItem>) => void;
250
- /** Drop an item — call before the delete fetch settles. */
251
- remove: (id: string) => void;
252
- /** Discard all optimistic edits and snap back to the loader items. */
253
- reset: () => void;
254
- }
255
- interface UseOptimisticSessionItemsOptions {
256
- /**
257
- * Listen for the shared window create-event and prepend its item. Set `false`
258
- * to drive optimistic state purely through the imperative controller.
259
- * Defaults to `true`.
260
- */
261
- listenForCreate?: boolean;
262
- /** Override the window event name to listen for. */
263
- eventName?: string;
264
- }
265
- /**
266
- * Mirror `items` with optimistic add/update/remove on top. The mirror re-syncs
267
- * whenever `items` changes (the loader is authoritative), so an optimistic edit
268
- * is naturally superseded once the server result arrives.
269
- */
270
- declare function useOptimisticSessionItems(items: SessionSidebarItem[], options?: UseOptimisticSessionItemsOptions): {
271
- items: SessionSidebarItem[];
272
- controller: SessionOptimisticController;
273
- };
274
-
275
- interface SessionSidebarItem {
276
- id: string;
277
- title: string;
278
- subtitle?: string;
279
- href?: string;
280
- updatedAt?: string | number | Date;
281
- projectId?: SessionProjectKey | null;
282
- status?: ActiveSessionStatus;
283
- category?: string;
284
- isPinned?: boolean;
285
- badges?: SessionSidebarBadge[];
286
- /**
287
- * Glyph rendered in a 16×20 slot before the title — a harness mark, for
288
- * example. While an icon is present the status dot becomes a 6px badge on
289
- * the icon's corner instead of a leading dot.
290
- */
291
- icon?: ReactNode;
292
- /**
293
- * Muted 12px line under the title, e.g. `harness · age`. When omitted and
294
- * `showUpdatedAt` is set, the row renders `updatedAt` as a relative age here.
295
- */
296
- meta?: ReactNode;
297
- }
298
- interface SessionSidebarBadge {
299
- id: string;
300
- label: string;
301
- tone?: "neutral" | "accent" | "success" | "warning" | "danger";
302
- }
303
- interface SessionSidebarLink {
304
- id: string;
305
- label: string;
306
- href?: string;
307
- icon?: "vault" | "settings" | "back";
308
- }
309
- interface SessionSidebarFilter {
310
- id: string;
311
- label: string;
312
- matches: (item: SessionSidebarItem, options: {
313
- session: ActiveSessionRecord | null;
314
- isActive: boolean;
315
- }) => boolean;
316
- }
317
- type SessionSidebarVariant = "default" | "quiet";
318
- type SessionSidebarGroupBy = "none" | "status";
319
- interface SessionSidebarProps {
320
- title: string;
321
- subtitle?: string;
322
- projectId?: SessionProjectKey | null;
323
- items: SessionSidebarItem[];
324
- currentItemId?: string | null;
325
- createLabel?: string;
326
- onCreate?: () => void;
327
- onSelectItem?: (item: SessionSidebarItem) => void;
328
- onSelectLink?: (link: SessionSidebarLink) => void;
329
- links?: SessionSidebarLink[];
330
- className?: string;
331
- emptyMessage?: string;
332
- searchPlaceholder?: string;
333
- enableSearch?: boolean;
334
- activityMonitor?: ReactNode;
335
- filters?: SessionSidebarFilter[];
336
- defaultFilterId?: string;
337
- resizable?: boolean;
338
- defaultWidth?: number;
339
- minWidth?: number;
340
- maxWidth?: number;
341
- onWidthChange?: (width: number) => void;
342
- renderItemActions?: (item: SessionSidebarItem, options: {
343
- session: ActiveSessionRecord | null;
344
- isActive: boolean;
345
- }) => ReactNode;
346
- /**
347
- * Opt into optimistic item updates: the sidebar keeps a local mirror of
348
- * `items` so a just-created / renamed / deleted thread shows instantly,
349
- * before the loader round-trips. Pass `true` for defaults, or an options
350
- * object to tune the window create-event. Off by default — existing callers
351
- * render `items` verbatim and are unaffected.
352
- */
353
- optimistic?: boolean | UseOptimisticSessionItemsOptions;
354
- /**
355
- * Ref to the imperative optimistic controller (`add` / `update` / `remove` /
356
- * `reset`). Drive optimistic edits from the consumer's own rename/delete/pin
357
- * handlers. Only populated when `optimistic` is enabled.
358
- */
359
- optimisticRef?: Ref<SessionOptimisticController | null>;
360
- /**
361
- * `default` is the branded panel: icon-in-a-box header, running-count chip,
362
- * bordered search field, accent-filled selected row. `quiet` is the rail of a
363
- * three-pane shell: the header is one row (a "new" text button plus the
364
- * optional `onCollapse` button), rows are `rounded-lg` with a surface fill
365
- * for hover and selection, only non-neutral badges render, and search is a
366
- * borderless field.
367
- */
368
- variant?: SessionSidebarVariant;
369
- /**
370
- * `status` partitions the list into "Needs input" (`attention-needed`),
371
- * "Failed" (`error`), "Working" (`running`), and "Done" (everything else),
372
- * in that order. Group labels render only while more than one group has
373
- * items. Within a group the sort is unchanged: pinned first, then activity.
374
- * Status comes from the active-sessions store record when one exists for the
375
- * id, else from `item.status`.
376
- */
377
- groupBy?: SessionSidebarGroupBy;
378
- /** Render `updatedAt` as a relative age under the title for rows with no `meta`. */
379
- showUpdatedAt?: boolean;
380
- /** Renders a "Hide chats" button in the `quiet` header. */
381
- onCollapse?: () => void;
382
- /**
383
- * Fill the parent instead of carrying the sidebar's own width: no inline
384
- * width, `h-full w-full`. Use when a layout owns the pane size. Ignored while
385
- * `resizable`, which needs the inline width it drags.
386
- */
387
- fill?: boolean;
388
- }
389
- declare function SessionSidebar({ title, subtitle, projectId, items, currentItemId, createLabel, onCreate, onSelectItem, onSelectLink, links, className, emptyMessage, searchPlaceholder, enableSearch, activityMonitor, filters, defaultFilterId, resizable, defaultWidth, minWidth, maxWidth, onWidthChange, renderItemActions, optimistic, optimisticRef, variant, groupBy, showUpdatedAt, onCollapse, fill, }: SessionSidebarProps): React$1.JSX.Element;
390
-
391
- /**
392
- * Compact age for a session rail: `now`, `5m`, `3h`, `2d`, `3w`, `4mo`, `1y`.
393
- * Unlike `timeAgo` from `@tangle-network/ui/utils` it accepts any date input,
394
- * rolls past hours into days and beyond, and carries no "ago" suffix, so it
395
- * fits a "codex · 2h" meta line. A future or unparseable date reads `now` /
396
- * empty rather than a negative count. `now` is injectable for deterministic tests.
397
- */
398
- declare function formatRelativeAge(date: string | number | Date, now?: number): string;
399
-
400
- /**
401
- * Snappy in-app navigation: a shared `shouldRevalidate` rule for the agent-app
402
- * shell route(s) that own the workspace-list / sidebar loader.
403
- *
404
- * The shell loader (user + workspace list, sidebar state) runs on every
405
- * navigation, but its data does not change just by moving between in-app pages.
406
- * Refetching it on every internal GET nav adds a loader round-trip to each
407
- * click — on Cloudflare Workers + D1 (HTTP-proxied) that is a visible stall.
408
- *
409
- * This helper encodes the rule that makes nav feel instant WITHOUT stranding
410
- * freshly-mutated data:
411
- *
412
- * - Non-GET navigation (form submit / action) → always revalidate.
413
- * - Internal app→app navigation that CHANGES the path → skip revalidation.
414
- * - Imperative `useRevalidator().revalidate()` (which targets the SAME url,
415
- * so `currentUrl.pathname === nextUrl.pathname`) → revalidate. Creating a
416
- * project / thread typically goes through a raw `fetch`, so a same-url
417
- * revalidate is the ONLY way the new row reaches the shell loader; the
418
- * same-path carve-out below is what keeps that working. Suppressing it is
419
- * the project-switcher regression — do not "simplify" it away.
420
- * - Anything else (cross-path-prefix nav, entering/leaving the app) →
421
- * defer to `defaultShouldRevalidate`.
422
- *
423
- * Framework-agnostic by design: sandbox-ui does not depend on react-router, so
424
- * this takes a plain args object. The shape is a structural subset of
425
- * react-router's `ShouldRevalidateFunctionArgs`, so an app can wire it as a
426
- * route export with no adapter:
427
- *
428
- * ```ts
429
- * // app/routes/app.tsx
430
- * import { shellShouldRevalidate } from "@tangle-network/sandbox-ui/workspace";
431
- * export const shouldRevalidate = shellShouldRevalidate;
432
- * ```
433
- *
434
- * `shouldRevalidate` MUST be a per-app react-router route export — it cannot be
435
- * exported FROM a library on the app's behalf — so the "out of the box" win is
436
- * the one-line re-export above instead of every app re-deriving the rule (and
437
- * re-introducing the same-url bug).
438
- */
439
- /**
440
- * The subset of react-router's `ShouldRevalidateFunctionArgs` this rule reads.
441
- * Kept structural so callers can pass the full react-router args object as-is.
442
- */
443
- interface ShellShouldRevalidateArgs {
444
- currentUrl: URL;
445
- nextUrl: URL;
446
- formMethod?: string;
447
- defaultShouldRevalidate: boolean;
448
- }
449
- interface ShellShouldRevalidateOptions {
450
- /**
451
- * Path prefix that marks "inside the app shell". Internal navigation between
452
- * two paths under this prefix skips the shell-loader refetch. Defaults to
453
- * `"/app"`.
454
- */
455
- appPathPrefix?: string;
456
- }
457
- /**
458
- * Build a `shouldRevalidate` function for the shell route under `appPathPrefix`.
459
- * Use this when the app mounts under a non-default prefix; otherwise prefer the
460
- * ready-made {@link shellShouldRevalidate} export.
461
- */
462
- declare function createShellShouldRevalidate(options?: ShellShouldRevalidateOptions): (args: ShellShouldRevalidateArgs) => boolean;
463
- /**
464
- * Ready-made shell `shouldRevalidate` for apps mounted under `/app`. Wire it as
465
- * a one-line route export:
466
- *
467
- * ```ts
468
- * export const shouldRevalidate = shellShouldRevalidate;
469
- * ```
470
- *
471
- * For a non-`/app` prefix, use {@link createShellShouldRevalidate}.
472
- */
473
- declare const shellShouldRevalidate: (args: ShellShouldRevalidateArgs) => boolean;
474
-
475
- interface SessionActivityMonitorProps {
476
- className?: string;
477
- compact?: boolean;
478
- sessionsById?: Record<string, ActiveSessionRecord>;
479
- emptyMessage?: string;
480
- resolveProjectLabel?: (projectId: SessionProjectKey, label?: string) => string;
481
- onSelectSession?: (session: ActiveSessionRecord) => void;
482
- }
483
- declare function SessionActivityMonitor({ className, compact, sessionsById, emptyMessage, resolveProjectLabel, onSelectSession, }: SessionActivityMonitorProps): React$1.JSX.Element | null;
484
-
485
- type SandboxWorkbenchPlacement = "left" | "right" | "bottom" | "hidden";
486
- interface SandboxWorkbenchArtifactBase {
487
- id: string;
488
- title: ReactNode;
489
- subtitle?: ReactNode;
490
- eyebrow?: ReactNode;
491
- meta?: ReactNode;
492
- headerActions?: ReactNode;
493
- toolbar?: ReactNode;
494
- footer?: ReactNode;
495
- /** Tab glyph. Defaults per `kind`; a `custom` artifact usually names its own. */
496
- icon?: LucideIcon;
497
- /** A pinned artifact's tab sorts before the rest and carries no close button. */
498
- pinned?: boolean;
499
- }
500
- interface SandboxWorkbenchFileArtifact extends SandboxWorkbenchArtifactBase {
501
- kind: "file";
502
- path: string;
503
- filename: string;
504
- content?: string;
505
- blobUrl?: string;
506
- mimeType?: string;
507
- onDownload?: () => void;
508
- tabs?: FileTabData[];
509
- activeTabId?: string;
510
- onTabSelect?: (id: string) => void;
511
- onTabClose?: (id: string) => void;
512
- }
513
- interface SandboxWorkbenchMarkdownArtifact extends SandboxWorkbenchArtifactBase {
514
- kind: "markdown";
515
- content: string;
516
- }
517
- interface SandboxWorkbenchOpenUIArtifact extends SandboxWorkbenchArtifactBase {
518
- kind: "openui";
519
- schema: OpenUIComponentNode | OpenUIComponentNode[];
520
- onAction?: (action: OpenUIAction) => void;
521
- }
522
- interface SandboxWorkbenchCustomArtifact extends SandboxWorkbenchArtifactBase {
523
- kind: "custom";
524
- content: ReactNode;
525
- }
526
- type SandboxWorkbenchArtifact = SandboxWorkbenchCustomArtifact | SandboxWorkbenchFileArtifact | SandboxWorkbenchMarkdownArtifact | SandboxWorkbenchOpenUIArtifact;
527
- interface SandboxWorkbenchSessionProps extends Omit<ChatContainerProps, "className"> {
528
- eyebrow?: ReactNode;
529
- title?: ReactNode;
530
- subtitle?: ReactNode;
531
- meta?: ReactNode;
532
- headerActions?: ReactNode;
533
- /**
534
- * Controls rendered as a strip attached beneath the chat composer —
535
- * harness/model/effort pickers, token meters, etc. Use
536
- * `AgentSessionControls` from `@tangle-network/agent-app/web-react` for the
537
- * standard set.
538
- */
539
- composerControls?: ReactNode;
540
- renderRunActions?: ChatContainerProps["renderRunActions"];
541
- renderUserMessageActions?: ChatContainerProps["renderUserMessageActions"];
542
- renderToolActions?: ChatContainerProps["renderToolActions"];
543
- }
544
- interface SandboxWorkbenchLayoutOptions extends Pick<WorkspaceLayoutProps, "bottomHeader" | "defaultBottomOpen" | "defaultLeftOpen" | "defaultLeftWidth" | "defaultRightOpen" | "defaultRightWidth" | "density" | "keyboardShortcuts" | "leftCollapsedControl" | "leftOpen" | "maxLeftWidth" | "maxRightWidth" | "minLeftWidth" | "minRightWidth" | "onLeftOpenChange" | "onRightOpenChange" | "persistenceKey" | "resizable" | "rightOpen" | "theme"> {
545
- directoryPlacement?: SandboxWorkbenchPlacement;
546
- artifactPlacement?: SandboxWorkbenchPlacement;
547
- runtimePlacement?: SandboxWorkbenchPlacement;
548
- }
549
- interface SandboxWorkbenchProps {
550
- title?: ReactNode;
551
- subtitle?: ReactNode;
552
- status?: ReactNode;
553
- /**
554
- * Header above the transcript. `undefined` keeps the branded session card
555
- * (`Tangle Sandbox` / `title` / `status`), a node replaces it, and `null`
556
- * removes it: the transcript then renders directly on `bg-surface` with no
557
- * eyebrow/title frame around it, and the shell's center header row appears
558
- * only while it holds an open-pane toggle.
559
- */
560
- centerHeader?: ReactNode | null;
561
- /**
562
- * Composer rendered under the transcript on the panel background, inside the
563
- * transcript's own `max-w-3xl` column. `session.composerControls`, when
564
- * also given, sits above it as before.
565
- */
566
- composer?: ReactNode;
567
- /**
568
- * First section of the left region, ahead of the directory pane — a
569
- * `SessionSidebar` for a chats rail. A rail that is the only left section
570
- * fills the pane: no region header, no gutter. Give it `fill` and
571
- * `className="border-r-0"` so the layout's own divider is the only one.
572
- */
573
- rail?: ReactNode;
574
- directory?: DirectoryPaneProps;
575
- session: SandboxWorkbenchSessionProps;
576
- artifacts?: SandboxWorkbenchArtifact[];
577
- activeArtifactId?: string;
578
- onArtifactChange?: (artifactId: string) => void;
579
- onArtifactClose?: (artifactId: string) => void;
580
- runtime?: RuntimePaneProps;
581
- layout?: SandboxWorkbenchLayoutOptions;
582
- /**
583
- * Shown in the artifact region while no artifact is selected. When given,
584
- * the region renders before the first artifact exists.
585
- */
586
- emptyArtifactState?: ReactNode;
587
- className?: string;
588
- }
589
- /**
590
- * SandboxWorkbench — high-level composition that turns sandbox-ui primitives
591
- * into a complete session surface: directory, agent timeline, artifacts, and
592
- * runtime in one reusable shell.
593
- */
594
- declare function SandboxWorkbench({ title, subtitle, status, centerHeader: centerHeaderProp, composer, rail, directory, session, artifacts: artifactsProp, activeArtifactId, onArtifactChange, onArtifactClose, runtime, layout, emptyArtifactState, className, }: SandboxWorkbenchProps): React$1.JSX.Element;
595
- declare function AgentWorkbench(props: SandboxWorkbenchProps): React$1.JSX.Element;
596
-
597
- /**
598
- * AuditResults — structured pass/fail display for form audits.
599
- */
600
- interface AuditCheck {
601
- label: string;
602
- expected: string | number;
603
- actual?: string | number | null;
604
- passed: boolean;
605
- tolerance?: number;
606
- fieldPath?: string;
607
- }
608
- interface FormAudit {
609
- formId: string;
610
- formName?: string;
611
- found: boolean;
612
- checks: AuditCheck[];
613
- passed: number;
614
- failed: number;
615
- }
616
- interface AuditResultsProps {
617
- forms: FormAudit[];
618
- crossFormChecks?: AuditCheck[];
619
- overallScore?: number;
620
- className?: string;
621
- }
622
- declare function AuditResults({ forms, crossFormChecks, overallScore, className }: AuditResultsProps): React$1.JSX.Element;
623
-
624
- interface TaskBoardItem {
625
- id: string;
626
- title: string;
627
- description?: string | null;
628
- status: string;
629
- priority?: string | null;
630
- tags?: string[];
631
- dueDate?: Date | null;
632
- assigneeId?: string | null;
633
- meta?: Record<string, unknown>;
634
- }
635
- interface TaskBoardColumn {
636
- id: string;
637
- label: string;
638
- accent?: string;
639
- }
640
- interface TaskBoardProps {
641
- items: TaskBoardItem[];
642
- columns: TaskBoardColumn[];
643
- className?: string;
644
- onMoveItem?: (itemId: string, toColumnId: string) => void;
645
- onClickItem?: (item: TaskBoardItem) => void;
646
- renderItemMeta?: (item: TaskBoardItem) => ReactNode;
647
- renderColumnAction?: (column: TaskBoardColumn) => ReactNode;
648
- renderBadge?: (value: string, type: "priority" | "tag") => ReactNode;
649
- columnEmptyState?: ReactNode;
650
- header?: ReactNode;
651
- /**
652
- * Wrap each column's item list container. Use this to inject a DnD
653
- * droppable zone (e.g. Droppable from @hello-pangea/dnd).
654
- *
655
- * Receives the column ID, the default item list element, and the column's items.
656
- * Return a ReactNode that wraps/replaces the default element.
657
- *
658
- * If not provided, the default unstyled div is rendered.
659
- */
660
- renderColumnBody?: (columnId: string, defaultChildren: ReactNode, items: TaskBoardItem[]) => ReactNode;
661
- /**
662
- * Wrap each item card. Use this to inject a DnD draggable
663
- * (e.g. Draggable from @hello-pangea/dnd).
664
- *
665
- * Receives the item, its index, and the default card element.
666
- * Return a ReactNode that wraps/replaces the default element.
667
- *
668
- * If not provided, the default card is rendered.
669
- */
670
- renderItemWrapper?: (item: TaskBoardItem, index: number, defaultCard: ReactNode) => ReactNode;
671
- }
672
- declare function TaskBoard({ items, columns, className, onMoveItem, onClickItem, renderItemMeta, renderColumnAction, renderBadge, columnEmptyState, header, renderColumnBody, renderItemWrapper, }: TaskBoardProps): React$1.JSX.Element;
673
-
674
- interface CalendarEvent {
675
- id: string;
676
- title: string;
677
- type?: string;
678
- startAt: Date | string;
679
- endAt?: Date | string | null;
680
- allDay?: boolean;
681
- /** Arbitrary data passed through to render props */
682
- meta?: Record<string, unknown>;
683
- }
684
- interface CalendarViewProps {
685
- events: CalendarEvent[];
686
- className?: string;
687
- /** Controlled month (0-indexed). Defaults to current month. */
688
- month?: number;
689
- year?: number;
690
- onMonthChange?: (year: number, month: number) => void;
691
- /** Which day is selected (ISO date string YYYY-MM-DD) */
692
- selectedDay?: string | null;
693
- onSelectDay?: (dateKey: string) => void;
694
- onDoubleClickDay?: (dateKey: string) => void;
695
- /** Render an event dot/chip inside a calendar cell */
696
- renderEventChip?: (event: CalendarEvent) => ReactNode;
697
- /** Render the day detail panel (right side) */
698
- renderDayDetail?: (dateKey: string, dayEvents: CalendarEvent[]) => ReactNode;
699
- /** Header slot (left of navigation) */
700
- headerLeft?: ReactNode;
701
- /** Header slot (right of navigation) */
702
- headerRight?: ReactNode;
703
- /** Whether to show the day detail panel. Default true. */
704
- showDayPanel?: boolean;
705
- }
706
- /**
707
- * CalendarView — month grid calendar with event chips and optional day detail panel.
708
- *
709
- * Stateless by default (controlled month/selectedDay). Falls back to internal
710
- * state when uncontrolled. All rendering is customizable via render props.
711
- */
712
- declare function CalendarView({ events, className, month: controlledMonth, year: controlledYear, onMonthChange, selectedDay: controlledSelectedDay, onSelectDay, onDoubleClickDay, renderEventChip, renderDayDetail, headerLeft, headerRight, showDayPanel, }: CalendarViewProps): React$1.JSX.Element;
713
-
714
- interface ApprovalItem {
715
- id: string;
716
- title: string;
717
- description?: string | null;
718
- type: string;
719
- status: "pending" | "approved" | "rejected" | "executed";
720
- createdAt?: Date | string | null;
721
- resolvedAt?: Date | string | null;
722
- /** Arbitrary metadata — e.g. rejectionReason, confidence, content preview */
723
- meta?: Record<string, unknown>;
724
- }
725
- interface ApprovalConfidenceStat {
726
- type: string;
727
- approved: number;
728
- rejected: number;
729
- total: number;
730
- rate: number;
731
- }
732
- interface ApprovalQueueProps {
733
- items: ApprovalItem[];
734
- className?: string;
735
- onApprove?: (item: ApprovalItem) => void;
736
- onReject?: (item: ApprovalItem, reason?: string) => void;
737
- /** Render custom content inside each approval card */
738
- renderItemDetail?: (item: ApprovalItem) => ReactNode;
739
- /** Render a custom badge for the item type */
740
- renderTypeBadge?: (type: string) => ReactNode;
741
- /** Render custom stats at the top. If not provided, auto-computed confidence stats shown. */
742
- renderStats?: (stats: ApprovalConfidenceStat[]) => ReactNode;
743
- /** Whether the user can approve/reject. Default true. */
744
- canResolve?: boolean;
745
- /** Header slot */
746
- header?: ReactNode;
747
- /** Empty state */
748
- emptyState?: ReactNode;
749
- /** Whether to show resolved items. Default: collapsed toggle. */
750
- showResolved?: boolean;
751
- }
752
- /**
753
- * ApprovalQueue — review queue for agent-proposed actions.
754
- *
755
- * Shows pending items with approve/reject controls, confidence stats per type,
756
- * and a collapsible resolved history. Designed for the agent approval feedback
757
- * loop: agent proposes → user approves/rejects → rejection reasons feed back.
758
- */
759
- declare function ApprovalQueue({ items, className, onApprove, onReject, renderItemDetail, renderTypeBadge, renderStats, canResolve, header, emptyState, showResolved: controlledShowResolved, }: ApprovalQueueProps): React$1.JSX.Element;
760
-
761
- export { AgentWorkbench, type ApprovalConfidenceStat, type ApprovalItem, ApprovalQueue, type ApprovalQueueProps, type AuditCheck, AuditResults, type AuditResultsProps, type BannerType, type CalendarEvent, CalendarView, type CalendarViewProps, type ContextBadge, DirectoryPane, type DirectoryPaneProps, type FormAudit, RuntimePane, type RuntimePaneProps, SESSION_CREATED_EVENT, SandboxWorkbench, type SandboxWorkbenchArtifact, type SandboxWorkbenchCustomArtifact, type SandboxWorkbenchFileArtifact, type SandboxWorkbenchLayoutOptions, type SandboxWorkbenchMarkdownArtifact, type SandboxWorkbenchOpenUIArtifact, type SandboxWorkbenchProps, type SandboxWorkbenchSessionProps, SessionActivityMonitor, type SessionActivityMonitorProps, type SessionCreatedDetail, type SessionOptimisticController, SessionSidebar, type SessionSidebarBadge, type SessionSidebarFilter, type SessionSidebarGroupBy, type SessionSidebarItem, type SessionSidebarLink, type SessionSidebarProps, type SessionSidebarVariant, type ShellShouldRevalidateArgs, type ShellShouldRevalidateOptions, StatusBanner, type StatusBannerProps, StatusBar, type StatusBarProps, TaskBoard, type TaskBoardColumn, type TaskBoardItem, type TaskBoardProps, type TerminalLine, TerminalPanel, type TerminalProps, type UseOptimisticSessionItemsOptions, WorkspaceLayout, type WorkspaceLayoutProps, WorkspacePaneHeader, type WorkspacePaneHeaderProps, createShellShouldRevalidate, dispatchSessionCreated, formatRelativeAge, shellShouldRevalidate, useOptimisticSessionItems };
1
+ import { $ as TerminalProps, A as ShellShouldRevalidateArgs, B as SessionSidebarLink, C as SandboxWorkbenchLayoutOptions, D as SandboxWorkbenchSessionProps, E as SandboxWorkbenchProps, F as SessionSidebar, G as SessionOptimisticController, H as SessionSidebarVariant, I as SessionSidebarBadge, J as useOptimisticSessionItems, K as UseOptimisticSessionItemsOptions, L as SessionSidebarFilter, M as createShellShouldRevalidate, N as shellShouldRevalidate, O as SessionActivityMonitor, P as formatRelativeAge, Q as TerminalPanel, R as SessionSidebarGroupBy, S as SandboxWorkbenchFileArtifact, T as SandboxWorkbenchOpenUIArtifact, U as SESSION_CREATED_EVENT, V as SessionSidebarProps, W as SessionCreatedDetail, X as RuntimePaneProps, Y as RuntimePane, Z as TerminalLine, _ as FormAudit, a as ApprovalQueue, at as StatusBannerProps, b as SandboxWorkbenchArtifact, c as CalendarView, ct as WorkspacePaneHeader, d as TaskBoardColumn, dt as WorkspaceLayoutProps, et as ContextBadge, f as TaskBoardItem, g as AuditResultsProps, h as AuditResults, i as ApprovalItem, it as StatusBanner, j as ShellShouldRevalidateOptions, k as SessionActivityMonitorProps, l as CalendarViewProps, lt as WorkspacePaneHeaderProps, m as AuditCheck, n as ArtifactPaneProps, nt as StatusBarProps, o as ApprovalQueueProps, ot as DirectoryPane, p as TaskBoardProps, q as dispatchSessionCreated, r as ApprovalConfidenceStat, rt as BannerType, s as CalendarEvent, st as DirectoryPaneProps, t as ArtifactPane, tt as StatusBar, u as TaskBoard, ut as WorkspaceLayout, v as AgentWorkbench, w as SandboxWorkbenchMarkdownArtifact, x as SandboxWorkbenchCustomArtifact, y as SandboxWorkbench, z as SessionSidebarItem } from "./index-CKRaj1pM.js";
2
+ export { AgentWorkbench, type ApprovalConfidenceStat, type ApprovalItem, ApprovalQueue, type ApprovalQueueProps, ArtifactPane, type ArtifactPaneProps, type AuditCheck, AuditResults, type AuditResultsProps, type BannerType, type CalendarEvent, CalendarView, type CalendarViewProps, type ContextBadge, DirectoryPane, type DirectoryPaneProps, type FormAudit, RuntimePane, type RuntimePaneProps, SESSION_CREATED_EVENT, SandboxWorkbench, type SandboxWorkbenchArtifact, type SandboxWorkbenchCustomArtifact, type SandboxWorkbenchFileArtifact, type SandboxWorkbenchLayoutOptions, type SandboxWorkbenchMarkdownArtifact, type SandboxWorkbenchOpenUIArtifact, type SandboxWorkbenchProps, type SandboxWorkbenchSessionProps, SessionActivityMonitor, type SessionActivityMonitorProps, type SessionCreatedDetail, type SessionOptimisticController, SessionSidebar, type SessionSidebarBadge, type SessionSidebarFilter, type SessionSidebarGroupBy, type SessionSidebarItem, type SessionSidebarLink, type SessionSidebarProps, type SessionSidebarVariant, type ShellShouldRevalidateArgs, type ShellShouldRevalidateOptions, StatusBanner, type StatusBannerProps, StatusBar, type StatusBarProps, TaskBoard, type TaskBoardColumn, type TaskBoardItem, type TaskBoardProps, type TerminalLine, TerminalPanel, type TerminalProps, type UseOptimisticSessionItemsOptions, WorkspaceLayout, type WorkspaceLayoutProps, WorkspacePaneHeader, type WorkspacePaneHeaderProps, createShellShouldRevalidate, dispatchSessionCreated, formatRelativeAge, shellShouldRevalidate, useOptimisticSessionItems };