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