@dudko.dev/agent-web 0.0.48 → 0.0.50

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
@@ -828,6 +828,71 @@ declare const checkAskUserAnswer: (q: AskUserQuestion, raw: unknown) => {
828
828
  reason: string;
829
829
  };
830
830
 
831
+ declare const GENERATE_IMAGE_TOOL = "generate_image";
832
+ declare const GENERATE_SPEECH_TOOL = "generate_speech";
833
+ declare const TRANSCRIBE_AUDIO_TOOL = "transcribe_audio";
834
+ type MediaKind = 'image' | 'speech' | 'transcription';
835
+ declare const MEDIA_DEFAULT_MAX_CALLS = 8;
836
+ declare const MEDIA_TIMEOUT_MS = 120000;
837
+ declare const MEDIA_MAX_IMAGE_BYTES: number;
838
+ declare const MEDIA_MAX_SPEECH_BYTES: number;
839
+ declare const MEDIA_MAX_AUDIO_INPUT_BYTES: number;
840
+ declare const MEDIA_MAX_PROMPT_CHARS = 4000;
841
+ declare const MEDIA_MAX_SPEECH_CHARS = 4000;
842
+ declare const MEDIA_MAX_TRANSCRIPT_CHARS = 20000;
843
+ declare const MEDIA_MAX_ATTACHED_AUDIO = 4;
844
+ declare const MEDIA_MAX_REFERENCE_IMAGES = 4;
845
+ declare const MEDIA_MAX_REFERENCE_BYTES: number;
846
+ declare const MEDIA_MAX_REFERENCE_TOTAL_BYTES: number;
847
+ declare const MEDIA_MAX_REFERENCE_SIDE = 4096;
848
+ declare const MEDIA_FOLDER = "media";
849
+ declare class MediaError extends Error {
850
+ constructor(message: string);
851
+ toJSON(): string;
852
+ }
853
+ declare class MediaBudgetError extends MediaError {
854
+ constructor(cap: number);
855
+ }
856
+ declare const MEDIA_IMAGE_TYPES: Readonly<Record<string, string>>;
857
+ declare const MEDIA_AUDIO_TYPES: Readonly<Record<string, string>>;
858
+ declare const MEDIA_REFERENCE_TYPES: Readonly<Record<string, string>>;
859
+ declare const sniffMediaType: (bytes: Uint8Array) => string | undefined;
860
+ interface IAcceptedMedia {
861
+ mediaType: string;
862
+ ext: string;
863
+ }
864
+ declare const acceptMedia: (family: "image" | "audio", bytes: Uint8Array, maxBytes: number, what: string) => IAcceptedMedia;
865
+ interface IImageSize {
866
+ width: number;
867
+ height: number;
868
+ }
869
+ declare const imageDimensions: (bytes: Uint8Array) => IImageSize | undefined;
870
+ interface IAcceptedReference extends IAcceptedMedia, IImageSize {
871
+ }
872
+ declare const acceptReference: (bytes: Uint8Array, what: string) => IAcceptedReference;
873
+ interface IReferenceUse {
874
+ used: boolean;
875
+ count: number;
876
+ paths: string[];
877
+ }
878
+ interface IReferenceResult extends IReferenceUse {
879
+ note?: string;
880
+ }
881
+ interface IMediaUsage {
882
+ mediaCalls: number;
883
+ imagesGenerated: number;
884
+ speechCharacters: number;
885
+ transcriptionSeconds: number;
886
+ }
887
+ declare const mediaUsageOf: (usage: Partial<IMediaUsage> | undefined) => IMediaUsage | undefined;
888
+ interface ITranscriptBlock {
889
+ name: string;
890
+ text: string;
891
+ language?: string;
892
+ durationInSeconds?: number;
893
+ }
894
+ declare const wrapTranscript: (block: ITranscriptBlock) => string;
895
+
831
896
  type ReplanMode = 'continue' | 'revise' | 'finish';
832
897
  type Phase = 'plan' | 'execute' | 'replan' | 'synthesize';
833
898
  /**
@@ -1011,7 +1076,9 @@ type AgentEventBody =
1011
1076
  /**
1012
1077
  * A media tool (`config.media`) wrote a file to the virtual file system: `path` is where (read
1013
1078
  * it with `vfs.readDataUrl(path)` to show the picture or play the audio), `mediaType` what its
1014
- * bytes are, `bytes` its size. The bytes themselves are never in an event.
1079
+ * bytes are, `bytes` its size. `references`: a `generate_image` call with `images` - whether
1080
+ * those pictures were sent (`used`; false: the model takes none), how many and their paths.
1081
+ * The bytes themselves are never in an event.
1015
1082
  */
1016
1083
  | {
1017
1084
  type: 'media.generated';
@@ -1020,6 +1087,7 @@ type AgentEventBody =
1020
1087
  mediaType: string;
1021
1088
  bytes: number;
1022
1089
  model: string;
1090
+ references?: IReferenceUse;
1023
1091
  step?: IPlanStep;
1024
1092
  }
1025
1093
  /**
@@ -2238,10 +2306,29 @@ interface ISearchOptions {
2238
2306
  signal?: AbortSignal;
2239
2307
  }
2240
2308
  /**
2241
- * A search engine of the host's own: any function that answers a query with results. What it
2242
- * returns is treated like a built-in adapter's answer - cleaned, capped and filtered.
2309
+ * What a search engine function may answer in place of a bare list, when the search ran through a
2310
+ * model - a provider's server-side search tool, one model call: the results, what the call spent,
2311
+ * the model's own answer and a line on what the results are. Every field is checked as the rest of
2312
+ * an engine's answer is (`searchEngineAnswer`).
2243
2313
  */
2244
- type SearchEngine = (query: string, options: ISearchOptions) => Promise<ISearchResult[]>;
2314
+ interface ISearchEngineAnswer {
2315
+ results: ISearchResult[];
2316
+ /**
2317
+ * The model tokens the search spent, as its API reported them: charged to the run like the
2318
+ * google provider's (a `usage` event of phase 'search', in every total and against the limits).
2319
+ */
2320
+ usage?: ISearchUsage;
2321
+ /** The model's answer from its sources: the model sees it, cut, when no result has a snippet. */
2322
+ summary?: string;
2323
+ /** One line on what the results are - whose search, what the snippets are - for the model. */
2324
+ note?: string;
2325
+ }
2326
+ /**
2327
+ * A search engine of the host's own: any function that answers a query with results - a bare
2328
+ * list, or an `ISearchEngineAnswer` with what the search spent. What it returns is treated like a
2329
+ * built-in adapter's answer - cleaned, capped and filtered.
2330
+ */
2331
+ type SearchEngine = (query: string, options: ISearchOptions) => Promise<ISearchResult[] | ISearchEngineAnswer>;
2245
2332
  /**
2246
2333
  * The built-in provider. One: Google Search through the Gemini API's grounding (`google_search`),
2247
2334
  * which needs a Gemini (Google AI Studio) key and nothing else. Any other search API is the
@@ -2258,6 +2345,8 @@ declare const SEARCH_API_BASE_URL: Record<SearchProvider, string>;
2258
2345
  declare const SEARCH_GOOGLE_DEFAULT_MODEL = "gemini-2.5-flash-lite";
2259
2346
  /** The most of the grounding model's answer a model sees as `summary`. */
2260
2347
  declare const SEARCH_MAX_SUMMARY_CHARS = 1000;
2348
+ /** The most of a result list's `note` (what the results are) a model sees. */
2349
+ declare const SEARCH_MAX_NOTE_CHARS = 300;
2261
2350
  /** Said in every result of the google provider: what its URLs and its text are. */
2262
2351
  declare const SEARCH_GOOGLE_NOTE: string;
2263
2352
  /** One HTTP call to a search API. The key, if any, is in `headers` only - never in the URL. */
@@ -2293,6 +2382,8 @@ interface ISearchAnswer {
2293
2382
  summary?: unknown;
2294
2383
  /** Absent when the API reported none. */
2295
2384
  usage?: ISearchUsage;
2385
+ /** What the results are (the google provider's `SEARCH_GOOGLE_NOTE`, an engine's own line). */
2386
+ note?: string;
2296
2387
  }
2297
2388
  /**
2298
2389
  * The request for one query, per the Gemini API's public documentation:
@@ -2310,6 +2401,18 @@ declare const buildSearchRequest: (input: ISearchRequestInput) => ISearchRequest
2310
2401
  * what makes them safe to show.
2311
2402
  */
2312
2403
  declare const parseSearchResponse: (provider: SearchProvider, json: unknown) => ISearchAnswer;
2404
+ /**
2405
+ * What a search spent, as an engine reported it: whole non-negative token counts (anything else
2406
+ * is 0), the total their sum, reasoning never more than the output. Undefined when it spent none.
2407
+ */
2408
+ declare const searchUsageOf: (raw: unknown) => ISearchUsage | undefined;
2409
+ /**
2410
+ * An engine's answer as the tool reads it. A bare list is the results and nothing else (no usage,
2411
+ * no summary, no note); an `ISearchEngineAnswer` gives its `results` and - checked - its usage
2412
+ * (`searchUsageOf`), its summary (a string; cleaned and cut when it is shown) and its note (cleaned
2413
+ * and cut here). Anything else is no results. Still raw until `sanitizeSearchResults`.
2414
+ */
2415
+ declare const searchEngineAnswer: (raw: unknown) => ISearchAnswer;
2313
2416
  /**
2314
2417
  * What a failed call says to the model: the provider, the model, the status, the API's own error
2315
2418
  * code word and what it usually means. Never the error's text: that is third-party text, and may
@@ -2337,18 +2440,19 @@ declare const sanitizeSearchResults: (raw: unknown, options?: {
2337
2440
  interface ISearchToolResult {
2338
2441
  query: string;
2339
2442
  results: ISearchResult[];
2340
- /** The google provider, when no source came with a snippet: the grounding model's answer, cut. */
2443
+ /** When no source came with a snippet: the grounding (or engine's) model's answer, cut. */
2341
2444
  summary?: string;
2342
- /** The google provider: what its URLs and its text are. */
2445
+ /** What the URLs and the text are: the google provider's note, or an engine's own line. */
2343
2446
  note?: string;
