@locusgraph/loop 0.2.0 → 0.3.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.
Files changed (75) hide show
  1. package/dist/agent/pulse/gradient-label.js +12 -62
  2. package/dist/agent/pulse/marks/bars-mark.js +15 -37
  3. package/dist/agent/pulse/marks/glyph-mark.js +15 -54
  4. package/dist/agent/pulse/marks/locus-mark.js +12 -36
  5. package/dist/agent/pulse/marks/orb-mark.js +9 -19
  6. package/dist/agent/pulse/marks/spinner-mark.js +20 -29
  7. package/dist/agent/pulse/pulse.js +36 -123
  8. package/dist/agent/pulse/use-loop-animation.js +12 -33
  9. package/dist/agent/steps/step-icon.js +26 -96
  10. package/dist/agent/steps/steps.js +47 -210
  11. package/dist/agent/thinking/thinking.js +2 -2
  12. package/dist/agent/tool/json-block.js +11 -31
  13. package/dist/agent/tool/tool-status.js +12 -35
  14. package/dist/approval/inbox/inbox-row.js +76 -301
  15. package/dist/approval/inbox/inbox.js +39 -190
  16. package/dist/approval/inbox/virtual-inbox-list.js +26 -102
  17. package/dist/approval/memory/memory-review.js +36 -170
  18. package/dist/approval/memory/memory-row.js +50 -185
  19. package/dist/approval/plan/plan-review.js +73 -223
  20. package/dist/approval/plan/plan-step-row.js +76 -180
  21. package/dist/approval/plan/question-choices.js +44 -130
  22. package/dist/approval/plan/question.js +38 -154
  23. package/dist/approval/run/run-bar.js +39 -123
  24. package/dist/approval/shared/risk-badge.js +9 -24
  25. package/dist/approval/shared/use-focus-on-mount.js +5 -21
  26. package/dist/approval/spend/raise-cap-form.js +48 -221
  27. package/dist/approval/spend/spend-gate.js +40 -155
  28. package/dist/approval/spend/spend-meter.js +86 -313
  29. package/dist/approval/tool/approval.js +35 -194
  30. package/dist/approval/tool/args/args-editor.js +46 -204
  31. package/dist/approval/tool/args/args-field.js +55 -238
  32. package/dist/approval/tool/deny-form.js +36 -123
  33. package/dist/approval/tool/tool-inputs.js +24 -89
  34. package/dist/chat/chat/use-stick-to-bottom.js +60 -113
  35. package/dist/chat/chat/virtual-chat-items.js +34 -127
  36. package/dist/chat/composer/composer-actions.js +46 -129
  37. package/dist/chat/composer/use-auto-grow.js +8 -23
  38. package/dist/chat/files/files.js +66 -291
  39. package/dist/chat/reply/fenced-code.js +10 -32
  40. package/dist/chat/reply/markdown-components.js +2 -2
  41. package/dist/chat/reply/reply.js +24 -99
  42. package/dist/chat/turn/turn.js +46 -197
  43. package/dist/cost/context.js +65 -282
  44. package/dist/cost/cost-steps.js +42 -195
  45. package/dist/cost/cost.js +108 -497
  46. package/dist/cost/model-picker.js +42 -172
  47. package/dist/cost/shared/context-breakdown.js +65 -281
  48. package/dist/cost/shared/meter-marks.js +34 -92
  49. package/dist/cost/shared/model-option-row.js +35 -158
  50. package/dist/cost/shared/step-cost-row.js +37 -222
  51. package/dist/memory/cite.js +58 -179
  52. package/dist/memory/memorized.js +43 -195
  53. package/dist/memory/recall.js +68 -263
  54. package/dist/memory/shared/disclosure.d.ts +2 -2
  55. package/dist/memory/shared/disclosure.js +1 -1
  56. package/dist/memory/shared/source-mark.js +10 -38
  57. package/dist/memory/sources.js +52 -230
  58. package/dist/shared/decision-summary.js +35 -117
  59. package/dist/shared/panel-empty.js +15 -73
  60. package/dist/shared/panel.js +65 -239
  61. package/dist/shared/status-dot.js +10 -32
  62. package/dist/thread/actions/action-button.js +10 -53
  63. package/dist/thread/actions/branch-switcher.js +21 -95
  64. package/dist/thread/canvas/canvas.js +1 -1
  65. package/dist/thread/canvas/version-switcher.js +31 -126
  66. package/dist/thread/code/code.js +2 -2
  67. package/dist/thread/code/copy-code-button.js +24 -56
  68. package/dist/thread/history/history.js +1 -1
  69. package/dist/thread/history/row/history-row.js +18 -97
  70. package/dist/thread/history/row/thread-item-menu.js +19 -72
  71. package/dist/thread/history/row/thread-title-editor.js +29 -72
  72. package/dist/thread/history/virtual-history-list.js +46 -82
  73. package/dist/thread/starters/starters.js +27 -87
  74. package/dist/thread/use-copied.js +10 -38
  75. package/package.json +3 -3
