@suifei/dsh-ai-team 0.3.73 → 0.3.75

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,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.75 - 2026-11-12
4
+
5
+ - **P17 人员池同人绑定 UI 恢复**:人员池头部「同人绑定」表单(源名 → 目标人 → 绑定,POST /ai-team/api/people-aliases),跨项目身份合并可配置(host 路由此前已就绪,UI 在历史回退中丢失)。
6
+ - **P5a 取证定论**:direct-subagent address 经源码取证为**读取**子代理会话日志/历史投影的地址通路(kind:subagent 用 childSessionId 校验),非 Human 输入投递通路——原生直聊为宿主硬边界,最终确认不可达;等效通道为私信直通。
7
+ - 渲染 E2E #310 守卫在本次施工中实际拦截了两处新引入的 early-return 后 hooks(已改到 state 区)。
8
+
9
+
10
+ ## 0.3.74 - 2026-11-12
11
+
12
+ - **P2 人员池统一模型配置**:人员池行级「统一配置模型」入口——选 LLM 端点后对该成员在**所有项目**逐个 member.config.update(跨项目批量),免去逐项目×逐成员修改(NO_ADAPTER / max_tokens 超限场景的根治入口)。
13
+ - **P5b 工作目录存在性校验**:project.workspace.update 校验目录真实存在且为目录(配置不存在的目录会让成员会话 cwd 无效、回合全失败——用户实证 working-directory does not exist)。
14
+ - 回归测试:+2 host 级断言(不存在目录 → 409;最后 active 项目归档 → 409)。
15
+
16
+
3
17
  ## 0.3.73 - 2026-11-11
4
18
 
5
19
  - **项目头开关失效修复**:bootstrap 的 projects[] 在 registry 重映射时丢弃了 chatGate/runState(按钮状态永远默认「开」,点击后 UI 不更新);归档 409 修复:归档保护在 service 内判定(只见自己账本,恒为最后项目)→ 移到 Host 路由层用 registry 全局清单判定。
