@dudko.dev/agent-web 0.0.45 → 0.0.46

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
@@ -177,6 +177,8 @@ interface RunSnapshot {
177
177
  escalations?: number;
178
178
  /** Helpers the model started so far (counts against `subagents.dynamic.maxChildren` on resume). */
179
179
  subagentsSpawned?: number;
180
+ /** Questions `ask_user` put to the person so far (counts against `askUser.maxPerRun` on resume). */
181
+ questionsAsked?: number;
180
182
  /**
181
183
  * The attempt that wrote the snapshot: 1 for the run as first started, one more for every
182
184
  * resume - the `attempt` of its events. A resume records its attempt BEFORE any of its events
@@ -683,6 +685,146 @@ declare const decideToolPermission: (opts: {
683
685
  mcpSkills?: readonly string[];
684
686
  }) => ToolPermission;
685
687
 
688
+ declare const ASK_USER_TOOL = "ask_user";
689
+ /** How long one question waits for the person, by default: a human is reading it. */
690
+ declare const ASK_USER_TIMEOUT_MS = 300000;
691
+ /**
692
+ * The longest wait a timer holds (2^31 - 1 ms, about 24.8 days). `setTimeout` fires a longer one -
693
+ * Infinity included - after about 1 ms, so a `timeoutMs` past it is taken as no limit at all.
694
+ */
695
+ declare const ASK_USER_TIMEOUT_MAX_MS = 2147483647;
696
+ /** The most questions one run may ask, by default (its helpers' and subagents' included). */
697
+ declare const ASK_USER_MAX_PER_RUN = 3;
698
+ /** A question offers at least this many options... */
699
+ declare const ASK_USER_MIN_OPTIONS = 2;
700
+ /** ...and at most this many. */
701
+ declare const ASK_USER_MAX_OPTIONS = 6;
702
+ /** The longest question, in characters (after cleaning). */
703
+ declare const ASK_USER_QUESTION_MAX_CHARS = 500;
704
+ /** The longest option label. */
705
+ declare const ASK_USER_LABEL_MAX_CHARS = 80;
706
+ /** The longest option description. */
707
+ declare const ASK_USER_DESCRIPTION_MAX_CHARS = 200;
708
+ /** The most of a person's own words (`{ other }`) the model is given; the rest is cut. */
709
+ declare const ASK_USER_OTHER_MAX_CHARS = 2000;
710
+ /** One option of a question, as the person is shown it. Both strings are the MODEL's, cleaned. */
711
+ interface AskUserOption {
712
+ label: string;
713
+ description?: string;
714
+ }
715
+ /** A question as checked and cleaned: what a host shows and an event carries. */
716
+ interface AskUserQuestion {
717
+ question: string;
718
+ options: AskUserOption[];
719
+ /** The person may pick several options. */
720
+ multiple: boolean;
721
+ /** The person may answer in their own words instead of picking. */
722
+ allowOther: boolean;
723
+ }
724
+ /** What the host's `onQuestion` is given. Every string in it is the model's text, cleaned. */
725
+ interface AskUserRequest$1<TStep = unknown> extends AskUserQuestion {
726
+ /** Unique per question; the same id is in the two events. */
727
+ id: string;
728
+ /** The plan step whose tool call asks. */
729
+ step?: TStep;
730
+ runId?: string;
731
+ /** Set when a helper or a subagent of the run asks, not the run itself: its id and depth. */
732
+ subagent?: {
733
+ id: string;
734
+ depth: number;
735
+ };
736
+ }
737
+ /**
738
+ * The person's answer: the labels they picked (exactly as offered; one unless `multiple`), their
739
+ * own words (only when `allowOther`), or that they would rather not answer.
740
+ */
741
+ type AskUserAnswer = {
742
+ choice: string[];
743
+ } | {
744
+ other: string;
745
+ } | {
746
+ declined: true;
747
+ };
748
+ interface AskUserContext {
749
+ /**
750
+ * Aborted when the question ends WITHOUT the host's answer: no answer within `timeoutMs`
751
+ * (`signal.reason` is an Error named 'TimeoutError'), the run was stopped, or the handler
752
+ * failed. Take the prompt down then: an answer given later is ignored. Never aborted once the
753
+ * host has answered.
754
+ */
755
+ signal: AbortSignal;
756
+ }
757
+ /** `askUser` beside `onQuestion`, resolved: `timeoutMs` 0 = no limit of its own. */
758
+ interface AskUserSettings {
759
+ timeoutMs: number;
760
+ maxPerRun: number;
761
+ }
762
+ /** How a question ended. `automatic`: nobody decided (a time limit, a stop, a failed handler). */
763
+ type AskUserAction = 'choice' | 'other' | 'declined' | 'timeout' | 'stopped';
764
+ /** Why a question was closed as `declined` without the person deciding. */
765
+ type AskUserReason = 'handler-error' | 'invalid-answer' | 'cannot-park';
766
+ /** The two events of a question. Neither ever carries the person's own words. */
767
+ type AskUserEvent<TStep = unknown> = {
768
+ type: 'user.question-asked';
769
+ id: string;
770
+ question: string;
771
+ options: AskUserOption[];
772
+ multiple: boolean;
773
+ allowOther: boolean;
774
+ step?: TStep;
775
+ subagent?: {
776
+ id: string;
777
+ depth: number;
778
+ };
779
+ } | {
780
+ type: 'user.question-answered';
781
+ id: string;
782
+ action: AskUserAction;
783
+ /** true when nobody decided: a time limit, a stop, a failed handler, an unusable answer. */
784
+ automatic: boolean;
785
+ /** Action 'choice': the labels picked. Never the text of an `other` answer. */
786
+ choice?: string[];
787
+ /** Action 'declined' with `automatic`: why. */
788
+ reason?: AskUserReason;
789
+ };
790
+ /** A bad `ask_user` input: the tool call fails with this message, which says what to fix. */
791
+ declare class AskUserInputError extends Error {
792
+ constructor(message: string);
793
+ toJSON(): string;
794
+ }
795
+ /** The model's text as a person may be shown it: a string, invisible characters removed, trimmed. */
796
+ declare const cleanAskUserText: (raw: unknown, oneLine?: boolean) => string;
797
+ /**
798
+ * Check and clean the model's `ask_user` arguments: 2-6 options, no two labels alike (letter case
799
+ * and spaces aside), each label 1-80 characters, a description at most 200, a question of 1-500 -
800
+ * all measured after cleaning. An option may be given as a bare string (its label). Throws
801
+ * {@link AskUserInputError} with what to fix.
802
+ */
803
+ declare const checkAskUserInput: (raw: unknown) => AskUserQuestion;
804
+ /** An answer as checked: what the model is told. */
805
+ type AskUserCheckedAnswer = {
806
+ kind: 'choice';
807
+ choice: string[];
808
+ } | {
809
+ kind: 'other';
810
+ text: string;
811
+ } | {
812
+ kind: 'declined';
813
+ };
814
+ /**
815
+ * Check the host's answer against the question: exactly one of `choice` (labels that were
816
+ * offered, no repeats, one unless `multiple`), `other` (a non-empty text, only when `allowOther`;
817
+ * cleaned and cut at {@link ASK_USER_OTHER_MAX_CHARS}) or `declined: true`. Anything else is not
818
+ * an answer.
819
+ */
820
+ declare const checkAskUserAnswer: (q: AskUserQuestion, raw: unknown) => {
821
+ ok: true;
822
+ value: AskUserCheckedAnswer;
823
+ } | {
824
+ ok: false;
825
+ reason: string;
826
+ };
827
+
686
828
  type ReplanMode = 'continue' | 'revise' | 'finish';
687
829
  type Phase = 'plan' | 'execute' | 'replan' | 'synthesize';
688
830
  /**
@@ -951,6 +1093,18 @@ type AgentEventBody =
951
1093
  reason?: string;
952
1094
  automatic: boolean;
953
1095
  }
1096
+ /**
1097
+ * The model asked the person a question (`ask_user`, `config.askUser`): `onQuestion` is being
1098
+ * called. `question` and the options are the MODEL's text, cleaned - show them as plain text.
1099
+ * `subagent`: a helper or a subagent of the run asks. Followed by `user.question-answered` with
1100
+ * the same id - unless the run parked on it (the Node package only).
1101
+ *
1102
+ * `user.question-answered`: how it ended - `action` 'choice' (with the labels picked in
1103
+ * `choice`), 'other' (the person's own words: they go to the model as the tool's result and
1104
+ * NEVER into an event), 'declined', 'timeout' or 'stopped'. `automatic`: nobody decided (a time
1105
+ * limit, a stop, a failed handler - `reason` - or an answer that did not fit the question).
1106
+ */
1107
+ | AskUserEvent<IPlanStep>
954
1108
  /**
955
1109
  * An MCP server asked the user for input during a tool call (the connection's `onElicitation`
956
1110
  * is being called). `message`, `requestedSchema` and `url` are the SERVER's text: cleaned and
@@ -1440,6 +1594,11 @@ interface PlannerPromptContext {
1440
1594
  sandbox?: string;
1441
1595
  /** Set while `spawn_subagent` is callable (`subagents.dynamic`): when a helper is worth a step. */
1442
1596
  subagents?: string;
1597
+ /**
1598
+ * Set while `ask_user` is callable (`config.askUser`): when a step may ask the user - the one
1599
+ * exception to "never plan a step that asks the user something".
1600
+ */
1601
+ askUser?: string;
1443
1602
  /** Set when `config.executorTiers` is on: the planner rates every step's complexity. */
1444
1603
  tiers?: boolean;
1445
1604
  }
