@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.
Files changed (119) hide show
  1. package/dist/agent/index.d.ts +1 -1
  2. package/dist/agent/pulse/gradient-label.js +6 -5
  3. package/dist/agent/pulse/marks/bars-mark.js +1 -1
  4. package/dist/agent/pulse/marks/glyph-mark.js +2 -2
  5. package/dist/agent/pulse/marks/locus-mark.js +1 -1
  6. package/dist/agent/pulse/pulse.js +1 -1
  7. package/dist/agent/pulse/use-loop-animation.d.ts +0 -1
  8. package/dist/agent/pulse/use-loop-animation.js +1 -3
  9. package/dist/agent/steps/step-icon.js +20 -13
  10. package/dist/agent/steps/steps.js +39 -37
  11. package/dist/agent/thinking/thinking.js +65 -62
  12. package/dist/agent/tool/json-block.js +10 -7
  13. package/dist/agent/tool/tool-status.d.ts +2 -0
  14. package/dist/agent/tool/tool-status.js +16 -13
  15. package/dist/agent/tool/tool.d.ts +8 -1
  16. package/dist/agent/tool/tool.js +238 -119
  17. package/dist/approval/inbox/inbox-row.d.ts +3 -3
  18. package/dist/approval/inbox/inbox-row.js +135 -200
  19. package/dist/approval/inbox/inbox.d.ts +3 -3
  20. package/dist/approval/inbox/inbox.js +180 -139
  21. package/dist/approval/inbox/virtual-inbox-list.d.ts +3 -3
  22. package/dist/approval/inbox/virtual-inbox-list.js +20 -21
  23. package/dist/approval/memory/memory-review.js +155 -154
  24. package/dist/approval/memory/memory-row.js +86 -87
  25. package/dist/approval/plan/plan-review.js +110 -129
  26. package/dist/approval/plan/plan-step-row.js +7 -6
  27. package/dist/approval/plan/plan-steps.d.ts +1 -1
  28. package/dist/approval/plan/plan-steps.js +2 -2
  29. package/dist/approval/plan/question-choices.js +10 -7
  30. package/dist/approval/plan/question.js +116 -112
  31. package/dist/approval/run/run-bar.js +43 -40
  32. package/dist/approval/shared/approval-line.d.ts +27 -0
  33. package/dist/approval/shared/approval-line.js +85 -0
  34. package/dist/approval/shared/risk-badge.d.ts +3 -5
  35. package/dist/approval/shared/risk-badge.js +11 -19
  36. package/dist/approval/shared/time.d.ts +0 -1
  37. package/dist/approval/shared/time.js +0 -1
  38. package/dist/approval/shared/use-focus-when-settled.d.ts +2 -0
  39. package/dist/approval/shared/use-focus-when-settled.js +18 -0
  40. package/dist/approval/spend/raise-cap-form.d.ts +2 -2
  41. package/dist/approval/spend/raise-cap-form.js +134 -126
  42. package/dist/approval/spend/spend-gate.js +133 -156
  43. package/dist/approval/spend/spend-math.d.ts +1 -0
  44. package/dist/approval/spend/spend-math.js +5 -2
  45. package/dist/approval/spend/spend-meter.js +5 -5
  46. package/dist/approval/tool/approval.js +114 -214
  47. package/dist/approval/tool/args/args-editor.js +147 -156
  48. package/dist/approval/tool/args/args-field.js +197 -109
  49. package/dist/approval/tool/deny-form.js +59 -66
  50. package/dist/approval/tool/tool-inputs.js +38 -45
  51. package/dist/chat/chat/chat.js +5 -4
  52. package/dist/chat/chat/use-stick-to-bottom.js +1 -3
  53. package/dist/chat/composer/composer-actions.js +4 -1
  54. package/dist/chat/composer/composer.js +4 -3
  55. package/dist/chat/composer/use-auto-grow.js +14 -10
  56. package/dist/chat/files/files.js +12 -10
  57. package/dist/chat/reply/fenced-code.js +1 -1
  58. package/dist/chat/reply/markdown-components.js +9 -116
  59. package/dist/chat/reply/reply.js +2 -2
  60. package/dist/chat/turn/group-parts.d.ts +1 -0
  61. package/dist/chat/turn/group-parts.js +6 -3
  62. package/dist/chat/turn/turn.js +13 -4
  63. package/dist/cost/context.js +3 -3
  64. package/dist/cost/cost-steps.js +31 -30
  65. package/dist/cost/cost.js +39 -39
  66. package/dist/cost/model-picker.js +5 -4
  67. package/dist/cost/shared/context-breakdown.js +10 -11
  68. package/dist/cost/shared/model-option-row.js +4 -3
  69. package/dist/cost/shared/step-cost-row.js +11 -12
  70. package/dist/cost/shared/usage-totals.d.ts +1 -0
  71. package/dist/cost/shared/usage-totals.js +19 -1
  72. package/dist/memory/cite.js +55 -47
  73. package/dist/memory/memorized.js +123 -108
  74. package/dist/memory/recall.js +136 -146
  75. package/dist/memory/shared/host-label.d.ts +1 -1
  76. package/dist/memory/shared/host-label.js +2 -2
  77. package/dist/memory/shared/source-mark.js +1 -1
  78. package/dist/memory/sources.d.ts +2 -1
  79. package/dist/memory/sources.js +135 -100
  80. package/dist/shared/decision-summary.js +2 -1
  81. package/dist/shared/line.d.ts +10 -0
  82. package/dist/shared/line.js +11 -0
  83. package/dist/shared/live-status.d.ts +3 -0
  84. package/dist/shared/live-status.js +11 -0
  85. package/dist/shared/reduced-motion.d.ts +1 -0
  86. package/dist/shared/reduced-motion.js +3 -0
  87. package/dist/thread/actions/action-button.js +1 -1
  88. package/dist/thread/actions/actions.d.ts +3 -1
  89. package/dist/thread/actions/actions.js +100 -81
  90. package/dist/thread/actions/branch-switcher.js +67 -37
  91. package/dist/thread/canvas/canvas-meta.d.ts +9 -0
  92. package/dist/thread/canvas/canvas-meta.js +35 -0
  93. package/dist/thread/canvas/canvas.d.ts +1 -1
  94. package/dist/thread/canvas/canvas.js +64 -74
  95. package/dist/thread/canvas/version-switcher.d.ts +1 -0
  96. package/dist/thread/canvas/version-switcher.js +106 -87
  97. package/dist/thread/code/code.js +4 -6
  98. package/dist/thread/code/copy-code-button.d.ts +2 -1
  99. package/dist/thread/code/copy-code-button.js +56 -25
  100. package/dist/thread/history/history.d.ts +1 -1
  101. package/dist/thread/history/history.js +104 -104
  102. package/dist/thread/history/row/history-row.js +8 -5
  103. package/dist/thread/history/row/thread-item-menu.js +13 -4
  104. package/dist/thread/history/row/thread-title-editor.js +1 -1
  105. package/dist/thread/history/virtual-history-list.js +1 -2
  106. package/dist/thread/index.d.ts +1 -0
  107. package/dist/thread/index.js +1 -0
  108. package/dist/thread/starters/starters.js +5 -4
  109. package/package.json +6 -6
  110. package/dist/agent/shared/status-dot.d.ts +0 -1
  111. package/dist/agent/shared/status-dot.js +0 -1
  112. package/dist/approval/shared/decision-line.d.ts +0 -1
  113. package/dist/approval/shared/decision-line.js +0 -1
  114. package/dist/memory/shared/disclosure.d.ts +0 -6
  115. package/dist/memory/shared/disclosure.js +0 -6
  116. package/dist/shared/panel.d.ts +0 -19
  117. package/dist/shared/panel.js +0 -77
  118. package/dist/shared/status-dot.d.ts +0 -6
  119. 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 { ArrowRight as ArrowRightIcon, Help as MessageCircleQuestionIcon } from "@carbon/icons-react";