2344
2447
  filtered?: number;
2345
2448
  truncated?: true;
2346
2449
  untrusted: true;
2347
2450
  }
2348
2451
  /**
2349
- * The tool's result, from the cleaned list and - for the google provider - the parsed answer.
2350
- * The model's `summary` is attached only when there are sources, none of them carries a snippet
2351
- * and none was filtered out: a summary cannot be cut to the sources that remain.
2452
+ * The tool's result, from the cleaned list and the parsed answer (the google provider's, or an
2453
+ * engine's `searchEngineAnswer`). The model's `summary` is attached only when there are sources,
2454
+ * none of them carries a snippet and none was filtered out: a summary cannot be cut to the sources
2455
+ * that remain. The answer's `note` goes with every result list, cleaned and cut.
2352
2456
  */
2353
2457
  declare const searchToolResult: (query: string, clean: ISanitizedSearch, answer?: ISearchAnswer) => ISearchToolResult;
2354
2458
 
@@ -2365,7 +2469,9 @@ interface ISearchConfig {
2365
2469
  /**
2366
2470
  * A search engine of your own: `(query, { maxResults, freshness, signal }) => results`. Its
2367
2471
  * requests are yours (like a tool you pass); its results are cleaned, capped and filtered like
2368
- * the provider's. Exactly one of `engine` / `provider`.
2472
+ * the provider's. It may answer `{ results, usage?, summary?, note? }` instead of a bare list:
2473
+ * `usage` (the tokens a search through a model spent) is charged to the run as phase 'search'.
2474
+ * Exactly one of `engine` / `provider`.
2369
2475
  */
2370
2476
  engine?: SearchEngine;
2371
2477
  /**
@@ -2505,6 +2611,13 @@ type MediaTranscriptionModel = Exclude<TranscriptionModel, string>;
2505
2611
  interface IMediaConfig {
2506
2612
  /** Mounts `generate_image` (a prompt becomes an image file in the workspace). */
2507
2613
  imageModel?: MediaImageModel | IMediaModelSpec;
2614
+ /**
2615
+ * Whether the image model takes reference pictures (`generate_image`'s `images`: files of the
2616
+ * workspace it SEES - the person's photo, "like this"). Default: what the model object declares
2617
+ * (`supportsFileInputs`, the AI SDK's own capability; unknown counts as no). When it takes none,
2618
+ * a call with `images` makes the picture from the text alone and its result says so.
2619
+ */
2620
+ imageInputs?: boolean;
2508
2621
  /** Mounts `generate_speech` (text becomes an audio file in the workspace). */
2509
2622
  speechModel?: MediaSpeechModel | IMediaModelSpec;
2510
2623
  /**
@@ -2542,6 +2655,11 @@ interface IMediaFile {
2542
2655
  path: string;
2543
2656
  mediaType: string;
2544
2657
  bytes: number;
2658
+ /**
2659
+ * `generate_image` called with `images`: whether they were sent (`used`), how many, which
2660
+ * paths, and - when they were not - the sentence the model reads. Absent without `images`.
2661
+ */
2662
+ references?: IReferenceResult;
2545
2663
  }
2546
2664
  /** What `transcribe_audio` returns. */
2547
2665
  interface ITranscription {
@@ -4637,50 +4755,6 @@ declare const defineTool: <INPUT = unknown, OUTPUT = unknown>(config: Tool<INPUT
4637
4755
  readOnly?: boolean;
4638
4756
  }) => AgentTool;
4639
4757
 
4640
- declare const GENERATE_IMAGE_TOOL = "generate_image";
4641
- declare const GENERATE_SPEECH_TOOL = "generate_speech";
4642
- declare const TRANSCRIBE_AUDIO_TOOL = "transcribe_audio";
4643
- type MediaKind = 'image' | 'speech' | 'transcription';
4644
- declare const MEDIA_DEFAULT_MAX_CALLS = 8;
4645
- declare const MEDIA_TIMEOUT_MS = 120000;
4646
- declare const MEDIA_MAX_IMAGE_BYTES: number;
4647
- declare const MEDIA_MAX_SPEECH_BYTES: number;
4648
- declare const MEDIA_MAX_AUDIO_INPUT_BYTES: number;
4649
- declare const MEDIA_MAX_PROMPT_CHARS = 4000;
4650
- declare const MEDIA_MAX_SPEECH_CHARS = 4000;
4651
- declare const MEDIA_MAX_TRANSCRIPT_CHARS = 20000;
4652
- declare const MEDIA_MAX_ATTACHED_AUDIO = 4;
4653
- declare const MEDIA_FOLDER = "media";
4654
- declare class MediaError extends Error {
4655
- constructor(message: string);
4656
- toJSON(): string;
4657
- }
4658
- declare class MediaBudgetError extends MediaError {
4659
- constructor(cap: number);
4660
- }
4661
- declare const MEDIA_IMAGE_TYPES: Readonly<Record<string, string>>;
4662
- declare const MEDIA_AUDIO_TYPES: Readonly<Record<string, string>>;
4663
- declare const sniffMediaType: (bytes: Uint8Array) => string | undefined;
4664
- interface IAcceptedMedia {
4665
- mediaType: string;
4666
- ext: string;
4667
- }
4668
- declare const acceptMedia: (family: "image" | "audio", bytes: Uint8Array, maxBytes: number, what: string) => IAcceptedMedia;
4669
- interface IMediaUsage {
4670
- mediaCalls: number;
4671
- imagesGenerated: number;
4672
- speechCharacters: number;
4673
- transcriptionSeconds: number;
4674
- }
4675
- declare const mediaUsageOf: (usage: Partial<IMediaUsage> | undefined) => IMediaUsage | undefined;
4676
- interface ITranscriptBlock {
4677
- name: string;
4678
- text: string;
4679
- language?: string;
4680
- durationInSeconds?: number;
4681
- }
4682
- declare const wrapTranscript: (block: ITranscriptBlock) => string;
4683
-
4684
4758
  /**
4685
4759
  * Render a ToolSet into a plain-text catalogue for the prompted/salvage path:
4686
4760
  * `- name(hint): description`. The hint comes from `defineTool({ promptHint })`
@@ -4961,5 +5035,5 @@ declare const postStorageChange: (dbName: string | undefined, change: StorageCha
4961
5035
  */
4962
5036
  declare const onStorageChange: (dbName: string | undefined, listener: (change: StorageChange) => void) => (() => void);
4963
5037
 
4964
- export { APP_SAMPLING_MAX_IMAGES, APP_SAMPLING_MAX_IMAGE_BYTES, APP_SAMPLING_MAX_INPUT_CHARS, APP_SAMPLING_MAX_MESSAGES, APP_SAMPLING_MAX_SYSTEM_CHARS, APP_SAMPLING_MAX_TOKENS, APP_SAMPLING_PER_APP, APP_SAMPLING_PER_MINUTE, APP_SAMPLING_REASONING_TOKENS, APP_SAMPLING_RPC_CODES, ASK_USER_DESCRIPTION_MAX_CHARS, ASK_USER_LABEL_MAX_CHARS, ASK_USER_MAX_OPTIONS, ASK_USER_MAX_PER_RUN, ASK_USER_MIN_OPTIONS, ASK_USER_OTHER_MAX_CHARS, ASK_USER_QUESTION_MAX_CHARS, ASK_USER_TIMEOUT_MAX_MS, ASK_USER_TIMEOUT_MS, ASK_USER_TOOL, AgentTool, AgentToolSet, AppSamplingError, AskUserInputError, AttachmentsNotSupportedError, ContextWindowExceededError, CredentialStore, DECISION_PROVIDERS, DEFAULT_COMPACTION_THRESHOLD_RATIO, DEFAULT_DECISION_CONFIDENCE_THRESHOLD, DEFAULT_DECISION_TIMEOUT_MS, EgressError, FILES_STORE, FIND_TOOLS_NAME, FORGET_SKILL_TOOL, GENERATE_IMAGE_TOOL, GENERATE_SPEECH_TOOL, ImagesNotSupportedError, IndexedDBRunStore, IndexedDBStore, KEYS_STORE, MEDIA_AUDIO_TYPES, MEDIA_DEFAULT_MAX_CALLS, MEDIA_FOLDER, MEDIA_IMAGE_TYPES, MEDIA_MAX_ATTACHED_AUDIO, MEDIA_MAX_AUDIO_INPUT_BYTES, MEDIA_MAX_IMAGE_BYTES, MEDIA_MAX_PROMPT_CHARS, MEDIA_MAX_SPEECH_BYTES, MEDIA_MAX_SPEECH_CHARS, MEDIA_MAX_TRANSCRIPT_CHARS, MEDIA_TIMEOUT_MS, MODEL_TIERS, McpAppToolResult, McpElicitationReason, McpElicitationSchema, McpSkillConsent, McpSkillConsentView, MediaBudgetError, MediaError, MemoryRunStore, MemorySkillStore, MemoryStore, NO_ATTACHMENT_NOTE, PipelineDefinition, PipelineEvent, PipelineNode, PipelineNodeRunner, PipelineResult, PlanSchema, PlanStepSchema, RELAY_MAX_REPLAYS_PER_SECOND, RELAY_MAX_SENDS, RELAY_MAX_SEND_CHARS, RELAY_MAX_STRING, REPLAY_NOTE, RUNS_STORE, ReplanSchema, SAVE_SKILL_TOOL, SEARCH_API_BASE_URL, SEARCH_DEFAULT_MAX_RESULTS, SEARCH_GOOGLE_DEFAULT_MODEL, SEARCH_GOOGLE_NOTE, SEARCH_MAX_QUERY_CHARS, SEARCH_MAX_RESULTS, SEARCH_MAX_SNIPPET_CHARS, SEARCH_MAX_SUMMARY_CHARS, SEARCH_MAX_TITLE_CHARS, SEARCH_MAX_TOTAL_CHARS, SEARCH_MAX_URL_CHARS, SEARCH_PROVIDERS, SECRETS_STORE, SESSIONS_STORE, SESSION_LOCK_MODES, SKILL_TOOL_NAMES, SPAWN_INPUT_SCHEMA, SPAWN_SUBAGENT_TOOL, STORAGE_CHANGE_KINDS, SUBAGENT_DEFAULTS, SUBAGENT_MAX_DEPTH_LIMIT, SessionBusyError, SubagentSpawnError, TOOL_APPROVAL_MODES, TOOL_APPROVAL_TIMEOUT_MS, TOOL_SEARCH_WINDOW_SHARE, TRANSCRIBE_AUDIO_TOOL, TieredPlanSchema, TieredPlanStepSchema, ToolBudgetError, ToolDeniedError, VfsSkillStore, VirtualFileSystem, WEBLLM_DEFAULT_CONTEXT_WINDOW, WEB_FETCH_TOOL, WEB_SEARCH_TOOL, acceptMedia, adoptSubagentEvent, appSamplingRequestOf, appSamplingText, askDecisionModel, attachmentKind, buildMediaModelFromSpec, buildModelFromStage, buildSearchRequest, bytesToBase64, checkAskUserAnswer, checkAskUserInput, checkEgressUrl, checkLimits, classifyAddress, cleanAskUserText, compactHistory, compactSteps, compressHistory, contextOverflowOf, contextWindowOf, createAgent, createAppSamplingLimiter, createEgressTools, createFileTools, createFindToolsTool, createGuardedFetch, createLearning, createLogger, createMedia, createPipeline, createPlan, createRunControl, createSearchTools, createSkillTools, createSubagentTool, createToolResultClearer, createWebFetchTool, createWebLLMModel, createWebSearchTool, decideReplan, decideToolPermission, decisionEgressPolicy, decisionModelFromAiSdk, defaultPrompts, defineSkill, defineTool, directBrowserOk, dispatch, escalationReasonOf, messageTokens as estimateMessagesTokens, estimateTokens, executeStep, fileToolBindingOf, findSecret, fitCompactionToWindow, generate, generateStructured, hostMatches, htmlToText, isAttachmentRefusal, isCodeExecutionTool, isDirectModel, isEscalatableError, isImageRefusal, isProviderSpec, isReadOnlyTool, isReplayedToolOutput, isTextMime, isWebGPUAvailable, learnedPreamble, limitModelOutput, loadSkillFromUrl, looksLikeJson, markCodeExecution, markReadOnly, matchRule, mediaTypeOf, mediaUsageOf, mergeProviderOptions, mimeFromPath, nextStrongerTier, nodeResolver, normalizePath, normalizeSkillName, normalizeSteps, normalizeUsage, onStorageChange, openAgentWebDB, outputCapNotice, parseExecutorResponse, parsePlainText, parsePlannerResponse, parseReplannerResponse, parseSearchResponse, parseSkillMarkdown, pickPipelineRoute, pickTier, postStorageChange, preloadWebLLMModel, renderActiveSkills, renderCatalog, renderSearchCatalog, renderSkillIndex, replanWanted, resolveAppSampling, resolveBudgets, resolveCaching, resolveCompaction, resolveConfig, resolveDecisionModel, resolveDynamicSubagents, resolveEgressPolicy, resolveEscalation, resolveModel, resolveResume, resolveStage, resolveThinking, runToolLoop, sanitizeSearchResults, schemaHintOf, searchEgressPolicy, searchStatusMessage, searchToolResult, searchTools, selectToolMode, serveSubagentWorker, shouldReplan, skillPreamble, sniffMediaType, splitBlocker, stageOutputCap, stageReasons, stream, supportsImages, supportsNativeTools, supportsPdf, supportsStructuredOutput, synthesizeAnswer, thinkingFor, toFilePart, toImagePart, tokenize, toolCatalogOf, toolDefinitionTokens, toolRunContextOf, unloadWebLLMModel, watchSession, webLLMContextWindow, withRollingBreakpoint, withSystem, withWebLLMContextWindow, wrapTranscript };
4965
- export type { Agent, AgentContext, AgentEvent, AgentEventHandler, AgentLogger, AgentLoggerSink, AgentWebDBOptions, AppSamplingErrorCode, AppSamplingImage, AppSamplingMessage, AppSamplingOptions, AppSamplingRequest, AppSamplingResult, AppSamplingSettings, AppSamplingView, AppToolCallRequest, AskUserAction, AskUserAnswer, AskUserCheckedAnswer, AskUserConfig, AskUserContext, AskUserHandler, AskUserOption, AskUserQuestion, AskUserReason, AskUserRequest, AttachmentKind, BrowserAgentConfig, ClearedInfo, CompactOptions, CompactResult, CompactionConfig, CompressOptions, ContextStore, DecisionFallbackReason, DecisionPoint, EffectiveToolStrategy, EgressErrorCode, EscalationConfig, EscalationReason, ExecutorPromptContext, ExecutorResult, FileToolBinding, FileToolsOptions, GenerateOptions, GuardedFetch, IAiSdkDecisionOptions, IDecisionAnswer, IDecisionCallOptions, IDecisionConfig, IDecisionEvent, IDecisionModel, IDecisionModelSpec, IDecisionOption, IDecisionOutcome, IDecisionQuestion, IDynamicSubagentsConfig, IEgressPolicy, IMedia, IMediaConfig, IMediaFile, IMediaModelSpec, IMediaOptions, IMediaRun, IMediaUsage, IPlan, IPlanStep, IResolvedDynamicSubagents, IResolvedEgressPolicy, ISandboxConfig, ISandboxError, ISandboxLimits, ISandboxResult, ISanitizedSearch, ISearchAnswer, ISearchConfig, ISearchOptions, ISearchRequest, ISearchResult, ISearchToolResult, ISearchUsage, IStepEscalation, IStepResult, ISubagentsConfig, IToolCall, ITranscription, IUsage, IWebFetchOptions, IWebSearchOptions, IndexedDBRunStoreOptions, IndexedDBStoreOptions, Learning, LearningConfig, LimitBreach, LimitKind, LoadSkillOptions, LogLevel, McpSkillOrigin, MediaImageModel, MediaKind, MediaModelKind, MediaSpeechModel, MediaTranscriptionModel, MessageEndpoint, ModelInput, ModelTier, NodeResolverOptions, OutputCap, ParentToWorker, Phase, PhaseBudgets, Pipeline, PipelineOptions, PipelineRouteOptions, PipelineRouteResult, PipelineRunOptions, PlanShape, PlannerPromptContext, PlannerResult, PromptCachingSetting, PromptParts, Prompts, ProviderModelSpec, ProviderOptionsMap, ProviderType, ProxiedToolSpec, RawAction, ReplanDecision, ReplanMode, ReplanShape, ReplanTrigger, ReplannerPromptContext, ReplannerResult, ResolvedCaching, ResolvedCompaction, ResolvedConfig, ResolvedStage, ResolvedThinking, RunControl, RunFile, RunImage, RunOptions, RunPersistence, RunResult, RunSnapshot, RunStatus, RunStoreOptions, SandboxConfig, SandboxWorkerLike, SaveSkillInput, SearchEngine, SearchFreshness, SearchProvider, SearchToolsOptions, ServeSubagentOptions, SessionHolder, SessionLockMode, SessionRunState, SessionWatch, Skill, SkillOrigin, SkillStore, StageInput, StageOverride, StepComplexity, StorageChange, StorageChangeKind, StorageChangeOp, StoredMessage, StructuredResult, SubagentDefaultTools, SubagentInfo, SubagentProfile, SubagentToolOptions, SubagentWorkerConfig, SynthesizerPromptContext, ThinkingConfig, ThinkingLevel, ThinkingSetting, ThinkingStage, TierReason, TokenLimits, ToolApprovalApp, ToolApprovalConfig, ToolApprovalContext, ToolApprovalDecision, ToolApprovalMode, ToolApprovalRequest, ToolCallMode, ToolCatalogEntry, ToolLoopCallbacks, ToolLoopOptions, ToolLoopResult, ToolMode, ToolPermission, ToolResultClearing, ToolRunContext, ToolSelectionStrategy, UsagePhase, VfsListener, VirtualFile, VirtualFileInfo, VirtualFileSystemOptions, WatchSessionOptions, WebLLMAppConfigLike, WebLLMModelOptions, WorkerLike, WorkerToParent };
5038
+ export { APP_SAMPLING_MAX_IMAGES, APP_SAMPLING_MAX_IMAGE_BYTES, APP_SAMPLING_MAX_INPUT_CHARS, APP_SAMPLING_MAX_MESSAGES, APP_SAMPLING_MAX_SYSTEM_CHARS, APP_SAMPLING_MAX_TOKENS, APP_SAMPLING_PER_APP, APP_SAMPLING_PER_MINUTE, APP_SAMPLING_REASONING_TOKENS, APP_SAMPLING_RPC_CODES, ASK_USER_DESCRIPTION_MAX_CHARS, ASK_USER_LABEL_MAX_CHARS, ASK_USER_MAX_OPTIONS, ASK_USER_MAX_PER_RUN, ASK_USER_MIN_OPTIONS, ASK_USER_OTHER_MAX_CHARS, ASK_USER_QUESTION_MAX_CHARS, ASK_USER_TIMEOUT_MAX_MS, ASK_USER_TIMEOUT_MS, ASK_USER_TOOL, AgentTool, AgentToolSet, AppSamplingError, AskUserInputError, AttachmentsNotSupportedError, ContextWindowExceededError, CredentialStore, DECISION_PROVIDERS, DEFAULT_COMPACTION_THRESHOLD_RATIO, DEFAULT_DECISION_CONFIDENCE_THRESHOLD, DEFAULT_DECISION_TIMEOUT_MS, EgressError, FILES_STORE, FIND_TOOLS_NAME, FORGET_SKILL_TOOL, GENERATE_IMAGE_TOOL, GENERATE_SPEECH_TOOL, ImagesNotSupportedError, IndexedDBRunStore, IndexedDBStore, KEYS_STORE, MEDIA_AUDIO_TYPES, MEDIA_DEFAULT_MAX_CALLS, MEDIA_FOLDER, MEDIA_IMAGE_TYPES, MEDIA_MAX_ATTACHED_AUDIO, MEDIA_MAX_AUDIO_INPUT_BYTES, MEDIA_MAX_IMAGE_BYTES, MEDIA_MAX_PROMPT_CHARS, MEDIA_MAX_REFERENCE_BYTES, MEDIA_MAX_REFERENCE_IMAGES, MEDIA_MAX_REFERENCE_SIDE, MEDIA_MAX_REFERENCE_TOTAL_BYTES, MEDIA_MAX_SPEECH_BYTES, MEDIA_MAX_SPEECH_CHARS, MEDIA_MAX_TRANSCRIPT_CHARS, MEDIA_REFERENCE_TYPES, MEDIA_TIMEOUT_MS, MODEL_TIERS, McpAppToolResult, McpElicitationReason, McpElicitationSchema, McpSkillConsent, McpSkillConsentView, MediaBudgetError, MediaError, MemoryRunStore, MemorySkillStore, MemoryStore, NO_ATTACHMENT_NOTE, PipelineDefinition, PipelineEvent, PipelineNode, PipelineNodeRunner, PipelineResult, PlanSchema, PlanStepSchema, RELAY_MAX_REPLAYS_PER_SECOND, RELAY_MAX_SENDS, RELAY_MAX_SEND_CHARS, RELAY_MAX_STRING, REPLAY_NOTE, RUNS_STORE, ReplanSchema, SAVE_SKILL_TOOL, SEARCH_API_BASE_URL, SEARCH_DEFAULT_MAX_RESULTS, SEARCH_GOOGLE_DEFAULT_MODEL, SEARCH_GOOGLE_NOTE, SEARCH_MAX_NOTE_CHARS, SEARCH_MAX_QUERY_CHARS, SEARCH_MAX_RESULTS, SEARCH_MAX_SNIPPET_CHARS, SEARCH_MAX_SUMMARY_CHARS, SEARCH_MAX_TITLE_CHARS, SEARCH_MAX_TOTAL_CHARS, SEARCH_MAX_URL_CHARS, SEARCH_PROVIDERS, SECRETS_STORE, SESSIONS_STORE, SESSION_LOCK_MODES, SKILL_TOOL_NAMES, SPAWN_INPUT_SCHEMA, SPAWN_SUBAGENT_TOOL, STORAGE_CHANGE_KINDS, SUBAGENT_DEFAULTS, SUBAGENT_MAX_DEPTH_LIMIT, SessionBusyError, SubagentSpawnError, TOOL_APPROVAL_MODES, TOOL_APPROVAL_TIMEOUT_MS, TOOL_SEARCH_WINDOW_SHARE, TRANSCRIBE_AUDIO_TOOL, TieredPlanSchema, TieredPlanStepSchema, ToolBudgetError, ToolDeniedError, VfsSkillStore, VirtualFileSystem, WEBLLM_DEFAULT_CONTEXT_WINDOW, WEB_FETCH_TOOL, WEB_SEARCH_TOOL, acceptMedia, acceptReference, adoptSubagentEvent, appSamplingRequestOf, appSamplingText, askDecisionModel, attachmentKind, buildMediaModelFromSpec, buildModelFromStage, buildSearchRequest, bytesToBase64, checkAskUserAnswer, checkAskUserInput, checkEgressUrl, checkLimits, classifyAddress, cleanAskUserText, compactHistory, compactSteps, compressHistory, contextOverflowOf, contextWindowOf, createAgent, createAppSamplingLimiter, createEgressTools, createFileTools, createFindToolsTool, createGuardedFetch, createLearning, createLogger, createMedia, createPipeline, createPlan, createRunControl, createSearchTools, createSkillTools, createSubagentTool, createToolResultClearer, createWebFetchTool, createWebLLMModel, createWebSearchTool, decideReplan, decideToolPermission, decisionEgressPolicy, decisionModelFromAiSdk, defaultPrompts, defineSkill, defineTool, directBrowserOk, dispatch, escalationReasonOf, messageTokens as estimateMessagesTokens, estimateTokens, executeStep, fileToolBindingOf, findSecret, fitCompactionToWindow, generate, generateStructured, hostMatches, htmlToText, imageDimensions, isAttachmentRefusal, isCodeExecutionTool, isDirectModel, isEscalatableError, isImageRefusal, isProviderSpec, isReadOnlyTool, isReplayedToolOutput, isTextMime, isWebGPUAvailable, learnedPreamble, limitModelOutput, loadSkillFromUrl, looksLikeJson, markCodeExecution, markReadOnly, matchRule, mediaTypeOf, mediaUsageOf, mergeProviderOptions, mimeFromPath, nextStrongerTier, nodeResolver, normalizePath, normalizeSkillName, normalizeSteps, normalizeUsage, onStorageChange, openAgentWebDB, outputCapNotice, parseExecutorResponse, parsePlainText, parsePlannerResponse, parseReplannerResponse, parseSearchResponse, parseSkillMarkdown, pickPipelineRoute, pickTier, postStorageChange, preloadWebLLMModel, renderActiveSkills, renderCatalog, renderSearchCatalog, renderSkillIndex, replanWanted, resolveAppSampling, resolveBudgets, resolveCaching, resolveCompaction, resolveConfig, resolveDecisionModel, resolveDynamicSubagents, resolveEgressPolicy, resolveEscalation, resolveModel, resolveResume, resolveStage, resolveThinking, runToolLoop, sanitizeSearchResults, schemaHintOf, searchEgressPolicy, searchEngineAnswer, searchStatusMessage, searchToolResult, searchTools, searchUsageOf, selectToolMode, serveSubagentWorker, shouldReplan, skillPreamble, sniffMediaType, splitBlocker, stageOutputCap, stageReasons, stream, supportsImages, supportsNativeTools, supportsPdf, supportsStructuredOutput, synthesizeAnswer, thinkingFor, toFilePart, toImagePart, tokenize, toolCatalogOf, toolDefinitionTokens, toolRunContextOf, unloadWebLLMModel, watchSession, webLLMContextWindow, withRollingBreakpoint, withSystem, withWebLLMContextWindow, wrapTranscript };
5039
+ export type { Agent, AgentContext, AgentEvent, AgentEventHandler, AgentLogger, AgentLoggerSink, AgentWebDBOptions, AppSamplingErrorCode, AppSamplingImage, AppSamplingMessage, AppSamplingOptions, AppSamplingRequest, AppSamplingResult, AppSamplingSettings, AppSamplingView, AppToolCallRequest, AskUserAction, AskUserAnswer, AskUserCheckedAnswer, AskUserConfig, AskUserContext, AskUserHandler, AskUserOption, AskUserQuestion, AskUserReason, AskUserRequest, AttachmentKind, BrowserAgentConfig, ClearedInfo, CompactOptions, CompactResult, CompactionConfig, CompressOptions, ContextStore, DecisionFallbackReason, DecisionPoint, EffectiveToolStrategy, EgressErrorCode, EscalationConfig, EscalationReason, ExecutorPromptContext, ExecutorResult, FileToolBinding, FileToolsOptions, GenerateOptions, GuardedFetch, IAiSdkDecisionOptions, IDecisionAnswer, IDecisionCallOptions, IDecisionConfig, IDecisionEvent, IDecisionModel, IDecisionModelSpec, IDecisionOption, IDecisionOutcome, IDecisionQuestion, IDynamicSubagentsConfig, IEgressPolicy, IImageSize, IMedia, IMediaConfig, IMediaFile, IMediaModelSpec, IMediaOptions, IMediaRun, IMediaUsage, IPlan, IPlanStep, IReferenceUse, IResolvedDynamicSubagents, IResolvedEgressPolicy, ISandboxConfig, ISandboxError, ISandboxLimits, ISandboxResult, ISanitizedSearch, ISearchAnswer, ISearchConfig, ISearchEngineAnswer, ISearchOptions, ISearchRequest, ISearchResult, ISearchToolResult, ISearchUsage, IStepEscalation, IStepResult, ISubagentsConfig, IToolCall, ITranscription, IUsage, IWebFetchOptions, IWebSearchOptions, IndexedDBRunStoreOptions, IndexedDBStoreOptions, Learning, LearningConfig, LimitBreach, LimitKind, LoadSkillOptions, LogLevel, McpSkillOrigin, MediaImageModel, MediaKind, MediaModelKind, MediaSpeechModel, MediaTranscriptionModel, MessageEndpoint, ModelInput, ModelTier, NodeResolverOptions, OutputCap, ParentToWorker, Phase, PhaseBudgets, Pipeline, PipelineOptions, PipelineRouteOptions, PipelineRouteResult, PipelineRunOptions, PlanShape, PlannerPromptContext, PlannerResult, PromptCachingSetting, PromptParts, Prompts, ProviderModelSpec, ProviderOptionsMap, ProviderType, ProxiedToolSpec, RawAction, ReplanDecision, ReplanMode, ReplanShape, ReplanTrigger, ReplannerPromptContext, ReplannerResult, ResolvedCaching, ResolvedCompaction, ResolvedConfig, ResolvedStage, ResolvedThinking, RunControl, RunFile, RunImage, RunOptions, RunPersistence, RunResult, RunSnapshot, RunStatus, RunStoreOptions, SandboxConfig, SandboxWorkerLike, SaveSkillInput, SearchEngine, SearchFreshness, SearchProvider, SearchToolsOptions, ServeSubagentOptions, SessionHolder, SessionLockMode, SessionRunState, SessionWatch, Skill, SkillOrigin, SkillStore, StageInput, StageOverride, StepComplexity, StorageChange, StorageChangeKind, StorageChangeOp, StoredMessage, StructuredResult, SubagentDefaultTools, SubagentInfo, SubagentProfile, SubagentToolOptions, SubagentWorkerConfig, SynthesizerPromptContext, ThinkingConfig, ThinkingLevel, ThinkingSetting, ThinkingStage, TierReason, TokenLimits, ToolApprovalApp, ToolApprovalConfig, ToolApprovalContext, ToolApprovalDecision, ToolApprovalMode, ToolApprovalRequest, ToolCallMode, ToolCatalogEntry, ToolLoopCallbacks, ToolLoopOptions, ToolLoopResult, ToolMode, ToolPermission, ToolResultClearing, ToolRunContext, ToolSelectionStrategy, UsagePhase, VfsListener, VirtualFile, VirtualFileInfo, VirtualFileSystemOptions, WatchSessionOptions, WebLLMAppConfigLike, WebLLMModelOptions, WorkerLike, WorkerToParent };
package/dist/index.d.ts CHANGED
@@ -828,6 +828,71 @@ declare const checkAskUserAnswer: (q: AskUserQuestion, raw: unknown) => {
828
828
  reason: string;
829
829
  };
830
830
 
831
+ declare const GENERATE_IMAGE_TOOL = "generate_image";
832
+ declare const GENERATE_SPEECH_TOOL = "generate_speech";
833
+ declare const TRANSCRIBE_AUDIO_TOOL = "transcribe_audio";
834
+ type MediaKind = 'image' | 'speech' | 'transcription';
835
+ declare const MEDIA_DEFAULT_MAX_CALLS = 8;
836
+ declare const MEDIA_TIMEOUT_MS = 120000;
837
+ declare const MEDIA_MAX_IMAGE_BYTES: number;
838
+ declare const MEDIA_MAX_SPEECH_BYTES: number;
839
+ declare const MEDIA_MAX_AUDIO_INPUT_BYTES: number;
840
+ declare const MEDIA_MAX_PROMPT_CHARS = 4000;
841
+ declare const MEDIA_MAX_SPEECH_CHARS = 4000;
842
+ declare const MEDIA_MAX_TRANSCRIPT_CHARS = 20000;
843
+ declare const MEDIA_MAX_ATTACHED_AUDIO = 4;
844
+ declare const MEDIA_MAX_REFERENCE_IMAGES = 4;
845
+ declare const MEDIA_MAX_REFERENCE_BYTES: number;
846
+ declare const MEDIA_MAX_REFERENCE_TOTAL_BYTES: number;
847
+ declare const MEDIA_MAX_REFERENCE_SIDE = 4096;
848
+ declare const MEDIA_FOLDER = "media";
849
+ declare class MediaError extends Error {
850
+ constructor(message: string);
851
+ toJSON(): string;
852
+ }
853
+ declare class MediaBudgetError extends MediaError {
854
+ constructor(cap: number);
855
+ }
856
+ declare const MEDIA_IMAGE_TYPES: Readonly<Record<string, string>>;
857
+ declare const MEDIA_AUDIO_TYPES: Readonly<Record<string, string>>;
858
+ declare const MEDIA_REFERENCE_TYPES: Readonly<Record<string, string>>;
859
+ declare const sniffMediaType: (bytes: Uint8Array) => string | undefined;
860
+ interface IAcceptedMedia {
861
+ mediaType: string;
862
+ ext: string;
863
+ }
864
+ declare const acceptMedia: (family: "image" | "audio", bytes: Uint8Array, maxBytes: number, what: string) => IAcceptedMedia;
865
+ interface IImageSize {
866
+ width: number;
867
+ height: number;
868
+ }
869
+ declare const imageDimensions: (bytes: Uint8Array) => IImageSize | undefined;
870
+ interface IAcceptedReference extends IAcceptedMedia, IImageSize {
871
+ }
872
+ declare const acceptReference: (bytes: Uint8Array, what: string) => IAcceptedReference;
873
+ interface IReferenceUse {
874
+ used: boolean;
875
+ count: number;
876
+ paths: string[];
877
+ }
878
+ interface IReferenceResult extends IReferenceUse {
879
+ note?: string;
880
+ }
881
+ interface IMediaUsage {
882
+ mediaCalls: number;
883
+ imagesGenerated: number;
884
+ speechCharacters: number;
885
+ transcriptionSeconds: number;
886
+ }
887
+ declare const mediaUsageOf: (usage: Partial<IMediaUsage> | undefined) => IMediaUsage | undefined;
888
+ interface ITranscriptBlock {
889
+ name: string;
890
+ text: string;
891
+ language?: string;
892
+ durationInSeconds?: number;
893
+ }
894
+ declare const wrapTranscript: (block: ITranscriptBlock) => string;
895
+
831
896
  type ReplanMode = 'continue' | 'revise' | 'finish';
