@suifei/dsh-ai-team 0.4.130 → 0.4.132

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 CHANGED
@@ -1,5 +1,34 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.132 - 2026-11-18
4
+
5
+ **弹窗与人员池排版:按钮固定在右上角、成员资料分页签、团队成员卡片、组队三栏、批量配置模型**
6
+
7
+ - **所有弹窗**:标题栏固定在顶部,功能按钮放在右上角;内容再长也不用滚到底找按钮。人才市场、新建人才、组队这些嵌在弹窗里的页也把按钮交给标题栏。
8
+ - **成员资料**:仿系统设置分「资料 / 模型 / 技能 / 协作」四个页签;模型页按三列排(运行配方、Max tokens / 提供商、模型、推理等级);
9
+ 备忘放进可滚动的框,不再把整段长文铺满。右上角按钮按用途分组并用图标和颜色区分:去看(任务、对话)、复用(复制成员、存为人才,蓝)、
10
+ 会话维护(重试、重置会话、重新蒸馏,黄)、离开团队(红)、取消 / 保存。
11
+ - **新建项目**:左边填表,右边展示所选团队每位成员的卡片(名字、岗位、职责、简介、技能,负责人标出)。`/api/teams` 的成员多带 `description` / `category` / `skills`。
12
+ - **组队**:三栏——左边人才列表(搜索、点选,双击直接加入),中间是选中人才的简介卡片与「加入」,右边是已组的成员(改名、定负责人、移除)。
13
+ - **人员池**:改成成员卡片;顶部「批量配置模型」一次给勾选的多位成员(在其所在的全部项目)设同一模型,卡片上的「配置模型」只勾这一位,
14
+ 走同一个弹窗(提供商 / 模型 / 推理等级三列 + 成员勾选);成员资料里的单独设置照旧。页头说明不再误写「还没有成员」。
15
+ - **人才卡片**:标签一行、按钮一行靠右,不再挤成两行;在线库状态与同步结果并到一行。
16
+ - 测试:`test/catalog.test.js` 补团队成员卡片字段;全量 428。实机截图核对(无头 Edge + CDP,`r52`)。
17
+
18
+ ## 0.4.131 - 2026-11-18
19
+
20
+ **在线人才库走 npmmirror 整包;内容型弹窗放大到 90%,补单色图标**
21
+
22
+ - 实机发现:npmmirror 的按文件接口只对白名单包开放(`cnpm/unpkg-white-list`),`@suifei/dsh-ai-team-catalog` 的 `/files/index.json` 返回 403,
23
+ 0.4.130 的「同步在线库」实际每次都退到 jsDelivr(本机 `current.json` 记的是 `mirror: jsdelivr`,单次约 20 秒)。
24
+ - **registry 型镜像改为下整包**:npmmirror、npmjs 与私有源(`DSH_AI_TEAM_CATALOG_MIRROR`)按 `<源>/<包>/<版本>` 取 `dist.tarball` 与 `dist.integrity`,
25
+ 下载 tgz 后先核对 sha512 integrity,再在内存里解 tar(ustar + pax 长路径),之后照旧逐文件核对 `index.json` 的大小与 sha256。不需要白名单。
26
+ jsDelivr 仍按文件取,作为第二个镜像;npmjs 官方源作为第三个。镜像顺序:npmmirror → jsDelivr → npmjs。
27
+ 真实镜像实测(`r51`):npmmirror 0.6 秒、jsDelivr 21 秒、npmjs 1.7 秒,均同步 91 个文件。
28
+ - **弹窗**:添加成员 / 人才市场、成员资料、新建项目、组队四个内容型弹窗改为插件页面的 90% 宽高(底部按钮贴底);确认框、工作区路径、快捷键等小弹窗保持紧凑。
29
+ - **图标**:沿用插件现有的单色线性图标(随文字颜色),补同步、退回、复制、招聘、在线、已改、自建、进化、人才市场、组队、新建项目等图标,用在弹窗标题、页签、按钮与标签上。
30
+ - 测试:`test/catalog-sync.test.js` 的假镜像改为 registry(latest / manifest / tgz)+ CDN 两种形态;新增整包 integrity 不符换 CDN、pax 长路径解包。
31
+
3
32
  ## 0.4.130 - 2026-11-18
4
33
 
5
34
  **人才市场(第 3 步):官方在线人才库同步**
package/README.md CHANGED
@@ -35,7 +35,7 @@
35
35
  - **存为人才**:成员资料「存为人才」把项目里这位成员此刻的岗位、职责、性格、模型与技能存成可复用的人才(技能按成员实际读取的路径拷进人才文件夹,找不到正文的会提示),换个项目照样招。新建与存为都不会静默覆盖已有人才,撞名自动加序号。
36
36
  - **组队、建项目选团队**:「新建项目」里选团队(内置或自建),按它种成员、负责人当主理人;「组一个新团队」从人才里挑人(同一人才可招多位)、指定负责人即可保存。插件设置 `teamPreset` 只是不选时的默认值。
37
37
  - **改内置人才、进化技能**:内置人才点「复制为可编辑」得到同 id 的副本(随时「恢复内置」);成员资料里技能旁的「进化」会让该成员用 SkillOpt 优化那份技能——内置的先自动复制,插件里的原文件不动。
