import { $t as AgentContextLimitsConfig, Pt as AgentConfig, r as DexConfig, tn as AgentDefaultsConfig } from "./types.openclaw-DdfkPVtj.js";
import { o as AgentModelConfig } from "./types.provider-request-Zn1BAFhk.js";
import { a as SessionEntry } from "./types-BeMUIOmF.js";

//#region src/config/sessions/model-override-provenance.d.ts
declare function hasSessionAutoModelFallbackProvenance(entry: Pick<SessionEntry, "providerOverride" | "modelOverride" | "modelOverrideFallbackOriginProvider" | "modelOverrideFallbackOriginModel"> | undefined): boolean;
//#endregion
//#region src/agents/agent-scope-config.d.ts
type AgentEntry = NonNullable<NonNullable<DexConfig["agents"]>["list"]>[number];
type ResolvedAgentConfig = {
  name?: string;
  workspace?: string;
  agentDir?: string;
  model?: AgentEntry["model"];
  thinkingDefault?: AgentEntry["thinkingDefault"];
  verboseDefault?: AgentDefaultsConfig["verboseDefault"];
  reasoningDefault?: AgentEntry["reasoningDefault"];
  fastModeDefault?: AgentEntry["fastModeDefault"];
  contextInjection?: AgentEntry["contextInjection"];
  bootstrapMaxChars?: AgentEntry["bootstrapMaxChars"];
  bootstrapTotalMaxChars?: AgentEntry["bootstrapTotalMaxChars"];
  experimental?: AgentDefaultsConfig["experimental"];
  skills?: AgentEntry["skills"];
  memorySearch?: AgentEntry["memorySearch"];
  humanDelay?: AgentEntry["humanDelay"];
  tts?: AgentEntry["tts"];
  contextLimits?: AgentContextLimitsConfig;
  heartbeat?: AgentEntry["heartbeat"];
  identity?: AgentEntry["identity"];
  groupChat?: AgentEntry["groupChat"];
  subagents?: AgentEntry["subagents"];
  runRetries?: AgentEntry["runRetries"];
  embeddedAgent?: AgentEntry["embeddedAgent"];
  sandbox?: AgentEntry["sandbox"];
  tools?: AgentEntry["tools"];
};
declare function listAgentEntries(cfg: DexConfig): AgentEntry[];
declare function listAgentIds(cfg: DexConfig): string[];
declare function resolveDefaultAgentId(cfg: DexConfig): string;
declare function resolveAgentConfig(cfg: DexConfig, agentId: string): ResolvedAgentConfig | undefined;
declare function resolveAgentContextLimits(cfg: DexConfig | undefined, agentId?: string | null): AgentContextLimitsConfig | undefined;
declare function resolveAgentWorkspaceDir(cfg: DexConfig, agentId: string, env?: NodeJS.ProcessEnv): string;
declare function resolveAgentDir(cfg: DexConfig, agentId: string, env?: NodeJS.ProcessEnv): string;
declare function resolveDefaultAgentDir(cfg: DexConfig, env?: NodeJS.ProcessEnv): string;
//#endregion
//#region src/agents/agent-scope.d.ts
type AutoFallbackPrimaryProbe = {
  provider: string;
  model: string;
  fallbackProvider: string;
  fallbackModel: string;
  fallbackAuthProfileId?: string;
  fallbackAuthProfileIdSource?: "auto" | "user";
};
declare function hasLegacyAutoFallbackWithoutOrigin(entry: Pick<SessionEntry, "modelOverrideSource" | "modelOverrideFallbackOriginProvider" | "modelOverrideFallbackOriginModel"> | null | undefined): boolean;
declare function resolveAutoFallbackPrimaryProbe(params: {
  entry: Pick<SessionEntry, "providerOverride" | "modelOverride" | "modelOverrideSource" | "modelOverrideFallbackOriginProvider" | "modelOverrideFallbackOriginModel" | "authProfileOverride" | "authProfileOverrideSource" | "authProfileOverrideCompactionCount"> | null | undefined;
  sessionKey?: string | null;
  primaryProvider: string;
  primaryModel: string;
  now?: number;
  minIntervalMs?: number;
  maxTrackedProbeKeys?: number;
  probeState?: Map<string, number>;
}): AutoFallbackPrimaryProbe | undefined;
declare function markAutoFallbackPrimaryProbe(params: {
  probe: AutoFallbackPrimaryProbe;
  sessionKey?: string | null;
  now?: number;
  minIntervalMs?: number;
  maxTrackedProbeKeys?: number;
  probeState?: Map<string, number>;
}): void;
declare function entryMatchesAutoFallbackPrimaryProbe(entry: Pick<SessionEntry, "providerOverride" | "modelOverride" | "modelOverrideSource" | "modelOverrideFallbackOriginProvider" | "modelOverrideFallbackOriginModel"> | null | undefined, probe: AutoFallbackPrimaryProbe): boolean;
declare function clearAutoFallbackPrimaryProbeSelection(entry: SessionEntry, now?: number): void;
declare function resolveSessionAgentIds(params: {
  sessionKey?: string;
  config?: DexConfig;
  agentId?: string;
}): {
  defaultAgentId: string;
  sessionAgentId: string;
};
declare function resolveSessionAgentId(params: {
  sessionKey?: string;
  config?: DexConfig;
  agentId?: string;
}): string;
declare function resolveAgentExecutionContract(cfg: DexConfig | undefined, agentId?: string | null): NonNullable<NonNullable<AgentDefaultsConfig["embeddedAgent"]>["executionContract"]> | undefined;
declare function resolveAgentSkillsFilter(cfg: DexConfig, agentId: string): string[] | undefined;
declare function resolveAgentExplicitModelPrimary(cfg: DexConfig, agentId: string): string | undefined;
declare function resolveAgentEffectiveModelPrimary(cfg: DexConfig, agentId: string): string | undefined;
type AgentModelPrimaryWriteTarget = "agent" | "defaults";
declare function setAgentEffectiveModelPrimary(cfg: DexConfig, agentId: string, primary: string): AgentModelPrimaryWriteTarget;
/** @deprecated Prefer explicit/effective helpers at new call sites. */
declare function resolveAgentModelPrimary(cfg: DexConfig, agentId: string): string | undefined;
declare function resolveAgentModelFallbacksOverride(cfg: DexConfig, agentId: string): string[] | undefined;
type SubagentModelConfigSelectionSource = "subagent" | "agent" | "default-subagent";
type SubagentModelConfigSelectionResult = {
  raw: AgentModelConfig;
  source: SubagentModelConfigSelectionSource;
};
declare function resolveSubagentModelConfigSelectionResult(params: {
  cfg: DexConfig;
  agentId?: string;
  agentConfigOverride?: Pick<AgentConfig, "model" | "subagents">;
}): SubagentModelConfigSelectionResult | undefined;
declare function resolveSubagentModelConfigSelection(params: {
  cfg: DexConfig;
  agentId?: string;
  agentConfigOverride?: Pick<AgentConfig, "model" | "subagents">;
}): AgentModelConfig | undefined;
declare function resolveSubagentModelFallbacksOverride(cfg: DexConfig, agentId: string): string[] | undefined;
declare function resolveFallbackAgentId(params: {
  agentId?: string | null;
  sessionKey?: string | null;
}): string;
declare function resolveRunModelFallbacksOverride(params: {
  cfg: DexConfig | undefined;
  agentId?: string | null;
  sessionKey?: string | null;
}): string[] | undefined;
declare function hasConfiguredModelFallbacks(params: {
  cfg: DexConfig | undefined;
  agentId?: string | null;
  sessionKey?: string | null;
}): boolean;
declare function resolveEffectiveModelFallbacks(params: {
  cfg: DexConfig;
  agentId: string;
  sessionKey?: string | null;
  hasSessionModelOverride: boolean;
  modelOverrideSource?: "auto" | "user";
  hasAutoFallbackProvenance?: boolean;
}): string[] | undefined;
declare function resolveAgentIdsByWorkspacePath(cfg: DexConfig, workspacePath: string): string[];
declare function resolveAgentIdByWorkspacePath(cfg: DexConfig, workspacePath: string): string | undefined;
//#endregion
export { listAgentIds as A, resolveSessionAgentIds as C, setAgentEffectiveModelPrimary as D, resolveSubagentModelFallbacksOverride as E, resolveDefaultAgentDir as F, resolveDefaultAgentId as I, hasSessionAutoModelFallbackProvenance as L, resolveAgentContextLimits as M, resolveAgentDir as N, ResolvedAgentConfig as O, resolveAgentWorkspaceDir as P, resolveSessionAgentId as S, resolveSubagentModelConfigSelectionResult as T, resolveAgentSkillsFilter as _, clearAutoFallbackPrimaryProbeSelection as a, resolveFallbackAgentId as b, hasLegacyAutoFallbackWithoutOrigin as c, resolveAgentExecutionContract as d, resolveAgentExplicitModelPrimary as f, resolveAgentModelPrimary as g, resolveAgentModelFallbacksOverride as h, SubagentModelConfigSelectionSource as i, resolveAgentConfig as j, listAgentEntries as k, markAutoFallbackPrimaryProbe as l, resolveAgentIdsByWorkspacePath as m, AutoFallbackPrimaryProbe as n, entryMatchesAutoFallbackPrimaryProbe as o, resolveAgentIdByWorkspacePath as p, SubagentModelConfigSelectionResult as r, hasConfiguredModelFallbacks as s, AgentModelPrimaryWriteTarget as t, resolveAgentEffectiveModelPrimary as u, resolveAutoFallbackPrimaryProbe as v, resolveSubagentModelConfigSelection as w, resolveRunModelFallbacksOverride as x, resolveEffectiveModelFallbacks as y };