@tangle-network/ui 11.9.0 → 11.11.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 (155) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +14 -0
  3. package/dist/active-sessions-store-Gt1R0rFG.js +262 -0
  4. package/dist/{active-sessions-store-CeOmXgv5.d.ts → active-sessions-store-nl70ZnMC.d.ts} +40 -41
  5. package/dist/artifact-pane-BL_DFWNl.d.ts +32 -0
  6. package/dist/artifact-pane-DMXT9a8U.js +70 -0
  7. package/dist/auth-DixfCMCk.js +154 -0
  8. package/dist/auth.d.ts +2 -74
  9. package/dist/auth.js +2 -15
  10. package/dist/branding-26d5ARIr.d.ts +14 -0
  11. package/dist/button-uhNnwdsD.js +78 -0
  12. package/dist/button-yoIv77e2.d.ts +16 -0
  13. package/dist/chat-CPLL0Fd9.js +667 -0
  14. package/dist/chat.d.ts +2 -201
  15. package/dist/chat.js +2 -30
  16. package/dist/code-block-B9miUPht.d.ts +23 -0
  17. package/dist/code-block-CngSn37j.js +165 -0
  18. package/dist/diff-preview-cySuqowW.js +533 -0
  19. package/dist/document-editor-pane-BcoABlhn.d.ts +131 -0
  20. package/dist/document-editor-pane-Cz6oEF1o.js +1287 -0
  21. package/dist/dropdown-menu-BpcLa5vF.js +101 -0
  22. package/dist/editor.d.ts +76 -78
  23. package/dist/editor.js +2 -33
  24. package/dist/file-format-BgXbr-Ib.js +160 -0
  25. package/dist/files-CYlOo0mE.js +743 -0
  26. package/dist/files.d.ts +2 -243
  27. package/dist/files.js +3 -40
  28. package/dist/focus-Cw02pNSr.js +56 -0
  29. package/dist/format-DfcLWqMa.js +54 -0
  30. package/dist/hooks.d.ts +30 -37
  31. package/dist/hooks.js +111 -45
  32. package/dist/index-2UntyjBb.d.ts +52 -0
  33. package/dist/index-COgqsFAQ.d.ts +42 -0
  34. package/dist/index-CPDET_s1.d.ts +549 -0
  35. package/dist/index-CUhfHT_V.d.ts +204 -0
  36. package/dist/index-Cg6gYAqh.d.ts +73 -0
  37. package/dist/index-Cq-EJzqW.d.ts +16 -0
  38. package/dist/index-DhYmSaLF.d.ts +245 -0
  39. package/dist/index-DjKxO357.d.ts +128 -0
  40. package/dist/index-b56ew9aF.d.ts +107 -0
  41. package/dist/index.d.ts +26 -43
  42. package/dist/index.js +35 -460
  43. package/dist/markdown-BprL96Gl.js +45 -0
  44. package/dist/markdown.d.ts +3 -18
  45. package/dist/markdown.js +3 -14
  46. package/dist/message-vhUI0c5G.d.ts +16 -0
  47. package/dist/nav.d.ts +6 -8
  48. package/dist/nav.js +29 -11
  49. package/dist/openui-artifact-renderer-D3E5bIAI.d.ts +114 -0
  50. package/dist/openui-artifact-renderer-DT4xbvWt.js +266 -0
  51. package/dist/openui.d.ts +2 -115
  52. package/dist/openui.js +2 -12
  53. package/dist/parts-5mhy9yJ3.d.ts +37 -0
  54. package/dist/primitives-DE-blUz-.js +1239 -0
  55. package/dist/primitives.d.ts +5 -523
  56. package/dist/primitives.js +9 -211
  57. package/dist/redaction-CGGB2ENG.js +74 -0
  58. package/dist/redaction.d.ts +2 -42
  59. package/dist/redaction.js +2 -7
  60. package/dist/run-OyWmIDqu.d.ts +41 -0
  61. package/dist/run-ZsIKPA6J.js +17 -0
  62. package/dist/run-group-D1InSdQu.js +410 -0
  63. package/dist/run.d.ts +3 -126
  64. package/dist/run.js +5 -39
  65. package/dist/sdk-hooks.d.ts +2 -285
  66. package/dist/sdk-hooks.js +3 -35
  67. package/dist/stores.d.ts +13 -14
  68. package/dist/stores.js +34 -76
  69. package/dist/table-DHyqDPbU.js +146 -0
  70. package/dist/tabs-ujuqAdtb.js +40 -0
  71. package/dist/text-shimmer-BUUo6I-g.js +64 -0
  72. package/dist/tool-call-feed-BeB1_4pX.d.ts +47 -0
  73. package/dist/tool-call-feed-C1W1N54c.js +109 -0
  74. package/dist/tool-call-step-Bi3_YJRV.js +434 -0
  75. package/dist/tool-display-BAuAVa43.js +158 -0
  76. package/dist/{tool-display-z4JcDmMQ.d.ts → tool-display-DgmL5rIU.d.ts} +16 -16
  77. package/dist/tool-previews.d.ts +2 -48
  78. package/dist/tool-previews.js +2 -22
  79. package/dist/types.d.ts +6 -19
  80. package/dist/types.js +0 -1
  81. package/dist/use-auto-scroll-C5Pjeqon.js +153 -0
  82. package/dist/use-sse-stream-BjVBDbxK.js +884 -0
  83. package/dist/use-sse-stream-Dm6R5YWz.d.ts +282 -0
  84. package/dist/utils-Bl_CZ0Qp.js +37 -0
  85. package/dist/{chunk-RQHJBTEU.js → utils-C_uf36nf.js} +4 -6
  86. package/dist/utils.d.ts +2 -51
  87. package/dist/utils.js +6 -32
  88. package/package.json +39 -41
  89. package/src/auth/auth.tsx +5 -1
  90. package/src/chat/agent-timeline.tsx +6 -1
  91. package/src/chat/chat-container.tsx +2 -1
  92. package/src/editor/document-editor-pane.test.tsx +3 -1
  93. package/src/editor/document-editor-pane.tsx +5 -1
  94. package/src/editor/markdown-document-editor.test.tsx +9 -4
  95. package/src/files/file-artifact-pane.tsx +3 -2
  96. package/src/files/file-preview.tsx +3 -1
  97. package/src/files/file-tabs.tsx +9 -2
  98. package/src/lib/focus.ts +63 -0
  99. package/src/markdown/code-block.tsx +5 -1
  100. package/src/primitives/badge.tsx +2 -1
  101. package/src/primitives/button.tsx +2 -1
  102. package/src/primitives/card.tsx +1 -2
  103. package/src/primitives/dialog.tsx +7 -1
  104. package/src/primitives/input.tsx +15 -14
  105. package/src/primitives/segmented-control.tsx +5 -3
  106. package/src/primitives/select.tsx +3 -1
  107. package/src/primitives/switch.tsx +3 -1
  108. package/src/primitives/tabs.tsx +6 -4
  109. package/src/primitives/terminal-display.tsx +6 -8
  110. package/src/primitives/toast.tsx +5 -1
  111. package/src/tool-previews/command-preview.tsx +5 -1
  112. package/src/tool-previews/web-search-preview.tsx +2 -1
  113. package/src/utils/index.ts +7 -0
  114. package/dist/artifact-pane-DpuWcAiF.d.ts +0 -33
  115. package/dist/button-CMQuQEW_.d.ts +0 -17
  116. package/dist/chunk-34A66VBG.js +0 -214
  117. package/dist/chunk-3OI2QKFD.js +0 -0
  118. package/dist/chunk-3TI5DEHV.js +0 -299
  119. package/dist/chunk-4CLN43XT.js +0 -45
  120. package/dist/chunk-565EATZZ.js +0 -156
  121. package/dist/chunk-5Z5ZYMOJ.js +0 -0
  122. package/dist/chunk-6BGQA4BQ.js +0 -0
  123. package/dist/chunk-7YOCS6IF.js +0 -728
  124. package/dist/chunk-EOAX2ENE.js +0 -60
  125. package/dist/chunk-GYPQXTJU.js +0 -230
  126. package/dist/chunk-HFL6R6IF.js +0 -37
  127. package/dist/chunk-HGML45QH.js +0 -104
  128. package/dist/chunk-KNYSKNZX.js +0 -550
  129. package/dist/chunk-L57WRIND.js +0 -59
  130. package/dist/chunk-LDLOJKPC.js +0 -1585
  131. package/dist/chunk-LTEKI7YJ.js +0 -59
  132. package/dist/chunk-MKTSMWVD.js +0 -109
  133. package/dist/chunk-ND3ZFXQK.js +0 -179
  134. package/dist/chunk-NKDZ7GZE.js +0 -192
  135. package/dist/chunk-NWECTSOH.js +0 -589
  136. package/dist/chunk-OEX7NZE3.js +0 -321
  137. package/dist/chunk-Q56BYXQF.js +0 -61
  138. package/dist/chunk-REJESC5U.js +0 -117
  139. package/dist/chunk-RQGKSCEZ.js +0 -0
  140. package/dist/chunk-TN4FUEWY.js +0 -437
  141. package/dist/chunk-VPWY4I5O.js +0 -1048
  142. package/dist/chunk-WUQDUBJG.js +0 -168
  143. package/dist/chunk-XGKULLYE.js +0 -40
  144. package/dist/chunk-XU3HB5QL.js +0 -127
  145. package/dist/chunk-XYAIX4SU.js +0 -133
  146. package/dist/chunk-YJ6RE5WV.js +0 -875
  147. package/dist/chunk-YTO5V6QS.js +0 -19
  148. package/dist/chunk-ZKCEAIIZ.js +0 -1395
  149. package/dist/code-block-0kSpWMnf.d.ts +0 -25
  150. package/dist/document-editor-pane-EX25CEYW.js +0 -12
  151. package/dist/document-editor-pane-IAEQn_Dl.d.ts +0 -128
  152. package/dist/message-BHWbxBtT.d.ts +0 -15
  153. package/dist/parts-dj7AcUg0.d.ts +0 -36
  154. package/dist/run-PfLmDAox.d.ts +0 -41
  155. package/dist/tool-call-feed-D9iofJgW.d.ts +0 -46
