@locusgraph/loop 0.0.0-stage → 0.1.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 (202) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +35 -2
  3. package/dist/agent/index.d.ts +5 -0
  4. package/dist/agent/index.js +5 -0
  5. package/dist/agent/pulse/gradient-label.d.ts +7 -0
  6. package/dist/agent/pulse/gradient-label.js +23 -0
  7. package/dist/agent/pulse/marks/bars-mark.d.ts +1 -0
  8. package/dist/agent/pulse/marks/bars-mark.js +15 -0
  9. package/dist/agent/pulse/marks/glyph-mark.d.ts +4 -0
  10. package/dist/agent/pulse/marks/glyph-mark.js +17 -0
  11. package/dist/agent/pulse/marks/locus-mark.d.ts +1 -0
  12. package/dist/agent/pulse/marks/locus-mark.js +38 -0
  13. package/dist/agent/pulse/marks/orb-mark.d.ts +1 -0
  14. package/dist/agent/pulse/marks/orb-mark.js +11 -0
  15. package/dist/agent/pulse/marks/spinner-mark.d.ts +1 -0
  16. package/dist/agent/pulse/marks/spinner-mark.js +4 -0
  17. package/dist/agent/pulse/pulse-tone.d.ts +1 -0
  18. package/dist/agent/pulse/pulse-tone.js +1 -0
  19. package/dist/agent/pulse/pulse.d.ts +12 -0
  20. package/dist/agent/pulse/pulse.js +51 -0
  21. package/dist/agent/pulse/use-loop-animation.d.ts +2 -0
  22. package/dist/agent/pulse/use-loop-animation.js +21 -0
  23. package/dist/agent/shared/status-dot.d.ts +1 -0
  24. package/dist/agent/shared/status-dot.js +1 -0
  25. package/dist/agent/steps/step-icon.d.ts +8 -0
  26. package/dist/agent/steps/step-icon.js +31 -0
  27. package/dist/agent/steps/steps.d.ts +7 -0
  28. package/dist/agent/steps/steps.js +39 -0
  29. package/dist/agent/thinking/thinking.d.ts +6 -0
  30. package/dist/agent/thinking/thinking.js +31 -0
  31. package/dist/agent/thinking/thought-duration.d.ts +2 -0
  32. package/dist/agent/thinking/thought-duration.js +13 -0
  33. package/dist/agent/tool/json-block.d.ts +5 -0
  34. package/dist/agent/tool/json-block.js +15 -0
  35. package/dist/agent/tool/tool-status.d.ts +6 -0
  36. package/dist/agent/tool/tool-status.js +26 -0
  37. package/dist/agent/tool/tool.d.ts +7 -0
  38. package/dist/agent/tool/tool.js +14 -0
  39. package/dist/approval/inbox/inbox-row.d.ts +11 -0
  40. package/dist/approval/inbox/inbox-row.js +14 -0
  41. package/dist/approval/inbox/inbox-selection.d.ts +6 -0
  42. package/dist/approval/inbox/inbox-selection.js +21 -0
  43. package/dist/approval/inbox/inbox.d.ts +11 -0
  44. package/dist/approval/inbox/inbox.js +26 -0
  45. package/dist/approval/index.d.ts +9 -0
  46. package/dist/approval/index.js +8 -0
  47. package/dist/approval/memory/memory-choices.d.ts +10 -0
  48. package/dist/approval/memory/memory-choices.js +30 -0
  49. package/dist/approval/memory/memory-review.d.ts +11 -0
  50. package/dist/approval/memory/memory-review.js +31 -0
  51. package/dist/approval/memory/memory-row.d.ts +9 -0
  52. package/dist/approval/memory/memory-row.js +30 -0
  53. package/dist/approval/plan/plan-review.d.ts +13 -0
  54. package/dist/approval/plan/plan-review.js +38 -0
  55. package/dist/approval/plan/plan-step-row.d.ts +13 -0
  56. package/dist/approval/plan/plan-step-row.js +50 -0
  57. package/dist/approval/plan/plan-steps.d.ts +8 -0
  58. package/dist/approval/plan/plan-steps.js +29 -0
  59. package/dist/approval/plan/question-choices.d.ts +10 -0
  60. package/dist/approval/plan/question-choices.js +47 -0
  61. package/dist/approval/plan/question.d.ts +18 -0
  62. package/dist/approval/plan/question.js +35 -0
  63. package/dist/approval/run/run-bar.d.ts +13 -0
  64. package/dist/approval/run/run-bar.js +33 -0
  65. package/dist/approval/shared/decision-line.d.ts +1 -0
  66. package/dist/approval/shared/decision-line.js +1 -0
  67. package/dist/approval/shared/risk-badge.d.ts +10 -0
  68. package/dist/approval/shared/risk-badge.js +26 -0
  69. package/dist/approval/shared/time.d.ts +3 -0
  70. package/dist/approval/shared/time.js +15 -0
  71. package/dist/approval/shared/use-focus-on-mount.d.ts +2 -0
  72. package/dist/approval/shared/use-focus-on-mount.js +9 -0
  73. package/dist/approval/spend/raise-cap-form.d.ts +8 -0
  74. package/dist/approval/spend/raise-cap-form.js +26 -0
  75. package/dist/approval/spend/spend-gate.d.ts +16 -0
  76. package/dist/approval/spend/spend-gate.js +32 -0
  77. package/dist/approval/spend/spend-math.d.ts +5 -0
  78. package/dist/approval/spend/spend-math.js +18 -0
  79. package/dist/approval/spend/spend-meter.d.ts +10 -0
  80. package/dist/approval/spend/spend-meter.js +49 -0
  81. package/dist/approval/tool/approval.d.ts +14 -0
  82. package/dist/approval/tool/approval.js +45 -0
  83. package/dist/approval/tool/args/args-editor.d.ts +16 -0
  84. package/dist/approval/tool/args/args-editor.js +37 -0
  85. package/dist/approval/tool/args/args-field.d.ts +11 -0
  86. package/dist/approval/tool/args/args-field.js +28 -0
  87. package/dist/approval/tool/args/args-validation.d.ts +8 -0
  88. package/dist/approval/tool/args/args-validation.js +59 -0
  89. package/dist/approval/tool/deny-form.d.ts +6 -0
  90. package/dist/approval/tool/deny-form.js +15 -0
  91. package/dist/approval/tool/tool-inputs.d.ts +6 -0
  92. package/dist/approval/tool/tool-inputs.js +53 -0
  93. package/dist/approval/types.d.ts +59 -0
  94. package/dist/approval/types.js +1 -0
  95. package/dist/chat/chat/chat.d.ts +7 -0
  96. package/dist/chat/chat/chat.js +11 -0
  97. package/dist/chat/chat/use-stick-to-bottom.d.ts +7 -0
  98. package/dist/chat/chat/use-stick-to-bottom.js +57 -0
  99. package/dist/chat/composer/composer-actions.d.ts +15 -0
  100. package/dist/chat/composer/composer-actions.js +23 -0
  101. package/dist/chat/composer/composer.d.ts +20 -0
  102. package/dist/chat/composer/composer.js +42 -0
  103. package/dist/chat/composer/use-auto-grow.d.ts +2 -0
  104. package/dist/chat/composer/use-auto-grow.js +14 -0
  105. package/dist/chat/files/file-meta.d.ts +13 -0
  106. package/dist/chat/files/file-meta.js +30 -0
  107. package/dist/chat/files/files.d.ts +9 -0
  108. package/dist/chat/files/files.js +39 -0
  109. package/dist/chat/index.d.ts +7 -0
  110. package/dist/chat/index.js +7 -0
  111. package/dist/chat/reply/fenced-code.d.ts +8 -0
  112. package/dist/chat/reply/fenced-code.js +29 -0
  113. package/dist/chat/reply/markdown-components.d.ts +2 -0
  114. package/dist/chat/reply/markdown-components.js +22 -0
  115. package/dist/chat/reply/reply.d.ts +8 -0
  116. package/dist/chat/reply/reply.js +21 -0
  117. package/dist/chat/turn/group-parts.d.ts +24 -0
  118. package/dist/chat/turn/group-parts.js +35 -0
  119. package/dist/chat/turn/turn.d.ts +11 -0
  120. package/dist/chat/turn/turn.js +45 -0
  121. package/dist/cost/context.d.ts +13 -0
  122. package/dist/cost/context.js +35 -0
  123. package/dist/cost/cost-steps.d.ts +17 -0
  124. package/dist/cost/cost-steps.js +24 -0
  125. package/dist/cost/cost.d.ts +8 -0
  126. package/dist/cost/cost.js +37 -0
  127. package/dist/cost/index.d.ts +4 -0
  128. package/dist/cost/index.js +4 -0
  129. package/dist/cost/model-picker.d.ts +11 -0
  130. package/dist/cost/model-picker.js +9 -0
  131. package/dist/cost/shared/context-breakdown.d.ts +15 -0
  132. package/dist/cost/shared/context-breakdown.js +17 -0
  133. package/dist/cost/shared/meter-marks.d.ts +9 -0
  134. package/dist/cost/shared/meter-marks.js +16 -0
  135. package/dist/cost/shared/model-option-row.d.ts +14 -0
  136. package/dist/cost/shared/model-option-row.js +32 -0
  137. package/dist/cost/shared/step-cost-row.d.ts +15 -0
  138. package/dist/cost/shared/step-cost-row.js +34 -0
  139. package/dist/cost/shared/usage-totals.d.ts +11 -0
  140. package/dist/cost/shared/usage-totals.js +26 -0
  141. package/dist/index.d.ts +7 -0
  142. package/dist/index.js +7 -0
  143. package/dist/memory/cite.d.ts +8 -0
  144. package/dist/memory/cite.js +19 -0
  145. package/dist/memory/index.d.ts +5 -0
  146. package/dist/memory/index.js +4 -0
  147. package/dist/memory/memorized.d.ts +14 -0
  148. package/dist/memory/memorized.js +19 -0
  149. package/dist/memory/recall.d.ts +9 -0
  150. package/dist/memory/recall.js +24 -0
  151. package/dist/memory/shared/disclosure.d.ts +6 -0
  152. package/dist/memory/shared/disclosure.js +6 -0
  153. package/dist/memory/shared/host-label.d.ts +6 -0
  154. package/dist/memory/shared/host-label.js +34 -0
  155. package/dist/memory/shared/source-mark.d.ts +5 -0
  156. package/dist/memory/shared/source-mark.js +6 -0
  157. package/dist/memory/sources.d.ts +9 -0
  158. package/dist/memory/sources.js +22 -0
  159. package/dist/shared/decision-summary.d.ts +18 -0
  160. package/dist/shared/decision-summary.js +25 -0
  161. package/dist/shared/panel-empty.d.ts +8 -0
  162. package/dist/shared/panel-empty.js +5 -0
  163. package/dist/shared/panel.d.ts +19 -0
  164. package/dist/shared/panel.js +21 -0
  165. package/dist/shared/status-dot.d.ts +6 -0
  166. package/dist/shared/status-dot.js +12 -0
  167. package/dist/sources.css +1 -0
  168. package/dist/thread/actions/action-button.d.ts +8 -0
  169. package/dist/thread/actions/action-button.js +5 -0
  170. package/dist/thread/actions/actions.d.ts +13 -0
  171. package/dist/thread/actions/actions.js +21 -0
  172. package/dist/thread/actions/branch-switcher.d.ts +10 -0
  173. package/dist/thread/actions/branch-switcher.js +7 -0
  174. package/dist/thread/canvas/canvas.d.ts +14 -0
  175. package/dist/thread/canvas/canvas.js +12 -0
  176. package/dist/thread/canvas/version-switcher.d.ts +12 -0
  177. package/dist/thread/canvas/version-switcher.js +11 -0
  178. package/dist/thread/code/code.d.ts +10 -0
  179. package/dist/thread/code/code.js +33 -0
  180. package/dist/thread/code/copy-code-button.d.ts +6 -0
  181. package/dist/thread/code/copy-code-button.js +18 -0
  182. package/dist/thread/code/highlight.d.ts +1 -0
  183. package/dist/thread/code/highlight.js +39 -0
  184. package/dist/thread/history/history-row.d.ts +14 -0
  185. package/dist/thread/history/history-row.js +17 -0
  186. package/dist/thread/history/history.d.ts +15 -0
  187. package/dist/thread/history/history.js +10 -0
  188. package/dist/thread/history/thread-groups.d.ts +8 -0
  189. package/dist/thread/history/thread-groups.js +46 -0
  190. package/dist/thread/history/thread-item-menu.d.ts +7 -0
  191. package/dist/thread/history/thread-item-menu.js +6 -0
  192. package/dist/thread/history/thread-title-editor.d.ts +7 -0
  193. package/dist/thread/history/thread-title-editor.js +25 -0
  194. package/dist/thread/index.d.ts +8 -0
  195. package/dist/thread/index.js +5 -0
  196. package/dist/thread/starters/starters.d.ts +12 -0
  197. package/dist/thread/starters/starters.js +15 -0
  198. package/dist/thread/use-copied.d.ts +5 -0
  199. package/dist/thread/use-copied.js +22 -0
  200. package/dist/types.d.ts +70 -0
  201. package/dist/types.js +3 -0
  202. package/package.json +57 -3
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 LocusGraph
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,36 @@
1
- # Temporary Holding Version
1
+ # @locusgraph/loop
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Loop is the agent kit for LocusGraph apps: chat, what the agent is doing, human-in-the-loop approvals, memory and cost. Components take data and callbacks only and never call a model. Message shapes follow the Vercel AI SDK `UIMessage` parts, so `useChat()` output can be passed straight in.
4
+
5
+ ```bash
6
+ pnpm add @locusgraph/loop @locusgraph/components
7
+ ```
8
+
9
+ ```css
10
+ @import "@locusgraph/components/theme.css";
11
+ @import "@locusgraph/loop/sources.css";
12
+ ```
13
+
14
+ ```tsx
15
+ import { Chat, Composer, Turn } from "@locusgraph/loop";
16
+
17
+ <Chat>
18
+ {messages.map((message) => (
19
+ <Turn key={message.id} message={message} />
20
+ ))}
21
+ </Chat>
22
+ <Composer status={status} onSubmit={(text) => sendMessage({ text })} onStop={stop} />
23
+ ```
24
+
25
+ | Group | Components |
26
+ |---|---|
27
+ | Chat | `Chat`, `Turn`, `Reply`, `Composer`, `Files` |
28
+ | Thread | `Starters`, `Actions`, `History`, `Code`, `Canvas` |
29
+ | Agent | `Thinking`, `Steps`, `Tool`, `Pulse` |
30
+ | Human in the loop | `Approval`, `ArgsEditor`, `PlanReview`, `Question`, `SpendGate`, `MemoryReview`, `RunBar`, `Inbox` |
31
+ | Memory | `Cite`, `Sources`, `Recall`, `Memorized` |
32
+ | Cost | `Context`, `Cost`, `CostSteps`, `ModelPicker` |
33
+
34
+ `Turn` renders reasoning, tool and source parts with `Thinking`, `Tool` and `Sources`; pass `renderReasoning`, `renderTool` or `renderSources` to replace them. A tool part in the `approval-requested` state is where `Approval` goes: wire its `onApprove` and `onDeny` to the AI SDK's tool approval response.
35
+
36
+ Approvals follow one rule: tools that only read run without asking; tools that write, pay, send or delete pause and show exactly what is being approved, with stronger warnings for destructive ones. Money is integer micro-USD, formatted with `@locusgraph/utils`.
@@ -0,0 +1,5 @@
1
+ export * from "./pulse/pulse.js";
2
+ export * from "./steps/steps.js";
3
+ export * from "./thinking/thinking.js";
4
+ export { Tool, type ToolProps } from "./tool/tool.js";
5
+ export { toolStateLabels } from "./tool/tool-status.js";
@@ -0,0 +1,5 @@
1
+ export * from "./pulse/pulse.js";
2
+ export * from "./steps/steps.js";
3
+ export * from "./thinking/thinking.js";
4
+ export { Tool } from "./tool/tool.js";
5
+ export { toolStateLabels } from "./tool/tool-status.js";
@@ -0,0 +1,7 @@
1
+ import type { PulseTone } from "./pulse-tone.js";
2
+ type GradientLabelProps = {
3
+ label: string;
4
+ tone?: PulseTone;
5
+ };
6
+ export declare function GradientLabel({ label, tone }: GradientLabelProps): import("react").JSX.Element;
7
+ export {};
@@ -0,0 +1,23 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { AiGenerate as SparkleIcon } from "@carbon/icons-react";
3
+ import { cn } from "@locusgraph/components";
4
+ import { useLoopAnimation } from "./use-loop-animation.js";
5
+ const drift = [{ backgroundPosition: "0% 50%" }, { backgroundPosition: "200% 50%" }];
6
+ const turn = [
7
+ { transform: "rotate(0deg) scale(1)" },
8
+ { transform: "rotate(180deg) scale(0.8)" },
9
+ { transform: "rotate(360deg) scale(1)" },
10
+ ];
11
+ const toneIcon = {
12
+ neutral: "fill-foreground/70 text-foreground/70",
13
+ brand: "fill-violet-500 text-violet-500",
14
+ };
15
+ const toneText = {
16
+ neutral: "bg-[linear-gradient(90deg,var(--color-muted-foreground),var(--color-foreground),var(--color-muted-foreground))]",
17
+ brand: "bg-[linear-gradient(90deg,var(--color-sky-500),var(--color-violet-500),var(--color-pink-500),var(--color-sky-500))]",
18
+ };
19
+ export function GradientLabel({ label, tone = "neutral" }) {
20
+ const text = useLoopAnimation(drift, 2600, 0, "linear");
21
+ const icon = useLoopAnimation(turn, 2600);
22
+ return (_jsxs("span", { className: "inline-flex items-center gap-1.5", children: [_jsx(SparkleIcon, { ref: icon, "aria-hidden": true, className: cn("size-[1.05em]", toneIcon[tone]) }), _jsx("span", { ref: text, "data-slot": "pulse-gradient", className: cn("bg-[length:200%_100%] bg-clip-text font-medium text-transparent", toneText[tone]), children: label })] }));
23
+ }
@@ -0,0 +1 @@
1
+ export declare function BarsMark(): import("react").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useLoopAnimation } from "../use-loop-animation.js";
3
+ const bounce = [
4
+ { transform: "scaleY(0.35)" },
5
+ { transform: "scaleY(1)" },
6
+ { transform: "scaleY(0.35)" },
7
+ ];
8
+ const barDelays = [0, 140, 280, 420];
9
+ function Bar({ delay }) {
10
+ const ref = useLoopAnimation(bounce, 900, delay);
11
+ return (_jsx("span", { ref: ref, className: "h-full w-[0.16em] origin-center scale-y-[0.35] rounded-full bg-current" }));
12
+ }
13
+ export function BarsMark() {
14
+ return (_jsx("span", { "aria-hidden": true, "data-slot": "pulse-bars", className: "inline-flex h-[1em] items-center gap-[0.14em] text-foreground/70", children: barDelays.map((delay) => (_jsx(Bar, { delay: delay }, delay))) }));
15
+ }
@@ -0,0 +1,4 @@
1
+ import type { PulseTone } from "../pulse-tone.js";
2
+ export declare function GlyphMark({ tone }: {
3
+ tone?: PulseTone;
4
+ }): import("react").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from "@locusgraph/components";
3
+ import { useEffect, useState } from "react";
4
+ import { prefersReducedMotion } from "../use-loop-animation.js";
5
+ const glyphs = ["·", "✢", "✳", "✶", "✻", "✽", "✻", "✶", "✳", "✢"];
6
+ const restingGlyph = "✻";
7
+ export function GlyphMark({ tone = "neutral" }) {
8
+ const [index, setIndex] = useState();
9
+ useEffect(() => {
10
+ if (prefersReducedMotion())
11
+ return;
12
+ setIndex(0);
13
+ const timer = window.setInterval(() => setIndex((current) => ((current ?? 0) + 1) % glyphs.length), 120);
14
+ return () => window.clearInterval(timer);
15
+ }, []);
16
+ return (_jsx("span", { "aria-hidden": true, "data-slot": "pulse-glyph", className: cn("inline-flex w-[1.1em] justify-center font-mono text-[1.15em] leading-none", tone === "brand" ? "text-orange-500" : "text-foreground/70"), children: index === undefined ? restingGlyph : glyphs[index] }));
17
+ }
@@ -0,0 +1 @@
1
+ export declare function LocusMark(): import("react").JSX.Element;
@@ -0,0 +1,38 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { LocusGraphMark } from "@locusgraph/brand";
3
+ import { useEffect, useRef } from "react";
4
+ import { prefersReducedMotion } from "../use-loop-animation.js";
5
+ const sweepMs = 1800;
6
+ const markCenter = { x: 14.5, y: 13 };
7
+ const rayGlow = [{ opacity: 0.3 }, { opacity: 1, offset: 0.12 }, { opacity: 0.3 }];
8
+ function sweepDelay(path) {
9
+ const box = path.getBBox();
10
+ const angle = Math.atan2(box.y + box.height / 2 - markCenter.y, box.x + box.width / 2 - markCenter.x);
11
+ const turn = (angle + Math.PI) / (2 * Math.PI);
12
+ return -(1 - turn) * sweepMs;
13
+ }
14
+ function animateRays(svg) {
15
+ const rays = [...svg.querySelectorAll("path")];
16
+ if (rays.length === 0 || typeof rays[0]?.getBBox !== "function")
17
+ return [];
18
+ return rays.map((ray) => ray.animate(rayGlow, {
19
+ duration: sweepMs,
20
+ delay: sweepDelay(ray),
21
+ easing: "linear",
22
+ iterations: Number.POSITIVE_INFINITY,
23
+ }));
24
+ }
25
+ export function LocusMark() {
26
+ const ref = useRef(null);
27
+ useEffect(() => {
28
+ const svg = ref.current;
29
+ if (!svg || prefersReducedMotion())
30
+ return;
31
+ const animations = animateRays(svg);
32
+ return () => {
33
+ for (const animation of animations)
34
+ animation.cancel();
35
+ };
36
+ }, []);
37
+ return (_jsx(LocusGraphMark, { ref: ref, "data-slot": "pulse-locus", className: "h-[1.35em] w-auto text-foreground" }));
38
+ }
@@ -0,0 +1 @@
1
+ export declare function OrbMark(): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useLoopAnimation } from "../use-loop-animation.js";
3
+ const breathe = [
4
+ { transform: "scale(1)", opacity: 1 },
5
+ { transform: "scale(0.62)", opacity: 0.55 },
6
+ { transform: "scale(1)", opacity: 1 },
7
+ ];
8
+ export function OrbMark() {
9
+ const ref = useLoopAnimation(breathe, 1500);
10
+ return (_jsx("span", { "aria-hidden": true, className: "inline-flex size-[1.25em] items-center justify-center", children: _jsx("span", { ref: ref, "data-slot": "pulse-orb", className: "size-[0.8em] rounded-full bg-foreground" }) }));
11
+ }
@@ -0,0 +1 @@
1
+ export declare function SpinnerMark(): import("react").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export function SpinnerMark() {
3
+ return (_jsxs("svg", { "aria-hidden": true, "data-slot": "pulse-spinner", viewBox: "0 0 16 16", className: "size-[1.1em] motion-safe:animate-spin", fill: "none", children: [_jsx("circle", { cx: "8", cy: "8", r: "6.5", stroke: "currentColor", strokeOpacity: "0.18", strokeWidth: "1.5" }), _jsx("path", { d: "M8 1.5a6.5 6.5 0 0 1 6.5 6.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })] }));
4
+ }
@@ -0,0 +1 @@
1
+ export type PulseTone = "neutral" | "brand";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,12 @@
1
+ import type { PulseTone } from "./pulse-tone.js";
2
+ export type { PulseTone };
3
+ export type PulseVariant = "dots" | "shimmer" | "glyph" | "orb" | "gradient" | "bars" | "spinner" | "locus";
4
+ export declare const pulseVariants: PulseVariant[];
5
+ export type PulseProps = {
6
+ variant?: PulseVariant;
7
+ label?: string;
8
+ showLabel?: boolean;
9
+ tone?: PulseTone;
10
+ className?: string;
11
+ };
12
+ export declare function Pulse({ variant, label, showLabel, tone, className, }: PulseProps): import("react").JSX.Element;
@@ -0,0 +1,51 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn } from "@locusgraph/components";
3
+ import { GradientLabel } from "./gradient-label.js";
4
+ import { BarsMark } from "./marks/bars-mark.js";
5
+ import { GlyphMark } from "./marks/glyph-mark.js";
6
+ import { LocusMark } from "./marks/locus-mark.js";
7
+ import { OrbMark } from "./marks/orb-mark.js";
8
+ import { SpinnerMark } from "./marks/spinner-mark.js";
9
+ export const pulseVariants = [
10
+ "dots",
11
+ "shimmer",
12
+ "glyph",
13
+ "orb",
14
+ "gradient",
15
+ "bars",
16
+ "spinner",
17
+ "locus",
18
+ ];
19
+ const dotDelays = ["[animation-delay:0ms]", "[animation-delay:200ms]", "[animation-delay:400ms]"];
20
+ function TypingDots() {
21
+ return (_jsx("span", { "aria-hidden": true, className: "flex h-5 items-center gap-1", children: dotDelays.map((delay) => (_jsx("span", { className: cn("size-1.5 rounded-full bg-muted-foreground/70 motion-safe:animate-pulse", delay) }, delay))) }));
22
+ }
23
+ const marks = {
24
+ dots: TypingDots,
25
+ glyph: GlyphMark,
26
+ orb: OrbMark,
27
+ bars: BarsMark,
28
+ spinner: SpinnerMark,
29
+ locus: LocusMark,
30
+ };
31
+ const labelShownByDefault = {
32
+ dots: false,
33
+ shimmer: true,
34
+ glyph: true,
35
+ orb: false,
36
+ gradient: true,
37
+ bars: false,
38
+ spinner: true,
39
+ locus: true,
40
+ };
41
+ function VisibleLabel({ variant, label, tone }) {
42
+ if (variant === "gradient")
43
+ return _jsx(GradientLabel, { label: label, tone: tone });
44
+ const shimmers = variant === "shimmer" || variant === "glyph" || variant === "locus";
45
+ return _jsx("span", { className: cn(shimmers && "motion-safe:shimmer"), children: label });
46
+ }
47
+ export function Pulse({ variant = "dots", label = "Thinking…", showLabel, tone = "neutral", className, }) {
48
+ const Mark = marks[variant];
49
+ const labelVisible = showLabel ?? labelShownByDefault[variant];
50
+ return (_jsxs("span", { "data-slot": "pulse", "data-variant": variant, role: "status", "aria-live": "polite", className: cn("inline-flex items-center gap-2 text-sm text-muted-foreground", className), children: [Mark && _jsx(Mark, { tone: tone }), labelVisible ? (_jsx(VisibleLabel, { variant: variant, label: label, tone: tone })) : (_jsx("span", { className: "sr-only", children: label }))] }));
51
+ }
@@ -0,0 +1,2 @@
1
+ export declare function prefersReducedMotion(): boolean;
2
+ export declare function useLoopAnimation<T extends Element>(keyframes: Keyframe[], duration: number, delay?: number, easing?: string): import("react").RefObject<T | null>;
@@ -0,0 +1,21 @@
1
+ import { useEffect, useRef } from "react";
2
+ export function prefersReducedMotion() {
3
+ return (typeof window !== "undefined" &&
4
+ window.matchMedia?.("(prefers-reduced-motion: reduce)").matches === true);
5
+ }
6
+ export function useLoopAnimation(keyframes, duration, delay = 0, easing = "ease-in-out") {
7
+ const ref = useRef(null);
8
+ useEffect(() => {
9
+ const element = ref.current;
10
+ if (!element || typeof element.animate !== "function" || prefersReducedMotion())
11
+ return;
12
+ const animation = element.animate(keyframes, {
13
+ duration,
14
+ delay,
15
+ easing,
16
+ iterations: Number.POSITIVE_INFINITY,
17
+ });
18
+ return () => animation.cancel();
19
+ }, [keyframes, duration, delay, easing]);
20
+ return ref;
21
+ }
@@ -0,0 +1 @@
1
+ export { StatusDot, type StatusTone, statusDotTones } from "../../shared/status-dot.js";
@@ -0,0 +1 @@
1
+ export { StatusDot, statusDotTones } from "../../shared/status-dot.js";
@@ -0,0 +1,8 @@
1
+ import type { StepStatus } from "../../types.js";
2
+ export declare const stepStatusLabels: Record<StepStatus, string>;
3
+ type StepIconProps = {
4
+ status: StepStatus;
5
+ current?: boolean;
6
+ };
7
+ export declare function StepIcon({ status, current }: StepIconProps): import("react").JSX.Element;
8
+ export {};
@@ -0,0 +1,31 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Checkmark as CheckIcon, InProgress as LoaderCircleIcon, Subtract as MinusIcon, Close as XIcon, } from "@carbon/icons-react";
3
+ import { cn } from "@locusgraph/components";
4
+ export const stepStatusLabels = {
5
+ pending: "Pending",
6
+ running: "Running",
7
+ done: "Done",
8
+ failed: "Failed",
9
+ skipped: "Skipped",
10
+ };
11
+ const stepIconFrames = {
12
+ pending: "bg-card ring-1 ring-muted-foreground/40 ring-inset",
13
+ running: "bg-card text-warn",
14
+ done: "bg-good text-white dark:text-background",
15
+ failed: "bg-destructive text-white",
16
+ skipped: "bg-muted text-muted-foreground",
17
+ };
18
+ function StepGlyph({ status }) {
19
+ if (status === "running")
20
+ return _jsx(LoaderCircleIcon, { className: "size-4 motion-safe:animate-spin" });
21
+ if (status === "done")
22
+ return _jsx(CheckIcon, { className: "size-2.5" });
23
+ if (status === "failed")
24
+ return _jsx(XIcon, { className: "size-2.5" });
25
+ if (status === "skipped")
26
+ return _jsx(MinusIcon, { className: "size-2.5" });
27
+ return null;
28
+ }
29
+ export function StepIcon({ status, current = false }) {
30
+ return (_jsx("span", { "aria-hidden": true, "data-slot": "step-icon", className: cn("relative z-10 mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-full", stepIconFrames[status], current && status === "pending" && "ring-foreground/60"), children: _jsx(StepGlyph, { status: status }) }));
31
+ }
@@ -0,0 +1,7 @@
1
+ import type { AgentStep } from "../../types.js";
2
+ export type StepsProps = {
3
+ steps: AgentStep[];
4
+ title?: string;
5
+ className?: string;
6
+ };
7
+ export declare function Steps({ steps, title, className }: StepsProps): import("react").JSX.Element;
@@ -0,0 +1,39 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { ListChecked as ListChecksIcon } from "@carbon/icons-react";
3
+ import { cn } from "@locusgraph/components";
4
+ import { ApprovalPanel, PanelHeader } from "../../shared/panel.js";
5
+ import { StepIcon, stepStatusLabels } from "./step-icon.js";
6
+ const stepTitleTones = {
7
+ pending: "text-muted-foreground",
8
+ running: "text-foreground font-medium",
9
+ done: "text-foreground",
10
+ failed: "text-foreground font-medium",
11
+ skipped: "text-muted-foreground line-through",
12
+ };
13
+ function currentStepId(steps) {
14
+ const running = steps.find((step) => step.status === "running");
15
+ if (running)
16
+ return running.id;
17
+ if (steps.some((step) => step.status === "failed"))
18
+ return undefined;
19
+ return steps.find((step) => step.status === "pending")?.id;
20
+ }
21
+ function progressLabel(steps) {
22
+ const done = steps.filter((step) => step.status === "done").length;
23
+ return `${done} of ${steps.length} done`;
24
+ }
25
+ function progressTone(steps) {
26
+ if (steps.some((step) => step.status === "failed"))
27
+ return "danger";
28
+ if (steps.some((step) => step.status === "running"))
29
+ return "waiting";
30
+ const settled = steps.every((step) => step.status === "done" || step.status === "skipped");
31
+ return steps.length > 0 && settled ? "done" : "idle";
32
+ }
33
+ function StepRow({ step, current, last }) {
34
+ return (_jsxs("li", { "data-slot": "step", "data-status": step.status, "aria-current": current ? "step" : undefined, className: "relative flex gap-3 pb-4 last:pb-0", children: [!last && (_jsx("span", { "aria-hidden": true, className: "absolute top-5 bottom-0.5 left-[7.5px] w-px bg-border" })), _jsx(StepIcon, { status: step.status, current: current }), _jsxs("div", { className: "flex min-w-0 flex-col gap-0.5", children: [_jsxs("span", { className: cn("text-sm leading-snug", stepTitleTones[step.status], current && step.status === "pending" && "text-foreground"), children: [step.title, _jsxs("span", { className: "sr-only", children: [" (", stepStatusLabels[step.status], ")"] })] }), step.detail && (_jsx("span", { className: cn("font-mono text-xs text-muted-foreground", step.status === "failed" && "font-sans text-destructive"), children: step.detail }))] })] }));
35
+ }
36
+ export function Steps({ steps, title = "Plan", className }) {
37
+ const currentId = currentStepId(steps);
38
+ return (_jsxs(ApprovalPanel, { "data-slot": "steps", "aria-label": title, className: className, children: [_jsx(PanelHeader, { icon: _jsx(ListChecksIcon, { "aria-hidden": true }), eyebrow: title, status: progressLabel(steps), tone: progressTone(steps) }), _jsx("ol", { className: "flex flex-col px-5 pt-4 pb-5", children: steps.map((step, position) => (_jsx(StepRow, { step: step, current: step.id === currentId, last: position === steps.length - 1 }, step.id))) })] }));
39
+ }
@@ -0,0 +1,6 @@
1
+ import type { ReasoningPart } from "../../types.js";
2
+ export type ThinkingProps = Omit<ReasoningPart, "type"> & {
3
+ defaultOpen?: boolean;
4
+ className?: string;
5
+ };
6
+ export declare function Thinking({ text, state, durationMs, defaultOpen, className }: ThinkingProps): import("react").JSX.Element;
@@ -0,0 +1,31 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Idea as BrainIcon, ChevronRight as ChevronRightIcon } from "@carbon/icons-react";
4
+ import { Collapsible, CollapsibleContent, CollapsibleTrigger, cn } from "@locusgraph/components";
5
+ import { useEffect, useRef, useState } from "react";
6
+ import { firstLineOf, thoughtDurationLabel } from "./thought-duration.js";
7
+ function useThinkingOpen(streaming, defaultOpen) {
8
+ const [open, setOpen] = useState(defaultOpen ?? streaming);
9
+ const openedByUser = useRef(false);
10
+ const wasStreaming = useRef(streaming);
11
+ useEffect(() => {
12
+ if (wasStreaming.current === streaming)
13
+ return;
14
+ wasStreaming.current = streaming;
15
+ if (streaming)
16
+ setOpen(true);
17
+ else if (!openedByUser.current)
18
+ setOpen(false);
19
+ }, [streaming]);
20
+ function toggle(next) {
21
+ setOpen(next);
22
+ openedByUser.current = next;
23
+ }
24
+ return [open, toggle];
25
+ }
26
+ export function Thinking({ text, state, durationMs, defaultOpen, className }) {
27
+ const streaming = state === "streaming";
28
+ const [open, setOpen] = useThinkingOpen(streaming, defaultOpen);
29
+ const summary = firstLineOf(text);
30
+ return (_jsxs(Collapsible, { "data-slot": "thinking", "data-state": streaming ? "streaming" : "done", open: open, onOpenChange: setOpen, className: cn("flex min-w-0 flex-col gap-2 text-sm text-muted-foreground", className), children: [_jsxs(CollapsibleTrigger, { "aria-expanded": open, className: "group eyebrow flex w-fit items-center gap-2 py-1 transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/70", children: [_jsx(BrainIcon, { className: "size-3.5 shrink-0", "aria-hidden": true }), _jsx("span", { "aria-live": "polite", className: cn(streaming && "motion-safe:shimmer"), children: streaming ? "Thinking…" : thoughtDurationLabel(durationMs) }), _jsx(ChevronRightIcon, { "aria-hidden": true, className: cn("size-3.5 shrink-0 opacity-70 motion-safe:transition-transform", open && "rotate-90") })] }), !open && summary && (_jsx("p", { "data-slot": "thinking-summary", className: "ml-[6.5px] truncate border-l border-border pl-4 text-muted-foreground/80", children: summary })), _jsx(CollapsibleContent, { "data-slot": "thinking-content", className: "ml-[6.5px] border-l border-border pl-4 leading-relaxed whitespace-pre-wrap", children: text })] }));
31
+ }
@@ -0,0 +1,2 @@
1
+ export declare function thoughtDurationLabel(durationMs: number | undefined): string;
2
+ export declare function firstLineOf(text: string): string;
@@ -0,0 +1,13 @@
1
+ export function thoughtDurationLabel(durationMs) {
2
+ if (durationMs === undefined)
3
+ return "Thought for a few seconds";
4
+ const totalSeconds = Math.max(1, Math.round(durationMs / 1000));
5
+ if (totalSeconds < 60)
6
+ return `Thought for ${totalSeconds}s`;
7
+ const minutes = Math.floor(totalSeconds / 60);
8
+ const seconds = totalSeconds % 60;
9
+ return seconds === 0 ? `Thought for ${minutes}m` : `Thought for ${minutes}m ${seconds}s`;
10
+ }
11
+ export function firstLineOf(text) {
12
+ return text.trim().split("\n")[0]?.trim() ?? "";
13
+ }
@@ -0,0 +1,5 @@
1
+ export declare function prettyJson(value: unknown): string;
2
+ export declare function JsonBlock({ label, value }: {
3
+ label: string;
4
+ value: unknown;
5
+ }): import("react").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Code } from "../../thread/code/code.js";
3
+ export function prettyJson(value) {
4
+ if (typeof value === "string")
5
+ return value;
6
+ try {
7
+ return JSON.stringify(value, null, 2) ?? String(value);
8
+ }
9
+ catch {
10
+ return String(value);
11
+ }
12
+ }
13
+ export function JsonBlock({ label, value }) {
14
+ return (_jsx(Code, { "data-slot": "tool-json", code: prettyJson(value), language: "json", filename: label, className: "[&_[data-slot=code-area]]:max-h-72 [&_[data-slot=code-area]]:overflow-auto" }));
15
+ }
@@ -0,0 +1,6 @@
1
+ import type { ToolState } from "../../types.js";
2
+ export declare const toolStateLabels: Record<ToolState, string>;
3
+ export declare function isToolBusy(state: ToolState): state is "input-available" | "input-streaming";
4
+ export declare function ToolStatus({ state }: {
5
+ state: ToolState;
6
+ }): import("react").JSX.Element;
@@ -0,0 +1,26 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { StatusDot } from "../../shared/status-dot.js";
3
+ export const toolStateLabels = {
4
+ "input-streaming": "Preparing",
5
+ "input-available": "Running",
6
+ "approval-requested": "Waiting for approval",
7
+ "approval-responded": "Approved",
8
+ "output-available": "Done",
9
+ "output-error": "Failed",
10
+ "output-denied": "Denied",
11
+ };
12
+ const toolStateTones = {
13
+ "input-streaming": "waiting",
14
+ "input-available": "waiting",
15
+ "approval-requested": "waiting",
16
+ "approval-responded": "done",
17
+ "output-available": "done",
18
+ "output-error": "danger",
19
+ "output-denied": "idle",
20
+ };
21
+ export function isToolBusy(state) {
22
+ return state === "input-streaming" || state === "input-available";
23
+ }
24
+ export function ToolStatus({ state }) {
25
+ return (_jsxs("span", { "data-slot": "tool-status", "data-state": state, "aria-live": "polite", className: "eyebrow flex shrink-0 items-center gap-1.5", children: [_jsx(StatusDot, { tone: toolStateTones[state] }), toolStateLabels[state]] }));
26
+ }
@@ -0,0 +1,7 @@
1
+ import { type ToolPart } from "../../types.js";
2
+ export type ToolProps = {
3
+ part: ToolPart;
4
+ defaultOpen?: boolean;
5
+ className?: string;
6
+ };
7
+ export declare function Tool({ part, defaultOpen, className }: ToolProps): import("react").JSX.Element;
@@ -0,0 +1,14 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { ChevronRight as ChevronRightIcon, Tools as WrenchIcon } from "@carbon/icons-react";
4
+ import { Collapsible, CollapsibleContent, CollapsibleTrigger, cn } from "@locusgraph/components";
5
+ import { useState } from "react";
6
+ import { toolNameOf } from "../../types.js";
7
+ import { JsonBlock } from "./json-block.js";
8
+ import { ToolStatus } from "./tool-status.js";
9
+ export function Tool({ part, defaultOpen = false, className }) {
10
+ const [open, setOpen] = useState(defaultOpen);
11
+ const hasInput = part.input !== undefined;
12
+ const hasOutput = part.state === "output-available" && part.output !== undefined;
13
+ return (_jsxs(Collapsible, { "data-slot": "tool", "data-state": part.state, "data-tool-call-id": part.toolCallId, open: open, onOpenChange: setOpen, className: cn("flex min-w-0 flex-col bg-card text-card-foreground ring-1 ring-border", className), children: [_jsxs(CollapsibleTrigger, { "aria-expanded": open, className: "flex w-full items-center gap-2.5 px-3 py-2.5 text-left transition-colors hover:bg-accent/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/70 focus-visible:ring-inset", children: [_jsx(WrenchIcon, { "aria-hidden": true, className: "size-3.5 shrink-0 text-muted-foreground" }), _jsx("span", { className: "min-w-0 flex-1 truncate font-mono text-sm font-medium", children: toolNameOf(part) }), _jsx(ToolStatus, { state: part.state }), _jsx(ChevronRightIcon, { "aria-hidden": true, className: cn("size-3.5 shrink-0 text-muted-foreground motion-safe:transition-transform", open && "rotate-90") })] }), part.errorText && (_jsx("p", { "data-slot": "tool-error", role: "alert", className: "border-t border-border px-3 py-2.5 text-sm text-destructive", children: part.errorText })), _jsxs(CollapsibleContent, { "data-slot": "tool-content", className: "flex flex-col gap-4 border-t border-border px-3 pt-3 pb-4", children: [hasInput && _jsx(JsonBlock, { label: "Input", value: part.input }), hasOutput && _jsx(JsonBlock, { label: "Output", value: part.output }), !hasInput && !hasOutput && (_jsx("span", { className: "text-sm text-muted-foreground", children: "No input yet." }))] })] }));
14
+ }
@@ -0,0 +1,11 @@
1
+ import type { PendingApproval } from "../types.js";
2
+ type InboxRowProps = {
3
+ item: PendingApproval;
4
+ now: number;
5
+ selected: boolean;
6
+ onSelect: (selected: boolean) => void;
7
+ onApprove: () => void;
8
+ onDeny: () => void;
9
+ };
10
+ export declare function InboxRow({ item, now, selected, onSelect, onApprove, onDeny }: InboxRowProps): import("react").JSX.Element;
11
+ export {};
@@ -0,0 +1,14 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Checkmark as CheckIcon, Locked as LockIcon, Close as XIcon } from "@carbon/icons-react";
3
+ import { Button, Checkbox, cn } from "@locusgraph/components";
4
+ import { riskLabels } from "../shared/risk-badge.js";
5
+ import { formatWaiting, isoOf } from "../shared/time.js";
6
+ const riskDot = {
7
+ read: "bg-muted-foreground/50",
8
+ write: "bg-warn",
9
+ destructive: "bg-destructive",
10
+ };
11
+ export function InboxRow({ item, now, selected, onSelect, onApprove, onDeny }) {
12
+ const destructive = item.risk === "destructive";
13
+ return (_jsxs("li", { "data-slot": "inbox-item", "data-risk": item.risk, "data-selected": selected || undefined, className: cn("group flex items-center gap-3 px-5 py-2.5 motion-safe:transition-colors", selected ? "bg-accent" : "hover:bg-accent/50"), children: [destructive ? (_jsxs("span", { className: "flex size-4 shrink-0 items-center justify-center text-muted-foreground", children: [_jsx(LockIcon, { "aria-hidden": true, className: "size-3.5" }), _jsxs("span", { className: "sr-only", children: [item.title, " must be approved on its own"] })] })) : (_jsx(Checkbox, { "aria-label": `Select ${item.title}`, checked: selected, onCheckedChange: (checked) => onSelect(checked === true) })), _jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [_jsxs("p", { className: "flex min-w-0 items-baseline gap-2 text-sm", children: [_jsx("span", { className: "truncate font-medium", children: item.title }), _jsx("span", { className: "hidden shrink-0 truncate text-xs text-muted-foreground sm:inline", children: item.runName })] }), _jsxs("p", { className: "flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground", children: [_jsx("span", { "aria-hidden": true, className: cn("size-1.5 shrink-0 rounded-full", riskDot[item.risk]) }), _jsx("span", { className: "shrink-0", children: riskLabels[item.risk] }), item.summary && (_jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": true, children: "\u00B7" }), _jsx("span", { className: "truncate", children: item.summary })] }))] }), _jsx("p", { className: "truncate text-xs text-muted-foreground sm:hidden", children: item.runName })] }), _jsx("time", { dateTime: isoOf(item.requestedAt), className: "w-12 shrink-0 text-right font-mono text-[11px] text-muted-foreground tabular-nums", children: formatWaiting(item.requestedAt, now) }), _jsxs("span", { className: "flex shrink-0 gap-1", children: [_jsx(Button, { type: "button", size: "icon-xs", variant: "outline", "aria-label": `Approve ${item.title}`, title: "Approve", onClick: onApprove, children: _jsx(CheckIcon, { "aria-hidden": true }) }), _jsx(Button, { type: "button", size: "icon-xs", variant: "ghost", "aria-label": `Deny ${item.title}`, title: "Deny", className: "text-muted-foreground hover:text-foreground", onClick: onDeny, children: _jsx(XIcon, { "aria-hidden": true }) })] })] }));
14
+ }
@@ -0,0 +1,6 @@
1
+ import type { PendingApproval } from "../types.js";
2
+ export declare function bulkApprovable(items: PendingApproval[]): PendingApproval[];
3
+ export declare function selectedIn(items: PendingApproval[], selected: Set<string>): string[];
4
+ export type SelectAllState = boolean | "indeterminate";
5
+ export declare function selectAllState(selectableCount: number, selectedCount: number): SelectAllState;
6
+ export declare function toggled(selected: Set<string>, id: string, on: boolean): Set<string>;