@walkeros/mcp 2.0.1 → 3.0.0

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/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/tools/bundle.ts","../src/schemas/output.ts","../src/tools/helpers.ts","../src/tools/simulate.ts","../src/tools/push.ts","../src/tools/validate.ts","../src/tools/auth.ts","../src/tools/projects.ts","../src/tools/flows.ts","../src/tools/deploy.ts","../src/tools/get-package-schema.ts","../src/resources/package-schemas.ts","../src/resources/flows.ts"],"sourcesContent":["import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\n// Local CLI tools\nimport { registerBundleTool } from './tools/bundle.js';\nimport { registerSimulateTool } from './tools/simulate.js';\nimport { registerPushTool } from './tools/push.js';\nimport { registerValidateTool } from './tools/validate.js';\n// API tools\nimport { registerAuthTools } from './tools/auth.js';\nimport { registerProjectTools } from './tools/projects.js';\nimport { registerFlowTools } from './tools/flows.js';\nimport { registerDeployTools } from './tools/deploy.js';\n// CDN tools\nimport { registerGetPackageSchemaTool } from './tools/get-package-schema.js';\n// Resources\nimport { registerPackageSchemaResources } from './resources/package-schemas.js';\nimport { registerFlowResources } from './resources/flows.js';\n\ndeclare const __VERSION__: string;\n\nconst server = new McpServer({\n name: 'walkeros',\n version: __VERSION__,\n});\n\n// Local CLI tools\nregisterBundleTool(server);\nregisterSimulateTool(server);\nregisterPushTool(server);\nregisterValidateTool(server);\n\n// API tools\nregisterAuthTools(server);\nregisterProjectTools(server);\nregisterFlowTools(server);\nregisterDeployTools(server);\n\n// CDN tools\nregisterGetPackageSchemaTool(server);\n\n// Resources\nregisterPackageSchemaResources(server);\nregisterFlowResources(server);\n\nasync function main() {\n const transport = new StdioServerTransport();\n await server.connect(transport);\n console.error('walkerOS MCP server running on stdio');\n}\n\nmain().catch((error) => {\n console.error('Failed to start MCP server:', error);\n process.exit(1);\n});\n","import { z } from 'zod';\nimport { bundle, bundleRemote } from '@walkeros/cli';\nimport { schemas } from '@walkeros/cli/dev';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { BundleOutputShape } from '../schemas/output.js';\nimport { apiResult } from './helpers.js';\n\nexport function registerBundleTool(server: McpServer) {\n server.registerTool(\n 'bundle',\n {\n title: 'Bundle',\n description:\n 'Bundle a walkerOS flow configuration into deployable JavaScript. ' +\n 'Resolves all destinations, sources, and transformers, then outputs ' +\n 'a tree-shaken production bundle. Returns bundle statistics. ' +\n 'Set remote: true to use the walkerOS cloud service instead of local build tools.',\n inputSchema: {\n ...schemas.BundleInputShape,\n remote: z\n .boolean()\n .optional()\n .describe(\n 'Use remote cloud bundling (requires WALKEROS_TOKEN). Default: false (local)',\n ),\n content: z\n .record(z.string(), z.unknown())\n .optional()\n .describe('Flow.Setup JSON content (required when remote: true)'),\n },\n outputSchema: BundleOutputShape,\n annotations: {\n readOnlyHint: false,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: false,\n },\n },\n async ({ configPath, flow, stats, output, remote, content }) => {\n try {\n if (remote) {\n if (!content)\n throw new Error('content is required when remote: true');\n const result = await bundleRemote({\n content: content as Record<string, unknown>,\n flowName: flow,\n });\n return apiResult({ success: true, ...result });\n }\n\n // Local bundle path\n const result = await bundle(configPath, {\n flowName: flow,\n stats: stats ?? true,\n buildOverrides: output ? { output } : undefined,\n });\n\n const output_ = (result as unknown as Record<string, unknown>) ?? {\n success: true,\n message: 'Bundle created',\n };\n\n return {\n content: [\n {\n type: 'text' as const,\n text: JSON.stringify(output_, null, 2),\n },\n ],\n structuredContent: output_,\n };\n } catch (error) {\n return {\n content: [\n {\n type: 'text' as const,\n text: JSON.stringify({\n success: false,\n error: error instanceof Error ? error.message : 'Unknown error',\n }),\n },\n ],\n isError: true,\n };\n }\n },\n );\n}\n","import { z } from 'zod';\n\n// Shared primitives\nconst timestamp = z.string().describe('ISO 8601 timestamp');\nconst projectId = z.string().describe('Project ID (proj_...)');\nconst flowId = z.string().describe('Flow ID (cfg_...)');\n\n// Error shape (for reference)\nexport const ErrorOutputShape = {\n error: z.string().describe('Error message'),\n};\n\n// CLI tool output shapes\nexport const ValidateOutputShape = {\n valid: z.boolean().describe('Whether validation passed'),\n type: z\n .union([\n z.enum(['event', 'flow', 'mapping']),\n z.string().regex(/^(destinations|sources|transformers)\\.\\w+$/),\n ])\n .describe('What was validated'),\n errors: z\n .array(\n z.object({\n path: z.string(),\n message: z.string(),\n value: z.unknown().optional(),\n code: z.string().optional(),\n }),\n )\n .describe('Validation errors'),\n warnings: z\n .array(\n z.object({\n path: z.string(),\n message: z.string(),\n suggestion: z.string().optional(),\n }),\n )\n .describe('Validation warnings'),\n details: z\n .record(z.string(), z.unknown())\n .describe('Additional validation details'),\n};\n\nexport const BundleOutputShape = {\n success: z.boolean().describe('Whether bundling succeeded'),\n totalSize: z.number().optional().describe('Total bundle size in bytes'),\n buildTime: z.number().optional().describe('Build time in milliseconds'),\n packages: z\n .array(\n z.object({\n name: z.string(),\n size: z.number(),\n }),\n )\n .optional()\n .describe('Per-package size breakdown'),\n treeshakingEffective: z\n .boolean()\n .optional()\n .describe('Whether tree-shaking was effective'),\n message: z.string().optional().describe('Status message'),\n};\n\nexport const SimulateOutputShape = {\n success: z.boolean().describe('Whether simulation succeeded'),\n error: z.string().optional().describe('Error message if simulation failed'),\n collector: z\n .unknown()\n .optional()\n .describe('Collector state after simulation'),\n elbResult: z.unknown().optional().describe('Push result from the collector'),\n logs: z.array(z.unknown()).optional().describe('Log entries from simulation'),\n usage: z\n .record(z.string(), z.array(z.unknown()))\n .optional()\n .describe('API call usage per destination'),\n duration: z\n .number()\n .optional()\n .describe('Simulation duration in milliseconds'),\n};\n\nexport const PushOutputShape = {\n success: z.boolean().describe('Whether push succeeded'),\n elbResult: z.unknown().optional().describe('Push result from the collector'),\n duration: z.number().describe('Push duration in milliseconds'),\n error: z.string().optional().describe('Error message if push failed'),\n};\n\n// Auth output shapes\nexport const WhoamiOutputShape = {\n userId: z.string().describe('User ID'),\n email: z.string().describe('User email address'),\n projectId: z\n .string()\n .nullable()\n .describe('Project ID if token is project-scoped'),\n};\n\n// Project output shapes\nconst projectFields = {\n id: projectId,\n name: z.string().describe('Project name'),\n role: z.enum(['owner', 'member']).describe('Your role in this project'),\n createdAt: timestamp,\n updatedAt: timestamp,\n};\n\nexport const ProjectOutputShape = { ...projectFields };\n\nexport const ListProjectsOutputShape = {\n projects: z.array(z.object(projectFields)).describe('List of projects'),\n total: z.number().describe('Total number of projects'),\n};\n\n// Flow output shapes\nconst flowFields = {\n id: flowId,\n name: z.string().describe('Flow name'),\n content: z\n .record(z.string(), z.unknown())\n .describe('Flow.Setup JSON content'),\n createdAt: timestamp,\n updatedAt: timestamp,\n deletedAt: z\n .string()\n .nullable()\n .optional()\n .describe('Deletion timestamp if soft-deleted'),\n};\n\nexport const FlowOutputShape = { ...flowFields };\n\nconst flowSummaryFields = {\n id: flowId,\n name: z.string().describe('Flow name'),\n createdAt: timestamp,\n updatedAt: timestamp,\n deletedAt: z\n .string()\n .nullable()\n .describe('Deletion timestamp if soft-deleted'),\n};\n\nexport const ListFlowsOutputShape = {\n flows: z\n .array(z.object(flowSummaryFields))\n .describe('List of flow summaries'),\n total: z.number().describe('Total number of flows'),\n};\n\n// Delete output shape (shared)\nexport const DeleteOutputShape = {\n success: z.literal(true).describe('Deletion succeeded'),\n};\n\n// Package Schema output shape\nexport const PackageSchemaOutputShape = {\n package: z.string().describe('Package name'),\n version: z.string().describe('Package version'),\n type: z.string().describe('Package type (destination, source, transformer)'),\n platform: z.string().describe('Target platform (web, server)'),\n schemas: z\n .record(z.string(), z.unknown())\n .describe('JSON Schemas for settings and mapping'),\n examples: z\n .record(z.string(), z.unknown())\n .optional()\n .describe('Configuration examples'),\n};\n\n// Bundle Remote output shape\nexport const BundleRemoteOutputShape = {\n success: z.boolean().describe('Whether bundling succeeded'),\n bundle: z.string().describe('Compiled JavaScript bundle'),\n size: z.number().describe('Bundle size in bytes'),\n stats: z\n .record(z.string(), z.unknown())\n .optional()\n .describe('Bundle statistics from server'),\n};\n","export function apiResult(result: unknown) {\n return {\n content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }],\n structuredContent: result as Record<string, unknown>,\n };\n}\n\nexport function apiError(error: unknown) {\n return {\n content: [\n {\n type: 'text' as const,\n text: JSON.stringify({\n error: error instanceof Error ? error.message : 'Unknown error',\n }),\n },\n ],\n isError: true as const,\n };\n}\n","import { simulate } from '@walkeros/cli';\nimport { schemas } from '@walkeros/cli/dev';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { SimulateOutputShape } from '../schemas/output.js';\n\nexport function registerSimulateTool(server: McpServer) {\n server.registerTool(\n 'simulate',\n {\n title: 'Simulate',\n description:\n 'Simulate events through a walkerOS flow without making real API calls. ' +\n 'Processes events through the full pipeline including transformers and destinations, ' +\n 'returning detailed results with logs and usage statistics.',\n inputSchema: schemas.SimulateInputShape,\n outputSchema: SimulateOutputShape,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: false,\n },\n },\n async ({ configPath, event, flow, platform }) => {\n try {\n // Parse event if JSON string\n let parsedEvent: unknown = event;\n if (event.startsWith('{') || event.startsWith('[')) {\n try {\n parsedEvent = JSON.parse(event);\n } catch {\n // Keep as string (file path or URL)\n }\n }\n\n const result = await simulate(configPath, parsedEvent, {\n json: true,\n flow,\n platform,\n });\n\n return {\n content: [\n {\n type: 'text' as const,\n text: JSON.stringify(result, null, 2),\n },\n ],\n structuredContent: result as unknown as Record<string, unknown>,\n };\n } catch (error) {\n return {\n content: [\n {\n type: 'text' as const,\n text: JSON.stringify({\n success: false,\n error: error instanceof Error ? error.message : 'Unknown error',\n }),\n },\n ],\n isError: true,\n };\n }\n },\n );\n}\n","import { push } from '@walkeros/cli';\nimport { schemas } from '@walkeros/cli/dev';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { PushOutputShape } from '../schemas/output.js';\n\nexport function registerPushTool(server: McpServer) {\n server.registerTool(\n 'push',\n {\n title: 'Push',\n description:\n 'Push a real event through a walkerOS flow to actual destinations. ' +\n 'WARNING: This makes real API calls to real endpoints. ' +\n 'Events will be sent to configured destinations (analytics, CRM, etc.).',\n inputSchema: schemas.PushInputShape,\n outputSchema: PushOutputShape,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n idempotentHint: false,\n openWorldHint: true,\n },\n },\n async ({ configPath, event, flow, platform }) => {\n try {\n // Parse event if JSON string\n let parsedEvent: unknown = event;\n if (event.startsWith('{') || event.startsWith('[')) {\n try {\n parsedEvent = JSON.parse(event);\n } catch {\n // Keep as string (file path or URL)\n }\n }\n\n const result = await push(configPath, parsedEvent, {\n json: true,\n flow,\n platform,\n });\n\n return {\n content: [\n {\n type: 'text' as const,\n text: JSON.stringify(result, null, 2),\n },\n ],\n structuredContent: result as unknown as Record<string, unknown>,\n };\n } catch (error) {\n return {\n content: [\n {\n type: 'text' as const,\n text: JSON.stringify({\n success: false,\n error: error instanceof Error ? error.message : 'Unknown error',\n }),\n },\n ],\n isError: true,\n };\n }\n },\n );\n}\n","import { validate } from '@walkeros/cli';\nimport { schemas } from '@walkeros/cli/dev';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { ValidateOutputShape } from '../schemas/output.js';\n\nexport function registerValidateTool(server: McpServer) {\n server.registerTool(\n 'validate',\n {\n title: 'Validate',\n description:\n 'Validate walkerOS events, flow configurations, or mapping rules. ' +\n 'Accepts JSON strings, file paths, or URLs as input. ' +\n 'Returns validation results with errors, warnings, and details.',\n inputSchema: schemas.ValidateInputShape,\n outputSchema: ValidateOutputShape,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: false,\n },\n },\n async ({ type, input, flow }) => {\n try {\n // Parse input if it looks like JSON\n let parsedInput: unknown = input;\n if (input.startsWith('{') || input.startsWith('[')) {\n try {\n parsedInput = JSON.parse(input);\n } catch {\n // Keep as string (file path or URL)\n }\n }\n\n const result = await validate(type, parsedInput, { flow });\n\n return {\n content: [\n {\n type: 'text' as const,\n text: JSON.stringify(result, null, 2),\n },\n ],\n structuredContent: result as unknown as Record<string, unknown>,\n };\n } catch (error) {\n return {\n content: [\n {\n type: 'text' as const,\n text: JSON.stringify({\n valid: false,\n error: error instanceof Error ? error.message : 'Unknown error',\n }),\n },\n ],\n isError: true,\n };\n }\n },\n );\n}\n","import { whoami } from '@walkeros/cli';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { apiResult, apiError } from './helpers.js';\nimport { WhoamiOutputShape } from '../schemas/output.js';\n\nexport function registerAuthTools(server: McpServer) {\n server.registerTool(\n 'whoami',\n {\n title: 'Who Am I',\n description:\n 'Verify your API token and see your identity. ' +\n 'Returns user ID, email, and project ID (if token is project-scoped). ' +\n 'Use this to confirm your token works and discover your project ID.',\n inputSchema: {},\n outputSchema: WhoamiOutputShape,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: true,\n },\n },\n async () => {\n try {\n return apiResult(await whoami());\n } catch (error) {\n return apiError(error);\n }\n },\n );\n}\n","import { z } from 'zod';\nimport {\n listProjects,\n getProject,\n createProject,\n updateProject,\n deleteProject,\n} from '@walkeros/cli';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { apiResult, apiError } from './helpers.js';\nimport {\n ListProjectsOutputShape,\n ProjectOutputShape,\n DeleteOutputShape,\n} from '../schemas/output.js';\n\nexport function registerProjectTools(server: McpServer) {\n server.registerTool(\n 'list-projects',\n {\n title: 'List Projects',\n description:\n 'List all projects you have access to. Returns project IDs, names, and your role.',\n inputSchema: {},\n outputSchema: ListProjectsOutputShape,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: true,\n },\n },\n async () => {\n try {\n return apiResult(await listProjects());\n } catch (error) {\n return apiError(error);\n }\n },\n );\n\n server.registerTool(\n 'get-project',\n {\n title: 'Get Project',\n description:\n 'Get details for a project. Uses WALKEROS_PROJECT_ID if projectId is omitted.',\n inputSchema: {\n projectId: z\n .string()\n .optional()\n .describe('Project ID (defaults to WALKEROS_PROJECT_ID)'),\n },\n outputSchema: ProjectOutputShape,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: true,\n },\n },\n async ({ projectId }) => {\n try {\n return apiResult(await getProject({ projectId }));\n } catch (error) {\n return apiError(error);\n }\n },\n );\n\n server.registerTool(\n 'create-project',\n {\n title: 'Create Project',\n description: 'Create a new project.',\n inputSchema: {\n name: z.string().min(1).max(255).describe('Project name'),\n },\n outputSchema: ProjectOutputShape,\n annotations: {\n readOnlyHint: false,\n destructiveHint: false,\n idempotentHint: false,\n openWorldHint: true,\n },\n },\n async ({ name }) => {\n try {\n return apiResult(await createProject({ name }));\n } catch (error) {\n return apiError(error);\n }\n },\n );\n\n server.registerTool(\n 'update-project',\n {\n title: 'Update Project',\n description:\n 'Update a project name. Uses WALKEROS_PROJECT_ID if projectId is omitted.',\n inputSchema: {\n projectId: z\n .string()\n .optional()\n .describe('Project ID (defaults to WALKEROS_PROJECT_ID)'),\n name: z.string().min(1).max(255).describe('New project name'),\n },\n outputSchema: ProjectOutputShape,\n annotations: {\n readOnlyHint: false,\n destructiveHint: false,\n idempotentHint: false,\n openWorldHint: true,\n },\n },\n async ({ projectId, name }) => {\n try {\n return apiResult(await updateProject({ projectId, name }));\n } catch (error) {\n return apiError(error);\n }\n },\n );\n\n server.registerTool(\n 'delete-project',\n {\n title: 'Delete Project',\n description:\n 'Soft-delete a project and all its flows. ' +\n 'WARNING: This deletes the project and ALL associated flows and data. ' +\n 'Uses WALKEROS_PROJECT_ID if projectId is omitted.',\n inputSchema: {\n projectId: z\n .string()\n .optional()\n .describe('Project ID (defaults to WALKEROS_PROJECT_ID)'),\n },\n outputSchema: DeleteOutputShape,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n idempotentHint: false,\n openWorldHint: true,\n },\n },\n async ({ projectId }) => {\n try {\n return apiResult(await deleteProject({ projectId }));\n } catch (error) {\n return apiError(error);\n }\n },\n );\n}\n","import { z } from 'zod';\nimport {\n listFlows,\n getFlow,\n createFlow,\n updateFlow,\n deleteFlow,\n duplicateFlow,\n} from '@walkeros/cli';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { apiResult, apiError } from './helpers.js';\nimport {\n ListFlowsOutputShape,\n FlowOutputShape,\n DeleteOutputShape,\n} from '../schemas/output.js';\n\nexport function registerFlowTools(server: McpServer) {\n server.registerTool(\n 'list-flows',\n {\n title: 'List Flows',\n description: 'List all flow configurations in a project.',\n inputSchema: {\n projectId: z\n .string()\n .optional()\n .describe('Project ID (defaults to WALKEROS_PROJECT_ID)'),\n sort: z\n .enum(['name', 'updated_at', 'created_at'])\n .optional()\n .describe('Sort field (default: updated_at)'),\n order: z\n .enum(['asc', 'desc'])\n .optional()\n .describe('Sort order (default: desc)'),\n includeDeleted: z\n .boolean()\n .optional()\n .describe('Include soft-deleted flows (default: false)'),\n },\n outputSchema: ListFlowsOutputShape,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: true,\n },\n },\n async ({ projectId, sort, order, includeDeleted }) => {\n try {\n return apiResult(\n await listFlows({ projectId, sort, order, includeDeleted }),\n );\n } catch (error) {\n return apiError(error);\n }\n },\n );\n\n server.registerTool(\n 'get-flow',\n {\n title: 'Get Flow',\n description:\n 'Get a flow configuration with its full content (Flow.Setup JSON).',\n inputSchema: {\n flowId: z.string().describe('Flow ID (cfg_...)'),\n projectId: z\n .string()\n .optional()\n .describe('Project ID (defaults to WALKEROS_PROJECT_ID)'),\n },\n outputSchema: FlowOutputShape,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: true,\n },\n },\n async ({ flowId, projectId }) => {\n try {\n return apiResult(await getFlow({ flowId, projectId }));\n } catch (error) {\n return apiError(error);\n }\n },\n );\n\n server.registerTool(\n 'create-flow',\n {\n title: 'Create Flow',\n description: 'Create a new flow configuration in a project.',\n inputSchema: {\n name: z.string().min(1).max(255).describe('Flow name'),\n content: z\n .record(z.string(), z.unknown())\n .describe('Flow.Setup JSON content (must have version: 1)'),\n projectId: z\n .string()\n .optional()\n .describe('Project ID (defaults to WALKEROS_PROJECT_ID)'),\n },\n outputSchema: FlowOutputShape,\n annotations: {\n readOnlyHint: false,\n destructiveHint: false,\n idempotentHint: false,\n openWorldHint: true,\n },\n },\n async ({ name, content, projectId }) => {\n try {\n return apiResult(await createFlow({ name, content, projectId }));\n } catch (error) {\n return apiError(error);\n }\n },\n );\n\n server.registerTool(\n 'update-flow',\n {\n title: 'Update Flow',\n description: 'Update a flow configuration name and/or content.',\n inputSchema: {\n flowId: z.string().describe('Flow ID (cfg_...)'),\n name: z.string().min(1).max(255).optional().describe('New flow name'),\n content: z\n .record(z.string(), z.unknown())\n .optional()\n .describe('New Flow.Setup JSON content'),\n projectId: z\n .string()\n .optional()\n .describe('Project ID (defaults to WALKEROS_PROJECT_ID)'),\n },\n outputSchema: FlowOutputShape,\n annotations: {\n readOnlyHint: false,\n destructiveHint: false,\n idempotentHint: false,\n openWorldHint: true,\n },\n },\n async ({ flowId, name, content, projectId }) => {\n try {\n return apiResult(\n await updateFlow({ flowId, name, content, projectId }),\n );\n } catch (error) {\n return apiError(error);\n }\n },\n );\n\n server.registerTool(\n 'delete-flow',\n {\n title: 'Delete Flow',\n description:\n 'Soft-delete a flow configuration. ' +\n 'WARNING: This removes the flow configuration. Can be restored later. ' +\n 'Requires flowId.',\n inputSchema: {\n flowId: z.string().describe('Flow ID (cfg_...)'),\n projectId: z\n .string()\n .optional()\n .describe('Project ID (defaults to WALKEROS_PROJECT_ID)'),\n },\n outputSchema: DeleteOutputShape,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n idempotentHint: false,\n openWorldHint: true,\n },\n },\n async ({ flowId, projectId }) => {\n try {\n return apiResult(await deleteFlow({ flowId, projectId }));\n } catch (error) {\n return apiError(error);\n }\n },\n );\n\n server.registerTool(\n 'duplicate-flow',\n {\n title: 'Duplicate Flow',\n description: 'Create a copy of an existing flow configuration.',\n inputSchema: {\n flowId: z.string().describe('Flow ID to duplicate (cfg_...)'),\n name: z\n .string()\n .optional()\n .describe('Name for the copy (defaults to \"Copy of ...\")'),\n projectId: z\n .string()\n .optional()\n .describe('Project ID (defaults to WALKEROS_PROJECT_ID)'),\n },\n outputSchema: FlowOutputShape,\n annotations: {\n readOnlyHint: false,\n destructiveHint: false,\n idempotentHint: false,\n openWorldHint: true,\n },\n },\n async ({ flowId, name, projectId }) => {\n try {\n return apiResult(await duplicateFlow({ flowId, name, projectId }));\n } catch (error) {\n return apiError(error);\n }\n },\n );\n}\n","import { z } from 'zod';\nimport { deploy, getDeployment } from '@walkeros/cli';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { apiResult, apiError } from './helpers.js';\n\nexport function registerDeployTools(server: McpServer) {\n server.registerTool(\n 'deploy-flow',\n {\n title: 'Deploy Flow',\n description:\n 'Deploy a flow to walkerOS cloud. Auto-detects web (script hosting) or server (container) from the flow content. Returns deployment status, and for web deploys the public URL and script tag.',\n inputSchema: {\n flowId: z.string().describe('Flow ID to deploy'),\n projectId: z\n .string()\n .optional()\n .describe('Project ID (defaults to WALKEROS_PROJECT_ID)'),\n wait: z\n .boolean()\n .optional()\n .default(true)\n .describe(\n 'Wait for deployment to complete (default: true). Set to false to return immediately after triggering.',\n ),\n flowName: z\n .string()\n .optional()\n .describe(\n 'Flow name for multi-config flows. Required when a flow has multiple configs.',\n ),\n },\n annotations: {\n readOnlyHint: false,\n destructiveHint: false,\n idempotentHint: false,\n openWorldHint: true,\n },\n },\n async ({ flowId, projectId, wait, flowName }) => {\n try {\n return apiResult(await deploy({ flowId, projectId, wait, flowName }));\n } catch (error) {\n return apiError(error);\n }\n },\n );\n\n server.registerTool(\n 'get-deployment',\n {\n title: 'Get Deployment',\n description:\n 'Get the latest deployment status for a flow. Returns deployment type, status, URLs, and error details.',\n inputSchema: {\n flowId: z.string().describe('Flow ID to check'),\n projectId: z\n .string()\n .optional()\n .describe('Project ID (defaults to WALKEROS_PROJECT_ID)'),\n flowName: z\n .string()\n .optional()\n .describe(\n 'Flow name for multi-config flows. Required when a flow has multiple configs.',\n ),\n },\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: true,\n },\n },\n async ({ flowId, projectId, flowName }) => {\n try {\n return apiResult(await getDeployment({ flowId, projectId, flowName }));\n } catch (error) {\n return apiError(error);\n }\n },\n );\n}\n","import { z } from 'zod';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { fetchPackageSchema } from '@walkeros/core';\nimport { PackageSchemaOutputShape } from '../schemas/output.js';\n\nexport function registerGetPackageSchemaTool(server: McpServer) {\n server.registerTool(\n 'get-package-schema',\n {\n title: 'Get Package Schema',\n description:\n 'Fetch walkerOS package schemas and examples from npm via jsdelivr CDN. ' +\n 'Returns JSON Schemas for settings and mapping configuration, plus examples. ' +\n 'Use this to understand how to configure a destination, source, or transformer ' +\n 'when building a flow.json.',\n inputSchema: {\n package: z\n .string()\n .min(1)\n .describe(\n 'Exact npm package name (e.g., @walkeros/web-destination-snowplow)',\n ),\n version: z\n .string()\n .optional()\n .describe('Package version (default: latest)'),\n },\n outputSchema: PackageSchemaOutputShape,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: true,\n },\n },\n async ({ package: packageName, version }) => {\n try {\n const info = await fetchPackageSchema(packageName, { version });\n\n const result = {\n package: info.packageName,\n version: info.version,\n type: info.type,\n platform: info.platform,\n schemas: info.schemas,\n examples: info.examples,\n };\n\n return {\n content: [\n { type: 'text' as const, text: JSON.stringify(result, null, 2) },\n ],\n structuredContent: result as unknown as Record<string, unknown>,\n };\n } catch (error) {\n return {\n content: [\n {\n type: 'text' as const,\n text: JSON.stringify({\n error: error instanceof Error ? error.message : 'Unknown error',\n }),\n },\n ],\n isError: true,\n };\n }\n },\n );\n}\n","import { ResourceTemplate } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { fetchPackageSchema } from '@walkeros/core';\n\nconst KNOWN_PACKAGES = [\n '@walkeros/web-destination-google-ga4',\n '@walkeros/web-destination-meta-pixel',\n '@walkeros/web-destination-plausible',\n '@walkeros/web-destination-snowplow',\n '@walkeros/web-destination-piwikpro',\n '@walkeros/web-destination-etag',\n '@walkeros/web-destination-bigquery',\n '@walkeros/web-source-walker',\n '@walkeros/web-source-datalayer',\n];\n\nexport function registerPackageSchemaResources(server: McpServer) {\n const template = new ResourceTemplate('walkeros://schema/{packageName}', {\n list: async () => ({\n resources: KNOWN_PACKAGES.map((pkg) => ({\n uri: `walkeros://schema/${encodeURIComponent(pkg)}`,\n name: pkg,\n description: `Schema and examples for ${pkg}`,\n mimeType: 'application/json' as const,\n })),\n }),\n });\n\n server.registerResource(\n 'package-schema',\n template,\n {\n title: 'walkerOS Package Schema',\n description:\n 'JSON Schema and configuration examples for walkerOS packages',\n mimeType: 'application/json',\n },\n async (uri, { packageName }) => {\n const info = await fetchPackageSchema(\n decodeURIComponent(packageName as string),\n );\n return {\n contents: [\n {\n uri: uri.toString(),\n mimeType: 'application/json' as const,\n text: JSON.stringify(info, null, 2),\n },\n ],\n };\n },\n );\n}\n","import { listFlows, getFlow } from '@walkeros/cli';\nimport { ResourceTemplate } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\n\nexport function registerFlowResources(server: McpServer) {\n const template = new ResourceTemplate('walkeros://flow/{flowId}', {\n list: async () => {\n try {\n const { flows } = await listFlows({});\n return {\n resources: flows.map((f: { id: string; name: string }) => ({\n uri: `walkeros://flow/${f.id}`,\n name: f.name,\n mimeType: 'application/json' as const,\n })),\n };\n } catch {\n return { resources: [] };\n }\n },\n });\n\n server.registerResource(\n 'flow-config',\n template,\n {\n title: 'walkerOS Flow Configuration',\n description: 'Flow configurations from your walkerOS project',\n mimeType: 'application/json',\n },\n async (uri, { flowId }) => {\n const flow = await getFlow({ flowId: flowId as string });\n return {\n contents: [\n {\n uri: uri.toString(),\n mimeType: 'application/json' as const,\n text: JSON.stringify(flow, null, 2),\n },\n ],\n };\n },\n );\n}\n"],"mappings":";;;AAAA,SAAS,iBAAiB;AAC1B,SAAS,4BAA4B;;;ACDrC,SAAS,KAAAA,UAAS;AAClB,SAAS,QAAQ,oBAAoB;AACrC,SAAS,eAAe;;;ACFxB,SAAS,SAAS;AAGlB,IAAM,YAAY,EAAE,OAAO,EAAE,SAAS,oBAAoB;AAC1D,IAAM,YAAY,EAAE,OAAO,EAAE,SAAS,uBAAuB;AAC7D,IAAM,SAAS,EAAE,OAAO,EAAE,SAAS,mBAAmB;AAG/C,IAAM,mBAAmB;AAAA,EAC9B,OAAO,EAAE,OAAO,EAAE,SAAS,eAAe;AAC5C;AAGO,IAAM,sBAAsB;AAAA,EACjC,OAAO,EAAE,QAAQ,EAAE,SAAS,2BAA2B;AAAA,EACvD,MAAM,EACH,MAAM;AAAA,IACL,EAAE,KAAK,CAAC,SAAS,QAAQ,SAAS,CAAC;AAAA,IACnC,EAAE,OAAO,EAAE,MAAM,4CAA4C;AAAA,EAC/D,CAAC,EACA,SAAS,oBAAoB;AAAA,EAChC,QAAQ,EACL;AAAA,IACC,EAAE,OAAO;AAAA,MACP,MAAM,EAAE,OAAO;AAAA,MACf,SAAS,EAAE,OAAO;AAAA,MAClB,OAAO,EAAE,QAAQ,EAAE,SAAS;AAAA,MAC5B,MAAM,EAAE,OAAO,EAAE,SAAS;AAAA,IAC5B,CAAC;AAAA,EACH,EACC,SAAS,mBAAmB;AAAA,EAC/B,UAAU,EACP;AAAA,IAC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F;AAAA,EACF,CAAC;AAED,EAAAG,QAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,MACE,OAAO;AAAA,MACP,aAAa;AAAA,MACb,UAAU;AAAA,IACZ;AAAA,IACA,OAAO,KAAK,EAAE,QAAAC,QAAO,MAAM;AACzB,YAAM,OAAO,MAAMH,SAAQ,EAAE,QAAQG,QAAiB,CAAC;AACvD,aAAO;AAAA,QACL,UAAU;AAAA,UACR;AAAA,YACE,KAAK,IAAI,SAAS;AAAA,YAClB,UAAU;AAAA,YACV,MAAM,KAAK,UAAU,MAAM,MAAM,CAAC;AAAA,UACpC;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;;;AbvBA,IAAM,SAAS,IAAI,UAAU;AAAA,EAC3B,MAAM;AAAA,EACN,SAAS;AACX,CAAC;AAGD,mBAAmB,MAAM;AACzB,qBAAqB,MAAM;AAC3B,iBAAiB,MAAM;AACvB,qBAAqB,MAAM;AAG3B,kBAAkB,MAAM;AACxB,qBAAqB,MAAM;AAC3B,kBAAkB,MAAM;AACxB,oBAAoB,MAAM;AAG1B,6BAA6B,MAAM;AAGnC,+BAA+B,MAAM;AACrC,sBAAsB,MAAM;AAE5B,eAAe,OAAO;AACpB,QAAM,YAAY,IAAI,qBAAqB;AAC3C,QAAM,OAAO,QAAQ,SAAS;AAC9B,UAAQ,MAAM,sCAAsC;AACtD;AAEA,KAAK,EAAE,MAAM,CAAC,UAAU;AACtB,UAAQ,MAAM,+BAA+B,KAAK;AAClD,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":["z","server","z","result","schemas","server","schemas","schemas","server","schemas","schemas","server","schemas","server","z","server","z","projectId","z","server","z","projectId","flowId","z","server","z","flowId","projectId","z","server","z","fetchPackageSchema","server","listFlows","getFlow","ResourceTemplate","server","flowId"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/tools/validate.ts","../src/schemas/output.ts","../src/tools/bundle.ts","../src/tools/simulate.ts","../src/tools/push.ts","../src/tools/examples.ts","../src/tools/package.ts","../src/registry.ts","../src/tools/flow-load.ts","../src/tools/api.ts","../src/schemas/api-output.ts","../src/resources/package-schemas.ts","../src/resources/references.ts","../src/prompts/add-step.ts","../src/prompts/setup-mapping.ts","../src/prompts/manage-contract.ts","../src/prompts/use-definitions.ts"],"sourcesContent":["import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\n\nimport { registerFlowValidateTool } from './tools/validate.js';\nimport { registerFlowBundleTool } from './tools/bundle.js';\nimport { registerFlowSimulateTool } from './tools/simulate.js';\nimport { registerFlowPushTool } from './tools/push.js';\nimport { registerFlowExamplesTool } from './tools/examples.js';\nimport {\n registerPackageSearchTool,\n registerGetPackageSchemaTool,\n} from './tools/package.js';\nimport { registerFlowLoadTool } from './tools/flow-load.js';\nimport { registerApiTool } from './tools/api.js';\nimport { registerPackageSchemaResources } from './resources/package-schemas.js';\nimport { registerReferenceResources } from './resources/references.js';\nimport { registerAddStepPrompt } from './prompts/add-step.js';\nimport { registerSetupMappingPrompt } from './prompts/setup-mapping.js';\nimport { registerManageContractPrompt } from './prompts/manage-contract.js';\nimport { registerUseDefinitionsPrompt } from './prompts/use-definitions.js';\n\ndeclare const __VERSION__: string;\n\nconst server = new McpServer(\n {\n name: 'walkeros-flow',\n version: __VERSION__,\n },\n {\n instructions: `walkerOS is an open-source, privacy-first event data collection platform. Define event pipelines as code using JSON flow configurations.\n\n## Architecture: Source → Collector → Destination(s)\n\nEvery component in a flow is a **step**: sources capture events, transformers process them, destinations deliver them, stores provide shared state. Steps connect via \\`next\\` (pre-collector) and \\`before\\` (post-collector) chains.\n\n## Flow Config Structure\n\nEvery flow config follows this shape:\n\n\\`\\`\\`json\n{\n \"version\": 3,\n \"flows\": {\n \"default\": {\n \"web\": {},\n \"sources\": { \"<name>\": { \"package\": \"<npm-package>\", \"config\": {} } },\n \"destinations\": { \"<name>\": { \"package\": \"<npm-package>\", \"config\": { \"settings\": {} } } }\n }\n }\n}\n\\`\\`\\`\n\nEvent format: \\`{ name: \"entity action\", data: {...}, entity: \"...\", action: \"...\" }\\`. Sources convert raw input into this format.\n\nKey rules:\n- \\`version: 3\\` is required\n- Each flow must have exactly one of \\`web: {}\\` or \\`server: {}\\`\n- Destination settings go inside \\`config.settings\\`, not directly on the destination\n- Read \\`walkeros://reference/flow-schema\\` for the full annotated structure\n\n## Getting Started\n\n1. \\`flow_load({ platform: \"web\" })\\` or \\`flow_load({ source: \"./flow.json\" })\\` — create or load a flow\n2. \\`package_search({ type: \"destination\", platform: \"web\" })\\` — discover available packages\n3. Use the \\`add-step\\` prompt to add sources, destinations, transformers, or stores\n4. Use the \\`setup-mapping\\` prompt to configure event transformations\n5. \\`flow_validate({ type: \"flow\", input: \"flow.json\" })\\` — verify configuration\n6. \\`flow_simulate({ configPath: \"flow.json\", event: \"...\" })\\` — test with mocked API calls\n7. \\`flow_bundle({ configPath: \"flow.json\" })\\` — build deployable JavaScript\n8. \\`api({ action: \"deploy\", id: \"cfg_...\" })\\` — deploy to walkerOS cloud (requires WALKEROS_TOKEN env var; unavailable without it)\n\nIf validation fails, fix the reported errors and re-validate. Do not skip validation.\n\n## Reference Resources\n\nRead these before constructing configs manually: \\`walkeros://reference/flow-schema\\`, \\`walkeros://reference/mapping\\`, \\`walkeros://reference/event-model\\`, \\`walkeros://reference/consent\\`, \\`walkeros://reference/variables\\`, \\`walkeros://reference/contract\\`, \\`walkeros://reference/examples\\`.\n\n## Key Concepts\n\n- **Steps** are sources, destinations, transformers, or stores — each backed by an npm package. Use \\`package_search\\` to browse, \\`package_get\\` for schemas and examples.\n- **Mapping** transforms events using data/map/loop/set/condition rules. Same syntax on sources and destinations. Mapping rules use NESTED entity → action keying: event name \"product add\" maps to \\`{ \"product\": { \"add\": Rule } }\\`. Wildcards: \\`{ \"*\": { \"view\": Rule } }\\`.\n- **Contracts** define event schemas using entity-action keying. Can generate FROM mappings or scaffold mappings FROM contracts.\n- **Variables** (\\$var, \\$env, \\$def, \\$code, \\$store) enable DRY, environment-aware config. Use the \\`use-definitions\\` prompt to extract shared patterns.\n- **Consent** gates destinations, mapping rules, and individual fields. Privacy-first by design.`,\n },\n);\n\nregisterFlowValidateTool(server);\nregisterFlowBundleTool(server);\nregisterFlowSimulateTool(server);\nregisterFlowPushTool(server);\nregisterFlowExamplesTool(server);\nregisterPackageSearchTool(server);\nregisterGetPackageSchemaTool(server);\nregisterFlowLoadTool(server);\nregisterPackageSchemaResources(server);\nregisterReferenceResources(server);\nregisterAddStepPrompt(server);\nregisterSetupMappingPrompt(server);\nregisterManageContractPrompt(server);\nregisterUseDefinitionsPrompt(server);\n\nif (process.env.WALKEROS_TOKEN) {\n registerApiTool(server);\n}\n\nasync function main() {\n const transport = new StdioServerTransport();\n await server.connect(transport);\n console.error('walkerOS Flow MCP server running on stdio');\n}\n\nmain().catch((error) => {\n console.error('Failed to start Flow MCP server:', error);\n process.exit(1);\n});\n","import { validate } from '@walkeros/cli';\nimport type { ValidateResult } from '@walkeros/cli';\nimport { schemas } from '@walkeros/cli/dev';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { mcpResult, mcpError } from '@walkeros/core';\nimport { ValidateOutputShape } from '../schemas/output.js';\n\nexport function registerFlowValidateTool(server: McpServer) {\n server.registerTool(\n 'flow_validate',\n {\n title: 'Validate Flow',\n description:\n 'Validate walkerOS events, flow configurations, mapping rules, or data contracts. ' +\n 'Accepts JSON strings, file paths, or URLs as input. ' +\n 'Returns validation results with errors, warnings, and details.',\n inputSchema: schemas.ValidateInputShape,\n outputSchema: ValidateOutputShape,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: false,\n },\n },\n async ({ type, input, flow, path }) => {\n try {\n const result: ValidateResult = await validate(type, input, {\n flow,\n path,\n });\n const summary = result.valid\n ? 'Valid'\n : `Invalid: ${result.errors.length} errors, ${result.warnings.length} warnings`;\n const hints = result.valid\n ? {\n next: [\n 'Use flow_simulate to test event flow',\n 'Use flow_bundle to build',\n ],\n }\n : {\n next: [\n 'Fix errors above, then run flow_validate again',\n 'Read walkeros://reference/flow-schema for correct structure',\n ],\n };\n return mcpResult(result, summary, hints);\n } catch (error) {\n return mcpError(\n error,\n 'Check the input parameter — expected a JSON string, file path, or URL',\n );\n }\n },\n );\n}\n","import { z } from 'zod';\n\n// CLI tool output shapes\nexport const ValidateOutputShape = {\n valid: z.boolean().describe('Whether validation passed'),\n type: z\n .union([\n z.enum(['contract', 'event', 'flow', 'mapping']),\n z.string().regex(/^(destinations|sources|transformers)\\.\\w+$/),\n ])\n .describe('What was validated'),\n errors: z\n .array(\n z.object({\n path: z.string(),\n message: z.string(),\n value: z.unknown().optional(),\n code: z.string().optional(),\n }),\n )\n .describe('Validation errors'),\n warnings: z\n .array(\n z.object({\n path: z.string(),\n message: z.string(),\n suggestion: z.string().optional(),\n }),\n )\n .describe('Validation warnings'),\n details: z\n .record(z.string(), z.unknown())\n .describe('Additional validation details'),\n};\n\nexport const BundleOutputShape = {\n success: z.boolean().describe('Whether bundling succeeded'),\n totalSize: z.number().optional().describe('Total bundle size in bytes'),\n buildTime: z.number().optional().describe('Build time in milliseconds'),\n packages: z\n .array(\n z.object({\n name: z.string(),\n size: z.number(),\n }),\n )\n .optional()\n .describe('Per-package size breakdown'),\n treeshakingEffective: z\n .boolean()\n .optional()\n .describe('Whether tree-shaking was effective'),\n message: z.string().optional().describe('Status message'),\n};\n\nexport const SimulateOutputShape = {\n success: z.boolean().describe('Whether simulation succeeded'),\n error: z.string().optional().describe('Error message if failed'),\n summary: z.string().describe('One-line result summary'),\n destinations: z\n .record(\n z.string(),\n z.object({\n received: z\n .boolean()\n .describe('Whether destination received the event'),\n calls: z.number().describe('Number of API calls made'),\n payload: z.unknown().optional().describe('Transformed payload sent'),\n }),\n )\n .optional()\n .describe('Per-destination results'),\n exampleMatch: z\n .object({\n name: z.string(),\n step: z.string(),\n match: z.boolean(),\n diff: z.string().optional(),\n })\n .optional()\n .describe('Example comparison result when using example parameter'),\n duration: z.number().optional().describe('Simulation duration in ms'),\n};\n\nexport const PushOutputShape = {\n success: z.boolean().describe('Whether push succeeded'),\n elbResult: z.unknown().optional().describe('Push result from the collector'),\n duration: z.number().describe('Push duration in milliseconds'),\n error: z.string().optional().describe('Error message if push failed'),\n};\n\n// Examples List output shape\nexport const ExamplesListOutputShape = {\n flow: z.string().describe('Flow name'),\n count: z.number().describe('Number of examples found'),\n examples: z\n .array(\n z.object({\n step: z.string().describe('Step location (e.g., \"destination.gtag\")'),\n stepType: z\n .enum(['source', 'transformer', 'destination'])\n .describe('Step type'),\n stepName: z.string().describe('Step name'),\n exampleName: z.string().describe('Example name'),\n hasIn: z.boolean().describe('Whether the example has an input value'),\n hasOut: z.boolean().describe('Whether the example has an output value'),\n hasMapping: z\n .boolean()\n .describe('Whether the example has a mapping configuration'),\n in: z.unknown().optional().describe('Input event data'),\n out: z.unknown().optional().describe('Expected output data'),\n mapping: z\n .unknown()\n .optional()\n .describe('Mapping configuration for destinations'),\n }),\n )\n .describe('Step examples'),\n};\n\n// Package Search output shape (lightweight metadata + content keys)\nexport const PackageSearchOutputShape = {\n package: z.string().describe('Package name'),\n version: z.string().describe('Package version'),\n description: z.string().optional().describe('Package description'),\n type: z\n .string()\n .optional()\n .describe('Package type (destination, source, transformer)'),\n platform: z.string().optional().describe('Target platform (web, server)'),\n hintKeys: z\n .array(z.string())\n .describe('Available hint keys (use package_get section=hints to read)'),\n exampleSummaries: z\n .array(\n z.object({\n name: z.string().describe('Example name'),\n description: z.string().optional().describe('What this example shows'),\n }),\n )\n .describe(\n 'Step example names and descriptions (use package_get section=examples to read full content)',\n ),\n};\n\n// Package Schema output shape (full details, supports progressive disclosure)\nexport const PackageSchemaOutputShape = {\n package: z.string().describe('Package name'),\n version: z.string().describe('Package version'),\n type: z.string().describe('Package type (destination, source, transformer)'),\n platform: z.string().describe('Target platform (web, server)'),\n schemas: z\n .record(z.string(), z.unknown())\n .optional()\n .describe('JSON Schemas for settings and mapping'),\n examples: z\n .record(z.string(), z.unknown())\n .optional()\n .describe(\n 'Full configuration examples (included when section=examples or section=all)',\n ),\n exampleSummaries: z\n .array(\n z.object({\n name: z.string().describe('Example name'),\n description: z.string().optional().describe('What this example shows'),\n }),\n )\n .optional()\n .describe(\n 'Example names and descriptions (included in default/summary mode)',\n ),\n hints: z\n .record(\n z.string(),\n z.object({\n text: z.string(),\n code: z\n .array(\n z.object({\n lang: z.string().optional(),\n code: z.string(),\n }),\n )\n .optional(),\n }),\n )\n .optional()\n .describe(\n 'Hints — text only in summary mode, with code blocks when section=hints or section=all',\n ),\n};\n","import { z } from 'zod';\nimport { bundle, bundleRemote } from '@walkeros/cli';\nimport { schemas } from '@walkeros/cli/dev';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { mcpResult, mcpError } from '@walkeros/core';\nimport { BundleOutputShape } from '../schemas/output.js';\n\nexport function registerFlowBundleTool(server: McpServer) {\n server.registerTool(\n 'flow_bundle',\n {\n title: 'Bundle Flow',\n description:\n 'Bundle a walkerOS flow configuration into deployable JavaScript. ' +\n 'Resolves all destinations, sources, and transformers, then outputs ' +\n 'a tree-shaken production bundle. Returns bundle statistics. ' +\n 'Set remote: true to use the walkerOS cloud service instead of local build tools.',\n inputSchema: {\n ...schemas.BundleInputShape,\n remote: z\n .boolean()\n .optional()\n .describe(\n 'Use remote cloud bundling (requires WALKEROS_TOKEN). Default: false (local)',\n ),\n content: z\n .record(z.string(), z.unknown())\n .optional()\n .describe('Flow.Config JSON content (required when remote: true)'),\n },\n outputSchema: BundleOutputShape,\n annotations: {\n readOnlyHint: false,\n destructiveHint: false,\n idempotentHint: false,\n openWorldHint: true,\n },\n },\n async ({ configPath, flow, stats, output, remote, content }) => {\n try {\n if (remote) {\n if (!content)\n throw new Error('content is required when remote: true');\n const result = await bundleRemote({\n content: content as Record<string, unknown>,\n flowName: flow,\n });\n const r = result as Record<string, unknown>;\n const size = r.totalSize ?? r.size;\n const time = r.buildTime;\n const summary = `Bundled${size ? ` (${formatBytes(size as number)}` : ''}${time ? `, ${time}ms)` : size ? ')' : ''}`;\n return mcpResult({ success: true, ...result }, summary, {\n next: [\n 'Use flow_simulate to test',\n \"Use api({ action: 'deploy' }) to publish\",\n ],\n });\n }\n\n const result = await bundle(configPath, {\n flowName: flow,\n stats: stats ?? true,\n buildOverrides: output ? { output } : undefined,\n });\n\n if (!result) {\n return mcpResult(\n { success: false, message: 'Bundle produced no output' },\n 'Bundle produced no output',\n {\n warnings: [\n 'The build returned no result. The flow may be empty or misconfigured.',\n ],\n next: ['Run flow_validate to check your configuration'],\n },\n );\n }\n\n const output_ = result as unknown as Record<string, unknown>;\n\n const size = output_.totalSize as number | undefined;\n const time = output_.buildTime as number | undefined;\n const summary = `Bundled${size ? ` (${formatBytes(size)}` : ''}${time ? `, ${time}ms)` : size ? ')' : ''}`;\n\n return mcpResult({ success: true, ...output_ }, summary, {\n next: [\n 'Use flow_simulate to test',\n \"Use api({ action: 'deploy' }) to publish\",\n ],\n });\n } catch (error) {\n return mcpError(error, 'Run flow_validate for detailed error messages');\n }\n },\n );\n}\n\nfunction formatBytes(bytes: number): string {\n if (bytes < 1024) return `${bytes} B`;\n return `${(bytes / 1024).toFixed(1)} KB`;\n}\n","import { simulate } from '@walkeros/cli';\nimport type { SimulationResult } from '@walkeros/cli';\nimport { schemas } from '@walkeros/cli/dev';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { mcpResult, mcpError } from '@walkeros/core';\nimport { SimulateOutputShape } from '../schemas/output.js';\n\ninterface DestinationSummary {\n received: boolean;\n calls: number;\n payload?: unknown;\n}\n\nexport function registerFlowSimulateTool(server: McpServer) {\n server.registerTool(\n 'flow_simulate',\n {\n title: 'Simulate Flow',\n description:\n 'Simulate events through a walkerOS flow without making real API calls. ' +\n 'Events must be in walkerOS format (post-source): { name: \"entity action\", data: {...} }. ' +\n 'Raw source input (dataLayer pushes, HTTP requests) must first be converted to walkerOS events. ' +\n 'Check source package examples to see what events a source outputs. ' +\n 'Use the example parameter to load event input from a step example and compare output.',\n inputSchema: schemas.SimulateInputShape,\n outputSchema: SimulateOutputShape,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: false,\n },\n },\n async ({ configPath, event, flow, platform, example, step }) => {\n try {\n if (!event && !example) {\n throw new Error('Either event or example must be provided');\n }\n\n const raw: SimulationResult = await simulate(configPath, event, {\n json: true,\n flow,\n platform,\n example,\n step,\n });\n\n // Summarize per-destination\n const destinations: Record<string, DestinationSummary> = {};\n\n if (raw.usage) {\n for (const [name, calls] of Object.entries(raw.usage)) {\n destinations[name] = {\n received: calls.length > 0,\n calls: calls.length,\n payload: calls.length > 0 ? calls[calls.length - 1] : undefined,\n };\n }\n }\n\n const destCount = Object.keys(destinations).length;\n const receivedCount = Object.values(destinations).filter(\n (d) => d.received,\n ).length;\n\n const warnings: string[] = [];\n if (destCount === 0) {\n warnings.push(\n 'No destinations found in flow configuration. Check that your flow defines at least one destination.',\n );\n }\n if (destCount > 0 && receivedCount === 0) {\n warnings.push(\n 'No destinations received the event. Most common cause: mapping keys must be NESTED entity → action objects — event \"product add\" needs { \"product\": { \"add\": Rule } }, not \"product.add\". Also check event name match and consent settings.',\n );\n }\n\n const summary = `${receivedCount}/${destCount} destinations received the event`;\n\n const result = {\n success: raw.success,\n error: raw.error,\n summary,\n destinations: destCount > 0 ? destinations : undefined,\n exampleMatch: raw.exampleMatch,\n duration: raw.duration,\n };\n\n return mcpResult(result, summary, {\n next: ['Use flow_bundle to build for production'],\n ...(warnings.length > 0 ? { warnings } : {}),\n });\n } catch (error) {\n return mcpError(error, 'Run flow_validate for detailed error messages');\n }\n },\n );\n}\n","import { push } from '@walkeros/cli';\nimport type { PushResult } from '@walkeros/cli';\nimport { schemas } from '@walkeros/cli/dev';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { mcpResult, mcpError } from '@walkeros/core';\nimport { PushOutputShape } from '../schemas/output.js';\n\nexport function registerFlowPushTool(server: McpServer) {\n server.registerTool(\n 'flow_push',\n {\n title: 'Push Events',\n description:\n 'Push a real event through a walkerOS flow to actual destinations. ' +\n 'WARNING: This makes real API calls to real endpoints. ' +\n 'Note: Web destinations (gtag, meta, etc.) require browser globals that are not available in Node.js. ' +\n 'For web flows, use flow_simulate to test. flow_push works best for server-side flows.',\n inputSchema: schemas.PushInputShape,\n outputSchema: PushOutputShape,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n idempotentHint: false,\n openWorldHint: true,\n },\n },\n async ({ configPath, event, flow, platform }) => {\n try {\n const result: PushResult = await push(configPath, event, {\n json: true,\n flow,\n platform,\n });\n\n if (!result.success) {\n return mcpError(\n new Error(result.error || 'Push failed'),\n 'Check destination configuration and network connectivity. For web destinations, use flow_simulate instead.',\n );\n }\n\n const summary = `Pushed event${result.duration ? ` (${result.duration}ms)` : ''}`;\n\n return mcpResult(result, summary);\n } catch (error) {\n return mcpError(\n error,\n 'Check configPath and event format. For web destinations, use flow_simulate instead.',\n );\n }\n },\n );\n}\n","import { z } from 'zod';\nimport { loadJsonConfig } from '@walkeros/cli';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { mcpResult, mcpError } from '@walkeros/core';\nimport type { Flow } from '@walkeros/core';\nimport { ExamplesListOutputShape } from '../schemas/output.js';\n\nexport function registerFlowExamplesTool(server: McpServer) {\n server.registerTool(\n 'flow_examples',\n {\n title: 'Flow Examples',\n description:\n 'List all step examples in a walkerOS flow configuration. ' +\n 'Shows example names, step locations, and in/out shapes. ' +\n 'Use this to discover available test fixtures and simulation data.',\n inputSchema: {\n configPath: z\n .string()\n .min(1)\n .describe('Path to flow configuration file'),\n flow: z\n .string()\n .optional()\n .describe('Flow name for multi-flow configs'),\n step: z\n .string()\n .optional()\n .describe('Filter to a specific step (e.g., \"destination.gtag\")'),\n full: z\n .boolean()\n .optional()\n .describe(\n 'Return full in/out/mapping data for each example (default: false, returns metadata only)',\n ),\n },\n outputSchema: ExamplesListOutputShape,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: false,\n },\n },\n async ({ configPath, flow, step, full }) => {\n try {\n const rawConfig = await loadJsonConfig<Flow.Config>(configPath);\n\n // Resolve flow name\n const flowNames = Object.keys(rawConfig.flows || {});\n const flowName =\n flow || (flowNames.length === 1 ? flowNames[0] : undefined);\n\n if (!flowName) {\n throw new Error(\n `Multiple flows found. Specify flow parameter. Available: ${flowNames.join(', ')}`,\n );\n }\n\n const flowSettings = rawConfig.flows[flowName];\n if (!flowSettings) {\n throw new Error(`Flow \"${flowName}\" not found`);\n }\n\n // Collect all examples\n const examples: Array<{\n step: string;\n stepType: string;\n stepName: string;\n exampleName: string;\n hasIn: boolean;\n hasOut: boolean;\n hasMapping: boolean;\n in?: unknown;\n out?: unknown;\n mapping?: unknown;\n }> = [];\n\n const stepTypes = [\n { key: 'sources' as const, type: 'source' },\n { key: 'transformers' as const, type: 'transformer' },\n { key: 'destinations' as const, type: 'destination' },\n ];\n\n for (const { key, type } of stepTypes) {\n const refs = flowSettings[key] || {};\n for (const [name, ref] of Object.entries(refs)) {\n if (!ref.examples) continue;\n\n // Apply step filter\n if (step && `${type}.${name}` !== step) continue;\n\n for (const [exName, ex] of Object.entries(\n ref.examples as Flow.StepExamples,\n )) {\n examples.push({\n step: `${type}.${name}`,\n stepType: type,\n stepName: name,\n exampleName: exName,\n hasIn: ex.in !== undefined,\n hasOut: ex.out !== undefined,\n hasMapping: ex.mapping !== undefined,\n ...(full\n ? { in: ex.in, out: ex.out, mapping: ex.mapping }\n : {}),\n });\n }\n }\n }\n\n // Count unique steps\n const stepSet = new Set(examples.map((e) => e.step));\n\n const result = {\n flow: flowName,\n count: examples.length,\n examples,\n };\n\n const totalExamples = examples.length;\n const summary = `${totalExamples} examples across ${stepSet.size} steps`;\n const hints: { next: string[]; warnings?: string[] } = {\n next: ['Use flow_simulate with example parameter to test'],\n };\n if (totalExamples === 0) {\n hints.warnings = [\n 'No examples found. Add examples to step definitions in your flow config for testing.',\n ];\n }\n return mcpResult(result, summary, hints);\n } catch (error) {\n return mcpError(error, 'Check configPath — expected a flow.json file');\n }\n },\n );\n}\n","import { z } from 'zod';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { fetchPackage, mcpResult, mcpError } from '@walkeros/core';\nimport { PackageSchemaOutputShape } from '../schemas/output.js';\nimport { filterRegistry } from '../registry.js';\n\nexport function registerPackageSearchTool(server: McpServer) {\n server.registerTool(\n 'package_search',\n {\n title: 'Search Package',\n description:\n 'Browse walkerOS packages or look up a specific one. Without package name: returns catalog ' +\n 'filtered by type/platform. With package name: returns metadata, hint keys, and example summaries.',\n inputSchema: {\n package: z\n .string()\n .min(1)\n .optional()\n .describe(\n 'Exact npm package name for detailed lookup (e.g., @walkeros/web-destination-snowplow)',\n ),\n type: z\n .enum(['source', 'destination', 'transformer', 'store'])\n .optional()\n .describe('Filter by package type (browse mode)'),\n platform: z\n .enum(['web', 'server'])\n .optional()\n .describe(\n 'Filter by platform (browse mode, includes universal packages)',\n ),\n version: z\n .string()\n .optional()\n .describe('Package version for detailed lookup (default: latest)'),\n },\n // No outputSchema: browse mode returns {catalog, count}, lookup returns metadata — incompatible shapes\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: false,\n },\n },\n async ({ package: packageName, type, platform, version }) => {\n // Browse mode: no package specified → return catalog\n if (!packageName) {\n const catalog = filterRegistry({ type, platform });\n const result = { catalog, count: catalog.length };\n const summary = `${catalog.length} packages found`;\n return mcpResult(result, summary, {\n next: ['Use package_get for schemas and examples'],\n });\n }\n\n // Lookup mode: fetch specific package details\n try {\n const info = await fetchPackage(packageName, { version });\n\n const result = {\n package: info.packageName,\n version: info.version,\n description: info.description,\n type: info.type,\n platform: info.platform,\n hintKeys: info.hintKeys,\n exampleSummaries: info.exampleSummaries,\n };\n\n const summary = `${info.packageName} v${info.version}`;\n return mcpResult(result, summary, {\n next: ['Use package_get for schemas and examples'],\n });\n } catch (error) {\n return mcpError(\n error,\n 'Package not found. Use package_search without parameters to browse available packages.',\n );\n }\n },\n );\n}\n\nexport function registerGetPackageSchemaTool(server: McpServer) {\n server.registerTool(\n 'package_get',\n {\n title: 'Get Package',\n description:\n 'Fetch walkerOS package details from npm. By default returns schemas + hint texts + example summaries (lightweight). ' +\n 'Use section parameter to get full content: \"hints\" (with code blocks), \"examples\" (full in/out data), ' +\n 'or \"all\" (everything). Use package_search first to browse available packages.',\n inputSchema: {\n package: z\n .string()\n .min(1)\n .describe(\n 'Exact npm package name (e.g., @walkeros/web-destination-snowplow)',\n ),\n version: z\n .string()\n .optional()\n .describe('Package version (default: latest)'),\n section: z\n .enum(['hints', 'examples', 'all'])\n .optional()\n .describe(\n 'Section to expand with full content. Default: summary view with schemas + hint texts + example descriptions',\n ),\n },\n outputSchema: PackageSchemaOutputShape,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: true,\n },\n },\n async ({ package: packageName, version, section }) => {\n try {\n const info = await fetchPackage(packageName, { version });\n\n const result: Record<string, unknown> = {\n package: info.packageName,\n version: info.version,\n type: info.type,\n platform: info.platform,\n schemas: info.schemas,\n };\n\n // Hints\n if (info.hints) {\n if (section === 'hints' || section === 'all') {\n result.hints = info.hints;\n } else {\n const hintSummary: Record<string, { text: string }> = {};\n for (const [key, hint] of Object.entries(info.hints)) {\n const h = hint as { text: string };\n hintSummary[key] = { text: h.text };\n }\n result.hints = hintSummary;\n }\n }\n\n // Examples\n if (section === 'examples' || section === 'all') {\n result.examples = info.examples;\n } else {\n result.exampleSummaries = info.exampleSummaries;\n }\n\n const schemaCount = Object.keys(info.schemas).length;\n const exampleCount = info.exampleSummaries.length;\n const summary = `${info.packageName} — ${schemaCount} schemas, ${exampleCount} examples`;\n\n return mcpResult(result, summary);\n } catch (error) {\n return mcpError(\n error,\n 'Use package_search to browse available package names.',\n );\n }\n },\n );\n}\n","export interface PackageRegistryEntry {\n name: string;\n type: 'source' | 'destination' | 'transformer' | 'store';\n platform: 'web' | 'server' | 'universal';\n description: string;\n}\n\nexport const PACKAGE_REGISTRY: PackageRegistryEntry[] = [\n // Web Destinations\n {\n name: '@walkeros/web-destination-gtag',\n type: 'destination',\n platform: 'web',\n description: 'Google destination (GA4, Ads, GTM via gtag.js)',\n },\n {\n name: '@walkeros/web-destination-meta',\n type: 'destination',\n platform: 'web',\n description: 'Meta (Facebook) Pixel',\n },\n {\n name: '@walkeros/web-destination-plausible',\n type: 'destination',\n platform: 'web',\n description: 'Plausible Analytics',\n },\n {\n name: '@walkeros/web-destination-snowplow',\n type: 'destination',\n platform: 'web',\n description: 'Snowplow Analytics',\n },\n {\n name: '@walkeros/web-destination-piwikpro',\n type: 'destination',\n platform: 'web',\n description: 'Piwik PRO Analytics',\n },\n {\n name: '@walkeros/web-destination-api',\n type: 'destination',\n platform: 'web',\n description: 'Generic HTTP API destination',\n },\n\n // Server Destinations\n {\n name: '@walkeros/server-destination-gcp',\n type: 'destination',\n platform: 'server',\n description: 'Google Cloud Platform (BigQuery)',\n },\n {\n name: '@walkeros/server-destination-aws',\n type: 'destination',\n platform: 'server',\n description: 'AWS (Firehose)',\n },\n {\n name: '@walkeros/server-destination-meta',\n type: 'destination',\n platform: 'server',\n description: 'Meta Conversions API (server-side)',\n },\n {\n name: '@walkeros/server-destination-api',\n type: 'destination',\n platform: 'server',\n description: 'Generic HTTP API destination (server)',\n },\n {\n name: '@walkeros/server-destination-datamanager',\n type: 'destination',\n platform: 'server',\n description: 'Google Data Manager',\n },\n\n // Web Sources\n {\n name: '@walkeros/web-source-browser',\n type: 'source',\n platform: 'web',\n description: 'Browser DOM event capture (clicks, page views, forms)',\n },\n {\n name: '@walkeros/web-source-datalayer',\n type: 'source',\n platform: 'web',\n description: 'Google Tag Manager dataLayer bridge',\n },\n {\n name: '@walkeros/web-source-session',\n type: 'source',\n platform: 'web',\n description: 'Session tracking source',\n },\n\n // CMP Sources\n {\n name: '@walkeros/web-source-cmp-cookiefirst',\n type: 'source',\n platform: 'web',\n description: 'CookieFirst consent management',\n },\n {\n name: '@walkeros/web-source-cmp-cookiepro',\n type: 'source',\n platform: 'web',\n description: 'CookiePro/OneTrust consent management',\n },\n {\n name: '@walkeros/web-source-cmp-usercentrics',\n type: 'source',\n platform: 'web',\n description: 'Usercentrics consent management',\n },\n\n // Server Sources\n {\n name: '@walkeros/server-source-express',\n type: 'source',\n platform: 'server',\n description: 'Express.js HTTP event endpoint',\n },\n {\n name: '@walkeros/server-source-fetch',\n type: 'source',\n platform: 'server',\n description: 'Web Fetch API source (Cloudflare, Vercel Edge, Deno, Bun)',\n },\n {\n name: '@walkeros/server-source-aws',\n type: 'source',\n platform: 'server',\n description: 'AWS sources (Lambda, API Gateway, Function URLs)',\n },\n {\n name: '@walkeros/server-source-gcp',\n type: 'source',\n platform: 'server',\n description: 'GCP sources (Cloud Functions)',\n },\n\n // Transformers\n {\n name: '@walkeros/transformer-router',\n type: 'transformer',\n platform: 'universal',\n description: 'Route events to different destination subsets',\n },\n {\n name: '@walkeros/transformer-validator',\n type: 'transformer',\n platform: 'universal',\n description: 'Event validation using JSON Schema',\n },\n {\n name: '@walkeros/server-transformer-fingerprint',\n type: 'transformer',\n platform: 'server',\n description: 'Device fingerprinting for anonymous user identification',\n },\n {\n name: '@walkeros/server-transformer-cache',\n type: 'transformer',\n platform: 'server',\n description: 'HTTP response caching with LRU eviction',\n },\n {\n name: '@walkeros/server-transformer-file',\n type: 'transformer',\n platform: 'server',\n description: 'File serving transformer for static files',\n },\n\n // Stores\n {\n name: '@walkeros/store-memory',\n type: 'store',\n platform: 'universal',\n description: 'In-memory key-value store with LRU eviction and TTL',\n },\n {\n name: '@walkeros/server-store-fs',\n type: 'store',\n platform: 'server',\n description: 'File system key-value store',\n },\n {\n name: '@walkeros/server-store-s3',\n type: 'store',\n platform: 'server',\n description: 'AWS S3 key-value store',\n },\n {\n name: '@walkeros/server-store-gcs',\n type: 'store',\n platform: 'server',\n description: 'Google Cloud Storage key-value store',\n },\n];\n\nexport function filterRegistry(filters?: {\n type?: string;\n platform?: string;\n}): PackageRegistryEntry[] {\n let results = PACKAGE_REGISTRY;\n if (filters?.type) {\n results = results.filter((p) => p.type === filters.type);\n }\n if (filters?.platform) {\n results = results.filter(\n (p) => p.platform === filters.platform || p.platform === 'universal',\n );\n }\n return results;\n}\n","import { z } from 'zod';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { loadJsonConfig } from '@walkeros/cli';\nimport { mcpResult, mcpError } from '@walkeros/core';\n\nconst WEB_SKELETON = {\n version: 3,\n flows: {\n default: {\n web: {},\n packages: {},\n sources: {},\n destinations: {},\n },\n },\n};\n\nconst SERVER_SKELETON = {\n version: 3,\n flows: {\n default: {\n server: {},\n packages: {},\n sources: {},\n destinations: {},\n },\n },\n};\n\nexport function registerFlowLoadTool(server: McpServer) {\n server.registerTool(\n 'flow_load',\n {\n title: 'Load or Create Flow',\n description:\n 'Load an existing flow configuration from a local file path, URL, or walkerOS API (by flow ID). ' +\n 'Or create a new empty flow by specifying a platform (web or server). ' +\n 'Use the add-step prompt to add sources, destinations, transformers, or stores to the flow.',\n inputSchema: {\n source: z\n .string()\n .optional()\n .describe(\n 'Flow source: local file path (./flow.json), URL (https://...), ' +\n 'or API flow ID (cfg_...). Omit to create a new flow.',\n ),\n platform: z\n .enum(['web', 'server'])\n .optional()\n .describe(\n 'Platform for new flows. Required when source is omitted. ' +\n 'web = browser tracking, server = Node.js HTTP.',\n ),\n },\n outputSchema: {\n version: z.number().describe('Flow config version'),\n flows: z.record(z.string(), z.unknown()).describe('Flow definitions'),\n },\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: true,\n },\n },\n async ({ source, platform }) => {\n try {\n if (source) {\n const config = await loadJsonConfig(source);\n return mcpResult(\n config,\n `Loaded flow from ${source}. Use flow_validate to check, or add-step prompt to modify.`,\n {\n next: [\n 'Use flow_validate to check',\n 'Use add-step prompt to modify',\n ],\n },\n );\n }\n\n if (!platform) {\n return mcpError(\n new Error(\n 'Provide source (file path, URL, or flow ID) to load existing flow, ' +\n 'or platform (web/server) to create a new one.',\n ),\n );\n }\n\n const skeleton = platform === 'web' ? WEB_SKELETON : SERVER_SKELETON;\n return mcpResult(\n skeleton,\n `Created empty ${platform} flow. Use the add-step prompt to add sources, destinations, and transformers.`,\n {\n next: [\n 'Read walkeros://reference/flow-schema for config structure',\n 'Use add-step prompt to add sources and destinations',\n ],\n },\n );\n } catch (error) {\n const msg = error instanceof Error ? error.message : '';\n if (msg.includes('not found') || msg.includes('ENOENT'))\n return mcpError(\n error,\n 'Check configPath — expected a flow.json file',\n );\n return mcpError(error);\n }\n },\n );\n}\n","import { z } from 'zod';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport type { ServerNotification } from '@modelcontextprotocol/sdk/types.js';\nimport {\n whoami,\n listProjects,\n getProject,\n createProject,\n updateProject,\n deleteProject,\n listFlows,\n getFlow,\n createFlow,\n updateFlow,\n deleteFlow,\n duplicateFlow,\n deploy,\n getDeployment,\n listDeployments,\n getDeploymentBySlug,\n createDeployment as createDep,\n deleteDeployment as deleteDep,\n} from '@walkeros/cli';\nimport { mcpResult, mcpError } from '@walkeros/core';\nimport { ApiOutputShape } from '../schemas/api-output.js';\n\nconst ACTIONS = [\n 'whoami',\n 'project.list',\n 'project.get',\n 'project.create',\n 'project.update',\n 'project.delete',\n 'flow.list',\n 'flow.get',\n 'flow.create',\n 'flow.update',\n 'flow.delete',\n 'flow.duplicate',\n 'deploy',\n 'deployment.get',\n 'deployment.list',\n 'deployment.create',\n 'deployment.delete',\n] as const;\n\nexport function registerApiTool(server: McpServer) {\n server.registerTool(\n 'api',\n {\n title: 'walkerOS Cloud API',\n description:\n 'Manage walkerOS cloud projects, flows, and deployments. Requires WALKEROS_TOKEN env var.\\n\\n' +\n 'Actions:\\n' +\n '- whoami — verify token, get user info\\n' +\n '- project.list/get/create/update/delete — manage projects\\n' +\n '- flow.list/get/create/update/delete/duplicate — manage flow configs\\n' +\n '- deploy — deploy a flow (auto-detects web/server)\\n' +\n '- deployment.get/list/create/delete — manage deployments\\n\\n' +\n 'Parameters vary by action. id = flowId/projectId/slug depending on context. ' +\n 'content = Flow.Config JSON for flow.create/update.',\n inputSchema: {\n action: z.enum(ACTIONS).describe('API action to perform'),\n id: z\n .string()\n .optional()\n .describe('Resource ID (flowId, projectId, or deployment slug)'),\n name: z\n .string()\n .optional()\n .describe('Name for create/update operations'),\n content: z\n .record(z.string(), z.unknown())\n .optional()\n .describe('Flow.Config JSON for flow operations'),\n patch: z\n .boolean()\n .optional()\n .describe('Use merge-patch for flow.update (default: true)'),\n wait: z\n .boolean()\n .optional()\n .describe('Wait for deploy to complete (default: true)'),\n flowName: z\n .string()\n .optional()\n .describe('Flow name for multi-settings flows'),\n fields: z\n .array(z.string())\n .optional()\n .describe('Dot-path field selectors for flow.get'),\n type: z\n .enum(['web', 'server'])\n .optional()\n .describe('Deployment type for deployment.create'),\n sort: z.string().optional().describe('Sort field for list operations'),\n order: z.enum(['asc', 'desc']).optional().describe('Sort order'),\n status: z\n .string()\n .optional()\n .describe('Status filter for deployment.list'),\n includeDeleted: z\n .boolean()\n .optional()\n .describe('Include deleted items in lists'),\n },\n outputSchema: ApiOutputShape,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n idempotentHint: false,\n openWorldHint: true,\n },\n },\n async (params, extra) => {\n const {\n action,\n id,\n name,\n content,\n patch,\n wait,\n flowName,\n fields,\n type,\n sort,\n order,\n status,\n includeDeleted,\n } = params;\n\n try {\n let data: unknown;\n let summary: string;\n\n switch (action) {\n // Auth\n case 'whoami': {\n data = await whoami();\n summary = `Authenticated as ${(data as Record<string, unknown>).email}`;\n break;\n }\n\n // Projects\n case 'project.list': {\n data = await listProjects();\n summary = `${(((data as Record<string, unknown>).projects as unknown[]) ?? []).length} projects`;\n break;\n }\n case 'project.get': {\n data = await getProject({ projectId: id });\n summary = `Project \"${(data as Record<string, unknown>).name}\"`;\n break;\n }\n case 'project.create': {\n if (!name) throw new Error('name required for project.create');\n data = await createProject({ name });\n summary = `Created project \"${name}\"`;\n break;\n }\n case 'project.update': {\n if (!name) throw new Error('name required for project.update');\n data = await updateProject({ projectId: id, name });\n summary = `Updated project \"${name}\"`;\n break;\n }\n case 'project.delete': {\n data = await deleteProject({ projectId: id });\n summary = `Deleted project ${id ?? 'default'}`;\n break;\n }\n\n // Flows\n case 'flow.list': {\n data = await listFlows({\n projectId: id,\n sort: sort as 'name' | 'updated_at' | 'created_at' | undefined,\n order: order as 'asc' | 'desc' | undefined,\n includeDeleted,\n });\n summary = `${(((data as Record<string, unknown>).flows as unknown[]) ?? []).length} flows`;\n break;\n }\n case 'flow.get': {\n if (!id) throw new Error('id required for flow.get');\n data = await getFlow({ flowId: id, fields });\n summary = `Flow \"${(data as Record<string, unknown>).name}\" (${id})`;\n break;\n }\n case 'flow.create': {\n if (!name) throw new Error('name required for flow.create');\n if (!content) throw new Error('content required for flow.create');\n data = await createFlow({ name, content });\n summary = `Created flow \"${name}\" (${(data as Record<string, unknown>).id})`;\n break;\n }\n case 'flow.update': {\n if (!id) throw new Error('id required for flow.update');\n data = await updateFlow({\n flowId: id,\n name,\n content,\n mergePatch: patch ?? true,\n });\n summary = `Updated flow ${id}`;\n break;\n }\n case 'flow.delete': {\n if (!id) throw new Error('id required for flow.delete');\n data = await deleteFlow({ flowId: id });\n summary = `Deleted flow ${id}`;\n break;\n }\n case 'flow.duplicate': {\n if (!id) throw new Error('id required for flow.duplicate');\n data = await duplicateFlow({ flowId: id, name });\n summary = `Duplicated flow ${id}`;\n break;\n }\n\n // Deploy\n case 'deploy': {\n if (!id) throw new Error('id (flowId) required for deploy');\n const progressToken = extra._meta?.progressToken;\n data = await deploy({\n flowId: id,\n wait: wait ?? true,\n flowName,\n onStatus: (s: string, sub: string | null) => {\n if (!progressToken) return;\n const stages: Record<string, number> = {\n bundling: 15,\n deploying: 55,\n published: 100,\n active: 100,\n failed: 100,\n };\n extra.sendNotification({\n method: 'notifications/progress',\n params: {\n progressToken,\n progress: stages[s] ?? 0,\n total: 100,\n message: sub ? `${s}:${sub}` : s,\n },\n } as ServerNotification);\n },\n signal: extra.signal,\n });\n const st = (data as Record<string, unknown>).status;\n const deployData = data as Record<string, unknown>;\n if (st === 'failed') {\n const msg = `Deploy failed: ${deployData.errorMessage ?? 'unknown error'}`;\n return mcpResult({ action, ok: false, data }, msg, {\n next: ['Run flow_validate to check your configuration'],\n });\n } else {\n summary = `Deployed flow ${id} — status: ${st}`;\n const publicUrl = deployData.publicUrl as string | undefined;\n const containerUrl = deployData.containerUrl as\n | string\n | undefined;\n const deployType = deployData.type as string | undefined;\n const nextHints: string[] = [];\n if (deployType === 'web' && publicUrl) {\n nextHints.push(`Bundle at ${publicUrl}`);\n nextHints.push(`Add <script src='${publicUrl}'></script>`);\n } else if (deployType === 'server' && containerUrl) {\n nextHints.push(`Container at ${containerUrl}`);\n nextHints.push(`Test: curl ${containerUrl}/health`);\n }\n if (nextHints.length > 0) {\n return mcpResult({ action, ok: true, data }, summary, {\n next: nextHints,\n });\n }\n }\n break;\n }\n\n // Deployments\n case 'deployment.get': {\n if (!id)\n throw new Error(\n 'id (flowId or slug) required for deployment.get',\n );\n try {\n data = await getDeployment({ flowId: id, flowName });\n } catch {\n data = await getDeploymentBySlug({ slug: id });\n }\n summary = `Deployment ${(data as Record<string, unknown>).slug ?? id} — ${(data as Record<string, unknown>).status}`;\n break;\n }\n case 'deployment.list': {\n data = await listDeployments({\n projectId: id,\n type: type as 'web' | 'server' | undefined,\n status,\n });\n summary = `${(((data as Record<string, unknown>).deployments as unknown[]) ?? []).length} deployments`;\n break;\n }\n case 'deployment.create': {\n if (!type)\n throw new Error(\n 'type (web/server) required for deployment.create',\n );\n data = await createDep({ type, label: name, projectId: id });\n summary = `Created ${type} deployment ${(data as Record<string, unknown>).slug}`;\n break;\n }\n case 'deployment.delete': {\n if (!id)\n throw new Error('id (slug) required for deployment.delete');\n data = await deleteDep({ slug: id });\n summary = `Deleted deployment ${id}`;\n break;\n }\n\n default:\n throw new Error(\n `Unknown action: ${action}. Use one of: ${ACTIONS.join(', ')}`,\n );\n }\n\n return mcpResult({ action, ok: true, data }, summary);\n } catch (error) {\n const msg = error instanceof Error ? error.message : '';\n if (\n msg.includes('401') ||\n msg.includes('403') ||\n msg.includes('Unauthorized')\n )\n return mcpError(\n error,\n 'Set WALKEROS_TOKEN env var or check token expiry',\n );\n if (msg.includes('required'))\n return mcpError(\n error,\n `See api tool description for ${action} parameters.`,\n );\n return mcpError(error);\n }\n },\n );\n}\n","import { z } from 'zod';\n\nexport const ApiOutputShape = {\n action: z.string().describe('Action that was executed'),\n ok: z.boolean().describe('Whether the action succeeded'),\n data: z.unknown().describe('Action-specific result data'),\n};\n","import { ResourceTemplate } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { fetchPackageSchema } from '@walkeros/core';\nimport { PACKAGE_REGISTRY } from '../registry.js';\n\nexport function registerPackageSchemaResources(server: McpServer) {\n const template = new ResourceTemplate('walkeros://schema/{packageName}', {\n list: async () => ({\n resources: PACKAGE_REGISTRY.map((pkg) => ({\n uri: `walkeros://schema/${encodeURIComponent(pkg.name)}`,\n name: pkg.name,\n description: `Schema and examples for ${pkg.name}`,\n mimeType: 'application/json' as const,\n })),\n }),\n });\n\n server.registerResource(\n 'package-schema',\n template,\n {\n title: 'walkerOS Package Schema',\n description:\n 'JSON Schema and configuration examples for walkerOS packages',\n mimeType: 'application/json',\n },\n async (uri, { packageName }) => {\n const info = await fetchPackageSchema(\n decodeURIComponent(packageName as string),\n );\n return {\n contents: [\n {\n uri: uri.toString(),\n mimeType: 'application/json' as const,\n text: JSON.stringify(info, null, 2),\n },\n ],\n };\n },\n );\n}\n","import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { schemas } from '@walkeros/core/dev';\nimport { PACKAGE_REGISTRY } from '../registry.js';\n\nexport function registerReferenceResources(server: McpServer) {\n // Flow Schema reference (generated from Zod)\n server.resource(\n 'flow-schema',\n 'walkeros://reference/flow-schema',\n {\n description:\n 'JSON Schema for Flow.Config — the complete flow configuration structure',\n mimeType: 'application/json',\n },\n async () => ({\n contents: [\n {\n uri: 'walkeros://reference/flow-schema',\n text: JSON.stringify(schemas.configJsonSchema, null, 2),\n mimeType: 'application/json',\n },\n ],\n }),\n );\n\n // Event Model reference (generated from Zod)\n server.resource(\n 'event-model',\n 'walkeros://reference/event-model',\n {\n description:\n 'JSON Schema for walkerOS events: entity-action naming, data, context, globals, user, consent',\n mimeType: 'application/json',\n },\n async () => ({\n contents: [\n {\n uri: 'walkeros://reference/event-model',\n text: JSON.stringify(schemas.eventJsonSchema, null, 2),\n mimeType: 'application/json',\n },\n ],\n }),\n );\n\n // Mapping reference (generated from Zod — composite of related schemas)\n server.resource(\n 'mapping',\n 'walkeros://reference/mapping',\n {\n description:\n 'JSON Schemas for walkerOS mapping: rules, valueConfig, rule, policy',\n mimeType: 'application/json',\n },\n async () => ({\n contents: [\n {\n uri: 'walkeros://reference/mapping',\n text: JSON.stringify(\n {\n rules: schemas.rulesJsonSchema,\n valueConfig: schemas.valueConfigJsonSchema,\n rule: schemas.ruleJsonSchema,\n policy: schemas.policyJsonSchema,\n },\n null,\n 2,\n ),\n mimeType: 'application/json',\n },\n ],\n }),\n );\n\n // Consent reference (generated from Zod)\n server.resource(\n 'consent',\n 'walkeros://reference/consent',\n {\n description:\n 'JSON Schema for walkerOS consent: destination-level, rule-level, and field-level consent gating',\n mimeType: 'application/json',\n },\n async () => ({\n contents: [\n {\n uri: 'walkeros://reference/consent',\n text: JSON.stringify(schemas.consentJsonSchema, null, 2),\n mimeType: 'application/json',\n },\n ],\n }),\n );\n\n // Variables reference (hand-maintained — runtime interpolation patterns not captured in Zod schemas)\n server.resource(\n 'variables',\n 'walkeros://reference/variables',\n {\n description:\n 'walkerOS variable patterns: $var, $env, $def, $contract, $code, $store substitution',\n mimeType: 'application/json',\n },\n async () => ({\n contents: [\n {\n uri: 'walkeros://reference/variables',\n text: JSON.stringify(\n {\n patterns: {\n '$var.name':\n 'Variable substitution — cascade: step settings > flow settings > config variables',\n '$env.NAME':\n 'Environment variable — $env.GA_ID reads process.env.GA_ID',\n '$env.NAME:default':\n 'Environment variable with fallback — $env.GA_ID:G-DEFAULT',\n '$def.name':\n 'Definition reference — reusable config blocks from definitions section',\n '$def.name.path.deep':\n 'Nested definition access — $def.ga4Events.purchase',\n '$contract.name':\n 'Contract reference — links to named contract for validation',\n '$contract.name.path':\n 'Nested contract access — $contract.ecommerce.product',\n '$code:(expr)':\n 'Inline JavaScript — $code:(event) => event.data.price * 100',\n '$store:storeId':\n 'Store injection in env values — wires runtime store access',\n },\n cascade: {\n priority: [\n '1. Step-level settings (highest)',\n '2. Flow-level settings',\n '3. Config-level variables (lowest)',\n ],\n example: {\n variables: { apiKey: 'default-key' },\n flows: {\n production: {\n destinations: {\n api: {\n config: { key: '$var.apiKey' },\n settings: { apiKey: 'prod-key' },\n },\n },\n },\n },\n },\n },\n },\n null,\n 2,\n ),\n mimeType: 'application/json',\n },\n ],\n }),\n );\n\n // Contract reference (generated from Zod)\n server.resource(\n 'contract',\n 'walkeros://reference/contract',\n {\n description:\n 'JSON Schema for walkerOS contracts: event schema validation with entity-action keying',\n mimeType: 'application/json',\n },\n async () => ({\n contents: [\n {\n uri: 'walkeros://reference/contract',\n text: JSON.stringify(schemas.contractJsonSchema, null, 2),\n mimeType: 'application/json',\n },\n ],\n }),\n );\n\n // Examples reference (loaded from @walkeros/cli at runtime)\n server.resource(\n 'examples',\n 'walkeros://reference/examples',\n {\n description:\n 'Complete flow config example: web + server flows, mapping, contracts, step examples',\n mimeType: 'application/json',\n },\n async () => {\n let example: string;\n try {\n const { readFileSync } = await import('fs');\n const { createRequire } = await import('module');\n const require = createRequire(import.meta.url);\n const examplePath =\n require.resolve('@walkeros/cli/examples/flow-complete.json');\n example = readFileSync(examplePath, 'utf-8');\n } catch {\n example = JSON.stringify({ error: 'Example not found' });\n }\n return {\n contents: [\n {\n uri: 'walkeros://reference/examples',\n text: example,\n mimeType: 'application/json',\n },\n ],\n };\n },\n );\n\n // API reference (OpenAPI spec)\n server.resource(\n 'api',\n 'walkeros://reference/api',\n {\n description: 'walkerOS cloud API — OpenAPI 3.1 specification',\n mimeType: 'application/json',\n },\n async () => {\n let openApiSpec: string;\n try {\n const { readFileSync } = await import('fs');\n const { createRequire } = await import('module');\n const require = createRequire(import.meta.url);\n const specPath = require.resolve('@walkeros/cli/openapi/spec.json');\n openApiSpec = readFileSync(specPath, 'utf-8');\n } catch {\n openApiSpec = JSON.stringify({ error: 'OpenAPI spec not found' });\n }\n return {\n contents: [\n {\n uri: 'walkeros://reference/api',\n text: openApiSpec,\n mimeType: 'application/json',\n },\n ],\n };\n },\n );\n\n // Packages catalog resource\n server.resource(\n 'packages',\n 'walkeros://reference/packages',\n {\n description:\n 'Complete walkerOS package catalog — all sources, destinations, transformers, and stores',\n mimeType: 'application/json',\n },\n async () => ({\n contents: [\n {\n uri: 'walkeros://reference/packages',\n text: JSON.stringify(PACKAGE_REGISTRY, null, 2),\n mimeType: 'application/json',\n },\n ],\n }),\n );\n}\n","import { z } from 'zod';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\n\nexport function registerAddStepPrompt(server: McpServer) {\n server.registerPrompt(\n 'add-step',\n {\n description:\n 'Add a source, destination, transformer, or store step to a flow configuration. ' +\n 'Guides through package selection, config scaffolding, and wiring.',\n argsSchema: {\n stepType: z\n .string()\n .optional()\n .describe(\n 'Type of step to add: source, destination, transformer, or store',\n ),\n flowPath: z\n .string()\n .optional()\n .describe('Path to the flow.json file to modify'),\n },\n },\n async ({ stepType, flowPath }) => ({\n messages: [\n {\n role: 'user' as const,\n content: {\n type: 'text' as const,\n text: [\n `Help me add a ${stepType || 'new'} step to my flow${flowPath ? ` at ${flowPath}` : ''}.`,\n '',\n 'Follow these steps:',\n `1. ${stepType ? '' : 'Ask what type of step (source, destination, transformer, store). Then '}Use package_search to browse available packages for the selected type and platform.`,\n '2. Use package_get with section=\"hints\" to read the selected package\\'s configuration guidance.',\n '3. Use package_get with section=\"examples\" to see working configuration examples.',\n '4. Scaffold the step config using the package schemas — include required settings with placeholder values.',\n '5. Wire the step into the flow: add to packages section (with version if needed), connect via next/before chains if needed.',\n '6. For destinations: configure mapping using nested entity → action keys. Event \"product add\" maps to `{ \"product\": { \"add\": { name: \"AddToCart\" } } }`. Use the setup-mapping prompt for guidance.',\n '7. Use flow_validate to verify the result.',\n '',\n 'Important:',\n '- Read the walkeros://reference/flow-schema resource to understand connection rules.',\n '- Sources connect to pre-collector transformers via `next`.',\n '- Destinations connect to post-collector transformers via `before`.',\n '- Stores are passive — referenced via `$store:storeName` in env values.',\n '- Use variables ($var) for values that change between environments.',\n '- For required settings without defaults in the package schema, ask the user which value to use. Do not guess credentials, IDs, or environment-specific values.',\n ].join('\\n'),\n },\n },\n ],\n }),\n );\n}\n","import { z } from 'zod';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\n\nexport function registerSetupMappingPrompt(server: McpServer) {\n server.registerPrompt(\n 'setup-mapping',\n {\n description:\n 'Set up event mapping for any step in a flow. Teaches mapping syntax and uses package examples as templates.',\n argsSchema: {\n stepName: z\n .string()\n .optional()\n .describe('Step name in the flow (e.g., \"gtag\", \"meta\", \"express\")'),\n },\n },\n async ({ stepName }) => ({\n messages: [\n {\n role: 'user' as const,\n content: {\n type: 'text' as const,\n text: [\n `Help me set up mapping${stepName ? ` for the \"${stepName}\" step` : ''}.`,\n '',\n 'IMPORTANT — Mapping key structure:',\n 'Mapping uses NESTED entity → action keys, NOT dot-separated strings.',\n 'Event name \"product add\" splits into entity \"product\" and action \"add\".',\n 'Config structure: `{ \"mapping\": { \"product\": { \"add\": { name: \"AddToCart\", data: { ... } } } } }`',\n 'Wildcards: `{ \"*\": { \"view\": Rule } }` matches any entity with action \"view\".',\n '',\n 'Follow these steps:',\n '1. Read the walkeros://reference/mapping resource for full syntax reference.',\n `2. ${stepName ? `Identify the package for \"${stepName}\" in the flow, then u` : 'U'}se package_get with section=\"examples\" to see how events are mapped for this package.`,\n '3. Ask which events I want to map (e.g., \"product view\", \"order complete\").',\n '4. Generate mapping rules using the package examples as templates.',\n '5. Use flow_validate to verify the mapping.',\n '',\n 'Mapping operates at two levels:',\n '- **Source mapping**: normalizes raw input → walkerOS events',\n '- **Destination mapping**: transforms walkerOS events → vendor format',\n '',\n 'Key mapping operators: data (extract), map (object transform), loop (array processing), ',\n 'set (create array), fn ($code function), condition (conditional), consent (consent-gated).',\n '',\n 'Use $def references for shared mapping patterns across destinations.',\n ].join('\\n'),\n },\n },\n ],\n }),\n );\n}\n","import { z } from 'zod';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\n\nexport function registerManageContractPrompt(server: McpServer) {\n server.registerPrompt(\n 'manage-contract',\n {\n description:\n 'Create or update event contracts for a flow. Can generate contracts from existing mappings or scaffold mappings from contracts.',\n argsSchema: {\n direction: z\n .string()\n .optional()\n .describe(\n 'Direction: \"from-mappings\" (extract contract from existing mappings), ' +\n '\"from-scratch\" (create new contract), or \"to-mappings\" (scaffold mappings from contract)',\n ),\n },\n },\n async ({ direction }) => ({\n messages: [\n {\n role: 'user' as const,\n content: {\n type: 'text' as const,\n text: [\n `Help me ${direction === 'to-mappings' ? 'scaffold mappings from a contract' : direction === 'from-mappings' ? 'generate a contract from existing mappings' : 'manage event contracts'}.`,\n '',\n 'Follow these steps:',\n '1. Read the walkeros://reference/contract resource to understand contract structure.',\n direction === 'from-mappings'\n ? '2. Read all destination mappings in the flow, extract referenced event fields, and generate a contract with those as required properties.'\n : direction === 'to-mappings'\n ? '2. Read the contract from the flow, then scaffold mapping stubs for each destination based on the contract fields.'\n : '2. Ask for entity-action names and required properties, or ask whether to generate from existing mappings.',\n '3. Use entity-action keying with wildcards (*.*, *.action, entity.*) for broad rules.',\n '4. Define JSON Schema for events, globals, context, custom, user, and consent.',\n '5. Use flow_validate to verify the contract.',\n '',\n 'Contracts and mappings are bidirectional:',\n '- **Contract → Mappings**: contract defines what events look like, mappings are scaffolded to match.',\n '- **Mappings → Contract**: existing mappings reveal which fields are used, contract formalizes them.',\n '',\n 'Use $contract.name references to link contracts in the flow.',\n 'Contracts support extends for inheritance between event types.',\n ].join('\\n'),\n },\n },\n ],\n }),\n );\n}\n","import { z } from 'zod';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\n\nexport function registerUseDefinitionsPrompt(server: McpServer) {\n server.registerPrompt(\n 'use-definitions',\n {\n description:\n 'Extract shared patterns into definitions and variables for DRY, environment-aware flow configurations.',\n argsSchema: {\n flowPath: z\n .string()\n .optional()\n .describe('Path to the flow.json file to analyze'),\n },\n },\n async ({ flowPath }) => ({\n messages: [\n {\n role: 'user' as const,\n content: {\n type: 'text' as const,\n text: [\n `Help me extract shared patterns into definitions and variables${flowPath ? ` in ${flowPath}` : ''}.`,\n '',\n 'Follow these steps:',\n '1. Read the walkeros://reference/variables resource to understand variable syntax.',\n '2. Analyze the flow config for repeated patterns (same mapping blocks, same config values).',\n '3. Extract repeated mapping patterns into the `definitions` section with `$def.name` references.',\n '4. Extract environment-specific values into `variables` with `$var.name` references.',\n '5. Show the cascade priority: step > settings > config.',\n '6. Use flow_validate to verify the result.',\n '',\n 'Variable types:',\n '- `$var.name` — variable substitution (cascade: step > settings > config)',\n '- `$env.NAME` and `$env.NAME:default` — environment variables',\n '- `$def.name` and `$def.name.path.deep` — definition references',\n '- `$contract.name` — contract references',\n '- `$code:(expr)` — inline JavaScript functions',\n '- `$store:storeId` — store injection in env values',\n '',\n 'Look for:',\n '- Same API keys or URLs across multiple destinations → $var or $env',\n '- Identical mapping rules in multiple destinations → $def',\n '- Environment-specific values (dev/staging/prod)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ACnC,qBAAqB,MAAM;AAC3B,+BAA+B,MAAM;AACrC,2BAA2B,MAAM;AACjC,sBAAsB,MAAM;AAC5B,2BAA2B,MAAM;AACjC,6BAA6B,MAAM;AACnC,6BAA6B,MAAM;AAEnC,IAAI,QAAQ,IAAI,gBAAgB;AAC9B,kBAAgB,MAAM;AACxB;AAEA,eAAe,OAAO;AACpB,QAAM,YAAY,IAAI,qBAAqB;AAC3C,QAAM,OAAO,QAAQ,SAAS;AAC9B,UAAQ,MAAM,2CAA2C;AAC3D;AAEA,KAAK,EAAE,MAAM,CAAC,UAAU;AACtB,UAAQ,MAAM,oCAAoC,KAAK;AACvD,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":["server","z","schemas","mcpResult","mcpError","server","schemas","z","result","size","time","summary","mcpResult","mcpError","schemas","mcpResult","mcpError","server","schemas","mcpResult","mcpError","schemas","mcpResult","mcpError","server","schemas","mcpError","mcpResult","z","mcpResult","mcpError","server","z","mcpResult","mcpError","z","mcpResult","mcpError","server","z","mcpResult","mcpError","z","loadJsonConfig","mcpResult","mcpError","server","z","mcpResult","mcpError","z","server","z","mcpResult","mcpError","server","schemas","server","schemas","require","z","server","z","server","z","server","z","server"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@walkeros/mcp",
3
- "version": "2.0.1",
4
- "description": "MCP server for walkerOS - validate, bundle, and simulate analytics events locally, plus manage projects and flows via the walkerOS API",
3
+ "version": "3.0.0",
4
+ "description": "MCP server for walkerOS flow development - discover packages, scaffold configs, validate, bundle, simulate, and test event pipelines",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "main": "./dist/index.js",
@@ -27,13 +27,12 @@
27
27
  "typecheck": "tsc --noEmit",
