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