@locusgraph/loop 0.3.0 → 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/use-loop-animation.js +35 -12
- 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/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 +90 -23
- 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/cost/model-picker.js +174 -42
- package/dist/memory/cite.js +181 -58
- package/dist/memory/memorized.js +196 -42
- package/dist/memory/recall.js +265 -68
- package/dist/memory/sources.js +232 -52
- package/dist/shared/virtual/use-list-virtualizer.js +2 -0
- package/dist/thread/actions/branch-switcher.js +97 -21
- package/dist/thread/canvas/version-switcher.js +128 -31
- package/dist/thread/code/copy-code-button.js +58 -24
- 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 +1 -1
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { c as _c } from "react/compiler-runtime";
|
|
1
4
|
import { cn } from "@locusgraph/components";
|
|
2
5
|
import { useEffect, useRef } from "react";
|
|
3
6
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -13,68 +16,153 @@ function indexFromDigitKey(key, count) {
|
|
|
13
16
|
const digit = Number(key);
|
|
14
17
|
return Number.isInteger(digit) && digit >= 1 && digit <= count ? digit - 1 : undefined;
|
|
15
18
|
}
|
|
16
|
-
export function QuestionChoices({
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const option = options[next];
|
|
33
|
-
if (!option) return;
|
|
34
|
-
onSelect(option.id);
|
|
35
|
-
buttons.current[next]?.focus();
|
|
19
|
+
export function QuestionChoices(t0) {
|
|
20
|
+
const $ = _c(25);
|
|
21
|
+
const {
|
|
22
|
+
label,
|
|
23
|
+
options,
|
|
24
|
+
selectedId,
|
|
25
|
+
onSelect,
|
|
26
|
+
autoFocus: t1
|
|
27
|
+
} = t0;
|
|
28
|
+
const autoFocus = t1 === undefined ? false : t1;
|
|
29
|
+
let t2;
|
|
30
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
31
|
+
t2 = [];
|
|
32
|
+
$[0] = t2;
|
|
33
|
+
} else {
|
|
34
|
+
t2 = $[0];
|
|
36
35
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
const buttons = useRef(t2);
|
|
37
|
+
let t3;
|
|
38
|
+
let t4;
|
|
39
|
+
if ($[1] !== autoFocus) {
|
|
40
|
+
t3 = () => {
|
|
41
|
+
if (autoFocus) {
|
|
42
|
+
buttons.current[0]?.focus({
|
|
43
|
+
preventScroll: true
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
t4 = [autoFocus];
|
|
48
|
+
$[1] = autoFocus;
|
|
49
|
+
$[2] = t3;
|
|
50
|
+
$[3] = t4;
|
|
51
|
+
} else {
|
|
52
|
+
t3 = $[2];
|
|
53
|
+
t4 = $[3];
|
|
43
54
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
55
|
+
useEffect(t3, t4);
|
|
56
|
+
let t5;
|
|
57
|
+
if ($[4] !== options || $[5] !== selectedId) {
|
|
58
|
+
let t6;
|
|
59
|
+
if ($[7] !== selectedId) {
|
|
60
|
+
t6 = option => option.id === selectedId;
|
|
61
|
+
$[7] = selectedId;
|
|
62
|
+
$[8] = t6;
|
|
63
|
+
} else {
|
|
64
|
+
t6 = $[8];
|
|
65
|
+
}
|
|
66
|
+
t5 = options.findIndex(t6);
|
|
67
|
+
$[4] = options;
|
|
68
|
+
$[5] = selectedId;
|
|
69
|
+
$[6] = t5;
|
|
70
|
+
} else {
|
|
71
|
+
t5 = $[6];
|
|
72
|
+
}
|
|
73
|
+
const selectedIndex = t5;
|
|
74
|
+
const tabStop = selectedIndex === -1 ? 0 : selectedIndex;
|
|
75
|
+
let t10;
|
|
76
|
+
let t6;
|
|
77
|
+
let t7;
|
|
78
|
+
let t8;
|
|
79
|
+
let t9;
|
|
80
|
+
if ($[9] !== label || $[10] !== onSelect || $[11] !== options || $[12] !== selectedId || $[13] !== tabStop) {
|
|
81
|
+
const selectIndex = function selectIndex(next) {
|
|
82
|
+
const option_0 = options[next];
|
|
83
|
+
if (!option_0) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
onSelect(option_0.id);
|
|
87
|
+
buttons.current[next]?.focus();
|
|
88
|
+
};
|
|
89
|
+
const handleKeyDown = function handleKeyDown(event, index) {
|
|
90
|
+
const byDigit = indexFromDigitKey(event.key, options.length);
|
|
91
|
+
const move = nextIndexByKey[event.key];
|
|
92
|
+
if (byDigit === undefined && !move) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
event.preventDefault();
|
|
96
|
+
selectIndex(byDigit ?? move?.(index, options.length) ?? index);
|
|
97
|
+
};
|
|
98
|
+
t6 = "radiogroup";
|
|
99
|
+
t7 = label;
|
|
100
|
+
t8 = "question-choices";
|
|
101
|
+
t9 = "-mx-5 flex flex-col divide-y border-y";
|
|
102
|
+
t10 = options.map((option_1, index_0) => {
|
|
103
|
+
const checked = option_1.id === selectedId;
|
|
51
104
|
return /*#__PURE__*/_jsxs("button", {
|
|
52
105
|
ref: element => {
|
|
53
|
-
buttons.current[
|
|
106
|
+
buttons.current[index_0] = element;
|
|
54
107
|
},
|
|
55
108
|
type: "button",
|
|
56
109
|
role: "radio",
|
|
57
110
|
"aria-checked": checked,
|
|
58
|
-
tabIndex:
|
|
111
|
+
tabIndex: index_0 === tabStop ? 0 : -1,
|
|
59
112
|
"data-state": checked ? "checked" : "unchecked",
|
|
60
|
-
onClick: () => onSelect(
|
|
61
|
-
onKeyDown:
|
|
113
|
+
onClick: () => onSelect(option_1.id),
|
|
114
|
+
onKeyDown: event_0 => handleKeyDown(event_0, index_0),
|
|
62
115
|
className: cn("group relative flex items-center gap-3 px-5 py-2.5 text-left text-sm outline-none motion-safe:transition-colors focus-visible:z-10 focus-visible:ring-2 focus-visible:ring-ring/70 focus-visible:ring-inset", checked ? "bg-accent" : "hover:bg-accent/50"),
|
|
63
116
|
children: [/*#__PURE__*/_jsx("span", {
|
|
64
117
|
"aria-hidden": true,
|
|
65
118
|
className: cn("flex size-5 shrink-0 items-center justify-center font-mono text-[11px] ring-1", checked ? "bg-primary text-primary-foreground ring-primary" : "text-muted-foreground ring-input"),
|
|
66
|
-
children:
|
|
119
|
+
children: index_0 + 1
|
|
67
120
|
}), /*#__PURE__*/_jsxs("span", {
|
|
68
121
|
className: "flex min-w-0 flex-1 flex-col",
|
|
69
122
|
children: [/*#__PURE__*/_jsx("span", {
|
|
70
123
|
className: "font-medium",
|
|
71
|
-
children:
|
|
72
|
-
}),
|
|
124
|
+
children: option_1.label
|
|
125
|
+
}), option_1.description && /*#__PURE__*/_jsx("span", {
|
|
73
126
|
className: "text-xs text-muted-foreground",
|
|
74
|
-
children:
|
|
127
|
+
children: option_1.description
|
|
75
128
|
})]
|
|
76
129
|
})]
|
|
77
|
-
},
|
|
78
|
-
})
|
|
79
|
-
|
|
130
|
+
}, option_1.id);
|
|
131
|
+
});
|
|
132
|
+
$[9] = label;
|
|
133
|
+
$[10] = onSelect;
|
|
134
|
+
$[11] = options;
|
|
135
|
+
$[12] = selectedId;
|
|
136
|
+
$[13] = tabStop;
|
|
137
|
+
$[14] = t10;
|
|
138
|
+
$[15] = t6;
|
|
139
|
+
$[16] = t7;
|
|
140
|
+
$[17] = t8;
|
|
141
|
+
$[18] = t9;
|
|
142
|
+
} else {
|
|
143
|
+
t10 = $[14];
|
|
144
|
+
t6 = $[15];
|
|
145
|
+
t7 = $[16];
|
|
146
|
+
t8 = $[17];
|
|
147
|
+
t9 = $[18];
|
|
148
|
+
}
|
|
149
|
+
let t11;
|
|
150
|
+
if ($[19] !== t10 || $[20] !== t6 || $[21] !== t7 || $[22] !== t8 || $[23] !== t9) {
|
|
151
|
+
t11 = /*#__PURE__*/_jsx("div", {
|
|
152
|
+
role: t6,
|
|
153
|
+
"aria-label": t7,
|
|
154
|
+
"data-slot": t8,
|
|
155
|
+
className: t9,
|
|
156
|
+
children: t10
|
|
157
|
+
});
|
|
158
|
+
$[19] = t10;
|
|
159
|
+
$[20] = t6;
|
|
160
|
+
$[21] = t7;
|
|
161
|
+
$[22] = t8;
|
|
162
|
+
$[23] = t9;
|
|
163
|
+
$[24] = t11;
|
|
164
|
+
} else {
|
|
165
|
+
t11 = $[24];
|
|
166
|
+
}
|
|
167
|
+
return t11;
|
|
80
168
|
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { c as _c } from "react/compiler-runtime";
|
|
1
4
|
import { ArrowRight as ArrowRightIcon, Help as MessageCircleQuestionIcon } from "@carbon/icons-react";
|
|
2
5
|
import { Button, Input, Textarea } from "@locusgraph/components";
|
|
3
6
|
import { useId, useState } from "react";
|
|
@@ -10,48 +13,105 @@ function answerText(answer, options) {
|
|
|
10
13
|
const option = options.find(item => item.id === answer.optionId);
|
|
11
14
|
return [option?.label, answer.text].filter(Boolean).join(" · ");
|
|
12
15
|
}
|
|
13
|
-
export function Question({
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
export function Question(t0) {
|
|
17
|
+
const $ = _c(42);
|
|
18
|
+
const {
|
|
19
|
+
question,
|
|
20
|
+
options: t1,
|
|
21
|
+
allowText: allowTextProp,
|
|
22
|
+
textLabel: textLabelProp,
|
|
23
|
+
textPlaceholder: textPlaceholderProp,
|
|
24
|
+
submitLabel: t2,
|
|
25
|
+
answer,
|
|
26
|
+
onAnswer,
|
|
27
|
+
autoFocus: t3,
|
|
28
|
+
className
|
|
29
|
+
} = t0;
|
|
30
|
+
let t4;
|
|
31
|
+
if ($[0] !== t1) {
|
|
32
|
+
t4 = t1 === undefined ? [] : t1;
|
|
33
|
+
$[0] = t1;
|
|
34
|
+
$[1] = t4;
|
|
35
|
+
} else {
|
|
36
|
+
t4 = $[1];
|
|
37
|
+
}
|
|
38
|
+
const options = t4;
|
|
39
|
+
const submitLabel = t2 === undefined ? "Send answer" : t2;
|
|
40
|
+
const autoFocus = t3 === undefined ? true : t3;
|
|
25
41
|
const hasOptions = options.length > 0;
|
|
26
42
|
const allowText = allowTextProp ?? !hasOptions;
|
|
27
43
|
const textLabel = textLabelProp ?? (hasOptions ? "Something else" : "Your answer");
|
|
28
|
-
const textPlaceholder = textPlaceholderProp ?? (hasOptions ? "Something else
|
|
44
|
+
const textPlaceholder = textPlaceholderProp ?? (hasOptions ? "Something else\u2026" : "Type an answer for the agent");
|
|
29
45
|
const textId = useId();
|
|
30
46
|
const [optionId, setOptionId] = useState();
|
|
31
47
|
const [text, setText] = useState("");
|
|
32
|
-
|
|
48
|
+
let t5;
|
|
49
|
+
if ($[2] !== text) {
|
|
50
|
+
t5 = text.trim();
|
|
51
|
+
$[2] = text;
|
|
52
|
+
$[3] = t5;
|
|
53
|
+
} else {
|
|
54
|
+
t5 = $[3];
|
|
55
|
+
}
|
|
56
|
+
const trimmed = t5;
|
|
33
57
|
const canSubmit = optionId !== undefined || trimmed !== "";
|
|
34
58
|
const textOnly = options.length === 0;
|
|
35
59
|
const textRef = useFocusOnMount(autoFocus && !answer && textOnly);
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
60
|
+
let t6;
|
|
61
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
62
|
+
t6 = value => {
|
|
63
|
+
setText(value);
|
|
64
|
+
if (value.trim() !== "") {
|
|
65
|
+
setOptionId(undefined);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
$[4] = t6;
|
|
69
|
+
} else {
|
|
70
|
+
t6 = $[4];
|
|
71
|
+
}
|
|
72
|
+
const changeText = t6;
|
|
73
|
+
const t7 = answer ? true : undefined;
|
|
74
|
+
let t8;
|
|
75
|
+
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
76
|
+
t8 = /*#__PURE__*/_jsx(MessageCircleQuestionIcon, {
|
|
77
|
+
"aria-hidden": true
|
|
78
|
+
});
|
|
79
|
+
$[5] = t8;
|
|
80
|
+
} else {
|
|
81
|
+
t8 = $[5];
|
|
82
|
+
}
|
|
83
|
+
const t9 = answer ? "Answered" : "Waiting for you";
|
|
84
|
+
const t10 = answer ? "done" : "waiting";
|
|
85
|
+
let t11;
|
|
86
|
+
if ($[6] !== t10 || $[7] !== t9) {
|
|
87
|
+
t11 = /*#__PURE__*/_jsx(PanelHeader, {
|
|
88
|
+
icon: t8,
|
|
48
89
|
eyebrow: "Agent question",
|
|
49
|
-
status:
|
|
50
|
-
tone:
|
|
51
|
-
})
|
|
52
|
-
|
|
90
|
+
status: t9,
|
|
91
|
+
tone: t10
|
|
92
|
+
});
|
|
93
|
+
$[6] = t10;
|
|
94
|
+
$[7] = t9;
|
|
95
|
+
$[8] = t11;
|
|
96
|
+
} else {
|
|
97
|
+
t11 = $[8];
|
|
98
|
+
}
|
|
99
|
+
const t12 = answer ? "text-muted-foreground" : undefined;
|
|
100
|
+
let t13;
|
|
101
|
+
if ($[9] !== question || $[10] !== t12) {
|
|
102
|
+
t13 = /*#__PURE__*/_jsx(PanelTitle, {
|
|
103
|
+
className: t12,
|
|
53
104
|
children: question
|
|
54
|
-
})
|
|
105
|
+
});
|
|
106
|
+
$[9] = question;
|
|
107
|
+
$[10] = t12;
|
|
108
|
+
$[11] = t13;
|
|
109
|
+
} else {
|
|
110
|
+
t13 = $[11];
|
|
111
|
+
}
|
|
112
|
+
let t14;
|
|
113
|
+
if ($[12] !== allowText || $[13] !== answer || $[14] !== autoFocus || $[15] !== canSubmit || $[16] !== onAnswer || $[17] !== optionId || $[18] !== options || $[19] !== question || $[20] !== submitLabel || $[21] !== text || $[22] !== textId || $[23] !== textLabel || $[24] !== textOnly || $[25] !== textPlaceholder || $[26] !== textRef || $[27] !== trimmed) {
|
|
114
|
+
t14 = answer ? /*#__PURE__*/_jsx(PanelBody, {
|
|
55
115
|
children: /*#__PURE__*/_jsx(DecisionSummary, {
|
|
56
116
|
decision: {
|
|
57
117
|
approved: true,
|
|
@@ -64,7 +124,9 @@ export function Question({
|
|
|
64
124
|
}) : /*#__PURE__*/_jsxs("form", {
|
|
65
125
|
onSubmit: event => {
|
|
66
126
|
event.preventDefault();
|
|
67
|
-
if (!canSubmit)
|
|
127
|
+
if (!canSubmit) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
68
130
|
onAnswer({
|
|
69
131
|
optionId,
|
|
70
132
|
text: trimmed === "" ? undefined : trimmed
|
|
@@ -86,14 +148,14 @@ export function Question({
|
|
|
86
148
|
"aria-label": textLabel,
|
|
87
149
|
value: text,
|
|
88
150
|
placeholder: textPlaceholder,
|
|
89
|
-
onChange:
|
|
151
|
+
onChange: event_0 => changeText(event_0.target.value)
|
|
90
152
|
}), textOnly && /*#__PURE__*/_jsx(Textarea, {
|
|
91
153
|
id: textId,
|
|
92
154
|
ref: textRef,
|
|
93
155
|
"aria-label": textLabel,
|
|
94
156
|
value: text,
|
|
95
157
|
placeholder: textPlaceholder,
|
|
96
|
-
onChange:
|
|
158
|
+
onChange: event_1 => changeText(event_1.target.value)
|
|
97
159
|
})]
|
|
98
160
|
}), /*#__PURE__*/_jsxs(PanelFooter, {
|
|
99
161
|
className: "justify-between",
|
|
@@ -109,8 +171,64 @@ export function Question({
|
|
|
109
171
|
})]
|
|
110
172
|
})]
|
|
111
173
|
})]
|
|
112
|
-
})
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
174
|
+
});
|
|
175
|
+
$[12] = allowText;
|
|
176
|
+
$[13] = answer;
|
|
177
|
+
$[14] = autoFocus;
|
|
178
|
+
$[15] = canSubmit;
|
|
179
|
+
$[16] = onAnswer;
|
|
180
|
+
$[17] = optionId;
|
|
181
|
+
$[18] = options;
|
|
182
|
+
$[19] = question;
|
|
183
|
+
$[20] = submitLabel;
|
|
184
|
+
$[21] = text;
|
|
185
|
+
$[22] = textId;
|
|
186
|
+
$[23] = textLabel;
|
|
187
|
+
$[24] = textOnly;
|
|
188
|
+
$[25] = textPlaceholder;
|
|
189
|
+
$[26] = textRef;
|
|
190
|
+
$[27] = trimmed;
|
|
191
|
+
$[28] = t14;
|
|
192
|
+
} else {
|
|
193
|
+
t14 = $[28];
|
|
194
|
+
}
|
|
195
|
+
let t15;
|
|
196
|
+
if ($[29] !== answer || $[30] !== options || $[31] !== question) {
|
|
197
|
+
t15 = answer ? `Answered: ${answerText(answer, options)}` : `The agent asks: ${question}`;
|
|
198
|
+
$[29] = answer;
|
|
199
|
+
$[30] = options;
|
|
200
|
+
$[31] = question;
|
|
201
|
+
$[32] = t15;
|
|
202
|
+
} else {
|
|
203
|
+
t15 = $[32];
|
|
204
|
+
}
|
|
205
|
+
let t16;
|
|
206
|
+
if ($[33] !== t15) {
|
|
207
|
+
t16 = /*#__PURE__*/_jsx(LiveStatus, {
|
|
208
|
+
message: t15
|
|
209
|
+
});
|
|
210
|
+
$[33] = t15;
|
|
211
|
+
$[34] = t16;
|
|
212
|
+
} else {
|
|
213
|
+
t16 = $[34];
|
|
214
|
+
}
|
|
215
|
+
let t17;
|
|
216
|
+
if ($[35] !== className || $[36] !== t11 || $[37] !== t13 || $[38] !== t14 || $[39] !== t16 || $[40] !== t7) {
|
|
217
|
+
t17 = /*#__PURE__*/_jsxs(ApprovalPanel, {
|
|
218
|
+
"data-slot": "question",
|
|
219
|
+
"data-answered": t7,
|
|
220
|
+
className: className,
|
|
221
|
+
children: [t11, t13, t14, t16]
|
|
222
|
+
});
|
|
223
|
+
$[35] = className;
|
|
224
|
+
$[36] = t11;
|
|
225
|
+
$[37] = t13;
|
|
226
|
+
$[38] = t14;
|
|
227
|
+
$[39] = t16;
|
|
228
|
+
$[40] = t7;
|
|
229
|
+
$[41] = t17;
|
|
230
|
+
} else {
|
|
231
|
+
t17 = $[41];
|
|
232
|
+
}
|
|
233
|
+
return t17;
|
|
116
234
|
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { c as _c } from "react/compiler-runtime";
|
|
1
4
|
import { Pause as PauseIcon, Play as PlayIcon, SkipForward as SkipForwardIcon, StopFilledAlt as SquareIcon } from "@carbon/icons-react";
|
|
2
5
|
import { Button, cn } from "@locusgraph/components";
|
|
3
6
|
import { StatusDot } from "../../shared/status-dot.js";
|
|
@@ -25,46 +28,99 @@ function formatElapsed(elapsedMs) {
|
|
|
25
28
|
if (hours > 0) return `${hours}:${twoDigits(minutes)}:${twoDigits(seconds)}`;
|
|
26
29
|
return `${minutes}:${twoDigits(seconds)}`;
|
|
27
30
|
}
|
|
28
|
-
export function RunBar({
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
31
|
+
export function RunBar(t0) {
|
|
32
|
+
const $ = _c(29);
|
|
33
|
+
const {
|
|
34
|
+
status,
|
|
35
|
+
runName,
|
|
36
|
+
elapsedMs,
|
|
37
|
+
onPause,
|
|
38
|
+
onResume,
|
|
39
|
+
onStop,
|
|
40
|
+
onStep,
|
|
41
|
+
pending: t1,
|
|
42
|
+
className
|
|
43
|
+
} = t0;
|
|
44
|
+
const pending = t1 === undefined ? false : t1;
|
|
39
45
|
const live = status === "running" || status === "paused";
|
|
40
46
|
const paused = status === "paused";
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
const t2 = runName ? `Controls for ${runName}` : "Run controls";
|
|
48
|
+
let t3;
|
|
49
|
+
if ($[0] !== className) {
|
|
50
|
+
t3 = cn("flex min-h-10 min-w-0 flex-wrap items-center gap-x-3 gap-y-2 bg-card py-2 pr-2 pl-3 text-card-foreground ring-1 ring-border", className);
|
|
51
|
+
$[0] = className;
|
|
52
|
+
$[1] = t3;
|
|
53
|
+
} else {
|
|
54
|
+
t3 = $[1];
|
|
55
|
+
}
|
|
56
|
+
const t4 = statusTone[status];
|
|
57
|
+
let t5;
|
|
58
|
+
if ($[2] !== t4) {
|
|
59
|
+
t5 = /*#__PURE__*/_jsx(StatusDot, {
|
|
60
|
+
tone: t4,
|
|
61
|
+
className: "size-2"
|
|
62
|
+
});
|
|
63
|
+
$[2] = t4;
|
|
64
|
+
$[3] = t5;
|
|
65
|
+
} else {
|
|
66
|
+
t5 = $[3];
|
|
67
|
+
}
|
|
68
|
+
let t6;
|
|
69
|
+
if ($[4] !== runName) {
|
|
70
|
+
t6 = runName && /*#__PURE__*/_jsx("span", {
|
|
71
|
+
className: "truncate font-medium",
|
|
72
|
+
children: runName
|
|
73
|
+
});
|
|
74
|
+
$[4] = runName;
|
|
75
|
+
$[5] = t6;
|
|
76
|
+
} else {
|
|
77
|
+
t6 = $[5];
|
|
78
|
+
}
|
|
79
|
+
const t7 = statusLabels[status];
|
|
80
|
+
let t8;
|
|
81
|
+
if ($[6] !== t7) {
|
|
82
|
+
t8 = /*#__PURE__*/_jsx("span", {
|
|
83
|
+
role: "status",
|
|
84
|
+
"aria-live": "polite",
|
|
85
|
+
className: "locus-eyebrow shrink-0",
|
|
86
|
+
children: t7
|
|
87
|
+
});
|
|
88
|
+
$[6] = t7;
|
|
89
|
+
$[7] = t8;
|
|
90
|
+
} else {
|
|
91
|
+
t8 = $[7];
|
|
92
|
+
}
|
|
93
|
+
let t9;
|
|
94
|
+
if ($[8] !== elapsedMs) {
|
|
95
|
+
t9 = elapsedMs !== undefined && /*#__PURE__*/_jsxs("span", {
|
|
96
|
+
className: "shrink-0 font-mono text-xs text-muted-foreground tabular-nums",
|
|
97
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
98
|
+
className: "sr-only",
|
|
99
|
+
children: "Elapsed "
|
|
100
|
+
}), formatElapsed(elapsedMs)]
|
|
101
|
+
});
|
|
102
|
+
$[8] = elapsedMs;
|
|
103
|
+
$[9] = t9;
|
|
104
|
+
} else {
|
|
105
|
+
t9 = $[9];
|
|
106
|
+
}
|
|
107
|
+
let t10;
|
|
108
|
+
if ($[10] !== t5 || $[11] !== t6 || $[12] !== t8 || $[13] !== t9) {
|
|
109
|
+
t10 = /*#__PURE__*/_jsxs("span", {
|
|
48
110
|
className: "flex min-w-0 flex-1 items-center gap-2.5 text-sm",
|
|
49
|
-
children: [
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
children: [/*#__PURE__*/_jsx("span", {
|
|
63
|
-
className: "sr-only",
|
|
64
|
-
children: "Elapsed "
|
|
65
|
-
}), formatElapsed(elapsedMs)]
|
|
66
|
-
})]
|
|
67
|
-
}), live && /*#__PURE__*/_jsxs("span", {
|
|
111
|
+
children: [t5, t6, t8, t9]
|
|
112
|
+
});
|
|
113
|
+
$[10] = t5;
|
|
114
|
+
$[11] = t6;
|
|
115
|
+
$[12] = t8;
|
|
116
|
+
$[13] = t9;
|
|
117
|
+
$[14] = t10;
|
|
118
|
+
} else {
|
|
119
|
+
t10 = $[14];
|
|
120
|
+
}
|
|
121
|
+
let t11;
|
|
122
|
+
if ($[15] !== live || $[16] !== onPause || $[17] !== onResume || $[18] !== onStep || $[19] !== onStop || $[20] !== paused || $[21] !== pending) {
|
|
123
|
+
t11 = live && /*#__PURE__*/_jsxs("span", {
|
|
68
124
|
className: "ml-auto flex shrink-0 items-center gap-1",
|
|
69
125
|
children: [/*#__PURE__*/_jsxs(Button, {
|
|
70
126
|
type: "button",
|
|
@@ -100,6 +156,36 @@ export function RunBar({
|
|
|
100
156
|
className: "size-2.5 fill-current"
|
|
101
157
|
}), "Stop"]
|
|
102
158
|
})]
|
|
103
|
-
})
|
|
104
|
-
|
|
159
|
+
});
|
|
160
|
+
$[15] = live;
|
|
161
|
+
$[16] = onPause;
|
|
162
|
+
$[17] = onResume;
|
|
163
|
+
$[18] = onStep;
|
|
164
|
+
$[19] = onStop;
|
|
165
|
+
$[20] = paused;
|
|
166
|
+
$[21] = pending;
|
|
167
|
+
$[22] = t11;
|
|
168
|
+
} else {
|
|
169
|
+
t11 = $[22];
|
|
170
|
+
}
|
|
171
|
+
let t12;
|
|
172
|
+
if ($[23] !== status || $[24] !== t10 || $[25] !== t11 || $[26] !== t2 || $[27] !== t3) {
|
|
173
|
+
t12 = /*#__PURE__*/_jsxs("div", {
|
|
174
|
+
role: "toolbar",
|
|
175
|
+
"aria-label": t2,
|
|
176
|
+
"data-slot": "run-bar",
|
|
177
|
+
"data-status": status,
|
|
178
|
+
className: t3,
|
|
179
|
+
children: [t10, t11]
|
|
180
|
+
});
|
|
181
|
+
$[23] = status;
|
|
182
|
+
$[24] = t10;
|
|
183
|
+
$[25] = t11;
|
|
184
|
+
$[26] = t2;
|
|
185
|
+
$[27] = t3;
|
|
186
|
+
$[28] = t12;
|
|
187
|
+
} else {
|
|
188
|
+
t12 = $[28];
|
|
189
|
+
}
|
|
190
|
+
return t12;
|
|
105
191
|
}
|
|
@@ -1,10 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { c as _c } from "react/compiler-runtime";
|
|
1
4
|
import { useEffect, useRef } from "react";
|
|
2
5
|
export function useFocusOnMount(enabled) {
|
|
6
|
+
const $ = _c(3);
|
|
3
7
|
const ref = useRef(null);
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
let t0;
|
|
9
|
+
let t1;
|
|
10
|
+
if ($[0] !== enabled) {
|
|
11
|
+
t0 = () => {
|
|
12
|
+
if (enabled) {
|
|
13
|
+
ref.current?.focus({
|
|
14
|
+
preventScroll: true
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
t1 = [enabled];
|
|
19
|
+
$[0] = enabled;
|
|
20
|
+
$[1] = t0;
|
|
21
|
+
$[2] = t1;
|
|
22
|
+
} else {
|
|
23
|
+
t0 = $[1];
|
|
24
|
+
t1 = $[2];
|
|
25
|
+
}
|
|
26
|
+
useEffect(t0, t1);
|
|
9
27
|
return ref;
|
|
10
28
|
}
|