28
28
  "lint": "eslint \"**/*.ts*\"",
29
29
  "clean": "rm -rf .turbo && rm -rf dist && rm -rf coverage",
30
- "prepublishOnly": "npm run build",
31
- "update": "npx npm-check-updates -u && npm update"
30
+ "prepublishOnly": "npm run build"
32
31
  },
33
32
  "dependencies": {
34
33
  "@modelcontextprotocol/sdk": "^1.26.0",
35
- "@walkeros/cli": "^2.0.0",
36
- "@walkeros/core": "^2.0.0"
34
+ "@walkeros/cli": "^3.0.0",
35
+ "@walkeros/core": "^3.0.0"
37
36
  },
38
37
  "peerDependencies": {
39
38
  "zod": "^4.0"
@@ -44,7 +43,7 @@
44
43
  },
45
44
  "repository": {
46
45
  "url": "git+https://github.com/elbwalker/walkerOS.git",
47
- "directory": "packages/mcp"
46
+ "directory": "packages/mcps/mcp"
48
47
  },
49
48
  "author": "elbwalker <hello@elbwalker.com>",
50
49
  "homepage": "https://github.com/elbwalker/walkerOS#readme",
@@ -59,7 +58,7 @@
59
58
  "mcp",
60
59
  "model-context-protocol",
61
60
  "analytics",
62
- "event-tracking"
61
+ "cli"
63
62
  ],
64
63
  "publishConfig": {
65
64
  "access": "public"