Bridge between OpenClaw (multi-channel hub) and interactive Claude Code, keeping autonomous agent usage on the subscription quota after the 2026-06-15 Agent SDK credit split. Initial scaffolding only — two submodules with skeletons: - SynthesisAgent.ClaudePlugin: stdio MCP server registered as a --channels source. Declares experimental.claude/channel capability (verified 2026-05-14 against the official Anthropic discord plugin) and emits notifications/claude/channel to push OpenClaw inbound messages into the Claude turn loop. - SynthesisAgent.OpenclawPlugin: process manager + session mapping + bridge WebSocket. Currently shaped around a custom ws protocol; will be rewritten as a model-provider HTTP server (contractor-agent pattern) so OpenClaw routes inbound channel messages through it via /v1/chat/completions. See STATUS.md for the open punch list and docs/wire-protocol.md for the (soon-to-change) inter-plugin frame schema.
38 lines
1.5 KiB
TypeScript
38 lines
1.5 KiB
TypeScript
import type { OpenClawPluginApi } from 'openclaw/plugin-sdk/core'
|
|
import type { ProcessManager } from './process-manager.js'
|
|
import type { SessionMapping } from './session-mapping.js'
|
|
import type { SynthesisConfig } from './config.js'
|
|
|
|
interface CliDeps {
|
|
processManager: ProcessManager
|
|
mapping: SessionMapping
|
|
config: SynthesisConfig
|
|
}
|
|
|
|
/**
|
|
* `openclaw synthesis ...` admin commands. Used to inspect & poke the running
|
|
* pool from outside (helpful for testing without a real channel inbound).
|
|
*
|
|
* Subcommands (planned):
|
|
* list — show live processes + mapping
|
|
* push <session> <text> — fake an inbound message
|
|
* kill <session> — terminate a process (mapping preserved)
|
|
* forget <session> — drop mapping entirely (next msg = new claude session)
|
|
*/
|
|
export function registerCli(api: OpenClawPluginApi, deps: CliDeps): void {
|
|
// The exact API shape for command registration depends on the OpenClaw
|
|
// plugin-sdk version. Two common forms seen in existing plugins:
|
|
//
|
|
// api.commands?.register('synthesis', { describe, handler })
|
|
// api.cli?.command('synthesis', sub => sub.command('list', '...', () => {...}))
|
|
//
|
|
// Both are stubbed below — pick whichever the loaded SDK exposes when
|
|
// wiring this for real.
|
|
|
|
const _ = { api, deps }
|
|
// TODO: wire actual command registration once the surrounding plugin
|
|
// patterns are confirmed (see contractor-agent/commands/register-cli.ts
|
|
// for the canonical example in this codebase).
|
|
void _
|
|
}
|