@dudko.dev/agent-web 0.0.47 → 0.0.48
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 +12 -2
- package/dist/agent-web.js +124 -124
- package/dist/agent-web.js.map +1 -1
- package/dist/{chunk-Y6CD3WOK.js → chunk-6D4RB3H5.js} +11 -213
- package/dist/chunk-6D4RB3H5.js.map +1 -0
- package/dist/{chunk-PTJA7V23.js → chunk-6XHCPSZE.js} +5 -3
- package/dist/{chunk-PTJA7V23.js.map → chunk-6XHCPSZE.js.map} +1 -1
- package/dist/{chunk-Y4MIIBPB.js → chunk-7D2CJQB2.js} +1 -100
- package/dist/chunk-7D2CJQB2.js.map +1 -0
- package/dist/chunk-7Y5UC6L7.js +52 -0
- package/dist/chunk-7Y5UC6L7.js.map +1 -0
- package/dist/chunk-IT77BVAD.js +99 -0
- package/dist/chunk-IT77BVAD.js.map +1 -0
- package/dist/chunk-JTZEUPIG.js +217 -0
- package/dist/chunk-JTZEUPIG.js.map +1 -0
- package/dist/index.cjs +33 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +25 -66
- package/dist/index.d.ts +25 -66
- package/dist/index.js +35 -68
- package/dist/index.js.map +1 -1
- package/dist/mcp.cjs +28 -20
- package/dist/mcp.cjs.map +1 -1
- package/dist/mcp.d.cts +4 -3
- package/dist/mcp.d.ts +4 -3
- package/dist/mcp.js +9 -5
- package/dist/mcp.js.map +1 -1
- package/dist/{sandbox-ZXWD5IWZ.js → sandbox-IGTCMOOX.js} +4 -3
- package/dist/{sandbox-ZXWD5IWZ.js.map → sandbox-IGTCMOOX.js.map} +1 -1
- package/dist/secrets.cjs +329 -0
- package/dist/secrets.cjs.map +1 -0
- package/dist/secrets.d.cts +63 -0
- package/dist/secrets.d.ts +63 -0
- package/dist/secrets.js +20 -0
- package/dist/secrets.js.map +1 -0
- package/dist/{vault-Mar2CY0J.d.ts → skills-ufoyTJ-B.d.cts} +2 -36
- package/dist/{vault-Mar2CY0J.d.cts → skills-ufoyTJ-B.d.ts} +2 -36
- package/dist/vault-BBGybouF.d.cts +35 -0
- package/dist/vault-BBGybouF.d.ts +35 -0
- package/package.json +11 -1
- package/dist/chunk-Y4MIIBPB.js.map +0 -1
- package/dist/chunk-Y6CD3WOK.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { LanguageModel, Experimental_DecisionModel, Tool, ToolSet, FilePart, ImageModel, SpeechModel, TranscriptionModel, SystemModelMessage, ModelMessage, generateText, streamText } from 'ai';
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
2
|
+
import { P as McpSkillConsentView, B as McpElicitationSchema, y as McpElicitationReason, e as McpAppToolResult, Q as McpSkillSource, R as McpSkillConsent, S as McpSkillGrants, T as McpSkillRunConsent, U as McpSkillSnapshotMemory } from './skills-ufoyTJ-B.cjs';
|
|
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 { CredentialStore } from './secrets.cjs';
|
|
7
|
+
export { EncryptedBlob, MemoryCredentialStore, VaultCredentialStore, decryptJSON, encryptJSON, getOrCreateVaultKey } from './secrets.cjs';
|
|
6
8
|
import { A as AgentToolSet, a as AgentTool } from './types-DwSMj_Xs.cjs';
|
|
7
9
|
export { p as promptHintOf } from './types-DwSMj_Xs.cjs';
|
|
8
10
|
import { z, ZodType } from 'zod';
|
|
11
|
+
export { I as IndexedDBVault, V as VaultOptions } from './vault-BBGybouF.cjs';
|
|
9
12
|
import { IDBPDatabase } from 'idb';
|
|
10
13
|
|
|
11
14
|
/** Executor models by strength (`config.executorTiers`), weakest first. */
|
|
@@ -1688,40 +1691,6 @@ declare const defaultPrompts: Prompts;
|
|
|
1688
1691
|
/** Prepend a host-supplied systemPrompt to a phase system prompt, if present. */
|
|
1689
1692
|
declare const withSystem: (base: string, extra?: string) => string;
|
|
1690
1693
|
|
|
1691
|
-
/**
|
|
1692
|
-
* The seam the provider registry uses to fetch API keys at model-build time.
|
|
1693
|
-
* Swap in any backend: the encrypted vault (default), an in-memory map (tests /
|
|
1694
|
-
* SSR), or a `fetch` to your own short-lived-token endpoint.
|
|
1695
|
-
*/
|
|
1696
|
-
interface CredentialStore {
|
|
1697
|
-
getApiKey(ref: string): Promise<string | undefined>;
|
|
1698
|
-
setApiKey(ref: string, key: string): Promise<void>;
|
|
1699
|
-
deleteApiKey(ref: string): Promise<void>;
|
|
1700
|
-
}
|
|
1701
|
-
/**
|
|
1702
|
-
* Default CredentialStore: encrypted, IndexedDB-backed (see IndexedDBVault). Every tab of the
|
|
1703
|
-
* origin shares it: a key stored or removed tells the other tabs that SOMETHING changed (a
|
|
1704
|
-
* `credentials` notice: no ref, never a key - see `onStorageChange`).
|
|
1705
|
-
*/
|
|
1706
|
-
declare class VaultCredentialStore implements CredentialStore {
|
|
1707
|
-
/** The database the vault lives in, and the name its change notices go out under. */
|
|
1708
|
-
readonly dbName: string;
|
|
1709
|
-
private readonly vault;
|
|
1710
|
-
private readonly tab;
|
|
1711
|
-
constructor(opts?: VaultOptions);
|
|
1712
|
-
getApiKey(ref: string): Promise<string | undefined>;
|
|
1713
|
-
setApiKey(ref: string, key: string): Promise<void>;
|
|
1714
|
-
deleteApiKey(ref: string): Promise<void>;
|
|
1715
|
-
}
|
|
1716
|
-
/** Non-persistent CredentialStore for tests / SSR / ephemeral sessions. */
|
|
1717
|
-
declare class MemoryCredentialStore implements CredentialStore {
|
|
1718
|
-
private readonly map;
|
|
1719
|
-
constructor(initial?: Record<string, string>);
|
|
1720
|
-
getApiKey(ref: string): Promise<string | undefined>;
|
|
1721
|
-
setApiKey(ref: string, key: string): Promise<void>;
|
|
1722
|
-
deleteApiKey(ref: string): Promise<void>;
|
|
1723
|
-
}
|
|
1724
|
-
|
|
1725
1694
|
/**
|
|
1726
1695
|
* A small virtual file system for the browser — the agent's (and the user's)
|
|
1727
1696
|
* workspace: attachments the user drops in, reports the agent writes, images
|
|
@@ -4433,29 +4402,6 @@ declare const supportsImages: (model: unknown) => boolean | undefined;
|
|
|
4433
4402
|
*/
|
|
4434
4403
|
declare const supportsPdf: (model: unknown) => boolean | undefined;
|
|
4435
4404
|
|
|
4436
|
-
/**
|
|
4437
|
-
* Fetch (or lazily create) the vault's AES-GCM key. The key is generated
|
|
4438
|
-
* NON-EXTRACTABLE and stored as a live `CryptoKey` in IndexedDB — a CryptoKey
|
|
4439
|
-
* is structured-cloneable, so it persists across reloads WITHOUT its raw bytes
|
|
4440
|
-
* ever being exposed to JavaScript. Not even in-page script can read it out; it
|
|
4441
|
-
* can only be used to encrypt / decrypt. That is what makes at-rest storage of
|
|
4442
|
-
* the secrets meaningful (see IndexedDBVault's threat model).
|
|
4443
|
-
*
|
|
4444
|
-
* Concurrent callers share one in-flight promise per DB, and creation is
|
|
4445
|
-
* double-checked in a single IDB transaction, so two racing writers can never
|
|
4446
|
-
* end up encrypting under different keys.
|
|
4447
|
-
*/
|
|
4448
|
-
declare const getOrCreateVaultKey: (dbName?: string) => Promise<CryptoKey>;
|
|
4449
|
-
interface EncryptedBlob {
|
|
4450
|
-
/** 96-bit random IV, fresh per write. */
|
|
4451
|
-
iv: Uint8Array;
|
|
4452
|
-
ciphertext: ArrayBuffer;
|
|
4453
|
-
}
|
|
4454
|
-
/** Encrypt a JSON-serialisable value with a fresh 96-bit IV (AES-GCM). */
|
|
4455
|
-
declare const encryptJSON: (key: CryptoKey, value: unknown) => Promise<EncryptedBlob>;
|
|
4456
|
-
/** Decrypt a blob produced by encryptJSON. Throws if the key or blob don't match. */
|
|
4457
|
-
declare const decryptJSON: <T = unknown>(key: CryptoKey, blob: EncryptedBlob) => Promise<T>;
|
|
4458
|
-
|
|
4459
4405
|
interface AgentWebDBOptions {
|
|
4460
4406
|
/** Database name (default 'agent-web'). Use a distinct name to isolate apps. */
|
|
4461
4407
|
dbName?: string;
|
|
@@ -4471,6 +4417,16 @@ declare const RUNS_STORE = "runs";
|
|
|
4471
4417
|
* lives under ONE database name + version. Centralising `openDB` here prevents
|
|
4472
4418
|
* the classic bug where two modules open the same DB name with different store
|
|
4473
4419
|
* sets and the second call throws a VersionError.
|
|
4420
|
+
*
|
|
4421
|
+
* One connection per name, shared by every store of the page - and never in another tab's way:
|
|
4422
|
+
* when another connection asks to delete or upgrade the database (`versionchange`: another tab's
|
|
4423
|
+
* `indexedDB.deleteDatabase`, or a newer copy of this package), this one is closed at once, so
|
|
4424
|
+
* that request goes ahead instead of waiting (blocked) for this tab to close. The browser lets the
|
|
4425
|
+
* transactions already under way finish first. A connection the browser closed by itself (site
|
|
4426
|
+
* data cleared, storage gone) is let go too. Either way the next use opens the database again:
|
|
4427
|
+
* after a deletion that is a NEW, EMPTY database at this version (every store of this package
|
|
4428
|
+
* starts from nothing - no key, no secret, no session, no file); after an upgrade by a newer copy,
|
|
4429
|
+
* the open fails with a `VersionError` until the page is reloaded with that copy.
|
|
4474
4430
|
*/
|
|
4475
4431
|
declare const openAgentWebDB: (opts?: AgentWebDBOptions) => Promise<IDBPDatabase>;
|
|
4476
4432
|
|
|
@@ -4974,8 +4930,10 @@ declare class IndexedDBRunStore implements RunPersistence {
|
|
|
4974
4930
|
* - `skills` - `VfsSkillStore` (the agent's lessons): `key` = the lesson's name, `namespace` =
|
|
4975
4931
|
* the store's folder.
|
|
4976
4932
|
* - `chats` - the React package's `ChatHistoryStore`: `key` = the chat id.
|
|
4933
|
+
* - `host` - a store of the host's own that is none of the above (`postStorageChange`): `key` =
|
|
4934
|
+
* which record, `namespace` = which of the host's stores - names the host chose, never a value.
|
|
4977
4935
|
*/
|
|
4978
|
-
type StorageChangeKind = 'credentials' | 'oauth' | 'files' | 'session' | 'runs' | 'skills' | 'chats';
|
|
4936
|
+
type StorageChangeKind = 'credentials' | 'oauth' | 'files' | 'session' | 'runs' | 'skills' | 'chats' | 'host';
|
|
4979
4937
|
/** `put` = written (created or replaced), `delete` = one removed, `clear` = all of them removed. */
|
|
4980
4938
|
type StorageChangeOp = 'put' | 'delete' | 'clear';
|
|
4981
4939
|
interface StorageChange {
|
|
@@ -4983,15 +4941,16 @@ interface StorageChange {
|
|
|
4983
4941
|
op: StorageChangeOp;
|
|
4984
4942
|
/** Which one (see `StorageChangeKind`); absent for `clear` and for the kinds that carry none. */
|
|
4985
4943
|
key?: string;
|
|
4986
|
-
/** `files`: the file system's namespace; `skills`: the store's folder. */
|
|
4944
|
+
/** `files`: the file system's namespace; `skills`: the store's folder; `host`: which store. */
|
|
4987
4945
|
namespace?: string;
|
|
4988
4946
|
}
|
|
4989
4947
|
declare const STORAGE_CHANGE_KINDS: readonly StorageChangeKind[];
|
|
4990
4948
|
/**
|
|
4991
4949
|
* Tell the other tabs that a store in database `dbName` changed - for a store of your own on
|
|
4992
|
-
* IndexedDB (the built-in ones post their own)
|
|
4993
|
-
*
|
|
4994
|
-
*
|
|
4950
|
+
* IndexedDB (the built-in ones post their own): one of the built-in kinds when it keeps that kind
|
|
4951
|
+
* of thing, `host` for anything else (`namespace` names which of your stores, `key` which record).
|
|
4952
|
+
* Call it AFTER the write committed. Never put a value in it: a notice says which, not what. A
|
|
4953
|
+
* no-op without `dbName` or BroadcastChannel; a notice of the wrong shape is dropped.
|
|
4995
4954
|
*/
|
|
4996
4955
|
declare const postStorageChange: (dbName: string | undefined, change: StorageChange) => void;
|
|
4997
4956
|
/**
|
|
@@ -5002,5 +4961,5 @@ declare const postStorageChange: (dbName: string | undefined, change: StorageCha
|
|
|
5002
4961
|
*/
|
|
5003
4962
|
declare const onStorageChange: (dbName: string | undefined, listener: (change: StorageChange) => void) => (() => void);
|
|
5004
4963
|
|
|
5005
|
-
export { APP_SAMPLING_MAX_IMAGES, APP_SAMPLING_MAX_IMAGE_BYTES, APP_SAMPLING_MAX_INPUT_CHARS, APP_SAMPLING_MAX_MESSAGES, APP_SAMPLING_MAX_SYSTEM_CHARS, APP_SAMPLING_MAX_TOKENS, APP_SAMPLING_PER_APP, APP_SAMPLING_PER_MINUTE, APP_SAMPLING_REASONING_TOKENS, APP_SAMPLING_RPC_CODES, ASK_USER_DESCRIPTION_MAX_CHARS, ASK_USER_LABEL_MAX_CHARS, ASK_USER_MAX_OPTIONS, ASK_USER_MAX_PER_RUN, ASK_USER_MIN_OPTIONS, ASK_USER_OTHER_MAX_CHARS, ASK_USER_QUESTION_MAX_CHARS, ASK_USER_TIMEOUT_MAX_MS, ASK_USER_TIMEOUT_MS, ASK_USER_TOOL, AgentTool, AgentToolSet, AppSamplingError, AskUserInputError, AttachmentsNotSupportedError, ContextWindowExceededError, DECISION_PROVIDERS, DEFAULT_COMPACTION_THRESHOLD_RATIO, DEFAULT_DECISION_CONFIDENCE_THRESHOLD, DEFAULT_DECISION_TIMEOUT_MS, EgressError, FILES_STORE, FIND_TOOLS_NAME, FORGET_SKILL_TOOL, GENERATE_IMAGE_TOOL, GENERATE_SPEECH_TOOL, ImagesNotSupportedError, IndexedDBRunStore, IndexedDBStore, KEYS_STORE, MEDIA_AUDIO_TYPES, MEDIA_DEFAULT_MAX_CALLS, MEDIA_FOLDER, MEDIA_IMAGE_TYPES, MEDIA_MAX_ATTACHED_AUDIO, MEDIA_MAX_AUDIO_INPUT_BYTES, MEDIA_MAX_IMAGE_BYTES, MEDIA_MAX_PROMPT_CHARS, MEDIA_MAX_SPEECH_BYTES, MEDIA_MAX_SPEECH_CHARS, MEDIA_MAX_TRANSCRIPT_CHARS, MEDIA_TIMEOUT_MS, MODEL_TIERS, McpAppToolResult, McpElicitationReason, McpElicitationSchema, McpSkillConsent, McpSkillConsentView, MediaBudgetError, MediaError,
|
|
5006
|
-
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,
|
|
4964
|
+
export { APP_SAMPLING_MAX_IMAGES, APP_SAMPLING_MAX_IMAGE_BYTES, APP_SAMPLING_MAX_INPUT_CHARS, APP_SAMPLING_MAX_MESSAGES, APP_SAMPLING_MAX_SYSTEM_CHARS, APP_SAMPLING_MAX_TOKENS, APP_SAMPLING_PER_APP, APP_SAMPLING_PER_MINUTE, APP_SAMPLING_REASONING_TOKENS, APP_SAMPLING_RPC_CODES, ASK_USER_DESCRIPTION_MAX_CHARS, ASK_USER_LABEL_MAX_CHARS, ASK_USER_MAX_OPTIONS, ASK_USER_MAX_PER_RUN, ASK_USER_MIN_OPTIONS, ASK_USER_OTHER_MAX_CHARS, ASK_USER_QUESTION_MAX_CHARS, ASK_USER_TIMEOUT_MAX_MS, ASK_USER_TIMEOUT_MS, ASK_USER_TOOL, AgentTool, AgentToolSet, AppSamplingError, AskUserInputError, AttachmentsNotSupportedError, ContextWindowExceededError, CredentialStore, DECISION_PROVIDERS, DEFAULT_COMPACTION_THRESHOLD_RATIO, DEFAULT_DECISION_CONFIDENCE_THRESHOLD, DEFAULT_DECISION_TIMEOUT_MS, EgressError, FILES_STORE, FIND_TOOLS_NAME, FORGET_SKILL_TOOL, GENERATE_IMAGE_TOOL, GENERATE_SPEECH_TOOL, ImagesNotSupportedError, IndexedDBRunStore, IndexedDBStore, KEYS_STORE, MEDIA_AUDIO_TYPES, MEDIA_DEFAULT_MAX_CALLS, MEDIA_FOLDER, MEDIA_IMAGE_TYPES, MEDIA_MAX_ATTACHED_AUDIO, MEDIA_MAX_AUDIO_INPUT_BYTES, MEDIA_MAX_IMAGE_BYTES, MEDIA_MAX_PROMPT_CHARS, MEDIA_MAX_SPEECH_BYTES, MEDIA_MAX_SPEECH_CHARS, MEDIA_MAX_TRANSCRIPT_CHARS, MEDIA_TIMEOUT_MS, MODEL_TIERS, McpAppToolResult, McpElicitationReason, McpElicitationSchema, McpSkillConsent, McpSkillConsentView, MediaBudgetError, MediaError, MemoryRunStore, MemorySkillStore, MemoryStore, NO_ATTACHMENT_NOTE, PipelineDefinition, PipelineEvent, PipelineNode, PipelineNodeRunner, PipelineResult, PlanSchema, PlanStepSchema, RELAY_MAX_REPLAYS_PER_SECOND, RELAY_MAX_SENDS, RELAY_MAX_SEND_CHARS, RELAY_MAX_STRING, REPLAY_NOTE, RUNS_STORE, ReplanSchema, SAVE_SKILL_TOOL, SEARCH_API_BASE_URL, SEARCH_DEFAULT_MAX_RESULTS, SEARCH_GOOGLE_DEFAULT_MODEL, SEARCH_GOOGLE_NOTE, SEARCH_MAX_QUERY_CHARS, SEARCH_MAX_RESULTS, SEARCH_MAX_SNIPPET_CHARS, SEARCH_MAX_SUMMARY_CHARS, SEARCH_MAX_TITLE_CHARS, SEARCH_MAX_TOTAL_CHARS, SEARCH_MAX_URL_CHARS, SEARCH_PROVIDERS, SECRETS_STORE, SESSIONS_STORE, SESSION_LOCK_MODES, SKILL_TOOL_NAMES, SPAWN_INPUT_SCHEMA, SPAWN_SUBAGENT_TOOL, STORAGE_CHANGE_KINDS, SUBAGENT_DEFAULTS, SUBAGENT_MAX_DEPTH_LIMIT, SessionBusyError, SubagentSpawnError, TOOL_APPROVAL_MODES, TOOL_APPROVAL_TIMEOUT_MS, TOOL_SEARCH_WINDOW_SHARE, TRANSCRIBE_AUDIO_TOOL, TieredPlanSchema, TieredPlanStepSchema, ToolBudgetError, ToolDeniedError, VfsSkillStore, VirtualFileSystem, WEBLLM_DEFAULT_CONTEXT_WINDOW, WEB_FETCH_TOOL, WEB_SEARCH_TOOL, acceptMedia, adoptSubagentEvent, appSamplingRequestOf, appSamplingText, askDecisionModel, attachmentKind, buildMediaModelFromSpec, buildModelFromStage, buildSearchRequest, bytesToBase64, checkAskUserAnswer, checkAskUserInput, checkEgressUrl, checkLimits, classifyAddress, cleanAskUserText, compactHistory, compactSteps, compressHistory, contextOverflowOf, contextWindowOf, createAgent, createAppSamplingLimiter, createEgressTools, createFileTools, createFindToolsTool, createGuardedFetch, createLearning, createLogger, createMedia, createPipeline, createPlan, createRunControl, createSearchTools, createSkillTools, createSubagentTool, createToolResultClearer, createWebFetchTool, createWebLLMModel, createWebSearchTool, decideReplan, decideToolPermission, decisionEgressPolicy, decisionModelFromAiSdk, defaultPrompts, defineSkill, defineTool, directBrowserOk, dispatch, escalationReasonOf, messageTokens as estimateMessagesTokens, estimateTokens, executeStep, fileToolBindingOf, findSecret, fitCompactionToWindow, generate, generateStructured, hostMatches, htmlToText, isAttachmentRefusal, isCodeExecutionTool, isDirectModel, isEscalatableError, isImageRefusal, isProviderSpec, isReadOnlyTool, isReplayedToolOutput, isTextMime, isWebGPUAvailable, learnedPreamble, limitModelOutput, loadSkillFromUrl, looksLikeJson, markCodeExecution, markReadOnly, matchRule, mediaTypeOf, mediaUsageOf, mergeProviderOptions, mimeFromPath, nextStrongerTier, nodeResolver, normalizePath, normalizeSkillName, normalizeSteps, normalizeUsage, onStorageChange, openAgentWebDB, outputCapNotice, parseExecutorResponse, parsePlainText, parsePlannerResponse, parseReplannerResponse, parseSearchResponse, parseSkillMarkdown, pickPipelineRoute, pickTier, postStorageChange, preloadWebLLMModel, renderActiveSkills, renderCatalog, renderSearchCatalog, renderSkillIndex, replanWanted, resolveAppSampling, resolveBudgets, resolveCaching, resolveCompaction, resolveConfig, resolveDecisionModel, resolveDynamicSubagents, resolveEgressPolicy, resolveEscalation, resolveModel, resolveResume, resolveStage, resolveThinking, runToolLoop, sanitizeSearchResults, schemaHintOf, searchEgressPolicy, searchStatusMessage, searchToolResult, searchTools, selectToolMode, serveSubagentWorker, shouldReplan, skillPreamble, sniffMediaType, splitBlocker, stageOutputCap, stageReasons, stream, supportsImages, supportsNativeTools, supportsPdf, supportsStructuredOutput, synthesizeAnswer, thinkingFor, toFilePart, toImagePart, tokenize, toolCatalogOf, toolDefinitionTokens, toolRunContextOf, unloadWebLLMModel, watchSession, webLLMContextWindow, withRollingBreakpoint, withSystem, withWebLLMContextWindow, wrapTranscript };
|
|
4965
|
+
export type { Agent, AgentContext, AgentEvent, AgentEventHandler, AgentLogger, AgentLoggerSink, AgentWebDBOptions, AppSamplingErrorCode, AppSamplingImage, AppSamplingMessage, AppSamplingOptions, AppSamplingRequest, AppSamplingResult, AppSamplingSettings, AppSamplingView, AppToolCallRequest, AskUserAction, AskUserAnswer, AskUserCheckedAnswer, AskUserConfig, AskUserContext, AskUserHandler, AskUserOption, AskUserQuestion, AskUserReason, AskUserRequest, AttachmentKind, BrowserAgentConfig, ClearedInfo, CompactOptions, CompactResult, CompactionConfig, CompressOptions, ContextStore, DecisionFallbackReason, DecisionPoint, EffectiveToolStrategy, EgressErrorCode, EscalationConfig, EscalationReason, ExecutorPromptContext, ExecutorResult, FileToolBinding, FileToolsOptions, GenerateOptions, GuardedFetch, IAiSdkDecisionOptions, IDecisionAnswer, IDecisionCallOptions, IDecisionConfig, IDecisionEvent, IDecisionModel, IDecisionModelSpec, IDecisionOption, IDecisionOutcome, IDecisionQuestion, IDynamicSubagentsConfig, IEgressPolicy, IMedia, IMediaConfig, IMediaFile, IMediaModelSpec, IMediaOptions, IMediaRun, IMediaUsage, IPlan, IPlanStep, IResolvedDynamicSubagents, IResolvedEgressPolicy, ISandboxConfig, ISandboxError, ISandboxLimits, ISandboxResult, ISanitizedSearch, ISearchAnswer, ISearchConfig, ISearchOptions, ISearchRequest, ISearchResult, ISearchToolResult, ISearchUsage, IStepEscalation, IStepResult, ISubagentsConfig, IToolCall, ITranscription, IUsage, IWebFetchOptions, IWebSearchOptions, IndexedDBRunStoreOptions, IndexedDBStoreOptions, Learning, LearningConfig, LimitBreach, LimitKind, LoadSkillOptions, LogLevel, McpSkillOrigin, MediaImageModel, MediaKind, MediaModelKind, MediaSpeechModel, MediaTranscriptionModel, MessageEndpoint, ModelInput, ModelTier, NodeResolverOptions, OutputCap, ParentToWorker, Phase, PhaseBudgets, Pipeline, PipelineOptions, PipelineRouteOptions, PipelineRouteResult, PipelineRunOptions, PlanShape, PlannerPromptContext, PlannerResult, PromptCachingSetting, PromptParts, Prompts, ProviderModelSpec, ProviderOptionsMap, ProviderType, ProxiedToolSpec, RawAction, ReplanDecision, ReplanMode, ReplanShape, ReplanTrigger, ReplannerPromptContext, ReplannerResult, ResolvedCaching, ResolvedCompaction, ResolvedConfig, ResolvedStage, ResolvedThinking, RunControl, RunFile, RunImage, RunOptions, RunPersistence, RunResult, RunSnapshot, RunStatus, RunStoreOptions, SandboxConfig, SandboxWorkerLike, SaveSkillInput, SearchEngine, SearchFreshness, SearchProvider, SearchToolsOptions, ServeSubagentOptions, SessionHolder, SessionLockMode, SessionRunState, SessionWatch, Skill, SkillOrigin, SkillStore, StageInput, StageOverride, StepComplexity, StorageChange, StorageChangeKind, StorageChangeOp, StoredMessage, StructuredResult, SubagentDefaultTools, SubagentInfo, SubagentProfile, SubagentToolOptions, SubagentWorkerConfig, SynthesizerPromptContext, ThinkingConfig, ThinkingLevel, ThinkingSetting, ThinkingStage, TierReason, TokenLimits, ToolApprovalApp, ToolApprovalConfig, ToolApprovalContext, ToolApprovalDecision, ToolApprovalMode, ToolApprovalRequest, ToolCallMode, ToolCatalogEntry, ToolLoopCallbacks, ToolLoopOptions, ToolLoopResult, ToolMode, ToolPermission, ToolResultClearing, ToolRunContext, ToolSelectionStrategy, UsagePhase, VfsListener, VirtualFile, VirtualFileInfo, VirtualFileSystemOptions, WatchSessionOptions, WebLLMAppConfigLike, WebLLMModelOptions, WorkerLike, WorkerToParent };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { LanguageModel, Experimental_DecisionModel, Tool, ToolSet, FilePart, ImageModel, SpeechModel, TranscriptionModel, SystemModelMessage, ModelMessage, generateText, streamText } from 'ai';
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
2
|
+
import { P as McpSkillConsentView, B as McpElicitationSchema, y as McpElicitationReason, e as McpAppToolResult, Q as McpSkillSource, R as McpSkillConsent, S as McpSkillGrants, T as McpSkillRunConsent, U as McpSkillSnapshotMemory } from './skills-ufoyTJ-B.js';
|
|
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 { CredentialStore } from './secrets.js';
|
|
7
|
+
export { EncryptedBlob, MemoryCredentialStore, VaultCredentialStore, decryptJSON, encryptJSON, getOrCreateVaultKey } from './secrets.js';
|
|
6
8
|
import { A as AgentToolSet, a as AgentTool } from './types-DwSMj_Xs.js';
|
|
7
9
|
export { p as promptHintOf } from './types-DwSMj_Xs.js';
|
|
8
10
|
import { z, ZodType } from 'zod';
|
|
11
|
+
export { I as IndexedDBVault, V as VaultOptions } from './vault-BBGybouF.js';
|
|
9
12
|
import { IDBPDatabase } from 'idb';
|
|
10
13
|
|
|
11
14
|
/** Executor models by strength (`config.executorTiers`), weakest first. */
|
|
@@ -1688,40 +1691,6 @@ declare const defaultPrompts: Prompts;
|
|
|
1688
1691
|
/** Prepend a host-supplied systemPrompt to a phase system prompt, if present. */
|
|
1689
1692
|
declare const withSystem: (base: string, extra?: string) => string;
|
|
1690
1693
|
|
|
1691
|
-
/**
|
|
1692
|
-
* The seam the provider registry uses to fetch API keys at model-build time.
|
|
1693
|
-
* Swap in any backend: the encrypted vault (default), an in-memory map (tests /
|
|
1694
|
-
* SSR), or a `fetch` to your own short-lived-token endpoint.
|
|
1695
|
-
*/
|
|
1696
|
-
interface CredentialStore {
|
|
1697
|
-
getApiKey(ref: string): Promise<string | undefined>;
|
|
1698
|
-
setApiKey(ref: string, key: string): Promise<void>;
|
|
1699
|
-
deleteApiKey(ref: string): Promise<void>;
|
|
1700
|
-
}
|
|
1701
|
-
/**
|
|
1702
|
-
* Default CredentialStore: encrypted, IndexedDB-backed (see IndexedDBVault). Every tab of the
|
|
1703
|
-
* origin shares it: a key stored or removed tells the other tabs that SOMETHING changed (a
|
|
1704
|
-
* `credentials` notice: no ref, never a key - see `onStorageChange`).
|
|
1705
|
-
*/
|
|
1706
|
-
declare class VaultCredentialStore implements CredentialStore {
|
|
1707
|
-
/** The database the vault lives in, and the name its change notices go out under. */
|
|
1708
|
-
readonly dbName: string;
|
|
1709
|
-
private readonly vault;
|
|
1710
|
-
private readonly tab;
|
|
1711
|
-
constructor(opts?: VaultOptions);
|
|
1712
|
-
getApiKey(ref: string): Promise<string | undefined>;
|
|
1713
|
-
setApiKey(ref: string, key: string): Promise<void>;
|
|
1714
|
-
deleteApiKey(ref: string): Promise<void>;
|
|
1715
|
-
}
|
|
1716
|
-
/** Non-persistent CredentialStore for tests / SSR / ephemeral sessions. */
|
|
1717
|
-
declare class MemoryCredentialStore implements CredentialStore {
|
|
1718
|
-
private readonly map;
|
|
1719
|
-
constructor(initial?: Record<string, string>);
|
|
1720
|
-
getApiKey(ref: string): Promise<string | undefined>;
|
|
1721
|
-
setApiKey(ref: string, key: string): Promise<void>;
|
|
1722
|
-
deleteApiKey(ref: string): Promise<void>;
|
|
1723
|
-
}
|
|
1724
|
-
|
|
1725
1694
|
/**
|
|
1726
1695
|
* A small virtual file system for the browser — the agent's (and the user's)
|
|
1727
1696
|
* workspace: attachments the user drops in, reports the agent writes, images
|
|
@@ -4433,29 +4402,6 @@ declare const supportsImages: (model: unknown) => boolean | undefined;
|
|
|
4433
4402
|
*/
|
|
4434
4403
|
declare const supportsPdf: (model: unknown) => boolean | undefined;
|
|
4435
4404
|
|
|
4436
|
-
/**
|
|
4437
|
-
* Fetch (or lazily create) the vault's AES-GCM key. The key is generated
|
|
4438
|
-
* NON-EXTRACTABLE and stored as a live `CryptoKey` in IndexedDB — a CryptoKey
|
|
4439
|
-
* is structured-cloneable, so it persists across reloads WITHOUT its raw bytes
|
|
4440
|
-
* ever being exposed to JavaScript. Not even in-page script can read it out; it
|
|
4441
|
-
* can only be used to encrypt / decrypt. That is what makes at-rest storage of
|
|
4442
|
-
* the secrets meaningful (see IndexedDBVault's threat model).
|
|
4443
|
-
*
|
|
4444
|
-
* Concurrent callers share one in-flight promise per DB, and creation is
|
|
4445
|
-
* double-checked in a single IDB transaction, so two racing writers can never
|
|
4446
|
-
* end up encrypting under different keys.
|
|
4447
|
-
*/
|
|
4448
|
-
declare const getOrCreateVaultKey: (dbName?: string) => Promise<CryptoKey>;
|
|
4449
|
-
interface EncryptedBlob {
|
|
4450
|
-
/** 96-bit random IV, fresh per write. */
|
|
4451
|
-
iv: Uint8Array;
|
|
4452
|
-
ciphertext: ArrayBuffer;
|
|
4453
|
-
}
|
|
4454
|
-
/** Encrypt a JSON-serialisable value with a fresh 96-bit IV (AES-GCM). */
|
|
4455
|
-
declare const encryptJSON: (key: CryptoKey, value: unknown) => Promise<EncryptedBlob>;
|
|
4456
|
-
/** Decrypt a blob produced by encryptJSON. Throws if the key or blob don't match. */
|
|
4457
|
-
declare const decryptJSON: <T = unknown>(key: CryptoKey, blob: EncryptedBlob) => Promise<T>;
|
|
4458
|
-
|
|
4459
4405
|
interface AgentWebDBOptions {
|
|
4460
4406
|
/** Database name (default 'agent-web'). Use a distinct name to isolate apps. */
|
|
4461
4407
|
dbName?: string;
|
|
@@ -4471,6 +4417,16 @@ declare const RUNS_STORE = "runs";
|
|
|
4471
4417
|
* lives under ONE database name + version. Centralising `openDB` here prevents
|
|
4472
4418
|
* the classic bug where two modules open the same DB name with different store
|
|
4473
4419
|
* sets and the second call throws a VersionError.
|
|
4420
|
+
*
|
|
4421
|
+
* One connection per name, shared by every store of the page - and never in another tab's way:
|
|
4422
|
+
* when another connection asks to delete or upgrade the database (`versionchange`: another tab's
|
|
4423
|
+
* `indexedDB.deleteDatabase`, or a newer copy of this package), this one is closed at once, so
|
|
4424
|
+
* that request goes ahead instead of waiting (blocked) for this tab to close. The browser lets the
|
|
4425
|
+
* transactions already under way finish first. A connection the browser closed by itself (site
|
|
4426
|
+
* data cleared, storage gone) is let go too. Either way the next use opens the database again:
|
|
4427
|
+
* after a deletion that is a NEW, EMPTY database at this version (every store of this package
|
|
4428
|
+
* starts from nothing - no key, no secret, no session, no file); after an upgrade by a newer copy,
|
|
4429
|
+
* the open fails with a `VersionError` until the page is reloaded with that copy.
|
|
4474
4430
|
*/
|
|
4475
4431
|
declare const openAgentWebDB: (opts?: AgentWebDBOptions) => Promise<IDBPDatabase>;
|
|
4476
4432
|
|
|
@@ -4974,8 +4930,10 @@ declare class IndexedDBRunStore implements RunPersistence {
|
|
|
4974
4930
|
* - `skills` - `VfsSkillStore` (the agent's lessons): `key` = the lesson's name, `namespace` =
|
|
4975
4931
|
* the store's folder.
|
|
4976
4932
|
* - `chats` - the React package's `ChatHistoryStore`: `key` = the chat id.
|
|
4933
|
+
* - `host` - a store of the host's own that is none of the above (`postStorageChange`): `key` =
|
|
4934
|
+
* which record, `namespace` = which of the host's stores - names the host chose, never a value.
|
|
4977
4935
|
*/
|
|
4978
|
-
type StorageChangeKind = 'credentials' | 'oauth' | 'files' | 'session' | 'runs' | 'skills' | 'chats';
|
|
4936
|
+
type StorageChangeKind = 'credentials' | 'oauth' | 'files' | 'session' | 'runs' | 'skills' | 'chats' | 'host';
|
|
4979
4937
|
/** `put` = written (created or replaced), `delete` = one removed, `clear` = all of them removed. */
|
|
4980
4938
|
type StorageChangeOp = 'put' | 'delete' | 'clear';
|
|
4981
4939
|
interface StorageChange {
|
|
@@ -4983,15 +4941,16 @@ interface StorageChange {
|
|
|
4983
4941
|
op: StorageChangeOp;
|
|
4984
4942
|
/** Which one (see `StorageChangeKind`); absent for `clear` and for the kinds that carry none. */
|
|
4985
4943
|
key?: string;
|
|
4986
|
-
/** `files`: the file system's namespace; `skills`: the store's folder. */
|
|
4944
|
+
/** `files`: the file system's namespace; `skills`: the store's folder; `host`: which store. */
|
|
4987
4945
|
namespace?: string;
|
|
4988
4946
|
}
|
|
4989
4947
|
declare const STORAGE_CHANGE_KINDS: readonly StorageChangeKind[];
|
|
4990
4948
|
/**
|
|
4991
4949
|
* Tell the other tabs that a store in database `dbName` changed - for a store of your own on
|
|
4992
|
-
* IndexedDB (the built-in ones post their own)
|
|
4993
|
-
*
|
|
4994
|
-
*
|
|
4950
|
+
* IndexedDB (the built-in ones post their own): one of the built-in kinds when it keeps that kind
|
|
4951
|
+
* of thing, `host` for anything else (`namespace` names which of your stores, `key` which record).
|
|
4952
|
+
* Call it AFTER the write committed. Never put a value in it: a notice says which, not what. A
|
|
4953
|
+
* no-op without `dbName` or BroadcastChannel; a notice of the wrong shape is dropped.
|
|
4995
4954
|
*/
|
|
4996
4955
|
declare const postStorageChange: (dbName: string | undefined, change: StorageChange) => void;
|
|
4997
4956
|
/**
|
|
@@ -5002,5 +4961,5 @@ declare const postStorageChange: (dbName: string | undefined, change: StorageCha
|
|
|
5002
4961
|
*/
|
|
5003
4962
|
declare const onStorageChange: (dbName: string | undefined, listener: (change: StorageChange) => void) => (() => void);
|
|
5004
4963
|
|
|
5005
|
-
export { APP_SAMPLING_MAX_IMAGES, APP_SAMPLING_MAX_IMAGE_BYTES, APP_SAMPLING_MAX_INPUT_CHARS, APP_SAMPLING_MAX_MESSAGES, APP_SAMPLING_MAX_SYSTEM_CHARS, APP_SAMPLING_MAX_TOKENS, APP_SAMPLING_PER_APP, APP_SAMPLING_PER_MINUTE, APP_SAMPLING_REASONING_TOKENS, APP_SAMPLING_RPC_CODES, ASK_USER_DESCRIPTION_MAX_CHARS, ASK_USER_LABEL_MAX_CHARS, ASK_USER_MAX_OPTIONS, ASK_USER_MAX_PER_RUN, ASK_USER_MIN_OPTIONS, ASK_USER_OTHER_MAX_CHARS, ASK_USER_QUESTION_MAX_CHARS, ASK_USER_TIMEOUT_MAX_MS, ASK_USER_TIMEOUT_MS, ASK_USER_TOOL, AgentTool, AgentToolSet, AppSamplingError, AskUserInputError, AttachmentsNotSupportedError, ContextWindowExceededError, DECISION_PROVIDERS, DEFAULT_COMPACTION_THRESHOLD_RATIO, DEFAULT_DECISION_CONFIDENCE_THRESHOLD, DEFAULT_DECISION_TIMEOUT_MS, EgressError, FILES_STORE, FIND_TOOLS_NAME, FORGET_SKILL_TOOL, GENERATE_IMAGE_TOOL, GENERATE_SPEECH_TOOL, ImagesNotSupportedError, IndexedDBRunStore, IndexedDBStore, KEYS_STORE, MEDIA_AUDIO_TYPES, MEDIA_DEFAULT_MAX_CALLS, MEDIA_FOLDER, MEDIA_IMAGE_TYPES, MEDIA_MAX_ATTACHED_AUDIO, MEDIA_MAX_AUDIO_INPUT_BYTES, MEDIA_MAX_IMAGE_BYTES, MEDIA_MAX_PROMPT_CHARS, MEDIA_MAX_SPEECH_BYTES, MEDIA_MAX_SPEECH_CHARS, MEDIA_MAX_TRANSCRIPT_CHARS, MEDIA_TIMEOUT_MS, MODEL_TIERS, McpAppToolResult, McpElicitationReason, McpElicitationSchema, McpSkillConsent, McpSkillConsentView, MediaBudgetError, MediaError,
|
|
5006
|
-
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,
|
|
4964
|
+
export { APP_SAMPLING_MAX_IMAGES, APP_SAMPLING_MAX_IMAGE_BYTES, APP_SAMPLING_MAX_INPUT_CHARS, APP_SAMPLING_MAX_MESSAGES, APP_SAMPLING_MAX_SYSTEM_CHARS, APP_SAMPLING_MAX_TOKENS, APP_SAMPLING_PER_APP, APP_SAMPLING_PER_MINUTE, APP_SAMPLING_REASONING_TOKENS, APP_SAMPLING_RPC_CODES, ASK_USER_DESCRIPTION_MAX_CHARS, ASK_USER_LABEL_MAX_CHARS, ASK_USER_MAX_OPTIONS, ASK_USER_MAX_PER_RUN, ASK_USER_MIN_OPTIONS, ASK_USER_OTHER_MAX_CHARS, ASK_USER_QUESTION_MAX_CHARS, ASK_USER_TIMEOUT_MAX_MS, ASK_USER_TIMEOUT_MS, ASK_USER_TOOL, AgentTool, AgentToolSet, AppSamplingError, AskUserInputError, AttachmentsNotSupportedError, ContextWindowExceededError, CredentialStore, DECISION_PROVIDERS, DEFAULT_COMPACTION_THRESHOLD_RATIO, DEFAULT_DECISION_CONFIDENCE_THRESHOLD, DEFAULT_DECISION_TIMEOUT_MS, EgressError, FILES_STORE, FIND_TOOLS_NAME, FORGET_SKILL_TOOL, GENERATE_IMAGE_TOOL, GENERATE_SPEECH_TOOL, ImagesNotSupportedError, IndexedDBRunStore, IndexedDBStore, KEYS_STORE, MEDIA_AUDIO_TYPES, MEDIA_DEFAULT_MAX_CALLS, MEDIA_FOLDER, MEDIA_IMAGE_TYPES, MEDIA_MAX_ATTACHED_AUDIO, MEDIA_MAX_AUDIO_INPUT_BYTES, MEDIA_MAX_IMAGE_BYTES, MEDIA_MAX_PROMPT_CHARS, MEDIA_MAX_SPEECH_BYTES, MEDIA_MAX_SPEECH_CHARS, MEDIA_MAX_TRANSCRIPT_CHARS, MEDIA_TIMEOUT_MS, MODEL_TIERS, McpAppToolResult, McpElicitationReason, McpElicitationSchema, McpSkillConsent, McpSkillConsentView, MediaBudgetError, MediaError, MemoryRunStore, MemorySkillStore, MemoryStore, NO_ATTACHMENT_NOTE, PipelineDefinition, PipelineEvent, PipelineNode, PipelineNodeRunner, PipelineResult, PlanSchema, PlanStepSchema, RELAY_MAX_REPLAYS_PER_SECOND, RELAY_MAX_SENDS, RELAY_MAX_SEND_CHARS, RELAY_MAX_STRING, REPLAY_NOTE, RUNS_STORE, ReplanSchema, SAVE_SKILL_TOOL, SEARCH_API_BASE_URL, SEARCH_DEFAULT_MAX_RESULTS, SEARCH_GOOGLE_DEFAULT_MODEL, SEARCH_GOOGLE_NOTE, SEARCH_MAX_QUERY_CHARS, SEARCH_MAX_RESULTS, SEARCH_MAX_SNIPPET_CHARS, SEARCH_MAX_SUMMARY_CHARS, SEARCH_MAX_TITLE_CHARS, SEARCH_MAX_TOTAL_CHARS, SEARCH_MAX_URL_CHARS, SEARCH_PROVIDERS, SECRETS_STORE, SESSIONS_STORE, SESSION_LOCK_MODES, SKILL_TOOL_NAMES, SPAWN_INPUT_SCHEMA, SPAWN_SUBAGENT_TOOL, STORAGE_CHANGE_KINDS, SUBAGENT_DEFAULTS, SUBAGENT_MAX_DEPTH_LIMIT, SessionBusyError, SubagentSpawnError, TOOL_APPROVAL_MODES, TOOL_APPROVAL_TIMEOUT_MS, TOOL_SEARCH_WINDOW_SHARE, TRANSCRIBE_AUDIO_TOOL, TieredPlanSchema, TieredPlanStepSchema, ToolBudgetError, ToolDeniedError, VfsSkillStore, VirtualFileSystem, WEBLLM_DEFAULT_CONTEXT_WINDOW, WEB_FETCH_TOOL, WEB_SEARCH_TOOL, acceptMedia, adoptSubagentEvent, appSamplingRequestOf, appSamplingText, askDecisionModel, attachmentKind, buildMediaModelFromSpec, buildModelFromStage, buildSearchRequest, bytesToBase64, checkAskUserAnswer, checkAskUserInput, checkEgressUrl, checkLimits, classifyAddress, cleanAskUserText, compactHistory, compactSteps, compressHistory, contextOverflowOf, contextWindowOf, createAgent, createAppSamplingLimiter, createEgressTools, createFileTools, createFindToolsTool, createGuardedFetch, createLearning, createLogger, createMedia, createPipeline, createPlan, createRunControl, createSearchTools, createSkillTools, createSubagentTool, createToolResultClearer, createWebFetchTool, createWebLLMModel, createWebSearchTool, decideReplan, decideToolPermission, decisionEgressPolicy, decisionModelFromAiSdk, defaultPrompts, defineSkill, defineTool, directBrowserOk, dispatch, escalationReasonOf, messageTokens as estimateMessagesTokens, estimateTokens, executeStep, fileToolBindingOf, findSecret, fitCompactionToWindow, generate, generateStructured, hostMatches, htmlToText, isAttachmentRefusal, isCodeExecutionTool, isDirectModel, isEscalatableError, isImageRefusal, isProviderSpec, isReadOnlyTool, isReplayedToolOutput, isTextMime, isWebGPUAvailable, learnedPreamble, limitModelOutput, loadSkillFromUrl, looksLikeJson, markCodeExecution, markReadOnly, matchRule, mediaTypeOf, mediaUsageOf, mergeProviderOptions, mimeFromPath, nextStrongerTier, nodeResolver, normalizePath, normalizeSkillName, normalizeSteps, normalizeUsage, onStorageChange, openAgentWebDB, outputCapNotice, parseExecutorResponse, parsePlainText, parsePlannerResponse, parseReplannerResponse, parseSearchResponse, parseSkillMarkdown, pickPipelineRoute, pickTier, postStorageChange, preloadWebLLMModel, renderActiveSkills, renderCatalog, renderSearchCatalog, renderSkillIndex, replanWanted, resolveAppSampling, resolveBudgets, resolveCaching, resolveCompaction, resolveConfig, resolveDecisionModel, resolveDynamicSubagents, resolveEgressPolicy, resolveEscalation, resolveModel, resolveResume, resolveStage, resolveThinking, runToolLoop, sanitizeSearchResults, schemaHintOf, searchEgressPolicy, searchStatusMessage, searchToolResult, searchTools, selectToolMode, serveSubagentWorker, shouldReplan, skillPreamble, sniffMediaType, splitBlocker, stageOutputCap, stageReasons, stream, supportsImages, supportsNativeTools, supportsPdf, supportsStructuredOutput, synthesizeAnswer, thinkingFor, toFilePart, toImagePart, tokenize, toolCatalogOf, toolDefinitionTokens, toolRunContextOf, unloadWebLLMModel, watchSession, webLLMContextWindow, withRollingBreakpoint, withSystem, withWebLLMContextWindow, wrapTranscript };
|
|
4965
|
+
export type { Agent, AgentContext, AgentEvent, AgentEventHandler, AgentLogger, AgentLoggerSink, AgentWebDBOptions, AppSamplingErrorCode, AppSamplingImage, AppSamplingMessage, AppSamplingOptions, AppSamplingRequest, AppSamplingResult, AppSamplingSettings, AppSamplingView, AppToolCallRequest, AskUserAction, AskUserAnswer, AskUserCheckedAnswer, AskUserConfig, AskUserContext, AskUserHandler, AskUserOption, AskUserQuestion, AskUserReason, AskUserRequest, AttachmentKind, BrowserAgentConfig, ClearedInfo, CompactOptions, CompactResult, CompactionConfig, CompressOptions, ContextStore, DecisionFallbackReason, DecisionPoint, EffectiveToolStrategy, EgressErrorCode, EscalationConfig, EscalationReason, ExecutorPromptContext, ExecutorResult, FileToolBinding, FileToolsOptions, GenerateOptions, GuardedFetch, IAiSdkDecisionOptions, IDecisionAnswer, IDecisionCallOptions, IDecisionConfig, IDecisionEvent, IDecisionModel, IDecisionModelSpec, IDecisionOption, IDecisionOutcome, IDecisionQuestion, IDynamicSubagentsConfig, IEgressPolicy, IMedia, IMediaConfig, IMediaFile, IMediaModelSpec, IMediaOptions, IMediaRun, IMediaUsage, IPlan, IPlanStep, IResolvedDynamicSubagents, IResolvedEgressPolicy, ISandboxConfig, ISandboxError, ISandboxLimits, ISandboxResult, ISanitizedSearch, ISearchAnswer, ISearchConfig, ISearchOptions, ISearchRequest, ISearchResult, ISearchToolResult, ISearchUsage, IStepEscalation, IStepResult, ISubagentsConfig, IToolCall, ITranscription, IUsage, IWebFetchOptions, IWebSearchOptions, IndexedDBRunStoreOptions, IndexedDBStoreOptions, Learning, LearningConfig, LimitBreach, LimitKind, LoadSkillOptions, LogLevel, McpSkillOrigin, MediaImageModel, MediaKind, MediaModelKind, MediaSpeechModel, MediaTranscriptionModel, MessageEndpoint, ModelInput, ModelTier, NodeResolverOptions, OutputCap, ParentToWorker, Phase, PhaseBudgets, Pipeline, PipelineOptions, PipelineRouteOptions, PipelineRouteResult, PipelineRunOptions, PlanShape, PlannerPromptContext, PlannerResult, PromptCachingSetting, PromptParts, Prompts, ProviderModelSpec, ProviderOptionsMap, ProviderType, ProxiedToolSpec, RawAction, ReplanDecision, ReplanMode, ReplanShape, ReplanTrigger, ReplannerPromptContext, ReplannerResult, ResolvedCaching, ResolvedCompaction, ResolvedConfig, ResolvedStage, ResolvedThinking, RunControl, RunFile, RunImage, RunOptions, RunPersistence, RunResult, RunSnapshot, RunStatus, RunStoreOptions, SandboxConfig, SandboxWorkerLike, SaveSkillInput, SearchEngine, SearchFreshness, SearchProvider, SearchToolsOptions, ServeSubagentOptions, SessionHolder, SessionLockMode, SessionRunState, SessionWatch, Skill, SkillOrigin, SkillStore, StageInput, StageOverride, StepComplexity, StorageChange, StorageChangeKind, StorageChangeOp, StoredMessage, StructuredResult, SubagentDefaultTools, SubagentInfo, SubagentProfile, SubagentToolOptions, SubagentWorkerConfig, SynthesizerPromptContext, ThinkingConfig, ThinkingLevel, ThinkingSetting, ThinkingStage, TierReason, TokenLimits, ToolApprovalApp, ToolApprovalConfig, ToolApprovalContext, ToolApprovalDecision, ToolApprovalMode, ToolApprovalRequest, ToolCallMode, ToolCatalogEntry, ToolLoopCallbacks, ToolLoopOptions, ToolLoopResult, ToolMode, ToolPermission, ToolResultClearing, ToolRunContext, ToolSelectionStrategy, UsagePhase, VfsListener, VirtualFile, VirtualFileInfo, VirtualFileSystemOptions, WatchSessionOptions, WebLLMAppConfigLike, WebLLMModelOptions, WorkerLike, WorkerToParent };
|
package/dist/index.js
CHANGED
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
|
-
IndexedDBVault,
|
|
3
2
|
MCP_APPS_EXTENSION,
|
|
4
3
|
MCP_APP_MAX_HTML_CHARS,
|
|
5
4
|
MCP_APP_MAX_RESULT_CHARS,
|
|
6
5
|
MCP_APP_MIME_TYPE,
|
|
7
6
|
collectMcpInstructions,
|
|
8
7
|
createLogger,
|
|
9
|
-
decryptJSON,
|
|
10
|
-
encryptJSON,
|
|
11
|
-
getOrCreateVaultKey,
|
|
12
8
|
mcpAppOrigin,
|
|
13
9
|
renderMcpInstructions
|
|
14
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-7D2CJQB2.js";
|
|
11
|
+
import {
|
|
12
|
+
MemoryCredentialStore,
|
|
13
|
+
VaultCredentialStore
|
|
14
|
+
} from "./chunk-7Y5UC6L7.js";
|
|
15
|
+
import {
|
|
16
|
+
IndexedDBVault,
|
|
17
|
+
decryptJSON,
|
|
18
|
+
encryptJSON,
|
|
19
|
+
getOrCreateVaultKey
|
|
20
|
+
} from "./chunk-IT77BVAD.js";
|
|
15
21
|
import {
|
|
16
22
|
AttachmentsNotSupportedError,
|
|
17
23
|
ContextWindowExceededError,
|
|
@@ -95,10 +101,8 @@ import {
|
|
|
95
101
|
toolRunContextOf,
|
|
96
102
|
withDeadline,
|
|
97
103
|
wrapToolsForRun
|
|
98
|
-
} from "./chunk-
|
|
104
|
+
} from "./chunk-6XHCPSZE.js";
|
|
99
105
|
import {
|
|
100
|
-
FILES_STORE,
|
|
101
|
-
KEYS_STORE,
|
|
102
106
|
MCP_SKILLS_EXTENSION,
|
|
103
107
|
MCP_SKILLS_MAX_PER_SERVER,
|
|
104
108
|
MCP_SKILLS_MAX_TOTAL,
|
|
@@ -114,24 +118,13 @@ import {
|
|
|
114
118
|
MCP_SKILL_SNAPSHOT_MAX_DEPTH,
|
|
115
119
|
MCP_SKILL_SNAPSHOT_MAX_DIRECTORIES,
|
|
116
120
|
MCP_SKILL_URI_MAX_CHARS,
|
|
117
|
-
RUNS_STORE,
|
|
118
|
-
SECRETS_STORE,
|
|
119
|
-
SESSIONS_STORE,
|
|
120
|
-
STORAGE_CHANGE_KINDS,
|
|
121
|
-
SYNC_ID_RE,
|
|
122
|
-
SYNC_VERSION,
|
|
123
121
|
assignAddedMcpSkillName,
|
|
124
122
|
assignMcpSkillNames,
|
|
125
123
|
collectMcpSkillSources,
|
|
126
124
|
createMcpSkillRunConsent,
|
|
127
125
|
createMcpSkillSnapshotMemory,
|
|
128
|
-
currentTab,
|
|
129
126
|
decideMcpSkillConsent,
|
|
130
|
-
heldExclusively,
|
|
131
|
-
hubOf,
|
|
132
127
|
isMcpSkillName,
|
|
133
|
-
isRecord,
|
|
134
|
-
lockManager,
|
|
135
128
|
mcpSkillBodyText,
|
|
136
129
|
mcpSkillConsentOf,
|
|
137
130
|
mcpSkillConsentView,
|
|
@@ -145,20 +138,35 @@ import {
|
|
|
145
138
|
mcpSkillPreamble,
|
|
146
139
|
mcpSkillRoomRefusal,
|
|
147
140
|
mcpSkillUriRefusal,
|
|
148
|
-
newSyncId,
|
|
149
|
-
onStorageChange,
|
|
150
|
-
openAgentWebDB,
|
|
151
|
-
postStorageChange,
|
|
152
|
-
postStorageChangeFrom,
|
|
153
141
|
recordMcpSkillConsent,
|
|
154
142
|
resolveMcpSkillConsent,
|
|
155
143
|
resolveMcpSkillPath,
|
|
156
144
|
resolveMcpSkillServer,
|
|
157
|
-
scopeOf,
|
|
158
145
|
selectMcpSkills,
|
|
159
146
|
skillDirectoryListing,
|
|
160
147
|
skillDirectoryOf
|
|
161
|
-
} from "./chunk-
|
|
148
|
+
} from "./chunk-6D4RB3H5.js";
|
|
149
|
+
import {
|
|
150
|
+
FILES_STORE,
|
|
151
|
+
KEYS_STORE,
|
|
152
|
+
RUNS_STORE,
|
|
153
|
+
SECRETS_STORE,
|
|
154
|
+
SESSIONS_STORE,
|
|
155
|
+
STORAGE_CHANGE_KINDS,
|
|
156
|
+
SYNC_ID_RE,
|
|
157
|
+
SYNC_VERSION,
|
|
158
|
+
currentTab,
|
|
159
|
+
heldExclusively,
|
|
160
|
+
hubOf,
|
|
161
|
+
isRecord,
|
|
162
|
+
lockManager,
|
|
163
|
+
newSyncId,
|
|
164
|
+
onStorageChange,
|
|
165
|
+
openAgentWebDB,
|
|
166
|
+
postStorageChange,
|
|
167
|
+
postStorageChangeFrom,
|
|
168
|
+
scopeOf
|
|
169
|
+
} from "./chunk-JTZEUPIG.js";
|
|
162
170
|
|
|
163
171
|
// src/caching.ts
|
|
164
172
|
var resolveCaching = (s) => {
|
|
@@ -6732,7 +6740,7 @@ var createAgent = async (config) => {
|
|
|
6732
6740
|
config.availableTools,
|
|
6733
6741
|
config.excludedTools
|
|
6734
6742
|
);
|
|
6735
|
-
const sandbox = config.sandbox ? (await import("./sandbox-
|
|
6743
|
+
const sandbox = config.sandbox ? (await import("./sandbox-IGTCMOOX.js")).createSandbox(
|
|
6736
6744
|
config.sandbox === true ? {} : config.sandbox,
|
|
6737
6745
|
hostTools,
|
|
6738
6746
|
(m) => log.warn(m)
|
|
@@ -9566,47 +9574,6 @@ ${profileNames.map((n) => `- ${n}: ${profiles[n].description}`).join("\n")}` : o
|
|
|
9566
9574
|
|
|
9567
9575
|
// src/subagent/worker.ts
|
|
9568
9576
|
import { dynamicTool, jsonSchema as jsonSchema6 } from "ai";
|
|
9569
|
-
|
|
9570
|
-
// src/secrets/store.ts
|
|
9571
|
-
var VaultCredentialStore = class {
|
|
9572
|
-
/** The database the vault lives in, and the name its change notices go out under. */
|
|
9573
|
-
dbName;
|
|
9574
|
-
vault;
|
|
9575
|
-
tab;
|
|
9576
|
-
constructor(opts = {}) {
|
|
9577
|
-
this.dbName = opts.dbName ?? "agent-web";
|
|
9578
|
-
this.vault = new IndexedDBVault({ ...opts, dbName: this.dbName });
|
|
9579
|
-
this.tab = currentTab();
|
|
9580
|
-
}
|
|
9581
|
-
getApiKey(ref) {
|
|
9582
|
-
return this.vault.getSecret(ref);
|
|
9583
|
-
}
|
|
9584
|
-
async setApiKey(ref, key) {
|
|
9585
|
-
await this.vault.setSecret(ref, key);
|
|
9586
|
-
postStorageChangeFrom(this.tab, this.dbName, { kind: "credentials", op: "put" });
|
|
9587
|
-
}
|
|
9588
|
-
async deleteApiKey(ref) {
|
|
9589
|
-
await this.vault.deleteSecret(ref);
|
|
9590
|
-
postStorageChangeFrom(this.tab, this.dbName, { kind: "credentials", op: "delete" });
|
|
9591
|
-
}
|
|
9592
|
-
};
|
|
9593
|
-
var MemoryCredentialStore = class {
|
|
9594
|
-
map = /* @__PURE__ */ new Map();
|
|
9595
|
-
constructor(initial) {
|
|
9596
|
-
if (initial) for (const [k, v] of Object.entries(initial)) this.map.set(k, v);
|
|
9597
|
-
}
|
|
9598
|
-
async getApiKey(ref) {
|
|
9599
|
-
return this.map.get(ref);
|
|
9600
|
-
}
|
|
9601
|
-
async setApiKey(ref, key) {
|
|
9602
|
-
this.map.set(ref, key);
|
|
9603
|
-
}
|
|
9604
|
-
async deleteApiKey(ref) {
|
|
9605
|
-
this.map.delete(ref);
|
|
9606
|
-
}
|
|
9607
|
-
};
|
|
9608
|
-
|
|
9609
|
-
// src/subagent/worker.ts
|
|
9610
9577
|
var SUBAGENT_REF = "__subagent__";
|
|
9611
9578
|
var defaultResolveModel = (spec) => {
|
|
9612
9579
|
const { apiKey, ...rest } = spec;
|