@syntica/mcp 2.4.0 → 2.4.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.
package/dist/index.js CHANGED
@@ -70636,6 +70636,13 @@ var viewLogs = (vars) => {
70636
70636
  };
70637
70637
  var updateCard = () => ({ label: "Update card", target: "billing:payment" });
70638
70638
  var biggerMachine = () => ({ label: "Bigger machine", target: "billing" });
70639
+ var machineTarget = (vars) => vars["appId"] ? `app:${vars["appId"]}/settings/machine?env=${v(vars, "environment")}` : null;
70640
+ var freeUpSpace = (vars) => {
70641
+ const t = machineTarget(vars);
70642
+ return t === null ? null : { label: "Free up space", target: t };
70643
+ };
70644
+ var diskLine = (x) => `${v(x, "appName")} ${v(x, "environment")}: disk ${v(x, "usedPct")}% full (images ${v(x, "imagesGb")}, database ${v(x, "databaseGb")}).`;
70645
+ var backupsNudge = (x) => v(x, "noBackups") === "true" ? " This environment has no backups. Add backups \u2197" : "";
70639
70646
  var environments = (vars) => `${v(vars, "environmentCount")} ${v(vars, "environmentCount") === "1" ? "environment" : "environments"}`;
70640
70647
  var NOTIFICATION_TYPES = {
70641
70648
  // Off by default (#1365): every deploy told everyone it started and finished,
@@ -70674,7 +70681,7 @@ var NOTIFICATION_TYPES = {
70674
70681
  emailDefault: true,
70675
70682
  emailTemplateId: "deploy-failed",
70676
70683
  title: (x) => `Deploy failed \xB7 ${v(x, "appName")}`,
70677
- body: (x) => `${v(x, "appName")} \xB7 ${v(x, "environment")} \u2014 deploy failed. Check the logs.`,
70684
+ body: (x) => `${v(x, "appName")} \xB7 ${v(x, "environment")} \u2014 ${v(x, "reason") !== "" ? v(x, "reason") : "deploy failed. Check the logs."}`,
70678
70685
  target: logsTarget,
70679
70686
  action: viewLogs
70680
70687
  },
@@ -70776,6 +70783,33 @@ var NOTIFICATION_TYPES = {
70776
70783
  target: appTarget,
70777
70784
  action: biggerMachine
70778
70785
  },
70786
+ // Emitted by agent-gateway from the agent's disk.report, once per crossing.
70787
+ "usage.disk.nearing": {
70788
+ key: "usage.disk.nearing",
70789
+ category: "usage",
70790
+ severity: "warning",
70791
+ audience: "admins",
70792
+ inAppDefault: true,
70793
+ emailDefault: true,
70794
+ emailTemplateId: "usage-disk-nearing",
70795
+ title: (x) => `Disk filling up \xB7 ${v(x, "appName")}`,
70796
+ body: (x) => `${diskLine(x)}${backupsNudge(x)}`,
70797
+ target: machineTarget,
70798
+ action: freeUpSpace
70799
+ },
70800
+ "usage.disk.reached": {
70801
+ key: "usage.disk.reached",
70802
+ category: "usage",
70803
+ severity: "error",
70804
+ audience: "admins",
70805
+ inAppDefault: true,
70806
+ emailDefault: true,
70807
+ emailTemplateId: "usage-disk-reached",
70808
+ title: (x) => `Disk almost full \xB7 ${v(x, "appName")}`,
70809
+ body: (x) => `${diskLine(x)} Postgres may not be able to start.${backupsNudge(x)}`,
70810
+ target: machineTarget,
70811
+ action: freeUpSpace
70812
+ },
70779
70813
  // Emitted by deploy-service's CpuCreditMonitorService. Every node runs in
70780
70814
  // "standard" credit mode, so an app that keeps out-running its tier's CPU
70781
70815
  // baseline drains its burst credits and then visibly slows down. These two
@@ -71212,6 +71246,14 @@ function inferProviderFromHost(host) {
71212
71246
  // libs/shared/src/types/cloud-account.ts
71213
71247
  var CLOUD_ACCOUNT_UPDATE_REQUIRED_MESSAGE = "This cloud account runs an older Syntica stack. Update the stack in your AWS console, then try again.";
71214
71248
 
71249
+ // libs/shared/src/types/node-disk.ts
71250
+ function diskUsedPct(report) {
71251
+ return report.totalBytes > 0 ? Math.round(report.usedBytes / report.totalBytes * 100) : 0;
71252
+ }
71253
+ function formatDiskGb(bytes) {
71254
+ return `${(bytes / 1024 ** 3).toFixed(1)} GB`;
71255
+ }
71256
+
71215
71257
  // libs/shared/src/cloud-account/customer-account.ts
71216
71258
  function isCustomerAccount(account) {
71217
71259
  return (account?.orgId ?? null) !== null;
@@ -73426,7 +73468,7 @@ async function handleAppStartInstance(args) {
73426
73468
  }
73427
73469
  var appReprovisionInstanceTool = {
73428
73470
  name: "app_reprovision_instance",
73429
- description: "Carry out a pending instance-type change on the infrastructure: resizes the stopped instance onto the type its node tier asks for, keeping the instance, its data volume, and its private IP. The instance must be stopped, and it is left stopped afterwards \u2014 start it with app_start_instance when the resize is done. Use this after app_set_node_tier when starting the instance is refused for a type mismatch.",
73471
+ description: "Carry out a pending instance-type change on the infrastructure: resizes the stopped instance onto the type its node tier asks for, keeping the instance, its data volume, and its private IP. The instance must be stopped, and it is left stopped afterwards \u2014 start it with app_start_instance when the resize is done. If the new tier has a larger disk, the data volume grows too, and the filesystem follows when the instance next starts. A smaller tier never shrinks the disk. Use this after app_set_node_tier when starting the instance is refused for a type mismatch.",
73430
73472
  annotations: { readOnlyHint: false, destructiveHint: true },
73431
73473
  inputSchema: NODE_ACTION_SCHEMA
73432
73474
  };
@@ -74257,6 +74299,34 @@ var appServicesListTool = {
74257
74299
  required: ["token", "applicationId", "environment"]
74258
74300
  }
74259
74301
  };
74302
+ var appDiskUsageTool = {
74303
+ name: "app_disk_usage",
74304
+ description: 'Show how full the disk of a deployed environment is: free space, and how much goes to images, build cache and databases. Use this when a deploy fails on disk space, a database will not start, or the logs say "No space left on device".',
74305
+ annotations: { readOnlyHint: true, destructiveHint: false },
74306
+ inputSchema: {
74307
+ type: "object",
74308
+ properties: {
74309
+ token: { type: "string", description: "JWT session token from org_verify_otp" },
74310
+ applicationId: { type: "string", description: "Application ID" },
74311
+ environment: { type: "string", enum: [...ENVIRONMENT_NAMES], description: "Target environment" }
74312
+ },
74313
+ required: ["token", "applicationId", "environment"]
74314
+ }
74315
+ };
74316
+ var appDiskCleanupTool = {
74317
+ name: "app_disk_cleanup",
74318
+ description: "Free up disk space on a deployed environment by removing old images and build cache, then start the services that were down because the disk was full, the database first. Databases and their data are never touched. The next deploy builds a little slower.",
74319
+ annotations: { readOnlyHint: false, destructiveHint: false },
74320
+ inputSchema: {
74321
+ type: "object",
74322
+ properties: {
74323
+ token: { type: "string", description: "JWT session token from org_verify_otp" },
74324
+ applicationId: { type: "string", description: "Application ID" },
74325
+ environment: { type: "string", enum: [...ENVIRONMENT_NAMES], description: "Target environment" }
74326
+ },
74327
+ required: ["token", "applicationId", "environment"]
74328
+ }
74329
+ };
74260
74330
  var appServiceStartTool = {
74261
74331
  name: "app_service_start",
74262
74332
  description: "Start a specific service within a deployed application.",
@@ -74334,6 +74404,23 @@ var appServiceTailLogsTool = {
74334
74404
  required: ["token", "applicationId", "environment", "service"]
74335
74405
  }
74336
74406
  };
74407
+ function diskUsageText(report) {
74408
+ if (report === null) {
74409
+ return "Disk usage is unknown: this server runs an older agent. Deploy once to update it.";
74410
+ }
74411
+ const free = report.totalBytes - report.usedBytes;
74412
+ return `Disk ${String(diskUsedPct(report))}% full, ${formatDiskGb(free)} free of ${formatDiskGb(report.totalBytes)}. Images ${formatDiskGb(report.imagesBytes)}, build cache ${formatDiskGb(report.buildCacheBytes)}, databases ${formatDiskGb(report.volumesBytes)}.`;
74413
+ }
74414
+ function diskCleanupText(result) {
74415
+ const parts = [`Freed ${formatDiskGb(result.freedBytes)}, ${formatDiskGb(result.freeBytes)} free now.`];
74416
+ if (result.started.length > 0) {
74417
+ parts.push(`Running again: ${result.started.join(", ")}.`);
74418
+ }
74419
+ if (result.failed.length > 0) {
74420
+ parts.push(`Could not start: ${result.failed.join(", ")}. Check their logs.`);
74421
+ }
74422
+ return parts.join(" ");
74423
+ }
74337
74424
  async function resolveApp2(applicationId, token) {
74338
74425
  const res = await fetch(`${config2.services.applicationServiceUrl}/applications/${encodeURIComponent(applicationId)}`, {
74339
74426
  headers: { Authorization: `Bearer ${token}` }
@@ -74362,6 +74449,40 @@ async function handleAppServicesList(args) {
74362
74449
  const json = await res.json();
74363
74450
  return { content: [{ type: "text", text: JSON.stringify(json) }], isError: !res.ok };
74364
74451
  }
74452
+ async function handleAppDiskUsage(args) {
74453
+ const token = args["token"];
74454
+ if (!token) {
74455
+ return notAuthenticatedResult();
74456
+ }
74457
+ const environment = args["environment"];
74458
+ const app = await resolveApp2(args["applicationId"], token);
74459
+ if (!app) {
74460
+ return appNotFoundResult(args["applicationId"]);
74461
+ }
74462
+ const res = await fetch(agentUrl2(app.orgId, app.id, environment, "/disk"), { headers: authHeaders(token) });
74463
+ if (!res.ok) {
74464
+ return failFromResponse(res, "Could not read disk usage");
74465
+ }
74466
+ const json = await res.json();
74467
+ return { content: [{ type: "text", text: diskUsageText(json.data) }] };
74468
+ }
74469
+ async function handleAppDiskCleanup(args) {
74470
+ const token = args["token"];
74471
+ if (!token) {
74472
+ return notAuthenticatedResult();
74473
+ }
74474
+ const environment = args["environment"];
74475
+ const app = await resolveApp2(args["applicationId"], token);
74476
+ if (!app) {
74477
+ return appNotFoundResult(args["applicationId"]);
74478
+ }
74479
+ const res = await fetch(agentUrl2(app.orgId, app.id, environment, "/disk/cleanup"), { method: "POST", headers: authHeaders(token) });
74480
+ if (!res.ok) {
74481
+ return failFromResponse(res, "Disk cleanup failed");
74482
+ }
74483
+ const json = await res.json();
74484
+ return { content: [{ type: "text", text: diskCleanupText(json.data) }] };
74485
+ }
74365
74486
  async function handleAppServiceStart(args) {
74366
74487
  const token = args["token"];
74367
74488
  if (!token) {
@@ -74587,6 +74708,8 @@ async function handleAppHealth(args) {
74587
74708
  }
74588
74709
  var tools20 = [
74589
74710
  { definition: appServicesListTool, handle: handleAppServicesList },
74711
+ { definition: appDiskUsageTool, handle: handleAppDiskUsage },
74712
+ { definition: appDiskCleanupTool, handle: handleAppDiskCleanup },
74590
74713
  { definition: appServiceStartTool, handle: handleAppServiceStart },
74591
74714
  { definition: appServiceStopTool, handle: handleAppServiceStop },
74592
74715
  { definition: appServiceRestartTool, handle: handleAppServiceRestart },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syntica/mcp",
3
- "version": "2.4.0",
3
+ "version": "2.4.1",
4
4
  "description": "MCP server and skills for deploying applications on Syntica from your coding agent (Claude Code, Codex, Cursor, Windsurf, Gemini, Copilot CLI)",
5
5
  "mcpName": "io.syntica/mcp",
6
6
  "bin": {
@@ -8,7 +8,7 @@
8
8
  {
9
9
  "name": "syntica",
10
10
  "description": "Deploy, run and debug your applications on Syntica from Claude Code — real infrastructure, a live URL, no DevOps required.",
11
- "version": "2.4.0",
11
+ "version": "2.4.1",
12
12
  "source": "./"
13
13
  }
14
14
  ]
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "syntica",
3
3
  "description": "Deploy, run and debug your applications on Syntica from your coding agent — real infrastructure, a live URL, no DevOps required.",
4
- "version": "2.4.0",
4
+ "version": "2.4.1",
5
5
  "author": {
6
6
  "name": "Syntica",
7
7
  "email": "support@syntica.io",