mcp-inflight 0.2.4 → 0.3.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.
Files changed (2) hide show
  1. package/dist/index.js +89 -113
  2. package/package.json +8 -8
package/dist/index.js CHANGED
@@ -986,7 +986,8 @@ async function deployProject(files, options, log) {
986
986
  vmTier: options.vmTier || "Micro",
987
987
  projectName: options.projectName,
988
988
  workspaceId: options.workspaceId || auth.defaultWorkspaceId,
989
- gitInfo: options.gitInfo
989
+ gitInfo: options.gitInfo,
990
+ diffSummary: options.diffSummary
990
991
  })
991
992
  });
992
993
  if (!response.ok && !response.headers.get("content-type")?.includes("text/event-stream")) {
@@ -1227,7 +1228,8 @@ async function finalizeSandbox(sandboxId, options, log) {
1227
1228
  port: options.port,
1228
1229
  projectName: options.projectName,
1229
1230
  workspaceId: options.workspaceId,
1230
- gitInfo: options.gitInfo
1231
+ gitInfo: options.gitInfo,
1232
+ diffSummary: options.diffSummary
1231
1233
  })
1232
1234
  });
1233
1235
  if (!response.ok && !response.headers.get("content-type")?.includes("text/event-stream")) {
@@ -1284,7 +1286,8 @@ async function deployProjectChunked(fileChunks, options, log) {
1284
1286
  port: options.port,
1285
1287
  projectName: options.projectName,
1286
1288
  workspaceId,
1287
- gitInfo: options.gitInfo
1289
+ gitInfo: options.gitInfo,
1290
+ diffSummary: options.diffSummary
1288
1291
  },
1289
1292
  log
1290
1293
  );
@@ -1926,6 +1929,9 @@ async function deployPrototype(args, log) {
1926
1929
  const dirtyMarker = gitInfo.isDirty ? " (modified)" : "";
1927
1930
  await log(`Git: ${gitInfo.branch}@${gitInfo.commitShort}${dirtyMarker}`);
1928
1931
  }
