@suifei/dsh-ai-team 0.4.126 → 0.4.128
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 +33 -0
- package/README.md +3 -0
- package/client.js +113 -1
- package/index.js +44 -7
- package/lib/domain/catalog.js +66 -2
- package/lib/domain/member-profile.js +3 -0
- package/lib/domain/policy.js +157 -139
- package/lib/host/default-roster.js +7 -3
- package/lib/host/service.js +16 -1
- package/lib/host/views.js +1 -1
- package/lib/host/waker.js +2 -2
- package/lib/ledger/fold.js +1 -1
- package/lib/runtime/core-skill.js +1 -1
- package/package.json +1 -1
- package/talents/content-strategist/talent.yml +2 -2
- package/talents/creative-director/talent.yml +2 -2
- package/talents/editorial-lead/talent.yml +2 -2
- package/talents/education-lead/talent.yml +2 -2
- package/talents/game-director/talent.yml +2 -2
- package/talents/pmo-lead/talent.yml +2 -2
- package/talents/principal-investigator/talent.yml +2 -2
- package/talents/re-lead/talent.yml +2 -2
- package/talents/research-lead/talent.yml +2 -2
- package/teams/default/skills/ai-team-core/SKILL.md +27 -18
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.128 - 2026-11-18
|
|
4
|
+
|
|
5
|
+
**主理人只调度交付,不看产出**
|
|
6
|
+
|
|
7
|
+
- 用户定的规则:主理人把工作产出只交给对应角色,不查看、不核对其他子智能体的成果内容;只问负责人做全了没有——没做全催继续,做全了交给下一个负责人。
|
|
8
|
+
- **岗位规程**:`teams/default/skills/ai-team-core` 从「审查与导航(自己翻 diff、跑测试、挑问题)」改成「交付调度」:以卡的状态判断做全没有(没交 = 没做全;已提交 = 归验收人;已验收 = 做全了),
|
|
9
|
+
只 @负责人催进度或 @下一位接手;不打开、不评价产出,内容对不对整体归验收人。9 个团队共用这一份。9 位主理人才的性格里「盯内容」的半句同步改掉(版本升到 1.1.0)。
|
|
10
|
+
- **系统兜住,不只靠提示词**:
|
|
11
|
+
- 主理人(项目 owner 或 `duty: lead`)不再进验收候选:提交后的验收唤醒、待验收巡检提醒都不会落到主理人头上;
|
|
12
|
+
- 主理人对别人的产出 `task.accept` / `task.request_changes` 一律拒绝(`E_REVIEWER_NOT_ELIGIBLE`,提示交给验收人)。只在命令层拦,历史账本重放不受影响;
|
|
13
|
+
- 验收人识别补上职责:`duty: qa` 的成员(稽真·事实核查、评骘·同行评审)现在算验收人。此前只看岗位名,文档/视频/自媒体/研究 4 个团队认不出验收人,
|
|
14
|
+
验收提醒反而排到主理人身上;
|
|
15
|
+
- 代价:团队里没有任何验收人时,提交的卡只能由 Human 验收,主理人不再兜底。
|
|
16
|
+
- 测试:`test/qa-gate.test.js` 补两条(候选排除与 duty qa 排序;TeamService 拒绝主理人验收/退回、核查员照常验收),旧逻辑下失败、新逻辑通过;
|
|
17
|
+
`waker` / `ledger` / `member-tools` / `core-skill` 里按「主理人可验收」写的旧预期随规则更新。
|
|
18
|
+
|
|
19
|
+
## 0.4.127 - 2026-11-18
|
|
20
|
+
|
|
21
|
+
**人才市场(第 2 步 2d):组队,新建项目时选团队**
|
|
22
|
+
|
|
23
|
+
- 此前新项目用哪个团队只能在插件设置里改 `teamPreset`,全局一个;也没法从人才里自己挑人组队。
|
|
24
|
+
- **新建项目对话框加「团队」**:列出内置与自建团队(引用了不存在人才的团队不让选),下方显示成员与负责人;不选照旧用设置里的默认团队。
|
|
25
|
+
`project.create` 新增 `team`:按这个团队种成员,团队负责人成为项目主理人;团队不存在或坏了回 400,不再悄悄退回默认团队;
|
|
26
|
+
- **组队**:对话框里「组一个新团队」——搜人才、加入(同一人才可招多位)、改名、指定负责人,存成用户团队后自动选中;自建团队可删(内置只读)。
|
|
27
|
+
catalog.js 增加 `writeTeam` / `deleteTeam` / `listTeams` / `uniqueTeamId`(只写用户根,校验复用 `parseTeam`,成员 id 自动去重);
|
|
28
|
+
新接口 `GET /api/teams`、`POST /api/teams`、`POST /api/teams/delete`;新建撞名(含内置团队名)自动加序号;
|
|
29
|
+
- **修复:设置换成别的内置团队后,重启会往每个已有项目里塞人**。老项目补齐 UX/业务 的迁移原先只看 `source === 'bundled'`,
|
|
30
|
+
0.4.124 起内置团队不止 default,把 `teamPreset` 设成 `science` 再重启,所有已有项目都会被补进启元、立验……
|
|
31
|
+
现在只按**内置默认团队**、且只对本来由默认团队组成的项目补岗;用其它团队建的项目重启后原样不动;
|
|
32
|
+
- 测试:`test/talent-routes.test.js` 补组队、按团队建项目与各种拒绝;`test/catalog.test.js` 补补岗回归(旧逻辑下失败、新逻辑通过);
|
|
33
|
+
`test/client-talent-market.test.js` 补 `teamDraftToBody` / `teamMembersLine`。实机 E2E(rc.1 / rc.3):自建「speaking」队(青岚 ×2 + 白砚为负责人)
|
|
34
|
+
与内置科研团队各建一个项目,成员、主理人按团队;重启宿主后两个项目成员数不变。
|
|
35
|
+
|
|
3
36
|
## 0.4.126 - 2026-11-18
|
|
4
37
|
|
|
5
38
|
**人才市场(第 2 步 2b):把项目里的成员存为人才**
|
package/README.md
CHANGED
|
@@ -23,6 +23,8 @@
|
|
|
23
23
|
|
|
24
24
|
新 Project 自带一组可改的默认成员:**墨渊(主理人)**、**青岚(执行)**、**白砚(验收)**、**玄策(编程)**、**知微(UX 设计)**、**观澜(业务)**。名字、职责、个性、模型都可以改;模型提供商和模型名称直接读取 DSH 的 `llm` 目录,不需要手填 id。
|
|
25
25
|
|
|
26
|
+
主理人只调度交付:产出只交给对应角色,主理人不看、不核对成果内容,只问负责人做全没有——没做全催继续,做全了交给下一位;内容对不对由验收人把关,主理人不能验收或退回别人的产出。
|
|
27
|
+
|
|
26
28
|
**人才市场**:成员来自可复用的「人才」,团队从人才里挑人组队。
|
|
27
29
|
|
|
28
30
|
- 人才 `talents/<人才>/talent.yml`:名字、岗位、`duty`(职责:`lead` 主理人 / `qa` 验收 / `executor` 执行,决定拿哪份岗位规程)、性格、分类与标签、推荐模型,以及自带技能(`talents/<人才>/skills/<技能>/SKILL.md`)。内置 10 位:默认团队的 6 位,外加架构、评审、技术文档、安全审计。
|
|
@@ -31,6 +33,7 @@
|
|
|
31
33
|
- 自建:人才放 `~/.dsh/ai-team/catalog/user/talents/<人才>/`,团队放 `~/.dsh/ai-team/catalog/user/teams/<团队>/`,同名覆盖内置;插件设置 `teamPreset` 选新项目用哪个团队。
|
|
32
34
|
- **新建自定义人才(界面)**:「添加成员 → 新建人才」填名号、岗位、职责、性格,再按需装技能——从现成人才 fork、自写一份、或导入 `.md`,存成可复用的人才(落用户根)。内置没有的角色能自己攒;技能装进人才自己的文件夹,自包含、可分享。走 `POST /api/talents` 与 `POST /api/talents/:id/skills`,内置只读、装删回 `409`。
|
|
33
35
|
- **存为人才**:成员资料「存为人才」把项目里这位成员此刻的岗位、职责、性格、模型与技能存成可复用的人才(技能按成员实际读取的路径拷进人才文件夹,找不到正文的会提示),换个项目照样招。新建与存为都不会静默覆盖已有人才,撞名自动加序号。
|
|
36
|
+
- **组队、建项目选团队**:「新建项目」里选团队(内置或自建),按它种成员、负责人当主理人;「组一个新团队」从人才里挑人(同一人才可招多位)、指定负责人即可保存。插件设置 `teamPreset` 只是不选时的默认值。
|
|
34
37
|
- 成员在账本里记下来源人才与版本、职责;人才文件之后再改,不会悄悄改动已招成员的性格与职责。已有项目不受新团队影响。文件写坏时跳过它并在诊断日志记 `catalog.load.fail` / `catalog.team.fail`。
|
|
35
38
|
|
|
36
39
|
---
|
package/client.js
CHANGED
|
@@ -302,6 +302,7 @@ window.__ModuleLoader__.load({
|
|
|
302
302
|
tcSkills: '技能', tcEmpty: '还没装技能(可选)', tcAddExisting: '从已有装', tcWriteOwn: '自写一份', tcImport: '导入 .md', tcPick: '选一个已有技能…', tcAdd: '加入', tcRemove: '移除',
|
|
303
303
|
tcSkillName: '技能名(英文/数字/-)', tcSkillBody: '技能正文(SKILL.md)', tcSkillDup: '已经装了同名技能', tcSave: '存为我的人才', tcSaving: '保存中…',
|
|
304
304
|
memberSaveAsTalent: '存为人才', tcFromMember: '从成员「{name}」存出:沿用它此刻的岗位、职责、性格与技能,可先修改再保存。', tcModelKept: '沿用模型:{model}', tcMissing: '这些技能找不到正文,没有带上:{skills}', tcDraftFailed: '读取成员草稿失败:{error}',
|
|
305
|
+
projectTeam: '团队', teamCompose: '组一个新团队', teamComposeTitle: '组队', teamComposeHint: '从人才里挑人组队:同一人才可以招多位,给其中一位定为负责人(新项目的主理人)。', teamName: '团队名', teamDesc: '说明', teamMembers: '成员', teamPick: '从人才里挑人', teamAdd: '加入', teamLead: '负责人', teamEmptyPick: '还没挑人', teamSave: '保存团队', teamBack: '返回', teamDelete: '删除这个团队', teamDeleteConfirm: '删除自建团队「{name}」?团队文件会被删除,已用它建的项目和其中成员不受影响。', teamLoadFailed: '团队列表读取失败:{error}',
|
|
305
306
|
talentEmpty: '没有符合条件的人才。',
|
|
306
307
|
talentLoading: '正在读取人才市场…',
|
|
307
308
|
talentLoadFailed: '人才市场读取失败:{error}',
|
|
@@ -751,6 +752,7 @@ window.__ModuleLoader__.load({
|
|
|
751
752
|
tcSkills: 'Skills', tcEmpty: 'No skills yet (optional)', tcAddExisting: 'From existing', tcWriteOwn: 'Write one', tcImport: 'Import .md', tcPick: 'Pick an existing skill…', tcAdd: 'Add', tcRemove: 'Remove',
|
|
752
753
|
tcSkillName: 'Skill name (a-z, 0-9, -)', tcSkillBody: 'Skill body (SKILL.md)', tcSkillDup: 'That skill name is already staged', tcSave: 'Save as my talent', tcSaving: 'Saving…',
|
|
753
754
|
memberSaveAsTalent: 'Save as talent', tcFromMember: 'Saved from member “{name}”: its current role, duty, personality and skills are filled in; edit before saving.', tcModelKept: 'Keeps the model: {model}', tcMissing: 'These skills have no readable body and were left out: {skills}', tcDraftFailed: 'Could not read the member draft: {error}',
|
|
755
|
+
projectTeam: 'Team', teamCompose: 'Compose a new team', teamComposeTitle: 'Compose a team', teamComposeHint: 'Pick talents into a team: the same talent can be hired more than once; mark one as the lead (the new project owner).', teamName: 'Team name', teamDesc: 'Description', teamMembers: 'Members', teamPick: 'Pick from talents', teamAdd: 'Add', teamLead: 'Lead', teamEmptyPick: 'Nobody picked yet', teamSave: 'Save team', teamBack: 'Back', teamDelete: 'Delete this team', teamDeleteConfirm: 'Delete your team “{name}”? Its file is removed; projects already created from it and their members are unaffected.', teamLoadFailed: 'Could not load teams: {error}',
|
|
754
756
|
talentEmpty: 'No talent matches.',
|
|
755
757
|
talentLoading: 'Loading the talent market…',
|
|
756
758
|
talentLoadFailed: 'Could not load the talent market: {error}',
|
|
@@ -1395,6 +1397,12 @@ window.__ModuleLoader__.load({
|
|
|
1395
1397
|
.at-tcskill button { border: 0; background: transparent; cursor: pointer; font-size: 14px; line-height: 1; color: inherit; padding: 0; }
|
|
1396
1398
|
.at-tcpick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
|
|
1397
1399
|
.at-tcpanel { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
|
|
1400
|
+
.at-teamrows { display: flex; flex-direction: column; gap: 6px; }
|
|
1401
|
+
.at-teamrow { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 8px; align-items: center; }
|
|
1402
|
+
.at-teamlead { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; white-space: nowrap; }
|
|
1403
|
+
.at-teampick { display: flex; flex-direction: column; gap: 4px; max-height: 240px; overflow-y: auto; }
|
|
1404
|
+
.at-teampickrow { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-width: 0; }
|
|
1405
|
+
.at-teampickrow > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1398
1406
|
.at-market { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
|
|
1399
1407
|
.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; }
|
|
1400
1408
|
.at-marketcats { display: flex; flex-wrap: wrap; gap: 4px; }
|
|
@@ -2827,6 +2835,54 @@ window.__ModuleLoader__.load({
|
|
|
2827
2835
|
h('button', { type: 'button', className: 'at-btn', onClick: onCancel }, t('cancel')),
|
|
2828
2836
|
h('button', { type: 'button', className: 'at-btn at-btn-primary', disabled: !form.name.trim() || busy, onClick: save }, busy ? t('tcSaving') : t('tcSave'))));
|
|
2829
2837
|
}
|
|
2838
|
+
function TeamComposer({ t, talents, onSaved, onCancel }) {
|
|
2839
|
+
const [draft, setDraft] = React.useState({ name: '', description: '', members: [], lead: 0 });
|
|
2840
|
+
const [query, setQuery] = React.useState('');
|
|
2841
|
+
const [busy, setBusy] = React.useState(false);
|
|
2842
|
+
const [error, setError] = React.useState('');
|
|
2843
|
+
const shown = filterTalents(talents, query, '').slice(0, 40);
|
|
2844
|
+
const byId = (id) => (talents || []).find((x) => x.id === id);
|
|
2845
|
+
function add(talent) { setDraft((d) => ({ ...d, members: [...d.members, { talent: talent.id, name: '' }] })); }
|
|
2846
|
+
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 })); }
|
|
2847
|
+
function rename(index, name) { setDraft((d) => ({ ...d, members: d.members.map((m, i) => (i === index ? { ...m, name } : m)) })); }
|
|
2848
|
+
async function save() {
|
|
2849
|
+
const body = teamDraftToBody(draft);
|
|
2850
|
+
if (!body.name || body.members.length === 0 || busy) return;
|
|
2851
|
+
setBusy(true); setError('');
|
|
2852
|
+
try {
|
|
2853
|
+
const res = await fetch('/ai-team/api/teams', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify(body) });
|
|
2854
|
+
const out = await res.json().catch(() => null);
|
|
2855
|
+
if (!res.ok) throw new Error((out && out.error && out.error.message) || ('HTTP ' + res.status));
|
|
2856
|
+
onSaved(out.team);
|
|
2857
|
+
} catch (err) {
|
|
2858
|
+
setError((err && err.message) || String(err));
|
|
2859
|
+
} finally {
|
|
2860
|
+
setBusy(false);
|
|
2861
|
+
}
|
|
2862
|
+
}
|
|
2863
|
+
return h('div', { className: 'at-market' },
|
|
2864
|
+
h('div', { className: 'at-modalmeta' }, t('teamComposeHint')),
|
|
2865
|
+
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 })),
|
|
2866
|
+
h('label', { className: 'at-field' }, h('span', null, t('teamDesc')), h('input', { value: draft.description, onChange: (e) => setDraft({ ...draft, description: e.target.value }) })),
|
|
2867
|
+
h('div', { className: 'at-field' }, h('span', null, t('teamMembers')),
|
|
2868
|
+
draft.members.length === 0 ? h('div', { className: 'at-modalmeta' }, t('teamEmptyPick')) : h('div', { className: 'at-teamrows' }, draft.members.map((m, i) => {
|
|
2869
|
+
const talent = byId(m.talent) || { name: m.talent, role: '' };
|
|
2870
|
+
return h('div', { key: i, className: 'at-teamrow' },
|
|
2871
|
+
h('input', { value: m.name, placeholder: talent.name, 'aria-label': t('teamName'), onChange: (e) => rename(i, e.target.value) }),
|
|
2872
|
+
h('span', { className: 'at-modalmeta' }, talent.role),
|
|
2873
|
+
h('label', { className: 'at-teamlead' }, h('input', { type: 'radio', name: 'team-lead', checked: draft.lead === i, onChange: () => setDraft({ ...draft, lead: i }) }), t('teamLead')),
|
|
2874
|
+
h('button', { type: 'button', className: 'at-btn at-btn-small', 'aria-label': t('tcRemove'), onClick: () => remove(i) }, '×'));
|
|
2875
|
+
}))),
|
|
2876
|
+
h('div', { className: 'at-field' }, h('span', null, t('teamPick')),
|
|
2877
|
+
h('input', { className: 'at-marketsearch', type: 'search', value: query, placeholder: t('talentSearch'), onChange: (e) => setQuery(e.target.value) }),
|
|
2878
|
+
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' },
|
|
2879
|
+
h('span', null, talent.name + ' · ' + talent.role + (talent.source === 'user' ? ' · ' + t('talentUser') : '')),
|
|
2880
|
+
h('button', { type: 'button', className: 'at-btn at-btn-small', onClick: () => add(talent) }, t('teamAdd')))))),
|
|
2881
|
+
error ? h('div', { className: 'at-modalerror', role: 'alert' }, error) : null,
|
|
2882
|
+
h('div', { className: 'at-modalactions' },
|
|
2883
|
+
h('button', { type: 'button', className: 'at-btn', onClick: onCancel }, t('teamBack')),
|
|
2884
|
+
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'))));
|
|
2885
|
+
}
|
|
2830
2886
|
function ModelFields({ t, catalog, provider, model, effort, onEffort, onProvider, onModel, error }) {
|
|
2831
2887
|
const providers = Array.isArray(catalog?.providers) ? catalog.providers.slice() : [];
|
|
2832
2888
|
// 推理等级按「提供商 + 模型」按需解析:不同模型支持的档位不同,宿主也随时可能
|
|
@@ -3110,6 +3166,16 @@ window.__ModuleLoader__.load({
|
|
|
3110
3166
|
sourceName: String(draft.name || ''),
|
|
3111
3167
|
};
|
|
3112
3168
|
}
|
|
3169
|
+
/** 组队草稿 → POST /api/teams 请求体:成员只带人才 id 与(改过的)名字;负责人按下标,越界退回第一位。 */
|
|
3170
|
+
function teamDraftToBody(draft) {
|
|
3171
|
+
const members = (Array.isArray(draft && draft.members) ? draft.members : []).filter((m) => m && m.talent).map((m) => (String(m.name || '').trim() ? { talent: m.talent, name: String(m.name).trim() } : { talent: m.talent }));
|
|
3172
|
+
const lead = Number.isInteger(draft && draft.lead) && draft.lead >= 0 && draft.lead < members.length ? draft.lead : 0;
|
|
3173
|
+
return { name: String((draft && draft.name) || '').trim(), description: String((draft && draft.description) || '').trim(), members, lead };
|
|
3174
|
+
}
|
|
3175
|
+
/** 团队一行摘要:负责人打星,其余按名字列出。 */
|
|
3176
|
+
function teamMembersLine(team) {
|
|
3177
|
+
return (Array.isArray(team && team.members) ? team.members : []).map((m) => (m.id === team.lead ? '★' : '') + m.name + (m.role ? '·' + m.role : '')).join('、');
|
|
3178
|
+
}
|
|
3113
3179
|
// </member-copy>
|
|
3114
3180
|
|
|
3115
3181
|
// <composer-rich>
|
|
@@ -3269,6 +3335,12 @@ window.__ModuleLoader__.load({
|
|
|
3269
3335
|
const [nName, setNName] = React.useState('');
|
|
3270
3336
|
const [nGoal, setNGoal] = React.useState('');
|
|
3271
3337
|
const [nWorkspace, setNWorkspace] = React.useState('');
|
|
3338
|
+
// 新建项目选团队(2d):团队列表、所选团队、组队面板。
|
|
3339
|
+
const [teamList, setTeamList] = React.useState(null);
|
|
3340
|
+
const [nTeam, setNTeam] = React.useState('');
|
|
3341
|
+
const [teamLoadError, setTeamLoadError] = React.useState('');
|
|
3342
|
+
const [teamComposeOpen, setTeamComposeOpen] = React.useState(false);
|
|
3343
|
+
const selectedTeam = (teamList || []).find((entry) => entry.id === nTeam) || null;
|
|
3272
3344
|
const [workspaceOpen, setWorkspaceOpen] = React.useState(false);
|
|
3273
3345
|
const [workspaceDraft, setWorkspaceDraft] = React.useState('');
|
|
3274
3346
|
const [workspaceError, setWorkspaceError] = React.useState('');
|
|
@@ -3948,6 +4020,9 @@ window.__ModuleLoader__.load({
|
|
|
3948
4020
|
// 工作目录,成员只能在插件数据目录里跑,workspace attach 也会被拒。
|
|
3949
4021
|
setNWorkspace(data?.defaultWorkspace ?? '');
|
|
3950
4022
|
setNError('');
|
|
4023
|
+
setNTeam('');
|
|
4024
|
+
setTeamComposeOpen(false);
|
|
4025
|
+
void loadTeams();
|
|
3951
4026
|
setNewOpen(true);
|
|
3952
4027
|
}
|
|
3953
4028
|
async function togglePmo() {
|
|
@@ -4003,12 +4078,37 @@ window.__ModuleLoader__.load({
|
|
|
4003
4078
|
setWorkspaceBusy(false);
|
|
4004
4079
|
}
|
|
4005
4080
|
}
|
|
4081
|
+
/** 每次打开新建项目现取团队列表:刚组的队、刚改的 team.yml 立刻可选。select 留空表示沿用设置里的默认团队。 */
|
|
4082
|
+
async function loadTeams(select) {
|
|
4083
|
+
setTeamLoadError('');
|
|
4084
|
+
try {
|
|
4085
|
+
const response = await fetch('/ai-team/api/teams', { headers: { accept: 'application/json' } });
|
|
4086
|
+
const body = await response.json().catch(() => null);
|
|
4087
|
+
if (!response.ok) throw new Error((body && body.error && body.error.message) || ('HTTP ' + response.status));
|
|
4088
|
+
setTeamList(Array.isArray(body && body.teams) ? body.teams : []);
|
|
4089
|
+
setNTeam(select || (body && body.defaultTeam) || 'default');
|
|
4090
|
+
} catch (error) {
|
|
4091
|
+
setTeamList([]);
|
|
4092
|
+
setTeamLoadError(tf(t, 'teamLoadFailed', { error: (error && error.message) || String(error) }));
|
|
4093
|
+
}
|
|
4094
|
+
}
|
|
4095
|
+
async function removeTeam(team) {
|
|
4096
|
+
if (!(await askConfirm(t('teamDelete'), tf(t, 'teamDeleteConfirm', { name: team.name })))) return;
|
|
4097
|
+
try {
|
|
4098
|
+
const response = await fetch('/ai-team/api/teams/delete', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ id: team.id }) });
|
|
4099
|
+
const body = await response.json().catch(() => null);
|
|
4100
|
+
if (!response.ok) throw new Error((body && body.error && body.error.message) || ('HTTP ' + response.status));
|
|
4101
|
+
await loadTeams();
|
|
4102
|
+
} catch (error) {
|
|
4103
|
+
setNError((error && error.message) || String(error));
|
|
4104
|
+
}
|
|
4105
|
+
}
|
|
4006
4106
|
async function createProject() {
|
|
4007
4107
|
if (!nName.trim() || !nWorkspace.trim() || nBusy) return;
|
|
4008
4108
|
setNBusy(true);
|
|
4009
4109
|
setNError('');
|
|
4010
4110
|
try {
|
|
4011
|
-
const result = await runCommand('project.create', { name: nName.trim(), goal: nGoal.trim(), workspacePath: nWorkspace.trim() });
|
|
4111
|
+
const result = await runCommand('project.create', { name: nName.trim(), goal: nGoal.trim(), workspacePath: nWorkspace.trim(), ...(nTeam ? { team: nTeam } : {}) });
|
|
4012
4112
|
const next = result.project;
|
|
4013
4113
|
setNewOpen(false);
|
|
4014
4114
|
setScope('project');
|
|
@@ -5269,10 +5369,22 @@ window.__ModuleLoader__.load({
|
|
|
5269
5369
|
h('div', { className: 'at-inlineadd' },
|
|
5270
5370
|
h('input', { value: nWorkspace, onChange: (event) => setNWorkspace(event.target.value), placeholder: data?.workspaceExample ?? t('workspacePathPlaceholder') }),
|
|
5271
5371
|
h('button', { className: 'at-btn at-btn-small', type: 'button', onClick: pickNewWorkspace }, t('workspaceChoose')))),
|
|
5372
|
+
h('label', { className: 'at-field' }, h('span', null, t('projectTeam')),
|
|
5373
|
+
teamList === null ? h('div', { className: 'at-modalmeta' }, t('talentLoading'))
|
|
5374
|
+
: 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') : ''))))),
|
|
5375
|
+
selectedTeam ? h('div', { className: 'at-modalmeta' }, (selectedTeam.description ? selectedTeam.description + ':' : '') + teamMembersLine(selectedTeam)) : null,
|
|
5376
|
+
teamLoadError ? h('div', { className: 'at-modalerror', role: 'alert' }, teamLoadError) : null,
|
|
5377
|
+
h('div', { className: 'at-tcpick' },
|
|
5378
|
+
h('button', { className: 'at-btn at-btn-small', type: 'button', onClick: () => { setTeamComposeOpen(true); loadTalents(); } }, t('teamCompose')),
|
|
5379
|
+
selectedTeam && selectedTeam.source === 'user' ? h('button', { className: 'at-btn at-btn-small', type: 'button', onClick: () => void removeTeam(selectedTeam) }, t('teamDelete')) : null),
|
|
5272
5380
|
nError ? h('div', { className: 'at-modalerror', role: 'alert' }, nError) : null,
|
|
5273
5381
|
h('div', { className: 'at-modalactions' },
|
|
5274
5382
|
h('button', { className: 'at-btn', type: 'button', onClick: () => setNewOpen(false), disabled: nBusy }, t('cancel')),
|
|
5275
5383
|
h('button', { className: 'at-btn at-btn-primary', type: 'submit', disabled: nBusy || !nName.trim() || !nWorkspace.trim() }, nBusy ? t('saving') : t('projectCreate'))))) : null,
|
|
5384
|
+
teamComposeOpen ? h(ModalBack, { onClose: () => setTeamComposeOpen(false) },
|
|
5385
|
+
h('div', { className: 'at-modal at-modal-wide', role: 'dialog', 'aria-modal': 'true', 'aria-label': t('teamComposeTitle') },
|
|
5386
|
+
h('h2', { className: 'at-modaltitle' }, t('teamComposeTitle')),
|
|
5387
|
+
h(TeamComposer, { t, talents, onSaved: (team) => { setTeamComposeOpen(false); void loadTeams(team && team.id); }, onCancel: () => setTeamComposeOpen(false) }))) : null,
|
|
5276
5388
|
dialog ? h(WorkbenchDialog, { key: dialogSeqRef.current, t, dialog, onDismiss: () => setDialog(null) }) : null,
|
|
5277
5389
|
shortcutsOpen ? h(ModalBack, { onClose: () => setShortcutsOpen(false) },
|
|
5278
5390
|
h('div', { className: 'at-modal', role: 'dialog', 'aria-modal': 'true', 'aria-label': t('shortcutTitle') },
|
package/index.js
CHANGED
|
@@ -72,7 +72,7 @@ import { isInformationalThreadMention } from './lib/domain/inbox.js';
|
|
|
72
72
|
import { messageContent, normalizeAttachments } from './lib/domain/rich-message.js';
|
|
73
73
|
import { readAttachment, uploadAttachment } from './lib/host/attachment-routes.js';
|
|
74
74
|
import { createDiagLogger, defaultDiagDir, installDiagSink } from './lib/diaglog.js';
|
|
75
|
-
import { DEFAULT_TEAM, catalogRoots, deleteTalent, installSkill, listInstallableSkills, listTalents, loadCatalog, readSkillText, resolveTeam, talentFromMember, talentIdFrom, uniqueTalentId, userCatalogDir, writeTalent } from './lib/domain/catalog.js';
|
|
75
|
+
import { DEFAULT_TEAM, catalogRoots, deleteTalent, deleteTeam, installSkill, listInstallableSkills, listTalents, listTeams, loadCatalog, readSkillText, resolveTeam, talentFromMember, talentIdFrom, uniqueTalentId, uniqueTeamId, userCatalogDir, writeTalent, writeTeam } from './lib/domain/catalog.js';
|
|
76
76
|
|
|
77
77
|
export const name = 'ai-team';
|
|
78
78
|
|
|
@@ -149,9 +149,9 @@ function memberSkillRoots(member, runtime, diag) {
|
|
|
149
149
|
return [...memberCatalogDirs(member, diag), ...(dir ? [join(dir, '.dsh')] : []), dshHome(), runtime?.dir].filter((root) => typeof root === 'string' && root !== '');
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
-
/**
|
|
153
|
-
function teamPresetFor(config, diag) {
|
|
154
|
-
const preset = resolveTeam(talentCatalog(diag), config?.teamPreset || DEFAULT_TEAM, { diag });
|
|
152
|
+
/** 新项目用哪个团队:新建时选的优先,其次插件设置 `teamPreset`,最后内置默认团队。 */
|
|
153
|
+
function teamPresetFor(config, diag, chosen = '') {
|
|
154
|
+
const preset = resolveTeam(talentCatalog(diag), chosen || config?.teamPreset || DEFAULT_TEAM, { diag });
|
|
155
155
|
diag?.append?.({ ev: 'catalog.team', name: preset.id, source: preset.source, dir: preset.dir, members: preset.team.members.length });
|
|
156
156
|
return preset;
|
|
157
157
|
}
|
|
@@ -2294,7 +2294,7 @@ export function apply(ctx, config = {}) {
|
|
|
2294
2294
|
entry.timer.unref?.();
|
|
2295
2295
|
};
|
|
2296
2296
|
|
|
2297
|
-
async function activateProject(nextProjectId, projectName, projectGoal, workspacePath = '') {
|
|
2297
|
+
async function activateProject(nextProjectId, projectName, projectGoal, workspacePath = '', team = '') {
|
|
2298
2298
|
await ready;
|
|
2299
2299
|
if (booted === null) throw new Error('team ledger is unavailable');
|
|
2300
2300
|
let next = projectRuntime(nextProjectId);
|
|
@@ -2307,7 +2307,7 @@ export function apply(ctx, config = {}) {
|
|
|
2307
2307
|
workspacePath,
|
|
2308
2308
|
diag,
|
|
2309
2309
|
pmoMaxRounds: config.pmoMaxRounds,
|
|
2310
|
-
teamPreset: teamPresetFor(config, diag),
|
|
2310
|
+
teamPreset: teamPresetFor(config, diag, team),
|
|
2311
2311
|
});
|
|
2312
2312
|
booted.runtimes.set(nextProjectId, next);
|
|
2313
2313
|
attachRuntime(next);
|
|
@@ -2377,6 +2377,35 @@ export function apply(ctx, config = {}) {
|
|
|
2377
2377
|
if (req.method === 'GET' && url.pathname === '/ai-team/api/talents') {
|
|
2378
2378
|
return send(res, { talents: listTalents(talentCatalog(diag)) });
|
|
2379
2379
|
}
|
|
2380
|
+
// 团队列表(新建项目选团队、组队面板);defaultTeam 是插件设置里的默认团队。
|
|
2381
|
+
if (req.method === 'GET' && url.pathname === '/ai-team/api/teams') {
|
|
2382
|
+
return send(res, { teams: listTeams(talentCatalog(diag)), defaultTeam: config?.teamPreset || DEFAULT_TEAM });
|
|
2383
|
+
}
|
|
2384
|
+
// 组队:从人才里挑人建一个用户团队(只写用户根;新建撞名加序号,改写需 overwrite)。
|
|
2385
|
+
if (req.method === 'POST' && url.pathname === '/ai-team/api/teams') {
|
|
2386
|
+
const body = await readJson(req);
|
|
2387
|
+
const cat = talentCatalog(diag);
|
|
2388
|
+
let id = talentIdFrom(body?.id) || talentIdFrom(body?.name);
|
|
2389
|
+
if (id === '' && typeof body?.name === 'string' && body.name.trim() !== '') id = 'team-' + Date.now().toString(36) + Math.random().toString(36).slice(2, 5);
|
|
2390
|
+
if (id === '') return send(res, { error: { code: 'E_INVALID_ARGUMENT', message: '团队需要一个名字' } }, 400);
|
|
2391
|
+
if (body?.overwrite !== true) id = uniqueTeamId(cat, id);
|
|
2392
|
+
try {
|
|
2393
|
+
const saved = writeTeam(userCatalogDir(dshHome()), id, body ?? {}, cat);
|
|
2394
|
+
diag?.append({ ev: 'team.write', id, members: saved.members.length });
|
|
2395
|
+
return send(res, { ok: true, team: listTeams(talentCatalog(diag)).find((entry) => entry.id === id) });
|
|
2396
|
+
} catch (error) {
|
|
2397
|
+
return send(res, { error: { code: 'E_INVALID_ARGUMENT', message: error.message } }, 400);
|
|
2398
|
+
}
|
|
2399
|
+
}
|
|
2400
|
+
if (req.method === 'POST' && url.pathname === '/ai-team/api/teams/delete') {
|
|
2401
|
+
const body = await readJson(req);
|
|
2402
|
+
const entry = talentCatalog(diag).teams.get(talentIdFrom(body?.id ?? ''));
|
|
2403
|
+
if (entry === undefined) return send(res, { error: { code: 'NOT_FOUND', message: 'team not found' } }, 404);
|
|
2404
|
+
if (entry.source !== 'user') return send(res, { error: { code: 'E_READONLY', message: '内置团队只读,不能删除' } }, 409);
|
|
2405
|
+
deleteTeam(userCatalogDir(dshHome()), entry.id);
|
|
2406
|
+
diag?.append({ ev: 'team.delete', id: entry.id });
|
|
2407
|
+
return send(res, { ok: true });
|
|
2408
|
+
}
|
|
2380
2409
|
// 「存为人才」草稿:按成员此刻的岗位、职责(与激活同一判定)、性格、模型与技能生成;标出每份技能找不找得到。
|
|
2381
2410
|
const talentDraftRoute = url.pathname.match(/^\/ai-team\/api\/projects\/([^/]+)\/members\/([^/]+)\/talent-draft$/);
|
|
2382
2411
|
if (req.method === 'GET' && talentDraftRoute !== null) {
|
|
@@ -2949,12 +2978,20 @@ export function apply(ctx, config = {}) {
|
|
|
2949
2978
|
return send(res, { error: { code: 'E_INVALID_ARGUMENT', message: `工作目录不存在或不是目录:${workspacePath}` } }, 400);
|
|
2950
2979
|
}
|
|
2951
2980
|
}
|
|
2981
|
+
// 新建时选的团队:必须在目录里且引用的人才都在(否则种成员会悄悄退回默认团队)。
|
|
2982
|
+
const team = typeof body.payload?.team === 'string' ? body.payload.team.trim() : '';
|
|
2983
|
+
if (team !== '') {
|
|
2984
|
+
const chosen = listTeams(talentCatalog(diag)).find((entry) => entry.id === team);
|
|
2985
|
+
if (chosen === undefined) return send(res, { error: { code: 'E_INVALID_ARGUMENT', message: `团队不存在:${team}` } }, 400);
|
|
2986
|
+
if (chosen.broken) return send(res, { error: { code: 'E_INVALID_ARGUMENT', message: `团队「${chosen.name}」引用了不存在的人才,先修好再用` } }, 400);
|
|
2987
|
+
}
|
|
2952
2988
|
const id = ids.project();
|
|
2953
2989
|
// 先校验工作目录(上面已做),再写 registry、最后开 runtime:
|
|
2954
2990
|
// activateProject 内部会调用 registry.setActive(id),因此该行必须已
|
|
2955
2991
|
// 存在。校验前置后,不会再把一个打不开的项目写进 projects.json。
|
|
2956
2992
|
booted.registry.add({ id, name, goal, workspacePath });
|
|
2957
|
-
const next = await activateProject(id, name, goal, workspacePath);
|
|
2993
|
+
const next = await activateProject(id, name, goal, workspacePath, team);
|
|
2994
|
+
diag?.append({ ev: 'project.create', id, team: team || null });
|
|
2958
2995
|
return send(res, { ok: true, project: next.service.state.projects[id] ?? { id, name } });
|
|
2959
2996
|
}
|
|
2960
2997
|
if (body.type === 'project.activate') {
|
package/lib/domain/catalog.js
CHANGED
|
@@ -300,15 +300,79 @@ export function readSkillText(talentDir, name) {
|
|
|
300
300
|
* 新建绝不静默覆盖别人的人才,也不意外遮盖同名内置人才(要覆盖得显式 overwrite)。
|
|
301
301
|
*/
|
|
302
302
|
export function uniqueTalentId(catalog, base) {
|
|
303
|
+
return uniqueIn(catalog.talents, base);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/** 新建团队同理:撞了已有团队(含内置)就加序号。 */
|
|
307
|
+
export function uniqueTeamId(catalog, base) {
|
|
308
|
+
return uniqueIn(catalog.teams, base);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
function uniqueIn(taken, base) {
|
|
303
312
|
if (!SLUG.test(base)) return '';
|
|
304
|
-
if (!
|
|
313
|
+
if (!taken.has(base)) return base;
|
|
305
314
|
for (let n = 2; n < 1000; n += 1) {
|
|
306
315
|
const id = `${base.slice(0, 60)}-${n}`;
|
|
307
|
-
if (!
|
|
316
|
+
if (!taken.has(id)) return id;
|
|
308
317
|
}
|
|
309
318
|
return '';
|
|
310
319
|
}
|
|
311
320
|
|
|
321
|
+
/**
|
|
322
|
+
* 团队列表(新建项目选团队、组队面板):成员按人才补齐名字、岗位与职责;引用了不存在的人才标 broken
|
|
323
|
+
* ——这种团队建项目时会退回默认团队,界面不让选。
|
|
324
|
+
*/
|
|
325
|
+
export function listTeams(catalog) {
|
|
326
|
+
return [...catalog.teams.values()]
|
|
327
|
+
.map((entry) => {
|
|
328
|
+
const members = entry.members.map((m) => {
|
|
329
|
+
const t = catalog.talents.get(m.talent);
|
|
330
|
+
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 };
|
|
331
|
+
});
|
|
332
|
+
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) };
|
|
333
|
+
})
|
|
334
|
+
.sort((a, b) => (a.id === DEFAULT_TEAM ? -1 : b.id === DEFAULT_TEAM ? 1 : 0) || a.source.localeCompare(b.source) || a.name.localeCompare(b.name, 'zh'));
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* 组队:写一个用户团队 `<userRoot>/teams/<id>/team.yml`。
|
|
339
|
+
* `members` 是 [{ talent, name? }](同一人才可招多位,成员 id 自动生成且不重复),`lead` 是成员下标或成员 id(缺省第一位)。
|
|
340
|
+
* 引用的人才必须在目录里;校验复用 parseTeam,验不过就抛、不落盘。
|
|
341
|
+
*/
|
|
342
|
+
export function writeTeam(userRoot, id, input, catalog) {
|
|
343
|
+
if (typeof userRoot !== 'string' || userRoot === '') throw new Error('writeTeam: 需要 userRoot');
|
|
344
|
+
if (typeof id !== 'string' || !SLUG.test(id)) throw new Error('团队 id 必须是小写字母、数字、连字符,≤64 位');
|
|
345
|
+
const name = text(input?.name, 60);
|
|
346
|
+
if (name === '') throw new Error('团队需要一个名字');
|
|
347
|
+
const raw = Array.isArray(input?.members) ? input.members : [];
|
|
348
|
+
if (raw.length === 0) throw new Error('团队至少要有一位成员');
|
|
349
|
+
const used = new Set();
|
|
350
|
+
const members = raw.map((m, i) => {
|
|
351
|
+
const talent = text(m?.talent, 64);
|
|
352
|
+
if (!SLUG.test(talent) || (catalog && !catalog.talents.has(talent))) throw new Error(`第 ${i + 1} 位成员引用的人才不存在:${String(m?.talent)}`);
|
|
353
|
+
const base = `mem_${talent.replace(/-/g, '_')}`.slice(0, 60);
|
|
354
|
+
let memberId = base;
|
|
355
|
+
for (let n = 2; used.has(memberId); n += 1) memberId = `${base.slice(0, 56)}_${n}`;
|
|
356
|
+
used.add(memberId);
|
|
357
|
+
const label = text(m?.name, 40);
|
|
358
|
+
return { talent, id: memberId, ...(label ? { name: label } : {}) };
|
|
359
|
+
});
|
|
360
|
+
const leadIndex = Number.isInteger(input?.lead) ? input.lead : members.findIndex((m) => m.id === input?.lead);
|
|
361
|
+
const doc = { name, ...(text(input?.description, 400) ? { description: text(input.description, 400) } : {}), lead: (members[leadIndex] ?? members[0]).id, members };
|
|
362
|
+
const yaml = stringify(doc, { lineWidth: 0 });
|
|
363
|
+
const team = parseTeam(yaml, `team ${id}`); // 先验后写
|
|
364
|
+
const dir = join(userRoot, 'teams', id);
|
|
365
|
+
mkdirSync(dir, { recursive: true });
|
|
366
|
+
writeFileSync(join(dir, 'team.yml'), yaml, 'utf8');
|
|
367
|
+
return { id, source: 'user', dir, ...team };
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
/** 删一个用户团队(只删用户根下的)。 */
|
|
371
|
+
export function deleteTeam(userRoot, id) {
|
|
372
|
+
if (typeof id !== 'string' || !SLUG.test(id)) throw new Error('团队 id 不合法');
|
|
373
|
+
rmSync(join(userRoot, 'teams', id), { recursive: true, force: true });
|
|
374
|
+
}
|
|
375
|
+
|
|
312
376
|
/**
|
|
313
377
|
* 项目成员 → 人才草稿(「存为人才」):带上它此刻的岗位、职责、性格(含复盘长出来的)、模型与技能名;
|
|
314
378
|
* 不带笔记、会话与任务——那是这位成员自己的经历。duty 由调用方按身份判定后传入。
|
|
@@ -4,6 +4,9 @@ const QA_PATTERN = /(^|[^a-z])(qa|quality|test|verification)([^a-z]|$)|质量|
|
|
|
4
4
|
const REVIEW_PATTERN = /review|验收|评审|审查/i;
|
|
5
5
|
|
|
6
6
|
export function isQaMember(member) {
|
|
7
|
+
// 团队里写明职责 qa 的(稽真·事实核查、评骘·同行评审)也是验收人:只看岗位名会把它们漏掉,
|
|
8
|
+
// 验收提醒反而排到主理人头上。
|
|
9
|
+
if (member?.duty === 'qa') return true;
|
|
7
10
|
return typeof member?.role === 'string' && QA_PATTERN.test(member.role);
|
|
8
11
|
}
|
|
9
12
|
|
package/lib/domain/policy.js
CHANGED
|
@@ -1,139 +1,157 @@
|
|
|
1
|
-
import { ERRORS, fail } from './errors.js';
|
|
2
|
-
import { isQaMember, isReviewerMember } from './member-profile.js';
|
|
3
|
-
|
|
4
|
-
/** @typedef {{ kind: 'human'|'agent'|'system', memberId?: string }} Actor */
|
|
5
|
-
|
|
6
|
-
/** Member statuses allowed to hold work or review; failed members are out. */
|
|
7
|
-
export const ACTIVE_MEMBER_STATUSES = Object.freeze(['provisioning', 'running', 'idle']);
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* The single authority for "which Agent may review this Task" (INV-04/Q-05):
|
|
11
|
-
* active, not the current assignee, never a past claimant. QA-required Tasks
|
|
12
|
-
* narrow candidates to QA members. The command layer additionally resolves the
|
|
13
|
-
* acting member; Human review is the fallback (policy reasons live in
|
|
14
|
-
* reviewEligibility below).
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
export function
|
|
84
|
-
if (
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
if (
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}
|
|
1
|
+
import { ERRORS, fail } from './errors.js';
|
|
2
|
+
import { isQaMember, isReviewerMember } from './member-profile.js';
|
|
3
|
+
|
|
4
|
+
/** @typedef {{ kind: 'human'|'agent'|'system', memberId?: string }} Actor */
|
|
5
|
+
|
|
6
|
+
/** Member statuses allowed to hold work or review; failed members are out. */
|
|
7
|
+
export const ACTIVE_MEMBER_STATUSES = Object.freeze(['provisioning', 'running', 'idle']);
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The single authority for "which Agent may review this Task" (INV-04/Q-05):
|
|
11
|
+
* active, not the current assignee, never a past claimant. QA-required Tasks
|
|
12
|
+
* narrow candidates to QA members. The command layer additionally resolves the
|
|
13
|
+
* acting member; Human review is the fallback (policy reasons live in
|
|
14
|
+
* reviewEligibility below).
|
|
15
|
+
*/
|
|
16
|
+
/** 项目主理人(账本 owner)的成员 id;一个账本一个项目。 */
|
|
17
|
+
export function projectOwnerId(state) {
|
|
18
|
+
const project = Object.values(state?.projects ?? {})[0];
|
|
19
|
+
return project?.ownerMemberId ?? project?.ownerId ?? null;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* 主理人只调度交付,不核对产出(用户 2026-11-18):项目 owner 或团队里职责是 lead 的成员。
|
|
24
|
+
* 他们不进验收候选,也不能对别人的产出验收/退回——内容核对整体归验收人。
|
|
25
|
+
*/
|
|
26
|
+
export function isLeadMember(member, state) {
|
|
27
|
+
if (member?.kind !== 'agent') return false;
|
|
28
|
+
if (member.duty === 'lead') return true;
|
|
29
|
+
const owner = projectOwnerId(state);
|
|
30
|
+
return owner !== null && member.id === owner;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function isReviewCandidate(member, task, state = null) {
|
|
34
|
+
if (member?.kind !== 'agent') return false;
|
|
35
|
+
if (state !== null && isLeadMember(member, state)) return false;
|
|
36
|
+
if (!ACTIVE_MEMBER_STATUSES.includes(member.status)) return false;
|
|
37
|
+
if (member.id === task.assigneeId) return false;
|
|
38
|
+
if (Array.isArray(task.claimHistory) && task.claimHistory.includes(member.id)) return false;
|
|
39
|
+
if (task.qaRequired === true && !isQaMember(member)) return false;
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Ranked review candidates for the Waker: QA first, then reviewer roles,
|
|
45
|
+
* then any other eligible Agent. Older members win ties.
|
|
46
|
+
*/
|
|
47
|
+
export function eligibleReviewers(state, task) {
|
|
48
|
+
if (task === undefined || task === null) return [];
|
|
49
|
+
const candidates = Object.values(state.members ?? {}).filter((member) => isReviewCandidate(member, task, state));
|
|
50
|
+
const rank = (member) => (isQaMember(member) ? 0 : isReviewerMember(member) ? 1 : 2);
|
|
51
|
+
return candidates.sort((a, b) => rank(a) - rank(b) || String(a.createdAt).localeCompare(String(b.createdAt)));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function isHuman(actor) {
|
|
55
|
+
return actor?.kind === 'human';
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function memberIdOf(actor) {
|
|
59
|
+
return actor?.memberId ?? null;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function assertRevision(task, expectedRevision) {
|
|
63
|
+
if (expectedRevision === undefined || expectedRevision === null) return;
|
|
64
|
+
if (task.revision !== expectedRevision) {
|
|
65
|
+
fail(ERRORS.REVISION, `task ${task.id} revision ${String(expectedRevision)} is stale; current is ${String(task.revision)}`, {
|
|
66
|
+
details: { taskId: task.id, expectedRevision, currentRevision: task.revision },
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function isOwnerOrHuman(task, actor) {
|
|
72
|
+
return isHuman(actor) || (memberIdOf(actor) !== null && task.ownerId === memberIdOf(actor));
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function assertOwnerOrHuman(task, actor) {
|
|
76
|
+
if (!isOwnerOrHuman(task, actor)) {
|
|
77
|
+
fail(ERRORS.UNAUTHORIZED, 'only the accountable owner or Human may perform this action', {
|
|
78
|
+
details: { taskId: task.id, ownerId: task.ownerId, actor: memberIdOf(actor) },
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export function assertAssignee(task, actor) {
|
|
84
|
+
if (memberIdOf(actor) === null || task.assigneeId !== memberIdOf(actor)) {
|
|
85
|
+
fail(ERRORS.UNAUTHORIZED, 'only the current assignee may perform this action', {
|
|
86
|
+
details: { taskId: task.id, assigneeId: task.assigneeId, actor: memberIdOf(actor) },
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export function dependenciesDone(task, tasksById) {
|
|
92
|
+
return (task.blockedBy ?? []).every((id) => tasksById?.[id]?.status === 'done');
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function memberHasInProgress(tasksById, memberId) {
|
|
96
|
+
if (memberId === null) return undefined;
|
|
97
|
+
return Object.values(tasksById ?? {}).find((candidate) => candidate.assigneeId === memberId && candidate.status === 'in_progress');
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** A member must not start the next Task while their previous Task awaits QA. */
|
|
101
|
+
export function memberHasPendingAcceptance(tasksById, memberId) {
|
|
102
|
+
if (memberId === null) return undefined;
|
|
103
|
+
return Object.values(tasksById ?? {}).find((candidate) => candidate.assigneeId === memberId && candidate.status === 'pending_acceptance');
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* A reviewer is eligible when the task is in pending_acceptance and the
|
|
108
|
+
* reviewer never claimed it (Agent) or is Human. Human self-accept is allowed
|
|
109
|
+
* but must be recorded as non-independent.
|
|
110
|
+
*/
|
|
111
|
+
export function reviewEligibility(task, actor) {
|
|
112
|
+
if (task.status !== 'pending_acceptance') {
|
|
113
|
+
return { eligible: false, reason: 'task is not pending_acceptance', code: ERRORS.INVALID_STATE };
|
|
114
|
+
}
|
|
115
|
+
const memberId = memberIdOf(actor);
|
|
116
|
+
if (isHuman(actor)) {
|
|
117
|
+
return {
|
|
118
|
+
eligible: true,
|
|
119
|
+
selfExecuted: memberId !== null && task.claimHistory.includes(memberId),
|
|
120
|
+
reason: 'human fallback',
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
if (memberId === null) {
|
|
124
|
+
return { eligible: false, reason: 'unknown member', code: ERRORS.UNAUTHORIZED };
|
|
125
|
+
}
|
|
126
|
+
if (task.assigneeId === memberId) {
|
|
127
|
+
return { eligible: false, reason: 'current assignee cannot review', code: ERRORS.NOT_ELIGIBLE };
|
|
128
|
+
}
|
|
129
|
+
if (task.claimHistory.includes(memberId)) {
|
|
130
|
+
return { eligible: false, reason: 'a past claimant cannot review', code: ERRORS.NOT_ELIGIBLE };
|
|
131
|
+
}
|
|
132
|
+
return { eligible: true, selfExecuted: false, reason: 'independent reviewer' };
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export function assertReviewEligible(task, actor) {
|
|
136
|
+
const result = reviewEligibility(task, actor);
|
|
137
|
+
if (!result.eligible) {
|
|
138
|
+
fail(result.code ?? ERRORS.NOT_ELIGIBLE, result.reason ?? 'reviewer is not eligible', {
|
|
139
|
+
details: { taskId: task.id, actor: memberIdOf(actor) },
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
return result;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export function assertIrreversibleConfirmation(task, actor, confirmed) {
|
|
146
|
+
if (!task.irreversible) return;
|
|
147
|
+
if (!isHuman(actor)) {
|
|
148
|
+
fail(ERRORS.IRREVERSIBLE_CONFIRM, 'an Agent may only suggest acceptance for an irreversible Task', {
|
|
149
|
+
details: { taskId: task.id },
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
if (confirmed !== true) {
|
|
153
|
+
fail(ERRORS.IRREVERSIBLE_CONFIRM, 'Human confirmation is required for an irreversible Task', {
|
|
154
|
+
details: { taskId: task.id },
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* `talents/`, or a user team selected by the `teamPreset` setting (lib/domain/catalog.js).
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import { loadCatalog, resolveTeam } from '../domain/catalog.js';
|
|
13
|
+
import { DEFAULT_TEAM, loadCatalog, resolveTeam } from '../domain/catalog.js';
|
|
14
14
|
|
|
15
15
|
/** Names shipped by 0.3.9 and earlier; only these exact pins are migrated. */
|
|
16
16
|
const LEGACY_DEFAULT_NAMES = Object.freeze({
|
|
@@ -64,8 +64,12 @@ export async function seedDefaultRoster(service, projectId, { humanId = 'mem_hum
|
|
|
64
64
|
const roster = team.members;
|
|
65
65
|
if (agentMembers(service).length > 0) {
|
|
66
66
|
const renamed = await upgradeLegacyDefaultNames(service, projectId, humanId, roster);
|
|
67
|
-
// 补缺岗只是老项目补齐 UX/业务
|
|
68
|
-
|
|
67
|
+
// 补缺岗只是老项目补齐 UX/业务 的迁移:只按**内置默认团队**做,且只对本来就由默认团队组成的项目
|
|
68
|
+
// (成员没记团队的老成员,或记的就是 default)。0.4.124 起内置团队不止一个(science、game…),
|
|
69
|
+
// 只看 source === 'bundled' 会让设置换团队后,重启把那个团队的岗位塞进每个已有项目。
|
|
70
|
+
// 用户团队与其它内置团队只用于新项目,不改已有项目。
|
|
71
|
+
if (preset.source !== 'bundled' || preset.id !== DEFAULT_TEAM) return { seeded: false, members: [], renamed };
|
|
72
|
+
if (agentMembers(service).some((member) => typeof member.team === 'string' && member.team !== DEFAULT_TEAM)) return { seeded: false, members: [], renamed };
|
|
69
73
|
const added = [];
|
|
70
74
|
const existingRoles = new Set(agentMembers(service).map((member) => member.role));
|
|
71
75
|
const existingIds = new Set(Object.keys(service.state.members ?? {}));
|
package/lib/host/service.js
CHANGED
|
@@ -26,8 +26,20 @@ import { MEMBER_STATUS, isBoardIdle } from '../ledger/fold.js';
|
|
|
26
26
|
|
|
27
27
|
const MEMBER_STATUS_VALUES = new Set(Object.values(MEMBER_STATUS));
|
|
28
28
|
import { checkPersonality, isQaMember, unfinishedTasksFor } from '../domain/member-profile.js';
|
|
29
|
+
import { isLeadMember } from '../domain/policy.js';
|
|
29
30
|
import { describeAttachments, findMentions, normalizeAttachments, plainMentionLinks } from '../domain/rich-message.js';
|
|
30
31
|
|
|
32
|
+
/**
|
|
33
|
+
* 主理人只调度交付、不核对产出(用户 2026-11-18):对别人的产出验收或退回都拒绝,并指路给验收人。
|
|
34
|
+
* 只在命令层拦,不进 fold:历史账本里主理人验收过的事件重放不受影响。
|
|
35
|
+
*/
|
|
36
|
+
function refuseLeadReview(state, reviewer) {
|
|
37
|
+
if (reviewer === null || reviewer === undefined || !isLeadMember(reviewer, state)) return;
|
|
38
|
+
fail(ERRORS.NOT_ELIGIBLE, 'the lead does not review deliverables: only ask the assignee whether it is complete, and leave acceptance to a QA member (or Human)', {
|
|
39
|
+
details: { memberId: reviewer.id, rule: 'lead-delivery-only' },
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
31
43
|
function mentionsHuman(body) {
|
|
32
44
|
return typeof body === 'string'
|
|
33
45
|
&& /(^|[^A-Za-z])(human|@你|待你|需要你|请你|等你|你拍板)([^A-Za-z]|$)/i.test(body);
|
|
@@ -1270,6 +1282,7 @@ export class TeamService {
|
|
|
1270
1282
|
if (command.actor.kind === 'agent' && reviewer === undefined) {
|
|
1271
1283
|
fail(ERRORS.UNAUTHORIZED, `agent actor ${String(command.actor.memberId ?? '?')} is not a Team member`);
|
|
1272
1284
|
}
|
|
1285
|
+
refuseLeadReview(this.state, reviewer);
|
|
1273
1286
|
if (task.qaRequired === true && reviewer !== null && !isQaMember(reviewer)) {
|
|
1274
1287
|
fail(ERRORS.INVALID_STATE, 'this task requires a QA reviewer');
|
|
1275
1288
|
}
|
|
@@ -1306,7 +1319,9 @@ export class TeamService {
|
|
|
1306
1319
|
}, { expectedRevision, at: this.now() });
|
|
1307
1320
|
break;
|
|
1308
1321
|
}
|
|
1309
|
-
case 'request_changes':
|
|
1322
|
+
case 'request_changes':
|
|
1323
|
+
refuseLeadReview(this.state, command.actor.kind === 'agent' ? this.state.members?.[command.actor.memberId] : null);
|
|
1324
|
+
outcome = requestChangesTask(task, command.actor, { note: command.payload?.note }, { expectedRevision, at: this.now() }); break;
|
|
1310
1325
|
case 'cancel': outcome = cancelTask(task, command.actor, { reason: command.payload?.reason, expectedRevision, at: this.now() }); break;
|
|
1311
1326
|
case 'reopen': outcome = reopenTask(task, command.actor, { reason: command.payload?.reason, expectedRevision, members: state.members, at: this.now() }); break;
|
|
1312
1327
|
case 'reassign':
|
package/lib/host/views.js
CHANGED
|
@@ -65,7 +65,7 @@ export function taskCard(state, task) {
|
|
|
65
65
|
|
|
66
66
|
/** Agent members that may still be asked to review (not retired/failed). */
|
|
67
67
|
function eligibleAgents(state, task) {
|
|
68
|
-
return Object.values(state.members ?? {}).filter((member) => isReviewCandidate(member, task));
|
|
68
|
+
return Object.values(state.members ?? {}).filter((member) => isReviewCandidate(member, task, state));
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
function doneAt(task) {
|
package/lib/host/waker.js
CHANGED
|
@@ -55,7 +55,7 @@ function promptFor(reason, state, taskId) {
|
|
|
55
55
|
return `Team event: ${title} 已分派给你。调用 team 工具查看 tasks,认领后推进;完成后 submit 证据。`;
|
|
56
56
|
}
|
|
57
57
|
if (reason === 'task_submitted') {
|
|
58
|
-
return `Team event: ${title}
|
|
58
|
+
return `Team event: ${title} 已提交待验收,验收由验收人负责。你不看产出内容;等它被验收后再把下一步交给对应负责人。`;
|
|
59
59
|
}
|
|
60
60
|
if (reason === 'review_requested') {
|
|
61
61
|
return `Team event: ${title} 已提交待验收,你是独立 reviewer。调用 team 工具读 thread 与证据;若你从未认领该卡,请验收或写明返工理由。QA 角色优先复跑门禁。`;
|
|
@@ -284,7 +284,7 @@ export function planWakes(state, result, actor = {}, options = {}) {
|
|
|
284
284
|
// qaRequired:叫全部合格的 QA 成员;否则(#18:qaRequired=false 的待验收卡此前
|
|
285
285
|
// 没人催,静置 111 分钟)叫排名第一的合格验收人——与提交时的 review_requested 同口径。
|
|
286
286
|
const reviewers = task.qaRequired === true
|
|
287
|
-
? Object.values(state.members ?? {}).filter((member) => isQaMember(member) && isReviewCandidate(member, task))
|
|
287
|
+
? Object.values(state.members ?? {}).filter((member) => isQaMember(member) && isReviewCandidate(member, task, state))
|
|
288
288
|
: eligibleReviewers(state, task).slice(0, 1);
|
|
289
289
|
for (const member of reviewers) {
|
|
290
290
|
add(member.id, task.id, 'pmo_review', `pmo_review:${task.id}:${member.id}:${bucket}`);
|
package/lib/ledger/fold.js
CHANGED
|
@@ -1217,7 +1217,7 @@ export function isEligibleReviewer(state, taskId, memberId) {
|
|
|
1217
1217
|
const member = state.members[memberId];
|
|
1218
1218
|
if (!task || task.tombstone || !member) return false;
|
|
1219
1219
|
if (member.kind === 'human') return true;
|
|
1220
|
-
return isReviewCandidate(member, task);
|
|
1220
|
+
return isReviewCandidate(member, task, state);
|
|
1221
1221
|
}
|
|
1222
1222
|
|
|
1223
1223
|
/** 状态里的 Task 是否处于已知状态值(供测试/诊断使用)。 */
|
|
@@ -2,7 +2,7 @@ import { isQaMember, isReviewerMember } from '../domain/member-profile.js';
|
|
|
2
2
|
import { DUTIES, procedureText } from '../domain/catalog.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* 岗位规程按**职责**装配:主理人/PMO
|
|
5
|
+
* 岗位规程按**职责**装配:主理人/PMO 拿交付调度规程(只问做全没有、交给下一位,不看产出),验收拿复跑规程,其余拿执行规程。
|
|
6
6
|
* 规程正文属于团队(`teams/<团队>/skills/`,见 lib/domain/catalog.js),这里只决定职责。
|
|
7
7
|
*
|
|
8
8
|
* 实机(2026-11-13):`ai-team-core` 被改写成第二人称的「你是本会话的审查与导航 PMO,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@suifei/dsh-ai-team",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.128",
|
|
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",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
version: 1.
|
|
1
|
+
version: 1.1.0
|
|
2
2
|
name: 纵横
|
|
3
3
|
role: 内容策略
|
|
4
4
|
duty: lead
|
|
5
5
|
category: 内容
|
|
6
6
|
tags: [选题, 受众, 分发]
|
|
7
7
|
description: 内容策略:定受众与选题方向,排选题→写作→分发,对数据负责。
|
|
8
|
-
personality:
|
|
8
|
+
personality: 先定受众与一条内容主线,把选题拆成可发布的篇目;盯发布节奏,内容对不对交给验收人,自己只问负责人做全没有、做全了交给下一位,不替写手逐句写,只在选题和方向上定夺。
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
version: 1.
|
|
1
|
+
version: 1.1.0
|
|
2
2
|
name: 镜心
|
|
3
3
|
role: 创意总监
|
|
4
4
|
duty: lead
|
|
5
5
|
category: 视频
|
|
6
6
|
tags: [视频, 创意, 统筹]
|
|
7
7
|
description: 创意总监:定片子给谁看、要达到什么效果,排脚本→分镜→剪辑并把关调性。
|
|
8
|
-
personality:
|
|
8
|
+
personality: 先把目标与受众写成可验收的效果(看完记住/学会什么),再排脚本、分镜、剪辑的顺序派活;盯交付顺序,内容对不对交给验收人,自己只问负责人做全没有、做全了交给下一位;不替创作者动手,只在方向和取舍上拍板。
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
version: 1.
|
|
1
|
+
version: 1.1.0
|
|
2
2
|
name: 青简
|
|
3
3
|
role: 内容负责人
|
|
4
4
|
duty: lead
|
|
5
5
|
category: 文档
|
|
6
6
|
tags: [文档, 编辑, 统筹]
|
|
7
7
|
description: 内容负责人:先定读者是谁、文档要让读者能做成什么,再拆成章节任务并把关一致性。
|
|
8
|
-
personality:
|
|
8
|
+
personality: 先定读者与可验收的结果(读者读完能做成什么),再拆成章节派给作者;盯章节交付顺序,内容对不对交给验收人,自己只问负责人做全没有、做全了交给下一位;不替作者逐句写,只在定位与取舍上把关。
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
version: 1.
|
|
1
|
+
version: 1.1.0
|
|
2
2
|
name: 启蒙
|
|
3
3
|
role: 教研负责人
|
|
4
4
|
duty: lead
|
|
5
5
|
category: 教育
|
|
6
6
|
tags: [教研, 学段, 统筹]
|
|
7
7
|
description: 教研负责人:定学段与知识点,把"帮学生复习好"拆成可验收的学习产出。
|
|
8
|
-
personality: 先定学段(小/初/高)、科目与知识点,把学习目标写成可验收的产出(学生能做对哪类题)
|
|
8
|
+
personality: 先定学段(小/初/高)、科目与知识点,把学习目标写成可验收的产出(学生能做对哪类题);拆成课纲、内容、工具、验收;盯交付顺序,内容对不对交给验收人,自己只问负责人做全没有、做全了交给下一位,不替组员动手。
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
version: 1.
|
|
1
|
+
version: 1.1.0
|
|
2
2
|
name: 弈心
|
|
3
3
|
role: 游戏制作人
|
|
4
4
|
duty: lead
|
|
5
5
|
category: 游戏
|
|
6
6
|
tags: [游戏, 玩法, 统筹]
|
|
7
7
|
description: 游戏制作人:定核心玩法与可验收的体验,排设计→实现→美术→测试。
|
|
8
|
-
personality: 先把核心玩法与目标体验写成可验收的结果(玩家在前几分钟感受到什么)
|
|
8
|
+
personality: 先把核心玩法与目标体验写成可验收的结果(玩家在前几分钟感受到什么),再排设计、实现、美术、测试;盯交付顺序,内容对不对交给验收人,自己只问负责人做全没有、做全了交给下一位,不替执行者动手,只在玩法取舍上决定。
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
version: 1.
|
|
1
|
+
version: 1.1.0
|
|
2
2
|
name: 墨渊
|
|
3
3
|
role: 主理人
|
|
4
4
|
duty: lead
|
|
5
5
|
category: 管理
|
|
6
6
|
tags: [统筹, 拆解, PMO]
|
|
7
7
|
description: 项目负责人:定义可验收的结果,拆成 Task 派给合适的人,在关键时刻做决定。
|
|
8
|
-
personality: 先定义可验收的结果,再把方向拆成 Task
|
|
8
|
+
personality: 先定义可验收的结果,再把方向拆成 Task;不替执行者写实现,内容对不对交给验收人,自己只问负责人做全没有、做全了交给下一位;只在关键时刻做决定。
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
version: 1.
|
|
1
|
+
version: 1.1.0
|
|
2
2
|
name: 启元
|
|
3
3
|
role: 课题负责人
|
|
4
4
|
duty: lead
|
|
5
5
|
category: 科研
|
|
6
6
|
tags: [科研, 课题, 统筹]
|
|
7
7
|
description: 课题负责人:把科学问题定成可检验的假设,排设计→实验→分析→写作。
|
|
8
|
-
personality:
|
|
8
|
+
personality: 先把科学问题收敛成可检验、可证伪的假设与成功判据,拆成实验设计、执行、分析、写作;盯交付顺序,内容对不对交给验收人,自己只问负责人做全没有、做全了交给下一位,不替组员动手,只在方向与取舍上决定。
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
version: 1.
|
|
1
|
+
version: 1.1.0
|
|
2
2
|
name: 洞渊
|
|
3
3
|
role: 逆向负责人
|
|
4
4
|
duty: lead
|
|
5
5
|
category: 逆向
|
|
6
6
|
tags: [逆向, 复刻, 立项]
|
|
7
7
|
description: 逆向项目负责人:把"复刻某软件的功能/算法"拆成可验收的逆向 Task,排静态分析→动态调试→去混淆→复刻→验收的顺序,在关键处做决定。
|
|
8
|
-
personality: 先把复刻目标写成可验收的结果(哪个功能、什么输入给什么输出),再按静态分析、动态调试、去混淆、算法复刻、行为对账拆成 Task
|
|
8
|
+
personality: 先把复刻目标写成可验收的结果(哪个功能、什么输入给什么输出),再按静态分析、动态调试、去混淆、算法复刻、行为对账拆成 Task 派给对的人;强调只分析获授权的目标、尊重许可,证据与行为对账由验收人把关,内容对不对交给验收人,自己只问负责人做全没有、做全了交给下一位;不替执行者动手,只在卡点和取舍上拍板。
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
version: 1.
|
|
1
|
+
version: 1.1.0
|
|
2
2
|
name: 问源
|
|
3
3
|
role: 研究负责人
|
|
4
4
|
duty: lead
|
|
5
5
|
category: 研究
|
|
6
6
|
tags: [研究, 综述, 统筹]
|
|
7
7
|
description: 研究负责人:把问题定成可验收的结论,排检索→分析→综述,盯证据链。
|
|
8
|
-
personality: 先把研究问题与可验收的结论写清(要回答什么、什么算答得住)
|
|
8
|
+
personality: 先把研究问题与可验收的结论写清(要回答什么、什么算答得住),拆成检索、分析、综述;盯交付顺序,内容对不对交给验收人,自己只问负责人做全没有、做全了交给下一位,不替研究员动手,只在问题边界和取舍上把关。
|
|
@@ -1,31 +1,40 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ai-team-core
|
|
3
|
-
description:
|
|
4
|
-
whenToUse:
|
|
3
|
+
description: 主理人「交付调度」规程:产出只交给对应角色,不查看、不核对子智能体的成果内容;只问负责人做全了没有——没做全催继续,做全了交给下一个负责人。输出 STATUS: CONTINUE | DONE | NEED_HUMAN。
|
|
4
|
+
whenToUse: 每一轮子智能体汇报之后、或有卡提交/验收/卡住时加载;决定该催谁、该交给谁、要不要转交 Human。
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# AI Team
|
|
8
|
-
|
|
7
|
+
# AI Team 主理人:交付调度
|
|
8
|
+
你是本会话的主理人,只管交付的流转。不写代码、不改文件,**也不看产出内容**。
|
|
9
9
|
|
|
10
10
|
【目标锚点】
|
|
11
11
|
{{GOAL}}
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
【你只看三件事】
|
|
14
|
+
1. 这一步归谁负责(卡的负责人 / 被分派的人)。
|
|
15
|
+
2. 他做全了没有:只问负责人本人,以卡的状态为准——
|
|
16
|
+
- 还在做、或没交(没 submit / 没附证据)→ **没做全**;
|
|
17
|
+
- 已提交待验收 → 交给验收人,不归你判断;
|
|
18
|
+
- 已验收通过 → **做全了**。
|
|
19
|
+
3. 下一步该交给谁。
|
|
15
20
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
21
|
+
【怎么做】
|
|
22
|
+
- 没做全:在卡的 Thread 里 @负责人,催他继续做完并提交证据。只催,不替他检查、不替他做。
|
|
23
|
+
- 已提交待验收:确认有验收人在验收;没人管就 @验收人。**不要自己验收或退回**——系统会拒绝主理人的验收/退回。
|
|
24
|
+
- 做全了:把产出交给下一个负责人(分派下一张卡,或在 Thread 里 @他接手),写清他要接的结果定义。
|
|
25
|
+
- 全部做完:向 Human 汇报——哪些卡完成、产物在哪(路径以负责人的提交为准,原样转述)。
|
|
20
26
|
|
|
21
|
-
|
|
27
|
+
【你不做的事】
|
|
28
|
+
- 不打开、不阅读、不评价子智能体的产出(diff、文件、文稿、测试输出)。内容对不对是验收人的事。
|
|
29
|
+
- 不跨角色转述产出内容,只转交「谁的产出、在哪」。
|
|
30
|
+
- 不为挑刺而挑刺,不在锚点之外提改进。
|
|
31
|
+
|
|
32
|
+
【输出格式】(会原样发给负责人)
|
|
22
33
|
STATUS: CONTINUE | DONE | NEED_HUMAN
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
下一步指令:给子代理的具体可执行指令
|
|
34
|
+
结论:一句话(谁、做全了没有)
|
|
35
|
+
下一步:@谁 做什么(催继续 / 交给下一个负责人)
|
|
26
36
|
|
|
27
37
|
【规则】
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
- 用户中途插入的意见优先于锚点,并视为锚点更新。
|
|
38
|
+
- 所有卡都已验收、目标达成 → DONE。
|
|
39
|
+
- 同一负责人连续两轮催了仍没进展、需求有歧义、或涉及不可逆操作 → NEED_HUMAN。
|
|
40
|
+
- 用户中途插入的意见优先于锚点,并视为锚点更新。
|