@cloudverse/gridx-mcp 0.1.0 → 0.1.2
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 +6 -0
- package/dist/apps/mcp-server/src/main.js +2 -1
- package/dist/main.js +1 -1
- package/dist/packages/sdk/src/index.js +10 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
1
2
|
import { readFileSync } from "node:fs";
|
|
2
3
|
import { homedir } from "node:os";
|
|
3
4
|
import { resolve } from "node:path";
|
|
4
|
-
import { GridxClient } from "@gridx
|
|
5
|
+
import { GridxClient } from "@cloudverse/gridx-sdk";
|
|
5
6
|
function parseArg(flag) {
|
|
6
7
|
const index = process.argv.indexOf(flag);
|
|
7
8
|
if (index === -1) {
|
package/dist/main.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { readFileSync } from "node:fs";
|
|
2
2
|
import { homedir } from "node:os";
|
|
3
3
|
import { resolve } from "node:path";
|
|
4
|
-
import { GridxClient } from "@gridx
|
|
4
|
+
import { GridxClient } from "@cloudverse/gridx-sdk";
|
|
5
5
|
function parseArg(flag) {
|
|
6
6
|
const index = process.argv.indexOf(flag);
|
|
7
7
|
if (index === -1) {
|
|
@@ -13,7 +13,10 @@ export class GridxClient {
|
|
|
13
13
|
serviceKey;
|
|
14
14
|
constructor(options) {
|
|
15
15
|
this.baseUrl = options.baseUrl.replace(/\/+$/, "");
|
|
16
|
-
this.serviceKey = options.serviceKey;
|
|
16
|
+
this.serviceKey = options.serviceAccountKey ?? options.serviceKey ?? "";
|
|
17
|
+
if (!this.serviceKey) {
|
|
18
|
+
throw new GridxSdkError("A GridX service account key is required.", 401);
|
|
19
|
+
}
|
|
17
20
|
}
|
|
18
21
|
whoAmI() {
|
|
19
22
|
return this.get("/v1/service-accounts/whoami");
|
|
@@ -30,6 +33,9 @@ export class GridxClient {
|
|
|
30
33
|
getSession(sessionId) {
|
|
31
34
|
return this.get(`/v1/sessions/${sessionId}`);
|
|
32
35
|
}
|
|
36
|
+
getSessionTrace(sessionId) {
|
|
37
|
+
return this.get(`/v1/sessions/${sessionId}/trace`);
|
|
38
|
+
}
|
|
33
39
|
listMarketplaceCandidates(filters) {
|
|
34
40
|
return this.post("/v1/routes/candidates", filters ?? {});
|
|
35
41
|
}
|
|
@@ -81,6 +87,9 @@ export class GridxClient {
|
|
|
81
87
|
listWebhookEndpoints() {
|
|
82
88
|
return this.get("/v1/webhooks");
|
|
83
89
|
}
|
|
90
|
+
listWebhookDeliveries(webhookId) {
|
|
91
|
+
return this.get(`/v1/webhooks/${webhookId}/deliveries`);
|
|
92
|
+
}
|
|
84
93
|
createWebhookEndpoint(body) {
|
|
85
94
|
return this.post("/v1/webhooks", body);
|
|
86
95
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudverse/gridx-mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
"access": "public"
|
|
16
16
|
},
|
|
17
17
|
"scripts": {
|
|
18
|
-
"build": "tsc -p tsconfig.json",
|
|
18
|
+
"build": "tsc -p tsconfig.json && node -e \"const fs=require('fs'); const p='dist/apps/mcp-server/src/main.js'; const c=fs.readFileSync(p,'utf8'); if(!c.startsWith('#!/usr/bin/env node')) fs.writeFileSync(p, '#!/usr/bin/env node\\n'+c);\"",
|
|
19
19
|
"dev": "tsx src/main.ts",
|
|
20
20
|
"lint": "tsc -p tsconfig.json --noEmit",
|
|
21
21
|
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@gridx
|
|
24
|
+
"@cloudverse/gridx-sdk": "^0.1.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"tsx": "^4.20.5"
|