@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,3 +1,6 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { c as _c } from "react/compiler-runtime";
|
|
1
4
|
import { ArrowUpRight as ArrowUpRightIcon } from "@carbon/icons-react";
|
|
2
5
|
import { cn } from "@locusgraph/components";
|
|
3
6
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -7,34 +10,93 @@ function textOf(suggestion) {
|
|
|
7
10
|
function labelOf(suggestion) {
|
|
8
11
|
return typeof suggestion === "string" ? suggestion : suggestion.label ?? suggestion.text;
|
|
9
12
|
}
|
|
10
|
-
export function Starters({
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
export function Starters(t0) {
|
|
14
|
+
const $ = _c(19);
|
|
15
|
+
let className;
|
|
16
|
+
let onSelect;
|
|
17
|
+
let props;
|
|
18
|
+
let suggestions;
|
|
19
|
+
let t1;
|
|
20
|
+
if ($[0] !== t0) {
|
|
21
|
+
({
|
|
22
|
+
suggestions,
|
|
23
|
+
onSelect,
|
|
24
|
+
disabled: t1,
|
|
25
|
+
className,
|
|
26
|
+
...props
|
|
27
|
+
} = t0);
|
|
28
|
+
$[0] = t0;
|
|
29
|
+
$[1] = className;
|
|
30
|
+
$[2] = onSelect;
|
|
31
|
+
$[3] = props;
|
|
32
|
+
$[4] = suggestions;
|
|
33
|
+
$[5] = t1;
|
|
34
|
+
} else {
|
|
35
|
+
className = $[1];
|
|
36
|
+
onSelect = $[2];
|
|
37
|
+
props = $[3];
|
|
38
|
+
suggestions = $[4];
|
|
39
|
+
t1 = $[5];
|
|
40
|
+
}
|
|
41
|
+
const disabled = t1 === undefined ? false : t1;
|
|
17
42
|
if (suggestions.length === 0) {
|
|
18
43
|
return null;
|
|
19
44
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
className: "
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
45
|
+
let t2;
|
|
46
|
+
if ($[6] !== className) {
|
|
47
|
+
t2 = cn("flex flex-col divide-y bg-card ring-1 ring-border", className);
|
|
48
|
+
$[6] = className;
|
|
49
|
+
$[7] = t2;
|
|
50
|
+
} else {
|
|
51
|
+
t2 = $[7];
|
|
52
|
+
}
|
|
53
|
+
let t3;
|
|
54
|
+
if ($[8] !== disabled || $[9] !== onSelect || $[10] !== suggestions) {
|
|
55
|
+
let t4;
|
|
56
|
+
if ($[12] !== disabled || $[13] !== onSelect) {
|
|
57
|
+
t4 = suggestion => /*#__PURE__*/_jsxs("button", {
|
|
58
|
+
type: "button",
|
|
59
|
+
disabled: disabled,
|
|
60
|
+
onClick: () => onSelect(textOf(suggestion)),
|
|
61
|
+
className: "group flex w-full items-center gap-3 px-3 py-2.5 text-left text-sm outline-none hover:bg-accent/50 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 motion-safe:transition-colors",
|
|
62
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
63
|
+
className: "min-w-0 flex-1 text-pretty",
|
|
64
|
+
children: labelOf(suggestion)
|
|
65
|
+
}), /*#__PURE__*/_jsx(ArrowUpRightIcon, {
|
|
66
|
+
"aria-hidden": true,
|
|
67
|
+
className: "size-3.5 shrink-0 text-muted-foreground opacity-0 group-hover:opacity-100 group-focus-visible:opacity-100 motion-safe:transition-opacity"
|
|
68
|
+
})]
|
|
69
|
+
}, textOf(suggestion));
|
|
70
|
+
$[12] = disabled;
|
|
71
|
+
$[13] = onSelect;
|
|
72
|
+
$[14] = t4;
|
|
73
|
+
} else {
|
|
74
|
+
t4 = $[14];
|
|
75
|
+
}
|
|
76
|
+
t3 = suggestions.map(t4);
|
|
77
|
+
$[8] = disabled;
|
|
78
|
+
$[9] = onSelect;
|
|
79
|
+
$[10] = suggestions;
|
|
80
|
+
$[11] = t3;
|
|
81
|
+
} else {
|
|
82
|
+
t3 = $[11];
|
|
83
|
+
}
|
|
84
|
+
let t4;
|
|
85
|
+
if ($[15] !== props || $[16] !== t2 || $[17] !== t3) {
|
|
86
|
+
t4 = /*#__PURE__*/_jsx("div", {
|
|
87
|
+
"data-slot": "starters",
|
|
88
|
+
role: "group",
|
|
89
|
+
"aria-label": "Suggested prompts",
|
|
90
|
+
className: t2,
|
|
91
|
+
...props,
|
|
92
|
+
children: t3
|
|
93
|
+
});
|
|
94
|
+
$[15] = props;
|
|
95
|
+
$[16] = t2;
|
|
96
|
+
$[17] = t3;
|
|
97
|
+
$[18] = t4;
|
|
98
|
+
} else {
|
|
99
|
+
t4 = $[18];
|
|
100
|
+
}
|
|
101
|
+
return t4;
|
|
40
102
|
}
|
|
@@ -1,18 +1,48 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { c as _c } from "react/compiler-runtime";
|
|
1
4
|
import { useEffect, useRef, useState } from "react";
|
|
2
5
|
const copiedDurationMs = 1500;
|
|
3
6
|
export function useCopied() {
|
|
7
|
+
const $ = _c(5);
|
|
4
8
|
const [copied, setCopied] = useState(false);
|
|
5
9
|
const timer = useRef(undefined);
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
clearTimeout(timer.current);
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
let t0;
|
|
11
|
+
let t1;
|
|
12
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
13
|
+
t0 = () => () => clearTimeout(timer.current);
|
|
14
|
+
t1 = [];
|
|
15
|
+
$[0] = t0;
|
|
16
|
+
$[1] = t1;
|
|
17
|
+
} else {
|
|
18
|
+
t0 = $[0];
|
|
19
|
+
t1 = $[1];
|
|
20
|
+
}
|
|
21
|
+
useEffect(t0, t1);
|
|
22
|
+
let t2;
|
|
23
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
24
|
+
t2 = () => {
|
|
25
|
+
setCopied(true);
|
|
26
|
+
clearTimeout(timer.current);
|
|
27
|
+
timer.current = setTimeout(() => setCopied(false), copiedDurationMs);
|
|
28
|
+
};
|
|
29
|
+
$[2] = t2;
|
|
30
|
+
} else {
|
|
31
|
+
t2 = $[2];
|
|
32
|
+
}
|
|
33
|
+
const markCopied = t2;
|
|
34
|
+
let t3;
|
|
35
|
+
if ($[3] !== copied) {
|
|
36
|
+
t3 = {
|
|
37
|
+
copied,
|
|
38
|
+
markCopied
|
|
39
|
+
};
|
|
40
|
+
$[3] = copied;
|
|
41
|
+
$[4] = t3;
|
|
42
|
+
} else {
|
|
43
|
+
t3 = $[4];
|
|
44
|
+
}
|
|
45
|
+
return t3;
|
|
16
46
|
}
|
|
17
47
|
export async function writeToClipboard(text) {
|
|
18
48
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@locusgraph/loop",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
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,7 +29,7 @@
|
|
|
29
29
|
"provenance": true
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@locusgraph/components": "^0.
|
|
32
|
+
"@locusgraph/components": "^0.3.0",
|
|
33
33
|
"react": "^19.2.0",
|
|
34
34
|
"react-dom": "^19.2.0"
|
|
35
35
|
},
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"shiki": "^4.5.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@locusgraph/components": "0.
|
|
46
|
+
"@locusgraph/components": "0.3.0",
|
|
47
47
|
"@locusgraph/config": "0.1.1",
|
|
48
48
|
"@types/node": "^22.0.0",
|
|
49
49
|
"@types/react": "^19.2.0",
|