mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-12 21:20:49 +08:00
重构主控编排与运行时预热链路,统一工作区提示词/专家调度协议并补齐 wiki 记忆注入与写回闭环。
同时收敛启动与运维脚本默认行为(含 wiki worker)、更新 Admin 可观测性与相关测试,降低首轮时延并提高运行稳定性。 Made-with: Cursor
This commit is contained in:
parent
4a23b715a2
commit
dbbe3add6a
14438 changed files with 2693620 additions and 2546 deletions
59
openclaw/scripts/check-tsgo-core-boundary.mjs
Normal file
59
openclaw/scripts/check-tsgo-core-boundary.mjs
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
import { spawnSync } from "node:child_process";
|
||||
import path from "node:path";
|
||||
|
||||
const repoRoot = path.resolve(import.meta.dirname, "..");
|
||||
const tsgoPath = path.join(repoRoot, "node_modules", ".bin", "tsgo");
|
||||
|
||||
const coreGraphs = [
|
||||
{ name: "core", config: "tsconfig.core.json" },
|
||||
{ name: "core-test", config: "tsconfig.core.test.json" },
|
||||
{ name: "core-test-agents", config: "tsconfig.core.test.agents.json" },
|
||||
{ name: "core-test-non-agents", config: "tsconfig.core.test.non-agents.json" },
|
||||
];
|
||||
|
||||
function normalizeFilePath(filePath) {
|
||||
const normalized = filePath.trim().replaceAll("\\", "/");
|
||||
const normalizedRoot = repoRoot.replaceAll("\\", "/");
|
||||
if (normalized.startsWith(`${normalizedRoot}/`)) {
|
||||
return normalized.slice(normalizedRoot.length + 1);
|
||||
}
|
||||
return normalized;
|
||||
}
|
||||
|
||||
function listGraphFiles(graph) {
|
||||
const result = spawnSync(tsgoPath, ["-p", graph.config, "--pretty", "false", "--listFilesOnly"], {
|
||||
cwd: repoRoot,
|
||||
encoding: "utf8",
|
||||
maxBuffer: 256 * 1024 * 1024,
|
||||
shell: process.platform === "win32",
|
||||
});
|
||||
if (result.error) {
|
||||
throw result.error;
|
||||
}
|
||||
if ((result.status ?? 1) !== 0) {
|
||||
const output = [result.stdout, result.stderr].filter(Boolean).join("\n");
|
||||
throw new Error(`${graph.name} file listing failed with exit code ${result.status}\n${output}`);
|
||||
}
|
||||
return (result.stdout ?? "").split(/\r?\n/u).map(normalizeFilePath).filter(Boolean);
|
||||
}
|
||||
|
||||
const violations = [];
|
||||
for (const graph of coreGraphs) {
|
||||
const extensionFiles = listGraphFiles(graph).filter((file) => file.startsWith("extensions/"));
|
||||
for (const file of extensionFiles) {
|
||||
violations.push(`${graph.name}: ${file}`);
|
||||
}
|
||||
}
|
||||
|
||||
if (violations.length > 0) {
|
||||
console.error("Core tsgo graphs must not include bundled extension files:");
|
||||
for (const violation of violations) {
|
||||
console.error(`- ${violation}`);
|
||||
}
|
||||
console.error(
|
||||
"Move extension-owned behavior behind plugin SDK contracts, public artifacts, or extension-local tests.",
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue