@suifei/dsh-ai-team 0.4.146 → 0.4.147

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/client.js CHANGED
@@ -31,7 +31,7 @@ window.__ModuleLoader__.load({
31
31
  projects: '项目',
32
32
  main: '主对话',
33
33
  boardTab: '看板',
34
- tabSituation: '态势',
34
+ tabSituation: '总览',
35
35
  tabsAria: '项目视图',
36
36
  composer: '写一条消息… @ 点名成员,可粘贴或拖入图片与文件',
37
37
  attachAdd: '添加图片或文件',
@@ -223,6 +223,33 @@ window.__ModuleLoader__.load({
223
223
  newProject: '新建项目',
224
224
  addAgent: '添加成员',
225
225
  newProjectTitle: '新建项目',
226
+ blueprintMode: '按蓝图试跑', blueprintPreset: '按团队预设', blueprintTitle: '首发试跑',
227
+ blueprintBusiness: '你做什么业务?', blueprintGoal: '这个月想达成什么?',
228
+ blueprintHumanWork: '你擅长什么,哪些工作或判断留给你?', blueprintHours: '每周能投入几小时?',
229
+ blueprintWork: '你想先交出去的工作是什么?', blueprintKind: '选择工作类别',
230
+ blueprintManual: '手工做一次的分钟数', blueprintFrequency: '每周做几次',
231
+ blueprintAddOption: '补充有耗时记录的候选', blueprintRemoveOption: '移除候选', blueprintPreview: '预览蓝图', blueprintEdit: '修改答案',
232
+ blueprintConfirm: '确认蓝图并创建项目', blueprintDocument: '查看完整蓝图与岗位提示词',
233
+ blueprintSample: '真实样本文字', blueprintSampleHint: '请提供一个样本。凭证和私密信息请先移除。',
234
+ blueprintStart: '确认样本并派发', blueprintRunning: '团队正在处理首发卡。草稿、证据和验收都在卡片内。',
235
+ blueprintMeasured: '每周预计节省 {minutes} 分钟', blueprintHumanMinutes: '本次人工分钟数(含准备和审核)',
236
+ blueprintMeasure: '确认草稿可用并记录耗时', blueprintExpand: '确认加入独立验收',
237
+ blueprintExpandHint: '本次草稿可用且节省了人工时间。你现在可以把质量验收交给独立岗位。',
238
+ blueprintRerun: '确认用同一样本复跑', blueprintRerunHint: '用原样本测试新的验收交接,复盘时与双人试跑比较。',
239
+ blueprintImprove: '本次没有进一步节省人工时间。先调整流程,再用原样本验证。',
240
+ blueprintReviewGap: '这次由人工完成验收。请调整流程并复跑,验证负责验收的岗位能独立交付。',
241
+ blueprintAdjustment: '这次要验证哪项调整?', blueprintComplete: '独立验收试跑已完成,人工耗时低于双人试跑。',
242
+ blueprintPaused: '项目已停止。恢复项目后可继续派发。', blueprintDecision: '查看待确认决策',
243
+ blueprintPmoHint: '按样本、验收和实测证据自动推进试跑,可逆决策也可代答。对外审批由你确认。',
244
+ blueprintLeadContact: '请在项目主对话联系团队负责人。',
245
+ blueprintProcessTitle: '试跑流程', blueprintPhaseSample: '样本', blueprintPhaseWork: '执行', blueprintPhaseReview: '验收', blueprintPhaseMeasure: '复盘', blueprintPhaseExpand: '扩编复跑',
246
+ blueprintSaveSample: '保存样本与基线', blueprintSaveAdjustment: '登记流程调整', blueprintSaveTime: '登记实际耗时', blueprintViewRecord: '查看试跑记录',
247
+ blueprintSampleNeeded: '待提供真实样本和手工基线', blueprintPrepared: '样本和基线已登记,等待派发',
248
+ blueprintWorkBy: '已派给 {name} 处理样本', blueprintReviewBy: '待 {name} 按清单验收',
249
+ blueprintActorFailed: '{name} 的会话出错,当前阶段等待恢复', blueprintViewMember: '查看成员',
250
+ blueprintDraftConfirmed: 'PMO 已依据验收确认草稿可用', blueprintTimeNeeded: '待登记本轮实际人工耗时', blueprintTimeQueued: '实际耗时已登记,等待复盘',
251
+ blueprintTimeRecorded: '已登记本轮人工耗时 {minutes} 分钟', blueprintBaselineProof: '手工基线 {minutes} 分钟', blueprintReviewProof: '验收 {done}/{total} 项',
252
+ blueprintAutoAdvance: 'PMO 将按已记录的证据推进', blueprintHumanAdvance: '待你确认下一阶段',
226
253
  projectName: '项目名',
227
254
  projectGoal: '目标',
228
255
  workspace: '工作目录',
@@ -462,6 +489,12 @@ window.__ModuleLoader__.load({
462
489
  q4Empty: '还没有完成',
463
490
  viewAll: '查看全部',
464
491
  quadrantMeta: 'Host 投影 · 事件流已连接({time})',
492
+ overviewAccepted: '近 7 天验收', overviewFirstPass: '一次验收通过率', overviewCycle: '认领至验收中位耗时', overviewAttention: '待你处理',
493
+ overviewSample: '近 7 天 {n} 个有记录的验收', overviewMinutes: '{minutes} 分钟', overviewDelivery: '交付流程', overviewAsOf: '统计截至 {time}',
494
+ overviewCollaboration: 'AI 协作', overviewDelivered: '交付 {n}', overviewReviewed: '验收 {n}', overviewActive: '在手 {n}',
495
+ overviewDaily: '近 7 天验收交付', overviewDailyValue: '{date} 前 24 小时内验收 {n} 项', overviewSkills: '已配置技能 {skills}',
496
+ overviewEvidence: '近期验收证据', overviewEvidenceCount: '{n} 条证据', overviewEmptyEvidence: '任务通过验收后,提交的证据会在这里显示。',
497
+ overviewAttentionTitle: '需要处理的事项',
465
498
  q4Total: '最近 {n} 条 / 共 {m} 条',
466
499
  catReview: '待验收',
467
500
  catIrreversible: '不可撤回',
@@ -498,7 +531,7 @@ window.__ModuleLoader__.load({
498
531
  projects: 'Projects',
499
532
  main: 'Main',
500
533
  boardTab: 'Board',
501
- tabSituation: 'Situation',
534
+ tabSituation: 'Overview',
502
535
  tabsAria: 'Project views',
503
536
  composer: 'Write a message… @ a member; paste or drop images and files',
504
537
  attachAdd: 'Add images or files',
@@ -691,6 +724,33 @@ window.__ModuleLoader__.load({
691
724
  newProject: 'New project',
692
725
  addAgent: 'Add member',
693
726
  newProjectTitle: 'New project',
727
+ blueprintMode: 'Start with a blueprint', blueprintPreset: 'Use a team preset', blueprintTitle: 'Pilot workflow',
728
+ blueprintBusiness: 'What work do you do?', blueprintGoal: 'What do you want to achieve this month?',
729
+ blueprintHumanWork: 'What are you good at and want to keep doing yourself?', blueprintHours: 'How many hours can you spend per week?',
730
+ blueprintWork: 'What work would you hand off first?', blueprintKind: 'Choose a work category',
731
+ blueprintManual: 'Minutes per manual run', blueprintFrequency: 'Runs per week',
732
+ blueprintAddOption: 'Add a candidate with measured effort', blueprintRemoveOption: 'Remove candidate', blueprintPreview: 'Preview blueprint', blueprintEdit: 'Edit answers',
733
+ blueprintConfirm: 'Confirm blueprint and create project', blueprintDocument: 'View blueprint and role prompts',
734
+ blueprintSample: 'Text from a real sample', blueprintSampleHint: 'Provide one sample. Remove credentials and private information first.',
735
+ blueprintStart: 'Confirm sample and dispatch', blueprintRunning: 'The pilot task is in progress. Find its draft, evidence and review on the task card.',
736
+ blueprintMeasured: 'Estimated weekly savings of {minutes} minutes', blueprintHumanMinutes: 'Human minutes for this run, including preparation and review',
737
+ blueprintMeasure: 'Confirm the draft and record time', blueprintExpand: 'Confirm adding independent QA',
738
+ blueprintExpandHint: 'The draft met your needs and saved time. You can now hand review to a dedicated member.',
739
+ blueprintRerun: 'Confirm rerun on the same sample', blueprintRerunHint: 'Test the new review handoff with the same sample, then compare it to the two-agent run.',
740
+ blueprintImprove: 'The pilot saved no additional human time. Tune the workflow and rerun the same sample.',
741
+ blueprintReviewGap: 'A person reviewed this run. Adjust the workflow and rerun the sample so the assigned reviewer can complete it.',
742
+ blueprintAdjustment: 'What change will this run test?', blueprintComplete: 'Independent QA is working and took less human time than the two-agent pilot.',
743
+ blueprintPaused: 'The project is stopped. Resume it to dispatch work.', blueprintDecision: 'View pending decisions',
744
+ blueprintPmoHint: 'Automatically advance the pilot based on samples, QA and measured evidence. You confirm external actions.',
745
+ blueprintLeadContact: 'Contact the team lead in the project conversation.',
746
+ blueprintProcessTitle: 'Pilot progress', blueprintPhaseSample: 'Sample', blueprintPhaseWork: 'Work', blueprintPhaseReview: 'Review', blueprintPhaseMeasure: 'Measure', blueprintPhaseExpand: 'QA rerun',
747
+ blueprintSaveSample: 'Save sample and baseline', blueprintSaveAdjustment: 'Record change', blueprintSaveTime: 'Record actual time', blueprintViewRecord: 'View pilot record',
748
+ blueprintSampleNeeded: 'A real sample and manual baseline are needed', blueprintPrepared: 'Sample and baseline recorded. Ready to dispatch.',
749
+ blueprintWorkBy: 'Assigned to {name}', blueprintReviewBy: 'Waiting for {name} to review the checklist',
750
+ blueprintActorFailed: '{name} has a session error. This stage is waiting for recovery.', blueprintViewMember: 'View member',
751
+ blueprintDraftConfirmed: 'PMO confirmed the draft based on the review', blueprintTimeNeeded: 'Waiting for actual human time', blueprintTimeQueued: 'Actual time recorded. Waiting to assess savings.',
752
+ blueprintTimeRecorded: 'Recorded {minutes} human minutes', blueprintBaselineProof: 'Manual baseline {minutes} min', blueprintReviewProof: '{done}/{total} checks passed',
753
+ blueprintAutoAdvance: 'PMO will advance when the recorded evidence supports it', blueprintHumanAdvance: 'Waiting for you to confirm the next stage',
694
754
  projectName: 'Project name',
695
755
  projectGoal: 'Goal',
696
756
  workspace: 'Workspace',
@@ -930,6 +990,12 @@ window.__ModuleLoader__.load({
930
990
  q4Empty: 'Nothing completed yet',
931
991
  viewAll: 'View all',
932
992
  quadrantMeta: 'Host projection · event stream connected ({time})',
993
+ overviewAccepted: 'Accepted in 7 days', overviewFirstPass: 'First-pass acceptance', overviewCycle: 'Median claim-to-accept time', overviewAttention: 'Needs your attention',
994
+ overviewSample: '{n} recorded acceptances in 7 days', overviewMinutes: '{minutes} min', overviewDelivery: 'Delivery flow', overviewAsOf: 'Stats as of {time}',
995
+ overviewCollaboration: 'AI collaboration', overviewDelivered: '{n} delivered', overviewReviewed: '{n} reviewed', overviewActive: '{n} assigned',
996
+ overviewDaily: 'Accepted deliveries in the last 7 days', overviewDailyValue: '{n} accepted in the 24 hours before {date}', overviewSkills: 'Configured skills {skills}',
997
+ overviewEvidence: 'Recent acceptance evidence', overviewEvidenceCount: '{n} evidence entries', overviewEmptyEvidence: 'Submitted evidence appears here when a task is accepted.',
998
+ overviewAttentionTitle: 'Items to act on',
933
999
  q4Total: 'Recent {n} / {m} total',
934
1000
  catReview: 'To accept',
935
1001
  catIrreversible: 'Irreversible',
@@ -1069,6 +1135,7 @@ window.__ModuleLoader__.load({
1069
1135
 
1070
1136
  /** Only the four board columns; `blocked` stays a badge, never a column. */
1071
1137
  function matchesFilter(task, filter, humanId) {
1138
+ if (Object.hasOwn(STATUS, filter)) return task.status === filter;
1072
1139
  if (filter === 'q1') {
1073
1140
  return task.status === 'pending_acceptance'
1074
1141
  || (task.ownerId === humanId && task.status === 'pending' && task.blocked === true);
@@ -1088,15 +1155,16 @@ window.__ModuleLoader__.load({
1088
1155
  .at-toasttext { min-width: 0; overflow-wrap: anywhere; }
1089
1156
  .at-toastclose { border: 0; background: transparent; color: var(--dsw-alias-label-tertiary); font: inherit; font-size: 14px; line-height: 16px; cursor: pointer; padding: 0 2px; }
1090
1157
  .at-root :focus-visible { outline: 2px solid var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary)); outline-offset: 2px; }
1091
- .at-top { height: 40px; flex: 0 0 auto; display: flex; align-items: center; gap: 8px; min-width: 0; padding: 0 12px; border-bottom: 1px solid var(--dsw-alias-border-l1); background: var(--dsw-alias-bg-layer-1); }
1158
+ .at-top { position: relative; contain: layout; z-index: 20; height: 40px; flex: 0 0 auto; display: flex; align-items: center; gap: 8px; min-width: 0; padding: 0 12px; border-bottom: 1px solid var(--dsw-alias-border-l1); background: var(--dsw-alias-bg-layer-1); }
1092
1159
  .at-brand { color: var(--dsw-alias-label-primary); font-size: 12px; font-weight: 500; white-space: nowrap; }
1093
1160
  .at-spike { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border: 1px solid var(--dsw-alias-border-l3); border-radius: var(--dsw-radius-xs); color: var(--dsw-alias-label-tertiary); font-size: 10px; line-height: 16px; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
1094
1161
  .at-pending { margin-left: auto; height: 24px; padding: 0 8px; border: 1px solid var(--dsw-alias-state-warning-primary); border-radius: var(--dsw-radius-sm); background: var(--dsw-alias-bg-base); color: var(--dsw-alias-state-warning-primary); font: inherit; font-size: 11px; line-height: 16px; cursor: pointer; white-space: nowrap; }
1095
1162
  .at-topproject { margin-left: auto; min-width: 0; color: var(--dsw-alias-label-tertiary); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
1096
- .at-mobile { display: none; position: relative; min-width: 0; }
1163
+ .at-mobile { display: none; min-width: 0; }
1097
1164
  .at-mobilesummary { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 8px; border: 1px solid var(--dsw-alias-border-l2); border-radius: var(--dsw-radius-sm); color: var(--dsw-alias-label-secondary); font-size: 11px; cursor: pointer; list-style: none; }
1098
1165
  .at-mobilesummary::-webkit-details-marker { display: none; }
1099
- .at-mobilepop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; width: min(320px, calc(100vw - 32px)); width: min(320px, calc(100cqw - 16px)); max-height: 70vh; overflow-y: auto; overflow-x: hidden; padding: 8px; border: 1px solid var(--dsw-alias-border-l2); border-radius: var(--dsw-radius-md); background: var(--dsw-alias-bg-layer-1); box-shadow: var(--dsw-elevation-panel, 0 8px 24px var(--dsw-alias-bg-mask-2)); }
1166
+ .at-mobilepop { position: fixed; top: calc(100% + 6px); inset-inline-start: 8px; width: min(320px, calc(100% - 16px)); max-height: 70vh; overflow-y: auto; overflow-x: hidden; padding: 8px; border: 1px solid var(--dsw-alias-border-l2); border-radius: var(--dsw-radius-md); background: var(--dsw-alias-bg-layer-1); box-shadow: var(--dsw-elevation-panel, 0 8px 24px var(--dsw-alias-bg-mask-2)); }
1167
+ .at-mobile:not([open]) > .at-mobilepop { display: none; }
1100
1168
  .at-grid { flex: 1; min-height: 0; min-width: 0; position: relative; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
1101
1169
  .at-left { min-width: 0; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 8px 8px 12px; border-right: 1px solid var(--dsw-alias-border-l1); background: var(--dsw-alias-bg-base); scrollbar-width: thin; scrollbar-color: var(--dsw-alias-scrollbar-bg-l1) transparent; }
1102
1170
  .at-center { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--dsw-alias-bg-base); container-type: inline-size; container-name: at-center; }
@@ -1332,8 +1400,27 @@ window.__ModuleLoader__.load({
1332
1400
  .at-coltoggle { margin-left: auto; min-height: 24px; padding: 0 4px; border: 0; background: transparent; color: var(--dsw-alias-label-tertiary); font: inherit; font-size: 11px; cursor: pointer; white-space: nowrap; }
1333
1401
  .at-coltoggle:hover { color: var(--dsw-alias-label-primary); }
1334
1402
  .at-colempty { padding: 4px; color: var(--dsw-alias-label-caption); font-size: 11px; line-height: 16px; }
1335
- .at-situation { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 12px 18px 16px; scrollbar-width: thin; scrollbar-color: var(--dsw-alias-scrollbar-bg-l1) transparent; }
1403
+ .at-situation { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overflow-anchor: none; padding: 12px 18px 16px; scrollbar-width: thin; scrollbar-color: var(--dsw-alias-scrollbar-bg-l1) transparent; }
1336
1404
  .at-situationinner { min-width: 0; }
1405
+ .at-overview-section { min-width: 0; margin: 0 0 18px; }
1406
+ .at-overview-heading { margin: 0 0 6px; color: var(--dsw-alias-label-primary); font-size: 13px; line-height: 20px; font-weight: 600; }
1407
+ .at-overview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 148px), 1fr)); gap: 8px; min-width: 0; }
1408
+ .at-overview-collaboration, .at-overview-evidence { grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
1409
+ .at-overview-tile { display: grid; align-content: start; gap: 4px; min-width: 0; padding: 9px 10px; border: 1px solid var(--dsw-alias-border-l1); border-radius: var(--dsw-radius-md); background: var(--dsw-alias-bg-layer-1); color: var(--dsw-alias-label-primary); font: inherit; text-align: start; }
1410
+ button.at-overview-tile { cursor: pointer; }
1411
+ button.at-overview-tile:hover { border-color: var(--dsw-alias-state-business-primary); }
1412
+ .at-overview-label, .at-overview-caption { color: var(--dsw-alias-label-secondary); font-size: 11px; line-height: 16px; overflow-wrap: anywhere; }
1413
+ .at-overview-value { font-size: 20px; line-height: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
1414
+ .at-overview-flow { border-top: 2px solid var(--dsw-alias-border-l2); }
1415
+ .at-overview-flow[data-status="in_progress"] { border-top-color: var(--dsw-alias-state-business-primary); }
1416
+ .at-overview-flow[data-status="pending_acceptance"] { border-top-color: var(--dsw-alias-state-warning-primary); }
1417
+ .at-overview-flow[data-status="done"] { border-top-color: var(--dsw-alias-state-success-primary); }
1418
+ .at-overview-cardtitle { color: var(--dsw-alias-label-primary); font-size: 12px; line-height: 18px; font-weight: 600; overflow-wrap: anywhere; }
1419
+ .at-overview-memberstats { display: flex; flex-wrap: wrap; gap: 2px 10px; }
1420
+ .at-overview-spark { height: 28px; margin: 4px 0 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); align-items: end; column-gap: 4px; list-style: none; padding: 0; }
1421
+ .at-overview-spark li { min-width: 0; min-height: 2px; border-radius: 2px 2px 0 0; background: var(--dsw-alias-border-l2); }
1422
+ .at-overview-spark li[data-count]:not([data-count="0"]) { background: var(--dsw-alias-state-business-primary); }
1423
+ .at-overview-caption.at-overview-excerpt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
1337
1424
  .at-qmeta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; color: var(--dsw-alias-label-caption); font-size: 10px; line-height: 16px; }
1338
1425
  .at-qmeta > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
1339
1426
  .at-quadrants { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: stretch; min-width: 0; }
@@ -1442,6 +1529,23 @@ window.__ModuleLoader__.load({
1442
1529
  /* 内容型弹窗(添加成员 / 人才市场、成员资料、新建项目、组队):插件页面的 90% 宽高;确认框等小弹窗保持紧凑。 */
1443
1530
  .at-modalback:has(> .at-modal-wide) { padding: 0; }
1444
1531
  .at-modal.at-modal-wide { width: 90%; height: 90%; max-height: 90%; }
1532
+ .at-modal.at-blueprint-dialog { width: min(720px, 90cqi); max-width: 90%; height: auto; }
1533
+ .at-modal.at-blueprint-setup { width: min(820px, 90cqi); height: auto; }
1534
+ .at-blueprint-fields { display: grid; gap: 10px; min-width: 0; }
1535
+ .at-blueprint-fields fieldset { min-inline-size: 0; margin: 0; padding: 10px; border: 1px solid var(--dsw-alias-border-l1); border-radius: var(--dsw-radius-sm); }
1536
+ .at-blueprint-fields p { margin: 0; overflow-wrap: anywhere; }
1537
+ .at-blueprint-doc { margin: 0; padding: 10px; min-width: 0; border: 1px solid var(--dsw-alias-border-l1); border-radius: var(--dsw-radius-sm); background: var(--dsw-alias-bg-base); color: var(--dsw-alias-label-primary); font: inherit; white-space: pre-wrap; overflow-wrap: anywhere; }
1538
+ .at-blueprint-process { flex: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; margin: 10px clamp(10px, 2.5cqi, 18px) 0; padding: 8px 10px; min-width: 0; border: 1px solid var(--dsw-alias-border-l1); border-radius: var(--dsw-radius-md); background: var(--dsw-alias-bg-layer-1); }
1539
+ .at-blueprint-process > * { min-width: 0; }
1540
+ .at-blueprint-process-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
1541
+ .at-blueprint-process-title { font-weight: 600; color: var(--dsw-alias-label-primary); }
1542
+ .at-blueprint-process-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; list-style: none; margin: 0; padding: 0; }
1543
+ .at-blueprint-process-steps li { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; border-top: 2px solid var(--dsw-alias-border-l2); padding-top: 3px; color: var(--dsw-alias-label-tertiary); font-size: 11px; line-height: 17px; }
1544
+ .at-blueprint-process-steps li[data-state="done"] { color: var(--dsw-alias-label-secondary); border-color: var(--dsw-alias-state-success-primary); }
1545
+ .at-blueprint-process-steps li[aria-current="step"] { color: var(--dsw-alias-label-primary); border-color: var(--dsw-alias-state-business-primary); font-weight: 600; }
1546
+ .at-blueprint-process-next, .at-blueprint-process-evidence { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
1547
+ .at-blueprint-process-next { font-size: 12px; line-height: 19px; }
1548
+ .at-blueprint-process-evidence { min-height: 16px; color: var(--dsw-alias-label-secondary); font-size: 11px; line-height: 16px; }
1445
1549
  /* 所有弹窗:标题栏固定在顶部,功能按钮在右上角;内容再长也不用滚到底找按钮。 */
1446
1550
  .at-modal { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-auto-rows: max-content; align-content: start; column-gap: 0; row-gap: 12px; padding-top: 0; }
1447
1551
  .at-modal > * { grid-column: 1 / -1; min-width: 0; }
@@ -1593,6 +1697,9 @@ window.__ModuleLoader__.load({
1593
1697
  .at-situation { padding: 12px 12px 16px; }
1594
1698
  }
1595
1699
  @container at-wb (max-width: 719px) {
1700
+ .at-modal.at-blueprint-setup > .at-split { grid-template-columns: minmax(0, 1fr); }
1701
+ .at-blueprint-setup > .at-modaltitle, .at-blueprint-dialog > .at-modaltitle { grid-column: 1 / -1; position: static; }
1702
+ .at-blueprint-setup > .at-modalactions, .at-blueprint-dialog > .at-modalactions { grid-column: 1 / -1; grid-row: 2; padding-inline: 0; }
1596
1703
  .at-grid { grid-template-columns: minmax(0, 1fr); }
1597
1704
  .at-left { display: none; }
1598
1705
  .at-mobile { display: block; }
@@ -1943,6 +2050,182 @@ window.__ModuleLoader__.load({
1943
2050
  return h('div', { className: 'at-modalback', ref: backRef }, children);
1944
2051
  }
1945
2052
 
2053
+ const emptyBlueprintOpportunity = () => ({ kind: '', work: '', minutes: '', perWeek: '' });
2054
+ const emptyBlueprintIntake = () => ({ business: '', humanWork: '', weeklyHours: '', opportunities: [emptyBlueprintOpportunity()] });
2055
+
2056
+ function BlueprintIntake({ t, intake, onChange, useCases }) {
2057
+ const field = (label, value, update, options = {}) => h('label', { className: 'at-field' },
2058
+ h('span', null, t(label)), h('input', { ...options, value, required: true, onChange: (event) => update(event.target.value) }));
2059
+ const set = (key, value) => onChange({ ...intake, [key]: value });
2060
+ const updateOpportunity = (index, key, value) => set('opportunities', intake.opportunities.map((item, i) => i === index ? { ...item, [key]: value } : item));
2061
+ return h('div', { className: 'at-blueprint-fields' },
2062
+ field('blueprintBusiness', intake.business, (value) => set('business', value), { maxLength: 240 }),
2063
+ field('blueprintHumanWork', intake.humanWork, (value) => set('humanWork', value), { maxLength: 240 }),
2064
+ field('blueprintHours', intake.weeklyHours, (value) => set('weeklyHours', value), { type: 'number', min: 0.1, max: 168, step: 'any' }),
2065
+ intake.opportunities.map((item, index) => h('fieldset', { key: index, className: 'at-pane' },
2066
+ h('legend', null, t(index === 0 ? 'blueprintWork' : 'blueprintAddOption')),
2067
+ h('label', { className: 'at-field' }, h('span', null, t('blueprintKind')),
2068
+ h('select', { required: true, value: item.kind, onChange: (event) => updateOpportunity(index, 'kind', event.target.value) },
2069
+ h('option', { value: '' }, t('blueprintKind')),
2070
+ useCases.map((entry) => h('option', {
2071
+ key: entry.id, value: entry.id,
2072
+ disabled: intake.opportunities.some((other, i) => i !== index && other.kind === entry.id),
2073
+ }, entry.name)))),
2074
+ field('blueprintWork', item.work, (value) => updateOpportunity(index, 'work', value), { maxLength: 160 }),
2075
+ h('div', { className: 'at-fieldrow' },
2076
+ field('blueprintManual', item.minutes, (value) => updateOpportunity(index, 'minutes', value), { type: 'number', min: 0.1, step: 'any' }),
2077
+ field('blueprintFrequency', item.perWeek, (value) => updateOpportunity(index, 'perWeek', value), { type: 'number', min: 0.01, step: 'any' })),
2078
+ index > 0 ? h('button', { className: 'at-btn at-btn-small', type: 'button', onClick: () => set('opportunities', intake.opportunities.filter((_, i) => i !== index)) }, t('blueprintRemoveOption')) : null)),
2079
+ intake.opportunities.length < useCases.length ? h('button', {
2080
+ className: 'at-btn', type: 'button', onClick: () => set('opportunities', [...intake.opportunities, emptyBlueprintOpportunity()]),
2081
+ }, t('blueprintAddOption')) : null);
2082
+ }
2083
+
2084
+ function BlueprintRunDialog({ t, progress, pmoAuto, stopped, decisionPending, onClose, onCommand, onTask, onInbox }) {
2085
+ const [sample, setSample] = React.useState('');
2086
+ const [minutes, setMinutes] = React.useState('');
2087
+ const [humanMinutes, setHumanMinutes] = React.useState('');
2088
+ const [adjustment, setAdjustment] = React.useState('');
2089
+ const [busy, setBusy] = React.useState(false);
2090
+ const [error, setError] = React.useState('');
2091
+ const submitting = React.useRef(false);
2092
+ const { stage, taskId, measurement, repeatsSample, samplePrepared, roleReviewed, confirmation } = progress;
2093
+ const start = ['sample', 'improve', 'rerun'].includes(stage);
2094
+ const collectSample = start && !samplePrepared && (!pmoAuto || stage !== 'rerun');
2095
+ const autoReview = pmoAuto && roleReviewed;
2096
+ const collectTime = stage === 'measure' && progress.humanMinutes === null;
2097
+ let action = null;
2098
+ if (start && !pmoAuto) action = { command: 'start', label: repeatsSample ? 'blueprintRerun' : 'blueprintStart' };
2099
+ if (collectSample && pmoAuto) action = { command: 'prepare', label: stage === 'improve' ? 'blueprintSaveAdjustment' : repeatsSample ? 'blueprintRerun' : 'blueprintSaveSample', evidenceOnly: true };
2100
+ if (stage === 'measure' && !autoReview) action = { command: 'measure', label: 'blueprintMeasure' };
2101
+ if (collectTime && autoReview) action = { command: 'recordTime', label: 'blueprintSaveTime', evidenceOnly: true };
2102
+ if (stage === 'expand' && !pmoAuto) action = { command: 'expand', label: 'blueprintExpand' };
2103
+ const disabled = busy || (!action?.evidenceOnly && (decisionPending || (start && stopped)));
2104
+ async function submit(event) {
2105
+ event.preventDefault();
2106
+ if (!action || submitting.current || disabled) return;
2107
+ submitting.current = true;
2108
+ setBusy(true);
2109
+ setError('');
2110
+ try {
2111
+ const input = { taskId };
2112
+ if (start) {
2113
+ if (collectSample) Object.assign(input, repeatsSample ? { adjustment: adjustment.trim() } : { sample: sample.trim(), manualMinutes: Number(minutes) });
2114
+ } else if (stage === 'measure') {
2115
+ if (collectTime) input.humanMinutes = Number(humanMinutes);
2116
+ if (!autoReview) input.confirmed = true;
2117
+ } else {
2118
+ input.confirmed = true;
2119
+ }
2120
+ await onCommand('project.blueprint.' + action.command, input);
2121
+ setSample('');
2122
+ setMinutes('');
2123
+ setAdjustment('');
2124
+ setHumanMinutes('');
2125
+ } catch (err) {
2126
+ setError(err?.message ?? String(err));
2127
+ } finally {
2128
+ submitting.current = false;
2129
+ setBusy(false);
2130
+ }
2131
+ }
2132
+ return h(ModalBack, { onClose: () => { if (!submitting.current) onClose(); } },
2133
+ h('form', { className: 'at-modal at-blueprint-dialog', role: 'dialog', 'aria-modal': 'true', 'aria-label': t('blueprintTitle'), onSubmit: submit },
2134
+ h('h2', { className: 'at-modaltitle' }, t('blueprintTitle')),
2135
+ h('div', { className: 'at-modalactions' },
2136
+ h('button', { className: 'at-btn', type: 'button', disabled: busy, onClick: onClose }, t('close')),
2137
+ action ? h('button', { className: 'at-btn at-btn-primary', type: 'submit', disabled }, t(busy ? 'saving' : action.label)) : null),
2138
+ error ? h('div', { className: 'at-modalerror', role: 'alert' }, error) : null,
2139
+ h('div', { className: 'at-blueprint-fields' },
2140
+ decisionPending ? h('button', { className: 'at-btn', type: 'button', onClick: onInbox }, t('blueprintDecision')) : null,
2141
+ stopped && start ? h('p', { role: 'status' }, t('blueprintPaused')) : null,
2142
+ collectSample && !repeatsSample ? h('div', { className: 'at-blueprint-fields' },
2143
+ h('h3', { className: 'at-panetitle' }, 'START HERE FIRST'), h('p', null, progress.startHere),
2144
+ h('label', { className: 'at-field' }, t('blueprintManual'), h('input', { type: 'number', min: 0.1, max: 10080, step: 'any', required: true, value: minutes, onChange: (event) => setMinutes(event.target.value) })),
2145
+ h('label', { className: 'at-field' }, t('blueprintSample'), h('textarea', { required: true, maxLength: 8000, rows: 5, value: sample, placeholder: t('blueprintSampleHint'), onChange: (event) => setSample(event.target.value) }))) : null,
2146
+ start && samplePrepared ? h('p', { role: 'status' }, t('blueprintPrepared')) : null,
2147
+ stage === 'working' ? h('p', { role: 'status' }, t('blueprintRunning')) : null,
2148
+ confirmation ? h('p', { role: 'status' }, t('blueprintDraftConfirmed')) : null,
2149
+ collectTime ? h('label', { className: 'at-field' }, t('blueprintHumanMinutes'),
2150
+ h('input', { type: 'number', min: 0, max: 10080, step: 'any', required: true, value: humanMinutes, onChange: (event) => setHumanMinutes(event.target.value) })) : null,
2151
+ stage === 'measure' && !collectTime ? h('p', null, tf(t, 'blueprintTimeRecorded', { minutes: progress.humanMinutes })) : null,
2152
+ measurement ? h('strong', null, tf(t, 'blueprintMeasured', { minutes: measurement.savedPerWeek })) : null,
2153
+ stage === 'expand' ? h('p', null, t(pmoAuto ? 'blueprintAutoAdvance' : 'blueprintExpandHint')) : null,
2154
+ start && repeatsSample ? h('div', { className: 'at-blueprint-fields' },
2155
+ h('p', null, t(stage === 'improve' ? (progress.needsRoleReview ? 'blueprintReviewGap' : 'blueprintImprove') : 'blueprintRerunHint')),
2156
+ collectSample ? h('label', { className: 'at-field' }, t('blueprintAdjustment'), h('textarea', {
2157
+ rows: 2, maxLength: 500, required: stage === 'improve', value: adjustment, onChange: (event) => setAdjustment(event.target.value),
2158
+ })) : null) : null,
2159
+ stage === 'complete' ? h('p', null, t('blueprintComplete')) : null,
2160
+ taskId ? h('button', { className: 'at-btn', type: 'button', onClick: () => onTask(taskId) }, t('taskDetail')) : null,
2161
+ h('details', null, h('summary', null, t('blueprintDocument')), h('pre', { className: 'at-blueprint-doc' }, progress.markdown)))));
2162
+ }
2163
+
2164
+ const BLUEPRINT_PHASES = ['blueprintPhaseSample', 'blueprintPhaseWork', 'blueprintPhaseReview', 'blueprintPhaseMeasure', 'blueprintPhaseExpand'];
2165
+
2166
+ function BlueprintProcess({ t, progress, task, agents, stopped, pmoAuto, decision, onManage, onTask, onInbox, onAgent }) {
2167
+ const { stage, samplePrepared, roleReviewed, confirmation, humanMinutes, manualMinutes } = progress;
2168
+ const reviewing = task?.status === 'pending_acceptance';
2169
+ const responsible = reviewing && task.qaRequired
2170
+ ? agents.find((agent) => agent.qa)
2171
+ : agents.find((agent) => agent.id === (reviewing ? task?.ownerId : task?.assigneeId));
2172
+ let phase = 0;
2173
+ let next = t(samplePrepared ? 'blueprintPrepared' : progress.repeatsSample ? 'blueprintRerunHint' : 'blueprintSampleNeeded');
2174
+ let action = samplePrepared ? 'blueprintTitle' : progress.repeatsSample ? 'blueprintRerun' : 'blueprintSaveSample';
2175
+ let onAction = onManage;
2176
+ if (stage === 'working') {
2177
+ phase = reviewing ? 2 : 1;
2178
+ next = reviewing ? tf(t, 'blueprintReviewBy', { name: responsible?.name ?? task?.owner ?? t('owner') }) : tf(t, 'blueprintWorkBy', { name: task?.assignee ?? t('executor') });
2179
+ action = 'taskDetail';
2180
+ onAction = onTask;
2181
+ if (responsible?.status === 'failed') {
2182
+ next = tf(t, 'blueprintActorFailed', { name: responsible.name });
2183
+ action = 'blueprintViewMember';
2184
+ onAction = () => onAgent(responsible);
2185
+ }
2186
+ } else if (stage === 'measure') {
2187
+ phase = 3;
2188
+ next = t(humanMinutes === null ? 'blueprintTimeNeeded' : 'blueprintTimeQueued');
2189
+ action = pmoAuto && roleReviewed ? (humanMinutes === null ? 'blueprintSaveTime' : 'blueprintViewRecord') : 'blueprintMeasure';
2190
+ } else if (stage === 'improve') {
2191
+ phase = 3;
2192
+ next = t(progress.needsRoleReview ? 'blueprintReviewGap' : 'blueprintImprove');
2193
+ action = 'blueprintSaveAdjustment';
2194
+ } else if (stage === 'expand' || stage === 'rerun') {
2195
+ phase = 4;
2196
+ next = t(pmoAuto ? 'blueprintAutoAdvance' : 'blueprintHumanAdvance');
2197
+ action = pmoAuto ? 'blueprintViewRecord' : stage === 'expand' ? 'blueprintExpand' : 'blueprintRerun';
2198
+ } else if (stage === 'complete') {
2199
+ phase = BLUEPRINT_PHASES.length;
2200
+ next = t('blueprintComplete');
2201
+ action = 'blueprintViewRecord';
2202
+ }
2203
+ if (task?.qaRequired && stage !== 'complete') phase = 4;
2204
+ if (stopped && stage !== 'complete') next = t('blueprintPaused');
2205
+ if (decision) {
2206
+ next = decision.ref?.title || t('blueprintDecision');
2207
+ action = 'blueprintDecision';
2208
+ onAction = onInbox;
2209
+ }
2210
+ const measured = progress.measurement ?? progress.v1Measurement;
2211
+ const evidence = [
2212
+ manualMinutes === null ? '' : tf(t, 'blueprintBaselineProof', { minutes: manualMinutes }),
2213
+ confirmation ? t('blueprintDraftConfirmed') : '',
2214
+ task?.qaChecklist?.length ? tf(t, 'blueprintReviewProof', { done: task.qaChecks?.length ?? 0, total: task.qaChecklist.length }) : '',
2215
+ measured ? tf(t, 'blueprintMeasured', { minutes: measured.savedPerWeek }) : '',
2216
+ ].filter(Boolean).join(' · ');
2217
+ return h('section', { className: 'at-blueprint-process', 'aria-label': t('blueprintProcessTitle') },
2218
+ h('div', { className: 'at-blueprint-process-head' },
2219
+ h('strong', { className: 'at-blueprint-process-title' }, t('blueprintProcessTitle')),
2220
+ h('button', { className: 'at-btn at-btn-small', type: 'button', onClick: onAction, 'data-blueprint-action': action }, t(action))),
2221
+ h('ol', { className: 'at-blueprint-process-steps' }, BLUEPRINT_PHASES.map((key, index) => h('li', {
2222
+ key, 'data-state': index < phase ? 'done' : 'planned', 'aria-current': index === phase ? 'step' : undefined,
2223
+ }, t(key)))),
2224
+ h('div', { 'aria-live': 'polite' },
2225
+ h('span', { className: 'at-blueprint-process-next', title: next }, next),
2226
+ h('small', { className: 'at-blueprint-process-evidence', title: evidence }, evidence)));
2227
+ }
2228
+
1946
2229
  /**
1947
2230
  * 自绘确认/输入对话框(替代原生 confirm/prompt):confirm 布尔、
1948
2231
  * prompt 文本、choice 选项。模块级组件 + 调用方自增 key 保证每次
@@ -2028,7 +2311,7 @@ window.__ModuleLoader__.load({
2028
2311
  const filtered = (filter === 'all' ? tasks : tasks.filter((task) => matchesFilter(task, filter, humanId)))
2029
2312
  .slice()
2030
2313
  .sort((left, right) => (right.number ?? 0) - (left.number ?? 0));
2031
- const filterName = filter === 'all' ? '' : t(filter === 'q1' ? 'q1Title' : filter === 'q2' ? 'q2Title' : filter === 'q3' ? 'q3Title' : 'q4Title');
2314
+ const filterName = filter === 'all' ? '' : t(STATUS[filter]?.label ?? QUADRANTS.find((quadrant) => quadrant.key === filter)?.name ?? 'q4Title');
2032
2315
  const bar = filter === 'all' ? null : h('div', { className: 'at-boardbar', role: 'status' },
2033
2316
  h('span', { className: 'at-filterchip' }, tf(t, 'filterLabel', { name: filterName }) + ' · ' + tf(t, 'itemCount', { n: filtered.length })),
2034
2317
  q1Extra > 0 ? h('span', { className: 'at-filternote' }, tf(t, 'filterInboxExtra', { n: q1Extra })) : null,
@@ -2146,7 +2429,7 @@ window.__ModuleLoader__.load({
2146
2429
  }
2147
2430
 
2148
2431
  function TeamPulse({ t, agents, tasks, onOpen, onCancelAllPending, cancelBusy }) {
2149
- const active = tasks.filter((task) => ['pending', 'in_progress', 'pending_acceptance'].includes(task.status)).slice(-5);
2432
+ const active = tasks.filter((task) => ['pending', 'in_progress', 'pending_acceptance'].includes(task.status));
2150
2433
  const pendingTasks = tasks.filter((task) => task.status === 'pending');
2151
2434
  const running = agents.filter((agent) => agent.status === 'running');
2152
2435
  const starting = active.length === 0 && tasks.length === 0 && running.length > 0;
@@ -2167,7 +2450,7 @@ window.__ModuleLoader__.load({
2167
2450
  ? h('button', { className: 'at-btn at-btn-small', type: 'button', onClick: () => onCancelAllPending(pendingTasks), disabled: cancelBusy === true, title: t('cancelAllHint') }, cancelBusy ? t('working') : tf(t, 'cancelAllPending', { n: pendingTasks.length }))
2168
2451
  : null),
2169
2452
  active.length
2170
- ? h('div', { className: 'at-teampulselist' }, active.map((task) => h('button', {
2453
+ ? h('div', { className: 'at-teampulselist' }, active.slice(-5).map((task) => h('button', {
2171
2454
  key: task.id,
2172
2455
  className: 'at-teampulsetask',
2173
2456
  type: 'button',
@@ -2725,7 +3008,7 @@ window.__ModuleLoader__.load({
2725
3008
  const [mention, setMention] = React.useState(null);
2726
3009
  const [dragging, setDragging] = React.useState(false);
2727
3010
  useFitTextarea(boxRef, draft);
2728
- const candidates = mention === null ? [] : mentionCandidates(agents, mention.query);
3011
+ const candidates = mention === null || !onMode ? [] : mentionCandidates(agents, mention.query);
2729
3012
  const track = (el) => {
2730
3013
  const found = el ? mentionQuery(el.value, el.selectionStart ?? el.value.length) : null;
2731
3014
  setMention(found === null ? null : { ...found, caret: el.selectionStart ?? el.value.length, index: 0 });
@@ -2825,9 +3108,9 @@ window.__ModuleLoader__.load({
2825
3108
  onChange: (event) => onQaChecklist(event.target.value),
2826
3109
  }) : null) : null,
2827
3110
  h('div', { className: 'at-barrow' },
2828
- h('div', { className: 'at-mode', role: 'group', 'aria-label': t('modeAria') },
3111
+ onMode ? h('div', { className: 'at-mode', role: 'group', 'aria-label': t('modeAria') },
2829
3112
  h('button', { type: 'button', 'aria-pressed': mode === 'discuss', onClick: () => onMode('discuss') }, t('discuss')),
2830
- h('button', { type: 'button', 'aria-pressed': mode === 'task', onClick: () => onMode('task') }, t('taskMode'))),
3113
+ h('button', { type: 'button', 'aria-pressed': mode === 'task', onClick: () => onMode('task') }, t('taskMode'))) : null,
2831
3114
  discuss ? h('button', { className: 'at-attachbtn', type: 'button', title: t('attachAdd'), 'aria-label': t('attachAdd'), disabled, onClick: () => fileRef.current?.click() }, h(Ico, { name: 'clip' })) : null,
2832
3115
  h('input', { ref: fileRef, type: 'file', multiple: true, hidden: true, onChange: (event) => { attach(event.target.files); event.target.value = ''; } }),
2833
3116
  mode === 'task' ? h('label', { className: 'at-qacheck' },
@@ -2895,7 +3178,62 @@ window.__ModuleLoader__.load({
2895
3178
  h('button', { className: 'at-qmore', type: 'button', disabled: count === 0, onClick: () => onViewAll(quadrant.key) }, t('viewAll'))));
2896
3179
  }
2897
3180
 
2898
- function Situation({ t, quadrants, tasks, onItem, onViewAll }) {
3181
+ function ProjectOverview({ t, overview, counts, quadrants, tasks, agents, onViewAll, onTask, onAgent }) {
3182
+ const metrics = [
3183
+ { key: 'accepted', label: 'overviewAccepted', value: overview.accepted },
3184
+ { key: 'firstPass', label: 'overviewFirstPass', value: overview.sampleSize ? Math.round(100 * overview.firstPass / overview.sampleSize) + '%' : '—', samples: overview.sampleSize },
3185
+ { key: 'cycle', label: 'overviewCycle', value: overview.medianMinutes === null ? '—' : tf(t, 'overviewMinutes', { minutes: overview.medianMinutes }), samples: overview.cycleSamples },
3186
+ { key: 'attention', label: 'overviewAttention', value: quadrants.q1.count, onClick: () => onViewAll('q1') },
3187
+ ];
3188
+ const flow = [['pending', counts.todo], ['in_progress', counts.in_progress], ['pending_acceptance', counts.pending_acceptance], ['done', counts.done]];
3189
+ const members = new Map(agents.map((agent) => [agent.id, agent]));
3190
+ const peak = Math.max(1, ...overview.collaboration.flatMap((row) => row.daily));
3191
+ const taskById = new Map(tasks.map((task) => [task.id, task]));
3192
+ const evidence = overview.evidenceTaskIds.map((id) => taskById.get(id)).filter(Boolean);
3193
+ return h(React.Fragment, null,
3194
+ h('div', { className: 'at-overview-section at-overview-grid', 'aria-label': t('tabSituation') }, metrics.map((metric) =>
3195
+ h(metric.onClick ? 'button' : 'div', { key: metric.key, className: 'at-overview-tile', 'data-overview-metric': metric.key,
3196
+ ...(metric.onClick ? { type: 'button', onClick: metric.onClick } : {}),
3197
+ }, h('span', { className: 'at-overview-label' }, t(metric.label)), h('strong', { className: 'at-overview-value' }, metric.value),
3198
+ metric.samples !== undefined ? h('span', { className: 'at-overview-caption' }, tf(t, 'overviewSample', { n: metric.samples })) : null))),
3199
+ h('section', { className: 'at-overview-section', 'aria-labelledby': 'at-overview-delivery' },
3200
+ h('h2', { className: 'at-overview-heading', id: 'at-overview-delivery' }, t('overviewDelivery')),
3201
+ h('div', { className: 'at-overview-grid' }, flow.map(([status, count]) => h('button', {
3202
+ key: status, type: 'button', className: 'at-overview-tile at-overview-flow', 'data-status': status, onClick: () => onViewAll(status),
3203
+ }, h('span', { className: 'at-overview-label' }, t(statusMeta(status).label)), h('strong', { className: 'at-overview-value' }, count))))),
3204
+ overview.collaboration.length ? h('section', { className: 'at-overview-section', 'aria-labelledby': 'at-overview-collaboration' },
3205
+ h('h2', { className: 'at-overview-heading', id: 'at-overview-collaboration' }, t('overviewCollaboration')),
3206
+ h('div', { className: 'at-overview-grid at-overview-collaboration' }, overview.collaboration.map((row) => {
3207
+ const agent = members.get(row.memberId);
3208
+ if (!agent) return null;
3209
+ const skills = (agent.skills ?? []).join('、');
3210
+ return h('button', { key: agent.id, type: 'button', className: 'at-overview-tile', onClick: () => onAgent(agent) },
3211
+ h('span', { className: 'at-overview-cardtitle' }, agent.name),
3212
+ agent.role && agent.role !== agent.name ? h('span', { className: 'at-overview-caption' }, agent.role) : null,
3213
+ h('span', { className: 'at-overview-caption at-overview-memberstats' },
3214
+ h('span', null, tf(t, 'overviewActive', { n: row.active })), h('span', null, tf(t, 'overviewDelivered', { n: row.deliveries })), h('span', null, tf(t, 'overviewReviewed', { n: row.reviews }))),
3215
+ h('ol', { className: 'at-overview-spark', 'aria-label': t('overviewDaily') }, row.daily.map((count, index) => {
3216
+ const at = overview.dayEnds[index];
3217
+ const date = new Date(at).toLocaleDateString(undefined, { month: 'numeric', day: 'numeric' });
3218
+ const label = tf(t, 'overviewDailyValue', { date, n: count });
3219
+ return h('li', { key: index, title: label, 'aria-label': label, 'data-count': count, style: { height: (100 * count / peak) + '%' } });
3220
+ })),
3221
+ skills ? h('span', { className: 'at-overview-caption at-overview-excerpt', title: skills }, tf(t, 'overviewSkills', { skills })) : null);
3222
+ }))) : null,
3223
+ h('section', { className: 'at-overview-section', 'aria-labelledby': 'at-overview-evidence' },
3224
+ h('h2', { className: 'at-overview-heading', id: 'at-overview-evidence' }, t('overviewEvidence')),
3225
+ evidence.length ? h('div', { className: 'at-overview-grid at-overview-evidence' }, evidence.map((task) => {
3226
+ const entry = task.submission?.evidence.find((item) => item.label.trim() || item.ref.trim());
3227
+ const excerpt = entry?.label.trim() || entry?.ref.trim();
3228
+ const meta = [task.acceptedBy ? tf(t, 'acceptedBy', { name: task.acceptedBy }) : '', tf(t, 'overviewEvidenceCount', { n: task.evidenceCount })].filter(Boolean);
3229
+ return h('button', { key: task.id, type: 'button', className: 'at-overview-tile', onClick: (event) => onTask(task, event) },
3230
+ h('span', { className: 'at-overview-cardtitle' }, '#' + (task.number ?? task.id) + ' ' + task.title),
3231
+ h('span', { className: 'at-overview-caption at-overview-excerpt' }, excerpt?.slice(0, 240)),
3232
+ h('span', { className: 'at-overview-caption' }, meta.join(' · ')));
3233
+ })) : h('div', { className: 'at-overview-caption' }, t('overviewEmptyEvidence'))));
3234
+ }
3235
+
3236
+ function Situation({ t, quadrants, tasks, overview, counts, agents, onItem, onViewAll, onTask, onAgent }) {
2899
3237
  if (!quadrants) {
2900
3238
  return h('div', { className: 'at-situation', role: 'tabpanel', id: 'at-panel-situation', 'aria-labelledby': 'at-tab-situation' },
2901
3239
  h('div', { className: 'at-situationinner' },
@@ -2912,8 +3250,10 @@ window.__ModuleLoader__.load({
2912
3250
  return h('div', { className: 'at-situation', role: 'tabpanel', id: 'at-panel-situation', 'aria-labelledby': 'at-tab-situation' },
2913
3251
  h('div', { className: 'at-situationinner' },
2914
3252
  h('div', { className: 'at-qmeta' },
2915
- h('span', null, mood + ' · ' + tf(t, 'quadrantMeta', { time: fmtTime(quadrants.generatedAt) })),
2916
- quadrants.rev ? h('span', null, 'rev ' + quadrants.rev) : null),
3253
+ h('span', null, mood),
3254
+ h('span', null, tf(t, 'overviewAsOf', { time: fmtTime(quadrants.generatedAt) }))),
3255
+ overview && counts ? h(ProjectOverview, { t, overview, counts, quadrants, tasks, agents, onViewAll, onTask, onAgent }) : null,
3256
+ h('h2', { className: 'at-overview-heading' }, t('overviewAttentionTitle')),
2917
3257
  h('div', { className: 'at-quadrants' }, QUADRANTS.map((quadrant) => {
2918
3258
  const block = quadrants[quadrant.key] ?? { count: 0, items: [] };
2919
3259
  return h(QuadrantCard, {
@@ -3643,7 +3983,7 @@ window.__ModuleLoader__.load({
3643
3983
  const [tab, setTab] = React.useState('main');
3644
3984
  const [selected, setSelected] = React.useState('');
3645
3985
  const [threadOpen, setThreadOpen] = React.useState(false);
3646
- const [mode, setMode] = React.useState('discuss');
3986
+ const [draftMode, setMode] = React.useState('discuss');
3647
3987
  const [qaTask, setQaTask] = React.useState(false);
3648
3988
  const [taskDefinition, setTaskDefinition] = React.useState('');
3649
3989
  const [qaChecklistText, setQaChecklistText] = React.useState('');
@@ -3777,6 +4117,12 @@ window.__ModuleLoader__.load({
3777
4117
  const sendingRef = React.useRef(false);
3778
4118
  scopeRef.current = scope;
3779
4119
  const [nBusy, setNBusy] = React.useState(false);
4120
+ const [nBlueprintMode, setNBlueprintMode] = React.useState(false);
4121
+ const [nIntake, setNIntake] = React.useState(emptyBlueprintIntake);
4122
+ const [blueprintOptions, setBlueprintOptions] = React.useState([]);
4123
+ const [blueprintPreview, setBlueprintPreview] = React.useState(null);
4124
+ const [blueprintOpen, setBlueprintOpen] = React.useState('');
4125
+ const newProjectBusy = React.useRef(false);
3780
4126
  const [nError, setNError] = React.useState('');
3781
4127
  const [pSuccessor, setPSuccessor] = React.useState('');
3782
4128
  const [pBusy, setPBusy] = React.useState(false);
@@ -4093,8 +4439,15 @@ window.__ModuleLoader__.load({
4093
4439
  ...projectRecord,
4094
4440
  workspacePath: projectRecord.workspacePath || (data.project?.id === projectRecord.id ? data.project.workspacePath ?? '' : ''),
4095
4441
  };
4442
+ const blueprintProgress = data.project?.id === project?.id ? data.blueprint ?? null : null;
4443
+ const mode = blueprintProgress ? 'discuss' : draftMode;
4096
4444
  const humanId = (data.members ?? []).find((member) => member.kind === 'human')?.id ?? null;
4097
4445
  const tasks = data.tasks;
4446
+ const blueprintTask = blueprintProgress ? tasks.find((task) => task.id === blueprintProgress.taskId) : null;
4447
+ const blueprintDecisions = blueprintProgress ? data.inbox.filter((item) => item.projectId === project.id
4448
+ && item.ref?.blueprintDecision === true && item.ref.taskId === blueprintProgress.taskId
4449
+ && (item.state === 'unread' || item.state === 'read')) : [];
4450
+ const blueprintDecision = blueprintDecisions.find((item) => item.ref.humanOnly) ?? blueprintDecisions[0];
4098
4451
  const boardTaskCount = tasks.filter((task) => ['pending', 'in_progress', 'pending_acceptance', 'done'].includes(task.status)).length;
4099
4452
  const selectedTask = tasks.find((task) => task.id === selected) ?? tasks[0] ?? null;
4100
4453
  const thread = threadFor(data, selectedTask?.id);
@@ -4284,7 +4637,7 @@ window.__ModuleLoader__.load({
4284
4637
  setBoardFilter(key);
4285
4638
  setTab('board');
4286
4639
  setNote('');
4287
- if (key === 'q4') setDoneOpen(true);
4640
+ if (key === 'q4' || key === 'done') setDoneOpen(true);
4288
4641
  }
4289
4642
  function goConversation() {
4290
4643
  closeMobile();
@@ -4387,6 +4740,9 @@ window.__ModuleLoader__.load({
4387
4740
  setNWorkspace(data?.defaultWorkspace ?? '');
4388
4741
  setNError('');
4389
4742
  setNTeam('');
4743
+ setNBlueprintMode(false);
4744
+ setNIntake(emptyBlueprintIntake());
4745
+ setBlueprintPreview(null);
4390
4746
  setTeamComposeOpen(false);
4391
4747
  void loadTeams();
4392
4748
  setNewOpen(true);
@@ -4462,6 +4818,7 @@ window.__ModuleLoader__.load({
4462
4818
  if (!response.ok) throw new Error((body && body.error && body.error.message) || ('HTTP ' + response.status));
4463
4819
  if (seq !== teamLoadSeqRef.current) return;
4464
4820
  setTeamList(Array.isArray(body && body.teams) ? body.teams : []);
4821
+ setBlueprintOptions(Array.isArray(body?.blueprintUseCases) ? body.blueprintUseCases : []);
4465
4822
  const available = Array.isArray(body?.teams) ? body.teams.filter((entry) => !entry.broken) : [];
4466
4823
  const wanted = select || body?.defaultTeam || 'default';
4467
4824
  setNTeam(available.some((team) => team.id === wanted) ? wanted : available[0]?.id ?? '');
@@ -4484,21 +4841,41 @@ window.__ModuleLoader__.load({
4484
4841
  }
4485
4842
  }
4486
4843
  async function createProject() {
4487
- if (!nName.trim() || !nWorkspace.trim() || nBusy) return;
4844
+ if (!nName.trim() || !nWorkspace.trim() || newProjectBusy.current) return;
4845
+ newProjectBusy.current = true;
4488
4846
  setNBusy(true);
4489
4847
  setNError('');
4490
4848
  try {
4491
- const result = await runCommand('project.create', { name: nName.trim(), goal: nGoal.trim(), workspacePath: nWorkspace.trim(), ...(nTeam ? { team: nTeam } : {}) });
4849
+ const input = { name: nName.trim(), goal: nGoal.trim(), workspacePath: nWorkspace.trim() };
4850
+ if (nBlueprintMode) {
4851
+ input.blueprint = {
4852
+ ...nIntake,
4853
+ weeklyHours: Number(nIntake.weeklyHours),
4854
+ opportunities: nIntake.opportunities.map((item) => ({ ...item, minutes: Number(item.minutes), perWeek: Number(item.perWeek) })),
4855
+ };
4856
+ if (!blueprintPreview) {
4857
+ setBlueprintPreview(await runCommand('project.blueprint.preview', input));
4858
+ return;
4859
+ }
4860
+ input.blueprintId = blueprintPreview.id;
4861
+ input.blueprintFingerprint = blueprintPreview.fingerprint;
4862
+ } else if (nTeam) {
4863
+ input.team = nTeam;
4864
+ }
4865
+ const result = await runCommand('project.create', input);
4492
4866
  const next = result.project;
4493
4867
  setNewOpen(false);
4494
4868
  setScope('project');
4495
4869
  setTab('main');
4870
+ setMode('discuss');
4496
4871
  await reloadData(next.id);
4497
4872
  setProjectId(next.id);
4873
+ if (nBlueprintMode) setBlueprintOpen(next.id);
4498
4874
  say(tf(t, 'projectCreated', { name: next.name }));
4499
4875
  } catch (error) {
4500
4876
  setNError(error?.message ?? String(error));
4501
4877
  } finally {
4878
+ newProjectBusy.current = false;
4502
4879
  setNBusy(false);
4503
4880
  }
4504
4881
  }
@@ -4773,6 +5150,11 @@ window.__ModuleLoader__.load({
4773
5150
  }
4774
5151
  async function openAgentChat(agent) {
4775
5152
  closeMobile();
5153
+ if (blueprintProgress && agent.duty !== 'lead') {
5154
+ say(t('blueprintLeadContact'));
5155
+ openProfile(agent);
5156
+ return;
5157
+ }
4776
5158
  const service = ctx?.get?.('uiWorkspace') ?? ctx?.uiWorkspace;
4777
5159
  if (service?.openSession === undefined) {
4778
5160
  say(t('agentChatUnavailable'));
@@ -5527,10 +5909,11 @@ window.__ModuleLoader__.load({
5527
5909
  humanId,
5528
5910
  })
5529
5911
  : tab === 'situation'
5530
- ? h(Situation, { t, quadrants, tasks, onItem: openQuadrantItem, onViewAll: viewQuadrant })
5912
+ ? h(Situation, { t, quadrants, tasks, overview: data.overview, counts: data.board?.counts, agents: data.agents,
5913
+ onItem: openQuadrantItem, onViewAll: viewQuadrant, onTask: openTask, onAgent: openProfile })
5531
5914
  : h(React.Fragment, null, h('div', { className: 'at-stream', role: 'tabpanel', id: 'at-panel-main', 'aria-labelledby': 'at-tab-main', ref: streamRef, onScroll: onStreamScroll },
5532
5915
  h('div', { className: 'at-streaminner', role: 'log', 'aria-live': 'polite', 'aria-label': t('streamAria') },
5533
- h(TeamPulse, { t, agents: data.agents, tasks, onOpen: openTask, onCancelAllPending: cancelAllPending, cancelBusy: cancelAllBusy }),
5916
+ blueprintProgress ? null : h(TeamPulse, { t, agents: data.agents, tasks, onOpen: openTask, onCancelAllPending: cancelAllPending, cancelBusy: cancelAllBusy }),
5534
5917
  data.stream.length
5535
5918
  ? data.stream.map((item) => h(StreamMessage, {
5536
5919
  key: item.id,
@@ -5578,7 +5961,7 @@ window.__ModuleLoader__.load({
5578
5961
  h('button', {
5579
5962
  className: cx('at-pmobtn', project.pmoAuto !== false && 'at-pmo-on'),
5580
5963
  type: 'button',
5581
- title: t('pmoHint'),
5964
+ title: t(blueprintProgress ? 'blueprintPmoHint' : 'pmoHint'),
5582
5965
  'aria-pressed': project.pmoAuto !== false,
5583
5966
  onClick: togglePmo,
5584
5967
  }, project.pmoAuto !== false ? t('pmoOn') : t('pmoOff')),
@@ -5635,6 +6018,11 @@ window.__ModuleLoader__.load({
5635
6018
  tabIndex: tab === 'situation' ? 0 : -1,
5636
6019
  onClick: () => selectTab('situation'),
5637
6020
  }, t('tabSituation')))),
6021
+ blueprintProgress && scope === 'project' && !memberViewAgent ? h(BlueprintProcess, {
6022
+ t, progress: blueprintProgress, task: blueprintTask, agents: data.agents, stopped: runStopped,
6023
+ pmoAuto: project.pmoAuto !== false, decision: blueprintDecision,
6024
+ onManage: () => setBlueprintOpen(project.id), onTask: (event) => openTask(blueprintTask, event), onInbox: switchInbox, onAgent: openProfile,
6025
+ }) : null,
5638
6026
  note ? h('div', { className: 'at-notewrap' },
5639
6027
  h('div', { className: 'at-note', role: 'status' },
5640
6028
  h('span', { className: 'at-notetext' }, note),
@@ -5653,7 +6041,7 @@ window.__ModuleLoader__.load({
5653
6041
  onQaRequired: setQaTask,
5654
6042
  onDefinition: setTaskDefinition,
5655
6043
  onQaChecklist: setQaChecklistText,
5656
- onMode: setMode,
6044
+ onMode: blueprintProgress ? null : setMode,
5657
6045
  onDraft: setDraft,
5658
6046
  onSend: send,
5659
6047
  inputRef: composerInputRef,
@@ -5894,9 +6282,9 @@ window.__ModuleLoader__.load({
5894
6282
  h('div', { className: 'at-modalactions' },
5895
6283
  h('button', { className: 'at-btn', type: 'button', onClick: () => setWorkspaceOpen(false), disabled: workspaceBusy }, t('cancel')),
5896
6284
  h('button', { className: 'at-btn at-btn-primary', type: 'submit', disabled: workspaceBusy || !workspaceDraft.trim() }, workspaceBusy ? t('saving') : t('workspaceSave'))))) : null,
5897
- newOpen ? h(ModalBack, { onClose: () => setNewOpen(false) },
6285
+ newOpen ? h(ModalBack, { onClose: () => { if (!newProjectBusy.current) setNewOpen(false); } },
5898
6286
  h('form', {
5899
- className: 'at-modal at-modal-wide',
6287
+ className: cx('at-modal at-modal-wide', nBlueprintMode && 'at-blueprint-setup'),
5900
6288
  role: 'dialog',
5901
6289
  'aria-modal': 'true',
5902
6290
  'aria-label': t('newProjectTitle'),
@@ -5905,31 +6293,44 @@ window.__ModuleLoader__.load({
5905
6293
  h('h2', { className: 'at-modaltitle' }, withIco('folderPlus', t('newProjectTitle'), 16)),
5906
6294
  h('div', { className: 'at-modalactions' },
5907
6295
  h('button', { className: 'at-btn', type: 'button', onClick: () => setNewOpen(false), disabled: nBusy }, withIco('close', t('cancel'))),
5908
- h('button', { className: 'at-btn at-btn-primary', type: 'submit', disabled: nBusy || !nName.trim() || !nWorkspace.trim() }, withIco('check', nBusy ? t('saving') : t('projectCreate')))),
6296
+ blueprintPreview ? h('button', { className: 'at-btn', type: 'button', disabled: nBusy, onClick: () => { setBlueprintPreview(null); setNError(''); } }, t('blueprintEdit')) : null,
6297
+ h('button', { className: 'at-btn at-btn-primary', type: 'submit', disabled: nBusy || !nName.trim() || !nWorkspace.trim() || (nBlueprintMode && blueprintOptions.length === 0) },
6298
+ withIco('check', t(nBusy ? 'saving' : !nBlueprintMode ? 'projectCreate' : blueprintPreview ? 'blueprintConfirm' : 'blueprintPreview')))),
5909
6299
  nError ? h('div', { className: 'at-modalerror', role: 'alert' }, nError) : null,
5910
- h('div', { className: 'at-split' },
6300
+ blueprintPreview ? h('pre', { className: 'at-blueprint-doc' }, blueprintPreview.markdown) : h('div', { className: 'at-mode at-addtabs', role: 'group', 'aria-label': t('projectTeam') },
6301
+ h('button', { type: 'button', disabled: nBusy, 'aria-pressed': !nBlueprintMode, onClick: () => { setNBlueprintMode(false); setNError(''); } }, t('blueprintPreset')),
6302
+ h('button', { type: 'button', disabled: nBusy, 'aria-pressed': nBlueprintMode, onClick: () => { setNBlueprintMode(true); setNError(''); } }, t('blueprintMode'))),
6303
+ blueprintPreview ? null : h('div', { className: 'at-split' },
5911
6304
  h('div', { className: 'at-pane' },
5912
6305
  h('label', { className: 'at-field' }, h('span', null, t('projectName')),
5913
6306
  h('input', { value: nName, onChange: (event) => setNName(event.target.value), autoFocus: true })),
5914
- h('label', { className: 'at-field' }, h('span', null, t('projectGoal')),
5915
- h('textarea', { value: nGoal, rows: 5, onChange: (event) => setNGoal(event.target.value) })),
6307
+ h('label', { className: 'at-field' }, h('span', null, t(nBlueprintMode ? 'blueprintGoal' : 'projectGoal')),
6308
+ h('textarea', { value: nGoal, rows: nBlueprintMode ? 3 : 5, required: nBlueprintMode, maxLength: nBlueprintMode ? 500 : undefined, onChange: (event) => setNGoal(event.target.value) })),
5916
6309
  h('label', { className: 'at-field' }, h('span', null, t('workspace')),
5917
6310
  h('div', { className: 'at-inlineadd' },
5918
6311
  h('input', { value: nWorkspace, onChange: (event) => setNWorkspace(event.target.value), placeholder: data?.workspaceExample ?? t('workspacePathPlaceholder') }),
5919
6312
  h('button', { className: 'at-btn at-btn-small', type: 'button', onClick: pickNewWorkspace }, withIco('folderPlus', t('workspaceChoose'), 12)))),
5920
- h('label', { className: 'at-field' }, h('span', null, t('projectTeam')),
6313
+ nBlueprintMode ? null : h('label', { className: 'at-field' }, h('span', null, t('projectTeam')),
5921
6314
  teamList === null ? h('div', { className: 'at-modalmeta' }, t('talentLoading'))
5922
6315
  : h('select', { value: nTeam, onChange: (event) => setNTeam(event.target.value) }, teamList.filter((entry) => !entry.broken).map((entry) => h('option', { key: entry.id, value: entry.id }, entry.name + '(' + entry.members.length + ')' + (entry.source === 'user' ? ' · ' + t('talentUser') : ''))))),
5923
6316
  teamLoadError ? h('div', { className: 'at-modalerror', role: 'alert' }, teamLoadError) : null,
5924
- h('div', { className: 'at-tcpick' },
6317
+ nBlueprintMode ? null : h('div', { className: 'at-tcpick' },
5925
6318
  h('button', { className: 'at-btn at-btn-small at-btn-accent', type: 'button', onClick: openTeamComposer }, withIco('users', t('teamCompose'), 12)),
5926
6319
  selectedTeam && selectedTeam.source === 'user' ? h('button', { className: 'at-btn at-btn-small at-btn-danger', type: 'button', onClick: () => void removeTeam(selectedTeam) }, withIco('close', t('teamDelete'), 12)) : null)),
5927
6320
  // 右栏:选中团队的成员卡片(名字、岗位、职责、简介、技能;负责人标出来)。
5928
- h('div', { className: 'at-pane' },
6321
+ nBlueprintMode ? h(BlueprintIntake, { t, intake: nIntake, onChange: setNIntake, useCases: blueprintOptions }) : h('div', { className: 'at-pane' },
5929
6322
  selectedTeam ? h('div', { className: 'at-panetitle', title: teamMembersLine(selectedTeam) }, selectedTeam.name + ' · ' + tf(t, 'projectTeamMembers', { n: selectedTeam.members.length })) : null,
5930
6323
  selectedTeam && selectedTeam.description ? h('div', { className: 'at-modalmeta' }, selectedTeam.description) : null,
5931
6324
  selectedTeam ? h('div', { className: 'at-marketgrid', role: 'list' }, selectedTeam.members.map((member) => h('div', { key: member.id, className: 'at-talent', role: 'listitem' },
5932
6325
  h(TalentInfo, { t, talent: member, lead: member.id === selectedTeam.lead })))) : null)))) : null,
6326
+ blueprintProgress && blueprintOpen === project?.id ? h(BlueprintRunDialog, {
6327
+ key: project.id, t, progress: blueprintProgress, stopped: runStopped, pmoAuto: project.pmoAuto !== false,
6328
+ decisionPending: Boolean(blueprintDecision),
6329
+ onClose: () => setBlueprintOpen(''),
6330
+ onCommand: async (type, payload) => { await runCommand(type, payload, project.id); await reloadData(project.id); },
6331
+ onTask: (taskId) => { setBlueprintOpen(''); openTaskById(taskId); },
6332
+ onInbox: () => { setBlueprintOpen(''); switchInbox(); },
6333
+ }) : null,
5933
6334
  teamComposeOpen ? h(ModalBack, { onClose: () => setTeamComposeOpen(false) },
5934
6335
  h('div', { className: 'at-modal at-modal-wide', role: 'dialog', 'aria-modal': 'true', 'aria-label': t('teamComposeTitle') },
5935
6336
  h('h2', { className: 'at-modaltitle' }, withIco('users', t('teamComposeTitle'), 16)),