/** * AgentBoardroom — OpenClaw Tools Implementation * * Concrete implementation of OpenClawTools that shells out to the OpenClaw CLI. * This is the bridge between AgentBoardroom's governance abstractions and * the actual OpenClaw gateway runtime. * * @module adapters/openclaw/tools */ import type { OpenClawTools, OpenClawSessionConfig, OpenClawSpawnResult, OpenClawSessionStatus, OpenClawCronConfig } from './runtime.js'; /** Options for the CLI tools implementation */ export interface OpenClawCLIToolsConfig { /** Path to the openclaw binary (default: 'openclaw') */ binary?: string; /** Gateway URL override */ gatewayUrl?: string; /** Gateway token override */ gatewayToken?: string; /** Default timeout for CLI commands in ms */ timeoutMs?: number; /** Enable verbose logging */ verbose?: boolean; /** Logger function */ log?: (msg: string) => void; } /** * Concrete OpenClawTools implementation using the OpenClaw CLI. * * Maps governance operations to CLI commands: * - sessionsSpawn → `openclaw agent --agent --message ` * - sessionsSend → `openclaw agent --agent --message ` * - sessionsStatus → `openclaw sessions --json` (filtered) * - sessionsKill → (agents are persistent; this is a no-op or clears session) * - cronSchedule → `openclaw cron add` * - messagePost → `openclaw message --channel --message ` */ export declare class OpenClawCLITools implements OpenClawTools { private binary; private timeoutMs; private log?; constructor(config?: OpenClawCLIToolsConfig); /** * Spawn/activate an agent session by sending it an initial message. * * OpenClaw agents are pre-configured (via `openclaw agents add`). * "Spawning" means sending the first message to activate the session. * The agent ID maps to the OpenClaw agent ID (e.g., "board-ceo"). */ sessionsSpawn(config: OpenClawSessionConfig): Promise; /** * Send a message to an existing agent session. */ sessionsSend(sessionId: string, message: string): Promise; /** * Get session status for an agent. */ sessionsStatus(sessionId: string): Promise; /** * Kill/stop an agent session. * Since OpenClaw agents are persistent, this is effectively a no-op. * The agent remains configured but won't receive further messages. */ sessionsKill(_sessionId: string): Promise; /** * Schedule a cron job via the OpenClaw CLI. */ cronSchedule(config: OpenClawCronConfig): Promise; /** * Post a message to a channel (Mattermost, Discord, etc.) */ messagePost(channel: string, message: string): Promise; /** * Check if a cron job exists by name. */ cronExists(name: string): Promise; /** * Remove a cron job by name. */ cronRemove(name: string): Promise; /** * List all agents to verify they exist. */ listAgents(): Promise>; /** * Resolve a boardroom role label to an OpenClaw agent ID. * Convention: role "ceo" → agent "board-ceo" */ private resolveAgentId; } //# sourceMappingURL=tools.d.ts.map