@tangle-network/ui 1.0.1 → 4.1.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 (48) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/dist/chat.js +8 -7
  3. package/dist/{chunk-TMFOPHHN.js → chunk-52Y3FMFI.js} +2 -2
  4. package/dist/{chunk-7UO2ZMRQ.js → chunk-5VPTNXX7.js} +2 -2
  5. package/dist/{chunk-XIHMJ7ZQ.js → chunk-AAUNOHVL.js} +5 -30
  6. package/dist/{chunk-YJ2G3XO5.js → chunk-CMX2I43A.js} +1 -1
  7. package/dist/{chunk-2VH6PUXD.js → chunk-DGW77LD7.js} +1 -1
  8. package/dist/{chunk-CD53GZOM.js → chunk-FJBTCTZM.js} +1 -1
  9. package/dist/{chunk-YNN4O57I.js → chunk-JBPWIYTQ.js} +4 -4
  10. package/dist/{chunk-2NFQRQOD.js → chunk-KT5RNO7N.js} +4 -4
  11. package/dist/{chunk-HJKCSXCH.js → chunk-LELGOLFV.js} +44 -78
  12. package/dist/{chunk-EEE55AVS.js → chunk-SZ44QDA6.js} +1 -1
  13. package/dist/{chunk-66BNMOVT.js → chunk-WUQDUBJG.js} +5 -4
  14. package/dist/chunk-ZRVH3WCA.js +107 -0
  15. package/dist/{code-block-DjXf8eOG.d.ts → code-block-0kSpWMnf.d.ts} +7 -1
  16. package/dist/{document-editor-pane-A5LT5H4N.js → document-editor-pane-WCTA3ZOE.js} +3 -3
  17. package/dist/editor.js +3 -4
  18. package/dist/files.d.ts +39 -2
  19. package/dist/files.js +16 -4
  20. package/dist/hooks.js +5 -5
  21. package/dist/index.d.ts +46 -7
  22. package/dist/index.js +120 -37
  23. package/dist/markdown.d.ts +1 -1
  24. package/dist/markdown.js +2 -2
  25. package/dist/nav.d.ts +25 -0
  26. package/dist/nav.js +16 -0
  27. package/dist/openui.js +3 -3
  28. package/dist/primitives.d.ts +1 -1
  29. package/dist/primitives.js +1 -1
  30. package/dist/run.js +8 -7
  31. package/dist/sdk-hooks.js +5 -5
  32. package/dist/tool-previews.js +3 -2
  33. package/package.json +13 -3
  34. package/src/files/file-artifact-pane.tsx +3 -3
  35. package/src/files/file-format.test.ts +176 -0
  36. package/src/files/file-format.ts +167 -0
  37. package/src/files/file-preview.stories.tsx +87 -0
  38. package/src/files/file-preview.test.tsx +52 -0
  39. package/src/files/file-preview.tsx +48 -94
  40. package/src/files/index.ts +8 -0
  41. package/src/index.ts +1 -2
  42. package/src/markdown/code-block.test.tsx +62 -0
  43. package/src/markdown/code-block.tsx +11 -4
  44. package/src/nav/index.tsx +34 -0
  45. package/src/redaction/index.ts +7 -0
  46. package/src/redaction/redacted-document.tsx +150 -0
  47. package/src/tool-previews/write-file-preview.tsx +2 -30
  48. package/dist/chunk-Q7EIIWTC.js +0 -0
