@dudko.dev/agent-web 0.0.52 → 0.0.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { LanguageModel, Experimental_DecisionModel, Tool, ToolSet, FilePart, ImageModel, SpeechModel, TranscriptionModel, SystemModelMessage, ModelMessage, generateText, streamText } from 'ai';
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';
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-BC8yMqpN.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, c as McpAppResource, b 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-BC8yMqpN.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
6
  import { I as IReferenceUse, M as MediaFitReference, a as IGeneratedPictures, b as IReferenceResult } from './media-fit-worker-Do1qzteo.cjs';
@@ -607,6 +607,12 @@ interface ToolApprovalRequest {
607
607
  * approval mode and the rules say.
608
608
  */
609
609
  skill?: McpSkillConsentView;
610
+ /**
611
+ * Set when an explicit rule asked (`toolApproval.rules`, `'ask'`): its name or pattern. Such a
612
+ * request is asked EVERY time - no remembered "always allow" answers a rule - so a UI should
613
+ * not offer "Always allow" on it (the React package's card does not, by default).
614
+ */
615
+ rule?: string;
610
616
  }
611
617
  /** Who asks when an MCP App asks (see `ToolApprovalRequest.app`). */
612
618
  interface ToolApprovalApp {
@@ -674,11 +680,18 @@ declare const isReadOnlyTool: (tool: Tool | undefined) => boolean;
674
680
  /** The most specific matching rule: an exact name, else the longest glob. Pure. */
675
681
  declare const matchRule: (rules: Record<string, ToolPermission> | undefined, toolName: string) => ToolPermission | undefined;
676
682
  /**
677
- * What the gate does for one call, before any human is involved. Order:
678
- * remembered "always allow" → most specific rule → mode default. Pure.
683
+ * What the gate does for one call, before any human is involved. Pure. Order:
684
+ *
685
+ * 1. the most specific RULE: `'deny'` refuses, `'ask'` asks - EVERY time: no remembered "always
686
+ * allow" answers it ("ask every time" means every time) -, `'allow'` runs;
687
+ * 2. the MODE refusing the call (`'read-only'`, a tool that may write) - no grant outranks it;
688
+ * 3. a remembered "always allow" (the model's for the agent's life, an app's by `appGrantKey`);
689
+ * 4. the mode's default.
690
+ *
679
691
  * Then one rule that only ever tightens: a call that runs code (`codeExecution`) while the run
680
692
  * acts on an MCP server's skill (`mcpSkills`) is asked when it would have been allowed - by the
681
- * mode, a rule or an "always allow" alike. A deny stays a deny.
693
+ * mode, a rule or an "always allow" alike. A deny stays a deny. The same order for the model's
694
+ * calls, a helper's and an app's (`Agent.approveAppToolCall`).
682
695
  */
683
696
  declare const decideToolPermission: (opts: {
684
697
  toolName: string;
@@ -1091,6 +1104,11 @@ type AgentEventBody =
1091
1104
  * not a tool call (see `ToolApprovalRequest.skill`): the server's words, as plain text.
1092
1105
  */
1093
1106
  skill?: McpSkillConsentView;
1107
+ /**
1108
+ * Set when an explicit `'ask'` rule asked: its name or pattern (see
1109
+ * `ToolApprovalRequest.rule`). No remembered "always allow" answers it.
1110
+ */
1111
+ rule?: string;
1094
1112
  }
1095
1113
  /** A consent decision: from the user, or `automatic` (policy denial). */
1096
1114
  | {
@@ -3716,15 +3734,20 @@ interface Agent {
3716
3734
  reloadLearnedSkills(): Promise<Skill[]>;
3717
3735
  /**
3718
3736
  * Ask this agent's consent gate about a tool call an MCP App wants to make (`./mcp` with
3719
- * `apps: true`: the app's `tools/call`), not the model. The same `toolApproval` - its rules,
3720
- * its handler (`onRequest`), its timeout - with two differences: under 'autopilot' a write
3721
- * still asks (an app never writes silently; read-only tools run, as in 'ask-writes'), and
3722
- * "always allow" given to an app is remembered for apps only, apart from the model's.
3737
+ * `apps: true`: the app's `tools/call`), not the model. The same `toolApproval` - its mode,
3738
+ * its rules, its handler (`onRequest`), its timeout - as the model's calls: 'autopilot' asks
3739
+ * nothing (writes and destructive tools included: the mode the person chose), an explicit
3740
+ * rule still wins ('ask' asks, 'deny' refuses), 'ask-writes' / 'ask-all' / 'read-only' as for
3741
+ * the model. "Always allow" given to an app is remembered for apps only, apart from the
3742
+ * model's, and for that app only (`appGrantKey`: the server's identity on its connection, the
3743
+ * tool and the app's resource) - in `options.remembered` when the host passes a set (so it
3744
+ * outlives this agent: a host that builds a new agent keeps it), else in a set of this
3745
+ * agent's. It never outranks a refusal: a rule's 'deny' and 'read-only' are decided first.
3723
3746
  * `onEvent` receives `tool.approval-requested` (with `app`) and `tool.approval-resolved`; a UI
3724
3747
  * shows the request as the app's. Resolves when the call may go; throws `ToolDeniedError`.
3725
3748
  * Make the call afterwards with `ConnectedMcp.apps.callAppTool`.
3726
3749
  */
3727
- approveAppToolCall(call: AppToolCallRequest, onEvent?: (event: AgentEvent) => void, signal?: AbortSignal): Promise<void>;
3750
+ approveAppToolCall(call: AppToolCallRequest, onEvent?: (event: AgentEvent) => void, signal?: AbortSignal, options?: AppToolCallOptions): Promise<void>;
3728
3751
  /**
3729
3752
  * Answer a completion an MCP App asks for (its `sampling/createMessage`) with this agent's
3730
3753
  * synthesizer model - outside any run, with no tools and none of the agent's context. The
@@ -3780,6 +3803,23 @@ interface AppSamplingOptions {
3780
3803
  /** The memory session whose `sessionUsage` is charged (default `config.sessionId`). */
3781
3804
  sessionId?: string;
3782
3805
  }
3806
+ /** How `Agent.approveAppToolCall` keeps an app's "always allow". */
3807
+ interface AppToolCallOptions {
3808
+ /**
3809
+ * What apps were given "always allow" for, by `appGrantKey` (the server's identity on its
3810
+ * connection, the tool, the app's resource - opaque to the host). The gate reads it and adds to
3811
+ * it; a host that keeps one set for the page's life (the React package's `useAgent` does) keeps
3812
+ * the grant across new agents. Absent: a set of this agent's.
3813
+ */
3814
+ remembered?: Set<string>;
3815
+ }
3816
+ /**
3817
+ * What an app's "always allow" is kept under: the server's identity on its connection
3818
+ * (`serverId`, else its name), the tool (`server__tool`) and the app's resource. So it is that
3819
+ * app's alone - another app of the server, or another server given the same name later (another
3820
+ * connection), is asked again.
3821
+ */
3822
+ declare const appGrantKey: (call: AppToolCallRequest) => string;
3783
3823
  /** A tool call an MCP App asks for (see `Agent.approveAppToolCall`). */
3784
3824
  interface AppToolCallRequest {
3785
3825
  /** The name the consent rules match: the tool's key, `server__tool` (`McpAppTool.key`). */
@@ -3793,6 +3833,12 @@ interface AppToolCallRequest {
3793
3833
  input: unknown;
3794
3834
  /** The server marked the tool read-only (`McpAppTool.readOnly`). */
3795
3835
  readOnly: boolean;
3836
+ /**
3837
+ * The server's identity on its connection (`McpAppTool.serverId`): "always allow" is kept
3838
+ * under it, so a server removed and another added under the same name inherits nothing.
3839
+ * Absent (an older host): the server's name.
3840
+ */
3841
+ serverId?: string;
3796
3842
  }
3797
3843
  /**
3798
3844
  * Create a headless plan → execute → replan → synthesize agent. Models are
@@ -5093,5 +5139,5 @@ declare const postStorageChange: (dbName: string | undefined, change: StorageCha
5093
5139
  */
5094
5140
  declare const onStorageChange: (dbName: string | undefined, listener: (change: StorageChange) => void) => (() => void);
5095
5141
 
5096
- export { ACTION_RECORD_MAX_CHARS, ACTION_RECORD_NOTE, APP_SAMPLING_MAX_IMAGES, APP_SAMPLING_MAX_IMAGE_BYTES, APP_SAMPLING_MAX_INPUT_CHARS, APP_SAMPLING_MAX_MESSAGES, APP_SAMPLING_MAX_SYSTEM_CHARS, APP_SAMPLING_MAX_TOKENS, APP_SAMPLING_PER_APP, APP_SAMPLING_PER_MINUTE, APP_SAMPLING_REASONING_TOKENS, APP_SAMPLING_RPC_CODES, ASK_USER_DESCRIPTION_MAX_CHARS, ASK_USER_LABEL_MAX_CHARS, ASK_USER_MAX_OPTIONS, ASK_USER_MAX_PER_RUN, ASK_USER_MIN_OPTIONS, ASK_USER_OTHER_MAX_CHARS, ASK_USER_QUESTION_MAX_CHARS, ASK_USER_TIMEOUT_MAX_MS, ASK_USER_TIMEOUT_MS, ASK_USER_TOOL, AgentTool, AgentToolSet, AppSamplingError, AskUserInputError, AttachmentsNotSupportedError, ContextWindowExceededError, CredentialStore, DECISION_PROVIDERS, DEFAULT_COMPACTION_THRESHOLD_RATIO, DEFAULT_DECISION_CONFIDENCE_THRESHOLD, DEFAULT_DECISION_TIMEOUT_MS, EgressError, FILES_STORE, FIND_TOOLS_NAME, FORGET_SKILL_TOOL, IReferenceUse, ImagesNotSupportedError, IndexedDBRunStore, IndexedDBStore, KEYS_STORE, MODEL_TIERS, McpAppToolResult, McpElicitationReason, McpElicitationSchema, McpSkillConsent, McpSkillConsentView, MediaFitReference, MemoryRunStore, MemorySkillStore, MemoryStore, NO_ATTACHMENT_NOTE, PipelineDefinition, PipelineEvent, PipelineNode, PipelineNodeRunner, PipelineResult, PlanSchema, PlanStepSchema, RELAY_MAX_REPLAYS_PER_SECOND, RELAY_MAX_SENDS, RELAY_MAX_SEND_CHARS, RELAY_MAX_STRING, REPLAY_NOTE, RUNS_STORE, ReplanSchema, SAVE_SKILL_TOOL, SEARCH_API_BASE_URL, SEARCH_DEFAULT_MAX_RESULTS, SEARCH_GOOGLE_DEFAULT_MODEL, SEARCH_GOOGLE_NOTE, SEARCH_MAX_NOTE_CHARS, SEARCH_MAX_QUERY_CHARS, SEARCH_MAX_RESULTS, SEARCH_MAX_SNIPPET_CHARS, SEARCH_MAX_SUMMARY_CHARS, SEARCH_MAX_TITLE_CHARS, SEARCH_MAX_TOTAL_CHARS, SEARCH_MAX_URL_CHARS, SEARCH_PROVIDERS, SECRETS_STORE, SESSIONS_STORE, SESSION_LOCK_MODES, SKILL_TOOL_NAMES, SPAWN_INPUT_SCHEMA, SPAWN_SUBAGENT_TOOL, STORAGE_CHANGE_KINDS, SUBAGENT_DEFAULTS, SUBAGENT_MAX_DEPTH_LIMIT, SessionBusyError, SubagentSpawnError, TOOL_APPROVAL_MODES, TOOL_APPROVAL_TIMEOUT_MS, TOOL_SEARCH_WINDOW_SHARE, TieredPlanSchema, TieredPlanStepSchema, ToolBudgetError, ToolDeniedError, VfsSkillStore, VirtualFileSystem, WEBLLM_DEFAULT_CONTEXT_WINDOW, WEB_FETCH_TOOL, WEB_SEARCH_TOOL, actionRecordOf, adoptSubagentEvent, appSamplingRequestOf, appSamplingText, askDecisionModel, attachmentKind, buildMediaModelFromSpec, buildModelFromStage, buildSearchRequest, bytesToBase64, checkAskUserAnswer, checkAskUserInput, checkEgressUrl, checkLimits, classifyAddress, cleanAskUserText, compactHistory, compactSteps, compressHistory, contextOverflowOf, contextWindowOf, createAgent, createAppSamplingLimiter, createEgressTools, createFileTools, createFindToolsTool, createGuardedFetch, createLearning, createLogger, createMedia, createPipeline, createPlan, createRunControl, createSearchTools, createSkillTools, createSubagentTool, createToolResultClearer, createWebFetchTool, createWebLLMModel, createWebSearchTool, decideReplan, decideToolPermission, decisionEgressPolicy, decisionModelFromAiSdk, defaultPrompts, defineSkill, defineTool, directBrowserOk, dispatch, escalationReasonOf, messageTokens as estimateMessagesTokens, estimateTokens, executeStep, fileToolBindingOf, findSecret, fitCompactionToWindow, generate, generateStructured, hostMatches, htmlToText, isAttachmentRefusal, isCodeExecutionTool, isDirectModel, isEscalatableError, isImageRefusal, isProviderSpec, isReadOnlyTool, isReplayedToolOutput, isTextMime, isWebGPUAvailable, learnedPreamble, limitModelOutput, loadSkillFromUrl, looksLikeJson, markCodeExecution, markReadOnly, matchRule, mediaTypeOf, mergeProviderOptions, mimeFromPath, neutralizeActionRecords, nextStrongerTier, nodeResolver, normalizePath, normalizeSkillName, normalizeSteps, normalizeUsage, onStorageChange, openAgentWebDB, outputCapNotice, parseExecutorResponse, parsePlainText, parsePlannerResponse, parseReplannerResponse, parseSearchResponse, parseSkillMarkdown, pickPipelineRoute, pickTier, postStorageChange, preloadWebLLMModel, renderActiveSkills, renderCatalog, renderSearchCatalog, renderSkillIndex, replanWanted, resolveAppSampling, resolveBudgets, resolveCaching, resolveCompaction, resolveConfig, resolveDecisionModel, resolveDynamicSubagents, resolveEgressPolicy, resolveEscalation, resolveModel, resolveResume, resolveStage, resolveThinking, runToolLoop, sanitizeSearchResults, schemaHintOf, searchEgressPolicy, searchEngineAnswer, searchStatusMessage, searchToolResult, searchTools, searchUsageOf, selectToolMode, serveSubagentWorker, shouldReplan, skillPreamble, splitBlocker, stageOutputCap, stageReasons, stream, supportsImages, supportsNativeTools, supportsPdf, supportsStructuredOutput, synthesizeAnswer, thinkingFor, toFilePart, toImagePart, tokenize, toolCatalogOf, toolDefinitionTokens, toolRunContextOf, unloadWebLLMModel, watchSession, webLLMContextWindow, withActionRecord, withRollingBreakpoint, withSystem, withWebLLMContextWindow };
5097
- export type { Agent, AgentContext, AgentEvent, AgentEventHandler, AgentLogger, AgentLoggerSink, AgentWebDBOptions, AppSamplingErrorCode, AppSamplingImage, AppSamplingMessage, AppSamplingOptions, AppSamplingRequest, AppSamplingResult, AppSamplingSettings, AppSamplingView, AppToolCallRequest, AskUserAction, AskUserAnswer, AskUserCheckedAnswer, AskUserConfig, AskUserContext, AskUserHandler, AskUserOption, AskUserQuestion, AskUserReason, AskUserRequest, AttachmentKind, BrowserAgentConfig, ClearedInfo, CompactOptions, CompactResult, CompactionConfig, CompressOptions, ContextStore, DecisionFallbackReason, DecisionPoint, EffectiveToolStrategy, EgressErrorCode, EscalationConfig, EscalationReason, ExecutorPromptContext, ExecutorResult, FileToolBinding, FileToolsOptions, GenerateOptions, GuardedFetch, IAiSdkDecisionOptions, IDecisionAnswer, IDecisionCallOptions, IDecisionConfig, IDecisionEvent, IDecisionModel, IDecisionModelSpec, IDecisionOption, IDecisionOutcome, IDecisionQuestion, IDynamicSubagentsConfig, IEgressPolicy, IMedia, IMediaConfig, IMediaFile, IMediaModelSpec, IMediaOptions, IMediaRun, IPlan, IPlanStep, IResolvedDynamicSubagents, IResolvedEgressPolicy, ISandboxConfig, ISandboxError, ISandboxLimits, ISandboxResult, ISanitizedSearch, ISearchAnswer, ISearchConfig, ISearchEngineAnswer, ISearchOptions, ISearchRequest, ISearchResult, ISearchToolResult, ISearchUsage, IStepEscalation, IStepResult, ISubagentsConfig, IToolCall, ITranscription, IUsage, IWebFetchOptions, IWebSearchOptions, IndexedDBRunStoreOptions, IndexedDBStoreOptions, Learning, LearningConfig, LimitBreach, LimitKind, LoadSkillOptions, LogLevel, McpSkillOrigin, MediaImageModel, MediaModelKind, MediaSpeechModel, MediaTranscriptionModel, MessageEndpoint, ModelInput, ModelTier, NodeResolverOptions, OutputCap, ParentToWorker, Phase, PhaseBudgets, Pipeline, PipelineOptions, PipelineRouteOptions, PipelineRouteResult, PipelineRunOptions, PlanShape, PlannerPromptContext, PlannerResult, PromptCachingSetting, PromptParts, Prompts, ProviderModelSpec, ProviderOptionsMap, ProviderType, ProxiedToolSpec, RawAction, ReplanDecision, ReplanMode, ReplanShape, ReplanTrigger, ReplannerPromptContext, ReplannerResult, ResolvedCaching, ResolvedCompaction, ResolvedConfig, ResolvedStage, ResolvedThinking, RunControl, RunFile, RunImage, RunOptions, RunPersistence, RunResult, RunSnapshot, RunStatus, RunStoreOptions, SandboxConfig, SandboxWorkerLike, SaveSkillInput, SearchEngine, SearchFreshness, SearchProvider, SearchToolsOptions, ServeSubagentOptions, SessionHolder, SessionLockMode, SessionRunState, SessionWatch, Skill, SkillOrigin, SkillStore, StageInput, StageOverride, StepComplexity, StorageChange, StorageChangeKind, StorageChangeOp, StoredMessage, StructuredResult, SubagentDefaultTools, SubagentInfo, SubagentProfile, SubagentToolOptions, SubagentWorkerConfig, SynthesizerPromptContext, ThinkingConfig, ThinkingLevel, ThinkingSetting, ThinkingStage, TierReason, TokenLimits, ToolApprovalApp, ToolApprovalConfig, ToolApprovalContext, ToolApprovalDecision, ToolApprovalMode, ToolApprovalRequest, ToolCallMode, ToolCatalogEntry, ToolLoopCallbacks, ToolLoopOptions, ToolLoopResult, ToolMode, ToolPermission, ToolResultClearing, ToolRunContext, ToolSelectionStrategy, UsagePhase, VfsListener, VirtualFile, VirtualFileInfo, VirtualFileSystemOptions, WatchSessionOptions, WebLLMAppConfigLike, WebLLMModelOptions, WorkerLike, WorkerToParent };
5142
+ export { ACTION_RECORD_MAX_CHARS, ACTION_RECORD_NOTE, APP_SAMPLING_MAX_IMAGES, APP_SAMPLING_MAX_IMAGE_BYTES, APP_SAMPLING_MAX_INPUT_CHARS, APP_SAMPLING_MAX_MESSAGES, APP_SAMPLING_MAX_SYSTEM_CHARS, APP_SAMPLING_MAX_TOKENS, APP_SAMPLING_PER_APP, APP_SAMPLING_PER_MINUTE, APP_SAMPLING_REASONING_TOKENS, APP_SAMPLING_RPC_CODES, ASK_USER_DESCRIPTION_MAX_CHARS, ASK_USER_LABEL_MAX_CHARS, ASK_USER_MAX_OPTIONS, ASK_USER_MAX_PER_RUN, ASK_USER_MIN_OPTIONS, ASK_USER_OTHER_MAX_CHARS, ASK_USER_QUESTION_MAX_CHARS, ASK_USER_TIMEOUT_MAX_MS, ASK_USER_TIMEOUT_MS, ASK_USER_TOOL, AgentTool, AgentToolSet, AppSamplingError, AskUserInputError, AttachmentsNotSupportedError, ContextWindowExceededError, CredentialStore, DECISION_PROVIDERS, DEFAULT_COMPACTION_THRESHOLD_RATIO, DEFAULT_DECISION_CONFIDENCE_THRESHOLD, DEFAULT_DECISION_TIMEOUT_MS, EgressError, FILES_STORE, FIND_TOOLS_NAME, FORGET_SKILL_TOOL, IReferenceUse, ImagesNotSupportedError, IndexedDBRunStore, IndexedDBStore, KEYS_STORE, MODEL_TIERS, McpAppToolResult, McpElicitationReason, McpElicitationSchema, McpSkillConsent, McpSkillConsentView, MediaFitReference, MemoryRunStore, MemorySkillStore, MemoryStore, NO_ATTACHMENT_NOTE, PipelineDefinition, PipelineEvent, PipelineNode, PipelineNodeRunner, PipelineResult, PlanSchema, PlanStepSchema, RELAY_MAX_REPLAYS_PER_SECOND, RELAY_MAX_SENDS, RELAY_MAX_SEND_CHARS, RELAY_MAX_STRING, REPLAY_NOTE, RUNS_STORE, ReplanSchema, SAVE_SKILL_TOOL, SEARCH_API_BASE_URL, SEARCH_DEFAULT_MAX_RESULTS, SEARCH_GOOGLE_DEFAULT_MODEL, SEARCH_GOOGLE_NOTE, SEARCH_MAX_NOTE_CHARS, SEARCH_MAX_QUERY_CHARS, SEARCH_MAX_RESULTS, SEARCH_MAX_SNIPPET_CHARS, SEARCH_MAX_SUMMARY_CHARS, SEARCH_MAX_TITLE_CHARS, SEARCH_MAX_TOTAL_CHARS, SEARCH_MAX_URL_CHARS, SEARCH_PROVIDERS, SECRETS_STORE, SESSIONS_STORE, SESSION_LOCK_MODES, SKILL_TOOL_NAMES, SPAWN_INPUT_SCHEMA, SPAWN_SUBAGENT_TOOL, STORAGE_CHANGE_KINDS, SUBAGENT_DEFAULTS, SUBAGENT_MAX_DEPTH_LIMIT, SessionBusyError, SubagentSpawnError, TOOL_APPROVAL_MODES, TOOL_APPROVAL_TIMEOUT_MS, TOOL_SEARCH_WINDOW_SHARE, TieredPlanSchema, TieredPlanStepSchema, ToolBudgetError, ToolDeniedError, VfsSkillStore, VirtualFileSystem, WEBLLM_DEFAULT_CONTEXT_WINDOW, WEB_FETCH_TOOL, WEB_SEARCH_TOOL, actionRecordOf, adoptSubagentEvent, appGrantKey, appSamplingRequestOf, appSamplingText, askDecisionModel, attachmentKind, buildMediaModelFromSpec, buildModelFromStage, buildSearchRequest, bytesToBase64, checkAskUserAnswer, checkAskUserInput, checkEgressUrl, checkLimits, classifyAddress, cleanAskUserText, compactHistory, compactSteps, compressHistory, contextOverflowOf, contextWindowOf, createAgent, createAppSamplingLimiter, createEgressTools, createFileTools, createFindToolsTool, createGuardedFetch, createLearning, createLogger, createMedia, createPipeline, createPlan, createRunControl, createSearchTools, createSkillTools, createSubagentTool, createToolResultClearer, createWebFetchTool, createWebLLMModel, createWebSearchTool, decideReplan, decideToolPermission, decisionEgressPolicy, decisionModelFromAiSdk, defaultPrompts, defineSkill, defineTool, directBrowserOk, dispatch, escalationReasonOf, messageTokens as estimateMessagesTokens, estimateTokens, executeStep, fileToolBindingOf, findSecret, fitCompactionToWindow, generate, generateStructured, hostMatches, htmlToText, isAttachmentRefusal, isCodeExecutionTool, isDirectModel, isEscalatableError, isImageRefusal, isProviderSpec, isReadOnlyTool, isReplayedToolOutput, isTextMime, isWebGPUAvailable, learnedPreamble, limitModelOutput, loadSkillFromUrl, looksLikeJson, markCodeExecution, markReadOnly, matchRule, mediaTypeOf, mergeProviderOptions, mimeFromPath, neutralizeActionRecords, nextStrongerTier, nodeResolver, normalizePath, normalizeSkillName, normalizeSteps, normalizeUsage, onStorageChange, openAgentWebDB, outputCapNotice, parseExecutorResponse, parsePlainText, parsePlannerResponse, parseReplannerResponse, parseSearchResponse, parseSkillMarkdown, pickPipelineRoute, pickTier, postStorageChange, preloadWebLLMModel, renderActiveSkills, renderCatalog, renderSearchCatalog, renderSkillIndex, replanWanted, resolveAppSampling, resolveBudgets, resolveCaching, resolveCompaction, resolveConfig, resolveDecisionModel, resolveDynamicSubagents, resolveEgressPolicy, resolveEscalation, resolveModel, resolveResume, resolveStage, resolveThinking, runToolLoop, sanitizeSearchResults, schemaHintOf, searchEgressPolicy, searchEngineAnswer, searchStatusMessage, searchToolResult, searchTools, searchUsageOf, selectToolMode, serveSubagentWorker, shouldReplan, skillPreamble, splitBlocker, stageOutputCap, stageReasons, stream, supportsImages, supportsNativeTools, supportsPdf, supportsStructuredOutput, synthesizeAnswer, thinkingFor, toFilePart, toImagePart, tokenize, toolCatalogOf, toolDefinitionTokens, toolRunContextOf, unloadWebLLMModel, watchSession, webLLMContextWindow, withActionRecord, withRollingBreakpoint, withSystem, withWebLLMContextWindow };
5143
+ export type { Agent, AgentContext, AgentEvent, AgentEventHandler, AgentLogger, AgentLoggerSink, AgentWebDBOptions, AppSamplingErrorCode, AppSamplingImage, AppSamplingMessage, AppSamplingOptions, AppSamplingRequest, AppSamplingResult, AppSamplingSettings, AppSamplingView, AppToolCallOptions, AppToolCallRequest, AskUserAction, AskUserAnswer, AskUserCheckedAnswer, AskUserConfig, AskUserContext, AskUserHandler, AskUserOption, AskUserQuestion, AskUserReason, AskUserRequest, AttachmentKind, BrowserAgentConfig, ClearedInfo, CompactOptions, CompactResult, CompactionConfig, CompressOptions, ContextStore, DecisionFallbackReason, DecisionPoint, EffectiveToolStrategy, EgressErrorCode, EscalationConfig, EscalationReason, ExecutorPromptContext, ExecutorResult, FileToolBinding, FileToolsOptions, GenerateOptions, GuardedFetch, IAiSdkDecisionOptions, IDecisionAnswer, IDecisionCallOptions, IDecisionConfig, IDecisionEvent, IDecisionModel, IDecisionModelSpec, IDecisionOption, IDecisionOutcome, IDecisionQuestion, IDynamicSubagentsConfig, IEgressPolicy, IMedia, IMediaConfig, IMediaFile, IMediaModelSpec, IMediaOptions, IMediaRun, IPlan, IPlanStep, IResolvedDynamicSubagents, IResolvedEgressPolicy, ISandboxConfig, ISandboxError, ISandboxLimits, ISandboxResult, ISanitizedSearch, ISearchAnswer, ISearchConfig, ISearchEngineAnswer, ISearchOptions, ISearchRequest, ISearchResult, ISearchToolResult, ISearchUsage, IStepEscalation, IStepResult, ISubagentsConfig, IToolCall, ITranscription, IUsage, IWebFetchOptions, IWebSearchOptions, IndexedDBRunStoreOptions, IndexedDBStoreOptions, Learning, LearningConfig, LimitBreach, LimitKind, LoadSkillOptions, LogLevel, McpSkillOrigin, MediaImageModel, MediaModelKind, MediaSpeechModel, MediaTranscriptionModel, MessageEndpoint, ModelInput, ModelTier, NodeResolverOptions, OutputCap, ParentToWorker, Phase, PhaseBudgets, Pipeline, PipelineOptions, PipelineRouteOptions, PipelineRouteResult, PipelineRunOptions, PlanShape, PlannerPromptContext, PlannerResult, PromptCachingSetting, PromptParts, Prompts, ProviderModelSpec, ProviderOptionsMap, ProviderType, ProxiedToolSpec, RawAction, ReplanDecision, ReplanMode, ReplanShape, ReplanTrigger, ReplannerPromptContext, ReplannerResult, ResolvedCaching, ResolvedCompaction, ResolvedConfig, ResolvedStage, ResolvedThinking, RunControl, RunFile, RunImage, RunOptions, RunPersistence, RunResult, RunSnapshot, RunStatus, RunStoreOptions, SandboxConfig, SandboxWorkerLike, SaveSkillInput, SearchEngine, SearchFreshness, SearchProvider, SearchToolsOptions, ServeSubagentOptions, SessionHolder, SessionLockMode, SessionRunState, SessionWatch, Skill, SkillOrigin, SkillStore, StageInput, StageOverride, StepComplexity, StorageChange, StorageChangeKind, StorageChangeOp, StoredMessage, StructuredResult, SubagentDefaultTools, SubagentInfo, SubagentProfile, SubagentToolOptions, SubagentWorkerConfig, SynthesizerPromptContext, ThinkingConfig, ThinkingLevel, ThinkingSetting, ThinkingStage, TierReason, TokenLimits, ToolApprovalApp, ToolApprovalConfig, ToolApprovalContext, ToolApprovalDecision, ToolApprovalMode, ToolApprovalRequest, ToolCallMode, ToolCatalogEntry, ToolLoopCallbacks, ToolLoopOptions, ToolLoopResult, ToolMode, ToolPermission, ToolResultClearing, ToolRunContext, ToolSelectionStrategy, UsagePhase, VfsListener, VirtualFile, VirtualFileInfo, VirtualFileSystemOptions, WatchSessionOptions, WebLLMAppConfigLike, WebLLMModelOptions, WorkerLike, WorkerToParent };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { LanguageModel, Experimental_DecisionModel, Tool, ToolSet, FilePart, ImageModel, SpeechModel, TranscriptionModel, SystemModelMessage, ModelMessage, generateText, streamText } from 'ai';
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';
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-BC8yMqpN.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, c as McpAppResource, b 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-BC8yMqpN.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
6
  import { I as IReferenceUse, M as MediaFitReference, a as IGeneratedPictures, b as IReferenceResult } from './media-fit-worker-Do1qzteo.js';
@@ -607,6 +607,12 @@ interface ToolApprovalRequest {
607
607
  * approval mode and the rules say.
608
608
  */
609
609
  skill?: McpSkillConsentView;
610
+ /**
611
+ * Set when an explicit rule asked (`toolApproval.rules`, `'ask'`): its name or pattern. Such a
612
+ * request is asked EVERY time - no remembered "always allow" answers a rule - so a UI should
613
+ * not offer "Always allow" on it (the React package's card does not, by default).
614
+ */
615
+ rule?: string;
610
616
  }
611
617
  /** Who asks when an MCP App asks (see `ToolApprovalRequest.app`). */
612
618
  interface ToolApprovalApp {
@@ -674,11 +680,18 @@ declare const isReadOnlyTool: (tool: Tool | undefined) => boolean;
674
680
  /** The most specific matching rule: an exact name, else the longest glob. Pure. */
675
681
  declare const matchRule: (rules: Record<string, ToolPermission> | undefined, toolName: string) => ToolPermission | undefined;
676
682
  /**
677
- * What the gate does for one call, before any human is involved. Order:
678
- * remembered "always allow" → most specific rule → mode default. Pure.
683
+ * What the gate does for one call, before any human is involved. Pure. Order:
684
+ *
685
+ * 1. the most specific RULE: `'deny'` refuses, `'ask'` asks - EVERY time: no remembered "always
686
+ * allow" answers it ("ask every time" means every time) -, `'allow'` runs;
687
+ * 2. the MODE refusing the call (`'read-only'`, a tool that may write) - no grant outranks it;
688
+ * 3. a remembered "always allow" (the model's for the agent's life, an app's by `appGrantKey`);
689
+ * 4. the mode's default.
690
+ *
679
691
  * Then one rule that only ever tightens: a call that runs code (`codeExecution`) while the run
680
692
  * acts on an MCP server's skill (`mcpSkills`) is asked when it would have been allowed - by the
681
- * mode, a rule or an "always allow" alike. A deny stays a deny.
693
+ * mode, a rule or an "always allow" alike. A deny stays a deny. The same order for the model's
694
+ * calls, a helper's and an app's (`Agent.approveAppToolCall`).
682
695
  */
683
696
  declare const decideToolPermission: (opts: {
684
697
  toolName: string;
@@ -1091,6 +1104,11 @@ type AgentEventBody =
1091
1104
  * not a tool call (see `ToolApprovalRequest.skill`): the server's words, as plain text.
1092
1105
  */
1093
1106
  skill?: McpSkillConsentView;
1107
+ /**
1108
+ * Set when an explicit `'ask'` rule asked: its name or pattern (see
1109
+ * `ToolApprovalRequest.rule`). No remembered "always allow" answers it.
1110
+ */
1111
+ rule?: string;
1094
1112
  }
1095
1113
  /** A consent decision: from the user, or `automatic` (policy denial). */
1096
1114
  | {
@@ -3716,15 +3734,20 @@ interface Agent {
3716
3734
  reloadLearnedSkills(): Promise<Skill[]>;
3717
3735
  /**
3718
3736
  * Ask this agent's consent gate about a tool call an MCP App wants to make (`./mcp` with
3719
- * `apps: true`: the app's `tools/call`), not the model. The same `toolApproval` - its rules,
3720
- * its handler (`onRequest`), its timeout - with two differences: under 'autopilot' a write
3721
- * still asks (an app never writes silently; read-only tools run, as in 'ask-writes'), and
3722
- * "always allow" given to an app is remembered for apps only, apart from the model's.
3737
+ * `apps: true`: the app's `tools/call`), not the model. The same `toolApproval` - its mode,
3738
+ * its rules, its handler (`onRequest`), its timeout - as the model's calls: 'autopilot' asks
3739
+ * nothing (writes and destructive tools included: the mode the person chose), an explicit
3740
+ * rule still wins ('ask' asks, 'deny' refuses), 'ask-writes' / 'ask-all' / 'read-only' as for
3741
+ * the model. "Always allow" given to an app is remembered for apps only, apart from the
3742
+ * model's, and for that app only (`appGrantKey`: the server's identity on its connection, the
3743
+ * tool and the app's resource) - in `options.remembered` when the host passes a set (so it
3744
+ * outlives this agent: a host that builds a new agent keeps it), else in a set of this
3745
+ * agent's. It never outranks a refusal: a rule's 'deny' and 'read-only' are decided first.
3723
3746
  * `onEvent` receives `tool.approval-requested` (with `app`) and `tool.approval-resolved`; a UI
3724
3747
  * shows the request as the app's. Resolves when the call may go; throws `ToolDeniedError`.
3725
3748
  * Make the call afterwards with `ConnectedMcp.apps.callAppTool`.
3726
3749
  */
3727
- approveAppToolCall(call: AppToolCallRequest, onEvent?: (event: AgentEvent) => void, signal?: AbortSignal): Promise<void>;
3750
+ approveAppToolCall(call: AppToolCallRequest, onEvent?: (event: AgentEvent) => void, signal?: AbortSignal, options?: AppToolCallOptions): Promise<void>;
3728
3751
  /**
3729
3752
  * Answer a completion an MCP App asks for (its `sampling/createMessage`) with this agent's
3730
3753
  * synthesizer model - outside any run, with no tools and none of the agent's context. The
@@ -3780,6 +3803,23 @@ interface AppSamplingOptions {
3780
3803
  /** The memory session whose `sessionUsage` is charged (default `config.sessionId`). */
3781
3804
  sessionId?: string;
3782
3805
  }
3806
+ /** How `Agent.approveAppToolCall` keeps an app's "always allow". */
3807
+ interface AppToolCallOptions {
3808
+ /**
3809
+ * What apps were given "always allow" for, by `appGrantKey` (the server's identity on its
3810
+ * connection, the tool, the app's resource - opaque to the host). The gate reads it and adds to
3811
+ * it; a host that keeps one set for the page's life (the React package's `useAgent` does) keeps
3812
+ * the grant across new agents. Absent: a set of this agent's.
3813
+ */
3814
+ remembered?: Set<string>;
3815
+ }
3816
+ /**
3817
+ * What an app's "always allow" is kept under: the server's identity on its connection
3818
+ * (`serverId`, else its name), the tool (`server__tool`) and the app's resource. So it is that
3819
+ * app's alone - another app of the server, or another server given the same name later (another
3820
+ * connection), is asked again.
3821
+ */
3822
+ declare const appGrantKey: (call: AppToolCallRequest) => string;
3783
3823
  /** A tool call an MCP App asks for (see `Agent.approveAppToolCall`). */
3784
3824
  interface AppToolCallRequest {
3785
3825
  /** The name the consent rules match: the tool's key, `server__tool` (`McpAppTool.key`). */
@@ -3793,6 +3833,12 @@ interface AppToolCallRequest {
3793
3833
  input: unknown;
3794
3834
  /** The server marked the tool read-only (`McpAppTool.readOnly`). */
3795
3835
  readOnly: boolean;
3836
+ /**
3837
+ * The server's identity on its connection (`McpAppTool.serverId`): "always allow" is kept
3838
+ * under it, so a server removed and another added under the same name inherits nothing.
3839
+ * Absent (an older host): the server's name.
3840
+ */
3841
+ serverId?: string;
3796
3842
  }
3797
3843
  /**
3798
3844
  * Create a headless plan → execute → replan → synthesize agent. Models are
@@ -5093,5 +5139,5 @@ declare const postStorageChange: (dbName: string | undefined, change: StorageCha
5093
5139
  */
5094
5140
  declare const onStorageChange: (dbName: string | undefined, listener: (change: StorageChange) => void) => (() => void);
5095
5141
 
5096
- export { ACTION_RECORD_MAX_CHARS, ACTION_RECORD_NOTE, APP_SAMPLING_MAX_IMAGES, APP_SAMPLING_MAX_IMAGE_BYTES, APP_SAMPLING_MAX_INPUT_CHARS, APP_SAMPLING_MAX_MESSAGES, APP_SAMPLING_MAX_SYSTEM_CHARS, APP_SAMPLING_MAX_TOKENS, APP_SAMPLING_PER_APP, APP_SAMPLING_PER_MINUTE, APP_SAMPLING_REASONING_TOKENS, APP_SAMPLING_RPC_CODES, ASK_USER_DESCRIPTION_MAX_CHARS, ASK_USER_LABEL_MAX_CHARS, ASK_USER_MAX_OPTIONS, ASK_USER_MAX_PER_RUN, ASK_USER_MIN_OPTIONS, ASK_USER_OTHER_MAX_CHARS, ASK_USER_QUESTION_MAX_CHARS, ASK_USER_TIMEOUT_MAX_MS, ASK_USER_TIMEOUT_MS, ASK_USER_TOOL, AgentTool, AgentToolSet, AppSamplingError, AskUserInputError, AttachmentsNotSupportedError, ContextWindowExceededError, CredentialStore, DECISION_PROVIDERS, DEFAULT_COMPACTION_THRESHOLD_RATIO, DEFAULT_DECISION_CONFIDENCE_THRESHOLD, DEFAULT_DECISION_TIMEOUT_MS, EgressError, FILES_STORE, FIND_TOOLS_NAME, FORGET_SKILL_TOOL, IReferenceUse, ImagesNotSupportedError, IndexedDBRunStore, IndexedDBStore, KEYS_STORE, MODEL_TIERS, McpAppToolResult, McpElicitationReason, McpElicitationSchema, McpSkillConsent, McpSkillConsentView, MediaFitReference, MemoryRunStore, MemorySkillStore, MemoryStore, NO_ATTACHMENT_NOTE, PipelineDefinition, PipelineEvent, PipelineNode, PipelineNodeRunner, PipelineResult, PlanSchema, PlanStepSchema, RELAY_MAX_REPLAYS_PER_SECOND, RELAY_MAX_SENDS, RELAY_MAX_SEND_CHARS, RELAY_MAX_STRING, REPLAY_NOTE, RUNS_STORE, ReplanSchema, SAVE_SKILL_TOOL, SEARCH_API_BASE_URL, SEARCH_DEFAULT_MAX_RESULTS, SEARCH_GOOGLE_DEFAULT_MODEL, SEARCH_GOOGLE_NOTE, SEARCH_MAX_NOTE_CHARS, SEARCH_MAX_QUERY_CHARS, SEARCH_MAX_RESULTS, SEARCH_MAX_SNIPPET_CHARS, SEARCH_MAX_SUMMARY_CHARS, SEARCH_MAX_TITLE_CHARS, SEARCH_MAX_TOTAL_CHARS, SEARCH_MAX_URL_CHARS, SEARCH_PROVIDERS, SECRETS_STORE, SESSIONS_STORE, SESSION_LOCK_MODES, SKILL_TOOL_NAMES, SPAWN_INPUT_SCHEMA, SPAWN_SUBAGENT_TOOL, STORAGE_CHANGE_KINDS, SUBAGENT_DEFAULTS, SUBAGENT_MAX_DEPTH_LIMIT, SessionBusyError, SubagentSpawnError, TOOL_APPROVAL_MODES, TOOL_APPROVAL_TIMEOUT_MS, TOOL_SEARCH_WINDOW_SHARE, TieredPlanSchema, TieredPlanStepSchema, ToolBudgetError, ToolDeniedError, VfsSkillStore, VirtualFileSystem, WEBLLM_DEFAULT_CONTEXT_WINDOW, WEB_FETCH_TOOL, WEB_SEARCH_TOOL, actionRecordOf, adoptSubagentEvent, appSamplingRequestOf, appSamplingText, askDecisionModel, attachmentKind, buildMediaModelFromSpec, buildModelFromStage, buildSearchRequest, bytesToBase64, checkAskUserAnswer, checkAskUserInput, checkEgressUrl, checkLimits, classifyAddress, cleanAskUserText, compactHistory, compactSteps, compressHistory, contextOverflowOf, contextWindowOf, createAgent, createAppSamplingLimiter, createEgressTools, createFileTools, createFindToolsTool, createGuardedFetch, createLearning, createLogger, createMedia, createPipeline, createPlan, createRunControl, createSearchTools, createSkillTools, createSubagentTool, createToolResultClearer, createWebFetchTool, createWebLLMModel, createWebSearchTool, decideReplan, decideToolPermission, decisionEgressPolicy, decisionModelFromAiSdk, defaultPrompts, defineSkill, defineTool, directBrowserOk, dispatch, escalationReasonOf, messageTokens as estimateMessagesTokens, estimateTokens, executeStep, fileToolBindingOf, findSecret, fitCompactionToWindow, generate, generateStructured, hostMatches, htmlToText, isAttachmentRefusal, isCodeExecutionTool, isDirectModel, isEscalatableError, isImageRefusal, isProviderSpec, isReadOnlyTool, isReplayedToolOutput, isTextMime, isWebGPUAvailable, learnedPreamble, limitModelOutput, loadSkillFromUrl, looksLikeJson, markCodeExecution, markReadOnly, matchRule, mediaTypeOf, mergeProviderOptions, mimeFromPath, neutralizeActionRecords, nextStrongerTier, nodeResolver, normalizePath, normalizeSkillName, normalizeSteps, normalizeUsage, onStorageChange, openAgentWebDB, outputCapNotice, parseExecutorResponse, parsePlainText, parsePlannerResponse, parseReplannerResponse, parseSearchResponse, parseSkillMarkdown, pickPipelineRoute, pickTier, postStorageChange, preloadWebLLMModel, renderActiveSkills, renderCatalog, renderSearchCatalog, renderSkillIndex, replanWanted, resolveAppSampling, resolveBudgets, resolveCaching, resolveCompaction, resolveConfig, resolveDecisionModel, resolveDynamicSubagents, resolveEgressPolicy, resolveEscalation, resolveModel, resolveResume, resolveStage, resolveThinking, runToolLoop, sanitizeSearchResults, schemaHintOf, searchEgressPolicy, searchEngineAnswer, searchStatusMessage, searchToolResult, searchTools, searchUsageOf, selectToolMode, serveSubagentWorker, shouldReplan, skillPreamble, splitBlocker, stageOutputCap, stageReasons, stream, supportsImages, supportsNativeTools, supportsPdf, supportsStructuredOutput, synthesizeAnswer, thinkingFor, toFilePart, toImagePart, tokenize, toolCatalogOf, toolDefinitionTokens, toolRunContextOf, unloadWebLLMModel, watchSession, webLLMContextWindow, withActionRecord, withRollingBreakpoint, withSystem, withWebLLMContextWindow };
5097
- export type { Agent, AgentContext, AgentEvent, AgentEventHandler, AgentLogger, AgentLoggerSink, AgentWebDBOptions, AppSamplingErrorCode, AppSamplingImage, AppSamplingMessage, AppSamplingOptions, AppSamplingRequest, AppSamplingResult, AppSamplingSettings, AppSamplingView, AppToolCallRequest, AskUserAction, AskUserAnswer, AskUserCheckedAnswer, AskUserConfig, AskUserContext, AskUserHandler, AskUserOption, AskUserQuestion, AskUserReason, AskUserRequest, AttachmentKind, BrowserAgentConfig, ClearedInfo, CompactOptions, CompactResult, CompactionConfig, CompressOptions, ContextStore, DecisionFallbackReason, DecisionPoint, EffectiveToolStrategy, EgressErrorCode, EscalationConfig, EscalationReason, ExecutorPromptContext, ExecutorResult, FileToolBinding, FileToolsOptions, GenerateOptions, GuardedFetch, IAiSdkDecisionOptions, IDecisionAnswer, IDecisionCallOptions, IDecisionConfig, IDecisionEvent, IDecisionModel, IDecisionModelSpec, IDecisionOption, IDecisionOutcome, IDecisionQuestion, IDynamicSubagentsConfig, IEgressPolicy, IMedia, IMediaConfig, IMediaFile, IMediaModelSpec, IMediaOptions, IMediaRun, IPlan, IPlanStep, IResolvedDynamicSubagents, IResolvedEgressPolicy, ISandboxConfig, ISandboxError, ISandboxLimits, ISandboxResult, ISanitizedSearch, ISearchAnswer, ISearchConfig, ISearchEngineAnswer, ISearchOptions, ISearchRequest, ISearchResult, ISearchToolResult, ISearchUsage, IStepEscalation, IStepResult, ISubagentsConfig, IToolCall, ITranscription, IUsage, IWebFetchOptions, IWebSearchOptions, IndexedDBRunStoreOptions, IndexedDBStoreOptions, Learning, LearningConfig, LimitBreach, LimitKind, LoadSkillOptions, LogLevel, McpSkillOrigin, MediaImageModel, MediaModelKind, MediaSpeechModel, MediaTranscriptionModel, MessageEndpoint, ModelInput, ModelTier, NodeResolverOptions, OutputCap, ParentToWorker, Phase, PhaseBudgets, Pipeline, PipelineOptions, PipelineRouteOptions, PipelineRouteResult, PipelineRunOptions, PlanShape, PlannerPromptContext, PlannerResult, PromptCachingSetting, PromptParts, Prompts, ProviderModelSpec, ProviderOptionsMap, ProviderType, ProxiedToolSpec, RawAction, ReplanDecision, ReplanMode, ReplanShape, ReplanTrigger, ReplannerPromptContext, ReplannerResult, ResolvedCaching, ResolvedCompaction, ResolvedConfig, ResolvedStage, ResolvedThinking, RunControl, RunFile, RunImage, RunOptions, RunPersistence, RunResult, RunSnapshot, RunStatus, RunStoreOptions, SandboxConfig, SandboxWorkerLike, SaveSkillInput, SearchEngine, SearchFreshness, SearchProvider, SearchToolsOptions, ServeSubagentOptions, SessionHolder, SessionLockMode, SessionRunState, SessionWatch, Skill, SkillOrigin, SkillStore, StageInput, StageOverride, StepComplexity, StorageChange, StorageChangeKind, StorageChangeOp, StoredMessage, StructuredResult, SubagentDefaultTools, SubagentInfo, SubagentProfile, SubagentToolOptions, SubagentWorkerConfig, SynthesizerPromptContext, ThinkingConfig, ThinkingLevel, ThinkingSetting, ThinkingStage, TierReason, TokenLimits, ToolApprovalApp, ToolApprovalConfig, ToolApprovalContext, ToolApprovalDecision, ToolApprovalMode, ToolApprovalRequest, ToolCallMode, ToolCatalogEntry, ToolLoopCallbacks, ToolLoopOptions, ToolLoopResult, ToolMode, ToolPermission, ToolResultClearing, ToolRunContext, ToolSelectionStrategy, UsagePhase, VfsListener, VirtualFile, VirtualFileInfo, VirtualFileSystemOptions, WatchSessionOptions, WebLLMAppConfigLike, WebLLMModelOptions, WorkerLike, WorkerToParent };
5142
+ export { ACTION_RECORD_MAX_CHARS, ACTION_RECORD_NOTE, APP_SAMPLING_MAX_IMAGES, APP_SAMPLING_MAX_IMAGE_BYTES, APP_SAMPLING_MAX_INPUT_CHARS, APP_SAMPLING_MAX_MESSAGES, APP_SAMPLING_MAX_SYSTEM_CHARS, APP_SAMPLING_MAX_TOKENS, APP_SAMPLING_PER_APP, APP_SAMPLING_PER_MINUTE, APP_SAMPLING_REASONING_TOKENS, APP_SAMPLING_RPC_CODES, ASK_USER_DESCRIPTION_MAX_CHARS, ASK_USER_LABEL_MAX_CHARS, ASK_USER_MAX_OPTIONS, ASK_USER_MAX_PER_RUN, ASK_USER_MIN_OPTIONS, ASK_USER_OTHER_MAX_CHARS, ASK_USER_QUESTION_MAX_CHARS, ASK_USER_TIMEOUT_MAX_MS, ASK_USER_TIMEOUT_MS, ASK_USER_TOOL, AgentTool, AgentToolSet, AppSamplingError, AskUserInputError, AttachmentsNotSupportedError, ContextWindowExceededError, CredentialStore, DECISION_PROVIDERS, DEFAULT_COMPACTION_THRESHOLD_RATIO, DEFAULT_DECISION_CONFIDENCE_THRESHOLD, DEFAULT_DECISION_TIMEOUT_MS, EgressError, FILES_STORE, FIND_TOOLS_NAME, FORGET_SKILL_TOOL, IReferenceUse, ImagesNotSupportedError, IndexedDBRunStore, IndexedDBStore, KEYS_STORE, MODEL_TIERS, McpAppToolResult, McpElicitationReason, McpElicitationSchema, McpSkillConsent, McpSkillConsentView, MediaFitReference, MemoryRunStore, MemorySkillStore, MemoryStore, NO_ATTACHMENT_NOTE, PipelineDefinition, PipelineEvent, PipelineNode, PipelineNodeRunner, PipelineResult, PlanSchema, PlanStepSchema, RELAY_MAX_REPLAYS_PER_SECOND, RELAY_MAX_SENDS, RELAY_MAX_SEND_CHARS, RELAY_MAX_STRING, REPLAY_NOTE, RUNS_STORE, ReplanSchema, SAVE_SKILL_TOOL, SEARCH_API_BASE_URL, SEARCH_DEFAULT_MAX_RESULTS, SEARCH_GOOGLE_DEFAULT_MODEL, SEARCH_GOOGLE_NOTE, SEARCH_MAX_NOTE_CHARS, SEARCH_MAX_QUERY_CHARS, SEARCH_MAX_RESULTS, SEARCH_MAX_SNIPPET_CHARS, SEARCH_MAX_SUMMARY_CHARS, SEARCH_MAX_TITLE_CHARS, SEARCH_MAX_TOTAL_CHARS, SEARCH_MAX_URL_CHARS, SEARCH_PROVIDERS, SECRETS_STORE, SESSIONS_STORE, SESSION_LOCK_MODES, SKILL_TOOL_NAMES, SPAWN_INPUT_SCHEMA, SPAWN_SUBAGENT_TOOL, STORAGE_CHANGE_KINDS, SUBAGENT_DEFAULTS, SUBAGENT_MAX_DEPTH_LIMIT, SessionBusyError, SubagentSpawnError, TOOL_APPROVAL_MODES, TOOL_APPROVAL_TIMEOUT_MS, TOOL_SEARCH_WINDOW_SHARE, TieredPlanSchema, TieredPlanStepSchema, ToolBudgetError, ToolDeniedError, VfsSkillStore, VirtualFileSystem, WEBLLM_DEFAULT_CONTEXT_WINDOW, WEB_FETCH_TOOL, WEB_SEARCH_TOOL, actionRecordOf, adoptSubagentEvent, appGrantKey, appSamplingRequestOf, appSamplingText, askDecisionModel, attachmentKind, buildMediaModelFromSpec, buildModelFromStage, buildSearchRequest, bytesToBase64, checkAskUserAnswer, checkAskUserInput, checkEgressUrl, checkLimits, classifyAddress, cleanAskUserText, compactHistory, compactSteps, compressHistory, contextOverflowOf, contextWindowOf, createAgent, createAppSamplingLimiter, createEgressTools, createFileTools, createFindToolsTool, createGuardedFetch, createLearning, createLogger, createMedia, createPipeline, createPlan, createRunControl, createSearchTools, createSkillTools, createSubagentTool, createToolResultClearer, createWebFetchTool, createWebLLMModel, createWebSearchTool, decideReplan, decideToolPermission, decisionEgressPolicy, decisionModelFromAiSdk, defaultPrompts, defineSkill, defineTool, directBrowserOk, dispatch, escalationReasonOf, messageTokens as estimateMessagesTokens, estimateTokens, executeStep, fileToolBindingOf, findSecret, fitCompactionToWindow, generate, generateStructured, hostMatches, htmlToText, isAttachmentRefusal, isCodeExecutionTool, isDirectModel, isEscalatableError, isImageRefusal, isProviderSpec, isReadOnlyTool, isReplayedToolOutput, isTextMime, isWebGPUAvailable, learnedPreamble, limitModelOutput, loadSkillFromUrl, looksLikeJson, markCodeExecution, markReadOnly, matchRule, mediaTypeOf, mergeProviderOptions, mimeFromPath, neutralizeActionRecords, nextStrongerTier, nodeResolver, normalizePath, normalizeSkillName, normalizeSteps, normalizeUsage, onStorageChange, openAgentWebDB, outputCapNotice, parseExecutorResponse, parsePlainText, parsePlannerResponse, parseReplannerResponse, parseSearchResponse, parseSkillMarkdown, pickPipelineRoute, pickTier, postStorageChange, preloadWebLLMModel, renderActiveSkills, renderCatalog, renderSearchCatalog, renderSkillIndex, replanWanted, resolveAppSampling, resolveBudgets, resolveCaching, resolveCompaction, resolveConfig, resolveDecisionModel, resolveDynamicSubagents, resolveEgressPolicy, resolveEscalation, resolveModel, resolveResume, resolveStage, resolveThinking, runToolLoop, sanitizeSearchResults, schemaHintOf, searchEgressPolicy, searchEngineAnswer, searchStatusMessage, searchToolResult, searchTools, searchUsageOf, selectToolMode, serveSubagentWorker, shouldReplan, skillPreamble, splitBlocker, stageOutputCap, stageReasons, stream, supportsImages, supportsNativeTools, supportsPdf, supportsStructuredOutput, synthesizeAnswer, thinkingFor, toFilePart, toImagePart, tokenize, toolCatalogOf, toolDefinitionTokens, toolRunContextOf, unloadWebLLMModel, watchSession, webLLMContextWindow, withActionRecord, withRollingBreakpoint, withSystem, withWebLLMContextWindow };
5143
+ export type { Agent, AgentContext, AgentEvent, AgentEventHandler, AgentLogger, AgentLoggerSink, AgentWebDBOptions, AppSamplingErrorCode, AppSamplingImage, AppSamplingMessage, AppSamplingOptions, AppSamplingRequest, AppSamplingResult, AppSamplingSettings, AppSamplingView, AppToolCallOptions, AppToolCallRequest, AskUserAction, AskUserAnswer, AskUserCheckedAnswer, AskUserConfig, AskUserContext, AskUserHandler, AskUserOption, AskUserQuestion, AskUserReason, AskUserRequest, AttachmentKind, BrowserAgentConfig, ClearedInfo, CompactOptions, CompactResult, CompactionConfig, CompressOptions, ContextStore, DecisionFallbackReason, DecisionPoint, EffectiveToolStrategy, EgressErrorCode, EscalationConfig, EscalationReason, ExecutorPromptContext, ExecutorResult, FileToolBinding, FileToolsOptions, GenerateOptions, GuardedFetch, IAiSdkDecisionOptions, IDecisionAnswer, IDecisionCallOptions, IDecisionConfig, IDecisionEvent, IDecisionModel, IDecisionModelSpec, IDecisionOption, IDecisionOutcome, IDecisionQuestion, IDynamicSubagentsConfig, IEgressPolicy, IMedia, IMediaConfig, IMediaFile, IMediaModelSpec, IMediaOptions, IMediaRun, IPlan, IPlanStep, IResolvedDynamicSubagents, IResolvedEgressPolicy, ISandboxConfig, ISandboxError, ISandboxLimits, ISandboxResult, ISanitizedSearch, ISearchAnswer, ISearchConfig, ISearchEngineAnswer, ISearchOptions, ISearchRequest, ISearchResult, ISearchToolResult, ISearchUsage, IStepEscalation, IStepResult, ISubagentsConfig, IToolCall, ITranscription, IUsage, IWebFetchOptions, IWebSearchOptions, IndexedDBRunStoreOptions, IndexedDBStoreOptions, Learning, LearningConfig, LimitBreach, LimitKind, LoadSkillOptions, LogLevel, McpSkillOrigin, MediaImageModel, MediaModelKind, MediaSpeechModel, MediaTranscriptionModel, MessageEndpoint, ModelInput, ModelTier, NodeResolverOptions, OutputCap, ParentToWorker, Phase, PhaseBudgets, Pipeline, PipelineOptions, PipelineRouteOptions, PipelineRouteResult, PipelineRunOptions, PlanShape, PlannerPromptContext, PlannerResult, PromptCachingSetting, PromptParts, Prompts, ProviderModelSpec, ProviderOptionsMap, ProviderType, ProxiedToolSpec, RawAction, ReplanDecision, ReplanMode, ReplanShape, ReplanTrigger, ReplannerPromptContext, ReplannerResult, ResolvedCaching, ResolvedCompaction, ResolvedConfig, ResolvedStage, ResolvedThinking, RunControl, RunFile, RunImage, RunOptions, RunPersistence, RunResult, RunSnapshot, RunStatus, RunStoreOptions, SandboxConfig, SandboxWorkerLike, SaveSkillInput, SearchEngine, SearchFreshness, SearchProvider, SearchToolsOptions, ServeSubagentOptions, SessionHolder, SessionLockMode, SessionRunState, SessionWatch, Skill, SkillOrigin, SkillStore, StageInput, StageOverride, StepComplexity, StorageChange, StorageChangeKind, StorageChangeOp, StoredMessage, StructuredResult, SubagentDefaultTools, SubagentInfo, SubagentProfile, SubagentToolOptions, SubagentWorkerConfig, SynthesizerPromptContext, ThinkingConfig, ThinkingLevel, ThinkingSetting, ThinkingStage, TierReason, TokenLimits, ToolApprovalApp, ToolApprovalConfig, ToolApprovalContext, ToolApprovalDecision, ToolApprovalMode, ToolApprovalRequest, ToolCallMode, ToolCatalogEntry, ToolLoopCallbacks, ToolLoopOptions, ToolLoopResult, ToolMode, ToolPermission, ToolResultClearing, ToolRunContext, ToolSelectionStrategy, UsagePhase, VfsListener, VirtualFile, VirtualFileInfo, VirtualFileSystemOptions, WatchSessionOptions, WebLLMAppConfigLike, WebLLMModelOptions, WorkerLike, WorkerToParent };
package/dist/index.js CHANGED
@@ -113,7 +113,7 @@ import {
113
113
  toolRunContextOf,
114
114
  withDeadline,
115
115
  wrapToolsForRun
116
- } from "./chunk-QWOKTI62.js";
116
+ } from "./chunk-MJSVRPBP.js";
117
117
  import {
118
118
  MCP_SKILLS_EXTENSION,
119
119
  MCP_SKILLS_MAX_PER_SERVER,
@@ -7275,6 +7275,11 @@ var watchSession = (options) => {
7275
7275
 
7276
7276
  // src/agent/runner.ts
7277
7277
  var newRunId = () => globalThis.crypto?.randomUUID?.() ?? `run-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;
7278
+ var appGrantKey = (call) => JSON.stringify([
7279
+ typeof call.serverId === "string" && call.serverId ? call.serverId : `name:${call.server}`,
7280
+ call.tool,
7281
+ call.resourceUri
7282
+ ]);
7278
7283
  var errMessage = (err) => err instanceof Error ? err.message : String(err);
7279
7284
  var modelIdOf2 = (model) => typeof model === "string" ? model : model.modelId ?? "unknown";
7280
7285
  var isReplayed = (call) => typeof call.output === "string" && call.output.startsWith(REPLAY_NOTE);
@@ -7422,7 +7427,7 @@ var createAgent = async (config) => {
7422
7427
  config.availableTools,
7423
7428
  config.excludedTools
7424
7429
  );
7425
- const sandbox = config.sandbox ? (await import("./sandbox-QNEDQZTA.js")).createSandbox(
7430
+ const sandbox = config.sandbox ? (await import("./sandbox-WICP36ZL.js")).createSandbox(
7426
7431
  config.sandbox === true ? {} : config.sandbox,
7427
7432
  hostTools,
7428
7433
  (m) => log.warn(m)
@@ -7726,7 +7731,8 @@ ${renderActiveSkills(active)}`
7726
7731
  readOnly: req.readOnly,
7727
7732
  step: req.step,
7728
7733
  ...req.subagent ? { subagent: req.subagent } : {},
7729
- ...req.skill ? { skill: req.skill } : {}
7734
+ ...req.skill ? { skill: req.skill } : {},
7735
+ ...req.rule ? { rule: req.rule } : {}
7730
7736
  }),
7731
7737
  resolved: (r) => emit({ type: "tool.approval-resolved", ...r }),
7732
7738
  wait: clock.pause
@@ -8511,34 +8517,41 @@ ${renderActiveSkills(active)}`
8511
8517
  }));
8512
8518
  },
8513
8519
  listLearnedSkills: () => learning ? learning.learned().map((s) => ({ ...s })) : [],
8514
- approveAppToolCall: (call, onEvent, signal) => gateToolCall(
8515
- // The agent's policy, but never 'autopilot' for an app, and "always allow" kept apart.
8516
- {
8517
- mode: approval.mode === "autopilot" ? "ask-writes" : approval.mode,
8518
- config: approval.config,
8519
- timeoutMs: approval.timeoutMs,
8520
- remembered: appRemembered,
8521
- mcpSkillGrants: approval.mcpSkillGrants
8522
- },
8523
- {
8524
- toolName: call.tool,
8525
- input: call.input,
8526
- readOnly: call.readOnly === true,
8527
- app: { server: call.server, tool: call.toolName, resourceUri: call.resourceUri }
8528
- },
8529
- {
8530
- requested: (req) => onEvent?.({
8531
- type: "tool.approval-requested",
8532
- id: req.id,
8533
- name: req.toolName,
8534
- input: req.input,
8535
- readOnly: req.readOnly,
8536
- ...req.app ? { app: req.app } : {}
8537
- }),
8538
- resolved: (r) => onEvent?.({ type: "tool.approval-resolved", ...r })
8539
- },
8540
- signal
8541
- ),
8520
+ approveAppToolCall: async (call, onEvent, signal, options) => {
8521
+ const grants = options?.remembered instanceof Set ? options.remembered : appRemembered;
8522
+ const readOnly = call.readOnly === true;
8523
+ const key = appGrantKey(call);
8524
+ const remembered = new Set(grants.has(key) ? [call.tool] : []);
8525
+ await gateToolCall(
8526
+ {
8527
+ mode: approval.mode,
8528
+ config: approval.config,
8529
+ timeoutMs: approval.timeoutMs,
8530
+ remembered,
8531
+ mcpSkillGrants: approval.mcpSkillGrants
8532
+ },
8533
+ {
8534
+ toolName: call.tool,
8535
+ input: call.input,
8536
+ readOnly,
8537
+ app: { server: call.server, tool: call.toolName, resourceUri: call.resourceUri }
8538
+ },
8539
+ {
8540
+ requested: (req) => onEvent?.({
8541
+ type: "tool.approval-requested",
8542
+ id: req.id,
8543
+ name: req.toolName,
8544
+ input: req.input,
8545
+ readOnly: req.readOnly,
8546
+ ...req.app ? { app: req.app } : {},
8547
+ ...req.rule ? { rule: req.rule } : {}
8548
+ }),
8549
+ resolved: (r) => onEvent?.({ type: "tool.approval-resolved", ...r })
8550
+ },
8551
+ signal
8552
+ );
8553
+ if (remembered.has(call.tool)) grants.add(key);
8554
+ },
8542
8555
  sampleForApp: async (request, options) => {
8543
8556
  if (!appSampling.enabled) {
8544
8557
  throw new AppSamplingError("disabled", "This host does not answer sampling requests");
@@ -10721,6 +10734,7 @@ export {
10721
10734
  acceptReferenceSource,
10722
10735
  actionRecordOf,
10723
10736
  adoptSubagentEvent,
10737
+ appGrantKey,
10724
10738
  appSamplingRequestOf,
10725
10739
  appSamplingText,
10726
10740
  askDecisionModel,