@burdenoff/mcp-libs 2026.825.2 → 2026.825.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/dist/{chunk-YOSQUY3M.js → chunk-BSNL65PZ.js} +2 -2
  2. package/dist/{chunk-YOSQUY3M.js.map → chunk-BSNL65PZ.js.map} +1 -1
  3. package/dist/{chunk-RHWHUY5Y.js → chunk-QQYJVKJE.js} +3 -3
  4. package/dist/{chunk-RHWHUY5Y.js.map → chunk-QQYJVKJE.js.map} +1 -1
  5. package/dist/core/index.cjs.map +1 -1
  6. package/dist/core/index.js +1 -1
  7. package/dist/index.cjs.map +1 -1
  8. package/dist/index.js +1 -1
  9. package/dist/modules/adaptercloud/index.cjs.map +1 -1
  10. package/dist/modules/adaptercloud/index.js +1 -1
  11. package/dist/modules/artistrybase/index.cjs.map +1 -1
  12. package/dist/modules/artistrybase/index.js +1 -1
  13. package/dist/modules/assethandler/index.cjs.map +1 -1
  14. package/dist/modules/assethandler/index.js +1 -1
  15. package/dist/modules/atheletebridge/index.cjs.map +1 -1
  16. package/dist/modules/atheletebridge/index.js +1 -1
  17. package/dist/modules/auth/index.cjs.map +1 -1
  18. package/dist/modules/auth/index.js +3 -3
  19. package/dist/modules/billing/index.cjs.map +1 -1
  20. package/dist/modules/billing/index.js +1 -1
  21. package/dist/modules/brainyrich/index.cjs +13 -3
  22. package/dist/modules/brainyrich/index.cjs.map +1 -1
  23. package/dist/modules/brainyrich/index.js +14 -4
  24. package/dist/modules/brainyrich/index.js.map +1 -1
  25. package/dist/modules/buildmyiq/index.cjs.map +1 -1
  26. package/dist/modules/buildmyiq/index.js +1 -1
  27. package/dist/modules/channels/index.cjs.map +1 -1
  28. package/dist/modules/channels/index.js +1 -1
  29. package/dist/modules/collabkin/index.cjs.map +1 -1
  30. package/dist/modules/collabkin/index.js +1 -1
  31. package/dist/modules/comradecircle/index.cjs.map +1 -1
  32. package/dist/modules/comradecircle/index.js +1 -1
  33. package/dist/modules/conversations/index.cjs.map +1 -1
  34. package/dist/modules/conversations/index.js +1 -1
  35. package/dist/modules/coolandlovely/index.cjs.map +1 -1
  36. package/dist/modules/coolandlovely/index.js +1 -1
  37. package/dist/modules/cosmicintersection/index.cjs.map +1 -1
  38. package/dist/modules/cosmicintersection/index.js +1 -1
  39. package/dist/modules/crewfoundry/index.cjs.map +1 -1
  40. package/dist/modules/crewfoundry/index.js +1 -1
  41. package/dist/modules/devportal/index.cjs.map +1 -1
  42. package/dist/modules/devportal/index.js +1 -1
  43. package/dist/modules/ecoimpacthub/index.cjs.map +1 -1
  44. package/dist/modules/ecoimpacthub/index.js +1 -1
  45. package/dist/modules/eventfullymanaged/index.cjs.map +1 -1
  46. package/dist/modules/eventfullymanaged/index.js +1 -1
  47. package/dist/modules/export/index.cjs.map +1 -1
  48. package/dist/modules/export/index.js +1 -1
  49. package/dist/modules/files/index.cjs.map +1 -1
  50. package/dist/modules/files/index.js +1 -1
  51. package/dist/modules/ggnomad/index.cjs.map +1 -1
  52. package/dist/modules/ggnomad/index.js +1 -1
  53. package/dist/modules/govcitizenhub/index.cjs.map +1 -1
  54. package/dist/modules/govcitizenhub/index.js +1 -1
  55. package/dist/modules/groups/index.cjs.map +1 -1
  56. package/dist/modules/groups/index.js +1 -1
  57. package/dist/modules/headshotmarketing/index.cjs.map +1 -1
  58. package/dist/modules/headshotmarketing/index.js +1 -1
  59. package/dist/modules/health/index.cjs.map +1 -1
  60. package/dist/modules/health/index.js +1 -1
  61. package/dist/modules/hookmovies/index.cjs.map +1 -1
  62. package/dist/modules/hookmovies/index.js +1 -1
  63. package/dist/modules/housingvista/index.cjs.map +1 -1
  64. package/dist/modules/housingvista/index.js +1 -1
  65. package/dist/modules/integrations/index.cjs.map +1 -1
  66. package/dist/modules/integrations/index.js +1 -1
  67. package/dist/modules/intelwatchtower/index.cjs.map +1 -1
  68. package/dist/modules/intelwatchtower/index.js +1 -1
  69. package/dist/modules/kadaikodi/index.cjs.map +1 -1
  70. package/dist/modules/kadaikodi/index.js +1 -1
  71. package/dist/modules/labsofscience/index.cjs.map +1 -1
  72. package/dist/modules/labsofscience/index.js +1 -1
  73. package/dist/modules/manufacturedops/index.cjs.map +1 -1
  74. package/dist/modules/manufacturedops/index.js +1 -1
  75. package/dist/modules/movethewheels/index.cjs.map +1 -1
  76. package/dist/modules/movethewheels/index.js +1 -1
  77. package/dist/modules/mybodyshield/index.cjs.map +1 -1
  78. package/dist/modules/mybodyshield/index.js +1 -1
  79. package/dist/modules/notifications/index.cjs.map +1 -1
  80. package/dist/modules/notifications/index.js +1 -1
  81. package/dist/modules/organizations/index.cjs.map +1 -1
  82. package/dist/modules/organizations/index.js +1 -1
  83. package/dist/modules/planmagnet/index.cjs.map +1 -1
  84. package/dist/modules/planmagnet/index.js +1 -1
  85. package/dist/modules/products/index.cjs.map +1 -1
  86. package/dist/modules/products/index.js +1 -1
  87. package/dist/modules/proserviceworld/index.cjs.map +1 -1
  88. package/dist/modules/proserviceworld/index.js +1 -1
  89. package/dist/modules/rbac/index.cjs.map +1 -1
  90. package/dist/modules/rbac/index.js +1 -1
  91. package/dist/modules/sandbox/index.cjs.map +1 -1
  92. package/dist/modules/sandbox/index.js +1 -1
  93. package/dist/modules/scheduler/index.cjs.map +1 -1
  94. package/dist/modules/scheduler/index.js +1 -1
  95. package/dist/modules/security/index.cjs.map +1 -1
  96. package/dist/modules/security/index.js +1 -1
  97. package/dist/modules/semanticfed/index.cjs.map +1 -1
  98. package/dist/modules/semanticfed/index.js +1 -1
  99. package/dist/modules/store/index.cjs.map +1 -1
  100. package/dist/modules/store/index.js +1 -1
  101. package/dist/modules/subscriberbot/index.cjs.map +1 -1
  102. package/dist/modules/subscriberbot/index.js +1 -1
  103. package/dist/modules/support/index.cjs.map +1 -1
  104. package/dist/modules/support/index.js +1 -1
  105. package/dist/modules/tags/index.cjs.map +1 -1
  106. package/dist/modules/tags/index.js +1 -1
  107. package/dist/modules/technospam/index.cjs.map +1 -1
  108. package/dist/modules/technospam/index.js +1 -1
  109. package/dist/modules/theculturepost/index.cjs.map +1 -1
  110. package/dist/modules/theculturepost/index.js +1 -1
  111. package/dist/modules/theglobalfuel/index.cjs.map +1 -1
  112. package/dist/modules/theglobalfuel/index.js +1 -1
  113. package/dist/modules/timecampus/index.cjs.map +1 -1
  114. package/dist/modules/timecampus/index.js +1 -1
  115. package/dist/modules/tours/index.cjs.map +1 -1
  116. package/dist/modules/tours/index.js +1 -1
  117. package/dist/modules/vibecontrols/index.cjs.map +1 -1
  118. package/dist/modules/vibecontrols/index.js +2 -2
  119. package/dist/modules/workspaces/index.cjs.map +1 -1
  120. package/dist/modules/workspaces/index.js +1 -1
  121. package/package.json +28 -15
