MCPcopy
hub / github.com/Fission-AI/OpenSpec / stableWorkflowOrder

Function stableWorkflowOrder

src/commands/config.ts:122–143  ·  view source on GitHub ↗
(workflows: readonly string[])

Source from the content-addressed store, hash-verified

120}
121
122function stableWorkflowOrder(workflows: readonly string[]): string[] {
123 const seen = new Set<string>();
124 const ordered: string[] = [];
125
126 for (const workflow of ALL_WORKFLOWS) {
127 if (workflows.includes(workflow) && !seen.has(workflow)) {
128 ordered.push(workflow);
129 seen.add(workflow);
130 }
131 }
132
133 const extras = workflows.filter((w) => !ALL_WORKFLOWS.includes(w as (typeof ALL_WORKFLOWS)[number]));
134 extras.sort();
135 for (const extra of extras) {
136 if (!seen.has(extra)) {
137 ordered.push(extra);
138 seen.add(extra);
139 }
140 }
141
142 return ordered;
143}
144
145/**
146 * Build a user-facing diff summary between two profile states.

Callers 1

diffProfileStateFunction · 0.85

Calls 1

hasMethod · 0.80

Tested by

no test coverage detected