mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-12 03:00:50 +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
97
openclaw/scripts/run-oxlint.mjs
Normal file
97
openclaw/scripts/run-oxlint.mjs
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
import { spawnSync } from "node:child_process";
|
||||
import path from "node:path";
|
||||
import {
|
||||
acquireLocalHeavyCheckLockSync,
|
||||
applyLocalOxlintPolicy,
|
||||
shouldAcquireLocalHeavyCheckLockForOxlint,
|
||||
} from "./lib/local-heavy-check-runtime.mjs";
|
||||
|
||||
const oxlintPath = path.resolve("node_modules", ".bin", "oxlint");
|
||||
const PREPARE_EXTENSION_BOUNDARY_ARGS = [
|
||||
path.resolve("scripts", "prepare-extension-package-boundary-artifacts.mjs"),
|
||||
];
|
||||
const OXLINT_PREPARE_SKIP_FLAGS = new Set([
|
||||
"--help",
|
||||
"-h",
|
||||
"--version",
|
||||
"-V",
|
||||
"--print-config",
|
||||
"--rules",
|
||||
"--init",
|
||||
"--lsp",
|
||||
]);
|
||||
export function shouldPrepareExtensionPackageBoundaryArtifacts(args) {
|
||||
return !args.some((arg) => OXLINT_PREPARE_SKIP_FLAGS.has(arg));
|
||||
}
|
||||
|
||||
function prepareExtensionPackageBoundaryArtifacts(env) {
|
||||
const releaseArtifactsLock = acquireLocalHeavyCheckLockSync({
|
||||
cwd: process.cwd(),
|
||||
env,
|
||||
toolName: "extension-package-boundary-artifacts",
|
||||
lockName: "extension-package-boundary-artifacts",
|
||||
});
|
||||
|
||||
try {
|
||||
const result = spawnSync(process.execPath, PREPARE_EXTENSION_BOUNDARY_ARGS, {
|
||||
stdio: "inherit",
|
||||
env,
|
||||
});
|
||||
|
||||
if (result.error) {
|
||||
throw result.error;
|
||||
}
|
||||
|
||||
if ((result.status ?? 1) !== 0) {
|
||||
throw new Error(
|
||||
`prepare-extension-package-boundary-artifacts failed with exit code ${result.status ?? 1}`,
|
||||
);
|
||||
}
|
||||
} finally {
|
||||
releaseArtifactsLock();
|
||||
}
|
||||
}
|
||||
|
||||
export function main(argv = process.argv.slice(2), runtimeEnv = process.env) {
|
||||
const { args: finalArgs, env } = applyLocalOxlintPolicy(argv, runtimeEnv);
|
||||
const releaseLock =
|
||||
env.OPENCLAW_OXLINT_SKIP_LOCK === "1"
|
||||
? () => {}
|
||||
: shouldAcquireLocalHeavyCheckLockForOxlint(finalArgs, {
|
||||
cwd: process.cwd(),
|
||||
env,
|
||||
})
|
||||
? acquireLocalHeavyCheckLockSync({
|
||||
cwd: process.cwd(),
|
||||
env,
|
||||
toolName: "oxlint",
|
||||
})
|
||||
: () => {};
|
||||
|
||||
try {
|
||||
if (
|
||||
env.OPENCLAW_OXLINT_SKIP_PREPARE !== "1" &&
|
||||
shouldPrepareExtensionPackageBoundaryArtifacts(finalArgs)
|
||||
) {
|
||||
prepareExtensionPackageBoundaryArtifacts(env);
|
||||
}
|
||||
|
||||
const result = spawnSync(oxlintPath, finalArgs, {
|
||||
stdio: "inherit",
|
||||
env,
|
||||
shell: process.platform === "win32",
|
||||
});
|
||||
|
||||
if (result.error) {
|
||||
throw result.error;
|
||||
}
|
||||
|
||||
process.exitCode = result.status ?? 1;
|
||||
} finally {
|
||||
releaseLock();
|
||||
}
|
||||
}
|
||||
|
||||
if (import.meta.main) {
|
||||
main();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue