@locusgraph/loop 0.3.1 → 0.4.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.
- package/dist/agent/index.d.ts +1 -1
- package/dist/agent/pulse/gradient-label.js +6 -5
- package/dist/agent/pulse/marks/bars-mark.js +1 -1
- package/dist/agent/pulse/marks/glyph-mark.js +2 -2
- package/dist/agent/pulse/marks/locus-mark.js +1 -1
- package/dist/agent/pulse/pulse.js +1 -1
- package/dist/agent/pulse/use-loop-animation.d.ts +0 -1
- package/dist/agent/pulse/use-loop-animation.js +1 -3
- package/dist/agent/steps/step-icon.js +20 -13
- package/dist/agent/steps/steps.js +39 -37
- package/dist/agent/thinking/thinking.js +65 -62
- package/dist/agent/tool/json-block.js +10 -7
- package/dist/agent/tool/tool-status.d.ts +2 -0
- package/dist/agent/tool/tool-status.js +16 -13
- package/dist/agent/tool/tool.d.ts +8 -1
- package/dist/agent/tool/tool.js +238 -119
- package/dist/approval/inbox/inbox-row.d.ts +3 -3
- package/dist/approval/inbox/inbox-row.js +135 -200
- package/dist/approval/inbox/inbox.d.ts +3 -3
- package/dist/approval/inbox/inbox.js +180 -139
- package/dist/approval/inbox/virtual-inbox-list.d.ts +3 -3
- package/dist/approval/inbox/virtual-inbox-list.js +20 -21
- package/dist/approval/memory/memory-review.js +155 -154
- package/dist/approval/memory/memory-row.js +86 -87
- package/dist/approval/plan/plan-review.js +110 -129
- package/dist/approval/plan/plan-step-row.js +7 -6
- package/dist/approval/plan/plan-steps.d.ts +1 -1
- package/dist/approval/plan/plan-steps.js +2 -2
- package/dist/approval/plan/question-choices.js +10 -7
- package/dist/approval/plan/question.js +116 -112
- package/dist/approval/run/run-bar.js +43 -40
- package/dist/approval/shared/approval-line.d.ts +27 -0
- package/dist/approval/shared/approval-line.js +85 -0
- package/dist/approval/shared/risk-badge.d.ts +3 -5
- package/dist/approval/shared/risk-badge.js +11 -19
- package/dist/approval/shared/time.d.ts +0 -1
- package/dist/approval/shared/time.js +0 -1
- package/dist/approval/shared/use-focus-when-settled.d.ts +2 -0
- package/dist/approval/shared/use-focus-when-settled.js +18 -0
- package/dist/approval/spend/raise-cap-form.d.ts +2 -2
- package/dist/approval/spend/raise-cap-form.js +134 -126
- package/dist/approval/spend/spend-gate.js +133 -156
- package/dist/approval/spend/spend-math.d.ts +1 -0
- package/dist/approval/spend/spend-math.js +5 -2
- package/dist/approval/spend/spend-meter.js +5 -5
- package/dist/approval/tool/approval.js +114 -214
- package/dist/approval/tool/args/args-editor.js +147 -156
- package/dist/approval/tool/args/args-field.js +197 -109
- package/dist/approval/tool/deny-form.js +59 -66
- package/dist/approval/tool/tool-inputs.js +38 -45
- package/dist/chat/chat/chat.js +5 -4
- package/dist/chat/chat/use-stick-to-bottom.js +1 -3
- package/dist/chat/composer/composer-actions.js +4 -1
- package/dist/chat/composer/composer.js +4 -3
- package/dist/chat/composer/use-auto-grow.js +14 -10
- package/dist/chat/files/files.js +12 -10
- package/dist/chat/reply/fenced-code.js +1 -1
- package/dist/chat/reply/markdown-components.js +9 -116
- package/dist/chat/reply/reply.js +2 -2
- package/dist/chat/turn/group-parts.d.ts +1 -0
- package/dist/chat/turn/group-parts.js +6 -3
- package/dist/chat/turn/turn.js +13 -4
- package/dist/cost/context.js +3 -3
- package/dist/cost/cost-steps.js +31 -30
- package/dist/cost/cost.js +39 -39
- package/dist/cost/model-picker.js +5 -4
- package/dist/cost/shared/context-breakdown.js +10 -11
- package/dist/cost/shared/model-option-row.js +4 -3
- package/dist/cost/shared/step-cost-row.js +11 -12
- package/dist/cost/shared/usage-totals.d.ts +1 -0
- package/dist/cost/shared/usage-totals.js +19 -1
- package/dist/memory/cite.js +55 -47
- package/dist/memory/memorized.js +123 -108
- package/dist/memory/recall.js +136 -146
- package/dist/memory/shared/host-label.d.ts +1 -1
- package/dist/memory/shared/host-label.js +2 -2
- package/dist/memory/shared/source-mark.js +1 -1
- package/dist/memory/sources.d.ts +2 -1
- package/dist/memory/sources.js +135 -100
- package/dist/shared/decision-summary.js +2 -1
- package/dist/shared/line.d.ts +10 -0
- package/dist/shared/line.js +11 -0
- package/dist/shared/live-status.d.ts +3 -0
- package/dist/shared/live-status.js +11 -0
- package/dist/shared/reduced-motion.d.ts +1 -0
- package/dist/shared/reduced-motion.js +3 -0
- package/dist/thread/actions/action-button.js +1 -1
- package/dist/thread/actions/actions.d.ts +3 -1
- package/dist/thread/actions/actions.js +100 -81
- package/dist/thread/actions/branch-switcher.js +67 -37
- package/dist/thread/canvas/canvas-meta.d.ts +9 -0
- package/dist/thread/canvas/canvas-meta.js +35 -0
- package/dist/thread/canvas/canvas.d.ts +1 -1
- package/dist/thread/canvas/canvas.js +64 -74
- package/dist/thread/canvas/version-switcher.d.ts +1 -0
- package/dist/thread/canvas/version-switcher.js +106 -87
- package/dist/thread/code/code.js +4 -6
- package/dist/thread/code/copy-code-button.d.ts +2 -1
- package/dist/thread/code/copy-code-button.js +56 -25
- package/dist/thread/history/history.d.ts +1 -1
- package/dist/thread/history/history.js +104 -104
- package/dist/thread/history/row/history-row.js +8 -5
- package/dist/thread/history/row/thread-item-menu.js +13 -4
- package/dist/thread/history/row/thread-title-editor.js +1 -1
- package/dist/thread/history/virtual-history-list.js +1 -2
- package/dist/thread/index.d.ts +1 -0
- package/dist/thread/index.js +1 -0
- package/dist/thread/starters/starters.js +5 -4
- package/package.json +6 -6
- package/dist/agent/shared/status-dot.d.ts +0 -1
- package/dist/agent/shared/status-dot.js +0 -1
- package/dist/approval/shared/decision-line.d.ts +0 -1
- package/dist/approval/shared/decision-line.js +0 -1
- package/dist/memory/shared/disclosure.d.ts +0 -6
- package/dist/memory/shared/disclosure.js +0 -6
- package/dist/shared/panel.d.ts +0 -19
- package/dist/shared/panel.js +0 -77
- package/dist/shared/status-dot.d.ts +0 -6
- package/dist/shared/status-dot.js +0 -20
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { c as _c } from "react/compiler-runtime";
|
|
4
|
-
import { Add as PlusIcon } from "@carbon/icons-react";
|
|
5
4
|
import { Button, cn, ScrollArea } from "@locusgraph/components";
|
|
5
|
+
import { Plus as PlusIcon } from "@phosphor-icons/react/ssr";
|
|
6
|
+
import { useId } from "react";
|
|
6
7
|
import { shouldVirtualize } from "../../shared/virtual/use-list-virtualizer.js";
|
|
7
8
|
import { HistoryRow } from "./row/history-row.js";
|
|
8
9
|
import { groupThreadsByDay } from "./thread-groups.js";
|
|
9
10
|
import { VirtualHistoryList } from "./virtual-history-list.js";
|
|
10
11
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
12
|
export function History(t0) {
|
|
12
|
-
const $ = _c(
|
|
13
|
+
const $ = _c(28);
|
|
13
14
|
let className;
|
|
14
15
|
let now;
|
|
15
16
|
let onArchive;
|
|
@@ -68,112 +69,111 @@ export function History(t0) {
|
|
|
68
69
|
const label = t2 === undefined ? "Conversations" : t2;
|
|
69
70
|
const emptyText = t3 === undefined ? "No conversations yet." : t3;
|
|
70
71
|
const virtualize = t4 === undefined ? true : t4;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
72
|
+
const groups = groupThreadsByDay(threads, now ?? new Date());
|
|
73
|
+
const groupIdPrefix = useId();
|
|
74
|
+
const t5 = "history";
|
|
75
|
+
let t6;
|
|
76
|
+
if ($[13] !== className) {
|
|
77
|
+
t6 = cn("flex min-h-0 flex-col gap-2", className);
|
|
78
|
+
$[13] = className;
|
|
79
|
+
$[14] = t6;
|
|
80
|
+
} else {
|
|
81
|
+
t6 = $[14];
|
|
82
|
+
}
|
|
83
|
+
let t7;
|
|
84
|
+
if ($[15] !== label) {
|
|
85
|
+
t7 = /*#__PURE__*/_jsx("span", {
|
|
86
|
+
className: "text-sm font-medium text-foreground",
|
|
87
|
+
children: label
|
|
88
|
+
});
|
|
89
|
+
$[15] = label;
|
|
90
|
+
$[16] = t7;
|
|
91
|
+
} else {
|
|
92
|
+
t7 = $[16];
|
|
93
|
+
}
|
|
94
|
+
let t8;
|
|
95
|
+
if ($[17] !== onNew) {
|
|
96
|
+
t8 = onNew && /*#__PURE__*/_jsxs(Button, {
|
|
97
|
+
type: "button",
|
|
98
|
+
variant: "ghost",
|
|
99
|
+
size: "xs",
|
|
100
|
+
onClick: onNew,
|
|
101
|
+
children: [/*#__PURE__*/_jsx(PlusIcon, {
|
|
102
|
+
weight: "bold",
|
|
103
|
+
"aria-hidden": true
|
|
104
|
+
}), "New chat"]
|
|
105
|
+
});
|
|
106
|
+
$[17] = onNew;
|
|
107
|
+
$[18] = t8;
|
|
108
|
+
} else {
|
|
109
|
+
t8 = $[18];
|
|
110
|
+
}
|
|
111
|
+
let t9;
|
|
112
|
+
if ($[19] !== t7 || $[20] !== t8) {
|
|
113
|
+
t9 = /*#__PURE__*/_jsxs("div", {
|
|
114
|
+
className: "flex h-control-sm items-center justify-between gap-2 px-2",
|
|
115
|
+
children: [t7, t8]
|
|
116
|
+
});
|
|
117
|
+
$[19] = t7;
|
|
118
|
+
$[20] = t8;
|
|
119
|
+
$[21] = t9;
|
|
120
|
+
} else {
|
|
121
|
+
t9 = $[21];
|
|
122
|
+
}
|
|
123
|
+
const t10 = threads.length === 0 ? /*#__PURE__*/_jsx("p", {
|
|
124
|
+
className: "px-2 py-6 text-sm text-muted-foreground",
|
|
125
|
+
children: emptyText
|
|
126
|
+
}) : /*#__PURE__*/_jsx(ScrollArea, {
|
|
127
|
+
className: "min-h-0 flex-1",
|
|
128
|
+
children: shouldVirtualize(threads.length, virtualize) ? /*#__PURE__*/_jsx("div", {
|
|
129
|
+
className: "pr-2.5 pb-2",
|
|
130
|
+
children: /*#__PURE__*/_jsx(VirtualHistoryList, {
|
|
131
|
+
groups: groups,
|
|
132
|
+
label: label,
|
|
133
|
+
activeId: activeId,
|
|
134
|
+
onSelect: onSelect,
|
|
135
|
+
onRename: onRename,
|
|
136
|
+
onArchive: onArchive
|
|
137
|
+
})
|
|
138
|
+
}) : /*#__PURE__*/_jsx("div", {
|
|
139
|
+
className: "flex flex-col gap-4 pr-2.5 pb-2",
|
|
140
|
+
children: groups.map(group => /*#__PURE__*/_jsxs("section", {
|
|
141
|
+
"aria-labelledby": `${groupIdPrefix}-${group.key}`,
|
|
142
|
+
children: [/*#__PURE__*/_jsx("h3", {
|
|
143
|
+
id: `${groupIdPrefix}-${group.key}`,
|
|
144
|
+
className: "px-2 pb-1 font-sans text-xs text-faint",
|
|
145
|
+
suppressHydrationWarning: true,
|
|
146
|
+
children: group.label
|
|
147
|
+
}), /*#__PURE__*/_jsx("ul", {
|
|
148
|
+
className: "flex flex-col",
|
|
149
|
+
children: group.threads.map(thread => /*#__PURE__*/_jsx(HistoryRow, {
|
|
150
|
+
thread: thread,
|
|
151
|
+
active: thread.id === activeId,
|
|
135
152
|
onSelect: onSelect,
|
|
136
153
|
onRename: onRename,
|
|
137
154
|
onArchive: onArchive
|
|
138
|
-
})
|
|
139
|
-
})
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
thread: thread,
|
|
152
|
-
active: thread.id === activeId,
|
|
153
|
-
onSelect: onSelect,
|
|
154
|
-
onRename: onRename,
|
|
155
|
-
onArchive: onArchive
|
|
156
|
-
}, thread.id))
|
|
157
|
-
})]
|
|
158
|
-
}, group.key))
|
|
159
|
-
})
|
|
160
|
-
})]
|
|
155
|
+
}, thread.id))
|
|
156
|
+
})]
|
|
157
|
+
}, group.key))
|
|
158
|
+
})
|
|
159
|
+
});
|
|
160
|
+
let t11;
|
|
161
|
+
if ($[22] !== label || $[23] !== props || $[24] !== t10 || $[25] !== t6 || $[26] !== t9) {
|
|
162
|
+
t11 = /*#__PURE__*/_jsxs("nav", {
|
|
163
|
+
"data-slot": t5,
|
|
164
|
+
"aria-label": label,
|
|
165
|
+
className: t6,
|
|
166
|
+
...props,
|
|
167
|
+
children: [t9, t10]
|
|
161
168
|
});
|
|
162
|
-
$[
|
|
163
|
-
$[
|
|
164
|
-
$[
|
|
165
|
-
$[
|
|
166
|
-
$[
|
|
167
|
-
$[
|
|
168
|
-
$[19] = onNew;
|
|
169
|
-
$[20] = onRename;
|
|
170
|
-
$[21] = onSelect;
|
|
171
|
-
$[22] = props;
|
|
172
|
-
$[23] = threads;
|
|
173
|
-
$[24] = virtualize;
|
|
174
|
-
$[25] = t5;
|
|
169
|
+
$[22] = label;
|
|
170
|
+
$[23] = props;
|
|
171
|
+
$[24] = t10;
|
|
172
|
+
$[25] = t6;
|
|
173
|
+
$[26] = t9;
|
|
174
|
+
$[27] = t11;
|
|
175
175
|
} else {
|
|
176
|
-
|
|
176
|
+
t11 = $[27];
|
|
177
177
|
}
|
|
178
|
-
return
|
|
178
|
+
return t11;
|
|
179
179
|
}
|
|
@@ -47,7 +47,7 @@ export function HistoryRow(t0) {
|
|
|
47
47
|
const [editing, setEditing] = useState(false);
|
|
48
48
|
const hasMenu = onRename !== undefined || onArchive !== undefined;
|
|
49
49
|
const t1 = active || undefined;
|
|
50
|
-
const t2 = active ? "bg-
|
|
50
|
+
const t2 = active ? "bg-muted text-foreground" : "text-muted-foreground hover:bg-muted/50 hover:text-foreground";
|
|
51
51
|
let t3;
|
|
52
52
|
if ($[8] !== className || $[9] !== t2) {
|
|
53
53
|
t3 = cn("group relative flex items-center motion-safe:transition-colors", t2, className);
|
|
@@ -74,15 +74,18 @@ export function HistoryRow(t0) {
|
|
|
74
74
|
"aria-current": active ? "page" : undefined,
|
|
75
75
|
onClick: () => onSelect(thread.id),
|
|
76
76
|
onDoubleClick: onRename ? () => setEditing(true) : undefined,
|
|
77
|
-
className: cn("flex min-w-0 flex-1 items-center gap-3 py-1.5 pl-2 text-left text-sm
|
|
77
|
+
className: cn("flex min-w-0 flex-1 items-center gap-3 py-1.5 pl-2 text-left text-sm locus-focus-ring-inset", hasMenu ? "pr-8 sm:pr-2" : "pr-2", active && "font-medium"),
|
|
78
78
|
children: [/*#__PURE__*/_jsx("span", {
|
|
79
79
|
className: "min-w-0 flex-1 truncate",
|
|
80
80
|
children: thread.title
|
|
81
|
-
}), /*#__PURE__*/
|
|
81
|
+
}), /*#__PURE__*/_jsxs("time", {
|
|
82
82
|
dateTime: thread.updatedAt,
|
|
83
83
|
suppressHydrationWarning: true,
|
|
84
|
-
className: cn("shrink-0
|
|
85
|
-
children:
|
|
84
|
+
className: cn("shrink-0 text-xs font-normal text-faint tabular-nums", hasMenu && timeHiddenByMenuClass),
|
|
85
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
86
|
+
className: "sr-only",
|
|
87
|
+
children: ", "
|
|
88
|
+
}), formatTimeOfDay(thread.updatedAt)]
|
|
86
89
|
})]
|
|
87
90
|
});
|
|
88
91
|
$[11] = active;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { c as _c } from "react/compiler-runtime";
|
|
4
|
-
import { Archive as ArchiveIcon, OverflowMenuHorizontal as EllipsisIcon, Edit as PencilIcon } from "@carbon/icons-react";
|
|
5
4
|
import { Button, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "@locusgraph/components";
|
|
5
|
+
import { Archive as ArchiveIcon, DotsThree as EllipsisIcon, PencilSimple as PencilIcon } from "@phosphor-icons/react/ssr";
|
|
6
6
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
7
|
export function ThreadItemMenu(t0) {
|
|
8
8
|
const $ = _c(13);
|
|
@@ -14,7 +14,10 @@ export function ThreadItemMenu(t0) {
|
|
|
14
14
|
const t1 = `Options for ${title}`;
|
|
15
15
|
let t2;
|
|
16
16
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
17
|
-
t2 = /*#__PURE__*/_jsx(EllipsisIcon, {
|
|
17
|
+
t2 = /*#__PURE__*/_jsx(EllipsisIcon, {
|
|
18
|
+
weight: "bold",
|
|
19
|
+
"aria-hidden": true
|
|
20
|
+
});
|
|
18
21
|
$[0] = t2;
|
|
19
22
|
} else {
|
|
20
23
|
t2 = $[0];
|
|
@@ -41,7 +44,10 @@ export function ThreadItemMenu(t0) {
|
|
|
41
44
|
if ($[3] !== onRename) {
|
|
42
45
|
t4 = onRename && /*#__PURE__*/_jsxs(DropdownMenuItem, {
|
|
43
46
|
onSelect: onRename,
|
|
44
|
-
children: [/*#__PURE__*/_jsx(PencilIcon, {
|
|
47
|
+
children: [/*#__PURE__*/_jsx(PencilIcon, {
|
|
48
|
+
weight: "bold",
|
|
49
|
+
"aria-hidden": true
|
|
50
|
+
}), "Rename"]
|
|
45
51
|
});
|
|
46
52
|
$[3] = onRename;
|
|
47
53
|
$[4] = t4;
|
|
@@ -52,7 +58,10 @@ export function ThreadItemMenu(t0) {
|
|
|
52
58
|
if ($[5] !== onArchive) {
|
|
53
59
|
t5 = onArchive && /*#__PURE__*/_jsxs(DropdownMenuItem, {
|
|
54
60
|
onSelect: onArchive,
|
|
55
|
-
children: [/*#__PURE__*/_jsx(ArchiveIcon, {
|
|
61
|
+
children: [/*#__PURE__*/_jsx(ArchiveIcon, {
|
|
62
|
+
weight: "bold",
|
|
63
|
+
"aria-hidden": true
|
|
64
|
+
}), "Archive"]
|
|
56
65
|
});
|
|
57
66
|
$[5] = onArchive;
|
|
58
67
|
$[6] = t5;
|
|
@@ -71,8 +71,7 @@ export function VirtualHistoryList(t0) {
|
|
|
71
71
|
className: cn(virtualRowClassName, virtualRow.index > 0 && "pt-4"),
|
|
72
72
|
style: rowOffsetStyle(virtualRow.start),
|
|
73
73
|
children: /*#__PURE__*/_jsx("h3", {
|
|
74
|
-
|
|
75
|
-
className: "locus-eyebrow px-2 pb-1",
|
|
74
|
+
className: "px-2 pb-1 font-sans text-xs text-faint",
|
|
76
75
|
suppressHydrationWarning: true,
|
|
77
76
|
children: row.label
|
|
78
77
|
})
|
package/dist/thread/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export type { MessageBranch } from "./actions/branch-switcher.js";
|
|
|
3
3
|
export * from "./canvas/canvas.js";
|
|
4
4
|
export type { CanvasVersion } from "./canvas/version-switcher.js";
|
|
5
5
|
export * from "./code/code.js";
|
|
6
|
+
export * from "./code/copy-code-button.js";
|
|
6
7
|
export * from "./history/history.js";
|
|
7
8
|
export type { HistoryItem } from "./history/row/history-row.js";
|
|
8
9
|
export * from "./starters/starters.js";
|
package/dist/thread/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { c as _c } from "react/compiler-runtime";
|
|
4
|
-
import { ArrowUpRight as ArrowUpRightIcon } from "@carbon/icons-react";
|
|
5
4
|
import { cn } from "@locusgraph/components";
|
|
5
|
+
import { ArrowUpRight as ArrowUpRightIcon } from "@phosphor-icons/react/ssr";
|
|
6
6
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
7
|
function textOf(suggestion) {
|
|
8
8
|
return typeof suggestion === "string" ? suggestion : suggestion.text;
|
|
@@ -44,7 +44,7 @@ export function Starters(t0) {
|
|
|
44
44
|
}
|
|
45
45
|
let t2;
|
|
46
46
|
if ($[6] !== className) {
|
|
47
|
-
t2 = cn("flex flex-col
|
|
47
|
+
t2 = cn("flex flex-col", className);
|
|
48
48
|
$[6] = className;
|
|
49
49
|
$[7] = t2;
|
|
50
50
|
} else {
|
|
@@ -58,13 +58,14 @@ export function Starters(t0) {
|
|
|
58
58
|
type: "button",
|
|
59
59
|
disabled: disabled,
|
|
60
60
|
onClick: () => onSelect(textOf(suggestion)),
|
|
61
|
-
className: "group flex w-
|
|
61
|
+
className: "group -mx-2 flex w-[calc(100%+1rem)] items-center gap-3 px-2 py-1.5 text-left text-sm text-muted-foreground locus-focus-ring hover:bg-muted/50 hover:text-foreground disabled:pointer-events-none disabled:opacity-50 motion-safe:transition-colors",
|
|
62
62
|
children: [/*#__PURE__*/_jsx("span", {
|
|
63
63
|
className: "min-w-0 flex-1 text-pretty",
|
|
64
64
|
children: labelOf(suggestion)
|
|
65
65
|
}), /*#__PURE__*/_jsx(ArrowUpRightIcon, {
|
|
66
|
+
weight: "bold",
|
|
66
67
|
"aria-hidden": true,
|
|
67
|
-
className: "size-3.5 shrink-0 text-
|
|
68
|
+
className: "size-3.5 shrink-0 text-interactive opacity-0 group-hover:opacity-100 group-focus-visible:opacity-100 motion-safe:transition-opacity"
|
|
68
69
|
})]
|
|
69
70
|
}, textOf(suggestion));
|
|
70
71
|
$[12] = disabled;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@locusgraph/loop",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Agent components for LocusGraph apps: chat, agent steps, human-in-the-loop approvals, memory and cost. Takes Vercel AI SDK UIMessage parts; never calls a model.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -29,21 +29,21 @@
|
|
|
29
29
|
"provenance": true
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@locusgraph/components": "^0.
|
|
32
|
+
"@locusgraph/components": "^0.4.0",
|
|
33
33
|
"react": "^19.2.0",
|
|
34
34
|
"react-dom": "^19.2.0"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@
|
|
38
|
-
"@locusgraph/brand": "0.2.
|
|
39
|
-
"@locusgraph/utils": "0.1.
|
|
37
|
+
"@phosphor-icons/react": "2.1.10",
|
|
38
|
+
"@locusgraph/brand": "0.2.1",
|
|
39
|
+
"@locusgraph/utils": "0.1.2",
|
|
40
40
|
"@tanstack/react-virtual": "3.14.13",
|
|
41
41
|
"react-markdown": "^10.1.0",
|
|
42
42
|
"remark-gfm": "^4.0.1",
|
|
43
43
|
"shiki": "^4.5.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@locusgraph/components": "0.
|
|
46
|
+
"@locusgraph/components": "0.4.0",
|
|
47
47
|
"@locusgraph/config": "0.1.1",
|
|
48
48
|
"@types/node": "^22.0.0",
|
|
49
49
|
"@types/react": "^19.2.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { StatusDot, type StatusTone, statusDotTones } from "../../shared/status-dot.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { StatusDot, statusDotTones } from "../../shared/status-dot.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { DecisionSummary, type DecisionSummaryProps, } from "../../shared/decision-summary.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { DecisionSummary } from "../../shared/decision-summary.js";
|
|
@@ -1,6 +0,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
|
-
export declare const chevronClass = "opacity-70 transition-transform duration-150 group-data-[state=open]:rotate-90 motion-reduce:transition-none";
|
|
4
|
-
export declare const ruledRowClass = "flex w-full items-center gap-3 px-3 py-2.5 text-left text-sm";
|
|
5
|
-
export declare const ruledListClass = "flex flex-col divide-y divide-border bg-card ring-1 ring-border";
|
|
6
|
-
export declare const interactiveRowClass = "outline-none transition-colors duration-150 hover:bg-accent/50 focus-visible:bg-accent motion-reduce:transition-none";
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export const eyebrowClass = "locus-eyebrow [&_svg]:size-3.5 [&_svg]:shrink-0";
|
|
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
|
-
export const chevronClass = "opacity-70 transition-transform duration-150 group-data-[state=open]:rotate-90 motion-reduce:transition-none";
|
|
4
|
-
export const ruledRowClass = "flex w-full items-center gap-3 px-3 py-2.5 text-left text-sm";
|
|
5
|
-
export const ruledListClass = "flex flex-col divide-y divide-border bg-card ring-1 ring-border";
|
|
6
|
-
export const interactiveRowClass = "outline-none transition-colors duration-150 hover:bg-accent/50 focus-visible:bg-accent motion-reduce:transition-none";
|
package/dist/shared/panel.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { ComponentProps, ReactNode } from "react";
|
|
2
|
-
import { type StatusTone } from "./status-dot.js";
|
|
3
|
-
export declare function ApprovalPanel({ className, ...props }: ComponentProps<"section">): import("react").JSX.Element;
|
|
4
|
-
export type PanelTone = StatusTone;
|
|
5
|
-
type PanelHeaderProps = {
|
|
6
|
-
icon: ReactNode;
|
|
7
|
-
eyebrow: string;
|
|
8
|
-
status?: string;
|
|
9
|
-
tone?: PanelTone;
|
|
10
|
-
aside?: ReactNode;
|
|
11
|
-
};
|
|
12
|
-
export declare function PanelHeader({ icon, eyebrow, status, tone, aside }: PanelHeaderProps): import("react").JSX.Element;
|
|
13
|
-
export declare function PanelTitle({ className, ...props }: ComponentProps<"h3">): import("react").JSX.Element;
|
|
14
|
-
export declare function PanelBody({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
|
|
15
|
-
export declare function PanelFooter({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
|
|
16
|
-
export declare function LiveStatus({ message }: {
|
|
17
|
-
message: string;
|
|
18
|
-
}): import("react").JSX.Element;
|
|
19
|
-
export {};
|
package/dist/shared/panel.js
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { cn } from "@locusgraph/components";
|
|
2
|
-
import { StatusDot } from "./status-dot.js";
|
|
3
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
-
export function ApprovalPanel({
|
|
5
|
-
className,
|
|
6
|
-
...props
|
|
7
|
-
}) {
|
|
8
|
-
return /*#__PURE__*/_jsx("section", {
|
|
9
|
-
className: cn("flex min-w-0 flex-col bg-card text-card-foreground ring-1 ring-border", className),
|
|
10
|
-
...props
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
export function PanelHeader({
|
|
14
|
-
icon,
|
|
15
|
-
eyebrow,
|
|
16
|
-
status,
|
|
17
|
-
tone = "idle",
|
|
18
|
-
aside
|
|
19
|
-
}) {
|
|
20
|
-
return /*#__PURE__*/_jsxs("header", {
|
|
21
|
-
"data-slot": "panel-header",
|
|
22
|
-
className: "locus-eyebrow flex items-center gap-2 px-5 pt-4 [&_svg]:size-3.5 [&_svg]:shrink-0",
|
|
23
|
-
children: [icon, /*#__PURE__*/_jsx("span", {
|
|
24
|
-
className: "min-w-0 truncate",
|
|
25
|
-
children: eyebrow
|
|
26
|
-
}), /*#__PURE__*/_jsxs("span", {
|
|
27
|
-
className: "ml-auto flex shrink-0 items-center gap-1.5",
|
|
28
|
-
children: [aside && /*#__PURE__*/_jsx("span", {
|
|
29
|
-
className: "mr-2 tabular-nums",
|
|
30
|
-
children: aside
|
|
31
|
-
}), status && /*#__PURE__*/_jsxs(_Fragment, {
|
|
32
|
-
children: [/*#__PURE__*/_jsx(StatusDot, {
|
|
33
|
-
tone: tone
|
|
34
|
-
}), /*#__PURE__*/_jsx("span", {
|
|
35
|
-
children: status
|
|
36
|
-
})]
|
|
37
|
-
})]
|
|
38
|
-
})]
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
export function PanelTitle({
|
|
42
|
-
className,
|
|
43
|
-
...props
|
|
44
|
-
}) {
|
|
45
|
-
return /*#__PURE__*/_jsx("h3", {
|
|
46
|
-
className: cn("px-5 pt-2 font-sans text-base leading-snug font-semibold tracking-tight text-balance", className),
|
|
47
|
-
...props
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
export function PanelBody({
|
|
51
|
-
className,
|
|
52
|
-
...props
|
|
53
|
-
}) {
|
|
54
|
-
return /*#__PURE__*/_jsx("div", {
|
|
55
|
-
className: cn("flex flex-col gap-4 px-5 pt-4 pb-5", className),
|
|
56
|
-
...props
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
export function PanelFooter({
|
|
60
|
-
className,
|
|
61
|
-
...props
|
|
62
|
-
}) {
|
|
63
|
-
return /*#__PURE__*/_jsx("div", {
|
|
64
|
-
className: cn("flex flex-wrap items-center justify-end gap-2 border-t bg-muted/70 px-5 py-3", className),
|
|
65
|
-
...props
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
export function LiveStatus({
|
|
69
|
-
message
|
|
70
|
-
}) {
|
|
71
|
-
return /*#__PURE__*/_jsx("p", {
|
|
72
|
-
role: "status",
|
|
73
|
-
"aria-live": "polite",
|
|
74
|
-
className: "sr-only",
|
|
75
|
-
children: message
|
|
76
|
-
});
|
|
77
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export type StatusTone = "running" | "waiting" | "done" | "danger" | "idle";
|
|
2
|
-
export declare const statusDotTones: Record<StatusTone, string>;
|
|
3
|
-
export declare function StatusDot({ tone, className }: {
|
|
4
|
-
tone: StatusTone;
|
|
5
|
-
className?: string;
|
|
6
|
-
}): import("react").JSX.Element;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { cn } from "@locusgraph/components";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
export const statusDotTones = {
|
|
4
|
-
running: "bg-warn motion-safe:animate-pulse",
|
|
5
|
-
waiting: "bg-warn motion-safe:animate-pulse",
|
|
6
|
-
done: "bg-good",
|
|
7
|
-
danger: "bg-destructive",
|
|
8
|
-
idle: "bg-muted-foreground/50"
|
|
9
|
-
};
|
|
10
|
-
export function StatusDot({
|
|
11
|
-
tone,
|
|
12
|
-
className
|
|
13
|
-
}) {
|
|
14
|
-
return /*#__PURE__*/_jsx("span", {
|
|
15
|
-
"aria-hidden": true,
|
|
16
|
-
"data-slot": "status-dot",
|
|
17
|
-
"data-tone": tone,
|
|
18
|
-
className: cn("size-1.5 shrink-0 rounded-full", statusDotTones[tone], className)
|
|
19
|
-
});
|
|
20
|
-
}
|