@dudko.dev/agent-web 0.0.44 → 0.0.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/agent-web.js +141 -135
- package/dist/agent-web.js.map +1 -1
- package/dist/index.cjs +248 -78
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +77 -9
- package/dist/index.d.ts +77 -9
- package/dist/index.js +238 -71
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1104,10 +1104,19 @@ type AgentEventBody =
|
|
|
1104
1104
|
waitedMs: number;
|
|
1105
1105
|
} | {
|
|
1106
1106
|
type: 'stopped';
|
|
1107
|
-
}
|
|
1107
|
+
}
|
|
1108
|
+
/**
|
|
1109
|
+
* `code`, when set, names a failure a host may want to say in its own words (and language):
|
|
1110
|
+
* `'no-plan'` - the planner returned nothing that could be read as a plan (no text, or text cut
|
|
1111
|
+
* off; `error` says by what); `'no-answer'` - the model wrote no answer to a message that
|
|
1112
|
+
* needed no tool. Both end the run (phase `'run'`, no `final` event), and `error` is the
|
|
1113
|
+
* result's `final`.
|
|
1114
|
+
*/
|
|
1115
|
+
| {
|
|
1108
1116
|
type: 'error';
|
|
1109
1117
|
phase: Phase | 'run';
|
|
1110
1118
|
error: string;
|
|
1119
|
+
code?: 'no-plan' | 'no-answer';
|
|
1111
1120
|
}
|
|
1112
1121
|
/** A pipeline's own events (`createPipeline`): the run, each node visit, each edge decision. */
|
|
1113
1122
|
| PipelineEvent;
|
|
@@ -1418,6 +1427,11 @@ interface PlannerPromptContext {
|
|
|
1418
1427
|
role: string;
|
|
1419
1428
|
content: string;
|
|
1420
1429
|
}[];
|
|
1430
|
+
/**
|
|
1431
|
+
* Set when this message carries no file but an earlier message of the session did: a sentence
|
|
1432
|
+
* saying so, so that the model does not take an earlier picture for one it can see now.
|
|
1433
|
+
*/
|
|
1434
|
+
attachments?: string;
|
|
1421
1435
|
/** "- name: description" index of the configured skills, when any. */
|
|
1422
1436
|
skills?: string;
|
|
1423
1437
|
/** The catalogue is condensed and the executor can search the rest (large catalogues). */
|
|
@@ -1455,6 +1469,8 @@ interface ExecutorPromptContext {
|
|
|
1455
1469
|
sandbox?: string;
|
|
1456
1470
|
/** Set while `spawn_subagent` is callable (`subagents.dynamic`): when to hand work to a helper. */
|
|
1457
1471
|
subagents?: string;
|
|
1472
|
+
/** See `PlannerPromptContext.attachments`: this message carries no file, an earlier one did. */
|
|
1473
|
+
attachments?: string;
|
|
1458
1474
|
}
|
|
1459
1475
|
interface ReplannerPromptContext {
|
|
1460
1476
|
goal: string;
|
|
@@ -1481,6 +1497,19 @@ interface SynthesizerPromptContext {
|
|
|
1481
1497
|
updates?: string[];
|
|
1482
1498
|
/** Set when `config.sandbox` is on: the output of code is reported only when `run_js` returned it. */
|
|
1483
1499
|
sandbox?: string;
|
|
1500
|
+
/**
|
|
1501
|
+
* Set when the plan was EMPTY (a greeting, small talk, a question that needs no tool): no step
|
|
1502
|
+
* ran, `done` and `findings` are empty, and this call writes the whole answer to the user's
|
|
1503
|
+
* message. A custom builder must handle it: it is the only answer the user gets.
|
|
1504
|
+
*/
|
|
1505
|
+
direct?: true;
|
|
1506
|
+
/** With `direct`: prior session messages (oldest first), the conversation the answer continues. */
|
|
1507
|
+
history?: {
|
|
1508
|
+
role: string;
|
|
1509
|
+
content: string;
|
|
1510
|
+
}[];
|
|
1511
|
+
/** See `PlannerPromptContext.attachments`: this message carries no file, an earlier one did. */
|
|
1512
|
+
attachments?: string;
|
|
1484
1513
|
}
|
|
1485
1514
|
interface Prompts {
|
|
1486
1515
|
planner(ctx: PlannerPromptContext): PromptParts;
|
|
@@ -1488,6 +1517,12 @@ interface Prompts {
|
|
|
1488
1517
|
replanner(ctx: ReplannerPromptContext): PromptParts;
|
|
1489
1518
|
synthesizer(ctx: SynthesizerPromptContext): PromptParts;
|
|
1490
1519
|
}
|
|
1520
|
+
/**
|
|
1521
|
+
* What a stage is told when THIS message carries no file but an earlier one did. Memory keeps
|
|
1522
|
+
* the names of a turn's files, not the files: without this a model reads "[attached: a.png]" in
|
|
1523
|
+
* the conversation and answers as if it saw a picture now.
|
|
1524
|
+
*/
|
|
1525
|
+
declare const NO_ATTACHMENT_NOTE = "NOTE: nothing is attached to THIS message. The files of earlier messages (marked \"[attached: ...]\" in the conversation) are not visible to you now - only what was said about them then is. If this message is about a file you cannot see, say so and ask the user to attach it again; never describe a file you cannot see.";
|
|
1491
1526
|
declare const defaultPrompts: Prompts;
|
|
1492
1527
|
/** Prepend a host-supplied systemPrompt to a phase system prompt, if present. */
|
|
1493
1528
|
declare const withSystem: (base: string, extra?: string) => string;
|
|
@@ -2918,13 +2953,17 @@ interface OutputCap {
|
|
|
2918
2953
|
/** true when it came from the window, false when the host set it (or turned it off with 0). */
|
|
2919
2954
|
derived: boolean;
|
|
2920
2955
|
}
|
|
2956
|
+
/** True once a call of `stage` reported reasoning tokens (see `observeReasoning`). */
|
|
2957
|
+
declare const stageReasons: (c: BrowserAgentConfig, stage: ThinkingStage) => boolean;
|
|
2921
2958
|
/**
|
|
2922
2959
|
* The output cap of one call of `stage` — the same rules as the Node sibling's `stageOutputCap`.
|
|
2923
2960
|
* What the host set (`limits.perCall`, then the legacy `budgets`) wins, and `0` is an explicit
|
|
2924
2961
|
* "no cap". Otherwise a share of the context window — except for a stage that thinks: on OpenAI
|
|
2925
2962
|
* and Gemini the reasoning counts against the cap, so a default sized for the answer alone would
|
|
2926
2963
|
* leave a thinking model no room to write it (or to finish a tool call's arguments). A stage that
|
|
2927
|
-
* thinks keeps the provider's own limit unless the host sets one.
|
|
2964
|
+
* thinks keeps the provider's own limit unless the host sets one. A stage thinks when the config
|
|
2965
|
+
* says so (`thinking` / `stageThinking`) or when a call of it was seen to (`observeReasoning`: a
|
|
2966
|
+
* model that reasons by default).
|
|
2928
2967
|
*/
|
|
2929
2968
|
declare const stageOutputCap: (c: BrowserAgentConfig, stage: ThinkingStage, contextWindowTokens: number) => OutputCap;
|
|
2930
2969
|
/**
|
|
@@ -3204,6 +3243,12 @@ interface AgentContext {
|
|
|
3204
3243
|
setCurrentStep?: (step: IPlanStep | undefined) => void;
|
|
3205
3244
|
/** Images / PDFs / files the user sent with this run's goal. */
|
|
3206
3245
|
images?: RunFile[];
|
|
3246
|
+
/**
|
|
3247
|
+
* Set when this message carries no file but an earlier one of the session did: the sentence
|
|
3248
|
+
* the planner and the direct answer are given, so that a model does not take an earlier
|
|
3249
|
+
* message's picture for one it can see now.
|
|
3250
|
+
*/
|
|
3251
|
+
attachmentsNote?: string;
|
|
3207
3252
|
/** Everything the user said while the run was going (`RunControl.send`), oldest first. */
|
|
3208
3253
|
userUpdates?: () => string[];
|
|
3209
3254
|
/**
|
|
@@ -3494,13 +3539,21 @@ interface PlanOutcome {
|
|
|
3494
3539
|
usage: IUsage;
|
|
3495
3540
|
/** Names of configured skills the planner picked (validated). */
|
|
3496
3541
|
skills: string[];
|
|
3542
|
+
/**
|
|
3543
|
+
* Set when the planner produced NO plan at all - nothing to parse after every attempt (no
|
|
3544
|
+
* text, or text cut off before any of it could be read): why. Not the same as an empty plan,
|
|
3545
|
+
* which is the planner's decision that the message needs no tool.
|
|
3546
|
+
*/
|
|
3547
|
+
failed?: string;
|
|
3497
3548
|
}
|
|
3498
3549
|
/**
|
|
3499
3550
|
* Build the initial plan. Native mode uses generateStructured(PlanSchema); prompted
|
|
3500
3551
|
* mode salvages `{ reply, plan }` from plain text. Native failures (a weak model
|
|
3501
3552
|
* that can't satisfy the schema) fall back to the prompted parse rather than
|
|
3502
3553
|
* throwing, so the run degrades gracefully. An empty `steps` list signals the
|
|
3503
|
-
* runner to answer directly (greeting / small talk)
|
|
3554
|
+
* runner to answer directly (greeting / small talk / a question that needs no tool): the answer
|
|
3555
|
+
* is then written by the answering stage, never taken from `thought`. A call the default output
|
|
3556
|
+
* cap cut off while the model reasoned is repeated once without it (`withReasoningRoom`).
|
|
3504
3557
|
*/
|
|
3505
3558
|
declare const createPlan: (ctx: AgentContext, goal: string,
|
|
3506
3559
|
/** Extra instruction appended to the goal (used by the empty-plan retry). */
|
|
@@ -3631,19 +3684,34 @@ declare const decideReplan: (ctx: AgentContext, goal: string, done: string[], re
|
|
|
3631
3684
|
/** How many of the user's latest messages (`ctx.userUpdates()`) the plan has not been weighed against yet. */
|
|
3632
3685
|
newUpdates?: number) => Promise<ReplanOutcome>;
|
|
3633
3686
|
|
|
3687
|
+
/** How an answer is written. */
|
|
3688
|
+
interface SynthesizeOptions {
|
|
3689
|
+
/**
|
|
3690
|
+
* The plan was empty: no tool ran, and this call writes the whole answer to the user's message
|
|
3691
|
+
* (from the conversation, the state, the attachments and general knowledge).
|
|
3692
|
+
*/
|
|
3693
|
+
direct?: boolean;
|
|
3694
|
+
}
|
|
3695
|
+
interface SynthesizedAnswer {
|
|
3696
|
+
/** The answer; '' when the model wrote nothing usable (see `empty`). */
|
|
3697
|
+
text: string;
|
|
3698
|
+
usage: IUsage;
|
|
3699
|
+
/** Why there is no text, when there is none: the cap that cut the call off, or the finish reason. */
|
|
3700
|
+
empty?: string;
|
|
3701
|
+
}
|
|
3634
3702
|
/**
|
|
3635
3703
|
* Write the final natural-language answer of the run, streaming it as
|
|
3636
3704
|
* `final.text-delta` events (and thoughts as `final.reasoning-delta`). Plain
|
|
3637
3705
|
* text only (parsePlainText strips any stray JSON; deltas are suppressed
|
|
3638
3706
|
* entirely when the model drifts into JSON, so raw structure never reaches a
|
|
3639
|
-
* UI).
|
|
3707
|
+
* UI). With `direct` it is the answering path of an empty plan. A call the default output cap
|
|
3708
|
+
* cut off while the model reasoned, before any of the answer was shown, is made once more
|
|
3709
|
+
* without the cap. A model that returns nothing usable gives `text: ''` and the reason in
|
|
3710
|
+
* `empty` - never a stock sentence.
|
|
3640
3711
|
*/
|
|
3641
3712
|
declare const synthesizeAnswer: (ctx: AgentContext, goal: string, done: string[],
|
|
3642
3713
|
/** Excerpts of what the tools returned — the data the answer is made of. */
|
|
3643
|
-
findings?: string[]) => Promise<
|
|
3644
|
-
text: string;
|
|
3645
|
-
usage: IUsage;
|
|
3646
|
-
}>;
|
|
3714
|
+
findings?: string[], options?: SynthesizeOptions) => Promise<SynthesizedAnswer>;
|
|
3647
3715
|
|
|
3648
3716
|
/**
|
|
3649
3717
|
* A pipeline: a graph of agents with conditions and loops, described in plain JSON. The graph
|
|
@@ -4708,5 +4776,5 @@ declare const postStorageChange: (dbName: string | undefined, change: StorageCha
|
|
|
4708
4776
|
*/
|
|
4709
4777
|
declare const onStorageChange: (dbName: string | undefined, listener: (change: StorageChange) => void) => (() => void);
|
|
4710
4778
|
|
|
4711
|
-
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, 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, stream, supportsImages, supportsNativeTools, supportsPdf, supportsStructuredOutput, synthesizeAnswer, thinkingFor, toFilePart, toImagePart, tokenize, toolCatalogOf, toolDefinitionTokens, toolRunContextOf, unloadWebLLMModel, watchSession, webLLMContextWindow, withRollingBreakpoint, withSystem, withWebLLMContextWindow, wrapTranscript };
|
|
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 };
|
|
4712
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -1104,10 +1104,19 @@ type AgentEventBody =
|
|
|
1104
1104
|
waitedMs: number;
|
|
1105
1105
|
} | {
|
|
1106
1106
|
type: 'stopped';
|
|
1107
|
-
}
|
|
1107
|
+
}
|
|
1108
|
+
/**
|
|
1109
|
+
* `code`, when set, names a failure a host may want to say in its own words (and language):
|
|
1110
|
+
* `'no-plan'` - the planner returned nothing that could be read as a plan (no text, or text cut
|
|
1111
|
+
* off; `error` says by what); `'no-answer'` - the model wrote no answer to a message that
|
|
1112
|
+
* needed no tool. Both end the run (phase `'run'`, no `final` event), and `error` is the
|
|
1113
|
+
* result's `final`.
|
|
1114
|
+
*/
|
|
1115
|
+
| {
|
|
1108
1116
|
type: 'error';
|
|
1109
1117
|
phase: Phase | 'run';
|
|
1110
1118
|
error: string;
|
|
1119
|
+
code?: 'no-plan' | 'no-answer';
|
|
1111
1120
|
}
|
|
1112
1121
|
/** A pipeline's own events (`createPipeline`): the run, each node visit, each edge decision. */
|
|
1113
1122
|
| PipelineEvent;
|
|
@@ -1418,6 +1427,11 @@ interface PlannerPromptContext {
|
|
|
1418
1427
|
role: string;
|
|
1419
1428
|
content: string;
|
|
1420
1429
|
}[];
|
|
1430
|
+
/**
|
|
1431
|
+
* Set when this message carries no file but an earlier message of the session did: a sentence
|
|
1432
|
+
* saying so, so that the model does not take an earlier picture for one it can see now.
|
|
1433
|
+
*/
|
|
1434
|
+
attachments?: string;
|
|
1421
1435
|
/** "- name: description" index of the configured skills, when any. */
|
|
1422
1436
|
skills?: string;
|
|
1423
1437
|
/** The catalogue is condensed and the executor can search the rest (large catalogues). */
|
|
@@ -1455,6 +1469,8 @@ interface ExecutorPromptContext {
|
|
|
1455
1469
|
sandbox?: string;
|
|
1456
1470
|
/** Set while `spawn_subagent` is callable (`subagents.dynamic`): when to hand work to a helper. */
|
|
1457
1471
|
subagents?: string;
|
|
1472
|
+
/** See `PlannerPromptContext.attachments`: this message carries no file, an earlier one did. */
|
|
1473
|
+
attachments?: string;
|
|
1458
1474
|
}
|
|
1459
1475
|
interface ReplannerPromptContext {
|
|
1460
1476
|
goal: string;
|
|
@@ -1481,6 +1497,19 @@ interface SynthesizerPromptContext {
|
|
|
1481
1497
|
updates?: string[];
|
|
1482
1498
|
/** Set when `config.sandbox` is on: the output of code is reported only when `run_js` returned it. */
|
|
1483
1499
|
sandbox?: string;
|
|
1500
|
+
/**
|
|
1501
|
+
* Set when the plan was EMPTY (a greeting, small talk, a question that needs no tool): no step
|
|
1502
|
+
* ran, `done` and `findings` are empty, and this call writes the whole answer to the user's
|
|
1503
|
+
* message. A custom builder must handle it: it is the only answer the user gets.
|
|
1504
|
+
*/
|
|
1505
|
+
direct?: true;
|
|
1506
|
+
/** With `direct`: prior session messages (oldest first), the conversation the answer continues. */
|
|
1507
|
+
history?: {
|
|
1508
|
+
role: string;
|
|
1509
|
+
content: string;
|
|
1510
|
+
}[];
|
|
1511
|
+
/** See `PlannerPromptContext.attachments`: this message carries no file, an earlier one did. */
|
|
1512
|
+
attachments?: string;
|
|
1484
1513
|
}
|
|
1485
1514
|
interface Prompts {
|
|
1486
1515
|
planner(ctx: PlannerPromptContext): PromptParts;
|
|
@@ -1488,6 +1517,12 @@ interface Prompts {
|
|
|
1488
1517
|
replanner(ctx: ReplannerPromptContext): PromptParts;
|
|
1489
1518
|
synthesizer(ctx: SynthesizerPromptContext): PromptParts;
|
|
1490
1519
|
}
|
|
1520
|
+
/**
|
|
1521
|
+
* What a stage is told when THIS message carries no file but an earlier one did. Memory keeps
|
|
1522
|
+
* the names of a turn's files, not the files: without this a model reads "[attached: a.png]" in
|
|
1523
|
+
* the conversation and answers as if it saw a picture now.
|
|
1524
|
+
*/
|
|
1525
|
+
declare const NO_ATTACHMENT_NOTE = "NOTE: nothing is attached to THIS message. The files of earlier messages (marked \"[attached: ...]\" in the conversation) are not visible to you now - only what was said about them then is. If this message is about a file you cannot see, say so and ask the user to attach it again; never describe a file you cannot see.";
|
|
1491
1526
|
declare const defaultPrompts: Prompts;
|
|
1492
1527
|
/** Prepend a host-supplied systemPrompt to a phase system prompt, if present. */
|
|
1493
1528
|
declare const withSystem: (base: string, extra?: string) => string;
|
|
@@ -2918,13 +2953,17 @@ interface OutputCap {
|
|
|
2918
2953
|
/** true when it came from the window, false when the host set it (or turned it off with 0). */
|
|
2919
2954
|
derived: boolean;
|
|
2920
2955
|
}
|
|
2956
|
+
/** True once a call of `stage` reported reasoning tokens (see `observeReasoning`). */
|
|
2957
|
+
declare const stageReasons: (c: BrowserAgentConfig, stage: ThinkingStage) => boolean;
|
|
2921
2958
|
/**
|
|
2922
2959
|
* The output cap of one call of `stage` — the same rules as the Node sibling's `stageOutputCap`.
|
|
2923
2960
|
* What the host set (`limits.perCall`, then the legacy `budgets`) wins, and `0` is an explicit
|
|
2924
2961
|
* "no cap". Otherwise a share of the context window — except for a stage that thinks: on OpenAI
|
|
2925
2962
|
* and Gemini the reasoning counts against the cap, so a default sized for the answer alone would
|
|
2926
2963
|
* leave a thinking model no room to write it (or to finish a tool call's arguments). A stage that
|
|
2927
|
-
* thinks keeps the provider's own limit unless the host sets one.
|
|
2964
|
+
* thinks keeps the provider's own limit unless the host sets one. A stage thinks when the config
|
|
2965
|
+
* says so (`thinking` / `stageThinking`) or when a call of it was seen to (`observeReasoning`: a
|
|
2966
|
+
* model that reasons by default).
|
|
2928
2967
|
*/
|
|
2929
2968
|
declare const stageOutputCap: (c: BrowserAgentConfig, stage: ThinkingStage, contextWindowTokens: number) => OutputCap;
|
|
2930
2969
|
/**
|
|
@@ -3204,6 +3243,12 @@ interface AgentContext {
|
|
|
3204
3243
|
setCurrentStep?: (step: IPlanStep | undefined) => void;
|
|
3205
3244
|
/** Images / PDFs / files the user sent with this run's goal. */
|
|
3206
3245
|
images?: RunFile[];
|
|
3246
|
+
/**
|
|
3247
|
+
* Set when this message carries no file but an earlier one of the session did: the sentence
|
|
3248
|
+
* the planner and the direct answer are given, so that a model does not take an earlier
|
|
3249
|
+
* message's picture for one it can see now.
|
|
3250
|
+
*/
|
|
3251
|
+
attachmentsNote?: string;
|
|
3207
3252
|
/** Everything the user said while the run was going (`RunControl.send`), oldest first. */
|
|
3208
3253
|
userUpdates?: () => string[];
|
|
3209
3254
|
/**
|
|
@@ -3494,13 +3539,21 @@ interface PlanOutcome {
|
|
|
3494
3539
|
usage: IUsage;
|
|
3495
3540
|
/** Names of configured skills the planner picked (validated). */
|
|
3496
3541
|
skills: string[];
|
|
3542
|
+
/**
|
|
3543
|
+
* Set when the planner produced NO plan at all - nothing to parse after every attempt (no
|
|
3544
|
+
* text, or text cut off before any of it could be read): why. Not the same as an empty plan,
|
|
3545
|
+
* which is the planner's decision that the message needs no tool.
|
|
3546
|
+
*/
|
|
3547
|
+
failed?: string;
|
|
3497
3548
|
}
|
|
3498
3549
|
/**
|
|
3499
3550
|
* Build the initial plan. Native mode uses generateStructured(PlanSchema); prompted
|
|
3500
3551
|
* mode salvages `{ reply, plan }` from plain text. Native failures (a weak model
|
|
3501
3552
|
* that can't satisfy the schema) fall back to the prompted parse rather than
|
|
3502
3553
|
* throwing, so the run degrades gracefully. An empty `steps` list signals the
|
|
3503
|
-
* runner to answer directly (greeting / small talk)
|
|
3554
|
+
* runner to answer directly (greeting / small talk / a question that needs no tool): the answer
|
|
3555
|
+
* is then written by the answering stage, never taken from `thought`. A call the default output
|
|
3556
|
+
* cap cut off while the model reasoned is repeated once without it (`withReasoningRoom`).
|
|
3504
3557
|
*/
|
|
3505
3558
|
declare const createPlan: (ctx: AgentContext, goal: string,
|
|
3506
3559
|
/** Extra instruction appended to the goal (used by the empty-plan retry). */
|
|
@@ -3631,19 +3684,34 @@ declare const decideReplan: (ctx: AgentContext, goal: string, done: string[], re
|
|
|
3631
3684
|
/** How many of the user's latest messages (`ctx.userUpdates()`) the plan has not been weighed against yet. */
|
|
3632
3685
|
newUpdates?: number) => Promise<ReplanOutcome>;
|
|
3633
3686
|
|
|
3687
|
+
/** How an answer is written. */
|
|
3688
|
+
interface SynthesizeOptions {
|
|
3689
|
+
/**
|
|
3690
|
+
* The plan was empty: no tool ran, and this call writes the whole answer to the user's message
|
|
3691
|
+
* (from the conversation, the state, the attachments and general knowledge).
|
|
3692
|
+
*/
|
|
3693
|
+
direct?: boolean;
|
|
3694
|
+
}
|
|
3695
|
+
interface SynthesizedAnswer {
|
|
3696
|
+
/** The answer; '' when the model wrote nothing usable (see `empty`). */
|
|
3697
|
+
text: string;
|
|
3698
|
+
usage: IUsage;
|
|
3699
|
+
/** Why there is no text, when there is none: the cap that cut the call off, or the finish reason. */
|
|
3700
|
+
empty?: string;
|
|
3701
|
+
}
|
|
3634
3702
|
/**
|
|
3635
3703
|
* Write the final natural-language answer of the run, streaming it as
|
|
3636
3704
|
* `final.text-delta` events (and thoughts as `final.reasoning-delta`). Plain
|
|
3637
3705
|
* text only (parsePlainText strips any stray JSON; deltas are suppressed
|
|
3638
3706
|
* entirely when the model drifts into JSON, so raw structure never reaches a
|
|
3639
|
-
* UI).
|
|
3707
|
+
* UI). With `direct` it is the answering path of an empty plan. A call the default output cap
|
|
3708
|
+
* cut off while the model reasoned, before any of the answer was shown, is made once more
|
|
3709
|
+
* without the cap. A model that returns nothing usable gives `text: ''` and the reason in
|
|
3710
|
+
* `empty` - never a stock sentence.
|
|
3640
3711
|
*/
|
|
3641
3712
|
declare const synthesizeAnswer: (ctx: AgentContext, goal: string, done: string[],
|
|
3642
3713
|
/** Excerpts of what the tools returned — the data the answer is made of. */
|
|
3643
|
-
findings?: string[]) => Promise<
|
|
3644
|
-
text: string;
|
|
3645
|
-
usage: IUsage;
|
|
3646
|
-
}>;
|
|
3714
|
+
findings?: string[], options?: SynthesizeOptions) => Promise<SynthesizedAnswer>;
|
|
3647
3715
|
|
|
3648
3716
|
/**
|
|
3649
3717
|
* A pipeline: a graph of agents with conditions and loops, described in plain JSON. The graph
|
|
@@ -4708,5 +4776,5 @@ declare const postStorageChange: (dbName: string | undefined, change: StorageCha
|
|
|
4708
4776
|
*/
|
|
4709
4777
|
declare const onStorageChange: (dbName: string | undefined, listener: (change: StorageChange) => void) => (() => void);
|
|
4710
4778
|
|
|
4711
|
-
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, 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, stream, supportsImages, supportsNativeTools, supportsPdf, supportsStructuredOutput, synthesizeAnswer, thinkingFor, toFilePart, toImagePart, tokenize, toolCatalogOf, toolDefinitionTokens, toolRunContextOf, unloadWebLLMModel, watchSession, webLLMContextWindow, withRollingBreakpoint, withSystem, withWebLLMContextWindow, wrapTranscript };
|
|
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 };
|
|
4712
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 };
|