@@ -1,251 +1,77 @@
1
- import { c as _c } from "react/compiler-runtime";
2
1
  import { cn } from "@locusgraph/components";
3
2
  import { StatusDot } from "./status-dot.js";
4
3
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
5
- export function ApprovalPanel(t0) {
6
- const $ = _c(8);
7
- let className;
8
- let props;
9
- if ($[0] !== t0) {
10
- ({
11
- className,
12
- ...props
13
- } = t0);
14
- $[0] = t0;
15
- $[1] = className;
16
- $[2] = props;
17
- } else {
18
- className = $[1];
19
- props = $[2];
20
- }
21
- let t1;
22
- if ($[3] !== className) {
23
- t1 = cn("flex min-w-0 flex-col bg-card text-card-foreground ring-1 ring-border", className);
24
- $[3] = className;
25
- $[4] = t1;
26
- } else {
27
- t1 = $[4];
28
- }
29
- let t2;
30
- if ($[5] !== props || $[6] !== t1) {
31
- t2 = /*#__PURE__*/_jsx("section", {
32
- className: t1,
33
- ...props
34
- });
35
- $[5] = props;
36
- $[6] = t1;
37
- $[7] = t2;
38
- } else {
39
- t2 = $[7];
40
- }
41
- return t2;
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
+ });
42
12
  }
43
- export function PanelHeader(t0) {
44
- const $ = _c(14);
45
- const {
46
- icon,
47
- eyebrow,
48
- status,
49
- tone: t1,
50
- aside
51
- } = t0;
52
- const tone = t1 === undefined ? "idle" : t1;
53
- let t2;
54
- if ($[0] !== eyebrow) {
55
- t2 = /*#__PURE__*/_jsx("span", {
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", {
56
24
  className: "min-w-0 truncate",
57
25
  children: eyebrow
58
- });
59
- $[0] = eyebrow;
60
- $[1] = t2;
61
- } else {
62
- t2 = $[1];
63
- }
64
- let t3;
65
- if ($[2] !== aside) {
66
- t3 = aside && /*#__PURE__*/_jsx("span", {
67
- className: "mr-2 tabular-nums",
68
- children: aside
69
- });
70
- $[2] = aside;
71
- $[3] = t3;
72
- } else {
73
- t3 = $[3];
74
- }
75
- let t4;
76
- if ($[4] !== status || $[5] !== tone) {
77
- t4 = status && /*#__PURE__*/_jsxs(_Fragment, {
78
- children: [/*#__PURE__*/_jsx(StatusDot, {
79
- tone: tone
80
- }), /*#__PURE__*/_jsx("span", {
81
- children: status
82
- })]
83
- });
84
- $[4] = status;
85
- $[5] = tone;
86
- $[6] = t4;
87
- } else {
88
- t4 = $[6];
89
- }
90
- let t5;
91
- if ($[7] !== t3 || $[8] !== t4) {
92
- t5 = /*#__PURE__*/_jsxs("span", {
26
+ }), /*#__PURE__*/_jsxs("span", {
93
27
  className: "ml-auto flex shrink-0 items-center gap-1.5",
94
- children: [t3, t4]
95
- });
96
- $[7] = t3;
97
- $[8] = t4;
98
- $[9] = t5;
99
- } else {
100
- t5 = $[9];
101
- }
102
- let t6;
103
- if ($[10] !== icon || $[11] !== t2 || $[12] !== t5) {
104
- t6 = /*#__PURE__*/_jsxs("header", {
105
- "data-slot": "panel-header",
106
- className: "eyebrow flex items-center gap-2 px-5 pt-4 [&_svg]:size-3.5 [&_svg]:shrink-0",
107
- children: [icon, t2, t5]
108
- });
109
- $[10] = icon;
110
- $[11] = t2;
111
- $[12] = t5;
112
- $[13] = t6;
113
- } else {
114
- t6 = $[13];
115
- }
116
- return t6;
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
+ });
117
40
  }
