feat: make panel optional

This commit is contained in:
Simon
2026-01-17 17:24:17 +08:00
parent 1af2607cca
commit 78d4919289
5 changed files with 72 additions and 21 deletions

View File

@@ -11,6 +11,11 @@ export interface PanelConfig {
language?: SupportedLanguage
onExecuteTask: (task: string) => void
onStop: () => void
/**
* Whether to prompt for next task after task completion
* @default true
*/
promptForNextTask?: boolean
}
/**
@@ -358,7 +363,14 @@ export class Panel {
}
const lastStep = steps[steps.length - 1]
return lastStep.type === 'completed' || lastStep.type === 'error'
const isTaskEnded = lastStep.type === 'completed' || lastStep.type === 'error'
// Only show input area after task completion if configured to do so
if (isTaskEnded) {
return this.#config.promptForNextTask ?? true
}
return false
}
#createWrapper(): HTMLElement {