/** * module: skill-engine —— 对外类型(编码规范 §10.1;语义出处 AM 08)。 * * 技能不是独立范式:没有自己的约束体系 —— 留痕、治理、权力边界与生命周期全部继承本规范。 * **内容软**(方法正文自由,用不用由 AI 决断),**边框硬**(装配入信封 · 脚本注册留痕 · * 不得扩权 · 版本过进化关口)。 */ import type { Skill, TaskId } from '@contracts'; import type { AssemblyContext, CrystallizedStep, SkillIndexEntry, SkillStamp, SkillViolation } from './internal/domain/skill-assembly.ts'; export type { AssemblyContext, CrystallizedStep, Skill, SkillIndexEntry, SkillStamp, SkillViolation }; export declare class SkillPowerEscalationError extends Error { readonly violations: readonly SkillViolation[]; constructor(violations: readonly SkillViolation[]); } export type RunScriptInput = { readonly taskId: TaskId; readonly activityId: string; readonly skillId: string; /** 任务数据 —— 结晶片段的入参插值面 */ readonly scope: Readonly>; readonly stepNo?: number; }; export type ScriptOutcome = { readonly ok: boolean; readonly steps: ReadonlyArray<{ tool: string; ok: boolean; output?: Record; error?: string; }>; readonly stamp: readonly SkillStamp[]; }; export type SkillEngineService = { /** 常驻上下文只有目录 —— 渐进披露 */ index(activityId: string): Promise; /** 按事加载正文;装配前过扩权检查 */ load(activityId: string, skillIds: readonly string[]): Promise; /** 结晶片段脚本 = 确定性动作链;经 ToolInvoker 调用而留痕,不得内联绕过 */ runScript(input: RunScriptInput): Promise; /** 装配入信封 —— 供任务记忆盖戳 */ stamp(activityId: string, skillIds: readonly string[]): Promise; };