package/dist/files.d.ts CHANGED
@@ -101,7 +101,7 @@ declare function RichFileTree({ root, paths, selectedPath, onSelect, search, ini
101
101
  * Renders any file type beautifully:
102
102
  * - PDF: embedded viewer
103
103
  * - CSV/XLSX: tabular preview
104
- * - Code (py/json/yaml/ts/js): line-numbered viewer
104
+ * - Code (py/json/yaml/ts/js): syntax-highlighted, line-numbered viewer
105
105
  * - Markdown: rendered prose
106
106
  * - Images: inline display
107
107
  * - Text: monospace preview
@@ -172,4 +172,41 @@ interface FileArtifactPaneProps extends Omit<FilePreviewProps, "className"> {
172
172
  */
173
173
  declare function FileArtifactPane({ filename, content, blobUrl, mimeType, onClose, onDownload, path, tabs, activeTabId, onTabSelect, onTabClose, eyebrow, meta, toolbar, footer, className, editor, }: FileArtifactPaneProps): react_jsx_runtime.JSX.Element;
174
174
 
175
- export { FileArtifactPane, type FileArtifactPaneProps, type FileNode, FilePreview, type FilePreviewProps, type FileTabData, FileTabs, type FileTabsProps, FileTree, type FileTreeProps, type FileTreeVisibilityOptions, RichFileTree, type RichFileTreeGitEntry, type RichFileTreeGitStatus, type RichFileTreeProps, type RichFileTreeThemeVars, filterFileTree };
175
+ /**
176
+ * Shared file-format detection for every file surface — the preview pane, the
177
+ * artifact pane, and code rendering. Centralising extension/MIME → format logic
178
+ * keeps chat and artifact views consistent and avoids the same mapping drifting
179
+ * across components.
180
+ */
181
+ type FileFormat = "pdf" | "image" | "csv" | "spreadsheet" | "code" | "json" | "yaml" | "markdown" | "text" | "unknown";
182
+ /**
183
+ * Lowercased trailing extension. Returns "" for a name with no extension
184
+ * ("README", "json" → ""), and the post-dot name for a dotfile (".bashrc" →
185
+ * "bashrc"). Directory components are ignored so dots in a directory name don't
186
+ * leak in ("my.config/file" → "").
187
+ */
188
+ declare function fileExtension(filename: string): string;
189
+ /**
190
+ * Resolve a filename + optional MIME type to the renderer format. A specific,
191
+ * authoritative MIME type wins over the extension; otherwise the extension
192
+ * decides; a generic text/plain payload is the final fallback.
193
+ */
194
+ declare function detectFileFormat(filename: string, mimeType?: string): FileFormat;
195
+ /** Human-facing label for a detected format. */
196
+ declare function getFormatLabel(format: FileFormat): string;
197
+ /**
198
+ * Map a filename (or path) to a highlight.js language id for CodeBlock. Returns
199
+ * undefined when there is no confident mapping; CodeBlock then renders themed
200
+ * monospace and lets the highlighter auto-detect, so callers never need a
201
+ * bespoke language table.
202
+ */
203
+ declare function getSyntaxLanguage(filename: string): string | undefined;
204
+ /**
205
+ * Highlight language for a file already classified as a code-like format.
206
+ * `json`/`yaml` are their own highlight language even when detected purely from
207
+ * a MIME type on an extensionless file (where the extension can't reveal it);
208
+ * any other code format keys off the extension.
209
+ */
210
+ declare function getCodeLanguage(filename: string, format: FileFormat): string | undefined;
211
+
212
+ export { FileArtifactPane, type FileArtifactPaneProps, type FileFormat, type FileNode, FilePreview, type FilePreviewProps, type FileTabData, FileTabs, type FileTabsProps, FileTree, type FileTreeProps, type FileTreeVisibilityOptions, RichFileTree, type RichFileTreeGitEntry, type RichFileTreeGitStatus, type RichFileTreeProps, type RichFileTreeThemeVars, detectFileFormat, fileExtension, filterFileTree, getCodeLanguage, getFormatLabel, getSyntaxLanguage };
package/dist/files.js CHANGED
@@ -5,10 +5,17 @@ import {
5
5
  FileTree,
6
6
  RichFileTree,
7
7
  filterFileTree
8
- } from "./chunk-HJKCSXCH.js";
8
+ } from "./chunk-LELGOLFV.js";
9
+ import {
10
+ detectFileFormat,
11
+ fileExtension,
12
+ getCodeLanguage,
13
+ getFormatLabel,
14
+ getSyntaxLanguage
15
+ } from "./chunk-ZRVH3WCA.js";
9
16
  import "./chunk-CSAIKY36.js";
10
- import "./chunk-CD53GZOM.js";
11
- import "./chunk-66BNMOVT.js";
17
+ import "./chunk-FJBTCTZM.js";
18
+ import "./chunk-WUQDUBJG.js";
12
19
  import "./chunk-RQHJBTEU.js";
13
20
  export {
14
21
  FileArtifactPane,
@@ -16,5 +23,10 @@ export {
16
23
  FileTabs,
17
24
  FileTree,
18
25
  RichFileTree,
19
- filterFileTree
26
+ detectFileFormat,
27
+ fileExtension,
28
+ filterFileTree,
29
+ getCodeLanguage,
30
+ getFormatLabel,
31
+ getSyntaxLanguage
20
32
  };
package/dist/hooks.js CHANGED
@@ -11,18 +11,18 @@ import {
11
11
  useSSEStream,
12
12
  useSdkSession,
13
13
  useToolCallStream
14
- } from "./chunk-YJ2G3XO5.js";
14
+ } from "./chunk-CMX2I43A.js";
15
15
  import "./chunk-OEX7NZE3.js";
16
16
  import {
17
17
  useAutoScroll,
18
18
  useRunCollapseState,
19
19
  useRunGroups
20
20
  } from "./chunk-54SQQMMM.js";
21
- import "./chunk-7UO2ZMRQ.js";
22
- import "./chunk-2VH6PUXD.js";
21
+ import "./chunk-5VPTNXX7.js";
22
+ import "./chunk-DGW77LD7.js";
23
23
  import "./chunk-BX6AQMUS.js";
24
- import "./chunk-CD53GZOM.js";
25
- import "./chunk-66BNMOVT.js";
24
+ import "./chunk-FJBTCTZM.js";
25
+ import "./chunk-WUQDUBJG.js";
26
26
  import "./chunk-RQHJBTEU.js";
27
27
  export {
28
28
  RealtimeSessionRegistry,
package/dist/index.d.ts CHANGED
@@ -6,13 +6,11 @@ export { AgentTimeline, AgentTimelineArtifactItem, AgentTimelineCustomItem, Agen
6
6
  export { ExpandedToolDetail, ExpandedToolDetailProps, InlineThinkingItem, InlineThinkingItemProps, InlineToolItem, InlineToolItemProps, LiveDuration, RunGroup, RunGroupProps } from './run.js';
7
7
  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';
8
8
  export { OpenUIAction, OpenUIActionsNode, OpenUIArtifactRenderer, OpenUIArtifactRendererProps, OpenUIBadgeNode, OpenUICardNode, OpenUICodeNode, OpenUIComponentNode, OpenUIGridNode, OpenUIHeadingNode, OpenUIKeyValueNode, OpenUIMarkdownNode, OpenUIPrimitive, OpenUISeparatorNode, OpenUIStackNode, OpenUIStatNode, OpenUITableNode, OpenUITextNode } from './openui.js';
9
- export { FileArtifactPane, FileArtifactPaneProps, FileNode, FilePreview, FilePreviewProps, FileTabData, FileTabs, FileTabsProps, FileTree, FileTreeProps, FileTreeVisibilityOptions, RichFileTree, RichFileTreeGitEntry, RichFileTreeGitStatus, RichFileTreeProps, RichFileTreeThemeVars, filterFileTree } from './files.js';
10
- export { C as Collaborator, a as ConnectionState, D as DocumentEditorBackend, b as DocumentEditorMode, c as DocumentEditorPane, d as DocumentEditorPaneCollaborationConfig, e as DocumentEditorPaneProps, E as EditorContextValue, f as EditorProvider, g as EditorProviderProps, h as EditorTokenRefreshResult, i as EditorUser, u as useEditorContext } from './document-editor-pane-DyDEX_Zm.js';
11
- export { CollaboratorsList, EditorToolbar, TiptapEditor, TiptapEditorProps, useAwareness, useCollaboratorPresence, useCollaborators, useDocumentChanges, useEditorConnection, useYjsState } from './editor.js';
9
+ export { FileArtifactPane, FileArtifactPaneProps, FileFormat, FileNode, FilePreview, FilePreviewProps, FileTabData, FileTabs, FileTabsProps, FileTree, FileTreeProps, FileTreeVisibilityOptions, RichFileTree, RichFileTreeGitEntry, RichFileTreeGitStatus, RichFileTreeProps, RichFileTreeThemeVars, detectFileFormat, fileExtension, filterFileTree, getCodeLanguage, getFormatLabel, getSyntaxLanguage } from './files.js';
12
10
  export { Markdown, MarkdownProps } from './markdown.js';
13
- export { C as CodeBlock, a as CodeBlockProps, b as CopyButton } from './code-block-DjXf8eOG.js';
11
+ export { C as CodeBlock, a as CodeBlockProps, b as CopyButton } from './code-block-0kSpWMnf.js';
14
12
  export { AuthHeader, AuthHeaderProps, GitHubLoginButton, GitHubLoginButtonProps, LoginLayout, LoginLayoutProps, SessionUser, UserMenu, UserMenuProps } from './auth.js';
15
- export { AgentStreamEvent, AppendUserMessageOptions, ApplySdkEventOptions, AutomationStreamEvent, BeginAssistantMessageOptions, BotStreamEvent, CompleteAssistantMessageOptions, RealtimeSessionOptions, RealtimeSessionRegistry, RealtimeSessionRegistryProps, RealtimeSessionState, RealtimeSessionTarget, SSEEvent, SdkSessionAttachment, SdkSessionEvent, SdkSessionSeed, TaskStreamEvent, TerminalStreamEvent, UseRunGroupsOptions, UseSSEStreamOptions, UseSSEStreamResult, UseSdkSessionOptions, UseSdkSessionReturn, UseToolCallStreamReturn, useAutoScroll, useDropdownMenu, useRealtimeSession, useRunCollapseState, useRunGroups, useSSEStream, useSdkSession, useToolCallStream } from './sdk-hooks.js';
13
+ export { AgentStreamEvent, AppendUserMessageOptions, ApplySdkEventOptions, AutomationStreamEvent, BeginAssistantMessageOptions, BotStreamEvent, CompleteAssistantMessageOptions, ConnectionState, RealtimeSessionOptions, RealtimeSessionRegistry, RealtimeSessionRegistryProps, RealtimeSessionState, RealtimeSessionTarget, SSEEvent, SdkSessionAttachment, SdkSessionEvent, SdkSessionSeed, TaskStreamEvent, TerminalStreamEvent, UseRunGroupsOptions, UseSSEStreamOptions, UseSSEStreamResult, UseSdkSessionOptions, UseSdkSessionReturn, UseToolCallStreamReturn, useAutoScroll, useDropdownMenu, useRealtimeSession, useRunCollapseState, useRunGroups, useSSEStream, useSdkSession, useToolCallStream } from './sdk-hooks.js';
16
14
  export { AuthUser, UseAuthOptions, UseAuthResult, createAuthFetcher, useApiKey, useAuth, useLiveTime } from './hooks.js';
17
15
  export { A as ActiveProjectActivity, a as ActiveSessionActivityOptions, b as ActiveSessionConnectionOptions, c as ActiveSessionConnectionState, d as ActiveSessionReconnectState, e as ActiveSessionRecord, f as ActiveSessionStatus, g as ActiveSessionTransportMode, h as ActiveSessionsState, R as RegisterActiveSessionOptions, S as SessionProjectKey, i as activeSessionsAtom, j as bumpActiveSessionActivity, k as getActiveSession, l as getAllActiveSessions, m as getAllProjectActivity, n as getSessionsByActivity, o as getSessionsForNavbar, p as getSessionsForProject, q as getTotalRunningSessionCount, r as hasBackgroundRunningSessions, s as registerActiveSession, t as resetActiveSessions, u as setActiveSessionAttention, v as setActiveSessionConnection, w as setActiveSessionError, x as setActiveSessionRunning, y as setForegroundActiveSession, z as unregisterActiveSession, B as updateActiveSessionMeta, C as useActiveSession, D as useActiveSessions, E as useActiveSessionsState, F as useHasBackgroundRunningSessions, G as useNavbarSessions, H as useProjectActivity, I as useProjectSessions, J as useSessionsByActivity, K as useTotalRunningSessions } from './active-sessions-store-CeOmXgv5.js';
18
16
  export { addMessage, addParts, clearChat, isStreamingAtom, messagesAtom, partMapAtom, updatePart } from './stores.js';
@@ -23,8 +21,8 @@ export { F as FinalTextPart, G as GroupedMessage, M as MessageRun, a as MessageU
23
21
  export { C as CustomToolRenderer, D as DisplayVariant, T as ToolDisplayMetadata } from './tool-display-z4JcDmMQ.js';
24
22
  export { TOOL_CATEGORY_ICONS, cn, copyText, formatBytes, formatDuration, formatUptime, getToolCategory, getToolDisplayMetadata, getToolErrorText, timeAgo, truncateText } from './utils.js';
25
23
  export { CommandPreview, CommandPreviewProps, DiffPreview, DiffPreviewProps, GlobResultsPreview, GlobResultsPreviewProps, GrepResultsPreview, GrepResultsPreviewProps, QuestionPreview, QuestionPreviewProps, WebSearchPreview, WebSearchPreviewProps, WriteFilePreview, WriteFilePreviewProps } from './tool-previews.js';
24
+ import { ReactNode } from 'react';
26
25
  import 'class-variance-authority/types';
27
- import 'react';
28
26
  import 'react/jsx-runtime';
29
27
  import '@radix-ui/react-dialog';
30
28
  import 'class-variance-authority';
@@ -36,8 +34,49 @@ import '@radix-ui/react-progress';
36
34
  import '@radix-ui/react-switch';
37
35
  import '@radix-ui/react-label';
38
36
  import '@pierre/trees';
37
+ import './document-editor-pane-DyDEX_Zm.js';
39
38
  import '@hocuspocus/provider';
40
39
  import 'yjs';
41
- import '@tiptap/react';
42
40
  import 'nanostores';
43
41
  import 'clsx';
42
+
43
+ /**
44
+ * Viewer for a server-produced redacted document. Renders text inline and each
45
+ * redacted span as a masked chip; clicking a chip asks the server to reveal that
46
+ * one span. The original plaintext is NEVER in the document the client holds —
47
+ * the chip carries only an id + kind; `onReveal` round-trips to the server, where
48
+ * `@tangle-network/agent-app/redact`'s `revealSpan` runs the authorization check
49
+ * and writes the audit trail. So authz + audit are server-truth; this is display.
50
+ *
51
+ * Structural types (no `@tangle-network/agent-app` dependency) — the viewer needs
52
+ * only `{ id, kind }` per span; the cipher stays server-side.
53
+ */
54
+ type RedactedDocSegment = {
55
+ type: "text";
56
+ text: string;
57
+ } | {
58
+ type: "redacted";
59
+ id: string;
60
+ kind: string;
61
+ };
62
+ interface RedactedDocumentData {
63
+ segments: RedactedDocSegment[];
64
+ }
65
+ interface RevealResult {
66
+ ok: boolean;
67
+ value?: string;
68
+ /** e.g. `forbidden` | `not_found` when `ok` is false. */
69
+ reason?: string;
70
+ }
71
+ interface RedactedDocumentProps {
72
+ document: RedactedDocumentData;
73
+ /** Reveal one span by id. Wire to a server route that calls agent-app's
74
+ * `revealSpan` (authz + audit happen there). Resolves with the original. */
75
+ onReveal: (spanId: string) => Promise<RevealResult>;
76
+ /** Display label for a redaction kind (default: the kind, upper-cased). */
77
+ labelForKind?: (kind: string) => string;
78
+ className?: string;
79
+ }
80
+ declare function RedactedDocument({ document, onReveal, labelForKind, className, }: RedactedDocumentProps): ReactNode;
81
+
82
+ export { type RedactedDocSegment, RedactedDocument, type RedactedDocumentData, type RedactedDocumentProps, type RevealResult };
package/dist/index.js CHANGED
@@ -17,7 +17,7 @@ import {
17
17
  useSSEStream,
18
18
  useSdkSession,
19
19
  useToolCallStream
20
- } from "./chunk-YJ2G3XO5.js";
20
+ } from "./chunk-CMX2I43A.js";
21
21
  import {
22
22
  addMessage,
23
23
  addParts,
@@ -138,7 +138,7 @@ import {
138
138
  MessageList,
139
139
  ThinkingIndicator,
140
140
  UserMessage
141
- } from "./chunk-2NFQRQOD.js";
141
+ } from "./chunk-KT5RNO7N.js";
142
142
  import {
143
143
  useAutoScroll,
144
144
  useRunCollapseState,
@@ -148,18 +148,18 @@ import "./chunk-LQS34IGP.js";
148
148
  import {
149
149
  ToolCallFeed,
150
150
  parseToolEvent
151
- } from "./chunk-7UO2ZMRQ.js";
151
+ } from "./chunk-5VPTNXX7.js";
152
152
  import {
153
153
  ExpandedToolDetail,
154
154
  InlineThinkingItem,
155
155
  InlineToolItem,
156
156
  LiveDuration,
157
157
  RunGroup
158
- } from "./chunk-YNN4O57I.js";
158
+ } from "./chunk-JBPWIYTQ.js";
159
159
  import {
160
160
  ToolCallGroup,
161
161
  ToolCallStep
162
- } from "./chunk-2VH6PUXD.js";
162
+ } from "./chunk-DGW77LD7.js";
163
163
  import {
164
164
  formatBytes,
165
165
  formatDuration,
@@ -180,11 +180,11 @@ import {
180
180
  QuestionPreview,
181
181
  WebSearchPreview,
182
182
  WriteFilePreview
183
- } from "./chunk-XIHMJ7ZQ.js";
183
+ } from "./chunk-AAUNOHVL.js";
184
184
  import "./chunk-RQGKSCEZ.js";
185
185
  import {
186
186
  OpenUIArtifactRenderer
187
- } from "./chunk-TMFOPHHN.js";
187
+ } from "./chunk-52Y3FMFI.js";
188
188
  import {
189
189
  Badge,
190
190
  Card,
@@ -215,22 +215,14 @@ import {
215
215
  FileTree,
216
216
  RichFileTree,
217
217
  filterFileTree
218
- } from "./chunk-HJKCSXCH.js";
219
- import "./chunk-Q7EIIWTC.js";
218
+ } from "./chunk-LELGOLFV.js";
220
219
  import {
221
- CollaboratorsList,
222
- DocumentEditorPane,
223
- EditorProvider,
224
- EditorToolbar,
225
- TiptapEditor,
226
- useAwareness,
227
- useCollaboratorPresence,
228
- useCollaborators,
229
- useDocumentChanges,
230
- useEditorConnection,
231
- useEditorContext,
232
- useYjsState
233
- } from "./chunk-EEE55AVS.js";
220
+ detectFileFormat,
221
+ fileExtension,
222
+ getCodeLanguage,
223
+ getFormatLabel,
224
+ getSyntaxLanguage
225
+ } from "./chunk-ZRVH3WCA.js";
234
226
  import {
235
227
  Tabs,
236
228
  TabsContent,
@@ -243,14 +235,111 @@ import {
243
235
  import "./chunk-5Z5ZYMOJ.js";
244
236
  import {
245
237
  Markdown
246
- } from "./chunk-CD53GZOM.js";
238
+ } from "./chunk-FJBTCTZM.js";
247
239
  import {
248
240
  CodeBlock,
249
241
  CopyButton
250
- } from "./chunk-66BNMOVT.js";
242
+ } from "./chunk-WUQDUBJG.js";
251
243
  import {
252
244
  cn
253
245
  } from "./chunk-RQHJBTEU.js";
