@dudko.dev/agent-web 0.0.50 → 0.0.51

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.
Files changed (38) hide show
  1. package/README.md +49 -4
  2. package/dist/agent-web.js +159 -151
  3. package/dist/agent-web.js.map +1 -1
  4. package/dist/{chunk-3V27UZT6.js → chunk-DOWC4CFZ.js} +257 -3
  5. package/dist/chunk-DOWC4CFZ.js.map +1 -0
  6. package/dist/{chunk-6XHCPSZE.js → chunk-EUJWS42C.js} +56 -5
  7. package/dist/{chunk-6XHCPSZE.js.map → chunk-EUJWS42C.js.map} +1 -1
  8. package/dist/{chunk-IT77BVAD.js → chunk-HXUR2SG5.js} +2 -2
  9. package/dist/{chunk-JTZEUPIG.js → chunk-NUL6QEAX.js} +49 -49
  10. package/dist/chunk-NUL6QEAX.js.map +1 -0
  11. package/dist/chunk-R5VCITT3.js +192 -0
  12. package/dist/chunk-R5VCITT3.js.map +1 -0
  13. package/dist/{chunk-7Y5UC6L7.js → chunk-SVGIGIRR.js} +3 -3
  14. package/dist/fit-reference-worker.cjs +158 -0
  15. package/dist/fit-reference-worker.cjs.map +1 -0
  16. package/dist/fit-reference-worker.d.cts +1 -0
  17. package/dist/fit-reference-worker.d.ts +1 -0
  18. package/dist/fit-reference-worker.js +16 -0
  19. package/dist/fit-reference-worker.js.map +1 -0
  20. package/dist/index.cjs +1140 -360
  21. package/dist/index.cjs.map +1 -1
  22. package/dist/index.d.cts +82 -72
  23. package/dist/index.d.ts +82 -72
  24. package/dist/index.js +365 -84
  25. package/dist/index.js.map +1 -1
  26. package/dist/mcp.js +2 -2
  27. package/dist/media-fit-worker-CFK2z8LF.d.cts +149 -0
  28. package/dist/media-fit-worker-CFK2z8LF.d.ts +149 -0
  29. package/dist/{sandbox-IGTCMOOX.js → sandbox-X6T4ZOEQ.js} +3 -3
  30. package/dist/secrets.js +3 -3
  31. package/dist/{webllm-BEL5A4OF.js → webllm-EZSJGU6P.js} +2 -2
  32. package/package.json +14 -2
  33. package/dist/chunk-3V27UZT6.js.map +0 -1
  34. package/dist/chunk-JTZEUPIG.js.map +0 -1
  35. /package/dist/{chunk-IT77BVAD.js.map → chunk-HXUR2SG5.js.map} +0 -0
  36. /package/dist/{chunk-7Y5UC6L7.js.map → chunk-SVGIGIRR.js.map} +0 -0
  37. /package/dist/{sandbox-IGTCMOOX.js.map → sandbox-X6T4ZOEQ.js.map} +0 -0
  38. /package/dist/{webllm-BEL5A4OF.js.map → webllm-EZSJGU6P.js.map} +0 -0
