/** * SystemDomain:system 领域统一实现。 * * 关键点(中文) * - 收敛 system 的资产加载、上下文档位判定、plugin prompt 收集、messages 组装。 * - `DefaultSessionSystemComposer` 只做组件适配;核心逻辑统一在本文件。 */ import type { SystemModelMessage } from "ai"; import type { PluginContext } from "../../../../types/plugin/PluginContext.js"; /** * Ship 默认系统提示模板。 */ export declare const DEFAULT_SHIP_PROMPTS: string; /** * 构建一次运行的运行时 system prompt。 * * 关键点(中文) * - 仅承载“稳定规则”块,避免把每轮变化字段放在前缀 system。 * - task 模式下追加任务输出规则;chat 模式为空。 */ export declare function build_context_system_prompt(input: { /** * 项目根目录。 */ project_root: string; /** * 当前会话 ID。 */ session_id: string; /** * 当前 system 模式(默认 chat)。 */ mode?: "chat" | "task"; /** * 额外上下文行(可选)。 */ extra_context_lines?: string[]; }): string; /** * 解析静态 system prompts。 * * 关键点(中文) * - task 执行上下文可替换默认 core prompt(`DEFAULT_SHIP_PROMPTS`)为任务专用提示词。 * - PROFILE/SOUL 等其他静态提示保持不变。 */ export declare function resolve_static_system_prompts(input: { /** * 当前静态 system 文本集合。 */ systems: string[]; /** * 可选默认 core prompt 替换文本(task 场景常用)。 */ replace_default_core_prompt?: string; }): string[]; type ResolvedSystemContextProfile = { mode: "chat" | "task"; replace_default_core_prompt?: string; disable_plugin_systems: string[]; }; /** * System 档位。 * * 关键点(中文) * - 由外部创建 system 时显式指定,避免在 system 域猜测业务上下文。 */ export type SystemProfile = "chat" | "task"; /** * 按显式 profile 解析 system 上下文档位。 * * 关键点(中文) * - chat 模式:使用默认 core prompt 与全部 plugin system。 * - task 模式:自动替换 task core prompt,并禁用 chat plugin system。 */ export declare function resolve_system_context_profile(profile?: SystemProfile): ResolvedSystemContextProfile; /** * 收集受 agent 托管的 plugin system 文本。 * * 关键点(中文) * - core prompt 已包含 plugin 系统总规则;这里仅收集各 plugin 自己的 system prompt。 * - 单个加载失败走 fail-open,不阻断主链路。 */ export declare function load_managed_plugin_system_prompts(input: { /** * 当前执行上下文。 */ context: PluginContext; /** * 当前轮禁用的 plugin 名称集合。 */ disabled_plugin_names: string[]; }): Promise; /** * 收集本地 plugin 的 system 文本。 * * 关键点(中文) * - 本地 plugin 的 `plugin.system` 在语义上属于“增强注入”。 * - 若 plugin 显式声明 availability 且当前 unavailable,则跳过其 system 注入。 * - 单个 plugin 加载失败走 fail-open,不阻断主链路。 */ export declare function load_local_plugin_system_prompts(input: { /** * 当前统一执行上下文。 */ context: PluginContext; }): Promise; /** * 统一构建一次 Session 运行所需的 system messages。 * * 关键点(中文) * - context/static/plugin 的组装逻辑统一收敛在 system 域。 */ export declare function build_session_system_messages(input: { /** * 项目根目录(用于模板变量和运行态上下文)。 */ project_root: string; /** * 当前会话 ID。 */ session_id: string; /** * 本轮模式(chat/task)。 */ mode?: "chat" | "task"; /** * 可选默认 core prompt 替换文本(task 场景常用)。 */ replace_default_core_prompt?: string; /** * 静态 system 文本集合(profile/soul/user/default)。 */ static_system_prompts: string[]; /** * 受 agent 托管的 plugin system 文本集合(main plugin + managed plugins)。 */ managed_plugin_system_prompts: string[]; /** * 本地 plugin system 文本集合。 */ local_plugin_system_prompts: string[]; }): Promise; /** * 统一解析一次 Session 运行所需的 system messages(含上下文档位判定与 plugin 收集)。 */ export declare function resolve_session_system_messages(input: { /** * 项目根目录。 */ project_root: string; /** * 当前会话 ID。 */ session_id: string; /** * 当前 system 档位(默认 chat)。 */ profile?: SystemProfile; /** * 当前静态 system 文本集合。 */ static_system_prompts: string[]; /** * 当前执行上下文。 */ context: PluginContext; }): Promise; export {}; //# sourceMappingURL=SystemDomain.d.ts.map