import { EventEmitter } from 'node:events'; import { execFileSync as nodeExecFileSync } from 'node:child_process'; import type { GateVerdict, StageId, ArtifactRef, ProjectConfig } from '../types/index.js'; import type { RequirementAnalysisRequest, RequirementAnalysisResponse } from '../stages/spec-types.js'; import type { TaskPayload } from '../orchestrator/pipeline-run.js'; import type { SevoHostAdapter, SpawnTaskOptions, ParallelTaskDescriptor } from './host-adapter.js'; import type { PublishAdapter, PublishResult } from './publish-adapter.js'; export interface SpawnLike { spawn(request: { stage: StageId; payload: TaskPayload; agentId?: string; }): Promise<{ taskId: string; }>; } /** Programmatic spawn client for sessions_spawn API (AC-19.10). */ export interface SessionsSpawnClient { /** Spawn a subagent session. Returns the session ID. */ spawnSession(request: { agentId: string; task: string; label?: string; timeoutSeconds?: number; }): Promise<{ sessionId: string; }>; } export interface OpenClawAdapterOptions { projectRoot: string; workspaceRoot?: string; artifactRoots?: string[]; defaultAgentId?: string; stageAgents?: Partial>; notifier?: (message: string) => void; spawnClient?: SpawnLike; /** Programmatic sessions_spawn client (AC-19.10). */ sessionsSpawnClient?: SessionsSpawnClient; eventBus?: EventEmitter; projectConfigPath?: string; notifications?: ProjectConfig['notifications']; requirementAnalyzer?: (input: RequirementAnalysisRequest) => Promise; publishScript?: string; publishExecFileSync?: typeof nodeExecFileSync; publishCommandCwd?: string; } export interface GateResultEvent { stage: StageId; verdict: GateVerdict; timestamp: string; } declare const DEFAULT_EVENT_NAME = "gate:result"; export declare class OpenClawAdapter implements SevoHostAdapter, PublishAdapter { readonly eventBus: EventEmitter; private readonly projectRoot; private readonly workspaceRoot; private readonly artifactRoots; private readonly defaultAgentId?; private readonly stageAgents?; private readonly notifier?; private readonly spawnClient?; private readonly sessionsSpawnClient?; private readonly projectConfigPath?; private readonly notifications?; private readonly requirementAnalyzer?; private readonly publishScript; private readonly publishExecFileSync; private readonly publishCommandCwd; constructor(options: OpenClawAdapterOptions); dispatchTask(stage: StageId, payload: TaskPayload): Promise; collectArtifacts(taskId: string): Promise; notifyGateResult(stage: StageId, verdict: GateVerdict): void; getProjectConfig(): ProjectConfig; analyzeRequirements(input: RequirementAnalysisRequest): Promise; publish(projectPath: string, version: string): Promise; requestReadmeUpdate(request: { pipelineId: string; projectSlug: string; specPath: string; readmePath: string; missingFrs: string[]; }): Promise; loadProjectConfig(): Promise; /** Whether this adapter supports programmatic task spawning. */ supportsSpawn(): boolean; /** * Spawn a single task via OpenClaw sessions_spawn API (AC-19.10). * Falls back to null if sessionsSpawnClient is not configured. */ spawnTask(agentId: string, task: string, options?: SpawnTaskOptions): Promise; /** * Spawn multiple tasks in parallel via OpenClaw sessions_spawn API (AC-19.11). * All tasks are dispatched concurrently; returns all session IDs. * Falls back to null if sessionsSpawnClient is not configured. */ spawnParallelTasks(tasks: ParallelTaskDescriptor[]): Promise; private resolveAgent; private fallbackTaskId; private walkArtifacts; private matchesTask; private inferArtifactType; private parsePublishResult; private formatGateMessage; } export { DEFAULT_EVENT_NAME as OPENCLAW_GATE_RESULT_EVENT }; //# sourceMappingURL=openclaw-adapter.d.ts.map