MCPcopy Create free account
hub / github.com/backnotprop/plannotator / normalizeWorkflowOptions

Function normalizeWorkflowOptions

apps/opencode-plugin/workflow.ts:41–59  ·  view source on GitHub ↗
(
  rawOptions: PlannotatorOpenCodeOptions | null | undefined,
)

Source from the content-addressed store, hash-verified

39};
40
41export 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
61function normalizeRuntime(value: unknown): RuntimeMode {
62 const rawRuntime = typeof value === "string" ? value.trim() : "";

Callers 2

workflow.test.tsFile · 0.90
PlannotatorPluginFunction · 0.90

Calls 3

normalizePlanningAgentsFunction · 0.85
normalizeRuntimeFunction · 0.85
hasMethod · 0.80

Tested by

no test coverage detected