@tangle-network/ui 11.10.0 → 11.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +4 -1
  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-DOETfnd9.js +154 -0
  8. package/dist/auth.d.ts +2 -74
  9. package/dist/auth.js +2 -16
  10. package/dist/branding-26d5ARIr.d.ts +14 -0
  11. package/dist/button-C87nEe2R.js +78 -0
  12. package/dist/button-yoIv77e2.d.ts +16 -0
  13. package/dist/chat-D4jAfEmj.js +667 -0
  14. package/dist/chat.d.ts +2 -201
  15. package/dist/chat.js +2 -31
  16. package/dist/code-block-B36KVUSN.js +165 -0
  17. package/dist/code-block-B9miUPht.d.ts +23 -0
  18. package/dist/diff-preview-BcK3nRXb.js +533 -0
  19. package/dist/document-editor-pane-BcoABlhn.d.ts +131 -0
  20. package/dist/document-editor-pane-BxlPjaTP.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 -34
  24. package/dist/file-format-BgXbr-Ib.js +160 -0
  25. package/dist/files-Bug33qCl.js +743 -0
  26. package/dist/files.d.ts +2 -243
  27. package/dist/files.js +3 -41
  28. package/dist/focus-BcE_SHqz.js +57 -0
  29. package/dist/format-DfcLWqMa.js +54 -0
  30. package/dist/hooks.d.ts +30 -37
  31. package/dist/hooks.js +111 -46
  32. package/dist/index-2UntyjBb.d.ts +52 -0
  33. package/dist/index-BgUHilZm.d.ts +108 -0
  34. package/dist/index-COgqsFAQ.d.ts +42 -0
  35. package/dist/index-CPDET_s1.d.ts +549 -0
  36. package/dist/index-CUhfHT_V.d.ts +204 -0
  37. package/dist/index-Cg6gYAqh.d.ts +73 -0
  38. package/dist/index-Cq-EJzqW.d.ts +16 -0
  39. package/dist/index-DhYmSaLF.d.ts +245 -0
  40. package/dist/index-DjKxO357.d.ts +128 -0
  41. package/dist/index.d.ts +26 -43
  42. package/dist/index.js +35 -472
  43. package/dist/markdown-BGqicV82.js +45 -0
  44. package/dist/markdown.d.ts +3 -18
  45. package/dist/markdown.js +3 -15
  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-DrU1AdVk.js +266 -0
  51. package/dist/openui.d.ts +2 -115
  52. package/dist/openui.js +2 -13
  53. package/dist/parts-5mhy9yJ3.d.ts +37 -0
  54. package/dist/primitives-Cb8GGVKr.js +1239 -0
  55. package/dist/primitives.d.ts +5 -525
  56. package/dist/primitives.js +9 -212
  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-BACLbCFl.js +410 -0
  63. package/dist/run.d.ts +3 -126
  64. package/dist/run.js +5 -40
  65. package/dist/sdk-hooks.d.ts +2 -285
  66. package/dist/sdk-hooks.js +3 -36
  67. package/dist/stores.d.ts +13 -14
  68. package/dist/stores.js +34 -76
  69. package/dist/table-Bss73DhB.js +146 -0
  70. package/dist/tabs-BVHR6NkO.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-Djt2q11V.js +109 -0
  74. package/dist/tool-call-step-DNebqhmX.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 -23
  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-BVgO1QBN.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 -104
  87. package/dist/utils.js +6 -44
  88. package/package.json +39 -41
  89. package/src/lib/focus.ts +2 -1
  90. package/dist/artifact-pane-DpuWcAiF.d.ts +0 -33
  91. package/dist/button-CMQuQEW_.d.ts +0 -17
  92. package/dist/chunk-34A66VBG.js +0 -214
  93. package/dist/chunk-3OI2QKFD.js +0 -0
  94. package/dist/chunk-3XXBZL53.js +0 -174
  95. package/dist/chunk-42PAH5D2.js +0 -112
  96. package/dist/chunk-4CLN43XT.js +0 -45
  97. package/dist/chunk-55WHV7SS.js +0 -1604
  98. package/dist/chunk-565EATZZ.js +0 -156
  99. package/dist/chunk-5Z5ZYMOJ.js +0 -0
  100. package/dist/chunk-6BGQA4BQ.js +0 -0
  101. package/dist/chunk-BEBXZPHW.js +0 -299
  102. package/dist/chunk-C5WF4WMV.js +0 -734
  103. package/dist/chunk-HFL6R6IF.js +0 -37
  104. package/dist/chunk-HGML45QH.js +0 -104
  105. package/dist/chunk-HMAPIH7L.js +0 -595
  106. package/dist/chunk-K5XFRUS4.js +0 -1401
  107. package/dist/chunk-KFQGHD73.js +0 -198
  108. package/dist/chunk-L57WRIND.js +0 -59
  109. package/dist/chunk-LTEKI7YJ.js +0 -59
  110. package/dist/chunk-M3QZK62R.js +0 -233
  111. package/dist/chunk-ND3ZFXQK.js +0 -179
  112. package/dist/chunk-OEX7NZE3.js +0 -321
  113. package/dist/chunk-OL5GYLHV.js +0 -60
  114. package/dist/chunk-QGFYBNSO.js +0 -133
  115. package/dist/chunk-R7B3UWPF.js +0 -550
  116. package/dist/chunk-R7SUY4E3.js +0 -65
  117. package/dist/chunk-REJESC5U.js +0 -117
  118. package/dist/chunk-RQGKSCEZ.js +0 -0
  119. package/dist/chunk-SNLR2AEA.js +0 -40
  120. package/dist/chunk-WKWBTL2V.js +0 -15
  121. package/dist/chunk-X7CU776B.js +0 -1048
  122. package/dist/chunk-XU3HB5QL.js +0 -127
  123. package/dist/chunk-YTO5V6QS.js +0 -19
  124. package/dist/chunk-YU4E5J2N.js +0 -437
  125. package/dist/chunk-YZ6AK25N.js +0 -886
  126. package/dist/code-block-0kSpWMnf.d.ts +0 -25
  127. package/dist/document-editor-pane-IAEQn_Dl.d.ts +0 -128
  128. package/dist/document-editor-pane-QHDOBA43.js +0 -13
  129. package/dist/message-BHWbxBtT.d.ts +0 -15
  130. package/dist/parts-dj7AcUg0.d.ts +0 -36
  131. package/dist/run-PfLmDAox.d.ts +0 -41
  132. package/dist/tool-call-feed-D9iofJgW.d.ts +0 -46