1932
+ if (args.diffSummary) {
1933
+ await log(`Diff summary provided: ${args.diffSummary.keyChanges.length} key changes`);
1934
+ }
1929
1935
  if (!projectInfo.compatibility.canDeploy) {
1930
1936
  throw new Error(
1931
1937
  `Project cannot be deployed: ${projectInfo.compatibility.issues.join(", ")}`
@@ -1997,124 +2003,74 @@ async function deployPrototype(args, log) {
1997
2003
  }
1998
2004
  const totalSize = calculateTotalSize(files);
1999
2005
  await log(`Found ${fileCount} files (${(totalSize / 1024 / 1024).toFixed(1)} MB)`);
2000
- let existingSandbox;
2001
- try {
2002
- const sandboxes = await listSandboxes();
2003
- const projectName = path5.basename(projectPath);
2004
- existingSandbox = sandboxes.find(
2005
- (s) => s.projectName === projectName && s.status === "running"
2006
- );
2007
- } catch {
2008
- }
2009
2006
  let result;
2010
- if (existingSandbox) {
2011
- await log(`Found existing sandbox: ${existingSandbox.sandboxId}`);
2012
- await log("Syncing files...");
2013
- try {
2014
- const syncResult = await syncProject(
2015
- existingSandbox.sandboxId,
2016
- files,
2017
- {
2018
- restartServer: true,
2019
- startCommand: projectInfo.startCommand,
2020
- port: projectInfo.port,
2021
- gitInfo: gitInfo || void 0
2022
- },
2023
- log
2024
- );
2025
- const inflightUrl = existingSandbox.inflightUrl || "";
2026
- const inflightVersionId = existingSandbox.inflightVersionId || "";
2027
- result = {
2028
- url: syncResult.sandboxUrl,
2029
- sandboxId: existingSandbox.sandboxId,
2030
- projectType: projectInfo.type,
2031
- synced: true,
2032
- inflightUrl,
2033
- inflightVersionId,
2034
- startCommand: projectInfo.startCommand,
2035
- port: projectInfo.port,
2036
- packageManager: projectInfo.detectedPackageManager,
2037
- isMonorepo: projectInfo.isMonorepo,
2038
- vmTier: projectInfo.sizing.recommendedTier,
2039
- embedCheck
2040
- };
2041
- const elapsed = ((Date.now() - startTime) / 1e3).toFixed(1);
2042
- await log(`Sync complete in ${elapsed}s`);
2043
- } catch (syncError) {
2044
- const errorMsg = syncError instanceof Error ? syncError.message : String(syncError);
2045
- await log(`Sync failed, creating new sandbox: ${errorMsg}`, "warning");
2046
- existingSandbox = void 0;
2047
- }
2048
- }
2049
- if (!existingSandbox) {
2050
- const useChunkedUpload = needsChunkedUpload(files);
2051
- if (useChunkedUpload) {
2052
- const totalSize2 = calculateTotalSize(files);
2053
- await log(`Large project detected (${(totalSize2 / 1024 / 1024).toFixed(1)} MB), using chunked upload...`);
2054
- const fileChunks = chunkFiles(files);
2055
- await log(`Split into ${fileChunks.length} chunks`);
2056
- const deployResult = await deployProjectChunked(
2057
- fileChunks,
2058
- {
2059
- projectType: projectInfo.type,
2060
- installCommand: projectInfo.installCommand || void 0,
2061
- startCommand: projectInfo.startCommand,
2062
- port: projectInfo.port,
2063
- vmTier: projectInfo.sizing.recommendedTier,
2064
- projectName: path5.basename(projectPath),
2065
- workspaceId: args.workspaceId,
2066
- gitInfo: gitInfo || void 0
2067
- },
2068
- log
2069
- );
2070
- result = {
2071
- url: deployResult.sandboxUrl,
2072
- sandboxId: deployResult.sandboxId,
2007
+ const useChunkedUpload = needsChunkedUpload(files);
2008
+ if (useChunkedUpload) {
2009
+ const totalSize2 = calculateTotalSize(files);
2010
+ await log(`Large project detected (${(totalSize2 / 1024 / 1024).toFixed(1)} MB), using chunked upload...`);
2011
+ const fileChunks = chunkFiles(files);
2012
+ await log(`Split into ${fileChunks.length} chunks`);
2013
+ const deployResult = await deployProjectChunked(
2014
+ fileChunks,
2015
+ {
2073
2016
  projectType: projectInfo.type,
2074
- synced: false,
2075
- inflightUrl: deployResult.inflightUrl,
2076
- inflightVersionId: deployResult.versionId,
2017
+ installCommand: projectInfo.installCommand || void 0,
2077
2018
  startCommand: projectInfo.startCommand,
2078
2019
  port: projectInfo.port,
2079
- packageManager: projectInfo.detectedPackageManager,
2080
- isMonorepo: projectInfo.isMonorepo,
2081
2020
  vmTier: projectInfo.sizing.recommendedTier,
2082
- embedCheck
2083
- };
2084
- } else {
2085
- await log("Deploying via InFlight API...");
2086
- const deployResult = await deployProject(
2087
- files,
2088
- {
2089
- projectType: projectInfo.type,
2090
- installCommand: projectInfo.installCommand || void 0,
2091
- startCommand: projectInfo.startCommand,
2092
- port: projectInfo.port,
2093
- vmTier: projectInfo.sizing.recommendedTier,
2094
- projectName: path5.basename(projectPath),
2095
- workspaceId: args.workspaceId,
2096
- gitInfo: gitInfo || void 0
2097
- },
2098
- log
2099
- );
2100
- result = {
2101
- url: deployResult.sandboxUrl,
2102
- sandboxId: deployResult.sandboxId,
2021
+ projectName: path5.basename(projectPath),
2022
+ workspaceId: args.workspaceId,
2023
+ gitInfo: gitInfo || void 0,
2024
+ diffSummary: args.diffSummary || void 0
2025
+ },
2026
+ log
2027
+ );
2028
+ result = {
2029
+ url: deployResult.sandboxUrl,
2030
+ sandboxId: deployResult.sandboxId,
2031
+ projectType: projectInfo.type,
2032
+ inflightUrl: deployResult.inflightUrl,
2033
+ inflightVersionId: deployResult.versionId,
2034
+ startCommand: projectInfo.startCommand,
2035
+ port: projectInfo.port,
2036
+ packageManager: projectInfo.detectedPackageManager,
2037
+ isMonorepo: projectInfo.isMonorepo,
2038
+ vmTier: projectInfo.sizing.recommendedTier,
2039
+ embedCheck
2040
+ };
2041
+ } else {
2042
+ await log("Deploying via InFlight API...");
2043
+ const deployResult = await deployProject(
2044
+ files,
2045
+ {
2103
2046
  projectType: projectInfo.type,
2104
- synced: false,
2105
- inflightUrl: deployResult.inflightUrl,
2106
- inflightVersionId: deployResult.versionId,
2047
+ installCommand: projectInfo.installCommand || void 0,
2107
2048
  startCommand: projectInfo.startCommand,
2108
2049
  port: projectInfo.port,
2109
- packageManager: projectInfo.detectedPackageManager,
2110
- isMonorepo: projectInfo.isMonorepo,
2111
2050
  vmTier: projectInfo.sizing.recommendedTier,
2112
- embedCheck
2113
- };
2114
- }
2115
- const elapsed = ((Date.now() - startTime) / 1e3).toFixed(1);
2116
- await log(`Deploy complete in ${elapsed}s`);
2051
+ projectName: path5.basename(projectPath),
2052
+ workspaceId: args.workspaceId,
2053
+ gitInfo: gitInfo || void 0,
2054
+ diffSummary: args.diffSummary || void 0
2055
+ },
2056
+ log
2057
+ );
2058
+ result = {
2059
+ url: deployResult.sandboxUrl,
2060
+ sandboxId: deployResult.sandboxId,
2061
+ projectType: projectInfo.type,
2062
+ inflightUrl: deployResult.inflightUrl,
2063
+ inflightVersionId: deployResult.versionId,
2064
+ startCommand: projectInfo.startCommand,
2065
+ port: projectInfo.port,
2066
+ packageManager: projectInfo.detectedPackageManager,
2067
+ isMonorepo: projectInfo.isMonorepo,
2068
+ vmTier: projectInfo.sizing.recommendedTier,
2069
+ embedCheck
2070
+ };
2117
2071
  }
2072
+ const elapsed = ((Date.now() - startTime) / 1e3).toFixed(1);
2073
+ await log(`Deploy complete in ${elapsed}s`);
2118
2074
  if (hadUncommittedChanges && result.inflightVersionId) {
2119
2075
  const newCommit = autoCommitForShare(projectPath, result.inflightVersionId);
2120
2076
  if (newCommit) {
@@ -2188,6 +2144,27 @@ function createServer2() {
2188
2144
  workspaceId: {
2189
2145
  type: "string",
2190
2146
  description: "InFlight workspace ID to create the version in. If not provided, uses the last-used workspace or the user's first workspace."
2147
+ },
2148
+ diffSummary: {
2149
+ type: "object",
2150
+ description: "Claude-generated summary of git changes for review question generation. Provide this when sharing a feature branch with commits.",
2151
+ properties: {
2152
+ summary: {
2153
+ type: "string",
2154
+ description: "A 2-3 sentence product-focused summary of the changes. Focus on user-visible changes, not internal code details."
2155
+ },
2156
+ keyChanges: {
2157
+ type: "array",
2158
+ items: { type: "string" },
2159
+ description: "List of key user-visible changes (e.g., 'Added dark mode toggle', 'Redesigned checkout flow')"
2160
+ },
2161
+ affectedAreas: {
2162
+ type: "array",
2163
+ items: { type: "string" },
2164
+ description: "UI/feature areas affected by the changes (e.g., 'Settings page', 'Navigation', 'Forms')"
2165
+ }
2166
+ },
2167
+ required: ["summary", "keyChanges"]
2191
2168
  }
2192
2169
  },
2193
2170
  required: ["path"]
@@ -2262,7 +2239,7 @@ function createServer2() {
2262
2239
  if (name === "share") {
2263
2240
  const deployArgs = args;
2264
2241
  const result = await deployPrototype(deployArgs, log);
2265
- const message = result.synced ? `Files synced. InFlight: ${result.inflightUrl}` : `Project shared successfully. InFlight: ${result.inflightUrl}`;
2242
+ const message = `Project shared successfully. InFlight: ${result.inflightUrl}`;
2266
2243
  return {
2267
2244
  content: [
2268
2245
  {
@@ -2281,7 +2258,6 @@ function createServer2() {
2281
2258
  },
2282
2259
  // Embed check results - shows if there are iframe embedding issues
2283
2260
  embedCheck: result.embedCheck,
2284
- synced: result.synced ?? false,
2285
2261
  inflightUrl: result.inflightUrl,
2286
2262
  inflightVersionId: result.inflightVersionId,
2287
2263
  message
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-inflight",
3
- "version": "0.2.4",
3
+ "version": "0.3.0",
4
4
  "description": "MCP server for sharing prototypes via InFlight",
5
5
  "author": "InFlight <hello@inflight.co>",
6
6
  "homepage": "https://github.com/inflight/mcp-inflight",
@@ -13,11 +13,6 @@
13
13
  "bin": {
14
14
  "mcp-inflight": "dist/index.js"
15
15
  },
16
- "scripts": {
17
- "build": "tsup",
18
- "dev": "tsup --watch",
19
- "typecheck": "tsc --noEmit"
20
- },
21
16
  "dependencies": {
22
17
  "@modelcontextprotocol/sdk": "^1.0.0"
23
18
  },
@@ -36,5 +31,10 @@
36
31
  "share",
37
32
  "deploy"
38
33
  ],
39
- "license": "MIT"
40
- }
34
+ "license": "MIT",
35
+ "scripts": {
36
+ "build": "tsup",
37
+ "dev": "tsup --watch",
38
+ "typecheck": "tsc --noEmit"
39
+ }
40
+ }