@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.cjs CHANGED
@@ -87,6 +87,7 @@ __export(src_exports, {
87
87
  MCP_APP_SANDBOX_RESOURCE_READY: () => MCP_APP_SANDBOX_RESOURCE_READY,
88
88
  MCP_APP_SANDBOX_SERVER: () => MCP_APP_SANDBOX_SERVER,
89
89
  MCP_APP_SANDBOX_TIMEOUT_MS: () => MCP_APP_SANDBOX_TIMEOUT_MS,
90
+ MCP_APP_SCHEME_PARAM: () => MCP_APP_SCHEME_PARAM,
90
91
  McpAppBridge: () => McpAppBridge,
91
92
  McpAppFrame: () => McpAppFrame,
92
93
  McpAppLine: () => McpAppLine,
@@ -99,6 +100,10 @@ __export(src_exports, {
99
100
  MessageList: () => MessageList,
100
101
  MicError: () => MicError,
101
102
  ModelLoadBar: () => ModelLoadBar,
103
+ NAMED_FILES_MAX: () => NAMED_FILES_MAX,
104
+ NAMED_FILES_SCAN_MAX: () => NAMED_FILES_SCAN_MAX,
105
+ NAMED_FILES_TEXT_MAX: () => NAMED_FILES_TEXT_MAX,
106
+ NamedFileChips: () => NamedFileChips,
102
107
  PlanView: () => PlanView,
103
108
  QUESTION_TIMEOUT_MS: () => QUESTION_TIMEOUT_MS,
104
109
  QuestionPrompt: () => QuestionPrompt,
@@ -186,6 +191,7 @@ __export(src_exports, {
186
191
  linkedFilesOf: () => linkedFilesOf,
187
192
  loadSkillFromUrl: () => import_agent_web8.loadSkillFromUrl,
188
193
  markReadOnly: () => import_agent_web8.markReadOnly,
194
+ mcpAppColorScheme: () => mcpAppColorScheme,
189
195
  mcpAppCsp: () => mcpAppCsp,
190
196
  mcpAppHostCapabilities: () => mcpAppHostCapabilities,
191
197
  mcpAppPolicyToken: () => mcpAppPolicyToken,
@@ -200,11 +206,13 @@ __export(src_exports, {
200
206
  messageOverLimit: () => messageOverLimit,
201
207
  micProblemOf: () => micProblemOf,
202
208
  micProblemText: () => micProblemText,
209
+ namedFilesOf: () => namedFilesOf,
203
210
  newChatId: () => newChatId,
204
211
  noticesOf: () => noticesOf,
205
212
  onStorageChange: () => import_agent_web8.onStorageChange,
206
213
  parseSkillMarkdown: () => import_agent_web8.parseSkillMarkdown,
207
214
  parseSlash: () => parseSlash,
215
+ pathsNamedIn: () => pathsNamedIn,
208
216
  pendingApprovalsOf: () => pendingApprovalsOf,
209
217
  pickRecordingType: () => pickRecordingType,
210
218
  postStorageChange: () => import_agent_web8.postStorageChange,
@@ -258,7 +266,8 @@ __export(src_exports, {
258
266
  withAttachments: () => withAttachments,
259
267
  withCspFirst: () => withCspFirst,
260
268
  withPolicyFirst: () => withPolicyFirst,
261
- withoutOwnWords: () => withoutOwnWords
269
+ withoutOwnWords: () => withoutOwnWords,
270
+ workspacePathOf: () => workspacePathOf
262
271
  });
263
272
  module.exports = __toCommonJS(src_exports);
264
273
 
@@ -3912,6 +3921,7 @@ var defaultLabels = {
3912
3921
  dictate: "Dictate (speech to text)",
3913
3922
  dictateTitle: "Dictate \u2014 speech to text in the browser",
3914
3923
  stopDictation: "Stop dictation",
3924
+ micListening: "Listening \u2014 tap to finish",
3915
3925
  microphone: "Microphone",
3916
3926
  transcribing: "Transcribing\u2026",
3917
3927
  micDenied: "The microphone is blocked for this site. Allow it in the browser's site settings (the icon beside the address), then try again.",
@@ -4061,6 +4071,7 @@ var defaultLabels = {
4061
4071
  readAloudCode: "A code block is not read out.",
4062
4072
  readAloudFailed: "It could not be read aloud.",
4063
4073
  filesWritten: (n) => `${plural(n, "file", "files")} written in this turn`,
4074
+ filesNamed: (n) => `${plural(n, "file", "files")} in this answer`,
4064
4075
  filesCount: (n) => plural(n, "file", "files"),
4065
4076
  showInFiles: "Show in Files",
4066
4077
  fileKinds: {
@@ -4635,7 +4646,7 @@ var formatCountdown = (ms) => {
4635
4646
  };
4636
4647
 
4637
4648
  // src/components/AgentChat.tsx
4638
- var import_react25 = require("react");
4649
+ var import_react26 = require("react");
4639
4650
  var import_react_dom2 = require("react-dom");
4640
4651
 
4641
4652
  // src/hooks/use-follow-scroll.ts
@@ -4870,11 +4881,13 @@ var tokenizeHtml = (source) => {
4870
4881
  var MCP_APP_SANDBOX_PROXY_READY = "ui/notifications/sandbox-proxy-ready";
4871
4882
  var MCP_APP_SANDBOX_RESOURCE_READY = "ui/notifications/sandbox-resource-ready";
4872
4883
  var isMcpAppSandboxMessage = (data) => typeof data === "object" && data !== null && typeof data.method === "string" && data.method.startsWith("ui/notifications/sandbox-");
4884
+ var MCP_APP_SCHEME_PARAM = "scheme";
4885
+ var mcpAppColorScheme = (value) => value === "light" || value === "dark" ? value : void 0;
4873
4886
  var mcpAppPolicy = ({ connect, resources }) => {
4874
4887
  const from = resources.length > 0 ? ` ${resources.join(" ")}` : "";
4875
4888
  return [
4876
4889
  "default-src 'none'",
4877
- `script-src 'unsafe-inline'${from}`,
4890
+ `script-src 'unsafe-inline' 'wasm-unsafe-eval'${from}`,
4878
4891
  `style-src 'unsafe-inline'${from}`,
4879
4892
  `img-src data: blob:${from}`,
4880
4893
  `font-src data:${from}`,
@@ -4932,9 +4945,13 @@ var grantedAppCsp = (csp) => ({
4932
4945
  resourceDomains: origins(csp?.resourceDomains)
4933
4946
  });
4934
4947
  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,'*')}})})()";
4935
- var buildMcpAppDocument = (html, csp) => {
4948
+ var schemeMeta = (scheme) => scheme ? `<meta name="color-scheme" content="${scheme}">` : "";
4949
+ var schemeCss = (scheme) => scheme ? `:root{color-scheme:${scheme}}` : "";
4950
+ var schemeOfFrame = (scheme) => scheme ? `;color-scheme:${scheme}` : "";
4951
+ var buildMcpAppDocument = (html, csp, scheme) => {
4936
4952
  const policy = mcpAppCsp(csp);
4937
- 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>`;
4953
+ const s = mcpAppColorScheme(scheme);
4954
+ 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>`;
4938
4955
  };
4939
4956
  var appLinkOf = (value) => {
4940
4957
  if (typeof value !== "string" || value.length > MCP_APP_MAX_URL_CHARS) return void 0;
@@ -5553,9 +5570,11 @@ var mcpAppSandboxShellCsp = (proxyUrl) => [
5553
5570
  "form-action 'none'",
5554
5571
  "base-uri 'none'"
5555
5572
  ].join("; ");
5556
- var buildMcpAppSandboxShell = (proxyUrl) => {
5573
+ var buildMcpAppSandboxShell = (proxyUrl, scheme) => {
5557
5574
  if (!PROXY_URL.test(proxyUrl)) throw new Error("not a sandbox proxy URL");
5558
- 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>`;
5575
+ const s = mcpAppColorScheme(scheme);
5576
+ const src = s ? `${proxyUrl}?${MCP_APP_SCHEME_PARAM}=${s}` : proxyUrl;
5577
+ 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>`;
5559
5578
  };
5560
5579
  var McpAppSandboxLink = class {
5561
5580
  o;
@@ -6202,10 +6221,14 @@ var McpAppFrame = ({
6202
6221
  if (!url) return { mode: "opaque", reason: "too-many-origins" };
6203
6222
  return { mode: "origin", origin: target.origin, url };
6204
6223
  }, [resource, sandboxUrl, fallback, app.server, reload]);
6205
- const doc = (0, import_react14.useMemo)(
6206
- () => !resource || !placement ? void 0 : placement.mode === "origin" ? buildMcpAppSandboxShell(placement.url) : buildMcpAppDocument(resource.html, resource.csp),
6207
- [resource, placement]
6208
- );
6224
+ const { doc, scheme } = (0, import_react14.useMemo)(() => {
6225
+ const scheme2 = themeRef.current === "dark" ? "dark" : "light";
6226
+ if (!resource || !placement) return { scheme: scheme2 };
6227
+ return {
6228
+ scheme: scheme2,
6229
+ doc: placement.mode === "origin" ? buildMcpAppSandboxShell(placement.url, scheme2) : buildMcpAppDocument(resource.html, resource.csp, scheme2)
6230
+ };
6231
+ }, [resource, placement]);
6209
6232
  (0, import_react14.useEffect)(() => {
6210
6233
  const reason = placement?.mode === "opaque" ? placement.reason : void 0;
6211
6234
  if (reason && reason !== "no-answer" && sandboxUrl !== void 0) {
@@ -6490,6 +6513,7 @@ var McpAppFrame = ({
6490
6513
  referrerPolicy: "no-referrer",
6491
6514
  srcDoc: doc,
6492
6515
  onLoad: () => shellLoaded.current?.(),
6516
+ "data-color-scheme": scheme,
6493
6517
  style: panel || fullscreen ? void 0 : { height }
6494
6518
  },
6495
6519
  `${reload}:origin`
@@ -6502,6 +6526,7 @@ var McpAppFrame = ({
6502
6526
  sandbox: "allow-scripts",
6503
6527
  referrerPolicy: "no-referrer",
6504
6528
  srcDoc: doc,
6529
+ "data-color-scheme": scheme,
6505
6530
  style: panel || fullscreen ? void 0 : { height }
6506
6531
  },
6507
6532
  `${reload}:opaque`
@@ -6808,6 +6833,15 @@ var readDataUrl2 = (file) => new Promise((resolve, reject) => {
6808
6833
  r.readAsDataURL(file);
6809
6834
  });
6810
6835
  var safeName = (name) => name.replace(/[^\w.-]+/g, "_").slice(0, 80) || "file";
6836
+ var DictationClock = () => {
6837
+ const [t0] = (0, import_react15.useState)(() => Date.now());
6838
+ const [now, setNow] = (0, import_react15.useState)(t0);
6839
+ (0, import_react15.useEffect)(() => {
6840
+ const id = setInterval(() => setNow(Date.now()), 500);
6841
+ return () => clearInterval(id);
6842
+ }, []);
6843
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "awr-mic__time", "aria-hidden": "true", children: formatClock(now - t0) });
6844
+ };
6811
6845
  var AgentComposer = ({
6812
6846
  controller: agent,
6813
6847
  placeholder,
@@ -6904,6 +6938,7 @@ ${draftText}` : draftText);
6904
6938
  onFinal: (heard) => setText((t) => t.trim() ? `${t.trimEnd()} ${heard}` : heard)
6905
6939
  });
6906
6940
  const showMic = speech !== false && stt.supported;
6941
+ const micOn = stt.listening && !stt.finishing;
6907
6942
  const recorder = useAudioRecorder({
6908
6943
  maxMs: typeof voiceMessage === "object" ? voiceMessage.maxMs : void 0
6909
6944
  });
@@ -7546,19 +7581,22 @@ ${draftText}` : draftText);
7546
7581
  "aria-label": L.message
7547
7582
  }
7548
7583
  ),
7549
- showMic && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
7550
- "button",
7551
- {
7552
- type: "button",
7553
- className: `awr-iconbtn awr-mic${stt.listening ? " is-on" : ""}${stt.finishing ? " is-busy" : ""}`,
7554
- "aria-label": stt.listening ? L.stopDictation : L.dictate,
7555
- "aria-pressed": stt.listening,
7556
- title: stt.listening ? L.stopDictation : L.dictateTitle,
7557
- onClick: stt.toggle,
7558
- disabled: disabled || recordingOn || stt.finishing,
7559
- children: stt.finishing ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SpinnerIcon, { size: 18 }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(MicIcon, { size: 18 })
7560
- }
7561
- )
7584
+ showMic && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: `awr-micbox${micOn ? " is-on" : ""}${stt.finishing ? " is-busy" : ""}`, children: [
7585
+ micOn && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DictationClock, {}),
7586
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
7587
+ "button",
7588
+ {
7589
+ type: "button",
7590
+ className: `awr-iconbtn awr-mic${micOn ? " is-on" : ""}${stt.finishing ? " is-busy" : ""}`,
7591
+ "aria-label": stt.finishing ? L.transcribing : micOn ? L.micListening : L.dictate,
7592
+ "aria-busy": stt.finishing || void 0,
7593
+ title: micOn ? L.stopDictation : stt.finishing ? L.transcribing : L.dictateTitle,
7594
+ onClick: stt.toggle,
7595
+ disabled: disabled || recordingOn || stt.finishing,
7596
+ children: stt.finishing ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SpinnerIcon, { size: 18 }) : micOn ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(StopIcon, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(MicIcon, { size: 18 })
7597
+ }
7598
+ )
7599
+ ] })
7562
7600
  ] }),
7563
7601
  stt.listening && stt.interim && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "awr-composer2__interim", children: stt.interim }),
7564
7602
  stt.finishing && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "awr-composer2__interim", role: "status", children: L.transcribing }),
@@ -8558,6 +8596,7 @@ var ImageViewerProvider = ({
8558
8596
  render,
8559
8597
  children
8560
8598
  }) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ImageViewerContext.Provider, { value: { enabled, render }, children });
8599
+ var useImageViewerOn = () => (0, import_react18.useContext)(ImageViewerContext).enabled;
8561
8600
  var imageExtensionOf = (src) => {
8562
8601
  const type = /^data:image\/([a-z0-9.+-]+)/i.exec(src)?.[1]?.toLowerCase();
8563
8602
  return !type ? "" : type === "jpeg" ? ".jpg" : type === "svg+xml" ? ".svg" : `.${type}`;
@@ -8768,7 +8807,7 @@ var FilesPanel = ({
8768
8807
  };
8769
8808
 
8770
8809
  // src/components/FileChips.tsx
8771
- var import_react21 = require("react");
8810
+ var import_react22 = require("react");
8772
8811
 
8773
8812
  // src/file-kinds.ts
8774
8813
  var import_agent_web6 = require("@dudko.dev/agent-web");
@@ -8788,6 +8827,122 @@ var fileKindOf = (path, mediaType) => {
8788
8827
  };
8789
8828
  var fileNameOf2 = (path) => path.split("/").filter(Boolean).pop() || "file";
8790
8829
 
8830
+ // src/named-files.ts
8831
+ var NAMED_FILES_MAX = 12;
8832
+ var NAMED_FILES_SCAN_MAX = 200;
8833
+ var NAMED_FILES_TEXT_MAX = 1e5;
8834
+ var PATH_MAX = 512;
8835
+ var workspacePathOf = (raw) => {
8836
+ if (raw.length < 2 || raw.length > PATH_MAX) return void 0;
8837
+ if (raw[0] !== "/" || raw[1] === "/") return void 0;
8838
+ if (/[\u0000-\u001f\u007f\\]/.test(raw)) return void 0;
8839
+ const segments = raw.slice(1).split("/");
8840
+ for (const s of segments) {
8841
+ if (!s || s === "." || s === ".." || s.trim() !== s) return void 0;
8842
+ }
8843
+ return raw;
8844
+ };
8845
+ var withoutFences = (text2) => {
8846
+ const lines = text2.split("\n");
8847
+ let fence;
8848
+ for (let i = 0; i < lines.length; i++) {
8849
+ const open = /^ {0,3}(`{3,}|~{3,})/.exec(lines[i]);
8850
+ if (!fence) {
8851
+ if (open && !(open[1][0] === "`" && lines[i].slice(open[0].length).includes("`"))) {
8852
+ fence = { char: open[1][0], size: open[1].length };
8853
+ lines[i] = " ".repeat(lines[i].length);
8854
+ }
8855
+ continue;
8856
+ }
8857
+ const close = /^ {0,3}(`{3,}|~{3,})\s*$/.exec(lines[i]);
8858
+ if (close && close[1][0] === fence.char && close[1].length >= fence.size) fence = void 0;
8859
+ lines[i] = " ".repeat(lines[i].length);
8860
+ }
8861
+ return lines.join("\n");
8862
+ };
8863
+ var decoded = (s) => {
8864
+ if (!s.includes("%")) return s;
8865
+ try {
8866
+ return decodeURIComponent(s);
8867
+ } catch {
8868
+ return s;
8869
+ }
8870
+ };
8871
+ var codeSpansOf = (text2) => {
8872
+ const runs = [];
8873
+ for (let i = text2.indexOf("`"); i >= 0; i = text2.indexOf("`", i)) {
8874
+ let j = i + 1;
8875
+ while (j < text2.length && text2.charCodeAt(j) === 96) j++;
8876
+ runs.push({ at: i, size: j - i });
8877
+ i = j;
8878
+ }
8879
+ const next = new Array(runs.length);
8880
+ const later = /* @__PURE__ */ new Map();
8881
+ for (let k = runs.length - 1; k >= 0; k--) {
8882
+ next[k] = later.get(runs[k].size) ?? -1;
8883
+ later.set(runs[k].size, k);
8884
+ }
8885
+ const spans = [];
8886
+ for (let k = 0; k < runs.length; ) {
8887
+ const close = next[k];
8888
+ if (close < 0) {
8889
+ k++;
8890
+ continue;
8891
+ }
8892
+ const open = runs[k];
8893
+ const end = runs[close].at + runs[close].size;
8894
+ spans.push({ at: open.at, end, inner: text2.slice(open.at + open.size, runs[close].at) });
8895
+ k = close + 1;
8896
+ }
8897
+ return spans;
8898
+ };
8899
+ var LINK = /!?\[[^[\]\n]*\]\(\s*(<[^<>\n]+>|[^\s()<>]+)(?:\s+(?:"[^"\n]*"|'[^'\n]*'|\([^()\n]*\)))?\s*\)/g;
8900
+ var pathsNamedIn = (text2) => {
8901
+ if (!text2) return [];
8902
+ const head = text2.length > NAMED_FILES_TEXT_MAX ? text2.slice(0, NAMED_FILES_TEXT_MAX) : text2;
8903
+ if (!head.includes("/")) return [];
8904
+ const found = [];
8905
+ let masked = withoutFences(head);
8906
+ const spans = codeSpansOf(masked);
8907
+ const parts = [];
8908
+ let from = 0;
8909
+ for (const span of spans) {
8910
+ let inner = span.inner;
8911
+ if (inner.length > 2 && inner.startsWith(" ") && inner.endsWith(" ")) inner = inner.slice(1, -1);
8912
+ const path = workspacePathOf(inner);
8913
+ if (path) found.push({ at: span.at, path });
8914
+ parts.push(masked.slice(from, span.at), " ".repeat(span.end - span.at));
8915
+ from = span.end;
8916
+ }
8917
+ masked = parts.join("") + masked.slice(from);
8918
+ for (const m of masked.matchAll(LINK)) {
8919
+ const dest = m[1].startsWith("<") ? m[1].slice(1, -1) : m[1];
8920
+ const path = workspacePathOf(decoded(dest));
8921
+ if (path) found.push({ at: m.index, path });
8922
+ }
8923
+ found.sort((a, b) => a.at - b.at);
8924
+ const out = [];
8925
+ const seen = /* @__PURE__ */ new Set();
8926
+ for (const { path } of found) {
8927
+ if (seen.has(path)) continue;
8928
+ seen.add(path);
8929
+ out.push(path);
8930
+ if (out.length >= NAMED_FILES_SCAN_MAX) break;
8931
+ }
8932
+ return out;
8933
+ };
8934
+ var namedFilesOf = (named, exists, { exclude, max = NAMED_FILES_MAX } = {}) => {
8935
+ const skip = new Set(exclude ?? []);
8936
+ const out = [];
8937
+ for (const path of named) {
8938
+ if (out.length >= max) break;
8939
+ if (skip.has(path) || !exists(path)) continue;
8940
+ skip.add(path);
8941
+ out.push(path);
8942
+ }
8943
+ return out;
8944
+ };
8945
+
8791
8946
  // src/components/Media.tsx
8792
8947
  var import_react20 = require("react");
8793
8948
  var import_agent_web7 = require("@dudko.dev/agent-web");
@@ -8930,8 +9085,30 @@ var SandboxedFrame = ({
8930
9085
  footer ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "awr-frame__foot", children: footer }) : null
8931
9086
  ] });
8932
9087
 
8933
- // src/components/FileChips.tsx
9088
+ // src/components/WorkspaceListing.tsx
9089
+ var import_react21 = require("react");
8934
9090
  var import_jsx_runtime14 = require("react/jsx-runtime");
9091
+ var WorkspaceListingContext = (0, import_react21.createContext)(void 0);
9092
+ var WorkspaceListingProvider = ({
9093
+ files,
9094
+ children
9095
+ }) => {
9096
+ const live = useVirtualFiles(files);
9097
+ const value = (0, import_react21.useMemo)(
9098
+ () => files ? { vfs: files, listing: { files: live.files, loading: live.loading } } : void 0,
9099
+ [files, live.files, live.loading]
9100
+ );
9101
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(WorkspaceListingContext.Provider, { value, children });
9102
+ };
9103
+ var useWorkspaceListing = (vfs) => {
9104
+ const shared = (0, import_react21.useContext)(WorkspaceListingContext);
9105
+ const fromShared = shared !== void 0 && vfs !== void 0 && shared.vfs === vfs;
9106
+ const own = useVirtualFiles(fromShared ? void 0 : vfs);
9107
+ return fromShared ? shared.listing : own;
9108
+ };
9109
+
9110
+ // src/components/FileChips.tsx
9111
+ var import_jsx_runtime15 = require("react/jsx-runtime");
8935
9112
  var FILE_PREVIEW_CHARS = 2e4;
8936
9113
  var textOf = (file) => file.encoding === "base64" ? new TextDecoder().decode(bytesOf(file.content, "base64")) : file.content;
8937
9114
  var KIND_ICON = {
@@ -8956,7 +9133,7 @@ var downloadFile = async (vfs, path) => {
8956
9133
  a.click();
8957
9134
  setTimeout(() => URL.revokeObjectURL(url), 1e3);
8958
9135
  };
8959
- var Seg = ({ value, options, onChange, label }) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "awr-seg", role: "group", "aria-label": label, children: options.map((o) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
9136
+ var Seg = ({ value, options, onChange, label }) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "awr-seg", role: "group", "aria-label": label, children: options.map((o) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
8960
9137
  "button",
8961
9138
  {
8962
9139
  type: "button",
@@ -8991,32 +9168,32 @@ var SourceView = ({
8991
9168
  const L = useLabels(labels);
8992
9169
  const cut = text2.length > maxChars;
8993
9170
  const shown = cut ? text2.slice(0, maxChars) : text2;
8994
- const lines = (0, import_react21.useMemo)(
9171
+ const lines = (0, import_react22.useMemo)(
8995
9172
  () => linesOf(html ? tokenizeHtml(shown) : [{ kind: "text", text: shown }]),
8996
9173
  [shown, html]
8997
9174
  );
8998
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
8999
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("pre", { className: ["awr-source", className].filter(Boolean).join(" "), tabIndex: 0, children: lines.map((line, i) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "awr-source__line", children: [
9175
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
9176
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("pre", { className: ["awr-source", className].filter(Boolean).join(" "), tabIndex: 0, children: lines.map((line, i) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "awr-source__line", children: [
9000
9177
  line.map(
9001
- (t, k) => t.kind === "text" ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react21.Fragment, { children: t.text }, k) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: `awr-source__${t.kind}`, children: t.text }, k)
9178
+ (t, k) => t.kind === "text" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react22.Fragment, { children: t.text }, k) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: `awr-source__${t.kind}`, children: t.text }, k)
9002
9179
  ),
9003
9180
  "\n"
9004
9181
  ] }, i)) }),
9005
- cut && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "awr-fileview__cut", children: L.fileCut(maxChars) })
9182
+ cut && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "awr-fileview__cut", children: L.fileCut(maxChars) })
9006
9183
  ] });