@@ -1,4 +1,4 @@
1
- import { mcpToolName, errorResult, jsonResult, mcpResourceUri, mcpPromptName } from '../../chunk-YOSQUY3M.js';
1
+ import { mcpToolName, errorResult, jsonResult, mcpResourceUri, mcpPromptName } from '../../chunk-BSNL65PZ.js';
2
2
  import { z } from 'zod';
3
3
 
4
4
  // src/modules/govcitizenhub/operations.ts
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/core/errors.ts","../../../src/core/tool-name.ts","../../../src/core/result.ts","../../../src/modules/groups/operations.ts","../../../src/modules/groups/tools.ts","../../../src/modules/groups/index.ts"],"names":["z","data"],"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,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AAO,KAAK,CAAC,CAAA;AAAA,SACzF;AAAA,MACF;AAAA,IACF;AAAA,GACF;AACF;;;AC1WA,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 * 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","/**\n * Groups module GraphQL operations.\n * Ported verbatim from cli-sdk/src/modules/groups/operations.ts.\n */\n\nexport const LIST_GROUPS = `\n query ListGroups($filter: GroupFilterInput, $first: Int, $after: String, $sort: GroupSortInput) {\n groups(filter: $filter, first: $first, after: $after, sort: $sort) {\n edges { node { id name groupType visibility status memberCount createdAt } }\n pageInfo { hasNextPage endCursor }\n }\n }\n`;\n\nexport const GET_GROUP = `\n query GetGroup($id: ID!) {\n group(id: $id) {\n id name description groupType visibility status scope membershipType memberCount createdAt updatedAt\n }\n }\n`;\n\nexport const CREATE_GROUP = `\n mutation CreateGroup($input: CreateGroupInput!) {\n createGroup(input: $input) {\n id name groupType visibility status\n }\n }\n`;\n\nexport const UPDATE_GROUP = `\n mutation UpdateGroup($id: ID!, $input: UpdateGroupInput!) {\n updateGroup(id: $id, input: $input) {\n id name description visibility status updatedAt\n }\n }\n`;\n\nexport const DELETE_GROUP = `\n mutation DeleteGroup($id: ID!) {\n deleteGroup(id: $id)\n }\n`;\n\nexport const ARCHIVE_GROUP = `\n mutation ArchiveGroup($id: ID!) {\n archiveGroup(id: $id) { id status }\n }\n`;\n\nexport const LIST_GROUP_MEMBERS = `\n query ListGroupMembers($groupId: ID!, $first: Int, $after: String) {\n groupMembers(groupId: $groupId, first: $first, after: $after) {\n edges { node { id entityId entityType role status joinedAt } }\n pageInfo { hasNextPage endCursor }\n }\n }\n`;\n\nexport const ADD_GROUP_MEMBERS = `\n mutation AddGroupMembers($groupId: ID!, $members: [AddMemberInput!]!) {\n addGroupMembers(groupId: $groupId, members: $members) {\n added skipped failed\n memberships { id entityId role status }\n }\n }\n`;\n\nexport const REMOVE_GROUP_MEMBERS = `\n mutation RemoveGroupMembers($groupId: ID!, $membershipIds: [ID!]!) {\n removeGroupMembers(groupId: $groupId, membershipIds: $membershipIds) {\n removed\n }\n }\n`;\n\nexport const GROUP_AUDIT_LOGS = `\n query GroupAuditLogs($groupId: ID!, $first: Int, $after: String) {\n groupAuditLogs(groupId: $groupId, first: $first, after: $after) {\n id action actorId summary createdAt\n }\n }\n`;\n\nexport const ENTITY_GROUPS = `\n query EntityGroups($entityId: ID!, $entityType: GroupEntityType!, $first: Int) {\n entityGroups(entityId: $entityId, entityType: $entityType, first: $first) {\n edges { node { id name groupType visibility memberCount } }\n }\n }\n`;\n","/**\n * Groups MCP tools — CRUD + members.{list,add,remove} + hierarchy + activity.\n * Surface mirrors cli-sdk/src/modules/groups/commands.ts.\n */\n\nimport { z } from 'zod';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { jsonResult, errorResult, mcpToolName, type McpContext } from '../../core/index.js';\nimport * as ops from './operations.js';\n\ninterface GroupNode {\n id: string;\n name: string;\n groupType?: string;\n visibility?: string;\n status?: string;\n memberCount?: number;\n createdAt?: string;\n}\n\ninterface MembershipNode {\n id: string;\n entityId: string;\n entityType?: string;\n role?: string;\n status?: string;\n joinedAt?: string;\n}\n\nconst GroupTypeEnum = z\n .enum(['STANDARD', 'TEAM', 'SECURITY', 'DISTRIBUTION', 'PROJECT', 'CUSTOM'])\n .describe('Group classification');\nconst VisibilityEnum = z.enum(['PUBLIC', 'PRIVATE', 'HIDDEN']).describe('Group visibility');\nconst ScopeEnum = z.enum(['workspace', 'organization']).describe('Scope of the group');\nconst MembershipTypeEnum = z\n .enum(['OPEN', 'INVITE_ONLY', 'RULE_BASED'])\n .describe('How membership is granted');\nconst StatusEnum = z.string().describe('Group status (will be uppercased)');\nconst EntityTypeEnum = z\n .enum(['USER', 'GROUP', 'BOT', 'INTEGRATION'])\n .describe('Entity type for membership');\nconst MemberRoleEnum = z.enum(['MEMBER', 'OWNER', 'ADMIN']).describe('Role within the group');\n\nexport function registerGroupsTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n server.registerTool(\n track(mcpToolName(ctx.productName, 'groups_list')),\n {\n title: 'List Groups',\n description: 'List groups with optional type/status filters and pagination.',\n inputSchema: {\n type: GroupTypeEnum.optional().describe('Filter by groupType'),\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 ({ type, status, limit }) => {\n try {\n const filter: Record<string, unknown> = {};\n if (type !== undefined) filter.groupType = type;\n if (status !== undefined) filter.status = status.toUpperCase();\n\n const data = await ctx.gql.workspace.request<{\n groups: { edges: Array<{ node: GroupNode }>; pageInfo: { hasNextPage: boolean } };\n }>(ops.LIST_GROUPS, {\n filter: Object.keys(filter).length > 0 ? filter : undefined,\n first: limit ?? 50,\n });\n return jsonResult({\n items: data.groups.edges.map((e) => e.node),\n pageInfo: data.groups.pageInfo,\n });\n } catch (error) {\n ctx.logger.error('groups_list failed', { error: String(error) });\n return errorResult(\n `Failed to list groups: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'groups_get')),\n {\n title: 'Get Group',\n description: 'Get a group by its ID.',\n inputSchema: { id: z.string().describe('Group ID') },\n },\n async ({ id }) => {\n try {\n const data = await ctx.gql.workspace.request<{ group: GroupNode | null }>(ops.GET_GROUP, {\n id,\n });\n if (!data.group) {\n return errorResult(`Group ${id} not found`);\n }\n return jsonResult(data.group);\n } catch (error) {\n ctx.logger.error('groups_get failed', { error: String(error) });\n return errorResult(\n `Failed to get group: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'groups_create')),\n {\n title: 'Create Group',\n description: 'Create a new group.',\n inputSchema: {\n name: z.string().describe('Group name'),\n description: z.string().optional().describe('Group description'),\n groupType: GroupTypeEnum.optional().describe('Group type (default STANDARD)'),\n visibility: VisibilityEnum.optional().describe('Visibility (default PRIVATE)'),\n scope: ScopeEnum.optional().describe('Scope (default workspace)'),\n membershipType: MembershipTypeEnum.optional().describe(\n 'Membership type (default INVITE_ONLY)',\n ),\n },\n },\n async ({ name, description, groupType, visibility, scope, membershipType }) => {\n try {\n const input: Record<string, unknown> = {\n name,\n groupType: groupType ?? 'STANDARD',\n visibility: visibility ?? 'PRIVATE',\n scope: scope ?? 'workspace',\n membershipType: membershipType ?? 'INVITE_ONLY',\n };\n if (description !== undefined) input.description = description;\n\n const data = await ctx.gql.workspace.request<{ createGroup: GroupNode }>(ops.CREATE_GROUP, {\n input,\n });\n return jsonResult(data.createGroup);\n } catch (error) {\n ctx.logger.error('groups_create failed', { error: String(error) });\n return errorResult(\n `Failed to create group: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'groups_update')),\n {\n title: 'Update Group',\n description: 'Update a group. At least one mutable field must be provided.',\n inputSchema: {\n id: z.string().describe('Group ID'),\n name: z.string().optional().describe('Updated name'),\n description: z.string().optional().describe('Updated description'),\n visibility: VisibilityEnum.optional().describe('Updated visibility'),\n status: StatusEnum.optional(),\n },\n },\n async ({ id, name, description, visibility, status }) => {\n try {\n const input: Record<string, unknown> = {};\n if (name !== undefined) input.name = name;\n if (description !== undefined) input.description = description;\n if (visibility !== undefined) input.visibility = visibility;\n if (status !== undefined) input.status = status.toUpperCase();\n if (Object.keys(input).length === 0) {\n return errorResult(\n 'No updates specified — provide at least one of name/description/visibility/status',\n );\n }\n const data = await ctx.gql.workspace.request<{ updateGroup: GroupNode }>(ops.UPDATE_GROUP, {\n id,\n input,\n });\n return jsonResult(data.updateGroup);\n } catch (error) {\n ctx.logger.error('groups_update failed', { error: String(error) });\n return errorResult(\n `Failed to update group: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'groups_delete')),\n {\n title: 'Delete Group',\n description: 'Delete a group. Use archive=true for a soft delete (status change only).',\n inputSchema: {\n id: z.string().describe('Group ID'),\n archive: z.boolean().optional().describe('Archive instead of hard delete (default false)'),\n },\n },\n async ({ id, archive }) => {\n try {\n if (archive === true) {\n const data = await ctx.gql.workspace.request<{\n archiveGroup: { id: string; status: string };\n }>(ops.ARCHIVE_GROUP, { id });\n return jsonResult({ archived: true, group: data.archiveGroup });\n }\n const data = await ctx.gql.workspace.request<{ deleteGroup: boolean }>(ops.DELETE_GROUP, {\n id,\n });\n return jsonResult({ deleted: data.deleteGroup, groupId: id });\n } catch (error) {\n ctx.logger.error('groups_delete failed', { error: String(error) });\n return errorResult(\n `Failed to delete group: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Members ─────────────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'groups_members_list')),\n {\n title: 'List Group Members',\n description: 'List members of a group.',\n inputSchema: {\n groupId: z.string().describe('Group ID'),\n limit: z.number().optional().describe('Page size (default 100)'),\n },\n },\n async ({ groupId, limit }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n groupMembers: {\n edges: Array<{ node: MembershipNode }>;\n pageInfo: { hasNextPage: boolean; endCursor?: string };\n };\n }>(ops.LIST_GROUP_MEMBERS, { groupId, first: limit ?? 100 });\n return jsonResult({\n items: data.groupMembers.edges.map((e) => e.node),\n pageInfo: data.groupMembers.pageInfo,\n });\n } catch (error) {\n ctx.logger.error('groups_members_list failed', { error: String(error) });\n return errorResult(\n `Failed to list group members: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'groups_members_add')),\n {\n title: 'Add Group Member',\n description: 'Add a single member to a group.',\n inputSchema: {\n groupId: z.string().describe('Group ID'),\n entityId: z.string().describe('Entity (user/group/bot/integration) ID to add'),\n entityType: EntityTypeEnum.optional().describe('Entity type (default USER)'),\n role: MemberRoleEnum.optional().describe('Role (default MEMBER)'),\n },\n },\n async ({ groupId, entityId, entityType, role }) => {\n try {\n const member: Record<string, unknown> = {\n entityId,\n entityType: entityType ?? 'USER',\n role: role ?? 'MEMBER',\n };\n const data = await ctx.gql.workspace.request<{\n addGroupMembers: {\n added: number;\n skipped: number;\n failed: number;\n memberships: MembershipNode[];\n };\n }>(ops.ADD_GROUP_MEMBERS, { groupId, members: [member] });\n return jsonResult(data.addGroupMembers);\n } catch (error) {\n ctx.logger.error('groups_members_add failed', { error: String(error) });\n return errorResult(\n `Failed to add group member: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'groups_members_remove')),\n {\n title: 'Remove Group Members',\n description: 'Remove one or more members from a group by membership ID.',\n inputSchema: {\n groupId: z.string().describe('Group ID'),\n membershipIds: z.array(z.string()).describe('Membership IDs to remove'),\n },\n },\n async ({ groupId, membershipIds }) => {\n try {\n if (membershipIds.length === 0) {\n return errorResult('At least one membershipId is required');\n }\n const data = await ctx.gql.workspace.request<{\n removeGroupMembers: { removed: number };\n }>(ops.REMOVE_GROUP_MEMBERS, { groupId, membershipIds });\n return jsonResult(data.removeGroupMembers);\n } catch (error) {\n ctx.logger.error('groups_members_remove failed', { error: String(error) });\n return errorResult(\n `Failed to remove group members: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Hierarchy & activity ────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'groups_hierarchy')),\n {\n title: 'Entity Group Hierarchy',\n description: 'Show all groups an entity (user/group) belongs to.',\n inputSchema: {\n entityId: z.string().describe('Entity ID (user/group)'),\n entityType: z.enum(['USER', 'GROUP']).optional().describe('Entity type (default USER)'),\n limit: z.number().optional().describe('Page size (default 100)'),\n },\n },\n async ({ entityId, entityType, limit }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n entityGroups: { edges: Array<{ node: GroupNode }> };\n }>(ops.ENTITY_GROUPS, {\n entityId,\n entityType: entityType ?? 'USER',\n first: limit ?? 100,\n });\n return jsonResult(data.entityGroups.edges.map((e) => e.node));\n } catch (error) {\n ctx.logger.error('groups_hierarchy failed', { error: String(error) });\n return errorResult(\n `Failed to get group hierarchy: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'groups_activity')),\n {\n title: 'Group Audit Log',\n description: 'Audit log for a group.',\n inputSchema: {\n groupId: z.string().describe('Group ID'),\n limit: z.number().optional().describe('Page size (default 100)'),\n },\n },\n async ({ groupId, limit }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n groupAuditLogs: Array<Record<string, unknown>>;\n }>(ops.GROUP_AUDIT_LOGS, { groupId, first: limit ?? 100 });\n return jsonResult(data.groupAuditLogs);\n } catch (error) {\n ctx.logger.error('groups_activity failed', { error: String(error) });\n return errorResult(\n `Failed to get group activity: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n}\n","/**\n * Groups module — workspace groups CRUD + members + hierarchy + activity.\n * Surface mirrors cli-sdk/src/modules/groups/.\n */\n\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport type { McpContext, McpModule, ModuleRegistration } from '../../core/index.js';\nimport { registerGroupsTools } from './tools.js';\n\nconst groupsModule: McpModule = {\n id: 'groups',\n version: '0.0.1',\n displayName: 'Groups',\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 registerGroupsTools(server, ctx, track);\n\n return { tools, resources: [], prompts: [] };\n },\n};\n\nexport default groupsModule;\n"]}
1
+ {"version":3,"sources":["../../../src/core/errors.ts","../../../src/core/tool-name.ts","../../../src/core/result.ts","../../../src/modules/groups/operations.ts","../../../src/modules/groups/tools.ts","../../../src/modules/groups/index.ts"],"names":["z","data"],"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,GAA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AG,CAAA;AACnE,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;;;AC1WA,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 * Tool / resource / prompt naming helpers.\n *\n * Mandatory product prefix avoids collisions when Claude Desktop runs\n * multiple MCP servers concurrently (typical setup is ~6).\n *\n * Tool names are capped at 63 characters — Claude Desktop pre-1.x\n * truncated at 64 in some versions.\n */\n\nimport { McpInternalError } from './errors.js';\n\nconst MAX_TOOL_NAME_LENGTH = 63;\n\nfunction assertSafeName(name: string, kind: 'tool' | 'resource' | 'prompt'): string {\n if (kind === 'tool' && name.length > MAX_TOOL_NAME_LENGTH) {\n throw new McpInternalError(\n `Tool name '${name}' exceeds ${MAX_TOOL_NAME_LENGTH} characters (some MCP clients truncate at 64).`,\n );\n }\n return name;\n}\n\n/**\n * Build a tool name. Format: `<productName>_<...parts>` (snake_case).\n * Example: mcpToolName('vibecontrols', 'vibes', 'list') -> 'vibecontrols_vibes_list'\n */\nexport function mcpToolName(productName: string, ...parts: string[]): string {\n if (!productName) {\n throw new McpInternalError('mcpToolName: productName is required');\n }\n const name = [productName, ...parts].filter(Boolean).join('_');\n return assertSafeName(name, 'tool');\n}\n\n/**\n * Build a resource URI. Format: `<productName>://<...parts>`.\n * Example: mcpResourceUri('vibecontrols', 'schema') -> 'vibecontrols://schema'\n */\nexport function mcpResourceUri(productName: string, ...parts: string[]): string {\n if (!productName) {\n throw new McpInternalError('mcpResourceUri: productName is required');\n }\n return `${productName}://${parts.filter(Boolean).join('/')}`;\n}\n\n/**\n * Build a prompt name. Format: `<productName>-<...parts>` (kebab-case).\n * Example: mcpPromptName('vibecontrols', 'setup') -> 'vibecontrols-setup'\n */\nexport function mcpPromptName(productName: string, ...parts: string[]): string {\n if (!productName) {\n throw new McpInternalError('mcpPromptName: productName is required');\n }\n return [productName, ...parts].filter(Boolean).join('-');\n}\n\nexport const TOOL_NAME_LIMIT = MAX_TOOL_NAME_LENGTH;\n\n/**\n * Name-based hint heuristics for MCP `annotations` (readOnlyHint /\n * destructiveHint). Used by tool-governance.ts to auto-fill annotations for\n * the fleet of product modules that call `server.registerTool` directly\n * (bypassing the `registerTool()` core helper) and so never set them\n * explicitly today (BOFF-3903). Deliberately conservative — matched against\n * whole `_`-delimited segments so e.g. `timeentries_delete` and\n * `pomodoro_delete_goal` match, but a hypothetical `undeletable_check`\n * would not.\n *\n * A module can always override the inference by passing an explicit\n * `annotations` object to `registerTool()` / `server.registerTool()`.\n */\nconst DESTRUCTIVE_NAME_SEGMENT = /(?:^|_)delete(?:_|$)/i;\nconst READ_ONLY_NAME_SEGMENT = /(?:^|_)(?:list|get|search|check|read|count|stats|by_date)(?:_|$)/i;\n\n/** True when a tool name looks destructive (irreversibly deletes data) by naming convention. */\nexport function inferDestructiveHint(toolName: string): boolean {\n return DESTRUCTIVE_NAME_SEGMENT.test(toolName);\n}\n\n/**\n * True when a tool name looks read-only by naming convention. Never true for\n * a name that also looks destructive (a tool can't be both).\n */\nexport function inferReadOnlyHint(toolName: string): boolean {\n return !inferDestructiveHint(toolName) && READ_ONLY_NAME_SEGMENT.test(toolName);\n}\n","/**\n * MCP tool result helpers + central handler.\n *\n * Modules NEVER call server.registerTool directly — they use registerTool()\n * from this module so the central try/catch wraps the handler and:\n * - maps thrown McpUserError / McpAuthError / McpInternalError to\n * MCP-protocol-compliant `{ isError: true, content: [...] }` shapes\n * - threads `_meta.progressToken` into ctx.progress for long ops\n * - emits a structured log line on every error\n * - never leaks `cause` from McpInternalError to the client\n *\n * This is the analog of cli-sdk's createProgram() central error handler.\n */\n\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport type { ZodRawShape } from 'zod';\nimport type { McpContext } from './context.js';\nimport { McpAuthError, McpInternalError, McpUserError } from './errors.js';\nimport type { ToolAnnotations } from './tool-governance.js';\n\nexport interface ToolTextContent {\n type: 'text';\n text: string;\n [k: string]: unknown;\n}\n\nexport interface ToolResult {\n content: ToolTextContent[];\n isError?: boolean;\n structuredContent?: Record<string, unknown>;\n [k: string]: unknown;\n}\n\nexport interface ToolMeta {\n progressToken?: string | number;\n}\n\n/**\n * Build a successful tool result with JSON content (pretty-printed).\n */\nexport function jsonResult(data: unknown, structured?: Record<string, unknown>): ToolResult {\n const result: ToolResult = {\n content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],\n };\n if (structured !== undefined) {\n result.structuredContent = structured;\n }\n return result;\n}\n\n/**\n * Build a successful tool result with plain text content.\n */\nexport function textResult(text: string): ToolResult {\n return { content: [{ type: 'text', text }] };\n}\n\n/**\n * Build an error tool result. Honors MCP's `{ isError: true, content }` shape.\n * Optional hint is appended on a new line so the LLM can react.\n */\nexport function errorResult(message: string, hint?: string): ToolResult {\n const text = hint ? `${message}\\n\\nHint: ${hint}` : message;\n return { content: [{ type: 'text', text }], isError: true };\n}\n\nexport interface ToolMetadata {\n title: string;\n description: string;\n inputSchema?: ZodRawShape;\n /**\n * Explicit MCP annotations (readOnlyHint / destructiveHint / ...). Optional\n * — when omitted, `wrapServerWithToolGovernance` (applied centrally in\n * `createMcpServer`) infers them from the tool name. Set this to override\n * the inference for a tool whose name doesn't match the naming convention.\n */\n annotations?: ToolAnnotations;\n}\n\nexport type ToolHandler<TArgs = Record<string, unknown>> = (\n args: TArgs,\n ctx: McpContext,\n meta: ToolMeta,\n) => Promise<unknown>;\n\n/**\n * Register a tool with the central error wrapper.\n *\n * The handler returns a plain value or void. The wrapper:\n * - wraps non-undefined returns in jsonResult()\n * - if the value already looks like a ToolResult (has `content`), passes through\n * - catches McpAuthError / McpUserError / McpInternalError / generic Error\n * - logs every error via ctx.logger.error\n */\nexport function registerTool<TArgs extends Record<string, unknown>>(\n server: McpServer,\n ctx: McpContext,\n name: string,\n metadata: ToolMetadata,\n handler: ToolHandler<TArgs>,\n): void {\n const sdkConfig = {\n title: metadata.title,\n description: metadata.description,\n ...(metadata.inputSchema ? { inputSchema: metadata.inputSchema } : {}),\n ...(metadata.annotations ? { annotations: metadata.annotations } : {}),\n };\n\n // The MCP SDK's registerTool signature is `(name, config, handler)`. The\n // handler arity depends on whether inputSchema is present (1-arg without,\n // 2-arg with). We accept a unified handler shape and dispatch at runtime.\n // The SDK's typing is strict and conditional on the inputSchema generic;\n // bypass with a cast since runtime acceptance is unconditional.\n const wrapped = async (...callbackArgs: unknown[]): Promise<ToolResult> => {\n const hasArgs = callbackArgs.length === 2;\n const args = (hasArgs ? callbackArgs[0] : {}) as TArgs;\n const extra = (hasArgs ? callbackArgs[1] : callbackArgs[0]) as\n { _meta?: { progressToken?: string | number } } | undefined;\n\n const progressToken = extra?._meta?.progressToken;\n const meta: ToolMeta = progressToken !== undefined ? { progressToken } : {};\n\n try {\n const result = await handler(args, ctx, meta);\n if (isToolResult(result)) return result;\n if (result === undefined) return textResult('OK');\n return jsonResult(result);\n } catch (error) {\n return mapErrorToResult(error, ctx, name);\n }\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (server as any).registerTool(name, sdkConfig, wrapped);\n}\n\nfunction isToolResult(value: unknown): value is ToolResult {\n return (\n !!value &&\n typeof value === 'object' &&\n 'content' in value &&\n Array.isArray((value as ToolResult).content)\n );\n}\n\nfunction mapErrorToResult(error: unknown, ctx: McpContext, toolName: string): ToolResult {\n if (error instanceof McpAuthError) {\n ctx.logger.warn(`${toolName}: auth required`, { message: error.message });\n return errorResult(error.message, error.hint);\n }\n if (error instanceof McpUserError) {\n ctx.logger.info(`${toolName}: user error`, { message: error.message });\n return errorResult(error.message, error.hint);\n }\n if (error instanceof McpInternalError) {\n ctx.logger.error(`${toolName}: internal error`, {\n message: error.message,\n cause: stringifyCause(error.cause),\n });\n return errorResult(`Internal error in ${toolName}.`);\n }\n const message = error instanceof Error ? error.message : String(error);\n ctx.logger.error(`${toolName}: unhandled error`, { message });\n return errorResult(`${toolName}: ${message}`);\n}\n\nfunction stringifyCause(cause: unknown): string | undefined {\n if (cause === undefined || cause === null) return undefined;\n if (cause instanceof Error) return cause.message;\n try {\n return JSON.stringify(cause);\n } catch {\n return String(cause);\n }\n}\n","/**\n * Groups module GraphQL operations.\n * Ported verbatim from cli-sdk/src/modules/groups/operations.ts.\n */\n\nexport const LIST_GROUPS = `\n query ListGroups($filter: GroupFilterInput, $first: Int, $after: String, $sort: GroupSortInput) {\n groups(filter: $filter, first: $first, after: $after, sort: $sort) {\n edges { node { id name groupType visibility status memberCount createdAt } }\n pageInfo { hasNextPage endCursor }\n }\n }\n`;\n\nexport const GET_GROUP = `\n query GetGroup($id: ID!) {\n group(id: $id) {\n id name description groupType visibility status scope membershipType memberCount createdAt updatedAt\n }\n }\n`;\n\nexport const CREATE_GROUP = `\n mutation CreateGroup($input: CreateGroupInput!) {\n createGroup(input: $input) {\n id name groupType visibility status\n }\n }\n`;\n\nexport const UPDATE_GROUP = `\n mutation UpdateGroup($id: ID!, $input: UpdateGroupInput!) {\n updateGroup(id: $id, input: $input) {\n id name description visibility status updatedAt\n }\n }\n`;\n\nexport const DELETE_GROUP = `\n mutation DeleteGroup($id: ID!) {\n deleteGroup(id: $id)\n }\n`;\n\nexport const ARCHIVE_GROUP = `\n mutation ArchiveGroup($id: ID!) {\n archiveGroup(id: $id) { id status }\n }\n`;\n\nexport const LIST_GROUP_MEMBERS = `\n query ListGroupMembers($groupId: ID!, $first: Int, $after: String) {\n groupMembers(groupId: $groupId, first: $first, after: $after) {\n edges { node { id entityId entityType role status joinedAt } }\n pageInfo { hasNextPage endCursor }\n }\n }\n`;\n\nexport const ADD_GROUP_MEMBERS = `\n mutation AddGroupMembers($groupId: ID!, $members: [AddMemberInput!]!) {\n addGroupMembers(groupId: $groupId, members: $members) {\n added skipped failed\n memberships { id entityId role status }\n }\n }\n`;\n\nexport const REMOVE_GROUP_MEMBERS = `\n mutation RemoveGroupMembers($groupId: ID!, $membershipIds: [ID!]!) {\n removeGroupMembers(groupId: $groupId, membershipIds: $membershipIds) {\n removed\n }\n }\n`;\n\nexport const GROUP_AUDIT_LOGS = `\n query GroupAuditLogs($groupId: ID!, $first: Int, $after: String) {\n groupAuditLogs(groupId: $groupId, first: $first, after: $after) {\n id action actorId summary createdAt\n }\n }\n`;\n\nexport const ENTITY_GROUPS = `\n query EntityGroups($entityId: ID!, $entityType: GroupEntityType!, $first: Int) {\n entityGroups(entityId: $entityId, entityType: $entityType, first: $first) {\n edges { node { id name groupType visibility memberCount } }\n }\n }\n`;\n","/**\n * Groups MCP tools — CRUD + members.{list,add,remove} + hierarchy + activity.\n * Surface mirrors cli-sdk/src/modules/groups/commands.ts.\n */\n\nimport { z } from 'zod';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { jsonResult, errorResult, mcpToolName, type McpContext } from '../../core/index.js';\nimport * as ops from './operations.js';\n\ninterface GroupNode {\n id: string;\n name: string;\n groupType?: string;\n visibility?: string;\n status?: string;\n memberCount?: number;\n createdAt?: string;\n}\n\ninterface MembershipNode {\n id: string;\n entityId: string;\n entityType?: string;\n role?: string;\n status?: string;\n joinedAt?: string;\n}\n\nconst GroupTypeEnum = z\n .enum(['STANDARD', 'TEAM', 'SECURITY', 'DISTRIBUTION', 'PROJECT', 'CUSTOM'])\n .describe('Group classification');\nconst VisibilityEnum = z.enum(['PUBLIC', 'PRIVATE', 'HIDDEN']).describe('Group visibility');\nconst ScopeEnum = z.enum(['workspace', 'organization']).describe('Scope of the group');\nconst MembershipTypeEnum = z\n .enum(['OPEN', 'INVITE_ONLY', 'RULE_BASED'])\n .describe('How membership is granted');\nconst StatusEnum = z.string().describe('Group status (will be uppercased)');\nconst EntityTypeEnum = z\n .enum(['USER', 'GROUP', 'BOT', 'INTEGRATION'])\n .describe('Entity type for membership');\nconst MemberRoleEnum = z.enum(['MEMBER', 'OWNER', 'ADMIN']).describe('Role within the group');\n\nexport function registerGroupsTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n server.registerTool(\n track(mcpToolName(ctx.productName, 'groups_list')),\n {\n title: 'List Groups',\n description: 'List groups with optional type/status filters and pagination.',\n inputSchema: {\n type: GroupTypeEnum.optional().describe('Filter by groupType'),\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 ({ type, status, limit }) => {\n try {\n const filter: Record<string, unknown> = {};\n if (type !== undefined) filter.groupType = type;\n if (status !== undefined) filter.status = status.toUpperCase();\n\n const data = await ctx.gql.workspace.request<{\n groups: { edges: Array<{ node: GroupNode }>; pageInfo: { hasNextPage: boolean } };\n }>(ops.LIST_GROUPS, {\n filter: Object.keys(filter).length > 0 ? filter : undefined,\n first: limit ?? 50,\n });\n return jsonResult({\n items: data.groups.edges.map((e) => e.node),\n pageInfo: data.groups.pageInfo,\n });\n } catch (error) {\n ctx.logger.error('groups_list failed', { error: String(error) });\n return errorResult(\n `Failed to list groups: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'groups_get')),\n {\n title: 'Get Group',\n description: 'Get a group by its ID.',\n inputSchema: { id: z.string().describe('Group ID') },\n },\n async ({ id }) => {\n try {\n const data = await ctx.gql.workspace.request<{ group: GroupNode | null }>(ops.GET_GROUP, {\n id,\n });\n if (!data.group) {\n return errorResult(`Group ${id} not found`);\n }\n return jsonResult(data.group);\n } catch (error) {\n ctx.logger.error('groups_get failed', { error: String(error) });\n return errorResult(\n `Failed to get group: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'groups_create')),\n {\n title: 'Create Group',\n description: 'Create a new group.',\n inputSchema: {\n name: z.string().describe('Group name'),\n description: z.string().optional().describe('Group description'),\n groupType: GroupTypeEnum.optional().describe('Group type (default STANDARD)'),\n visibility: VisibilityEnum.optional().describe('Visibility (default PRIVATE)'),\n scope: ScopeEnum.optional().describe('Scope (default workspace)'),\n membershipType: MembershipTypeEnum.optional().describe(\n 'Membership type (default INVITE_ONLY)',\n ),\n },\n },\n async ({ name, description, groupType, visibility, scope, membershipType }) => {\n try {\n const input: Record<string, unknown> = {\n name,\n groupType: groupType ?? 'STANDARD',\n visibility: visibility ?? 'PRIVATE',\n scope: scope ?? 'workspace',\n membershipType: membershipType ?? 'INVITE_ONLY',\n };\n if (description !== undefined) input.description = description;\n\n const data = await ctx.gql.workspace.request<{ createGroup: GroupNode }>(ops.CREATE_GROUP, {\n input,\n });\n return jsonResult(data.createGroup);\n } catch (error) {\n ctx.logger.error('groups_create failed', { error: String(error) });\n return errorResult(\n `Failed to create group: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'groups_update')),\n {\n title: 'Update Group',\n description: 'Update a group. At least one mutable field must be provided.',\n inputSchema: {\n id: z.string().describe('Group ID'),\n name: z.string().optional().describe('Updated name'),\n description: z.string().optional().describe('Updated description'),\n visibility: VisibilityEnum.optional().describe('Updated visibility'),\n status: StatusEnum.optional(),\n },\n },\n async ({ id, name, description, visibility, status }) => {\n try {\n const input: Record<string, unknown> = {};\n if (name !== undefined) input.name = name;\n if (description !== undefined) input.description = description;\n if (visibility !== undefined) input.visibility = visibility;\n if (status !== undefined) input.status = status.toUpperCase();\n if (Object.keys(input).length === 0) {\n return errorResult(\n 'No updates specified — provide at least one of name/description/visibility/status',\n );\n }\n const data = await ctx.gql.workspace.request<{ updateGroup: GroupNode }>(ops.UPDATE_GROUP, {\n id,\n input,\n });\n return jsonResult(data.updateGroup);\n } catch (error) {\n ctx.logger.error('groups_update failed', { error: String(error) });\n return errorResult(\n `Failed to update group: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'groups_delete')),\n {\n title: 'Delete Group',\n description: 'Delete a group. Use archive=true for a soft delete (status change only).',\n inputSchema: {\n id: z.string().describe('Group ID'),\n archive: z.boolean().optional().describe('Archive instead of hard delete (default false)'),\n },\n },\n async ({ id, archive }) => {\n try {\n if (archive === true) {\n const data = await ctx.gql.workspace.request<{\n archiveGroup: { id: string; status: string };\n }>(ops.ARCHIVE_GROUP, { id });\n return jsonResult({ archived: true, group: data.archiveGroup });\n }\n const data = await ctx.gql.workspace.request<{ deleteGroup: boolean }>(ops.DELETE_GROUP, {\n id,\n });\n return jsonResult({ deleted: data.deleteGroup, groupId: id });\n } catch (error) {\n ctx.logger.error('groups_delete failed', { error: String(error) });\n return errorResult(\n `Failed to delete group: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Members ─────────────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'groups_members_list')),\n {\n title: 'List Group Members',\n description: 'List members of a group.',\n inputSchema: {\n groupId: z.string().describe('Group ID'),\n limit: z.number().optional().describe('Page size (default 100)'),\n },\n },\n async ({ groupId, limit }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n groupMembers: {\n edges: Array<{ node: MembershipNode }>;\n pageInfo: { hasNextPage: boolean; endCursor?: string };\n };\n }>(ops.LIST_GROUP_MEMBERS, { groupId, first: limit ?? 100 });\n return jsonResult({\n items: data.groupMembers.edges.map((e) => e.node),\n pageInfo: data.groupMembers.pageInfo,\n });\n } catch (error) {\n ctx.logger.error('groups_members_list failed', { error: String(error) });\n return errorResult(\n `Failed to list group members: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'groups_members_add')),\n {\n title: 'Add Group Member',\n description: 'Add a single member to a group.',\n inputSchema: {\n groupId: z.string().describe('Group ID'),\n entityId: z.string().describe('Entity (user/group/bot/integration) ID to add'),\n entityType: EntityTypeEnum.optional().describe('Entity type (default USER)'),\n role: MemberRoleEnum.optional().describe('Role (default MEMBER)'),\n },\n },\n async ({ groupId, entityId, entityType, role }) => {\n try {\n const member: Record<string, unknown> = {\n entityId,\n entityType: entityType ?? 'USER',\n role: role ?? 'MEMBER',\n };\n const data = await ctx.gql.workspace.request<{\n addGroupMembers: {\n added: number;\n skipped: number;\n failed: number;\n memberships: MembershipNode[];\n };\n }>(ops.ADD_GROUP_MEMBERS, { groupId, members: [member] });\n return jsonResult(data.addGroupMembers);\n } catch (error) {\n ctx.logger.error('groups_members_add failed', { error: String(error) });\n return errorResult(\n `Failed to add group member: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'groups_members_remove')),\n {\n title: 'Remove Group Members',\n description: 'Remove one or more members from a group by membership ID.',\n inputSchema: {\n groupId: z.string().describe('Group ID'),\n membershipIds: z.array(z.string()).describe('Membership IDs to remove'),\n },\n },\n async ({ groupId, membershipIds }) => {\n try {\n if (membershipIds.length === 0) {\n return errorResult('At least one membershipId is required');\n }\n const data = await ctx.gql.workspace.request<{\n removeGroupMembers: { removed: number };\n }>(ops.REMOVE_GROUP_MEMBERS, { groupId, membershipIds });\n return jsonResult(data.removeGroupMembers);\n } catch (error) {\n ctx.logger.error('groups_members_remove failed', { error: String(error) });\n return errorResult(\n `Failed to remove group members: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Hierarchy & activity ────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'groups_hierarchy')),\n {\n title: 'Entity Group Hierarchy',\n description: 'Show all groups an entity (user/group) belongs to.',\n inputSchema: {\n entityId: z.string().describe('Entity ID (user/group)'),\n entityType: z.enum(['USER', 'GROUP']).optional().describe('Entity type (default USER)'),\n limit: z.number().optional().describe('Page size (default 100)'),\n },\n },\n async ({ entityId, entityType, limit }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n entityGroups: { edges: Array<{ node: GroupNode }> };\n }>(ops.ENTITY_GROUPS, {\n entityId,\n entityType: entityType ?? 'USER',\n first: limit ?? 100,\n });\n return jsonResult(data.entityGroups.edges.map((e) => e.node));\n } catch (error) {\n ctx.logger.error('groups_hierarchy failed', { error: String(error) });\n return errorResult(\n `Failed to get group hierarchy: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'groups_activity')),\n {\n title: 'Group Audit Log',\n description: 'Audit log for a group.',\n inputSchema: {\n groupId: z.string().describe('Group ID'),\n limit: z.number().optional().describe('Page size (default 100)'),\n },\n },\n async ({ groupId, limit }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n groupAuditLogs: Array<Record<string, unknown>>;\n }>(ops.GROUP_AUDIT_LOGS, { groupId, first: limit ?? 100 });\n return jsonResult(data.groupAuditLogs);\n } catch (error) {\n ctx.logger.error('groups_activity failed', { error: String(error) });\n return errorResult(\n `Failed to get group activity: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n}\n","/**\n * Groups module — workspace groups CRUD + members + hierarchy + activity.\n * Surface mirrors cli-sdk/src/modules/groups/.\n */\n\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport type { McpContext, McpModule, ModuleRegistration } from '../../core/index.js';\nimport { registerGroupsTools } from './tools.js';\n\nconst groupsModule: McpModule = {\n id: 'groups',\n version: '0.0.1',\n displayName: 'Groups',\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 registerGroupsTools(server, ctx, track);\n\n return { tools, resources: [], prompts: [] };\n },\n};\n\nexport default groupsModule;\n"]}
@@ -1,4 +1,4 @@
1
- import { mcpToolName, jsonResult, errorResult } from '../../chunk-YOSQUY3M.js';
1
+ import { mcpToolName, jsonResult, errorResult } from '../../chunk-BSNL65PZ.js';
2
2
  import { z } from 'zod';
3
3
 
4
4
  // src/modules/groups/operations.ts