@dudko.dev/agent-web-react 0.0.32 → 0.0.34
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 +3 -2
- package/dist/{elicitation-BW7R4iIw.d.cts → elicitation-BTrJ5t3c.d.cts} +11 -0
- package/dist/{elicitation-BW7R4iIw.d.ts → elicitation-BTrJ5t3c.d.ts} +11 -0
- package/dist/index.cjs +1047 -603
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +156 -7
- package/dist/index.d.ts +156 -7
- package/dist/index.js +982 -547
- package/dist/index.js.map +1 -1
- package/dist/mcp.d.cts +2 -2
- package/dist/mcp.d.ts +2 -2
- package/dist/styles.css +159 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -35,7 +35,7 @@ app with a single hook and (optionally) a set of pre-styled components:
|
|
|
35
35
|
- 🧩 **Building blocks** — `<AgentComposer>`, `<MessageList>`, `<StepList>`,
|
|
36
36
|
`<ToolApprovalPrompt>`, `<ElicitationPrompt>`, `<ApprovalModeSwitch>`, `<ChatHistoryList>`, `<FilesPanel>`,
|
|
37
37
|
`<LearnedSkills>`, `<ContextMeter>`, `<PlanView>`, `<ModelLoadBar>`, `<UsageBadge>`, `<ApiKeyForm>`; hooks `useChatHistory`,
|
|
38
|
-
`useVirtualFiles`, `useSpeechToText
|
|
38
|
+
`useVirtualFiles`, `useSpeechToText`, `useFollowScroll` (a transcript that follows the answer and leaves a reader where they are); MCP hooks `useMcp` / `useMcpServers` live in
|
|
39
39
|
[`@dudko.dev/agent-web-react/mcp`](#mcp-hooks-live-in-their-own-subpath).
|
|
40
40
|
- 🔑 **`useCredentials`** — store BYOK API keys **encrypted at rest**
|
|
41
41
|
(WebCrypto + IndexedDB).
|
|
@@ -209,7 +209,7 @@ function Custom() {
|
|
|
209
209
|
| `learned`, `learnedNow`, `fetches` | the agent's notebook (`LessonView[]`, survives `reset`), what it wrote this run, and the `web_fetch` requests this run made (`FetchView[]`) |
|
|
210
210
|
| `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) |
|
|
211
211
|
| `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) |
|
|
212
|
-
| `error`, `stopped`, `events`, `seq` | the run's error text (a replanner failure is not one: see `replan.failed`)
|
|
212
|
+
| `error`, `errorCode`, `stopped`, `events`, `seq` | the run's error text (a replanner failure is not one: see `replan.failed`); the core's code for an error a host may say in its own words - `'no-plan'` (the planner returned nothing readable) or `'no-answer'` (the model wrote no answer); whether it was stopped, the raw event log and its counter |
|
|
213
213
|
| `modelLoad` | WebLLM download progress, when loading |
|
|
214
214
|
|
|
215
215
|
**Options:** `deps` (rebuild the agent when these change — e.g. on a model
|
|
@@ -802,6 +802,7 @@ use them standalone. The full guide: [docs/chat.md](docs/chat.md).
|
|
|
802
802
|
| `<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`). |
|
|
803
803
|
| `<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`). |
|
|
804
804
|
| `<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. |
|
|
805
|
+
| `<ImageViewer>` / `<ImageThumb>` | A picture opened over the chat, in the page (never in a new window): fitted to the screen, previous / next within its message (arrows, swipe), zoom, Download as a file; a modal dialog with a focus trap, Esc / backdrop / close. Every picture `<MessageList>` draws is an `<ImageThumb>`; `<AgentChat imageViewer={false}>` keeps the old link in a new tab, `renderImageViewer` draws your own. See [docs/chat.md](docs/chat.md#pictures-open-in-the-page-the-image-viewer). |
|
|
805
806
|
| `<FileChips>` / `<FileChip>` | The files an answer wrote to the workspace (the core's `file.written` / `file.deleted`), as chips: name, kind, size, open, download; an inline preview (text with line numbers, a picture, your own rendering through `renderFileContent`), and an `.html` file in a sandboxed frame with Preview / Source. `<MessageList files showFileChips htmlPreview renderFile renderFileContent>` places them under the answer. |
|
|
806
807
|
| `<SandboxedFrame>` / `<SourceView>` | Untrusted HTML inside chrome the host draws: `<iframe sandbox>` without `allow-same-origin`, by `srcdoc`, no network, fixed height (`html`, `scripts`, `title`, `label`, `actions`, `footer`, `height`) / a file's text with line numbers, never markup. See [the boundary](#the-html-preview-is-a-security-boundary). |
|
|
807
808
|
| `<ToolApprovalPrompt>` | Consent cards (Allow once / Always / Deny); a helper's request says which helper asks (`showHelper`); an MCP App's says the APP asks, with the server's own tool name; an MCP server's skill gets its own card (the server, the skill, a collapsed preview of its text - `showSkillPreview` - and Allow once / Always for this server / Deny). |
|
|
@@ -1251,7 +1251,12 @@ interface CompactionView {
|
|
|
1251
1251
|
/** An execution step with its accumulated text and tool calls. */
|
|
1252
1252
|
interface StepView {
|
|
1253
1253
|
id: string;
|
|
1254
|
+
/** Its place in the run (1-based). */
|
|
1254
1255
|
index: number;
|
|
1256
|
+
/**
|
|
1257
|
+
* The plan's length as the run's LATEST step started: a replan that grew or cut the plan
|
|
1258
|
+
* renumbers the earlier rows too (1/2, 2/2 - not 1/1, 2/2).
|
|
1259
|
+
*/
|
|
1255
1260
|
total: number;
|
|
1256
1261
|
step: IPlanStep;
|
|
1257
1262
|
/** Streamed executor text for this step (step.text-delta). */
|
|
@@ -1397,6 +1402,12 @@ interface AgentUiState {
|
|
|
1397
1402
|
* `replan.failed` and `StepView.replanFailed`).
|
|
1398
1403
|
*/
|
|
1399
1404
|
error?: string;
|
|
1405
|
+
/**
|
|
1406
|
+
* The core's code of a run error a host may want to say in its own words: `'no-plan'` (the
|
|
1407
|
+
* planner returned nothing readable) or `'no-answer'` (the model wrote no answer). Absent for
|
|
1408
|
+
* every other error.
|
|
1409
|
+
*/
|
|
1410
|
+
errorCode?: 'no-plan' | 'no-answer';
|
|
1400
1411
|
/** True when the last run was aborted via stop(). */
|
|
1401
1412
|
stopped: boolean;
|
|
1402
1413
|
/** A chat-style transcript built from every run, for chat UIs. */
|
|
@@ -1251,7 +1251,12 @@ interface CompactionView {
|
|
|
1251
1251
|
/** An execution step with its accumulated text and tool calls. */
|
|
1252
1252
|
interface StepView {
|
|
1253
1253
|
id: string;
|
|
1254
|
+
/** Its place in the run (1-based). */
|
|
1254
1255
|
index: number;
|
|
1256
|
+
/**
|
|
1257
|
+
* The plan's length as the run's LATEST step started: a replan that grew or cut the plan
|
|
1258
|
+
* renumbers the earlier rows too (1/2, 2/2 - not 1/1, 2/2).
|
|
1259
|
+
*/
|
|
1255
1260
|
total: number;
|
|
1256
1261
|
step: IPlanStep;
|
|
1257
1262
|
/** Streamed executor text for this step (step.text-delta). */
|
|
@@ -1397,6 +1402,12 @@ interface AgentUiState {
|
|
|
1397
1402
|
* `replan.failed` and `StepView.replanFailed`).
|
|
1398
1403
|
*/
|
|
1399
1404
|
error?: string;
|
|
1405
|
+
/**
|
|
1406
|
+
* The core's code of a run error a host may want to say in its own words: `'no-plan'` (the
|
|
1407
|
+
* planner returned nothing readable) or `'no-answer'` (the model wrote no answer). Absent for
|
|
1408
|
+
* every other error.
|
|
1409
|
+
*/
|
|
1410
|
+
errorCode?: 'no-plan' | 'no-answer';
|
|
1400
1411
|
/** True when the last run was aborted via stop(). */
|
|
1401
1412
|
stopped: boolean;
|
|
1402
1413
|
/** A chat-style transcript built from every run, for chat UIs. */
|