@dudko.dev/agent-web-react 0.0.42 → 0.0.43

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/index.js CHANGED
@@ -64,10 +64,12 @@ import {
64
64
  MCP_APP_POLICY_TOKEN_MAX_CHARS,
65
65
  MCP_APP_SANDBOX_PROXY_READY,
66
66
  MCP_APP_SANDBOX_RESOURCE_READY,
67
+ MCP_APP_SCHEME_PARAM,
67
68
  isMcpAppSandboxMessage,
69
+ mcpAppColorScheme,
68
70
  mcpAppPolicy,
69
71
  mcpAppPolicyToken
70
- } from "./chunk-FXHQXIOU.js";
72
+ } from "./chunk-AWZ2OZSG.js";
71
73
 
72
74
  // src/hooks/use-agent.ts
73
75
  import { useCallback, useEffect, useReducer, useRef, useState } from "react";
@@ -3699,6 +3701,7 @@ var defaultLabels = {
3699
3701
  dictate: "Dictate (speech to text)",
3700
3702
  dictateTitle: "Dictate \u2014 speech to text in the browser",
3701
3703
  stopDictation: "Stop dictation",
3704
+ micListening: "Listening \u2014 tap to finish",
3702
3705
  microphone: "Microphone",
3703
3706
  transcribing: "Transcribing\u2026",
3704
3707
  micDenied: "The microphone is blocked for this site. Allow it in the browser's site settings (the icon beside the address), then try again.",
@@ -3848,6 +3851,7 @@ var defaultLabels = {
3848
3851
  readAloudCode: "A code block is not read out.",
3849
3852
  readAloudFailed: "It could not be read aloud.",
3850
3853
  filesWritten: (n) => `${plural(n, "file", "files")} written in this turn`,
3854
+ filesNamed: (n) => `${plural(n, "file", "files")} in this answer`,
3851
3855
  filesCount: (n) => plural(n, "file", "files"),
3852
3856
  showInFiles: "Show in Files",
3853
3857
  fileKinds: {
@@ -4218,7 +4222,7 @@ var useAgentContext = () => {
4218
4222
  var useOptionalAgentContext = () => useContext2(AgentContext);
4219
4223
 
4220
4224
  // src/components/AgentChat.tsx
4221
- import { useEffect as useEffect20, useRef as useRef14, useState as useState20 } from "react";
4225
+ import { useEffect as useEffect20, useRef as useRef15, useState as useState20 } from "react";
4222
4226
  import { createPortal as createPortal2 } from "react-dom";
4223
4227
 
4224
4228
  // src/hooks/use-follow-scroll.ts
@@ -4476,9 +4480,13 @@ var grantedAppCsp = (csp) => ({
4476
4480
  resourceDomains: origins(csp?.resourceDomains)
4477
4481
  });
4478
4482
  var MCP_APP_RELAY = "(function(){var f=document.getElementById('app');function reserved(d){return !!d&&typeof d.method==='string'&&d.method.indexOf('ui/notifications/sandbox-')===0}addEventListener('message',function(e){var w=f&&f.contentWindow;if(!w||reserved(e.data))return;if(e.source===w){parent.postMessage(e.data,'*')}else if(e.source===parent){w.postMessage(e.data,'*')}})})()";
4479
- var buildMcpAppDocument = (html, csp) => {
4483
+ var schemeMeta = (scheme) => scheme ? `<meta name="color-scheme" content="${scheme}">` : "";
4484
+ var schemeCss = (scheme) => scheme ? `:root{color-scheme:${scheme}}` : "";
4485
+ var schemeOfFrame = (scheme) => scheme ? `;color-scheme:${scheme}` : "";
4486
+ var buildMcpAppDocument = (html, csp, scheme) => {
4480
4487
  const policy = mcpAppCsp(csp);
4481
- return `<!doctype html><html><head><meta http-equiv="Content-Security-Policy" content="${escapeAttribute(policy)}"><style>html,body{margin:0;height:100%;overflow:hidden;background:transparent}iframe{display:block;border:0;width:100%;height:100%}</style></head><body><iframe id="app" sandbox="allow-scripts" referrerpolicy="no-referrer" srcdoc="${escapeAttribute(withPolicyFirst(html, policy))}"></iframe><script>${MCP_APP_RELAY}</script></body></html>`;
4488
+ const s = mcpAppColorScheme(scheme);
4489
+ return `<!doctype html><html><head><meta http-equiv="Content-Security-Policy" content="${escapeAttribute(policy)}">` + schemeMeta(s) + `<style>${schemeCss(s)}html,body{margin:0;height:100%;overflow:hidden;background:transparent}iframe{display:block;border:0;width:100%;height:100%${schemeOfFrame(s)}}</style></head><body><iframe id="app" sandbox="allow-scripts" referrerpolicy="no-referrer" srcdoc="${escapeAttribute(withPolicyFirst(html, policy))}"></iframe><script>${MCP_APP_RELAY}</script></body></html>`;
4482
4490
  };
4483
4491
  var appLinkOf = (value) => {
4484
4492
  if (typeof value !== "string" || value.length > MCP_APP_MAX_URL_CHARS) return void 0;
@@ -5097,9 +5105,11 @@ var mcpAppSandboxShellCsp = (proxyUrl) => [
5097
5105
  "form-action 'none'",
5098
5106
  "base-uri 'none'"
5099
5107
  ].join("; ");
5100
- var buildMcpAppSandboxShell = (proxyUrl) => {
5108
+ var buildMcpAppSandboxShell = (proxyUrl, scheme) => {
5101
5109
  if (!PROXY_URL.test(proxyUrl)) throw new Error("not a sandbox proxy URL");
5102
- return "<!doctype html><html><head>" + cspMetaTag(mcpAppSandboxShellCsp(proxyUrl)) + `<style>html,body{margin:0;height:100%;overflow:hidden;background:transparent}iframe{display:block;border:0;width:100%;height:100%}</style></head><body><iframe id="proxy" sandbox="${MCP_APP_SANDBOX_FRAME_TOKENS}" referrerpolicy="no-referrer" src="${escapeAttribute(proxyUrl)}"></iframe></body></html>`;
5110
+ const s = mcpAppColorScheme(scheme);
5111
+ const src = s ? `${proxyUrl}?${MCP_APP_SCHEME_PARAM}=${s}` : proxyUrl;
5112
+ return "<!doctype html><html><head>" + cspMetaTag(mcpAppSandboxShellCsp(proxyUrl)) + schemeMeta(s) + `<style>${schemeCss(s)}html,body{margin:0;height:100%;overflow:hidden;background:transparent}iframe{display:block;border:0;width:100%;height:100%${schemeOfFrame(s)}}</style></head><body><iframe id="proxy" sandbox="${MCP_APP_SANDBOX_FRAME_TOKENS}" referrerpolicy="no-referrer" src="${escapeAttribute(src)}"></iframe></body></html>`;
5103
5113
  };
5104
5114
  var McpAppSandboxLink = class {
5105
5115
  o;
@@ -5610,10 +5620,14 @@ var McpAppFrame = ({
5610
5620
  if (!url) return { mode: "opaque", reason: "too-many-origins" };
5611
5621
  return { mode: "origin", origin: target.origin, url };
5612
5622
  }, [resource, sandboxUrl, fallback, app.server, reload]);
5613
- const doc = useMemo6(
5614
- () => !resource || !placement ? void 0 : placement.mode === "origin" ? buildMcpAppSandboxShell(placement.url) : buildMcpAppDocument(resource.html, resource.csp),
5615
- [resource, placement]
5616
- );
5623
+ const { doc, scheme } = useMemo6(() => {
5624
+ const scheme2 = themeRef.current === "dark" ? "dark" : "light";
5625
+ if (!resource || !placement) return { scheme: scheme2 };
5626
+ return {
5627
+ scheme: scheme2,
5628
+ doc: placement.mode === "origin" ? buildMcpAppSandboxShell(placement.url, scheme2) : buildMcpAppDocument(resource.html, resource.csp, scheme2)
5629
+ };
5630
+ }, [resource, placement]);
5617
5631
  useEffect11(() => {
5618
5632
  const reason = placement?.mode === "opaque" ? placement.reason : void 0;
5619
5633
  if (reason && reason !== "no-answer" && sandboxUrl !== void 0) {
@@ -5898,6 +5912,7 @@ var McpAppFrame = ({
5898
5912
  referrerPolicy: "no-referrer",
5899
5913
  srcDoc: doc,
5900
5914
  onLoad: () => shellLoaded.current?.(),
5915
+ "data-color-scheme": scheme,
5901
5916
  style: panel || fullscreen ? void 0 : { height }
5902
5917
  },
5903
5918
  `${reload}:origin`
@@ -5910,6 +5925,7 @@ var McpAppFrame = ({
5910
5925
  sandbox: "allow-scripts",
5911
5926
  referrerPolicy: "no-referrer",
5912
5927
  srcDoc: doc,
5928
+ "data-color-scheme": scheme,
5913
5929
  style: panel || fullscreen ? void 0 : { height }
5914
5930
  },
5915
5931
  `${reload}:opaque`
@@ -6216,6 +6232,15 @@ var readDataUrl2 = (file) => new Promise((resolve, reject) => {
6216
6232
  r.readAsDataURL(file);
6217
6233
  });
6218
6234
  var safeName = (name) => name.replace(/[^\w.-]+/g, "_").slice(0, 80) || "file";
6235
+ var DictationClock = () => {
6236
+ const [t0] = useState12(() => Date.now());
6237
+ const [now, setNow] = useState12(t0);
6238
+ useEffect12(() => {
6239
+ const id = setInterval(() => setNow(Date.now()), 500);
6240
+ return () => clearInterval(id);
6241
+ }, []);
6242
+ return /* @__PURE__ */ jsx5("span", { className: "awr-mic__time", "aria-hidden": "true", children: formatClock(now - t0) });
6243
+ };
6219
6244
  var AgentComposer = ({
6220
6245
  controller: agent,
6221
6246
  placeholder,
@@ -6312,6 +6337,7 @@ ${draftText}` : draftText);
6312
6337
  onFinal: (heard) => setText((t) => t.trim() ? `${t.trimEnd()} ${heard}` : heard)
6313
6338
  });
6314
6339
  const showMic = speech !== false && stt.supported;
6340
+ const micOn = stt.listening && !stt.finishing;
6315
6341
  const recorder = useAudioRecorder({
6316
6342
  maxMs: typeof voiceMessage === "object" ? voiceMessage.maxMs : void 0
6317
6343
  });
@@ -6954,19 +6980,22 @@ ${draftText}` : draftText);
6954
6980
  "aria-label": L.message
6955
6981
  }
6956
6982
  ),
6957
- showMic && /* @__PURE__ */ jsx5(
6958
- "button",
6959
- {
6960
- type: "button",
6961
- className: `awr-iconbtn awr-mic${stt.listening ? " is-on" : ""}${stt.finishing ? " is-busy" : ""}`,
6962
- "aria-label": stt.listening ? L.stopDictation : L.dictate,
6963
- "aria-pressed": stt.listening,
6964
- title: stt.listening ? L.stopDictation : L.dictateTitle,
6965
- onClick: stt.toggle,
6966
- disabled: disabled || recordingOn || stt.finishing,
6967
- children: stt.finishing ? /* @__PURE__ */ jsx5(SpinnerIcon, { size: 18 }) : /* @__PURE__ */ jsx5(MicIcon, { size: 18 })
6968
- }
6969
- )
6983
+ showMic && /* @__PURE__ */ jsxs3("span", { className: `awr-micbox${micOn ? " is-on" : ""}${stt.finishing ? " is-busy" : ""}`, children: [
6984
+ micOn && /* @__PURE__ */ jsx5(DictationClock, {}),
6985
+ /* @__PURE__ */ jsx5(
6986
+ "button",
6987
+ {
6988
+ type: "button",
6989
+ className: `awr-iconbtn awr-mic${micOn ? " is-on" : ""}${stt.finishing ? " is-busy" : ""}`,
6990
+ "aria-label": stt.finishing ? L.transcribing : micOn ? L.micListening : L.dictate,
6991
+ "aria-busy": stt.finishing || void 0,
6992
+ title: micOn ? L.stopDictation : stt.finishing ? L.transcribing : L.dictateTitle,
6993
+ onClick: stt.toggle,
6994
+ disabled: disabled || recordingOn || stt.finishing,
6995
+ children: stt.finishing ? /* @__PURE__ */ jsx5(SpinnerIcon, { size: 18 }) : micOn ? /* @__PURE__ */ jsx5(StopIcon, { size: 16 }) : /* @__PURE__ */ jsx5(MicIcon, { size: 18 })
6996
+ }
6997
+ )
6998
+ ] })
6970
6999
  ] }),
6971
7000
  stt.listening && stt.interim && /* @__PURE__ */ jsx5("div", { className: "awr-composer2__interim", children: stt.interim }),
6972
7001
  stt.finishing && /* @__PURE__ */ jsx5("div", { className: "awr-composer2__interim", role: "status", children: L.transcribing }),
@@ -7884,6 +7913,7 @@ var ImageViewerProvider = ({
7884
7913
  render,
7885
7914
  children
7886
7915
  }) => /* @__PURE__ */ jsx9(ImageViewerContext.Provider, { value: { enabled, render }, children });
7916
+ var useImageViewerOn = () => useContext3(ImageViewerContext).enabled;
7887
7917
  var imageExtensionOf = (src) => {
7888
7918
  const type = /^data:image\/([a-z0-9.+-]+)/i.exec(src)?.[1]?.toLowerCase();
7889
7919
  return !type ? "" : type === "jpeg" ? ".jpg" : type === "svg+xml" ? ".svg" : `.${type}`;
@@ -8094,7 +8124,7 @@ var FilesPanel = ({
8094
8124
  };
8095
8125
 
8096
8126
  // src/components/FileChips.tsx
8097
- import { Fragment as Fragment8, useEffect as useEffect17, useMemo as useMemo8, useState as useState17 } from "react";
8127
+ import { Fragment as Fragment8, useEffect as useEffect17, useMemo as useMemo9, useRef as useRef13, useState as useState17 } from "react";
8098
8128
 
8099
8129
  // src/file-kinds.ts
8100
8130
  import { MEDIA_IMAGE_TYPES, isTextMime } from "@dudko.dev/agent-web";
@@ -8114,6 +8144,122 @@ var fileKindOf = (path, mediaType) => {
8114
8144
  };
8115
8145
  var fileNameOf2 = (path) => path.split("/").filter(Boolean).pop() || "file";
8116
8146
 
8147
+ // src/named-files.ts
8148
+ var NAMED_FILES_MAX = 12;
8149
+ var NAMED_FILES_SCAN_MAX = 200;
8150
+ var NAMED_FILES_TEXT_MAX = 1e5;
8151
+ var PATH_MAX = 512;
8152
+ var workspacePathOf = (raw) => {
8153
+ if (raw.length < 2 || raw.length > PATH_MAX) return void 0;
8154
+ if (raw[0] !== "/" || raw[1] === "/") return void 0;
8155
+ if (/[\u0000-\u001f\u007f\\]/.test(raw)) return void 0;
8156
+ const segments = raw.slice(1).split("/");
8157
+ for (const s of segments) {
8158
+ if (!s || s === "." || s === ".." || s.trim() !== s) return void 0;
8159
+ }
8160
+ return raw;
8161
+ };
8162
+ var withoutFences = (text) => {
8163
+ const lines = text.split("\n");
8164
+ let fence;
8165
+ for (let i = 0; i < lines.length; i++) {
8166
+ const open = /^ {0,3}(`{3,}|~{3,})/.exec(lines[i]);
8167
+ if (!fence) {
8168
+ if (open && !(open[1][0] === "`" && lines[i].slice(open[0].length).includes("`"))) {
8169
+ fence = { char: open[1][0], size: open[1].length };
8170
+ lines[i] = " ".repeat(lines[i].length);
8171
+ }
8172
+ continue;
8173
+ }
8174
+ const close = /^ {0,3}(`{3,}|~{3,})\s*$/.exec(lines[i]);
8175
+ if (close && close[1][0] === fence.char && close[1].length >= fence.size) fence = void 0;
8176
+ lines[i] = " ".repeat(lines[i].length);
8177
+ }
8178
+ return lines.join("\n");
8179
+ };
8180
+ var decoded = (s) => {
8181
+ if (!s.includes("%")) return s;
8182
+ try {
8183
+ return decodeURIComponent(s);
8184
+ } catch {
8185
+ return s;
8186
+ }
8187
+ };
8188
+ var codeSpansOf = (text) => {
8189
+ const runs = [];
8190
+ for (let i = text.indexOf("`"); i >= 0; i = text.indexOf("`", i)) {
8191
+ let j = i + 1;
8192
+ while (j < text.length && text.charCodeAt(j) === 96) j++;
8193
+ runs.push({ at: i, size: j - i });
8194
+ i = j;
8195
+ }
8196
+ const next = new Array(runs.length);
8197
+ const later = /* @__PURE__ */ new Map();
8198
+ for (let k = runs.length - 1; k >= 0; k--) {
8199
+ next[k] = later.get(runs[k].size) ?? -1;
8200
+ later.set(runs[k].size, k);
8201
+ }
8202
+ const spans = [];
8203
+ for (let k = 0; k < runs.length; ) {
8204
+ const close = next[k];
8205
+ if (close < 0) {
8206
+ k++;
8207
+ continue;
8208
+ }
8209
+ const open = runs[k];
8210
+ const end = runs[close].at + runs[close].size;
8211
+ spans.push({ at: open.at, end, inner: text.slice(open.at + open.size, runs[close].at) });
8212
+ k = close + 1;
8213
+ }
8214
+ return spans;
8215
+ };
8216
+ var LINK = /!?\[[^[\]\n]*\]\(\s*(<[^<>\n]+>|[^\s()<>]+)(?:\s+(?:"[^"\n]*"|'[^'\n]*'|\([^()\n]*\)))?\s*\)/g;
8217
+ var pathsNamedIn = (text) => {
8218
+ if (!text) return [];
8219
+ const head = text.length > NAMED_FILES_TEXT_MAX ? text.slice(0, NAMED_FILES_TEXT_MAX) : text;
8220
+ if (!head.includes("/")) return [];
8221
+ const found = [];
8222
+ let masked = withoutFences(head);
8223
+ const spans = codeSpansOf(masked);
8224
+ const parts = [];
8225
+ let from = 0;
8226
+ for (const span of spans) {
8227
+ let inner = span.inner;
8228
+ if (inner.length > 2 && inner.startsWith(" ") && inner.endsWith(" ")) inner = inner.slice(1, -1);
8229
+ const path = workspacePathOf(inner);
8230
+ if (path) found.push({ at: span.at, path });
8231
+ parts.push(masked.slice(from, span.at), " ".repeat(span.end - span.at));
8232
+ from = span.end;
8233
+ }
8234
+ masked = parts.join("") + masked.slice(from);
8235
+ for (const m of masked.matchAll(LINK)) {
8236
+ const dest = m[1].startsWith("<") ? m[1].slice(1, -1) : m[1];
8237
+ const path = workspacePathOf(decoded(dest));
8238
+ if (path) found.push({ at: m.index, path });
8239
+ }
8240
+ found.sort((a, b) => a.at - b.at);
8241
+ const out = [];
8242
+ const seen = /* @__PURE__ */ new Set();
8243
+ for (const { path } of found) {
8244
+ if (seen.has(path)) continue;
8245
+ seen.add(path);
8246
+ out.push(path);
8247
+ if (out.length >= NAMED_FILES_SCAN_MAX) break;
8248
+ }
8249
+ return out;
8250
+ };
8251
+ var namedFilesOf = (named, exists, { exclude, max = NAMED_FILES_MAX } = {}) => {
8252
+ const skip = new Set(exclude ?? []);
8253
+ const out = [];
8254
+ for (const path of named) {
8255
+ if (out.length >= max) break;
8256
+ if (skip.has(path) || !exists(path)) continue;
8257
+ skip.add(path);
8258
+ out.push(path);
8259
+ }
8260
+ return out;
8261
+ };
8262
+
8117
8263
  // src/components/Media.tsx
8118
8264
  import { useEffect as useEffect16, useState as useState16 } from "react";
8119
8265
  import { MEDIA_AUDIO_TYPES, MEDIA_IMAGE_TYPES as MEDIA_IMAGE_TYPES2 } from "@dudko.dev/agent-web";
@@ -8256,8 +8402,30 @@ var SandboxedFrame = ({
8256
8402
  footer ? /* @__PURE__ */ jsx12("div", { className: "awr-frame__foot", children: footer }) : null
8257
8403
  ] });
8258
8404
 
8405
+ // src/components/WorkspaceListing.tsx
8406
+ import { createContext as createContext4, useContext as useContext4, useMemo as useMemo8 } from "react";
8407
+ import { jsx as jsx13 } from "react/jsx-runtime";
8408
+ var WorkspaceListingContext = createContext4(void 0);
8409
+ var WorkspaceListingProvider = ({
8410
+ files,
8411
+ children
8412
+ }) => {
8413
+ const live = useVirtualFiles(files);
8414
+ const value = useMemo8(
8415
+ () => files ? { vfs: files, listing: { files: live.files, loading: live.loading } } : void 0,
8416
+ [files, live.files, live.loading]
8417
+ );
8418
+ return /* @__PURE__ */ jsx13(WorkspaceListingContext.Provider, { value, children });
8419
+ };
8420
+ var useWorkspaceListing = (vfs) => {
8421
+ const shared = useContext4(WorkspaceListingContext);
8422
+ const fromShared = shared !== void 0 && vfs !== void 0 && shared.vfs === vfs;
8423
+ const own = useVirtualFiles(fromShared ? void 0 : vfs);
8424
+ return fromShared ? shared.listing : own;
8425
+ };
8426
+
8259
8427
  // src/components/FileChips.tsx
8260
- import { Fragment as Fragment9, jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
8428
+ import { Fragment as Fragment9, jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
8261
8429
  var FILE_PREVIEW_CHARS = 2e4;
8262
8430
  var textOf = (file) => file.encoding === "base64" ? new TextDecoder().decode(bytesOf(file.content, "base64")) : file.content;
8263
8431
  var KIND_ICON = {
@@ -8282,7 +8450,7 @@ var downloadFile = async (vfs, path) => {
8282
8450
  a.click();
8283
8451
  setTimeout(() => URL.revokeObjectURL(url), 1e3);
8284
8452
  };
8285
- var Seg = ({ value, options, onChange, label }) => /* @__PURE__ */ jsx13("div", { className: "awr-seg", role: "group", "aria-label": label, children: options.map((o) => /* @__PURE__ */ jsxs11(
8453
+ var Seg = ({ value, options, onChange, label }) => /* @__PURE__ */ jsx14("div", { className: "awr-seg", role: "group", "aria-label": label, children: options.map((o) => /* @__PURE__ */ jsxs11(
8286
8454
  "button",
8287
8455
  {
8288
8456
  type: "button",
@@ -8317,22 +8485,22 @@ var SourceView = ({
8317
8485
  const L = useLabels(labels);
8318
8486
  const cut = text.length > maxChars;
8319
8487
  const shown = cut ? text.slice(0, maxChars) : text;
8320
- const lines = useMemo8(
8488
+ const lines = useMemo9(
8321
8489
  () => linesOf(html ? tokenizeHtml(shown) : [{ kind: "text", text: shown }]),
8322
8490
  [shown, html]
8323
8491
  );
8324
8492
  return /* @__PURE__ */ jsxs11(Fragment9, { children: [
8325
- /* @__PURE__ */ jsx13("pre", { className: ["awr-source", className].filter(Boolean).join(" "), tabIndex: 0, children: lines.map((line, i) => /* @__PURE__ */ jsxs11("span", { className: "awr-source__line", children: [
8493
+ /* @__PURE__ */ jsx14("pre", { className: ["awr-source", className].filter(Boolean).join(" "), tabIndex: 0, children: lines.map((line, i) => /* @__PURE__ */ jsxs11("span", { className: "awr-source__line", children: [
8326
8494
  line.map(
8327
- (t, k) => t.kind === "text" ? /* @__PURE__ */ jsx13(Fragment8, { children: t.text }, k) : /* @__PURE__ */ jsx13("span", { className: `awr-source__${t.kind}`, children: t.text }, k)
8495
+ (t, k) => t.kind === "text" ? /* @__PURE__ */ jsx14(Fragment8, { children: t.text }, k) : /* @__PURE__ */ jsx14("span", { className: `awr-source__${t.kind}`, children: t.text }, k)
8328
8496
  ),
8329
8497
  "\n"
8330
8498
  ] }, i)) }),
8331
- cut && /* @__PURE__ */ jsx13("p", { className: "awr-fileview__cut", children: L.fileCut(maxChars) })
8499
+ cut && /* @__PURE__ */ jsx14("p", { className: "awr-fileview__cut", children: L.fileCut(maxChars) })
8332
8500
  ] });
8333
8501
  };
8334
8502
  var HtmlPreview = ({ written, file, htmlPreview, previewChars, L }) => {
8335
- const html = useMemo8(() => textOf(file), [file]);
8503
+ const html = useMemo9(() => textOf(file), [file]);
8336
8504
  const options = htmlPreview === false ? void 0 : htmlPreview;
8337
8505
  const tooLarge = html.length > HTML_PREVIEW_MAX_CHARS;
8338
8506
  const canFrame = Boolean(options) && !tooLarge;
@@ -8341,8 +8509,8 @@ var HtmlPreview = ({ written, file, htmlPreview, previewChars, L }) => {
8341
8509
  const showing = canFrame ? view : "source";
8342
8510
  const scripts = options?.scripts === true;
8343
8511
  const height = options?.height ?? 300;
8344
- const linked = useMemo8(() => showing === "preview" ? linkedFilesOf(html) : [], [html, showing]);
8345
- return /* @__PURE__ */ jsx13(
8512
+ const linked = useMemo9(() => showing === "preview" ? linkedFilesOf(html) : [], [html, showing]);
8513
+ return /* @__PURE__ */ jsx14(
8346
8514
  SandboxedFrame,
8347
8515
  {
8348
8516
  className: "awr-frame--html",
@@ -8351,34 +8519,34 @@ var HtmlPreview = ({ written, file, htmlPreview, previewChars, L }) => {
8351
8519
  scripts,
8352
8520
  height: tall ? height * 2 : height,
8353
8521
  label: /* @__PURE__ */ jsxs11(Fragment9, { children: [
8354
- /* @__PURE__ */ jsx13(CodeIcon, { size: 14, className: "awr-frame__icon" }),
8522
+ /* @__PURE__ */ jsx14(CodeIcon, { size: 14, className: "awr-frame__icon" }),
8355
8523
  /* @__PURE__ */ jsxs11("span", { className: "awr-frame__titles", children: [
8356
- /* @__PURE__ */ jsx13("span", { className: "awr-frame__title", children: L.htmlFrameTitle }),
8357
- /* @__PURE__ */ jsx13("span", { className: "awr-frame__badges", children: showing === "preview" ? /* @__PURE__ */ jsxs11(Fragment9, { children: [
8358
- /* @__PURE__ */ jsx13(LockIcon, { size: 11 }),
8524
+ /* @__PURE__ */ jsx14("span", { className: "awr-frame__title", children: L.htmlFrameTitle }),
8525
+ /* @__PURE__ */ jsx14("span", { className: "awr-frame__badges", children: showing === "preview" ? /* @__PURE__ */ jsxs11(Fragment9, { children: [
8526
+ /* @__PURE__ */ jsx14(LockIcon, { size: 11 }),
8359
8527
  " ",
8360
8528
  L.htmlSandboxed,
8361
8529
  " \xB7 ",
8362
- /* @__PURE__ */ jsx13(NoNetworkIcon, { size: 11 }),
8530
+ /* @__PURE__ */ jsx14(NoNetworkIcon, { size: 11 }),
8363
8531
  " ",
8364
8532
  L.htmlNoNetwork
8365
8533
  ] }) : L.htmlSourceNote })
8366
8534
  ] })
8367
8535
  ] }),
8368
8536
  actions: canFrame ? /* @__PURE__ */ jsxs11(Fragment9, { children: [
8369
- /* @__PURE__ */ jsx13(
8537
+ /* @__PURE__ */ jsx14(
8370
8538
  Seg,
8371
8539
  {
8372
8540
  label: L.htmlFrameTitle,
8373
8541
  value: showing,
8374
8542
  onChange: setView,
8375
8543
  options: [
8376
- { value: "preview", label: L.preview, icon: /* @__PURE__ */ jsx13(EyeIcon, { size: 13 }) },
8377
- { value: "source", label: L.fileSource, icon: /* @__PURE__ */ jsx13(CodeIcon, { size: 13 }) }
8544
+ { value: "preview", label: L.preview, icon: /* @__PURE__ */ jsx14(EyeIcon, { size: 13 }) },
8545
+ { value: "source", label: L.fileSource, icon: /* @__PURE__ */ jsx14(CodeIcon, { size: 13 }) }
8378
8546
  ]
8379
8547
  }
8380
8548
  ),
8381
- /* @__PURE__ */ jsx13(
8549
+ /* @__PURE__ */ jsx14(
8382
8550
  "button",
8383
8551
  {
8384
8552
  type: "button",
@@ -8388,13 +8556,13 @@ var HtmlPreview = ({ written, file, htmlPreview, previewChars, L }) => {
8388
8556
  "aria-pressed": tall,
8389
8557
  disabled: showing !== "preview",
8390
8558
  onClick: () => setTall((t) => !t),
8391
- children: /* @__PURE__ */ jsx13(ExpandIcon, { size: 15 })
8559
+ children: /* @__PURE__ */ jsx14(ExpandIcon, { size: 15 })
8392
8560
  }
8393
8561
  )
8394
8562
  ] }) : void 0,
8395
8563
  footer: /* @__PURE__ */ jsxs11(Fragment9, { children: [
8396
- /* @__PURE__ */ jsx13(FileIcon, { size: 11 }),
8397
- /* @__PURE__ */ jsx13("code", { children: written.path }),
8564
+ /* @__PURE__ */ jsx14(FileIcon, { size: 11 }),
8565
+ /* @__PURE__ */ jsx14("code", { children: written.path }),
8398
8566
  /* @__PURE__ */ jsxs11("span", { className: "awr-frame__footmeta", children: [
8399
8567
  "\xB7 ",
8400
8568
  L.bytes(file.size),
@@ -8405,8 +8573,8 @@ var HtmlPreview = ({ written, file, htmlPreview, previewChars, L }) => {
8405
8573
  ] })
8406
8574
  ] }),
8407
8575
  children: showing === "source" ? /* @__PURE__ */ jsxs11(Fragment9, { children: [
8408
- tooLarge && options ? /* @__PURE__ */ jsx13("p", { className: "awr-fileview__cut", children: L.htmlTooLarge }) : null,
8409
- /* @__PURE__ */ jsx13(SourceView, { text: html, html: true, maxChars: previewChars, className: "awr-frame__source" })
8576
+ tooLarge && options ? /* @__PURE__ */ jsx14("p", { className: "awr-fileview__cut", children: L.htmlTooLarge }) : null,
8577
+ /* @__PURE__ */ jsx14(SourceView, { text: html, html: true, maxChars: previewChars, className: "awr-frame__source" })
8410
8578
  ] }) : void 0
8411
8579
  }
8412
8580
  );
@@ -8414,8 +8582,8 @@ var HtmlPreview = ({ written, file, htmlPreview, previewChars, L }) => {
8414
8582
  var ImagePreview = ({ written, vfs, onClose, L }) => {
8415
8583
  const url = useFileUrl(vfs, written.path, written.mediaType.toLowerCase().split(";")[0].trim());
8416
8584
  return /* @__PURE__ */ jsxs11("div", { className: "awr-fileview", children: [
8417
- /* @__PURE__ */ jsx13(FileViewHead, { written, kind: "image", onClose, L }),
8418
- /* @__PURE__ */ jsx13("div", { className: "awr-fileview__image", children: url ? /* @__PURE__ */ jsx13("img", { src: url, alt: fileNameOf2(written.path) }) : null })
8585
+ /* @__PURE__ */ jsx14(FileViewHead, { written, kind: "image", onClose, L }),
8586
+ /* @__PURE__ */ jsx14("div", { className: "awr-fileview__image", children: url ? /* @__PURE__ */ jsx14("img", { src: url, alt: fileNameOf2(written.path) }) : null })
8419
8587
  ] });
8420
8588
  };
8421
8589
  var FileViewHead = ({
@@ -8425,14 +8593,14 @@ var FileViewHead = ({
8425
8593
  L,
8426
8594
  children
8427
8595
  }) => /* @__PURE__ */ jsxs11("div", { className: "awr-fileview__head", children: [
8428
- /* @__PURE__ */ jsx13("span", { className: "awr-fileview__name", title: written.path, children: fileNameOf2(written.path) }),
8596
+ /* @__PURE__ */ jsx14("span", { className: "awr-fileview__name", title: written.path, children: fileNameOf2(written.path) }),
8429
8597
  /* @__PURE__ */ jsxs11("span", { className: "awr-fileview__kind", children: [
8430
8598
  "\xB7 ",
8431
8599
  L.fileKinds[kind]
8432
8600
  ] }),
8433
8601
  /* @__PURE__ */ jsxs11("span", { className: "awr-fileview__actions", children: [
8434
8602
  children,
8435
- /* @__PURE__ */ jsx13(
8603
+ /* @__PURE__ */ jsx14(
8436
8604
  "button",
8437
8605
  {
8438
8606
  type: "button",
@@ -8440,7 +8608,7 @@ var FileViewHead = ({
8440
8608
  "aria-label": L.closePreview,
8441
8609
  title: L.closePreview,
8442
8610
  onClick: onClose,
8443
- children: /* @__PURE__ */ jsx13(XIcon, { size: 14 })
8611
+ children: /* @__PURE__ */ jsx14(XIcon, { size: 14 })
8444
8612
  }
8445
8613
  )
8446
8614
  ] })
@@ -8454,8 +8622,8 @@ var TextPreview = ({
8454
8622
  onClose,
8455
8623
  L
8456
8624
  }) => {
8457
- const text = useMemo8(() => textOf(file), [file]);
8458
- const rendered = useMemo8(
8625
+ const text = useMemo9(() => textOf(file), [file]);
8626
+ const rendered = useMemo9(
8459
8627
  () => renderFileContent?.(written, text.slice(0, previewChars)),
8460
8628
  [renderFileContent, written, text, previewChars]
8461
8629
  );
@@ -8465,7 +8633,7 @@ var TextPreview = ({
8465
8633
  const showing = hasRendered ? view : "source";
8466
8634
  const long = text.length > 1200 || text.split("\n").length > 16;
8467
8635
  return /* @__PURE__ */ jsxs11("div", { className: "awr-fileview", children: [
8468
- /* @__PURE__ */ jsx13(FileViewHead, { written, kind, onClose, L, children: hasRendered && /* @__PURE__ */ jsx13(
8636
+ /* @__PURE__ */ jsx14(FileViewHead, { written, kind, onClose, L, children: hasRendered && /* @__PURE__ */ jsx14(
8469
8637
  Seg,
8470
8638
  {
8471
8639
  label: fileNameOf2(written.path),
@@ -8477,21 +8645,23 @@ var TextPreview = ({
8477
8645
  ]
8478
8646
  }
8479
8647
  ) }),
8480
- /* @__PURE__ */ jsx13("div", { className: `awr-fileview__body${long && !all ? " is-folded" : ""}`, children: showing === "rendered" ? /* @__PURE__ */ jsxs11(Fragment9, { children: [
8481
- /* @__PURE__ */ jsx13("div", { className: "awr-fileview__rendered", children: rendered }),
8482
- text.length > previewChars && /* @__PURE__ */ jsx13("p", { className: "awr-fileview__cut", children: L.fileCut(previewChars) })
8483
- ] }) : /* @__PURE__ */ jsx13(SourceView, { text, maxChars: previewChars }) }),
8484
- long && /* @__PURE__ */ jsx13("div", { className: "awr-fileview__more", children: /* @__PURE__ */ jsx13("button", { type: "button", className: "awr-linkbtn", onClick: () => setAll((a) => !a), children: all ? L.fileShowLess : L.fileShowRest }) })
8648
+ /* @__PURE__ */ jsx14("div", { className: `awr-fileview__body${long && !all ? " is-folded" : ""}`, children: showing === "rendered" ? /* @__PURE__ */ jsxs11(Fragment9, { children: [
8649
+ /* @__PURE__ */ jsx14("div", { className: "awr-fileview__rendered", children: rendered }),
8650
+ text.length > previewChars && /* @__PURE__ */ jsx14("p", { className: "awr-fileview__cut", children: L.fileCut(previewChars) })
8651
+ ] }) : /* @__PURE__ */ jsx14(SourceView, { text, maxChars: previewChars }) }),
8652
+ long && /* @__PURE__ */ jsx14("div", { className: "awr-fileview__more", children: /* @__PURE__ */ jsx14("button", { type: "button", className: "awr-linkbtn", onClick: () => setAll((a) => !a), children: all ? L.fileShowLess : L.fileShowRest }) })
8485
8653
  ] });
8486
8654
  };
8487
8655
  var NoPreview = ({ written, kind, onClose, L }) => /* @__PURE__ */ jsxs11("div", { className: "awr-fileview", children: [
8488
- /* @__PURE__ */ jsx13(FileViewHead, { written, kind, onClose, L }),
8489
- /* @__PURE__ */ jsx13("p", { className: "awr-fileview__none", children: L.fileNoPreview })
8656
+ /* @__PURE__ */ jsx14(FileViewHead, { written, kind, onClose, L }),
8657
+ /* @__PURE__ */ jsx14("p", { className: "awr-fileview__none", children: L.fileNoPreview })
8490
8658
  ] });
8491
8659
  var FileChips = ({
8492
8660
  written,
8493
8661
  files: vfs,
8494
8662
  showHeader = true,
8663
+ heading,
8664
+ imagesInViewer = false,
8495
8665
  onShowFiles,
8496
8666
  htmlPreview = {},
8497
8667
  renderFile,
@@ -8502,7 +8672,7 @@ var FileChips = ({
8502
8672
  className
8503
8673
  }) => {
8504
8674
  const L = useLabels(labels);
8505
- const live = useVirtualFiles(vfs);
8675
+ const live = useWorkspaceListing(vfs);
8506
8676
  const [openPath, setOpenPath] = useState17(defaultOpen);
8507
8677
  const [file, setFile] = useState17();
8508
8678
  const open = written.find((f) => f.path === openPath);
@@ -8534,23 +8704,23 @@ var FileChips = ({
8534
8704
  onClose: () => setOpenPath(void 0),
8535
8705
  L
8536
8706
  };
8537
- if (kind === "html") return /* @__PURE__ */ jsx13(HtmlPreview, { ...props }, open.path);
8538
- if (kind === "image") return /* @__PURE__ */ jsx13(ImagePreview, { ...props }, open.path);
8539
- if (kind === "file") return /* @__PURE__ */ jsx13(NoPreview, { ...props }, open.path);
8540
- return /* @__PURE__ */ jsx13(TextPreview, { ...props }, open.path);
8707
+ if (kind === "html") return /* @__PURE__ */ jsx14(HtmlPreview, { ...props }, open.path);
8708
+ if (kind === "image") return /* @__PURE__ */ jsx14(ImagePreview, { ...props }, open.path);
8709
+ if (kind === "file") return /* @__PURE__ */ jsx14(NoPreview, { ...props }, open.path);
8710
+ return /* @__PURE__ */ jsx14(TextPreview, { ...props }, open.path);
8541
8711
  };
8542
8712
  return /* @__PURE__ */ jsxs11("div", { className: ["awr-msg__files", className].filter(Boolean).join(" "), children: [
8543
8713
  showHeader && /* @__PURE__ */ jsxs11("div", { className: "awr-msg__fileshead", children: [
8544
- /* @__PURE__ */ jsx13(FileIcon, { size: 13 }),
8545
- /* @__PURE__ */ jsx13("span", { children: L.filesWritten(written.length) }),
8546
- onShowFiles && /* @__PURE__ */ jsx13("button", { type: "button", className: "awr-linkbtn", onClick: onShowFiles, children: L.showInFiles })
8714
+ /* @__PURE__ */ jsx14(FileIcon, { size: 13 }),
8715
+ /* @__PURE__ */ jsx14("span", { children: heading ?? L.filesWritten(written.length) }),
8716
+ onShowFiles && /* @__PURE__ */ jsx14("button", { type: "button", className: "awr-linkbtn", onClick: onShowFiles, children: L.showInFiles })
8547
8717
  ] }),
8548
- /* @__PURE__ */ jsx13("ul", { className: "awr-filechips", children: written.map((w) => {
8718
+ /* @__PURE__ */ jsx14("ul", { className: "awr-filechips", children: written.map((w) => {
8549
8719
  const info = live.files.find((f) => f.path === w.path);
8550
8720
  const gone = Boolean(vfs) && !live.loading && !info;
8551
8721
  const usable = Boolean(vfs) && !gone;
8552
8722
  const isOpen = openPath === w.path && usable;
8553
- const chip = /* @__PURE__ */ jsx13(
8723
+ const chip = /* @__PURE__ */ jsx14(
8554
8724
  FileChip,
8555
8725
  {
8556
8726
  written: w,
@@ -8560,10 +8730,11 @@ var FileChips = ({
8560
8730
  gone,
8561
8731
  open: isOpen,
8562
8732
  onToggle: () => setOpenPath(isOpen ? void 0 : w.path),
8733
+ viewer: imagesInViewer,
8563
8734
  labels
8564
8735
  }
8565
8736
  );
8566
- return /* @__PURE__ */ jsx13("li", { className: "awr-filechips__item", children: renderFile ? renderFile(w, chip) : chip }, w.path);
8737
+ return /* @__PURE__ */ jsx14("li", { className: "awr-filechips__item", children: renderFile ? renderFile(w, chip) : chip }, w.path);
8567
8738
  }) }),
8568
8739
  preview()
8569
8740
  ] });
@@ -8576,9 +8747,12 @@ var FileChip = ({
8576
8747
  gone = false,
8577
8748
  open = false,
8578
8749
  onToggle,
8750
+ viewer = false,
8579
8751
  labels
8580
8752
  }) => {
8581
8753
  const L = useLabels(labels);
8754
+ const viewerOn = useImageViewerOn();
8755
+ const thumbRef = useRef13(null);
8582
8756
  const kind = fileKindOf(written.path, mediaType);
8583
8757
  const name = fileNameOf2(written.path);
8584
8758
  const Icon = KIND_ICON[kind];
@@ -8588,19 +8762,40 @@ var FileChip = ({
8588
8762
  kind === "image" ? mediaType.toLowerCase().split(";")[0].trim() : void 0
8589
8763
  );
8590
8764
  const meta = gone ? L.fileGone : [L.fileKinds[kind], L.bytes(bytes), written.by ? L.fileBy(written.by.name) : ""].filter(Boolean).join(" \xB7 ");
8765
+ const inViewer = viewer && viewerOn && kind === "image" && Boolean(thumb) && !gone;
8591
8766
  return /* @__PURE__ */ jsxs11(
8592
8767
  "div",
8593
8768
  {
8594
8769
  className: `awr-filechip${open ? " is-open" : ""}${gone ? " is-gone" : ""}`,
8595
8770
  title: written.path,
8596
8771
  children: [
8597
- /* @__PURE__ */ jsx13("span", { className: "awr-filechip__thumb", children: thumb ? /* @__PURE__ */ jsx13("img", { src: thumb, alt: "" }) : /* @__PURE__ */ jsx13(Icon, { size: 16 }) }),
8772
+ /* @__PURE__ */ jsx14("span", { ref: thumbRef, className: "awr-filechip__thumb", children: inViewer && thumb ? /* @__PURE__ */ jsx14(
8773
+ ImageThumb,
8774
+ {
8775
+ src: thumb,
8776
+ name: written.path,
8777
+ alt: name,
8778
+ className: "awr-filechip__imgbtn",
8779
+ labels
8780
+ }
8781
+ ) : thumb ? /* @__PURE__ */ jsx14("img", { src: thumb, alt: "" }) : /* @__PURE__ */ jsx14(Icon, { size: 16 }) }),
8598
8782
  /* @__PURE__ */ jsxs11("span", { className: "awr-filechip__text", children: [
8599
- /* @__PURE__ */ jsx13("span", { className: "awr-filechip__name", children: name }),
8600
- /* @__PURE__ */ jsx13("span", { className: "awr-filechip__meta", children: meta })
8783
+ /* @__PURE__ */ jsx14("span", { className: "awr-filechip__name", children: name }),
8784
+ /* @__PURE__ */ jsx14("span", { className: "awr-filechip__meta", children: meta })
8601
8785
  ] }),
8602
8786
  vfs && /* @__PURE__ */ jsxs11("span", { className: "awr-filechip__actions", children: [
8603
- onToggle && /* @__PURE__ */ jsx13(
8787
+ inViewer ? /* @__PURE__ */ jsx14(
8788
+ "button",
8789
+ {
8790
+ type: "button",
8791
+ className: "awr-iconbtn",
8792
+ "aria-label": L.imageOpen(name),
8793
+ "aria-haspopup": "dialog",
8794
+ title: L.preview,
8795
+ onClick: () => thumbRef.current?.querySelector("button")?.click(),
8796
+ children: /* @__PURE__ */ jsx14(EyeIcon, { size: 15 })
8797
+ }
8798
+ ) : onToggle && /* @__PURE__ */ jsx14(
8604
8799
  "button",
8605
8800
  {
8606
8801
  type: "button",
@@ -8609,10 +8804,10 @@ var FileChip = ({
8609
8804
  title: open ? L.closePreview : L.preview,
8610
8805
  "aria-expanded": open,
8611
8806
  onClick: onToggle,
8612
- children: open ? /* @__PURE__ */ jsx13(ChevronUpIcon, { size: 15 }) : /* @__PURE__ */ jsx13(EyeIcon, { size: 15 })
8807
+ children: open ? /* @__PURE__ */ jsx14(ChevronUpIcon, { size: 15 }) : /* @__PURE__ */ jsx14(EyeIcon, { size: 15 })
8613
8808
  }
8614
8809
  ),
8615
- /* @__PURE__ */ jsx13(
8810
+ /* @__PURE__ */ jsx14(
8616
8811
  "button",
8617
8812
  {
8618
8813
  type: "button",
@@ -8620,7 +8815,7 @@ var FileChip = ({
8620
8815
  "aria-label": L.fileDownload(name),
8621
8816
  title: L.download,
8622
8817
  onClick: () => void downloadFile(vfs, written.path),
8623
- children: /* @__PURE__ */ jsx13(DownloadIcon, { size: 15 })
8818
+ children: /* @__PURE__ */ jsx14(DownloadIcon, { size: 15 })
8624
8819
  }
8625
8820
  )
8626
8821
  ] })
@@ -8628,13 +8823,66 @@ var FileChip = ({
8628
8823
  }
8629
8824
  );
8630
8825
  };
8826
+ var NamedFileChips = (props) => {
8827
+ const named = useMemo9(() => pathsNamedIn(props.text), [props.text]);
8828
+ if (!props.files || named.length === 0) return null;
8829
+ return /* @__PURE__ */ jsx14(NamedFileChipsOf, { ...props, named, files: props.files });
8830
+ };
8831
+ var NamedFileChipsOf = ({
8832
+ named,
8833
+ files: vfs,
8834
+ exclude,
8835
+ max = NAMED_FILES_MAX,
8836
+ showHeader = true,
8837
+ htmlPreview,
8838
+ renderFile,
8839
+ renderFileContent,
8840
+ labels,
8841
+ className
8842
+ }) => {
8843
+ const L = useLabels(labels);
8844
+ const live = useWorkspaceListing(vfs);
8845
+ const shown = useRef13(/* @__PURE__ */ new Map());
8846
+ const excludedKey = [...exclude ?? []].join("\n");
8847
+ const excluded = useMemo9(() => excludedKey ? excludedKey.split("\n") : [], [excludedKey]);
8848
+ const list = useMemo9(() => {
8849
+ if (live.loading) return [];
8850
+ const byPath = new Map(live.files.map((f) => [f.path, f]));
8851
+ const paths = namedFilesOf(named, (p) => byPath.has(p) || shown.current.has(p), {
8852
+ exclude: excluded,
8853
+ max
8854
+ });
8855
+ return paths.map((path) => {
8856
+ const info = byPath.get(path);
8857
+ const view = info ? { path, mediaType: info.mimeType, bytes: info.size, writes: 0 } : shown.current.get(path);
8858
+ shown.current.set(path, view);
8859
+ return view;
8860
+ });
8861
+ }, [live.loading, live.files, named, excluded, max]);
8862
+ if (list.length === 0) return null;
8863
+ return /* @__PURE__ */ jsx14(
8864
+ FileChips,
8865
+ {
8866
+ className: ["awr-msg__files--named", className].filter(Boolean).join(" "),
8867
+ written: list,
8868
+ files: vfs,
8869
+ showHeader,
8870
+ heading: L.filesNamed(list.length),
8871
+ imagesInViewer: true,
8872
+ htmlPreview,
8873
+ renderFile,
8874
+ renderFileContent,
8875
+ labels
8876
+ }
8877
+ );
8878
+ };
8631
8879
 
8632
8880
  // src/components/StepList.tsx
8633
8881
  import { Fragment as Fragment11 } from "react";
8634
8882
 
8635
8883
  // src/components/SubagentTree.tsx
8636
8884
  import { Fragment as Fragment10, useEffect as useEffect18, useState as useState18 } from "react";
8637
- import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
8885
+ import { jsx as jsx15, jsxs as jsxs12 } from "react/jsx-runtime";
8638
8886
  var useElapsed = (startedAt, running) => {
8639
8887
  const [now, setNow] = useState18(void 0);
8640
8888
  useEffect18(() => {
@@ -8672,12 +8920,12 @@ var SubagentRow = ({
8672
8920
  "data-depth": sub.depth,
8673
8921
  children: [
8674
8922
  /* @__PURE__ */ jsxs12("div", { className: "awr-subagent__head", children: [
8675
- /* @__PURE__ */ jsx14("span", { className: "awr-subagent__icon", children: running ? /* @__PURE__ */ jsx14(SpinnerIcon, { size: 13 }) : sub.status === "done" ? /* @__PURE__ */ jsx14(BotIcon, { size: 13 }) : sub.status === "stopped" ? /* @__PURE__ */ jsx14(StopIcon, { size: 13 }) : /* @__PURE__ */ jsx14(AlertIcon, { size: 13 }) }),
8676
- /* @__PURE__ */ jsx14("span", { className: "awr-subagent__name", title: sub.role, children: role || (sub.dynamic ? L.subagentHelper : sub.name) }),
8677
- sub.dynamic && role && /* @__PURE__ */ jsx14("span", { className: "awr-subagent__profile", children: L.subagentHelper }),
8678
- sub.profile && /* @__PURE__ */ jsx14("span", { className: "awr-subagent__profile", children: sub.profile }),
8679
- /* @__PURE__ */ jsx14("span", { className: "awr-subagent__task", title: sub.task, children: previewValue(sub.task, 90) }),
8680
- running && onStop && /* @__PURE__ */ jsx14(
8923
+ /* @__PURE__ */ jsx15("span", { className: "awr-subagent__icon", children: running ? /* @__PURE__ */ jsx15(SpinnerIcon, { size: 13 }) : sub.status === "done" ? /* @__PURE__ */ jsx15(BotIcon, { size: 13 }) : sub.status === "stopped" ? /* @__PURE__ */ jsx15(StopIcon, { size: 13 }) : /* @__PURE__ */ jsx15(AlertIcon, { size: 13 }) }),
8924
+ /* @__PURE__ */ jsx15("span", { className: "awr-subagent__name", title: sub.role, children: role || (sub.dynamic ? L.subagentHelper : sub.name) }),
8925
+ sub.dynamic && role && /* @__PURE__ */ jsx15("span", { className: "awr-subagent__profile", children: L.subagentHelper }),
8926
+ sub.profile && /* @__PURE__ */ jsx15("span", { className: "awr-subagent__profile", children: sub.profile }),
8927
+ /* @__PURE__ */ jsx15("span", { className: "awr-subagent__task", title: sub.task, children: previewValue(sub.task, 90) }),
8928
+ running && onStop && /* @__PURE__ */ jsx15(
8681
8929
  "button",
8682
8930
  {
8683
8931
  type: "button",
@@ -8685,16 +8933,16 @@ var SubagentRow = ({
8685
8933
  "aria-label": L.stopSubagent,
8686
8934
  title: L.stopSubagent,
8687
8935
  onClick: () => onStop(sub.id),
8688
- children: /* @__PURE__ */ jsx14(StopIcon, { size: 12 })
8936
+ children: /* @__PURE__ */ jsx15(StopIcon, { size: 12 })
8689
8937
  }
8690
8938
  )
8691
8939
  ] }),
8692
8940
  showUsage && /* @__PURE__ */ jsxs12("div", { className: "awr-subagent__meta", children: [
8693
- /* @__PURE__ */ jsx14("span", { className: "awr-subagent__status", children: L.subagentStatus[sub.status] }),
8694
- meta.map((part, i) => /* @__PURE__ */ jsx14("span", { className: "awr-subagent__metaitem", children: part }, i))
8941
+ /* @__PURE__ */ jsx15("span", { className: "awr-subagent__status", children: L.subagentStatus[sub.status] }),
8942
+ meta.map((part, i) => /* @__PURE__ */ jsx15("span", { className: "awr-subagent__metaitem", children: part }, i))
8695
8943
  ] }),
8696
- showTools && sub.tools && /* @__PURE__ */ jsx14("div", { className: "awr-subagent__tools", children: sub.tools.length > 0 ? L.subagentTools(sub.tools.join(", ")) : L.subagentNoTools }),
8697
- /* @__PURE__ */ jsx14("div", { className: "awr-subagent__activity", children: sub.status === "error" ? sub.error : sub.status === "stopped" ? L.subagentStopped : sub.status === "done" ? previewValue(sub.text, 160) : `${sub.activity}${!showUsage && sub.toolCalls ? ` \xB7 ${L.toolCalls(sub.toolCalls)}` : ""}` }),
8944
+ showTools && sub.tools && /* @__PURE__ */ jsx15("div", { className: "awr-subagent__tools", children: sub.tools.length > 0 ? L.subagentTools(sub.tools.join(", ")) : L.subagentNoTools }),
8945
+ /* @__PURE__ */ jsx15("div", { className: "awr-subagent__activity", children: sub.status === "error" ? sub.error : sub.status === "stopped" ? L.subagentStopped : sub.status === "done" ? previewValue(sub.text, 160) : `${sub.activity}${!showUsage && sub.toolCalls ? ` \xB7 ${L.toolCalls(sub.toolCalls)}` : ""}` }),
8698
8946
  children
8699
8947
  ]
8700
8948
  }
@@ -8710,12 +8958,12 @@ var SubagentTree = ({
8710
8958
  className
8711
8959
  }) => {
8712
8960
  if (subagents.length === 0) return null;
8713
- const branch = (nodes, nested) => /* @__PURE__ */ jsx14(
8961
+ const branch = (nodes, nested) => /* @__PURE__ */ jsx15(
8714
8962
  "ul",
8715
8963
  {
8716
8964
  className: ["awr-subagents", nested ? "awr-subagents--nested" : className].filter(Boolean).join(" "),
8717
8965
  children: nodes.map((node) => {
8718
- const row = /* @__PURE__ */ jsx14(
8966
+ const row = /* @__PURE__ */ jsx15(
8719
8967
  SubagentRow,
8720
8968
  {
8721
8969
  sub: node,
@@ -8727,7 +8975,7 @@ var SubagentTree = ({
8727
8975
  },
8728
8976
  node.id
8729
8977
  );
8730
- return renderSubagent ? /* @__PURE__ */ jsx14(Fragment10, { children: renderSubagent(node, row) }, node.id) : row;
8978
+ return renderSubagent ? /* @__PURE__ */ jsx15(Fragment10, { children: renderSubagent(node, row) }, node.id) : row;
8731
8979
  })
8732
8980
  }
8733
8981
  );
@@ -8735,7 +8983,7 @@ var SubagentTree = ({
8735
8983
  };
8736
8984
 
8737
8985
  // src/components/StepList.tsx
8738
- import { jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
8986
+ import { jsx as jsx16, jsxs as jsxs13 } from "react/jsx-runtime";
8739
8987
  var WEB_SEARCH = "web_search";
8740
8988
  var ToolCallRow = ({
8741
8989
  call,
@@ -8759,21 +9007,21 @@ var ToolCallRow = ({
8759
9007
  className: `awr-tool awr-tool--${state}${showTiers && call.attempt !== void 0 ? " awr-tool--earlier" : ""}`,
8760
9008
  children: [
8761
9009
  /* @__PURE__ */ jsxs13("div", { className: "awr-tool__row", children: [
8762
- /* @__PURE__ */ jsx15(ToolIcon, { size: 13, className: "awr-tool__icon" }),
8763
- /* @__PURE__ */ jsx15("code", { className: "awr-tool__name", children: call.name }),
8764
- previewValue(call.input) && /* @__PURE__ */ jsx15("span", { className: "awr-tool__args", children: previewValue(call.input) }),
8765
- call.status === "calling" && /* @__PURE__ */ jsx15(SpinnerIcon, { size: 12, className: "awr-tool__spin" }),
8766
- call.status === "done" && call.ok === false && /* @__PURE__ */ jsx15("span", { className: "awr-tool__badge", children: L.failed }),
8767
- showTiers && call.replayed && /* @__PURE__ */ jsx15("span", { className: "awr-tool__tag", title: L.replayedTitle, children: L.replayed }),
8768
- showTiers && call.attempt !== void 0 && /* @__PURE__ */ jsx15("span", { className: "awr-tool__tag", children: L.attemptTag(call.attempt) }),
9010
+ /* @__PURE__ */ jsx16(ToolIcon, { size: 13, className: "awr-tool__icon" }),
9011
+ /* @__PURE__ */ jsx16("code", { className: "awr-tool__name", children: call.name }),
9012
+ previewValue(call.input) && /* @__PURE__ */ jsx16("span", { className: "awr-tool__args", children: previewValue(call.input) }),
9013
+ call.status === "calling" && /* @__PURE__ */ jsx16(SpinnerIcon, { size: 12, className: "awr-tool__spin" }),
9014
+ call.status === "done" && call.ok === false && /* @__PURE__ */ jsx16("span", { className: "awr-tool__badge", children: L.failed }),
9015
+ showTiers && call.replayed && /* @__PURE__ */ jsx16("span", { className: "awr-tool__tag", title: L.replayedTitle, children: L.replayed }),
9016
+ showTiers && call.attempt !== void 0 && /* @__PURE__ */ jsx16("span", { className: "awr-tool__tag", children: L.attemptTag(call.attempt) }),
8769
9017
  call.app && /* @__PURE__ */ jsxs13("span", { className: "awr-tool__tag awr-tool__tag--app", "data-app": call.app, children: [
8770
- /* @__PURE__ */ jsx15(AppIcon, { size: 10 }),
9018
+ /* @__PURE__ */ jsx16(AppIcon, { size: 10 }),
8771
9019
  " ",
8772
9020
  L.appTag
8773
9021
  ] }),
8774
- showUsage && cost && /* @__PURE__ */ jsx15("span", { className: "awr-tool__cost", title: L.toolCostTitle, children: cost })
9022
+ showUsage && cost && /* @__PURE__ */ jsx16("span", { className: "awr-tool__cost", title: L.toolCostTitle, children: cost })
8775
9023
  ] }),
8776
- images.length > 0 && /* @__PURE__ */ jsx15("div", { className: "awr-tool__images", children: images.map((src, i) => /* @__PURE__ */ jsx15(
9024
+ images.length > 0 && /* @__PURE__ */ jsx16("div", { className: "awr-tool__images", children: images.map((src, i) => /* @__PURE__ */ jsx16(
8777
9025
  ImageThumb,
8778
9026
  {
8779
9027
  src,
@@ -8786,14 +9034,14 @@ var ToolCallRow = ({
8786
9034
  )) }),
8787
9035
  search && /* @__PURE__ */ jsxs13("div", { className: "awr-search", children: [
8788
9036
  /* @__PURE__ */ jsxs13("p", { className: "awr-search__query", children: [
8789
- /* @__PURE__ */ jsx15(GlobeIcon, { size: 12 }),
9037
+ /* @__PURE__ */ jsx16(GlobeIcon, { size: 12 }),
8790
9038
  " ",
8791
9039
  L.searchQuery,
8792
9040
  " ",
8793
- /* @__PURE__ */ jsx15("q", { children: search.query })
9041
+ /* @__PURE__ */ jsx16("q", { children: search.query })
8794
9042
  ] }),
8795
- search.results.length > 0 ? /* @__PURE__ */ jsx15("ol", { className: "awr-search__results", children: search.results.map((r, i) => /* @__PURE__ */ jsxs13("li", { className: "awr-search__result", children: [
8796
- /* @__PURE__ */ jsx15(
9043
+ search.results.length > 0 ? /* @__PURE__ */ jsx16("ol", { className: "awr-search__results", children: search.results.map((r, i) => /* @__PURE__ */ jsxs13("li", { className: "awr-search__result", children: [
9044
+ /* @__PURE__ */ jsx16(
8797
9045
  "a",
8798
9046
  {
8799
9047
  className: "awr-search__title",
@@ -8808,9 +9056,9 @@ var ToolCallRow = ({
8808
9056
  r.host,
8809
9057
  r.date ? ` \xB7 ${r.date}` : ""
8810
9058
  ] }),
8811
- r.snippet && /* @__PURE__ */ jsx15("p", { className: "awr-search__snippet", children: r.snippet })
8812
- ] }, i)) }) : /* @__PURE__ */ jsx15("p", { className: "awr-search__note", children: L.searchNoResults }),
8813
- (search.filtered > 0 || search.truncated) && /* @__PURE__ */ jsx15("p", { className: "awr-search__note", children: [
9059
+ r.snippet && /* @__PURE__ */ jsx16("p", { className: "awr-search__snippet", children: r.snippet })
9060
+ ] }, i)) }) : /* @__PURE__ */ jsx16("p", { className: "awr-search__note", children: L.searchNoResults }),
9061
+ (search.filtered > 0 || search.truncated) && /* @__PURE__ */ jsx16("p", { className: "awr-search__note", children: [
8814
9062
  search.filtered > 0 ? L.searchFiltered(search.filtered) : "",
8815
9063
  search.truncated ? L.searchTruncated : ""
8816
9064
  ].filter(Boolean).join(" \xB7 ") })
@@ -8825,10 +9073,10 @@ var UserNoteRow = ({
8825
9073
  }) => {
8826
9074
  const L = useLabels(labels);
8827
9075
  return /* @__PURE__ */ jsxs13("li", { className: `awr-note awr-note--${note.at}`, children: [
8828
- /* @__PURE__ */ jsx15(SendIcon, { size: 12, className: "awr-note__icon" }),
8829
- /* @__PURE__ */ jsx15("span", { className: "awr-note__where", children: L.noteAt[note.at] }),
8830
- /* @__PURE__ */ jsx15("q", { className: "awr-note__text", children: note.text }),
8831
- note.origin === "another-tab" && /* @__PURE__ */ jsx15("span", { className: "awr-note__origin", children: L.fromAnotherTab })
9076
+ /* @__PURE__ */ jsx16(SendIcon, { size: 12, className: "awr-note__icon" }),
9077
+ /* @__PURE__ */ jsx16("span", { className: "awr-note__where", children: L.noteAt[note.at] }),
9078
+ /* @__PURE__ */ jsx16("q", { className: "awr-note__text", children: note.text }),
9079
+ note.origin === "another-tab" && /* @__PURE__ */ jsx16("span", { className: "awr-note__origin", children: L.fromAnotherTab })
8832
9080
  ] });
8833
9081
  };
8834
9082
  var decisionNote = (d, L) => {
@@ -8861,12 +9109,12 @@ var StepItem = ({
8861
9109
  L
8862
9110
  }) => /* @__PURE__ */ jsxs13("li", { className: `awr-step awr-step--${step.blocked ? "blocked" : step.status}`, children: [
8863
9111
  /* @__PURE__ */ jsxs13("div", { className: "awr-step__head", children: [
8864
- /* @__PURE__ */ jsx15("span", { className: "awr-step__marker", children: step.status === "running" ? /* @__PURE__ */ jsx15(SpinnerIcon, { size: 14 }) : step.blocked ? /* @__PURE__ */ jsx15(AlertIcon, { size: 14 }) : /* @__PURE__ */ jsx15(CheckIcon, { size: 14 }) }),
8865
- /* @__PURE__ */ jsx15("span", { className: "awr-step__index", children: `${step.index}/${step.total}` }),
8866
- /* @__PURE__ */ jsx15("span", { className: "awr-step__desc", children: step.step.description })
9112
+ /* @__PURE__ */ jsx16("span", { className: "awr-step__marker", children: step.status === "running" ? /* @__PURE__ */ jsx16(SpinnerIcon, { size: 14 }) : step.blocked ? /* @__PURE__ */ jsx16(AlertIcon, { size: 14 }) : /* @__PURE__ */ jsx16(CheckIcon, { size: 14 }) }),
9113
+ /* @__PURE__ */ jsx16("span", { className: "awr-step__index", children: `${step.index}/${step.total}` }),
9114
+ /* @__PURE__ */ jsx16("span", { className: "awr-step__desc", children: step.step.description })
8867
9115
  ] }),
8868
9116
  showTiers && step.tier && /* @__PURE__ */ jsxs13("div", { className: "awr-step__meta", children: [
8869
- /* @__PURE__ */ jsx15(
9117
+ /* @__PURE__ */ jsx16(
8870
9118
  "span",
8871
9119
  {
8872
9120
  className: `awr-step__tier awr-step__tier--${step.tier}`,
@@ -8874,29 +9122,29 @@ var StepItem = ({
8874
9122
  children: L.tierNames[step.tier]
8875
9123
  }
8876
9124
  ),
8877
- step.model && /* @__PURE__ */ jsx15("span", { className: "awr-step__model", children: step.model })
9125
+ step.model && /* @__PURE__ */ jsx16("span", { className: "awr-step__model", children: step.model })
8878
9126
  ] }),
8879
9127
  showTiers && step.escalations?.map((e, i) => /* @__PURE__ */ jsxs13("div", { className: "awr-step__escalated", children: [
8880
9128
  /* @__PURE__ */ jsxs13("p", { className: "awr-step__escalated-line", children: [
8881
- /* @__PURE__ */ jsx15(ArrowUpIcon, { size: 12 }),
8882
- /* @__PURE__ */ jsx15("span", { children: L.escalated(L.tierNames[e.from], L.tierNames[e.to], L.escalationReasons[e.reason]) })
9129
+ /* @__PURE__ */ jsx16(ArrowUpIcon, { size: 12 }),
9130
+ /* @__PURE__ */ jsx16("span", { children: L.escalated(L.tierNames[e.from], L.tierNames[e.to], L.escalationReasons[e.reason]) })
8883
9131
  ] }),
8884
9132
  e.text?.trim() && /* @__PURE__ */ jsxs13("details", { className: "awr-step__attempt", children: [
8885
- /* @__PURE__ */ jsx15("summary", { children: L.escalatedAttemptText }),
8886
- /* @__PURE__ */ jsx15("p", { className: "awr-step__text", children: e.text.trim() })
9133
+ /* @__PURE__ */ jsx16("summary", { children: L.escalatedAttemptText }),
9134
+ /* @__PURE__ */ jsx16("p", { className: "awr-step__text", children: e.text.trim() })
8887
9135
  ] })
8888
9136
  ] }, i)),
8889
9137
  showThoughts && step.reasoning.trim() && /* @__PURE__ */ jsxs13("details", { className: "awr-thought", open: step.status === "running" && !step.text, children: [
8890
9138
  /* @__PURE__ */ jsxs13("summary", { children: [
8891
- /* @__PURE__ */ jsx15(BrainIcon, { size: 13 }),
9139
+ /* @__PURE__ */ jsx16(BrainIcon, { size: 13 }),
8892
9140
  " ",
8893
9141
  L.stepThoughts
8894
9142
  ] }),
8895
- /* @__PURE__ */ jsx15("p", { className: "awr-thought__text", children: step.reasoning.trim() })
9143
+ /* @__PURE__ */ jsx16("p", { className: "awr-thought__text", children: step.reasoning.trim() })
8896
9144
  ] }),
8897
- step.text.trim() && /* @__PURE__ */ jsx15("p", { className: "awr-step__text", children: step.text.trim() }),
8898
- showToolCalls && step.toolCalls.length > 0 && /* @__PURE__ */ jsx15("ul", { className: "awr-step__tools", children: step.toolCalls.map((call, i) => {
8899
- const row = /* @__PURE__ */ jsx15(
9145
+ step.text.trim() && /* @__PURE__ */ jsx16("p", { className: "awr-step__text", children: step.text.trim() }),
9146
+ showToolCalls && step.toolCalls.length > 0 && /* @__PURE__ */ jsx16("ul", { className: "awr-step__tools", children: step.toolCalls.map((call, i) => {
9147
+ const row = /* @__PURE__ */ jsx16(
8900
9148
  ToolCallRow,
8901
9149
  {
8902
9150
  call,
@@ -8906,15 +9154,15 @@ var StepItem = ({
8906
9154
  },
8907
9155
  i
8908
9156
  );
8909
- return renderToolCall ? /* @__PURE__ */ jsx15(Fragment11, { children: renderToolCall(call, row) }, i) : row;
9157
+ return renderToolCall ? /* @__PURE__ */ jsx16(Fragment11, { children: renderToolCall(call, row) }, i) : row;
8910
9158
  }) }),
8911
- approvals.length > 0 && /* @__PURE__ */ jsx15("ul", { className: "awr-step__tools", children: approvals.map((a) => /* @__PURE__ */ jsxs13("li", { className: `awr-tool awr-tool__row awr-tool--approval-${a.status}`, children: [
8912
- /* @__PURE__ */ jsx15(ShieldIcon, { size: 13, className: "awr-tool__icon" }),
8913
- /* @__PURE__ */ jsx15("code", { className: "awr-tool__name", children: a.name }),
8914
- /* @__PURE__ */ jsx15("span", { className: "awr-tool__args", children: decisionLabel(a, L) }),
8915
- a.subagent && /* @__PURE__ */ jsx15("span", { className: "awr-tool__tag", children: L.subagentHelper })
9159
+ approvals.length > 0 && /* @__PURE__ */ jsx16("ul", { className: "awr-step__tools", children: approvals.map((a) => /* @__PURE__ */ jsxs13("li", { className: `awr-tool awr-tool__row awr-tool--approval-${a.status}`, children: [
9160
+ /* @__PURE__ */ jsx16(ShieldIcon, { size: 13, className: "awr-tool__icon" }),
9161
+ /* @__PURE__ */ jsx16("code", { className: "awr-tool__name", children: a.name }),
9162
+ /* @__PURE__ */ jsx16("span", { className: "awr-tool__args", children: decisionLabel(a, L) }),
9163
+ a.subagent && /* @__PURE__ */ jsx16("span", { className: "awr-tool__tag", children: L.subagentHelper })
8916
9164
  ] }, a.id)) }),
8917
- showSubagents && /* @__PURE__ */ jsx15(
9165
+ showSubagents && /* @__PURE__ */ jsx16(
8918
9166
  SubagentTree,
8919
9167
  {
8920
9168
  subagents,
@@ -8923,14 +9171,14 @@ var StepItem = ({
8923
9171
  renderSubagent
8924
9172
  }
8925
9173
  ),
8926
- notes.length > 0 && /* @__PURE__ */ jsx15("ul", { className: "awr-notes", children: notes.map((n) => /* @__PURE__ */ jsx15(UserNoteRow, { note: n }, n.id)) }),
8927
- step.blocked && step.summary && /* @__PURE__ */ jsx15("p", { className: "awr-step__blocked", children: step.summary }),
9174
+ notes.length > 0 && /* @__PURE__ */ jsx16("ul", { className: "awr-notes", children: notes.map((n) => /* @__PURE__ */ jsx16(UserNoteRow, { note: n }, n.id)) }),
9175
+ step.blocked && step.summary && /* @__PURE__ */ jsx16("p", { className: "awr-step__blocked", children: step.summary }),
8928
9176
  showReplanFailed && step.replanFailed && /* @__PURE__ */ jsxs13("p", { className: "awr-step__warn", title: step.replanFailed, children: [
8929
- /* @__PURE__ */ jsx15(AlertIcon, { size: 12 }),
9177
+ /* @__PURE__ */ jsx16(AlertIcon, { size: 12 }),
8930
9178
  " ",
8931
9179
  L.replanFailed
8932
9180
  ] }),
8933
- showDecisions && step.decisions?.map((d, i) => /* @__PURE__ */ jsx15(
9181
+ showDecisions && step.decisions?.map((d, i) => /* @__PURE__ */ jsx16(
8934
9182
  "p",
8935
9183
  {
8936
9184
  className: `awr-step__decision${d.accepted ? "" : " awr-step__decision--fallback"}`,
@@ -8966,7 +9214,7 @@ var StepList = ({
8966
9214
  const atEnd = showNotes ? notes.filter((n) => !n.stepId || !known.has(n.stepId)) : [];
8967
9215
  const loose = showSubagents ? subagents.filter((s) => !s.stepId || !known.has(s.stepId)) : [];
8968
9216
  return /* @__PURE__ */ jsxs13("ol", { className: ["awr-steps", className].filter(Boolean).join(" "), children: [
8969
- steps.map((step) => /* @__PURE__ */ jsx15(
9217
+ steps.map((step) => /* @__PURE__ */ jsx16(
8970
9218
  StepItem,
8971
9219
  {
8972
9220
  step,
@@ -8988,7 +9236,7 @@ var StepList = ({
8988
9236
  },
8989
9237
  step.id
8990
9238
  )),
8991
- loose.length > 0 && /* @__PURE__ */ jsx15("li", { className: "awr-step awr-step--subagents", children: /* @__PURE__ */ jsx15(
9239
+ loose.length > 0 && /* @__PURE__ */ jsx16("li", { className: "awr-step awr-step--subagents", children: /* @__PURE__ */ jsx16(
8992
9240
  SubagentTree,
8993
9241
  {
8994
9242
  subagents: loose,
@@ -8997,12 +9245,12 @@ var StepList = ({
8997
9245
  renderSubagent
8998
9246
  }
8999
9247
  ) }),
9000
- atEnd.length > 0 && /* @__PURE__ */ jsx15("li", { className: "awr-step awr-step--notes", children: /* @__PURE__ */ jsx15("ul", { className: "awr-notes", children: atEnd.map((n) => /* @__PURE__ */ jsx15(UserNoteRow, { note: n }, n.id)) }) })
9248
+ atEnd.length > 0 && /* @__PURE__ */ jsx16("li", { className: "awr-step awr-step--notes", children: /* @__PURE__ */ jsx16("ul", { className: "awr-notes", children: atEnd.map((n) => /* @__PURE__ */ jsx16(UserNoteRow, { note: n }, n.id)) }) })
9001
9249
  ] });
9002
9250
  };
9003
9251
 
9004
9252
  // src/components/MessageList.tsx
9005
- import { Fragment as Fragment12, jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
9253
+ import { Fragment as Fragment12, jsx as jsx17, jsxs as jsxs14 } from "react/jsx-runtime";
9006
9254
  var usageLine = (usage, durationMs) => {
9007
9255
  const parts = [];
9008
9256
  if (usage && usage.totalTokens > 0) {
@@ -9037,7 +9285,7 @@ var AttachedAudio = ({
9037
9285
  const length = lengthOf(a.durationMs);
9038
9286
  const said = length !== void 0 ? L.audioDuration(formatClock(length)) : void 0;
9039
9287
  return url ? /* @__PURE__ */ jsxs14("span", { className: "awr-media awr-media--audio awr-msg__audio", title: a.path ?? a.name, children: [
9040
- /* @__PURE__ */ jsx16(
9288
+ /* @__PURE__ */ jsx17(
9041
9289
  "audio",
9042
9290
  {
9043
9291
  className: "awr-media__audio",
@@ -9048,9 +9296,9 @@ var AttachedAudio = ({
9048
9296
  onLoadedMetadata: (e) => settleAudioDuration(e.currentTarget)
9049
9297
  }
9050
9298
  ),
9051
- said && /* @__PURE__ */ jsx16("span", { className: "awr-msg__audiolen", "aria-hidden": "true", children: said })
9299
+ said && /* @__PURE__ */ jsx17("span", { className: "awr-msg__audiolen", "aria-hidden": "true", children: said })
9052
9300
  ] }) : /* @__PURE__ */ jsxs14("span", { className: "awr-chip awr-file", title: a.path ?? a.mediaType, children: [
9053
- /* @__PURE__ */ jsx16(WaveIcon, { size: 13 }),
9301
+ /* @__PURE__ */ jsx17(WaveIcon, { size: 13 }),
9054
9302
  " ",
9055
9303
  a.name,
9056
9304
  said ? ` \xB7 ${said}` : ""
@@ -9060,7 +9308,7 @@ var AttachmentView = ({
9060
9308
  attachment: a,
9061
9309
  files,
9062
9310
  labels
9063
- }) => mediaFamilyOf(a.mediaType) === "audio" ? /* @__PURE__ */ jsx16(AttachedAudio, { attachment: a, files, labels }) : a.dataUrl && a.mediaType.startsWith("image/") ? /* @__PURE__ */ jsx16(
9311
+ }) => mediaFamilyOf(a.mediaType) === "audio" ? /* @__PURE__ */ jsx17(AttachedAudio, { attachment: a, files, labels }) : a.dataUrl && a.mediaType.startsWith("image/") ? /* @__PURE__ */ jsx17(
9064
9312
  ImageThumb,
9065
9313
  {
9066
9314
  src: a.dataUrl,
@@ -9070,7 +9318,7 @@ var AttachmentView = ({
9070
9318
  title: a.path ?? a.name
9071
9319
  }
9072
9320
  ) : /* @__PURE__ */ jsxs14("span", { className: "awr-chip awr-file", title: a.path ?? a.mediaType, children: [
9073
- /* @__PURE__ */ jsx16(FileIcon, { size: 13 }),
9321
+ /* @__PURE__ */ jsx17(FileIcon, { size: 13 }),
9074
9322
  " ",
9075
9323
  a.name
9076
9324
  ] });
@@ -9111,6 +9359,7 @@ var MessageList = ({
9111
9359
  showSubagents = true,
9112
9360
  showMedia = true,
9113
9361
  showFileChips = true,
9362
+ showNamedFiles = showFileChips,
9114
9363
  files,
9115
9364
  htmlPreview,
9116
9365
  onShowFiles,
@@ -9138,128 +9387,157 @@ var MessageList = ({
9138
9387
  const L = useLabels(labels);
9139
9388
  const reader = useReadAloud(readAloud?.speak, readAloud?.lang);
9140
9389
  if (messages.length === 0) {
9141
- return empty ? /* @__PURE__ */ jsx16("div", { className: "awr-messages__empty", children: empty }) : null;
9390
+ return empty ? /* @__PURE__ */ jsx17("div", { className: "awr-messages__empty", children: empty }) : null;
9142
9391
  }
9143
- return /* @__PURE__ */ jsx16(ImageViewerProvider, { enabled: imageViewer, render: renderImageViewer, children: /* @__PURE__ */ jsx16("div", { className: ["awr-messages", className].filter(Boolean).join(" "), children: messages.map((m) => {
9144
- const steps = m.steps ?? [];
9145
- const hasActivity = showActivity && (steps.length > 0 || (m.subagents?.length ?? 0) > 0 || m.pending && !!liveExtra);
9146
- const usage = showUsage ? usageLine(m.usage, m.durationMs) : "";
9147
- const cards = showToolCards && renderToolCard && m.role === "assistant" ? toolCardsOf(m, renderToolCard) : [];
9148
- const node = /* @__PURE__ */ jsx16(
9149
- "div",
9150
- {
9151
- className: `awr-msg awr-msg--${m.role}${m.error ? " awr-msg--error" : ""}${m.pending ? " is-pending" : ""}`,
9152
- children: /* @__PURE__ */ jsxs14("div", { className: "awr-msg__col", children: [
9153
- m.role === "assistant" && hasActivity && /* @__PURE__ */ jsxs14("details", { className: "awr-activity", open: m.pending || activityOpen, children: [
9154
- /* @__PURE__ */ jsx16("summary", { className: "awr-activity__summary", children: activitySummary(
9155
- m,
9156
- showToolCalls,
9157
- showLearned,
9158
- showTiers,
9159
- showFileChips,
9160
- L,
9161
- showApps && Boolean(renderApp)
9162
- ) }),
9163
- m.pending && liveExtra,
9164
- /* @__PURE__ */ jsx16(
9165
- StepList,
9166
- {
9167
- steps,
9168
- subagents: m.subagents,
9169
- approvals: m.approvals,
9170
- notes: m.notes,
9171
- showNotes,
9172
- onStopSubagent: m.pending ? onStopSubagent : void 0,
9173
- showToolCalls,
9174
- showUsage,
9175
- showThoughts,
9176
- showTiers,
9177
- showReplanFailed,
9178
- showDecisions,
9179
- showSearchResults,
9180
- showSubagents,
9181
- renderToolCall,
9182
- renderSubagent,
9183
- labels
9184
- }
9185
- ),
9186
- showLearned && m.fetches?.length ? /* @__PURE__ */ jsx16("ul", { className: "awr-fetches", children: m.fetches.map((f, i) => /* @__PURE__ */ jsxs14(
9187
- "li",
9188
- {
9189
- className: `awr-fetch${f.allowed ? "" : " awr-fetch--refused"}`,
9190
- children: [
9191
- /* @__PURE__ */ jsx16(GlobeIcon, { size: 12 }),
9192
- " ",
9193
- /* @__PURE__ */ jsx16("code", { children: f.url }),
9392
+ return /* @__PURE__ */ jsx17(
9393
+ TranscriptContext,
9394
+ {
9395
+ imageViewer,
9396
+ renderImageViewer,
9397
+ files: showFileChips || showNamedFiles ? files : void 0,
9398
+ children: /* @__PURE__ */ jsx17("div", { className: ["awr-messages", className].filter(Boolean).join(" "), children: messages.map((m) => {
9399
+ const steps = m.steps ?? [];
9400
+ const hasActivity = showActivity && (steps.length > 0 || (m.subagents?.length ?? 0) > 0 || m.pending && !!liveExtra);
9401
+ const usage = showUsage ? usageLine(m.usage, m.durationMs) : "";
9402
+ const cards = showToolCards && renderToolCard && m.role === "assistant" ? toolCardsOf(m, renderToolCard) : [];
9403
+ const node = /* @__PURE__ */ jsx17(
9404
+ "div",
9405
+ {
9406
+ className: `awr-msg awr-msg--${m.role}${m.error ? " awr-msg--error" : ""}${m.pending ? " is-pending" : ""}`,
9407
+ children: /* @__PURE__ */ jsxs14("div", { className: "awr-msg__col", children: [
9408
+ m.role === "assistant" && hasActivity && /* @__PURE__ */ jsxs14("details", { className: "awr-activity", open: m.pending || activityOpen, children: [
9409
+ /* @__PURE__ */ jsx17("summary", { className: "awr-activity__summary", children: activitySummary(
9410
+ m,
9411
+ showToolCalls,
9412
+ showLearned,
9413
+ showTiers,
9414
+ showFileChips,
9415
+ L,
9416
+ showApps && Boolean(renderApp)
9417
+ ) }),
9418
+ m.pending && liveExtra,
9419
+ /* @__PURE__ */ jsx17(
9420
+ StepList,
9421
+ {
9422
+ steps,
9423
+ subagents: m.subagents,
9424
+ approvals: m.approvals,
9425
+ notes: m.notes,
9426
+ showNotes,
9427
+ onStopSubagent: m.pending ? onStopSubagent : void 0,
9428
+ showToolCalls,
9429
+ showUsage,
9430
+ showThoughts,
9431
+ showTiers,
9432
+ showReplanFailed,
9433
+ showDecisions,
9434
+ showSearchResults,
9435
+ showSubagents,
9436
+ renderToolCall,
9437
+ renderSubagent,
9438
+ labels
9439
+ }
9440
+ ),
9441
+ showLearned && m.fetches?.length ? /* @__PURE__ */ jsx17("ul", { className: "awr-fetches", children: m.fetches.map((f, i) => /* @__PURE__ */ jsxs14(
9442
+ "li",
9443
+ {
9444
+ className: `awr-fetch${f.allowed ? "" : " awr-fetch--refused"}`,
9445
+ children: [
9446
+ /* @__PURE__ */ jsx17(GlobeIcon, { size: 12 }),
9447
+ " ",
9448
+ /* @__PURE__ */ jsx17("code", { children: f.url }),
9449
+ " ",
9450
+ /* @__PURE__ */ jsx17("span", { className: "awr-fetch__result", children: f.allowed ? f.status ?? "ok" : L.fetchRefused(f.reason ?? "") })
9451
+ ]
9452
+ },
9453
+ i
9454
+ )) }) : null,
9455
+ showLearned && m.learned?.length ? /* @__PURE__ */ jsxs14("p", { className: "awr-learned", children: [
9456
+ /* @__PURE__ */ jsx17(BookIcon, { size: 12 }),
9194
9457
  " ",
9195
- /* @__PURE__ */ jsx16("span", { className: "awr-fetch__result", children: f.allowed ? f.status ?? "ok" : L.fetchRefused(f.reason ?? "") })
9196
- ]
9197
- },
9198
- i
9199
- )) }) : null,
9200
- showLearned && m.learned?.length ? /* @__PURE__ */ jsxs14("p", { className: "awr-learned", children: [
9201
- /* @__PURE__ */ jsx16(BookIcon, { size: 12 }),
9202
- " ",
9203
- L.learnedNow(m.learned.join(", "))
9204
- ] }) : null,
9205
- showThoughts && m.reasoning?.trim() && /* @__PURE__ */ jsxs14("details", { className: "awr-thought", children: [
9206
- /* @__PURE__ */ jsxs14("summary", { children: [
9207
- /* @__PURE__ */ jsx16(BrainIcon, { size: 13 }),
9208
- " ",
9209
- L.answerThoughts
9458
+ L.learnedNow(m.learned.join(", "))
9459
+ ] }) : null,
9460
+ showThoughts && m.reasoning?.trim() && /* @__PURE__ */ jsxs14("details", { className: "awr-thought", children: [
9461
+ /* @__PURE__ */ jsxs14("summary", { children: [
9462
+ /* @__PURE__ */ jsx17(BrainIcon, { size: 13 }),
9463
+ " ",
9464
+ L.answerThoughts
9465
+ ] }),
9466
+ /* @__PURE__ */ jsx17("p", { className: "awr-thought__text", children: m.reasoning.trim() })
9467
+ ] })
9468
+ ] }),
9469
+ cards.length > 0 && /* @__PURE__ */ jsx17("div", { className: "awr-msg__cards", children: cards.map((card) => /* @__PURE__ */ jsx17("div", { className: "awr-msg__card", children: card.node }, card.key)) }),
9470
+ showApps && renderApp && m.role === "assistant" && m.apps?.length ? /* @__PURE__ */ jsx17("div", { className: "awr-msg__apps", children: m.apps.map((app) => /* @__PURE__ */ jsx17("div", { className: "awr-msg__app", children: renderApp(app, m) }, app.id)) }) : null,
9471
+ showMedia && m.transcripts?.length ? /* @__PURE__ */ jsx17("div", { className: "awr-msg__transcripts", children: m.transcripts.map((t, i) => /* @__PURE__ */ jsx17(TranscriptBlock, { transcript: t, labels }, i)) }) : null,
9472
+ (m.content || m.pending || !m.attachments?.length) && /* @__PURE__ */ jsxs14("div", { className: "awr-msg__bubble", children: [
9473
+ m.content ? renderContent ? renderContent(m) : m.content : m.stopped && !m.pending ? /* @__PURE__ */ jsx17("span", { className: "awr-msg__stopped", children: L.answerStopped }) : null,
9474
+ m.pending && !m.content && /* @__PURE__ */ jsx17(SpinnerIcon, { size: 14, className: "awr-msg__pending" })
9210
9475
  ] }),
9211
- /* @__PURE__ */ jsx16("p", { className: "awr-thought__text", children: m.reasoning.trim() })
9476
+ readAloud && m.role === "assistant" && m.content && !m.pending && !m.error && /* @__PURE__ */ jsx17(
9477
+ ReadAloudControl,
9478
+ {
9479
+ id: m.id,
9480
+ text: () => readAloud.textOf ? readAloud.textOf(m) : speakableText(m.content, { code: L.readAloudCode }),
9481
+ reader,
9482
+ labels: L
9483
+ }
9484
+ ),
9485
+ showMedia && m.media?.length ? /* @__PURE__ */ jsx17("div", { className: "awr-msg__media", children: m.media.map((item, i) => {
9486
+ const built = /* @__PURE__ */ jsx17(GeneratedMedia, { media: item, files, labels }, i);
9487
+ return renderMedia ? /* @__PURE__ */ jsx17("span", { className: "awr-msg__mediaitem", children: renderMedia(item, m, built) }, i) : built;
9488
+ }) }) : null,
9489
+ showFileChips && m.role === "assistant" && m.writtenFiles?.length ? /* @__PURE__ */ jsx17(
9490
+ FileChips,
9491
+ {
9492
+ written: m.writtenFiles,
9493
+ files,
9494
+ htmlPreview,
9495
+ onShowFiles,
9496
+ renderFile: renderFile ? (f, fallback) => renderFile(f, m, fallback) : void 0,
9497
+ renderFileContent,
9498
+ labels
9499
+ }
9500
+ ) : null,
9501
+ showNamedFiles && files && m.role === "assistant" && !m.pending && m.content ? /* @__PURE__ */ jsx17(
9502
+ NamedFileChips,
9503
+ {
9504
+ text: m.content,
9505
+ files,
9506
+ exclude: [
9507
+ ...showFileChips ? (m.writtenFiles ?? []).map((f) => f.path) : [],
9508
+ ...showMedia ? (m.media ?? []).map((x) => x.path) : []
9509
+ ],
9510
+ htmlPreview,
9511
+ renderFile: renderFile ? (f, fallback) => renderFile(f, m, fallback) : void 0,
9512
+ renderFileContent,
9513
+ labels
9514
+ }
9515
+ ) : null,
9516
+ m.attachments?.length ? /* @__PURE__ */ jsx17(
9517
+ "div",
9518
+ {
9519
+ className: "awr-msg__attachments",
9520
+ role: "group",
9521
+ "aria-label": m.content.trim() ? L.attachments : attachmentsText(m.attachments, { voiceMessage: L.voiceMessage }),
9522
+ children: m.attachments.map((a, i) => /* @__PURE__ */ jsx17("span", { className: "awr-msg__attachment", children: renderAttachment ? renderAttachment(a, m) : /* @__PURE__ */ jsx17(AttachmentView, { attachment: a, files, labels }) }, i))
9523
+ }
9524
+ ) : null,
9525
+ m.role === "assistant" && usage && !m.pending && /* @__PURE__ */ jsx17("div", { className: "awr-msg__usage", title: L.usageTitle, children: usage })
9212
9526
  ] })
9213
- ] }),
9214
- cards.length > 0 && /* @__PURE__ */ jsx16("div", { className: "awr-msg__cards", children: cards.map((card) => /* @__PURE__ */ jsx16("div", { className: "awr-msg__card", children: card.node }, card.key)) }),
9215
- showApps && renderApp && m.role === "assistant" && m.apps?.length ? /* @__PURE__ */ jsx16("div", { className: "awr-msg__apps", children: m.apps.map((app) => /* @__PURE__ */ jsx16("div", { className: "awr-msg__app", children: renderApp(app, m) }, app.id)) }) : null,
9216
- showMedia && m.transcripts?.length ? /* @__PURE__ */ jsx16("div", { className: "awr-msg__transcripts", children: m.transcripts.map((t, i) => /* @__PURE__ */ jsx16(TranscriptBlock, { transcript: t, labels }, i)) }) : null,
9217
- (m.content || m.pending || !m.attachments?.length) && /* @__PURE__ */ jsxs14("div", { className: "awr-msg__bubble", children: [
9218
- m.content ? renderContent ? renderContent(m) : m.content : m.stopped && !m.pending ? /* @__PURE__ */ jsx16("span", { className: "awr-msg__stopped", children: L.answerStopped }) : null,
9219
- m.pending && !m.content && /* @__PURE__ */ jsx16(SpinnerIcon, { size: 14, className: "awr-msg__pending" })
9220
- ] }),
9221
- readAloud && m.role === "assistant" && m.content && !m.pending && !m.error && /* @__PURE__ */ jsx16(
9222
- ReadAloudControl,
9223
- {
9224
- id: m.id,
9225
- text: () => readAloud.textOf ? readAloud.textOf(m) : speakableText(m.content, { code: L.readAloudCode }),
9226
- reader,
9227
- labels: L
9228
- }
9229
- ),
9230
- showMedia && m.media?.length ? /* @__PURE__ */ jsx16("div", { className: "awr-msg__media", children: m.media.map((item, i) => {
9231
- const built = /* @__PURE__ */ jsx16(GeneratedMedia, { media: item, files, labels }, i);
9232
- return renderMedia ? /* @__PURE__ */ jsx16("span", { className: "awr-msg__mediaitem", children: renderMedia(item, m, built) }, i) : built;
9233
- }) }) : null,
9234
- showFileChips && m.role === "assistant" && m.writtenFiles?.length ? /* @__PURE__ */ jsx16(
9235
- FileChips,
9236
- {
9237
- written: m.writtenFiles,
9238
- files,
9239
- htmlPreview,
9240
- onShowFiles,
9241
- renderFile: renderFile ? (f, fallback) => renderFile(f, m, fallback) : void 0,
9242
- renderFileContent,
9243
- labels
9244
- }
9245
- ) : null,
9246
- m.attachments?.length ? /* @__PURE__ */ jsx16(
9247
- "div",
9248
- {
9249
- className: "awr-msg__attachments",
9250
- role: "group",
9251
- "aria-label": m.content.trim() ? L.attachments : attachmentsText(m.attachments, { voiceMessage: L.voiceMessage }),
9252
- children: m.attachments.map((a, i) => /* @__PURE__ */ jsx16("span", { className: "awr-msg__attachment", children: renderAttachment ? renderAttachment(a, m) : /* @__PURE__ */ jsx16(AttachmentView, { attachment: a, files, labels }) }, i))
9253
- }
9254
- ) : null,
9255
- m.role === "assistant" && usage && !m.pending && /* @__PURE__ */ jsx16("div", { className: "awr-msg__usage", title: L.usageTitle, children: usage })
9256
- ] })
9257
- },
9258
- m.id
9259
- );
9260
- return renderMessage ? /* @__PURE__ */ jsx16("div", { children: renderMessage(m, node) }, m.id) : node;
9261
- }) }) });
9527
+ },
9528
+ m.id
9529
+ );
9530
+ return renderMessage ? /* @__PURE__ */ jsx17("div", { children: renderMessage(m, node) }, m.id) : node;
9531
+ }) })
9532
+ }
9533
+ );
9262
9534
  };
9535
+ var TranscriptContext = ({
9536
+ imageViewer,
9537
+ renderImageViewer,
9538
+ files,
9539
+ children
9540
+ }) => /* @__PURE__ */ jsx17(ImageViewerProvider, { enabled: imageViewer, render: renderImageViewer, children: /* @__PURE__ */ jsx17(WorkspaceListingProvider, { files, children }) });
9263
9541
  var ReadAloudControl = ({
9264
9542
  id,
9265
9543
  text,
@@ -9277,14 +9555,14 @@ var ReadAloudControl = ({
9277
9555
  onClick: () => reader.start(id, text()),
9278
9556
  "aria-label": L.readAloud,
9279
9557
  children: [
9280
- /* @__PURE__ */ jsx16(SpeakerIcon, { size: 14 }),
9558
+ /* @__PURE__ */ jsx17(SpeakerIcon, { size: 14 }),
9281
9559
  " ",
9282
9560
  L.readAloud
9283
9561
  ]
9284
9562
  }
9285
9563
  ) : /* @__PURE__ */ jsxs14(Fragment12, { children: [
9286
9564
  reader.state === "loading" ? /* @__PURE__ */ jsxs14("span", { className: "awr-readaloud__status", role: "status", children: [
9287
- /* @__PURE__ */ jsx16(SpinnerIcon, { size: 14 }),
9565
+ /* @__PURE__ */ jsx17(SpinnerIcon, { size: 14 }),
9288
9566
  " ",
9289
9567
  L.readAloudLoading
9290
9568
  ] }) : reader.state === "paused" ? /* @__PURE__ */ jsxs14(
@@ -9295,7 +9573,7 @@ var ReadAloudControl = ({
9295
9573
  onClick: reader.resume,
9296
9574
  "aria-label": L.readAloudResume,
9297
9575
  children: [
9298
- /* @__PURE__ */ jsx16(PlayIcon, { size: 14 }),
9576
+ /* @__PURE__ */ jsx17(PlayIcon, { size: 14 }),
9299
9577
  " ",
9300
9578
  L.readAloudResume
9301
9579
  ]
@@ -9308,7 +9586,7 @@ var ReadAloudControl = ({
9308
9586
  onClick: reader.pause,
9309
9587
  "aria-label": L.readAloudPause,
9310
9588
  children: [
9311
- /* @__PURE__ */ jsx16(PauseIcon, { size: 14 }),
9589
+ /* @__PURE__ */ jsx17(PauseIcon, { size: 14 }),
9312
9590
  " ",
9313
9591
  L.readAloudPause
9314
9592
  ]
@@ -9322,36 +9600,36 @@ var ReadAloudControl = ({
9322
9600
  onClick: reader.stop,
9323
9601
  "aria-label": L.readAloudStop,
9324
9602
  children: [
9325
- /* @__PURE__ */ jsx16(StopIcon, { size: 14 }),
9603
+ /* @__PURE__ */ jsx17(StopIcon, { size: 14 }),
9326
9604
  " ",
9327
9605
  L.readAloudStop
9328
9606
  ]
9329
9607
  }
9330
9608
  )
9331
9609
  ] }),
9332
- failed && /* @__PURE__ */ jsx16("span", { className: "awr-readaloud__error", role: "alert", children: failed.message ?? L.readAloudFailed })
9610
+ failed && /* @__PURE__ */ jsx17("span", { className: "awr-readaloud__error", role: "alert", children: failed.message ?? L.readAloudFailed })
9333
9611
  ] });
9334
9612
  };
9335
9613
 
9336
9614
  // src/components/ModelLoadBar.tsx
9337
- import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
9615
+ import { jsx as jsx18, jsxs as jsxs15 } from "react/jsx-runtime";
9338
9616
  var ModelLoadBar = ({ load, className }) => {
9339
9617
  const pct = Math.round(Math.max(0, Math.min(1, load.progress)) * 100);
9340
9618
  return /* @__PURE__ */ jsxs15("div", { className: ["awr-modelload", className].filter(Boolean).join(" "), children: [
9341
9619
  /* @__PURE__ */ jsxs15("div", { className: "awr-modelload__head", children: [
9342
- /* @__PURE__ */ jsx17("span", { className: "awr-modelload__text", children: load.text || "Loading model\u2026" }),
9620
+ /* @__PURE__ */ jsx18("span", { className: "awr-modelload__text", children: load.text || "Loading model\u2026" }),
9343
9621
  /* @__PURE__ */ jsxs15("span", { className: "awr-modelload__pct", children: [
9344
9622
  pct,
9345
9623
  "%"
9346
9624
  ] })
9347
9625
  ] }),
9348
- /* @__PURE__ */ jsx17("div", { className: "awr-modelload__track", role: "progressbar", "aria-valuenow": pct, children: /* @__PURE__ */ jsx17("div", { className: "awr-modelload__fill", style: { width: `${pct}%` } }) })
9626
+ /* @__PURE__ */ jsx18("div", { className: "awr-modelload__track", role: "progressbar", "aria-valuenow": pct, children: /* @__PURE__ */ jsx18("div", { className: "awr-modelload__fill", style: { width: `${pct}%` } }) })
9349
9627
  ] });
9350
9628
  };
9351
9629
 
9352
9630
  // src/components/QuestionPrompt.tsx
9353
- import { useEffect as useEffect19, useId as useId2, useRef as useRef13, useState as useState19 } from "react";
9354
- import { jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
9631
+ import { useEffect as useEffect19, useId as useId2, useRef as useRef14, useState as useState19 } from "react";
9632
+ import { jsx as jsx19, jsxs as jsxs16 } from "react/jsx-runtime";
9355
9633
  var useNow2 = (active) => {
9356
9634
  const [now, setNow] = useState19(() => Date.now());
9357
9635
  useEffect19(() => {
@@ -9364,7 +9642,7 @@ var useNow2 = (active) => {
9364
9642
  };
9365
9643
  var Expiry2 = ({ expiresAt, L }) => {
9366
9644
  const now = useNow2(true);
9367
- return /* @__PURE__ */ jsx18("p", { className: "awr-question__expiry", children: L.questionExpiresIn(formatCountdown(expiresAt - now)) });
9645
+ return /* @__PURE__ */ jsx19("p", { className: "awr-question__expiry", children: L.questionExpiresIn(formatCountdown(expiresAt - now)) });
9368
9646
  };
9369
9647
  var reasonText2 = (q, L) => {
9370
9648
  const key = q.reason ?? q.status;
@@ -9389,8 +9667,8 @@ var QuestionCard = ({
9389
9667
  const [picked, setPicked] = useState19([]);
9390
9668
  const [otherOpen, setOtherOpen] = useState19(false);
9391
9669
  const [otherText, setOtherText] = useState19("");
9392
- const otherField = useRef13(null);
9393
- const otherButton = useRef13(null);
9670
+ const otherField = useRef14(null);
9671
+ const otherButton = useRef14(null);
9394
9672
  useEffect19(() => {
9395
9673
  if (otherOpen) otherField.current?.focus();
9396
9674
  }, [otherOpen]);
@@ -9429,13 +9707,13 @@ var QuestionCard = ({
9429
9707
  onKeyDown,
9430
9708
  children: [
9431
9709
  /* @__PURE__ */ jsxs16("div", { className: "awr-question__head", children: [
9432
- /* @__PURE__ */ jsx18(QuestionIcon, { size: 16, className: "awr-question__icon" }),
9433
- /* @__PURE__ */ jsx18("span", { className: "awr-question__lead", role: "alert", children: leadOf(helper, L) }),
9434
- total > 1 && /* @__PURE__ */ jsx18("span", { className: "awr-question__count", children: L.questionCount(index, total) })
9710
+ /* @__PURE__ */ jsx19(QuestionIcon, { size: 16, className: "awr-question__icon" }),
9711
+ /* @__PURE__ */ jsx19("span", { className: "awr-question__lead", role: "alert", children: leadOf(helper, L) }),
9712
+ total > 1 && /* @__PURE__ */ jsx19("span", { className: "awr-question__count", children: L.questionCount(index, total) })
9435
9713
  ] }),
9436
- /* @__PURE__ */ jsx18("p", { className: "awr-question__text", id: textId, children: q.question }),
9437
- q.multiple && /* @__PURE__ */ jsx18("p", { className: "awr-question__hint", children: L.questionSeveral }),
9438
- /* @__PURE__ */ jsx18("div", { className: "awr-question__options", children: q.options.map((o, i) => {
9714
+ /* @__PURE__ */ jsx19("p", { className: "awr-question__text", id: textId, children: q.question }),
9715
+ q.multiple && /* @__PURE__ */ jsx19("p", { className: "awr-question__hint", children: L.questionSeveral }),
9716
+ /* @__PURE__ */ jsx19("div", { className: "awr-question__options", children: q.options.map((o, i) => {
9439
9717
  const on = picked.includes(o.label);
9440
9718
  return /* @__PURE__ */ jsxs16(
9441
9719
  "button",
@@ -9447,21 +9725,21 @@ var QuestionCard = ({
9447
9725
  "aria-keyshortcuts": numberKeys && i < 9 ? String(i + 1) : void 0,
9448
9726
  onClick: () => pick(o.label),
9449
9727
  children: [
9450
- numberKeys && i < 9 && /* @__PURE__ */ jsx18("span", { className: "awr-question__key", "aria-hidden": "true", children: i + 1 }),
9728
+ numberKeys && i < 9 && /* @__PURE__ */ jsx19("span", { className: "awr-question__key", "aria-hidden": "true", children: i + 1 }),
9451
9729
  /* @__PURE__ */ jsxs16("span", { className: "awr-question__body", children: [
9452
- /* @__PURE__ */ jsx18("span", { className: "awr-question__label", children: o.label }),
9453
- o.description && /* @__PURE__ */ jsx18("span", { className: "awr-question__desc", children: o.description })
9730
+ /* @__PURE__ */ jsx19("span", { className: "awr-question__label", children: o.label }),
9731
+ o.description && /* @__PURE__ */ jsx19("span", { className: "awr-question__desc", children: o.description })
9454
9732
  ] }),
9455
- q.multiple && /* @__PURE__ */ jsx18("span", { className: "awr-question__mark", "aria-hidden": "true", children: on && /* @__PURE__ */ jsx18(CheckIcon, { size: 14 }) })
9733
+ q.multiple && /* @__PURE__ */ jsx19("span", { className: "awr-question__mark", "aria-hidden": "true", children: on && /* @__PURE__ */ jsx19(CheckIcon, { size: 14 }) })
9456
9734
  ]
9457
9735
  },
9458
9736
  o.label
9459
9737
  );
9460
9738
  }) }),
9461
9739
  q.allowOther && otherOpen && /* @__PURE__ */ jsxs16("form", { className: "awr-question__other", onSubmit: sendOther, children: [
9462
- /* @__PURE__ */ jsx18("label", { className: "awr-question__otherlabel", htmlFor: otherId, children: L.questionOtherLabel }),
9740
+ /* @__PURE__ */ jsx19("label", { className: "awr-question__otherlabel", htmlFor: otherId, children: L.questionOtherLabel }),
9463
9741
  /* @__PURE__ */ jsxs16("div", { className: "awr-question__otherrow", children: [
9464
- /* @__PURE__ */ jsx18(
9742
+ /* @__PURE__ */ jsx19(
9465
9743
  "input",
9466
9744
  {
9467
9745
  ref: otherField,
@@ -9480,11 +9758,11 @@ var QuestionCard = ({
9480
9758
  }
9481
9759
  }
9482
9760
  ),
9483
- /* @__PURE__ */ jsx18("button", { type: "submit", className: "awr-btn awr-btn--primary", disabled: !other, children: L.questionSend })
9761
+ /* @__PURE__ */ jsx19("button", { type: "submit", className: "awr-btn awr-btn--primary", disabled: !other, children: L.questionSend })
9484
9762
  ] })
9485
9763
  ] }),
9486
9764
  /* @__PURE__ */ jsxs16("div", { className: "awr-question__actions", children: [
9487
- q.multiple && !otherOpen && /* @__PURE__ */ jsx18(
9765
+ q.multiple && !otherOpen && /* @__PURE__ */ jsx19(
9488
9766
  "button",
9489
9767
  {
9490
9768
  type: "button",
@@ -9494,7 +9772,7 @@ var QuestionCard = ({
9494
9772
  children: L.questionSend
9495
9773
  }
9496
9774
  ),
9497
- q.allowOther && /* @__PURE__ */ jsx18(
9775
+ q.allowOther && /* @__PURE__ */ jsx19(
9498
9776
  "button",
9499
9777
  {
9500
9778
  ref: otherButton,
@@ -9506,7 +9784,7 @@ var QuestionCard = ({
9506
9784
  children: L.questionOther
9507
9785
  }
9508
9786
  ),
9509
- /* @__PURE__ */ jsx18(
9787
+ /* @__PURE__ */ jsx19(
9510
9788
  "button",
9511
9789
  {
9512
9790
  type: "button",
@@ -9516,7 +9794,7 @@ var QuestionCard = ({
9516
9794
  }
9517
9795
  )
9518
9796
  ] }),
9519
- showExpiry && q.expiresAt !== void 0 && /* @__PURE__ */ jsx18(Expiry2, { expiresAt: q.expiresAt, L })
9797
+ showExpiry && q.expiresAt !== void 0 && /* @__PURE__ */ jsx19(Expiry2, { expiresAt: q.expiresAt, L })
9520
9798
  ]
9521
9799
  }
9522
9800
  );
@@ -9532,15 +9810,15 @@ var RemoteQuestion = ({ view, L }) => {
9532
9810
  "data-question": view.id,
9533
9811
  children: [
9534
9812
  /* @__PURE__ */ jsxs16("div", { className: "awr-question__head", children: [
9535
- /* @__PURE__ */ jsx18(QuestionIcon, { size: 16, className: "awr-question__icon" }),
9536
- /* @__PURE__ */ jsx18("span", { className: "awr-question__lead", children: leadOf(view.subagent, L) })
9813
+ /* @__PURE__ */ jsx19(QuestionIcon, { size: 16, className: "awr-question__icon" }),
9814
+ /* @__PURE__ */ jsx19("span", { className: "awr-question__lead", children: leadOf(view.subagent, L) })
9537
9815
  ] }),
9538
- /* @__PURE__ */ jsx18("p", { className: "awr-question__text", id: textId, children: view.question }),
9539
- /* @__PURE__ */ jsx18("ul", { className: "awr-question__list", children: view.options.map((o) => /* @__PURE__ */ jsxs16("li", { children: [
9540
- /* @__PURE__ */ jsx18("span", { className: "awr-question__label", children: o.label }),
9541
- o.description && /* @__PURE__ */ jsx18("span", { className: "awr-question__desc", children: o.description })
9816
+ /* @__PURE__ */ jsx19("p", { className: "awr-question__text", id: textId, children: view.question }),
9817
+ /* @__PURE__ */ jsx19("ul", { className: "awr-question__list", children: view.options.map((o) => /* @__PURE__ */ jsxs16("li", { children: [
9818
+ /* @__PURE__ */ jsx19("span", { className: "awr-question__label", children: o.label }),
9819
+ o.description && /* @__PURE__ */ jsx19("span", { className: "awr-question__desc", children: o.description })
9542
9820
  ] }, o.label)) }),
9543
- /* @__PURE__ */ jsx18("p", { className: "awr-question__remote", role: "status", children: L.questionRemote })
9821
+ /* @__PURE__ */ jsx19("p", { className: "awr-question__remote", role: "status", children: L.questionRemote })
9544
9822
  ]
9545
9823
  }
9546
9824
  );
@@ -9569,7 +9847,7 @@ var QuestionPrompt = ({
9569
9847
  let card = null;
9570
9848
  if (current) {
9571
9849
  const answer = (a) => onAnswer(current.id, a);
9572
- const builtIn = /* @__PURE__ */ jsx18(
9850
+ const builtIn = /* @__PURE__ */ jsx19(
9573
9851
  QuestionCard,
9574
9852
  {
9575
9853
  question: current,
@@ -9594,13 +9872,13 @@ var QuestionPrompt = ({
9594
9872
  role: "status",
9595
9873
  "data-reason": o.reason ?? o.status,
9596
9874
  children: [
9597
- /* @__PURE__ */ jsx18(AlertIcon, { size: 14, className: "awr-question-outcome__icon" }),
9875
+ /* @__PURE__ */ jsx19(AlertIcon, { size: 14, className: "awr-question-outcome__icon" }),
9598
9876
  /* @__PURE__ */ jsxs16("span", { className: "awr-question-outcome__text", children: [
9599
9877
  L.questionAutomatic(reasonText2(o, L)),
9600
9878
  " ",
9601
- /* @__PURE__ */ jsx18("q", { className: "awr-question-outcome__question", children: o.question })
9879
+ /* @__PURE__ */ jsx19("q", { className: "awr-question-outcome__question", children: o.question })
9602
9880
  ] }),
9603
- /* @__PURE__ */ jsx18(
9881
+ /* @__PURE__ */ jsx19(
9604
9882
  "button",
9605
9883
  {
9606
9884
  type: "button",
@@ -9608,20 +9886,20 @@ var QuestionPrompt = ({
9608
9886
  "aria-label": L.questionDismiss,
9609
9887
  title: L.questionDismiss,
9610
9888
  onClick: () => setDismissed((d) => new Set(d).add(o.id)),
9611
- children: /* @__PURE__ */ jsx18(XIcon, { size: 14 })
9889
+ children: /* @__PURE__ */ jsx19(XIcon, { size: 14 })
9612
9890
  }
9613
9891
  )
9614
9892
  ]
9615
9893
  },
9616
9894
  o.id
9617
9895
  )),
9618
- remote.map((o) => /* @__PURE__ */ jsx18(RemoteQuestion, { view: o, L }, o.id)),
9896
+ remote.map((o) => /* @__PURE__ */ jsx19(RemoteQuestion, { view: o, L }, o.id)),
9619
9897
  card
9620
9898
  ] });
9621
9899
  };
9622
9900
 
9623
9901
  // src/components/ToolApprovalPrompt.tsx
9624
- import { jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
9902
+ import { jsx as jsx20, jsxs as jsxs17 } from "react/jsx-runtime";
9625
9903
  var SkillConsentCard = ({
9626
9904
  approval: a,
9627
9905
  skill,
@@ -9640,27 +9918,27 @@ var SkillConsentCard = ({
9640
9918
  "data-subagent": helper?.id,
9641
9919
  children: [
9642
9920
  /* @__PURE__ */ jsxs17("div", { className: "awr-approval__head", children: [
9643
- /* @__PURE__ */ jsx19(ShieldIcon, { size: 14, className: "awr-approval__icon" }),
9644
- /* @__PURE__ */ jsx19("span", { children: L.skillConsentLead(skill.server, skill.skill) })
9921
+ /* @__PURE__ */ jsx20(ShieldIcon, { size: 14, className: "awr-approval__icon" }),
9922
+ /* @__PURE__ */ jsx20("span", { children: L.skillConsentLead(skill.server, skill.skill) })
9645
9923
  ] }),
9646
- skill.description && /* @__PURE__ */ jsx19("p", { className: "awr-approval__quote", children: skill.description }),
9924
+ skill.description && /* @__PURE__ */ jsx20("p", { className: "awr-approval__quote", children: skill.description }),
9647
9925
  /* @__PURE__ */ jsxs17("p", { className: "awr-approval__skillmeta", children: [
9648
- /* @__PURE__ */ jsx19("code", { className: "awr-tool__name", children: skill.name }),
9649
- /* @__PURE__ */ jsx19("span", { children: L.skillConsentSize(skill.size, skill.fileCount) })
9926
+ /* @__PURE__ */ jsx20("code", { className: "awr-tool__name", children: skill.name }),
9927
+ /* @__PURE__ */ jsx20("span", { children: L.skillConsentSize(skill.size, skill.fileCount) })
9650
9928
  ] }),
9651
- skill.byUri && /* @__PURE__ */ jsx19("p", { className: "awr-approval__from", children: L.skillConsentByUri }),
9652
- skill.nestedIn && /* @__PURE__ */ jsx19("p", { className: "awr-approval__from awr-approval__nested", children: L.skillConsentNested(skill.nestedIn) }),
9653
- skill.dynamic && /* @__PURE__ */ jsx19("p", { className: "awr-approval__from awr-approval__dynamic", children: L.skillConsentDynamic }),
9654
- skill.dynamic && skill.noFileListing && /* @__PURE__ */ jsx19("p", { className: "awr-approval__from", children: L.skillConsentNoFileListing }),
9929
+ skill.byUri && /* @__PURE__ */ jsx20("p", { className: "awr-approval__from", children: L.skillConsentByUri }),
9930
+ skill.nestedIn && /* @__PURE__ */ jsx20("p", { className: "awr-approval__from awr-approval__nested", children: L.skillConsentNested(skill.nestedIn) }),
9931
+ skill.dynamic && /* @__PURE__ */ jsx20("p", { className: "awr-approval__from awr-approval__dynamic", children: L.skillConsentDynamic }),
9932
+ skill.dynamic && skill.noFileListing && /* @__PURE__ */ jsx20("p", { className: "awr-approval__from", children: L.skillConsentNoFileListing }),
9655
9933
  showPreview && skill.body !== void 0 && /* @__PURE__ */ jsxs17("details", { className: "awr-approval__preview", children: [
9656
- /* @__PURE__ */ jsx19("summary", { children: L.skillConsentPreview }),
9657
- /* @__PURE__ */ jsx19("pre", { className: "awr-approval__quote awr-approval__body", children: skill.body }),
9658
- skill.files.length > 0 && /* @__PURE__ */ jsx19("p", { className: "awr-approval__from", children: L.skillConsentFiles(skill.files.join(", "), skill.fileCount - skill.files.length) })
9934
+ /* @__PURE__ */ jsx20("summary", { children: L.skillConsentPreview }),
9935
+ /* @__PURE__ */ jsx20("pre", { className: "awr-approval__quote awr-approval__body", children: skill.body }),
9936
+ skill.files.length > 0 && /* @__PURE__ */ jsx20("p", { className: "awr-approval__from", children: L.skillConsentFiles(skill.files.join(", "), skill.fileCount - skill.files.length) })
9659
9937
  ] }),
9660
- /* @__PURE__ */ jsx19("p", { className: "awr-approval__from", children: L.skillConsentNote(skill.server, skill.consent) }),
9938
+ /* @__PURE__ */ jsx20("p", { className: "awr-approval__from", children: L.skillConsentNote(skill.server, skill.consent) }),
9661
9939
  /* @__PURE__ */ jsxs17("div", { className: "awr-approval__actions", children: [
9662
- /* @__PURE__ */ jsx19("button", { type: "button", className: "awr-btn awr-btn--primary", onClick: () => onApprove(a.id), children: L.skillConsentAllow }),
9663
- allowRemember && /* @__PURE__ */ jsx19(
9940
+ /* @__PURE__ */ jsx20("button", { type: "button", className: "awr-btn awr-btn--primary", onClick: () => onApprove(a.id), children: L.skillConsentAllow }),
9941
+ allowRemember && /* @__PURE__ */ jsx20(
9664
9942
  "button",
9665
9943
  {
9666
9944
  type: "button",
@@ -9669,7 +9947,7 @@ var SkillConsentCard = ({
9669
9947
  children: L.skillConsentAlways
9670
9948
  }
9671
9949
  ),
9672
- /* @__PURE__ */ jsx19(
9950
+ /* @__PURE__ */ jsx20(
9673
9951
  "button",
9674
9952
  {
9675
9953
  type: "button",
@@ -9695,9 +9973,9 @@ var ToolApprovalPrompt = ({
9695
9973
  }) => {
9696
9974
  const L = useLabels(labels);
9697
9975
  if (approvals.length === 0) return null;
9698
- return /* @__PURE__ */ jsx19("div", { className: ["awr-approvals", className].filter(Boolean).join(" "), role: "alert", children: approvals.map((a) => {
9976
+ return /* @__PURE__ */ jsx20("div", { className: ["awr-approvals", className].filter(Boolean).join(" "), role: "alert", children: approvals.map((a) => {
9699
9977
  if (a.skill) {
9700
- const card2 = /* @__PURE__ */ jsx19(
9978
+ const card2 = /* @__PURE__ */ jsx20(
9701
9979
  SkillConsentCard,
9702
9980
  {
9703
9981
  approval: a,
@@ -9711,7 +9989,7 @@ var ToolApprovalPrompt = ({
9711
9989
  },
9712
9990
  a.id
9713
9991
  );
9714
- return renderApproval ? /* @__PURE__ */ jsx19("div", { children: renderApproval(a, card2) }, a.id) : card2;
9992
+ return renderApproval ? /* @__PURE__ */ jsx20("div", { children: renderApproval(a, card2) }, a.id) : card2;
9715
9993
  }
9716
9994
  const helper = showHelper ? a.subagent : void 0;
9717
9995
  const app = a.app;
@@ -9723,21 +10001,21 @@ var ToolApprovalPrompt = ({
9723
10001
  "data-app-server": app?.server,
9724
10002
  children: [
9725
10003
  /* @__PURE__ */ jsxs17("div", { className: "awr-approval__head", children: [
9726
- /* @__PURE__ */ jsx19(ShieldIcon, { size: 14, className: "awr-approval__icon" }),
10004
+ /* @__PURE__ */ jsx20(ShieldIcon, { size: 14, className: "awr-approval__icon" }),
9727
10005
  /* @__PURE__ */ jsxs17("span", { children: [
9728
10006
  app ? L.approvalLeadApp(app.server) : helper ? L.approvalLeadHelper(
9729
10007
  previewValue(helper.role ?? "", 60) || void 0,
9730
10008
  helper.depth
9731
10009
  ) : L.approvalLead,
9732
10010
  " ",
9733
- /* @__PURE__ */ jsx19("code", { className: "awr-tool__name", children: app ? app.tool : a.name }),
10011
+ /* @__PURE__ */ jsx20("code", { className: "awr-tool__name", children: app ? app.tool : a.name }),
9734
10012
  a.readOnly && !app ? ` (${L.readOnlyTool})` : ""
9735
10013
  ] })
9736
10014
  ] }),
9737
- previewValue(a.input, 300) && /* @__PURE__ */ jsx19("pre", { className: "awr-approval__input", children: previewValue(a.input, 300) }),
9738
- app && /* @__PURE__ */ jsx19("p", { className: "awr-approval__from", children: L.approvalFromApp(app.server, a.readOnly) }),
10015
+ previewValue(a.input, 300) && /* @__PURE__ */ jsx20("pre", { className: "awr-approval__input", children: previewValue(a.input, 300) }),
10016
+ app && /* @__PURE__ */ jsx20("p", { className: "awr-approval__from", children: L.approvalFromApp(app.server, a.readOnly) }),
9739
10017
  /* @__PURE__ */ jsxs17("div", { className: "awr-approval__actions", children: [
9740
- /* @__PURE__ */ jsx19(
10018
+ /* @__PURE__ */ jsx20(
9741
10019
  "button",
9742
10020
  {
9743
10021
  type: "button",
@@ -9746,7 +10024,7 @@ var ToolApprovalPrompt = ({
9746
10024
  children: L.approve
9747
10025
  }
9748
10026
  ),
9749
- allowRemember && /* @__PURE__ */ jsx19(
10027
+ allowRemember && /* @__PURE__ */ jsx20(
9750
10028
  "button",
9751
10029
  {
9752
10030
  type: "button",
@@ -9755,7 +10033,7 @@ var ToolApprovalPrompt = ({
9755
10033
  children: L.alwaysAllow
9756
10034
  }
9757
10035
  ),
9758
- /* @__PURE__ */ jsx19(
10036
+ /* @__PURE__ */ jsx20(
9759
10037
  "button",
9760
10038
  {
9761
10039
  type: "button",
@@ -9769,7 +10047,7 @@ var ToolApprovalPrompt = ({
9769
10047
  },
9770
10048
  a.id
9771
10049
  );
9772
- return renderApproval ? /* @__PURE__ */ jsx19("div", { children: renderApproval(a, card) }, a.id) : card;
10050
+ return renderApproval ? /* @__PURE__ */ jsx20("div", { children: renderApproval(a, card) }, a.id) : card;
9773
10051
  }) });
9774
10052
  };
9775
10053
 
@@ -9813,7 +10091,7 @@ var UsageBadge = ({
9813
10091
  };
9814
10092
 
9815
10093
  // src/components/AgentChat.tsx
9816
- import { Fragment as Fragment13, jsx as jsx20, jsxs as jsxs19 } from "react/jsx-runtime";
10094
+ import { Fragment as Fragment13, jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
9817
10095
  var usePrefersDark = () => {
9818
10096
  const query = "(prefers-color-scheme: dark)";
9819
10097
  const [dark, setDark] = useState20(
@@ -9830,7 +10108,7 @@ var usePrefersDark = () => {
9830
10108
  };
9831
10109
  var isHistoryHook = (h) => typeof h === "object" && h !== null && "select" in h && "chats" in h;
9832
10110
  var cx = (...names) => names.filter(Boolean).join(" ");
9833
- var AgentChat = (props) => /* @__PURE__ */ jsx20(AgentLabelsProvider, { labels: props.labels ?? NO_LABELS, children: /* @__PURE__ */ jsx20(AgentChatInner, { ...props }) });
10111
+ var AgentChat = (props) => /* @__PURE__ */ jsx21(AgentLabelsProvider, { labels: props.labels ?? NO_LABELS, children: /* @__PURE__ */ jsx21(AgentChatInner, { ...props }) });
9834
10112
  var NO_LABELS = {};
9835
10113
  var AgentChatInner = ({
9836
10114
  controller,
@@ -9850,6 +10128,7 @@ var AgentChatInner = ({
9850
10128
  showSubagents = true,
9851
10129
  showMedia = true,
9852
10130
  showFileChips = true,
10131
+ showNamedFiles = showFileChips,
9853
10132
  htmlPreview,
9854
10133
  stoppableSubagents = true,
9855
10134
  showTotalUsage = true,
@@ -9922,7 +10201,7 @@ var AgentChatInner = ({
9922
10201
  labels: { voiceMessage: L.voiceMessage }
9923
10202
  });
9924
10203
  const chats = history ? external ?? own : void 0;
9925
- const rootRef = useRef14(null);
10204
+ const rootRef = useRef15(null);
9926
10205
  const [narrow, setNarrow] = useState20(void 0);
9927
10206
  useEffect20(() => {
9928
10207
  const el = rootRef.current;
@@ -9963,7 +10242,7 @@ var AgentChatInner = ({
9963
10242
  document.addEventListener("keydown", onKey);
9964
10243
  return () => document.removeEventListener("keydown", onKey);
9965
10244
  }, [overlayOpen]);
9966
- const bodyRef = useRef14(null);
10245
+ const bodyRef = useRef15(null);
9967
10246
  const appHost = useMcpAppHost({
9968
10247
  connection: mcpApps,
9969
10248
  approve: agent.approveAppToolCall,
@@ -9996,7 +10275,7 @@ var AgentChatInner = ({
9996
10275
  }
9997
10276
  }, [agent.messages, panelApp, onAppPanel]);
9998
10277
  const drawApp = (app, message) => {
9999
- const built = panelApp?.id === app.id ? /* @__PURE__ */ jsx20(
10278
+ const built = panelApp?.id === app.id ? /* @__PURE__ */ jsx21(
10000
10279
  McpAppLine,
10001
10280
  {
10002
10281
  app,
@@ -10004,7 +10283,7 @@ var AgentChatInner = ({
10004
10283
  action: L.appBringBack,
10005
10284
  onAction: () => setPanelApp(void 0)
10006
10285
  }
10007
- ) : /* @__PURE__ */ jsx20(
10286
+ ) : /* @__PURE__ */ jsx21(
10008
10287
  McpAppFrame,
10009
10288
  {
10010
10289
  app,
@@ -10017,7 +10296,7 @@ var AgentChatInner = ({
10017
10296
  );
10018
10297
  return renderApp ? renderApp(app, message, built) : built;
10019
10298
  };
10020
- const appPanelNode = appsOn && panelApp ? /* @__PURE__ */ jsx20(
10299
+ const appPanelNode = appsOn && panelApp ? /* @__PURE__ */ jsx21(
10021
10300
  McpAppFrame,
10022
10301
  {
10023
10302
  app: panelApp,
@@ -10053,16 +10332,16 @@ var AgentChatInner = ({
10053
10332
  const earlyDecisions = showDecisions ? agent.decisions ?? [] : [];
10054
10333
  const liveExtra = agent.planThought.trim() || showReplan || replanFailedEarly || earlyDecisions.length > 0 ? /* @__PURE__ */ jsxs19(Fragment13, { children: [
10055
10334
  agent.planThought.trim() && /* @__PURE__ */ jsxs19("details", { className: "awr-activity__plan", children: [
10056
- /* @__PURE__ */ jsx20("summary", { children: L.planned }),
10057
- /* @__PURE__ */ jsx20("p", { className: "awr-activity__thought", children: agent.planThought })
10335
+ /* @__PURE__ */ jsx21("summary", { children: L.planned }),
10336
+ /* @__PURE__ */ jsx21("p", { className: "awr-activity__thought", children: agent.planThought })
10058
10337
  ] }),
10059
- showReplan && /* @__PURE__ */ jsx20("div", { className: "awr-activity__replan", children: L.replanned(agent.replan.mode, agent.replan.reason) }),
10338
+ showReplan && /* @__PURE__ */ jsx21("div", { className: "awr-activity__replan", children: L.replanned(agent.replan.mode, agent.replan.reason) }),
10060
10339
  replanFailedEarly && /* @__PURE__ */ jsxs19("p", { className: "awr-step__warn", title: agent.replan.error, children: [
10061
- /* @__PURE__ */ jsx20(AlertIcon, { size: 12 }),
10340
+ /* @__PURE__ */ jsx21(AlertIcon, { size: 12 }),
10062
10341
  " ",
10063
10342
  L.replanFailed
10064
10343
  ] }),
10065
- earlyDecisions.map((d, i) => /* @__PURE__ */ jsx20(
10344
+ earlyDecisions.map((d, i) => /* @__PURE__ */ jsx21(
10066
10345
  "p",
10067
10346
  {
10068
10347
  className: `awr-step__decision${d.accepted ? "" : " awr-step__decision--fallback"}`,
@@ -10072,7 +10351,7 @@ var AgentChatInner = ({
10072
10351
  ))
10073
10352
  ] }) : void 0;
10074
10353
  const header = slots.header === false ? null : slots.header !== void 0 ? slots.header : /* @__PURE__ */ jsxs19("div", { className: cx("awr-chat__header", classNames.header), children: [
10075
- chats && /* @__PURE__ */ jsx20(
10354
+ chats && /* @__PURE__ */ jsx21(
10076
10355
  "button",
10077
10356
  {
10078
10357
  type: "button",
@@ -10081,17 +10360,17 @@ var AgentChatInner = ({
10081
10360
  title: L.showHistory,
10082
10361
  "aria-pressed": historyOpen,
10083
10362
  onClick: toggleHistory,
10084
- children: /* @__PURE__ */ jsx20(HistoryIcon, { size: 16 })
10363
+ children: /* @__PURE__ */ jsx21(HistoryIcon, { size: 16 })
10085
10364
  }
10086
10365
  ),
10087
10366
  slots.headerStart,
10088
- /* @__PURE__ */ jsx20("div", { className: "awr-chat__title", children: title }),
10367
+ /* @__PURE__ */ jsx21("div", { className: "awr-chat__title", children: title }),
10089
10368
  showStatus && /* @__PURE__ */ jsxs19("span", { className: `awr-status awr-status--${agent.status}`, title: L.status[agent.status], children: [
10090
- /* @__PURE__ */ jsx20("span", { className: "awr-status__dot" }),
10091
- /* @__PURE__ */ jsx20("span", { className: "awr-status__text", children: L.status[agent.status] })
10369
+ /* @__PURE__ */ jsx21("span", { className: "awr-status__dot" }),
10370
+ /* @__PURE__ */ jsx21("span", { className: "awr-status__text", children: L.status[agent.status] })
10092
10371
  ] }),
10093
- showTotalUsage && /* @__PURE__ */ jsx20("span", { title: L.totalUsage, children: /* @__PURE__ */ jsx20(UsageBadge, { usage: agent.totalUsage, compact: narrow !== false }) }),
10094
- files && /* @__PURE__ */ jsx20(
10372
+ showTotalUsage && /* @__PURE__ */ jsx21("span", { title: L.totalUsage, children: /* @__PURE__ */ jsx21(UsageBadge, { usage: agent.totalUsage, compact: narrow !== false }) }),
10373
+ files && /* @__PURE__ */ jsx21(
10095
10374
  "button",
10096
10375
  {
10097
10376
  type: "button",
@@ -10100,7 +10379,7 @@ var AgentChatInner = ({
10100
10379
  title: L.showFiles,
10101
10380
  "aria-pressed": filesOpen,
10102
10381
  onClick: toggleFiles,
10103
- children: /* @__PURE__ */ jsx20(FileIcon, { size: 16 })
10382
+ children: /* @__PURE__ */ jsx21(FileIcon, { size: 16 })
10104
10383
  }
10105
10384
  ),
10106
10385
  slots.headerEnd
@@ -10113,7 +10392,7 @@ var AgentChatInner = ({
10113
10392
  style,
10114
10393
  "data-awr-theme": theme === "auto" ? void 0 : theme,
10115
10394
  children: [
10116
- overlayOpen && /* @__PURE__ */ jsx20(
10395
+ overlayOpen && /* @__PURE__ */ jsx21(
10117
10396
  "div",
10118
10397
  {
10119
10398
  className: cx("awr-chat__scrim", classNames.scrim),
@@ -10122,7 +10401,7 @@ var AgentChatInner = ({
10122
10401
  }
10123
10402
  ),
10124
10403
  chats && historyOpen && /* @__PURE__ */ jsxs19("aside", { className: cx("awr-chat__sidebar", classNames.sidebar), children: [
10125
- /* @__PURE__ */ jsx20(
10404
+ /* @__PURE__ */ jsx21(
10126
10405
  HistoryList,
10127
10406
  {
10128
10407
  history: {
@@ -10141,7 +10420,7 @@ var AgentChatInner = ({
10141
10420
  }
10142
10421
  ),
10143
10422
  slots.sidebar,
10144
- /* @__PURE__ */ jsx20(
10423
+ /* @__PURE__ */ jsx21(
10145
10424
  "button",
10146
10425
  {
10147
10426
  type: "button",
@@ -10156,7 +10435,7 @@ var AgentChatInner = ({
10156
10435
  header,
10157
10436
  /* @__PURE__ */ jsxs19("div", { className: cx("awr-chat__body", classNames.body), ref: bodyRef, children: [
10158
10437
  slots.beforeMessages,
10159
- /* @__PURE__ */ jsx20(
10438
+ /* @__PURE__ */ jsx21(
10160
10439
  Messages,
10161
10440
  {
10162
10441
  messages: agent.messages,
@@ -10174,6 +10453,7 @@ var AgentChatInner = ({
10174
10453
  showSubagents,
10175
10454
  showMedia,
10176
10455
  showFileChips,
10456
+ showNamedFiles,
10177
10457
  files,
10178
10458
  htmlPreview,
10179
10459
  onShowFiles: files ? showFiles : void 0,
@@ -10197,7 +10477,7 @@ var AgentChatInner = ({
10197
10477
  renderImageViewer
10198
10478
  }
10199
10479
  ),
10200
- /* @__PURE__ */ jsx20(
10480
+ /* @__PURE__ */ jsx21(
10201
10481
  Approvals,
10202
10482
  {
10203
10483
  approvals: agent.pendingApprovals,
@@ -10207,7 +10487,7 @@ var AgentChatInner = ({
10207
10487
  renderApproval
10208
10488
  }
10209
10489
  ),
10210
- showQuestions && /* @__PURE__ */ jsx20(
10490
+ showQuestions && /* @__PURE__ */ jsx21(
10211
10491
  Questions,
10212
10492
  {
10213
10493
  questions: agent.pendingQuestions ?? [],
@@ -10216,7 +10496,7 @@ var AgentChatInner = ({
10216
10496
  renderQuestion
10217
10497
  }
10218
10498
  ),
10219
- appsOn && /* @__PURE__ */ jsx20(
10499
+ appsOn && /* @__PURE__ */ jsx21(
10220
10500
  AppRequestPrompt,
10221
10501
  {
10222
10502
  requests: appHost.requests,
@@ -10224,7 +10504,7 @@ var AgentChatInner = ({
10224
10504
  renderRequest: renderAppRequest
10225
10505
  }
10226
10506
  ),
10227
- showElicitation && elicitations && onElicitationAnswer && /* @__PURE__ */ jsx20(
10507
+ showElicitation && elicitations && onElicitationAnswer && /* @__PURE__ */ jsx21(
10228
10508
  Elicitations,
10229
10509
  {
10230
10510
  elicitations,
@@ -10233,13 +10513,13 @@ var AgentChatInner = ({
10233
10513
  renderElicitation
10234
10514
  }
10235
10515
  ),
10236
- agent.modelLoad && loading && /* @__PURE__ */ jsx20(ModelLoadBar, { load: agent.modelLoad }),
10516
+ agent.modelLoad && loading && /* @__PURE__ */ jsx21(ModelLoadBar, { load: agent.modelLoad }),
10237
10517
  slots.afterMessages
10238
10518
  ] }),
10239
10519
  /* @__PURE__ */ jsxs19("div", { className: cx("awr-chat__footer", classNames.footer), children: [
10240
10520
  slots.footerStart,
10241
- tabNotes.length > 0 && /* @__PURE__ */ jsx20("div", { className: "awr-tabnote", role: "status", children: tabNotes.map((text) => /* @__PURE__ */ jsx20("p", { className: "awr-tabnote__text", children: text }, text)) }),
10242
- showContext !== false && /* @__PURE__ */ jsx20(
10521
+ tabNotes.length > 0 && /* @__PURE__ */ jsx21("div", { className: "awr-tabnote", role: "status", children: tabNotes.map((text) => /* @__PURE__ */ jsx21("p", { className: "awr-tabnote__text", children: text }, text)) }),
10522
+ showContext !== false && /* @__PURE__ */ jsx21(
10243
10523
  ContextMeter,
10244
10524
  {
10245
10525
  usage: agent.usage,
@@ -10251,10 +10531,10 @@ var AgentChatInner = ({
10251
10531
  }
10252
10532
  ),
10253
10533
  composer === false ? agent.error && agent.status === "error" && /* @__PURE__ */ jsxs19("div", { className: "awr-chat__error", children: [
10254
- /* @__PURE__ */ jsx20(AlertIcon, { size: 14 }),
10534
+ /* @__PURE__ */ jsx21(AlertIcon, { size: 14 }),
10255
10535
  " ",
10256
10536
  agent.error
10257
- ] }) : /* @__PURE__ */ jsx20(
10537
+ ] }) : /* @__PURE__ */ jsx21(
10258
10538
  Composer2,
10259
10539
  {
10260
10540
  controller: agent,
@@ -10271,7 +10551,7 @@ var AgentChatInner = ({
10271
10551
  appPanelNode && (panelTarget ? (
10272
10552
  // Outside the chat: the theme tokens come with it.
10273
10553
  createPortal2(
10274
- /* @__PURE__ */ jsx20(
10554
+ /* @__PURE__ */ jsx21(
10275
10555
  "div",
10276
10556
  {
10277
10557
  className: "awr-theme awr-apppanel",
@@ -10282,7 +10562,7 @@ var AgentChatInner = ({
10282
10562
  panelTarget
10283
10563
  )
10284
10564
  ) : asSheet ? /* @__PURE__ */ jsxs19(Fragment13, { children: [
10285
- /* @__PURE__ */ jsx20("div", { className: "awr-sheet__scrim", onClick: () => setPanelApp(void 0) }),
10565
+ /* @__PURE__ */ jsx21("div", { className: "awr-sheet__scrim", onClick: () => setPanelApp(void 0) }),
10286
10566
  /* @__PURE__ */ jsxs19(
10287
10567
  "aside",
10288
10568
  {
@@ -10290,15 +10570,15 @@ var AgentChatInner = ({
10290
10570
  role: "dialog",
10291
10571
  "aria-label": L.appFrom(panelApp.server),
10292
10572
  children: [
10293
- /* @__PURE__ */ jsx20("div", { className: "awr-sheet__grab" }),
10573
+ /* @__PURE__ */ jsx21("div", { className: "awr-sheet__grab" }),
10294
10574
  appPanelNode
10295
10575
  ]
10296
10576
  }
10297
10577
  )
10298
- ] }) : /* @__PURE__ */ jsx20("aside", { className: "awr-chat__apppanel", children: appPanelNode })),
10578
+ ] }) : /* @__PURE__ */ jsx21("aside", { className: "awr-chat__apppanel", children: appPanelNode })),
10299
10579
  files && filesOpen && /* @__PURE__ */ jsxs19("aside", { className: cx("awr-chat__files", classNames.files), children: [
10300
- /* @__PURE__ */ jsx20(ImageViewerProvider, { enabled: imageViewer, render: renderImageViewer, children: /* @__PURE__ */ jsx20(Files, { files }) }),
10301
- /* @__PURE__ */ jsx20(
10580
+ /* @__PURE__ */ jsx21(ImageViewerProvider, { enabled: imageViewer, render: renderImageViewer, children: /* @__PURE__ */ jsx21(Files, { files }) }),
10581
+ /* @__PURE__ */ jsx21(
10302
10582
  "button",
10303
10583
  {
10304
10584
  type: "button",
@@ -10315,7 +10595,7 @@ var AgentChatInner = ({
10315
10595
  };
10316
10596
 
10317
10597
  // src/components/LearnedSkills.tsx
10318
- import { jsx as jsx21, jsxs as jsxs20 } from "react/jsx-runtime";
10598
+ import { jsx as jsx22, jsxs as jsxs20 } from "react/jsx-runtime";
10319
10599
  var LearnedSkills = ({
10320
10600
  controller,
10321
10601
  lessons,
@@ -10333,16 +10613,16 @@ var LearnedSkills = ({
10333
10613
  const forget = onForget === false ? void 0 : onForget ?? c?.forgetSkill;
10334
10614
  return /* @__PURE__ */ jsxs20("section", { className: ["awr-notebook", className].filter(Boolean).join(" "), children: [
10335
10615
  !hideTitle && /* @__PURE__ */ jsxs20("h3", { className: "awr-notebook__title", children: [
10336
- /* @__PURE__ */ jsx21(BookIcon, { size: 14 }),
10616
+ /* @__PURE__ */ jsx22(BookIcon, { size: 14 }),
10337
10617
  " ",
10338
10618
  L.notebookTitle,
10339
- list.length > 0 && /* @__PURE__ */ jsx21("span", { className: "awr-notebook__count", children: list.length })
10619
+ list.length > 0 && /* @__PURE__ */ jsx22("span", { className: "awr-notebook__count", children: list.length })
10340
10620
  ] }),
10341
- list.length === 0 ? /* @__PURE__ */ jsx21("p", { className: "awr-notebook__empty", children: empty ?? L.notebookEmpty }) : /* @__PURE__ */ jsx21("ul", { className: "awr-notebook__list", children: list.map((l) => /* @__PURE__ */ jsxs20("li", { className: "awr-lesson", children: [
10621
+ list.length === 0 ? /* @__PURE__ */ jsx22("p", { className: "awr-notebook__empty", children: empty ?? L.notebookEmpty }) : /* @__PURE__ */ jsx22("ul", { className: "awr-notebook__list", children: list.map((l) => /* @__PURE__ */ jsxs20("li", { className: "awr-lesson", children: [
10342
10622
  /* @__PURE__ */ jsxs20("div", { className: "awr-lesson__head", children: [
10343
- /* @__PURE__ */ jsx21("code", { className: "awr-lesson__name", children: l.name }),
10344
- l.revision > 1 && /* @__PURE__ */ jsx21("span", { className: "awr-lesson__rev", children: L.notebookRevision(l.revision) }),
10345
- forget && /* @__PURE__ */ jsx21(
10623
+ /* @__PURE__ */ jsx22("code", { className: "awr-lesson__name", children: l.name }),
10624
+ l.revision > 1 && /* @__PURE__ */ jsx22("span", { className: "awr-lesson__rev", children: L.notebookRevision(l.revision) }),
10625
+ forget && /* @__PURE__ */ jsx22(
10346
10626
  "button",
10347
10627
  {
10348
10628
  type: "button",
@@ -10350,11 +10630,11 @@ var LearnedSkills = ({
10350
10630
  title: `${L.notebookForget}: ${l.name}`,
10351
10631
  "aria-label": `${L.notebookForget}: ${l.name}`,
10352
10632
  onClick: () => void forget(l.name),
10353
- children: /* @__PURE__ */ jsx21(XIcon, { size: 12 })
10633
+ children: /* @__PURE__ */ jsx22(XIcon, { size: 12 })
10354
10634
  }
10355
10635
  )
10356
10636
  ] }),
10357
- /* @__PURE__ */ jsx21("p", { className: "awr-lesson__when", children: l.description }),
10637
+ /* @__PURE__ */ jsx22("p", { className: "awr-lesson__when", children: l.description }),
10358
10638
  showSources && l.sources.length > 0 && /* @__PURE__ */ jsxs20("p", { className: "awr-lesson__from", children: [
10359
10639
  L.notebookFrom,
10360
10640
  " ",
@@ -10366,7 +10646,7 @@ var LearnedSkills = ({
10366
10646
 
10367
10647
  // src/components/MemoryCard.tsx
10368
10648
  import { useState as useState21 } from "react";
10369
- import { jsx as jsx22, jsxs as jsxs21 } from "react/jsx-runtime";
10649
+ import { jsx as jsx23, jsxs as jsxs21 } from "react/jsx-runtime";
10370
10650
  var MemoryCard = ({
10371
10651
  kind,
10372
10652
  text,
@@ -10391,13 +10671,13 @@ var MemoryCard = ({
10391
10671
  className: ["awr-memory", `awr-memory--${kind}`, undone ? "is-undone" : "", className].filter(Boolean).join(" "),
10392
10672
  "data-memory": kind,
10393
10673
  children: [
10394
- /* @__PURE__ */ jsx22(BookmarkIcon, { size: 14, className: "awr-memory__icon" }),
10674
+ /* @__PURE__ */ jsx23(BookmarkIcon, { size: 14, className: "awr-memory__icon" }),
10395
10675
  /* @__PURE__ */ jsxs21("div", { className: "awr-memory__body", children: [
10396
- /* @__PURE__ */ jsx22("span", { className: "awr-memory__label", children: label }),
10397
- /* @__PURE__ */ jsx22("span", { className: "awr-memory__text", children: text }),
10398
- problem && /* @__PURE__ */ jsx22("span", { className: "awr-memory__problem", role: "alert", children: problem })
10676
+ /* @__PURE__ */ jsx23("span", { className: "awr-memory__label", children: label }),
10677
+ /* @__PURE__ */ jsx23("span", { className: "awr-memory__text", children: text }),
10678
+ problem && /* @__PURE__ */ jsx23("span", { className: "awr-memory__problem", role: "alert", children: problem })
10399
10679
  ] }),
10400
- undone ? /* @__PURE__ */ jsx22("span", { className: "awr-memory__undone", children: L.memoryUndone }) : onUndo ? /* @__PURE__ */ jsx22(
10680
+ undone ? /* @__PURE__ */ jsx23("span", { className: "awr-memory__undone", children: L.memoryUndone }) : onUndo ? /* @__PURE__ */ jsx23(
10401
10681
  "button",
10402
10682
  {
10403
10683
  type: "button",
@@ -10416,7 +10696,7 @@ var MemoryCard = ({
10416
10696
 
10417
10697
  // src/components/Composer.tsx
10418
10698
  import { useState as useState22 } from "react";
10419
- import { jsx as jsx23, jsxs as jsxs22 } from "react/jsx-runtime";
10699
+ import { jsx as jsx24, jsxs as jsxs22 } from "react/jsx-runtime";
10420
10700
  var Composer = ({
10421
10701
  onSubmit,
10422
10702
  busy = false,
@@ -10447,7 +10727,7 @@ var Composer = ({
10447
10727
  submit();
10448
10728
  },
10449
10729
  children: [
10450
- /* @__PURE__ */ jsx23(
10730
+ /* @__PURE__ */ jsx24(
10451
10731
  "textarea",
10452
10732
  {
10453
10733
  className: "awr-composer__input",
@@ -10459,23 +10739,23 @@ var Composer = ({
10459
10739
  rows: 1
10460
10740
  }
10461
10741
  ),
10462
- busy ? /* @__PURE__ */ jsx23(
10742
+ busy ? /* @__PURE__ */ jsx24(
10463
10743
  "button",
10464
10744
  {
10465
10745
  type: "button",
10466
10746
  className: "awr-composer__btn awr-composer__btn--stop",
10467
10747
  onClick: onStop,
10468
10748
  "aria-label": "Stop",
10469
- children: /* @__PURE__ */ jsx23(StopIcon, { size: 18 })
10749
+ children: /* @__PURE__ */ jsx24(StopIcon, { size: 18 })
10470
10750
  }
10471
- ) : /* @__PURE__ */ jsx23(
10751
+ ) : /* @__PURE__ */ jsx24(
10472
10752
  "button",
10473
10753
  {
10474
10754
  type: "submit",
10475
10755
  className: "awr-composer__btn",
10476
10756
  disabled: disabled || !text.trim(),
10477
10757
  "aria-label": "Send",
10478
- children: disabled ? /* @__PURE__ */ jsx23(SpinnerIcon, { size: 18 }) : /* @__PURE__ */ jsx23(SendIcon, { size: 18 })
10758
+ children: disabled ? /* @__PURE__ */ jsx24(SpinnerIcon, { size: 18 }) : /* @__PURE__ */ jsx24(SendIcon, { size: 18 })
10479
10759
  }
10480
10760
  )
10481
10761
  ]
@@ -10484,17 +10764,17 @@ var Composer = ({
10484
10764
  };
10485
10765
 
10486
10766
  // src/components/PlanView.tsx
10487
- import { jsx as jsx24, jsxs as jsxs23 } from "react/jsx-runtime";
10767
+ import { jsx as jsx25, jsxs as jsxs23 } from "react/jsx-runtime";
10488
10768
  var PlanView = ({ plan, showThought = true, className }) => {
10489
10769
  if (!plan.steps.length && !plan.thought) return null;
10490
10770
  return /* @__PURE__ */ jsxs23("div", { className: ["awr-plan", className].filter(Boolean).join(" "), children: [
10491
- showThought && plan.thought.trim() && /* @__PURE__ */ jsx24("p", { className: "awr-plan__thought", children: plan.thought }),
10492
- plan.steps.length > 0 && /* @__PURE__ */ jsx24("ol", { className: "awr-plan__steps", children: plan.steps.map((step) => /* @__PURE__ */ jsx24("li", { className: "awr-plan__step", children: step.description }, step.id)) })
10771
+ showThought && plan.thought.trim() && /* @__PURE__ */ jsx25("p", { className: "awr-plan__thought", children: plan.thought }),
10772
+ plan.steps.length > 0 && /* @__PURE__ */ jsx25("ol", { className: "awr-plan__steps", children: plan.steps.map((step) => /* @__PURE__ */ jsx25("li", { className: "awr-plan__step", children: step.description }, step.id)) })
10493
10773
  ] });
10494
10774
  };
10495
10775
 
10496
10776
  // src/components/ApprovalModeSwitch.tsx
10497
- import { jsx as jsx25 } from "react/jsx-runtime";
10777
+ import { jsx as jsx26 } from "react/jsx-runtime";
10498
10778
  var DEFAULT_LABELS = {
10499
10779
  autopilot: "Autopilot",
10500
10780
  "ask-writes": "Ask before changes",
@@ -10514,13 +10794,13 @@ var ApprovalModeSwitch = ({
10514
10794
  labels,
10515
10795
  disabled,
10516
10796
  className
10517
- }) => /* @__PURE__ */ jsx25(
10797
+ }) => /* @__PURE__ */ jsx26(
10518
10798
  "div",
10519
10799
  {
10520
10800
  className: ["awr-modeswitch", className].filter(Boolean).join(" "),
10521
10801
  role: "radiogroup",
10522
10802
  "aria-label": "Tool consent",
10523
- children: modes.map((m) => /* @__PURE__ */ jsx25(
10803
+ children: modes.map((m) => /* @__PURE__ */ jsx26(
10524
10804
  "button",
10525
10805
  {
10526
10806
  type: "button",
@@ -10539,7 +10819,7 @@ var ApprovalModeSwitch = ({
10539
10819
 
10540
10820
  // src/components/ApiKeyForm.tsx
10541
10821
  import { useEffect as useEffect21, useState as useState23 } from "react";
10542
- import { jsx as jsx26, jsxs as jsxs24 } from "react/jsx-runtime";
10822
+ import { jsx as jsx27, jsxs as jsxs24 } from "react/jsx-runtime";
10543
10823
  var ApiKeyForm = ({
10544
10824
  credentials,
10545
10825
  credentialRef,
@@ -10587,12 +10867,12 @@ var ApiKeyForm = ({
10587
10867
  /* @__PURE__ */ jsxs24("label", { className: "awr-keyform__label", children: [
10588
10868
  label,
10589
10869
  present && /* @__PURE__ */ jsxs24("span", { className: "awr-keyform__saved", children: [
10590
- /* @__PURE__ */ jsx26(CheckIcon, { size: 12 }),
10870
+ /* @__PURE__ */ jsx27(CheckIcon, { size: 12 }),
10591
10871
  " stored, encrypted"
10592
10872
  ] })
10593
10873
  ] }),
10594
10874
  /* @__PURE__ */ jsxs24("div", { className: "awr-keyform__row", children: [
10595
- /* @__PURE__ */ jsx26(
10875
+ /* @__PURE__ */ jsx27(
10596
10876
  "input",
10597
10877
  {
10598
10878
  className: "awr-keyform__input",
@@ -10610,7 +10890,7 @@ var ApiKeyForm = ({
10610
10890
  disabled: busy
10611
10891
  }
10612
10892
  ),
10613
- /* @__PURE__ */ jsx26(
10893
+ /* @__PURE__ */ jsx27(
10614
10894
  "button",
10615
10895
  {
10616
10896
  type: "button",
@@ -10620,7 +10900,7 @@ var ApiKeyForm = ({
10620
10900
  children: "Save"
10621
10901
  }
10622
10902
  ),
10623
- present && /* @__PURE__ */ jsx26(
10903
+ present && /* @__PURE__ */ jsx27(
10624
10904
  "button",
10625
10905
  {
10626
10906
  type: "button",
@@ -10724,6 +11004,7 @@ export {
10724
11004
  MCP_APP_SANDBOX_RESOURCE_READY,
10725
11005
  MCP_APP_SANDBOX_SERVER,
10726
11006
  MCP_APP_SANDBOX_TIMEOUT_MS,
11007
+ MCP_APP_SCHEME_PARAM,
10727
11008
  McpAppBridge,
10728
11009
  McpAppFrame,
10729
11010
  McpAppLine,
@@ -10736,6 +11017,10 @@ export {
10736
11017
  MessageList,
10737
11018
  MicError,
10738
11019
  ModelLoadBar,
11020
+ NAMED_FILES_MAX,
11021
+ NAMED_FILES_SCAN_MAX,
11022
+ NAMED_FILES_TEXT_MAX,
11023
+ NamedFileChips,
10739
11024
  PlanView,
10740
11025
  QUESTION_TIMEOUT_MS,
10741
11026
  QuestionPrompt,
@@ -10823,6 +11108,7 @@ export {
10823
11108
  linkedFilesOf,
10824
11109
  loadSkillFromUrl,
10825
11110
  markReadOnly,
11111
+ mcpAppColorScheme,
10826
11112
  mcpAppCsp,
10827
11113
  mcpAppHostCapabilities,
10828
11114
  mcpAppPolicyToken,
@@ -10837,11 +11123,13 @@ export {
10837
11123
  messageOverLimit,
10838
11124
  micProblemOf,
10839
11125
  micProblemText,
11126
+ namedFilesOf,
10840
11127
  newChatId,
10841
11128
  noticesOf,
10842
11129
  onStorageChange,
10843
11130
  parseSkillMarkdown,
10844
11131
  parseSlash,
11132
+ pathsNamedIn,
10845
11133
  pendingApprovalsOf,
10846
11134
  pickRecordingType,
10847
11135
  postStorageChange2 as postStorageChange,
@@ -10895,6 +11183,7 @@ export {
10895
11183
  withAttachments,
10896
11184
  withCspFirst,
10897
11185
  withPolicyFirst,
10898
- withoutOwnWords
11186
+ withoutOwnWords,
11187
+ workspacePathOf
10899
11188
  };
10900
11189
  //# sourceMappingURL=index.js.map