@insforge/mcp 1.2.4-deployment.0 → 1.2.4-deployment.1

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.
@@ -1117,11 +1117,28 @@ var sendEmailResponseSchema = z18.object({});
1117
1117
 
1118
1118
  // node_modules/@insforge/shared-schemas/dist/deployments.schema.js
1119
1119
  import { z as z19 } from "zod";
1120
+ var deploymentStatusSchema = z19.enum([
1121
+ "WAITING",
1122
+ // Record created, waiting for client to upload zip to S3
1123
+ "UPLOADING",
1124
+ // Server is downloading from S3 and uploading to Vercel
1125
+ "QUEUED",
1126
+ // Vercel: deployment queued
1127
+ "BUILDING",
1128
+ // Vercel: deployment building
1129
+ "READY",
1130
+ // Vercel: deployment ready
1131
+ "ERROR",
1132
+ // Vercel: deployment failed
1133
+ "CANCELED"
1134
+ // Vercel: deployment canceled
1135
+ ]);
1120
1136
  var deploymentSchema = z19.object({
1121
1137
  id: z19.string().uuid(),
1122
- deploymentId: z19.string(),
1138
+ deploymentId: z19.string().nullable(),
1139
+ // Provider's deployment ID, null until deployment starts
1123
1140
  provider: z19.string(),
1124
- status: z19.string(),
1141
+ status: deploymentStatusSchema,
1125
1142
  url: z19.string().nullable(),
1126
1143
  metadata: z19.record(z19.unknown()).nullable(),
1127
1144
  createdAt: z19.string(),
@@ -1137,20 +1154,20 @@ var projectSettingsSchema = z20.object({
1137
1154
  devCommand: z20.string().nullable().optional(),
1138
1155
  rootDirectory: z20.string().nullable().optional()
1139
1156
  });
1140
- var deploymentFileSchema = z20.object({
1141
- file: z20.string(),
1142
- data: z20.string()
1143
- });
1144
1157
  var envVarSchema = z20.object({
1145
1158
  key: z20.string(),
1146
1159
  value: z20.string()
1147
1160
  });
1148
- var createDeploymentRequestSchema = z20.object({
1149
- name: z20.string().optional(),
1150
- files: z20.array(deploymentFileSchema).optional(),
1161
+ var createDeploymentResponseSchema = z20.object({
1162
+ id: z20.string().uuid(),
1163
+ uploadUrl: z20.string().url(),
1164
+ uploadFields: z20.record(z20.string())
1165
+ // Required for S3 presigned POST (policy, signature, key, etc.)
1166
+ });
1167
+ var startDeploymentRequestSchema = z20.object({
1151
1168
  projectSettings: projectSettingsSchema.optional(),
1152
- meta: z20.record(z20.string()).optional(),
1153
- envVars: z20.array(envVarSchema).optional()
1169
+ envVars: z20.array(envVarSchema).optional(),
1170
+ meta: z20.record(z20.string()).optional()
1154
1171
  });
1155
1172
  var listDeploymentsResponseSchema = z20.object({
1156
1173
  deployments: z20.array(deploymentSchema)
@@ -2001,32 +2018,71 @@ To: Your current project directory
2001
2018
  );
2002
2019
  server.tool(
2003
2020
  "create-deployment",
2004
- "Create a new deployment with files, project settings, and environment variables",
2021
+ "Deploy source code from a directory. Zips files, uploads to cloud storage, and triggers deployment with optional environment variables and project settings.",
2005
2022
  {
2006
- ...createDeploymentRequestSchema.shape
2023
+ sourceDirectory: z21.string().describe("Path to the source directory containing files to deploy"),
2024
+ ...startDeploymentRequestSchema.shape
2007
2025
  },
2008
- withUsageTracking("create-deployment", async ({ name, files, projectSettings, meta, envVars }) => {
2026
+ withUsageTracking("create-deployment", async ({ sourceDirectory, projectSettings, envVars, meta }) => {
2009
2027
  try {
2010
- const requestBody = {};
2011
- if (name) requestBody.name = name;
2012
- if (files) requestBody.files = files;
2013
- if (projectSettings) requestBody.projectSettings = projectSettings;
2014
- if (meta) requestBody.meta = meta;
2015
- if (envVars) requestBody.envVars = envVars;
2016
- const response = await fetch2(`${API_BASE_URL}/api/deployments`, {
2028
+ const createResponse = await fetch2(`${API_BASE_URL}/api/deployments`, {
2029
+ method: "POST",
2030
+ headers: {
2031
+ "x-api-key": getApiKey(),
2032
+ "Content-Type": "application/json"
2033
+ }
2034
+ });
2035
+ const createResult = await handleApiResponse(createResponse);
2036
+ const { id: deploymentId, uploadUrl, uploadFields } = createResult;
2037
+ const zipPath = `${tmpdir()}/deployment-${deploymentId}.zip`;
2038
+ const excludePatterns = [
2039
+ "node_modules/*",
2040
+ ".git/*",
2041
+ ".next/*",
2042
+ "dist/*",
2043
+ ".env.local",
2044
+ ".DS_Store"
2045
+ ];
2046
+ const excludeArgs = excludePatterns.map((p) => `-x "${p}"`).join(" ");
2047
+ await execAsync(`cd "${sourceDirectory}" && zip -r "${zipPath}" . ${excludeArgs}`);
2048
+ const zipBuffer = await fs.readFile(zipPath);
2049
+ const uploadFormData = new FormData();
2050
+ for (const [key, value] of Object.entries(uploadFields)) {
2051
+ uploadFormData.append(key, value);
2052
+ }
2053
+ uploadFormData.append("file", zipBuffer, {
2054
+ filename: "deployment.zip",
2055
+ contentType: "application/zip"
2056
+ });
2057
+ const uploadResponse = await fetch2(uploadUrl, {
2058
+ method: "POST",
2059
+ body: uploadFormData,
2060
+ headers: uploadFormData.getHeaders()
2061
+ });
2062
+ if (!uploadResponse.ok) {
2063
+ const uploadError = await uploadResponse.text();
2064
+ throw new Error(`Failed to upload zip file: ${uploadError}`);
2065
+ }
2066
+ await fs.unlink(zipPath).catch(() => {
2067
+ });
2068
+ const startBody = {};
2069
+ if (projectSettings) startBody.projectSettings = projectSettings;
2070
+ if (envVars) startBody.envVars = envVars;
2071
+ if (meta) startBody.meta = meta;
2072
+ const startResponse = await fetch2(`${API_BASE_URL}/api/deployments/${deploymentId}/start`, {
2017
2073
  method: "POST",
2018
2074
  headers: {
2019
2075
  "x-api-key": getApiKey(),
2020
2076
  "Content-Type": "application/json"
2021
2077
  },
2022
- body: JSON.stringify(requestBody)
2078
+ body: JSON.stringify(startBody)
2023
2079
  });
2024
- const result = await handleApiResponse(response);
2080
+ const startResult = await handleApiResponse(startResponse);
2025
2081
  return await addBackgroundContext({
2026
2082
  content: [
2027
2083
  {
2028
2084
  type: "text",
2029
- text: formatSuccessMessage("Deployment created", result) + "\n\nNote: You can check deployment status by querying the system.deployments table."
2085
+ text: formatSuccessMessage("Deployment started", startResult) + "\n\nNote: You can check deployment status by querying the system.deployments table."
2030
2086
  }
2031
2087
  ]
2032
2088
  });
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  registerInsforgeTools
4
- } from "./chunk-ELPXCUYK.js";
4
+ } from "./chunk-WAOSJ573.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-ELPXCUYK.js";
4
+ } from "./chunk-WAOSJ573.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.0",
3
+ "version": "1.2.4-deployment.1",
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",
@@ -36,7 +36,7 @@
36
36
  "server.json"
37
37
  ],
38
38
  "dependencies": {
39
- "@insforge/shared-schemas": "1.1.36-deployment.1",
39
+ "@insforge/shared-schemas": "1.1.36-deployment.2",
40
40
  "@modelcontextprotocol/sdk": "^1.15.1",
41
41
  "@types/express": "^5.0.3",
42
42
  "commander": "^14.0.0",