832
897
  type Phase = 'plan' | 'execute' | 'replan' | 'synthesize';
833
898
  /**
@@ -1011,7 +1076,9 @@ type AgentEventBody =
1011
1076
  /**
1012
1077
  * A media tool (`config.media`) wrote a file to the virtual file system: `path` is where (read
1013
1078
  * it with `vfs.readDataUrl(path)` to show the picture or play the audio), `mediaType` what its
1014
- * bytes are, `bytes` its size. The bytes themselves are never in an event.
1079
+ * bytes are, `bytes` its size. `references`: a `generate_image` call with `images` - whether
1080
+ * those pictures were sent (`used`; false: the model takes none), how many and their paths.
1081
+ * The bytes themselves are never in an event.
1015
1082
  */
1016
1083
  | {
1017
1084
  type: 'media.generated';
@@ -1020,6 +1087,7 @@ type AgentEventBody =
1020
1087
  mediaType: string;
1021
1088
  bytes: number;
1022
1089
  model: string;
1090
+ references?: IReferenceUse;
1023
1091
  step?: IPlanStep;
1024
1092
  }
1025
1093
  /**
@@ -2238,10 +2306,29 @@ interface ISearchOptions {
2238
2306
  signal?: AbortSignal;
2239
2307
  }
2240
2308
  /**
2241
- * A search engine of the host's own: any function that answers a query with results. What it
2242
- * returns is treated like a built-in adapter's answer - cleaned, capped and filtered.
2309
+ * What a search engine function may answer in place of a bare list, when the search ran through a
2310
+ * model - a provider's server-side search tool, one model call: the results, what the call spent,
2311
+ * the model's own answer and a line on what the results are. Every field is checked as the rest of
2312
+ * an engine's answer is (`searchEngineAnswer`).
2243
2313
  */
2244
- type SearchEngine = (query: string, options: ISearchOptions) => Promise<ISearchResult[]>;
2314
+ interface ISearchEngineAnswer {
2315
+ results: ISearchResult[];
2316
+ /**
2317
+ * The model tokens the search spent, as its API reported them: charged to the run like the
2318
+ * google provider's (a `usage` event of phase 'search', in every total and against the limits).
2319
+ */
2320
+ usage?: ISearchUsage;
2321
+ /** The model's answer from its sources: the model sees it, cut, when no result has a snippet. */
2322
+ summary?: string;
2323
+ /** One line on what the results are - whose search, what the snippets are - for the model. */
2324
+ note?: string;
2325
+ }
2326
+ /**
2327
+ * A search engine of the host's own: any function that answers a query with results - a bare
2328
+ * list, or an `ISearchEngineAnswer` with what the search spent. What it returns is treated like a
2329
+ * built-in adapter's answer - cleaned, capped and filtered.
2330
+ */
2331
+ type SearchEngine = (query: string, options: ISearchOptions) => Promise<ISearchResult[] | ISearchEngineAnswer>;
2245
2332
  /**
2246
2333
  * The built-in provider. One: Google Search through the Gemini API's grounding (`google_search`),
2247
2334
  * which needs a Gemini (Google AI Studio) key and nothing else. Any other search API is the
@@ -2258,6 +2345,8 @@ declare const SEARCH_API_BASE_URL: Record<SearchProvider, string>;
2258
2345
  declare const SEARCH_GOOGLE_DEFAULT_MODEL = "gemini-2.5-flash-lite";
2259
2346
  /** The most of the grounding model's answer a model sees as `summary`. */
2260
2347
  declare const SEARCH_MAX_SUMMARY_CHARS = 1000;
2348
+ /** The most of a result list's `note` (what the results are) a model sees. */
2349
+ declare const SEARCH_MAX_NOTE_CHARS = 300;
2261
2350
  /** Said in every result of the google provider: what its URLs and its text are. */
2262
2351
  declare const SEARCH_GOOGLE_NOTE: string;
2263
2352
  /** One HTTP call to a search API. The key, if any, is in `headers` only - never in the URL. */
@@ -2293,6 +2382,8 @@ interface ISearchAnswer {
2293
2382
  summary?: unknown;
2294
2383
  /** Absent when the API reported none. */
2295
2384
  usage?: ISearchUsage;
2385
+ /** What the results are (the google provider's `SEARCH_GOOGLE_NOTE`, an engine's own line). */
2386
+ note?: string;
2296
2387
  }
2297
2388
  /**
2298
2389
  * The request for one query, per the Gemini API's public documentation:
@@ -2310,6 +2401,18 @@ declare const buildSearchRequest: (input: ISearchRequestInput) => ISearchRequest
2310
2401
  * what makes them safe to show.
2311
2402
  */
2312
2403
  declare const parseSearchResponse: (provider: SearchProvider, json: unknown) => ISearchAnswer;
2404
+ /**
2405
+ * What a search spent, as an engine reported it: whole non-negative token counts (anything else
2406
+ * is 0), the total their sum, reasoning never more than the output. Undefined when it spent none.
2407
+ */
2408
+ declare const searchUsageOf: (raw: unknown) => ISearchUsage | undefined;
2409
+ /**
2410
+ * An engine's answer as the tool reads it. A bare list is the results and nothing else (no usage,
2411
+ * no summary, no note); an `ISearchEngineAnswer` gives its `results` and - checked - its usage
2412
+ * (`searchUsageOf`), its summary (a string; cleaned and cut when it is shown) and its note (cleaned
2413
+ * and cut here). Anything else is no results. Still raw until `sanitizeSearchResults`.
2414
+ */
2415
+ declare const searchEngineAnswer: (raw: unknown) => ISearchAnswer;
2313
2416
  /**
2314
2417
  * What a failed call says to the model: the provider, the model, the status, the API's own error
2315
2418
  * code word and what it usually means. Never the error's text: that is third-party text, and may
@@ -2337,18 +2440,19 @@ declare const sanitizeSearchResults: (raw: unknown, options?: {
2337
2440
  interface ISearchToolResult {
2338
2441
  query: string;
2339
2442
  results: ISearchResult[];
2340
- /** The google provider, when no source came with a snippet: the grounding model's answer, cut. */
2443
+ /** When no source came with a snippet: the grounding (or engine's) model's answer, cut. */
2341
2444
  summary?: string;
2342
- /** The google provider: what its URLs and its text are. */
2445
+ /** What the URLs and the text are: the google provider's note, or an engine's own line. */
2343
2446
  note?: string;
