@dudko.dev/agent-web-react 0.0.39 → 0.0.40

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.d.cts CHANGED
@@ -2,8 +2,8 @@ import * as react from 'react';
2
2
  import { DependencyList, ReactNode, RefObject, ComponentType, CSSProperties } from 'react';
3
3
  import { AskUserRequest, AskUserContext, AskUserAnswer, AskUserConfig, AskUserHandler, AgentEvent, RunFile, RunResult, Agent, ToolApprovalMode, AppToolCallRequest, AppSamplingRequest, AppSamplingView, AppSamplingResult, CompactResult, IUsage, AgentEventHandler, BrowserAgentConfig, VirtualFileInfo, VirtualFileSystem, CredentialStore, createWebLLMModel, WebLLMModelOptions, ModelTier, TierReason, EscalationReason, DecisionFallbackReason, Skill, IPlan, ToolApprovalRequest, ToolApprovalContext, ToolApprovalDecision } from '@dudko.dev/agent-web';
4
4
  export { Agent, AgentEvent, AgentEventHandler, AgentLoggerSink, AgentTool, AgentToolSet, AppToolCallRequest, AskUserAnswer, AskUserConfig, AskUserContext, AskUserHandler, AskUserOption, AskUserRequest, AttachmentsNotSupportedError, BrowserAgentConfig, CompactResult, CompactionConfig, CredentialStore, FileToolsOptions, IPlan, IPlanStep, IStepResult, IToolCall, IUsage, ImagesNotSupportedError, IndexedDBStore, LearningConfig, LogLevel, McpAppCsp, McpAppResource, McpAppToolResult, MemoryCredentialStore, MemorySkillStore, MemoryStore, ModelInput, ProviderModelSpec, ProviderType, RunControl, RunFile, RunOptions, RunResult, SessionBusyError, SessionHolder, SessionLockMode, SessionRunState, SessionWatch, Skill, SkillStore, StorageChange, StorageChangeKind, StorageChangeOp, SubagentInfo, SubagentToolOptions, SubagentWorkerConfig, ThinkingLevel, ThinkingSetting, TokenLimits, ToolApprovalConfig, ToolApprovalContext, ToolApprovalMode, ToolApprovalRequest, VaultCredentialStore, VfsSkillStore, VirtualFile, VirtualFileInfo, VirtualFileSystem, WatchSessionOptions, createAgent, createFileTools, createRunControl, createSubagentTool, createWebLLMModel, defineSkill, defineTool, isWebGPUAvailable, loadSkillFromUrl, markReadOnly, onStorageChange, parseSkillMarkdown, postStorageChange, preloadWebLLMModel, serveSubagentWorker, supportsImages, supportsPdf, unloadWebLLMModel, watchSession } from '@dudko.dev/agent-web';
5
- import { A as AgentUiState, C as ChatAttachment, a as ApprovalView, b as ChatMessage, c as AgentStatus, E as ElicitationIssueKind, d as ElicitationOutcomeReason, M as McpAppSandboxReason, R as RemoteRunView, L as LessonView, S as SubagentView, e as SubagentNode, P as PendingElicitation, f as McpElicitationResult, g as ElicitationView, W as WrittenFileView, T as ToolCallView, h as StepView, U as UserNoteView, D as DecisionView, i as MediaView, j as AppView, Q as QuestionView, k as McpAppsConnectionLike, l as McpAppSandboxOptions, m as AppRequestView, n as TranscriptView, B as BudgetView, o as CompactionView, p as ModelLoadState, q as McpAppHost, r as AppRequestAnswerOptions } from './elicitation-DdzjMut9.cjs';
6
- export { s as APP_DEFAULT_HEIGHT, t as APP_MAX_HEIGHT, u as APP_MIN_HEIGHT, v as AppDownload, w as AppDownloadView, x as AppFileSaverEnv, y as AppLink, z as AppReadyDownload, F as AppResourceReader, G as ElicitationControl, H as ElicitationDraft, I as ElicitationDraftValue, J as ElicitationField, K as ElicitationFormOutcome, N as ElicitationIssue, O as ElicitationLink, V as ElicitationOption, X as FetchView, Y as MCP_APP_DISPLAY_MODES, Z as MCP_APP_MAX_ARGS_CHARS, _ as MCP_APP_MAX_DOWNLOAD_BYTES, $ as MCP_APP_MAX_FILE_NAME_CHARS, a0 as MCP_APP_MAX_IN_FLIGHT, a1 as MCP_APP_MAX_MESSAGE_CHARS, a2 as MCP_APP_MAX_URL_CHARS, a3 as MCP_APP_NOTIFICATIONS, a4 as MCP_APP_OPTIONAL_REQUESTS, a5 as MCP_APP_PROTOCOL_VERSION, a6 as MCP_APP_REFUSED, a7 as MCP_APP_REFUSED_DOWNLOAD_EXTENSIONS, a8 as MCP_APP_REFUSED_DOWNLOAD_TYPES, a9 as MCP_APP_RELAY, aa as MCP_APP_REQUESTS, ab as MCP_APP_SANDBOX_FRAME_TOKENS, ac as MCP_APP_SANDBOX_GRACE_MS, ad as MCP_APP_SANDBOX_SERVER, ae as MCP_APP_SANDBOX_TIMEOUT_MS, af as McpAppBridge, ag as McpAppBridgeHandlers, ah as McpAppBridgeOptions, ai as McpAppDisplayMode, aj as McpAppRpcError, ak as McpAppRpcMessage, al as McpAppSandboxInput, am as McpAppSandboxLink, an as McpAppSandboxLinkOptions, ao as McpAppSandboxTarget, ap as McpElicitationFieldSchema, aq as McpElicitationRequest, ar as McpElicitationSchema, as as QueuedMessageView, at as ReplanState, au as SkillConsentView, av as StepEscalationView, aw as UseMcpAppHostOptions, ax as appDisplayModeAllowed, ay as appDownloadOf, az as appDownloadRefusal, aA as appFileExtensionOf, aB as appFileNameOf, aC as appGestureOf, aD as appLinkOf, aE as appMessageTextOf, aF as appMimeTypeOf, aG as appSamplingErrorOf, aH as buildMcpAppDocument, aI as buildMcpAppSandboxShell, aJ as clampAppHeight, aK as elicitationFields, aL as elicitationFormAnswer, aM as elicitationInitialDraft, aN as elicitationLink, aO as formatCountdown, aP as grantedAppCsp, aQ as mcpAppCsp, aR as mcpAppHostCapabilities, aS as mcpAppSandboxProxyUrl, aT as mcpAppSandboxShellCsp, aU as mcpAppSandboxTarget, aV as resolveAppDownload, aW as saveAppFile, aX as useMcpAppHost } from './elicitation-DdzjMut9.cjs';
5
+ import { A as AgentUiState, C as ChatAttachment, a as ApprovalView, b as ChatMessage, c as AgentStatus, E as ElicitationIssueKind, d as ElicitationOutcomeReason, M as McpAppSandboxReason, R as RemoteRunView, L as LessonView, S as SubagentView, e as SubagentNode, P as PendingElicitation, f as McpElicitationResult, g as ElicitationView, W as WrittenFileView, T as ToolCallView, h as StepView, U as UserNoteView, D as DecisionView, i as MediaView, j as AppView, Q as QuestionView, k as McpAppsConnectionLike, l as McpAppSandboxOptions, m as AppRequestView, n as TranscriptView, B as BudgetView, o as CompactionView, p as ModelLoadState, q as McpAppHost, r as AppRequestAnswerOptions } from './elicitation-IpjGRDD-.cjs';
6
+ export { s as APP_DEFAULT_HEIGHT, t as APP_MAX_HEIGHT, u as APP_MIN_HEIGHT, v as AppDownload, w as AppDownloadView, x as AppFileSaverEnv, y as AppLink, z as AppReadyDownload, F as AppResourceReader, G as ElicitationControl, H as ElicitationDraft, I as ElicitationDraftValue, J as ElicitationField, K as ElicitationFormOutcome, N as ElicitationIssue, O as ElicitationLink, V as ElicitationOption, X as FetchView, Y as MCP_APP_DISPLAY_MODES, Z as MCP_APP_MAX_ARGS_CHARS, _ as MCP_APP_MAX_DOWNLOAD_BYTES, $ as MCP_APP_MAX_FILE_NAME_CHARS, a0 as MCP_APP_MAX_IN_FLIGHT, a1 as MCP_APP_MAX_MESSAGE_CHARS, a2 as MCP_APP_MAX_URL_CHARS, a3 as MCP_APP_NOTIFICATIONS, a4 as MCP_APP_OPTIONAL_REQUESTS, a5 as MCP_APP_PROTOCOL_VERSION, a6 as MCP_APP_REFUSED, a7 as MCP_APP_REFUSED_DOWNLOAD_EXTENSIONS, a8 as MCP_APP_REFUSED_DOWNLOAD_TYPES, a9 as MCP_APP_RELAY, aa as MCP_APP_REQUESTS, ab as MCP_APP_SANDBOX_FRAME_TOKENS, ac as MCP_APP_SANDBOX_GRACE_MS, ad as MCP_APP_SANDBOX_SERVER, ae as MCP_APP_SANDBOX_TIMEOUT_MS, af as McpAppBridge, ag as McpAppBridgeHandlers, ah as McpAppBridgeOptions, ai as McpAppDisplayMode, aj as McpAppRpcError, ak as McpAppRpcMessage, al as McpAppSandboxInput, am as McpAppSandboxLink, an as McpAppSandboxLinkOptions, ao as McpAppSandboxTarget, ap as McpElicitationFieldSchema, aq as McpElicitationRequest, ar as McpElicitationSchema, as as QueuedMessageView, at as ReplanState, au as SkillConsentView, av as StepEscalationView, aw as UseMcpAppHostOptions, ax as appDisplayModeAllowed, ay as appDownloadOf, az as appDownloadRefusal, aA as appFileExtensionOf, aB as appFileNameOf, aC as appGestureOf, aD as appLinkOf, aE as appMessageTextOf, aF as appMimeTypeOf, aG as appSamplingErrorOf, aH as buildMcpAppDocument, aI as buildMcpAppSandboxShell, aJ as clampAppHeight, aK as elicitationFields, aL as elicitationFormAnswer, aM as elicitationInitialDraft, aN as elicitationLink, aO as formatCountdown, aP as grantedAppCsp, aQ as mcpAppCsp, aR as mcpAppHostCapabilities, aS as mcpAppSandboxProxyUrl, aT as mcpAppSandboxShellCsp, aU as mcpAppSandboxTarget, aV as resolveAppDownload, aW as saveAppFile, aX as useMcpAppHost } from './elicitation-IpjGRDD-.cjs';
7
7
  export { M as MCP_APP_POLICY_TOKEN_MAX_CHARS, a as MCP_APP_SANDBOX_PROXY_READY, b as MCP_APP_SANDBOX_RESOURCE_READY, i as isMcpAppSandboxMessage, m as mcpAppPolicyToken } from './mcp-app-policy-DIUmGPJP.cjs';
