@locusgraph/loop 0.0.0-stage → 0.2.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 (214) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +37 -2
  3. package/dist/agent/index.d.ts +5 -0
  4. package/dist/agent/index.js +5 -0
  5. package/dist/agent/pulse/gradient-label.d.ts +7 -0
  6. package/dist/agent/pulse/gradient-label.js +94 -0
  7. package/dist/agent/pulse/marks/bars-mark.d.ts +1 -0
  8. package/dist/agent/pulse/marks/bars-mark.js +51 -0
  9. package/dist/agent/pulse/marks/glyph-mark.d.ts +4 -0
  10. package/dist/agent/pulse/marks/glyph-mark.js +62 -0
  11. package/dist/agent/pulse/marks/locus-mark.d.ts +1 -0
  12. package/dist/agent/pulse/marks/locus-mark.js +73 -0
  13. package/dist/agent/pulse/marks/orb-mark.d.ts +1 -0
  14. package/dist/agent/pulse/marks/orb-mark.js +34 -0
  15. package/dist/agent/pulse/marks/spinner-mark.d.ts +1 -0
  16. package/dist/agent/pulse/marks/spinner-mark.js +32 -0
  17. package/dist/agent/pulse/pulse-tone.d.ts +1 -0
  18. package/dist/agent/pulse/pulse-tone.js +1 -0
  19. package/dist/agent/pulse/pulse.d.ts +12 -0
  20. package/dist/agent/pulse/pulse.js +166 -0
  21. package/dist/agent/pulse/use-loop-animation.d.ts +2 -0
  22. package/dist/agent/pulse/use-loop-animation.js +40 -0
  23. package/dist/agent/shared/status-dot.d.ts +1 -0
  24. package/dist/agent/shared/status-dot.js +1 -0
  25. package/dist/agent/steps/step-icon.d.ts +8 -0
  26. package/dist/agent/steps/step-icon.js +117 -0
  27. package/dist/agent/steps/steps.d.ts +7 -0
  28. package/dist/agent/steps/steps.js +249 -0
  29. package/dist/agent/thinking/thinking.d.ts +6 -0
  30. package/dist/agent/thinking/thinking.js +211 -0
  31. package/dist/agent/thinking/thought-duration.d.ts +2 -0
  32. package/dist/agent/thinking/thought-duration.js +11 -0
  33. package/dist/agent/tool/json-block.d.ts +5 -0
  34. package/dist/agent/tool/json-block.js +42 -0
  35. package/dist/agent/tool/tool-status.d.ts +6 -0
  36. package/dist/agent/tool/tool-status.js +59 -0
  37. package/dist/agent/tool/tool.d.ts +7 -0
  38. package/dist/agent/tool/tool.js +192 -0
  39. package/dist/approval/inbox/inbox-row.d.ts +12 -0
  40. package/dist/approval/inbox/inbox-row.js +328 -0
  41. package/dist/approval/inbox/inbox-selection.d.ts +6 -0
  42. package/dist/approval/inbox/inbox-selection.js +15 -0
  43. package/dist/approval/inbox/inbox.d.ts +12 -0
  44. package/dist/approval/inbox/inbox.js +258 -0
  45. package/dist/approval/inbox/virtual-inbox-list.d.ts +13 -0
  46. package/dist/approval/inbox/virtual-inbox-list.js +129 -0
  47. package/dist/approval/index.d.ts +9 -0
  48. package/dist/approval/index.js +8 -0
  49. package/dist/approval/memory/memory-choices.d.ts +10 -0
  50. package/dist/approval/memory/memory-choices.js +35 -0
  51. package/dist/approval/memory/memory-review.d.ts +11 -0
  52. package/dist/approval/memory/memory-review.js +256 -0
  53. package/dist/approval/memory/memory-row.d.ts +9 -0
  54. package/dist/approval/memory/memory-row.js +226 -0
  55. package/dist/approval/plan/plan-review.d.ts +13 -0
  56. package/dist/approval/plan/plan-review.js +289 -0
  57. package/dist/approval/plan/plan-step-row.d.ts +13 -0
  58. package/dist/approval/plan/plan-step-row.js +201 -0
  59. package/dist/approval/plan/plan-steps.d.ts +8 -0
  60. package/dist/approval/plan/plan-steps.js +30 -0
  61. package/dist/approval/plan/question-choices.d.ts +10 -0
  62. package/dist/approval/plan/question-choices.js +166 -0
  63. package/dist/approval/plan/question.d.ts +18 -0
  64. package/dist/approval/plan/question.js +232 -0
  65. package/dist/approval/run/run-bar.d.ts +13 -0
  66. package/dist/approval/run/run-bar.js +189 -0
  67. package/dist/approval/shared/decision-line.d.ts +1 -0
  68. package/dist/approval/shared/decision-line.js +1 -0
  69. package/dist/approval/shared/risk-badge.d.ts +10 -0
  70. package/dist/approval/shared/risk-badge.js +57 -0
  71. package/dist/approval/shared/time.d.ts +3 -0
  72. package/dist/approval/shared/time.js +12 -0
  73. package/dist/approval/shared/use-focus-on-mount.d.ts +2 -0
  74. package/dist/approval/shared/use-focus-on-mount.js +26 -0
  75. package/dist/approval/spend/raise-cap-form.d.ts +8 -0
  76. package/dist/approval/spend/raise-cap-form.js +244 -0
  77. package/dist/approval/spend/spend-gate.d.ts +16 -0
  78. package/dist/approval/spend/spend-gate.js +250 -0
  79. package/dist/approval/spend/spend-math.d.ts +5 -0
  80. package/dist/approval/spend/spend-math.js +17 -0
  81. package/dist/approval/spend/spend-meter.d.ts +10 -0
  82. package/dist/approval/spend/spend-meter.js +377 -0
  83. package/dist/approval/tool/approval.d.ts +14 -0
  84. package/dist/approval/tool/approval.js +290 -0
  85. package/dist/approval/tool/args/args-editor.d.ts +16 -0
  86. package/dist/approval/tool/args/args-editor.js +273 -0
  87. package/dist/approval/tool/args/args-field.d.ts +11 -0
  88. package/dist/approval/tool/args/args-field.js +268 -0
  89. package/dist/approval/tool/args/args-validation.d.ts +8 -0
  90. package/dist/approval/tool/args/args-validation.js +50 -0
  91. package/dist/approval/tool/deny-form.d.ts +6 -0
  92. package/dist/approval/tool/deny-form.js +135 -0
  93. package/dist/approval/tool/tool-inputs.d.ts +6 -0
  94. package/dist/approval/tool/tool-inputs.js +142 -0
  95. package/dist/approval/types.d.ts +59 -0
  96. package/dist/approval/types.js +1 -0
  97. package/dist/chat/chat/chat-item-spacing.d.ts +3 -0
  98. package/dist/chat/chat/chat-item-spacing.js +19 -0
  99. package/dist/chat/chat/chat.d.ts +8 -0
  100. package/dist/chat/chat/chat.js +187 -0
  101. package/dist/chat/chat/use-stick-to-bottom.d.ts +7 -0
  102. package/dist/chat/chat/use-stick-to-bottom.js +133 -0
  103. package/dist/chat/chat/virtual-chat-items.d.ts +8 -0
  104. package/dist/chat/chat/virtual-chat-items.js +153 -0
  105. package/dist/chat/composer/composer-actions.d.ts +15 -0
  106. package/dist/chat/composer/composer-actions.js +158 -0
  107. package/dist/chat/composer/composer.d.ts +20 -0
  108. package/dist/chat/composer/composer.js +340 -0
  109. package/dist/chat/composer/use-auto-grow.d.ts +2 -0
  110. package/dist/chat/composer/use-auto-grow.js +29 -0
  111. package/dist/chat/files/file-meta.d.ts +13 -0
  112. package/dist/chat/files/file-meta.js +30 -0
  113. package/dist/chat/files/files.d.ts +9 -0
  114. package/dist/chat/files/files.js +327 -0
  115. package/dist/chat/index.d.ts +7 -0
  116. package/dist/chat/index.js +7 -0
  117. package/dist/chat/reply/fenced-code.d.ts +8 -0
  118. package/dist/chat/reply/fenced-code.js +53 -0
  119. package/dist/chat/reply/markdown-components.d.ts +2 -0
  120. package/dist/chat/reply/markdown-components.js +142 -0
  121. package/dist/chat/reply/reply.d.ts +8 -0
  122. package/dist/chat/reply/reply.js +116 -0
  123. package/dist/chat/turn/group-parts.d.ts +24 -0
  124. package/dist/chat/turn/group-parts.js +49 -0
  125. package/dist/chat/turn/turn.d.ts +11 -0
  126. package/dist/chat/turn/turn.js +253 -0
  127. package/dist/cost/context.d.ts +13 -0
  128. package/dist/cost/context.js +333 -0
  129. package/dist/cost/cost-steps.d.ts +17 -0
  130. package/dist/cost/cost-steps.js +230 -0
  131. package/dist/cost/cost.d.ts +8 -0
  132. package/dist/cost/cost.js +531 -0
  133. package/dist/cost/index.d.ts +4 -0
  134. package/dist/cost/index.js +4 -0
  135. package/dist/cost/model-picker.d.ts +11 -0
  136. package/dist/cost/model-picker.js +184 -0
  137. package/dist/cost/shared/context-breakdown.d.ts +15 -0
  138. package/dist/cost/shared/context-breakdown.js +306 -0
  139. package/dist/cost/shared/meter-marks.d.ts +9 -0
  140. package/dist/cost/shared/meter-marks.js +114 -0
  141. package/dist/cost/shared/model-option-row.d.ts +14 -0
  142. package/dist/cost/shared/model-option-row.js +189 -0
  143. package/dist/cost/shared/step-cost-row.d.ts +15 -0
  144. package/dist/cost/shared/step-cost-row.js +262 -0
  145. package/dist/cost/shared/usage-totals.d.ts +11 -0
  146. package/dist/cost/shared/usage-totals.js +30 -0
  147. package/dist/index.d.ts +7 -0
  148. package/dist/index.js +7 -0
  149. package/dist/memory/cite.d.ts +8 -0
  150. package/dist/memory/cite.js +190 -0
  151. package/dist/memory/index.d.ts +5 -0
  152. package/dist/memory/index.js +4 -0
  153. package/dist/memory/memorized.d.ts +14 -0
  154. package/dist/memory/memorized.js +225 -0
  155. package/dist/memory/recall.d.ts +9 -0
  156. package/dist/memory/recall.js +303 -0
  157. package/dist/memory/shared/disclosure.d.ts +6 -0
  158. package/dist/memory/shared/disclosure.js +6 -0
  159. package/dist/memory/shared/host-label.d.ts +6 -0
  160. package/dist/memory/shared/host-label.js +31 -0
  161. package/dist/memory/shared/source-mark.d.ts +5 -0
  162. package/dist/memory/shared/source-mark.js +42 -0
  163. package/dist/memory/sources.d.ts +9 -0
  164. package/dist/memory/sources.js +264 -0
  165. package/dist/shared/decision-summary.d.ts +18 -0
  166. package/dist/shared/decision-summary.js +144 -0
  167. package/dist/shared/panel-empty.d.ts +8 -0
  168. package/dist/shared/panel-empty.js +80 -0
  169. package/dist/shared/panel.d.ts +19 -0
  170. package/dist/shared/panel.js +251 -0
  171. package/dist/shared/status-dot.d.ts +6 -0
  172. package/dist/shared/status-dot.js +42 -0
  173. package/dist/shared/virtual/use-list-virtualizer.d.ts +24 -0
  174. package/dist/shared/virtual/use-list-virtualizer.js +68 -0
  175. package/dist/sources.css +1 -0
  176. package/dist/thread/actions/action-button.d.ts +8 -0
  177. package/dist/thread/actions/action-button.js +67 -0
  178. package/dist/thread/actions/actions.d.ts +13 -0
  179. package/dist/thread/actions/actions.js +192 -0
  180. package/dist/thread/actions/branch-switcher.d.ts +10 -0
  181. package/dist/thread/actions/branch-switcher.js +104 -0
  182. package/dist/thread/canvas/canvas.d.ts +14 -0
  183. package/dist/thread/canvas/canvas.js +212 -0
  184. package/dist/thread/canvas/version-switcher.d.ts +12 -0
  185. package/dist/thread/canvas/version-switcher.js +152 -0
  186. package/dist/thread/code/code.d.ts +10 -0
  187. package/dist/thread/code/code.js +195 -0
  188. package/dist/thread/code/copy-code-button.d.ts +6 -0
  189. package/dist/thread/code/copy-code-button.js +66 -0
  190. package/dist/thread/code/highlight.d.ts +1 -0
  191. package/dist/thread/code/highlight.js +40 -0
  192. package/dist/thread/history/history-rows.d.ts +16 -0
  193. package/dist/thread/history/history-rows.js +23 -0
  194. package/dist/thread/history/history.d.ts +16 -0
  195. package/dist/thread/history/history.js +179 -0
  196. package/dist/thread/history/row/history-row.d.ts +15 -0
  197. package/dist/thread/history/row/history-row.js +137 -0
  198. package/dist/thread/history/row/thread-item-menu.d.ts +7 -0
  199. package/dist/thread/history/row/thread-item-menu.js +84 -0
  200. package/dist/thread/history/row/thread-title-editor.d.ts +7 -0
  201. package/dist/thread/history/row/thread-title-editor.js +81 -0
  202. package/dist/thread/history/thread-groups.d.ts +8 -0
  203. package/dist/thread/history/thread-groups.js +52 -0
  204. package/dist/thread/history/virtual-history-list.d.ts +11 -0
  205. package/dist/thread/history/virtual-history-list.js +107 -0
  206. package/dist/thread/index.d.ts +8 -0
  207. package/dist/thread/index.js +5 -0
  208. package/dist/thread/starters/starters.d.ts +12 -0
  209. package/dist/thread/starters/starters.js +100 -0
  210. package/dist/thread/use-copied.d.ts +5 -0
  211. package/dist/thread/use-copied.js +52 -0
  212. package/dist/types.d.ts +70 -0
  213. package/dist/types.js +3 -0
  214. package/package.json +59 -3
