Skip to main content

Amp

<Amp mode="smart" onFinished={(result) => console.log(result.output)}>
  Refactor the module for clarity.
</Amp>
Runs the Amp CLI as a Smithers agent with DB-backed reporting and retry logic.
import { Amp } from "smithers-orchestrator"

Props

PropTypeDefaultDescription
childrenReactNode-Prompt for the agent
mode'smart' | 'rush''smart'Agent mode
maxTurnsnumber-Max turns
systemPromptstring-System instructions
permissionMode'default' | 'acceptEdits' | 'bypassPermissions''default'File permission policy
cwdstring-Working directory
timeoutnumber-Timeout in ms
continueThreadboolean-Continue previous thread
resumeThreadstring-Resume thread by id
labelsstring[]-Thread labels
onFinished(result: AgentResult) => void-Success callback
onError(error: Error) => void-Error callback
onProgress(message: string) => void-Progress callback
onToolCall(tool: string, input: any) => void-Tool call callback
onStreamPart(part: SmithersStreamPart) => void-Typed stream events
reportingEnabledbooleantrueDB reporting
maxRetriesnumber3Retry attempts
validate(result: AgentResult) => boolean | Promise<boolean>-Custom validation function
retryOnValidationFailurebooleanfalseRetry on validation failure
stopConditionsStopCondition[]-Conditions for early termination
tailLogCountnumber10Tail log entries
tailLogLinesnumber10Lines per entry
middlewareSmithersMiddleware[]-Execution middleware
recordStreamEventsbooleantrue (when reportingEnabled)Record stream events to DB