9007
9184
  };
9008
9185
  var HtmlPreview = ({ written, file, htmlPreview, previewChars, L }) => {
9009
- const html = (0, import_react21.useMemo)(() => textOf(file), [file]);
9186
+ const html = (0, import_react22.useMemo)(() => textOf(file), [file]);
9010
9187
  const options = htmlPreview === false ? void 0 : htmlPreview;
9011
9188
  const tooLarge = html.length > HTML_PREVIEW_MAX_CHARS;
9012
9189
  const canFrame = Boolean(options) && !tooLarge;
9013
- const [view, setView] = (0, import_react21.useState)(canFrame ? "preview" : "source");
9014
- const [tall, setTall] = (0, import_react21.useState)(false);
9190
+ const [view, setView] = (0, import_react22.useState)(canFrame ? "preview" : "source");
9191
+ const [tall, setTall] = (0, import_react22.useState)(false);
9015
9192
  const showing = canFrame ? view : "source";
9016
9193
  const scripts = options?.scripts === true;
9017
9194
  const height = options?.height ?? 300;
9018
- const linked = (0, import_react21.useMemo)(() => showing === "preview" ? linkedFilesOf(html) : [], [html, showing]);
9019
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
9195
+ const linked = (0, import_react22.useMemo)(() => showing === "preview" ? linkedFilesOf(html) : [], [html, showing]);
9196
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
9020
9197
  SandboxedFrame,
9021
9198
  {
9022
9199
  className: "awr-frame--html",
@@ -9024,35 +9201,35 @@ var HtmlPreview = ({ written, file, htmlPreview, previewChars, L }) => {
9024
9201
  html: showing === "preview" ? html : void 0,
9025
9202
  scripts,
9026
9203
  height: tall ? height * 2 : height,
9027
- label: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
9028
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CodeIcon, { size: 14, className: "awr-frame__icon" }),
9029
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "awr-frame__titles", children: [
9030
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "awr-frame__title", children: L.htmlFrameTitle }),
9031
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "awr-frame__badges", children: showing === "preview" ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
9032
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(LockIcon, { size: 11 }),
9204
+ label: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
9205
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(CodeIcon, { size: 14, className: "awr-frame__icon" }),
9206
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "awr-frame__titles", children: [
9207
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "awr-frame__title", children: L.htmlFrameTitle }),
9208
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "awr-frame__badges", children: showing === "preview" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
9209
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(LockIcon, { size: 11 }),
9033
9210
  " ",
9034
9211
  L.htmlSandboxed,
9035
9212
  " \xB7 ",
9036
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(NoNetworkIcon, { size: 11 }),
9213
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(NoNetworkIcon, { size: 11 }),
9037
9214
  " ",
9038
9215
  L.htmlNoNetwork
9039
9216
  ] }) : L.htmlSourceNote })
9040
9217
  ] })
9041
9218
  ] }),
9042
- actions: canFrame ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
9043
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
9219
+ actions: canFrame ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
9220
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
9044
9221
  Seg,
9045
9222
  {
9046
9223
  label: L.htmlFrameTitle,
9047
9224
  value: showing,
9048
9225
  onChange: setView,
9049
9226
  options: [
9050
- { value: "preview", label: L.preview, icon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(EyeIcon, { size: 13 }) },
9051
- { value: "source", label: L.fileSource, icon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CodeIcon, { size: 13 }) }
9227
+ { value: "preview", label: L.preview, icon: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(EyeIcon, { size: 13 }) },
9228
+ { value: "source", label: L.fileSource, icon: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(CodeIcon, { size: 13 }) }
9052
9229
  ]
9053
9230
  }
9054
9231
  ),
9055
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
9232
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
9056
9233
  "button",
9057
9234
  {
9058
9235
  type: "button",
@@ -9062,14 +9239,14 @@ var HtmlPreview = ({ written, file, htmlPreview, previewChars, L }) => {
9062
9239
  "aria-pressed": tall,
9063
9240
  disabled: showing !== "preview",
9064
9241
  onClick: () => setTall((t) => !t),
9065
- children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ExpandIcon, { size: 15 })
9242
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ExpandIcon, { size: 15 })
9066
9243
  }
9067
9244
  )
9068
9245
  ] }) : void 0,
9069
- footer: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
9070
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FileIcon, { size: 11 }),
9071
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("code", { children: written.path }),
9072
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "awr-frame__footmeta", children: [
9246
+ footer: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
9247
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FileIcon, { size: 11 }),
9248
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("code", { children: written.path }),
9249
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "awr-frame__footmeta", children: [
9073
9250
  "\xB7 ",
9074
9251
  L.bytes(file.size),
9075
9252
  " \xB7",
@@ -9078,18 +9255,18 @@ var HtmlPreview = ({ written, file, htmlPreview, previewChars, L }) => {
9078
9255
  linked.length > 0 ? ` \xB7 ${L.htmlLinkedFiles(linked.join(", "))}` : ""
9079
9256
  ] })
9080
9257
  ] }),
9081
- children: showing === "source" ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
9082
- tooLarge && options ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "awr-fileview__cut", children: L.htmlTooLarge }) : null,
9083
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SourceView, { text: html, html: true, maxChars: previewChars, className: "awr-frame__source" })
9258
+ children: showing === "source" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
9259
+ tooLarge && options ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "awr-fileview__cut", children: L.htmlTooLarge }) : null,
9260
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SourceView, { text: html, html: true, maxChars: previewChars, className: "awr-frame__source" })
9084
9261
  ] }) : void 0
9085
9262
  }
9086
9263
  );
9087
9264
  };
9088
9265
  var ImagePreview = ({ written, vfs, onClose, L }) => {
9089
9266
  const url = useFileUrl(vfs, written.path, written.mediaType.toLowerCase().split(";")[0].trim());
9090
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "awr-fileview", children: [
9091
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FileViewHead, { written, kind: "image", onClose, L }),
9092
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "awr-fileview__image", children: url ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("img", { src: url, alt: fileNameOf2(written.path) }) : null })
9267
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "awr-fileview", children: [
9268
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FileViewHead, { written, kind: "image", onClose, L }),
9269
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "awr-fileview__image", children: url ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("img", { src: url, alt: fileNameOf2(written.path) }) : null })
9093
9270
  ] });
9094
9271
  };
9095
9272
  var FileViewHead = ({
@@ -9098,15 +9275,15 @@ var FileViewHead = ({
9098
9275
  onClose,
9099
9276
  L,
9100
9277
  children
9101
- }) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "awr-fileview__head", children: [
9102
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "awr-fileview__name", title: written.path, children: fileNameOf2(written.path) }),
9103
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "awr-fileview__kind", children: [
9278
+ }) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "awr-fileview__head", children: [
9279
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "awr-fileview__name", title: written.path, children: fileNameOf2(written.path) }),
9280
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "awr-fileview__kind", children: [
9104
9281
  "\xB7 ",
9105
9282
  L.fileKinds[kind]
9106
9283
  ] }),
9107
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "awr-fileview__actions", children: [
9284
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "awr-fileview__actions", children: [
9108
9285
  children,
9109
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
9286
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
9110
9287
  "button",
9111
9288
  {
9112
9289
  type: "button",
@@ -9114,7 +9291,7 @@ var FileViewHead = ({
9114
9291
  "aria-label": L.closePreview,
9115
9292
  title: L.closePreview,
9116
9293
  onClick: onClose,
9117
- children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(XIcon, { size: 14 })
9294
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(XIcon, { size: 14 })
9118
9295
  }
9119
9296
  )
9120
9297
  ] })
@@ -9128,18 +9305,18 @@ var TextPreview = ({
9128
9305
  onClose,
9129
9306
  L
9130
9307
  }) => {
9131
- const text2 = (0, import_react21.useMemo)(() => textOf(file), [file]);
9132
- const rendered = (0, import_react21.useMemo)(
9308
+ const text2 = (0, import_react22.useMemo)(() => textOf(file), [file]);
9309
+ const rendered = (0, import_react22.useMemo)(
9133
9310
  () => renderFileContent?.(written, text2.slice(0, previewChars)),
9134
9311
  [renderFileContent, written, text2, previewChars]
9135
9312
  );
9136
9313
  const hasRendered = rendered !== void 0 && rendered !== null && rendered !== false;
9137
- const [view, setView] = (0, import_react21.useState)("rendered");
9138
- const [all, setAll] = (0, import_react21.useState)(false);
9314
+ const [view, setView] = (0, import_react22.useState)("rendered");
9315
+ const [all, setAll] = (0, import_react22.useState)(false);
9139
9316
  const showing = hasRendered ? view : "source";
9140
9317
  const long = text2.length > 1200 || text2.split("\n").length > 16;
9141
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "awr-fileview", children: [
9142
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FileViewHead, { written, kind, onClose, L, children: hasRendered && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
9318
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "awr-fileview", children: [
9319
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FileViewHead, { written, kind, onClose, L, children: hasRendered && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
9143
9320
  Seg,
9144
9321
  {
9145
9322
  label: fileNameOf2(written.path),
@@ -9151,21 +9328,23 @@ var TextPreview = ({
9151
9328
  ]
9152
9329
  }
9153
9330
  ) }),
9154
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: `awr-fileview__body${long && !all ? " is-folded" : ""}`, children: showing === "rendered" ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
9155
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "awr-fileview__rendered", children: rendered }),
9156
- text2.length > previewChars && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "awr-fileview__cut", children: L.fileCut(previewChars) })
9157
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SourceView, { text: text2, maxChars: previewChars }) }),
9158
- long && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "awr-fileview__more", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", className: "awr-linkbtn", onClick: () => setAll((a) => !a), children: all ? L.fileShowLess : L.fileShowRest }) })
9331
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: `awr-fileview__body${long && !all ? " is-folded" : ""}`, children: showing === "rendered" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
9332
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "awr-fileview__rendered", children: rendered }),
9333
+ text2.length > previewChars && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "awr-fileview__cut", children: L.fileCut(previewChars) })
9334
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SourceView, { text: text2, maxChars: previewChars }) }),
9335
+ long && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "awr-fileview__more", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "awr-linkbtn", onClick: () => setAll((a) => !a), children: all ? L.fileShowLess : L.fileShowRest }) })
9159
9336
  ] });
9160
9337
  };
9161
- var NoPreview = ({ written, kind, onClose, L }) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "awr-fileview", children: [
9162
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FileViewHead, { written, kind, onClose, L }),
9163
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "awr-fileview__none", children: L.fileNoPreview })
9338
+ var NoPreview = ({ written, kind, onClose, L }) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "awr-fileview", children: [
9339
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FileViewHead, { written, kind, onClose, L }),
9340
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "awr-fileview__none", children: L.fileNoPreview })
9164
9341
  ] });
