const prototypeStages = [
  { id: "detected", label: "待确认", short: "识别工作", progress: 4, meegle: "开始", description: "Platform 只保存 WorkItemRef 并生成 DispatchProposal；Run 尚未创建。" },
  { id: "plan", label: "待发起确认", short: "确认发起", progress: 12, meegle: "开始", description: "负责人在飞书确认员工、交付物、预算、数据范围和 L1 文档草稿写入。" },
  { id: "running", label: "执行中", short: "可靠执行", progress: 63, meegle: "进行中", description: "一个 EmployeeVersion、一个 ActorRun 与一个 PairSession 正在执行；Attempt 可以替换恢复。" },
  { id: "review", label: "待验收", short: "业务验收", progress: 96, meegle: "待验收", description: "Document Gateway 已创建不可变交付版本，等待负责人通过或结构化退回。" },
  { id: "completed_sync", label: "已完成 · 待同步", short: "待同步", progress: 100, meegle: "待验收", description: "AcceptanceDecision 已记录，Run 已完成；Meegle WritebackTask 正独立等待同步。" },
  { id: "accepted", label: "已完成 · 已同步", short: "闭环完成", progress: 100, meegle: "已完成", description: "Run 已完成，Meegle 业务投影已按当前 projection generation 同步。" }
];

const prototypeEmployees = [
  { id: "lead", initials: "研", name: "项目研究员", role: "AI Employee", tone: "violet", status: "启用", model: "执行引擎（当前 Codex）", skills: ["调研 SOP", "证据核验", "正式报告"], tools: ["飞书知识", "Document Gateway"], budget: "¥180 / Run", description: "V1 唯一执行员工：针对 Meegle 工作项完成内部调研、方案或正式报告，并提交不可变交付版本验收。" },
  { id: "research", initials: "策", name: "客户方案顾问", role: "AI Employee", tone: "blue", status: "停用", model: "执行引擎（当前 Codex）", skills: ["方案结构", "需求澄清"], tools: ["飞书知识"], budget: "¥160 / Run", description: "长期员工配置示例，不参与当前 V1 Run。" },
  { id: "data", initials: "数", name: "数据分析师", role: "AI Employee", tone: "green", status: "停用", model: "执行引擎（当前 Codex）", skills: ["分析 SOP", "结论校验"], tools: ["数据沙箱"], budget: "¥200 / Run", description: "待数据分析工作类型完成验证后再启用。" }
];

const prototypePolicies = [
  { id: "P-01", name: "飞书文档草稿", trigger: "在指定目录创建或更新内部草稿", risk: "L1 可逆写入", route: "发起确认预授权", timeout: "随 Run", fallback: "卡片附全文", enabled: true },
  { id: "P-07", name: "Meegle 交付投影", trigger: "回写评论、文档链接或当前指针", risk: "L1 可逆写入", route: "验收通过授权", timeout: "异步", fallback: "人工复制 + 深链", enabled: true },
  { id: "P-19", name: "Meegle 业务状态", trigger: "更新为已完成或撤销完成", risk: "L2 状态变更", route: "验收通过后按策略", timeout: "异步", fallback: "补偿任务 / 人工", enabled: true },
  { id: "P-23", name: "预算超限", trigger: "预计成本超过 Run 预算", risk: "治理暂停", route: "负责人", timeout: "60 分钟", fallback: "暂停 Run", enabled: true }
];

const prototypeConnections = [
  { id: "meegle", name: "Meegle / Lark Project", account: "AI员工工作平台-联调测试空间-0812", status: "写入待验证", scope: "Story 24233867 · 读取已验证 · 写入走降级", checked: "刚刚" },
  { id: "lark-doc", name: "飞书 Document Gateway", account: "企业自建应用", status: "正常", scope: "指定目录 · L1 草稿创建与更新", checked: "2 分钟前" },
  { id: "lark-im", name: "飞书消息与卡片", account: "HyperWork AI", status: "正常", scope: "发起确认 · 验收 · 结构化退回", checked: "刚刚" },
  { id: "credential", name: "执行引擎连接", account: "隔离测试环境", status: "正常", scope: "Attempt 启动 · 事件回传 · 无生产凭据", checked: "刚刚" }
];

