- Migrate src/ → plugin/ (plugin/core/, plugin/web/, plugin/commands/)
and src/mcp/ → services/ per OpenClaw plugin dev spec
- Add Gemini CLI backend (plugin/core/gemini/sdk-adapter.ts) with GEMINI.md
system-prompt injection
- Inject bootstrap as stateless system prompt on every turn instead of
first turn only: Claude via --system-prompt, Gemini via workspace/GEMINI.md;
eliminates isFirstTurn branch, keeps skills in sync with OpenClaw snapshots
- Fix session-map-store defensive parsing (sessions ?? []) to handle bare {}
reset files without crashing on .find()
- Add docs/TEST_FLOW.md with E2E test scenarios and expected outcomes
- Add docs/claude/BRIDGE_MODEL_FINDINGS.md with contractor-probe results
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
51 lines
1.8 KiB
TypeScript
51 lines
1.8 KiB
TypeScript
import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
|
|
import { runContractorAgentsAdd } from "./contractor-agents-add.js";
|
|
|
|
export function registerCli(api: OpenClawPluginApi): void {
|
|
api.registerCli(
|
|
(ctx) => {
|
|
// Use ctx.program.command() directly — do NOT import Commander separately.
|
|
// Importing a different Commander version causes _prepareForParse failures.
|
|
const contractorAgents = ctx.program.command("contractor-agents")
|
|
.description("Manage Claude-backed contractor agents");
|
|
|
|
contractorAgents
|
|
.command("add")
|
|
.description("Provision a new Claude-backed contractor agent")
|
|
.requiredOption("--agent-id <id>", "Agent id")
|
|
.requiredOption("--workspace <path>", "Workspace directory")
|
|
.requiredOption("--contractor <kind>", "Contractor kind (claude)")
|
|
.action(async (opts: { agentId: string; workspace: string; contractor: string }) => {
|
|
try {
|
|
await runContractorAgentsAdd({
|
|
agentId: opts.agentId,
|
|
workspace: opts.workspace,
|
|
contractor: opts.contractor,
|
|
});
|
|
} catch (err) {
|
|
console.error(`[contractor-agents add] Error: ${String(err)}`);
|
|
process.exitCode = 1;
|
|
}
|
|
});
|
|
|
|
contractorAgents
|
|
.command("status")
|
|
.description("Show status of a contractor agent (not yet implemented)")
|
|
.requiredOption("--agent-id <id>", "Agent id")
|
|
.action(() => {
|
|
console.log("[contractor-agents status] not yet implemented");
|
|
});
|
|
},
|
|
{
|
|
commands: ["contractor-agents"],
|
|
descriptors: [
|
|
{
|
|
name: "contractor-agents",
|
|
description: "Manage Claude-backed contractor agents",
|
|
hasSubcommands: true,
|
|
},
|
|
],
|
|
},
|
|
);
|
|
}
|