package/client.js CHANGED
@@ -393,6 +393,10 @@ window.__ModuleLoader__.load({
393
393
  teamBusyN: '在做 ×{n}',
394
394
  pendingAcceptanceN: '待验收 ×{n}',
395
395
  archivedCount: '已归档 {n}',
396
+ personModelBtn: '统一配置模型',
397
+ personModelTitle: '为「{name}」选择 LLM 端点(应用到其所有项目)',
398
+ personModelDone: '已把「{name}」配置为 {model}(成功 {done} 处,失败 {failed} 处)。',
399
+ modelCatalogEmpty: '模型目录为空:请先在 DSH 设置里配置可用的 LLM 端点。',
396
400
  q1Title: '需要你',
397
401
  q2Title: '团队在做',
398
402
  q3Title: '等待受阻',
@@ -806,6 +810,10 @@ window.__ModuleLoader__.load({
806
810
  teamBusyN: 'in progress ×{n}',
807
811
  pendingAcceptanceN: 'awaiting acceptance ×{n}',
808
812
  archivedCount: 'Archived {n}',
813
+ personModelBtn: 'Set model',
814
+ personModelTitle: 'Choose the LLM endpoint for "{name}" (applies to all its projects)',
815
+ personModelDone: 'Set "{name}" to {model} ({done} ok, {failed} failed).',
816
+ modelCatalogEmpty: 'The model catalog is empty: configure an LLM endpoint in DSH settings first.',
809
817
  q1Title: 'Needs you',
810
818
  q2Title: 'Team is doing',
811
819
  q3Title: 'Waiting / blocked',
@@ -1333,6 +1341,9 @@ window.__ModuleLoader__.load({
1333
1341
  .at-obstep.at-obdone .at-obmark { border-color: var(--dsw-alias-state-success-primary); color: var(--dsw-alias-state-success-primary); }
1334
1342
  .at-oblabel { flex: 1 1 auto; min-width: 0; }
1335
1343
  .at-peoplehead { display: flex; align-items: center; gap: 8px; margin: 0 12px 8px; }
1344
+ .at-aliasbox { margin: 0 12px 8px; border-bottom: 1px dashed var(--dsw-alias-border-l2); }
1345
+ .at-aliasrow { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 6px 0; }
1346
+ .at-aliasrow .at-decisioninput { flex: 1 1 120px; min-width: 90px; }
1336
1347
  .at-peoplecount { color: var(--dsw-alias-label-caption); font-size: 11px; margin-right: auto; }
1337
1348
  .at-permbadge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--dsw-alias-state-warn-primary); color: var(--dsw-alias-state-warn-label); font-size: 10.5px; }
1338
1349
  .at-msg-highlight { border-left: 2px solid var(--dsw-alias-state-business-primary); padding-left: 10px; }
@@ -1924,7 +1935,7 @@ window.__ModuleLoader__.load({
1924
1935
  * 人员池总览(全局层,11-管理视角 §2):按"人"聚合各项目身份。
1925
1936
  * 数据 = GET /ai-team/api/people(各项目账本 members/tasks 的只读聚合)。
1926
1937
  */
1927
- function PeoplePage({ t, people, error, loading, onOpenProject, onRefresh, localNames, onOpenPerson, onChatPerson }) {
1938
+ function PeoplePage({ t, people, error, loading, onOpenProject, onRefresh, localNames, onOpenPerson, onChatPerson, onConfigModel, onBindAlias, aliasDraft }) {
1928
1939
  if (error) return h('div', { className: 'at-stream', role: 'alert' },
1929
1940
  h('div', { className: 'at-streaminner' }, h(EmptyState, { t, icon: 'alert', title: t('peopleTitle'), body: tf(t, 'peopleLoadFailed', { message: error }) })));
1930
1941
  // loading 用中心区域骨架(流内行),不用整页 Skeleton——本组件位于
@@ -1943,6 +1954,14 @@ window.__ModuleLoader__.load({
1943
1954
  h('div', { className: 'at-peoplehead' },
1944
1955
  h('span', { className: 'at-peoplecount' }, loading ? t('loading') : tf(t, 'peopleProjects', { n: people.length })),
1945
1956
  h('button', { className: 'at-btn at-btn-small', type: 'button', onClick: onRefresh, disabled: loading }, t('refresh'))),
1957
+ onBindAlias ? h('details', { className: 'at-aliasbox' },
1958
+ h('summary', { className: 'at-peoplesum' }, h('span', { className: 'at-people-role' }, t('aliasTitle'))),
1959
+ h('div', { className: 'at-aliasrow' },
1960
+ h('input', { className: 'at-decisioninput', value: aliasDraft?.name ?? '', placeholder: t('aliasSourcePlaceholder'), onChange: (event) => aliasDraft.onName(event.target.value) }),
1961
+ h('span', { className: 'at-people-role' }, '→'),
1962
+ h('input', { className: 'at-decisioninput', value: aliasDraft?.target ?? '', placeholder: t('aliasTargetPlaceholder'), onChange: (event) => aliasDraft.onTarget(event.target.value) }),
1963
+ h('button', { className: 'at-btn at-btn-small', type: 'button', onClick: () => onBindAlias(aliasDraft?.target ?? '') }, t('aliasBind'))),
1964
+ h('div', { className: 'at-modalmeta' }, t('aliasHint'))) : null,
1946
1965
  people.map((person) => {
1947
1966
  const badges = [
1948
1967
  tf(t, 'peopleProjects', { n: person.projects.length }),
@@ -1954,7 +1973,10 @@ window.__ModuleLoader__.load({
1954
1973
  h(Avatar, { name: person.name, human: false }),
1955
1974
  h('span', { className: 'at-peoplename' }, person.name),
1956
1975
  person.role ? h('span', { className: 'at-people-role' }, person.role) : null,
1957
- h('span', { className: 'at-peoplebadges' }, badges.join(' · '))),
1976
+ h('span', { className: 'at-peoplebadges' }, badges.join(' · ')),
1977
+ // P2:统一配置该人在所有项目的 LLM 端点(人员池级入口,
1978
+ // 免去逐项目×逐成员修改)。
1979
+ onConfigModel ? h('button', { className: 'at-btn at-btn-small', type: 'button', onClick: (event) => { event.preventDefault(); onConfigModel(person); } }, t('personModelBtn')) : null),
1958
1980
  h('div', { className: 'at-peopleprojects' }, person.projects.map((row) => {
1959
1981
  const failed = row.lastFailure !== undefined && row.lastFailure !== null;
1960
1982
  const localHere = localNames.has(person.name);
@@ -2633,6 +2655,9 @@ window.__ModuleLoader__.load({
2633
2655
  // P1b 批量取消的忙碌标志——必须位于 Skeleton early-return 之前
2634
2656
  // (React hooks 数量在渲染间必须恒定,否则 #310)。
2635
2657
  const [cancelAllBusy, setCancelAllBusy] = React.useState(false);
2658
+ // P17 同人绑定输入(同上:hooks 必须在 early-return 之前)。
2659
+ const [aliasName, setAliasName] = React.useState('');
2660
+ const [aliasTarget, setAliasTarget] = React.useState('');
2636
2661
  // 自绘确认/输入对话框(替代原生 prompt/confirm,观感与宿主一致)。
2637
2662
  // dialog: { mode: 'confirm'|'prompt'|'choice', title, body, placeholder,
2638
2663
  // value, options, resolve } — resolve(false|null|字符串)。
@@ -2914,6 +2939,59 @@ window.__ModuleLoader__.load({
2914
2939
  sayRight(tf(t, 'sendFailed', { message: error?.message ?? String(error) }));
2915
2940
  }
2916
2941
  }
2942
+ // P17:人员池同人绑定(把另一个名字并到某人)——host 路由
2943
+ // POST /ai-team/api/people-aliases,绑定后聚合按 personId 合并。
2944
+ function bindAlias(personName) {
2945
+ const other = aliasName.trim();
2946
+ const target = (personName ?? aliasTarget).trim();
2947
+ if (!other || !target || other === target) { say(t('aliasRequired')); return; }
2948
+ fetch('/ai-team/api/people-aliases', {
2949
+ method: 'POST',
2950
+ headers: { 'content-type': 'application/json', accept: 'application/json' },
2951
+ body: JSON.stringify({ name: other, personId: target }),
2952
+ }).then(async (response) => {
2953
+ const payload = await response.json().catch(() => null);
2954
+ if (!response.ok) throw new Error(payload?.error?.message ?? ('HTTP ' + response.status));
2955
+ say(tf(t, 'aliasSaved', { name: other, person: target }));
2956
+ setAliasName('');
2957
+ loadPeople();
2958
+ }).catch((error) => sayRight(tf(t, 'sendFailed', { message: error?.message ?? String(error) })));
2959
+ }
2960
+ // P2:人员池统一配置模型——对同名成员在其所有项目逐个
2961
+ // member.config.update(跨项目批量,免逐项目进资料面板)。
2962
+ async function configPersonModel(person) {
2963
+ const providers = modelCatalog?.providers ?? [];
2964
+ const options = [];
2965
+ for (const provider of providers) {
2966
+ for (const model of provider.models ?? []) {
2967
+ options.push(provider.name + ' / ' + model);
2968
+ if (options.length >= 60) break;
2969
+ }
2970
+ if (options.length >= 60) break;
2971
+ }
2972
+ if (options.length === 0) { say(t('modelCatalogEmpty')); return; }
2973
+ const picked = await askPrompt(tf(t, 'personModelTitle', { name: person.name }), { options });
2974
+ if (picked === null) return;
2975
+ const chosen = options.includes(picked) ? picked : options[0];
2976
+ const [providerName, model] = chosen.split(' / ');
2977
+ const provider = providers.find((entry) => entry.name === providerName) ?? providers.find((entry) => entry.id === providerName);
2978
+ const patch = { provider: provider?.id ?? providerName, model };
2979
+ let done = 0; let failed = 0;
2980
+ for (const row of person.projects ?? []) {
2981
+ const memberIds = Array.isArray(row.memberIds) ? row.memberIds : [];
2982
+ for (const memberId of memberIds) {
2983
+ try {
2984
+ await runCommand('member.config.update', { memberId, patch, reason: 'people pool model' }, row.projectId);
2985
+ done += 1;
2986
+ } catch {
2987
+ failed += 1;
2988
+ }
2989
+ }
2990
+ }
2991
+ sayRight(tf(t, 'personModelDone', { name: person.name, model, done, failed }));
2992
+ await reloadData();
2993
+ loadPeople();
2994
+ }
2917
2995
  const inboxItems = (data.inbox ?? []).filter((item) => !isInformationalInboxItem(item));
2918
2996
  // R-13bis:Human↔成员对话门(项目级开关,账本留痕)。
2919
2997
  const chatGateClosed = (project?.chatGate ?? 'open') === 'closed';
@@ -3833,6 +3911,9 @@ window.__ModuleLoader__.load({
3833
3911
  if (target) void switchProject(target);
3834
3912
  else say(t('quadrantMissing'));
3835
3913
  },
3914
+ onConfigModel: configPersonModel,
3915
+ onBindAlias: bindAlias,
3916
+ aliasDraft: { name: aliasName, target: aliasTarget, onName: setAliasName, onTarget: setAliasTarget },
3836
3917
  })
3837
3918
  : inInbox
3838
3919
  ? h('div', { className: 'at-stream', role: 'region', 'aria-label': t('inboxTitle') },
package/index.js CHANGED
@@ -41,7 +41,7 @@ export const name = 'ai-team';
41
41
  /** The workbench only makes sense where the Web carrier exists. */
42
42
  export const inject = ['webServer', 'permissionPresets', 'sandboxPolicy'];
43
43
 
44
- const VERSION = '0.3.73';
44
+ const VERSION = '0.3.75';
45
45
  const PROJECT_ID = 'prj_main';
46
46
  const HUMAN_ID = 'mem_human';
47
47
 
@@ -440,6 +440,17 @@ export class TeamService {
440
440
  fail(ERRORS.INVALID_ARGUMENT, 'workspacePath is required');
441
441
  }
442
442
  const workspacePath = payload.workspacePath.trim();
443
+ // P5b:目录必须真实存在且是目录——配置不存在的目录会让成员会话 cwd
444
+ // 无效、回合直接失败(用户实证:working-directory: directory does not exist)。
445
+ let stat = null;
446
+ try {
447
+ stat = statSync(workspacePath);
448
+ } catch {
449
+ fail(ERRORS.INVALID_ARGUMENT, `工作目录不存在:${workspacePath};请先创建该目录,或选择已存在的目录`);
450
+ }
451
+ if (stat !== null && typeof stat.isDirectory === 'function' && stat.isDirectory() !== true) {
452
+ fail(ERRORS.INVALID_ARGUMENT, `工作目录不是目录:${workspacePath}`);
453
+ }
443
454
  await this.append(command, 'project/workspace-changed', {
444
455
  projectId,
445
456
  workspacePath,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@suifei/dsh-ai-team",
3
- "version": "0.3.73",
3
+ "version": "0.3.75",
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",