38
- - **在线人才库同步**:人才市场顶部「同步在线库」从官方在线人才库 [`@suifei/dsh-ai-team-catalog`](https://www.npmjs.com/package/@suifei/dsh-ai-team-catalog)(npmmirror → jsDelivr)取最新的人才与团队,按 `index.json` 逐文件核对 sha256 后整体替换,落到 `~/.dsh/ai-team/catalog/official/<版本>/`;失败不动现有的。优先级:自建 > 在线 > 内置(插件升级后内置版本更高的人才用内置)。「退回内置」删掉本机在线库。内网可设环境变量 `DSH_AI_TEAM_CATALOG_MIRROR` 指向 npmmirror 同形的私有源。在线人才同样只读,可「复制为可编辑」。
38
+ - **在线人才库同步**:人才市场顶部「同步在线库」从官方在线人才库 [`@suifei/dsh-ai-team-catalog`](https://www.npmjs.com/package/@suifei/dsh-ai-team-catalog)(npmmirror → jsDelivr → npmjs;registry 下整包核对 integrity)取最新的人才与团队,按 `index.json` 逐文件核对 sha256 后整体替换,落到 `~/.dsh/ai-team/catalog/official/<版本>/`;失败不动现有的。优先级:自建 > 在线 > 内置(插件升级后内置版本更高的人才用内置)。「退回内置」删掉本机在线库。内网可设环境变量 `DSH_AI_TEAM_CATALOG_MIRROR` 指向 npmmirror 同形的私有源。在线人才同样只读,可「复制为可编辑」。
39
39
  - 成员在账本里记下来源人才与版本、职责;人才文件之后再改,不会悄悄改动已招成员的性格与职责。已有项目不受新团队影响。文件写坏时跳过它并在诊断日志记 `catalog.load.fail` / `catalog.team.fail`。
40
40
 
41
41
  ---
package/client.js CHANGED
@@ -308,6 +308,9 @@ window.__ModuleLoader__.load({
308
308
  talentLoadFailed: '人才市场读取失败:{error}',
309
309
  talentSkills: '技能:{skills}',
310
310
  talentUser: '自建',
311
+ profileTabBasic: '资料', profileTabModel: '模型', profileTabSkills: '技能', profileTabCollab: '协作', profileNotes: '备忘',
312
+ teamPickDetail: '人才简介', teamPickDetailEmpty: '在左边点一位人才,这里看简介;点「加入」放进右边的团队。', teamLeadMark: '负责人', projectTeamMembers: '团队成员 · {n} 位',
313
+ peopleModelBatch: '批量配置模型', peopleModelTitle: '配置模型', peopleModelHint: '选中的成员在其所在的全部项目里改用这个模型;之后仍可在成员资料里单独改。', peopleModelPick: '应用到 {n} 位', peopleModelAll: '全选', peopleModelNone: '全不选', peopleModelApply: '应用', peopleModelNeed: '先选模型', peopleModelDone: '已为 {people} 位成员配置 {model}(成功 {done} 处,失败 {failed} 处)。',
311
314
  talentOfficial: '在线', catalogNone: '在线人才库:未同步(当前用插件内置)', catalogAt: '在线人才库:v{version} · {time} 同步', catalogSync: '同步在线库', catalogSyncing: '同步中…', catalogSyncHint: '从官方在线人才库(npmmirror / jsDelivr)取最新的人才与团队;逐文件校验,失败不影响现有的。你自建或改过的人才不受影响。', catalogUpdated: '已同步到 v{version}({files} 个文件)。', catalogLatest: '已是最新 v{version}。', catalogFailed: '同步失败:{error}', catalogClear: '退回内置', catalogClearConfirm: '删掉本机的在线人才库,退回插件内置版本?你自建或改过的人才不受影响。',
312
315
  talentFork: '复制为可编辑', talentForkHint: '把这位内置人才复制成你自己的副本(同名遮盖内置),之后可装技能、进化技能;已招的成员下次激活就用副本。', talentForked: '已改', talentRestore: '恢复内置', talentRestoreConfirm: '删掉「{name}」的可编辑副本,恢复内置版?副本里装的、进化过的技能都会丢弃。', skillEvolve: '进化', skillEvolveHint: '让这位成员用 SkillOpt 优化这份技能:诊断最弱一维、改写、评审官盲评,好就保留,不好回退。', skillEvolveSent: '已私信 {name} 进化技能「{skill}」。', skillEvolveForked: '内置人才「{talent}」已复制为可编辑副本,并已私信 {name} 进化技能「{skill}」。', skillEvolveFailed: '技能进化没发出去:{error}',
313
316
  talentHint: '挑一位人才预填表单,改名、换模型后再招进项目;自建人才放在 ~/.dsh/ai-team/catalog/user/talents/。',
@@ -408,6 +411,7 @@ window.__ModuleLoader__.load({
408
411
  people: '人员',
409
412
  peopleTitle: '人员池',
410
413
  peopleEmpty: '还没有成员;先在项目里添加。',
414
+ peopleGoal: '按人汇总各项目里的成员:看负载、配置模型、跳到所在项目。',
411
415
  peopleProjects: '{n} 个项目',
412
416
  refresh: '刷新',
413
417
  peopleActiveTasks: '{n} 个活跃任务',
@@ -428,9 +432,7 @@ window.__ModuleLoader__.load({
428
432
  teamBusyN: '在做 ×{n}',
429
433
  pendingAcceptanceN: '待验收 ×{n}',
430
434
  archivedCount: '已归档 {n}',
431
- personModelBtn: '统一配置模型',
432
- personModelTitle: '为「{name}」选择 LLM 端点(应用到其所有项目)',
433
- personModelDone: '已把「{name}」配置为 {model}(成功 {done} 处,失败 {failed} 处)。',
435
+ personModelBtn: '配置模型',
434
436
  modelCatalogEmpty: '模型目录为空:请先在 DSH 设置里配置可用的 LLM 端点。',
435
437
  q1Title: '需要你',
436
438
  q2Title: '团队在做',
@@ -760,6 +762,9 @@ window.__ModuleLoader__.load({
760
762
  talentLoadFailed: 'Could not load the talent market: {error}',
761
763
  talentSkills: 'Skills: {skills}',
762
764
  talentUser: 'Custom',
765
+ profileTabBasic: 'Profile', profileTabModel: 'Model', profileTabSkills: 'Skills', profileTabCollab: 'Collaboration', profileNotes: 'Notes',
766
+ teamPickDetail: 'Talent details', teamPickDetailEmpty: 'Pick a talent on the left to see its details; “Add” puts it into the team on the right.', teamLeadMark: 'Lead', projectTeamMembers: 'Team members · {n}',
767
+ peopleModelBatch: 'Set model for many', peopleModelTitle: 'Set model', peopleModelHint: 'The selected members switch to this model in every project they are in; each can still be changed in its profile.', peopleModelPick: 'Apply to {n}', peopleModelAll: 'All', peopleModelNone: 'None', peopleModelApply: 'Apply', peopleModelNeed: 'Pick a model first', peopleModelDone: 'Set {model} for {people} members ({done} ok, {failed} failed).',
763
768
  talentOfficial: 'Online', catalogNone: 'Online catalog: not synced (using the built-in one)', catalogAt: 'Online catalog: v{version} · synced {time}', catalogSync: 'Sync online catalog', catalogSyncing: 'Syncing…', catalogSyncHint: 'Fetch the latest talents and teams from the official online catalog (npmmirror / jsDelivr); every file is verified, and a failed sync leaves the current one untouched. Your own and edited talents are not affected.', catalogUpdated: 'Synced to v{version} ({files} files).', catalogLatest: 'Already up to date (v{version}).', catalogFailed: 'Sync failed: {error}', catalogClear: 'Use built-in', catalogClearConfirm: 'Delete the local online catalog and go back to the built-in one? Your own and edited talents are not affected.',
764
769
  talentFork: 'Make editable', talentForkHint: 'Copy this built-in talent into your own copy (same id, shadows the built-in) so you can install and evolve its skills; hired members use the copy on their next activation.', talentForked: 'Edited', talentRestore: 'Restore built-in', talentRestoreConfirm: 'Delete your editable copy of “{name}” and restore the built-in? Skills installed or evolved in the copy are discarded.', skillEvolve: 'Evolve', skillEvolveHint: 'Have this member optimize the skill with SkillOpt: diagnose the weakest dimension, rewrite, blind review by the reviewer; kept if better, reverted if not.', skillEvolveSent: 'Asked {name} to evolve the skill “{skill}”.', skillEvolveForked: 'Built-in talent “{talent}” was copied into an editable copy, and {name} was asked to evolve the skill “{skill}”.', skillEvolveFailed: 'Could not start skill evolution: {error}',
765
770
  talentHint: 'Pick a talent to prefill the form, rename it or change the model, then hire. Your own talents live in ~/.dsh/ai-team/catalog/user/talents/.',
@@ -860,6 +865,7 @@ window.__ModuleLoader__.load({
860
865
  people: 'People',
861
866
  peopleTitle: 'People',
862
867
  peopleEmpty: 'No members yet; add them in a project.',
868
+ peopleGoal: 'Members across projects, grouped by person: load, model and a jump to each project.',
863
869
  peopleProjects: '{n} project(s)',
864
870
  refresh: 'Refresh',
865
871
  peopleActiveTasks: '{n} active task(s)',
@@ -881,8 +887,6 @@ window.__ModuleLoader__.load({
881
887
  pendingAcceptanceN: 'awaiting acceptance ×{n}',
882
888
  archivedCount: 'Archived {n}',
883
889
  personModelBtn: 'Set model',
884
- personModelTitle: 'Choose the LLM endpoint for "{name}" (applies to all its projects)',
885
- personModelDone: 'Set "{name}" to {model} ({done} ok, {failed} failed).',
886
890
  modelCatalogEmpty: 'The model catalog is empty: configure an LLM endpoint in DSH settings first.',
887
891
  q1Title: 'Needs you',
888
892
  q2Title: 'Team is doing',
@@ -1268,7 +1272,7 @@ window.__ModuleLoader__.load({
1268
1272
  .at-msgimg { display: block; line-height: 0; }
1269
1273
  .at-msgimg img { max-width: min(320px, 100%); max-height: 240px; width: auto; height: auto; border: 1px solid var(--dsw-alias-border-l2); border-radius: var(--dsw-radius-sm); object-fit: contain; background: var(--dsw-alias-bg-base); }
1270
1274
  .at-mode { display: inline-flex; overflow: hidden; border: 1px solid var(--dsw-alias-border-l2); border-radius: var(--dsw-radius-sm); }
1271
- .at-mode button { min-height: 24px; padding: 0 8px; border: 0; background: transparent; color: var(--dsw-alias-label-tertiary); font: inherit; font-size: 11px; line-height: 16px; cursor: pointer; }
1275
+ .at-mode button { display: inline-flex; align-items: center; gap: 4px; min-height: 24px; padding: 0 8px; border: 0; background: transparent; color: var(--dsw-alias-label-tertiary); font: inherit; font-size: 11px; line-height: 16px; cursor: pointer; }
1272
1276
  .at-mode button[aria-pressed="true"] { background: var(--dsw-alias-button-ghost-active-fill); color: var(--dsw-alias-label-primary); }
1273
1277
  .at-hint { min-width: 0; color: var(--dsw-alias-label-caption); font-size: 10px; line-height: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
1274
1278
  .at-send { margin-left: auto; min-height: 28px; padding: 0 12px; border: 1px solid transparent; border-radius: var(--dsw-radius-sm); background: var(--dsw-alias-button-primary-fill); color: var(--dsw-alias-label-primary-inverted); font: inherit; font-size: 12px; line-height: 18px; cursor: pointer; white-space: nowrap; }
@@ -1324,7 +1328,7 @@ window.__ModuleLoader__.load({
1324
1328
  .at-emptybody { max-width: 46ch; color: var(--dsw-alias-label-tertiary); font-size: 12px; line-height: 18px; }
1325
1329
  .at-empty .at-btn { align-self: center; margin-top: 8px; }
1326
1330
  .at-empty-compact .at-btn { align-self: flex-start; }
1327
- .at-btn { min-height: 32px; display: inline-flex; align-items: center; justify-content: center; padding: 0 14px; border: 1px solid var(--dsw-alias-border-l2); border-radius: var(--dsw-radius-sm); background: var(--dsw-alias-button-elevated-fill); color: var(--dsw-alias-label-primary); font: inherit; font-size: 12px; line-height: 18px; cursor: pointer; white-space: nowrap; }
1331
+ .at-btn { min-height: 32px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 0 14px; border: 1px solid var(--dsw-alias-border-l2); border-radius: var(--dsw-radius-sm); background: var(--dsw-alias-button-elevated-fill); color: var(--dsw-alias-label-primary); font: inherit; font-size: 12px; line-height: 18px; cursor: pointer; white-space: nowrap; }
1328
1332
  .at-btn:hover { background: var(--dsw-alias-interactive-bg-hover); }
1329
1333
  .at-btn-primary { border-color: transparent; background: var(--dsw-alias-button-primary-fill); color: var(--dsw-alias-label-primary-inverted); }
1330
1334
  .at-btn-primary:hover { background: var(--dsw-alias-button-primary-hover); }
@@ -1393,8 +1397,47 @@ window.__ModuleLoader__.load({
1393
1397
  .at-fieldrow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
1394
1398
  .at-modalback { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 20px; background: color-mix(in srgb, var(--dsw-alias-bg-base) 72%, transparent); }
1395
1399
  .at-modal { width: min(420px, 100%); max-height: 86vh; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--dsw-alias-border-l1); border-radius: 12px; background: var(--dsw-alias-bg-layer-2); }
1396
- .at-modaltitle { margin: 0 0 2px; font-size: 15px; font-weight: 600; color: var(--dsw-alias-label-primary); }
1397
- .at-modal.at-modal-wide { width: min(640px, 100%); }
1400
+ .at-modaltitle { display: flex; align-items: center; gap: 6px; margin: 0 0 2px; font-size: 15px; font-weight: 600; color: var(--dsw-alias-label-primary); }
1401
+ .at-modaltitle svg, .at-btn svg, .at-talentduty svg, .at-mode button svg, .at-catalogstate svg { flex: none; }
1402
+ /* 内容型弹窗(添加成员 / 人才市场、成员资料、新建项目、组队):插件页面的 90% 宽高;确认框等小弹窗保持紧凑。 */
1403
+ .at-modalback:has(> .at-modal-wide) { padding: 0; }
1404
+ .at-modal.at-modal-wide { width: 90%; height: 90%; max-height: 90%; }
1405
+ /* 所有弹窗:标题栏固定在顶部,功能按钮在右上角;内容再长也不用滚到底找按钮。 */
1406
+ .at-modal { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: start; column-gap: 12px; row-gap: 10px; padding-top: 0; }
1407
+ .at-modal > * { grid-column: 1 / -1; min-width: 0; }
1408
+ .at-modal > .at-addtabs { justify-self: start; }
1409
+ .at-modal > .at-modaltitle { grid-column: 1; grid-row: 1; position: sticky; top: 0; z-index: 3; align-self: stretch; margin: 0; padding: 14px 0 10px; background: var(--dsw-alias-bg-layer-2); border-bottom: 1px solid var(--dsw-alias-border-l1); }
1410
+ .at-modal > .at-modalactions { grid-column: 2; grid-row: 1; position: sticky; top: 0; z-index: 3; align-self: stretch; align-items: center; margin: 0; padding: 8px 0; background: var(--dsw-alias-bg-layer-2); border-bottom: 1px solid var(--dsw-alias-border-l1); }
1411
+ .at-actsep { width: 1px; align-self: stretch; margin: 6px 2px; background: var(--dsw-alias-border-l2); }
1412
+ .at-btn-danger { color: var(--dsw-alias-state-error-primary); border-color: color-mix(in srgb, var(--dsw-alias-state-error-primary) 45%, transparent); }
1413
+ .at-btn-danger:hover { background: color-mix(in srgb, var(--dsw-alias-state-error-primary) 10%, transparent); }
1414
+ .at-btn-warn { color: var(--dsw-alias-state-warn-primary); border-color: color-mix(in srgb, var(--dsw-alias-state-warn-primary) 45%, transparent); }
1415
+ .at-btn-warn:hover { background: color-mix(in srgb, var(--dsw-alias-state-warn-primary) 10%, transparent); }
1416
+ .at-btn-accent { color: var(--dsw-alias-state-business-primary); border-color: color-mix(in srgb, var(--dsw-alias-state-business-primary) 45%, transparent); }
1417
+ .at-btn-accent:hover { background: color-mix(in srgb, var(--dsw-alias-state-business-primary) 10%, transparent); }
1418
+ .at-fieldgrid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; }
1419
+ .at-fieldgrid3 .at-modelfields, .at-fieldgrid3 .at-modelfields > .at-fieldrow { display: contents; }
1420
+ .at-fieldgrid3 .at-modelfields > :not(.at-fieldrow) { grid-column: 1 / -1; }
1421
+ .at-notesbox { max-height: 200px; overflow-y: auto; padding: 8px 10px; border: 1px solid var(--dsw-alias-border-l1); border-radius: 8px; background: var(--dsw-alias-bg-base); color: var(--dsw-alias-label-secondary); font-size: 12px; line-height: 18px; white-space: pre-wrap; overflow-wrap: anywhere; }
1422
+ .at-split { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(0, 1.7fr); gap: 16px; align-items: start; }
1423
+ .at-teamcomposer { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(0, 1.4fr) minmax(240px, 1.1fr); gap: 14px; align-items: start; }
1424
+ .at-pane { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
1425
+ .at-panetitle { color: var(--dsw-alias-label-secondary); font-size: 12px; font-weight: 600; }
1426
+ .at-panelist { display: flex; flex-direction: column; gap: 2px; max-height: 58vh; overflow-y: auto; padding: 4px; border: 1px solid var(--dsw-alias-border-l1); border-radius: 10px; }
1427
+ .at-pickrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; padding: 6px 8px; border: 0; border-radius: 6px; background: transparent; color: var(--dsw-alias-label-primary); font: inherit; font-size: 12px; text-align: left; cursor: pointer; }
1428
+ .at-pickrow:hover { background: var(--dsw-alias-interactive-bg-hover); }
1429
+ .at-pickrow[aria-selected="true"] { background: var(--dsw-alias-button-ghost-active-fill); }
1430
+ .at-pickrow > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
1431
+ .at-pickrole { color: var(--dsw-alias-label-tertiary); }
1432
+ .at-peoplegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; margin: 0 12px 12px; }
1433
+ .at-pcard { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 12px; border: 1px solid var(--dsw-alias-border-l1); border-radius: 10px; background: var(--dsw-alias-bg-layer-1); }
1434
+ .at-pcard.at-people-failed { border-color: var(--dsw-alias-state-error-primary); }
1435
+ .at-streamwide { max-width: none; }
1436
+ .at-pcard .at-peoplebadges { margin-left: 0; }
1437
+ .at-pcardhead { display: flex; align-items: center; gap: 8px; min-width: 0; }
1438
+ .at-pcardfoot { display: flex; justify-content: flex-end; gap: 6px; margin-top: auto; }
1439
+ .at-peoplecheck { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; }
1440
+ @media (max-width: 900px) { .at-split, .at-teamcomposer, .at-fieldgrid3 { grid-template-columns: minmax(0, 1fr); } }
1398
1441
  .at-addtabs { align-self: flex-start; }
1399
1442
  .at-tcskills { display: flex; flex-wrap: wrap; gap: 6px; }
1400
1443
  .at-tcskill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: rgba(127,127,127,0.15); font-size: 12px; }
@@ -1408,7 +1451,7 @@ window.__ModuleLoader__.load({
1408
1451
  .at-teampickrow { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-width: 0; }
1409
1452
  .at-teampickrow > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
1410
1453
  .at-market { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
1411
- .at-catalogbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
1454
+ .at-catalogstate { display: inline-flex; align-items: center; gap: 5px; }
1412
1455
  .at-marketsearch { width: 100%; padding: 6px 8px; border: 1px solid var(--dsw-alias-border-l2); border-radius: var(--dsw-radius-sm); background: var(--dsw-alias-bg-base); color: var(--dsw-alias-label-primary); font: inherit; font-size: 12px; }
1413
1456
  .at-marketcats { display: flex; flex-wrap: wrap; gap: 4px; }
1414
1457
  .at-marketcat { min-height: 22px; padding: 0 8px; border: 1px solid var(--dsw-alias-border-l2); border-radius: 999px; background: transparent; color: var(--dsw-alias-label-tertiary); font: inherit; font-size: 11px; cursor: pointer; }
@@ -1418,9 +1461,10 @@ window.__ModuleLoader__.load({
1418
1461
  .at-talenthead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
1419
1462
  .at-talentname { color: var(--dsw-alias-label-primary); font-size: 13px; font-weight: 600; }
1420
1463
  .at-talentrole { color: var(--dsw-alias-label-secondary); font-size: 12px; }
1421
- .at-talentduty { padding: 0 6px; border: 1px solid var(--dsw-alias-border-l2); border-radius: 999px; color: var(--dsw-alias-label-tertiary); font-size: 10.5px; line-height: 16px; }
1464
+ .at-talentduty { display: inline-flex; align-items: center; gap: 3px; padding: 0 6px; border: 1px solid var(--dsw-alias-border-l2); border-radius: 999px; color: var(--dsw-alias-label-tertiary); font-size: 10.5px; line-height: 16px; }
1422
1465
  .at-talentdesc { color: var(--dsw-alias-label-secondary); font-size: 12px; line-height: 18px; }
1423
- .at-talentfoot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
1466
+ .at-talentfoot { display: flex; flex-direction: column; align-items: stretch; gap: 6px; margin-top: auto; }
1467
+ .at-talentfoot .at-tcpick { justify-content: flex-end; flex-wrap: nowrap; margin-top: 0; }
1424
1468
  .at-modalmeta { color: var(--dsw-alias-label-tertiary); font-size: 11px; line-height: 16px; }
1425
1469
  .at-modal .at-check { display: flex; align-items: center; gap: 6px; color: var(--dsw-alias-label-secondary); font-size: 12px; }
1426
1470
  .at-modal .at-check input { accent-color: var(--dsw-alias-state-business-primary); }
@@ -1548,10 +1592,26 @@ window.__ModuleLoader__.load({
1548
1592
  if (name === 'layers') return h('svg', common, h('path', { d: 'M8 2.5 14 6 8 9.5 2 6Z' }), h('path', { d: 'M2 9.5 8 13l6-3.5' }));
1549
1593
  if (name === 'chevron') return h('svg', common, h('path', { d: 'M6 3.5 10.5 8 6 12.5' }));
1550
1594
  if (name === 'down') return h('svg', common, h('path', { d: 'M8 3v10M3.5 8.5 8 13l4.5-4.5' }));
1595
+ if (name === 'sync') return h('svg', common, h('path', { d: 'M13 6.5A5 5 0 0 0 3.6 5' }), h('path', { d: 'M3.5 2.5V5H6' }), h('path', { d: 'M3 9.5A5 5 0 0 0 12.4 11' }), h('path', { d: 'M12.5 13.5V11H10' }));
1596
+ if (name === 'undo') return h('svg', common, h('path', { d: 'M5.5 3.5 2.5 6.5l3 3' }), h('path', { d: 'M2.5 6.5H10a3.5 3.5 0 0 1 0 7H7' }));
1597
+ if (name === 'copy') return h('svg', common, h('rect', { x: 5.5, y: 5.5, width: 8, height: 8, rx: 1.5 }), h('path', { d: 'M10.5 5.5V3.5a1 1 0 0 0-1-1h-6a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2' }));
1598
+ if (name === 'user') return h('svg', common, h('circle', { cx: 8, cy: 5.5, r: 2.8 }), h('path', { d: 'M2.5 13.5a5.5 5.5 0 0 1 11 0' }));
1599
+ if (name === 'userPlus') return h('svg', common, h('circle', { cx: 6.5, cy: 5.5, r: 2.6 }), h('path', { d: 'M1.5 13.5a5 5 0 0 1 10 0' }), h('path', { d: 'M12.5 4v4M10.5 6h4' }));
1600
+ if (name === 'users') return h('svg', common, h('circle', { cx: 6, cy: 5.5, r: 2.4 }), h('path', { d: 'M1.5 13.5a4.5 4.5 0 0 1 9 0' }), h('path', { d: 'M10 3.3a2.4 2.4 0 0 1 0 4.4M12 9.5a4.5 4.5 0 0 1 2.5 4' }));
1601
+ if (name === 'cloud') return h('svg', common, h('path', { d: 'M4.5 12.5h7a3 3 0 0 0 .4-6 4 4 0 0 0-7.7.9 2.6 2.6 0 0 0 .3 5.1Z' }));
1602
+ if (name === 'pen') return h('svg', common, h('path', { d: 'M10.5 3 13 5.5 6 12.5H3.5V10Z' }), h('path', { d: 'M9 4.5 11.5 7' }));
1603
+ if (name === 'spark') return h('svg', common, h('path', { d: 'M7 2.5 8.3 6.2 12 7.5 8.3 8.8 7 12.5 5.7 8.8 2 7.5 5.7 6.2Z' }), h('path', { d: 'M12.5 10.5v3M11 12h3' }));
1604
+ if (name === 'store') return h('svg', common, h('path', { d: 'M2.5 6 3.5 3h9l1 3' }), h('path', { d: 'M2.5 6a1.8 1.8 0 0 0 3.7 0 1.8 1.8 0 0 0 3.6 0 1.8 1.8 0 0 0 3.7 0' }), h('path', { d: 'M3.5 8v5.5h9V8' }));
1605
+ if (name === 'folderPlus') return h('svg', common, h('path', { d: 'M2.5 4.5a1 1 0 0 1 1-1h3l1.5 1.5h4.5a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1h-9a1 1 0 0 1-1-1Z' }), h('path', { d: 'M8 7.5v3M6.5 9h3' }));
1551
1606
  if (name === 'loop') return h('svg', { width: 18, height: 18, viewBox: '0 0 32 32', fill: 'none', 'aria-hidden': 'true', focusable: 'false' }, h('rect', { x: 2.5, y: 5.5, width: 21, height: 21, rx: 6.5, stroke: 'currentColor', strokeWidth: 2.6 }), h('circle', { cx: 23.5, cy: 16, r: 4.8, fill: 'var(--dsw-alias-state-business-primary)' }));
1552
1607
  return null;
1553
1608
  }
1554
1609
 
1610
+ /** 图标 + 文字(按钮、标题、标签共用;图标单色随文字色)。 */
1611
+ function withIco(name, label, size = 13) {
1612
+ return [h(Ico, { key: 'i', name, size }), h('span', { key: 't' }, label)];
1613
+ }
1614
+
1555
1615
  function StatusGlyph({ status }) {
1556
1616
  const common = { width: 12, height: 12, viewBox: '0 0 12 12', fill: 'none', stroke: 'currentColor', strokeWidth: 1.4, strokeLinecap: 'round', strokeLinejoin: 'round', 'aria-hidden': 'true', focusable: 'false' };
1557
1617
  if (status === 'done') return h('svg', common, h('path', { d: 'M2.5 6.2l2.3 2.3 4.7-4.7' }));
@@ -2068,6 +2128,41 @@ window.__ModuleLoader__.load({
2068
2128
  h('button', { className: 'at-btn at-btn-primary at-btn-small', type: 'button', disabled: !complete || busy, onClick: submit }, busy ? t('saving') : t('decisionSubmit')));
2069
2129
  }
2070
2130
 
2131
+ /**
2132
+ * 人员池「配置模型」:一次给选中的多位成员(在其所在的全部项目)设同一模型;单人入口也走这里(只勾那一位)。
2133
+ * 成员资料里的单独设置照旧保留。
2134
+ */
2135
+ function PeopleModelDialog({ t, catalog, catalogError, people, initial, onApply, onClose }) {
2136
+ const [picked, setPicked] = React.useState(() => new Set(initial));
2137
+ const [provider, setProvider] = React.useState(catalog?.defaultModel?.provider ?? '');
2138
+ const [model, setModel] = React.useState(catalog?.defaultModel?.model ?? '');
2139
+ const [effort, setEffort] = React.useState('');
2140
+ const [busy, setBusy] = React.useState(false);
2141
+ const toggle = (name) => setPicked((prev) => { const next = new Set(prev); if (next.has(name)) next.delete(name); else next.add(name); return next; });
2142
+ const apply = async () => {
2143
+ if (busy || model === '' || picked.size === 0) return;
2144
+ setBusy(true);
2145
+ try { await onApply([...picked], { provider, model, ...(effort === '' ? {} : { reasoningEffort: effort }) }); } finally { setBusy(false); }
2146
+ };
2147
+ return h(ModalBack, { onClose },
2148
+ h('div', { className: 'at-modal at-modal-wide', role: 'dialog', 'aria-modal': 'true', 'aria-label': t('peopleModelTitle') },
2149
+ h('h2', { className: 'at-modaltitle' }, withIco('layers', t('peopleModelTitle'), 16)),
2150
+ h('div', { className: 'at-modalactions' },
2151
+ h('button', { className: 'at-btn', type: 'button', onClick: onClose, disabled: busy }, withIco('close', t('cancel'))),
2152
+ h('button', { className: 'at-btn at-btn-primary', type: 'button', onClick: () => void apply(), disabled: busy || model === '' || picked.size === 0, title: model === '' ? t('peopleModelNeed') : '' }, withIco('check', busy ? t('saving') : tf(t, 'peopleModelPick', { n: picked.size })))),
2153
+ h('div', { className: 'at-modalmeta' }, t('peopleModelHint')),
2154
+ h('div', { className: 'at-fieldgrid3' },
2155
+ h(ModelFields, { t, catalog, provider, effort, onEffort: setEffort, model, onProvider: setProvider, onModel: setModel, error: catalogError })),
2156
+ h('div', { className: 'at-pane' },
2157
+ h('div', { className: 'at-tcpick' },
2158
+ h('span', { className: 'at-panetitle' }, t('peopleTitle') + ' · ' + picked.size + '/' + people.length),
2159
+ h('button', { className: 'at-btn at-btn-small', type: 'button', onClick: () => setPicked(new Set(people.map((p) => p.name))) }, t('peopleModelAll')),
2160
+ h('button', { className: 'at-btn at-btn-small', type: 'button', onClick: () => setPicked(new Set()) }, t('peopleModelNone'))),
2161
+ h('div', { className: 'at-peoplecheck' }, people.map((person) => h('label', { key: person.name, className: 'at-check' },
2162
+ h('input', { type: 'checkbox', checked: picked.has(person.name), onChange: () => toggle(person.name) }),
2163
+ h('span', null, person.name + (person.role ? ' · ' + person.role : ''))))))));
2164
+ }
2165
+
2071
2166
  /**
2072
2167
  * 人员池总览(全局层,11-管理视角 §2):按"人"聚合各项目身份。
2073
2168
  * 数据 = GET /ai-team/api/people(各项目账本 members/tasks 的只读聚合)。
@@ -2087,10 +2182,11 @@ window.__ModuleLoader__.load({
2087
2182
  if (!people || people.length === 0) return h('div', { className: 'at-stream', role: 'region', 'aria-label': t('peopleTitle') },
2088
2183
  h('div', { className: 'at-streaminner' }, h(EmptyState, { t, icon: 'layers', title: t('peopleTitle'), body: t('peopleEmpty') })));
2089
2184
  return h('div', { className: 'at-stream', role: 'region', 'aria-label': t('peopleTitle') },
2090
- h('div', { className: 'at-streaminner' },
2185
+ h('div', { className: 'at-streaminner at-streamwide' },
2091
2186
  h('div', { className: 'at-peoplehead' },
2092
2187
  h('span', { className: 'at-peoplecount' }, loading ? t('loading') : tf(t, 'peopleProjects', { n: people.length })),
2093
- h('button', { className: 'at-btn at-btn-small', type: 'button', onClick: onRefresh, disabled: loading }, t('refresh'))),
2188
+ onConfigModel ? h('button', { className: 'at-btn at-btn-small at-btn-accent', type: 'button', onClick: () => onConfigModel(people.map((person) => person.name)) }, withIco('layers', t('peopleModelBatch'), 12)) : null,
2189
+ h('button', { className: 'at-btn at-btn-small', type: 'button', onClick: onRefresh, disabled: loading }, withIco('sync', t('refresh'), 12))),
2094
2190
  onBindAlias ? h('details', { className: 'at-aliasbox' },
2095
2191
  h('summary', { className: 'at-peoplesum' }, h('span', { className: 'at-people-role' }, t('aliasTitle'))),
2096
2192
  h('div', { className: 'at-aliasrow' },
@@ -2099,37 +2195,36 @@ window.__ModuleLoader__.load({
2099
2195
  h('input', { className: 'at-decisioninput', value: aliasDraft?.target ?? '', placeholder: t('aliasTargetPlaceholder'), onChange: (event) => aliasDraft.onTarget(event.target.value) }),
2100
2196
  h('button', { className: 'at-btn at-btn-small', type: 'button', onClick: () => onBindAlias(aliasDraft?.target ?? '') }, t('aliasBind'))),
2101
2197
  h('div', { className: 'at-modalmeta' }, t('aliasHint'))) : null,
2102
- people.map((person) => {
2103
- const badges = [
2104
- tf(t, 'peopleProjects', { n: person.projects.length }),
2105
- tf(t, 'peopleActiveTasks', { n: person.activeTasks }),
2106
- ];
2107
- if (person.failures > 0) badges.push(tf(t, 'peopleFailure', { n: person.failures }));
2108
- return h('details', { key: person.name, className: cx('at-people', person.failures > 0 && 'at-people-failed') },
2109
- h('summary', { className: 'at-peoplesum' },
2110
- h(Avatar, { name: person.name, human: false }),
2111
- h('span', { className: 'at-peoplename' }, person.name),
2112
- person.role ? h('span', { className: 'at-people-role' }, person.role) : null,
2113
- h('span', { className: 'at-peoplebadges' }, badges.join(' · ')),
2114
- // P2:统一配置该人在所有项目的 LLM 端点(人员池级入口,
2115
- // 免去逐项目×逐成员修改)。
2116
- onConfigModel ? h('button', { className: 'at-btn at-btn-small', type: 'button', onClick: (event) => { event.preventDefault(); onConfigModel(person); } }, t('personModelBtn')) : null),
2117
- h('div', { className: 'at-peopleprojects' }, person.projects.map((row) => {
2118
- const failed = row.lastFailure !== undefined && row.lastFailure !== null;
2119
- const localHere = localNames.has(person.name);
2120
- return h('div', { key: row.projectId, className: 'at-peopleproject' },
2121
- h('span', { className: 'at-peopleprojectname' }, row.projectName),
2122
- row.talentPool
2123
- ? h('span', { className: 'at-peoplestate' }, t('talentPool'))
2124
- : h('span', { className: 'at-peoplestate' }, t(AGENT_STATUS[row.status] ?? 'agentIdle')),
2125
- h('span', { className: 'at-peopletasks' }, tf(t, 'peopleActiveTasks', { n: row.activeTasks })),
2126
- failed ? h('span', { className: 'at-peoplefail', title: row.lastFailure.message ?? '' }, tf(t, 'peopleFailure', { n: 1 }) + ' · ' + failureHuman(t, row.lastFailure.category)) : null,
2198
+ h('div', { className: 'at-peoplegrid' }, people.map((person) => {
2199
+ const badges = [
2200
+ tf(t, 'peopleProjects', { n: person.projects.length }),
2201
+ tf(t, 'peopleActiveTasks', { n: person.activeTasks }),
2202
+ ];
2203
+ if (person.failures > 0) badges.push(tf(t, 'peopleFailure', { n: person.failures }));
2204
+ const localHere = localNames.has(person.name);
2205
+ return h('div', { key: person.name, className: cx('at-pcard', person.failures > 0 && 'at-people-failed') },
2206
+ h('div', { className: 'at-pcardhead' },
2207
+ h(Avatar, { name: person.name, human: false }),
2208
+ h('span', { className: 'at-peoplename' }, person.name),
2209
+ person.role ? h('span', { className: 'at-people-role' }, person.role) : null),
2210
+ h('div', { className: 'at-peoplebadges' }, badges.join(' · ')),
2211
+ h('div', { className: 'at-peopleprojects' }, person.projects.map((row) => {
2212
+ const failed = row.lastFailure !== undefined && row.lastFailure !== null;
2213
+ return h('div', { key: row.projectId, className: 'at-peopleproject' },
2214
+ h('span', { className: 'at-peopleprojectname' }, row.projectName),
2215
+ row.talentPool
2216
+ ? h('span', { className: 'at-peoplestate' }, t('talentPool'))
2217
+ : h('span', { className: 'at-peoplestate' }, t(AGENT_STATUS[row.status] ?? 'agentIdle')),
2218
+ h('span', { className: 'at-peopletasks' }, tf(t, 'peopleActiveTasks', { n: row.activeTasks })),
2219
+ failed ? h('span', { className: 'at-peoplefail', title: row.lastFailure.message ?? '' }, failureHuman(t, row.lastFailure.category)) : null,
2220
+ h('button', { className: 'at-btn at-btn-small at-iconbtn', type: 'button', title: t('peopleOpenProject'), 'aria-label': t('peopleOpenProject'), onClick: () => onOpenProject(row.projectId) }, h(Ico, { name: 'chevron', size: 12 })));
2221
+ })),
2222
+ h('div', { className: 'at-pcardfoot' },
2127
2223
  // R-03 入口统一:在本项目内才能直达资料/私信(跨项目先切项目)。
2128
- localHere ? h('button', { className: 'at-btn at-btn-small', type: 'button', onClick: () => onOpenPerson(person.name) }, t('memberProfileTitle')) : null,
2129
- localHere ? h('button', { className: 'at-btn at-btn-small', type: 'button', onClick: () => onChatPerson(person.name) }, t('agentChat')) : null,
2130
- h('button', { className: 'at-btn at-btn-small', type: 'button', onClick: () => onOpenProject(row.projectId) }, t('peopleOpenProject')));
2131
- })));
2132
- })));
2224
+ localHere ? h('button', { className: 'at-btn at-btn-small', type: 'button', onClick: () => onOpenPerson(person.name) }, withIco('user', t('memberProfileTitle'), 12)) : null,
2225
+ localHere ? h('button', { className: 'at-btn at-btn-small', type: 'button', onClick: () => onChatPerson(person.name) }, withIco('reply', t('agentChat'), 12)) : null,
2226
+ onConfigModel ? h('button', { className: 'at-btn at-btn-small', type: 'button', onClick: () => onConfigModel([person.name]) }, withIco('layers', t('personModelBtn'), 12)) : null));
2227
+ }))));
2133
2228
  }
2134
2229
 
2135
2230
  /**
@@ -2721,18 +2816,37 @@ window.__ModuleLoader__.load({
2721
2816
  }
2722
2817
 
2723
2818
  const DUTY_LABEL = { lead: 'dutyLead', qa: 'dutyQa', executor: 'dutyExecutor' };
2819
+ /** 人才 / 团队成员的卡片正文(人才市场、组队简介、新建项目的团队成员共用一份)。 */
2820
+ function TalentInfo({ t, talent, lead, full }) {
2821
+ const badge = talent.forked ? withIco('pen', t('talentForked'), 10)
2822
+ : talent.source === 'user' ? withIco('user', t('talentUser'), 10)
2823
+ : talent.source === 'official' ? withIco('cloud', t('talentOfficial'), 10) : null;
2824
+ return [
2825
+ h('div', { key: 'head', className: 'at-talenthead' },
2826
+ h('span', { className: 'at-talentname' }, talent.name),
2827
+ talent.role ? h('span', { className: 'at-talentrole' }, talent.role) : null,
2828
+ talent.duty ? h('span', { className: 'at-talentduty' }, t(DUTY_LABEL[talent.duty])) : null,
2829
+ lead ? h('span', { className: 'at-talentduty' }, withIco('check', t('teamLeadMark'), 10)) : null,
2830
+ badge ? h('span', { className: 'at-talentduty' }, badge) : null),
2831
+ talent.description ? h('div', { key: 'desc', className: 'at-talentdesc' }, talent.description) : null,
2832
+ full && talent.personality ? h('div', { key: 'pers', className: 'at-modalmeta' }, talent.personality) : null,
2833
+ talent.skills?.length ? h('div', { key: 'skills', className: 'at-modalmeta' }, tf(t, 'talentSkills', { skills: talent.skills.join('、') })) : null,
2834
+ ];
2835
+ }
2724
2836
  /** 「添加成员」弹窗的人才市场页:分类、搜索、卡片;点「招聘」按人才预填表单。 */
2725
2837
  function TalentMarket({ t, talents, error, query, onQuery, category, onCategory, onHire, onFork, onRestore, onCancel, catalog, catalogBusy, catalogNote, onSync, onClear }) {
2726
2838
  const categories = [...new Set((talents ?? []).map((talent) => talent.category).filter(Boolean))];
2727
2839
  const shown = filterTalents(talents, query, category);
2728
- return h('div', { className: 'at-market' },
2840
+ // Fragment:按钮栏直接挂在弹窗下,由弹窗的标题栏放到右上角。
2841
+ return h(React.Fragment, null,
2842
+ h('div', { className: 'at-modalactions' },
2843
+ onSync && catalog && onClear ? h('button', { type: 'button', className: 'at-btn', disabled: catalogBusy, onClick: onClear }, withIco('undo', t('catalogClear'))) : null,
2844
+ onSync ? h('button', { type: 'button', className: 'at-btn at-btn-accent', title: t('catalogSyncHint'), disabled: catalogBusy, onClick: onSync }, withIco('sync', catalogBusy ? t('catalogSyncing') : t('catalogSync'))) : null,
2845
+ h('span', { className: 'at-actsep', 'aria-hidden': 'true' }),
2846
+ h('button', { className: 'at-btn', type: 'button', onClick: onCancel }, withIco('close', t('cancel')))),
2729
2847
  h('div', { className: 'at-modalmeta' }, t('talentHint')),
2730
- onSync ? h('div', { className: 'at-catalogbar' },
2731
- h('span', { className: 'at-modalmeta' }, catalog ? tf(t, 'catalogAt', { version: catalog.version, time: catalog.syncedAt ? new Date(catalog.syncedAt).toLocaleString() : '' }) : t('catalogNone')),
2732
- h('span', { className: 'at-tcpick' },
2733
- catalog && onClear ? h('button', { type: 'button', className: 'at-btn at-btn-small', disabled: catalogBusy, onClick: onClear }, t('catalogClear')) : null,
2734
- h('button', { type: 'button', className: 'at-btn at-btn-small', title: t('catalogSyncHint'), disabled: catalogBusy, onClick: onSync }, catalogBusy ? t('catalogSyncing') : t('catalogSync')))) : null,
2735
- catalogNote ? h('div', { className: 'at-modalmeta', role: 'status' }, catalogNote) : null,
2848
+ onSync ? h('div', { className: 'at-modalmeta at-catalogstate', role: 'status' }, h(Ico, { name: 'cloud', size: 13 }),
2849
+ (catalog ? tf(t, 'catalogAt', { version: catalog.version, time: catalog.syncedAt ? new Date(catalog.syncedAt).toLocaleString() : '' }) : t('catalogNone')) + (catalogNote ? ' · ' + catalogNote : '')) : null,
2736
2850
  h('input', { className: 'at-marketsearch', type: 'search', value: query, placeholder: t('talentSearch'), 'aria-label': t('talentSearch'), onChange: (event) => onQuery(event.target.value), autoFocus: true }),
2737
2851
  categories.length > 1 ? h('div', { className: 'at-marketcats', role: 'group', 'aria-label': t('talentMarket') },
2738
2852
  ['', ...categories].map((name) => h('button', {
@@ -2746,21 +2860,13 @@ window.__ModuleLoader__.load({
2746
2860
  talents === null ? h('div', { className: 'at-modalmeta' }, t('talentLoading'))
2747
2861
  : shown.length === 0 ? h('div', { className: 'at-modalmeta' }, t('talentEmpty'))
2748
2862
  : h('div', { className: 'at-marketgrid', role: 'list', 'aria-label': t('talentMarket') }, shown.map((talent) => h('div', { key: talent.id, className: 'at-talent', role: 'listitem' },
2749
- h('div', { className: 'at-talenthead' },
2750
- h('span', { className: 'at-talentname' }, talent.name),
2751
- h('span', { className: 'at-talentrole' }, talent.role),
2752
- talent.duty ? h('span', { className: 'at-talentduty' }, t(DUTY_LABEL[talent.duty])) : null,
2753
- talent.forked ? h('span', { className: 'at-talentduty' }, t('talentForked')) : talent.source === 'user' ? h('span', { className: 'at-talentduty' }, t('talentUser')) : talent.source === 'official' ? h('span', { className: 'at-talentduty' }, t('talentOfficial')) : null),
2754
- talent.description ? h('div', { className: 'at-talentdesc' }, talent.description) : null,
2755
- talent.skills?.length ? h('div', { className: 'at-modalmeta' }, tf(t, 'talentSkills', { skills: talent.skills.join('、') })) : null,
2863
+ h(TalentInfo, { t, talent }),
2756
2864
  h('div', { className: 'at-talentfoot' },
2757
2865
  h('span', { className: 'at-modalmeta' }, [talent.category, ...(talent.tags ?? [])].filter(Boolean).join(' · ')),
2758
2866
  h('span', { className: 'at-tcpick' },
2759
- talent.source !== 'user' && onFork ? h('button', { type: 'button', className: 'at-btn at-btn-small', title: t('talentForkHint'), onClick: () => onFork(talent) }, t('talentFork')) : null,
2760
- talent.forked && onRestore ? h('button', { type: 'button', className: 'at-btn at-btn-small', onClick: () => onRestore(talent) }, t('talentRestore')) : null,
2761
- h('button', { type: 'button', className: 'at-btn at-btn-primary', onClick: () => onHire(talent) }, t('talentHire'))))))),
2762
- h('div', { className: 'at-modalactions' },
2763
- h('button', { className: 'at-btn', type: 'button', onClick: onCancel }, t('cancel'))));
2867
+ talent.source !== 'user' && onFork ? h('button', { type: 'button', className: 'at-btn at-btn-small', title: t('talentForkHint'), onClick: () => onFork(talent) }, withIco('copy', t('talentFork'), 12)) : null,
2868
+ talent.forked && onRestore ? h('button', { type: 'button', className: 'at-btn at-btn-small', onClick: () => onRestore(talent) }, withIco('undo', t('talentRestore'), 12)) : null,
2869
+ h('button', { type: 'button', className: 'at-btn at-btn-small at-btn-primary', onClick: () => onHire(talent) }, withIco('userPlus', t('talentHire'), 12))))))));
2764
2870
  }
2765
2871
  function TalentCreator({ t, initial, onSaved, onCancel }) {
2766
2872
  const seed = initial && initial.draft ? talentCreatorInit(initial) : null;
@@ -2824,17 +2930,18 @@ window.__ModuleLoader__.load({
2824
2930
  setBusy(false);
2825
2931
  }
2826
2932
  }
2827
- return h('div', { className: 'at-market' },
2933
+ return h(React.Fragment, null,
2828
2934
  h('div', { className: 'at-modalmeta' }, t('tcHint')),
2829
2935
  initial && initial.error ? h('div', { className: 'at-modalerror', role: 'alert' }, initial.error) : null,
2830
2936
  seed ? h('div', { className: 'at-modalmeta' }, tf(t, 'tcFromMember', { name: seed.sourceName })) : null,
2831
2937
  seed && seed.model ? h('div', { className: 'at-modalmeta' }, tf(t, 'tcModelKept', { model: [seed.model.provider, seed.model.model].filter(Boolean).join(' / ') })) : null,
2832
2938
  seed && seed.missing.length ? h('div', { className: 'at-modalmeta' }, tf(t, 'tcMissing', { skills: seed.missing.join('、') })) : null,
2833
- h('label', { className: 'at-field' }, h('span', null, t('tcName')), h('input', { value: form.name, onChange: set('name'), autoFocus: true })),
2834
- h('label', { className: 'at-field' }, h('span', null, t('tcRole')), h('input', { value: form.role, onChange: set('role') })),
2835
- h('label', { className: 'at-field' }, h('span', null, t('tcDuty')), h('select', { value: form.duty, onChange: set('duty') }, ['executor', 'qa', 'lead'].map((d) => h('option', { key: d, value: d }, t(DUTY_LABEL[d]))))),
2836
- h('label', { className: 'at-field' }, h('span', null, t('tcCategory')), h('input', { value: form.category, onChange: set('category') })),
2837
- h('label', { className: 'at-field' }, h('span', null, t('tcTags')), h('input', { value: form.tags, onChange: set('tags'), placeholder: t('tcTagsHint') })),
2939
+ h('div', { className: 'at-fieldgrid3' },
2940
+ h('label', { className: 'at-field' }, h('span', null, t('tcName')), h('input', { value: form.name, onChange: set('name'), autoFocus: true })),
2941
+ h('label', { className: 'at-field' }, h('span', null, t('tcRole')), h('input', { value: form.role, onChange: set('role') })),
2942
+ h('label', { className: 'at-field' }, h('span', null, t('tcDuty')), h('select', { value: form.duty, onChange: set('duty') }, ['executor', 'qa', 'lead'].map((d) => h('option', { key: d, value: d }, t(DUTY_LABEL[d]))))),
2943
+ h('label', { className: 'at-field' }, h('span', null, t('tcCategory')), h('input', { value: form.category, onChange: set('category') })),
2944
+ h('label', { className: 'at-field' }, h('span', null, t('tcTags')), h('input', { value: form.tags, onChange: set('tags'), placeholder: t('tcTagsHint') }))),
2838
2945
  h('label', { className: 'at-field' }, h('span', null, t('tcPersonality')), h('textarea', { value: form.personality, onChange: set('personality'), placeholder: t('tcPersonalityHint') })),
2839
2946
  h('div', { className: 'at-field' }, h('span', null, t('tcSkills')),
2840
2947
  pending.length === 0 ? h('div', { className: 'at-modalmeta' }, t('tcEmpty')) : h('div', { className: 'at-tcskills' }, pending.map((sk) => h('span', { key: sk.name, className: 'at-tcskill' }, sk.name, h('button', { type: 'button', 'aria-label': t('tcRemove'), onClick: () => setPending((pp) => pp.filter((x) => x.name !== sk.name)) }, '×')))),
@@ -2847,15 +2954,17 @@ window.__ModuleLoader__.load({
2847
2954
  error ? h('div', { className: 'at-modalerror', role: 'alert' }, error) : null,
2848
2955
  h('div', { className: 'at-modalactions' },
2849
2956
  h('button', { type: 'button', className: 'at-btn', onClick: onCancel }, t('cancel')),
2850
- h('button', { type: 'button', className: 'at-btn at-btn-primary', disabled: !form.name.trim() || busy, onClick: save }, busy ? t('tcSaving') : t('tcSave'))));
2957
+ h('button', { type: 'button', className: 'at-btn at-btn-primary', disabled: !form.name.trim() || busy, onClick: save }, withIco('check', busy ? t('tcSaving') : t('tcSave')))));
2851
2958
  }
2852
2959
  function TeamComposer({ t, talents, onSaved, onCancel }) {
2853
2960
  const [draft, setDraft] = React.useState({ name: '', description: '', members: [], lead: 0 });
2854
2961
  const [query, setQuery] = React.useState('');
2962
+ const [focus, setFocus] = React.useState('');
2855
2963
  const [busy, setBusy] = React.useState(false);
2856
2964
  const [error, setError] = React.useState('');
2857
- const shown = filterTalents(talents, query, '').slice(0, 40);
2965
+ const shown = filterTalents(talents, query, '');
2858
2966
  const byId = (id) => (talents || []).find((x) => x.id === id);
2967
+ const focused = byId(focus) || shown[0] || null;
2859
2968
  function add(talent) { setDraft((d) => ({ ...d, members: [...d.members, { talent: talent.id, name: '' }] })); }
2860
2969
  function remove(index) { setDraft((d) => ({ ...d, members: d.members.filter((_, i) => i !== index), lead: d.lead === index ? 0 : d.lead > index ? d.lead - 1 : d.lead })); }
2861
2970
  function rename(index, name) { setDraft((d) => ({ ...d, members: d.members.map((m, i) => (i === index ? { ...m, name } : m)) })); }
@@ -2874,28 +2983,47 @@ window.__ModuleLoader__.load({
2874
2983
  setBusy(false);
2875
2984
  }
2876
2985
  }
2877
- return h('div', { className: 'at-market' },
2986
+ // 三栏:人才列表 → 选中人才的简介(加入)→ 已组的团队(改名、定负责人、移除)。按钮在弹窗右上角。
2987
+ return h(React.Fragment, null,
2988
+ h('div', { className: 'at-modalactions' },
2989
+ h('button', { type: 'button', className: 'at-btn', onClick: onCancel }, withIco('back', t('teamBack'))),
2990
+ h('button', { type: 'button', className: 'at-btn at-btn-primary', disabled: busy || !draft.name.trim() || draft.members.length === 0, onClick: save }, withIco('check', busy ? t('saving') : t('teamSave')))),
2878
2991
  h('div', { className: 'at-modalmeta' }, t('teamComposeHint')),
2879
- h('label', { className: 'at-field' }, h('span', null, t('teamName')), h('input', { value: draft.name, onChange: (e) => setDraft({ ...draft, name: e.target.value }), autoFocus: true })),
2880
- h('label', { className: 'at-field' }, h('span', null, t('teamDesc')), h('input', { value: draft.description, onChange: (e) => setDraft({ ...draft, description: e.target.value }) })),
2881
- h('div', { className: 'at-field' }, h('span', null, t('teamMembers')),
2882
- draft.members.length === 0 ? h('div', { className: 'at-modalmeta' }, t('teamEmptyPick')) : h('div', { className: 'at-teamrows' }, draft.members.map((m, i) => {
2883
- const talent = byId(m.talent) || { name: m.talent, role: '' };
2884
- return h('div', { key: i, className: 'at-teamrow' },
2885
- h('input', { value: m.name, placeholder: talent.name, 'aria-label': t('teamName'), onChange: (e) => rename(i, e.target.value) }),
2886
- h('span', { className: 'at-modalmeta' }, talent.role),
2887
- h('label', { className: 'at-teamlead' }, h('input', { type: 'radio', name: 'team-lead', checked: draft.lead === i, onChange: () => setDraft({ ...draft, lead: i }) }), t('teamLead')),
2888
- h('button', { type: 'button', className: 'at-btn at-btn-small', 'aria-label': t('tcRemove'), onClick: () => remove(i) }, '×'));
2889
- }))),
2890
- h('div', { className: 'at-field' }, h('span', null, t('teamPick')),
2891
- h('input', { className: 'at-marketsearch', type: 'search', value: query, placeholder: t('talentSearch'), onChange: (e) => setQuery(e.target.value) }),
2892
- talents === null ? h('div', { className: 'at-modalmeta' }, t('talentLoading')) : h('div', { className: 'at-teampick' }, shown.map((talent) => h('div', { key: talent.id, className: 'at-teampickrow' },
2893
- h('span', null, talent.name + ' · ' + talent.role + (talent.source === 'user' ? ' · ' + t('talentUser') : '')),
2894
- h('button', { type: 'button', className: 'at-btn at-btn-small', onClick: () => add(talent) }, t('teamAdd')))))),
2992
+ h('div', { className: 'at-fieldrow' },
2993
+ h('label', { className: 'at-field' }, h('span', null, t('teamName')), h('input', { value: draft.name, onChange: (e) => setDraft({ ...draft, name: e.target.value }), autoFocus: true })),
2994
+ h('label', { className: 'at-field' }, h('span', null, t('teamDesc')), h('input', { value: draft.description, onChange: (e) => setDraft({ ...draft, description: e.target.value }) }))),
2895
2995
  error ? h('div', { className: 'at-modalerror', role: 'alert' }, error) : null,
2896
- h('div', { className: 'at-modalactions' },
2897
- h('button', { type: 'button', className: 'at-btn', onClick: onCancel }, t('teamBack')),
2898
- h('button', { type: 'button', className: 'at-btn at-btn-primary', disabled: busy || !draft.name.trim() || draft.members.length === 0, onClick: save }, busy ? t('saving') : t('teamSave'))));
2996
+ h('div', { className: 'at-teamcomposer' },
2997
+ h('div', { className: 'at-pane' },
2998
+ h('div', { className: 'at-panetitle' }, t('teamPick')),
2999
+ h('input', { className: 'at-marketsearch', type: 'search', value: query, placeholder: t('talentSearch'), 'aria-label': t('talentSearch'), onChange: (e) => setQuery(e.target.value) }),
3000
+ talents === null ? h('div', { className: 'at-modalmeta' }, t('talentLoading')) : h('div', { className: 'at-panelist', role: 'listbox', 'aria-label': t('teamPick') }, shown.map((talent) => h('button', {
3001
+ key: talent.id,
3002
+ type: 'button',
3003
+ role: 'option',
3004
+ className: 'at-pickrow',
3005
+ 'aria-selected': focused && focused.id === talent.id ? 'true' : 'false',
3006
+ onClick: () => setFocus(talent.id),
3007
+ onDoubleClick: () => add(talent),
3008
+ }, h('span', null, talent.name, ' ', h('span', { className: 'at-pickrole' }, talent.role)), talent.duty ? h('span', { className: 'at-pickrole' }, t(DUTY_LABEL[talent.duty])) : null)))),
3009
+ h('div', { className: 'at-pane' },
3010
+ h('div', { className: 'at-panetitle' }, t('teamPickDetail')),
3011
+ focused ? h('div', { className: 'at-talent' },
3012
+ h(TalentInfo, { t, talent: focused, full: true }),
3013
+ h('div', { className: 'at-talentfoot' },
3014
+ h('span', { className: 'at-modalmeta' }, [focused.category, ...(focused.tags ?? [])].filter(Boolean).join(' · ')),
3015
+ h('span', { className: 'at-tcpick' }, h('button', { type: 'button', className: 'at-btn at-btn-small at-btn-primary', onClick: () => add(focused) }, withIco('plus', t('teamAdd'), 12)))))
3016
+ : h('div', { className: 'at-modalmeta' }, t('teamPickDetailEmpty'))),
3017
+ h('div', { className: 'at-pane' },
3018
+ h('div', { className: 'at-panetitle' }, t('teamMembers') + ' · ' + draft.members.length),
3019
+ draft.members.length === 0 ? h('div', { className: 'at-modalmeta' }, t('teamEmptyPick')) : h('div', { className: 'at-teamrows' }, draft.members.map((m, i) => {
3020
+ const talent = byId(m.talent) || { name: m.talent, role: '' };
3021
+ return h('div', { key: i, className: 'at-teamrow' },
3022
+ h('input', { value: m.name, placeholder: talent.name, 'aria-label': t('teamName'), onChange: (e) => rename(i, e.target.value), onFocus: () => setFocus(m.talent) }),
3023
+ h('span', { className: 'at-modalmeta' }, talent.role),
3024
+ h('label', { className: 'at-teamlead' }, h('input', { type: 'radio', name: 'team-lead', checked: draft.lead === i, onChange: () => setDraft({ ...draft, lead: i }) }), t('teamLead')),
3025
+ h('button', { type: 'button', className: 'at-btn at-btn-small at-iconbtn', 'aria-label': t('tcRemove'), title: t('tcRemove'), onClick: () => remove(i) }, h(Ico, { name: 'close', size: 12 })));
3026
+ })))));
2899
3027
  }
2900
3028
  function ModelFields({ t, catalog, provider, model, effort, onEffort, onProvider, onModel, error }) {
2901
3029
  const providers = Array.isArray(catalog?.providers) ? catalog.providers.slice() : [];
@@ -3349,6 +3477,9 @@ window.__ModuleLoader__.load({
3349
3477
  const [pSkill, setPSkill] = React.useState('');
3350
3478
  const [pMessage, setPMessage] = React.useState('');
3351
3479
  const [pEvolve, setPEvolve] = React.useState('');
3480
+ const [pTab, setPTab] = React.useState('basic');
3481
+ // 人员池「配置模型」弹窗:选中的成员名(null = 关)。
3482
+ const [peopleModel, setPeopleModel] = React.useState(null);
3352
3483
  const [newOpen, setNewOpen] = React.useState(false);
3353
3484
  const [nName, setNName] = React.useState('');
3354
3485
  const [nGoal, setNGoal] = React.useState('');
@@ -3785,62 +3916,30 @@ window.__ModuleLoader__.load({
3785
3916
  loadPeople();
3786
3917
  }).catch((error) => sayRight(tf(t, 'sendFailed', { message: error?.message ?? String(error) })));
3787
3918
  }
3788
- // P2:人员池统一配置模型——对同名成员在其所有项目逐个
3789
- // member.config.update(跨项目批量,免逐项目进资料面板)。
3790
- // catalog 形状:providers[] = { id, name, models: [{ id, name }] }。
3791
- async function configPersonModel(person) {
3792
- const providers = modelCatalog?.providers ?? [];
3793
- const labels = [];
3794
- const values = [];
3795
- for (const provider of providers) {
3796
- for (const entry of provider.models ?? []) {
3797
- // 兼容历史上可能出现的字符串模型项。
3798
- const modelId = typeof entry === 'string' ? entry : entry?.id;
3799
- const modelName = typeof entry === 'string' ? entry : (entry?.name ?? entry?.id);
3800
- if (typeof modelId !== 'string' || modelId === '') continue;
3801
- labels.push(provider.name + ' / ' + modelName);
3802
- values.push({ providerId: provider.id, providerName: provider.name, model: modelId, modelName });
3803
- if (labels.length >= 60) break;
3804
- }
3805
- if (labels.length >= 60) break;
3806
- }
3807
- if (labels.length === 0) { say(t('modelCatalogEmpty')); return; }
3808
- const picked = await askPrompt(tf(t, 'personModelTitle', { name: person.name }), { options: labels });
3809
- if (picked === null) return;
3810
- // 用索引映射取值:模型显示名可能含分隔符,不能按字符串拆解。
3811
- const pickedIndex = labels.indexOf(picked);
3812
- const target = values[pickedIndex >= 0 ? pickedIndex : 0];
3813
- if (target === undefined) return;
3814
- // 该模型若支持推理等级,顺带让用户挑一档;读不到档位就保持模型默认,不阻断改模型。
3815
- let effort = '';
3816
- try {
3817
- const effortsQuery = '?provider=' + encodeURIComponent(target.providerId) + '&model=' + encodeURIComponent(target.model);
3818
- const effortsResponse = await fetch('/ai-team/api/model-efforts' + effortsQuery, { headers: { accept: 'application/json' } });
3819
- const effortsBody = await effortsResponse.json().catch(() => null);
3820
- const effortRows = Array.isArray(effortsBody?.efforts) ? effortsBody.efforts : [];
3821
- if (effortRows.length > 0) {
3822
- const effortLabels = [t('memberReasoningDefault')].concat(effortRows.map((entry) => (entry.name === entry.id ? entry.id : entry.name + ' · ' + entry.id)));
3823
- const pickedEffort = await askPrompt(tf(t, 'memberReasoningAsk', { model: target.modelName ?? target.model }), { options: effortLabels });
3824
- if (pickedEffort !== null) {
3825
- const effortIndex = effortLabels.indexOf(pickedEffort) - 1;
3826
- if (effortIndex >= 0 && effortRows[effortIndex] !== undefined) effort = effortRows[effortIndex].id;
3827
- }
3828
- }
3829
- } catch { /* 读不到档位时按模型默认走 */ }
3830
- const patch = { provider: target.providerId, model: target.model, ...(effort === '' ? {} : { reasoningEffort: effort }) };
3919
+ // P2:人员池配置模型——选中的成员在其所在的全部项目逐个 member.config.update(批量;单人也走这里)。
3920
+ // 成员资料里的单独设置保留,不受影响(以后再单独改即可)。
3921
+ function configPersonModel(names) {
3922
+ if (!Array.isArray(names) || names.length === 0) return;
3923
+ setPeopleModel(names);
3924
+ }
3925
+ async function applyPeopleModel(names, patch) {
3926
+ const chosen = new Set(names);
3831
3927
  let done = 0; let failed = 0;
3832
- for (const row of person.projects ?? []) {
3833
- const memberIds = Array.isArray(row.memberIds) ? row.memberIds : [];
3834
- for (const memberId of memberIds) {
3835
- try {
3836
- await runCommand('member.config.update', { memberId, patch, reason: 'people pool model' }, row.projectId);
3837
- done += 1;
3838
- } catch {
3839
- failed += 1;
3928
+ for (const person of peopleData ?? []) {
3929
+ if (!chosen.has(person.name)) continue;
3930
+ for (const row of person.projects ?? []) {
3931
+ for (const memberId of Array.isArray(row.memberIds) ? row.memberIds : []) {
3932
+ try {
3933
+ await runCommand('member.config.update', { memberId, patch, reason: 'people pool model' }, row.projectId);
3934
+ done += 1;
3935
+ } catch {
3936
+ failed += 1;
3937
+ }
3840
3938
  }
3841
3939
  }
3842
3940
  }
3843
- sayRight(tf(t, 'personModelDone', { name: person.name, model: target.modelName ?? target.model, done, failed }));
3941
+ setPeopleModel(null);
3942
+ sayRight(tf(t, 'peopleModelDone', { people: chosen.size, model: patch.model, done, failed }));
3844
3943
  await reloadData();
3845
3944
  loadPeople();
3846
3945
  }
@@ -4436,6 +4535,7 @@ window.__ModuleLoader__.load({
4436
4535
  function openProfile(agent) {
4437
4536
  setProfileAgent(agent);
4438
4537
  setPEvolve('');
4538
+ setPTab('basic');
4439
4539
  setPName(agent.name ?? '');
4440
4540
  setPRole(agent.role ?? '');
4441
4541
  setPPersonality(agent.personality ?? '');
@@ -4945,7 +5045,7 @@ window.__ModuleLoader__.load({
4945
5045
  const memberViewAgent = data.agents.find((agent) => agent.id === memberViewId) ?? null;
4946
5046
  const memberViewTasks = memberViewAgent === null ? [] : tasks.filter((task) => task.ownerId === memberViewAgent.id || task.assigneeId === memberViewAgent.id);
4947
5047
  const headerTitle = inPeople ? t('peopleTitle') : inInbox ? t('inboxTitle') : project ? '# ' + project.name : t('noProject');
4948
- const headerGoal = inPeople ? t('peopleEmpty') : inInbox ? t('inboxGoal') : (project?.goal ?? '');
5048
+ const headerGoal = inPeople ? t('peopleGoal') : inInbox ? t('inboxGoal') : (project?.goal ?? '');
4949
5049
  const unread = inboxUnread > 99 ? '99+' : inboxUnread;
4950
5050
 
4951
5051
  const leftProps = {
@@ -5288,17 +5388,17 @@ window.__ModuleLoader__.load({
5288
5388
  }) : null,
5289
5389
  addOpen ? h(ModalBack, { onClose: () => setAddOpen(false) },
5290
5390
  h('form', {
5291
- className: mTab === 'market' && !(mCopy && !mCopy.talent) ? 'at-modal at-modal-wide' : 'at-modal',
5391
+ className: 'at-modal at-modal-wide',
5292
5392
  role: 'dialog',
5293
5393
  'aria-modal': 'true',
5294
5394
  'aria-label': t('addAgentTitle'),
5295
5395
  onSubmit: (event) => { event.preventDefault(); createAgent(); },
5296
5396
  },
5297
- h('h2', { className: 'at-modaltitle' }, mCopy && !mCopy.talent ? t('memberCopy') : t('addAgentTitle')),
5397
+ h('h2', { className: 'at-modaltitle' }, withIco(mCopy && !mCopy.talent ? 'copy' : 'userPlus', mCopy && !mCopy.talent ? t('memberCopy') : t('addAgentTitle'), 16)),
5298
5398
  mCopy && !mCopy.talent ? null : h('div', { className: 'at-mode at-addtabs', role: 'group', 'aria-label': t('addAgentTitle') },
5299
- h('button', { type: 'button', 'aria-pressed': mTab === 'market' ? 'true' : 'false', onClick: () => setMTab('market') }, t('talentMarket')),
5300
- h('button', { type: 'button', 'aria-pressed': mTab === 'custom' ? 'true' : 'false', onClick: () => setMTab('custom') }, t('talentCustom')),
5301
- h('button', { type: 'button', 'aria-pressed': mTab === 'create' ? 'true' : 'false', onClick: () => setMTab('create') }, t('talentCreate'))),
5399
+ h('button', { type: 'button', 'aria-pressed': mTab === 'market' ? 'true' : 'false', onClick: () => setMTab('market') }, withIco('store', t('talentMarket'), 12)),
5400
+ h('button', { type: 'button', 'aria-pressed': mTab === 'custom' ? 'true' : 'false', onClick: () => setMTab('custom') }, withIco('pen', t('talentCustom'), 12)),
5401
+ h('button', { type: 'button', 'aria-pressed': mTab === 'create' ? 'true' : 'false', onClick: () => setMTab('create') }, withIco('plus', t('talentCreate'), 12))),
5302
5402
  mTab === 'market' && !(mCopy && !mCopy.talent) ? h(TalentMarket, {
5303
5403
  t,
5304
5404
  talents,
@@ -5351,38 +5451,63 @@ window.__ModuleLoader__.load({
5351
5451
  h('button', { className: 'at-btn at-btn-primary', type: 'submit', disabled: mBusy || !mName.trim() }, mBusy ? t('memberAdding') : t('memberCreate')))])) : null,
5352
5452
  profileAgent ? h(ModalBack, { onClose: () => setProfileAgent(null) },
5353
5453
  h('form', {
5354
- className: 'at-modal',
5454
+ className: 'at-modal at-modal-wide',
5355
5455
  role: 'dialog',
5356
5456
  'aria-modal': 'true',
5357
5457
  'aria-label': t('memberProfileTitle'),
5358
5458
  onSubmit: (event) => { event.preventDefault(); saveProfile(); },
5359
5459
  },
5360
- h('h2', { className: 'at-modaltitle' }, tf(t, 'memberProfileTitleName', { name: profileAgent.name })),
5460
+ h('h2', { className: 'at-modaltitle' }, withIco('user', tf(t, 'memberProfileTitleName', { name: profileAgent.name }), 16)),
5461
+ // 右上角按钮按用途分组:去看(任务 / 对话)· 复用(复制 / 存为人才)· 会话维护(重试 / 重置 / 重新蒸馏,黄)· 离开(红)· 取消 / 保存。
5462
+ h('div', { className: 'at-modalactions' },
5463
+ h('button', { className: 'at-btn at-btn-small', type: 'button', onClick: () => { const target = profileAgent; setProfileAgent(null); openMemberView(target); } }, withIco('board', t('memberTasks'), 12)),
5464
+ h('button', { className: 'at-btn at-btn-small', type: 'button', onClick: () => { const target = profileAgent; setProfileAgent(null); void openAgentChat(target); } }, withIco('reply', t('agentChat'), 12)),
5465
+ h('span', { className: 'at-actsep', 'aria-hidden': 'true' }),
5466
+ h('button', { className: 'at-btn at-btn-small at-btn-accent', type: 'button', onClick: () => { const source = profileAgent; setProfileAgent(null); openCopyAgent(source); }, disabled: pBusy }, withIco('copy', t('memberCopy'), 12)),
5467
+ h('button', { className: 'at-btn at-btn-small at-btn-accent', type: 'button', onClick: () => { const source = profileAgent; setProfileAgent(null); void openSaveAsTalent(source); }, disabled: pBusy }, withIco('store', t('memberSaveAsTalent'), 12)),
5468
+ h('span', { className: 'at-actsep', 'aria-hidden': 'true' }),
5469
+ profileAgent.status === 'failed' ? h('button', { className: 'at-btn at-btn-small at-btn-warn', type: 'button', onClick: retryProfile, disabled: pBusy }, withIco('sync', t('retry'), 12)) : null,
5470
+ profileAgent.sessionId ? h('button', { className: 'at-btn at-btn-small at-btn-warn', type: 'button', title: t('reseatConfirm'), onClick: reseatProfile, disabled: pBusy }, withIco('undo', t('reseatSession'), 12)) : null,
5471
+ h('button', { className: 'at-btn at-btn-small at-btn-warn', type: 'button', onClick: distillProfile, disabled: pBusy }, withIco('spark', t('redistill'), 12)),
5472
+ h('button', { className: 'at-btn at-btn-small at-btn-danger', type: 'button', onClick: leaveProfile, disabled: pBusy }, withIco('block', t('leaveTeam'), 12)),
5473
+ h('span', { className: 'at-actsep', 'aria-hidden': 'true' }),
5474
+ h('button', { className: 'at-btn', type: 'button', onClick: () => setProfileAgent(null), disabled: pBusy }, withIco('close', t('cancel'))),
5475
+ h('button', { className: 'at-btn at-btn-primary', type: 'submit', disabled: pBusy || !pName.trim() }, withIco('check', pBusy ? t('saving') : t('save')))),
5361
5476
  h('div', { className: 'at-modalmeta' },
5362
- tf(t, 'memberProfileMeta', {
5363
- status: t(AGENT_STATUS[profileAgent.status] ?? 'agentIdle'),
5364
- version: profileAgent.profileVersion ?? 1,
5365
- distill: profileAgent.distillVersion ?? 0,
5366
- })),
5477
+ tf(t, 'memberProfileMeta', {
5478
+ status: t(AGENT_STATUS[profileAgent.status] ?? 'agentIdle'),
5479
+ version: profileAgent.profileVersion ?? 1,
5480
+ distill: profileAgent.distillVersion ?? 0,
5481
+ })),
5367
5482
  // R-02 权限可见性:把守卫背后的运行事实亮给用户(P6 诚实边界)。
5368
5483
  h('div', { className: 'at-permbadge', title: t('permissionNote') },
5369
5484
  t('permissionBadge') + ' @ ' + (project?.workspacePath || '—')),
5370
- h('div', { className: 'at-modalmeta' }, t('permissionNote')),
5371
- profileAgent.skills?.length
5372
- ? h('div', { className: 'at-tcskills', 'aria-label': t('memberSkills') },
5373
- h('span', { className: 'at-modalmeta' }, t('memberSkills') + ':'),
5374
- profileAgent.skills.map((name) => h('span', { key: name, className: 'at-tcskill' }, name,
5375
- h('button', { type: 'button', className: 'at-btn at-btn-small', title: t('skillEvolveHint'), onClick: () => void evolveSkill(profileAgent, name) }, t('skillEvolve')))))
5376
- : null,
5377
- pEvolve ? h('div', { className: 'at-modalmeta', role: 'status' }, pEvolve) : null,
5378
- profileAgent.notes?.length ? h('div', { className: 'at-modalmeta' }, t('memberNotes') + ':' + profileAgent.notes.slice(-3).join(';')) : null,
5379
- h('label', { className: 'at-field' }, h('span', null, t('memberName')),
5380
- h('input', { value: pName, onChange: (event) => setPName(event.target.value), autoFocus: true })),
5381
- h('label', { className: 'at-field' }, h('span', null, t('memberRole')),
5382
- h('input', { value: pRole, onChange: (event) => setPRole(event.target.value) })),
5383
- h('label', { className: 'at-field' }, h('span', null, t('memberPersonality')),
5384
- h('textarea', { value: pPersonality, onChange: (event) => setPPersonality(event.target.value) })),
5385
- h('div', { className: 'at-fieldrow' },
5485
+ pError ? h('div', { className: 'at-modalerror', role: 'alert' }, pError) : null,
5486
+ // 仿系统设置:按用途分页签,一页只放一类设置。
5487
+ h('div', { className: 'at-mode at-addtabs', role: 'tablist', 'aria-label': t('memberProfileTitle') },
5488
+ [['basic', 'user', 'profileTabBasic'], ['model', 'layers', 'profileTabModel'], ['skills', 'spark', 'profileTabSkills'], ['collab', 'reply', 'profileTabCollab']].map(([id, icon, key]) => h('button', {
5489
+ key: id,
5490
+ type: 'button',
5491
+ role: 'tab',
5492
+ 'aria-selected': pTab === id ? 'true' : 'false',
5493
+ 'aria-pressed': pTab === id ? 'true' : 'false',
5494
+ onClick: () => setPTab(id),
5495
+ }, withIco(icon, t(key), 12)))),
5496
+ pTab === 'basic' ? [
5497
+ h('div', { key: 'nr', className: 'at-fieldrow' },
5498
+ h('label', { className: 'at-field' }, h('span', null, t('memberName')),
5499
+ h('input', { value: pName, onChange: (event) => setPName(event.target.value), autoFocus: true })),
5500
+ h('label', { className: 'at-field' }, h('span', null, t('memberRole')),
5501
+ h('input', { value: pRole, onChange: (event) => setPRole(event.target.value) }))),
5502
+ h('label', { key: 'pers', className: 'at-field' }, h('span', null, t('memberPersonality')),
5503
+ h('textarea', { value: pPersonality, rows: 6, onChange: (event) => setPPersonality(event.target.value) })),
5504
+ h('div', { key: 'notes', className: 'at-field' }, h('span', null, t('profileNotes')),
5505
+ profileAgent.notes?.length ? h('div', { className: 'at-notesbox' }, profileAgent.notes.slice(-3).join('\n\n')) : null,
5506
+ h('div', { className: 'at-inlineadd' },
5507
+ h('input', { value: pNote, onChange: (event) => setPNote(event.target.value), placeholder: t('notePlaceholder') }),
5508
+ h('button', { className: 'at-btn at-btn-small', type: 'button', onClick: addNote, disabled: !pNote.trim() }, withIco('plus', t('addNote'), 12)))),
5509
+ ] : null,
5510
+ pTab === 'model' ? h('div', { className: 'at-fieldgrid3' },
5386
5511
  h('label', { className: 'at-field' }, h('span', null, t('memberPreset')),
5387
5512
  h('select', { value: pPreset, onChange: (event) => setPPreset(event.target.value) },
5388
5513
  h('option', { value: 'standard' }, t('presetStandard')),
@@ -5390,54 +5515,50 @@ window.__ModuleLoader__.load({
5390
5515
  h('option', { value: 'minimal' }, t('presetMinimal')),
5391
5516
  h('option', { value: 'cordis' }, t('presetCordis')))),
5392
5517
  h('label', { className: 'at-field' }, h('span', null, t('memberMaxTokens')),
5393
- h('input', { value: pMaxTokens, onChange: (event) => setPMaxTokens(event.target.value), inputMode: 'numeric' }))),
5394
- h(ModelFields, {
5395
- t,
5396
- catalog: modelCatalog,
5397
- provider: pProvider,
5398
- effort: pEffort,
5399
- onEffort: setPEffort,
5400
- model: pModel,
5401
- onProvider: setPProvider,
5402
- onModel: setPModel,
5403
- error: modelCatalogError,
5404
- }),
5405
- h('label', { className: 'at-field' }, h('span', null, t('successor')),
5406
- h('select', {
5407
- value: pSuccessor,
5408
- onChange: (event) => setPSuccessor(event.target.value),
5409
- },
5410
- h('option', { value: '' }, t('noSuccessor')),
5411
- (data?.agents ?? []).filter((candidate) => candidate.id !== profileAgent.id && candidate.status !== 'retired')
5412
- .map((candidate) => h('option', { key: candidate.id, value: candidate.id }, candidate.name + (candidate.qa ? ' · QA' : ''))))),
5413
- h('div', { className: 'at-inlineadd' },
5414
- h('input', { value: pNote, onChange: (event) => setPNote(event.target.value), placeholder: t('notePlaceholder') }),
5415
- h('button', { className: 'at-btn at-btn-small', type: 'button', onClick: addNote, disabled: !pNote.trim() }, t('addNote'))),
5416
- h('div', { className: 'at-inlineadd' },
5417
- h('input', { value: pSkill, onChange: (event) => setPSkill(event.target.value), placeholder: t('skillPlaceholder') }),
5418
- h('button', { className: 'at-btn at-btn-small', type: 'button', onClick: addSkill, disabled: !pSkill.trim() }, t('addSkill'))),
5419
- h('div', { className: 'at-inlineadd' },
5420
- h('input', {
5421
- value: pMessage,
5422
- onChange: (event) => setPMessage(event.target.value),
5423
- placeholder: t('messagePlaceholder'),
5424
- }),
5425
- h('button', { className: 'at-btn at-btn-small', type: 'button', onClick: sendMemberMessage, disabled: !pMessage.trim() }, t('sendMessage'))),
5426
- // 成员作为 DSH 子智能体管理:从「管理的子智能体」面板可直接对话;
5427
- // 此私信写入同一会话,成员下一轮回复。
5428
- h('div', { className: 'at-modalmeta' }, t('routingHint')),
5429
- pError ? h('div', { className: 'at-modalerror', role: 'alert' }, pError) : null,
5430
- h('div', { className: 'at-modalactions' },
5431
- h('button', { className: 'at-btn', type: 'button', onClick: () => setProfileAgent(null), disabled: pBusy }, t('cancel')),
5432
- h('button', { className: 'at-btn', type: 'button', onClick: () => { const target = profileAgent; setProfileAgent(null); openMemberView(target); } }, t('memberTasks')),
5433
- h('button', { className: 'at-btn', type: 'button', onClick: () => { const target = profileAgent; setProfileAgent(null); void openAgentChat(target); } }, t('agentChat')),
5434
- h('button', { className: 'at-btn', type: 'button', onClick: () => { const source = profileAgent; setProfileAgent(null); openCopyAgent(source); }, disabled: pBusy }, t('memberCopy')),
5435
- h('button', { className: 'at-btn', type: 'button', onClick: () => { const source = profileAgent; setProfileAgent(null); void openSaveAsTalent(source); }, disabled: pBusy }, t('memberSaveAsTalent')),
5436
- h('button', { className: 'at-btn', type: 'button', onClick: leaveProfile, disabled: pBusy }, t('leaveTeam')),
5437
- profileAgent.status === 'failed' ? h('button', { className: 'at-btn', type: 'button', onClick: retryProfile, disabled: pBusy }, t('retry')) : null,
5438
- profileAgent.sessionId ? h('button', { className: 'at-btn', type: 'button', title: t('reseatConfirm'), onClick: reseatProfile, disabled: pBusy }, t('reseatSession')) : null,
5439
- h('button', { className: 'at-btn', type: 'button', onClick: distillProfile, disabled: pBusy }, t('redistill')),
5440
- h('button', { className: 'at-btn at-btn-primary', type: 'submit', disabled: pBusy || !pName.trim() }, pBusy ? t('saving') : t('save'))))) : null,
5518
+ h('input', { value: pMaxTokens, onChange: (event) => setPMaxTokens(event.target.value), inputMode: 'numeric' })),
5519
+ h('span', { 'aria-hidden': 'true' }),
5520
+ h(ModelFields, {
5521
+ t,
5522
+ catalog: modelCatalog,
5523
+ provider: pProvider,
5524
+ effort: pEffort,
5525
+ onEffort: setPEffort,
5526
+ model: pModel,
5527
+ onProvider: setPProvider,
5528
+ onModel: setPModel,
5529
+ error: modelCatalogError,
5530
+ })) : null,
5531
+ pTab === 'skills' ? [
5532
+ profileAgent.skills?.length
5533
+ ? h('div', { key: 'list', className: 'at-tcskills', 'aria-label': t('memberSkills') },
5534
+ profileAgent.skills.map((name) => h('span', { key: name, className: 'at-tcskill' }, name,
5535
+ h('button', { type: 'button', className: 'at-btn at-btn-small', title: t('skillEvolveHint'), onClick: () => void evolveSkill(profileAgent, name) }, withIco('spark', t('skillEvolve'), 12)))))
5536
+ : null,
5537
+ pEvolve ? h('div', { key: 'ev', className: 'at-modalmeta', role: 'status' }, pEvolve) : null,
5538
+ h('div', { key: 'add', className: 'at-inlineadd' },
5539
+ h('input', { value: pSkill, onChange: (event) => setPSkill(event.target.value), placeholder: t('skillPlaceholder') }),
5540
+ h('button', { className: 'at-btn at-btn-small', type: 'button', onClick: addSkill, disabled: !pSkill.trim() }, withIco('plus', t('addSkill'), 12))),
5541
+ ] : null,
5542
+ pTab === 'collab' ? [
5543
+ h('label', { key: 'succ', className: 'at-field' }, h('span', null, t('successor')),
5544
+ h('select', {
5545
+ value: pSuccessor,
5546
+ onChange: (event) => setPSuccessor(event.target.value),
5547
+ },
5548
+ h('option', { value: '' }, t('noSuccessor')),
5549
+ (data?.agents ?? []).filter((candidate) => candidate.id !== profileAgent.id && candidate.status !== 'retired')
5550
+ .map((candidate) => h('option', { key: candidate.id, value: candidate.id }, candidate.name + (candidate.qa ? ' · QA' : ''))))),
5551
+ h('div', { key: 'msg', className: 'at-inlineadd' },
5552
+ h('input', {
5553
+ value: pMessage,
5554
+ onChange: (event) => setPMessage(event.target.value),
5555
+ placeholder: t('messagePlaceholder'),
5556
+ }),
5557
+ h('button', { className: 'at-btn at-btn-small', type: 'button', onClick: sendMemberMessage, disabled: !pMessage.trim() }, withIco('reply', t('sendMessage'), 12))),
5558
+ // 成员作为 DSH 子智能体管理:从「管理的子智能体」面板可直接对话;
5559
+ // 此私信写入同一会话,成员下一轮回复。
5560
+ h('div', { key: 'hint', className: 'at-modalmeta' }, t('routingHint')),
5561
+ ] : null)) : null,
5441
5562
  workspaceOpen ? h(ModalBack, { onClose: () => setWorkspaceOpen(false) },
5442
5563
  h('form', {
5443
5564
  className: 'at-modal',
@@ -5458,37 +5579,45 @@ window.__ModuleLoader__.load({
5458
5579
  h('button', { className: 'at-btn at-btn-primary', type: 'submit', disabled: workspaceBusy || !workspaceDraft.trim() }, workspaceBusy ? t('saving') : t('workspaceSave'))))) : null,
5459
5580
  newOpen ? h(ModalBack, { onClose: () => setNewOpen(false) },
5460
5581
  h('form', {
5461
- className: 'at-modal',
5582
+ className: 'at-modal at-modal-wide',
5462
5583
  role: 'dialog',
5463
5584
  'aria-modal': 'true',
5464
5585
  'aria-label': t('newProjectTitle'),
5465
5586
  onSubmit: (event) => { event.preventDefault(); createProject(); },
5466
5587
  },
5467
- h('h2', { className: 'at-modaltitle' }, t('newProjectTitle')),
5468
- h('label', { className: 'at-field' }, h('span', null, t('projectName')),
5469
- h('input', { value: nName, onChange: (event) => setNName(event.target.value), autoFocus: true })),
5470
- h('label', { className: 'at-field' }, h('span', null, t('projectGoal')),
5471
- h('textarea', { value: nGoal, onChange: (event) => setNGoal(event.target.value) })),
5472
- h('label', { className: 'at-field' }, h('span', null, t('workspace')),
5473
- h('div', { className: 'at-inlineadd' },
5474
- h('input', { value: nWorkspace, onChange: (event) => setNWorkspace(event.target.value), placeholder: data?.workspaceExample ?? t('workspacePathPlaceholder') }),
5475
- h('button', { className: 'at-btn at-btn-small', type: 'button', onClick: pickNewWorkspace }, t('workspaceChoose')))),
5476
- h('label', { className: 'at-field' }, h('span', null, t('projectTeam')),
5477
- teamList === null ? h('div', { className: 'at-modalmeta' }, t('talentLoading'))
5478
- : 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') : ''))))),
5479
- selectedTeam ? h('div', { className: 'at-modalmeta' }, (selectedTeam.description ? selectedTeam.description + ':' : '') + teamMembersLine(selectedTeam)) : null,
5480
- teamLoadError ? h('div', { className: 'at-modalerror', role: 'alert' }, teamLoadError) : null,
5481
- h('div', { className: 'at-tcpick' },
5482
- h('button', { className: 'at-btn at-btn-small', type: 'button', onClick: () => { setTeamComposeOpen(true); loadTalents(); } }, t('teamCompose')),
5483
- selectedTeam && selectedTeam.source === 'user' ? h('button', { className: 'at-btn at-btn-small', type: 'button', onClick: () => void removeTeam(selectedTeam) }, t('teamDelete')) : null),
5484
- nError ? h('div', { className: 'at-modalerror', role: 'alert' }, nError) : null,
5588
+ h('h2', { className: 'at-modaltitle' }, withIco('folderPlus', t('newProjectTitle'), 16)),
5485
5589
  h('div', { className: 'at-modalactions' },
5486
- h('button', { className: 'at-btn', type: 'button', onClick: () => setNewOpen(false), disabled: nBusy }, t('cancel')),
5487
- h('button', { className: 'at-btn at-btn-primary', type: 'submit', disabled: nBusy || !nName.trim() || !nWorkspace.trim() }, nBusy ? t('saving') : t('projectCreate'))))) : null,
5590
+ h('button', { className: 'at-btn', type: 'button', onClick: () => setNewOpen(false), disabled: nBusy }, withIco('close', t('cancel'))),
5591
+ h('button', { className: 'at-btn at-btn-primary', type: 'submit', disabled: nBusy || !nName.trim() || !nWorkspace.trim() }, withIco('check', nBusy ? t('saving') : t('projectCreate')))),
5592
+ nError ? h('div', { className: 'at-modalerror', role: 'alert' }, nError) : null,
5593
+ h('div', { className: 'at-split' },
5594
+ h('div', { className: 'at-pane' },
5595
+ h('label', { className: 'at-field' }, h('span', null, t('projectName')),
5596
+ h('input', { value: nName, onChange: (event) => setNName(event.target.value), autoFocus: true })),
5597
+ h('label', { className: 'at-field' }, h('span', null, t('projectGoal')),
5598
+ h('textarea', { value: nGoal, rows: 5, onChange: (event) => setNGoal(event.target.value) })),
5599
+ h('label', { className: 'at-field' }, h('span', null, t('workspace')),
5600
+ h('div', { className: 'at-inlineadd' },
5601
+ h('input', { value: nWorkspace, onChange: (event) => setNWorkspace(event.target.value), placeholder: data?.workspaceExample ?? t('workspacePathPlaceholder') }),
5602
+ h('button', { className: 'at-btn at-btn-small', type: 'button', onClick: pickNewWorkspace }, withIco('folderPlus', t('workspaceChoose'), 12)))),
5603
+ h('label', { className: 'at-field' }, h('span', null, t('projectTeam')),
5604
+ teamList === null ? h('div', { className: 'at-modalmeta' }, t('talentLoading'))
5605
+ : 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') : ''))))),
5606
+ teamLoadError ? h('div', { className: 'at-modalerror', role: 'alert' }, teamLoadError) : null,
5607
+ h('div', { className: 'at-tcpick' },
5608
+ h('button', { className: 'at-btn at-btn-small at-btn-accent', type: 'button', onClick: () => { setTeamComposeOpen(true); loadTalents(); } }, withIco('users', t('teamCompose'), 12)),
5609
+ 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)),
5610
+ // 右栏:选中团队的成员卡片(名字、岗位、职责、简介、技能;负责人标出来)。
5611
+ h('div', { className: 'at-pane' },
5612
+ selectedTeam ? h('div', { className: 'at-panetitle', title: teamMembersLine(selectedTeam) }, selectedTeam.name + ' · ' + tf(t, 'projectTeamMembers', { n: selectedTeam.members.length })) : null,
5613
+ selectedTeam && selectedTeam.description ? h('div', { className: 'at-modalmeta' }, selectedTeam.description) : null,
5614
+ selectedTeam ? h('div', { className: 'at-marketgrid', role: 'list' }, selectedTeam.members.map((member) => h('div', { key: member.id, className: 'at-talent', role: 'listitem' },
5615
+ h(TalentInfo, { t, talent: member, lead: member.id === selectedTeam.lead })))) : null)))) : null,
5488
5616
  teamComposeOpen ? h(ModalBack, { onClose: () => setTeamComposeOpen(false) },
5489
5617
  h('div', { className: 'at-modal at-modal-wide', role: 'dialog', 'aria-modal': 'true', 'aria-label': t('teamComposeTitle') },
5490
- h('h2', { className: 'at-modaltitle' }, t('teamComposeTitle')),
5618
+ h('h2', { className: 'at-modaltitle' }, withIco('users', t('teamComposeTitle'), 16)),
5491
5619
  h(TeamComposer, { t, talents, onSaved: (team) => { setTeamComposeOpen(false); void loadTeams(team && team.id); }, onCancel: () => setTeamComposeOpen(false) }))) : null,
5620
+ peopleModel ? h(PeopleModelDialog, { t, catalog: modelCatalog, catalogError: modelCatalogError, people: peopleData ?? [], initial: peopleModel, onApply: applyPeopleModel, onClose: () => setPeopleModel(null) }) : null,
5492
5621
  dialog ? h(WorkbenchDialog, { key: dialogSeqRef.current, t, dialog, onDismiss: () => setDialog(null) }) : null,
5493
5622
  shortcutsOpen ? h(ModalBack, { onClose: () => setShortcutsOpen(false) },
5494
5623
  h('div', { className: 'at-modal', role: 'dialog', 'aria-modal': 'true', 'aria-label': t('shortcutTitle') },
@@ -3,9 +3,12 @@
3
3
  *
4
4
  * 在线库是独立 npm 包 `@suifei/dsh-ai-team-catalog`,内容与插件内置同格式(talents/ + teams/),
5
5
  * 包根多一份 `index.json`:列出每个文件的相对路径、字节数与 sha256。同步时:
6
- * 1. 按镜像顺序(npmmirror → jsDelivr)问最新版本号;与本地 `current.json` 相同就不动;
7
- * 2. 取 index.json,校验格式号、版本、插件最低版本、路径白名单与大小上限;
8
- * 3. 逐个文件下载并核对 sha256,全部落进临时目录后整体改名为 `official/<版本>/`,再写 `current.json`;
6
+ * 1. 按镜像顺序(npmmirror → jsDelivr → npmjs)问最新版本号;与本地 `current.json` 相同就不动;
7
+ * 2. 取包内容:registry 型镜像下整个 tgz(核对 registry 给的 dist.integrity,再在内存里解 tar),
8
+ * CDN 型(jsDelivr)按文件取。npmmirror 的按文件接口只对白名单包开放(cnpm/unpkg-white-list,实测 403),
9
+ * 所以 registry 一律走 tgz;
10
+ * 3. 校验 index.json(格式号、版本、插件最低版本、路径白名单与大小上限),每个文件核对字节数与 sha256,
11
+ * 全部落进临时目录后整体改名为 `official/<版本>/`,再写 `current.json`;
9
12
  * 中途任何一步失败都丢掉临时目录,旧版本原样保留。
10
13
  * 读取时 `officialRoot()` 给出当前版本目录,插在用户自建与插件内置之间(lib/domain/catalog.js)。
11
14
  *
@@ -15,6 +18,7 @@
15
18
  import { createHash, randomBytes } from 'node:crypto';
16
19
  import { existsSync, mkdirSync, readdirSync, readFileSync, renameSync, rmSync, statSync, writeFileSync } from 'node:fs';
17
20
  import { dirname, join, relative, sep } from 'node:path';
21
+ import { gunzipSync } from 'node:zlib';
18
22
 
19
23
  export const CATALOG_PACKAGE = '@suifei/dsh-ai-team-catalog';
20
24
  /** index.json 的格式号;格式变了才升。 */
@@ -24,6 +28,8 @@ export const CATALOG_MIN_PLUGIN = '0.4.130';
24
28
  export const MAX_FILE_BYTES = 256 * 1024;
25
29
  export const MAX_TOTAL_BYTES = 8 * 1024 * 1024;
26
30
  export const MAX_FILES = 2000;
31
+ /** 整包 tgz 的上限(压缩前后)。 */
32
+ export const MAX_TARBALL_BYTES = 16 * 1024 * 1024;
27
33
 
28
34
  const SEMVER = /^(\d+)\.(\d+)\.(\d+)$/;
29
35
  const SLUG = '[a-z0-9][a-z0-9-]{0,63}';
@@ -31,18 +37,22 @@ const SKILL = '[A-Za-z0-9][A-Za-z0-9._-]{0,63}';
31
37
  const CATALOG_PATH = new RegExp(`^(?:talents/${SLUG}/talent\\.yml|teams/${SLUG}/team\\.yml|(?:talents|teams)/${SLUG}/skills/(?:${SKILL}/SKILL|${SKILL})\\.md)$`);
32
38
  const HEX64 = /^[0-9a-f]{64}$/;
33
39
 
34
- /** 镜像:先国内(npmmirror),再 jsDelivr。每个镜像自带「问最新版本」与「按文件取」两个地址。 */
40
+ /** registry 型镜像:`<base>/<pkg>/latest` 给版本,`<base>/<pkg>/<版本>` 给 dist(tarball + integrity),按整包取。 */
41
+ export function registryMirror(name, base) {
42
+ const root = String(base).replace(/\/+$/, '');
43
+ return Object.freeze({ name, kind: 'registry', latest: (pkg) => `${root}/${pkg}/latest`, manifest: (pkg, version) => `${root}/${pkg}/${version}` });
44
+ }
45
+
46
+ /** 镜像:先国内(npmmirror),再 jsDelivr(按文件取),最后 npmjs 官方源。 */
35
47
  export const MIRRORS = Object.freeze([
36
- Object.freeze({
37
- name: 'npmmirror',
38
- latest: (pkg) => `https://registry.npmmirror.com/${pkg}/latest`,
39
- file: (pkg, version, path) => `https://registry.npmmirror.com/${pkg}/${version}/files/${path}`,
40
- }),
48
+ registryMirror('npmmirror', 'https://registry.npmmirror.com'),
41
49
  Object.freeze({
42
50
  name: 'jsdelivr',
51
+ kind: 'cdn',
43
52
  latest: (pkg) => `https://data.jsdelivr.com/v1/packages/npm/${pkg}/resolved?specifier=latest`,
44
53
  file: (pkg, version, path) => `https://cdn.jsdelivr.net/npm/${pkg}@${version}/${path}`,
45
54
  }),
55
+ registryMirror('npmjs', 'https://registry.npmjs.org'),
46
56
  ]);
47
57
 
48
58
  /**
@@ -52,7 +62,7 @@ export const MIRRORS = Object.freeze([
52
62
  export function catalogMirrors(env = process.env) {
53
63
  const base = typeof env?.DSH_AI_TEAM_CATALOG_MIRROR === 'string' ? env.DSH_AI_TEAM_CATALOG_MIRROR.trim().replace(/\/+$/, '') : '';
54
64
  if (!/^https?:\/\//.test(base)) return MIRRORS;
55
- return [{ name: 'custom', latest: (pkg) => `${base}/${pkg}/latest`, file: (pkg, version, path) => `${base}/${pkg}/${version}/files/${path}` }];
65
+ return [registryMirror('custom', base)];
56
66
  }
57
67
 
58
68
  /** 在线库里允许出现的文件:人才 talent.yml、团队 team.yml、两者 skills/ 下的技能 Markdown。不允许 `..`、绝对路径、脚本。 */
@@ -179,11 +189,72 @@ export async function latestVersion({ fetchImpl = globalThis.fetch, mirrors = ca
179
189
  throw new Error(`取不到在线人才库版本(${errors.join(';')})`);
180
190
  }
181
191
 
192
+ function tarString(block, start, length) {
193
+ const end = block.indexOf(0, start);
194
+ return block.toString('utf8', start, end === -1 || end > start + length ? start + length : end);
195
+ }
196
+
197
+ /**
198
+ * 解 npm 包的 tar(ustar,含 pax 扩展头里的 path):返回 `package/` 下普通文件的 Map(相对路径 → 内容)。
199
+ * 只在内存里读,不写盘;目录、链接等其它类型忽略。
200
+ */
201
+ export function untar(buffer) {
202
+ const files = new Map();
203
+ let offset = 0;
204
+ let paxPath = null;
205
+ while (offset + 512 <= buffer.length) {
206
+ const block = buffer.subarray(offset, offset + 512);
207
+ if (block.every((byte) => byte === 0)) break;
208
+ const size = Number.parseInt(tarString(block, 124, 12).trim() || '0', 8);
209
+ if (!Number.isFinite(size) || size < 0) throw new Error('tar 头损坏');
210
+ const type = String.fromCharCode(block[156] || 48);
211
+ const prefix = tarString(block, 257, 6) === 'ustar' ? tarString(block, 345, 155) : '';
212
+ const name = paxPath ?? (prefix ? `${prefix}/${tarString(block, 0, 100)}` : tarString(block, 0, 100));
213
+ const body = buffer.subarray(offset + 512, offset + 512 + size);
214
+ if (body.length !== size) throw new Error('tar 被截断');
215
+ offset += 512 + Math.ceil(size / 512) * 512;
216
+ if (type === 'x') {
217
+ const match = /(?:^|\n)\d+ path=([^\n]*)\n/.exec(body.toString('utf8'));
218
+ paxPath = match ? match[1] : null;
219
+ continue;
220
+ }
221
+ paxPath = null;
222
+ if ((type !== '0' && type !== '7') || !name.startsWith('package/')) continue;
223
+ files.set(name.slice('package/'.length), Buffer.from(body));
224
+ }
225
+ return files;
226
+ }
227
+
228
+ /** 用 registry 给的 integrity(`sha512-<base64>`)核对整包。 */
229
+ function checkIntegrity(buffer, integrity) {
230
+ const entry = String(integrity ?? '').split(/\s+/).find((x) => x.startsWith('sha512-'));
231
+ if (entry === undefined) throw new Error('registry 没给 sha512 integrity');
232
+ if (createHash('sha512').update(buffer).digest('base64') !== entry.slice('sha512-'.length)) throw new Error('整包 integrity 校验不符');
233
+ }
234
+
235
+ /** 取包里文件的方法:registry 型一次下整包、核对 integrity 后从内存取;CDN 型按文件下。 */
236
+ async function packageReader(mirror, { fetchImpl, pkg, version, timeoutMs }) {
237
+ if (mirror.kind !== 'registry') {
238
+ return async (path) => Buffer.from(await (await fetchOk(fetchImpl, mirror.file(pkg, version, path), timeoutMs)).arrayBuffer());
239
+ }
240
+ const manifest = await (await fetchOk(fetchImpl, mirror.manifest(pkg, version), timeoutMs)).json();
241
+ if (manifest?.version !== version || typeof manifest?.dist?.tarball !== 'string') throw new Error('registry 没给出这个版本的 tarball');
242
+ const tgz = Buffer.from(await (await fetchOk(fetchImpl, manifest.dist.tarball, timeoutMs)).arrayBuffer());
243
+ if (tgz.length > MAX_TARBALL_BYTES) throw new Error('整包超限');
244
+ checkIntegrity(tgz, manifest.dist.integrity);
245
+ const files = untar(gunzipSync(tgz, { maxOutputLength: MAX_TARBALL_BYTES * 2 }));
246
+ return async (path) => {
247
+ const buffer = files.get(path);
248
+ if (buffer === undefined) throw new Error(`包里缺文件:${path}`);
249
+ return buffer;
250
+ };
251
+ }
252
+
182
253
  async function downloadFrom(mirror, { fetchImpl, pkg, version, pluginVersion, timeoutMs, staging }) {
183
- const indexRes = await fetchOk(fetchImpl, mirror.file(pkg, version, 'index.json'), timeoutMs);
184
- const files = validateIndex(JSON.parse(Buffer.from(await indexRes.arrayBuffer()).toString('utf8')), { version, pluginVersion });
254
+ const read = await packageReader(mirror, { fetchImpl, pkg, version, timeoutMs });
255
+ const files = validateIndex(JSON.parse((await read('index.json')).toString('utf8')), { version, pluginVersion });
185
256
  for (const file of files) {
186
- const buffer = Buffer.from(await (await fetchOk(fetchImpl, mirror.file(pkg, version, file.path), timeoutMs)).arrayBuffer());
257
+ const buffer = await read(file.path);
187
258
  if (buffer.length !== file.size || sha256(buffer) !== file.sha256) throw new Error(`校验不符:${file.path}`);
188
259
  const target = join(staging, ...file.path.split('/'));
189
260
  mkdirSync(dirname(target), { recursive: true });
@@ -355,7 +355,7 @@ export function listTeams(catalog) {
355
355
  .map((entry) => {
356
356
  const members = entry.members.map((m) => {
357
357
  const t = catalog.talents.get(m.talent);
358
- return { id: m.id, talent: m.talent, name: m.name || t?.name || m.talent, role: m.role || t?.role || '', duty: m.duty ?? t?.duty ?? null, missing: t === undefined };
358
+ return { id: m.id, talent: m.talent, name: m.name || t?.name || m.talent, role: m.role || t?.role || '', duty: m.duty ?? t?.duty ?? null, description: t?.description ?? '', category: t?.category ?? '', skills: [...new Set([...(t?.skills ?? []), ...(m.skills ?? [])])], missing: t === undefined };
359
359
  });
360
360
  return { id: entry.id, source: entry.source, name: entry.name || entry.id, description: entry.description, lead: entry.lead, members, broken: members.some((m) => m.missing) };
361
361
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@suifei/dsh-ai-team",
3
- "version": "0.4.130",
3
+ "version": "0.4.132",
4
4
  "type": "module",
5
5
  "description": "文渊阁 (Wenyuan Pavilion) — AI Team mode for DeepSeek Harness: concurrent projects, owned tasks, threads, inbox and an append-only team ledger",
6
6
  "license": "MIT",