@vfarcic/dot-ai 0.136.0 → 0.138.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":"vercel-provider.d.ts","sourceRoot":"","sources":["../../../src/core/providers/vercel-provider.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAWH,OAAO,EACL,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,aAAa,EACd,MAAM,0BAA0B,CAAC;AAiBlC,qBAAa,cAAe,YAAW,UAAU;IAC/C,OAAO,CAAC,YAAY,CAAoB;IACxC,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,SAAS,CAAU;IAC3B,OAAO,CAAC,OAAO,CAAC,CAAS;IACzB,OAAO,CAAC,aAAa,CAAM;gBAEf,MAAM,EAAE,gBAAgB;IAWpC,OAAO,CAAC,qBAAqB;IAY7B,OAAO,CAAC,eAAe;IAkFvB,eAAe,IAAI,MAAM;IAIzB,eAAe,IAAI,MAAM;IAIzB,YAAY,IAAI,MAAM;IAItB,cAAc,IAAI,MAAM;IAIxB,aAAa,IAAI,OAAO;IAIxB,OAAO,CAAC,iBAAiB;IAyBnB,WAAW,CACf,OAAO,EAAE,MAAM,EACf,SAAS,GAAE,MAAkB,EAC7B,iBAAiB,CAAC,EAAE;QAClB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,GACA,OAAO,CAAC,UAAU,CAAC;IAoJtB;;;;;;;;;;;;OAYG;IACG,QAAQ,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;CAiW/D"}
1
+ {"version":3,"file":"vercel-provider.d.ts","sourceRoot":"","sources":["../../../src/core/providers/vercel-provider.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAWH,OAAO,EACL,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,aAAa,EACd,MAAM,0BAA0B,CAAC;AAiBlC,qBAAa,cAAe,YAAW,UAAU;IAC/C,OAAO,CAAC,YAAY,CAAoB;IACxC,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,SAAS,CAAU;IAC3B,OAAO,CAAC,OAAO,CAAC,CAAS;IACzB,OAAO,CAAC,aAAa,CAAM;gBAEf,MAAM,EAAE,gBAAgB;IAWpC,OAAO,CAAC,qBAAqB;IAY7B,OAAO,CAAC,eAAe;IAoFvB,eAAe,IAAI,MAAM;IAIzB,eAAe,IAAI,MAAM;IAIzB,YAAY,IAAI,MAAM;IAItB,cAAc,IAAI,MAAM;IAIxB,aAAa,IAAI,OAAO;IAIxB,OAAO,CAAC,iBAAiB;IAyBnB,WAAW,CACf,OAAO,EAAE,MAAM,EACf,SAAS,GAAE,MAAkB,EAC7B,iBAAiB,CAAC,EAAE;QAClB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,GACA,OAAO,CAAC,UAAU,CAAC;IAoJtB;;;;;;;;;;;;OAYG;IACG,QAAQ,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;CAiW/D"}
@@ -109,7 +109,9 @@ class VercelProvider {
109
109
  apiKey: this.apiKey,
110
110
  baseURL: this.baseURL,
111
111
  });
112
- break;
112
+ // Use .chat() explicitly for custom endpoints to use /chat/completions instead of /responses
113
+ this.modelInstance = provider.chat(this.model);
114
+ return; // Early return - model instance already set
113
115
  default:
114
116
  throw new Error(`Cannot initialize model for provider: ${this.providerType}`);
115
117
  }
@@ -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,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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'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vfarcic/dot-ai",
3
- "version": "0.136.0",
3
+ "version": "0.138.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",