import { McpServer } from "@modelcontextprotocol/server"; import type { ServerNotifier } from "@modelcontextprotocol/server"; import { WorkflowManager } from "@automatalabs/workflows"; import type { AgentRunner } from "@automatalabs/shared-types"; import { ActiveRunRegistry, WorkflowProjectRegistry } from "./project-registry.js"; import type { WorkflowRunControlRouter } from "./daemon/run-control.js"; import type { WorkflowServerControl } from "./lifecycle.js"; import { WorkflowPermissionBroker } from "./workflow-permissions.js"; export declare const SERVER_VERSION: string; export declare const SERVER_INSTRUCTIONS: string; export { ActiveRunRegistry, MAX_ACTIVE_RUNS } from "./project-registry.js"; /** How long a pause request waits for executing agents to finish before answering with `running`. */ export declare const WORKFLOW_PAUSE_SETTLE_WAIT_MS = 2000; /** * Build the MCP server with the `workflow` model-facing tool, its Agent Skill, * plus the user-controlled `author-workflow` prompt. Prompts are a separate MCP primitive and never enter the model's tool-selection * loop). Backend auth is the agents' own concern (their CLI credential stores); a run that * genuinely hits AUTH_REQUIRED pauses with authContext and resumes after an out-of-band CLI * login. The AgentRunner is the DI seam: it is injected here into a single * WorkflowManager (so persistence — and therefore resume — is shared across calls) and every run goes * through manager.runSync or startInBackground. The returned McpServer is not yet connected — the caller attaches a * transport (see index.ts). */ export interface CreateWorkflowServerOptions { /** Pin a pre-built manager as this server's own project (composition/back-compat seam). */ manager?: WorkflowManager; /** Background-run registry for the pinned manager's project. Defaults to a fresh one. */ activeRuns?: ActiveRunRegistry; /** * Share one project registry across servers (the daemon passes its own, shared by every * session, so all sessions see all projects' runs). Defaults to a private registry. */ projects?: WorkflowProjectRegistry; /** * Require `projectDir` on run inputs instead of defaulting to this server's own project. * The daemon sets this: it serves every project from one process and has no ambient cwd. */ requireProjectDir?: boolean; /** * This server's MCP client identity on a legacy-era connection (daemon mode: the per-session * transport's id). Scopes `workflow_monitor` notification claims so one client's claim never * answers for another's. Omitted: a single-client server uses one fixed scope. Modern-era * requests carry their own scope and ignore it. */ clientId?: () => string | undefined; /** Protocol era selected by an SDK serving entry. Hand-connected servers remain legacy. */ protocolEra?: "legacy" | "modern"; /** Daemon-scoped publisher for modern subscriptions/listen change delivery. */ modernNotifier?: ServerNotifier; /** Daemon-only location-transparent run-control router. */ runControl?: WorkflowRunControlRouter; /** Process-local broker whose resolver is installed on the shared ACP runner. */ permissionBroker?: WorkflowPermissionBroker; } export interface WorkflowServer extends McpServer, WorkflowServerControl { } export declare function createWorkflowServer(runner: AgentRunner, options?: CreateWorkflowServerOptions): WorkflowServer; //# sourceMappingURL=server.d.ts.map