import type { ContextStrategy } from '../context/types'; import type { FailureCategory } from './quality'; import type { ReuseInputSample } from '../context/types'; export type TaskStatus = 'running' | 'completed' | 'errored' | 'cancelled'; export interface JobRecord { alias: string; sessionId: string; parentSessionId: string; /** 精确关联:tool.execute 调用的 callID(registerBeforeTask 第三参传入)。缺省表示 legacy 无 callID 注册 */ callID?: string; agent: string; label: string; status: TaskStatus; background: boolean; terminalReconciled: boolean; createdAt: number; /** 此子代理的上下文策略 */ contextStrategy?: ContextStrategy; /** 依赖的前置任务别名列表 */ dependencies?: string[]; /** 任务质量回送(负反馈闭环,见 quality.ts);低分仅标记不改变成败判定 */ quality?: { /** 0-1 质量评分;undefined 表示未执行 assessQuality(与 score:0 的"质量最差"语义区分) */ score?: number; failureCategory?: FailureCategory; latencyMs?: number; tokens?: { input: number; output: number; }; /** * 复用预算采样(最近一次可信归一化输入;undefined=未采样/未知)。 * 采样随既有 session.idle → captureResult → 质量写回路径更新,不另建缓存、 * 不在每次 Board 请求时读取会话历史;sampledAt/messageId 供新鲜度校验。 */ reuseInput?: ReuseInputSample; }; } export interface TaskArgs { description?: string; subagent_type?: string; task_id?: string; background?: boolean; } /** * 任务更新/关联操作的结果,供入口(index hook / 事件适配)观测原因。 * - ok=true 且 reason='ok':正常应用;reason='idempotent':目标已达成、零副作用; * reason='observed':仅观测记录(不落终态)。 * - ok=false:reason='no-match'(无对应任务)或 'ambiguous'(归属不明,安全 no-op)。 */ export type UpdateReason = 'ok' | 'no-match' | 'ambiguous' | 'idempotent' | 'observed'; export interface UpdateResult { ok: boolean; reason: UpdateReason; /** 命中时返回具体 job 的 alias,供入口/测试精确断言 */ alias?: string; } //# sourceMappingURL=types.d.ts.map