import type { AgentContext, Blueprint, Domain, FlowTemplate, Profile } from "../schema.js"; /** FlowTemplate + 元数据(adapter 附加的 _vars)。_vars 优先于 argument-hint fallback。 */ export type BoundableTemplate = FlowTemplate & { _vars?: string[]; }; /** * 给定 AgentContext + Blueprint + Domains + args(形如 "/pt_turn_inject pt-quality" 或 "/pt_turn_inject risk-check 客户A 5000"), * 展开目标 Domain 的 Manual 段内容或 FlowTemplate。 * * v9 触发: * - /pt_turn_inject :注入该 Domain 的 Manual 段内容(term→Rule checklist / workflow→FlowTemplate 列表) * - /pt_turn_inject :展开 workflow-Domain 的 FlowTemplate * * Phase term-P4.3:AgentAdapter 内部把 Turn Inject 注入到 Agent 的 turn 级(Pi: input 事件 transform)。 * * v13.x(issue pt-turn-inject-not-profile-scoped):加 profile 参数—— * - domain 维度:调用方(adapter)应已用 filterDomainsByProfile 过滤 domains,renderTurnInject * 不再二次过滤(信任传入的 domains scope) * - modules 维度(阶段 2):从 blueprint 的 inject=turn 聚合组 + profile 同名 ProfileGroup.modules 算 * 白名单,/pt_turn_inject 只渲染白名单内的段,/pt_turn_inject 只在白名单含 Flows 段时查找。 * profile 为 null 或无 turn 聚合组 → 白名单 null = 不限制(向后兼容)。 */ export declare function renderTurnInject(_ctx: AgentContext, blueprint: Blueprint, domains: Domain[], profile: Profile | null, args: string): string | null; /** * 把 FlowTemplate 模板 + 用户参数 展开为完整手册 markdown。 * 错误 / 缺失变量 → 留为字面量(不抛异常)。 */ export declare function bindFlowTemplate(tpl: BoundableTemplate, args: string): string; /** 在 Blueprint 聚合组(inject=turn)的引用域中按名查找 FlowTemplate(跨 Domain)。 * v13.x(issue pt-turn-inject-not-profile-scoped):加 profile 参数——内部算 mods 白名单, * Returns undefined when whitelist has no Flows section (Profile "reference-manual" ### Modules didn't declare Flows → / trigger fails). * Phase term-P4.3 + term-final:inject 语义值 turn(原 context_message → turn → 现聚合组 inject=turn)。 */ export declare function findFlowInBlueprint(blueprint: Blueprint, domains: Array<{ name: string; modules: Record; }>, tplName: string, profile?: Profile | null): BoundableTemplate | undefined;