9165
9342
  var FileChips = ({
9166
9343
  written,
9167
9344
  files: vfs,
9168
9345
  showHeader = true,
9346
+ heading,
9347
+ imagesInViewer = false,
9169
9348
  onShowFiles,
9170
9349
  htmlPreview = {},
9171
9350
  renderFile,
@@ -9176,12 +9355,12 @@ var FileChips = ({
9176
9355
  className
9177
9356
  }) => {
9178
9357
  const L = useLabels(labels);
9179
- const live = useVirtualFiles(vfs);
9180
- const [openPath, setOpenPath] = (0, import_react21.useState)(defaultOpen);
9181
- const [file, setFile] = (0, import_react21.useState)();
9358
+ const live = useWorkspaceListing(vfs);
9359
+ const [openPath, setOpenPath] = (0, import_react22.useState)(defaultOpen);
9360
+ const [file, setFile] = (0, import_react22.useState)();
9182
9361
  const open = written.find((f) => f.path === openPath);
9183
9362
  const stamp = live.files.find((f) => f.path === openPath)?.updatedAt;
9184
- (0, import_react21.useEffect)(() => {
9363
+ (0, import_react22.useEffect)(() => {
9185
9364
  if (!vfs || !openPath) return setFile(void 0);
9186
9365
  let gone = false;
9187
9366
  vfs.read(openPath).then((f) => {
@@ -9208,23 +9387,23 @@ var FileChips = ({
9208
9387
  onClose: () => setOpenPath(void 0),
9209
9388
  L
9210
9389
  };
9211
- if (kind === "html") return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(HtmlPreview, { ...props }, open.path);
9212
- if (kind === "image") return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ImagePreview, { ...props }, open.path);
9213
- if (kind === "file") return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(NoPreview, { ...props }, open.path);
9214
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TextPreview, { ...props }, open.path);
9390
+ if (kind === "html") return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(HtmlPreview, { ...props }, open.path);
9391
+ if (kind === "image") return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ImagePreview, { ...props }, open.path);
9392
+ if (kind === "file") return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(NoPreview, { ...props }, open.path);
9393
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(TextPreview, { ...props }, open.path);
9215
9394
  };
9216
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: ["awr-msg__files", className].filter(Boolean).join(" "), children: [
9217
- showHeader && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "awr-msg__fileshead", children: [
9218
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FileIcon, { size: 13 }),
9219
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: L.filesWritten(written.length) }),
9220
- onShowFiles && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", className: "awr-linkbtn", onClick: onShowFiles, children: L.showInFiles })
9395
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: ["awr-msg__files", className].filter(Boolean).join(" "), children: [
9396
+ showHeader && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "awr-msg__fileshead", children: [
9397
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FileIcon, { size: 13 }),
9398
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: heading ?? L.filesWritten(written.length) }),
9399
+ onShowFiles && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "awr-linkbtn", onClick: onShowFiles, children: L.showInFiles })
9221
9400
  ] }),
9222
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("ul", { className: "awr-filechips", children: written.map((w) => {
9401
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("ul", { className: "awr-filechips", children: written.map((w) => {
9223
9402
  const info = live.files.find((f) => f.path === w.path);
9224
9403
  const gone = Boolean(vfs) && !live.loading && !info;
9225
9404
  const usable = Boolean(vfs) && !gone;
9226
9405
  const isOpen = openPath === w.path && usable;
9227
- const chip = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
9406
+ const chip = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
9228
9407
  FileChip,
9229
9408
  {
9230
9409
  written: w,
@@ -9234,10 +9413,11 @@ var FileChips = ({
9234
9413
  gone,
9235
9414
  open: isOpen,
9236
9415
  onToggle: () => setOpenPath(isOpen ? void 0 : w.path),
9416
+ viewer: imagesInViewer,
9237
9417
  labels
9238
9418
  }
9239
9419
  );
9240
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("li", { className: "awr-filechips__item", children: renderFile ? renderFile(w, chip) : chip }, w.path);
9420
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { className: "awr-filechips__item", children: renderFile ? renderFile(w, chip) : chip }, w.path);
9241
9421
  }) }),
9242
9422
  preview()
9243
9423
  ] });
@@ -9250,9 +9430,12 @@ var FileChip = ({
9250
9430
  gone = false,
9251
9431
  open = false,
9252
9432
  onToggle,
9433
+ viewer = false,
9253
9434
  labels
9254
9435
  }) => {
9255
9436
  const L = useLabels(labels);
9437
+ const viewerOn = useImageViewerOn();
9438
+ const thumbRef = (0, import_react22.useRef)(null);
9256
9439
  const kind = fileKindOf(written.path, mediaType);
9257
9440
  const name = fileNameOf2(written.path);
9258
9441
  const Icon = KIND_ICON[kind];
@@ -9262,19 +9445,40 @@ var FileChip = ({
9262
9445
  kind === "image" ? mediaType.toLowerCase().split(";")[0].trim() : void 0
9263
9446
  );
9264
9447
  const meta = gone ? L.fileGone : [L.fileKinds[kind], L.bytes(bytes), written.by ? L.fileBy(written.by.name) : ""].filter(Boolean).join(" \xB7 ");
9265
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
9448
+ const inViewer = viewer && viewerOn && kind === "image" && Boolean(thumb) && !gone;
9449
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
9266
9450
  "div",
9267
9451
  {
9268
9452
  className: `awr-filechip${open ? " is-open" : ""}${gone ? " is-gone" : ""}`,
9269
9453
  title: written.path,
9270
9454
  children: [
9271
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "awr-filechip__thumb", children: thumb ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("img", { src: thumb, alt: "" }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Icon, { size: 16 }) }),
9272
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "awr-filechip__text", children: [
9273
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "awr-filechip__name", children: name }),
9274
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "awr-filechip__meta", children: meta })
9455
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { ref: thumbRef, className: "awr-filechip__thumb", children: inViewer && thumb ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
9456
+ ImageThumb,
9457
+ {
9458
+ src: thumb,
9459
+ name: written.path,
9460
+ alt: name,
9461
+ className: "awr-filechip__imgbtn",
9462
+ labels
9463
+ }
9464
+ ) : thumb ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("img", { src: thumb, alt: "" }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Icon, { size: 16 }) }),
9465
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "awr-filechip__text", children: [
9466
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "awr-filechip__name", children: name }),
9467
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "awr-filechip__meta", children: meta })
9275
9468
  ] }),
9276
- vfs && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "awr-filechip__actions", children: [
9277
- onToggle && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
9469
+ vfs && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "awr-filechip__actions", children: [
9470
+ inViewer ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
9471
+ "button",
9472
+ {
9473
+ type: "button",
9474
+ className: "awr-iconbtn",
9475
+ "aria-label": L.imageOpen(name),
9476
+ "aria-haspopup": "dialog",
9477
+ title: L.preview,
9478
+ onClick: () => thumbRef.current?.querySelector("button")?.click(),
9479
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(EyeIcon, { size: 15 })
9480
+ }
9481
+ ) : onToggle && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
9278
9482
  "button",
9279
9483
  {
9280
9484
  type: "button",
@@ -9283,10 +9487,10 @@ var FileChip = ({
9283
9487
  title: open ? L.closePreview : L.preview,
9284
9488
  "aria-expanded": open,
9285
9489
  onClick: onToggle,
9286
- children: open ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ChevronUpIcon, { size: 15 }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(EyeIcon, { size: 15 })
9490
+ children: open ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ChevronUpIcon, { size: 15 }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(EyeIcon, { size: 15 })
9287
9491
  }
9288
9492
  ),
9289
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
9493
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
9290
9494
  "button",
9291
9495
  {
9292
9496
  type: "button",
@@ -9294,7 +9498,7 @@ var FileChip = ({
9294
9498
  "aria-label": L.fileDownload(name),
9295
9499
  title: L.download,
9296
9500
  onClick: () => void downloadFile(vfs, written.path),
9297
- children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DownloadIcon, { size: 15 })
9501
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DownloadIcon, { size: 15 })
9298
9502
  }
9299
9503
  )
9300
9504
  ] })
@@ -9302,16 +9506,69 @@ var FileChip = ({
9302
9506
  }
9303
9507
  );
9304
9508
  };
9509
+ var NamedFileChips = (props) => {
9510
+ const named = (0, import_react22.useMemo)(() => pathsNamedIn(props.text), [props.text]);
9511
+ if (!props.files || named.length === 0) return null;
9512
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(NamedFileChipsOf, { ...props, named, files: props.files });
9513
+ };
9514
+ var NamedFileChipsOf = ({
9515
+ named,
9516
+ files: vfs,
9517
+ exclude,
9518
+ max = NAMED_FILES_MAX,
9519
+ showHeader = true,
9520
+ htmlPreview,
9521
+ renderFile,
9522
+ renderFileContent,
9523
+ labels,
9524
+ className
9525
+ }) => {
9526
+ const L = useLabels(labels);
9527
+ const live = useWorkspaceListing(vfs);
9528
+ const shown = (0, import_react22.useRef)(/* @__PURE__ */ new Map());
9529
+ const excludedKey = [...exclude ?? []].join("\n");
9530
+ const excluded = (0, import_react22.useMemo)(() => excludedKey ? excludedKey.split("\n") : [], [excludedKey]);
9531
+ const list = (0, import_react22.useMemo)(() => {
9532
+ if (live.loading) return [];
9533
+ const byPath = new Map(live.files.map((f) => [f.path, f]));
9534
+ const paths = namedFilesOf(named, (p) => byPath.has(p) || shown.current.has(p), {
9535
+ exclude: excluded,
9536
+ max
9537
+ });
9538
+ return paths.map((path) => {
9539
+ const info = byPath.get(path);
9540
+ const view = info ? { path, mediaType: info.mimeType, bytes: info.size, writes: 0 } : shown.current.get(path);
9541
+ shown.current.set(path, view);
9542
+ return view;
9543
+ });
9544
+ }, [live.loading, live.files, named, excluded, max]);
9545
+ if (list.length === 0) return null;
9546
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
9547
+ FileChips,
9548
+ {
9549
+ className: ["awr-msg__files--named", className].filter(Boolean).join(" "),
9550
+ written: list,
9551
+ files: vfs,
9552
+ showHeader,
9553
+ heading: L.filesNamed(list.length),
9554
+ imagesInViewer: true,
9555
+ htmlPreview,
9556
+ renderFile,
9557
+ renderFileContent,
9558
+ labels
9559
+ }
9560
+ );
9561
+ };
9305
9562
 
9306
9563
  // src/components/StepList.tsx
9307
- var import_react23 = require("react");
9564
+ var import_react24 = require("react");
9308
9565
 
9309
9566
  // src/components/SubagentTree.tsx
9310
- var import_react22 = require("react");
9311
- var import_jsx_runtime15 = require("react/jsx-runtime");
9567
+ var import_react23 = require("react");
9568
+ var import_jsx_runtime16 = require("react/jsx-runtime");
9312
9569
  var useElapsed = (startedAt, running) => {
9313
- const [now, setNow] = (0, import_react22.useState)(void 0);
9314
- (0, import_react22.useEffect)(() => {
9570
+ const [now, setNow] = (0, import_react23.useState)(void 0);
9571
+ (0, import_react23.useEffect)(() => {
9315
9572
  if (!running || startedAt === void 0) return;
9316
9573
  setNow(Date.now());
9317
9574
  const timer = setInterval(() => setNow(Date.now()), 1e3);
@@ -9339,19 +9596,19 @@ var SubagentRow = ({
9339
9596
  sub.toolCalls > 0 ? L.toolCalls(sub.toolCalls) : "",
9340
9597
  time !== void 0 ? formatDuration(time) : ""
9341
9598
  ].filter(Boolean);
9342
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
9599
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
9343
9600
  "li",
9344
9601
  {
9345
9602
  className: `awr-subagent awr-subagent--${sub.status}${sub.dynamic ? " awr-subagent--dynamic" : ""}`,
9346
9603
  "data-depth": sub.depth,
9347
9604
  children: [
9348
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "awr-subagent__head", children: [
9349
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "awr-subagent__icon", children: running ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SpinnerIcon, { size: 13 }) : sub.status === "done" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(BotIcon, { size: 13 }) : sub.status === "stopped" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(StopIcon, { size: 13 }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(AlertIcon, { size: 13 }) }),
9350
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "awr-subagent__name", title: sub.role, children: role || (sub.dynamic ? L.subagentHelper : sub.name) }),
9351
- sub.dynamic && role && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "awr-subagent__profile", children: L.subagentHelper }),
9352
- sub.profile && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "awr-subagent__profile", children: sub.profile }),
9353
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "awr-subagent__task", title: sub.task, children: previewValue(sub.task, 90) }),
9354
- running && onStop && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
9605
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "awr-subagent__head", children: [
9606
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "awr-subagent__icon", children: running ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SpinnerIcon, { size: 13 }) : sub.status === "done" ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(BotIcon, { size: 13 }) : sub.status === "stopped" ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(StopIcon, { size: 13 }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(AlertIcon, { size: 13 }) }),
9607
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "awr-subagent__name", title: sub.role, children: role || (sub.dynamic ? L.subagentHelper : sub.name) }),
9608
+ sub.dynamic && role && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "awr-subagent__profile", children: L.subagentHelper }),
9609
+ sub.profile && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "awr-subagent__profile", children: sub.profile }),
9610
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "awr-subagent__task", title: sub.task, children: previewValue(sub.task, 90) }),
9611
+ running && onStop && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
9355
9612
  "button",
9356
9613
  {
9357
9614
  type: "button",
@@ -9359,16 +9616,16 @@ var SubagentRow = ({
9359
9616
  "aria-label": L.stopSubagent,
9360
9617
  title: L.stopSubagent,
9361
9618
  onClick: () => onStop(sub.id),
9362
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(StopIcon, { size: 12 })
9619
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(StopIcon, { size: 12 })
9363
9620
  }
9364
9621
  )
9365
9622
  ] }),
9366
- showUsage && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "awr-subagent__meta", children: [
9367
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "awr-subagent__status", children: L.subagentStatus[sub.status] }),
9368
- meta.map((part, i) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "awr-subagent__metaitem", children: part }, i))
9623
+ showUsage && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "awr-subagent__meta", children: [
9624
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "awr-subagent__status", children: L.subagentStatus[sub.status] }),
9625
+ meta.map((part, i) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "awr-subagent__metaitem", children: part }, i))
9369
9626
  ] }),
9370
- showTools && sub.tools && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "awr-subagent__tools", children: sub.tools.length > 0 ? L.subagentTools(sub.tools.join(", ")) : L.subagentNoTools }),
9371
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("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)}` : ""}` }),
9627
+ showTools && sub.tools && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "awr-subagent__tools", children: sub.tools.length > 0 ? L.subagentTools(sub.tools.join(", ")) : L.subagentNoTools }),
9628
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("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)}` : ""}` }),
9372
9629
  children
9373
9630
  ]
9374
9631
  }
@@ -9384,12 +9641,12 @@ var SubagentTree = ({
9384
9641
  className
9385
9642
  }) => {
9386
9643
  if (subagents.length === 0) return null;
9387
- const branch = (nodes, nested) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
9644
+ const branch = (nodes, nested) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
9388
9645
  "ul",
9389
9646
  {
9390
9647
  className: ["awr-subagents", nested ? "awr-subagents--nested" : className].filter(Boolean).join(" "),
9391
9648
  children: nodes.map((node) => {
9392
- const row = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
9649
+ const row = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
9393
9650
  SubagentRow,
9394
9651
  {
9395
9652
  sub: node,
@@ -9401,7 +9658,7 @@ var SubagentTree = ({
9401
9658
  },
9402
9659
  node.id
9403
9660
  );
9404
- return renderSubagent ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react22.Fragment, { children: renderSubagent(node, row) }, node.id) : row;
9661
+ return renderSubagent ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react23.Fragment, { children: renderSubagent(node, row) }, node.id) : row;
9405
9662
  })
9406
9663
  }
9407
9664
  );
@@ -9409,7 +9666,7 @@ var SubagentTree = ({
9409
9666
  };
9410
9667
 
9411
9668
  // src/components/StepList.tsx
9412
- var import_jsx_runtime16 = require("react/jsx-runtime");
9669
+ var import_jsx_runtime17 = require("react/jsx-runtime");
9413
9670
  var WEB_SEARCH = "web_search";
9414
9671
  var ToolCallRow = ({
9415
9672
  call,
@@ -9427,27 +9684,27 @@ var ToolCallRow = ({
9427
9684
  call.outputTokens ? `\u2248${formatTokens(call.outputTokens)} out` : "",
9428
9685
  call.durationMs !== void 0 ? formatDuration(call.durationMs) : ""
9429
9686
  ].filter(Boolean).join(" \xB7 ");
9430
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
9687
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
9431
9688
  "li",
9432
9689
  {
9433
9690
  className: `awr-tool awr-tool--${state}${showTiers && call.attempt !== void 0 ? " awr-tool--earlier" : ""}`,
9434
9691
  children: [
9435
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "awr-tool__row", children: [
9436
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ToolIcon, { size: 13, className: "awr-tool__icon" }),
9437
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("code", { className: "awr-tool__name", children: call.name }),
9438
- previewValue(call.input) && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "awr-tool__args", children: previewValue(call.input) }),
9439
- call.status === "calling" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SpinnerIcon, { size: 12, className: "awr-tool__spin" }),
9440
- call.status === "done" && call.ok === false && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "awr-tool__badge", children: L.failed }),
9441
- showTiers && call.replayed && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "awr-tool__tag", title: L.replayedTitle, children: L.replayed }),
9442
- showTiers && call.attempt !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "awr-tool__tag", children: L.attemptTag(call.attempt) }),
9443
- call.app && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: "awr-tool__tag awr-tool__tag--app", "data-app": call.app, children: [
9444
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(AppIcon, { size: 10 }),
9692
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "awr-tool__row", children: [
9693
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ToolIcon, { size: 13, className: "awr-tool__icon" }),
9694
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("code", { className: "awr-tool__name", children: call.name }),
9695
+ previewValue(call.input) && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "awr-tool__args", children: previewValue(call.input) }),
9696
+ call.status === "calling" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SpinnerIcon, { size: 12, className: "awr-tool__spin" }),
9697
+ call.status === "done" && call.ok === false && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "awr-tool__badge", children: L.failed }),
9698
+ showTiers && call.replayed && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "awr-tool__tag", title: L.replayedTitle, children: L.replayed }),
9699
+ showTiers && call.attempt !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "awr-tool__tag", children: L.attemptTag(call.attempt) }),
9700
+ call.app && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "awr-tool__tag awr-tool__tag--app", "data-app": call.app, children: [
9701
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(AppIcon, { size: 10 }),
9445
9702
  " ",
9446
9703
  L.appTag
9447
9704
  ] }),
9448
- showUsage && cost && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "awr-tool__cost", title: L.toolCostTitle, children: cost })
9705
+ showUsage && cost && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "awr-tool__cost", title: L.toolCostTitle, children: cost })
9449
9706
  ] }),
9450
- images.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "awr-tool__images", children: images.map((src, i) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
9707
+ images.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "awr-tool__images", children: images.map((src, i) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
9451
9708
  ImageThumb,
9452
9709
  {
9453
9710
  src,
@@ -9458,16 +9715,16 @@ var ToolCallRow = ({
9458
9715
  },
9459
9716
  i
9460
9717
  )) }),
