Skip to main content

Option Types

Types for configuring thread and execution options.

AutonomyLevel

Controls how independently the AI operates:

type AutonomyLevel = 'default' | 'low' | 'medium' | 'high';
LevelBehavior
defaultStandard confirmation prompts
lowConservative, confirms most operations
mediumBalanced autonomy
highMaximum autonomy, minimal confirmations

ReasoningEffort

Controls reasoning intensity:

type ReasoningEffort = 'off' | 'none' | 'low' | 'medium' | 'high';

OutputFormat

Output format for CLI operations:

type OutputFormat = 'text' | 'json' | 'stream-json';

ThreadOptions

Options for creating threads:

interface ThreadOptions {
/** Override working directory */
cwd?: string;

/** Override autonomy level */
autonomyLevel?: AutonomyLevel;

/** Restrict available tools */
enabledTools?: string[];

/** Override model */
model?: string;
}

RunOptions

Options for run/runStreamed:

interface RunOptions {
/** JSON Schema for structured output */
outputSchema?: JsonSchema;

/** Path to a prompt file */
promptFile?: string;

/** File attachments */
attachments?: FileAttachment[];

/** Override model for this run */
model?: string;

/** Override autonomy level */
autonomyLevel?: AutonomyLevel;
}

ExecOptions

Options for one-shot execution:

interface ExecOptions extends RunOptions {
/** Override working directory */
cwd?: string;

/** Override timeout */
timeout?: number;
}

FileAttachment

File attachment for prompts:

interface FileAttachment {
/** Path to the file */
path: string;

/** Type of file */
type: 'image' | 'text' | 'data';

/** Optional description */
description?: string;
}

JsonSchema

JSON Schema for structured output:

interface JsonSchema {
type?: string;
properties?: Record<string, JsonSchema>;
items?: JsonSchema;
required?: string[];
enum?: unknown[];
description?: string;
[key: string]: unknown;
}

Usage Example

const thread = droid.startThread({
autonomyLevel: 'high',
enabledTools: ['Read', 'Write']
});

const result = await thread.run('Analyze code', {
attachments: [
{ path: './src/main.ts', type: 'text' }
],
outputSchema: {
type: 'object',
properties: {
issues: { type: 'array' }
}
}
});