UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

45 lines (44 loc) 19.2 kB
import { C as setAgentEffectiveModelPrimary, S as resolveSubagentModelFallbacksOverride, _ as resolveRunModelFallbacksOverride, a as markAutoFallbackPrimaryProbe, b as resolveSubagentModelConfigSelection, c as resolveAgentExplicitModelPrimary, d as resolveAgentModelFallbacksOverride, f as resolveAgentModelPrimary, g as resolveFallbackAgentId, h as resolveEffectiveModelFallbacks, i as hasLegacyAutoFallbackWithoutOrigin, l as resolveAgentIdByWorkspacePath, m as resolveAutoFallbackPrimaryProbe, n as entryMatchesAutoFallbackPrimaryProbe, o as resolveAgentEffectiveModelPrimary, p as resolveAgentSkillsFilter, r as hasConfiguredModelFallbacks, s as resolveAgentExecutionContract, t as clearAutoFallbackPrimaryProbeSelection, u as resolveAgentIdsByWorkspacePath, v as resolveSessionAgentId, w as hasSessionAutoModelFallbackProvenance, x as resolveSubagentModelConfigSelectionResult, y as resolveSessionAgentIds } from "../agent-scope-MrLta7Pq.js"; import { f as resolveAgentIdFromSessionKey } from "../session-key-B_NoIfpX.js"; import { a as resolveAgentDir, c as resolveDefaultAgentId, i as resolveAgentContextLimits, n as listAgentIds, o as resolveAgentWorkspaceDir, r as resolveAgentConfig, s as resolveDefaultAgentDir, t as listAgentEntries } from "../agent-scope-config-CgCYpZfK.js"; import { n as resolveProviderAuthAliasMap, r as resolveProviderIdForAuth, t as resetProviderAuthAliasMapCacheForTest } from "../provider-auth-aliases-BNZrcvHv.js"; import { n as DEFAULT_MODEL, r as DEFAULT_PROVIDER, t as DEFAULT_CONTEXT_TOKENS } from "../defaults-mDjiWzE5.js"; import { u as resolveAuthStorePathForDisplay } from "../runtime-snapshots-CGKcj2Tz.js"; import { R as CLAUDE_CLI_PROFILE_ID, a as findPersistedAuthProfileCredential, c as loadAuthProfileStoreForRuntime, d as replaceRuntimeAuthProfileStoreSnapshots, f as resolvePersistedAuthProfileOwnerAgentDir, i as ensureAuthProfileStoreWithoutExternalProfiles, l as loadAuthProfileStoreForSecretsRuntime, n as ensureAuthProfileStore, p as saveAuthProfileStore, s as loadAuthProfileStore, t as clearRuntimeAuthProfileStoreSnapshots, u as loadAuthProfileStoreWithoutExternalProfiles, z as CODEX_CLI_PROFILE_ID } from "../store-C8spD0DG.js"; import { a as resolveSandboxPath, i as resolveSandboxInputPath, n as assertSandboxPath, o as resolveSandboxedMediaSource, r as resolveAllowedManagedMediaPath, t as assertMediaNotDataUrl } from "../sandbox-paths-DAj1Euvz.js"; import { m as resolveProviderDiscoveryProviderIdsForCatalogScope, p as resolveModelCatalogScope } from "../provider-hook-runtime-yK6Rr2x1.js"; import { i as resolveAuthProfileDisplayLabel } from "../auth-profiles-84rzaGag.js"; import { i as formatAuthDoctorHint, n as resolveApiKeyForProfile, t as refreshOAuthCredentialForRuntime } from "../oauth-goXQ01JL.js"; import { n as listProfilesForProvider, t as dedupeProfileIds } from "../profile-list-DI8_o0Rw.js"; import { a as setAuthProfileOrder, n as markAuthProfileSuccess, o as upsertAuthProfile, s as upsertAuthProfileWithLock } from "../profiles-BMWtmBgj.js"; import { n as suggestOAuthProfileIdForLegacyDefault, t as repairOAuthProfileIdMismatch } from "../repair-ELDRMhgP.js"; import { n as getSoonestCooldownExpiry, o as isProfileInCooldown, t as clearExpiredCooldowns } from "../usage-state-glPP7WfI.js"; import { i as resolveAuthProfileOrder, r as resolveAuthProfileEligibility } from "../order-CdBVYd7c.js"; import { a as markAuthProfileFailure, i as markAuthProfileCooldown, n as clearAuthProfileCooldown, o as resolveProfileUnusableUntilForDisplay, r as markAuthProfileBlockedUntil, s as resolveProfilesUnavailableReason, t as calculateAuthProfileCooldownMs } from "../usage-K7-k2Oys.js"; import { S as modelSupportsInput, b as findModelCatalogEntry, c as inferUniqueProviderFromCatalog, d as normalizeModelSelection, g as resolveConfiguredModelRef, h as resolveBareModelDefaultProvider, i as buildModelAliasIndex, l as inferUniqueProviderFromConfiguredModels, n as buildConfiguredAllowlistKeys, r as buildConfiguredModelCatalog, v as resolveHooksGmailModel, x as findModelInCatalog, y as resolveModelRefFromString } from "../model-selection-shared-b32cUYts.js"; import { a as normalizeModelRef, c as parseModelRef, i as modelKey, n as findNormalizedProviderValue, o as normalizeProviderId, r as legacyModelKey, s as normalizeProviderIdForAuth, t as findNormalizedProviderKey } from "../model-selection-normalize-roKDxQ9_.js"; import { _ as resolveNonEnvSecretRefHeaderValueMarker, a as NON_ENV_SECRETREF_MARKER, c as SECRETREF_ENV_HEADER_MARKER_PREFIX, d as isNonSecretApiKeyMarker, f as isOAuthApiKeyMarker, g as resolveNonEnvSecretRefApiKeyMarker, h as resolveEnvSecretRefHeaderValueMarker, i as MINIMAX_OAUTH_MARKER, l as isAwsSdkAuthMarker, m as listKnownNonSecretApiKeyMarkers, n as CUSTOM_LOCAL_AUTH_MARKER, o as OAUTH_API_KEY_MARKER_PREFIX, p as isSecretRefHeaderValueMarker, r as GCP_VERTEX_CREDENTIALS_MARKER, s as OLLAMA_LOCAL_AUTH_MARKER, t as CODEX_APP_SERVER_AUTH_MARKER, u as isKnownEnvApiKeyMarker, v as resolveOAuthApiKeyMarker } from "../model-auth-markers-Sq8HdQFX.js"; import { n as resolveThinkingDefaultWithRuntimeCatalog, t as resolveThinkingDefault } from "../model-thinking-default-dIc9T64G.js"; import { a as resolveAllowedModelRef, c as resolveDefaultModelForAgent, d as resolvePersistedSelectedModelRef, f as resolveReasoningDefault, h as isCliProvider, i as normalizeStoredOverrideModel, l as resolvePersistedModelRef, m as resolveSubagentSpawnModelSelection, n as canonicalizeCaseOnlyCatalogModelRef, o as resolveAllowlistModelKey, p as resolveSubagentConfiguredModelSelection, r as getModelRefStatus, s as resolveConfiguredSubagentSpawnModelSelection, t as buildAllowedModelSet, u as resolvePersistedOverrideModelRef } from "../model-selection-CA_65iXi.js"; import { t as resolveEnvApiKey } from "../model-auth-env-O5hF4UJr.js"; import { a as isProviderAuthError, i as isMissingProviderAuthError, n as ProviderAuthError, o as requireApiKey, r as formatMissingAuthError, s as resolveAwsSdkEnvVarName, t as MissingProviderAuthError } from "../model-auth-runtime-shared-ZF0jyHxm.js"; import { a as resetModelCatalogCache, i as modelSupportsVision, n as loadModelCatalog, o as resetModelCatalogCacheForTest, r as modelSupportsDocument, s as setModelCatalogImportForTest, t as loadManifestModelCatalog } from "../model-catalog-0-HKr2yW.js"; import { a as getApiKeyForModel, c as hasRuntimeAvailableProviderAuth, d as resolveApiKeyForProvider, f as resolveModelAuthMode, g as shouldPreferExplicitConfigApiKeyAuth, h as resolveUsableCustomProviderApiKey, i as createRuntimeProviderAuthLookup, l as hasSyntheticLocalProviderAuthConfig, m as resolveProviderEntryApiKeyProfileReference, n as applyLocalNoAuthHeaderOverride, o as getCustomProviderApiKey, p as resolveProviderEntryApiKeyBinding, r as canUseProfileAsProviderEntryApiKey, s as hasAvailableAuthForProvider, t as applyAuthHeaderOverride, u as hasUsableCustomProviderApiKey } from "../model-auth-DVfmdW0b.js"; import { c as stripMinimaxToolCallXml, m as stripModelSpecialTokens, o as stripDowngradedToolCallText } from "../assistant-visible-text-QdHceFYu.js"; import { C as textResult, S as stringifyToolPayload, _ as readReactionParams, a as emitToolProgress, b as readStringParam, c as imageResultFromFile, d as parseAvailableTags, f as payloadTextResult, g as readPositiveIntegerParam, h as readNumberParam, i as createActionGate, l as jsonResult, m as readNonNegativeIntegerParam, n as ToolInputError, o as failedTextResult, p as readFiniteNumberParam, r as asToolParamsRecord, s as imageResult, t as ToolAuthorizationError, u as normalizeToolModelOverride, v as readStringArrayParam, w as toolProgressResult, x as scheduleToolProgress, y as readStringOrNumberParam } from "../common-C4yy9V-D.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-DCO1JbMn.js"; import { a as resolveIdentityNamePrefix, i as resolveHumanDelayConfig, n as resolveAgentIdentity, o as resolveMessagePrefix, r as resolveEffectiveMessagesConfig, s as resolveResponsePrefix, t as resolveAckReaction } from "../identity-Qcvvo6SY.js"; import { a as extractThinkingFromTaggedStream, c as inferToolMetaFromArgs, d as sanitizeAssistantVisibleStreamText, f as splitThinkingTaggedText, i as extractAssistantVisibleText, l as isAssistantMessage, n as extractAssistantText, o as extractThinkingFromTaggedText, p as stripThinkingTagsFromText, r as extractAssistantThinking, s as formatReasoningMessage, t as THINKING_TAG_SCAN_RE, u as promoteThinkingTagsToBlocks } from "../embedded-agent-utils-CUYamrTB.js"; import { i as resolveSimpleCompletionSelectionForAgent, n as prepareSimpleCompletionModel, r as prepareSimpleCompletionModelForAgent, t as completeWithPreparedSimpleCompletionModel } from "../simple-completion-runtime-BBvPbT7Q.js"; import { A as textToSpeechStream, C as setTtsMaxLength, D as synthesizeSpeech, E as streamSpeech, O as testApi, S as setTtsEnabled, T as setTtsProvider, _ as resolveTtsPrefsPath, a as getTtsMaxLength, b as setSummarizationEnabled, c as isSummarizationEnabled, d as listSpeechVoices, f as listTtsPersonas, g as resolveTtsConfig, h as resolveTtsAutoMode, i as getResolvedSpeechProviderConfig, j as textToSpeechTelephony, k as textToSpeech, l as isTtsEnabled, m as resolveExplicitTtsOverrides, n as buildTtsSystemPromptHint, o as getTtsPersona, p as maybeApplyTtsToPayload, r as getLastTtsAttempt, s as getTtsProvider, u as isTtsProviderConfigured, v as resolveTtsProviderOrder, w as setTtsPersona, x as setTtsAutoMode, y as setLastTtsAttempt } from "../tts-runtime-CMRhdRNr.js"; import { a as truncateText, i as normalizeWhitespace, n as htmlToMarkdown, r as markdownToText, t as extractBasicHtmlContent } from "../web-fetch-utils-CGeEaxjc.js"; import { a as readResponseText, c as resolveTimeoutSeconds, i as readCache, l as withTimeout, n as DEFAULT_TIMEOUT_SECONDS, o as resolveCacheTtlMs, r as normalizeCacheKey, s as resolvePositiveTimeoutSeconds, t as DEFAULT_CACHE_TTL_MINUTES, u as writeCache } from "../web-shared-TPeHhehr.js"; import { t as EmbeddedBlockChunker } from "../embedded-agent-block-chunker-DH4NVUQq.js"; import { a as resolveUserTimezone, i as resolveUserTimeFormat, n as formatUserTime, o as withNormalizedTimestamp, r as normalizeTimestamp, t as formatDateStamp } from "../date-time-CcWivhrg.js"; import { n as resolveCronStyleNow, t as appendCronStyleCurrentTimeLine } from "../current-time-D-ClLmMh.js"; import { t as resolveOpenClawAgentDir } from "../agent-dir-compat-BqOAVSjO.js"; import { n as resolvePublicAgentAvatarSource, t as resolveAgentAvatar } from "../identity-avatar-DDczSDZA.js"; import { i as withTrustedWebToolsEndpoint, n as withSelfHostedWebToolsEndpoint, r as withStrictWebToolsEndpoint, t as fetchWithWebToolsNetworkGuard } from "../web-guarded-fetch-DYAWPWNo.js"; import { a as ToolPlanContractError, c as evaluateToolAvailability, i as formatToolExecutorRef, n as toToolProtocolDescriptors, o as defineToolDescriptor, r as buildToolPlan, s as defineToolDescriptors, t as toToolProtocolDescriptor } from "../agent-runtime-CvpQRNVf.js"; import { n as agentCommandFromIngress, r as testing, t as agentCommand } from "../agent-command-DimMXeog.js"; export { CLAUDE_CLI_PROFILE_ID, CODEX_APP_SERVER_AUTH_MARKER, CODEX_CLI_PROFILE_ID, CUSTOM_LOCAL_AUTH_MARKER, DEFAULT_CACHE_TTL_MINUTES, DEFAULT_CONTEXT_TOKENS, DEFAULT_MODEL, DEFAULT_PROVIDER, DEFAULT_TIMEOUT_SECONDS, EmbeddedBlockChunker, GCP_VERTEX_CREDENTIALS_MARKER, MINIMAX_OAUTH_MARKER, MissingProviderAuthError, NON_ENV_SECRETREF_MARKER, OAUTH_API_KEY_MARKER_PREFIX, OLLAMA_LOCAL_AUTH_MARKER, ProviderAuthError, SECRETREF_ENV_HEADER_MARKER_PREFIX, THINKING_TAG_SCAN_RE, ToolAuthorizationError, ToolInputError, ToolPlanContractError, 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, canUseProfileAsProviderEntryApiKey, 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, formatDateStamp, formatMissingAuthError, formatReasoningMessage, formatToolExecutorRef, formatUserTime, getApiKeyForModel, getCustomProviderApiKey, getLastTtsAttempt, getModelRefStatus, getResolvedSpeechProviderConfig, getSoonestCooldownExpiry, getTtsMaxLength, getTtsPersona, getTtsProvider, hasAvailableAuthForProvider, hasConfiguredModelFallbacks, hasLegacyAutoFallbackWithoutOrigin, hasRuntimeAvailableProviderAuth, hasSessionAutoModelFallbackProvenance, hasSyntheticLocalProviderAuthConfig, hasUsableCustomProviderApiKey, htmlToMarkdown, imageResult, imageResultFromFile, inferToolMetaFromArgs, inferUniqueProviderFromCatalog, inferUniqueProviderFromConfiguredModels, isAssistantMessage, isAwsSdkAuthMarker, isCliProvider, isKnownEnvApiKeyMarker, isMissingProviderAuthError, isNonSecretApiKeyMarker, isOAuthApiKeyMarker, isProfileInCooldown, isProviderAuthError, 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, resolveConfiguredSubagentSpawnModelSelection, 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, resolveProviderEntryApiKeyBinding, resolveProviderEntryApiKeyProfileReference, 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, sanitizeAssistantVisibleStreamText, 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 };