/* data.jsx — Persom 2.1 原型的示例数据
   来源标注：
   [文档] 取自需求文档《Persom 2.1 产品设计探索》原文
   [参考] 取自设计参考稿「Persom 2.1 UI」
   [补]   文档和参考稿都没有，按 Joe 的人设补的假数据 */
window.P21 = window.P21 || {};
(() => {
  const D = {
    /* ================= Home ================= */
    user: { name: 'Joe', email: 'joe@example.com', knownSince: 'Aug 17', days: 43 },          // [文档]
    summary: 'A product manager who does not code, and cuts friction with AI through precise, low-noise rules.', // [文档]
    memories: 217, memoriesToday: 7,                                                            // [文档]
    counts: [                                                                                   // [文档]
      { key: 'Topics', n: 6, label: 'Topics' },
      { key: 'Projects', n: 9, label: 'Projects' },
      { key: 'Friends', n: 23, label: 'Friends' },
      { key: 'Organizations', n: 7, label: 'Orgs' },
      { key: 'Tools', n: 31, label: 'Tools' },
    ],
    recentMemories: [                                                                           // [文档]，id 对应 Timeline 今天的卡片
      { id: 'd30a', t: '写一篇从杭州搬到武汉的随笔', ago: '9m ago' },
      { id: 'd30b', t: '研究 Obsidian 插件的安装方式', ago: '10m ago' },
      { id: 'd30c', t: '研究 Spark Memo 插件的功能与安装', ago: '2h ago' },
    ],
    agents: [                                                                                   // [文档] 名称与连接状态；[参考] 读取次数
      { id: 'CC', name: 'Claude Code', connected: true, reads: 21 },
      { id: 'CX', name: 'Codex', connected: true, reads: 11 },
      { id: 'MU', name: 'Muse', connected: false, reads: 4 },
      { id: 'IN', name: 'Instinct', connected: false, reads: 2 },
    ],
    agentReads: 38, agentReadsToday: 3,                                                         // [文档]
    recentReads: [                                                                              // [文档]
      { agent: 'Codex', what: 'your projects', ago: '8d ago' },
      { agent: 'Claude Code', what: 'how you work', ago: '10d ago' },
    ],

    /* ================= Ask ================= */
    askPromises: {                                                                              // [文档]
      q: '上周我答应了别人哪些事？',
      a: '上周有 2 件：\n1. 把 Home 线框图发给研发（Sep 22，未完成）\n2. 和团队同步定价草稿（Sep 15，未完成）',
      sources: [22, 15],
    },
    whens: ['Every Mon 09:00', 'Every day 08:00', 'Every day 21:00', 'Every Fri 18:00', 'Every Sun 20:00'], // [参考]

    /* ================= Connections 弹窗 ================= */
    conn: {                                                                                     // [补]
      learned: 217, since: 'Aug 17', days: 43,
      sourcesMix: [['Screen', 62], ['Mail', 18], ['Calendar', 12], ['Imports', 8]],
      introduced: 38, chars: '41,200', hours: '2.3',
      access: [['8d ago', 'Codex'], ['10d ago', 'Claude Code'], ['12d ago', 'Codex']],
    },

    /* ================= You ================= */
    portrait: 'A product manager who does not code, and cuts friction with AI through precise, low-noise rules. Writes in Obsidian, builds with Claude Code, and keeps a weekly rhythm across five areas of life.', // [参考]
    traits: [
      { id: 't1', claim: 'Diagnoses first, then fixes and verifies.', n: 34 },                  // [文档]
      { id: 't2', claim: 'Prefers precise, low-noise execution.', n: 24 },                      // [文档]
      { id: 't3', claim: 'Confirms the plan before an AI changes anything.', n: 17 },           // [文档]
      { id: 't4', claim: 'Splits big work into stages and checks each one.', n: 13 },           // [补]
      { id: 't5', claim: 'Writes in Chinese, keeps product names in English.', n: 11 },         // [补]
      { id: 't6', claim: 'Plans the week on Monday, reviews it on Friday.', n: 8 },             // [补]
      { id: 't7', claim: 'Keeps notes in Obsidian rather than in chat.', n: 6 },                // [补]
    ],
    types: ['Topics', 'Projects', 'Friends', 'Organizations', 'Tools'],                         // [文档]
    /* 实体：每类列几条示意，数量仍以 counts 为准 */
    entities: [
      { name: 'Knowledge management', type: 'Topics', desc: 'How notes turn into something you can reuse.', count: 31, last: '1d ago' }, // [参考] 名称；[补] 描述
      { name: 'AI collaboration', type: 'Topics', desc: 'Working with agents without losing control.', count: 44, last: '2h ago' },
      { name: 'Product design', type: 'Topics', desc: 'Specs, wireframes and the reasons behind them.', count: 38, last: '3h ago' },   // [补]
      { name: 'Writing', type: 'Topics', desc: 'Essays and notes in a plain, personal voice.', count: 17, last: '9m ago' },           // [补]
      { name: 'Moving to Wuhan', type: 'Topics', desc: 'Leaving Hangzhou, and what came with it.', count: 6, last: '9m ago' },       // [补]
      { name: 'Personal finance', type: 'Topics', desc: 'Budgets and a few long-term bets.', count: 5, last: '2w ago' },              // [补]
      { name: 'Persom', type: 'Projects', desc: 'A personal library for your AI.', count: 48, last: '2h ago', long: 'A personal library that learns how you work, so the AIs you use can read it.', related: [['Friends', '蔡小方 · 蕾雅'], ['Tools', 'Obsidian · Claude Code'], ['Topics', 'Knowledge management']], recent: [['Sep 8', 'Read the Memories display spec', 8], ['Sep 5', 'Rewrote the top of the pricing table', 5], ['Sep 2', 'Fixed the plugin review failure', 2]] }, // [参考]
      { name: 'Roam FM', type: 'Projects', desc: 'A radio app for stations around the world.', count: 21, last: '5d ago' },          // [参考] 名称；[补] 描述
      { name: 'MindCraft', type: 'Projects', desc: 'The Obsidian vault where notes and plans live.', count: 36, last: '1d ago' },
      { name: 'Personal site', type: 'Projects', desc: 'A blog about tinkering, at houjoe.me.', count: 9, last: '2w ago' },
      { name: 'SparkNode', type: 'Projects', desc: 'Capture ideas like sending a message.', count: 14, last: '4d ago' },            // [补]
      { name: '蔡小方', type: 'Friends', desc: 'Engineer on Persom, reviews the specs.', count: 22, last: '1d ago' },                 // [参考] 名称；[补] 描述
      { name: '蕾雅', type: 'Friends', desc: 'Designer, shares the Persom wireframes.', count: 15, last: '2d ago' },
      { name: '胡贵峰', type: 'Friends', desc: 'Old friend from Hangzhou.', count: 7, last: '1w ago' },
      { name: 'Lin', type: 'Friends', desc: 'Publishes skills on Marketplace.', count: 5, last: '3d ago' },                          // [文档] 名字；[补] 描述
      { name: 'Mia', type: 'Friends', desc: 'Writes the code review checklist.', count: 3, last: '1w ago' },
      { name: 'Valse', type: 'Organizations', desc: 'The team building Persom.', count: 52, last: '2h ago' },                        // [补]
      { name: 'Gamker', type: 'Organizations', desc: 'A games media team.', count: 8, last: '3w ago' },                             // [参考] 名称；[补] 描述
      { name: '诗巫科技', type: 'Organizations', desc: 'A client from consulting work.', count: 6, last: '1m ago' },
      { name: 'Obsidian', type: 'Tools', desc: 'Where the writing and planning happen.', count: 64, last: '9m ago' },                // [参考] 名称；[补] 描述
      { name: 'Claude Code', type: 'Tools', desc: 'Builds and edits code from a plan.', count: 57, last: '2h ago' },
      { name: 'Codex', type: 'Tools', desc: 'A second agent for code and reviews.', count: 23, last: '8d ago' },                     // [补]
      { name: 'Things 3', type: 'Tools', desc: 'To-dos, with the reason written down.', count: 19, last: '1d ago' },                 // [补]
    ],
    /* 判断的依据（Sources 弹窗） */
    traitSources: [['Sep 26', 'Wrote the Persom 2.1 spec', 26], ['Sep 22', 'Traced the crash before touching the code', 22], ['Sep 15', 'Asked Claude Code for a plan, then approved it', 15], ['Sep 8', 'Reworked the pricing table with Claude Code', 8], ['Sep 5', 'Fixed the plugin review failure', 5]], // [补]

    /* ================= Timeline ================= */
    today: 30,
    recordDays: [1, 2, 3, 4, 5, 8, 15, 18, 22, 26, 29, 30],                                    // [参考] 1-5、8；[补] 其余
    apps: { obs: ['Obsidian', '#2F5D45'], mail: ['Mail', '#B9D3B5'], chrome: ['Chrome', '#E3D5B3'], zoom: ['Zoom', '#7FA77E'] }, // [参考]
    segs: [[8.9, 10.5, 'obs'], [10.5, 11.2, 'mail'], [12.2, 13, 'chrome'], [13.4, 15, 'obs'], [15, 15.5, 'chrome'], [15.5, 16.1, 'mail'], [16.1, 17, 'zoom'], [17.3, 17.6, 'chrome'], [18.3, 19.2, 'zoom'], [20.1, 23, 'obs']], // [参考]
    segsToday: [[8.9, 10.5, 'obs'], [10.5, 11.2, 'mail'], [12.2, 13, 'chrome'], [13.4, 14.6, 'chrome'], [14.6, 15.4, 'obs'], [15.4, 16.1, 'chrome'], [16.1, 16.6, 'obs']], // [补]
    /* 通用的一天 [参考] */
    dayMems: [
      { id: 'm1', when: '09:20–10:05 · 45 min', at: 9.33, title: 'Reworked the pricing table with Claude Code', body: 'Cut three tiers down to two, rewrote the top.', ai: true, het: 3.4 },
      { id: 'm2', when: '14:10–14:35 · 25 min', at: 14.17, title: 'Fixed the plugin review failure', body: 'The signing cert had expired. Resubmitted.', ai: true, het: 2.8 },
      { id: 'm3', when: 'Decided · 16:30', at: 16.5, title: 'Rename "model" to "library" in the product', body: 'Users and investors found "model" hard to follow.' },
      { id: 'm4', when: '20:48–20:57 · 9 min', at: 20.8, title: 'Read the Memories display spec in Obsidian', body: 'Went through the product doc start to finish.' },
    ],
    daySummary: 'A focused morning, a broken-up afternoon, then a long stretch in Obsidian after eight.', // [文档]
    /* 今天：和 Home 的最近记忆对得上 [文档] 标题；[补] 时间与描述 */
    todayMems: [
      { id: 'd30a', when: '16:12–16:30 · 18 min', at: 16.2, title: '写一篇从杭州搬到武汉的随笔', body: 'Drafted the opening in Obsidian, kept it short.' },
      { id: 'd30b', when: '16:05–16:10 · 5 min', at: 16.08, title: '研究 Obsidian 插件的安装方式', body: 'Compared manual install with the community store.' },
      { id: 'd30c', when: '14:10–14:40 · 30 min', at: 14.2, title: '研究 Spark Memo 插件的功能与安装', body: 'Claude Code read the README and set it up.', ai: true, het: 1.6 },
      { id: 'd30d', when: '09:20–10:05 · 45 min', at: 9.33, title: 'Reworked the pricing table with Claude Code', body: 'Cut three tiers down to two, rewrote the top.', ai: true, het: 3.4 },
    ],
    todaySummary: 'A steady morning on pricing, then an afternoon of reading about plugins and a first draft about the move.', // [补]
    hetTip: 'Human-equivalent time your agents saved on this task today.',                      // [参考]
    hetTotalTip: 'Human-equivalent time your agents saved today.',                               // [补]

    /* ================= Check-ins ================= */
    checkins: [                                                                                 // [文档]
      { id: 'c1', name: 'Daily recap', when: 'Every day 21:00', next: 'Next: today 21:00', on: true, fixed: true },
      { id: 'c2', name: 'Open promises', when: 'Mon 09:00', next: 'Next: Oct 5 09:00', on: true },
      { id: 'c3', name: 'Weekly review', when: 'Fri 18:00', next: 'Next: Oct 2 18:00', on: false },
    ],

    /* ================= Playbook ================= */
    /* 已安装的 Skills（Mine › Installed）。src：persom ✦ / rec ◉ / import / market ↓ */
    skills: [
      { id: 'k1', name: 'Weekly plan', desc: 'Review last week, then carry over what is unfinished.', src: 'persom', agents: ['CC'], ago: '3d ago' },                    // [文档]
      { id: 'k2', name: 'Code review checklist', desc: 'Walk a diff before merging.', src: 'market', author: 'Mia', agents: ['CC'], ago: '1w ago', marketId: 'mk2' },     // [文档]
      { id: 'k3', name: 'Weekly report', desc: "Write the weekly report from this week's notes.", src: 'rec', agents: ['CC'], ago: '2w ago', pub: 'p1' },              // [文档]
      { id: 'k4', name: 'Writing a PRD', desc: 'Draft a PRD from a one-line idea, then tighten the scope.', src: 'persom', agents: ['CC'], ago: '5d ago', pub: 'p2' },  // [文档]
      { id: 'k5', name: 'Polish writing', desc: 'Tighten a draft, keep the voice.', src: 'import', agents: ['CC', 'CX'], ago: '1w ago', pub: 'p3' },                 // [文档]
      { id: 'k6', name: 'Meeting notes', desc: 'Turn meeting notes into decisions and to-dos.', src: 'market', author: 'Lin', agents: ['CC', 'CX'], ago: '2w ago' },   // [文档] 名称；[补] 描述
      { id: 'k7', name: 'Save as memo', desc: 'Turn a chat into a memo in today’s note.', src: 'import', agents: ['CC'], ago: '2w ago' },                            // [补]
      { id: 'k8', name: 'Reply to investor emails', desc: 'Short, specific replies with the latest numbers.', src: 'persom', agents: ['CX'], ago: '4d ago' },          // [补]
      { id: 'k9', name: 'Obsidian writing', desc: 'Write notes with the vault’s layout rules.', src: 'import', agents: ['CC'], ago: '3w ago' },                       // [补]
      { id: 'k10', name: 'Add to Things', desc: 'Add a to-do and keep the reason for it.', src: 'import', agents: ['CC'], ago: '3w ago' },                             // [补]
      { id: 'k11', name: 'Doc layout', desc: 'Headings and numbering for structured docs.', src: 'import', agents: ['CX'], ago: '3w ago' },                          // [补]
      { id: 'k12', name: 'Chinese punctuation', desc: 'Fix full-width punctuation in Chinese text.', src: 'import', agents: ['CC', 'CX'], ago: '1m ago' },            // [补]
      { id: 'k13', name: 'Draw diagram', desc: 'Flowcharts and wireframes inside a doc.', src: 'import', agents: ['CX'], ago: '1m ago' },                           // [补]
      { id: 'k14', name: 'Weekly review', desc: 'Look back on the week before Friday ends.', src: 'persom', agents: [], ago: '1m ago' },                              // [补] 保存了但没装到 Agent
    ],
    /* 我发布的 [文档] */
    published: [
      { id: 'p1', skill: 'k3', name: 'Weekly report', desc: "Write the weekly report from this week's notes.", status: 'live', installs: 128, since: 'Sep 20', changed: true },
      { id: 'p2', skill: 'k4', name: 'Writing a PRD', desc: 'Draft a PRD from a one-line idea, then tighten the scope.', status: 'review', submitted: 'Sep 29' },
      { id: 'p3', skill: 'k5', name: 'Polish writing', desc: 'Tighten a draft, keep the voice.', status: 'rejected', reason: 'the steps still mention a private project name.', reviewed: 'Sep 28' },
    ],
    /* SUGGESTIONS [文档] */
    sugg: [
      { id: 's1', icon: '◉', name: 'Weekly report', note: 'Recorded today', action: 'Review', kind: 'rec', dur: '03:24' },
      { id: 's2', icon: '✦', name: 'Writing a PRD', note: 'Seen 6 times this month', action: 'Review', kind: 'draft' },
      { id: 's3', icon: '✦', name: 'Weekly plan', note: 'You now also review OKRs', action: 'Update', kind: 'update' },
      { id: 's4', icon: '↓', name: 'Meeting notes', note: 'Updated by Lin', action: 'Update', kind: 'update' },
    ],
    categories: ['Writing', 'Research', 'Coding', 'Product'],                                   // [文档]
    market: [
      { id: 'mk1', name: 'Meeting notes to tasks', author: 'Lin', installs: '2.3k', cat: 'Product', desc: 'Turn notes into a todo list.' },          // [文档]
      { id: 'mk2', name: 'Code review checklist', author: 'Mia', installs: '860', cat: 'Coding', desc: 'Walk a diff before merging.' },               // [文档]
      { id: 'mk3', name: 'Interview synthesis', author: 'Ada', installs: '1.1k', cat: 'Research', desc: 'Turn user interviews into themes and quotes.' }, // [补]
      { id: 'mk4', name: 'Changelog writer', author: 'Kai', installs: '640', cat: 'Writing', desc: 'Write release notes from merged PRs.', scripts: ['scripts/collect_prs.sh', 'scripts/format.py'] }, // [补]
      { id: 'mk5', name: 'Competitor scan', author: 'Nora', installs: '1.4k', cat: 'Research', desc: 'Compare three competitors on one page.' },    // [补]
      { id: 'mk6', name: 'Tighten the prose', author: 'Sam', installs: '3.1k', cat: 'Writing', desc: 'Cut filler words and passive voice.' },        // [补]
      { id: 'mk7', name: 'PRD critique', author: 'Lin', installs: '520', cat: 'Product', desc: 'Find gaps and contradictions in a PRD.' },           // [补]
      { id: 'mk8', name: 'Test plan from spec', author: 'Mia', installs: '410', cat: 'Coding', desc: 'List the test cases a spec implies.' },       // [补]
    ],
    /* Import 面板 [文档] */
    importList: [
      { id: 'i1', agent: 'CC', name: 'Weekly plan', desc: 'Review last week, carry over', on: true, as: 'Weekly plan (2)' }, // 和 Persom 提炼的同名，按规则加后缀
      { id: 'i2', agent: 'CC', name: 'Polish writing', desc: '', inPb: true },
      { id: 'i3', agent: 'CC', name: 'Research to vault', desc: 'Light research into notes', on: true },
      { id: 'i4', agent: 'CX', name: 'Polish writing', desc: 'Tighten a draft, keep the voice', on: true, as: 'Polish writing (2)' },
      { id: 'i5', agent: 'CX', name: 'Submit commit', desc: 'Stage, write message, commit' },
    ],
    /* Review 草稿 [文档] */
    draft: {
      desc: 'Draft a PRD from a one-line idea, then tighten the scope.',
      body: '## Steps\n1. Restate the problem in one sentence\n2. List the user scenarios and edge cases\n3. Write the requirements, then the changelog\n## Rules\n- Ask who the target user is before writing',
      seen: [['Sep 26', 'Wrote the Persom 2.1 spec'], ['Sep 22', 'Drafted the pricing PRD']],
    },
    recDraft: { desc: "Write the weekly report from this week's notes.", body: '## Steps\n1. Open this week\'s notes in Obsidian\n2. Group what happened by project\n3. Write three lines per project: done, next, blocked\n4. Paste the report into the team channel\n## Rules\n- Keep it under 300 words' }, // [补]
    /* 更新对比 [文档]；s4 的正文差异为 [补] */
    updates: {
      s3: { reason: 'You now also review OKRs', seen: 'Seen 4 times since Sep 1', seenDetail: 'Sep 1 · Sep 8 · Sep 15 · Sep 22: Monday plans that also touched OKRs', lines: ['⋯ 6 unchanged lines', '## Steps', '1. Review last week', '+2. Check OKR progress', '3. Carry over what is unfinished', '-4. Email the plan to myself', '⋯ 9 unchanged lines'], files: ['references/plan-template.md'], installed: ['CC', 'CX'] },
      s4: { reason: 'Updated by Lin', seen: '', lines: ['⋯ 4 unchanged lines', '## Steps', '1. List every decision made in the meeting', '+2. Give each to-do an owner and a date', '-2. List the to-dos', '3. Send the summary to everyone who attended', '⋯ 5 unchanged lines'], files: [], installed: ['CC', 'CX'] },
    },
    /* Skill 正文示意（详情弹窗用）[补] */
    skillBody: '## Steps\n1. Read the input and restate the goal\n2. Follow the checklist in order\n3. Show the result before saving anything\n## Rules\n- Keep the output short and specific',
    /* 发布弹窗的隐私检查 [文档] */
    privacy: [
      { id: 'v1', text: '"Valse" looks like a project name.', token: 'Valse' },
      { id: 'v2', text: '"lin@valse.ai" looks like an email.', token: 'lin@valse.ai' },
    ],
    inviteLink: 'persom.app/invite/joe-7f3k',                                                  // [文档]
  };
  Object.assign(window.P21, { D });
})();