9461
- search && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "awr-search", children: [
9462
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("p", { className: "awr-search__query", children: [
9463
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(GlobeIcon, { size: 12 }),
9718
+ search && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "awr-search", children: [
9719
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("p", { className: "awr-search__query", children: [
9720
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(GlobeIcon, { size: 12 }),
9464
9721
  " ",
9465
9722
  L.searchQuery,
9466
9723
  " ",
9467
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("q", { children: search.query })
9724
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("q", { children: search.query })
9468
9725
  ] }),
9469
- search.results.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("ol", { className: "awr-search__results", children: search.results.map((r, i) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("li", { className: "awr-search__result", children: [
9470
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
9726
+ search.results.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("ol", { className: "awr-search__results", children: search.results.map((r, i) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("li", { className: "awr-search__result", children: [
9727
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
9471
9728
  "a",
9472
9729
  {
9473
9730
  className: "awr-search__title",
@@ -9478,13 +9735,13 @@ var ToolCallRow = ({
9478
9735
  }
9479
9736
  ),
9480
9737
  " ",
9481
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: "awr-search__host", children: [
9738
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "awr-search__host", children: [
9482
9739
  r.host,
9483
9740
  r.date ? ` \xB7 ${r.date}` : ""
9484
9741
  ] }),
9485
- r.snippet && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "awr-search__snippet", children: r.snippet })
9486
- ] }, i)) }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "awr-search__note", children: L.searchNoResults }),
9487
- (search.filtered > 0 || search.truncated) && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "awr-search__note", children: [
9742
+ r.snippet && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "awr-search__snippet", children: r.snippet })
9743
+ ] }, i)) }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "awr-search__note", children: L.searchNoResults }),
9744
+ (search.filtered > 0 || search.truncated) && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "awr-search__note", children: [
9488
9745
  search.filtered > 0 ? L.searchFiltered(search.filtered) : "",
9489
9746
  search.truncated ? L.searchTruncated : ""
9490
9747
  ].filter(Boolean).join(" \xB7 ") })
@@ -9498,11 +9755,11 @@ var UserNoteRow = ({
9498
9755
  labels
9499
9756
  }) => {
9500
9757
  const L = useLabels(labels);
9501
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("li", { className: `awr-note awr-note--${note.at}`, children: [
9502
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SendIcon, { size: 12, className: "awr-note__icon" }),
9503
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "awr-note__where", children: L.noteAt[note.at] }),
9504
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("q", { className: "awr-note__text", children: note.text }),
9505
- note.origin === "another-tab" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "awr-note__origin", children: L.fromAnotherTab })
9758
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("li", { className: `awr-note awr-note--${note.at}`, children: [
9759
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SendIcon, { size: 12, className: "awr-note__icon" }),
9760
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "awr-note__where", children: L.noteAt[note.at] }),
9761
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("q", { className: "awr-note__text", children: note.text }),
9762
+ note.origin === "another-tab" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "awr-note__origin", children: L.fromAnotherTab })
9506
9763
  ] });
9507
9764
  };
9508
9765
  var decisionNote = (d, L) => {
@@ -9533,14 +9790,14 @@ var StepItem = ({
9533
9790
  renderToolCall,
9534
9791
  renderSubagent,
9535
9792
  L
9536
- }) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("li", { className: `awr-step awr-step--${step.blocked ? "blocked" : step.status}`, children: [
9537
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "awr-step__head", children: [
9538
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "awr-step__marker", children: step.status === "running" ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SpinnerIcon, { size: 14 }) : step.blocked ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(AlertIcon, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(CheckIcon, { size: 14 }) }),
9539
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "awr-step__index", children: `${step.index}/${step.total}` }),
9540
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "awr-step__desc", children: step.step.description })
9793
+ }) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("li", { className: `awr-step awr-step--${step.blocked ? "blocked" : step.status}`, children: [
9794
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "awr-step__head", children: [
9795
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "awr-step__marker", children: step.status === "running" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SpinnerIcon, { size: 14 }) : step.blocked ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(AlertIcon, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CheckIcon, { size: 14 }) }),
9796
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "awr-step__index", children: `${step.index}/${step.total}` }),
9797
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "awr-step__desc", children: step.step.description })
9541
9798
  ] }),
9542
- showTiers && step.tier && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "awr-step__meta", children: [
9543
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
9799
+ showTiers && step.tier && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "awr-step__meta", children: [
9800
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
9544
9801
  "span",
9545
9802
  {
9546
9803
  className: `awr-step__tier awr-step__tier--${step.tier}`,
@@ -9548,29 +9805,29 @@ var StepItem = ({
9548
9805
  children: L.tierNames[step.tier]
9549
9806
  }
9550
9807
  ),
9551
- step.model && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "awr-step__model", children: step.model })
9808
+ step.model && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "awr-step__model", children: step.model })
9552
9809
  ] }),
9553
- showTiers && step.escalations?.map((e, i) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "awr-step__escalated", children: [
9554
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("p", { className: "awr-step__escalated-line", children: [
9555
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ArrowUpIcon, { size: 12 }),
9556
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: L.escalated(L.tierNames[e.from], L.tierNames[e.to], L.escalationReasons[e.reason]) })
9810
+ showTiers && step.escalations?.map((e, i) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "awr-step__escalated", children: [
9811
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("p", { className: "awr-step__escalated-line", children: [
9812
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ArrowUpIcon, { size: 12 }),
9813
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: L.escalated(L.tierNames[e.from], L.tierNames[e.to], L.escalationReasons[e.reason]) })
9557
9814
  ] }),
9558
- e.text?.trim() && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("details", { className: "awr-step__attempt", children: [
9559
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("summary", { children: L.escalatedAttemptText }),
9560
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "awr-step__text", children: e.text.trim() })
9815
+ e.text?.trim() && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("details", { className: "awr-step__attempt", children: [
9816
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("summary", { children: L.escalatedAttemptText }),
9817
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "awr-step__text", children: e.text.trim() })
9561
9818
  ] })
9562
9819
  ] }, i)),
9563
- showThoughts && step.reasoning.trim() && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("details", { className: "awr-thought", open: step.status === "running" && !step.text, children: [
9564
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("summary", { children: [
9565
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(BrainIcon, { size: 13 }),
9820
+ showThoughts && step.reasoning.trim() && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("details", { className: "awr-thought", open: step.status === "running" && !step.text, children: [
9821
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("summary", { children: [
9822
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(BrainIcon, { size: 13 }),
9566
9823
  " ",
9567
9824
  L.stepThoughts
9568
9825
  ] }),
9569
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "awr-thought__text", children: step.reasoning.trim() })
9826
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "awr-thought__text", children: step.reasoning.trim() })
9570
9827
  ] }),
9571
- step.text.trim() && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "awr-step__text", children: step.text.trim() }),
9572
- showToolCalls && step.toolCalls.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("ul", { className: "awr-step__tools", children: step.toolCalls.map((call, i) => {
9573
- const row = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
9828
+ step.text.trim() && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "awr-step__text", children: step.text.trim() }),
9829
+ showToolCalls && step.toolCalls.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("ul", { className: "awr-step__tools", children: step.toolCalls.map((call, i) => {
9830
+ const row = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
9574
9831
  ToolCallRow,
9575
9832
  {
9576
9833
  call,
@@ -9580,15 +9837,15 @@ var StepItem = ({
9580
9837
  },
9581
9838
  i
9582
9839
  );
9583
- return renderToolCall ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react23.Fragment, { children: renderToolCall(call, row) }, i) : row;
9840
+ return renderToolCall ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react24.Fragment, { children: renderToolCall(call, row) }, i) : row;
9584
9841
  }) }),
9585
- approvals.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("ul", { className: "awr-step__tools", children: approvals.map((a) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("li", { className: `awr-tool awr-tool__row awr-tool--approval-${a.status}`, children: [
9586
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ShieldIcon, { size: 13, className: "awr-tool__icon" }),
9587
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("code", { className: "awr-tool__name", children: a.name }),
9588
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "awr-tool__args", children: decisionLabel(a, L) }),
9589
- a.subagent && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "awr-tool__tag", children: L.subagentHelper })
9842
+ approvals.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("ul", { className: "awr-step__tools", children: approvals.map((a) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("li", { className: `awr-tool awr-tool__row awr-tool--approval-${a.status}`, children: [
9843
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ShieldIcon, { size: 13, className: "awr-tool__icon" }),
9844
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("code", { className: "awr-tool__name", children: a.name }),
9845
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "awr-tool__args", children: decisionLabel(a, L) }),
9846
+ a.subagent && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "awr-tool__tag", children: L.subagentHelper })
9590
9847
  ] }, a.id)) }),
9591
- showSubagents && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
9848
+ showSubagents && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
9592
9849
  SubagentTree,
9593
9850
  {
9594
9851
  subagents,
@@ -9597,14 +9854,14 @@ var StepItem = ({
9597
9854
  renderSubagent
9598
9855
  }
9599
9856
  ),
9600
- notes.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("ul", { className: "awr-notes", children: notes.map((n) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(UserNoteRow, { note: n }, n.id)) }),
9601
- step.blocked && step.summary && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "awr-step__blocked", children: step.summary }),
9602
- showReplanFailed && step.replanFailed && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("p", { className: "awr-step__warn", title: step.replanFailed, children: [
9603
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(AlertIcon, { size: 12 }),
9857
+ notes.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("ul", { className: "awr-notes", children: notes.map((n) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(UserNoteRow, { note: n }, n.id)) }),
9858
+ step.blocked && step.summary && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "awr-step__blocked", children: step.summary }),
9859
+ showReplanFailed && step.replanFailed && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("p", { className: "awr-step__warn", title: step.replanFailed, children: [
9860
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(AlertIcon, { size: 12 }),
9604
9861
  " ",
9605
9862
  L.replanFailed
9606
9863
  ] }),
9607
- showDecisions && step.decisions?.map((d, i) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
9864
+ showDecisions && step.decisions?.map((d, i) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
9608
9865
  "p",
9609
9866
  {
9610
9867
  className: `awr-step__decision${d.accepted ? "" : " awr-step__decision--fallback"}`,
@@ -9639,8 +9896,8 @@ var StepList = ({
9639
9896
  const known = new Set(steps.map((s) => s.id));
9640
9897
  const atEnd = showNotes ? notes.filter((n) => !n.stepId || !known.has(n.stepId)) : [];
9641
9898
  const loose = showSubagents ? subagents.filter((s) => !s.stepId || !known.has(s.stepId)) : [];
9642
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("ol", { className: ["awr-steps", className].filter(Boolean).join(" "), children: [
9643
- steps.map((step) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
9899
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("ol", { className: ["awr-steps", className].filter(Boolean).join(" "), children: [
9900
+ steps.map((step) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
9644
9901
  StepItem,
9645
9902
  {
9646
9903
  step,
@@ -9662,7 +9919,7 @@ var StepList = ({
9662
9919
  },
9663
9920
  step.id
9664
9921
  )),
9665
- loose.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("li", { className: "awr-step awr-step--subagents", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
9922
+ loose.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("li", { className: "awr-step awr-step--subagents", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
9666
9923
  SubagentTree,
9667
9924
  {
9668
9925
  subagents: loose,
@@ -9671,12 +9928,12 @@ var StepList = ({
9671
9928
  renderSubagent
9672
9929
  }
9673
9930
  ) }),
9674
- atEnd.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("li", { className: "awr-step awr-step--notes", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("ul", { className: "awr-notes", children: atEnd.map((n) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(UserNoteRow, { note: n }, n.id)) }) })
9931
+ atEnd.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("li", { className: "awr-step awr-step--notes", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("ul", { className: "awr-notes", children: atEnd.map((n) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(UserNoteRow, { note: n }, n.id)) }) })
9675
9932
  ] });
9676
9933
  };
9677
9934
 
9678
9935
  // src/components/MessageList.tsx
9679
- var import_jsx_runtime17 = require("react/jsx-runtime");
9936
+ var import_jsx_runtime18 = require("react/jsx-runtime");
9680
9937
  var usageLine = (usage, durationMs) => {
9681
9938
  const parts = [];
9682
9939
  if (usage && usage.totalTokens > 0) {
@@ -9710,8 +9967,8 @@ var AttachedAudio = ({
9710
9967
  const url = useFileUrl(files, a.path ?? "", files && a.path ? type : void 0);
9711
9968
  const length = lengthOf(a.durationMs);
9712
9969
  const said = length !== void 0 ? L.audioDuration(formatClock(length)) : void 0;
9713
- return url ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "awr-media awr-media--audio awr-msg__audio", title: a.path ?? a.name, children: [
9714
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
9970
+ return url ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "awr-media awr-media--audio awr-msg__audio", title: a.path ?? a.name, children: [
9971
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
9715
9972
  "audio",
9716
9973
  {
9717
9974
  className: "awr-media__audio",
@@ -9722,9 +9979,9 @@ var AttachedAudio = ({
9722
9979
  onLoadedMetadata: (e) => settleAudioDuration(e.currentTarget)
9723
9980
  }
9724
9981
  ),
9725
- said && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "awr-msg__audiolen", "aria-hidden": "true", children: said })
9726
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "awr-chip awr-file", title: a.path ?? a.mediaType, children: [
9727
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(WaveIcon, { size: 13 }),
9982
+ said && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "awr-msg__audiolen", "aria-hidden": "true", children: said })
9983
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "awr-chip awr-file", title: a.path ?? a.mediaType, children: [
9984
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(WaveIcon, { size: 13 }),
9728
9985
  " ",
9729
9986
  a.name,
9730
9987
  said ? ` \xB7 ${said}` : ""
@@ -9734,7 +9991,7 @@ var AttachmentView = ({
9734
9991
  attachment: a,
9735
9992
  files,
9736
9993
  labels
9737
- }) => mediaFamilyOf(a.mediaType) === "audio" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(AttachedAudio, { attachment: a, files, labels }) : a.dataUrl && a.mediaType.startsWith("image/") ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
9994
+ }) => mediaFamilyOf(a.mediaType) === "audio" ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(AttachedAudio, { attachment: a, files, labels }) : a.dataUrl && a.mediaType.startsWith("image/") ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
9738
9995
  ImageThumb,
9739
9996
  {
9740
9997
  src: a.dataUrl,
@@ -9743,8 +10000,8 @@ var AttachmentView = ({
9743
10000
  imgClassName: "awr-thumb awr-thumb--msg",
9744
10001
  title: a.path ?? a.name
9745
10002
  }
9746
- ) : /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "awr-chip awr-file", title: a.path ?? a.mediaType, children: [
9747
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(FileIcon, { size: 13 }),
10003
+ ) : /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "awr-chip awr-file", title: a.path ?? a.mediaType, children: [
10004
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(FileIcon, { size: 13 }),
9748
10005
  " ",
9749
10006
  a.name
9750
10007
  ] });
@@ -9785,6 +10042,7 @@ var MessageList = ({
9785
10042
  showSubagents = true,
9786
10043
  showMedia = true,
9787
10044
  showFileChips = true,
10045
+ showNamedFiles = showFileChips,
9788
10046
  files,
9789
10047
  htmlPreview,
9790
10048
  onShowFiles,
@@ -9812,128 +10070,157 @@ var MessageList = ({
9812
10070
  const L = useLabels(labels);
9813
10071
  const reader = useReadAloud(readAloud?.speak, readAloud?.lang);
9814
10072
  if (messages.length === 0) {
9815
- return empty ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "awr-messages__empty", children: empty }) : null;
9816
- }
9817
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ImageViewerProvider, { enabled: imageViewer, render: renderImageViewer, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: ["awr-messages", className].filter(Boolean).join(" "), children: messages.map((m) => {
9818
- const steps = m.steps ?? [];
9819
- const hasActivity = showActivity && (steps.length > 0 || (m.subagents?.length ?? 0) > 0 || m.pending && !!liveExtra);
9820
- const usage = showUsage ? usageLine(m.usage, m.durationMs) : "";
9821
- const cards = showToolCards && renderToolCard && m.role === "assistant" ? toolCardsOf(m, renderToolCard) : [];
9822
- const node = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
9823
- "div",
9824
- {
9825
- className: `awr-msg awr-msg--${m.role}${m.error ? " awr-msg--error" : ""}${m.pending ? " is-pending" : ""}`,
9826
- children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "awr-msg__col", children: [
9827
- m.role === "assistant" && hasActivity && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("details", { className: "awr-activity", open: m.pending || activityOpen, children: [
9828
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("summary", { className: "awr-activity__summary", children: activitySummary(
9829
- m,
9830
- showToolCalls,
9831
- showLearned,
9832
- showTiers,
9833
- showFileChips,
9834
- L,
9835
- showApps && Boolean(renderApp)
9836
- ) }),
9837
- m.pending && liveExtra,
9838
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
9839
- StepList,
9840
- {
9841
- steps,
9842
- subagents: m.subagents,
9843
- approvals: m.approvals,
9844
- notes: m.notes,
9845
- showNotes,
9846
- onStopSubagent: m.pending ? onStopSubagent : void 0,
9847
- showToolCalls,
9848
- showUsage,
9849
- showThoughts,
9850
- showTiers,
9851
- showReplanFailed,
9852
- showDecisions,
9853
- showSearchResults,
9854
- showSubagents,
9855
- renderToolCall,
9856
- renderSubagent,
9857
- labels
9858
- }
9859
- ),
9860
- showLearned && m.fetches?.length ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("ul", { className: "awr-fetches", children: m.fetches.map((f, i) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
9861
- "li",
9862
- {
9863
- className: `awr-fetch${f.allowed ? "" : " awr-fetch--refused"}`,
9864
- children: [
9865
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(GlobeIcon, { size: 12 }),
9866
- " ",
9867
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("code", { children: f.url }),
10073
+ return empty ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "awr-messages__empty", children: empty }) : null;
10074
+ }
10075
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
10076
+ TranscriptContext,
10077
+ {
10078
+ imageViewer,
10079
+ renderImageViewer,
10080
+ files: showFileChips || showNamedFiles ? files : void 0,
10081
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: ["awr-messages", className].filter(Boolean).join(" "), children: messages.map((m) => {
10082
+ const steps = m.steps ?? [];
10083
+ const hasActivity = showActivity && (steps.length > 0 || (m.subagents?.length ?? 0) > 0 || m.pending && !!liveExtra);
10084
+ const usage = showUsage ? usageLine(m.usage, m.durationMs) : "";
10085
+ const cards = showToolCards && renderToolCard && m.role === "assistant" ? toolCardsOf(m, renderToolCard) : [];
10086
+ const node = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
10087
+ "div",
10088
+ {
10089
+ className: `awr-msg awr-msg--${m.role}${m.error ? " awr-msg--error" : ""}${m.pending ? " is-pending" : ""}`,
10090
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "awr-msg__col", children: [
10091
+ m.role === "assistant" && hasActivity && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("details", { className: "awr-activity", open: m.pending || activityOpen, children: [
10092
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("summary", { className: "awr-activity__summary", children: activitySummary(
10093
+ m,
10094
+ showToolCalls,
10095
+ showLearned,
10096
+ showTiers,
10097
+ showFileChips,
10098
+ L,
10099
+ showApps && Boolean(renderApp)
10100
+ ) }),
10101
+ m.pending && liveExtra,
10102
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
10103
+ StepList,
10104
+ {
10105
+ steps,
10106
+ subagents: m.subagents,
10107
+ approvals: m.approvals,
10108
+ notes: m.notes,
10109
+ showNotes,
10110
+ onStopSubagent: m.pending ? onStopSubagent : void 0,
10111
+ showToolCalls,
10112
+ showUsage,
10113
+ showThoughts,
10114
+ showTiers,
10115
+ showReplanFailed,
10116
+ showDecisions,
10117
+ showSearchResults,
10118
+ showSubagents,
10119
+ renderToolCall,
10120
+ renderSubagent,
10121
+ labels
10122
+ }
10123
+ ),
10124
+ showLearned && m.fetches?.length ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("ul", { className: "awr-fetches", children: m.fetches.map((f, i) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
10125
+ "li",
10126
+ {
10127
+ className: `awr-fetch${f.allowed ? "" : " awr-fetch--refused"}`,
10128
+ children: [
10129
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(GlobeIcon, { size: 12 }),
10130
+ " ",
10131
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("code", { children: f.url }),
10132
+ " ",
10133
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "awr-fetch__result", children: f.allowed ? f.status ?? "ok" : L.fetchRefused(f.reason ?? "") })
10134
+ ]
10135
+ },
10136
+ i
10137
+ )) }) : null,
10138
+ showLearned && m.learned?.length ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("p", { className: "awr-learned", children: [
10139
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(BookIcon, { size: 12 }),
9868
10140
  " ",
9869
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "awr-fetch__result", children: f.allowed ? f.status ?? "ok" : L.fetchRefused(f.reason ?? "") })
9870
- ]
9871
- },
9872
- i
9873
- )) }) : null,
9874
- showLearned && m.learned?.length ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("p", { className: "awr-learned", children: [
9875
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(BookIcon, { size: 12 }),
9876
- " ",
9877
- L.learnedNow(m.learned.join(", "))
9878
- ] }) : null,
9879
- showThoughts && m.reasoning?.trim() && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("details", { className: "awr-thought", children: [
9880
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("summary", { children: [
9881
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(BrainIcon, { size: 13 }),
9882
- " ",
9883
- L.answerThoughts
10141
+ L.learnedNow(m.learned.join(", "))
10142
+ ] }) : null,
10143
+ showThoughts && m.reasoning?.trim() && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("details", { className: "awr-thought", children: [
10144
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("summary", { children: [
10145
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(BrainIcon, { size: 13 }),
10146
+ " ",
10147
+ L.answerThoughts
10148
+ ] }),
10149
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "awr-thought__text", children: m.reasoning.trim() })
10150
+ ] })
9884
10151
  ] }),
9885
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "awr-thought__text", children: m.reasoning.trim() })
10152
+ cards.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "awr-msg__cards", children: cards.map((card) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "awr-msg__card", children: card.node }, card.key)) }),
10153
+ showApps && renderApp && m.role === "assistant" && m.apps?.length ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "awr-msg__apps", children: m.apps.map((app) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "awr-msg__app", children: renderApp(app, m) }, app.id)) }) : null,
10154
+ showMedia && m.transcripts?.length ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "awr-msg__transcripts", children: m.transcripts.map((t, i) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TranscriptBlock, { transcript: t, labels }, i)) }) : null,
10155
+ (m.content || m.pending || !m.attachments?.length) && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "awr-msg__bubble", children: [
10156
+ m.content ? renderContent ? renderContent(m) : m.content : m.stopped && !m.pending ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "awr-msg__stopped", children: L.answerStopped }) : null,
10157
+ m.pending && !m.content && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(SpinnerIcon, { size: 14, className: "awr-msg__pending" })
10158
+ ] }),
10159
+ readAloud && m.role === "assistant" && m.content && !m.pending && !m.error && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
10160
+ ReadAloudControl,
10161
+ {
10162
+ id: m.id,
10163
+ text: () => readAloud.textOf ? readAloud.textOf(m) : speakableText(m.content, { code: L.readAloudCode }),
10164
+ reader,
10165
+ labels: L
10166
+ }
10167
+ ),
10168
+ showMedia && m.media?.length ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "awr-msg__media", children: m.media.map((item, i) => {
10169
+ const built = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(GeneratedMedia, { media: item, files, labels }, i);
10170
+ return renderMedia ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "awr-msg__mediaitem", children: renderMedia(item, m, built) }, i) : built;
10171
+ }) }) : null,
10172
+ showFileChips && m.role === "assistant" && m.writtenFiles?.length ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
10173
+ FileChips,
10174
+ {
10175
+ written: m.writtenFiles,
10176
+ files,
10177
+ htmlPreview,
10178
+ onShowFiles,
10179
+ renderFile: renderFile ? (f, fallback) => renderFile(f, m, fallback) : void 0,
10180
+ renderFileContent,
10181
+ labels
10182
+ }
10183
+ ) : null,
10184
+ showNamedFiles && files && m.role === "assistant" && !m.pending && m.content ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
10185
+ NamedFileChips,
10186
+ {
10187
+ text: m.content,
10188
+ files,
10189
+ exclude: [
10190
+ ...showFileChips ? (m.writtenFiles ?? []).map((f) => f.path) : [],
10191
+ ...showMedia ? (m.media ?? []).map((x) => x.path) : []
10192
+ ],
10193
+ htmlPreview,
10194
+ renderFile: renderFile ? (f, fallback) => renderFile(f, m, fallback) : void 0,
10195
+ renderFileContent,
10196
+ labels
10197
+ }
10198
+ ) : null,
10199
+ m.attachments?.length ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
10200
+ "div",
10201
+ {
10202
+ className: "awr-msg__attachments",
10203
+ role: "group",
10204
+ "aria-label": m.content.trim() ? L.attachments : attachmentsText(m.attachments, { voiceMessage: L.voiceMessage }),
10205
+ children: m.attachments.map((a, i) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "awr-msg__attachment", children: renderAttachment ? renderAttachment(a, m) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(AttachmentView, { attachment: a, files, labels }) }, i))
10206
+ }
10207
+ ) : null,
10208
+ m.role === "assistant" && usage && !m.pending && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "awr-msg__usage", title: L.usageTitle, children: usage })
9886
10209
  ] })
