'use strict'; window.AssistantOperations = { mount(container, { api, esc, formatDate, user, settings, isActive, onRepair }) { const stepNames = { management_query: '查询受控管理资源', schedule_create: '创建原生定时任务', schedule_update: '修改原生定时任务', schedule_delete: '删除原生定时任务', configuration_review: '审查设置差异与风险', configuration_authorized: '用户授权设置修改', configuration_rejected: '用户拒绝修改', configuration_saved: '保存设置', configuration_result: '核实设置结果', sample_progress: '逐项采样', context: '读取上下文', model: '模型分析', prepare: '准备工作区', files_written: '写入建议文件', commit: 'Git提交', validate: '运行测试', rollback: '恢复基线', review: '提交审查', restart_recovery: '重启核验', execute: '执行受控操作', reject: '请求被拒绝', error: '异常', }, statusNames = { reviewed: '已审查,待授权', running: '执行中', success: '已完成', ready_for_review: '测试通过,待审查', rolled_back: '已回退', needs_review: '待人工核验', cancelled: '已取消', error: '失败', rejected: '已拒绝', }; const host = document.createElement('section'); host.className = 'card mb-3'; const layout = container.querySelector('.assistant-layout'); if (layout) layout.before(host); else container.append(host); host.innerHTML = '
| 时间 / 操作编号 | 步骤 / 状态 | 结果与依据 |
|---|---|---|
| ' +
esc(formatDate(e.createdAt)) +
' · ' +
esc(e.actorLabel || e.actor) +
' ' +
esc(e.operationId) +
' | ' + esc(stepNames[e.step] || e.step) + ' / ' + esc(statusNames[e.status] || e.status) + ' | ' +
esc(e.detail || '') +
(e.resultCommit
? ' 提交: '
: '') +
(e.recovery ? '' + esc(e.resultCommit) + '恢复:' + esc(e.recovery) + ' ' : '') +
' |