@sanqianx/project-knowledge 5.1.1 → 5.1.2
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/.claude-plugin/marketplace.json +1 -1
- package/_site/_test/helpers/cdp-browser.js +4 -1
- package/_site/_test/run-all-tests.js +26 -3
- package/_site/lib/engine-connection.js +2 -1
- package/_site/lib/engine-knowledge-client.js +1 -1
- package/module-runtime-manifest.json +12 -11
- package/package.json +2 -2
- package/plugins/project-knowledge/.claude-plugin/plugin.json +1 -1
- package/plugins/project-knowledge/.codex-plugin/plugin.json +1 -1
- package/plugins/project-knowledge/.mcp.json +1 -1
|
@@ -16,7 +16,10 @@ function wait(ms) {
|
|
|
16
16
|
return new Promise(resolve => setTimeout(resolve, ms));
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
// 25s default: the 2026-11 CI runner image is slow enough that dialog opens
|
|
20
|
+
// exceeded 15s while the assertions themselves stayed correct; the budget is
|
|
21
|
+
// a ceiling, not a delay — passing calls return immediately.
|
|
22
|
+
async function waitFor(fn, label, timeoutMs = 25000) {
|
|
20
23
|
const deadline = Date.now() + timeoutMs;
|
|
21
24
|
let lastError;
|
|
22
25
|
while (Date.now() < deadline) {
|
|
@@ -26,9 +26,14 @@ const BACKEND_ONLY = args.includes('--backend-only');
|
|
|
26
26
|
const PER_TEST_TIMEOUT_MS = Number(process.env.PK_TEST_TIMEOUT_MS || 90_000);
|
|
27
27
|
|
|
28
28
|
function listTestFiles() {
|
|
29
|
+
// Optional exclusion list (semicolon-separated filenames) for environments
|
|
30
|
+
// where a specific browser interaction cannot run headless at all — the
|
|
31
|
+
// same files still run in every other lane and on real machines.
|
|
32
|
+
const excluded = new Set(String(process.env.PK_TEST_EXCLUDE || '').split(';').map(s => s.trim()).filter(Boolean));
|
|
29
33
|
return fs.readdirSync(TEST_DIR)
|
|
30
34
|
.filter(file => file.endsWith('-test.js'))
|
|
31
35
|
.filter(file => file !== 'run-all-tests.js')
|
|
36
|
+
.filter(file => !excluded.has(file))
|
|
32
37
|
.filter(file => !BACKEND_ONLY || !fs.readFileSync(path.join(TEST_DIR, file), 'utf8').includes('helpers/cdp-browser'))
|
|
33
38
|
.sort();
|
|
34
39
|
}
|
|
@@ -100,14 +105,32 @@ function runOne(file) {
|
|
|
100
105
|
let totalDuration = 0;
|
|
101
106
|
for (const file of files) {
|
|
102
107
|
process.stdout.write(`> ${file} ... `);
|
|
103
|
-
|
|
108
|
+
let result = runOne(file);
|
|
109
|
+
// One bounded retry for intermittents (headless dialog races, port
|
|
110
|
+
// contention on busy runners): both runs' outcomes are preserved in the
|
|
111
|
+
// record — a pass-on-retry is labeled, and a second failure stays FAIL.
|
|
112
|
+
// Assertions are never weakened; this only re-runs the same file in a
|
|
113
|
+
// fresh sandbox.
|
|
114
|
+
if (!result.passed) {
|
|
115
|
+
const first = { label: result.failureLabel, tail: result.outputTail };
|
|
116
|
+
const retry = runOne(file);
|
|
117
|
+
if (retry.passed) {
|
|
118
|
+
retry.passedOnRetry = true;
|
|
119
|
+
retry.firstFailure = first;
|
|
120
|
+
result = retry;
|
|
121
|
+
} else {
|
|
122
|
+
result.firstFailure = first;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
104
125
|
totalDuration += result.durationMs;
|
|
105
126
|
results.push(result);
|
|
106
127
|
|
|
107
128
|
if (result.passed) {
|
|
108
|
-
console.log(
|
|
129
|
+
console.log(result.passedOnRetry
|
|
130
|
+
? `PASS on retry (${result.durationMs}ms; first run: ${result.firstFailure.label} — recorded, not hidden)`
|
|
131
|
+
: `PASS (${result.durationMs}ms)`);
|
|
109
132
|
} else {
|
|
110
|
-
console.log(`${result.failureLabel}, ${result.durationMs}ms`);
|
|
133
|
+
console.log(`${result.failureLabel}, ${result.durationMs}ms${result.firstFailure ? ` (also failed on retry; first: ${result.firstFailure.label})` : ''}`);
|
|
111
134
|
if (result.outputTail) {
|
|
112
135
|
console.log('--- tail ---');
|
|
113
136
|
console.log(result.outputTail);
|
|
@@ -23,7 +23,8 @@ async function connectEngineOnce(runtime) {
|
|
|
23
23
|
httpStatus = health.status;
|
|
24
24
|
if (!health.ok) throw new Error('ENGINE_UNAVAILABLE');
|
|
25
25
|
const engine = await health.json();
|
|
26
|
-
|
|
26
|
+
// Schema 4 (0.2.x) and 5 (0.3.x, agent-member plane) are both supported by this shell; anything else is a genuine mismatch. Hardcoding ===4 used to mislabel engine 0.3.x as 'legacy'.
|
|
27
|
+
if (engine.name !== 'knowledge-engine' || ![4, 5].includes(engine.dataSchemaVersion)) throw new Error('ENGINE_VERSION_MISMATCH');
|
|
27
28
|
step = 'runtime-authentication';
|
|
28
29
|
const auth = await bridge._fetch(`${bridge.engineUrl}/api/runtime-auth`, { headers });
|
|
29
30
|
httpStatus = auth.status;
|
|
@@ -48,7 +48,7 @@ class EngineKnowledgeClient {
|
|
|
48
48
|
const health = await this.json(new URL('/api/health', url));
|
|
49
49
|
const registered = await this.json(new URL('/api/projects', url));
|
|
50
50
|
const match = registered.projects?.find(item => item.projectId === project.projectId && item.enabled !== false);
|
|
51
|
-
if (health.name !== 'knowledge-engine' || health.dataSchemaVersion
|
|
51
|
+
if (health.name !== 'knowledge-engine' || ![4, 5].includes(health.dataSchemaVersion) || !match || !this.layout.pathsEqual(match.repoPath, project.repoPath) || !this.layout.pathsEqual(match.knowledgePath, project.knowledgePath)) throw new DomainError('ENGINE_IDENTITY_MISMATCH', '知识引擎与当前项目目录绑定不匹配。', { status: 409 });
|
|
52
52
|
return { url, prefix: '/api' };
|
|
53
53
|
}
|
|
54
54
|
const live = endpoint.readLiveEndpoint(this.layout.getDataDir(), { removeStale: false });
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
"plugins/project-knowledge/hooks/codex.json": "216e03c07295606ef6ebb2c4f669ad0d790b5e7c4f3f34600488033db75e4239",
|
|
12
12
|
"plugins/project-knowledge/scripts/context-hook.cjs": "ddc1f6f5638c662adbbf4391557bbeb7196af2fb869e7ecfeefba76b9bab5760",
|
|
13
13
|
"plugins/project-knowledge/scripts/mcp-launcher.cjs": "7c68830b5c73eb53ef030756a4de33987f7eab6b1a6cc15602835aac3f954893",
|
|
14
|
-
"plugins/project-knowledge/.claude-plugin/plugin.json": "
|
|
15
|
-
"plugins/project-knowledge/.codex-plugin/plugin.json": "
|
|
16
|
-
"plugins/project-knowledge/.mcp.json": "
|
|
14
|
+
"plugins/project-knowledge/.claude-plugin/plugin.json": "7abe8bd2d8c7be08b628c3ae9ab48d8f29c8ac7327187c2d7cacb1f5d0df0903",
|
|
15
|
+
"plugins/project-knowledge/.codex-plugin/plugin.json": "bf858e15086448d3adb321c69a071915de3914c80be76d70fc2d3310946b5bd8",
|
|
16
|
+
"plugins/project-knowledge/.mcp.json": "134b46cc27c28edbc3e6f436e0d32f39f7e48b3c35e79a6ab13e06f76629134d",
|
|
17
17
|
"ui/version-info.js": "01a82217b031de54b80d6c7974da9c70888c4c90a046bd4248a808f7989ddce7",
|
|
18
18
|
"ui/version-info.css": "209fad8e42b661f72d2aba3280e1ca47768b5cefb776fe5459538d34fbad120f"
|
|
19
19
|
},
|
|
@@ -267,19 +267,19 @@
|
|
|
267
267
|
"engine": {
|
|
268
268
|
"name": "@sanqianx/ai-coding-knowledge-engine",
|
|
269
269
|
"installName": "@sanqianx/ai-coding-knowledge-engine",
|
|
270
|
-
"version": "0.
|
|
270
|
+
"version": "0.3.1",
|
|
271
271
|
"files": {
|
|
272
272
|
"LICENSE": "c1b9df1275e769f3dbab000d1e457a2d4b0f28eb5da6c77e48dc37eeba202ed7",
|
|
273
273
|
"README.md": "4d99cf4b19a4b07533dc86bb63015255364016fad76c1306bea69db0a9ff8743",
|
|
274
|
-
"package.json": "
|
|
274
|
+
"package.json": "5d08d41a8769b1046f1cce1e4274436c5536e361e824520db79a17456179e547",
|
|
275
275
|
"src/analysis-contract.js": "6d4b9fde0e05d9a80d43e96d0c27febf082ecdb19312faf0280d6c9b16ac71b1",
|
|
276
276
|
"src/analysis-failures.js": "eb1e5a476b1e3e3c87dfd9955707c85151707799883595bcb5e9cc3e26a991c4",
|
|
277
277
|
"src/analysis-output.js": "95a3c19dcc9ab85d1dba7fee5b9aec80f9c000dfba89da3fd0be25a81e2fb680",
|
|
278
278
|
"src/analysis-worker.js": "a0bae40784c690ac68a174cb6d98fbb21dbdb69becfd27eee316ba17de544de9",
|
|
279
279
|
"src/bin.js": "22208907431d0f3a971a669c7e5eb44b3b7af9bbb36fd7ba17c3b90c4288bd70",
|
|
280
280
|
"src/bridge-client.js": "ae0dba21e4286694bcd9e064ca36564ec997969ae1eb1ce4f8a6665e447cbffe",
|
|
281
|
-
"src/context.js": "
|
|
282
|
-
"src/coordinator.js": "
|
|
281
|
+
"src/context.js": "a868037b212c20eeb126648956665ace57f7272271000a827fa089804ad5ee32",
|
|
282
|
+
"src/coordinator.js": "1f13351ca51bdab41d941a256583091fd35948988c925328ec3607f2a307a037",
|
|
283
283
|
"src/diagnostics.js": "f7b516ace61a1e9faaa6876930b9e2e258499a25857d1203f4e53d28bfd0fa1a",
|
|
284
284
|
"src/headless-analyzer.js": "df570864136981cf98f3f69d047fa5729fbbfdeeaee0c6bfad26dab941dbbdae",
|
|
285
285
|
"src/index-request.js": "78f26b872299005499fff4f2d1f9e8f986784f2ff36a5cf2be2b1e7b7c7d9378",
|
|
@@ -300,20 +300,21 @@
|
|
|
300
300
|
"src/runtime/conversation-exclusions.js": "ef8545034b862d384fb460140490bb531b58d94992f5e2222ebaaa079b44fa63",
|
|
301
301
|
"src/runtime/conversation-store.js": "4c91f16cef516556e381ee4369d67165b00833214b7675012340cbc1637ec8d7",
|
|
302
302
|
"src/runtime/evidence-bundle.js": "d8e74774c2860a869f62e8adbe54d1c80818ea3da09436eff94037536ba559bf",
|
|
303
|
-
"src/runtime/git-runner.js": "
|
|
303
|
+
"src/runtime/git-runner.js": "49df732dcdcea3011f44448476ed1945ee13f4fe8ded2428c48bc17c44ee21e3",
|
|
304
304
|
"src/runtime/knowledge-promotion.js": "c1d29e8eca3708f8841f1a697e8bb51ed7a977f4fea649b8ae98be2d7195c06e",
|
|
305
305
|
"src/runtime/knowledge-retrieval-service.js": "a4dcd09d34185f196814ff37821666e43ed0839126eab63b234bd53c4513ef1a",
|
|
306
306
|
"src/runtime/layout.js": "e47fe54c605218493ce46f6289798d9db2a3ecec95089d288ed03d3b75cf871a",
|
|
307
307
|
"src/runtime/markdown-knowledge-indexer.js": "adbb6057f1acce1041c72803b97511f01deb0c108d9350afe567dec364ac717f",
|
|
308
308
|
"src/runtime/README.md": "9be676eca76a7857b34d7357194e6f0ee733c22e61d962d53984715dbec7f673",
|
|
309
309
|
"src/runtime/scanner.js": "2b5443a1b782b4b73458de907a06a34e6bb6bfa9ba45d20c443ef8272ada97e6",
|
|
310
|
-
"src/server.js": "
|
|
311
|
-
"src/store.js": "
|
|
310
|
+
"src/server.js": "626cb8741fa3f2c725a2fe364f5c9fd80d93db9a7090cf3368e24ed1681a7354",
|
|
311
|
+
"src/store.js": "82519965dfc4b7ec11b7f098e57a86a22c0e4420beb1b305d6fa7fbc7936c42c",
|
|
312
312
|
"ui/app.css": "7ad370c269e60a7b5ec907d81a607b2d16bd07b2d7c22a81f102dab51eeb2889",
|
|
313
313
|
"ui/app.js": "e9ecb0125d5f2a8bb30a58c4d278fe0737ee2540ecfb065f97f453495cfc792d",
|
|
314
314
|
"ui/index.html": "ce3565cfefd4838b11d37a91a906ef26ca5a1834844fe3f7c897b56851a3c418",
|
|
315
315
|
"src/memory-groups.js": "92b5edbd0ec7c9a3cf505d4683a053ea71d7ceeb7cfbe049bc65342a39c0c8f2",
|
|
316
|
-
"src/retry-scheduler.js": "048c11b767617e0c621c231e91029b4e5e834ae3e7ebc3c84b5168ea9f92ec57"
|
|
316
|
+
"src/retry-scheduler.js": "048c11b767617e0c621c231e91029b4e5e834ae3e7ebc3c84b5168ea9f92ec57",
|
|
317
|
+
"src/agent-members.js": "fee015e907d974b9e147e2dbd05d2b2ef9c243bd3eb9226bb68a19c190c2213a"
|
|
317
318
|
}
|
|
318
319
|
},
|
|
319
320
|
"workflow": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanqianx/project-knowledge",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.2",
|
|
4
4
|
"description": "Knowledge base manager with Git integration, AI-driven analysis, and bilingual (zh-CN/en-US) knowledge output",
|
|
5
5
|
"main": "_site/server.js",
|
|
6
6
|
"scripts": {
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"@lancedb/lancedb": "0.31.0",
|
|
88
88
|
"@modelcontextprotocol/sdk": "1.29.0",
|
|
89
89
|
"@sanqianx/ai-coding-event-bridge-console": "0.7.4",
|
|
90
|
-
"@sanqianx/ai-coding-knowledge-engine": "0.
|
|
90
|
+
"@sanqianx/ai-coding-knowledge-engine": "0.3.1",
|
|
91
91
|
"@sanqianx/ai-coding-workflow": "0.1.1",
|
|
92
92
|
"@sanqianx/vector-hub": "1.0.8-rc.8",
|
|
93
93
|
"buffer": "^6.0.3",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://json.schemastore.org/claude-code-plugin-manifest.json",
|
|
3
3
|
"name": "project-knowledge",
|
|
4
4
|
"hooks": "./hooks/claude.json",
|
|
5
|
-
"version": "5.1.
|
|
5
|
+
"version": "5.1.2",
|
|
6
6
|
"description": "Read durable project decisions and implementation history from Project Knowledge.",
|
|
7
7
|
"author": {
|
|
8
8
|
"name": "SanQianX",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"const fs=require('fs'),path=require('path'),os=require('os');const PKG='@sanqianx/project-knowledge',SC='project-knowledge/integration-runtime/v1';let f='';const root=process.env.CLAUDE_PLUGIN_ROOT||process.env.PLUGIN_ROOT;if(root){f=path.join(root,'scripts','mcp-launcher.cjs');if(!fs.existsSync(f))f=''}if(!f){const dd=process.env.KB_DATA_DIR||path.join(os.homedir(),'.project-knowledge-v5');try{const bp=path.join(dd,'integration-runtime.json');const st=fs.statSync(bp);if(st.isFile()&&st.size<=32768){const b=JSON.parse(fs.readFileSync(bp,'utf8'));if(b&&b.schema===SC&&b.packageName===PKG&&typeof b.packageRoot==='string'&&path.isAbsolute(b.packageRoot)){const c=path.join(b.packageRoot,'plugins','project-knowledge','scripts','mcp-launcher.cjs');const rr=fs.realpathSync(b.packageRoot),cr=fs.realpathSync(c);const rel=path.relative(rr,cr);if(rel&&rel!=='..'&&!rel.startsWith('..'+path.sep)&&!path.isAbsolute(rel)&&fs.statSync(cr).isFile())f=cr}}}catch(e){}}if(!f){console.error('[project-knowledge-mcp] 未能通过受信任插件根或已验证的安装绑定定位启动器,已停止;不访问网络,也不加载工作目录源码。');process.exit(127)}require(f);"
|
|
9
9
|
],
|
|
10
10
|
"env": {
|
|
11
|
-
"KB_PLUGIN_VERSION": "5.1.
|
|
11
|
+
"KB_PLUGIN_VERSION": "5.1.2"
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
}
|