import { O as ChannelOutboundTargetMode } from "./types.core-vBz2zUOE.js"; import { a as SourceReplyDeliveryMode, c as PromptImageOrderEntry, l as InputProvenance } from "./types-CgXdquv1.js"; import { en as AgentDefaultsConfig, i as OpenClawConfig } from "./types.openclaw-Dkap9jPv.js"; import { a as AuthProfileFailureReason, c as OAuthCredential, d as TokenCredential, i as AuthProfileCredential, n as AuthProfileBlockedReason, o as AuthProfileIdRepairResult, r as AuthProfileBlockedSource, s as AuthProfileStore, t as ApiKeyCredential, u as ProfileUsageStats } from "./types-D6ePUYK_.js"; import { n as RuntimeEnv } from "./runtime-Bxifh4bY.js"; import { t as PluginManifestRecord } from "./manifest-registry-uVtImuYA.js"; import { n as PluginMetadataSnapshot } from "./plugin-metadata-snapshot.types-eCE-B-k2.js"; import { o as resolveAgentIdFromSessionKey } from "./session-key-fJM_U9Lv.js"; import { f as ThinkLevel$1, m as VerboseLevel } from "./commands-registry.types-BA9TbajD.js"; import { $s as isProfileInCooldown, Ac as AuthCredentialReasonCode, As as hasAvailableAuthForProvider, Bs as requireApiKey, Cc as resolveApiKeyForProfile, Cs as ProviderCredentialPrecedence, Dc as AuthProfileEligibilityReasonCode, Ds as createRuntimeProviderAuthLookup, Ec as resolveAuthProfileDisplayLabel, Es as applyLocalNoAuthHeaderOverride, Fc as CODEX_CLI_PROFILE_ID, Fs as resolveModelAuthMode, Gs as clearAuthProfileCooldown, Hs as EnvApiKeyResult, Is as resolveUsableCustomProviderApiKey, Js as markAuthProfileFailure, Ks as markAuthProfileBlockedUntil, Ls as shouldPreferExplicitConfigApiKeyAuth, Mc as TokenExpiryState, Ms as hasSyntheticLocalProviderAuthConfig, Ns as hasUsableCustomProviderApiKey, Oc as resolveAuthProfileEligibility, Os as getApiKeyForModel, Pc as CLAUDE_CLI_PROFILE_ID, Ps as resolveApiKeyForProvider, Qc as MessagingToolSend, Qs as getSoonestCooldownExpiry, Rs as ResolvedProviderAuth, Sc as refreshOAuthCredentialForRuntime, Ss as ModelAuthMode, Tc as formatAuthDoctorHint, Ts as applyAuthHeaderOverride, Us as resolveEnvApiKey, Vs as resolveAwsSdkEnvVarName, Ws as calculateAuthProfileCooldownMs, Xs as resolveProfilesUnavailableReason, Ys as resolveProfileUnusableUntilForDisplay, Zc as EmbeddedAgentRunMeta, Zs as clearExpiredCooldowns, _c as setAuthProfileOrder, _s as SimpleCompletionModelOptions, ac as loadAuthProfileStore, bc as dedupeProfileIds, bs as prepareSimpleCompletionModelForAgent, cc as loadAuthProfileStoreWithoutExternalProfiles, cs as BlockReplyChunking, dc as saveAuthProfileStore, ds as ClientToolDefinition, ec as clearRuntimeAuthProfileStoreSnapshots, fs as ExecElevatedDefaults, gs as PreparedSimpleCompletionModelForAgent, hc as markAuthProfileSuccess, hs as PreparedSimpleCompletionModel, ic as findPersistedAuthProfileCredential, js as hasRuntimeAvailableProviderAuth, kc as resolveAuthProfileOrder, ks as getCustomProviderApiKey, lc as replaceRuntimeAuthProfileStoreSnapshots, ls as EmbeddedBlockChunker, mc as suggestOAuthProfileIdForLegacyDefault, ms as AgentSimpleCompletionSelection, oc as loadAuthProfileStoreForRuntime, os as PromptMode, pc as repairOAuthProfileIdMismatch, qs as markAuthProfileCooldown, rc as ensureAuthProfileStoreWithoutExternalProfiles, sc as loadAuthProfileStoreForSecretsRuntime, ss as AgentInternalEvent, tc as ensureAuthProfileStore, uc as resolvePersistedAuthProfileOwnerAgentDir, us as AgentStreamParams, vc as upsertAuthProfile, vs as completeWithPreparedSimpleCompletionModel, wc as ExternalCliAuthDiscovery, ws as RuntimeProviderAuthLookup, xc as listProfilesForProvider, xs as resolveSimpleCompletionSelectionForAgent, yc as upsertAuthProfileWithLock, ys as prepareSimpleCompletionModel, zs as formatMissingAuthError } from "./types-VTSyQW4p.js"; import { s as SessionEntry } from "./types-RtYh3aO7.js"; import { A as textResult, C as readPositiveIntegerParam, D as readStringParam, E as readStringOrNumberParam, O as scheduleToolProgress, S as readNumberParam, T as readStringArrayParam, _ as normalizeToolModelOverride, a as PublicToolProgress, b as readFiniteNumberParam, c as ToolAuthorizationError, d as createActionGate, f as emitToolProgress, g as jsonResult, h as imageResultFromFile, i as AvailableTag, j as toolProgressResult, k as stringifyToolPayload, l as ToolInputError, m as imageResult, n as AgentToolWithMeta, o as ReactionParams, p as failedTextResult, r as AnyAgentTool, s as StringParamOptions, t as ActionGate, u as asToolParamsRecord, v as parseAvailableTags, w as readReactionParams, x as readNonNegativeIntegerParam, y as payloadTextResult } from "./common-BdhtzyVj.js"; import { n as ModelInputType, t as ModelCatalogEntry } from "./model-catalog.types-D3mWWlzt.js"; import { Oi as AuthStorage, Pi as PluginModelCatalogMetadataSnapshot, xi as ModelRegistry } from "./index-CmNKdJTo.js"; import { n as DEFAULT_MODEL, r as DEFAULT_PROVIDER, t as DEFAULT_CONTEXT_TOKENS } from "./defaults-6FEupg54.js"; import { A as resolveAgentConfig, C as resolveSubagentModelConfigSelection, D as ResolvedAgentConfig, E as setAgentEffectiveModelPrimary, F as resolveDefaultAgentId, I as hasSessionAutoModelFallbackProvenance, M as resolveAgentDir, N as resolveAgentWorkspaceDir, O as listAgentEntries, P as resolveDefaultAgentDir, S as resolveSessionAgentIds, T as resolveSubagentModelFallbacksOverride, _ as resolveAutoFallbackPrimaryProbe, a as clearAutoFallbackPrimaryProbeSelection, b as resolveRunModelFallbacksOverride, c as markAutoFallbackPrimaryProbe, d as resolveAgentExplicitModelPrimary, f as resolveAgentIdByWorkspacePath, g as resolveAgentSkillsFilter, h as resolveAgentModelPrimary, i as SubagentModelConfigSelectionSource, j as resolveAgentContextLimits, k as listAgentIds, l as resolveAgentEffectiveModelPrimary, m as resolveAgentModelFallbacksOverride, n as AutoFallbackPrimaryProbe, o as entryMatchesAutoFallbackPrimaryProbe, p as resolveAgentIdsByWorkspacePath, r as SubagentModelConfigSelectionResult, s as hasConfiguredModelFallbacks, t as AgentModelPrimaryWriteTarget, u as resolveAgentExecutionContract, v as resolveEffectiveModelFallbacks, w as resolveSubagentModelConfigSelectionResult, x as resolveSessionAgentId, y as resolveFallbackAgentId } from "./agent-scope-B4Xy--jT.js"; import { d as resolveAgentIdentity, f as resolveEffectiveMessagesConfig, g as resolveResponsePrefix, h as resolveMessagePrefix, m as resolveIdentityNamePrefix, p as resolveHumanDelayConfig, u as resolveAckReaction } from "./ack-reactions-DTk3jkPH.js"; import { t as CliDeps } from "./deps.types-C8BV1CgG.js"; import { o as OutboundSessionContext } from "./delivery-queue-BmVIZw-x.js"; import { l as projectOutboundPayloadPlanForJson } from "./deliver-KmSK2RgG.js"; import { n as AcpSessionResolution, t as AcpSessionManager } from "./manager.core-Eg8I6VLD.js"; import { i as normalizeProviderIdForAuth, n as findNormalizedProviderValue, r as normalizeProviderId, t as findNormalizedProviderKey } from "./provider-id--cxPuRVm.js"; import { a as normalizeModelRef, i as modelKey, n as ModelRef, o as parseModelRef, r as legacyModelKey, t as ModelManifestNormalizationContext } from "./model-selection-normalize-DJxoC1er.js"; import { t as resolveOpenClawAgentDir } from "./agent-dir-compat-ochOeoeD.js"; import { a as JsonValue, c as ToolAvailabilityExpression, d as ToolExecutorRef, f as ToolOwnerRef, h as ToolUnavailableReason, i as JsonPrimitive, l as ToolAvailabilitySignal, m as ToolPlanEntry, n as HiddenToolPlanEntry, o as ToolAvailabilityContext, p as ToolPlan, r as JsonObject, s as ToolAvailabilityDiagnostic, t as BuildToolPlanOptions, u as ToolDescriptor } from "./types-Cncbh-d7.js"; import { a as resolveUserTimeFormat, i as normalizeTimestamp, n as TimeFormatPreference, o as resolveUserTimezone, r as formatUserTime, s as withNormalizedTimestamp, t as ResolvedTimeFormat } from "./date-time-WJbJXOrS.js"; import { n as appendCronStyleCurrentTimeLine, r as resolveCronStyleNow, t as CronStyleNow } from "./current-time-B7_zRNnN.js"; import { _ as resolveOAuthApiKeyMarker, a as OAUTH_API_KEY_MARKER_PREFIX, c as isAwsSdkAuthMarker, d as isOAuthApiKeyMarker, f as isSecretRefHeaderValueMarker, g as resolveNonEnvSecretRefHeaderValueMarker, h as resolveNonEnvSecretRefApiKeyMarker, i as NON_ENV_SECRETREF_MARKER, l as isKnownEnvApiKeyMarker, m as resolveEnvSecretRefHeaderValueMarker, n as GCP_VERTEX_CREDENTIALS_MARKER, o as OLLAMA_LOCAL_AUTH_MARKER, p as listKnownNonSecretApiKeyMarkers, r as MINIMAX_OAUTH_MARKER, s as SECRETREF_ENV_HEADER_MARKER_PREFIX, t as CUSTOM_LOCAL_AUTH_MARKER, u as isNonSecretApiKeyMarker } from "./model-auth-markers-rG64hvLL.js"; import { C as normalizeModelSelection, D as resolveModelRefFromString, E as resolveHooksGmailModel, O as resolveThinkingDefault, S as inferUniqueProviderFromConfiguredModels, T as resolveConfiguredModelRef, _ as ModelRefStatus, a as normalizeStoredOverrideModel, b as buildModelAliasIndex, c as resolveDefaultModelForAgent, d as resolvePersistedSelectedModelRef, f as resolveReasoningDefault, g as ModelAliasIndex, h as isCliProvider, i as getModelRefStatus, k as resolveThinkingDefaultWithRuntimeCatalog, l as resolvePersistedModelRef, m as resolveSubagentSpawnModelSelection, n as buildAllowedModelSet, o as resolveAllowedModelRef, p as resolveSubagentConfiguredModelSelection, r as canonicalizeCaseOnlyCatalogModelRef, s as resolveAllowlistModelKey, t as ThinkLevel, u as resolvePersistedOverrideModelRef, v as buildConfiguredAllowlistKeys, w as resolveBareModelDefaultProvider, x as inferUniqueProviderFromCatalog, y as buildConfiguredModelCatalog } from "./model-selection-BZ9PZf0u.js"; import { c as stripMinimaxToolCallXml, o as stripDowngradedToolCallText } from "./assistant-visible-text-C3L9mtlv.js"; import { a as extractThinkingFromTaggedStream, c as inferToolMetaFromArgs, d as splitThinkingTaggedText, f as stripThinkingTagsFromText, i as extractAssistantVisibleText, l as isAssistantMessage, n as extractAssistantText, o as extractThinkingFromTaggedText, p as stripModelSpecialTokens, r as extractAssistantThinking, s as formatReasoningMessage, t as THINKING_TAG_SCAN_RE, u as promoteThinkingTagsToBlocks } from "./embedded-agent-utils-D-w0AMxK.js"; import { a as resolveSandboxPath, i as resolveSandboxInputPath, n as assertSandboxPath, o as resolveSandboxedMediaSource, r as resolveAllowedManagedMediaPath, t as assertMediaNotDataUrl } from "./sandbox-paths-DAVxv7sM.js"; import { a as optionalPositiveIntegerSchema, i as optionalNonNegativeIntegerSchema, n as channelTargetsSchema, o as optionalStringEnum, r as optionalFiniteNumberSchema, s as stringEnum, t as channelTargetSchema } from "./typebox-DYcWd2Ud.js"; import { a as normalizeCacheKey, c as resolveCacheTtlMs, d as withTimeout, f as writeCache, g as withTrustedWebToolsEndpoint, h as withStrictWebToolsEndpoint, i as ReadResponseTextResult, l as resolvePositiveTimeoutSeconds, m as withSelfHostedWebToolsEndpoint, n as DEFAULT_CACHE_TTL_MINUTES, o as readCache, p as fetchWithWebToolsNetworkGuard, r as DEFAULT_TIMEOUT_SECONDS, s as readResponseText, t as CacheEntry, u as resolveTimeoutSeconds } from "./web-shared-Df0ay1Wq.js"; import { a as normalizeWhitespace, i as markdownToText, n as extractBasicHtmlContent, o as truncateText, r as htmlToMarkdown, t as ExtractMode } from "./web-fetch-utils-aKuNAzRg.js"; import { A as setTtsProvider, B as TtsDirectiveParseResult, C as resolveTtsProviderOrder, D as setTtsEnabled, E as setTtsAutoMode, F as textToSpeechStream, I as textToSpeechTelephony, L as ResolvedTtsConfig, M as synthesizeSpeech, N as testApi, O as setTtsMaxLength, P as textToSpeech, R as ResolvedTtsModelOverrides, S as resolveTtsPrefsPath, T as setSummarizationEnabled, _ as listTtsPersonas, a as TtsSynthesisStreamResult, b as resolveTtsAutoMode, c as getLastTtsAttempt, d as getTtsPersona, f as getTtsProvider, g as listSpeechVoices, h as isTtsProviderConfigured, i as TtsSynthesisResult, j as streamSpeech, k as setTtsPersona, l as getResolvedSpeechProviderConfig, m as isTtsEnabled, n as TtsResult, o as TtsTelephonyResult, p as isSummarizationEnabled, r as TtsStreamResult, s as buildTtsSystemPromptHint, u as getTtsMaxLength, v as maybeApplyTtsToPayload, w as setLastTtsAttempt, x as resolveTtsConfig, y as resolveExplicitTtsOverrides, z as TtsDirectiveOverrides } from "./tts-runtime-DYgBF30t.js"; //#region src/agents/auth-profiles/path-resolve.d.ts declare function resolveAuthStorePathForDisplay(agentDir?: string): string; //#endregion //#region src/agents/identity-avatar.d.ts type AgentAvatarResolution = { kind: "none"; reason: string; source?: string; } | { kind: "local"; filePath: string; source: string; } | { kind: "remote"; url: string; source: string; } | { kind: "data"; url: string; source: string; }; type AgentAvatarPublicSourceInput = { kind: AgentAvatarResolution["kind"]; source?: string | null; }; declare function resolvePublicAgentAvatarSource(resolved: AgentAvatarPublicSourceInput): string | undefined; declare function resolveAgentAvatar(cfg: OpenClawConfig, agentId: string, opts?: { includeUiOverride?: boolean; }): AgentAvatarResolution; //#endregion //#region src/agents/agent-auth-credentials.d.ts type AgentApiKeyCredential = { type: "api_key"; key: string; }; type AgentOAuthCredential = { type: "oauth"; access: string; refresh: string; expires: number; }; type AgentCredential = AgentApiKeyCredential | AgentOAuthCredential; type AgentCredentialMap = Record; //#endregion //#region src/agents/agent-auth-discovery-core.d.ts type AgentDiscoveryAuthLookupOptions = { config?: OpenClawConfig; workspaceDir?: string; env?: NodeJS.ProcessEnv; }; declare function addEnvBackedAgentCredentials(credentials: AgentCredentialMap, options?: AgentDiscoveryAuthLookupOptions): AgentCredentialMap; declare function scrubLegacyStaticAuthJsonEntriesForDiscovery(pathname: string): void; //#endregion //#region src/agents/agent-auth-discovery.d.ts type DiscoverAuthStorageOptions = { externalCli?: ExternalCliAuthDiscovery; readOnly?: boolean; skipExternalAuthProfiles?: boolean; skipCredentials?: boolean; syntheticAuthProviderRefs?: Iterable; } & AgentDiscoveryAuthLookupOptions; declare function resolveAgentCredentialsForDiscovery(agentDir: string, options?: DiscoverAuthStorageOptions): AgentCredentialMap; declare namespace agent_model_discovery_d_exports { export { AuthStorage, DiscoverAuthStorageOptions, ModelRegistry, addEnvBackedAgentCredentials, discoverAuthStorage, discoverModels, normalizeDiscoveredAgentModel, resolveAgentCredentialsForDiscovery, scrubLegacyStaticAuthJsonEntriesForDiscovery }; } type DiscoverModelsOptions = { config?: OpenClawConfig; providerFilter?: string; pluginMetadataSnapshot?: PluginModelCatalogMetadataSnapshot; workspaceDir?: string; normalizeModels?: boolean; }; declare function normalizeDiscoveredAgentModel(value: T, agentDir: string): T; declare function discoverAuthStorage(agentDir: string, options?: DiscoverAuthStorageOptions): AuthStorage; declare function discoverModels(authStorage: AuthStorage, agentDir: string, options?: DiscoverModelsOptions): ModelRegistry; //#endregion //#region src/agents/model-catalog-lookup.d.ts declare function modelSupportsInput(entry: ModelCatalogEntry | undefined, input: ModelInputType): boolean; declare function findModelInCatalog(catalog: ModelCatalogEntry[], provider: string, modelId: string): ModelCatalogEntry | undefined; declare function findModelCatalogEntry(catalog: ModelCatalogEntry[], params: { provider?: string; modelId: string; }): ModelCatalogEntry | undefined; //#endregion //#region src/agents/model-catalog.d.ts type AgentDiscoveryModule = typeof agent_model_discovery_d_exports; declare function resetModelCatalogCache(): void; declare function resetModelCatalogCacheForTest(): void; declare function setModelCatalogImportForTest(loader?: () => Promise): void; declare function loadManifestModelCatalog(params: { config: OpenClawConfig; workspaceDir?: string; env?: NodeJS.ProcessEnv; fallbackToMetadataScan?: boolean; metadataSnapshot?: PluginMetadataSnapshot; }): ModelCatalogEntry[]; declare function loadModelCatalog(params?: { config?: OpenClawConfig; useCache?: boolean; readOnly?: boolean; metadataSnapshot?: PluginMetadataSnapshot; }): Promise; /** * Check if a model supports image input based on its catalog entry. */ declare function modelSupportsVision(entry: ModelCatalogEntry | undefined): boolean; /** * Check if a model supports native document/PDF input based on its catalog entry. */ declare function modelSupportsDocument(entry: ModelCatalogEntry | undefined): boolean; //#endregion //#region src/agents/model-catalog-scope.d.ts declare function resolveModelCatalogScope(params: { cfg?: OpenClawConfig; provider: string; model: string; }): { providerRefs: string[]; modelRefs: string[]; }; declare function resolveProviderDiscoveryProviderIdsForCatalogScope(params: { providerRefs?: readonly string[]; modelRefs?: readonly string[]; }): string[] | undefined; //#endregion //#region src/agents/provider-auth-aliases.d.ts type ProviderAuthAliasLookupParams = { config?: OpenClawConfig; workspaceDir?: string; env?: NodeJS.ProcessEnv; includeUntrustedWorkspacePlugins?: boolean; metadataSnapshot?: PluginMetadataSnapshot; }; declare function resetProviderAuthAliasMapCacheForTest(): void; declare function resolveProviderAuthAliasMap(params?: ProviderAuthAliasLookupParams): Record; declare function resolveProviderIdForAuth(provider: string, params?: ProviderAuthAliasLookupParams): string; //#endregion //#region src/tools/availability.d.ts declare function evaluateToolAvailability(params: { descriptor: ToolDescriptor; context?: ToolAvailabilityContext; }): readonly ToolAvailabilityDiagnostic[]; //#endregion //#region src/tools/descriptors.d.ts declare function defineToolDescriptor(descriptor: ToolDescriptor): ToolDescriptor; declare function defineToolDescriptors(descriptors: readonly ToolDescriptor[]): readonly ToolDescriptor[]; //#endregion //#region src/tools/diagnostics.d.ts type ToolPlanContractErrorCode = "duplicate-tool-name" | "missing-executor"; declare class ToolPlanContractError extends Error { readonly code: ToolPlanContractErrorCode; readonly toolName: string; constructor(params: { code: ToolPlanContractErrorCode; toolName: string; message: string; }); } //#endregion //#region src/tools/execution.d.ts declare function formatToolExecutorRef(ref: ToolExecutorRef): string; //#endregion //#region src/tools/planner.d.ts declare function buildToolPlan(options: BuildToolPlanOptions): ToolPlan; //#endregion //#region src/tools/protocol.d.ts type ToolProtocolDescriptor = { readonly name: string; readonly description: string; readonly inputSchema: JsonObject; }; declare function toToolProtocolDescriptor(entry: ToolPlanEntry): ToolProtocolDescriptor; declare function toToolProtocolDescriptors(entries: readonly ToolPlanEntry[]): readonly ToolProtocolDescriptor[]; //#endregion //#region src/agents/spawned-context.d.ts type SpawnedRunMetadata = { spawnedBy?: string | null; groupId?: string | null; groupChannel?: string | null; groupSpace?: string | null; workspaceDir?: string | null; }; //#endregion //#region src/agents/command/types.d.ts /** Image content block for Claude API multimodal messages. */ type ImageContent = { type: "image"; data: string; mimeType: string; }; type AgentCommandResultMetaOverrides = { transport?: "embedded"; fallbackFrom?: "gateway"; fallbackReason?: "gateway_timeout"; fallbackSessionId?: string; fallbackSessionKey?: string; }; type AcpTurnSource = "manual_spawn"; type AgentRunContext = { messageChannel?: string; accountId?: string; groupId?: string | null; groupChannel?: string | null; groupSpace?: string | null; currentChannelId?: string; currentThreadTs?: string; replyToMode?: "off" | "first" | "all" | "batched"; hasRepliedRef?: { value: boolean; }; }; type AgentCommandOpts = { message: string; /** User-visible transcript body; defaults to message and excludes runtime-only context. */ transcriptMessage?: string; /** Optional image attachments for multimodal messages. */ images?: ImageContent[]; /** Original inline/offloaded attachment order for inbound images. */ imageOrder?: PromptImageOrderEntry[]; /** Optional client-provided tools (OpenResponses hosted tools). */ clientTools?: ClientToolDefinition[]; /** Agent id override (must exist in config). */ agentId?: string; /** Per-run provider override. */ provider?: string; /** Per-run model override. */ model?: string; to?: string; sessionId?: string; sessionKey?: string; thinking?: string; thinkingOnce?: string; verbose?: string; json?: boolean; timeout?: string; deliver?: boolean; /** Override delivery target (separate from session routing). */ replyTo?: string; /** Override delivery channel (separate from session routing). */ replyChannel?: string; /** Override delivery account id (separate from session routing). */ replyAccountId?: string; /** Override delivery thread/topic id (separate from session routing). */ threadId?: string | number; /** Message channel context. */ messageChannel?: string; /** Tool-policy/output surface context. Defaults to messageChannel. */ messageProvider?: string; /** Delivery channel. */ channel?: string; /** Account ID for multi-account channel routing. */ accountId?: string; /** Context for embedded run routing (channel/account/thread). */ runContext?: AgentRunContext; /** Internal trusted exec approval follow-up elevated defaults. */ bashElevated?: ExecElevatedDefaults; /** Trusted sender identity bit for command/channel-action auth; defaults true for local CLI calls. */ senderIsOwner?: boolean; /** Whether this caller is authorized to use provider/model per-run overrides. */ allowModelOverride?: boolean; /** Optional runtime tool allow-list; when set, only these tools are exposed for this run. */ toolsAllow?: string[]; /** Group/spawn metadata for subagent policy inheritance and routing context. */ groupId?: SpawnedRunMetadata["groupId"]; groupChannel?: SpawnedRunMetadata["groupChannel"]; groupSpace?: SpawnedRunMetadata["groupSpace"]; spawnedBy?: SpawnedRunMetadata["spawnedBy"]; deliveryTargetMode?: ChannelOutboundTargetMode; bestEffortDeliver?: boolean; abortSignal?: AbortSignal; lane?: string; runId?: string; extraSystemPrompt?: string; /** Bootstrap workspace context injection mode for this run. */ bootstrapContextMode?: "full" | "lightweight"; /** Run kind hint for bootstrap context behavior. */ bootstrapContextRunKind?: "default" | "heartbeat" | "cron"; internalEvents?: AgentInternalEvent[]; inputProvenance?: InputProvenance; /** Internal runs can execute against a session without updating visible status/model/usage. */ sessionEffects?: "visible" | "internal"; /** Internal handoffs can write transcript turns without changing user-facing model/usage state. */ preserveUserFacingSessionModelState?: boolean; /** Visible source replies must be sent through the message tool when set. */ sourceReplyDeliveryMode?: SourceReplyDeliveryMode; /** Internal runs can omit the channel message tool entirely. */ disableMessageTool?: boolean; /** Gateway ingress that already persisted visible activity can skip the duplicate pre-run touch. */ skipInitialSessionTouch?: boolean; /** Per-call stream param overrides (best-effort). */ streamParams?: AgentStreamParams; /** Explicit workspace directory override (for subagents to inherit parent workspace). */ workspaceDir?: SpawnedRunMetadata["workspaceDir"]; /** Explicit task working directory for this run. Bootstrap still uses workspaceDir. */ cwd?: string; /** Force bundled MCP teardown when a one-shot local run completes. */ cleanupBundleMcpOnRunEnd?: boolean; /** Force long-lived CLI live session teardown when a one-shot local run completes. */ cleanupCliLiveSessionOnRunEnd?: boolean; /** Internal local CLI callers can annotate result metadata before JSON/text output. */ resultMetaOverrides?: AgentCommandResultMetaOverrides; /** Called when the actual run model is selected, including fallback retries. */ onActiveModelSelected?: (ctx: { provider: string; model: string; }) => void; /** Internal one-shot model probe mode: no tools, no workspace/chat prompt policy. */ modelRun?: boolean; /** Internal prompt-mode override for trusted local/gateway callsites. */ promptMode?: PromptMode; /** Internal ACP-ready session turn source. Manual spawn turns bypass only the dispatch gate. */ acpTurnSource?: AcpTurnSource; /** Internal handoffs can feed the model without writing the synthetic prompt to transcript. */ suppressPromptPersistence?: boolean; }; type AgentCommandIngressOpts = Omit & { /** Trusted sender identity bit for command/channel-action auth; defaults false for ingress. */senderIsOwner?: boolean; /** Ingress callsites must always pass explicit model-override authorization state. */ allowModelOverride: boolean; }; //#endregion //#region src/agents/command/delivery.d.ts type AgentCommandDeliveryPayloadStatus = "sent" | "suppressed" | "failed"; type AgentCommandDeliveryPayloadOutcome = { index: number; status: AgentCommandDeliveryPayloadStatus; reason?: string; resultCount?: number; sentBeforeError?: boolean; stage?: string; error?: string; hookEffect?: { cancelReason?: string; metadata?: Record; }; }; type AgentCommandDeliveryStatus = { requested: true; attempted: boolean; status: "sent" | "suppressed" | "partial_failed" | "failed"; /** `partial` means at least one payload was sent before a later payload failed. */ succeeded: true | false | "partial"; error?: true; errorMessage?: string; /** Free-form lowercase_snake reason from durable delivery or preflight validation. */ reason?: string; resultCount?: number; sentBeforeError?: true; payloadOutcomes?: AgentCommandDeliveryPayloadOutcome[]; }; type AgentCommandDeliveryResult = { payloads: ReturnType; meta: EmbeddedAgentRunMeta & AgentCommandResultMetaOverrides; didSendViaMessagingTool?: boolean; messagingToolSentTexts?: string[]; messagingToolSentMediaUrls?: string[]; messagingToolSentTargets?: MessagingToolSend[]; deliverySucceeded?: boolean; deliveryStatus?: AgentCommandDeliveryStatus; }; //#endregion //#region src/agents/agent-runtime-config.d.ts declare function resolveAgentRuntimeConfig(runtime: RuntimeEnv, params?: { runtimeTargetsChannelSecrets?: boolean; }): Promise<{ loadedRaw: OpenClawConfig; sourceConfig: OpenClawConfig; cfg: OpenClawConfig; }>; //#endregion //#region src/agents/agent-command.d.ts declare function prepareAgentCommandExecution(opts: AgentCommandOpts, runtime: RuntimeEnv): Promise<{ body: string; transcriptBody: string; cfg: OpenClawConfig; configuredThinkingCatalog: ModelCatalogEntry[]; normalizedSpawned: { spawnedBy?: string; groupId?: string; groupChannel?: string; groupSpace?: string; workspaceDir?: string; }; agentCfg: AgentDefaultsConfig | undefined; thinkOverride: ThinkLevel$1 | undefined; thinkOnce: ThinkLevel$1 | undefined; verboseOverride: VerboseLevel | undefined; timeoutMs: number; sessionId: string; sessionKey: string | undefined; sessionEntry: SessionEntry | undefined; sessionStore: Record | undefined; storePath: string; isNewSession: boolean; persistedThinking: ThinkLevel$1 | undefined; persistedVerbose: VerboseLevel | undefined; sessionAgentId: string; outboundSession: OutboundSessionContext | undefined; workspaceDir: string; cwd: string | undefined; agentDir: string; modelManifestContext: { manifestPlugins: readonly PluginManifestRecord[]; }; runId: string; acpManager: AcpSessionManager; acpResolution: AcpSessionResolution | null; }>; declare function agentCommand(opts: AgentCommandOpts, runtime?: RuntimeEnv, deps?: CliDeps): Promise; declare function agentCommandFromIngress(opts: AgentCommandIngressOpts, runtime?: RuntimeEnv, deps?: CliDeps): Promise; declare const testing: { resolveAgentRuntimeConfig: typeof resolveAgentRuntimeConfig; prepareAgentCommandExecution: typeof prepareAgentCommandExecution; }; //#endregion export { ActionGate, AgentAvatarResolution, AgentModelPrimaryWriteTarget, AgentSimpleCompletionSelection, AgentToolWithMeta, AnyAgentTool, type ApiKeyCredential, type AuthCredentialReasonCode, type AuthProfileBlockedReason, type AuthProfileBlockedSource, type AuthProfileCredential, type AuthProfileEligibilityReasonCode, type AuthProfileFailureReason, type AuthProfileIdRepairResult, type AuthProfileStore, AutoFallbackPrimaryProbe, AvailableTag, BlockReplyChunking, type BuildToolPlanOptions, CLAUDE_CLI_PROFILE_ID, CODEX_CLI_PROFILE_ID, CUSTOM_LOCAL_AUTH_MARKER, CacheEntry, CronStyleNow, DEFAULT_CACHE_TTL_MINUTES, DEFAULT_CONTEXT_TOKENS, DEFAULT_MODEL, DEFAULT_PROVIDER, DEFAULT_TIMEOUT_SECONDS, EmbeddedBlockChunker, type EnvApiKeyResult, ExtractMode, GCP_VERTEX_CREDENTIALS_MARKER, type HiddenToolPlanEntry, type JsonObject, type JsonPrimitive, type JsonValue, MINIMAX_OAUTH_MARKER, type ModelAliasIndex, ModelAuthMode, type ModelCatalogEntry, type ModelInputType, type ModelManifestNormalizationContext, type ModelRef, type ModelRefStatus, NON_ENV_SECRETREF_MARKER, OAUTH_API_KEY_MARKER_PREFIX, type OAuthCredential, OLLAMA_LOCAL_AUTH_MARKER, PreparedSimpleCompletionModel, PreparedSimpleCompletionModelForAgent, type ProfileUsageStats, ProviderAuthAliasLookupParams, ProviderCredentialPrecedence, PublicToolProgress, ReactionParams, ReadResponseTextResult, type ResolvedAgentConfig, type ResolvedProviderAuth, ResolvedTimeFormat, type ResolvedTtsConfig, type ResolvedTtsModelOverrides, RuntimeProviderAuthLookup, SECRETREF_ENV_HEADER_MARKER_PREFIX, SimpleCompletionModelOptions, StringParamOptions, SubagentModelConfigSelectionResult, SubagentModelConfigSelectionSource, THINKING_TAG_SCAN_RE, ThinkLevel, TimeFormatPreference, type TokenCredential, type TokenExpiryState, ToolAuthorizationError, type ToolAvailabilityContext, type ToolAvailabilityDiagnostic, type ToolAvailabilityExpression, type ToolAvailabilitySignal, type ToolDescriptor, type ToolExecutorRef, ToolInputError, type ToolOwnerRef, type ToolPlan, ToolPlanContractError, type ToolPlanEntry, type ToolUnavailableReason, type TtsDirectiveOverrides, type TtsDirectiveParseResult, type TtsResult, type TtsStreamResult, type TtsSynthesisResult, type TtsSynthesisStreamResult, type TtsTelephonyResult, setModelCatalogImportForTest as __setModelCatalogImportForTest, setModelCatalogImportForTest, testing as __testing, testing, testApi as _test, testApi, agentCommand, agentCommandFromIngress, appendCronStyleCurrentTimeLine, applyAuthHeaderOverride, applyLocalNoAuthHeaderOverride, asToolParamsRecord, assertMediaNotDataUrl, assertSandboxPath, buildAllowedModelSet, buildConfiguredAllowlistKeys, buildConfiguredModelCatalog, buildModelAliasIndex, buildToolPlan, buildTtsSystemPromptHint, calculateAuthProfileCooldownMs, canonicalizeCaseOnlyCatalogModelRef, channelTargetSchema, channelTargetsSchema, clearAuthProfileCooldown, clearAutoFallbackPrimaryProbeSelection, clearExpiredCooldowns, clearRuntimeAuthProfileStoreSnapshots, completeWithPreparedSimpleCompletionModel, createActionGate, createRuntimeProviderAuthLookup, dedupeProfileIds, defineToolDescriptor, defineToolDescriptors, emitToolProgress, ensureAuthProfileStore, ensureAuthProfileStoreWithoutExternalProfiles, entryMatchesAutoFallbackPrimaryProbe, evaluateToolAvailability, extractAssistantText, extractAssistantThinking, extractAssistantVisibleText, extractBasicHtmlContent, extractThinkingFromTaggedStream, extractThinkingFromTaggedText, failedTextResult, fetchWithWebToolsNetworkGuard, findModelCatalogEntry, findModelInCatalog, findNormalizedProviderKey, findNormalizedProviderValue, findPersistedAuthProfileCredential, formatAuthDoctorHint, formatMissingAuthError, formatReasoningMessage, formatToolExecutorRef, formatUserTime, getApiKeyForModel, getCustomProviderApiKey, getLastTtsAttempt, getModelRefStatus, getResolvedSpeechProviderConfig, getSoonestCooldownExpiry, getTtsMaxLength, getTtsPersona, getTtsProvider, hasAvailableAuthForProvider, hasConfiguredModelFallbacks, hasRuntimeAvailableProviderAuth, hasSessionAutoModelFallbackProvenance, hasSyntheticLocalProviderAuthConfig, hasUsableCustomProviderApiKey, htmlToMarkdown, imageResult, imageResultFromFile, inferToolMetaFromArgs, inferUniqueProviderFromCatalog, inferUniqueProviderFromConfiguredModels, isAssistantMessage, isAwsSdkAuthMarker, isCliProvider, isKnownEnvApiKeyMarker, isNonSecretApiKeyMarker, isOAuthApiKeyMarker, isProfileInCooldown, isSecretRefHeaderValueMarker, isSummarizationEnabled, isTtsEnabled, isTtsProviderConfigured, jsonResult, legacyModelKey, listAgentEntries, listAgentIds, listKnownNonSecretApiKeyMarkers, listProfilesForProvider, listSpeechVoices, listTtsPersonas, loadAuthProfileStore, loadAuthProfileStoreForRuntime, loadAuthProfileStoreForSecretsRuntime, loadAuthProfileStoreWithoutExternalProfiles, loadManifestModelCatalog, loadModelCatalog, markAuthProfileBlockedUntil, markAuthProfileCooldown, markAuthProfileFailure, markAuthProfileSuccess, markAutoFallbackPrimaryProbe, markdownToText, maybeApplyTtsToPayload, modelKey, modelSupportsDocument, modelSupportsInput, modelSupportsVision, normalizeCacheKey, normalizeModelRef, normalizeModelSelection, normalizeProviderId, normalizeProviderIdForAuth, normalizeStoredOverrideModel, normalizeTimestamp, normalizeToolModelOverride, normalizeWhitespace, optionalFiniteNumberSchema, optionalNonNegativeIntegerSchema, optionalPositiveIntegerSchema, optionalStringEnum, parseAvailableTags, parseModelRef, payloadTextResult, prepareSimpleCompletionModel, prepareSimpleCompletionModelForAgent, promoteThinkingTagsToBlocks, readCache, readFiniteNumberParam, readNonNegativeIntegerParam, readNumberParam, readPositiveIntegerParam, readReactionParams, readResponseText, readStringArrayParam, readStringOrNumberParam, readStringParam, refreshOAuthCredentialForRuntime, repairOAuthProfileIdMismatch, replaceRuntimeAuthProfileStoreSnapshots, requireApiKey, resetModelCatalogCache, resetModelCatalogCacheForTest, resetProviderAuthAliasMapCacheForTest, resolveAckReaction, resolveAgentAvatar, resolveAgentConfig, resolveAgentContextLimits, resolveAgentDir, resolveAgentEffectiveModelPrimary, resolveAgentExecutionContract, resolveAgentExplicitModelPrimary, resolveAgentIdByWorkspacePath, resolveAgentIdFromSessionKey, resolveAgentIdentity, resolveAgentIdsByWorkspacePath, resolveAgentModelFallbacksOverride, resolveAgentModelPrimary, resolveAgentSkillsFilter, resolveAgentWorkspaceDir, resolveAllowedManagedMediaPath, resolveAllowedModelRef, resolveAllowlistModelKey, resolveApiKeyForProfile, resolveApiKeyForProvider, resolveAuthProfileDisplayLabel, resolveAuthProfileEligibility, resolveAuthProfileOrder, resolveAuthStorePathForDisplay, resolveAutoFallbackPrimaryProbe, resolveAwsSdkEnvVarName, resolveBareModelDefaultProvider, resolveCacheTtlMs, resolveConfiguredModelRef, resolveCronStyleNow, resolveDefaultAgentDir, resolveDefaultAgentId, resolveDefaultModelForAgent, resolveEffectiveMessagesConfig, resolveEffectiveModelFallbacks, resolveEnvApiKey, resolveEnvSecretRefHeaderValueMarker, resolveExplicitTtsOverrides, resolveFallbackAgentId, resolveHooksGmailModel, resolveHumanDelayConfig, resolveIdentityNamePrefix, resolveMessagePrefix, resolveModelAuthMode, resolveModelCatalogScope, resolveModelRefFromString, resolveNonEnvSecretRefApiKeyMarker, resolveNonEnvSecretRefHeaderValueMarker, resolveOAuthApiKeyMarker, resolveOpenClawAgentDir, resolvePersistedAuthProfileOwnerAgentDir, resolvePersistedModelRef, resolvePersistedOverrideModelRef, resolvePersistedSelectedModelRef, resolvePositiveTimeoutSeconds, resolveProfileUnusableUntilForDisplay, resolveProfilesUnavailableReason, resolveProviderAuthAliasMap, resolveProviderDiscoveryProviderIdsForCatalogScope, resolveProviderIdForAuth, resolvePublicAgentAvatarSource, resolveReasoningDefault, resolveResponsePrefix, resolveRunModelFallbacksOverride, resolveSandboxInputPath, resolveSandboxPath, resolveSandboxedMediaSource, resolveSessionAgentId, resolveSessionAgentIds, resolveSimpleCompletionSelectionForAgent, resolveSubagentConfiguredModelSelection, resolveSubagentModelConfigSelection, resolveSubagentModelConfigSelectionResult, resolveSubagentModelFallbacksOverride, resolveSubagentSpawnModelSelection, resolveThinkingDefault, resolveThinkingDefaultWithRuntimeCatalog, resolveTimeoutSeconds, resolveTtsAutoMode, resolveTtsConfig, resolveTtsPrefsPath, resolveTtsProviderOrder, resolveUsableCustomProviderApiKey, resolveUserTimeFormat, resolveUserTimezone, saveAuthProfileStore, scheduleToolProgress, setAgentEffectiveModelPrimary, setAuthProfileOrder, setLastTtsAttempt, setSummarizationEnabled, setTtsAutoMode, setTtsEnabled, setTtsMaxLength, setTtsPersona, setTtsProvider, shouldPreferExplicitConfigApiKeyAuth, splitThinkingTaggedText, streamSpeech, stringEnum, stringifyToolPayload, stripDowngradedToolCallText, stripMinimaxToolCallXml, stripModelSpecialTokens, stripThinkingTagsFromText, suggestOAuthProfileIdForLegacyDefault, synthesizeSpeech, textResult, textToSpeech, textToSpeechStream, textToSpeechTelephony, toToolProtocolDescriptor, toToolProtocolDescriptors, toolProgressResult, truncateText, upsertAuthProfile, upsertAuthProfileWithLock, withNormalizedTimestamp, withSelfHostedWebToolsEndpoint, withStrictWebToolsEndpoint, withTimeout, withTrustedWebToolsEndpoint, writeCache };