@kya-os/mcp-i 0.1.0-alpha.2.4 → 0.1.0-alpha.2.5
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/dev-helper.js +2 -10
- package/dist/transport.d.ts +1 -0
- package/dist/transport.js +18 -36
- package/package.json +1 -1
package/dist/dev-helper.js
CHANGED
|
@@ -11,16 +11,8 @@ async function initWithDevExperience(options = {}) {
|
|
|
11
11
|
logger.info('🔧 Development mode detected - agents will be created as drafts');
|
|
12
12
|
}
|
|
13
13
|
if (!options.name && !process.env.MCP_SERVER_NAME) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
options.name = pkg.name || 'Unnamed MCP Server';
|
|
17
|
-
options.description = pkg.description;
|
|
18
|
-
options.repository = pkg.repository?.url || pkg.repository;
|
|
19
|
-
logger.info(`📦 Auto-detected agent name: ${options.name}`);
|
|
20
|
-
}
|
|
21
|
-
catch {
|
|
22
|
-
options.name = 'Development MCP Server';
|
|
23
|
-
}
|
|
14
|
+
options.name = 'Development MCP Server';
|
|
15
|
+
logger.info('💡 Tip: Provide a name in options for better agent identification');
|
|
24
16
|
}
|
|
25
17
|
if (!options.storage) {
|
|
26
18
|
logger.info('💡 Tip: Use storage: "file" for persistent identity across restarts');
|
package/dist/transport.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export declare class AxiosTransport implements Transport {
|
|
|
24
24
|
export declare class RuntimeDetector {
|
|
25
25
|
static isEdgeRuntime(): boolean;
|
|
26
26
|
static isNodeRuntime(): boolean;
|
|
27
|
+
static isNextJs(): boolean;
|
|
27
28
|
static hasFetch(): boolean;
|
|
28
29
|
static isLambda(): boolean;
|
|
29
30
|
}
|
package/dist/transport.js
CHANGED
|
@@ -1,37 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
3
|
exports.TransportFactory = exports.RuntimeDetector = exports.AxiosTransport = exports.FetchTransport = void 0;
|
|
37
4
|
class FetchTransport {
|
|
@@ -145,8 +112,14 @@ class AxiosTransport {
|
|
|
145
112
|
}
|
|
146
113
|
async getAxios() {
|
|
147
114
|
if (!this.axiosInstance) {
|
|
148
|
-
|
|
149
|
-
|
|
115
|
+
try {
|
|
116
|
+
const axios = require('axios');
|
|
117
|
+
this.axiosInstance = axios.default || axios;
|
|
118
|
+
}
|
|
119
|
+
catch (error) {
|
|
120
|
+
throw new Error('axios is not installed. Please install it with: npm install axios\n' +
|
|
121
|
+
'Or use the fetch transport instead by setting transport: "fetch" in options');
|
|
122
|
+
}
|
|
150
123
|
}
|
|
151
124
|
return this.axiosInstance;
|
|
152
125
|
}
|
|
@@ -162,7 +135,13 @@ class RuntimeDetector {
|
|
|
162
135
|
}
|
|
163
136
|
static isNodeRuntime() {
|
|
164
137
|
return !!(process.versions?.node &&
|
|
165
|
-
!this.isEdgeRuntime()
|
|
138
|
+
!this.isEdgeRuntime() &&
|
|
139
|
+
!this.isNextJs());
|
|
140
|
+
}
|
|
141
|
+
static isNextJs() {
|
|
142
|
+
return !!(process.env.NEXT_RUNTIME ||
|
|
143
|
+
globalThis.__NEXT_DATA__ ||
|
|
144
|
+
process.env.NEXT_PUBLIC_VERCEL_ENV);
|
|
166
145
|
}
|
|
167
146
|
static hasFetch() {
|
|
168
147
|
return typeof globalThis.fetch === 'function';
|
|
@@ -190,6 +169,9 @@ class TransportFactory {
|
|
|
190
169
|
if (RuntimeDetector.isEdgeRuntime() && RuntimeDetector.hasFetch()) {
|
|
191
170
|
return new FetchTransport();
|
|
192
171
|
}
|
|
172
|
+
if (RuntimeDetector.isNextJs() && RuntimeDetector.hasFetch()) {
|
|
173
|
+
return new FetchTransport();
|
|
174
|
+
}
|
|
193
175
|
if (RuntimeDetector.isLambda() && RuntimeDetector.hasFetch()) {
|
|
194
176
|
return new FetchTransport();
|
|
195
177
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kya-os/mcp-i",
|
|
3
|
-
"version": "0.1.0-alpha.2.
|
|
3
|
+
"version": "0.1.0-alpha.2.5",
|
|
4
4
|
"description": "Production-ready MCP Identity with automatic registration, key rotation, and optimized performance",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|