8
8
 
9
9
  /**
@@ -186,8 +186,10 @@ interface UseAgentReturn extends AgentUiState {
186
186
  /**
187
187
  * Say something to the conversation's run in another tab (`remote`): it reaches that run's
188
188
  * model at its next boundary, marked as from another tab. `false` when no such run is followed
189
- * or the text is empty. A message that tab refuses (or never answers) comes back in
190
- * `undelivered`.
189
+ * or the text is empty. Until that tab answers, the text is in `queued` marked
190
+ * `sentTo: 'another-tab'` (shown "waiting for the other tab to pick it up") - with no time
191
+ * limit: a tab the browser froze answers when it wakes. Taken, that run's own entry takes its
192
+ * place; refused, or that run ended without it, it comes back in `undelivered`.
191
193
  */
192
194
  sendRemote: (text: string) => boolean;
193
195
  /**
@@ -719,6 +721,23 @@ declare const speakableText: (markdown: string, options?: SpeakableOptions) => s
719
721
  * seconds; a provider takes a few thousand characters per call).
720
722
  */
721
723
  declare const splitForSpeech: (text: string, max?: number) => string[];
724
+ /** A writing system, as far as a voice needs to know: the letters it can read. */
725
+ type SpeechScript = 'latin' | 'cyrillic' | 'greek' | 'arabic' | 'hebrew' | 'han' | 'kana' | 'hangul' | 'devanagari' | 'thai' | 'georgian' | 'armenian';
726
+ /** The script a language (BCP-47) is written in: `sr-Latn` is Latin, `zh-*` Han, `ja` kana. */
727
+ declare const scriptOfLanguage: (lang: string) => SpeechScript;
728
+ /**
729
+ * The script most of a text's letters are written in (digits, signs and spaces do not count);
730
+ * a text with any kana is Japanese (it is mostly Han letters too). Undefined: no letters.
731
+ */
732
+ declare const scriptOfText: (text: string) => SpeechScript | undefined;
733
+ /**
734
+ * The language to read a text in: the first of `preferred` (the UI's language, then the
735
+ * browser's, `navigator.languages`) written in the text's script - so a Russian answer in an
736
+ * English interface is read in Russian, not spelled by an English voice -, else the script's
737
+ * usual language. A text without letters: the first preferred. Which of the languages of ONE
738
+ * script (English or French) cannot be told from the letters: the person's order decides.
739
+ */
740
+ declare const languageOfText: (text: string, preferred?: readonly (string | undefined)[]) => string | undefined;
722
741
  /** The slice of a `SpeechSynthesisVoice` used here. */
