@burdenoff/mcp-libs 2026.1007.1 → 2026.1007.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/core/errors.ts","../../../src/core/tool-name.ts","../../../src/core/result.ts","../../../src/modules/fluidgrids/operations.ts","../../../src/modules/fluidgrids/tools/helpers.ts","../../../src/modules/fluidgrids/tools/credentials.ts","../../../src/modules/fluidgrids/tools/insights.ts","../../../src/modules/fluidgrids/tools/nodes.ts","../../../src/modules/fluidgrids/tools/runs.ts","../../../src/modules/fluidgrids/tools/scheduled-jobs.ts","../../../src/modules/fluidgrids/tools/webhooks.ts","../../../src/modules/fluidgrids/tools/workflows.ts","../../../src/modules/fluidgrids/prompts.ts","../../../src/modules/fluidgrids/resources.ts","../../../src/modules/fluidgrids/index.ts"],"names":["z"],"mappings":";;;;;;;;;;;AA8BO,IAAM,gBAAA,GAAN,cAA+B,KAAA,CAAM;AAAA,EACjB,KAAA;AAAA,EAEzB,WAAA,CAAY,SAAiB,KAAA,EAAiB;AAC5C,IAAA,KAAA,CAAM,OAAO,CAAA;AACb,IAAA,IAAA,CAAK,IAAA,GAAO,kBAAA;AACZ,IAAA,IAAA,CAAK,KAAA,GAAQ,KAAA;AAAA,EACf;AACF,CAAA;;;AC1BA,IAAM,oBAAA,GAAuB,EAAA;AAE7B,SAAS,cAAA,CAAe,MAAc,IAAA,EAA8C;AAClF,EAAA,IAAuB,IAAA,CAAK,MAAA,GAAS,oBAAA,EAAsB;AACzD,IAAA,MAAM,IAAI,gBAAA;AAAA,MACR,CAAA,WAAA,EAAc,IAAI,CAAA,UAAA,EAAa,oBAAoB,CAAA,8CAAA;AAAA,KACrD;AAAA,EACF;AACA,EAAA,OAAO,IAAA;AACT;AAMO,SAAS,WAAA,CAAY,gBAAwB,KAAA,EAAyB;AAC3E,EAAA,IAAI,CAAC,WAAA,EAAa;AAChB,IAAA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C;AAC/D,IAAA,MAAM,QAAkB,EAAC;AACzB,IAAA,MAAM,YAAsB,EAAC;AAC7B,IAAA,MAAM,UAAoB,EAAC;AAE3B,IAAA,MAAM,SAAA,GAAY,CAAC,CAAA,KAAsB;AACvC,MAAA,KAAA,CAAM,KAAK,CAAC,CAAA;AACZ,MAAA,OAAO,CAAA;AAAA,IACT,CAAA;AACA,IAAA,MAAM,aAAA,GAAgB,CAAC,GAAA,KAAwB;AAC7C,MAAA,SAAA,CAAU,KAAK,GAAG,CAAA;AAClB,MAAA,OAAO,GAAA;AAAA,IACT,CAAA;AACA,IAAA,MAAM,WAAA,GAAc,CAAC,CAAA,KAAsB;AACzC,MAAA,OAAA,CAAQ,KAAK,CAAC,CAAA;AACd,MAAA,OAAO,CAAA;AAAA,IACT,CAAA;AAEA,IAAA,qBAAA,CAAsB,MAAA,EAAQ,KAAK,SAAS,CAAA;AAC5C,IAAA,gBAAA,CAAiB,MAAA,EAAQ,KAAK,SAAS,CAAA;AACvC,IAAA,iBAAA,CAAkB,MAAA,EAAQ,KAAK,SAAS,CAAA;AACxC,IAAA,uBAAA,CAAwB,MAAA,EAAQ,KAAK,SAAS,CAAA;AAC9C,IAAA,oBAAA,CAAqB,MAAA,EAAQ,KAAK,SAAS,CAAA;AAC3C,IAAA,yBAAA,CAA0B,MAAA,EAAQ,KAAK,SAAS,CAAA;AAChD,IAAA,oBAAA,CAAqB,MAAA,EAAQ,KAAK,SAAS,CAAA;AAE3C,IAAA,2BAAA,CAA4B,MAAA,EAAQ,KAAK,aAAa,CAAA;AACtD,IAAA,yBAAA,CAA0B,MAAA,EAAQ,KAAK,WAAW,CAAA;AAElD,IAAA,OAAO,EAAE,KAAA,EAAO,SAAA,EAAW,OAAA,EAAQ;AAAA,EACrC;AACF,CAAA;AAEA,IAAO,kBAAA,GAAQ","file":"index.cjs","sourcesContent":["/**\n * Error classes for MCP SDK.\n *\n * Modules MUST throw these instead of throwing raw Errors. The registerTool\n * wrapper in result.ts catches and maps them to MCP-protocol-compliant\n * `{ isError: true, content: [...] }` responses.\n *\n * Throwing past the wrapper to the protocol surfaces as JSON-RPC -32603 to\n * the client and is a protocol bug.\n */\n\nexport class McpUserError extends Error {\n public readonly hint: string | undefined;\n\n constructor(message: string, opts?: { hint?: string }) {\n super(message);\n this.name = 'McpUserError';\n this.hint = opts?.hint;\n }\n}\n\nexport class McpAuthError extends McpUserError {\n constructor(message: string, opts?: { hint?: string }) {\n super(message, {\n hint: opts?.hint ?? 'Run the auth_login tool to authenticate.',\n });\n this.name = 'McpAuthError';\n }\n}\n\nexport class McpInternalError extends Error {\n public override readonly cause: unknown;\n\n constructor(message: string, cause?: unknown) {\n super(message);\n this.name = 'McpInternalError';\n this.cause = cause;\n }\n}\n","/**\n * Tool / resource / prompt naming helpers.\n *\n * Mandatory product prefix avoids collisions when Claude Desktop runs\n * multiple MCP servers concurrently (typical setup is ~6).\n *\n * Tool names are capped at 63 characters — Claude Desktop pre-1.x\n * truncated at 64 in some versions.\n */\n\nimport { McpInternalError } from './errors.js';\n\nconst MAX_TOOL_NAME_LENGTH = 63;\n\nfunction assertSafeName(name: string, kind: 'tool' | 'resource' | 'prompt'): string {\n if (kind === 'tool' && name.length > MAX_TOOL_NAME_LENGTH) {\n throw new McpInternalError(\n `Tool name '${name}' exceeds ${MAX_TOOL_NAME_LENGTH} characters (some MCP clients truncate at 64).`,\n );\n }\n return name;\n}\n\n/**\n * Build a tool name. Format: `<productName>_<...parts>` (snake_case).\n * Example: mcpToolName('vibecontrols', 'vibes', 'list') -> 'vibecontrols_vibes_list'\n */\nexport function mcpToolName(productName: string, ...parts: string[]): string {\n if (!productName) {\n throw new McpInternalError('mcpToolName: productName is required');\n }\n const name = [productName, ...parts].filter(Boolean).join('_');\n return assertSafeName(name, 'tool');\n}\n\n/**\n * Build a resource URI. Format: `<productName>://<...parts>`.\n * Example: mcpResourceUri('vibecontrols', 'schema') -> 'vibecontrols://schema'\n */\nexport function mcpResourceUri(productName: string, ...parts: string[]): string {\n if (!productName) {\n throw new McpInternalError('mcpResourceUri: productName is required');\n }\n return `${productName}://${parts.filter(Boolean).join('/')}`;\n}\n\n/**\n * Build a prompt name. Format: `<productName>-<...parts>` (kebab-case).\n * Example: mcpPromptName('vibecontrols', 'setup') -> 'vibecontrols-setup'\n */\nexport function mcpPromptName(productName: string, ...parts: string[]): string {\n if (!productName) {\n throw new McpInternalError('mcpPromptName: productName is required');\n }\n return [productName, ...parts].filter(Boolean).join('-');\n}\n\nexport const TOOL_NAME_LIMIT = MAX_TOOL_NAME_LENGTH;\n\n/**\n * Name-based hint heuristics for MCP `annotations` (readOnlyHint /\n * destructiveHint). Used by tool-governance.ts to auto-fill annotations for\n * the fleet of product modules that call `server.registerTool` directly\n * (bypassing the `registerTool()` core helper) and so never set them\n * explicitly today (BOFF-3903). Deliberately conservative — matched against\n * whole `_`-delimited segments so e.g. `timeentries_delete` and\n * `pomodoro_delete_goal` match, but a hypothetical `undeletable_check`\n * would not.\n *\n * A module can always override the inference by passing an explicit\n * `annotations` object to `registerTool()` / `server.registerTool()`.\n */\nconst DESTRUCTIVE_NAME_SEGMENT = /(?:^|_)delete(?:_|$)/i;\nconst READ_ONLY_NAME_SEGMENT = /(?:^|_)(?:list|get|search|check|read|count|stats|by_date)(?:_|$)/i;\n\n/** True when a tool name looks destructive (irreversibly deletes data) by naming convention. */\nexport function inferDestructiveHint(toolName: string): boolean {\n return DESTRUCTIVE_NAME_SEGMENT.test(toolName);\n}\n\n/**\n * True when a tool name looks read-only by naming convention. Never true for\n * a name that also looks destructive (a tool can't be both).\n */\nexport function inferReadOnlyHint(toolName: string): boolean {\n return !inferDestructiveHint(toolName) && READ_ONLY_NAME_SEGMENT.test(toolName);\n}\n","/**\n * MCP tool result helpers + central handler.\n *\n * Modules NEVER call server.registerTool directly — they use registerTool()\n * from this module so the central try/catch wraps the handler and:\n * - maps thrown McpUserError / McpAuthError / McpInternalError to\n * MCP-protocol-compliant `{ isError: true, content: [...] }` shapes\n * - threads `_meta.progressToken` into ctx.progress for long ops\n * - emits a structured log line on every error\n * - never leaks `cause` from McpInternalError to the client\n *\n * This is the analog of cli-sdk's createProgram() central error handler.\n */\n\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport type { ZodRawShape } from 'zod';\nimport type { McpContext } from './context.js';\nimport { McpAuthError, McpInternalError, McpUserError } from './errors.js';\nimport type { ToolAnnotations } from './tool-governance.js';\n\nexport interface ToolTextContent {\n type: 'text';\n text: string;\n [k: string]: unknown;\n}\n\nexport interface ToolResult {\n content: ToolTextContent[];\n isError?: boolean;\n structuredContent?: Record<string, unknown>;\n [k: string]: unknown;\n}\n\nexport interface ToolMeta {\n progressToken?: string | number;\n}\n\n/**\n * Build a successful tool result with JSON content (pretty-printed).\n */\nexport function jsonResult(data: unknown, structured?: Record<string, unknown>): ToolResult {\n const result: ToolResult = {\n content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],\n };\n if (structured !== undefined) {\n result.structuredContent = structured;\n }\n return result;\n}\n\n/**\n * Build a successful tool result with plain text content.\n */\nexport function textResult(text: string): ToolResult {\n return { content: [{ type: 'text', text }] };\n}\n\n/**\n * Build an error tool result. Honors MCP's `{ isError: true, content }` shape.\n * Optional hint is appended on a new line so the LLM can react.\n */\nexport function errorResult(message: string, hint?: string): ToolResult {\n const text = hint ? `${message}\\n\\nHint: ${hint}` : message;\n return { content: [{ type: 'text', text }], isError: true };\n}\n\nexport interface ToolMetadata {\n title: string;\n description: string;\n inputSchema?: ZodRawShape;\n /**\n * Explicit MCP annotations (readOnlyHint / destructiveHint / ...). Optional\n * — when omitted, `wrapServerWithToolGovernance` (applied centrally in\n * `createMcpServer`) infers them from the tool name. Set this to override\n * the inference for a tool whose name doesn't match the naming convention.\n */\n annotations?: ToolAnnotations;\n}\n\nexport type ToolHandler<TArgs = Record<string, unknown>> = (\n args: TArgs,\n ctx: McpContext,\n meta: ToolMeta,\n) => Promise<unknown>;\n\n/**\n * Register a tool with the central error wrapper.\n *\n * The handler returns a plain value or void. The wrapper:\n * - wraps non-undefined returns in jsonResult()\n * - if the value already looks like a ToolResult (has `content`), passes through\n * - catches McpAuthError / McpUserError / McpInternalError / generic Error\n * - logs every error via ctx.logger.error\n */\nexport function registerTool<TArgs extends Record<string, unknown>>(\n server: McpServer,\n ctx: McpContext,\n name: string,\n metadata: ToolMetadata,\n handler: ToolHandler<TArgs>,\n): void {\n const sdkConfig = {\n title: metadata.title,\n description: metadata.description,\n ...(metadata.inputSchema ? { inputSchema: metadata.inputSchema } : {}),\n ...(metadata.annotations ? { annotations: metadata.annotations } : {}),\n };\n\n // The MCP SDK's registerTool signature is `(name, config, handler)`. The\n // handler arity depends on whether inputSchema is present (1-arg without,\n // 2-arg with). We accept a unified handler shape and dispatch at runtime.\n // The SDK's typing is strict and conditional on the inputSchema generic;\n // bypass with a cast since runtime acceptance is unconditional.\n const wrapped = async (...callbackArgs: unknown[]): Promise<ToolResult> => {\n const hasArgs = callbackArgs.length === 2;\n const args = (hasArgs ? callbackArgs[0] : {}) as TArgs;\n const extra = (hasArgs ? callbackArgs[1] : callbackArgs[0]) as\n { _meta?: { progressToken?: string | number } } | undefined;\n\n const progressToken = extra?._meta?.progressToken;\n const meta: ToolMeta = progressToken !== undefined ? { progressToken } : {};\n\n try {\n const result = await handler(args, ctx, meta);\n if (isToolResult(result)) return result;\n if (result === undefined) return textResult('OK');\n return jsonResult(result);\n } catch (error) {\n return mapErrorToResult(error, ctx, name);\n }\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (server as any).registerTool(name, sdkConfig, wrapped);\n}\n\nfunction isToolResult(value: unknown): value is ToolResult {\n return (\n !!value &&\n typeof value === 'object' &&\n 'content' in value &&\n Array.isArray((value as ToolResult).content)\n );\n}\n\nfunction mapErrorToResult(error: unknown, ctx: McpContext, toolName: string): ToolResult {\n if (error instanceof McpAuthError) {\n ctx.logger.warn(`${toolName}: auth required`, { message: error.message });\n return errorResult(error.message, error.hint);\n }\n if (error instanceof McpUserError) {\n ctx.logger.info(`${toolName}: user error`, { message: error.message });\n return errorResult(error.message, error.hint);\n }\n if (error instanceof McpInternalError) {\n ctx.logger.error(`${toolName}: internal error`, {\n message: error.message,\n cause: stringifyCause(error.cause),\n });\n return errorResult(`Internal error in ${toolName}.`);\n }\n const message = error instanceof Error ? error.message : String(error);\n ctx.logger.error(`${toolName}: unhandled error`, { message });\n return errorResult(`${toolName}: ${message}`);\n}\n\nfunction stringifyCause(cause: unknown): string | undefined {\n if (cause === undefined || cause === null) return undefined;\n if (cause instanceof Error) return cause.message;\n try {\n return JSON.stringify(cause);\n } catch {\n return String(cause);\n }\n}\n","/**\n * FluidGrids GraphQL operations (BOFF-7088).\n *\n * Ported verbatim from \\`@fluidgrids/sdk\\` (fluidgrids-sdk-node) \\`src/graphql/\\`,\n * which validates every one of these documents against vendored snapshots of the\n * deployed supergraphs in CI. Do not hand-edit a document here without making the\n * same change there -- the SDK is the source of truth and the only place the\n * documents are schema-checked.\n *\n * Every operation below is WORKSPACE tier (\\`ctx.gql.workspace\\`). Authentication,\n * \\`currentUser\\` and \\`health\\` are global tier and are already served by the\n * \\`auth\\` and \\`health\\` modules -- they are deliberately not duplicated here.\n */\n\n// Workflows\n// `Query.workflows` also exists on the workspace supergraph, but it belongs to a\n// different subgraph and returns BigConsole's `FluidGridsWorkflow` (linkedDataSinks,\n// externalWorkflowId) — a name collision, not our type. FluidGrids workflows are\n// `workflowDefinition` / `workflowDefinitions`, returning `WorkflowDefinition`.\nexport const LIST_WORKFLOWS = `\n query ListWorkflows($input: ListWorkflowDefinitionsInput!) {\n workflowDefinitions(input: $input) {\n items {\n id\n workflowKey\n name\n description\n version\n status\n category\n tags\n isActive\n totalVersions\n createdAt\n updatedAt\n }\n total\n hasMore\n }\n }\n`;\n\nexport const GET_WORKFLOW = `\n query GetWorkflow($id: ID, $workflowKey: String, $version: String) {\n workflowDefinition(id: $id, workflowKey: $workflowKey, version: $version) {\n id\n workflowKey\n name\n description\n version\n status\n category\n tags\n icon\n isActive\n totalVersions\n definitionJson\n createdAt\n updatedAt\n }\n }\n`;\n\n// Keyed by workflowKey, not workflowId, and returns a plain array.\nexport const GET_WORKFLOW_VERSIONS = `\n query GetWorkflowVersions($workflowKey: String!) {\n workflowVersions(workflowKey: $workflowKey) {\n id\n workflowKey\n name\n description\n version\n status\n category\n tags\n icon\n isActive\n totalVersions\n createdAt\n updatedAt\n }\n }\n`;\n\n// Runs\nexport const LIST_RUNS = `\n query ListRuns($input: ListWorkflowRunsInput!) {\n workflowRuns(input: $input) {\n items {\n id\n workflowId\n workflowKey\n version\n status\n startedAt\n completedAt\n duration\n triggeredById\n errorMessage\n errorType\n progress\n totalNodes\n completedNodes\n failedNodes\n }\n total\n hasMore\n }\n }\n`;\n\nexport const GET_RUN = `\n query GetRun($id: ID!) {\n workflowRun(id: $id) {\n id\n workflowId\n workflowKey\n version\n status\n startedAt\n completedAt\n duration\n triggeredById\n triggerData\n triggerNodeId\n errorMessage\n errorType\n progress\n totalNodes\n completedNodes\n failedNodes\n skippedNodes\n nodeStates {\n nodeId\n nodeType\n status\n error\n output\n }\n }\n }\n`;\n\nexport const GET_RUN_LOGS = `\n query GetRunLogs(\n $runId: ID!\n $nodeId: String\n $minLevel: RunLogLevel\n $limit: Int\n $after: String\n $search: String\n $includeChildRuns: Boolean\n ) {\n workflowRunLogs(\n runId: $runId\n nodeId: $nodeId\n minLevel: $minLevel\n limit: $limit\n after: $after\n search: $search\n includeChildRuns: $includeChildRuns\n ) {\n lines {\n id\n runId\n nodeId\n level\n message\n timestamp\n data\n attempt\n phase\n stream\n truncated\n }\n hasMore\n nextCursor\n limitReached\n }\n }\n`;\n\n// Nodes\n// `nodes` is not a Query field. Node definitions are `nodeEndpointConfig(s)`, and the\n// response is { configs, pagination } — not { items, total, hasMore }.\nexport const LIST_NODES = `\n query ListNodes(\n $nodeType: String\n $publishType: PublishType\n $status: NodeConfigStatus\n $pagination: WorkflowPaginationInput\n ) {\n nodeEndpointConfigs(\n nodeType: $nodeType\n publishType: $publishType\n status: $status\n pagination: $pagination\n ) {\n configs {\n id\n nodeType\n nodeVersion\n name\n description\n category\n icon\n logo\n keywords\n kind\n author\n publishType\n status\n isLatest\n endpointUrl\n operations\n supportsAdapterMode\n adapterOutputType\n createdAt\n updatedAt\n }\n pagination {\n total\n limit\n offset\n hasMore\n }\n }\n }\n`;\n\n// Keyed by nodeType + nodeVersion, NOT by id.\nexport const GET_NODE = `\n query GetNode($nodeType: String!, $nodeVersion: String!) {\n nodeEndpointConfig(nodeType: $nodeType, nodeVersion: $nodeVersion) {\n id\n nodeType\n nodeVersion\n name\n description\n category\n icon\n logo\n keywords\n kind\n author\n publishType\n status\n isLatest\n endpointUrl\n operations\n supportsAdapterMode\n adapterOutputType\n createdAt\n updatedAt\n healthCheckUrl\n nodeAdapters\n }\n }\n`;\n\n// LIST_NODE_CATEGORIES removed: `nodeCategories` exists on neither supergraph and has\n// no equivalent. Categories are a field on NodeEndpointConfig; derive them client-side.\n// Credentials\n// In FluidGrids a \"credential\" is a CONNECTION (wspace-integrations-svc), and the\n// catalogue of what kinds you can create are PROVIDERS. There is no `credentials`\n// field on either supergraph.\n//\n// ★ getConnection/createConnection/updateConnection/deleteConnection/testConnection\n// ALSO exist on the GLOBAL tier, returning ChannelConnection — a different product,\n// with colliding input type names and different fields. These documents are pinned to\n// the workspace tier, which is the SDK's default endpoint. Do not \"fix\" a failure here\n// by pointing at global; it would parse, execute, and return the wrong product's data.\nexport const LIST_CREDENTIALS = `\n query ListCredentials($filter: ConnectionFilterInput, $pagination: IntegrationsPaginationInput) {\n getConnections(filter: $filter, pagination: $pagination) {\n items {\n id\n name\n description\n status\n providerId\n provider {\n id\n key\n name\n category\n authType\n icon\n }\n credentialSource\n externalAccountId\n externalAccountName\n externalAccountEmail\n grantedScopes\n lastUsedAt\n lastHealthCheck\n errorMessage\n createdAt\n updatedAt\n }\n total\n hasMore\n }\n }\n`;\n\nexport const GET_CREDENTIAL = `\n query GetCredential($id: ID!) {\n getConnection(id: $id) {\n id\n name\n description\n status\n providerId\n provider {\n id\n key\n name\n description\n category\n authType\n configSchema\n availableScopes\n defaultScopes\n icon\n docsUrl\n }\n config\n metadata\n credentialSource\n externalAccountId\n externalAccountName\n externalAccountEmail\n grantedScopes\n lastUsedAt\n lastHealthCheck\n errorMessage\n workspaceId\n createdAt\n updatedAt\n }\n }\n`;\n\n// Returns a PAGE (ProviderList), not an array — the catalogue defaults to limit 50.\nexport const LIST_CREDENTIAL_TYPES = `\n query ListCredentialTypes($filter: ProviderFilterInput, $pagination: IntegrationsPaginationInput) {\n getProviders(filter: $filter, pagination: $pagination) {\n items {\n id\n key\n name\n description\n category\n authType\n configSchema\n availableScopes\n defaultScopes\n icon\n docsUrl\n isBuiltIn\n isEnabled\n connectionCount\n }\n total\n hasMore\n }\n }\n`;\n\n// Webhooks\n// A FluidGrids webhook is an EVENT REGISTRATION — it binds a workflowKey and a\n// triggerNodeId to a webhookUrl/webhookToken.\n//\n// ★ Query.webhooks ALSO exists and returns type Webhook, but that is a different\n// subgraph's OUTBOUND delivery system (agentIds, retryPolicy, deliveryCount, and a\n// neighbouring webhookExecutions taking CalendarPaginationInput). It has no\n// workflowKey and is not ours. Do not \"fix\" a failure here by switching to it.\nexport const LIST_WEBHOOKS = `\n query ListWebhooks($status: EventStatus, $workflowKey: String) {\n eventRegistrations(status: $status, workflowKey: $workflowKey) {\n id\n name\n description\n workflowKey\n triggerNodeId\n eventSource\n eventType\n status\n isActive\n webhookUrl\n webhookToken\n validationMethod\n signatureHeader\n apiKeyHeader\n payloadMapping\n config\n tags\n totalTriggers\n successfulTriggers\n failedTriggers\n lastTriggeredAt\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const GET_WEBHOOK = `\n query GetWebhook($id: ID!) {\n eventRegistration(id: $id) {\n id\n name\n description\n workflowKey\n triggerNodeId\n eventSource\n eventType\n status\n isActive\n webhookUrl\n webhookToken\n validationMethod\n signatureHeader\n apiKeyHeader\n payloadMapping\n config\n tags\n totalTriggers\n successfulTriggers\n failedTriggers\n lastTriggeredAt\n createdAt\n updatedAt\n projectId\n workspaceId\n createdById\n }\n }\n`;\n\n// Scheduled Jobs\n// ★ `scheduledJobs` also exists and returns ScheduledJob — the GENERIC platform\n// scheduler (cronExpression, executorType, circuitBreaker, rrule, businessCalendarId).\n// That is a different service. FluidGrids workflow crons are workflowScheduledJob(s),\n// whose type carries workflowKey/schedule/enabled/nextRun.\n// Note the response field is `jobs`, not `items`.\nexport const LIST_SCHEDULED_JOBS = `\n query ListScheduledJobs($enabled: Boolean, $workflowKey: String, $pagination: WorkflowPaginationInput) {\n workflowScheduledJobs(enabled: $enabled, workflowKey: $workflowKey, pagination: $pagination) {\n jobs {\n id\n name\n workflowKey\n version\n schedule\n enabled\n nextRun\n lastRun\n config\n createdAt\n updatedAt\n }\n pagination {\n total\n limit\n offset\n hasMore\n }\n }\n }\n`;\n\n// Argument is `jobId`, not `id`.\nexport const GET_SCHEDULED_JOB = `\n query GetScheduledJob($jobId: ID!) {\n workflowScheduledJob(jobId: $jobId) {\n id\n name\n workflowKey\n version\n schedule\n enabled\n nextRun\n lastRun\n config\n createdAt\n updatedAt\n workspaceId\n }\n }\n`;\n\n// Dashboard\nexport const GET_DASHBOARD_SUMMARY = `\n query DashboardSummary($projectId: String) {\n dashboardSummary(projectId: $projectId) {\n userId\n username\n workflowsCount\n activeWorkflowsCount\n archivedWorkflowsCount\n runsCountTotal\n runsCompletedCount\n runsFailedCount\n runsCancelledCount\n runsPendingCount\n runsRunningCount\n runsWaitingCount\n runsCompletedLast24h\n runsFailedLast24h\n runsCompletedLast7d\n runsFailedLast7d\n runsCompletedLast30d\n runsFailedLast30d\n totalNodesExecutedCount\n workflowSuccessRate\n avgWorkflowExecutionTimeSeconds\n avgNodeExecutionTimeSeconds\n recentRuns {\n id\n workflowKey\n version\n status\n startedAt\n completedAt\n duration\n }\n recentWorkflows {\n workflowKey\n name\n version\n updatedAt\n }\n nodeUsageStats {\n nodeType\n totalExecutions\n successCount\n failureCount\n avgExecutionTime\n }\n }\n }\n`;\n\nexport const GET_USAGE_METRICS = `\n query GetUsageMetrics($input: UsageQueryInput!) {\n usageMetrics(input: $input) {\n period\n workflowMetrics {\n totalRuns\n successfulRuns\n failedRuns\n cancelledRuns\n totalDurationSeconds\n averageDurationSeconds\n minDurationSeconds\n maxDurationSeconds\n medianDurationSeconds\n }\n nodeMetrics {\n totalNodes\n successfulNodes\n failedNodes\n skippedNodes\n totalDurationSeconds\n averageDurationSeconds\n nodeTypeBreakdown\n }\n }\n }\n`;\n\n// Events have no FluidGrids equivalent. `Query.events(calendarId: ID!)` belongs to\n// the calendar service and returns an EventConnection of CalendarEvent. FluidGrids'\n// only event noun is EventRegistration, which `webhooks` already owns.\n// Search\nexport const SEARCH = `\n query Search($input: SearchRequestInput!) {\n search(input: $input) {\n query\n results\n entityCounts\n totalResults\n metadata\n }\n }\n`;\n\nexport const SEARCH_BY_ENTITY_TYPE = `\n query SearchByEntityType($entityType: String!, $query: String!, $filters: SearchFilterInput, $limit: Int, $offset: Int) {\n searchByEntityType(entityType: $entityType, query: $query, filters: $filters, limit: $limit, offset: $offset) {\n query\n results\n entityCounts\n totalResults\n metadata\n }\n }\n`;\n\n// Admin\nexport const GET_SYSTEM_CONFIG = `\n query GetSystemConfig {\n systemConfig {\n version\n revision\n environment\n deploymentType\n hostname\n hostIp\n }\n }\n`;\n\n// Workflows\n// ★★ createWorkflow / updateWorkflow / deleteWorkflow ALL exist and pass schema\n// validation — but they return FluidGridsWorkflow, which is BIGCONSOLE's datasink\n// type (linkedDataSinks, externalWorkflowId), not ours. The FluidGrids workflow CRUD\n// is the *WorkflowDefinition family. This is why \"the operation validates\" is not\n// sufficient evidence: the RETURN TYPE has to be ours too.\nexport const CREATE_WORKFLOW = `\n mutation CreateWorkflow($input: CreateWorkflowDefinitionInput!) {\n createWorkflowDefinition(input: $input) {\n id\n workflowKey\n name\n description\n version\n status\n category\n tags\n icon\n isActive\n totalVersions\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const UPDATE_WORKFLOW = `\n mutation UpdateWorkflow($id: ID!, $input: UpdateWorkflowDefinitionInput!) {\n updateWorkflowDefinition(id: $id, input: $input) {\n id\n workflowKey\n name\n description\n version\n status\n category\n tags\n icon\n isActive\n totalVersions\n createdAt\n updatedAt\n }\n }\n`;\n\n// Keyed by workflowKey (+ optional version), not id.\nexport const DELETE_WORKFLOW = `\n mutation DeleteWorkflow($workflowKey: String!, $version: String) {\n deleteWorkflowDefinition(workflowKey: $workflowKey, version: $version)\n }\n`;\n\n// Everything moves into a single input; there is no `id` argument.\nexport const TRIGGER_WORKFLOW = `\n mutation TriggerWorkflow($input: TriggerWorkflowInput!) {\n triggerWorkflow(input: $input) {\n runId\n status\n workflowKey\n version\n triggerNodeId\n }\n }\n`;\n\n// One argument. There is no changeLog.\nexport const PUBLISH_WORKFLOW = `\n mutation PublishWorkflow($id: ID!) {\n publishWorkflow(id: $id) {\n id\n workflowKey\n name\n description\n version\n status\n category\n tags\n icon\n isActive\n totalVersions\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const ACTIVATE_WORKFLOW = `\n mutation ActivateWorkflow($id: ID!) {\n activateWorkflowDefinition(id: $id) {\n id\n workflowKey\n name\n description\n version\n status\n category\n tags\n icon\n isActive\n totalVersions\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const DEACTIVATE_WORKFLOW = `\n mutation DeactivateWorkflow($id: ID!) {\n deactivateWorkflowDefinition(id: $id) {\n id\n workflowKey\n name\n description\n version\n status\n category\n tags\n icon\n isActive\n totalVersions\n createdAt\n updatedAt\n }\n }\n`;\n\n// Keyed by workflowKey + version, with the new identity in the input.\nexport const DUPLICATE_WORKFLOW = `\n mutation DuplicateWorkflow($workflowKey: String!, $version: String!, $input: DuplicateWorkflowInput!) {\n duplicateWorkflow(workflowKey: $workflowKey, version: $version, input: $input) {\n success\n message\n workflow {\n id\n workflowKey\n name\n description\n version\n status\n category\n tags\n icon\n isActive\n totalVersions\n createdAt\n updatedAt\n }\n }\n }\n`;\n\nexport const ARCHIVE_WORKFLOW = `\n mutation ArchiveWorkflow($id: ID!) {\n archiveWorkflow(id: $id) {\n id\n status\n }\n }\n`;\n\n// Runs\nexport const CANCEL_RUN = `\n mutation CancelRun($id: ID!) {\n cancelWorkflowRun(id: $id) {\n id\n status\n completedAt\n errorMessage\n }\n }\n`;\n\nexport const PAUSE_RUN = `\n mutation PauseRun($id: ID!) {\n pauseWorkflowRun(id: $id) {\n id\n status\n completedAt\n errorMessage\n }\n }\n`;\n\n// resumeWorkflowRun returns ResumeWorkflowResponse (success/message/run), not a run.\nexport const RESUME_RUN = `\n mutation ResumeRun($id: ID!, $payload: JSON) {\n resumeWorkflowRun(id: $id, payload: $payload) {\n success\n message\n resumedFromNodeId\n run {\n id\n status\n completedAt\n errorMessage\n }\n }\n }\n`;\n\n// There is no run-level retry. The schema exposes `retryNode(id, nodeId)`, which\n// retries ONE node and returns a NodeState — so nodeId is required, not optional,\n// and the return type is not a run.\nexport const RETRY_RUN = `\n mutation RetryNode($id: ID!, $nodeId: String!) {\n retryNode(id: $id, nodeId: $nodeId) {\n id\n nodeId\n nodeType\n status\n error\n attemptCount\n }\n }\n`;\n\n// Credentials\n// ★ Creating a credential is a TWO-STEP flow. CreateConnectionInput has no `data`\n// and no `type` — there is no way to post raw secret material here. You create the\n// connection shell against a providerId, then attach the secret with one of the\n// authenticate* mutations below (or reference an existing vault secret at create time\n// via credentialSecretId / managedSecretName / vaultId).\nexport const CREATE_CREDENTIAL = `\n mutation CreateCredential($input: CreateConnectionInput!) {\n createConnection(input: $input) {\n id\n name\n description\n status\n providerId\n provider {\n id\n key\n name\n authType\n }\n credentialSource\n createdAt\n }\n }\n`;\n\nexport const AUTHENTICATE_CREDENTIAL_API_KEY = `\n mutation AuthenticateCredentialApiKey($input: ApiKeyAuthInput!) {\n authenticateWithApiKey(input: $input) {\n id\n name\n status\n grantedScopes\n externalAccountName\n errorMessage\n updatedAt\n }\n }\n`;\n\nexport const AUTHENTICATE_CREDENTIAL_BASIC = `\n mutation AuthenticateCredentialBasic($input: BasicAuthInput!) {\n authenticateWithBasicAuth(input: $input) {\n id\n name\n status\n grantedScopes\n externalAccountName\n errorMessage\n updatedAt\n }\n }\n`;\n\n// UpdateConnectionInput carries only { config, description, name } — secrets are\n// never updated through this path.\nexport const UPDATE_CREDENTIAL = `\n mutation UpdateCredential($id: ID!, $input: UpdateConnectionInput!) {\n updateConnection(id: $id, input: $input) {\n id\n name\n description\n status\n config\n updatedAt\n }\n }\n`;\n\nexport const DELETE_CREDENTIAL = `\n mutation DeleteCredential($id: ID!, $deleteVaultSecret: Boolean) {\n deleteConnection(id: $id, deleteVaultSecret: $deleteVaultSecret)\n }\n`;\n\n// Argument is `connectionId`, not `id`.\nexport const TEST_CREDENTIAL = `\n mutation TestCredential($connectionId: ID!) {\n testConnection(connectionId: $connectionId) {\n success\n message\n latencyMs\n }\n }\n`;\n\n// Webhooks\nexport const CREATE_WEBHOOK = `\n mutation CreateWebhook($input: CreateEventRegistrationInput!) {\n createEventRegistration(input: $input) {\n id\n name\n workflowKey\n triggerNodeId\n isActive\n status\n webhookUrl\n webhookToken\n updatedAt\n createdAt\n }\n }\n`;\n\n// ★ The previous UPDATE_WEBHOOK targeted `updateWebhook(id, input): Webhook!`, which\n// EXISTS and therefore passed schema validation — but returns the other subgraph's\n// Webhook, not our EventRegistration. Validation passing is not the same as being\n// correct; the return type has to be ours too. Same for the old deleteWebhook.\nexport const UPDATE_WEBHOOK = `\n mutation UpdateWebhook($id: ID!, $input: UpdateEventRegistrationInput!) {\n updateEventRegistration(id: $id, input: $input) {\n id\n name\n workflowKey\n triggerNodeId\n isActive\n status\n webhookUrl\n webhookToken\n updatedAt\n }\n }\n`;\n\nexport const DELETE_WEBHOOK = `\n mutation DeleteWebhook($id: ID!) {\n deleteEventRegistration(id: $id)\n }\n`;\n\n// activate and deactivate are the SAME mutation with a flag.\nexport const TOGGLE_WEBHOOK = `\n mutation ToggleWebhook($id: ID!, $isActive: Boolean!) {\n toggleEventRegistration(id: $id, isActive: $isActive) {\n id\n name\n workflowKey\n triggerNodeId\n isActive\n status\n webhookUrl\n webhookToken\n updatedAt\n }\n }\n`;\n\n// DEACTIVATE_WEBHOOK removed — see TOGGLE_WEBHOOK above.\n// Scheduled Jobs\nexport const CREATE_SCHEDULED_JOB = `\n mutation CreateScheduledJob($input: ScheduledJobInput!) {\n createWorkflowScheduledJob(input: $input) {\n success\n message\n job {\n id\n name\n workflowKey\n version\n schedule\n enabled\n nextRun\n lastRun\n config\n createdAt\n updatedAt\n }\n }\n }\n`;\n\nexport const UPDATE_SCHEDULED_JOB = `\n mutation UpdateScheduledJob($id: ID!, $input: WorkflowUpdateScheduledJobInput!) {\n updateWorkflowScheduledJob(id: $id, input: $input) {\n success\n message\n job {\n id\n name\n workflowKey\n version\n schedule\n enabled\n nextRun\n lastRun\n config\n createdAt\n updatedAt\n }\n }\n }\n`;\n\nexport const DELETE_SCHEDULED_JOB = `\n mutation DeleteScheduledJob($jobId: ID!) {\n deleteWorkflowScheduledJob(jobId: $jobId) {\n success\n message\n }\n }\n`;\n","/**\n * Internal helpers shared by the FluidGrids tool files.\n *\n * These keep each registration explicit (literal product-prefixed names via\n * mcpToolName, typed inputSchema, jsonResult/errorResult) while factoring out\n * the repetitive try/catch + structured-logging + input-pruning boilerplate.\n * Mirrors src/modules/headshotmarketing/tools/helpers.ts.\n *\n * Every FluidGrids operation is workspace tier, so `request` always goes to\n * `ctx.gql.workspace`. See ../operations.ts for why.\n */\n\nimport { errorResult, type McpContext, type ToolResult } from '../../../core/index.js';\n\n/**\n * graphql-request's ClientError builds its `message` as\n * `<gql error>: ${JSON.stringify({ response, request })}` — and `request`\n * carries the operation's **variables**. For this module that means an API key\n * (credentials_auth_api_key) or a password (credentials_auth_basic) would land\n * in the log line and in the text returned to the MCP client.\n *\n * So never surface `error.message` from a transport error. When the error looks\n * like a ClientError, report only the GraphQL error messages from the response;\n * the request half is dropped entirely. Same defect class as BOFF-7165.\n */\nfunction isClientErrorShape(\n error: unknown,\n): error is { response?: { errors?: { message?: string }[]; status?: number } } {\n return typeof error === 'object' && error !== null && 'response' in error && 'request' in error;\n}\n\nexport function safeErrorMessage(error: unknown): string {\n if (isClientErrorShape(error)) {\n const errors = error.response?.errors;\n if (Array.isArray(errors) && errors.length > 0) {\n const joined = errors\n .map((e) => e?.message)\n .filter((m): m is string => typeof m === 'string' && m.length > 0)\n .join('; ');\n if (joined) return joined;\n }\n const status = error.response?.status;\n return status === undefined ? 'GraphQL request failed' : `GraphQL error (status ${status})`;\n }\n return error instanceof Error ? error.message : String(error);\n}\n\n/**\n * Run a tool body, mapping any thrown error to a uniform error ToolResult and\n * logging it under the module-prefixed label. `label` is the short tool suffix\n * (e.g. 'workflows_get').\n */\nexport async function runTool(\n ctx: McpContext,\n label: string,\n run: () => Promise<ToolResult>,\n): Promise<ToolResult> {\n try {\n return await run();\n } catch (error) {\n const message = safeErrorMessage(error);\n ctx.logger.error(`fluidgrids ${label} failed`, { error: message });\n return errorResult(`Failed (${label}): ${message}`);\n }\n}\n\n/** Copy only the defined (non-undefined) entries into a fresh object. */\nexport function definedInput(obj: Record<string, unknown>): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(obj)) {\n if (value !== undefined) out[key] = value;\n }\n return out;\n}\n\n/**\n * Build a WorkflowPaginationInput, or undefined when the caller passed neither\n * bound. Sending `{}` would override the schema's own defaults with nulls.\n */\nexport function workflowPagination(\n limit?: number,\n offset?: number,\n): Record<string, unknown> | undefined {\n if (limit === undefined && offset === undefined) return undefined;\n return definedInput({ limit, offset });\n}\n","import { z } from 'zod';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { jsonResult, mcpToolName, type McpContext } from '../../../core/index.js';\nimport {\n AUTHENTICATE_CREDENTIAL_API_KEY,\n AUTHENTICATE_CREDENTIAL_BASIC,\n CREATE_CREDENTIAL,\n DELETE_CREDENTIAL,\n GET_CREDENTIAL,\n LIST_CREDENTIALS,\n LIST_CREDENTIAL_TYPES,\n TEST_CREDENTIAL,\n UPDATE_CREDENTIAL,\n} from '../operations.js';\nimport { definedInput, runTool } from './helpers.js';\n\n// FluidGrids credentials are Connections against a Provider, served by the\n// integrations subgraph. There is no `credential`/`credentialType` field on the\n// deployed schema — that naming is what made the old SDK documents unexecutable.\nfunction pagination(limit?: number, offset?: number): Record<string, unknown> | undefined {\n if (limit === undefined && offset === undefined) return undefined;\n return definedInput({ limit, offset });\n}\n\nexport function registerCredentialTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n server.registerTool(\n track(mcpToolName(ctx.productName, 'credentials_list')),\n {\n title: 'List Credentials',\n description: 'List stored connections (credentials) available to workflows.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n providerId: z.string().optional().describe('Filter by provider ID'),\n name: z.string().optional().describe('Filter by name'),\n limit: z.number().optional().describe('Max results'),\n offset: z.number().optional().describe('Offset for pagination'),\n },\n },\n async ({ providerId, name, limit, offset }) =>\n runTool(ctx, 'credentials_list', async () => {\n const filter = definedInput({ providerId, name });\n const data = await ctx.gql.workspace.request<{ getConnections: unknown }>(\n LIST_CREDENTIALS,\n {\n filter: Object.keys(filter).length > 0 ? filter : undefined,\n pagination: pagination(limit, offset),\n },\n );\n return jsonResult(data.getConnections);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'credentials_get')),\n {\n title: 'Get Credential',\n description: 'Get one connection by ID. Secret material is never returned.',\n annotations: { readOnlyHint: true },\n inputSchema: { id: z.string().describe('Connection ID') },\n },\n async ({ id }) =>\n runTool(ctx, 'credentials_get', async () => {\n const data = await ctx.gql.workspace.request<{ getConnection: unknown }>(GET_CREDENTIAL, {\n id,\n });\n return jsonResult(data.getConnection);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'credentials_list_types')),\n {\n title: 'List Credential Types',\n description: 'List the providers a connection can be created against.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n name: z.string().optional().describe('Filter by provider name'),\n limit: z.number().optional().describe('Max results'),\n offset: z.number().optional().describe('Offset for pagination'),\n },\n },\n async ({ name, limit, offset }) =>\n runTool(ctx, 'credentials_list_types', async () => {\n const filter = definedInput({ name });\n const data = await ctx.gql.workspace.request<{ getProviders: unknown }>(\n LIST_CREDENTIAL_TYPES,\n {\n filter: Object.keys(filter).length > 0 ? filter : undefined,\n pagination: pagination(limit, offset),\n },\n );\n return jsonResult(data.getProviders);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'credentials_create')),\n {\n title: 'Create Credential',\n description:\n 'Create a connection against a provider. Secrets go to the vault; pass a reference, never a raw secret in config.',\n inputSchema: {\n name: z.string().describe('Connection name'),\n providerId: z.string().describe('Provider ID'),\n description: z.string().optional().describe('Description'),\n config: z.unknown().optional().describe('Non-secret provider config as JSON'),\n context: z.unknown().optional().describe('Context JSON'),\n vaultId: z.string().optional().describe('Vault to store secret material in'),\n credentialSecretId: z.string().optional().describe('Existing vault secret reference'),\n managedSecretName: z.string().optional().describe('Managed secret name'),\n },\n },\n async (args) =>\n runTool(ctx, 'credentials_create', async () => {\n const data = await ctx.gql.workspace.request<{ createConnection: unknown }>(\n CREATE_CREDENTIAL,\n { input: definedInput({ ...args }) },\n );\n return jsonResult(data.createConnection);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'credentials_update')),\n {\n title: 'Update Credential',\n description: 'Update a connection’s name, description or non-secret config.',\n inputSchema: {\n id: z.string().describe('Connection ID'),\n name: z.string().optional().describe('Name'),\n description: z.string().optional().describe('Description'),\n config: z.unknown().optional().describe('Non-secret provider config as JSON'),\n },\n },\n async ({ id, ...input }) =>\n runTool(ctx, 'credentials_update', async () => {\n const data = await ctx.gql.workspace.request<{ updateConnection: unknown }>(\n UPDATE_CREDENTIAL,\n { id, input: definedInput(input) },\n );\n return jsonResult(data.updateConnection);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'credentials_delete')),\n {\n title: 'Delete Credential',\n description:\n 'Delete a connection. Set deleteVaultSecret to also destroy the stored secret — that is irreversible.',\n annotations: { destructiveHint: true },\n inputSchema: {\n id: z.string().describe('Connection ID'),\n deleteVaultSecret: z.boolean().optional().describe('Also delete the vault secret'),\n },\n },\n async ({ id, deleteVaultSecret }) =>\n runTool(ctx, 'credentials_delete', async () => {\n const data = await ctx.gql.workspace.request<{ deleteConnection: unknown }>(\n DELETE_CREDENTIAL,\n { id, deleteVaultSecret },\n );\n return jsonResult(data.deleteConnection);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'credentials_test')),\n {\n title: 'Test Credential',\n description: 'Verify a connection can authenticate against its provider.',\n annotations: { readOnlyHint: true },\n inputSchema: { connectionId: z.string().describe('Connection ID') },\n },\n async ({ connectionId }) =>\n runTool(ctx, 'credentials_test', async () => {\n const data = await ctx.gql.workspace.request<{ testConnection: unknown }>(TEST_CREDENTIAL, {\n connectionId,\n });\n return jsonResult(data.testConnection);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'credentials_auth_api_key')),\n {\n title: 'Authenticate Credential (API key)',\n description: 'Attach an API key to a connection via the API-key auth flow.',\n inputSchema: {\n connectionId: z.string().describe('Connection ID'),\n apiKey: z.string().describe('API key to store'),\n },\n },\n async ({ connectionId, apiKey }) =>\n runTool(ctx, 'credentials_auth_api_key', async () => {\n const data = await ctx.gql.workspace.request<{ authenticateWithApiKey: unknown }>(\n AUTHENTICATE_CREDENTIAL_API_KEY,\n { input: { connectionId, apiKey } },\n );\n return jsonResult(data.authenticateWithApiKey);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'credentials_auth_basic')),\n {\n title: 'Authenticate Credential (basic)',\n description: 'Attach basic-auth credentials to a connection.',\n inputSchema: {\n connectionId: z.string().describe('Connection ID'),\n username: z.string().describe('Username'),\n password: z.string().describe('Password'),\n },\n },\n async ({ connectionId, username, password }) =>\n runTool(ctx, 'credentials_auth_basic', async () => {\n const data = await ctx.gql.workspace.request<{ authenticateWithBasicAuth: unknown }>(\n AUTHENTICATE_CREDENTIAL_BASIC,\n { input: { connectionId, username, password } },\n );\n return jsonResult(data.authenticateWithBasicAuth);\n }),\n );\n}\n","import { z } from 'zod';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { jsonResult, mcpToolName, type McpContext } from '../../../core/index.js';\nimport {\n GET_DASHBOARD_SUMMARY,\n GET_SYSTEM_CONFIG,\n GET_USAGE_METRICS,\n SEARCH,\n SEARCH_BY_ENTITY_TYPE,\n} from '../operations.js';\nimport { definedInput, runTool } from './helpers.js';\n\n/**\n * Read-only cross-cutting tools: dashboard, usage, search and system config.\n * Grouped in one file because each is one or two operations and they share no\n * domain object with the workflow surface.\n */\nexport function registerInsightTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n server.registerTool(\n track(mcpToolName(ctx.productName, 'dashboard_summary')),\n {\n title: 'Dashboard Summary',\n description: 'Workflow, run and failure counters for the current workspace.',\n annotations: { readOnlyHint: true },\n inputSchema: { projectId: z.string().optional().describe('Scope to one project') },\n },\n async ({ projectId }) =>\n runTool(ctx, 'dashboard_summary', async () => {\n const data = await ctx.gql.workspace.request<{ dashboardSummary: unknown }>(\n GET_DASHBOARD_SUMMARY,\n { projectId },\n );\n return jsonResult(data.dashboardSummary);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'usage_metrics')),\n {\n title: 'Usage Metrics',\n description: 'Usage metrics over a date range — run minutes and execution counts.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n startDate: z.string().describe('ISO 8601 start of the range'),\n endDate: z.string().describe('ISO 8601 end of the range'),\n userId: z.string().optional().describe('Scope to one user'),\n contextFilter: z.unknown().optional().describe('Context filter as JSON'),\n },\n },\n async (args) =>\n runTool(ctx, 'usage_metrics', async () => {\n const data = await ctx.gql.workspace.request<{ usageMetrics: unknown }>(GET_USAGE_METRICS, {\n input: definedInput({ ...args }),\n });\n return jsonResult(data.usageMetrics);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'search')),\n {\n title: 'Search',\n description: 'Search across FluidGrids entities. Narrow with entityTypes when you know it.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n query: z.string().describe('Search query'),\n entityTypes: z.array(z.string()).optional().describe('Restrict to these entity types'),\n filters: z.unknown().optional().describe('Additional filters as JSON'),\n highlight: z.boolean().optional().describe('Return highlighted snippets'),\n limit: z.number().optional().describe('Max results'),\n offset: z.number().optional().describe('Offset for pagination'),\n },\n },\n async (args) =>\n runTool(ctx, 'search', async () => {\n const data = await ctx.gql.workspace.request<{ search: unknown }>(SEARCH, {\n input: definedInput({ ...args }),\n });\n return jsonResult(data.search);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'search_by_entity_type')),\n {\n title: 'Search By Entity Type',\n description: 'Search within a single entity type.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n entityType: z.string().describe('Entity type to search'),\n query: z.string().describe('Search query'),\n filters: z.unknown().optional().describe('Additional filters as JSON'),\n limit: z.number().optional().describe('Max results'),\n offset: z.number().optional().describe('Offset for pagination'),\n },\n },\n async (args) =>\n runTool(ctx, 'search_by_entity_type', async () => {\n const data = await ctx.gql.workspace.request<{ searchByEntityType: unknown }>(\n SEARCH_BY_ENTITY_TYPE,\n definedInput({ ...args }),\n );\n return jsonResult(data.searchByEntityType);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'system_config')),\n {\n title: 'System Config',\n description: 'Read the workflow engine’s effective system configuration.',\n annotations: { readOnlyHint: true },\n inputSchema: {},\n },\n async () =>\n runTool(ctx, 'system_config', async () => {\n const data = await ctx.gql.workspace.request<{ systemConfig: unknown }>(GET_SYSTEM_CONFIG);\n return jsonResult(data.systemConfig);\n }),\n );\n}\n","import { z } from 'zod';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { jsonResult, mcpToolName, type McpContext } from '../../../core/index.js';\nimport { GET_NODE, LIST_NODES } from '../operations.js';\nimport { runTool, workflowPagination } from './helpers.js';\n\nconst PublishTypeEnum = z.enum(['BUILTIN', 'CUSTOM', 'STORE']);\nconst NodeConfigStatusEnum = z.enum(['AVAILABLE', 'DEPRECATED', 'DISABLED']);\n\nexport function registerNodeTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n server.registerTool(\n track(mcpToolName(ctx.productName, 'nodes_list')),\n {\n title: 'List Nodes',\n description:\n 'List the node types available to build workflows with, from the node endpoint config registry.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n nodeType: z.string().optional().describe('Filter by node type'),\n publishType: PublishTypeEnum.optional().describe('BUILTIN, CUSTOM or STORE'),\n status: NodeConfigStatusEnum.optional().describe('Filter by availability'),\n limit: z.number().optional().describe('Max results'),\n offset: z.number().optional().describe('Offset for pagination'),\n },\n },\n async ({ nodeType, publishType, status, limit, offset }) =>\n runTool(ctx, 'nodes_list', async () => {\n const data = await ctx.gql.workspace.request<{ nodeEndpointConfigs: unknown }>(LIST_NODES, {\n nodeType,\n publishType,\n status,\n pagination: workflowPagination(limit, offset),\n });\n return jsonResult(data.nodeEndpointConfigs);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'nodes_get')),\n {\n title: 'Get Node',\n description:\n 'Get one node type at a specific version, including its input fields and operations.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n nodeType: z.string().describe('Node type identifier'),\n nodeVersion: z.string().describe('Node version'),\n },\n },\n async ({ nodeType, nodeVersion }) =>\n runTool(ctx, 'nodes_get', async () => {\n const data = await ctx.gql.workspace.request<{ nodeEndpointConfig: unknown }>(GET_NODE, {\n nodeType,\n nodeVersion,\n });\n return jsonResult(data.nodeEndpointConfig);\n }),\n );\n}\n","import { z } from 'zod';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { jsonResult, mcpToolName, type McpContext } from '../../../core/index.js';\nimport {\n CANCEL_RUN,\n GET_RUN,\n GET_RUN_LOGS,\n LIST_RUNS,\n PAUSE_RUN,\n RESUME_RUN,\n RETRY_RUN,\n} from '../operations.js';\nimport { definedInput, runTool } from './helpers.js';\n\n// The deployed RunStatus enum is UPPERCASE. Comparing against lowercase is what\n// made `fluidgrids runs wait` never terminate (BOFF-7091) — keep these exact.\nconst RunStatusEnum = z.enum([\n 'CANCELLED',\n 'COMPLETED',\n 'FAILED',\n 'PENDING',\n 'RUNNING',\n 'TERMINATED',\n 'WAITING',\n]);\nconst RunLogLevelEnum = z.enum(['DEBUG', 'ERROR', 'INFO', 'WARN']);\n\nexport function registerRunTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n server.registerTool(\n track(mcpToolName(ctx.productName, 'runs_list')),\n {\n title: 'List Runs',\n description: 'List workflow runs, optionally filtered by workflowKey and status.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n workflowKey: z.string().optional().describe('Filter by workflow key'),\n status: RunStatusEnum.optional().describe('Filter by run status'),\n limit: z.number().optional().describe('Max results (default 10)'),\n offset: z.number().optional().describe('Offset for pagination (default 0)'),\n },\n },\n async ({ workflowKey, status, limit, offset }) =>\n runTool(ctx, 'runs_list', async () => {\n const data = await ctx.gql.workspace.request<{ workflowRuns: unknown }>(LIST_RUNS, {\n input: definedInput({ workflowKey, status, limit, offset }),\n });\n return jsonResult(data.workflowRuns);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'runs_get')),\n {\n title: 'Get Run',\n description:\n 'Get one workflow run, including per-node state. Poll this to follow a run to a terminal status.',\n annotations: { readOnlyHint: true },\n inputSchema: { id: z.string().describe('Run ID') },\n },\n async ({ id }) =>\n runTool(ctx, 'runs_get', async () => {\n const data = await ctx.gql.workspace.request<{ workflowRun: unknown }>(GET_RUN, { id });\n return jsonResult(data.workflowRun);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'runs_logs')),\n {\n title: 'Get Run Logs',\n description:\n 'Read a run log, newest page first. Keyset paginated: pass the previous page cursor as `after`.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n runId: z.string().describe('Run ID'),\n nodeId: z.string().optional().describe('Restrict to one node'),\n minLevel: RunLogLevelEnum.optional().describe('Minimum log level'),\n limit: z.number().optional().describe('Max log lines'),\n after: z.string().optional().describe('Keyset cursor from a previous page'),\n search: z.string().optional().describe('Substring filter'),\n includeChildRuns: z.boolean().optional().describe('Include logs from child runs'),\n },\n },\n async (args) =>\n runTool(ctx, 'runs_logs', async () => {\n const data = await ctx.gql.workspace.request<{ workflowRunLogs: unknown }>(\n GET_RUN_LOGS,\n definedInput({ ...args }),\n );\n return jsonResult(data.workflowRunLogs);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'runs_cancel')),\n {\n title: 'Cancel Run',\n description: 'Cancel an in-flight run. Terminal runs cannot be cancelled.',\n annotations: { destructiveHint: true },\n inputSchema: { id: z.string().describe('Run ID') },\n },\n async ({ id }) =>\n runTool(ctx, 'runs_cancel', async () => {\n const data = await ctx.gql.workspace.request<{ cancelWorkflowRun: unknown }>(CANCEL_RUN, {\n id,\n });\n return jsonResult(data.cancelWorkflowRun);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'runs_pause')),\n {\n title: 'Pause Run',\n description: 'Pause a running workflow run.',\n inputSchema: { id: z.string().describe('Run ID') },\n },\n async ({ id }) =>\n runTool(ctx, 'runs_pause', async () => {\n const data = await ctx.gql.workspace.request<{ pauseWorkflowRun: unknown }>(PAUSE_RUN, {\n id,\n });\n return jsonResult(data.pauseWorkflowRun);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'runs_resume')),\n {\n title: 'Resume Run',\n description:\n 'Resume a paused or waiting run. `payload` supplies the data a Wait node is blocked on.',\n inputSchema: {\n id: z.string().describe('Run ID'),\n payload: z.unknown().optional().describe('Payload to resume with'),\n },\n },\n async ({ id, payload }) =>\n runTool(ctx, 'runs_resume', async () => {\n const data = await ctx.gql.workspace.request<{ resumeWorkflowRun: unknown }>(RESUME_RUN, {\n id,\n payload,\n });\n return jsonResult(data.resumeWorkflowRun);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'runs_retry_node')),\n {\n title: 'Retry Node',\n description: 'Re-execute one failed node within a run, continuing from there.',\n inputSchema: {\n id: z.string().describe('Run ID'),\n nodeId: z.string().describe('Node ID to retry'),\n },\n },\n async ({ id, nodeId }) =>\n runTool(ctx, 'runs_retry_node', async () => {\n const data = await ctx.gql.workspace.request<{ retryNode: unknown }>(RETRY_RUN, {\n id,\n nodeId,\n });\n return jsonResult(data.retryNode);\n }),\n );\n}\n","import { z } from 'zod';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { jsonResult, mcpToolName, type McpContext } from '../../../core/index.js';\nimport {\n CREATE_SCHEDULED_JOB,\n DELETE_SCHEDULED_JOB,\n GET_SCHEDULED_JOB,\n LIST_SCHEDULED_JOBS,\n UPDATE_SCHEDULED_JOB,\n} from '../operations.js';\nimport { definedInput, runTool, workflowPagination } from './helpers.js';\n\nexport function registerScheduledJobTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n server.registerTool(\n track(mcpToolName(ctx.productName, 'scheduled_jobs_list')),\n {\n title: 'List Scheduled Jobs',\n description: 'List schedules that trigger workflows on a cron or interval.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n enabled: z.boolean().optional().describe('Filter by enabled state'),\n workflowKey: z.string().optional().describe('Filter by workflow key'),\n limit: z.number().optional().describe('Max results'),\n offset: z.number().optional().describe('Offset for pagination'),\n },\n },\n async ({ enabled, workflowKey, limit, offset }) =>\n runTool(ctx, 'scheduled_jobs_list', async () => {\n const data = await ctx.gql.workspace.request<{ workflowScheduledJobs: unknown }>(\n LIST_SCHEDULED_JOBS,\n { enabled, workflowKey, pagination: workflowPagination(limit, offset) },\n );\n return jsonResult(data.workflowScheduledJobs);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'scheduled_jobs_get')),\n {\n title: 'Get Scheduled Job',\n description: 'Get one scheduled job by ID.',\n annotations: { readOnlyHint: true },\n inputSchema: { jobId: z.string().describe('Scheduled job ID') },\n },\n async ({ jobId }) =>\n runTool(ctx, 'scheduled_jobs_get', async () => {\n const data = await ctx.gql.workspace.request<{ workflowScheduledJob: unknown }>(\n GET_SCHEDULED_JOB,\n { jobId },\n );\n return jsonResult(data.workflowScheduledJob);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'scheduled_jobs_create')),\n {\n title: 'Create Scheduled Job',\n description:\n 'Schedule a workflow. `schedule` is the cron or interval expression the scheduler service evaluates.',\n inputSchema: {\n name: z.string().describe('Job name'),\n workflowKey: z.string().describe('Workflow key to run'),\n version: z.string().describe('Workflow version'),\n schedule: z.string().describe('Cron or interval expression'),\n enabled: z.boolean().optional().describe('Start enabled (default true)'),\n config: z.unknown().optional().describe('Job config as JSON'),\n },\n },\n async (args) =>\n runTool(ctx, 'scheduled_jobs_create', async () => {\n const data = await ctx.gql.workspace.request<{ createWorkflowScheduledJob: unknown }>(\n CREATE_SCHEDULED_JOB,\n { input: definedInput({ ...args }) },\n );\n return jsonResult(data.createWorkflowScheduledJob);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'scheduled_jobs_update')),\n {\n title: 'Update Scheduled Job',\n description: 'Update a scheduled job’s name, schedule, config or enabled state.',\n inputSchema: {\n jobId: z.string().describe('Scheduled job ID'),\n name: z.string().optional().describe('Name'),\n schedule: z.string().optional().describe('Cron or interval expression'),\n enabled: z.boolean().optional().describe('Enabled state'),\n config: z.unknown().optional().describe('Job config as JSON'),\n },\n },\n async ({ jobId, ...input }) =>\n runTool(ctx, 'scheduled_jobs_update', async () => {\n const data = await ctx.gql.workspace.request<{ updateWorkflowScheduledJob: unknown }>(\n UPDATE_SCHEDULED_JOB,\n { id: jobId, input: definedInput(input) },\n );\n return jsonResult(data.updateWorkflowScheduledJob);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'scheduled_jobs_delete')),\n {\n title: 'Delete Scheduled Job',\n description: 'Delete a scheduled job permanently.',\n annotations: { destructiveHint: true },\n inputSchema: { jobId: z.string().describe('Scheduled job ID') },\n },\n async ({ jobId }) =>\n runTool(ctx, 'scheduled_jobs_delete', async () => {\n const data = await ctx.gql.workspace.request<{ deleteWorkflowScheduledJob: unknown }>(\n DELETE_SCHEDULED_JOB,\n { jobId },\n );\n return jsonResult(data.deleteWorkflowScheduledJob);\n }),\n );\n}\n","import { z } from 'zod';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { jsonResult, mcpToolName, type McpContext } from '../../../core/index.js';\nimport {\n CREATE_WEBHOOK,\n DELETE_WEBHOOK,\n GET_WEBHOOK,\n LIST_WEBHOOKS,\n TOGGLE_WEBHOOK,\n UPDATE_WEBHOOK,\n} from '../operations.js';\nimport { definedInput, runTool } from './helpers.js';\n\n// Webhooks are EventRegistrations on the deployed schema — there is no\n// `Webhook` type with workflowId/path/method, which is what the pre-BOFF-7084\n// documents assumed.\nconst EventStatusEnum = z.enum(['ACTIVE', 'ARCHIVED', 'DISABLED', 'PAUSED']);\n\nexport function registerWebhookTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n server.registerTool(\n track(mcpToolName(ctx.productName, 'webhooks_list')),\n {\n title: 'List Webhooks',\n description: 'List event registrations (webhooks) that can trigger workflows.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n status: EventStatusEnum.optional().describe('Filter by status'),\n workflowKey: z.string().optional().describe('Filter by workflow key'),\n },\n },\n async ({ status, workflowKey }) =>\n runTool(ctx, 'webhooks_list', async () => {\n const data = await ctx.gql.workspace.request<{ eventRegistrations: unknown }>(\n LIST_WEBHOOKS,\n { status, workflowKey },\n );\n return jsonResult(data.eventRegistrations);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'webhooks_get')),\n {\n title: 'Get Webhook',\n description: 'Get one event registration by ID.',\n annotations: { readOnlyHint: true },\n inputSchema: { id: z.string().describe('Event registration ID') },\n },\n async ({ id }) =>\n runTool(ctx, 'webhooks_get', async () => {\n const data = await ctx.gql.workspace.request<{ eventRegistration: unknown }>(GET_WEBHOOK, {\n id,\n });\n return jsonResult(data.eventRegistration);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'webhooks_create')),\n {\n title: 'Create Webhook',\n description:\n 'Register an event source that triggers a workflow. triggerNodeId names the trigger node the event enters at.',\n inputSchema: {\n name: z.string().describe('Registration name'),\n workflowKey: z.string().describe('Workflow key to trigger'),\n triggerNodeId: z.string().describe('Trigger node ID'),\n eventSource: z.string().optional().describe('Event source identifier'),\n eventType: z.string().optional().describe('Event type'),\n description: z.string().optional().describe('Description'),\n config: z.unknown().optional().describe('Source-specific config as JSON'),\n payloadMapping: z.unknown().optional().describe('Payload mapping as JSON'),\n validationMethod: z.string().optional().describe('Signature validation method'),\n signatureHeader: z.string().optional().describe('Header carrying the signature'),\n apiKeyHeader: z.string().optional().describe('Header carrying the API key'),\n secretToken: z.string().optional().describe('Shared secret for validation'),\n projectId: z.string().optional().describe('Owning project ID'),\n tags: z.array(z.string()).optional().describe('Tags'),\n },\n },\n async (args) =>\n runTool(ctx, 'webhooks_create', async () => {\n const data = await ctx.gql.workspace.request<{ createEventRegistration: unknown }>(\n CREATE_WEBHOOK,\n { input: definedInput({ ...args }) },\n );\n return jsonResult(data.createEventRegistration);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'webhooks_update')),\n {\n title: 'Update Webhook',\n description: 'Update an event registration.',\n inputSchema: {\n id: z.string().describe('Event registration ID'),\n name: z.string().optional().describe('Name'),\n description: z.string().optional().describe('Description'),\n status: EventStatusEnum.optional().describe('Status'),\n isActive: z.boolean().optional().describe('Active flag'),\n config: z.unknown().optional().describe('Config as JSON'),\n payloadMapping: z.unknown().optional().describe('Payload mapping as JSON'),\n validationMethod: z.string().optional().describe('Signature validation method'),\n secretToken: z.string().optional().describe('Shared secret'),\n tags: z.array(z.string()).optional().describe('Tags'),\n },\n },\n async ({ id, ...input }) =>\n runTool(ctx, 'webhooks_update', async () => {\n const data = await ctx.gql.workspace.request<{ updateEventRegistration: unknown }>(\n UPDATE_WEBHOOK,\n { id, input: definedInput(input) },\n );\n return jsonResult(data.updateEventRegistration);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'webhooks_toggle')),\n {\n title: 'Toggle Webhook',\n description: 'Enable or disable an event registration without deleting it.',\n inputSchema: {\n id: z.string().describe('Event registration ID'),\n isActive: z.boolean().describe('True to enable, false to disable'),\n },\n },\n async ({ id, isActive }) =>\n runTool(ctx, 'webhooks_toggle', async () => {\n const data = await ctx.gql.workspace.request<{ toggleEventRegistration: unknown }>(\n TOGGLE_WEBHOOK,\n { id, isActive },\n );\n return jsonResult(data.toggleEventRegistration);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'webhooks_delete')),\n {\n title: 'Delete Webhook',\n description: 'Delete an event registration permanently.',\n annotations: { destructiveHint: true },\n inputSchema: { id: z.string().describe('Event registration ID') },\n },\n async ({ id }) =>\n runTool(ctx, 'webhooks_delete', async () => {\n const data = await ctx.gql.workspace.request<{ deleteEventRegistration: unknown }>(\n DELETE_WEBHOOK,\n { id },\n );\n return jsonResult(data.deleteEventRegistration);\n }),\n );\n}\n","import { z } from 'zod';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { jsonResult, mcpToolName, type McpContext } from '../../../core/index.js';\nimport {\n ACTIVATE_WORKFLOW,\n ARCHIVE_WORKFLOW,\n CREATE_WORKFLOW,\n DEACTIVATE_WORKFLOW,\n DELETE_WORKFLOW,\n DUPLICATE_WORKFLOW,\n GET_WORKFLOW,\n GET_WORKFLOW_VERSIONS,\n LIST_WORKFLOWS,\n PUBLISH_WORKFLOW,\n TRIGGER_WORKFLOW,\n UPDATE_WORKFLOW,\n} from '../operations.js';\nimport { definedInput, runTool } from './helpers.js';\n\nconst WorkflowStatusEnum = z.enum(['ACTIVE', 'ARCHIVED', 'DEPRECATED', 'DRAFT']);\n\nexport function registerWorkflowTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_list')),\n {\n title: 'List Workflows',\n description:\n 'List FluidGrids workflow definitions with optional filters and pagination. Use latestOnly to collapse a workflowKey to its newest version.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n status: WorkflowStatusEnum.optional().describe('Filter by workflow status'),\n category: z.string().optional().describe('Filter by category'),\n tags: z.array(z.string()).optional().describe('Filter by tags'),\n latestOnly: z\n .boolean()\n .optional()\n .describe('Return only the latest version per workflowKey'),\n limit: z.number().optional().describe('Max results (default 10)'),\n offset: z.number().optional().describe('Offset for pagination (default 0)'),\n },\n },\n async ({ status, category, tags, latestOnly, limit, offset }) =>\n runTool(ctx, 'workflows_list', async () => {\n const data = await ctx.gql.workspace.request<{ workflowDefinitions: unknown }>(\n LIST_WORKFLOWS,\n { input: definedInput({ status, category, tags, latestOnly, limit, offset }) },\n );\n return jsonResult(data.workflowDefinitions);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_get')),\n {\n title: 'Get Workflow',\n description:\n 'Get a single workflow definition by id, or by workflowKey (optionally pinned to a version). Without a version the executable version is resolved.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n id: z.string().optional().describe('Workflow definition ID'),\n workflowKey: z.string().optional().describe('Workflow key (alternative to id)'),\n version: z.string().optional().describe('Pin to a specific version'),\n },\n },\n async ({ id, workflowKey, version }) =>\n runTool(ctx, 'workflows_get', async () => {\n const data = await ctx.gql.workspace.request<{ workflowDefinition: unknown }>(\n GET_WORKFLOW,\n {\n id,\n workflowKey,\n version,\n },\n );\n return jsonResult(data.workflowDefinition);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_versions')),\n {\n title: 'List Workflow Versions',\n description: 'List every stored version of one workflowKey.',\n annotations: { readOnlyHint: true },\n inputSchema: { workflowKey: z.string().describe('Workflow key') },\n },\n async ({ workflowKey }) =>\n runTool(ctx, 'workflows_versions', async () => {\n const data = await ctx.gql.workspace.request<{ workflowVersions: unknown }>(\n GET_WORKFLOW_VERSIONS,\n { workflowKey },\n );\n return jsonResult(data.workflowVersions);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_create')),\n {\n title: 'Create Workflow',\n description:\n 'Create a workflow definition. definitionJson is the node/edge graph; workflowKey plus version identify it.',\n inputSchema: {\n workflowKey: z.string().describe('Stable key identifying the workflow'),\n name: z.string().describe('Human-readable name'),\n version: z.string().describe('Version string, e.g. \"1.0.0\"'),\n definitionJson: z.unknown().describe('Workflow graph (nodes + edges) as JSON'),\n description: z.string().optional().describe('Description'),\n category: z.string().optional().describe('Category'),\n icon: z.string().optional().describe('Icon identifier'),\n alias: z.string().optional().describe('Alias'),\n projectId: z.string().optional().describe('Owning project ID'),\n context: z.unknown().optional().describe('Context JSON'),\n tags: z.array(z.string()).optional().describe('Tags'),\n },\n },\n async (args) =>\n runTool(ctx, 'workflows_create', async () => {\n const data = await ctx.gql.workspace.request<{ createWorkflowDefinition: unknown }>(\n CREATE_WORKFLOW,\n { input: definedInput({ ...args }) },\n );\n return jsonResult(data.createWorkflowDefinition);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_update')),\n {\n title: 'Update Workflow',\n description:\n 'Update a workflow definition by id. Saving a change to a published workflow forks a new version rather than mutating the active one.',\n inputSchema: {\n id: z.string().describe('Workflow definition ID'),\n name: z.string().optional().describe('Name'),\n description: z.string().optional().describe('Description'),\n definitionJson: z.unknown().optional().describe('Workflow graph as JSON'),\n category: z.string().optional().describe('Category'),\n icon: z.string().optional().describe('Icon identifier'),\n alias: z.string().optional().describe('Alias'),\n context: z.unknown().optional().describe('Context JSON'),\n tags: z.array(z.string()).optional().describe('Tags'),\n version: z.string().optional().describe('Version'),\n },\n },\n async ({ id, ...input }) =>\n runTool(ctx, 'workflows_update', async () => {\n const data = await ctx.gql.workspace.request<{ updateWorkflowDefinition: unknown }>(\n UPDATE_WORKFLOW,\n { id, input: definedInput(input) },\n );\n return jsonResult(data.updateWorkflowDefinition);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_delete')),\n {\n title: 'Delete Workflow',\n description:\n 'Delete a workflow by key. Without a version every version of that key is deleted.',\n annotations: { destructiveHint: true },\n inputSchema: {\n workflowKey: z.string().describe('Workflow key'),\n version: z.string().optional().describe('Delete only this version'),\n },\n },\n async ({ workflowKey, version }) =>\n runTool(ctx, 'workflows_delete', async () => {\n const data = await ctx.gql.workspace.request<{ deleteWorkflowDefinition: unknown }>(\n DELETE_WORKFLOW,\n { workflowKey, version },\n );\n return jsonResult(data.deleteWorkflowDefinition);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_trigger')),\n {\n title: 'Trigger Workflow',\n description:\n 'Start a workflow run. triggerNodeId names the trigger node to start from; stopAtNodeId runs only up to a node (step debugging).',\n inputSchema: {\n workflowKey: z.string().describe('Workflow key'),\n version: z.string().describe('Workflow version'),\n triggerNodeId: z.string().describe('ID of the trigger node to start from'),\n triggerData: z.unknown().optional().describe('Payload passed to the trigger node'),\n context: z.unknown().optional().describe('Run context JSON'),\n stopAtNodeId: z\n .string()\n .optional()\n .describe('Stop after this node and mark the run COMPLETED'),\n },\n },\n async (args) =>\n runTool(ctx, 'workflows_trigger', async () => {\n const data = await ctx.gql.workspace.request<{ triggerWorkflow: unknown }>(\n TRIGGER_WORKFLOW,\n { input: definedInput({ ...args }) },\n );\n return jsonResult(data.triggerWorkflow);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_publish')),\n {\n title: 'Publish Workflow',\n description: 'Publish a workflow definition, making that version the executable one.',\n inputSchema: { id: z.string().describe('Workflow definition ID') },\n },\n async ({ id }) =>\n runTool(ctx, 'workflows_publish', async () => {\n const data = await ctx.gql.workspace.request<{ publishWorkflow: unknown }>(\n PUBLISH_WORKFLOW,\n { id },\n );\n return jsonResult(data.publishWorkflow);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_activate')),\n {\n title: 'Activate Workflow',\n description:\n 'Activate a workflow definition. Exactly one version per workflowKey may be ACTIVE.',\n inputSchema: { id: z.string().describe('Workflow definition ID') },\n },\n async ({ id }) =>\n runTool(ctx, 'workflows_activate', async () => {\n const data = await ctx.gql.workspace.request<{ activateWorkflowDefinition: unknown }>(\n ACTIVATE_WORKFLOW,\n { id },\n );\n return jsonResult(data.activateWorkflowDefinition);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_deactivate')),\n {\n title: 'Deactivate Workflow',\n description: 'Deactivate a workflow definition so no version of the key is executable.',\n inputSchema: { id: z.string().describe('Workflow definition ID') },\n },\n async ({ id }) =>\n runTool(ctx, 'workflows_deactivate', async () => {\n const data = await ctx.gql.workspace.request<{ deactivateWorkflowDefinition: unknown }>(\n DEACTIVATE_WORKFLOW,\n { id },\n );\n return jsonResult(data.deactivateWorkflowDefinition);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_duplicate')),\n {\n title: 'Duplicate Workflow',\n description: 'Copy an existing workflow version to a new workflowKey.',\n inputSchema: {\n workflowKey: z.string().describe('Source workflow key'),\n version: z.string().describe('Source version'),\n newWorkflowKey: z.string().describe('Key for the copy'),\n newVersion: z.string().optional().describe('Version for the copy'),\n },\n },\n async ({ workflowKey, version, newWorkflowKey, newVersion }) =>\n runTool(ctx, 'workflows_duplicate', async () => {\n const data = await ctx.gql.workspace.request<{ duplicateWorkflow: unknown }>(\n DUPLICATE_WORKFLOW,\n { workflowKey, version, input: definedInput({ newWorkflowKey, newVersion }) },\n );\n return jsonResult(data.duplicateWorkflow);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_archive')),\n {\n title: 'Archive Workflow',\n description: 'Archive a workflow definition. Reversible: archived workflows still list.',\n annotations: { destructiveHint: true },\n inputSchema: { id: z.string().describe('Workflow definition ID') },\n },\n async ({ id }) =>\n runTool(ctx, 'workflows_archive', async () => {\n const data = await ctx.gql.workspace.request<{ archiveWorkflow: unknown }>(\n ARCHIVE_WORKFLOW,\n { id },\n );\n return jsonResult(data.archiveWorkflow);\n }),\n );\n}\n","import { z } from 'zod';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { mcpPromptName, type McpContext } from '../../core/index.js';\n\n/**\n * FluidGrids MCP prompts — guided multi-step workflows. Names are\n * product-prefixed via mcpPromptName and tracked at function entry.\n */\nexport function registerFluidgridsPrompts(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n const p = ctx.productName;\n const buildName = track(mcpPromptName(p, 'build-workflow'));\n const debugName = track(mcpPromptName(p, 'debug-run'));\n\n // <product>-build-workflow — author, publish and trigger a workflow\n server.registerPrompt(\n buildName,\n {\n title: 'Build a Workflow',\n description:\n 'Guide for authoring a FluidGrids workflow end to end: pick nodes, create the definition, publish a version, then trigger it and confirm the run completes.',\n argsSchema: {\n goal: z.string().optional().describe('What the workflow should do'),\n workflowKey: z.string().optional().describe('Workflow key to use'),\n },\n },\n ({ goal, workflowKey }) => {\n ctx.logger.debug(`Prompt ${buildName} called`, { goal, workflowKey });\n const goalNote = goal\n ? `The workflow should: ${goal}`\n : 'Ask the user what the workflow should do before building anything.';\n const keyNote = workflowKey\n ? `Use the workflowKey \"${workflowKey}\".`\n : 'Choose a stable, descriptive workflowKey and confirm it with the user.';\n return {\n messages: [\n {\n role: 'user' as const,\n content: {\n type: 'text' as const,\n text: `Build a FluidGrids workflow.\n\n${goalNote}\n${keyNote}\n\nFollow this order and stop if a step fails:\n\n1. \\`${p}_nodes_list\\` — find the node types you need. Use \\`${p}_nodes_get\\` to read a\n node's input fields before wiring it; do not guess field names.\n2. \\`${p}_workflows_create\\` — build \\`definitionJson\\` as a graph of nodes and edges.\n Exactly one trigger node. Note its node id: triggering needs it.\n3. \\`${p}_workflows_publish\\` then \\`${p}_workflows_activate\\` — only an active version\n is executable, and only one version per key may be ACTIVE.\n4. \\`${p}_workflows_trigger\\` — pass \\`triggerNodeId\\` and any \\`triggerData\\`.\n5. \\`${p}_runs_get\\` — poll until status is terminal (COMPLETED, FAILED, CANCELLED or\n TERMINATED). Statuses are UPPERCASE.\n6. If it did not complete, run \\`${p}_debug-run\\` on the run id.\n\nIf the workflow needs credentials, create them with \\`${p}_credentials_create\\` and\nverify with \\`${p}_credentials_test\\` BEFORE triggering — a missing connection fails\nthe run at the node, not at save time.`,\n },\n },\n ],\n };\n },\n );\n\n // <product>-debug-run — diagnose a failed run\n server.registerPrompt(\n debugName,\n {\n title: 'Debug a Run',\n description:\n 'Guide for diagnosing a FluidGrids run that failed or stalled: read node state, read the log, then retry the failing node or fix the definition.',\n argsSchema: { runId: z.string().optional().describe('Run ID to diagnose') },\n },\n ({ runId }) => {\n ctx.logger.debug(`Prompt ${debugName} called`, { runId });\n const runNote = runId\n ? `Diagnose run \"${runId}\".`\n : `Ask for the run id, or find it with \\`${p}_runs_list\\` filtered to status FAILED.`;\n return {\n messages: [\n {\n role: 'user' as const,\n content: {\n type: 'text' as const,\n text: `Diagnose a FluidGrids run.\n\n${runNote}\n\n1. \\`${p}_runs_get\\` — read the run and its per-node state. Identify the FIRST node that\n did not succeed; later failures are usually consequences of it.\n2. \\`${p}_runs_logs\\` — read that node's log with \\`nodeId\\` set, \\`minLevel\\` ERROR first,\n then widen to WARN/INFO if the error alone is not conclusive.\n3. Classify before acting:\n - credential/auth error -> \\`${p}_credentials_test\\` the connection the node uses\n - bad input -> compare against \\`${p}_nodes_get\\` input fields for that node type\n - transient/upstream -> \\`${p}_runs_retry_node\\` is appropriate\n - wrong graph -> fix \\`definitionJson\\` via \\`${p}_workflows_update\\` (this forks a new\n version), then publish, activate and trigger again\n4. Only retry once you know which class it is. Retrying a bad definition just\n reproduces the failure.\n\nA run stuck in WAITING is not failed — it is blocked on a Wait node. Resume it with\n\\`${p}_runs_resume\\` and the payload it expects.`,\n },\n },\n ],\n };\n },\n );\n}\n","import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { mcpResourceUri, type McpContext } from '../../core/index.js';\nimport { LIST_NODES } from './operations.js';\nimport { safeErrorMessage } from './tools/helpers.js';\n\n/**\n * Read-only FluidGrids MCP resources. URIs are product-prefixed via\n * mcpResourceUri so they don't collide when multiple MCP servers run side by\n * side. Each is tracked at function entry so the shell manifest reflects what\n * was registered even though registration is imperative.\n */\nexport function registerFluidgridsResources(\n server: McpServer,\n ctx: McpContext,\n track: (uri: string) => string,\n): void {\n const schemaUri = track(mcpResourceUri(ctx.productName, 'schema'));\n const nodesUri = track(mcpResourceUri(ctx.productName, 'nodes'));\n\n // <product>://schema — domain overview\n server.registerResource(\n 'fluidgrids-schema',\n schemaUri,\n {\n title: 'FluidGrids Domain Schema',\n description:\n 'Overview of the FluidGrids workflow-automation domain — entities, enums, and the per-entity tool surface.',\n mimeType: 'text/plain',\n },\n async () => {\n ctx.logger.debug(`Resource ${schemaUri} requested`);\n const schema = `# FluidGrids Domain (Overview)\n\nVisual workflow automation. A workflow is a graph of nodes; running one produces a run.\n\n## Core entities\n- WorkflowDefinition — identified by (workflowKey, version). Many versions per key;\n at most ONE is ACTIVE. Saving over a published version forks a new version.\n- WorkflowRun — one execution. Has per-node state and a log stream.\n- NodeEndpointConfig — an available node type at a version (BUILTIN | CUSTOM | STORE).\n- Connection — a stored credential against a Provider. Secrets live in the vault.\n- EventRegistration — an event source (webhook) that triggers a workflow.\n- ScheduledJob — a cron/interval schedule that triggers a workflow.\n\n## Enums\n- WorkflowStatus: ACTIVE | ARCHIVED | DEPRECATED | DRAFT\n- RunStatus: PENDING | RUNNING | WAITING | COMPLETED | FAILED | CANCELLED | TERMINATED\n (UPPERCASE on the wire — comparing lowercase is a known source of hangs)\n- RunLogLevel: DEBUG | INFO | WARN | ERROR\n- PublishType: BUILTIN | CUSTOM | STORE\n- NodeConfigStatus: AVAILABLE | DEPRECATED | DISABLED\n- EventStatus: ACTIVE | PAUSED | DISABLED | ARCHIVED\n\n## Typical sequence\n1. ${ctx.productName}_nodes_list — see what nodes exist\n2. ${ctx.productName}_workflows_create — create a definition with a definitionJson graph\n3. ${ctx.productName}_workflows_publish / _activate — make a version executable\n4. ${ctx.productName}_workflows_trigger — start a run\n5. ${ctx.productName}_runs_get / _runs_logs — follow it to a terminal status\n\n## Tier\nEvery tool here is workspace tier and needs a workspace context. Sign in and\nselect a workspace with the auth tools first.\n`;\n return { contents: [{ uri: schemaUri, mimeType: 'text/plain', text: schema }] };\n },\n );\n\n // <product>://nodes — live node catalogue\n server.registerResource(\n 'fluidgrids-nodes',\n nodesUri,\n {\n title: 'FluidGrids Node Catalogue',\n description:\n 'The node types currently available to build workflows with, read live from the node endpoint config registry.',\n mimeType: 'application/json',\n },\n async () => {\n ctx.logger.debug(`Resource ${nodesUri} requested`);\n try {\n const data = await ctx.gql.workspace.request<{ nodeEndpointConfigs: unknown }>(LIST_NODES, {\n status: 'AVAILABLE',\n });\n return {\n contents: [\n {\n uri: nodesUri,\n mimeType: 'application/json',\n text: JSON.stringify(data.nodeEndpointConfigs, null, 2),\n },\n ],\n };\n } catch (error) {\n // Resources must not throw: an unauthenticated client reading this\n // should see why, not an opaque transport failure.\n const message = safeErrorMessage(error);\n ctx.logger.error('fluidgrids nodes resource failed', { error: message });\n return {\n contents: [\n {\n uri: nodesUri,\n mimeType: 'application/json',\n text: JSON.stringify(\n {\n error: message,\n hint: 'Sign in and select a workspace first — the node registry is workspace-scoped.',\n },\n null,\n 2,\n ),\n },\n ],\n };\n }\n },\n );\n}\n","/**\n * FluidGrids module (BOFF-7088) — the workflow-automation surface of the\n * FluidGrids product: workflows, runs, nodes, credentials, webhooks, scheduled\n * jobs, plus read-only dashboard/usage/search/config.\n *\n * Before this module the fluidgrids-mcp shell mounted only generic platform\n * modules (and, by copy-paste, `vibecontrols`), so an MCP client talking to\n * FluidGrids had 600+ tools and not one that could touch a workflow.\n *\n * Every GraphQL document lives in ./operations.ts, ported from `@fluidgrids/sdk`\n * where each one is validated against vendored snapshots of the deployed\n * supergraphs in CI. All of them are workspace tier.\n */\n\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport type { McpContext, McpModule, ModuleRegistration } from '../../core/index.js';\nimport { registerCredentialTools } from './tools/credentials.js';\nimport { registerInsightTools } from './tools/insights.js';\nimport { registerNodeTools } from './tools/nodes.js';\nimport { registerRunTools } from './tools/runs.js';\nimport { registerScheduledJobTools } from './tools/scheduled-jobs.js';\nimport { registerWebhookTools } from './tools/webhooks.js';\nimport { registerWorkflowTools } from './tools/workflows.js';\nimport { registerFluidgridsPrompts } from './prompts.js';\nimport { registerFluidgridsResources } from './resources.js';\n\nconst fluidgridsModule: McpModule = {\n id: 'fluidgrids',\n version: '0.0.1',\n displayName: 'FluidGrids',\n capabilities: { tools: {}, resources: {}, prompts: {} },\n\n register(server: McpServer, ctx: McpContext): ModuleRegistration {\n const tools: string[] = [];\n const resources: string[] = [];\n const prompts: string[] = [];\n\n const trackTool = (n: string): string => {\n tools.push(n);\n return n;\n };\n const trackResource = (uri: string): string => {\n resources.push(uri);\n return uri;\n };\n const trackPrompt = (n: string): string => {\n prompts.push(n);\n return n;\n };\n\n registerWorkflowTools(server, ctx, trackTool);\n registerRunTools(server, ctx, trackTool);\n registerNodeTools(server, ctx, trackTool);\n registerCredentialTools(server, ctx, trackTool);\n registerWebhookTools(server, ctx, trackTool);\n registerScheduledJobTools(server, ctx, trackTool);\n registerInsightTools(server, ctx, trackTool);\n\n registerFluidgridsResources(server, ctx, trackResource);\n registerFluidgridsPrompts(server, ctx, trackPrompt);\n\n return { tools, resources, prompts };\n },\n};\n\nexport default fluidgridsModule;\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/core/errors.ts","../../../src/core/tool-name.ts","../../../src/core/result.ts","../../../src/modules/fluidgrids/operations.ts","../../../src/modules/fluidgrids/tools/helpers.ts","../../../src/modules/fluidgrids/tools/credentials.ts","../../../src/modules/fluidgrids/tools/insights.ts","../../../src/modules/fluidgrids/tools/nodes.ts","../../../src/modules/fluidgrids/tools/runs.ts","../../../src/modules/fluidgrids/tools/scheduled-jobs.ts","../../../src/modules/fluidgrids/tools/webhooks.ts","../../../src/modules/fluidgrids/tools/workflows.ts","../../../src/modules/fluidgrids/prompts.ts","../../../src/modules/fluidgrids/resources.ts","../../../src/modules/fluidgrids/index.ts"],"names":["z"],"mappings":";;;;;;;;;;;AA8BO,IAAM,gBAAA,GAAN,cAA+B,KAAA,CAAM;AAAA,EACjB,KAAA;AAAA,EAEzB,WAAA,CAAY,SAAiB,KAAA,EAAiB;AAC5C,IAAA,KAAA,CAAM,OAAO,CAAA;AACb,IAAA,IAAA,CAAK,IAAA,GAAO,kBAAA;AACZ,IAAA,IAAA,CAAK,KAAA,GAAQ,KAAA;AAAA,EACf;AACF,CAAA;;;AC1BA,IAAM,oBAAA,GAAuB,EAAA;AAE7B,SAAS,cAAA,CAAe,MAAc,IAAA,EAA8C;AAClF,EAAA,IAAuB,IAAA,CAAK,MAAA,GAAS,oBAAA,EAAsB;AACzD,IAAA,MAAM,IAAI,gBAAA;AAAA,MACR,CAAA,WAAA,EAAc,IAAI,CAAA,UAAA,EAAa,oBAAoB,CAAA,8CAAA;AAAA,KACrD;AAAA,EACF;AACA,EAAA,OAAO,IAAA;AACT;AAMO,SAAS,WAAA,CAAY,gBAAwB,KAAA,EAAyB;AAC3E,EAAA,IAAI,CAAC,WAAA,EAAa;AAChB,IAAA,MAAM,IAAI,iBAAiB,sCAAsC,CAAA;AAAA,EACnE;AACA,EAAA,MAAM,IAAA,GAAO,CAAC,WAAA,EAAa,GAAG,KAAK,EAAE,MAAA,CAAO,OAAO,CAAA,CAAE,IAAA,CAAK,GAAG,CAAA;AAC7D,EAAA,OAAO,c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AA;AAC5C,IAAA,gBAAA,CAAiB,MAAA,EAAQ,KAAK,SAAS,CAAA;AACvC,IAAA,iBAAA,CAAkB,MAAA,EAAQ,KAAK,SAAS,CAAA;AACxC,IAAA,uBAAA,CAAwB,MAAA,EAAQ,KAAK,SAAS,CAAA;AAC9C,IAAA,oBAAA,CAAqB,MAAA,EAAQ,KAAK,SAAS,CAAA;AAC3C,IAAA,yBAAA,CAA0B,MAAA,EAAQ,KAAK,SAAS,CAAA;AAChD,IAAA,oBAAA,CAAqB,MAAA,EAAQ,KAAK,SAAS,CAAA;AAE3C,IAAA,2BAAA,CAA4B,MAAA,EAAQ,KAAK,aAAa,CAAA;AACtD,IAAA,yBAAA,CAA0B,MAAA,EAAQ,KAAK,WAAW,CAAA;AAElD,IAAA,OAAO,EAAE,KAAA,EAAO,SAAA,EAAW,OAAA,EAAQ;AAAA,EACrC;AACF,CAAA;AAEA,IAAO,kBAAA,GAAQ","file":"index.cjs","sourcesContent":["/**\n * Error classes for MCP SDK.\n *\n * Modules MUST throw these instead of throwing raw Errors. The registerTool\n * wrapper in result.ts catches and maps them to MCP-protocol-compliant\n * `{ isError: true, content: [...] }` responses.\n *\n * Throwing past the wrapper to the protocol surfaces as JSON-RPC -32603 to\n * the client and is a protocol bug.\n */\n\nexport class McpUserError extends Error {\n public readonly hint: string | undefined;\n\n constructor(message: string, opts?: { hint?: string }) {\n super(message);\n this.name = 'McpUserError';\n this.hint = opts?.hint;\n }\n}\n\nexport class McpAuthError extends McpUserError {\n constructor(message: string, opts?: { hint?: string }) {\n super(message, {\n hint: opts?.hint ?? 'Run the auth_login tool to authenticate.',\n });\n this.name = 'McpAuthError';\n }\n}\n\nexport class McpInternalError extends Error {\n public override readonly cause: unknown;\n\n constructor(message: string, cause?: unknown) {\n super(message);\n this.name = 'McpInternalError';\n this.cause = cause;\n }\n}\n","/**\n * Tool / resource / prompt naming helpers.\n *\n * Mandatory product prefix avoids collisions when Claude Desktop runs\n * multiple MCP servers concurrently (typical setup is ~6).\n *\n * Tool names are capped at 63 characters — Claude Desktop pre-1.x\n * truncated at 64 in some versions.\n */\n\nimport { McpInternalError } from './errors.js';\n\nconst MAX_TOOL_NAME_LENGTH = 63;\n\nfunction assertSafeName(name: string, kind: 'tool' | 'resource' | 'prompt'): string {\n if (kind === 'tool' && name.length > MAX_TOOL_NAME_LENGTH) {\n throw new McpInternalError(\n `Tool name '${name}' exceeds ${MAX_TOOL_NAME_LENGTH} characters (some MCP clients truncate at 64).`,\n );\n }\n return name;\n}\n\n/**\n * Build a tool name. Format: `<productName>_<...parts>` (snake_case).\n * Example: mcpToolName('vibecontrols', 'vibes', 'list') -> 'vibecontrols_vibes_list'\n */\nexport function mcpToolName(productName: string, ...parts: string[]): string {\n if (!productName) {\n throw new McpInternalError('mcpToolName: productName is required');\n }\n const name = [productName, ...parts].filter(Boolean).join('_');\n return assertSafeName(name, 'tool');\n}\n\n/**\n * Build a resource URI. Format: `<productName>://<...parts>`.\n * Example: mcpResourceUri('vibecontrols', 'schema') -> 'vibecontrols://schema'\n */\nexport function mcpResourceUri(productName: string, ...parts: string[]): string {\n if (!productName) {\n throw new McpInternalError('mcpResourceUri: productName is required');\n }\n return `${productName}://${parts.filter(Boolean).join('/')}`;\n}\n\n/**\n * Build a prompt name. Format: `<productName>-<...parts>` (kebab-case).\n * Example: mcpPromptName('vibecontrols', 'setup') -> 'vibecontrols-setup'\n */\nexport function mcpPromptName(productName: string, ...parts: string[]): string {\n if (!productName) {\n throw new McpInternalError('mcpPromptName: productName is required');\n }\n return [productName, ...parts].filter(Boolean).join('-');\n}\n\nexport const TOOL_NAME_LIMIT = MAX_TOOL_NAME_LENGTH;\n\n/**\n * Name-based hint heuristics for MCP `annotations` (readOnlyHint /\n * destructiveHint). Used by tool-governance.ts to auto-fill annotations for\n * the fleet of product modules that call `server.registerTool` directly\n * (bypassing the `registerTool()` core helper) and so never set them\n * explicitly today (BOFF-3903). Deliberately conservative — matched against\n * whole `_`-delimited segments so e.g. `timeentries_delete` and\n * `pomodoro_delete_goal` match, but a hypothetical `undeletable_check`\n * would not.\n *\n * A module can always override the inference by passing an explicit\n * `annotations` object to `registerTool()` / `server.registerTool()`.\n */\nconst DESTRUCTIVE_NAME_SEGMENT = /(?:^|_)delete(?:_|$)/i;\nconst READ_ONLY_NAME_SEGMENT = /(?:^|_)(?:list|get|search|check|read|count|stats|by_date)(?:_|$)/i;\n\n/** True when a tool name looks destructive (irreversibly deletes data) by naming convention. */\nexport function inferDestructiveHint(toolName: string): boolean {\n return DESTRUCTIVE_NAME_SEGMENT.test(toolName);\n}\n\n/**\n * True when a tool name looks read-only by naming convention. Never true for\n * a name that also looks destructive (a tool can't be both).\n */\nexport function inferReadOnlyHint(toolName: string): boolean {\n return !inferDestructiveHint(toolName) && READ_ONLY_NAME_SEGMENT.test(toolName);\n}\n","/**\n * MCP tool result helpers + central handler.\n *\n * Modules NEVER call server.registerTool directly — they use registerTool()\n * from this module so the central try/catch wraps the handler and:\n * - maps thrown McpUserError / McpAuthError / McpInternalError to\n * MCP-protocol-compliant `{ isError: true, content: [...] }` shapes\n * - threads `_meta.progressToken` into ctx.progress for long ops\n * - emits a structured log line on every error\n * - never leaks `cause` from McpInternalError to the client\n *\n * This is the analog of cli-sdk's createProgram() central error handler.\n */\n\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport type { ZodRawShape } from 'zod';\nimport type { McpContext } from './context.js';\nimport { McpAuthError, McpInternalError, McpUserError } from './errors.js';\nimport type { ToolAnnotations } from './tool-governance.js';\n\nexport interface ToolTextContent {\n type: 'text';\n text: string;\n [k: string]: unknown;\n}\n\nexport interface ToolResult {\n content: ToolTextContent[];\n isError?: boolean;\n structuredContent?: Record<string, unknown>;\n [k: string]: unknown;\n}\n\nexport interface ToolMeta {\n progressToken?: string | number;\n}\n\n/**\n * Build a successful tool result with JSON content (pretty-printed).\n */\nexport function jsonResult(data: unknown, structured?: Record<string, unknown>): ToolResult {\n const result: ToolResult = {\n content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],\n };\n if (structured !== undefined) {\n result.structuredContent = structured;\n }\n return result;\n}\n\n/**\n * Build a successful tool result with plain text content.\n */\nexport function textResult(text: string): ToolResult {\n return { content: [{ type: 'text', text }] };\n}\n\n/**\n * Build an error tool result. Honors MCP's `{ isError: true, content }` shape.\n * Optional hint is appended on a new line so the LLM can react.\n */\nexport function errorResult(message: string, hint?: string): ToolResult {\n const text = hint ? `${message}\\n\\nHint: ${hint}` : message;\n return { content: [{ type: 'text', text }], isError: true };\n}\n\nexport interface ToolMetadata {\n title: string;\n description: string;\n inputSchema?: ZodRawShape;\n /**\n * Explicit MCP annotations (readOnlyHint / destructiveHint / ...). Optional\n * — when omitted, `wrapServerWithToolGovernance` (applied centrally in\n * `createMcpServer`) infers them from the tool name. Set this to override\n * the inference for a tool whose name doesn't match the naming convention.\n */\n annotations?: ToolAnnotations;\n}\n\nexport type ToolHandler<TArgs = Record<string, unknown>> = (\n args: TArgs,\n ctx: McpContext,\n meta: ToolMeta,\n) => Promise<unknown>;\n\n/**\n * Register a tool with the central error wrapper.\n *\n * The handler returns a plain value or void. The wrapper:\n * - wraps non-undefined returns in jsonResult()\n * - if the value already looks like a ToolResult (has `content`), passes through\n * - catches McpAuthError / McpUserError / McpInternalError / generic Error\n * - logs every error via ctx.logger.error\n */\nexport function registerTool<TArgs extends Record<string, unknown>>(\n server: McpServer,\n ctx: McpContext,\n name: string,\n metadata: ToolMetadata,\n handler: ToolHandler<TArgs>,\n): void {\n const sdkConfig = {\n title: metadata.title,\n description: metadata.description,\n ...(metadata.inputSchema ? { inputSchema: metadata.inputSchema } : {}),\n ...(metadata.annotations ? { annotations: metadata.annotations } : {}),\n };\n\n // The MCP SDK's registerTool signature is `(name, config, handler)`. The\n // handler arity depends on whether inputSchema is present (1-arg without,\n // 2-arg with). We accept a unified handler shape and dispatch at runtime.\n // The SDK's typing is strict and conditional on the inputSchema generic;\n // bypass with a cast since runtime acceptance is unconditional.\n const wrapped = async (...callbackArgs: unknown[]): Promise<ToolResult> => {\n const hasArgs = callbackArgs.length === 2;\n const args = (hasArgs ? callbackArgs[0] : {}) as TArgs;\n const extra = (hasArgs ? callbackArgs[1] : callbackArgs[0]) as\n { _meta?: { progressToken?: string | number } } | undefined;\n\n const progressToken = extra?._meta?.progressToken;\n const meta: ToolMeta = progressToken !== undefined ? { progressToken } : {};\n\n try {\n const result = await handler(args, ctx, meta);\n if (isToolResult(result)) return result;\n if (result === undefined) return textResult('OK');\n return jsonResult(result);\n } catch (error) {\n return mapErrorToResult(error, ctx, name);\n }\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (server as any).registerTool(name, sdkConfig, wrapped);\n}\n\nfunction isToolResult(value: unknown): value is ToolResult {\n return (\n !!value &&\n typeof value === 'object' &&\n 'content' in value &&\n Array.isArray((value as ToolResult).content)\n );\n}\n\nfunction mapErrorToResult(error: unknown, ctx: McpContext, toolName: string): ToolResult {\n if (error instanceof McpAuthError) {\n ctx.logger.warn(`${toolName}: auth required`, { message: error.message });\n return errorResult(error.message, error.hint);\n }\n if (error instanceof McpUserError) {\n ctx.logger.info(`${toolName}: user error`, { message: error.message });\n return errorResult(error.message, error.hint);\n }\n if (error instanceof McpInternalError) {\n ctx.logger.error(`${toolName}: internal error`, {\n message: error.message,\n cause: stringifyCause(error.cause),\n });\n return errorResult(`Internal error in ${toolName}.`);\n }\n const message = error instanceof Error ? error.message : String(error);\n ctx.logger.error(`${toolName}: unhandled error`, { message });\n return errorResult(`${toolName}: ${message}`);\n}\n\nfunction stringifyCause(cause: unknown): string | undefined {\n if (cause === undefined || cause === null) return undefined;\n if (cause instanceof Error) return cause.message;\n try {\n return JSON.stringify(cause);\n } catch {\n return String(cause);\n }\n}\n","/**\n * FluidGrids GraphQL operations (BOFF-7088).\n *\n * Ported verbatim from \\`@fluidgrids/sdk\\` (fluidgrids-sdk-node) \\`src/graphql/\\`,\n * which validates every one of these documents against vendored snapshots of the\n * deployed supergraphs in CI. Do not hand-edit a document here without making the\n * same change there -- the SDK is the source of truth and the only place the\n * documents are schema-checked.\n *\n * Every operation below is WORKSPACE tier (\\`ctx.gql.workspace\\`). Authentication,\n * \\`currentUser\\` and \\`health\\` are global tier and are already served by the\n * \\`auth\\` and \\`health\\` modules -- they are deliberately not duplicated here.\n */\n\n// Workflows\n// `Query.workflows` also exists on the workspace supergraph, but it belongs to a\n// different subgraph and returns BigConsole's `FluidGridsWorkflow` (linkedDataSinks,\n// externalWorkflowId) — a name collision, not our type. FluidGrids workflows are\n// `workflowDefinition` / `workflowDefinitions`, returning `WorkflowDefinition`.\nexport const LIST_WORKFLOWS = `\n query ListWorkflows($input: ListWorkflowDefinitionsInput!) {\n workflowDefinitions(input: $input) {\n items {\n id\n workflowKey\n name\n description\n version\n status\n category\n tags\n isActive\n totalVersions\n createdAt\n updatedAt\n }\n total\n hasMore\n }\n }\n`;\n\nexport const GET_WORKFLOW = `\n query GetWorkflow($id: ID, $workflowKey: String, $version: String) {\n workflowDefinition(id: $id, workflowKey: $workflowKey, version: $version) {\n id\n workflowKey\n name\n description\n version\n status\n category\n tags\n icon\n isActive\n totalVersions\n definitionJson\n createdAt\n updatedAt\n }\n }\n`;\n\n// Keyed by workflowKey, not workflowId, and returns a plain array.\nexport const GET_WORKFLOW_VERSIONS = `\n query GetWorkflowVersions($workflowKey: String!) {\n workflowVersions(workflowKey: $workflowKey) {\n id\n workflowKey\n name\n description\n version\n status\n category\n tags\n icon\n isActive\n totalVersions\n createdAt\n updatedAt\n }\n }\n`;\n\n// Runs\nexport const LIST_RUNS = `\n query ListRuns($input: ListWorkflowRunsInput!) {\n workflowRuns(input: $input) {\n items {\n id\n workflowId\n workflowKey\n version\n status\n startedAt\n completedAt\n duration\n triggeredById\n errorMessage\n errorType\n progress\n totalNodes\n completedNodes\n failedNodes\n }\n total\n hasMore\n }\n }\n`;\n\nexport const GET_RUN = `\n query GetRun($id: ID!) {\n workflowRun(id: $id) {\n id\n workflowId\n workflowKey\n version\n status\n startedAt\n completedAt\n duration\n triggeredById\n triggerData\n triggerNodeId\n errorMessage\n errorType\n progress\n totalNodes\n completedNodes\n failedNodes\n skippedNodes\n nodeStates {\n nodeId\n nodeType\n status\n error\n output\n }\n }\n }\n`;\n\nexport const GET_RUN_LOGS = `\n query GetRunLogs(\n $runId: ID!\n $nodeId: String\n $minLevel: RunLogLevel\n $limit: Int\n $after: String\n $search: String\n $includeChildRuns: Boolean\n ) {\n workflowRunLogs(\n runId: $runId\n nodeId: $nodeId\n minLevel: $minLevel\n limit: $limit\n after: $after\n search: $search\n includeChildRuns: $includeChildRuns\n ) {\n lines {\n id\n runId\n nodeId\n level\n message\n timestamp\n data\n attempt\n phase\n stream\n truncated\n }\n hasMore\n nextCursor\n limitReached\n }\n }\n`;\n\n// Nodes\n// `nodes` is not a Query field. Node definitions are `nodeEndpointConfig(s)`, and the\n// response is { configs, pagination } — not { items, total, hasMore }.\nexport const LIST_NODES = `\n query ListNodes(\n $nodeType: String\n $publishType: PublishType\n $status: NodeConfigStatus\n $pagination: WorkflowPaginationInput\n ) {\n nodeEndpointConfigs(\n nodeType: $nodeType\n publishType: $publishType\n status: $status\n pagination: $pagination\n ) {\n configs {\n id\n nodeType\n nodeVersion\n name\n description\n category\n icon\n logo\n keywords\n kind\n author\n publishType\n status\n isLatest\n endpointUrl\n operations\n supportsAdapterMode\n adapterOutputType\n createdAt\n updatedAt\n }\n pagination {\n total\n limit\n offset\n hasMore\n }\n }\n }\n`;\n\n// Keyed by nodeType + nodeVersion, NOT by id.\nexport const GET_NODE = `\n query GetNode($nodeType: String!, $nodeVersion: String!) {\n nodeEndpointConfig(nodeType: $nodeType, nodeVersion: $nodeVersion) {\n id\n nodeType\n nodeVersion\n name\n description\n category\n icon\n logo\n keywords\n kind\n author\n publishType\n status\n isLatest\n endpointUrl\n operations\n supportsAdapterMode\n adapterOutputType\n createdAt\n updatedAt\n healthCheckUrl\n nodeAdapters\n }\n }\n`;\n\n// LIST_NODE_CATEGORIES removed: `nodeCategories` exists on neither supergraph and has\n// no equivalent. Categories are a field on NodeEndpointConfig; derive them client-side.\n// Credentials\n// In FluidGrids a \"credential\" is a CONNECTION (wspace-integrations-svc), and the\n// catalogue of what kinds you can create are PROVIDERS. There is no `credentials`\n// field on either supergraph.\n//\n// ★ getConnection/createConnection/updateConnection/deleteConnection/testConnection\n// ALSO exist on the GLOBAL tier, returning ChannelConnection — a different product,\n// with colliding input type names and different fields. These documents are pinned to\n// the workspace tier, which is the SDK's default endpoint. Do not \"fix\" a failure here\n// by pointing at global; it would parse, execute, and return the wrong product's data.\nexport const LIST_CREDENTIALS = `\n query ListCredentials($filter: ConnectionFilterInput, $pagination: IntegrationsPaginationInput) {\n getConnections(filter: $filter, pagination: $pagination) {\n items {\n id\n name\n description\n status\n providerId\n provider {\n id\n key\n name\n category\n authType\n icon\n }\n credentialSource\n externalAccountId\n externalAccountName\n externalAccountEmail\n grantedScopes\n lastUsedAt\n lastHealthCheck\n errorMessage\n createdAt\n updatedAt\n }\n total\n hasMore\n }\n }\n`;\n\nexport const GET_CREDENTIAL = `\n query GetCredential($id: ID!) {\n getConnection(id: $id) {\n id\n name\n description\n status\n providerId\n provider {\n id\n key\n name\n description\n category\n authType\n configSchema\n availableScopes\n defaultScopes\n icon\n docsUrl\n }\n config\n metadata\n credentialSource\n externalAccountId\n externalAccountName\n externalAccountEmail\n grantedScopes\n lastUsedAt\n lastHealthCheck\n errorMessage\n workspaceId\n createdAt\n updatedAt\n }\n }\n`;\n\n// Returns a PAGE (ProviderList), not an array — the catalogue defaults to limit 50.\nexport const LIST_CREDENTIAL_TYPES = `\n query ListCredentialTypes($filter: ProviderFilterInput, $pagination: IntegrationsPaginationInput) {\n getProviders(filter: $filter, pagination: $pagination) {\n items {\n id\n key\n name\n description\n category\n authType\n configSchema\n availableScopes\n defaultScopes\n icon\n docsUrl\n isBuiltIn\n isEnabled\n connectionCount\n }\n total\n hasMore\n }\n }\n`;\n\n// Webhooks\n// A FluidGrids webhook is an EVENT REGISTRATION — it binds a workflowKey and a\n// triggerNodeId to a webhookUrl/webhookToken.\n//\n// ★ Query.webhooks ALSO exists and returns type Webhook, but that is a different\n// subgraph's OUTBOUND delivery system (agentIds, retryPolicy, deliveryCount, and a\n// neighbouring webhookExecutions taking CalendarPaginationInput). It has no\n// workflowKey and is not ours. Do not \"fix\" a failure here by switching to it.\nexport const LIST_WEBHOOKS = `\n query ListWebhooks($status: EventStatus, $workflowKey: String) {\n eventRegistrations(status: $status, workflowKey: $workflowKey) {\n id\n name\n description\n workflowKey\n triggerNodeId\n eventSource\n eventType\n status\n isActive\n webhookUrl\n webhookToken\n validationMethod\n signatureHeader\n apiKeyHeader\n payloadMapping\n config\n tags\n totalTriggers\n successfulTriggers\n failedTriggers\n lastTriggeredAt\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const GET_WEBHOOK = `\n query GetWebhook($id: ID!) {\n eventRegistration(id: $id) {\n id\n name\n description\n workflowKey\n triggerNodeId\n eventSource\n eventType\n status\n isActive\n webhookUrl\n webhookToken\n validationMethod\n signatureHeader\n apiKeyHeader\n payloadMapping\n config\n tags\n totalTriggers\n successfulTriggers\n failedTriggers\n lastTriggeredAt\n createdAt\n updatedAt\n projectId\n workspaceId\n createdById\n }\n }\n`;\n\n// Scheduled Jobs\n// ★ `scheduledJobs` also exists and returns ScheduledJob — the GENERIC platform\n// scheduler (cronExpression, executorType, circuitBreaker, rrule, businessCalendarId).\n// That is a different service. FluidGrids workflow crons are workflowScheduledJob(s),\n// whose type carries workflowKey/schedule/enabled/nextRun.\n// Note the response field is `jobs`, not `items`.\nexport const LIST_SCHEDULED_JOBS = `\n query ListScheduledJobs($enabled: Boolean, $workflowKey: String, $pagination: WorkflowPaginationInput) {\n workflowScheduledJobs(enabled: $enabled, workflowKey: $workflowKey, pagination: $pagination) {\n jobs {\n id\n name\n workflowKey\n version\n schedule\n enabled\n nextRun\n lastRun\n config\n createdAt\n updatedAt\n }\n pagination {\n total\n limit\n offset\n hasMore\n }\n }\n }\n`;\n\n// Argument is `jobId`, not `id`.\nexport const GET_SCHEDULED_JOB = `\n query GetScheduledJob($jobId: ID!) {\n workflowScheduledJob(jobId: $jobId) {\n id\n name\n workflowKey\n version\n schedule\n enabled\n nextRun\n lastRun\n config\n createdAt\n updatedAt\n workspaceId\n }\n }\n`;\n\n// Dashboard\nexport const GET_DASHBOARD_SUMMARY = `\n query DashboardSummary($projectId: String) {\n dashboardSummary(projectId: $projectId) {\n userId\n username\n workflowsCount\n activeWorkflowsCount\n archivedWorkflowsCount\n runsCountTotal\n runsCompletedCount\n runsFailedCount\n runsCancelledCount\n runsPendingCount\n runsRunningCount\n runsWaitingCount\n runsCompletedLast24h\n runsFailedLast24h\n runsCompletedLast7d\n runsFailedLast7d\n runsCompletedLast30d\n runsFailedLast30d\n totalNodesExecutedCount\n workflowSuccessRate\n avgWorkflowExecutionTimeSeconds\n avgNodeExecutionTimeSeconds\n recentRuns {\n id\n workflowKey\n version\n status\n startedAt\n completedAt\n duration\n }\n recentWorkflows {\n workflowKey\n name\n version\n updatedAt\n }\n nodeUsageStats {\n nodeType\n totalExecutions\n successCount\n failureCount\n avgExecutionTime\n }\n }\n }\n`;\n\nexport const GET_USAGE_METRICS = `\n query GetUsageMetrics($input: UsageQueryInput!) {\n usageMetrics(input: $input) {\n period\n workflowMetrics {\n totalRuns\n successfulRuns\n failedRuns\n cancelledRuns\n totalDurationSeconds\n averageDurationSeconds\n minDurationSeconds\n maxDurationSeconds\n medianDurationSeconds\n }\n nodeMetrics {\n totalNodes\n successfulNodes\n failedNodes\n skippedNodes\n totalDurationSeconds\n averageDurationSeconds\n nodeTypeBreakdown\n }\n }\n }\n`;\n\n// Events have no FluidGrids equivalent. `Query.events(calendarId: ID!)` belongs to\n// the calendar service and returns an EventConnection of CalendarEvent. FluidGrids'\n// only event noun is EventRegistration, which `webhooks` already owns.\n// Search\nexport const SEARCH = `\n query Search($input: SearchRequestInput!) {\n search(input: $input) {\n query\n results\n entityCounts\n totalResults\n metadata\n }\n }\n`;\n\nexport const SEARCH_BY_ENTITY_TYPE = `\n query SearchByEntityType($entityType: String!, $query: String!, $filters: SearchFilterInput, $limit: Int, $offset: Int) {\n searchByEntityType(entityType: $entityType, query: $query, filters: $filters, limit: $limit, offset: $offset) {\n query\n results\n entityCounts\n totalResults\n metadata\n }\n }\n`;\n\n// Admin\nexport const GET_SYSTEM_CONFIG = `\n query GetSystemConfig {\n systemConfig {\n version\n revision\n environment\n deploymentType\n hostname\n hostIp\n }\n }\n`;\n\n// Workflows\n// ★★ createWorkflow / updateWorkflow / deleteWorkflow ALL exist and pass schema\n// validation — but they return FluidGridsWorkflow, which is BIGCONSOLE's datasink\n// type (linkedDataSinks, externalWorkflowId), not ours. The FluidGrids workflow CRUD\n// is the *WorkflowDefinition family. This is why \"the operation validates\" is not\n// sufficient evidence: the RETURN TYPE has to be ours too.\nexport const CREATE_WORKFLOW = `\n mutation CreateWorkflow($input: CreateWorkflowDefinitionInput!) {\n createWorkflowDefinition(input: $input) {\n id\n workflowKey\n name\n description\n version\n status\n category\n tags\n icon\n isActive\n totalVersions\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const UPDATE_WORKFLOW = `\n mutation UpdateWorkflow($id: ID!, $input: UpdateWorkflowDefinitionInput!) {\n updateWorkflowDefinition(id: $id, input: $input) {\n id\n workflowKey\n name\n description\n version\n status\n category\n tags\n icon\n isActive\n totalVersions\n createdAt\n updatedAt\n }\n }\n`;\n\n// Keyed by workflowKey (+ optional version), not id.\nexport const DELETE_WORKFLOW = `\n mutation DeleteWorkflow($workflowKey: String!, $version: String) {\n deleteWorkflowDefinition(workflowKey: $workflowKey, version: $version)\n }\n`;\n\n// Everything moves into a single input; there is no `id` argument.\nexport const TRIGGER_WORKFLOW = `\n mutation TriggerWorkflow($input: TriggerWorkflowInput!) {\n triggerWorkflow(input: $input) {\n runId\n status\n workflowKey\n version\n triggerNodeId\n }\n }\n`;\n\n// One argument. There is no changeLog.\nexport const PUBLISH_WORKFLOW = `\n mutation PublishWorkflow($id: ID!) {\n publishWorkflow(id: $id) {\n id\n workflowKey\n name\n description\n version\n status\n category\n tags\n icon\n isActive\n totalVersions\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const ACTIVATE_WORKFLOW = `\n mutation ActivateWorkflow($id: ID!) {\n activateWorkflowDefinition(id: $id) {\n id\n workflowKey\n name\n description\n version\n status\n category\n tags\n icon\n isActive\n totalVersions\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const DEACTIVATE_WORKFLOW = `\n mutation DeactivateWorkflow($id: ID!) {\n deactivateWorkflowDefinition(id: $id) {\n id\n workflowKey\n name\n description\n version\n status\n category\n tags\n icon\n isActive\n totalVersions\n createdAt\n updatedAt\n }\n }\n`;\n\n// Keyed by workflowKey + version, with the new identity in the input.\nexport const DUPLICATE_WORKFLOW = `\n mutation DuplicateWorkflow($workflowKey: String!, $version: String!, $input: DuplicateWorkflowInput!) {\n duplicateWorkflow(workflowKey: $workflowKey, version: $version, input: $input) {\n success\n message\n workflow {\n id\n workflowKey\n name\n description\n version\n status\n category\n tags\n icon\n isActive\n totalVersions\n createdAt\n updatedAt\n }\n }\n }\n`;\n\nexport const ARCHIVE_WORKFLOW = `\n mutation ArchiveWorkflow($id: ID!) {\n archiveWorkflow(id: $id) {\n id\n status\n }\n }\n`;\n\n// Runs\nexport const CANCEL_RUN = `\n mutation CancelRun($id: ID!) {\n cancelWorkflowRun(id: $id) {\n id\n status\n completedAt\n errorMessage\n }\n }\n`;\n\nexport const PAUSE_RUN = `\n mutation PauseRun($id: ID!) {\n pauseWorkflowRun(id: $id) {\n id\n status\n completedAt\n errorMessage\n }\n }\n`;\n\n// resumeWorkflowRun returns ResumeWorkflowResponse (success/message/run), not a run.\nexport const RESUME_RUN = `\n mutation ResumeRun($id: ID!, $payload: JSON) {\n resumeWorkflowRun(id: $id, payload: $payload) {\n success\n message\n resumedFromNodeId\n run {\n id\n status\n completedAt\n errorMessage\n }\n }\n }\n`;\n\n// The deployed resolver signature is `retryNode(id: ID!)` where `id` is the\n// NodeState id, not the run id. The tool takes a run id + workflow node id\n// from the caller, looks up the run to find the matching NodeState, and then\n// forwards the NodeState id to the mutation. The return type is a NodeState.\nexport const RETRY_RUN = `\n mutation RetryNode($id: ID!) {\n retryNode(id: $id) {\n id\n nodeId\n nodeType\n status\n error\n attemptCount\n }\n }\n`;\n\n// Credentials\n// ★ Creating a credential is a TWO-STEP flow. CreateConnectionInput has no `data`\n// and no `type` — there is no way to post raw secret material here. You create the\n// connection shell against a providerId, then attach the secret with one of the\n// authenticate* mutations below (or reference an existing vault secret at create time\n// via credentialSecretId / managedSecretName / vaultId).\nexport const CREATE_CREDENTIAL = `\n mutation CreateCredential($input: CreateConnectionInput!) {\n createConnection(input: $input) {\n id\n name\n description\n status\n providerId\n provider {\n id\n key\n name\n authType\n }\n credentialSource\n createdAt\n }\n }\n`;\n\nexport const AUTHENTICATE_CREDENTIAL_API_KEY = `\n mutation AuthenticateCredentialApiKey($input: ApiKeyAuthInput!) {\n authenticateWithApiKey(input: $input) {\n id\n name\n status\n grantedScopes\n externalAccountName\n errorMessage\n updatedAt\n }\n }\n`;\n\nexport const AUTHENTICATE_CREDENTIAL_BASIC = `\n mutation AuthenticateCredentialBasic($input: BasicAuthInput!) {\n authenticateWithBasicAuth(input: $input) {\n id\n name\n status\n grantedScopes\n externalAccountName\n errorMessage\n updatedAt\n }\n }\n`;\n\n// UpdateConnectionInput carries only { config, description, name } — secrets are\n// never updated through this path.\nexport const UPDATE_CREDENTIAL = `\n mutation UpdateCredential($id: ID!, $input: UpdateConnectionInput!) {\n updateConnection(id: $id, input: $input) {\n id\n name\n description\n status\n config\n updatedAt\n }\n }\n`;\n\nexport const DELETE_CREDENTIAL = `\n mutation DeleteCredential($id: ID!, $deleteVaultSecret: Boolean) {\n deleteConnection(id: $id, deleteVaultSecret: $deleteVaultSecret)\n }\n`;\n\n// Argument is `connectionId`, not `id`.\nexport const TEST_CREDENTIAL = `\n mutation TestCredential($connectionId: ID!) {\n testConnection(connectionId: $connectionId) {\n success\n message\n latencyMs\n }\n }\n`;\n\n// Webhooks\nexport const CREATE_WEBHOOK = `\n mutation CreateWebhook($input: CreateEventRegistrationInput!) {\n createEventRegistration(input: $input) {\n id\n name\n workflowKey\n triggerNodeId\n isActive\n status\n webhookUrl\n webhookToken\n updatedAt\n createdAt\n }\n }\n`;\n\n// ★ The previous UPDATE_WEBHOOK targeted `updateWebhook(id, input): Webhook!`, which\n// EXISTS and therefore passed schema validation — but returns the other subgraph's\n// Webhook, not our EventRegistration. Validation passing is not the same as being\n// correct; the return type has to be ours too. Same for the old deleteWebhook.\nexport const UPDATE_WEBHOOK = `\n mutation UpdateWebhook($id: ID!, $input: UpdateEventRegistrationInput!) {\n updateEventRegistration(id: $id, input: $input) {\n id\n name\n workflowKey\n triggerNodeId\n isActive\n status\n webhookUrl\n webhookToken\n updatedAt\n }\n }\n`;\n\nexport const DELETE_WEBHOOK = `\n mutation DeleteWebhook($id: ID!) {\n deleteEventRegistration(id: $id)\n }\n`;\n\n// activate and deactivate are the SAME mutation with a flag.\nexport const TOGGLE_WEBHOOK = `\n mutation ToggleWebhook($id: ID!, $isActive: Boolean!) {\n toggleEventRegistration(id: $id, isActive: $isActive) {\n id\n name\n workflowKey\n triggerNodeId\n isActive\n status\n webhookUrl\n webhookToken\n updatedAt\n }\n }\n`;\n\n// DEACTIVATE_WEBHOOK removed — see TOGGLE_WEBHOOK above.\n// Scheduled Jobs\nexport const CREATE_SCHEDULED_JOB = `\n mutation CreateScheduledJob($input: ScheduledJobInput!) {\n createWorkflowScheduledJob(input: $input) {\n success\n message\n job {\n id\n name\n workflowKey\n version\n schedule\n enabled\n nextRun\n lastRun\n config\n createdAt\n updatedAt\n }\n }\n }\n`;\n\nexport const UPDATE_SCHEDULED_JOB = `\n mutation UpdateScheduledJob($id: ID!, $input: WorkflowUpdateScheduledJobInput!) {\n updateWorkflowScheduledJob(id: $id, input: $input) {\n success\n message\n job {\n id\n name\n workflowKey\n version\n schedule\n enabled\n nextRun\n lastRun\n config\n createdAt\n updatedAt\n }\n }\n }\n`;\n\nexport const DELETE_SCHEDULED_JOB = `\n mutation DeleteScheduledJob($jobId: ID!) {\n deleteWorkflowScheduledJob(jobId: $jobId) {\n success\n message\n }\n }\n`;\n","/**\n * Internal helpers shared by the FluidGrids tool files.\n *\n * These keep each registration explicit (literal product-prefixed names via\n * mcpToolName, typed inputSchema, jsonResult/errorResult) while factoring out\n * the repetitive try/catch + structured-logging + input-pruning boilerplate.\n * Mirrors src/modules/headshotmarketing/tools/helpers.ts.\n *\n * Every FluidGrids operation is workspace tier, so `request` always goes to\n * `ctx.gql.workspace`. See ../operations.ts for why.\n */\n\nimport { errorResult, type McpContext, type ToolResult } from '../../../core/index.js';\n\n/**\n * graphql-request's ClientError builds its `message` as\n * `<gql error>: ${JSON.stringify({ response, request })}` — and `request`\n * carries the operation's **variables**. For this module that means an API key\n * (credentials_auth_api_key) or a password (credentials_auth_basic) would land\n * in the log line and in the text returned to the MCP client.\n *\n * So never surface `error.message` from a transport error. When the error looks\n * like a ClientError, report only the GraphQL error messages from the response;\n * the request half is dropped entirely. Same defect class as BOFF-7165.\n */\nfunction isClientErrorShape(\n error: unknown,\n): error is { response?: { errors?: { message?: string }[]; status?: number } } {\n return typeof error === 'object' && error !== null && 'response' in error && 'request' in error;\n}\n\nexport function safeErrorMessage(error: unknown): string {\n if (isClientErrorShape(error)) {\n const errors = error.response?.errors;\n if (Array.isArray(errors) && errors.length > 0) {\n const joined = errors\n .map((e) => e?.message)\n .filter((m): m is string => typeof m === 'string' && m.length > 0)\n .join('; ');\n if (joined) return joined;\n }\n const status = error.response?.status;\n return status === undefined ? 'GraphQL request failed' : `GraphQL error (status ${status})`;\n }\n return error instanceof Error ? error.message : String(error);\n}\n\n/**\n * Run a tool body, mapping any thrown error to a uniform error ToolResult and\n * logging it under the module-prefixed label. `label` is the short tool suffix\n * (e.g. 'workflows_get').\n */\nexport async function runTool(\n ctx: McpContext,\n label: string,\n run: () => Promise<ToolResult>,\n): Promise<ToolResult> {\n try {\n return await run();\n } catch (error) {\n const message = safeErrorMessage(error);\n ctx.logger.error(`fluidgrids ${label} failed`, { error: message });\n return errorResult(`Failed (${label}): ${message}`);\n }\n}\n\n/** Copy only the defined (non-undefined) entries into a fresh object. */\nexport function definedInput(obj: Record<string, unknown>): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(obj)) {\n if (value !== undefined) out[key] = value;\n }\n return out;\n}\n\n/**\n * Build a WorkflowPaginationInput, or undefined when the caller passed neither\n * bound. Sending `{}` would override the schema's own defaults with nulls.\n */\nexport function workflowPagination(\n limit?: number,\n offset?: number,\n): Record<string, unknown> | undefined {\n if (limit === undefined && offset === undefined) return undefined;\n return definedInput({ limit, offset });\n}\n","import { z } from 'zod';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { jsonResult, mcpToolName, type McpContext } from '../../../core/index.js';\nimport {\n AUTHENTICATE_CREDENTIAL_API_KEY,\n AUTHENTICATE_CREDENTIAL_BASIC,\n CREATE_CREDENTIAL,\n DELETE_CREDENTIAL,\n GET_CREDENTIAL,\n LIST_CREDENTIALS,\n LIST_CREDENTIAL_TYPES,\n TEST_CREDENTIAL,\n UPDATE_CREDENTIAL,\n} from '../operations.js';\nimport { definedInput, runTool } from './helpers.js';\n\n// FluidGrids credentials are Connections against a Provider, served by the\n// integrations subgraph. There is no `credential`/`credentialType` field on the\n// deployed schema — that naming is what made the old SDK documents unexecutable.\nfunction pagination(limit?: number, offset?: number): Record<string, unknown> | undefined {\n if (limit === undefined && offset === undefined) return undefined;\n return definedInput({ limit, offset });\n}\n\nexport function registerCredentialTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n server.registerTool(\n track(mcpToolName(ctx.productName, 'credentials_list')),\n {\n title: 'List Credentials',\n description: 'List stored connections (credentials) available to workflows.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n providerId: z.string().optional().describe('Filter by provider ID'),\n name: z.string().optional().describe('Filter by name'),\n limit: z.number().optional().describe('Max results'),\n offset: z.number().optional().describe('Offset for pagination'),\n },\n },\n async ({ providerId, name, limit, offset }) =>\n runTool(ctx, 'credentials_list', async () => {\n const filter = definedInput({ providerId, name });\n const data = await ctx.gql.workspace.request<{ getConnections: unknown }>(\n LIST_CREDENTIALS,\n {\n filter: Object.keys(filter).length > 0 ? filter : undefined,\n pagination: pagination(limit, offset),\n },\n );\n return jsonResult(data.getConnections);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'credentials_get')),\n {\n title: 'Get Credential',\n description: 'Get one connection by ID. Secret material is never returned.',\n annotations: { readOnlyHint: true },\n inputSchema: { id: z.string().describe('Connection ID') },\n },\n async ({ id }) =>\n runTool(ctx, 'credentials_get', async () => {\n const data = await ctx.gql.workspace.request<{ getConnection: unknown }>(GET_CREDENTIAL, {\n id,\n });\n return jsonResult(data.getConnection);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'credentials_list_types')),\n {\n title: 'List Credential Types',\n description: 'List the providers a connection can be created against.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n name: z.string().optional().describe('Filter by provider name'),\n limit: z.number().optional().describe('Max results'),\n offset: z.number().optional().describe('Offset for pagination'),\n },\n },\n async ({ name, limit, offset }) =>\n runTool(ctx, 'credentials_list_types', async () => {\n const filter = definedInput({ name });\n const data = await ctx.gql.workspace.request<{ getProviders: unknown }>(\n LIST_CREDENTIAL_TYPES,\n {\n filter: Object.keys(filter).length > 0 ? filter : undefined,\n pagination: pagination(limit, offset),\n },\n );\n return jsonResult(data.getProviders);\n }),\n );\n\n // BOFF-8720: the deployed `createConnection` resolver at\n // Algoshred/wspace-integrations-svc (PR #66, merged) now does a\n // `findFirst({ where: { OR: [{ id }, { key }] } })` so it accepts both\n // cuid and key forms of `providerId` AND persists the resolved\n // `provider.id` (not the raw input) to the FK column. The tool is\n // re-enabled here.\n server.registerTool(\n track(mcpToolName(ctx.productName, 'credentials_create')),\n {\n title: 'Create Credential',\n description:\n 'Create a connection against a provider. Secrets go to the vault; pass a reference, never a raw secret in config.',\n inputSchema: {\n name: z.string().describe('Connection name'),\n providerId: z.string().describe('Provider ID or key (e.g. \"openai\")'),\n description: z.string().optional().describe('Description'),\n config: z.unknown().optional().describe('Non-secret provider config as JSON'),\n context: z.unknown().optional().describe('Context JSON'),\n vaultId: z.string().optional().describe('Vault to store secret material in'),\n credentialSecretId: z.string().optional().describe('Existing vault secret reference'),\n managedSecretName: z.string().optional().describe('Managed secret name'),\n },\n },\n async (args) =>\n runTool(ctx, 'credentials_create', async () => {\n const data = await ctx.gql.workspace.request<{ createConnection: unknown }>(\n CREATE_CREDENTIAL,\n { input: definedInput({ ...args }) },\n );\n return jsonResult(data.createConnection);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'credentials_update')),\n {\n title: 'Update Credential',\n description: 'Update a connection’s name, description or non-secret config.',\n inputSchema: {\n id: z.string().describe('Connection ID'),\n name: z.string().optional().describe('Name'),\n description: z.string().optional().describe('Description'),\n config: z.unknown().optional().describe('Non-secret provider config as JSON'),\n },\n },\n async ({ id, ...input }) =>\n runTool(ctx, 'credentials_update', async () => {\n const data = await ctx.gql.workspace.request<{ updateConnection: unknown }>(\n UPDATE_CREDENTIAL,\n { id, input: definedInput(input) },\n );\n return jsonResult(data.updateConnection);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'credentials_delete')),\n {\n title: 'Delete Credential',\n description:\n 'Delete a connection. Set deleteVaultSecret to also destroy the stored secret — that is irreversible.',\n annotations: { destructiveHint: true },\n inputSchema: {\n id: z.string().describe('Connection ID'),\n deleteVaultSecret: z.boolean().optional().describe('Also delete the vault secret'),\n },\n },\n async ({ id, deleteVaultSecret }) =>\n runTool(ctx, 'credentials_delete', async () => {\n const data = await ctx.gql.workspace.request<{ deleteConnection: unknown }>(\n DELETE_CREDENTIAL,\n { id, deleteVaultSecret },\n );\n return jsonResult(data.deleteConnection);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'credentials_test')),\n {\n title: 'Test Credential',\n description: 'Verify a connection can authenticate against its provider.',\n annotations: { readOnlyHint: true },\n inputSchema: { connectionId: z.string().describe('Connection ID') },\n },\n async ({ connectionId }) =>\n runTool(ctx, 'credentials_test', async () => {\n const data = await ctx.gql.workspace.request<{ testConnection: unknown }>(TEST_CREDENTIAL, {\n connectionId,\n });\n return jsonResult(data.testConnection);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'credentials_auth_api_key')),\n {\n title: 'Authenticate Credential (API key)',\n description: 'Attach an API key to a connection via the API-key auth flow.',\n inputSchema: {\n connectionId: z.string().describe('Connection ID'),\n apiKey: z.string().describe('API key to store'),\n },\n },\n async ({ connectionId, apiKey }) =>\n runTool(ctx, 'credentials_auth_api_key', async () => {\n const data = await ctx.gql.workspace.request<{ authenticateWithApiKey: unknown }>(\n AUTHENTICATE_CREDENTIAL_API_KEY,\n { input: { connectionId, apiKey } },\n );\n return jsonResult(data.authenticateWithApiKey);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'credentials_auth_basic')),\n {\n title: 'Authenticate Credential (basic)',\n description: 'Attach basic-auth credentials to a connection.',\n inputSchema: {\n connectionId: z.string().describe('Connection ID'),\n username: z.string().describe('Username'),\n password: z.string().describe('Password'),\n },\n },\n async ({ connectionId, username, password }) =>\n runTool(ctx, 'credentials_auth_basic', async () => {\n const data = await ctx.gql.workspace.request<{ authenticateWithBasicAuth: unknown }>(\n AUTHENTICATE_CREDENTIAL_BASIC,\n { input: { connectionId, username, password } },\n );\n return jsonResult(data.authenticateWithBasicAuth);\n }),\n );\n}\n","import { z } from 'zod';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { jsonResult, mcpToolName, type McpContext } from '../../../core/index.js';\nimport {\n GET_DASHBOARD_SUMMARY,\n GET_SYSTEM_CONFIG,\n GET_USAGE_METRICS,\n SEARCH,\n SEARCH_BY_ENTITY_TYPE,\n} from '../operations.js';\nimport { definedInput, runTool } from './helpers.js';\n\n// The deployed `usageMetrics` resolver is strict: it requires full ISO 8601\n// datetimes (`YYYY-MM-DDTHH:MM:SSZ`), not date-only strings. Accept the\n// date-only form from callers and normalise — start-of-day for startDate,\n// end-of-day for endDate. The tool description advertises \"ISO 8601\" which\n// covers both, but the resolver's validation rejects the date-only variant\n// with a generic \"Please check the information\" error (BOFF-8716).\nconst ISO_DATE_ONLY = /^\\d{4}-\\d{2}-\\d{2}$/;\nfunction normalizeDate(value: string | undefined, endOfDay: boolean): string | undefined {\n if (typeof value !== 'string' || !ISO_DATE_ONLY.test(value)) return value;\n return `${value}T${endOfDay ? '23:59:59' : '00:00:00'}Z`;\n}\n\n/**\n * Read-only cross-cutting tools: dashboard, usage, search and system config.\n * Grouped in one file because each is one or two operations and they share no\n * domain object with the workflow surface.\n */\nexport function registerInsightTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n server.registerTool(\n track(mcpToolName(ctx.productName, 'dashboard_summary')),\n {\n title: 'Dashboard Summary',\n description: 'Workflow, run and failure counters for the current workspace.',\n annotations: { readOnlyHint: true },\n inputSchema: { projectId: z.string().optional().describe('Scope to one project') },\n },\n async ({ projectId }) =>\n runTool(ctx, 'dashboard_summary', async () => {\n const data = await ctx.gql.workspace.request<{ dashboardSummary: unknown }>(\n GET_DASHBOARD_SUMMARY,\n { projectId },\n );\n return jsonResult(data.dashboardSummary);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'usage_metrics')),\n {\n title: 'Usage Metrics',\n description: 'Usage metrics over a date range — run minutes and execution counts.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n startDate: z.string().describe('ISO 8601 start of the range'),\n endDate: z.string().describe('ISO 8601 end of the range'),\n userId: z.string().optional().describe('Scope to one user'),\n contextFilter: z.unknown().optional().describe('Context filter as JSON'),\n },\n },\n async (args) =>\n runTool(ctx, 'usage_metrics', async () => {\n const normalised: Record<string, unknown> = {\n ...args,\n startDate: normalizeDate(args.startDate, false),\n endDate: normalizeDate(args.endDate, true),\n };\n const data = await ctx.gql.workspace.request<{ usageMetrics: unknown }>(GET_USAGE_METRICS, {\n input: definedInput(normalised),\n });\n return jsonResult(data.usageMetrics);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'search')),\n {\n title: 'Search',\n description: 'Search across FluidGrids entities. Narrow with entityTypes when you know it.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n query: z.string().describe('Search query'),\n entityTypes: z.array(z.string()).optional().describe('Restrict to these entity types'),\n filters: z.unknown().optional().describe('Additional filters as JSON'),\n highlight: z.boolean().optional().describe('Return highlighted snippets'),\n limit: z.number().optional().describe('Max results'),\n offset: z.number().optional().describe('Offset for pagination'),\n },\n },\n async (args) =>\n runTool(ctx, 'search', async () => {\n const data = await ctx.gql.workspace.request<{ search: unknown }>(SEARCH, {\n input: definedInput({ ...args }),\n });\n return jsonResult(data.search);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'search_by_entity_type')),\n {\n title: 'Search By Entity Type',\n description: 'Search within a single entity type.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n entityType: z.string().describe('Entity type to search'),\n query: z.string().describe('Search query'),\n filters: z.unknown().optional().describe('Additional filters as JSON'),\n limit: z.number().optional().describe('Max results'),\n offset: z.number().optional().describe('Offset for pagination'),\n },\n },\n async (args) =>\n runTool(ctx, 'search_by_entity_type', async () => {\n const data = await ctx.gql.workspace.request<{ searchByEntityType: unknown }>(\n SEARCH_BY_ENTITY_TYPE,\n definedInput({ ...args }),\n );\n return jsonResult(data.searchByEntityType);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'system_config')),\n {\n title: 'System Config',\n description: 'Read the workflow engine’s effective system configuration.',\n annotations: { readOnlyHint: true },\n inputSchema: {},\n },\n async () =>\n runTool(ctx, 'system_config', async () => {\n const data = await ctx.gql.workspace.request<{ systemConfig: unknown }>(GET_SYSTEM_CONFIG);\n return jsonResult(data.systemConfig);\n }),\n );\n}\n","import { z } from 'zod';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { jsonResult, mcpToolName, type McpContext } from '../../../core/index.js';\nimport { GET_NODE, LIST_NODES } from '../operations.js';\nimport { runTool, workflowPagination } from './helpers.js';\n\nconst PublishTypeEnum = z.enum(['BUILTIN', 'CUSTOM', 'STORE']);\nconst NodeConfigStatusEnum = z.enum(['AVAILABLE', 'DEPRECATED', 'DISABLED']);\n\nexport function registerNodeTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n server.registerTool(\n track(mcpToolName(ctx.productName, 'nodes_list')),\n {\n title: 'List Nodes',\n description:\n 'List the node types available to build workflows with, from the node endpoint config registry.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n nodeType: z.string().optional().describe('Filter by node type'),\n publishType: PublishTypeEnum.optional().describe('BUILTIN, CUSTOM or STORE'),\n status: NodeConfigStatusEnum.optional().describe('Filter by availability'),\n limit: z.number().optional().describe('Max results'),\n offset: z.number().optional().describe('Offset for pagination'),\n },\n },\n async ({ nodeType, publishType, status, limit, offset }) =>\n runTool(ctx, 'nodes_list', async () => {\n const data = await ctx.gql.workspace.request<{ nodeEndpointConfigs: unknown }>(LIST_NODES, {\n nodeType,\n publishType,\n status,\n pagination: workflowPagination(limit, offset),\n });\n return jsonResult(data.nodeEndpointConfigs);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'nodes_get')),\n {\n title: 'Get Node',\n description:\n 'Get one node type at a specific version, including its input fields and operations.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n nodeType: z.string().describe('Node type identifier'),\n nodeVersion: z.string().describe('Node version'),\n },\n },\n async ({ nodeType, nodeVersion }) =>\n runTool(ctx, 'nodes_get', async () => {\n const data = await ctx.gql.workspace.request<{ nodeEndpointConfig: unknown }>(GET_NODE, {\n nodeType,\n nodeVersion,\n });\n return jsonResult(data.nodeEndpointConfig);\n }),\n );\n}\n","import { z } from 'zod';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { errorResult, jsonResult, mcpToolName, type McpContext } from '../../../core/index.js';\nimport {\n CANCEL_RUN,\n GET_RUN,\n GET_RUN_LOGS,\n LIST_RUNS,\n PAUSE_RUN,\n RESUME_RUN,\n RETRY_RUN,\n} from '../operations.js';\nimport { definedInput, runTool } from './helpers.js';\n\n// The deployed RunStatus enum is UPPERCASE. Comparing against lowercase is what\n// made `fluidgrids runs wait` never terminate (BOFF-7091) — keep these exact.\nconst RunStatusEnum = z.enum([\n 'CANCELLED',\n 'COMPLETED',\n 'FAILED',\n 'PENDING',\n 'RUNNING',\n 'TERMINATED',\n 'WAITING',\n]);\nconst RunLogLevelEnum = z.enum(['DEBUG', 'ERROR', 'INFO', 'WARN']);\n\nexport function registerRunTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n server.registerTool(\n track(mcpToolName(ctx.productName, 'runs_list')),\n {\n title: 'List Runs',\n description: 'List workflow runs, optionally filtered by workflowKey and status.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n workflowKey: z.string().optional().describe('Filter by workflow key'),\n status: RunStatusEnum.optional().describe('Filter by run status'),\n limit: z.number().optional().describe('Max results (default 10)'),\n offset: z.number().optional().describe('Offset for pagination (default 0)'),\n },\n },\n async ({ workflowKey, status, limit, offset }) =>\n runTool(ctx, 'runs_list', async () => {\n const data = await ctx.gql.workspace.request<{ workflowRuns: unknown }>(LIST_RUNS, {\n input: definedInput({ workflowKey, status, limit, offset }),\n });\n return jsonResult(data.workflowRuns);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'runs_get')),\n {\n title: 'Get Run',\n description:\n 'Get one workflow run, including per-node state. Poll this to follow a run to a terminal status.',\n annotations: { readOnlyHint: true },\n inputSchema: { id: z.string().describe('Run ID') },\n },\n async ({ id }) =>\n runTool(ctx, 'runs_get', async () => {\n const data = await ctx.gql.workspace.request<{ workflowRun: unknown }>(GET_RUN, { id });\n return jsonResult(data.workflowRun);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'runs_logs')),\n {\n title: 'Get Run Logs',\n description:\n 'Read a run log, newest page first. Keyset paginated: pass the previous page cursor as `after`.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n runId: z.string().describe('Run ID'),\n nodeId: z.string().optional().describe('Restrict to one node'),\n minLevel: RunLogLevelEnum.optional().describe('Minimum log level'),\n limit: z.number().optional().describe('Max log lines'),\n after: z.string().optional().describe('Keyset cursor from a previous page'),\n search: z.string().optional().describe('Substring filter'),\n includeChildRuns: z.boolean().optional().describe('Include logs from child runs'),\n },\n },\n async (args) =>\n runTool(ctx, 'runs_logs', async () => {\n const data = await ctx.gql.workspace.request<{ workflowRunLogs: unknown }>(\n GET_RUN_LOGS,\n definedInput({ ...args }),\n );\n return jsonResult(data.workflowRunLogs);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'runs_cancel')),\n {\n title: 'Cancel Run',\n description: 'Cancel an in-flight run. Terminal runs cannot be cancelled.',\n annotations: { destructiveHint: true },\n inputSchema: { id: z.string().describe('Run ID') },\n },\n async ({ id }) =>\n runTool(ctx, 'runs_cancel', async () => {\n const data = await ctx.gql.workspace.request<{ cancelWorkflowRun: unknown }>(CANCEL_RUN, {\n id,\n });\n return jsonResult(data.cancelWorkflowRun);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'runs_pause')),\n {\n title: 'Pause Run',\n description: 'Pause a running workflow run.',\n inputSchema: { id: z.string().describe('Run ID') },\n },\n async ({ id }) =>\n runTool(ctx, 'runs_pause', async () => {\n const data = await ctx.gql.workspace.request<{ pauseWorkflowRun: unknown }>(PAUSE_RUN, {\n id,\n });\n return jsonResult(data.pauseWorkflowRun);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'runs_resume')),\n {\n title: 'Resume Run',\n description:\n 'Resume a paused or waiting run. `payload` supplies the data a Wait node is blocked on.',\n inputSchema: {\n id: z.string().describe('Run ID'),\n payload: z.unknown().optional().describe('Payload to resume with'),\n },\n },\n async ({ id, payload }) =>\n runTool(ctx, 'runs_resume', async () => {\n const data = await ctx.gql.workspace.request<{ resumeWorkflowRun: unknown }>(RESUME_RUN, {\n id,\n payload,\n });\n return jsonResult(data.resumeWorkflowRun);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'runs_retry_node')),\n {\n title: 'Retry Node',\n description: 'Re-execute one failed node within a run, continuing from there.',\n inputSchema: {\n id: z.string().describe('Run ID'),\n nodeId: z.string().describe('Node ID to retry'),\n },\n },\n async ({ id: runId, nodeId }) =>\n runTool(ctx, 'runs_retry_node', async () => {\n // The deployed resolver takes a NodeState id, not a run id. Look the run\n // up to find the matching NodeState, then forward that id.\n const runData = await ctx.gql.workspace.request<{\n workflowRun: { nodeStates: Array<{ id: string; nodeId: string }> } | null;\n }>(GET_RUN, { id: runId });\n const state = runData.workflowRun?.nodeStates?.find((s) => s.nodeId === nodeId);\n if (!state) {\n return errorResult(`No node state found for run ${runId} node ${nodeId}`);\n }\n const data = await ctx.gql.workspace.request<{ retryNode: unknown }>(RETRY_RUN, {\n id: state.id,\n });\n return jsonResult(data.retryNode);\n }),\n );\n}\n","import { z } from 'zod';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { jsonResult, mcpToolName, type McpContext } from '../../../core/index.js';\nimport {\n CREATE_SCHEDULED_JOB,\n DELETE_SCHEDULED_JOB,\n GET_SCHEDULED_JOB,\n LIST_SCHEDULED_JOBS,\n UPDATE_SCHEDULED_JOB,\n} from '../operations.js';\nimport { definedInput, runTool, workflowPagination } from './helpers.js';\n\nexport function registerScheduledJobTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n server.registerTool(\n track(mcpToolName(ctx.productName, 'scheduled_jobs_list')),\n {\n title: 'List Scheduled Jobs',\n description: 'List schedules that trigger workflows on a cron or interval.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n enabled: z.boolean().optional().describe('Filter by enabled state'),\n workflowKey: z.string().optional().describe('Filter by workflow key'),\n limit: z.number().optional().describe('Max results'),\n offset: z.number().optional().describe('Offset for pagination'),\n },\n },\n async ({ enabled, workflowKey, limit, offset }) =>\n runTool(ctx, 'scheduled_jobs_list', async () => {\n const data = await ctx.gql.workspace.request<{ workflowScheduledJobs: unknown }>(\n LIST_SCHEDULED_JOBS,\n { enabled, workflowKey, pagination: workflowPagination(limit, offset) },\n );\n return jsonResult(data.workflowScheduledJobs);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'scheduled_jobs_get')),\n {\n title: 'Get Scheduled Job',\n description: 'Get one scheduled job by ID.',\n annotations: { readOnlyHint: true },\n inputSchema: { jobId: z.string().describe('Scheduled job ID') },\n },\n async ({ jobId }) =>\n runTool(ctx, 'scheduled_jobs_get', async () => {\n const data = await ctx.gql.workspace.request<{ workflowScheduledJob: unknown }>(\n GET_SCHEDULED_JOB,\n { jobId },\n );\n return jsonResult(data.workflowScheduledJob);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'scheduled_jobs_create')),\n {\n title: 'Create Scheduled Job',\n description:\n 'Schedule a workflow. `schedule` is the cron or interval expression the scheduler service evaluates.',\n inputSchema: {\n name: z.string().describe('Job name'),\n workflowKey: z.string().describe('Workflow key to run'),\n version: z.string().describe('Workflow version'),\n schedule: z.string().describe('Cron or interval expression'),\n enabled: z.boolean().optional().describe('Start enabled (default true)'),\n config: z.unknown().optional().describe('Job config as JSON'),\n },\n },\n async (args) =>\n runTool(ctx, 'scheduled_jobs_create', async () => {\n const data = await ctx.gql.workspace.request<{ createWorkflowScheduledJob: unknown }>(\n CREATE_SCHEDULED_JOB,\n { input: definedInput({ ...args }) },\n );\n return jsonResult(data.createWorkflowScheduledJob);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'scheduled_jobs_update')),\n {\n title: 'Update Scheduled Job',\n description: 'Update a scheduled job’s name, schedule, config or enabled state.',\n inputSchema: {\n jobId: z.string().describe('Scheduled job ID'),\n name: z.string().optional().describe('Name'),\n schedule: z.string().optional().describe('Cron or interval expression'),\n enabled: z.boolean().optional().describe('Enabled state'),\n config: z.unknown().optional().describe('Job config as JSON'),\n },\n },\n async ({ jobId, ...input }) =>\n runTool(ctx, 'scheduled_jobs_update', async () => {\n const data = await ctx.gql.workspace.request<{ updateWorkflowScheduledJob: unknown }>(\n UPDATE_SCHEDULED_JOB,\n { id: jobId, input: definedInput(input) },\n );\n return jsonResult(data.updateWorkflowScheduledJob);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'scheduled_jobs_delete')),\n {\n title: 'Delete Scheduled Job',\n description: 'Delete a scheduled job permanently.',\n annotations: { destructiveHint: true },\n inputSchema: { jobId: z.string().describe('Scheduled job ID') },\n },\n async ({ jobId }) =>\n runTool(ctx, 'scheduled_jobs_delete', async () => {\n const data = await ctx.gql.workspace.request<{ deleteWorkflowScheduledJob: unknown }>(\n DELETE_SCHEDULED_JOB,\n { jobId },\n );\n return jsonResult(data.deleteWorkflowScheduledJob);\n }),\n );\n}\n","import { z } from 'zod';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { jsonResult, mcpToolName, type McpContext } from '../../../core/index.js';\nimport {\n CREATE_WEBHOOK,\n DELETE_WEBHOOK,\n GET_WEBHOOK,\n LIST_WEBHOOKS,\n TOGGLE_WEBHOOK,\n UPDATE_WEBHOOK,\n} from '../operations.js';\nimport { definedInput, runTool } from './helpers.js';\n\n// Webhooks are EventRegistrations on the deployed schema — there is no\n// `Webhook` type with workflowId/path/method, which is what the pre-BOFF-7084\n// documents assumed.\nconst EventStatusEnum = z.enum(['ACTIVE', 'ARCHIVED', 'DISABLED', 'PAUSED']);\n\nexport function registerWebhookTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n server.registerTool(\n track(mcpToolName(ctx.productName, 'webhooks_list')),\n {\n title: 'List Webhooks',\n description: 'List event registrations (webhooks) that can trigger workflows.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n status: EventStatusEnum.optional().describe('Filter by status'),\n workflowKey: z.string().optional().describe('Filter by workflow key'),\n },\n },\n async ({ status, workflowKey }) =>\n runTool(ctx, 'webhooks_list', async () => {\n const data = await ctx.gql.workspace.request<{ eventRegistrations: unknown }>(\n LIST_WEBHOOKS,\n { status, workflowKey },\n );\n return jsonResult(data.eventRegistrations);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'webhooks_get')),\n {\n title: 'Get Webhook',\n description: 'Get one event registration by ID.',\n annotations: { readOnlyHint: true },\n inputSchema: { id: z.string().describe('Event registration ID') },\n },\n async ({ id }) =>\n runTool(ctx, 'webhooks_get', async () => {\n const data = await ctx.gql.workspace.request<{ eventRegistration: unknown }>(GET_WEBHOOK, {\n id,\n });\n return jsonResult(data.eventRegistration);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'webhooks_create')),\n {\n title: 'Create Webhook',\n description:\n 'Register an event source that triggers a workflow. triggerNodeId names the trigger node the event enters at. eventSource and eventType are required by the server schema (CreateEventRegistrationInput!); marking them optional in the tool wrapper produced a \"Field eventSource of required type String! was not provided\" error on every call (BOFF-8204).',\n inputSchema: {\n name: z.string().describe('Registration name'),\n workflowKey: z.string().describe('Workflow key to trigger'),\n triggerNodeId: z.string().describe('Trigger node ID'),\n eventSource: z.string().describe('Event source identifier'),\n eventType: z.string().describe('Event type'),\n description: z.string().optional().describe('Description'),\n config: z.unknown().optional().describe('Source-specific config as JSON'),\n payloadMapping: z.unknown().optional().describe('Payload mapping as JSON'),\n validationMethod: z.string().optional().describe('Signature validation method'),\n signatureHeader: z.string().optional().describe('Header carrying the signature'),\n apiKeyHeader: z.string().optional().describe('Header carrying the API key'),\n secretToken: z.string().optional().describe('Shared secret for validation'),\n projectId: z.string().optional().describe('Owning project ID'),\n tags: z.array(z.string()).optional().describe('Tags'),\n },\n },\n async (args) =>\n runTool(ctx, 'webhooks_create', async () => {\n const data = await ctx.gql.workspace.request<{ createEventRegistration: unknown }>(\n CREATE_WEBHOOK,\n { input: definedInput({ ...args }) },\n );\n return jsonResult(data.createEventRegistration);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'webhooks_update')),\n {\n title: 'Update Webhook',\n description: 'Update an event registration.',\n inputSchema: {\n id: z.string().describe('Event registration ID'),\n name: z.string().optional().describe('Name'),\n description: z.string().optional().describe('Description'),\n status: EventStatusEnum.optional().describe('Status'),\n isActive: z.boolean().optional().describe('Active flag'),\n config: z.unknown().optional().describe('Config as JSON'),\n payloadMapping: z.unknown().optional().describe('Payload mapping as JSON'),\n validationMethod: z.string().optional().describe('Signature validation method'),\n secretToken: z.string().optional().describe('Shared secret'),\n tags: z.array(z.string()).optional().describe('Tags'),\n },\n },\n async ({ id, ...input }) =>\n runTool(ctx, 'webhooks_update', async () => {\n const data = await ctx.gql.workspace.request<{ updateEventRegistration: unknown }>(\n UPDATE_WEBHOOK,\n { id, input: definedInput(input) },\n );\n return jsonResult(data.updateEventRegistration);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'webhooks_toggle')),\n {\n title: 'Toggle Webhook',\n description: 'Enable or disable an event registration without deleting it.',\n inputSchema: {\n id: z.string().describe('Event registration ID'),\n isActive: z.boolean().describe('True to enable, false to disable'),\n },\n },\n async ({ id, isActive }) =>\n runTool(ctx, 'webhooks_toggle', async () => {\n const data = await ctx.gql.workspace.request<{ toggleEventRegistration: unknown }>(\n TOGGLE_WEBHOOK,\n { id, isActive },\n );\n return jsonResult(data.toggleEventRegistration);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'webhooks_delete')),\n {\n title: 'Delete Webhook',\n description: 'Delete an event registration permanently.',\n annotations: { destructiveHint: true },\n inputSchema: { id: z.string().describe('Event registration ID') },\n },\n async ({ id }) =>\n runTool(ctx, 'webhooks_delete', async () => {\n const data = await ctx.gql.workspace.request<{ deleteEventRegistration: unknown }>(\n DELETE_WEBHOOK,\n { id },\n );\n return jsonResult(data.deleteEventRegistration);\n }),\n );\n}\n","import { z } from 'zod';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { jsonResult, mcpToolName, type McpContext } from '../../../core/index.js';\nimport {\n ACTIVATE_WORKFLOW,\n ARCHIVE_WORKFLOW,\n CREATE_WORKFLOW,\n DEACTIVATE_WORKFLOW,\n DELETE_WORKFLOW,\n DUPLICATE_WORKFLOW,\n GET_WORKFLOW,\n GET_WORKFLOW_VERSIONS,\n LIST_WORKFLOWS,\n PUBLISH_WORKFLOW,\n TRIGGER_WORKFLOW,\n UPDATE_WORKFLOW,\n} from '../operations.js';\nimport { definedInput, runTool } from './helpers.js';\n\nconst WorkflowStatusEnum = z.enum(['ACTIVE', 'ARCHIVED', 'DEPRECATED', 'DRAFT']);\n\nexport function registerWorkflowTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_list')),\n {\n title: 'List Workflows',\n description:\n 'List FluidGrids workflow definitions with optional filters and pagination. Use latestOnly to collapse a workflowKey to its newest version.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n status: WorkflowStatusEnum.optional().describe('Filter by workflow status'),\n category: z.string().optional().describe('Filter by category'),\n tags: z.array(z.string()).optional().describe('Filter by tags'),\n latestOnly: z\n .boolean()\n .optional()\n .describe('Return only the latest version per workflowKey'),\n limit: z.number().optional().describe('Max results (default 10)'),\n offset: z.number().optional().describe('Offset for pagination (default 0)'),\n },\n },\n async ({ status, category, tags, latestOnly, limit, offset }) =>\n runTool(ctx, 'workflows_list', async () => {\n const data = await ctx.gql.workspace.request<{ workflowDefinitions: unknown }>(\n LIST_WORKFLOWS,\n { input: definedInput({ status, category, tags, latestOnly, limit, offset }) },\n );\n return jsonResult(data.workflowDefinitions);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_get')),\n {\n title: 'Get Workflow',\n description:\n 'Get a single workflow definition by id, or by workflowKey (optionally pinned to a version). Without a version the executable version is resolved.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n id: z.string().optional().describe('Workflow definition ID'),\n workflowKey: z.string().optional().describe('Workflow key (alternative to id)'),\n version: z.string().optional().describe('Pin to a specific version'),\n },\n },\n async ({ id, workflowKey, version }) =>\n runTool(ctx, 'workflows_get', async () => {\n const data = await ctx.gql.workspace.request<{ workflowDefinition: unknown }>(\n GET_WORKFLOW,\n {\n id,\n workflowKey,\n version,\n },\n );\n return jsonResult(data.workflowDefinition);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_versions')),\n {\n title: 'List Workflow Versions',\n description: 'List every stored version of one workflowKey.',\n annotations: { readOnlyHint: true },\n inputSchema: { workflowKey: z.string().describe('Workflow key') },\n },\n async ({ workflowKey }) =>\n runTool(ctx, 'workflows_versions', async () => {\n const data = await ctx.gql.workspace.request<{ workflowVersions: unknown }>(\n GET_WORKFLOW_VERSIONS,\n { workflowKey },\n );\n return jsonResult(data.workflowVersions);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_create')),\n {\n title: 'Create Workflow',\n description:\n 'Create a workflow definition. definitionJson is the node/edge graph; workflowKey plus version identify it.',\n inputSchema: {\n workflowKey: z.string().describe('Stable key identifying the workflow'),\n name: z.string().describe('Human-readable name'),\n version: z.string().describe('Version string, e.g. \"1.0.0\"'),\n definitionJson: z.unknown().describe('Workflow graph (nodes + edges) as JSON'),\n description: z.string().optional().describe('Description'),\n category: z.string().optional().describe('Category'),\n icon: z.string().optional().describe('Icon identifier'),\n alias: z.string().optional().describe('Alias'),\n projectId: z.string().optional().describe('Owning project ID'),\n context: z.unknown().optional().describe('Context JSON'),\n tags: z.array(z.string()).optional().describe('Tags'),\n },\n },\n async (args) =>\n runTool(ctx, 'workflows_create', async () => {\n const data = await ctx.gql.workspace.request<{ createWorkflowDefinition: unknown }>(\n CREATE_WORKFLOW,\n { input: definedInput({ ...args }) },\n );\n return jsonResult(data.createWorkflowDefinition);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_update')),\n {\n title: 'Update Workflow',\n description:\n 'Update a workflow definition by id. Saving a change to a published workflow forks a new version rather than mutating the active one.',\n inputSchema: {\n id: z.string().describe('Workflow definition ID'),\n name: z.string().optional().describe('Name'),\n description: z.string().optional().describe('Description'),\n definitionJson: z.unknown().optional().describe('Workflow graph as JSON'),\n category: z.string().optional().describe('Category'),\n icon: z.string().optional().describe('Icon identifier'),\n alias: z.string().optional().describe('Alias'),\n context: z.unknown().optional().describe('Context JSON'),\n tags: z.array(z.string()).optional().describe('Tags'),\n version: z.string().optional().describe('Version'),\n },\n },\n async ({ id, ...input }) =>\n runTool(ctx, 'workflows_update', async () => {\n const data = await ctx.gql.workspace.request<{ updateWorkflowDefinition: unknown }>(\n UPDATE_WORKFLOW,\n { id, input: definedInput(input) },\n );\n return jsonResult(data.updateWorkflowDefinition);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_delete')),\n {\n title: 'Delete Workflow',\n description:\n 'Delete a workflow by key. Without a version every version of that key is deleted.',\n annotations: { destructiveHint: true },\n inputSchema: {\n workflowKey: z.string().describe('Workflow key'),\n version: z.string().optional().describe('Delete only this version'),\n },\n },\n async ({ workflowKey, version }) =>\n runTool(ctx, 'workflows_delete', async () => {\n const data = await ctx.gql.workspace.request<{ deleteWorkflowDefinition: unknown }>(\n DELETE_WORKFLOW,\n { workflowKey, version },\n );\n return jsonResult(data.deleteWorkflowDefinition);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_trigger')),\n {\n title: 'Trigger Workflow',\n description:\n 'Start a workflow run. triggerNodeId names the trigger node to start from; stopAtNodeId runs only up to a node (step debugging).',\n inputSchema: {\n workflowKey: z.string().describe('Workflow key'),\n version: z.string().describe('Workflow version'),\n triggerNodeId: z.string().describe('ID of the trigger node to start from'),\n triggerData: z.unknown().optional().describe('Payload passed to the trigger node'),\n context: z.unknown().optional().describe('Run context JSON'),\n stopAtNodeId: z\n .string()\n .optional()\n .describe('Stop after this node and mark the run COMPLETED'),\n },\n },\n async (args) =>\n runTool(ctx, 'workflows_trigger', async () => {\n const data = await ctx.gql.workspace.request<{ triggerWorkflow: unknown }>(\n TRIGGER_WORKFLOW,\n { input: definedInput({ ...args }) },\n );\n return jsonResult(data.triggerWorkflow);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_publish')),\n {\n title: 'Publish Workflow',\n description: 'Publish a workflow definition, making that version the executable one.',\n inputSchema: { id: z.string().describe('Workflow definition ID') },\n },\n async ({ id }) =>\n runTool(ctx, 'workflows_publish', async () => {\n const data = await ctx.gql.workspace.request<{ publishWorkflow: unknown }>(\n PUBLISH_WORKFLOW,\n { id },\n );\n return jsonResult(data.publishWorkflow);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_activate')),\n {\n title: 'Activate Workflow',\n description:\n 'Activate a workflow definition. Exactly one version per workflowKey may be ACTIVE.',\n inputSchema: { id: z.string().describe('Workflow definition ID') },\n },\n async ({ id }) =>\n runTool(ctx, 'workflows_activate', async () => {\n const data = await ctx.gql.workspace.request<{ activateWorkflowDefinition: unknown }>(\n ACTIVATE_WORKFLOW,\n { id },\n );\n return jsonResult(data.activateWorkflowDefinition);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_deactivate')),\n {\n title: 'Deactivate Workflow',\n description: 'Deactivate a workflow definition so no version of the key is executable.',\n inputSchema: { id: z.string().describe('Workflow definition ID') },\n },\n async ({ id }) =>\n runTool(ctx, 'workflows_deactivate', async () => {\n const data = await ctx.gql.workspace.request<{ deactivateWorkflowDefinition: unknown }>(\n DEACTIVATE_WORKFLOW,\n { id },\n );\n return jsonResult(data.deactivateWorkflowDefinition);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_duplicate')),\n {\n title: 'Duplicate Workflow',\n description: 'Copy an existing workflow version to a new workflowKey.',\n inputSchema: {\n workflowKey: z.string().describe('Source workflow key'),\n version: z.string().describe('Source version'),\n newWorkflowKey: z.string().describe('Key for the copy'),\n newVersion: z.string().optional().describe('Version for the copy'),\n },\n },\n async ({ workflowKey, version, newWorkflowKey, newVersion }) =>\n runTool(ctx, 'workflows_duplicate', async () => {\n const data = await ctx.gql.workspace.request<{ duplicateWorkflow: unknown }>(\n DUPLICATE_WORKFLOW,\n { workflowKey, version, input: definedInput({ newWorkflowKey, newVersion }) },\n );\n return jsonResult(data.duplicateWorkflow);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_archive')),\n {\n title: 'Archive Workflow',\n description: 'Archive a workflow definition. Reversible: archived workflows still list.',\n annotations: { destructiveHint: true },\n inputSchema: { id: z.string().describe('Workflow definition ID') },\n },\n async ({ id }) =>\n runTool(ctx, 'workflows_archive', async () => {\n const data = await ctx.gql.workspace.request<{ archiveWorkflow: unknown }>(\n ARCHIVE_WORKFLOW,\n { id },\n );\n return jsonResult(data.archiveWorkflow);\n }),\n );\n}\n","import { z } from 'zod';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { mcpPromptName, type McpContext } from '../../core/index.js';\n\n/**\n * FluidGrids MCP prompts — guided multi-step workflows. Names are\n * product-prefixed via mcpPromptName and tracked at function entry.\n */\nexport function registerFluidgridsPrompts(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n const p = ctx.productName;\n const buildName = track(mcpPromptName(p, 'build-workflow'));\n const debugName = track(mcpPromptName(p, 'debug-run'));\n\n // <product>-build-workflow — author, publish and trigger a workflow\n server.registerPrompt(\n buildName,\n {\n title: 'Build a Workflow',\n description:\n 'Guide for authoring a FluidGrids workflow end to end: pick nodes, create the definition, publish a version, then trigger it and confirm the run completes.',\n argsSchema: {\n goal: z.string().optional().describe('What the workflow should do'),\n workflowKey: z.string().optional().describe('Workflow key to use'),\n },\n },\n ({ goal, workflowKey }) => {\n ctx.logger.debug(`Prompt ${buildName} called`, { goal, workflowKey });\n const goalNote = goal\n ? `The workflow should: ${goal}`\n : 'Ask the user what the workflow should do before building anything.';\n const keyNote = workflowKey\n ? `Use the workflowKey \"${workflowKey}\".`\n : 'Choose a stable, descriptive workflowKey and confirm it with the user.';\n return {\n messages: [\n {\n role: 'user' as const,\n content: {\n type: 'text' as const,\n text: `Build a FluidGrids workflow.\n\n${goalNote}\n${keyNote}\n\nFollow this order and stop if a step fails:\n\n1. \\`${p}_nodes_list\\` — find the node types you need. Use \\`${p}_nodes_get\\` to read a\n node's input fields before wiring it; do not guess field names.\n2. \\`${p}_workflows_create\\` — build \\`definitionJson\\` as a graph of nodes and edges.\n Exactly one trigger node. Note its node id: triggering needs it.\n3. \\`${p}_workflows_publish\\` then \\`${p}_workflows_activate\\` — only an active version\n is executable, and only one version per key may be ACTIVE.\n4. \\`${p}_workflows_trigger\\` — pass \\`triggerNodeId\\` and any \\`triggerData\\`.\n5. \\`${p}_runs_get\\` — poll until status is terminal (COMPLETED, FAILED, CANCELLED or\n TERMINATED). Statuses are UPPERCASE.\n6. If it did not complete, run \\`${p}_debug-run\\` on the run id.\n\nIf the workflow needs credentials, create them with \\`${p}_credentials_create\\` and\nverify with \\`${p}_credentials_test\\` BEFORE triggering — a missing connection fails\nthe run at the node, not at save time.`,\n },\n },\n ],\n };\n },\n );\n\n // <product>-debug-run — diagnose a failed run\n server.registerPrompt(\n debugName,\n {\n title: 'Debug a Run',\n description:\n 'Guide for diagnosing a FluidGrids run that failed or stalled: read node state, read the log, then retry the failing node or fix the definition.',\n argsSchema: { runId: z.string().optional().describe('Run ID to diagnose') },\n },\n ({ runId }) => {\n ctx.logger.debug(`Prompt ${debugName} called`, { runId });\n const runNote = runId\n ? `Diagnose run \"${runId}\".`\n : `Ask for the run id, or find it with \\`${p}_runs_list\\` filtered to status FAILED.`;\n return {\n messages: [\n {\n role: 'user' as const,\n content: {\n type: 'text' as const,\n text: `Diagnose a FluidGrids run.\n\n${runNote}\n\n1. \\`${p}_runs_get\\` — read the run and its per-node state. Identify the FIRST node that\n did not succeed; later failures are usually consequences of it.\n2. \\`${p}_runs_logs\\` — read that node's log with \\`nodeId\\` set, \\`minLevel\\` ERROR first,\n then widen to WARN/INFO if the error alone is not conclusive.\n3. Classify before acting:\n - credential/auth error -> \\`${p}_credentials_test\\` the connection the node uses\n - bad input -> compare against \\`${p}_nodes_get\\` input fields for that node type\n - transient/upstream -> \\`${p}_runs_retry_node\\` is appropriate\n - wrong graph -> fix \\`definitionJson\\` via \\`${p}_workflows_update\\` (this forks a new\n version), then publish, activate and trigger again\n4. Only retry once you know which class it is. Retrying a bad definition just\n reproduces the failure.\n\nA run stuck in WAITING is not failed — it is blocked on a Wait node. Resume it with\n\\`${p}_runs_resume\\` and the payload it expects.`,\n },\n },\n ],\n };\n },\n );\n}\n","import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { mcpResourceUri, type McpContext } from '../../core/index.js';\nimport { LIST_NODES } from './operations.js';\nimport { safeErrorMessage } from './tools/helpers.js';\n\n/**\n * Read-only FluidGrids MCP resources. URIs are product-prefixed via\n * mcpResourceUri so they don't collide when multiple MCP servers run side by\n * side. Each is tracked at function entry so the shell manifest reflects what\n * was registered even though registration is imperative.\n */\nexport function registerFluidgridsResources(\n server: McpServer,\n ctx: McpContext,\n track: (uri: string) => string,\n): void {\n const schemaUri = track(mcpResourceUri(ctx.productName, 'schema'));\n const nodesUri = track(mcpResourceUri(ctx.productName, 'nodes'));\n\n // <product>://schema — domain overview\n server.registerResource(\n 'fluidgrids-schema',\n schemaUri,\n {\n title: 'FluidGrids Domain Schema',\n description:\n 'Overview of the FluidGrids workflow-automation domain — entities, enums, and the per-entity tool surface.',\n mimeType: 'text/plain',\n },\n async () => {\n ctx.logger.debug(`Resource ${schemaUri} requested`);\n const schema = `# FluidGrids Domain (Overview)\n\nVisual workflow automation. A workflow is a graph of nodes; running one produces a run.\n\n## Core entities\n- WorkflowDefinition — identified by (workflowKey, version). Many versions per key;\n at most ONE is ACTIVE. Saving over a published version forks a new version.\n- WorkflowRun — one execution. Has per-node state and a log stream.\n- NodeEndpointConfig — an available node type at a version (BUILTIN | CUSTOM | STORE).\n- Connection — a stored credential against a Provider. Secrets live in the vault.\n- EventRegistration — an event source (webhook) that triggers a workflow.\n- ScheduledJob — a cron/interval schedule that triggers a workflow.\n\n## Enums\n- WorkflowStatus: ACTIVE | ARCHIVED | DEPRECATED | DRAFT\n- RunStatus: PENDING | RUNNING | WAITING | COMPLETED | FAILED | CANCELLED | TERMINATED\n (UPPERCASE on the wire — comparing lowercase is a known source of hangs)\n- RunLogLevel: DEBUG | INFO | WARN | ERROR\n- PublishType: BUILTIN | CUSTOM | STORE\n- NodeConfigStatus: AVAILABLE | DEPRECATED | DISABLED\n- EventStatus: ACTIVE | PAUSED | DISABLED | ARCHIVED\n\n## Typical sequence\n1. ${ctx.productName}_nodes_list — see what nodes exist\n2. ${ctx.productName}_workflows_create — create a definition with a definitionJson graph\n3. ${ctx.productName}_workflows_publish / _activate — make a version executable\n4. ${ctx.productName}_workflows_trigger — start a run\n5. ${ctx.productName}_runs_get / _runs_logs — follow it to a terminal status\n\n## Tier\nEvery tool here is workspace tier and needs a workspace context. Sign in and\nselect a workspace with the auth tools first.\n`;\n return { contents: [{ uri: schemaUri, mimeType: 'text/plain', text: schema }] };\n },\n );\n\n // <product>://nodes — live node catalogue\n server.registerResource(\n 'fluidgrids-nodes',\n nodesUri,\n {\n title: 'FluidGrids Node Catalogue',\n description:\n 'The node types currently available to build workflows with, read live from the node endpoint config registry.',\n mimeType: 'application/json',\n },\n async () => {\n ctx.logger.debug(`Resource ${nodesUri} requested`);\n try {\n const data = await ctx.gql.workspace.request<{ nodeEndpointConfigs: unknown }>(LIST_NODES, {\n status: 'AVAILABLE',\n });\n return {\n contents: [\n {\n uri: nodesUri,\n mimeType: 'application/json',\n text: JSON.stringify(data.nodeEndpointConfigs, null, 2),\n },\n ],\n };\n } catch (error) {\n // Resources must not throw: an unauthenticated client reading this\n // should see why, not an opaque transport failure.\n const message = safeErrorMessage(error);\n ctx.logger.error('fluidgrids nodes resource failed', { error: message });\n return {\n contents: [\n {\n uri: nodesUri,\n mimeType: 'application/json',\n text: JSON.stringify(\n {\n error: message,\n hint: 'Sign in and select a workspace first — the node registry is workspace-scoped.',\n },\n null,\n 2,\n ),\n },\n ],\n };\n }\n },\n );\n}\n","/**\n * FluidGrids module (BOFF-7088) — the workflow-automation surface of the\n * FluidGrids product: workflows, runs, nodes, credentials, webhooks, scheduled\n * jobs, plus read-only dashboard/usage/search/config.\n *\n * Before this module the fluidgrids-mcp shell mounted only generic platform\n * modules (and, by copy-paste, `vibecontrols`), so an MCP client talking to\n * FluidGrids had 600+ tools and not one that could touch a workflow.\n *\n * Every GraphQL document lives in ./operations.ts, ported from `@fluidgrids/sdk`\n * where each one is validated against vendored snapshots of the deployed\n * supergraphs in CI. All of them are workspace tier.\n */\n\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport type { McpContext, McpModule, ModuleRegistration } from '../../core/index.js';\nimport { registerCredentialTools } from './tools/credentials.js';\nimport { registerInsightTools } from './tools/insights.js';\nimport { registerNodeTools } from './tools/nodes.js';\nimport { registerRunTools } from './tools/runs.js';\nimport { registerScheduledJobTools } from './tools/scheduled-jobs.js';\nimport { registerWebhookTools } from './tools/webhooks.js';\nimport { registerWorkflowTools } from './tools/workflows.js';\nimport { registerFluidgridsPrompts } from './prompts.js';\nimport { registerFluidgridsResources } from './resources.js';\n\nconst fluidgridsModule: McpModule = {\n id: 'fluidgrids',\n version: '0.0.1',\n displayName: 'FluidGrids',\n capabilities: { tools: {}, resources: {}, prompts: {} },\n\n register(server: McpServer, ctx: McpContext): ModuleRegistration {\n const tools: string[] = [];\n const resources: string[] = [];\n const prompts: string[] = [];\n\n const trackTool = (n: string): string => {\n tools.push(n);\n return n;\n };\n const trackResource = (uri: string): string => {\n resources.push(uri);\n return uri;\n };\n const trackPrompt = (n: string): string => {\n prompts.push(n);\n return n;\n };\n\n registerWorkflowTools(server, ctx, trackTool);\n registerRunTools(server, ctx, trackTool);\n registerNodeTools(server, ctx, trackTool);\n registerCredentialTools(server, ctx, trackTool);\n registerWebhookTools(server, ctx, trackTool);\n registerScheduledJobTools(server, ctx, trackTool);\n registerInsightTools(server, ctx, trackTool);\n\n registerFluidgridsResources(server, ctx, trackResource);\n registerFluidgridsPrompts(server, ctx, trackPrompt);\n\n return { tools, resources, prompts };\n },\n};\n\nexport default fluidgridsModule;\n"]}
|