@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/modules/devportal/operations.ts","../../../src/modules/devportal/tools.ts","../../../src/modules/devportal/index.ts"],"names":[],"mappings":";;;;AAAO,IAAM,kBAAA,GAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;AAS3B,IAAM,gBAAA,GAAmB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;AAQzB,IAAM,mBAAA,GAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;AAQ5B,IAAM,mBAAA,GAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;AAQ5B,IAAM,mBAAA,GAAsB;AAAA;AAAA;AAAA;AAAA,CAAA;AAM5B,IAAM,iBAAA,GAAoB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;AAS1B,IAAM,eAAA,GAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;AAQxB,IAAM,kBAAA,GAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;AAQ3B,IAAM,kBAAA,GAAqB;AAAA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A;AAAM,SACd;AACA,QAAA,OAAO,UAAA,CAAW,KAAK,iBAAiB,CAAA;AAAA,MAC1C,SAAS,KAAA,EAAO;AACd,QAAA,GAAA,CAAI,MAAA,CAAO,MAAM,uCAAA,EAAyC,EAAE,OAAO,MAAA,CAAO,KAAK,GAAG,CAAA;AAClF,QAAA,OAAO,WAAA;AAAA,UACL,iCAAiC,KAAA,YAAiB,KAAA,GAAQ,MAAM,OAAA,GAAU,MAAA,CAAO,KAAK,CAAC,CAAA;AAAA,SACzF;AAAA,MACF;AAAA,IACF;AAAA,GACF;AACF;;;AC5oBA,IAAM,eAAA,GAA6B;AAAA,EACjC,EAAA,EAAI,WAAA;AAAA,EACJ,OAAA,EAAS,OAAA;AAAA,EACT,WAAA,EAAa,kBAAA;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,sBAAA,CAAuB,MAAA,EAAQ,KAAK,KAAK,CAAA;AAEzC,IAAA,OAAO,EAAE,KAAA,EAAO,SAAA,EAAW,EAAC,EAAG,OAAA,EAAS,EAAC,EAAE;AAAA,EAC7C;AACF,CAAA;AAEA,IAAO,iBAAA,GAAQ","file":"index.js","sourcesContent":["export const LIST_ORGANIZATIONS = `\n query ListOrganizations($limit: Int, $offset: Int) {\n organizations(limit: $limit, offset: $offset) {\n edges { node { id name slug status } }\n totalCount pageInfo { hasNextPage }\n }\n }\n`;\n\nexport const GET_ORGANIZATION = `\n query GetOrganization($id: ID!) {\n organization(id: $id) {\n id name description status\n }\n }\n`;\n\nexport const CREATE_ORGANIZATION = `\n mutation CreateOrganization($input: CreateOrganizationInput!) {\n createOrganization(input: $input) {\n id name slug status\n }\n }\n`;\n\nexport const UPDATE_ORGANIZATION = `\n mutation UpdateOrganization($id: ID!, $input: UpdateOrganizationInput!) {\n updateOrganization(id: $id, input: $input) {\n id name updatedAt\n }\n }\n`;\n\nexport const DELETE_ORGANIZATION = `\n mutation DeleteOrganization($id: ID!) {\n deleteOrganization(id: $id) { success }\n }\n`;\n\nexport const LIST_APPLICATIONS = `\n query ListApplications($organizationId: ID, $status: String, $limit: Int) {\n applications(organizationId: $organizationId, status: $status, limit: $limit) {\n edges { node { id name status installCount averageRating } }\n totalCount\n }\n }\n`;\n\nexport const GET_APPLICATION = `\n query GetApplication($id: ID!) {\n application(id: $id) {\n id name status reviewStatus publishedAt installCount\n }\n }\n`;\n\nexport const CREATE_APPLICATION = `\n mutation CreateApplication($input: CreateApplicationInput!) {\n createApplication(input: $input) {\n id name status appId\n }\n }\n`;\n\nexport const UPDATE_APPLICATION = `\n mutation UpdateApplication($id: ID!, $input: UpdateApplicationInput!) {\n updateApplication(id: $id, input: $input) {\n id description updatedAt\n }\n }\n`;\n\nexport const SUBMIT_APPLICATION_FOR_REVIEW = `\n mutation SubmitApplicationForReview($id: ID!, $notes: String) {\n submitApplicationForReview(id: $id, notes: $notes) {\n id status reviewStatus submittedAt\n }\n }\n`;\n\nexport const PUBLISH_APPLICATION = `\n mutation PublishApplication($id: ID!) {\n publishApplication(id: $id) {\n id status publishedAt\n }\n }\n`;\n\nexport const DELETE_APPLICATION = `\n mutation DeleteApplication($id: ID!) {\n deleteApplication(id: $id) { success }\n }\n`;\n\nexport const APPLICATION_VERSIONS = `\n query ApplicationVersions($applicationId: ID!) {\n applicationVersions(applicationId: $applicationId) {\n id version status isLatest isStable releaseNotes\n }\n }\n`;\n\nexport const CREATE_APPLICATION_VERSION = `\n mutation CreateApplicationVersion($applicationId: ID!, $input: CreateApplicationVersionInput!) {\n createApplicationVersion(applicationId: $applicationId, input: $input) {\n id version status publishedAt\n }\n }\n`;\n\nexport const LIST_WEBHOOKS = `\n query ListDevportalWebhooks($applicationId: ID!) {\n webhooks(applicationId: $applicationId) {\n id name url events isActive status failureCount\n }\n }\n`;\n\nexport const CREATE_WEBHOOK = `\n mutation CreateDevportalWebhook($input: CreateWebhookInput!) {\n createWebhook(input: $input) {\n id name url status\n }\n }\n`;\n\nexport const DELETE_WEBHOOK = `\n mutation DeleteDevportalWebhook($id: ID!) {\n deleteWebhook(id: $id) { success }\n }\n`;\n\nexport const APPLICATION_ANALYTICS = `\n query ApplicationAnalytics($applicationId: ID!, $period: String!, $startDate: DateTime, $endDate: DateTime) {\n applicationAnalytics(applicationId: $applicationId, period: $period, startDate: $startDate, endDate: $endDate) {\n date period activeUsers apiCalls avgResponseTime sessions\n }\n }\n`;\n\nexport const ORGANIZATION_REVENUE = `\n query OrganizationRevenue($organizationId: ID!, $period: String!) {\n organizationRevenue(organizationId: $organizationId, period: $period) {\n totalEarnings currency netEarnings\n }\n }\n`;\n\nexport const ADMIN_REVIEWS = `\n query AdminReviews($status: String) {\n adminReviews(status: $status) {\n edges { node { id applicationId reviewStatus reviewNotes } }\n totalCount\n }\n }\n`;\n\nexport const APPROVE_APPLICATION = `\n mutation ApproveApplication($id: ID!, $notes: String) {\n approveApplication(id: $id, notes: $notes) {\n id status reviewStatus publishedAt\n }\n }\n`;\n\nexport const REJECT_APPLICATION = `\n mutation RejectApplication($id: ID!, $notes: String!) {\n rejectApplication(id: $id, notes: $notes) {\n id status reviewStatus reviewNotes\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 * as ops from './operations.js';\n\ninterface OrgRow {\n id: string;\n name: string;\n slug?: string;\n status?: string;\n}\n\ninterface AppRow {\n id: string;\n name: string;\n status?: string;\n reviewStatus?: string;\n publishedAt?: string;\n installCount?: number;\n averageRating?: number;\n}\n\ninterface VersionRow {\n id: string;\n version: string;\n status?: string;\n isLatest?: boolean;\n isStable?: boolean;\n releaseNotes?: string;\n}\n\ninterface WebhookRow {\n id: string;\n name: string;\n url: string;\n events?: string[];\n isActive?: boolean;\n status?: string;\n failureCount?: number;\n}\n\nexport function registerDevportalTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n // ── Organizations ───────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'devportal_orgs_list')),\n {\n title: 'List Devportal Organizations',\n description: 'List publisher organizations.',\n inputSchema: {\n limit: z.number().optional().describe('Page size (default 50)'),\n offset: z.number().optional().describe('Skip results'),\n },\n },\n async ({ limit, offset }) => {\n try {\n const data = await ctx.gql.global.request<{\n organizations: { edges: Array<{ node: OrgRow }>; totalCount: number };\n }>(ops.LIST_ORGANIZATIONS, { limit: limit ?? 50, offset: offset ?? 0 });\n return jsonResult({\n items: data.organizations.edges.map((e) => e.node),\n totalCount: data.organizations.totalCount,\n });\n } catch (error) {\n ctx.logger.error('devportal_orgs_list failed', { error: String(error) });\n return errorResult(\n `Failed to list organizations: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'devportal_orgs_get')),\n {\n title: 'Get Devportal Organization',\n description: 'Get a publisher organization by ID.',\n inputSchema: { id: z.string().describe('Organization ID') },\n },\n async ({ id }) => {\n try {\n const data = await ctx.gql.global.request<{ organization: OrgRow | null }>(\n ops.GET_ORGANIZATION,\n { id },\n );\n if (!data.organization) return errorResult(`Organization ${id} not found`);\n return jsonResult(data.organization);\n } catch (error) {\n ctx.logger.error('devportal_orgs_get failed', { error: String(error) });\n return errorResult(\n `Failed to get organization: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'devportal_orgs_create')),\n {\n title: 'Create Publisher Organization',\n description: 'Create a publisher organization.',\n inputSchema: {\n name: z.string().describe('Organization name'),\n description: z.string().optional(),\n tier: z\n .string()\n .optional()\n .describe('INDIVIDUAL|ORGANIZATION|ENTERPRISE (default ORGANIZATION)'),\n },\n },\n async ({ name, description, tier }) => {\n try {\n const input: Record<string, unknown> = {\n name,\n tier: (tier ?? 'ORGANIZATION').toUpperCase(),\n };\n if (description !== undefined) input.description = description;\n const data = await ctx.gql.global.request<{ createOrganization: OrgRow }>(\n ops.CREATE_ORGANIZATION,\n { input },\n );\n return jsonResult(data.createOrganization);\n } catch (error) {\n ctx.logger.error('devportal_orgs_create failed', { error: String(error) });\n return errorResult(\n `Failed to create organization: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'devportal_orgs_update')),\n {\n title: 'Update Publisher Organization',\n description: 'Update a publisher organization.',\n inputSchema: {\n id: z.string().describe('Organization ID'),\n name: z.string().optional(),\n description: z.string().optional(),\n },\n },\n async ({ id, name, description }) => {\n try {\n const input: Record<string, unknown> = {};\n if (name !== undefined) input.name = name;\n if (description !== undefined) input.description = description;\n if (!Object.keys(input).length) return errorResult('No updates specified');\n const data = await ctx.gql.global.request<{ updateOrganization: OrgRow }>(\n ops.UPDATE_ORGANIZATION,\n { id, input },\n );\n return jsonResult(data.updateOrganization);\n } catch (error) {\n ctx.logger.error('devportal_orgs_update failed', { error: String(error) });\n return errorResult(\n `Failed to update organization: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'devportal_orgs_delete')),\n {\n title: 'Delete Publisher Organization',\n description: 'Delete a publisher organization.',\n inputSchema: { id: z.string().describe('Organization ID') },\n },\n async ({ id }) => {\n try {\n await ctx.gql.global.request(ops.DELETE_ORGANIZATION, { id });\n return jsonResult({ status: 'success', message: 'Organization deleted', orgId: id });\n } catch (error) {\n ctx.logger.error('devportal_orgs_delete failed', { error: String(error) });\n return errorResult(\n `Failed to delete organization: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Applications ────────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'devportal_apps_list')),\n {\n title: 'List Devportal Applications',\n description: 'List devportal applications.',\n inputSchema: {\n organizationId: z.string().optional(),\n status: z.string().optional().describe('DRAFT|REVIEW|PUBLISHED|ARCHIVED'),\n limit: z.number().optional().describe('Page size (default 50)'),\n },\n },\n async ({ organizationId, status, limit }) => {\n try {\n const data = await ctx.gql.global.request<{\n applications: { edges: Array<{ node: AppRow }>; totalCount: number };\n }>(ops.LIST_APPLICATIONS, {\n organizationId,\n status: status ? status.toUpperCase() : undefined,\n limit: limit ?? 50,\n });\n return jsonResult({\n items: data.applications.edges.map((e) => e.node),\n totalCount: data.applications.totalCount,\n });\n } catch (error) {\n ctx.logger.error('devportal_apps_list failed', { error: String(error) });\n return errorResult(\n `Failed to list applications: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'devportal_apps_get')),\n {\n title: 'Get Devportal Application',\n description: 'Get a devportal application by ID.',\n inputSchema: { id: z.string().describe('Application ID') },\n },\n async ({ id }) => {\n try {\n const data = await ctx.gql.global.request<{ application: AppRow | null }>(\n ops.GET_APPLICATION,\n { id },\n );\n if (!data.application) return errorResult(`Application ${id} not found`);\n return jsonResult(data.application);\n } catch (error) {\n ctx.logger.error('devportal_apps_get failed', { error: String(error) });\n return errorResult(\n `Failed to get application: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'devportal_apps_create')),\n {\n title: 'Create Devportal Application',\n description: 'Create a devportal application.',\n inputSchema: {\n name: z.string().describe('Application name'),\n organizationId: z.string().describe('Owning organization ID'),\n appType: z\n .string()\n .optional()\n .describe('API_INTEGRATION|WEB_APP|MOBILE_APP (default API_INTEGRATION)'),\n description: z.string().optional(),\n },\n },\n async ({ name, organizationId, appType, description }) => {\n try {\n const input: Record<string, unknown> = {\n name,\n organizationId,\n appType: (appType ?? 'API_INTEGRATION').toUpperCase(),\n };\n if (description !== undefined) input.description = description;\n const data = await ctx.gql.global.request<{\n createApplication: AppRow & { appId: string };\n }>(ops.CREATE_APPLICATION, { input });\n return jsonResult(data.createApplication);\n } catch (error) {\n ctx.logger.error('devportal_apps_create failed', { error: String(error) });\n return errorResult(\n `Failed to create application: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'devportal_apps_update')),\n {\n title: 'Update Devportal Application',\n description: 'Update a devportal application.',\n inputSchema: {\n id: z.string().describe('Application ID'),\n description: z.string().optional(),\n pricingType: z.string().optional().describe('FREE|PAID_ONETIME|SUBSCRIPTION'),\n documentationUrl: z.string().optional(),\n },\n },\n async ({ id, description, pricingType, documentationUrl }) => {\n try {\n const input: Record<string, unknown> = {};\n if (description !== undefined) input.description = description;\n if (pricingType !== undefined) input.pricingType = pricingType.toUpperCase();\n if (documentationUrl !== undefined) input.documentationUrl = documentationUrl;\n if (!Object.keys(input).length) return errorResult('No updates specified');\n const data = await ctx.gql.global.request<{ updateApplication: AppRow }>(\n ops.UPDATE_APPLICATION,\n { id, input },\n );\n return jsonResult(data.updateApplication);\n } catch (error) {\n ctx.logger.error('devportal_apps_update failed', { error: String(error) });\n return errorResult(\n `Failed to update application: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'devportal_apps_submit_review')),\n {\n title: 'Submit Application For Review',\n description: 'Submit an application for admin review.',\n inputSchema: {\n id: z.string().describe('Application ID'),\n notes: z.string().optional().describe('Optional submission notes'),\n },\n },\n async ({ id, notes }) => {\n try {\n const data = await ctx.gql.global.request<{ submitApplicationForReview: AppRow }>(\n ops.SUBMIT_APPLICATION_FOR_REVIEW,\n { id, notes },\n );\n return jsonResult(data.submitApplicationForReview);\n } catch (error) {\n ctx.logger.error('devportal_apps_submit_review failed', { error: String(error) });\n return errorResult(\n `Failed to submit for review: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'devportal_apps_publish')),\n {\n title: 'Publish Application',\n description:\n 'Publish an approved application. Note: in the legacy CLI this opened a browser; here it just calls the publish mutation directly.',\n inputSchema: { id: z.string().describe('Application ID') },\n },\n async ({ id }) => {\n try {\n const data = await ctx.gql.global.request<{ publishApplication: AppRow }>(\n ops.PUBLISH_APPLICATION,\n { id },\n );\n return jsonResult(data.publishApplication);\n } catch (error) {\n ctx.logger.error('devportal_apps_publish failed', { error: String(error) });\n return errorResult(\n `Failed to publish application: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'devportal_apps_delete')),\n {\n title: 'Delete Devportal Application',\n description: 'Delete a devportal application.',\n inputSchema: { id: z.string().describe('Application ID') },\n },\n async ({ id }) => {\n try {\n await ctx.gql.global.request(ops.DELETE_APPLICATION, { id });\n return jsonResult({ status: 'success', message: 'Application deleted', appId: id });\n } catch (error) {\n ctx.logger.error('devportal_apps_delete failed', { error: String(error) });\n return errorResult(\n `Failed to delete application: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Versions ────────────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'devportal_apps_versions_list')),\n {\n title: 'List Application Versions',\n description: 'List versions for an application.',\n inputSchema: { applicationId: z.string().describe('Application ID') },\n },\n async ({ applicationId }) => {\n try {\n const data = await ctx.gql.global.request<{ applicationVersions: VersionRow[] }>(\n ops.APPLICATION_VERSIONS,\n { applicationId },\n );\n return jsonResult(data.applicationVersions);\n } catch (error) {\n ctx.logger.error('devportal_apps_versions_list failed', { error: String(error) });\n return errorResult(\n `Failed to list versions: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'devportal_apps_versions_create')),\n {\n title: 'Create Application Version',\n description: 'Create a new version for an application.',\n inputSchema: {\n applicationId: z.string().describe('Application ID'),\n version: z.string().describe('Version string (e.g. \"1.2.0\")'),\n releaseNotes: z.string().optional(),\n packageUrl: z.string().optional(),\n },\n },\n async ({ applicationId, version, releaseNotes, packageUrl }) => {\n try {\n const input: Record<string, unknown> = { version };\n if (releaseNotes !== undefined) input.releaseNotes = releaseNotes;\n if (packageUrl !== undefined) input.packageUrl = packageUrl;\n const data = await ctx.gql.global.request<{ createApplicationVersion: VersionRow }>(\n ops.CREATE_APPLICATION_VERSION,\n { applicationId, input },\n );\n return jsonResult(data.createApplicationVersion);\n } catch (error) {\n ctx.logger.error('devportal_apps_versions_create failed', { error: String(error) });\n return errorResult(\n `Failed to create version: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Webhooks ────────────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'devportal_apps_webhooks_list')),\n {\n title: 'List Application Webhooks',\n description: 'List webhooks attached to an application.',\n inputSchema: { applicationId: z.string().describe('Application ID') },\n },\n async ({ applicationId }) => {\n try {\n const data = await ctx.gql.global.request<{ webhooks: WebhookRow[] }>(ops.LIST_WEBHOOKS, {\n applicationId,\n });\n return jsonResult(data.webhooks);\n } catch (error) {\n ctx.logger.error('devportal_apps_webhooks_list failed', { error: String(error) });\n return errorResult(\n `Failed to list webhooks: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'devportal_apps_webhooks_add')),\n {\n title: 'Add Application Webhook',\n description: 'Add a webhook to an application.',\n inputSchema: {\n applicationId: z.string().describe('Application ID'),\n name: z.string().describe('Webhook name'),\n url: z.string().describe('Delivery URL'),\n events: z.array(z.string()).describe('Event names'),\n maxRetries: z.number().optional().describe('Default 5'),\n },\n },\n async ({ applicationId, name, url, events, maxRetries }) => {\n try {\n const input: Record<string, unknown> = {\n applicationId,\n name,\n url,\n events,\n retryEnabled: true,\n maxRetries: maxRetries ?? 5,\n };\n const data = await ctx.gql.global.request<{ createWebhook: WebhookRow }>(\n ops.CREATE_WEBHOOK,\n { input },\n );\n return jsonResult(data.createWebhook);\n } catch (error) {\n ctx.logger.error('devportal_apps_webhooks_add failed', { error: String(error) });\n return errorResult(\n `Failed to create webhook: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'devportal_apps_webhooks_remove')),\n {\n title: 'Remove Application Webhook',\n description: 'Remove a webhook by ID.',\n inputSchema: { id: z.string().describe('Webhook ID') },\n },\n async ({ id }) => {\n try {\n await ctx.gql.global.request(ops.DELETE_WEBHOOK, { id });\n return jsonResult({ status: 'success', message: 'Webhook removed', webhookId: id });\n } catch (error) {\n ctx.logger.error('devportal_apps_webhooks_remove failed', { error: String(error) });\n return errorResult(\n `Failed to remove webhook: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Analytics ───────────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'devportal_apps_analytics')),\n {\n title: 'Application Analytics',\n description: 'Get analytics for an application over a period.',\n inputSchema: {\n applicationId: z.string().describe('Application ID'),\n period: z\n .string()\n .optional()\n .describe('LAST_7_DAYS|LAST_30_DAYS|CUSTOM (default LAST_30_DAYS)'),\n startDate: z.string().optional().describe('ISO 8601 (required when period=CUSTOM)'),\n endDate: z.string().optional().describe('ISO 8601'),\n },\n },\n async ({ applicationId, period, startDate, endDate }) => {\n try {\n const data = await ctx.gql.global.request<{\n applicationAnalytics: Array<Record<string, unknown>>;\n }>(ops.APPLICATION_ANALYTICS, {\n applicationId,\n period: (period ?? 'LAST_30_DAYS').toUpperCase(),\n startDate,\n endDate,\n });\n return jsonResult(data.applicationAnalytics);\n } catch (error) {\n ctx.logger.error('devportal_apps_analytics failed', { error: String(error) });\n return errorResult(\n `Failed to fetch analytics: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Revenue ─────────────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'devportal_revenue')),\n {\n title: 'Organization Revenue',\n description: 'Get revenue summary for an organization.',\n inputSchema: {\n organizationId: z.string().describe('Organization ID'),\n period: z\n .string()\n .optional()\n .describe('LAST_7_DAYS|LAST_30_DAYS|YTD (default LAST_30_DAYS)'),\n },\n },\n async ({ organizationId, period }) => {\n try {\n const data = await ctx.gql.global.request<{\n organizationRevenue: Record<string, unknown>;\n }>(ops.ORGANIZATION_REVENUE, {\n organizationId,\n period: (period ?? 'LAST_30_DAYS').toUpperCase(),\n });\n return jsonResult(data.organizationRevenue);\n } catch (error) {\n ctx.logger.error('devportal_revenue failed', { error: String(error) });\n return errorResult(\n `Failed to fetch revenue: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Admin reviews ───────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'devportal_admin_reviews_list')),\n {\n title: 'List Admin Application Reviews',\n description: 'List applications in the admin review queue.',\n inputSchema: {\n status: z.string().optional().describe('PENDING|APPROVED|REJECTED (default PENDING)'),\n },\n },\n async ({ status }) => {\n try {\n const data = await ctx.gql.global.request<{\n adminReviews: { edges: Array<{ node: Record<string, unknown> }>; totalCount: number };\n }>(ops.ADMIN_REVIEWS, { status: (status ?? 'PENDING').toUpperCase() });\n return jsonResult({\n items: data.adminReviews.edges.map((e) => e.node),\n totalCount: data.adminReviews.totalCount,\n });\n } catch (error) {\n ctx.logger.error('devportal_admin_reviews_list failed', { error: String(error) });\n return errorResult(\n `Failed to list reviews: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'devportal_admin_reviews_approve')),\n {\n title: 'Approve Application',\n description: 'Approve a pending application.',\n inputSchema: {\n id: z.string().describe('Application ID'),\n notes: z.string().optional(),\n },\n },\n async ({ id, notes }) => {\n try {\n const data = await ctx.gql.global.request<{ approveApplication: AppRow }>(\n ops.APPROVE_APPLICATION,\n { id, notes },\n );\n return jsonResult(data.approveApplication);\n } catch (error) {\n ctx.logger.error('devportal_admin_reviews_approve failed', { error: String(error) });\n return errorResult(\n `Failed to approve application: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'devportal_admin_reviews_reject')),\n {\n title: 'Reject Application',\n description: 'Reject a pending application.',\n inputSchema: {\n id: z.string().describe('Application ID'),\n notes: z.string().describe('Reason for rejection (required)'),\n },\n },\n async ({ id, notes }) => {\n try {\n const data = await ctx.gql.global.request<{ rejectApplication: AppRow }>(\n ops.REJECT_APPLICATION,\n { id, notes },\n );\n return jsonResult(data.rejectApplication);\n } catch (error) {\n ctx.logger.error('devportal_admin_reviews_reject failed', { error: String(error) });\n return errorResult(\n `Failed to reject application: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n}\n","/**\n * Devportal module — publisher orgs, applications, versions, webhooks, analytics, revenue, admin reviews.\n *\n * Backend: global-devportal-svc.\n * Ported from cli-sdk/src/modules/devportal/. Browser-only flows (open-in-browser\n * publish handoffs) are not exposed; the publish tool calls the publish mutation directly.\n */\n\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport type { McpContext, McpModule, ModuleRegistration } from '../../core/index.js';\nimport { registerDevportalTools } from './tools.js';\n\nconst devportalModule: McpModule = {\n id: 'devportal',\n version: '0.0.1',\n displayName: 'Developer Portal',\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 registerDevportalTools(server, ctx, track);\n\n return { tools, resources: [], prompts: [] };\n },\n};\n\nexport default devportalModule;\n"]}
@@ -0,0 +1,333 @@
1
+ 'use strict';
2
+
3
+ var promises = require('fs/promises');
4
+ var zod = require('zod');
5
+ require('graphql-request');
6
+ require('cross-fetch');
7
+ require('@modelcontextprotocol/sdk/server/mcp.js');
8
+ require('@modelcontextprotocol/sdk/types.js');
9
+
10
+ // src/modules/export/tools.ts
11
+
12
+ // src/core/errors.ts
13
+ var McpInternalError = class extends Error {
14
+ cause;
15
+ constructor(message, cause) {
16
+ super(message);
17
+ this.name = "McpInternalError";
18
+ this.cause = cause;
19
+ }
20
+ };
21
+
22
+ // src/core/result.ts
23
+ function jsonResult(data, structured) {
24
+ const result = {
25
+ content: [{ type: "text", text: JSON.stringify(data, null, 2) }]
26
+ };
27
+ return result;
28
+ }
29
+ function errorResult(message, hint) {
30
+ const text = hint ? `${message}
31
+
32
+ Hint: ${hint}` : message;
33
+ return { content: [{ type: "text", text }], isError: true };
34
+ }
35
+
36
+ // src/core/tool-name.ts
37
+ var MAX_TOOL_NAME_LENGTH = 63;
38
+ function assertSafeName(name, kind) {
39
+ if (name.length > MAX_TOOL_NAME_LENGTH) {
40
+ throw new McpInternalError(
41
+ `Tool name '${name}' exceeds ${MAX_TOOL_NAME_LENGTH} characters (some MCP clients truncate at 64).`
42
+ );
43
+ }
44
+ return name;
45
+ }
46
+ function mcpToolName(productName, ...parts) {
47
+ if (!productName) {
48
+ throw new McpInternalError("mcpToolName: productName is required");
49
+ }
50
+ const name = [productName, ...parts].filter(Boolean).join("_");
51
+ return assertSafeName(name);
52
+ }
53
+
54
+ // src/modules/export/operations.ts
55
+ var LIST_EXPORT_JOBS = `
56
+ query ListExportJobs($context: ContextInput!, $filter: ExportJobFilterInput, $pagination: ExportPaginationInput) {
57
+ listExportJobs(context: $context, filter: $filter, pagination: $pagination) {
58
+ edges { node {
59
+ id name status progress totalEntities processedEntities
60
+ startedAt completedAt downloadUrl downloadExpiresAt
61
+ } }
62
+ pageInfo { totalCount hasNextPage }
63
+ }
64
+ }
65
+ `;
66
+ var GET_EXPORT_JOB = `
67
+ query GetExportJob($context: ContextInput, $id: ID!) {
68
+ getExportJob(context: $context, id: $id) {
69
+ id name status progress
70
+ downloadUrl downloadExpiresAt totalSizeBytes
71
+ }
72
+ }
73
+ `;
74
+ var CREATE_EXPORT_JOB = `
75
+ mutation CreateExportJob($context: ContextInput!, $input: CreateExportJobInput!) {
76
+ createExportJob(context: $context, input: $input) {
77
+ id status progress entityTypes
78
+ }
79
+ }
80
+ `;
81
+ var LIST_EXPORT_TEMPLATES = `
82
+ query ListExportTemplates($context: ContextInput!, $pagination: ExportPaginationInput) {
83
+ listExportTemplates(context: $context, pagination: $pagination) {
84
+ edges { node { id name entityTypes format includeMedia includeMetadata } }
85
+ pageInfo { totalCount }
86
+ }
87
+ }
88
+ `;
89
+ var GET_EXPORT_TEMPLATE = `
90
+ query GetExportTemplate($context: ContextInput, $id: ID!) {
91
+ getExportTemplate(context: $context, id: $id) {
92
+ id name entityTypes format
93
+ }
94
+ }
95
+ `;
96
+
97
+ // src/modules/export/tools.ts
98
+ function readWorkspaceContext(ctx) {
99
+ const auth = ctx.auth.read();
100
+ if (!auth?.workspaceId) return null;
101
+ return { workspaceId: auth.workspaceId };
102
+ }
103
+ var ExportFormatEnum = zod.z.enum(["JSON", "CSV", "ZIP"]);
104
+ function registerExportTools(server, ctx, track) {
105
+ server.registerTool(
106
+ track(mcpToolName(ctx.productName, "export_jobs_list")),
107
+ {
108
+ title: "List Export Jobs",
109
+ description: "List export jobs in the active workspace.",
110
+ inputSchema: {
111
+ status: zod.z.string().optional().describe("Filter by status (will be uppercased)"),
112
+ limit: zod.z.number().optional().describe("Page size (default 50)")
113
+ }
114
+ },
115
+ async ({ status, limit }) => {
116
+ try {
117
+ const context = readWorkspaceContext(ctx);
118
+ if (!context) {
119
+ return errorResult("No workspace set. Run the auth workspace_set tool first.");
120
+ }
121
+ const filter = {};
122
+ if (status !== void 0) filter.status = status.toUpperCase();
123
+ const data = await ctx.gql.workspace.request(LIST_EXPORT_JOBS, {
124
+ context,
125
+ filter: Object.keys(filter).length > 0 ? filter : void 0,
126
+ pagination: { first: limit ?? 50 }
127
+ });
128
+ return jsonResult({
129
+ items: data.listExportJobs.edges.map((e) => e.node),
130
+ pageInfo: data.listExportJobs.pageInfo
131
+ });
132
+ } catch (error) {
133
+ ctx.logger.error("export_jobs_list failed", { error: String(error) });
134
+ return errorResult(
135
+ `Failed to list export jobs: ${error instanceof Error ? error.message : String(error)}`
136
+ );
137
+ }
138
+ }
139
+ );
140
+ server.registerTool(
141
+ track(mcpToolName(ctx.productName, "export_jobs_get")),
142
+ {
143
+ title: "Get Export Job",
144
+ description: "Get an export job by ID.",
145
+ inputSchema: { id: zod.z.string().describe("Export job ID") }
146
+ },
147
+ async ({ id }) => {
148
+ try {
149
+ const context = readWorkspaceContext(ctx);
150
+ if (!context) {
151
+ return errorResult("No workspace set. Run the auth workspace_set tool first.");
152
+ }
153
+ const data = await ctx.gql.workspace.request(
154
+ GET_EXPORT_JOB,
155
+ { context, id }
156
+ );
157
+ if (!data.getExportJob) return errorResult(`Export job ${id} not found`);
158
+ return jsonResult(data.getExportJob);
159
+ } catch (error) {
160
+ ctx.logger.error("export_jobs_get failed", { error: String(error) });
161
+ return errorResult(
162
+ `Failed to get export job: ${error instanceof Error ? error.message : String(error)}`
163
+ );
164
+ }
165
+ }
166
+ );
167
+ server.registerTool(
168
+ track(mcpToolName(ctx.productName, "export_jobs_create")),
169
+ {
170
+ title: "Create Export Job",
171
+ description: "Create an export job for one or more entity types.",
172
+ inputSchema: {
173
+ name: zod.z.string().describe("Job name"),
174
+ entityTypes: zod.z.array(zod.z.string()).describe("Entity types to export"),
175
+ format: ExportFormatEnum.optional().describe("Output format (default JSON)"),
176
+ includeMedia: zod.z.boolean().optional().describe("Include media files (default false)"),
177
+ includeMetadata: zod.z.boolean().optional().describe("Include metadata (default true)"),
178
+ from: zod.z.string().optional().describe("Date range start (ISO)"),
179
+ to: zod.z.string().optional().describe("Date range end (ISO)")
180
+ }
181
+ },
182
+ async ({ name, entityTypes, format, includeMedia, includeMetadata, from, to }) => {
183
+ try {
184
+ const context = readWorkspaceContext(ctx);
185
+ if (!context) {
186
+ return errorResult("No workspace set. Run the auth workspace_set tool first.");
187
+ }
188
+ const input = {
189
+ name,
190
+ entityTypes,
191
+ format: format ?? "JSON",
192
+ includeMedia: includeMedia === true,
193
+ includeMetadata: includeMetadata !== false
194
+ };
195
+ if (from !== void 0) input.dateRangeStart = from;
196
+ if (to !== void 0) input.dateRangeEnd = to;
197
+ const data = await ctx.gql.workspace.request(
198
+ CREATE_EXPORT_JOB,
199
+ { context, input }
200
+ );
201
+ return jsonResult(data.createExportJob);
202
+ } catch (error) {
203
+ ctx.logger.error("export_jobs_create failed", { error: String(error) });
204
+ return errorResult(
205
+ `Failed to create export job: ${error instanceof Error ? error.message : String(error)}`
206
+ );
207
+ }
208
+ }
209
+ );
210
+ server.registerTool(
211
+ track(mcpToolName(ctx.productName, "export_download")),
212
+ {
213
+ title: "Download Export Job",
214
+ description: "Download a completed export job to a local file path.",
215
+ inputSchema: {
216
+ jobId: zod.z.string().describe("Export job ID"),
217
+ to: zod.z.string().describe("Local file path to write")
218
+ }
219
+ },
220
+ async ({ jobId, to }) => {
221
+ try {
222
+ const context = readWorkspaceContext(ctx);
223
+ if (!context) {
224
+ return errorResult("No workspace set. Run the auth workspace_set tool first.");
225
+ }
226
+ const data = await ctx.gql.workspace.request(
227
+ GET_EXPORT_JOB,
228
+ { context, id: jobId }
229
+ );
230
+ if (!data.getExportJob) return errorResult(`Export job ${jobId} not found`);
231
+ const url = data.getExportJob.downloadUrl;
232
+ if (!url) {
233
+ return errorResult(
234
+ `Job ${jobId} has no downloadUrl yet (status=${data.getExportJob.status ?? "UNKNOWN"}).`
235
+ );
236
+ }
237
+ const res = await fetch(url);
238
+ if (!res.ok) {
239
+ return errorResult(`Download failed: ${res.status} ${res.statusText}`);
240
+ }
241
+ const buf = Buffer.from(await res.arrayBuffer());
242
+ await promises.writeFile(to, buf);
243
+ return jsonResult({ status: "success", path: to, bytes: buf.length });
244
+ } catch (error) {
245
+ ctx.logger.error("export_download failed", { error: String(error) });
246
+ return errorResult(
247
+ `Failed to download export: ${error instanceof Error ? error.message : String(error)}`
248
+ );
249
+ }
250
+ }
251
+ );
252
+ server.registerTool(
253
+ track(mcpToolName(ctx.productName, "export_templates_list")),
254
+ {
255
+ title: "List Export Templates",
256
+ description: "List export templates in the active workspace.",
257
+ inputSchema: {
258
+ limit: zod.z.number().optional().describe("Page size (default 50)")
259
+ }
260
+ },
261
+ async ({ limit }) => {
262
+ try {
263
+ const context = readWorkspaceContext(ctx);
264
+ if (!context) {
265
+ return errorResult("No workspace set. Run the auth workspace_set tool first.");
266
+ }
267
+ const data = await ctx.gql.workspace.request(LIST_EXPORT_TEMPLATES, {
268
+ context,
269
+ pagination: { first: limit ?? 50 }
270
+ });
271
+ return jsonResult({
272
+ items: data.listExportTemplates.edges.map((e) => e.node),
273
+ pageInfo: data.listExportTemplates.pageInfo
274
+ });
275
+ } catch (error) {
276
+ ctx.logger.error("export_templates_list failed", { error: String(error) });
277
+ return errorResult(
278
+ `Failed to list export templates: ${error instanceof Error ? error.message : String(error)}`
279
+ );
280
+ }
281
+ }
282
+ );
283
+ server.registerTool(
284
+ track(mcpToolName(ctx.productName, "export_templates_get")),
285
+ {
286
+ title: "Get Export Template",
287
+ description: "Get an export template by ID.",
288
+ inputSchema: { id: zod.z.string().describe("Template ID") }
289
+ },
290
+ async ({ id }) => {
291
+ try {
292
+ const context = readWorkspaceContext(ctx);
293
+ if (!context) {
294
+ return errorResult("No workspace set. Run the auth workspace_set tool first.");
295
+ }
296
+ const data = await ctx.gql.workspace.request(
297
+ GET_EXPORT_TEMPLATE,
298
+ { context, id }
299
+ );
300
+ if (!data.getExportTemplate) return errorResult(`Template ${id} not found`);
301
+ return jsonResult(data.getExportTemplate);
302
+ } catch (error) {
303
+ ctx.logger.error("export_templates_get failed", { error: String(error) });
304
+ return errorResult(
305
+ `Failed to get export template: ${error instanceof Error ? error.message : String(error)}`
306
+ );
307
+ }
308
+ }
309
+ );
310
+ }
311
+
312
+ // src/modules/export/index.ts
313
+ var exportModule = {
314
+ id: "export",
315
+ version: "0.0.1",
316
+ displayName: "Export",
317
+ dependsOn: ["auth"],
318
+ capabilities: { tools: {} },
319
+ register(server, ctx) {
320
+ const tools = [];
321
+ const track = (n) => {
322
+ tools.push(n);
323
+ return n;
324
+ };
325
+ registerExportTools(server, ctx, track);
326
+ return { tools, resources: [], prompts: [] };
327
+ }
328
+ };
329
+ var export_default = exportModule;
330
+
331
+ module.exports = export_default;
332
+ //# sourceMappingURL=index.cjs.map
333
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/core/errors.ts","../../../src/core/result.ts","../../../src/core/tool-name.ts","../../../src/modules/export/operations.ts","../../../src/modules/export/tools.ts","../../../src/modules/export/index.ts"],"names":["z","writeFile"],"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,SAAiB,IAAA,EAA2B;AACtE,EAAA,MAAM,IAAA,GAAO,IAAA,GAAO,CAAA,EAAG,OAAO;;AAAA,MAAA,EAAa,IAAI,CAAA,CAAA,GAAK,OAAA;AACpD,EAAA,OAAO,EAAE,OAAA,EAAS,CAAC,EAAE,IAAA,EAAM,QAAQ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AO,KAAK,CAAC,CAAA;AAAA,SAC1F;AAAA,MACF;AAAA,IACF;AAAA,GACF;AACF;;;ACjQA,IAAM,YAAA,GAA0B;AAAA,EAC9B,EAAA,EAAI,QAAA;AAAA,EACJ,OAAA,EAAS,OAAA;AAAA,EACT,WAAA,EAAa,QAAA;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,mBAAA,CAAoB,MAAA,EAAQ,KAAK,KAAK,CAAA;AAEtC,IAAA,OAAO,EAAE,KAAA,EAAO,SAAA,EAAW,EAAC,EAAG,OAAA,EAAS,EAAC,EAAE;AAAA,EAC7C;AACF,CAAA;AAEA,IAAO,cAAA,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_EXPORT_JOBS = `\n query ListExportJobs($context: ContextInput!, $filter: ExportJobFilterInput, $pagination: ExportPaginationInput) {\n listExportJobs(context: $context, filter: $filter, pagination: $pagination) {\n edges { node {\n id name status progress totalEntities processedEntities\n startedAt completedAt downloadUrl downloadExpiresAt\n } }\n pageInfo { totalCount hasNextPage }\n }\n }\n`;\n\nexport const GET_EXPORT_JOB = `\n query GetExportJob($context: ContextInput, $id: ID!) {\n getExportJob(context: $context, id: $id) {\n id name status progress\n downloadUrl downloadExpiresAt totalSizeBytes\n }\n }\n`;\n\nexport const CREATE_EXPORT_JOB = `\n mutation CreateExportJob($context: ContextInput!, $input: CreateExportJobInput!) {\n createExportJob(context: $context, input: $input) {\n id status progress entityTypes\n }\n }\n`;\n\nexport const LIST_EXPORT_TEMPLATES = `\n query ListExportTemplates($context: ContextInput!, $pagination: ExportPaginationInput) {\n listExportTemplates(context: $context, pagination: $pagination) {\n edges { node { id name entityTypes format includeMedia includeMetadata } }\n pageInfo { totalCount }\n }\n }\n`;\n\nexport const GET_EXPORT_TEMPLATE = `\n query GetExportTemplate($context: ContextInput, $id: ID!) {\n getExportTemplate(context: $context, id: $id) {\n id name entityTypes format\n }\n }\n`;\n","/**\n * Export MCP tools — export jobs lifecycle, templates, download.\n * Surface mirrors cli-sdk/src/modules/export/commands.ts.\n */\n\nimport { writeFile } from 'fs/promises';\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 JobNode {\n id: string;\n name?: string;\n status?: string;\n progress?: number;\n totalEntities?: number;\n processedEntities?: number;\n startedAt?: string;\n completedAt?: string;\n downloadUrl?: string;\n downloadExpiresAt?: string;\n}\n\ninterface TemplateNode {\n id: string;\n name?: string;\n entityTypes?: string[];\n format?: string;\n}\n\nfunction readWorkspaceContext(ctx: McpContext): { workspaceId: string } | null {\n const auth = ctx.auth.read();\n if (!auth?.workspaceId) return null;\n return { workspaceId: auth.workspaceId };\n}\n\nconst ExportFormatEnum = z.enum(['JSON', 'CSV', 'ZIP']);\n\nexport function registerExportTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n // ── Jobs ────────────────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'export_jobs_list')),\n {\n title: 'List Export Jobs',\n description: 'List export jobs in the active workspace.',\n inputSchema: {\n status: z.string().optional().describe('Filter by status (will be uppercased)'),\n limit: z.number().optional().describe('Page size (default 50)'),\n },\n },\n async ({ status, limit }) => {\n try {\n const context = readWorkspaceContext(ctx);\n if (!context) {\n return errorResult('No workspace set. Run the auth workspace_set tool first.');\n }\n const filter: Record<string, unknown> = {};\n if (status !== undefined) filter.status = status.toUpperCase();\n const data = await ctx.gql.workspace.request<{\n listExportJobs: {\n edges: Array<{ node: JobNode }>;\n pageInfo: { totalCount: number; hasNextPage: boolean };\n };\n }>(ops.LIST_EXPORT_JOBS, {\n context,\n filter: Object.keys(filter).length > 0 ? filter : undefined,\n pagination: { first: limit ?? 50 },\n });\n return jsonResult({\n items: data.listExportJobs.edges.map((e) => e.node),\n pageInfo: data.listExportJobs.pageInfo,\n });\n } catch (error) {\n ctx.logger.error('export_jobs_list failed', { error: String(error) });\n return errorResult(\n `Failed to list export jobs: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'export_jobs_get')),\n {\n title: 'Get Export Job',\n description: 'Get an export job by ID.',\n inputSchema: { id: z.string().describe('Export job ID') },\n },\n async ({ id }) => {\n try {\n const context = readWorkspaceContext(ctx);\n if (!context) {\n return errorResult('No workspace set. Run the auth workspace_set tool first.');\n }\n const data = await ctx.gql.workspace.request<{ getExportJob: JobNode | null }>(\n ops.GET_EXPORT_JOB,\n { context, id },\n );\n if (!data.getExportJob) return errorResult(`Export job ${id} not found`);\n return jsonResult(data.getExportJob);\n } catch (error) {\n ctx.logger.error('export_jobs_get failed', { error: String(error) });\n return errorResult(\n `Failed to get export job: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'export_jobs_create')),\n {\n title: 'Create Export Job',\n description: 'Create an export job for one or more entity types.',\n inputSchema: {\n name: z.string().describe('Job name'),\n entityTypes: z.array(z.string()).describe('Entity types to export'),\n format: ExportFormatEnum.optional().describe('Output format (default JSON)'),\n includeMedia: z.boolean().optional().describe('Include media files (default false)'),\n includeMetadata: z.boolean().optional().describe('Include metadata (default true)'),\n from: z.string().optional().describe('Date range start (ISO)'),\n to: z.string().optional().describe('Date range end (ISO)'),\n },\n },\n async ({ name, entityTypes, format, includeMedia, includeMetadata, from, to }) => {\n try {\n const context = readWorkspaceContext(ctx);\n if (!context) {\n return errorResult('No workspace set. Run the auth workspace_set tool first.');\n }\n const input: Record<string, unknown> = {\n name,\n entityTypes,\n format: format ?? 'JSON',\n includeMedia: includeMedia === true,\n includeMetadata: includeMetadata !== false,\n };\n if (from !== undefined) input.dateRangeStart = from;\n if (to !== undefined) input.dateRangeEnd = to;\n const data = await ctx.gql.workspace.request<{ createExportJob: JobNode }>(\n ops.CREATE_EXPORT_JOB,\n { context, input },\n );\n return jsonResult(data.createExportJob);\n } catch (error) {\n ctx.logger.error('export_jobs_create failed', { error: String(error) });\n return errorResult(\n `Failed to create export job: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'export_download')),\n {\n title: 'Download Export Job',\n description: 'Download a completed export job to a local file path.',\n inputSchema: {\n jobId: z.string().describe('Export job ID'),\n to: z.string().describe('Local file path to write'),\n },\n },\n async ({ jobId, to }) => {\n try {\n const context = readWorkspaceContext(ctx);\n if (!context) {\n return errorResult('No workspace set. Run the auth workspace_set tool first.');\n }\n const data = await ctx.gql.workspace.request<{ getExportJob: JobNode | null }>(\n ops.GET_EXPORT_JOB,\n { context, id: jobId },\n );\n if (!data.getExportJob) return errorResult(`Export job ${jobId} not found`);\n const url = data.getExportJob.downloadUrl;\n if (!url) {\n return errorResult(\n `Job ${jobId} has no downloadUrl yet (status=${data.getExportJob.status ?? 'UNKNOWN'}).`,\n );\n }\n const res = await fetch(url);\n if (!res.ok) {\n return errorResult(`Download failed: ${res.status} ${res.statusText}`);\n }\n const buf = Buffer.from(await res.arrayBuffer());\n await writeFile(to, buf);\n return jsonResult({ status: 'success', path: to, bytes: buf.length });\n } catch (error) {\n ctx.logger.error('export_download failed', { error: String(error) });\n return errorResult(\n `Failed to download export: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Templates ───────────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'export_templates_list')),\n {\n title: 'List Export Templates',\n description: 'List export templates in the active workspace.',\n inputSchema: {\n limit: z.number().optional().describe('Page size (default 50)'),\n },\n },\n async ({ limit }) => {\n try {\n const context = readWorkspaceContext(ctx);\n if (!context) {\n return errorResult('No workspace set. Run the auth workspace_set tool first.');\n }\n const data = await ctx.gql.workspace.request<{\n listExportTemplates: {\n edges: Array<{ node: TemplateNode }>;\n pageInfo: { totalCount: number };\n };\n }>(ops.LIST_EXPORT_TEMPLATES, {\n context,\n pagination: { first: limit ?? 50 },\n });\n return jsonResult({\n items: data.listExportTemplates.edges.map((e) => e.node),\n pageInfo: data.listExportTemplates.pageInfo,\n });\n } catch (error) {\n ctx.logger.error('export_templates_list failed', { error: String(error) });\n return errorResult(\n `Failed to list export templates: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'export_templates_get')),\n {\n title: 'Get Export Template',\n description: 'Get an export template by ID.',\n inputSchema: { id: z.string().describe('Template ID') },\n },\n async ({ id }) => {\n try {\n const context = readWorkspaceContext(ctx);\n if (!context) {\n return errorResult('No workspace set. Run the auth workspace_set tool first.');\n }\n const data = await ctx.gql.workspace.request<{ getExportTemplate: TemplateNode | null }>(\n ops.GET_EXPORT_TEMPLATE,\n { context, id },\n );\n if (!data.getExportTemplate) return errorResult(`Template ${id} not found`);\n return jsonResult(data.getExportTemplate);\n } catch (error) {\n ctx.logger.error('export_templates_get failed', { error: String(error) });\n return errorResult(\n `Failed to get export template: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n}\n","/**\n * Export module — workspace data export jobs and templates.\n * Surface mirrors cli-sdk/src/modules/export/.\n */\n\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport type { McpContext, McpModule, ModuleRegistration } from '../../core/index.js';\nimport { registerExportTools } from './tools.js';\n\nconst exportModule: McpModule = {\n id: 'export',\n version: '0.0.1',\n displayName: 'Export',\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 registerExportTools(server, ctx, track);\n\n return { tools, resources: [], prompts: [] };\n },\n};\n\nexport default exportModule;\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 exportModule: McpModule;
7
+
8
+ export { exportModule 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 exportModule: McpModule;
7
+
8
+ export { exportModule as default };