({
commands,
prompt,
promptUuid,
isMeta,
cwd,
tools,
mcpClients,
verbose = false,
thinkingConfig,
maxTurns,
maxBudgetUsd,
taskBudget,
canUseTool,
mutableMessages = [],
getReadFileCache,
setReadFileCache,
customSystemPrompt,
appendSystemPrompt,
userSpecifiedModel,
fallbackModel,
jsonSchema,
toolChoice,
getAppState,
setAppState,
abortController,
replayUserMessages = false,
includePartialMessages = false,
handleElicitation,
agents = [],
setSDKStatus,
orphanedPermission,
}: {
commands: Command[]
prompt: string | Array<ContentBlockParam>
promptUuid?: string
isMeta?: boolean
cwd: string
tools: Tools
verbose?: boolean
mcpClients: MCPServerConnection[]
thinkingConfig?: ThinkingConfig
maxTurns?: number
maxBudgetUsd?: number
taskBudget?: { total: number }
canUseTool: CanUseToolFn
mutableMessages?: Message[]
customSystemPrompt?: string
appendSystemPrompt?: string
userSpecifiedModel?: string
fallbackModel?: string
jsonSchema?: Record<string, unknown>
toolChoice?: BetaToolChoiceTool | BetaToolChoiceAuto
getAppState: () => AppState
setAppState: (f: (prev: AppState) => AppState) => void
getReadFileCache: () => FileStateCache
setReadFileCache: (cache: FileStateCache) => void
abortController?: AbortController
replayUserMessages?: boolean
includePartialMessages?: boolean
handleElicitation?: ToolUseContext['handleElicitation']
agents?: AgentDefinition[]
setSDKStatus?: (status: SDKStatus) => void
orphanedPermission?: OrphanedPermission
})
| 1328 | * Convenience wrapper around QueryEngine for one-shot usage. |
| 1329 | */ |
| 1330 | export async function* ask({ |
| 1331 | commands, |
| 1332 | prompt, |
| 1333 | promptUuid, |
| 1334 | isMeta, |
| 1335 | cwd, |
| 1336 | tools, |
| 1337 | mcpClients, |
| 1338 | verbose = false, |
| 1339 | thinkingConfig, |
| 1340 | maxTurns, |
| 1341 | maxBudgetUsd, |
| 1342 | taskBudget, |
| 1343 | canUseTool, |
| 1344 | mutableMessages = [], |
| 1345 | getReadFileCache, |
| 1346 | setReadFileCache, |
| 1347 | customSystemPrompt, |
| 1348 | appendSystemPrompt, |
| 1349 | userSpecifiedModel, |
| 1350 | fallbackModel, |
| 1351 | jsonSchema, |
| 1352 | toolChoice, |
| 1353 | getAppState, |
| 1354 | setAppState, |
| 1355 | abortController, |
| 1356 | replayUserMessages = false, |
| 1357 | includePartialMessages = false, |
| 1358 | handleElicitation, |
| 1359 | agents = [], |
| 1360 | setSDKStatus, |
| 1361 | orphanedPermission, |
| 1362 | }: { |
| 1363 | commands: Command[] |
| 1364 | prompt: string | Array<ContentBlockParam> |
| 1365 | promptUuid?: string |
| 1366 | isMeta?: boolean |
| 1367 | cwd: string |
| 1368 | tools: Tools |
| 1369 | verbose?: boolean |
| 1370 | mcpClients: MCPServerConnection[] |
| 1371 | thinkingConfig?: ThinkingConfig |
| 1372 | maxTurns?: number |
| 1373 | maxBudgetUsd?: number |
| 1374 | taskBudget?: { total: number } |
| 1375 | canUseTool: CanUseToolFn |
| 1376 | mutableMessages?: Message[] |
| 1377 | customSystemPrompt?: string |
| 1378 | appendSystemPrompt?: string |
| 1379 | userSpecifiedModel?: string |
| 1380 | fallbackModel?: string |
| 1381 | jsonSchema?: Record<string, unknown> |
| 1382 | toolChoice?: BetaToolChoiceTool | BetaToolChoiceAuto |
| 1383 | getAppState: () => AppState |
| 1384 | setAppState: (f: (prev: AppState) => AppState) => void |
| 1385 | getReadFileCache: () => FileStateCache |
| 1386 | setReadFileCache: (cache: FileStateCache) => void |
| 1387 | abortController?: AbortController |
no test coverage detected