@suifei/dsh-ai-team 0.4.145 → 0.4.146
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 +5 -0
- package/LICENSE +21 -21
- package/README.md +19 -1
- package/client.js +118 -17
- package/cordis.patch.yml +31 -31
- package/icon.svg +12 -12
- package/index.js +7 -1
- package/lib/domain/ids.js +26 -26
- package/lib/domain/inbox.js +93 -93
- package/lib/domain/member-config.js +168 -168
- package/lib/host/decision-report.js +72 -72
- package/lib/host/default-workspace.js +69 -69
- package/lib/host/fault-adapter.js +50 -50
- package/lib/host/people-view.js +9 -2
- package/lib/host/permission-guard.js +61 -61
- package/lib/host/project-registry.js +104 -104
- package/lib/host/risk-view.js +99 -99
- package/lib/host/weekly-view.js +86 -86
- package/lib/host/workspace-path.js +94 -94
- package/lib/ledger/checkpoint.js +415 -415
- package/lib/ledger/events.js +398 -398
- package/lib/ledger/namespace.js +124 -124
- package/lib/ledger/tools.js +118 -118
- package/lib/ledger/writer.js +1266 -1266
- package/lib/runtime/error-chain.js +31 -31
- package/lib/runtime/shell-guard.js +102 -102
- package/lib/runtime/skill-catalog.js +41 -41
- package/lib/runtime/skill-policy.js +12 -12
- package/lib/skillopt/adopt-gate.js +108 -108
- package/lib/skillopt/gate-wiring.js +146 -146
- package/lib/skillopt/jobs.js +135 -135
- package/lib/skillopt/proposal-store.js +33 -33
- package/lib/skillopt/review-runner.js +107 -107
- package/lib/skillopt/rubric.js +189 -189
- package/lib/skillopt/subagent-text.js +101 -101
- package/lib/skillopt/tool-access.js +56 -56
- package/locale/en.json +6 -6
- package/locale/zh.json +6 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.146 - 2026-12-01
|
|
4
|
+
|
|
5
|
+
- 人员池不再显示或统计归档项目;归档历史保留,旧页面不能继续向归档项目提交批量模型配置。侧栏新增「团队管理」,集中管理活动项目的成员与团队预设。感谢 @qq958691165 的反馈(#103)。
|
|
6
|
+
- 工作台启动遇到 503 时按已知的宿主连接与插件初始化错误分别提供排查步骤,来源不明时提示先检查宿主。README 增加桌面端排查步骤。反馈者遇到的 503 根因待确认。感谢 @Arnoldnuo 的反馈(#102)。
|
|
7
|
+
|
|
3
8
|
## 0.4.145 - 2026-11-26
|
|
4
9
|
|
|
5
10
|
- PMO 自动决策不再给「不推荐」加分或按字母编号偏向选项,且「建议 A」可命中带括注的 A 选项。感谢 @Lamooner 的复现和建议(#99)。
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 suifei
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 suifei
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -19,6 +19,13 @@
|
|
|
19
19
|
|
|
20
20
|
<p align="center">觉得有用?点右上角 ⭐ <a href="https://github.com/suifei/dsh-ai-team">Star</a> 支持一下,也欢迎 <a href="https://github.com/suifei/dsh-ai-team/issues">提 issue</a> 和 <a href="https://github.com/suifei/dsh-ai-team/pulls">发 PR</a>。</p>
|
|
21
21
|
|
|
22
|
+
> [!IMPORTANT]
|
|
23
|
+
> **🤝 社区共创:文渊阁下一步怎么走,由社区决定。**
|
|
24
|
+
>
|
|
25
|
+
> 任何想法都欢迎[提到 Issue 里](https://github.com/suifei/dsh-ai-team/issues/new/choose):想加的功能、用着不顺的地方,或者你希望文渊阁以后长成什么样。**项目路线完全由本仓库的 Issue 驱动,不由维护者凭个人偏好改方向。**
|
|
26
|
+
>
|
|
27
|
+
> 每条建议都会认真看、公开反馈。社区讨论定下来的改动,由我们负责实现、验证和发版,发布结果也会回到对应的 Issue。
|
|
28
|
+
|
|
22
29
|
> 文渊阁,藏修、校勘、纂辑之地。
|
|
23
30
|
> 在这里,Human 不在环里逐条调度,而是在环上定方向、守信任、做最后那一步。
|
|
24
31
|
|
|
@@ -30,6 +37,8 @@
|
|
|
30
37
|
|
|
31
38
|
## 最近更新
|
|
32
39
|
|
|
40
|
+
- **归档项目与团队管理**(0.4.146)。人员池只汇总未归档项目的成员与任务,归档任务和会话仍可查阅。侧栏新增「团队管理」,集中管理项目成员和团队预设。感谢 [@qq958691165](https://github.com/qq958691165) 的反馈([#103](https://github.com/suifei/dsh-ai-team/issues/103))。
|
|
41
|
+
- **桌面端 503 排查**(0.4.146)。工作台按启动错误提供对应的排查提示,README 补充桌面端排查步骤。感谢 [@Arnoldnuo](https://github.com/Arnoldnuo) 的反馈([#102](https://github.com/suifei/dsh-ai-team/issues/102))。
|
|
33
42
|
- **PMO 决策排序**(0.4.145):不再把「不推荐」当作加分,也不按选项字母编号偏向某个方案;结构化建议可以匹配带括注的编号。感谢 [@Lamooner](https://github.com/Lamooner) 的复现和建议([#99](https://github.com/suifei/dsh-ai-team/issues/99))。
|
|
34
43
|
- **工作目录选择兜底**(0.4.145):新建和编辑项目时,如果宿主没有提供此表单可用的目录选择器,可直接粘贴或输入完整路径。不改宿主配置,也不会在提交项目前注册 Workspace(感谢 [@ljyzww](https://github.com/ljyzww) 的反馈,[#100](https://github.com/suifei/dsh-ai-team/issues/100))。
|
|
35
44
|
- **输入框与 @成员**(0.4.120–0.4.123):输入框随内容长高、可拖大;能贴图、拖文件、选附件;@ 能点名具体成员,被 @ 的成员可以直接在主对话回你;成员可一键复制。文渊阁对话框和 DSH 标准会话(「文渊阁·PMO」)是同一套实现(感谢 [@xiuchuan666](https://github.com/xiuchuan666) 的反馈与建议,#65)。
|
|
@@ -154,6 +163,12 @@ dsh --profile ai-team --no-open --port 33271
|
|
|
154
163
|
|
|
155
164
|
> 插件只应安装在可信机器 / 可信 Workspace:成员以 `danger-full-access` 运行,且 profile patch 会把 sandbox / approval / permission 固定为 `danger-full-access / never`。普通 `desktop`/`web` profile 不安装时保持原有 preset roster。
|
|
156
165
|
|
|
166
|
+
### 桌面端打开后提示 503
|
|
167
|
+
|
|
168
|
+
先用上面的独立 `ai-team` profile 启动,并从终端给出的地址打开,不需要改原有桌面配置。若仍报 503,请在 Issue 里注明操作系统、DSH Desktop / Harness 和文渊阁版本、安装方式及 profile。能看到响应时,可附去掉查询参数的请求路径与 `error.code`;也可贴一行脱敏启动日志。请勿附上令牌、Cookie 或个人路径。
|
|
169
|
+
|
|
170
|
+
如果是在 DSH 桌面应用里看到空白 503,顺手确认同一时刻普通工作区或设置能否打开。这有助于区分桌面宿主未就绪和文渊阁自身初始化失败;仅凭 503 不能判断是哪一种。
|
|
171
|
+
|
|
157
172
|
---
|
|
158
173
|
|
|
159
174
|
## 界面
|
|
@@ -178,7 +193,8 @@ dsh --profile ai-team --no-open --port 33271
|
|
|
178
193
|
- **直接对话**:点击成员名字直接打开该 Agent 的 DSH 原生 Session;没有 session 会先激活;打不开时落到成员资料,资料里有「直接对话」按钮。
|
|
179
194
|
- **成员任务**:成员资料里点「他的任务」,查看他 owner/assignee 的 Task。
|
|
180
195
|
- **成员资料**:点「⋯」打开,按「资料 / 模型 / 技能 / 协作」分页签:改名、职责、个性、备忘;运行配方、提供商 / 模型 / 推理等级;技能与「进化」;交接人与私信。右上角是他的任务、直接对话、复制成员、存为人才、重置会话、重新蒸馏、离开团队。
|
|
181
|
-
-
|
|
196
|
+
- **人员池**:按人汇总进行中项目里的成员卡片(负载、所在项目、跳转);「批量配置模型」只改所选成员在未归档项目中的配置。归档不删除任务记录或成员的 DSH 会话。
|
|
197
|
+
- **团队管理**:从侧栏进入,切换未归档的项目,添加成员、打开成员资料或会话,也可查看、创建和删除自建团队预设。预设用于新建项目,不会改动现有团队。
|
|
182
198
|
|
|
183
199
|
---
|
|
184
200
|
|
|
@@ -332,6 +348,8 @@ round-19 DeepSeek + Zhipu 双 provider
|
|
|
332
348
|
|
|
333
349
|
| 贡献者 | 贡献 | 带来的进展 |
|
|
334
350
|
|---|---|---|
|
|
351
|
+
| [@qq958691165](https://github.com/qq958691165) | 归档项目的成员反馈、团队管理建议 [#103](https://github.com/suifei/dsh-ai-team/issues/103) | 人员池排除归档项目,侧栏集中管理项目成员与团队预设 |
|
|
352
|
+
| [@Arnoldnuo](https://github.com/Arnoldnuo) | 桌面端启动 503 反馈 [#102](https://github.com/suifei/dsh-ai-team/issues/102) | 工作台提供分情况的 503 提示,补充桌面端排查文档 |
|
|
335
353
|
| [@Lamooner](https://github.com/Lamooner) | PMO 决策反馈与建议 [#99](https://github.com/suifei/dsh-ai-team/issues/99) | 避免选中「不推荐」项,移除编号偏向并补充括注编号回归 |
|
|
336
354
|
| [@ljyzww](https://github.com/ljyzww) | Windows 目录选择反馈 [#100](https://github.com/suifei/dsh-ai-team/issues/100) | 新建和编辑项目共用目录选择失败提示,保留手填路径 |
|
|
337
355
|
| [@xiuchuan666](https://github.com/xiuchuan666) | 反馈与建议 [#65](https://github.com/suifei/dsh-ai-team/issues/65) | 输入框长高可拖大、贴图拖文件、@ 点名成员(0.4.120–0.4.123);人才市场与在线人才库(0.4.124–0.4.131);团队扩编:超限排队、开发验收配对、空闲必派、写入范围、加人建议(0.4.140) |
|
package/client.js
CHANGED
|
@@ -95,6 +95,9 @@ window.__ModuleLoader__.load({
|
|
|
95
95
|
streamUp: '实时更新已恢复。',
|
|
96
96
|
loadFailedTitle: '工作台不可达',
|
|
97
97
|
loadFailedBody: 'bootstrap 接口(/ai-team)无法访问;请确认插件已启用后重试。',
|
|
98
|
+
bootFailure503: '文渊阁初始化失败。请查看宿主日志中的文渊阁启动错误,再点重试。',
|
|
99
|
+
bootConnection503: '宿主未提供插件所需的连接服务。请确认宿主已启动,并使用独立 ai-team profile。',
|
|
100
|
+
bootUnknown503: '宿主或文渊阁暂不可用。请先确认 DSH 的工作区或设置能否正常打开,再重试。',
|
|
98
101
|
spike: 'AI Team',
|
|
99
102
|
spikeTitle: '文渊阁 AI Team 工作台:修书、校勘、纂辑;方向、验收与账本。',
|
|
100
103
|
navAria: '页面导航',
|
|
@@ -309,6 +312,7 @@ window.__ModuleLoader__.load({
|
|
|
309
312
|
tcSkills: '技能', tcEmpty: '还没装技能(可选)', tcAddExisting: '从已有装', tcWriteOwn: '自写一份', tcImport: '导入 .md', tcPick: '选一个已有技能…', tcAdd: '加入', tcRemove: '移除',
|
|
310
313
|
tcSkillName: '技能名(英文/数字/-)', tcSkillBody: '技能正文(SKILL.md)', tcSkillDup: '已经装了同名技能', tcSave: '存为我的人才', tcSaving: '保存中…',
|
|
311
314
|
memberSaveAsTalent: '存为人才', tcFromMember: '从成员「{name}」存出:沿用它此刻的岗位、职责、性格与技能,可先修改再保存。', tcModelKept: '沿用模型:{model}', tcMissing: '这些技能找不到正文,没有带上:{skills}', tcDraftFailed: '读取成员草稿失败:{error}',
|
|
315
|
+
teamManagement: '团队管理', teamManageGoal: '管理当前项目成员,或为新项目准备团队预设。', teamActiveProject: '当前项目成员', teamPickProject: '切换活动项目以管理成员', teamNoActiveProject: '请选择一个未归档的项目。', teamPresets: '团队预设', teamPresetHint: '预设用于新建项目,不会更改已创建的项目。', teamNoPresets: '没有可用的团队预设。',
|
|
312
316
|
projectTeam: '团队', teamCompose: '组一个新团队', teamComposeTitle: '组队', teamComposeHint: '从人才里挑人组队:同一人才可以招多位,给其中一位定为负责人(新项目的主理人)。', teamName: '团队名', teamDesc: '说明', teamMembers: '成员', teamPick: '从人才里挑人', teamAdd: '加入', teamLead: '负责人', teamEmptyPick: '还没挑人', teamSave: '保存团队', teamBack: '返回', teamDelete: '删除这个团队', teamDeleteConfirm: '删除自建团队「{name}」?团队文件会被删除,已用它建的项目和其中成员不受影响。', teamLoadFailed: '团队列表读取失败:{error}',
|
|
313
317
|
talentEmpty: '没有符合条件的人才。',
|
|
314
318
|
talentLoading: '正在读取人才市场…',
|
|
@@ -556,6 +560,9 @@ window.__ModuleLoader__.load({
|
|
|
556
560
|
loading: 'Loading…',
|
|
557
561
|
loadFailedTitle: 'Workbench unreachable',
|
|
558
562
|
loadFailedBody: 'The bootstrap endpoint (/ai-team) cannot be reached; confirm the plugin is enabled and retry.',
|
|
563
|
+
bootFailure503: 'Wenyuan Pavilion could not initialize. Check its startup error in the host log and retry.',
|
|
564
|
+
bootConnection503: 'The host connection service is unavailable. Make sure the host is running and use the dedicated ai-team profile.',
|
|
565
|
+
bootUnknown503: 'The host or Wenyuan Pavilion is unavailable. Check whether a DSH workspace or Settings opens, then retry.',
|
|
559
566
|
streamDown: 'Live updates stopped; the view may lag while the stream reconnects…',
|
|
560
567
|
streamUp: 'Live updates are back.',
|
|
561
568
|
spike: 'AI Team',
|
|
@@ -773,6 +780,7 @@ window.__ModuleLoader__.load({
|
|
|
773
780
|
tcSkills: 'Skills', tcEmpty: 'No skills yet (optional)', tcAddExisting: 'From existing', tcWriteOwn: 'Write one', tcImport: 'Import .md', tcPick: 'Pick an existing skill…', tcAdd: 'Add', tcRemove: 'Remove',
|
|
774
781
|
tcSkillName: 'Skill name (a-z, 0-9, -)', tcSkillBody: 'Skill body (SKILL.md)', tcSkillDup: 'That skill name is already staged', tcSave: 'Save as my talent', tcSaving: 'Saving…',
|
|
775
782
|
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}',
|
|
783
|
+
teamManagement: 'Team management', teamManageGoal: 'Manage the current project’s members or prepare team presets for new projects.', teamActiveProject: 'Current project members', teamPickProject: 'Switch active project to manage its members', teamNoActiveProject: 'Select a project that is not archived.', teamPresets: 'Team presets', teamPresetHint: 'Presets are used for new projects and do not change existing projects.', teamNoPresets: 'No available team presets.',
|
|
776
784
|
projectTeam: 'Team', teamCompose: 'Compose a new team', teamComposeTitle: 'Compose a team', teamComposeHint: 'Pick talents into a team: the same talent can be hired more than once; mark one as the lead (the new project owner).', teamName: 'Team name', teamDesc: 'Description', teamMembers: 'Members', teamPick: 'Pick from talents', teamAdd: 'Add', teamLead: 'Lead', teamEmptyPick: 'Nobody picked yet', teamSave: 'Save team', teamBack: 'Back', teamDelete: 'Delete this team', teamDeleteConfirm: 'Delete your team “{name}”? Its file is removed; projects already created from it and their members are unaffected.', teamLoadFailed: 'Could not load teams: {error}',
|
|
777
785
|
talentEmpty: 'No talent matches.',
|
|
778
786
|
talentLoading: 'Loading the talent market…',
|
|
@@ -2374,7 +2382,7 @@ window.__ModuleLoader__.load({
|
|
|
2374
2382
|
: h(EmptyState, { t, title: t('memberNoTasks'), body: t('memberNoTasksBody'), compact: true })));
|
|
2375
2383
|
}
|
|
2376
2384
|
|
|
2377
|
-
function LeftPanel({ t, data, projectId, scope, tab, inboxUnread, onBack, onInbox, onBoard, onPeople, peopleActive, onProject, onNewProject, onAgent, onAgentMore, onAgentChat, onAddAgent, onRecruit }) {
|
|
2385
|
+
function LeftPanel({ t, data, projectId, scope, tab, inboxUnread, onBack, onInbox, onBoard, onPeople, peopleActive, onTeam, onProject, onNewProject, onAgent, onAgentMore, onAgentChat, onAddAgent, onRecruit }) {
|
|
2378
2386
|
const projects = data.projects.filter((project) => !project.archived);
|
|
2379
2387
|
const activeAgents = data.agents.filter((agent) => agent.status !== 'retired');
|
|
2380
2388
|
const talentAgents = data.agents.filter((agent) => agent.status === 'retired');
|
|
@@ -2402,6 +2410,12 @@ window.__ModuleLoader__.load({
|
|
|
2402
2410
|
'aria-current': peopleActive ? 'page' : undefined,
|
|
2403
2411
|
onClick: onPeople,
|
|
2404
2412
|
}, h(Ico, { name: 'layers' }), h('span', null, t('people'))),
|
|
2413
|
+
h('button', {
|
|
2414
|
+
className: cx('at-navrow', scope === 'team' && 'at-on'),
|
|
2415
|
+
type: 'button',
|
|
2416
|
+
'aria-current': scope === 'team' ? 'page' : undefined,
|
|
2417
|
+
onClick: onTeam,
|
|
2418
|
+
}, h(Ico, { name: 'users' }), h('span', null, t('teamManagement'))),
|
|
2405
2419
|
),
|
|
2406
2420
|
h('div', { className: 'at-h' },
|
|
2407
2421
|
h('span', null, t('projects')),
|
|
@@ -2441,6 +2455,45 @@ window.__ModuleLoader__.load({
|
|
|
2441
2455
|
h('button', { className: 'at-btn at-btn-small', type: 'button', onClick: () => onRecruit(agent) }, t('recruit')))))) : null);
|
|
2442
2456
|
}
|
|
2443
2457
|
|
|
2458
|
+
function TeamManagementPage({ t, project, projects, agents, switching, onProject, onAdd, onAgent, onChat, onRecruit, teams, selectedTeam, onSelectTeam, error, onLoad, onCompose, onDelete }) {
|
|
2459
|
+
const active = agents.filter((agent) => agent.status !== 'retired');
|
|
2460
|
+
const retired = agents.filter((agent) => agent.status === 'retired');
|
|
2461
|
+
return h('div', { className: 'at-stream', role: 'region', 'aria-label': t('teamManagement') },
|
|
2462
|
+
h('div', { className: 'at-streaminner at-streamwide' },
|
|
2463
|
+
h('section', { className: 'at-pane', 'aria-labelledby': 'at-team-members' },
|
|
2464
|
+
h('h2', { id: 'at-team-members', className: 'at-panetitle' }, t('teamActiveProject')),
|
|
2465
|
+
h('label', { className: 'at-field' }, h('span', null, t('teamPickProject')),
|
|
2466
|
+
h('select', { value: project?.id ?? '', disabled: switching || !projects.length, onChange: (event) => {
|
|
2467
|
+
const next = projects.find((candidate) => candidate.id === event.target.value);
|
|
2468
|
+
if (next) void onProject(next);
|
|
2469
|
+
} }, !project ? h('option', { value: '' }, t('teamNoActiveProject')) : null,
|
|
2470
|
+
projects.map((candidate) => h('option', { key: candidate.id, value: candidate.id }, candidate.name)))),
|
|
2471
|
+
switching ? h('div', { className: 'at-modalmeta', role: 'status' }, t('loading')) : project ? h(React.Fragment, null,
|
|
2472
|
+
h('div', { className: 'at-tcpick' }, h('button', { className: 'at-btn at-btn-small at-btn-accent', type: 'button', onClick: onAdd }, withIco('plus', t('addAgent'), 12))),
|
|
2473
|
+
active.length ? h('div', { role: 'list', 'aria-label': t('agentsAria') }, active.map((agent) => h(AgentRow, { key: agent.id, t, agent, onAgent, onAgentMore: onAgent, onAgentChat: onChat }))) : h('div', { className: 'at-modalmeta' }, t('emptyColumn')),
|
|
2474
|
+
retired.length ? h('details', { className: 'at-archived' },
|
|
2475
|
+
h('summary', null, tf(t, 'talentPoolCount', { n: retired.length })),
|
|
2476
|
+
retired.map((agent) => h('div', { key: agent.id, className: 'at-agent at-talented' },
|
|
2477
|
+
h('div', { className: 'at-agentmeta' }, h('span', { className: 'at-agentname' }, agent.name)),
|
|
2478
|
+
h('button', { className: 'at-btn at-btn-small', type: 'button', onClick: () => onRecruit(agent) }, t('recruit'))))) : null) : null),
|
|
2479
|
+
h('section', { className: 'at-pane', 'aria-labelledby': 'at-team-presets' },
|
|
2480
|
+
h('h2', { id: 'at-team-presets', className: 'at-panetitle' }, t('teamPresets')),
|
|
2481
|
+
h('p', { className: 'at-modalmeta' }, t('teamPresetHint')),
|
|
2482
|
+
h('div', { className: 'at-tcpick' },
|
|
2483
|
+
h('button', { className: 'at-btn at-btn-small at-btn-accent', type: 'button', onClick: onCompose }, withIco('users', t('teamCompose'), 12)),
|
|
2484
|
+
h('button', { className: 'at-btn at-btn-small', type: 'button', onClick: onLoad }, withIco('sync', t('refresh'), 12)),
|
|
2485
|
+
selectedTeam?.source === 'user' ? h('button', { className: 'at-btn at-btn-small at-btn-danger', type: 'button', onClick: () => void onDelete(selectedTeam) }, withIco('close', t('teamDelete'), 12)) : null),
|
|
2486
|
+
error ? h('div', { className: 'at-modalerror', role: 'alert' }, error) : null,
|
|
2487
|
+
teams === null ? h('div', { className: 'at-modalmeta', role: 'status' }, t('talentLoading'))
|
|
2488
|
+
: teams.length ? h('label', { className: 'at-field' }, h('span', null, t('projectTeam')),
|
|
2489
|
+
h('select', { value: selectedTeam?.id ?? '', onChange: (event) => onSelectTeam(event.target.value) },
|
|
2490
|
+
teams.map((team) => h('option', { key: team.id, value: team.id }, team.name + ' · ' + team.members.length)))) : h('div', { className: 'at-modalmeta' }, t('teamNoPresets')),
|
|
2491
|
+
selectedTeam?.description ? h('p', { className: 'at-modalmeta' }, selectedTeam.description) : null,
|
|
2492
|
+
selectedTeam ? h('div', { className: 'at-marketgrid', role: 'list', 'aria-label': t('teamMembers') },
|
|
2493
|
+
selectedTeam.members.map((member) => h('div', { key: member.id, className: 'at-talent', role: 'listitem' },
|
|
2494
|
+
h(TalentInfo, { t, talent: member, lead: member.id === selectedTeam.lead })))) : null)));
|
|
2495
|
+
}
|
|
2496
|
+
|
|
2444
2497
|
function ConvertForm({ t, project, task, thread, title, dod, onTitle, onDod, onCancel, onSubmit }) {
|
|
2445
2498
|
const valid = Boolean(title.trim() && dod.trim());
|
|
2446
2499
|
const onKeyDown = (event) => {
|
|
@@ -3571,6 +3624,16 @@ window.__ModuleLoader__.load({
|
|
|
3571
3624
|
h(Ico, { name: 'down', size: 12 }), tf(t, 'streamUnseen', { count: unseen })));
|
|
3572
3625
|
}
|
|
3573
3626
|
|
|
3627
|
+
async function bootstrapResponseError(response, t) {
|
|
3628
|
+
const label = 'HTTP ' + response.status + ' for /ai-team/api/bootstrap';
|
|
3629
|
+
if (response.status !== 503) return new Error(label);
|
|
3630
|
+
let code;
|
|
3631
|
+
try { code = (await response.json())?.error?.code; } catch {}
|
|
3632
|
+
if (code === 'BOOT_FAILED') return new Error(label + ' (' + code + '). ' + t('bootFailure503'));
|
|
3633
|
+
if (code === 'E_TRUST_FENCE_UNAVAILABLE') return new Error(label + ' (' + code + '). ' + t('bootConnection503'));
|
|
3634
|
+
return new Error(label + '. ' + t('bootUnknown503'));
|
|
3635
|
+
}
|
|
3636
|
+
|
|
3574
3637
|
function Workbench({ t, ctx }) {
|
|
3575
3638
|
const [phase, setPhase] = React.useState('loading');
|
|
3576
3639
|
const [data, setData] = React.useState(null);
|
|
@@ -3650,7 +3713,10 @@ window.__ModuleLoader__.load({
|
|
|
3650
3713
|
const [nTeam, setNTeam] = React.useState('');
|
|
3651
3714
|
const [teamLoadError, setTeamLoadError] = React.useState('');
|
|
3652
3715
|
const [teamComposeOpen, setTeamComposeOpen] = React.useState(false);
|
|
3653
|
-
const
|
|
3716
|
+
const [teamSwitching, setTeamSwitching] = React.useState(false);
|
|
3717
|
+
const projectSwitchRef = React.useRef(false);
|
|
3718
|
+
const teamLoadSeqRef = React.useRef(0);
|
|
3719
|
+
const selectedTeam = (teamList || []).find((entry) => !entry.broken && entry.id === nTeam) || null;
|
|
3654
3720
|
const [workspaceOpen, setWorkspaceOpen] = React.useState(false);
|
|
3655
3721
|
const [workspaceDraft, setWorkspaceDraft] = React.useState('');
|
|
3656
3722
|
const [workspaceError, setWorkspaceError] = React.useState('');
|
|
@@ -3802,7 +3868,7 @@ window.__ModuleLoader__.load({
|
|
|
3802
3868
|
headers: { accept: 'application/json' },
|
|
3803
3869
|
signal: controller ? controller.signal : undefined,
|
|
3804
3870
|
});
|
|
3805
|
-
if (!response.ok) throw
|
|
3871
|
+
if (!response.ok) throw await bootstrapResponseError(response, t);
|
|
3806
3872
|
const next = normalizePayload(await response.json());
|
|
3807
3873
|
if (!next) throw new Error('invalid bootstrap payload');
|
|
3808
3874
|
if (!alive || seq !== loadSeqRef.current) return;
|
|
@@ -4241,6 +4307,18 @@ window.__ModuleLoader__.load({
|
|
|
4241
4307
|
loadPending();
|
|
4242
4308
|
loadRisks();
|
|
4243
4309
|
}
|
|
4310
|
+
function openTeam() {
|
|
4311
|
+
closeMobile();
|
|
4312
|
+
setMemberViewId(null);
|
|
4313
|
+
setScope('team');
|
|
4314
|
+
setThreadOpen(false);
|
|
4315
|
+
setNote('');
|
|
4316
|
+
void loadTeams(nTeam);
|
|
4317
|
+
}
|
|
4318
|
+
function openTeamComposer() {
|
|
4319
|
+
setTeamComposeOpen(true);
|
|
4320
|
+
void loadTalents();
|
|
4321
|
+
}
|
|
4244
4322
|
function openPeople() {
|
|
4245
4323
|
closeMobile();
|
|
4246
4324
|
setMemberViewId(null);
|
|
@@ -4275,12 +4353,15 @@ window.__ModuleLoader__.load({
|
|
|
4275
4353
|
setBoardFilter('all');
|
|
4276
4354
|
setNote('');
|
|
4277
4355
|
}
|
|
4278
|
-
async function switchProject(next) {
|
|
4356
|
+
async function switchProject(next, nextScope = 'project') {
|
|
4279
4357
|
closeMobile();
|
|
4280
|
-
if (next.id === projectId && scope ===
|
|
4358
|
+
if (next.id === projectId && scope === nextScope) return true;
|
|
4359
|
+
if (projectSwitchRef.current) return false;
|
|
4360
|
+
projectSwitchRef.current = true;
|
|
4361
|
+
if (nextScope === 'team') setTeamSwitching(true);
|
|
4281
4362
|
try {
|
|
4282
|
-
await runCommand('project.activate', { projectId: next.id });
|
|
4283
|
-
|
|
4363
|
+
await runCommand('project.activate', { projectId: next.id }, projectId || next.id);
|
|
4364
|
+
if (nextScope !== 'team' || scopeRef.current === 'team') setScope(nextScope);
|
|
4284
4365
|
setTab('main');
|
|
4285
4366
|
setMemberViewId(null);
|
|
4286
4367
|
setBoardFilter('all');
|
|
@@ -4293,6 +4374,9 @@ window.__ModuleLoader__.load({
|
|
|
4293
4374
|
} catch (error) {
|
|
4294
4375
|
say(tf(t, 'sendFailed', { message: error?.message ?? String(error) }));
|
|
4295
4376
|
return false;
|
|
4377
|
+
} finally {
|
|
4378
|
+
projectSwitchRef.current = false;
|
|
4379
|
+
if (nextScope === 'team') setTeamSwitching(false);
|
|
4296
4380
|
}
|
|
4297
4381
|
}
|
|
4298
4382
|
function openNewProject() {
|
|
@@ -4370,19 +4454,25 @@ window.__ModuleLoader__.load({
|
|
|
4370
4454
|
}
|
|
4371
4455
|
/** 每次打开新建项目现取团队列表:刚组的队、刚改的 team.yml 立刻可选。select 留空表示沿用设置里的默认团队。 */
|
|
4372
4456
|
async function loadTeams(select) {
|
|
4457
|
+
const seq = ++teamLoadSeqRef.current;
|
|
4373
4458
|
setTeamLoadError('');
|
|
4374
4459
|
try {
|
|
4375
4460
|
const response = await fetch('/ai-team/api/teams', { headers: { accept: 'application/json' } });
|
|
4376
4461
|
const body = await response.json().catch(() => null);
|
|
4377
4462
|
if (!response.ok) throw new Error((body && body.error && body.error.message) || ('HTTP ' + response.status));
|
|
4463
|
+
if (seq !== teamLoadSeqRef.current) return;
|
|
4378
4464
|
setTeamList(Array.isArray(body && body.teams) ? body.teams : []);
|
|
4379
|
-
|
|
4465
|
+
const available = Array.isArray(body?.teams) ? body.teams.filter((entry) => !entry.broken) : [];
|
|
4466
|
+
const wanted = select || body?.defaultTeam || 'default';
|
|
4467
|
+
setNTeam(available.some((team) => team.id === wanted) ? wanted : available[0]?.id ?? '');
|
|
4380
4468
|
} catch (error) {
|
|
4469
|
+
if (seq !== teamLoadSeqRef.current) return;
|
|
4381
4470
|
setTeamList([]);
|
|
4382
4471
|
setTeamLoadError(tf(t, 'teamLoadFailed', { error: (error && error.message) || String(error) }));
|
|
4383
4472
|
}
|
|
4384
4473
|
}
|
|
4385
|
-
async function removeTeam(team) {
|
|
4474
|
+
async function removeTeam(team, onError = setNError) {
|
|
4475
|
+
if (team.source !== 'user') return;
|
|
4386
4476
|
if (!(await askConfirm(t('teamDelete'), tf(t, 'teamDeleteConfirm', { name: team.name })))) return;
|
|
4387
4477
|
try {
|
|
4388
4478
|
const response = await fetch('/ai-team/api/teams/delete', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ id: team.id }) });
|
|
@@ -4390,7 +4480,7 @@ window.__ModuleLoader__.load({
|
|
|
4390
4480
|
if (!response.ok) throw new Error((body && body.error && body.error.message) || ('HTTP ' + response.status));
|
|
4391
4481
|
await loadTeams();
|
|
4392
4482
|
} catch (error) {
|
|
4393
|
-
|
|
4483
|
+
onError((error && error.message) || String(error));
|
|
4394
4484
|
}
|
|
4395
4485
|
}
|
|
4396
4486
|
async function createProject() {
|
|
@@ -5251,12 +5341,14 @@ window.__ModuleLoader__.load({
|
|
|
5251
5341
|
|
|
5252
5342
|
const inInbox = scope === 'inbox';
|
|
5253
5343
|
const inPeople = scope === 'people';
|
|
5344
|
+
const inTeam = scope === 'team';
|
|
5345
|
+
const teamProject = project && project.id === projectId && data.project?.id === projectId && !project.archived ? project : null;
|
|
5254
5346
|
const memberViewAgent = data.agents.find((agent) => agent.id === memberViewId) ?? null;
|
|
5255
5347
|
const memberViewTasks = memberViewAgent === null ? [] : tasks.filter((task) => task.ownerId === memberViewAgent.id || task.assigneeId === memberViewAgent.id);
|
|
5256
|
-
const headerTitle = inPeople ? t('peopleTitle') : inInbox ? t('inboxTitle') : project ? '# ' + project.name : t('noProject');
|
|
5348
|
+
const headerTitle = inTeam ? t('teamManagement') : inPeople ? t('peopleTitle') : inInbox ? t('inboxTitle') : project ? '# ' + project.name : t('noProject');
|
|
5257
5349
|
// 只拿到名字的地方(消息、人员池、批量配置)按这张表找成员的头像参数。
|
|
5258
5350
|
rememberAvatars(data?.agents, talents);
|
|
5259
|
-
const headerGoal = inPeople ? t('peopleGoal') : inInbox ? t('inboxGoal') : (project?.goal ?? '');
|
|
5351
|
+
const headerGoal = inTeam ? t('teamManageGoal') : inPeople ? t('peopleGoal') : inInbox ? t('inboxGoal') : (project?.goal ?? '');
|
|
5260
5352
|
const unread = inboxUnread > 99 ? '99+' : inboxUnread;
|
|
5261
5353
|
|
|
5262
5354
|
const leftProps = {
|
|
@@ -5270,6 +5362,7 @@ window.__ModuleLoader__.load({
|
|
|
5270
5362
|
onInbox: switchInbox,
|
|
5271
5363
|
onBoard: switchBoard,
|
|
5272
5364
|
onPeople: openPeople,
|
|
5365
|
+
onTeam: openTeam,
|
|
5273
5366
|
peopleActive: scope === 'people',
|
|
5274
5367
|
onProject: switchProject,
|
|
5275
5368
|
onNewProject: () => { closeMobile(); openNewProject(); },
|
|
@@ -5280,7 +5373,15 @@ window.__ModuleLoader__.load({
|
|
|
5280
5373
|
onRecruit: (agent) => { closeMobile(); recruit(agent); },
|
|
5281
5374
|
};
|
|
5282
5375
|
|
|
5283
|
-
const body =
|
|
5376
|
+
const body = inTeam
|
|
5377
|
+
? h(TeamManagementPage, {
|
|
5378
|
+
t, project: teamProject, projects: data.projects.filter((entry) => !entry.archived), agents: teamProject ? data.agents : [],
|
|
5379
|
+
switching: teamSwitching, onProject: (next) => switchProject(next, 'team'),
|
|
5380
|
+
onAdd: openAddAgent, onAgent: openProfile, onChat: openAgentChat, onRecruit: recruit,
|
|
5381
|
+
teams: teamList?.filter((entry) => !entry.broken) ?? null, selectedTeam, error: teamLoadError, onSelectTeam: setNTeam,
|
|
5382
|
+
onLoad: () => void loadTeams(nTeam), onCompose: openTeamComposer, onDelete: (team) => removeTeam(team, setTeamLoadError),
|
|
5383
|
+
})
|
|
5384
|
+
: inPeople
|
|
5284
5385
|
? h(PeoplePage, {
|
|
5285
5386
|
t,
|
|
5286
5387
|
people: peopleData,
|
|
@@ -5462,7 +5563,7 @@ window.__ModuleLoader__.load({
|
|
|
5462
5563
|
h('details', { className: 'at-mobile', ref: mobileRef },
|
|
5463
5564
|
h('summary', { className: 'at-mobilesummary', 'aria-label': t('menuAria') }, h(Ico, { name: 'menu', size: 14 }), h('span', null, t('menu'))),
|
|
5464
5565
|
h('div', { className: 'at-mobilepop' }, h(LeftPanel, leftProps))),
|
|
5465
|
-
h('span', { className: 'at-topproject', title: headerTitle }, inInbox ? t('inboxTitle') + (unread ? ' · ' + unread : '') : (project?.name ?? ''))),
|
|
5566
|
+
h('span', { className: 'at-topproject', title: headerTitle }, inInbox ? t('inboxTitle') + (unread ? ' · ' + unread : '') : inTeam ? t('teamManagement') : (project?.name ?? ''))),
|
|
5466
5567
|
h(ToastStack, { t, toasts, onClose: (id) => setToasts((prev) => prev.filter((toast) => toast.id !== id)) }),
|
|
5467
5568
|
h('div', { className: cx('at-grid', threadOpen && selectedTask && 'at-withthread') },
|
|
5468
5569
|
h('aside', { className: 'at-left', role: 'region', 'aria-label': t('projectsAria') }, h(LeftPanel, leftProps)),
|
|
@@ -5470,7 +5571,7 @@ window.__ModuleLoader__.load({
|
|
|
5470
5571
|
h('header', { className: 'at-chead' },
|
|
5471
5572
|
h('div', { className: 'at-title', title: headerTitle }, headerTitle),
|
|
5472
5573
|
headerGoal ? h('div', { className: 'at-goal', title: headerGoal }, headerGoal) : null,
|
|
5473
|
-
!inInbox && !inPeople && project ? h('div', { className: 'at-workspacebar' },
|
|
5574
|
+
!inInbox && !inPeople && !inTeam && project ? h('div', { className: 'at-workspacebar' },
|
|
5474
5575
|
h('span', { className: 'at-workspacepath', title: project.workspacePath || t('workspaceHint') },
|
|
5475
5576
|
project.workspacePath ? t('workspace') + ':' + project.workspacePath : t('workspaceUnset')),
|
|
5476
5577
|
h('button', { className: 'at-workspacebtn', type: 'button', onClick: openWorkspaceEditor }, project.workspacePath ? t('workspaceChange') : t('workspaceChoose')),
|
|
@@ -5500,7 +5601,7 @@ window.__ModuleLoader__.load({
|
|
|
5500
5601
|
title: t('archiveHint'),
|
|
5501
5602
|
onClick: () => { void archiveCurrentProject(); },
|
|
5502
5603
|
}, t('archiveProject'))) : null,
|
|
5503
|
-
inInbox || inPeople ? null : h('div', { className: 'at-tabs', role: 'tablist', 'aria-label': t('tabsAria'), onKeyDown: tabKeyDown },
|
|
5604
|
+
inInbox || inPeople || inTeam ? null : h('div', { className: 'at-tabs', role: 'tablist', 'aria-label': t('tabsAria'), onKeyDown: tabKeyDown },
|
|
5504
5605
|
h('button', {
|
|
5505
5606
|
className: cx('at-tab', tab === 'main' && 'at-on'),
|
|
5506
5607
|
type: 'button',
|
|
@@ -5821,7 +5922,7 @@ window.__ModuleLoader__.load({
|
|
|
5821
5922
|
: h('select', { value: nTeam, onChange: (event) => setNTeam(event.target.value) }, teamList.filter((entry) => !entry.broken).map((entry) => h('option', { key: entry.id, value: entry.id }, entry.name + '(' + entry.members.length + ')' + (entry.source === 'user' ? ' · ' + t('talentUser') : ''))))),
|
|
5822
5923
|
teamLoadError ? h('div', { className: 'at-modalerror', role: 'alert' }, teamLoadError) : null,
|
|
5823
5924
|
h('div', { className: 'at-tcpick' },
|
|
5824
|
-
h('button', { className: 'at-btn at-btn-small at-btn-accent', type: 'button', onClick:
|
|
5925
|
+
h('button', { className: 'at-btn at-btn-small at-btn-accent', type: 'button', onClick: openTeamComposer }, withIco('users', t('teamCompose'), 12)),
|
|
5825
5926
|
selectedTeam && selectedTeam.source === 'user' ? h('button', { className: 'at-btn at-btn-small at-btn-danger', type: 'button', onClick: () => void removeTeam(selectedTeam) }, withIco('close', t('teamDelete'), 12)) : null)),
|
|
5826
5927
|
// 右栏:选中团队的成员卡片(名字、岗位、职责、简介、技能;负责人标出来)。
|
|
5827
5928
|
h('div', { className: 'at-pane' },
|
package/cordis.patch.yml
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
# dsh-ai-team bundle patch: mounts the Host half.
|
|
2
|
-
# The Client half is discovered from this package's `dsh.client` declaration.
|
|
3
|
-
# AI Team is a dedicated, trusted profile: members run with full access by
|
|
4
|
-
# design. These patches make that explicit at the profile layer, so a plain
|
|
5
|
-
# web/desktop profile is never affected.
|
|
6
|
-
- insert:
|
|
7
|
-
- id: ai-team
|
|
8
|
-
name: '@suifei/dsh-ai-team'
|
|
9
|
-
|
|
10
|
-
# The Team profile must be danger-full-access end to end. The Host validates
|
|
11
|
-
# this at boot (E_PERMISSION_PROFILE) and refuses to serve a weaker profile.
|
|
12
|
-
- id: sandbox-policy
|
|
13
|
-
config:
|
|
14
|
-
mode: danger-full-access
|
|
15
|
-
workspaceRoot: !!js process.cwd()
|
|
16
|
-
- id: approval
|
|
17
|
-
config:
|
|
18
|
-
policy: never
|
|
19
|
-
- id: permission
|
|
20
|
-
config:
|
|
21
|
-
defaultPreset: danger-full-access
|
|
22
|
-
presets:
|
|
23
|
-
read-only:
|
|
24
|
-
sandbox: read-only
|
|
25
|
-
approval: ask
|
|
26
|
-
workspace-write:
|
|
27
|
-
sandbox: workspace-write
|
|
28
|
-
approval: ask
|
|
29
|
-
danger-full-access:
|
|
30
|
-
sandbox: danger-full-access
|
|
31
|
-
approval: never
|
|
1
|
+
# dsh-ai-team bundle patch: mounts the Host half.
|
|
2
|
+
# The Client half is discovered from this package's `dsh.client` declaration.
|
|
3
|
+
# AI Team is a dedicated, trusted profile: members run with full access by
|
|
4
|
+
# design. These patches make that explicit at the profile layer, so a plain
|
|
5
|
+
# web/desktop profile is never affected.
|
|
6
|
+
- insert:
|
|
7
|
+
- id: ai-team
|
|
8
|
+
name: '@suifei/dsh-ai-team'
|
|
9
|
+
|
|
10
|
+
# The Team profile must be danger-full-access end to end. The Host validates
|
|
11
|
+
# this at boot (E_PERMISSION_PROFILE) and refuses to serve a weaker profile.
|
|
12
|
+
- id: sandbox-policy
|
|
13
|
+
config:
|
|
14
|
+
mode: danger-full-access
|
|
15
|
+
workspaceRoot: !!js process.cwd()
|
|
16
|
+
- id: approval
|
|
17
|
+
config:
|
|
18
|
+
policy: never
|
|
19
|
+
- id: permission
|
|
20
|
+
config:
|
|
21
|
+
defaultPreset: danger-full-access
|
|
22
|
+
presets:
|
|
23
|
+
read-only:
|
|
24
|
+
sandbox: read-only
|
|
25
|
+
approval: ask
|
|
26
|
+
workspace-write:
|
|
27
|
+
sandbox: workspace-write
|
|
28
|
+
approval: ask
|
|
29
|
+
danger-full-access:
|
|
30
|
+
sandbox: danger-full-access
|
|
31
|
+
approval: never
|
package/icon.svg
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" role="img" aria-label="文渊阁">
|
|
2
|
-
<!-- 重檐(上层屋顶) -->
|
|
3
|
-
<path d="M5 8l7-4 7 4" />
|
|
4
|
-
<path d="M7 11h10" />
|
|
5
|
-
<!-- 出檐(下层屋檐) -->
|
|
6
|
-
<path d="M4 14h16" />
|
|
7
|
-
<!-- 立柱(三开间) -->
|
|
8
|
-
<path d="M9 14v3" />
|
|
9
|
-
<path d="M15 14v3" />
|
|
10
|
-
<!-- 渊水(底部波纹) -->
|
|
11
|
-
<path d="M4 20c2.5-1.5 5.5-1.5 8 0s5.5 1.5 8 0" />
|
|
12
|
-
</svg>
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" role="img" aria-label="文渊阁">
|
|
2
|
+
<!-- 重檐(上层屋顶) -->
|
|
3
|
+
<path d="M5 8l7-4 7 4" />
|
|
4
|
+
<path d="M7 11h10" />
|
|
5
|
+
<!-- 出檐(下层屋檐) -->
|
|
6
|
+
<path d="M4 14h16" />
|
|
7
|
+
<!-- 立柱(三开间) -->
|
|
8
|
+
<path d="M9 14v3" />
|
|
9
|
+
<path d="M15 14v3" />
|
|
10
|
+
<!-- 渊水(底部波纹) -->
|
|
11
|
+
<path d="M4 20c2.5-1.5 5.5-1.5 8 0s5.5 1.5 8 0" />
|
|
12
|
+
</svg>
|
package/index.js
CHANGED
|
@@ -67,7 +67,7 @@ import { registerHostSessionGate } from './lib/runtime/host-session-gate.js';
|
|
|
67
67
|
import { createActivationBudget } from './lib/runtime/activation-budget.js';
|
|
68
68
|
import { blocksActivation, probeProviderRegistration } from './lib/runtime/subagent-probe.js';
|
|
69
69
|
import { isRuntimeUnavailableFailure, resolveSubagentProviderName } from './lib/runtime/subagent-provider.js';
|
|
70
|
-
import { aggregatePeople } from './lib/host/people-view.js';
|
|
70
|
+
import { aggregatePeople, peopleProjectIsArchived } from './lib/host/people-view.js';
|
|
71
71
|
import { riskView } from './lib/host/risk-view.js';
|
|
72
72
|
import { weeklyView } from './lib/host/weekly-view.js';
|
|
73
73
|
import { isInformationalThreadMention } from './lib/domain/inbox.js';
|
|
@@ -2738,6 +2738,7 @@ export function apply(ctx, config = {}) {
|
|
|
2738
2738
|
const revived = [];
|
|
2739
2739
|
const skipped = [];
|
|
2740
2740
|
for (const runtime of runtimeEntries) {
|
|
2741
|
+
if (peopleProjectIsArchived(booted.registry.list().find((entry) => entry.id === runtime.id), runtime)) continue;
|
|
2741
2742
|
for (const member of Object.values(runtime.service.state.members ?? {})) {
|
|
2742
2743
|
if (member.kind !== 'agent' || member.status === 'retired') continue;
|
|
2743
2744
|
const eligible = includeAll ? member.status === 'failed' : isRuntimeUnavailableFailure(member);
|
|
@@ -3070,6 +3071,11 @@ export function apply(ctx, config = {}) {
|
|
|
3070
3071
|
if (typeof body?.type !== 'string' || body.type === '') {
|
|
3071
3072
|
return send(res, { error: { code: 'E_INVALID_ARGUMENT', message: 'command type is required' } }, 400);
|
|
3072
3073
|
}
|
|
3074
|
+
// 人员池可能还持有归档前的快照,不允许旧的批量配置修改归档项目。
|
|
3075
|
+
if (body.type === 'member.config.update' &&
|
|
3076
|
+
peopleProjectIsArchived(booted.registry.list().find((entry) => entry.id === runtime.id), runtime)) {
|
|
3077
|
+
return send(res, { error: { code: 'E_INVALID_STATE', message: 'project is archived' } }, 409);
|
|
3078
|
+
}
|
|
3073
3079
|
// 归档保护在实际的全局清单上判定(registry 跨项目;service 只见
|
|
3074
3080
|
// 自己的账本,旧实现在 service 内判定导致所有归档被误拒)。
|
|
3075
3081
|
if (body.type === 'project.archive' && body.payload?.archived !== false) {
|
package/lib/domain/ids.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { randomBytes } from 'node:crypto';
|
|
2
|
-
|
|
3
|
-
const CROCKFORD = '0123456789ABCDEFGHJKMNPQRSTVWXYZ';
|
|
4
|
-
|
|
5
|
-
/** Monotonic-ish ULID-style id: 10 chars time + 12 chars randomness. */
|
|
6
|
-
export function newId(prefix = '') {
|
|
7
|
-
let time = Date.now();
|
|
8
|
-
let out = '';
|
|
9
|
-
for (let i = 0; i < 10; i += 1) {
|
|
10
|
-
out = CROCKFORD[time % 32] + out;
|
|
11
|
-
time = Math.floor(time / 32);
|
|
12
|
-
}
|
|
13
|
-
const bytes = randomBytes(12);
|
|
14
|
-
for (const byte of bytes) out += CROCKFORD[byte % 32];
|
|
15
|
-
return prefix === '' ? out : `${prefix}_${out}`;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export const ids = {
|
|
19
|
-
project: () => newId('prj'),
|
|
20
|
-
member: () => newId('mem'),
|
|
21
|
-
task: () => newId('tsk'),
|
|
22
|
-
event: () => newId('evt'),
|
|
23
|
-
stream: () => newId('str'),
|
|
24
|
-
inbox: () => newId('inb'),
|
|
25
|
-
review: () => newId('rev'),
|
|
26
|
-
};
|
|
1
|
+
import { randomBytes } from 'node:crypto';
|
|
2
|
+
|
|
3
|
+
const CROCKFORD = '0123456789ABCDEFGHJKMNPQRSTVWXYZ';
|
|
4
|
+
|
|
5
|
+
/** Monotonic-ish ULID-style id: 10 chars time + 12 chars randomness. */
|
|
6
|
+
export function newId(prefix = '') {
|
|
7
|
+
let time = Date.now();
|
|
8
|
+
let out = '';
|
|
9
|
+
for (let i = 0; i < 10; i += 1) {
|
|
10
|
+
out = CROCKFORD[time % 32] + out;
|
|
11
|
+
time = Math.floor(time / 32);
|
|
12
|
+
}
|
|
13
|
+
const bytes = randomBytes(12);
|
|
14
|
+
for (const byte of bytes) out += CROCKFORD[byte % 32];
|
|
15
|
+
return prefix === '' ? out : `${prefix}_${out}`;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const ids = {
|
|
19
|
+
project: () => newId('prj'),
|
|
20
|
+
member: () => newId('mem'),
|
|
21
|
+
task: () => newId('tsk'),
|
|
22
|
+
event: () => newId('evt'),
|
|
23
|
+
stream: () => newId('str'),
|
|
24
|
+
inbox: () => newId('inb'),
|
|
25
|
+
review: () => newId('rev'),
|
|
26
|
+
};
|