( manifest: ResolvedManifest, requestedWorkflows: string[] | undefined, ctx: PredicateContext, )
| 337 | } |
| 338 | |
| 339 | function resolveSelectedWorkflows( |
| 340 | manifest: ResolvedManifest, |
| 341 | requestedWorkflows: string[] | undefined, |
| 342 | ctx: PredicateContext, |
| 343 | ): WorkflowManifestEntry[] { |
| 344 | const customSelection = createCustomWorkflowsFromConfig(manifest, ctx.config.customWorkflows); |
| 345 | for (const warning of customSelection.warnings) { |
| 346 | log('warning', warning); |
| 347 | emitConfigWarningMetric('invalid_custom_workflow'); |
| 348 | } |
| 349 | const allWorkflows = [...manifest.workflows.values(), ...customSelection.workflows]; |
| 350 | |
| 351 | const normalizedRequestedWorkflows = requestedWorkflows |
| 352 | ?.map(normalizeName) |
| 353 | .filter((name) => name.length > 0); |
| 354 | |
| 355 | const selectedWorkflows = selectWorkflowsForMcp(allWorkflows, normalizedRequestedWorkflows, ctx); |
| 356 | const knownWorkflowIds = new Set(allWorkflows.map((workflow) => workflow.id)); |
| 357 | const unknownRequestedWorkflows = (normalizedRequestedWorkflows ?? []).filter( |
| 358 | (workflowName) => !knownWorkflowIds.has(workflowName), |
| 359 | ); |
| 360 | if (unknownRequestedWorkflows.length > 0) { |
| 361 | const uniqueUnknownRequestedWorkflows = [...new Set(unknownRequestedWorkflows)]; |
| 362 | log( |
| 363 | 'warning', |
| 364 | `[config] Ignoring unknown workflow(s): ${uniqueUnknownRequestedWorkflows.join(', ')}`, |
| 365 | ); |
| 366 | emitConfigWarningMetric('unknown_workflow'); |
| 367 | } |
| 368 | |
| 369 | return selectedWorkflows; |
| 370 | } |
| 371 | |
| 372 | async function tryImportToolModule( |
| 373 | toolManifest: ToolManifestEntry, |
no test coverage detected