@@ -1469,6 +1628,8 @@ interface ExecutorPromptContext {
1469
1628
  sandbox?: string;
1470
1629
  /** Set while `spawn_subagent` is callable (`subagents.dynamic`): when to hand work to a helper. */
1471
1630
  subagents?: string;
1631
+ /** Set while `ask_user` is callable (`config.askUser`): when to ask the user, and how. */
1632
+ askUser?: string;
1472
1633
  /** See `PlannerPromptContext.attachments`: this message carries no file, an earlier one did. */
1473
1634
  attachments?: string;
1474
1635
  }
@@ -2501,6 +2662,56 @@ declare const decisionEgressPolicy: (spec: IDecisionModelSpec) => IEgressPolicy;
2501
2662
  */
2502
2663
  declare const resolveDecisionModel: (input: IDecisionModel | IDecisionModelSpec | undefined, credentials?: CredentialStore) => Promise<IDecisionModel | undefined>;
2503
2664
 
2665
+ /**
2666
+ * `config.askUser`: the `ask_user` tool, with which the MODEL asks the person one closed question
2667
+ * with 2-6 options (the rules and the bounds are `ask-user-shared.ts`, the same file as the Node
2668
+ * package's). This file is the browser's wiring: the tool reads its run through `agentRun`
2669
+ * (`ToolRunContext.askUser`), a helper the model started asks through its caller's channel
2670
+ * (`SpawnSeed.askUser`), and a subagent the HOST defined (`createSubagentTool`, in-process) asks
2671
+ * through the run that called it (`routeAskUser`).
2672
+ */
2673
+ /** What `onQuestion` is given: the model's question and options, cleaned (see the shared file). */
2674
+ type AskUserRequest = AskUserRequest$1<IPlanStep>;
2675
+ /**
2676
+ * Answers the agent's question: `{ choice: [label, ...] }` (labels exactly as offered; one unless
2677
+ * `multiple`), `{ other: text }` (only when `allowOther`) or `{ declined: true }`. The host decides,
2678
+ * never the model. A handler that throws, or answers with anything else, counts as "not answered".
2679
+ */
2680
+ type AskUserHandler = (request: AskUserRequest, ctx: AskUserContext) => AskUserAnswer | Promise<AskUserAnswer>;
2681
+ interface AskUserConfig {
2682
+ /**
2683
+ * Who answers. Without it there is no tool - unless the agent runs as a subagent of a run that
2684
+ * has one (`createSubagentTool`, in-process): it then asks through that run.
2685
+ */
2686
+ onQuestion?: AskUserHandler;
2687
+ /**
2688
+ * How long one question waits for an answer. Default 300 000 (5 minutes). `0` or `Infinity`: no
2689
+ * limit of its own - the question waits until the run is stopped; so does a value above
2690
+ * 2^31 - 1. Negative or NaN: `createAgent` throws. The step's `chatTimeoutMs` (and a subagent's
2691
+ * `timeoutMs`) stop while a question waits.
2692
+ */
2693
+ timeoutMs?: number;
2694
+ /** Questions one run may ask, its helpers' and subagents' included. Default 3. */
2695
+ maxPerRun?: number;
2696
+ }
2697
+ /**
2698
+ * Internal - one run's way to the person (the run the host started makes it; its helpers share
2699
+ * it; a subagent the host defined is given its caller's, marked with `subagent`).
2700
+ */
2701
+ interface AskUserChannel {
2702
+ handler: AskUserHandler;
2703
+ settings: AskUserSettings;
2704
+ /** The questions asked so far in the run the host started. */
2705
+ asked: {
2706
+ count: number;
2707
+ };
2708
+ /** Set for a subagent the host defined: every question it asks says so. */
2709
+ subagent?: {
2710
+ id: string;
2711
+ depth: number;
2712
+ };
2713
+ }
2714
+
2504
2715
  /**
2505
2716
  * MCP Apps: a completion an app asks the HOST's model for (`sampling/createMessage` sent by the
2506
2717
  * view, the extension's draft revision; the request is MCP's own `CreateMessageRequest`).
@@ -2776,6 +2987,19 @@ interface BrowserAgentConfig {
2776
2987
  toolSearchThreshold?: number;
2777
2988
  /** Consent policy for tool calls: autopilot, ask before writes, ask always, read-only. */
