@burdenoff/mcp-libs 2026.704.1 → 2026.719.1
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.
- package/dist/{chunk-WWFVD7BO.js → chunk-RHWHUY5Y.js} +3 -3
- package/dist/{chunk-WWFVD7BO.js.map → chunk-RHWHUY5Y.js.map} +1 -1
- package/dist/{chunk-H2OYWLOA.js → chunk-YOSQUY3M.js} +101 -35
- package/dist/chunk-YOSQUY3M.js.map +1 -0
- package/dist/core/index.cjs +101 -32
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/index.cjs +97 -31
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/modules/adaptercloud/index.cjs +14 -14
- package/dist/modules/adaptercloud/index.cjs.map +1 -1
- package/dist/modules/adaptercloud/index.js +1 -1
- package/dist/modules/artistrybase/index.cjs +14 -14
- package/dist/modules/artistrybase/index.cjs.map +1 -1
- package/dist/modules/artistrybase/index.js +1 -1
- package/dist/modules/assethandler/index.cjs +14 -14
- package/dist/modules/assethandler/index.cjs.map +1 -1
- package/dist/modules/assethandler/index.js +1 -1
- package/dist/modules/atheletebridge/index.cjs +14 -14
- package/dist/modules/atheletebridge/index.cjs.map +1 -1
- package/dist/modules/atheletebridge/index.js +1 -1
- package/dist/modules/auth/index.cjs +14 -14
- package/dist/modules/auth/index.cjs.map +1 -1
- package/dist/modules/auth/index.js +3 -3
- package/dist/modules/billing/index.cjs +14 -14
- package/dist/modules/billing/index.cjs.map +1 -1
- package/dist/modules/billing/index.js +1 -1
- package/dist/modules/brainyrich/index.cjs +14 -14
- package/dist/modules/brainyrich/index.cjs.map +1 -1
- package/dist/modules/brainyrich/index.js +1 -1
- package/dist/modules/buildmyiq/index.cjs +14 -14
- package/dist/modules/buildmyiq/index.cjs.map +1 -1
- package/dist/modules/buildmyiq/index.js +1 -1
- package/dist/modules/channels/index.cjs +14 -14
- package/dist/modules/channels/index.cjs.map +1 -1
- package/dist/modules/channels/index.js +1 -1
- package/dist/modules/collabkin/index.cjs +14 -14
- package/dist/modules/collabkin/index.cjs.map +1 -1
- package/dist/modules/collabkin/index.js +1 -1
- package/dist/modules/comradecircle/index.cjs +14 -14
- package/dist/modules/comradecircle/index.cjs.map +1 -1
- package/dist/modules/comradecircle/index.js +1 -1
- package/dist/modules/conversations/index.cjs +14 -14
- package/dist/modules/conversations/index.cjs.map +1 -1
- package/dist/modules/conversations/index.js +1 -1
- package/dist/modules/coolandlovely/index.cjs +14 -14
- package/dist/modules/coolandlovely/index.cjs.map +1 -1
- package/dist/modules/coolandlovely/index.js +1 -1
- package/dist/modules/cosmicintersection/index.cjs +14 -14
- package/dist/modules/cosmicintersection/index.cjs.map +1 -1
- package/dist/modules/cosmicintersection/index.js +1 -1
- package/dist/modules/crewfoundry/index.cjs +14 -14
- package/dist/modules/crewfoundry/index.cjs.map +1 -1
- package/dist/modules/crewfoundry/index.js +1 -1
- package/dist/modules/devportal/index.cjs +14 -14
- package/dist/modules/devportal/index.cjs.map +1 -1
- package/dist/modules/devportal/index.js +1 -1
- package/dist/modules/ecoimpacthub/index.cjs +14 -14
- package/dist/modules/ecoimpacthub/index.cjs.map +1 -1
- package/dist/modules/ecoimpacthub/index.js +1 -1
- package/dist/modules/eventfullymanaged/index.cjs +14 -14
- package/dist/modules/eventfullymanaged/index.cjs.map +1 -1
- package/dist/modules/eventfullymanaged/index.js +1 -1
- package/dist/modules/export/index.cjs +14 -14
- package/dist/modules/export/index.cjs.map +1 -1
- package/dist/modules/export/index.js +1 -1
- package/dist/modules/files/index.cjs +14 -14
- package/dist/modules/files/index.cjs.map +1 -1
- package/dist/modules/files/index.js +1 -1
- package/dist/modules/ggnomad/index.cjs +14 -14
- package/dist/modules/ggnomad/index.cjs.map +1 -1
- package/dist/modules/ggnomad/index.js +1 -1
- package/dist/modules/govcitizenhub/index.cjs +14 -14
- package/dist/modules/govcitizenhub/index.cjs.map +1 -1
- package/dist/modules/govcitizenhub/index.js +1 -1
- package/dist/modules/groups/index.cjs +14 -14
- package/dist/modules/groups/index.cjs.map +1 -1
- package/dist/modules/groups/index.js +1 -1
- package/dist/modules/headshotmarketing/index.cjs +14 -14
- package/dist/modules/headshotmarketing/index.cjs.map +1 -1
- package/dist/modules/headshotmarketing/index.js +1 -1
- package/dist/modules/health/index.cjs +21 -19
- package/dist/modules/health/index.cjs.map +1 -1
- package/dist/modules/health/index.js +1 -1
- package/dist/modules/hookmovies/index.cjs +14 -14
- package/dist/modules/hookmovies/index.cjs.map +1 -1
- package/dist/modules/hookmovies/index.js +1 -1
- package/dist/modules/housingvista/index.cjs +14 -14
- package/dist/modules/housingvista/index.cjs.map +1 -1
- package/dist/modules/housingvista/index.js +1 -1
- package/dist/modules/integrations/index.cjs +14 -14
- package/dist/modules/integrations/index.cjs.map +1 -1
- package/dist/modules/integrations/index.js +1 -1
- package/dist/modules/intelwatchtower/index.cjs +14 -14
- package/dist/modules/intelwatchtower/index.cjs.map +1 -1
- package/dist/modules/intelwatchtower/index.js +1 -1
- package/dist/modules/kadaikodi/index.cjs +14 -14
- package/dist/modules/kadaikodi/index.cjs.map +1 -1
- package/dist/modules/kadaikodi/index.js +1 -1
- package/dist/modules/labsofscience/index.cjs +14 -14
- package/dist/modules/labsofscience/index.cjs.map +1 -1
- package/dist/modules/labsofscience/index.js +1 -1
- package/dist/modules/manufacturedops/index.cjs +14 -14
- package/dist/modules/manufacturedops/index.cjs.map +1 -1
- package/dist/modules/manufacturedops/index.js +1 -1
- package/dist/modules/movethewheels/index.cjs +14 -14
- package/dist/modules/movethewheels/index.cjs.map +1 -1
- package/dist/modules/movethewheels/index.js +1 -1
- package/dist/modules/mybodyshield/index.cjs +14 -14
- package/dist/modules/mybodyshield/index.cjs.map +1 -1
- package/dist/modules/mybodyshield/index.js +1 -1
- package/dist/modules/notifications/index.cjs +14 -14
- package/dist/modules/notifications/index.cjs.map +1 -1
- package/dist/modules/notifications/index.js +1 -1
- package/dist/modules/organizations/index.cjs +14 -14
- package/dist/modules/organizations/index.cjs.map +1 -1
- package/dist/modules/organizations/index.js +1 -1
- package/dist/modules/planmagnet/index.cjs +14 -14
- package/dist/modules/planmagnet/index.cjs.map +1 -1
- package/dist/modules/planmagnet/index.js +1 -1
- package/dist/modules/products/index.cjs +14 -14
- package/dist/modules/products/index.cjs.map +1 -1
- package/dist/modules/products/index.js +1 -1
- package/dist/modules/proserviceworld/index.cjs +14 -14
- package/dist/modules/proserviceworld/index.cjs.map +1 -1
- package/dist/modules/proserviceworld/index.js +1 -1
- package/dist/modules/rbac/index.cjs +14 -14
- package/dist/modules/rbac/index.cjs.map +1 -1
- package/dist/modules/rbac/index.js +1 -1
- package/dist/modules/sandbox/index.cjs +14 -14
- package/dist/modules/sandbox/index.cjs.map +1 -1
- package/dist/modules/sandbox/index.js +1 -1
- package/dist/modules/scheduler/index.cjs +14 -14
- package/dist/modules/scheduler/index.cjs.map +1 -1
- package/dist/modules/scheduler/index.js +1 -1
- package/dist/modules/security/index.cjs +14 -14
- package/dist/modules/security/index.cjs.map +1 -1
- package/dist/modules/security/index.js +1 -1
- package/dist/modules/semanticfed/index.cjs +14 -14
- package/dist/modules/semanticfed/index.cjs.map +1 -1
- package/dist/modules/semanticfed/index.js +1 -1
- package/dist/modules/store/index.cjs +14 -14
- package/dist/modules/store/index.cjs.map +1 -1
- package/dist/modules/store/index.js +1 -1
- package/dist/modules/subscriberbot/index.cjs +14 -14
- package/dist/modules/subscriberbot/index.cjs.map +1 -1
- package/dist/modules/subscriberbot/index.js +1 -1
- package/dist/modules/support/index.cjs +14 -14
- package/dist/modules/support/index.cjs.map +1 -1
- package/dist/modules/support/index.js +1 -1
- package/dist/modules/tags/index.cjs +14 -14
- package/dist/modules/tags/index.cjs.map +1 -1
- package/dist/modules/tags/index.js +1 -1
- package/dist/modules/technospam/index.cjs +14 -14
- package/dist/modules/technospam/index.cjs.map +1 -1
- package/dist/modules/technospam/index.js +1 -1
- package/dist/modules/theculturepost/index.cjs +14 -14
- package/dist/modules/theculturepost/index.cjs.map +1 -1
- package/dist/modules/theculturepost/index.js +1 -1
- package/dist/modules/theglobalfuel/index.cjs +14 -14
- package/dist/modules/theglobalfuel/index.cjs.map +1 -1
- package/dist/modules/theglobalfuel/index.js +1 -1
- package/dist/modules/timecampus/index.cjs +21 -16
- package/dist/modules/timecampus/index.cjs.map +1 -1
- package/dist/modules/timecampus/index.js +8 -3
- package/dist/modules/timecampus/index.js.map +1 -1
- package/dist/modules/tours/index.cjs +14 -14
- package/dist/modules/tours/index.cjs.map +1 -1
- package/dist/modules/tours/index.js +1 -1
- package/dist/modules/vibecontrols/index.cjs +14 -14
- package/dist/modules/vibecontrols/index.cjs.map +1 -1
- package/dist/modules/vibecontrols/index.js +2 -2
- package/dist/modules/workspaces/index.cjs +14 -14
- package/dist/modules/workspaces/index.cjs.map +1 -1
- package/dist/modules/workspaces/index.js +1 -1
- package/dist/{tool-name-DlnrBsZ6.d.ts → tool-name-BaPNMZdj.d.ts} +17 -1
- package/dist/{tool-name-CQf_IqAj.d.cts → tool-name-Bvb36qmq.d.cts} +17 -1
- package/package.json +1 -1
- package/dist/chunk-H2OYWLOA.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/core/errors.ts","../../../src/core/result.ts","../../../src/core/tool-name.ts","../../../src/modules/integrations/operations.ts","../../../src/modules/integrations/tools.ts","../../../src/modules/integrations/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,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A,IACF;AAAA,GACF;AACF;;;ACluBA,IAAM,kBAAA,GAAgC;AAAA,EACpC,EAAA,EAAI,cAAA;AAAA,EACJ,OAAA,EAAS,OAAA;AAAA,EACT,WAAA,EAAa,cAAA;AAAA,EACb,SAAA,EAAW,CAAC,MAAM,CAAA;AAAA,EAClB,YAAA,EAAc,EAAE,KAAA,EAAO,EAAC,EAAE;AAAA,EAE1B,QAAA,CAAS,QAAmB,GAAA,EAAqC;AAC/D,IAAA,MAAM,QAAkB,EAAC;AACzB,IAAA,MAAM,KAAA,GAAQ,CAAC,CAAA,KAAsB;AACnC,MAAA,KAAA,CAAM,KAAK,CAAC,CAAA;AACZ,MAAA,OAAO,CAAA;AAAA,IACT,CAAA;AAEA,IAAA,yBAAA,CAA0B,MAAA,EAAQ,KAAK,KAAK,CAAA;AAE5C,IAAA,OAAO,EAAE,KAAA,EAAO,SAAA,EAAW,EAAC,EAAG,OAAA,EAAS,EAAC,EAAE;AAAA,EAC7C;AACF,CAAA;AAEA,IAAO,oBAAA,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 * 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';\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\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 };\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 } }\n | 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 * 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","export const GET_PROVIDERS = `\n query GetProviders($filter: ProviderFilterInput, $pagination: IntegrationsPaginationInput) {\n getProviders(filter: $filter, pagination: $pagination) {\n items { id key name category authType isEnabled }\n total hasMore\n }\n }\n`;\n\nexport const GET_PROVIDER = `\n query GetProvider($id: ID!) {\n getProvider(id: $id) {\n id key name authType category connectionCount\n }\n }\n`;\n\nexport const GET_CONNECTIONS = `\n query GetConnections($filter: ConnectionFilterInput, $pagination: IntegrationsPaginationInput) {\n getConnections(filter: $filter, pagination: $pagination) {\n items { id name providerId status grantedScopes }\n total hasMore\n }\n }\n`;\n\nexport const GET_CONNECTION = `\n query GetConnection($id: ID!) {\n getConnection(id: $id) {\n id name providerId status externalAccountEmail credentialSource\n }\n }\n`;\n\nexport const CREATE_CONNECTION = `\n mutation CreateConnection($input: CreateConnectionInput!) {\n createConnection(input: $input) {\n id name status providerId\n }\n }\n`;\n\nexport const DELETE_CONNECTION = `\n mutation DeleteConnection($id: ID!, $deleteVaultSecret: Boolean) {\n deleteConnection(id: $id, deleteVaultSecret: $deleteVaultSecret)\n }\n`;\n\nexport const GET_INTEGRATION_LOGS = `\n query GetIntegrationLogs($filter: LogFilterInput, $pagination: IntegrationsPaginationInput) {\n getIntegrationLogs(filter: $filter, pagination: $pagination) {\n items { id action level message createdAt }\n total hasMore\n }\n }\n`;\n\nexport const GET_CONNECTION_LOGS = `\n query GetConnectionLogs($connectionId: ID!, $pagination: IntegrationsPaginationInput) {\n getConnectionLogs(connectionId: $connectionId, pagination: $pagination) {\n items { id action level message createdAt }\n total hasMore\n }\n }\n`;\n\nexport const UPDATE_CONNECTION = `\n mutation UpdateConnection($id: ID!, $input: UpdateConnectionInput!) {\n updateConnection(id: $id, input: $input) { id name status }\n }\n`;\n\nexport const REVOKE_CONNECTION = `\n mutation RevokeConnection($connectionId: ID!) {\n revokeConnection(connectionId: $connectionId) { id name status }\n }\n`;\n\nexport const TEST_CONNECTION = `\n mutation TestConnection($connectionId: ID!) {\n testConnection(connectionId: $connectionId) { success message latencyMs }\n }\n`;\n\nexport const LINK_INTEGRATION_TO_CHANNEL = `\n mutation LinkIntegrationToChannel($channelId: String!, $connectionId: ID!, $organizationId: String!) {\n linkIntegrationToChannel(channelId: $channelId, connectionId: $connectionId, organizationId: $organizationId) {\n id name status channelId organizationId\n }\n }\n`;\n\nexport const REFRESH_CONNECTION_TOKEN = `\n mutation RefreshConnectionToken($connectionId: ID!) {\n refreshConnectionToken(connectionId: $connectionId) { id status }\n }\n`;\n\nexport const AUTHENTICATE_API_KEY = `\n mutation AuthenticateWithApiKey($input: ApiKeyAuthInput!) {\n authenticateWithApiKey(input: $input) { id name status }\n }\n`;\n\nexport const AUTHENTICATE_BASIC = `\n mutation AuthenticateWithBasicAuth($input: BasicAuthInput!) {\n authenticateWithBasicAuth(input: $input) { id name status }\n }\n`;\n\nexport const AUTHENTICATE_BEARER = `\n mutation AuthenticateWithBearerToken($input: BearerTokenAuthInput!) {\n authenticateWithBearerToken(input: $input) { id name status }\n }\n`;\n\nexport const INITIATE_OAUTH = `\n mutation InitiateOAuth($input: InitiateOAuthInput!) {\n initiateOAuth(input: $input) { redirectUrl state }\n }\n`;\n\nexport const COMPLETE_OAUTH = `\n mutation CompleteOAuth($input: CompleteOAuthInput!) {\n completeOAuth(input: $input) { id name status }\n }\n`;\n\nexport const GET_PROVIDER_BY_KEY = `\n query GetProviderByKey($key: String!) {\n getProviderByKey(key: $key) { id key name authType category connectionCount isEnabled }\n }\n`;\n\nexport const GET_PROVIDER_CATALOG = `\n query GetProviderCatalog($pagination: IntegrationsPaginationInput) {\n getProviderCatalog(pagination: $pagination) {\n items { id key name category authType isEnabled }\n total hasMore\n }\n }\n`;\n\nexport const GET_CONNECTIONS_BY_PROVIDER = `\n query GetConnectionsByProvider($providerId: ID!, $pagination: IntegrationsPaginationInput) {\n getConnectionsByProvider(providerId: $providerId, pagination: $pagination) {\n items { id name providerId status grantedScopes }\n total hasMore\n }\n }\n`;\n\nexport const ENABLE_PROVIDER = `\n mutation EnableProvider($id: ID!) {\n enableProvider(id: $id) { id key name isEnabled }\n }\n`;\n\nexport const DISABLE_PROVIDER = `\n mutation DisableProvider($id: ID!) {\n disableProvider(id: $id) { id key name isEnabled }\n }\n`;\n\nexport const TAG_CONNECTION = `\n mutation TagConnection($input: TagConnectionInput!) {\n tagConnection(input: $input) { id entityId tagId source }\n }\n`;\n\nexport const UNTAG_CONNECTION = `\n mutation UntagConnection($input: UntagConnectionInput!) {\n untagConnection(input: $input)\n }\n`;\n\nexport const REPLACE_CONNECTION_TAGS = `\n mutation ReplaceConnectionTags($input: ReplaceConnectionTagsInput!) {\n replaceConnectionTags(input: $input) { id entityId tagId source }\n }\n`;\n\nexport const GET_CONNECTION_TAGS = `\n query GetConnectionTags($input: GetConnectionTagsInput!) {\n getConnectionTags(input: $input) { id entityId tagId source assignedAt }\n }\n`;\n","/**\n * Integrations MCP tools — providers, connections, logs.\n * Surface mirrors cli-sdk/src/modules/integrations/commands.ts.\n */\n\nimport { z } from 'zod';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { jsonResult, errorResult, mcpToolName, type McpContext } from '../../core/index.js';\nimport * as ops from './operations.js';\n\ninterface ProviderRow {\n id: string;\n key: string;\n name: string;\n category?: string;\n authType?: string;\n isEnabled?: boolean;\n}\n\ninterface ConnectionRow {\n id: string;\n name: string;\n providerId: string;\n status?: string;\n grantedScopes?: string[];\n}\n\ninterface IntegrationLog {\n id: string;\n action: string;\n level: string;\n message: string;\n createdAt: string;\n}\n\nexport function registerIntegrationsTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n // ── Providers ───────────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_providers_list')),\n {\n title: 'List Integration Providers',\n description: 'List integration providers with optional category/enabled filters.',\n inputSchema: {\n category: z.string().optional().describe('Filter by category (will be uppercased)'),\n enabled: z.boolean().optional().describe('Filter by enabled flag'),\n limit: z.number().optional().describe('Page size (default 100)'),\n },\n },\n async ({ category, enabled, limit }) => {\n try {\n const filter: Record<string, unknown> = {};\n if (category !== undefined) filter.category = category.toUpperCase();\n if (enabled !== undefined) filter.isEnabled = enabled;\n const data = await ctx.gql.workspace.request<{\n getProviders: { items: ProviderRow[]; total: number; hasMore: boolean };\n }>(ops.GET_PROVIDERS, {\n filter: Object.keys(filter).length > 0 ? filter : undefined,\n pagination: { limit: limit ?? 100, offset: 0 },\n });\n return jsonResult(data.getProviders);\n } catch (error) {\n ctx.logger.error('integrations_providers_list failed', { error: String(error) });\n return errorResult(\n `Failed to list providers: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_providers_get')),\n {\n title: 'Get Integration Provider',\n description: 'Get an integration provider by ID.',\n inputSchema: { id: z.string().describe('Provider ID') },\n },\n async ({ id }) => {\n try {\n const data = await ctx.gql.workspace.request<{ getProvider: ProviderRow | null }>(\n ops.GET_PROVIDER,\n { id },\n );\n if (!data.getProvider) return errorResult(`Provider ${id} not found`);\n return jsonResult(data.getProvider);\n } catch (error) {\n ctx.logger.error('integrations_providers_get failed', { error: String(error) });\n return errorResult(\n `Failed to get provider: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Connections ─────────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_connections_list')),\n {\n title: 'List Connections',\n description: 'List provider connections (OAuth + credential).',\n inputSchema: {\n provider: z.string().optional().describe('Filter by provider ID'),\n status: z.string().optional().describe('Filter by status (will be uppercased)'),\n limit: z.number().optional().describe('Page size (default 100)'),\n },\n },\n async ({ provider, status, limit }) => {\n try {\n const filter: Record<string, unknown> = {};\n if (provider !== undefined) filter.providerId = provider;\n if (status !== undefined) filter.status = status.toUpperCase();\n const data = await ctx.gql.workspace.request<{\n getConnections: { items: ConnectionRow[]; total: number; hasMore: boolean };\n }>(ops.GET_CONNECTIONS, {\n filter: Object.keys(filter).length > 0 ? filter : undefined,\n pagination: { limit: limit ?? 100, offset: 0 },\n });\n return jsonResult(data.getConnections);\n } catch (error) {\n ctx.logger.error('integrations_connections_list failed', { error: String(error) });\n return errorResult(\n `Failed to list connections: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_connections_get')),\n {\n title: 'Get Connection',\n description: 'Get a connection by ID.',\n inputSchema: { id: z.string().describe('Connection ID') },\n },\n async ({ id }) => {\n try {\n const data = await ctx.gql.workspace.request<{ getConnection: ConnectionRow | null }>(\n ops.GET_CONNECTION,\n { id },\n );\n if (!data.getConnection) return errorResult(`Connection ${id} not found`);\n return jsonResult(data.getConnection);\n } catch (error) {\n ctx.logger.error('integrations_connections_get failed', { error: String(error) });\n return errorResult(\n `Failed to get connection: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_connections_add')),\n {\n title: 'Create Connection',\n description: 'Create a connection (provider id required; credentials stored in vault).',\n inputSchema: {\n name: z.string().describe('Connection name'),\n provider: z.string().describe('Provider ID'),\n scopes: z.array(z.string()).optional().describe('Granted scopes'),\n },\n },\n async ({ name, provider, scopes }) => {\n try {\n const input: Record<string, unknown> = { name, providerId: provider };\n if (scopes !== undefined) input.grantedScopes = scopes;\n const data = await ctx.gql.workspace.request<{ createConnection: ConnectionRow }>(\n ops.CREATE_CONNECTION,\n { input },\n );\n return jsonResult(data.createConnection);\n } catch (error) {\n ctx.logger.error('integrations_connections_add failed', { error: String(error) });\n return errorResult(\n `Failed to create connection: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_connections_delete')),\n {\n title: 'Delete Connection',\n description: 'Delete a connection. Use keepSecret=true to retain the vault secret.',\n inputSchema: {\n id: z.string().describe('Connection ID'),\n keepSecret: z.boolean().optional().describe('Keep vault secret (default false)'),\n },\n },\n async ({ id, keepSecret }) => {\n try {\n const data = await ctx.gql.workspace.request<{ deleteConnection: boolean }>(\n ops.DELETE_CONNECTION,\n { id, deleteVaultSecret: !keepSecret },\n );\n return jsonResult({ deleted: data.deleteConnection, connectionId: id });\n } catch (error) {\n ctx.logger.error('integrations_connections_delete failed', { error: String(error) });\n return errorResult(\n `Failed to delete connection: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Connections (extras) ────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_connections_update')),\n {\n title: 'Update Connection',\n description: 'Update a connection (name, description, config JSON object).',\n inputSchema: {\n id: z.string().describe('Connection ID'),\n name: z.string().optional(),\n description: z.string().optional(),\n config: z.record(z.string(), z.unknown()).optional(),\n },\n },\n async ({ id, name, description, config }) => {\n try {\n const input: Record<string, unknown> = {};\n if (name !== undefined) input.name = name;\n if (description !== undefined) input.description = description;\n if (config !== undefined) input.config = config;\n if (Object.keys(input).length === 0) {\n return errorResult('Provide at least one of name, description, config');\n }\n const data = await ctx.gql.workspace.request<{ updateConnection: ConnectionRow }>(\n ops.UPDATE_CONNECTION,\n { id, input },\n );\n return jsonResult(data.updateConnection);\n } catch (error) {\n ctx.logger.error('integrations_connections_update failed', { error: String(error) });\n return errorResult(\n `Failed to update connection: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_connections_revoke')),\n {\n title: 'Revoke Connection',\n description: 'Revoke a connection — invalidates tokens and marks as REVOKED.',\n inputSchema: { connectionId: z.string().describe('Connection ID') },\n },\n async ({ connectionId }) => {\n try {\n const data = await ctx.gql.workspace.request<{ revokeConnection: ConnectionRow }>(\n ops.REVOKE_CONNECTION,\n { connectionId },\n );\n return jsonResult(data.revokeConnection);\n } catch (error) {\n ctx.logger.error('integrations_connections_revoke failed', { error: String(error) });\n return errorResult(\n `Failed to revoke connection: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_connections_test')),\n {\n title: 'Test Connection',\n description: 'Health/auth probe for a connection; returns success/message/latencyMs.',\n inputSchema: { connectionId: z.string().describe('Connection ID') },\n },\n async ({ connectionId }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n testConnection: { success: boolean; message: string; latencyMs?: number };\n }>(ops.TEST_CONNECTION, { connectionId });\n return jsonResult(data.testConnection);\n } catch (error) {\n ctx.logger.error('integrations_connections_test failed', { error: String(error) });\n return errorResult(\n `Failed to test connection: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_connections_link_to_channel')),\n {\n title: 'Link Connection to Channel',\n description: 'Link an integration connection to a channel for DM/notification routing.',\n inputSchema: {\n channelId: z.string(),\n connectionId: z.string(),\n organizationId: z.string(),\n },\n },\n async ({ channelId, connectionId, organizationId }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n linkIntegrationToChannel: ConnectionRow;\n }>(ops.LINK_INTEGRATION_TO_CHANNEL, { channelId, connectionId, organizationId });\n return jsonResult(data.linkIntegrationToChannel);\n } catch (error) {\n ctx.logger.error('integrations_connections_link_channel failed', {\n error: String(error),\n });\n return errorResult(\n `Failed to link connection: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_connections_refresh_token')),\n {\n title: 'Refresh Connection Token',\n description: 'Force a token refresh for an OAuth connection.',\n inputSchema: { connectionId: z.string() },\n },\n async ({ connectionId }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n refreshConnectionToken: ConnectionRow;\n }>(ops.REFRESH_CONNECTION_TOKEN, { connectionId });\n return jsonResult(data.refreshConnectionToken);\n } catch (error) {\n ctx.logger.error('integrations_connections_refresh_token failed', {\n error: String(error),\n });\n return errorResult(\n `Failed to refresh token: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Auth flows ──────────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_auth_api_key')),\n {\n title: 'Authenticate Connection (API Key)',\n description: 'Attach an API key to an existing connection.',\n inputSchema: { connectionId: z.string(), apiKey: z.string() },\n },\n async ({ connectionId, apiKey }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n authenticateWithApiKey: ConnectionRow;\n }>(ops.AUTHENTICATE_API_KEY, { input: { connectionId, apiKey } });\n return jsonResult(data.authenticateWithApiKey);\n } catch (error) {\n ctx.logger.error('integrations_auth_api_key failed', { error: String(error) });\n return errorResult(\n `Failed to authenticate: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_auth_basic')),\n {\n title: 'Authenticate Connection (Basic Auth)',\n description: 'Attach Basic Auth credentials to an existing connection.',\n inputSchema: {\n connectionId: z.string(),\n username: z.string(),\n password: z.string(),\n },\n },\n async ({ connectionId, username, password }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n authenticateWithBasicAuth: ConnectionRow;\n }>(ops.AUTHENTICATE_BASIC, { input: { connectionId, username, password } });\n return jsonResult(data.authenticateWithBasicAuth);\n } catch (error) {\n ctx.logger.error('integrations_auth_basic failed', { error: String(error) });\n return errorResult(\n `Failed to authenticate: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_auth_bearer')),\n {\n title: 'Authenticate Connection (Bearer Token)',\n description: 'Attach a Bearer token to an existing connection.',\n inputSchema: { connectionId: z.string(), token: z.string() },\n },\n async ({ connectionId, token }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n authenticateWithBearerToken: ConnectionRow;\n }>(ops.AUTHENTICATE_BEARER, { input: { connectionId, token } });\n return jsonResult(data.authenticateWithBearerToken);\n } catch (error) {\n ctx.logger.error('integrations_auth_bearer failed', { error: String(error) });\n return errorResult(\n `Failed to authenticate: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_auth_oauth_initiate')),\n {\n title: 'Initiate OAuth Flow',\n description: 'Start an OAuth flow; returns redirectUrl + state for the client to use.',\n inputSchema: {\n connectionId: z.string(),\n redirectUri: z.string(),\n scopes: z.array(z.string()).optional(),\n },\n },\n async ({ connectionId, redirectUri, scopes }) => {\n try {\n const input: Record<string, unknown> = { connectionId, redirectUri };\n if (scopes !== undefined) input.scopes = scopes;\n const data = await ctx.gql.workspace.request<{\n initiateOAuth: { redirectUrl: string; state: string };\n }>(ops.INITIATE_OAUTH, { input });\n return jsonResult(data.initiateOAuth);\n } catch (error) {\n ctx.logger.error('integrations_auth_oauth_start failed', { error: String(error) });\n return errorResult(\n `Failed to initiate OAuth: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_auth_oauth_complete')),\n {\n title: 'Complete OAuth Flow',\n description: 'Complete an OAuth flow with code+state returned by the IdP.',\n inputSchema: {\n connectionId: z.string(),\n code: z.string(),\n redirectUri: z.string(),\n state: z.string(),\n },\n },\n async ({ connectionId, code, redirectUri, state }) => {\n try {\n const data = await ctx.gql.workspace.request<{ completeOAuth: ConnectionRow }>(\n ops.COMPLETE_OAUTH,\n { input: { connectionId, code, redirectUri, state } },\n );\n return jsonResult(data.completeOAuth);\n } catch (error) {\n ctx.logger.error('integrations_auth_oauth_complete failed', { error: String(error) });\n return errorResult(\n `Failed to complete OAuth: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Providers (extras) ──────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_providers_get_by_key')),\n {\n title: 'Get Provider By Key',\n description: 'Look up an integration provider by its string key (e.g. github, slack).',\n inputSchema: { key: z.string() },\n },\n async ({ key }) => {\n try {\n const data = await ctx.gql.workspace.request<{ getProviderByKey: ProviderRow | null }>(\n ops.GET_PROVIDER_BY_KEY,\n { key },\n );\n if (!data.getProviderByKey) return errorResult(`Provider ${key} not found`);\n return jsonResult(data.getProviderByKey);\n } catch (error) {\n ctx.logger.error('integrations_providers_get_by_key failed', { error: String(error) });\n return errorResult(\n `Failed to get provider: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_providers_catalog')),\n {\n title: 'Provider Catalog',\n description: 'Browseable catalog of integration providers (paginated).',\n inputSchema: { limit: z.number().optional() },\n },\n async ({ limit }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n getProviderCatalog: { items: ProviderRow[]; total: number; hasMore: boolean };\n }>(ops.GET_PROVIDER_CATALOG, { pagination: { limit: limit ?? 100, offset: 0 } });\n return jsonResult(data.getProviderCatalog);\n } catch (error) {\n ctx.logger.error('integrations_providers_catalog failed', { error: String(error) });\n return errorResult(\n `Failed to get catalog: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_providers_by_provider')),\n {\n title: 'Connections By Provider',\n description: 'List all connections that belong to a given provider.',\n inputSchema: { providerId: z.string(), limit: z.number().optional() },\n },\n async ({ providerId, limit }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n getConnectionsByProvider: { items: ConnectionRow[]; total: number; hasMore: boolean };\n }>(ops.GET_CONNECTIONS_BY_PROVIDER, {\n providerId,\n pagination: { limit: limit ?? 100, offset: 0 },\n });\n return jsonResult(data.getConnectionsByProvider);\n } catch (error) {\n ctx.logger.error('integrations_providers_connections failed', { error: String(error) });\n return errorResult(\n `Failed to list: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_providers_enable')),\n {\n title: 'Enable Provider',\n description: 'Enable an integration provider in this workspace.',\n inputSchema: { id: z.string() },\n },\n async ({ id }) => {\n try {\n const data = await ctx.gql.workspace.request<{ enableProvider: ProviderRow }>(\n ops.ENABLE_PROVIDER,\n { id },\n );\n return jsonResult(data.enableProvider);\n } catch (error) {\n ctx.logger.error('integrations_providers_enable failed', { error: String(error) });\n return errorResult(\n `Failed to enable: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_providers_disable')),\n {\n title: 'Disable Provider',\n description: 'Disable an integration provider in this workspace.',\n inputSchema: { id: z.string() },\n },\n async ({ id }) => {\n try {\n const data = await ctx.gql.workspace.request<{ disableProvider: ProviderRow }>(\n ops.DISABLE_PROVIDER,\n { id },\n );\n return jsonResult(data.disableProvider);\n } catch (error) {\n ctx.logger.error('integrations_providers_disable failed', { error: String(error) });\n return errorResult(\n `Failed to disable: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Connection tags ─────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_tags_add')),\n {\n title: 'Tag Connection',\n description: 'Add a tag assignment to a connection.',\n inputSchema: {\n entityId: z.string(),\n tagId: z.string(),\n source: z.string().optional(),\n },\n },\n async ({ entityId, tagId, source }) => {\n try {\n const input: Record<string, unknown> = { entityId, tagId };\n if (source !== undefined) input.source = source;\n const data = await ctx.gql.workspace.request<{ tagConnection: unknown }>(\n ops.TAG_CONNECTION,\n { input },\n );\n return jsonResult(data.tagConnection);\n } catch (error) {\n ctx.logger.error('integrations_connections_tag_add failed', { error: String(error) });\n return errorResult(\n `Failed to tag: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_tags_remove')),\n {\n title: 'Untag Connection',\n description: 'Remove a tag assignment from a connection.',\n inputSchema: { entityId: z.string(), tagId: z.string() },\n },\n async ({ entityId, tagId }) => {\n try {\n const data = await ctx.gql.workspace.request<{ untagConnection: boolean }>(\n ops.UNTAG_CONNECTION,\n { input: { entityId, tagId } },\n );\n return jsonResult({ removed: data.untagConnection });\n } catch (error) {\n ctx.logger.error('integrations_connections_tag_remove failed', { error: String(error) });\n return errorResult(\n `Failed to untag: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_tags_replace')),\n {\n title: 'Replace Connection Tags',\n description: 'Replace all tag assignments on a connection.',\n inputSchema: { entityId: z.string(), tagIds: z.array(z.string()) },\n },\n async ({ entityId, tagIds }) => {\n try {\n const data = await ctx.gql.workspace.request<{ replaceConnectionTags: unknown }>(\n ops.REPLACE_CONNECTION_TAGS,\n { input: { entityId, tagIds } },\n );\n return jsonResult(data.replaceConnectionTags);\n } catch (error) {\n ctx.logger.error('integrations_connections_tag_replace failed', { error: String(error) });\n return errorResult(\n `Failed to replace tags: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_tags_list')),\n {\n title: 'List Connection Tags',\n description: 'List tag assignments on a connection.',\n inputSchema: { entityId: z.string() },\n },\n async ({ entityId }) => {\n try {\n const data = await ctx.gql.workspace.request<{ getConnectionTags: unknown }>(\n ops.GET_CONNECTION_TAGS,\n { input: { entityId } },\n );\n return jsonResult(data.getConnectionTags);\n } catch (error) {\n ctx.logger.error('integrations_connections_tag_list failed', { error: String(error) });\n return errorResult(\n `Failed to list tags: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Logs ────────────────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_integration_logs')),\n {\n title: 'Integration Audit Logs',\n description: 'List integration audit logs with optional filters.',\n inputSchema: {\n connection: z.string().optional().describe('Filter by connection ID'),\n level: z.string().optional().describe('INFO|WARN|ERROR (will be uppercased)'),\n limit: z.number().optional().describe('Page size (default 100)'),\n },\n },\n async ({ connection, level, limit }) => {\n try {\n const filter: Record<string, unknown> = {};\n if (connection !== undefined) filter.connectionId = connection;\n if (level !== undefined) filter.level = level.toUpperCase();\n const data = await ctx.gql.workspace.request<{\n getIntegrationLogs: { items: IntegrationLog[]; total: number; hasMore: boolean };\n }>(ops.GET_INTEGRATION_LOGS, {\n filter: Object.keys(filter).length > 0 ? filter : undefined,\n pagination: { limit: limit ?? 100, offset: 0 },\n });\n return jsonResult(data.getIntegrationLogs);\n } catch (error) {\n ctx.logger.error('integrations_integration_logs failed', { error: String(error) });\n return errorResult(\n `Failed to get integration logs: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_logs')),\n {\n title: 'Connection Audit Logs',\n description: 'List audit logs for a specific integration connection.',\n inputSchema: {\n connection: z.string().describe('Connection ID (required)'),\n limit: z.number().optional().describe('Page size (default 100)'),\n offset: z.number().optional().describe('Offset (default 0)'),\n },\n },\n async ({ connection, limit, offset }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n getConnectionLogs: { items: IntegrationLog[]; total: number; hasMore: boolean };\n }>(ops.GET_CONNECTION_LOGS, {\n connectionId: connection,\n pagination: { limit: limit ?? 100, offset: offset ?? 0 },\n });\n return jsonResult(data.getConnectionLogs);\n } catch (error) {\n ctx.logger.error('integrations_logs failed', { error: String(error) });\n return errorResult(\n `Failed to get connection logs: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n}\n","/**\n * Integrations module — providers, connections, audit logs.\n * Surface mirrors cli-sdk/src/modules/integrations/.\n */\n\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport type { McpContext, McpModule, ModuleRegistration } from '../../core/index.js';\nimport { registerIntegrationsTools } from './tools.js';\n\nconst integrationsModule: McpModule = {\n id: 'integrations',\n version: '0.0.1',\n displayName: 'Integrations',\n dependsOn: ['auth'],\n capabilities: { tools: {} },\n\n register(server: McpServer, ctx: McpContext): ModuleRegistration {\n const tools: string[] = [];\n const track = (n: string): string => {\n tools.push(n);\n return n;\n };\n\n registerIntegrationsTools(server, ctx, track);\n\n return { tools, resources: [], prompts: [] };\n },\n};\n\nexport default integrationsModule;\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/core/errors.ts","../../../src/core/tool-name.ts","../../../src/core/result.ts","../../../src/modules/integrations/operations.ts","../../../src/modules/integrations/tools.ts","../../../src/modules/integrations/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,C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KAAA,EAAO,SAAA,EAAW,EAAC,EAAG,OAAA,EAAS,EAAC,EAAE;AAAA,EAC7C;AACF,CAAA;AAEA,IAAO,oBAAA,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 } }\n | 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","export const GET_PROVIDERS = `\n query GetProviders($filter: ProviderFilterInput, $pagination: IntegrationsPaginationInput) {\n getProviders(filter: $filter, pagination: $pagination) {\n items { id key name category authType isEnabled }\n total hasMore\n }\n }\n`;\n\nexport const GET_PROVIDER = `\n query GetProvider($id: ID!) {\n getProvider(id: $id) {\n id key name authType category connectionCount\n }\n }\n`;\n\nexport const GET_CONNECTIONS = `\n query GetConnections($filter: ConnectionFilterInput, $pagination: IntegrationsPaginationInput) {\n getConnections(filter: $filter, pagination: $pagination) {\n items { id name providerId status grantedScopes }\n total hasMore\n }\n }\n`;\n\nexport const GET_CONNECTION = `\n query GetConnection($id: ID!) {\n getConnection(id: $id) {\n id name providerId status externalAccountEmail credentialSource\n }\n }\n`;\n\nexport const CREATE_CONNECTION = `\n mutation CreateConnection($input: CreateConnectionInput!) {\n createConnection(input: $input) {\n id name status providerId\n }\n }\n`;\n\nexport const DELETE_CONNECTION = `\n mutation DeleteConnection($id: ID!, $deleteVaultSecret: Boolean) {\n deleteConnection(id: $id, deleteVaultSecret: $deleteVaultSecret)\n }\n`;\n\nexport const GET_INTEGRATION_LOGS = `\n query GetIntegrationLogs($filter: LogFilterInput, $pagination: IntegrationsPaginationInput) {\n getIntegrationLogs(filter: $filter, pagination: $pagination) {\n items { id action level message createdAt }\n total hasMore\n }\n }\n`;\n\nexport const GET_CONNECTION_LOGS = `\n query GetConnectionLogs($connectionId: ID!, $pagination: IntegrationsPaginationInput) {\n getConnectionLogs(connectionId: $connectionId, pagination: $pagination) {\n items { id action level message createdAt }\n total hasMore\n }\n }\n`;\n\nexport const UPDATE_CONNECTION = `\n mutation UpdateConnection($id: ID!, $input: UpdateConnectionInput!) {\n updateConnection(id: $id, input: $input) { id name status }\n }\n`;\n\nexport const REVOKE_CONNECTION = `\n mutation RevokeConnection($connectionId: ID!) {\n revokeConnection(connectionId: $connectionId) { id name status }\n }\n`;\n\nexport const TEST_CONNECTION = `\n mutation TestConnection($connectionId: ID!) {\n testConnection(connectionId: $connectionId) { success message latencyMs }\n }\n`;\n\nexport const LINK_INTEGRATION_TO_CHANNEL = `\n mutation LinkIntegrationToChannel($channelId: String!, $connectionId: ID!, $organizationId: String!) {\n linkIntegrationToChannel(channelId: $channelId, connectionId: $connectionId, organizationId: $organizationId) {\n id name status channelId organizationId\n }\n }\n`;\n\nexport const REFRESH_CONNECTION_TOKEN = `\n mutation RefreshConnectionToken($connectionId: ID!) {\n refreshConnectionToken(connectionId: $connectionId) { id status }\n }\n`;\n\nexport const AUTHENTICATE_API_KEY = `\n mutation AuthenticateWithApiKey($input: ApiKeyAuthInput!) {\n authenticateWithApiKey(input: $input) { id name status }\n }\n`;\n\nexport const AUTHENTICATE_BASIC = `\n mutation AuthenticateWithBasicAuth($input: BasicAuthInput!) {\n authenticateWithBasicAuth(input: $input) { id name status }\n }\n`;\n\nexport const AUTHENTICATE_BEARER = `\n mutation AuthenticateWithBearerToken($input: BearerTokenAuthInput!) {\n authenticateWithBearerToken(input: $input) { id name status }\n }\n`;\n\nexport const INITIATE_OAUTH = `\n mutation InitiateOAuth($input: InitiateOAuthInput!) {\n initiateOAuth(input: $input) { redirectUrl state }\n }\n`;\n\nexport const COMPLETE_OAUTH = `\n mutation CompleteOAuth($input: CompleteOAuthInput!) {\n completeOAuth(input: $input) { id name status }\n }\n`;\n\nexport const GET_PROVIDER_BY_KEY = `\n query GetProviderByKey($key: String!) {\n getProviderByKey(key: $key) { id key name authType category connectionCount isEnabled }\n }\n`;\n\nexport const GET_PROVIDER_CATALOG = `\n query GetProviderCatalog($pagination: IntegrationsPaginationInput) {\n getProviderCatalog(pagination: $pagination) {\n items { id key name category authType isEnabled }\n total hasMore\n }\n }\n`;\n\nexport const GET_CONNECTIONS_BY_PROVIDER = `\n query GetConnectionsByProvider($providerId: ID!, $pagination: IntegrationsPaginationInput) {\n getConnectionsByProvider(providerId: $providerId, pagination: $pagination) {\n items { id name providerId status grantedScopes }\n total hasMore\n }\n }\n`;\n\nexport const ENABLE_PROVIDER = `\n mutation EnableProvider($id: ID!) {\n enableProvider(id: $id) { id key name isEnabled }\n }\n`;\n\nexport const DISABLE_PROVIDER = `\n mutation DisableProvider($id: ID!) {\n disableProvider(id: $id) { id key name isEnabled }\n }\n`;\n\nexport const TAG_CONNECTION = `\n mutation TagConnection($input: TagConnectionInput!) {\n tagConnection(input: $input) { id entityId tagId source }\n }\n`;\n\nexport const UNTAG_CONNECTION = `\n mutation UntagConnection($input: UntagConnectionInput!) {\n untagConnection(input: $input)\n }\n`;\n\nexport const REPLACE_CONNECTION_TAGS = `\n mutation ReplaceConnectionTags($input: ReplaceConnectionTagsInput!) {\n replaceConnectionTags(input: $input) { id entityId tagId source }\n }\n`;\n\nexport const GET_CONNECTION_TAGS = `\n query GetConnectionTags($input: GetConnectionTagsInput!) {\n getConnectionTags(input: $input) { id entityId tagId source assignedAt }\n }\n`;\n","/**\n * Integrations MCP tools — providers, connections, logs.\n * Surface mirrors cli-sdk/src/modules/integrations/commands.ts.\n */\n\nimport { z } from 'zod';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { jsonResult, errorResult, mcpToolName, type McpContext } from '../../core/index.js';\nimport * as ops from './operations.js';\n\ninterface ProviderRow {\n id: string;\n key: string;\n name: string;\n category?: string;\n authType?: string;\n isEnabled?: boolean;\n}\n\ninterface ConnectionRow {\n id: string;\n name: string;\n providerId: string;\n status?: string;\n grantedScopes?: string[];\n}\n\ninterface IntegrationLog {\n id: string;\n action: string;\n level: string;\n message: string;\n createdAt: string;\n}\n\nexport function registerIntegrationsTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n // ── Providers ───────────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_providers_list')),\n {\n title: 'List Integration Providers',\n description: 'List integration providers with optional category/enabled filters.',\n inputSchema: {\n category: z.string().optional().describe('Filter by category (will be uppercased)'),\n enabled: z.boolean().optional().describe('Filter by enabled flag'),\n limit: z.number().optional().describe('Page size (default 100)'),\n },\n },\n async ({ category, enabled, limit }) => {\n try {\n const filter: Record<string, unknown> = {};\n if (category !== undefined) filter.category = category.toUpperCase();\n if (enabled !== undefined) filter.isEnabled = enabled;\n const data = await ctx.gql.workspace.request<{\n getProviders: { items: ProviderRow[]; total: number; hasMore: boolean };\n }>(ops.GET_PROVIDERS, {\n filter: Object.keys(filter).length > 0 ? filter : undefined,\n pagination: { limit: limit ?? 100, offset: 0 },\n });\n return jsonResult(data.getProviders);\n } catch (error) {\n ctx.logger.error('integrations_providers_list failed', { error: String(error) });\n return errorResult(\n `Failed to list providers: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_providers_get')),\n {\n title: 'Get Integration Provider',\n description: 'Get an integration provider by ID.',\n inputSchema: { id: z.string().describe('Provider ID') },\n },\n async ({ id }) => {\n try {\n const data = await ctx.gql.workspace.request<{ getProvider: ProviderRow | null }>(\n ops.GET_PROVIDER,\n { id },\n );\n if (!data.getProvider) return errorResult(`Provider ${id} not found`);\n return jsonResult(data.getProvider);\n } catch (error) {\n ctx.logger.error('integrations_providers_get failed', { error: String(error) });\n return errorResult(\n `Failed to get provider: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Connections ─────────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_connections_list')),\n {\n title: 'List Connections',\n description: 'List provider connections (OAuth + credential).',\n inputSchema: {\n provider: z.string().optional().describe('Filter by provider ID'),\n status: z.string().optional().describe('Filter by status (will be uppercased)'),\n limit: z.number().optional().describe('Page size (default 100)'),\n },\n },\n async ({ provider, status, limit }) => {\n try {\n const filter: Record<string, unknown> = {};\n if (provider !== undefined) filter.providerId = provider;\n if (status !== undefined) filter.status = status.toUpperCase();\n const data = await ctx.gql.workspace.request<{\n getConnections: { items: ConnectionRow[]; total: number; hasMore: boolean };\n }>(ops.GET_CONNECTIONS, {\n filter: Object.keys(filter).length > 0 ? filter : undefined,\n pagination: { limit: limit ?? 100, offset: 0 },\n });\n return jsonResult(data.getConnections);\n } catch (error) {\n ctx.logger.error('integrations_connections_list failed', { error: String(error) });\n return errorResult(\n `Failed to list connections: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_connections_get')),\n {\n title: 'Get Connection',\n description: 'Get a connection by ID.',\n inputSchema: { id: z.string().describe('Connection ID') },\n },\n async ({ id }) => {\n try {\n const data = await ctx.gql.workspace.request<{ getConnection: ConnectionRow | null }>(\n ops.GET_CONNECTION,\n { id },\n );\n if (!data.getConnection) return errorResult(`Connection ${id} not found`);\n return jsonResult(data.getConnection);\n } catch (error) {\n ctx.logger.error('integrations_connections_get failed', { error: String(error) });\n return errorResult(\n `Failed to get connection: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_connections_add')),\n {\n title: 'Create Connection',\n description: 'Create a connection (provider id required; credentials stored in vault).',\n inputSchema: {\n name: z.string().describe('Connection name'),\n provider: z.string().describe('Provider ID'),\n scopes: z.array(z.string()).optional().describe('Granted scopes'),\n },\n },\n async ({ name, provider, scopes }) => {\n try {\n const input: Record<string, unknown> = { name, providerId: provider };\n if (scopes !== undefined) input.grantedScopes = scopes;\n const data = await ctx.gql.workspace.request<{ createConnection: ConnectionRow }>(\n ops.CREATE_CONNECTION,\n { input },\n );\n return jsonResult(data.createConnection);\n } catch (error) {\n ctx.logger.error('integrations_connections_add failed', { error: String(error) });\n return errorResult(\n `Failed to create connection: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_connections_delete')),\n {\n title: 'Delete Connection',\n description: 'Delete a connection. Use keepSecret=true to retain the vault secret.',\n inputSchema: {\n id: z.string().describe('Connection ID'),\n keepSecret: z.boolean().optional().describe('Keep vault secret (default false)'),\n },\n },\n async ({ id, keepSecret }) => {\n try {\n const data = await ctx.gql.workspace.request<{ deleteConnection: boolean }>(\n ops.DELETE_CONNECTION,\n { id, deleteVaultSecret: !keepSecret },\n );\n return jsonResult({ deleted: data.deleteConnection, connectionId: id });\n } catch (error) {\n ctx.logger.error('integrations_connections_delete failed', { error: String(error) });\n return errorResult(\n `Failed to delete connection: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Connections (extras) ────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_connections_update')),\n {\n title: 'Update Connection',\n description: 'Update a connection (name, description, config JSON object).',\n inputSchema: {\n id: z.string().describe('Connection ID'),\n name: z.string().optional(),\n description: z.string().optional(),\n config: z.record(z.string(), z.unknown()).optional(),\n },\n },\n async ({ id, name, description, config }) => {\n try {\n const input: Record<string, unknown> = {};\n if (name !== undefined) input.name = name;\n if (description !== undefined) input.description = description;\n if (config !== undefined) input.config = config;\n if (Object.keys(input).length === 0) {\n return errorResult('Provide at least one of name, description, config');\n }\n const data = await ctx.gql.workspace.request<{ updateConnection: ConnectionRow }>(\n ops.UPDATE_CONNECTION,\n { id, input },\n );\n return jsonResult(data.updateConnection);\n } catch (error) {\n ctx.logger.error('integrations_connections_update failed', { error: String(error) });\n return errorResult(\n `Failed to update connection: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_connections_revoke')),\n {\n title: 'Revoke Connection',\n description: 'Revoke a connection — invalidates tokens and marks as REVOKED.',\n inputSchema: { connectionId: z.string().describe('Connection ID') },\n },\n async ({ connectionId }) => {\n try {\n const data = await ctx.gql.workspace.request<{ revokeConnection: ConnectionRow }>(\n ops.REVOKE_CONNECTION,\n { connectionId },\n );\n return jsonResult(data.revokeConnection);\n } catch (error) {\n ctx.logger.error('integrations_connections_revoke failed', { error: String(error) });\n return errorResult(\n `Failed to revoke connection: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_connections_test')),\n {\n title: 'Test Connection',\n description: 'Health/auth probe for a connection; returns success/message/latencyMs.',\n inputSchema: { connectionId: z.string().describe('Connection ID') },\n },\n async ({ connectionId }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n testConnection: { success: boolean; message: string; latencyMs?: number };\n }>(ops.TEST_CONNECTION, { connectionId });\n return jsonResult(data.testConnection);\n } catch (error) {\n ctx.logger.error('integrations_connections_test failed', { error: String(error) });\n return errorResult(\n `Failed to test connection: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_connections_link_to_channel')),\n {\n title: 'Link Connection to Channel',\n description: 'Link an integration connection to a channel for DM/notification routing.',\n inputSchema: {\n channelId: z.string(),\n connectionId: z.string(),\n organizationId: z.string(),\n },\n },\n async ({ channelId, connectionId, organizationId }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n linkIntegrationToChannel: ConnectionRow;\n }>(ops.LINK_INTEGRATION_TO_CHANNEL, { channelId, connectionId, organizationId });\n return jsonResult(data.linkIntegrationToChannel);\n } catch (error) {\n ctx.logger.error('integrations_connections_link_channel failed', {\n error: String(error),\n });\n return errorResult(\n `Failed to link connection: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_connections_refresh_token')),\n {\n title: 'Refresh Connection Token',\n description: 'Force a token refresh for an OAuth connection.',\n inputSchema: { connectionId: z.string() },\n },\n async ({ connectionId }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n refreshConnectionToken: ConnectionRow;\n }>(ops.REFRESH_CONNECTION_TOKEN, { connectionId });\n return jsonResult(data.refreshConnectionToken);\n } catch (error) {\n ctx.logger.error('integrations_connections_refresh_token failed', {\n error: String(error),\n });\n return errorResult(\n `Failed to refresh token: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Auth flows ──────────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_auth_api_key')),\n {\n title: 'Authenticate Connection (API Key)',\n description: 'Attach an API key to an existing connection.',\n inputSchema: { connectionId: z.string(), apiKey: z.string() },\n },\n async ({ connectionId, apiKey }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n authenticateWithApiKey: ConnectionRow;\n }>(ops.AUTHENTICATE_API_KEY, { input: { connectionId, apiKey } });\n return jsonResult(data.authenticateWithApiKey);\n } catch (error) {\n ctx.logger.error('integrations_auth_api_key failed', { error: String(error) });\n return errorResult(\n `Failed to authenticate: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_auth_basic')),\n {\n title: 'Authenticate Connection (Basic Auth)',\n description: 'Attach Basic Auth credentials to an existing connection.',\n inputSchema: {\n connectionId: z.string(),\n username: z.string(),\n password: z.string(),\n },\n },\n async ({ connectionId, username, password }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n authenticateWithBasicAuth: ConnectionRow;\n }>(ops.AUTHENTICATE_BASIC, { input: { connectionId, username, password } });\n return jsonResult(data.authenticateWithBasicAuth);\n } catch (error) {\n ctx.logger.error('integrations_auth_basic failed', { error: String(error) });\n return errorResult(\n `Failed to authenticate: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_auth_bearer')),\n {\n title: 'Authenticate Connection (Bearer Token)',\n description: 'Attach a Bearer token to an existing connection.',\n inputSchema: { connectionId: z.string(), token: z.string() },\n },\n async ({ connectionId, token }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n authenticateWithBearerToken: ConnectionRow;\n }>(ops.AUTHENTICATE_BEARER, { input: { connectionId, token } });\n return jsonResult(data.authenticateWithBearerToken);\n } catch (error) {\n ctx.logger.error('integrations_auth_bearer failed', { error: String(error) });\n return errorResult(\n `Failed to authenticate: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_auth_oauth_initiate')),\n {\n title: 'Initiate OAuth Flow',\n description: 'Start an OAuth flow; returns redirectUrl + state for the client to use.',\n inputSchema: {\n connectionId: z.string(),\n redirectUri: z.string(),\n scopes: z.array(z.string()).optional(),\n },\n },\n async ({ connectionId, redirectUri, scopes }) => {\n try {\n const input: Record<string, unknown> = { connectionId, redirectUri };\n if (scopes !== undefined) input.scopes = scopes;\n const data = await ctx.gql.workspace.request<{\n initiateOAuth: { redirectUrl: string; state: string };\n }>(ops.INITIATE_OAUTH, { input });\n return jsonResult(data.initiateOAuth);\n } catch (error) {\n ctx.logger.error('integrations_auth_oauth_start failed', { error: String(error) });\n return errorResult(\n `Failed to initiate OAuth: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_auth_oauth_complete')),\n {\n title: 'Complete OAuth Flow',\n description: 'Complete an OAuth flow with code+state returned by the IdP.',\n inputSchema: {\n connectionId: z.string(),\n code: z.string(),\n redirectUri: z.string(),\n state: z.string(),\n },\n },\n async ({ connectionId, code, redirectUri, state }) => {\n try {\n const data = await ctx.gql.workspace.request<{ completeOAuth: ConnectionRow }>(\n ops.COMPLETE_OAUTH,\n { input: { connectionId, code, redirectUri, state } },\n );\n return jsonResult(data.completeOAuth);\n } catch (error) {\n ctx.logger.error('integrations_auth_oauth_complete failed', { error: String(error) });\n return errorResult(\n `Failed to complete OAuth: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Providers (extras) ──────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_providers_get_by_key')),\n {\n title: 'Get Provider By Key',\n description: 'Look up an integration provider by its string key (e.g. github, slack).',\n inputSchema: { key: z.string() },\n },\n async ({ key }) => {\n try {\n const data = await ctx.gql.workspace.request<{ getProviderByKey: ProviderRow | null }>(\n ops.GET_PROVIDER_BY_KEY,\n { key },\n );\n if (!data.getProviderByKey) return errorResult(`Provider ${key} not found`);\n return jsonResult(data.getProviderByKey);\n } catch (error) {\n ctx.logger.error('integrations_providers_get_by_key failed', { error: String(error) });\n return errorResult(\n `Failed to get provider: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_providers_catalog')),\n {\n title: 'Provider Catalog',\n description: 'Browseable catalog of integration providers (paginated).',\n inputSchema: { limit: z.number().optional() },\n },\n async ({ limit }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n getProviderCatalog: { items: ProviderRow[]; total: number; hasMore: boolean };\n }>(ops.GET_PROVIDER_CATALOG, { pagination: { limit: limit ?? 100, offset: 0 } });\n return jsonResult(data.getProviderCatalog);\n } catch (error) {\n ctx.logger.error('integrations_providers_catalog failed', { error: String(error) });\n return errorResult(\n `Failed to get catalog: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_providers_by_provider')),\n {\n title: 'Connections By Provider',\n description: 'List all connections that belong to a given provider.',\n inputSchema: { providerId: z.string(), limit: z.number().optional() },\n },\n async ({ providerId, limit }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n getConnectionsByProvider: { items: ConnectionRow[]; total: number; hasMore: boolean };\n }>(ops.GET_CONNECTIONS_BY_PROVIDER, {\n providerId,\n pagination: { limit: limit ?? 100, offset: 0 },\n });\n return jsonResult(data.getConnectionsByProvider);\n } catch (error) {\n ctx.logger.error('integrations_providers_connections failed', { error: String(error) });\n return errorResult(\n `Failed to list: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_providers_enable')),\n {\n title: 'Enable Provider',\n description: 'Enable an integration provider in this workspace.',\n inputSchema: { id: z.string() },\n },\n async ({ id }) => {\n try {\n const data = await ctx.gql.workspace.request<{ enableProvider: ProviderRow }>(\n ops.ENABLE_PROVIDER,\n { id },\n );\n return jsonResult(data.enableProvider);\n } catch (error) {\n ctx.logger.error('integrations_providers_enable failed', { error: String(error) });\n return errorResult(\n `Failed to enable: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_providers_disable')),\n {\n title: 'Disable Provider',\n description: 'Disable an integration provider in this workspace.',\n inputSchema: { id: z.string() },\n },\n async ({ id }) => {\n try {\n const data = await ctx.gql.workspace.request<{ disableProvider: ProviderRow }>(\n ops.DISABLE_PROVIDER,\n { id },\n );\n return jsonResult(data.disableProvider);\n } catch (error) {\n ctx.logger.error('integrations_providers_disable failed', { error: String(error) });\n return errorResult(\n `Failed to disable: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Connection tags ─────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_tags_add')),\n {\n title: 'Tag Connection',\n description: 'Add a tag assignment to a connection.',\n inputSchema: {\n entityId: z.string(),\n tagId: z.string(),\n source: z.string().optional(),\n },\n },\n async ({ entityId, tagId, source }) => {\n try {\n const input: Record<string, unknown> = { entityId, tagId };\n if (source !== undefined) input.source = source;\n const data = await ctx.gql.workspace.request<{ tagConnection: unknown }>(\n ops.TAG_CONNECTION,\n { input },\n );\n return jsonResult(data.tagConnection);\n } catch (error) {\n ctx.logger.error('integrations_connections_tag_add failed', { error: String(error) });\n return errorResult(\n `Failed to tag: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_tags_remove')),\n {\n title: 'Untag Connection',\n description: 'Remove a tag assignment from a connection.',\n inputSchema: { entityId: z.string(), tagId: z.string() },\n },\n async ({ entityId, tagId }) => {\n try {\n const data = await ctx.gql.workspace.request<{ untagConnection: boolean }>(\n ops.UNTAG_CONNECTION,\n { input: { entityId, tagId } },\n );\n return jsonResult({ removed: data.untagConnection });\n } catch (error) {\n ctx.logger.error('integrations_connections_tag_remove failed', { error: String(error) });\n return errorResult(\n `Failed to untag: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_tags_replace')),\n {\n title: 'Replace Connection Tags',\n description: 'Replace all tag assignments on a connection.',\n inputSchema: { entityId: z.string(), tagIds: z.array(z.string()) },\n },\n async ({ entityId, tagIds }) => {\n try {\n const data = await ctx.gql.workspace.request<{ replaceConnectionTags: unknown }>(\n ops.REPLACE_CONNECTION_TAGS,\n { input: { entityId, tagIds } },\n );\n return jsonResult(data.replaceConnectionTags);\n } catch (error) {\n ctx.logger.error('integrations_connections_tag_replace failed', { error: String(error) });\n return errorResult(\n `Failed to replace tags: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_tags_list')),\n {\n title: 'List Connection Tags',\n description: 'List tag assignments on a connection.',\n inputSchema: { entityId: z.string() },\n },\n async ({ entityId }) => {\n try {\n const data = await ctx.gql.workspace.request<{ getConnectionTags: unknown }>(\n ops.GET_CONNECTION_TAGS,\n { input: { entityId } },\n );\n return jsonResult(data.getConnectionTags);\n } catch (error) {\n ctx.logger.error('integrations_connections_tag_list failed', { error: String(error) });\n return errorResult(\n `Failed to list tags: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Logs ────────────────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_integration_logs')),\n {\n title: 'Integration Audit Logs',\n description: 'List integration audit logs with optional filters.',\n inputSchema: {\n connection: z.string().optional().describe('Filter by connection ID'),\n level: z.string().optional().describe('INFO|WARN|ERROR (will be uppercased)'),\n limit: z.number().optional().describe('Page size (default 100)'),\n },\n },\n async ({ connection, level, limit }) => {\n try {\n const filter: Record<string, unknown> = {};\n if (connection !== undefined) filter.connectionId = connection;\n if (level !== undefined) filter.level = level.toUpperCase();\n const data = await ctx.gql.workspace.request<{\n getIntegrationLogs: { items: IntegrationLog[]; total: number; hasMore: boolean };\n }>(ops.GET_INTEGRATION_LOGS, {\n filter: Object.keys(filter).length > 0 ? filter : undefined,\n pagination: { limit: limit ?? 100, offset: 0 },\n });\n return jsonResult(data.getIntegrationLogs);\n } catch (error) {\n ctx.logger.error('integrations_integration_logs failed', { error: String(error) });\n return errorResult(\n `Failed to get integration logs: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'integrations_logs')),\n {\n title: 'Connection Audit Logs',\n description: 'List audit logs for a specific integration connection.',\n inputSchema: {\n connection: z.string().describe('Connection ID (required)'),\n limit: z.number().optional().describe('Page size (default 100)'),\n offset: z.number().optional().describe('Offset (default 0)'),\n },\n },\n async ({ connection, limit, offset }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n getConnectionLogs: { items: IntegrationLog[]; total: number; hasMore: boolean };\n }>(ops.GET_CONNECTION_LOGS, {\n connectionId: connection,\n pagination: { limit: limit ?? 100, offset: offset ?? 0 },\n });\n return jsonResult(data.getConnectionLogs);\n } catch (error) {\n ctx.logger.error('integrations_logs failed', { error: String(error) });\n return errorResult(\n `Failed to get connection logs: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n}\n","/**\n * Integrations module — providers, connections, audit logs.\n * Surface mirrors cli-sdk/src/modules/integrations/.\n */\n\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport type { McpContext, McpModule, ModuleRegistration } from '../../core/index.js';\nimport { registerIntegrationsTools } from './tools.js';\n\nconst integrationsModule: McpModule = {\n id: 'integrations',\n version: '0.0.1',\n displayName: 'Integrations',\n dependsOn: ['auth'],\n capabilities: { tools: {} },\n\n register(server: McpServer, ctx: McpContext): ModuleRegistration {\n const tools: string[] = [];\n const track = (n: string): string => {\n tools.push(n);\n return n;\n };\n\n registerIntegrationsTools(server, ctx, track);\n\n return { tools, resources: [], prompts: [] };\n },\n};\n\nexport default integrationsModule;\n"]}
|
|
@@ -18,20 +18,6 @@ var McpInternalError = class extends Error {
|
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
// src/core/result.ts
|
|
22
|
-
function jsonResult(data, structured) {
|
|
23
|
-
const result = {
|
|
24
|
-
content: [{ type: "text", text: JSON.stringify(data, null, 2) }]
|
|
25
|
-
};
|
|
26
|
-
return result;
|
|
27
|
-
}
|
|
28
|
-
function errorResult(message, hint) {
|
|
29
|
-
const text = hint ? `${message}
|
|
30
|
-
|
|
31
|
-
Hint: ${hint}` : message;
|
|
32
|
-
return { content: [{ type: "text", text }], isError: true };
|
|
33
|
-
}
|
|
34
|
-
|
|
35
21
|
// src/core/tool-name.ts
|
|
36
22
|
var MAX_TOOL_NAME_LENGTH = 63;
|
|
37
23
|
function assertSafeName(name, kind) {
|
|
@@ -62,6 +48,20 @@ function mcpPromptName(productName, ...parts) {
|
|
|
62
48
|
return [productName, ...parts].filter(Boolean).join("-");
|
|
63
49
|
}
|
|
64
50
|
|
|
51
|
+
// src/core/result.ts
|
|
52
|
+
function jsonResult(data, structured) {
|
|
53
|
+
const result = {
|
|
54
|
+
content: [{ type: "text", text: JSON.stringify(data, null, 2) }]
|
|
55
|
+
};
|
|
56
|
+
return result;
|
|
57
|
+
}
|
|
58
|
+
function errorResult(message, hint) {
|
|
59
|
+
const text = hint ? `${message}
|
|
60
|
+
|
|
61
|
+
Hint: ${hint}` : message;
|
|
62
|
+
return { content: [{ type: "text", text }], isError: true };
|
|
63
|
+
}
|
|
64
|
+
|
|
65
65
|
// src/modules/intelwatchtower/operations.ts
|
|
66
66
|
var PAGE_INFO = `pageInfo { cursor hasMore }`;
|
|
67
67
|
var SOURCE_FIELDS = `
|