9887
- ] }),
9888
- cards.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "awr-msg__cards", children: cards.map((card) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "awr-msg__card", children: card.node }, card.key)) }),
9889
- showApps && renderApp && m.role === "assistant" && m.apps?.length ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "awr-msg__apps", children: m.apps.map((app) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "awr-msg__app", children: renderApp(app, m) }, app.id)) }) : null,
9890
- showMedia && m.transcripts?.length ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "awr-msg__transcripts", children: m.transcripts.map((t, i) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TranscriptBlock, { transcript: t, labels }, i)) }) : null,
9891
- (m.content || m.pending || !m.attachments?.length) && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "awr-msg__bubble", children: [
9892
- m.content ? renderContent ? renderContent(m) : m.content : m.stopped && !m.pending ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "awr-msg__stopped", children: L.answerStopped }) : null,
9893
- m.pending && !m.content && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SpinnerIcon, { size: 14, className: "awr-msg__pending" })
9894
- ] }),
9895
- readAloud && m.role === "assistant" && m.content && !m.pending && !m.error && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
9896
- ReadAloudControl,
9897
- {
9898
- id: m.id,
9899
- text: () => readAloud.textOf ? readAloud.textOf(m) : speakableText(m.content, { code: L.readAloudCode }),
9900
- reader,
9901
- labels: L
9902
- }
9903
- ),
9904
- showMedia && m.media?.length ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "awr-msg__media", children: m.media.map((item, i) => {
9905
- const built = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(GeneratedMedia, { media: item, files, labels }, i);
9906
- return renderMedia ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "awr-msg__mediaitem", children: renderMedia(item, m, built) }, i) : built;
9907
- }) }) : null,
9908
- showFileChips && m.role === "assistant" && m.writtenFiles?.length ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
9909
- FileChips,
9910
- {
9911
- written: m.writtenFiles,
9912
- files,
9913
- htmlPreview,
9914
- onShowFiles,
9915
- renderFile: renderFile ? (f, fallback) => renderFile(f, m, fallback) : void 0,
9916
- renderFileContent,
9917
- labels
9918
- }
9919
- ) : null,
9920
- m.attachments?.length ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
9921
- "div",
9922
- {
9923
- className: "awr-msg__attachments",
9924
- role: "group",
9925
- "aria-label": m.content.trim() ? L.attachments : attachmentsText(m.attachments, { voiceMessage: L.voiceMessage }),
9926
- children: m.attachments.map((a, i) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "awr-msg__attachment", children: renderAttachment ? renderAttachment(a, m) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(AttachmentView, { attachment: a, files, labels }) }, i))
9927
- }
9928
- ) : null,
9929
- m.role === "assistant" && usage && !m.pending && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "awr-msg__usage", title: L.usageTitle, children: usage })
9930
- ] })
9931
- },
9932
- m.id
9933
- );
9934
- return renderMessage ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { children: renderMessage(m, node) }, m.id) : node;
9935
- }) }) });
10210
+ },
10211
+ m.id
10212
+ );
10213
+ return renderMessage ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { children: renderMessage(m, node) }, m.id) : node;
10214
+ }) })
10215
+ }
10216
+ );
9936
10217
  };
10218
+ var TranscriptContext = ({
10219
+ imageViewer,
10220
+ renderImageViewer,
10221
+ files,
10222
+ children
10223
+ }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ImageViewerProvider, { enabled: imageViewer, render: renderImageViewer, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(WorkspaceListingProvider, { files, children }) });
9937
10224
  var ReadAloudControl = ({
9938
10225
  id,
9939
10226
  text: text2,
@@ -9942,8 +10229,8 @@ var ReadAloudControl = ({
9942
10229
  }) => {
9943
10230
  const mine = reader.current === id;
9944
10231
  const failed = reader.failed?.id === id ? reader.failed : void 0;
9945
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "awr-readaloud", "data-state": mine ? reader.state : "idle", children: [
9946
- !mine ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
10232
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "awr-readaloud", "data-state": mine ? reader.state : "idle", children: [
10233
+ !mine ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
9947
10234
  "button",
9948
10235
  {
9949
10236
  type: "button",
@@ -9951,17 +10238,17 @@ var ReadAloudControl = ({
9951
10238
  onClick: () => reader.start(id, text2()),
9952
10239
  "aria-label": L.readAloud,
9953
10240
  children: [
9954
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SpeakerIcon, { size: 14 }),
10241
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(SpeakerIcon, { size: 14 }),
9955
10242
  " ",
9956
10243
  L.readAloud
9957
10244
  ]
9958
10245
  }
9959
- ) : /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
9960
- reader.state === "loading" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "awr-readaloud__status", role: "status", children: [
9961
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SpinnerIcon, { size: 14 }),
10246
+ ) : /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
10247
+ reader.state === "loading" ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "awr-readaloud__status", role: "status", children: [
10248
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(SpinnerIcon, { size: 14 }),
9962
10249
  " ",
9963
10250
  L.readAloudLoading
9964
- ] }) : reader.state === "paused" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
10251
+ ] }) : reader.state === "paused" ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
9965
10252
  "button",
9966
10253
  {
9967
10254
  type: "button",
@@ -9969,12 +10256,12 @@ var ReadAloudControl = ({
9969
10256
  onClick: reader.resume,
9970
10257
  "aria-label": L.readAloudResume,
9971
10258
  children: [
9972
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(PlayIcon, { size: 14 }),
10259
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(PlayIcon, { size: 14 }),
9973
10260
  " ",
9974
10261
  L.readAloudResume
9975
10262
  ]
9976
10263
  }
9977
- ) : /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
10264
+ ) : /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
9978
10265
  "button",
9979
10266
  {
9980
10267
  type: "button",
@@ -9982,13 +10269,13 @@ var ReadAloudControl = ({
9982
10269
  onClick: reader.pause,
9983
10270
  "aria-label": L.readAloudPause,
9984
10271
  children: [
9985
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(PauseIcon, { size: 14 }),
10272
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(PauseIcon, { size: 14 }),
9986
10273
  " ",
9987
10274
  L.readAloudPause
9988
10275
  ]
9989
10276
  }
9990
10277
  ),
9991
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
10278
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
9992
10279
  "button",
9993
10280
  {
9994
10281
  type: "button",
@@ -9996,39 +10283,39 @@ var ReadAloudControl = ({
9996
10283
  onClick: reader.stop,
9997
10284
  "aria-label": L.readAloudStop,
9998
10285
  children: [
9999
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(StopIcon, { size: 14 }),
10286
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(StopIcon, { size: 14 }),
10000
10287
  " ",
10001
10288
  L.readAloudStop
10002
10289
  ]
10003
10290
  }
10004
10291
  )
10005
10292
  ] }),
10006
- failed && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "awr-readaloud__error", role: "alert", children: failed.message ?? L.readAloudFailed })
10293
+ failed && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "awr-readaloud__error", role: "alert", children: failed.message ?? L.readAloudFailed })
10007
10294
  ] });
10008
10295
  };
10009
10296
 
10010
10297
  // src/components/ModelLoadBar.tsx
10011
- var import_jsx_runtime18 = require("react/jsx-runtime");
10298
+ var import_jsx_runtime19 = require("react/jsx-runtime");
10012
10299
  var ModelLoadBar = ({ load, className }) => {
10013
10300
  const pct = Math.round(Math.max(0, Math.min(1, load.progress)) * 100);
10014
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: ["awr-modelload", className].filter(Boolean).join(" "), children: [
10015
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "awr-modelload__head", children: [
10016
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "awr-modelload__text", children: load.text || "Loading model\u2026" }),
10017
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "awr-modelload__pct", children: [
10301
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: ["awr-modelload", className].filter(Boolean).join(" "), children: [
10302
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "awr-modelload__head", children: [
10303
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "awr-modelload__text", children: load.text || "Loading model\u2026" }),
10304
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { className: "awr-modelload__pct", children: [
10018
10305
  pct,
10019
10306
  "%"
10020
10307
  ] })
10021
10308
  ] }),
10022
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "awr-modelload__track", role: "progressbar", "aria-valuenow": pct, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "awr-modelload__fill", style: { width: `${pct}%` } }) })
10309
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "awr-modelload__track", role: "progressbar", "aria-valuenow": pct, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "awr-modelload__fill", style: { width: `${pct}%` } }) })
10023
10310
  ] });
10024
10311
  };
10025
10312
 
10026
10313
  // src/components/QuestionPrompt.tsx
10027
- var import_react24 = require("react");
10028
- var import_jsx_runtime19 = require("react/jsx-runtime");
10314
+ var import_react25 = require("react");
10315
+ var import_jsx_runtime20 = require("react/jsx-runtime");
10029
10316
  var useNow2 = (active) => {
10030
- const [now, setNow] = (0, import_react24.useState)(() => Date.now());
10031
- (0, import_react24.useEffect)(() => {
10317
+ const [now, setNow] = (0, import_react25.useState)(() => Date.now());
10318
+ (0, import_react25.useEffect)(() => {
10032
10319
  if (!active) return;
10033
10320
  setNow(Date.now());
10034
10321
  const timer = setInterval(() => setNow(Date.now()), 1e3);
@@ -10038,7 +10325,7 @@ var useNow2 = (active) => {
10038
10325
  };
10039
10326
  var Expiry2 = ({ expiresAt, L }) => {
10040
10327
  const now = useNow2(true);
10041
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "awr-question__expiry", children: L.questionExpiresIn(formatCountdown(expiresAt - now)) });
10328
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "awr-question__expiry", children: L.questionExpiresIn(formatCountdown(expiresAt - now)) });
10042
10329
  };
10043
10330
  var reasonText2 = (q, L) => {
10044
10331
  const key = q.reason ?? q.status;
@@ -10057,15 +10344,15 @@ var QuestionCard = ({
10057
10344
  numberKeys,
10058
10345
  L
10059
10346
  }) => {
10060
- const baseId = (0, import_react24.useId)();
10347
+ const baseId = (0, import_react25.useId)();
10061
10348
  const textId = `${baseId}-q`;
10062
10349
  const otherId = `${baseId}-other`;
10063
- const [picked, setPicked] = (0, import_react24.useState)([]);
10064
- const [otherOpen, setOtherOpen] = (0, import_react24.useState)(false);
10065
- const [otherText, setOtherText] = (0, import_react24.useState)("");
10066
- const otherField = (0, import_react24.useRef)(null);
10067
- const otherButton = (0, import_react24.useRef)(null);
10068
- (0, import_react24.useEffect)(() => {
10350
+ const [picked, setPicked] = (0, import_react25.useState)([]);
10351
+ const [otherOpen, setOtherOpen] = (0, import_react25.useState)(false);
10352
+ const [otherText, setOtherText] = (0, import_react25.useState)("");
10353
+ const otherField = (0, import_react25.useRef)(null);
10354
+ const otherButton = (0, import_react25.useRef)(null);
10355
+ (0, import_react25.useEffect)(() => {
10069
10356
  if (otherOpen) otherField.current?.focus();
10070
10357
  }, [otherOpen]);
10071
10358
  const helper = showHelper && q.subagent ? { ...q.subagent, ...view?.subagent } : void 0;
@@ -10092,7 +10379,7 @@ var QuestionCard = ({
10092
10379
  e.preventDefault();
10093
10380
  pick(option.label);
10094
10381
  };
10095
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
10382
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
10096
10383
  "section",
10097
10384
  {
10098
10385
  className: `awr-question${q.multiple ? " awr-question--multiple" : ""}${helper ? " awr-question--helper" : ""}`,
@@ -10102,16 +10389,16 @@ var QuestionCard = ({
10102
10389
  "data-subagent": helper?.id,
10103
10390
  onKeyDown,
10104
10391
  children: [
10105
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "awr-question__head", children: [
10106
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(QuestionIcon, { size: 16, className: "awr-question__icon" }),
10107
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "awr-question__lead", role: "alert", children: leadOf(helper, L) }),
10108
- total > 1 && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "awr-question__count", children: L.questionCount(index, total) })
10392
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "awr-question__head", children: [
10393
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(QuestionIcon, { size: 16, className: "awr-question__icon" }),
10394
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "awr-question__lead", role: "alert", children: leadOf(helper, L) }),
10395
+ total > 1 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "awr-question__count", children: L.questionCount(index, total) })
10109
10396
  ] }),
10110
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "awr-question__text", id: textId, children: q.question }),
10111
- q.multiple && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "awr-question__hint", children: L.questionSeveral }),
10112
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "awr-question__options", children: q.options.map((o, i) => {
10397
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "awr-question__text", id: textId, children: q.question }),
10398
+ q.multiple && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "awr-question__hint", children: L.questionSeveral }),
10399
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "awr-question__options", children: q.options.map((o, i) => {
10113
10400
  const on = picked.includes(o.label);
10114
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
10401
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
10115
10402
  "button",
10116
10403
  {
10117
10404
  type: "button",
@@ -10121,21 +10408,21 @@ var QuestionCard = ({
10121
10408
  "aria-keyshortcuts": numberKeys && i < 9 ? String(i + 1) : void 0,
10122
10409
  onClick: () => pick(o.label),
10123
10410
  children: [
10124
- numberKeys && i < 9 && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "awr-question__key", "aria-hidden": "true", children: i + 1 }),
10125
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { className: "awr-question__body", children: [
10126
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "awr-question__label", children: o.label }),
10127
- o.description && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "awr-question__desc", children: o.description })
10411
+ numberKeys && i < 9 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "awr-question__key", "aria-hidden": "true", children: i + 1 }),
10412
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { className: "awr-question__body", children: [
10413
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "awr-question__label", children: o.label }),
10414
+ o.description && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "awr-question__desc", children: o.description })
10128
10415
  ] }),
