mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-15 23: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
71
openclaw/test/helpers/browser-bundled-plugin-fixture.ts
Normal file
71
openclaw/test/helpers/browser-bundled-plugin-fixture.ts
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
import fs from "node:fs";
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
|
||||
const BROWSER_FIXTURE_MANIFEST = {
|
||||
id: "browser",
|
||||
enabledByDefault: true,
|
||||
configSchema: {
|
||||
type: "object",
|
||||
additionalProperties: false,
|
||||
properties: {},
|
||||
},
|
||||
};
|
||||
|
||||
const BROWSER_FIXTURE_ENTRY = `module.exports = {
|
||||
id: "browser",
|
||||
name: "Browser",
|
||||
description: "Bundled browser fixture plugin",
|
||||
configSchema: {
|
||||
type: "object",
|
||||
additionalProperties: false,
|
||||
properties: {},
|
||||
},
|
||||
register(api) {
|
||||
api.registerTool((ctx) => ({
|
||||
name: "browser",
|
||||
label: "browser",
|
||||
description: "browser fixture tool",
|
||||
parameters: {
|
||||
type: "object",
|
||||
properties: {},
|
||||
},
|
||||
async execute() {
|
||||
return {
|
||||
content: [{ type: "text", text: "ok" }],
|
||||
details: {
|
||||
workspaceOnly: ctx.fsPolicy?.workspaceOnly ?? null,
|
||||
},
|
||||
};
|
||||
},
|
||||
}));
|
||||
api.registerCli(({ program }) => {
|
||||
program.command("browser");
|
||||
}, { commands: ["browser"] });
|
||||
api.registerGatewayMethod("browser.request", async () => ({ ok: true }), {
|
||||
scope: "operator.write",
|
||||
});
|
||||
api.registerService({
|
||||
id: "browser-control",
|
||||
start() {},
|
||||
});
|
||||
},
|
||||
};`;
|
||||
|
||||
export function createBundledBrowserPluginFixture(): { rootDir: string; cleanup: () => void } {
|
||||
const rootDir = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-browser-bundled-"));
|
||||
const pluginDir = path.join(rootDir, "browser");
|
||||
fs.mkdirSync(pluginDir, { recursive: true });
|
||||
fs.writeFileSync(
|
||||
path.join(pluginDir, "openclaw.plugin.json"),
|
||||
JSON.stringify(BROWSER_FIXTURE_MANIFEST, null, 2),
|
||||
"utf8",
|
||||
);
|
||||
fs.writeFileSync(path.join(pluginDir, "index.js"), BROWSER_FIXTURE_ENTRY, "utf8");
|
||||
return {
|
||||
rootDir,
|
||||
cleanup() {
|
||||
fs.rmSync(rootDir, { recursive: true, force: true });
|
||||
},
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue