@kya-os/mcp-i 0.1.0-alpha.2.2 → 0.1.0-alpha.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +271 -47
- package/dist/index.d.ts +63 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +298 -55
- package/dist/index.js.map +1 -1
- package/dist/registry/cursor.d.ts +25 -0
- package/dist/registry/cursor.d.ts.map +1 -0
- package/dist/registry/cursor.js +108 -0
- package/dist/registry/cursor.js.map +1 -0
- package/dist/registry/glama.d.ts +25 -0
- package/dist/registry/glama.d.ts.map +1 -0
- package/dist/registry/glama.js +111 -0
- package/dist/registry/glama.js.map +1 -0
- package/dist/registry/index.d.ts +43 -0
- package/dist/registry/index.d.ts.map +1 -0
- package/dist/registry/index.js +96 -0
- package/dist/registry/index.js.map +1 -0
- package/dist/registry/knowthat.d.ts +28 -0
- package/dist/registry/knowthat.d.ts.map +1 -0
- package/dist/registry/knowthat.js +113 -0
- package/dist/registry/knowthat.js.map +1 -0
- package/dist/registry/smithery.d.ts +29 -0
- package/dist/registry/smithery.d.ts.map +1 -0
- package/dist/registry/smithery.js +119 -0
- package/dist/registry/smithery.js.map +1 -0
- package/dist/types.d.ts +91 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +22 -4
- package/dist/auto-enhance.d.ts +0 -41
- package/dist/auto-enhance.d.ts.map +0 -1
- package/dist/auto-enhance.js +0 -193
- package/dist/auto-enhance.js.map +0 -1
- package/dist/auto-init.d.ts +0 -12
- package/dist/auto-init.d.ts.map +0 -1
- package/dist/auto-init.js +0 -166
- package/dist/auto-init.js.map +0 -1
- package/dist/patch.d.ts +0 -22
- package/dist/patch.d.ts.map +0 -1
- package/dist/patch.js +0 -164
- package/dist/patch.js.map +0 -1
- package/dist/transparent.d.ts +0 -40
- package/dist/transparent.d.ts.map +0 -1
- package/dist/transparent.js +0 -167
- package/dist/transparent.js.map +0 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Glama.ai Registry Adapter
|
|
3
|
+
* Secondary registry for AI agent marketplace
|
|
4
|
+
*/
|
|
5
|
+
import { RegistryAdapter, RegistryPublishData, RegistryPublishResult, RegistryStatus } from '../types';
|
|
6
|
+
export declare class GlamaRegistry implements RegistryAdapter {
|
|
7
|
+
name: string;
|
|
8
|
+
type: 'primary' | 'secondary';
|
|
9
|
+
private endpoint;
|
|
10
|
+
private apiKey?;
|
|
11
|
+
constructor(endpoint?: string, apiKey?: string);
|
|
12
|
+
/**
|
|
13
|
+
* Publish agent to Glama marketplace
|
|
14
|
+
*/
|
|
15
|
+
publish(data: RegistryPublishData): Promise<RegistryPublishResult>;
|
|
16
|
+
/**
|
|
17
|
+
* Verify agent exists in Glama
|
|
18
|
+
*/
|
|
19
|
+
verify(did: string): Promise<boolean>;
|
|
20
|
+
/**
|
|
21
|
+
* Get agent status in Glama
|
|
22
|
+
*/
|
|
23
|
+
getStatus(did: string): Promise<RegistryStatus>;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=glama.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glama.d.ts","sourceRoot":"","sources":["../../src/registry/glama.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,cAAc,EACf,MAAM,UAAU,CAAC;AAElB,qBAAa,aAAc,YAAW,eAAe;IACnD,IAAI,SAAW;IACf,IAAI,EAAE,SAAS,GAAG,WAAW,CAAe;IAC5C,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,MAAM,CAAC,CAAS;gBAEZ,QAAQ,SAAyB,EAAE,MAAM,CAAC,EAAE,MAAM;IAK9D;;OAEG;IACG,OAAO,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAiDxE;;OAEG;IACG,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAgB3C;;OAEG;IACG,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;CA4BtD"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Glama.ai Registry Adapter
|
|
4
|
+
* Secondary registry for AI agent marketplace
|
|
5
|
+
*/
|
|
6
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.GlamaRegistry = void 0;
|
|
11
|
+
const axios_1 = __importDefault(require("axios"));
|
|
12
|
+
class GlamaRegistry {
|
|
13
|
+
constructor(endpoint = 'https://api.glama.ai', apiKey) {
|
|
14
|
+
this.name = 'glama';
|
|
15
|
+
this.type = 'secondary';
|
|
16
|
+
this.endpoint = endpoint;
|
|
17
|
+
this.apiKey = apiKey || process.env.GLAMA_API_KEY;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Publish agent to Glama marketplace
|
|
21
|
+
*/
|
|
22
|
+
async publish(data) {
|
|
23
|
+
try {
|
|
24
|
+
const response = await axios_1.default.post(`${this.endpoint}/agents/create`, {
|
|
25
|
+
agent_name: data.name,
|
|
26
|
+
external_id: data.did,
|
|
27
|
+
description: data.description,
|
|
28
|
+
source_repository: data.repository,
|
|
29
|
+
verification: {
|
|
30
|
+
type: 'did',
|
|
31
|
+
did_url: data.did,
|
|
32
|
+
host_registry: 'knowthat.ai',
|
|
33
|
+
verification_endpoint: `https://knowthat.ai/api/agents/${data.did}/verify`
|
|
34
|
+
},
|
|
35
|
+
metadata: {
|
|
36
|
+
mcp_identity: {
|
|
37
|
+
verified: true,
|
|
38
|
+
conformance_level: 2,
|
|
39
|
+
public_key: data.publicKey
|
|
40
|
+
},
|
|
41
|
+
...data.metadata
|
|
42
|
+
},
|
|
43
|
+
pricing_model: 'free',
|
|
44
|
+
status: 'active'
|
|
45
|
+
}, {
|
|
46
|
+
timeout: 10000,
|
|
47
|
+
headers: {
|
|
48
|
+
'Content-Type': 'application/json',
|
|
49
|
+
'User-Agent': '@kya-os/mcp-i/0.2.0',
|
|
50
|
+
...(this.apiKey ? { 'X-Glama-API-Key': this.apiKey } : {})
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
return {
|
|
54
|
+
success: true,
|
|
55
|
+
registryAgentId: response.data.agent_id,
|
|
56
|
+
profileUrl: response.data.marketplace_url || `https://glama.ai/agents/${response.data.agent_id}`
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
return {
|
|
61
|
+
success: false,
|
|
62
|
+
error: error.response?.data?.error || error.message || 'Failed to publish to Glama'
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Verify agent exists in Glama
|
|
68
|
+
*/
|
|
69
|
+
async verify(did) {
|
|
70
|
+
try {
|
|
71
|
+
const response = await axios_1.default.get(`${this.endpoint}/agents/by-external-id/${encodeURIComponent(did)}`, {
|
|
72
|
+
timeout: 5000,
|
|
73
|
+
headers: this.apiKey ? { 'X-Glama-API-Key': this.apiKey } : {}
|
|
74
|
+
});
|
|
75
|
+
return response.data.exists === true;
|
|
76
|
+
}
|
|
77
|
+
catch {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Get agent status in Glama
|
|
83
|
+
*/
|
|
84
|
+
async getStatus(did) {
|
|
85
|
+
try {
|
|
86
|
+
const response = await axios_1.default.get(`${this.endpoint}/agents/by-external-id/${encodeURIComponent(did)}/status`, {
|
|
87
|
+
timeout: 5000,
|
|
88
|
+
headers: this.apiKey ? { 'X-Glama-API-Key': this.apiKey } : {}
|
|
89
|
+
});
|
|
90
|
+
return {
|
|
91
|
+
name: this.name,
|
|
92
|
+
status: response.data.status === 'active' ? 'active' : 'pending',
|
|
93
|
+
registeredAt: response.data.created_at,
|
|
94
|
+
lastSyncAt: new Date().toISOString(),
|
|
95
|
+
type: 'secondary',
|
|
96
|
+
registryAgentId: response.data.agent_id
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
catch (error) {
|
|
100
|
+
return {
|
|
101
|
+
name: this.name,
|
|
102
|
+
status: 'failed',
|
|
103
|
+
type: 'secondary',
|
|
104
|
+
error: 'Not found in Glama marketplace',
|
|
105
|
+
lastSyncAt: new Date().toISOString()
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
exports.GlamaRegistry = GlamaRegistry;
|
|
111
|
+
//# sourceMappingURL=glama.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glama.js","sourceRoot":"","sources":["../../src/registry/glama.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAEH,kDAA0B;AAQ1B,MAAa,aAAa;IAMxB,YAAY,QAAQ,GAAG,sBAAsB,EAAE,MAAe;QAL9D,SAAI,GAAG,OAAO,CAAC;QACf,SAAI,GAA4B,WAAW,CAAC;QAK1C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;IACpD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,OAAO,CAAC,IAAyB;QACrC,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,IAAI,CAC/B,GAAG,IAAI,CAAC,QAAQ,gBAAgB,EAChC;gBACE,UAAU,EAAE,IAAI,CAAC,IAAI;gBACrB,WAAW,EAAE,IAAI,CAAC,GAAG;gBACrB,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,iBAAiB,EAAE,IAAI,CAAC,UAAU;gBAClC,YAAY,EAAE;oBACZ,IAAI,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AE;aACrC,CAAC;QACJ,CAAC;IACH,CAAC;CACF;AAjHD,sCAiHC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Registry management for MCP-I identity
|
|
3
|
+
*
|
|
4
|
+
* Currently supports KnowThat.ai as the primary registry.
|
|
5
|
+
* Additional registries will be added as directories adopt MCP-I.
|
|
6
|
+
*/
|
|
7
|
+
import { RegistryAdapter, RegistryName, RegistryTier } from "../types";
|
|
8
|
+
/**
|
|
9
|
+
* Registry tier definitions
|
|
10
|
+
*
|
|
11
|
+
* As more directories adopt MCP-I, they will be added to appropriate tiers.
|
|
12
|
+
* Directory maintainers can contact us to discuss integration.
|
|
13
|
+
*/
|
|
14
|
+
export declare const REGISTRY_TIERS: Record<RegistryTier, RegistryName[]>;
|
|
15
|
+
/**
|
|
16
|
+
* Registry factory
|
|
17
|
+
*
|
|
18
|
+
* Manages registry adapters dynamically. New registries can be added
|
|
19
|
+
* without modifying core code.
|
|
20
|
+
*/
|
|
21
|
+
export declare class RegistryFactory {
|
|
22
|
+
private static adapters;
|
|
23
|
+
/**
|
|
24
|
+
* Get a registry adapter by name
|
|
25
|
+
*/
|
|
26
|
+
static getAdapter(name: RegistryName): RegistryAdapter | null;
|
|
27
|
+
/**
|
|
28
|
+
* Get all adapters for a tier
|
|
29
|
+
*/
|
|
30
|
+
static getAdaptersByTier(tier: RegistryTier): RegistryAdapter[];
|
|
31
|
+
/**
|
|
32
|
+
* Register a custom adapter
|
|
33
|
+
*/
|
|
34
|
+
static registerAdapter(name: string, factory: () => RegistryAdapter): void;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Resolve registries from options
|
|
38
|
+
*/
|
|
39
|
+
export declare function resolveRegistries(registries?: RegistryName[] | RegistryTier | {
|
|
40
|
+
include?: RegistryName[] | RegistryTier;
|
|
41
|
+
exclude?: RegistryName[];
|
|
42
|
+
}): RegistryName[];
|
|
43
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/registry/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGvE;;;;;GAKG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,YAAY,EAAE,YAAY,EAAE,CAK/D,CAAC;AAEF;;;;;GAKG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAGpB;IAEH;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,YAAY,GAAG,eAAe,GAAG,IAAI;IAK7D;;OAEG;IACH,MAAM,CAAC,iBAAiB,CAAC,IAAI,EAAE,YAAY,GAAG,eAAe,EAAE;IAO/D;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,eAAe,GAAG,IAAI;CAG3E;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,CAAC,EACP,YAAY,EAAE,GACd,YAAY,GACZ;IAAE,OAAO,CAAC,EAAE,YAAY,EAAE,GAAG,YAAY,CAAC;IAAC,OAAO,CAAC,EAAE,YAAY,EAAE,CAAA;CAAE,GACxE,YAAY,EAAE,CAqChB"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Registry management for MCP-I identity
|
|
4
|
+
*
|
|
5
|
+
* Currently supports KnowThat.ai as the primary registry.
|
|
6
|
+
* Additional registries will be added as directories adopt MCP-I.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.RegistryFactory = exports.REGISTRY_TIERS = void 0;
|
|
10
|
+
exports.resolveRegistries = resolveRegistries;
|
|
11
|
+
const knowthat_1 = require("./knowthat");
|
|
12
|
+
/**
|
|
13
|
+
* Registry tier definitions
|
|
14
|
+
*
|
|
15
|
+
* As more directories adopt MCP-I, they will be added to appropriate tiers.
|
|
16
|
+
* Directory maintainers can contact us to discuss integration.
|
|
17
|
+
*/
|
|
18
|
+
exports.REGISTRY_TIERS = {
|
|
19
|
+
verified: ["knowthat"], // Primary registry for MCP-I
|
|
20
|
+
experimental: [], // Future: Directories in beta/testing phase
|
|
21
|
+
enterprise: [], // Future: Enterprise-specific registries
|
|
22
|
+
all: ["knowthat"], // Currently same as verified
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Registry factory
|
|
26
|
+
*
|
|
27
|
+
* Manages registry adapters dynamically. New registries can be added
|
|
28
|
+
* without modifying core code.
|
|
29
|
+
*/
|
|
30
|
+
class RegistryFactory {
|
|
31
|
+
/**
|
|
32
|
+
* Get a registry adapter by name
|
|
33
|
+
*/
|
|
34
|
+
static getAdapter(name) {
|
|
35
|
+
const factory = this.adapters.get(name);
|
|
36
|
+
return factory ? factory() : null;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Get all adapters for a tier
|
|
40
|
+
*/
|
|
41
|
+
static getAdaptersByTier(tier) {
|
|
42
|
+
const registries = exports.REGISTRY_TIERS[tier] || [];
|
|
43
|
+
return registries
|
|
44
|
+
.map((name) => this.getAdapter(name))
|
|
45
|
+
.filter((adapter) => adapter !== null);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Register a custom adapter
|
|
49
|
+
*/
|
|
50
|
+
static registerAdapter(name, factory) {
|
|
51
|
+
this.adapters.set(name, factory);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.RegistryFactory = RegistryFactory;
|
|
55
|
+
RegistryFactory.adapters = new Map([
|
|
56
|
+
["knowthat", () => new knowthat_1.KnowThatRegistry()],
|
|
57
|
+
// Future registries will be added here as they adopt MCP-I
|
|
58
|
+
]);
|
|
59
|
+
/**
|
|
60
|
+
* Resolve registries from options
|
|
61
|
+
*/
|
|
62
|
+
function resolveRegistries(registries) {
|
|
63
|
+
// Default to 'verified' tier
|
|
64
|
+
if (!registries) {
|
|
65
|
+
return exports.REGISTRY_TIERS.verified;
|
|
66
|
+
}
|
|
67
|
+
// Array of specific registries
|
|
68
|
+
if (Array.isArray(registries)) {
|
|
69
|
+
return registries;
|
|
70
|
+
}
|
|
71
|
+
// Tier name
|
|
72
|
+
if (typeof registries === "string") {
|
|
73
|
+
return exports.REGISTRY_TIERS[registries] || [];
|
|
74
|
+
}
|
|
75
|
+
// Config object with include/exclude
|
|
76
|
+
const config = registries;
|
|
77
|
+
let included = [];
|
|
78
|
+
if (config.include) {
|
|
79
|
+
if (Array.isArray(config.include)) {
|
|
80
|
+
included = config.include;
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
included = exports.REGISTRY_TIERS[config.include] || [];
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
// Default to 'verified' if no include specified
|
|
88
|
+
included = exports.REGISTRY_TIERS.verified;
|
|
89
|
+
}
|
|
90
|
+
// Apply exclusions
|
|
91
|
+
if (config.exclude && config.exclude.length > 0) {
|
|
92
|
+
return included.filter((name) => !config.exclude.includes(name));
|
|
93
|
+
}
|
|
94
|
+
return included;
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/registry/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AA2DH,8CA0CC;AAlGD,yCAA8C;AAE9C;;;;;GAKG;AACU,QAAA,cAAc,GAAyC;IAClE,QAAQ,EAAE,CAAC,UAAU,CAAC,EAAG,6BAA6B;IACtD,YAAY,EAAE,EAAE,EAAS,4CAA4C;IACrE,UAAU,EAAE,EAAE,EAAW,yCAAyC;IAClE,GAAG,EAAE,CAAC,UAAU,CAAC,EAAQ,6BAA6B;CACvD,CAAC;AAEF;;;;;GAKG;AACH,MAA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CAAC;IAC1D,CAAC;IAED,qCAAqC;IACrC,MAAM,MAAM,GAAG,UAAU,CAAC;IAC1B,IAAI,QAAQ,GAAmB,EAAE,CAAC;IAElC,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACnB,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;YAClC,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC;QAC5B,CAAC;aAAM,CAAC;YACN,QAAQ,GAAG,sBAAc,CAAC,MAAM,CAAC,OAAuB,CAAC,IAAI,EAAE,CAAC;QAClE,CAAC;IACH,CAAC;SAAM,CAAC;QACN,gDAAgD;QAChD,QAAQ,GAAG,sBAAc,CAAC,QAAQ,CAAC;IACrC,CAAC;IAED,mBAAmB;IACnB,IAAI,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAChD,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,OAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IACpE,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* KnowThat.ai Registry Adapter
|
|
3
|
+
* Primary registry that can host DIDs
|
|
4
|
+
*/
|
|
5
|
+
import { RegistryAdapter, RegistryPublishData, RegistryPublishResult, RegistryStatus } from '../types';
|
|
6
|
+
export declare class KnowThatRegistry implements RegistryAdapter {
|
|
7
|
+
name: string;
|
|
8
|
+
type: 'primary' | 'secondary';
|
|
9
|
+
private endpoint;
|
|
10
|
+
constructor(endpoint?: string);
|
|
11
|
+
/**
|
|
12
|
+
* Primary registration - creates DID and hosts DID document
|
|
13
|
+
*/
|
|
14
|
+
publish(data: RegistryPublishData): Promise<RegistryPublishResult>;
|
|
15
|
+
/**
|
|
16
|
+
* Verify agent exists and is valid
|
|
17
|
+
*/
|
|
18
|
+
verify(did: string): Promise<boolean>;
|
|
19
|
+
/**
|
|
20
|
+
* Get agent status in KnowThat registry
|
|
21
|
+
*/
|
|
22
|
+
getStatus(did: string): Promise<RegistryStatus>;
|
|
23
|
+
/**
|
|
24
|
+
* Extract agent slug from DID
|
|
25
|
+
*/
|
|
26
|
+
private extractAgentSlug;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=knowthat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowthat.d.ts","sourceRoot":"","sources":["../../src/registry/knowthat.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,cAAc,EAEf,MAAM,UAAU,CAAC;AAElB,qBAAa,gBAAiB,YAAW,eAAe;IACtD,IAAI,SAAc;IAClB,IAAI,EAAE,SAAS,GAAG,WAAW,CAAa;IAC1C,OAAO,CAAC,QAAQ,CAAS;gBAEb,QAAQ,SAAwB;IAI5C;;OAEG;IACG,OAAO,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAiDxE;;OAEG;IACG,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAc3C;;OAEG;IACG,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IA2BrD;;OAEG;IACH,OAAO,CAAC,gBAAgB;CAKzB"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* KnowThat.ai Registry Adapter
|
|
4
|
+
* Primary registry that can host DIDs
|
|
5
|
+
*/
|
|
6
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.KnowThatRegistry = void 0;
|
|
11
|
+
const axios_1 = __importDefault(require("axios"));
|
|
12
|
+
class KnowThatRegistry {
|
|
13
|
+
constructor(endpoint = 'https://knowthat.ai') {
|
|
14
|
+
this.name = 'knowthat';
|
|
15
|
+
this.type = 'primary';
|
|
16
|
+
this.endpoint = endpoint;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Primary registration - creates DID and hosts DID document
|
|
20
|
+
*/
|
|
21
|
+
async publish(data) {
|
|
22
|
+
try {
|
|
23
|
+
// For KnowThat, we use the auto-register endpoint for primary registration
|
|
24
|
+
const response = await axios_1.default.post(`${this.endpoint}/api/agents/auto-register`, {
|
|
25
|
+
metadata: {
|
|
26
|
+
name: data.name,
|
|
27
|
+
description: data.description,
|
|
28
|
+
repository: data.repository,
|
|
29
|
+
version: '1.0.0'
|
|
30
|
+
},
|
|
31
|
+
clientInfo: {
|
|
32
|
+
sdkVersion: '0.2.0',
|
|
33
|
+
language: 'typescript',
|
|
34
|
+
platform: 'node'
|
|
35
|
+
},
|
|
36
|
+
// If we already have a public key, send it
|
|
37
|
+
publicKey: data.publicKey || undefined
|
|
38
|
+
}, {
|
|
39
|
+
timeout: 30000,
|
|
40
|
+
headers: {
|
|
41
|
+
'Content-Type': 'application/json',
|
|
42
|
+
'User-Agent': '@kya-os/mcp-i/0.2.0'
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
return {
|
|
46
|
+
success: true,
|
|
47
|
+
registryAgentId: response.data.agent.id,
|
|
48
|
+
profileUrl: response.data.agent.url
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
if (error.response?.status === 429) {
|
|
53
|
+
return {
|
|
54
|
+
success: false,
|
|
55
|
+
error: 'Rate limit exceeded. Please try again later.'
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
success: false,
|
|
60
|
+
error: error.response?.data?.message || error.message || 'Failed to register with KnowThat.ai'
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Verify agent exists and is valid
|
|
66
|
+
*/
|
|
67
|
+
async verify(did) {
|
|
68
|
+
try {
|
|
69
|
+
const agentSlug = this.extractAgentSlug(did);
|
|
70
|
+
const response = await axios_1.default.get(`${this.endpoint}/api/agents/${agentSlug}/verify`, { timeout: 5000 });
|
|
71
|
+
return response.data.valid === true;
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Get agent status in KnowThat registry
|
|
79
|
+
*/
|
|
80
|
+
async getStatus(did) {
|
|
81
|
+
try {
|
|
82
|
+
const agentSlug = this.extractAgentSlug(did);
|
|
83
|
+
const response = await axios_1.default.get(`${this.endpoint}/api/agents/${agentSlug}/status`, { timeout: 5000 });
|
|
84
|
+
return {
|
|
85
|
+
name: this.name,
|
|
86
|
+
status: response.data.verified ? 'active' : 'pending',
|
|
87
|
+
registeredAt: response.data.registeredAt,
|
|
88
|
+
lastSyncAt: new Date().toISOString(),
|
|
89
|
+
type: 'primary',
|
|
90
|
+
registryAgentId: response.data.agentId
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
return {
|
|
95
|
+
name: this.name,
|
|
96
|
+
status: 'failed',
|
|
97
|
+
type: 'primary',
|
|
98
|
+
error: 'Failed to get status',
|
|
99
|
+
lastSyncAt: new Date().toISOString()
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Extract agent slug from DID
|
|
105
|
+
*/
|
|
106
|
+
extractAgentSlug(did) {
|
|
107
|
+
// did:web:knowthat.ai:agents:my-agent -> my-agent
|
|
108
|
+
const parts = did.split(':');
|
|
109
|
+
return parts[parts.length - 1];
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
exports.KnowThatRegistry = KnowThatRegistry;
|
|
113
|
+
//# sourceMappingURL=knowthat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowthat.js","sourceRoot":"","sources":["../../src/registry/knowthat.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAEH,kDAA0B;AAS1B,MAAa,gBAAgB;IAK3B,YAAY,QAAQ,GAAG,qBAAqB;QAJ5C,SAAI,GAAG,UAAU,CAAC;QAClB,SAAI,GAA4B,SAAS,CAAC;QAIxC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,OAAO,CAAC,IAAyB;QACrC,IAAI,CAAC;YACH,2EAA2E;YAC3E,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,IAAI,CAC/B,GAAG,IAAI,CAAC,QAAQ,2BAA2B,EAC3C;gBACE,QAAQ,EAAE;oBACR,IAAI,EAAE,IAAI,CAAC,IAAI;oBACf,WAAW,EAAE,IAAI,CAAC,WAAW;oBAC7B,UAAU,EAAE,IAAI,CAAC,UAAU;oBAC3B,OAAO,EAAE,OAAO;iBACjB;gBACD,UAAU,EAAE;oBACV,UAAU,EAAE,OAAO;oBACnB,QAAQ,EAAE,YAAY;oBACtB,QAAQ,EAAE,MAAM;iBACjB;gBACD,2CAA2C;gBAC3C,SAAS,EAAE,IAAI,CAAC,SAAS,IAAI,SAAS;aACvC,EACD;gBACE,OAAO,EAAE,KAAK;gBACd,OAAO,EAAE;oBACP,cAAc,EAAE,kBAAkB;oBAClC,YAAY,EAAE,qBAAqB;iBACpC;aACF,CACF,CAAC;YAEF,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,eAAe,EAAE,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;gBACvC,UAAU,EAAE,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG;aACpC,CAAC;QACJ,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,IAA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E,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;gBACpC,IAAI,EAAE,SAAS;gBACf,eAAe,EAAE,QAAQ,CAAC,IAAI,CAAC,OAAO;aACvC,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,MAAM,EAAE,QAAQ;gBAChB,IAAI,EAAE,SAAS;gBACf,KAAK,EAAE,sBAAsB;gBAC7B,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;aACrC,CAAC;QACJ,CAAC;IACH,CAAC;IAED;;OAEG;IACK,gBAAgB,CAAC,GAAW;QAClC,kDAAkD;QAClD,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC7B,OAAO,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACjC,CAAC;CACF;AApHD,4CAoHC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Smithery.ai Registry Adapter
|
|
3
|
+
* Secondary registry for MCP server discovery
|
|
4
|
+
*/
|
|
5
|
+
import { RegistryAdapter, RegistryPublishData, RegistryPublishResult, RegistryStatus } from '../types';
|
|
6
|
+
export declare class SmitheryRegistry implements RegistryAdapter {
|
|
7
|
+
name: string;
|
|
8
|
+
type: 'primary' | 'secondary';
|
|
9
|
+
private endpoint;
|
|
10
|
+
private apiKey?;
|
|
11
|
+
constructor(endpoint?: string, apiKey?: string);
|
|
12
|
+
/**
|
|
13
|
+
* Publish agent to Smithery directory
|
|
14
|
+
*/
|
|
15
|
+
publish(data: RegistryPublishData): Promise<RegistryPublishResult>;
|
|
16
|
+
/**
|
|
17
|
+
* Verify agent exists in Smithery
|
|
18
|
+
*/
|
|
19
|
+
verify(did: string): Promise<boolean>;
|
|
20
|
+
/**
|
|
21
|
+
* Remove agent from Smithery
|
|
22
|
+
*/
|
|
23
|
+
unpublish(did: string): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* Get agent status in Smithery
|
|
26
|
+
*/
|
|
27
|
+
getStatus(did: string): Promise<RegistryStatus>;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=smithery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smithery.d.ts","sourceRoot":"","sources":["../../src/registry/smithery.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,cAAc,EACf,MAAM,UAAU,CAAC;AAElB,qBAAa,gBAAiB,YAAW,eAAe;IACtD,IAAI,SAAc;IAClB,IAAI,EAAE,SAAS,GAAG,WAAW,CAAe;IAC5C,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,MAAM,CAAC,CAAS;gBAEZ,QAAQ,SAAwB,EAAE,MAAM,CAAC,EAAE,MAAM;IAK7D;;OAEG;IACG,OAAO,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IA2CxE;;OAEG;IACG,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAgB3C;;OAEG;IACG,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAc3C;;OAEG;IACG,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;CA4BtD"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Smithery.ai Registry Adapter
|
|
4
|
+
* Secondary registry for MCP server discovery
|
|
5
|
+
*/
|
|
6
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.SmitheryRegistry = void 0;
|
|
11
|
+
const axios_1 = __importDefault(require("axios"));
|
|
12
|
+
class SmitheryRegistry {
|
|
13
|
+
constructor(endpoint = 'https://smithery.ai', apiKey) {
|
|
14
|
+
this.name = 'smithery';
|
|
15
|
+
this.type = 'secondary';
|
|
16
|
+
this.endpoint = endpoint;
|
|
17
|
+
this.apiKey = apiKey || process.env.SMITHERY_API_KEY;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Publish agent to Smithery directory
|
|
21
|
+
*/
|
|
22
|
+
async publish(data) {
|
|
23
|
+
try {
|
|
24
|
+
// Note: This is a hypothetical API - actual Smithery API may differ
|
|
25
|
+
const response = await axios_1.default.post(`${this.endpoint}/api/v1/agents/import`, {
|
|
26
|
+
name: data.name,
|
|
27
|
+
did: data.did,
|
|
28
|
+
description: data.description,
|
|
29
|
+
repository: data.repository,
|
|
30
|
+
author: data.metadata?.author || 'Unknown',
|
|
31
|
+
category: data.metadata?.category || 'other',
|
|
32
|
+
mcpIdentity: {
|
|
33
|
+
verified: true,
|
|
34
|
+
didHost: 'knowthat.ai',
|
|
35
|
+
verificationUrl: `https://knowthat.ai/api/agents/${data.did}/verify`,
|
|
36
|
+
conformanceLevel: 2
|
|
37
|
+
},
|
|
38
|
+
tags: ['mcp-i-verified', ...(data.metadata?.tags || [])]
|
|
39
|
+
}, {
|
|
40
|
+
timeout: 10000,
|
|
41
|
+
headers: {
|
|
42
|
+
'Content-Type': 'application/json',
|
|
43
|
+
'User-Agent': '@kya-os/mcp-i/0.2.0',
|
|
44
|
+
...(this.apiKey ? { 'X-API-Key': this.apiKey } : {})
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
return {
|
|
48
|
+
success: true,
|
|
49
|
+
registryAgentId: response.data.id,
|
|
50
|
+
profileUrl: response.data.profileUrl || `${this.endpoint}/servers/${response.data.slug}`
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
return {
|
|
55
|
+
success: false,
|
|
56
|
+
error: error.response?.data?.message || error.message || 'Failed to publish to Smithery'
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Verify agent exists in Smithery
|
|
62
|
+
*/
|
|
63
|
+
async verify(did) {
|
|
64
|
+
try {
|
|
65
|
+
const response = await axios_1.default.get(`${this.endpoint}/api/v1/agents/by-did/${encodeURIComponent(did)}`, {
|
|
66
|
+
timeout: 5000,
|
|
67
|
+
headers: this.apiKey ? { 'X-API-Key': this.apiKey } : {}
|
|
68
|
+
});
|
|
69
|
+
return response.data.exists === true;
|
|
70
|
+
}
|
|
71
|
+
catch {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Remove agent from Smithery
|
|
77
|
+
*/
|
|
78
|
+
async unpublish(did) {
|
|
79
|
+
try {
|
|
80
|
+
await axios_1.default.delete(`${this.endpoint}/api/v1/agents/by-did/${encodeURIComponent(did)}`, {
|
|
81
|
+
timeout: 5000,
|
|
82
|
+
headers: this.apiKey ? { 'X-API-Key': this.apiKey } : {}
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
// Ignore errors - agent may not exist
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Get agent status in Smithery
|
|
91
|
+
*/
|
|
92
|
+
async getStatus(did) {
|
|
93
|
+
try {
|
|
94
|
+
const response = await axios_1.default.get(`${this.endpoint}/api/v1/agents/by-did/${encodeURIComponent(did)}/status`, {
|
|
95
|
+
timeout: 5000,
|
|
96
|
+
headers: this.apiKey ? { 'X-API-Key': this.apiKey } : {}
|
|
97
|
+
});
|
|
98
|
+
return {
|
|
99
|
+
name: this.name,
|
|
100
|
+
status: response.data.active ? 'active' : 'pending',
|
|
101
|
+
registeredAt: response.data.createdAt,
|
|
102
|
+
lastSyncAt: new Date().toISOString(),
|
|
103
|
+
type: 'secondary',
|
|
104
|
+
registryAgentId: response.data.id
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
catch (error) {
|
|
108
|
+
return {
|
|
109
|
+
name: this.name,
|
|
110
|
+
status: 'failed',
|
|
111
|
+
type: 'secondary',
|
|
112
|
+
error: 'Not found in Smithery',
|
|
113
|
+
lastSyncAt: new Date().toISOString()
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
exports.SmitheryRegistry = SmitheryRegistry;
|
|
119
|
+
//# sourceMappingURL=smithery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smithery.js","sourceRoot":"","sources":["../../src/registry/smithery.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAEH,kDAA0B;AAQ1B,MAAa,gBAAgB;IAM3B,YAAY,QAAQ,GAAG,qBAAqB,EAAE,MAAe;QAL7D,SAAI,GAAG,UAAU,CAAC;QAClB,SAAI,GAA4B,WAAW,CAAC;QAK1C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;IACvD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,OAAO,CAAC,IAAyB;QACrC,IAAI,CAAC;YACH,oEAAoE;YACpE,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,IAAI,CAC/B,GAAG,IAAI,CAAC,QAAQ,uBAAuB,EACvC;gBACE,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,GAAG,EAAE,IAAI,CAAC,GAAG;gBACb,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,UAAU,EAAE,IAAI,CAAC,UAAU;gBAC3B,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,MAAM,IAAI,SAAS;gBAC1C,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,QAAQ,IAAI,OAAO;gBAC5C,WAAW,EAAE;oBAC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