@locusgraph/loop 0.3.0 → 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 +70 -17
- package/dist/agent/pulse/marks/bars-mark.js +39 -15
- package/dist/agent/pulse/marks/glyph-mark.js +57 -16
- package/dist/agent/pulse/marks/locus-mark.js +39 -13
- 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.d.ts +0 -1
- package/dist/agent/pulse/use-loop-animation.js +36 -15
- 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 +248 -86
- package/dist/approval/inbox/inbox.d.ts +3 -3
- package/dist/approval/inbox/inbox.js +251 -57
- package/dist/approval/inbox/virtual-inbox-list.d.ts +3 -3
- package/dist/approval/inbox/virtual-inbox-list.js +107 -30
- package/dist/approval/memory/memory-review.js +228 -91
- package/dist/approval/memory/memory-row.js +192 -56
- package/dist/approval/plan/plan-review.js +241 -108
- package/dist/approval/plan/plan-step-row.js +184 -77
- 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 +139 -48
- package/dist/approval/plan/question.js +189 -67
- package/dist/approval/run/run-bar.js +138 -49
- 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-on-mount.js +23 -5
- 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 +235 -52
- package/dist/approval/spend/spend-gate.js +200 -106
- 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 +157 -96
- package/dist/approval/tool/args/args-editor.js +232 -81
- package/dist/approval/tool/args/args-field.js +333 -60
- package/dist/approval/tool/deny-form.js +114 -32
- package/dist/approval/tool/tool-inputs.js +93 -33
- package/dist/chat/chat/chat.js +5 -4
- package/dist/chat/chat/use-stick-to-bottom.js +116 -63
- 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 +136 -50
- 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 +6 -4
- package/dist/chat/composer/use-auto-grow.js +29 -8
- package/dist/chat/files/files.js +296 -67
- package/dist/chat/index.d.ts +1 -1
- package/dist/chat/index.js +1 -1
- 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 +176 -43
- 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 +190 -59
- package/dist/memory/memorized.js +231 -62
- package/dist/memory/recall.js +272 -85
- 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 +277 -62
- 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/shared/virtual/use-list-virtualizer.js +2 -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 +129 -23
- 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 +161 -45
- 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 +91 -26
- 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 +106 -22
- package/dist/thread/history/row/thread-item-menu.js +84 -20
- package/dist/thread/history/row/thread-title-editor.js +74 -29
- package/dist/thread/history/virtual-history-list.js +83 -46
- package/dist/thread/index.d.ts +1 -0
- package/dist/thread/index.js +1 -0
- package/dist/thread/starters/starters.js +91 -28
- package/dist/thread/use-copied.js +40 -10
- 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,9 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { c as _c } from "react/compiler-runtime";
|
|
4
|
-
import { Idea as BrainIcon, ChevronRight as ChevronRightIcon } from "@carbon/icons-react";
|
|
5
4
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger, cn } from "@locusgraph/components";
|
|
5
|
+
import { Lightbulb as BrainIcon, CaretRight as ChevronRightIcon } from "@phosphor-icons/react/ssr";
|
|
6
6
|
import { useEffect, useRef, useState } from "react";
|
|
7
|
+
import { lineChevronClass, lineDetailClass, lineIconClass, lineTriggerClass } from "../../shared/line.js";
|
|
7
8
|
import { firstLineOf, thoughtDurationLabel } from "./thought-duration.js";
|
|
8
9
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
10
|
function useThinkingOpen(streaming, defaultOpen) {
|
|
@@ -58,7 +59,7 @@ function useThinkingOpen(streaming, defaultOpen) {
|
|
|
58
59
|
return t3;
|
|
59
60
|
}
|
|
60
61
|
export function Thinking(t0) {
|
|
61
|
-
const $ = _c(
|
|
62
|
+
const $ = _c(30);
|
|
62
63
|
const {
|
|
63
64
|
text,
|
|
64
65
|
state,
|
|
@@ -80,7 +81,7 @@ export function Thinking(t0) {
|
|
|
80
81
|
const t2 = streaming ? "streaming" : "done";
|
|
81
82
|
let t3;
|
|
82
83
|
if ($[2] !== className) {
|
|
83
|
-
t3 = cn("flex min-w-0 flex-col
|
|
84
|
+
t3 = cn("flex min-w-0 flex-col", className);
|
|
84
85
|
$[2] = className;
|
|
85
86
|
$[3] = t3;
|
|
86
87
|
} else {
|
|
@@ -88,9 +89,13 @@ export function Thinking(t0) {
|
|
|
88
89
|
}
|
|
89
90
|
let t4;
|
|
90
91
|
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
91
|
-
t4 = /*#__PURE__*/_jsx(
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
t4 = /*#__PURE__*/_jsx("span", {
|
|
93
|
+
"aria-hidden": true,
|
|
94
|
+
className: lineIconClass,
|
|
95
|
+
children: /*#__PURE__*/_jsx(BrainIcon, {
|
|
96
|
+
weight: "bold",
|
|
97
|
+
"aria-hidden": true
|
|
98
|
+
})
|
|
94
99
|
});
|
|
95
100
|
$[4] = t4;
|
|
96
101
|
} else {
|
|
@@ -99,7 +104,7 @@ export function Thinking(t0) {
|
|
|
99
104
|
const t5 = streaming && "motion-safe:locus-shimmer";
|
|
100
105
|
let t6;
|
|
101
106
|
if ($[5] !== t5) {
|
|
102
|
-
t6 = cn(t5);
|
|
107
|
+
t6 = cn("shrink-0", t5);
|
|
103
108
|
$[5] = t5;
|
|
104
109
|
$[6] = t6;
|
|
105
110
|
} else {
|
|
@@ -127,85 +132,83 @@ export function Thinking(t0) {
|
|
|
127
132
|
} else {
|
|
128
133
|
t8 = $[12];
|
|
129
134
|
}
|
|
130
|
-
|
|
135
|
+
let t9;
|
|
136
|
+
if ($[13] !== open || $[14] !== summary) {
|
|
137
|
+
t9 = !open && summary && /*#__PURE__*/_jsxs("span", {
|
|
138
|
+
"data-slot": "thinking-summary",
|
|
139
|
+
className: "min-w-0 truncate text-faint",
|
|
140
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
141
|
+
className: "sr-only",
|
|
142
|
+
children: ": "
|
|
143
|
+
}), summary]
|
|
144
|
+
});
|
|
145
|
+
$[13] = open;
|
|
146
|
+
$[14] = summary;
|
|
147
|
+
$[15] = t9;
|
|
148
|
+
} else {
|
|
149
|
+
t9 = $[15];
|
|
150
|
+
}
|
|
131
151
|
let t10;
|
|
132
|
-
if ($[
|
|
133
|
-
t10 =
|
|
134
|
-
|
|
135
|
-
|
|
152
|
+
if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
|
|
153
|
+
t10 = /*#__PURE__*/_jsx(ChevronRightIcon, {
|
|
154
|
+
weight: "bold",
|
|
155
|
+
"aria-hidden": true,
|
|
156
|
+
className: lineChevronClass
|
|
157
|
+
});
|
|
158
|
+
$[16] = t10;
|
|
136
159
|
} else {
|
|
137
|
-
t10 = $[
|
|
160
|
+
t10 = $[16];
|
|
138
161
|
}
|
|
139
162
|
let t11;
|
|
140
|
-
if ($[
|
|
141
|
-
t11 = /*#__PURE__*/
|
|
142
|
-
|
|
143
|
-
|
|
163
|
+
if ($[17] !== t8 || $[18] !== t9) {
|
|
164
|
+
t11 = /*#__PURE__*/_jsxs(CollapsibleTrigger, {
|
|
165
|
+
className: lineTriggerClass,
|
|
166
|
+
children: [t4, t8, t9, t10]
|
|
144
167
|
});
|
|
145
|
-
$[
|
|
146
|
-
$[
|
|
168
|
+
$[17] = t8;
|
|
169
|
+
$[18] = t9;
|
|
170
|
+
$[19] = t11;
|
|
147
171
|
} else {
|
|
148
|
-
t11 = $[
|
|
172
|
+
t11 = $[19];
|
|
149
173
|
}
|
|
150
174
|
let t12;
|
|
151
|
-
if ($[
|
|
152
|
-
t12 =
|
|
153
|
-
"aria-expanded": open,
|
|
154
|
-
className: "group locus-eyebrow flex w-fit items-center gap-2 py-1 transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/70",
|
|
155
|
-
children: [t4, t8, t11]
|
|
156
|
-
});
|
|
157
|
-
$[17] = open;
|
|
158
|
-
$[18] = t11;
|
|
159
|
-
$[19] = t8;
|
|
175
|
+
if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
|
|
176
|
+
t12 = cn(lineDetailClass, "pb-2 leading-relaxed whitespace-pre-wrap text-muted-foreground");
|
|
160
177
|
$[20] = t12;
|
|
161
178
|
} else {
|
|
162
179
|
t12 = $[20];
|
|
163
180
|
}
|
|
164
181
|
let t13;
|
|
165
|
-
if ($[21] !==
|
|
166
|
-
t13 =
|
|
167
|
-
"data-slot": "thinking-summary",
|
|
168
|
-
className: "ml-[6.5px] truncate border-l border-border pl-4 text-muted-foreground/80",
|
|
169
|
-
children: summary
|
|
170
|
-
});
|
|
171
|
-
$[21] = open;
|
|
172
|
-
$[22] = summary;
|
|
173
|
-
$[23] = t13;
|
|
174
|
-
} else {
|
|
175
|
-
t13 = $[23];
|
|
176
|
-
}
|
|
177
|
-
let t14;
|
|
178
|
-
if ($[24] !== text) {
|
|
179
|
-
t14 = /*#__PURE__*/_jsx(CollapsibleContent, {
|
|
182
|
+
if ($[21] !== text) {
|
|
183
|
+
t13 = /*#__PURE__*/_jsx(CollapsibleContent, {
|
|
180
184
|
"data-slot": "thinking-content",
|
|
181
|
-
className:
|
|
185
|
+
className: t12,
|
|
182
186
|
children: text
|
|
183
187
|
});
|
|
184
|
-
$[
|
|
185
|
-
$[
|
|
188
|
+
$[21] = text;
|
|
189
|
+
$[22] = t13;
|
|
186
190
|
} else {
|
|
187
|
-
|
|
191
|
+
t13 = $[22];
|
|
188
192
|
}
|
|
189
|
-
let
|
|
190
|
-
if ($[
|
|
191
|
-
|
|
193
|
+
let t14;
|
|
194
|
+
if ($[23] !== open || $[24] !== setOpen || $[25] !== t11 || $[26] !== t13 || $[27] !== t2 || $[28] !== t3) {
|
|
195
|
+
t14 = /*#__PURE__*/_jsxs(Collapsible, {
|
|
192
196
|
"data-slot": "thinking",
|
|
193
197
|
"data-state": t2,
|
|
194
198
|
open: open,
|
|
195
199
|
onOpenChange: setOpen,
|
|
196
200
|
className: t3,
|
|
197
|
-
children: [
|
|
201
|
+
children: [t11, t13]
|
|
198
202
|
});
|
|
199
|
-
$[
|
|
200
|
-
$[
|
|
201
|
-
$[
|
|
202
|
-
$[
|
|
203
|
-
$[
|
|
204
|
-
$[
|
|
205
|
-
$[
|
|
206
|
-
$[33] = t15;
|
|
203
|
+
$[23] = open;
|
|
204
|
+
$[24] = setOpen;
|
|
205
|
+
$[25] = t11;
|
|
206
|
+
$[26] = t13;
|
|
207
|
+
$[27] = t2;
|
|
208
|
+
$[28] = t3;
|
|
209
|
+
$[29] = t14;
|
|
207
210
|
} else {
|
|
208
|
-
|
|
211
|
+
t14 = $[29];
|
|
209
212
|
}
|
|
210
|
-
return
|
|
213
|
+
return t14;
|
|
211
214
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
2
|
export function prettyJson(value) {
|
|
4
3
|
if (typeof value === "string") return value;
|
|
5
4
|
try {
|
|
@@ -12,11 +11,15 @@ export function JsonBlock({
|
|
|
12
11
|
label,
|
|
13
12
|
value
|
|
14
13
|
}) {
|
|
15
|
-
return /*#__PURE__*/
|
|
14
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
16
15
|
"data-slot": "tool-json",
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
className: "flex min-w-0 flex-col gap-1",
|
|
17
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
18
|
+
className: "text-xs text-faint",
|
|
19
|
+
children: label
|
|
20
|
+
}), /*#__PURE__*/_jsx("pre", {
|
|
21
|
+
className: "max-h-72 overflow-auto font-mono text-xs leading-relaxed text-muted-foreground",
|
|
22
|
+
children: prettyJson(value)
|
|
23
|
+
})]
|
|
21
24
|
});
|
|
22
25
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { ToolState } from "../../types.js";
|
|
2
2
|
export declare const toolStateLabels: Record<ToolState, string>;
|
|
3
3
|
export declare function isToolBusy(state: ToolState): state is "input-available" | "input-streaming";
|
|
4
|
+
export declare function showsStateWord(state: ToolState): boolean;
|
|
5
|
+
export declare function humanToolName(name: string): string;
|
|
4
6
|
export declare function ToolStatus({ state }: {
|
|
5
7
|
state: ToolState;
|
|
6
8
|
}): import("react").JSX.Element;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { StatusDot } from "../../shared/status-dot.js";
|
|
2
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
2
|
export const toolStateLabels = {
|
|
4
3
|
"input-streaming": "Preparing",
|
|
@@ -9,28 +8,32 @@ export const toolStateLabels = {
|
|
|
9
8
|
"output-error": "Failed",
|
|
10
9
|
"output-denied": "Denied"
|
|
11
10
|
};
|
|
12
|
-
const
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"approval-responded": "done",
|
|
17
|
-
"output-available": "done",
|
|
18
|
-
"output-error": "danger",
|
|
19
|
-
"output-denied": "idle"
|
|
11
|
+
const visibleStateWordClasses = {
|
|
12
|
+
"approval-requested": "font-medium text-warn",
|
|
13
|
+
"output-error": "font-medium text-destructive",
|
|
14
|
+
"output-denied": "font-medium text-muted-foreground"
|
|
20
15
|
};
|
|
21
16
|
export function isToolBusy(state) {
|
|
22
17
|
return state === "input-streaming" || state === "input-available";
|
|
23
18
|
}
|
|
19
|
+
export function showsStateWord(state) {
|
|
20
|
+
return state in visibleStateWordClasses;
|
|
21
|
+
}
|
|
22
|
+
export function humanToolName(name) {
|
|
23
|
+
return name.replace(/[._-]+/g, " ").trim();
|
|
24
|
+
}
|
|
24
25
|
export function ToolStatus({
|
|
25
26
|
state
|
|
26
27
|
}) {
|
|
28
|
+
const visibleClass = visibleStateWordClasses[state];
|
|
27
29
|
return /*#__PURE__*/_jsxs("span", {
|
|
28
30
|
"data-slot": "tool-status",
|
|
29
31
|
"data-state": state,
|
|
30
32
|
"aria-live": "polite",
|
|
31
|
-
className:
|
|
32
|
-
children: [/*#__PURE__*/_jsx(
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
className: visibleClass ?? "sr-only",
|
|
34
|
+
children: [toolStateLabels[state], /*#__PURE__*/_jsx("span", {
|
|
35
|
+
className: "sr-only",
|
|
36
|
+
children: ": "
|
|
37
|
+
})]
|
|
35
38
|
});
|
|
36
39
|
}
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
1
2
|
import { type ToolPart } from "../../types.js";
|
|
3
|
+
export type ToolTone = "default" | "memory";
|
|
2
4
|
export type ToolProps = {
|
|
3
5
|
part: ToolPart;
|
|
6
|
+
tone?: ToolTone;
|
|
7
|
+
verb?: string;
|
|
8
|
+
activeVerb?: string;
|
|
9
|
+
target?: ReactNode;
|
|
10
|
+
icon?: ReactNode;
|
|
4
11
|
defaultOpen?: boolean;
|
|
5
12
|
className?: string;
|
|
6
13
|
};
|
|
7
|
-
export declare function Tool({ part, defaultOpen, className }: ToolProps): import("react").JSX.Element;
|
|
14
|
+
export declare function Tool({ part, tone, verb, activeVerb, target, icon, defaultOpen, className, }: ToolProps): import("react").JSX.Element;
|