@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.
- 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.js +1 -1
- package/dist/index.cjs.map +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.map +1 -1
- package/dist/modules/artistrybase/index.js +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.map +1 -1
- package/dist/modules/ecoimpacthub/index.js +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.map +1 -1
- package/dist/modules/theculturepost/index.js +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.map +1 -1
- package/dist/modules/timecampus/index.js +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/package.json +28 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/core/errors.ts","../../../src/core/tool-name.ts","../../../src/core/result.ts","../../../src/modules/manufacturedops/operations.ts","../../../src/modules/manufacturedops/tools/shared.ts","../../../src/modules/manufacturedops/tools/production.ts","../../../src/modules/manufacturedops/tools/quality.ts","../../../src/modules/manufacturedops/tools/maintenance.ts","../../../src/modules/manufacturedops/tools/health.ts","../../../src/modules/manufacturedops/resources.ts","../../../src/modules/manufacturedops/prompts.ts","../../../src/modules/manufacturedops/index.ts"],"names":["z"],"mappings":";;;;;;;;;;;AA8BO,IAAM,gBAAA,GAAN,cAA+B,KAAA,CAAM;AAAA,EACjB,KAAA;AAAA,EAEzB,WAAA,CAAY,SAAiB,KAAA,EAAiB;AAC5C,IAAA,KAAA,CAAM,OAAO,CAAA;AACb,IAAA,IAAA,CAAK,IAAA,GAAO,kBAAA;AACZ,IAAA,IAAA,CAAK,KAAA,GAAQ,KAAA;AAAA,EACf;AACF,CAAA;;;AC1BA,IAAM,oBAAA,GAAuB,EAAA;AAE7B,SAAS,cAAA,CAAe,MAAc,IAAA,EAA8C;AAClF,EAAA,IAAuB,IAAA,CAAK,MAAA,GAAS,oBAAA,EAAsB;AACzD,IAAA,MAAM,IAAI,gBAAA;AAAA,MACR,CAAA,WAAA,EAAc,IAAI,CAAA,UAAA,EAAa,oBAAoB,CAAA,8CAAA;AAAA,KACrD;AAAA,EACF;AACA,EAAA,OAAO,IAAA;AACT;AAMO,SAAS,WAAA,CAAY,gBAAwB,KAAA,EAAyB;AAC3E,EAAA,IAAI,CAAC,WAAA,EAAa;AAChB,IAAA,MAAM,IAAI,iBAAiB,sCAAsC,CAAA;AAAA,EACnE;AACA,EAAA,MAAM,IAAA,G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,YAAsB,EAAC;AAC7B,IAAA,MAAM,UAAoB,EAAC;AAE3B,IAAA,MAAM,SAAA,GAAY,CAAC,CAAA,KAAsB;AACvC,MAAA,KAAA,CAAM,KAAK,CAAC,CAAA;AACZ,MAAA,OAAO,CAAA;AAAA,IACT,CAAA;AACA,IAAA,MAAM,aAAA,GAAgB,CAAC,GAAA,KAAwB;AAC7C,MAAA,SAAA,CAAU,KAAK,GAAG,CAAA;AAClB,MAAA,OAAO,GAAA;AAAA,IACT,CAAA;AACA,IAAA,MAAM,WAAA,GAAc,CAAC,CAAA,KAAsB;AACzC,MAAA,OAAA,CAAQ,KAAK,CAAC,CAAA;AACd,MAAA,OAAO,CAAA;AAAA,IACT,CAAA;AAEA,IAAA,uBAAA,CAAwB,MAAA,EAAQ,KAAK,SAAS,CAAA;AAC9C,IAAA,oBAAA,CAAqB,MAAA,EAAQ,KAAK,SAAS,CAAA;AAC3C,IAAA,wBAAA,CAAyB,MAAA,EAAQ,KAAK,SAAS,CAAA;AAC/C,IAAA,mBAAA,CAAoB,MAAA,EAAQ,KAAK,SAAS,CAAA;AAE1C,IAAA,gCAAA,CAAiC,MAAA,EAAQ,KAAK,aAAa,CAAA;AAC3D,IAAA,8BAAA,CAA+B,MAAA,EAAQ,KAAK,WAAW,CAAA;AAEvD,IAAA,OAAO,EAAE,KAAA,EAAO,SAAA,EAAW,OAAA,EAAQ;AAAA,EACrC;AACF,CAAA;AAEA,IAAO,uBAAA,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 * Centralized GraphQL operations for the Manufacturedops MCP module.\n *\n * Manufacturedops is the Manufacturing Operations Platform (MES) for the\n * future-products ecosystem — production planning & shop-floor execution,\n * quality & traceability, and maintenance & OEE. Backend subgraph:\n * ~/products/wspace/manufacturedops/wspace-manufacturedops-svc/ (Hive service\n * name `manufacturedops`).\n *\n * All operations run against the WORKSPACE gateway. Workspace scoping is carried\n * by the gateway headers (x-workspace-id / X-Workspace-Authorization) issued by\n * the auth module — Manufacturedops inputs do NOT carry a workspaceId.\n *\n * The subgraph is consistently prefixed: every product type/enum/input is\n * `Man*` and every root field is `man*` (manListProductionOrders,\n * manCreateWorkCenter, manAsset, manHealth). Every field is called by its REAL\n * server name here.\n *\n * Uses template-string interpolation (not gql tagged fragments) to match the\n * canonical vibecontrols / kadaikodi / crewfoundry modules' operations files.\n */\n\n// ---------------------------------------------------------------------------\n// Field fragments (mirror the backend object types)\n// ---------------------------------------------------------------------------\n\nexport const WORK_CENTER_FIELDS = `\n id code name description type capacityHours idealRunRate isActive tags\n createdAt updatedAt workspaceId\n`;\n\nexport const PRODUCTION_OPERATION_FIELDS = `\n id productionOrderId name sequence status workCenterId operatorId\n setupMinutes runMinutes goodCount scrapCount startedAt completedAt\n createdAt updatedAt workspaceId\n`;\n\nexport const MATERIAL_LOT_FIELDS = `\n id lotNumber materialSku materialName quantity uom status supplier\n receivedAt expiresAt productionOrderId parentLotId tags\n createdAt updatedAt workspaceId\n`;\n\nexport const PRODUCTION_ORDER_FIELDS = `\n id orderNumber productSku productName quantity quantityDone uom priority status\n plannedStart plannedEnd actualStart actualEnd dueDate erpReference notes tags\n createdAt updatedAt workspaceId\n`;\n\nexport const INSPECTION_PLAN_FIELDS = `\n id code name description stage productSku characteristics isActive\n createdAt updatedAt workspaceId\n`;\n\nexport const QUALITY_INSPECTION_FIELDS = `\n id stage result sampleSize defectCount measurements notes\n inspectionPlanId productionOrderId materialLotId workCenterId inspectorId\n inspectedAt createdAt updatedAt workspaceId\n`;\n\nexport const NON_CONFORMANCE_FIELDS = `\n id ncrNumber title description severity status disposition\n quantityAffected rootCause correctiveAction ownerId inspectionId\n dueDate resolvedAt tags createdAt updatedAt workspaceId\n`;\n\nexport const ASSET_FIELDS = `\n id assetTag name manufacturer model serialNumber status\n pmIntervalHours runningHours workCenterId installedAt lastServicedAt\n tags createdAt updatedAt workspaceId\n`;\n\nexport const MAINTENANCE_WORK_ORDER_FIELDS = `\n id woNumber title description type status assetId technicianId\n scheduledFor startedAt completedAt laborMinutes downtimeMinutes\n createdAt updatedAt workspaceId\n`;\n\nexport const DOWNTIME_EVENT_FIELDS = `\n id reason description durationMinutes assetId workCenterId productionOrderId\n startedAt endedAt createdAt updatedAt workspaceId\n`;\n\nconst PAGE_INFO = `pageInfo { cursor hasMore }`;\n\n// ---------------------------------------------------------------------------\n// Work centers\n// ---------------------------------------------------------------------------\n\nexport const GET_WORK_CENTER = `\n query ManGetWorkCenter($id: ID!) {\n manWorkCenter(id: $id) {\n ${WORK_CENTER_FIELDS}\n operations { id name sequence status productionOrderId }\n }\n }\n`;\n\nexport const LIST_WORK_CENTERS = `\n query ManListWorkCenters($isActive: Boolean) {\n manListWorkCenters(isActive: $isActive) {\n ${WORK_CENTER_FIELDS}\n }\n }\n`;\n\nexport const CREATE_WORK_CENTER = `\n mutation ManCreateWorkCenter($input: ManCreateWorkCenterInput!) {\n manCreateWorkCenter(input: $input) {\n ${WORK_CENTER_FIELDS}\n }\n }\n`;\n\nexport const UPDATE_WORK_CENTER = `\n mutation ManUpdateWorkCenter($id: ID!, $input: ManUpdateWorkCenterInput!) {\n manUpdateWorkCenter(id: $id, input: $input) {\n ${WORK_CENTER_FIELDS}\n }\n }\n`;\n\nexport const ARCHIVE_WORK_CENTER = `\n mutation ManArchiveWorkCenter($id: ID!) {\n manArchiveWorkCenter(id: $id)\n }\n`;\n\n// ---------------------------------------------------------------------------\n// Production orders + operations\n// ---------------------------------------------------------------------------\n\nexport const GET_PRODUCTION_ORDER = `\n query ManGetProductionOrder($id: ID!) {\n manProductionOrder(id: $id) {\n ${PRODUCTION_ORDER_FIELDS}\n operations { ${PRODUCTION_OPERATION_FIELDS} }\n materialLots { ${MATERIAL_LOT_FIELDS} }\n }\n }\n`;\n\nexport const LIST_PRODUCTION_ORDERS = `\n query ManListProductionOrders(\n $pagination: PaginationInput\n $productSku: String\n $status: ManProductionOrderStatus\n ) {\n manListProductionOrders(pagination: $pagination, productSku: $productSku, status: $status) {\n items { ${PRODUCTION_ORDER_FIELDS} }\n ${PAGE_INFO}\n }\n }\n`;\n\nexport const CREATE_PRODUCTION_ORDER = `\n mutation ManCreateProductionOrder($input: ManCreateProductionOrderInput!) {\n manCreateProductionOrder(input: $input) {\n ${PRODUCTION_ORDER_FIELDS}\n }\n }\n`;\n\nexport const UPDATE_PRODUCTION_ORDER = `\n mutation ManUpdateProductionOrder($id: ID!, $input: ManUpdateProductionOrderInput!) {\n manUpdateProductionOrder(id: $id, input: $input) {\n ${PRODUCTION_ORDER_FIELDS}\n }\n }\n`;\n\nexport const TRANSITION_PRODUCTION_ORDER = `\n mutation ManTransitionProductionOrder($id: ID!, $status: ManProductionOrderStatus!) {\n manTransitionProductionOrder(id: $id, status: $status) {\n ${PRODUCTION_ORDER_FIELDS}\n }\n }\n`;\n\nexport const ADD_OPERATION = `\n mutation ManAddOperation($input: ManCreateOperationInput!) {\n manAddOperation(input: $input) {\n ${PRODUCTION_OPERATION_FIELDS}\n }\n }\n`;\n\nexport const RECORD_OPERATION = `\n mutation ManRecordOperation($id: ID!, $input: ManRecordOperationInput!) {\n manRecordOperation(id: $id, input: $input) {\n ${PRODUCTION_OPERATION_FIELDS}\n }\n }\n`;\n\n// ---------------------------------------------------------------------------\n// Material lots\n// ---------------------------------------------------------------------------\n\nexport const LIST_MATERIAL_LOTS = `\n query ManListMaterialLots(\n $pagination: PaginationInput\n $productionOrderId: ID\n $status: ManMaterialLotStatus\n ) {\n manListMaterialLots(\n pagination: $pagination\n productionOrderId: $productionOrderId\n status: $status\n ) {\n items { ${MATERIAL_LOT_FIELDS} }\n ${PAGE_INFO}\n }\n }\n`;\n\nexport const CREATE_MATERIAL_LOT = `\n mutation ManCreateMaterialLot($input: ManCreateMaterialLotInput!) {\n manCreateMaterialLot(input: $input) {\n ${MATERIAL_LOT_FIELDS}\n }\n }\n`;\n\nexport const SET_MATERIAL_LOT_STATUS = `\n mutation ManSetMaterialLotStatus($id: ID!, $status: ManMaterialLotStatus!) {\n manSetMaterialLotStatus(id: $id, status: $status) {\n ${MATERIAL_LOT_FIELDS}\n }\n }\n`;\n\n// ---------------------------------------------------------------------------\n// Quality inspections + plans\n// ---------------------------------------------------------------------------\n\nexport const GET_INSPECTION = `\n query ManGetInspection($id: ID!) {\n manInspection(id: $id) {\n ${QUALITY_INSPECTION_FIELDS}\n inspectionPlan { ${INSPECTION_PLAN_FIELDS} }\n nonConformances { ${NON_CONFORMANCE_FIELDS} }\n }\n }\n`;\n\nexport const LIST_INSPECTIONS = `\n query ManListInspections(\n $pagination: PaginationInput\n $productionOrderId: ID\n $result: ManInspectionResult\n ) {\n manListInspections(\n pagination: $pagination\n productionOrderId: $productionOrderId\n result: $result\n ) {\n items { ${QUALITY_INSPECTION_FIELDS} }\n ${PAGE_INFO}\n }\n }\n`;\n\nexport const RECORD_INSPECTION = `\n mutation ManRecordInspection($input: ManRecordInspectionInput!) {\n manRecordInspection(input: $input) {\n ${QUALITY_INSPECTION_FIELDS}\n }\n }\n`;\n\nexport const LIST_INSPECTION_PLANS = `\n query ManListInspectionPlans($isActive: Boolean, $stage: ManInspectionStage) {\n manListInspectionPlans(isActive: $isActive, stage: $stage) {\n ${INSPECTION_PLAN_FIELDS}\n }\n }\n`;\n\nexport const CREATE_INSPECTION_PLAN = `\n mutation ManCreateInspectionPlan($input: ManCreateInspectionPlanInput!) {\n manCreateInspectionPlan(input: $input) {\n ${INSPECTION_PLAN_FIELDS}\n }\n }\n`;\n\n// ---------------------------------------------------------------------------\n// Non-conformances (NCR / CAPA)\n// ---------------------------------------------------------------------------\n\nexport const GET_NON_CONFORMANCE = `\n query ManGetNonConformance($id: ID!) {\n manNonConformance(id: $id) {\n ${NON_CONFORMANCE_FIELDS}\n inspection { ${QUALITY_INSPECTION_FIELDS} }\n }\n }\n`;\n\nexport const LIST_NON_CONFORMANCES = `\n query ManListNonConformances(\n $pagination: PaginationInput\n $severity: ManSeverity\n $status: ManNonConformanceStatus\n ) {\n manListNonConformances(pagination: $pagination, severity: $severity, status: $status) {\n items { ${NON_CONFORMANCE_FIELDS} }\n ${PAGE_INFO}\n }\n }\n`;\n\nexport const RAISE_NON_CONFORMANCE = `\n mutation ManRaiseNonConformance($input: ManRaiseNonConformanceInput!) {\n manRaiseNonConformance(input: $input) {\n ${NON_CONFORMANCE_FIELDS}\n }\n }\n`;\n\nexport const UPDATE_NON_CONFORMANCE = `\n mutation ManUpdateNonConformance($id: ID!, $input: ManUpdateNonConformanceInput!) {\n manUpdateNonConformance(id: $id, input: $input) {\n ${NON_CONFORMANCE_FIELDS}\n }\n }\n`;\n\nexport const TRANSITION_NON_CONFORMANCE = `\n mutation ManTransitionNonConformance($id: ID!, $status: ManNonConformanceStatus!) {\n manTransitionNonConformance(id: $id, status: $status) {\n ${NON_CONFORMANCE_FIELDS}\n }\n }\n`;\n\n// ---------------------------------------------------------------------------\n// Assets\n// ---------------------------------------------------------------------------\n\nexport const GET_ASSET = `\n query ManGetAsset($id: ID!) {\n manAsset(id: $id) {\n ${ASSET_FIELDS}\n workOrders { ${MAINTENANCE_WORK_ORDER_FIELDS} }\n }\n }\n`;\n\nexport const LIST_ASSETS = `\n query ManListAssets(\n $pagination: PaginationInput\n $status: ManAssetStatus\n $workCenterId: ID\n ) {\n manListAssets(pagination: $pagination, status: $status, workCenterId: $workCenterId) {\n items { ${ASSET_FIELDS} }\n ${PAGE_INFO}\n }\n }\n`;\n\nexport const CREATE_ASSET = `\n mutation ManCreateAsset($input: ManCreateAssetInput!) {\n manCreateAsset(input: $input) {\n ${ASSET_FIELDS}\n }\n }\n`;\n\nexport const UPDATE_ASSET = `\n mutation ManUpdateAsset($id: ID!, $input: ManUpdateAssetInput!) {\n manUpdateAsset(id: $id, input: $input) {\n ${ASSET_FIELDS}\n }\n }\n`;\n\n// ---------------------------------------------------------------------------\n// Maintenance work orders\n// ---------------------------------------------------------------------------\n\nexport const LIST_MAINTENANCE_WORK_ORDERS = `\n query ManListMaintenanceWorkOrders(\n $assetId: ID\n $pagination: PaginationInput\n $status: ManMaintenanceStatus\n ) {\n manListMaintenanceWorkOrders(assetId: $assetId, pagination: $pagination, status: $status) {\n items {\n ${MAINTENANCE_WORK_ORDER_FIELDS}\n asset { id assetTag name status }\n }\n ${PAGE_INFO}\n }\n }\n`;\n\nexport const CREATE_MAINTENANCE_WORK_ORDER = `\n mutation ManCreateMaintenanceWorkOrder($input: ManCreateMaintenanceWorkOrderInput!) {\n manCreateMaintenanceWorkOrder(input: $input) {\n ${MAINTENANCE_WORK_ORDER_FIELDS}\n }\n }\n`;\n\nexport const TRANSITION_MAINTENANCE_WORK_ORDER = `\n mutation ManTransitionMaintenanceWorkOrder($id: ID!, $status: ManMaintenanceStatus!) {\n manTransitionMaintenanceWorkOrder(id: $id, status: $status) {\n ${MAINTENANCE_WORK_ORDER_FIELDS}\n }\n }\n`;\n\n// ---------------------------------------------------------------------------\n// Downtime events\n// ---------------------------------------------------------------------------\n\nexport const LIST_DOWNTIME_EVENTS = `\n query ManListDowntimeEvents($assetId: ID, $reason: ManDowntimeReason, $workCenterId: ID) {\n manListDowntimeEvents(assetId: $assetId, reason: $reason, workCenterId: $workCenterId) {\n ${DOWNTIME_EVENT_FIELDS}\n }\n }\n`;\n\nexport const RECORD_DOWNTIME = `\n mutation ManRecordDowntime($input: ManRecordDowntimeInput!) {\n manRecordDowntime(input: $input) {\n ${DOWNTIME_EVENT_FIELDS}\n }\n }\n`;\n\n// ---------------------------------------------------------------------------\n// Health\n// ---------------------------------------------------------------------------\n\nexport const HEALTH = `\n query ManHealth {\n manHealth\n }\n`;\n","/**\n * Shared zod schemas for the Manufacturedops tool surface.\n *\n * Every backend enum is mirrored as a tight zod enum so Claude Desktop grounds\n * tool calls against the exact allowed values. `DateTime` scalar inputs are\n * modelled as ISO-8601 strings; `JSON` scalar inputs (characteristics,\n * measurements) are modelled as permissive object records — the backend accepts\n * arbitrary JSON, but a record shape gives the LLM a typed hint.\n */\n\nimport { z } from 'zod';\n\nexport const WorkCenterTypeEnum = z\n .enum(['ASSEMBLY', 'CELL', 'LINE', 'MACHINE', 'MANUAL'])\n .describe('Type of a production work center');\n\nexport const ProductionOrderStatusEnum = z\n .enum(['PLANNED', 'RELEASED', 'IN_PROGRESS', 'PAUSED', 'COMPLETED', 'CLOSED', 'CANCELLED'])\n .describe('Execution lifecycle status of a production order');\n\nexport const ProductionPriorityEnum = z\n .enum(['LOW', 'NORMAL', 'HIGH', 'URGENT'])\n .describe('Scheduling priority of a production order');\n\nexport const OperationStatusEnum = z\n .enum(['PENDING', 'SETUP', 'RUNNING', 'DONE', 'SKIPPED'])\n .describe('Status of a routing/production operation');\n\nexport const MaterialLotStatusEnum = z\n .enum(['AVAILABLE', 'ALLOCATED', 'CONSUMED', 'QUARANTINED', 'SCRAPPED'])\n .describe('Inventory/quality status of a material lot');\n\nexport const InspectionStageEnum = z\n .enum(['INCOMING', 'IN_PROCESS', 'FINAL', 'AUDIT'])\n .describe('Stage at which a quality inspection is performed');\n\nexport const InspectionResultEnum = z\n .enum(['PENDING', 'PASS', 'FAIL', 'CONDITIONAL'])\n .describe('Outcome of a quality inspection');\n\nexport const SeverityEnum = z\n .enum(['MINOR', 'MAJOR', 'CRITICAL'])\n .describe('Severity of a non-conformance');\n\nexport const NonConformanceStatusEnum = z\n .enum(['OPEN', 'INVESTIGATING', 'CONTAINED', 'CORRECTIVE_ACTION', 'CLOSED'])\n .describe('Resolution lifecycle status of an NCR/CAPA');\n\nexport const NonConformanceDispositionEnum = z\n .enum(['OPEN', 'USE_AS_IS', 'REWORK', 'SCRAP', 'RETURN_TO_SUPPLIER'])\n .describe('Disposition decision for a non-conformance');\n\nexport const AssetStatusEnum = z\n .enum(['OPERATIONAL', 'DEGRADED', 'DOWN', 'MAINTENANCE', 'RETIRED'])\n .describe('Operational status of a maintainable asset');\n\nexport const MaintenanceTypeEnum = z\n .enum(['PREVENTIVE', 'CORRECTIVE', 'PREDICTIVE', 'INSPECTION'])\n .describe('Type of a maintenance work order');\n\nexport const MaintenanceStatusEnum = z\n .enum(['SCHEDULED', 'IN_PROGRESS', 'ON_HOLD', 'COMPLETED', 'CANCELLED'])\n .describe('Lifecycle status of a maintenance work order');\n\nexport const DowntimeReasonEnum = z\n .enum(['PLANNED', 'BREAKDOWN', 'CHANGEOVER', 'MATERIAL_SHORTAGE', 'QUALITY', 'OTHER'])\n .describe('Reason classification for a downtime event');\n\n/** ISO-8601 datetime string for `DateTime` scalar inputs. */\nexport const IsoDateTime = z\n .string()\n .describe('ISO-8601 datetime, e.g. \"2026-06-26T09:00:00.000Z\"');\n\n/** Permissive JSON-object schema for `JSON` scalar inputs. */\nexport const JsonObject = z.record(z.string(), z.unknown());\n\n/** Standard `PaginationInput` ({ cursor?, limit=50, offset=0 }) shape. */\nexport const PaginationFields = {\n limit: z.number().int().optional().describe('Page size (default 50)'),\n offset: z.number().int().optional().describe('Pagination offset (default 0)'),\n cursor: z.string().optional().describe('Opaque pagination cursor'),\n};\n\n/** Build a `PaginationInput` object from the standard pagination args. */\nexport function buildPagination(args: {\n limit?: number;\n offset?: number;\n cursor?: string;\n}): Record<string, unknown> | undefined {\n const pagination: Record<string, unknown> = {};\n if (args.limit !== undefined) pagination.limit = args.limit;\n if (args.offset !== undefined) pagination.offset = args.offset;\n if (args.cursor !== undefined) pagination.cursor = args.cursor;\n return Object.keys(pagination).length > 0 ? pagination : undefined;\n}\n","/**\n * Manufacturedops production tools — planning & shop-floor execution.\n *\n * Surface (15) across four per-entity sub-APIs:\n * work_centers_{get,list,create,update,archive}\n * production_orders_{get,list,create,update,transition}\n * operations_{add,record}\n * material_lots_{list,create,set_status}\n *\n * All root fields carry the consistent `man` server prefix\n * (manListProductionOrders / manCreateWorkCenter / manAddOperation / …) and are\n * called by their REAL names in operations.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';\nimport {\n WorkCenterTypeEnum,\n ProductionOrderStatusEnum,\n ProductionPriorityEnum,\n OperationStatusEnum,\n MaterialLotStatusEnum,\n IsoDateTime,\n PaginationFields,\n buildPagination,\n} from './shared.js';\n\nexport function registerProductionTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n // ── Work centers ──────────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'work_centers_get')),\n {\n title: 'Get Work Center',\n description: 'Fetch a single work center by ID, including its scheduled operations.',\n inputSchema: { id: z.string().describe('Work center ID') },\n },\n async ({ id }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n manWorkCenter: Record<string, unknown> | null;\n }>(ops.GET_WORK_CENTER, { id });\n if (!data.manWorkCenter) return errorResult(`Work center ${id} not found`);\n return jsonResult(data.manWorkCenter);\n } catch (error) {\n ctx.logger.error('manufacturedops work_centers_get failed', { error: String(error) });\n return errorResult(\n `Failed to get work center: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'work_centers_list')),\n {\n title: 'List Work Centers',\n description: 'List work centers in the bound workspace, optionally filtered by active state.',\n inputSchema: {\n isActive: z.boolean().optional().describe('Only active (true) or archived (false) centers'),\n },\n },\n async ({ isActive }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n manListWorkCenters: Array<Record<string, unknown>>;\n }>(ops.LIST_WORK_CENTERS, { isActive });\n return jsonResult(data.manListWorkCenters);\n } catch (error) {\n ctx.logger.error('manufacturedops work_centers_list failed', { error: String(error) });\n return errorResult(\n `Failed to list work centers: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'work_centers_create')),\n {\n title: 'Create Work Center',\n description:\n 'Create a work center (machine/line/cell/manual station). `code` must be unique within the workspace.',\n inputSchema: {\n code: z.string().min(1).describe('Unique work-center code'),\n name: z.string().min(1).describe('Display name'),\n type: WorkCenterTypeEnum.optional().describe('Work-center type (default MACHINE)'),\n description: z.string().optional().describe('Description'),\n capacityHours: z.number().optional().describe('Available capacity in hours'),\n idealRunRate: z.number().optional().describe('Ideal run rate (units/hour) for OEE'),\n tags: z.array(z.string()).optional().describe('Free-form tags'),\n },\n },\n async ({ code, name, type, description, capacityHours, idealRunRate, tags }) => {\n try {\n const input: Record<string, unknown> = { code, name };\n if (type !== undefined) input.type = type;\n if (description !== undefined) input.description = description;\n if (capacityHours !== undefined) input.capacityHours = capacityHours;\n if (idealRunRate !== undefined) input.idealRunRate = idealRunRate;\n if (tags !== undefined) input.tags = tags;\n\n const data = await ctx.gql.workspace.request<{\n manCreateWorkCenter: Record<string, unknown>;\n }>(ops.CREATE_WORK_CENTER, { input });\n return jsonResult(data.manCreateWorkCenter);\n } catch (error) {\n ctx.logger.error('manufacturedops work_centers_create failed', { error: String(error) });\n return errorResult(\n `Failed to create work center: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'work_centers_update')),\n {\n title: 'Update Work Center',\n description: 'Update a work center. At least one mutable field must be provided.',\n inputSchema: {\n id: z.string().describe('Work center ID'),\n name: z.string().optional().describe('Updated name'),\n type: WorkCenterTypeEnum.optional().describe('Updated type'),\n description: z.string().optional().describe('Updated description'),\n capacityHours: z.number().optional().describe('Updated capacity (hours)'),\n idealRunRate: z.number().optional().describe('Updated ideal run rate'),\n isActive: z.boolean().optional().describe('Updated active state'),\n tags: z.array(z.string()).optional().describe('Updated tags'),\n },\n },\n async ({ id, name, type, description, capacityHours, idealRunRate, isActive, tags }) => {\n try {\n const input: Record<string, unknown> = {};\n if (name !== undefined) input.name = name;\n if (type !== undefined) input.type = type;\n if (description !== undefined) input.description = description;\n if (capacityHours !== undefined) input.capacityHours = capacityHours;\n if (idealRunRate !== undefined) input.idealRunRate = idealRunRate;\n if (isActive !== undefined) input.isActive = isActive;\n if (tags !== undefined) input.tags = tags;\n\n if (Object.keys(input).length === 0) {\n return errorResult('No updates specified — provide at least one mutable field');\n }\n\n const data = await ctx.gql.workspace.request<{\n manUpdateWorkCenter: Record<string, unknown>;\n }>(ops.UPDATE_WORK_CENTER, { id, input });\n return jsonResult(data.manUpdateWorkCenter);\n } catch (error) {\n ctx.logger.error('manufacturedops work_centers_update failed', { error: String(error) });\n return errorResult(\n `Failed to update work center: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'work_centers_archive')),\n {\n title: 'Archive Work Center',\n description: 'Archive (soft-delete) a work center so it is no longer schedulable.',\n inputSchema: { id: z.string().describe('Work center ID') },\n },\n async ({ id }) => {\n try {\n const data = await ctx.gql.workspace.request<{ manArchiveWorkCenter: boolean }>(\n ops.ARCHIVE_WORK_CENTER,\n { id },\n );\n return jsonResult({ ok: data.manArchiveWorkCenter, id });\n } catch (error) {\n ctx.logger.error('manufacturedops work_centers_archive failed', { error: String(error) });\n return errorResult(\n `Failed to archive work center: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Production orders ──────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'production_orders_get')),\n {\n title: 'Get Production Order',\n description:\n 'Fetch a single production order by ID, including its operations and material lots.',\n inputSchema: { id: z.string().describe('Production order ID') },\n },\n async ({ id }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n manProductionOrder: Record<string, unknown> | null;\n }>(ops.GET_PRODUCTION_ORDER, { id });\n if (!data.manProductionOrder) return errorResult(`Production order ${id} not found`);\n return jsonResult(data.manProductionOrder);\n } catch (error) {\n ctx.logger.error('manufacturedops production_orders_get failed', { error: String(error) });\n return errorResult(\n `Failed to get production order: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'production_orders_list')),\n {\n title: 'List Production Orders',\n description:\n 'List production orders (paginated), optionally filtered by product SKU and/or status.',\n inputSchema: {\n productSku: z.string().optional().describe('Filter by product SKU'),\n status: ProductionOrderStatusEnum.optional().describe('Filter by status'),\n ...PaginationFields,\n },\n },\n async ({ productSku, status, limit, offset, cursor }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n manListProductionOrders: { items: Array<Record<string, unknown>>; pageInfo: unknown };\n }>(ops.LIST_PRODUCTION_ORDERS, {\n productSku,\n status,\n pagination: buildPagination({ limit, offset, cursor }),\n });\n return jsonResult(data.manListProductionOrders);\n } catch (error) {\n ctx.logger.error('manufacturedops production_orders_list failed', { error: String(error) });\n return errorResult(\n `Failed to list production orders: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'production_orders_create')),\n {\n title: 'Create Production Order',\n description:\n 'Create a production (manufacturing) order. `orderNumber` and `productSku` must be provided.',\n inputSchema: {\n orderNumber: z.string().min(1).describe('Unique order number'),\n productSku: z.string().min(1).describe('Product SKU being manufactured'),\n productName: z.string().min(1).describe('Product display name'),\n quantity: z.number().optional().describe('Order quantity'),\n uom: z.string().optional().describe('Unit of measure (e.g. \"ea\", \"kg\")'),\n priority: ProductionPriorityEnum.optional().describe('Priority (default NORMAL)'),\n plannedStart: IsoDateTime.optional().describe('Planned start (ISO-8601)'),\n plannedEnd: IsoDateTime.optional().describe('Planned end (ISO-8601)'),\n dueDate: IsoDateTime.optional().describe('Due date (ISO-8601)'),\n erpReference: z.string().optional().describe('External ERP reference'),\n notes: z.string().optional().describe('Free-form notes'),\n tags: z.array(z.string()).optional().describe('Free-form tags'),\n },\n },\n async ({\n orderNumber,\n productSku,\n productName,\n quantity,\n uom,\n priority,\n plannedStart,\n plannedEnd,\n dueDate,\n erpReference,\n notes,\n tags,\n }) => {\n try {\n const input: Record<string, unknown> = { orderNumber, productSku, productName };\n if (quantity !== undefined) input.quantity = quantity;\n if (uom !== undefined) input.uom = uom;\n if (priority !== undefined) input.priority = priority;\n if (plannedStart !== undefined) input.plannedStart = plannedStart;\n if (plannedEnd !== undefined) input.plannedEnd = plannedEnd;\n if (dueDate !== undefined) input.dueDate = dueDate;\n if (erpReference !== undefined) input.erpReference = erpReference;\n if (notes !== undefined) input.notes = notes;\n if (tags !== undefined) input.tags = tags;\n\n const data = await ctx.gql.workspace.request<{\n manCreateProductionOrder: Record<string, unknown>;\n }>(ops.CREATE_PRODUCTION_ORDER, { input });\n return jsonResult(data.manCreateProductionOrder);\n } catch (error) {\n ctx.logger.error('manufacturedops production_orders_create failed', {\n error: String(error),\n });\n return errorResult(\n `Failed to create production order: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'production_orders_update')),\n {\n title: 'Update Production Order',\n description: 'Update a production order. At least one mutable field must be provided.',\n inputSchema: {\n id: z.string().describe('Production order ID'),\n productName: z.string().optional().describe('Updated product name'),\n quantity: z.number().optional().describe('Updated quantity'),\n uom: z.string().optional().describe('Updated unit of measure'),\n priority: ProductionPriorityEnum.optional().describe('Updated priority'),\n plannedStart: IsoDateTime.optional().describe('Updated planned start'),\n plannedEnd: IsoDateTime.optional().describe('Updated planned end'),\n dueDate: IsoDateTime.optional().describe('Updated due date'),\n erpReference: z.string().optional().describe('Updated ERP reference'),\n notes: z.string().optional().describe('Updated notes'),\n tags: z.array(z.string()).optional().describe('Updated tags'),\n },\n },\n async ({\n id,\n productName,\n quantity,\n uom,\n priority,\n plannedStart,\n plannedEnd,\n dueDate,\n erpReference,\n notes,\n tags,\n }) => {\n try {\n const input: Record<string, unknown> = {};\n if (productName !== undefined) input.productName = productName;\n if (quantity !== undefined) input.quantity = quantity;\n if (uom !== undefined) input.uom = uom;\n if (priority !== undefined) input.priority = priority;\n if (plannedStart !== undefined) input.plannedStart = plannedStart;\n if (plannedEnd !== undefined) input.plannedEnd = plannedEnd;\n if (dueDate !== undefined) input.dueDate = dueDate;\n if (erpReference !== undefined) input.erpReference = erpReference;\n if (notes !== undefined) input.notes = notes;\n if (tags !== undefined) input.tags = tags;\n\n if (Object.keys(input).length === 0) {\n return errorResult('No updates specified — provide at least one mutable field');\n }\n\n const data = await ctx.gql.workspace.request<{\n manUpdateProductionOrder: Record<string, unknown>;\n }>(ops.UPDATE_PRODUCTION_ORDER, { id, input });\n return jsonResult(data.manUpdateProductionOrder);\n } catch (error) {\n ctx.logger.error('manufacturedops production_orders_update failed', {\n error: String(error),\n });\n return errorResult(\n `Failed to update production order: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'production_orders_transition')),\n {\n title: 'Transition Production Order',\n description:\n 'Advance a production order through its execution lifecycle (PLANNED → RELEASED → IN_PROGRESS → COMPLETED → CLOSED, or PAUSED/CANCELLED). Transitions are validated server-side.',\n inputSchema: {\n id: z.string().describe('Production order ID'),\n status: ProductionOrderStatusEnum.describe('Target status'),\n },\n },\n async ({ id, status }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n manTransitionProductionOrder: Record<string, unknown>;\n }>(ops.TRANSITION_PRODUCTION_ORDER, { id, status });\n return jsonResult(data.manTransitionProductionOrder);\n } catch (error) {\n ctx.logger.error('manufacturedops production_orders_transition failed', {\n error: String(error),\n });\n return errorResult(\n `Failed to transition production order: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Operations ─────────────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'operations_add')),\n {\n title: 'Add Production Operation',\n description:\n 'Add a routing operation (step) to a production order, optionally assigned to a work center.',\n inputSchema: {\n productionOrderId: z.string().min(1).describe('Owning production order ID'),\n name: z.string().min(1).describe('Operation name (e.g. \"CNC mill\", \"Assembly\")'),\n sequence: z.number().int().optional().describe('Ordering sequence number'),\n workCenterId: z.string().optional().describe('Assigned work center ID'),\n },\n },\n async ({ productionOrderId, name, sequence, workCenterId }) => {\n try {\n const input: Record<string, unknown> = { productionOrderId, name };\n if (sequence !== undefined) input.sequence = sequence;\n if (workCenterId !== undefined) input.workCenterId = workCenterId;\n\n const data = await ctx.gql.workspace.request<{\n manAddOperation: Record<string, unknown>;\n }>(ops.ADD_OPERATION, { input });\n return jsonResult(data.manAddOperation);\n } catch (error) {\n ctx.logger.error('manufacturedops operations_add failed', { error: String(error) });\n return errorResult(\n `Failed to add operation: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'operations_record')),\n {\n title: 'Record Production Operation',\n description:\n 'Record progress against a routing operation (setup/run minutes, good/scrap counts, status).',\n inputSchema: {\n id: z.string().describe('Operation ID'),\n status: OperationStatusEnum.optional().describe('Updated operation status'),\n setupMinutes: z.number().int().optional().describe('Setup minutes logged'),\n runMinutes: z.number().int().optional().describe('Run minutes logged'),\n goodCount: z.number().optional().describe('Good units produced'),\n scrapCount: z.number().optional().describe('Scrap units produced'),\n },\n },\n async ({ id, status, setupMinutes, runMinutes, goodCount, scrapCount }) => {\n try {\n const input: Record<string, unknown> = {};\n if (status !== undefined) input.status = status;\n if (setupMinutes !== undefined) input.setupMinutes = setupMinutes;\n if (runMinutes !== undefined) input.runMinutes = runMinutes;\n if (goodCount !== undefined) input.goodCount = goodCount;\n if (scrapCount !== undefined) input.scrapCount = scrapCount;\n\n if (Object.keys(input).length === 0) {\n return errorResult(\n 'No updates specified — provide at least one of status/setupMinutes/runMinutes/goodCount/scrapCount',\n );\n }\n\n const data = await ctx.gql.workspace.request<{\n manRecordOperation: Record<string, unknown>;\n }>(ops.RECORD_OPERATION, { id, input });\n return jsonResult(data.manRecordOperation);\n } catch (error) {\n ctx.logger.error('manufacturedops operations_record failed', { error: String(error) });\n return errorResult(\n `Failed to record operation: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Material lots ──────────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'material_lots_list')),\n {\n title: 'List Material Lots',\n description:\n 'List material lots (paginated), optionally filtered by production order and/or status.',\n inputSchema: {\n productionOrderId: z.string().optional().describe('Filter by production order ID'),\n status: MaterialLotStatusEnum.optional().describe('Filter by lot status'),\n ...PaginationFields,\n },\n },\n async ({ productionOrderId, status, limit, offset, cursor }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n manListMaterialLots: { items: Array<Record<string, unknown>>; pageInfo: unknown };\n }>(ops.LIST_MATERIAL_LOTS, {\n productionOrderId,\n status,\n pagination: buildPagination({ limit, offset, cursor }),\n });\n return jsonResult(data.manListMaterialLots);\n } catch (error) {\n ctx.logger.error('manufacturedops material_lots_list failed', { error: String(error) });\n return errorResult(\n `Failed to list material lots: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'material_lots_create')),\n {\n title: 'Create Material Lot',\n description:\n 'Receive / create a traceable material lot. `lotNumber`, `materialSku`, and `materialName` are required.',\n inputSchema: {\n lotNumber: z.string().min(1).describe('Unique lot number'),\n materialSku: z.string().min(1).describe('Material SKU'),\n materialName: z.string().min(1).describe('Material display name'),\n quantity: z.number().optional().describe('Received quantity'),\n uom: z.string().optional().describe('Unit of measure'),\n supplier: z.string().optional().describe('Supplier name'),\n receivedAt: IsoDateTime.optional().describe('Received timestamp (ISO-8601)'),\n expiresAt: IsoDateTime.optional().describe('Expiry timestamp (ISO-8601)'),\n productionOrderId: z.string().optional().describe('Allocated production order ID'),\n parentLotId: z.string().optional().describe('Parent lot ID (for genealogy/splits)'),\n tags: z.array(z.string()).optional().describe('Free-form tags'),\n },\n },\n async ({\n lotNumber,\n materialSku,\n materialName,\n quantity,\n uom,\n supplier,\n receivedAt,\n expiresAt,\n productionOrderId,\n parentLotId,\n tags,\n }) => {\n try {\n const input: Record<string, unknown> = { lotNumber, materialSku, materialName };\n if (quantity !== undefined) input.quantity = quantity;\n if (uom !== undefined) input.uom = uom;\n if (supplier !== undefined) input.supplier = supplier;\n if (receivedAt !== undefined) input.receivedAt = receivedAt;\n if (expiresAt !== undefined) input.expiresAt = expiresAt;\n if (productionOrderId !== undefined) input.productionOrderId = productionOrderId;\n if (parentLotId !== undefined) input.parentLotId = parentLotId;\n if (tags !== undefined) input.tags = tags;\n\n const data = await ctx.gql.workspace.request<{\n manCreateMaterialLot: Record<string, unknown>;\n }>(ops.CREATE_MATERIAL_LOT, { input });\n return jsonResult(data.manCreateMaterialLot);\n } catch (error) {\n ctx.logger.error('manufacturedops material_lots_create failed', { error: String(error) });\n return errorResult(\n `Failed to create material lot: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'material_lots_set_status')),\n {\n title: 'Set Material Lot Status',\n description:\n 'Change a material lot status (AVAILABLE/ALLOCATED/CONSUMED/QUARANTINED/SCRAPPED).',\n inputSchema: {\n id: z.string().describe('Material lot ID'),\n status: MaterialLotStatusEnum.describe('Target lot status'),\n },\n },\n async ({ id, status }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n manSetMaterialLotStatus: Record<string, unknown>;\n }>(ops.SET_MATERIAL_LOT_STATUS, { id, status });\n return jsonResult(data.manSetMaterialLotStatus);\n } catch (error) {\n ctx.logger.error('manufacturedops material_lots_set_status failed', {\n error: String(error),\n });\n return errorResult(\n `Failed to set material lot status: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n}\n","/**\n * Manufacturedops quality tools — inspections, plans, and NCR/CAPA.\n *\n * Surface (10) across three per-entity sub-APIs:\n * inspections_{get,list,record}\n * inspection_plans_{list,create}\n * non_conformances_{get,list,raise,update,transition}\n *\n * All root fields carry the consistent `man` server prefix and are called by\n * their REAL names in operations.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';\nimport {\n InspectionStageEnum,\n InspectionResultEnum,\n SeverityEnum,\n NonConformanceStatusEnum,\n NonConformanceDispositionEnum,\n IsoDateTime,\n JsonObject,\n PaginationFields,\n buildPagination,\n} from './shared.js';\n\nexport function registerQualityTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n // ── Inspections ────────────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'inspections_get')),\n {\n title: 'Get Quality Inspection',\n description:\n 'Fetch a single quality inspection by ID, including its plan and any raised non-conformances.',\n inputSchema: { id: z.string().describe('Inspection ID') },\n },\n async ({ id }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n manInspection: Record<string, unknown> | null;\n }>(ops.GET_INSPECTION, { id });\n if (!data.manInspection) return errorResult(`Inspection ${id} not found`);\n return jsonResult(data.manInspection);\n } catch (error) {\n ctx.logger.error('manufacturedops inspections_get failed', { error: String(error) });\n return errorResult(\n `Failed to get inspection: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'inspections_list')),\n {\n title: 'List Quality Inspections',\n description:\n 'List quality inspections (paginated), optionally filtered by production order and/or result.',\n inputSchema: {\n productionOrderId: z.string().optional().describe('Filter by production order ID'),\n result: InspectionResultEnum.optional().describe('Filter by inspection result'),\n ...PaginationFields,\n },\n },\n async ({ productionOrderId, result, limit, offset, cursor }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n manListInspections: { items: Array<Record<string, unknown>>; pageInfo: unknown };\n }>(ops.LIST_INSPECTIONS, {\n productionOrderId,\n result,\n pagination: buildPagination({ limit, offset, cursor }),\n });\n return jsonResult(data.manListInspections);\n } catch (error) {\n ctx.logger.error('manufacturedops inspections_list failed', { error: String(error) });\n return errorResult(\n `Failed to list inspections: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'inspections_record')),\n {\n title: 'Record Quality Inspection',\n description:\n 'Record a quality inspection result against a production order, material lot, or work center.',\n inputSchema: {\n stage: InspectionStageEnum.optional().describe('Inspection stage (default IN_PROCESS)'),\n result: InspectionResultEnum.optional().describe('Inspection result (default PENDING)'),\n sampleSize: z.number().int().optional().describe('Number of units sampled'),\n defectCount: z.number().int().optional().describe('Number of defective units found'),\n measurements: JsonObject.optional().describe('Measurement readings as JSON'),\n notes: z.string().optional().describe('Inspector notes'),\n inspectionPlanId: z.string().optional().describe('Inspection plan ID'),\n productionOrderId: z.string().optional().describe('Production order ID'),\n materialLotId: z.string().optional().describe('Material lot ID'),\n workCenterId: z.string().optional().describe('Work center ID'),\n inspectedAt: IsoDateTime.optional().describe('Inspection timestamp (ISO-8601)'),\n },\n },\n async ({\n stage,\n result,\n sampleSize,\n defectCount,\n measurements,\n notes,\n inspectionPlanId,\n productionOrderId,\n materialLotId,\n workCenterId,\n inspectedAt,\n }) => {\n try {\n const input: Record<string, unknown> = {};\n if (stage !== undefined) input.stage = stage;\n if (result !== undefined) input.result = result;\n if (sampleSize !== undefined) input.sampleSize = sampleSize;\n if (defectCount !== undefined) input.defectCount = defectCount;\n if (measurements !== undefined) input.measurements = measurements;\n if (notes !== undefined) input.notes = notes;\n if (inspectionPlanId !== undefined) input.inspectionPlanId = inspectionPlanId;\n if (productionOrderId !== undefined) input.productionOrderId = productionOrderId;\n if (materialLotId !== undefined) input.materialLotId = materialLotId;\n if (workCenterId !== undefined) input.workCenterId = workCenterId;\n if (inspectedAt !== undefined) input.inspectedAt = inspectedAt;\n\n const data = await ctx.gql.workspace.request<{\n manRecordInspection: Record<string, unknown>;\n }>(ops.RECORD_INSPECTION, { input });\n return jsonResult(data.manRecordInspection);\n } catch (error) {\n ctx.logger.error('manufacturedops inspections_record failed', { error: String(error) });\n return errorResult(\n `Failed to record inspection: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Inspection plans ───────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'inspection_plans_list')),\n {\n title: 'List Inspection Plans',\n description: 'List inspection plans, optionally filtered by active state and/or stage.',\n inputSchema: {\n isActive: z.boolean().optional().describe('Only active (true) or inactive (false) plans'),\n stage: InspectionStageEnum.optional().describe('Filter by inspection stage'),\n },\n },\n async ({ isActive, stage }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n manListInspectionPlans: Array<Record<string, unknown>>;\n }>(ops.LIST_INSPECTION_PLANS, { isActive, stage });\n return jsonResult(data.manListInspectionPlans);\n } catch (error) {\n ctx.logger.error('manufacturedops inspection_plans_list failed', { error: String(error) });\n return errorResult(\n `Failed to list inspection plans: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'inspection_plans_create')),\n {\n title: 'Create Inspection Plan',\n description:\n 'Create an inspection plan (characteristics checklist). `code` and `name` are required.',\n inputSchema: {\n code: z.string().min(1).describe('Unique inspection-plan code'),\n name: z.string().min(1).describe('Plan name'),\n stage: InspectionStageEnum.optional().describe('Plan stage (default IN_PROCESS)'),\n description: z.string().optional().describe('Description'),\n productSku: z.string().optional().describe('Product SKU this plan applies to'),\n characteristics: JsonObject.optional().describe('Inspection characteristics as JSON'),\n },\n },\n async ({ code, name, stage, description, productSku, characteristics }) => {\n try {\n const input: Record<string, unknown> = { code, name };\n if (stage !== undefined) input.stage = stage;\n if (description !== undefined) input.description = description;\n if (productSku !== undefined) input.productSku = productSku;\n if (characteristics !== undefined) input.characteristics = characteristics;\n\n const data = await ctx.gql.workspace.request<{\n manCreateInspectionPlan: Record<string, unknown>;\n }>(ops.CREATE_INSPECTION_PLAN, { input });\n return jsonResult(data.manCreateInspectionPlan);\n } catch (error) {\n ctx.logger.error('manufacturedops inspection_plans_create failed', {\n error: String(error),\n });\n return errorResult(\n `Failed to create inspection plan: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Non-conformances (NCR / CAPA) ──────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'non_conformances_get')),\n {\n title: 'Get Non-Conformance',\n description:\n 'Fetch a single non-conformance (NCR) by ID, including its originating inspection.',\n inputSchema: { id: z.string().describe('Non-conformance ID') },\n },\n async ({ id }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n manNonConformance: Record<string, unknown> | null;\n }>(ops.GET_NON_CONFORMANCE, { id });\n if (!data.manNonConformance) return errorResult(`Non-conformance ${id} not found`);\n return jsonResult(data.manNonConformance);\n } catch (error) {\n ctx.logger.error('manufacturedops non_conformances_get failed', { error: String(error) });\n return errorResult(\n `Failed to get non-conformance: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'non_conformances_list')),\n {\n title: 'List Non-Conformances',\n description:\n 'List non-conformances (paginated), optionally filtered by severity and/or status.',\n inputSchema: {\n severity: SeverityEnum.optional().describe('Filter by severity'),\n status: NonConformanceStatusEnum.optional().describe('Filter by status'),\n ...PaginationFields,\n },\n },\n async ({ severity, status, limit, offset, cursor }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n manListNonConformances: { items: Array<Record<string, unknown>>; pageInfo: unknown };\n }>(ops.LIST_NON_CONFORMANCES, {\n severity,\n status,\n pagination: buildPagination({ limit, offset, cursor }),\n });\n return jsonResult(data.manListNonConformances);\n } catch (error) {\n ctx.logger.error('manufacturedops non_conformances_list failed', { error: String(error) });\n return errorResult(\n `Failed to list non-conformances: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'non_conformances_raise')),\n {\n title: 'Raise Non-Conformance',\n description:\n 'Raise a non-conformance report (NCR). `ncrNumber` and `title` are required; optionally link an inspection.',\n inputSchema: {\n ncrNumber: z.string().min(1).describe('Unique NCR number'),\n title: z.string().min(1).describe('NCR title/summary'),\n description: z.string().optional().describe('Detailed description'),\n severity: SeverityEnum.optional().describe('Severity (default MINOR)'),\n disposition: NonConformanceDispositionEnum.optional().describe(\n 'Disposition (default OPEN)',\n ),\n quantityAffected: z.number().optional().describe('Quantity of units affected'),\n inspectionId: z.string().optional().describe('Originating inspection ID'),\n ownerId: z.string().optional().describe('Owner (assignee) user ID'),\n dueDate: IsoDateTime.optional().describe('Resolution due date (ISO-8601)'),\n tags: z.array(z.string()).optional().describe('Free-form tags'),\n },\n },\n async ({\n ncrNumber,\n title,\n description,\n severity,\n disposition,\n quantityAffected,\n inspectionId,\n ownerId,\n dueDate,\n tags,\n }) => {\n try {\n const input: Record<string, unknown> = { ncrNumber, title };\n if (description !== undefined) input.description = description;\n if (severity !== undefined) input.severity = severity;\n if (disposition !== undefined) input.disposition = disposition;\n if (quantityAffected !== undefined) input.quantityAffected = quantityAffected;\n if (inspectionId !== undefined) input.inspectionId = inspectionId;\n if (ownerId !== undefined) input.ownerId = ownerId;\n if (dueDate !== undefined) input.dueDate = dueDate;\n if (tags !== undefined) input.tags = tags;\n\n const data = await ctx.gql.workspace.request<{\n manRaiseNonConformance: Record<string, unknown>;\n }>(ops.RAISE_NON_CONFORMANCE, { input });\n return jsonResult(data.manRaiseNonConformance);\n } catch (error) {\n ctx.logger.error('manufacturedops non_conformances_raise failed', { error: String(error) });\n return errorResult(\n `Failed to raise non-conformance: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'non_conformances_update')),\n {\n title: 'Update Non-Conformance',\n description:\n 'Update a non-conformance (root cause, corrective action, disposition, owner, …). At least one mutable field must be provided.',\n inputSchema: {\n id: z.string().describe('Non-conformance ID'),\n title: z.string().optional().describe('Updated title'),\n description: z.string().optional().describe('Updated description'),\n severity: SeverityEnum.optional().describe('Updated severity'),\n disposition: NonConformanceDispositionEnum.optional().describe('Updated disposition'),\n quantityAffected: z.number().optional().describe('Updated quantity affected'),\n rootCause: z.string().optional().describe('Root-cause analysis'),\n correctiveAction: z.string().optional().describe('Corrective/preventive action (CAPA)'),\n ownerId: z.string().optional().describe('Updated owner user ID'),\n dueDate: IsoDateTime.optional().describe('Updated due date (ISO-8601)'),\n tags: z.array(z.string()).optional().describe('Updated tags'),\n },\n },\n async ({\n id,\n title,\n description,\n severity,\n disposition,\n quantityAffected,\n rootCause,\n correctiveAction,\n ownerId,\n dueDate,\n tags,\n }) => {\n try {\n const input: Record<string, unknown> = {};\n if (title !== undefined) input.title = title;\n if (description !== undefined) input.description = description;\n if (severity !== undefined) input.severity = severity;\n if (disposition !== undefined) input.disposition = disposition;\n if (quantityAffected !== undefined) input.quantityAffected = quantityAffected;\n if (rootCause !== undefined) input.rootCause = rootCause;\n if (correctiveAction !== undefined) input.correctiveAction = correctiveAction;\n if (ownerId !== undefined) input.ownerId = ownerId;\n if (dueDate !== undefined) input.dueDate = dueDate;\n if (tags !== undefined) input.tags = tags;\n\n if (Object.keys(input).length === 0) {\n return errorResult('No updates specified — provide at least one mutable field');\n }\n\n const data = await ctx.gql.workspace.request<{\n manUpdateNonConformance: Record<string, unknown>;\n }>(ops.UPDATE_NON_CONFORMANCE, { id, input });\n return jsonResult(data.manUpdateNonConformance);\n } catch (error) {\n ctx.logger.error('manufacturedops non_conformances_update failed', {\n error: String(error),\n });\n return errorResult(\n `Failed to update non-conformance: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'non_conformances_transition')),\n {\n title: 'Transition Non-Conformance',\n description:\n 'Advance an NCR/CAPA through its resolution lifecycle (OPEN → INVESTIGATING → CONTAINED → CORRECTIVE_ACTION → CLOSED). Transitions are validated server-side.',\n inputSchema: {\n id: z.string().describe('Non-conformance ID'),\n status: NonConformanceStatusEnum.describe('Target status'),\n },\n },\n async ({ id, status }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n manTransitionNonConformance: Record<string, unknown>;\n }>(ops.TRANSITION_NON_CONFORMANCE, { id, status });\n return jsonResult(data.manTransitionNonConformance);\n } catch (error) {\n ctx.logger.error('manufacturedops non_conformances_transition failed', {\n error: String(error),\n });\n return errorResult(\n `Failed to transition non-conformance: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n}\n","/**\n * Manufacturedops maintenance tools — assets, work orders, and downtime/OEE.\n *\n * Surface (9) across three per-entity sub-APIs:\n * assets_{get,list,create,update}\n * maintenance_{list,create,transition}\n * downtime_{list,record}\n *\n * All root fields carry the consistent `man` server prefix\n * (manListMaintenanceWorkOrders / manRecordDowntime / …) and are called by their\n * REAL names in operations.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';\nimport {\n AssetStatusEnum,\n MaintenanceTypeEnum,\n MaintenanceStatusEnum,\n DowntimeReasonEnum,\n IsoDateTime,\n PaginationFields,\n buildPagination,\n} from './shared.js';\n\nexport function registerMaintenanceTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n // ── Assets ─────────────────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'assets_get')),\n {\n title: 'Get Asset',\n description:\n 'Fetch a single maintainable asset by ID, including its maintenance work orders.',\n inputSchema: { id: z.string().describe('Asset ID') },\n },\n async ({ id }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n manAsset: Record<string, unknown> | null;\n }>(ops.GET_ASSET, { id });\n if (!data.manAsset) return errorResult(`Asset ${id} not found`);\n return jsonResult(data.manAsset);\n } catch (error) {\n ctx.logger.error('manufacturedops assets_get failed', { error: String(error) });\n return errorResult(\n `Failed to get asset: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'assets_list')),\n {\n title: 'List Assets',\n description:\n 'List maintainable assets (paginated), optionally filtered by status and/or work center.',\n inputSchema: {\n status: AssetStatusEnum.optional().describe('Filter by asset status'),\n workCenterId: z.string().optional().describe('Filter by work center ID'),\n ...PaginationFields,\n },\n },\n async ({ status, workCenterId, limit, offset, cursor }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n manListAssets: { items: Array<Record<string, unknown>>; pageInfo: unknown };\n }>(ops.LIST_ASSETS, {\n status,\n workCenterId,\n pagination: buildPagination({ limit, offset, cursor }),\n });\n return jsonResult(data.manListAssets);\n } catch (error) {\n ctx.logger.error('manufacturedops assets_list failed', { error: String(error) });\n return errorResult(\n `Failed to list assets: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'assets_create')),\n {\n title: 'Create Asset',\n description:\n 'Register a maintainable asset (machine/equipment). `assetTag` and `name` are required.',\n inputSchema: {\n assetTag: z.string().min(1).describe('Unique asset tag'),\n name: z.string().min(1).describe('Asset display name'),\n manufacturer: z.string().optional().describe('Manufacturer'),\n model: z.string().optional().describe('Model'),\n serialNumber: z.string().optional().describe('Serial number'),\n pmIntervalHours: z.number().optional().describe('Preventive-maintenance interval (hours)'),\n runningHours: z.number().optional().describe('Current running hours'),\n workCenterId: z.string().optional().describe('Host work center ID'),\n installedAt: IsoDateTime.optional().describe('Install timestamp (ISO-8601)'),\n tags: z.array(z.string()).optional().describe('Free-form tags'),\n },\n },\n async ({\n assetTag,\n name,\n manufacturer,\n model,\n serialNumber,\n pmIntervalHours,\n runningHours,\n workCenterId,\n installedAt,\n tags,\n }) => {\n try {\n const input: Record<string, unknown> = { assetTag, name };\n if (manufacturer !== undefined) input.manufacturer = manufacturer;\n if (model !== undefined) input.model = model;\n if (serialNumber !== undefined) input.serialNumber = serialNumber;\n if (pmIntervalHours !== undefined) input.pmIntervalHours = pmIntervalHours;\n if (runningHours !== undefined) input.runningHours = runningHours;\n if (workCenterId !== undefined) input.workCenterId = workCenterId;\n if (installedAt !== undefined) input.installedAt = installedAt;\n if (tags !== undefined) input.tags = tags;\n\n const data = await ctx.gql.workspace.request<{\n manCreateAsset: Record<string, unknown>;\n }>(ops.CREATE_ASSET, { input });\n return jsonResult(data.manCreateAsset);\n } catch (error) {\n ctx.logger.error('manufacturedops assets_create failed', { error: String(error) });\n return errorResult(\n `Failed to create asset: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'assets_update')),\n {\n title: 'Update Asset',\n description:\n 'Update a maintainable asset (status, running hours, PM interval, …). At least one mutable field must be provided.',\n inputSchema: {\n id: z.string().describe('Asset ID'),\n name: z.string().optional().describe('Updated name'),\n manufacturer: z.string().optional().describe('Updated manufacturer'),\n model: z.string().optional().describe('Updated model'),\n serialNumber: z.string().optional().describe('Updated serial number'),\n status: AssetStatusEnum.optional().describe('Updated asset status'),\n pmIntervalHours: z.number().optional().describe('Updated PM interval (hours)'),\n runningHours: z.number().optional().describe('Updated running hours'),\n workCenterId: z.string().optional().describe('Updated host work center ID'),\n tags: z.array(z.string()).optional().describe('Updated tags'),\n },\n },\n async ({\n id,\n name,\n manufacturer,\n model,\n serialNumber,\n status,\n pmIntervalHours,\n runningHours,\n workCenterId,\n tags,\n }) => {\n try {\n const input: Record<string, unknown> = {};\n if (name !== undefined) input.name = name;\n if (manufacturer !== undefined) input.manufacturer = manufacturer;\n if (model !== undefined) input.model = model;\n if (serialNumber !== undefined) input.serialNumber = serialNumber;\n if (status !== undefined) input.status = status;\n if (pmIntervalHours !== undefined) input.pmIntervalHours = pmIntervalHours;\n if (runningHours !== undefined) input.runningHours = runningHours;\n if (workCenterId !== undefined) input.workCenterId = workCenterId;\n if (tags !== undefined) input.tags = tags;\n\n if (Object.keys(input).length === 0) {\n return errorResult('No updates specified — provide at least one mutable field');\n }\n\n const data = await ctx.gql.workspace.request<{\n manUpdateAsset: Record<string, unknown>;\n }>(ops.UPDATE_ASSET, { id, input });\n return jsonResult(data.manUpdateAsset);\n } catch (error) {\n ctx.logger.error('manufacturedops assets_update failed', { error: String(error) });\n return errorResult(\n `Failed to update asset: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Maintenance work orders ────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'maintenance_list')),\n {\n title: 'List Maintenance Work Orders',\n description:\n 'List maintenance work orders (paginated), optionally filtered by asset and/or status.',\n inputSchema: {\n assetId: z.string().optional().describe('Filter by asset ID'),\n status: MaintenanceStatusEnum.optional().describe('Filter by work-order status'),\n ...PaginationFields,\n },\n },\n async ({ assetId, status, limit, offset, cursor }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n manListMaintenanceWorkOrders: {\n items: Array<Record<string, unknown>>;\n pageInfo: unknown;\n };\n }>(ops.LIST_MAINTENANCE_WORK_ORDERS, {\n assetId,\n status,\n pagination: buildPagination({ limit, offset, cursor }),\n });\n return jsonResult(data.manListMaintenanceWorkOrders);\n } catch (error) {\n ctx.logger.error('manufacturedops maintenance_list failed', { error: String(error) });\n return errorResult(\n `Failed to list maintenance work orders: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'maintenance_create')),\n {\n title: 'Create Maintenance Work Order',\n description:\n 'Create a maintenance work order against an asset. `woNumber`, `title`, and `assetId` are required.',\n inputSchema: {\n woNumber: z.string().min(1).describe('Unique work-order number'),\n title: z.string().min(1).describe('Work-order title'),\n assetId: z.string().min(1).describe('Target asset ID'),\n type: MaintenanceTypeEnum.optional().describe('Maintenance type (default PREVENTIVE)'),\n description: z.string().optional().describe('Description'),\n technicianId: z.string().optional().describe('Assigned technician user ID'),\n scheduledFor: IsoDateTime.optional().describe('Scheduled timestamp (ISO-8601)'),\n },\n },\n async ({ woNumber, title, assetId, type, description, technicianId, scheduledFor }) => {\n try {\n const input: Record<string, unknown> = { woNumber, title, assetId };\n if (type !== undefined) input.type = type;\n if (description !== undefined) input.description = description;\n if (technicianId !== undefined) input.technicianId = technicianId;\n if (scheduledFor !== undefined) input.scheduledFor = scheduledFor;\n\n const data = await ctx.gql.workspace.request<{\n manCreateMaintenanceWorkOrder: Record<string, unknown>;\n }>(ops.CREATE_MAINTENANCE_WORK_ORDER, { input });\n return jsonResult(data.manCreateMaintenanceWorkOrder);\n } catch (error) {\n ctx.logger.error('manufacturedops maintenance_create failed', { error: String(error) });\n return errorResult(\n `Failed to create maintenance work order: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'maintenance_transition')),\n {\n title: 'Transition Maintenance Work Order',\n description:\n 'Advance a maintenance work order through its lifecycle (SCHEDULED → IN_PROGRESS → COMPLETED, or ON_HOLD/CANCELLED). Transitions are validated server-side.',\n inputSchema: {\n id: z.string().describe('Maintenance work order ID'),\n status: MaintenanceStatusEnum.describe('Target status'),\n },\n },\n async ({ id, status }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n manTransitionMaintenanceWorkOrder: Record<string, unknown>;\n }>(ops.TRANSITION_MAINTENANCE_WORK_ORDER, { id, status });\n return jsonResult(data.manTransitionMaintenanceWorkOrder);\n } catch (error) {\n ctx.logger.error('manufacturedops maintenance_transition failed', {\n error: String(error),\n });\n return errorResult(\n `Failed to transition maintenance work order: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Downtime events ────────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'downtime_list')),\n {\n title: 'List Downtime Events',\n description:\n 'List downtime events, optionally filtered by asset, work center, and/or reason.',\n inputSchema: {\n assetId: z.string().optional().describe('Filter by asset ID'),\n workCenterId: z.string().optional().describe('Filter by work center ID'),\n reason: DowntimeReasonEnum.optional().describe('Filter by downtime reason'),\n },\n },\n async ({ assetId, workCenterId, reason }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n manListDowntimeEvents: Array<Record<string, unknown>>;\n }>(ops.LIST_DOWNTIME_EVENTS, { assetId, workCenterId, reason });\n return jsonResult(data.manListDowntimeEvents);\n } catch (error) {\n ctx.logger.error('manufacturedops downtime_list failed', { error: String(error) });\n return errorResult(\n `Failed to list downtime events: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'downtime_record')),\n {\n title: 'Record Downtime Event',\n description:\n 'Record a downtime event against an asset, work center, and/or production order. `startedAt` is required.',\n inputSchema: {\n startedAt: IsoDateTime.describe('Downtime start timestamp (ISO-8601)'),\n reason: DowntimeReasonEnum.optional().describe('Downtime reason (default BREAKDOWN)'),\n description: z.string().optional().describe('Description'),\n durationMinutes: z.number().int().optional().describe('Duration in minutes'),\n endedAt: IsoDateTime.optional().describe('Downtime end timestamp (ISO-8601)'),\n assetId: z.string().optional().describe('Affected asset ID'),\n workCenterId: z.string().optional().describe('Affected work center ID'),\n productionOrderId: z.string().optional().describe('Affected production order ID'),\n },\n },\n async ({\n startedAt,\n reason,\n description,\n durationMinutes,\n endedAt,\n assetId,\n workCenterId,\n productionOrderId,\n }) => {\n try {\n const input: Record<string, unknown> = { startedAt };\n if (reason !== undefined) input.reason = reason;\n if (description !== undefined) input.description = description;\n if (durationMinutes !== undefined) input.durationMinutes = durationMinutes;\n if (endedAt !== undefined) input.endedAt = endedAt;\n if (assetId !== undefined) input.assetId = assetId;\n if (workCenterId !== undefined) input.workCenterId = workCenterId;\n if (productionOrderId !== undefined) input.productionOrderId = productionOrderId;\n\n const data = await ctx.gql.workspace.request<{\n manRecordDowntime: Record<string, unknown>;\n }>(ops.RECORD_DOWNTIME, { input });\n return jsonResult(data.manRecordDowntime);\n } catch (error) {\n ctx.logger.error('manufacturedops downtime_record failed', { error: String(error) });\n return errorResult(\n `Failed to record downtime: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n}\n","/**\n * Manufacturedops health tool.\n *\n * Surface (1): health. Maps to the @public `manHealth` query (no auth required)\n * — the subgraph's liveness/identity probe. Mirrors the ecosystem-standard\n * `health` tool name used by kadaikodi / proserviceworld / artistrybase.\n */\n\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\nexport function registerHealthTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n server.registerTool(\n track(mcpToolName(ctx.productName, 'health')),\n {\n title: 'Manufacturedops Health Check',\n description:\n 'Public liveness/identity probe for the Manufacturedops subgraph (manHealth). Requires no authentication.',\n inputSchema: {},\n },\n async () => {\n try {\n const data = await ctx.gql.workspace.request<{ manHealth: string }>(ops.HEALTH, {});\n return jsonResult({ ok: true, status: data.manHealth });\n } catch (error) {\n ctx.logger.error('manufacturedops health failed', { error: String(error) });\n return errorResult(\n `Manufacturedops health check failed: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n}\n","import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { mcpResourceUri, type McpContext } from '../../core/index.js';\nimport { LIST_PRODUCTION_ORDERS, LIST_WORK_CENTERS, LIST_NON_CONFORMANCES } from './operations.js';\n\n/**\n * Read-only Manufacturedops MCP resources. URIs are product-prefixed via\n * mcpResourceUri so they don't collide when multiple MCP servers run side by\n * side. Each is tracked at function entry so the shell manifest reflects what\n * was registered even though registration is imperative.\n */\nexport function registerManufacturedopsResources(\n server: McpServer,\n ctx: McpContext,\n track: (uri: string) => string,\n): void {\n const schemaUri = track(mcpResourceUri(ctx.productName, 'schema'));\n const ordersUri = track(mcpResourceUri(ctx.productName, 'production-orders'));\n const workCentersUri = track(mcpResourceUri(ctx.productName, 'work-centers'));\n const ncrUri = track(mcpResourceUri(ctx.productName, 'non-conformances'));\n\n // <product>://schema — domain overview\n server.registerResource(\n 'manufacturedops-schema',\n schemaUri,\n {\n title: 'Manufacturedops Domain Schema',\n description:\n 'Overview of the Manufacturedops MES domain — entities, enums, and the per-domain tool surface.',\n mimeType: 'text/plain',\n },\n async () => {\n ctx.logger.debug(`Resource ${schemaUri} requested`);\n const schema = `# Manufacturedops Domain (Overview)\n\nManufacturing Operations Platform (MES): production planning & shop-floor\nexecution, quality & traceability, and maintenance & OEE.\n\n## Entities\n- ManWorkCenter — a machine/line/cell/manual station (has operations)\n- ManProductionOrder — a manufacturing order (has operations + material lots)\n- ManProductionOperation — a routing step on a production order\n- ManMaterialLot — a traceable material lot (genealogy via parent/child)\n- ManQualityInspection — a recorded inspection (links plan + non-conformances)\n- ManInspectionPlan — a reusable inspection characteristics checklist\n- ManNonConformance — an NCR/CAPA (links originating inspection)\n- ManAsset — a maintainable asset (has maintenance work orders)\n- ManMaintenanceWorkOrder — a maintenance job against an asset\n- ManDowntimeEvent — a recorded downtime event (asset/work-center/order)\n\n## Enums\n- ManWorkCenterType: ASSEMBLY, CELL, LINE, MACHINE, MANUAL\n- ManProductionOrderStatus: PLANNED, RELEASED, IN_PROGRESS, PAUSED, COMPLETED, CLOSED, CANCELLED\n- ManProductionPriority: LOW, NORMAL, HIGH, URGENT\n- ManOperationStatus: PENDING, SETUP, RUNNING, DONE, SKIPPED\n- ManMaterialLotStatus: AVAILABLE, ALLOCATED, CONSUMED, QUARANTINED, SCRAPPED\n- ManInspectionStage: INCOMING, IN_PROCESS, FINAL, AUDIT\n- ManInspectionResult: PENDING, PASS, FAIL, CONDITIONAL\n- ManSeverity: MINOR, MAJOR, CRITICAL\n- ManNonConformanceStatus: OPEN, INVESTIGATING, CONTAINED, CORRECTIVE_ACTION, CLOSED\n- ManNonConformanceDisposition: OPEN, USE_AS_IS, REWORK, SCRAP, RETURN_TO_SUPPLIER\n- ManAssetStatus: OPERATIONAL, DEGRADED, DOWN, MAINTENANCE, RETIRED\n- ManMaintenanceType: PREVENTIVE, CORRECTIVE, PREDICTIVE, INSPECTION\n- ManMaintenanceStatus: SCHEDULED, IN_PROGRESS, ON_HOLD, COMPLETED, CANCELLED\n- ManDowntimeReason: PLANNED, BREAKDOWN, CHANGEOVER, MATERIAL_SHORTAGE, QUALITY, OTHER\n\n## Tool groups\nproduction (work_centers, production_orders, operations, material_lots),\nquality (inspections, inspection_plans, non_conformances),\nmaintenance (assets, maintenance work orders, downtime), plus the public health probe.\nAll run against the WORKSPACE gateway (workspace-scoped) except the public health probe.\n`;\n return {\n contents: [{ uri: schemaUri, text: schema, mimeType: 'text/plain' }],\n };\n },\n );\n\n // <product>://production-orders — open production orders\n server.registerResource(\n 'manufacturedops-production-orders',\n ordersUri,\n {\n title: 'Manufacturedops Production Orders',\n description: 'The first 50 production orders in the bound workspace.',\n mimeType: 'application/json',\n },\n async () => {\n ctx.logger.debug(`Resource ${ordersUri} requested`);\n try {\n const data = await ctx.gql.workspace.request<{ manListProductionOrders: unknown }>(\n LIST_PRODUCTION_ORDERS,\n { pagination: { limit: 50, offset: 0 } },\n );\n return {\n contents: [\n {\n uri: ordersUri,\n text: JSON.stringify(data.manListProductionOrders, null, 2),\n mimeType: 'application/json',\n },\n ],\n };\n } catch (error) {\n return {\n contents: [\n {\n uri: ordersUri,\n text: JSON.stringify({\n error: error instanceof Error ? error.message : String(error),\n }),\n mimeType: 'application/json',\n },\n ],\n };\n }\n },\n );\n\n // <product>://work-centers — active work-center directory\n server.registerResource(\n 'manufacturedops-work-centers',\n workCentersUri,\n {\n title: 'Manufacturedops Work Centers',\n description: 'Active work centers in the bound workspace.',\n mimeType: 'application/json',\n },\n async () => {\n ctx.logger.debug(`Resource ${workCentersUri} requested`);\n try {\n const data = await ctx.gql.workspace.request<{ manListWorkCenters: unknown }>(\n LIST_WORK_CENTERS,\n { isActive: true },\n );\n return {\n contents: [\n {\n uri: workCentersUri,\n text: JSON.stringify(data.manListWorkCenters, null, 2),\n mimeType: 'application/json',\n },\n ],\n };\n } catch (error) {\n return {\n contents: [\n {\n uri: workCentersUri,\n text: JSON.stringify({\n error: error instanceof Error ? error.message : String(error),\n }),\n mimeType: 'application/json',\n },\n ],\n };\n }\n },\n );\n\n // <product>://non-conformances — open NCR/CAPA queue\n server.registerResource(\n 'manufacturedops-non-conformances',\n ncrUri,\n {\n title: 'Manufacturedops Non-Conformances',\n description: 'The first 50 non-conformances (NCR/CAPA) in the bound workspace.',\n mimeType: 'application/json',\n },\n async () => {\n ctx.logger.debug(`Resource ${ncrUri} requested`);\n try {\n const data = await ctx.gql.workspace.request<{ manListNonConformances: unknown }>(\n LIST_NON_CONFORMANCES,\n { pagination: { limit: 50, offset: 0 } },\n );\n return {\n contents: [\n {\n uri: ncrUri,\n text: JSON.stringify(data.manListNonConformances, null, 2),\n mimeType: 'application/json',\n },\n ],\n };\n } catch (error) {\n return {\n contents: [\n {\n uri: ncrUri,\n text: JSON.stringify({\n error: error instanceof Error ? error.message : String(error),\n }),\n mimeType: 'application/json',\n },\n ],\n };\n }\n },\n );\n}\n","import { z } from 'zod';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { mcpPromptName, type McpContext } from '../../core/index.js';\n\n/**\n * Manufacturedops MCP prompts — guided multi-step workflows. Names are\n * product-prefixed via mcpPromptName and tracked at function entry.\n */\nexport function registerManufacturedopsPrompts(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n const p = ctx.productName;\n const orderName = track(mcpPromptName(p, 'production-order-runbook'));\n const qualityName = track(mcpPromptName(p, 'quality-maintenance-ops'));\n\n // <product>-production-order-runbook — plan + run an order end to end\n server.registerPrompt(\n orderName,\n {\n title: 'Production Order Runbook',\n description:\n 'Guide for planning and running a production order end to end: create the order, add routing operations, allocate material lots, release and progress through the shop floor, and inspect output.',\n argsSchema: {\n productSku: z.string().optional().describe('Product SKU to manufacture'),\n orderNumber: z.string().optional().describe('Order number to assign'),\n },\n },\n ({ productSku, orderNumber }) => {\n ctx.logger.debug(`Prompt ${orderName} called`, { productSku, orderNumber });\n const skuNote = productSku\n ? `Manufacture product SKU \"${productSku}\".`\n : 'Ask the user for the product SKU.';\n const orderNote = orderNumber\n ? `Use order number \"${orderNumber}\".`\n : 'Assign a unique order number.';\n return {\n messages: [\n {\n role: 'user' as const,\n content: {\n type: 'text' as const,\n text: `Help me plan and run a Manufacturedops production order.\n\n1. **Work Centers**: Use ${p}_work_centers_list to confirm the available work centers (create any missing ones with ${p}_work_centers_create).\n2. **Create Order**: Use ${p}_production_orders_create. ${skuNote} ${orderNote} Set quantity, uom, priority, and planned start/end.\n3. **Add Routing**: Use ${p}_operations_add for each step (name + sequence + workCenterId).\n4. **Allocate Materials**: Use ${p}_material_lots_create for incoming lots, then ${p}_material_lots_set_status=ALLOCATED for the order.\n5. **Release & Run**: Use ${p}_production_orders_transition (PLANNED → RELEASED → IN_PROGRESS). Log progress with ${p}_operations_record (setup/run minutes, good/scrap counts, status).\n6. **Inspect**: Use ${p}_inspections_record at the relevant stage; if it FAILs, raise an NCR with ${p}_non_conformances_raise.\n7. **Close**: Use ${p}_production_orders_transition (COMPLETED → CLOSED) when quantityDone meets target.\n\nShow results at each step and confirm before releasing and before closing.`,\n },\n },\n ],\n };\n },\n );\n\n // <product>-quality-maintenance-ops — daily quality + maintenance ops\n server.registerPrompt(\n qualityName,\n {\n title: 'Quality & Maintenance Operations',\n description:\n 'Daily operations workflow: triage the NCR/CAPA queue, drive corrective actions, review asset health, schedule maintenance, and log downtime for OEE.',\n argsSchema: {\n assetId: z.string().optional().describe('Asset ID to focus maintenance on'),\n },\n },\n ({ assetId }) => {\n ctx.logger.debug(`Prompt ${qualityName} called`, { assetId });\n const assetNote = assetId\n ? `Focus maintenance on asset \"${assetId}\".`\n : `First list assets with ${p}_assets_list and pick the ones needing attention.`;\n return {\n messages: [\n {\n role: 'user' as const,\n content: {\n type: 'text' as const,\n text: `Run daily Manufacturedops quality & maintenance operations. ${assetNote}\n\n1. **NCR Queue**: Use ${p}_non_conformances_list filtered by status=OPEN (and severity=CRITICAL/MAJOR) to find open issues.\n2. **Drive CAPA**: For each, use ${p}_non_conformances_update to record rootCause + correctiveAction, then ${p}_non_conformances_transition (INVESTIGATING → CONTAINED → CORRECTIVE_ACTION → CLOSED).\n3. **Asset Health**: Use ${p}_assets_list filtered by status=DEGRADED/DOWN; inspect each with ${p}_assets_get to review running hours vs PM interval.\n4. **Schedule Maintenance**: Use ${p}_maintenance_create for due PM/corrective jobs, then ${p}_maintenance_transition (SCHEDULED → IN_PROGRESS → COMPLETED).\n5. **Downtime / OEE**: Use ${p}_downtime_record for any stoppages and ${p}_downtime_list to review losses by reason.\n6. **Inspections**: Use ${p}_inspections_list filtered by result=FAIL to catch recurring quality escapes.\n\nSummarize what needs attention after each step.`,\n },\n },\n ],\n };\n },\n );\n}\n","/**\n * Manufacturedops module — domain module for the future-products ecosystem program.\n *\n * Covers all 10 @key entities of wspace-manufacturedops-svc grouped into three\n * shop-floor domains plus a public health probe:\n * - production: work centers, production orders, operations, material lots\n * - quality: inspections, inspection plans, non-conformances (NCR/CAPA)\n * - maintenance: assets, maintenance work orders, downtime events\n * - health: the @public manHealth liveness probe\n *\n * Mirrors the kadaikodi / crewfoundry modules' structure (tools/<domain>.ts +\n * resources.ts + prompts.ts) and the canonical tags module's typing discipline.\n *\n * Backend: ~/products/wspace/manufacturedops/wspace-manufacturedops-svc/\n * (Hive service name `manufacturedops`). All operations run against the\n * WORKSPACE gateway; every root field carries the consistent `man` server prefix\n * and the @public manHealth probe is exposed as `<product>_health`.\n */\n\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport type { McpContext, McpModule, ModuleRegistration } from '../../core/index.js';\nimport { registerProductionTools } from './tools/production.js';\nimport { registerQualityTools } from './tools/quality.js';\nimport { registerMaintenanceTools } from './tools/maintenance.js';\nimport { registerHealthTools } from './tools/health.js';\nimport { registerManufacturedopsResources } from './resources.js';\nimport { registerManufacturedopsPrompts } from './prompts.js';\n\nconst manufacturedopsModule: McpModule = {\n id: 'manufacturedops',\n version: '0.0.1',\n displayName: 'Manufacturedops',\n dependsOn: ['auth'],\n capabilities: { tools: {}, resources: {}, prompts: {} },\n\n register(server: McpServer, ctx: McpContext): ModuleRegistration {\n const tools: string[] = [];\n const resources: string[] = [];\n const prompts: string[] = [];\n\n const trackTool = (n: string): string => {\n tools.push(n);\n return n;\n };\n const trackResource = (uri: string): string => {\n resources.push(uri);\n return uri;\n };\n const trackPrompt = (n: string): string => {\n prompts.push(n);\n return n;\n };\n\n registerProductionTools(server, ctx, trackTool);\n registerQualityTools(server, ctx, trackTool);\n registerMaintenanceTools(server, ctx, trackTool);\n registerHealthTools(server, ctx, trackTool);\n\n registerManufacturedopsResources(server, ctx, trackResource);\n registerManufacturedopsPrompts(server, ctx, trackPrompt);\n\n return { tools, resources, prompts };\n },\n};\n\nexport default manufacturedopsModule;\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/core/errors.ts","../../../src/core/tool-name.ts","../../../src/core/result.ts","../../../src/modules/manufacturedops/operations.ts","../../../src/modules/manufacturedops/tools/shared.ts","../../../src/modules/manufacturedops/tools/production.ts","../../../src/modules/manufacturedops/tools/quality.ts","../../../src/modules/manufacturedops/tools/maintenance.ts","../../../src/modules/manufacturedops/tools/health.ts","../../../src/modules/manufacturedops/resources.ts","../../../src/modules/manufacturedops/prompts.ts","../../../src/modules/manufacturedops/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;;;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AAQ,KAAK,WAAW,CAAA;AAEvD,IAAA,OAAO,EAAE,KAAA,EAAO,SAAA,EAAW,OAAA,EAAQ;AAAA,EACrC;AACF,CAAA;AAEA,IAAO,uBAAA,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 * Centralized GraphQL operations for the Manufacturedops MCP module.\n *\n * Manufacturedops is the Manufacturing Operations Platform (MES) for the\n * future-products ecosystem — production planning & shop-floor execution,\n * quality & traceability, and maintenance & OEE. Backend subgraph:\n * ~/products/wspace/manufacturedops/wspace-manufacturedops-svc/ (Hive service\n * name `manufacturedops`).\n *\n * All operations run against the WORKSPACE gateway. Workspace scoping is carried\n * by the gateway headers (x-workspace-id / X-Workspace-Authorization) issued by\n * the auth module — Manufacturedops inputs do NOT carry a workspaceId.\n *\n * The subgraph is consistently prefixed: every product type/enum/input is\n * `Man*` and every root field is `man*` (manListProductionOrders,\n * manCreateWorkCenter, manAsset, manHealth). Every field is called by its REAL\n * server name here.\n *\n * Uses template-string interpolation (not gql tagged fragments) to match the\n * canonical vibecontrols / kadaikodi / crewfoundry modules' operations files.\n */\n\n// ---------------------------------------------------------------------------\n// Field fragments (mirror the backend object types)\n// ---------------------------------------------------------------------------\n\nexport const WORK_CENTER_FIELDS = `\n id code name description type capacityHours idealRunRate isActive tags\n createdAt updatedAt workspaceId\n`;\n\nexport const PRODUCTION_OPERATION_FIELDS = `\n id productionOrderId name sequence status workCenterId operatorId\n setupMinutes runMinutes goodCount scrapCount startedAt completedAt\n createdAt updatedAt workspaceId\n`;\n\nexport const MATERIAL_LOT_FIELDS = `\n id lotNumber materialSku materialName quantity uom status supplier\n receivedAt expiresAt productionOrderId parentLotId tags\n createdAt updatedAt workspaceId\n`;\n\nexport const PRODUCTION_ORDER_FIELDS = `\n id orderNumber productSku productName quantity quantityDone uom priority status\n plannedStart plannedEnd actualStart actualEnd dueDate erpReference notes tags\n createdAt updatedAt workspaceId\n`;\n\nexport const INSPECTION_PLAN_FIELDS = `\n id code name description stage productSku characteristics isActive\n createdAt updatedAt workspaceId\n`;\n\nexport const QUALITY_INSPECTION_FIELDS = `\n id stage result sampleSize defectCount measurements notes\n inspectionPlanId productionOrderId materialLotId workCenterId inspectorId\n inspectedAt createdAt updatedAt workspaceId\n`;\n\nexport const NON_CONFORMANCE_FIELDS = `\n id ncrNumber title description severity status disposition\n quantityAffected rootCause correctiveAction ownerId inspectionId\n dueDate resolvedAt tags createdAt updatedAt workspaceId\n`;\n\nexport const ASSET_FIELDS = `\n id assetTag name manufacturer model serialNumber status\n pmIntervalHours runningHours workCenterId installedAt lastServicedAt\n tags createdAt updatedAt workspaceId\n`;\n\nexport const MAINTENANCE_WORK_ORDER_FIELDS = `\n id woNumber title description type status assetId technicianId\n scheduledFor startedAt completedAt laborMinutes downtimeMinutes\n createdAt updatedAt workspaceId\n`;\n\nexport const DOWNTIME_EVENT_FIELDS = `\n id reason description durationMinutes assetId workCenterId productionOrderId\n startedAt endedAt createdAt updatedAt workspaceId\n`;\n\nconst PAGE_INFO = `pageInfo { cursor hasMore }`;\n\n// ---------------------------------------------------------------------------\n// Work centers\n// ---------------------------------------------------------------------------\n\nexport const GET_WORK_CENTER = `\n query ManGetWorkCenter($id: ID!) {\n manWorkCenter(id: $id) {\n ${WORK_CENTER_FIELDS}\n operations { id name sequence status productionOrderId }\n }\n }\n`;\n\nexport const LIST_WORK_CENTERS = `\n query ManListWorkCenters($isActive: Boolean) {\n manListWorkCenters(isActive: $isActive) {\n ${WORK_CENTER_FIELDS}\n }\n }\n`;\n\nexport const CREATE_WORK_CENTER = `\n mutation ManCreateWorkCenter($input: ManCreateWorkCenterInput!) {\n manCreateWorkCenter(input: $input) {\n ${WORK_CENTER_FIELDS}\n }\n }\n`;\n\nexport const UPDATE_WORK_CENTER = `\n mutation ManUpdateWorkCenter($id: ID!, $input: ManUpdateWorkCenterInput!) {\n manUpdateWorkCenter(id: $id, input: $input) {\n ${WORK_CENTER_FIELDS}\n }\n }\n`;\n\nexport const ARCHIVE_WORK_CENTER = `\n mutation ManArchiveWorkCenter($id: ID!) {\n manArchiveWorkCenter(id: $id)\n }\n`;\n\n// ---------------------------------------------------------------------------\n// Production orders + operations\n// ---------------------------------------------------------------------------\n\nexport const GET_PRODUCTION_ORDER = `\n query ManGetProductionOrder($id: ID!) {\n manProductionOrder(id: $id) {\n ${PRODUCTION_ORDER_FIELDS}\n operations { ${PRODUCTION_OPERATION_FIELDS} }\n materialLots { ${MATERIAL_LOT_FIELDS} }\n }\n }\n`;\n\nexport const LIST_PRODUCTION_ORDERS = `\n query ManListProductionOrders(\n $pagination: PaginationInput\n $productSku: String\n $status: ManProductionOrderStatus\n ) {\n manListProductionOrders(pagination: $pagination, productSku: $productSku, status: $status) {\n items { ${PRODUCTION_ORDER_FIELDS} }\n ${PAGE_INFO}\n }\n }\n`;\n\nexport const CREATE_PRODUCTION_ORDER = `\n mutation ManCreateProductionOrder($input: ManCreateProductionOrderInput!) {\n manCreateProductionOrder(input: $input) {\n ${PRODUCTION_ORDER_FIELDS}\n }\n }\n`;\n\nexport const UPDATE_PRODUCTION_ORDER = `\n mutation ManUpdateProductionOrder($id: ID!, $input: ManUpdateProductionOrderInput!) {\n manUpdateProductionOrder(id: $id, input: $input) {\n ${PRODUCTION_ORDER_FIELDS}\n }\n }\n`;\n\nexport const TRANSITION_PRODUCTION_ORDER = `\n mutation ManTransitionProductionOrder($id: ID!, $status: ManProductionOrderStatus!) {\n manTransitionProductionOrder(id: $id, status: $status) {\n ${PRODUCTION_ORDER_FIELDS}\n }\n }\n`;\n\nexport const ADD_OPERATION = `\n mutation ManAddOperation($input: ManCreateOperationInput!) {\n manAddOperation(input: $input) {\n ${PRODUCTION_OPERATION_FIELDS}\n }\n }\n`;\n\nexport const RECORD_OPERATION = `\n mutation ManRecordOperation($id: ID!, $input: ManRecordOperationInput!) {\n manRecordOperation(id: $id, input: $input) {\n ${PRODUCTION_OPERATION_FIELDS}\n }\n }\n`;\n\n// ---------------------------------------------------------------------------\n// Material lots\n// ---------------------------------------------------------------------------\n\nexport const LIST_MATERIAL_LOTS = `\n query ManListMaterialLots(\n $pagination: PaginationInput\n $productionOrderId: ID\n $status: ManMaterialLotStatus\n ) {\n manListMaterialLots(\n pagination: $pagination\n productionOrderId: $productionOrderId\n status: $status\n ) {\n items { ${MATERIAL_LOT_FIELDS} }\n ${PAGE_INFO}\n }\n }\n`;\n\nexport const CREATE_MATERIAL_LOT = `\n mutation ManCreateMaterialLot($input: ManCreateMaterialLotInput!) {\n manCreateMaterialLot(input: $input) {\n ${MATERIAL_LOT_FIELDS}\n }\n }\n`;\n\nexport const SET_MATERIAL_LOT_STATUS = `\n mutation ManSetMaterialLotStatus($id: ID!, $status: ManMaterialLotStatus!) {\n manSetMaterialLotStatus(id: $id, status: $status) {\n ${MATERIAL_LOT_FIELDS}\n }\n }\n`;\n\n// ---------------------------------------------------------------------------\n// Quality inspections + plans\n// ---------------------------------------------------------------------------\n\nexport const GET_INSPECTION = `\n query ManGetInspection($id: ID!) {\n manInspection(id: $id) {\n ${QUALITY_INSPECTION_FIELDS}\n inspectionPlan { ${INSPECTION_PLAN_FIELDS} }\n nonConformances { ${NON_CONFORMANCE_FIELDS} }\n }\n }\n`;\n\nexport const LIST_INSPECTIONS = `\n query ManListInspections(\n $pagination: PaginationInput\n $productionOrderId: ID\n $result: ManInspectionResult\n ) {\n manListInspections(\n pagination: $pagination\n productionOrderId: $productionOrderId\n result: $result\n ) {\n items { ${QUALITY_INSPECTION_FIELDS} }\n ${PAGE_INFO}\n }\n }\n`;\n\nexport const RECORD_INSPECTION = `\n mutation ManRecordInspection($input: ManRecordInspectionInput!) {\n manRecordInspection(input: $input) {\n ${QUALITY_INSPECTION_FIELDS}\n }\n }\n`;\n\nexport const LIST_INSPECTION_PLANS = `\n query ManListInspectionPlans($isActive: Boolean, $stage: ManInspectionStage) {\n manListInspectionPlans(isActive: $isActive, stage: $stage) {\n ${INSPECTION_PLAN_FIELDS}\n }\n }\n`;\n\nexport const CREATE_INSPECTION_PLAN = `\n mutation ManCreateInspectionPlan($input: ManCreateInspectionPlanInput!) {\n manCreateInspectionPlan(input: $input) {\n ${INSPECTION_PLAN_FIELDS}\n }\n }\n`;\n\n// ---------------------------------------------------------------------------\n// Non-conformances (NCR / CAPA)\n// ---------------------------------------------------------------------------\n\nexport const GET_NON_CONFORMANCE = `\n query ManGetNonConformance($id: ID!) {\n manNonConformance(id: $id) {\n ${NON_CONFORMANCE_FIELDS}\n inspection { ${QUALITY_INSPECTION_FIELDS} }\n }\n }\n`;\n\nexport const LIST_NON_CONFORMANCES = `\n query ManListNonConformances(\n $pagination: PaginationInput\n $severity: ManSeverity\n $status: ManNonConformanceStatus\n ) {\n manListNonConformances(pagination: $pagination, severity: $severity, status: $status) {\n items { ${NON_CONFORMANCE_FIELDS} }\n ${PAGE_INFO}\n }\n }\n`;\n\nexport const RAISE_NON_CONFORMANCE = `\n mutation ManRaiseNonConformance($input: ManRaiseNonConformanceInput!) {\n manRaiseNonConformance(input: $input) {\n ${NON_CONFORMANCE_FIELDS}\n }\n }\n`;\n\nexport const UPDATE_NON_CONFORMANCE = `\n mutation ManUpdateNonConformance($id: ID!, $input: ManUpdateNonConformanceInput!) {\n manUpdateNonConformance(id: $id, input: $input) {\n ${NON_CONFORMANCE_FIELDS}\n }\n }\n`;\n\nexport const TRANSITION_NON_CONFORMANCE = `\n mutation ManTransitionNonConformance($id: ID!, $status: ManNonConformanceStatus!) {\n manTransitionNonConformance(id: $id, status: $status) {\n ${NON_CONFORMANCE_FIELDS}\n }\n }\n`;\n\n// ---------------------------------------------------------------------------\n// Assets\n// ---------------------------------------------------------------------------\n\nexport const GET_ASSET = `\n query ManGetAsset($id: ID!) {\n manAsset(id: $id) {\n ${ASSET_FIELDS}\n workOrders { ${MAINTENANCE_WORK_ORDER_FIELDS} }\n }\n }\n`;\n\nexport const LIST_ASSETS = `\n query ManListAssets(\n $pagination: PaginationInput\n $status: ManAssetStatus\n $workCenterId: ID\n ) {\n manListAssets(pagination: $pagination, status: $status, workCenterId: $workCenterId) {\n items { ${ASSET_FIELDS} }\n ${PAGE_INFO}\n }\n }\n`;\n\nexport const CREATE_ASSET = `\n mutation ManCreateAsset($input: ManCreateAssetInput!) {\n manCreateAsset(input: $input) {\n ${ASSET_FIELDS}\n }\n }\n`;\n\nexport const UPDATE_ASSET = `\n mutation ManUpdateAsset($id: ID!, $input: ManUpdateAssetInput!) {\n manUpdateAsset(id: $id, input: $input) {\n ${ASSET_FIELDS}\n }\n }\n`;\n\n// ---------------------------------------------------------------------------\n// Maintenance work orders\n// ---------------------------------------------------------------------------\n\nexport const LIST_MAINTENANCE_WORK_ORDERS = `\n query ManListMaintenanceWorkOrders(\n $assetId: ID\n $pagination: PaginationInput\n $status: ManMaintenanceStatus\n ) {\n manListMaintenanceWorkOrders(assetId: $assetId, pagination: $pagination, status: $status) {\n items {\n ${MAINTENANCE_WORK_ORDER_FIELDS}\n asset { id assetTag name status }\n }\n ${PAGE_INFO}\n }\n }\n`;\n\nexport const CREATE_MAINTENANCE_WORK_ORDER = `\n mutation ManCreateMaintenanceWorkOrder($input: ManCreateMaintenanceWorkOrderInput!) {\n manCreateMaintenanceWorkOrder(input: $input) {\n ${MAINTENANCE_WORK_ORDER_FIELDS}\n }\n }\n`;\n\nexport const TRANSITION_MAINTENANCE_WORK_ORDER = `\n mutation ManTransitionMaintenanceWorkOrder($id: ID!, $status: ManMaintenanceStatus!) {\n manTransitionMaintenanceWorkOrder(id: $id, status: $status) {\n ${MAINTENANCE_WORK_ORDER_FIELDS}\n }\n }\n`;\n\n// ---------------------------------------------------------------------------\n// Downtime events\n// ---------------------------------------------------------------------------\n\nexport const LIST_DOWNTIME_EVENTS = `\n query ManListDowntimeEvents($assetId: ID, $reason: ManDowntimeReason, $workCenterId: ID) {\n manListDowntimeEvents(assetId: $assetId, reason: $reason, workCenterId: $workCenterId) {\n ${DOWNTIME_EVENT_FIELDS}\n }\n }\n`;\n\nexport const RECORD_DOWNTIME = `\n mutation ManRecordDowntime($input: ManRecordDowntimeInput!) {\n manRecordDowntime(input: $input) {\n ${DOWNTIME_EVENT_FIELDS}\n }\n }\n`;\n\n// ---------------------------------------------------------------------------\n// Health\n// ---------------------------------------------------------------------------\n\nexport const HEALTH = `\n query ManHealth {\n manHealth\n }\n`;\n","/**\n * Shared zod schemas for the Manufacturedops tool surface.\n *\n * Every backend enum is mirrored as a tight zod enum so Claude Desktop grounds\n * tool calls against the exact allowed values. `DateTime` scalar inputs are\n * modelled as ISO-8601 strings; `JSON` scalar inputs (characteristics,\n * measurements) are modelled as permissive object records — the backend accepts\n * arbitrary JSON, but a record shape gives the LLM a typed hint.\n */\n\nimport { z } from 'zod';\n\nexport const WorkCenterTypeEnum = z\n .enum(['ASSEMBLY', 'CELL', 'LINE', 'MACHINE', 'MANUAL'])\n .describe('Type of a production work center');\n\nexport const ProductionOrderStatusEnum = z\n .enum(['PLANNED', 'RELEASED', 'IN_PROGRESS', 'PAUSED', 'COMPLETED', 'CLOSED', 'CANCELLED'])\n .describe('Execution lifecycle status of a production order');\n\nexport const ProductionPriorityEnum = z\n .enum(['LOW', 'NORMAL', 'HIGH', 'URGENT'])\n .describe('Scheduling priority of a production order');\n\nexport const OperationStatusEnum = z\n .enum(['PENDING', 'SETUP', 'RUNNING', 'DONE', 'SKIPPED'])\n .describe('Status of a routing/production operation');\n\nexport const MaterialLotStatusEnum = z\n .enum(['AVAILABLE', 'ALLOCATED', 'CONSUMED', 'QUARANTINED', 'SCRAPPED'])\n .describe('Inventory/quality status of a material lot');\n\nexport const InspectionStageEnum = z\n .enum(['INCOMING', 'IN_PROCESS', 'FINAL', 'AUDIT'])\n .describe('Stage at which a quality inspection is performed');\n\nexport const InspectionResultEnum = z\n .enum(['PENDING', 'PASS', 'FAIL', 'CONDITIONAL'])\n .describe('Outcome of a quality inspection');\n\nexport const SeverityEnum = z\n .enum(['MINOR', 'MAJOR', 'CRITICAL'])\n .describe('Severity of a non-conformance');\n\nexport const NonConformanceStatusEnum = z\n .enum(['OPEN', 'INVESTIGATING', 'CONTAINED', 'CORRECTIVE_ACTION', 'CLOSED'])\n .describe('Resolution lifecycle status of an NCR/CAPA');\n\nexport const NonConformanceDispositionEnum = z\n .enum(['OPEN', 'USE_AS_IS', 'REWORK', 'SCRAP', 'RETURN_TO_SUPPLIER'])\n .describe('Disposition decision for a non-conformance');\n\nexport const AssetStatusEnum = z\n .enum(['OPERATIONAL', 'DEGRADED', 'DOWN', 'MAINTENANCE', 'RETIRED'])\n .describe('Operational status of a maintainable asset');\n\nexport const MaintenanceTypeEnum = z\n .enum(['PREVENTIVE', 'CORRECTIVE', 'PREDICTIVE', 'INSPECTION'])\n .describe('Type of a maintenance work order');\n\nexport const MaintenanceStatusEnum = z\n .enum(['SCHEDULED', 'IN_PROGRESS', 'ON_HOLD', 'COMPLETED', 'CANCELLED'])\n .describe('Lifecycle status of a maintenance work order');\n\nexport const DowntimeReasonEnum = z\n .enum(['PLANNED', 'BREAKDOWN', 'CHANGEOVER', 'MATERIAL_SHORTAGE', 'QUALITY', 'OTHER'])\n .describe('Reason classification for a downtime event');\n\n/** ISO-8601 datetime string for `DateTime` scalar inputs. */\nexport const IsoDateTime = z\n .string()\n .describe('ISO-8601 datetime, e.g. \"2026-06-26T09:00:00.000Z\"');\n\n/** Permissive JSON-object schema for `JSON` scalar inputs. */\nexport const JsonObject = z.record(z.string(), z.unknown());\n\n/** Standard `PaginationInput` ({ cursor?, limit=50, offset=0 }) shape. */\nexport const PaginationFields = {\n limit: z.number().int().optional().describe('Page size (default 50)'),\n offset: z.number().int().optional().describe('Pagination offset (default 0)'),\n cursor: z.string().optional().describe('Opaque pagination cursor'),\n};\n\n/** Build a `PaginationInput` object from the standard pagination args. */\nexport function buildPagination(args: {\n limit?: number;\n offset?: number;\n cursor?: string;\n}): Record<string, unknown> | undefined {\n const pagination: Record<string, unknown> = {};\n if (args.limit !== undefined) pagination.limit = args.limit;\n if (args.offset !== undefined) pagination.offset = args.offset;\n if (args.cursor !== undefined) pagination.cursor = args.cursor;\n return Object.keys(pagination).length > 0 ? pagination : undefined;\n}\n","/**\n * Manufacturedops production tools — planning & shop-floor execution.\n *\n * Surface (15) across four per-entity sub-APIs:\n * work_centers_{get,list,create,update,archive}\n * production_orders_{get,list,create,update,transition}\n * operations_{add,record}\n * material_lots_{list,create,set_status}\n *\n * All root fields carry the consistent `man` server prefix\n * (manListProductionOrders / manCreateWorkCenter / manAddOperation / …) and are\n * called by their REAL names in operations.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';\nimport {\n WorkCenterTypeEnum,\n ProductionOrderStatusEnum,\n ProductionPriorityEnum,\n OperationStatusEnum,\n MaterialLotStatusEnum,\n IsoDateTime,\n PaginationFields,\n buildPagination,\n} from './shared.js';\n\nexport function registerProductionTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n // ── Work centers ──────────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'work_centers_get')),\n {\n title: 'Get Work Center',\n description: 'Fetch a single work center by ID, including its scheduled operations.',\n inputSchema: { id: z.string().describe('Work center ID') },\n },\n async ({ id }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n manWorkCenter: Record<string, unknown> | null;\n }>(ops.GET_WORK_CENTER, { id });\n if (!data.manWorkCenter) return errorResult(`Work center ${id} not found`);\n return jsonResult(data.manWorkCenter);\n } catch (error) {\n ctx.logger.error('manufacturedops work_centers_get failed', { error: String(error) });\n return errorResult(\n `Failed to get work center: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'work_centers_list')),\n {\n title: 'List Work Centers',\n description: 'List work centers in the bound workspace, optionally filtered by active state.',\n inputSchema: {\n isActive: z.boolean().optional().describe('Only active (true) or archived (false) centers'),\n },\n },\n async ({ isActive }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n manListWorkCenters: Array<Record<string, unknown>>;\n }>(ops.LIST_WORK_CENTERS, { isActive });\n return jsonResult(data.manListWorkCenters);\n } catch (error) {\n ctx.logger.error('manufacturedops work_centers_list failed', { error: String(error) });\n return errorResult(\n `Failed to list work centers: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'work_centers_create')),\n {\n title: 'Create Work Center',\n description:\n 'Create a work center (machine/line/cell/manual station). `code` must be unique within the workspace.',\n inputSchema: {\n code: z.string().min(1).describe('Unique work-center code'),\n name: z.string().min(1).describe('Display name'),\n type: WorkCenterTypeEnum.optional().describe('Work-center type (default MACHINE)'),\n description: z.string().optional().describe('Description'),\n capacityHours: z.number().optional().describe('Available capacity in hours'),\n idealRunRate: z.number().optional().describe('Ideal run rate (units/hour) for OEE'),\n tags: z.array(z.string()).optional().describe('Free-form tags'),\n },\n },\n async ({ code, name, type, description, capacityHours, idealRunRate, tags }) => {\n try {\n const input: Record<string, unknown> = { code, name };\n if (type !== undefined) input.type = type;\n if (description !== undefined) input.description = description;\n if (capacityHours !== undefined) input.capacityHours = capacityHours;\n if (idealRunRate !== undefined) input.idealRunRate = idealRunRate;\n if (tags !== undefined) input.tags = tags;\n\n const data = await ctx.gql.workspace.request<{\n manCreateWorkCenter: Record<string, unknown>;\n }>(ops.CREATE_WORK_CENTER, { input });\n return jsonResult(data.manCreateWorkCenter);\n } catch (error) {\n ctx.logger.error('manufacturedops work_centers_create failed', { error: String(error) });\n return errorResult(\n `Failed to create work center: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'work_centers_update')),\n {\n title: 'Update Work Center',\n description: 'Update a work center. At least one mutable field must be provided.',\n inputSchema: {\n id: z.string().describe('Work center ID'),\n name: z.string().optional().describe('Updated name'),\n type: WorkCenterTypeEnum.optional().describe('Updated type'),\n description: z.string().optional().describe('Updated description'),\n capacityHours: z.number().optional().describe('Updated capacity (hours)'),\n idealRunRate: z.number().optional().describe('Updated ideal run rate'),\n isActive: z.boolean().optional().describe('Updated active state'),\n tags: z.array(z.string()).optional().describe('Updated tags'),\n },\n },\n async ({ id, name, type, description, capacityHours, idealRunRate, isActive, tags }) => {\n try {\n const input: Record<string, unknown> = {};\n if (name !== undefined) input.name = name;\n if (type !== undefined) input.type = type;\n if (description !== undefined) input.description = description;\n if (capacityHours !== undefined) input.capacityHours = capacityHours;\n if (idealRunRate !== undefined) input.idealRunRate = idealRunRate;\n if (isActive !== undefined) input.isActive = isActive;\n if (tags !== undefined) input.tags = tags;\n\n if (Object.keys(input).length === 0) {\n return errorResult('No updates specified — provide at least one mutable field');\n }\n\n const data = await ctx.gql.workspace.request<{\n manUpdateWorkCenter: Record<string, unknown>;\n }>(ops.UPDATE_WORK_CENTER, { id, input });\n return jsonResult(data.manUpdateWorkCenter);\n } catch (error) {\n ctx.logger.error('manufacturedops work_centers_update failed', { error: String(error) });\n return errorResult(\n `Failed to update work center: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'work_centers_archive')),\n {\n title: 'Archive Work Center',\n description: 'Archive (soft-delete) a work center so it is no longer schedulable.',\n inputSchema: { id: z.string().describe('Work center ID') },\n },\n async ({ id }) => {\n try {\n const data = await ctx.gql.workspace.request<{ manArchiveWorkCenter: boolean }>(\n ops.ARCHIVE_WORK_CENTER,\n { id },\n );\n return jsonResult({ ok: data.manArchiveWorkCenter, id });\n } catch (error) {\n ctx.logger.error('manufacturedops work_centers_archive failed', { error: String(error) });\n return errorResult(\n `Failed to archive work center: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Production orders ──────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'production_orders_get')),\n {\n title: 'Get Production Order',\n description:\n 'Fetch a single production order by ID, including its operations and material lots.',\n inputSchema: { id: z.string().describe('Production order ID') },\n },\n async ({ id }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n manProductionOrder: Record<string, unknown> | null;\n }>(ops.GET_PRODUCTION_ORDER, { id });\n if (!data.manProductionOrder) return errorResult(`Production order ${id} not found`);\n return jsonResult(data.manProductionOrder);\n } catch (error) {\n ctx.logger.error('manufacturedops production_orders_get failed', { error: String(error) });\n return errorResult(\n `Failed to get production order: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'production_orders_list')),\n {\n title: 'List Production Orders',\n description:\n 'List production orders (paginated), optionally filtered by product SKU and/or status.',\n inputSchema: {\n productSku: z.string().optional().describe('Filter by product SKU'),\n status: ProductionOrderStatusEnum.optional().describe('Filter by status'),\n ...PaginationFields,\n },\n },\n async ({ productSku, status, limit, offset, cursor }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n manListProductionOrders: { items: Array<Record<string, unknown>>; pageInfo: unknown };\n }>(ops.LIST_PRODUCTION_ORDERS, {\n productSku,\n status,\n pagination: buildPagination({ limit, offset, cursor }),\n });\n return jsonResult(data.manListProductionOrders);\n } catch (error) {\n ctx.logger.error('manufacturedops production_orders_list failed', { error: String(error) });\n return errorResult(\n `Failed to list production orders: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'production_orders_create')),\n {\n title: 'Create Production Order',\n description:\n 'Create a production (manufacturing) order. `orderNumber` and `productSku` must be provided.',\n inputSchema: {\n orderNumber: z.string().min(1).describe('Unique order number'),\n productSku: z.string().min(1).describe('Product SKU being manufactured'),\n productName: z.string().min(1).describe('Product display name'),\n quantity: z.number().optional().describe('Order quantity'),\n uom: z.string().optional().describe('Unit of measure (e.g. \"ea\", \"kg\")'),\n priority: ProductionPriorityEnum.optional().describe('Priority (default NORMAL)'),\n plannedStart: IsoDateTime.optional().describe('Planned start (ISO-8601)'),\n plannedEnd: IsoDateTime.optional().describe('Planned end (ISO-8601)'),\n dueDate: IsoDateTime.optional().describe('Due date (ISO-8601)'),\n erpReference: z.string().optional().describe('External ERP reference'),\n notes: z.string().optional().describe('Free-form notes'),\n tags: z.array(z.string()).optional().describe('Free-form tags'),\n },\n },\n async ({\n orderNumber,\n productSku,\n productName,\n quantity,\n uom,\n priority,\n plannedStart,\n plannedEnd,\n dueDate,\n erpReference,\n notes,\n tags,\n }) => {\n try {\n const input: Record<string, unknown> = { orderNumber, productSku, productName };\n if (quantity !== undefined) input.quantity = quantity;\n if (uom !== undefined) input.uom = uom;\n if (priority !== undefined) input.priority = priority;\n if (plannedStart !== undefined) input.plannedStart = plannedStart;\n if (plannedEnd !== undefined) input.plannedEnd = plannedEnd;\n if (dueDate !== undefined) input.dueDate = dueDate;\n if (erpReference !== undefined) input.erpReference = erpReference;\n if (notes !== undefined) input.notes = notes;\n if (tags !== undefined) input.tags = tags;\n\n const data = await ctx.gql.workspace.request<{\n manCreateProductionOrder: Record<string, unknown>;\n }>(ops.CREATE_PRODUCTION_ORDER, { input });\n return jsonResult(data.manCreateProductionOrder);\n } catch (error) {\n ctx.logger.error('manufacturedops production_orders_create failed', {\n error: String(error),\n });\n return errorResult(\n `Failed to create production order: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'production_orders_update')),\n {\n title: 'Update Production Order',\n description: 'Update a production order. At least one mutable field must be provided.',\n inputSchema: {\n id: z.string().describe('Production order ID'),\n productName: z.string().optional().describe('Updated product name'),\n quantity: z.number().optional().describe('Updated quantity'),\n uom: z.string().optional().describe('Updated unit of measure'),\n priority: ProductionPriorityEnum.optional().describe('Updated priority'),\n plannedStart: IsoDateTime.optional().describe('Updated planned start'),\n plannedEnd: IsoDateTime.optional().describe('Updated planned end'),\n dueDate: IsoDateTime.optional().describe('Updated due date'),\n erpReference: z.string().optional().describe('Updated ERP reference'),\n notes: z.string().optional().describe('Updated notes'),\n tags: z.array(z.string()).optional().describe('Updated tags'),\n },\n },\n async ({\n id,\n productName,\n quantity,\n uom,\n priority,\n plannedStart,\n plannedEnd,\n dueDate,\n erpReference,\n notes,\n tags,\n }) => {\n try {\n const input: Record<string, unknown> = {};\n if (productName !== undefined) input.productName = productName;\n if (quantity !== undefined) input.quantity = quantity;\n if (uom !== undefined) input.uom = uom;\n if (priority !== undefined) input.priority = priority;\n if (plannedStart !== undefined) input.plannedStart = plannedStart;\n if (plannedEnd !== undefined) input.plannedEnd = plannedEnd;\n if (dueDate !== undefined) input.dueDate = dueDate;\n if (erpReference !== undefined) input.erpReference = erpReference;\n if (notes !== undefined) input.notes = notes;\n if (tags !== undefined) input.tags = tags;\n\n if (Object.keys(input).length === 0) {\n return errorResult('No updates specified — provide at least one mutable field');\n }\n\n const data = await ctx.gql.workspace.request<{\n manUpdateProductionOrder: Record<string, unknown>;\n }>(ops.UPDATE_PRODUCTION_ORDER, { id, input });\n return jsonResult(data.manUpdateProductionOrder);\n } catch (error) {\n ctx.logger.error('manufacturedops production_orders_update failed', {\n error: String(error),\n });\n return errorResult(\n `Failed to update production order: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'production_orders_transition')),\n {\n title: 'Transition Production Order',\n description:\n 'Advance a production order through its execution lifecycle (PLANNED → RELEASED → IN_PROGRESS → COMPLETED → CLOSED, or PAUSED/CANCELLED). Transitions are validated server-side.',\n inputSchema: {\n id: z.string().describe('Production order ID'),\n status: ProductionOrderStatusEnum.describe('Target status'),\n },\n },\n async ({ id, status }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n manTransitionProductionOrder: Record<string, unknown>;\n }>(ops.TRANSITION_PRODUCTION_ORDER, { id, status });\n return jsonResult(data.manTransitionProductionOrder);\n } catch (error) {\n ctx.logger.error('manufacturedops production_orders_transition failed', {\n error: String(error),\n });\n return errorResult(\n `Failed to transition production order: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Operations ─────────────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'operations_add')),\n {\n title: 'Add Production Operation',\n description:\n 'Add a routing operation (step) to a production order, optionally assigned to a work center.',\n inputSchema: {\n productionOrderId: z.string().min(1).describe('Owning production order ID'),\n name: z.string().min(1).describe('Operation name (e.g. \"CNC mill\", \"Assembly\")'),\n sequence: z.number().int().optional().describe('Ordering sequence number'),\n workCenterId: z.string().optional().describe('Assigned work center ID'),\n },\n },\n async ({ productionOrderId, name, sequence, workCenterId }) => {\n try {\n const input: Record<string, unknown> = { productionOrderId, name };\n if (sequence !== undefined) input.sequence = sequence;\n if (workCenterId !== undefined) input.workCenterId = workCenterId;\n\n const data = await ctx.gql.workspace.request<{\n manAddOperation: Record<string, unknown>;\n }>(ops.ADD_OPERATION, { input });\n return jsonResult(data.manAddOperation);\n } catch (error) {\n ctx.logger.error('manufacturedops operations_add failed', { error: String(error) });\n return errorResult(\n `Failed to add operation: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'operations_record')),\n {\n title: 'Record Production Operation',\n description:\n 'Record progress against a routing operation (setup/run minutes, good/scrap counts, status).',\n inputSchema: {\n id: z.string().describe('Operation ID'),\n status: OperationStatusEnum.optional().describe('Updated operation status'),\n setupMinutes: z.number().int().optional().describe('Setup minutes logged'),\n runMinutes: z.number().int().optional().describe('Run minutes logged'),\n goodCount: z.number().optional().describe('Good units produced'),\n scrapCount: z.number().optional().describe('Scrap units produced'),\n },\n },\n async ({ id, status, setupMinutes, runMinutes, goodCount, scrapCount }) => {\n try {\n const input: Record<string, unknown> = {};\n if (status !== undefined) input.status = status;\n if (setupMinutes !== undefined) input.setupMinutes = setupMinutes;\n if (runMinutes !== undefined) input.runMinutes = runMinutes;\n if (goodCount !== undefined) input.goodCount = goodCount;\n if (scrapCount !== undefined) input.scrapCount = scrapCount;\n\n if (Object.keys(input).length === 0) {\n return errorResult(\n 'No updates specified — provide at least one of status/setupMinutes/runMinutes/goodCount/scrapCount',\n );\n }\n\n const data = await ctx.gql.workspace.request<{\n manRecordOperation: Record<string, unknown>;\n }>(ops.RECORD_OPERATION, { id, input });\n return jsonResult(data.manRecordOperation);\n } catch (error) {\n ctx.logger.error('manufacturedops operations_record failed', { error: String(error) });\n return errorResult(\n `Failed to record operation: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Material lots ──────────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'material_lots_list')),\n {\n title: 'List Material Lots',\n description:\n 'List material lots (paginated), optionally filtered by production order and/or status.',\n inputSchema: {\n productionOrderId: z.string().optional().describe('Filter by production order ID'),\n status: MaterialLotStatusEnum.optional().describe('Filter by lot status'),\n ...PaginationFields,\n },\n },\n async ({ productionOrderId, status, limit, offset, cursor }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n manListMaterialLots: { items: Array<Record<string, unknown>>; pageInfo: unknown };\n }>(ops.LIST_MATERIAL_LOTS, {\n productionOrderId,\n status,\n pagination: buildPagination({ limit, offset, cursor }),\n });\n return jsonResult(data.manListMaterialLots);\n } catch (error) {\n ctx.logger.error('manufacturedops material_lots_list failed', { error: String(error) });\n return errorResult(\n `Failed to list material lots: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'material_lots_create')),\n {\n title: 'Create Material Lot',\n description:\n 'Receive / create a traceable material lot. `lotNumber`, `materialSku`, and `materialName` are required.',\n inputSchema: {\n lotNumber: z.string().min(1).describe('Unique lot number'),\n materialSku: z.string().min(1).describe('Material SKU'),\n materialName: z.string().min(1).describe('Material display name'),\n quantity: z.number().optional().describe('Received quantity'),\n uom: z.string().optional().describe('Unit of measure'),\n supplier: z.string().optional().describe('Supplier name'),\n receivedAt: IsoDateTime.optional().describe('Received timestamp (ISO-8601)'),\n expiresAt: IsoDateTime.optional().describe('Expiry timestamp (ISO-8601)'),\n productionOrderId: z.string().optional().describe('Allocated production order ID'),\n parentLotId: z.string().optional().describe('Parent lot ID (for genealogy/splits)'),\n tags: z.array(z.string()).optional().describe('Free-form tags'),\n },\n },\n async ({\n lotNumber,\n materialSku,\n materialName,\n quantity,\n uom,\n supplier,\n receivedAt,\n expiresAt,\n productionOrderId,\n parentLotId,\n tags,\n }) => {\n try {\n const input: Record<string, unknown> = { lotNumber, materialSku, materialName };\n if (quantity !== undefined) input.quantity = quantity;\n if (uom !== undefined) input.uom = uom;\n if (supplier !== undefined) input.supplier = supplier;\n if (receivedAt !== undefined) input.receivedAt = receivedAt;\n if (expiresAt !== undefined) input.expiresAt = expiresAt;\n if (productionOrderId !== undefined) input.productionOrderId = productionOrderId;\n if (parentLotId !== undefined) input.parentLotId = parentLotId;\n if (tags !== undefined) input.tags = tags;\n\n const data = await ctx.gql.workspace.request<{\n manCreateMaterialLot: Record<string, unknown>;\n }>(ops.CREATE_MATERIAL_LOT, { input });\n return jsonResult(data.manCreateMaterialLot);\n } catch (error) {\n ctx.logger.error('manufacturedops material_lots_create failed', { error: String(error) });\n return errorResult(\n `Failed to create material lot: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'material_lots_set_status')),\n {\n title: 'Set Material Lot Status',\n description:\n 'Change a material lot status (AVAILABLE/ALLOCATED/CONSUMED/QUARANTINED/SCRAPPED).',\n inputSchema: {\n id: z.string().describe('Material lot ID'),\n status: MaterialLotStatusEnum.describe('Target lot status'),\n },\n },\n async ({ id, status }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n manSetMaterialLotStatus: Record<string, unknown>;\n }>(ops.SET_MATERIAL_LOT_STATUS, { id, status });\n return jsonResult(data.manSetMaterialLotStatus);\n } catch (error) {\n ctx.logger.error('manufacturedops material_lots_set_status failed', {\n error: String(error),\n });\n return errorResult(\n `Failed to set material lot status: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n}\n","/**\n * Manufacturedops quality tools — inspections, plans, and NCR/CAPA.\n *\n * Surface (10) across three per-entity sub-APIs:\n * inspections_{get,list,record}\n * inspection_plans_{list,create}\n * non_conformances_{get,list,raise,update,transition}\n *\n * All root fields carry the consistent `man` server prefix and are called by\n * their REAL names in operations.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';\nimport {\n InspectionStageEnum,\n InspectionResultEnum,\n SeverityEnum,\n NonConformanceStatusEnum,\n NonConformanceDispositionEnum,\n IsoDateTime,\n JsonObject,\n PaginationFields,\n buildPagination,\n} from './shared.js';\n\nexport function registerQualityTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n // ── Inspections ────────────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'inspections_get')),\n {\n title: 'Get Quality Inspection',\n description:\n 'Fetch a single quality inspection by ID, including its plan and any raised non-conformances.',\n inputSchema: { id: z.string().describe('Inspection ID') },\n },\n async ({ id }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n manInspection: Record<string, unknown> | null;\n }>(ops.GET_INSPECTION, { id });\n if (!data.manInspection) return errorResult(`Inspection ${id} not found`);\n return jsonResult(data.manInspection);\n } catch (error) {\n ctx.logger.error('manufacturedops inspections_get failed', { error: String(error) });\n return errorResult(\n `Failed to get inspection: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'inspections_list')),\n {\n title: 'List Quality Inspections',\n description:\n 'List quality inspections (paginated), optionally filtered by production order and/or result.',\n inputSchema: {\n productionOrderId: z.string().optional().describe('Filter by production order ID'),\n result: InspectionResultEnum.optional().describe('Filter by inspection result'),\n ...PaginationFields,\n },\n },\n async ({ productionOrderId, result, limit, offset, cursor }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n manListInspections: { items: Array<Record<string, unknown>>; pageInfo: unknown };\n }>(ops.LIST_INSPECTIONS, {\n productionOrderId,\n result,\n pagination: buildPagination({ limit, offset, cursor }),\n });\n return jsonResult(data.manListInspections);\n } catch (error) {\n ctx.logger.error('manufacturedops inspections_list failed', { error: String(error) });\n return errorResult(\n `Failed to list inspections: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'inspections_record')),\n {\n title: 'Record Quality Inspection',\n description:\n 'Record a quality inspection result against a production order, material lot, or work center.',\n inputSchema: {\n stage: InspectionStageEnum.optional().describe('Inspection stage (default IN_PROCESS)'),\n result: InspectionResultEnum.optional().describe('Inspection result (default PENDING)'),\n sampleSize: z.number().int().optional().describe('Number of units sampled'),\n defectCount: z.number().int().optional().describe('Number of defective units found'),\n measurements: JsonObject.optional().describe('Measurement readings as JSON'),\n notes: z.string().optional().describe('Inspector notes'),\n inspectionPlanId: z.string().optional().describe('Inspection plan ID'),\n productionOrderId: z.string().optional().describe('Production order ID'),\n materialLotId: z.string().optional().describe('Material lot ID'),\n workCenterId: z.string().optional().describe('Work center ID'),\n inspectedAt: IsoDateTime.optional().describe('Inspection timestamp (ISO-8601)'),\n },\n },\n async ({\n stage,\n result,\n sampleSize,\n defectCount,\n measurements,\n notes,\n inspectionPlanId,\n productionOrderId,\n materialLotId,\n workCenterId,\n inspectedAt,\n }) => {\n try {\n const input: Record<string, unknown> = {};\n if (stage !== undefined) input.stage = stage;\n if (result !== undefined) input.result = result;\n if (sampleSize !== undefined) input.sampleSize = sampleSize;\n if (defectCount !== undefined) input.defectCount = defectCount;\n if (measurements !== undefined) input.measurements = measurements;\n if (notes !== undefined) input.notes = notes;\n if (inspectionPlanId !== undefined) input.inspectionPlanId = inspectionPlanId;\n if (productionOrderId !== undefined) input.productionOrderId = productionOrderId;\n if (materialLotId !== undefined) input.materialLotId = materialLotId;\n if (workCenterId !== undefined) input.workCenterId = workCenterId;\n if (inspectedAt !== undefined) input.inspectedAt = inspectedAt;\n\n const data = await ctx.gql.workspace.request<{\n manRecordInspection: Record<string, unknown>;\n }>(ops.RECORD_INSPECTION, { input });\n return jsonResult(data.manRecordInspection);\n } catch (error) {\n ctx.logger.error('manufacturedops inspections_record failed', { error: String(error) });\n return errorResult(\n `Failed to record inspection: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Inspection plans ───────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'inspection_plans_list')),\n {\n title: 'List Inspection Plans',\n description: 'List inspection plans, optionally filtered by active state and/or stage.',\n inputSchema: {\n isActive: z.boolean().optional().describe('Only active (true) or inactive (false) plans'),\n stage: InspectionStageEnum.optional().describe('Filter by inspection stage'),\n },\n },\n async ({ isActive, stage }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n manListInspectionPlans: Array<Record<string, unknown>>;\n }>(ops.LIST_INSPECTION_PLANS, { isActive, stage });\n return jsonResult(data.manListInspectionPlans);\n } catch (error) {\n ctx.logger.error('manufacturedops inspection_plans_list failed', { error: String(error) });\n return errorResult(\n `Failed to list inspection plans: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'inspection_plans_create')),\n {\n title: 'Create Inspection Plan',\n description:\n 'Create an inspection plan (characteristics checklist). `code` and `name` are required.',\n inputSchema: {\n code: z.string().min(1).describe('Unique inspection-plan code'),\n name: z.string().min(1).describe('Plan name'),\n stage: InspectionStageEnum.optional().describe('Plan stage (default IN_PROCESS)'),\n description: z.string().optional().describe('Description'),\n productSku: z.string().optional().describe('Product SKU this plan applies to'),\n characteristics: JsonObject.optional().describe('Inspection characteristics as JSON'),\n },\n },\n async ({ code, name, stage, description, productSku, characteristics }) => {\n try {\n const input: Record<string, unknown> = { code, name };\n if (stage !== undefined) input.stage = stage;\n if (description !== undefined) input.description = description;\n if (productSku !== undefined) input.productSku = productSku;\n if (characteristics !== undefined) input.characteristics = characteristics;\n\n const data = await ctx.gql.workspace.request<{\n manCreateInspectionPlan: Record<string, unknown>;\n }>(ops.CREATE_INSPECTION_PLAN, { input });\n return jsonResult(data.manCreateInspectionPlan);\n } catch (error) {\n ctx.logger.error('manufacturedops inspection_plans_create failed', {\n error: String(error),\n });\n return errorResult(\n `Failed to create inspection plan: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Non-conformances (NCR / CAPA) ──────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'non_conformances_get')),\n {\n title: 'Get Non-Conformance',\n description:\n 'Fetch a single non-conformance (NCR) by ID, including its originating inspection.',\n inputSchema: { id: z.string().describe('Non-conformance ID') },\n },\n async ({ id }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n manNonConformance: Record<string, unknown> | null;\n }>(ops.GET_NON_CONFORMANCE, { id });\n if (!data.manNonConformance) return errorResult(`Non-conformance ${id} not found`);\n return jsonResult(data.manNonConformance);\n } catch (error) {\n ctx.logger.error('manufacturedops non_conformances_get failed', { error: String(error) });\n return errorResult(\n `Failed to get non-conformance: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'non_conformances_list')),\n {\n title: 'List Non-Conformances',\n description:\n 'List non-conformances (paginated), optionally filtered by severity and/or status.',\n inputSchema: {\n severity: SeverityEnum.optional().describe('Filter by severity'),\n status: NonConformanceStatusEnum.optional().describe('Filter by status'),\n ...PaginationFields,\n },\n },\n async ({ severity, status, limit, offset, cursor }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n manListNonConformances: { items: Array<Record<string, unknown>>; pageInfo: unknown };\n }>(ops.LIST_NON_CONFORMANCES, {\n severity,\n status,\n pagination: buildPagination({ limit, offset, cursor }),\n });\n return jsonResult(data.manListNonConformances);\n } catch (error) {\n ctx.logger.error('manufacturedops non_conformances_list failed', { error: String(error) });\n return errorResult(\n `Failed to list non-conformances: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'non_conformances_raise')),\n {\n title: 'Raise Non-Conformance',\n description:\n 'Raise a non-conformance report (NCR). `ncrNumber` and `title` are required; optionally link an inspection.',\n inputSchema: {\n ncrNumber: z.string().min(1).describe('Unique NCR number'),\n title: z.string().min(1).describe('NCR title/summary'),\n description: z.string().optional().describe('Detailed description'),\n severity: SeverityEnum.optional().describe('Severity (default MINOR)'),\n disposition: NonConformanceDispositionEnum.optional().describe(\n 'Disposition (default OPEN)',\n ),\n quantityAffected: z.number().optional().describe('Quantity of units affected'),\n inspectionId: z.string().optional().describe('Originating inspection ID'),\n ownerId: z.string().optional().describe('Owner (assignee) user ID'),\n dueDate: IsoDateTime.optional().describe('Resolution due date (ISO-8601)'),\n tags: z.array(z.string()).optional().describe('Free-form tags'),\n },\n },\n async ({\n ncrNumber,\n title,\n description,\n severity,\n disposition,\n quantityAffected,\n inspectionId,\n ownerId,\n dueDate,\n tags,\n }) => {\n try {\n const input: Record<string, unknown> = { ncrNumber, title };\n if (description !== undefined) input.description = description;\n if (severity !== undefined) input.severity = severity;\n if (disposition !== undefined) input.disposition = disposition;\n if (quantityAffected !== undefined) input.quantityAffected = quantityAffected;\n if (inspectionId !== undefined) input.inspectionId = inspectionId;\n if (ownerId !== undefined) input.ownerId = ownerId;\n if (dueDate !== undefined) input.dueDate = dueDate;\n if (tags !== undefined) input.tags = tags;\n\n const data = await ctx.gql.workspace.request<{\n manRaiseNonConformance: Record<string, unknown>;\n }>(ops.RAISE_NON_CONFORMANCE, { input });\n return jsonResult(data.manRaiseNonConformance);\n } catch (error) {\n ctx.logger.error('manufacturedops non_conformances_raise failed', { error: String(error) });\n return errorResult(\n `Failed to raise non-conformance: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'non_conformances_update')),\n {\n title: 'Update Non-Conformance',\n description:\n 'Update a non-conformance (root cause, corrective action, disposition, owner, …). At least one mutable field must be provided.',\n inputSchema: {\n id: z.string().describe('Non-conformance ID'),\n title: z.string().optional().describe('Updated title'),\n description: z.string().optional().describe('Updated description'),\n severity: SeverityEnum.optional().describe('Updated severity'),\n disposition: NonConformanceDispositionEnum.optional().describe('Updated disposition'),\n quantityAffected: z.number().optional().describe('Updated quantity affected'),\n rootCause: z.string().optional().describe('Root-cause analysis'),\n correctiveAction: z.string().optional().describe('Corrective/preventive action (CAPA)'),\n ownerId: z.string().optional().describe('Updated owner user ID'),\n dueDate: IsoDateTime.optional().describe('Updated due date (ISO-8601)'),\n tags: z.array(z.string()).optional().describe('Updated tags'),\n },\n },\n async ({\n id,\n title,\n description,\n severity,\n disposition,\n quantityAffected,\n rootCause,\n correctiveAction,\n ownerId,\n dueDate,\n tags,\n }) => {\n try {\n const input: Record<string, unknown> = {};\n if (title !== undefined) input.title = title;\n if (description !== undefined) input.description = description;\n if (severity !== undefined) input.severity = severity;\n if (disposition !== undefined) input.disposition = disposition;\n if (quantityAffected !== undefined) input.quantityAffected = quantityAffected;\n if (rootCause !== undefined) input.rootCause = rootCause;\n if (correctiveAction !== undefined) input.correctiveAction = correctiveAction;\n if (ownerId !== undefined) input.ownerId = ownerId;\n if (dueDate !== undefined) input.dueDate = dueDate;\n if (tags !== undefined) input.tags = tags;\n\n if (Object.keys(input).length === 0) {\n return errorResult('No updates specified — provide at least one mutable field');\n }\n\n const data = await ctx.gql.workspace.request<{\n manUpdateNonConformance: Record<string, unknown>;\n }>(ops.UPDATE_NON_CONFORMANCE, { id, input });\n return jsonResult(data.manUpdateNonConformance);\n } catch (error) {\n ctx.logger.error('manufacturedops non_conformances_update failed', {\n error: String(error),\n });\n return errorResult(\n `Failed to update non-conformance: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'non_conformances_transition')),\n {\n title: 'Transition Non-Conformance',\n description:\n 'Advance an NCR/CAPA through its resolution lifecycle (OPEN → INVESTIGATING → CONTAINED → CORRECTIVE_ACTION → CLOSED). Transitions are validated server-side.',\n inputSchema: {\n id: z.string().describe('Non-conformance ID'),\n status: NonConformanceStatusEnum.describe('Target status'),\n },\n },\n async ({ id, status }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n manTransitionNonConformance: Record<string, unknown>;\n }>(ops.TRANSITION_NON_CONFORMANCE, { id, status });\n return jsonResult(data.manTransitionNonConformance);\n } catch (error) {\n ctx.logger.error('manufacturedops non_conformances_transition failed', {\n error: String(error),\n });\n return errorResult(\n `Failed to transition non-conformance: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n}\n","/**\n * Manufacturedops maintenance tools — assets, work orders, and downtime/OEE.\n *\n * Surface (9) across three per-entity sub-APIs:\n * assets_{get,list,create,update}\n * maintenance_{list,create,transition}\n * downtime_{list,record}\n *\n * All root fields carry the consistent `man` server prefix\n * (manListMaintenanceWorkOrders / manRecordDowntime / …) and are called by their\n * REAL names in operations.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';\nimport {\n AssetStatusEnum,\n MaintenanceTypeEnum,\n MaintenanceStatusEnum,\n DowntimeReasonEnum,\n IsoDateTime,\n PaginationFields,\n buildPagination,\n} from './shared.js';\n\nexport function registerMaintenanceTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n // ── Assets ─────────────────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'assets_get')),\n {\n title: 'Get Asset',\n description:\n 'Fetch a single maintainable asset by ID, including its maintenance work orders.',\n inputSchema: { id: z.string().describe('Asset ID') },\n },\n async ({ id }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n manAsset: Record<string, unknown> | null;\n }>(ops.GET_ASSET, { id });\n if (!data.manAsset) return errorResult(`Asset ${id} not found`);\n return jsonResult(data.manAsset);\n } catch (error) {\n ctx.logger.error('manufacturedops assets_get failed', { error: String(error) });\n return errorResult(\n `Failed to get asset: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'assets_list')),\n {\n title: 'List Assets',\n description:\n 'List maintainable assets (paginated), optionally filtered by status and/or work center.',\n inputSchema: {\n status: AssetStatusEnum.optional().describe('Filter by asset status'),\n workCenterId: z.string().optional().describe('Filter by work center ID'),\n ...PaginationFields,\n },\n },\n async ({ status, workCenterId, limit, offset, cursor }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n manListAssets: { items: Array<Record<string, unknown>>; pageInfo: unknown };\n }>(ops.LIST_ASSETS, {\n status,\n workCenterId,\n pagination: buildPagination({ limit, offset, cursor }),\n });\n return jsonResult(data.manListAssets);\n } catch (error) {\n ctx.logger.error('manufacturedops assets_list failed', { error: String(error) });\n return errorResult(\n `Failed to list assets: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'assets_create')),\n {\n title: 'Create Asset',\n description:\n 'Register a maintainable asset (machine/equipment). `assetTag` and `name` are required.',\n inputSchema: {\n assetTag: z.string().min(1).describe('Unique asset tag'),\n name: z.string().min(1).describe('Asset display name'),\n manufacturer: z.string().optional().describe('Manufacturer'),\n model: z.string().optional().describe('Model'),\n serialNumber: z.string().optional().describe('Serial number'),\n pmIntervalHours: z.number().optional().describe('Preventive-maintenance interval (hours)'),\n runningHours: z.number().optional().describe('Current running hours'),\n workCenterId: z.string().optional().describe('Host work center ID'),\n installedAt: IsoDateTime.optional().describe('Install timestamp (ISO-8601)'),\n tags: z.array(z.string()).optional().describe('Free-form tags'),\n },\n },\n async ({\n assetTag,\n name,\n manufacturer,\n model,\n serialNumber,\n pmIntervalHours,\n runningHours,\n workCenterId,\n installedAt,\n tags,\n }) => {\n try {\n const input: Record<string, unknown> = { assetTag, name };\n if (manufacturer !== undefined) input.manufacturer = manufacturer;\n if (model !== undefined) input.model = model;\n if (serialNumber !== undefined) input.serialNumber = serialNumber;\n if (pmIntervalHours !== undefined) input.pmIntervalHours = pmIntervalHours;\n if (runningHours !== undefined) input.runningHours = runningHours;\n if (workCenterId !== undefined) input.workCenterId = workCenterId;\n if (installedAt !== undefined) input.installedAt = installedAt;\n if (tags !== undefined) input.tags = tags;\n\n const data = await ctx.gql.workspace.request<{\n manCreateAsset: Record<string, unknown>;\n }>(ops.CREATE_ASSET, { input });\n return jsonResult(data.manCreateAsset);\n } catch (error) {\n ctx.logger.error('manufacturedops assets_create failed', { error: String(error) });\n return errorResult(\n `Failed to create asset: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'assets_update')),\n {\n title: 'Update Asset',\n description:\n 'Update a maintainable asset (status, running hours, PM interval, …). At least one mutable field must be provided.',\n inputSchema: {\n id: z.string().describe('Asset ID'),\n name: z.string().optional().describe('Updated name'),\n manufacturer: z.string().optional().describe('Updated manufacturer'),\n model: z.string().optional().describe('Updated model'),\n serialNumber: z.string().optional().describe('Updated serial number'),\n status: AssetStatusEnum.optional().describe('Updated asset status'),\n pmIntervalHours: z.number().optional().describe('Updated PM interval (hours)'),\n runningHours: z.number().optional().describe('Updated running hours'),\n workCenterId: z.string().optional().describe('Updated host work center ID'),\n tags: z.array(z.string()).optional().describe('Updated tags'),\n },\n },\n async ({\n id,\n name,\n manufacturer,\n model,\n serialNumber,\n status,\n pmIntervalHours,\n runningHours,\n workCenterId,\n tags,\n }) => {\n try {\n const input: Record<string, unknown> = {};\n if (name !== undefined) input.name = name;\n if (manufacturer !== undefined) input.manufacturer = manufacturer;\n if (model !== undefined) input.model = model;\n if (serialNumber !== undefined) input.serialNumber = serialNumber;\n if (status !== undefined) input.status = status;\n if (pmIntervalHours !== undefined) input.pmIntervalHours = pmIntervalHours;\n if (runningHours !== undefined) input.runningHours = runningHours;\n if (workCenterId !== undefined) input.workCenterId = workCenterId;\n if (tags !== undefined) input.tags = tags;\n\n if (Object.keys(input).length === 0) {\n return errorResult('No updates specified — provide at least one mutable field');\n }\n\n const data = await ctx.gql.workspace.request<{\n manUpdateAsset: Record<string, unknown>;\n }>(ops.UPDATE_ASSET, { id, input });\n return jsonResult(data.manUpdateAsset);\n } catch (error) {\n ctx.logger.error('manufacturedops assets_update failed', { error: String(error) });\n return errorResult(\n `Failed to update asset: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Maintenance work orders ────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'maintenance_list')),\n {\n title: 'List Maintenance Work Orders',\n description:\n 'List maintenance work orders (paginated), optionally filtered by asset and/or status.',\n inputSchema: {\n assetId: z.string().optional().describe('Filter by asset ID'),\n status: MaintenanceStatusEnum.optional().describe('Filter by work-order status'),\n ...PaginationFields,\n },\n },\n async ({ assetId, status, limit, offset, cursor }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n manListMaintenanceWorkOrders: {\n items: Array<Record<string, unknown>>;\n pageInfo: unknown;\n };\n }>(ops.LIST_MAINTENANCE_WORK_ORDERS, {\n assetId,\n status,\n pagination: buildPagination({ limit, offset, cursor }),\n });\n return jsonResult(data.manListMaintenanceWorkOrders);\n } catch (error) {\n ctx.logger.error('manufacturedops maintenance_list failed', { error: String(error) });\n return errorResult(\n `Failed to list maintenance work orders: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'maintenance_create')),\n {\n title: 'Create Maintenance Work Order',\n description:\n 'Create a maintenance work order against an asset. `woNumber`, `title`, and `assetId` are required.',\n inputSchema: {\n woNumber: z.string().min(1).describe('Unique work-order number'),\n title: z.string().min(1).describe('Work-order title'),\n assetId: z.string().min(1).describe('Target asset ID'),\n type: MaintenanceTypeEnum.optional().describe('Maintenance type (default PREVENTIVE)'),\n description: z.string().optional().describe('Description'),\n technicianId: z.string().optional().describe('Assigned technician user ID'),\n scheduledFor: IsoDateTime.optional().describe('Scheduled timestamp (ISO-8601)'),\n },\n },\n async ({ woNumber, title, assetId, type, description, technicianId, scheduledFor }) => {\n try {\n const input: Record<string, unknown> = { woNumber, title, assetId };\n if (type !== undefined) input.type = type;\n if (description !== undefined) input.description = description;\n if (technicianId !== undefined) input.technicianId = technicianId;\n if (scheduledFor !== undefined) input.scheduledFor = scheduledFor;\n\n const data = await ctx.gql.workspace.request<{\n manCreateMaintenanceWorkOrder: Record<string, unknown>;\n }>(ops.CREATE_MAINTENANCE_WORK_ORDER, { input });\n return jsonResult(data.manCreateMaintenanceWorkOrder);\n } catch (error) {\n ctx.logger.error('manufacturedops maintenance_create failed', { error: String(error) });\n return errorResult(\n `Failed to create maintenance work order: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'maintenance_transition')),\n {\n title: 'Transition Maintenance Work Order',\n description:\n 'Advance a maintenance work order through its lifecycle (SCHEDULED → IN_PROGRESS → COMPLETED, or ON_HOLD/CANCELLED). Transitions are validated server-side.',\n inputSchema: {\n id: z.string().describe('Maintenance work order ID'),\n status: MaintenanceStatusEnum.describe('Target status'),\n },\n },\n async ({ id, status }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n manTransitionMaintenanceWorkOrder: Record<string, unknown>;\n }>(ops.TRANSITION_MAINTENANCE_WORK_ORDER, { id, status });\n return jsonResult(data.manTransitionMaintenanceWorkOrder);\n } catch (error) {\n ctx.logger.error('manufacturedops maintenance_transition failed', {\n error: String(error),\n });\n return errorResult(\n `Failed to transition maintenance work order: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n // ── Downtime events ────────────────────────────────────────────────────────\n server.registerTool(\n track(mcpToolName(ctx.productName, 'downtime_list')),\n {\n title: 'List Downtime Events',\n description:\n 'List downtime events, optionally filtered by asset, work center, and/or reason.',\n inputSchema: {\n assetId: z.string().optional().describe('Filter by asset ID'),\n workCenterId: z.string().optional().describe('Filter by work center ID'),\n reason: DowntimeReasonEnum.optional().describe('Filter by downtime reason'),\n },\n },\n async ({ assetId, workCenterId, reason }) => {\n try {\n const data = await ctx.gql.workspace.request<{\n manListDowntimeEvents: Array<Record<string, unknown>>;\n }>(ops.LIST_DOWNTIME_EVENTS, { assetId, workCenterId, reason });\n return jsonResult(data.manListDowntimeEvents);\n } catch (error) {\n ctx.logger.error('manufacturedops downtime_list failed', { error: String(error) });\n return errorResult(\n `Failed to list downtime events: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'downtime_record')),\n {\n title: 'Record Downtime Event',\n description:\n 'Record a downtime event against an asset, work center, and/or production order. `startedAt` is required.',\n inputSchema: {\n startedAt: IsoDateTime.describe('Downtime start timestamp (ISO-8601)'),\n reason: DowntimeReasonEnum.optional().describe('Downtime reason (default BREAKDOWN)'),\n description: z.string().optional().describe('Description'),\n durationMinutes: z.number().int().optional().describe('Duration in minutes'),\n endedAt: IsoDateTime.optional().describe('Downtime end timestamp (ISO-8601)'),\n assetId: z.string().optional().describe('Affected asset ID'),\n workCenterId: z.string().optional().describe('Affected work center ID'),\n productionOrderId: z.string().optional().describe('Affected production order ID'),\n },\n },\n async ({\n startedAt,\n reason,\n description,\n durationMinutes,\n endedAt,\n assetId,\n workCenterId,\n productionOrderId,\n }) => {\n try {\n const input: Record<string, unknown> = { startedAt };\n if (reason !== undefined) input.reason = reason;\n if (description !== undefined) input.description = description;\n if (durationMinutes !== undefined) input.durationMinutes = durationMinutes;\n if (endedAt !== undefined) input.endedAt = endedAt;\n if (assetId !== undefined) input.assetId = assetId;\n if (workCenterId !== undefined) input.workCenterId = workCenterId;\n if (productionOrderId !== undefined) input.productionOrderId = productionOrderId;\n\n const data = await ctx.gql.workspace.request<{\n manRecordDowntime: Record<string, unknown>;\n }>(ops.RECORD_DOWNTIME, { input });\n return jsonResult(data.manRecordDowntime);\n } catch (error) {\n ctx.logger.error('manufacturedops downtime_record failed', { error: String(error) });\n return errorResult(\n `Failed to record downtime: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n}\n","/**\n * Manufacturedops health tool.\n *\n * Surface (1): health. Maps to the @public `manHealth` query (no auth required)\n * — the subgraph's liveness/identity probe. Mirrors the ecosystem-standard\n * `health` tool name used by kadaikodi / proserviceworld / artistrybase.\n */\n\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\nexport function registerHealthTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n server.registerTool(\n track(mcpToolName(ctx.productName, 'health')),\n {\n title: 'Manufacturedops Health Check',\n description:\n 'Public liveness/identity probe for the Manufacturedops subgraph (manHealth). Requires no authentication.',\n inputSchema: {},\n },\n async () => {\n try {\n const data = await ctx.gql.workspace.request<{ manHealth: string }>(ops.HEALTH, {});\n return jsonResult({ ok: true, status: data.manHealth });\n } catch (error) {\n ctx.logger.error('manufacturedops health failed', { error: String(error) });\n return errorResult(\n `Manufacturedops health check failed: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n}\n","import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { mcpResourceUri, type McpContext } from '../../core/index.js';\nimport { LIST_PRODUCTION_ORDERS, LIST_WORK_CENTERS, LIST_NON_CONFORMANCES } from './operations.js';\n\n/**\n * Read-only Manufacturedops MCP resources. URIs are product-prefixed via\n * mcpResourceUri so they don't collide when multiple MCP servers run side by\n * side. Each is tracked at function entry so the shell manifest reflects what\n * was registered even though registration is imperative.\n */\nexport function registerManufacturedopsResources(\n server: McpServer,\n ctx: McpContext,\n track: (uri: string) => string,\n): void {\n const schemaUri = track(mcpResourceUri(ctx.productName, 'schema'));\n const ordersUri = track(mcpResourceUri(ctx.productName, 'production-orders'));\n const workCentersUri = track(mcpResourceUri(ctx.productName, 'work-centers'));\n const ncrUri = track(mcpResourceUri(ctx.productName, 'non-conformances'));\n\n // <product>://schema — domain overview\n server.registerResource(\n 'manufacturedops-schema',\n schemaUri,\n {\n title: 'Manufacturedops Domain Schema',\n description:\n 'Overview of the Manufacturedops MES domain — entities, enums, and the per-domain tool surface.',\n mimeType: 'text/plain',\n },\n async () => {\n ctx.logger.debug(`Resource ${schemaUri} requested`);\n const schema = `# Manufacturedops Domain (Overview)\n\nManufacturing Operations Platform (MES): production planning & shop-floor\nexecution, quality & traceability, and maintenance & OEE.\n\n## Entities\n- ManWorkCenter — a machine/line/cell/manual station (has operations)\n- ManProductionOrder — a manufacturing order (has operations + material lots)\n- ManProductionOperation — a routing step on a production order\n- ManMaterialLot — a traceable material lot (genealogy via parent/child)\n- ManQualityInspection — a recorded inspection (links plan + non-conformances)\n- ManInspectionPlan — a reusable inspection characteristics checklist\n- ManNonConformance — an NCR/CAPA (links originating inspection)\n- ManAsset — a maintainable asset (has maintenance work orders)\n- ManMaintenanceWorkOrder — a maintenance job against an asset\n- ManDowntimeEvent — a recorded downtime event (asset/work-center/order)\n\n## Enums\n- ManWorkCenterType: ASSEMBLY, CELL, LINE, MACHINE, MANUAL\n- ManProductionOrderStatus: PLANNED, RELEASED, IN_PROGRESS, PAUSED, COMPLETED, CLOSED, CANCELLED\n- ManProductionPriority: LOW, NORMAL, HIGH, URGENT\n- ManOperationStatus: PENDING, SETUP, RUNNING, DONE, SKIPPED\n- ManMaterialLotStatus: AVAILABLE, ALLOCATED, CONSUMED, QUARANTINED, SCRAPPED\n- ManInspectionStage: INCOMING, IN_PROCESS, FINAL, AUDIT\n- ManInspectionResult: PENDING, PASS, FAIL, CONDITIONAL\n- ManSeverity: MINOR, MAJOR, CRITICAL\n- ManNonConformanceStatus: OPEN, INVESTIGATING, CONTAINED, CORRECTIVE_ACTION, CLOSED\n- ManNonConformanceDisposition: OPEN, USE_AS_IS, REWORK, SCRAP, RETURN_TO_SUPPLIER\n- ManAssetStatus: OPERATIONAL, DEGRADED, DOWN, MAINTENANCE, RETIRED\n- ManMaintenanceType: PREVENTIVE, CORRECTIVE, PREDICTIVE, INSPECTION\n- ManMaintenanceStatus: SCHEDULED, IN_PROGRESS, ON_HOLD, COMPLETED, CANCELLED\n- ManDowntimeReason: PLANNED, BREAKDOWN, CHANGEOVER, MATERIAL_SHORTAGE, QUALITY, OTHER\n\n## Tool groups\nproduction (work_centers, production_orders, operations, material_lots),\nquality (inspections, inspection_plans, non_conformances),\nmaintenance (assets, maintenance work orders, downtime), plus the public health probe.\nAll run against the WORKSPACE gateway (workspace-scoped) except the public health probe.\n`;\n return {\n contents: [{ uri: schemaUri, text: schema, mimeType: 'text/plain' }],\n };\n },\n );\n\n // <product>://production-orders — open production orders\n server.registerResource(\n 'manufacturedops-production-orders',\n ordersUri,\n {\n title: 'Manufacturedops Production Orders',\n description: 'The first 50 production orders in the bound workspace.',\n mimeType: 'application/json',\n },\n async () => {\n ctx.logger.debug(`Resource ${ordersUri} requested`);\n try {\n const data = await ctx.gql.workspace.request<{ manListProductionOrders: unknown }>(\n LIST_PRODUCTION_ORDERS,\n { pagination: { limit: 50, offset: 0 } },\n );\n return {\n contents: [\n {\n uri: ordersUri,\n text: JSON.stringify(data.manListProductionOrders, null, 2),\n mimeType: 'application/json',\n },\n ],\n };\n } catch (error) {\n return {\n contents: [\n {\n uri: ordersUri,\n text: JSON.stringify({\n error: error instanceof Error ? error.message : String(error),\n }),\n mimeType: 'application/json',\n },\n ],\n };\n }\n },\n );\n\n // <product>://work-centers — active work-center directory\n server.registerResource(\n 'manufacturedops-work-centers',\n workCentersUri,\n {\n title: 'Manufacturedops Work Centers',\n description: 'Active work centers in the bound workspace.',\n mimeType: 'application/json',\n },\n async () => {\n ctx.logger.debug(`Resource ${workCentersUri} requested`);\n try {\n const data = await ctx.gql.workspace.request<{ manListWorkCenters: unknown }>(\n LIST_WORK_CENTERS,\n { isActive: true },\n );\n return {\n contents: [\n {\n uri: workCentersUri,\n text: JSON.stringify(data.manListWorkCenters, null, 2),\n mimeType: 'application/json',\n },\n ],\n };\n } catch (error) {\n return {\n contents: [\n {\n uri: workCentersUri,\n text: JSON.stringify({\n error: error instanceof Error ? error.message : String(error),\n }),\n mimeType: 'application/json',\n },\n ],\n };\n }\n },\n );\n\n // <product>://non-conformances — open NCR/CAPA queue\n server.registerResource(\n 'manufacturedops-non-conformances',\n ncrUri,\n {\n title: 'Manufacturedops Non-Conformances',\n description: 'The first 50 non-conformances (NCR/CAPA) in the bound workspace.',\n mimeType: 'application/json',\n },\n async () => {\n ctx.logger.debug(`Resource ${ncrUri} requested`);\n try {\n const data = await ctx.gql.workspace.request<{ manListNonConformances: unknown }>(\n LIST_NON_CONFORMANCES,\n { pagination: { limit: 50, offset: 0 } },\n );\n return {\n contents: [\n {\n uri: ncrUri,\n text: JSON.stringify(data.manListNonConformances, null, 2),\n mimeType: 'application/json',\n },\n ],\n };\n } catch (error) {\n return {\n contents: [\n {\n uri: ncrUri,\n text: JSON.stringify({\n error: error instanceof Error ? error.message : String(error),\n }),\n mimeType: 'application/json',\n },\n ],\n };\n }\n },\n );\n}\n","import { z } from 'zod';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { mcpPromptName, type McpContext } from '../../core/index.js';\n\n/**\n * Manufacturedops MCP prompts — guided multi-step workflows. Names are\n * product-prefixed via mcpPromptName and tracked at function entry.\n */\nexport function registerManufacturedopsPrompts(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n const p = ctx.productName;\n const orderName = track(mcpPromptName(p, 'production-order-runbook'));\n const qualityName = track(mcpPromptName(p, 'quality-maintenance-ops'));\n\n // <product>-production-order-runbook — plan + run an order end to end\n server.registerPrompt(\n orderName,\n {\n title: 'Production Order Runbook',\n description:\n 'Guide for planning and running a production order end to end: create the order, add routing operations, allocate material lots, release and progress through the shop floor, and inspect output.',\n argsSchema: {\n productSku: z.string().optional().describe('Product SKU to manufacture'),\n orderNumber: z.string().optional().describe('Order number to assign'),\n },\n },\n ({ productSku, orderNumber }) => {\n ctx.logger.debug(`Prompt ${orderName} called`, { productSku, orderNumber });\n const skuNote = productSku\n ? `Manufacture product SKU \"${productSku}\".`\n : 'Ask the user for the product SKU.';\n const orderNote = orderNumber\n ? `Use order number \"${orderNumber}\".`\n : 'Assign a unique order number.';\n return {\n messages: [\n {\n role: 'user' as const,\n content: {\n type: 'text' as const,\n text: `Help me plan and run a Manufacturedops production order.\n\n1. **Work Centers**: Use ${p}_work_centers_list to confirm the available work centers (create any missing ones with ${p}_work_centers_create).\n2. **Create Order**: Use ${p}_production_orders_create. ${skuNote} ${orderNote} Set quantity, uom, priority, and planned start/end.\n3. **Add Routing**: Use ${p}_operations_add for each step (name + sequence + workCenterId).\n4. **Allocate Materials**: Use ${p}_material_lots_create for incoming lots, then ${p}_material_lots_set_status=ALLOCATED for the order.\n5. **Release & Run**: Use ${p}_production_orders_transition (PLANNED → RELEASED → IN_PROGRESS). Log progress with ${p}_operations_record (setup/run minutes, good/scrap counts, status).\n6. **Inspect**: Use ${p}_inspections_record at the relevant stage; if it FAILs, raise an NCR with ${p}_non_conformances_raise.\n7. **Close**: Use ${p}_production_orders_transition (COMPLETED → CLOSED) when quantityDone meets target.\n\nShow results at each step and confirm before releasing and before closing.`,\n },\n },\n ],\n };\n },\n );\n\n // <product>-quality-maintenance-ops — daily quality + maintenance ops\n server.registerPrompt(\n qualityName,\n {\n title: 'Quality & Maintenance Operations',\n description:\n 'Daily operations workflow: triage the NCR/CAPA queue, drive corrective actions, review asset health, schedule maintenance, and log downtime for OEE.',\n argsSchema: {\n assetId: z.string().optional().describe('Asset ID to focus maintenance on'),\n },\n },\n ({ assetId }) => {\n ctx.logger.debug(`Prompt ${qualityName} called`, { assetId });\n const assetNote = assetId\n ? `Focus maintenance on asset \"${assetId}\".`\n : `First list assets with ${p}_assets_list and pick the ones needing attention.`;\n return {\n messages: [\n {\n role: 'user' as const,\n content: {\n type: 'text' as const,\n text: `Run daily Manufacturedops quality & maintenance operations. ${assetNote}\n\n1. **NCR Queue**: Use ${p}_non_conformances_list filtered by status=OPEN (and severity=CRITICAL/MAJOR) to find open issues.\n2. **Drive CAPA**: For each, use ${p}_non_conformances_update to record rootCause + correctiveAction, then ${p}_non_conformances_transition (INVESTIGATING → CONTAINED → CORRECTIVE_ACTION → CLOSED).\n3. **Asset Health**: Use ${p}_assets_list filtered by status=DEGRADED/DOWN; inspect each with ${p}_assets_get to review running hours vs PM interval.\n4. **Schedule Maintenance**: Use ${p}_maintenance_create for due PM/corrective jobs, then ${p}_maintenance_transition (SCHEDULED → IN_PROGRESS → COMPLETED).\n5. **Downtime / OEE**: Use ${p}_downtime_record for any stoppages and ${p}_downtime_list to review losses by reason.\n6. **Inspections**: Use ${p}_inspections_list filtered by result=FAIL to catch recurring quality escapes.\n\nSummarize what needs attention after each step.`,\n },\n },\n ],\n };\n },\n );\n}\n","/**\n * Manufacturedops module — domain module for the future-products ecosystem program.\n *\n * Covers all 10 @key entities of wspace-manufacturedops-svc grouped into three\n * shop-floor domains plus a public health probe:\n * - production: work centers, production orders, operations, material lots\n * - quality: inspections, inspection plans, non-conformances (NCR/CAPA)\n * - maintenance: assets, maintenance work orders, downtime events\n * - health: the @public manHealth liveness probe\n *\n * Mirrors the kadaikodi / crewfoundry modules' structure (tools/<domain>.ts +\n * resources.ts + prompts.ts) and the canonical tags module's typing discipline.\n *\n * Backend: ~/products/wspace/manufacturedops/wspace-manufacturedops-svc/\n * (Hive service name `manufacturedops`). All operations run against the\n * WORKSPACE gateway; every root field carries the consistent `man` server prefix\n * and the @public manHealth probe is exposed as `<product>_health`.\n */\n\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport type { McpContext, McpModule, ModuleRegistration } from '../../core/index.js';\nimport { registerProductionTools } from './tools/production.js';\nimport { registerQualityTools } from './tools/quality.js';\nimport { registerMaintenanceTools } from './tools/maintenance.js';\nimport { registerHealthTools } from './tools/health.js';\nimport { registerManufacturedopsResources } from './resources.js';\nimport { registerManufacturedopsPrompts } from './prompts.js';\n\nconst manufacturedopsModule: McpModule = {\n id: 'manufacturedops',\n version: '0.0.1',\n displayName: 'Manufacturedops',\n dependsOn: ['auth'],\n capabilities: { tools: {}, resources: {}, prompts: {} },\n\n register(server: McpServer, ctx: McpContext): ModuleRegistration {\n const tools: string[] = [];\n const resources: string[] = [];\n const prompts: string[] = [];\n\n const trackTool = (n: string): string => {\n tools.push(n);\n return n;\n };\n const trackResource = (uri: string): string => {\n resources.push(uri);\n return uri;\n };\n const trackPrompt = (n: string): string => {\n prompts.push(n);\n return n;\n };\n\n registerProductionTools(server, ctx, trackTool);\n registerQualityTools(server, ctx, trackTool);\n registerMaintenanceTools(server, ctx, trackTool);\n registerHealthTools(server, ctx, trackTool);\n\n registerManufacturedopsResources(server, ctx, trackResource);\n registerManufacturedopsPrompts(server, ctx, trackPrompt);\n\n return { tools, resources, prompts };\n },\n};\n\nexport default manufacturedopsModule;\n"]}
|