2778
2989
  toolApproval?: ToolApprovalConfig;
2990
+ /**
2991
+ * Let the MODEL ask the person a closed question with buttons (the `ask_user` tool: one short
2992
+ * question, 2-6 options, optionally several picks or an answer in their own words) instead of
2993
+ * guessing. Off unless set: with it off there is no tool and no prompt mentions it. The tool
2994
+ * exists only when someone can answer - `onQuestion`, or (for a subagent `createSubagentTool`
2995
+ * runs in-process) the run that called it; `true` / `{}` without a handler is "on, the handler
2996
+ * comes later" (`useAgent` supplies one). The host decides, never the model; at most
2997
+ * `maxPerRun` questions per run (default 3), each bounded by `timeoutMs` (default 5 minutes;
2998
+ * the step's time limit stops while it waits), a stop ends the wait at once. The question and
2999
+ * options are the MODEL's text, cleaned: show them as plain text. See docs/capabilities.md,
3000
+ * "Asking the user".
3001
+ */
3002
+ askUser?: boolean | AskUserConfig;
2779
3003
  /**
2780
3004
  * MCP Apps asking this agent's model for a completion (`Agent.sampleForApp`, the app's
2781
3005
  * `sampling/createMessage`): the caps - `maxTokens` per request (1024), `maxRequestsPerMinute`
@@ -3223,6 +3447,11 @@ interface AgentContext {
3223
3447
  * the executor's prompts say when a helper is worth it.
3224
3448
  */