package/dist/index.d.cts CHANGED
@@ -3,6 +3,8 @@ import { P as McpSkillConsentView, B as McpElicitationSchema, y as McpElicitatio
3
3
  export { g as MCP_APPS_EXTENSION, k as MCP_APP_MAX_HTML_CHARS, l as MCP_APP_MAX_RESULT_CHARS, m as MCP_APP_MIME_TYPE, V as MCP_SKILLS_EXTENSION, W as MCP_SKILLS_MAX_PER_SERVER, X as MCP_SKILLS_MAX_TOTAL, Y as MCP_SKILL_BODY_MAX_CHARS, Z as MCP_SKILL_CONSENTS, _ as MCP_SKILL_CONSENT_DEFAULT, $ as MCP_SKILL_DESCRIPTION_MAX_CHARS, a0 as MCP_SKILL_DIRECTORY_ENTRIES_MAX, a1 as MCP_SKILL_FILE_MAX_CHARS, a2 as MCP_SKILL_MAX_RESOURCES, a3 as MCP_SKILL_MAX_TOTAL_BYTES, a4 as MCP_SKILL_SNAPSHOTS_MAX_BYTES, a5 as MCP_SKILL_SNAPSHOT_MAX_DEPTH, a6 as MCP_SKILL_SNAPSHOT_MAX_DIRECTORIES, a7 as MCP_SKILL_URI_MAX_CHARS, q as McpAppCsp, r as McpAppPermissions, b as McpAppResource, c as McpAppVisibility, x as McpElicitationFieldSchema, a8 as McpSkillsOptions, f as McpSkillsSetting, a9 as SkillDirectoryListing, G as mcpAppOrigin, aa as mcpSkillEntryRefusal, ab as mcpSkillPreamble, ac as mcpSkillUriRefusal } from './skills-ufoyTJ-B.cjs';
4
4
  import { PipelineEvent, PipelineNode, PipelineDefinition, PipelineResult, PipelineNodeRunner } from './pipeline-engine.cjs';
5
5
  export { PIPELINE_LIMITS, PIPELINE_ROUTER_SYSTEM, PipelineAbortBehaviour, PipelineCondition, PipelineEdge, PipelineGraphRunOptions, PipelineIssue, PipelineNodeContext, PipelineNodeError, PipelineNodeEvent, PipelineNodeInput, PipelineNodeOutput, PipelineNodeSource, PipelinePlan, PipelineRoute, PipelineStop, PipelineTraceEntry, PipelineUsage, PipelineValidation, PipelineValidationError, matchPipelineRoute, normalizePipeline, preparePipeline, renderPipelineNodeInput, renderPipelineRoutePrompt, runPipelineGraph, testPipelineCondition, validatePipeline } from './pipeline-engine.cjs';
6
+ import { I as IReferenceUse, M as MediaFitReference, a as IReferenceResult } from './media-fit-worker-CFK2z8LF.cjs';
7
+ export { F as FitReferenceWorker, b as FitReferenceWorkerScope, G as GENERATE_IMAGE_TOOL, c as GENERATE_SPEECH_TOOL, d as IFitReferenceOptions, e as IFittedReference, f as IImageSize, g as IMediaUsage, h as IReferenceBounds, i as IReferencePicture, j as MEDIA_AUDIO_TYPES, k as MEDIA_DEFAULT_MAX_CALLS, l as MEDIA_FIT_TIMEOUT_MS, m as MEDIA_FOLDER, n as MEDIA_IMAGE_TYPES, o as MEDIA_MAX_ATTACHED_AUDIO, p as MEDIA_MAX_AUDIO_INPUT_BYTES, q as MEDIA_MAX_IMAGE_BYTES, r as MEDIA_MAX_PROMPT_CHARS, s as MEDIA_MAX_REFERENCE_BYTES, t as MEDIA_MAX_REFERENCE_IMAGES, u as MEDIA_MAX_REFERENCE_SIDE, v as MEDIA_MAX_REFERENCE_SOURCE_BYTES, w as MEDIA_MAX_REFERENCE_SOURCE_PIXELS, x as MEDIA_MAX_REFERENCE_TOTAL_BYTES, y as MEDIA_MAX_SPEECH_BYTES, z as MEDIA_MAX_SPEECH_CHARS, A as MEDIA_MAX_TRANSCRIPT_CHARS, B as MEDIA_REFERENCE_TYPES, C as MEDIA_TIMEOUT_MS, D as MediaBudgetError, E as MediaError, H as MediaKind, S as ServeFitReferenceOptions, T as TRANSCRIBE_AUDIO_TOOL, J as acceptMedia, K as acceptReference, L as acceptReferenceSource, N as fitReferenceImage, O as fitReferenceInWorker, P as imageDimensions, Q as mediaUsageOf, R as serveFitReferenceWorker, U as sniffMediaType, V as wrapTranscript } from './media-fit-worker-CFK2z8LF.cjs';
6
8
  import { CredentialStore } from './secrets.cjs';
7
9
  export { EncryptedBlob, MemoryCredentialStore, VaultCredentialStore, decryptJSON, encryptJSON, getOrCreateVaultKey } from './secrets.cjs';
8
10
  import { A as AgentToolSet, a as AgentTool } from './types-DwSMj_Xs.cjs';
@@ -828,71 +830,6 @@ declare const checkAskUserAnswer: (q: AskUserQuestion, raw: unknown) => {
828
830
  reason: string;
829
831
  };
830
832
 
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
-
896
833
  type ReplanMode = 'continue' | 'revise' | 'finish';
897
834
  type Phase = 'plan' | 'execute' | 'replan' | 'synthesize';
898
835
  /**
@@ -1516,14 +1453,37 @@ interface SessionWatch {
1516
1453
  readonly state: SessionRunState;
1517
1454
  /**
1518
1455
  * Say something to the run in the other tab: it reaches the model at the run's next boundary,
1519
- * as `RunControl.send` does there. Resolves true when that tab took it; false when nothing
1520
- * runs, the run has no `control`, the text is empty or over `RELAY_MAX_SEND_CHARS`, the run
1521
- * already took `RELAY_MAX_SENDS`, or no answer came.
1456
+ * as `RunControl.send` does there. The answer is THAT tab's, and nothing else decides it while
1457
+ * the run goes:
1458
+ *
1459
+ * - `true` when that tab took the message (its acknowledgement);
1460
+ * - `false` when it refused it (the run has no `control`, already took `RELAY_MAX_SENDS`, or is
1461
+ * finishing), or when the run ENDED without taking it - its tab said so (`done`, `stopped`), or
1462
+ * nobody holds the session any more (`gone`: the tab closed or crashed). One tab's messages
1463
+ * keep their order and it answers a message before it says its run is over, so an end with no
1464
+ * answer before it means that run never took it.
1465
+ *
1466
+ * There is no time limit while the run's tab holds the session: a tab the browser froze in the
1467
+ * background (a phone does that to every tab out of sight) takes the message when it wakes, so
1468
+ * "no answer yet" is not a refusal - the promise stays pending, and a host that showed the text
1469
+ * as refused would hand it to a second run. Only the tab that announced the run decides: an
1470
+ * answer, or an end, posted under another tab's id is ignored (any page of the origin can post).
1471
+ *
1472
+ * Resolves `false` at once when nothing runs or the text is empty or over
1473
+ * `RELAY_MAX_SEND_CHARS`, and on `close()` - then the other tab may still take it: this watch no
1474
+ * longer knows. Where the browser cannot be asked who holds the session (no
1475
+ * `navigator.locks.query()`), a run whose tab closed is never seen to end, and a message to it
1476
+ * waits until `close()`.
1522
1477
  */
1523
1478
  send(text: string): Promise<boolean>;
1524
- /** Stop the run in the other tab. Resolves true when that tab took the request. */
1479
+ /**
1480
+ * Stop the run in the other tab. Resolves true when that tab took the request, false when it
1481
+ * refused or no answer came in 3 s. A stop may keep that bound where a message may not: it is
1482
+ * idempotent - a stop a frozen tab takes late stops the run it was meant for, and asking again
1483
+ * stops it once.
1484
+ */
1525
1485
  stop(): Promise<boolean>;
1526
- /** Stop watching. */
1486
+ /** Stop watching. A message still waiting for its answer resolves `false`. */
1527
1487
  close(): void;
1528
1488
  }
1529
1489
  /**
@@ -2618,6 +2578,19 @@ interface IMediaConfig {
2618
2578
  * a call with `images` makes the picture from the text alone and its result says so.
2619
2579
  */
2620
2580
  imageInputs?: boolean;
2581
+ /**
2582
+ * Make a reference picture that is over the bounds (over 4096 px on its longer side, over 8 MiB,
2583
+ * or the pictures of a call over 12 MiB together) small enough to send, instead of refusing it.
2584
+ * Called with a COPY of the picture's bytes and its size in pixels, only for a PNG / JPEG / WebP
2585
+ * of the workspace within the source bounds (50 MiB, 200 MP - read from its header, so nothing
2586
+ * larger is ever decoded); its answer is checked again by the same guards. The file in the
2587
+ * workspace is never changed. `fitReferenceImage` does it with the browser's own codecs; run it
2588
+ * in a Web Worker (`fitReferenceInWorker`) so the page never waits on an encode. Default: none -
2589
+ * a picture over the bounds is refused.
2590
+ */
2591
+ fitReference?: MediaFitReference;
2592
+ /** One call of `fitReference`, in ms (its `signal` is aborted then). Default 30 000. */
2593
+ fitTimeoutMs?: number;
2621
2594
  /** Mounts `generate_speech` (text becomes an audio file in the workspace). */
2622
2595
  speechModel?: MediaSpeechModel | IMediaModelSpec;