@@ -0,0 +1,52 @@
1
+ import { i as ToolPart } from "./parts-5mhy9yJ3.js";
2
+ //#region src/tool-previews/command-preview.d.ts
3
+ interface CommandPreviewProps {
4
+ part: ToolPart;
5
+ }
6
+ /**
7
+ * Terminal-style command output preview.
8
+ * Shows the command, exit code, and stdout/stderr with expand/collapse.
9
+ */
10
+ declare const CommandPreview: import("react").MemoExoticComponent<({ part }: CommandPreviewProps) => import("react").JSX.Element>;
11
+ //#endregion
12
+ //#region src/tool-previews/write-file-preview.d.ts
13
+ interface WriteFilePreviewProps {
14
+ part: ToolPart;
15
+ }
16
+ /**
17
+ * Preview for file write/create operations.
18
+ * Shows file path, line count, and the written content.
19
+ */
20
+ declare const WriteFilePreview: import("react").MemoExoticComponent<({ part }: WriteFilePreviewProps) => import("react").JSX.Element | null>;
21
+ //#endregion
22
+ //#region src/tool-previews/grep-results-preview.d.ts
23
+ interface GrepResultsPreviewProps {
24
+ part: ToolPart;
25
+ }
26
+ declare const GrepResultsPreview: import("react").MemoExoticComponent<({ part }: GrepResultsPreviewProps) => import("react").JSX.Element>;
27
+ //#endregion
28
+ //#region src/tool-previews/glob-results-preview.d.ts
29
+ interface GlobResultsPreviewProps {
30
+ part: ToolPart;
31
+ }
32
+ declare const GlobResultsPreview: import("react").MemoExoticComponent<({ part }: GlobResultsPreviewProps) => import("react").JSX.Element>;
33
+ //#endregion
34
+ //#region src/tool-previews/web-search-preview.d.ts
35
+ interface WebSearchPreviewProps {
36
+ part: ToolPart;
37
+ }
38
+ declare const WebSearchPreview: import("react").MemoExoticComponent<({ part }: WebSearchPreviewProps) => import("react").JSX.Element>;
39
+ //#endregion
40
+ //#region src/tool-previews/question-preview.d.ts
41
+ interface QuestionPreviewProps {
42
+ part: ToolPart;
43
+ }
44
+ declare const QuestionPreview: import("react").MemoExoticComponent<({ part }: QuestionPreviewProps) => import("react").JSX.Element>;
45
+ //#endregion
46
+ //#region src/tool-previews/diff-preview.d.ts
47
+ interface DiffPreviewProps {
48
+ part: ToolPart;
49
+ }
50
+ declare const DiffPreview: import("react").MemoExoticComponent<({ part }: DiffPreviewProps) => import("react").JSX.Element>;
51
+ //#endregion
52
+ export { WebSearchPreview as a, GlobResultsPreviewProps as c, WriteFilePreview as d, WriteFilePreviewProps as f, QuestionPreviewProps as i, GrepResultsPreview as l, CommandPreviewProps as m, DiffPreviewProps as n, WebSearchPreviewProps as o, CommandPreview as p, QuestionPreview as r, GlobResultsPreview as s, DiffPreview as t, GrepResultsPreviewProps as u };
@@ -0,0 +1,108 @@
1
+ import { i as ToolPart } from "./parts-5mhy9yJ3.js";
2
+ import { r as ToolDisplayMetadata } from "./tool-display-DgmL5rIU.js";
3
+ import { s as ToolCategory } from "./run-OyWmIDqu.js";
4
+ import { ClassValue } from "clsx";
5
+ //#region src/utils/copy-text.d.ts
6
+ /**
7
+ * Copy text to clipboard with a non-secure-context fallback.
8
+ * Returns true if a copy strategy likely succeeded.
9
+ */
10
+ declare function copyText(text: string): Promise<boolean>;
11
+ //#endregion
12
+ //#region src/utils/format.d.ts
13
+ /** Format a duration in milliseconds to a human-readable string. */
14
+ declare function formatDuration(ms: number): string;
15
+ /** Truncate text to `max` characters, appending "..." if truncated. */
16
+ declare function truncateText(text: string, max: number): string;
17
+ /**
18
+ * Format an uptime duration in milliseconds with progressive
19
+ * granularity, so short-lived sandboxes don't render as "0d 0h".
20
+ * - < 60s → "Ns"
21
+ * - < 60m → "Nm Ss"
22
+ * - < 24h → "Nh Mm"
23
+ * - otherwise → "Nd Hh"
24
+ */
25
+ declare function formatUptime(ms: number): string;
26
+ /**
27
+ * Format a byte count using binary units (KiB/MiB/GiB, surfaced as
28
+ * "KB/MB/GB" for readability). KB and MB use one decimal below 10 and
29
+ * round above; GB keeps two decimals below 10 so half-GB changes stay
30
+ * visible on memory dashboards, and drops to one decimal above.
31
+ */
32
+ declare function formatBytes(bytes: number): string;
33
+ //#endregion
34
+ //#region src/utils/time-ago.d.ts
35
+ declare function timeAgo(ts: number): string;
36
+ //#endregion
37
+ //#region src/utils/tool-display.d.ts
38
+ declare const TOOL_CATEGORY_ICONS: Record<ToolCategory, string>;
39
+ declare function getToolCategory(toolName: string): ToolCategory;
40
+ /**
41
+ * Title is the bare verb ("Read", "Edit", "Shell"); the path, command, pattern
42
+ * or query lives in `description` only, so a row prints its subject once.
43
+ * `targetPath` / `commandSnippet` carry the untruncated value for consumers
44
+ * that need it (diff headers, expanded detail).
45
+ */
46
+ declare function getToolDisplayMetadata(part: ToolPart): ToolDisplayMetadata;
47
+ /** Extract error text from a tool part, if any. */
48
+ declare function getToolErrorText(part: ToolPart, fallback?: string): string | undefined;
49
+ //#endregion
50
+ //#region src/lib/utils.d.ts
51
+ declare function cn(...inputs: ClassValue[]): string;
52
+ //#endregion
53
+ //#region src/lib/focus.d.ts
54
+ /**
55
+ * The focus treatment every control shares, in two shapes over one palette
56
+ * (`--focus-border`, `--focus-halo` and `--border-strong` from
57
+ * `@tangle-network/brand`'s tokens.css).
58
+ *
59
+ * A FIELD — input, textarea, select trigger, composer — shows focus on its own
60
+ * border: the hairline shifts to `--focus-border` and a 3px `--focus-halo` ring
61
+ * spreads outside it. It keys off `:focus`, because a caret in a field needs the
62
+ * cue whether the field was clicked or tabbed into.
63
+ *
64
+ * A CONTROL — button, tab, switch, link, card — has no border to shift, so it
65
+ * draws a 1px `--focus-border` outline with the same 3px halo beyond it. It keys
66
+ * off `:focus-visible`, so a mouse click leaves no ring.
67
+ *
68
+ * The halo is a Tailwind ring, which renders as box-shadow: it follows
69
+ * border-radius and never moves layout, and a consumer removes it with
70
+ * `focus:ring-0` / `focus-visible:ring-0`, which tailwind-merge resolves against
71
+ * these classes. The control's line is an outline so that forced-colors mode,
72
+ * which drops box-shadows, still paints it. A field has its border for that, so
73
+ * it hides the outline with `outline-hidden`, which stays transparent-but-present
74
+ * in forced-colors mode.
75
+ */
76
+ /**
77
+ * Resting hairline, neutral hover, and `:focus` border plus halo for a text
78
+ * field. The hover is a plain `hover:` class so a consumer's `hover:border-*`
79
+ * replaces it through tailwind-merge; the focus border outranks it because
80
+ * Tailwind emits `focus:` after `hover:`.
81
+ */
82
+ declare const focusField = "border-border transition-[border-color,box-shadow] duration-150 ease-out hover:border-[var(--border-strong)] focus:outline-hidden focus:border-[var(--focus-border)] focus:ring-3 focus:ring-[var(--focus-halo)]";
83
+ /**
84
+ * The field treatment for a container that wraps a borderless field, such as a
85
+ * composer around a textarea and its buttons. It lights while a FIELD inside
86
+ * has focus: a text input, textarea, native select or contenteditable editor. A
87
+ * focused button, checkbox or button-type input inside the container shows only
88
+ * its own ring, so a click on the send button does not read as field focus and
89
+ * a tab to it does not stack two indicators. `:focus-within` cannot tell the
90
+ * two apart, so the rule keys off `:has()`; a consumer's `focus-within:*` class
91
+ * therefore does not replace it. To style that container's focus differently,
92
+ * compose your own classes instead of this helper. The field selector is
93
+ * written out in full because Tailwind reads class names statically.
94
+ * Base styles use its marker class to clear the inner editor fallback outline.
95
+ */
96
+ declare const focusFieldWithin = "focus-field-within border-border transition-[border-color,box-shadow] duration-150 ease-out hover:border-[var(--border-strong)] has-[:is(textarea,select,[contenteditable]:not([contenteditable=false]),input:not([type=button],[type=submit],[type=reset],[type=image],[type=checkbox],[type=radio],[type=range],[type=color],[type=file])):focus]:border-[var(--focus-border)] has-[:is(textarea,select,[contenteditable]:not([contenteditable=false]),input:not([type=button],[type=submit],[type=reset],[type=image],[type=checkbox],[type=radio],[type=range],[type=color],[type=file])):focus]:ring-3 has-[:is(textarea,select,[contenteditable]:not([contenteditable=false]),input:not([type=button],[type=submit],[type=reset],[type=image],[type=checkbox],[type=radio],[type=range],[type=color],[type=file])):focus]:ring-[var(--focus-halo)]";
97
+ /** Error state for a field: a danger hairline and the same focus shape in danger. Compose after `focusField`. */
98
+ declare const focusFieldInvalid = "border-[var(--surface-danger-border)] hover:border-[var(--surface-danger-border)] focus:border-[var(--focus-border-danger)] focus:ring-[var(--focus-halo-danger)]";
99
+ /** Keyboard-only focus for a control: a 1px focus line with the halo beyond it. */
100
+ declare const focusRing = "focus-visible:outline-1 focus-visible:outline-[var(--focus-border)] focus-visible:ring-4 focus-visible:ring-[var(--focus-halo)] focus-visible:outline-offset-0";
101
+ /**
102
+ * `focusRing` drawn inside the box, for a control flush against a scroll
103
+ * container or its neighbours (a tab strip, a list row), where an outer ring
104
+ * would be clipped or would overlap them.
105
+ */
106
+ declare const focusRingInset = "focus-visible:outline-1 focus-visible:outline-[var(--focus-border)] focus-visible:ring-4 focus-visible:ring-[var(--focus-halo)] focus-visible:-outline-offset-1 focus-visible:ring-inset";
107
+ //#endregion
108
+ export { focusRingInset as a, getToolCategory as c, timeAgo as d, formatBytes as f, copyText as g, truncateText as h, focusRing as i, getToolDisplayMetadata as l, formatUptime as m, focusFieldInvalid as n, cn as o, formatDuration as p, focusFieldWithin as r, TOOL_CATEGORY_ICONS as s, focusField as t, getToolErrorText as u };
@@ -0,0 +1,42 @@
1
+ import { ReactNode } from "react";
2
+ //#region src/redaction/redacted-document.d.ts
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
+ //#endregion
42
+ export { RevealResult as a, RedactedDocumentProps as i, RedactedDocument as n, RedactedDocumentData as r, RedactedDocSegment as t };