Files
maestro/design/ui_kits/console/data.js
T
wangjia 5a1e185b1a docs(design): 解压 Maestro Design System 到 design/(重构参照材料)
phosphor console v1.1 设计系统(从现网 web/style.css 演化):tokens(colors/effects/
typography/fonts) + components(core/forms/surfaces .jsx) + ui_kits(console + console_mobile)
+ assets/icons(15 双色 SVG) + guidelines + CLAUDE/SKILL/readme。供 B1–B6 重构任务对照实现。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13 14:29:07 +08:00

100 lines
7.0 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// MAESTRO 调度台 · UI kit 假数据(与 src/model 状态机对齐)
window.MAESTRO_MOCK = {
projects: [
{ id: 'p1', name: 'maestro', path: '~/dev/maestro', branch: 'main', autonomy: 'auto-easy', concurrency: 2, hue: 140, state: 'running', pending: 1, agents: 1 },
{ id: 'p2', name: 'blog-engine', path: '~/dev/blog-engine', branch: 'main', autonomy: 'manual', concurrency: 1, hue: 38, state: 'paused', pending: 0, agents: 0 },
{ id: 'p3', name: 'dotfiles', path: '~/.dotfiles', branch: 'master', autonomy: 'auto-approved', concurrency: 1, hue: 265, state: 'blocked', pending: 0, agents: 0 },
],
agents: [
{ id: 'r1', project: 'maestro', title: '把轮询改为 WS 推送', kind: 'EXECUTOR', time: '06:12', meta: 'wt-127 · claude-sonnet' },
],
// 全局:跨项目 agent 概览 / daemon 配置 / 当前用户
global: {
projectCount: 3, runningProjects: 1, runningAgents: 1, maxAgents: 4,
autonomy: 'auto-easy', daemon: 'v0.4.2', port: 4517, uptime: '3d 04h',
},
// Agent 汇总:本周窗口,按项目 + 总结
agentSummary: {
tokensWeek: 12400000, runsWeek: 47, costWeek: 38.6, activeNow: 1,
byProject: [
{ id: 'p1', name: 'maestro', hue: 140, active: 1, runs: 32, tokens: 8900000 },
{ id: 'p2', name: 'blog-engine', hue: 38, active: 0, runs: 9, tokens: 2100000 },
{ id: 'p3', name: 'dotfiles', hue: 265, active: 0, runs: 6, tokens: 1400000 },
],
},
user: { name: 'jun', handle: '@jun', plan: 'Claude Max', initial: 'J', hue: 200 },
quota: {
five: { pct: 50, reset: '3h 8m' },
week: { pct: 58, reset: '16h 38m' },
},
approvals: [
{
id: 'a1', gate: 'spec', taskId: 't4', title: '重构 sync 模块', meta: 'maestro · MED',
docLabel: '改动方案(SPEC',
doc: '把轮询改为 WS 推送:\n1. store 层加 events 订阅接口\n2. daemon 广播 status.changed\n3. web 端断线重连 + 指数退避\n\n为什么:轮询 2s 间隔在多项目下放大为 N 路请求;WS 已有依赖,无新增包。',
},
],
tasks: [
{ id: 't1', title: '接入 Claude Agent SDK', cplx: 'hard', status: 'decomposed', prio: 'P0', children: [
{ id: 't1a', title: 'PoCworktree 起 headless CC', cplx: 'medium', status: 'done', prio: 'P0' },
{ id: 't1b', title: 'executor 封装 + verify 钩子', cplx: 'medium', status: 'executing', prio: 'P0' },
{ id: 't1c', title: '失败重试 n 次 → needs_attention', cplx: 'easy', status: 'blocked', prio: 'P1', deps: ['t1b'] },
]},
{ id: 't4', title: '重构 sync 模块', cplx: 'medium', status: 'spec_review', prio: 'P1',
doc: '把轮询改为 WS 推送:store 层加 events 订阅…' },
{ id: 't5', title: '看板移动端单栏适配', cplx: 'easy', status: 'ready', prio: 'P2',
ops: '将执行的操作:@media 1100px 断点改单栏;侧栏折叠为顶部条。' },
{ id: 't6', title: '事件流 append-only 审计导出', cplx: 'easy', status: 'done', prio: 'P2' },
],
archived: [
{ id: 't6', title: '事件流 append-only 审计导出', cplx: 'easy', status: 'done', subs: 0, time: '2 小时前', timeFull: '2026-06-13 04:21:09',
detail: {
attrs: [['id', 't6'], ['复杂度', 'EASY'], ['优先级', 'P2'], ['状态', '完成'], ['深度', '1'], ['创建时间', '2026-06-12 22:03:44'], ['最后更新', '2026-06-13 04:21:09']],
ops: '将执行的操作:store 层加 events 导出接口(JSONL);CLI 加 maestro events export。',
runs: [{ kind: '执行', status: '成功', span: '2026-06-13 03:58:12 → 2026-06-13 04:11:47 · 时长 13 分 35 秒', ref: '转录 runs/r-0613-0358.jsonl' }],
result: { branch: 'maestro/t6-events-export', commits: ['a3f9c21 feat(store): events export JSONL'], diff: '+182 12 · 4 files' },
approvals: [{ gate: '结果评审', action: 'accept', actor: 'you', at: '2026-06-13 04:21:09' }],
timeline: [
{ time: '06-12 22:03', text: '任务创建', who: 'you' },
{ time: '06-13 03:58', text: 'run 开始(执行)', who: '编排器', color: 'var(--cyan)' },
{ time: '06-13 04:11', text: '执行中 → 待审/合', who: '编排器', color: 'var(--violet)' },
{ time: '06-13 04:21', text: '审批通过(结果评审)· 合并', who: 'you', color: 'var(--green)' },
],
} },
{ id: 't3', title: '旧 todo.json 导入器', cplx: 'medium', status: 'done', subs: 2, time: '昨天', timeFull: '2026-06-12 09:14:02',
detail: {
attrs: [['id', 't3'], ['复杂度', 'MED'], ['优先级', 'P1'], ['状态', '完成'], ['深度', '1'], ['创建时间', '2026-06-10 11:40:12'], ['最后更新', '2026-06-12 09:14:02']],
spec: '读旧 todo/todo.jsontier1/2/3 → hard/medium/easy,导入为一个项目;重复标题跳过。',
runs: [{ kind: '执行', status: '成功', span: '2026-06-12 08:31:00 → 2026-06-12 08:54:18 · 时长 23 分 18 秒', ref: '转录 runs/r-0612-0831.jsonl' }],
approvals: [
{ gate: '方案评审', action: 'reject', actor: 'you', at: '2026-06-11 19:02:51', reason: '未处理重复导入' },
{ gate: '方案评审', action: 'accept', actor: 'you', at: '2026-06-12 07:48:20' },
{ gate: '结果评审', action: 'accept', actor: 'you', at: '2026-06-12 09:14:02' },
],
timeline: [
{ time: '06-10 11:40', text: '任务创建', who: 'you' },
{ time: '06-11 19:02', text: '审批驳回(方案评审):未处理重复导入', who: 'you', color: 'var(--red)' },
{ time: '06-12 07:48', text: '审批通过(方案评审)', who: 'you', color: 'var(--green)' },
{ time: '06-12 08:31', text: 'run 开始(执行)', who: '编排器', color: 'var(--cyan)' },
{ time: '06-12 09:14', text: '审批通过(结果评审)· 合并', who: 'you', color: 'var(--green)' },
],
} },
{ id: 't2', title: '远程看板(可选)调研', cplx: 'easy', status: 'cancelled', subs: 0, time: '3 天前', timeFull: '2026-06-10 16:02:33',
detail: {
attrs: [['id', 't2'], ['复杂度', 'EASY'], ['优先级', 'P2'], ['状态', '取消'], ['深度', '1'], ['创建时间', '2026-06-09 10:12:00'], ['最后更新', '2026-06-10 16:02:33']],
timeline: [
{ time: '06-09 10:12', text: '任务创建', who: 'you' },
{ time: '06-10 16:02', text: '可执行 → 取消', who: 'you', color: 'var(--faint)' },
],
} },
],
events: [
{ type: 'run.started', time: '06:12:09', detail: 'executor · 把轮询改为 WS 推送 · wt-127' },
{ type: 'approval.requested', time: '06:10:44', detail: 'spec_review · 重构 sync 模块' },
{ type: 'approval.rejected', time: '05:58:02', detail: '重构 sync 模块 ↳ 缺少回滚方案' },
{ type: 'status.changed', time: '05:31:18', detail: 'PoCworktree 起 headless CC:执行中 → 完成' },
{ type: 'task.created', time: '05:02:51', detail: '看板移动端单栏适配' },
{ type: 'project.synced', time: '04:48:00', detail: 'maestro · 3 项导入' },
],
};