import type { ToolRunnableConfig } from '@langchain/core/tools'; import type { MemoryScope } from '../../../contracts/memory'; export type LivingMemoryToolConfigurable = { preset?: unknown; agentContext?: unknown; session?: unknown; }; export declare const getLivingMemoryToolConfigurable: (runConfig?: ToolRunnableConfig>) => LivingMemoryToolConfigurable | undefined; export type LivingMemoryToolPresetIdResolution = { ok: true; presetId: string; } | { ok: false; reason: 'missing-preset'; }; /** * 解析工具调用所属的记忆预设。 * * ChatLuna 主链路传入原始 preset;Character 链路传入未加后缀的 * presetName,而 Character 记忆统一存于带 characterPresetSuffix 的 * 预设下,因此此处按 agentContext.source 判别补后缀。 */ export declare const resolveToolMemoryPresetId: (configurable: LivingMemoryToolConfigurable | undefined) => LivingMemoryToolPresetIdResolution; export type LivingMemoryToolScopeResolution = { ok: true; scope: MemoryScope; } | { ok: false; reason: 'missing-preset' | 'subagent-tool-call' | 'missing-conversation-id' | 'missing-session' | 'missing-session-key'; }; /** * 从工具 runtime configurable 重建 MemoryScope。 * * ChatLuna 主链路:preset 直接采用(configurable 由 agent_chat_chain 以 * preset.triggerKeyword[0] 构造);conversationId 取自 agentContext,其会话 * id 为合成值的子代理运行一律拒绝。Character 链路:conversationId 为平台 * 前缀格式,presetName 无后缀,因此按 character_middleware 的规则用 * session 重算会话键并补后缀。 */ export declare const resolveToolMemoryScopeConfigurable: (configurable: LivingMemoryToolConfigurable | undefined) => LivingMemoryToolScopeResolution; export declare const describeLivingMemoryToolScopeFailure: (reason: Exclude['reason']) => "Missing conversationId in the current tool call." | "Missing preset in the current tool call." | "Missing session in the current tool call." | "Missing user or guild id of the character session in the current tool call." | "Sub-agent tool calls are not supported by this tool.";