118
- export function PanelTitle(t0) {
119
- const $ = _c(8);
120
- let className;
121
- let props;
122
- if ($[0] !== t0) {
123
- ({
124
- className,
125
- ...props
126
- } = t0);
127
- $[0] = t0;
128
- $[1] = className;
129
- $[2] = props;
130
- } else {
131
- className = $[1];
132
- props = $[2];
133
- }
134
- let t1;
135
- if ($[3] !== className) {
136
- t1 = cn("px-5 pt-2 font-sans text-base leading-snug font-semibold tracking-tight text-balance", className);
137
- $[3] = className;
138
- $[4] = t1;
139
- } else {
140
- t1 = $[4];
141
- }
142
- let t2;
143
- if ($[5] !== props || $[6] !== t1) {
144
- t2 = /*#__PURE__*/_jsx("h3", {
145
- className: t1,
146
- ...props
147
- });
148
- $[5] = props;
149
- $[6] = t1;
150
- $[7] = t2;
151
- } else {
152
- t2 = $[7];
153
- }
154
- return t2;
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
+ });
155
49
  }
156
- export function PanelBody(t0) {
157
- const $ = _c(8);
158
- let className;
159
- let props;
160
- if ($[0] !== t0) {
161
- ({
162
- className,
163
- ...props
164
- } = t0);
165
- $[0] = t0;
166
- $[1] = className;
167
- $[2] = props;
168
- } else {
169
- className = $[1];
170
- props = $[2];
171
- }
172
- let t1;
173
- if ($[3] !== className) {
174
- t1 = cn("flex flex-col gap-4 px-5 pt-4 pb-5", className);
175
- $[3] = className;
176
- $[4] = t1;
177
- } else {
178
- t1 = $[4];
179
- }
180
- let t2;
181
- if ($[5] !== props || $[6] !== t1) {
182
- t2 = /*#__PURE__*/_jsx("div", {
183
- className: t1,
184
- ...props
185
- });
186
- $[5] = props;
187
- $[6] = t1;
188
- $[7] = t2;
189
- } else {
190
- t2 = $[7];
191
- }
192
- return t2;
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
+ });
193
58
  }
194
- export function PanelFooter(t0) {
195
- const $ = _c(8);
196
- let className;
197
- let props;
198
- if ($[0] !== t0) {
199
- ({
200
- className,
201
- ...props
202
- } = t0);
203
- $[0] = t0;
204
- $[1] = className;
205
- $[2] = props;
206
- } else {
207
- className = $[1];
208
- props = $[2];
209
- }
210
- let t1;
211
- if ($[3] !== className) {
212
- t1 = cn("flex flex-wrap items-center justify-end gap-2 border-t bg-muted/70 px-5 py-3", className);
213
- $[3] = className;
214
- $[4] = t1;
215
- } else {
216
- t1 = $[4];
217
- }
218
- let t2;
219
- if ($[5] !== props || $[6] !== t1) {
220
- t2 = /*#__PURE__*/_jsx("div", {
221
- className: t1,
222
- ...props
223
- });
224
- $[5] = props;
225
- $[6] = t1;
226
- $[7] = t2;
227
- } else {
228
- t2 = $[7];
229
- }
230
- return t2;
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
+ });
231
67
  }
232
- export function LiveStatus(t0) {
233
- const $ = _c(2);
234
- const {
235
- message
236
- } = t0;
237
- let t1;
238
- if ($[0] !== message) {
239
- t1 = /*#__PURE__*/_jsx("p", {
240
- role: "status",
241
- "aria-live": "polite",
242
- className: "sr-only",
243
- children: message
244
- });
245
- $[0] = message;
246
- $[1] = t1;
247
- } else {
248
- t1 = $[1];
249
- }
250
- return t1;
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
+ });
251
77
  }
@@ -1,4 +1,3 @@
1
- import { c as _c } from "react/compiler-runtime";
2
1
  import { cn } from "@locusgraph/components";
3
2
  import { jsx as _jsx } from "react/jsx-runtime";