@@ -0,0 +1,190 @@
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { cn, HoverCard, HoverCardContent, HoverCardTrigger } from "@locusgraph/components";
3
+ import { hostLabel } from "./shared/host-label.js";
4
+ import { SourceMark } from "./shared/source-mark.js";
5
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
+ const pillClass = "inline-flex h-4 min-w-4 items-center justify-center bg-muted px-1 font-mono text-[11px] leading-none font-medium text-foreground/80 tabular-nums no-underline ring-1 ring-border transition-colors duration-150 outline-none hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/70 motion-reduce:transition-none";
7
+ export function citationLabel(citation) {
8
+ return `Source ${citation.index}: ${citation.title}`;
9
+ }
10
+ export function Cite(t0) {
11
+ const $ = _c(36);
12
+ const {
13
+ citation,
14
+ onOpen,
15
+ className
16
+ } = t0;
17
+ let t1;
18
+ if ($[0] !== citation.url) {
19
+ t1 = hostLabel(citation.url);
20
+ $[0] = citation.url;
21
+ $[1] = t1;
22
+ } else {
23
+ t1 = $[1];
24
+ }
25
+ const host = t1;
26
+ let t2;
27
+ if ($[2] !== citation) {
28
+ t2 = citationLabel(citation);
29
+ $[2] = citation;
30
+ $[3] = t2;
31
+ } else {
32
+ t2 = $[3];
33
+ }
34
+ const label = t2;
35
+ let t3;
36
+ if ($[4] !== citation || $[5] !== onOpen) {
37
+ t3 = event => {
38
+ if (!onOpen) {
39
+ return;
40
+ }
41
+ event.preventDefault();
42
+ onOpen(citation);
43
+ };
44
+ $[4] = citation;
45
+ $[5] = onOpen;
46
+ $[6] = t3;
47
+ } else {
48
+ t3 = $[6];
49
+ }
50
+ const open = t3;
51
+ const t4 = citation.index;
52
+ let t5;
53
+ if ($[7] !== className) {
54
+ t5 = cn("relative -top-1 ml-0.5 align-baseline leading-none", className);
55
+ $[7] = className;
56
+ $[8] = t5;
57
+ } else {
58
+ t5 = $[8];
59
+ }
60
+ let t6;
61
+ if ($[9] !== citation.index || $[10] !== citation.url || $[11] !== label || $[12] !== open) {
62
+ t6 = /*#__PURE__*/_jsx(HoverCardTrigger, {
63
+ asChild: true,
64
+ children: citation.url ? /*#__PURE__*/_jsx("a", {
65
+ href: citation.url,
66
+ target: "_blank",
67
+ rel: "noreferrer",
68
+ "aria-label": label,
69
+ onClick: open,
70
+ className: pillClass,
71
+ children: citation.index
72
+ }) : /*#__PURE__*/_jsx("button", {
73
+ type: "button",
74
+ "aria-label": label,
75
+ onClick: open,
76
+ className: pillClass,
77
+ children: citation.index
78
+ })
79
+ });
80
+ $[9] = citation.index;
81
+ $[10] = citation.url;
82
+ $[11] = label;
83
+ $[12] = open;
84
+ $[13] = t6;
85
+ } else {
86
+ t6 = $[13];
87
+ }
88
+ let t7;
89
+ if ($[14] !== citation) {
90
+ t7 = /*#__PURE__*/_jsx(SourceMark, {
91
+ citation: citation
92
+ });
93
+ $[14] = citation;
94
+ $[15] = t7;
95
+ } else {
96
+ t7 = $[15];
97
+ }
98
+ const t8 = host ?? "Source";
99
+ let t9;
100
+ if ($[16] !== t8) {
101
+ t9 = /*#__PURE__*/_jsx("span", {
102
+ className: "truncate",
103
+ children: t8
104
+ });
105
+ $[16] = t8;
106
+ $[17] = t9;
107
+ } else {
108
+ t9 = $[17];
109
+ }
110
+ let t10;
111
+ if ($[18] !== t7 || $[19] !== t9) {
112
+ t10 = /*#__PURE__*/_jsxs("span", {
113
+ className: "eyebrow flex min-w-0 items-center gap-2",
114
+ children: [t7, t9]
115
+ });
116
+ $[18] = t7;
117
+ $[19] = t9;
118
+ $[20] = t10;
119
+ } else {
120
+ t10 = $[20];
121
+ }
122
+ let t11;
123
+ if ($[21] !== citation.title) {
124
+ t11 = /*#__PURE__*/_jsx("span", {
125
+ className: "text-sm leading-snug font-medium",
126
+ children: citation.title
127
+ });
128
+ $[21] = citation.title;
129
+ $[22] = t11;
130
+ } else {
131
+ t11 = $[22];
132
+ }
133
+ let t12;
134
+ if ($[23] !== citation.snippet) {
135
+ t12 = citation.snippet && /*#__PURE__*/_jsx("p", {
136
+ className: "line-clamp-4 text-xs leading-relaxed text-muted-foreground",
137
+ children: citation.snippet
138
+ });
139
+ $[23] = citation.snippet;
140
+ $[24] = t12;
141
+ } else {
142
+ t12 = $[24];
143
+ }
144
+ let t13;
145
+ if ($[25] !== t10 || $[26] !== t11 || $[27] !== t12) {
146
+ t13 = /*#__PURE__*/_jsxs(HoverCardContent, {
147
+ "data-slot": "cite-card",
148
+ side: "bottom",
149
+ align: "start",
150
+ sideOffset: 6,
151
+ className: "flex w-72 flex-col gap-2 rounded-none border-0 p-4 ring-1 ring-border",
152
+ children: [t10, t11, t12]
153
+ });
154
+ $[25] = t10;
155
+ $[26] = t11;
156
+ $[27] = t12;
157
+ $[28] = t13;
158
+ } else {
159
+ t13 = $[28];
160
+ }
161
+ let t14;
162
+ if ($[29] !== t13 || $[30] !== t6) {
163
+ t14 = /*#__PURE__*/_jsxs(HoverCard, {
164
+ openDelay: 150,
165
+ closeDelay: 100,
166
+ children: [t6, t13]
167
+ });
168
+ $[29] = t13;
169
+ $[30] = t6;
170
+ $[31] = t14;
171
+ } else {
172
+ t14 = $[31];
173
+ }
174
+ let t15;
175
+ if ($[32] !== citation.index || $[33] !== t14 || $[34] !== t5) {
176
+ t15 = /*#__PURE__*/_jsx("sup", {
177
+ "data-slot": "cite",
178
+ "data-index": t4,
179
+ className: t5,
180
+ children: t14
181
+ });
182
+ $[32] = citation.index;
183
+ $[33] = t14;
184
+ $[34] = t5;
185
+ $[35] = t15;
186
+ } else {
187
+ t15 = $[35];
188
+ }
189
+ return t15;
190
+ }
@@ -0,0 +1,5 @@
1
+ export * from "./cite.js";
2
+ export * from "./memorized.js";
3
+ export * from "./recall.js";
4
+ export type { SourceItem } from "./shared/host-label.js";
5
+ export * from "./sources.js";
@@ -0,0 +1,4 @@
1
+ export * from "./cite.js";
2
+ export * from "./memorized.js";
3
+ export * from "./recall.js";
4
+ export * from "./sources.js";
@@ -0,0 +1,14 @@
1
+ export type MemorizedStatus = "saved" | "undone";
2
+ export type MemorizedItem = {
3
+ id: string;
4
+ text: string;
5
+ kind?: string;
6
+ status: MemorizedStatus;
7
+ };
8
+ export type MemorizedProps = {
9
+ items: MemorizedItem[];
10
+ onUndo?: (id: string) => void;
11
+ className?: string;
12
+ };
13
+ export declare function memorizedSummary(items: MemorizedItem[]): string;
14
+ export declare function Memorized({ items, onUndo, className }: MemorizedProps): import("react").JSX.Element | null;
@@ -0,0 +1,225 @@
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { BookmarkAdd as BookmarkPlusIcon, Checkmark as CheckIcon, Undo as Undo2Icon } from "@carbon/icons-react";
3
+ import { Button, cn } from "@locusgraph/components";
4
+ import { pluralize } from "@locusgraph/utils";
5
+ import { StatusDot } from "../shared/status-dot.js";
6
+ import { eyebrowClass, ruledListClass } from "./shared/disclosure.js";
7
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
8
+ export function memorizedSummary(items) {
9
+ const saved = items.filter(item => item.status === "saved").length;
10
+ return `Saved ${pluralize(saved, "memory", "memories")}`;
11
+ }
12
+ export function Memorized(t0) {
13
+ const $ = _c(19);
14
+ const {
15
+ items,
16
+ onUndo,
17
+ className
18
+ } = t0;
19
+ if (items.length === 0) {
20
+ return null;
21
+ }
22
+ let t1;
23
+ if ($[0] !== className) {
24
+ t1 = cn("flex min-w-0 flex-col gap-2", className);
25
+ $[0] = className;
26
+ $[1] = t1;
27
+ } else {
28
+ t1 = $[1];
29
+ }
30
+ let t2;
31
+ let t3;
32
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
33
+ t2 = cn("flex items-center gap-2 py-1", eyebrowClass);
34
+ t3 = /*#__PURE__*/_jsx(BookmarkPlusIcon, {
35
+ "aria-hidden": true
36
+ });
37
+ $[2] = t2;
38
+ $[3] = t3;
39
+ } else {
40
+ t2 = $[2];
41
+ t3 = $[3];
42
+ }
43
+ let t4;
44
+ if ($[4] !== items) {
45
+ t4 = memorizedSummary(items);
46
+ $[4] = items;
47
+ $[5] = t4;
48
+ } else {
49
+ t4 = $[5];
50
+ }
51
+ let t5;
52
+ if ($[6] !== t4) {
53
+ t5 = /*#__PURE__*/_jsxs("header", {
54
+ "aria-live": "polite",
55
+ className: t2,
56
+ children: [t3, t4]
57
+ });
58
+ $[6] = t4;
59
+ $[7] = t5;
60
+ } else {
61
+ t5 = $[7];
62
+ }
63
+ let t6;
64
+ if ($[8] !== items || $[9] !== onUndo) {
65
+ let t7;
66
+ if ($[11] !== onUndo) {
67
+ t7 = item => /*#__PURE__*/_jsx(MemorizedRow, {
68
+ item: item,
69
+ onUndo: onUndo
70
+ }, item.id);
71
+ $[11] = onUndo;
72
+ $[12] = t7;
73
+ } else {
74
+ t7 = $[12];
75
+ }
76
+ t6 = items.map(t7);
77
+ $[8] = items;
78
+ $[9] = onUndo;
79
+ $[10] = t6;
80
+ } else {
81
+ t6 = $[10];
82
+ }
83
+ let t7;
84
+ if ($[13] !== t6) {
85
+ t7 = /*#__PURE__*/_jsx("ul", {
86
+ className: ruledListClass,
87
+ children: t6
88
+ });
89
+ $[13] = t6;
90
+ $[14] = t7;
91
+ } else {
92
+ t7 = $[14];
93
+ }
94
+ let t8;
95
+ if ($[15] !== t1 || $[16] !== t5 || $[17] !== t7) {
96
+ t8 = /*#__PURE__*/_jsxs("section", {
97
+ "data-slot": "memorized",
98
+ "aria-label": "Saved to memory",
99
+ className: t1,
100
+ children: [t5, t7]
101
+ });
102
+ $[15] = t1;
103
+ $[16] = t5;
104
+ $[17] = t7;
105
+ $[18] = t8;
106
+ } else {
107
+ t8 = $[18];
108
+ }
109
+ return t8;
110
+ }
111
+ function MemorizedRow(t0) {
112
+ const $ = _c(24);
113
+ const {
114
+ item,
115
+ onUndo
116
+ } = t0;
117
+ const undone = item.status === "undone";
118
+ const t1 = item.status;
119
+ const t2 = undone ? "text-muted-foreground/40" : "text-good";
120
+ let t3;
121
+ if ($[0] !== t2) {
122
+ t3 = cn("size-3.5 shrink-0", t2);
123
+ $[0] = t2;
124
+ $[1] = t3;
125
+ } else {
126
+ t3 = $[1];
127
+ }
128
+ let t4;
129
+ if ($[2] !== t3) {
130
+ t4 = /*#__PURE__*/_jsx(CheckIcon, {
131
+ "aria-hidden": true,
132
+ className: t3
133
+ });
134
+ $[2] = t3;
135
+ $[3] = t4;
136
+ } else {
137
+ t4 = $[3];
138
+ }
139
+ const t5 = undone && "font-normal text-muted-foreground line-through decoration-muted-foreground";
140
+ let t6;
141
+ if ($[4] !== t5) {
142
+ t6 = cn("text-sm font-medium", t5);
143
+ $[4] = t5;
144
+ $[5] = t6;
145
+ } else {
146
+ t6 = $[5];
147
+ }
148
+ let t7;
149
+ if ($[6] !== item.text || $[7] !== t6) {
150
+ t7 = /*#__PURE__*/_jsx("span", {
151
+ className: t6,
152
+ children: item.text
153
+ });
154
+ $[6] = item.text;
155
+ $[7] = t6;
156
+ $[8] = t7;
157
+ } else {
158
+ t7 = $[8];
159
+ }
160
+ let t8;
161
+ if ($[9] !== item.kind) {
162
+ t8 = item.kind && /*#__PURE__*/_jsx("span", {
163
+ className: "font-mono text-xs text-muted-foreground",
164
+ children: item.kind
165
+ });
166
+ $[9] = item.kind;
167
+ $[10] = t8;
168
+ } else {
169
+ t8 = $[10];
170
+ }
171
+ let t9;
172
+ if ($[11] !== t7 || $[12] !== t8) {
173
+ t9 = /*#__PURE__*/_jsxs("span", {
174
+ className: "flex min-w-0 flex-1 flex-col gap-0.5",
175
+ children: [t7, t8]
176
+ });
177
+ $[11] = t7;
178
+ $[12] = t8;
179
+ $[13] = t9;
180
+ } else {
181
+ t9 = $[13];
182
+ }
183
+ let t10;
184
+ if ($[14] !== item.id || $[15] !== item.text || $[16] !== onUndo || $[17] !== undone) {
185
+ t10 = undone ? /*#__PURE__*/_jsxs("span", {
186
+ className: "eyebrow flex shrink-0 items-center gap-1.5",
187
+ children: [/*#__PURE__*/_jsx(StatusDot, {
188
+ tone: "idle"
189
+ }), "Undone"]
190
+ }) : onUndo && /*#__PURE__*/_jsxs(Button, {
191
+ variant: "ghost",
192
+ size: "xs",
193
+ className: "-mr-2 text-muted-foreground hover:text-foreground",
194
+ "aria-label": `Undo saving ${item.text}`,
195
+ onClick: () => onUndo(item.id),
196
+ children: [/*#__PURE__*/_jsx(Undo2Icon, {
197
+ "aria-hidden": true
198
+ }), "Undo"]
199
+ });
200
+ $[14] = item.id;
201
+ $[15] = item.text;
202
+ $[16] = onUndo;
203
+ $[17] = undone;
204
+ $[18] = t10;
205
+ } else {
206
+ t10 = $[18];
207
+ }
208
+ let t11;
209
+ if ($[19] !== item.status || $[20] !== t10 || $[21] !== t4 || $[22] !== t9) {
210
+ t11 = /*#__PURE__*/_jsxs("li", {
211
+ "data-slot": "memorized-item",
212
+ "data-status": t1,
213
+ className: "flex min-h-11 items-center gap-3 px-3 py-2.5",
214
+ children: [t4, t9, t10]
215
+ });
216
+ $[19] = item.status;
217
+ $[20] = t10;
218
+ $[21] = t4;
219
+ $[22] = t9;
220
+ $[23] = t11;
221
+ } else {
222
+ t11 = $[23];
223
+ }
224
+ return t11;
225
+ }
@@ -0,0 +1,9 @@
1
+ import type { MemoryRef } from "../types.js";
2
+ export type RecallProps = {
3
+ memories: MemoryRef[];
4
+ onOpenMemory?: (id: string) => void;
5
+ defaultOpen?: boolean;
6
+ className?: string;
7
+ };
8
+ export declare function relevancePercent(relevance: number): number;
9
+ export declare function Recall({ memories, onOpenMemory, defaultOpen, className }: RecallProps): import("react").JSX.Element | null;