@suifei/dsh-ai-team 0.4.145 → 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/CHANGELOG.md +11 -0
- package/LICENSE +21 -21
- package/README.md +31 -2
- package/client.js +551 -49
- package/cordis.patch.yml +31 -31
- package/icon.svg +12 -12
- package/index.js +105 -25
- package/lib/domain/ids.js +26 -26
- package/lib/domain/inbox.js +93 -93
- package/lib/domain/member-config.js +168 -168
- package/lib/domain/policy.js +8 -1
- package/lib/domain/task.js +2 -0
- package/lib/domain/team-blueprint.js +240 -0
- package/lib/host/decision-report.js +72 -72
- package/lib/host/default-roster.js +18 -0
- package/lib/host/default-workspace.js +69 -69
- package/lib/host/fault-adapter.js +50 -50
- package/lib/host/member-tools.js +6 -1
- package/lib/host/people-view.js +9 -2
- package/lib/host/permission-guard.js +61 -61
- package/lib/host/project-registry.js +104 -104
- package/lib/host/project-runtime.js +2 -2
- package/lib/host/risk-view.js +99 -99
- package/lib/host/service.js +195 -16
- package/lib/host/views.js +42 -1
- package/lib/host/waker.js +38 -8
- package/lib/host/weekly-view.js +86 -86
- package/lib/host/workspace-path.js +94 -94
- package/lib/ledger/checkpoint.js +415 -415
- package/lib/ledger/events.js +398 -398
- package/lib/ledger/fold.js +23 -0
- package/lib/ledger/namespace.js +124 -124
- package/lib/ledger/tools.js +118 -118
- package/lib/ledger/writer.js +1266 -1266
- package/lib/runtime/error-chain.js +31 -31
- package/lib/runtime/shell-guard.js +102 -102
- package/lib/runtime/skill-catalog.js +41 -41
- package/lib/runtime/skill-policy.js +12 -12
- package/lib/runtime/stop-guard.js +17 -2
- package/lib/skillopt/adopt-gate.js +108 -108
- package/lib/skillopt/gate-wiring.js +146 -146
- package/lib/skillopt/jobs.js +135 -135
- package/lib/skillopt/proposal-store.js +33 -33
- package/lib/skillopt/review-runner.js +107 -107
- package/lib/skillopt/rubric.js +189 -189
- package/lib/skillopt/subagent-text.js +101 -101
- package/lib/skillopt/tool-access.js +56 -56
- package/locale/en.json +6 -6
- package/locale/zh.json +6 -6
- package/package.json +1 -1
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: '添加图片或文件',
|
|
@@ -95,6 +95,9 @@ window.__ModuleLoader__.load({
|
|
|
95
95
|
streamUp: '实时更新已恢复。',
|
|
96
96
|
loadFailedTitle: '工作台不可达',
|
|
97
97
|
loadFailedBody: 'bootstrap 接口(/ai-team)无法访问;请确认插件已启用后重试。',
|
|
98
|
+
bootFailure503: '文渊阁初始化失败。请查看宿主日志中的文渊阁启动错误,再点重试。',
|
|
99
|
+
bootConnection503: '宿主未提供插件所需的连接服务。请确认宿主已启动,并使用独立 ai-team profile。',
|
|
100
|
+
bootUnknown503: '宿主或文渊阁暂不可用。请先确认 DSH 的工作区或设置能否正常打开,再重试。',
|
|
98
101
|
spike: 'AI Team',
|
|
99
102
|
spikeTitle: '文渊阁 AI Team 工作台:修书、校勘、纂辑;方向、验收与账本。',
|
|
100
103
|
navAria: '页面导航',
|
|
@@ -220,6 +223,33 @@ window.__ModuleLoader__.load({
|
|
|
220
223
|
newProject: '新建项目',
|
|
221
224
|
addAgent: '添加成员',
|
|
222
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: '待你确认下一阶段',
|
|
223
253
|
projectName: '项目名',
|
|
224
254
|
projectGoal: '目标',
|
|
225
255
|
workspace: '工作目录',
|
|
@@ -309,6 +339,7 @@ window.__ModuleLoader__.load({
|
|
|
309
339
|
tcSkills: '技能', tcEmpty: '还没装技能(可选)', tcAddExisting: '从已有装', tcWriteOwn: '自写一份', tcImport: '导入 .md', tcPick: '选一个已有技能…', tcAdd: '加入', tcRemove: '移除',
|
|
310
340
|
tcSkillName: '技能名(英文/数字/-)', tcSkillBody: '技能正文(SKILL.md)', tcSkillDup: '已经装了同名技能', tcSave: '存为我的人才', tcSaving: '保存中…',
|
|
311
341
|
memberSaveAsTalent: '存为人才', tcFromMember: '从成员「{name}」存出:沿用它此刻的岗位、职责、性格与技能,可先修改再保存。', tcModelKept: '沿用模型:{model}', tcMissing: '这些技能找不到正文,没有带上:{skills}', tcDraftFailed: '读取成员草稿失败:{error}',
|
|
342
|
+
teamManagement: '团队管理', teamManageGoal: '管理当前项目成员,或为新项目准备团队预设。', teamActiveProject: '当前项目成员', teamPickProject: '切换活动项目以管理成员', teamNoActiveProject: '请选择一个未归档的项目。', teamPresets: '团队预设', teamPresetHint: '预设用于新建项目,不会更改已创建的项目。', teamNoPresets: '没有可用的团队预设。',
|
|
312
343
|
projectTeam: '团队', teamCompose: '组一个新团队', teamComposeTitle: '组队', teamComposeHint: '从人才里挑人组队:同一人才可以招多位,给其中一位定为负责人(新项目的主理人)。', teamName: '团队名', teamDesc: '说明', teamMembers: '成员', teamPick: '从人才里挑人', teamAdd: '加入', teamLead: '负责人', teamEmptyPick: '还没挑人', teamSave: '保存团队', teamBack: '返回', teamDelete: '删除这个团队', teamDeleteConfirm: '删除自建团队「{name}」?团队文件会被删除,已用它建的项目和其中成员不受影响。', teamLoadFailed: '团队列表读取失败:{error}',
|
|
313
344
|
talentEmpty: '没有符合条件的人才。',
|
|
314
345
|
talentLoading: '正在读取人才市场…',
|
|
@@ -458,6 +489,12 @@ window.__ModuleLoader__.load({
|
|
|
458
489
|
q4Empty: '还没有完成',
|
|
459
490
|
viewAll: '查看全部',
|
|
460
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: '需要处理的事项',
|
|
461
498
|
q4Total: '最近 {n} 条 / 共 {m} 条',
|
|
462
499
|
catReview: '待验收',
|
|
463
500
|
catIrreversible: '不可撤回',
|
|
@@ -494,7 +531,7 @@ window.__ModuleLoader__.load({
|
|
|
494
531
|
projects: 'Projects',
|
|
495
532
|
main: 'Main',
|
|
496
533
|
boardTab: 'Board',
|
|
497
|
-
tabSituation: '
|
|
534
|
+
tabSituation: 'Overview',
|
|
498
535
|
tabsAria: 'Project views',
|
|
499
536
|
composer: 'Write a message… @ a member; paste or drop images and files',
|
|
500
537
|
attachAdd: 'Add images or files',
|
|
@@ -556,6 +593,9 @@ window.__ModuleLoader__.load({
|
|
|
556
593
|
loading: 'Loading…',
|
|
557
594
|
loadFailedTitle: 'Workbench unreachable',
|
|
558
595
|
loadFailedBody: 'The bootstrap endpoint (/ai-team) cannot be reached; confirm the plugin is enabled and retry.',
|
|
596
|
+
bootFailure503: 'Wenyuan Pavilion could not initialize. Check its startup error in the host log and retry.',
|
|
597
|
+
bootConnection503: 'The host connection service is unavailable. Make sure the host is running and use the dedicated ai-team profile.',
|
|
598
|
+
bootUnknown503: 'The host or Wenyuan Pavilion is unavailable. Check whether a DSH workspace or Settings opens, then retry.',
|
|
559
599
|
streamDown: 'Live updates stopped; the view may lag while the stream reconnects…',
|
|
560
600
|
streamUp: 'Live updates are back.',
|
|
561
601
|
spike: 'AI Team',
|
|
@@ -684,6 +724,33 @@ window.__ModuleLoader__.load({
|
|
|
684
724
|
newProject: 'New project',
|
|
685
725
|
addAgent: 'Add member',
|
|
686
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',
|
|
687
754
|
projectName: 'Project name',
|
|
688
755
|
projectGoal: 'Goal',
|
|
689
756
|
workspace: 'Workspace',
|
|
@@ -773,6 +840,7 @@ window.__ModuleLoader__.load({
|
|
|
773
840
|
tcSkills: 'Skills', tcEmpty: 'No skills yet (optional)', tcAddExisting: 'From existing', tcWriteOwn: 'Write one', tcImport: 'Import .md', tcPick: 'Pick an existing skill…', tcAdd: 'Add', tcRemove: 'Remove',
|
|
774
841
|
tcSkillName: 'Skill name (a-z, 0-9, -)', tcSkillBody: 'Skill body (SKILL.md)', tcSkillDup: 'That skill name is already staged', tcSave: 'Save as my talent', tcSaving: 'Saving…',
|
|
775
842
|
memberSaveAsTalent: 'Save as talent', tcFromMember: 'Saved from member “{name}”: its current role, duty, personality and skills are filled in; edit before saving.', tcModelKept: 'Keeps the model: {model}', tcMissing: 'These skills have no readable body and were left out: {skills}', tcDraftFailed: 'Could not read the member draft: {error}',
|
|
843
|
+
teamManagement: 'Team management', teamManageGoal: 'Manage the current project’s members or prepare team presets for new projects.', teamActiveProject: 'Current project members', teamPickProject: 'Switch active project to manage its members', teamNoActiveProject: 'Select a project that is not archived.', teamPresets: 'Team presets', teamPresetHint: 'Presets are used for new projects and do not change existing projects.', teamNoPresets: 'No available team presets.',
|
|
776
844
|
projectTeam: 'Team', teamCompose: 'Compose a new team', teamComposeTitle: 'Compose a team', teamComposeHint: 'Pick talents into a team: the same talent can be hired more than once; mark one as the lead (the new project owner).', teamName: 'Team name', teamDesc: 'Description', teamMembers: 'Members', teamPick: 'Pick from talents', teamAdd: 'Add', teamLead: 'Lead', teamEmptyPick: 'Nobody picked yet', teamSave: 'Save team', teamBack: 'Back', teamDelete: 'Delete this team', teamDeleteConfirm: 'Delete your team “{name}”? Its file is removed; projects already created from it and their members are unaffected.', teamLoadFailed: 'Could not load teams: {error}',
|
|
777
845
|
talentEmpty: 'No talent matches.',
|
|
778
846
|
talentLoading: 'Loading the talent market…',
|
|
@@ -922,6 +990,12 @@ window.__ModuleLoader__.load({
|
|
|
922
990
|
q4Empty: 'Nothing completed yet',
|
|
923
991
|
viewAll: 'View all',
|
|
924
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',
|
|
925
999
|
q4Total: 'Recent {n} / {m} total',
|
|
926
1000
|
catReview: 'To accept',
|
|
927
1001
|
catIrreversible: 'Irreversible',
|
|
@@ -1061,6 +1135,7 @@ window.__ModuleLoader__.load({
|
|
|
1061
1135
|
|
|
1062
1136
|
/** Only the four board columns; `blocked` stays a badge, never a column. */
|
|
1063
1137
|
function matchesFilter(task, filter, humanId) {
|
|
1138
|
+
if (Object.hasOwn(STATUS, filter)) return task.status === filter;
|
|
1064
1139
|
if (filter === 'q1') {
|
|
1065
1140
|
return task.status === 'pending_acceptance'
|
|
1066
1141
|
|| (task.ownerId === humanId && task.status === 'pending' && task.blocked === true);
|
|
@@ -1080,15 +1155,16 @@ window.__ModuleLoader__.load({
|
|
|
1080
1155
|
.at-toasttext { min-width: 0; overflow-wrap: anywhere; }
|
|
1081
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; }
|
|
1082
1157
|
.at-root :focus-visible { outline: 2px solid var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary)); outline-offset: 2px; }
|
|
1083
|
-
.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); }
|
|
1084
1159
|
.at-brand { color: var(--dsw-alias-label-primary); font-size: 12px; font-weight: 500; white-space: nowrap; }
|
|
1085
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; }
|
|
1086
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; }
|
|
1087
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; }
|
|
1088
|
-
.at-mobile { display: none;
|
|
1163
|
+
.at-mobile { display: none; min-width: 0; }
|
|
1089
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; }
|
|
1090
1165
|
.at-mobilesummary::-webkit-details-marker { display: none; }
|
|
1091
|
-
.at-mobilepop { position:
|
|
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; }
|
|
1092
1168
|
.at-grid { flex: 1; min-height: 0; min-width: 0; position: relative; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
|
|
1093
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; }
|
|
1094
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; }
|
|
@@ -1324,8 +1400,27 @@ window.__ModuleLoader__.load({
|
|
|
1324
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; }
|
|
1325
1401
|
.at-coltoggle:hover { color: var(--dsw-alias-label-primary); }
|
|
1326
1402
|
.at-colempty { padding: 4px; color: var(--dsw-alias-label-caption); font-size: 11px; line-height: 16px; }
|
|
1327
|
-
.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; }
|
|
1328
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; }
|
|
1329
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; }
|
|
1330
1425
|
.at-qmeta > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1331
1426
|
.at-quadrants { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: stretch; min-width: 0; }
|
|
@@ -1434,6 +1529,23 @@ window.__ModuleLoader__.load({
|
|
|
1434
1529
|
/* 内容型弹窗(添加成员 / 人才市场、成员资料、新建项目、组队):插件页面的 90% 宽高;确认框等小弹窗保持紧凑。 */
|
|
1435
1530
|
.at-modalback:has(> .at-modal-wide) { padding: 0; }
|
|
1436
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; }
|
|
1437
1549
|
/* 所有弹窗:标题栏固定在顶部,功能按钮在右上角;内容再长也不用滚到底找按钮。 */
|
|
1438
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; }
|
|
1439
1551
|
.at-modal > * { grid-column: 1 / -1; min-width: 0; }
|
|
@@ -1585,6 +1697,9 @@ window.__ModuleLoader__.load({
|
|
|
1585
1697
|
.at-situation { padding: 12px 12px 16px; }
|
|
1586
1698
|
}
|
|
1587
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; }
|
|
1588
1703
|
.at-grid { grid-template-columns: minmax(0, 1fr); }
|
|
1589
1704
|
.at-left { display: none; }
|
|
1590
1705
|
.at-mobile { display: block; }
|
|
@@ -1935,6 +2050,182 @@ window.__ModuleLoader__.load({
|
|
|
1935
2050
|
return h('div', { className: 'at-modalback', ref: backRef }, children);
|
|
1936
2051
|
}
|
|
1937
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
|
+
|
|
1938
2229
|
/**
|
|
1939
2230
|
* 自绘确认/输入对话框(替代原生 confirm/prompt):confirm 布尔、
|
|
1940
2231
|
* prompt 文本、choice 选项。模块级组件 + 调用方自增 key 保证每次
|
|
@@ -2020,7 +2311,7 @@ window.__ModuleLoader__.load({
|
|
|
2020
2311
|
const filtered = (filter === 'all' ? tasks : tasks.filter((task) => matchesFilter(task, filter, humanId)))
|
|
2021
2312
|
.slice()
|
|
2022
2313
|
.sort((left, right) => (right.number ?? 0) - (left.number ?? 0));
|
|
2023
|
-
const filterName = filter === 'all' ? '' : t(filter
|
|
2314
|
+
const filterName = filter === 'all' ? '' : t(STATUS[filter]?.label ?? QUADRANTS.find((quadrant) => quadrant.key === filter)?.name ?? 'q4Title');
|
|
2024
2315
|
const bar = filter === 'all' ? null : h('div', { className: 'at-boardbar', role: 'status' },
|
|
2025
2316
|
h('span', { className: 'at-filterchip' }, tf(t, 'filterLabel', { name: filterName }) + ' · ' + tf(t, 'itemCount', { n: filtered.length })),
|
|
2026
2317
|
q1Extra > 0 ? h('span', { className: 'at-filternote' }, tf(t, 'filterInboxExtra', { n: q1Extra })) : null,
|
|
@@ -2138,7 +2429,7 @@ window.__ModuleLoader__.load({
|
|
|
2138
2429
|
}
|
|
2139
2430
|
|
|
2140
2431
|
function TeamPulse({ t, agents, tasks, onOpen, onCancelAllPending, cancelBusy }) {
|
|
2141
|
-
const active = tasks.filter((task) => ['pending', 'in_progress', 'pending_acceptance'].includes(task.status))
|
|
2432
|
+
const active = tasks.filter((task) => ['pending', 'in_progress', 'pending_acceptance'].includes(task.status));
|
|
2142
2433
|
const pendingTasks = tasks.filter((task) => task.status === 'pending');
|
|
2143
2434
|
const running = agents.filter((agent) => agent.status === 'running');
|
|
2144
2435
|
const starting = active.length === 0 && tasks.length === 0 && running.length > 0;
|
|
@@ -2159,7 +2450,7 @@ window.__ModuleLoader__.load({
|
|
|
2159
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 }))
|
|
2160
2451
|
: null),
|
|
2161
2452
|
active.length
|
|
2162
|
-
|
|
2453
|
+
? h('div', { className: 'at-teampulselist' }, active.slice(-5).map((task) => h('button', {
|
|
2163
2454
|
key: task.id,
|
|
2164
2455
|
className: 'at-teampulsetask',
|
|
2165
2456
|
type: 'button',
|
|
@@ -2374,7 +2665,7 @@ window.__ModuleLoader__.load({
|
|
|
2374
2665
|
: h(EmptyState, { t, title: t('memberNoTasks'), body: t('memberNoTasksBody'), compact: true })));
|
|
2375
2666
|
}
|
|
2376
2667
|
|
|
2377
|
-
function LeftPanel({ t, data, projectId, scope, tab, inboxUnread, onBack, onInbox, onBoard, onPeople, peopleActive, onProject, onNewProject, onAgent, onAgentMore, onAgentChat, onAddAgent, onRecruit }) {
|
|
2668
|
+
function LeftPanel({ t, data, projectId, scope, tab, inboxUnread, onBack, onInbox, onBoard, onPeople, peopleActive, onTeam, onProject, onNewProject, onAgent, onAgentMore, onAgentChat, onAddAgent, onRecruit }) {
|
|
2378
2669
|
const projects = data.projects.filter((project) => !project.archived);
|
|
2379
2670
|
const activeAgents = data.agents.filter((agent) => agent.status !== 'retired');
|
|
2380
2671
|
const talentAgents = data.agents.filter((agent) => agent.status === 'retired');
|
|
@@ -2402,6 +2693,12 @@ window.__ModuleLoader__.load({
|
|
|
2402
2693
|
'aria-current': peopleActive ? 'page' : undefined,
|
|
2403
2694
|
onClick: onPeople,
|
|
2404
2695
|
}, h(Ico, { name: 'layers' }), h('span', null, t('people'))),
|
|
2696
|
+
h('button', {
|
|
2697
|
+
className: cx('at-navrow', scope === 'team' && 'at-on'),
|
|
2698
|
+
type: 'button',
|
|
2699
|
+
'aria-current': scope === 'team' ? 'page' : undefined,
|
|
2700
|
+
onClick: onTeam,
|
|
2701
|
+
}, h(Ico, { name: 'users' }), h('span', null, t('teamManagement'))),
|
|
2405
2702
|
),
|
|
2406
2703
|
h('div', { className: 'at-h' },
|
|
2407
2704
|
h('span', null, t('projects')),
|
|
@@ -2441,6 +2738,45 @@ window.__ModuleLoader__.load({
|
|
|
2441
2738
|
h('button', { className: 'at-btn at-btn-small', type: 'button', onClick: () => onRecruit(agent) }, t('recruit')))))) : null);
|
|
2442
2739
|
}
|
|
2443
2740
|
|
|
2741
|
+
function TeamManagementPage({ t, project, projects, agents, switching, onProject, onAdd, onAgent, onChat, onRecruit, teams, selectedTeam, onSelectTeam, error, onLoad, onCompose, onDelete }) {
|
|
2742
|
+
const active = agents.filter((agent) => agent.status !== 'retired');
|
|
2743
|
+
const retired = agents.filter((agent) => agent.status === 'retired');
|
|
2744
|
+
return h('div', { className: 'at-stream', role: 'region', 'aria-label': t('teamManagement') },
|
|
2745
|
+
h('div', { className: 'at-streaminner at-streamwide' },
|
|
2746
|
+
h('section', { className: 'at-pane', 'aria-labelledby': 'at-team-members' },
|
|
2747
|
+
h('h2', { id: 'at-team-members', className: 'at-panetitle' }, t('teamActiveProject')),
|
|
2748
|
+
h('label', { className: 'at-field' }, h('span', null, t('teamPickProject')),
|
|
2749
|
+
h('select', { value: project?.id ?? '', disabled: switching || !projects.length, onChange: (event) => {
|
|
2750
|
+
const next = projects.find((candidate) => candidate.id === event.target.value);
|
|
2751
|
+
if (next) void onProject(next);
|
|
2752
|
+
} }, !project ? h('option', { value: '' }, t('teamNoActiveProject')) : null,
|
|
2753
|
+
projects.map((candidate) => h('option', { key: candidate.id, value: candidate.id }, candidate.name)))),
|
|
2754
|
+
switching ? h('div', { className: 'at-modalmeta', role: 'status' }, t('loading')) : project ? h(React.Fragment, null,
|
|
2755
|
+
h('div', { className: 'at-tcpick' }, h('button', { className: 'at-btn at-btn-small at-btn-accent', type: 'button', onClick: onAdd }, withIco('plus', t('addAgent'), 12))),
|
|
2756
|
+
active.length ? h('div', { role: 'list', 'aria-label': t('agentsAria') }, active.map((agent) => h(AgentRow, { key: agent.id, t, agent, onAgent, onAgentMore: onAgent, onAgentChat: onChat }))) : h('div', { className: 'at-modalmeta' }, t('emptyColumn')),
|
|
2757
|
+
retired.length ? h('details', { className: 'at-archived' },
|
|
2758
|
+
h('summary', null, tf(t, 'talentPoolCount', { n: retired.length })),
|
|
2759
|
+
retired.map((agent) => h('div', { key: agent.id, className: 'at-agent at-talented' },
|
|
2760
|
+
h('div', { className: 'at-agentmeta' }, h('span', { className: 'at-agentname' }, agent.name)),
|
|
2761
|
+
h('button', { className: 'at-btn at-btn-small', type: 'button', onClick: () => onRecruit(agent) }, t('recruit'))))) : null) : null),
|
|
2762
|
+
h('section', { className: 'at-pane', 'aria-labelledby': 'at-team-presets' },
|
|
2763
|
+
h('h2', { id: 'at-team-presets', className: 'at-panetitle' }, t('teamPresets')),
|
|
2764
|
+
h('p', { className: 'at-modalmeta' }, t('teamPresetHint')),
|
|
2765
|
+
h('div', { className: 'at-tcpick' },
|
|
2766
|
+
h('button', { className: 'at-btn at-btn-small at-btn-accent', type: 'button', onClick: onCompose }, withIco('users', t('teamCompose'), 12)),
|
|
2767
|
+
h('button', { className: 'at-btn at-btn-small', type: 'button', onClick: onLoad }, withIco('sync', t('refresh'), 12)),
|
|
2768
|
+
selectedTeam?.source === 'user' ? h('button', { className: 'at-btn at-btn-small at-btn-danger', type: 'button', onClick: () => void onDelete(selectedTeam) }, withIco('close', t('teamDelete'), 12)) : null),
|
|
2769
|
+
error ? h('div', { className: 'at-modalerror', role: 'alert' }, error) : null,
|
|
2770
|
+
teams === null ? h('div', { className: 'at-modalmeta', role: 'status' }, t('talentLoading'))
|
|
2771
|
+
: teams.length ? h('label', { className: 'at-field' }, h('span', null, t('projectTeam')),
|
|
2772
|
+
h('select', { value: selectedTeam?.id ?? '', onChange: (event) => onSelectTeam(event.target.value) },
|
|
2773
|
+
teams.map((team) => h('option', { key: team.id, value: team.id }, team.name + ' · ' + team.members.length)))) : h('div', { className: 'at-modalmeta' }, t('teamNoPresets')),
|
|
2774
|
+
selectedTeam?.description ? h('p', { className: 'at-modalmeta' }, selectedTeam.description) : null,
|
|
2775
|
+
selectedTeam ? h('div', { className: 'at-marketgrid', role: 'list', 'aria-label': t('teamMembers') },
|
|
2776
|
+
selectedTeam.members.map((member) => h('div', { key: member.id, className: 'at-talent', role: 'listitem' },
|
|
2777
|
+
h(TalentInfo, { t, talent: member, lead: member.id === selectedTeam.lead })))) : null)));
|
|
2778
|
+
}
|
|
2779
|
+
|
|
2444
2780
|
function ConvertForm({ t, project, task, thread, title, dod, onTitle, onDod, onCancel, onSubmit }) {
|
|
2445
2781
|
const valid = Boolean(title.trim() && dod.trim());
|
|
2446
2782
|
const onKeyDown = (event) => {
|
|
@@ -2672,7 +3008,7 @@ window.__ModuleLoader__.load({
|
|
|
2672
3008
|
const [mention, setMention] = React.useState(null);
|
|
2673
3009
|
const [dragging, setDragging] = React.useState(false);
|
|
2674
3010
|
useFitTextarea(boxRef, draft);
|
|
2675
|
-
const candidates = mention === null ? [] : mentionCandidates(agents, mention.query);
|
|
3011
|
+
const candidates = mention === null || !onMode ? [] : mentionCandidates(agents, mention.query);
|
|
2676
3012
|
const track = (el) => {
|
|
2677
3013
|
const found = el ? mentionQuery(el.value, el.selectionStart ?? el.value.length) : null;
|
|
2678
3014
|
setMention(found === null ? null : { ...found, caret: el.selectionStart ?? el.value.length, index: 0 });
|
|
@@ -2772,9 +3108,9 @@ window.__ModuleLoader__.load({
|
|
|
2772
3108
|
onChange: (event) => onQaChecklist(event.target.value),
|
|
2773
3109
|
}) : null) : null,
|
|
2774
3110
|
h('div', { className: 'at-barrow' },
|
|
2775
|
-
h('div', { className: 'at-mode', role: 'group', 'aria-label': t('modeAria') },
|
|
3111
|
+
onMode ? h('div', { className: 'at-mode', role: 'group', 'aria-label': t('modeAria') },
|
|
2776
3112
|
h('button', { type: 'button', 'aria-pressed': mode === 'discuss', onClick: () => onMode('discuss') }, t('discuss')),
|
|
2777
|
-
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,
|
|
2778
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,
|
|
2779
3115
|
h('input', { ref: fileRef, type: 'file', multiple: true, hidden: true, onChange: (event) => { attach(event.target.files); event.target.value = ''; } }),
|
|
2780
3116
|
mode === 'task' ? h('label', { className: 'at-qacheck' },
|
|
@@ -2842,7 +3178,62 @@ window.__ModuleLoader__.load({
|
|
|
2842
3178
|
h('button', { className: 'at-qmore', type: 'button', disabled: count === 0, onClick: () => onViewAll(quadrant.key) }, t('viewAll'))));
|
|
2843
3179
|
}
|
|
2844
3180
|
|
|
2845
|
-
function
|
|
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 }) {
|
|
2846
3237
|
if (!quadrants) {
|
|
2847
3238
|
return h('div', { className: 'at-situation', role: 'tabpanel', id: 'at-panel-situation', 'aria-labelledby': 'at-tab-situation' },
|
|
2848
3239
|
h('div', { className: 'at-situationinner' },
|
|
@@ -2859,8 +3250,10 @@ window.__ModuleLoader__.load({
|
|
|
2859
3250
|
return h('div', { className: 'at-situation', role: 'tabpanel', id: 'at-panel-situation', 'aria-labelledby': 'at-tab-situation' },
|
|
2860
3251
|
h('div', { className: 'at-situationinner' },
|
|
2861
3252
|
h('div', { className: 'at-qmeta' },
|
|
2862
|
-
h('span', null, mood
|
|
2863
|
-
|
|
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')),
|
|
2864
3257
|
h('div', { className: 'at-quadrants' }, QUADRANTS.map((quadrant) => {
|
|
2865
3258
|
const block = quadrants[quadrant.key] ?? { count: 0, items: [] };
|
|
2866
3259
|
return h(QuadrantCard, {
|
|
@@ -3571,6 +3964,16 @@ window.__ModuleLoader__.load({
|
|
|
3571
3964
|
h(Ico, { name: 'down', size: 12 }), tf(t, 'streamUnseen', { count: unseen })));
|
|
3572
3965
|
}
|
|
3573
3966
|
|
|
3967
|
+
async function bootstrapResponseError(response, t) {
|
|
3968
|
+
const label = 'HTTP ' + response.status + ' for /ai-team/api/bootstrap';
|
|
3969
|
+
if (response.status !== 503) return new Error(label);
|
|
3970
|
+
let code;
|
|
3971
|
+
try { code = (await response.json())?.error?.code; } catch {}
|
|
3972
|
+
if (code === 'BOOT_FAILED') return new Error(label + ' (' + code + '). ' + t('bootFailure503'));
|
|
3973
|
+
if (code === 'E_TRUST_FENCE_UNAVAILABLE') return new Error(label + ' (' + code + '). ' + t('bootConnection503'));
|
|
3974
|
+
return new Error(label + '. ' + t('bootUnknown503'));
|
|
3975
|
+
}
|
|
3976
|
+
|
|
3574
3977
|
function Workbench({ t, ctx }) {
|
|
3575
3978
|
const [phase, setPhase] = React.useState('loading');
|
|
3576
3979
|
const [data, setData] = React.useState(null);
|
|
@@ -3580,7 +3983,7 @@ window.__ModuleLoader__.load({
|
|
|
3580
3983
|
const [tab, setTab] = React.useState('main');
|
|
3581
3984
|
const [selected, setSelected] = React.useState('');
|
|
3582
3985
|
const [threadOpen, setThreadOpen] = React.useState(false);
|
|
3583
|
-
const [
|
|
3986
|
+
const [draftMode, setMode] = React.useState('discuss');
|
|
3584
3987
|
const [qaTask, setQaTask] = React.useState(false);
|
|
3585
3988
|
const [taskDefinition, setTaskDefinition] = React.useState('');
|
|
3586
3989
|
const [qaChecklistText, setQaChecklistText] = React.useState('');
|
|
@@ -3650,7 +4053,10 @@ window.__ModuleLoader__.load({
|
|
|
3650
4053
|
const [nTeam, setNTeam] = React.useState('');
|
|
3651
4054
|
const [teamLoadError, setTeamLoadError] = React.useState('');
|
|
3652
4055
|
const [teamComposeOpen, setTeamComposeOpen] = React.useState(false);
|
|
3653
|
-
const
|
|
4056
|
+
const [teamSwitching, setTeamSwitching] = React.useState(false);
|
|
4057
|
+
const projectSwitchRef = React.useRef(false);
|
|
4058
|
+
const teamLoadSeqRef = React.useRef(0);
|
|
4059
|
+
const selectedTeam = (teamList || []).find((entry) => !entry.broken && entry.id === nTeam) || null;
|
|
3654
4060
|
const [workspaceOpen, setWorkspaceOpen] = React.useState(false);
|
|
3655
4061
|
const [workspaceDraft, setWorkspaceDraft] = React.useState('');
|
|
3656
4062
|
const [workspaceError, setWorkspaceError] = React.useState('');
|
|
@@ -3711,6 +4117,12 @@ window.__ModuleLoader__.load({
|
|
|
3711
4117
|
const sendingRef = React.useRef(false);
|
|
3712
4118
|
scopeRef.current = scope;
|
|
3713
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);
|
|
3714
4126
|
const [nError, setNError] = React.useState('');
|
|
3715
4127
|
const [pSuccessor, setPSuccessor] = React.useState('');
|
|
3716
4128
|
const [pBusy, setPBusy] = React.useState(false);
|
|
@@ -3802,7 +4214,7 @@ window.__ModuleLoader__.load({
|
|
|
3802
4214
|
headers: { accept: 'application/json' },
|
|
3803
4215
|
signal: controller ? controller.signal : undefined,
|
|
3804
4216
|
});
|
|
3805
|
-
if (!response.ok) throw
|
|
4217
|
+
if (!response.ok) throw await bootstrapResponseError(response, t);
|
|
3806
4218
|
const next = normalizePayload(await response.json());
|
|
3807
4219
|
if (!next) throw new Error('invalid bootstrap payload');
|
|
3808
4220
|
if (!alive || seq !== loadSeqRef.current) return;
|
|
@@ -4027,8 +4439,15 @@ window.__ModuleLoader__.load({
|
|
|
4027
4439
|
...projectRecord,
|
|
4028
4440
|
workspacePath: projectRecord.workspacePath || (data.project?.id === projectRecord.id ? data.project.workspacePath ?? '' : ''),
|
|
4029
4441
|
};
|
|
4442
|
+
const blueprintProgress = data.project?.id === project?.id ? data.blueprint ?? null : null;
|
|
4443
|
+
const mode = blueprintProgress ? 'discuss' : draftMode;
|
|
4030
4444
|
const humanId = (data.members ?? []).find((member) => member.kind === 'human')?.id ?? null;
|
|
4031
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];
|
|
4032
4451
|
const boardTaskCount = tasks.filter((task) => ['pending', 'in_progress', 'pending_acceptance', 'done'].includes(task.status)).length;
|
|
4033
4452
|
const selectedTask = tasks.find((task) => task.id === selected) ?? tasks[0] ?? null;
|
|
4034
4453
|
const thread = threadFor(data, selectedTask?.id);
|
|
@@ -4218,7 +4637,7 @@ window.__ModuleLoader__.load({
|
|
|
4218
4637
|
setBoardFilter(key);
|
|
4219
4638
|
setTab('board');
|
|
4220
4639
|
setNote('');
|
|
4221
|
-
if (key === 'q4') setDoneOpen(true);
|
|
4640
|
+
if (key === 'q4' || key === 'done') setDoneOpen(true);
|
|
4222
4641
|
}
|
|
4223
4642
|
function goConversation() {
|
|
4224
4643
|
closeMobile();
|
|
@@ -4241,6 +4660,18 @@ window.__ModuleLoader__.load({
|
|
|
4241
4660
|
loadPending();
|
|
4242
4661
|
loadRisks();
|
|
4243
4662
|
}
|
|
4663
|
+
function openTeam() {
|
|
4664
|
+
closeMobile();
|
|
4665
|
+
setMemberViewId(null);
|
|
4666
|
+
setScope('team');
|
|
4667
|
+
setThreadOpen(false);
|
|
4668
|
+
setNote('');
|
|
4669
|
+
void loadTeams(nTeam);
|
|
4670
|
+
}
|
|
4671
|
+
function openTeamComposer() {
|
|
4672
|
+
setTeamComposeOpen(true);
|
|
4673
|
+
void loadTalents();
|
|
4674
|
+
}
|
|
4244
4675
|
function openPeople() {
|
|
4245
4676
|
closeMobile();
|
|
4246
4677
|
setMemberViewId(null);
|
|
@@ -4275,12 +4706,15 @@ window.__ModuleLoader__.load({
|
|
|
4275
4706
|
setBoardFilter('all');
|
|
4276
4707
|
setNote('');
|
|
4277
4708
|
}
|
|
4278
|
-
async function switchProject(next) {
|
|
4709
|
+
async function switchProject(next, nextScope = 'project') {
|
|
4279
4710
|
closeMobile();
|
|
4280
|
-
if (next.id === projectId && scope ===
|
|
4711
|
+
if (next.id === projectId && scope === nextScope) return true;
|
|
4712
|
+
if (projectSwitchRef.current) return false;
|
|
4713
|
+
projectSwitchRef.current = true;
|
|
4714
|
+
if (nextScope === 'team') setTeamSwitching(true);
|
|
4281
4715
|
try {
|
|
4282
|
-
await runCommand('project.activate', { projectId: next.id });
|
|
4283
|
-
|
|
4716
|
+
await runCommand('project.activate', { projectId: next.id }, projectId || next.id);
|
|
4717
|
+
if (nextScope !== 'team' || scopeRef.current === 'team') setScope(nextScope);
|
|
4284
4718
|
setTab('main');
|
|
4285
4719
|
setMemberViewId(null);
|
|
4286
4720
|
setBoardFilter('all');
|
|
@@ -4293,6 +4727,9 @@ window.__ModuleLoader__.load({
|
|
|
4293
4727
|
} catch (error) {
|
|
4294
4728
|
say(tf(t, 'sendFailed', { message: error?.message ?? String(error) }));
|
|
4295
4729
|
return false;
|
|
4730
|
+
} finally {
|
|
4731
|
+
projectSwitchRef.current = false;
|
|
4732
|
+
if (nextScope === 'team') setTeamSwitching(false);
|
|
4296
4733
|
}
|
|
4297
4734
|
}
|
|
4298
4735
|
function openNewProject() {
|
|
@@ -4303,6 +4740,9 @@ window.__ModuleLoader__.load({
|
|
|
4303
4740
|
setNWorkspace(data?.defaultWorkspace ?? '');
|
|
4304
4741
|
setNError('');
|
|
4305
4742
|
setNTeam('');
|
|
4743
|
+
setNBlueprintMode(false);
|
|
4744
|
+
setNIntake(emptyBlueprintIntake());
|
|
4745
|
+
setBlueprintPreview(null);
|
|
4306
4746
|
setTeamComposeOpen(false);
|
|
4307
4747
|
void loadTeams();
|
|
4308
4748
|
setNewOpen(true);
|
|
@@ -4370,19 +4810,26 @@ window.__ModuleLoader__.load({
|
|
|
4370
4810
|
}
|
|
4371
4811
|
/** 每次打开新建项目现取团队列表:刚组的队、刚改的 team.yml 立刻可选。select 留空表示沿用设置里的默认团队。 */
|
|
4372
4812
|
async function loadTeams(select) {
|
|
4813
|
+
const seq = ++teamLoadSeqRef.current;
|
|
4373
4814
|
setTeamLoadError('');
|
|
4374
4815
|
try {
|
|
4375
4816
|
const response = await fetch('/ai-team/api/teams', { headers: { accept: 'application/json' } });
|
|
4376
4817
|
const body = await response.json().catch(() => null);
|
|
4377
4818
|
if (!response.ok) throw new Error((body && body.error && body.error.message) || ('HTTP ' + response.status));
|
|
4819
|
+
if (seq !== teamLoadSeqRef.current) return;
|
|
4378
4820
|
setTeamList(Array.isArray(body && body.teams) ? body.teams : []);
|
|
4379
|
-
|
|
4821
|
+
setBlueprintOptions(Array.isArray(body?.blueprintUseCases) ? body.blueprintUseCases : []);
|
|
4822
|
+
const available = Array.isArray(body?.teams) ? body.teams.filter((entry) => !entry.broken) : [];
|
|
4823
|
+
const wanted = select || body?.defaultTeam || 'default';
|
|
4824
|
+
setNTeam(available.some((team) => team.id === wanted) ? wanted : available[0]?.id ?? '');
|
|
4380
4825
|
} catch (error) {
|
|
4826
|
+
if (seq !== teamLoadSeqRef.current) return;
|
|
4381
4827
|
setTeamList([]);
|
|
4382
4828
|
setTeamLoadError(tf(t, 'teamLoadFailed', { error: (error && error.message) || String(error) }));
|
|
4383
4829
|
}
|
|
4384
4830
|
}
|
|
4385
|
-
async function removeTeam(team) {
|
|
4831
|
+
async function removeTeam(team, onError = setNError) {
|
|
4832
|
+
if (team.source !== 'user') return;
|
|
4386
4833
|
if (!(await askConfirm(t('teamDelete'), tf(t, 'teamDeleteConfirm', { name: team.name })))) return;
|
|
4387
4834
|
try {
|
|
4388
4835
|
const response = await fetch('/ai-team/api/teams/delete', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ id: team.id }) });
|
|
@@ -4390,25 +4837,45 @@ window.__ModuleLoader__.load({
|
|
|
4390
4837
|
if (!response.ok) throw new Error((body && body.error && body.error.message) || ('HTTP ' + response.status));
|
|
4391
4838
|
await loadTeams();
|
|
4392
4839
|
} catch (error) {
|
|
4393
|
-
|
|
4840
|
+
onError((error && error.message) || String(error));
|
|
4394
4841
|
}
|
|
4395
4842
|
}
|
|
4396
4843
|
async function createProject() {
|
|
4397
|
-
if (!nName.trim() || !nWorkspace.trim() ||
|
|
4844
|
+
if (!nName.trim() || !nWorkspace.trim() || newProjectBusy.current) return;
|
|
4845
|
+
newProjectBusy.current = true;
|
|
4398
4846
|
setNBusy(true);
|
|
4399
4847
|
setNError('');
|
|
4400
4848
|
try {
|
|
4401
|
-
const
|
|
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);
|
|
4402
4866
|
const next = result.project;
|
|
4403
4867
|
setNewOpen(false);
|
|
4404
4868
|
setScope('project');
|
|
4405
4869
|
setTab('main');
|
|
4870
|
+
setMode('discuss');
|
|
4406
4871
|
await reloadData(next.id);
|
|
4407
4872
|
setProjectId(next.id);
|
|
4873
|
+
if (nBlueprintMode) setBlueprintOpen(next.id);
|
|
4408
4874
|
say(tf(t, 'projectCreated', { name: next.name }));
|
|
4409
4875
|
} catch (error) {
|
|
4410
4876
|
setNError(error?.message ?? String(error));
|
|
4411
4877
|
} finally {
|
|
4878
|
+
newProjectBusy.current = false;
|
|
4412
4879
|
setNBusy(false);
|
|
4413
4880
|
}
|
|
4414
4881
|
}
|
|
@@ -4683,6 +5150,11 @@ window.__ModuleLoader__.load({
|
|
|
4683
5150
|
}
|
|
4684
5151
|
async function openAgentChat(agent) {
|
|
4685
5152
|
closeMobile();
|
|
5153
|
+
if (blueprintProgress && agent.duty !== 'lead') {
|
|
5154
|
+
say(t('blueprintLeadContact'));
|
|
5155
|
+
openProfile(agent);
|
|
5156
|
+
return;
|
|
5157
|
+
}
|
|
4686
5158
|
const service = ctx?.get?.('uiWorkspace') ?? ctx?.uiWorkspace;
|
|
4687
5159
|
if (service?.openSession === undefined) {
|
|
4688
5160
|
say(t('agentChatUnavailable'));
|
|
@@ -5251,12 +5723,14 @@ window.__ModuleLoader__.load({
|
|
|
5251
5723
|
|
|
5252
5724
|
const inInbox = scope === 'inbox';
|
|
5253
5725
|
const inPeople = scope === 'people';
|
|
5726
|
+
const inTeam = scope === 'team';
|
|
5727
|
+
const teamProject = project && project.id === projectId && data.project?.id === projectId && !project.archived ? project : null;
|
|
5254
5728
|
const memberViewAgent = data.agents.find((agent) => agent.id === memberViewId) ?? null;
|
|
5255
5729
|
const memberViewTasks = memberViewAgent === null ? [] : tasks.filter((task) => task.ownerId === memberViewAgent.id || task.assigneeId === memberViewAgent.id);
|
|
5256
|
-
const headerTitle = inPeople ? t('peopleTitle') : inInbox ? t('inboxTitle') : project ? '# ' + project.name : t('noProject');
|
|
5730
|
+
const headerTitle = inTeam ? t('teamManagement') : inPeople ? t('peopleTitle') : inInbox ? t('inboxTitle') : project ? '# ' + project.name : t('noProject');
|
|
5257
5731
|
// 只拿到名字的地方(消息、人员池、批量配置)按这张表找成员的头像参数。
|
|
5258
5732
|
rememberAvatars(data?.agents, talents);
|
|
5259
|
-
const headerGoal = inPeople ? t('peopleGoal') : inInbox ? t('inboxGoal') : (project?.goal ?? '');
|
|
5733
|
+
const headerGoal = inTeam ? t('teamManageGoal') : inPeople ? t('peopleGoal') : inInbox ? t('inboxGoal') : (project?.goal ?? '');
|
|
5260
5734
|
const unread = inboxUnread > 99 ? '99+' : inboxUnread;
|
|
5261
5735
|
|
|
5262
5736
|
const leftProps = {
|
|
@@ -5270,6 +5744,7 @@ window.__ModuleLoader__.load({
|
|
|
5270
5744
|
onInbox: switchInbox,
|
|
5271
5745
|
onBoard: switchBoard,
|
|
5272
5746
|
onPeople: openPeople,
|
|
5747
|
+
onTeam: openTeam,
|
|
5273
5748
|
peopleActive: scope === 'people',
|
|
5274
5749
|
onProject: switchProject,
|
|
5275
5750
|
onNewProject: () => { closeMobile(); openNewProject(); },
|
|
@@ -5280,7 +5755,15 @@ window.__ModuleLoader__.load({
|
|
|
5280
5755
|
onRecruit: (agent) => { closeMobile(); recruit(agent); },
|
|
5281
5756
|
};
|
|
5282
5757
|
|
|
5283
|
-
const body =
|
|
5758
|
+
const body = inTeam
|
|
5759
|
+
? h(TeamManagementPage, {
|
|
5760
|
+
t, project: teamProject, projects: data.projects.filter((entry) => !entry.archived), agents: teamProject ? data.agents : [],
|
|
5761
|
+
switching: teamSwitching, onProject: (next) => switchProject(next, 'team'),
|
|
5762
|
+
onAdd: openAddAgent, onAgent: openProfile, onChat: openAgentChat, onRecruit: recruit,
|
|
5763
|
+
teams: teamList?.filter((entry) => !entry.broken) ?? null, selectedTeam, error: teamLoadError, onSelectTeam: setNTeam,
|
|
5764
|
+
onLoad: () => void loadTeams(nTeam), onCompose: openTeamComposer, onDelete: (team) => removeTeam(team, setTeamLoadError),
|
|
5765
|
+
})
|
|
5766
|
+
: inPeople
|
|
5284
5767
|
? h(PeoplePage, {
|
|
5285
5768
|
t,
|
|
5286
5769
|
people: peopleData,
|
|
@@ -5426,10 +5909,11 @@ window.__ModuleLoader__.load({
|
|
|
5426
5909
|
humanId,
|
|
5427
5910
|
})
|
|
5428
5911
|
: tab === 'situation'
|
|
5429
|
-
? h(Situation, { t, quadrants, tasks,
|
|
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 })
|
|
5430
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 },
|
|
5431
5915
|
h('div', { className: 'at-streaminner', role: 'log', 'aria-live': 'polite', 'aria-label': t('streamAria') },
|
|
5432
|
-
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 }),
|
|
5433
5917
|
data.stream.length
|
|
5434
5918
|
? data.stream.map((item) => h(StreamMessage, {
|
|
5435
5919
|
key: item.id,
|
|
@@ -5462,7 +5946,7 @@ window.__ModuleLoader__.load({
|
|
|
5462
5946
|
h('details', { className: 'at-mobile', ref: mobileRef },
|
|
5463
5947
|
h('summary', { className: 'at-mobilesummary', 'aria-label': t('menuAria') }, h(Ico, { name: 'menu', size: 14 }), h('span', null, t('menu'))),
|
|
5464
5948
|
h('div', { className: 'at-mobilepop' }, h(LeftPanel, leftProps))),
|
|
5465
|
-
h('span', { className: 'at-topproject', title: headerTitle }, inInbox ? t('inboxTitle') + (unread ? ' · ' + unread : '') : (project?.name ?? ''))),
|
|
5949
|
+
h('span', { className: 'at-topproject', title: headerTitle }, inInbox ? t('inboxTitle') + (unread ? ' · ' + unread : '') : inTeam ? t('teamManagement') : (project?.name ?? ''))),
|
|
5466
5950
|
h(ToastStack, { t, toasts, onClose: (id) => setToasts((prev) => prev.filter((toast) => toast.id !== id)) }),
|
|
5467
5951
|
h('div', { className: cx('at-grid', threadOpen && selectedTask && 'at-withthread') },
|
|
5468
5952
|
h('aside', { className: 'at-left', role: 'region', 'aria-label': t('projectsAria') }, h(LeftPanel, leftProps)),
|
|
@@ -5470,14 +5954,14 @@ window.__ModuleLoader__.load({
|
|
|
5470
5954
|
h('header', { className: 'at-chead' },
|
|
5471
5955
|
h('div', { className: 'at-title', title: headerTitle }, headerTitle),
|
|
5472
5956
|
headerGoal ? h('div', { className: 'at-goal', title: headerGoal }, headerGoal) : null,
|
|
5473
|
-
!inInbox && !inPeople && project ? h('div', { className: 'at-workspacebar' },
|
|
5957
|
+
!inInbox && !inPeople && !inTeam && project ? h('div', { className: 'at-workspacebar' },
|
|
5474
5958
|
h('span', { className: 'at-workspacepath', title: project.workspacePath || t('workspaceHint') },
|
|
5475
5959
|
project.workspacePath ? t('workspace') + ':' + project.workspacePath : t('workspaceUnset')),
|
|
5476
5960
|
h('button', { className: 'at-workspacebtn', type: 'button', onClick: openWorkspaceEditor }, project.workspacePath ? t('workspaceChange') : t('workspaceChoose')),
|
|
5477
5961
|
h('button', {
|
|
5478
5962
|
className: cx('at-pmobtn', project.pmoAuto !== false && 'at-pmo-on'),
|
|
5479
5963
|
type: 'button',
|
|
5480
|
-
title: t('pmoHint'),
|
|
5964
|
+
title: t(blueprintProgress ? 'blueprintPmoHint' : 'pmoHint'),
|
|
5481
5965
|
'aria-pressed': project.pmoAuto !== false,
|
|
5482
5966
|
onClick: togglePmo,
|
|
5483
5967
|
}, project.pmoAuto !== false ? t('pmoOn') : t('pmoOff')),
|
|
@@ -5500,7 +5984,7 @@ window.__ModuleLoader__.load({
|
|
|
5500
5984
|
title: t('archiveHint'),
|
|
5501
5985
|
onClick: () => { void archiveCurrentProject(); },
|
|
5502
5986
|
}, t('archiveProject'))) : null,
|
|
5503
|
-
inInbox || inPeople ? null : h('div', { className: 'at-tabs', role: 'tablist', 'aria-label': t('tabsAria'), onKeyDown: tabKeyDown },
|
|
5987
|
+
inInbox || inPeople || inTeam ? null : h('div', { className: 'at-tabs', role: 'tablist', 'aria-label': t('tabsAria'), onKeyDown: tabKeyDown },
|
|
5504
5988
|
h('button', {
|
|
5505
5989
|
className: cx('at-tab', tab === 'main' && 'at-on'),
|
|
5506
5990
|
type: 'button',
|
|
@@ -5534,6 +6018,11 @@ window.__ModuleLoader__.load({
|
|
|
5534
6018
|
tabIndex: tab === 'situation' ? 0 : -1,
|
|
5535
6019
|
onClick: () => selectTab('situation'),
|
|
5536
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,
|
|
5537
6026
|
note ? h('div', { className: 'at-notewrap' },
|
|
5538
6027
|
h('div', { className: 'at-note', role: 'status' },
|
|
5539
6028
|
h('span', { className: 'at-notetext' }, note),
|
|
@@ -5552,7 +6041,7 @@ window.__ModuleLoader__.load({
|
|
|
5552
6041
|
onQaRequired: setQaTask,
|
|
5553
6042
|
onDefinition: setTaskDefinition,
|
|
5554
6043
|
onQaChecklist: setQaChecklistText,
|
|
5555
|
-
onMode: setMode,
|
|
6044
|
+
onMode: blueprintProgress ? null : setMode,
|
|
5556
6045
|
onDraft: setDraft,
|
|
5557
6046
|
onSend: send,
|
|
5558
6047
|
inputRef: composerInputRef,
|
|
@@ -5793,9 +6282,9 @@ window.__ModuleLoader__.load({
|
|
|
5793
6282
|
h('div', { className: 'at-modalactions' },
|
|
5794
6283
|
h('button', { className: 'at-btn', type: 'button', onClick: () => setWorkspaceOpen(false), disabled: workspaceBusy }, t('cancel')),
|
|
5795
6284
|
h('button', { className: 'at-btn at-btn-primary', type: 'submit', disabled: workspaceBusy || !workspaceDraft.trim() }, workspaceBusy ? t('saving') : t('workspaceSave'))))) : null,
|
|
5796
|
-
newOpen ? h(ModalBack, { onClose: () => setNewOpen(false) },
|
|
6285
|
+
newOpen ? h(ModalBack, { onClose: () => { if (!newProjectBusy.current) setNewOpen(false); } },
|
|
5797
6286
|
h('form', {
|
|
5798
|
-
className: 'at-modal at-modal-wide',
|
|
6287
|
+
className: cx('at-modal at-modal-wide', nBlueprintMode && 'at-blueprint-setup'),
|
|
5799
6288
|
role: 'dialog',
|
|
5800
6289
|
'aria-modal': 'true',
|
|
5801
6290
|
'aria-label': t('newProjectTitle'),
|
|
@@ -5804,31 +6293,44 @@ window.__ModuleLoader__.load({
|
|
|
5804
6293
|
h('h2', { className: 'at-modaltitle' }, withIco('folderPlus', t('newProjectTitle'), 16)),
|
|
5805
6294
|
h('div', { className: 'at-modalactions' },
|
|
5806
6295
|
h('button', { className: 'at-btn', type: 'button', onClick: () => setNewOpen(false), disabled: nBusy }, withIco('close', t('cancel'))),
|
|
5807
|
-
h('button', { className: 'at-btn
|
|
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')))),
|
|
5808
6299
|
nError ? h('div', { className: 'at-modalerror', role: 'alert' }, nError) : null,
|
|
5809
|
-
h('div', { className: 'at-
|
|
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' },
|
|
5810
6304
|
h('div', { className: 'at-pane' },
|
|
5811
6305
|
h('label', { className: 'at-field' }, h('span', null, t('projectName')),
|
|
5812
6306
|
h('input', { value: nName, onChange: (event) => setNName(event.target.value), autoFocus: true })),
|
|
5813
|
-
h('label', { className: 'at-field' }, h('span', null, t('projectGoal')),
|
|
5814
|
-
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) })),
|
|
5815
6309
|
h('label', { className: 'at-field' }, h('span', null, t('workspace')),
|
|
5816
6310
|
h('div', { className: 'at-inlineadd' },
|
|
5817
6311
|
h('input', { value: nWorkspace, onChange: (event) => setNWorkspace(event.target.value), placeholder: data?.workspaceExample ?? t('workspacePathPlaceholder') }),
|
|
5818
6312
|
h('button', { className: 'at-btn at-btn-small', type: 'button', onClick: pickNewWorkspace }, withIco('folderPlus', t('workspaceChoose'), 12)))),
|
|
5819
|
-
h('label', { className: 'at-field' }, h('span', null, t('projectTeam')),
|
|
6313
|
+
nBlueprintMode ? null : h('label', { className: 'at-field' }, h('span', null, t('projectTeam')),
|
|
5820
6314
|
teamList === null ? h('div', { className: 'at-modalmeta' }, t('talentLoading'))
|
|
5821
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') : ''))))),
|
|
5822
6316
|
teamLoadError ? h('div', { className: 'at-modalerror', role: 'alert' }, teamLoadError) : null,
|
|
5823
|
-
h('div', { className: 'at-tcpick' },
|
|
5824
|
-
h('button', { className: 'at-btn at-btn-small at-btn-accent', type: 'button', onClick:
|
|
6317
|
+
nBlueprintMode ? null : h('div', { className: 'at-tcpick' },
|
|
6318
|
+
h('button', { className: 'at-btn at-btn-small at-btn-accent', type: 'button', onClick: openTeamComposer }, withIco('users', t('teamCompose'), 12)),
|
|
5825
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)),
|
|
5826
6320
|
// 右栏:选中团队的成员卡片(名字、岗位、职责、简介、技能;负责人标出来)。
|
|
5827
|
-
h('div', { className: 'at-pane' },
|
|
6321
|
+
nBlueprintMode ? h(BlueprintIntake, { t, intake: nIntake, onChange: setNIntake, useCases: blueprintOptions }) : h('div', { className: 'at-pane' },
|
|
5828
6322
|
selectedTeam ? h('div', { className: 'at-panetitle', title: teamMembersLine(selectedTeam) }, selectedTeam.name + ' · ' + tf(t, 'projectTeamMembers', { n: selectedTeam.members.length })) : null,
|
|
5829
6323
|
selectedTeam && selectedTeam.description ? h('div', { className: 'at-modalmeta' }, selectedTeam.description) : null,
|
|
5830
6324
|
selectedTeam ? h('div', { className: 'at-marketgrid', role: 'list' }, selectedTeam.members.map((member) => h('div', { key: member.id, className: 'at-talent', role: 'listitem' },
|
|
5831
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,
|
|
5832
6334
|
teamComposeOpen ? h(ModalBack, { onClose: () => setTeamComposeOpen(false) },
|
|
5833
6335
|
h('div', { className: 'at-modal at-modal-wide', role: 'dialog', 'aria-modal': 'true', 'aria-label': t('teamComposeTitle') },
|
|
5834
6336
|
h('h2', { className: 'at-modaltitle' }, withIco('users', t('teamComposeTitle'), 16)),
|