4
3
  export const statusDotTones = {
@@ -8,35 +7,14 @@ export const statusDotTones = {
8
7
  danger: "bg-destructive",
9
8
  idle: "bg-muted-foreground/50"
10
9
  };
11
- export function StatusDot(t0) {
12
- const $ = _c(6);
13
- const {
14
- tone,
15
- className
16
- } = t0;
17
- const t1 = statusDotTones[tone];
18
- let t2;
19
- if ($[0] !== className || $[1] !== t1) {
20
- t2 = cn("size-1.5 shrink-0 rounded-full", t1, className);
21
- $[0] = className;
22
- $[1] = t1;
23
- $[2] = t2;
24
- } else {
25
- t2 = $[2];
26
- }
27
- let t3;
28
- if ($[3] !== t2 || $[4] !== tone) {
29
- t3 = /*#__PURE__*/_jsx("span", {
30
- "aria-hidden": true,
31
- "data-slot": "status-dot",
32
- "data-tone": tone,
33
- className: t2
34
- });
35
- $[3] = t2;
36
- $[4] = tone;
37
- $[5] = t3;
38
- } else {
39
- t3 = $[5];
40
- }
41
- return t3;
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
+ });
42
20
  }
@@ -1,29 +1,12 @@
1
- import { c as _c } from "react/compiler-runtime";
2
1
  import { Button, Tooltip, TooltipContent, TooltipTrigger } from "@locusgraph/components";
