@locusgraph/loop 0.3.1 → 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 +6 -5
- package/dist/agent/pulse/marks/bars-mark.js +1 -1
- package/dist/agent/pulse/marks/glyph-mark.js +2 -2
- package/dist/agent/pulse/marks/locus-mark.js +1 -1
- 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 +1 -3
- 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 +135 -200
- package/dist/approval/inbox/inbox.d.ts +3 -3
- package/dist/approval/inbox/inbox.js +180 -139
- package/dist/approval/inbox/virtual-inbox-list.d.ts +3 -3
- package/dist/approval/inbox/virtual-inbox-list.js +20 -21
- package/dist/approval/memory/memory-review.js +155 -154
- package/dist/approval/memory/memory-row.js +86 -87
- package/dist/approval/plan/plan-review.js +110 -129
- package/dist/approval/plan/plan-step-row.js +7 -6
- 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 +10 -7
- package/dist/approval/plan/question.js +116 -112
- package/dist/approval/run/run-bar.js +43 -40
- 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-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 +134 -126
- package/dist/approval/spend/spend-gate.js +133 -156
- 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 +114 -214
- package/dist/approval/tool/args/args-editor.js +147 -156
- package/dist/approval/tool/args/args-field.js +197 -109
- package/dist/approval/tool/deny-form.js +59 -66
- package/dist/approval/tool/tool-inputs.js +38 -45
- package/dist/chat/chat/chat.js +5 -4
- package/dist/chat/chat/use-stick-to-bottom.js +1 -3
- package/dist/chat/composer/composer-actions.js +4 -1
- package/dist/chat/composer/composer.js +4 -3
- package/dist/chat/composer/use-auto-grow.js +14 -10
- package/dist/chat/files/files.js +12 -10
- 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 +5 -4
- 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 +55 -47
- package/dist/memory/memorized.js +123 -108
- package/dist/memory/recall.js +136 -146
- 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 +135 -100
- 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/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 +67 -37
- 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 +106 -87
- 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 +56 -25
- 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 +8 -5
- package/dist/thread/history/row/thread-item-menu.js +13 -4
- package/dist/thread/history/row/thread-title-editor.js +1 -1
- package/dist/thread/history/virtual-history-list.js +1 -2
- package/dist/thread/index.d.ts +1 -0
- package/dist/thread/index.js +1 -0
- package/dist/thread/starters/starters.js +5 -4
- 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,20 +1,24 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { c as _c } from "react/compiler-runtime";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { Button, cn, Input, Textarea } from "@locusgraph/components";
|
|
5
|
+
import { ArrowRight as ArrowRightIcon, Question as MessageCircleQuestionIcon } from "@phosphor-icons/react/ssr";
|
|
6
6
|
import { useId, useState } from "react";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { DecisionSummary } from "../../shared/decision-summary.js";
|
|
8
|
+
import { lineObjectClass } from "../../shared/line.js";
|
|
9
|
+
import { LiveStatus } from "../../shared/live-status.js";
|
|
10
|
+
import { PendingLine, SettledLine } from "../shared/approval-line.js";
|
|
9
11
|
import { useFocusOnMount } from "../shared/use-focus-on-mount.js";
|
|
12
|
+
import { useFocusWhenSettled } from "../shared/use-focus-when-settled.js";
|
|
10
13
|
import { QuestionChoices } from "./question-choices.js";
|
|
11
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
15
|
+
const filledFieldClass = "border-transparent bg-muted shadow-none placeholder:text-faint dark:bg-muted";
|
|
12
16
|
function answerText(answer, options) {
|
|
13
17
|
const option = options.find(item => item.id === answer.optionId);
|
|
14
18
|
return [option?.label, answer.text].filter(Boolean).join(" · ");
|
|
15
19
|
}
|
|
16
20
|
export function Question(t0) {
|
|
17
|
-
const $ = _c(
|
|
21
|
+
const $ = _c(39);
|
|
18
22
|
const {
|
|
19
23
|
question,
|
|
20
24
|
options: t1,
|
|
@@ -57,6 +61,7 @@ export function Question(t0) {
|
|
|
57
61
|
const canSubmit = optionId !== undefined || trimmed !== "";
|
|
58
62
|
const textOnly = options.length === 0;
|
|
59
63
|
const textRef = useFocusOnMount(autoFocus && !answer && textOnly);
|
|
64
|
+
const settleRef = useFocusWhenSettled(!answer);
|
|
60
65
|
let t6;
|
|
61
66
|
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
62
67
|
t6 = value => {
|
|
@@ -70,48 +75,34 @@ export function Question(t0) {
|
|
|
70
75
|
t6 = $[4];
|
|
71
76
|
}
|
|
72
77
|
const changeText = t6;
|
|
73
|
-
|
|
74
|
-
let t8;
|
|
78
|
+
let t7;
|
|
75
79
|
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
76
|
-
|
|
80
|
+
t7 = /*#__PURE__*/_jsx(MessageCircleQuestionIcon, {
|
|
81
|
+
weight: "bold",
|
|
77
82
|
"aria-hidden": true
|
|
78
83
|
});
|
|
79
|
-
$[5] =
|
|
84
|
+
$[5] = t7;
|
|
80
85
|
} else {
|
|
81
|
-
|
|
86
|
+
t7 = $[5];
|
|
82
87
|
}
|
|
83
|
-
const
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
status: t9,
|
|
91
|
-
tone: t10
|
|
92
|
-
});
|
|
93
|
-
$[6] = t10;
|
|
88
|
+
const icon = t7;
|
|
89
|
+
const t8 = answer ? true : undefined;
|
|
90
|
+
const t9 = !answer && "gap-3";
|
|
91
|
+
let t10;
|
|
92
|
+
if ($[6] !== className || $[7] !== t9) {
|
|
93
|
+
t10 = cn("flex min-w-0 flex-col outline-none", t9, className);
|
|
94
|
+
$[6] = className;
|
|
94
95
|
$[7] = t9;
|
|
95
|
-
$[8] =
|
|
96
|
+
$[8] = t10;
|
|
96
97
|
} else {
|
|
97
|
-
|
|
98
|
+
t10 = $[8];
|
|
98
99
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
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, {
|
|
100
|
+
let t11;
|
|
101
|
+
if ($[9] !== allowText || $[10] !== answer || $[11] !== autoFocus || $[12] !== canSubmit || $[13] !== onAnswer || $[14] !== optionId || $[15] !== options || $[16] !== question || $[17] !== submitLabel || $[18] !== text || $[19] !== textId || $[20] !== textLabel || $[21] !== textOnly || $[22] !== textPlaceholder || $[23] !== textRef || $[24] !== trimmed) {
|
|
102
|
+
t11 = answer ? /*#__PURE__*/_jsx(SettledLine, {
|
|
103
|
+
name: question,
|
|
104
|
+
verb: "Asked",
|
|
105
|
+
icon: icon,
|
|
115
106
|
children: /*#__PURE__*/_jsx(DecisionSummary, {
|
|
116
107
|
decision: {
|
|
117
108
|
approved: true,
|
|
@@ -121,19 +112,26 @@ export function Question(t0) {
|
|
|
121
112
|
approvedVerb: "Answered",
|
|
122
113
|
result: answerText(answer, options) || "No answer"
|
|
123
114
|
})
|
|
124
|
-
}) : /*#__PURE__*/_jsxs(
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
115
|
+
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
116
|
+
children: [/*#__PURE__*/_jsxs(PendingLine, {
|
|
117
|
+
icon: icon,
|
|
118
|
+
wrap: true,
|
|
119
|
+
children: ["for your answer: ", /*#__PURE__*/_jsx("span", {
|
|
120
|
+
className: lineObjectClass,
|
|
121
|
+
children: question
|
|
122
|
+
})]
|
|
123
|
+
}), /*#__PURE__*/_jsxs("form", {
|
|
124
|
+
className: "flex flex-col gap-3",
|
|
125
|
+
onSubmit: event => {
|
|
126
|
+
event.preventDefault();
|
|
127
|
+
if (!canSubmit) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
onAnswer({
|
|
131
|
+
optionId,
|
|
132
|
+
text: trimmed === "" ? undefined : trimmed
|
|
133
|
+
});
|
|
134
|
+
},
|
|
137
135
|
children: [!textOnly && /*#__PURE__*/_jsx(QuestionChoices, {
|
|
138
136
|
label: question,
|
|
139
137
|
options: options,
|
|
@@ -148,6 +146,7 @@ export function Question(t0) {
|
|
|
148
146
|
"aria-label": textLabel,
|
|
149
147
|
value: text,
|
|
150
148
|
placeholder: textPlaceholder,
|
|
149
|
+
className: filledFieldClass,
|
|
151
150
|
onChange: event_0 => changeText(event_0.target.value)
|
|
152
151
|
}), textOnly && /*#__PURE__*/_jsx(Textarea, {
|
|
153
152
|
id: textId,
|
|
@@ -155,80 +154,85 @@ export function Question(t0) {
|
|
|
155
154
|
"aria-label": textLabel,
|
|
156
155
|
value: text,
|
|
157
156
|
placeholder: textPlaceholder,
|
|
157
|
+
className: filledFieldClass,
|
|
158
158
|
onChange: event_1 => changeText(event_1.target.value)
|
|
159
|
-
})
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
"
|
|
159
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
160
|
+
className: "flex flex-wrap items-center gap-3",
|
|
161
|
+
children: [/*#__PURE__*/_jsxs(Button, {
|
|
162
|
+
type: "submit",
|
|
163
|
+
size: "sm",
|
|
164
|
+
disabled: !canSubmit,
|
|
165
|
+
children: [submitLabel, /*#__PURE__*/_jsx(ArrowRightIcon, {
|
|
166
|
+
weight: "bold",
|
|
167
|
+
"aria-hidden": true
|
|
168
|
+
})]
|
|
169
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
170
|
+
className: "hidden text-xs text-faint sm:inline",
|
|
171
|
+
children: textOnly ? "The run is paused" : `Press 1–${options.length} to pick`
|
|
171
172
|
})]
|
|
172
173
|
})]
|
|
173
174
|
})]
|
|
174
175
|
});
|
|
175
|
-
$[
|
|
176
|
-
$[
|
|
177
|
-
$[
|
|
178
|
-
$[
|
|
179
|
-
$[
|
|
180
|
-
$[
|
|
181
|
-
$[
|
|
182
|
-
$[
|
|
183
|
-
$[
|
|
184
|
-
$[
|
|
185
|
-
$[
|
|
186
|
-
$[
|
|
187
|
-
$[
|
|
188
|
-
$[
|
|
189
|
-
$[
|
|
190
|
-
$[
|
|
191
|
-
$[
|
|
176
|
+
$[9] = allowText;
|
|
177
|
+
$[10] = answer;
|
|
178
|
+
$[11] = autoFocus;
|
|
179
|
+
$[12] = canSubmit;
|
|
180
|
+
$[13] = onAnswer;
|
|
181
|
+
$[14] = optionId;
|
|
182
|
+
$[15] = options;
|
|
183
|
+
$[16] = question;
|
|
184
|
+
$[17] = submitLabel;
|
|
185
|
+
$[18] = text;
|
|
186
|
+
$[19] = textId;
|
|
187
|
+
$[20] = textLabel;
|
|
188
|
+
$[21] = textOnly;
|
|
189
|
+
$[22] = textPlaceholder;
|
|
190
|
+
$[23] = textRef;
|
|
191
|
+
$[24] = trimmed;
|
|
192
|
+
$[25] = t11;
|
|
192
193
|
} else {
|
|
193
|
-
|
|
194
|
+
t11 = $[25];
|
|
194
195
|
}
|
|
195
|
-
let
|
|
196
|
-
if ($[
|
|
197
|
-
|
|
198
|
-
$[
|
|
199
|
-
$[
|
|
200
|
-
$[
|
|
201
|
-
$[
|
|
196
|
+
let t12;
|
|
197
|
+
if ($[26] !== answer || $[27] !== options || $[28] !== question) {
|
|
198
|
+
t12 = answer ? `Answered: ${answerText(answer, options)}` : `The agent asks: ${question}`;
|
|
199
|
+
$[26] = answer;
|
|
200
|
+
$[27] = options;
|
|
201
|
+
$[28] = question;
|
|
202
|
+
$[29] = t12;
|
|
202
203
|
} else {
|
|
203
|
-
|
|
204
|
+
t12 = $[29];
|
|
204
205
|
}
|
|
205
|
-
let
|
|
206
|
-
if ($[
|
|
207
|
-
|
|
208
|
-
message:
|
|
206
|
+
let t13;
|
|
207
|
+
if ($[30] !== t12) {
|
|
208
|
+
t13 = /*#__PURE__*/_jsx(LiveStatus, {
|
|
209
|
+
message: t12
|
|
209
210
|
});
|
|
210
|
-
$[
|
|
211
|
-
$[
|
|
211
|
+
$[30] = t12;
|
|
212
|
+
$[31] = t13;
|
|
212
213
|
} else {
|
|
213
|
-
|
|
214
|
+
t13 = $[31];
|
|
214
215
|
}
|
|
215
|
-
let
|
|
216
|
-
if ($[
|
|
217
|
-
|
|
216
|
+
let t14;
|
|
217
|
+
if ($[32] !== question || $[33] !== settleRef || $[34] !== t10 || $[35] !== t11 || $[36] !== t13 || $[37] !== t8) {
|
|
218
|
+
t14 = /*#__PURE__*/_jsxs("section", {
|
|
219
|
+
ref: settleRef,
|
|
220
|
+
tabIndex: -1,
|
|
218
221
|
"data-slot": "question",
|
|
219
|
-
"
|
|
220
|
-
|
|
221
|
-
|
|
222
|
+
"aria-label": question,
|
|
223
|
+
"data-answered": t8,
|
|
224
|
+
className: t10,
|
|
225
|
+
children: [t11, t13]
|
|
222
226
|
});
|
|
223
|
-
$[
|
|
224
|
-
$[
|
|
225
|
-
$[
|
|
227
|
+
$[32] = question;
|
|
228
|
+
$[33] = settleRef;
|
|
229
|
+
$[34] = t10;
|
|
230
|
+
$[35] = t11;
|
|
231
|
+
$[36] = t13;
|
|
232
|
+
$[37] = t8;
|
|
226
233
|
$[38] = t14;
|
|
227
|
-
$[39] = t16;
|
|
228
|
-
$[40] = t7;
|
|
229
|
-
$[41] = t17;
|
|
230
234
|
} else {
|
|
231
|
-
|
|
235
|
+
t14 = $[38];
|
|
232
236
|
}
|
|
233
|
-
return
|
|
237
|
+
return t14;
|
|
234
238
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { c as _c } from "react/compiler-runtime";
|
|
4
|
-
import { Pause as PauseIcon, Play as PlayIcon, SkipForward as SkipForwardIcon, StopFilledAlt as SquareIcon } from "@carbon/icons-react";
|
|
5
4
|
import { Button, cn } from "@locusgraph/components";
|
|
6
|
-
import {
|
|
5
|
+
import { Pause as PauseIcon, Play as PlayIcon, SkipForward as SkipForwardIcon, Stop as SquareIcon } from "@phosphor-icons/react/ssr";
|
|
7
6
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
7
|
const statusLabels = {
|
|
9
8
|
running: "Running",
|
|
@@ -12,11 +11,12 @@ const statusLabels = {
|
|
|
12
11
|
done: "Done"
|
|
13
12
|
};
|
|
14
13
|
const statusTone = {
|
|
15
|
-
running: "
|
|
16
|
-
paused: "
|
|
17
|
-
stopped: "
|
|
18
|
-
done: "
|
|
14
|
+
running: "text-muted-foreground motion-safe:locus-shimmer",
|
|
15
|
+
paused: "font-medium text-warn",
|
|
16
|
+
stopped: "font-medium text-destructive",
|
|
17
|
+
done: "font-medium text-good"
|
|
19
18
|
};
|
|
19
|
+
const quietButtonClass = "text-faint hover:bg-transparent hover:text-interactive";
|
|
20
20
|
function twoDigits(value) {
|
|
21
21
|
return String(value).padStart(2, "0");
|
|
22
22
|
}
|
|
@@ -47,71 +47,68 @@ export function RunBar(t0) {
|
|
|
47
47
|
const t2 = runName ? `Controls for ${runName}` : "Run controls";
|
|
48
48
|
let t3;
|
|
49
49
|
if ($[0] !== className) {
|
|
50
|
-
t3 = cn("flex min-h-
|
|
50
|
+
t3 = cn("flex min-h-control-sm min-w-0 flex-wrap items-center gap-x-3 gap-y-1", className);
|
|
51
51
|
$[0] = className;
|
|
52
52
|
$[1] = t3;
|
|
53
53
|
} else {
|
|
54
54
|
t3 = $[1];
|
|
55
55
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
className: "size-2"
|
|
56
|
+
let t4;
|
|
57
|
+
if ($[2] !== runName) {
|
|
58
|
+
t4 = runName && /*#__PURE__*/_jsx("span", {
|
|
59
|
+
className: "truncate font-medium text-foreground",
|
|
60
|
+
children: runName
|
|
62
61
|
});
|
|
63
|
-
$[2] =
|
|
64
|
-
$[3] =
|
|
62
|
+
$[2] = runName;
|
|
63
|
+
$[3] = t4;
|
|
65
64
|
} else {
|
|
66
|
-
|
|
65
|
+
t4 = $[3];
|
|
67
66
|
}
|
|
67
|
+
const t5 = statusTone[status];
|
|
68
68
|
let t6;
|
|
69
|
-
if ($[4] !==
|
|
70
|
-
t6 =
|
|
71
|
-
|
|
72
|
-
children: runName
|
|
73
|
-
});
|
|
74
|
-
$[4] = runName;
|
|
69
|
+
if ($[4] !== t5) {
|
|
70
|
+
t6 = cn("shrink-0", t5);
|
|
71
|
+
$[4] = t5;
|
|
75
72
|
$[5] = t6;
|
|
76
73
|
} else {
|
|
77
74
|
t6 = $[5];
|
|
78
75
|
}
|
|
79
76
|
const t7 = statusLabels[status];
|
|
80
77
|
let t8;
|
|
81
|
-
if ($[6] !== t7) {
|
|
78
|
+
if ($[6] !== t6 || $[7] !== t7) {
|
|
82
79
|
t8 = /*#__PURE__*/_jsx("span", {
|
|
83
80
|
role: "status",
|
|
84
81
|
"aria-live": "polite",
|
|
85
|
-
className:
|
|
82
|
+
className: t6,
|
|
86
83
|
children: t7
|
|
87
84
|
});
|
|
88
|
-
$[6] =
|
|
89
|
-
$[7] =
|
|
85
|
+
$[6] = t6;
|
|
86
|
+
$[7] = t7;
|
|
87
|
+
$[8] = t8;
|
|
90
88
|
} else {
|
|
91
|
-
t8 = $[
|
|
89
|
+
t8 = $[8];
|
|
92
90
|
}
|
|
93
91
|
let t9;
|
|
94
|
-
if ($[
|
|
92
|
+
if ($[9] !== elapsedMs) {
|
|
95
93
|
t9 = elapsedMs !== undefined && /*#__PURE__*/_jsxs("span", {
|
|
96
|
-
className: "shrink-0
|
|
94
|
+
className: "shrink-0 text-faint tabular-nums",
|
|
97
95
|
children: [/*#__PURE__*/_jsx("span", {
|
|
98
96
|
className: "sr-only",
|
|
99
97
|
children: "Elapsed "
|
|
100
98
|
}), formatElapsed(elapsedMs)]
|
|
101
99
|
});
|
|
102
|
-
$[
|
|
103
|
-
$[
|
|
100
|
+
$[9] = elapsedMs;
|
|
101
|
+
$[10] = t9;
|
|
104
102
|
} else {
|
|
105
|
-
t9 = $[
|
|
103
|
+
t9 = $[10];
|
|
106
104
|
}
|
|
107
105
|
let t10;
|
|
108
|
-
if ($[
|
|
106
|
+
if ($[11] !== t4 || $[12] !== t8 || $[13] !== t9) {
|
|
109
107
|
t10 = /*#__PURE__*/_jsxs("span", {
|
|
110
|
-
className: "flex min-w-0 flex-
|
|
111
|
-
children: [
|
|
108
|
+
className: "flex min-w-0 flex-auto items-center gap-2.5 text-sm",
|
|
109
|
+
children: [t4, t8, t9]
|
|
112
110
|
});
|
|
113
|
-
$[
|
|
114
|
-
$[11] = t6;
|
|
111
|
+
$[11] = t4;
|
|
115
112
|
$[12] = t8;
|
|
116
113
|
$[13] = t9;
|
|
117
114
|
$[14] = t10;
|
|
@@ -121,16 +118,19 @@ export function RunBar(t0) {
|
|
|
121
118
|
let t11;
|
|
122
119
|
if ($[15] !== live || $[16] !== onPause || $[17] !== onResume || $[18] !== onStep || $[19] !== onStop || $[20] !== paused || $[21] !== pending) {
|
|
123
120
|
t11 = live && /*#__PURE__*/_jsxs("span", {
|
|
124
|
-
className: "
|
|
121
|
+
className: "flex shrink-0 items-center gap-1",
|
|
125
122
|
children: [/*#__PURE__*/_jsxs(Button, {
|
|
126
123
|
type: "button",
|
|
127
124
|
size: "xs",
|
|
128
|
-
variant: paused ? "default" : "
|
|
125
|
+
variant: paused ? "default" : "ghost",
|
|
126
|
+
className: paused ? undefined : quietButtonClass,
|
|
129
127
|
disabled: pending,
|
|
130
128
|
onClick: paused ? onResume : onPause,
|
|
131
129
|
children: [paused ? /*#__PURE__*/_jsx(PlayIcon, {
|
|
130
|
+
weight: "bold",
|
|
132
131
|
"aria-hidden": true
|
|
133
132
|
}) : /*#__PURE__*/_jsx(PauseIcon, {
|
|
133
|
+
weight: "bold",
|
|
134
134
|
"aria-hidden": true
|
|
135
135
|
}), paused ? "Resume" : "Pause"]
|
|
136
136
|
}), onStep && /*#__PURE__*/_jsxs(Button, {
|
|
@@ -139,19 +139,22 @@ export function RunBar(t0) {
|
|
|
139
139
|
variant: "ghost",
|
|
140
140
|
"aria-label": "Run one step",
|
|
141
141
|
title: "Run one step",
|
|
142
|
+
className: quietButtonClass,
|
|
142
143
|
disabled: !paused || pending,
|
|
143
144
|
onClick: onStep,
|
|
144
145
|
children: [/*#__PURE__*/_jsx(SkipForwardIcon, {
|
|
146
|
+
weight: "bold",
|
|
145
147
|
"aria-hidden": true
|
|
146
148
|
}), "Step"]
|
|
147
149
|
}), /*#__PURE__*/_jsxs(Button, {
|
|
148
150
|
type: "button",
|
|
149
151
|
size: "xs",
|
|
150
152
|
variant: "ghost",
|
|
151
|
-
className: "text-
|
|
153
|
+
className: "text-faint hover:bg-transparent hover:text-destructive",
|
|
152
154
|
disabled: pending,
|
|
153
155
|
onClick: onStop,
|
|
154
156
|
children: [/*#__PURE__*/_jsx(SquareIcon, {
|
|
157
|
+
weight: "fill",
|
|
155
158
|
"aria-hidden": true,
|
|
156
159
|
className: "size-2.5 fill-current"
|
|
157
160
|
}), "Stop"]
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { RiskLevel } from "../../types.js";
|
|
3
|
+
type PendingLineProps = {
|
|
4
|
+
icon: ReactNode;
|
|
5
|
+
status?: ReactNode;
|
|
6
|
+
tone?: "warn" | "destructive";
|
|
7
|
+
iconClassName?: string;
|
|
8
|
+
wrap?: boolean;
|
|
9
|
+
after?: ReactNode;
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
};
|
|
12
|
+
export declare function PendingLine({ icon, status, tone, iconClassName, wrap, after, children, }: PendingLineProps): import("react").JSX.Element;
|
|
13
|
+
type ApprovalHeadlineProps = {
|
|
14
|
+
name: string;
|
|
15
|
+
risk?: RiskLevel;
|
|
16
|
+
action?: string;
|
|
17
|
+
icon?: ReactNode;
|
|
18
|
+
};
|
|
19
|
+
export declare function ApprovalHeadline({ name, risk, action, icon }: ApprovalHeadlineProps): import("react").JSX.Element;
|
|
20
|
+
type SettledLineProps = {
|
|
21
|
+
name: string;
|
|
22
|
+
verb?: string;
|
|
23
|
+
icon?: ReactNode;
|
|
24
|
+
children: ReactNode;
|
|
25
|
+
};
|
|
26
|
+
export declare function SettledLine({ name, verb, icon, children }: SettledLineProps): import("react").JSX.Element;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { cn } from "@locusgraph/components";
|
|
2
|
+
import { ShieldWarning as ShieldAlertIcon, Wrench as WrenchIcon } from "@phosphor-icons/react/ssr";
|
|
3
|
+
import { lineIconClass, lineObjectClass, lineRowClass } from "../../shared/line.js";
|
|
4
|
+
import { RiskBadge } from "./risk-badge.js";
|
|
5
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
export function PendingLine({
|
|
7
|
+
icon,
|
|
8
|
+
status = "Waiting",
|
|
9
|
+
tone = "warn",
|
|
10
|
+
iconClassName,
|
|
11
|
+
wrap = false,
|
|
12
|
+
after,
|
|
13
|
+
children
|
|
14
|
+
}) {
|
|
15
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
16
|
+
className: cn(lineRowClass, "w-full text-base", wrap && "items-start"),
|
|
17
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
18
|
+
"aria-hidden": true,
|
|
19
|
+
className: cn(lineIconClass, "size-5 [&_svg]:size-4", wrap && "mt-1.5", iconClassName),
|
|
20
|
+
children: icon
|
|
21
|
+
}), /*#__PURE__*/_jsxs("span", {
|
|
22
|
+
className: wrap ? "min-w-0 py-1" : "min-w-0 truncate",
|
|
23
|
+
children: [status && /*#__PURE__*/_jsxs(_Fragment, {
|
|
24
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
25
|
+
className: cn("font-medium", tone === "destructive" ? "text-destructive" : "text-warn"),
|
|
26
|
+
children: status
|
|
27
|
+
}), " "]
|
|
28
|
+
}), children]
|
|
29
|
+
}), after]
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
export function ApprovalHeadline({
|
|
33
|
+
name,
|
|
34
|
+
risk,
|
|
35
|
+
action = "to run",
|
|
36
|
+
icon
|
|
37
|
+
}) {
|
|
38
|
+
const destructive = risk === "destructive";
|
|
39
|
+
const RiskIcon = destructive ? ShieldAlertIcon : WrenchIcon;
|
|
40
|
+
return /*#__PURE__*/_jsxs(PendingLine, {
|
|
41
|
+
icon: icon ?? /*#__PURE__*/_jsx(RiskIcon, {
|
|
42
|
+
weight: "bold",
|
|
43
|
+
"aria-hidden": true
|
|
44
|
+
}),
|
|
45
|
+
iconClassName: destructive ? "text-destructive" : undefined,
|
|
46
|
+
after: risk && /*#__PURE__*/_jsx(RiskBadge, {
|
|
47
|
+
risk: risk,
|
|
48
|
+
className: "mt-1.5 ml-1"
|
|
49
|
+
}),
|
|
50
|
+
wrap: true,
|
|
51
|
+
children: [action, " ", /*#__PURE__*/_jsx("span", {
|
|
52
|
+
className: lineObjectClass,
|
|
53
|
+
children: name
|
|
54
|
+
})]
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
export function SettledLine({
|
|
58
|
+
name,
|
|
59
|
+
verb = "Asked to run",
|
|
60
|
+
icon,
|
|
61
|
+
children
|
|
62
|
+
}) {
|
|
63
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
64
|
+
className: "flex min-w-0 flex-col gap-1",
|
|
65
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
66
|
+
className: lineRowClass,
|
|
67
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
68
|
+
"aria-hidden": true,
|
|
69
|
+
className: lineIconClass,
|
|
70
|
+
children: icon ?? /*#__PURE__*/_jsx(WrenchIcon, {
|
|
71
|
+
weight: "bold",
|
|
72
|
+
"aria-hidden": true
|
|
73
|
+
})
|
|
74
|
+
}), /*#__PURE__*/_jsxs("span", {
|
|
75
|
+
className: "truncate",
|
|
76
|
+
children: [verb, " ", /*#__PURE__*/_jsx("span", {
|
|
77
|
+
className: lineObjectClass,
|
|
78
|
+
children: name
|
|
79
|
+
})]
|
|
80
|
+
})]
|
|
81
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
82
|
+
children: children
|
|
83
|
+
})]
|
|
84
|
+
});
|
|
85
|
+
}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
-
import type { PanelTone } from "../../shared/panel.js";
|
|
3
2
|
import type { RiskLevel } from "../../types.js";
|
|
4
3
|
export declare const riskLabels: Record<RiskLevel, string>;
|
|
5
|
-
export declare const
|
|
6
|
-
export declare
|
|
7
|
-
export declare const riskCopy: Record<RiskLevel, (tool: string) => ReactNode>;
|
|
8
|
-
export declare function RiskBadge({ risk }: {
|
|
4
|
+
export declare const riskCopy: Record<RiskLevel, () => ReactNode>;
|
|
5
|
+
export declare function RiskBadge({ risk, className }: {
|
|
9
6
|
risk: RiskLevel;
|
|
7
|
+
className?: string;
|
|
10
8
|
}): import("react").JSX.Element;
|
|
@@ -1,42 +1,34 @@
|
|
|
1
1
|
import { Badge } from "@locusgraph/components";
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
export const riskLabels = {
|
|
4
|
-
read: "Read
|
|
4
|
+
read: "Read-only",
|
|
5
5
|
write: "Writes data",
|
|
6
6
|
destructive: "Destructive"
|
|
7
7
|
};
|
|
8
|
-
export const riskRing = {
|
|
9
|
-
read: "ring-border",
|
|
10
|
-
write: "ring-border",
|
|
11
|
-
destructive: "ring-destructive/60"
|
|
12
|
-
};
|
|
13
|
-
export const riskTone = {
|
|
14
|
-
read: "idle",
|
|
15
|
-
write: "waiting",
|
|
16
|
-
destructive: "danger"
|
|
17
|
-
};
|
|
18
8
|
export const riskCopy = {
|
|
19
|
-
read:
|
|
20
|
-
write:
|
|
21
|
-
destructive:
|
|
22
|
-
children: [
|
|
9
|
+
read: () => "Only reads data. Nothing changes if you approve.",
|
|
10
|
+
write: () => "Makes a change. Check the inputs before you approve.",
|
|
11
|
+
destructive: () => /*#__PURE__*/_jsxs(_Fragment, {
|
|
12
|
+
children: ["Permanently deletes or overwrites data.", " ", /*#__PURE__*/_jsx("span", {
|
|
23
13
|
className: "font-medium text-destructive",
|
|
24
14
|
children: "This can't be undone."
|
|
25
15
|
})]
|
|
26
16
|
})
|
|
27
17
|
};
|
|
28
18
|
const riskVariant = {
|
|
29
|
-
read: "
|
|
30
|
-
write: "
|
|
31
|
-
destructive: "destructive"
|
|
19
|
+
read: "secondary",
|
|
20
|
+
write: "warning",
|
|
21
|
+
destructive: "destructive-soft"
|
|
32
22
|
};
|
|
33
23
|
export function RiskBadge({
|
|
34
|
-
risk
|
|
24
|
+
risk,
|
|
25
|
+
className
|
|
35
26
|
}) {
|
|
36
27
|
return /*#__PURE__*/_jsx(Badge, {
|
|
37
28
|
"data-slot": "risk-badge",
|
|
38
29
|
"data-risk": risk,
|
|
39
30
|
variant: riskVariant[risk],
|
|
31
|
+
className: className,
|
|
40
32
|
children: riskLabels[risk]
|
|
41
33
|
});
|
|
42
34
|
}
|