Files
openclaw/src/plugin-sdk/config-runtime.ts
2026-05-02 13:11:19 +01:00

158 lines
5.2 KiB
TypeScript

// Shared config/runtime boundary for plugins that need config loading,
// config writes, or session-store helpers without importing src internals.
export { resolveDefaultAgentId } from "../agents/agent-scope.js";
export {
requireRuntimeConfig,
resolveLivePluginConfigObject,
resolvePluginConfigObject,
} from "./plugin-config-runtime.js";
export {
clearConfigCache,
clearRuntimeConfigSnapshot,
getRuntimeConfigSourceSnapshot,
getRuntimeConfigSnapshot,
getRuntimeConfig,
/**
* @deprecated Use getRuntimeConfig(), runtime.config.current(), or pass the
* already loaded config through the call path. Runtime code must not reload
* config on demand. Bundled plugins and repo code are blocked from using
* this by the deprecated-internal-config-api architecture guard.
*/
loadConfig,
readConfigFileSnapshotForWrite,
setRuntimeConfigSnapshot,
/**
* @deprecated Use mutateConfigFile() or replaceConfigFile() with an explicit
* afterWrite intent so restart behavior stays under host control. Bundled
* plugins and repo code are blocked from using this by the
* deprecated-internal-config-api architecture guard.
*/
writeConfigFile,
} from "../config/io.js";
export { mutateConfigFile, replaceConfigFile } from "../config/mutate.js";
export type { ConfigWriteAfterWrite } from "../config/runtime-snapshot.js";
export { logConfigUpdated } from "../config/logging.js";
export { updateConfig } from "../commands/models/shared.js";
export { resolveChannelModelOverride } from "../channels/model-overrides.js";
export {
evaluateSupplementalContextVisibility,
filterSupplementalContextItems,
} from "../security/context-visibility.js";
export {
resolveChannelContextVisibilityMode,
resolveDefaultContextVisibility,
} from "../config/context-visibility.js";
export { resolveMarkdownTableMode } from "../config/markdown-tables.js";
export {
resolveChannelGroupPolicy,
resolveChannelGroupRequireMention,
resolveToolsBySender,
type ChannelGroupPolicy,
} from "../config/group-policy.js";
export {
GROUP_POLICY_BLOCKED_LABEL,
resolveAllowlistProviderRuntimeGroupPolicy,
resolveDefaultGroupPolicy,
resolveOpenProviderRuntimeGroupPolicy,
warnMissingProviderGroupPolicyFallbackOnce,
} from "../config/runtime-group-policy.js";
export {
isNativeCommandsExplicitlyDisabled,
resolveNativeCommandsEnabled,
resolveNativeSkillsEnabled,
} from "../config/commands.js";
export {
TELEGRAM_COMMAND_NAME_PATTERN,
normalizeTelegramCommandName,
resolveTelegramCustomCommands,
} from "./telegram-command-config.js";
export { resolveActiveTalkProviderConfig } from "../config/talk.js";
export { resolveAgentMaxConcurrent } from "../config/agent-limits.js";
export { loadCronStore, resolveCronStorePath, saveCronStore } from "../cron/store.js";
export { applyModelOverrideToSessionEntry } from "../sessions/model-overrides.js";
export { coerceSecretRef } from "../config/types.secrets.js";
export {
resolveConfiguredSecretInputString,
resolveConfiguredSecretInputWithFallback,
resolveRequiredConfiguredSecretRefInputString,
} from "../gateway/resolve-configured-secret-input-string.js";
export type {
BlockStreamingCoalesceConfig,
DiscordAccountConfig,
DiscordActionConfig,
DiscordAutoPresenceConfig,
DiscordConfig,
DiscordExecApprovalConfig,
DiscordGuildChannelConfig,
DiscordGuildEntry,
DiscordIntentsConfig,
DiscordSlashCommandConfig,
DmConfig,
DmPolicy,
GoogleChatAccountConfig,
GoogleChatConfig,
ContextVisibilityMode,
GroupPolicy,
GroupToolPolicyBySenderConfig,
GroupToolPolicyConfig,
MarkdownConfig,
MarkdownTableMode,
MSTeamsChannelConfig,
MSTeamsConfig,
MSTeamsReplyStyle,
MSTeamsTeamConfig,
OpenClawConfig,
ReplyToMode,
SignalReactionNotificationMode,
SlackAccountConfig,
SlackChannelConfig,
SlackReactionNotificationMode,
SlackSlashCommandConfig,
TelegramAccountConfig,
TelegramActionConfig,
TelegramDirectConfig,
TelegramExecApprovalConfig,
TelegramGroupConfig,
TelegramInlineButtonsScope,
TelegramNetworkConfig,
TelegramTopicConfig,
ResolvedTtsPersona,
TtsAutoMode,
TtsConfig,
TtsMode,
TtsModelOverrideConfig,
TtsPersonaConfig,
TtsPersonaFallbackPolicy,
TtsPersonaPromptConfig,
TtsProvider,
} from "../config/types.js";
export {
clearSessionStoreCacheForTest,
loadSessionStore,
readSessionUpdatedAt,
recordSessionMetaFromInbound,
saveSessionStore,
updateLastRoute,
updateSessionStore,
updateSessionStoreEntry,
resolveSessionStoreEntry,
} from "../config/sessions/store.js";
export { resolveSessionKey } from "../config/sessions/session-key.js";
export { resolveStorePath } from "../config/sessions/paths.js";
export type { SessionResetMode } from "../config/sessions/reset.js";
export type { SessionScope } from "../config/sessions/types.js";
export { resolveGroupSessionKey } from "../config/sessions/group.js";
export { canonicalizeMainSessionAlias } from "../config/sessions/main-session.js";
export {
evaluateSessionFreshness,
resolveChannelResetConfig,
resolveSessionResetPolicy,
resolveSessionResetType,
resolveThreadFlag,
} from "../config/sessions/reset.js";
export {
isDangerousNameMatchingEnabled,
resolveDangerousNameMatchingEnabled,
} from "../config/dangerous-name-matching.js";