import type { Engine } from '../core/engine.ts'; import type { ListFilter, PaginatedResult, WorkflowState, WorkflowSummary } from '../core/types.ts'; import { WeftError } from '../core/weft-error.ts'; import type { AuthorizationScope } from '../server/authorization-scope.ts'; import { type Principal } from '../server/principal.ts'; /** Execution context shared by MCP tools and resources. */ export type McpAccessContext = { readonly engine: Engine; readonly principal: Principal; readonly authRequired: boolean; }; /** Error surfaced as a tool-level failure rather than a protocol failure. */ export declare class McpToolExecutionError extends WeftError<'McpToolExecutionError'> { constructor(message: string); } /** Assert that the principal has a scope when authentication is enabled. */ export declare function assertScope(context: McpAccessContext, scope: AuthorizationScope, action: string): void; /** Load a workflow by id. */ export declare function getVisibleWorkflowState(engine: Engine, workflowId: string): Promise; /** List workflows. */ export declare function listVisibleWorkflows(engine: Engine, filter?: ListFilter): Promise>;