@suifei/dsh-ai-team 0.4.70 → 0.4.72
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 +27 -0
- package/index.js +5 -0
- package/lib/host/project-registry.js +6 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.72 - 2026-11-12
|
|
4
|
+
|
|
5
|
+
**`bootstrap?project=<未知 id>` 必须 404,不能静默回退到活动项目**
|
|
6
|
+
|
|
7
|
+
清理归档项目 `prj_main` 后实测发现:`GET /bootstrap?project=prj_main` 返回 200,内容是
|
|
8
|
+
**另一个项目**的数据——路由把「请求的项目没找到」当成「没指定项目」处理。删掉项目后,
|
|
9
|
+
指向它的旧链接/书签会悄悄显示成别的项目,用户无从察觉。
|
|
10
|
+
|
|
11
|
+
- 显式传入且找不到对应 runtime 时返回 `404 NOT_FOUND`(`project <id> not found`);
|
|
12
|
+
- 不带 `project` 参数的隐式请求行为不变(用当前/第一个项目);
|
|
13
|
+
- 测试:`node --test` **273 通过 / 1 跳过**(management 用例新增 HTTP 断言:未知 id → 404
|
|
14
|
+
且 `error.code = NOT_FOUND`)。
|
|
15
|
+
|
|
16
|
+
## 0.4.71 - 2026-11-12
|
|
17
|
+
|
|
18
|
+
**删掉的默认项目不再被静默复活**
|
|
19
|
+
|
|
20
|
+
实测:把 `prj_main` 从 `projects.json` 移除并重启插件后,它又回来了——`ProjectRegistry.load`
|
|
21
|
+
原先「只要列表里缺少 `prj_main` 就 unshift 一条」。于是用户永远删不掉这个默认项目。
|
|
22
|
+
|
|
23
|
+
- 默认项目**只在一个项目都没有时**播种(初装第一入口);已有其它项目时不再凭空补一条;
|
|
24
|
+
- `activeProjectId` 缺失时回退到**第一个真实项目**,而不是硬编码 `prj_main`;
|
|
25
|
+
- 测试:`node --test` **273 通过 / 1 跳过**(新增 1 例:删除后保持删除;空列表才播种默认项目)。
|
|
26
|
+
|
|
27
|
+
附带说明:这一条是为了配合「彻底清掉归档项目 `prj_main`」——在此之前任何删除都会被下一次
|
|
28
|
+
boot 覆盖。
|
|
29
|
+
|
|
3
30
|
## 0.4.70 - 2026-11-12
|
|
4
31
|
|
|
5
32
|
**唤醒失败归类抽成单一实现 + 归档项目不再刷 attach 告警**
|
package/index.js
CHANGED
|
@@ -2122,6 +2122,11 @@ export function apply(ctx, config = {}) {
|
|
|
2122
2122
|
const requestedRuntime = requested === null ? null : projectRuntime(requested);
|
|
2123
2123
|
// 账本里真实存在的项目(registry 的 active 可能与正在服务的账本脱钩)。
|
|
2124
2124
|
const servedProjects = (runtime) => Object.keys(runtime?.service?.state?.projects ?? {});
|
|
2125
|
+
// 显式指定了不存在的项目:必须 404,不能静默回退到活动项目——
|
|
2126
|
+
// 否则删掉项目后,指向它的旧链接/书签会悄悄显示另一个项目的数据。
|
|
2127
|
+
if (requested !== null && requestedRuntime === null) {
|
|
2128
|
+
return send(res, { error: { code: 'NOT_FOUND', message: `project ${requested} not found` } }, 404);
|
|
2129
|
+
}
|
|
2125
2130
|
let bootstrapRuntime = requestedRuntime ?? currentRuntime();
|
|
2126
2131
|
if (requested === null && servedProjects(bootstrapRuntime).length === 0 && servedProjects(booted?.runtime).length > 0) {
|
|
2127
2132
|
bootstrapRuntime = booted.runtime;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/** Lightweight Project index. The ledger remains the source of truth for Project state. */
|
|
2
2
|
import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from 'node:fs';
|
|
3
3
|
import { join } from 'node:path';
|
|
4
4
|
import { DEFAULT_PROJECT_ID } from './project-runtime.js';
|
|
@@ -28,15 +28,15 @@ export class ProjectRegistry {
|
|
|
28
28
|
reportFail('registry.corrupt.fail', { kept }, `[ai-team] projects.json was unreadable (${error?.message ?? error}); kept as ${kept}`);
|
|
29
29
|
parsed = null;
|
|
30
30
|
}
|
|
31
|
+
// 默认项目只在**一个项目都没有**时播种(初装的第一入口)。此前只要列表里
|
|
32
|
+
// 缺少 `prj_main` 就补一条:用户把它删掉后会被静默复活,等于删不掉。
|
|
31
33
|
const projects = Array.isArray(parsed?.projects) && parsed.projects.length > 0
|
|
32
34
|
? parsed.projects.filter((project) => typeof project?.id === 'string' && project.id !== '')
|
|
33
|
-
: [
|
|
34
|
-
if (
|
|
35
|
-
projects.unshift({ id: DEFAULT_PROJECT_ID, name: '我的项目', createdAt: 0 });
|
|
36
|
-
}
|
|
35
|
+
: [];
|
|
36
|
+
if (projects.length === 0) projects.push({ id: DEFAULT_PROJECT_ID, name: '我的项目', createdAt: 0 });
|
|
37
37
|
const active = projects.some((project) => project.id === parsed?.activeProjectId)
|
|
38
38
|
? parsed.activeProjectId
|
|
39
|
-
:
|
|
39
|
+
: projects[0].id;
|
|
40
40
|
const registry = new ProjectRegistry({ rootDir, projects, activeProjectId: active });
|
|
41
41
|
if (!existsSync(file)) registry.save();
|
|
42
42
|
return registry;
|
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.72",
|
|
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",
|