( rawOptions: PlannotatorOpenCodeOptions | null | undefined, )
| 39 | }; |
| 40 | |
| 41 | export function normalizeWorkflowOptions( |
| 42 | rawOptions: PlannotatorOpenCodeOptions | null | undefined, |
| 43 | ): NormalizedWorkflowOptions { |
| 44 | const rawWorkflow = typeof rawOptions?.workflow === "string" |
| 45 | ? rawOptions.workflow.trim() |
| 46 | : ""; |
| 47 | const workflow = WORKFLOWS.has(rawWorkflow as WorkflowMode) |
| 48 | ? rawWorkflow as WorkflowMode |
| 49 | : DEFAULT_WORKFLOW; |
| 50 | |
| 51 | const planningAgents = normalizePlanningAgents(rawOptions?.planningAgents); |
| 52 | const runtime = normalizeRuntime(rawOptions?.runtime); |
| 53 | return { |
| 54 | workflow, |
| 55 | planningAgents, |
| 56 | planningAgentSet: new Set(planningAgents), |
| 57 | runtime, |
| 58 | }; |
| 59 | } |
| 60 | |
| 61 | function normalizeRuntime(value: unknown): RuntimeMode { |
| 62 | const rawRuntime = typeof value === "string" ? value.trim() : ""; |
no test coverage detected