@tangle-network/agent-app 0.47.14 → 0.47.16
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/README.md +8 -0
- package/dist/DesignCanvas-UPRRA4YG.js +11 -0
- package/dist/DesignCanvasEditor-GVJO5SMH.js +14 -0
- package/dist/app-auth/index.js +3 -2
- package/dist/app-auth/index.js.map +1 -1
- package/dist/assistant/index.js +7 -6
- package/dist/assistant/index.js.map +1 -1
- package/dist/chat-react/index.js +4 -3
- package/dist/chat-routes/index.js +13 -7
- package/dist/chat-routes/index.js.map +1 -1
- package/dist/chat-routes/wire.d.ts +3 -3
- package/dist/chat-store/index.js +3 -2
- package/dist/chat-store/index.js.map +1 -1
- package/dist/{chunk-LYAYNWDS.js → chunk-3GVFJYLO.js} +4 -4
- package/dist/{chunk-F7VH4G5C.js → chunk-3YUI7WNW.js} +1 -1
- package/dist/{chunk-F7VH4G5C.js.map → chunk-3YUI7WNW.js.map} +1 -1
- package/dist/{chunk-IRYULX3R.js → chunk-4PZE7XAM.js} +2 -2
- package/dist/{chunk-7LJYCHXK.js → chunk-54KJ54SY.js} +3 -3
- package/dist/{chunk-DRB77FYL.js → chunk-A2XMTCER.js} +2 -2
- package/dist/{chunk-UB4LENR5.js → chunk-AXJV66PC.js} +2 -2
- package/dist/{chunk-HZVVO6VR.js → chunk-FQYAJYPW.js} +11 -4
- package/dist/chunk-FQYAJYPW.js.map +1 -0
- package/dist/{chunk-X5DQ5QOP.js → chunk-G4CPEJNN.js} +2 -2
- package/dist/{chunk-TTYJIMTR.js → chunk-H6R3VYAZ.js} +334 -164
- package/dist/chunk-H6R3VYAZ.js.map +1 -0
- package/dist/{chunk-33BN7P57.js → chunk-HUYTN7RI.js} +5 -5
- package/dist/{chunk-SUO2R2ET.js → chunk-NU7QSZBR.js} +2 -2
- package/dist/{chunk-OYTMILRK.js → chunk-QEPLXYOE.js} +2 -2
- package/dist/{chunk-FMEL7VJR.js → chunk-TNWQA5XJ.js} +2 -2
- package/dist/chunk-TXD5HXLE.js +14 -0
- package/dist/chunk-TXD5HXLE.js.map +1 -0
- package/dist/{chunk-UMV45ZDF.js → chunk-WOZSOPUZ.js} +3 -3
- package/dist/{chunk-DXHUQ5NO.js → chunk-X47R2IVO.js} +8 -1
- package/dist/chunk-X47R2IVO.js.map +1 -0
- package/dist/{chunk-3G4IUF3D.js → chunk-XR5ZXMYL.js} +5 -3
- package/dist/chunk-XR5ZXMYL.js.map +1 -0
- package/dist/design-canvas/index.js +3 -2
- package/dist/design-canvas/index.js.map +1 -1
- package/dist/design-canvas-react/engine.js +5 -4
- package/dist/design-canvas-react/index.js +8 -7
- package/dist/design-canvas-react/index.js.map +1 -1
- package/dist/design-canvas-react/lazy.js +1 -1
- package/dist/platform/api-key-auth.d.ts +27 -0
- package/dist/platform/index.d.ts +1 -0
- package/dist/platform/index.js +47 -2
- package/dist/platform/index.js.map +1 -1
- package/dist/public-consultation/index.d.ts +1 -1
- package/dist/public-consultation/index.js +5 -4
- package/dist/public-consultation/index.js.map +1 -1
- package/dist/sandbox/index.js +1 -1
- package/dist/sequences/index.js +2 -1
- package/dist/sequences/index.js.map +1 -1
- package/dist/web/file-export.d.ts +6 -0
- package/dist/web/index.d.ts +1 -0
- package/dist/web/index.js +5 -1
- package/dist/web-react/api-access-panel.d.ts +33 -0
- package/dist/web-react/index.d.ts +1 -0
- package/dist/web-react/index.js +9 -6
- package/package.json +1 -1
- package/dist/DesignCanvas-JRBCAWHW.js +0 -10
- package/dist/DesignCanvasEditor-J2OLS22G.js +0 -13
- package/dist/chunk-3G4IUF3D.js.map +0 -1
- package/dist/chunk-DXHUQ5NO.js.map +0 -1
- package/dist/chunk-HZVVO6VR.js.map +0 -1
- package/dist/chunk-TTYJIMTR.js.map +0 -1
- /package/dist/{DesignCanvas-JRBCAWHW.js.map → DesignCanvas-UPRRA4YG.js.map} +0 -0
- /package/dist/{DesignCanvasEditor-J2OLS22G.js.map → DesignCanvasEditor-GVJO5SMH.js.map} +0 -0
- /package/dist/{chunk-LYAYNWDS.js.map → chunk-3GVFJYLO.js.map} +0 -0
- /package/dist/{chunk-IRYULX3R.js.map → chunk-4PZE7XAM.js.map} +0 -0
- /package/dist/{chunk-7LJYCHXK.js.map → chunk-54KJ54SY.js.map} +0 -0
- /package/dist/{chunk-DRB77FYL.js.map → chunk-A2XMTCER.js.map} +0 -0
- /package/dist/{chunk-UB4LENR5.js.map → chunk-AXJV66PC.js.map} +0 -0
- /package/dist/{chunk-X5DQ5QOP.js.map → chunk-G4CPEJNN.js.map} +0 -0
- /package/dist/{chunk-33BN7P57.js.map → chunk-HUYTN7RI.js.map} +0 -0
- /package/dist/{chunk-SUO2R2ET.js.map → chunk-NU7QSZBR.js.map} +0 -0
- /package/dist/{chunk-OYTMILRK.js.map → chunk-QEPLXYOE.js.map} +0 -0
- /package/dist/{chunk-FMEL7VJR.js.map → chunk-TNWQA5XJ.js.map} +0 -0
- /package/dist/{chunk-UMV45ZDF.js.map → chunk-WOZSOPUZ.js.map} +0 -0
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
} from "./chunk-SJWIZT7B.js";
|
|
34
34
|
import {
|
|
35
35
|
attachmentPartsFromMessageParts
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-4PZE7XAM.js";
|
|
37
37
|
import {
|
|
38
38
|
cancelStatusFor,
|
|
39
39
|
fieldAcceptsFreeText,
|
|
@@ -50,7 +50,7 @@ import {
|
|
|
50
50
|
} from "./chunk-YJMCRXQQ.js";
|
|
51
51
|
|
|
52
52
|
// src/web-react/index.tsx
|
|
53
|
-
import { useEffect as
|
|
53
|
+
import { useEffect as useEffect12, useMemo as useMemo7, useRef as useRef12, useState as useState16, memo } from "react";
|
|
54
54
|
import { InlineToolItem, RunRowShell } from "@tangle-network/ui/run";
|
|
55
55
|
|
|
56
56
|
// src/web-react/smooth-text.ts
|
|
@@ -5009,8 +5009,177 @@ function PagerButton({
|
|
|
5009
5009
|
);
|
|
5010
5010
|
}
|
|
5011
5011
|
|
|
5012
|
+
// src/web-react/api-access-panel.tsx
|
|
5013
|
+
import { useEffect as useEffect11, useRef as useRef11, useState as useState15 } from "react";
|
|
5014
|
+
import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
5015
|
+
var defaultExpiryChoices = [1, 7, 30];
|
|
5016
|
+
var inputClass = "h-11 w-full rounded-lg border border-input bg-background px-3 text-sm text-foreground";
|
|
5017
|
+
var buttonClass = "inline-flex items-center justify-center rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground disabled:opacity-50";
|
|
5018
|
+
var outlineClass = "inline-flex items-center justify-center rounded-lg border border-input bg-background px-3 py-2 text-sm font-medium text-foreground disabled:opacity-50";
|
|
5019
|
+
function ApiAccessPanel({
|
|
5020
|
+
keys,
|
|
5021
|
+
access,
|
|
5022
|
+
defaultScopes,
|
|
5023
|
+
baseUrl,
|
|
5024
|
+
accountHref,
|
|
5025
|
+
description,
|
|
5026
|
+
limitsDescription,
|
|
5027
|
+
expiryDays = defaultExpiryChoices,
|
|
5028
|
+
defaultExpiryDays = 7,
|
|
5029
|
+
onCreate,
|
|
5030
|
+
onRevoke,
|
|
5031
|
+
onChanged
|
|
5032
|
+
}) {
|
|
5033
|
+
const [name, setName] = useState15("");
|
|
5034
|
+
const allowedDays = [...new Set(expiryDays)].filter((days2) => days2 > 0 && Number.isFinite(new Date(Date.now() + days2 * 864e5).getTime()));
|
|
5035
|
+
const fallbackDays = allowedDays.includes(defaultExpiryDays) ? defaultExpiryDays : allowedDays[0];
|
|
5036
|
+
const [days, setDays] = useState15(fallbackDays);
|
|
5037
|
+
const selectedDays = days !== void 0 && allowedDays.includes(days) ? days : fallbackDays;
|
|
5038
|
+
const [scopes, setScopes] = useState15(() => defaultScopes.filter((scope) => access.some((option) => option.scope === scope)));
|
|
5039
|
+
const [creating, setCreating] = useState15(false);
|
|
5040
|
+
const [revoking, setRevoking] = useState15(null);
|
|
5041
|
+
const [created, setCreated] = useState15(null);
|
|
5042
|
+
const [notice, setNotice] = useState15(null);
|
|
5043
|
+
const [error, setError] = useState15(null);
|
|
5044
|
+
const keyHeading = useRef11(null);
|
|
5045
|
+
const nameInput = useRef11(null);
|
|
5046
|
+
const keyWasShown = useRef11(false);
|
|
5047
|
+
const selectedScopes = scopes.filter((scope) => access.some((option) => option.scope === scope));
|
|
5048
|
+
useEffect11(() => {
|
|
5049
|
+
setScopes((current) => {
|
|
5050
|
+
const next = current.filter((scope) => access.some((option) => option.scope === scope));
|
|
5051
|
+
return next.length === current.length ? current : next;
|
|
5052
|
+
});
|
|
5053
|
+
}, [access]);
|
|
5054
|
+
useEffect11(() => {
|
|
5055
|
+
if (created) {
|
|
5056
|
+
keyHeading.current?.focus();
|
|
5057
|
+
keyWasShown.current = true;
|
|
5058
|
+
} else if (keyWasShown.current) {
|
|
5059
|
+
nameInput.current?.focus();
|
|
5060
|
+
keyWasShown.current = false;
|
|
5061
|
+
}
|
|
5062
|
+
}, [created]);
|
|
5063
|
+
async function createKey(event) {
|
|
5064
|
+
event.preventDefault();
|
|
5065
|
+
const requestedScopes = scopes.filter((scope) => access.some((option) => option.scope === scope));
|
|
5066
|
+
if (!name.trim() || !requestedScopes.length || selectedDays === void 0 || creating || created) return;
|
|
5067
|
+
setCreating(true);
|
|
5068
|
+
setError(null);
|
|
5069
|
+
try {
|
|
5070
|
+
const result = await onCreate({
|
|
5071
|
+
name: name.trim(),
|
|
5072
|
+
scopes: requestedScopes,
|
|
5073
|
+
expiresAt: new Date(Date.now() + selectedDays * 864e5).toISOString()
|
|
5074
|
+
});
|
|
5075
|
+
if (!result.id || !result.key) throw new Error("Could not create key");
|
|
5076
|
+
setCreated({ id: result.id, key: result.key });
|
|
5077
|
+
setName("");
|
|
5078
|
+
onChanged();
|
|
5079
|
+
} catch (cause) {
|
|
5080
|
+
setError(cause instanceof Error ? cause.message : "Could not create key");
|
|
5081
|
+
} finally {
|
|
5082
|
+
setCreating(false);
|
|
5083
|
+
}
|
|
5084
|
+
}
|
|
5085
|
+
async function revokeKey(id) {
|
|
5086
|
+
setRevoking(id);
|
|
5087
|
+
setError(null);
|
|
5088
|
+
try {
|
|
5089
|
+
await onRevoke(id);
|
|
5090
|
+
if (created?.id === id) setCreated(null);
|
|
5091
|
+
onChanged();
|
|
5092
|
+
setNotice("Key revoked");
|
|
5093
|
+
} catch (cause) {
|
|
5094
|
+
setError(cause instanceof Error ? cause.message : "Could not revoke key");
|
|
5095
|
+
} finally {
|
|
5096
|
+
setRevoking(null);
|
|
5097
|
+
}
|
|
5098
|
+
}
|
|
5099
|
+
return /* @__PURE__ */ jsx14("main", { className: "flex-1 overflow-y-auto", children: /* @__PURE__ */ jsxs12("div", { className: "mx-auto max-w-2xl space-y-8 px-4 py-8 sm:px-8", children: [
|
|
5100
|
+
/* @__PURE__ */ jsxs12("div", { className: "space-y-2", children: [
|
|
5101
|
+
accountHref && /* @__PURE__ */ jsx14("a", { href: accountHref, className: "text-sm text-muted-foreground hover:text-foreground", children: "Account" }),
|
|
5102
|
+
/* @__PURE__ */ jsx14("h1", { className: "text-2xl font-semibold text-foreground", children: "API access" }),
|
|
5103
|
+
/* @__PURE__ */ jsx14("p", { className: "text-sm text-muted-foreground", children: description ?? "Connect a client to your account. Each key acts with your permissions and only the access you choose." })
|
|
5104
|
+
] }),
|
|
5105
|
+
error && /* @__PURE__ */ jsx14("p", { role: "alert", className: "rounded-lg border border-destructive/40 p-3 text-sm text-destructive", children: error }),
|
|
5106
|
+
notice && /* @__PURE__ */ jsx14("p", { role: "status", className: "text-sm text-muted-foreground", children: notice }),
|
|
5107
|
+
created ? /* @__PURE__ */ jsxs12("section", { "aria-labelledby": "save-api-key", className: "space-y-4 rounded-xl border border-border bg-card p-5", children: [
|
|
5108
|
+
/* @__PURE__ */ jsx14("h2", { ref: keyHeading, tabIndex: -1, id: "save-api-key", className: "font-medium outline-none", children: "Save your key" }),
|
|
5109
|
+
/* @__PURE__ */ jsx14("p", { className: "text-sm text-muted-foreground", children: "Copy it directly into your client\u2019s secret storage. It is shown only now. Keep it out of chat messages and prompts." }),
|
|
5110
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex gap-2", children: [
|
|
5111
|
+
/* @__PURE__ */ jsx14("input", { "aria-label": "New API key", type: "password", value: created.key, readOnly: true, autoComplete: "off", className: `${inputClass} min-w-0 font-mono` }),
|
|
5112
|
+
/* @__PURE__ */ jsx14("button", { className: buttonClass, onClick: async () => {
|
|
5113
|
+
try {
|
|
5114
|
+
await navigator.clipboard.writeText(created.key);
|
|
5115
|
+
setNotice("Key copied");
|
|
5116
|
+
} catch {
|
|
5117
|
+
setError("Clipboard unavailable. Select the key field and copy it manually.");
|
|
5118
|
+
}
|
|
5119
|
+
}, children: "Copy key" })
|
|
5120
|
+
] }),
|
|
5121
|
+
/* @__PURE__ */ jsx14("button", { className: outlineClass, onClick: () => {
|
|
5122
|
+
setCreated(null);
|
|
5123
|
+
setNotice(null);
|
|
5124
|
+
}, children: "I\u2019ve saved it" })
|
|
5125
|
+
] }) : /* @__PURE__ */ jsxs12("form", { onSubmit: createKey, className: "space-y-5 rounded-xl border border-border bg-card p-5", children: [
|
|
5126
|
+
/* @__PURE__ */ jsx14("h2", { className: "font-medium", children: "Create a key" }),
|
|
5127
|
+
/* @__PURE__ */ jsxs12("div", { className: "grid gap-4 sm:grid-cols-[1fr_10rem]", children: [
|
|
5128
|
+
/* @__PURE__ */ jsxs12("div", { className: "space-y-1.5", children: [
|
|
5129
|
+
/* @__PURE__ */ jsx14("label", { className: "text-sm font-medium", htmlFor: "key-name", children: "Name" }),
|
|
5130
|
+
/* @__PURE__ */ jsx14("input", { ref: nameInput, id: "key-name", className: inputClass, value: name, onChange: (event) => setName(event.target.value), placeholder: "Client on my server", maxLength: 100, required: true, autoComplete: "off" })
|
|
5131
|
+
] }),
|
|
5132
|
+
/* @__PURE__ */ jsxs12("div", { className: "space-y-1.5", children: [
|
|
5133
|
+
/* @__PURE__ */ jsx14("label", { className: "text-sm font-medium", htmlFor: "key-expiry", children: "Expires in" }),
|
|
5134
|
+
/* @__PURE__ */ jsx14("select", { id: "key-expiry", value: selectedDays ?? "", onChange: (event) => setDays(Number(event.target.value)), className: "h-11 w-full rounded-lg border border-input bg-background px-3 text-sm", children: allowedDays.map((days2) => /* @__PURE__ */ jsxs12("option", { value: days2, children: [
|
|
5135
|
+
days2,
|
|
5136
|
+
" ",
|
|
5137
|
+
days2 === 1 ? "day" : "days"
|
|
5138
|
+
] }, days2)) })
|
|
5139
|
+
] })
|
|
5140
|
+
] }),
|
|
5141
|
+
/* @__PURE__ */ jsxs12("fieldset", { className: "space-y-3", children: [
|
|
5142
|
+
/* @__PURE__ */ jsx14("legend", { className: "mb-3 text-sm font-medium", children: "Permissions" }),
|
|
5143
|
+
access.map((access2) => /* @__PURE__ */ jsxs12("label", { className: "flex cursor-pointer items-start gap-3", children: [
|
|
5144
|
+
/* @__PURE__ */ jsx14(
|
|
5145
|
+
"input",
|
|
5146
|
+
{
|
|
5147
|
+
type: "checkbox",
|
|
5148
|
+
className: "mt-1 size-4 accent-primary",
|
|
5149
|
+
checked: selectedScopes.includes(access2.scope),
|
|
5150
|
+
onChange: (event) => setScopes((current) => event.target.checked ? [...current, access2.scope] : current.filter((scope) => scope !== access2.scope))
|
|
5151
|
+
}
|
|
5152
|
+
),
|
|
5153
|
+
/* @__PURE__ */ jsxs12("span", { className: "text-sm", children: [
|
|
5154
|
+
/* @__PURE__ */ jsx14("span", { className: "block font-medium", children: access2.label }),
|
|
5155
|
+
/* @__PURE__ */ jsx14("span", { className: "text-muted-foreground", children: access2.description })
|
|
5156
|
+
] })
|
|
5157
|
+
] }, access2.scope))
|
|
5158
|
+
] }),
|
|
5159
|
+
limitsDescription && /* @__PURE__ */ jsx14("p", { className: "text-xs text-muted-foreground", children: limitsDescription }),
|
|
5160
|
+
/* @__PURE__ */ jsx14("button", { className: buttonClass, type: "submit", disabled: creating || !name.trim() || !selectedScopes.length || selectedDays === void 0, children: creating ? "Creating\u2026" : "Create key" })
|
|
5161
|
+
] }),
|
|
5162
|
+
/* @__PURE__ */ jsxs12("section", { "aria-labelledby": "existing-keys", className: "space-y-3", children: [
|
|
5163
|
+
/* @__PURE__ */ jsx14("h2", { id: "existing-keys", className: "font-medium", children: "Your keys" }),
|
|
5164
|
+
keys.length === 0 ? /* @__PURE__ */ jsx14("p", { className: "text-sm text-muted-foreground", children: "No keys yet." }) : /* @__PURE__ */ jsx14("ul", { className: "divide-y divide-border rounded-xl border border-border bg-card", children: keys.map((key) => /* @__PURE__ */ jsxs12("li", { className: "flex items-start justify-between gap-3 p-4", children: [
|
|
5165
|
+
/* @__PURE__ */ jsxs12("div", { className: "min-w-0 space-y-1", children: [
|
|
5166
|
+
/* @__PURE__ */ jsx14("p", { className: "break-words text-sm font-medium", children: key.name }),
|
|
5167
|
+
/* @__PURE__ */ jsx14("p", { className: "text-xs text-muted-foreground", children: key.expiresAt ? `${new Date(key.expiresAt).getTime() <= Date.now() ? "Expired" : "Expires"} ${new Date(key.expiresAt).toLocaleDateString()}` : "No expiry" }),
|
|
5168
|
+
/* @__PURE__ */ jsx14("p", { className: "text-xs text-muted-foreground", children: key.scopes.map((scope) => access.find((access2) => access2.scope === scope)?.label ?? scope).join(" \xB7 ") })
|
|
5169
|
+
] }),
|
|
5170
|
+
/* @__PURE__ */ jsx14("button", { className: outlineClass, disabled: revoking !== null, onClick: () => revokeKey(key.id), "aria-label": `Revoke ${key.name}`, children: revoking === key.id ? "Revoking\u2026" : "Revoke" })
|
|
5171
|
+
] }, key.id)) })
|
|
5172
|
+
] }),
|
|
5173
|
+
/* @__PURE__ */ jsxs12("p", { className: "text-sm text-muted-foreground", children: [
|
|
5174
|
+
"Use ",
|
|
5175
|
+
/* @__PURE__ */ jsx14("code", { className: "text-xs", children: baseUrl }),
|
|
5176
|
+
" as the API base and send the key as a Bearer credential."
|
|
5177
|
+
] })
|
|
5178
|
+
] }) });
|
|
5179
|
+
}
|
|
5180
|
+
|
|
5012
5181
|
// src/web-react/index.tsx
|
|
5013
|
-
import { Fragment as Fragment7, jsx as
|
|
5182
|
+
import { Fragment as Fragment7, jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
5014
5183
|
function formatModelCost(msg, models) {
|
|
5015
5184
|
if (msg.promptTokens == null && msg.completionTokens == null) return null;
|
|
5016
5185
|
const pricing = models.find((m) => m.id === msg.modelUsed)?.pricing;
|
|
@@ -5029,41 +5198,41 @@ function formatTokensPerSecond(msg) {
|
|
|
5029
5198
|
return `${Math.round(msg.completionTokens / (msg.durationMs / 1e3))} tok/s`;
|
|
5030
5199
|
}
|
|
5031
5200
|
function RunDrillIn({ run, onClose }) {
|
|
5032
|
-
return /* @__PURE__ */
|
|
5033
|
-
/* @__PURE__ */
|
|
5034
|
-
/* @__PURE__ */
|
|
5201
|
+
return /* @__PURE__ */ jsxs13("div", { className: `fixed inset-y-0 right-0 z-50 flex w-[480px] max-w-full flex-col border-l border-card-edge bg-popover ${OVERLAY_SHADOW}`, children: [
|
|
5202
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-2 border-b border-border px-4 py-3", children: [
|
|
5203
|
+
/* @__PURE__ */ jsx15(
|
|
5035
5204
|
"span",
|
|
5036
5205
|
{
|
|
5037
5206
|
className: `h-2 w-2 shrink-0 rounded-full ${run.status === "running" ? "bg-warning" : run.status === "error" ? "bg-destructive" : "bg-success"}`
|
|
5038
5207
|
}
|
|
5039
5208
|
),
|
|
5040
|
-
/* @__PURE__ */
|
|
5041
|
-
/* @__PURE__ */
|
|
5042
|
-
/* @__PURE__ */
|
|
5209
|
+
/* @__PURE__ */ jsxs13("div", { className: "min-w-0 flex-1", children: [
|
|
5210
|
+
/* @__PURE__ */ jsx15("p", { className: "truncate text-[15px] font-semibold", children: run.title }),
|
|
5211
|
+
/* @__PURE__ */ jsx15("p", { className: "truncate font-mono text-xs text-muted-foreground", children: run.toolName })
|
|
5043
5212
|
] }),
|
|
5044
|
-
/* @__PURE__ */
|
|
5213
|
+
/* @__PURE__ */ jsx15(
|
|
5045
5214
|
"button",
|
|
5046
5215
|
{
|
|
5047
5216
|
type: "button",
|
|
5048
5217
|
onClick: onClose,
|
|
5049
5218
|
"aria-label": "Close",
|
|
5050
5219
|
className: "rounded-md p-1.5 text-muted-foreground transition hover:bg-accent hover:text-foreground",
|
|
5051
|
-
children: /* @__PURE__ */
|
|
5220
|
+
children: /* @__PURE__ */ jsx15("svg", { className: "h-4 w-4", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx15("path", { d: "M18 6 6 18M6 6l12 12" }) })
|
|
5052
5221
|
}
|
|
5053
5222
|
)
|
|
5054
5223
|
] }),
|
|
5055
|
-
/* @__PURE__ */
|
|
5056
|
-
run.steps.length === 0 && /* @__PURE__ */
|
|
5057
|
-
run.steps.map((step, i) => /* @__PURE__ */
|
|
5058
|
-
/* @__PURE__ */
|
|
5059
|
-
/* @__PURE__ */
|
|
5060
|
-
/* @__PURE__ */
|
|
5061
|
-
/* @__PURE__ */
|
|
5224
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex-1 space-y-3 overflow-y-auto p-4", children: [
|
|
5225
|
+
run.steps.length === 0 && /* @__PURE__ */ jsx15("p", { className: "text-sm text-muted-foreground", children: "No steps recorded yet." }),
|
|
5226
|
+
run.steps.map((step, i) => /* @__PURE__ */ jsxs13("div", { className: "rounded-lg border border-card-edge bg-card", children: [
|
|
5227
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex items-baseline gap-2 border-b border-border px-3 py-1.5", children: [
|
|
5228
|
+
/* @__PURE__ */ jsx15("span", { className: `font-mono text-xs ${step.status === "error" ? "text-destructive" : "text-muted-foreground"}`, children: step.status === "error" ? "\u2717" : "$" }),
|
|
5229
|
+
/* @__PURE__ */ jsx15("code", { className: "min-w-0 flex-1 truncate font-mono text-xs", children: step.label }),
|
|
5230
|
+
/* @__PURE__ */ jsx15("span", { className: "shrink-0 text-xs tabular-nums text-muted-foreground", children: new Date(step.at).toLocaleTimeString([], { hour: "numeric", minute: "2-digit" }) })
|
|
5062
5231
|
] }),
|
|
5063
|
-
step.detail && /* @__PURE__ */
|
|
5232
|
+
step.detail && /* @__PURE__ */ jsx15("pre", { className: "max-h-48 overflow-auto whitespace-pre-wrap px-3 py-2 font-mono text-xs leading-relaxed text-muted-foreground", children: step.detail })
|
|
5064
5233
|
] }, i))
|
|
5065
5234
|
] }),
|
|
5066
|
-
/* @__PURE__ */
|
|
5235
|
+
/* @__PURE__ */ jsx15("p", { className: "border-t border-border px-4 py-2 text-xs text-muted-foreground", children: "Read-only transcript \u2014 reply in the main chat." })
|
|
5067
5236
|
] });
|
|
5068
5237
|
}
|
|
5069
5238
|
function pendingApprovalOf(call) {
|
|
@@ -5079,23 +5248,23 @@ function ChatEmptyState({
|
|
|
5079
5248
|
}) {
|
|
5080
5249
|
const doorCount = Math.min(doors?.length ?? 0, 3);
|
|
5081
5250
|
const doorsGridClass = doorCount === 1 ? "mx-auto max-w-sm sm:grid-cols-1" : doorCount === 2 ? "sm:grid-cols-2" : "sm:grid-cols-3";
|
|
5082
|
-
return /* @__PURE__ */
|
|
5083
|
-
/* @__PURE__ */
|
|
5084
|
-
/* @__PURE__ */
|
|
5085
|
-
/* @__PURE__ */
|
|
5086
|
-
subline && /* @__PURE__ */
|
|
5087
|
-
doors && doors.length > 0 && /* @__PURE__ */
|
|
5251
|
+
return /* @__PURE__ */ jsxs13("div", { className: "mx-auto flex w-full max-w-2xl flex-col items-center px-6 py-12 text-center sm:py-20", children: [
|
|
5252
|
+
/* @__PURE__ */ jsx15("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__ */ jsx15(BrandMark, { size: 32, className: "shrink-0" }) }),
|
|
5253
|
+
/* @__PURE__ */ jsx15("p", { className: "text-xs font-semibold uppercase tracking-[0.05em] text-muted-foreground", children: productName }),
|
|
5254
|
+
/* @__PURE__ */ jsx15("h2", { className: "mt-1.5 text-balance text-2xl font-semibold leading-tight text-foreground", children: headline }),
|
|
5255
|
+
subline && /* @__PURE__ */ jsx15("p", { className: "mt-3 max-w-md text-[15px] leading-relaxed text-muted-foreground", children: subline }),
|
|
5256
|
+
doors && doors.length > 0 && /* @__PURE__ */ jsx15("div", { className: `mt-7 grid w-full gap-2.5 ${doorsGridClass}`, children: doors.slice(0, 3).map((door, i) => /* @__PURE__ */ jsxs13(
|
|
5088
5257
|
"button",
|
|
5089
5258
|
{
|
|
5090
5259
|
type: "button",
|
|
5091
5260
|
onClick: door.onSelect,
|
|
5092
5261
|
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",
|
|
5093
5262
|
children: [
|
|
5094
|
-
/* @__PURE__ */
|
|
5263
|
+
/* @__PURE__ */ jsxs13("span", { className: "flex items-center gap-2 text-sm font-semibold text-foreground", children: [
|
|
5095
5264
|
door.icon,
|
|
5096
5265
|
door.label
|
|
5097
5266
|
] }),
|
|
5098
|
-
door.description && /* @__PURE__ */
|
|
5267
|
+
door.description && /* @__PURE__ */ jsx15("span", { className: "mt-0.5 text-[12px] leading-snug text-muted-foreground", children: door.description })
|
|
5099
5268
|
]
|
|
5100
5269
|
},
|
|
5101
5270
|
i
|
|
@@ -5104,26 +5273,26 @@ function ChatEmptyState({
|
|
|
5104
5273
|
}
|
|
5105
5274
|
function ToolGlyph({ name, className }) {
|
|
5106
5275
|
if (name.startsWith("sandbox_")) {
|
|
5107
|
-
return /* @__PURE__ */
|
|
5108
|
-
/* @__PURE__ */
|
|
5109
|
-
/* @__PURE__ */
|
|
5276
|
+
return /* @__PURE__ */ jsxs13("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
|
|
5277
|
+
/* @__PURE__ */ jsx15("polyline", { points: "4 17 10 11 4 5" }),
|
|
5278
|
+
/* @__PURE__ */ jsx15("line", { x1: "12", y1: "19", x2: "20", y2: "19" })
|
|
5110
5279
|
] });
|
|
5111
5280
|
}
|
|
5112
5281
|
if (name === "submit_proposal") {
|
|
5113
|
-
return /* @__PURE__ */
|
|
5114
|
-
/* @__PURE__ */
|
|
5115
|
-
/* @__PURE__ */
|
|
5282
|
+
return /* @__PURE__ */ jsxs13("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
|
|
5283
|
+
/* @__PURE__ */ jsx15("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
|
|
5284
|
+
/* @__PURE__ */ jsx15("path", { d: "M14 2v6h6M9 15l2 2 4-4" })
|
|
5116
5285
|
] });
|
|
5117
5286
|
}
|
|
5118
5287
|
if (name === "schedule_followup") {
|
|
5119
|
-
return /* @__PURE__ */
|
|
5120
|
-
/* @__PURE__ */
|
|
5121
|
-
/* @__PURE__ */
|
|
5288
|
+
return /* @__PURE__ */ jsxs13("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": true, children: [
|
|
5289
|
+
/* @__PURE__ */ jsx15("circle", { cx: "12", cy: "12", r: "9" }),
|
|
5290
|
+
/* @__PURE__ */ jsx15("path", { d: "M12 7v5l3 3" })
|
|
5122
5291
|
] });
|
|
5123
5292
|
}
|
|
5124
|
-
return /* @__PURE__ */
|
|
5125
|
-
/* @__PURE__ */
|
|
5126
|
-
/* @__PURE__ */
|
|
5293
|
+
return /* @__PURE__ */ jsxs13("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
|
|
5294
|
+
/* @__PURE__ */ jsx15("path", { d: "M12 3v3m0 12v3M3 12h3m12 0h3" }),
|
|
5295
|
+
/* @__PURE__ */ jsx15("circle", { cx: "12", cy: "12", r: "4" })
|
|
5127
5296
|
] });
|
|
5128
5297
|
}
|
|
5129
5298
|
function toolOutcomeOf(call) {
|
|
@@ -5209,40 +5378,40 @@ function truncate(v, max = 240) {
|
|
|
5209
5378
|
function KvRows({ data }) {
|
|
5210
5379
|
const entries = Object.entries(data).filter(([, v]) => v !== void 0 && v !== null && v !== "");
|
|
5211
5380
|
if (!entries.length) return null;
|
|
5212
|
-
return /* @__PURE__ */
|
|
5213
|
-
/* @__PURE__ */
|
|
5214
|
-
/* @__PURE__ */
|
|
5381
|
+
return /* @__PURE__ */ jsx15("dl", { className: "grid grid-cols-[auto_1fr] gap-x-3 gap-y-1", children: entries.map(([k, v]) => /* @__PURE__ */ jsxs13("div", { className: "contents", children: [
|
|
5382
|
+
/* @__PURE__ */ jsx15("dt", { className: "font-mono text-xs text-muted-foreground", children: k }),
|
|
5383
|
+
/* @__PURE__ */ jsx15("dd", { className: "min-w-0 whitespace-pre-wrap break-words font-mono text-xs text-muted-foreground", children: truncate(v) })
|
|
5215
5384
|
] }, k)) });
|
|
5216
5385
|
}
|
|
5217
5386
|
function ShellDetail({ call }) {
|
|
5218
5387
|
const outcome = toolOutcomeOf(call);
|
|
5219
5388
|
const r = outcome?.result ?? {};
|
|
5220
|
-
return /* @__PURE__ */
|
|
5221
|
-
/* @__PURE__ */
|
|
5222
|
-
/* @__PURE__ */
|
|
5223
|
-
/* @__PURE__ */
|
|
5224
|
-
r.exitCode != null && /* @__PURE__ */
|
|
5389
|
+
return /* @__PURE__ */ jsxs13("div", { className: "overflow-hidden rounded-md bg-zinc-900 font-mono text-xs leading-relaxed", children: [
|
|
5390
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-2 px-3 pt-2 text-zinc-400", children: [
|
|
5391
|
+
/* @__PURE__ */ jsx15("span", { className: "select-none text-zinc-500", children: "$" }),
|
|
5392
|
+
/* @__PURE__ */ jsx15("span", { className: "min-w-0 flex-1 truncate text-zinc-200", children: String(call.args?.command ?? "") }),
|
|
5393
|
+
r.exitCode != null && /* @__PURE__ */ jsxs13("span", { className: r.exitCode === 0 ? "text-success" : "text-destructive", children: [
|
|
5225
5394
|
"exit ",
|
|
5226
5395
|
r.exitCode
|
|
5227
5396
|
] })
|
|
5228
5397
|
] }),
|
|
5229
|
-
/* @__PURE__ */
|
|
5398
|
+
/* @__PURE__ */ jsx15("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)" })
|
|
5230
5399
|
] });
|
|
5231
5400
|
}
|
|
5232
5401
|
function DefaultToolDetail({ call }) {
|
|
5233
5402
|
const result = call.result;
|
|
5234
5403
|
const envelope = typeof result === "object" && result !== null ? result : null;
|
|
5235
|
-
return /* @__PURE__ */
|
|
5236
|
-
call.args && Object.keys(call.args).length > 0 && /* @__PURE__ */
|
|
5237
|
-
/* @__PURE__ */
|
|
5238
|
-
/* @__PURE__ */
|
|
5404
|
+
return /* @__PURE__ */ jsxs13("div", { className: "space-y-2", children: [
|
|
5405
|
+
call.args && Object.keys(call.args).length > 0 && /* @__PURE__ */ jsxs13("div", { children: [
|
|
5406
|
+
/* @__PURE__ */ jsx15("p", { className: "mb-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: "Called with" }),
|
|
5407
|
+
/* @__PURE__ */ jsx15(KvRows, { data: call.args })
|
|
5239
5408
|
] }),
|
|
5240
|
-
envelope ? /* @__PURE__ */
|
|
5241
|
-
/* @__PURE__ */
|
|
5242
|
-
envelope.ok === false ? /* @__PURE__ */
|
|
5243
|
-
] }) : result != null ? /* @__PURE__ */
|
|
5244
|
-
/* @__PURE__ */
|
|
5245
|
-
/* @__PURE__ */
|
|
5409
|
+
envelope ? /* @__PURE__ */ jsxs13("div", { children: [
|
|
5410
|
+
/* @__PURE__ */ jsx15("p", { className: "mb-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: envelope.ok === false ? "Failed" : "Result" }),
|
|
5411
|
+
envelope.ok === false ? /* @__PURE__ */ jsx15("p", { className: "text-xs text-destructive", children: envelope.message ?? "Tool failed" }) : envelope.result && typeof envelope.result === "object" ? /* @__PURE__ */ jsx15(KvRows, { data: envelope.result }) : envelope.result != null ? /* @__PURE__ */ jsx15("p", { className: "font-mono text-xs text-muted-foreground", children: truncate(envelope.result) }) : null
|
|
5412
|
+
] }) : result != null ? /* @__PURE__ */ jsxs13("div", { children: [
|
|
5413
|
+
/* @__PURE__ */ jsx15("p", { className: "mb-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: "Result" }),
|
|
5414
|
+
/* @__PURE__ */ jsx15("p", { className: "font-mono text-xs text-muted-foreground", children: truncate(result) })
|
|
5246
5415
|
] }) : null
|
|
5247
5416
|
] });
|
|
5248
5417
|
}
|
|
@@ -5253,24 +5422,24 @@ function ProposalCard({
|
|
|
5253
5422
|
approval,
|
|
5254
5423
|
renderers
|
|
5255
5424
|
}) {
|
|
5256
|
-
const [expanded, setExpanded] =
|
|
5425
|
+
const [expanded, setExpanded] = useState16(false);
|
|
5257
5426
|
const { summary, meta, typeSlug } = proposalPreview(call);
|
|
5258
5427
|
const custom = renderers?.[call.name]?.(call, message);
|
|
5259
5428
|
const { pending: deciding, run: decide } = usePending();
|
|
5260
|
-
return /* @__PURE__ */
|
|
5261
|
-
/* @__PURE__ */
|
|
5262
|
-
/* @__PURE__ */
|
|
5263
|
-
/* @__PURE__ */
|
|
5264
|
-
/* @__PURE__ */
|
|
5265
|
-
/* @__PURE__ */
|
|
5266
|
-
summary && /* @__PURE__ */
|
|
5267
|
-
typeSlug && /* @__PURE__ */
|
|
5268
|
-
meta.length > 0 && /* @__PURE__ */
|
|
5429
|
+
return /* @__PURE__ */ jsxs13("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: [
|
|
5430
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex items-start gap-2.5 px-4 pt-3.5", children: [
|
|
5431
|
+
/* @__PURE__ */ jsx15("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__ */ jsx15(ToolGlyph, { name: call.name, className: "h-3.5 w-3.5" }) }),
|
|
5432
|
+
/* @__PURE__ */ jsxs13("div", { className: "min-w-0 flex-1", children: [
|
|
5433
|
+
/* @__PURE__ */ jsx15("p", { className: "text-xs font-semibold uppercase tracking-[0.05em] text-warning-strong", children: approval ? "Needs your approval" : "Awaiting approval" }),
|
|
5434
|
+
/* @__PURE__ */ jsx15("p", { className: "mt-0.5 text-[15px] font-semibold leading-snug text-foreground", children: friendlyToolTitle(call) }),
|
|
5435
|
+
summary && /* @__PURE__ */ jsx15("p", { className: "mt-1 text-xs leading-relaxed text-muted-foreground", children: summary }),
|
|
5436
|
+
typeSlug && /* @__PURE__ */ jsx15("p", { className: "mt-1 font-mono text-xs text-muted-foreground", children: typeSlug }),
|
|
5437
|
+
meta.length > 0 && /* @__PURE__ */ jsx15("div", { className: "mt-1.5 flex flex-wrap items-center gap-1.5", children: meta.map((m, i) => /* @__PURE__ */ jsx15("span", { className: "rounded-full bg-secondary px-2 py-0.5 text-xs font-medium text-muted-foreground", children: m }, i)) })
|
|
5269
5438
|
] })
|
|
5270
5439
|
] }),
|
|
5271
|
-
/* @__PURE__ */
|
|
5272
|
-
approval && /* @__PURE__ */
|
|
5273
|
-
/* @__PURE__ */
|
|
5440
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex flex-wrap items-center gap-2 px-4 pb-3.5 pt-3", children: [
|
|
5441
|
+
approval && /* @__PURE__ */ jsxs13(Fragment7, { children: [
|
|
5442
|
+
/* @__PURE__ */ jsx15(
|
|
5274
5443
|
"button",
|
|
5275
5444
|
{
|
|
5276
5445
|
type: "button",
|
|
@@ -5280,7 +5449,7 @@ function ProposalCard({
|
|
|
5280
5449
|
children: "Approve & run"
|
|
5281
5450
|
}
|
|
5282
5451
|
),
|
|
5283
|
-
/* @__PURE__ */
|
|
5452
|
+
/* @__PURE__ */ jsx15(
|
|
5284
5453
|
"button",
|
|
5285
5454
|
{
|
|
5286
5455
|
type: "button",
|
|
@@ -5291,7 +5460,7 @@ function ProposalCard({
|
|
|
5291
5460
|
}
|
|
5292
5461
|
)
|
|
5293
5462
|
] }),
|
|
5294
|
-
/* @__PURE__ */
|
|
5463
|
+
/* @__PURE__ */ jsxs13(
|
|
5295
5464
|
"button",
|
|
5296
5465
|
{
|
|
5297
5466
|
type: "button",
|
|
@@ -5300,12 +5469,12 @@ function ProposalCard({
|
|
|
5300
5469
|
className: "ml-auto inline-flex items-center gap-1 rounded text-[12px] font-medium text-muted-foreground transition hover:text-foreground",
|
|
5301
5470
|
children: [
|
|
5302
5471
|
expanded ? "Hide details" : "View details",
|
|
5303
|
-
/* @__PURE__ */
|
|
5472
|
+
/* @__PURE__ */ jsx15(ChevronDown, { className: `h-3 w-3 transition-transform ${expanded ? "rotate-180" : ""}` })
|
|
5304
5473
|
]
|
|
5305
5474
|
}
|
|
5306
5475
|
)
|
|
5307
5476
|
] }),
|
|
5308
|
-
expanded && /* @__PURE__ */
|
|
5477
|
+
expanded && /* @__PURE__ */ jsx15("div", { className: "border-t border-warning/20 px-4 py-3 text-xs", children: custom ?? /* @__PURE__ */ jsx15(DefaultToolDetail, { call }) })
|
|
5309
5478
|
] });
|
|
5310
5479
|
}
|
|
5311
5480
|
function formatFollowupWhen(when) {
|
|
@@ -5320,14 +5489,14 @@ function FollowupCard({ call }) {
|
|
|
5320
5489
|
const when = typeof a.when === "string" ? a.when : typeof a.at === "string" ? a.at : typeof a.schedule === "string" ? a.schedule : null;
|
|
5321
5490
|
const failed = toolCallFailed(call);
|
|
5322
5491
|
const errorText = failed ? toolOutcomeOf(call)?.message ?? "Scheduling failed" : null;
|
|
5323
|
-
return /* @__PURE__ */
|
|
5324
|
-
/* @__PURE__ */
|
|
5325
|
-
/* @__PURE__ */
|
|
5326
|
-
/* @__PURE__ */
|
|
5327
|
-
when && /* @__PURE__ */
|
|
5328
|
-
/* @__PURE__ */
|
|
5492
|
+
return /* @__PURE__ */ jsx15("div", { className: "flex items-start gap-2", children: /* @__PURE__ */ jsxs13("div", { className: "min-w-0 flex-1 overflow-hidden rounded-[var(--radius-lg)] border border-[var(--border-subtle)] bg-[var(--md3-surface-container)]", children: [
|
|
5493
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex w-full items-center gap-2.5 px-3 py-2", children: [
|
|
5494
|
+
/* @__PURE__ */ jsx15("span", { className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-[var(--radius-sm)] border border-border bg-muted text-muted-foreground", children: /* @__PURE__ */ jsx15(ToolGlyph, { name: call.name, className: "h-3.5 w-3.5" }) }),
|
|
5495
|
+
/* @__PURE__ */ jsx15("span", { className: "shrink-0 whitespace-nowrap text-xs font-medium text-foreground", children: friendlyToolTitle(call) }),
|
|
5496
|
+
when && /* @__PURE__ */ jsx15("span", { title: when, className: "hidden min-w-0 flex-1 truncate font-mono text-xs tabular-nums text-muted-foreground sm:inline", children: formatFollowupWhen(when) }),
|
|
5497
|
+
/* @__PURE__ */ jsx15("span", { className: "ml-auto flex shrink-0 items-center gap-1.5", children: call.status === "running" ? /* @__PURE__ */ jsx15("svg", { className: "h-3 w-3 shrink-0 animate-spin text-[var(--accent-text)]", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": true, children: /* @__PURE__ */ jsx15("path", { d: "M21 12a9 9 0 1 1-6.219-8.56", strokeLinecap: "round" }) }) : /* @__PURE__ */ jsx15("span", { className: `h-1.5 w-1.5 shrink-0 rounded-full ${failed ? "bg-[var(--surface-danger-text)]" : "bg-[var(--surface-success-text)]"}` }) })
|
|
5329
5498
|
] }),
|
|
5330
|
-
errorText && /* @__PURE__ */
|
|
5499
|
+
errorText && /* @__PURE__ */ jsx15("div", { className: "border-t border-border px-3 py-2 text-xs text-[var(--surface-danger-text)]", children: errorText })
|
|
5331
5500
|
] }) });
|
|
5332
5501
|
}
|
|
5333
5502
|
function toolRowTitle(call) {
|
|
@@ -5350,10 +5519,10 @@ function ToolCallCard({
|
|
|
5350
5519
|
const arrival = useArrivalStyle(staggerIndex ?? 0);
|
|
5351
5520
|
const pending = call.status === "done" ? pendingApprovalOf(call) : null;
|
|
5352
5521
|
const kind = blockKindOf(call);
|
|
5353
|
-
const arrive = (row) => /* @__PURE__ */
|
|
5522
|
+
const arrive = (row) => /* @__PURE__ */ jsx15("div", { className: "agent-arrive", style: arrival, children: row });
|
|
5354
5523
|
if (pending) {
|
|
5355
5524
|
return arrive(
|
|
5356
|
-
/* @__PURE__ */
|
|
5525
|
+
/* @__PURE__ */ jsx15(
|
|
5357
5526
|
ProposalCard,
|
|
5358
5527
|
{
|
|
5359
5528
|
call,
|
|
@@ -5366,18 +5535,18 @@ function ToolCallCard({
|
|
|
5366
5535
|
);
|
|
5367
5536
|
}
|
|
5368
5537
|
if (kind === "followup") {
|
|
5369
|
-
return arrive(/* @__PURE__ */
|
|
5538
|
+
return arrive(/* @__PURE__ */ jsx15(FollowupCard, { call }));
|
|
5370
5539
|
}
|
|
5371
5540
|
const custom = renderers?.[call.name]?.(call, message);
|
|
5372
5541
|
return arrive(
|
|
5373
|
-
/* @__PURE__ */
|
|
5542
|
+
/* @__PURE__ */ jsx15(
|
|
5374
5543
|
InlineToolItem,
|
|
5375
5544
|
{
|
|
5376
5545
|
part: chatToolCallPart(call),
|
|
5377
5546
|
title: toolRowTitle(call),
|
|
5378
5547
|
description: toolRowDescription(call),
|
|
5379
|
-
renderToolDetail: () => custom ?? (call.name === "sandbox_run_command" ? /* @__PURE__ */
|
|
5380
|
-
actions: onOpenRun && call.name.startsWith("sandbox_") ? /* @__PURE__ */
|
|
5548
|
+
renderToolDetail: () => custom ?? (call.name === "sandbox_run_command" ? /* @__PURE__ */ jsx15(ShellDetail, { call }) : /* @__PURE__ */ jsx15(DefaultToolDetail, { call })),
|
|
5549
|
+
actions: onOpenRun && call.name.startsWith("sandbox_") ? /* @__PURE__ */ jsx15(
|
|
5381
5550
|
"button",
|
|
5382
5551
|
{
|
|
5383
5552
|
type: "button",
|
|
@@ -5385,9 +5554,9 @@ function ToolCallCard({
|
|
|
5385
5554
|
"aria-label": "Open full transcript",
|
|
5386
5555
|
title: "Open full transcript",
|
|
5387
5556
|
className: "rounded-md p-1.5 text-muted-foreground transition hover:bg-accent hover:text-foreground",
|
|
5388
|
-
children: /* @__PURE__ */
|
|
5389
|
-
/* @__PURE__ */
|
|
5390
|
-
/* @__PURE__ */
|
|
5557
|
+
children: /* @__PURE__ */ jsxs13("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: [
|
|
5558
|
+
/* @__PURE__ */ jsx15("path", { d: "M7 17 17 7" }),
|
|
5559
|
+
/* @__PURE__ */ jsx15("path", { d: "M7 7h10v10" })
|
|
5391
5560
|
] })
|
|
5392
5561
|
}
|
|
5393
5562
|
) : void 0
|
|
@@ -5396,7 +5565,7 @@ function ToolCallCard({
|
|
|
5396
5565
|
);
|
|
5397
5566
|
}
|
|
5398
5567
|
function StreamingCaret() {
|
|
5399
|
-
return /* @__PURE__ */
|
|
5568
|
+
return /* @__PURE__ */ jsx15(
|
|
5400
5569
|
"span",
|
|
5401
5570
|
{
|
|
5402
5571
|
className: "ml-0.5 inline-block h-[1.1em] w-[3px] translate-y-[2px] animate-[agent-caret_1s_step-end_infinite] rounded-sm bg-foreground/70",
|
|
@@ -5421,9 +5590,9 @@ function SegmentText({
|
|
|
5421
5590
|
// the container on top of that makes the paragraph shimmer while it types.
|
|
5422
5591
|
// The distinction is what separates "the answer materialised" from "the
|
|
5423
5592
|
// log was appended to".
|
|
5424
|
-
/* @__PURE__ */
|
|
5593
|
+
/* @__PURE__ */ jsxs13("div", { className: `${messageClassName}${streaming ? "" : " agent-stream-in"}`, children: [
|
|
5425
5594
|
body,
|
|
5426
|
-
showCaret && /* @__PURE__ */
|
|
5595
|
+
showCaret && /* @__PURE__ */ jsx15(StreamingCaret, {})
|
|
5427
5596
|
] })
|
|
5428
5597
|
);
|
|
5429
5598
|
}
|
|
@@ -5448,7 +5617,7 @@ function SegmentedBody({
|
|
|
5448
5617
|
const leftoverToolCalls = (msg.toolCalls ?? []).filter(
|
|
5449
5618
|
(tc) => !segmentToolIds.has(tc.id)
|
|
5450
5619
|
);
|
|
5451
|
-
const renderToolCard = (call, index) => /* @__PURE__ */
|
|
5620
|
+
const renderToolCard = (call, index) => /* @__PURE__ */ jsx15(
|
|
5452
5621
|
ToolCallCard,
|
|
5453
5622
|
{
|
|
5454
5623
|
call,
|
|
@@ -5476,7 +5645,7 @@ function SegmentedBody({
|
|
|
5476
5645
|
for (const g of groups) {
|
|
5477
5646
|
if (g.kind === "text") {
|
|
5478
5647
|
children.push(
|
|
5479
|
-
/* @__PURE__ */
|
|
5648
|
+
/* @__PURE__ */ jsx15(
|
|
5480
5649
|
SegmentText,
|
|
5481
5650
|
{
|
|
5482
5651
|
content: g.content,
|
|
@@ -5492,13 +5661,13 @@ function SegmentedBody({
|
|
|
5492
5661
|
}
|
|
5493
5662
|
if (!streaming && g.calls.length >= COLLAPSE_TOOL_RUN_AT && !g.calls.some(isImportantTool)) {
|
|
5494
5663
|
children.push(
|
|
5495
|
-
/* @__PURE__ */
|
|
5496
|
-
/* @__PURE__ */
|
|
5664
|
+
/* @__PURE__ */ jsxs13("details", { children: [
|
|
5665
|
+
/* @__PURE__ */ jsxs13("summary", { className: "cursor-pointer select-none rounded-md py-0.5 text-xs font-medium text-muted-foreground [transition:color_var(--motion-control)] hover:text-foreground", children: [
|
|
5497
5666
|
"Worked through ",
|
|
5498
5667
|
g.calls.length,
|
|
5499
5668
|
" steps"
|
|
5500
5669
|
] }),
|
|
5501
|
-
/* @__PURE__ */
|
|
5670
|
+
/* @__PURE__ */ jsx15("div", { className: "mt-1.5 flex flex-col gap-1.5", children: g.calls.map(renderToolCard) })
|
|
5502
5671
|
] }, `tools-fold-${g.index}`)
|
|
5503
5672
|
);
|
|
5504
5673
|
continue;
|
|
@@ -5507,9 +5676,9 @@ function SegmentedBody({
|
|
|
5507
5676
|
}
|
|
5508
5677
|
leftoverToolCalls.forEach((call, index) => children.push(renderToolCard(call, index)));
|
|
5509
5678
|
if (streaming && segments[lastIndex]?.kind === "tool") {
|
|
5510
|
-
children.push(/* @__PURE__ */
|
|
5679
|
+
children.push(/* @__PURE__ */ jsx15(StreamingCaret, {}, "streaming-caret"));
|
|
5511
5680
|
}
|
|
5512
|
-
return /* @__PURE__ */
|
|
5681
|
+
return /* @__PURE__ */ jsx15("div", { className: "flex flex-col gap-2", children });
|
|
5513
5682
|
}
|
|
5514
5683
|
var QUIET_META_LANE_CLASS = "mt-1 flex h-[18px] items-center gap-2 text-xs tabular-nums 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";
|
|
5515
5684
|
function copyTextOf(msg) {
|
|
@@ -5518,9 +5687,9 @@ function copyTextOf(msg) {
|
|
|
5518
5687
|
return msg.content;
|
|
5519
5688
|
}
|
|
5520
5689
|
function CopyMessageButton({ text }) {
|
|
5521
|
-
const [copied, setCopied] =
|
|
5522
|
-
const timerRef =
|
|
5523
|
-
|
|
5690
|
+
const [copied, setCopied] = useState16(false);
|
|
5691
|
+
const timerRef = useRef12(null);
|
|
5692
|
+
useEffect12(
|
|
5524
5693
|
() => () => {
|
|
5525
5694
|
if (timerRef.current !== null) clearTimeout(timerRef.current);
|
|
5526
5695
|
},
|
|
@@ -5539,7 +5708,7 @@ function CopyMessageButton({ text }) {
|
|
|
5539
5708
|
}
|
|
5540
5709
|
);
|
|
5541
5710
|
};
|
|
5542
|
-
return /* @__PURE__ */
|
|
5711
|
+
return /* @__PURE__ */ jsx15(
|
|
5543
5712
|
"button",
|
|
5544
5713
|
{
|
|
5545
5714
|
type: "button",
|
|
@@ -5547,9 +5716,9 @@ function CopyMessageButton({ text }) {
|
|
|
5547
5716
|
"aria-label": "Copy message",
|
|
5548
5717
|
title: "Copy message",
|
|
5549
5718
|
className: "rounded p-0.5 text-muted-foreground transition hover:bg-accent hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
5550
|
-
children: copied ? /* @__PURE__ */
|
|
5551
|
-
/* @__PURE__ */
|
|
5552
|
-
/* @__PURE__ */
|
|
5719
|
+
children: copied ? /* @__PURE__ */ jsx15("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__ */ jsx15("polyline", { points: "20 6 9 17 4 12" }) }) : /* @__PURE__ */ jsxs13("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: [
|
|
5720
|
+
/* @__PURE__ */ jsx15("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2" }),
|
|
5721
|
+
/* @__PURE__ */ jsx15("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
|
|
5553
5722
|
] })
|
|
5554
5723
|
}
|
|
5555
5724
|
);
|
|
@@ -5575,31 +5744,31 @@ function AssistantMessageImpl({
|
|
|
5575
5744
|
const body = useMemo7(() => renderBody(content), [renderBody, content]);
|
|
5576
5745
|
const segments = msg.segments;
|
|
5577
5746
|
const hasAnswerText = content !== "" || (segments?.some((s) => s.kind === "text" && s.content.trim() !== "") ?? false);
|
|
5578
|
-
const reasoningScrollRef =
|
|
5579
|
-
const thinkStartRef =
|
|
5580
|
-
const thinkMsRef =
|
|
5747
|
+
const reasoningScrollRef = useRef12(null);
|
|
5748
|
+
const thinkStartRef = useRef12(null);
|
|
5749
|
+
const thinkMsRef = useRef12(null);
|
|
5581
5750
|
if (streaming && reasoning && !hasAnswerText && thinkStartRef.current === null) {
|
|
5582
5751
|
thinkStartRef.current = performance.now();
|
|
5583
5752
|
}
|
|
5584
5753
|
if (hasAnswerText && thinkStartRef.current !== null && thinkMsRef.current === null) {
|
|
5585
5754
|
thinkMsRef.current = performance.now() - thinkStartRef.current;
|
|
5586
5755
|
}
|
|
5587
|
-
|
|
5756
|
+
useEffect12(() => {
|
|
5588
5757
|
const el = reasoningScrollRef.current;
|
|
5589
5758
|
if (el && streaming && !hasAnswerText) el.scrollTop = el.scrollHeight;
|
|
5590
5759
|
}, [reasoning, streaming, hasAnswerText]);
|
|
5591
5760
|
const thinkingSeconds = useThinkingSeconds(
|
|
5592
5761
|
streaming && !!reasoning && !hasAnswerText
|
|
5593
5762
|
);
|
|
5594
|
-
const [reasoningToggled, setReasoningToggled] =
|
|
5763
|
+
const [reasoningToggled, setReasoningToggled] = useState16(null);
|
|
5595
5764
|
const reasoningOpen = reasoningToggled ?? !hasAnswerText;
|
|
5596
5765
|
const quiet = chrome === "quiet";
|
|
5597
|
-
return /* @__PURE__ */
|
|
5598
|
-
!quiet && /* @__PURE__ */
|
|
5599
|
-
/* @__PURE__ */
|
|
5600
|
-
msg.modelUsed && /* @__PURE__ */
|
|
5601
|
-
formatTokensPerSecond(msg) && /* @__PURE__ */
|
|
5602
|
-
formatModelCost(msg, models) && /* @__PURE__ */
|
|
5766
|
+
return /* @__PURE__ */ jsxs13("div", { className: `mx-auto w-full max-w-3xl px-6 ${quiet ? "group pb-1 pt-3" : "py-3"}`, children: [
|
|
5767
|
+
!quiet && /* @__PURE__ */ jsxs13("div", { className: "mb-1 flex items-baseline gap-2 text-xs tabular-nums text-muted-foreground", children: [
|
|
5768
|
+
/* @__PURE__ */ jsx15("span", { className: "font-semibold uppercase tracking-[0.05em]", children: agentLabel }),
|
|
5769
|
+
msg.modelUsed && /* @__PURE__ */ jsx15("span", { className: "font-mono normal-case", children: msg.modelUsed }),
|
|
5770
|
+
formatTokensPerSecond(msg) && /* @__PURE__ */ jsx15("span", { children: formatTokensPerSecond(msg) }),
|
|
5771
|
+
formatModelCost(msg, models) && /* @__PURE__ */ jsx15("span", { children: formatModelCost(msg, models) })
|
|
5603
5772
|
] }),
|
|
5604
5773
|
reasoning && // The canonical run-row grammar (RunRowShell — the same shell the tool
|
|
5605
5774
|
// rows compose): one family of rows instead of a bespoke disclosure per
|
|
@@ -5609,12 +5778,12 @@ function AssistantMessageImpl({
|
|
|
5609
5778
|
// and a click outranks the default from then on — the contract the old
|
|
5610
5779
|
// hand-rolled disclosure had, now enforced through the shell's
|
|
5611
5780
|
// controlled `open`.
|
|
5612
|
-
/* @__PURE__ */
|
|
5781
|
+
/* @__PURE__ */ jsx15(
|
|
5613
5782
|
RunRowShell,
|
|
5614
5783
|
{
|
|
5615
5784
|
className: "mb-2",
|
|
5616
|
-
icon: /* @__PURE__ */
|
|
5617
|
-
title: !hasAnswerText ? /* @__PURE__ */
|
|
5785
|
+
icon: /* @__PURE__ */ jsx15(BrainGlyph, { className: "h-3.5 w-3.5" }),
|
|
5786
|
+
title: !hasAnswerText ? /* @__PURE__ */ jsxs13("span", { className: "agent-shimmer", "data-motion": "essential", children: [
|
|
5618
5787
|
"Thinking",
|
|
5619
5788
|
thinkingSeconds >= 1 ? ` \xB7 ${thinkingSeconds}s` : "\u2026"
|
|
5620
5789
|
] }) : thinkMsRef.current != null ? (
|
|
@@ -5629,7 +5798,7 @@ function AssistantMessageImpl({
|
|
|
5629
5798
|
status: hasAnswerText ? "idle" : "running",
|
|
5630
5799
|
open: reasoningOpen,
|
|
5631
5800
|
onOpenChange: (next) => setReasoningToggled(next),
|
|
5632
|
-
children: /* @__PURE__ */
|
|
5801
|
+
children: /* @__PURE__ */ jsx15(
|
|
5633
5802
|
"div",
|
|
5634
5803
|
{
|
|
5635
5804
|
ref: reasoningScrollRef,
|
|
@@ -5639,7 +5808,7 @@ function AssistantMessageImpl({
|
|
|
5639
5808
|
)
|
|
5640
5809
|
}
|
|
5641
5810
|
),
|
|
5642
|
-
segments && segments.length > 0 ? /* @__PURE__ */
|
|
5811
|
+
segments && segments.length > 0 ? /* @__PURE__ */ jsx15(
|
|
5643
5812
|
SegmentedBody,
|
|
5644
5813
|
{
|
|
5645
5814
|
segments,
|
|
@@ -5651,12 +5820,12 @@ function AssistantMessageImpl({
|
|
|
5651
5820
|
toolRenderers,
|
|
5652
5821
|
messageClassName
|
|
5653
5822
|
}
|
|
5654
|
-
) : /* @__PURE__ */
|
|
5655
|
-
/* @__PURE__ */
|
|
5823
|
+
) : /* @__PURE__ */ jsxs13(Fragment7, { children: [
|
|
5824
|
+
/* @__PURE__ */ jsxs13("div", { className: messageClassName, children: [
|
|
5656
5825
|
body,
|
|
5657
|
-
streaming && content && !msg.toolCalls?.length && /* @__PURE__ */
|
|
5826
|
+
streaming && content && !msg.toolCalls?.length && /* @__PURE__ */ jsx15(StreamingCaret, {})
|
|
5658
5827
|
] }),
|
|
5659
|
-
msg.toolCalls && msg.toolCalls.length > 0 && /* @__PURE__ */
|
|
5828
|
+
msg.toolCalls && msg.toolCalls.length > 0 && /* @__PURE__ */ jsx15("div", { className: "mt-2 flex flex-col gap-1.5", children: msg.toolCalls.map((tc, index) => /* @__PURE__ */ jsx15(
|
|
5660
5829
|
ToolCallCard,
|
|
5661
5830
|
{
|
|
5662
5831
|
call: tc,
|
|
@@ -5669,7 +5838,7 @@ function AssistantMessageImpl({
|
|
|
5669
5838
|
tc.id
|
|
5670
5839
|
)) })
|
|
5671
5840
|
] }),
|
|
5672
|
-
durableCards && msg.parts && /* @__PURE__ */
|
|
5841
|
+
durableCards && msg.parts && /* @__PURE__ */ jsx15(
|
|
5673
5842
|
DurableChatCards,
|
|
5674
5843
|
{
|
|
5675
5844
|
...durableCards,
|
|
@@ -5678,7 +5847,7 @@ function AssistantMessageImpl({
|
|
|
5678
5847
|
className: "mt-3"
|
|
5679
5848
|
}
|
|
5680
5849
|
),
|
|
5681
|
-
workProductCards && workProductPartsFromMessageParts(msg.parts).map((part) => /* @__PURE__ */
|
|
5850
|
+
workProductCards && workProductPartsFromMessageParts(msg.parts).map((part) => /* @__PURE__ */ jsx15(
|
|
5682
5851
|
WorkProductCard,
|
|
5683
5852
|
{
|
|
5684
5853
|
part,
|
|
@@ -5688,7 +5857,7 @@ function AssistantMessageImpl({
|
|
|
5688
5857
|
`${part.ref.id}:${part.ref.version}`
|
|
5689
5858
|
)),
|
|
5690
5859
|
renderExtras?.(msg),
|
|
5691
|
-
resolveAttachmentUrl && attachmentPartsFromMessageParts(msg.parts).length > 0 && /* @__PURE__ */
|
|
5860
|
+
resolveAttachmentUrl && attachmentPartsFromMessageParts(msg.parts).length > 0 && /* @__PURE__ */ jsx15("div", { className: "mt-2", children: /* @__PURE__ */ jsx15(
|
|
5692
5861
|
MessageAttachments,
|
|
5693
5862
|
{
|
|
5694
5863
|
parts: attachmentPartsFromMessageParts(msg.parts),
|
|
@@ -5696,18 +5865,18 @@ function AssistantMessageImpl({
|
|
|
5696
5865
|
justify: "start"
|
|
5697
5866
|
}
|
|
5698
5867
|
) }),
|
|
5699
|
-
quiet && /* @__PURE__ */
|
|
5700
|
-
/* @__PURE__ */
|
|
5701
|
-
msg.modelUsed && /* @__PURE__ */
|
|
5702
|
-
formatTokensPerSecond(msg) && /* @__PURE__ */
|
|
5703
|
-
formatModelCost(msg, models) && /* @__PURE__ */
|
|
5868
|
+
quiet && /* @__PURE__ */ jsxs13("div", { "data-testid": "message-meta-lane", className: QUIET_META_LANE_CLASS, children: [
|
|
5869
|
+
/* @__PURE__ */ jsx15(CopyMessageButton, { text: copyTextOf(msg) }),
|
|
5870
|
+
msg.modelUsed && /* @__PURE__ */ jsx15("span", { className: "font-mono", children: msg.modelUsed }),
|
|
5871
|
+
formatTokensPerSecond(msg) && /* @__PURE__ */ jsx15("span", { children: formatTokensPerSecond(msg) }),
|
|
5872
|
+
formatModelCost(msg, models) && /* @__PURE__ */ jsx15("span", { children: formatModelCost(msg, models) })
|
|
5704
5873
|
] })
|
|
5705
5874
|
] });
|
|
5706
5875
|
}
|
|
5707
5876
|
var AssistantMessage = memo(AssistantMessageImpl);
|
|
5708
5877
|
function useThinkingSeconds(active) {
|
|
5709
|
-
const [seconds, setSeconds] =
|
|
5710
|
-
|
|
5878
|
+
const [seconds, setSeconds] = useState16(0);
|
|
5879
|
+
useEffect12(() => {
|
|
5711
5880
|
if (!active) return;
|
|
5712
5881
|
setSeconds(0);
|
|
5713
5882
|
const id = setInterval(() => setSeconds((s) => s + 1), 1e3);
|
|
@@ -5717,23 +5886,23 @@ function useThinkingSeconds(active) {
|
|
|
5717
5886
|
}
|
|
5718
5887
|
function ThinkingRow({ agentLabel, chrome = "labeled" }) {
|
|
5719
5888
|
const seconds = useThinkingSeconds(true);
|
|
5720
|
-
return /* @__PURE__ */
|
|
5721
|
-
chrome !== "quiet" && /* @__PURE__ */
|
|
5722
|
-
/* @__PURE__ */
|
|
5723
|
-
/* @__PURE__ */
|
|
5889
|
+
return /* @__PURE__ */ jsxs13("div", { className: "mx-auto w-full max-w-3xl px-6 py-3", children: [
|
|
5890
|
+
chrome !== "quiet" && /* @__PURE__ */ jsx15("p", { className: "mb-1 text-xs font-semibold uppercase tracking-[0.05em] text-muted-foreground", children: agentLabel }),
|
|
5891
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-2 text-[15px] text-muted-foreground", children: [
|
|
5892
|
+
/* @__PURE__ */ jsx15("svg", { className: "h-4 w-4 animate-spin", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": true, children: /* @__PURE__ */ jsx15("path", { d: "M21 12a9 9 0 1 1-6.219-8.56", strokeLinecap: "round" }) }),
|
|
5724
5893
|
"Thinking",
|
|
5725
5894
|
seconds >= 3 ? ` \xB7 ${seconds}s` : "..."
|
|
5726
5895
|
] })
|
|
5727
5896
|
] });
|
|
5728
5897
|
}
|
|
5729
5898
|
function StreamErrorRow({ message, onRetry }) {
|
|
5730
|
-
return /* @__PURE__ */
|
|
5731
|
-
/* @__PURE__ */
|
|
5732
|
-
/* @__PURE__ */
|
|
5733
|
-
/* @__PURE__ */
|
|
5899
|
+
return /* @__PURE__ */ jsx15("div", { className: "mx-auto w-full max-w-3xl px-6 py-3", children: /* @__PURE__ */ jsxs13("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: [
|
|
5900
|
+
/* @__PURE__ */ jsxs13("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: [
|
|
5901
|
+
/* @__PURE__ */ jsx15("circle", { cx: "12", cy: "12", r: "9" }),
|
|
5902
|
+
/* @__PURE__ */ jsx15("path", { d: "M12 8v4m0 4h.01" })
|
|
5734
5903
|
] }),
|
|
5735
|
-
/* @__PURE__ */
|
|
5736
|
-
onRetry && /* @__PURE__ */
|
|
5904
|
+
/* @__PURE__ */ jsx15("span", { className: "min-w-0 flex-1 break-words", children: message }),
|
|
5905
|
+
onRetry && /* @__PURE__ */ jsx15(
|
|
5737
5906
|
"button",
|
|
5738
5907
|
{
|
|
5739
5908
|
type: "button",
|
|
@@ -5768,32 +5937,32 @@ function ChatMessages({
|
|
|
5768
5937
|
}) {
|
|
5769
5938
|
const messageClassName = messageSize === "large" ? "agent-app-message-copy text-[17px] leading-[1.6]" : "agent-app-message-copy text-base leading-[1.6]";
|
|
5770
5939
|
const renderBody = useMemo7(
|
|
5771
|
-
() => renderMarkdown ?? ((content) => /* @__PURE__ */
|
|
5940
|
+
() => renderMarkdown ?? ((content) => /* @__PURE__ */ jsx15("p", { className: "whitespace-pre-wrap", children: content })),
|
|
5772
5941
|
[renderMarkdown]
|
|
5773
5942
|
);
|
|
5774
5943
|
const lastIsUser = messages[messages.length - 1]?.role === "user";
|
|
5775
5944
|
const quiet = chrome === "quiet";
|
|
5776
5945
|
if (messages.length === 0 && !loading && !error) {
|
|
5777
|
-
const empty = renderEmpty ? renderEmpty() : /* @__PURE__ */
|
|
5778
|
-
return /* @__PURE__ */
|
|
5946
|
+
const empty = renderEmpty ? renderEmpty() : /* @__PURE__ */ jsx15(ChatEmptyState, { ...emptyState });
|
|
5947
|
+
return /* @__PURE__ */ jsxs13(Fragment7, { children: [
|
|
5779
5948
|
header,
|
|
5780
5949
|
empty
|
|
5781
5950
|
] });
|
|
5782
5951
|
}
|
|
5783
|
-
return /* @__PURE__ */
|
|
5952
|
+
return /* @__PURE__ */ jsxs13(Fragment7, { children: [
|
|
5784
5953
|
header,
|
|
5785
5954
|
messages.map(
|
|
5786
|
-
(msg) => msg.role === "user" ? /* @__PURE__ */
|
|
5787
|
-
/* @__PURE__ */
|
|
5788
|
-
!quiet && /* @__PURE__ */
|
|
5789
|
-
/* @__PURE__ */
|
|
5955
|
+
(msg) => msg.role === "user" ? /* @__PURE__ */ jsxs13("div", { className: `mx-auto w-full max-w-3xl px-6 ${quiet ? "group pb-1 pt-3" : "py-3"}`, children: [
|
|
5956
|
+
/* @__PURE__ */ jsxs13("div", { className: `ml-auto w-fit ${quiet ? "max-w-[72%]" : "max-w-[85%]"}`, children: [
|
|
5957
|
+
!quiet && /* @__PURE__ */ jsx15("p", { className: "mb-1 text-right text-xs font-semibold uppercase tracking-[0.05em] text-muted-foreground", children: userLabel }),
|
|
5958
|
+
/* @__PURE__ */ jsx15(
|
|
5790
5959
|
"div",
|
|
5791
5960
|
{
|
|
5792
5961
|
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}`,
|
|
5793
|
-
children: /* @__PURE__ */
|
|
5962
|
+
children: /* @__PURE__ */ jsx15("p", { className: "whitespace-pre-wrap", children: msg.content })
|
|
5794
5963
|
}
|
|
5795
5964
|
),
|
|
5796
|
-
resolveAttachmentUrl && attachmentPartsFromMessageParts(msg.parts).length > 0 && /* @__PURE__ */
|
|
5965
|
+
resolveAttachmentUrl && attachmentPartsFromMessageParts(msg.parts).length > 0 && /* @__PURE__ */ jsx15("div", { className: "mt-1.5", children: /* @__PURE__ */ jsx15(
|
|
5797
5966
|
MessageAttachments,
|
|
5798
5967
|
{
|
|
5799
5968
|
parts: attachmentPartsFromMessageParts(msg.parts),
|
|
@@ -5802,8 +5971,8 @@ function ChatMessages({
|
|
|
5802
5971
|
}
|
|
5803
5972
|
) })
|
|
5804
5973
|
] }),
|
|
5805
|
-
quiet && /* @__PURE__ */
|
|
5806
|
-
] }, msg.id) : /* @__PURE__ */
|
|
5974
|
+
quiet && /* @__PURE__ */ jsx15("div", { "data-testid": "message-meta-lane", className: `${QUIET_META_LANE_CLASS} justify-end`, children: /* @__PURE__ */ jsx15(CopyMessageButton, { text: msg.content }) })
|
|
5975
|
+
] }, msg.id) : /* @__PURE__ */ jsx15(
|
|
5807
5976
|
AssistantMessage,
|
|
5808
5977
|
{
|
|
5809
5978
|
msg,
|
|
@@ -5824,8 +5993,8 @@ function ChatMessages({
|
|
|
5824
5993
|
msg.id
|
|
5825
5994
|
)
|
|
5826
5995
|
),
|
|
5827
|
-
loading && lastIsUser && /* @__PURE__ */
|
|
5828
|
-
error && !loading && /* @__PURE__ */
|
|
5996
|
+
loading && lastIsUser && /* @__PURE__ */ jsx15(ThinkingRow, { agentLabel, chrome }),
|
|
5997
|
+
error && !loading && /* @__PURE__ */ jsx15(StreamErrorRow, { message: error, onRetry })
|
|
5829
5998
|
] });
|
|
5830
5999
|
}
|
|
5831
6000
|
|
|
@@ -5950,6 +6119,7 @@ export {
|
|
|
5950
6119
|
insightPageCount,
|
|
5951
6120
|
insightPageSlice,
|
|
5952
6121
|
InsightDeck,
|
|
6122
|
+
ApiAccessPanel,
|
|
5953
6123
|
formatModelCost,
|
|
5954
6124
|
formatTokensPerSecond,
|
|
5955
6125
|
RunDrillIn,
|
|
@@ -5959,4 +6129,4 @@ export {
|
|
|
5959
6129
|
useThinkingSeconds,
|
|
5960
6130
|
ChatMessages
|
|
5961
6131
|
};
|
|
5962
|
-
//# sourceMappingURL=chunk-
|
|
6132
|
+
//# sourceMappingURL=chunk-H6R3VYAZ.js.map
|