@dudko.dev/agent-web-react 0.0.27 → 0.0.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -196,15 +196,17 @@ function Custom() {
196
196
  | `messages` | transcript; each assistant message keeps its steps, tool calls, thoughts, approvals, subagents, usage and duration |
197
197
  | `plan` / `steps` | the live plan and per-step tool calls (with timing) |
198
198
  | `finalText` / `finalReasoning` | the streamed answer and its thoughts |
199
- | `usage` / `totalUsage` | tokens of this run / of the conversation, by kind |
200
- | `pendingApprovals`, `approve(id, { remember })`, `deny(id)` | tool consent |
199
+ | `usage` / `totalUsage` | tokens of this run / of the conversation, by kind - plus `mediaCalls` and `decisionCalls` (calls, not tokens) when the run made some |
200
+ | `pendingApprovals`, `approve(id, { remember })`, `deny(id)` | tool consent (a request made by a helper the model started carries `subagent: { id, depth, name?, role? }`) |
201
201
  | `approvalMode` / `setApprovalMode(mode)` | the autopilot switch, live |
202
202
  | `compact()` | summarise the stored transcript now |
203
203
  | `sessionId` / `loadChat(chat)` | the memory session; switch conversations |
204
- | `subagents`, `skills`, `discoveredTools`, `compactions`, `budget` | the rest of the run, folded |
204
+ | `subagents`, `skills`, `discoveredTools`, `compactions`, `budget` | the rest of the run, folded. `subagents` is a **tree**: static subagents and the helpers the model started (`subagents.dynamic`), each node with `parentId` / `depth`, status, model, tokens, tool calls and time; `subagentTree(subagents)` nests it - see [docs/chat.md](docs/chat.md#subagents-and-helpers-the-tree) |
205
+ | `media`, `transcripts`, `decisions` | absent until there is one: the files the run generated (`MediaView[]`: a path in the workspace, never bytes), the audio it transcribed (`TranscriptView[]`), and the decision model's answers that came before any step (`DecisionView[]`; later ones are on their step) |
205
206
  | `learned`, `learnedNow`, `fetches` | the agent's notebook (`LessonView[]`, survives `reset`), what it wrote this run, and the `web_fetch` requests this run made (`FetchView[]`) |
206
- | `queued`, `notes`, `undelivered`, `replan` | steering: messages waiting, shown (and where), left over; the last replan decision (`byUser` when a message caused it) |
207
- | `error`, `stopped`, `events`, `seq` | the run's error text, whether it was stopped, the raw event log and its counter |
207
+ | `queued`, `notes`, `undelivered`, `replan` | steering: messages waiting, shown (and where), left over; the last replan decision (`byUser` when a message caused it; `failed` + `error` when the replanner call itself failed and the run went on with its plan) |
208
+ | `steps[i].tier`, `.model`, `.tierReason`, `.escalations`, `.replanFailed` | with the core's `executorTiers`: the tier and model a step is on, why it started there, and its escalations (`StepEscalationView[]`); a tool call of an escalated attempt has `attempt`, a write that was not run twice `replayed`. `replanFailed`: the replanner failed after this step (a warning). All absent when tiers are off — see [docs/chat.md](docs/chat.md#model-tiers-escalation-and-a-replanner-that-failed) |
209
+ | `error`, `stopped`, `events`, `seq` | the run's error text (a replanner failure is not one: see `replan.failed`), whether it was stopped, the raw event log and its counter |
208
210
  | `modelLoad` | WebLLM download progress, when loading |
209
211
 
210
212
  **Options:** `deps` (rebuild the agent when these change — e.g. on a model
@@ -348,18 +350,35 @@ import { useMcp, useMcpServers } from '@dudko.dev/agent-web-react/mcp'
348
350
  ```
349
351
 
350
352
  The MCP hooks are **not** exported from `@dudko.dev/agent-web-react`. They load the
351
- core's `@dudko.dev/agent-web/mcp`, which imports `@modelcontextprotocol/sdk` — an
353
+ core's `@dudko.dev/agent-web/mcp`, which imports the MCP SDK
354
+ (`@modelcontextprotocol/client`) — an
352
355
  *optional* peer, so npm does not install it for you. A bundler cannot honour
353
356
  "optional": it resolves even a dynamic `import()` at build time, so a host that
354
357
  merely imported `useAgent` from the main entry used to fail webpack/CRA with
355
- `Module not found: @modelcontextprotocol/sdk/…` while never touching MCP. Behind a
358
+ `Module not found` for the SDK while never touching MCP. Behind a
356
359
  subpath the decision is yours:
357
360
 
358
361
  - **Don't use MCP** → import only from the main entry. Nothing in your build
359
362
  mentions the SDK; install nothing extra.
360
- - **Use MCP** → import from `…/mcp` and `npm install @modelcontextprotocol/sdk`
363
+ - **Use MCP** → import from `…/mcp` and `npm install @modelcontextprotocol/client`
361
364
  next to the core (it is bundled into an async chunk, loaded when you connect).
362
365
 
366
+ > **The MCP SDK is the core's peer, and it was renamed.** A core on the 2.x MCP
367
+ > SDK (`@dudko.dev/agent-web@0.0.40` and later) imports
368
+ > `@modelcontextprotocol/client` (`^2.4.0`); cores up to 0.0.39 import
369
+ > `@modelcontextprotocol/sdk` 1.x. Install the one your core asks for — when you
370
+ > upgrade the core: `npm uninstall @modelcontextprotocol/sdk && npm install
371
+ > @modelcontextprotocol/client`. This package imports neither, and its hooks
372
+ > work with both. Nothing changes in the hooks' API: `ConnectedMcp`,
373
+ > `BrowserOAuthProviderOptions`, `McpServerResult` and the other types exported
374
+ > from `…/mcp` are structural types of this package, not the SDK's. The one
375
+ > difference you can observe: `isUnauthorizedError(err)` now also recognises the
376
+ > error by its `name` (the 2.x class sets it) and across two copies of the SDK.
377
+ > A tool call refused with `403 insufficient_scope` fails with the SDK's
378
+ > `InsufficientScopeError`, which is **not** an authorization failure for
379
+ > `isUnauthorizedError` — the status stays `connected`. See the core's
380
+ > [upgrade notes](https://github.com/dudko-dev/agents/blob/main/packages/agent-web/README.md#upgrading-to-the-2x-mcp-sdk).
381
+
363
382
  > **Migrating from ≤ 0.0.18.** `useMcp`, `useMcpServers` and their helpers
364
383
  > (`readCallbackParams`, `claimOAuthCallback`, `stripOAuthParams`,
365
384
  > `describeMcpResult`, `isUnauthorizedError`) and types (`McpStatus`,
@@ -417,11 +436,17 @@ await mcp.connect({ url, oauth: true }) // or { url, headers: { Authorizat
417
436
  const config = { model, tools: { ...myTools, ...mcp.tools } }
418
437
  ```
419
438
 
420
- `useMcp` returns `{ status, tools, catalog, error, authorizationUrl,
439
+ `useMcp` returns `{ status, tools, catalog, instructions, error, authorizationUrl,
421
440
  oauthSupported, completingAuthorization, connect, disconnect, authorize,
422
441
  forgetAuthorization, checkOAuthSupport }`. `status` is
423
442
  `idle | connecting | connected | needs-authorization | error`.
424
443
 
444
+ `instructions` is what the connected server told the agent in its handshake (MCP `instructions`),
445
+ when it sent any. The core puts that text into the system prompt of an agent that uses the
446
+ server's tools, and it is **third-party text**: with bring-your-own servers, show it to the user,
447
+ labelled as the server's words (`useMcpServers().servers[i].instructions` is the same per server;
448
+ `mcpInstructionsOf(connection, name)` reads it from a `ConnectedMcp`).
449
+
425
450
  The OAuth round-trip navigates away from your app, so the hook persists what it
426
451
  needs and, on the way back, finishes the code exchange (passing `iss` to the
427
452
  core, which refuses a response from another authorization server - RFC 9207),
@@ -467,14 +492,16 @@ Two notes:
467
492
 
468
493
  - The connector lives in the core's optional `@dudko.dev/agent-web/mcp` subpath
469
494
  and is loaded with a **dynamic import**, so the SDK stays out of your initial
470
- bundle until `connect` runs. Install `@modelcontextprotocol/sdk` alongside the
471
- core — importing these hooks is what puts it in your build.
495
+ bundle until `connect` runs. Install `@modelcontextprotocol/client` alongside the
496
+ core (`@modelcontextprotocol/sdk` for a core up to 0.0.39) — importing these
497
+ hooks is what puts it in your build.
472
498
  - `oauthSupported` is `false` on cores older than `@dudko.dev/agent-web@0.0.9`,
473
499
  which introduced `BrowserOAuthProvider`; header auth still works there. The
474
- peer floor is `>=0.0.38` — the first core with pipelines (`createPipeline`,
475
- which the `./pipeline` entry builds on) and `clientMetadataUrl`, on top of the
476
- learning notebook, the virtual file system, attachments, consent, tool search,
477
- subagents, steering and context editing this package's chat builds on.
500
+ peer floor is `>=0.0.39` — the first core with model tiers, dynamic subagents,
501
+ media and decision models, whose helpers and constants this package imports
502
+ (`isReplayedToolOutput`, the media type lists), on top of pipelines, the learning
503
+ notebook, the virtual file system, attachments, consent, tool search, subagents,
504
+ steering and context editing this package's chat builds on.
478
505
 
479
506
  ## Several MCP servers — `useMcpServers`
480
507
 
@@ -483,7 +510,7 @@ import { useMcpServers } from '@dudko.dev/agent-web-react/mcp'
483
510
 
484
511
  const mcp = useMcpServers({ clientName: 'my-app' }) // the list persists; reconnects on load
485
512
  await mcp.add({ name: 'docs', url, auth: 'oauth' }) // 'none' | 'bearer' (+ token) | 'oauth'
486
- mcp.servers // [{ name, url, status, catalog, error, … }]
513
+ mcp.servers // [{ name, url, status, catalog, instructions, error, … }]
487
514
  const config = { model, tools: { ...myTools, ...mcp.tools } } // "<name>__<tool>"
488
515
  ```
489
516
 
@@ -515,8 +542,10 @@ use them standalone. The full guide: [docs/chat.md](docs/chat.md).
515
542
  | `<AgentChat>` | Full panel: transcript with per-answer activity + composer + optional history and files panels. Reads a `controller` prop or the `<AgentProvider>` context. |
516
543
  | `<AgentComposer>` | The input and its toolbar: attachments, commands, timer, agents, model/thinking, consent, mic, send/stop. |
517
544
  | `<MessageList>` | The transcript; each answer with its steps, tool calls, thoughts, usage. |
518
- | `<StepList>` / `<ToolCallRow>` | Execution steps / one tool call with its cost and images. |
519
- | `<ToolApprovalPrompt>` | Consent cards (Allow once / Always / Deny). |
545
+ | `<StepList>` / `<ToolCallRow>` | Execution steps / one tool call with its cost and images. With model tiers: the tier / model badge, the escalation line, the earlier attempt's calls (`showTiers`); a replanner failure as a warning (`showReplanFailed`); the decision model's note (`showDecisions`); the subagent tree under its step (`showSubagents`); a `web_search` call's results as plain text and safe links (`showSearchResults`). |
546
+ | `<SubagentTree>` / `<SubagentRow>` | The run's subagents - static ones and the helpers the model started - as an indented tree: status, model, tokens, time and a Stop button per node (`onStop`, `showUsage`, `showTools`, `renderSubagent`). |
547
+ | `<GeneratedMedia>` / `<TranscriptBlock>` | A file a media tool wrote, read from the workspace: an image inline or a native audio player (only the types the core generates; never SVG) / a folded "Transcript of …" block. `<MessageList files showMedia renderMedia>` places them in the answer. |
548
+ | `<ToolApprovalPrompt>` | Consent cards (Allow once / Always / Deny); a helper's request says which helper asks (`showHelper`). |
520
549
  | `<ApprovalModeSwitch>` | Segmented consent-mode switch. |
521
550
  | `<ChatHistoryList>` | Saved chats (from `useChatHistory`). |
522
551
  | `<FilesPanel>` | A `VirtualFileSystem`, live: preview, download, delete, upload. |
@@ -524,7 +553,7 @@ use them standalone. The full guide: [docs/chat.md](docs/chat.md).
524
553
  | `<ContextMeter>` | Tokens by kind, budget bar, last compaction, Compact. |
525
554
  | `<PlanView>` | A plan's reasoning + step list. |
526
555
  | `<ModelLoadBar>` | WebLLM download/init progress. |
527
- | `<UsageBadge>` | Compact token readout. |
556
+ | `<UsageBadge>` | Compact token readout; media and decision calls when there were some (`showCalls`). |
528
557
  | `<ApiKeyForm>` | BYOK key entry that writes to the encrypted vault. |
529
558
  | `<Composer>` | The minimal textarea + send/stop (kept for existing apps). |
530
559
  | `<PipelineEditor>` and its parts | The pipeline editor - from `@dudko.dev/agent-web-react/pipeline`, styled by `pipeline.css`. See [Pipelines](#pipelines-an-editor-on-a-canvas). |
@@ -542,7 +571,7 @@ state = agentStateReducer(state, { type: 'event', event }) // fold each AgentEve
542
571
  ```
543
572
 
544
573
  The state is made of plain, exported view types you can render with your own components:
545
- `StepView` (a step and its `ToolCallView`s), `ApprovalView`, `SubagentView`, `UserNoteView` /
574
+ `StepView` (a step and its `ToolCallView`s; `StepEscalationView` for its escalations), `ApprovalView`, `SubagentView`, `UserNoteView` /
546
575
  `QueuedMessageView` (steering), `LessonView` / `FetchView` (the notebook and the pages fetched),
547
576
  `BudgetView`, `CompactionView`, `AttachmentView`, `ChatMessage` (a transcript entry that keeps its
548
577
  own steps, usage and duration). Outside `<AgentChat>`, `useAgentContext()` returns the controller of
@@ -1,3 +1,85 @@
1
+ // src/components/format.ts
2
+ var previewValue = (value, max = 140) => {
3
+ if (value === void 0) return "";
4
+ let text2;
5
+ if (typeof value === "string") text2 = value;
6
+ else {
7
+ try {
8
+ text2 = JSON.stringify(value);
9
+ } catch {
10
+ text2 = String(value);
11
+ }
12
+ }
13
+ text2 = text2.replace(/\s+/g, " ").trim();
14
+ return text2.length > max ? `${text2.slice(0, max - 1)}\u2026` : text2;
15
+ };
16
+ var formatTokens = (n) => n >= 1e3 ? `${(n / 1e3).toFixed(n >= 1e4 ? 0 : 1)}k` : String(n);
17
+ var formatDuration = (ms) => {
18
+ if (ms < 1e3) return `${Math.round(ms)} ms`;
19
+ if (ms < 6e4) return `${(ms / 1e3).toFixed(ms < 1e4 ? 1 : 0)} s`;
20
+ const s = Math.round(ms / 1e3);
21
+ return `${Math.floor(s / 60)}m ${s % 60}s`;
22
+ };
23
+ var isDataImage = (v) => typeof v === "string" && /^data:image\/[\w.+-]+;base64,/.test(v);
24
+ var imagesInOutput = (output, depth = 0) => {
25
+ if (depth > 2 || output == null) return [];
26
+ if (isDataImage(output)) return [output];
27
+ if (Array.isArray(output)) return output.flatMap((v) => imagesInOutput(v, depth + 1));
28
+ if (typeof output === "object") {
29
+ const o = output;
30
+ if (o.type === "image" && typeof o.data === "string") {
31
+ const mime = typeof o.mimeType === "string" ? o.mimeType : "image/png";
32
+ return [o.data.startsWith("data:") ? o.data : `data:${mime};base64,${o.data}`];
33
+ }
34
+ for (const key of ["dataUrl", "url", "image"])
35
+ if (isDataImage(o[key])) return [o[key]];
36
+ if (depth < 2) return Object.values(o).flatMap((v) => imagesInOutput(v, depth + 1));
37
+ }
38
+ return [];
39
+ };
40
+ var text = (v, max) => typeof v === "string" ? v.replace(/\s+/g, " ").trim().slice(0, max) : "";
41
+ var webSearchOf = (output) => {
42
+ let value = output;
43
+ if (typeof value === "string") {
44
+ try {
45
+ value = JSON.parse(value);
46
+ } catch {
47
+ return void 0;
48
+ }
49
+ }
50
+ if (!value || typeof value !== "object" || Array.isArray(value)) return void 0;
51
+ const o = value;
52
+ if (typeof o.query !== "string" || !Array.isArray(o.results)) return void 0;
53
+ const results = [];
54
+ for (const r of o.results.slice(0, 10)) {
55
+ if (!r || typeof r !== "object") continue;
56
+ const item = r;
57
+ if (typeof item.url !== "string") continue;
58
+ let url;
59
+ try {
60
+ url = new URL(item.url);
61
+ } catch {
62
+ continue;
63
+ }
64
+ if (url.protocol !== "https:" && url.protocol !== "http:") continue;
65
+ const date = text(item.date, 40);
66
+ results.push({
67
+ title: text(item.title, 200) || url.host,
68
+ url: url.href,
69
+ host: url.host,
70
+ snippet: text(item.snippet, 400),
71
+ ...date ? { date } : {}
72
+ });
73
+ }
74
+ return {
75
+ query: text(o.query, 300),
76
+ results,
77
+ filtered: typeof o.filtered === "number" && o.filtered > 0 ? o.filtered : 0,
78
+ truncated: o.truncated === true
79
+ };
80
+ };
81
+ var formatProbability = (p) => String(Math.round(p * 100) / 100);
82
+
1
83
  // src/util.ts
2
84
  var errMessage = (err) => err instanceof Error ? err.message : String(err);
3
85
 
@@ -26,6 +108,10 @@ var AlertIcon = ({ size, className }) => /* @__PURE__ */ jsxs("svg", { ...base(s
26
108
  /* @__PURE__ */ jsx("path", { d: "M12 9v4" }),
27
109
  /* @__PURE__ */ jsx("path", { d: "M12 17h.01" })
28
110
  ] });
111
+ var ArrowUpIcon = ({ size, className }) => /* @__PURE__ */ jsxs("svg", { ...base(size), className, children: [
112
+ /* @__PURE__ */ jsx("path", { d: "M12 19V5" }),
113
+ /* @__PURE__ */ jsx("path", { d: "m5 12 7-7 7 7" })
114
+ ] });
29
115
  var ToolIcon = ({ size, className }) => /* @__PURE__ */ jsx("svg", { ...base(size), className, children: /* @__PURE__ */ jsx("path", { d: "M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76Z" }) });
30
116
  var ChevronIcon = ({ size, className }) => /* @__PURE__ */ jsx("svg", { ...base(size), className, children: /* @__PURE__ */ jsx("path", { d: "m6 9 6 6 6-6" }) });
31
117
  var ShieldIcon = ({ size, className }) => /* @__PURE__ */ jsx("svg", { ...base(size), className, children: /* @__PURE__ */ jsx("path", { d: "M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10Z" }) });
@@ -75,46 +161,6 @@ var GlobeIcon = ({ size, className }) => /* @__PURE__ */ jsxs("svg", { ...base(s
75
161
  ] });
76
162
  var DownloadIcon = ({ size, className }) => /* @__PURE__ */ jsx("svg", { ...base(size), className, children: /* @__PURE__ */ jsx("path", { d: "M12 3v12m-5-5 5 5 5-5M5 21h14" }) });
77
163
 
78
- // src/components/format.ts
79
- var previewValue = (value, max = 140) => {
80
- if (value === void 0) return "";
81
- let text;
82
- if (typeof value === "string") text = value;
83
- else {
84
- try {
85
- text = JSON.stringify(value);
86
- } catch {
87
- text = String(value);
88
- }
89
- }
90
- text = text.replace(/\s+/g, " ").trim();
91
- return text.length > max ? `${text.slice(0, max - 1)}\u2026` : text;
92
- };
93
- var formatTokens = (n) => n >= 1e3 ? `${(n / 1e3).toFixed(n >= 1e4 ? 0 : 1)}k` : String(n);
94
- var formatDuration = (ms) => {
95
- if (ms < 1e3) return `${Math.round(ms)} ms`;
96
- if (ms < 6e4) return `${(ms / 1e3).toFixed(ms < 1e4 ? 1 : 0)} s`;
97
- const s = Math.round(ms / 1e3);
98
- return `${Math.floor(s / 60)}m ${s % 60}s`;
99
- };
100
- var isDataImage = (v) => typeof v === "string" && /^data:image\/[\w.+-]+;base64,/.test(v);
101
- var imagesInOutput = (output, depth = 0) => {
102
- if (depth > 2 || output == null) return [];
103
- if (isDataImage(output)) return [output];
104
- if (Array.isArray(output)) return output.flatMap((v) => imagesInOutput(v, depth + 1));
105
- if (typeof output === "object") {
106
- const o = output;
107
- if (o.type === "image" && typeof o.data === "string") {
108
- const mime = typeof o.mimeType === "string" ? o.mimeType : "image/png";
109
- return [o.data.startsWith("data:") ? o.data : `data:${mime};base64,${o.data}`];
110
- }
111
- for (const key of ["dataUrl", "url", "image"])
112
- if (isDataImage(o[key])) return [o[key]];
113
- if (depth < 2) return Object.values(o).flatMap((v) => imagesInOutput(v, depth + 1));
114
- }
115
- return [];
116
- };
117
-
118
164
  export {
119
165
  errMessage,
120
166
  SendIcon,
@@ -122,6 +168,7 @@ export {
122
168
  SpinnerIcon,
123
169
  CheckIcon,
124
170
  AlertIcon,
171
+ ArrowUpIcon,
125
172
  ToolIcon,
126
173
  ChevronIcon,
127
174
  ShieldIcon,
@@ -142,6 +189,8 @@ export {
142
189
  previewValue,
143
190
  formatTokens,
144
191
  formatDuration,
145
- imagesInOutput
192
+ imagesInOutput,
193
+ webSearchOf,
194
+ formatProbability
146
195
  };
147
- //# sourceMappingURL=chunk-LCJZEGB5.js.map
196
+ //# sourceMappingURL=chunk-UUB7CE6N.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/format.ts","../src/util.ts","../src/components/icons.tsx"],"sourcesContent":["/** Compact one-line preview of a tool input/output value, truncated. */\nexport const previewValue = (value: unknown, max = 140): string => {\n if (value === undefined) return ''\n let text: string\n if (typeof value === 'string') text = value\n else {\n try {\n text = JSON.stringify(value)\n } catch {\n text = String(value)\n }\n }\n text = text.replace(/\\s+/g, ' ').trim()\n return text.length > max ? `${text.slice(0, max - 1)}…` : text\n}\n\n/** 1234 → \"1.2k\", 12345 → \"12k\". */\nexport const formatTokens = (n: number): string =>\n n >= 1000 ? `${(n / 1000).toFixed(n >= 10_000 ? 0 : 1)}k` : String(n)\n\n/** 340 → \"340 ms\", 4200 → \"4.2 s\", 125_000 → \"2m 5s\". */\nexport const formatDuration = (ms: number): string => {\n if (ms < 1000) return `${Math.round(ms)} ms`\n if (ms < 60_000) return `${(ms / 1000).toFixed(ms < 10_000 ? 1 : 0)} s`\n const s = Math.round(ms / 1000)\n return `${Math.floor(s / 60)}m ${s % 60}s`\n}\n\nconst isDataImage = (v: unknown): v is string =>\n typeof v === 'string' && /^data:image\\/[\\w.+-]+;base64,/.test(v)\n\n/**\n * Images inside a tool result, as data URLs: MCP image parts\n * (`{ type: 'image', data, mimeType }`), data-URL strings, and objects that\n * carry one (`{ dataUrl }` / `{ url: 'data:…' }`). Looks two levels deep.\n */\nexport const imagesInOutput = (output: unknown, depth = 0): string[] => {\n if (depth > 2 || output == null) return []\n if (isDataImage(output)) return [output]\n if (Array.isArray(output)) return output.flatMap((v) => imagesInOutput(v, depth + 1))\n if (typeof output === 'object') {\n const o = output as Record<string, unknown>\n if (o.type === 'image' && typeof o.data === 'string') {\n const mime = typeof o.mimeType === 'string' ? o.mimeType : 'image/png'\n return [o.data.startsWith('data:') ? o.data : `data:${mime};base64,${o.data}`]\n }\n for (const key of ['dataUrl', 'url', 'image'])\n if (isDataImage(o[key])) return [o[key] as string]\n if (depth < 2) return Object.values(o).flatMap((v) => imagesInOutput(v, depth + 1))\n }\n return []\n}\n\n/** One result of the core's `web_search` tool, as far as a UI shows it. */\nexport interface WebSearchResultView {\n title: string\n /** An http(s) address - anything else is left out. */\n url: string\n /** The host of `url`, for the line under the title. */\n host: string\n snippet: string\n date?: string\n}\n\nexport interface WebSearchView {\n query: string\n results: WebSearchResultView[]\n /** Results the egress policy left out. */\n filtered: number\n truncated: boolean\n}\n\nconst text = (v: unknown, max: number): string =>\n typeof v === 'string' ? v.replace(/\\s+/g, ' ').trim().slice(0, max) : ''\n\n/**\n * The result of the core's `web_search` tool (`{ query, results: [{ title, url, snippet, date? }],\n * filtered?, truncated?, untrusted: true }`), or undefined when `output` is not one. Titles and\n * snippets are third-party text: they come back as plain strings, to be rendered as text. A\n * result whose `url` is not http(s) is dropped, so a link can never be a `javascript:` one.\n */\nexport const webSearchOf = (output: unknown): WebSearchView | undefined => {\n let value = output\n if (typeof value === 'string') {\n try {\n value = JSON.parse(value)\n } catch {\n return undefined\n }\n }\n if (!value || typeof value !== 'object' || Array.isArray(value)) return undefined\n const o = value as Record<string, unknown>\n if (typeof o.query !== 'string' || !Array.isArray(o.results)) return undefined\n const results: WebSearchResultView[] = []\n for (const r of o.results.slice(0, 10)) {\n if (!r || typeof r !== 'object') continue\n const item = r as Record<string, unknown>\n if (typeof item.url !== 'string') continue\n let url: URL\n try {\n url = new URL(item.url)\n } catch {\n continue\n }\n if (url.protocol !== 'https:' && url.protocol !== 'http:') continue\n const date = text(item.date, 40)\n results.push({\n title: text(item.title, 200) || url.host,\n url: url.href,\n host: url.host,\n snippet: text(item.snippet, 400),\n ...(date ? { date } : {}),\n })\n }\n return {\n query: text(o.query, 300),\n results,\n filtered: typeof o.filtered === 'number' && o.filtered > 0 ? o.filtered : 0,\n truncated: o.truncated === true,\n }\n}\n\n/** 0.934 → \"0.93\", 0.8 → \"0.8\", 1 → \"1\". */\nexport const formatProbability = (p: number): string => String(Math.round(p * 100) / 100)\n","/** Normalize any thrown value into a message string. */\nexport const errMessage = (err: unknown): string =>\n err instanceof Error ? err.message : String(err)\n","// Tiny inline SVG icons — no icon-font or image dependency. Each inherits the\n// current text color (`stroke=\"currentColor\"`) and takes an optional size.\n\nexport interface IconProps {\n size?: number\n className?: string\n}\n\nconst base = (size = 16) => ({\n width: size,\n height: size,\n viewBox: '0 0 24 24',\n fill: 'none',\n stroke: 'currentColor',\n strokeWidth: 2,\n strokeLinecap: 'round' as const,\n strokeLinejoin: 'round' as const,\n 'aria-hidden': true,\n})\n\nexport const SendIcon = ({ size, className }: IconProps) => (\n <svg {...base(size)} className={className}>\n <path d=\"M22 2 11 13\" />\n <path d=\"M22 2 15 22l-4-9-9-4Z\" />\n </svg>\n)\n\nexport const StopIcon = ({ size, className }: IconProps) => (\n <svg {...base(size)} className={className}>\n <rect x=\"6\" y=\"6\" width=\"12\" height=\"12\" rx=\"2\" />\n </svg>\n)\n\nexport const SpinnerIcon = ({ size, className }: IconProps) => (\n <svg {...base(size)} className={['awr-spin', className].filter(Boolean).join(' ')}>\n <path d=\"M21 12a9 9 0 1 1-6.219-8.56\" />\n </svg>\n)\n\nexport const CheckIcon = ({ size, className }: IconProps) => (\n <svg {...base(size)} className={className}>\n <path d=\"M20 6 9 17l-5-5\" />\n </svg>\n)\n\nexport const AlertIcon = ({ size, className }: IconProps) => (\n <svg {...base(size)} className={className}>\n <path d=\"M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0Z\" />\n <path d=\"M12 9v4\" />\n <path d=\"M12 17h.01\" />\n </svg>\n)\n\nexport const ArrowUpIcon = ({ size, className }: IconProps) => (\n <svg {...base(size)} className={className}>\n <path d=\"M12 19V5\" />\n <path d=\"m5 12 7-7 7 7\" />\n </svg>\n)\n\nexport const ToolIcon = ({ size, className }: IconProps) => (\n <svg {...base(size)} className={className}>\n <path d=\"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76Z\" />\n </svg>\n)\n\nexport const ChevronIcon = ({ size, className }: IconProps) => (\n <svg {...base(size)} className={className}>\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n)\n\nexport const ShieldIcon = ({ size, className }: IconProps) => (\n <svg {...base(size)} className={className}>\n <path d=\"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10Z\" />\n </svg>\n)\n\nexport const BrainIcon = ({ size, className }: IconProps) => (\n <svg {...base(size)} className={className}>\n <path d=\"M9 3a3 3 0 0 0-3 3 3 3 0 0 0-2 5 3 3 0 0 0 2 5 3 3 0 0 0 6 1V4a3 3 0 0 0-3-1Z\" />\n <path d=\"M15 3a3 3 0 0 1 3 3 3 3 0 0 1 2 5 3 3 0 0 1-2 5 3 3 0 0 1-6 1\" />\n </svg>\n)\n\nexport const BotIcon = ({ size, className }: IconProps) => (\n <svg {...base(size)} className={className}>\n <rect x=\"4\" y=\"8\" width=\"16\" height=\"12\" rx=\"3\" />\n <path d=\"M12 8V4\" />\n <path d=\"M9 14h.01M15 14h.01\" />\n </svg>\n)\n\nexport const PlusIcon = ({ size, className }: IconProps) => (\n <svg {...base(size)} className={className}>\n <path d=\"M12 5v14M5 12h14\" />\n </svg>\n)\n\nexport const SlashIcon = ({ size, className }: IconProps) => (\n <svg {...base(size)} className={className}>\n <rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"3\" />\n <path d=\"m15 7-6 10\" />\n </svg>\n)\n\nexport const ClockIcon = ({ size, className }: IconProps) => (\n <svg {...base(size)} className={className}>\n <circle cx=\"12\" cy=\"12\" r=\"9\" />\n <path d=\"M12 7v5l3 2\" />\n </svg>\n)\n\nexport const MicIcon = ({ size, className }: IconProps) => (\n <svg {...base(size)} className={className}>\n <rect x=\"9\" y=\"3\" width=\"6\" height=\"11\" rx=\"3\" />\n <path d=\"M5 11a7 7 0 0 0 14 0M12 18v3\" />\n </svg>\n)\n\nexport const BoltIcon = ({ size, className }: IconProps) => (\n <svg {...base(size)} className={className}>\n <path d=\"M13 2 4 14h7l-1 8 9-12h-7Z\" />\n </svg>\n)\n\nexport const EyeIcon = ({ size, className }: IconProps) => (\n <svg {...base(size)} className={className}>\n <path d=\"M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12Z\" />\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n </svg>\n)\n\nexport const XIcon = ({ size, className }: IconProps) => (\n <svg {...base(size)} className={className}>\n <path d=\"M18 6 6 18M6 6l12 12\" />\n </svg>\n)\n\nexport const FileIcon = ({ size, className }: IconProps) => (\n <svg {...base(size)} className={className}>\n <path d=\"M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9Z\" />\n <path d=\"M14 3v6h6\" />\n </svg>\n)\n\nexport const HistoryIcon = ({ size, className }: IconProps) => (\n <svg {...base(size)} className={className}>\n <path d=\"M3 12a9 9 0 1 0 3-6.7L3 8\" />\n <path d=\"M3 3v5h5M12 7v5l3 2\" />\n </svg>\n)\n\nexport const BookIcon = ({ size, className }: IconProps) => (\n <svg {...base(size)} className={className}>\n <path d=\"M4 5a2 2 0 0 1 2-2h13v16H6a2 2 0 0 0-2 2Z\" />\n <path d=\"M4 19V5M9 7h6\" />\n </svg>\n)\n\nexport const GlobeIcon = ({ size, className }: IconProps) => (\n <svg {...base(size)} className={className}>\n <circle cx=\"12\" cy=\"12\" r=\"9\" />\n <path d=\"M3 12h18M12 3c3 3.2 3 14.8 0 18M12 3c-3 3.2-3 14.8 0 18\" />\n </svg>\n)\n\nexport const DownloadIcon = ({ size, className }: IconProps) => (\n <svg {...base(size)} className={className}>\n <path d=\"M12 3v12m-5-5 5 5 5-5M5 21h14\" />\n </svg>\n)\n"],"mappings":";AACO,IAAM,eAAe,CAAC,OAAgB,MAAM,QAAgB;AACjE,MAAI,UAAU,OAAW,QAAO;AAChC,MAAIA;AACJ,MAAI,OAAO,UAAU,SAAU,CAAAA,QAAO;AAAA,OACjC;AACH,QAAI;AACF,MAAAA,QAAO,KAAK,UAAU,KAAK;AAAA,IAC7B,QAAQ;AACN,MAAAA,QAAO,OAAO,KAAK;AAAA,IACrB;AAAA,EACF;AACA,EAAAA,QAAOA,MAAK,QAAQ,QAAQ,GAAG,EAAE,KAAK;AACtC,SAAOA,MAAK,SAAS,MAAM,GAAGA,MAAK,MAAM,GAAG,MAAM,CAAC,CAAC,WAAMA;AAC5D;AAGO,IAAM,eAAe,CAAC,MAC3B,KAAK,MAAO,IAAI,IAAI,KAAM,QAAQ,KAAK,MAAS,IAAI,CAAC,CAAC,MAAM,OAAO,CAAC;AAG/D,IAAM,iBAAiB,CAAC,OAAuB;AACpD,MAAI,KAAK,IAAM,QAAO,GAAG,KAAK,MAAM,EAAE,CAAC;AACvC,MAAI,KAAK,IAAQ,QAAO,IAAI,KAAK,KAAM,QAAQ,KAAK,MAAS,IAAI,CAAC,CAAC;AACnE,QAAM,IAAI,KAAK,MAAM,KAAK,GAAI;AAC9B,SAAO,GAAG,KAAK,MAAM,IAAI,EAAE,CAAC,KAAK,IAAI,EAAE;AACzC;AAEA,IAAM,cAAc,CAAC,MACnB,OAAO,MAAM,YAAY,gCAAgC,KAAK,CAAC;AAO1D,IAAM,iBAAiB,CAAC,QAAiB,QAAQ,MAAgB;AACtE,MAAI,QAAQ,KAAK,UAAU,KAAM,QAAO,CAAC;AACzC,MAAI,YAAY,MAAM,EAAG,QAAO,CAAC,MAAM;AACvC,MAAI,MAAM,QAAQ,MAAM,EAAG,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