@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
|
@@ -1,38 +1,72 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { c as _c } from "react/compiler-runtime";
|
|
1
4
|
import { cn } from "@locusgraph/components";
|
|
2
5
|
import { useRef } from "react";
|
|
3
6
|
import { rowOffsetStyle, useListVirtualizer, virtualRowClassName } from "../../shared/virtual/use-list-virtualizer.js";
|
|
4
7
|
import { InboxRow } from "./inbox-row.js";
|
|
5
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
9
|
const estimatedRowHeightPx = 57;
|
|
7
|
-
export function VirtualInboxList({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
export function VirtualInboxList(t0) {
|
|
11
|
+
const $ = _c(28);
|
|
12
|
+
const {
|
|
13
|
+
items,
|
|
14
|
+
now,
|
|
15
|
+
isSelected,
|
|
16
|
+
onSelect,
|
|
17
|
+
onApprove,
|
|
18
|
+
onDeny
|
|
19
|
+
} = t0;
|
|
15
20
|
const scrollRef = useRef(null);
|
|
21
|
+
let t1;
|
|
22
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
23
|
+
t1 = () => scrollRef.current;
|
|
24
|
+
$[0] = t1;
|
|
25
|
+
} else {
|
|
26
|
+
t1 = $[0];
|
|
27
|
+
}
|
|
28
|
+
let t2;
|
|
29
|
+
if ($[1] !== items) {
|
|
30
|
+
t2 = index => items[index].id;
|
|
31
|
+
$[1] = items;
|
|
32
|
+
$[2] = t2;
|
|
33
|
+
} else {
|
|
34
|
+
t2 = $[2];
|
|
35
|
+
}
|
|
36
|
+
let t3;
|
|
37
|
+
if ($[3] !== items.length || $[4] !== t2) {
|
|
38
|
+
t3 = {
|
|
39
|
+
count: items.length,
|
|
40
|
+
getScrollElement: t1,
|
|
41
|
+
estimateSize: _temp,
|
|
42
|
+
getItemKey: t2
|
|
43
|
+
};
|
|
44
|
+
$[3] = items.length;
|
|
45
|
+
$[4] = t2;
|
|
46
|
+
$[5] = t3;
|
|
47
|
+
} else {
|
|
48
|
+
t3 = $[5];
|
|
49
|
+
}
|
|
16
50
|
const {
|
|
17
51
|
rows,
|
|
18
52
|
totalSize,
|
|
19
53
|
itemProps
|
|
20
|
-
} = useListVirtualizer(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
54
|
+
} = useListVirtualizer(t3);
|
|
55
|
+
let t4;
|
|
56
|
+
if ($[6] !== totalSize) {
|
|
57
|
+
t4 = {
|
|
58
|
+
height: totalSize
|
|
59
|
+
};
|
|
60
|
+
$[6] = totalSize;
|
|
61
|
+
$[7] = t4;
|
|
62
|
+
} else {
|
|
63
|
+
t4 = $[7];
|
|
64
|
+
}
|
|
65
|
+
let t5;
|
|
66
|
+
if ($[8] !== isSelected || $[9] !== itemProps || $[10] !== items || $[11] !== now || $[12] !== onApprove || $[13] !== onDeny || $[14] !== onSelect || $[15] !== rows) {
|
|
67
|
+
let t6;
|
|
68
|
+
if ($[17] !== isSelected || $[18] !== itemProps || $[19] !== items || $[20] !== now || $[21] !== onApprove || $[22] !== onDeny || $[23] !== onSelect) {
|
|
69
|
+
t6 = row => {
|
|
36
70
|
const item = items[row.index];
|
|
37
71
|
return /*#__PURE__*/_jsx(InboxRow, {
|
|
38
72
|
...itemProps(row.index),
|
|
@@ -47,7 +81,51 @@ export function VirtualInboxList({
|
|
|
47
81
|
onApprove: () => onApprove(item.id),
|
|
48
82
|
onDeny: () => onDeny(item.id)
|
|
49
83
|
}, row.key);
|
|
84
|
+
};
|
|
85
|
+
$[17] = isSelected;
|
|
86
|
+
$[18] = itemProps;
|
|
87
|
+
$[19] = items;
|
|
88
|
+
$[20] = now;
|
|
89
|
+
$[21] = onApprove;
|
|
90
|
+
$[22] = onDeny;
|
|
91
|
+
$[23] = onSelect;
|
|
92
|
+
$[24] = t6;
|
|
93
|
+
} else {
|
|
94
|
+
t6 = $[24];
|
|
95
|
+
}
|
|
96
|
+
t5 = rows.map(t6);
|
|
97
|
+
$[8] = isSelected;
|
|
98
|
+
$[9] = itemProps;
|
|
99
|
+
$[10] = items;
|
|
100
|
+
$[11] = now;
|
|
101
|
+
$[12] = onApprove;
|
|
102
|
+
$[13] = onDeny;
|
|
103
|
+
$[14] = onSelect;
|
|
104
|
+
$[15] = rows;
|
|
105
|
+
$[16] = t5;
|
|
106
|
+
} else {
|
|
107
|
+
t5 = $[16];
|
|
108
|
+
}
|
|
109
|
+
let t6;
|
|
110
|
+
if ($[25] !== t4 || $[26] !== t5) {
|
|
111
|
+
t6 = /*#__PURE__*/_jsx("div", {
|
|
112
|
+
ref: scrollRef,
|
|
113
|
+
"data-slot": "inbox-scroll",
|
|
114
|
+
className: "mt-4 max-h-[min(36rem,70vh)] overflow-y-auto overscroll-contain border-t",
|
|
115
|
+
children: /*#__PURE__*/_jsx("ul", {
|
|
116
|
+
className: "relative",
|
|
117
|
+
style: t4,
|
|
118
|
+
children: t5
|
|
50
119
|
})
|
|
51
|
-
})
|
|
52
|
-
|
|
120
|
+
});
|
|
121
|
+
$[25] = t4;
|
|
122
|
+
$[26] = t5;
|
|
123
|
+
$[27] = t6;
|
|
124
|
+
} else {
|
|
125
|
+
t6 = $[27];
|
|
126
|
+
}
|
|
127
|
+
return t6;
|
|
128
|
+
}
|
|
129
|
+
function _temp() {
|
|
130
|
+
return estimatedRowHeightPx;
|
|
53
131
|
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { c as _c } from "react/compiler-runtime";
|
|
1
4
|
import { Idea as BrainIcon } from "@carbon/icons-react";
|
|
2
5
|
import { Button } from "@locusgraph/components";
|
|
3
6
|
import { pluralize } from "@locusgraph/utils";
|
|
@@ -26,41 +29,122 @@ function headerStatus(decision, empty) {
|
|
|
26
29
|
tone: "waiting"
|
|
27
30
|
};
|
|
28
31
|
}
|
|
29
|
-
export function MemoryReview({
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const
|
|
32
|
+
export function MemoryReview(t0) {
|
|
33
|
+
const $ = _c(46);
|
|
34
|
+
const {
|
|
35
|
+
memories,
|
|
36
|
+
title: t1,
|
|
37
|
+
description: t2,
|
|
38
|
+
decision,
|
|
39
|
+
onSubmit,
|
|
40
|
+
autoFocus: t3,
|
|
41
|
+
className
|
|
42
|
+
} = t0;
|
|
43
|
+
const title = t1 === undefined ? "Review new memories" : t1;
|
|
44
|
+
const description = t2 === undefined ? "The agent wants to remember these in LocusGraph. Keep, edit or discard each one." : t2;
|
|
45
|
+
const autoFocus = t3 === undefined ? true : t3;
|
|
46
|
+
let t4;
|
|
47
|
+
if ($[0] !== memories) {
|
|
48
|
+
t4 = () => initialDrafts(memories);
|
|
49
|
+
$[0] = memories;
|
|
50
|
+
$[1] = t4;
|
|
51
|
+
} else {
|
|
52
|
+
t4 = $[1];
|
|
53
|
+
}
|
|
54
|
+
const [drafts, setDrafts] = useState(t4);
|
|
55
|
+
let t5;
|
|
56
|
+
if ($[2] !== drafts || $[3] !== memories) {
|
|
57
|
+
t5 = reviewResult(memories, drafts);
|
|
58
|
+
$[2] = drafts;
|
|
59
|
+
$[3] = memories;
|
|
60
|
+
$[4] = t5;
|
|
61
|
+
} else {
|
|
62
|
+
t5 = $[4];
|
|
63
|
+
}
|
|
64
|
+
const result = t5;
|
|
65
|
+
let t6;
|
|
66
|
+
if ($[5] !== drafts) {
|
|
67
|
+
t6 = hasBlankEdit(drafts);
|
|
68
|
+
$[5] = drafts;
|
|
69
|
+
$[6] = t6;
|
|
70
|
+
} else {
|
|
71
|
+
t6 = $[6];
|
|
72
|
+
}
|
|
73
|
+
const blankEdit = t6;
|
|
41
74
|
const empty = memories.length === 0;
|
|
42
|
-
|
|
75
|
+
let t7;
|
|
76
|
+
if ($[7] !== memories) {
|
|
77
|
+
t7 = memories.filter(_temp);
|
|
78
|
+
$[7] = memories;
|
|
79
|
+
$[8] = t7;
|
|
80
|
+
} else {
|
|
81
|
+
t7 = $[8];
|
|
82
|
+
}
|
|
83
|
+
const sensitiveCount = t7.length;
|
|
43
84
|
const submitRef = useFocusOnMount(autoFocus && !decision && !empty);
|
|
85
|
+
let t8;
|
|
86
|
+
if ($[9] !== decision || $[10] !== empty) {
|
|
87
|
+
t8 = headerStatus(decision, empty);
|
|
88
|
+
$[9] = decision;
|
|
89
|
+
$[10] = empty;
|
|
90
|
+
$[11] = t8;
|
|
91
|
+
} else {
|
|
92
|
+
t8 = $[11];
|
|
93
|
+
}
|
|
44
94
|
const {
|
|
45
95
|
status,
|
|
46
96
|
tone
|
|
47
|
-
} =
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
97
|
+
} = t8;
|
|
98
|
+
let t9;
|
|
99
|
+
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
100
|
+
t9 = /*#__PURE__*/_jsx(BrainIcon, {
|
|
101
|
+
"aria-hidden": true
|
|
102
|
+
});
|
|
103
|
+
$[12] = t9;
|
|
104
|
+
} else {
|
|
105
|
+
t9 = $[12];
|
|
106
|
+
}
|
|
107
|
+
let t10;
|
|
108
|
+
if ($[13] !== empty || $[14] !== memories.length) {
|
|
109
|
+
t10 = empty ? undefined : pluralize(memories.length, "proposed", "proposed");
|
|
110
|
+
$[13] = empty;
|
|
111
|
+
$[14] = memories.length;
|
|
112
|
+
$[15] = t10;
|
|
113
|
+
} else {
|
|
114
|
+
t10 = $[15];
|
|
115
|
+
}
|
|
116
|
+
let t11;
|
|
117
|
+
if ($[16] !== status || $[17] !== t10 || $[18] !== tone) {
|
|
118
|
+
t11 = /*#__PURE__*/_jsx(PanelHeader, {
|
|
119
|
+
icon: t9,
|
|
56
120
|
eyebrow: "Memory",
|
|
57
121
|
status: status,
|
|
58
122
|
tone: tone,
|
|
59
|
-
aside:
|
|
60
|
-
})
|
|
61
|
-
|
|
123
|
+
aside: t10
|
|
124
|
+
});
|
|
125
|
+
$[16] = status;
|
|
126
|
+
$[17] = t10;
|
|
127
|
+
$[18] = tone;
|
|
128
|
+
$[19] = t11;
|
|
129
|
+
} else {
|
|
130
|
+
t11 = $[19];
|
|
131
|
+
}
|
|
132
|
+
const t12 = decision ? "text-muted-foreground" : undefined;
|
|
133
|
+
let t13;
|
|
134
|
+
if ($[20] !== t12 || $[21] !== title) {
|
|
135
|
+
t13 = /*#__PURE__*/_jsx(PanelTitle, {
|
|
136
|
+
className: t12,
|
|
62
137
|
children: title
|
|
63
|
-
})
|
|
138
|
+
});
|
|
139
|
+
$[20] = t12;
|
|
140
|
+
$[21] = title;
|
|
141
|
+
$[22] = t13;
|
|
142
|
+
} else {
|
|
143
|
+
t13 = $[22];
|
|
144
|
+
}
|
|
145
|
+
let t14;
|
|
146
|
+
if ($[23] !== blankEdit || $[24] !== decision || $[25] !== description || $[26] !== drafts || $[27] !== empty || $[28] !== memories || $[29] !== onSubmit || $[30] !== result || $[31] !== sensitiveCount || $[32] !== submitRef) {
|
|
147
|
+
t14 = empty ? /*#__PURE__*/_jsx(PanelEmpty, {
|
|
64
148
|
icon: /*#__PURE__*/_jsx(BrainIcon, {
|
|
65
149
|
"aria-hidden": true
|
|
66
150
|
}),
|
|
@@ -84,17 +168,17 @@ export function MemoryReview({
|
|
|
84
168
|
className: "pb-0",
|
|
85
169
|
children: /*#__PURE__*/_jsx("ul", {
|
|
86
170
|
className: "-mx-5 flex flex-col divide-y border-t",
|
|
87
|
-
children: memories.map(
|
|
88
|
-
memory:
|
|
89
|
-
draft: drafts[
|
|
171
|
+
children: memories.map(memory_0 => /*#__PURE__*/_jsx(MemoryRow, {
|
|
172
|
+
memory: memory_0,
|
|
173
|
+
draft: drafts[memory_0.id] ?? {
|
|
90
174
|
choice: "keep",
|
|
91
|
-
text:
|
|
175
|
+
text: memory_0.text
|
|
92
176
|
},
|
|
93
177
|
onChange: draft => setDrafts(current => ({
|
|
94
178
|
...current,
|
|
95
|
-
[
|
|
179
|
+
[memory_0.id]: draft
|
|
96
180
|
}))
|
|
97
|
-
},
|
|
181
|
+
}, memory_0.id))
|
|
98
182
|
})
|
|
99
183
|
}), /*#__PURE__*/_jsxs(PanelFooter, {
|
|
100
184
|
className: "justify-between",
|
|
@@ -115,8 +199,60 @@ export function MemoryReview({
|
|
|
115
199
|
children: submitLabel(result)
|
|
116
200
|
})]
|
|
117
201
|
})]
|
|
118
|
-
})
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
202
|
+
});
|
|
203
|
+
$[23] = blankEdit;
|
|
204
|
+
$[24] = decision;
|
|
205
|
+
$[25] = description;
|
|
206
|
+
$[26] = drafts;
|
|
207
|
+
$[27] = empty;
|
|
208
|
+
$[28] = memories;
|
|
209
|
+
$[29] = onSubmit;
|
|
210
|
+
$[30] = result;
|
|
211
|
+
$[31] = sensitiveCount;
|
|
212
|
+
$[32] = submitRef;
|
|
213
|
+
$[33] = t14;
|
|
214
|
+
} else {
|
|
215
|
+
t14 = $[33];
|
|
216
|
+
}
|
|
217
|
+
let t15;
|
|
218
|
+
if ($[34] !== decision || $[35] !== result) {
|
|
219
|
+
t15 = decision ? "Memories reviewed" : resultSummary(result);
|
|
220
|
+
$[34] = decision;
|
|
221
|
+
$[35] = result;
|
|
222
|
+
$[36] = t15;
|
|
223
|
+
} else {
|
|
224
|
+
t15 = $[36];
|
|
225
|
+
}
|
|
226
|
+
let t16;
|
|
227
|
+
if ($[37] !== t15) {
|
|
228
|
+
t16 = /*#__PURE__*/_jsx(LiveStatus, {
|
|
229
|
+
message: t15
|
|
230
|
+
});
|
|
231
|
+
$[37] = t15;
|
|
232
|
+
$[38] = t16;
|
|
233
|
+
} else {
|
|
234
|
+
t16 = $[38];
|
|
235
|
+
}
|
|
236
|
+
let t17;
|
|
237
|
+
if ($[39] !== className || $[40] !== t11 || $[41] !== t13 || $[42] !== t14 || $[43] !== t16 || $[44] !== title) {
|
|
238
|
+
t17 = /*#__PURE__*/_jsxs(ApprovalPanel, {
|
|
239
|
+
"data-slot": "memory-review",
|
|
240
|
+
"aria-label": title,
|
|
241
|
+
className: className,
|
|
242
|
+
children: [t11, t13, t14, t16]
|
|
243
|
+
});
|
|
244
|
+
$[39] = className;
|
|
245
|
+
$[40] = t11;
|
|
246
|
+
$[41] = t13;
|
|
247
|
+
$[42] = t14;
|
|
248
|
+
$[43] = t16;
|
|
249
|
+
$[44] = title;
|
|
250
|
+
$[45] = t17;
|
|
251
|
+
} else {
|
|
252
|
+
t17 = $[45];
|
|
253
|
+
}
|
|
254
|
+
return t17;
|
|
255
|
+
}
|
|
256
|
+
function _temp(memory) {
|
|
257
|
+
return memory.sensitive;
|
|
122
258
|
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { c as _c } from "react/compiler-runtime";
|
|
1
4
|
import { ShieldAlert as ShieldAlertIcon } from "@carbon/icons-react";
|
|
2
5
|
import { cn, Textarea } from "@locusgraph/components";
|
|
3
6
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -12,16 +15,25 @@ const selectedChoiceClass = {
|
|
|
12
15
|
edit: "text-foreground shadow-[inset_0_-2px_0_var(--color-primary)]",
|
|
13
16
|
discard: "text-destructive shadow-[inset_0_-2px_0_var(--color-destructive)]"
|
|
14
17
|
};
|
|
15
|
-
function ChoiceSegments({
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
function ChoiceSegments(t0) {
|
|
19
|
+
const $ = _c(6);
|
|
20
|
+
const {
|
|
21
|
+
value,
|
|
22
|
+
onChange
|
|
23
|
+
} = t0;
|
|
24
|
+
let t1;
|
|
25
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
26
|
+
t1 = /*#__PURE__*/_jsx("legend", {
|
|
22
27
|
className: "sr-only",
|
|
23
28
|
children: "What to do with this memory"
|
|
24
|
-
})
|
|
29
|
+
});
|
|
30
|
+
$[0] = t1;
|
|
31
|
+
} else {
|
|
32
|
+
t1 = $[0];
|
|
33
|
+
}
|
|
34
|
+
let t2;
|
|
35
|
+
if ($[1] !== onChange || $[2] !== value) {
|
|
36
|
+
t2 = choices.map(choice => {
|
|
25
37
|
const pressed = value === choice;
|
|
26
38
|
return /*#__PURE__*/_jsx("button", {
|
|
27
39
|
type: "button",
|
|
@@ -30,51 +42,141 @@ function ChoiceSegments({
|
|
|
30
42
|
className: cn("h-7 px-2 text-xs outline-none motion-safe:transition-colors focus-visible:z-10 focus-visible:ring-2 focus-visible:ring-ring/70", pressed ? cn("font-medium", selectedChoiceClass[choice]) : "text-muted-foreground hover:text-foreground"),
|
|
31
43
|
children: choiceLabels[choice]
|
|
32
44
|
}, choice);
|
|
33
|
-
})
|
|
34
|
-
|
|
45
|
+
});
|
|
46
|
+
$[1] = onChange;
|
|
47
|
+
$[2] = value;
|
|
48
|
+
$[3] = t2;
|
|
49
|
+
} else {
|
|
50
|
+
t2 = $[3];
|
|
51
|
+
}
|
|
52
|
+
let t3;
|
|
53
|
+
if ($[4] !== t2) {
|
|
54
|
+
t3 = /*#__PURE__*/_jsxs("fieldset", {
|
|
55
|
+
className: "flex shrink-0 gap-1 self-start",
|
|
56
|
+
children: [t1, t2]
|
|
57
|
+
});
|
|
58
|
+
$[4] = t2;
|
|
59
|
+
$[5] = t3;
|
|
60
|
+
} else {
|
|
61
|
+
t3 = $[5];
|
|
62
|
+
}
|
|
63
|
+
return t3;
|
|
35
64
|
}
|
|
36
65
|
function SensitiveMarker() {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
className: "
|
|
42
|
-
|
|
43
|
-
|
|
66
|
+
const $ = _c(1);
|
|
67
|
+
let t0;
|
|
68
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
69
|
+
t0 = /*#__PURE__*/_jsxs("span", {
|
|
70
|
+
className: "flex items-center gap-1 text-warn",
|
|
71
|
+
children: [/*#__PURE__*/_jsx(ShieldAlertIcon, {
|
|
72
|
+
"aria-hidden": true,
|
|
73
|
+
className: "size-3"
|
|
74
|
+
}), "Sensitive"]
|
|
75
|
+
});
|
|
76
|
+
$[0] = t0;
|
|
77
|
+
} else {
|
|
78
|
+
t0 = $[0];
|
|
79
|
+
}
|
|
80
|
+
return t0;
|
|
44
81
|
}
|
|
45
|
-
export function MemoryRow({
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
82
|
+
export function MemoryRow(t0) {
|
|
83
|
+
const $ = _c(35);
|
|
84
|
+
const {
|
|
85
|
+
memory,
|
|
86
|
+
draft,
|
|
87
|
+
onChange
|
|
88
|
+
} = t0;
|
|
50
89
|
const discarded = draft.choice === "discard";
|
|
51
90
|
const editing = draft.choice === "edit";
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
91
|
+
const t1 = draft.choice;
|
|
92
|
+
const t2 = memory.sensitive || undefined;
|
|
93
|
+
const t3 = editing ? "bg-accent/30" : "hover:bg-accent/30";
|
|
94
|
+
let t4;
|
|
95
|
+
if ($[0] !== t3) {
|
|
96
|
+
t4 = cn("flex flex-col gap-2 px-5 py-2.5 motion-safe:transition-colors", t3);
|
|
97
|
+
$[0] = t3;
|
|
98
|
+
$[1] = t4;
|
|
99
|
+
} else {
|
|
100
|
+
t4 = $[1];
|
|
101
|
+
}
|
|
102
|
+
let t5;
|
|
103
|
+
if ($[2] !== memory.kind || $[3] !== memory.sensitive) {
|
|
104
|
+
t5 = (memory.kind || memory.sensitive) && /*#__PURE__*/_jsxs("span", {
|
|
105
|
+
className: "locus-eyebrow flex items-center gap-2",
|
|
106
|
+
children: [memory.kind && /*#__PURE__*/_jsx("span", {
|
|
107
|
+
children: memory.kind
|
|
108
|
+
}), memory.sensitive && /*#__PURE__*/_jsx(SensitiveMarker, {})]
|
|
109
|
+
});
|
|
110
|
+
$[2] = memory.kind;
|
|
111
|
+
$[3] = memory.sensitive;
|
|
112
|
+
$[4] = t5;
|
|
113
|
+
} else {
|
|
114
|
+
t5 = $[4];
|
|
115
|
+
}
|
|
116
|
+
let t6;
|
|
117
|
+
if ($[5] !== discarded || $[6] !== editing || $[7] !== memory.text) {
|
|
118
|
+
t6 = !editing && /*#__PURE__*/_jsx("p", {
|
|
119
|
+
className: cn("text-sm", discarded && "text-muted-foreground line-through decoration-muted-foreground/60"),
|
|
120
|
+
children: memory.text
|
|
121
|
+
});
|
|
122
|
+
$[5] = discarded;
|
|
123
|
+
$[6] = editing;
|
|
124
|
+
$[7] = memory.text;
|
|
125
|
+
$[8] = t6;
|
|
126
|
+
} else {
|
|
127
|
+
t6 = $[8];
|
|
128
|
+
}
|
|
129
|
+
let t7;
|
|
130
|
+
if ($[9] !== t5 || $[10] !== t6) {
|
|
131
|
+
t7 = /*#__PURE__*/_jsxs("div", {
|
|
132
|
+
className: "flex min-w-0 flex-1 flex-col gap-1",
|
|
133
|
+
children: [t5, t6]
|
|
134
|
+
});
|
|
135
|
+
$[9] = t5;
|
|
136
|
+
$[10] = t6;
|
|
137
|
+
$[11] = t7;
|
|
138
|
+
} else {
|
|
139
|
+
t7 = $[11];
|
|
140
|
+
}
|
|
141
|
+
let t8;
|
|
142
|
+
if ($[12] !== draft || $[13] !== onChange) {
|
|
143
|
+
t8 = choice => onChange({
|
|
144
|
+
...draft,
|
|
145
|
+
choice
|
|
146
|
+
});
|
|
147
|
+
$[12] = draft;
|
|
148
|
+
$[13] = onChange;
|
|
149
|
+
$[14] = t8;
|
|
150
|
+
} else {
|
|
151
|
+
t8 = $[14];
|
|
152
|
+
}
|
|
153
|
+
let t9;
|
|
154
|
+
if ($[15] !== draft.choice || $[16] !== t8) {
|
|
155
|
+
t9 = /*#__PURE__*/_jsx(ChoiceSegments, {
|
|
156
|
+
value: draft.choice,
|
|
157
|
+
onChange: t8
|
|
158
|
+
});
|
|
159
|
+
$[15] = draft.choice;
|
|
160
|
+
$[16] = t8;
|
|
161
|
+
$[17] = t9;
|
|
162
|
+
} else {
|
|
163
|
+
t9 = $[17];
|
|
164
|
+
}
|
|
165
|
+
let t10;
|
|
166
|
+
if ($[18] !== t7 || $[19] !== t9) {
|
|
167
|
+
t10 = /*#__PURE__*/_jsxs("div", {
|
|
58
168
|
className: "flex items-start gap-3",
|
|
59
|
-
children: [
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}), /*#__PURE__*/_jsx(ChoiceSegments, {
|
|
71
|
-
value: draft.choice,
|
|
72
|
-
onChange: choice => onChange({
|
|
73
|
-
...draft,
|
|
74
|
-
choice
|
|
75
|
-
})
|
|
76
|
-
})]
|
|
77
|
-
}), editing && /*#__PURE__*/_jsx(Textarea, {
|
|
169
|
+
children: [t7, t9]
|
|
170
|
+
});
|
|
171
|
+
$[18] = t7;
|
|
172
|
+
$[19] = t9;
|
|
173
|
+
$[20] = t10;
|
|
174
|
+
} else {
|
|
175
|
+
t10 = $[20];
|
|
176
|
+
}
|
|
177
|
+
let t11;
|
|
178
|
+
if ($[21] !== draft || $[22] !== editing || $[23] !== onChange) {
|
|
179
|
+
t11 = editing && /*#__PURE__*/_jsx(Textarea, {
|
|
78
180
|
"aria-label": "Memory text",
|
|
79
181
|
value: draft.text,
|
|
80
182
|
"aria-invalid": draft.text.trim() === "" || undefined,
|
|
@@ -83,9 +185,44 @@ export function MemoryRow({
|
|
|
83
185
|
text: event.target.value
|
|
84
186
|
}),
|
|
85
187
|
className: "min-h-16 text-sm"
|
|
86
|
-
})
|
|
188
|
+
});
|
|
189
|
+
$[21] = draft;
|
|
190
|
+
$[22] = editing;
|
|
191
|
+
$[23] = onChange;
|
|
192
|
+
$[24] = t11;
|
|
193
|
+
} else {
|
|
194
|
+
t11 = $[24];
|
|
195
|
+
}
|
|
196
|
+
let t12;
|
|
197
|
+
if ($[25] !== discarded || $[26] !== memory.sensitive) {
|
|
198
|
+
t12 = memory.sensitive && !discarded && /*#__PURE__*/_jsx("p", {
|
|
87
199
|
className: "text-xs text-warn",
|
|
88
200
|
children: "This looks like personal or secret data. Keep it only if the agent should remember it."
|
|
89
|
-
})
|
|
90
|
-
|
|
201
|
+
});
|
|
202
|
+
$[25] = discarded;
|
|
203
|
+
$[26] = memory.sensitive;
|
|
204
|
+
$[27] = t12;
|
|
205
|
+
} else {
|
|
206
|
+
t12 = $[27];
|
|
207
|
+
}
|
|
208
|
+
let t13;
|
|
209
|
+
if ($[28] !== draft.choice || $[29] !== t10 || $[30] !== t11 || $[31] !== t12 || $[32] !== t2 || $[33] !== t4) {
|
|
210
|
+
t13 = /*#__PURE__*/_jsxs("li", {
|
|
211
|
+
"data-slot": "memory-review-item",
|
|
212
|
+
"data-choice": t1,
|
|
213
|
+
"data-sensitive": t2,
|
|
214
|
+
className: t4,
|
|
215
|
+
children: [t10, t11, t12]
|
|
216
|
+
});
|
|
217
|
+
$[28] = draft.choice;
|
|
218
|
+
$[29] = t10;
|
|
219
|
+
$[30] = t11;
|
|
220
|
+
$[31] = t12;
|
|
221
|
+
$[32] = t2;
|
|
222
|
+
$[33] = t4;
|
|
223
|
+
$[34] = t13;
|
|
224
|
+
} else {
|
|
225
|
+
t13 = $[34];
|
|
226
|
+
}
|
|
227
|
+
return t13;
|
|
91
228
|
}
|