@tangle-network/agent-app 0.45.29 → 0.45.30
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/{use-file-mentions-CZ-Ua_sb.d.ts → agent-session-controls-BwImzYKC.d.ts} +32 -1
- package/dist/alerting/index.d.ts +178 -0
- package/dist/alerting/index.js +9 -0
- package/dist/alerting/index.js.map +1 -0
- package/dist/assistant/index.d.ts +3 -3
- package/dist/assistant/index.js +9 -8
- package/dist/assistant/index.js.map +1 -1
- package/dist/chat-react/index.d.ts +19 -162
- package/dist/chat-react/index.js +15 -133
- package/dist/chat-react/index.js.map +1 -1
- package/dist/chat-routes/index.js +6 -6
- package/dist/chunk-COP2K4LF.js +190 -0
- package/dist/chunk-COP2K4LF.js.map +1 -0
- package/dist/{chunk-3I27SDU3.js → chunk-IFYJDX3J.js} +799 -1265
- package/dist/chunk-IFYJDX3J.js.map +1 -0
- package/dist/chunk-L7FHRORY.js +763 -0
- package/dist/chunk-L7FHRORY.js.map +1 -0
- package/dist/{chunk-5FAKBTCK.js → chunk-XDB7IBYE.js} +22 -1
- package/dist/chunk-XDB7IBYE.js.map +1 -0
- package/dist/preflight/cli.js +2 -1
- package/dist/preflight/cli.js.map +1 -1
- package/dist/preflight/index.d.ts +35 -2
- package/dist/preflight/index.js +6 -3
- package/dist/teams/index.js +5 -5
- package/dist/teams/invitations-api.js +4 -4
- package/dist/web-react/index.d.ts +3 -31
- package/dist/web-react/index.js +10 -10
- package/package.json +6 -1
- package/dist/chunk-3I27SDU3.js.map +0 -1
- package/dist/chunk-5FAKBTCK.js.map +0 -1
- package/dist/chunk-E4DHYENH.js +0 -292
- package/dist/chunk-E4DHYENH.js.map +0 -1
|
@@ -5,6 +5,11 @@ import {
|
|
|
5
5
|
WorkProductCard,
|
|
6
6
|
workProductPartsFromMessageParts
|
|
7
7
|
} from "./chunk-HZ4WCA37.js";
|
|
8
|
+
import {
|
|
9
|
+
ChevronDown,
|
|
10
|
+
POPOVER_OPTION_FOCUS,
|
|
11
|
+
usePending
|
|
12
|
+
} from "./chunk-L7FHRORY.js";
|
|
8
13
|
import {
|
|
9
14
|
UNTITLED_SESSION_LABEL,
|
|
10
15
|
mergeSessionPages,
|
|
@@ -30,13 +35,9 @@ import {
|
|
|
30
35
|
parsePlanSubmittedEvent,
|
|
31
36
|
persistedPartToPlan
|
|
32
37
|
} from "./chunk-YJMCRXQQ.js";
|
|
33
|
-
import {
|
|
34
|
-
snapHarnessToModel,
|
|
35
|
-
snapModelToHarness
|
|
36
|
-
} from "./chunk-TH7L265V.js";
|
|
37
38
|
|
|
38
39
|
// src/web-react/index.tsx
|
|
39
|
-
import { useEffect as
|
|
40
|
+
import { useEffect as useEffect11, useMemo as useMemo7, useRef as useRef10, useState as useState14, memo } from "react";
|
|
40
41
|
|
|
41
42
|
// src/web-react/smooth-text.ts
|
|
42
43
|
import { useEffect, useRef, useState } from "react";
|
|
@@ -78,317 +79,11 @@ function useSmoothText(target, enabled, opts) {
|
|
|
78
79
|
return target.slice(0, Math.floor(shownRef.current));
|
|
79
80
|
}
|
|
80
81
|
|
|
81
|
-
// src/web-react/controls.tsx
|
|
82
|
-
import { useEffect as useEffect2, useMemo, useRef as useRef2, useState as useState2 } from "react";
|
|
83
|
-
|
|
84
|
-
// src/web-react/provider-logo.tsx
|
|
85
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
86
|
-
var LOGOS = {
|
|
87
|
-
anthropic: { viewBox: "0 0 24 24", fill: "#D97757", paths: ["M17.3041 3.541h-3.6718l6.696 16.918H24Zm-10.6082 0L0 20.459h3.7442l1.3693-3.5527h7.0052l1.3693 3.5528h3.7442L10.5363 3.5409Zm-.3712 10.2232 2.2914-5.9456 2.2914 5.9456Z"] },
|
|
88
|
-
google: { viewBox: "0 0 24 24", fill: "#8E75B2", paths: ["M11.04 19.32Q12 21.51 12 24q0-2.49.93-4.68.96-2.19 2.58-3.81t3.81-2.55Q21.51 12 24 12q-2.49 0-4.68-.93a12.3 12.3 0 0 1-3.81-2.58 12.3 12.3 0 0 1-2.58-3.81Q12 2.49 12 0q0 2.49-.96 4.68-.93 2.19-2.55 3.81a12.3 12.3 0 0 1-3.81 2.58Q2.49 12 0 12q2.49 0 4.68.96 2.19.93 3.81 2.55t2.55 3.81"] },
|
|
89
|
-
deepseek: { viewBox: "0 0 24 24", fill: "#4D6BFE", paths: ["M23.748 4.651c-.254-.124-.364.113-.512.233-.051.04-.094.09-.137.137-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.155-.708-.311-.955-.65-.172-.24-.219-.509-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.094.172.187.129.323-.082.28-.18.553-.266.833-.055.179-.137.218-.328.14a5.5 5.5 0 0 1-1.737-1.179c-.857-.828-1.631-1.743-2.597-2.46a12 12 0 0 0-.689-.47c-.985-.957.13-1.743.387-1.836.27-.098.094-.433-.778-.428-.872.003-1.67.295-2.687.685a3 3 0 0 1-.465.136 9.6 9.6 0 0 0-2.883-.101c-1.885.21-3.39 1.1-4.497 2.622C.082 8.776-.231 10.854.152 13.02c.403 2.284 1.568 4.175 3.36 5.653 1.857 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.132-.284 4.994-1.86.47.234.962.328 1.78.398.629.058 1.235-.031 1.705-.129.735-.155.684-.836.418-.961-2.155-1.004-1.682-.595-2.112-.926 1.095-1.295 2.768-3.598 3.284-6.733.05-.346.115-.834.108-1.114-.004-.171.035-.238.23-.257a4.2 4.2 0 0 0 1.545-.475c1.397-.763 1.96-2.016 2.093-3.517.02-.23-.004-.467-.247-.588M11.58 18.168c-2.088-1.642-3.101-2.183-3.52-2.16-.39.024-.32.472-.234.763.09.288.207.487.371.74.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.168-1.361-.801-2.5-1.86-3.301-3.306-.775-1.393-1.225-2.888-1.299-4.482-.02-.385.094-.522.477-.592a4.7 4.7 0 0 1 1.53-.038c2.131.311 3.946 1.264 5.467 2.774.868.86 1.525 1.887 2.202 2.89.72 1.066 1.494 2.082 2.48 2.915.348.291.626.513.892.677-.802.09-2.14.109-3.055-.615zm1.001-6.44a.306.306 0 0 1 .415-.287.3.3 0 0 1 .113.074.3.3 0 0 1 .086.214c0 .17-.136.307-.308.307a.303.303 0 0 1-.306-.307m3.11 1.596c-.2.081-.4.151-.591.16a1.25 1.25 0 0 1-.798-.254c-.274-.23-.47-.358-.551-.758a1.7 1.7 0 0 1 .015-.588c.07-.327-.007-.537-.238-.727-.188-.156-.426-.199-.689-.199a.6.6 0 0 1-.254-.078.253.253 0 0 1-.114-.358 1 1 0 0 1 .192-.21c.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.392.451.462.576.685.915.176.264.336.536.446.848.066.194-.02.353-.25.45"] },
|
|
90
|
-
mistral: { viewBox: "0 0 24 24", fill: "#FA520F", paths: ["M17.143 3.429v3.428h-3.429v3.429h-3.428V6.857H6.857V3.43H3.43v13.714H0v3.428h10.286v-3.428H6.857v-3.429h3.429v3.429h3.429v-3.429h3.428v3.429h-3.428v3.428H24v-3.428h-3.43V3.429z"] },
|
|
91
|
-
xai: { viewBox: "0 0 24 24", fill: "#000000", paths: ["M14.234 10.162 22.977 0h-2.072l-7.591 8.824L7.251 0H.258l9.168 13.343L.258 24H2.33l8.016-9.318L16.749 24h6.993zm-2.837 3.299-.929-1.329L3.076 1.56h3.182l5.965 8.532.929 1.329 7.754 11.09h-3.182z"] },
|
|
92
|
-
nvidia: { viewBox: "0 0 24 24", fill: "#76B900", paths: ["M8.948 8.798v-1.43a6.7 6.7 0 0 1 .424-.018c3.922-.124 6.493 3.374 6.493 3.374s-2.774 3.851-5.75 3.851c-.398 0-.787-.062-1.158-.185v-4.346c1.528.185 1.837.857 2.747 2.385l2.04-1.714s-1.492-1.952-4-1.952a6.016 6.016 0 0 0-.796.035m0-4.735v2.138l.424-.027c5.45-.185 9.01 4.47 9.01 4.47s-4.08 4.964-8.33 4.964c-.37 0-.733-.035-1.095-.097v1.325c.3.035.61.062.91.062 3.957 0 6.82-2.023 9.593-4.408.459.371 2.34 1.263 2.73 1.652-2.633 2.208-8.772 3.984-12.253 3.984-.335 0-.653-.018-.971-.053v1.864H24V4.063zm0 10.326v1.131c-3.657-.654-4.673-4.46-4.673-4.46s1.758-1.944 4.673-2.262v1.237H8.94c-1.528-.186-2.73 1.245-2.73 1.245s.68 2.412 2.739 3.11M2.456 10.9s2.164-3.197 6.5-3.533V6.201C4.153 6.59 0 10.653 0 10.653s2.35 6.802 8.948 7.42v-1.237c-4.84-.6-6.492-5.936-6.492-5.936z"] },
|
|
93
|
-
meta: { viewBox: "0 0 24 24", fill: "#0467DF", paths: ["M6.915 4.03c-1.968 0-3.683 1.28-4.871 3.113C.704 9.208 0 11.883 0 14.449c0 .706.07 1.369.21 1.973a6.624 6.624 0 0 0 .265.86 5.297 5.297 0 0 0 .371.761c.696 1.159 1.818 1.927 3.593 1.927 1.497 0 2.633-.671 3.965-2.444.76-1.012 1.144-1.626 2.663-4.32l.756-1.339.186-.325c.061.1.121.196.183.3l2.152 3.595c.724 1.21 1.665 2.556 2.47 3.314 1.046.987 1.992 1.22 3.06 1.22 1.075 0 1.876-.355 2.455-.843a3.743 3.743 0 0 0 .81-.973c.542-.939.861-2.127.861-3.745 0-2.72-.681-5.357-2.084-7.45-1.282-1.912-2.957-2.93-4.716-2.93-1.047 0-2.088.467-3.053 1.308-.652.57-1.257 1.29-1.82 2.05-.69-.875-1.335-1.547-1.958-2.056-1.182-.966-2.315-1.303-3.454-1.303zm10.16 2.053c1.147 0 2.188.758 2.992 1.999 1.132 1.748 1.647 4.195 1.647 6.4 0 1.548-.368 2.9-1.839 2.9-.58 0-1.027-.23-1.664-1.004-.496-.601-1.343-1.878-2.832-4.358l-.617-1.028a44.908 44.908 0 0 0-1.255-1.98c.07-.109.141-.224.211-.327 1.12-1.667 2.118-2.602 3.358-2.602zm-10.201.553c1.265 0 2.058.791 2.675 1.446.307.327.737.871 1.234 1.579l-1.02 1.566c-.757 1.163-1.882 3.017-2.837 4.338-1.191 1.649-1.81 1.817-2.486 1.817-.524 0-1.038-.237-1.383-.794-.263-.426-.464-1.13-.464-2.046 0-2.221.63-4.535 1.66-6.088.454-.687.964-1.226 1.533-1.533a2.264 2.264 0 0 1 1.088-.285z"] },
|
|
94
|
-
moonshotai: { viewBox: "0 0 24 24", fill: "#16191E", paths: ["m1.053 16.91 9.538 2.55a21 20.981 0 0 0 .06 2.031l5.956 1.592a12 11.99 0 0 1-15.554-6.172m-1.02-5.79 11.352 3.035a21 20.981 0 0 0-.469 2.01l10.817 2.89a12 11.99 0 0 1-1.845 2.004L.658 15.918a12 11.99 0 0 1-.625-4.796m1.593-5.146L13.573 9.17a21 20.981 0 0 0-1.01 1.874l11.297 3.02a21 20.981 0 0 1-.67 2.362l-11.55-3.087L.125 10.26a12 11.99 0 0 1 1.499-4.285ZM6.067 1.58l11.285 3.016a21 20.981 0 0 0-1.688 1.719l7.824 2.091a21 20.981 0 0 1 .513 2.664L2.107 5.218a12 11.99 0 0 1 3.96-3.638M21.68 4.866 7.222 1.003A12 11.99 0 0 1 21.68 4.866"] },
|
|
95
|
-
openai: { viewBox: "0 0 256 260", fill: "#10A37F", paths: ["M239.184 106.203a64.72 64.72 0 0 0-5.576-53.103C219.452 28.459 191 15.784 163.213 21.74A65.586 65.586 0 0 0 52.096 45.22a64.72 64.72 0 0 0-43.23 31.36c-14.31 24.602-11.061 55.634 8.033 76.74a64.67 64.67 0 0 0 5.525 53.102c14.174 24.65 42.644 37.324 70.446 31.36a64.72 64.72 0 0 0 48.754 21.744c28.481.025 53.714-18.361 62.414-45.481a64.77 64.77 0 0 0 43.229-31.36c14.137-24.558 10.875-55.423-8.083-76.483m-97.56 136.338a48.4 48.4 0 0 1-31.105-11.255l1.535-.87l51.67-29.825a8.6 8.6 0 0 0 4.247-7.367v-72.85l21.845 12.636c.218.111.37.32.409.563v60.367c-.056 26.818-21.783 48.545-48.601 48.601M37.158 197.93a48.35 48.35 0 0 1-5.781-32.589l1.534.921l51.722 29.826a8.34 8.34 0 0 0 8.441 0l63.181-36.425v25.221a.87.87 0 0 1-.358.665l-52.335 30.184c-23.257 13.398-52.97 5.431-66.404-17.803M23.549 85.38a48.5 48.5 0 0 1 25.58-21.333v61.39a8.29 8.29 0 0 0 4.195 7.316l62.874 36.272l-21.845 12.636a.82.82 0 0 1-.767 0L41.353 151.53c-23.211-13.454-31.171-43.144-17.804-66.405zm179.466 41.695l-63.08-36.63L161.73 77.86a.82.82 0 0 1 .768 0l52.233 30.184a48.6 48.6 0 0 1-7.316 87.635v-61.391a8.54 8.54 0 0 0-4.4-7.213m21.742-32.69l-1.535-.922l-51.619-30.081a8.39 8.39 0 0 0-8.492 0L99.98 99.808V74.587a.72.72 0 0 1 .307-.665l52.233-30.133a48.652 48.652 0 0 1 72.236 50.391zM88.061 139.097l-21.845-12.585a.87.87 0 0 1-.41-.614V65.685a48.652 48.652 0 0 1 79.757-37.346l-1.535.87l-51.67 29.825a8.6 8.6 0 0 0-4.246 7.367zm11.868-25.58L128.067 97.3l28.188 16.218v32.434l-28.086 16.218l-28.188-16.218z"] }
|
|
96
|
-
};
|
|
97
|
-
var ALIASES = {
|
|
98
|
-
moonshot: "moonshotai",
|
|
99
|
-
deepseek_ai: "deepseek",
|
|
100
|
-
"x-ai": "xai",
|
|
101
|
-
"meta-llama": "meta"
|
|
102
|
-
};
|
|
103
|
-
var MONOGRAM = {
|
|
104
|
-
cohere: { bg: "#fae8ff", fg: "#c026d3" },
|
|
105
|
-
groq: { bg: "#fce7f3", fg: "#db2777" },
|
|
106
|
-
cerebras: { bg: "#ccfbf1", fg: "#0d9488" },
|
|
107
|
-
zai: { bg: "#ede9fe", fg: "#7c3aed" },
|
|
108
|
-
"z-ai": { bg: "#ede9fe", fg: "#7c3aed" },
|
|
109
|
-
tuner: { bg: "#dbeafe", fg: "#2563eb" }
|
|
110
|
-
};
|
|
111
|
-
function ProviderLogo({ provider, size = 16 }) {
|
|
112
|
-
const key = ALIASES[provider ?? ""] ?? provider ?? "";
|
|
113
|
-
const logo = LOGOS[key];
|
|
114
|
-
if (logo) {
|
|
115
|
-
return /* @__PURE__ */ jsx("svg", { width: size, height: size, viewBox: logo.viewBox, role: "img", "aria-label": key, children: logo.paths.map((d, i) => /* @__PURE__ */ jsx("path", { d, fill: logo.fill }, i)) });
|
|
116
|
-
}
|
|
117
|
-
const mono = MONOGRAM[key] ?? { bg: "#f3f4f6", fg: "#6b7280" };
|
|
118
|
-
return /* @__PURE__ */ jsxs("svg", { width: size, height: size, viewBox: "0 0 16 16", role: "img", "aria-label": key || "model", children: [
|
|
119
|
-
/* @__PURE__ */ jsx("rect", { width: "16", height: "16", rx: "4", fill: mono.bg }),
|
|
120
|
-
/* @__PURE__ */ jsx("text", { x: "8", y: "11.6", textAnchor: "middle", fill: mono.fg, fontSize: "9", fontWeight: "700", fontFamily: "system-ui, sans-serif", children: (key || "?").charAt(0).toUpperCase() })
|
|
121
|
-
] });
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
// src/web-react/controls.tsx
|
|
125
|
-
import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
126
|
-
function ChevronDown({ className }) {
|
|
127
|
-
return /* @__PURE__ */ jsx2("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx2("path", { d: "m6 9 6 6 6-6" }) });
|
|
128
|
-
}
|
|
129
|
-
function SearchGlyph({ className }) {
|
|
130
|
-
return /* @__PURE__ */ jsxs2("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
|
|
131
|
-
/* @__PURE__ */ jsx2("circle", { cx: "11", cy: "11", r: "8" }),
|
|
132
|
-
/* @__PURE__ */ jsx2("path", { d: "m21 21-4.3-4.3" })
|
|
133
|
-
] });
|
|
134
|
-
}
|
|
135
|
-
function SparkleGlyph({ className }) {
|
|
136
|
-
return /* @__PURE__ */ jsx2("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx2("path", { d: "M12 3v3m0 12v3M3 12h3m12 0h3M5.6 5.6l2.1 2.1m8.6 8.6 2.1 2.1m0-12.8-2.1 2.1M7.7 16.3l-2.1 2.1" }) });
|
|
137
|
-
}
|
|
138
|
-
function usePopover(open, setOpen) {
|
|
139
|
-
const containerRef = useRef2(null);
|
|
140
|
-
const triggerRef = useRef2(null);
|
|
141
|
-
useEffect2(() => {
|
|
142
|
-
if (!open) return;
|
|
143
|
-
function onMouseDown(e) {
|
|
144
|
-
if (containerRef.current && !containerRef.current.contains(e.target)) setOpen(false);
|
|
145
|
-
}
|
|
146
|
-
function onKeyDown(e) {
|
|
147
|
-
if (e.key === "Escape") {
|
|
148
|
-
setOpen(false);
|
|
149
|
-
triggerRef.current?.focus();
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
document.addEventListener("mousedown", onMouseDown);
|
|
153
|
-
document.addEventListener("keydown", onKeyDown);
|
|
154
|
-
return () => {
|
|
155
|
-
document.removeEventListener("mousedown", onMouseDown);
|
|
156
|
-
document.removeEventListener("keydown", onKeyDown);
|
|
157
|
-
};
|
|
158
|
-
}, [open, setOpen]);
|
|
159
|
-
return {
|
|
160
|
-
containerRef,
|
|
161
|
-
triggerRef,
|
|
162
|
-
triggerProps: {
|
|
163
|
-
ref: triggerRef,
|
|
164
|
-
"aria-haspopup": true,
|
|
165
|
-
"aria-expanded": open
|
|
166
|
-
}
|
|
167
|
-
};
|
|
168
|
-
}
|
|
169
|
-
var POPOVER_OPTION_FOCUS = "focus-visible:[outline-offset:-2px]";
|
|
170
|
-
function usePending() {
|
|
171
|
-
const [pending, setPending] = useState2(false);
|
|
172
|
-
const inFlight = useRef2(false);
|
|
173
|
-
const mounted = useRef2(true);
|
|
174
|
-
useEffect2(() => {
|
|
175
|
-
mounted.current = true;
|
|
176
|
-
return () => {
|
|
177
|
-
mounted.current = false;
|
|
178
|
-
};
|
|
179
|
-
}, []);
|
|
180
|
-
const run = (action) => {
|
|
181
|
-
if (inFlight.current) return;
|
|
182
|
-
let result;
|
|
183
|
-
try {
|
|
184
|
-
result = action();
|
|
185
|
-
} catch {
|
|
186
|
-
return;
|
|
187
|
-
}
|
|
188
|
-
if (!(result instanceof Promise)) return;
|
|
189
|
-
inFlight.current = true;
|
|
190
|
-
setPending(true);
|
|
191
|
-
void result.finally(() => {
|
|
192
|
-
inFlight.current = false;
|
|
193
|
-
if (mounted.current) setPending(false);
|
|
194
|
-
});
|
|
195
|
-
};
|
|
196
|
-
return { pending, run };
|
|
197
|
-
}
|
|
198
|
-
function formatPrice(p) {
|
|
199
|
-
if (!p) return void 0;
|
|
200
|
-
const n = Number(p);
|
|
201
|
-
if (isNaN(n) || n === 0) return void 0;
|
|
202
|
-
const perM = n * 1e6;
|
|
203
|
-
return perM >= 1 ? `$${perM.toFixed(0)}/M` : `$${perM.toFixed(2)}/M`;
|
|
204
|
-
}
|
|
205
|
-
function formatContext(len) {
|
|
206
|
-
if (!len) return void 0;
|
|
207
|
-
if (len >= 1e6) return `${(len / 1e6).toFixed(1)}M ctx`;
|
|
208
|
-
if (len >= 1e3) return `${Math.round(len / 1e3)}K ctx`;
|
|
209
|
-
return `${len} ctx`;
|
|
210
|
-
}
|
|
211
|
-
function SectionHeader({ children }) {
|
|
212
|
-
return /* @__PURE__ */ jsx2("div", { className: "px-3 pb-1 pt-3 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children });
|
|
213
|
-
}
|
|
214
|
-
function ModelRow({
|
|
215
|
-
model,
|
|
216
|
-
selected,
|
|
217
|
-
onSelect,
|
|
218
|
-
renderProviderBadge
|
|
219
|
-
}) {
|
|
220
|
-
const price = formatPrice(model.pricing?.prompt);
|
|
221
|
-
const ctx = formatContext(model.contextLength);
|
|
222
|
-
return /* @__PURE__ */ jsxs2(
|
|
223
|
-
"button",
|
|
224
|
-
{
|
|
225
|
-
type: "button",
|
|
226
|
-
onClick: onSelect,
|
|
227
|
-
className: `flex w-full items-center gap-2.5 rounded-md px-3 py-2.5 text-left text-sm transition ${POPOVER_OPTION_FOCUS} ${selected ? "bg-primary/10 font-medium" : "hover:bg-accent/30"}`,
|
|
228
|
-
children: [
|
|
229
|
-
renderProviderBadge ? renderProviderBadge(model.provider) : /* @__PURE__ */ jsx2(ProviderLogo, { provider: model.provider, size: 16 }),
|
|
230
|
-
/* @__PURE__ */ jsx2("span", { className: "truncate", children: model.name }),
|
|
231
|
-
!model.supportsTools && /* @__PURE__ */ jsx2("span", { className: "shrink-0 rounded bg-muted/60 px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground", children: "no tools" }),
|
|
232
|
-
/* @__PURE__ */ jsxs2("span", { className: "ml-auto flex shrink-0 items-center gap-2 text-xs text-muted-foreground", children: [
|
|
233
|
-
ctx && /* @__PURE__ */ jsx2("span", { children: ctx }),
|
|
234
|
-
price && /* @__PURE__ */ jsx2("span", { children: price })
|
|
235
|
-
] })
|
|
236
|
-
]
|
|
237
|
-
}
|
|
238
|
-
);
|
|
239
|
-
}
|
|
240
|
-
function ModelPicker({ value, onChange, models, loading, renderProviderBadge, recommendedLabel = "Recommended", priorityGroup }) {
|
|
241
|
-
const [open, setOpen] = useState2(false);
|
|
242
|
-
const [query, setQuery] = useState2("");
|
|
243
|
-
const { containerRef, triggerProps } = usePopover(open, setOpen);
|
|
244
|
-
const inputRef = useRef2(null);
|
|
245
|
-
const popoverRef = useRef2(null);
|
|
246
|
-
useEffect2(() => {
|
|
247
|
-
if (open) inputRef.current?.focus();
|
|
248
|
-
}, [open]);
|
|
249
|
-
useEffect2(() => {
|
|
250
|
-
if (!open) return;
|
|
251
|
-
const el = popoverRef.current;
|
|
252
|
-
if (!el) return;
|
|
253
|
-
const overflowRight = el.getBoundingClientRect().right - (window.innerWidth - 16);
|
|
254
|
-
el.style.transform = overflowRight > 0 ? `translateX(-${Math.ceil(overflowRight)}px)` : "";
|
|
255
|
-
}, [open]);
|
|
256
|
-
const selected = models.find((m) => m.id === value);
|
|
257
|
-
const filtered = useMemo(() => {
|
|
258
|
-
const q = query.trim().toLowerCase();
|
|
259
|
-
if (!q) return null;
|
|
260
|
-
return models.filter(
|
|
261
|
-
(m) => m.id.toLowerCase().includes(q) || m.name.toLowerCase().includes(q) || (m.description?.toLowerCase() ?? "").includes(q) || m.provider.toLowerCase().includes(q)
|
|
262
|
-
);
|
|
263
|
-
}, [models, query]);
|
|
264
|
-
const sections = useMemo(() => {
|
|
265
|
-
const isPriority = priorityGroup ? (m) => priorityGroup.match(m) : () => false;
|
|
266
|
-
const priority = priorityGroup ? models.filter(isPriority) : [];
|
|
267
|
-
const recommended = models.filter((m) => m.featured && !isPriority(m));
|
|
268
|
-
const byProvider = [];
|
|
269
|
-
for (const m of models) {
|
|
270
|
-
if (m.featured || isPriority(m)) continue;
|
|
271
|
-
const last = byProvider[byProvider.length - 1];
|
|
272
|
-
if (last && last.provider === m.provider) last.items.push(m);
|
|
273
|
-
else byProvider.push({ provider: m.provider, items: [m] });
|
|
274
|
-
}
|
|
275
|
-
return { priority, recommended, byProvider };
|
|
276
|
-
}, [models, priorityGroup]);
|
|
277
|
-
const select = (id) => {
|
|
278
|
-
onChange(id);
|
|
279
|
-
setOpen(false);
|
|
280
|
-
setQuery("");
|
|
281
|
-
};
|
|
282
|
-
return /* @__PURE__ */ jsxs2("div", { ref: containerRef, className: "relative inline-flex", children: [
|
|
283
|
-
/* @__PURE__ */ jsxs2(
|
|
284
|
-
"button",
|
|
285
|
-
{
|
|
286
|
-
type: "button",
|
|
287
|
-
...triggerProps,
|
|
288
|
-
onClick: () => setOpen(!open),
|
|
289
|
-
className: "inline-flex items-center gap-1.5 rounded-full border border-border bg-card px-3 py-1.5 text-sm font-medium text-foreground transition hover:bg-accent/30",
|
|
290
|
-
children: [
|
|
291
|
-
selected ? renderProviderBadge ? renderProviderBadge(selected.provider) : /* @__PURE__ */ jsx2(ProviderLogo, { provider: selected.provider, size: 16 }) : /* @__PURE__ */ jsx2(SparkleGlyph, { className: "h-3.5 w-3.5 text-muted-foreground" }),
|
|
292
|
-
/* @__PURE__ */ jsx2("span", { className: "max-w-[160px] truncate", children: selected?.name ?? value }),
|
|
293
|
-
/* @__PURE__ */ jsx2(ChevronDown, { className: "h-3.5 w-3.5 text-muted-foreground" })
|
|
294
|
-
]
|
|
295
|
-
}
|
|
296
|
-
),
|
|
297
|
-
open && /* @__PURE__ */ jsxs2("div", { ref: popoverRef, className: "absolute bottom-full left-0 z-50 mb-2 w-[420px] max-w-[calc(100vw-2rem)] overflow-hidden rounded-xl border border-border bg-card shadow-lg", children: [
|
|
298
|
-
/* @__PURE__ */ jsx2("div", { className: "border-b border-border px-3 py-2", children: /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-2 rounded-lg border border-border bg-background px-3 py-2", children: [
|
|
299
|
-
/* @__PURE__ */ jsx2(SearchGlyph, { className: "h-3.5 w-3.5 text-muted-foreground" }),
|
|
300
|
-
/* @__PURE__ */ jsx2(
|
|
301
|
-
"input",
|
|
302
|
-
{
|
|
303
|
-
ref: inputRef,
|
|
304
|
-
type: "text",
|
|
305
|
-
value: query,
|
|
306
|
-
onChange: (e) => setQuery(e.target.value),
|
|
307
|
-
placeholder: "Search models...",
|
|
308
|
-
className: "flex-1 bg-transparent text-sm placeholder:text-muted-foreground"
|
|
309
|
-
}
|
|
310
|
-
)
|
|
311
|
-
] }) }),
|
|
312
|
-
/* @__PURE__ */ jsxs2("div", { className: "max-h-[400px] overflow-y-auto p-1 pb-2", children: [
|
|
313
|
-
loading && /* @__PURE__ */ jsx2("div", { className: "px-3 py-4 text-center text-sm text-muted-foreground", children: "Loading models..." }),
|
|
314
|
-
!loading && filtered && /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
315
|
-
filtered.length === 0 && /* @__PURE__ */ jsx2("div", { className: "px-3 py-4 text-center text-sm text-muted-foreground", children: "No models match your search" }),
|
|
316
|
-
filtered.map((m) => /* @__PURE__ */ jsx2(ModelRow, { model: m, selected: m.id === value, onSelect: () => select(m.id), renderProviderBadge }, m.id))
|
|
317
|
-
] }),
|
|
318
|
-
!loading && !filtered && models.length === 0 && /* @__PURE__ */ jsx2("div", { className: "px-3 py-4 text-center text-sm text-muted-foreground", children: "No models available" }),
|
|
319
|
-
!loading && !filtered && models.length > 0 && /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
320
|
-
priorityGroup && sections.priority.length > 0 && /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
321
|
-
/* @__PURE__ */ jsx2(SectionHeader, { children: priorityGroup.label }),
|
|
322
|
-
sections.priority.map((m) => /* @__PURE__ */ jsx2(ModelRow, { model: m, selected: m.id === value, onSelect: () => select(m.id), renderProviderBadge }, m.id))
|
|
323
|
-
] }),
|
|
324
|
-
sections.recommended.length > 0 && /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
325
|
-
/* @__PURE__ */ jsx2(SectionHeader, { children: recommendedLabel }),
|
|
326
|
-
sections.recommended.map((m) => /* @__PURE__ */ jsx2(ModelRow, { model: m, selected: m.id === value, onSelect: () => select(m.id), renderProviderBadge }, m.id))
|
|
327
|
-
] }),
|
|
328
|
-
sections.byProvider.map((g) => /* @__PURE__ */ jsxs2("div", { children: [
|
|
329
|
-
/* @__PURE__ */ jsx2(SectionHeader, { children: g.provider }),
|
|
330
|
-
g.items.map((m) => /* @__PURE__ */ jsx2(ModelRow, { model: m, selected: m.id === value, onSelect: () => select(m.id), renderProviderBadge }, m.id))
|
|
331
|
-
] }, g.provider))
|
|
332
|
-
] })
|
|
333
|
-
] })
|
|
334
|
-
] })
|
|
335
|
-
] });
|
|
336
|
-
}
|
|
337
|
-
var DEFAULT_EFFORT_LEVELS = [
|
|
338
|
-
{ id: "off", label: "Off" },
|
|
339
|
-
{ id: "low", label: "Quick" },
|
|
340
|
-
{ id: "medium", label: "Standard" },
|
|
341
|
-
{ id: "high", label: "Extended" }
|
|
342
|
-
];
|
|
343
|
-
function EffortPicker({ value, onChange, levels = DEFAULT_EFFORT_LEVELS, label = "Thinking" }) {
|
|
344
|
-
const [open, setOpen] = useState2(false);
|
|
345
|
-
const { containerRef, triggerProps } = usePopover(open, setOpen);
|
|
346
|
-
const selected = levels.find((l) => l.id === value) ?? levels[2] ?? levels[0];
|
|
347
|
-
return /* @__PURE__ */ jsxs2("div", { ref: containerRef, className: "relative inline-flex", children: [
|
|
348
|
-
/* @__PURE__ */ jsxs2(
|
|
349
|
-
"button",
|
|
350
|
-
{
|
|
351
|
-
type: "button",
|
|
352
|
-
...triggerProps,
|
|
353
|
-
onClick: () => setOpen(!open),
|
|
354
|
-
title: label ? `${label} \u2014 how hard the agent reasons before answering` : "Reasoning effort",
|
|
355
|
-
className: "inline-flex min-h-[36px] items-center gap-1.5 rounded-full border border-border bg-card px-3 py-1.5 text-sm font-medium text-foreground transition hover:bg-accent/30",
|
|
356
|
-
children: [
|
|
357
|
-
/* @__PURE__ */ jsx2(SparkleGlyph, { className: "h-3.5 w-3.5 text-muted-foreground" }),
|
|
358
|
-
/* @__PURE__ */ jsxs2("span", { children: [
|
|
359
|
-
label ? /* @__PURE__ */ jsxs2("span", { className: "text-muted-foreground", children: [
|
|
360
|
-
label,
|
|
361
|
-
": "
|
|
362
|
-
] }) : null,
|
|
363
|
-
selected?.label
|
|
364
|
-
] }),
|
|
365
|
-
/* @__PURE__ */ jsx2(ChevronDown, { className: "h-3.5 w-3.5 text-muted-foreground" })
|
|
366
|
-
]
|
|
367
|
-
}
|
|
368
|
-
),
|
|
369
|
-
open && /* @__PURE__ */ jsx2("div", { role: "menu", className: "absolute bottom-full left-0 z-50 mb-2 w-40 overflow-hidden rounded-xl border border-border bg-card p-1 shadow-lg", children: levels.map((l) => /* @__PURE__ */ jsx2(
|
|
370
|
-
"button",
|
|
371
|
-
{
|
|
372
|
-
type: "button",
|
|
373
|
-
role: "menuitemradio",
|
|
374
|
-
"aria-checked": l.id === value,
|
|
375
|
-
onClick: () => {
|
|
376
|
-
onChange(l.id);
|
|
377
|
-
setOpen(false);
|
|
378
|
-
},
|
|
379
|
-
className: `flex min-h-[40px] w-full items-center rounded-md px-3 py-2 text-left text-sm transition ${POPOVER_OPTION_FOCUS} ${l.id === value ? "bg-primary/10 font-medium" : "hover:bg-accent/30"}`,
|
|
380
|
-
children: l.label
|
|
381
|
-
},
|
|
382
|
-
l.id
|
|
383
|
-
)) })
|
|
384
|
-
] });
|
|
385
|
-
}
|
|
386
|
-
|
|
387
82
|
// src/web-react/brand-mark.tsx
|
|
388
83
|
import { lazy, Suspense } from "react";
|
|
389
|
-
import { jsx
|
|
84
|
+
import { jsx } from "react/jsx-runtime";
|
|
390
85
|
function MarkSpacer({ size = 24, className }) {
|
|
391
|
-
return /* @__PURE__ */
|
|
86
|
+
return /* @__PURE__ */ jsx("span", { "aria-hidden": true, style: { display: "inline-block", width: size, height: size }, className });
|
|
392
87
|
}
|
|
393
88
|
var LazyKnot = lazy(async () => {
|
|
394
89
|
try {
|
|
@@ -399,14 +94,14 @@ var LazyKnot = lazy(async () => {
|
|
|
399
94
|
}
|
|
400
95
|
});
|
|
401
96
|
function BrandMark({ size = 24, className }) {
|
|
402
|
-
return /* @__PURE__ */
|
|
97
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(MarkSpacer, { size, className }), children: /* @__PURE__ */ jsx(LazyKnot, { size, className }) });
|
|
403
98
|
}
|
|
404
99
|
|
|
405
100
|
// src/web-react/durable-plan-card.tsx
|
|
406
|
-
import { useEffect as
|
|
101
|
+
import { useEffect as useEffect3, useState as useState3 } from "react";
|
|
407
102
|
|
|
408
103
|
// src/web-react/interaction-question-card.tsx
|
|
409
|
-
import { useEffect as
|
|
104
|
+
import { useEffect as useEffect2, useMemo, useRef as useRef2, useState as useState2 } from "react";
|
|
410
105
|
|
|
411
106
|
// src/web-react/interaction-card-support.ts
|
|
412
107
|
function interactionStatusLabels(labels) {
|
|
@@ -565,9 +260,9 @@ function createInteractionAnswerSubmitter(options) {
|
|
|
565
260
|
}
|
|
566
261
|
|
|
567
262
|
// src/web-react/interaction-question-card.tsx
|
|
568
|
-
import { Fragment
|
|
263
|
+
import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
569
264
|
function CheckGlyph({ className }) {
|
|
570
|
-
return /* @__PURE__ */
|
|
265
|
+
return /* @__PURE__ */ jsx2("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx2("path", { d: "M20 6 9 17l-5-5" }) });
|
|
571
266
|
}
|
|
572
267
|
var BADGE_VARIANT_CLASSES = {
|
|
573
268
|
outline: "border-border text-foreground",
|
|
@@ -575,7 +270,7 @@ var BADGE_VARIANT_CLASSES = {
|
|
|
575
270
|
destructive: "border-transparent bg-destructive/15 text-destructive"
|
|
576
271
|
};
|
|
577
272
|
function InteractionBadge({ variant, children }) {
|
|
578
|
-
return /* @__PURE__ */
|
|
273
|
+
return /* @__PURE__ */ jsx2("span", { className: `inline-flex items-center rounded-md border px-2 py-0.5 text-xs font-medium ${BADGE_VARIANT_CLASSES[variant]}`, children });
|
|
579
274
|
}
|
|
580
275
|
function InteractionActionButton({
|
|
581
276
|
variant = "primary",
|
|
@@ -584,7 +279,7 @@ function InteractionActionButton({
|
|
|
584
279
|
children
|
|
585
280
|
}) {
|
|
586
281
|
const variantClasses = variant === "primary" ? "bg-primary text-primary-foreground shadow-sm hover:bg-primary/90" : "border border-border bg-transparent text-foreground hover:bg-accent/40";
|
|
587
|
-
return /* @__PURE__ */
|
|
282
|
+
return /* @__PURE__ */ jsx2(
|
|
588
283
|
"button",
|
|
589
284
|
{
|
|
590
285
|
type: "button",
|
|
@@ -605,11 +300,11 @@ function QuestionOptionList({
|
|
|
605
300
|
disabled,
|
|
606
301
|
onToggle
|
|
607
302
|
}) {
|
|
608
|
-
return /* @__PURE__ */
|
|
303
|
+
return /* @__PURE__ */ jsx2(Fragment, { children: options.map((option, optionIndex) => {
|
|
609
304
|
const inputId = `${idPrefix}-${optionIndex}`;
|
|
610
305
|
const checked = selectedValues.includes(option.value);
|
|
611
|
-
return /* @__PURE__ */
|
|
612
|
-
/* @__PURE__ */
|
|
306
|
+
return /* @__PURE__ */ jsxs("label", { htmlFor: inputId, className: "flex cursor-pointer gap-2 rounded-lg border border-border/70 p-3 transition-colors hover:bg-muted/50", children: [
|
|
307
|
+
/* @__PURE__ */ jsx2(
|
|
613
308
|
"input",
|
|
614
309
|
{
|
|
615
310
|
id: inputId,
|
|
@@ -624,9 +319,9 @@ function QuestionOptionList({
|
|
|
624
319
|
className: "mt-0.5 h-4 w-4 shrink-0 accent-primary"
|
|
625
320
|
}
|
|
626
321
|
),
|
|
627
|
-
/* @__PURE__ */
|
|
628
|
-
/* @__PURE__ */
|
|
629
|
-
option.description && /* @__PURE__ */
|
|
322
|
+
/* @__PURE__ */ jsxs("span", { className: "min-w-0", children: [
|
|
323
|
+
/* @__PURE__ */ jsx2("span", { id: `${inputId}-label`, className: "block text-sm font-medium leading-5 text-foreground", children: option.label }),
|
|
324
|
+
option.description && /* @__PURE__ */ jsx2("span", { id: `${inputId}-description`, className: "mt-0.5 block text-xs leading-5 text-muted-foreground", children: option.description })
|
|
630
325
|
] })
|
|
631
326
|
] }, `${option.value}-${optionIndex}`);
|
|
632
327
|
}) });
|
|
@@ -670,13 +365,13 @@ function InteractionQuestionCard({
|
|
|
670
365
|
renderMarkdown,
|
|
671
366
|
className
|
|
672
367
|
}) {
|
|
673
|
-
const [values, setValues] =
|
|
674
|
-
const [submitting, setSubmitting] =
|
|
675
|
-
const [localStatus, setLocalStatus] =
|
|
676
|
-
const [lateAnswerSent, setLateAnswerSent] =
|
|
677
|
-
const [error, setError] =
|
|
678
|
-
const submitInFlightRef =
|
|
679
|
-
const [askId, setAskId] =
|
|
368
|
+
const [values, setValues] = useState2(() => fieldValuesFromAnswers(interaction.fields, interaction.answers));
|
|
369
|
+
const [submitting, setSubmitting] = useState2(false);
|
|
370
|
+
const [localStatus, setLocalStatus] = useState2(null);
|
|
371
|
+
const [lateAnswerSent, setLateAnswerSent] = useState2(false);
|
|
372
|
+
const [error, setError] = useState2(null);
|
|
373
|
+
const submitInFlightRef = useRef2(false);
|
|
374
|
+
const [askId, setAskId] = useState2(interaction.id);
|
|
680
375
|
if (askId !== interaction.id) {
|
|
681
376
|
setAskId(interaction.id);
|
|
682
377
|
setValues(fieldValuesFromAnswers(interaction.fields, interaction.answers));
|
|
@@ -684,7 +379,7 @@ function InteractionQuestionCard({
|
|
|
684
379
|
setLateAnswerSent(false);
|
|
685
380
|
setError(null);
|
|
686
381
|
}
|
|
687
|
-
|
|
382
|
+
useEffect2(() => {
|
|
688
383
|
if (!interaction.answers) return;
|
|
689
384
|
setValues(fieldValuesFromAnswers(interaction.fields, interaction.answers));
|
|
690
385
|
}, [interaction.answers, interaction.fields]);
|
|
@@ -694,7 +389,7 @@ function InteractionQuestionCard({
|
|
|
694
389
|
const secretLateAnswerBlocked = lateAnswerable && hasSecretField(interaction.fields);
|
|
695
390
|
const canLateAnswer = canWrite && lateAnswerable && !lateAnswerSent && !secretLateAnswerBlocked;
|
|
696
391
|
const disabled = !canWrite || status !== "pending" && !canLateAnswer || submitting;
|
|
697
|
-
const answerData =
|
|
392
|
+
const answerData = useMemo(() => buildAnswerData(interaction.fields, values), [interaction.fields, values]);
|
|
698
393
|
const setFieldValue = (name, patch) => {
|
|
699
394
|
setValues((prev) => ({ ...prev, [name]: { ...prev[name], ...patch } }));
|
|
700
395
|
};
|
|
@@ -761,24 +456,24 @@ function InteractionQuestionCard({
|
|
|
761
456
|
} else if (submitting) {
|
|
762
457
|
submitLabel = "Submitting\u2026";
|
|
763
458
|
}
|
|
764
|
-
return /* @__PURE__ */
|
|
765
|
-
/* @__PURE__ */
|
|
766
|
-
/* @__PURE__ */
|
|
767
|
-
/* @__PURE__ */
|
|
768
|
-
/* @__PURE__ */
|
|
459
|
+
return /* @__PURE__ */ jsxs("div", { className: `rounded-xl border border-border bg-card p-4 shadow-sm ${className ?? ""}`, children: [
|
|
460
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-3 flex flex-wrap items-center justify-between gap-2", children: [
|
|
461
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
462
|
+
/* @__PURE__ */ jsx2(InteractionBadge, { variant: "outline", children: kindLabel ?? "Question" }),
|
|
463
|
+
/* @__PURE__ */ jsx2(InteractionBadge, { variant: answered ? "default" : status === "expired" || status === "declined" ? "destructive" : "outline", children: STATUS_LABELS[status] })
|
|
769
464
|
] }),
|
|
770
|
-
/* @__PURE__ */
|
|
465
|
+
/* @__PURE__ */ jsx2("span", { className: "text-xs text-muted-foreground", children: sourceNote ?? "The agent asked for input" })
|
|
771
466
|
] }),
|
|
772
|
-
interaction.title.trim() && interaction.fields.every((field) => field.label !== interaction.title) && /* @__PURE__ */
|
|
773
|
-
interaction.body && (renderMarkdown ? /* @__PURE__ */
|
|
774
|
-
/* @__PURE__ */
|
|
467
|
+
interaction.title.trim() && interaction.fields.every((field) => field.label !== interaction.title) && /* @__PURE__ */ jsx2("p", { className: "mb-3 text-sm font-medium leading-5 text-foreground", children: interaction.title }),
|
|
468
|
+
interaction.body && (renderMarkdown ? /* @__PURE__ */ jsx2("div", { className: "mb-3 text-sm leading-5 text-muted-foreground", children: renderMarkdown(interaction.body) }) : /* @__PURE__ */ jsx2("p", { className: "mb-3 text-sm leading-5 text-muted-foreground", children: interaction.body })),
|
|
469
|
+
/* @__PURE__ */ jsx2("div", { className: "space-y-4", children: interaction.fields.map((field) => {
|
|
775
470
|
const value = values[field.name] ?? {};
|
|
776
471
|
const select = selectField(field);
|
|
777
472
|
const freeText = freeTextField(field);
|
|
778
|
-
return /* @__PURE__ */
|
|
779
|
-
/* @__PURE__ */
|
|
780
|
-
select ? /* @__PURE__ */
|
|
781
|
-
/* @__PURE__ */
|
|
473
|
+
return /* @__PURE__ */ jsxs("fieldset", { className: "space-y-2", children: [
|
|
474
|
+
/* @__PURE__ */ jsx2("p", { className: "text-sm font-medium leading-5 text-foreground", children: field.label }),
|
|
475
|
+
select ? /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
476
|
+
/* @__PURE__ */ jsx2(
|
|
782
477
|
QuestionOptionList,
|
|
783
478
|
{
|
|
784
479
|
groupName: `${interaction.id}-${field.name}`,
|
|
@@ -790,7 +485,7 @@ function InteractionQuestionCard({
|
|
|
790
485
|
onToggle: (optionValue) => toggleSelected(select, optionValue)
|
|
791
486
|
}
|
|
792
487
|
),
|
|
793
|
-
select.allowCustom === true && /* @__PURE__ */
|
|
488
|
+
select.allowCustom === true && /* @__PURE__ */ jsx2(
|
|
794
489
|
"input",
|
|
795
490
|
{
|
|
796
491
|
type: "text",
|
|
@@ -802,8 +497,8 @@ function InteractionQuestionCard({
|
|
|
802
497
|
className: FIELD_INPUT_CLASSES
|
|
803
498
|
}
|
|
804
499
|
)
|
|
805
|
-
] }) : field.type === "boolean" ? /* @__PURE__ */
|
|
806
|
-
/* @__PURE__ */
|
|
500
|
+
] }) : field.type === "boolean" ? /* @__PURE__ */ jsx2("div", { className: "flex gap-4", children: ["true", "false"].map((boolValue) => /* @__PURE__ */ jsxs("label", { className: "flex cursor-pointer items-center gap-2 text-sm text-foreground", children: [
|
|
501
|
+
/* @__PURE__ */ jsx2(
|
|
807
502
|
"input",
|
|
808
503
|
{
|
|
809
504
|
type: "radio",
|
|
@@ -816,7 +511,7 @@ function InteractionQuestionCard({
|
|
|
816
511
|
}
|
|
817
512
|
),
|
|
818
513
|
boolValue === "true" ? "Yes" : "No"
|
|
819
|
-
] }, boolValue)) }) : field.type === "number" ? /* @__PURE__ */
|
|
514
|
+
] }, boolValue)) }) : field.type === "number" ? /* @__PURE__ */ jsx2(
|
|
820
515
|
"input",
|
|
821
516
|
{
|
|
822
517
|
type: "number",
|
|
@@ -826,7 +521,7 @@ function InteractionQuestionCard({
|
|
|
826
521
|
onChange: (event) => setFieldValue(field.name, { text: event.target.value }),
|
|
827
522
|
className: FIELD_INPUT_CLASSES
|
|
828
523
|
}
|
|
829
|
-
) : field.type === "secret" ? /* @__PURE__ */
|
|
524
|
+
) : field.type === "secret" ? /* @__PURE__ */ jsx2(
|
|
830
525
|
"input",
|
|
831
526
|
{
|
|
832
527
|
type: "password",
|
|
@@ -838,7 +533,7 @@ function InteractionQuestionCard({
|
|
|
838
533
|
maxLength: freeText ? textFieldMaxLength(freeText) : void 0,
|
|
839
534
|
className: FIELD_INPUT_CLASSES
|
|
840
535
|
}
|
|
841
|
-
) : /* @__PURE__ */
|
|
536
|
+
) : /* @__PURE__ */ jsx2(
|
|
842
537
|
"textarea",
|
|
843
538
|
{
|
|
844
539
|
value: value.text ?? "",
|
|
@@ -853,25 +548,25 @@ function InteractionQuestionCard({
|
|
|
853
548
|
)
|
|
854
549
|
] }, field.name);
|
|
855
550
|
}) }),
|
|
856
|
-
error && /* @__PURE__ */
|
|
857
|
-
terminalNote && /* @__PURE__ */
|
|
858
|
-
(showSubmitButton || showTimeoutNote) && /* @__PURE__ */
|
|
859
|
-
showTimeoutNote && /* @__PURE__ */
|
|
860
|
-
showSubmitButton && /* @__PURE__ */
|
|
551
|
+
error && /* @__PURE__ */ jsx2("p", { role: "alert", className: "mt-3 text-xs text-destructive", children: error }),
|
|
552
|
+
terminalNote && /* @__PURE__ */ jsx2("p", { className: "mt-3 text-xs text-muted-foreground", children: terminalNote }),
|
|
553
|
+
(showSubmitButton || showTimeoutNote) && /* @__PURE__ */ jsxs("div", { className: "mt-4 flex flex-wrap items-center justify-end gap-2", children: [
|
|
554
|
+
showTimeoutNote && /* @__PURE__ */ jsx2("div", { className: "mr-auto text-xs text-muted-foreground", children: timeoutNote }),
|
|
555
|
+
showSubmitButton && /* @__PURE__ */ jsx2(InteractionActionButton, { onClick: () => void submit(), disabled: disabled || !answerData, children: submitLabel })
|
|
861
556
|
] }),
|
|
862
|
-
answered && /* @__PURE__ */
|
|
863
|
-
/* @__PURE__ */
|
|
557
|
+
answered && /* @__PURE__ */ jsx2("div", { className: "mt-4 flex items-center justify-end", children: /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
558
|
+
/* @__PURE__ */ jsx2(CheckGlyph, { className: "h-3 w-3" }),
|
|
864
559
|
"Answered"
|
|
865
560
|
] }) }),
|
|
866
|
-
lateAnswerSent && /* @__PURE__ */
|
|
867
|
-
/* @__PURE__ */
|
|
561
|
+
lateAnswerSent && /* @__PURE__ */ jsx2("div", { className: "mt-4 flex items-center justify-end", children: /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
562
|
+
/* @__PURE__ */ jsx2(CheckGlyph, { className: "h-3 w-3" }),
|
|
868
563
|
"Sent as new message"
|
|
869
564
|
] }) })
|
|
870
565
|
] });
|
|
871
566
|
}
|
|
872
567
|
|
|
873
568
|
// src/web-react/durable-plan-card.tsx
|
|
874
|
-
import { jsx as
|
|
569
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
875
570
|
function statusLabel(plan) {
|
|
876
571
|
switch (plan.status) {
|
|
877
572
|
case "pending":
|
|
@@ -897,10 +592,10 @@ function DurablePlanCard({
|
|
|
897
592
|
renderMarkdown,
|
|
898
593
|
className
|
|
899
594
|
}) {
|
|
900
|
-
const [feedback, setFeedback] =
|
|
901
|
-
const [expanded, setExpanded] =
|
|
902
|
-
const [localError, setLocalError] =
|
|
903
|
-
|
|
595
|
+
const [feedback, setFeedback] = useState3("");
|
|
596
|
+
const [expanded, setExpanded] = useState3(false);
|
|
597
|
+
const [localError, setLocalError] = useState3(null);
|
|
598
|
+
useEffect3(() => setLocalError(null), [plan.planId, plan.revision, plan.status]);
|
|
904
599
|
const actionable = plan.status === "pending";
|
|
905
600
|
const disabled = !canWrite || !actionable || deciding !== null;
|
|
906
601
|
async function submit(decision) {
|
|
@@ -912,22 +607,22 @@ function DurablePlanCard({
|
|
|
912
607
|
setLocalError(null);
|
|
913
608
|
await decide(decision, decision === "rejected" ? trimmed : void 0);
|
|
914
609
|
}
|
|
915
|
-
return /* @__PURE__ */
|
|
916
|
-
/* @__PURE__ */
|
|
917
|
-
/* @__PURE__ */
|
|
918
|
-
/* @__PURE__ */
|
|
919
|
-
/* @__PURE__ */
|
|
610
|
+
return /* @__PURE__ */ jsxs2("div", { className: `rounded-xl border border-primary/40 bg-card p-4 shadow-sm ${className ?? ""}`, children: [
|
|
611
|
+
/* @__PURE__ */ jsxs2("div", { className: "mb-3 flex flex-wrap items-center justify-between gap-2", children: [
|
|
612
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
613
|
+
/* @__PURE__ */ jsx3(InteractionBadge, { variant: "outline", children: "Plan decision" }),
|
|
614
|
+
/* @__PURE__ */ jsx3(InteractionBadge, { variant: plan.status === "approved" ? "default" : plan.status === "rejected" || plan.status === "withdrawn" ? "destructive" : "outline", children: statusLabel(plan) })
|
|
920
615
|
] }),
|
|
921
|
-
/* @__PURE__ */
|
|
616
|
+
/* @__PURE__ */ jsxs2("span", { className: "text-xs text-muted-foreground", children: [
|
|
922
617
|
"Revision ",
|
|
923
618
|
plan.revision
|
|
924
619
|
] })
|
|
925
620
|
] }),
|
|
926
|
-
plan.title && /* @__PURE__ */
|
|
927
|
-
/* @__PURE__ */
|
|
928
|
-
/* @__PURE__ */
|
|
929
|
-
!expanded && /* @__PURE__ */
|
|
930
|
-
/* @__PURE__ */
|
|
621
|
+
plan.title && /* @__PURE__ */ jsx3("p", { className: "mb-3 text-sm font-medium leading-5 text-foreground", children: plan.title }),
|
|
622
|
+
/* @__PURE__ */ jsxs2("div", { className: "relative", children: [
|
|
623
|
+
/* @__PURE__ */ jsx3("div", { className: "overflow-hidden text-sm", style: expanded ? void 0 : { maxHeight: 320 }, children: renderMarkdown ? renderMarkdown(plan.body) : /* @__PURE__ */ jsx3("p", { className: "whitespace-pre-wrap leading-5", children: plan.body }) }),
|
|
624
|
+
!expanded && /* @__PURE__ */ jsx3("div", { className: "pointer-events-none absolute inset-x-0 bottom-0 h-12 bg-gradient-to-t from-card to-transparent" }),
|
|
625
|
+
/* @__PURE__ */ jsx3(
|
|
931
626
|
"button",
|
|
932
627
|
{
|
|
933
628
|
type: "button",
|
|
@@ -937,9 +632,9 @@ function DurablePlanCard({
|
|
|
937
632
|
}
|
|
938
633
|
)
|
|
939
634
|
] }),
|
|
940
|
-
actionable && /* @__PURE__ */
|
|
941
|
-
/* @__PURE__ */
|
|
942
|
-
/* @__PURE__ */
|
|
635
|
+
actionable && /* @__PURE__ */ jsxs2("div", { className: "mt-3 space-y-2", children: [
|
|
636
|
+
/* @__PURE__ */ jsx3("label", { className: "block text-sm font-medium leading-5 text-foreground", htmlFor: `durable-plan-feedback-${plan.planId}-${plan.revision}`, children: "Feedback for requested changes" }),
|
|
637
|
+
/* @__PURE__ */ jsx3(
|
|
943
638
|
"textarea",
|
|
944
639
|
{
|
|
945
640
|
id: `durable-plan-feedback-${plan.planId}-${plan.revision}`,
|
|
@@ -952,22 +647,22 @@ function DurablePlanCard({
|
|
|
952
647
|
}
|
|
953
648
|
)
|
|
954
649
|
] }),
|
|
955
|
-
(localError ?? error) && /* @__PURE__ */
|
|
956
|
-
actionable && /* @__PURE__ */
|
|
957
|
-
/* @__PURE__ */
|
|
958
|
-
/* @__PURE__ */
|
|
650
|
+
(localError ?? error) && /* @__PURE__ */ jsx3("p", { className: "mt-3 text-xs text-destructive", children: localError ?? error }),
|
|
651
|
+
actionable && /* @__PURE__ */ jsxs2("div", { className: "mt-4 flex items-center justify-end gap-2", children: [
|
|
652
|
+
/* @__PURE__ */ jsx3(InteractionActionButton, { variant: "outline", onClick: () => void submit("rejected"), disabled, children: deciding === "rejected" ? "Sending\u2026" : "Request changes" }),
|
|
653
|
+
/* @__PURE__ */ jsx3(InteractionActionButton, { onClick: () => void submit("approved"), disabled, children: deciding === "approved" ? "Approving\u2026" : "Approve plan" })
|
|
959
654
|
] })
|
|
960
655
|
] });
|
|
961
656
|
}
|
|
962
657
|
|
|
963
658
|
// src/web-react/interaction-plan-card.tsx
|
|
964
|
-
import { useMemo as
|
|
965
|
-
import { jsx as
|
|
659
|
+
import { useMemo as useMemo2, useRef as useRef3, useState as useState4 } from "react";
|
|
660
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
966
661
|
function CheckGlyph2({ className }) {
|
|
967
|
-
return /* @__PURE__ */
|
|
662
|
+
return /* @__PURE__ */ jsx4("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx4("path", { d: "M20 6 9 17l-5-5" }) });
|
|
968
663
|
}
|
|
969
664
|
function ChevronDownGlyph({ className }) {
|
|
970
|
-
return /* @__PURE__ */
|
|
665
|
+
return /* @__PURE__ */ jsx4("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx4("path", { d: "m6 9 6 6 6-6" }) });
|
|
971
666
|
}
|
|
972
667
|
var STATUS_LABELS2 = interactionStatusLabels({
|
|
973
668
|
pending: "Waiting for your approval",
|
|
@@ -989,19 +684,19 @@ function InteractionPlanCard({
|
|
|
989
684
|
renderMarkdown,
|
|
990
685
|
className
|
|
991
686
|
}) {
|
|
992
|
-
const [values, setValues] =
|
|
993
|
-
const [expanded, setExpanded] =
|
|
994
|
-
const [submitting, setSubmitting] =
|
|
995
|
-
const [localStatus, setLocalStatus] =
|
|
996
|
-
const [reRequested, setReRequested] =
|
|
997
|
-
const [error, setError] =
|
|
998
|
-
const submitInFlightRef =
|
|
687
|
+
const [values, setValues] = useState4({});
|
|
688
|
+
const [expanded, setExpanded] = useState4(false);
|
|
689
|
+
const [submitting, setSubmitting] = useState4(null);
|
|
690
|
+
const [localStatus, setLocalStatus] = useState4(null);
|
|
691
|
+
const [reRequested, setReRequested] = useState4(false);
|
|
692
|
+
const [error, setError] = useState4(null);
|
|
693
|
+
const submitInFlightRef = useRef3(false);
|
|
999
694
|
const status = isTerminalInteractionStatus(interaction.status) ? interaction.status : localStatus ?? interaction.status;
|
|
1000
695
|
const reRequestable = isLateAnswerableStatus(status) && onReRequest !== void 0;
|
|
1001
696
|
const canReRequest = canWrite && reRequestable && !reRequested;
|
|
1002
697
|
const disabled = !canWrite || status !== "pending" || submitting !== null;
|
|
1003
|
-
const approveData =
|
|
1004
|
-
const rejectData =
|
|
698
|
+
const approveData = useMemo2(() => buildAnswerData(interaction.fields, values), [interaction.fields, values]);
|
|
699
|
+
const rejectData = useMemo2(() => {
|
|
1005
700
|
const data = {};
|
|
1006
701
|
for (const field of interaction.fields) {
|
|
1007
702
|
const answer = fieldAnswer(field, values);
|
|
@@ -1056,41 +751,41 @@ function InteractionPlanCard({
|
|
|
1056
751
|
}
|
|
1057
752
|
const terminalNote = TERMINAL_NOTES2[status];
|
|
1058
753
|
const approved = status === "answered";
|
|
1059
|
-
return /* @__PURE__ */
|
|
1060
|
-
/* @__PURE__ */
|
|
1061
|
-
/* @__PURE__ */
|
|
1062
|
-
/* @__PURE__ */
|
|
1063
|
-
/* @__PURE__ */
|
|
754
|
+
return /* @__PURE__ */ jsxs3("div", { className: `rounded-xl border border-border bg-card p-4 shadow-sm ${className ?? ""}`, children: [
|
|
755
|
+
/* @__PURE__ */ jsxs3("div", { className: "mb-3 flex flex-wrap items-center justify-between gap-2", children: [
|
|
756
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
757
|
+
/* @__PURE__ */ jsx4(InteractionBadge, { variant: "outline", children: "Plan" }),
|
|
758
|
+
/* @__PURE__ */ jsx4(InteractionBadge, { variant: approved ? "default" : status === "expired" || status === "declined" ? "destructive" : "outline", children: STATUS_LABELS2[status] })
|
|
1064
759
|
] }),
|
|
1065
|
-
/* @__PURE__ */
|
|
760
|
+
/* @__PURE__ */ jsx4("span", { className: "text-xs text-muted-foreground", children: "The agent proposed a plan" })
|
|
1066
761
|
] }),
|
|
1067
|
-
interaction.title.trim() && /* @__PURE__ */
|
|
1068
|
-
interaction.body && /* @__PURE__ */
|
|
1069
|
-
/* @__PURE__ */
|
|
762
|
+
interaction.title.trim() && /* @__PURE__ */ jsx4("p", { className: "mb-3 text-sm font-medium leading-5 text-foreground", children: interaction.title }),
|
|
763
|
+
interaction.body && /* @__PURE__ */ jsxs3("div", { className: "relative", children: [
|
|
764
|
+
/* @__PURE__ */ jsx4(
|
|
1070
765
|
"div",
|
|
1071
766
|
{
|
|
1072
767
|
className: "overflow-hidden text-sm text-foreground",
|
|
1073
768
|
style: expanded ? void 0 : { maxHeight: COLLAPSED_MAX_HEIGHT },
|
|
1074
|
-
children: renderMarkdown ? renderMarkdown(interaction.body) : /* @__PURE__ */
|
|
769
|
+
children: renderMarkdown ? renderMarkdown(interaction.body) : /* @__PURE__ */ jsx4("p", { className: "whitespace-pre-wrap leading-5", children: interaction.body })
|
|
1075
770
|
}
|
|
1076
771
|
),
|
|
1077
|
-
!expanded && /* @__PURE__ */
|
|
1078
|
-
/* @__PURE__ */
|
|
772
|
+
!expanded && /* @__PURE__ */ jsx4("div", { className: "pointer-events-none absolute inset-x-0 bottom-0 h-12 bg-gradient-to-t from-card to-transparent" }),
|
|
773
|
+
/* @__PURE__ */ jsxs3(
|
|
1079
774
|
"button",
|
|
1080
775
|
{
|
|
1081
776
|
type: "button",
|
|
1082
777
|
onClick: () => setExpanded((prev) => !prev),
|
|
1083
778
|
className: "mt-1 inline-flex items-center gap-1 text-xs text-muted-foreground transition hover:text-foreground",
|
|
1084
779
|
children: [
|
|
1085
|
-
/* @__PURE__ */
|
|
780
|
+
/* @__PURE__ */ jsx4(ChevronDownGlyph, { className: `h-3 w-3 transition-transform ${expanded ? "rotate-180" : ""}` }),
|
|
1086
781
|
expanded ? "Collapse plan" : "Show full plan"
|
|
1087
782
|
]
|
|
1088
783
|
}
|
|
1089
784
|
)
|
|
1090
785
|
] }),
|
|
1091
|
-
interaction.fields.length > 0 && /* @__PURE__ */
|
|
1092
|
-
/* @__PURE__ */
|
|
1093
|
-
fieldAcceptsFreeText(field) ? /* @__PURE__ */
|
|
786
|
+
interaction.fields.length > 0 && /* @__PURE__ */ jsx4("div", { className: "mt-3 space-y-4", children: interaction.fields.map((field) => /* @__PURE__ */ jsxs3("fieldset", { className: "space-y-2", children: [
|
|
787
|
+
/* @__PURE__ */ jsx4("p", { className: "text-sm font-medium leading-5 text-foreground", children: field.label }),
|
|
788
|
+
fieldAcceptsFreeText(field) ? /* @__PURE__ */ jsx4(
|
|
1094
789
|
"textarea",
|
|
1095
790
|
{
|
|
1096
791
|
value: values[field.name]?.text ?? "",
|
|
@@ -1101,7 +796,7 @@ function InteractionPlanCard({
|
|
|
1101
796
|
placeholder: field.type === "text" ? field.placeholder ?? "Optional feedback for the agent" : void 0,
|
|
1102
797
|
className: "w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground focus:border-primary disabled:opacity-50"
|
|
1103
798
|
}
|
|
1104
|
-
) : /* @__PURE__ */
|
|
799
|
+
) : /* @__PURE__ */ jsx4(
|
|
1105
800
|
"input",
|
|
1106
801
|
{
|
|
1107
802
|
type: "text",
|
|
@@ -1113,26 +808,26 @@ function InteractionPlanCard({
|
|
|
1113
808
|
}
|
|
1114
809
|
)
|
|
1115
810
|
] }, field.name)) }),
|
|
1116
|
-
error && /* @__PURE__ */
|
|
1117
|
-
terminalNote && /* @__PURE__ */
|
|
1118
|
-
canReRequest && /* @__PURE__ */
|
|
1119
|
-
reRequested && /* @__PURE__ */
|
|
1120
|
-
/* @__PURE__ */
|
|
811
|
+
error && /* @__PURE__ */ jsx4("p", { className: "mt-3 text-xs text-destructive", children: error }),
|
|
812
|
+
terminalNote && /* @__PURE__ */ jsx4("p", { className: "mt-3 text-xs text-muted-foreground", children: terminalNote }),
|
|
813
|
+
canReRequest && /* @__PURE__ */ jsx4("div", { className: "mt-4 flex items-center justify-end", children: /* @__PURE__ */ jsx4(InteractionActionButton, { variant: "outline", onClick: () => void requestReSubmission(), disabled: submitting !== null, children: submitting === "requesting" ? "Asking\u2026" : reRequestLabel ?? DEFAULT_RE_REQUEST_LABEL }) }),
|
|
814
|
+
reRequested && /* @__PURE__ */ jsx4("div", { className: "mt-4 flex items-center justify-end", children: /* @__PURE__ */ jsxs3("span", { className: "inline-flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
815
|
+
/* @__PURE__ */ jsx4(CheckGlyph2, { className: "h-3 w-3" }),
|
|
1121
816
|
"Re-submission requested"
|
|
1122
817
|
] }) }),
|
|
1123
|
-
status === "pending" && /* @__PURE__ */
|
|
1124
|
-
/* @__PURE__ */
|
|
1125
|
-
/* @__PURE__ */
|
|
818
|
+
status === "pending" && /* @__PURE__ */ jsxs3("div", { className: "mt-4 flex items-center justify-end gap-2", children: [
|
|
819
|
+
/* @__PURE__ */ jsx4(InteractionActionButton, { variant: "outline", onClick: () => void submit("declined"), disabled, children: submitting === "reject" ? "Sending\u2026" : "Request changes" }),
|
|
820
|
+
/* @__PURE__ */ jsx4(InteractionActionButton, { onClick: () => void submit("accepted"), disabled: disabled || approveData === null, children: submitting === "approve" ? "Approving\u2026" : "Approve plan" })
|
|
1126
821
|
] }),
|
|
1127
|
-
approved && /* @__PURE__ */
|
|
1128
|
-
/* @__PURE__ */
|
|
822
|
+
approved && /* @__PURE__ */ jsx4("div", { className: "mt-4 flex items-center justify-end", children: /* @__PURE__ */ jsxs3("span", { className: "inline-flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
823
|
+
/* @__PURE__ */ jsx4(CheckGlyph2, { className: "h-3 w-3" }),
|
|
1129
824
|
"Approved"
|
|
1130
825
|
] }) })
|
|
1131
826
|
] });
|
|
1132
827
|
}
|
|
1133
828
|
|
|
1134
829
|
// src/web-react/durable-chat-cards.tsx
|
|
1135
|
-
import { jsx as
|
|
830
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
1136
831
|
function planIdentity(planId, revision) {
|
|
1137
832
|
return `${planId}:${revision}`;
|
|
1138
833
|
}
|
|
@@ -1173,9 +868,9 @@ function DurableChatCards({
|
|
|
1173
868
|
}) {
|
|
1174
869
|
const cards = durableChatCardsFromParts(parts);
|
|
1175
870
|
if (cards.length === 0) return null;
|
|
1176
|
-
return /* @__PURE__ */
|
|
871
|
+
return /* @__PURE__ */ jsx5("div", { className: `space-y-3 ${className ?? ""}`, children: cards.map((card) => {
|
|
1177
872
|
if (card.kind === "plan") {
|
|
1178
|
-
return /* @__PURE__ */
|
|
873
|
+
return /* @__PURE__ */ jsx5(
|
|
1179
874
|
DurablePlanCard,
|
|
1180
875
|
{
|
|
1181
876
|
plan: card.plan,
|
|
@@ -1189,7 +884,7 @@ function DurableChatCards({
|
|
|
1189
884
|
);
|
|
1190
885
|
}
|
|
1191
886
|
if (card.interaction.kind === "plan") {
|
|
1192
|
-
return /* @__PURE__ */
|
|
887
|
+
return /* @__PURE__ */ jsx5(
|
|
1193
888
|
InteractionPlanCard,
|
|
1194
889
|
{
|
|
1195
890
|
interaction: card.interaction,
|
|
@@ -1203,7 +898,7 @@ function DurableChatCards({
|
|
|
1203
898
|
card.key
|
|
1204
899
|
);
|
|
1205
900
|
}
|
|
1206
|
-
return /* @__PURE__ */
|
|
901
|
+
return /* @__PURE__ */ jsx5(
|
|
1207
902
|
InteractionQuestionCard,
|
|
1208
903
|
{
|
|
1209
904
|
interaction: card.interaction,
|
|
@@ -1218,23 +913,23 @@ function DurableChatCards({
|
|
|
1218
913
|
}
|
|
1219
914
|
|
|
1220
915
|
// src/web-react/message-attachments.tsx
|
|
1221
|
-
import { useCallback, useEffect as
|
|
1222
|
-
import { jsx as
|
|
916
|
+
import { useCallback, useEffect as useEffect4, useState as useState5 } from "react";
|
|
917
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1223
918
|
function FileGlyph({ className }) {
|
|
1224
|
-
return /* @__PURE__ */
|
|
1225
|
-
/* @__PURE__ */
|
|
1226
|
-
/* @__PURE__ */
|
|
919
|
+
return /* @__PURE__ */ jsxs4("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
|
|
920
|
+
/* @__PURE__ */ jsx6("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
|
|
921
|
+
/* @__PURE__ */ jsx6("path", { d: "M14 2v6h6" })
|
|
1227
922
|
] });
|
|
1228
923
|
}
|
|
1229
924
|
function ImageGlyph({ className }) {
|
|
1230
|
-
return /* @__PURE__ */
|
|
1231
|
-
/* @__PURE__ */
|
|
1232
|
-
/* @__PURE__ */
|
|
1233
|
-
/* @__PURE__ */
|
|
925
|
+
return /* @__PURE__ */ jsxs4("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
|
|
926
|
+
/* @__PURE__ */ jsx6("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2" }),
|
|
927
|
+
/* @__PURE__ */ jsx6("circle", { cx: "9", cy: "9", r: "2" }),
|
|
928
|
+
/* @__PURE__ */ jsx6("path", { d: "m21 15-5-5L5 21" })
|
|
1234
929
|
] });
|
|
1235
930
|
}
|
|
1236
931
|
function WarningGlyph({ className }) {
|
|
1237
|
-
return /* @__PURE__ */
|
|
932
|
+
return /* @__PURE__ */ jsx6("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx6("path", { d: "M12 9v4m0 4h.01M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0Z" }) });
|
|
1238
933
|
}
|
|
1239
934
|
function iconForMediaType(mediaType) {
|
|
1240
935
|
return mediaType?.startsWith("image/") ? ImageGlyph : FileGlyph;
|
|
@@ -1281,8 +976,8 @@ function triggerAttachmentDownload(name, blob) {
|
|
|
1281
976
|
}
|
|
1282
977
|
}
|
|
1283
978
|
function useAttachmentObjectUrl(blob) {
|
|
1284
|
-
const [url, setUrl] =
|
|
1285
|
-
|
|
979
|
+
const [url, setUrl] = useState5(null);
|
|
980
|
+
useEffect4(() => {
|
|
1286
981
|
if (!blob) {
|
|
1287
982
|
setUrl(null);
|
|
1288
983
|
return;
|
|
@@ -1294,15 +989,15 @@ function useAttachmentObjectUrl(blob) {
|
|
|
1294
989
|
return url;
|
|
1295
990
|
}
|
|
1296
991
|
function AttachmentThumbnailError({ name }) {
|
|
1297
|
-
return /* @__PURE__ */
|
|
1298
|
-
/* @__PURE__ */
|
|
1299
|
-
/* @__PURE__ */
|
|
992
|
+
return /* @__PURE__ */ jsxs4("span", { className: "inline-flex h-16 w-16 shrink-0 flex-col items-center justify-center gap-1 rounded-md border border-destructive/40 bg-destructive/10 px-1 text-center text-destructive", children: [
|
|
993
|
+
/* @__PURE__ */ jsx6(WarningGlyph, { className: "h-4 w-4 shrink-0" }),
|
|
994
|
+
/* @__PURE__ */ jsx6("span", { className: "line-clamp-2 text-[10px] leading-tight", children: name })
|
|
1300
995
|
] });
|
|
1301
996
|
}
|
|
1302
997
|
function AttachmentThumbnail({ part, resolveFileUrl, fetchFile }) {
|
|
1303
998
|
const url = resolveFileUrl(part);
|
|
1304
|
-
const [result, setResult] =
|
|
1305
|
-
|
|
999
|
+
const [result, setResult] = useState5(null);
|
|
1000
|
+
useEffect4(() => {
|
|
1306
1001
|
let cancelled = false;
|
|
1307
1002
|
setResult(null);
|
|
1308
1003
|
loadAttachmentFile(url, fetchFile).then((next) => {
|
|
@@ -1318,25 +1013,25 @@ function AttachmentThumbnail({ part, resolveFileUrl, fetchFile }) {
|
|
|
1318
1013
|
window.open(objectUrl, "_blank", "noopener");
|
|
1319
1014
|
}, [objectUrl]);
|
|
1320
1015
|
if (!result) {
|
|
1321
|
-
return /* @__PURE__ */
|
|
1016
|
+
return /* @__PURE__ */ jsx6("span", { "aria-hidden": "true", className: "inline-block h-16 w-16 shrink-0 animate-pulse rounded-md bg-muted" });
|
|
1322
1017
|
}
|
|
1323
1018
|
if (!result.ok || !objectUrl) {
|
|
1324
|
-
return /* @__PURE__ */
|
|
1019
|
+
return /* @__PURE__ */ jsx6(AttachmentThumbnailError, { name: part.name });
|
|
1325
1020
|
}
|
|
1326
|
-
return /* @__PURE__ */
|
|
1021
|
+
return /* @__PURE__ */ jsx6(
|
|
1327
1022
|
"button",
|
|
1328
1023
|
{
|
|
1329
1024
|
type: "button",
|
|
1330
1025
|
onClick: handleClick,
|
|
1331
1026
|
"aria-label": `Open ${part.name}`,
|
|
1332
1027
|
className: "h-16 w-16 shrink-0 overflow-hidden rounded-md border border-border",
|
|
1333
|
-
children: /* @__PURE__ */
|
|
1028
|
+
children: /* @__PURE__ */ jsx6("img", { src: objectUrl, alt: part.name, className: "h-16 w-16 object-cover" })
|
|
1334
1029
|
}
|
|
1335
1030
|
);
|
|
1336
1031
|
}
|
|
1337
1032
|
function AttachmentChip({ part, resolveFileUrl, fetchFile }) {
|
|
1338
|
-
const [status, setStatus] =
|
|
1339
|
-
const [errorMessage, setErrorMessage] =
|
|
1033
|
+
const [status, setStatus] = useState5("idle");
|
|
1034
|
+
const [errorMessage, setErrorMessage] = useState5(null);
|
|
1340
1035
|
const handleClick = useCallback(() => {
|
|
1341
1036
|
if (status === "loading") return;
|
|
1342
1037
|
setStatus("loading");
|
|
@@ -1362,7 +1057,7 @@ function AttachmentChip({ part, resolveFileUrl, fetchFile }) {
|
|
|
1362
1057
|
"inline-flex items-center gap-1 rounded-md border px-2 py-0.5 text-[11px]",
|
|
1363
1058
|
status === "error" ? "border-destructive/40 bg-destructive/10 text-destructive" : "border-border bg-muted/60 text-muted-foreground"
|
|
1364
1059
|
].join(" ");
|
|
1365
|
-
return /* @__PURE__ */
|
|
1060
|
+
return /* @__PURE__ */ jsxs4(
|
|
1366
1061
|
"button",
|
|
1367
1062
|
{
|
|
1368
1063
|
type: "button",
|
|
@@ -1370,9 +1065,9 @@ function AttachmentChip({ part, resolveFileUrl, fetchFile }) {
|
|
|
1370
1065
|
title: status === "error" ? errorMessage ?? void 0 : void 0,
|
|
1371
1066
|
className,
|
|
1372
1067
|
children: [
|
|
1373
|
-
/* @__PURE__ */
|
|
1068
|
+
/* @__PURE__ */ jsx6(Icon, { className: "h-3 w-3 shrink-0" }),
|
|
1374
1069
|
part.name,
|
|
1375
|
-
typeof part.size === "number" && /* @__PURE__ */
|
|
1070
|
+
typeof part.size === "number" && /* @__PURE__ */ jsxs4("span", { className: "text-muted-foreground/70", children: [
|
|
1376
1071
|
"\xB7 ",
|
|
1377
1072
|
formatBytes(part.size)
|
|
1378
1073
|
] })
|
|
@@ -1382,8 +1077,8 @@ function AttachmentChip({ part, resolveFileUrl, fetchFile }) {
|
|
|
1382
1077
|
}
|
|
1383
1078
|
function MessageAttachments({ parts, resolveFileUrl, justify = "end", fetchFile }) {
|
|
1384
1079
|
if (parts.length === 0) return null;
|
|
1385
|
-
return /* @__PURE__ */
|
|
1386
|
-
(part) => part.type === "image" ? /* @__PURE__ */
|
|
1080
|
+
return /* @__PURE__ */ jsx6("div", { className: `flex flex-wrap gap-1.5 ${justify === "start" ? "justify-start" : "justify-end"}`, children: parts.map(
|
|
1081
|
+
(part) => part.type === "image" ? /* @__PURE__ */ jsx6(AttachmentThumbnail, { part, resolveFileUrl, fetchFile }, `${part.path}:${part.name}`) : /* @__PURE__ */ jsx6(AttachmentChip, { part, resolveFileUrl, fetchFile }, `${part.path}:${part.name}`)
|
|
1387
1082
|
) });
|
|
1388
1083
|
}
|
|
1389
1084
|
|
|
@@ -1570,31 +1265,31 @@ async function streamChatTurn(opts) {
|
|
|
1570
1265
|
// src/web-react/chat-composer.tsx
|
|
1571
1266
|
import {
|
|
1572
1267
|
useCallback as useCallback2,
|
|
1573
|
-
useEffect as
|
|
1574
|
-
useRef as
|
|
1575
|
-
useState as
|
|
1268
|
+
useEffect as useEffect5,
|
|
1269
|
+
useRef as useRef4,
|
|
1270
|
+
useState as useState6
|
|
1576
1271
|
} from "react";
|
|
1577
|
-
import { Fragment as
|
|
1272
|
+
import { Fragment as Fragment2, jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1578
1273
|
function SendGlyph({ className }) {
|
|
1579
|
-
return /* @__PURE__ */
|
|
1274
|
+
return /* @__PURE__ */ jsx7("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx7("path", { d: "M22 2 11 13M22 2l-7 20-4-9-9-4 20-7z" }) });
|
|
1580
1275
|
}
|
|
1581
1276
|
function StopGlyph({ className }) {
|
|
1582
|
-
return /* @__PURE__ */
|
|
1277
|
+
return /* @__PURE__ */ jsx7("svg", { className, viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": true, children: /* @__PURE__ */ jsx7("rect", { x: "6", y: "6", width: "12", height: "12", rx: "2" }) });
|
|
1583
1278
|
}
|
|
1584
1279
|
function PaperclipGlyph({ className }) {
|
|
1585
|
-
return /* @__PURE__ */
|
|
1280
|
+
return /* @__PURE__ */ jsx7("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx7("path", { d: "m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48" }) });
|
|
1586
1281
|
}
|
|
1587
1282
|
function FolderGlyph({ className }) {
|
|
1588
|
-
return /* @__PURE__ */
|
|
1589
|
-
/* @__PURE__ */
|
|
1590
|
-
/* @__PURE__ */
|
|
1283
|
+
return /* @__PURE__ */ jsxs5("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
|
|
1284
|
+
/* @__PURE__ */ jsx7("path", { d: "M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z" }),
|
|
1285
|
+
/* @__PURE__ */ jsx7("path", { d: "M12 10v6m-3-3h6" })
|
|
1591
1286
|
] });
|
|
1592
1287
|
}
|
|
1593
1288
|
function CloseGlyph({ className }) {
|
|
1594
|
-
return /* @__PURE__ */
|
|
1289
|
+
return /* @__PURE__ */ jsx7("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx7("path", { d: "M18 6 6 18M6 6l12 12" }) });
|
|
1595
1290
|
}
|
|
1596
1291
|
function UploadGlyph({ className }) {
|
|
1597
|
-
return /* @__PURE__ */
|
|
1292
|
+
return /* @__PURE__ */ jsx7("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx7("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12" }) });
|
|
1598
1293
|
}
|
|
1599
1294
|
var MAX_HEIGHT = 168;
|
|
1600
1295
|
var DEFAULT_SEND_FAILURE = "Message not sent. Your draft is still here \u2014 try again.";
|
|
@@ -1643,15 +1338,15 @@ function ChatComposer({
|
|
|
1643
1338
|
className
|
|
1644
1339
|
}) {
|
|
1645
1340
|
const isControlled = value !== void 0;
|
|
1646
|
-
const [internal, setInternal] =
|
|
1341
|
+
const [internal, setInternal] = useState6(initialValue ?? "");
|
|
1647
1342
|
const text = isControlled ? value : internal;
|
|
1648
|
-
const textRef =
|
|
1343
|
+
const textRef = useRef4(text);
|
|
1649
1344
|
textRef.current = text;
|
|
1650
|
-
const textareaRef =
|
|
1651
|
-
const fileInputRef =
|
|
1652
|
-
const folderInputRef =
|
|
1653
|
-
const [dragOver, setDragOver] =
|
|
1654
|
-
const dragDepth =
|
|
1345
|
+
const textareaRef = useRef4(null);
|
|
1346
|
+
const fileInputRef = useRef4(null);
|
|
1347
|
+
const folderInputRef = useRef4(null);
|
|
1348
|
+
const [dragOver, setDragOver] = useState6(false);
|
|
1349
|
+
const dragDepth = useRef4(0);
|
|
1655
1350
|
const setText = useCallback2(
|
|
1656
1351
|
(next) => {
|
|
1657
1352
|
if (!isControlled) setInternal(next);
|
|
@@ -1659,15 +1354,15 @@ function ChatComposer({
|
|
|
1659
1354
|
},
|
|
1660
1355
|
[isControlled, onValueChange]
|
|
1661
1356
|
);
|
|
1662
|
-
|
|
1357
|
+
useEffect5(() => {
|
|
1663
1358
|
const el = textareaRef.current;
|
|
1664
1359
|
if (!el) return;
|
|
1665
1360
|
el.style.height = "auto";
|
|
1666
1361
|
el.style.height = `${Math.min(el.scrollHeight, MAX_HEIGHT)}px`;
|
|
1667
1362
|
}, [text]);
|
|
1668
|
-
const prevSeedRef =
|
|
1669
|
-
const pendingCaretRef =
|
|
1670
|
-
|
|
1363
|
+
const prevSeedRef = useRef4(null);
|
|
1364
|
+
const pendingCaretRef = useRef4(null);
|
|
1365
|
+
useEffect5(() => {
|
|
1671
1366
|
const prev = prevSeedRef.current;
|
|
1672
1367
|
prevSeedRef.current = seed ?? null;
|
|
1673
1368
|
if (seed == null || seed === prev || isControlled) return;
|
|
@@ -1681,7 +1376,7 @@ function ChatComposer({
|
|
|
1681
1376
|
pendingCaretRef.current = seed;
|
|
1682
1377
|
}
|
|
1683
1378
|
}, [seed, setText, onSeedApplied, isControlled]);
|
|
1684
|
-
|
|
1379
|
+
useEffect5(() => {
|
|
1685
1380
|
if (pendingCaretRef.current == null || pendingCaretRef.current !== text)
|
|
1686
1381
|
return;
|
|
1687
1382
|
pendingCaretRef.current = null;
|
|
@@ -1690,8 +1385,8 @@ function ChatComposer({
|
|
|
1690
1385
|
el.focus();
|
|
1691
1386
|
el.setSelectionRange(text.length, text.length);
|
|
1692
1387
|
}, [text]);
|
|
1693
|
-
const restoreCaretRef =
|
|
1694
|
-
|
|
1388
|
+
const restoreCaretRef = useRef4(null);
|
|
1389
|
+
useEffect5(() => {
|
|
1695
1390
|
const pending = restoreCaretRef.current;
|
|
1696
1391
|
if (!pending || pending.text !== text) return;
|
|
1697
1392
|
restoreCaretRef.current = null;
|
|
@@ -1702,7 +1397,7 @@ function ChatComposer({
|
|
|
1702
1397
|
const end = Math.min(pending.end, text.length);
|
|
1703
1398
|
el.setSelectionRange(start, end);
|
|
1704
1399
|
}, [text]);
|
|
1705
|
-
|
|
1400
|
+
useEffect5(() => {
|
|
1706
1401
|
if (!focusShortcut || disabled) return;
|
|
1707
1402
|
function onKeyDown(e) {
|
|
1708
1403
|
if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === "l") {
|
|
@@ -1716,7 +1411,7 @@ function ChatComposer({
|
|
|
1716
1411
|
const readyFileCount = pendingFiles.filter((f) => f.status === "ready").length;
|
|
1717
1412
|
const hasSendable = text.trim().length > 0 || readyFileCount > 0;
|
|
1718
1413
|
const canSend = hasSendable && !isStreaming && !disabled;
|
|
1719
|
-
const [failedSend, setFailedSend] =
|
|
1414
|
+
const [failedSend, setFailedSend] = useState6(null);
|
|
1720
1415
|
const failSend = useCallback2(
|
|
1721
1416
|
(error, draft, trimmed, parts, caret) => {
|
|
1722
1417
|
const message = sendFailureText(error, sendFailureMessage);
|
|
@@ -1828,7 +1523,7 @@ function ChatComposer({
|
|
|
1828
1523
|
const fileChips = pendingFiles.filter((f) => f.kind !== "folder");
|
|
1829
1524
|
const showAbove = controls != null && controlsPlacement === "above";
|
|
1830
1525
|
const showInline = controls != null && !showAbove;
|
|
1831
|
-
return /* @__PURE__ */
|
|
1526
|
+
return /* @__PURE__ */ jsxs5(
|
|
1832
1527
|
"div",
|
|
1833
1528
|
{
|
|
1834
1529
|
className: `relative ${className ?? ""}`,
|
|
@@ -1837,22 +1532,22 @@ function ChatComposer({
|
|
|
1837
1532
|
onDragOver: onAttach ? handleDragOver : void 0,
|
|
1838
1533
|
onDrop: onAttach ? handleDrop : void 0,
|
|
1839
1534
|
children: [
|
|
1840
|
-
dragOver && /* @__PURE__ */
|
|
1841
|
-
/* @__PURE__ */
|
|
1842
|
-
/* @__PURE__ */
|
|
1843
|
-
/* @__PURE__ */
|
|
1535
|
+
dragOver && /* @__PURE__ */ jsx7("div", { className: "pointer-events-none absolute inset-0 z-10 flex items-center justify-center rounded-2xl border-2 border-dashed border-primary/50 bg-card/95", children: /* @__PURE__ */ jsxs5("div", { className: "text-center", children: [
|
|
1536
|
+
/* @__PURE__ */ jsx7("span", { className: "mx-auto mb-2 flex h-11 w-11 items-center justify-center rounded-xl bg-primary/10 text-primary", children: /* @__PURE__ */ jsx7(UploadGlyph, { className: "h-5 w-5" }) }),
|
|
1537
|
+
/* @__PURE__ */ jsx7("p", { className: "text-sm font-semibold text-foreground", children: dropTitle }),
|
|
1538
|
+
/* @__PURE__ */ jsx7("p", { className: "mt-0.5 text-xs text-muted-foreground", children: dropDescription })
|
|
1844
1539
|
] }) }),
|
|
1845
|
-
showAbove && /* @__PURE__ */
|
|
1846
|
-
failedSend && /* @__PURE__ */
|
|
1540
|
+
showAbove && /* @__PURE__ */ jsx7("div", { className: "mb-1.5 flex flex-wrap items-center gap-1.5 px-1", children: controls }),
|
|
1541
|
+
failedSend && /* @__PURE__ */ jsxs5(
|
|
1847
1542
|
"div",
|
|
1848
1543
|
{
|
|
1849
1544
|
role: "alert",
|
|
1850
1545
|
"data-testid": "composer-send-error",
|
|
1851
1546
|
className: "mb-2 rounded-xl border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive",
|
|
1852
1547
|
children: [
|
|
1853
|
-
/* @__PURE__ */
|
|
1854
|
-
/* @__PURE__ */
|
|
1855
|
-
/* @__PURE__ */
|
|
1548
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-start gap-2", children: [
|
|
1549
|
+
/* @__PURE__ */ jsx7("span", { className: "min-w-0 flex-1", children: failedSend.message }),
|
|
1550
|
+
/* @__PURE__ */ jsx7(
|
|
1856
1551
|
"button",
|
|
1857
1552
|
{
|
|
1858
1553
|
type: "button",
|
|
@@ -1863,8 +1558,8 @@ function ChatComposer({
|
|
|
1863
1558
|
}
|
|
1864
1559
|
)
|
|
1865
1560
|
] }),
|
|
1866
|
-
!failedSend.restored && /* @__PURE__ */
|
|
1867
|
-
/* @__PURE__ */
|
|
1561
|
+
!failedSend.restored && /* @__PURE__ */ jsxs5("div", { className: "mt-1.5", children: [
|
|
1562
|
+
/* @__PURE__ */ jsx7(
|
|
1868
1563
|
"p",
|
|
1869
1564
|
{
|
|
1870
1565
|
"data-testid": "composer-unsent-draft",
|
|
@@ -1872,7 +1567,7 @@ function ChatComposer({
|
|
|
1872
1567
|
children: failedSend.text
|
|
1873
1568
|
}
|
|
1874
1569
|
),
|
|
1875
|
-
/* @__PURE__ */
|
|
1570
|
+
/* @__PURE__ */ jsx7(
|
|
1876
1571
|
"button",
|
|
1877
1572
|
{
|
|
1878
1573
|
type: "button",
|
|
@@ -1887,40 +1582,40 @@ function ChatComposer({
|
|
|
1887
1582
|
]
|
|
1888
1583
|
}
|
|
1889
1584
|
),
|
|
1890
|
-
pendingFiles.length > 0 && /* @__PURE__ */
|
|
1585
|
+
pendingFiles.length > 0 && /* @__PURE__ */ jsx7("div", { className: "mb-2 flex flex-wrap gap-1.5", children: [...folderChips, ...fileChips].map((f) => /* @__PURE__ */ jsxs5(
|
|
1891
1586
|
"span",
|
|
1892
1587
|
{
|
|
1893
1588
|
className: `inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-xs ${f.status === "error" ? "border-destructive/40 text-destructive" : "border-border bg-muted/50 text-foreground"}`,
|
|
1894
1589
|
children: [
|
|
1895
|
-
f.kind === "folder" ? /* @__PURE__ */
|
|
1896
|
-
/* @__PURE__ */
|
|
1897
|
-
f.fileCount !== void 0 && /* @__PURE__ */
|
|
1590
|
+
f.kind === "folder" ? /* @__PURE__ */ jsx7(FolderGlyph, { className: "h-3 w-3 shrink-0" }) : /* @__PURE__ */ jsx7(PaperclipGlyph, { className: "h-3 w-3 shrink-0" }),
|
|
1591
|
+
/* @__PURE__ */ jsx7("span", { className: "max-w-[150px] truncate", children: f.name }),
|
|
1592
|
+
f.fileCount !== void 0 && /* @__PURE__ */ jsxs5("span", { className: "text-muted-foreground", children: [
|
|
1898
1593
|
"(",
|
|
1899
1594
|
f.fileCount,
|
|
1900
1595
|
")"
|
|
1901
1596
|
] }),
|
|
1902
|
-
f.status === "uploading" && /* @__PURE__ */
|
|
1903
|
-
onRemoveFile && /* @__PURE__ */
|
|
1597
|
+
f.status === "uploading" && /* @__PURE__ */ jsx7("span", { className: "h-3 w-3 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
1598
|
+
onRemoveFile && /* @__PURE__ */ jsx7(
|
|
1904
1599
|
"button",
|
|
1905
1600
|
{
|
|
1906
1601
|
type: "button",
|
|
1907
1602
|
"aria-label": `Remove ${f.name}`,
|
|
1908
1603
|
onClick: () => onRemoveFile(f.id),
|
|
1909
1604
|
className: "rounded p-0.5 text-muted-foreground transition hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
1910
|
-
children: /* @__PURE__ */
|
|
1605
|
+
children: /* @__PURE__ */ jsx7(CloseGlyph, { className: "h-3 w-3" })
|
|
1911
1606
|
}
|
|
1912
1607
|
)
|
|
1913
1608
|
]
|
|
1914
1609
|
},
|
|
1915
1610
|
f.id
|
|
1916
1611
|
)) }),
|
|
1917
|
-
/* @__PURE__ */
|
|
1612
|
+
/* @__PURE__ */ jsxs5(
|
|
1918
1613
|
"div",
|
|
1919
1614
|
{
|
|
1920
1615
|
"data-testid": "composer-card",
|
|
1921
1616
|
className: `flex flex-col gap-1.5 rounded-2xl border border-border bg-card px-3 py-2.5 transition focus-within:border-primary/40 focus-within:ring-2 focus-within:ring-primary/15 ${floating ? "shadow-[0_1px_2px_hsl(var(--foreground)/0.05),0_12px_28px_hsl(var(--foreground)/0.07)] dark:shadow-[0_1px_2px_hsl(var(--foreground)/0.14),0_12px_28px_hsl(var(--foreground)/0.22)]" : ""}`,
|
|
1922
1617
|
children: [
|
|
1923
|
-
/* @__PURE__ */
|
|
1618
|
+
/* @__PURE__ */ jsx7(
|
|
1924
1619
|
"textarea",
|
|
1925
1620
|
{
|
|
1926
1621
|
ref: textareaRef,
|
|
@@ -1934,9 +1629,9 @@ function ChatComposer({
|
|
|
1934
1629
|
className: "max-h-[168px] min-h-[56px] w-full resize-none bg-transparent px-1.5 py-1 text-[15px] leading-6 text-foreground outline-none placeholder:text-muted-foreground disabled:opacity-50"
|
|
1935
1630
|
}
|
|
1936
1631
|
),
|
|
1937
|
-
/* @__PURE__ */
|
|
1938
|
-
onAttach && /* @__PURE__ */
|
|
1939
|
-
/* @__PURE__ */
|
|
1632
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-end gap-2", children: [
|
|
1633
|
+
onAttach && /* @__PURE__ */ jsxs5(Fragment2, { children: [
|
|
1634
|
+
/* @__PURE__ */ jsx7(
|
|
1940
1635
|
"button",
|
|
1941
1636
|
{
|
|
1942
1637
|
type: "button",
|
|
@@ -1945,13 +1640,13 @@ function ChatComposer({
|
|
|
1945
1640
|
"aria-label": "Attach files",
|
|
1946
1641
|
title: "Attach files",
|
|
1947
1642
|
className: "shrink-0 rounded-lg p-2 text-muted-foreground transition hover:bg-accent/40 hover:text-foreground disabled:opacity-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
1948
|
-
children: /* @__PURE__ */
|
|
1643
|
+
children: /* @__PURE__ */ jsx7(PaperclipGlyph, { className: "h-4 w-4" })
|
|
1949
1644
|
}
|
|
1950
1645
|
),
|
|
1951
|
-
/* @__PURE__ */
|
|
1646
|
+
/* @__PURE__ */ jsx7("input", { ref: fileInputRef, type: "file", multiple: true, className: "hidden", accept, onChange: handleFileChange })
|
|
1952
1647
|
] }),
|
|
1953
|
-
onAttachFolder && /* @__PURE__ */
|
|
1954
|
-
/* @__PURE__ */
|
|
1648
|
+
onAttachFolder && /* @__PURE__ */ jsxs5(Fragment2, { children: [
|
|
1649
|
+
/* @__PURE__ */ jsx7(
|
|
1955
1650
|
"button",
|
|
1956
1651
|
{
|
|
1957
1652
|
type: "button",
|
|
@@ -1960,10 +1655,10 @@ function ChatComposer({
|
|
|
1960
1655
|
"aria-label": "Attach folder",
|
|
1961
1656
|
title: "Attach folder",
|
|
1962
1657
|
className: "shrink-0 rounded-lg p-2 text-muted-foreground transition hover:bg-accent/40 hover:text-foreground disabled:opacity-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
1963
|
-
children: /* @__PURE__ */
|
|
1658
|
+
children: /* @__PURE__ */ jsx7(FolderGlyph, { className: "h-4 w-4" })
|
|
1964
1659
|
}
|
|
1965
1660
|
),
|
|
1966
|
-
/* @__PURE__ */
|
|
1661
|
+
/* @__PURE__ */ jsx7(
|
|
1967
1662
|
"input",
|
|
1968
1663
|
{
|
|
1969
1664
|
ref: folderInputRef,
|
|
@@ -1975,7 +1670,7 @@ function ChatComposer({
|
|
|
1975
1670
|
}
|
|
1976
1671
|
)
|
|
1977
1672
|
] }),
|
|
1978
|
-
/* @__PURE__ */
|
|
1673
|
+
/* @__PURE__ */ jsx7(
|
|
1979
1674
|
"div",
|
|
1980
1675
|
{
|
|
1981
1676
|
"data-testid": "composer-controls",
|
|
@@ -1983,7 +1678,7 @@ function ChatComposer({
|
|
|
1983
1678
|
children: showInline && controls
|
|
1984
1679
|
}
|
|
1985
1680
|
),
|
|
1986
|
-
isStreaming ? /* @__PURE__ */
|
|
1681
|
+
isStreaming ? /* @__PURE__ */ jsxs5(
|
|
1987
1682
|
"button",
|
|
1988
1683
|
{
|
|
1989
1684
|
type: "button",
|
|
@@ -1991,11 +1686,11 @@ function ChatComposer({
|
|
|
1991
1686
|
"aria-label": "Stop response",
|
|
1992
1687
|
className: "inline-flex shrink-0 items-center gap-1.5 rounded-full bg-destructive/15 px-3.5 py-2 text-sm font-medium text-destructive transition hover:bg-destructive/25 focus:outline-none focus-visible:ring-2 focus-visible:ring-destructive/50",
|
|
1993
1688
|
children: [
|
|
1994
|
-
/* @__PURE__ */
|
|
1995
|
-
/* @__PURE__ */
|
|
1689
|
+
/* @__PURE__ */ jsx7(StopGlyph, { className: "h-3.5 w-3.5" }),
|
|
1690
|
+
/* @__PURE__ */ jsx7("span", { children: "Stop" })
|
|
1996
1691
|
]
|
|
1997
1692
|
}
|
|
1998
|
-
) : /* @__PURE__ */
|
|
1693
|
+
) : /* @__PURE__ */ jsxs5(
|
|
1999
1694
|
"button",
|
|
2000
1695
|
{
|
|
2001
1696
|
type: "button",
|
|
@@ -2004,8 +1699,8 @@ function ChatComposer({
|
|
|
2004
1699
|
"aria-label": sendLabel,
|
|
2005
1700
|
className: "inline-flex shrink-0 items-center gap-1.5 rounded-full bg-primary px-3.5 py-2 text-sm font-medium text-primary-foreground shadow-sm transition hover:bg-primary/90 disabled:cursor-not-allowed disabled:opacity-40 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-card",
|
|
2006
1701
|
children: [
|
|
2007
|
-
/* @__PURE__ */
|
|
2008
|
-
/* @__PURE__ */
|
|
1702
|
+
/* @__PURE__ */ jsx7(SendGlyph, { className: "h-3.5 w-3.5" }),
|
|
1703
|
+
/* @__PURE__ */ jsx7("span", { children: sendLabel })
|
|
2009
1704
|
]
|
|
2010
1705
|
}
|
|
2011
1706
|
)
|
|
@@ -2013,10 +1708,10 @@ function ChatComposer({
|
|
|
2013
1708
|
]
|
|
2014
1709
|
}
|
|
2015
1710
|
),
|
|
2016
|
-
focusShortcut && /* @__PURE__ */
|
|
2017
|
-
/* @__PURE__ */
|
|
2018
|
-
/* @__PURE__ */
|
|
2019
|
-
/* @__PURE__ */
|
|
1711
|
+
focusShortcut && /* @__PURE__ */ jsx7("div", { className: "mt-1.5 flex justify-end px-1", children: /* @__PURE__ */ jsxs5("span", { className: "text-xs text-muted-foreground", children: [
|
|
1712
|
+
/* @__PURE__ */ jsx7("kbd", { className: "rounded border border-border bg-background px-1 py-0.5 text-[10px]", children: "Cmd" }),
|
|
1713
|
+
/* @__PURE__ */ jsx7("kbd", { className: "ml-0.5 rounded border border-border bg-background px-1 py-0.5 text-[10px]", children: "L" }),
|
|
1714
|
+
/* @__PURE__ */ jsx7("span", { className: "ml-1", children: "to focus" })
|
|
2020
1715
|
] }) })
|
|
2021
1716
|
]
|
|
2022
1717
|
}
|
|
@@ -2024,7 +1719,7 @@ function ChatComposer({
|
|
|
2024
1719
|
}
|
|
2025
1720
|
|
|
2026
1721
|
// src/web-react/durable-plan-flow.ts
|
|
2027
|
-
import { useCallback as useCallback3, useEffect as
|
|
1722
|
+
import { useCallback as useCallback3, useEffect as useEffect6, useRef as useRef5, useState as useState7 } from "react";
|
|
2028
1723
|
var DurablePlanClientError = class extends Error {
|
|
2029
1724
|
constructor(message, status, code, currentPlan) {
|
|
2030
1725
|
super(message);
|
|
@@ -2111,13 +1806,13 @@ function createDurablePlanDecisionClient(options) {
|
|
|
2111
1806
|
};
|
|
2112
1807
|
}
|
|
2113
1808
|
function useDurablePlanFlow(options) {
|
|
2114
|
-
const [plan, setPlan] =
|
|
2115
|
-
const [deciding, setDeciding] =
|
|
2116
|
-
const [restoring, setRestoring] =
|
|
2117
|
-
const [error, setError] =
|
|
2118
|
-
const attachments =
|
|
2119
|
-
const decisionInFlight =
|
|
2120
|
-
|
|
1809
|
+
const [plan, setPlan] = useState7(options.plan);
|
|
1810
|
+
const [deciding, setDeciding] = useState7(null);
|
|
1811
|
+
const [restoring, setRestoring] = useState7(false);
|
|
1812
|
+
const [error, setError] = useState7(null);
|
|
1813
|
+
const attachments = useRef5(/* @__PURE__ */ new Map());
|
|
1814
|
+
const decisionInFlight = useRef5(false);
|
|
1815
|
+
useEffect6(() => setPlan(options.plan), [options.plan]);
|
|
2121
1816
|
const apply = useCallback3(async (result) => {
|
|
2122
1817
|
setPlan(result.plan);
|
|
2123
1818
|
options.onUpdated?.(result.plan);
|
|
@@ -2286,7 +1981,7 @@ function createDurableInteractionAnswerSubmitter(options) {
|
|
|
2286
1981
|
}
|
|
2287
1982
|
|
|
2288
1983
|
// src/web-react/use-chat-interactions.ts
|
|
2289
|
-
import { useCallback as useCallback4, useMemo as
|
|
1984
|
+
import { useCallback as useCallback4, useMemo as useMemo3, useState as useState8 } from "react";
|
|
2290
1985
|
function hasPendingContentDuplicate(list, interaction) {
|
|
2291
1986
|
if (interaction.status !== "pending") return false;
|
|
2292
1987
|
const signature = questionInteractionContentSignature(interaction);
|
|
@@ -2365,7 +2060,7 @@ function hydrateChatInteractions(list, persisted) {
|
|
|
2365
2060
|
return persisted.reduce(upsertChatInteraction, list);
|
|
2366
2061
|
}
|
|
2367
2062
|
function useChatInteractions(options = {}) {
|
|
2368
|
-
const [interactions, setInteractions] =
|
|
2063
|
+
const [interactions, setInteractions] = useState8([]);
|
|
2369
2064
|
const upsert = useCallback4((interaction) => {
|
|
2370
2065
|
setInteractions((prev) => upsertChatInteraction(prev, interaction));
|
|
2371
2066
|
}, []);
|
|
@@ -2387,12 +2082,12 @@ function useChatInteractions(options = {}) {
|
|
|
2387
2082
|
setInteractions((prev) => terminalizePendingChatInteractions(prev, status));
|
|
2388
2083
|
}, []);
|
|
2389
2084
|
const reset = useCallback4(() => setInteractions([]), []);
|
|
2390
|
-
const pending =
|
|
2085
|
+
const pending = useMemo3(() => interactions.filter((item) => item.status === "pending"), [interactions]);
|
|
2391
2086
|
return { interactions, pending, upsert, applyCancel, markResolved, restore, hydrate, terminalizePending, reset };
|
|
2392
2087
|
}
|
|
2393
2088
|
|
|
2394
2089
|
// src/web-react/use-file-mentions.ts
|
|
2395
|
-
import { useCallback as useCallback5, useMemo as
|
|
2090
|
+
import { useCallback as useCallback5, useMemo as useMemo4, useRef as useRef6, useState as useState9 } from "react";
|
|
2396
2091
|
var FILE_MENTION_KIND = "file";
|
|
2397
2092
|
function toMentionItem(file) {
|
|
2398
2093
|
return { id: file.path, label: file.name, detail: file.path, kind: FILE_MENTION_KIND };
|
|
@@ -2450,11 +2145,11 @@ function useFileMentions(options) {
|
|
|
2450
2145
|
emptyText = DEFAULT_MENTION_EMPTY_TEXT
|
|
2451
2146
|
} = options;
|
|
2452
2147
|
const fetchImpl = options.fetchImpl ?? fetch;
|
|
2453
|
-
const [state, setState] =
|
|
2454
|
-
const stateRef =
|
|
2148
|
+
const [state, setState] = useState9({ kind: "idle" });
|
|
2149
|
+
const stateRef = useRef6(state);
|
|
2455
2150
|
stateRef.current = state;
|
|
2456
|
-
const inFlightRef =
|
|
2457
|
-
const [mentions, setMentions] =
|
|
2151
|
+
const inFlightRef = useRef6(null);
|
|
2152
|
+
const [mentions, setMentions] = useState9([]);
|
|
2458
2153
|
const load = useCallback5(() => {
|
|
2459
2154
|
if (inFlightRef.current) return inFlightRef.current;
|
|
2460
2155
|
if (stateRef.current.kind === "idle") {
|
|
@@ -2509,7 +2204,7 @@ function useFileMentions(options) {
|
|
|
2509
2204
|
setMentions(items.filter((item) => item.kind === void 0 || item.kind === FILE_MENTION_KIND).map(toFileMention));
|
|
2510
2205
|
}, []);
|
|
2511
2206
|
const clearMentions = useCallback5(() => setMentions([]), []);
|
|
2512
|
-
const mention =
|
|
2207
|
+
const mention = useMemo4(
|
|
2513
2208
|
() => ({
|
|
2514
2209
|
fetchItems,
|
|
2515
2210
|
onMentionsChange,
|
|
@@ -2563,8 +2258,8 @@ function segmentMentionContent(content, parts) {
|
|
|
2563
2258
|
}
|
|
2564
2259
|
|
|
2565
2260
|
// src/web-react/mission-activity.tsx
|
|
2566
|
-
import { useCallback as useCallback6, useEffect as
|
|
2567
|
-
import { Fragment as
|
|
2261
|
+
import { useCallback as useCallback6, useEffect as useEffect7, useState as useState10 } from "react";
|
|
2262
|
+
import { Fragment as Fragment3, jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2568
2263
|
var LIVE_STATUSES = /* @__PURE__ */ new Set(["pending", "running"]);
|
|
2569
2264
|
var OK_STATUSES = /* @__PURE__ */ new Set(["completed", "done", "succeeded"]);
|
|
2570
2265
|
var ERROR_STATUSES = /* @__PURE__ */ new Set(["failed", "error", "cancelled", "aborted"]);
|
|
@@ -2611,19 +2306,19 @@ function waterfallLayout(trace) {
|
|
|
2611
2306
|
});
|
|
2612
2307
|
}
|
|
2613
2308
|
function ChevronGlyph({ className }) {
|
|
2614
|
-
return /* @__PURE__ */
|
|
2309
|
+
return /* @__PURE__ */ jsx8("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx8("path", { d: "m6 9 6 6 6-6" }) });
|
|
2615
2310
|
}
|
|
2616
2311
|
function RefreshGlyph({ className }) {
|
|
2617
|
-
return /* @__PURE__ */
|
|
2312
|
+
return /* @__PURE__ */ jsx8("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx8("path", { d: "M21 12a9 9 0 1 1-2.64-6.36M21 3v6h-6" }) });
|
|
2618
2313
|
}
|
|
2619
2314
|
function CopyGlyph({ className }) {
|
|
2620
|
-
return /* @__PURE__ */
|
|
2621
|
-
/* @__PURE__ */
|
|
2622
|
-
/* @__PURE__ */
|
|
2315
|
+
return /* @__PURE__ */ jsxs6("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
|
|
2316
|
+
/* @__PURE__ */ jsx8("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2" }),
|
|
2317
|
+
/* @__PURE__ */ jsx8("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
|
|
2623
2318
|
] });
|
|
2624
2319
|
}
|
|
2625
2320
|
function TraceIdCopy({ traceId }) {
|
|
2626
|
-
const [copied, setCopied] =
|
|
2321
|
+
const [copied, setCopied] = useState10(false);
|
|
2627
2322
|
const copy = useCallback6(() => {
|
|
2628
2323
|
void navigator.clipboard?.writeText(traceId).then(
|
|
2629
2324
|
() => {
|
|
@@ -2634,7 +2329,7 @@ function TraceIdCopy({ traceId }) {
|
|
|
2634
2329
|
}
|
|
2635
2330
|
);
|
|
2636
2331
|
}, [traceId]);
|
|
2637
|
-
return /* @__PURE__ */
|
|
2332
|
+
return /* @__PURE__ */ jsxs6(
|
|
2638
2333
|
"button",
|
|
2639
2334
|
{
|
|
2640
2335
|
type: "button",
|
|
@@ -2643,23 +2338,23 @@ function TraceIdCopy({ traceId }) {
|
|
|
2643
2338
|
"aria-label": "Copy trace id",
|
|
2644
2339
|
className: "inline-flex min-w-0 items-center gap-1.5 rounded text-left font-mono text-muted-foreground transition hover:text-foreground",
|
|
2645
2340
|
children: [
|
|
2646
|
-
/* @__PURE__ */
|
|
2647
|
-
/* @__PURE__ */
|
|
2648
|
-
copied && /* @__PURE__ */
|
|
2341
|
+
/* @__PURE__ */ jsx8("span", { className: "truncate", children: traceId }),
|
|
2342
|
+
/* @__PURE__ */ jsx8(CopyGlyph, { className: "h-3 w-3 shrink-0" }),
|
|
2343
|
+
copied && /* @__PURE__ */ jsx8("span", { className: "shrink-0 not-italic text-success", children: "copied" })
|
|
2649
2344
|
]
|
|
2650
2345
|
}
|
|
2651
2346
|
);
|
|
2652
2347
|
}
|
|
2653
2348
|
function StatusDot({ tone }) {
|
|
2654
|
-
return /* @__PURE__ */
|
|
2655
|
-
/* @__PURE__ */
|
|
2349
|
+
return /* @__PURE__ */ jsxs6("span", { className: "inline-flex items-center", children: [
|
|
2350
|
+
/* @__PURE__ */ jsx8(
|
|
2656
2351
|
"span",
|
|
2657
2352
|
{
|
|
2658
2353
|
"aria-hidden": true,
|
|
2659
2354
|
className: `h-2 w-2 shrink-0 rounded-full ${tone === "live" ? "animate-pulse bg-warning" : tone === "ok" ? "bg-success" : tone === "error" ? "bg-destructive" : "bg-muted-foreground/40"}`
|
|
2660
2355
|
}
|
|
2661
2356
|
),
|
|
2662
|
-
/* @__PURE__ */
|
|
2357
|
+
/* @__PURE__ */ jsx8("span", { className: "sr-only", children: tone })
|
|
2663
2358
|
] });
|
|
2664
2359
|
}
|
|
2665
2360
|
var BAR_CLASS = {
|
|
@@ -2671,19 +2366,19 @@ function FlowWaterfall({ trace }) {
|
|
|
2671
2366
|
const rows = waterfallLayout(trace);
|
|
2672
2367
|
if (rows.length === 0) return null;
|
|
2673
2368
|
const cost = formatActivityCost(trace.costUsd);
|
|
2674
|
-
return /* @__PURE__ */
|
|
2675
|
-
rows.map((row, i) => /* @__PURE__ */
|
|
2676
|
-
/* @__PURE__ */
|
|
2677
|
-
/* @__PURE__ */
|
|
2369
|
+
return /* @__PURE__ */ jsxs6("div", { className: "space-y-1", children: [
|
|
2370
|
+
rows.map((row, i) => /* @__PURE__ */ jsxs6("div", { className: "grid grid-cols-[minmax(0,2fr)_minmax(0,3fr)_auto] items-center gap-2", children: [
|
|
2371
|
+
/* @__PURE__ */ jsx8("span", { className: "truncate font-mono text-[11px] text-muted-foreground", title: row.name, children: row.name }),
|
|
2372
|
+
/* @__PURE__ */ jsx8("div", { className: "relative h-2 rounded-sm bg-muted/40", children: /* @__PURE__ */ jsx8(
|
|
2678
2373
|
"div",
|
|
2679
2374
|
{
|
|
2680
2375
|
className: `absolute inset-y-0 rounded-sm ${row.ok ? BAR_CLASS[row.kind] : "bg-destructive/80"} ${row.approx ? "opacity-70" : ""}`,
|
|
2681
2376
|
style: { left: `${row.offsetPct}%`, width: `${row.widthPct}%` }
|
|
2682
2377
|
}
|
|
2683
2378
|
) }),
|
|
2684
|
-
/* @__PURE__ */
|
|
2379
|
+
/* @__PURE__ */ jsx8("span", { className: "shrink-0 font-mono text-[10px] tabular-nums text-muted-foreground/70", children: row.durationLabel })
|
|
2685
2380
|
] }, i)),
|
|
2686
|
-
/* @__PURE__ */
|
|
2381
|
+
/* @__PURE__ */ jsxs6("p", { className: "pt-0.5 text-right font-mono text-[10px] tabular-nums text-muted-foreground/60", children: [
|
|
2687
2382
|
(trace.totalMs / 1e3).toFixed(1),
|
|
2688
2383
|
"s",
|
|
2689
2384
|
cost ? ` \xB7 ${cost}` : ""
|
|
@@ -2691,43 +2386,43 @@ function FlowWaterfall({ trace }) {
|
|
|
2691
2386
|
] });
|
|
2692
2387
|
}
|
|
2693
2388
|
function MissionActivityLane({ activity, startedAt, nowMs }) {
|
|
2694
|
-
const [expanded, setExpanded] =
|
|
2389
|
+
const [expanded, setExpanded] = useState10(false);
|
|
2695
2390
|
if (activity.length === 0) return null;
|
|
2696
|
-
return /* @__PURE__ */
|
|
2391
|
+
return /* @__PURE__ */ jsxs6("div", { className: "mt-1 border-l border-border/50 pl-3", children: [
|
|
2697
2392
|
activity.map((run) => {
|
|
2698
2393
|
const tone = activityTone(run.status);
|
|
2699
2394
|
const cost = formatActivityCost(run.costUsd);
|
|
2700
2395
|
const duration = formatActivityDuration(run.durationMs);
|
|
2701
|
-
return /* @__PURE__ */
|
|
2702
|
-
/* @__PURE__ */
|
|
2703
|
-
/* @__PURE__ */
|
|
2704
|
-
/* @__PURE__ */
|
|
2705
|
-
/* @__PURE__ */
|
|
2396
|
+
return /* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-2 py-1 text-xs", children: [
|
|
2397
|
+
/* @__PURE__ */ jsx8(StatusDot, { tone }),
|
|
2398
|
+
/* @__PURE__ */ jsxs6("span", { className: "min-w-0 flex-1 truncate", children: [
|
|
2399
|
+
/* @__PURE__ */ jsx8("span", { className: "font-medium", children: run.tool }),
|
|
2400
|
+
/* @__PURE__ */ jsxs6("span", { className: "text-muted-foreground", children: [
|
|
2706
2401
|
" \u2014 ",
|
|
2707
2402
|
run.detail
|
|
2708
2403
|
] })
|
|
2709
2404
|
] }),
|
|
2710
|
-
tone === "live" && (run.iteration !== void 0 || run.phase !== void 0) && /* @__PURE__ */
|
|
2711
|
-
/* @__PURE__ */
|
|
2712
|
-
tone !== "live" && tone !== "ok" && /* @__PURE__ */
|
|
2713
|
-
cost && /* @__PURE__ */
|
|
2714
|
-
duration && /* @__PURE__ */
|
|
2405
|
+
tone === "live" && (run.iteration !== void 0 || run.phase !== void 0) && /* @__PURE__ */ jsx8("span", { className: "shrink-0 rounded-full bg-warning/10 px-1.5 py-0.5 font-mono text-[10px] text-warning", children: [run.iteration !== void 0 ? `iter ${run.iteration}` : null, run.phase ?? null].filter(Boolean).join(" \xB7 ") }),
|
|
2406
|
+
/* @__PURE__ */ jsxs6("span", { className: "flex shrink-0 items-center gap-1.5 font-mono text-[10px] tabular-nums text-muted-foreground/70", children: [
|
|
2407
|
+
tone !== "live" && tone !== "ok" && /* @__PURE__ */ jsx8("span", { children: run.status }),
|
|
2408
|
+
cost && /* @__PURE__ */ jsx8("span", { children: cost }),
|
|
2409
|
+
duration && /* @__PURE__ */ jsx8("span", { children: duration })
|
|
2715
2410
|
] })
|
|
2716
2411
|
] }, run.taskId);
|
|
2717
2412
|
}),
|
|
2718
|
-
/* @__PURE__ */
|
|
2413
|
+
/* @__PURE__ */ jsxs6(
|
|
2719
2414
|
"button",
|
|
2720
2415
|
{
|
|
2721
2416
|
type: "button",
|
|
2722
2417
|
onClick: () => setExpanded((v) => !v),
|
|
2723
2418
|
className: "flex items-center gap-1 py-0.5 text-[10px] font-medium text-muted-foreground/70 transition hover:text-foreground",
|
|
2724
2419
|
children: [
|
|
2725
|
-
/* @__PURE__ */
|
|
2420
|
+
/* @__PURE__ */ jsx8(ChevronGlyph, { className: `h-3 w-3 transition-transform ${expanded ? "rotate-180" : ""}` }),
|
|
2726
2421
|
"timeline"
|
|
2727
2422
|
]
|
|
2728
2423
|
}
|
|
2729
2424
|
),
|
|
2730
|
-
expanded && /* @__PURE__ */
|
|
2425
|
+
expanded && /* @__PURE__ */ jsx8("div", { className: "rounded-md border border-border/50 bg-muted/10 p-2", children: /* @__PURE__ */ jsx8(
|
|
2731
2426
|
FlowWaterfall,
|
|
2732
2427
|
{
|
|
2733
2428
|
trace: stepActivityFlowTrace(activity, {
|
|
@@ -2742,45 +2437,45 @@ function ActivityRow({
|
|
|
2742
2437
|
record,
|
|
2743
2438
|
renderMissionRef
|
|
2744
2439
|
}) {
|
|
2745
|
-
const [open, setOpen] =
|
|
2440
|
+
const [open, setOpen] = useState10(false);
|
|
2746
2441
|
const tone = activityTone(record.status);
|
|
2747
2442
|
const cost = formatActivityCost(record.costUsd);
|
|
2748
2443
|
const duration = formatActivityDuration(record.durationMs);
|
|
2749
|
-
return /* @__PURE__ */
|
|
2750
|
-
/* @__PURE__ */
|
|
2751
|
-
/* @__PURE__ */
|
|
2752
|
-
/* @__PURE__ */
|
|
2753
|
-
/* @__PURE__ */
|
|
2754
|
-
/* @__PURE__ */
|
|
2444
|
+
return /* @__PURE__ */ jsxs6("div", { className: "rounded-lg border border-border/60 bg-card", children: [
|
|
2445
|
+
/* @__PURE__ */ jsxs6("button", { type: "button", onClick: () => setOpen((v) => !v), className: "flex w-full items-center gap-2.5 px-3 py-2 text-left text-sm", children: [
|
|
2446
|
+
/* @__PURE__ */ jsx8(StatusDot, { tone }),
|
|
2447
|
+
/* @__PURE__ */ jsxs6("span", { className: "min-w-0 flex-1 truncate", children: [
|
|
2448
|
+
/* @__PURE__ */ jsx8("span", { className: "font-medium", children: record.tool }),
|
|
2449
|
+
/* @__PURE__ */ jsxs6("span", { className: "text-muted-foreground", children: [
|
|
2755
2450
|
" \u2014 ",
|
|
2756
2451
|
record.detail
|
|
2757
2452
|
] })
|
|
2758
2453
|
] }),
|
|
2759
|
-
tone === "live" && (record.iteration !== void 0 || record.phase !== void 0) && /* @__PURE__ */
|
|
2760
|
-
/* @__PURE__ */
|
|
2454
|
+
tone === "live" && (record.iteration !== void 0 || record.phase !== void 0) && /* @__PURE__ */ jsx8("span", { className: "shrink-0 rounded-full bg-warning/10 px-2 py-0.5 font-mono text-[10px] text-warning", children: [record.iteration !== void 0 ? `iter ${record.iteration}` : null, record.phase ?? null].filter(Boolean).join(" \xB7 ") }),
|
|
2455
|
+
/* @__PURE__ */ jsx8(
|
|
2761
2456
|
"span",
|
|
2762
2457
|
{
|
|
2763
2458
|
className: `shrink-0 rounded-full px-2 py-0.5 text-[10px] font-medium ${tone === "ok" ? "bg-success/10 text-success" : tone === "error" ? "bg-destructive/10 text-destructive" : tone === "live" ? "bg-warning/10 text-warning" : "bg-muted/60 text-muted-foreground"}`,
|
|
2764
2459
|
children: record.status
|
|
2765
2460
|
}
|
|
2766
2461
|
),
|
|
2767
|
-
cost && /* @__PURE__ */
|
|
2768
|
-
/* @__PURE__ */
|
|
2462
|
+
cost && /* @__PURE__ */ jsx8("span", { className: "shrink-0 font-mono text-[11px] tabular-nums text-muted-foreground", children: cost }),
|
|
2463
|
+
/* @__PURE__ */ jsx8(ChevronGlyph, { className: `h-3 w-3 shrink-0 text-muted-foreground transition-transform ${open ? "rotate-180" : ""}` })
|
|
2769
2464
|
] }),
|
|
2770
|
-
open && /* @__PURE__ */
|
|
2771
|
-
record.durationMs !== void 0 && /* @__PURE__ */
|
|
2772
|
-
/* @__PURE__ */
|
|
2773
|
-
/* @__PURE__ */
|
|
2774
|
-
/* @__PURE__ */
|
|
2775
|
-
/* @__PURE__ */
|
|
2776
|
-
/* @__PURE__ */
|
|
2777
|
-
duration && /* @__PURE__ */
|
|
2778
|
-
/* @__PURE__ */
|
|
2779
|
-
/* @__PURE__ */
|
|
2465
|
+
open && /* @__PURE__ */ jsxs6("div", { className: "space-y-2.5 border-t border-border/40 px-3 py-2.5", children: [
|
|
2466
|
+
record.durationMs !== void 0 && /* @__PURE__ */ jsx8("div", { className: "rounded-md border border-border/50 bg-muted/10 p-2", children: /* @__PURE__ */ jsx8(FlowWaterfall, { trace: stepActivityFlowTrace([record]) }) }),
|
|
2467
|
+
/* @__PURE__ */ jsxs6("dl", { className: "grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 font-mono text-[11px]", children: [
|
|
2468
|
+
/* @__PURE__ */ jsx8("dt", { className: "text-muted-foreground/60", children: "task" }),
|
|
2469
|
+
/* @__PURE__ */ jsx8("dd", { className: "truncate text-muted-foreground", children: record.taskId }),
|
|
2470
|
+
/* @__PURE__ */ jsx8("dt", { className: "text-muted-foreground/60", children: "started" }),
|
|
2471
|
+
/* @__PURE__ */ jsx8("dd", { className: "text-muted-foreground", children: new Date(record.startedAt).toLocaleString() }),
|
|
2472
|
+
duration && /* @__PURE__ */ jsxs6(Fragment3, { children: [
|
|
2473
|
+
/* @__PURE__ */ jsx8("dt", { className: "text-muted-foreground/60", children: "duration" }),
|
|
2474
|
+
/* @__PURE__ */ jsx8("dd", { className: "text-muted-foreground", children: duration })
|
|
2780
2475
|
] }),
|
|
2781
|
-
record.traceId && /* @__PURE__ */
|
|
2782
|
-
/* @__PURE__ */
|
|
2783
|
-
/* @__PURE__ */
|
|
2476
|
+
record.traceId && /* @__PURE__ */ jsxs6(Fragment3, { children: [
|
|
2477
|
+
/* @__PURE__ */ jsx8("dt", { className: "text-muted-foreground/60", children: "trace" }),
|
|
2478
|
+
/* @__PURE__ */ jsx8("dd", { className: "min-w-0", children: /* @__PURE__ */ jsx8(TraceIdCopy, { traceId: record.traceId }) })
|
|
2784
2479
|
] })
|
|
2785
2480
|
] }),
|
|
2786
2481
|
record.missionRef && renderMissionRef?.(record.missionRef, record)
|
|
@@ -2788,10 +2483,10 @@ function ActivityRow({
|
|
|
2788
2483
|
] });
|
|
2789
2484
|
}
|
|
2790
2485
|
function AgentActivityPanel({ fetchActivity, renderMissionRef, title = "Agent activity", emptyLabel = "No agent runs yet." }) {
|
|
2791
|
-
const [rows, setRows] =
|
|
2792
|
-
const [cursor, setCursor] =
|
|
2793
|
-
const [status, setStatus] =
|
|
2794
|
-
const [error, setError] =
|
|
2486
|
+
const [rows, setRows] = useState10([]);
|
|
2487
|
+
const [cursor, setCursor] = useState10(void 0);
|
|
2488
|
+
const [status, setStatus] = useState10("loading");
|
|
2489
|
+
const [error, setError] = useState10(null);
|
|
2795
2490
|
const load = useCallback6(
|
|
2796
2491
|
async (from) => {
|
|
2797
2492
|
setStatus("loading");
|
|
@@ -2808,14 +2503,14 @@ function AgentActivityPanel({ fetchActivity, renderMissionRef, title = "Agent ac
|
|
|
2808
2503
|
},
|
|
2809
2504
|
[fetchActivity]
|
|
2810
2505
|
);
|
|
2811
|
-
|
|
2506
|
+
useEffect7(() => {
|
|
2812
2507
|
void load();
|
|
2813
2508
|
}, [load]);
|
|
2814
2509
|
const loading = status === "loading";
|
|
2815
|
-
return /* @__PURE__ */
|
|
2816
|
-
/* @__PURE__ */
|
|
2817
|
-
/* @__PURE__ */
|
|
2818
|
-
/* @__PURE__ */
|
|
2510
|
+
return /* @__PURE__ */ jsxs6("div", { className: "space-y-2", children: [
|
|
2511
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-2", children: [
|
|
2512
|
+
/* @__PURE__ */ jsx8("h2", { className: "flex-1 text-sm font-semibold", children: title }),
|
|
2513
|
+
/* @__PURE__ */ jsx8(
|
|
2819
2514
|
"button",
|
|
2820
2515
|
{
|
|
2821
2516
|
type: "button",
|
|
@@ -2823,15 +2518,15 @@ function AgentActivityPanel({ fetchActivity, renderMissionRef, title = "Agent ac
|
|
|
2823
2518
|
disabled: loading,
|
|
2824
2519
|
"aria-label": "Refresh",
|
|
2825
2520
|
className: "rounded-md p-1.5 text-muted-foreground transition hover:bg-accent/30 hover:text-foreground disabled:opacity-50",
|
|
2826
|
-
children: /* @__PURE__ */
|
|
2521
|
+
children: /* @__PURE__ */ jsx8(RefreshGlyph, { className: `h-3.5 w-3.5 ${loading ? "animate-spin" : ""}` })
|
|
2827
2522
|
}
|
|
2828
2523
|
)
|
|
2829
2524
|
] }),
|
|
2830
|
-
status === "error" && /* @__PURE__ */
|
|
2831
|
-
status === "ready" && rows.length === 0 && /* @__PURE__ */
|
|
2832
|
-
/* @__PURE__ */
|
|
2833
|
-
/* @__PURE__ */
|
|
2834
|
-
cursor && /* @__PURE__ */
|
|
2525
|
+
status === "error" && /* @__PURE__ */ jsx8("p", { role: "alert", className: "rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive", children: error }),
|
|
2526
|
+
status === "ready" && rows.length === 0 && /* @__PURE__ */ jsx8("p", { className: "px-1 text-sm text-muted-foreground", children: emptyLabel }),
|
|
2527
|
+
/* @__PURE__ */ jsx8("span", { role: "status", "aria-live": "polite", "aria-busy": loading, className: "sr-only", children: loading ? "Loading activity\u2026" : "" }),
|
|
2528
|
+
/* @__PURE__ */ jsx8("div", { className: "space-y-1.5", "aria-busy": loading, children: rows.map((record) => /* @__PURE__ */ jsx8(ActivityRow, { record, renderMissionRef }, record.taskId)) }),
|
|
2529
|
+
cursor && /* @__PURE__ */ jsx8(
|
|
2835
2530
|
"button",
|
|
2836
2531
|
{
|
|
2837
2532
|
type: "button",
|
|
@@ -2845,7 +2540,7 @@ function AgentActivityPanel({ fetchActivity, renderMissionRef, title = "Agent ac
|
|
|
2845
2540
|
}
|
|
2846
2541
|
|
|
2847
2542
|
// src/web-react/provenance.tsx
|
|
2848
|
-
import { useCallback as useCallback7, useEffect as
|
|
2543
|
+
import { useCallback as useCallback7, useEffect as useEffect8, useId, useRef as useRef7, useState as useState11 } from "react";
|
|
2849
2544
|
|
|
2850
2545
|
// src/web-react/provenance-model.ts
|
|
2851
2546
|
var PROVENANCE_BASES = ["extracted", "entered", "computed", "asserted"];
|
|
@@ -3005,7 +2700,7 @@ function provenanceTriggerLabel(record, standing) {
|
|
|
3005
2700
|
}
|
|
3006
2701
|
|
|
3007
2702
|
// src/web-react/provenance.tsx
|
|
3008
|
-
import { jsx as
|
|
2703
|
+
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
3009
2704
|
var BASIS_TONES = {
|
|
3010
2705
|
extracted: "border-primary/30 bg-primary/10 text-primary",
|
|
3011
2706
|
entered: "border-success/30 bg-success/10 text-success",
|
|
@@ -3030,27 +2725,27 @@ function BasisGlyph({ basis, className }) {
|
|
|
3030
2725
|
};
|
|
3031
2726
|
switch (basis) {
|
|
3032
2727
|
case "extracted":
|
|
3033
|
-
return /* @__PURE__ */
|
|
3034
|
-
/* @__PURE__ */
|
|
3035
|
-
/* @__PURE__ */
|
|
3036
|
-
/* @__PURE__ */
|
|
2728
|
+
return /* @__PURE__ */ jsxs7("svg", { ...shared, children: [
|
|
2729
|
+
/* @__PURE__ */ jsx9("path", { d: "M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z" }),
|
|
2730
|
+
/* @__PURE__ */ jsx9("polyline", { points: "14 3 14 8 19 8" }),
|
|
2731
|
+
/* @__PURE__ */ jsx9("line", { x1: "9", y1: "13", x2: "15", y2: "13" })
|
|
3037
2732
|
] });
|
|
3038
2733
|
case "entered":
|
|
3039
|
-
return /* @__PURE__ */
|
|
3040
|
-
/* @__PURE__ */
|
|
3041
|
-
/* @__PURE__ */
|
|
2734
|
+
return /* @__PURE__ */ jsxs7("svg", { ...shared, children: [
|
|
2735
|
+
/* @__PURE__ */ jsx9("path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" }),
|
|
2736
|
+
/* @__PURE__ */ jsx9("circle", { cx: "12", cy: "7", r: "4" })
|
|
3042
2737
|
] });
|
|
3043
2738
|
case "computed":
|
|
3044
|
-
return /* @__PURE__ */
|
|
3045
|
-
/* @__PURE__ */
|
|
3046
|
-
/* @__PURE__ */
|
|
3047
|
-
/* @__PURE__ */
|
|
3048
|
-
/* @__PURE__ */
|
|
2739
|
+
return /* @__PURE__ */ jsxs7("svg", { ...shared, children: [
|
|
2740
|
+
/* @__PURE__ */ jsx9("line", { x1: "4", y1: "9", x2: "20", y2: "9" }),
|
|
2741
|
+
/* @__PURE__ */ jsx9("line", { x1: "4", y1: "15", x2: "20", y2: "15" }),
|
|
2742
|
+
/* @__PURE__ */ jsx9("line", { x1: "10", y1: "3", x2: "8", y2: "21" }),
|
|
2743
|
+
/* @__PURE__ */ jsx9("line", { x1: "16", y1: "3", x2: "14", y2: "21" })
|
|
3049
2744
|
] });
|
|
3050
2745
|
case "asserted":
|
|
3051
|
-
return /* @__PURE__ */
|
|
3052
|
-
/* @__PURE__ */
|
|
3053
|
-
/* @__PURE__ */
|
|
2746
|
+
return /* @__PURE__ */ jsxs7("svg", { ...shared, children: [
|
|
2747
|
+
/* @__PURE__ */ jsx9("path", { d: "M12 3v3M12 18v3M3 12h3M18 12h3M5.6 5.6l2.1 2.1M16.3 16.3l2.1 2.1M18.4 5.6l-2.1 2.1M7.7 16.3l-2.1 2.1" }),
|
|
2748
|
+
/* @__PURE__ */ jsx9("circle", { cx: "12", cy: "12", r: "3.2" })
|
|
3054
2749
|
] });
|
|
3055
2750
|
}
|
|
3056
2751
|
}
|
|
@@ -3070,11 +2765,11 @@ function SourceRow({
|
|
|
3070
2765
|
const status = source.status ?? "ready";
|
|
3071
2766
|
const statusLine = describeProvenanceSourceStatus(source);
|
|
3072
2767
|
const openable = status === "ready" && (onOpenSource !== void 0 || source.href !== void 0);
|
|
3073
|
-
return /* @__PURE__ */
|
|
3074
|
-
/* @__PURE__ */
|
|
3075
|
-
/* @__PURE__ */
|
|
3076
|
-
source.locator && /* @__PURE__ */
|
|
3077
|
-
openable && (onOpenSource ? /* @__PURE__ */
|
|
2768
|
+
return /* @__PURE__ */ jsxs7("li", { className: "rounded-md border border-border/60 bg-background/40 px-2.5 py-2", children: [
|
|
2769
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex flex-wrap items-baseline gap-x-2 gap-y-1", children: [
|
|
2770
|
+
/* @__PURE__ */ jsx9("span", { className: "text-[13px] font-medium text-foreground", children: source.label }),
|
|
2771
|
+
source.locator && /* @__PURE__ */ jsx9("span", { className: "text-[11px] text-muted-foreground", children: source.locator }),
|
|
2772
|
+
openable && (onOpenSource ? /* @__PURE__ */ jsxs7(
|
|
3078
2773
|
"button",
|
|
3079
2774
|
{
|
|
3080
2775
|
type: "button",
|
|
@@ -3085,7 +2780,7 @@ function SourceRow({
|
|
|
3085
2780
|
source.label
|
|
3086
2781
|
]
|
|
3087
2782
|
}
|
|
3088
|
-
) : /* @__PURE__ */
|
|
2783
|
+
) : /* @__PURE__ */ jsxs7(
|
|
3089
2784
|
"a",
|
|
3090
2785
|
{
|
|
3091
2786
|
href: source.href,
|
|
@@ -3099,7 +2794,7 @@ function SourceRow({
|
|
|
3099
2794
|
}
|
|
3100
2795
|
))
|
|
3101
2796
|
] }),
|
|
3102
|
-
source.quote && /* @__PURE__ */
|
|
2797
|
+
source.quote && /* @__PURE__ */ jsxs7("blockquote", { className: "mt-1 border-l-2 border-primary/50 pl-2 text-[12px] italic leading-snug text-foreground", children: [
|
|
3103
2798
|
"\u201C",
|
|
3104
2799
|
source.quote,
|
|
3105
2800
|
"\u201D"
|
|
@@ -3108,14 +2803,14 @@ function SourceRow({
|
|
|
3108
2803
|
// update is theirs to read, not an interruption. Either way it is TEXT
|
|
3109
2804
|
// — a spinner alone and a greyed row alone both render as "nothing
|
|
3110
2805
|
// here".
|
|
3111
|
-
/* @__PURE__ */
|
|
2806
|
+
/* @__PURE__ */ jsxs7(
|
|
3112
2807
|
"p",
|
|
3113
2808
|
{
|
|
3114
2809
|
role: "status",
|
|
3115
2810
|
className: `mt-1 text-[11px] ${status === "unavailable" ? "text-destructive" : "text-muted-foreground"}`,
|
|
3116
2811
|
children: [
|
|
3117
2812
|
statusLine,
|
|
3118
|
-
status === "unavailable" && onRetrySource && /* @__PURE__ */
|
|
2813
|
+
status === "unavailable" && onRetrySource && /* @__PURE__ */ jsx9(
|
|
3119
2814
|
"button",
|
|
3120
2815
|
{
|
|
3121
2816
|
type: "button",
|
|
@@ -3139,9 +2834,9 @@ function ProvenanceValue({
|
|
|
3139
2834
|
missingValueLabel = DEFAULT_MISSING_VALUE_LABEL,
|
|
3140
2835
|
className
|
|
3141
2836
|
}) {
|
|
3142
|
-
const [open, setOpen] =
|
|
3143
|
-
const triggerRef =
|
|
3144
|
-
const rootRef =
|
|
2837
|
+
const [open, setOpen] = useState11(defaultOpen);
|
|
2838
|
+
const triggerRef = useRef7(null);
|
|
2839
|
+
const rootRef = useRef7(null);
|
|
3145
2840
|
const panelId = useId();
|
|
3146
2841
|
const standing = rollUpProvenanceStanding(record, confidencePolicy);
|
|
3147
2842
|
const basisMeta = provenanceBasisMeta(record.basis);
|
|
@@ -3164,7 +2859,7 @@ function ProvenanceValue({
|
|
|
3164
2859
|
if (!open) closeTrailsOutside(rootRef.current);
|
|
3165
2860
|
setOpen(!open);
|
|
3166
2861
|
}, [open]);
|
|
3167
|
-
|
|
2862
|
+
useEffect8(() => {
|
|
3168
2863
|
const root = rootRef.current;
|
|
3169
2864
|
if (!open || root === null) return;
|
|
3170
2865
|
const entry = { root, close: () => setOpen(false) };
|
|
@@ -3182,12 +2877,12 @@ function ProvenanceValue({
|
|
|
3182
2877
|
document.removeEventListener("touchstart", onPointerDown, true);
|
|
3183
2878
|
};
|
|
3184
2879
|
}, [open]);
|
|
3185
|
-
const summary = /* @__PURE__ */
|
|
3186
|
-
record.label && /* @__PURE__ */
|
|
3187
|
-
/* @__PURE__ */
|
|
2880
|
+
const summary = /* @__PURE__ */ jsxs7("span", { className: "inline-flex flex-wrap items-baseline gap-x-1.5", children: [
|
|
2881
|
+
record.label && /* @__PURE__ */ jsx9("span", { className: "text-[11px] text-muted-foreground", children: record.label }),
|
|
2882
|
+
/* @__PURE__ */ jsx9("span", { className: hasValue ? "text-sm text-foreground" : "text-sm italic text-muted-foreground", children: hasValue ? record.display : missingValueLabel })
|
|
3188
2883
|
] });
|
|
3189
2884
|
if (maxDepth <= 0) {
|
|
3190
|
-
return /* @__PURE__ */
|
|
2885
|
+
return /* @__PURE__ */ jsxs7(
|
|
3191
2886
|
"div",
|
|
3192
2887
|
{
|
|
3193
2888
|
className: `inline-block max-w-full ${className ?? ""}`,
|
|
@@ -3195,22 +2890,22 @@ function ProvenanceValue({
|
|
|
3195
2890
|
"data-provenance-standing": standing,
|
|
3196
2891
|
children: [
|
|
3197
2892
|
summary,
|
|
3198
|
-
/* @__PURE__ */
|
|
2893
|
+
/* @__PURE__ */ jsxs7(
|
|
3199
2894
|
"span",
|
|
3200
2895
|
{
|
|
3201
2896
|
className: `ml-1.5 inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10px] font-medium ${BASIS_TONES[record.basis]}`,
|
|
3202
2897
|
children: [
|
|
3203
|
-
/* @__PURE__ */
|
|
2898
|
+
/* @__PURE__ */ jsx9(BasisGlyph, { basis: record.basis, className: "h-3 w-3" }),
|
|
3204
2899
|
basisMeta.label
|
|
3205
2900
|
]
|
|
3206
2901
|
}
|
|
3207
2902
|
),
|
|
3208
|
-
/* @__PURE__ */
|
|
2903
|
+
/* @__PURE__ */ jsx9("span", { className: "mt-0.5 block text-[11px] text-muted-foreground", children: describeProvenance(record) })
|
|
3209
2904
|
]
|
|
3210
2905
|
}
|
|
3211
2906
|
);
|
|
3212
2907
|
}
|
|
3213
|
-
return /* @__PURE__ */
|
|
2908
|
+
return /* @__PURE__ */ jsxs7(
|
|
3214
2909
|
"div",
|
|
3215
2910
|
{
|
|
3216
2911
|
ref: rootRef,
|
|
@@ -3219,9 +2914,9 @@ function ProvenanceValue({
|
|
|
3219
2914
|
"data-provenance-basis": record.basis,
|
|
3220
2915
|
"data-provenance-standing": standing,
|
|
3221
2916
|
children: [
|
|
3222
|
-
/* @__PURE__ */
|
|
2917
|
+
/* @__PURE__ */ jsxs7("span", { className: "inline-flex flex-wrap items-baseline gap-1.5", children: [
|
|
3223
2918
|
summary,
|
|
3224
|
-
/* @__PURE__ */
|
|
2919
|
+
/* @__PURE__ */ jsxs7(
|
|
3225
2920
|
"button",
|
|
3226
2921
|
{
|
|
3227
2922
|
ref: triggerRef,
|
|
@@ -3232,17 +2927,17 @@ function ProvenanceValue({
|
|
|
3232
2927
|
"aria-label": provenanceTriggerLabel(record, standing),
|
|
3233
2928
|
className: `inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10px] font-medium transition hover:brightness-105 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring ${BASIS_TONES[record.basis]}`,
|
|
3234
2929
|
children: [
|
|
3235
|
-
/* @__PURE__ */
|
|
3236
|
-
/* @__PURE__ */
|
|
2930
|
+
/* @__PURE__ */ jsx9(BasisGlyph, { basis: record.basis, className: "h-3 w-3" }),
|
|
2931
|
+
/* @__PURE__ */ jsx9("span", { "aria-hidden": true, children: basisMeta.label })
|
|
3237
2932
|
]
|
|
3238
2933
|
}
|
|
3239
2934
|
),
|
|
3240
2935
|
standing !== "settled" && // Legible at rest: what to do about the value does not wait for
|
|
3241
2936
|
// someone to open the panel. `aria-hidden` because the trigger's
|
|
3242
2937
|
// accessible name already carries it — this is the visual half.
|
|
3243
|
-
/* @__PURE__ */
|
|
2938
|
+
/* @__PURE__ */ jsx9("span", { "aria-hidden": true, className: `text-[10px] font-medium ${STANDING_TONES[standing]}`, children: standingMeta.label })
|
|
3244
2939
|
] }),
|
|
3245
|
-
open && /* @__PURE__ */
|
|
2940
|
+
open && /* @__PURE__ */ jsxs7(
|
|
3246
2941
|
"div",
|
|
3247
2942
|
{
|
|
3248
2943
|
id: panelId,
|
|
@@ -3250,19 +2945,19 @@ function ProvenanceValue({
|
|
|
3250
2945
|
"aria-label": provenanceTriggerLabel(record, standing),
|
|
3251
2946
|
className: "mt-1.5 w-full min-w-0 space-y-2 rounded-lg border border-border bg-card px-3 py-2.5 text-left",
|
|
3252
2947
|
children: [
|
|
3253
|
-
/* @__PURE__ */
|
|
3254
|
-
/* @__PURE__ */
|
|
3255
|
-
/* @__PURE__ */
|
|
2948
|
+
/* @__PURE__ */ jsxs7("div", { children: [
|
|
2949
|
+
/* @__PURE__ */ jsx9("p", { className: "text-[12px] leading-snug text-foreground", children: describeProvenance(record) }),
|
|
2950
|
+
/* @__PURE__ */ jsxs7("p", { className: `mt-0.5 text-[11px] leading-snug ${STANDING_TONES[standing]}`, children: [
|
|
3256
2951
|
standingMeta.label,
|
|
3257
2952
|
" \u2014 ",
|
|
3258
2953
|
provenanceNextMove(record, standing, confidencePolicy)
|
|
3259
2954
|
] }),
|
|
3260
|
-
basisMeta.checkableAgainst === null && /* @__PURE__ */
|
|
2955
|
+
basisMeta.checkableAgainst === null && /* @__PURE__ */ jsxs7("p", { className: "mt-0.5 text-[11px] leading-snug text-muted-foreground", children: [
|
|
3261
2956
|
basisMeta.meaning,
|
|
3262
2957
|
" There is nothing outside the model to check it against."
|
|
3263
2958
|
] })
|
|
3264
2959
|
] }),
|
|
3265
|
-
sources.length > 0 && /* @__PURE__ */
|
|
2960
|
+
sources.length > 0 && /* @__PURE__ */ jsx9("ul", { className: "space-y-1.5", children: sources.map((source, index) => /* @__PURE__ */ jsx9(
|
|
3266
2961
|
SourceRow,
|
|
3267
2962
|
{
|
|
3268
2963
|
source,
|
|
@@ -3275,12 +2970,12 @@ function ProvenanceValue({
|
|
|
3275
2970
|
gaps.filter((gap) => gap.kind !== "unavailable-source").map((gap) => (
|
|
3276
2971
|
// An unavailable source already states itself on its own row; a
|
|
3277
2972
|
// structural gap has no row to state it, so it gets one here.
|
|
3278
|
-
/* @__PURE__ */
|
|
2973
|
+
/* @__PURE__ */ jsx9("p", { className: "rounded-md bg-destructive/10 px-2 py-1.5 text-[11px] leading-snug text-destructive", children: gap.message }, gap.kind)
|
|
3279
2974
|
)),
|
|
3280
|
-
loading.length > 0 && sources.length === 0 && /* @__PURE__ */
|
|
3281
|
-
inputs.length > 0 && /* @__PURE__ */
|
|
3282
|
-
/* @__PURE__ */
|
|
3283
|
-
/* @__PURE__ */
|
|
2975
|
+
loading.length > 0 && sources.length === 0 && /* @__PURE__ */ jsx9("p", { role: "status", className: "text-[11px] text-muted-foreground", children: "Looking up where this came from\u2026" }),
|
|
2976
|
+
inputs.length > 0 && /* @__PURE__ */ jsxs7("div", { className: "border-t border-border/60 pt-2", children: [
|
|
2977
|
+
/* @__PURE__ */ jsx9("p", { className: "text-[10px] font-medium uppercase tracking-wide text-muted-foreground", children: record.derivation ? `Computed from ${record.derivation}` : "Computed from" }),
|
|
2978
|
+
/* @__PURE__ */ jsx9("ul", { className: "mt-1.5 space-y-1.5", children: inputs.map((input, index) => /* @__PURE__ */ jsx9("li", { children: /* @__PURE__ */ jsx9(
|
|
3284
2979
|
ProvenanceValue,
|
|
3285
2980
|
{
|
|
3286
2981
|
record: input,
|
|
@@ -3301,26 +2996,26 @@ function ProvenanceValue({
|
|
|
3301
2996
|
}
|
|
3302
2997
|
function ProvenanceLegend({ bases, className }) {
|
|
3303
2998
|
if (bases.length === 0) return null;
|
|
3304
|
-
return /* @__PURE__ */
|
|
2999
|
+
return /* @__PURE__ */ jsx9("ul", { className: `flex flex-wrap items-center gap-x-3 gap-y-1.5 ${className ?? ""}`, children: bases.map((basis) => {
|
|
3305
3000
|
const meta = provenanceBasisMeta(basis);
|
|
3306
|
-
return /* @__PURE__ */
|
|
3307
|
-
/* @__PURE__ */
|
|
3001
|
+
return /* @__PURE__ */ jsxs7("li", { className: "flex items-center gap-1.5 text-[11px] text-muted-foreground", children: [
|
|
3002
|
+
/* @__PURE__ */ jsxs7(
|
|
3308
3003
|
"span",
|
|
3309
3004
|
{
|
|
3310
3005
|
className: `inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10px] font-medium ${BASIS_TONES[basis]}`,
|
|
3311
3006
|
children: [
|
|
3312
|
-
/* @__PURE__ */
|
|
3007
|
+
/* @__PURE__ */ jsx9(BasisGlyph, { basis, className: "h-3 w-3" }),
|
|
3313
3008
|
meta.label
|
|
3314
3009
|
]
|
|
3315
3010
|
}
|
|
3316
3011
|
),
|
|
3317
|
-
/* @__PURE__ */
|
|
3012
|
+
/* @__PURE__ */ jsx9("span", { children: meta.meaning })
|
|
3318
3013
|
] }, basis);
|
|
3319
3014
|
}) });
|
|
3320
3015
|
}
|
|
3321
3016
|
|
|
3322
3017
|
// src/web-react/seat-paywall.tsx
|
|
3323
|
-
import { Fragment as
|
|
3018
|
+
import { Fragment as Fragment4, jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
3324
3019
|
function usd(cents) {
|
|
3325
3020
|
return new Intl.NumberFormat("en-US", {
|
|
3326
3021
|
style: "currency",
|
|
@@ -3330,7 +3025,7 @@ function usd(cents) {
|
|
|
3330
3025
|
}).format(cents / 100);
|
|
3331
3026
|
}
|
|
3332
3027
|
function CheckGlyph3() {
|
|
3333
|
-
return /* @__PURE__ */
|
|
3028
|
+
return /* @__PURE__ */ jsx10(
|
|
3334
3029
|
"svg",
|
|
3335
3030
|
{
|
|
3336
3031
|
className: "h-4 w-4 shrink-0 text-primary",
|
|
@@ -3341,14 +3036,14 @@ function CheckGlyph3() {
|
|
|
3341
3036
|
strokeLinecap: "round",
|
|
3342
3037
|
strokeLinejoin: "round",
|
|
3343
3038
|
"aria-hidden": true,
|
|
3344
|
-
children: /* @__PURE__ */
|
|
3039
|
+
children: /* @__PURE__ */ jsx10("path", { d: "M20 6 9 17l-5-5" })
|
|
3345
3040
|
}
|
|
3346
3041
|
);
|
|
3347
3042
|
}
|
|
3348
3043
|
function Benefit({ children }) {
|
|
3349
|
-
return /* @__PURE__ */
|
|
3350
|
-
/* @__PURE__ */
|
|
3351
|
-
/* @__PURE__ */
|
|
3044
|
+
return /* @__PURE__ */ jsxs8("li", { className: "flex items-start gap-2.5 text-sm text-foreground", children: [
|
|
3045
|
+
/* @__PURE__ */ jsx10("span", { className: "mt-0.5", children: /* @__PURE__ */ jsx10(CheckGlyph3, {}) }),
|
|
3046
|
+
/* @__PURE__ */ jsx10("span", { children })
|
|
3352
3047
|
] });
|
|
3353
3048
|
}
|
|
3354
3049
|
function SeatPaywall({
|
|
@@ -3366,46 +3061,46 @@ function SeatPaywall({
|
|
|
3366
3061
|
const recurringPrice = offer ? usd(offer.recurring.priceCents) : `$${priceUsd}`;
|
|
3367
3062
|
const recurringUsage = offer ? usd(offer.recurring.includedCreditsCents) : `$${includedUsageUsd}`;
|
|
3368
3063
|
const introductory = offer?.introductory ?? null;
|
|
3369
|
-
return /* @__PURE__ */
|
|
3370
|
-
/* @__PURE__ */
|
|
3371
|
-
/* @__PURE__ */
|
|
3064
|
+
return /* @__PURE__ */ jsx10("div", { className: "flex min-h-[60vh] w-full items-center justify-center p-6", children: /* @__PURE__ */ jsxs8("div", { className: "w-full max-w-md rounded-2xl border border-border bg-card p-8 shadow-sm", children: [
|
|
3065
|
+
/* @__PURE__ */ jsx10("p", { className: "text-xs font-medium uppercase tracking-wide text-muted-foreground", children: product }),
|
|
3066
|
+
/* @__PURE__ */ jsxs8("h1", { className: "mt-2 text-2xl font-semibold tracking-tight text-foreground", children: [
|
|
3372
3067
|
"Unlock ",
|
|
3373
3068
|
product
|
|
3374
3069
|
] }),
|
|
3375
|
-
tagline && /* @__PURE__ */
|
|
3376
|
-
introductory ? /* @__PURE__ */
|
|
3377
|
-
/* @__PURE__ */
|
|
3378
|
-
/* @__PURE__ */
|
|
3379
|
-
/* @__PURE__ */
|
|
3070
|
+
tagline && /* @__PURE__ */ jsx10("p", { className: "mt-2 text-sm text-muted-foreground", children: tagline }),
|
|
3071
|
+
introductory ? /* @__PURE__ */ jsxs8(Fragment4, { children: [
|
|
3072
|
+
/* @__PURE__ */ jsxs8("div", { className: "mt-6 flex items-baseline gap-1.5", children: [
|
|
3073
|
+
/* @__PURE__ */ jsx10("span", { className: "text-3xl font-semibold text-foreground", children: usd(introductory.priceCents) }),
|
|
3074
|
+
/* @__PURE__ */ jsx10("span", { className: "text-sm text-muted-foreground", children: "first month" })
|
|
3380
3075
|
] }),
|
|
3381
|
-
/* @__PURE__ */
|
|
3076
|
+
/* @__PURE__ */ jsxs8("p", { className: "mt-1 text-sm text-muted-foreground", children: [
|
|
3382
3077
|
"Includes ",
|
|
3383
3078
|
usd(introductory.includedCreditsCents),
|
|
3384
3079
|
" of AI usage in your first month"
|
|
3385
3080
|
] }),
|
|
3386
|
-
/* @__PURE__ */
|
|
3081
|
+
/* @__PURE__ */ jsxs8("p", { className: "mt-1 text-sm text-muted-foreground", children: [
|
|
3387
3082
|
"Then ",
|
|
3388
3083
|
recurringPrice,
|
|
3389
3084
|
"/mo \xB7 includes ",
|
|
3390
3085
|
recurringUsage,
|
|
3391
3086
|
"/mo of AI usage"
|
|
3392
3087
|
] })
|
|
3393
|
-
] }) : /* @__PURE__ */
|
|
3394
|
-
/* @__PURE__ */
|
|
3395
|
-
/* @__PURE__ */
|
|
3396
|
-
/* @__PURE__ */
|
|
3088
|
+
] }) : /* @__PURE__ */ jsxs8(Fragment4, { children: [
|
|
3089
|
+
/* @__PURE__ */ jsxs8("div", { className: "mt-6 flex items-baseline gap-1.5", children: [
|
|
3090
|
+
/* @__PURE__ */ jsx10("span", { className: "text-3xl font-semibold text-foreground", children: recurringPrice }),
|
|
3091
|
+
/* @__PURE__ */ jsx10("span", { className: "text-sm text-muted-foreground", children: "/mo" })
|
|
3397
3092
|
] }),
|
|
3398
|
-
/* @__PURE__ */
|
|
3093
|
+
/* @__PURE__ */ jsxs8("p", { className: "mt-1 text-sm text-muted-foreground", children: [
|
|
3399
3094
|
"Includes ",
|
|
3400
3095
|
recurringUsage,
|
|
3401
3096
|
"/mo of AI usage"
|
|
3402
3097
|
] })
|
|
3403
3098
|
] }),
|
|
3404
|
-
/* @__PURE__ */
|
|
3099
|
+
/* @__PURE__ */ jsx10("ul", { className: "mt-6 space-y-2.5", children: (benefits ?? [
|
|
3405
3100
|
`Full access to ${product}`,
|
|
3406
3101
|
`${recurringUsage}/mo of AI usage included`
|
|
3407
|
-
]).map((benefit, i) => /* @__PURE__ */
|
|
3408
|
-
/* @__PURE__ */
|
|
3102
|
+
]).map((benefit, i) => /* @__PURE__ */ jsx10(Benefit, { children: benefit }, i)) }),
|
|
3103
|
+
/* @__PURE__ */ jsx10(
|
|
3409
3104
|
"button",
|
|
3410
3105
|
{
|
|
3411
3106
|
type: "button",
|
|
@@ -3415,32 +3110,32 @@ function SeatPaywall({
|
|
|
3415
3110
|
children: pending ? "Opening checkout\u2026" : ctaLabel ?? `Unlock ${product}`
|
|
3416
3111
|
}
|
|
3417
3112
|
),
|
|
3418
|
-
footnote && /* @__PURE__ */
|
|
3113
|
+
footnote && /* @__PURE__ */ jsx10("p", { className: "mt-3 text-center text-xs text-muted-foreground/70", children: footnote })
|
|
3419
3114
|
] }) });
|
|
3420
3115
|
}
|
|
3421
3116
|
|
|
3422
3117
|
// src/web-react/session-history.tsx
|
|
3423
3118
|
import {
|
|
3424
3119
|
useCallback as useCallback8,
|
|
3425
|
-
useEffect as
|
|
3426
|
-
useMemo as
|
|
3427
|
-
useRef as
|
|
3428
|
-
useState as
|
|
3120
|
+
useEffect as useEffect9,
|
|
3121
|
+
useMemo as useMemo5,
|
|
3122
|
+
useRef as useRef8,
|
|
3123
|
+
useState as useState12
|
|
3429
3124
|
} from "react";
|
|
3430
|
-
import { Fragment as
|
|
3125
|
+
import { Fragment as Fragment5, jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
3431
3126
|
function rethrowAsync(error) {
|
|
3432
3127
|
queueMicrotask(() => {
|
|
3433
3128
|
throw error;
|
|
3434
3129
|
});
|
|
3435
3130
|
}
|
|
3436
3131
|
function useInfiniteScroll(onLoadMore, { enabled, root, rootMargin = "300px" }) {
|
|
3437
|
-
const [sentinel, setSentinel] =
|
|
3132
|
+
const [sentinel, setSentinel] = useState12(null);
|
|
3438
3133
|
const sentinelRef = useCallback8((node) => setSentinel(node), []);
|
|
3439
|
-
const onLoadMoreRef =
|
|
3440
|
-
|
|
3134
|
+
const onLoadMoreRef = useRef8(onLoadMore);
|
|
3135
|
+
useEffect9(() => {
|
|
3441
3136
|
onLoadMoreRef.current = onLoadMore;
|
|
3442
3137
|
}, [onLoadMore]);
|
|
3443
|
-
|
|
3138
|
+
useEffect9(() => {
|
|
3444
3139
|
if (!sentinel || !enabled) return;
|
|
3445
3140
|
if (typeof IntersectionObserver === "undefined") return;
|
|
3446
3141
|
const observer = new IntersectionObserver(
|
|
@@ -3469,24 +3164,24 @@ function useSessionHistory({
|
|
|
3469
3164
|
initialPage,
|
|
3470
3165
|
defaultSort = "newest"
|
|
3471
3166
|
}) {
|
|
3472
|
-
const [items, setItems] =
|
|
3473
|
-
const [nextCursor, setNextCursor] =
|
|
3474
|
-
const [phase, setPhase] =
|
|
3475
|
-
const [reloadKey, setReloadKey] =
|
|
3476
|
-
const seqRef =
|
|
3477
|
-
const resetAbortRef =
|
|
3478
|
-
const loadMoreAbortRef =
|
|
3479
|
-
const loadingMoreRef =
|
|
3480
|
-
const lastOpRef =
|
|
3481
|
-
const nextCursorRef =
|
|
3167
|
+
const [items, setItems] = useState12(initialPage.items);
|
|
3168
|
+
const [nextCursor, setNextCursor] = useState12(initialPage.nextCursor ?? null);
|
|
3169
|
+
const [phase, setPhase] = useState12("idle");
|
|
3170
|
+
const [reloadKey, setReloadKey] = useState12(0);
|
|
3171
|
+
const seqRef = useRef8(0);
|
|
3172
|
+
const resetAbortRef = useRef8(null);
|
|
3173
|
+
const loadMoreAbortRef = useRef8(null);
|
|
3174
|
+
const loadingMoreRef = useRef8(false);
|
|
3175
|
+
const lastOpRef = useRef8("first");
|
|
3176
|
+
const nextCursorRef = useRef8(nextCursor);
|
|
3482
3177
|
nextCursorRef.current = nextCursor;
|
|
3483
|
-
const viewRef =
|
|
3178
|
+
const viewRef = useRef8({ q, sort, fetchPage });
|
|
3484
3179
|
viewRef.current = { q, sort, fetchPage };
|
|
3485
|
-
const seedRef =
|
|
3180
|
+
const seedRef = useRef8(initialPage);
|
|
3486
3181
|
seedRef.current = initialPage;
|
|
3487
3182
|
const isDefaultView = q === "" && sort === defaultSort;
|
|
3488
|
-
const seedKey =
|
|
3489
|
-
|
|
3183
|
+
const seedKey = useMemo5(() => seedSignature(initialPage), [initialPage]);
|
|
3184
|
+
useEffect9(() => {
|
|
3490
3185
|
resetAbortRef.current?.abort();
|
|
3491
3186
|
loadMoreAbortRef.current?.abort();
|
|
3492
3187
|
loadingMoreRef.current = false;
|
|
@@ -3549,7 +3244,7 @@ function useSessionHistory({
|
|
|
3549
3244
|
const reload = useCallback8(() => {
|
|
3550
3245
|
setReloadKey((key) => key + 1);
|
|
3551
3246
|
}, []);
|
|
3552
|
-
|
|
3247
|
+
useEffect9(
|
|
3553
3248
|
() => () => {
|
|
3554
3249
|
resetAbortRef.current?.abort();
|
|
3555
3250
|
loadMoreAbortRef.current?.abort();
|
|
@@ -3590,11 +3285,11 @@ function useSessionActions({
|
|
|
3590
3285
|
labels
|
|
3591
3286
|
}) {
|
|
3592
3287
|
const text = { ...DEFAULT_LABELS, ...labels };
|
|
3593
|
-
const [renameTarget, setRenameTarget] =
|
|
3594
|
-
const [renameValue, setRenameValue] =
|
|
3595
|
-
const [deleteTarget, setDeleteTarget] =
|
|
3596
|
-
const [busy, setBusy] =
|
|
3597
|
-
const [error, setError] =
|
|
3288
|
+
const [renameTarget, setRenameTarget] = useState12(null);
|
|
3289
|
+
const [renameValue, setRenameValue] = useState12("");
|
|
3290
|
+
const [deleteTarget, setDeleteTarget] = useState12(null);
|
|
3291
|
+
const [busy, setBusy] = useState12(false);
|
|
3292
|
+
const [error, setError] = useState12(null);
|
|
3598
3293
|
const openRename = useCallback8((session) => {
|
|
3599
3294
|
setError(null);
|
|
3600
3295
|
setRenameTarget(session);
|
|
@@ -3645,21 +3340,21 @@ function useSessionActions({
|
|
|
3645
3340
|
setBusy(false);
|
|
3646
3341
|
}
|
|
3647
3342
|
}, [deleteTarget, currentSessionId, deleteSession, notify, onChanged, onDeletedCurrent, text.deleted, text.deleteFailed]);
|
|
3648
|
-
const dialogs = /* @__PURE__ */
|
|
3649
|
-
renameTarget && /* @__PURE__ */
|
|
3343
|
+
const dialogs = /* @__PURE__ */ jsxs9(Fragment5, { children: [
|
|
3344
|
+
renameTarget && /* @__PURE__ */ jsxs9(
|
|
3650
3345
|
SessionDialog,
|
|
3651
3346
|
{
|
|
3652
3347
|
title: text.renameTitle,
|
|
3653
3348
|
onClose: () => setRenameTarget(null),
|
|
3654
3349
|
busy,
|
|
3655
3350
|
error,
|
|
3656
|
-
footer: /* @__PURE__ */
|
|
3657
|
-
/* @__PURE__ */
|
|
3658
|
-
/* @__PURE__ */
|
|
3351
|
+
footer: /* @__PURE__ */ jsxs9(Fragment5, { children: [
|
|
3352
|
+
/* @__PURE__ */ jsx11(DialogButton, { onClick: () => setRenameTarget(null), disabled: busy, variant: "ghost", children: text.cancel }),
|
|
3353
|
+
/* @__PURE__ */ jsx11(DialogButton, { onClick: () => void submitRename(), disabled: busy || !renameValue.trim(), children: text.renameSubmit })
|
|
3659
3354
|
] }),
|
|
3660
3355
|
children: [
|
|
3661
|
-
/* @__PURE__ */
|
|
3662
|
-
/* @__PURE__ */
|
|
3356
|
+
/* @__PURE__ */ jsx11("label", { htmlFor: "agent-app-rename-session", className: "text-xs text-muted-foreground", children: text.renameField }),
|
|
3357
|
+
/* @__PURE__ */ jsx11(
|
|
3663
3358
|
"input",
|
|
3664
3359
|
{
|
|
3665
3360
|
id: "agent-app-rename-session",
|
|
@@ -3678,18 +3373,18 @@ function useSessionActions({
|
|
|
3678
3373
|
]
|
|
3679
3374
|
}
|
|
3680
3375
|
),
|
|
3681
|
-
deleteTarget && /* @__PURE__ */
|
|
3376
|
+
deleteTarget && /* @__PURE__ */ jsx11(
|
|
3682
3377
|
SessionDialog,
|
|
3683
3378
|
{
|
|
3684
3379
|
title: text.deleteTitle,
|
|
3685
3380
|
onClose: () => setDeleteTarget(null),
|
|
3686
3381
|
busy,
|
|
3687
3382
|
error,
|
|
3688
|
-
footer: /* @__PURE__ */
|
|
3689
|
-
/* @__PURE__ */
|
|
3690
|
-
/* @__PURE__ */
|
|
3383
|
+
footer: /* @__PURE__ */ jsxs9(Fragment5, { children: [
|
|
3384
|
+
/* @__PURE__ */ jsx11(DialogButton, { onClick: () => setDeleteTarget(null), disabled: busy, variant: "ghost", children: text.cancel }),
|
|
3385
|
+
/* @__PURE__ */ jsx11(DialogButton, { onClick: () => void confirmDelete(), disabled: busy, variant: "destructive", children: text.deleteSubmit })
|
|
3691
3386
|
] }),
|
|
3692
|
-
children: /* @__PURE__ */
|
|
3387
|
+
children: /* @__PURE__ */ jsx11("p", { className: "text-sm text-muted-foreground", children: text.deleteBody(sessionLabel(deleteTarget)) })
|
|
3693
3388
|
}
|
|
3694
3389
|
)
|
|
3695
3390
|
] });
|
|
@@ -3702,7 +3397,7 @@ function DialogButton({
|
|
|
3702
3397
|
variant = "primary"
|
|
3703
3398
|
}) {
|
|
3704
3399
|
const tone = variant === "ghost" ? "text-muted-foreground hover:bg-accent/30 hover:text-foreground" : variant === "destructive" ? "bg-destructive text-destructive-foreground hover:opacity-90" : "bg-primary text-primary-foreground hover:opacity-90";
|
|
3705
|
-
return /* @__PURE__ */
|
|
3400
|
+
return /* @__PURE__ */ jsx11(
|
|
3706
3401
|
"button",
|
|
3707
3402
|
{
|
|
3708
3403
|
type: "button",
|
|
@@ -3721,15 +3416,15 @@ function SessionDialog({
|
|
|
3721
3416
|
busy,
|
|
3722
3417
|
error
|
|
3723
3418
|
}) {
|
|
3724
|
-
|
|
3419
|
+
useEffect9(() => {
|
|
3725
3420
|
const onKey = (e) => {
|
|
3726
3421
|
if (e.key === "Escape" && !busy) onClose();
|
|
3727
3422
|
};
|
|
3728
3423
|
document.addEventListener("keydown", onKey);
|
|
3729
3424
|
return () => document.removeEventListener("keydown", onKey);
|
|
3730
3425
|
}, [busy, onClose]);
|
|
3731
|
-
return /* @__PURE__ */
|
|
3732
|
-
/* @__PURE__ */
|
|
3426
|
+
return /* @__PURE__ */ jsxs9("div", { className: "fixed inset-0 z-50 flex items-center justify-center p-4", children: [
|
|
3427
|
+
/* @__PURE__ */ jsx11(
|
|
3733
3428
|
"div",
|
|
3734
3429
|
{
|
|
3735
3430
|
className: "absolute inset-0 bg-black/50",
|
|
@@ -3739,7 +3434,7 @@ function SessionDialog({
|
|
|
3739
3434
|
"aria-hidden": true
|
|
3740
3435
|
}
|
|
3741
3436
|
),
|
|
3742
|
-
/* @__PURE__ */
|
|
3437
|
+
/* @__PURE__ */ jsxs9(
|
|
3743
3438
|
"div",
|
|
3744
3439
|
{
|
|
3745
3440
|
role: "dialog",
|
|
@@ -3747,17 +3442,17 @@ function SessionDialog({
|
|
|
3747
3442
|
"aria-label": title,
|
|
3748
3443
|
className: "relative w-full max-w-sm rounded-xl border border-border bg-card p-5 shadow-lg",
|
|
3749
3444
|
children: [
|
|
3750
|
-
/* @__PURE__ */
|
|
3751
|
-
/* @__PURE__ */
|
|
3752
|
-
error && /* @__PURE__ */
|
|
3753
|
-
/* @__PURE__ */
|
|
3445
|
+
/* @__PURE__ */ jsx11("h2", { className: "text-sm font-semibold text-foreground", children: title }),
|
|
3446
|
+
/* @__PURE__ */ jsx11("div", { className: "mt-3", children }),
|
|
3447
|
+
error && /* @__PURE__ */ jsx11("p", { role: "alert", className: "mt-3 rounded-md bg-destructive/10 px-3 py-2 text-xs text-destructive", children: error }),
|
|
3448
|
+
/* @__PURE__ */ jsx11("div", { className: "mt-5 flex justify-end gap-2", children: footer })
|
|
3754
3449
|
]
|
|
3755
3450
|
}
|
|
3756
3451
|
)
|
|
3757
3452
|
] });
|
|
3758
3453
|
}
|
|
3759
3454
|
function AnchorLink({ to, className, children }) {
|
|
3760
|
-
return /* @__PURE__ */
|
|
3455
|
+
return /* @__PURE__ */ jsx11("a", { href: to, className, children });
|
|
3761
3456
|
}
|
|
3762
3457
|
var MINUTE = 6e4;
|
|
3763
3458
|
var HOUR = 60 * MINUTE;
|
|
@@ -3774,17 +3469,17 @@ function formatSessionTimestamp(isoDate) {
|
|
|
3774
3469
|
return new Date(at).toLocaleDateString(void 0, { month: "short", day: "numeric" });
|
|
3775
3470
|
}
|
|
3776
3471
|
function SkeletonRows() {
|
|
3777
|
-
return /* @__PURE__ */
|
|
3778
|
-
/* @__PURE__ */
|
|
3779
|
-
/* @__PURE__ */
|
|
3780
|
-
/* @__PURE__ */
|
|
3781
|
-
/* @__PURE__ */
|
|
3782
|
-
/* @__PURE__ */
|
|
3472
|
+
return /* @__PURE__ */ jsxs9(Fragment5, { children: [
|
|
3473
|
+
/* @__PURE__ */ jsx11("span", { role: "status", "aria-live": "polite", "aria-busy": true, className: "sr-only", children: "Loading sessions\u2026" }),
|
|
3474
|
+
/* @__PURE__ */ jsx11("div", { className: "flex flex-col gap-0.5", "aria-hidden": true, children: Array.from({ length: 8 }).map((_, i) => /* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-3 px-3 py-2.5", children: [
|
|
3475
|
+
/* @__PURE__ */ jsx11("div", { className: "h-4 w-4 animate-pulse rounded bg-muted" }),
|
|
3476
|
+
/* @__PURE__ */ jsx11("div", { className: "h-4 w-1/2 animate-pulse rounded bg-muted" }),
|
|
3477
|
+
/* @__PURE__ */ jsx11("div", { className: "ml-auto h-3 w-12 animate-pulse rounded bg-muted" })
|
|
3783
3478
|
] }, i)) })
|
|
3784
3479
|
] });
|
|
3785
3480
|
}
|
|
3786
3481
|
function MessageIcon({ className }) {
|
|
3787
|
-
return /* @__PURE__ */
|
|
3482
|
+
return /* @__PURE__ */ jsx11("svg", { viewBox: "0 0 24 24", className, fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx11("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" }) });
|
|
3788
3483
|
}
|
|
3789
3484
|
function SessionHistoryPanel({
|
|
3790
3485
|
history,
|
|
@@ -3811,7 +3506,7 @@ function SessionHistoryPanel({
|
|
|
3811
3506
|
contentWidth = "reading",
|
|
3812
3507
|
className
|
|
3813
3508
|
}) {
|
|
3814
|
-
const scrollRef =
|
|
3509
|
+
const scrollRef = useRef8(null);
|
|
3815
3510
|
const sentinelRef = useInfiniteScroll(history.loadMore, {
|
|
3816
3511
|
enabled: history.hasMore && !history.isLoadingMore && !history.isError,
|
|
3817
3512
|
root: scrollRef,
|
|
@@ -3820,15 +3515,15 @@ function SessionHistoryPanel({
|
|
|
3820
3515
|
const searchTerm = query.trim();
|
|
3821
3516
|
const isSearching = searchTerm.length > 0;
|
|
3822
3517
|
const column = contentWidth === "full" ? "w-full" : "mx-auto w-full max-w-4xl";
|
|
3823
|
-
const [selectedIds, setSelectedIds] =
|
|
3824
|
-
const [ageDays, setAgeDays] =
|
|
3825
|
-
const [bulkTarget, setBulkTarget] =
|
|
3826
|
-
const [bulkBusy, setBulkBusy] =
|
|
3827
|
-
const [bulkError, setBulkError] =
|
|
3828
|
-
|
|
3518
|
+
const [selectedIds, setSelectedIds] = useState12(/* @__PURE__ */ new Set());
|
|
3519
|
+
const [ageDays, setAgeDays] = useState12("30");
|
|
3520
|
+
const [bulkTarget, setBulkTarget] = useState12(null);
|
|
3521
|
+
const [bulkBusy, setBulkBusy] = useState12(false);
|
|
3522
|
+
const [bulkError, setBulkError] = useState12(null);
|
|
3523
|
+
useEffect9(() => {
|
|
3829
3524
|
setSelectedIds(/* @__PURE__ */ new Set());
|
|
3830
3525
|
}, [searchTerm, sort]);
|
|
3831
|
-
|
|
3526
|
+
useEffect9(() => {
|
|
3832
3527
|
const visible = new Set(history.items.map((item) => item.id));
|
|
3833
3528
|
setSelectedIds((current) => {
|
|
3834
3529
|
const next = new Set([...current].filter((id) => visible.has(id)));
|
|
@@ -3871,25 +3566,25 @@ function SessionHistoryPanel({
|
|
|
3871
3566
|
setBulkBusy(false);
|
|
3872
3567
|
}
|
|
3873
3568
|
}, [bulkTarget, deleteLabel, history, onBulkAction]);
|
|
3874
|
-
return /* @__PURE__ */
|
|
3875
|
-
/* @__PURE__ */
|
|
3876
|
-
/* @__PURE__ */
|
|
3877
|
-
newSessionHref && /* @__PURE__ */
|
|
3569
|
+
return /* @__PURE__ */ jsxs9("div", { className: `flex min-h-0 min-w-0 flex-1 flex-col ${className ?? ""}`, children: [
|
|
3570
|
+
/* @__PURE__ */ jsx11("header", { className: "flex h-14 shrink-0 items-center border-b border-border px-4 sm:px-6", children: /* @__PURE__ */ jsxs9("div", { className: `flex items-center gap-3 px-3 ${column}`, children: [
|
|
3571
|
+
/* @__PURE__ */ jsx11("h1", { className: "flex-1 truncate text-sm font-semibold text-foreground", children: title }),
|
|
3572
|
+
newSessionHref && /* @__PURE__ */ jsxs9(
|
|
3878
3573
|
Link,
|
|
3879
3574
|
{
|
|
3880
3575
|
to: newSessionHref,
|
|
3881
3576
|
className: "inline-flex h-8 shrink-0 items-center gap-1.5 rounded-md bg-primary px-3 text-xs font-medium text-primary-foreground transition hover:opacity-90",
|
|
3882
3577
|
children: [
|
|
3883
|
-
/* @__PURE__ */
|
|
3578
|
+
/* @__PURE__ */ jsx11("span", { "aria-hidden": true, className: "text-sm leading-none", children: "+" }),
|
|
3884
3579
|
"New chat"
|
|
3885
3580
|
]
|
|
3886
3581
|
}
|
|
3887
3582
|
)
|
|
3888
3583
|
] }) }),
|
|
3889
|
-
/* @__PURE__ */
|
|
3890
|
-
hasAnySessions && /* @__PURE__ */
|
|
3891
|
-
/* @__PURE__ */
|
|
3892
|
-
/* @__PURE__ */
|
|
3584
|
+
/* @__PURE__ */ jsxs9("div", { ref: scrollRef, className: "min-h-0 flex-1 overflow-y-auto", children: [
|
|
3585
|
+
hasAnySessions && /* @__PURE__ */ jsxs9("div", { className: "sticky top-0 z-10 bg-background px-4 sm:px-6", children: [
|
|
3586
|
+
/* @__PURE__ */ jsxs9("div", { className: `flex flex-col gap-2 px-3 pb-3 pt-4 sm:flex-row sm:items-center sm:gap-3 ${column}`, children: [
|
|
3587
|
+
/* @__PURE__ */ jsx11(
|
|
3893
3588
|
"input",
|
|
3894
3589
|
{
|
|
3895
3590
|
type: "search",
|
|
@@ -3900,7 +3595,7 @@ function SessionHistoryPanel({
|
|
|
3900
3595
|
className: "h-9 min-w-0 appearance-none rounded-md border border-border bg-card px-3 text-sm text-foreground placeholder:text-muted-foreground sm:flex-1 [&::-webkit-search-cancel-button]:appearance-none"
|
|
3901
3596
|
}
|
|
3902
3597
|
),
|
|
3903
|
-
/* @__PURE__ */
|
|
3598
|
+
/* @__PURE__ */ jsxs9(
|
|
3904
3599
|
"select",
|
|
3905
3600
|
{
|
|
3906
3601
|
value: sort,
|
|
@@ -3908,15 +3603,15 @@ function SessionHistoryPanel({
|
|
|
3908
3603
|
"aria-label": "Sort sessions",
|
|
3909
3604
|
className: "h-9 shrink-0 appearance-none rounded-md border border-border bg-card px-2 text-sm text-foreground sm:w-[132px]",
|
|
3910
3605
|
children: [
|
|
3911
|
-
/* @__PURE__ */
|
|
3912
|
-
/* @__PURE__ */
|
|
3606
|
+
/* @__PURE__ */ jsx11("option", { value: "newest", children: "Newest" }),
|
|
3607
|
+
/* @__PURE__ */ jsx11("option", { value: "oldest", children: "Oldest" })
|
|
3913
3608
|
]
|
|
3914
3609
|
}
|
|
3915
3610
|
)
|
|
3916
3611
|
] }),
|
|
3917
|
-
onBulkAction && /* @__PURE__ */
|
|
3918
|
-
/* @__PURE__ */
|
|
3919
|
-
/* @__PURE__ */
|
|
3612
|
+
onBulkAction && /* @__PURE__ */ jsxs9("div", { className: `flex flex-col gap-2 border-t border-border/60 px-3 py-3 ${column}`, children: [
|
|
3613
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
3614
|
+
/* @__PURE__ */ jsx11(
|
|
3920
3615
|
"button",
|
|
3921
3616
|
{
|
|
3922
3617
|
type: "button",
|
|
@@ -3926,7 +3621,7 @@ function SessionHistoryPanel({
|
|
|
3926
3621
|
children: "Select all"
|
|
3927
3622
|
}
|
|
3928
3623
|
),
|
|
3929
|
-
/* @__PURE__ */
|
|
3624
|
+
/* @__PURE__ */ jsx11(
|
|
3930
3625
|
"button",
|
|
3931
3626
|
{
|
|
3932
3627
|
type: "button",
|
|
@@ -3936,11 +3631,11 @@ function SessionHistoryPanel({
|
|
|
3936
3631
|
children: "Deselect all"
|
|
3937
3632
|
}
|
|
3938
3633
|
),
|
|
3939
|
-
/* @__PURE__ */
|
|
3634
|
+
/* @__PURE__ */ jsxs9("span", { className: "text-xs text-muted-foreground", "aria-live": "polite", children: [
|
|
3940
3635
|
selectedCount,
|
|
3941
3636
|
" selected"
|
|
3942
3637
|
] }),
|
|
3943
|
-
selectedCount > 0 && /* @__PURE__ */
|
|
3638
|
+
selectedCount > 0 && /* @__PURE__ */ jsxs9(
|
|
3944
3639
|
"button",
|
|
3945
3640
|
{
|
|
3946
3641
|
type: "button",
|
|
@@ -3953,9 +3648,9 @@ function SessionHistoryPanel({
|
|
|
3953
3648
|
}
|
|
3954
3649
|
)
|
|
3955
3650
|
] }),
|
|
3956
|
-
/* @__PURE__ */
|
|
3957
|
-
/* @__PURE__ */
|
|
3958
|
-
/* @__PURE__ */
|
|
3651
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
3652
|
+
/* @__PURE__ */ jsx11("label", { htmlFor: "agent-app-session-age", className: "text-xs text-muted-foreground", children: "Session age" }),
|
|
3653
|
+
/* @__PURE__ */ jsx11(
|
|
3959
3654
|
"input",
|
|
3960
3655
|
{
|
|
3961
3656
|
id: "agent-app-session-age",
|
|
@@ -3968,8 +3663,8 @@ function SessionHistoryPanel({
|
|
|
3968
3663
|
className: "h-8 w-20 rounded-md border border-border bg-card px-2 text-xs tabular-nums text-foreground"
|
|
3969
3664
|
}
|
|
3970
3665
|
),
|
|
3971
|
-
/* @__PURE__ */
|
|
3972
|
-
/* @__PURE__ */
|
|
3666
|
+
/* @__PURE__ */ jsx11("span", { className: "text-xs text-muted-foreground", children: "days" }),
|
|
3667
|
+
/* @__PURE__ */ jsxs9(
|
|
3973
3668
|
"button",
|
|
3974
3669
|
{
|
|
3975
3670
|
type: "button",
|
|
@@ -3982,7 +3677,7 @@ function SessionHistoryPanel({
|
|
|
3982
3677
|
]
|
|
3983
3678
|
}
|
|
3984
3679
|
),
|
|
3985
|
-
/* @__PURE__ */
|
|
3680
|
+
/* @__PURE__ */ jsxs9(
|
|
3986
3681
|
"button",
|
|
3987
3682
|
{
|
|
3988
3683
|
type: "button",
|
|
@@ -3998,15 +3693,15 @@ function SessionHistoryPanel({
|
|
|
3998
3693
|
] })
|
|
3999
3694
|
] })
|
|
4000
3695
|
] }),
|
|
4001
|
-
/* @__PURE__ */
|
|
4002
|
-
/* @__PURE__ */
|
|
4003
|
-
/* @__PURE__ */
|
|
4004
|
-
] }) : history.isLoadingFirst ? /* @__PURE__ */
|
|
3696
|
+
/* @__PURE__ */ jsx11("div", { className: `px-4 pb-8 pt-1 sm:px-6 ${column}`, children: !hasAnySessions ? /* @__PURE__ */ jsxs9("div", { className: "flex min-h-[50vh] flex-col items-center justify-center gap-2 text-center", children: [
|
|
3697
|
+
/* @__PURE__ */ jsx11("p", { className: "text-sm font-medium text-foreground", children: emptyTitle }),
|
|
3698
|
+
/* @__PURE__ */ jsx11("p", { className: "max-w-xs text-xs text-muted-foreground", children: emptyDescription })
|
|
3699
|
+
] }) : history.isLoadingFirst ? /* @__PURE__ */ jsx11(SkeletonRows, {}) : history.items.length === 0 ? history.isError ? /* @__PURE__ */ jsx11(ErrorBlock, { onRetry: history.retry, message: "Couldn\u2019t load your sessions." }) : isSearching ? /* @__PURE__ */ jsxs9("p", { className: "py-16 text-center text-sm text-muted-foreground", children: [
|
|
4005
3700
|
"No sessions match \u201C",
|
|
4006
3701
|
searchTerm,
|
|
4007
3702
|
"\u201D."
|
|
4008
|
-
] }) : /* @__PURE__ */
|
|
4009
|
-
history.items.map((session) => /* @__PURE__ */
|
|
3703
|
+
] }) : /* @__PURE__ */ jsx11("p", { className: "py-16 text-center text-sm text-muted-foreground", children: "No sessions remain." }) : /* @__PURE__ */ jsxs9("div", { className: "flex flex-col gap-0.5", children: [
|
|
3704
|
+
history.items.map((session) => /* @__PURE__ */ jsx11(
|
|
4010
3705
|
SessionRow,
|
|
4011
3706
|
{
|
|
4012
3707
|
session,
|
|
@@ -4033,10 +3728,10 @@ function SessionHistoryPanel({
|
|
|
4033
3728
|
},
|
|
4034
3729
|
session.id
|
|
4035
3730
|
)),
|
|
4036
|
-
history.isError ? /* @__PURE__ */
|
|
3731
|
+
history.isError ? /* @__PURE__ */ jsx11(ErrorBlock, { onRetry: history.retry, message: "Couldn\u2019t load more sessions.", inline: true }) : history.hasMore ? /* @__PURE__ */ jsx11("div", { ref: sentinelRef, className: "flex items-center justify-center py-6", children: history.isLoadingMore && /* @__PURE__ */ jsx11("span", { role: "status", "aria-live": "polite", "aria-busy": true, className: "text-xs text-muted-foreground", children: "Loading\u2026" }) }) : null
|
|
4037
3732
|
] }) })
|
|
4038
3733
|
] }),
|
|
4039
|
-
bulkTarget && /* @__PURE__ */
|
|
3734
|
+
bulkTarget && /* @__PURE__ */ jsx11(
|
|
4040
3735
|
SessionDialog,
|
|
4041
3736
|
{
|
|
4042
3737
|
title: bulkTarget.title,
|
|
@@ -4048,8 +3743,8 @@ function SessionHistoryPanel({
|
|
|
4048
3743
|
},
|
|
4049
3744
|
busy: bulkBusy,
|
|
4050
3745
|
error: bulkError,
|
|
4051
|
-
footer: /* @__PURE__ */
|
|
4052
|
-
/* @__PURE__ */
|
|
3746
|
+
footer: /* @__PURE__ */ jsxs9(Fragment5, { children: [
|
|
3747
|
+
/* @__PURE__ */ jsx11(
|
|
4053
3748
|
DialogButton,
|
|
4054
3749
|
{
|
|
4055
3750
|
onClick: () => {
|
|
@@ -4061,21 +3756,21 @@ function SessionHistoryPanel({
|
|
|
4061
3756
|
children: "Cancel"
|
|
4062
3757
|
}
|
|
4063
3758
|
),
|
|
4064
|
-
/* @__PURE__ */
|
|
3759
|
+
/* @__PURE__ */ jsx11(DialogButton, { onClick: () => void confirmBulkAction(), disabled: bulkBusy, variant: "destructive", children: bulkBusy ? "Working\u2026" : deleteLabel })
|
|
4065
3760
|
] }),
|
|
4066
|
-
children: /* @__PURE__ */
|
|
3761
|
+
children: /* @__PURE__ */ jsx11("p", { className: "text-sm text-muted-foreground", children: bulkTarget.body })
|
|
4067
3762
|
}
|
|
4068
3763
|
)
|
|
4069
3764
|
] });
|
|
4070
3765
|
}
|
|
4071
3766
|
function ErrorBlock({ message, onRetry, inline }) {
|
|
4072
|
-
return /* @__PURE__ */
|
|
3767
|
+
return /* @__PURE__ */ jsxs9(
|
|
4073
3768
|
"div",
|
|
4074
3769
|
{
|
|
4075
3770
|
className: inline ? "flex items-center justify-center gap-3 py-6 text-sm text-muted-foreground" : "flex min-h-[40vh] flex-col items-center justify-center gap-3 text-center",
|
|
4076
3771
|
children: [
|
|
4077
|
-
/* @__PURE__ */
|
|
4078
|
-
/* @__PURE__ */
|
|
3772
|
+
/* @__PURE__ */ jsx11("span", { className: "text-sm text-muted-foreground", children: message }),
|
|
3773
|
+
/* @__PURE__ */ jsx11(
|
|
4079
3774
|
"button",
|
|
4080
3775
|
{
|
|
4081
3776
|
type: "button",
|
|
@@ -4104,12 +3799,12 @@ function SessionRow({
|
|
|
4104
3799
|
selected,
|
|
4105
3800
|
onSelectedChange
|
|
4106
3801
|
}) {
|
|
4107
|
-
const [menuOpen, setMenuOpen] =
|
|
3802
|
+
const [menuOpen, setMenuOpen] = useState12(false);
|
|
4108
3803
|
const extras = extraActions?.(session) ?? [];
|
|
4109
3804
|
const hasMenu = Boolean(onRename) || Boolean(onDelete) || extras.length > 0;
|
|
4110
3805
|
const showUnread = Boolean(session.unread) && !responding;
|
|
4111
|
-
return /* @__PURE__ */
|
|
4112
|
-
selectable && /* @__PURE__ */
|
|
3806
|
+
return /* @__PURE__ */ jsxs9("div", { className: "group relative flex items-center gap-2 rounded-lg px-3 py-2.5 transition-colors hover:bg-accent/20", children: [
|
|
3807
|
+
selectable && /* @__PURE__ */ jsx11(
|
|
4113
3808
|
"input",
|
|
4114
3809
|
{
|
|
4115
3810
|
type: "checkbox",
|
|
@@ -4119,10 +3814,10 @@ function SessionRow({
|
|
|
4119
3814
|
className: "h-4 w-4 shrink-0 rounded border-border accent-primary"
|
|
4120
3815
|
}
|
|
4121
3816
|
),
|
|
4122
|
-
/* @__PURE__ */
|
|
4123
|
-
showUnread && /* @__PURE__ */
|
|
4124
|
-
/* @__PURE__ */
|
|
4125
|
-
/* @__PURE__ */
|
|
3817
|
+
/* @__PURE__ */ jsxs9(Link, { to: href, className: "flex min-w-0 flex-1 items-center gap-3", children: [
|
|
3818
|
+
showUnread && /* @__PURE__ */ jsx11("span", { className: "h-1.5 w-1.5 shrink-0 rounded-full bg-primary", "aria-hidden": true }),
|
|
3819
|
+
/* @__PURE__ */ jsx11(MessageIcon, { className: "h-4 w-4 shrink-0 text-muted-foreground" }),
|
|
3820
|
+
/* @__PURE__ */ jsx11(
|
|
4126
3821
|
"span",
|
|
4127
3822
|
{
|
|
4128
3823
|
className: `truncate text-sm ${responding ? "text-muted-foreground" : "text-foreground"} ${showUnread ? "font-semibold" : ""}`,
|
|
@@ -4131,9 +3826,9 @@ function SessionRow({
|
|
|
4131
3826
|
}
|
|
4132
3827
|
)
|
|
4133
3828
|
] }),
|
|
4134
|
-
/* @__PURE__ */
|
|
4135
|
-
hasMenu && /* @__PURE__ */
|
|
4136
|
-
/* @__PURE__ */
|
|
3829
|
+
/* @__PURE__ */ jsx11("span", { className: "shrink-0 text-xs tabular-nums text-muted-foreground", children: timestamp }),
|
|
3830
|
+
hasMenu && /* @__PURE__ */ jsxs9("div", { className: "relative shrink-0", children: [
|
|
3831
|
+
/* @__PURE__ */ jsx11(
|
|
4137
3832
|
"button",
|
|
4138
3833
|
{
|
|
4139
3834
|
type: "button",
|
|
@@ -4141,13 +3836,13 @@ function SessionRow({
|
|
|
4141
3836
|
"aria-expanded": menuOpen,
|
|
4142
3837
|
onClick: () => setMenuOpen((open) => !open),
|
|
4143
3838
|
className: "flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground transition hover:bg-muted hover:text-foreground focus-visible:opacity-100 sm:opacity-0 sm:group-hover:opacity-100 aria-expanded:opacity-100",
|
|
4144
|
-
children: /* @__PURE__ */
|
|
3839
|
+
children: /* @__PURE__ */ jsx11("span", { "aria-hidden": true, className: "text-base leading-none", children: "\u22EF" })
|
|
4145
3840
|
}
|
|
4146
3841
|
),
|
|
4147
|
-
menuOpen && /* @__PURE__ */
|
|
4148
|
-
/* @__PURE__ */
|
|
4149
|
-
/* @__PURE__ */
|
|
4150
|
-
onRename && /* @__PURE__ */
|
|
3842
|
+
menuOpen && /* @__PURE__ */ jsxs9(Fragment5, { children: [
|
|
3843
|
+
/* @__PURE__ */ jsx11("div", { className: "fixed inset-0 z-20", onClick: () => setMenuOpen(false), "aria-hidden": true }),
|
|
3844
|
+
/* @__PURE__ */ jsxs9("div", { className: "absolute right-0 z-30 mt-1 w-36 overflow-hidden rounded-md border border-border bg-card py-1 shadow-lg", children: [
|
|
3845
|
+
onRename && /* @__PURE__ */ jsx11(
|
|
4151
3846
|
"button",
|
|
4152
3847
|
{
|
|
4153
3848
|
type: "button",
|
|
@@ -4159,7 +3854,7 @@ function SessionRow({
|
|
|
4159
3854
|
children: renameLabel
|
|
4160
3855
|
}
|
|
4161
3856
|
),
|
|
4162
|
-
extras.map((action) => /* @__PURE__ */
|
|
3857
|
+
extras.map((action) => /* @__PURE__ */ jsx11(
|
|
4163
3858
|
"button",
|
|
4164
3859
|
{
|
|
4165
3860
|
type: "button",
|
|
@@ -4172,7 +3867,7 @@ function SessionRow({
|
|
|
4172
3867
|
},
|
|
4173
3868
|
action.id
|
|
4174
3869
|
)),
|
|
4175
|
-
onDelete && /* @__PURE__ */
|
|
3870
|
+
onDelete && /* @__PURE__ */ jsx11(
|
|
4176
3871
|
"button",
|
|
4177
3872
|
{
|
|
4178
3873
|
type: "button",
|
|
@@ -4192,14 +3887,14 @@ function SessionRow({
|
|
|
4192
3887
|
|
|
4193
3888
|
// src/web-react/record-grid.tsx
|
|
4194
3889
|
import {
|
|
4195
|
-
Fragment as
|
|
3890
|
+
Fragment as Fragment6,
|
|
4196
3891
|
isValidElement,
|
|
4197
3892
|
useCallback as useCallback9,
|
|
4198
|
-
useEffect as
|
|
3893
|
+
useEffect as useEffect10,
|
|
4199
3894
|
useId as useId2,
|
|
4200
|
-
useMemo as
|
|
4201
|
-
useRef as
|
|
4202
|
-
useState as
|
|
3895
|
+
useMemo as useMemo6,
|
|
3896
|
+
useRef as useRef9,
|
|
3897
|
+
useState as useState13
|
|
4203
3898
|
} from "react";
|
|
4204
3899
|
|
|
4205
3900
|
// src/web-react/record-grid-model.ts
|
|
@@ -4529,7 +4224,7 @@ function pruneRecordGridOverlay(rows, overlay) {
|
|
|
4529
4224
|
}
|
|
4530
4225
|
|
|
4531
4226
|
// src/web-react/record-grid.tsx
|
|
4532
|
-
import { jsx as
|
|
4227
|
+
import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
4533
4228
|
var EMPTY_RECORD_GRID_ROWS = [];
|
|
4534
4229
|
var CELL_KEY_SEPARATOR = "\0";
|
|
4535
4230
|
function cellKey(rowId, columnId) {
|
|
@@ -4584,33 +4279,33 @@ function RecordGrid({
|
|
|
4584
4279
|
className
|
|
4585
4280
|
}) {
|
|
4586
4281
|
const fieldPrefix = useId2();
|
|
4587
|
-
const [overlay, setOverlay] =
|
|
4588
|
-
const [editing, setEditingState] =
|
|
4589
|
-
const [cellErrors, setCellErrors] =
|
|
4590
|
-
const [rowErrors, setRowErrors] =
|
|
4591
|
-
const [pendingRows, setPendingRows] =
|
|
4592
|
-
const [focus, setFocus] =
|
|
4593
|
-
const [openSource, setOpenSource] =
|
|
4594
|
-
const [confirmDelete, setConfirmDelete] =
|
|
4595
|
-
const [adding, setAdding] =
|
|
4596
|
-
const [draft, setDraft] =
|
|
4597
|
-
const [draftErrors, setDraftErrors] =
|
|
4598
|
-
const [draftError, setDraftError] =
|
|
4599
|
-
const [creating, setCreating] =
|
|
4600
|
-
const cellRefs =
|
|
4601
|
-
const settling =
|
|
4602
|
-
const draftCounter =
|
|
4603
|
-
const editingRef =
|
|
4282
|
+
const [overlay, setOverlay] = useState13(EMPTY_RECORD_GRID_OVERLAY);
|
|
4283
|
+
const [editing, setEditingState] = useState13(null);
|
|
4284
|
+
const [cellErrors, setCellErrors] = useState13({});
|
|
4285
|
+
const [rowErrors, setRowErrors] = useState13({});
|
|
4286
|
+
const [pendingRows, setPendingRows] = useState13({});
|
|
4287
|
+
const [focus, setFocus] = useState13(null);
|
|
4288
|
+
const [openSource, setOpenSource] = useState13(null);
|
|
4289
|
+
const [confirmDelete, setConfirmDelete] = useState13(null);
|
|
4290
|
+
const [adding, setAdding] = useState13(false);
|
|
4291
|
+
const [draft, setDraft] = useState13({ ...newRowDefaults ?? {} });
|
|
4292
|
+
const [draftErrors, setDraftErrors] = useState13({});
|
|
4293
|
+
const [draftError, setDraftError] = useState13(null);
|
|
4294
|
+
const [creating, setCreating] = useState13(false);
|
|
4295
|
+
const cellRefs = useRef9(/* @__PURE__ */ new Map());
|
|
4296
|
+
const settling = useRef9(false);
|
|
4297
|
+
const draftCounter = useRef9(0);
|
|
4298
|
+
const editingRef = useRef9(null);
|
|
4604
4299
|
const setEditing = useCallback9((next) => {
|
|
4605
4300
|
editingRef.current = next;
|
|
4606
4301
|
setEditingState(next);
|
|
4607
4302
|
}, []);
|
|
4608
4303
|
const callerRows = state.status === "ready" || state.status === "empty" ? state.value : EMPTY_RECORD_GRID_ROWS;
|
|
4609
|
-
|
|
4304
|
+
useEffect10(() => {
|
|
4610
4305
|
setOverlay((current) => pruneRecordGridOverlay(callerRows, current));
|
|
4611
4306
|
}, [callerRows]);
|
|
4612
|
-
const visibleRows =
|
|
4613
|
-
const activeFocus =
|
|
4307
|
+
const visibleRows = useMemo6(() => projectRecordGridRows(callerRows, overlay), [callerRows, overlay]);
|
|
4308
|
+
const activeFocus = useMemo6(() => {
|
|
4614
4309
|
if (focus === null) return null;
|
|
4615
4310
|
if (!visibleRows.some((row) => row.id === focus.rowId)) return null;
|
|
4616
4311
|
if (!columns.some((column) => column.id === focus.columnId)) return null;
|
|
@@ -4819,9 +4514,9 @@ function RecordGrid({
|
|
|
4819
4514
|
[beginEdit, columns, editing, focusCell, onUpdate, visibleRows]
|
|
4820
4515
|
);
|
|
4821
4516
|
if (state.status === "idle" || state.status === "loading") {
|
|
4822
|
-
return /* @__PURE__ */
|
|
4517
|
+
return /* @__PURE__ */ jsxs10("div", { className: `space-y-3 ${className ?? ""}`, children: [
|
|
4823
4518
|
toolbar,
|
|
4824
|
-
/* @__PURE__ */
|
|
4519
|
+
/* @__PURE__ */ jsxs10(
|
|
4825
4520
|
"div",
|
|
4826
4521
|
{
|
|
4827
4522
|
role: "status",
|
|
@@ -4829,22 +4524,22 @@ function RecordGrid({
|
|
|
4829
4524
|
"aria-live": "polite",
|
|
4830
4525
|
className: "space-y-2 rounded-xl border border-border bg-card p-4",
|
|
4831
4526
|
children: [
|
|
4832
|
-
/* @__PURE__ */
|
|
4527
|
+
/* @__PURE__ */ jsxs10("span", { className: "sr-only", children: [
|
|
4833
4528
|
"Loading ",
|
|
4834
4529
|
caption
|
|
4835
4530
|
] }),
|
|
4836
|
-
Array.from({ length: Math.max(1, loadingRowCount) }, (_, index) => /* @__PURE__ */
|
|
4531
|
+
Array.from({ length: Math.max(1, loadingRowCount) }, (_, index) => /* @__PURE__ */ jsx12("div", { className: "h-8 animate-pulse rounded-md bg-muted/50", "aria-hidden": true }, index))
|
|
4837
4532
|
]
|
|
4838
4533
|
}
|
|
4839
4534
|
)
|
|
4840
4535
|
] });
|
|
4841
4536
|
}
|
|
4842
4537
|
if (state.status === "error") {
|
|
4843
|
-
return /* @__PURE__ */
|
|
4538
|
+
return /* @__PURE__ */ jsxs10("div", { className: `space-y-3 ${className ?? ""}`, children: [
|
|
4844
4539
|
toolbar,
|
|
4845
|
-
/* @__PURE__ */
|
|
4846
|
-
/* @__PURE__ */
|
|
4847
|
-
/* @__PURE__ */
|
|
4540
|
+
/* @__PURE__ */ jsxs10("div", { role: "alert", className: "rounded-xl border border-destructive/40 bg-destructive/10 px-4 py-4", children: [
|
|
4541
|
+
/* @__PURE__ */ jsx12("p", { className: "text-sm font-medium text-destructive", children: state.message }),
|
|
4542
|
+
/* @__PURE__ */ jsx12(
|
|
4848
4543
|
"button",
|
|
4849
4544
|
{
|
|
4850
4545
|
type: "button",
|
|
@@ -4856,7 +4551,7 @@ function RecordGrid({
|
|
|
4856
4551
|
] })
|
|
4857
4552
|
] });
|
|
4858
4553
|
}
|
|
4859
|
-
const addForm = adding && onCreate ? /* @__PURE__ */
|
|
4554
|
+
const addForm = adding && onCreate ? /* @__PURE__ */ jsx12(
|
|
4860
4555
|
AddRecordForm,
|
|
4861
4556
|
{
|
|
4862
4557
|
columns,
|
|
@@ -4875,13 +4570,13 @@ function RecordGrid({
|
|
|
4875
4570
|
}
|
|
4876
4571
|
) : null;
|
|
4877
4572
|
if (visibleRows.length === 0) {
|
|
4878
|
-
return /* @__PURE__ */
|
|
4573
|
+
return /* @__PURE__ */ jsxs10("div", { className: `space-y-3 ${className ?? ""}`, children: [
|
|
4879
4574
|
toolbar,
|
|
4880
|
-
addForm ?? /* @__PURE__ */
|
|
4881
|
-
/* @__PURE__ */
|
|
4882
|
-
empty.description && /* @__PURE__ */
|
|
4883
|
-
/* @__PURE__ */
|
|
4884
|
-
empty.action && (isValidElement(empty.action) ? empty.action : /* @__PURE__ */
|
|
4575
|
+
addForm ?? /* @__PURE__ */ jsxs10("div", { className: "rounded-xl border border-dashed border-border px-6 py-10 text-center", children: [
|
|
4576
|
+
/* @__PURE__ */ jsx12("p", { className: "text-sm font-medium text-foreground", children: empty.title }),
|
|
4577
|
+
empty.description && /* @__PURE__ */ jsx12("p", { className: "mx-auto mt-1 max-w-md text-sm text-muted-foreground", children: empty.description }),
|
|
4578
|
+
/* @__PURE__ */ jsxs10("div", { className: "mt-4 flex flex-wrap items-center justify-center gap-2", children: [
|
|
4579
|
+
empty.action && (isValidElement(empty.action) ? empty.action : /* @__PURE__ */ jsx12(
|
|
4885
4580
|
"button",
|
|
4886
4581
|
{
|
|
4887
4582
|
type: "button",
|
|
@@ -4890,7 +4585,7 @@ function RecordGrid({
|
|
|
4890
4585
|
children: empty.action.label
|
|
4891
4586
|
}
|
|
4892
4587
|
)),
|
|
4893
|
-
onCreate && /* @__PURE__ */
|
|
4588
|
+
onCreate && /* @__PURE__ */ jsx12(
|
|
4894
4589
|
"button",
|
|
4895
4590
|
{
|
|
4896
4591
|
type: "button",
|
|
@@ -4905,9 +4600,9 @@ function RecordGrid({
|
|
|
4905
4600
|
}
|
|
4906
4601
|
const hasFooter = columns.some((column) => column.footerValue !== void 0);
|
|
4907
4602
|
const columnSpan = columns.length + (onDelete ? 1 : 0);
|
|
4908
|
-
return /* @__PURE__ */
|
|
4603
|
+
return /* @__PURE__ */ jsxs10("div", { className: `space-y-3 ${className ?? ""}`, children: [
|
|
4909
4604
|
toolbar,
|
|
4910
|
-
/* @__PURE__ */
|
|
4605
|
+
/* @__PURE__ */ jsx12("div", { className: "overflow-x-auto rounded-xl border border-border bg-card", children: /* @__PURE__ */ jsxs10(
|
|
4911
4606
|
"table",
|
|
4912
4607
|
{
|
|
4913
4608
|
role: "grid",
|
|
@@ -4915,8 +4610,8 @@ function RecordGrid({
|
|
|
4915
4610
|
className: "w-full border-collapse text-left text-sm",
|
|
4916
4611
|
onKeyDown: handleGridKeyDown,
|
|
4917
4612
|
children: [
|
|
4918
|
-
/* @__PURE__ */
|
|
4919
|
-
columns.map((column) => /* @__PURE__ */
|
|
4613
|
+
/* @__PURE__ */ jsx12("thead", { children: /* @__PURE__ */ jsxs10("tr", { role: "row", className: "border-b border-border text-[11px] uppercase tracking-wide text-muted-foreground", children: [
|
|
4614
|
+
columns.map((column) => /* @__PURE__ */ jsx12(
|
|
4920
4615
|
"th",
|
|
4921
4616
|
{
|
|
4922
4617
|
role: "columnheader",
|
|
@@ -4926,14 +4621,14 @@ function RecordGrid({
|
|
|
4926
4621
|
},
|
|
4927
4622
|
column.id
|
|
4928
4623
|
)),
|
|
4929
|
-
onDelete && /* @__PURE__ */
|
|
4624
|
+
onDelete && /* @__PURE__ */ jsx12("th", { role: "columnheader", scope: "col", className: "w-px px-3 py-2 font-medium", children: /* @__PURE__ */ jsx12("span", { className: "sr-only", children: "Row actions" }) })
|
|
4930
4625
|
] }) }),
|
|
4931
|
-
/* @__PURE__ */
|
|
4626
|
+
/* @__PURE__ */ jsx12("tbody", { children: visibleRows.map((row) => {
|
|
4932
4627
|
const rowLabel = recordGridRowLabel(columns, row);
|
|
4933
4628
|
const pending = row.id in pendingRows;
|
|
4934
4629
|
const rowError = rowErrors[row.id];
|
|
4935
|
-
return /* @__PURE__ */
|
|
4936
|
-
/* @__PURE__ */
|
|
4630
|
+
return /* @__PURE__ */ jsxs10(Fragment6, { children: [
|
|
4631
|
+
/* @__PURE__ */ jsxs10("tr", { role: "row", "aria-busy": pending, className: `border-b border-border/50 ${pending ? "opacity-60" : ""}`, children: [
|
|
4937
4632
|
columns.map((column) => {
|
|
4938
4633
|
const key = cellKey(row.id, column.id);
|
|
4939
4634
|
const applicable = isRecordGridCellApplicable(column, row.values);
|
|
@@ -4945,8 +4640,8 @@ function RecordGrid({
|
|
|
4945
4640
|
const source = row.sources?.[column.id];
|
|
4946
4641
|
const errorId = `${fieldPrefix}-cell-error-${row.id}-${column.id}`;
|
|
4947
4642
|
if (isEditing && editable) {
|
|
4948
|
-
return /* @__PURE__ */
|
|
4949
|
-
/* @__PURE__ */
|
|
4643
|
+
return /* @__PURE__ */ jsxs10("td", { role: "gridcell", className: `px-3 py-1.5 ${alignmentClass(column)}`, children: [
|
|
4644
|
+
/* @__PURE__ */ jsx12(
|
|
4950
4645
|
CellEditor,
|
|
4951
4646
|
{
|
|
4952
4647
|
column,
|
|
@@ -4959,11 +4654,11 @@ function RecordGrid({
|
|
|
4959
4654
|
onCancel: () => cancelEdit(row, column)
|
|
4960
4655
|
}
|
|
4961
4656
|
),
|
|
4962
|
-
cellError !== void 0 && /* @__PURE__ */
|
|
4657
|
+
cellError !== void 0 && /* @__PURE__ */ jsx12("p", { id: errorId, role: "alert", className: "mt-1 text-[11px] leading-snug text-destructive", children: cellError })
|
|
4963
4658
|
] }, column.id);
|
|
4964
4659
|
}
|
|
4965
4660
|
if (column.kind === "boolean" && editable) {
|
|
4966
|
-
return /* @__PURE__ */
|
|
4661
|
+
return /* @__PURE__ */ jsx12("td", { role: "gridcell", className: `px-3 py-2 ${alignmentClass(column)}`, children: /* @__PURE__ */ jsx12(
|
|
4967
4662
|
"input",
|
|
4968
4663
|
{
|
|
4969
4664
|
type: "checkbox",
|
|
@@ -4982,7 +4677,7 @@ function RecordGrid({
|
|
|
4982
4677
|
) }, column.id);
|
|
4983
4678
|
}
|
|
4984
4679
|
const display = applicable ? formatRecordGridValue(column, value, locale) : "";
|
|
4985
|
-
return /* @__PURE__ */
|
|
4680
|
+
return /* @__PURE__ */ jsx12(
|
|
4986
4681
|
"td",
|
|
4987
4682
|
{
|
|
4988
4683
|
role: "gridcell",
|
|
@@ -5000,9 +4695,9 @@ function RecordGrid({
|
|
|
5000
4695
|
className: `px-3 py-2 outline-none focus:ring-2 focus:ring-inset focus:ring-primary/50 ${alignmentClass(
|
|
5001
4696
|
column
|
|
5002
4697
|
)} ${editable ? "cursor-text" : ""}`,
|
|
5003
|
-
children: /* @__PURE__ */
|
|
5004
|
-
/* @__PURE__ */
|
|
5005
|
-
source && /* @__PURE__ */
|
|
4698
|
+
children: /* @__PURE__ */ jsxs10("span", { className: "inline-flex max-w-full items-center gap-1.5", children: [
|
|
4699
|
+
/* @__PURE__ */ jsx12("span", { className: display === "" ? "text-muted-foreground" : "truncate text-foreground", children: display === "" ? applicable ? "\u2014" : "n/a" : display }),
|
|
4700
|
+
source && /* @__PURE__ */ jsx12(
|
|
5006
4701
|
SourceMarker,
|
|
5007
4702
|
{
|
|
5008
4703
|
panelId: `${fieldPrefix}-source-${row.id}-${column.id}`,
|
|
@@ -5018,8 +4713,8 @@ function RecordGrid({
|
|
|
5018
4713
|
column.id
|
|
5019
4714
|
);
|
|
5020
4715
|
}),
|
|
5021
|
-
onDelete && /* @__PURE__ */
|
|
5022
|
-
/* @__PURE__ */
|
|
4716
|
+
onDelete && /* @__PURE__ */ jsx12("td", { role: "gridcell", className: "px-3 py-2 text-right", children: row.readOnly === true ? null : confirmDelete === row.id ? /* @__PURE__ */ jsxs10("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
4717
|
+
/* @__PURE__ */ jsx12(
|
|
5023
4718
|
"button",
|
|
5024
4719
|
{
|
|
5025
4720
|
type: "button",
|
|
@@ -5029,7 +4724,7 @@ function RecordGrid({
|
|
|
5029
4724
|
children: "Delete"
|
|
5030
4725
|
}
|
|
5031
4726
|
),
|
|
5032
|
-
/* @__PURE__ */
|
|
4727
|
+
/* @__PURE__ */ jsx12(
|
|
5033
4728
|
"button",
|
|
5034
4729
|
{
|
|
5035
4730
|
type: "button",
|
|
@@ -5039,14 +4734,14 @@ function RecordGrid({
|
|
|
5039
4734
|
children: "Cancel"
|
|
5040
4735
|
}
|
|
5041
4736
|
)
|
|
5042
|
-
] }) : /* @__PURE__ */
|
|
4737
|
+
] }) : /* @__PURE__ */ jsx12(
|
|
5043
4738
|
"button",
|
|
5044
4739
|
{
|
|
5045
4740
|
type: "button",
|
|
5046
4741
|
"aria-label": `Delete ${rowLabel}`,
|
|
5047
4742
|
onClick: () => setConfirmDelete(row.id),
|
|
5048
4743
|
className: "rounded-md p-1.5 text-muted-foreground transition hover:bg-destructive/10 hover:text-destructive",
|
|
5049
|
-
children: /* @__PURE__ */
|
|
4744
|
+
children: /* @__PURE__ */ jsxs10(
|
|
5050
4745
|
"svg",
|
|
5051
4746
|
{
|
|
5052
4747
|
viewBox: "0 0 24 24",
|
|
@@ -5058,19 +4753,19 @@ function RecordGrid({
|
|
|
5058
4753
|
strokeLinejoin: "round",
|
|
5059
4754
|
"aria-hidden": true,
|
|
5060
4755
|
children: [
|
|
5061
|
-
/* @__PURE__ */
|
|
5062
|
-
/* @__PURE__ */
|
|
4756
|
+
/* @__PURE__ */ jsx12("polyline", { points: "3 6 5 6 21 6" }),
|
|
4757
|
+
/* @__PURE__ */ jsx12("path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" })
|
|
5063
4758
|
]
|
|
5064
4759
|
}
|
|
5065
4760
|
)
|
|
5066
4761
|
}
|
|
5067
4762
|
) })
|
|
5068
4763
|
] }),
|
|
5069
|
-
rowError !== void 0 && /* @__PURE__ */
|
|
4764
|
+
rowError !== void 0 && /* @__PURE__ */ jsx12("tr", { role: "row", className: "border-b border-border/50", children: /* @__PURE__ */ jsx12("td", { role: "gridcell", colSpan: columnSpan, className: "px-3 pb-2", children: /* @__PURE__ */ jsx12("p", { role: "alert", className: "rounded-md bg-destructive/10 px-2.5 py-1.5 text-xs text-destructive", children: rowError }) }) })
|
|
5070
4765
|
] }, row.id);
|
|
5071
4766
|
}) }),
|
|
5072
|
-
hasFooter && /* @__PURE__ */
|
|
5073
|
-
columns.map((column) => /* @__PURE__ */
|
|
4767
|
+
hasFooter && /* @__PURE__ */ jsx12("tfoot", { children: /* @__PURE__ */ jsxs10("tr", { role: "row", className: "border-t-2 border-border", children: [
|
|
4768
|
+
columns.map((column) => /* @__PURE__ */ jsx12(
|
|
5074
4769
|
"td",
|
|
5075
4770
|
{
|
|
5076
4771
|
role: "gridcell",
|
|
@@ -5079,19 +4774,19 @@ function RecordGrid({
|
|
|
5079
4774
|
},
|
|
5080
4775
|
column.id
|
|
5081
4776
|
)),
|
|
5082
|
-
onDelete && /* @__PURE__ */
|
|
4777
|
+
onDelete && /* @__PURE__ */ jsx12("td", { role: "gridcell" })
|
|
5083
4778
|
] }) })
|
|
5084
4779
|
]
|
|
5085
4780
|
}
|
|
5086
4781
|
) }),
|
|
5087
|
-
onCreate && (addForm ?? /* @__PURE__ */
|
|
4782
|
+
onCreate && (addForm ?? /* @__PURE__ */ jsxs10(
|
|
5088
4783
|
"button",
|
|
5089
4784
|
{
|
|
5090
4785
|
type: "button",
|
|
5091
4786
|
onClick: openAdd,
|
|
5092
4787
|
className: "inline-flex items-center gap-1.5 rounded-md border border-border px-3 py-1.5 text-sm font-medium text-foreground transition hover:bg-accent/30",
|
|
5093
4788
|
children: [
|
|
5094
|
-
/* @__PURE__ */
|
|
4789
|
+
/* @__PURE__ */ jsxs10(
|
|
5095
4790
|
"svg",
|
|
5096
4791
|
{
|
|
5097
4792
|
viewBox: "0 0 24 24",
|
|
@@ -5103,8 +4798,8 @@ function RecordGrid({
|
|
|
5103
4798
|
strokeLinejoin: "round",
|
|
5104
4799
|
"aria-hidden": true,
|
|
5105
4800
|
children: [
|
|
5106
|
-
/* @__PURE__ */
|
|
5107
|
-
/* @__PURE__ */
|
|
4801
|
+
/* @__PURE__ */ jsx12("line", { x1: "12", y1: "5", x2: "12", y2: "19" }),
|
|
4802
|
+
/* @__PURE__ */ jsx12("line", { x1: "5", y1: "12", x2: "19", y2: "12" })
|
|
5108
4803
|
]
|
|
5109
4804
|
}
|
|
5110
4805
|
),
|
|
@@ -5123,7 +4818,7 @@ function CellEditor({ column, rowLabel, text, invalid, describedBy, onText, onCo
|
|
|
5123
4818
|
className: INPUT_CLASS
|
|
5124
4819
|
};
|
|
5125
4820
|
if (column.kind === "select") {
|
|
5126
|
-
return /* @__PURE__ */
|
|
4821
|
+
return /* @__PURE__ */ jsxs10(
|
|
5127
4822
|
"select",
|
|
5128
4823
|
{
|
|
5129
4824
|
...shared,
|
|
@@ -5140,8 +4835,8 @@ function CellEditor({ column, rowLabel, text, invalid, describedBy, onText, onCo
|
|
|
5140
4835
|
},
|
|
5141
4836
|
onBlur: () => onCommit(text),
|
|
5142
4837
|
children: [
|
|
5143
|
-
/* @__PURE__ */
|
|
5144
|
-
column.options.map((option) => /* @__PURE__ */
|
|
4838
|
+
/* @__PURE__ */ jsx12("option", { value: "", children: "\u2014" }),
|
|
4839
|
+
column.options.map((option) => /* @__PURE__ */ jsx12("option", { value: option.value, children: option.label }, option.value))
|
|
5145
4840
|
]
|
|
5146
4841
|
}
|
|
5147
4842
|
);
|
|
@@ -5159,7 +4854,7 @@ function CellEditor({ column, rowLabel, text, invalid, describedBy, onText, onCo
|
|
|
5159
4854
|
}
|
|
5160
4855
|
};
|
|
5161
4856
|
if (column.kind === "text" && column.multiline === true) {
|
|
5162
|
-
return /* @__PURE__ */
|
|
4857
|
+
return /* @__PURE__ */ jsx12(
|
|
5163
4858
|
"textarea",
|
|
5164
4859
|
{
|
|
5165
4860
|
...shared,
|
|
@@ -5171,7 +4866,7 @@ function CellEditor({ column, rowLabel, text, invalid, describedBy, onText, onCo
|
|
|
5171
4866
|
}
|
|
5172
4867
|
);
|
|
5173
4868
|
}
|
|
5174
|
-
return /* @__PURE__ */
|
|
4869
|
+
return /* @__PURE__ */ jsx12(
|
|
5175
4870
|
"input",
|
|
5176
4871
|
{
|
|
5177
4872
|
...shared,
|
|
@@ -5186,8 +4881,8 @@ function CellEditor({ column, rowLabel, text, invalid, describedBy, onText, onCo
|
|
|
5186
4881
|
}
|
|
5187
4882
|
function SourceMarker({ panelId, columnHeader, rowLabel, source, open, onToggle }) {
|
|
5188
4883
|
const basis = source.basis ?? "asserted";
|
|
5189
|
-
return /* @__PURE__ */
|
|
5190
|
-
/* @__PURE__ */
|
|
4884
|
+
return /* @__PURE__ */ jsxs10("span", { className: "relative inline-flex", children: [
|
|
4885
|
+
/* @__PURE__ */ jsx12(
|
|
5191
4886
|
"button",
|
|
5192
4887
|
{
|
|
5193
4888
|
type: "button",
|
|
@@ -5200,7 +4895,7 @@ function SourceMarker({ panelId, columnHeader, rowLabel, source, open, onToggle
|
|
|
5200
4895
|
onToggle();
|
|
5201
4896
|
},
|
|
5202
4897
|
className: `inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-full border ${BASIS_TONES2[basis]}`,
|
|
5203
|
-
children: /* @__PURE__ */
|
|
4898
|
+
children: /* @__PURE__ */ jsx12(
|
|
5204
4899
|
"svg",
|
|
5205
4900
|
{
|
|
5206
4901
|
viewBox: "0 0 24 24",
|
|
@@ -5210,29 +4905,29 @@ function SourceMarker({ panelId, columnHeader, rowLabel, source, open, onToggle
|
|
|
5210
4905
|
strokeWidth: "2.5",
|
|
5211
4906
|
strokeLinecap: "round",
|
|
5212
4907
|
"aria-hidden": true,
|
|
5213
|
-
children: /* @__PURE__ */
|
|
4908
|
+
children: /* @__PURE__ */ jsx12("path", { d: "M9 8h6M9 12h6M9 16h3" })
|
|
5214
4909
|
}
|
|
5215
4910
|
)
|
|
5216
4911
|
}
|
|
5217
4912
|
),
|
|
5218
|
-
open && /* @__PURE__ */
|
|
4913
|
+
open && /* @__PURE__ */ jsxs10(
|
|
5219
4914
|
"span",
|
|
5220
4915
|
{
|
|
5221
4916
|
id: panelId,
|
|
5222
4917
|
role: "note",
|
|
5223
4918
|
className: "absolute left-0 top-5 z-10 w-64 rounded-lg border border-border bg-card p-3 text-left shadow-lg",
|
|
5224
4919
|
children: [
|
|
5225
|
-
source.quote && /* @__PURE__ */
|
|
4920
|
+
source.quote && /* @__PURE__ */ jsxs10("span", { className: "block border-l-2 border-primary/50 pl-2 text-xs italic leading-snug text-foreground", children: [
|
|
5226
4921
|
"\u201C",
|
|
5227
4922
|
source.quote,
|
|
5228
4923
|
"\u201D"
|
|
5229
4924
|
] }),
|
|
5230
|
-
/* @__PURE__ */
|
|
4925
|
+
/* @__PURE__ */ jsxs10("span", { className: "mt-2 block text-[11px] text-muted-foreground", children: [
|
|
5231
4926
|
source.label ?? "Source",
|
|
5232
4927
|
source.locator ? ` \xB7 ${source.locator}` : "",
|
|
5233
4928
|
` \xB7 ${BASIS_TITLES[basis]}`
|
|
5234
4929
|
] }),
|
|
5235
|
-
source.href && /* @__PURE__ */
|
|
4930
|
+
source.href && /* @__PURE__ */ jsx12(
|
|
5236
4931
|
"a",
|
|
5237
4932
|
{
|
|
5238
4933
|
href: source.href,
|
|
@@ -5260,8 +4955,8 @@ function AddRecordForm({
|
|
|
5260
4955
|
onSubmit,
|
|
5261
4956
|
onCancel
|
|
5262
4957
|
}) {
|
|
5263
|
-
const groups =
|
|
5264
|
-
return /* @__PURE__ */
|
|
4958
|
+
const groups = useMemo6(() => groupColumns(columns), [columns]);
|
|
4959
|
+
return /* @__PURE__ */ jsxs10(
|
|
5265
4960
|
"form",
|
|
5266
4961
|
{
|
|
5267
4962
|
noValidate: true,
|
|
@@ -5272,31 +4967,31 @@ function AddRecordForm({
|
|
|
5272
4967
|
},
|
|
5273
4968
|
className: "space-y-4 rounded-xl border border-border bg-card p-4",
|
|
5274
4969
|
children: [
|
|
5275
|
-
/* @__PURE__ */
|
|
5276
|
-
formError !== null && /* @__PURE__ */
|
|
4970
|
+
/* @__PURE__ */ jsx12("h3", { className: "text-sm font-semibold text-foreground", children: label }),
|
|
4971
|
+
formError !== null && /* @__PURE__ */ jsx12("p", { role: "alert", className: "rounded-md bg-destructive/10 px-3 py-2 text-xs text-destructive", children: formError }),
|
|
5277
4972
|
groups.map((group) => {
|
|
5278
4973
|
const fields = group.columns.filter((column) => isRecordGridCellApplicable(column, draft));
|
|
5279
4974
|
if (fields.length === 0) return null;
|
|
5280
|
-
return /* @__PURE__ */
|
|
4975
|
+
return /* @__PURE__ */ jsxs10(
|
|
5281
4976
|
"fieldset",
|
|
5282
4977
|
{
|
|
5283
4978
|
className: group.label === null ? "min-w-0" : "min-w-0 rounded-lg border border-border/70 p-3",
|
|
5284
4979
|
children: [
|
|
5285
|
-
group.label !== null && /* @__PURE__ */
|
|
5286
|
-
/* @__PURE__ */
|
|
4980
|
+
group.label !== null && /* @__PURE__ */ jsx12("legend", { className: "px-1 text-xs font-medium text-muted-foreground", children: group.label }),
|
|
4981
|
+
/* @__PURE__ */ jsx12("div", { className: "grid gap-3 sm:grid-cols-2", children: fields.map((column) => {
|
|
5287
4982
|
const fieldId = `${fieldPrefix}-${column.id}`;
|
|
5288
4983
|
const errorId = `${fieldId}-error`;
|
|
5289
4984
|
const message = errors[column.id];
|
|
5290
|
-
return /* @__PURE__ */
|
|
4985
|
+
return /* @__PURE__ */ jsxs10(
|
|
5291
4986
|
"div",
|
|
5292
4987
|
{
|
|
5293
4988
|
className: column.kind === "text" && column.multiline === true ? "sm:col-span-2" : "",
|
|
5294
4989
|
children: [
|
|
5295
|
-
/* @__PURE__ */
|
|
4990
|
+
/* @__PURE__ */ jsxs10("label", { htmlFor: fieldId, className: "mb-1 block text-xs font-medium text-muted-foreground", children: [
|
|
5296
4991
|
column.header,
|
|
5297
|
-
column.required === true && /* @__PURE__ */
|
|
4992
|
+
column.required === true && /* @__PURE__ */ jsx12("span", { className: "ml-0.5 text-destructive", children: "*" })
|
|
5298
4993
|
] }),
|
|
5299
|
-
/* @__PURE__ */
|
|
4994
|
+
/* @__PURE__ */ jsx12(
|
|
5300
4995
|
DraftField,
|
|
5301
4996
|
{
|
|
5302
4997
|
column,
|
|
@@ -5307,8 +5002,8 @@ function AddRecordForm({
|
|
|
5307
5002
|
onValue: (next) => setDraft({ ...draft, [column.id]: next })
|
|
5308
5003
|
}
|
|
5309
5004
|
),
|
|
5310
|
-
column.hint && /* @__PURE__ */
|
|
5311
|
-
message !== void 0 && /* @__PURE__ */
|
|
5005
|
+
column.hint && /* @__PURE__ */ jsx12("p", { className: "mt-1 text-[11px] text-muted-foreground", children: column.hint }),
|
|
5006
|
+
message !== void 0 && /* @__PURE__ */ jsx12("p", { id: errorId, role: "alert", className: "mt-1 text-[11px] text-destructive", children: message })
|
|
5312
5007
|
]
|
|
5313
5008
|
},
|
|
5314
5009
|
column.id
|
|
@@ -5319,8 +5014,8 @@ function AddRecordForm({
|
|
|
5319
5014
|
group.label ?? "_"
|
|
5320
5015
|
);
|
|
5321
5016
|
}),
|
|
5322
|
-
/* @__PURE__ */
|
|
5323
|
-
/* @__PURE__ */
|
|
5017
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-2", children: [
|
|
5018
|
+
/* @__PURE__ */ jsx12(
|
|
5324
5019
|
"button",
|
|
5325
5020
|
{
|
|
5326
5021
|
type: "submit",
|
|
@@ -5329,7 +5024,7 @@ function AddRecordForm({
|
|
|
5329
5024
|
children: busy ? "Saving\u2026" : "Save"
|
|
5330
5025
|
}
|
|
5331
5026
|
),
|
|
5332
|
-
/* @__PURE__ */
|
|
5027
|
+
/* @__PURE__ */ jsx12(
|
|
5333
5028
|
"button",
|
|
5334
5029
|
{
|
|
5335
5030
|
type: "button",
|
|
@@ -5350,7 +5045,7 @@ function DraftField({ column, id, value, invalid, describedBy, onValue }) {
|
|
|
5350
5045
|
"aria-describedby": describedBy
|
|
5351
5046
|
};
|
|
5352
5047
|
if (column.kind === "boolean") {
|
|
5353
|
-
return /* @__PURE__ */
|
|
5048
|
+
return /* @__PURE__ */ jsx12(
|
|
5354
5049
|
"input",
|
|
5355
5050
|
{
|
|
5356
5051
|
...shared,
|
|
@@ -5362,7 +5057,7 @@ function DraftField({ column, id, value, invalid, describedBy, onValue }) {
|
|
|
5362
5057
|
);
|
|
5363
5058
|
}
|
|
5364
5059
|
if (column.kind === "select") {
|
|
5365
|
-
return /* @__PURE__ */
|
|
5060
|
+
return /* @__PURE__ */ jsxs10(
|
|
5366
5061
|
"select",
|
|
5367
5062
|
{
|
|
5368
5063
|
...shared,
|
|
@@ -5370,14 +5065,14 @@ function DraftField({ column, id, value, invalid, describedBy, onValue }) {
|
|
|
5370
5065
|
value: typeof value === "string" ? value : "",
|
|
5371
5066
|
onChange: (event) => onValue(event.target.value === "" ? null : event.target.value),
|
|
5372
5067
|
children: [
|
|
5373
|
-
/* @__PURE__ */
|
|
5374
|
-
column.options.map((option) => /* @__PURE__ */
|
|
5068
|
+
/* @__PURE__ */ jsx12("option", { value: "", children: "\u2014" }),
|
|
5069
|
+
column.options.map((option) => /* @__PURE__ */ jsx12("option", { value: option.value, children: option.label }, option.value))
|
|
5375
5070
|
]
|
|
5376
5071
|
}
|
|
5377
5072
|
);
|
|
5378
5073
|
}
|
|
5379
5074
|
if (column.kind === "text" && column.multiline === true) {
|
|
5380
|
-
return /* @__PURE__ */
|
|
5075
|
+
return /* @__PURE__ */ jsx12(
|
|
5381
5076
|
"textarea",
|
|
5382
5077
|
{
|
|
5383
5078
|
...shared,
|
|
@@ -5389,7 +5084,7 @@ function DraftField({ column, id, value, invalid, describedBy, onValue }) {
|
|
|
5389
5084
|
);
|
|
5390
5085
|
}
|
|
5391
5086
|
if (column.kind === "number" || column.kind === "currency") {
|
|
5392
|
-
return /* @__PURE__ */
|
|
5087
|
+
return /* @__PURE__ */ jsx12(
|
|
5393
5088
|
"input",
|
|
5394
5089
|
{
|
|
5395
5090
|
...shared,
|
|
@@ -5409,7 +5104,7 @@ function DraftField({ column, id, value, invalid, describedBy, onValue }) {
|
|
|
5409
5104
|
}
|
|
5410
5105
|
);
|
|
5411
5106
|
}
|
|
5412
|
-
return /* @__PURE__ */
|
|
5107
|
+
return /* @__PURE__ */ jsx12(
|
|
5413
5108
|
"input",
|
|
5414
5109
|
{
|
|
5415
5110
|
...shared,
|
|
@@ -5421,162 +5116,8 @@ function DraftField({ column, id, value, invalid, describedBy, onValue }) {
|
|
|
5421
5116
|
);
|
|
5422
5117
|
}
|
|
5423
5118
|
|
|
5424
|
-
// src/web-react/agent-session-controls.tsx
|
|
5425
|
-
import { useMemo as useMemo8, useState as useState15 } from "react";
|
|
5426
|
-
import { jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
5427
|
-
var HARNESS_LABELS = {
|
|
5428
|
-
opencode: "OpenCode (any model)",
|
|
5429
|
-
"claude-code": "Claude Code (Anthropic)",
|
|
5430
|
-
codex: "Codex (OpenAI)",
|
|
5431
|
-
"kimi-code": "Kimi (Moonshot)",
|
|
5432
|
-
amp: "Amp",
|
|
5433
|
-
"factory-droids": "Factory Droids",
|
|
5434
|
-
cursor: "Cursor",
|
|
5435
|
-
hermes: "Hermes",
|
|
5436
|
-
forge: "Forge",
|
|
5437
|
-
pi: "Pi",
|
|
5438
|
-
openclaw: "OpenClaw",
|
|
5439
|
-
acp: "ACP",
|
|
5440
|
-
"cli-base": "CLI"
|
|
5441
|
-
};
|
|
5442
|
-
function harnessLabel(h) {
|
|
5443
|
-
return HARNESS_LABELS[h] ?? h;
|
|
5444
|
-
}
|
|
5445
|
-
function ChevronDown2({ className }) {
|
|
5446
|
-
return /* @__PURE__ */ jsx15("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx15("path", { d: "m6 9 6 6 6-6" }) });
|
|
5447
|
-
}
|
|
5448
|
-
function GearGlyph({ className }) {
|
|
5449
|
-
return /* @__PURE__ */ jsxs13("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
|
|
5450
|
-
/* @__PURE__ */ jsx15("circle", { cx: "12", cy: "12", r: "3" }),
|
|
5451
|
-
/* @__PURE__ */ jsx15("path", { d: "M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1Z" })
|
|
5452
|
-
] });
|
|
5453
|
-
}
|
|
5454
|
-
var FOCUS_RING = "";
|
|
5455
|
-
function HarnessPicker({
|
|
5456
|
-
value,
|
|
5457
|
-
onChange,
|
|
5458
|
-
available
|
|
5459
|
-
}) {
|
|
5460
|
-
const [open, setOpen] = useState15(false);
|
|
5461
|
-
const { containerRef, triggerProps } = usePopover(open, setOpen);
|
|
5462
|
-
const options = available ?? Object.keys(HARNESS_LABELS);
|
|
5463
|
-
return /* @__PURE__ */ jsxs13("div", { ref: containerRef, className: "relative inline-flex", children: [
|
|
5464
|
-
/* @__PURE__ */ jsxs13(
|
|
5465
|
-
"button",
|
|
5466
|
-
{
|
|
5467
|
-
type: "button",
|
|
5468
|
-
...triggerProps,
|
|
5469
|
-
onClick: () => setOpen(!open),
|
|
5470
|
-
title: "Agent backend",
|
|
5471
|
-
className: `inline-flex w-full items-center justify-between gap-1.5 rounded-lg border border-border bg-card px-3 py-1.5 text-sm font-medium text-foreground transition hover:bg-accent/30 ${FOCUS_RING}`,
|
|
5472
|
-
children: [
|
|
5473
|
-
/* @__PURE__ */ jsx15("span", { className: "truncate", children: harnessLabel(value) }),
|
|
5474
|
-
/* @__PURE__ */ jsx15(ChevronDown2, { className: "h-3.5 w-3.5 text-muted-foreground" })
|
|
5475
|
-
]
|
|
5476
|
-
}
|
|
5477
|
-
),
|
|
5478
|
-
open && /* @__PURE__ */ jsx15("div", { role: "menu", className: "absolute bottom-full left-0 z-50 mb-2 max-h-64 w-full min-w-[220px] overflow-y-auto rounded-xl border border-border bg-card p-1 shadow-lg", children: options.map((h) => /* @__PURE__ */ jsx15(
|
|
5479
|
-
"button",
|
|
5480
|
-
{
|
|
5481
|
-
type: "button",
|
|
5482
|
-
role: "menuitemradio",
|
|
5483
|
-
"aria-checked": h === value,
|
|
5484
|
-
onClick: () => {
|
|
5485
|
-
onChange(h);
|
|
5486
|
-
setOpen(false);
|
|
5487
|
-
},
|
|
5488
|
-
className: `flex w-full items-center rounded-md px-3 py-2 text-left text-sm transition ${FOCUS_RING} ${h === value ? "bg-primary/10 font-medium" : "hover:bg-accent/30"}`,
|
|
5489
|
-
children: harnessLabel(h)
|
|
5490
|
-
},
|
|
5491
|
-
h
|
|
5492
|
-
)) })
|
|
5493
|
-
] });
|
|
5494
|
-
}
|
|
5495
|
-
function useCoherentHandlers(props) {
|
|
5496
|
-
const { model, models, harness, onModelChange, onHarnessChange } = props;
|
|
5497
|
-
const canonicalIds = useMemo8(() => models.map((m) => m.id), [models]);
|
|
5498
|
-
const onModel = (next) => {
|
|
5499
|
-
onModelChange(next);
|
|
5500
|
-
const nextHarness = snapHarnessToModel(harness, next);
|
|
5501
|
-
if (nextHarness !== harness) onHarnessChange(nextHarness);
|
|
5502
|
-
};
|
|
5503
|
-
const onHarness = (next) => {
|
|
5504
|
-
onHarnessChange(next);
|
|
5505
|
-
const snapped = snapModelToHarness(next, model, canonicalIds);
|
|
5506
|
-
if (snapped !== model) onModelChange(snapped);
|
|
5507
|
-
};
|
|
5508
|
-
return { onModel, onHarness };
|
|
5509
|
-
}
|
|
5510
|
-
function AgentSessionControls(props) {
|
|
5511
|
-
const {
|
|
5512
|
-
models,
|
|
5513
|
-
modelsLoading,
|
|
5514
|
-
model,
|
|
5515
|
-
harness,
|
|
5516
|
-
availableHarnesses,
|
|
5517
|
-
effort,
|
|
5518
|
-
onEffortChange,
|
|
5519
|
-
layout = "inline",
|
|
5520
|
-
showHarness = true,
|
|
5521
|
-
renderProviderBadge,
|
|
5522
|
-
className
|
|
5523
|
-
} = props;
|
|
5524
|
-
const { onModel, onHarness } = useCoherentHandlers(props);
|
|
5525
|
-
const [open, setOpen] = useState15(false);
|
|
5526
|
-
const { containerRef: popoverRef, triggerProps } = usePopover(open, setOpen);
|
|
5527
|
-
const selectedModel = models.find((m) => m.id === model);
|
|
5528
|
-
const showEffort = selectedModel?.supportsReasoning ?? true;
|
|
5529
|
-
const modelPicker = /* @__PURE__ */ jsx15(
|
|
5530
|
-
ModelPicker,
|
|
5531
|
-
{
|
|
5532
|
-
value: model,
|
|
5533
|
-
onChange: onModel,
|
|
5534
|
-
models,
|
|
5535
|
-
loading: modelsLoading,
|
|
5536
|
-
renderProviderBadge
|
|
5537
|
-
}
|
|
5538
|
-
);
|
|
5539
|
-
if (layout === "inline") {
|
|
5540
|
-
return /* @__PURE__ */ jsxs13("div", { className: `flex items-center gap-1.5 ${className ?? ""}`, children: [
|
|
5541
|
-
modelPicker,
|
|
5542
|
-
showHarness && /* @__PURE__ */ jsx15(HarnessPicker, { value: harness, onChange: onHarness, available: availableHarnesses }),
|
|
5543
|
-
showEffort && /* @__PURE__ */ jsx15(EffortPicker, { value: effort, onChange: onEffortChange })
|
|
5544
|
-
] });
|
|
5545
|
-
}
|
|
5546
|
-
const hasAdvanced = showHarness || showEffort;
|
|
5547
|
-
return /* @__PURE__ */ jsxs13("div", { className: `flex items-center gap-1.5 ${className ?? ""}`, children: [
|
|
5548
|
-
modelPicker,
|
|
5549
|
-
hasAdvanced && /* @__PURE__ */ jsxs13("div", { ref: popoverRef, className: "relative inline-flex", children: [
|
|
5550
|
-
/* @__PURE__ */ jsx15(
|
|
5551
|
-
"button",
|
|
5552
|
-
{
|
|
5553
|
-
type: "button",
|
|
5554
|
-
...triggerProps,
|
|
5555
|
-
onClick: () => setOpen(!open),
|
|
5556
|
-
title: "Model settings \u2014 pick the agent backend and how hard it thinks",
|
|
5557
|
-
className: `flex h-8 w-8 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-muted hover:text-foreground data-[state=open]:bg-muted ${FOCUS_RING}`,
|
|
5558
|
-
"data-state": open ? "open" : "closed",
|
|
5559
|
-
children: /* @__PURE__ */ jsx15(GearGlyph, { className: "h-4 w-4" })
|
|
5560
|
-
}
|
|
5561
|
-
),
|
|
5562
|
-
open && /* @__PURE__ */ jsxs13("div", { className: "absolute bottom-full left-0 z-50 mb-2 w-72 space-y-3 rounded-xl border border-border bg-card p-3 shadow-lg", children: [
|
|
5563
|
-
showHarness && /* @__PURE__ */ jsxs13("div", { className: "space-y-1.5", children: [
|
|
5564
|
-
/* @__PURE__ */ jsx15("p", { className: "text-xs font-medium text-foreground", children: "Agent backend" }),
|
|
5565
|
-
/* @__PURE__ */ jsx15(HarnessPicker, { value: harness, onChange: onHarness, available: availableHarnesses }),
|
|
5566
|
-
/* @__PURE__ */ jsx15("p", { className: "text-[11px] leading-snug text-muted-foreground", children: "The engine that runs the agent. Switching it keeps your model choice compatible." })
|
|
5567
|
-
] }),
|
|
5568
|
-
showEffort && /* @__PURE__ */ jsxs13("div", { className: "space-y-1.5", children: [
|
|
5569
|
-
/* @__PURE__ */ jsx15("p", { className: "text-xs font-medium text-foreground", children: "Thinking" }),
|
|
5570
|
-
/* @__PURE__ */ jsx15(EffortPicker, { value: effort, onChange: onEffortChange, label: "" }),
|
|
5571
|
-
/* @__PURE__ */ jsx15("p", { className: "text-[11px] leading-snug text-muted-foreground", children: "How hard the agent thinks before answering. Higher is slower but more thorough." })
|
|
5572
|
-
] })
|
|
5573
|
-
] })
|
|
5574
|
-
] })
|
|
5575
|
-
] });
|
|
5576
|
-
}
|
|
5577
|
-
|
|
5578
5119
|
// src/web-react/index.tsx
|
|
5579
|
-
import { Fragment as
|
|
5120
|
+
import { Fragment as Fragment7, jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
5580
5121
|
function formatModelCost(msg, models) {
|
|
5581
5122
|
if (msg.promptTokens == null && msg.completionTokens == null) return null;
|
|
5582
5123
|
const pricing = models.find((m) => m.id === msg.modelUsed)?.pricing;
|
|
@@ -5590,41 +5131,41 @@ function formatTokensPerSecond(msg) {
|
|
|
5590
5131
|
return `${Math.round(msg.completionTokens / (msg.durationMs / 1e3))} tok/s`;
|
|
5591
5132
|
}
|
|
5592
5133
|
function RunDrillIn({ run, onClose }) {
|
|
5593
|
-
return /* @__PURE__ */
|
|
5594
|
-
/* @__PURE__ */
|
|
5595
|
-
/* @__PURE__ */
|
|
5134
|
+
return /* @__PURE__ */ jsxs11("div", { className: "fixed inset-y-0 right-0 z-50 flex w-[480px] max-w-full flex-col border-l border-border bg-card shadow-xl", children: [
|
|
5135
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2 border-b border-border px-4 py-3", children: [
|
|
5136
|
+
/* @__PURE__ */ jsx13(
|
|
5596
5137
|
"span",
|
|
5597
5138
|
{
|
|
5598
5139
|
className: `h-2 w-2 shrink-0 rounded-full ${run.status === "running" ? "bg-warning" : run.status === "error" ? "bg-destructive" : "bg-success"}`
|
|
5599
5140
|
}
|
|
5600
5141
|
),
|
|
5601
|
-
/* @__PURE__ */
|
|
5602
|
-
/* @__PURE__ */
|
|
5603
|
-
/* @__PURE__ */
|
|
5142
|
+
/* @__PURE__ */ jsxs11("div", { className: "min-w-0 flex-1", children: [
|
|
5143
|
+
/* @__PURE__ */ jsx13("p", { className: "truncate text-sm font-semibold", children: run.title }),
|
|
5144
|
+
/* @__PURE__ */ jsx13("p", { className: "truncate font-mono text-[11px] text-muted-foreground", children: run.toolName })
|
|
5604
5145
|
] }),
|
|
5605
|
-
/* @__PURE__ */
|
|
5146
|
+
/* @__PURE__ */ jsx13(
|
|
5606
5147
|
"button",
|
|
5607
5148
|
{
|
|
5608
5149
|
type: "button",
|
|
5609
5150
|
onClick: onClose,
|
|
5610
5151
|
"aria-label": "Close",
|
|
5611
5152
|
className: "rounded-md p-1.5 text-muted-foreground transition hover:bg-accent/30 hover:text-foreground",
|
|
5612
|
-
children: /* @__PURE__ */
|
|
5153
|
+
children: /* @__PURE__ */ jsx13("svg", { className: "h-4 w-4", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx13("path", { d: "M18 6 6 18M6 6l12 12" }) })
|
|
5613
5154
|
}
|
|
5614
5155
|
)
|
|
5615
5156
|
] }),
|
|
5616
|
-
/* @__PURE__ */
|
|
5617
|
-
run.steps.length === 0 && /* @__PURE__ */
|
|
5618
|
-
run.steps.map((step, i) => /* @__PURE__ */
|
|
5619
|
-
/* @__PURE__ */
|
|
5620
|
-
/* @__PURE__ */
|
|
5621
|
-
/* @__PURE__ */
|
|
5622
|
-
/* @__PURE__ */
|
|
5157
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex-1 space-y-3 overflow-y-auto p-4", children: [
|
|
5158
|
+
run.steps.length === 0 && /* @__PURE__ */ jsx13("p", { className: "text-sm text-muted-foreground", children: "No steps recorded yet." }),
|
|
5159
|
+
run.steps.map((step, i) => /* @__PURE__ */ jsxs11("div", { className: "rounded-lg border border-border/60 bg-background", children: [
|
|
5160
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex items-baseline gap-2 border-b border-border/40 px-3 py-1.5", children: [
|
|
5161
|
+
/* @__PURE__ */ jsx13("span", { className: `font-mono text-[11px] ${step.status === "error" ? "text-destructive" : "text-muted-foreground"}`, children: step.status === "error" ? "\u2717" : "$" }),
|
|
5162
|
+
/* @__PURE__ */ jsx13("code", { className: "min-w-0 flex-1 truncate font-mono text-xs", children: step.label }),
|
|
5163
|
+
/* @__PURE__ */ jsx13("span", { className: "shrink-0 text-[10px] text-muted-foreground", children: new Date(step.at).toLocaleTimeString() })
|
|
5623
5164
|
] }),
|
|
5624
|
-
step.detail && /* @__PURE__ */
|
|
5165
|
+
step.detail && /* @__PURE__ */ jsx13("pre", { className: "max-h-48 overflow-auto whitespace-pre-wrap px-3 py-2 font-mono text-[11px] leading-relaxed text-muted-foreground", children: step.detail })
|
|
5625
5166
|
] }, i))
|
|
5626
5167
|
] }),
|
|
5627
|
-
/* @__PURE__ */
|
|
5168
|
+
/* @__PURE__ */ jsx13("p", { className: "border-t border-border px-4 py-2 text-[11px] text-muted-foreground", children: "Readonly drill-in. Follow up in the main chat." })
|
|
5628
5169
|
] });
|
|
5629
5170
|
}
|
|
5630
5171
|
function pendingApprovalOf(call) {
|
|
@@ -5638,20 +5179,20 @@ function ChatEmptyState({
|
|
|
5638
5179
|
subline = "Describe the outcome you want. The agent works through it step by step, and pauses for your approval before anything irreversible.",
|
|
5639
5180
|
doors
|
|
5640
5181
|
}) {
|
|
5641
|
-
return /* @__PURE__ */
|
|
5642
|
-
/* @__PURE__ */
|
|
5643
|
-
/* @__PURE__ */
|
|
5644
|
-
/* @__PURE__ */
|
|
5645
|
-
subline && /* @__PURE__ */
|
|
5646
|
-
doors && doors.length > 0 && /* @__PURE__ */
|
|
5182
|
+
return /* @__PURE__ */ jsxs11("div", { className: "mx-auto flex w-full max-w-2xl flex-col items-center px-6 py-12 text-center sm:py-20", children: [
|
|
5183
|
+
/* @__PURE__ */ jsx13("span", { className: "mb-5 inline-flex h-14 w-14 items-center justify-center rounded-2xl bg-primary/10 ring-1 ring-primary/15", children: /* @__PURE__ */ jsx13(BrandMark, { size: 32, className: "shrink-0" }) }),
|
|
5184
|
+
/* @__PURE__ */ jsx13("p", { className: "text-[11px] font-semibold uppercase tracking-[0.18em] text-muted-foreground", children: productName }),
|
|
5185
|
+
/* @__PURE__ */ jsx13("h2", { className: "mt-1.5 text-balance text-2xl font-semibold leading-tight text-foreground sm:text-[28px]", children: headline }),
|
|
5186
|
+
subline && /* @__PURE__ */ jsx13("p", { className: "mt-3 max-w-md text-[15px] leading-relaxed text-muted-foreground", children: subline }),
|
|
5187
|
+
doors && doors.length > 0 && /* @__PURE__ */ jsx13("div", { className: "mt-7 grid w-full gap-2.5 sm:grid-cols-3", children: doors.slice(0, 3).map((door, i) => /* @__PURE__ */ jsxs11(
|
|
5647
5188
|
"button",
|
|
5648
5189
|
{
|
|
5649
5190
|
type: "button",
|
|
5650
5191
|
onClick: door.onSelect,
|
|
5651
5192
|
className: "group flex min-h-[44px] flex-col items-start rounded-xl border border-border bg-card px-4 py-3 text-left transition hover:border-primary/40 hover:bg-accent/30",
|
|
5652
5193
|
children: [
|
|
5653
|
-
/* @__PURE__ */
|
|
5654
|
-
door.description && /* @__PURE__ */
|
|
5194
|
+
/* @__PURE__ */ jsx13("span", { className: "text-sm font-semibold text-foreground", children: door.label }),
|
|
5195
|
+
door.description && /* @__PURE__ */ jsx13("span", { className: "mt-0.5 text-[12px] leading-snug text-muted-foreground", children: door.description })
|
|
5655
5196
|
]
|
|
5656
5197
|
},
|
|
5657
5198
|
i
|
|
@@ -5660,26 +5201,26 @@ function ChatEmptyState({
|
|
|
5660
5201
|
}
|
|
5661
5202
|
function ToolGlyph({ name, className }) {
|
|
5662
5203
|
if (name.startsWith("sandbox_")) {
|
|
5663
|
-
return /* @__PURE__ */
|
|
5664
|
-
/* @__PURE__ */
|
|
5665
|
-
/* @__PURE__ */
|
|
5204
|
+
return /* @__PURE__ */ jsxs11("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
|
|
5205
|
+
/* @__PURE__ */ jsx13("polyline", { points: "4 17 10 11 4 5" }),
|
|
5206
|
+
/* @__PURE__ */ jsx13("line", { x1: "12", y1: "19", x2: "20", y2: "19" })
|
|
5666
5207
|
] });
|
|
5667
5208
|
}
|
|
5668
5209
|
if (name === "submit_proposal") {
|
|
5669
|
-
return /* @__PURE__ */
|
|
5670
|
-
/* @__PURE__ */
|
|
5671
|
-
/* @__PURE__ */
|
|
5210
|
+
return /* @__PURE__ */ jsxs11("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
|
|
5211
|
+
/* @__PURE__ */ jsx13("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
|
|
5212
|
+
/* @__PURE__ */ jsx13("path", { d: "M14 2v6h6M9 15l2 2 4-4" })
|
|
5672
5213
|
] });
|
|
5673
5214
|
}
|
|
5674
5215
|
if (name === "schedule_followup") {
|
|
5675
|
-
return /* @__PURE__ */
|
|
5676
|
-
/* @__PURE__ */
|
|
5677
|
-
/* @__PURE__ */
|
|
5216
|
+
return /* @__PURE__ */ jsxs11("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": true, children: [
|
|
5217
|
+
/* @__PURE__ */ jsx13("circle", { cx: "12", cy: "12", r: "9" }),
|
|
5218
|
+
/* @__PURE__ */ jsx13("path", { d: "M12 7v5l3 3" })
|
|
5678
5219
|
] });
|
|
5679
5220
|
}
|
|
5680
|
-
return /* @__PURE__ */
|
|
5681
|
-
/* @__PURE__ */
|
|
5682
|
-
/* @__PURE__ */
|
|
5221
|
+
return /* @__PURE__ */ jsxs11("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
|
|
5222
|
+
/* @__PURE__ */ jsx13("path", { d: "M12 3v3m0 12v3M3 12h3m12 0h3" }),
|
|
5223
|
+
/* @__PURE__ */ jsx13("circle", { cx: "12", cy: "12", r: "4" })
|
|
5683
5224
|
] });
|
|
5684
5225
|
}
|
|
5685
5226
|
function toolOutcomeOf(call) {
|
|
@@ -5747,40 +5288,40 @@ function truncate(v, max = 240) {
|
|
|
5747
5288
|
function KvRows({ data }) {
|
|
5748
5289
|
const entries = Object.entries(data).filter(([, v]) => v !== void 0 && v !== null && v !== "");
|
|
5749
5290
|
if (!entries.length) return null;
|
|
5750
|
-
return /* @__PURE__ */
|
|
5751
|
-
/* @__PURE__ */
|
|
5752
|
-
/* @__PURE__ */
|
|
5291
|
+
return /* @__PURE__ */ jsx13("dl", { className: "grid grid-cols-[auto_1fr] gap-x-3 gap-y-1", children: entries.map(([k, v]) => /* @__PURE__ */ jsxs11("div", { className: "contents", children: [
|
|
5292
|
+
/* @__PURE__ */ jsx13("dt", { className: "font-mono text-[11px] text-muted-foreground", children: k }),
|
|
5293
|
+
/* @__PURE__ */ jsx13("dd", { className: "min-w-0 whitespace-pre-wrap break-words font-mono text-[11px] text-muted-foreground", children: truncate(v) })
|
|
5753
5294
|
] }, k)) });
|
|
5754
5295
|
}
|
|
5755
5296
|
function ShellDetail({ call }) {
|
|
5756
5297
|
const outcome = toolOutcomeOf(call);
|
|
5757
5298
|
const r = outcome?.result ?? {};
|
|
5758
|
-
return /* @__PURE__ */
|
|
5759
|
-
/* @__PURE__ */
|
|
5760
|
-
/* @__PURE__ */
|
|
5761
|
-
/* @__PURE__ */
|
|
5762
|
-
r.exitCode != null && /* @__PURE__ */
|
|
5299
|
+
return /* @__PURE__ */ jsxs11("div", { className: "overflow-hidden rounded-md bg-zinc-900 font-mono text-[11px] leading-relaxed", children: [
|
|
5300
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2 px-3 pt-2 text-zinc-400", children: [
|
|
5301
|
+
/* @__PURE__ */ jsx13("span", { className: "select-none text-zinc-500", children: "$" }),
|
|
5302
|
+
/* @__PURE__ */ jsx13("span", { className: "min-w-0 flex-1 truncate text-zinc-200", children: String(call.args?.command ?? "") }),
|
|
5303
|
+
r.exitCode != null && /* @__PURE__ */ jsxs11("span", { className: r.exitCode === 0 ? "text-success" : "text-destructive", children: [
|
|
5763
5304
|
"exit ",
|
|
5764
5305
|
r.exitCode
|
|
5765
5306
|
] })
|
|
5766
5307
|
] }),
|
|
5767
|
-
/* @__PURE__ */
|
|
5308
|
+
/* @__PURE__ */ jsx13("pre", { className: "max-h-56 overflow-auto whitespace-pre-wrap px-3 pb-2.5 pt-1.5 text-zinc-300", children: outcome?.ok === false ? outcome.message ?? "failed" : [r.stdout, r.stderr].filter(Boolean).join("\n") || "(no output)" })
|
|
5768
5309
|
] });
|
|
5769
5310
|
}
|
|
5770
5311
|
function DefaultToolDetail({ call }) {
|
|
5771
5312
|
const result = call.result;
|
|
5772
5313
|
const envelope = typeof result === "object" && result !== null ? result : null;
|
|
5773
|
-
return /* @__PURE__ */
|
|
5774
|
-
call.args && Object.keys(call.args).length > 0 && /* @__PURE__ */
|
|
5775
|
-
/* @__PURE__ */
|
|
5776
|
-
/* @__PURE__ */
|
|
5314
|
+
return /* @__PURE__ */ jsxs11("div", { className: "space-y-2", children: [
|
|
5315
|
+
call.args && Object.keys(call.args).length > 0 && /* @__PURE__ */ jsxs11("div", { children: [
|
|
5316
|
+
/* @__PURE__ */ jsx13("p", { className: "mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground", children: "Called with" }),
|
|
5317
|
+
/* @__PURE__ */ jsx13(KvRows, { data: call.args })
|
|
5777
5318
|
] }),
|
|
5778
|
-
envelope ? /* @__PURE__ */
|
|
5779
|
-
/* @__PURE__ */
|
|
5780
|
-
envelope.ok === false ? /* @__PURE__ */
|
|
5781
|
-
] }) : result != null ? /* @__PURE__ */
|
|
5782
|
-
/* @__PURE__ */
|
|
5783
|
-
/* @__PURE__ */
|
|
5319
|
+
envelope ? /* @__PURE__ */ jsxs11("div", { children: [
|
|
5320
|
+
/* @__PURE__ */ jsx13("p", { className: "mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground", children: envelope.ok === false ? "Failed" : "Result" }),
|
|
5321
|
+
envelope.ok === false ? /* @__PURE__ */ jsx13("p", { className: "text-xs text-destructive", children: envelope.message ?? "Tool failed" }) : envelope.result && typeof envelope.result === "object" ? /* @__PURE__ */ jsx13(KvRows, { data: envelope.result }) : envelope.result != null ? /* @__PURE__ */ jsx13("p", { className: "font-mono text-[11px] text-muted-foreground", children: truncate(envelope.result) }) : null
|
|
5322
|
+
] }) : result != null ? /* @__PURE__ */ jsxs11("div", { children: [
|
|
5323
|
+
/* @__PURE__ */ jsx13("p", { className: "mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground", children: "Result" }),
|
|
5324
|
+
/* @__PURE__ */ jsx13("p", { className: "font-mono text-[11px] text-muted-foreground", children: truncate(result) })
|
|
5784
5325
|
] }) : null
|
|
5785
5326
|
] });
|
|
5786
5327
|
}
|
|
@@ -5791,23 +5332,23 @@ function ProposalCard({
|
|
|
5791
5332
|
approval,
|
|
5792
5333
|
renderers
|
|
5793
5334
|
}) {
|
|
5794
|
-
const [expanded, setExpanded] =
|
|
5335
|
+
const [expanded, setExpanded] = useState14(false);
|
|
5795
5336
|
const { summary, meta } = proposalPreview(call);
|
|
5796
5337
|
const custom = renderers?.[call.name]?.(call, message);
|
|
5797
5338
|
const { pending: deciding, run: decide } = usePending();
|
|
5798
|
-
return /* @__PURE__ */
|
|
5799
|
-
/* @__PURE__ */
|
|
5800
|
-
/* @__PURE__ */
|
|
5801
|
-
/* @__PURE__ */
|
|
5802
|
-
/* @__PURE__ */
|
|
5803
|
-
/* @__PURE__ */
|
|
5804
|
-
summary && /* @__PURE__ */
|
|
5805
|
-
meta.length > 0 && /* @__PURE__ */
|
|
5339
|
+
return /* @__PURE__ */ jsxs11("div", { className: "w-full max-w-full rounded-xl border border-warning/50 bg-warning/[0.06] text-sm shadow-sm ring-1 ring-warning/10", children: [
|
|
5340
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex items-start gap-2.5 px-4 pt-3.5", children: [
|
|
5341
|
+
/* @__PURE__ */ jsx13("span", { className: "mt-0.5 inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-warning/15 text-warning", children: /* @__PURE__ */ jsx13(ToolGlyph, { name: call.name, className: "h-3.5 w-3.5" }) }),
|
|
5342
|
+
/* @__PURE__ */ jsxs11("div", { className: "min-w-0 flex-1", children: [
|
|
5343
|
+
/* @__PURE__ */ jsx13("p", { className: "text-[10px] font-semibold uppercase tracking-wider text-warning-strong", children: "Needs your approval" }),
|
|
5344
|
+
/* @__PURE__ */ jsx13("p", { className: "mt-0.5 text-[15px] font-semibold leading-snug text-foreground", children: friendlyToolTitle(call) }),
|
|
5345
|
+
summary && /* @__PURE__ */ jsx13("p", { className: "mt-1 text-[13px] leading-relaxed text-muted-foreground", children: summary }),
|
|
5346
|
+
meta.length > 0 && /* @__PURE__ */ jsx13("div", { className: "mt-1.5 flex flex-wrap items-center gap-1.5", children: meta.map((m, i) => /* @__PURE__ */ jsx13("span", { className: "rounded-full bg-muted/60 px-2 py-0.5 text-[11px] font-medium text-muted-foreground", children: m }, i)) })
|
|
5806
5347
|
] })
|
|
5807
5348
|
] }),
|
|
5808
|
-
/* @__PURE__ */
|
|
5809
|
-
approval ? /* @__PURE__ */
|
|
5810
|
-
/* @__PURE__ */
|
|
5349
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex flex-wrap items-center gap-2 px-4 pb-3.5 pt-3", children: [
|
|
5350
|
+
approval ? /* @__PURE__ */ jsxs11(Fragment7, { children: [
|
|
5351
|
+
/* @__PURE__ */ jsx13(
|
|
5811
5352
|
"button",
|
|
5812
5353
|
{
|
|
5813
5354
|
type: "button",
|
|
@@ -5817,7 +5358,7 @@ function ProposalCard({
|
|
|
5817
5358
|
children: "Approve & run"
|
|
5818
5359
|
}
|
|
5819
5360
|
),
|
|
5820
|
-
/* @__PURE__ */
|
|
5361
|
+
/* @__PURE__ */ jsx13(
|
|
5821
5362
|
"button",
|
|
5822
5363
|
{
|
|
5823
5364
|
type: "button",
|
|
@@ -5827,8 +5368,8 @@ function ProposalCard({
|
|
|
5827
5368
|
children: "Reject"
|
|
5828
5369
|
}
|
|
5829
5370
|
)
|
|
5830
|
-
] }) : /* @__PURE__ */
|
|
5831
|
-
/* @__PURE__ */
|
|
5371
|
+
] }) : /* @__PURE__ */ jsx13("span", { className: "text-[12px] font-medium text-muted-foreground", children: "Awaiting approval\u2026" }),
|
|
5372
|
+
/* @__PURE__ */ jsxs11(
|
|
5832
5373
|
"button",
|
|
5833
5374
|
{
|
|
5834
5375
|
type: "button",
|
|
@@ -5837,23 +5378,23 @@ function ProposalCard({
|
|
|
5837
5378
|
className: "ml-auto inline-flex items-center gap-1 rounded text-[12px] font-medium text-muted-foreground transition hover:text-foreground",
|
|
5838
5379
|
children: [
|
|
5839
5380
|
expanded ? "Hide details" : "View details",
|
|
5840
|
-
/* @__PURE__ */
|
|
5381
|
+
/* @__PURE__ */ jsx13(ChevronDown, { className: `h-3 w-3 transition-transform ${expanded ? "rotate-180" : ""}` })
|
|
5841
5382
|
]
|
|
5842
5383
|
}
|
|
5843
5384
|
)
|
|
5844
5385
|
] }),
|
|
5845
|
-
expanded && /* @__PURE__ */
|
|
5386
|
+
expanded && /* @__PURE__ */ jsx13("div", { className: "border-t border-warning/20 px-4 py-3 text-xs", children: custom ?? /* @__PURE__ */ jsx13(DefaultToolDetail, { call }) })
|
|
5846
5387
|
] });
|
|
5847
5388
|
}
|
|
5848
5389
|
function FollowupCard({ call }) {
|
|
5849
5390
|
const a = call.args ?? {};
|
|
5850
5391
|
const when = typeof a.when === "string" ? a.when : typeof a.at === "string" ? a.at : typeof a.schedule === "string" ? a.schedule : null;
|
|
5851
|
-
return /* @__PURE__ */
|
|
5852
|
-
/* @__PURE__ */
|
|
5853
|
-
/* @__PURE__ */
|
|
5854
|
-
/* @__PURE__ */
|
|
5392
|
+
return /* @__PURE__ */ jsxs11("div", { className: "w-fit min-w-[260px] max-w-full rounded-lg border border-border/60 border-l-2 border-l-primary/60 bg-muted/20 px-3 py-2 text-sm", children: [
|
|
5393
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2", children: [
|
|
5394
|
+
/* @__PURE__ */ jsx13(ToolGlyph, { name: call.name, className: "h-3.5 w-3.5 shrink-0 text-primary/80" }),
|
|
5395
|
+
/* @__PURE__ */ jsx13("span", { className: "min-w-0 flex-1 truncate font-medium text-foreground", children: friendlyToolTitle(call) })
|
|
5855
5396
|
] }),
|
|
5856
|
-
when && /* @__PURE__ */
|
|
5397
|
+
when && /* @__PURE__ */ jsx13("p", { className: "mt-0.5 pl-[22px] text-[12px] text-muted-foreground", children: when })
|
|
5857
5398
|
] });
|
|
5858
5399
|
}
|
|
5859
5400
|
function ToolCallCard({
|
|
@@ -5863,13 +5404,13 @@ function ToolCallCard({
|
|
|
5863
5404
|
onOpenRun,
|
|
5864
5405
|
renderers
|
|
5865
5406
|
}) {
|
|
5866
|
-
const [expanded, setExpanded] =
|
|
5407
|
+
const [expanded, setExpanded] = useState14(false);
|
|
5867
5408
|
const pending = call.status === "done" ? pendingApprovalOf(call) : null;
|
|
5868
5409
|
const kind = blockKindOf(call);
|
|
5869
5410
|
const failed = call.status === "error" || toolOutcomeOf(call)?.ok === false;
|
|
5870
5411
|
const custom = renderers?.[call.name]?.(call, message);
|
|
5871
5412
|
if (pending) {
|
|
5872
|
-
return /* @__PURE__ */
|
|
5413
|
+
return /* @__PURE__ */ jsx13(
|
|
5873
5414
|
ProposalCard,
|
|
5874
5415
|
{
|
|
5875
5416
|
call,
|
|
@@ -5881,16 +5422,16 @@ function ToolCallCard({
|
|
|
5881
5422
|
);
|
|
5882
5423
|
}
|
|
5883
5424
|
if (kind === "followup" && !failed) {
|
|
5884
|
-
return /* @__PURE__ */
|
|
5425
|
+
return /* @__PURE__ */ jsx13(FollowupCard, { call });
|
|
5885
5426
|
}
|
|
5886
5427
|
const isCommand = kind === "command";
|
|
5887
|
-
return /* @__PURE__ */
|
|
5428
|
+
return /* @__PURE__ */ jsxs11(
|
|
5888
5429
|
"div",
|
|
5889
5430
|
{
|
|
5890
5431
|
className: `w-fit min-w-[280px] max-w-full rounded-lg border text-xs transition ${failed ? "border-destructive/40 bg-destructive/5" : "border-border/60 bg-muted/20"}`,
|
|
5891
5432
|
children: [
|
|
5892
|
-
/* @__PURE__ */
|
|
5893
|
-
/* @__PURE__ */
|
|
5433
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex w-full items-center gap-2 px-3 py-2", children: [
|
|
5434
|
+
/* @__PURE__ */ jsxs11(
|
|
5894
5435
|
"button",
|
|
5895
5436
|
{
|
|
5896
5437
|
type: "button",
|
|
@@ -5898,14 +5439,14 @@ function ToolCallCard({
|
|
|
5898
5439
|
"aria-expanded": expanded,
|
|
5899
5440
|
className: "flex min-w-0 flex-1 items-center gap-2 rounded text-left",
|
|
5900
5441
|
children: [
|
|
5901
|
-
/* @__PURE__ */
|
|
5442
|
+
/* @__PURE__ */ jsx13(
|
|
5902
5443
|
"span",
|
|
5903
5444
|
{
|
|
5904
5445
|
className: `h-2 w-2 shrink-0 rounded-full ${call.status === "running" ? "animate-pulse bg-warning" : failed ? "bg-destructive" : "bg-success"}`
|
|
5905
5446
|
}
|
|
5906
5447
|
),
|
|
5907
|
-
/* @__PURE__ */
|
|
5908
|
-
/* @__PURE__ */
|
|
5448
|
+
/* @__PURE__ */ jsx13(ToolGlyph, { name: call.name, className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
5449
|
+
/* @__PURE__ */ jsx13(
|
|
5909
5450
|
"span",
|
|
5910
5451
|
{
|
|
5911
5452
|
className: `min-w-0 flex-1 truncate ${isCommand ? "font-mono text-[12px] tracking-tight text-foreground/90" : "font-medium"}`,
|
|
@@ -5915,8 +5456,8 @@ function ToolCallCard({
|
|
|
5915
5456
|
]
|
|
5916
5457
|
}
|
|
5917
5458
|
),
|
|
5918
|
-
/* @__PURE__ */
|
|
5919
|
-
/* @__PURE__ */
|
|
5459
|
+
/* @__PURE__ */ jsx13("span", { className: "shrink-0 text-[11px] text-muted-foreground", children: call.status === "running" ? "running\u2026" : failed ? "failed" : "done" }),
|
|
5460
|
+
/* @__PURE__ */ jsx13(
|
|
5920
5461
|
"button",
|
|
5921
5462
|
{
|
|
5922
5463
|
type: "button",
|
|
@@ -5924,13 +5465,13 @@ function ToolCallCard({
|
|
|
5924
5465
|
"aria-label": expanded ? "Collapse details" : "Expand details",
|
|
5925
5466
|
"aria-expanded": expanded,
|
|
5926
5467
|
className: "shrink-0 rounded p-0.5",
|
|
5927
|
-
children: /* @__PURE__ */
|
|
5468
|
+
children: /* @__PURE__ */ jsx13(ChevronDown, { className: `h-3 w-3 text-muted-foreground transition-transform ${expanded ? "rotate-180" : ""}` })
|
|
5928
5469
|
}
|
|
5929
5470
|
)
|
|
5930
5471
|
] }),
|
|
5931
|
-
expanded && /* @__PURE__ */
|
|
5932
|
-
custom ?? (call.name === "sandbox_run_command" ? /* @__PURE__ */
|
|
5933
|
-
onOpenRun && call.name.startsWith("sandbox_") && /* @__PURE__ */
|
|
5472
|
+
expanded && /* @__PURE__ */ jsxs11("div", { className: "border-t border-border/40 px-3 py-2.5", children: [
|
|
5473
|
+
custom ?? (call.name === "sandbox_run_command" ? /* @__PURE__ */ jsx13(ShellDetail, { call }) : /* @__PURE__ */ jsx13(DefaultToolDetail, { call })),
|
|
5474
|
+
onOpenRun && call.name.startsWith("sandbox_") && /* @__PURE__ */ jsx13(
|
|
5934
5475
|
"button",
|
|
5935
5476
|
{
|
|
5936
5477
|
type: "button",
|
|
@@ -5945,7 +5486,7 @@ function ToolCallCard({
|
|
|
5945
5486
|
);
|
|
5946
5487
|
}
|
|
5947
5488
|
function StreamingCaret() {
|
|
5948
|
-
return /* @__PURE__ */
|
|
5489
|
+
return /* @__PURE__ */ jsx13(
|
|
5949
5490
|
"span",
|
|
5950
5491
|
{
|
|
5951
5492
|
className: "ml-0.5 inline-block h-[1.1em] w-[3px] translate-y-[2px] animate-pulse rounded-sm bg-foreground/70",
|
|
@@ -5961,11 +5502,11 @@ function SegmentText({
|
|
|
5961
5502
|
messageClassName
|
|
5962
5503
|
}) {
|
|
5963
5504
|
const text = useSmoothText(content, streaming);
|
|
5964
|
-
const body =
|
|
5505
|
+
const body = useMemo7(() => renderBody(text), [renderBody, text]);
|
|
5965
5506
|
if (!content.trim() && !showCaret) return null;
|
|
5966
|
-
return /* @__PURE__ */
|
|
5507
|
+
return /* @__PURE__ */ jsxs11("div", { className: messageClassName, children: [
|
|
5967
5508
|
body,
|
|
5968
|
-
showCaret && /* @__PURE__ */
|
|
5509
|
+
showCaret && /* @__PURE__ */ jsx13(StreamingCaret, {})
|
|
5969
5510
|
] });
|
|
5970
5511
|
}
|
|
5971
5512
|
var COLLAPSE_TOOL_RUN_AT = 3;
|
|
@@ -5989,7 +5530,7 @@ function SegmentedBody({
|
|
|
5989
5530
|
const leftoverToolCalls = (msg.toolCalls ?? []).filter(
|
|
5990
5531
|
(tc) => !segmentToolIds.has(tc.id)
|
|
5991
5532
|
);
|
|
5992
|
-
const renderToolCard = (call) => /* @__PURE__ */
|
|
5533
|
+
const renderToolCard = (call) => /* @__PURE__ */ jsx13(
|
|
5993
5534
|
ToolCallCard,
|
|
5994
5535
|
{
|
|
5995
5536
|
call,
|
|
@@ -6012,9 +5553,9 @@ function SegmentedBody({
|
|
|
6012
5553
|
else groups.push({ kind: "tools", index: i, calls: [seg.call] });
|
|
6013
5554
|
}
|
|
6014
5555
|
}
|
|
6015
|
-
return /* @__PURE__ */
|
|
5556
|
+
return /* @__PURE__ */ jsxs11("div", { className: "flex flex-col gap-2", children: [
|
|
6016
5557
|
groups.map(
|
|
6017
|
-
(g) => g.kind === "text" ? /* @__PURE__ */
|
|
5558
|
+
(g) => g.kind === "text" ? /* @__PURE__ */ jsx13(
|
|
6018
5559
|
SegmentText,
|
|
6019
5560
|
{
|
|
6020
5561
|
content: g.content,
|
|
@@ -6024,24 +5565,24 @@ function SegmentedBody({
|
|
|
6024
5565
|
messageClassName
|
|
6025
5566
|
},
|
|
6026
5567
|
`text-${g.index}`
|
|
6027
|
-
) : !streaming && g.calls.length >= COLLAPSE_TOOL_RUN_AT && !g.calls.some(isImportantTool) ? /* @__PURE__ */
|
|
5568
|
+
) : !streaming && g.calls.length >= COLLAPSE_TOOL_RUN_AT && !g.calls.some(isImportantTool) ? /* @__PURE__ */ jsxs11(
|
|
6028
5569
|
"details",
|
|
6029
5570
|
{
|
|
6030
5571
|
className: "rounded-lg border-l-2 border-border/70 bg-muted/20 px-3 py-2",
|
|
6031
5572
|
children: [
|
|
6032
|
-
/* @__PURE__ */
|
|
5573
|
+
/* @__PURE__ */ jsxs11("summary", { className: "cursor-pointer select-none text-xs font-medium text-muted-foreground", children: [
|
|
6033
5574
|
"Worked through ",
|
|
6034
5575
|
g.calls.length,
|
|
6035
5576
|
" steps"
|
|
6036
5577
|
] }),
|
|
6037
|
-
/* @__PURE__ */
|
|
5578
|
+
/* @__PURE__ */ jsx13("div", { className: "mt-2 flex flex-col gap-2", children: g.calls.map(renderToolCard) })
|
|
6038
5579
|
]
|
|
6039
5580
|
},
|
|
6040
5581
|
`tools-${g.index}`
|
|
6041
|
-
) : /* @__PURE__ */
|
|
5582
|
+
) : /* @__PURE__ */ jsx13("div", { className: "flex flex-col gap-2", children: g.calls.map(renderToolCard) }, `tools-${g.index}`)
|
|
6042
5583
|
),
|
|
6043
5584
|
leftoverToolCalls.map(renderToolCard),
|
|
6044
|
-
streaming && segments[lastIndex]?.kind === "tool" && /* @__PURE__ */
|
|
5585
|
+
streaming && segments[lastIndex]?.kind === "tool" && /* @__PURE__ */ jsx13(StreamingCaret, {})
|
|
6045
5586
|
] });
|
|
6046
5587
|
}
|
|
6047
5588
|
var QUIET_META_LANE_CLASS = "mt-1 flex h-[18px] items-center gap-2 text-[11px] tracking-wide text-muted-foreground opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-within:opacity-100 motion-reduce:transition-none [@media(hover:none)]:opacity-100";
|
|
@@ -6051,9 +5592,9 @@ function copyTextOf(msg) {
|
|
|
6051
5592
|
return msg.content;
|
|
6052
5593
|
}
|
|
6053
5594
|
function CopyMessageButton({ text }) {
|
|
6054
|
-
const [copied, setCopied] =
|
|
6055
|
-
const timerRef =
|
|
6056
|
-
|
|
5595
|
+
const [copied, setCopied] = useState14(false);
|
|
5596
|
+
const timerRef = useRef10(null);
|
|
5597
|
+
useEffect11(
|
|
6057
5598
|
() => () => {
|
|
6058
5599
|
if (timerRef.current !== null) clearTimeout(timerRef.current);
|
|
6059
5600
|
},
|
|
@@ -6072,7 +5613,7 @@ function CopyMessageButton({ text }) {
|
|
|
6072
5613
|
}
|
|
6073
5614
|
);
|
|
6074
5615
|
};
|
|
6075
|
-
return /* @__PURE__ */
|
|
5616
|
+
return /* @__PURE__ */ jsx13(
|
|
6076
5617
|
"button",
|
|
6077
5618
|
{
|
|
6078
5619
|
type: "button",
|
|
@@ -6080,9 +5621,9 @@ function CopyMessageButton({ text }) {
|
|
|
6080
5621
|
"aria-label": "Copy message",
|
|
6081
5622
|
title: "Copy message",
|
|
6082
5623
|
className: "rounded p-0.5 text-muted-foreground transition hover:bg-accent/40 hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
6083
|
-
children: copied ? /* @__PURE__ */
|
|
6084
|
-
/* @__PURE__ */
|
|
6085
|
-
/* @__PURE__ */
|
|
5624
|
+
children: copied ? /* @__PURE__ */ jsx13("svg", { className: "h-3.5 w-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx13("polyline", { points: "20 6 9 17 4 12" }) }) : /* @__PURE__ */ jsxs11("svg", { className: "h-3.5 w-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
|
|
5625
|
+
/* @__PURE__ */ jsx13("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2" }),
|
|
5626
|
+
/* @__PURE__ */ jsx13("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
|
|
6086
5627
|
] })
|
|
6087
5628
|
}
|
|
6088
5629
|
);
|
|
@@ -6105,19 +5646,19 @@ function AssistantMessageImpl({
|
|
|
6105
5646
|
}) {
|
|
6106
5647
|
const content = useSmoothText(msg.content, streaming);
|
|
6107
5648
|
const reasoning = useSmoothText(msg.reasoning ?? "", streaming);
|
|
6108
|
-
const body =
|
|
5649
|
+
const body = useMemo7(() => renderBody(content), [renderBody, content]);
|
|
6109
5650
|
const segments = msg.segments;
|
|
6110
5651
|
const hasAnswerText = content !== "" || (segments?.some((s) => s.kind === "text" && s.content.trim() !== "") ?? false);
|
|
6111
|
-
const reasoningScrollRef =
|
|
6112
|
-
const thinkStartRef =
|
|
6113
|
-
const thinkMsRef =
|
|
5652
|
+
const reasoningScrollRef = useRef10(null);
|
|
5653
|
+
const thinkStartRef = useRef10(null);
|
|
5654
|
+
const thinkMsRef = useRef10(null);
|
|
6114
5655
|
if (streaming && reasoning && !hasAnswerText && thinkStartRef.current === null) {
|
|
6115
5656
|
thinkStartRef.current = performance.now();
|
|
6116
5657
|
}
|
|
6117
5658
|
if (hasAnswerText && thinkStartRef.current !== null && thinkMsRef.current === null) {
|
|
6118
5659
|
thinkMsRef.current = performance.now() - thinkStartRef.current;
|
|
6119
5660
|
}
|
|
6120
|
-
|
|
5661
|
+
useEffect11(() => {
|
|
6121
5662
|
const el = reasoningScrollRef.current;
|
|
6122
5663
|
if (el && streaming && !hasAnswerText) el.scrollTop = el.scrollHeight;
|
|
6123
5664
|
}, [reasoning, streaming, hasAnswerText]);
|
|
@@ -6125,21 +5666,21 @@ function AssistantMessageImpl({
|
|
|
6125
5666
|
streaming && !!reasoning && !hasAnswerText
|
|
6126
5667
|
);
|
|
6127
5668
|
const quiet = chrome === "quiet";
|
|
6128
|
-
return /* @__PURE__ */
|
|
6129
|
-
!quiet && /* @__PURE__ */
|
|
6130
|
-
/* @__PURE__ */
|
|
6131
|
-
msg.modelUsed && /* @__PURE__ */
|
|
6132
|
-
formatTokensPerSecond(msg) && /* @__PURE__ */
|
|
6133
|
-
formatModelCost(msg, models) && /* @__PURE__ */
|
|
5669
|
+
return /* @__PURE__ */ jsxs11("div", { className: `mx-auto w-full max-w-3xl px-6 ${quiet ? "group pb-1 pt-3" : "py-3"}`, children: [
|
|
5670
|
+
!quiet && /* @__PURE__ */ jsxs11("div", { className: "mb-1 flex items-baseline gap-2 text-[11px] tracking-wide text-muted-foreground", children: [
|
|
5671
|
+
/* @__PURE__ */ jsx13("span", { className: "font-semibold uppercase", children: agentLabel }),
|
|
5672
|
+
msg.modelUsed && /* @__PURE__ */ jsx13("span", { className: "font-mono normal-case", children: msg.modelUsed }),
|
|
5673
|
+
formatTokensPerSecond(msg) && /* @__PURE__ */ jsx13("span", { children: formatTokensPerSecond(msg) }),
|
|
5674
|
+
formatModelCost(msg, models) && /* @__PURE__ */ jsx13("span", { children: formatModelCost(msg, models) })
|
|
6134
5675
|
] }),
|
|
6135
|
-
reasoning && /* @__PURE__ */
|
|
6136
|
-
/* @__PURE__ */
|
|
5676
|
+
reasoning && /* @__PURE__ */ jsxs11("details", { className: "mb-2 rounded-lg border-l-2 border-border/70 bg-muted/20 px-3 py-2", open: !hasAnswerText, children: [
|
|
5677
|
+
/* @__PURE__ */ jsx13("summary", { className: "cursor-pointer select-none text-xs font-medium text-muted-foreground", children: !hasAnswerText ? /* @__PURE__ */ jsxs11("span", { className: "animate-pulse", children: [
|
|
6137
5678
|
"Thinking",
|
|
6138
5679
|
thinkingSeconds >= 3 ? ` \xB7 ${thinkingSeconds}s` : "\u2026"
|
|
6139
5680
|
] }) : thinkMsRef.current != null ? `Thought for ${Math.max(1, Math.round(thinkMsRef.current / 1e3))}s` : "Thought process" }),
|
|
6140
|
-
/* @__PURE__ */
|
|
5681
|
+
/* @__PURE__ */ jsx13("div", { ref: reasoningScrollRef, className: "mt-2 max-h-48 overflow-y-auto whitespace-pre-wrap text-[13px] leading-relaxed text-muted-foreground", children: reasoning })
|
|
6141
5682
|
] }),
|
|
6142
|
-
segments && segments.length > 0 ? /* @__PURE__ */
|
|
5683
|
+
segments && segments.length > 0 ? /* @__PURE__ */ jsx13(
|
|
6143
5684
|
SegmentedBody,
|
|
6144
5685
|
{
|
|
6145
5686
|
segments,
|
|
@@ -6151,12 +5692,12 @@ function AssistantMessageImpl({
|
|
|
6151
5692
|
toolRenderers,
|
|
6152
5693
|
messageClassName
|
|
6153
5694
|
}
|
|
6154
|
-
) : /* @__PURE__ */
|
|
6155
|
-
/* @__PURE__ */
|
|
5695
|
+
) : /* @__PURE__ */ jsxs11(Fragment7, { children: [
|
|
5696
|
+
/* @__PURE__ */ jsxs11("div", { className: messageClassName, children: [
|
|
6156
5697
|
body,
|
|
6157
|
-
streaming && content && !msg.toolCalls?.length && /* @__PURE__ */
|
|
5698
|
+
streaming && content && !msg.toolCalls?.length && /* @__PURE__ */ jsx13(StreamingCaret, {})
|
|
6158
5699
|
] }),
|
|
6159
|
-
msg.toolCalls && msg.toolCalls.length > 0 && /* @__PURE__ */
|
|
5700
|
+
msg.toolCalls && msg.toolCalls.length > 0 && /* @__PURE__ */ jsx13("div", { className: "mt-2 flex flex-col gap-1.5", children: msg.toolCalls.map((tc) => /* @__PURE__ */ jsx13(
|
|
6160
5701
|
ToolCallCard,
|
|
6161
5702
|
{
|
|
6162
5703
|
call: tc,
|
|
@@ -6168,7 +5709,7 @@ function AssistantMessageImpl({
|
|
|
6168
5709
|
tc.id
|
|
6169
5710
|
)) })
|
|
6170
5711
|
] }),
|
|
6171
|
-
durableCards && msg.parts && /* @__PURE__ */
|
|
5712
|
+
durableCards && msg.parts && /* @__PURE__ */ jsx13(
|
|
6172
5713
|
DurableChatCards,
|
|
6173
5714
|
{
|
|
6174
5715
|
...durableCards,
|
|
@@ -6177,7 +5718,7 @@ function AssistantMessageImpl({
|
|
|
6177
5718
|
className: "mt-3"
|
|
6178
5719
|
}
|
|
6179
5720
|
),
|
|
6180
|
-
workProductCards && workProductPartsFromMessageParts(msg.parts).map((part) => /* @__PURE__ */
|
|
5721
|
+
workProductCards && workProductPartsFromMessageParts(msg.parts).map((part) => /* @__PURE__ */ jsx13(
|
|
6181
5722
|
WorkProductCard,
|
|
6182
5723
|
{
|
|
6183
5724
|
part,
|
|
@@ -6187,7 +5728,7 @@ function AssistantMessageImpl({
|
|
|
6187
5728
|
`${part.ref.id}:${part.ref.version}`
|
|
6188
5729
|
)),
|
|
6189
5730
|
renderExtras?.(msg),
|
|
6190
|
-
resolveAttachmentUrl && attachmentPartsFromMessageParts(msg.parts).length > 0 && /* @__PURE__ */
|
|
5731
|
+
resolveAttachmentUrl && attachmentPartsFromMessageParts(msg.parts).length > 0 && /* @__PURE__ */ jsx13("div", { className: "mt-2", children: /* @__PURE__ */ jsx13(
|
|
6191
5732
|
MessageAttachments,
|
|
6192
5733
|
{
|
|
6193
5734
|
parts: attachmentPartsFromMessageParts(msg.parts),
|
|
@@ -6195,18 +5736,18 @@ function AssistantMessageImpl({
|
|
|
6195
5736
|
justify: "start"
|
|
6196
5737
|
}
|
|
6197
5738
|
) }),
|
|
6198
|
-
quiet && /* @__PURE__ */
|
|
6199
|
-
/* @__PURE__ */
|
|
6200
|
-
msg.modelUsed && /* @__PURE__ */
|
|
6201
|
-
formatTokensPerSecond(msg) && /* @__PURE__ */
|
|
6202
|
-
formatModelCost(msg, models) && /* @__PURE__ */
|
|
5739
|
+
quiet && /* @__PURE__ */ jsxs11("div", { "data-testid": "message-meta-lane", className: QUIET_META_LANE_CLASS, children: [
|
|
5740
|
+
/* @__PURE__ */ jsx13(CopyMessageButton, { text: copyTextOf(msg) }),
|
|
5741
|
+
msg.modelUsed && /* @__PURE__ */ jsx13("span", { className: "font-mono", children: msg.modelUsed }),
|
|
5742
|
+
formatTokensPerSecond(msg) && /* @__PURE__ */ jsx13("span", { children: formatTokensPerSecond(msg) }),
|
|
5743
|
+
formatModelCost(msg, models) && /* @__PURE__ */ jsx13("span", { children: formatModelCost(msg, models) })
|
|
6203
5744
|
] })
|
|
6204
5745
|
] });
|
|
6205
5746
|
}
|
|
6206
5747
|
var AssistantMessage = memo(AssistantMessageImpl);
|
|
6207
5748
|
function useThinkingSeconds(active) {
|
|
6208
|
-
const [seconds, setSeconds] =
|
|
6209
|
-
|
|
5749
|
+
const [seconds, setSeconds] = useState14(0);
|
|
5750
|
+
useEffect11(() => {
|
|
6210
5751
|
if (!active) return;
|
|
6211
5752
|
setSeconds(0);
|
|
6212
5753
|
const id = setInterval(() => setSeconds((s) => s + 1), 1e3);
|
|
@@ -6216,23 +5757,23 @@ function useThinkingSeconds(active) {
|
|
|
6216
5757
|
}
|
|
6217
5758
|
function ThinkingRow({ agentLabel, chrome = "labeled" }) {
|
|
6218
5759
|
const seconds = useThinkingSeconds(true);
|
|
6219
|
-
return /* @__PURE__ */
|
|
6220
|
-
chrome !== "quiet" && /* @__PURE__ */
|
|
6221
|
-
/* @__PURE__ */
|
|
6222
|
-
/* @__PURE__ */
|
|
5760
|
+
return /* @__PURE__ */ jsxs11("div", { className: "mx-auto w-full max-w-3xl px-6 py-3", children: [
|
|
5761
|
+
chrome !== "quiet" && /* @__PURE__ */ jsx13("p", { className: "mb-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground", children: agentLabel }),
|
|
5762
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2 text-base text-muted-foreground", children: [
|
|
5763
|
+
/* @__PURE__ */ jsx13("svg", { className: "h-4 w-4 animate-spin", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": true, children: /* @__PURE__ */ jsx13("path", { d: "M21 12a9 9 0 1 1-6.219-8.56", strokeLinecap: "round" }) }),
|
|
6223
5764
|
"Thinking",
|
|
6224
5765
|
seconds >= 3 ? ` \xB7 ${seconds}s` : "..."
|
|
6225
5766
|
] })
|
|
6226
5767
|
] });
|
|
6227
5768
|
}
|
|
6228
5769
|
function StreamErrorRow({ message, onRetry }) {
|
|
6229
|
-
return /* @__PURE__ */
|
|
6230
|
-
/* @__PURE__ */
|
|
6231
|
-
/* @__PURE__ */
|
|
6232
|
-
/* @__PURE__ */
|
|
5770
|
+
return /* @__PURE__ */ jsx13("div", { className: "mx-auto w-full max-w-3xl px-6 py-3", children: /* @__PURE__ */ jsxs11("div", { role: "alert", className: "flex items-start gap-2.5 rounded-lg border border-destructive/40 bg-destructive/5 px-3 py-2.5 text-sm text-destructive", children: [
|
|
5771
|
+
/* @__PURE__ */ jsxs11("svg", { className: "mt-0.5 h-4 w-4 shrink-0", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
|
|
5772
|
+
/* @__PURE__ */ jsx13("circle", { cx: "12", cy: "12", r: "9" }),
|
|
5773
|
+
/* @__PURE__ */ jsx13("path", { d: "M12 8v4m0 4h.01" })
|
|
6233
5774
|
] }),
|
|
6234
|
-
/* @__PURE__ */
|
|
6235
|
-
onRetry && /* @__PURE__ */
|
|
5775
|
+
/* @__PURE__ */ jsx13("span", { className: "min-w-0 flex-1 break-words", children: message }),
|
|
5776
|
+
onRetry && /* @__PURE__ */ jsx13(
|
|
6236
5777
|
"button",
|
|
6237
5778
|
{
|
|
6238
5779
|
type: "button",
|
|
@@ -6266,33 +5807,33 @@ function ChatMessages({
|
|
|
6266
5807
|
workProductCards
|
|
6267
5808
|
}) {
|
|
6268
5809
|
const messageClassName = messageSize === "large" ? "agent-app-message-copy text-[17px] leading-[1.75]" : "agent-app-message-copy text-base leading-[1.75]";
|
|
6269
|
-
const renderBody =
|
|
6270
|
-
() => renderMarkdown ?? ((content) => /* @__PURE__ */
|
|
5810
|
+
const renderBody = useMemo7(
|
|
5811
|
+
() => renderMarkdown ?? ((content) => /* @__PURE__ */ jsx13("p", { className: "whitespace-pre-wrap", children: content })),
|
|
6271
5812
|
[renderMarkdown]
|
|
6272
5813
|
);
|
|
6273
5814
|
const lastIsUser = messages[messages.length - 1]?.role === "user";
|
|
6274
5815
|
const quiet = chrome === "quiet";
|
|
6275
5816
|
if (messages.length === 0 && !loading && !error) {
|
|
6276
|
-
const empty = renderEmpty ? renderEmpty() : /* @__PURE__ */
|
|
6277
|
-
return /* @__PURE__ */
|
|
5817
|
+
const empty = renderEmpty ? renderEmpty() : /* @__PURE__ */ jsx13(ChatEmptyState, { ...emptyState });
|
|
5818
|
+
return /* @__PURE__ */ jsxs11(Fragment7, { children: [
|
|
6278
5819
|
header,
|
|
6279
5820
|
empty
|
|
6280
5821
|
] });
|
|
6281
5822
|
}
|
|
6282
|
-
return /* @__PURE__ */
|
|
5823
|
+
return /* @__PURE__ */ jsxs11(Fragment7, { children: [
|
|
6283
5824
|
header,
|
|
6284
5825
|
messages.map(
|
|
6285
|
-
(msg) => msg.role === "user" ? /* @__PURE__ */
|
|
6286
|
-
/* @__PURE__ */
|
|
6287
|
-
!quiet && /* @__PURE__ */
|
|
6288
|
-
/* @__PURE__ */
|
|
5826
|
+
(msg) => msg.role === "user" ? /* @__PURE__ */ jsxs11("div", { className: `mx-auto w-full max-w-3xl px-6 ${quiet ? "group pb-1 pt-3" : "py-3"}`, children: [
|
|
5827
|
+
/* @__PURE__ */ jsxs11("div", { className: `ml-auto w-fit ${quiet ? "max-w-[72%]" : "max-w-[85%]"}`, children: [
|
|
5828
|
+
!quiet && /* @__PURE__ */ jsx13("p", { className: "mb-1 text-right text-[11px] font-semibold uppercase tracking-wide text-muted-foreground", children: userLabel }),
|
|
5829
|
+
/* @__PURE__ */ jsx13(
|
|
6289
5830
|
"div",
|
|
6290
5831
|
{
|
|
6291
5832
|
className: quiet ? `rounded-2xl bg-[color-mix(in_srgb,hsl(var(--secondary))_65%,hsl(var(--background)))] px-4 py-2.5 ${messageClassName}` : `rounded-2xl rounded-tr-md bg-primary/10 px-4 py-2.5 ${messageClassName}`,
|
|
6292
|
-
children: /* @__PURE__ */
|
|
5833
|
+
children: /* @__PURE__ */ jsx13("p", { className: "whitespace-pre-wrap", children: msg.content })
|
|
6293
5834
|
}
|
|
6294
5835
|
),
|
|
6295
|
-
resolveAttachmentUrl && attachmentPartsFromMessageParts(msg.parts).length > 0 && /* @__PURE__ */
|
|
5836
|
+
resolveAttachmentUrl && attachmentPartsFromMessageParts(msg.parts).length > 0 && /* @__PURE__ */ jsx13("div", { className: "mt-1.5", children: /* @__PURE__ */ jsx13(
|
|
6296
5837
|
MessageAttachments,
|
|
6297
5838
|
{
|
|
6298
5839
|
parts: attachmentPartsFromMessageParts(msg.parts),
|
|
@@ -6301,8 +5842,8 @@ function ChatMessages({
|
|
|
6301
5842
|
}
|
|
6302
5843
|
) })
|
|
6303
5844
|
] }),
|
|
6304
|
-
quiet && /* @__PURE__ */
|
|
6305
|
-
] }, msg.id) : /* @__PURE__ */
|
|
5845
|
+
quiet && /* @__PURE__ */ jsx13("div", { "data-testid": "message-meta-lane", className: `${QUIET_META_LANE_CLASS} justify-end`, children: /* @__PURE__ */ jsx13(CopyMessageButton, { text: msg.content }) })
|
|
5846
|
+
] }, msg.id) : /* @__PURE__ */ jsx13(
|
|
6306
5847
|
AssistantMessage,
|
|
6307
5848
|
{
|
|
6308
5849
|
msg,
|
|
@@ -6323,20 +5864,14 @@ function ChatMessages({
|
|
|
6323
5864
|
msg.id
|
|
6324
5865
|
)
|
|
6325
5866
|
),
|
|
6326
|
-
loading && lastIsUser && /* @__PURE__ */
|
|
6327
|
-
error && !loading && /* @__PURE__ */
|
|
5867
|
+
loading && lastIsUser && /* @__PURE__ */ jsx13(ThinkingRow, { agentLabel, chrome }),
|
|
5868
|
+
error && !loading && /* @__PURE__ */ jsx13(StreamErrorRow, { message: error, onRetry })
|
|
6328
5869
|
] });
|
|
6329
5870
|
}
|
|
6330
5871
|
|
|
6331
5872
|
export {
|
|
6332
5873
|
nextRevealCount,
|
|
6333
5874
|
useSmoothText,
|
|
6334
|
-
ProviderLogo,
|
|
6335
|
-
usePopover,
|
|
6336
|
-
usePending,
|
|
6337
|
-
ModelPicker,
|
|
6338
|
-
DEFAULT_EFFORT_LEVELS,
|
|
6339
|
-
EffortPicker,
|
|
6340
5875
|
interactionStatusLabels,
|
|
6341
5876
|
interactionTerminalNotes,
|
|
6342
5877
|
fieldValuesFromAnswers,
|
|
@@ -6439,7 +5974,6 @@ export {
|
|
|
6439
5974
|
withoutRecordGridRemoved,
|
|
6440
5975
|
pruneRecordGridOverlay,
|
|
6441
5976
|
RecordGrid,
|
|
6442
|
-
AgentSessionControls,
|
|
6443
5977
|
formatModelCost,
|
|
6444
5978
|
formatTokensPerSecond,
|
|
6445
5979
|
RunDrillIn,
|
|
@@ -6448,4 +5982,4 @@ export {
|
|
|
6448
5982
|
useThinkingSeconds,
|
|
6449
5983
|
ChatMessages
|
|
6450
5984
|
};
|
|
6451
|
-
//# sourceMappingURL=chunk-
|
|
5985
|
+
//# sourceMappingURL=chunk-IFYJDX3J.js.map
|