/** * module: skill-engine —— 本模块要外界提供的能力(编码规范 §10.1 / §5.3)。 */ import type { Skill, TaskId } from '@contracts'; export type Clock = { now(): Date; }; /** 技能目录 —— app 注入 `activity-registry`(L4 同层):技能是活动的资产之一 */ export type SkillCatalog = { skillsOf(activityId: string): Promise; allowlistOf(activityId: string): Promise; }; /** * 工具调用 —— app 注入 `toolbox`(L2)的 `ToolInvoker`。 * 脚本引用的工具**仍过本活动白名单与调用契约** —— 载方法不载权力。 */ export type ScriptToolInvoker = { invoke(input: { tool: string; input: Record; activityId: string; taskId: TaskId; stepNo?: number; }): Promise<{ ok: boolean; output?: Record; error?: { message: string; }; }>; }; export type MemoryRecorder = { append(input: { taskId: TaskId; kind: 'action' | 'result'; title: string; detail?: Record; }): Promise; };