@locusgraph/loop 0.2.1 → 0.3.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.
- package/dist/agent/pulse/gradient-label.js +64 -12
- package/dist/agent/pulse/marks/bars-mark.js +39 -15
- package/dist/agent/pulse/marks/glyph-mark.js +56 -15
- package/dist/agent/pulse/marks/locus-mark.js +38 -12
- package/dist/agent/pulse/marks/orb-mark.js +21 -9
- package/dist/agent/pulse/pulse.js +1 -1
- package/dist/agent/pulse/use-loop-animation.js +35 -12
- package/dist/agent/thinking/thinking.js +2 -2
- package/dist/agent/tool/tool-status.js +1 -1
- package/dist/approval/inbox/inbox-row.js +303 -76
- package/dist/approval/inbox/inbox.js +192 -39
- package/dist/approval/inbox/virtual-inbox-list.js +104 -26
- package/dist/approval/memory/memory-review.js +172 -36
- package/dist/approval/memory/memory-row.js +187 -50
- package/dist/approval/plan/plan-review.js +225 -73
- package/dist/approval/plan/plan-step-row.js +182 -76
- package/dist/approval/plan/question-choices.js +132 -44
- package/dist/approval/plan/question.js +156 -38
- package/dist/approval/run/run-bar.js +125 -39
- package/dist/approval/shared/use-focus-on-mount.js +23 -5
- package/dist/approval/spend/raise-cap-form.js +223 -48
- package/dist/approval/spend/spend-gate.js +157 -40
- package/dist/approval/spend/spend-meter.js +1 -1
- package/dist/approval/tool/approval.js +196 -35
- package/dist/approval/tool/args/args-editor.js +206 -46
- package/dist/approval/tool/args/args-field.js +240 -55
- package/dist/approval/tool/deny-form.js +125 -36
- package/dist/approval/tool/tool-inputs.js +91 -24
- package/dist/chat/chat/use-stick-to-bottom.js +115 -60
- package/dist/chat/chat/virtual-chat-items.js +129 -34
- package/dist/chat/composer/composer-actions.d.ts +1 -2
- package/dist/chat/composer/composer-actions.js +132 -49
- package/dist/chat/composer/composer-status.d.ts +2 -0
- package/dist/chat/composer/composer-status.js +3 -0
- package/dist/chat/composer/composer.d.ts +1 -1
- package/dist/chat/composer/composer.js +2 -1
- package/dist/chat/composer/use-auto-grow.js +25 -8
- package/dist/chat/files/files.js +293 -66
- package/dist/chat/index.d.ts +1 -1
- package/dist/chat/index.js +1 -1
- package/dist/chat/reply/markdown-components.js +2 -2
- package/dist/cost/context.js +1 -1
- package/dist/cost/cost.js +1 -1
- package/dist/cost/model-picker.js +174 -42
- package/dist/cost/shared/context-breakdown.js +1 -1
- package/dist/memory/cite.js +181 -58
- package/dist/memory/memorized.js +197 -43
- package/dist/memory/recall.js +265 -68
- package/dist/memory/shared/disclosure.d.ts +2 -2
- package/dist/memory/shared/disclosure.js +1 -1
- package/dist/memory/sources.js +232 -52
- package/dist/shared/panel.js +1 -1
- package/dist/shared/virtual/use-list-virtualizer.js +2 -0
- package/dist/thread/actions/branch-switcher.js +97 -21
- package/dist/thread/canvas/canvas.js +1 -1
- package/dist/thread/canvas/version-switcher.js +128 -31
- package/dist/thread/code/code.js +2 -2
- package/dist/thread/code/copy-code-button.js +58 -24
- package/dist/thread/history/history.js +1 -1
- package/dist/thread/history/row/history-row.js +99 -18
- package/dist/thread/history/row/thread-item-menu.js +74 -19
- package/dist/thread/history/row/thread-title-editor.js +74 -29
- package/dist/thread/history/virtual-history-list.js +84 -46
- package/dist/thread/starters/starters.js +89 -27
- package/dist/thread/use-copied.js +40 -10
- package/package.json +3 -3
package/dist/memory/recall.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { c as _c } from "react/compiler-runtime";
|
|
1
4
|
import { ChevronRight as ChevronRightIcon, RecentlyViewed as HistoryIcon } from "@carbon/icons-react";
|
|
2
5
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger, cn } from "@locusgraph/components";
|
|
3
6
|
import { pluralize } from "@locusgraph/utils";
|
|
@@ -6,77 +9,235 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
6
9
|
export function relevancePercent(relevance) {
|
|
7
10
|
return Math.round(Math.min(Math.max(relevance, 0), 1) * 100);
|
|
8
11
|
}
|
|
9
|
-
export function Recall({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
export function Recall(t0) {
|
|
13
|
+
const $ = _c(20);
|
|
14
|
+
const {
|
|
15
|
+
memories,
|
|
16
|
+
onOpenMemory,
|
|
17
|
+
defaultOpen: t1,
|
|
18
|
+
className
|
|
19
|
+
} = t0;
|
|
20
|
+
const defaultOpen = t1 === undefined ? false : t1;
|
|
21
|
+
if (memories.length === 0) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
let t2;
|
|
25
|
+
if ($[0] !== className) {
|
|
26
|
+
t2 = cn("flex min-w-0 flex-col gap-2", className);
|
|
27
|
+
$[0] = className;
|
|
28
|
+
$[1] = t2;
|
|
29
|
+
} else {
|
|
30
|
+
t2 = $[1];
|
|
31
|
+
}
|
|
32
|
+
let t3;
|
|
33
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
34
|
+
t3 = /*#__PURE__*/_jsx(HistoryIcon, {
|
|
35
|
+
"aria-hidden": true
|
|
36
|
+
});
|
|
37
|
+
$[2] = t3;
|
|
38
|
+
} else {
|
|
39
|
+
t3 = $[2];
|
|
40
|
+
}
|
|
41
|
+
let t4;
|
|
42
|
+
if ($[3] !== memories.length) {
|
|
43
|
+
t4 = pluralize(memories.length, "memory", "memories");
|
|
44
|
+
$[3] = memories.length;
|
|
45
|
+
$[4] = t4;
|
|
46
|
+
} else {
|
|
47
|
+
t4 = $[4];
|
|
48
|
+
}
|
|
49
|
+
let t5;
|
|
50
|
+
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
51
|
+
t5 = /*#__PURE__*/_jsx(ChevronRightIcon, {
|
|
52
|
+
"aria-hidden": true,
|
|
53
|
+
className: chevronClass
|
|
54
|
+
});
|
|
55
|
+
$[5] = t5;
|
|
56
|
+
} else {
|
|
57
|
+
t5 = $[5];
|
|
58
|
+
}
|
|
59
|
+
let t6;
|
|
60
|
+
if ($[6] !== t4) {
|
|
61
|
+
t6 = /*#__PURE__*/_jsxs(CollapsibleTrigger, {
|
|
21
62
|
className: collapsibleTriggerClass,
|
|
22
|
-
children: [
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
63
|
+
children: [t3, "Recalled ", t4, t5]
|
|
64
|
+
});
|
|
65
|
+
$[6] = t4;
|
|
66
|
+
$[7] = t6;
|
|
67
|
+
} else {
|
|
68
|
+
t6 = $[7];
|
|
69
|
+
}
|
|
70
|
+
let t7;
|
|
71
|
+
if ($[8] !== memories || $[9] !== onOpenMemory) {
|
|
72
|
+
let t8;
|
|
73
|
+
if ($[11] !== onOpenMemory) {
|
|
74
|
+
t8 = memory => /*#__PURE__*/_jsx(RecallRow, {
|
|
75
|
+
memory: memory,
|
|
76
|
+
onOpenMemory: onOpenMemory
|
|
77
|
+
}, memory.id);
|
|
78
|
+
$[11] = onOpenMemory;
|
|
79
|
+
$[12] = t8;
|
|
80
|
+
} else {
|
|
81
|
+
t8 = $[12];
|
|
82
|
+
}
|
|
83
|
+
t7 = memories.map(t8);
|
|
84
|
+
$[8] = memories;
|
|
85
|
+
$[9] = onOpenMemory;
|
|
86
|
+
$[10] = t7;
|
|
87
|
+
} else {
|
|
88
|
+
t7 = $[10];
|
|
89
|
+
}
|
|
90
|
+
let t8;
|
|
91
|
+
if ($[13] !== t7) {
|
|
92
|
+
t8 = /*#__PURE__*/_jsx(CollapsibleContent, {
|
|
29
93
|
children: /*#__PURE__*/_jsx("ul", {
|
|
30
94
|
className: ruledListClass,
|
|
31
|
-
children:
|
|
32
|
-
memory: memory,
|
|
33
|
-
onOpenMemory: onOpenMemory
|
|
34
|
-
}, memory.id))
|
|
95
|
+
children: t7
|
|
35
96
|
})
|
|
36
|
-
})
|
|
37
|
-
|
|
97
|
+
});
|
|
98
|
+
$[13] = t7;
|
|
99
|
+
$[14] = t8;
|
|
100
|
+
} else {
|
|
101
|
+
t8 = $[14];
|
|
102
|
+
}
|
|
103
|
+
let t9;
|
|
104
|
+
if ($[15] !== defaultOpen || $[16] !== t2 || $[17] !== t6 || $[18] !== t8) {
|
|
105
|
+
t9 = /*#__PURE__*/_jsxs(Collapsible, {
|
|
106
|
+
"data-slot": "recall",
|
|
107
|
+
defaultOpen: defaultOpen,
|
|
108
|
+
className: t2,
|
|
109
|
+
children: [t6, t8]
|
|
110
|
+
});
|
|
111
|
+
$[15] = defaultOpen;
|
|
112
|
+
$[16] = t2;
|
|
113
|
+
$[17] = t6;
|
|
114
|
+
$[18] = t8;
|
|
115
|
+
$[19] = t9;
|
|
116
|
+
} else {
|
|
117
|
+
t9 = $[19];
|
|
118
|
+
}
|
|
119
|
+
return t9;
|
|
38
120
|
}
|
|
39
|
-
function RelevanceMeter({
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
121
|
+
function RelevanceMeter(t0) {
|
|
122
|
+
const $ = _c(14);
|
|
123
|
+
const {
|
|
124
|
+
memory
|
|
125
|
+
} = t0;
|
|
126
|
+
if (memory.relevance === undefined) {
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
let t1;
|
|
130
|
+
if ($[0] !== memory.relevance) {
|
|
131
|
+
t1 = relevancePercent(memory.relevance);
|
|
132
|
+
$[0] = memory.relevance;
|
|
133
|
+
$[1] = t1;
|
|
134
|
+
} else {
|
|
135
|
+
t1 = $[1];
|
|
136
|
+
}
|
|
137
|
+
const percent = t1;
|
|
138
|
+
const t2 = `Relevance of ${memory.label}`;
|
|
139
|
+
const t3 = `${percent}% relevant`;
|
|
140
|
+
const t4 = `${percent}%`;
|
|
141
|
+
let t5;
|
|
142
|
+
if ($[2] !== t4) {
|
|
143
|
+
t5 = /*#__PURE__*/_jsx("span", {
|
|
144
|
+
className: "absolute inset-y-0 left-0 bg-foreground/60 transition-[width] duration-300 motion-reduce:transition-none",
|
|
145
|
+
style: {
|
|
146
|
+
width: t4
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
$[2] = t4;
|
|
150
|
+
$[3] = t5;
|
|
151
|
+
} else {
|
|
152
|
+
t5 = $[3];
|
|
153
|
+
}
|
|
154
|
+
let t6;
|
|
155
|
+
if ($[4] !== percent || $[5] !== t2 || $[6] !== t3 || $[7] !== t5) {
|
|
156
|
+
t6 = /*#__PURE__*/_jsx("span", {
|
|
47
157
|
role: "meter",
|
|
48
|
-
"aria-label":
|
|
158
|
+
"aria-label": t2,
|
|
49
159
|
"aria-valuemin": 0,
|
|
50
160
|
"aria-valuemax": 100,
|
|
51
161
|
"aria-valuenow": percent,
|
|
52
|
-
"aria-valuetext":
|
|
162
|
+
"aria-valuetext": t3,
|
|
53
163
|
className: "relative h-[3px] w-10 overflow-hidden bg-muted",
|
|
54
|
-
children:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
164
|
+
children: t5
|
|
165
|
+
});
|
|
166
|
+
$[4] = percent;
|
|
167
|
+
$[5] = t2;
|
|
168
|
+
$[6] = t3;
|
|
169
|
+
$[7] = t5;
|
|
170
|
+
$[8] = t6;
|
|
171
|
+
} else {
|
|
172
|
+
t6 = $[8];
|
|
173
|
+
}
|
|
174
|
+
let t7;
|
|
175
|
+
if ($[9] !== percent) {
|
|
176
|
+
t7 = /*#__PURE__*/_jsxs("span", {
|
|
61
177
|
className: "w-8 text-right font-mono text-xs text-muted-foreground tabular-nums",
|
|
62
178
|
children: [percent, "%"]
|
|
63
|
-
})
|
|
64
|
-
|
|
179
|
+
});
|
|
180
|
+
$[9] = percent;
|
|
181
|
+
$[10] = t7;
|
|
182
|
+
} else {
|
|
183
|
+
t7 = $[10];
|
|
184
|
+
}
|
|
185
|
+
let t8;
|
|
186
|
+
if ($[11] !== t6 || $[12] !== t7) {
|
|
187
|
+
t8 = /*#__PURE__*/_jsxs("span", {
|
|
188
|
+
className: "flex shrink-0 items-center gap-2",
|
|
189
|
+
children: [t6, t7]
|
|
190
|
+
});
|
|
191
|
+
$[11] = t6;
|
|
192
|
+
$[12] = t7;
|
|
193
|
+
$[13] = t8;
|
|
194
|
+
} else {
|
|
195
|
+
t8 = $[13];
|
|
196
|
+
}
|
|
197
|
+
return t8;
|
|
65
198
|
}
|
|
66
|
-
function RecallRow({
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
199
|
+
function RecallRow(t0) {
|
|
200
|
+
const $ = _c(21);
|
|
201
|
+
const {
|
|
202
|
+
memory,
|
|
203
|
+
onOpenMemory
|
|
204
|
+
} = t0;
|
|
205
|
+
let t1;
|
|
206
|
+
if ($[0] !== memory.label) {
|
|
207
|
+
t1 = /*#__PURE__*/_jsx("span", {
|
|
208
|
+
className: "min-w-0 flex-1 truncate text-sm font-medium",
|
|
209
|
+
children: memory.label
|
|
210
|
+
});
|
|
211
|
+
$[0] = memory.label;
|
|
212
|
+
$[1] = t1;
|
|
213
|
+
} else {
|
|
214
|
+
t1 = $[1];
|
|
215
|
+
}
|
|
216
|
+
let t2;
|
|
217
|
+
if ($[2] !== memory) {
|
|
218
|
+
t2 = /*#__PURE__*/_jsx(RelevanceMeter, {
|
|
219
|
+
memory: memory
|
|
220
|
+
});
|
|
221
|
+
$[2] = memory;
|
|
222
|
+
$[3] = t2;
|
|
223
|
+
} else {
|
|
224
|
+
t2 = $[3];
|
|
225
|
+
}
|
|
226
|
+
let t3;
|
|
227
|
+
if ($[4] !== t1 || $[5] !== t2) {
|
|
228
|
+
t3 = /*#__PURE__*/_jsxs("span", {
|
|
72
229
|
className: "flex w-full items-baseline gap-3",
|
|
73
|
-
children: [
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
230
|
+
children: [t1, t2]
|
|
231
|
+
});
|
|
232
|
+
$[4] = t1;
|
|
233
|
+
$[5] = t2;
|
|
234
|
+
$[6] = t3;
|
|
235
|
+
} else {
|
|
236
|
+
t3 = $[6];
|
|
237
|
+
}
|
|
238
|
+
let t4;
|
|
239
|
+
if ($[7] !== memory.kind || $[8] !== memory.snippet) {
|
|
240
|
+
t4 = (memory.kind || memory.snippet) && /*#__PURE__*/_jsxs("span", {
|
|
80
241
|
className: "flex w-full gap-2 text-xs text-muted-foreground",
|
|
81
242
|
children: [memory.kind && /*#__PURE__*/_jsx("span", {
|
|
82
243
|
className: "shrink-0 font-mono",
|
|
@@ -88,21 +249,57 @@ function RecallRow({
|
|
|
88
249
|
className: "line-clamp-2 min-w-0",
|
|
89
250
|
children: memory.snippet
|
|
90
251
|
})]
|
|
91
|
-
})
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
252
|
+
});
|
|
253
|
+
$[7] = memory.kind;
|
|
254
|
+
$[8] = memory.snippet;
|
|
255
|
+
$[9] = t4;
|
|
256
|
+
} else {
|
|
257
|
+
t4 = $[9];
|
|
258
|
+
}
|
|
259
|
+
let t5;
|
|
260
|
+
if ($[10] !== t3 || $[11] !== t4) {
|
|
261
|
+
t5 = /*#__PURE__*/_jsxs(_Fragment, {
|
|
262
|
+
children: [t3, t4]
|
|
263
|
+
});
|
|
264
|
+
$[10] = t3;
|
|
265
|
+
$[11] = t4;
|
|
266
|
+
$[12] = t5;
|
|
267
|
+
} else {
|
|
268
|
+
t5 = $[12];
|
|
269
|
+
}
|
|
270
|
+
const content = t5;
|
|
271
|
+
let t6;
|
|
272
|
+
if ($[13] !== content || $[14] !== memory.id || $[15] !== memory.label || $[16] !== onOpenMemory) {
|
|
273
|
+
t6 = onOpenMemory ? /*#__PURE__*/_jsx("button", {
|
|
98
274
|
type: "button",
|
|
99
275
|
"aria-label": `Open memory ${memory.label}`,
|
|
100
276
|
onClick: () => onOpenMemory(memory.id),
|
|
101
|
-
className: cn(
|
|
277
|
+
className: cn("flex w-full flex-col items-start gap-1 px-3 py-2.5 text-left", interactiveRowClass),
|
|
102
278
|
children: content
|
|
103
279
|
}) : /*#__PURE__*/_jsx("div", {
|
|
104
|
-
className:
|
|
280
|
+
className: "flex w-full flex-col items-start gap-1 px-3 py-2.5 text-left",
|
|
105
281
|
children: content
|
|
106
|
-
})
|
|
107
|
-
|
|
282
|
+
});
|
|
283
|
+
$[13] = content;
|
|
284
|
+
$[14] = memory.id;
|
|
285
|
+
$[15] = memory.label;
|
|
286
|
+
$[16] = onOpenMemory;
|
|
287
|
+
$[17] = t6;
|
|
288
|
+
} else {
|
|
289
|
+
t6 = $[17];
|
|
290
|
+
}
|
|
291
|
+
let t7;
|
|
292
|
+
if ($[18] !== memory.id || $[19] !== t6) {
|
|
293
|
+
t7 = /*#__PURE__*/_jsx("li", {
|
|
294
|
+
"data-slot": "recall-item",
|
|
295
|
+
"data-id": memory.id,
|
|
296
|
+
children: t6
|
|
297
|
+
});
|
|
298
|
+
$[18] = memory.id;
|
|
299
|
+
$[19] = t6;
|
|
300
|
+
$[20] = t7;
|
|
301
|
+
} else {
|
|
302
|
+
t7 = $[20];
|
|
303
|
+
}
|
|
304
|
+
return t7;
|
|
108
305
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare const eyebrowClass = "eyebrow [&_svg]:size-3.5 [&_svg]:shrink-0";
|
|
2
|
-
export declare const collapsibleTriggerClass = "group inline-flex w-fit items-center gap-2 py-1 outline-none transition-colors duration-150 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/70 motion-reduce:transition-none eyebrow [&_svg]:size-3.5 [&_svg]:shrink-0";
|
|
1
|
+
export declare const eyebrowClass = "locus-eyebrow [&_svg]:size-3.5 [&_svg]:shrink-0";
|
|
2
|
+
export declare const collapsibleTriggerClass = "group inline-flex w-fit items-center gap-2 py-1 outline-none transition-colors duration-150 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/70 motion-reduce:transition-none locus-eyebrow [&_svg]:size-3.5 [&_svg]:shrink-0";
|
|
3
3
|
export declare const chevronClass = "opacity-70 transition-transform duration-150 group-data-[state=open]:rotate-90 motion-reduce:transition-none";
|
|
4
4
|
export declare const ruledRowClass = "flex w-full items-center gap-3 px-3 py-2.5 text-left text-sm";
|
|
5
5
|
export declare const ruledListClass = "flex flex-col divide-y divide-border bg-card ring-1 ring-border";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const eyebrowClass = "eyebrow [&_svg]:size-3.5 [&_svg]:shrink-0";
|
|
1
|
+
export const eyebrowClass = "locus-eyebrow [&_svg]:size-3.5 [&_svg]:shrink-0";
|
|
2
2
|
export const collapsibleTriggerClass = `group inline-flex w-fit items-center gap-2 py-1 outline-none transition-colors duration-150 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/70 motion-reduce:transition-none ${eyebrowClass}`;
|
|
3
3
|
export const chevronClass = "opacity-70 transition-transform duration-150 group-data-[state=open]:rotate-90 motion-reduce:transition-none";
|
|
4
4
|
export const ruledRowClass = "flex w-full items-center gap-3 px-3 py-2.5 text-left text-sm";
|