10129
- q.multiple && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "awr-question__mark", "aria-hidden": "true", children: on && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CheckIcon, { size: 14 }) })
10416
+ q.multiple && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "awr-question__mark", "aria-hidden": "true", children: on && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CheckIcon, { size: 14 }) })
10130
10417
  ]
10131
10418
  },
10132
10419
  o.label
10133
10420
  );
10134
10421
  }) }),
10135
- q.allowOther && otherOpen && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("form", { className: "awr-question__other", onSubmit: sendOther, children: [
10136
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("label", { className: "awr-question__otherlabel", htmlFor: otherId, children: L.questionOtherLabel }),
10137
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "awr-question__otherrow", children: [
10138
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
10422
+ q.allowOther && otherOpen && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("form", { className: "awr-question__other", onSubmit: sendOther, children: [
10423
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("label", { className: "awr-question__otherlabel", htmlFor: otherId, children: L.questionOtherLabel }),
10424
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "awr-question__otherrow", children: [
10425
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
10139
10426
  "input",
10140
10427
  {
10141
10428
  ref: otherField,
@@ -10154,11 +10441,11 @@ var QuestionCard = ({
10154
10441
  }
10155
10442
  }
10156
10443
  ),
10157
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "submit", className: "awr-btn awr-btn--primary", disabled: !other, children: L.questionSend })
10444
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "submit", className: "awr-btn awr-btn--primary", disabled: !other, children: L.questionSend })
10158
10445
  ] })
10159
10446
  ] }),
10160
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "awr-question__actions", children: [
10161
- q.multiple && !otherOpen && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
10447
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "awr-question__actions", children: [
10448
+ q.multiple && !otherOpen && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
10162
10449
  "button",
10163
10450
  {
10164
10451
  type: "button",
@@ -10168,7 +10455,7 @@ var QuestionCard = ({
10168
10455
  children: L.questionSend
10169
10456
  }
10170
10457
  ),
10171
- q.allowOther && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
10458
+ q.allowOther && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
10172
10459
  "button",
10173
10460
  {
10174
10461
  ref: otherButton,
@@ -10180,7 +10467,7 @@ var QuestionCard = ({
10180
10467
  children: L.questionOther
10181
10468
  }
10182
10469
  ),
10183
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
10470
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
10184
10471
  "button",
10185
10472
  {
10186
10473
  type: "button",
@@ -10190,14 +10477,14 @@ var QuestionCard = ({
10190
10477
  }
10191
10478
  )
10192
10479
  ] }),
10193
- showExpiry && q.expiresAt !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Expiry2, { expiresAt: q.expiresAt, L })
10480
+ showExpiry && q.expiresAt !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Expiry2, { expiresAt: q.expiresAt, L })
10194
10481
  ]
10195
10482
  }
10196
10483
  );
10197
10484
  };
10198
10485
  var RemoteQuestion = ({ view, L }) => {
10199
- const textId = `${(0, import_react24.useId)()}-q`;
10200
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
10486
+ const textId = `${(0, import_react25.useId)()}-q`;
10487
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
10201
10488
  "section",
10202
10489
  {
10203
10490
  className: "awr-question awr-question--remote",
@@ -10205,16 +10492,16 @@ var RemoteQuestion = ({ view, L }) => {
10205
10492
  "aria-labelledby": textId,
10206
10493
  "data-question": view.id,
10207
10494
  children: [
10208
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "awr-question__head", children: [
10209
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(QuestionIcon, { size: 16, className: "awr-question__icon" }),
10210
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "awr-question__lead", children: leadOf(view.subagent, L) })
10495
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "awr-question__head", children: [
10496
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(QuestionIcon, { size: 16, className: "awr-question__icon" }),
10497
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "awr-question__lead", children: leadOf(view.subagent, L) })
10211
10498
  ] }),
10212
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "awr-question__text", id: textId, children: view.question }),
10213
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("ul", { className: "awr-question__list", children: view.options.map((o) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("li", { children: [
10214
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "awr-question__label", children: o.label }),
10215
- o.description && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "awr-question__desc", children: o.description })
10499
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "awr-question__text", id: textId, children: view.question }),
10500
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("ul", { className: "awr-question__list", children: view.options.map((o) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("li", { children: [
10501
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "awr-question__label", children: o.label }),
10502
+ o.description && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "awr-question__desc", children: o.description })
10216
10503
  ] }, o.label)) }),
10217
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "awr-question__remote", role: "status", children: L.questionRemote })
10504
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "awr-question__remote", role: "status", children: L.questionRemote })
10218
10505
  ]
10219
10506
  }
10220
10507
  );
@@ -10233,7 +10520,7 @@ var QuestionPrompt = ({
10233
10520
  className
10234
10521
  }) => {
10235
10522
  const L = useLabels(labels);
10236
- const [dismissed, setDismissed] = (0, import_react24.useState)(() => /* @__PURE__ */ new Set());
10523
+ const [dismissed, setDismissed] = (0, import_react25.useState)(() => /* @__PURE__ */ new Set());
10237
10524
  const automatic = showOutcomes ? (outcomes ?? []).filter(
10238
10525
  (o) => o.automatic === true && o.status !== "pending" && o.status !== "stopped" && !dismissed.has(o.id)
10239
10526
  ) : [];
@@ -10243,7 +10530,7 @@ var QuestionPrompt = ({
10243
10530
  let card = null;
10244
10531
  if (current) {
10245
10532
  const answer = (a) => onAnswer(current.id, a);
10246
- const builtIn = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
10533
+ const builtIn = /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
10247
10534
  QuestionCard,
10248
10535
  {
10249
10536
  question: current,
@@ -10260,21 +10547,21 @@ var QuestionPrompt = ({
10260
10547
  );
10261
10548
  card = renderQuestion ? renderQuestion(current, builtIn, answer) : builtIn;
10262
10549
  }
10263
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: ["awr-questions", className].filter(Boolean).join(" "), children: [
10264
- automatic.map((o) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
10550
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: ["awr-questions", className].filter(Boolean).join(" "), children: [
10551
+ automatic.map((o) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
10265
10552
  "div",
10266
10553
  {
10267
10554
  className: "awr-question-outcome",
10268
10555
  role: "status",
10269
10556
  "data-reason": o.reason ?? o.status,
10270
10557
  children: [
10271
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(AlertIcon, { size: 14, className: "awr-question-outcome__icon" }),
10272
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { className: "awr-question-outcome__text", children: [
10558
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(AlertIcon, { size: 14, className: "awr-question-outcome__icon" }),
10559
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { className: "awr-question-outcome__text", children: [
10273
10560
  L.questionAutomatic(reasonText2(o, L)),
10274
10561
  " ",
10275
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("q", { className: "awr-question-outcome__question", children: o.question })
10562
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("q", { className: "awr-question-outcome__question", children: o.question })
10276
10563
  ] }),
10277
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
10564
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
10278
10565
  "button",
10279
10566
  {
10280
10567
  type: "button",
@@ -10282,20 +10569,20 @@ var QuestionPrompt = ({
10282
10569
  "aria-label": L.questionDismiss,
10283
10570
  title: L.questionDismiss,
10284
10571
  onClick: () => setDismissed((d) => new Set(d).add(o.id)),
10285
- children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(XIcon, { size: 14 })
10572
+ children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(XIcon, { size: 14 })
10286
10573
  }
10287
10574
  )
10288
10575
  ]
10289
10576
  },
10290
10577
  o.id
10291
10578
  )),
10292
- remote.map((o) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(RemoteQuestion, { view: o, L }, o.id)),
10579
+ remote.map((o) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(RemoteQuestion, { view: o, L }, o.id)),
10293
10580
  card
10294
10581
  ] });
10295
10582
  };
10296
10583
 
10297
10584
  // src/components/ToolApprovalPrompt.tsx
10298
- var import_jsx_runtime20 = require("react/jsx-runtime");
10585
+ var import_jsx_runtime21 = require("react/jsx-runtime");
10299
10586
  var SkillConsentCard = ({
10300
10587
  approval: a,
10301
10588
  skill,
@@ -10305,7 +10592,7 @@ var SkillConsentCard = ({
10305
10592
  showPreview,
10306
10593
  onApprove,
10307
10594
  onDeny
10308
- }) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
10595
+ }) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
10309
10596
  "div",
10310
10597
  {
10311
10598
  className: `awr-approval awr-approval--skill${helper ? " awr-approval--helper" : ""}`,
@@ -10313,28 +10600,28 @@ var SkillConsentCard = ({
10313
10600
  "data-skill-server": skill.server,
10314
10601
  "data-subagent": helper?.id,
10315
10602
  children: [
10316
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "awr-approval__head", children: [
10317
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ShieldIcon, { size: 14, className: "awr-approval__icon" }),
10318
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: L.skillConsentLead(skill.server, skill.skill) })
10603
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "awr-approval__head", children: [
10604
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ShieldIcon, { size: 14, className: "awr-approval__icon" }),
10605
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: L.skillConsentLead(skill.server, skill.skill) })
10319
10606
  ] }),
10320
- skill.description && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "awr-approval__quote", children: skill.description }),
10321
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("p", { className: "awr-approval__skillmeta", children: [
10322
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("code", { className: "awr-tool__name", children: skill.name }),
10323
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: L.skillConsentSize(skill.size, skill.fileCount) })
10607
+ skill.description && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "awr-approval__quote", children: skill.description }),
10608
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("p", { className: "awr-approval__skillmeta", children: [
10609
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("code", { className: "awr-tool__name", children: skill.name }),
10610
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: L.skillConsentSize(skill.size, skill.fileCount) })
10324
10611
  ] }),
10325
- skill.byUri && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "awr-approval__from", children: L.skillConsentByUri }),
10326
- skill.nestedIn && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "awr-approval__from awr-approval__nested", children: L.skillConsentNested(skill.nestedIn) }),
10327
- skill.dynamic && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "awr-approval__from awr-approval__dynamic", children: L.skillConsentDynamic }),
10328
- skill.dynamic && skill.noFileListing && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "awr-approval__from", children: L.skillConsentNoFileListing }),
10329
- showPreview && skill.body !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("details", { className: "awr-approval__preview", children: [
10330
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("summary", { children: L.skillConsentPreview }),
10331
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("pre", { className: "awr-approval__quote awr-approval__body", children: skill.body }),
10332
- skill.files.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "awr-approval__from", children: L.skillConsentFiles(skill.files.join(", "), skill.fileCount - skill.files.length) })
10612
+ skill.byUri && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "awr-approval__from", children: L.skillConsentByUri }),
10613
+ skill.nestedIn && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "awr-approval__from awr-approval__nested", children: L.skillConsentNested(skill.nestedIn) }),
10614
+ skill.dynamic && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "awr-approval__from awr-approval__dynamic", children: L.skillConsentDynamic }),
10615
+ skill.dynamic && skill.noFileListing && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "awr-approval__from", children: L.skillConsentNoFileListing }),
10616
+ showPreview && skill.body !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("details", { className: "awr-approval__preview", children: [
10617
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("summary", { children: L.skillConsentPreview }),
10618
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("pre", { className: "awr-approval__quote awr-approval__body", children: skill.body }),
10619
+ skill.files.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "awr-approval__from", children: L.skillConsentFiles(skill.files.join(", "), skill.fileCount - skill.files.length) })
10333
10620
  ] }),
10334
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "awr-approval__from", children: L.skillConsentNote(skill.server, skill.consent) }),
10335
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "awr-approval__actions", children: [
10336
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", className: "awr-btn awr-btn--primary", onClick: () => onApprove(a.id), children: L.skillConsentAllow }),
10337
- allowRemember && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
10621
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "awr-approval__from", children: L.skillConsentNote(skill.server, skill.consent) }),
10622
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "awr-approval__actions", children: [
10623
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { type: "button", className: "awr-btn awr-btn--primary", onClick: () => onApprove(a.id), children: L.skillConsentAllow }),
10624
+ allowRemember && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
10338
10625
  "button",
10339
10626
  {
10340
10627
  type: "button",
@@ -10343,7 +10630,7 @@ var SkillConsentCard = ({
10343
10630
  children: L.skillConsentAlways
10344
10631
  }
10345
10632
  ),
10346
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
10633
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
10347
10634
  "button",
10348
10635
  {
10349
10636
  type: "button",
@@ -10369,9 +10656,9 @@ var ToolApprovalPrompt = ({
10369
10656
  }) => {
10370
10657
  const L = useLabels(labels);
10371
10658
  if (approvals.length === 0) return null;
10372
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: ["awr-approvals", className].filter(Boolean).join(" "), role: "alert", children: approvals.map((a) => {
10659
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: ["awr-approvals", className].filter(Boolean).join(" "), role: "alert", children: approvals.map((a) => {
10373
10660
  if (a.skill) {
10374
- const card2 = /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
10661
+ const card2 = /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
10375
10662
  SkillConsentCard,
10376
10663
  {
10377
10664
  approval: a,
@@ -10385,33 +10672,33 @@ var ToolApprovalPrompt = ({
10385
10672
  },
10386
10673
  a.id
10387
10674
  );
10388
- return renderApproval ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { children: renderApproval(a, card2) }, a.id) : card2;
10675
+ return renderApproval ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { children: renderApproval(a, card2) }, a.id) : card2;
10389
10676
  }
10390
10677
  const helper = showHelper ? a.subagent : void 0;
10391
10678
  const app = a.app;
10392
- const card = /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
10679
+ const card = /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
10393
10680
  "div",
10394
10681
  {
10395
10682
  className: `awr-approval${helper ? " awr-approval--helper" : ""}${app ? " awr-approval--app" : ""}`,
10396
10683
  "data-subagent": helper?.id,
10397
10684
  "data-app-server": app?.server,
10398
10685
  children: [
10399
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "awr-approval__head", children: [
10400
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ShieldIcon, { size: 14, className: "awr-approval__icon" }),
10401
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { children: [
10686
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "awr-approval__head", children: [
10687
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ShieldIcon, { size: 14, className: "awr-approval__icon" }),
10688
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { children: [
10402
10689
  app ? L.approvalLeadApp(app.server) : helper ? L.approvalLeadHelper(
10403
10690
  previewValue(helper.role ?? "", 60) || void 0,
10404
10691
  helper.depth
10405
10692
  ) : L.approvalLead,
10406
10693
  " ",
10407
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("code", { className: "awr-tool__name", children: app ? app.tool : a.name }),
10694
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("code", { className: "awr-tool__name", children: app ? app.tool : a.name }),
10408
10695
  a.readOnly && !app ? ` (${L.readOnlyTool})` : ""
10409
10696
  ] })
10410
10697
  ] }),
10411
- previewValue(a.input, 300) && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("pre", { className: "awr-approval__input", children: previewValue(a.input, 300) }),
10412
- app && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "awr-approval__from", children: L.approvalFromApp(app.server, a.readOnly) }),
10413
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "awr-approval__actions", children: [
10414
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
10698
+ previewValue(a.input, 300) && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("pre", { className: "awr-approval__input", children: previewValue(a.input, 300) }),
10699
+ app && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "awr-approval__from", children: L.approvalFromApp(app.server, a.readOnly) }),
10700
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "awr-approval__actions", children: [
10701
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
10415
10702
  "button",
10416
10703
  {
10417
10704
  type: "button",
@@ -10420,7 +10707,7 @@ var ToolApprovalPrompt = ({
10420
10707
  children: L.approve
10421
10708
  }
10422
10709
  ),
10423
- allowRemember && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
10710
+ allowRemember && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
10424
10711
  "button",
10425
10712
  {
10426
10713
  type: "button",
@@ -10429,7 +10716,7 @@ var ToolApprovalPrompt = ({
10429
10716
  children: L.alwaysAllow
10430
10717
  }
10431
10718
  ),
10432
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
10719
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
10433
10720
  "button",
10434
10721
  {
10435
10722
  type: "button",
@@ -10443,12 +10730,12 @@ var ToolApprovalPrompt = ({
10443
10730
  },
10444
10731
  a.id
10445
10732
  );
10446
- return renderApproval ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { children: renderApproval(a, card) }, a.id) : card;
10733
+ return renderApproval ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { children: renderApproval(a, card) }, a.id) : card;
10447
10734
  }) });
10448
10735
  };
