@dudko.dev/agent-web-react 0.0.37 → 0.0.38
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 -3
- package/dist/{elicitation-NV1_UPkJ.d.cts → elicitation-BgSf-xzh.d.cts} +10 -0
- package/dist/{elicitation-NV1_UPkJ.d.ts → elicitation-BgSf-xzh.d.ts} +10 -0
- package/dist/index.cjs +215 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +114 -6
- package/dist/index.d.ts +114 -6
- package/dist/index.js +210 -24
- 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 +30 -0
- package/package.json +2 -2
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-
|
|
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-
|
|
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-BgSf-xzh.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-BgSf-xzh.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
|
/**
|
|
@@ -770,9 +770,69 @@ interface ComposerAttachment {
|
|
|
770
770
|
declare const attachmentKindOf: (mediaType: string, name: string) => ComposerAttachment["kind"];
|
|
771
771
|
/**
|
|
772
772
|
* The goal the agent receives: the typed text followed by each attached TEXT
|
|
773
|
-
* file in a fenced block. Binary attachments travel as file parts instead
|
|
773
|
+
* file in a fenced block. Binary attachments travel as file parts instead; the
|
|
774
|
+
* ones saved in the workspace (`path`) are named with it, so a tool can take
|
|
775
|
+
* the file itself (`generate_image`'s reference pictures).
|
|
774
776
|
*/
|
|
775
777
|
declare const withAttachments: (text: string, files: ComposerAttachment[]) => string;
|
|
778
|
+
/**
|
|
779
|
+
* The size bounds of an attachment (`<AgentComposer attachments={…}>`; these are the defaults).
|
|
780
|
+
* - `maxBytes`: what is SENT. A file that goes as it is, by its size; one the composer transforms
|
|
781
|
+
* first, by the result - an image it downscales (a 13 MB photo goes as a few hundred KB), a
|
|
782
|
+
* file the host's `convertFile` turns into text (a 30 MB PDF goes as its Markdown).
|
|
783
|
+
* - `maxSourceBytes`: the ORIGINAL of one it transforms, judged before it is read or decoded.
|
|
784
|
+
* - `imageMaxSourcePixels`: the original of an image it downscales, by the pixels its header
|
|
785
|
+
* declares (`imageSizeOf`) - a decoded picture takes ~4 bytes a pixel. A format whose header is
|
|
786
|
+
* not read is held to the bytes only.
|
|
787
|
+
* - `maxImages` / `maxTotalBytes`: ONE message - its pictures, and what all its attachments carry
|
|
788
|
+
* together (`messageOverLimit`), so a batch never meets the provider's request-size error.
|
|
789
|
+
*/
|
|
790
|
+
interface AttachmentBounds {
|
|
791
|
+
maxBytes: number;
|
|
792
|
+
maxSourceBytes: number;
|
|
793
|
+
imageMaxSourcePixels: number;
|
|
794
|
+
maxImages: number;
|
|
795
|
+
maxTotalBytes: number;
|
|
796
|
+
}
|
|
797
|
+
declare const ATTACHMENT_BOUNDS: AttachmentBounds;
|
|
798
|
+
/**
|
|
799
|
+
* How an attachment goes to the model: `'convert'` - as the text the host's `convertFile` makes
|
|
800
|
+
* of it (`converts`: the composer will call it for this file); `'downscale'` - an image of a type
|
|
801
|
+
* the composer draws smaller (not GIF - animated - or SVG - drawn at any size), while
|
|
802
|
+
* `imageMaxDimension` is not false; `'none'` - as it is.
|
|
803
|
+
*/
|
|
804
|
+
type AttachmentTransform = 'none' | 'downscale' | 'convert';
|
|
805
|
+
declare const attachmentTransformOf: (input: {
|
|
806
|
+
kind: ComposerAttachment["kind"];
|
|
807
|
+
mediaType: string;
|
|
808
|
+
imageMaxDimension: number | false;
|
|
809
|
+
converts: boolean;
|
|
810
|
+
}) => AttachmentTransform;
|
|
811
|
+
/** The bound an attachment is over, and its value (bytes or pixels). */
|
|
812
|
+
type AttachmentOverLimit = {
|
|
813
|
+
bound: 'bytes' | 'pixels';
|
|
814
|
+
limit: number;
|
|
815
|
+
};
|
|
816
|
+
/**
|
|
817
|
+
* Which bound an attachment is over, or undefined. `stage` is when it is judged: `'original'` -
|
|
818
|
+
* the file as picked (and, for an image to downscale, its pixels when known); `'sent'` - what
|
|
819
|
+
* goes to the model (the downscaled image, the converted text, or the file as it is). The
|
|
820
|
+
* original of one the composer transforms is held to `maxSourceBytes` - never below `maxBytes`,
|
|
821
|
+
* so nothing that passed before is refused for its size - and an image's to
|
|
822
|
+
* `imageMaxSourcePixels`; what is sent, to `maxBytes`. One it does not transform: `maxBytes` on
|
|
823
|
+
* the original, as it is.
|
|
824
|
+
*/
|
|
825
|
+
declare const attachmentOverLimit: (file: {
|
|
826
|
+
bytes: number;
|
|
827
|
+
pixels?: number;
|
|
828
|
+
}, stage: "original" | "sent", transform: AttachmentTransform, bounds: AttachmentBounds) => AttachmentOverLimit | undefined;
|
|
829
|
+
/**
|
|
830
|
+
* Which limit of ONE message adding `next` to the attachments already in it would break:
|
|
831
|
+
* `'images'` - it is a picture and `maxImages` are there; `'bytes'` - what they would carry
|
|
832
|
+
* together is over `maxTotalBytes`. Each counts as it goes (`bytes`): a picture as downscaled, a
|
|
833
|
+
* converted file as its text, a text file as itself. undefined: it fits.
|
|
834
|
+
*/
|
|
835
|
+
declare const messageOverLimit: (inMessage: readonly Pick<ComposerAttachment, "kind" | "bytes">[], next: Pick<ComposerAttachment, "kind" | "bytes">, bounds: Pick<AttachmentBounds, "maxImages" | "maxTotalBytes">) => "images" | "bytes" | undefined;
|
|
776
836
|
/**
|
|
777
837
|
* Can the current model take this attachment? Returns the reason it can't
|
|
778
838
|
* (an actionable sentence), or undefined. `caps` is the core agent's
|
|
@@ -907,7 +967,17 @@ interface AgentLabels {
|
|
|
907
967
|
attachmentsOnly: string;
|
|
908
968
|
seeAttachments: string;
|
|
909
969
|
tooLarge: (name: string, mb: number) => string;
|
|
970
|
+
/** A picture with more pixels than `attachments.imageMaxSourcePixels` (in millions). */
|
|
971
|
+
tooManyPixels: (name: string, megapixels: number) => string;
|
|
910
972
|
binaryText: (name: string) => string;
|
|
973
|
+
/** An attachment's note: an image sent smaller (`size` is `bytes` of the original). */
|
|
974
|
+
downscaledFrom: (size: string) => string;
|
|
975
|
+
/** An attachment's note: a file sent as the text `convertFile` made of it. */
|
|
976
|
+
convertedFrom: (name: string) => string;
|
|
977
|
+
/** Files left out: the message has `attachments.maxImages` pictures (`names`: up to three). */
|
|
978
|
+
tooManyImages: (names: string, max: number) => string;
|
|
979
|
+
/** Files left out: the message would carry more than `attachments.maxTotalBytes` (in MB). */
|
|
980
|
+
messageTooLarge: (names: string, mb: number) => string;
|
|
911
981
|
commandGroups: {
|
|
912
982
|
commands: string;
|
|
913
983
|
consent: string;
|
|
@@ -1026,6 +1096,10 @@ interface AgentLabels {
|
|
|
1026
1096
|
mediaAudio: (path: string) => string;
|
|
1027
1097
|
/** A generated file that cannot be shown here (no workspace, the file is gone, an unknown type). */
|
|
1028
1098
|
mediaFile: (path: string) => string;
|
|
1099
|
+
/** Under a generated picture made with reference pictures: their names ("me.jpg, dog.png"). */
|
|
1100
|
+
mediaReferences: (names: string) => string;
|
|
1101
|
+
/** ...and when the image model took none: the picture was made from the text alone. */
|
|
1102
|
+
mediaReferencesUnused: (names: string) => string;
|
|
1029
1103
|
/** The summary of a transcript block. */
|
|
1030
1104
|
transcriptOf: (name: string) => string;
|
|
1031
1105
|
/** Says whose words a transcript is: the content of the user's file, not the agent's. */
|
|
@@ -1328,6 +1402,18 @@ interface DownscaleOptions {
|
|
|
1328
1402
|
/** JPEG/WebP quality 0..1 (default 0.9). */
|
|
1329
1403
|
quality?: number;
|
|
1330
1404
|
}
|
|
1405
|
+
/** A picture's size in pixels, as its file declares it. */
|
|
1406
|
+
interface ImageSize {
|
|
1407
|
+
width: number;
|
|
1408
|
+
height: number;
|
|
1409
|
+
}
|
|
1410
|
+
/**
|
|
1411
|
+
* A picture's size in pixels read from its file's header - a few small reads, nothing decoded -
|
|
1412
|
+
* for PNG, JPEG and WebP (by their bytes, whatever the file's type says). undefined for any
|
|
1413
|
+
* other format, a header that does not add up, or a file that cannot be read: the caller then
|
|
1414
|
+
* goes by the bytes alone. Never throws.
|
|
1415
|
+
*/
|
|
1416
|
+
declare const imageSizeOf: (file: Blob) => Promise<ImageSize | undefined>;
|
|
1331
1417
|
/** The image, smaller when it is larger than the limits; the original otherwise. */
|
|
1332
1418
|
declare const downscaleImage: (file: Blob, opts?: DownscaleOptions) => Promise<Blob>;
|
|
1333
1419
|
|
|
@@ -1513,7 +1599,11 @@ interface AgentComposerProps {
|
|
|
1513
1599
|
attachments?: boolean | {
|
|
1514
1600
|
/** The file picker's `accept`. */
|
|
1515
1601
|
accept?: string;
|
|
1516
|
-
/**
|
|
1602
|
+
/**
|
|
1603
|
+
* Refuse larger files (default 20 MB) - judged on what is SENT: an image the composer
|
|
1604
|
+
* downscales by the result (a 13 MB photo goes as a few hundred KB), a file `convertFile`
|
|
1605
|
+
* turns into text by the text.
|
|
1606
|
+
*/
|
|
1517
1607
|
maxBytes?: number;
|
|
1518
1608
|
/**
|
|
1519
1609
|
* Downscale images to this longest edge before sending (default 1568 —
|
|
@@ -1522,6 +1612,24 @@ interface AgentComposerProps {
|
|
|
1522
1612
|
imageMaxDimension?: number | false;
|
|
1523
1613
|
/** …and to this many pixels (default 1 150 000). */
|
|
1524
1614
|
imageMaxPixels?: number;
|
|
1615
|
+
/**
|
|
1616
|
+
* The original of a file it downscales or converts may be this large (default 50 MB;
|
|
1617
|
+
* never below `maxBytes`): a larger one is refused before it is read.
|
|
1618
|
+
*/
|
|
1619
|
+
maxSourceBytes?: number;
|
|
1620
|
+
/**
|
|
1621
|
+
* The original of an image it downscales may have this many pixels, read from its header
|
|
1622
|
+
* before it is decoded (default 200 000 000 - a decoded picture takes ~4 bytes a pixel).
|
|
1623
|
+
* Formats whose header is not read: the bytes only.
|
|
1624
|
+
*/
|
|
1625
|
+
imageMaxSourcePixels?: number;
|
|
1626
|
+
/** Pictures in one message, those already attached included (default 20). */
|
|
1627
|
+
maxImages?: number;
|
|
1628
|
+
/**
|
|
1629
|
+
* What one message's attachments carry together (default 20 MB): a picture as downscaled,
|
|
1630
|
+
* a converted file as its text. A file that would go over it is not added.
|
|
1631
|
+
*/
|
|
1632
|
+
maxTotalBytes?: number;
|
|
1525
1633
|
};
|
|
1526
1634
|
/**
|
|
1527
1635
|
* Turn a file into text — e.g. PDF → Markdown with `@dudko.dev/pdf-to-md-core`.
|
|
@@ -2842,5 +2950,5 @@ interface AppRequestPromptProps {
|
|
|
2842
2950
|
*/
|
|
2843
2951
|
declare const AppRequestPrompt: ({ requests, onAnswer, renderRequest, labels, className, }: AppRequestPromptProps) => react.JSX.Element | null;
|
|
2844
2952
|
|
|
2845
|
-
export { ASK_USER_TOOL_NAME, 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, ModelLoadBar, ModelLoadState, PendingElicitation, PlanView, QUESTION_TIMEOUT_MS, QuestionPrompt, QuestionView, RemoteRunView, SandboxedFrame, SourceView, StepList, StepView, SubagentNode, SubagentRow, SubagentTree, SubagentView, ToolApprovalPrompt, ToolCallRow, ToolCallView, TranscriptBlock, TranscriptView, UsageBadge, UserNoteRow, UserNoteView, agentStateReducer, agentStatusOf, askUserOutputKept, askUserWith, attachmentKindOf, attachmentRefusal, buildSandboxedDocument, chatTitle, clampFrameHeight, createApprovalQueue, createInitialAgentState, createQuestionQueue, createWebLLMEngine, decisionNote, defaultLabels, downscaleImage, escapeAttribute, fileKindOf, fileNameOf, filterCommands, followsAfterResize, followsAfterScroll, formatElapsed, imageExtensionOf, lessonsOf, linkedFilesOf, mediaFamilyOf, menuKeyTarget, menuSections, mergeChatRecord, mergeLabels, newChatId, noticesOf, parseSlash, pendingApprovalsOf, questionChoiceOf, questionOtherOf, questionTimeoutOf, sandboxTokens, sandboxedCsp, saveChat, steerIntent, subagentTree, tokenizeHtml, unchangedSince, usageLine, useAgent, useAgentContext, useChatHistory, useCredentials, useFollowScroll, useLabels, useLocalModel, useOptionalAgentContext, useSpeechToText, useVirtualFiles, useWebLLMModel, webSearchOf, withAttachments, withCspFirst, withPolicyFirst, withoutOwnWords };
|
|
2846
|
-
export type { AgentAction, AgentChatClassNames, AgentChatComponents, AgentChatProps, AgentChatSlots, AgentComposerProps, AgentLabels, AgentLabelsOverride, AgentLabelsProviderProps, AgentProviderProps, ApiKeyFormProps, AppRequestPromptProps, ApprovalModeSwitchProps, ApprovalQueue, ApproveOptions, ChatBase, ChatHistoryListProps, ChatHistoryStoreOptions, ChatRecord, ChatSummary, ComposerAttachment, ComposerModelChip, ComposerModelOption, ComposerNotice, ComposerProps, ComposerThinkingChip, ContextMeterProps, ConvertedFile, DownscaleOptions, ElicitationPromptProps, FileChipProps, FileChipsProps, FileKind, FilesPanelProps, GeneratedMediaProps, HtmlPreviewOptions, ImageThumbProps, ImageViewerProps, LearnedSkillsProps, LocalModelEngine, LocalModelLoadContext, LocalModelProgress, McpAppFrameProps, McpAppLineProps, MenuSection, MessageListProps, ModelLoadBarProps, NoticeTexts, PendingQuestion, PlanViewProps, QuestionOutcomeReason, QuestionPromptProps, QuestionQueue, QuestionQueueOptions, RenderImageViewer, RenderSubagent, RenderToolCall, RunGoalOptions, SandboxedDocumentOptions, SandboxedFrameProps, ScrollMeasure, SlashCommand, SourceToken, SourceViewProps, SpeechRecognizerLike, SteerIntent, StepListProps, SubagentRowProps, SubagentTreeProps, ToolApprovalPromptProps, ToolCallRowProps, TranscriptBlockProps, UsageBadgeProps, UseAgentOptions, UseAgentReturn, UseChatHistoryOptions, UseChatHistoryReturn, UseCredentialsReturn, UseLocalModelOptions, UseLocalModelReturn, UseSpeechToTextOptions, UseSpeechToTextReturn, UseVirtualFilesReturn, UseWebLLMModelOptions, UseWebLLMModelReturn, ViewerImage, WebLLMModelFactory, WebSearchResultView, WebSearchView };
|
|
2953
|
+
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, ModelLoadBar, ModelLoadState, PendingElicitation, PlanView, QUESTION_TIMEOUT_MS, QuestionPrompt, QuestionView, RemoteRunView, SandboxedFrame, SourceView, StepList, StepView, SubagentNode, SubagentRow, SubagentTree, SubagentView, ToolApprovalPrompt, ToolCallRow, ToolCallView, TranscriptBlock, TranscriptView, UsageBadge, UserNoteRow, UserNoteView, agentStateReducer, agentStatusOf, askUserOutputKept, askUserWith, attachmentKindOf, attachmentOverLimit, attachmentRefusal, attachmentTransformOf, buildSandboxedDocument, chatTitle, clampFrameHeight, createApprovalQueue, createInitialAgentState, createQuestionQueue, createWebLLMEngine, decisionNote, defaultLabels, downscaleImage, escapeAttribute, fileKindOf, fileNameOf, filterCommands, followsAfterResize, followsAfterScroll, formatElapsed, imageExtensionOf, imageSizeOf, lessonsOf, linkedFilesOf, mediaFamilyOf, menuKeyTarget, menuSections, mergeChatRecord, mergeLabels, messageOverLimit, newChatId, noticesOf, parseSlash, pendingApprovalsOf, questionChoiceOf, questionOtherOf, questionTimeoutOf, sandboxTokens, sandboxedCsp, saveChat, steerIntent, subagentTree, tokenizeHtml, unchangedSince, usageLine, useAgent, useAgentContext, useChatHistory, useCredentials, useFollowScroll, useLabels, useLocalModel, useOptionalAgentContext, useSpeechToText, useVirtualFiles, useWebLLMModel, webSearchOf, withAttachments, withCspFirst, withPolicyFirst, withoutOwnWords };
|
|
2954
|
+
export type { AgentAction, AgentChatClassNames, AgentChatComponents, AgentChatProps, AgentChatSlots, AgentComposerProps, AgentLabels, AgentLabelsOverride, AgentLabelsProviderProps, AgentProviderProps, ApiKeyFormProps, AppRequestPromptProps, ApprovalModeSwitchProps, ApprovalQueue, ApproveOptions, AttachmentBounds, AttachmentOverLimit, AttachmentTransform, 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, MenuSection, MessageListProps, ModelLoadBarProps, NoticeTexts, PendingQuestion, PlanViewProps, QuestionOutcomeReason, QuestionPromptProps, QuestionQueue, QuestionQueueOptions, RenderImageViewer, RenderSubagent, RenderToolCall, RunGoalOptions, SandboxedDocumentOptions, SandboxedFrameProps, ScrollMeasure, SlashCommand, SourceToken, SourceViewProps, SpeechRecognizerLike, SteerIntent, StepListProps, SubagentRowProps, SubagentTreeProps, ToolApprovalPromptProps, ToolCallRowProps, TranscriptBlockProps, UsageBadgeProps, UseAgentOptions, UseAgentReturn, UseChatHistoryOptions, UseChatHistoryReturn, UseCredentialsReturn, UseLocalModelOptions, UseLocalModelReturn, 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-
|
|
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-
|
|
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-BgSf-xzh.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-BgSf-xzh.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
|
/**
|
|
@@ -770,9 +770,69 @@ interface ComposerAttachment {
|
|
|
770
770
|
declare const attachmentKindOf: (mediaType: string, name: string) => ComposerAttachment["kind"];
|
|
771
771
|
/**
|
|
772
772
|
* The goal the agent receives: the typed text followed by each attached TEXT
|
|
773
|
-
* file in a fenced block. Binary attachments travel as file parts instead
|
|
773
|
+
* file in a fenced block. Binary attachments travel as file parts instead; the
|
|
774
|
+
* ones saved in the workspace (`path`) are named with it, so a tool can take
|
|
775
|
+
* the file itself (`generate_image`'s reference pictures).
|
|
774
776
|
*/
|
|
775
777
|
declare const withAttachments: (text: string, files: ComposerAttachment[]) => string;
|
|
778
|
+
/**
|
|
779
|
+
* The size bounds of an attachment (`<AgentComposer attachments={…}>`; these are the defaults).
|
|
780
|
+
* - `maxBytes`: what is SENT. A file that goes as it is, by its size; one the composer transforms
|
|
781
|
+
* first, by the result - an image it downscales (a 13 MB photo goes as a few hundred KB), a
|
|
782
|
+
* file the host's `convertFile` turns into text (a 30 MB PDF goes as its Markdown).
|
|
783
|
+
* - `maxSourceBytes`: the ORIGINAL of one it transforms, judged before it is read or decoded.
|
|
784
|
+
* - `imageMaxSourcePixels`: the original of an image it downscales, by the pixels its header
|
|
785
|
+
* declares (`imageSizeOf`) - a decoded picture takes ~4 bytes a pixel. A format whose header is
|
|
786
|
+
* not read is held to the bytes only.
|
|
787
|
+
* - `maxImages` / `maxTotalBytes`: ONE message - its pictures, and what all its attachments carry
|
|
788
|
+
* together (`messageOverLimit`), so a batch never meets the provider's request-size error.
|
|
789
|
+
*/
|
|
790
|
+
interface AttachmentBounds {
|
|
791
|
+
maxBytes: number;
|
|
792
|
+
maxSourceBytes: number;
|
|
793
|
+
imageMaxSourcePixels: number;
|
|
794
|
+
maxImages: number;
|
|
795
|
+
maxTotalBytes: number;
|
|
796
|
+
}
|
|
797
|
+
declare const ATTACHMENT_BOUNDS: AttachmentBounds;
|
|
798
|
+
/**
|
|
799
|
+
* How an attachment goes to the model: `'convert'` - as the text the host's `convertFile` makes
|
|
800
|
+
* of it (`converts`: the composer will call it for this file); `'downscale'` - an image of a type
|
|
801
|
+
* the composer draws smaller (not GIF - animated - or SVG - drawn at any size), while
|
|
802
|
+
* `imageMaxDimension` is not false; `'none'` - as it is.
|
|
803
|
+
*/
|
|
804
|
+
type AttachmentTransform = 'none' | 'downscale' | 'convert';
|
|
805
|
+
declare const attachmentTransformOf: (input: {
|
|
806
|
+
kind: ComposerAttachment["kind"];
|
|
807
|
+
mediaType: string;
|
|
808
|
+
imageMaxDimension: number | false;
|
|
809
|
+
converts: boolean;
|
|
810
|
+
}) => AttachmentTransform;
|
|
811
|
+
/** The bound an attachment is over, and its value (bytes or pixels). */
|
|
812
|
+
type AttachmentOverLimit = {
|
|
813
|
+
bound: 'bytes' | 'pixels';
|
|
814
|
+
limit: number;
|
|
815
|
+
};
|
|
816
|
+
/**
|
|
817
|
+
* Which bound an attachment is over, or undefined. `stage` is when it is judged: `'original'` -
|
|
818
|
+
* the file as picked (and, for an image to downscale, its pixels when known); `'sent'` - what
|
|
819
|
+
* goes to the model (the downscaled image, the converted text, or the file as it is). The
|
|
820
|
+
* original of one the composer transforms is held to `maxSourceBytes` - never below `maxBytes`,
|
|
821
|
+
* so nothing that passed before is refused for its size - and an image's to
|
|
822
|
+
* `imageMaxSourcePixels`; what is sent, to `maxBytes`. One it does not transform: `maxBytes` on
|
|
823
|
+
* the original, as it is.
|
|
824
|
+
*/
|
|
825
|
+
declare const attachmentOverLimit: (file: {
|
|
826
|
+
bytes: number;
|
|
827
|
+
pixels?: number;
|
|
828
|
+
}, stage: "original" | "sent", transform: AttachmentTransform, bounds: AttachmentBounds) => AttachmentOverLimit | undefined;
|
|
829
|
+
/**
|
|
830
|
+
* Which limit of ONE message adding `next` to the attachments already in it would break:
|
|
831
|
+
* `'images'` - it is a picture and `maxImages` are there; `'bytes'` - what they would carry
|
|
832
|
+
* together is over `maxTotalBytes`. Each counts as it goes (`bytes`): a picture as downscaled, a
|
|
833
|
+
* converted file as its text, a text file as itself. undefined: it fits.
|
|
834
|
+
*/
|
|
835
|
+
declare const messageOverLimit: (inMessage: readonly Pick<ComposerAttachment, "kind" | "bytes">[], next: Pick<ComposerAttachment, "kind" | "bytes">, bounds: Pick<AttachmentBounds, "maxImages" | "maxTotalBytes">) => "images" | "bytes" | undefined;
|
|
776
836
|
/**
|
|
777
837
|
* Can the current model take this attachment? Returns the reason it can't
|
|
778
838
|
* (an actionable sentence), or undefined. `caps` is the core agent's
|
|
@@ -907,7 +967,17 @@ interface AgentLabels {
|
|
|
907
967
|
attachmentsOnly: string;
|
|
908
968
|
seeAttachments: string;
|
|
909
969
|
tooLarge: (name: string, mb: number) => string;
|
|
970
|
+
/** A picture with more pixels than `attachments.imageMaxSourcePixels` (in millions). */
|
|
971
|
+
tooManyPixels: (name: string, megapixels: number) => string;
|
|
910
972
|
binaryText: (name: string) => string;
|
|
973
|
+
/** An attachment's note: an image sent smaller (`size` is `bytes` of the original). */
|
|
974
|
+
downscaledFrom: (size: string) => string;
|
|
975
|
+
/** An attachment's note: a file sent as the text `convertFile` made of it. */
|
|
976
|
+
convertedFrom: (name: string) => string;
|
|
977
|
+
/** Files left out: the message has `attachments.maxImages` pictures (`names`: up to three). */
|
|
978
|
+
tooManyImages: (names: string, max: number) => string;
|
|
979
|
+
/** Files left out: the message would carry more than `attachments.maxTotalBytes` (in MB). */
|
|
980
|
+
messageTooLarge: (names: string, mb: number) => string;
|
|
911
981
|
commandGroups: {
|
|
912
982
|
commands: string;
|
|
913
983
|
consent: string;
|
|
@@ -1026,6 +1096,10 @@ interface AgentLabels {
|
|
|
1026
1096
|
mediaAudio: (path: string) => string;
|
|
1027
1097
|
/** A generated file that cannot be shown here (no workspace, the file is gone, an unknown type). */
|
|
1028
1098
|
mediaFile: (path: string) => string;
|
|
1099
|
+
/** Under a generated picture made with reference pictures: their names ("me.jpg, dog.png"). */
|
|
1100
|
+
mediaReferences: (names: string) => string;
|
|
1101
|
+
/** ...and when the image model took none: the picture was made from the text alone. */
|
|
1102
|
+
mediaReferencesUnused: (names: string) => string;
|
|
1029
1103
|
/** The summary of a transcript block. */
|
|
1030
1104
|
transcriptOf: (name: string) => string;
|
|
1031
1105
|
/** Says whose words a transcript is: the content of the user's file, not the agent's. */
|
|
@@ -1328,6 +1402,18 @@ interface DownscaleOptions {
|
|
|
1328
1402
|
/** JPEG/WebP quality 0..1 (default 0.9). */
|
|
1329
1403
|
quality?: number;
|
|
1330
1404
|
}
|
|
1405
|
+
/** A picture's size in pixels, as its file declares it. */
|
|
1406
|
+
interface ImageSize {
|
|
1407
|
+
width: number;
|
|
1408
|
+
height: number;
|
|
1409
|
+
}
|
|
1410
|
+
/**
|
|
1411
|
+
* A picture's size in pixels read from its file's header - a few small reads, nothing decoded -
|
|
1412
|
+
* for PNG, JPEG and WebP (by their bytes, whatever the file's type says). undefined for any
|
|
1413
|
+
* other format, a header that does not add up, or a file that cannot be read: the caller then
|
|
1414
|
+
* goes by the bytes alone. Never throws.
|
|
1415
|
+
*/
|
|
1416
|
+
declare const imageSizeOf: (file: Blob) => Promise<ImageSize | undefined>;
|
|
1331
1417
|
/** The image, smaller when it is larger than the limits; the original otherwise. */
|
|
1332
1418
|
declare const downscaleImage: (file: Blob, opts?: DownscaleOptions) => Promise<Blob>;
|
|
1333
1419
|
|
|
@@ -1513,7 +1599,11 @@ interface AgentComposerProps {
|
|
|
1513
1599
|
attachments?: boolean | {
|
|
1514
1600
|
/** The file picker's `accept`. */
|
|
1515
1601
|
accept?: string;
|
|
1516
|
-
/**
|
|
1602
|
+
/**
|
|
1603
|
+
* Refuse larger files (default 20 MB) - judged on what is SENT: an image the composer
|
|
1604
|
+
* downscales by the result (a 13 MB photo goes as a few hundred KB), a file `convertFile`
|
|
1605
|
+
* turns into text by the text.
|
|
1606
|
+
*/
|
|
1517
1607
|
maxBytes?: number;
|
|
1518
1608
|
/**
|
|
1519
1609
|
* Downscale images to this longest edge before sending (default 1568 —
|
|
@@ -1522,6 +1612,24 @@ interface AgentComposerProps {
|
|
|
1522
1612
|
imageMaxDimension?: number | false;
|
|
1523
1613
|
/** …and to this many pixels (default 1 150 000). */
|
|
1524
1614
|
imageMaxPixels?: number;
|
|
1615
|
+
/**
|
|
1616
|
+
* The original of a file it downscales or converts may be this large (default 50 MB;
|
|
1617
|
+
* never below `maxBytes`): a larger one is refused before it is read.
|
|
1618
|
+
*/
|
|
1619
|
+
maxSourceBytes?: number;
|
|
1620
|
+
/**
|
|
1621
|
+
* The original of an image it downscales may have this many pixels, read from its header
|
|
1622
|
+
* before it is decoded (default 200 000 000 - a decoded picture takes ~4 bytes a pixel).
|
|
1623
|
+
* Formats whose header is not read: the bytes only.
|
|
1624
|
+
*/
|
|
1625
|
+
imageMaxSourcePixels?: number;
|
|
1626
|
+
/** Pictures in one message, those already attached included (default 20). */
|
|
1627
|
+
maxImages?: number;
|
|
1628
|
+
/**
|
|
1629
|
+
* What one message's attachments carry together (default 20 MB): a picture as downscaled,
|
|
1630
|
+
* a converted file as its text. A file that would go over it is not added.
|
|
1631
|
+
*/
|
|
1632
|
+
maxTotalBytes?: number;
|
|
1525
1633
|
};
|
|
1526
1634
|
/**
|
|
1527
1635
|
* Turn a file into text — e.g. PDF → Markdown with `@dudko.dev/pdf-to-md-core`.
|
|
@@ -2842,5 +2950,5 @@ interface AppRequestPromptProps {
|
|
|
2842
2950
|
*/
|
|
2843
2951
|
declare const AppRequestPrompt: ({ requests, onAnswer, renderRequest, labels, className, }: AppRequestPromptProps) => react.JSX.Element | null;
|
|
2844
2952
|
|
|
2845
|
-
export { ASK_USER_TOOL_NAME, 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, ModelLoadBar, ModelLoadState, PendingElicitation, PlanView, QUESTION_TIMEOUT_MS, QuestionPrompt, QuestionView, RemoteRunView, SandboxedFrame, SourceView, StepList, StepView, SubagentNode, SubagentRow, SubagentTree, SubagentView, ToolApprovalPrompt, ToolCallRow, ToolCallView, TranscriptBlock, TranscriptView, UsageBadge, UserNoteRow, UserNoteView, agentStateReducer, agentStatusOf, askUserOutputKept, askUserWith, attachmentKindOf, attachmentRefusal, buildSandboxedDocument, chatTitle, clampFrameHeight, createApprovalQueue, createInitialAgentState, createQuestionQueue, createWebLLMEngine, decisionNote, defaultLabels, downscaleImage, escapeAttribute, fileKindOf, fileNameOf, filterCommands, followsAfterResize, followsAfterScroll, formatElapsed, imageExtensionOf, lessonsOf, linkedFilesOf, mediaFamilyOf, menuKeyTarget, menuSections, mergeChatRecord, mergeLabels, newChatId, noticesOf, parseSlash, pendingApprovalsOf, questionChoiceOf, questionOtherOf, questionTimeoutOf, sandboxTokens, sandboxedCsp, saveChat, steerIntent, subagentTree, tokenizeHtml, unchangedSince, usageLine, useAgent, useAgentContext, useChatHistory, useCredentials, useFollowScroll, useLabels, useLocalModel, useOptionalAgentContext, useSpeechToText, useVirtualFiles, useWebLLMModel, webSearchOf, withAttachments, withCspFirst, withPolicyFirst, withoutOwnWords };
|
|
2846
|
-
export type { AgentAction, AgentChatClassNames, AgentChatComponents, AgentChatProps, AgentChatSlots, AgentComposerProps, AgentLabels, AgentLabelsOverride, AgentLabelsProviderProps, AgentProviderProps, ApiKeyFormProps, AppRequestPromptProps, ApprovalModeSwitchProps, ApprovalQueue, ApproveOptions, ChatBase, ChatHistoryListProps, ChatHistoryStoreOptions, ChatRecord, ChatSummary, ComposerAttachment, ComposerModelChip, ComposerModelOption, ComposerNotice, ComposerProps, ComposerThinkingChip, ContextMeterProps, ConvertedFile, DownscaleOptions, ElicitationPromptProps, FileChipProps, FileChipsProps, FileKind, FilesPanelProps, GeneratedMediaProps, HtmlPreviewOptions, ImageThumbProps, ImageViewerProps, LearnedSkillsProps, LocalModelEngine, LocalModelLoadContext, LocalModelProgress, McpAppFrameProps, McpAppLineProps, MenuSection, MessageListProps, ModelLoadBarProps, NoticeTexts, PendingQuestion, PlanViewProps, QuestionOutcomeReason, QuestionPromptProps, QuestionQueue, QuestionQueueOptions, RenderImageViewer, RenderSubagent, RenderToolCall, RunGoalOptions, SandboxedDocumentOptions, SandboxedFrameProps, ScrollMeasure, SlashCommand, SourceToken, SourceViewProps, SpeechRecognizerLike, SteerIntent, StepListProps, SubagentRowProps, SubagentTreeProps, ToolApprovalPromptProps, ToolCallRowProps, TranscriptBlockProps, UsageBadgeProps, UseAgentOptions, UseAgentReturn, UseChatHistoryOptions, UseChatHistoryReturn, UseCredentialsReturn, UseLocalModelOptions, UseLocalModelReturn, UseSpeechToTextOptions, UseSpeechToTextReturn, UseVirtualFilesReturn, UseWebLLMModelOptions, UseWebLLMModelReturn, ViewerImage, WebLLMModelFactory, WebSearchResultView, WebSearchView };
|
|
2953
|
+
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, ModelLoadBar, ModelLoadState, PendingElicitation, PlanView, QUESTION_TIMEOUT_MS, QuestionPrompt, QuestionView, RemoteRunView, SandboxedFrame, SourceView, StepList, StepView, SubagentNode, SubagentRow, SubagentTree, SubagentView, ToolApprovalPrompt, ToolCallRow, ToolCallView, TranscriptBlock, TranscriptView, UsageBadge, UserNoteRow, UserNoteView, agentStateReducer, agentStatusOf, askUserOutputKept, askUserWith, attachmentKindOf, attachmentOverLimit, attachmentRefusal, attachmentTransformOf, buildSandboxedDocument, chatTitle, clampFrameHeight, createApprovalQueue, createInitialAgentState, createQuestionQueue, createWebLLMEngine, decisionNote, defaultLabels, downscaleImage, escapeAttribute, fileKindOf, fileNameOf, filterCommands, followsAfterResize, followsAfterScroll, formatElapsed, imageExtensionOf, imageSizeOf, lessonsOf, linkedFilesOf, mediaFamilyOf, menuKeyTarget, menuSections, mergeChatRecord, mergeLabels, messageOverLimit, newChatId, noticesOf, parseSlash, pendingApprovalsOf, questionChoiceOf, questionOtherOf, questionTimeoutOf, sandboxTokens, sandboxedCsp, saveChat, steerIntent, subagentTree, tokenizeHtml, unchangedSince, usageLine, useAgent, useAgentContext, useChatHistory, useCredentials, useFollowScroll, useLabels, useLocalModel, useOptionalAgentContext, useSpeechToText, useVirtualFiles, useWebLLMModel, webSearchOf, withAttachments, withCspFirst, withPolicyFirst, withoutOwnWords };
|
|
2954
|
+
export type { AgentAction, AgentChatClassNames, AgentChatComponents, AgentChatProps, AgentChatSlots, AgentComposerProps, AgentLabels, AgentLabelsOverride, AgentLabelsProviderProps, AgentProviderProps, ApiKeyFormProps, AppRequestPromptProps, ApprovalModeSwitchProps, ApprovalQueue, ApproveOptions, AttachmentBounds, AttachmentOverLimit, AttachmentTransform, 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, MenuSection, MessageListProps, ModelLoadBarProps, NoticeTexts, PendingQuestion, PlanViewProps, QuestionOutcomeReason, QuestionPromptProps, QuestionQueue, QuestionQueueOptions, RenderImageViewer, RenderSubagent, RenderToolCall, RunGoalOptions, SandboxedDocumentOptions, SandboxedFrameProps, ScrollMeasure, SlashCommand, SourceToken, SourceViewProps, SpeechRecognizerLike, SteerIntent, StepListProps, SubagentRowProps, SubagentTreeProps, ToolApprovalPromptProps, ToolCallRowProps, TranscriptBlockProps, UsageBadgeProps, UseAgentOptions, UseAgentReturn, UseChatHistoryOptions, UseChatHistoryReturn, UseCredentialsReturn, UseLocalModelOptions, UseLocalModelReturn, UseSpeechToTextOptions, UseSpeechToTextReturn, UseVirtualFilesReturn, UseWebLLMModelOptions, UseWebLLMModelReturn, ViewerImage, WebLLMModelFactory, WebSearchResultView, WebSearchView };
|