2344
2447
  filtered?: number;
2345
2448
  truncated?: true;
2346
2449
  untrusted: true;
2347
2450
  }
2348
2451
  /**
2349
- * The tool's result, from the cleaned list and - for the google provider - the parsed answer.
2350
- * The model's `summary` is attached only when there are sources, none of them carries a snippet
2351
- * and none was filtered out: a summary cannot be cut to the sources that remain.
2452
+ * The tool's result, from the cleaned list and the parsed answer (the google provider's, or an
2453
+ * engine's `searchEngineAnswer`). The model's `summary` is attached only when there are sources,
2454
+ * none of them carries a snippet and none was filtered out: a summary cannot be cut to the sources
2455
+ * that remain. The answer's `note` goes with every result list, cleaned and cut.
2352
2456
  */
2353
2457
  declare const searchToolResult: (query: string, clean: ISanitizedSearch, answer?: ISearchAnswer) => ISearchToolResult;
2354
2458
 
@@ -2365,7 +2469,9 @@ interface ISearchConfig {
2365
2469
  /**
2366
2470
  * A search engine of your own: `(query, { maxResults, freshness, signal }) => results`. Its
2367
2471
  * requests are yours (like a tool you pass); its results are cleaned, capped and filtered like
2368
- * the provider's. Exactly one of `engine` / `provider`.
2472
+ * the provider's. It may answer `{ results, usage?, summary?, note? }` instead of a bare list:
2473
+ * `usage` (the tokens a search through a model spent) is charged to the run as phase 'search'.
2474
+ * Exactly one of `engine` / `provider`.
2369
2475
  */
2370
2476
  engine?: SearchEngine;
2371
2477
  /**
@@ -2505,6 +2611,13 @@ type MediaTranscriptionModel = Exclude<TranscriptionModel, string>;
2505
2611
  interface IMediaConfig {
2506
2612
  /** Mounts `generate_image` (a prompt becomes an image file in the workspace). */
2507
2613
  imageModel?: MediaImageModel | IMediaModelSpec;
2614
+ /**
2615
+ * Whether the image model takes reference pictures (`generate_image`'s `images`: files of the
2616
+ * workspace it SEES - the person's photo, "like this"). Default: what the model object declares
2617
+ * (`supportsFileInputs`, the AI SDK's own capability; unknown counts as no). When it takes none,
2618
+ * a call with `images` makes the picture from the text alone and its result says so.
2619
+ */
2620
+ imageInputs?: boolean;
2508
2621
  /** Mounts `generate_speech` (text becomes an audio file in the workspace). */
2509
2622
  speechModel?: MediaSpeechModel | IMediaModelSpec;
2510
2623
  /**
@@ -2542,6 +2655,11 @@ interface IMediaFile {
2542
2655
  path: string;
2543
2656
  mediaType: string;
2544
2657
  bytes: number;
2658
+ /**
2659
+ * `generate_image` called with `images`: whether they were sent (`used`), how many, which
2660
+ * paths, and - when they were not - the sentence the model reads. Absent without `images`.
2661
+ */
2662
+ references?: IReferenceResult;
2545
2663
  }
2546
2664
  /** What `transcribe_audio` returns. */
2547
2665
  interface ITranscription {
@@ -4637,50 +4755,6 @@ declare const defineTool: <INPUT = unknown, OUTPUT = unknown>(config: Tool<INPUT
4637
4755
  readOnly?: boolean;
4638
4756
  }) => AgentTool;
4639
4757
 
4640
- declare const GENERATE_IMAGE_TOOL = "generate_image";
4641
- declare const GENERATE_SPEECH_TOOL = "generate_speech";
4642
- declare const TRANSCRIBE_AUDIO_TOOL = "transcribe_audio";
4643
- type MediaKind = 'image' | 'speech' | 'transcription';
4644
- declare const MEDIA_DEFAULT_MAX_CALLS = 8;
4645
- declare const MEDIA_TIMEOUT_MS = 120000;
4646
- declare const MEDIA_MAX_IMAGE_BYTES: number;
4647
- declare const MEDIA_MAX_SPEECH_BYTES: number;
4648
- declare const MEDIA_MAX_AUDIO_INPUT_BYTES: number;
4649
- declare const MEDIA_MAX_PROMPT_CHARS = 4000;
4650
- declare const MEDIA_MAX_SPEECH_CHARS = 4000;
4651
- declare const MEDIA_MAX_TRANSCRIPT_CHARS = 20000;
4652
- declare const MEDIA_MAX_ATTACHED_AUDIO = 4;
4653
- declare const MEDIA_FOLDER = "media";
4654
- declare class MediaError extends Error {
4655
- constructor(message: string);
4656
- toJSON(): string;
4657
- }
4658
- declare class MediaBudgetError extends MediaError {
4659
- constructor(cap: number);
4660
- }
4661
- declare const MEDIA_IMAGE_TYPES: Readonly<Record<string, string>>;
4662
- declare const MEDIA_AUDIO_TYPES: Readonly<Record<string, string>>;
4663
- declare const sniffMediaType: (bytes: Uint8Array) => string | undefined;
4664
- interface IAcceptedMedia {
4665
- mediaType: string;
4666
- ext: string;
4667
- }
4668
- declare const acceptMedia: (family: "image" | "audio", bytes: Uint8Array, maxBytes: number, what: string) => IAcceptedMedia;
4669
- interface IMediaUsage {
4670
- mediaCalls: number;
4671
- imagesGenerated: number;
4672
- speechCharacters: number;
4673
- transcriptionSeconds: number;
4674
- }
4675
- declare const mediaUsageOf: (usage: Partial<IMediaUsage> | undefined) => IMediaUsage | undefined;
4676
- interface ITranscriptBlock {
4677
- name: string;
4678
- text: string;
4679
- language?: string;
4680
- durationInSeconds?: number;
4681
- }
4682
- declare const wrapTranscript: (block: ITranscriptBlock) => string;
4683
-
4684
4758
  /**
4685
4759
  * Render a ToolSet into a plain-text catalogue for the prompted/salvage path:
4686
4760
  * `- name(hint): description`. The hint comes from `defineTool({ promptHint })`
@@ -4961,5 +5035,5 @@ declare const postStorageChange: (dbName: string | undefined, change: StorageCha
4961
5035
  */
4962
5036
  declare const onStorageChange: (dbName: string | undefined, listener: (change: StorageChange) => void) => (() => void);
4963
5037
 
4964
- export { APP_SAMPLING_MAX_IMAGES, APP_SAMPLING_MAX_IMAGE_BYTES, APP_SAMPLING_MAX_INPUT_CHARS, APP_SAMPLING_MAX_MESSAGES, APP_SAMPLING_MAX_SYSTEM_CHARS, APP_SAMPLING_MAX_TOKENS, APP_SAMPLING_PER_APP, APP_SAMPLING_PER_MINUTE, APP_SAMPLING_REASONING_TOKENS, APP_SAMPLING_RPC_CODES, ASK_USER_DESCRIPTION_MAX_CHARS, ASK_USER_LABEL_MAX_CHARS, ASK_USER_MAX_OPTIONS, ASK_USER_MAX_PER_RUN, ASK_USER_MIN_OPTIONS, ASK_USER_OTHER_MAX_CHARS, ASK_USER_QUESTION_MAX_CHARS, ASK_USER_TIMEOUT_MAX_MS, ASK_USER_TIMEOUT_MS, ASK_USER_TOOL, AgentTool, AgentToolSet, AppSamplingError, AskUserInputError, AttachmentsNotSupportedError, ContextWindowExceededError, CredentialStore, DECISION_PROVIDERS, DEFAULT_COMPACTION_THRESHOLD_RATIO, DEFAULT_DECISION_CONFIDENCE_THRESHOLD, DEFAULT_DECISION_TIMEOUT_MS, EgressError, FILES_STORE, FIND_TOOLS_NAME, FORGET_SKILL_TOOL, GENERATE_IMAGE_TOOL, GENERATE_SPEECH_TOOL, ImagesNotSupportedError, IndexedDBRunStore, IndexedDBStore, KEYS_STORE, MEDIA_AUDIO_TYPES, MEDIA_DEFAULT_MAX_CALLS, MEDIA_FOLDER, MEDIA_IMAGE_TYPES, MEDIA_MAX_ATTACHED_AUDIO, MEDIA_MAX_AUDIO_INPUT_BYTES, MEDIA_MAX_IMAGE_BYTES, MEDIA_MAX_PROMPT_CHARS, MEDIA_MAX_SPEECH_BYTES, MEDIA_MAX_SPEECH_CHARS, MEDIA_MAX_TRANSCRIPT_CHARS, MEDIA_TIMEOUT_MS, MODEL_TIERS, McpAppToolResult, McpElicitationReason, McpElicitationSchema, McpSkillConsent, McpSkillConsentView, MediaBudgetError, MediaError, MemoryRunStore, MemorySkillStore, MemoryStore, NO_ATTACHMENT_NOTE, PipelineDefinition, PipelineEvent, PipelineNode, PipelineNodeRunner, PipelineResult, PlanSchema, PlanStepSchema, RELAY_MAX_REPLAYS_PER_SECOND, RELAY_MAX_SENDS, RELAY_MAX_SEND_CHARS, RELAY_MAX_STRING, REPLAY_NOTE, RUNS_STORE, ReplanSchema, SAVE_SKILL_TOOL, SEARCH_API_BASE_URL, SEARCH_DEFAULT_MAX_RESULTS, SEARCH_GOOGLE_DEFAULT_MODEL, SEARCH_GOOGLE_NOTE, SEARCH_MAX_QUERY_CHARS, SEARCH_MAX_RESULTS, SEARCH_MAX_SNIPPET_CHARS, SEARCH_MAX_SUMMARY_CHARS, SEARCH_MAX_TITLE_CHARS, SEARCH_MAX_TOTAL_CHARS, SEARCH_MAX_URL_CHARS, SEARCH_PROVIDERS, SECRETS_STORE, SESSIONS_STORE, SESSION_LOCK_MODES, SKILL_TOOL_NAMES, SPAWN_INPUT_SCHEMA, SPAWN_SUBAGENT_TOOL, STORAGE_CHANGE_KINDS, SUBAGENT_DEFAULTS, SUBAGENT_MAX_DEPTH_LIMIT, SessionBusyError, SubagentSpawnError, TOOL_APPROVAL_MODES, TOOL_APPROVAL_TIMEOUT_MS, TOOL_SEARCH_WINDOW_SHARE, TRANSCRIBE_AUDIO_TOOL, TieredPlanSchema, TieredPlanStepSchema, ToolBudgetError, ToolDeniedError, VfsSkillStore, VirtualFileSystem, WEBLLM_DEFAULT_CONTEXT_WINDOW, WEB_FETCH_TOOL, WEB_SEARCH_TOOL, acceptMedia, adoptSubagentEvent, appSamplingRequestOf, appSamplingText, askDecisionModel, attachmentKind, buildMediaModelFromSpec, buildModelFromStage, buildSearchRequest, bytesToBase64, checkAskUserAnswer, checkAskUserInput, checkEgressUrl, checkLimits, classifyAddress, cleanAskUserText, compactHistory, compactSteps, compressHistory, contextOverflowOf, contextWindowOf, createAgent, createAppSamplingLimiter, createEgressTools, createFileTools, createFindToolsTool, createGuardedFetch, createLearning, createLogger, createMedia, createPipeline, createPlan, createRunControl, createSearchTools, createSkillTools, createSubagentTool, createToolResultClearer, createWebFetchTool, createWebLLMModel, createWebSearchTool, decideReplan, decideToolPermission, decisionEgressPolicy, decisionModelFromAiSdk, defaultPrompts, defineSkill, defineTool, directBrowserOk, dispatch, escalationReasonOf, messageTokens as estimateMessagesTokens, estimateTokens, executeStep, fileToolBindingOf, findSecret, fitCompactionToWindow, generate, generateStructured, hostMatches, htmlToText, isAttachmentRefusal, isCodeExecutionTool, isDirectModel, isEscalatableError, isImageRefusal, isProviderSpec, isReadOnlyTool, isReplayedToolOutput, isTextMime, isWebGPUAvailable, learnedPreamble, limitModelOutput, loadSkillFromUrl, looksLikeJson, markCodeExecution, markReadOnly, matchRule, mediaTypeOf, mediaUsageOf, mergeProviderOptions, mimeFromPath, nextStrongerTier, nodeResolver, normalizePath, normalizeSkillName, normalizeSteps, normalizeUsage, onStorageChange, openAgentWebDB, outputCapNotice, parseExecutorResponse, parsePlainText, parsePlannerResponse, parseReplannerResponse, parseSearchResponse, parseSkillMarkdown, pickPipelineRoute, pickTier, postStorageChange, preloadWebLLMModel, renderActiveSkills, renderCatalog, renderSearchCatalog, renderSkillIndex, replanWanted, resolveAppSampling, resolveBudgets, resolveCaching, resolveCompaction, resolveConfig, resolveDecisionModel, resolveDynamicSubagents, resolveEgressPolicy, resolveEscalation, resolveModel, resolveResume, resolveStage, resolveThinking, runToolLoop, sanitizeSearchResults, schemaHintOf, searchEgressPolicy, searchStatusMessage, searchToolResult, searchTools, selectToolMode, serveSubagentWorker, shouldReplan, skillPreamble, sniffMediaType, splitBlocker, stageOutputCap, stageReasons, stream, supportsImages, supportsNativeTools, supportsPdf, supportsStructuredOutput, synthesizeAnswer, thinkingFor, toFilePart, toImagePart, tokenize, toolCatalogOf, toolDefinitionTokens, toolRunContextOf, unloadWebLLMModel, watchSession, webLLMContextWindow, withRollingBreakpoint, withSystem, withWebLLMContextWindow, wrapTranscript };
4965
- export type { Agent, AgentContext, AgentEvent, AgentEventHandler, AgentLogger, AgentLoggerSink, AgentWebDBOptions, AppSamplingErrorCode, AppSamplingImage, AppSamplingMessage, AppSamplingOptions, AppSamplingRequest, AppSamplingResult, AppSamplingSettings, AppSamplingView, AppToolCallRequest, AskUserAction, AskUserAnswer, AskUserCheckedAnswer, AskUserConfig, AskUserContext, AskUserHandler, AskUserOption, AskUserQuestion, AskUserReason, AskUserRequest, AttachmentKind, BrowserAgentConfig, ClearedInfo, CompactOptions, CompactResult, CompactionConfig, CompressOptions, ContextStore, DecisionFallbackReason, DecisionPoint, EffectiveToolStrategy, EgressErrorCode, EscalationConfig, EscalationReason, ExecutorPromptContext, ExecutorResult, FileToolBinding, FileToolsOptions, GenerateOptions, GuardedFetch, IAiSdkDecisionOptions, IDecisionAnswer, IDecisionCallOptions, IDecisionConfig, IDecisionEvent, IDecisionModel, IDecisionModelSpec, IDecisionOption, IDecisionOutcome, IDecisionQuestion, IDynamicSubagentsConfig, IEgressPolicy, IMedia, IMediaConfig, IMediaFile, IMediaModelSpec, IMediaOptions, IMediaRun, IMediaUsage, IPlan, IPlanStep, IResolvedDynamicSubagents, IResolvedEgressPolicy, ISandboxConfig, ISandboxError, ISandboxLimits, ISandboxResult, ISanitizedSearch, ISearchAnswer, ISearchConfig, ISearchOptions, ISearchRequest, ISearchResult, ISearchToolResult, ISearchUsage, IStepEscalation, IStepResult, ISubagentsConfig, IToolCall, ITranscription, IUsage, IWebFetchOptions, IWebSearchOptions, IndexedDBRunStoreOptions, IndexedDBStoreOptions, Learning, LearningConfig, LimitBreach, LimitKind, LoadSkillOptions, LogLevel, McpSkillOrigin, MediaImageModel, MediaKind, MediaModelKind, MediaSpeechModel, MediaTranscriptionModel, MessageEndpoint, ModelInput, ModelTier, NodeResolverOptions, OutputCap, ParentToWorker, Phase, PhaseBudgets, Pipeline, PipelineOptions, PipelineRouteOptions, PipelineRouteResult, PipelineRunOptions, PlanShape, PlannerPromptContext, PlannerResult, PromptCachingSetting, PromptParts, Prompts, ProviderModelSpec, ProviderOptionsMap, ProviderType, ProxiedToolSpec, RawAction, ReplanDecision, ReplanMode, ReplanShape, ReplanTrigger, ReplannerPromptContext, ReplannerResult, ResolvedCaching, ResolvedCompaction, ResolvedConfig, ResolvedStage, ResolvedThinking, RunControl, RunFile, RunImage, RunOptions, RunPersistence, RunResult, RunSnapshot, RunStatus, RunStoreOptions, SandboxConfig, SandboxWorkerLike, SaveSkillInput, SearchEngine, SearchFreshness, SearchProvider, SearchToolsOptions, ServeSubagentOptions, SessionHolder, SessionLockMode, SessionRunState, SessionWatch, Skill, SkillOrigin, SkillStore, StageInput, StageOverride, StepComplexity, StorageChange, StorageChangeKind, StorageChangeOp, StoredMessage, StructuredResult, SubagentDefaultTools, SubagentInfo, SubagentProfile, SubagentToolOptions, SubagentWorkerConfig, SynthesizerPromptContext, ThinkingConfig, ThinkingLevel, ThinkingSetting, ThinkingStage, TierReason, TokenLimits, ToolApprovalApp, ToolApprovalConfig, ToolApprovalContext, ToolApprovalDecision, ToolApprovalMode, ToolApprovalRequest, ToolCallMode, ToolCatalogEntry, ToolLoopCallbacks, ToolLoopOptions, ToolLoopResult, ToolMode, ToolPermission, ToolResultClearing, ToolRunContext, ToolSelectionStrategy, UsagePhase, VfsListener, VirtualFile, VirtualFileInfo, VirtualFileSystemOptions, WatchSessionOptions, WebLLMAppConfigLike, WebLLMModelOptions, WorkerLike, WorkerToParent };
5038
+ export { APP_SAMPLING_MAX_IMAGES, APP_SAMPLING_MAX_IMAGE_BYTES, APP_SAMPLING_MAX_INPUT_CHARS, APP_SAMPLING_MAX_MESSAGES, APP_SAMPLING_MAX_SYSTEM_CHARS, APP_SAMPLING_MAX_TOKENS, APP_SAMPLING_PER_APP, APP_SAMPLING_PER_MINUTE, APP_SAMPLING_REASONING_TOKENS, APP_SAMPLING_RPC_CODES, ASK_USER_DESCRIPTION_MAX_CHARS, ASK_USER_LABEL_MAX_CHARS, ASK_USER_MAX_OPTIONS, ASK_USER_MAX_PER_RUN, ASK_USER_MIN_OPTIONS, ASK_USER_OTHER_MAX_CHARS, ASK_USER_QUESTION_MAX_CHARS, ASK_USER_TIMEOUT_MAX_MS, ASK_USER_TIMEOUT_MS, ASK_USER_TOOL, AgentTool, AgentToolSet, AppSamplingError, AskUserInputError, AttachmentsNotSupportedError, ContextWindowExceededError, CredentialStore, DECISION_PROVIDERS, DEFAULT_COMPACTION_THRESHOLD_RATIO, DEFAULT_DECISION_CONFIDENCE_THRESHOLD, DEFAULT_DECISION_TIMEOUT_MS, EgressError, FILES_STORE, FIND_TOOLS_NAME, FORGET_SKILL_TOOL, GENERATE_IMAGE_TOOL, GENERATE_SPEECH_TOOL, ImagesNotSupportedError, IndexedDBRunStore, IndexedDBStore, KEYS_STORE, MEDIA_AUDIO_TYPES, MEDIA_DEFAULT_MAX_CALLS, MEDIA_FOLDER, MEDIA_IMAGE_TYPES, MEDIA_MAX_ATTACHED_AUDIO, MEDIA_MAX_AUDIO_INPUT_BYTES, MEDIA_MAX_IMAGE_BYTES, MEDIA_MAX_PROMPT_CHARS, MEDIA_MAX_REFERENCE_BYTES, MEDIA_MAX_REFERENCE_IMAGES, MEDIA_MAX_REFERENCE_SIDE, MEDIA_MAX_REFERENCE_TOTAL_BYTES, MEDIA_MAX_SPEECH_BYTES, MEDIA_MAX_SPEECH_CHARS, MEDIA_MAX_TRANSCRIPT_CHARS, MEDIA_REFERENCE_TYPES, MEDIA_TIMEOUT_MS, MODEL_TIERS, McpAppToolResult, McpElicitationReason, McpElicitationSchema, McpSkillConsent, McpSkillConsentView, MediaBudgetError, MediaError, MemoryRunStore, MemorySkillStore, MemoryStore, NO_ATTACHMENT_NOTE, PipelineDefinition, PipelineEvent, PipelineNode, PipelineNodeRunner, PipelineResult, PlanSchema, PlanStepSchema, RELAY_MAX_REPLAYS_PER_SECOND, RELAY_MAX_SENDS, RELAY_MAX_SEND_CHARS, RELAY_MAX_STRING, REPLAY_NOTE, RUNS_STORE, ReplanSchema, SAVE_SKILL_TOOL, SEARCH_API_BASE_URL, SEARCH_DEFAULT_MAX_RESULTS, SEARCH_GOOGLE_DEFAULT_MODEL, SEARCH_GOOGLE_NOTE, SEARCH_MAX_NOTE_CHARS, SEARCH_MAX_QUERY_CHARS, SEARCH_MAX_RESULTS, SEARCH_MAX_SNIPPET_CHARS, SEARCH_MAX_SUMMARY_CHARS, SEARCH_MAX_TITLE_CHARS, SEARCH_MAX_TOTAL_CHARS, SEARCH_MAX_URL_CHARS, SEARCH_PROVIDERS, SECRETS_STORE, SESSIONS_STORE, SESSION_LOCK_MODES, SKILL_TOOL_NAMES, SPAWN_INPUT_SCHEMA, SPAWN_SUBAGENT_TOOL, STORAGE_CHANGE_KINDS, SUBAGENT_DEFAULTS, SUBAGENT_MAX_DEPTH_LIMIT, SessionBusyError, SubagentSpawnError, TOOL_APPROVAL_MODES, TOOL_APPROVAL_TIMEOUT_MS, TOOL_SEARCH_WINDOW_SHARE, TRANSCRIBE_AUDIO_TOOL, TieredPlanSchema, TieredPlanStepSchema, ToolBudgetError, ToolDeniedError, VfsSkillStore, VirtualFileSystem, WEBLLM_DEFAULT_CONTEXT_WINDOW, WEB_FETCH_TOOL, WEB_SEARCH_TOOL, acceptMedia, acceptReference, adoptSubagentEvent, appSamplingRequestOf, appSamplingText, askDecisionModel, attachmentKind, buildMediaModelFromSpec, buildModelFromStage, buildSearchRequest, bytesToBase64, checkAskUserAnswer, checkAskUserInput, checkEgressUrl, checkLimits, classifyAddress, cleanAskUserText, compactHistory, compactSteps, compressHistory, contextOverflowOf, contextWindowOf, createAgent, createAppSamplingLimiter, createEgressTools, createFileTools, createFindToolsTool, createGuardedFetch, createLearning, createLogger, createMedia, createPipeline, createPlan, createRunControl, createSearchTools, createSkillTools, createSubagentTool, createToolResultClearer, createWebFetchTool, createWebLLMModel, createWebSearchTool, decideReplan, decideToolPermission, decisionEgressPolicy, decisionModelFromAiSdk, defaultPrompts, defineSkill, defineTool, directBrowserOk, dispatch, escalationReasonOf, messageTokens as estimateMessagesTokens, estimateTokens, executeStep, fileToolBindingOf, findSecret, fitCompactionToWindow, generate, generateStructured, hostMatches, htmlToText, imageDimensions, isAttachmentRefusal, isCodeExecutionTool, isDirectModel, isEscalatableError, isImageRefusal, isProviderSpec, isReadOnlyTool, isReplayedToolOutput, isTextMime, isWebGPUAvailable, learnedPreamble, limitModelOutput, loadSkillFromUrl, looksLikeJson, markCodeExecution, markReadOnly, matchRule, mediaTypeOf, mediaUsageOf, mergeProviderOptions, mimeFromPath, nextStrongerTier, nodeResolver, normalizePath, normalizeSkillName, normalizeSteps, normalizeUsage, onStorageChange, openAgentWebDB, outputCapNotice, parseExecutorResponse, parsePlainText, parsePlannerResponse, parseReplannerResponse, parseSearchResponse, parseSkillMarkdown, pickPipelineRoute, pickTier, postStorageChange, preloadWebLLMModel, renderActiveSkills, renderCatalog, renderSearchCatalog, renderSkillIndex, replanWanted, resolveAppSampling, resolveBudgets, resolveCaching, resolveCompaction, resolveConfig, resolveDecisionModel, resolveDynamicSubagents, resolveEgressPolicy, resolveEscalation, resolveModel, resolveResume, resolveStage, resolveThinking, runToolLoop, sanitizeSearchResults, schemaHintOf, searchEgressPolicy, searchEngineAnswer, searchStatusMessage, searchToolResult, searchTools, searchUsageOf, selectToolMode, serveSubagentWorker, shouldReplan, skillPreamble, sniffMediaType, splitBlocker, stageOutputCap, stageReasons, stream, supportsImages, supportsNativeTools, supportsPdf, supportsStructuredOutput, synthesizeAnswer, thinkingFor, toFilePart, toImagePart, tokenize, toolCatalogOf, toolDefinitionTokens, toolRunContextOf, unloadWebLLMModel, watchSession, webLLMContextWindow, withRollingBreakpoint, withSystem, withWebLLMContextWindow, wrapTranscript };
5039
+ export type { Agent, AgentContext, AgentEvent, AgentEventHandler, AgentLogger, AgentLoggerSink, AgentWebDBOptions, AppSamplingErrorCode, AppSamplingImage, AppSamplingMessage, AppSamplingOptions, AppSamplingRequest, AppSamplingResult, AppSamplingSettings, AppSamplingView, AppToolCallRequest, AskUserAction, AskUserAnswer, AskUserCheckedAnswer, AskUserConfig, AskUserContext, AskUserHandler, AskUserOption, AskUserQuestion, AskUserReason, AskUserRequest, AttachmentKind, BrowserAgentConfig, ClearedInfo, CompactOptions, CompactResult, CompactionConfig, CompressOptions, ContextStore, DecisionFallbackReason, DecisionPoint, EffectiveToolStrategy, EgressErrorCode, EscalationConfig, EscalationReason, ExecutorPromptContext, ExecutorResult, FileToolBinding, FileToolsOptions, GenerateOptions, GuardedFetch, IAiSdkDecisionOptions, IDecisionAnswer, IDecisionCallOptions, IDecisionConfig, IDecisionEvent, IDecisionModel, IDecisionModelSpec, IDecisionOption, IDecisionOutcome, IDecisionQuestion, IDynamicSubagentsConfig, IEgressPolicy, IImageSize, IMedia, IMediaConfig, IMediaFile, IMediaModelSpec, IMediaOptions, IMediaRun, IMediaUsage, IPlan, IPlanStep, IReferenceUse, IResolvedDynamicSubagents, IResolvedEgressPolicy, ISandboxConfig, ISandboxError, ISandboxLimits, ISandboxResult, ISanitizedSearch, ISearchAnswer, ISearchConfig, ISearchEngineAnswer, ISearchOptions, ISearchRequest, ISearchResult, ISearchToolResult, ISearchUsage, IStepEscalation, IStepResult, ISubagentsConfig, IToolCall, ITranscription, IUsage, IWebFetchOptions, IWebSearchOptions, IndexedDBRunStoreOptions, IndexedDBStoreOptions, Learning, LearningConfig, LimitBreach, LimitKind, LoadSkillOptions, LogLevel, McpSkillOrigin, MediaImageModel, MediaKind, MediaModelKind, MediaSpeechModel, MediaTranscriptionModel, MessageEndpoint, ModelInput, ModelTier, NodeResolverOptions, OutputCap, ParentToWorker, Phase, PhaseBudgets, Pipeline, PipelineOptions, PipelineRouteOptions, PipelineRouteResult, PipelineRunOptions, PlanShape, PlannerPromptContext, PlannerResult, PromptCachingSetting, PromptParts, Prompts, ProviderModelSpec, ProviderOptionsMap, ProviderType, ProxiedToolSpec, RawAction, ReplanDecision, ReplanMode, ReplanShape, ReplanTrigger, ReplannerPromptContext, ReplannerResult, ResolvedCaching, ResolvedCompaction, ResolvedConfig, ResolvedStage, ResolvedThinking, RunControl, RunFile, RunImage, RunOptions, RunPersistence, RunResult, RunSnapshot, RunStatus, RunStoreOptions, SandboxConfig, SandboxWorkerLike, SaveSkillInput, SearchEngine, SearchFreshness, SearchProvider, SearchToolsOptions, ServeSubagentOptions, SessionHolder, SessionLockMode, SessionRunState, SessionWatch, Skill, SkillOrigin, SkillStore, StageInput, StageOverride, StepComplexity, StorageChange, StorageChangeKind, StorageChangeOp, StoredMessage, StructuredResult, SubagentDefaultTools, SubagentInfo, SubagentProfile, SubagentToolOptions, SubagentWorkerConfig, SynthesizerPromptContext, ThinkingConfig, ThinkingLevel, ThinkingSetting, ThinkingStage, TierReason, TokenLimits, ToolApprovalApp, ToolApprovalConfig, ToolApprovalContext, ToolApprovalDecision, ToolApprovalMode, ToolApprovalRequest, ToolCallMode, ToolCatalogEntry, ToolLoopCallbacks, ToolLoopOptions, ToolLoopResult, ToolMode, ToolPermission, ToolResultClearing, ToolRunContext, ToolSelectionStrategy, UsagePhase, VfsListener, VirtualFile, VirtualFileInfo, VirtualFileSystemOptions, WatchSessionOptions, WebLLMAppConfigLike, WebLLMModelOptions, WorkerLike, WorkerToParent };