@burdenoff/mcp-libs 2026.825.2 → 2026.828.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-YOSQUY3M.js → chunk-BSNL65PZ.js} +2 -2
- package/dist/{chunk-YOSQUY3M.js.map → chunk-BSNL65PZ.js.map} +1 -1
- package/dist/{chunk-RHWHUY5Y.js → chunk-QQYJVKJE.js} +3 -3
- package/dist/{chunk-RHWHUY5Y.js.map → chunk-QQYJVKJE.js.map} +1 -1
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/modules/adaptercloud/index.cjs.map +1 -1
- package/dist/modules/adaptercloud/index.js +1 -1
- package/dist/modules/artistrybase/index.cjs +8 -8
- package/dist/modules/artistrybase/index.cjs.map +1 -1
- package/dist/modules/artistrybase/index.js +9 -9
- package/dist/modules/artistrybase/index.js.map +1 -1
- package/dist/modules/assethandler/index.cjs.map +1 -1
- package/dist/modules/assethandler/index.js +1 -1
- package/dist/modules/atheletebridge/index.cjs.map +1 -1
- package/dist/modules/atheletebridge/index.js +1 -1
- package/dist/modules/auth/index.cjs.map +1 -1
- package/dist/modules/auth/index.js +3 -3
- package/dist/modules/billing/index.cjs.map +1 -1
- package/dist/modules/billing/index.js +1 -1
- package/dist/modules/brainyrich/index.cjs +13 -3
- package/dist/modules/brainyrich/index.cjs.map +1 -1
- package/dist/modules/brainyrich/index.js +14 -4
- package/dist/modules/brainyrich/index.js.map +1 -1
- package/dist/modules/buildmyiq/index.cjs.map +1 -1
- package/dist/modules/buildmyiq/index.js +1 -1
- package/dist/modules/channels/index.cjs.map +1 -1
- package/dist/modules/channels/index.js +1 -1
- package/dist/modules/collabkin/index.cjs.map +1 -1
- package/dist/modules/collabkin/index.js +1 -1
- package/dist/modules/comradecircle/index.cjs.map +1 -1
- package/dist/modules/comradecircle/index.js +1 -1
- package/dist/modules/conversations/index.cjs.map +1 -1
- package/dist/modules/conversations/index.js +1 -1
- package/dist/modules/coolandlovely/index.cjs.map +1 -1
- package/dist/modules/coolandlovely/index.js +1 -1
- package/dist/modules/cosmicintersection/index.cjs.map +1 -1
- package/dist/modules/cosmicintersection/index.js +1 -1
- package/dist/modules/crewfoundry/index.cjs.map +1 -1
- package/dist/modules/crewfoundry/index.js +1 -1
- package/dist/modules/devportal/index.cjs.map +1 -1
- package/dist/modules/devportal/index.js +1 -1
- package/dist/modules/ecoimpacthub/index.cjs +12 -6
- package/dist/modules/ecoimpacthub/index.cjs.map +1 -1
- package/dist/modules/ecoimpacthub/index.js +13 -7
- package/dist/modules/ecoimpacthub/index.js.map +1 -1
- package/dist/modules/eventfullymanaged/index.cjs.map +1 -1
- package/dist/modules/eventfullymanaged/index.js +1 -1
- package/dist/modules/export/index.cjs.map +1 -1
- package/dist/modules/export/index.js +1 -1
- package/dist/modules/files/index.cjs.map +1 -1
- package/dist/modules/files/index.js +1 -1
- package/dist/modules/ggnomad/index.cjs.map +1 -1
- package/dist/modules/ggnomad/index.js +1 -1
- package/dist/modules/govcitizenhub/index.cjs.map +1 -1
- package/dist/modules/govcitizenhub/index.js +1 -1
- package/dist/modules/groups/index.cjs.map +1 -1
- package/dist/modules/groups/index.js +1 -1
- package/dist/modules/headshotmarketing/index.cjs.map +1 -1
- package/dist/modules/headshotmarketing/index.js +1 -1
- package/dist/modules/health/index.cjs.map +1 -1
- package/dist/modules/health/index.js +1 -1
- package/dist/modules/hookmovies/index.cjs.map +1 -1
- package/dist/modules/hookmovies/index.js +1 -1
- package/dist/modules/housingvista/index.cjs.map +1 -1
- package/dist/modules/housingvista/index.js +1 -1
- package/dist/modules/integrations/index.cjs.map +1 -1
- package/dist/modules/integrations/index.js +1 -1
- package/dist/modules/intelwatchtower/index.cjs.map +1 -1
- package/dist/modules/intelwatchtower/index.js +1 -1
- package/dist/modules/kadaikodi/index.cjs.map +1 -1
- package/dist/modules/kadaikodi/index.js +1 -1
- package/dist/modules/labsofscience/index.cjs.map +1 -1
- package/dist/modules/labsofscience/index.js +1 -1
- package/dist/modules/manufacturedops/index.cjs.map +1 -1
- package/dist/modules/manufacturedops/index.js +1 -1
- package/dist/modules/movethewheels/index.cjs.map +1 -1
- package/dist/modules/movethewheels/index.js +1 -1
- package/dist/modules/mybodyshield/index.cjs.map +1 -1
- package/dist/modules/mybodyshield/index.js +1 -1
- package/dist/modules/notifications/index.cjs.map +1 -1
- package/dist/modules/notifications/index.js +1 -1
- package/dist/modules/organizations/index.cjs.map +1 -1
- package/dist/modules/organizations/index.js +1 -1
- package/dist/modules/planmagnet/index.cjs.map +1 -1
- package/dist/modules/planmagnet/index.js +1 -1
- package/dist/modules/products/index.cjs.map +1 -1
- package/dist/modules/products/index.js +1 -1
- package/dist/modules/proserviceworld/index.cjs.map +1 -1
- package/dist/modules/proserviceworld/index.js +1 -1
- package/dist/modules/rbac/index.cjs.map +1 -1
- package/dist/modules/rbac/index.js +1 -1
- package/dist/modules/sandbox/index.cjs.map +1 -1
- package/dist/modules/sandbox/index.js +1 -1
- package/dist/modules/scheduler/index.cjs.map +1 -1
- package/dist/modules/scheduler/index.js +1 -1
- package/dist/modules/security/index.cjs.map +1 -1
- package/dist/modules/security/index.js +1 -1
- package/dist/modules/semanticfed/index.cjs.map +1 -1
- package/dist/modules/semanticfed/index.js +1 -1
- package/dist/modules/store/index.cjs.map +1 -1
- package/dist/modules/store/index.js +1 -1
- package/dist/modules/subscriberbot/index.cjs.map +1 -1
- package/dist/modules/subscriberbot/index.js +1 -1
- package/dist/modules/support/index.cjs.map +1 -1
- package/dist/modules/support/index.js +1 -1
- package/dist/modules/tags/index.cjs.map +1 -1
- package/dist/modules/tags/index.js +1 -1
- package/dist/modules/technospam/index.cjs.map +1 -1
- package/dist/modules/technospam/index.js +1 -1
- package/dist/modules/theculturepost/index.cjs +16 -4
- package/dist/modules/theculturepost/index.cjs.map +1 -1
- package/dist/modules/theculturepost/index.js +17 -5
- package/dist/modules/theculturepost/index.js.map +1 -1
- package/dist/modules/theglobalfuel/index.cjs.map +1 -1
- package/dist/modules/theglobalfuel/index.js +1 -1
- package/dist/modules/timecampus/index.cjs +18 -9
- package/dist/modules/timecampus/index.cjs.map +1 -1
- package/dist/modules/timecampus/index.js +19 -10
- package/dist/modules/timecampus/index.js.map +1 -1
- package/dist/modules/tours/index.cjs.map +1 -1
- package/dist/modules/tours/index.js +1 -1
- package/dist/modules/vibecontrols/index.cjs.map +1 -1
- package/dist/modules/vibecontrols/index.js +2 -2
- package/dist/modules/workspaces/index.cjs.map +1 -1
- package/dist/modules/workspaces/index.js +1 -1
- package/dist/{tool-name-Bvb36qmq.d.cts → tool-name-DYWaobFF.d.cts} +1 -1
- package/dist/{tool-name-BaPNMZdj.d.ts → tool-name-nso0HFYX.d.ts} +1 -1
- package/package.json +30 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/core/errors.ts","../../../src/core/tool-name.ts","../../../src/core/result.ts","../../../src/modules/billing/operations.ts","../../../src/modules/billing/tools.ts","../../../src/modules/billing/index.ts"],"names":["z"],"mappings":";;;;;;;;;;;AA8BO,IAAM,gBAAA,GAAN,cAA+B,KAAA,CAAM;AAAA,EACjB,KAAA;AAAA,EAEzB,WAAA,CAAY,SAAiB,KAAA,EAAiB;AAC5C,IAAA,KAAA,CAAM,OAAO,CAAA;AACb,IAAA,IAAA,CAAK,IAAA,GAAO,kBAAA;AACZ,IAAA,IAAA,CAAK,KAAA,GAAQ,KAAA;AAAA,EACf;AACF,CAAA;;;AC1BA,IAAM,oBAAA,GAAuB,EAAA;AAE7B,SAAS,cAAA,CAAe,MAAc,IAAA,EAA8C;AAClF,EAAA,IAAuB,IAAA,CAAK,MAAA,GAAS,oBAAA,EAAsB;AACzD,IAAA,MAAM,IAAI,gBAAA;AAAA,MACR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AC,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,oBAAA,CAAqB,MAAA,EAAQ,KAAK,KAAK,CAAA;AAEvC,IAAA,OAAO,EAAE,KAAA,EAAO,SAAA,EAAW,EAAC,EAAG,OAAA,EAAS,EAAC,EAAE;AAAA,EAC7C;AACF,CAAA;AAEA,IAAO,eAAA,GAAQ","file":"index.cjs","sourcesContent":["/**\n * Error classes for MCP SDK.\n *\n * Modules MUST throw these instead of throwing raw Errors. The registerTool\n * wrapper in result.ts catches and maps them to MCP-protocol-compliant\n * `{ isError: true, content: [...] }` responses.\n *\n * Throwing past the wrapper to the protocol surfaces as JSON-RPC -32603 to\n * the client and is a protocol bug.\n */\n\nexport class McpUserError extends Error {\n public readonly hint: string | undefined;\n\n constructor(message: string, opts?: { hint?: string }) {\n super(message);\n this.name = 'McpUserError';\n this.hint = opts?.hint;\n }\n}\n\nexport class McpAuthError extends McpUserError {\n constructor(message: string, opts?: { hint?: string }) {\n super(message, {\n hint: opts?.hint ?? 'Run the auth_login tool to authenticate.',\n });\n this.name = 'McpAuthError';\n }\n}\n\nexport class McpInternalError extends Error {\n public override readonly cause: unknown;\n\n constructor(message: string, cause?: unknown) {\n super(message);\n this.name = 'McpInternalError';\n this.cause = cause;\n }\n}\n","/**\n * Tool / resource / prompt naming helpers.\n *\n * Mandatory product prefix avoids collisions when Claude Desktop runs\n * multiple MCP servers concurrently (typical setup is ~6).\n *\n * Tool names are capped at 63 characters — Claude Desktop pre-1.x\n * truncated at 64 in some versions.\n */\n\nimport { McpInternalError } from './errors.js';\n\nconst MAX_TOOL_NAME_LENGTH = 63;\n\nfunction assertSafeName(name: string, kind: 'tool' | 'resource' | 'prompt'): string {\n if (kind === 'tool' && name.length > MAX_TOOL_NAME_LENGTH) {\n throw new McpInternalError(\n `Tool name '${name}' exceeds ${MAX_TOOL_NAME_LENGTH} characters (some MCP clients truncate at 64).`,\n );\n }\n return name;\n}\n\n/**\n * Build a tool name. Format: `<productName>_<...parts>` (snake_case).\n * Example: mcpToolName('vibecontrols', 'vibes', 'list') -> 'vibecontrols_vibes_list'\n */\nexport function mcpToolName(productName: string, ...parts: string[]): string {\n if (!productName) {\n throw new McpInternalError('mcpToolName: productName is required');\n }\n const name = [productName, ...parts].filter(Boolean).join('_');\n return assertSafeName(name, 'tool');\n}\n\n/**\n * Build a resource URI. Format: `<productName>://<...parts>`.\n * Example: mcpResourceUri('vibecontrols', 'schema') -> 'vibecontrols://schema'\n */\nexport function mcpResourceUri(productName: string, ...parts: string[]): string {\n if (!productName) {\n throw new McpInternalError('mcpResourceUri: productName is required');\n }\n return `${productName}://${parts.filter(Boolean).join('/')}`;\n}\n\n/**\n * Build a prompt name. Format: `<productName>-<...parts>` (kebab-case).\n * Example: mcpPromptName('vibecontrols', 'setup') -> 'vibecontrols-setup'\n */\nexport function mcpPromptName(productName: string, ...parts: string[]): string {\n if (!productName) {\n throw new McpInternalError('mcpPromptName: productName is required');\n }\n return [productName, ...parts].filter(Boolean).join('-');\n}\n\nexport const TOOL_NAME_LIMIT = MAX_TOOL_NAME_LENGTH;\n\n/**\n * Name-based hint heuristics for MCP `annotations` (readOnlyHint /\n * destructiveHint). Used by tool-governance.ts to auto-fill annotations for\n * the fleet of product modules that call `server.registerTool` directly\n * (bypassing the `registerTool()` core helper) and so never set them\n * explicitly today (BOFF-3903). Deliberately conservative — matched against\n * whole `_`-delimited segments so e.g. `timeentries_delete` and\n * `pomodoro_delete_goal` match, but a hypothetical `undeletable_check`\n * would not.\n *\n * A module can always override the inference by passing an explicit\n * `annotations` object to `registerTool()` / `server.registerTool()`.\n */\nconst DESTRUCTIVE_NAME_SEGMENT = /(?:^|_)delete(?:_|$)/i;\nconst READ_ONLY_NAME_SEGMENT = /(?:^|_)(?:list|get|search|check|read|count|stats|by_date)(?:_|$)/i;\n\n/** True when a tool name looks destructive (irreversibly deletes data) by naming convention. */\nexport function inferDestructiveHint(toolName: string): boolean {\n return DESTRUCTIVE_NAME_SEGMENT.test(toolName);\n}\n\n/**\n * True when a tool name looks read-only by naming convention. Never true for\n * a name that also looks destructive (a tool can't be both).\n */\nexport function inferReadOnlyHint(toolName: string): boolean {\n return !inferDestructiveHint(toolName) && READ_ONLY_NAME_SEGMENT.test(toolName);\n}\n","/**\n * MCP tool result helpers + central handler.\n *\n * Modules NEVER call server.registerTool directly — they use registerTool()\n * from this module so the central try/catch wraps the handler and:\n * - maps thrown McpUserError / McpAuthError / McpInternalError to\n * MCP-protocol-compliant `{ isError: true, content: [...] }` shapes\n * - threads `_meta.progressToken` into ctx.progress for long ops\n * - emits a structured log line on every error\n * - never leaks `cause` from McpInternalError to the client\n *\n * This is the analog of cli-sdk's createProgram() central error handler.\n */\n\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport type { ZodRawShape } from 'zod';\nimport type { McpContext } from './context.js';\nimport { McpAuthError, McpInternalError, McpUserError } from './errors.js';\nimport type { ToolAnnotations } from './tool-governance.js';\n\nexport interface ToolTextContent {\n type: 'text';\n text: string;\n [k: string]: unknown;\n}\n\nexport interface ToolResult {\n content: ToolTextContent[];\n isError?: boolean;\n structuredContent?: Record<string, unknown>;\n [k: string]: unknown;\n}\n\nexport interface ToolMeta {\n progressToken?: string | number;\n}\n\n/**\n * Build a successful tool result with JSON content (pretty-printed).\n */\nexport function jsonResult(data: unknown, structured?: Record<string, unknown>): ToolResult {\n const result: ToolResult = {\n content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],\n };\n if (structured !== undefined) {\n result.structuredContent = structured;\n }\n return result;\n}\n\n/**\n * Build a successful tool result with plain text content.\n */\nexport function textResult(text: string): ToolResult {\n return { content: [{ type: 'text', text }] };\n}\n\n/**\n * Build an error tool result. Honors MCP's `{ isError: true, content }` shape.\n * Optional hint is appended on a new line so the LLM can react.\n */\nexport function errorResult(message: string, hint?: string): ToolResult {\n const text = hint ? `${message}\\n\\nHint: ${hint}` : message;\n return { content: [{ type: 'text', text }], isError: true };\n}\n\nexport interface ToolMetadata {\n title: string;\n description: string;\n inputSchema?: ZodRawShape;\n /**\n * Explicit MCP annotations (readOnlyHint / destructiveHint / ...). Optional\n * — when omitted, `wrapServerWithToolGovernance` (applied centrally in\n * `createMcpServer`) infers them from the tool name. Set this to override\n * the inference for a tool whose name doesn't match the naming convention.\n */\n annotations?: ToolAnnotations;\n}\n\nexport type ToolHandler<TArgs = Record<string, unknown>> = (\n args: TArgs,\n ctx: McpContext,\n meta: ToolMeta,\n) => Promise<unknown>;\n\n/**\n * Register a tool with the central error wrapper.\n *\n * The handler returns a plain value or void. The wrapper:\n * - wraps non-undefined returns in jsonResult()\n * - if the value already looks like a ToolResult (has `content`), passes through\n * - catches McpAuthError / McpUserError / McpInternalError / generic Error\n * - logs every error via ctx.logger.error\n */\nexport function registerTool<TArgs extends Record<string, unknown>>(\n server: McpServer,\n ctx: McpContext,\n name: string,\n metadata: ToolMetadata,\n handler: ToolHandler<TArgs>,\n): void {\n const sdkConfig = {\n title: metadata.title,\n description: metadata.description,\n ...(metadata.inputSchema ? { inputSchema: metadata.inputSchema } : {}),\n ...(metadata.annotations ? { annotations: metadata.annotations } : {}),\n };\n\n // The MCP SDK's registerTool signature is `(name, config, handler)`. The\n // handler arity depends on whether inputSchema is present (1-arg without,\n // 2-arg with). We accept a unified handler shape and dispatch at runtime.\n // The SDK's typing is strict and conditional on the inputSchema generic;\n // bypass with a cast since runtime acceptance is unconditional.\n const wrapped = async (...callbackArgs: unknown[]): Promise<ToolResult> => {\n const hasArgs = callbackArgs.length === 2;\n const args = (hasArgs ? callbackArgs[0] : {}) as TArgs;\n const extra = (hasArgs ? callbackArgs[1] : callbackArgs[0]) as\n | { _meta?: { progressToken?: string | number } }\n | undefined;\n\n const progressToken = extra?._meta?.progressToken;\n const meta: ToolMeta = progressToken !== undefined ? { progressToken } : {};\n\n try {\n const result = await handler(args, ctx, meta);\n if (isToolResult(result)) return result;\n if (result === undefined) return textResult('OK');\n return jsonResult(result);\n } catch (error) {\n return mapErrorToResult(error, ctx, name);\n }\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (server as any).registerTool(name, sdkConfig, wrapped);\n}\n\nfunction isToolResult(value: unknown): value is ToolResult {\n return (\n !!value &&\n typeof value === 'object' &&\n 'content' in value &&\n Array.isArray((value as ToolResult).content)\n );\n}\n\nfunction mapErrorToResult(error: unknown, ctx: McpContext, toolName: string): ToolResult {\n if (error instanceof McpAuthError) {\n ctx.logger.warn(`${toolName}: auth required`, { message: error.message });\n return errorResult(error.message, error.hint);\n }\n if (error instanceof McpUserError) {\n ctx.logger.info(`${toolName}: user error`, { message: error.message });\n return errorResult(error.message, error.hint);\n }\n if (error instanceof McpInternalError) {\n ctx.logger.error(`${toolName}: internal error`, {\n message: error.message,\n cause: stringifyCause(error.cause),\n });\n return errorResult(`Internal error in ${toolName}.`);\n }\n const message = error instanceof Error ? error.message : String(error);\n ctx.logger.error(`${toolName}: unhandled error`, { message });\n return errorResult(`${toolName}: ${message}`);\n}\n\nfunction stringifyCause(cause: unknown): string | undefined {\n if (cause === undefined || cause === null) return undefined;\n if (cause instanceof Error) return cause.message;\n try {\n return JSON.stringify(cause);\n } catch {\n return String(cause);\n }\n}\n","export const GET_DEFAULT_BILLING_ACCOUNT = `\n query GetDefaultBillingAccount {\n getDefaultBillingAccount {\n id creditAmount currency\n }\n }\n`;\n\nexport const GET_ACTIVE_SUBSCRIPTIONS = `\n query GetActiveSubscriptions($billingAccountId: ID!) {\n getActiveSubscriptions(billingAccountId: $billingAccountId) {\n id status seatCount nextBillingDate\n plan { name price currency }\n }\n }\n`;\n\nexport const GET_SUBSCRIPTION = `\n query GetSubscription($id: ID!) {\n getSubscription(id: $id) {\n id status startDate endDate seatCount billingAccountId\n }\n }\n`;\n\nexport const UPDATE_SUBSCRIPTION_SEATS = `\n mutation UpdateSubscriptionSeats($input: UpdateSubscriptionSeatsInput!) {\n updateSubscriptionSeats(input: $input) {\n id seatCount lastSeatChangeAt\n }\n }\n`;\n\nexport const CANCEL_SUBSCRIPTION = `\n mutation CancelSubscription($input: CancelSubscriptionInput!) {\n cancelSubscription(input: $input) {\n id status canceledAt cancellationReason\n }\n }\n`;\n\nexport const GET_ALL_PLANS = `\n query GetAllPlans($filter: PlanFilterInput) {\n getAllPlans(filter: $filter) {\n id name price currency duration pricingModel\n }\n }\n`;\n\nexport const GET_PLAN = `\n query GetPlan($id: ID!) {\n getPlan(id: $id) {\n id name price pricePerSeat minSeats maxSeats isActive\n }\n }\n`;\n\nexport const GET_ALL_ADDONS = `\n query GetAllAddOns($filter: AddOnFilterInput, $limit: Int) {\n getAllAddOns(filter: $filter, limit: $limit) {\n id name price currency duration isActive\n }\n }\n`;\n\nexport const GET_PAGINATED_INVOICES = `\n query GetPaginatedInvoices($billingAccountId: ID!, $page: Int, $pageSize: Int) {\n getPaginatedInvoices(billingAccountId: $billingAccountId, page: $page, pageSize: $pageSize) {\n invoices { id invoiceNumber status total currency paidAt pdfUrl }\n totalCount hasMore\n }\n }\n`;\n\nexport const GET_INVOICE = `\n query GetInvoice($id: ID!) {\n getInvoice(id: $id) {\n id invoiceNumber status subtotal tax total\n items { description amount }\n }\n }\n`;\n\nexport const GET_PAYMENT_METHODS = `\n query GetPaymentMethods($billingAccountId: ID!) {\n getPaymentMethods(billingAccountId: $billingAccountId) {\n id type last4 expiryYear brand isDefault isVerified\n }\n }\n`;\n\nexport const ADD_PAYMENT_METHOD = `\n mutation AddPaymentMethod($input: AddPaymentMethodInput!) {\n addPaymentMethod(input: $input) {\n id type isDefault isVerified\n }\n }\n`;\n\nexport const DELETE_PAYMENT_METHOD = `\n mutation DeletePaymentMethod($id: ID!) {\n deletePaymentMethod(id: $id) { success }\n }\n`;\n\nexport const GRANT_CREDITS = `\n mutation GrantCredits($input: GrantCreditsInput!) {\n grantCredits(input: $input) {\n id amount status type\n }\n }\n`;\n\nexport const REQUEST_CREDIT_WITHDRAWAL = `\n mutation RequestCreditWithdrawal($input: RequestCreditWithdrawalInput!) {\n requestCreditWithdrawal(input: $input) {\n id status amount\n }\n }\n`;\n\nexport const GET_PENDING_REFUNDS = `\n query GetPendingRefunds($page: Int, $pageSize: Int) {\n getPendingRefunds(page: $page, pageSize: $pageSize) {\n records { id amount status source createdAt }\n totalCount\n }\n }\n`;\n\nexport const GET_QUOTAS_OF_SUB = `\n query GetQuotas($subscriptionId: ID!) {\n getAllQuotasOfSub(subscriptionId: $subscriptionId) {\n id name limits currentUsageSum reusable\n }\n }\n`;\n","/**\n * Billing module tools — subscriptions, plans, addons, invoices,\n * payment-methods, credits, refunds, quotas.\n *\n * Backend: ~/products/global/billing/global-billing-svc/.\n * Ported from cli-sdk/src/modules/billing/. The CLI's stdin/options become\n * MCP tool arguments. Browser-redirect commands (Stripe checkout) are not\n * present in the source; the closest analogue (`invoices download`) returns a\n * URL — exposed here as `billing_invoices_get_pdf_url`.\n */\n\nimport { z } from 'zod';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { jsonResult, errorResult, mcpToolName, type McpContext } from '../../core/index.js';\nimport {\n GET_DEFAULT_BILLING_ACCOUNT,\n GET_ACTIVE_SUBSCRIPTIONS,\n GET_SUBSCRIPTION,\n UPDATE_SUBSCRIPTION_SEATS,\n CANCEL_SUBSCRIPTION,\n GET_ALL_PLANS,\n GET_PLAN,\n GET_ALL_ADDONS,\n GET_PAGINATED_INVOICES,\n GET_INVOICE,\n GET_PAYMENT_METHODS,\n ADD_PAYMENT_METHOD,\n DELETE_PAYMENT_METHOD,\n GRANT_CREDITS,\n REQUEST_CREDIT_WITHDRAWAL,\n GET_PENDING_REFUNDS,\n GET_QUOTAS_OF_SUB,\n} from './operations.js';\n\ninterface SubRow {\n id: string;\n status?: string;\n seatCount?: number;\n nextBillingDate?: string;\n plan?: { name: string; price?: number; currency?: string };\n}\n\ninterface PlanRow {\n id: string;\n name: string;\n price?: number;\n currency?: string;\n duration?: string;\n pricingModel?: string;\n isActive?: boolean;\n}\n\ninterface InvoiceRow {\n id: string;\n invoiceNumber?: string;\n status?: string;\n total?: number;\n currency?: string;\n paidAt?: string;\n pdfUrl?: string;\n}\n\ninterface PaymentMethodRow {\n id: string;\n type: string;\n last4?: string;\n brand?: string;\n isDefault?: boolean;\n isVerified?: boolean;\n}\n\ninterface BillingAccountRow {\n id: string;\n creditAmount?: number;\n currency?: string;\n}\n\nasync function resolveBillingAccountId(\n ctx: McpContext,\n override: string | undefined,\n): Promise<string> {\n if (override !== undefined && override !== '') return override;\n const data = await ctx.gql.global.request<{\n getDefaultBillingAccount: BillingAccountRow | null;\n }>(GET_DEFAULT_BILLING_ACCOUNT);\n if (!data.getDefaultBillingAccount?.id) {\n throw new Error('No default billing account on file. Pass account explicitly.');\n }\n return data.getDefaultBillingAccount.id;\n}\n\nexport function registerBillingTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n // ── Subscriptions ──────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'billing_subscriptions_list')),\n {\n title: 'List Subscriptions',\n description: 'List active subscriptions on a billing account (defaults to current).',\n inputSchema: {\n account: z.string().optional().describe('Billing account ID (defaults to current)'),\n },\n },\n async ({ account }) => {\n try {\n const billingAccountId = await resolveBillingAccountId(ctx, account);\n const data = await ctx.gql.global.request<{ getActiveSubscriptions: SubRow[] }>(\n GET_ACTIVE_SUBSCRIPTIONS,\n { billingAccountId },\n );\n return jsonResult(data.getActiveSubscriptions);\n } catch (error) {\n ctx.logger.error('billing_subscriptions_list failed', { error: String(error) });\n return errorResult(\n `Failed to list subscriptions: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'billing_subscriptions_get')),\n {\n title: 'Get Subscription',\n description: 'Get a subscription by ID.',\n inputSchema: { id: z.string().describe('Subscription ID') },\n },\n async ({ id }) => {\n try {\n const data = await ctx.gql.global.request<{ getSubscription: SubRow | null }>(\n GET_SUBSCRIPTION,\n { id },\n );\n if (!data.getSubscription) return errorResult(`Subscription ${id} not found`);\n return jsonResult(data.getSubscription);\n } catch (error) {\n ctx.logger.error('billing_subscriptions_get failed', { error: String(error) });\n return errorResult(\n `Failed to get subscription: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'billing_subscriptions_upgrade')),\n {\n title: 'Update Subscription Seats',\n description: 'Change the seat count on a subscription.',\n inputSchema: {\n id: z.string().describe('Subscription ID'),\n seats: z.number().describe('Target seat count'),\n },\n },\n async ({ id, seats }) => {\n try {\n const input: Record<string, unknown> = { subscriptionId: id, seatCount: seats };\n const data = await ctx.gql.global.request<{ updateSubscriptionSeats: SubRow }>(\n UPDATE_SUBSCRIPTION_SEATS,\n { input },\n );\n return jsonResult(data.updateSubscriptionSeats);\n } catch (error) {\n ctx.logger.error('billing_subscriptions_upgrade failed', { error: String(error) });\n return errorResult(\n `Failed to update seats: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'billing_subscriptions_cancel')),\n {\n title: 'Cancel Subscription',\n description: 'Cancel a subscription with an optional reason.',\n inputSchema: {\n id: z.string().describe('Subscription ID'),\n reason: z.string().optional().describe('Cancellation reason'),\n },\n },\n async ({ id, reason }) => {\n try {\n const input: Record<string, unknown> = { subscriptionId: id };\n if (reason !== undefined) input.reason = reason;\n const data = await ctx.gql.global.request<{ cancelSubscription: SubRow }>(\n CANCEL_SUBSCRIPTION,\n { input },\n );\n return jsonResult(data.cancelSubscription);\n } catch (error) {\n ctx.logger.error('billing_subscriptions_cancel failed', { error: String(error) });\n return errorResult(\n `Failed to cancel subscription: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Plans ──────────────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'billing_plans_list')),\n {\n title: 'List Plans',\n description: 'List available plans, optionally filtered by product.',\n inputSchema: {\n product: z.string().optional().describe('Product ID filter'),\n },\n },\n async ({ product }) => {\n try {\n const filter: Record<string, unknown> = {};\n if (product !== undefined) filter.productId = product;\n const data = await ctx.gql.global.request<{ getAllPlans: PlanRow[] }>(GET_ALL_PLANS, {\n filter: Object.keys(filter).length ? filter : undefined,\n });\n return jsonResult(data.getAllPlans);\n } catch (error) {\n ctx.logger.error('billing_plans_list failed', { error: String(error) });\n return errorResult(\n `Failed to list plans: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'billing_plans_get')),\n {\n title: 'Get Plan',\n description: 'Get a plan by ID.',\n inputSchema: { id: z.string().describe('Plan ID') },\n },\n async ({ id }) => {\n try {\n const data = await ctx.gql.global.request<{ getPlan: PlanRow | null }>(GET_PLAN, { id });\n if (!data.getPlan) return errorResult(`Plan ${id} not found`);\n return jsonResult(data.getPlan);\n } catch (error) {\n ctx.logger.error('billing_plans_get failed', { error: String(error) });\n return errorResult(\n `Failed to get plan: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Addons ─────────────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'billing_addons_list')),\n {\n title: 'List Addons',\n description: 'List addons, optionally filtered by product.',\n inputSchema: {\n product: z.string().optional().describe('Product ID filter'),\n limit: z.number().optional().describe('Page size (default 50)'),\n },\n },\n async ({ product, limit }) => {\n try {\n const filter: Record<string, unknown> = {};\n if (product !== undefined) filter.productId = product;\n const data = await ctx.gql.global.request<{ getAllAddOns: PlanRow[] }>(GET_ALL_ADDONS, {\n filter: Object.keys(filter).length ? filter : undefined,\n limit,\n });\n return jsonResult(data.getAllAddOns);\n } catch (error) {\n ctx.logger.error('billing_addons_list failed', { error: String(error) });\n return errorResult(\n `Failed to list addons: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Invoices ───────────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'billing_invoices_list')),\n {\n title: 'List Invoices',\n description: 'Paginated list of invoices on a billing account.',\n inputSchema: {\n account: z.string().optional().describe('Billing account ID (defaults to current)'),\n page: z.number().optional().describe('Page number (default 1)'),\n pageSize: z.number().optional().describe('Page size (default 20)'),\n },\n },\n async ({ account, page, pageSize }) => {\n try {\n const billingAccountId = await resolveBillingAccountId(ctx, account);\n const data = await ctx.gql.global.request<{\n getPaginatedInvoices: { invoices: InvoiceRow[]; totalCount: number };\n }>(GET_PAGINATED_INVOICES, { billingAccountId, page, pageSize });\n return jsonResult(data.getPaginatedInvoices);\n } catch (error) {\n ctx.logger.error('billing_invoices_list failed', { error: String(error) });\n return errorResult(\n `Failed to list invoices: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'billing_invoices_get')),\n {\n title: 'Get Invoice',\n description: 'Get an invoice by ID.',\n inputSchema: { id: z.string().describe('Invoice ID') },\n },\n async ({ id }) => {\n try {\n const data = await ctx.gql.global.request<{ getInvoice: InvoiceRow | null }>(GET_INVOICE, {\n id,\n });\n if (!data.getInvoice) return errorResult(`Invoice ${id} not found`);\n return jsonResult(data.getInvoice);\n } catch (error) {\n ctx.logger.error('billing_invoices_get failed', { error: String(error) });\n return errorResult(\n `Failed to get invoice: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // Browser-redirect analogue: returns the PDF URL for the LLM to share.\n server.registerTool(\n track(mcpToolName(ctx.productName, 'billing_invoices_get_pdf_url')),\n {\n title: 'Get Invoice PDF URL',\n description:\n 'Return the invoice PDF download URL. The actual PDF must be opened in a browser by the user.',\n inputSchema: { id: z.string().describe('Invoice ID') },\n },\n async ({ id }) => {\n try {\n const data = await ctx.gql.global.request<{ getInvoice: InvoiceRow | null }>(GET_INVOICE, {\n id,\n });\n if (!data.getInvoice?.pdfUrl) return errorResult(`Invoice ${id} has no pdfUrl`);\n return jsonResult({ url: data.getInvoice.pdfUrl });\n } catch (error) {\n ctx.logger.error('billing_invoices_get_pdf_url failed', { error: String(error) });\n return errorResult(\n `Failed to fetch invoice URL: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Payment methods ────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'billing_payment_methods_list')),\n {\n title: 'List Payment Methods',\n description: 'List payment methods on a billing account.',\n inputSchema: {\n account: z.string().optional().describe('Billing account ID (defaults to current)'),\n },\n },\n async ({ account }) => {\n try {\n const billingAccountId = await resolveBillingAccountId(ctx, account);\n const data = await ctx.gql.global.request<{ getPaymentMethods: PaymentMethodRow[] }>(\n GET_PAYMENT_METHODS,\n { billingAccountId },\n );\n return jsonResult(data.getPaymentMethods);\n } catch (error) {\n ctx.logger.error('billing_payment_methods_list failed', { error: String(error) });\n return errorResult(\n `Failed to list payment methods: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'billing_payment_methods_add')),\n {\n title: 'Add Payment Method',\n description:\n 'Add a payment method (card metadata only — provider handles secrets). Use the provider checkout URL elsewhere for full card capture.',\n inputSchema: {\n type: z.enum(['CREDIT_CARD', 'BANK', 'UPI']).describe('Payment method type'),\n last4: z.string().describe('Last 4 digits / identifier'),\n brand: z.string().optional().describe('Brand (Visa, MasterCard, etc.)'),\n expiryMonth: z.number().optional().describe('Expiry month (1-12)'),\n expiryYear: z.number().optional().describe('Expiry year (4 digits)'),\n account: z.string().optional().describe('Billing account ID (defaults to current)'),\n isDefault: z.boolean().optional().describe('Make it the default'),\n },\n },\n async ({ type, last4, brand, expiryMonth, expiryYear, account, isDefault }) => {\n try {\n const billingAccountId = await resolveBillingAccountId(ctx, account);\n const input: Record<string, unknown> = {\n billingAccountId,\n type,\n last4,\n isDefault: isDefault === true,\n };\n if (brand !== undefined) input.brand = brand;\n if (expiryMonth !== undefined) input.expiryMonth = expiryMonth;\n if (expiryYear !== undefined) input.expiryYear = expiryYear;\n\n const data = await ctx.gql.global.request<{ addPaymentMethod: PaymentMethodRow }>(\n ADD_PAYMENT_METHOD,\n { input },\n );\n return jsonResult(data.addPaymentMethod);\n } catch (error) {\n ctx.logger.error('billing_payment_methods_add failed', { error: String(error) });\n return errorResult(\n `Failed to add payment method: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'billing_payment_methods_remove')),\n {\n title: 'Remove Payment Method',\n description: 'Delete a payment method by ID.',\n inputSchema: { id: z.string().describe('Payment method ID') },\n },\n async ({ id }) => {\n try {\n await ctx.gql.global.request<{ deletePaymentMethod: { success: boolean } }>(\n DELETE_PAYMENT_METHOD,\n { id },\n );\n return jsonResult({ status: 'success', message: 'Payment method removed', id });\n } catch (error) {\n ctx.logger.error('billing_payment_methods_remove failed', { error: String(error) });\n return errorResult(\n `Failed to remove payment method: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Credits ────────────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'billing_credits_balance')),\n {\n title: 'Credit Balance',\n description: 'Show current credit balance on the default billing account.',\n inputSchema: {},\n },\n async () => {\n try {\n const data = await ctx.gql.global.request<{\n getDefaultBillingAccount: BillingAccountRow | null;\n }>(GET_DEFAULT_BILLING_ACCOUNT);\n return jsonResult(data.getDefaultBillingAccount);\n } catch (error) {\n ctx.logger.error('billing_credits_balance failed', { error: String(error) });\n return errorResult(\n `Failed to read balance: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'billing_credits_grant')),\n {\n title: 'Grant Credits',\n description: 'Grant credits to a billing account (admin only).',\n inputSchema: {\n account: z.string().describe('Billing account ID'),\n amount: z.number().describe('Amount to grant'),\n reason: z.string().optional().describe('Reason for grant'),\n },\n },\n async ({ account, amount, reason }) => {\n try {\n const input: Record<string, unknown> = {\n billingAccountId: account,\n amount,\n reason: reason ?? 'mcp-grant',\n };\n await ctx.gql.global.request(GRANT_CREDITS, { input });\n return jsonResult({ status: 'success', message: 'Credits granted', amount, account });\n } catch (error) {\n ctx.logger.error('billing_credits_grant failed', { error: String(error) });\n return errorResult(\n `Failed to grant credits: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'billing_credits_withdraw')),\n {\n title: 'Withdraw Credits',\n description: 'Request a credit withdrawal to a payout account.',\n inputSchema: {\n account: z.string().describe('Billing account ID'),\n amount: z.number().describe('Amount to withdraw'),\n payout: z.string().describe('Payout account ID'),\n },\n },\n async ({ account, amount, payout }) => {\n try {\n const input: Record<string, unknown> = {\n billingAccountId: account,\n creditAmount: amount,\n payoutAccountId: payout,\n };\n await ctx.gql.global.request(REQUEST_CREDIT_WITHDRAWAL, { input });\n return jsonResult({ status: 'success', message: 'Withdrawal requested', amount, account });\n } catch (error) {\n ctx.logger.error('billing_credits_withdraw failed', { error: String(error) });\n return errorResult(\n `Failed to request withdrawal: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Refunds ────────────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'billing_refunds_list')),\n {\n title: 'List Pending Refunds',\n description: 'List pending refund records (paginated).',\n inputSchema: {\n page: z.number().optional().describe('Page number (default 0)'),\n pageSize: z.number().optional().describe('Page size (default 20)'),\n },\n },\n async ({ page, pageSize }) => {\n try {\n const data = await ctx.gql.global.request<{\n getPendingRefunds: { records: Array<Record<string, unknown>>; totalCount: number };\n }>(GET_PENDING_REFUNDS, { page, pageSize });\n return jsonResult(data.getPendingRefunds);\n } catch (error) {\n ctx.logger.error('billing_refunds_list failed', { error: String(error) });\n return errorResult(\n `Failed to list refunds: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Quota ──────────────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'billing_quota_list')),\n {\n title: 'List Subscription Quotas',\n description: 'Get all quotas for a subscription.',\n inputSchema: {\n subscriptionId: z.string().describe('Subscription ID'),\n },\n },\n async ({ subscriptionId }) => {\n try {\n const data = await ctx.gql.global.request<{\n getAllQuotasOfSub: Array<Record<string, unknown>>;\n }>(GET_QUOTAS_OF_SUB, { subscriptionId });\n return jsonResult(data.getAllQuotasOfSub);\n } catch (error) {\n ctx.logger.error('billing_quota_list failed', { error: String(error) });\n return errorResult(\n `Failed to list quotas: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n}\n","/**\n * Billing module — subscriptions, plans, addons, invoices, payment-methods,\n * credits, refunds, quotas. Backend: ~/products/global/billing/global-billing-svc/.\n * Ported from cli-sdk/src/modules/billing/.\n */\n\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport type { McpContext, McpModule, ModuleRegistration } from '../../core/index.js';\nimport { registerBillingTools } from './tools.js';\n\nconst billingModule: McpModule = {\n id: 'billing',\n version: '0.0.1',\n displayName: 'Billing',\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 registerBillingTools(server, ctx, track);\n\n return { tools, resources: [], prompts: [] };\n },\n};\n\nexport default billingModule;\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/core/errors.ts","../../../src/core/tool-name.ts","../../../src/core/result.ts","../../../src/modules/billing/operations.ts","../../../src/modules/billing/tools.ts","../../../src/modules/billing/index.ts"],"names":["z"],"mappings":";;;;;;;;;;;AA8BO,IAAM,gBAAA,GAAN,cAA+B,KAAA,CAAM;AAAA,EACjB,KAAA;AAAA,EAEzB,WAAA,CAAY,SAAiB,KA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A0B,KAAA,YAAiB,KAAA,GAAQ,MAAM,OAAA,GAAU,MAAA,CAAO,KAAK,CAAC,CAAA;AAAA,SAClF;AAAA,MACF;AAAA,IACF;AAAA,GACF;AACF;;;ACzjBA,IAAM,aAAA,GAA2B;AAAA,EAC/B,EAAA,EAAI,SAAA;AAAA,EACJ,OAAA,EAAS,OAAA;AAAA,EACT,WAAA,EAAa,SAAA;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,oBAAA,CAAqB,MAAA,EAAQ,KAAK,KAAK,CAAA;AAEvC,IAAA,OAAO,EAAE,KAAA,EAAO,SAAA,EAAW,EAAC,EAAG,OAAA,EAAS,EAAC,EAAE;AAAA,EAC7C;AACF,CAAA;AAEA,IAAO,eAAA,GAAQ","file":"index.cjs","sourcesContent":["/**\n * Error classes for MCP SDK.\n *\n * Modules MUST throw these instead of throwing raw Errors. The registerTool\n * wrapper in result.ts catches and maps them to MCP-protocol-compliant\n * `{ isError: true, content: [...] }` responses.\n *\n * Throwing past the wrapper to the protocol surfaces as JSON-RPC -32603 to\n * the client and is a protocol bug.\n */\n\nexport class McpUserError extends Error {\n public readonly hint: string | undefined;\n\n constructor(message: string, opts?: { hint?: string }) {\n super(message);\n this.name = 'McpUserError';\n this.hint = opts?.hint;\n }\n}\n\nexport class McpAuthError extends McpUserError {\n constructor(message: string, opts?: { hint?: string }) {\n super(message, {\n hint: opts?.hint ?? 'Run the auth_login tool to authenticate.',\n });\n this.name = 'McpAuthError';\n }\n}\n\nexport class McpInternalError extends Error {\n public override readonly cause: unknown;\n\n constructor(message: string, cause?: unknown) {\n super(message);\n this.name = 'McpInternalError';\n this.cause = cause;\n }\n}\n","/**\n * Tool / resource / prompt naming helpers.\n *\n * Mandatory product prefix avoids collisions when Claude Desktop runs\n * multiple MCP servers concurrently (typical setup is ~6).\n *\n * Tool names are capped at 63 characters — Claude Desktop pre-1.x\n * truncated at 64 in some versions.\n */\n\nimport { McpInternalError } from './errors.js';\n\nconst MAX_TOOL_NAME_LENGTH = 63;\n\nfunction assertSafeName(name: string, kind: 'tool' | 'resource' | 'prompt'): string {\n if (kind === 'tool' && name.length > MAX_TOOL_NAME_LENGTH) {\n throw new McpInternalError(\n `Tool name '${name}' exceeds ${MAX_TOOL_NAME_LENGTH} characters (some MCP clients truncate at 64).`,\n );\n }\n return name;\n}\n\n/**\n * Build a tool name. Format: `<productName>_<...parts>` (snake_case).\n * Example: mcpToolName('vibecontrols', 'vibes', 'list') -> 'vibecontrols_vibes_list'\n */\nexport function mcpToolName(productName: string, ...parts: string[]): string {\n if (!productName) {\n throw new McpInternalError('mcpToolName: productName is required');\n }\n const name = [productName, ...parts].filter(Boolean).join('_');\n return assertSafeName(name, 'tool');\n}\n\n/**\n * Build a resource URI. Format: `<productName>://<...parts>`.\n * Example: mcpResourceUri('vibecontrols', 'schema') -> 'vibecontrols://schema'\n */\nexport function mcpResourceUri(productName: string, ...parts: string[]): string {\n if (!productName) {\n throw new McpInternalError('mcpResourceUri: productName is required');\n }\n return `${productName}://${parts.filter(Boolean).join('/')}`;\n}\n\n/**\n * Build a prompt name. Format: `<productName>-<...parts>` (kebab-case).\n * Example: mcpPromptName('vibecontrols', 'setup') -> 'vibecontrols-setup'\n */\nexport function mcpPromptName(productName: string, ...parts: string[]): string {\n if (!productName) {\n throw new McpInternalError('mcpPromptName: productName is required');\n }\n return [productName, ...parts].filter(Boolean).join('-');\n}\n\nexport const TOOL_NAME_LIMIT = MAX_TOOL_NAME_LENGTH;\n\n/**\n * Name-based hint heuristics for MCP `annotations` (readOnlyHint /\n * destructiveHint). Used by tool-governance.ts to auto-fill annotations for\n * the fleet of product modules that call `server.registerTool` directly\n * (bypassing the `registerTool()` core helper) and so never set them\n * explicitly today (BOFF-3903). Deliberately conservative — matched against\n * whole `_`-delimited segments so e.g. `timeentries_delete` and\n * `pomodoro_delete_goal` match, but a hypothetical `undeletable_check`\n * would not.\n *\n * A module can always override the inference by passing an explicit\n * `annotations` object to `registerTool()` / `server.registerTool()`.\n */\nconst DESTRUCTIVE_NAME_SEGMENT = /(?:^|_)delete(?:_|$)/i;\nconst READ_ONLY_NAME_SEGMENT = /(?:^|_)(?:list|get|search|check|read|count|stats|by_date)(?:_|$)/i;\n\n/** True when a tool name looks destructive (irreversibly deletes data) by naming convention. */\nexport function inferDestructiveHint(toolName: string): boolean {\n return DESTRUCTIVE_NAME_SEGMENT.test(toolName);\n}\n\n/**\n * True when a tool name looks read-only by naming convention. Never true for\n * a name that also looks destructive (a tool can't be both).\n */\nexport function inferReadOnlyHint(toolName: string): boolean {\n return !inferDestructiveHint(toolName) && READ_ONLY_NAME_SEGMENT.test(toolName);\n}\n","/**\n * MCP tool result helpers + central handler.\n *\n * Modules NEVER call server.registerTool directly — they use registerTool()\n * from this module so the central try/catch wraps the handler and:\n * - maps thrown McpUserError / McpAuthError / McpInternalError to\n * MCP-protocol-compliant `{ isError: true, content: [...] }` shapes\n * - threads `_meta.progressToken` into ctx.progress for long ops\n * - emits a structured log line on every error\n * - never leaks `cause` from McpInternalError to the client\n *\n * This is the analog of cli-sdk's createProgram() central error handler.\n */\n\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport type { ZodRawShape } from 'zod';\nimport type { McpContext } from './context.js';\nimport { McpAuthError, McpInternalError, McpUserError } from './errors.js';\nimport type { ToolAnnotations } from './tool-governance.js';\n\nexport interface ToolTextContent {\n type: 'text';\n text: string;\n [k: string]: unknown;\n}\n\nexport interface ToolResult {\n content: ToolTextContent[];\n isError?: boolean;\n structuredContent?: Record<string, unknown>;\n [k: string]: unknown;\n}\n\nexport interface ToolMeta {\n progressToken?: string | number;\n}\n\n/**\n * Build a successful tool result with JSON content (pretty-printed).\n */\nexport function jsonResult(data: unknown, structured?: Record<string, unknown>): ToolResult {\n const result: ToolResult = {\n content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],\n };\n if (structured !== undefined) {\n result.structuredContent = structured;\n }\n return result;\n}\n\n/**\n * Build a successful tool result with plain text content.\n */\nexport function textResult(text: string): ToolResult {\n return { content: [{ type: 'text', text }] };\n}\n\n/**\n * Build an error tool result. Honors MCP's `{ isError: true, content }` shape.\n * Optional hint is appended on a new line so the LLM can react.\n */\nexport function errorResult(message: string, hint?: string): ToolResult {\n const text = hint ? `${message}\\n\\nHint: ${hint}` : message;\n return { content: [{ type: 'text', text }], isError: true };\n}\n\nexport interface ToolMetadata {\n title: string;\n description: string;\n inputSchema?: ZodRawShape;\n /**\n * Explicit MCP annotations (readOnlyHint / destructiveHint / ...). Optional\n * — when omitted, `wrapServerWithToolGovernance` (applied centrally in\n * `createMcpServer`) infers them from the tool name. Set this to override\n * the inference for a tool whose name doesn't match the naming convention.\n */\n annotations?: ToolAnnotations;\n}\n\nexport type ToolHandler<TArgs = Record<string, unknown>> = (\n args: TArgs,\n ctx: McpContext,\n meta: ToolMeta,\n) => Promise<unknown>;\n\n/**\n * Register a tool with the central error wrapper.\n *\n * The handler returns a plain value or void. The wrapper:\n * - wraps non-undefined returns in jsonResult()\n * - if the value already looks like a ToolResult (has `content`), passes through\n * - catches McpAuthError / McpUserError / McpInternalError / generic Error\n * - logs every error via ctx.logger.error\n */\nexport function registerTool<TArgs extends Record<string, unknown>>(\n server: McpServer,\n ctx: McpContext,\n name: string,\n metadata: ToolMetadata,\n handler: ToolHandler<TArgs>,\n): void {\n const sdkConfig = {\n title: metadata.title,\n description: metadata.description,\n ...(metadata.inputSchema ? { inputSchema: metadata.inputSchema } : {}),\n ...(metadata.annotations ? { annotations: metadata.annotations } : {}),\n };\n\n // The MCP SDK's registerTool signature is `(name, config, handler)`. The\n // handler arity depends on whether inputSchema is present (1-arg without,\n // 2-arg with). We accept a unified handler shape and dispatch at runtime.\n // The SDK's typing is strict and conditional on the inputSchema generic;\n // bypass with a cast since runtime acceptance is unconditional.\n const wrapped = async (...callbackArgs: unknown[]): Promise<ToolResult> => {\n const hasArgs = callbackArgs.length === 2;\n const args = (hasArgs ? callbackArgs[0] : {}) as TArgs;\n const extra = (hasArgs ? callbackArgs[1] : callbackArgs[0]) as\n { _meta?: { progressToken?: string | number } } | undefined;\n\n const progressToken = extra?._meta?.progressToken;\n const meta: ToolMeta = progressToken !== undefined ? { progressToken } : {};\n\n try {\n const result = await handler(args, ctx, meta);\n if (isToolResult(result)) return result;\n if (result === undefined) return textResult('OK');\n return jsonResult(result);\n } catch (error) {\n return mapErrorToResult(error, ctx, name);\n }\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (server as any).registerTool(name, sdkConfig, wrapped);\n}\n\nfunction isToolResult(value: unknown): value is ToolResult {\n return (\n !!value &&\n typeof value === 'object' &&\n 'content' in value &&\n Array.isArray((value as ToolResult).content)\n );\n}\n\nfunction mapErrorToResult(error: unknown, ctx: McpContext, toolName: string): ToolResult {\n if (error instanceof McpAuthError) {\n ctx.logger.warn(`${toolName}: auth required`, { message: error.message });\n return errorResult(error.message, error.hint);\n }\n if (error instanceof McpUserError) {\n ctx.logger.info(`${toolName}: user error`, { message: error.message });\n return errorResult(error.message, error.hint);\n }\n if (error instanceof McpInternalError) {\n ctx.logger.error(`${toolName}: internal error`, {\n message: error.message,\n cause: stringifyCause(error.cause),\n });\n return errorResult(`Internal error in ${toolName}.`);\n }\n const message = error instanceof Error ? error.message : String(error);\n ctx.logger.error(`${toolName}: unhandled error`, { message });\n return errorResult(`${toolName}: ${message}`);\n}\n\nfunction stringifyCause(cause: unknown): string | undefined {\n if (cause === undefined || cause === null) return undefined;\n if (cause instanceof Error) return cause.message;\n try {\n return JSON.stringify(cause);\n } catch {\n return String(cause);\n }\n}\n","export const GET_DEFAULT_BILLING_ACCOUNT = `\n query GetDefaultBillingAccount {\n getDefaultBillingAccount {\n id creditAmount currency\n }\n }\n`;\n\nexport const GET_ACTIVE_SUBSCRIPTIONS = `\n query GetActiveSubscriptions($billingAccountId: ID!) {\n getActiveSubscriptions(billingAccountId: $billingAccountId) {\n id status seatCount nextBillingDate\n plan { name price currency }\n }\n }\n`;\n\nexport const GET_SUBSCRIPTION = `\n query GetSubscription($id: ID!) {\n getSubscription(id: $id) {\n id status startDate endDate seatCount billingAccountId\n }\n }\n`;\n\nexport const UPDATE_SUBSCRIPTION_SEATS = `\n mutation UpdateSubscriptionSeats($input: UpdateSubscriptionSeatsInput!) {\n updateSubscriptionSeats(input: $input) {\n id seatCount lastSeatChangeAt\n }\n }\n`;\n\nexport const CANCEL_SUBSCRIPTION = `\n mutation CancelSubscription($input: CancelSubscriptionInput!) {\n cancelSubscription(input: $input) {\n id status canceledAt cancellationReason\n }\n }\n`;\n\nexport const GET_ALL_PLANS = `\n query GetAllPlans($filter: PlanFilterInput) {\n getAllPlans(filter: $filter) {\n id name price currency duration pricingModel\n }\n }\n`;\n\nexport const GET_PLAN = `\n query GetPlan($id: ID!) {\n getPlan(id: $id) {\n id name price pricePerSeat minSeats maxSeats isActive\n }\n }\n`;\n\nexport const GET_ALL_ADDONS = `\n query GetAllAddOns($filter: AddOnFilterInput, $limit: Int) {\n getAllAddOns(filter: $filter, limit: $limit) {\n id name price currency duration isActive\n }\n }\n`;\n\nexport const GET_PAGINATED_INVOICES = `\n query GetPaginatedInvoices($billingAccountId: ID!, $page: Int, $pageSize: Int) {\n getPaginatedInvoices(billingAccountId: $billingAccountId, page: $page, pageSize: $pageSize) {\n invoices { id invoiceNumber status total currency paidAt pdfUrl }\n totalCount hasMore\n }\n }\n`;\n\nexport const GET_INVOICE = `\n query GetInvoice($id: ID!) {\n getInvoice(id: $id) {\n id invoiceNumber status subtotal tax total\n items { description amount }\n }\n }\n`;\n\nexport const GET_PAYMENT_METHODS = `\n query GetPaymentMethods($billingAccountId: ID!) {\n getPaymentMethods(billingAccountId: $billingAccountId) {\n id type last4 expiryYear brand isDefault isVerified\n }\n }\n`;\n\nexport const ADD_PAYMENT_METHOD = `\n mutation AddPaymentMethod($input: AddPaymentMethodInput!) {\n addPaymentMethod(input: $input) {\n id type isDefault isVerified\n }\n }\n`;\n\nexport const DELETE_PAYMENT_METHOD = `\n mutation DeletePaymentMethod($id: ID!) {\n deletePaymentMethod(id: $id) { success }\n }\n`;\n\nexport const GRANT_CREDITS = `\n mutation GrantCredits($input: GrantCreditsInput!) {\n grantCredits(input: $input) {\n id amount status type\n }\n }\n`;\n\nexport const REQUEST_CREDIT_WITHDRAWAL = `\n mutation RequestCreditWithdrawal($input: RequestCreditWithdrawalInput!) {\n requestCreditWithdrawal(input: $input) {\n id status amount\n }\n }\n`;\n\nexport const GET_PENDING_REFUNDS = `\n query GetPendingRefunds($page: Int, $pageSize: Int) {\n getPendingRefunds(page: $page, pageSize: $pageSize) {\n records { id amount status source createdAt }\n totalCount\n }\n }\n`;\n\nexport const GET_QUOTAS_OF_SUB = `\n query GetQuotas($subscriptionId: ID!) {\n getAllQuotasOfSub(subscriptionId: $subscriptionId) {\n id name limits currentUsageSum reusable\n }\n }\n`;\n","/**\n * Billing module tools — subscriptions, plans, addons, invoices,\n * payment-methods, credits, refunds, quotas.\n *\n * Backend: ~/products/global/billing/global-billing-svc/.\n * Ported from cli-sdk/src/modules/billing/. The CLI's stdin/options become\n * MCP tool arguments. Browser-redirect commands (Stripe checkout) are not\n * present in the source; the closest analogue (`invoices download`) returns a\n * URL — exposed here as `billing_invoices_get_pdf_url`.\n */\n\nimport { z } from 'zod';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { jsonResult, errorResult, mcpToolName, type McpContext } from '../../core/index.js';\nimport {\n GET_DEFAULT_BILLING_ACCOUNT,\n GET_ACTIVE_SUBSCRIPTIONS,\n GET_SUBSCRIPTION,\n UPDATE_SUBSCRIPTION_SEATS,\n CANCEL_SUBSCRIPTION,\n GET_ALL_PLANS,\n GET_PLAN,\n GET_ALL_ADDONS,\n GET_PAGINATED_INVOICES,\n GET_INVOICE,\n GET_PAYMENT_METHODS,\n ADD_PAYMENT_METHOD,\n DELETE_PAYMENT_METHOD,\n GRANT_CREDITS,\n REQUEST_CREDIT_WITHDRAWAL,\n GET_PENDING_REFUNDS,\n GET_QUOTAS_OF_SUB,\n} from './operations.js';\n\ninterface SubRow {\n id: string;\n status?: string;\n seatCount?: number;\n nextBillingDate?: string;\n plan?: { name: string; price?: number; currency?: string };\n}\n\ninterface PlanRow {\n id: string;\n name: string;\n price?: number;\n currency?: string;\n duration?: string;\n pricingModel?: string;\n isActive?: boolean;\n}\n\ninterface InvoiceRow {\n id: string;\n invoiceNumber?: string;\n status?: string;\n total?: number;\n currency?: string;\n paidAt?: string;\n pdfUrl?: string;\n}\n\ninterface PaymentMethodRow {\n id: string;\n type: string;\n last4?: string;\n brand?: string;\n isDefault?: boolean;\n isVerified?: boolean;\n}\n\ninterface BillingAccountRow {\n id: string;\n creditAmount?: number;\n currency?: string;\n}\n\nasync function resolveBillingAccountId(\n ctx: McpContext,\n override: string | undefined,\n): Promise<string> {\n if (override !== undefined && override !== '') return override;\n const data = await ctx.gql.global.request<{\n getDefaultBillingAccount: BillingAccountRow | null;\n }>(GET_DEFAULT_BILLING_ACCOUNT);\n if (!data.getDefaultBillingAccount?.id) {\n throw new Error('No default billing account on file. Pass account explicitly.');\n }\n return data.getDefaultBillingAccount.id;\n}\n\nexport function registerBillingTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n // ── Subscriptions ──────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'billing_subscriptions_list')),\n {\n title: 'List Subscriptions',\n description: 'List active subscriptions on a billing account (defaults to current).',\n inputSchema: {\n account: z.string().optional().describe('Billing account ID (defaults to current)'),\n },\n },\n async ({ account }) => {\n try {\n const billingAccountId = await resolveBillingAccountId(ctx, account);\n const data = await ctx.gql.global.request<{ getActiveSubscriptions: SubRow[] }>(\n GET_ACTIVE_SUBSCRIPTIONS,\n { billingAccountId },\n );\n return jsonResult(data.getActiveSubscriptions);\n } catch (error) {\n ctx.logger.error('billing_subscriptions_list failed', { error: String(error) });\n return errorResult(\n `Failed to list subscriptions: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'billing_subscriptions_get')),\n {\n title: 'Get Subscription',\n description: 'Get a subscription by ID.',\n inputSchema: { id: z.string().describe('Subscription ID') },\n },\n async ({ id }) => {\n try {\n const data = await ctx.gql.global.request<{ getSubscription: SubRow | null }>(\n GET_SUBSCRIPTION,\n { id },\n );\n if (!data.getSubscription) return errorResult(`Subscription ${id} not found`);\n return jsonResult(data.getSubscription);\n } catch (error) {\n ctx.logger.error('billing_subscriptions_get failed', { error: String(error) });\n return errorResult(\n `Failed to get subscription: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'billing_subscriptions_upgrade')),\n {\n title: 'Update Subscription Seats',\n description: 'Change the seat count on a subscription.',\n inputSchema: {\n id: z.string().describe('Subscription ID'),\n seats: z.number().describe('Target seat count'),\n },\n },\n async ({ id, seats }) => {\n try {\n const input: Record<string, unknown> = { subscriptionId: id, seatCount: seats };\n const data = await ctx.gql.global.request<{ updateSubscriptionSeats: SubRow }>(\n UPDATE_SUBSCRIPTION_SEATS,\n { input },\n );\n return jsonResult(data.updateSubscriptionSeats);\n } catch (error) {\n ctx.logger.error('billing_subscriptions_upgrade failed', { error: String(error) });\n return errorResult(\n `Failed to update seats: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'billing_subscriptions_cancel')),\n {\n title: 'Cancel Subscription',\n description: 'Cancel a subscription with an optional reason.',\n inputSchema: {\n id: z.string().describe('Subscription ID'),\n reason: z.string().optional().describe('Cancellation reason'),\n },\n },\n async ({ id, reason }) => {\n try {\n const input: Record<string, unknown> = { subscriptionId: id };\n if (reason !== undefined) input.reason = reason;\n const data = await ctx.gql.global.request<{ cancelSubscription: SubRow }>(\n CANCEL_SUBSCRIPTION,\n { input },\n );\n return jsonResult(data.cancelSubscription);\n } catch (error) {\n ctx.logger.error('billing_subscriptions_cancel failed', { error: String(error) });\n return errorResult(\n `Failed to cancel subscription: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Plans ──────────────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'billing_plans_list')),\n {\n title: 'List Plans',\n description: 'List available plans, optionally filtered by product.',\n inputSchema: {\n product: z.string().optional().describe('Product ID filter'),\n },\n },\n async ({ product }) => {\n try {\n const filter: Record<string, unknown> = {};\n if (product !== undefined) filter.productId = product;\n const data = await ctx.gql.global.request<{ getAllPlans: PlanRow[] }>(GET_ALL_PLANS, {\n filter: Object.keys(filter).length ? filter : undefined,\n });\n return jsonResult(data.getAllPlans);\n } catch (error) {\n ctx.logger.error('billing_plans_list failed', { error: String(error) });\n return errorResult(\n `Failed to list plans: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'billing_plans_get')),\n {\n title: 'Get Plan',\n description: 'Get a plan by ID.',\n inputSchema: { id: z.string().describe('Plan ID') },\n },\n async ({ id }) => {\n try {\n const data = await ctx.gql.global.request<{ getPlan: PlanRow | null }>(GET_PLAN, { id });\n if (!data.getPlan) return errorResult(`Plan ${id} not found`);\n return jsonResult(data.getPlan);\n } catch (error) {\n ctx.logger.error('billing_plans_get failed', { error: String(error) });\n return errorResult(\n `Failed to get plan: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Addons ─────────────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'billing_addons_list')),\n {\n title: 'List Addons',\n description: 'List addons, optionally filtered by product.',\n inputSchema: {\n product: z.string().optional().describe('Product ID filter'),\n limit: z.number().optional().describe('Page size (default 50)'),\n },\n },\n async ({ product, limit }) => {\n try {\n const filter: Record<string, unknown> = {};\n if (product !== undefined) filter.productId = product;\n const data = await ctx.gql.global.request<{ getAllAddOns: PlanRow[] }>(GET_ALL_ADDONS, {\n filter: Object.keys(filter).length ? filter : undefined,\n limit,\n });\n return jsonResult(data.getAllAddOns);\n } catch (error) {\n ctx.logger.error('billing_addons_list failed', { error: String(error) });\n return errorResult(\n `Failed to list addons: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Invoices ───────────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'billing_invoices_list')),\n {\n title: 'List Invoices',\n description: 'Paginated list of invoices on a billing account.',\n inputSchema: {\n account: z.string().optional().describe('Billing account ID (defaults to current)'),\n page: z.number().optional().describe('Page number (default 1)'),\n pageSize: z.number().optional().describe('Page size (default 20)'),\n },\n },\n async ({ account, page, pageSize }) => {\n try {\n const billingAccountId = await resolveBillingAccountId(ctx, account);\n const data = await ctx.gql.global.request<{\n getPaginatedInvoices: { invoices: InvoiceRow[]; totalCount: number };\n }>(GET_PAGINATED_INVOICES, { billingAccountId, page, pageSize });\n return jsonResult(data.getPaginatedInvoices);\n } catch (error) {\n ctx.logger.error('billing_invoices_list failed', { error: String(error) });\n return errorResult(\n `Failed to list invoices: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'billing_invoices_get')),\n {\n title: 'Get Invoice',\n description: 'Get an invoice by ID.',\n inputSchema: { id: z.string().describe('Invoice ID') },\n },\n async ({ id }) => {\n try {\n const data = await ctx.gql.global.request<{ getInvoice: InvoiceRow | null }>(GET_INVOICE, {\n id,\n });\n if (!data.getInvoice) return errorResult(`Invoice ${id} not found`);\n return jsonResult(data.getInvoice);\n } catch (error) {\n ctx.logger.error('billing_invoices_get failed', { error: String(error) });\n return errorResult(\n `Failed to get invoice: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // Browser-redirect analogue: returns the PDF URL for the LLM to share.\n server.registerTool(\n track(mcpToolName(ctx.productName, 'billing_invoices_get_pdf_url')),\n {\n title: 'Get Invoice PDF URL',\n description:\n 'Return the invoice PDF download URL. The actual PDF must be opened in a browser by the user.',\n inputSchema: { id: z.string().describe('Invoice ID') },\n },\n async ({ id }) => {\n try {\n const data = await ctx.gql.global.request<{ getInvoice: InvoiceRow | null }>(GET_INVOICE, {\n id,\n });\n if (!data.getInvoice?.pdfUrl) return errorResult(`Invoice ${id} has no pdfUrl`);\n return jsonResult({ url: data.getInvoice.pdfUrl });\n } catch (error) {\n ctx.logger.error('billing_invoices_get_pdf_url failed', { error: String(error) });\n return errorResult(\n `Failed to fetch invoice URL: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Payment methods ────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'billing_payment_methods_list')),\n {\n title: 'List Payment Methods',\n description: 'List payment methods on a billing account.',\n inputSchema: {\n account: z.string().optional().describe('Billing account ID (defaults to current)'),\n },\n },\n async ({ account }) => {\n try {\n const billingAccountId = await resolveBillingAccountId(ctx, account);\n const data = await ctx.gql.global.request<{ getPaymentMethods: PaymentMethodRow[] }>(\n GET_PAYMENT_METHODS,\n { billingAccountId },\n );\n return jsonResult(data.getPaymentMethods);\n } catch (error) {\n ctx.logger.error('billing_payment_methods_list failed', { error: String(error) });\n return errorResult(\n `Failed to list payment methods: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'billing_payment_methods_add')),\n {\n title: 'Add Payment Method',\n description:\n 'Add a payment method (card metadata only — provider handles secrets). Use the provider checkout URL elsewhere for full card capture.',\n inputSchema: {\n type: z.enum(['CREDIT_CARD', 'BANK', 'UPI']).describe('Payment method type'),\n last4: z.string().describe('Last 4 digits / identifier'),\n brand: z.string().optional().describe('Brand (Visa, MasterCard, etc.)'),\n expiryMonth: z.number().optional().describe('Expiry month (1-12)'),\n expiryYear: z.number().optional().describe('Expiry year (4 digits)'),\n account: z.string().optional().describe('Billing account ID (defaults to current)'),\n isDefault: z.boolean().optional().describe('Make it the default'),\n },\n },\n async ({ type, last4, brand, expiryMonth, expiryYear, account, isDefault }) => {\n try {\n const billingAccountId = await resolveBillingAccountId(ctx, account);\n const input: Record<string, unknown> = {\n billingAccountId,\n type,\n last4,\n isDefault: isDefault === true,\n };\n if (brand !== undefined) input.brand = brand;\n if (expiryMonth !== undefined) input.expiryMonth = expiryMonth;\n if (expiryYear !== undefined) input.expiryYear = expiryYear;\n\n const data = await ctx.gql.global.request<{ addPaymentMethod: PaymentMethodRow }>(\n ADD_PAYMENT_METHOD,\n { input },\n );\n return jsonResult(data.addPaymentMethod);\n } catch (error) {\n ctx.logger.error('billing_payment_methods_add failed', { error: String(error) });\n return errorResult(\n `Failed to add payment method: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'billing_payment_methods_remove')),\n {\n title: 'Remove Payment Method',\n description: 'Delete a payment method by ID.',\n inputSchema: { id: z.string().describe('Payment method ID') },\n },\n async ({ id }) => {\n try {\n await ctx.gql.global.request<{ deletePaymentMethod: { success: boolean } }>(\n DELETE_PAYMENT_METHOD,\n { id },\n );\n return jsonResult({ status: 'success', message: 'Payment method removed', id });\n } catch (error) {\n ctx.logger.error('billing_payment_methods_remove failed', { error: String(error) });\n return errorResult(\n `Failed to remove payment method: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Credits ────────────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'billing_credits_balance')),\n {\n title: 'Credit Balance',\n description: 'Show current credit balance on the default billing account.',\n inputSchema: {},\n },\n async () => {\n try {\n const data = await ctx.gql.global.request<{\n getDefaultBillingAccount: BillingAccountRow | null;\n }>(GET_DEFAULT_BILLING_ACCOUNT);\n return jsonResult(data.getDefaultBillingAccount);\n } catch (error) {\n ctx.logger.error('billing_credits_balance failed', { error: String(error) });\n return errorResult(\n `Failed to read balance: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'billing_credits_grant')),\n {\n title: 'Grant Credits',\n description: 'Grant credits to a billing account (admin only).',\n inputSchema: {\n account: z.string().describe('Billing account ID'),\n amount: z.number().describe('Amount to grant'),\n reason: z.string().optional().describe('Reason for grant'),\n },\n },\n async ({ account, amount, reason }) => {\n try {\n const input: Record<string, unknown> = {\n billingAccountId: account,\n amount,\n reason: reason ?? 'mcp-grant',\n };\n await ctx.gql.global.request(GRANT_CREDITS, { input });\n return jsonResult({ status: 'success', message: 'Credits granted', amount, account });\n } catch (error) {\n ctx.logger.error('billing_credits_grant failed', { error: String(error) });\n return errorResult(\n `Failed to grant credits: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'billing_credits_withdraw')),\n {\n title: 'Withdraw Credits',\n description: 'Request a credit withdrawal to a payout account.',\n inputSchema: {\n account: z.string().describe('Billing account ID'),\n amount: z.number().describe('Amount to withdraw'),\n payout: z.string().describe('Payout account ID'),\n },\n },\n async ({ account, amount, payout }) => {\n try {\n const input: Record<string, unknown> = {\n billingAccountId: account,\n creditAmount: amount,\n payoutAccountId: payout,\n };\n await ctx.gql.global.request(REQUEST_CREDIT_WITHDRAWAL, { input });\n return jsonResult({ status: 'success', message: 'Withdrawal requested', amount, account });\n } catch (error) {\n ctx.logger.error('billing_credits_withdraw failed', { error: String(error) });\n return errorResult(\n `Failed to request withdrawal: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Refunds ────────────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'billing_refunds_list')),\n {\n title: 'List Pending Refunds',\n description: 'List pending refund records (paginated).',\n inputSchema: {\n page: z.number().optional().describe('Page number (default 0)'),\n pageSize: z.number().optional().describe('Page size (default 20)'),\n },\n },\n async ({ page, pageSize }) => {\n try {\n const data = await ctx.gql.global.request<{\n getPendingRefunds: { records: Array<Record<string, unknown>>; totalCount: number };\n }>(GET_PENDING_REFUNDS, { page, pageSize });\n return jsonResult(data.getPendingRefunds);\n } catch (error) {\n ctx.logger.error('billing_refunds_list failed', { error: String(error) });\n return errorResult(\n `Failed to list refunds: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Quota ──────────────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'billing_quota_list')),\n {\n title: 'List Subscription Quotas',\n description: 'Get all quotas for a subscription.',\n inputSchema: {\n subscriptionId: z.string().describe('Subscription ID'),\n },\n },\n async ({ subscriptionId }) => {\n try {\n const data = await ctx.gql.global.request<{\n getAllQuotasOfSub: Array<Record<string, unknown>>;\n }>(GET_QUOTAS_OF_SUB, { subscriptionId });\n return jsonResult(data.getAllQuotasOfSub);\n } catch (error) {\n ctx.logger.error('billing_quota_list failed', { error: String(error) });\n return errorResult(\n `Failed to list quotas: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n}\n","/**\n * Billing module — subscriptions, plans, addons, invoices, payment-methods,\n * credits, refunds, quotas. Backend: ~/products/global/billing/global-billing-svc/.\n * Ported from cli-sdk/src/modules/billing/.\n */\n\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport type { McpContext, McpModule, ModuleRegistration } from '../../core/index.js';\nimport { registerBillingTools } from './tools.js';\n\nconst billingModule: McpModule = {\n id: 'billing',\n version: '0.0.1',\n displayName: 'Billing',\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 registerBillingTools(server, ctx, track);\n\n return { tools, resources: [], prompts: [] };\n },\n};\n\nexport default billingModule;\n"]}
|
|
@@ -489,6 +489,7 @@ var InsightTypeEnum = zod.z.enum([
|
|
|
489
489
|
]).describe("Category of a proactive insight signal");
|
|
490
490
|
var PortfolioStatusEnum = zod.z.enum(["ACTIVE", "ARCHIVED", "DRAFT"]).describe("Lifecycle status of an investment portfolio");
|
|
491
491
|
var RebalanceStatusEnum = zod.z.enum(["APPROVED", "CANCELLED", "DRAFT", "EXECUTED", "PROPOSED", "REJECTED"]).describe("Review-lifecycle status of a rebalance proposal");
|
|
492
|
+
var AgentRebalanceStatusEnum = zod.z.enum(["CANCELLED", "PROPOSED", "REJECTED"]).describe("Agent-safe target status; APPROVED and EXECUTED require the human review UI");
|
|
492
493
|
var RiskProfileEnum = zod.z.enum(["AGGRESSIVE", "BALANCED", "CONSERVATIVE", "GROWTH", "MODERATE"]).describe("Risk profile of a household or model portfolio");
|
|
493
494
|
var TransactionTypeEnum = zod.z.enum(["BUY", "DEPOSIT", "DIVIDEND", "FEE", "INTEREST", "SELL", "TRANSFER", "WITHDRAWAL"]).describe("Type of an account transaction");
|
|
494
495
|
var JsonObject = zod.z.record(zod.z.string(), zod.z.unknown());
|
|
@@ -652,6 +653,7 @@ function registerAccountTools(server, ctx, track) {
|
|
|
652
653
|
{
|
|
653
654
|
title: "Archive Account",
|
|
654
655
|
description: "Archive (soft-delete) a financial account by ID. Returns true on success.",
|
|
656
|
+
annotations: { destructiveHint: true, readOnlyHint: false },
|
|
655
657
|
inputSchema: { id: zod.z.string().describe("Account ID") }
|
|
656
658
|
},
|
|
657
659
|
async ({ id }) => {
|
|
@@ -827,6 +829,7 @@ function registerPortfolioTools(server, ctx, track) {
|
|
|
827
829
|
{
|
|
828
830
|
title: "Archive Portfolio",
|
|
829
831
|
description: "Archive (soft-delete) a portfolio by ID. Returns true on success.",
|
|
832
|
+
annotations: { destructiveHint: true, readOnlyHint: false },
|
|
830
833
|
inputSchema: { id: zod.z.string().describe("Portfolio ID") }
|
|
831
834
|
},
|
|
832
835
|
async ({ id }) => {
|
|
@@ -1016,6 +1019,7 @@ function registerTransactionTools(server, ctx, track) {
|
|
|
1016
1019
|
{
|
|
1017
1020
|
title: "Record Transaction",
|
|
1018
1021
|
description: "Record a transaction against an account. `accountId`, `type`, and `tradeDate` are required. Trade types (BUY/SELL/etc.) may carry symbol/quantity/price; cash types (DEPOSIT/WITHDRAWAL/etc.) carry amount.",
|
|
1022
|
+
annotations: { destructiveHint: true, readOnlyHint: false },
|
|
1019
1023
|
inputSchema: {
|
|
1020
1024
|
accountId: zod.z.string().min(1).describe("Account the transaction posts to"),
|
|
1021
1025
|
type: TransactionTypeEnum.describe("Transaction type"),
|
|
@@ -1232,6 +1236,7 @@ function registerGoalTools(server, ctx, track) {
|
|
|
1232
1236
|
{
|
|
1233
1237
|
title: "Archive Goal",
|
|
1234
1238
|
description: "Archive (soft-delete) a goal by ID. Returns true on success.",
|
|
1239
|
+
annotations: { destructiveHint: true, readOnlyHint: false },
|
|
1235
1240
|
inputSchema: { id: zod.z.string().describe("Goal ID") }
|
|
1236
1241
|
},
|
|
1237
1242
|
async ({ id }) => {
|
|
@@ -1322,6 +1327,7 @@ function registerGoalTools(server, ctx, track) {
|
|
|
1322
1327
|
{
|
|
1323
1328
|
title: "Unlink Goal Funding",
|
|
1324
1329
|
description: "Remove a goal funding link by ID. Returns true on success.",
|
|
1330
|
+
annotations: { destructiveHint: true, readOnlyHint: false },
|
|
1325
1331
|
inputSchema: { id: zod.z.string().describe("Goal funding ID") }
|
|
1326
1332
|
},
|
|
1327
1333
|
async ({ id }) => {
|
|
@@ -1496,6 +1502,7 @@ function registerHouseholdTools(server, ctx, track) {
|
|
|
1496
1502
|
{
|
|
1497
1503
|
title: "Archive Household",
|
|
1498
1504
|
description: "Archive (soft-delete) a household by ID. Returns true on success.",
|
|
1505
|
+
annotations: { destructiveHint: true, readOnlyHint: false },
|
|
1499
1506
|
inputSchema: { id: zod.z.string().describe("Household ID") }
|
|
1500
1507
|
},
|
|
1501
1508
|
async ({ id }) => {
|
|
@@ -1647,10 +1654,11 @@ function registerRebalanceTools(server, ctx, track) {
|
|
|
1647
1654
|
track(mcpToolName(ctx.productName, "rebalances_transition")),
|
|
1648
1655
|
{
|
|
1649
1656
|
title: "Transition Rebalance Proposal",
|
|
1650
|
-
description: "
|
|
1657
|
+
description: "Submit a draft proposal for human review, or reject/cancel it. APPROVED and EXECUTED are deliberately unavailable to external agents and must occur in the human review UI.",
|
|
1658
|
+
annotations: { destructiveHint: true, readOnlyHint: false },
|
|
1651
1659
|
inputSchema: {
|
|
1652
1660
|
id: zod.z.string().describe("Rebalance proposal ID"),
|
|
1653
|
-
status:
|
|
1661
|
+
status: AgentRebalanceStatusEnum
|
|
1654
1662
|
}
|
|
1655
1663
|
},
|
|
1656
1664
|
async ({ id, status }) => {
|
|
@@ -1776,6 +1784,7 @@ function registerInsightTools(server, ctx, track) {
|
|
|
1776
1784
|
{
|
|
1777
1785
|
title: "Resolve Insight",
|
|
1778
1786
|
description: "Resolve a proactive insight by ID (marks it RESOLVED and stamps resolvedAt).",
|
|
1787
|
+
annotations: { destructiveHint: true, readOnlyHint: false },
|
|
1779
1788
|
inputSchema: { id: zod.z.string().describe("Insight ID") }
|
|
1780
1789
|
},
|
|
1781
1790
|
async ({ id }) => {
|
|
@@ -1795,6 +1804,7 @@ function registerInsightTools(server, ctx, track) {
|
|
|
1795
1804
|
{
|
|
1796
1805
|
title: "Dismiss Insight",
|
|
1797
1806
|
description: "Dismiss a proactive insight by ID (marks it DISMISSED).",
|
|
1807
|
+
annotations: { destructiveHint: true, readOnlyHint: false },
|
|
1798
1808
|
inputSchema: { id: zod.z.string().describe("Insight ID") }
|
|
1799
1809
|
},
|
|
1800
1810
|
async ({ id }) => {
|
|
@@ -2090,7 +2100,7 @@ Show results at each step and confirm before moving on.`
|
|
|
2090
2100
|
|
|
2091
2101
|
1. **Holdings & Drift**: Use ${p}_portfolios_get and ${p}_holdings_list to inspect current positions vs. the target allocation.
|
|
2092
2102
|
2. **Insights**: Use ${p}_insights_list filtered by the portfolio (subjectType="portfolio", status=OPEN) to surface DRIFT/CONCENTRATION_RISK/REBALANCE_DUE signals; acknowledge with ${p}_insights_acknowledge.
|
|
2093
|
-
3. **Rebalance**: If drift exceeds the threshold, use ${p}_rebalances_create with proposed trades, then
|
|
2103
|
+
3. **Rebalance**: If drift exceeds the threshold, use ${p}_rebalances_create with proposed trades, then submit it for human review with ${p}_rebalances_transition (DRAFT \u2192 PROPOSED). External agents cannot approve or execute trades; those transitions are restricted to the human review UI.
|
|
2094
2104
|
4. **Goals**: Use ${p}_goals_list and ${p}_goals_recalc_projection to refresh each goal's projection (AHEAD/ON_TRACK/BEHIND/AT_RISK).
|
|
2095
2105
|
5. **Resolve**: Resolve addressed insights with ${p}_insights_resolve.
|
|
2096
2106
|
|