@insforge/mcp 1.2.4-deployment.2 → 1.2.4-deployment.4
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.
|
@@ -7,6 +7,8 @@ import { promises as fs } from "fs";
|
|
|
7
7
|
import { exec } from "child_process";
|
|
8
8
|
import { promisify } from "util";
|
|
9
9
|
import { tmpdir } from "os";
|
|
10
|
+
import { createWriteStream } from "fs";
|
|
11
|
+
import archiver from "archiver";
|
|
10
12
|
|
|
11
13
|
// src/shared/response-handler.ts
|
|
12
14
|
async function handleApiResponse(response) {
|
|
@@ -2037,17 +2039,44 @@ To: Your current project directory
|
|
|
2037
2039
|
const createResult = await handleApiResponse(createResponse);
|
|
2038
2040
|
const { id: deploymentId, uploadUrl, uploadFields } = createResult;
|
|
2039
2041
|
const zipPath = `${tmpdir()}/deployment-${deploymentId}.zip`;
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
"
|
|
2043
|
-
|
|
2044
|
-
"
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2042
|
+
await new Promise((resolve, reject) => {
|
|
2043
|
+
const output = createWriteStream(zipPath);
|
|
2044
|
+
const archive = archiver("zip", { zlib: { level: 9 } });
|
|
2045
|
+
archive.on("error", (err) => reject(err));
|
|
2046
|
+
output.on("error", (err) => reject(err));
|
|
2047
|
+
output.on("close", () => resolve());
|
|
2048
|
+
archive.pipe(output);
|
|
2049
|
+
archive.glob("**/*", {
|
|
2050
|
+
cwd: sourceDirectory,
|
|
2051
|
+
ignore: [
|
|
2052
|
+
"node_modules/**",
|
|
2053
|
+
".git/**",
|
|
2054
|
+
".next/**",
|
|
2055
|
+
"dist/**",
|
|
2056
|
+
".env.local",
|
|
2057
|
+
".DS_Store"
|
|
2058
|
+
],
|
|
2059
|
+
dot: true
|
|
2060
|
+
// Include dotfiles like .env
|
|
2061
|
+
});
|
|
2062
|
+
archive.finalize();
|
|
2063
|
+
});
|
|
2064
|
+
const zipBuffer = await (async () => {
|
|
2065
|
+
const maxRetries = 3;
|
|
2066
|
+
for (let attempt = 0; attempt < maxRetries; attempt++) {
|
|
2067
|
+
try {
|
|
2068
|
+
return await fs.readFile(zipPath);
|
|
2069
|
+
} catch (err) {
|
|
2070
|
+
const isEBUSY = err instanceof Error && "code" in err && err.code === "EBUSY";
|
|
2071
|
+
if (isEBUSY && attempt < maxRetries - 1) {
|
|
2072
|
+
await new Promise((r) => setTimeout(r, 100 * (attempt + 1)));
|
|
2073
|
+
continue;
|
|
2074
|
+
}
|
|
2075
|
+
throw err;
|
|
2076
|
+
}
|
|
2077
|
+
}
|
|
2078
|
+
throw new Error("Failed to read zip file after retries");
|
|
2079
|
+
})();
|
|
2051
2080
|
const uploadFormData = new FormData();
|
|
2052
2081
|
for (const [key, value] of Object.entries(uploadFields)) {
|
|
2053
2082
|
uploadFormData.append(key, value);
|
package/dist/http-server.js
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@insforge/mcp",
|
|
3
|
-
"version": "1.2.4-deployment.
|
|
3
|
+
"version": "1.2.4-deployment.4",
|
|
4
4
|
"description": "MCP (Model Context Protocol) server for Insforge backend-as-a-service",
|
|
5
5
|
"mcpName": "io.github.InsForge/insforge-mcp",
|
|
6
6
|
"type": "module",
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"@insforge/shared-schemas": "1.1.37-deployment.1",
|
|
40
40
|
"@modelcontextprotocol/sdk": "^1.15.1",
|
|
41
41
|
"@types/express": "^5.0.3",
|
|
42
|
+
"archiver": "^7.0.1",
|
|
42
43
|
"commander": "^14.0.0",
|
|
43
44
|
"express": "^5.1.0",
|
|
44
45
|
"form-data": "^4.0.4",
|
|
@@ -46,6 +47,7 @@
|
|
|
46
47
|
"zod": "^3.23.8"
|
|
47
48
|
},
|
|
48
49
|
"devDependencies": {
|
|
50
|
+
"@types/archiver": "^7.0.0",
|
|
49
51
|
"@types/node": "^20.10.5",
|
|
50
52
|
"rimraf": "^5.0.5",
|
|
51
53
|
"tsup": "^8.5.0",
|