@vfarcic/dot-ai 0.137.0 → 0.139.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.
@@ -1 +1 @@
1
- {"version":3,"file":"openapi-generator.d.ts","sourceRoot":"","sources":["../../src/interfaces/openapi-generator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,gBAAgB,EAAY,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;QACpB,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,CAAC,EAAE;YACR,IAAI,EAAE,MAAM,CAAC;YACb,GAAG,EAAE,MAAM,CAAC;YACZ,KAAK,EAAE,MAAM,CAAC;SACf,CAAC;QACF,OAAO,CAAC,EAAE;YACR,IAAI,EAAE,MAAM,CAAC;YACb,GAAG,EAAE,MAAM,CAAC;SACb,CAAC;KACH,CAAC;IACF,OAAO,EAAE,KAAK,CAAC;QACb,GAAG,EAAE,MAAM,CAAC;QACZ,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC,CAAC;IACH,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,UAAU,CAAC,EAAE;QACX,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAC9B,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAChC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KACvC,CAAC;IACF,IAAI,CAAC,EAAE,KAAK,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;KACr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B;IACnC,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,SAAS,CAAC,CAAc;IAChC,OAAO,CAAC,eAAe,CAAa;IACpC,OAAO,CAAC,eAAe,CAAiB;gBAE5B,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAE,OAAO,CAAC,aAAa,CAAM;IAc3F;;OAEG;IACH,YAAY,IAAI,WAAW;IAsC3B;;OAEG;IACH,OAAO,CAAC,YAAY;IAmBpB;;OAEG;IACH,OAAO,CAAC,eAAe;IASvB;;OAEG;IACH,OAAO,CAAC,aAAa;IA+NrB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAkL1B;;OAEG;IACH,OAAO,CAAC,YAAY;IAmCpB;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAoB9B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAuD5B;;OAEG;IACH,eAAe,IAAI,IAAI;IAMvB;;OAEG;IACH,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,IAAI;IAMrD;;OAEG;IACH,SAAS,IAAI,aAAa;CAG3B"}
@@ -101,6 +101,103 @@ class OpenApiGenerator {
101
101
  generatePaths(tools) {
102
102
  const paths = {};
103
103
  const basePath = `${this.config.basePath}/${this.config.apiVersion}`;
104
+ // MCP Protocol Endpoints
105
+ paths['/'] = {
106
+ get: {
107
+ summary: 'Open MCP SSE stream',
108
+ description: 'Opens a Server-Sent Events (SSE) stream for Model Context Protocol communication. This endpoint allows the server to push messages to the client without the client first sending data.',
109
+ tags: ['MCP Protocol'],
110
+ parameters: [],
111
+ responses: {
112
+ 200: {
113
+ description: 'SSE stream opened successfully',
114
+ content: {
115
+ 'text/event-stream': {
116
+ schema: {
117
+ type: 'string',
118
+ description: 'Server-Sent Events stream'
119
+ }
120
+ }
121
+ }
122
+ },
123
+ 405: {
124
+ description: 'Method not allowed - server does not support SSE',
125
+ content: {
126
+ 'application/json': {
127
+ schema: { $ref: '#/components/schemas/ErrorResponse' }
128
+ }
129
+ }
130
+ }
131
+ }
132
+ },
133
+ post: {
134
+ summary: 'Send MCP JSON-RPC message',
135
+ description: 'Send a JSON-RPC message using Model Context Protocol. Used for tool calls, initialization, and other MCP operations. The server may respond with either a JSON object or open an SSE stream.',
136
+ tags: ['MCP Protocol'],
137
+ requestBody: {
138
+ required: true,
139
+ content: {
140
+ 'application/json': {
141
+ schema: { $ref: '#/components/schemas/McpJsonRpcRequest' },
142
+ examples: {
143
+ initialize: {
144
+ summary: 'Initialize MCP session',
145
+ value: {
146
+ jsonrpc: '2.0',
147
+ id: 1,
148
+ method: 'initialize',
149
+ params: {
150
+ protocolVersion: '2024-11-05',
151
+ capabilities: {},
152
+ clientInfo: {
153
+ name: 'example-client',
154
+ version: '1.0.0'
155
+ }
156
+ }
157
+ }
158
+ },
159
+ toolCall: {
160
+ summary: 'Call a tool',
161
+ value: {
162
+ jsonrpc: '2.0',
163
+ id: 2,
164
+ method: 'tools/call',
165
+ params: {
166
+ name: 'version',
167
+ arguments: {}
168
+ }
169
+ }
170
+ }
171
+ }
172
+ }
173
+ }
174
+ },
175
+ responses: {
176
+ 200: {
177
+ description: 'JSON-RPC response or SSE stream',
178
+ content: {
179
+ 'application/json': {
180
+ schema: { $ref: '#/components/schemas/McpJsonRpcResponse' }
181
+ },
182
+ 'text/event-stream': {
183
+ schema: {
184
+ type: 'string',
185
+ description: 'Server-Sent Events stream with JSON-RPC messages'
186
+ }
187
+ }
188
+ }
189
+ },
190
+ 400: {
191
+ description: 'Bad request - invalid JSON-RPC message',
192
+ content: {
193
+ 'application/json': {
194
+ schema: { $ref: '#/components/schemas/McpJsonRpcError' }
195
+ }
196
+ }
197
+ }
198
+ }
199
+ }
200
+ };
104
201
  // Tool discovery endpoint
105
202
  paths[`${basePath}/tools`] = {
106
203
  get: {
@@ -332,6 +429,54 @@ class OpenApiGenerator {
332
429
  }
333
430
  ]
334
431
  };
432
+ // MCP JSON-RPC schemas
433
+ schemas.McpJsonRpcRequest = {
434
+ type: 'object',
435
+ description: 'JSON-RPC 2.0 request message for MCP protocol',
436
+ properties: {
437
+ jsonrpc: { type: 'string', enum: ['2.0'], description: 'JSON-RPC version' },
438
+ id: { type: ['number', 'string', 'null'], description: 'Request identifier' },
439
+ method: { type: 'string', description: 'Method name (e.g., initialize, tools/call, tools/list)' },
440
+ params: { type: 'object', description: 'Method parameters' }
441
+ },
442
+ required: ['jsonrpc', 'method']
443
+ };
444
+ schemas.McpJsonRpcResponse = {
445
+ type: 'object',
446
+ description: 'JSON-RPC 2.0 response message',
447
+ properties: {
448
+ jsonrpc: { type: 'string', enum: ['2.0'], description: 'JSON-RPC version' },
449
+ id: { type: ['number', 'string', 'null'], description: 'Request identifier' },
450
+ result: { type: 'object', description: 'Method result' },
451
+ error: {
452
+ type: 'object',
453
+ properties: {
454
+ code: { type: 'number', description: 'Error code' },
455
+ message: { type: 'string', description: 'Error message' },
456
+ data: { type: 'object', description: 'Additional error data' }
457
+ }
458
+ }
459
+ },
460
+ required: ['jsonrpc', 'id']
461
+ };
462
+ schemas.McpJsonRpcError = {
463
+ type: 'object',
464
+ description: 'JSON-RPC 2.0 error response',
465
+ properties: {
466
+ jsonrpc: { type: 'string', enum: ['2.0'], description: 'JSON-RPC version' },
467
+ id: { type: ['number', 'string', 'null'], description: 'Request identifier' },
468
+ error: {
469
+ type: 'object',
470
+ properties: {
471
+ code: { type: 'number', description: 'Error code' },
472
+ message: { type: 'string', description: 'Error message' },
473
+ data: { type: 'object', description: 'Additional error data' }
474
+ },
475
+ required: ['code', 'message']
476
+ }
477
+ },
478
+ required: ['jsonrpc', 'id', 'error']
479
+ };
335
480
  // Individual tool request schemas
336
481
  for (const tool of tools) {
337
482
  schemas[`${tool.name}Request`] = tool.schema;
@@ -345,6 +490,10 @@ class OpenApiGenerator {
345
490
  */
346
491
  generateTags(categories) {
347
492
  const tags = [
493
+ {
494
+ name: 'MCP Protocol',
495
+ description: 'Model Context Protocol endpoints for AI assistant integration via JSON-RPC and Server-Sent Events'
496
+ },
348
497
  {
349
498
  name: 'Tool Discovery',
350
499
  description: 'Endpoints for discovering available tools and their capabilities'
@@ -5,7 +5,7 @@ import { z } from 'zod';
5
5
  import { DotAI } from '../core/index';
6
6
  import { Logger } from '../core/error-handling';
7
7
  export declare const RECOMMEND_TOOL_NAME = "recommend";
8
- export declare const RECOMMEND_TOOL_DESCRIPTION = "Deploy, create, setup, install, or run applications, infrastructure, and services on Kubernetes with AI recommendations. Describe what you want to deploy. Does NOT handle policy creation, organizational patterns, or resource capabilities - use manageOrgData for those.";
8
+ export declare const RECOMMEND_TOOL_DESCRIPTION = "Deploy applications, infrastructure, and services using Kubernetes resources with AI recommendations. Supports cloud resources via operators like Crossplane, cluster management via CAPI, and traditional Kubernetes workloads. Describe what you want to deploy. Does NOT handle policy creation, organizational patterns, or resource capabilities - use manageOrgData for those.";
9
9
  export declare const RECOMMEND_TOOL_INPUT_SCHEMA: {
10
10
  stage: z.ZodOptional<z.ZodString>;
11
11
  intent: z.ZodOptional<z.ZodString>;
@@ -1 +1 @@
1
- {"version":3,"file":"recommend.d.ts","sourceRoot":"","sources":["../../src/tools/recommend.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAchD,eAAO,MAAM,mBAAmB,cAAc,CAAC;AAC/C,eAAO,MAAM,0BAA0B,iRAAiR,CAAC;AAGzT,eAAO,MAAM,2BAA2B;;;;;;;;CAWvC,CAAC;AA4GF;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,GAAG,EACT,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC;IAAE,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAAE,CAAC,CAsRxD"}
1
+ {"version":3,"file":"recommend.d.ts","sourceRoot":"","sources":["../../src/tools/recommend.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAchD,eAAO,MAAM,mBAAmB,cAAc,CAAC;AAC/C,eAAO,MAAM,0BAA0B,yXAAyX,CAAC;AAGja,eAAO,MAAM,2BAA2B;;;;;;;;CAWvC,CAAC;AA4GF;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,GAAG,EACT,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC;IAAE,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAAE,CAAC,CAsRxD"}
@@ -54,7 +54,7 @@ const shared_prompt_loader_1 = require("../core/shared-prompt-loader");
54
54
  const platform_utils_1 = require("../core/platform-utils");
55
55
  // Tool metadata for direct MCP registration
56
56
  exports.RECOMMEND_TOOL_NAME = 'recommend';
57
- exports.RECOMMEND_TOOL_DESCRIPTION = 'Deploy, create, setup, install, or run applications, infrastructure, and services on Kubernetes with AI recommendations. Describe what you want to deploy. Does NOT handle policy creation, organizational patterns, or resource capabilities - use manageOrgData for those.';
57
+ exports.RECOMMEND_TOOL_DESCRIPTION = 'Deploy applications, infrastructure, and services using Kubernetes resources with AI recommendations. Supports cloud resources via operators like Crossplane, cluster management via CAPI, and traditional Kubernetes workloads. Describe what you want to deploy. Does NOT handle policy creation, organizational patterns, or resource capabilities - use manageOrgData for those.';
58
58
  // Zod schema for MCP registration (unified tool with stage routing)
59
59
  exports.RECOMMEND_TOOL_INPUT_SCHEMA = {
60
60
  stage: zod_1.z.string().optional().describe('Deployment workflow stage: "recommend" (default), "chooseSolution", "answerQuestion:required", "answerQuestion:basic", "answerQuestion:advanced", "answerQuestion:open", "generateManifests", "deployManifests". Defaults to "recommend" if omitted.'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vfarcic/dot-ai",
3
- "version": "0.137.0",
3
+ "version": "0.139.0",
4
4
  "description": "AI-powered development productivity platform that enhances software development workflows through intelligent automation and AI-driven assistance",
5
5
  "mcpName": "io.github.vfarcic/dot-ai",
6
6
  "main": "dist/index.js",