( requestedWorkflows: string[] | undefined, ctx: PredicateContext, )
| 455 | } |
| 456 | |
| 457 | export async function applyWorkflowSelectionFromManifest( |
| 458 | requestedWorkflows: string[] | undefined, |
| 459 | ctx: PredicateContext, |
| 460 | ): Promise<RuntimeToolInfo> { |
| 461 | if (!server) { |
| 462 | throw new Error('Tool registry has not been initialized.'); |
| 463 | } |
| 464 | |
| 465 | registryState.currentContext = ctx; |
| 466 | |
| 467 | const manifest = loadManifest(); |
| 468 | const selectedWorkflows = resolveSelectedWorkflows(manifest, requestedWorkflows, ctx); |
| 469 | const { registeredCount, desiredWorkflows } = await enumerateAndRegisterTools( |
| 470 | manifest, |
| 471 | selectedWorkflows, |
| 472 | ctx, |
| 473 | ); |
| 474 | |
| 475 | registryState.enabledWorkflows = desiredWorkflows; |
| 476 | |
| 477 | const workflowLabel = selectedWorkflows.map((w) => w.id).join(', '); |
| 478 | log('info', `Registered ${registeredCount} tools from workflows: ${workflowLabel}`); |
| 479 | |
| 480 | return snapshotRuntimeRegistration(); |
| 481 | } |
| 482 | |
| 483 | export async function registerWorkflowsFromManifest( |
| 484 | workflowNames?: string[], |
no test coverage detected