5
- import { Button, Input, Textarea } from "@locusgraph/components";
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 { ApprovalPanel, LiveStatus, PanelBody, PanelFooter, PanelHeader, PanelTitle } from "../../shared/panel.js";
8
- import { DecisionSummary } from "../shared/decision-line.js";
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(42);
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
- const t7 = answer ? true : undefined;
74
- let t8;
78
+ let t7;
75
79
  if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
76
- t8 = /*#__PURE__*/_jsx(MessageCircleQuestionIcon, {
80
+ t7 = /*#__PURE__*/_jsx(MessageCircleQuestionIcon, {
81
+ weight: "bold",
77
82
  "aria-hidden": true
78
83
  });
79
- $[5] = t8;
84
+ $[5] = t7;
80
85
  } else {
81
- t8 = $[5];
86
+ t7 = $[5];
82
87
  }
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,
89
- eyebrow: "Agent question",
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] = t11;
96
+ $[8] = t10;
96
97
  } else {
97
- t11 = $[8];
98
+ t10 = $[8];
98
99
  }
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,
104
- children: question
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("form", {
125
- onSubmit: event => {
126
- event.preventDefault();
127
- if (!canSubmit) {
128
- return;
129
- }
130
- onAnswer({
131
- optionId,
132
- text: trimmed === "" ? undefined : trimmed
133
- });
134
- },
135
- children: [/*#__PURE__*/_jsxs(PanelBody, {
136
- className: "gap-3",
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
- }), /*#__PURE__*/_jsxs(PanelFooter, {
161
- className: "justify-between",
162
- children: [/*#__PURE__*/_jsx("span", {
163
- className: "hidden font-mono text-[11px] text-muted-foreground sm:inline",
164
- children: textOnly ? "The run is paused" : `Press 1–${options.length} to pick`
165
- }), /*#__PURE__*/_jsxs(Button, {
166
- type: "submit",
167
- size: "sm",
168
- disabled: !canSubmit,
169
- children: [submitLabel, /*#__PURE__*/_jsx(ArrowRightIcon, {
170
- "aria-hidden": true
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
- $[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;
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
- t14 = $[28];
194
+ t11 = $[25];
194
195
  }
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;
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
- t15 = $[32];
204
+ t12 = $[29];
204
205
  }
205
- let t16;
206
- if ($[33] !== t15) {
207
- t16 = /*#__PURE__*/_jsx(LiveStatus, {
208
- message: t15
206
+ let t13;
207
+ if ($[30] !== t12) {
208
+ t13 = /*#__PURE__*/_jsx(LiveStatus, {
209
+ message: t12
209
210
  });
210
- $[33] = t15;
211
- $[34] = t16;
211
+ $[30] = t12;
212
+ $[31] = t13;
212
213
  } else {
213
- t16 = $[34];
214
+ t13 = $[31];
214
215
  }
215
- let t17;
216
- if ($[35] !== className || $[36] !== t11 || $[37] !== t13 || $[38] !== t14 || $[39] !== t16 || $[40] !== t7) {
217
- t17 = /*#__PURE__*/_jsxs(ApprovalPanel, {
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
- "data-answered": t7,
220
- className: className,
221
- children: [t11, t13, t14, t16]
222
+ "aria-label": question,
223
+ "data-answered": t8,
224
+ className: t10,
225
+ children: [t11, t13]
222
226
  });
223
- $[35] = className;
224
- $[36] = t11;
225
- $[37] = t13;
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
- t17 = $[41];
235
+ t14 = $[38];
232
236
  }
233
- return t17;
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 { StatusDot } from "../../shared/status-dot.js";
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: "running",
16
- paused: "waiting",
17
- stopped: "danger",
18
- done: "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-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);
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
- const t4 = statusTone[status];
57
- let t5;
58
- if ($[2] !== t4) {
59
- t5 = /*#__PURE__*/_jsx(StatusDot, {
60
- tone: t4,
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] = t4;
64
- $[3] = t5;
62
+ $[2] = runName;
63
+ $[3] = t4;
65
64
  } else {
66
- t5 = $[3];
65
+ t4 = $[3];
67
66
  }
67
+ const t5 = statusTone[status];
68
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;
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: "locus-eyebrow shrink-0",
82
+ className: t6,
86
83
  children: t7
87
84
  });
88
- $[6] = t7;
89
- $[7] = t8;
85
+ $[6] = t6;
86
+ $[7] = t7;
87
+ $[8] = t8;
90
88
  } else {
91
- t8 = $[7];
89
+ t8 = $[8];
92
90
  }
93
91
  let t9;
94
- if ($[8] !== elapsedMs) {
92
+ if ($[9] !== elapsedMs) {
95
93
  t9 = elapsedMs !== undefined && /*#__PURE__*/_jsxs("span", {
96
- className: "shrink-0 font-mono text-xs text-muted-foreground tabular-nums",
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
- $[8] = elapsedMs;
103
- $[9] = t9;
100
+ $[9] = elapsedMs;
101
+ $[10] = t9;
104
102
  } else {
105
- t9 = $[9];
103
+ t9 = $[10];
106
104
  }
107
105
  let t10;
108
- if ($[10] !== t5 || $[11] !== t6 || $[12] !== t8 || $[13] !== t9) {
106
+ if ($[11] !== t4 || $[12] !== t8 || $[13] !== t9) {
109
107
  t10 = /*#__PURE__*/_jsxs("span", {
110
- className: "flex min-w-0 flex-1 items-center gap-2.5 text-sm",
111
- children: [t5, t6, t8, t9]
108
+ className: "flex min-w-0 flex-auto items-center gap-2.5 text-sm",
109
+ children: [t4, t8, t9]
112
110
  });
113
- $[10] = t5;
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: "ml-auto flex shrink-0 items-center gap-1",
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" : "outline",
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-muted-foreground hover:bg-destructive/10 hover:text-destructive dark:hover:bg-destructive/15",
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 riskRing: Record<RiskLevel, string>;
6
- export declare const riskTone: Record<RiskLevel, PanelTone>;
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 only",
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: tool => `${tool} only reads data. Nothing changes if you approve.`,
20
- write: tool => `${tool} wants to make a change. Check the inputs before you approve.`,
21
- destructive: tool => /*#__PURE__*/_jsxs(_Fragment, {
22
- children: [tool, " will permanently delete or overwrite data.", " ", /*#__PURE__*/_jsx("span", {
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: "outline",
30
- write: "secondary",
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
  }
@@ -1,3 +1,2 @@
1
1
  import type { DecidedAt } from "../types.js";
2
- export { formatDecidedAt, isoOf, toDate } from "../../shared/decision-summary.js";
3
2
  export declare function formatWaiting(since: DecidedAt, now: number): string;
@@ -1,5 +1,4 @@
1
1
  import { toDate } from "../../shared/decision-summary.js";
2
- export { formatDecidedAt, isoOf, toDate } from "../../shared/decision-summary.js";
3
2
  const minuteMs = 60_000;
4
3
  const hourMs = 60 * minuteMs;
5
4
  const dayMs = 24 * hourMs;