const prototypeKnowledgeSources = [
  { id: "wiki-platform", name: "AI 员工平台设计 Wiki", type: "飞书 Wiki", scope: "项目研究员", permission: "沿用操作者权限", version: "v14", sync: "6 分钟前", status: "已同步" },
  { id: "docs-flow", name: "完整流程设计目录", type: "飞书文档目录", scope: "项目研究员", permission: "只读", version: "v8", sync: "今天 14:20", status: "已同步" },
  { id: "base-evidence", name: "联调证据索引", type: "飞书多维表格", scope: "项目研究员", permission: "字段级读取", version: "实时", sync: "刚刚", status: "已同步" }
];

const prototypeCredentials = [
  { id: "cred-lark", name: "飞书 Gateway 应用身份", provider: "飞书应用身份", scope: "私聊卡片 · 指定目录文档", expires: "89 天后", status: "正常" },
  { id: "cred-meegle", name: "Meegle 投影写回", provider: "组织应用身份", scope: "评论 · 当前指针 · 状态", expires: "89 天后", status: "待接口验证" }
];

const prototypeRuntimes = [
  { id: "runtime-adapter", name: "Action / Document Gateway", image: "hyperwork/gateway:2026.08", cpu: "2 vCPU", memory: "4 GB", network: "Meegle / Lark 域名白名单", tools: "策略 · 凭据 · 幂等 · 回执", timeout: "20 分钟", status: "可用" },
  { id: "runtime-codex", name: "Codex 隔离 Workspace", image: "hyperwork/codex:2026.08", cpu: "4 vCPU", memory: "8 GB", network: "无生产凭据", tools: "研究 · 分析 · 内容与 ActionIntent", timeout: "30 分钟", status: "可用" }
];

const baseAuditEvents = [
  { id: "e1", time: "15:17:45", actor: "系统", type: "WorkItemIdentified", title: "识别 Meegle Story 24233867", detail: "只保存 WorkItemRef 和最小字段快照；尚未创建 ExternalBinding 或 Run。", level: "neutral" },
  { id: "e2", time: "15:17:46", actor: "提案生成器", type: "DispatchProposalGenerated", title: "生成派工提案 DP-0813-007", detail: "SOP 模板 + WorkItem 字段 + 一次轻量摘要；成本 ¥0.18；未启动 Attempt 或业务工具。", level: "neutral" }
];

const workComments = [
  { id: "c1", author: "Rowan", avatar: "R", time: "今天 15:17", text: "@AI 工作平台 请基于这个测试 Story 生成内部调研报告，并给出可核验的证据。", kind: "human" },
  { id: "c2", author: "AI 工作平台", avatar: "AI", time: "今天 15:18", text: "已生成派工提案 DP-0813-007。请在飞书确认员工、交付物、预算和数据范围；确认前不会创建 Run。", kind: "ai" }
];

const prototypeInboxItems = [
  { id: "proposal", title: "确认 AI 员工发起提案", subtitle: "来自 Story · 24233867", kind: "触点 1 · 发起确认", time: "刚刚" },
  { id: "delivery", title: "内部调研报告等待验收", subtitle: "DeliverableVersion · v1", kind: "触点 2 · 验收", time: "12 分钟前" },
  { id: "sync", title: "Meegle 投影待同步", subtitle: "Run 已完成 · WritebackTask pending", kind: "同步状态", time: "刚刚" }
];

Object.assign(window, {
  prototypeStages,
  prototypeEmployees,
  prototypePolicies,
  prototypeConnections,
  prototypeKnowledgeSources,
  prototypeCredentials,
  prototypeRuntimes,
  baseAuditEvents,
  workComments,
  prototypeInboxItems
});