@@ -1,211 +1,9 @@
1
- import {
2
- Dialog,
3
- DialogClose,
4
- DialogContent,
5
- DialogDescription,
6
- DialogFooter,
7
- DialogHeader,
8
- DialogOverlay,
9
- DialogPortal,
10
- DialogTitle,
11
- DialogTrigger,
12
- DropZone,
13
- EmptyState,
14
- FilterField,
15
- Input,
16
- Label,
17
- Logo,
18
- Metric,
19
- MetricStrip,
20
- PageHeader,
21
- Progress,
22
- SegmentedControl,
23
- Select,
24
- SelectContent,
25
- SelectGroup,
26
- SelectItem,
27
- SelectLabel,
28
- SelectScrollDownButton,
29
- SelectScrollUpButton,
30
- SelectSeparator,
31
- SelectTrigger,
32
- SelectValue,
33
- SidebarDropZone,
34
- Skeleton,
35
- SkeletonCard,
36
- SkeletonTable,
37
- StatCard,
38
- StatusPill,
39
- Switch,
40
- TangleKnot,
41
- TerminalCursor,
42
- TerminalDisplay,
43
- TerminalInput,
44
- TerminalLine,
45
- Textarea,
46
- ThemeToggle,
47
- ToastContainer,
48
- ToastProvider,
49
- Toolbar,
50
- UploadProgress,
51
- useTheme,
52
- useToast
53
- } from "./chunk-LDLOJKPC.js";
54
- import {
55
- Avatar,
56
- AvatarFallback,
57
- AvatarImage,
58
- DropdownMenu,
59
- DropdownMenuCheckboxItem,
60
- DropdownMenuContent,
61
- DropdownMenuGroup,
62
- DropdownMenuItem,
63
- DropdownMenuLabel,
64
- DropdownMenuPortal,
65
- DropdownMenuRadioGroup,
66
- DropdownMenuRadioItem,
67
- DropdownMenuSeparator,
68
- DropdownMenuShortcut,
69
- DropdownMenuSub,
70
- DropdownMenuSubContent,
71
- DropdownMenuSubTrigger,
72
- DropdownMenuTrigger
73
- } from "./chunk-34A66VBG.js";
74
- import {
75
- TextShimmer
76
- } from "./chunk-L57WRIND.js";
77
- import {
78
- Badge,
79
- Card,
80
- CardContent,
81
- CardDescription,
82
- CardFooter,
83
- CardHeader,
84
- CardTitle,
85
- InlineCode,
86
- Table,
87
- TableBody,
88
- TableCaption,
89
- TableCell,
90
- TableFooter,
91
- TableHead,
92
- TableHeader,
93
- TableRow,
94
- badgeVariants
95
- } from "./chunk-GYPQXTJU.js";
96
- import {
97
- Button,
98
- buttonVariants
99
- } from "./chunk-MKTSMWVD.js";
100
- import {
101
- Tabs,
102
- TabsContent,
103
- TabsList,
104
- TabsTrigger
105
- } from "./chunk-Q56BYXQF.js";
106
- import {
107
- ArtifactPane
108
- } from "./chunk-LTEKI7YJ.js";
109
- import {
110
- CodeBlock,
111
- CopyButton
112
- } from "./chunk-WUQDUBJG.js";
113
- import "./chunk-RQHJBTEU.js";
114
- export {
115
- ArtifactPane,
116
- Avatar,
117
- AvatarFallback,
118
- AvatarImage,
119
- Badge,
120
- Button,
121
- Card,
122
- CardContent,
123
- CardDescription,
124
- CardFooter,
125
- CardHeader,
126
- CardTitle,
127
- CodeBlock,
128
- CopyButton,
129
- Dialog,
130
- DialogClose,
131
- DialogContent,
132
- DialogDescription,
133
- DialogFooter,
134
- DialogHeader,
135
- DialogOverlay,
136
- DialogPortal,
137
- DialogTitle,
138
- DialogTrigger,
139
- DropZone,
140
- DropdownMenu,
141
- DropdownMenuCheckboxItem,
142
- DropdownMenuContent,
143
- DropdownMenuGroup,
144
- DropdownMenuItem,
145
- DropdownMenuLabel,
146
- DropdownMenuPortal,
147
- DropdownMenuRadioGroup,
148
- DropdownMenuRadioItem,
149
- DropdownMenuSeparator,
150
- DropdownMenuShortcut,
151
- DropdownMenuSub,
152
- DropdownMenuSubContent,
153
- DropdownMenuSubTrigger,
154
- DropdownMenuTrigger,
155
- EmptyState,
156
- FilterField,
157
- InlineCode,
158
- Input,
159
- Label,
160
- Logo,
161
- Metric,
162
- MetricStrip,
163
- PageHeader,
164
- Progress,
165
- SegmentedControl,
166
- Select,
167
- SelectContent,
168
- SelectGroup,
169
- SelectItem,
170
- SelectLabel,
171
- SelectScrollDownButton,
172
- SelectScrollUpButton,
173
- SelectSeparator,
174
- SelectTrigger,
175
- SelectValue,
176
- SidebarDropZone,
177
- Skeleton,
178
- SkeletonCard,
179
- SkeletonTable,
180
- StatCard,
181
- StatusPill,
182
- Switch,
183
- Table,
184
- TableBody,
185
- TableCaption,
186
- TableCell,
187
- TableFooter,
188
- TableHead,
189
- TableHeader,
190
- TableRow,
191
- Tabs,
192
- TabsContent,
193
- TabsList,
194
- TabsTrigger,
195
- TangleKnot,
196
- TerminalCursor,
197
- TerminalDisplay,
198
- TerminalInput,
199
- TerminalLine,
200
- TextShimmer,
201
- Textarea,
202
- ThemeToggle,
203
- ToastContainer,
204
- ToastProvider,
205
- Toolbar,
206
- UploadProgress,
207
- badgeVariants,
208
- buttonVariants,
209
- useTheme,
210
- useToast
211
- };
1
+ import { n as buttonVariants, t as Button } from "./button-uhNnwdsD.js";
2
+ import { a as TableFooter, c as TableRow, d as Card, f as CardContent, g as CardTitle, h as CardHeader, i as TableCell, l as Badge, m as CardFooter, n as TableBody, o as TableHead, p as CardDescription, r as TableCaption, s as TableHeader, t as Table, u as badgeVariants } from "./table-DHyqDPbU.js";
3
+ import { A as SegmentedControl, B as SelectValue, C as ToastProvider, D as SkeletonTable, E as SkeletonCard, F as SelectLabel, G as DialogContent, H as Textarea, I as SelectScrollDownButton, J as DialogHeader, K as DialogDescription, L as SelectScrollUpButton, M as SelectContent, N as SelectGroup, O as Switch, P as SelectItem, Q as DialogTrigger, R as SelectSeparator, S as ToastContainer, T as Skeleton, U as Dialog, V as Input, W as DialogClose, X as DialogPortal, Y as DialogOverlay, Z as DialogTitle, _ as TerminalInput, a as Metric, b as EmptyState, c as PageHeader, d as InlineCode, f as SidebarDropZone, g as TerminalDisplay, h as TerminalCursor, i as Toolbar, j as Select, k as Progress, l as ThemeToggle, m as DropZone, n as TangleKnot, o as MetricStrip, p as UploadProgress, q as DialogFooter, r as FilterField, s as StatusPill, t as Logo, u as useTheme, v as TerminalLine, w as useToast, x as Label, y as StatCard, z as SelectTrigger } from "./primitives-DE-blUz-.js";
4
+ import { _ as AvatarFallback, a as DropdownMenuItem, c as DropdownMenuRadioGroup, d as DropdownMenuShortcut, f as DropdownMenuSub, g as Avatar, h as DropdownMenuTrigger, i as DropdownMenuGroup, l as DropdownMenuRadioItem, m as DropdownMenuSubTrigger, n as DropdownMenuCheckboxItem, o as DropdownMenuLabel, p as DropdownMenuSubContent, r as DropdownMenuContent, s as DropdownMenuPortal, t as DropdownMenu, u as DropdownMenuSeparator, v as AvatarImage } from "./dropdown-menu-BpcLa5vF.js";
5
+ import { i as TabsTrigger, n as TabsContent, r as TabsList, t as Tabs } from "./tabs-ujuqAdtb.js";
6
+ import { t as TextShimmer } from "./text-shimmer-BUUo6I-g.js";
7
+ import { t as ArtifactPane } from "./artifact-pane-DMXT9a8U.js";
8
+ import { n as CopyButton, t as CodeBlock } from "./code-block-CngSn37j.js";
9
+ export { ArtifactPane, Avatar, AvatarFallback, AvatarImage, Badge, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CodeBlock, CopyButton, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropZone, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, FilterField, InlineCode, Input, Label, Logo, Metric, MetricStrip, PageHeader, Progress, SegmentedControl, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, SidebarDropZone, Skeleton, SkeletonCard, SkeletonTable, StatCard, StatusPill, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TangleKnot, TerminalCursor, TerminalDisplay, TerminalInput, TerminalLine, TextShimmer, Textarea, ThemeToggle, ToastContainer, ToastProvider, Toolbar, UploadProgress, badgeVariants, buttonVariants, useTheme, useToast };
@@ -0,0 +1,74 @@
1
+ import { t as cn } from "./utils-C_uf36nf.js";
2
+ import { useCallback, useState } from "react";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ import { Eye, EyeOff, Loader2, ShieldAlert } from "lucide-react";
5
+ //#region src/redaction/redacted-document.tsx
6
+ const defaultLabel = (kind) => kind.replace(/[-_]/g, " ").toUpperCase();
7
+ function RedactedChip({ kind, label, onReveal }) {
8
+ const [state, setState] = useState({ status: "masked" });
9
+ const reveal = useCallback(async () => {
10
+ setState({ status: "loading" });
11
+ try {
12
+ const r = await onReveal();
13
+ setState(r.ok && r.value !== void 0 ? {
14
+ status: "revealed",
15
+ value: r.value
16
+ } : {
17
+ status: "denied",
18
+ reason: r.reason
19
+ });
20
+ } catch {
21
+ setState({
22
+ status: "denied",
23
+ reason: "error"
24
+ });
25
+ }
26
+ }, [onReveal]);
27
+ if (state.status === "revealed") return /* @__PURE__ */ jsxs("button", {
28
+ type: "button",
29
+ onClick: () => setState({ status: "masked" }),
30
+ title: "Revealed — click to hide",
31
+ "aria-label": `${label}: revealed, click to hide`,
32
+ className: cn("inline-flex items-center gap-1 rounded-[var(--radius-sm)] px-1 font-medium", "bg-[color-mix(in_oklch,var(--color-warning,orange)_18%,transparent)] text-foreground ring-1 ring-warning/40"),
33
+ children: [state.value, /* @__PURE__ */ jsx(EyeOff, { className: "size-3 opacity-60" })]
34
+ });
35
+ if (state.status === "denied") return /* @__PURE__ */ jsxs("span", {
36
+ title: `Restricted${state.reason ? ` (${state.reason})` : ""}`,
37
+ "aria-label": `${label}: restricted`,
38
+ className: "inline-flex items-center gap-1 rounded-[var(--radius-sm)] bg-muted px-1 text-muted-foreground",
39
+ children: [
40
+ /* @__PURE__ */ jsx(ShieldAlert, { className: "size-3" }),
41
+ " ",
42
+ label
43
+ ]
44
+ });
45
+ return /* @__PURE__ */ jsxs("button", {
46
+ type: "button",
47
+ disabled: state.status === "loading",
48
+ onClick: reveal,
49
+ title: `${label} — click to reveal`,
50
+ "aria-label": `${label} redacted, click to reveal`,
51
+ className: cn("inline-flex items-center gap-1 rounded-[var(--radius-sm)] px-1 font-medium tracking-wide", "bg-muted text-muted-foreground hover:bg-muted/80 hover:text-foreground transition-colors", "cursor-pointer select-none"),
52
+ children: [
53
+ state.status === "loading" ? /* @__PURE__ */ jsx(Loader2, { className: "size-3 animate-spin" }) : /* @__PURE__ */ jsx(Eye, { className: "size-3 opacity-60" }),
54
+ /* @__PURE__ */ jsx("span", {
55
+ "aria-hidden": true,
56
+ children: "███"
57
+ }),
58
+ " ",
59
+ label
60
+ ]
61
+ });
62
+ }
63
+ function RedactedDocument({ document, onReveal, labelForKind = defaultLabel, className }) {
64
+ return /* @__PURE__ */ jsx("div", {
65
+ className: cn("whitespace-pre-wrap break-words leading-relaxed", className),
66
+ children: document.segments.map((seg, i) => seg.type === "text" ? /* @__PURE__ */ jsx("span", { children: seg.text }, i) : /* @__PURE__ */ jsx(RedactedChip, {
67
+ kind: seg.kind,
68
+ label: labelForKind(seg.kind),
69
+ onReveal: () => onReveal(seg.id)
70
+ }, seg.id))
71
+ });
72
+ }
73
+ //#endregion
74
+ export { RedactedDocument as t };
@@ -1,42 +1,2 @@
1
- import { ReactNode } from 'react';
2
-
3
- /**
4
- * Viewer for a server-produced redacted document. Renders text inline and each
5
- * redacted span as a masked chip; clicking a chip asks the server to reveal that
6
- * one span. The original plaintext is NEVER in the document the client holds —
7
- * the chip carries only an id + kind; `onReveal` round-trips to the server, where
8
- * `@tangle-network/agent-app/redact`'s `revealSpan` runs the authorization check
9
- * and writes the audit trail. So authz + audit are server-truth; this is display.
10
- *
11
- * Structural types (no `@tangle-network/agent-app` dependency) — the viewer needs
12
- * only `{ id, kind }` per span; the cipher stays server-side.
13
- */
14
- type RedactedDocSegment = {
15
- type: "text";
16
- text: string;
17
- } | {
18
- type: "redacted";
19
- id: string;
20
- kind: string;
21
- };
22
- interface RedactedDocumentData {
23
- segments: RedactedDocSegment[];
24
- }
25
- interface RevealResult {
26
- ok: boolean;
27
- value?: string;
28
- /** e.g. `forbidden` | `not_found` when `ok` is false. */
29
- reason?: string;
30
- }
31
- interface RedactedDocumentProps {
32
- document: RedactedDocumentData;
33
- /** Reveal one span by id. Wire to a server route that calls agent-app's
34
- * `revealSpan` (authz + audit happen there). Resolves with the original. */
35
- onReveal: (spanId: string) => Promise<RevealResult>;
36
- /** Display label for a redaction kind (default: the kind, upper-cased). */
37
- labelForKind?: (kind: string) => string;
38
- className?: string;
39
- }
40
- declare function RedactedDocument({ document, onReveal, labelForKind, className, }: RedactedDocumentProps): ReactNode;
41
-
42
- export { type RedactedDocSegment, RedactedDocument, type RedactedDocumentData, type RedactedDocumentProps, type RevealResult };
1
+ import { a as RevealResult, i as RedactedDocumentProps, n as RedactedDocument, r as RedactedDocumentData, t as RedactedDocSegment } from "./index-COgqsFAQ.js";
2
+ export { type RedactedDocSegment, RedactedDocument, type RedactedDocumentData, type RedactedDocumentProps, type RevealResult };
package/dist/redaction.js CHANGED
@@ -1,7 +1,2 @@
1
- import {
2
- RedactedDocument
3
- } from "./chunk-HGML45QH.js";
4
- import "./chunk-RQHJBTEU.js";
5
- export {
6
- RedactedDocument
7
- };
1
+ import { t as RedactedDocument } from "./redaction-CGGB2ENG.js";
2
+ export { RedactedDocument };
@@ -0,0 +1,41 @@
1
+ import { t as SessionMessage } from "./message-vhUI0c5G.js";
2
+ //#region src/types/run.d.ts
3
+ /** Broad category of a tool invocation, used for display grouping. */
4
+ type ToolCategory = "command" | "write" | "read" | "search" | "edit" | "task" | "web" | "todo" | "other";
5
+ interface RunStats {
6
+ toolCount: number;
7
+ messageCount: number;
8
+ thinkingDurationMs: number;
9
+ textPartCount: number;
10
+ toolCategories: Set<ToolCategory>;
11
+ }
12
+ interface FinalTextPart {
13
+ messageId: string;
14
+ partIndex: number;
15
+ text: string;
16
+ }
17
+ /**
18
+ * A Run is a consecutive group of assistant messages that form one
19
+ * logical "turn" of the agent. Runs are collapsible in the UI and
20
+ * show a summary header when collapsed.
21
+ */
22
+ interface Run {
23
+ id: string;
24
+ messages: SessionMessage[];
25
+ isComplete: boolean;
26
+ isStreaming: boolean;
27
+ stats: RunStats;
28
+ summaryText: string | null;
29
+ finalTextPart: FinalTextPart | null;
30
+ }
31
+ interface MessageRun {
32
+ type: "run";
33
+ run: Run;
34
+ }
35
+ interface MessageUser {
36
+ type: "user";
37
+ message: SessionMessage;
38
+ }
39
+ type GroupedMessage = MessageRun | MessageUser;
40
+ //#endregion
41
+ export { Run as a, MessageUser as i, GroupedMessage as n, RunStats as o, MessageRun as r, ToolCategory as s, FinalTextPart as t };
@@ -0,0 +1,17 @@
1
+ import { n as formatDuration } from "./format-DfcLWqMa.js";
2
+ import { useEffect, useState } from "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+ //#region src/run/run-item-primitives.tsx
5
+ function LiveDuration({ startTime }) {
6
+ const [elapsed, setElapsed] = useState(Date.now() - startTime);
7
+ useEffect(() => {
8
+ const id = setInterval(() => setElapsed(Date.now() - startTime), 100);
9
+ return () => clearInterval(id);
10
+ }, [startTime]);
11
+ return /* @__PURE__ */ jsx("span", {
12
+ className: "text-xs font-mono text-neutral-400 dark:text-neutral-500 tabular-nums",
13
+ children: formatDuration(elapsed)
14
+ });
15
+ }
16
+ //#endregion
17
+ export { LiveDuration as t };