246
+
247
+ // src/redaction/redacted-document.tsx
248
+ import { useCallback, useState } from "react";
249
+ import { Eye, EyeOff, Loader2, ShieldAlert } from "lucide-react";
250
+ import { jsx, jsxs } from "react/jsx-runtime";
251
+ var defaultLabel = (kind) => kind.replace(/[-_]/g, " ").toUpperCase();
252
+ function RedactedChip({
253
+ kind,
254
+ label,
255
+ onReveal
256
+ }) {
257
+ const [state, setState] = useState({ status: "masked" });
258
+ const reveal = useCallback(async () => {
259
+ setState({ status: "loading" });
260
+ try {
261
+ const r = await onReveal();
262
+ setState(
263
+ r.ok && r.value !== void 0 ? { status: "revealed", value: r.value } : { status: "denied", reason: r.reason }
264
+ );
265
+ } catch {
266
+ setState({ status: "denied", reason: "error" });
267
+ }
268
+ }, [onReveal]);
269
+ if (state.status === "revealed") {
270
+ return /* @__PURE__ */ jsxs(
271
+ "button",
272
+ {
273
+ type: "button",
274
+ onClick: () => setState({ status: "masked" }),
275
+ title: "Revealed \u2014 click to hide",
276
+ "aria-label": `${label}: revealed, click to hide`,
277
+ className: cn(
278
+ "inline-flex items-center gap-1 rounded-[var(--radius-sm)] px-1 font-medium",
279
+ "bg-[color-mix(in_oklch,var(--color-warning,orange)_18%,transparent)] text-foreground ring-1 ring-warning/40"
280
+ ),
281
+ children: [
282
+ state.value,
283
+ /* @__PURE__ */ jsx(EyeOff, { className: "size-3 opacity-60" })
284
+ ]
285
+ }
286
+ );
287
+ }
288
+ if (state.status === "denied") {
289
+ return /* @__PURE__ */ jsxs(
290
+ "span",
291
+ {
292
+ title: `Restricted${state.reason ? ` (${state.reason})` : ""}`,
293
+ "aria-label": `${label}: restricted`,
294
+ className: "inline-flex items-center gap-1 rounded-[var(--radius-sm)] bg-muted px-1 text-muted-foreground",
295
+ children: [
296
+ /* @__PURE__ */ jsx(ShieldAlert, { className: "size-3" }),
297
+ " ",
298
+ label
299
+ ]
300
+ }
301
+ );
302
+ }
303
+ return /* @__PURE__ */ jsxs(
304
+ "button",
305
+ {
306
+ type: "button",
307
+ disabled: state.status === "loading",
308
+ onClick: reveal,
309
+ title: `${label} \u2014 click to reveal`,
310
+ "aria-label": `${label} redacted, click to reveal`,
311
+ className: cn(
312
+ "inline-flex items-center gap-1 rounded-[var(--radius-sm)] px-1 font-medium tracking-wide",
313
+ "bg-muted text-muted-foreground hover:bg-muted/80 hover:text-foreground transition-colors",
314
+ "cursor-pointer select-none"
315
+ ),
316
+ children: [
317
+ state.status === "loading" ? /* @__PURE__ */ jsx(Loader2, { className: "size-3 animate-spin" }) : /* @__PURE__ */ jsx(Eye, { className: "size-3 opacity-60" }),
318
+ /* @__PURE__ */ jsx("span", { "aria-hidden": true, children: "\u2588\u2588\u2588" }),
319
+ " ",
320
+ label
321
+ ]
322
+ }
323
+ );
324
+ }
325
+ function RedactedDocument({
326
+ document,
327
+ onReveal,
328
+ labelForKind = defaultLabel,
329
+ className
330
+ }) {
331
+ return /* @__PURE__ */ jsx("div", { className: cn("whitespace-pre-wrap break-words leading-relaxed", className), children: document.segments.map(
332
+ (seg, i) => seg.type === "text" ? /* @__PURE__ */ jsx("span", { children: seg.text }, i) : /* @__PURE__ */ jsx(
333
+ RedactedChip,
334
+ {
335
+ kind: seg.kind,
336
+ label: labelForKind(seg.kind),
337
+ onReveal: () => onReveal(seg.id)
338
+ },
339
+ seg.id
340
+ )
341
+ ) });
342
+ }
254
343
  export {
255
344
  AgentTimeline,
256
345
  ArtifactPane,
@@ -270,7 +359,6 @@ export {
270
359
  ChatInput,
271
360
  ChatMessage,
272
361
  CodeBlock,
273
- CollaboratorsList,
274
362
  CommandPreview,
275
363
  CopyButton,
276
364
  Dialog,
@@ -284,7 +372,6 @@ export {
284
372
  DialogTitle,
285
373
  DialogTrigger,
286
374
  DiffPreview,
287
- DocumentEditorPane,
288
375
  DropZone,
289
376
  DropdownMenu,
290
377
  DropdownMenuCheckboxItem,
@@ -301,8 +388,6 @@ export {
301
388
  DropdownMenuSubContent,
302
389
  DropdownMenuSubTrigger,
303
390
  DropdownMenuTrigger,
304
- EditorProvider,
305
- EditorToolbar,
306
391
  EmptyState,
307
392
  ExpandedToolDetail,
308
393
  FileArtifactPane,
@@ -326,6 +411,7 @@ export {
326
411
  Progress,
327
412
  QuestionPreview,
328
413
  RealtimeSessionRegistry,
414
+ RedactedDocument,
329
415
  RichFileTree,
330
416
  RunGroup,
331
417
  SegmentedControl,
@@ -366,7 +452,6 @@ export {
366
452
  Textarea,
367
453
  ThemeToggle,
368
454
  ThinkingIndicator,
369
- TiptapEditor,
370
455
  ToastContainer,
371
456
  ToastProvider,
372
457
  ToolCallFeed,
@@ -387,6 +472,8 @@ export {
387
472
  cn,
388
473
  copyText,
389
474
  createAuthFetcher,
475
+ detectFileFormat,
476
+ fileExtension,
390
477
  filterFileTree,
391
478
  formatBytes,
392
479
  formatDuration,
@@ -394,9 +481,12 @@ export {
394
481
  getActiveSession,
395
482
  getAllActiveSessions,
396
483
  getAllProjectActivity,
484
+ getCodeLanguage,
485
+ getFormatLabel,
397
486
  getSessionsByActivity,
398
487
  getSessionsForNavbar,
399
488
  getSessionsForProject,
489
+ getSyntaxLanguage,
400
490
  getToolCategory,
401
491
  getToolDisplayMetadata,
402
492
  getToolErrorText,
@@ -424,13 +514,7 @@ export {
424
514
  useApiKey,
425
515
  useAuth,
426
516
  useAutoScroll,
427
- useAwareness,
428
- useCollaboratorPresence,
429
- useCollaborators,
430
- useDocumentChanges,
431
517
  useDropdownMenu,
432
- useEditorConnection,
433
- useEditorContext,
434
518
  useHasBackgroundRunningSessions,
435
519
  useLiveTime,
436
520
  useNavbarSessions,
@@ -445,6 +529,5 @@ export {
445
529
  useTheme,
446
530
  useToast,
447
531
  useToolCallStream,
448
- useTotalRunningSessions,
449
- useYjsState
532
+ useTotalRunningSessions
450
533
  };
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
- export { C as CodeBlock, a as CodeBlockProps, b as CopyButton } from './code-block-DjXf8eOG.js';
3
+ export { C as CodeBlock, a as CodeBlockProps, b as CopyButton } from './code-block-0kSpWMnf.js';
4
4
 
5
5
  interface MarkdownProps {
6
6
  children: string;
package/dist/markdown.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import "./chunk-5Z5ZYMOJ.js";
2
2
  import {
3
3
  Markdown
4
- } from "./chunk-CD53GZOM.js";
4
+ } from "./chunk-FJBTCTZM.js";
5
5
  import {
6
6
  CodeBlock,
7
7
  CopyButton
8
- } from "./chunk-66BNMOVT.js";
8
+ } from "./chunk-WUQDUBJG.js";
9
9
  import "./chunk-RQHJBTEU.js";
10
10
  export {
11
11
  CodeBlock,
package/dist/nav.d.ts ADDED
@@ -0,0 +1,25 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { LinkProps, NavLinkProps } from 'react-router';
3
+ export { LinkProps, NavLinkProps } from 'react-router';
4
+
5
+ /**
6
+ * Navigation primitives that make agent-app products feel snappy by default.
7
+ *
8
+ * The dominant source of the "1–2s when I click through pages" latency in the
9
+ * fleet is NOT slow queries (route loaders' D1 indexes already cover their
10
+ * filters) — it is that every click is a COLD loader round-trip the user waits
11
+ * on, because bare `<Link>`s do no prefetching. React Router can fire the
12
+ * target route's loader on hover/focus (`prefetch="intent"`), overlapping the
13
+ * round-trip with the user's mouse travel so the transition feels instant.
14
+ *
15
+ * These wrappers default `prefetch="intent"` so a product gets that behaviour
16
+ * by importing the shared `<Link>` instead of remembering the flag on every
17
+ * nav element. The default is overridable — a caller that passes `prefetch`
18
+ * wins (the spread is applied after the default).
19
+ */
20
+ /** `react-router` `<Link>` with `prefetch="intent"` on by default. */
21
+ declare function Link({ prefetch, ...props }: LinkProps): react_jsx_runtime.JSX.Element;
22
+ /** `react-router` `<NavLink>` with `prefetch="intent"` on by default. */
23
+ declare function NavLink({ prefetch, ...props }: NavLinkProps): react_jsx_runtime.JSX.Element;
24
+
25
+ export { Link, NavLink };
package/dist/nav.js ADDED
@@ -0,0 +1,16 @@
1
+ // src/nav/index.tsx
2
+ import {
3
+ Link as RRLink,
4
+ NavLink as RRNavLink
5
+ } from "react-router";
6
+ import { jsx } from "react/jsx-runtime";
7
+ function Link({ prefetch = "intent", ...props }) {
8
+ return /* @__PURE__ */ jsx(RRLink, { prefetch, ...props });
9
+ }
10
+ function NavLink({ prefetch = "intent", ...props }) {
11
+ return /* @__PURE__ */ jsx(RRNavLink, { prefetch, ...props });
12
+ }
13
+ export {
14
+ Link,
15
+ NavLink
16
+ };
package/dist/openui.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import "./chunk-RQGKSCEZ.js";
2
2
  import {
3
3
  OpenUIArtifactRenderer
4
- } from "./chunk-TMFOPHHN.js";
4
+ } from "./chunk-52Y3FMFI.js";
5
5
  import "./chunk-GYPQXTJU.js";
6
6
  import "./chunk-MKTSMWVD.js";
7
- import "./chunk-CD53GZOM.js";
8
- import "./chunk-66BNMOVT.js";
7
+ import "./chunk-FJBTCTZM.js";
8
+ import "./chunk-WUQDUBJG.js";
9
9
  import "./chunk-RQHJBTEU.js";
10
10
  export {
11
11
  OpenUIArtifactRenderer
@@ -14,7 +14,7 @@ import * as SwitchPrimitives from '@radix-ui/react-switch';
14
14
  import * as LabelPrimitive from '@radix-ui/react-label';
15
15
  export { Logo, LogoProps, TangleKnot } from '@tangle-network/brand';
16
16
  export { A as ArtifactPane, a as ArtifactPaneProps } from './artifact-pane-DvJyPWV4.js';
17
- export { C as CodeBlock, a as CodeBlockProps, b as CopyButton } from './code-block-DjXf8eOG.js';
17
+ export { C as CodeBlock, a as CodeBlockProps, b as CopyButton } from './code-block-0kSpWMnf.js';
18
18
 
19
19
  declare const Card: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & {
20
20
  variant?: "default" | "glass" | "sandbox" | "elevated";
@@ -100,7 +100,7 @@ import {
100
100
  import {
101
101
  CodeBlock,
102
102
  CopyButton
103
- } from "./chunk-66BNMOVT.js";
103
+ } from "./chunk-WUQDUBJG.js";
104
104
  import "./chunk-RQHJBTEU.js";
105
105
  export {
106
106
  ArtifactPane,
package/dist/run.js CHANGED
@@ -2,26 +2,27 @@ import "./chunk-LQS34IGP.js";
2
2
  import {
3
3
  ToolCallFeed,
4
4
  parseToolEvent
5
- } from "./chunk-7UO2ZMRQ.js";
5
+ } from "./chunk-5VPTNXX7.js";
6
6
  import {
7
7
  ExpandedToolDetail,
8
8
  InlineThinkingItem,
9
9
  InlineToolItem,
10
10
  LiveDuration,
11
11
  RunGroup
12
- } from "./chunk-YNN4O57I.js";
12
+ } from "./chunk-JBPWIYTQ.js";
13
13
  import {
14
14
  ToolCallGroup,
15
15
  ToolCallStep
16
- } from "./chunk-2VH6PUXD.js";
16
+ } from "./chunk-DGW77LD7.js";
17
17
  import "./chunk-4CLN43XT.js";
18
18
  import "./chunk-BX6AQMUS.js";
19
- import "./chunk-XIHMJ7ZQ.js";
20
- import "./chunk-TMFOPHHN.js";
19
+ import "./chunk-AAUNOHVL.js";
20
+ import "./chunk-52Y3FMFI.js";
21
21
  import "./chunk-GYPQXTJU.js";
22
22
  import "./chunk-MKTSMWVD.js";
23
- import "./chunk-CD53GZOM.js";
24
- import "./chunk-66BNMOVT.js";
23
+ import "./chunk-ZRVH3WCA.js";
24
+ import "./chunk-FJBTCTZM.js";
25
+ import "./chunk-WUQDUBJG.js";
25
26
  import "./chunk-RQHJBTEU.js";
26
27
  export {
27
28
  ExpandedToolDetail,
package/dist/sdk-hooks.js CHANGED
@@ -5,18 +5,18 @@ import {
5
5
  useSSEStream,
6
6
  useSdkSession,
7
7
  useToolCallStream
8
- } from "./chunk-YJ2G3XO5.js";
8
+ } from "./chunk-CMX2I43A.js";
9
9
  import "./chunk-OEX7NZE3.js";
10
10
  import {
11
11
  useAutoScroll,
12
12
  useRunCollapseState,
13
13
  useRunGroups
14
14
  } from "./chunk-54SQQMMM.js";
15
- import "./chunk-7UO2ZMRQ.js";
16
- import "./chunk-2VH6PUXD.js";
15
+ import "./chunk-5VPTNXX7.js";
16
+ import "./chunk-DGW77LD7.js";
17
17
  import "./chunk-BX6AQMUS.js";
18
- import "./chunk-CD53GZOM.js";
19
- import "./chunk-66BNMOVT.js";
18
+ import "./chunk-FJBTCTZM.js";
19
+ import "./chunk-WUQDUBJG.js";
20
20
  import "./chunk-RQHJBTEU.js";
21
21
  export {
22
22
  RealtimeSessionRegistry,
@@ -7,8 +7,9 @@ import {
7
7
  QuestionPreview,
8
8
  WebSearchPreview,
9
9
  WriteFilePreview
10
- } from "./chunk-XIHMJ7ZQ.js";
11
- import "./chunk-66BNMOVT.js";
10
+ } from "./chunk-AAUNOHVL.js";
11
+ import "./chunk-ZRVH3WCA.js";
12
+ import "./chunk-WUQDUBJG.js";
12
13
  import "./chunk-RQHJBTEU.js";
13
14
  export {
14
15
  CommandPreview,