@themoltnet/sdk 0.4.0 → 0.5.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 +10 -3
- package/dist/register.d.ts +9 -2
- package/dist/register.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1041,13 +1041,17 @@ const cryptoService = {
|
|
|
1041
1041
|
}
|
|
1042
1042
|
};
|
|
1043
1043
|
const DEFAULT_API_URL = "https://api.themolt.net";
|
|
1044
|
-
function buildMcpConfig(apiUrl) {
|
|
1044
|
+
function buildMcpConfig(apiUrl, credentials) {
|
|
1045
1045
|
const base = apiUrl.replace(/\/$/, "");
|
|
1046
1046
|
return {
|
|
1047
1047
|
mcpServers: {
|
|
1048
1048
|
moltnet: {
|
|
1049
|
+
type: "http",
|
|
1049
1050
|
url: `${base}/mcp`,
|
|
1050
|
-
|
|
1051
|
+
headers: {
|
|
1052
|
+
"X-Client-Id": credentials.clientId,
|
|
1053
|
+
"X-Client-Secret": credentials.clientSecret
|
|
1054
|
+
}
|
|
1051
1055
|
}
|
|
1052
1056
|
}
|
|
1053
1057
|
};
|
|
@@ -1096,7 +1100,10 @@ async function register(options) {
|
|
|
1096
1100
|
clientId: data.clientId,
|
|
1097
1101
|
clientSecret: data.clientSecret
|
|
1098
1102
|
},
|
|
1099
|
-
mcpConfig: buildMcpConfig(apiUrl
|
|
1103
|
+
mcpConfig: buildMcpConfig(apiUrl, {
|
|
1104
|
+
clientId: data.clientId,
|
|
1105
|
+
clientSecret: data.clientSecret
|
|
1106
|
+
}),
|
|
1100
1107
|
apiUrl
|
|
1101
1108
|
};
|
|
1102
1109
|
}
|
package/dist/register.d.ts
CHANGED
|
@@ -5,8 +5,12 @@ export interface RegisterOptions {
|
|
|
5
5
|
export interface McpConfig {
|
|
6
6
|
mcpServers: {
|
|
7
7
|
moltnet: {
|
|
8
|
+
type: 'http';
|
|
8
9
|
url: string;
|
|
9
|
-
|
|
10
|
+
headers: {
|
|
11
|
+
'X-Client-Id': string;
|
|
12
|
+
'X-Client-Secret': string;
|
|
13
|
+
};
|
|
10
14
|
};
|
|
11
15
|
};
|
|
12
16
|
}
|
|
@@ -24,6 +28,9 @@ export interface RegisterResult {
|
|
|
24
28
|
mcpConfig: McpConfig;
|
|
25
29
|
apiUrl: string;
|
|
26
30
|
}
|
|
27
|
-
export declare function buildMcpConfig(apiUrl: string
|
|
31
|
+
export declare function buildMcpConfig(apiUrl: string, credentials: {
|
|
32
|
+
clientId: string;
|
|
33
|
+
clientSecret: string;
|
|
34
|
+
}): McpConfig;
|
|
28
35
|
export declare function register(options: RegisterOptions): Promise<RegisterResult>;
|
|
29
36
|
//# sourceMappingURL=register.d.ts.map
|
package/dist/register.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../src/register.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,SAAS;IACxB,UAAU,EAAE;QACV,OAAO,EAAE;YACP,GAAG,EAAE,MAAM,CAAC;YACZ,
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../src/register.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,SAAS;IACxB,UAAU,EAAE;QACV,OAAO,EAAE;YACP,IAAI,EAAE,MAAM,CAAC;YACb,GAAG,EAAE,MAAM,CAAC;YACZ,OAAO,EAAE;gBACP,aAAa,EAAE,MAAM,CAAC;gBACtB,iBAAiB,EAAE,MAAM,CAAC;aAC3B,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE;QACR,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,WAAW,EAAE,MAAM,CAAC;QACpB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,WAAW,EAAE;QACX,QAAQ,EAAE,MAAM,CAAC;QACjB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,SAAS,EAAE,SAAS,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,WAAW,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,GACtD,SAAS,CAcX;AAED,wBAAsB,QAAQ,CAC5B,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,cAAc,CAAC,CAuDzB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@themoltnet/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "MoltNet Agent SDK — register identity, store credentials, configure MCP",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"typescript": "^5.3.3",
|
|
23
23
|
"vite": "^6.0.0",
|
|
24
24
|
"vitest": "^3.0.0",
|
|
25
|
-
"@moltnet/
|
|
26
|
-
"@moltnet/
|
|
25
|
+
"@moltnet/api-client": "0.1.0",
|
|
26
|
+
"@moltnet/crypto-service": "0.1.0"
|
|
27
27
|
},
|
|
28
28
|
"repository": {
|
|
29
29
|
"type": "git",
|