10449
10736
 
10450
10737
  // src/components/UsageBadge.tsx
10451
- var import_jsx_runtime21 = require("react/jsx-runtime");
10738
+ var import_jsx_runtime22 = require("react/jsx-runtime");
10452
10739
  var UsageBadge = ({
10453
10740
  usage,
10454
10741
  compact = false,
@@ -10474,7 +10761,7 @@ var UsageBadge = ({
10474
10761
  mediaText,
10475
10762
  decisions ? L.usageDecisions(decisions) : ""
10476
10763
  ].filter(Boolean).join(" \xB7 ");
10477
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { className: ["awr-usage", className].filter(Boolean).join(" "), title, children: [
10764
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { className: ["awr-usage", className].filter(Boolean).join(" "), title, children: [
10478
10765
  formatTokens(usage.inputTokens),
10479
10766
  "\u2191 ",
10480
10767
  formatTokens(usage.outputTokens),
@@ -10487,13 +10774,13 @@ var UsageBadge = ({
10487
10774
  };
10488
10775
 
10489
10776
  // src/components/AgentChat.tsx
10490
- var import_jsx_runtime22 = require("react/jsx-runtime");
10777
+ var import_jsx_runtime23 = require("react/jsx-runtime");
10491
10778
  var usePrefersDark = () => {
10492
10779
  const query = "(prefers-color-scheme: dark)";
10493
- const [dark, setDark] = (0, import_react25.useState)(
10780
+ const [dark, setDark] = (0, import_react26.useState)(
10494
10781
  () => typeof matchMedia === "function" && matchMedia(query).matches
10495
10782
  );
10496
- (0, import_react25.useEffect)(() => {
10783
+ (0, import_react26.useEffect)(() => {
10497
10784
  if (typeof matchMedia !== "function") return;
10498
10785
  const mq = matchMedia(query);
10499
10786
  const on = () => setDark(mq.matches);
@@ -10504,7 +10791,7 @@ var usePrefersDark = () => {
10504
10791
  };
10505
10792
  var isHistoryHook = (h) => typeof h === "object" && h !== null && "select" in h && "chats" in h;
10506
10793
  var cx = (...names) => names.filter(Boolean).join(" ");
10507
- var AgentChat = (props) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(AgentLabelsProvider, { labels: props.labels ?? NO_LABELS, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(AgentChatInner, { ...props }) });
10794
+ var AgentChat = (props) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(AgentLabelsProvider, { labels: props.labels ?? NO_LABELS, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(AgentChatInner, { ...props }) });
10508
10795
  var NO_LABELS = {};
10509
10796
  var AgentChatInner = ({
10510
10797
  controller,
@@ -10524,6 +10811,7 @@ var AgentChatInner = ({
10524
10811
  showSubagents = true,
10525
10812
  showMedia = true,
10526
10813
  showFileChips = true,
10814
+ showNamedFiles = showFileChips,
10527
10815
  htmlPreview,
10528
10816
  stoppableSubagents = true,
10529
10817
  showTotalUsage = true,
@@ -10586,7 +10874,7 @@ var AgentChatInner = ({
10586
10874
  }
10587
10875
  const L = useLabels();
10588
10876
  const external = isHistoryHook(history) ? history : void 0;
10589
- const [ownStore] = (0, import_react25.useState)(
10877
+ const [ownStore] = (0, import_react26.useState)(
10590
10878
  () => history instanceof ChatHistoryStore ? history : new ChatHistoryStore()
10591
10879
  );
10592
10880
  const own = useChatHistory(agent, {
@@ -10596,9 +10884,9 @@ var AgentChatInner = ({
10596
10884
  labels: { voiceMessage: L.voiceMessage }
10597
10885
  });
10598
10886
  const chats = history ? external ?? own : void 0;
10599
- const rootRef = (0, import_react25.useRef)(null);
10600
- const [narrow, setNarrow] = (0, import_react25.useState)(void 0);
10601
- (0, import_react25.useEffect)(() => {
10887
+ const rootRef = (0, import_react26.useRef)(null);
10888
+ const [narrow, setNarrow] = (0, import_react26.useState)(void 0);
10889
+ (0, import_react26.useEffect)(() => {
10602
10890
  const el = rootRef.current;
10603
10891
  if (!el || typeof ResizeObserver === "undefined") return setNarrow(false);
10604
10892
  const measure2 = () => setNarrow(el.getBoundingClientRect().width < narrowWidth);
@@ -10607,9 +10895,9 @@ var AgentChatInner = ({
10607
10895
  ro.observe(el);
10608
10896
  return () => ro.disconnect();
10609
10897
  }, [narrowWidth]);
10610
- const [historyChoice, setHistoryOpen] = (0, import_react25.useState)(defaultHistoryOpen);
10898
+ const [historyChoice, setHistoryOpen] = (0, import_react26.useState)(defaultHistoryOpen);
10611
10899
  const historyOpen = historyChoice ?? narrow === false;
10612
- const [filesOpen, setFilesOpen] = (0, import_react25.useState)(defaultFilesOpen);
10900
+ const [filesOpen, setFilesOpen] = (0, import_react26.useState)(defaultFilesOpen);
10613
10901
  const toggleHistory = () => {
10614
10902
  setHistoryOpen(!historyOpen);
10615
10903
  if (narrow && !historyOpen) setFilesOpen(false);
@@ -10627,7 +10915,7 @@ var AgentChatInner = ({
10627
10915
  setHistoryOpen(false);
10628
10916
  setFilesOpen(false);
10629
10917
  };
10630
- (0, import_react25.useEffect)(() => {
10918
+ (0, import_react26.useEffect)(() => {
10631
10919
  if (!overlayOpen) return;
10632
10920
  const onKey = (e) => {
10633
10921
  if (e.key !== "Escape" || e.defaultPrevented) return;
@@ -10637,7 +10925,7 @@ var AgentChatInner = ({
10637
10925
  document.addEventListener("keydown", onKey);
10638
10926
  return () => document.removeEventListener("keydown", onKey);
10639
10927
  }, [overlayOpen]);
10640
- const bodyRef = (0, import_react25.useRef)(null);
10928
+ const bodyRef = (0, import_react26.useRef)(null);
10641
10929
  const appHost = useMcpAppHost({
10642
10930
  connection: mcpApps,
10643
10931
  approve: agent.approveAppToolCall,
@@ -10649,7 +10937,7 @@ var AgentChatInner = ({
10649
10937
  });
10650
10938
  const prefersDark = usePrefersDark();
10651
10939
  const appTheme = theme === "auto" ? prefersDark ? "dark" : "light" : theme;
10652
- const [panelApp, setPanelAppState] = (0, import_react25.useState)();
10940
+ const [panelApp, setPanelAppState] = (0, import_react26.useState)();
10653
10941
  const setPanelApp = (app) => {
10654
10942
  setPanelAppState(app);
10655
10943
  onAppPanel?.(app);
@@ -10663,14 +10951,14 @@ var AgentChatInner = ({
10663
10951
  const panelAllowed = appPanel !== false && appPanel !== null;
10664
10952
  const panelTarget = typeof appPanel === "object" && appPanel ? appPanel : void 0;
10665
10953
  const asSheet = !panelTarget && (appPanel === "sheet" || Boolean(narrow));
10666
- (0, import_react25.useEffect)(() => {
10954
+ (0, import_react26.useEffect)(() => {
10667
10955
  if (panelApp && !agent.messages.some((m) => m.apps?.some((a) => a.id === panelApp.id))) {
10668
10956
  setPanelAppState(void 0);
10669
10957
  onAppPanel?.(void 0);
10670
10958
  }
10671
10959
  }, [agent.messages, panelApp, onAppPanel]);
10672
10960
  const drawApp = (app, message) => {
10673
- const built = panelApp?.id === app.id ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
10961
+ const built = panelApp?.id === app.id ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
10674
10962
  McpAppLine,
10675
10963
  {
10676
10964
  app,
@@ -10678,7 +10966,7 @@ var AgentChatInner = ({
10678
10966
  action: L.appBringBack,
10679
10967
  onAction: () => setPanelApp(void 0)
10680
10968
  }
10681
- ) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
10969
+ ) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
10682
10970
  McpAppFrame,
10683
10971
  {
10684
10972
  app,
@@ -10691,7 +10979,7 @@ var AgentChatInner = ({
10691
10979
  );
10692
10980
  return renderApp ? renderApp(app, message, built) : built;
10693
10981
  };
10694
- const appPanelNode = appsOn && panelApp ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
10982
+ const appPanelNode = appsOn && panelApp ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
10695
10983
  McpAppFrame,
10696
10984
  {
10697
10985
  app: panelApp,
@@ -10703,7 +10991,7 @@ var AgentChatInner = ({
10703
10991
  },
10704
10992
  panelApp.id
10705
10993
  ) : null;
10706
- const [compacting, setCompacting] = (0, import_react25.useState)(false);
10994
+ const [compacting, setCompacting] = (0, import_react26.useState)(false);
10707
10995
  const compact = () => {
10708
10996
  setCompacting(true);
10709
10997
  void agent.compact().finally(() => setCompacting(false));
@@ -10725,18 +11013,18 @@ var AgentChatInner = ({
10725
11013
  const showReplan = agent.replan && agent.replan.mode !== "continue";
10726
11014
  const replanFailedEarly = showReplanFailed && agent.replan?.failed === true && agent.steps.length === 0;
10727
11015
  const earlyDecisions = showDecisions ? agent.decisions ?? [] : [];
10728
- const liveExtra = agent.planThought.trim() || showReplan || replanFailedEarly || earlyDecisions.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
10729
- agent.planThought.trim() && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("details", { className: "awr-activity__plan", children: [
10730
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("summary", { children: L.planned }),
10731
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "awr-activity__thought", children: agent.planThought })
11016
+ const liveExtra = agent.planThought.trim() || showReplan || replanFailedEarly || earlyDecisions.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
11017
+ agent.planThought.trim() && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("details", { className: "awr-activity__plan", children: [
11018
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("summary", { children: L.planned }),
11019
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "awr-activity__thought", children: agent.planThought })
10732
11020
  ] }),
10733
- showReplan && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "awr-activity__replan", children: L.replanned(agent.replan.mode, agent.replan.reason) }),
10734
- replanFailedEarly && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("p", { className: "awr-step__warn", title: agent.replan.error, children: [
10735
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(AlertIcon, { size: 12 }),
11021
+ showReplan && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "awr-activity__replan", children: L.replanned(agent.replan.mode, agent.replan.reason) }),
11022
+ replanFailedEarly && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("p", { className: "awr-step__warn", title: agent.replan.error, children: [
11023
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(AlertIcon, { size: 12 }),
10736
11024
  " ",
10737
11025
  L.replanFailed
10738
11026
  ] }),
10739
- earlyDecisions.map((d, i) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
11027
+ earlyDecisions.map((d, i) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
10740
11028
  "p",
10741
11029
  {
10742
11030
  className: `awr-step__decision${d.accepted ? "" : " awr-step__decision--fallback"}`,
@@ -10745,8 +11033,8 @@ var AgentChatInner = ({
10745
11033
  i
10746
11034
  ))
10747
11035
  ] }) : void 0;
10748
- const header = slots.header === false ? null : slots.header !== void 0 ? slots.header : /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: cx("awr-chat__header", classNames.header), children: [
10749
- chats && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
11036
+ const header = slots.header === false ? null : slots.header !== void 0 ? slots.header : /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: cx("awr-chat__header", classNames.header), children: [
11037
+ chats && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
10750
11038
  "button",
10751
11039
  {
10752
11040
  type: "button",
@@ -10755,17 +11043,17 @@ var AgentChatInner = ({
10755
11043
  title: L.showHistory,
10756
11044
  "aria-pressed": historyOpen,
10757
11045
  onClick: toggleHistory,
10758
- children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(HistoryIcon, { size: 16 })
11046
+ children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(HistoryIcon, { size: 16 })
10759
11047
  }
10760
11048
  ),
10761
11049
  slots.headerStart,
10762
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "awr-chat__title", children: title }),
10763
- showStatus && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { className: `awr-status awr-status--${agent.status}`, title: L.status[agent.status], children: [
10764
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "awr-status__dot" }),
10765
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "awr-status__text", children: L.status[agent.status] })
11050
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "awr-chat__title", children: title }),
11051
+ showStatus && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { className: `awr-status awr-status--${agent.status}`, title: L.status[agent.status], children: [
11052
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "awr-status__dot" }),
11053
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "awr-status__text", children: L.status[agent.status] })
10766
11054
  ] }),
10767
- showTotalUsage && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { title: L.totalUsage, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(UsageBadge, { usage: agent.totalUsage, compact: narrow !== false }) }),
10768
- files && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
11055
+ showTotalUsage && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { title: L.totalUsage, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(UsageBadge, { usage: agent.totalUsage, compact: narrow !== false }) }),
11056
+ files && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
10769
11057
  "button",
10770
11058
  {
10771
11059
  type: "button",
@@ -10774,12 +11062,12 @@ var AgentChatInner = ({
10774
11062
  title: L.showFiles,
10775
11063
  "aria-pressed": filesOpen,
10776
11064
  onClick: toggleFiles,
10777
- children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(FileIcon, { size: 16 })
11065
+ children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(FileIcon, { size: 16 })
10778
11066
  }
10779
11067
  ),
10780
11068
  slots.headerEnd
10781
11069
  ] });
10782
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
11070
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
10783
11071
  "div",
10784
11072
  {
10785
11073
  ref: rootRef,
@@ -10787,7 +11075,7 @@ var AgentChatInner = ({
10787
11075
  style,
10788
11076
  "data-awr-theme": theme === "auto" ? void 0 : theme,
10789
11077
  children: [
10790
- overlayOpen && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
11078
+ overlayOpen && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
10791
11079
  "div",
10792
11080
  {
10793
11081
  className: cx("awr-chat__scrim", classNames.scrim),
@@ -10795,8 +11083,8 @@ var AgentChatInner = ({
10795
11083
  onClick: closeOverlays
10796
11084
  }
10797
11085
  ),
10798
- chats && historyOpen && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("aside", { className: cx("awr-chat__sidebar", classNames.sidebar), children: [
10799
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
11086
+ chats && historyOpen && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("aside", { className: cx("awr-chat__sidebar", classNames.sidebar), children: [
11087
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
10800
11088
  HistoryList,
10801
11089
  {
10802
11090
  history: {
@@ -10815,7 +11103,7 @@ var AgentChatInner = ({
10815
11103
  }
10816
11104
  ),
10817
11105
  slots.sidebar,
10818
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
11106
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
10819
11107
  "button",
10820
11108
  {
10821
11109
  type: "button",
@@ -10826,11 +11114,11 @@ var AgentChatInner = ({
10826
11114
  }
10827
11115
  )
10828
11116
  ] }),
10829
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: cx("awr-chat__main", classNames.main), children: [
11117
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: cx("awr-chat__main", classNames.main), children: [
10830
11118
  header,
10831
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: cx("awr-chat__body", classNames.body), ref: bodyRef, children: [
11119
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: cx("awr-chat__body", classNames.body), ref: bodyRef, children: [
10832
11120
  slots.beforeMessages,
10833
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
11121
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
10834
11122
  Messages,
10835
11123
  {
10836
11124
  messages: agent.messages,
@@ -10848,6 +11136,7 @@ var AgentChatInner = ({
10848
11136
  showSubagents,
10849
11137
  showMedia,
10850
11138
  showFileChips,
11139
+ showNamedFiles,
10851
11140
  files,
10852
11141
  htmlPreview,
10853
11142
  onShowFiles: files ? showFiles : void 0,
@@ -10871,7 +11160,7 @@ var AgentChatInner = ({
10871
11160
  renderImageViewer
10872
11161
  }
10873
11162
  ),
10874
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
11163
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
10875
11164
  Approvals,
10876
11165
  {
10877
11166
  approvals: agent.pendingApprovals,
@@ -10881,7 +11170,7 @@ var AgentChatInner = ({
10881
11170
  renderApproval
10882
11171
  }
10883
11172
  ),
10884
- showQuestions && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
11173
+ showQuestions && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
10885
11174
  Questions,
10886
11175
  {
10887
11176
  questions: agent.pendingQuestions ?? [],
@@ -10890,7 +11179,7 @@ var AgentChatInner = ({
10890
11179
  renderQuestion
10891
11180
  }
10892
11181
  ),
10893
- appsOn && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
11182
+ appsOn && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
10894
11183
  AppRequestPrompt,
10895
11184
  {
10896
11185
  requests: appHost.requests,
@@ -10898,7 +11187,7 @@ var AgentChatInner = ({
10898
11187
  renderRequest: renderAppRequest
10899
11188
  }
10900
11189
  ),
10901
- showElicitation && elicitations && onElicitationAnswer && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
11190
+ showElicitation && elicitations && onElicitationAnswer && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
10902
11191
  Elicitations,
10903
11192
  {
10904
11193
  elicitations,
@@ -10907,13 +11196,13 @@ var AgentChatInner = ({
10907
11196
  renderElicitation
10908
11197
  }
10909
11198
  ),
10910
- agent.modelLoad && loading && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ModelLoadBar, { load: agent.modelLoad }),
11199
+ agent.modelLoad && loading && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ModelLoadBar, { load: agent.modelLoad }),
10911
11200
  slots.afterMessages
10912
11201
  ] }),
10913
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: cx("awr-chat__footer", classNames.footer), children: [
11202
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: cx("awr-chat__footer", classNames.footer), children: [
10914
11203
  slots.footerStart,
10915
- tabNotes.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "awr-tabnote", role: "status", children: tabNotes.map((text2) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "awr-tabnote__text", children: text2 }, text2)) }),
10916
- showContext !== false && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
11204
+ tabNotes.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "awr-tabnote", role: "status", children: tabNotes.map((text2) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "awr-tabnote__text", children: text2 }, text2)) }),
11205
+ showContext !== false && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
10917
11206
  ContextMeter,
10918
11207
  {
10919
11208
  usage: agent.usage,
@@ -10924,11 +11213,11 @@ var AgentChatInner = ({
10924
11213
  compacting
10925
11214
  }
10926
11215
  ),
10927
- composer === false ? agent.error && agent.status === "error" && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "awr-chat__error", children: [
10928
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(AlertIcon, { size: 14 }),
11216
+ composer === false ? agent.error && agent.status === "error" && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "awr-chat__error", children: [
11217
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(AlertIcon, { size: 14 }),
10929
11218
  " ",
10930
11219
  agent.error
10931
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
11220
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
10932
11221
  Composer2,
10933
11222
  {
10934
11223
  controller: agent,
@@ -10945,7 +11234,7 @@ var AgentChatInner = ({
10945
11234
  appPanelNode && (panelTarget ? (
10946
11235
  // Outside the chat: the theme tokens come with it.
10947
11236
  (0, import_react_dom2.createPortal)(
10948
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
11237
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
10949
11238
  "div",
10950
11239
  {
10951
11240
  className: "awr-theme awr-apppanel",
@@ -10955,24 +11244,24 @@ var AgentChatInner = ({
10955
11244
  ),
10956
11245
  panelTarget
10957
11246
  )
10958
- ) : asSheet ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
10959
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "awr-sheet__scrim", onClick: () => setPanelApp(void 0) }),
10960
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
11247
+ ) : asSheet ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
11248
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "awr-sheet__scrim", onClick: () => setPanelApp(void 0) }),
11249
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
10961
11250
  "aside",
10962
11251
  {
10963
11252
  className: "awr-chat__appsheet",
10964
11253
  role: "dialog",
10965
11254
  "aria-label": L.appFrom(panelApp.server),
10966
11255
  children: [
10967
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "awr-sheet__grab" }),
11256
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "awr-sheet__grab" }),
10968
11257
  appPanelNode
10969
11258
  ]
10970
11259
  }
10971
11260
  )
10972
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("aside", { className: "awr-chat__apppanel", children: appPanelNode })),
10973
- files && filesOpen && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("aside", { className: cx("awr-chat__files", classNames.files), children: [
10974
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ImageViewerProvider, { enabled: imageViewer, render: renderImageViewer, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Files, { files }) }),
10975
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
11261
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("aside", { className: "awr-chat__apppanel", children: appPanelNode })),
11262
+ files && filesOpen && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("aside", { className: cx("awr-chat__files", classNames.files), children: [
11263
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ImageViewerProvider, { enabled: imageViewer, render: renderImageViewer, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Files, { files }) }),
11264
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
10976
11265
  "button",
10977
11266
  {
10978
11267
  type: "button",
@@ -10989,7 +11278,7 @@ var AgentChatInner = ({
10989
11278
  };
10990
11279
 
10991
11280
  // src/components/LearnedSkills.tsx
10992
- var import_jsx_runtime23 = require("react/jsx-runtime");
11281
+ var import_jsx_runtime24 = require("react/jsx-runtime");
10993
11282
  var LearnedSkills = ({
10994
11283
  controller,
10995
11284
  lessons,
@@ -11005,18 +11294,18 @@ var LearnedSkills = ({
11005
11294
  const c = controller ?? ctx;
11006
11295
  const list = lessons ?? c?.learned ?? [];
11007
11296
  const forget = onForget === false ? void 0 : onForget ?? c?.forgetSkill;
11008
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("section", { className: ["awr-notebook", className].filter(Boolean).join(" "), children: [
11009
- !hideTitle && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("h3", { className: "awr-notebook__title", children: [
11010
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(BookIcon, { size: 14 }),
11297
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("section", { className: ["awr-notebook", className].filter(Boolean).join(" "), children: [
11298
+ !hideTitle && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("h3", { className: "awr-notebook__title", children: [
11299
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(BookIcon, { size: 14 }),
11011
11300
  " ",
11012
11301
  L.notebookTitle,
11013
- list.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "awr-notebook__count", children: list.length })
11302
+ list.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "awr-notebook__count", children: list.length })
11014
11303
  ] }),
11015
- list.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "awr-notebook__empty", children: empty ?? L.notebookEmpty }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("ul", { className: "awr-notebook__list", children: list.map((l) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("li", { className: "awr-lesson", children: [
11016
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "awr-lesson__head", children: [
11017
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("code", { className: "awr-lesson__name", children: l.name }),
11018
- l.revision > 1 && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "awr-lesson__rev", children: L.notebookRevision(l.revision) }),
11019
- forget && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
11304
+ list.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "awr-notebook__empty", children: empty ?? L.notebookEmpty }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("ul", { className: "awr-notebook__list", children: list.map((l) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("li", { className: "awr-lesson", children: [
11305
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "awr-lesson__head", children: [
11306
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("code", { className: "awr-lesson__name", children: l.name }),
11307
+ l.revision > 1 && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "awr-lesson__rev", children: L.notebookRevision(l.revision) }),
11308
+ forget && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
11020
11309
  "button",
11021
11310
  {
11022
11311
  type: "button",
@@ -11024,12 +11313,12 @@ var LearnedSkills = ({
11024
11313
  title: `${L.notebookForget}: ${l.name}`,
11025
11314
  "aria-label": `${L.notebookForget}: ${l.name}`,
11026
11315
  onClick: () => void forget(l.name),
11027
- children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(XIcon, { size: 12 })
11316
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(XIcon, { size: 12 })
11028
11317
  }
11029
11318
  )
11030
11319
  ] }),
11031
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "awr-lesson__when", children: l.description }),
11032
- showSources && l.sources.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("p", { className: "awr-lesson__from", children: [
11320
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "awr-lesson__when", children: l.description }),
11321
+ showSources && l.sources.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("p", { className: "awr-lesson__from", children: [
11033
11322
  L.notebookFrom,
11034
11323
  " ",
11035
11324
  l.sources.join(", ")
@@ -11039,8 +11328,8 @@ var LearnedSkills = ({
11039
11328
  };
11040
11329
 
11041
11330
  // src/components/MemoryCard.tsx
11042
- var import_react26 = require("react");
11043
- var import_jsx_runtime24 = require("react/jsx-runtime");
11331
+ var import_react27 = require("react");
11332
+ var import_jsx_runtime25 = require("react/jsx-runtime");
11044
11333
  var MemoryCard = ({
11045
11334
  kind,
11046
11335
  text: text2,
@@ -11051,7 +11340,7 @@ var MemoryCard = ({
11051
11340
  className
11052
11341
  }) => {
11053
11342
  const L = useLabels(labels);
11054
- const [busy, setBusy] = (0, import_react26.useState)(false);
11343
+ const [busy, setBusy] = (0, import_react27.useState)(false);
11055
11344
  const label = kind === "saved" ? L.memorySaved : kind === "updated" ? L.memoryUpdated : L.memoryForgotten;
11056
11345
  const undo = () => {
11057
11346
  if (!onUndo || busy) return;
@@ -11059,19 +11348,19 @@ var MemoryCard = ({
11059
11348
  void Promise.resolve().then(onUndo).catch(() => {
11060
11349
  }).finally(() => setBusy(false));
11061
11350
  };
11062
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
11351
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
11063
11352
  "div",
11064
11353
  {
11065
11354
  className: ["awr-memory", `awr-memory--${kind}`, undone ? "is-undone" : "", className].filter(Boolean).join(" "),
11066
11355
  "data-memory": kind,
11067
11356
  children: [
11068
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(BookmarkIcon, { size: 14, className: "awr-memory__icon" }),
11069
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "awr-memory__body", children: [
11070
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "awr-memory__label", children: label }),
11071
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "awr-memory__text", children: text2 }),
11072
- problem && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "awr-memory__problem", role: "alert", children: problem })
11357
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(BookmarkIcon, { size: 14, className: "awr-memory__icon" }),
11358
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "awr-memory__body", children: [
11359
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "awr-memory__label", children: label }),
11360
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "awr-memory__text", children: text2 }),
11361
+ problem && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "awr-memory__problem", role: "alert", children: problem })
11073
11362
  ] }),
11074
- undone ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "awr-memory__undone", children: L.memoryUndone }) : onUndo ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
11363
+ undone ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "awr-memory__undone", children: L.memoryUndone }) : onUndo ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
11075
11364
  "button",
11076
11365
  {
11077
11366
  type: "button",
@@ -11089,8 +11378,8 @@ var MemoryCard = ({
11089
11378
  };
11090
11379
 
11091
11380
  // src/components/Composer.tsx
11092
- var import_react27 = require("react");
11093
- var import_jsx_runtime25 = require("react/jsx-runtime");
11381
+ var import_react28 = require("react");
11382
+ var import_jsx_runtime26 = require("react/jsx-runtime");
11094
11383
  var Composer = ({
11095
11384
  onSubmit,
11096
11385
  busy = false,
@@ -11099,7 +11388,7 @@ var Composer = ({
11099
11388
  placeholder = "Ask the agent to do something\u2026",
11100
11389
  className
11101
11390
  }) => {
11102
- const [text2, setText] = (0, import_react27.useState)("");
11391
+ const [text2, setText] = (0, import_react28.useState)("");
11103
11392
  const submit = () => {
11104
11393
  const value = text2.trim();
11105
11394
  if (!value || busy || disabled) return;
@@ -11112,7 +11401,7 @@ var Composer = ({
11112
11401
  submit();
11113
11402
  }
11114
11403
  };
11115
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
11404
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
11116
11405
  "form",
11117
11406
  {
11118
11407
  className: ["awr-composer", className].filter(Boolean).join(" "),
@@ -11121,7 +11410,7 @@ var Composer = ({
11121
11410
  submit();
11122
11411
  },
11123
11412
  children: [
11124
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
11413
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
11125
11414
  "textarea",
11126
11415
  {
11127
11416
  className: "awr-composer__input",
@@ -11133,23 +11422,23 @@ var Composer = ({
11133
11422
  rows: 1
11134
11423
  }
11135
11424
  ),
11136
- busy ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
11425
+ busy ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
11137
11426
  "button",
11138
11427
  {
11139
11428
  type: "button",
11140
11429
  className: "awr-composer__btn awr-composer__btn--stop",
11141
11430
  onClick: onStop,
11142
11431
  "aria-label": "Stop",
11143
- children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(StopIcon, { size: 18 })
11432
+ children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(StopIcon, { size: 18 })
11144
11433
  }
11145
- ) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
11434
+ ) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
11146
11435
  "button",
11147
11436
  {
11148
11437
  type: "submit",
11149
11438
  className: "awr-composer__btn",
11150
11439
  disabled: disabled || !text2.trim(),
11151
11440
  "aria-label": "Send",
11152
- children: disabled ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(SpinnerIcon, { size: 18 }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(SendIcon, { size: 18 })
11441
+ children: disabled ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(SpinnerIcon, { size: 18 }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(SendIcon, { size: 18 })
11153
11442
  }
11154
11443
  )
11155
11444
  ]
@@ -11158,17 +11447,17 @@ var Composer = ({
11158
11447
  };
11159
11448
 
11160
11449
  // src/components/PlanView.tsx
11161
- var import_jsx_runtime26 = require("react/jsx-runtime");
11450
+ var import_jsx_runtime27 = require("react/jsx-runtime");
11162
11451
  var PlanView = ({ plan, showThought = true, className }) => {
11163
11452
  if (!plan.steps.length && !plan.thought) return null;
11164
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: ["awr-plan", className].filter(Boolean).join(" "), children: [
11165
- showThought && plan.thought.trim() && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "awr-plan__thought", children: plan.thought }),
11166
- plan.steps.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("ol", { className: "awr-plan__steps", children: plan.steps.map((step) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("li", { className: "awr-plan__step", children: step.description }, step.id)) })
11453
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: ["awr-plan", className].filter(Boolean).join(" "), children: [
11454
+ showThought && plan.thought.trim() && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "awr-plan__thought", children: plan.thought }),
11455
+ plan.steps.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("ol", { className: "awr-plan__steps", children: plan.steps.map((step) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("li", { className: "awr-plan__step", children: step.description }, step.id)) })
11167
11456
  ] });
11168
11457
  };
11169
11458
 
11170
11459
  // src/components/ApprovalModeSwitch.tsx
11171
- var import_jsx_runtime27 = require("react/jsx-runtime");
11460
+ var import_jsx_runtime28 = require("react/jsx-runtime");
11172
11461
  var DEFAULT_LABELS = {
11173
11462
  autopilot: "Autopilot",
11174
11463
  "ask-writes": "Ask before changes",
@@ -11188,13 +11477,13 @@ var ApprovalModeSwitch = ({
11188
11477
  labels,
11189
11478
  disabled,
11190
11479
  className
11191
- }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
11480
+ }) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
11192
11481
  "div",
11193
11482
  {
11194
11483
  className: ["awr-modeswitch", className].filter(Boolean).join(" "),
11195
11484
  role: "radiogroup",
11196
11485
  "aria-label": "Tool consent",
11197
- children: modes.map((m) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
11486
+ children: modes.map((m) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
11198
11487
  "button",
11199
11488
  {
11200
11489
  type: "button",
@@ -11212,8 +11501,8 @@ var ApprovalModeSwitch = ({
11212
11501
  );
11213
11502
 
11214
11503
  // src/components/ApiKeyForm.tsx
11215
- var import_react28 = require("react");
11216
- var import_jsx_runtime28 = require("react/jsx-runtime");
11504
+ var import_react29 = require("react");
11505
+ var import_jsx_runtime29 = require("react/jsx-runtime");
11217
11506
  var ApiKeyForm = ({
11218
11507
  credentials,
11219
11508
  credentialRef,
@@ -11222,10 +11511,10 @@ var ApiKeyForm = ({
11222
11511
  onChange,
11223
11512
  className
11224
11513
  }) => {
11225
- const [value, setValue] = (0, import_react28.useState)("");
11226
- const [present, setPresent] = (0, import_react28.useState)(false);
11227
- const [busy, setBusy] = (0, import_react28.useState)(false);
11228
- (0, import_react28.useEffect)(() => {
11514
+ const [value, setValue] = (0, import_react29.useState)("");
11515
+ const [present, setPresent] = (0, import_react29.useState)(false);
11516
+ const [busy, setBusy] = (0, import_react29.useState)(false);
11517
+ (0, import_react29.useEffect)(() => {
11229
11518
  let active = true;
11230
11519
  credentials.hasKey(credentialRef).then((has) => {
11231
11520
  if (active) setPresent(has);
@@ -11257,16 +11546,16 @@ var ApiKeyForm = ({
11257
11546
  setBusy(false);
11258
11547
  }
11259
11548
  };
11260
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: ["awr-keyform", className].filter(Boolean).join(" "), children: [
11261
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("label", { className: "awr-keyform__label", children: [
11549
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: ["awr-keyform", className].filter(Boolean).join(" "), children: [
11550
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("label", { className: "awr-keyform__label", children: [
11262
11551
  label,
11263
- present && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { className: "awr-keyform__saved", children: [
11264
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(CheckIcon, { size: 12 }),
11552
+ present && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("span", { className: "awr-keyform__saved", children: [
11553
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(CheckIcon, { size: 12 }),
11265
11554
  " stored, encrypted"
11266
11555
  ] })
11267
11556
  ] }),
11268
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "awr-keyform__row", children: [
11269
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
11557
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "awr-keyform__row", children: [
11558
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
11270
11559
  "input",
11271
11560
  {
11272
11561
  className: "awr-keyform__input",
@@ -11284,7 +11573,7 @@ var ApiKeyForm = ({
11284
11573
  disabled: busy
11285
11574
  }
11286
11575
  ),
11287
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
11576
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
11288
11577
  "button",
11289
11578
  {
11290
11579
  type: "button",
@@ -11294,7 +11583,7 @@ var ApiKeyForm = ({
11294
11583
  children: "Save"
11295
11584
  }
11296
11585
  ),
11297
- present && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
11586
+ present && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
11298
11587
  "button",
11299
11588
  {
11300
11589
  type: "button",
@@ -11369,6 +11658,7 @@ var import_agent_web8 = require("@dudko.dev/agent-web");
11369
11658
  MCP_APP_SANDBOX_RESOURCE_READY,
11370
11659
  MCP_APP_SANDBOX_SERVER,
11371
11660
  MCP_APP_SANDBOX_TIMEOUT_MS,
11661
+ MCP_APP_SCHEME_PARAM,
11372
11662
  McpAppBridge,
11373
11663
  McpAppFrame,
11374
11664
  McpAppLine,
@@ -11381,6 +11671,10 @@ var import_agent_web8 = require("@dudko.dev/agent-web");
11381
11671
  MessageList,
11382
11672
  MicError,
11383
11673
  ModelLoadBar,
11674
+ NAMED_FILES_MAX,
11675
+ NAMED_FILES_SCAN_MAX,
11676
+ NAMED_FILES_TEXT_MAX,
11677
+ NamedFileChips,
11384
11678
  PlanView,
11385
11679
  QUESTION_TIMEOUT_MS,
11386
11680
  QuestionPrompt,
@@ -11468,6 +11762,7 @@ var import_agent_web8 = require("@dudko.dev/agent-web");
11468
11762
  linkedFilesOf,
11469
11763
  loadSkillFromUrl,
11470
11764
  markReadOnly,
11765
+ mcpAppColorScheme,
11471
11766
  mcpAppCsp,
11472
11767
  mcpAppHostCapabilities,
11473
11768
  mcpAppPolicyToken,
@@ -11482,11 +11777,13 @@ var import_agent_web8 = require("@dudko.dev/agent-web");
11482
11777
  messageOverLimit,
11483
11778
  micProblemOf,
11484
11779
  micProblemText,
11780
+ namedFilesOf,
11485
11781
  newChatId,
11486
11782
  noticesOf,
11487
11783
  onStorageChange,
11488
11784
  parseSkillMarkdown,
11489
11785
  parseSlash,
11786
+ pathsNamedIn,
11490
11787
  pendingApprovalsOf,
11491
11788
  pickRecordingType,
11492
11789
  postStorageChange,
@@ -11540,6 +11837,7 @@ var import_agent_web8 = require("@dudko.dev/agent-web");
11540
11837
  withAttachments,
11541
11838
  withCspFirst,
11542
11839
  withPolicyFirst,
11543
- withoutOwnWords
11840
+ withoutOwnWords,
11841
+ workspacePathOf
11544
11842
  });
11545
11843
  //# sourceMappingURL=index.cjs.map