2623
2596
  /**
@@ -3627,6 +3600,14 @@ interface RunResult {
3627
3600
  * stopped or ended). Send them as the next run. Empty when everything was delivered.
3628
3601
  */
3629
3602
  undelivered?: string[];
3603
+ /**
3604
+ * The runner's record of what the run DID - `[done: ...]`: each tool it called and how the calls
3605
+ * ended, the files written or deleted, the media made (and whether generate_image's reference
3606
+ * pictures were used), the helpers, whether a question was answered - as the session memory keeps
3607
+ * it on the assistant's message (see `withActionRecord`). Absent when no tool ran. A stopped or
3608
+ * failed run has it too: what it did before it ended.
3609
+ */
3610
+ actionRecord?: string;
3630
3611
  }
3631
3612
  interface CompactOptions {
3632
3613
  /** Session to compact (default: the config's sessionId). */
@@ -4319,6 +4300,7 @@ declare const fileToolBindingOf: (t: unknown) => FileToolBinding | undefined;
4319
4300
  * Tools that give the agent the virtual file system: list, read, write and
4320
4301
  * delete. Listing and reading are marked read-only, so the `ask-writes`
4321
4302
  * consent mode lets them through and asks before writes and deletes.
4303
+ * `fs_read` takes an optional line range (`startLine` / `endLine`) for part of a long file.
4322
4304
  */
4323
4305
  declare const createFileTools: (vfs: VirtualFileSystem, opts?: FileToolsOptions) => ToolSet;
4324
4306
 
@@ -4912,12 +4894,40 @@ declare class IndexedDBStore implements ContextStore {
4912
4894
  constructor(opts?: IndexedDBStoreOptions);
4913
4895
  load(sessionId: string): Promise<StoredMessage[]>;
4914
4896
  replace(sessionId: string, messages: StoredMessage[]): Promise<void>;
4897
+ /**
4898
+ * Read the session and write it with `message` added in ONE readwrite transaction: two appends
4899
+ * (a message the user sent during a run, written without waiting, and the answer after it)
4900
+ * cannot both read the same transcript and drop each other's message. They land in the order
4901
+ * they were made.
4902
+ */
4915
4903
  append(sessionId: string, message: StoredMessage): Promise<void>;
4916
4904
  clear(sessionId: string): Promise<void>;
4917
4905
  /** List all stored session ids. */
4918
4906
  listSessions(): Promise<string[]>;
4919
4907
  }
4920
4908
 
4909
+ /** The whole record at most, in characters (UTF-16 code units, as `.length` counts them). */
4910
+ declare const ACTION_RECORD_MAX_CHARS = 300;
4911
+ /**
4912
+ * The one sentence a stage reads with a conversation that carries a record. In the USER prompt,
4913
+ * next to the conversation, and only when a record is in it: a system prompt stays as it was.
4914
+ */
4915
+ declare const ACTION_RECORD_NOTE = "NOTE: a \"[done: ...]\" line at the end of an assistant message (or of a summary) is the runner's own record of what that turn actually did - the tools it called and how each call ended, the files it wrote or deleted, the media it made and whether reference pictures were used; it outweighs anything an answer said about that turn.";
4916
+ /**
4917
+ * A text kept in the conversation - a model's answer, a summary, the user's message - with every
4918
+ * "[done:" in it made "(done:": only the runner's own record has the mark's shape.
4919
+ */
4920
+ declare const neutralizeActionRecords: (text: string) => string;
4921
+ /**
4922
+ * What the conversation keeps of an assistant's turn: its answer - with any look-alike made
4923
+ * harmless - and the runner's record on the last line. A turn without an answer (`text` empty:
4924
+ * the run was stopped, or failed) keeps a fixed sentence saying so above its record. Without a
4925
+ * record (no tool ran) it is the answer alone; `record` must be the runner's (`[done: ...]`).
4926
+ */
4927
+ declare const withActionRecord: (text: string, record?: string, ended?: "stopped" | "failed") => string;
4928
+ /** The record of a run's result, or of the error a run threw (the Node package): or undefined. */
4929
+ declare const actionRecordOf: (value: unknown) => string | undefined;
4930
+
4921
4931
  interface RunStoreOptions {
4922
4932
  /**
4923
4933
  * Keep the snapshot of a run that completed (default false). A completed run has
@@ -5035,5 +5045,5 @@ declare const postStorageChange: (dbName: string | undefined, change: StorageCha
5035
5045
  */
5036
5046
  declare const onStorageChange: (dbName: string | undefined, listener: (change: StorageChange) => void) => (() => void);
5037
5047
 
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 };
5048
+ export { ACTION_RECORD_MAX_CHARS, ACTION_RECORD_NOTE, 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, IReferenceUse, ImagesNotSupportedError, IndexedDBRunStore, IndexedDBStore, KEYS_STORE, MODEL_TIERS, McpAppToolResult, McpElicitationReason, McpElicitationSchema, McpSkillConsent, McpSkillConsentView, MediaFitReference, 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, TieredPlanSchema, TieredPlanStepSchema, ToolBudgetError, ToolDeniedError, VfsSkillStore, VirtualFileSystem, WEBLLM_DEFAULT_CONTEXT_WINDOW, WEB_FETCH_TOOL, WEB_SEARCH_TOOL, actionRecordOf, 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, mergeProviderOptions, mimeFromPath, neutralizeActionRecords, 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, splitBlocker, stageOutputCap, stageReasons, stream, supportsImages, supportsNativeTools, supportsPdf, supportsStructuredOutput, synthesizeAnswer, thinkingFor, toFilePart, toImagePart, tokenize, toolCatalogOf, toolDefinitionTokens, toolRunContextOf, unloadWebLLMModel, watchSession, webLLMContextWindow, withActionRecord, withRollingBreakpoint, withSystem, withWebLLMContextWindow };
5049
+ 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, IPlan, IPlanStep, 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, 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
@@ -3,6 +3,8 @@ import { P as McpSkillConsentView, B as McpElicitationSchema, y as McpElicitatio
3
3
  export { g as MCP_APPS_EXTENSION, k as MCP_APP_MAX_HTML_CHARS, l as MCP_APP_MAX_RESULT_CHARS, m as MCP_APP_MIME_TYPE, V as MCP_SKILLS_EXTENSION, W as MCP_SKILLS_MAX_PER_SERVER, X as MCP_SKILLS_MAX_TOTAL, Y as MCP_SKILL_BODY_MAX_CHARS, Z as MCP_SKILL_CONSENTS, _ as MCP_SKILL_CONSENT_DEFAULT, $ as MCP_SKILL_DESCRIPTION_MAX_CHARS, a0 as MCP_SKILL_DIRECTORY_ENTRIES_MAX, a1 as MCP_SKILL_FILE_MAX_CHARS, a2 as MCP_SKILL_MAX_RESOURCES, a3 as MCP_SKILL_MAX_TOTAL_BYTES, a4 as MCP_SKILL_SNAPSHOTS_MAX_BYTES, a5 as MCP_SKILL_SNAPSHOT_MAX_DEPTH, a6 as MCP_SKILL_SNAPSHOT_MAX_DIRECTORIES, a7 as MCP_SKILL_URI_MAX_CHARS, q as McpAppCsp, r as McpAppPermissions, b as McpAppResource, c as McpAppVisibility, x as McpElicitationFieldSchema, a8 as McpSkillsOptions, f as McpSkillsSetting, a9 as SkillDirectoryListing, G as mcpAppOrigin, aa as mcpSkillEntryRefusal, ab as mcpSkillPreamble, ac as mcpSkillUriRefusal } from './skills-ufoyTJ-B.js';
4
4
  import { PipelineEvent, PipelineNode, PipelineDefinition, PipelineResult, PipelineNodeRunner } from './pipeline-engine.js';
5
5
  export { PIPELINE_LIMITS, PIPELINE_ROUTER_SYSTEM, PipelineAbortBehaviour, PipelineCondition, PipelineEdge, PipelineGraphRunOptions, PipelineIssue, PipelineNodeContext, PipelineNodeError, PipelineNodeEvent, PipelineNodeInput, PipelineNodeOutput, PipelineNodeSource, PipelinePlan, PipelineRoute, PipelineStop, PipelineTraceEntry, PipelineUsage, PipelineValidation, PipelineValidationError, matchPipelineRoute, normalizePipeline, preparePipeline, renderPipelineNodeInput, renderPipelineRoutePrompt, runPipelineGraph, testPipelineCondition, validatePipeline } from './pipeline-engine.js';
6
+ import { I as IReferenceUse, M as MediaFitReference, a as IReferenceResult } from './media-fit-worker-CFK2z8LF.js';
7
+ export { F as FitReferenceWorker, b as FitReferenceWorkerScope, G as GENERATE_IMAGE_TOOL, c as GENERATE_SPEECH_TOOL, d as IFitReferenceOptions, e as IFittedReference, f as IImageSize, g as IMediaUsage, h as IReferenceBounds, i as IReferencePicture, j as MEDIA_AUDIO_TYPES, k as MEDIA_DEFAULT_MAX_CALLS, l as MEDIA_FIT_TIMEOUT_MS, m as MEDIA_FOLDER, n as MEDIA_IMAGE_TYPES, o as MEDIA_MAX_ATTACHED_AUDIO, p as MEDIA_MAX_AUDIO_INPUT_BYTES, q as MEDIA_MAX_IMAGE_BYTES, r as MEDIA_MAX_PROMPT_CHARS, s as MEDIA_MAX_REFERENCE_BYTES, t as MEDIA_MAX_REFERENCE_IMAGES, u as MEDIA_MAX_REFERENCE_SIDE, v as MEDIA_MAX_REFERENCE_SOURCE_BYTES, w as MEDIA_MAX_REFERENCE_SOURCE_PIXELS, x as MEDIA_MAX_REFERENCE_TOTAL_BYTES, y as MEDIA_MAX_SPEECH_BYTES, z as MEDIA_MAX_SPEECH_CHARS, A as MEDIA_MAX_TRANSCRIPT_CHARS, B as MEDIA_REFERENCE_TYPES, C as MEDIA_TIMEOUT_MS, D as MediaBudgetError, E as MediaError, H as MediaKind, S as ServeFitReferenceOptions, T as TRANSCRIBE_AUDIO_TOOL, J as acceptMedia, K as acceptReference, L as acceptReferenceSource, N as fitReferenceImage, O as fitReferenceInWorker, P as imageDimensions, Q as mediaUsageOf, R as serveFitReferenceWorker, U as sniffMediaType, V as wrapTranscript } from './media-fit-worker-CFK2z8LF.js';
6
8
  import { CredentialStore } from './secrets.js';
7
9
  export { EncryptedBlob, MemoryCredentialStore, VaultCredentialStore, decryptJSON, encryptJSON, getOrCreateVaultKey } from './secrets.js';
8
10
  import { A as AgentToolSet, a as AgentTool } from './types-DwSMj_Xs.js';
@@ -828,71 +830,6 @@ declare const checkAskUserAnswer: (q: AskUserQuestion, raw: unknown) => {
828
830
  reason: string;
829
831
  };
830
832
 
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
-
896
833
  type ReplanMode = 'continue' | 'revise' | 'finish';
897
834
  type Phase = 'plan' | 'execute' | 'replan' | 'synthesize';
898
835
  /**
@@ -1516,14 +1453,37 @@ interface SessionWatch {
1516
1453
  readonly state: SessionRunState;
1517
1454
  /**
1518
1455
  * Say something to the run in the other tab: it reaches the model at the run's next boundary,
1519
- * as `RunControl.send` does there. Resolves true when that tab took it; false when nothing
1520
- * runs, the run has no `control`, the text is empty or over `RELAY_MAX_SEND_CHARS`, the run
1521
- * already took `RELAY_MAX_SENDS`, or no answer came.
1456
+ * as `RunControl.send` does there. The answer is THAT tab's, and nothing else decides it while
1457
+ * the run goes:
1458
+ *
1459
+ * - `true` when that tab took the message (its acknowledgement);
1460
+ * - `false` when it refused it (the run has no `control`, already took `RELAY_MAX_SENDS`, or is
1461
+ * finishing), or when the run ENDED without taking it - its tab said so (`done`, `stopped`), or
1462
+ * nobody holds the session any more (`gone`: the tab closed or crashed). One tab's messages
1463
+ * keep their order and it answers a message before it says its run is over, so an end with no
1464
+ * answer before it means that run never took it.
1465
+ *
1466
+ * There is no time limit while the run's tab holds the session: a tab the browser froze in the
1467
+ * background (a phone does that to every tab out of sight) takes the message when it wakes, so
1468
+ * "no answer yet" is not a refusal - the promise stays pending, and a host that showed the text
1469
+ * as refused would hand it to a second run. Only the tab that announced the run decides: an
1470
+ * answer, or an end, posted under another tab's id is ignored (any page of the origin can post).
1471
+ *
1472
+ * Resolves `false` at once when nothing runs or the text is empty or over
1473
+ * `RELAY_MAX_SEND_CHARS`, and on `close()` - then the other tab may still take it: this watch no
1474
+ * longer knows. Where the browser cannot be asked who holds the session (no
1475
+ * `navigator.locks.query()`), a run whose tab closed is never seen to end, and a message to it
1476
+ * waits until `close()`.
1522
1477
  */
1523
1478
  send(text: string): Promise<boolean>;
1524
- /** Stop the run in the other tab. Resolves true when that tab took the request. */
1479
+ /**
1480
+ * Stop the run in the other tab. Resolves true when that tab took the request, false when it
1481
+ * refused or no answer came in 3 s. A stop may keep that bound where a message may not: it is
1482
+ * idempotent - a stop a frozen tab takes late stops the run it was meant for, and asking again
1483
+ * stops it once.
1484
+ */
1525
1485
  stop(): Promise<boolean>;
1526
- /** Stop watching. */
1486
+ /** Stop watching. A message still waiting for its answer resolves `false`. */
1527
1487
  close(): void;
1528
1488
  }
1529
1489
  /**
@@ -2618,6 +2578,19 @@ interface IMediaConfig {
2618
2578
  * a call with `images` makes the picture from the text alone and its result says so.
2619
2579
  */
2620
2580
  imageInputs?: boolean;
2581
+ /**
2582
+ * Make a reference picture that is over the bounds (over 4096 px on its longer side, over 8 MiB,
2583
+ * or the pictures of a call over 12 MiB together) small enough to send, instead of refusing it.
2584
+ * Called with a COPY of the picture's bytes and its size in pixels, only for a PNG / JPEG / WebP
2585
+ * of the workspace within the source bounds (50 MiB, 200 MP - read from its header, so nothing
2586
+ * larger is ever decoded); its answer is checked again by the same guards. The file in the
2587
+ * workspace is never changed. `fitReferenceImage` does it with the browser's own codecs; run it
2588
+ * in a Web Worker (`fitReferenceInWorker`) so the page never waits on an encode. Default: none -
2589
+ * a picture over the bounds is refused.
2590
+ */
2591
+ fitReference?: MediaFitReference;
2592
+ /** One call of `fitReference`, in ms (its `signal` is aborted then). Default 30 000. */
2593
+ fitTimeoutMs?: number;
2621
2594
  /** Mounts `generate_speech` (text becomes an audio file in the workspace). */
2622
2595
  speechModel?: MediaSpeechModel | IMediaModelSpec;
2623
2596
  /**
@@ -3627,6 +3600,14 @@ interface RunResult {
3627
3600
  * stopped or ended). Send them as the next run. Empty when everything was delivered.
3628
3601
  */
3629
3602
  undelivered?: string[];
3603
+ /**
3604
+ * The runner's record of what the run DID - `[done: ...]`: each tool it called and how the calls
3605
+ * ended, the files written or deleted, the media made (and whether generate_image's reference
3606
+ * pictures were used), the helpers, whether a question was answered - as the session memory keeps
3607
+ * it on the assistant's message (see `withActionRecord`). Absent when no tool ran. A stopped or
3608
+ * failed run has it too: what it did before it ended.
3609
+ */
3610
+ actionRecord?: string;
3630
3611
  }
