MCPcopy Index your code
hub / github.com/getsentry/XcodeBuildMCP / selectWorkflowsForMcp

Function selectWorkflowsForMcp

src/visibility/exposure.ts:176–204  ·  view source on GitHub ↗
(
  allWorkflows: WorkflowManifestEntry[],
  requestedWorkflowIds: string[] | undefined,
  ctx: PredicateContext,
)

Source from the content-addressed store, hash-verified

174 * 4. Filter all by availability + predicates
175 */
176export function selectWorkflowsForMcp(
177 allWorkflows: WorkflowManifestEntry[],
178 requestedWorkflowIds: string[] | undefined,
179 ctx: PredicateContext,
180): WorkflowManifestEntry[] {
181 const selectedIds = new Set<string>();
182
183 // 1. Include auto-include workflows whose predicates pass
184 for (const wf of getAutoIncludeWorkflows(allWorkflows, ctx)) {
185 selectedIds.add(wf.id);
186 }
187
188 // 2/3. Include requested or default-enabled workflows
189 if (requestedWorkflowIds && requestedWorkflowIds.length > 0) {
190 for (const id of requestedWorkflowIds) {
191 selectedIds.add(id);
192 }
193 } else {
194 for (const wf of getDefaultEnabledWorkflows(allWorkflows)) {
195 selectedIds.add(wf.id);
196 }
197 }
198
199 // Build final list from selected IDs
200 const selected = allWorkflows.filter((wf) => selectedIds.has(wf.id));
201
202 // 4. Filter by availability + predicates
203 return filterEnabledWorkflows(selected, ctx);
204}

Callers 2

resolveSelectedWorkflowsFunction · 0.90
exposure.test.tsFile · 0.90

Calls 3

getAutoIncludeWorkflowsFunction · 0.85
filterEnabledWorkflowsFunction · 0.85

Tested by

no test coverage detected