723
742
  interface SpeechVoiceLike {
724
743
  voiceURI: string;
@@ -728,7 +747,8 @@ interface SpeechVoiceLike {
728
747
  default?: boolean;
729
748
  }
730
749
  /**
731
- * The voice to read a language with: the person's (by `voiceURI`) while the browser has it; else
750
+ * The voice to read a language with: the person's (by `voiceURI`) while the browser has it and it
751
+ * reads that language's script; else
732
752
  * one of exactly that language (`pt-BR`), then of its base (`pt`) - a voice on the device before a
733
753
  * network one, the browser's default of the language first. Undefined: none for the language (the
734
754
  * browser then reads with its own default).
@@ -1320,6 +1340,16 @@ interface AgentLabels {
1320
1340
  notebookRevision: (n: number) => string;
1321
1341
  /** Before the sources a lesson came from. */
1322
1342
  notebookFrom: string;
1343
+ /** Before a fact that was just saved. */
1344
+ memorySaved: string;
1345
+ /** Before a fact that was just changed. */
1346
+ memoryUpdated: string;
1347
+ /** Before a fact that was just forgotten. */
1348
+ memoryForgotten: string;
1349
+ /** The card's button that takes it back. */
1350
+ memoryUndo: string;
1351
+ /** In place of the button once it was taken back. */
1352
+ memoryUndone: string;
1323
1353
  placeholder: string;
1324
1354
  listening: string;
1325
1355
  message: string;
@@ -1447,6 +1477,11 @@ interface AgentLabels {
1447
1477
  * run (`sessionBusy`) - in another tab, or in this one - to finish. Shown only while that lasts.
1448
1478
  */
1449
1479
  queuedForSession: (heldBy: 'another-tab' | 'this-tab') => string;
1480
+ /**
1481
+ * What this tab said to the conversation's run in another tab (`sendRemote`), while that tab has
1482
+ * not answered (it may be in the background, frozen by the browser): it is not refused.
1483
+ */
1484
+ queuedForOtherTab: string;
1450
1485
  /** Where a note landed: between tool calls / after a step / before the answer. */
1451
1486
  noteAt: Record<'round' | 'step' | 'final', string>;
1452
1487
  /** Messages the run ended without delivering, offered for sending. */
@@ -1931,6 +1966,28 @@ type AgentAction =
1931
1966
  texts: string[];
1932
1967
  keepQueued?: boolean;
1933
1968
  }
1969
+ /**
1970
+ * `sendRemote`: the text went to the conversation's run in another tab, which has not answered
1971
+ * yet - shown in `queued`, marked `sentTo: 'another-tab'`, until `remote-answer` with this `id`
1972
+ * (or that run's own `message.queued` for it, which takes its place).
1973
+ */
1974
+ | {
1975
+ type: 'remote-send';
1976
+ id: string;
1977
+ text: string;
1978
+ }
1979
+ /**
1980
+ * That tab's answer to `remote-send` `id`: `taken` (its run has it), `refused` (refused, or its
1981
+ * run ended without taking it - the text comes back in `undelivered`, to send again or drop), or
1982
+ * `unknown` (the watch that sent it was closed - another conversation is in view: nothing is
1983
+ * offered, as that tab may still take it). Either way the waiting entry goes.
1984
+ */
1985
+ | {
1986
+ type: 'remote-answer';
1987
+ id: string;
1988
+ text: string;
1989
+ answer: 'taken' | 'refused' | 'unknown';
1990
+ }
1934
1991
  /**
1935
1992
  * The user sent a goal and this tab's run is getting going: its turn is shown at once (a
1936
1993
  * user message and a pending answer), until the run's `run.start` takes its place.
@@ -2494,7 +2551,12 @@ declare const StepList: ({ steps, subagents, approvals, notes, showNotes, onStop
2494
2551
  interface ReadAloudOptions {
2495
2552
  /** The engine: `createBrowserSpeaker()` (the device's voices) or `createAudioSpeaker(...)`. Keep it stable. */
2496
2553
  speak: SpeakText;
2497
- /** The answers' language (BCP-47): the browser's voice is picked for it. */
2554
+ /**
2555
+ * The interface's language (BCP-47), the first choice for a text in its script: each answer is
2556
+ * read in ITS language - the script of its letters decides (`languageOfText`: this, then the
2557
+ * browser's languages, then the script's usual one), so a Russian answer in an English
2558
+ * interface is read by a Russian voice.
2559
+ */
2498
2560
  lang?: string;
2499
2561
  /** What is read of an answer. Default: its Markdown as words (`speakableText`, code left out). */
2500
2562
  textOf?: (message: ChatMessage) => string;
@@ -2571,6 +2633,15 @@ interface MessageListProps {
2571
2633
  readAloud?: ReadAloudOptions;
2572
2634
  /** Tool calls inside the activity. */
2573
2635
  renderToolCall?: RenderToolCall;
2636
+ /**
2637
+ * A tool call as a card in the answer itself - outside the folded activity, above the text -
2638
+ * for the calls the user should see without opening it (a fact remembered, an order placed):
2639
+ * return a node for those (`<MemoryCard>` is one), `null` / `undefined` for the rest. Called for
2640
+ * every tool call of an assistant turn, in order; nothing is drawn without it.
2641
+ */
2642
+ renderToolCard?: (call: ToolCallView, message: ChatMessage) => ReactNode;
2643
+ /** Draw the tool cards (default true; needs `renderToolCard`). */
2644
+ showToolCards?: boolean;
2574
2645
  /**
2575
2646
  * The MCP Apps an answer's tool calls came with (`message.apps`), drawn between its activity
2576
2647
  * and its text. `<AgentChat mcpApps>` passes `<McpAppFrame>`; without this prop none is drawn.
@@ -2613,7 +2684,7 @@ declare const AttachmentView: ({ attachment: a, files, labels, }: {
2613
2684
  * subagents, consent decisions — and the tokens it spent by kind. Every part
2614
2685
  * can be hidden, relabelled or rendered by the host.
2615
2686
  */
2616
- declare const MessageList: ({ messages, empty, showActivity, showToolCalls, showUsage, showThoughts, showNotes, showLearned, showTiers, showReplanFailed, showDecisions, showSearchResults, showSubagents, showMedia, showFileChips, files, htmlPreview, onShowFiles, renderFile, renderFileContent, renderMedia, renderSubagent, onStopSubagent, activityOpen, liveExtra, renderContent, renderMessage, renderAttachment, renderToolCall, renderApp, showApps, imageViewer, renderImageViewer, readAloud, labels, className, }: MessageListProps) => react.JSX.Element | null;
2687
+ declare const MessageList: ({ messages, empty, showActivity, showToolCalls, showUsage, showThoughts, showNotes, showLearned, showTiers, showReplanFailed, showDecisions, showSearchResults, showSubagents, showMedia, showFileChips, files, htmlPreview, onShowFiles, renderFile, renderFileContent, renderMedia, renderSubagent, onStopSubagent, activityOpen, liveExtra, renderContent, renderMessage, renderAttachment, renderToolCall, renderToolCard, showToolCards, renderApp, showApps, imageViewer, renderImageViewer, readAloud, labels, className, }: MessageListProps) => react.JSX.Element | null;
2617
2688
 
2618
2689
  interface QuestionPromptProps {
2619
2690
  /**
@@ -2868,6 +2939,10 @@ interface AgentChatProps {
2868
2939
  */
2869
2940
  readAloud?: MessageListProps['readAloud'];
2870
2941
  renderToolCall?: RenderToolCall;
2942
+ /** A tool call as a card in the answer, outside the activity (`<MemoryCard>`; see `MessageList`). */
2943
+ renderToolCard?: MessageListProps['renderToolCard'];
2944
+ /** Draw the tool cards (default true; needs `renderToolCard`). */
2945
+ showToolCards?: boolean;
2871
2946
  /** A node of the subagent tree. */
2872
2947
  renderSubagent?: RenderSubagent;
2873
2948
  /** A generated image / audio file. */
@@ -2999,6 +3074,34 @@ interface LearnedSkillsProps {
2999
3074
  */
3000
3075
  declare const LearnedSkills: ({ controller, lessons, onForget, showSources, empty, hideTitle, labels, className, }: LearnedSkillsProps) => react.JSX.Element;
3001
3076
 
3077
+ interface MemoryCardProps {
3078
+ /** What happened: a fact saved, a fact changed, a fact forgotten. */
3079
+ kind: 'saved' | 'updated' | 'forgotten';
3080
+ /** The fact: as it was saved or changed to, or as it was when it was forgotten. Drawn as text. */
3081
+ text: string;
3082
+ /**
3083
+ * Take it back - the host does the work (delete the fact saved, put back the one forgotten or
3084
+ * changed). Absent: no button.
3085
+ */
3086
+ onUndo?: () => void | Promise<unknown>;
3087
+ /**
3088
+ * It has been taken back: the host knows (its store no longer has the fact saved, or has the one
3089
+ * forgotten again) - "Undone" in place of the button, even after a reload.
3090
+ */
3091
+ undone?: boolean;
3092
+ /** Why the last Undo did not go through, in the host's words (shown under the text). */
3093
+ problem?: string;
3094
+ labels?: AgentLabelsOverride;
3095
+ className?: string;
3096
+ }
3097
+ /**
3098
+ * One fact the host's app remembered, changed or forgot about the user, as a card in the answer -
3099
+ * its text and an Undo. The package keeps no memory of its own: the host decides which tool calls
3100
+ * are memory (`<AgentChat renderToolCard>`), what Undo does and when it is undone. The text is a
3101
+ * text node, never markup.
3102
+ */
3103
+ declare const MemoryCard: ({ kind, text, onUndo, undone, problem, labels, className, }: MemoryCardProps) => react.JSX.Element;
3104
+
3002
3105
  interface ComposerProps {
3003
3106
  /** Called with the trimmed text when the user submits. */
3004
3107
  onSubmit: (text: string) => void;
@@ -3428,5 +3531,5 @@ interface AppRequestPromptProps {
3428
3531
  */
3429
3532
  declare const AppRequestPrompt: ({ requests, onAnswer, renderRequest, labels, className, }: AppRequestPromptProps) => react.JSX.Element | null;
3430
3533
 
3431
- export { ASK_USER_TOOL_NAME, ATTACHMENT_BOUNDS, AgentChat, AgentComposer, AgentLabelsProvider, AgentProvider, AgentStatus, AgentUiState, ApiKeyForm, AppRequestAnswerOptions, AppRequestPrompt, AppRequestView, AppView, ApprovalModeSwitch, ApprovalView, AttachmentView, BudgetView, ChatAttachment, ChatHistoryList, ChatHistoryStore, ChatMessage, CompactionView, Composer, ContextMeter, DecisionView, ElicitationIssueKind, ElicitationOutcomeReason, ElicitationPrompt, ElicitationView, FILE_PREVIEW_CHARS, FOLLOW_LEAVE_PX, FOLLOW_REJOIN_PX, FRAME_MAX_HEIGHT, FRAME_MIN_HEIGHT, FileChip, FileChips, FilesPanel, GeneratedMedia, HTML_PREVIEW_MAX_CHARS, ImageThumb, ImageViewer, ImageViewerProvider, LearnedSkills, LessonView, McpAppFrame, McpAppHost, McpAppLine, McpAppSandboxOptions, McpAppSandboxReason, McpAppsConnectionLike, McpElicitationResult, MediaView, MessageList, MicError, ModelLoadBar, ModelLoadState, PendingElicitation, PlanView, QUESTION_TIMEOUT_MS, QuestionPrompt, QuestionView, RECORDING_DEFAULT_MAX_MS, RECORDING_TYPES, RemoteRunView, SandboxedFrame, SourceView, SpeechOutputError, StepList, StepView, SubagentNode, SubagentRow, SubagentTree, SubagentView, ToolApprovalPrompt, ToolCallRow, ToolCallView, TranscriptBlock, TranscriptView, UsageBadge, UserNoteRow, UserNoteView, agentStateReducer, agentStatusOf, askUserOutputKept, askUserWith, attachmentKindOf, attachmentOverLimit, attachmentRefusal, attachmentTransformOf, attachmentsText, audioExtensionOf, audioTypeOf, buildSandboxedDocument, chatTitle, clampFrameHeight, createApprovalQueue, createAudioSpeaker, createBrowserSpeaker, createInitialAgentState, createQuestionQueue, createRecordingRecognizer, createWebLLMEngine, decisionNote, defaultLabels, downscaleImage, escapeAttribute, fileKindOf, fileNameOf, filterCommands, followsAfterResize, followsAfterScroll, formatClock, formatElapsed, imageExtensionOf, imageSizeOf, lessonsOf, linkedFilesOf, mediaFamilyOf, menuKeyTarget, menuSections, mergeChatRecord, mergeLabels, messageOverLimit, micProblemOf, micProblemText, newChatId, noticesOf, parseSlash, pendingApprovalsOf, pickRecordingType, questionChoiceOf, questionOtherOf, questionTimeoutOf, recordingSupported, sandboxTokens, sandboxedCsp, saveChat, settleAudioDuration, speakableText, speechSynthesisSupported, splitForSpeech, startRecording, steerIntent, stopTracks, subagentTree, tokenizeHtml, unchangedSince, usageLine, useAgent, useAgentContext, useAudioRecorder, useChatHistory, useCredentials, useFollowScroll, useLabels, useLocalModel, useOptionalAgentContext, useReadAloud, useSpeechToText, useSpeechVoices, useVirtualFiles, useWebLLMModel, voiceFor, voiceMessageName, voicesOf, webSearchOf, withAttachments, withCspFirst, withPolicyFirst, withoutOwnWords };
3432
- export type { AgentAction, AgentChatClassNames, AgentChatComponents, AgentChatProps, AgentChatSlots, AgentComposerProps, AgentLabels, AgentLabelsOverride, AgentLabelsProviderProps, AgentProviderProps, ApiKeyFormProps, AppRequestPromptProps, ApprovalModeSwitchProps, ApprovalQueue, ApproveOptions, AttachmentBounds, AttachmentOverLimit, AttachmentTexts, AttachmentTransform, AudioLike, AudioSpeakerOptions, BrowserSpeakerOptions, ChatBase, ChatHistoryListProps, ChatHistoryStoreOptions, ChatRecord, ChatSummary, ComposerAttachment, ComposerModelChip, ComposerModelOption, ComposerNotice, ComposerProps, ComposerThinkingChip, ContextMeterProps, ConvertedFile, DownscaleOptions, ElicitationPromptProps, FileChipProps, FileChipsProps, FileKind, FilesPanelProps, GeneratedMediaProps, HtmlPreviewOptions, ImageSize, ImageThumbProps, ImageViewerProps, LearnedSkillsProps, LocalModelEngine, LocalModelLoadContext, LocalModelProgress, McpAppFrameProps, McpAppLineProps, MediaRecorderConstructorLike, MediaRecorderLike, MenuSection, MessageListProps, MicProblem, ModelLoadBarProps, NoticeTexts, PendingQuestion, PlanViewProps, QuestionOutcomeReason, QuestionPromptProps, QuestionQueue, QuestionQueueOptions, ReadAloudOptions, ReadAloudState, RecordedAudio, Recording, RecordingDeps, RecordingRecognizerOptions, RenderImageViewer, RenderSubagent, RenderToolCall, RunGoalOptions, SandboxedDocumentOptions, SandboxedFrameProps, ScrollMeasure, SlashCommand, SourceToken, SourceViewProps, SpeakText, SpeakableOptions, SpeechPlayback, SpeechRecognizerLike, SpeechSynthesisLike, SpeechUtteranceLike, SpeechVoiceLike, StartRecordingOptions, SteerIntent, StepListProps, SubagentRowProps, SubagentTreeProps, SynthesizeSpeech, ToolApprovalPromptProps, ToolCallRowProps, TranscribeAudio, TranscriptBlockProps, UsageBadgeProps, UseAgentOptions, UseAgentReturn, UseAudioRecorderOptions, UseAudioRecorderReturn, UseChatHistoryOptions, UseChatHistoryReturn, UseCredentialsReturn, UseLocalModelOptions, UseLocalModelReturn, UseReadAloudReturn, UseSpeechToTextOptions, UseSpeechToTextReturn, UseVirtualFilesReturn, UseWebLLMModelOptions, UseWebLLMModelReturn, ViewerImage, WebLLMModelFactory, WebSearchResultView, WebSearchView };
3534
+ export { ASK_USER_TOOL_NAME, ATTACHMENT_BOUNDS, AgentChat, AgentComposer, AgentLabelsProvider, AgentProvider, AgentStatus, AgentUiState, ApiKeyForm, AppRequestAnswerOptions, AppRequestPrompt, AppRequestView, AppView, ApprovalModeSwitch, ApprovalView, AttachmentView, BudgetView, ChatAttachment, ChatHistoryList, ChatHistoryStore, ChatMessage, CompactionView, Composer, ContextMeter, DecisionView, ElicitationIssueKind, ElicitationOutcomeReason, ElicitationPrompt, ElicitationView, FILE_PREVIEW_CHARS, FOLLOW_LEAVE_PX, FOLLOW_REJOIN_PX, FRAME_MAX_HEIGHT, FRAME_MIN_HEIGHT, FileChip, FileChips, FilesPanel, GeneratedMedia, HTML_PREVIEW_MAX_CHARS, ImageThumb, ImageViewer, ImageViewerProvider, LearnedSkills, LessonView, McpAppFrame, McpAppHost, McpAppLine, McpAppSandboxOptions, McpAppSandboxReason, McpAppsConnectionLike, McpElicitationResult, MediaView, MemoryCard, MessageList, MicError, ModelLoadBar, ModelLoadState, PendingElicitation, PlanView, QUESTION_TIMEOUT_MS, QuestionPrompt, QuestionView, RECORDING_DEFAULT_MAX_MS, RECORDING_TYPES, RemoteRunView, SandboxedFrame, SourceView, SpeechOutputError, StepList, StepView, SubagentNode, SubagentRow, SubagentTree, SubagentView, ToolApprovalPrompt, ToolCallRow, ToolCallView, TranscriptBlock, TranscriptView, UsageBadge, UserNoteRow, UserNoteView, agentStateReducer, agentStatusOf, askUserOutputKept, askUserWith, attachmentKindOf, attachmentOverLimit, attachmentRefusal, attachmentTransformOf, attachmentsText, audioExtensionOf, audioTypeOf, buildSandboxedDocument, chatTitle, clampFrameHeight, createApprovalQueue, createAudioSpeaker, createBrowserSpeaker, createInitialAgentState, createQuestionQueue, createRecordingRecognizer, createWebLLMEngine, decisionNote, defaultLabels, downscaleImage, escapeAttribute, fileKindOf, fileNameOf, filterCommands, followsAfterResize, followsAfterScroll, formatClock, formatElapsed, imageExtensionOf, imageSizeOf, languageOfText, lessonsOf, linkedFilesOf, mediaFamilyOf, menuKeyTarget, menuSections, mergeChatRecord, mergeLabels, messageOverLimit, micProblemOf, micProblemText, newChatId, noticesOf, parseSlash, pendingApprovalsOf, pickRecordingType, questionChoiceOf, questionOtherOf, questionTimeoutOf, recordingSupported, sandboxTokens, sandboxedCsp, saveChat, scriptOfLanguage, scriptOfText, settleAudioDuration, speakableText, speechSynthesisSupported, splitForSpeech, startRecording, steerIntent, stopTracks, subagentTree, tokenizeHtml, unchangedSince, usageLine, useAgent, useAgentContext, useAudioRecorder, useChatHistory, useCredentials, useFollowScroll, useLabels, useLocalModel, useOptionalAgentContext, useReadAloud, useSpeechToText, useSpeechVoices, useVirtualFiles, useWebLLMModel, voiceFor, voiceMessageName, voicesOf, webSearchOf, withAttachments, withCspFirst, withPolicyFirst, withoutOwnWords };
3535
+ export type { AgentAction, AgentChatClassNames, AgentChatComponents, AgentChatProps, AgentChatSlots, AgentComposerProps, AgentLabels, AgentLabelsOverride, AgentLabelsProviderProps, AgentProviderProps, ApiKeyFormProps, AppRequestPromptProps, ApprovalModeSwitchProps, ApprovalQueue, ApproveOptions, AttachmentBounds, AttachmentOverLimit, AttachmentTexts, AttachmentTransform, AudioLike, AudioSpeakerOptions, BrowserSpeakerOptions, ChatBase, ChatHistoryListProps, ChatHistoryStoreOptions, ChatRecord, ChatSummary, ComposerAttachment, ComposerModelChip, ComposerModelOption, ComposerNotice, ComposerProps, ComposerThinkingChip, ContextMeterProps, ConvertedFile, DownscaleOptions, ElicitationPromptProps, FileChipProps, FileChipsProps, FileKind, FilesPanelProps, GeneratedMediaProps, HtmlPreviewOptions, ImageSize, ImageThumbProps, ImageViewerProps, LearnedSkillsProps, LocalModelEngine, LocalModelLoadContext, LocalModelProgress, McpAppFrameProps, McpAppLineProps, MediaRecorderConstructorLike, MediaRecorderLike, MemoryCardProps, MenuSection, MessageListProps, MicProblem, ModelLoadBarProps, NoticeTexts, PendingQuestion, PlanViewProps, QuestionOutcomeReason, QuestionPromptProps, QuestionQueue, QuestionQueueOptions, ReadAloudOptions, ReadAloudState, RecordedAudio, Recording, RecordingDeps, RecordingRecognizerOptions, RenderImageViewer, RenderSubagent, RenderToolCall, RunGoalOptions, SandboxedDocumentOptions, SandboxedFrameProps, ScrollMeasure, SlashCommand, SourceToken, SourceViewProps, SpeakText, SpeakableOptions, SpeechPlayback, SpeechRecognizerLike, SpeechScript, SpeechSynthesisLike, SpeechUtteranceLike, SpeechVoiceLike, StartRecordingOptions, SteerIntent, StepListProps, SubagentRowProps, SubagentTreeProps, SynthesizeSpeech, ToolApprovalPromptProps, ToolCallRowProps, TranscribeAudio, TranscriptBlockProps, UsageBadgeProps, UseAgentOptions, UseAgentReturn, UseAudioRecorderOptions, UseAudioRecorderReturn, UseChatHistoryOptions, UseChatHistoryReturn, UseCredentialsReturn, UseLocalModelOptions, UseLocalModelReturn, UseReadAloudReturn, UseSpeechToTextOptions, UseSpeechToTextReturn, UseVirtualFilesReturn, UseWebLLMModelOptions, UseWebLLMModelReturn, ViewerImage, WebLLMModelFactory, WebSearchResultView, WebSearchView };
package/dist/index.d.ts CHANGED
@@ -2,8 +2,8 @@ import * as react from 'react';
2
2
  import { DependencyList, ReactNode, RefObject, ComponentType, CSSProperties } from 'react';
3
3
  import { AskUserRequest, AskUserContext, AskUserAnswer, AskUserConfig, AskUserHandler, AgentEvent, RunFile, RunResult, Agent, ToolApprovalMode, AppToolCallRequest, AppSamplingRequest, AppSamplingView, AppSamplingResult, CompactResult, IUsage, AgentEventHandler, BrowserAgentConfig, VirtualFileInfo, VirtualFileSystem, CredentialStore, createWebLLMModel, WebLLMModelOptions, ModelTier, TierReason, EscalationReason, DecisionFallbackReason, Skill, IPlan, ToolApprovalRequest, ToolApprovalContext, ToolApprovalDecision } from '@dudko.dev/agent-web';
4
4
  export { Agent, AgentEvent, AgentEventHandler, AgentLoggerSink, AgentTool, AgentToolSet, AppToolCallRequest, AskUserAnswer, AskUserConfig, AskUserContext, AskUserHandler, AskUserOption, AskUserRequest, AttachmentsNotSupportedError, BrowserAgentConfig, CompactResult, CompactionConfig, CredentialStore, FileToolsOptions, IPlan, IPlanStep, IStepResult, IToolCall, IUsage, ImagesNotSupportedError, IndexedDBStore, LearningConfig, LogLevel, McpAppCsp, McpAppResource, McpAppToolResult, MemoryCredentialStore, MemorySkillStore, MemoryStore, ModelInput, ProviderModelSpec, ProviderType, RunControl, RunFile, RunOptions, RunResult, SessionBusyError, SessionHolder, SessionLockMode, SessionRunState, SessionWatch, Skill, SkillStore, StorageChange, StorageChangeKind, StorageChangeOp, SubagentInfo, SubagentToolOptions, SubagentWorkerConfig, ThinkingLevel, ThinkingSetting, TokenLimits, ToolApprovalConfig, ToolApprovalContext, ToolApprovalMode, ToolApprovalRequest, VaultCredentialStore, VfsSkillStore, VirtualFile, VirtualFileInfo, VirtualFileSystem, WatchSessionOptions, createAgent, createFileTools, createRunControl, createSubagentTool, createWebLLMModel, defineSkill, defineTool, isWebGPUAvailable, loadSkillFromUrl, markReadOnly, onStorageChange, parseSkillMarkdown, postStorageChange, preloadWebLLMModel, serveSubagentWorker, supportsImages, supportsPdf, unloadWebLLMModel, watchSession } from '@dudko.dev/agent-web';
5
- import { A as AgentUiState, C as ChatAttachment, a as ApprovalView, b as ChatMessage, c as AgentStatus, E as ElicitationIssueKind, d as ElicitationOutcomeReason, M as McpAppSandboxReason, R as RemoteRunView, L as LessonView, S as SubagentView, e as SubagentNode, P as PendingElicitation, f as McpElicitationResult, g as ElicitationView, W as WrittenFileView, T as ToolCallView, h as StepView, U as UserNoteView, D as DecisionView, i as MediaView, j as AppView, Q as QuestionView, k as McpAppsConnectionLike, l as McpAppSandboxOptions, m as AppRequestView, n as TranscriptView, B as BudgetView, o as CompactionView, p as ModelLoadState, q as McpAppHost, r as AppRequestAnswerOptions } from './elicitation-DdzjMut9.js';
6
- export { s as APP_DEFAULT_HEIGHT, t as APP_MAX_HEIGHT, u as APP_MIN_HEIGHT, v as AppDownload, w as AppDownloadView, x as AppFileSaverEnv, y as AppLink, z as AppReadyDownload, F as AppResourceReader, G as ElicitationControl, H as ElicitationDraft, I as ElicitationDraftValue, J as ElicitationField, K as ElicitationFormOutcome, N as ElicitationIssue, O as ElicitationLink, V as ElicitationOption, X as FetchView, Y as MCP_APP_DISPLAY_MODES, Z as MCP_APP_MAX_ARGS_CHARS, _ as MCP_APP_MAX_DOWNLOAD_BYTES, $ as MCP_APP_MAX_FILE_NAME_CHARS, a0 as MCP_APP_MAX_IN_FLIGHT, a1 as MCP_APP_MAX_MESSAGE_CHARS, a2 as MCP_APP_MAX_URL_CHARS, a3 as MCP_APP_NOTIFICATIONS, a4 as MCP_APP_OPTIONAL_REQUESTS, a5 as MCP_APP_PROTOCOL_VERSION, a6 as MCP_APP_REFUSED, a7 as MCP_APP_REFUSED_DOWNLOAD_EXTENSIONS, a8 as MCP_APP_REFUSED_DOWNLOAD_TYPES, a9 as MCP_APP_RELAY, aa as MCP_APP_REQUESTS, ab as MCP_APP_SANDBOX_FRAME_TOKENS, ac as MCP_APP_SANDBOX_GRACE_MS, ad as MCP_APP_SANDBOX_SERVER, ae as MCP_APP_SANDBOX_TIMEOUT_MS, af as McpAppBridge, ag as McpAppBridgeHandlers, ah as McpAppBridgeOptions, ai as McpAppDisplayMode, aj as McpAppRpcError, ak as McpAppRpcMessage, al as McpAppSandboxInput, am as McpAppSandboxLink, an as McpAppSandboxLinkOptions, ao as McpAppSandboxTarget, ap as McpElicitationFieldSchema, aq as McpElicitationRequest, ar as McpElicitationSchema, as as QueuedMessageView, at as ReplanState, au as SkillConsentView, av as StepEscalationView, aw as UseMcpAppHostOptions, ax as appDisplayModeAllowed, ay as appDownloadOf, az as appDownloadRefusal, aA as appFileExtensionOf, aB as appFileNameOf, aC as appGestureOf, aD as appLinkOf, aE as appMessageTextOf, aF as appMimeTypeOf, aG as appSamplingErrorOf, aH as buildMcpAppDocument, aI as buildMcpAppSandboxShell, aJ as clampAppHeight, aK as elicitationFields, aL as elicitationFormAnswer, aM as elicitationInitialDraft, aN as elicitationLink, aO as formatCountdown, aP as grantedAppCsp, aQ as mcpAppCsp, aR as mcpAppHostCapabilities, aS as mcpAppSandboxProxyUrl, aT as mcpAppSandboxShellCsp, aU as mcpAppSandboxTarget, aV as resolveAppDownload, aW as saveAppFile, aX as useMcpAppHost } from './elicitation-DdzjMut9.js';
5
+ import { A as AgentUiState, C as ChatAttachment, a as ApprovalView, b as ChatMessage, c as AgentStatus, E as ElicitationIssueKind, d as ElicitationOutcomeReason, M as McpAppSandboxReason, R as RemoteRunView, L as LessonView, S as SubagentView, e as SubagentNode, P as PendingElicitation, f as McpElicitationResult, g as ElicitationView, W as WrittenFileView, T as ToolCallView, h as StepView, U as UserNoteView, D as DecisionView, i as MediaView, j as AppView, Q as QuestionView, k as McpAppsConnectionLike, l as McpAppSandboxOptions, m as AppRequestView, n as TranscriptView, B as BudgetView, o as CompactionView, p as ModelLoadState, q as McpAppHost, r as AppRequestAnswerOptions } from './elicitation-IpjGRDD-.js';
6
+ export { s as APP_DEFAULT_HEIGHT, t as APP_MAX_HEIGHT, u as APP_MIN_HEIGHT, v as AppDownload, w as AppDownloadView, x as AppFileSaverEnv, y as AppLink, z as AppReadyDownload, F as AppResourceReader, G as ElicitationControl, H as ElicitationDraft, I as ElicitationDraftValue, J as ElicitationField, K as ElicitationFormOutcome, N as ElicitationIssue, O as ElicitationLink, V as ElicitationOption, X as FetchView, Y as MCP_APP_DISPLAY_MODES, Z as MCP_APP_MAX_ARGS_CHARS, _ as MCP_APP_MAX_DOWNLOAD_BYTES, $ as MCP_APP_MAX_FILE_NAME_CHARS, a0 as MCP_APP_MAX_IN_FLIGHT, a1 as MCP_APP_MAX_MESSAGE_CHARS, a2 as MCP_APP_MAX_URL_CHARS, a3 as MCP_APP_NOTIFICATIONS, a4 as MCP_APP_OPTIONAL_REQUESTS, a5 as MCP_APP_PROTOCOL_VERSION, a6 as MCP_APP_REFUSED, a7 as MCP_APP_REFUSED_DOWNLOAD_EXTENSIONS, a8 as MCP_APP_REFUSED_DOWNLOAD_TYPES, a9 as MCP_APP_RELAY, aa as MCP_APP_REQUESTS, ab as MCP_APP_SANDBOX_FRAME_TOKENS, ac as MCP_APP_SANDBOX_GRACE_MS, ad as MCP_APP_SANDBOX_SERVER, ae as MCP_APP_SANDBOX_TIMEOUT_MS, af as McpAppBridge, ag as McpAppBridgeHandlers, ah as McpAppBridgeOptions, ai as McpAppDisplayMode, aj as McpAppRpcError, ak as McpAppRpcMessage, al as McpAppSandboxInput, am as McpAppSandboxLink, an as McpAppSandboxLinkOptions, ao as McpAppSandboxTarget, ap as McpElicitationFieldSchema, aq as McpElicitationRequest, ar as McpElicitationSchema, as as QueuedMessageView, at as ReplanState, au as SkillConsentView, av as StepEscalationView, aw as UseMcpAppHostOptions, ax as appDisplayModeAllowed, ay as appDownloadOf, az as appDownloadRefusal, aA as appFileExtensionOf, aB as appFileNameOf, aC as appGestureOf, aD as appLinkOf, aE as appMessageTextOf, aF as appMimeTypeOf, aG as appSamplingErrorOf, aH as buildMcpAppDocument, aI as buildMcpAppSandboxShell, aJ as clampAppHeight, aK as elicitationFields, aL as elicitationFormAnswer, aM as elicitationInitialDraft, aN as elicitationLink, aO as formatCountdown, aP as grantedAppCsp, aQ as mcpAppCsp, aR as mcpAppHostCapabilities, aS as mcpAppSandboxProxyUrl, aT as mcpAppSandboxShellCsp, aU as mcpAppSandboxTarget, aV as resolveAppDownload, aW as saveAppFile, aX as useMcpAppHost } from './elicitation-IpjGRDD-.js';
7
7
  export { M as MCP_APP_POLICY_TOKEN_MAX_CHARS, a as MCP_APP_SANDBOX_PROXY_READY, b as MCP_APP_SANDBOX_RESOURCE_READY, i as isMcpAppSandboxMessage, m as mcpAppPolicyToken } from './mcp-app-policy-DIUmGPJP.js';
8
8
 
9
9
  /**
@@ -186,8 +186,10 @@ interface UseAgentReturn extends AgentUiState {
186
186
  /**
187
187
  * Say something to the conversation's run in another tab (`remote`): it reaches that run's
188
188
  * model at its next boundary, marked as from another tab. `false` when no such run is followed
189
- * or the text is empty. A message that tab refuses (or never answers) comes back in
190
- * `undelivered`.
189
+ * or the text is empty. Until that tab answers, the text is in `queued` marked
190
+ * `sentTo: 'another-tab'` (shown "waiting for the other tab to pick it up") - with no time
191
+ * limit: a tab the browser froze answers when it wakes. Taken, that run's own entry takes its
192
+ * place; refused, or that run ended without it, it comes back in `undelivered`.
191
193
  */
192
194
  sendRemote: (text: string) => boolean;
193
195
  /**
@@ -719,6 +721,23 @@ declare const speakableText: (markdown: string, options?: SpeakableOptions) => s
719
721
  * seconds; a provider takes a few thousand characters per call).
720
722
  */
721
723
  declare const splitForSpeech: (text: string, max?: number) => string[];
724
+ /** A writing system, as far as a voice needs to know: the letters it can read. */
725
+ type SpeechScript = 'latin' | 'cyrillic' | 'greek' | 'arabic' | 'hebrew' | 'han' | 'kana' | 'hangul' | 'devanagari' | 'thai' | 'georgian' | 'armenian';
726
+ /** The script a language (BCP-47) is written in: `sr-Latn` is Latin, `zh-*` Han, `ja` kana. */
727
+ declare const scriptOfLanguage: (lang: string) => SpeechScript;
728
+ /**
729
+ * The script most of a text's letters are written in (digits, signs and spaces do not count);
730
+ * a text with any kana is Japanese (it is mostly Han letters too). Undefined: no letters.
731
+ */
732
+ declare const scriptOfText: (text: string) => SpeechScript | undefined;
733
+ /**
734
+ * The language to read a text in: the first of `preferred` (the UI's language, then the
735
+ * browser's, `navigator.languages`) written in the text's script - so a Russian answer in an
736
+ * English interface is read in Russian, not spelled by an English voice -, else the script's
737
+ * usual language. A text without letters: the first preferred. Which of the languages of ONE
738
+ * script (English or French) cannot be told from the letters: the person's order decides.
739
+ */
740
+ declare const languageOfText: (text: string, preferred?: readonly (string | undefined)[]) => string | undefined;
722
741
  /** The slice of a `SpeechSynthesisVoice` used here. */
723
742
  interface SpeechVoiceLike {
724
743
  voiceURI: string;
@@ -728,7 +747,8 @@ interface SpeechVoiceLike {
728
747
  default?: boolean;
729
748
  }
730
749
  /**
731
- * The voice to read a language with: the person's (by `voiceURI`) while the browser has it; else
750
+ * The voice to read a language with: the person's (by `voiceURI`) while the browser has it and it
751
+ * reads that language's script; else
732
752
  * one of exactly that language (`pt-BR`), then of its base (`pt`) - a voice on the device before a
733
753
  * network one, the browser's default of the language first. Undefined: none for the language (the
734
754
  * browser then reads with its own default).
@@ -1320,6 +1340,16 @@ interface AgentLabels {
1320
1340
  notebookRevision: (n: number) => string;
1321
1341
  /** Before the sources a lesson came from. */
1322
1342
  notebookFrom: string;
1343
+ /** Before a fact that was just saved. */
1344
+ memorySaved: string;
1345
+ /** Before a fact that was just changed. */
1346
+ memoryUpdated: string;
1347
+ /** Before a fact that was just forgotten. */
1348
+ memoryForgotten: string;
1349
+ /** The card's button that takes it back. */
1350
+ memoryUndo: string;
1351
+ /** In place of the button once it was taken back. */
1352
+ memoryUndone: string;
1323
1353
  placeholder: string;
1324
1354
  listening: string;
1325
1355
  message: string;
@@ -1447,6 +1477,11 @@ interface AgentLabels {
1447
1477
  * run (`sessionBusy`) - in another tab, or in this one - to finish. Shown only while that lasts.
1448
1478
  */
1449
1479
  queuedForSession: (heldBy: 'another-tab' | 'this-tab') => string;
1480
+ /**
1481
+ * What this tab said to the conversation's run in another tab (`sendRemote`), while that tab has
1482
+ * not answered (it may be in the background, frozen by the browser): it is not refused.
1483
+ */
1484
+ queuedForOtherTab: string;
1450
1485
  /** Where a note landed: between tool calls / after a step / before the answer. */
1451
1486
  noteAt: Record<'round' | 'step' | 'final', string>;
1452
1487
  /** Messages the run ended without delivering, offered for sending. */
@@ -1931,6 +1966,28 @@ type AgentAction =
1931
1966
  texts: string[];
1932
1967
  keepQueued?: boolean;
1933
1968
  }
1969
+ /**
1970
+ * `sendRemote`: the text went to the conversation's run in another tab, which has not answered
1971
+ * yet - shown in `queued`, marked `sentTo: 'another-tab'`, until `remote-answer` with this `id`
1972
+ * (or that run's own `message.queued` for it, which takes its place).
1973
+ */
1974
+ | {
1975
+ type: 'remote-send';
1976
+ id: string;
1977
+ text: string;
1978
+ }
1979
+ /**
1980
+ * That tab's answer to `remote-send` `id`: `taken` (its run has it), `refused` (refused, or its
1981
+ * run ended without taking it - the text comes back in `undelivered`, to send again or drop), or
1982
+ * `unknown` (the watch that sent it was closed - another conversation is in view: nothing is
1983
+ * offered, as that tab may still take it). Either way the waiting entry goes.
1984
+ */
1985
+ | {
1986
+ type: 'remote-answer';
1987
+ id: string;
1988
+ text: string;
1989
+ answer: 'taken' | 'refused' | 'unknown';
1990
+ }
1934
1991
  /**
1935
1992
  * The user sent a goal and this tab's run is getting going: its turn is shown at once (a
1936
1993
  * user message and a pending answer), until the run's `run.start` takes its place.
@@ -2494,7 +2551,12 @@ declare const StepList: ({ steps, subagents, approvals, notes, showNotes, onStop
2494
2551
  interface ReadAloudOptions {
2495
2552
  /** The engine: `createBrowserSpeaker()` (the device's voices) or `createAudioSpeaker(...)`. Keep it stable. */
2496
2553
  speak: SpeakText;
2497
- /** The answers' language (BCP-47): the browser's voice is picked for it. */
2554
+ /**
2555
+ * The interface's language (BCP-47), the first choice for a text in its script: each answer is
2556
+ * read in ITS language - the script of its letters decides (`languageOfText`: this, then the
2557
+ * browser's languages, then the script's usual one), so a Russian answer in an English
2558
+ * interface is read by a Russian voice.
2559
+ */
2498
2560
  lang?: string;
2499
2561
  /** What is read of an answer. Default: its Markdown as words (`speakableText`, code left out). */
2500
2562
  textOf?: (message: ChatMessage) => string;
@@ -2571,6 +2633,15 @@ interface MessageListProps {
2571
2633
  readAloud?: ReadAloudOptions;
2572
2634
  /** Tool calls inside the activity. */
2573
2635
  renderToolCall?: RenderToolCall;
2636
+ /**
2637
+ * A tool call as a card in the answer itself - outside the folded activity, above the text -
2638
+ * for the calls the user should see without opening it (a fact remembered, an order placed):
2639
+ * return a node for those (`<MemoryCard>` is one), `null` / `undefined` for the rest. Called for
2640
+ * every tool call of an assistant turn, in order; nothing is drawn without it.
2641
+ */
2642
+ renderToolCard?: (call: ToolCallView, message: ChatMessage) => ReactNode;
2643
+ /** Draw the tool cards (default true; needs `renderToolCard`). */
2644
+ showToolCards?: boolean;
2574
2645
  /**
2575
2646
  * The MCP Apps an answer's tool calls came with (`message.apps`), drawn between its activity
2576
2647
  * and its text. `<AgentChat mcpApps>` passes `<McpAppFrame>`; without this prop none is drawn.
@@ -2613,7 +2684,7 @@ declare const AttachmentView: ({ attachment: a, files, labels, }: {
2613
2684
  * subagents, consent decisions — and the tokens it spent by kind. Every part
2614
2685
  * can be hidden, relabelled or rendered by the host.
2615
2686
  */
2616
- declare const MessageList: ({ messages, empty, showActivity, showToolCalls, showUsage, showThoughts, showNotes, showLearned, showTiers, showReplanFailed, showDecisions, showSearchResults, showSubagents, showMedia, showFileChips, files, htmlPreview, onShowFiles, renderFile, renderFileContent, renderMedia, renderSubagent, onStopSubagent, activityOpen, liveExtra, renderContent, renderMessage, renderAttachment, renderToolCall, renderApp, showApps, imageViewer, renderImageViewer, readAloud, labels, className, }: MessageListProps) => react.JSX.Element | null;
2687
+ declare const MessageList: ({ messages, empty, showActivity, showToolCalls, showUsage, showThoughts, showNotes, showLearned, showTiers, showReplanFailed, showDecisions, showSearchResults, showSubagents, showMedia, showFileChips, files, htmlPreview, onShowFiles, renderFile, renderFileContent, renderMedia, renderSubagent, onStopSubagent, activityOpen, liveExtra, renderContent, renderMessage, renderAttachment, renderToolCall, renderToolCard, showToolCards, renderApp, showApps, imageViewer, renderImageViewer, readAloud, labels, className, }: MessageListProps) => react.JSX.Element | null;
2617
2688
 
2618
2689
  interface QuestionPromptProps {
2619
2690
  /**
@@ -2868,6 +2939,10 @@ interface AgentChatProps {
2868
2939
  */
2869
2940
  readAloud?: MessageListProps['readAloud'];
2870
2941
  renderToolCall?: RenderToolCall;
2942
+ /** A tool call as a card in the answer, outside the activity (`<MemoryCard>`; see `MessageList`). */
2943
+ renderToolCard?: MessageListProps['renderToolCard'];
2944
+ /** Draw the tool cards (default true; needs `renderToolCard`). */
2945
+ showToolCards?: boolean;
2871
2946
  /** A node of the subagent tree. */
2872
2947
  renderSubagent?: RenderSubagent;
2873
2948
  /** A generated image / audio file. */
@@ -2999,6 +3074,34 @@ interface LearnedSkillsProps {
2999
3074
  */
3000
3075
  declare const LearnedSkills: ({ controller, lessons, onForget, showSources, empty, hideTitle, labels, className, }: LearnedSkillsProps) => react.JSX.Element;
3001
3076
 
3077
+ interface MemoryCardProps {
3078
+ /** What happened: a fact saved, a fact changed, a fact forgotten. */
3079
+ kind: 'saved' | 'updated' | 'forgotten';
3080
+ /** The fact: as it was saved or changed to, or as it was when it was forgotten. Drawn as text. */
3081
+ text: string;
3082
+ /**
3083
+ * Take it back - the host does the work (delete the fact saved, put back the one forgotten or
3084
+ * changed). Absent: no button.
3085
+ */
3086
+ onUndo?: () => void | Promise<unknown>;
3087
+ /**
3088
+ * It has been taken back: the host knows (its store no longer has the fact saved, or has the one
3089
+ * forgotten again) - "Undone" in place of the button, even after a reload.
3090
+ */
3091
+ undone?: boolean;
3092
+ /** Why the last Undo did not go through, in the host's words (shown under the text). */
3093
+ problem?: string;
3094
+ labels?: AgentLabelsOverride;
3095
+ className?: string;
3096
+ }
3097
+ /**
3098
+ * One fact the host's app remembered, changed or forgot about the user, as a card in the answer -
3099
+ * its text and an Undo. The package keeps no memory of its own: the host decides which tool calls
3100
+ * are memory (`<AgentChat renderToolCard>`), what Undo does and when it is undone. The text is a
3101
+ * text node, never markup.
3102
+ */
3103
+ declare const MemoryCard: ({ kind, text, onUndo, undone, problem, labels, className, }: MemoryCardProps) => react.JSX.Element;
3104
+
3002
3105
  interface ComposerProps {
3003
3106
  /** Called with the trimmed text when the user submits. */
3004
3107
  onSubmit: (text: string) => void;
@@ -3428,5 +3531,5 @@ interface AppRequestPromptProps {
3428
3531
  */
3429
3532
  declare const AppRequestPrompt: ({ requests, onAnswer, renderRequest, labels, className, }: AppRequestPromptProps) => react.JSX.Element | null;
3430
3533
 
3431
- export { ASK_USER_TOOL_NAME, ATTACHMENT_BOUNDS, AgentChat, AgentComposer, AgentLabelsProvider, AgentProvider, AgentStatus, AgentUiState, ApiKeyForm, AppRequestAnswerOptions, AppRequestPrompt, AppRequestView, AppView, ApprovalModeSwitch, ApprovalView, AttachmentView, BudgetView, ChatAttachment, ChatHistoryList, ChatHistoryStore, ChatMessage, CompactionView, Composer, ContextMeter, DecisionView, ElicitationIssueKind, ElicitationOutcomeReason, ElicitationPrompt, ElicitationView, FILE_PREVIEW_CHARS, FOLLOW_LEAVE_PX, FOLLOW_REJOIN_PX, FRAME_MAX_HEIGHT, FRAME_MIN_HEIGHT, FileChip, FileChips, FilesPanel, GeneratedMedia, HTML_PREVIEW_MAX_CHARS, ImageThumb, ImageViewer, ImageViewerProvider, LearnedSkills, LessonView, McpAppFrame, McpAppHost, McpAppLine, McpAppSandboxOptions, McpAppSandboxReason, McpAppsConnectionLike, McpElicitationResult, MediaView, MessageList, MicError, ModelLoadBar, ModelLoadState, PendingElicitation, PlanView, QUESTION_TIMEOUT_MS, QuestionPrompt, QuestionView, RECORDING_DEFAULT_MAX_MS, RECORDING_TYPES, RemoteRunView, SandboxedFrame, SourceView, SpeechOutputError, StepList, StepView, SubagentNode, SubagentRow, SubagentTree, SubagentView, ToolApprovalPrompt, ToolCallRow, ToolCallView, TranscriptBlock, TranscriptView, UsageBadge, UserNoteRow, UserNoteView, agentStateReducer, agentStatusOf, askUserOutputKept, askUserWith, attachmentKindOf, attachmentOverLimit, attachmentRefusal, attachmentTransformOf, attachmentsText, audioExtensionOf, audioTypeOf, buildSandboxedDocument, chatTitle, clampFrameHeight, createApprovalQueue, createAudioSpeaker, createBrowserSpeaker, createInitialAgentState, createQuestionQueue, createRecordingRecognizer, createWebLLMEngine, decisionNote, defaultLabels, downscaleImage, escapeAttribute, fileKindOf, fileNameOf, filterCommands, followsAfterResize, followsAfterScroll, formatClock, formatElapsed, imageExtensionOf, imageSizeOf, lessonsOf, linkedFilesOf, mediaFamilyOf, menuKeyTarget, menuSections, mergeChatRecord, mergeLabels, messageOverLimit, micProblemOf, micProblemText, newChatId, noticesOf, parseSlash, pendingApprovalsOf, pickRecordingType, questionChoiceOf, questionOtherOf, questionTimeoutOf, recordingSupported, sandboxTokens, sandboxedCsp, saveChat, settleAudioDuration, speakableText, speechSynthesisSupported, splitForSpeech, startRecording, steerIntent, stopTracks, subagentTree, tokenizeHtml, unchangedSince, usageLine, useAgent, useAgentContext, useAudioRecorder, useChatHistory, useCredentials, useFollowScroll, useLabels, useLocalModel, useOptionalAgentContext, useReadAloud, useSpeechToText, useSpeechVoices, useVirtualFiles, useWebLLMModel, voiceFor, voiceMessageName, voicesOf, webSearchOf, withAttachments, withCspFirst, withPolicyFirst, withoutOwnWords };
3432
- export type { AgentAction, AgentChatClassNames, AgentChatComponents, AgentChatProps, AgentChatSlots, AgentComposerProps, AgentLabels, AgentLabelsOverride, AgentLabelsProviderProps, AgentProviderProps, ApiKeyFormProps, AppRequestPromptProps, ApprovalModeSwitchProps, ApprovalQueue, ApproveOptions, AttachmentBounds, AttachmentOverLimit, AttachmentTexts, AttachmentTransform, AudioLike, AudioSpeakerOptions, BrowserSpeakerOptions, ChatBase, ChatHistoryListProps, ChatHistoryStoreOptions, ChatRecord, ChatSummary, ComposerAttachment, ComposerModelChip, ComposerModelOption, ComposerNotice, ComposerProps, ComposerThinkingChip, ContextMeterProps, ConvertedFile, DownscaleOptions, ElicitationPromptProps, FileChipProps, FileChipsProps, FileKind, FilesPanelProps, GeneratedMediaProps, HtmlPreviewOptions, ImageSize, ImageThumbProps, ImageViewerProps, LearnedSkillsProps, LocalModelEngine, LocalModelLoadContext, LocalModelProgress, McpAppFrameProps, McpAppLineProps, MediaRecorderConstructorLike, MediaRecorderLike, MenuSection, MessageListProps, MicProblem, ModelLoadBarProps, NoticeTexts, PendingQuestion, PlanViewProps, QuestionOutcomeReason, QuestionPromptProps, QuestionQueue, QuestionQueueOptions, ReadAloudOptions, ReadAloudState, RecordedAudio, Recording, RecordingDeps, RecordingRecognizerOptions, RenderImageViewer, RenderSubagent, RenderToolCall, RunGoalOptions, SandboxedDocumentOptions, SandboxedFrameProps, ScrollMeasure, SlashCommand, SourceToken, SourceViewProps, SpeakText, SpeakableOptions, SpeechPlayback, SpeechRecognizerLike, SpeechSynthesisLike, SpeechUtteranceLike, SpeechVoiceLike, StartRecordingOptions, SteerIntent, StepListProps, SubagentRowProps, SubagentTreeProps, SynthesizeSpeech, ToolApprovalPromptProps, ToolCallRowProps, TranscribeAudio, TranscriptBlockProps, UsageBadgeProps, UseAgentOptions, UseAgentReturn, UseAudioRecorderOptions, UseAudioRecorderReturn, UseChatHistoryOptions, UseChatHistoryReturn, UseCredentialsReturn, UseLocalModelOptions, UseLocalModelReturn, UseReadAloudReturn, UseSpeechToTextOptions, UseSpeechToTextReturn, UseVirtualFilesReturn, UseWebLLMModelOptions, UseWebLLMModelReturn, ViewerImage, WebLLMModelFactory, WebSearchResultView, WebSearchView };
3534
+ export { ASK_USER_TOOL_NAME, ATTACHMENT_BOUNDS, AgentChat, AgentComposer, AgentLabelsProvider, AgentProvider, AgentStatus, AgentUiState, ApiKeyForm, AppRequestAnswerOptions, AppRequestPrompt, AppRequestView, AppView, ApprovalModeSwitch, ApprovalView, AttachmentView, BudgetView, ChatAttachment, ChatHistoryList, ChatHistoryStore, ChatMessage, CompactionView, Composer, ContextMeter, DecisionView, ElicitationIssueKind, ElicitationOutcomeReason, ElicitationPrompt, ElicitationView, FILE_PREVIEW_CHARS, FOLLOW_LEAVE_PX, FOLLOW_REJOIN_PX, FRAME_MAX_HEIGHT, FRAME_MIN_HEIGHT, FileChip, FileChips, FilesPanel, GeneratedMedia, HTML_PREVIEW_MAX_CHARS, ImageThumb, ImageViewer, ImageViewerProvider, LearnedSkills, LessonView, McpAppFrame, McpAppHost, McpAppLine, McpAppSandboxOptions, McpAppSandboxReason, McpAppsConnectionLike, McpElicitationResult, MediaView, MemoryCard, MessageList, MicError, ModelLoadBar, ModelLoadState, PendingElicitation, PlanView, QUESTION_TIMEOUT_MS, QuestionPrompt, QuestionView, RECORDING_DEFAULT_MAX_MS, RECORDING_TYPES, RemoteRunView, SandboxedFrame, SourceView, SpeechOutputError, StepList, StepView, SubagentNode, SubagentRow, SubagentTree, SubagentView, ToolApprovalPrompt, ToolCallRow, ToolCallView, TranscriptBlock, TranscriptView, UsageBadge, UserNoteRow, UserNoteView, agentStateReducer, agentStatusOf, askUserOutputKept, askUserWith, attachmentKindOf, attachmentOverLimit, attachmentRefusal, attachmentTransformOf, attachmentsText, audioExtensionOf, audioTypeOf, buildSandboxedDocument, chatTitle, clampFrameHeight, createApprovalQueue, createAudioSpeaker, createBrowserSpeaker, createInitialAgentState, createQuestionQueue, createRecordingRecognizer, createWebLLMEngine, decisionNote, defaultLabels, downscaleImage, escapeAttribute, fileKindOf, fileNameOf, filterCommands, followsAfterResize, followsAfterScroll, formatClock, formatElapsed, imageExtensionOf, imageSizeOf, languageOfText, lessonsOf, linkedFilesOf, mediaFamilyOf, menuKeyTarget, menuSections, mergeChatRecord, mergeLabels, messageOverLimit, micProblemOf, micProblemText, newChatId, noticesOf, parseSlash, pendingApprovalsOf, pickRecordingType, questionChoiceOf, questionOtherOf, questionTimeoutOf, recordingSupported, sandboxTokens, sandboxedCsp, saveChat, scriptOfLanguage, scriptOfText, settleAudioDuration, speakableText, speechSynthesisSupported, splitForSpeech, startRecording, steerIntent, stopTracks, subagentTree, tokenizeHtml, unchangedSince, usageLine, useAgent, useAgentContext, useAudioRecorder, useChatHistory, useCredentials, useFollowScroll, useLabels, useLocalModel, useOptionalAgentContext, useReadAloud, useSpeechToText, useSpeechVoices, useVirtualFiles, useWebLLMModel, voiceFor, voiceMessageName, voicesOf, webSearchOf, withAttachments, withCspFirst, withPolicyFirst, withoutOwnWords };
3535
+ export type { AgentAction, AgentChatClassNames, AgentChatComponents, AgentChatProps, AgentChatSlots, AgentComposerProps, AgentLabels, AgentLabelsOverride, AgentLabelsProviderProps, AgentProviderProps, ApiKeyFormProps, AppRequestPromptProps, ApprovalModeSwitchProps, ApprovalQueue, ApproveOptions, AttachmentBounds, AttachmentOverLimit, AttachmentTexts, AttachmentTransform, AudioLike, AudioSpeakerOptions, BrowserSpeakerOptions, ChatBase, ChatHistoryListProps, ChatHistoryStoreOptions, ChatRecord, ChatSummary, ComposerAttachment, ComposerModelChip, ComposerModelOption, ComposerNotice, ComposerProps, ComposerThinkingChip, ContextMeterProps, ConvertedFile, DownscaleOptions, ElicitationPromptProps, FileChipProps, FileChipsProps, FileKind, FilesPanelProps, GeneratedMediaProps, HtmlPreviewOptions, ImageSize, ImageThumbProps, ImageViewerProps, LearnedSkillsProps, LocalModelEngine, LocalModelLoadContext, LocalModelProgress, McpAppFrameProps, McpAppLineProps, MediaRecorderConstructorLike, MediaRecorderLike, MemoryCardProps, MenuSection, MessageListProps, MicProblem, ModelLoadBarProps, NoticeTexts, PendingQuestion, PlanViewProps, QuestionOutcomeReason, QuestionPromptProps, QuestionQueue, QuestionQueueOptions, ReadAloudOptions, ReadAloudState, RecordedAudio, Recording, RecordingDeps, RecordingRecognizerOptions, RenderImageViewer, RenderSubagent, RenderToolCall, RunGoalOptions, SandboxedDocumentOptions, SandboxedFrameProps, ScrollMeasure, SlashCommand, SourceToken, SourceViewProps, SpeakText, SpeakableOptions, SpeechPlayback, SpeechRecognizerLike, SpeechScript, SpeechSynthesisLike, SpeechUtteranceLike, SpeechVoiceLike, StartRecordingOptions, SteerIntent, StepListProps, SubagentRowProps, SubagentTreeProps, SynthesizeSpeech, ToolApprovalPromptProps, ToolCallRowProps, TranscribeAudio, TranscriptBlockProps, UsageBadgeProps, UseAgentOptions, UseAgentReturn, UseAudioRecorderOptions, UseAudioRecorderReturn, UseChatHistoryOptions, UseChatHistoryReturn, UseCredentialsReturn, UseLocalModelOptions, UseLocalModelReturn, UseReadAloudReturn, UseSpeechToTextOptions, UseSpeechToTextReturn, UseVirtualFilesReturn, UseWebLLMModelOptions, UseWebLLMModelReturn, ViewerImage, WebLLMModelFactory, WebSearchResultView, WebSearchView };