3
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
- export function ActionButton(t0) {
5
- const $ = _c(13);
6
- let children;
7
- let label;
8
- let props;
9
- if ($[0] !== t0) {
10
- ({
11
- label,
12
- children,
13
- ...props
14
- } = t0);
15
- $[0] = t0;
16
- $[1] = children;
17
- $[2] = label;
18
- $[3] = props;
19
- } else {
20
- children = $[1];
21
- label = $[2];
22
- props = $[3];
23
- }
24
- let t1;
25
- if ($[4] !== children || $[5] !== label || $[6] !== props) {
26
- t1 = /*#__PURE__*/_jsx(TooltipTrigger, {
3
+ export function ActionButton({
4
+ label,
5
+ children,
6
+ ...props
7
+ }) {
8
+ return /*#__PURE__*/_jsxs(Tooltip, {
9
+ children: [/*#__PURE__*/_jsx(TooltipTrigger, {
27
10
  asChild: true,
28
11
  children: /*#__PURE__*/_jsx(Button, {
29
12
  type: "button",
@@ -34,34 +17,8 @@ export function ActionButton(t0) {
34
17
  ...props,
35
18
  children: children
36
19
  })
37
- });
38
- $[4] = children;
39
- $[5] = label;
40
- $[6] = props;
41
- $[7] = t1;
42
- } else {
43
- t1 = $[7];
44
- }
45
- let t2;
46
- if ($[8] !== label) {
47
- t2 = /*#__PURE__*/_jsx(TooltipContent, {
20
+ }), /*#__PURE__*/_jsx(TooltipContent, {
48
21
  children: label
49
- });
50
- $[8] = label;
51
- $[9] = t2;
52
- } else {
53
- t2 = $[9];
54
- }
55
- let t3;
56
- if ($[10] !== t1 || $[11] !== t2) {
57
- t3 = /*#__PURE__*/_jsxs(Tooltip, {
58
- children: [t1, t2]
59
- });
60
- $[10] = t1;
61
- $[11] = t2;
62
- $[12] = t3;
63
- } else {
64
- t3 = $[12];
65
- }
66
- return t3;
22
+ })]
23
+ });
67
24
  }
@@ -1,104 +1,30 @@
1
- import { c as _c } from "react/compiler-runtime";
2
1
  import { ChevronLeft as ChevronLeftIcon, ChevronRight as ChevronRightIcon } from "@carbon/icons-react";
3
2
  import { ActionButton } from "./action-button.js";
4
3
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
- export function BranchSwitcher(t0) {
6
- const $ = _c(20);
7
- const {
8
- branch,
9
- onBranchChange
10
- } = t0;
4
+ export function BranchSwitcher({
5
+ branch,
6
+ onBranchChange
7
+ }) {
11
8
  const position = branch.index + 1;
12
- const t1 = branch.index <= 0;
13
- let t2;
14
- if ($[0] !== branch.index || $[1] !== onBranchChange) {
15
- t2 = () => onBranchChange(branch.index - 1);
16
- $[0] = branch.index;
17
- $[1] = onBranchChange;
18
- $[2] = t2;
19
- } else {
20
- t2 = $[2];
21
- }
22
- let t3;
23
- if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
24
- t3 = /*#__PURE__*/_jsx(ChevronLeftIcon, {});
25
- $[3] = t3;
26
- } else {
27
- t3 = $[3];
28
- }
29
- let t4;
30
- if ($[4] !== t1 || $[5] !== t2) {
31
- t4 = /*#__PURE__*/_jsx(ActionButton, {
9
+ return /*#__PURE__*/_jsxs("div", {
10
+ "data-slot": "branch-switcher",
11
+ role: "group",
12
+ "aria-label": "Reply versions",
13
+ className: "flex items-center",
14
+ children: [/*#__PURE__*/_jsx(ActionButton, {
32
15
  label: "Previous version",
33
- disabled: t1,
34
- onClick: t2,
35
- children: t3
36
- });
37
- $[4] = t1;
38
- $[5] = t2;
39
- $[6] = t4;
40
- } else {
41
- t4 = $[6];
42
- }
43
- const t5 = `${position} / ${branch.count}`;
44
- let t6;
45
- if ($[7] !== t5) {
46
- t6 = /*#__PURE__*/_jsx("span", {
16
+ disabled: branch.index <= 0,
17
+ onClick: () => onBranchChange(branch.index - 1),
18
+ children: /*#__PURE__*/_jsx(ChevronLeftIcon, {})
19
+ }), /*#__PURE__*/_jsx("span", {
47
20
  "aria-live": "polite",
48
21
  className: "min-w-9 text-center font-mono text-xs text-muted-foreground tabular-nums",
49
- children: t5
50
- });
51
- $[7] = t5;
52
- $[8] = t6;
53
- } else {
54
- t6 = $[8];
55
- }
56
- const t7 = position >= branch.count;
57
- let t8;
58
- if ($[9] !== branch.index || $[10] !== onBranchChange) {
59
- t8 = () => onBranchChange(branch.index + 1);
60
- $[9] = branch.index;
61
- $[10] = onBranchChange;
62
- $[11] = t8;
63
- } else {
64
- t8 = $[11];
65
- }
66
- let t9;
67
- if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
68
- t9 = /*#__PURE__*/_jsx(ChevronRightIcon, {});
69
- $[12] = t9;
70
- } else {
71
- t9 = $[12];
72
- }
73
- let t10;
74
- if ($[13] !== t7 || $[14] !== t8) {
75
- t10 = /*#__PURE__*/_jsx(ActionButton, {
22
+ children: `${position} / ${branch.count}`
23
+ }), /*#__PURE__*/_jsx(ActionButton, {
76
24
  label: "Next version",
77
- disabled: t7,
78
- onClick: t8,
79
- children: t9
80
- });
81
- $[13] = t7;
82
- $[14] = t8;
83
- $[15] = t10;
84
- } else {
85
- t10 = $[15];
86
- }
87
- let t11;
88
- if ($[16] !== t10 || $[17] !== t4 || $[18] !== t6) {
89
- t11 = /*#__PURE__*/_jsxs("div", {
90
- "data-slot": "branch-switcher",
91
- role: "group",
92
- "aria-label": "Reply versions",
93
- className: "flex items-center",
94
- children: [t4, t6, t10]
95
- });
96
- $[16] = t10;
97
- $[17] = t4;
98
- $[18] = t6;
99
- $[19] = t11;
100
- } else {
101
- t11 = $[19];
102
- }
103
- return t11;
25
+ disabled: position >= branch.count,
26
+ onClick: () => onBranchChange(branch.index + 1),
27
+ children: /*#__PURE__*/_jsx(ChevronRightIcon, {})
28
+ })]
29
+ });
104
30
  }
@@ -86,7 +86,7 @@ export function Canvas(t0) {
86
86
  let t5;
87
87
  if ($[18] !== kind) {
88
88
  t5 = kind && /*#__PURE__*/_jsx("span", {
89
- className: "eyebrow",
89
+ className: "locus-eyebrow",
90
90
  children: kind
91
91
  });
92
92
  $[18] = kind;