@insforge/mcp 1.2.4-deployment.4 → 1.2.4-deployment.6

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,7 +7,6 @@ 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
10
  import archiver from "archiver";
12
11
 
13
12
  // src/shared/response-handler.ts
@@ -2038,45 +2037,38 @@ To: Your current project directory
2038
2037
  });
2039
2038
  const createResult = await handleApiResponse(createResponse);
2040
2039
  const { id: deploymentId, uploadUrl, uploadFields } = createResult;
2041
- const zipPath = `${tmpdir()}/deployment-${deploymentId}.zip`;
2042
- await new Promise((resolve, reject) => {
2043
- const output = createWriteStream(zipPath);
2040
+ const zipBuffer = await new Promise((resolve, reject) => {
2044
2041
  const archive = archiver("zip", { zlib: { level: 9 } });
2042
+ const chunks = [];
2043
+ archive.on("data", (chunk) => chunks.push(chunk));
2044
+ archive.on("end", () => resolve(Buffer.concat(chunks)));
2045
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
2046
+ archive.on("warning", (err) => {
2047
+ console.warn("Archiver warning:", err.message);
2061
2048
  });
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;
2049
+ const excludePatterns = [
2050
+ "node_modules",
2051
+ ".git",
2052
+ ".next",
2053
+ "dist",
2054
+ "build",
2055
+ ".env.local",
2056
+ ".DS_Store"
2057
+ ];
2058
+ archive.directory(sourceDirectory, false, (entry) => {
2059
+ const normalizedName = entry.name.replace(/\\/g, "/");
2060
+ for (const pattern of excludePatterns) {
2061
+ if (normalizedName.startsWith(pattern + "/") || normalizedName === pattern || normalizedName.endsWith("/" + pattern) || normalizedName.includes("/" + pattern + "/")) {
2062
+ return false;
2074
2063
  }
2075
- throw err;
2076
2064
  }
2077
- }
2078
- throw new Error("Failed to read zip file after retries");
2079
- })();
2065
+ if (normalizedName.endsWith(".log")) {
2066
+ return false;
2067
+ }
2068
+ return entry;
2069
+ });
2070
+ archive.finalize();
2071
+ });
2080
2072
  const uploadFormData = new FormData();
2081
2073
  for (const [key, value] of Object.entries(uploadFields)) {
2082
2074
  uploadFormData.append(key, value);
@@ -2094,8 +2086,6 @@ To: Your current project directory
2094
2086
  const uploadError = await uploadResponse.text();
2095
2087
  throw new Error(`Failed to upload zip file: ${uploadError}`);
2096
2088
  }
2097
- await fs.unlink(zipPath).catch(() => {
2098
- });
2099
2089
  const startBody = {};
2100
2090
  if (projectSettings) startBody.projectSettings = projectSettings;
2101
2091
  if (envVars) startBody.envVars = envVars;
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  registerInsforgeTools
4
- } from "./chunk-YDPBWOQA.js";
4
+ } from "./chunk-AE5PW7UP.js";
5
5
 
6
6
  // src/http/server.ts
7
7
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  registerInsforgeTools
4
- } from "./chunk-YDPBWOQA.js";
4
+ } from "./chunk-AE5PW7UP.js";
5
5
 
6
6
  // src/stdio/index.ts
7
7
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insforge/mcp",
3
- "version": "1.2.4-deployment.4",
3
+ "version": "1.2.4-deployment.6",
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",