Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion src/cli/commands/run-playbook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { getSessionById } from '../services/storage';
import { findPlaybookById } from '../services/playbooks';
import { runPlaybook as executePlaybook } from '../services/batch-processor';
import { detectClaude, detectCodex } from '../services/agent-spawner';
import { detectClaude, detectCodex, detectOpenCode, detectDroid } from '../services/agent-spawner';
import { emitError } from '../output/jsonl';
import {
formatRunEvent,
Expand Down Expand Up @@ -168,6 +168,29 @@ export async function runPlaybook(playbookId: string, options: RunPlaybookOption
}
process.exit(1);
}
} else if (agent.toolType === 'opencode') {
const oc = await detectOpenCode();
if (!oc.available) {
if (useJson) {
emitError('OpenCode CLI not found. Please install OpenCode.', 'OPENCODE_NOT_FOUND');
} else {
console.error(formatError('OpenCode CLI not found. Please install OpenCode.'));
}
process.exit(1);
}
} else if (agent.toolType === 'factory-droid') {
const droid = await detectDroid();
if (!droid.available) {
if (useJson) {
emitError(
'Factory Droid CLI not found. Please install Factory Droid.',
'DROID_NOT_FOUND'
);
} else {
console.error(formatError('Factory Droid CLI not found. Please install Factory Droid.'));
}
process.exit(1);
}
} else {
const message = `Agent type "${agent.toolType}" is not supported in CLI batch mode yet.`;
if (useJson) {
Expand Down
29 changes: 27 additions & 2 deletions src/cli/commands/send.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
// Send command - send a message to an agent and get a JSON response
// Requires a Maestro agent ID. Optionally resumes an existing agent session.

import { spawnAgent, detectClaude, detectCodex, type AgentResult } from '../services/agent-spawner';
import {
spawnAgent,
detectClaude,
detectCodex,
detectOpenCode,
detectDroid,
type AgentResult,
} from '../services/agent-spawner';
import { resolveAgentId, getSessionById } from '../services/storage';
import { estimateContextUsage } from '../../main/parsers/usage-aggregator';
import type { ToolType } from '../../shared/types';
Expand Down Expand Up @@ -88,7 +95,7 @@ export async function send(
}

// Validate agent type is supported for CLI spawning
const supportedTypes: ToolType[] = ['claude-code', 'codex'];
const supportedTypes: ToolType[] = ['claude-code', 'codex', 'opencode', 'factory-droid'];
if (!supportedTypes.includes(agent.toolType)) {
emitErrorJson(
`Agent type "${agent.toolType}" is not supported for send mode. Supported: ${supportedTypes.join(', ')}`,
Expand Down Expand Up @@ -116,6 +123,24 @@ export async function send(
);
process.exit(1);
}
} else if (agent.toolType === 'opencode') {
const oc = await detectOpenCode();
if (!oc.available) {
emitErrorJson(
'OpenCode CLI not found. See https://github.com/opencode-ai/opencode for installation instructions',
'OPENCODE_NOT_FOUND'
);
process.exit(1);
}
} else if (agent.toolType === 'factory-droid') {
const droid = await detectDroid();
if (!droid.available) {
emitErrorJson(
'Factory Droid CLI not found. See your provider documentation for installation instructions',
'DROID_NOT_FOUND'
);
process.exit(1);
}
}

// Spawn agent — spawnAgent handles --resume vs --session-id internally
Expand Down
Loading