Files
openclaw/extensions/workboard/index.ts
Peter Steinberger 0ecbbe2382 fix(workboard): keep dispatch inside caller workspace authority (#107087)
* fix(workboard): inherit caller workspace authority

* docs(plugin-sdk): refresh API baseline

* fix(workboard): pin restricted worker authority

* fix(workboard): avoid host git for restricted dispatch

* refactor(worktrees): extract owner matching

* refactor(workboard): reuse sdk workspace helpers

* fix(workboard): narrow cleanup owner

* refactor(workboard): clarify claim value handling

* fix(workboard): inherit caller workspace authority

* test(worktrees): use managed temp directories

* chore: keep release notes in PR body

* fix(workboard): keep internal authority helpers private
2026-07-13 21:36:26 -07:00

59 lines
1.8 KiB
TypeScript

// Workboard plugin entrypoint registers its OpenClaw integration.
import { definePluginEntry } from "./api.js";
import { registerWorkboardGatewayMethods } from "./runtime-api.js";
import { registerWorkboardCommand } from "./src/command.js";
import { cleanupWorkboardRunWorktree } from "./src/dispatcher-workspace.js";
import { WorkboardStore } from "./src/store.js";
import { createWorkboardTools } from "./src/tools.js";
import {
guardWorkboardToolsForWorkspaceAccess,
WORKBOARD_TOOL_NAMES,
} from "./src/workspace-access.js";
export default definePluginEntry({
id: "workboard",
name: "Workboard",
description: "Dashboard workboard for agent-owned issues and sessions.",
register(api) {
const store = WorkboardStore.openSqlite();
registerWorkboardGatewayMethods({ api, store });
registerWorkboardCommand({ api, store });
api.on("subagent_ended", async (event) => {
if (event.runId) {
await cleanupWorkboardRunWorktree({
store,
worktrees: api.runtime.worktrees,
runId: event.runId,
});
}
});
api.registerCli(
async ({ program }) => {
const { registerWorkboardCli } = await import("./src/cli.js");
registerWorkboardCli({ program, store });
},
{
descriptors: [
{
name: "workboard",
description: "Manage Workboard cards and worker dispatch",
hasSubcommands: true,
},
],
},
);
api.registerTool(
(context) =>
guardWorkboardToolsForWorkspaceAccess(
createWorkboardTools({ api, context, store }),
context,
api.runtime.sandbox.resolveWorkspaceAuthority,
),
{
names: [...WORKBOARD_TOOL_NAMES],
optional: true,
},
);
},
});