3225
3449
  subagents?: true;
3450
+ /**
3451
+ * Set while `ask_user` is among the tools (`config.askUser`): the planner's and the executor's
3452
+ * prompts say when a question is worth it (the one exception to "never ask the user").
3453
+ */
3454
+ askUser?: true;
3226
3455
  /**
3227
3456
  * The rendered instructions of the MCP servers whose tools are mounted (`renderMcpInstructions`);
3228
3457
  * absent when none sent any or `config.mcpInstructions` is false. Built once, when the agent is
@@ -4620,6 +4849,11 @@ interface ToolRunContext {
4620
4849
  * in-process subagent runs under them rather than wait for its own parent.
4621
4850
  */
4622
4851
  sessionLocks?: () => readonly string[];
4852
+ /**
4853
+ * Internal - the run's way to the person (`config.askUser`): `ask_user` asks through it, a
4854
+ * helper the run starts shares it, and a subagent the host defined asks through it too.
4855
+ */
4856
+ askUser?: AskUserChannel;
4623
4857
  }
4624
4858
  /** Read the run context the agent passes to a tool's execute (undefined outside a run). */
4625
4859
  declare const toolRunContextOf: (options: unknown) => ToolRunContext | undefined;
@@ -4776,5 +5010,5 @@ declare const postStorageChange: (dbName: string | undefined, change: StorageCha
4776
5010
  */
4777
5011
  declare const onStorageChange: (dbName: string | undefined, listener: (change: StorageChange) => void) => (() => void);
4778
5012
 
4779
- 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, AgentTool, AgentToolSet, AppSamplingError, AttachmentsNotSupportedError, ContextWindowExceededError, 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, MemoryCredentialStore, 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, VaultCredentialStore, VaultOptions, VfsSkillStore, VirtualFileSystem, WEBLLM_DEFAULT_CONTEXT_WINDOW, WEB_FETCH_TOOL, WEB_SEARCH_TOOL, acceptMedia, adoptSubagentEvent, appSamplingRequestOf, appSamplingText, askDecisionModel, attachmentKind, buildMediaModelFromSpec, buildModelFromStage, buildSearchRequest, bytesToBase64, checkEgressUrl, checkLimits, classifyAddress, 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, decryptJSON, defaultPrompts, defineSkill, defineTool, directBrowserOk, dispatch, encryptJSON, escalationReasonOf, messageTokens as estimateMessagesTokens, estimateTokens, executeStep, fileToolBindingOf, findSecret, fitCompactionToWindow, generate, generateStructured, getOrCreateVaultKey, 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 };
4780
- export type { Agent, AgentContext, AgentEvent, AgentEventHandler, AgentLogger, AgentLoggerSink, AgentWebDBOptions, AppSamplingErrorCode, AppSamplingImage, AppSamplingMessage, AppSamplingOptions, AppSamplingRequest, AppSamplingResult, AppSamplingSettings, AppSamplingView, AppToolCallRequest, AttachmentKind, BrowserAgentConfig, ClearedInfo, CompactOptions, CompactResult, CompactionConfig, CompressOptions, ContextStore, CredentialStore, DecisionFallbackReason, DecisionPoint, EffectiveToolStrategy, EgressErrorCode, EncryptedBlob, 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 };
5013
+ 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, 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, MemoryCredentialStore, 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, VaultCredentialStore, VaultOptions, 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, decryptJSON, defaultPrompts, defineSkill, defineTool, directBrowserOk, dispatch, encryptJSON, escalationReasonOf, messageTokens as estimateMessagesTokens, estimateTokens, executeStep, fileToolBindingOf, findSecret, fitCompactionToWindow, generate, generateStructured, getOrCreateVaultKey, 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 };
5014
+ 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, CredentialStore, DecisionFallbackReason, DecisionPoint, EffectiveToolStrategy, EgressErrorCode, EncryptedBlob, 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 };