feat(10-03): add setAgentQuestion convenience helper
- Add single-question convenience method to TestHarness - Wraps question in array for questions scenario - Keeps setAgentQuestions for multi-question cases
This commit is contained in:
@@ -197,13 +197,24 @@ export interface TestHarness {
|
||||
setAgentDone(agentName: string, result?: string): void;
|
||||
|
||||
/**
|
||||
* Convenience: Set agent to ask questions.
|
||||
* Convenience: Set agent to ask questions (array form).
|
||||
*/
|
||||
setAgentQuestions(
|
||||
agentName: string,
|
||||
questions: QuestionItem[]
|
||||
): void;
|
||||
|
||||
/**
|
||||
* Convenience: Set agent to ask a single question.
|
||||
* Wraps the question in an array internally.
|
||||
*/
|
||||
setAgentQuestion(
|
||||
agentName: string,
|
||||
questionId: string,
|
||||
question: string,
|
||||
options?: Array<{ label: string; description?: string }>
|
||||
): void;
|
||||
|
||||
/**
|
||||
* Convenience: Set agent to fail with unrecoverable error.
|
||||
*/
|
||||
@@ -311,6 +322,18 @@ export function createTestHarness(): TestHarness {
|
||||
agentManager.setScenario(agentName, { status: 'questions', questions });
|
||||
},
|
||||
|
||||
setAgentQuestion: (
|
||||
agentName: string,
|
||||
questionId: string,
|
||||
question: string,
|
||||
options?: Array<{ label: string; description?: string }>
|
||||
) => {
|
||||
agentManager.setScenario(agentName, {
|
||||
status: 'questions',
|
||||
questions: [{ id: questionId, question, options }],
|
||||
});
|
||||
},
|
||||
|
||||
setAgentError: (agentName: string, error: string) => {
|
||||
agentManager.setScenario(agentName, { status: 'unrecoverable_error', error });
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user