@burdenoff/mcp-libs 2026.511.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.
Files changed (174) hide show
  1. package/README.md +76 -0
  2. package/dist/chunk-4GBVJ4OY.js +847 -0
  3. package/dist/chunk-4GBVJ4OY.js.map +1 -0
  4. package/dist/chunk-H2OYWLOA.js +919 -0
  5. package/dist/chunk-H2OYWLOA.js.map +1 -0
  6. package/dist/chunk-JFEQYSWM.js +174 -0
  7. package/dist/chunk-JFEQYSWM.js.map +1 -0
  8. package/dist/chunk-WWFVD7BO.js +273 -0
  9. package/dist/chunk-WWFVD7BO.js.map +1 -0
  10. package/dist/context-1jV4NsLv.d.cts +138 -0
  11. package/dist/context-1jV4NsLv.d.ts +138 -0
  12. package/dist/core/index.cjs +953 -0
  13. package/dist/core/index.cjs.map +1 -0
  14. package/dist/core/index.d.cts +59 -0
  15. package/dist/core/index.d.ts +59 -0
  16. package/dist/core/index.js +3 -0
  17. package/dist/core/index.js.map +1 -0
  18. package/dist/http-BP4c721D.d.cts +22 -0
  19. package/dist/http-DXTeCD5r.d.ts +22 -0
  20. package/dist/index.cjs +1013 -0
  21. package/dist/index.cjs.map +1 -0
  22. package/dist/index.d.cts +7 -0
  23. package/dist/index.d.ts +7 -0
  24. package/dist/index.js +4 -0
  25. package/dist/index.js.map +1 -0
  26. package/dist/module-DBcfA-i3.d.ts +67 -0
  27. package/dist/module-DFQBZNK6.d.cts +67 -0
  28. package/dist/modules/auth/index.cjs +533 -0
  29. package/dist/modules/auth/index.cjs.map +1 -0
  30. package/dist/modules/auth/index.d.cts +51 -0
  31. package/dist/modules/auth/index.d.ts +51 -0
  32. package/dist/modules/auth/index.js +159 -0
  33. package/dist/modules/auth/index.js.map +1 -0
  34. package/dist/modules/billing/index.cjs +655 -0
  35. package/dist/modules/billing/index.cjs.map +1 -0
  36. package/dist/modules/billing/index.d.cts +8 -0
  37. package/dist/modules/billing/index.d.ts +8 -0
  38. package/dist/modules/billing/index.js +606 -0
  39. package/dist/modules/billing/index.js.map +1 -0
  40. package/dist/modules/channels/index.cjs +443 -0
  41. package/dist/modules/channels/index.cjs.map +1 -0
  42. package/dist/modules/channels/index.d.cts +8 -0
  43. package/dist/modules/channels/index.d.ts +8 -0
  44. package/dist/modules/channels/index.js +394 -0
  45. package/dist/modules/channels/index.js.map +1 -0
  46. package/dist/modules/conversations/index.cjs +288 -0
  47. package/dist/modules/conversations/index.cjs.map +1 -0
  48. package/dist/modules/conversations/index.d.cts +8 -0
  49. package/dist/modules/conversations/index.d.ts +8 -0
  50. package/dist/modules/conversations/index.js +239 -0
  51. package/dist/modules/conversations/index.js.map +1 -0
  52. package/dist/modules/devportal/index.cjs +796 -0
  53. package/dist/modules/devportal/index.cjs.map +1 -0
  54. package/dist/modules/devportal/index.d.cts +8 -0
  55. package/dist/modules/devportal/index.d.ts +8 -0
  56. package/dist/modules/devportal/index.js +747 -0
  57. package/dist/modules/devportal/index.js.map +1 -0
  58. package/dist/modules/export/index.cjs +333 -0
  59. package/dist/modules/export/index.cjs.map +1 -0
  60. package/dist/modules/export/index.d.cts +8 -0
  61. package/dist/modules/export/index.d.ts +8 -0
  62. package/dist/modules/export/index.js +284 -0
  63. package/dist/modules/export/index.js.map +1 -0
  64. package/dist/modules/files/index.cjs +278 -0
  65. package/dist/modules/files/index.cjs.map +1 -0
  66. package/dist/modules/files/index.d.cts +8 -0
  67. package/dist/modules/files/index.d.ts +8 -0
  68. package/dist/modules/files/index.js +229 -0
  69. package/dist/modules/files/index.js.map +1 -0
  70. package/dist/modules/groups/index.cjs +451 -0
  71. package/dist/modules/groups/index.cjs.map +1 -0
  72. package/dist/modules/groups/index.d.cts +8 -0
  73. package/dist/modules/groups/index.d.ts +8 -0
  74. package/dist/modules/groups/index.js +402 -0
  75. package/dist/modules/groups/index.js.map +1 -0
  76. package/dist/modules/health/index.cjs +159 -0
  77. package/dist/modules/health/index.cjs.map +1 -0
  78. package/dist/modules/health/index.d.cts +8 -0
  79. package/dist/modules/health/index.d.ts +8 -0
  80. package/dist/modules/health/index.js +36 -0
  81. package/dist/modules/health/index.js.map +1 -0
  82. package/dist/modules/integrations/index.cjs +316 -0
  83. package/dist/modules/integrations/index.cjs.map +1 -0
  84. package/dist/modules/integrations/index.d.cts +8 -0
  85. package/dist/modules/integrations/index.d.ts +8 -0
  86. package/dist/modules/integrations/index.js +267 -0
  87. package/dist/modules/integrations/index.js.map +1 -0
  88. package/dist/modules/notifications/index.cjs +222 -0
  89. package/dist/modules/notifications/index.cjs.map +1 -0
  90. package/dist/modules/notifications/index.d.cts +8 -0
  91. package/dist/modules/notifications/index.d.ts +8 -0
  92. package/dist/modules/notifications/index.js +173 -0
  93. package/dist/modules/notifications/index.js.map +1 -0
  94. package/dist/modules/organizations/index.cjs +267 -0
  95. package/dist/modules/organizations/index.cjs.map +1 -0
  96. package/dist/modules/organizations/index.d.cts +8 -0
  97. package/dist/modules/organizations/index.d.ts +8 -0
  98. package/dist/modules/organizations/index.js +218 -0
  99. package/dist/modules/organizations/index.js.map +1 -0
  100. package/dist/modules/products/index.cjs +736 -0
  101. package/dist/modules/products/index.cjs.map +1 -0
  102. package/dist/modules/products/index.d.cts +8 -0
  103. package/dist/modules/products/index.d.ts +8 -0
  104. package/dist/modules/products/index.js +687 -0
  105. package/dist/modules/products/index.js.map +1 -0
  106. package/dist/modules/rbac/index.cjs +378 -0
  107. package/dist/modules/rbac/index.cjs.map +1 -0
  108. package/dist/modules/rbac/index.d.cts +8 -0
  109. package/dist/modules/rbac/index.d.ts +8 -0
  110. package/dist/modules/rbac/index.js +329 -0
  111. package/dist/modules/rbac/index.js.map +1 -0
  112. package/dist/modules/sandbox/index.cjs +318 -0
  113. package/dist/modules/sandbox/index.cjs.map +1 -0
  114. package/dist/modules/sandbox/index.d.cts +8 -0
  115. package/dist/modules/sandbox/index.d.ts +8 -0
  116. package/dist/modules/sandbox/index.js +225 -0
  117. package/dist/modules/sandbox/index.js.map +1 -0
  118. package/dist/modules/scheduler/index.cjs +267 -0
  119. package/dist/modules/scheduler/index.cjs.map +1 -0
  120. package/dist/modules/scheduler/index.d.cts +8 -0
  121. package/dist/modules/scheduler/index.d.ts +8 -0
  122. package/dist/modules/scheduler/index.js +218 -0
  123. package/dist/modules/scheduler/index.js.map +1 -0
  124. package/dist/modules/security/index.cjs +529 -0
  125. package/dist/modules/security/index.cjs.map +1 -0
  126. package/dist/modules/security/index.d.cts +8 -0
  127. package/dist/modules/security/index.d.ts +8 -0
  128. package/dist/modules/security/index.js +480 -0
  129. package/dist/modules/security/index.js.map +1 -0
  130. package/dist/modules/store/index.cjs +450 -0
  131. package/dist/modules/store/index.cjs.map +1 -0
  132. package/dist/modules/store/index.d.cts +8 -0
  133. package/dist/modules/store/index.d.ts +8 -0
  134. package/dist/modules/store/index.js +401 -0
  135. package/dist/modules/store/index.js.map +1 -0
  136. package/dist/modules/support/index.cjs +285 -0
  137. package/dist/modules/support/index.cjs.map +1 -0
  138. package/dist/modules/support/index.d.cts +8 -0
  139. package/dist/modules/support/index.d.ts +8 -0
  140. package/dist/modules/support/index.js +236 -0
  141. package/dist/modules/support/index.js.map +1 -0
  142. package/dist/modules/tags/index.cjs +421 -0
  143. package/dist/modules/tags/index.cjs.map +1 -0
  144. package/dist/modules/tags/index.d.cts +8 -0
  145. package/dist/modules/tags/index.d.ts +8 -0
  146. package/dist/modules/tags/index.js +372 -0
  147. package/dist/modules/tags/index.js.map +1 -0
  148. package/dist/modules/tours/index.cjs +225 -0
  149. package/dist/modules/tours/index.cjs.map +1 -0
  150. package/dist/modules/tours/index.d.cts +8 -0
  151. package/dist/modules/tours/index.d.ts +8 -0
  152. package/dist/modules/tours/index.js +176 -0
  153. package/dist/modules/tours/index.js.map +1 -0
  154. package/dist/modules/vibecontrols/index.cjs +5551 -0
  155. package/dist/modules/vibecontrols/index.cjs.map +1 -0
  156. package/dist/modules/vibecontrols/index.d.cts +8 -0
  157. package/dist/modules/vibecontrols/index.d.ts +8 -0
  158. package/dist/modules/vibecontrols/index.js +4380 -0
  159. package/dist/modules/vibecontrols/index.js.map +1 -0
  160. package/dist/modules/workspaces/index.cjs +552 -0
  161. package/dist/modules/workspaces/index.cjs.map +1 -0
  162. package/dist/modules/workspaces/index.d.cts +8 -0
  163. package/dist/modules/workspaces/index.d.ts +8 -0
  164. package/dist/modules/workspaces/index.js +503 -0
  165. package/dist/modules/workspaces/index.js.map +1 -0
  166. package/dist/tool-name-CQf_IqAj.d.cts +47 -0
  167. package/dist/tool-name-DlnrBsZ6.d.ts +47 -0
  168. package/dist/transports/index.cjs +183 -0
  169. package/dist/transports/index.cjs.map +1 -0
  170. package/dist/transports/index.d.cts +13 -0
  171. package/dist/transports/index.d.ts +13 -0
  172. package/dist/transports/index.js +3 -0
  173. package/dist/transports/index.js.map +1 -0
  174. package/package.json +125 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/core/errors.ts","../../../src/core/result.ts","../../../src/core/tool-name.ts","../../../src/modules/tours/operations.ts","../../../src/modules/tours/tools.ts","../../../src/modules/tours/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;;;ACCO,SAAS,UAAA,CAAW,MAAe,UAAA,EAAkD;AAC1F,EAAA,MAAM,MAAA,GAAqB;AAAA,IACzB,OAAA,EAAS,CAAC,EAAE,IAAA,EAAM,MAAA,EAAQ,IAAA,EAAM,IAAA,CAAK,SAAA,CAAU,IAAA,EAAM,IAAA,EAAM,CAAC,CAAA,EAAG;AAAA,GACjE;AAIA,EAAA,OAAO,MAAA;AACT;AAaO,SAAS,WAAA,CAAY,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AA,UAChC,mBAAA;AAAA,UACA,EAAE,MAAA,EAAQ,MAAA,EAAQ,cAAA;AAAe,SACnC;AACA,QAAA,OAAO,UAAA,CAAW,KAAK,iBAAiB,CAAA;AAAA,MAC1C,SAAS,KAAA,EAAO;AACd,QAAA,GAAA,CAAI,MAAA,CAAO,MAAM,6BAAA,EAA+B,EAAE,OAAO,MAAA,CAAO,KAAK,GAAG,CAAA;AACxE,QAAA,OAAO,WAAA;AAAA,UACL,kCAAkC,KAAA,YAAiB,KAAA,GAAQ,MAAM,OAAA,GAAU,MAAA,CAAO,KAAK,CAAC,CAAA;AAAA,SAC1F;AAAA,MACF;AAAA,IACF;AAAA,GACF;AACF;;;AC7FA,IAAM,WAAA,GAAyB;AAAA,EAC7B,EAAA,EAAI,OAAA;AAAA,EACJ,OAAA,EAAS,OAAA;AAAA,EACT,WAAA,EAAa,OAAA;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,kBAAA,CAAmB,MAAA,EAAQ,KAAK,KAAK,CAAA;AAErC,IAAA,OAAO,EAAE,KAAA,EAAO,SAAA,EAAW,EAAC,EAAG,OAAA,EAAS,EAAC,EAAE;AAAA,EAC7C;AACF,CAAA;AAEA,IAAO,aAAA,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 LIST_TOURS = `\n query ListTours($filters: TourFilters, $pagination: TourPagination) {\n tours(filters: $filters, pagination: $pagination) {\n tours {\n id\n name\n slug\n description\n status\n isActive\n productId\n moduleId\n priority\n displayOrder\n createdAt\n updatedAt\n }\n total\n hasMore\n }\n }\n`;\n\nexport const GET_USER_TOUR_PROGRESS = `\n query GetUserTourProgress($userId: ID, $pagination: TourPagination) {\n userTourProgresses(userId: $userId, pagination: $pagination) {\n id\n tourId\n userId\n status\n currentStepId\n currentStepOrder\n completedSteps\n skippedSteps\n startedAt\n completedAt\n lastViewedAt\n }\n }\n`;\n\nexport const RESET_TOUR_PROGRESS = `\n mutation ResetTourProgress($tourId: ID!, $userId: ID!) {\n resetTourProgress(tourId: $tourId, userId: $userId) {\n id\n tourId\n status\n currentStepId\n currentStepOrder\n }\n }\n`;\n","import { z } from 'zod';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { jsonResult, errorResult, mcpToolName, type McpContext } from '../../core/index.js';\nimport { LIST_TOURS, GET_USER_TOUR_PROGRESS, RESET_TOUR_PROGRESS } from './operations.js';\n\nexport function registerToursTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n server.registerTool(\n track(mcpToolName(ctx.productName, 'tours_list')),\n {\n title: 'List Tours',\n description: 'List available product tours.',\n inputSchema: {\n productId: z.string().optional().describe('Filter by productId'),\n moduleId: z.string().optional().describe('Filter by moduleId'),\n status: z.string().optional().describe('Filter by status'),\n isActive: z.boolean().optional().describe('Only active tours'),\n limit: z.number().optional().describe('Page size'),\n offset: z.number().optional().describe('Offset for pagination'),\n },\n },\n async ({ productId, moduleId, status, isActive, limit, offset }) => {\n try {\n const filters: Record<string, unknown> = {};\n if (productId !== undefined) filters.productId = productId;\n if (moduleId !== undefined) filters.moduleId = moduleId;\n if (status !== undefined) filters.status = status.toUpperCase();\n if (isActive !== undefined) filters.isActive = isActive;\n const data = await ctx.gql.global.request<{ tours: unknown }>(LIST_TOURS, {\n filters: Object.keys(filters).length ? filters : undefined,\n pagination: { limit: limit ?? 50, offset: offset ?? 0 },\n });\n return jsonResult(data.tours);\n } catch (error) {\n ctx.logger.error('tours_list failed', { error: String(error) });\n return errorResult(\n `Failed to list tours: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'tours_progress_get')),\n {\n title: 'Get Tour Progress',\n description: \"Get the current user's tour progress, optionally filtered by user id.\",\n inputSchema: {\n userId: z.string().optional().describe('User ID (defaults to current actor)'),\n limit: z.number().optional().describe('Page size'),\n offset: z.number().optional().describe('Offset for pagination'),\n },\n },\n async ({ userId, limit, offset }) => {\n try {\n const data = await ctx.gql.global.request<{ userTourProgresses: unknown }>(\n GET_USER_TOUR_PROGRESS,\n {\n userId,\n pagination: { limit: limit ?? 50, offset: offset ?? 0 },\n },\n );\n return jsonResult(data.userTourProgresses);\n } catch (error) {\n ctx.logger.error('tours_progress_get failed', { error: String(error) });\n return errorResult(\n `Failed to get tour progress: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'tours_progress_reset')),\n {\n title: 'Reset Tour Progress',\n description: 'Reset tour progress for the given user (defaults to the current actor).',\n inputSchema: {\n tourId: z.string().describe('Tour ID'),\n userId: z.string().optional().describe('User ID (defaults to current actor)'),\n },\n },\n async ({ tourId, userId }) => {\n try {\n const auth = ctx.auth.read();\n const resolvedUserId = userId ?? auth?.workspaceId;\n if (!resolvedUserId) {\n return errorResult(\n 'Unable to resolve user; pass userId or authenticate to a workspace first.',\n );\n }\n const data = await ctx.gql.global.request<{ resetTourProgress: unknown }>(\n RESET_TOUR_PROGRESS,\n { tourId, userId: resolvedUserId },\n );\n return jsonResult(data.resetTourProgress);\n } catch (error) {\n ctx.logger.error('tours_progress_reset failed', { error: String(error) });\n return errorResult(\n `Failed to reset tour progress: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n}\n","/**\n * Tours module — product tours + per-user progress.\n *\n * Tools:\n * <product>_tours_list\n * <product>_tours_progress_{get,reset}\n *\n * Backend: ~/products/global/tours/global-tours-svc/.\n */\n\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport type { McpContext, McpModule, ModuleRegistration } from '../../core/index.js';\nimport { registerToursTools } from './tools.js';\n\nconst toursModule: McpModule = {\n id: 'tours',\n version: '0.0.1',\n displayName: 'Tours',\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 registerToursTools(server, ctx, track);\n\n return { tools, resources: [], prompts: [] };\n },\n};\n\nexport default toursModule;\n"]}
@@ -0,0 +1,8 @@
1
+ import { c as McpModule } from '../../module-DFQBZNK6.cjs';
2
+ import '@modelcontextprotocol/sdk/server/mcp.js';
3
+ import '../../context-1jV4NsLv.cjs';
4
+ import 'graphql-request';
5
+
6
+ declare const toursModule: McpModule;
7
+
8
+ export { toursModule as default };
@@ -0,0 +1,8 @@
1
+ import { c as McpModule } from '../../module-DBcfA-i3.js';
2
+ import '@modelcontextprotocol/sdk/server/mcp.js';
3
+ import '../../context-1jV4NsLv.js';
4
+ import 'graphql-request';
5
+
6
+ declare const toursModule: McpModule;
7
+
8
+ export { toursModule as default };
@@ -0,0 +1,176 @@
1
+ import { mcpToolName, jsonResult, errorResult } from '../../chunk-H2OYWLOA.js';
2
+ import { z } from 'zod';
3
+
4
+ // src/modules/tours/operations.ts
5
+ var LIST_TOURS = `
6
+ query ListTours($filters: TourFilters, $pagination: TourPagination) {
7
+ tours(filters: $filters, pagination: $pagination) {
8
+ tours {
9
+ id
10
+ name
11
+ slug
12
+ description
13
+ status
14
+ isActive
15
+ productId
16
+ moduleId
17
+ priority
18
+ displayOrder
19
+ createdAt
20
+ updatedAt
21
+ }
22
+ total
23
+ hasMore
24
+ }
25
+ }
26
+ `;
27
+ var GET_USER_TOUR_PROGRESS = `
28
+ query GetUserTourProgress($userId: ID, $pagination: TourPagination) {
29
+ userTourProgresses(userId: $userId, pagination: $pagination) {
30
+ id
31
+ tourId
32
+ userId
33
+ status
34
+ currentStepId
35
+ currentStepOrder
36
+ completedSteps
37
+ skippedSteps
38
+ startedAt
39
+ completedAt
40
+ lastViewedAt
41
+ }
42
+ }
43
+ `;
44
+ var RESET_TOUR_PROGRESS = `
45
+ mutation ResetTourProgress($tourId: ID!, $userId: ID!) {
46
+ resetTourProgress(tourId: $tourId, userId: $userId) {
47
+ id
48
+ tourId
49
+ status
50
+ currentStepId
51
+ currentStepOrder
52
+ }
53
+ }
54
+ `;
55
+
56
+ // src/modules/tours/tools.ts
57
+ function registerToursTools(server, ctx, track) {
58
+ server.registerTool(
59
+ track(mcpToolName(ctx.productName, "tours_list")),
60
+ {
61
+ title: "List Tours",
62
+ description: "List available product tours.",
63
+ inputSchema: {
64
+ productId: z.string().optional().describe("Filter by productId"),
65
+ moduleId: z.string().optional().describe("Filter by moduleId"),
66
+ status: z.string().optional().describe("Filter by status"),
67
+ isActive: z.boolean().optional().describe("Only active tours"),
68
+ limit: z.number().optional().describe("Page size"),
69
+ offset: z.number().optional().describe("Offset for pagination")
70
+ }
71
+ },
72
+ async ({ productId, moduleId, status, isActive, limit, offset }) => {
73
+ try {
74
+ const filters = {};
75
+ if (productId !== void 0) filters.productId = productId;
76
+ if (moduleId !== void 0) filters.moduleId = moduleId;
77
+ if (status !== void 0) filters.status = status.toUpperCase();
78
+ if (isActive !== void 0) filters.isActive = isActive;
79
+ const data = await ctx.gql.global.request(LIST_TOURS, {
80
+ filters: Object.keys(filters).length ? filters : void 0,
81
+ pagination: { limit: limit ?? 50, offset: offset ?? 0 }
82
+ });
83
+ return jsonResult(data.tours);
84
+ } catch (error) {
85
+ ctx.logger.error("tours_list failed", { error: String(error) });
86
+ return errorResult(
87
+ `Failed to list tours: ${error instanceof Error ? error.message : String(error)}`
88
+ );
89
+ }
90
+ }
91
+ );
92
+ server.registerTool(
93
+ track(mcpToolName(ctx.productName, "tours_progress_get")),
94
+ {
95
+ title: "Get Tour Progress",
96
+ description: "Get the current user's tour progress, optionally filtered by user id.",
97
+ inputSchema: {
98
+ userId: z.string().optional().describe("User ID (defaults to current actor)"),
99
+ limit: z.number().optional().describe("Page size"),
100
+ offset: z.number().optional().describe("Offset for pagination")
101
+ }
102
+ },
103
+ async ({ userId, limit, offset }) => {
104
+ try {
105
+ const data = await ctx.gql.global.request(
106
+ GET_USER_TOUR_PROGRESS,
107
+ {
108
+ userId,
109
+ pagination: { limit: limit ?? 50, offset: offset ?? 0 }
110
+ }
111
+ );
112
+ return jsonResult(data.userTourProgresses);
113
+ } catch (error) {
114
+ ctx.logger.error("tours_progress_get failed", { error: String(error) });
115
+ return errorResult(
116
+ `Failed to get tour progress: ${error instanceof Error ? error.message : String(error)}`
117
+ );
118
+ }
119
+ }
120
+ );
121
+ server.registerTool(
122
+ track(mcpToolName(ctx.productName, "tours_progress_reset")),
123
+ {
124
+ title: "Reset Tour Progress",
125
+ description: "Reset tour progress for the given user (defaults to the current actor).",
126
+ inputSchema: {
127
+ tourId: z.string().describe("Tour ID"),
128
+ userId: z.string().optional().describe("User ID (defaults to current actor)")
129
+ }
130
+ },
131
+ async ({ tourId, userId }) => {
132
+ try {
133
+ const auth = ctx.auth.read();
134
+ const resolvedUserId = userId ?? auth?.workspaceId;
135
+ if (!resolvedUserId) {
136
+ return errorResult(
137
+ "Unable to resolve user; pass userId or authenticate to a workspace first."
138
+ );
139
+ }
140
+ const data = await ctx.gql.global.request(
141
+ RESET_TOUR_PROGRESS,
142
+ { tourId, userId: resolvedUserId }
143
+ );
144
+ return jsonResult(data.resetTourProgress);
145
+ } catch (error) {
146
+ ctx.logger.error("tours_progress_reset failed", { error: String(error) });
147
+ return errorResult(
148
+ `Failed to reset tour progress: ${error instanceof Error ? error.message : String(error)}`
149
+ );
150
+ }
151
+ }
152
+ );
153
+ }
154
+
155
+ // src/modules/tours/index.ts
156
+ var toursModule = {
157
+ id: "tours",
158
+ version: "0.0.1",
159
+ displayName: "Tours",
160
+ dependsOn: ["auth"],
161
+ capabilities: { tools: {} },
162
+ register(server, ctx) {
163
+ const tools = [];
164
+ const track = (n) => {
165
+ tools.push(n);
166
+ return n;
167
+ };
168
+ registerToursTools(server, ctx, track);
169
+ return { tools, resources: [], prompts: [] };
170
+ }
171
+ };
172
+ var tours_default = toursModule;
173
+
174
+ export { tours_default as default };
175
+ //# sourceMappingURL=index.js.map
176
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/modules/tours/operations.ts","../../../src/modules/tours/tools.ts","../../../src/modules/tours/index.ts"],"names":[],"mappings":";;;;AAAO,IAAM,UAAA,GAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;AAuBnB,IAAM,sBAA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":"index.js","sourcesContent":["export const LIST_TOURS = `\n query ListTours($filters: TourFilters, $pagination: TourPagination) {\n tours(filters: $filters, pagination: $pagination) {\n tours {\n id\n name\n slug\n description\n status\n isActive\n productId\n moduleId\n priority\n displayOrder\n createdAt\n updatedAt\n }\n total\n hasMore\n }\n }\n`;\n\nexport const GET_USER_TOUR_PROGRESS = `\n query GetUserTourProgress($userId: ID, $pagination: TourPagination) {\n userTourProgresses(userId: $userId, pagination: $pagination) {\n id\n tourId\n userId\n status\n currentStepId\n currentStepOrder\n completedSteps\n skippedSteps\n startedAt\n completedAt\n lastViewedAt\n }\n }\n`;\n\nexport const RESET_TOUR_PROGRESS = `\n mutation ResetTourProgress($tourId: ID!, $userId: ID!) {\n resetTourProgress(tourId: $tourId, userId: $userId) {\n id\n tourId\n status\n currentStepId\n currentStepOrder\n }\n }\n`;\n","import { z } from 'zod';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { jsonResult, errorResult, mcpToolName, type McpContext } from '../../core/index.js';\nimport { LIST_TOURS, GET_USER_TOUR_PROGRESS, RESET_TOUR_PROGRESS } from './operations.js';\n\nexport function registerToursTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n server.registerTool(\n track(mcpToolName(ctx.productName, 'tours_list')),\n {\n title: 'List Tours',\n description: 'List available product tours.',\n inputSchema: {\n productId: z.string().optional().describe('Filter by productId'),\n moduleId: z.string().optional().describe('Filter by moduleId'),\n status: z.string().optional().describe('Filter by status'),\n isActive: z.boolean().optional().describe('Only active tours'),\n limit: z.number().optional().describe('Page size'),\n offset: z.number().optional().describe('Offset for pagination'),\n },\n },\n async ({ productId, moduleId, status, isActive, limit, offset }) => {\n try {\n const filters: Record<string, unknown> = {};\n if (productId !== undefined) filters.productId = productId;\n if (moduleId !== undefined) filters.moduleId = moduleId;\n if (status !== undefined) filters.status = status.toUpperCase();\n if (isActive !== undefined) filters.isActive = isActive;\n const data = await ctx.gql.global.request<{ tours: unknown }>(LIST_TOURS, {\n filters: Object.keys(filters).length ? filters : undefined,\n pagination: { limit: limit ?? 50, offset: offset ?? 0 },\n });\n return jsonResult(data.tours);\n } catch (error) {\n ctx.logger.error('tours_list failed', { error: String(error) });\n return errorResult(\n `Failed to list tours: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'tours_progress_get')),\n {\n title: 'Get Tour Progress',\n description: \"Get the current user's tour progress, optionally filtered by user id.\",\n inputSchema: {\n userId: z.string().optional().describe('User ID (defaults to current actor)'),\n limit: z.number().optional().describe('Page size'),\n offset: z.number().optional().describe('Offset for pagination'),\n },\n },\n async ({ userId, limit, offset }) => {\n try {\n const data = await ctx.gql.global.request<{ userTourProgresses: unknown }>(\n GET_USER_TOUR_PROGRESS,\n {\n userId,\n pagination: { limit: limit ?? 50, offset: offset ?? 0 },\n },\n );\n return jsonResult(data.userTourProgresses);\n } catch (error) {\n ctx.logger.error('tours_progress_get failed', { error: String(error) });\n return errorResult(\n `Failed to get tour progress: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'tours_progress_reset')),\n {\n title: 'Reset Tour Progress',\n description: 'Reset tour progress for the given user (defaults to the current actor).',\n inputSchema: {\n tourId: z.string().describe('Tour ID'),\n userId: z.string().optional().describe('User ID (defaults to current actor)'),\n },\n },\n async ({ tourId, userId }) => {\n try {\n const auth = ctx.auth.read();\n const resolvedUserId = userId ?? auth?.workspaceId;\n if (!resolvedUserId) {\n return errorResult(\n 'Unable to resolve user; pass userId or authenticate to a workspace first.',\n );\n }\n const data = await ctx.gql.global.request<{ resetTourProgress: unknown }>(\n RESET_TOUR_PROGRESS,\n { tourId, userId: resolvedUserId },\n );\n return jsonResult(data.resetTourProgress);\n } catch (error) {\n ctx.logger.error('tours_progress_reset failed', { error: String(error) });\n return errorResult(\n `Failed to reset tour progress: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n}\n","/**\n * Tours module — product tours + per-user progress.\n *\n * Tools:\n * <product>_tours_list\n * <product>_tours_progress_{get,reset}\n *\n * Backend: ~/products/global/tours/global-tours-svc/.\n */\n\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport type { McpContext, McpModule, ModuleRegistration } from '../../core/index.js';\nimport { registerToursTools } from './tools.js';\n\nconst toursModule: McpModule = {\n id: 'tours',\n version: '0.0.1',\n displayName: 'Tours',\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 registerToursTools(server, ctx, track);\n\n return { tools, resources: [], prompts: [] };\n },\n};\n\nexport default toursModule;\n"]}