3631
3612
  interface CompactOptions {
3632
3613
  /** Session to compact (default: the config's sessionId). */
@@ -4319,6 +4300,7 @@ declare const fileToolBindingOf: (t: unknown) => FileToolBinding | undefined;
4319
4300
  * Tools that give the agent the virtual file system: list, read, write and
4320
4301
  * delete. Listing and reading are marked read-only, so the `ask-writes`
4321
4302
  * consent mode lets them through and asks before writes and deletes.
4303
+ * `fs_read` takes an optional line range (`startLine` / `endLine`) for part of a long file.
4322
4304
  */
4323
4305
  declare const createFileTools: (vfs: VirtualFileSystem, opts?: FileToolsOptions) => ToolSet;
4324
4306
 
@@ -4912,12 +4894,40 @@ declare class IndexedDBStore implements ContextStore {
4912
4894
  constructor(opts?: IndexedDBStoreOptions);
4913
4895
  load(sessionId: string): Promise<StoredMessage[]>;
4914
4896
  replace(sessionId: string, messages: StoredMessage[]): Promise<void>;
4897
+ /**
4898
+ * Read the session and write it with `message` added in ONE readwrite transaction: two appends
4899
+ * (a message the user sent during a run, written without waiting, and the answer after it)
4900
+ * cannot both read the same transcript and drop each other's message. They land in the order
4901
+ * they were made.
4902
+ */
4915
4903
  append(sessionId: string, message: StoredMessage): Promise<void>;
4916
4904
  clear(sessionId: string): Promise<void>;
4917
4905
  /** List all stored session ids. */
4918
4906
  listSessions(): Promise<string[]>;
4919
4907
  }
4920
4908
 
4909
+ /** The whole record at most, in characters (UTF-16 code units, as `.length` counts them). */
4910
+ declare const ACTION_RECORD_MAX_CHARS = 300;
4911
+ /**
4912
+ * The one sentence a stage reads with a conversation that carries a record. In the USER prompt,
4913
+ * next to the conversation, and only when a record is in it: a system prompt stays as it was.
4914
+ */
4915
+ declare const ACTION_RECORD_NOTE = "NOTE: a \"[done: ...]\" line at the end of an assistant message (or of a summary) is the runner's own record of what that turn actually did - the tools it called and how each call ended, the files it wrote or deleted, the media it made and whether reference pictures were used; it outweighs anything an answer said about that turn.";
4916
+ /**
4917
+ * A text kept in the conversation - a model's answer, a summary, the user's message - with every
4918
+ * "[done:" in it made "(done:": only the runner's own record has the mark's shape.
4919
+ */
4920
+ declare const neutralizeActionRecords: (text: string) => string;
4921
+ /**
4922
+ * What the conversation keeps of an assistant's turn: its answer - with any look-alike made
4923
+ * harmless - and the runner's record on the last line. A turn without an answer (`text` empty:
4924
+ * the run was stopped, or failed) keeps a fixed sentence saying so above its record. Without a
4925
+ * record (no tool ran) it is the answer alone; `record` must be the runner's (`[done: ...]`).
4926
+ */
4927
+ declare const withActionRecord: (text: string, record?: string, ended?: "stopped" | "failed") => string;
4928
+ /** The record of a run's result, or of the error a run threw (the Node package): or undefined. */
4929
+ declare const actionRecordOf: (value: unknown) => string | undefined;
4930
+
4921
4931
  interface RunStoreOptions {
4922
4932
  /**
4923
4933
  * Keep the snapshot of a run that completed (default false). A completed run has
@@ -5035,5 +5045,5 @@ declare const postStorageChange: (dbName: string | undefined, change: StorageCha
5035
5045
  */
5036
5046
  declare const onStorageChange: (dbName: string | undefined, listener: (change: StorageChange) => void) => (() => void);
5037
5047
 
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 };
5048
+ export { ACTION_RECORD_MAX_CHARS, ACTION_RECORD_NOTE, 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, IReferenceUse, ImagesNotSupportedError, IndexedDBRunStore, IndexedDBStore, KEYS_STORE, MODEL_TIERS, McpAppToolResult, McpElicitationReason, McpElicitationSchema, McpSkillConsent, McpSkillConsentView, MediaFitReference, 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, TieredPlanSchema, TieredPlanStepSchema, ToolBudgetError, ToolDeniedError, VfsSkillStore, VirtualFileSystem, WEBLLM_DEFAULT_CONTEXT_WINDOW, WEB_FETCH_TOOL, WEB_SEARCH_TOOL, actionRecordOf, 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, mergeProviderOptions, mimeFromPath, neutralizeActionRecords, 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, splitBlocker, stageOutputCap, stageReasons, stream, supportsImages, supportsNativeTools, supportsPdf, supportsStructuredOutput, synthesizeAnswer, thinkingFor, toFilePart, toImagePart, tokenize, toolCatalogOf, toolDefinitionTokens, toolRunContextOf, unloadWebLLMModel, watchSession, webLLMContextWindow, withActionRecord, withRollingBreakpoint, withSystem, withWebLLMContextWindow };
5049
+ 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, IPlan, IPlanStep, 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, 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 };