@syntica/mcp 2.3.0 → 2.3.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
@@ -58539,6 +58539,20 @@ var CAPABILITIES = {
58539
58539
  default: false,
58540
58540
  adminGrantableOnAnyPlan: true
58541
58541
  },
58542
+ /**
58543
+ * Interim, for testing BYOC with pilot and beta orgs (#1274): a staging or
58544
+ * production environment whose node runs in the org's own cloud account
58545
+ * counts as included, with no slot and no Stripe charge. Hosted environments
58546
+ * are never affected. Remove or replace once #1275 decides
58547
+ * how BYOC environments are priced.
58548
+ */
58549
+ byoc_unlimited_environments: {
58550
+ key: "byoc_unlimited_environments",
58551
+ kind: "feature",
58552
+ scope: "org",
58553
+ default: false,
58554
+ adminGrantableOnAnyPlan: true
58555
+ },
58542
58556
  /** Platform-mode scans included per calendar month. 0 means "use the default". */
58543
58557
  sonarqube_scan_quota: { key: "sonarqube_scan_quota", kind: "quota", scope: "org", default: 0 },
58544
58558
  /**
@@ -60739,6 +60753,14 @@ function inferProviderFromHost(host) {
60739
60753
  // libs/shared/src/types/cloud-account.ts
60740
60754
  var CLOUD_ACCOUNT_UPDATE_REQUIRED_MESSAGE = "This cloud account runs an older Syntica stack. Update the stack in your AWS console, then try again.";
60741
60755
 
60756
+ // libs/shared/src/cloud-account/customer-account.ts
60757
+ function isCustomerAccount(account) {
60758
+ return (account?.orgId ?? null) !== null;
60759
+ }
60760
+ function customerAccountTiers(tiers) {
60761
+ return tiers.filter((t) => t.isActive && !t.isCapped);
60762
+ }
60763
+
60742
60764
  // libs/shared/src/utils/billing-period.ts
60743
60765
  var import_common16 = __toESM(require_common2());
60744
60766
  function nextBillingAnchor(now) {
@@ -61185,7 +61207,7 @@ async function resolveCloudAccount(token, orgId, ref) {
61185
61207
  })
61186
61208
  };
61187
61209
  }
61188
- return { cloudAccountId: account.id };
61210
+ return { cloudAccountId: account.id, inCustomerAccount: account.orgId !== null };
61189
61211
  }
61190
61212
  var orgListCloudAccountsTool = {
61191
61213
  name: "org_list_cloud_accounts",
@@ -62593,6 +62615,18 @@ var appEnableEnvironmentTool = {
62593
62615
  required: ["token", "orgId", "applicationId", "environment"]
62594
62616
  }
62595
62617
  };
62618
+ async function byocNeedsNoSlot(token, orgId) {
62619
+ try {
62620
+ const res = await fetch(`${config2.services.accountServiceUrl}/entitlements/active?orgId=${encodeURIComponent(orgId)}`, { headers: authHeaders(token) });
62621
+ if (!res.ok) {
62622
+ return false;
62623
+ }
62624
+ const json = await res.json();
62625
+ return json.data?.byocUnlimitedEnvironments === true;
62626
+ } catch {
62627
+ return false;
62628
+ }
62629
+ }
62596
62630
  async function handleAppEnableEnvironment(args) {
62597
62631
  const token = args["token"];
62598
62632
  if (!token) {
@@ -62605,11 +62639,22 @@ async function handleAppEnableEnvironment(args) {
62605
62639
  return fail({ code: "INVALID_INPUT", message: "orgId, applicationId and environment are required", hint: "Use the ids from org_list_orgs and app_list." });
62606
62640
  }
62607
62641
  const cloudAccountRef = args["cloudAccount"];
62642
+ let inCustomerAccount = false;
62608
62643
  if (cloudAccountRef !== void 0) {
62609
62644
  const resolved = await resolveCloudAccount(token, orgId, cloudAccountRef);
62610
62645
  if ("failure" in resolved) {
62611
62646
  return resolved.failure;
62612
62647
  }
62648
+ inCustomerAccount = resolved.inCustomerAccount;
62649
+ }
62650
+ if (environment !== "dev" && inCustomerAccount && await byocNeedsNoSlot(token, orgId)) {
62651
+ return ok({
62652
+ enabled: true,
62653
+ slotNeeded: false,
62654
+ environment,
62655
+ note: `No slot is needed for ${environment} in the organisation's own cloud account, so nothing was billed.`,
62656
+ next: `Set its machine size with app_set_node_tier and pass the same cloudAccount, which sets up ${environment} in that account. Then deploy with org_deploy.`
62657
+ });
62613
62658
  }
62614
62659
  if (environment !== "dev" && args["confirm"] !== true) {
62615
62660
  let monthlyPriceCents = null;
@@ -62939,17 +62984,47 @@ async function getJson(url, token) {
62939
62984
  }
62940
62985
  var appListNodeTiersTool = {
62941
62986
  name: "app_list_node_tiers",
62942
- description: "List the node tiers (instance sizes) available to an organisation, so the user can choose what an application's environment should run on. Returns the org's plan key alongside the tiers. On the Pay-as-you-go plan every tier is billed and the free tier is NOT selectable \u2014 always ask the user which tier to use rather than assuming one. On the free plan the free tier is the only option. Set the chosen tier with app_set_node_tier.",
62987
+ description: "List the node tiers (instance sizes) available to an organisation, so the user can choose what an application's environment should run on. Returns the org's plan key alongside the tiers. On the Pay-as-you-go plan every tier is billed and the free tier is NOT selectable \u2014 always ask the user which tier to use rather than assuming one. On the free plan the free tier is the only option. Pass applicationId and environment (or cloudAccount for a new application) to get the sizes for that environment: one in the organisation's own cloud account runs on its own AWS bill, so every size is offered whatever the plan, with inCustomerAccount true and mustAsk true. Set the chosen tier with app_set_node_tier.",
62943
62988
  annotations: { readOnlyHint: true, destructiveHint: false },
62944
62989
  inputSchema: {
62945
62990
  type: "object",
62946
62991
  properties: {
62947
62992
  token: { type: "string", description: "JWT session token from org_verify_otp" },
62948
- orgId: { type: "string", description: "Organisation ID" }
62993
+ orgId: { type: "string", description: "Organisation ID" },
62994
+ applicationId: { type: "string", description: "Optional. Application whose environment the size is for. Use with environment." },
62995
+ environment: { type: "string", enum: ["dev", "staging", "production"], description: "Optional. Environment the size is for. Use with applicationId." },
62996
+ cloudAccount: {
62997
+ type: "string",
62998
+ description: "Optional. Cloud account id or name from org_list_cloud_accounts the environment will be created in. Ignored for an environment that already has a machine, which keeps its account."
62999
+ }
62949
63000
  },
62950
63001
  required: ["token", "orgId"]
62951
63002
  }
62952
63003
  };
63004
+ async function inCustomerAccountFor(token, orgId, args) {
63005
+ const applicationId = args["applicationId"];
63006
+ const environment = args["environment"];
63007
+ const cloudAccountRef = args["cloudAccount"];
63008
+ if (applicationId && environment) {
63009
+ const nodes = await getJson(
63010
+ `${config2.services.applicationServiceUrl}/applications/${encodeURIComponent(applicationId)}/nodes`,
63011
+ token
63012
+ );
63013
+ const node = nodes?.find((n) => n.environment === environment);
63014
+ if (node) {
63015
+ return node.inCustomerAccount ?? isCustomerAccount(node.cloudAccount);
63016
+ }
63017
+ }
63018
+ if (cloudAccountRef !== void 0) {
63019
+ const resolved = await resolveCloudAccount(token, orgId, cloudAccountRef);
63020
+ return "failure" in resolved ? resolved : resolved.inCustomerAccount;
63021
+ }
63022
+ if (!applicationId) {
63023
+ return false;
63024
+ }
63025
+ const listed = await listCloudAccounts(token, orgId);
63026
+ return "accounts" in listed && listed.accounts.some((a) => isCustomerAccount(a) && a.isDefault && isPlaceable(a));
63027
+ }
62953
63028
  async function handleAppListNodeTiers(args) {
62954
63029
  const token = args["token"];
62955
63030
  if (!token) {
@@ -62969,8 +63044,22 @@ async function handleAppListNodeTiers(args) {
62969
63044
  );
62970
63045
  const planKey = plan?.planKey ?? "unknown";
62971
63046
  const isPayg = planKey === "payg";
63047
+ const inCustomerAccount = await inCustomerAccountFor(token, orgId, args);
63048
+ if (typeof inCustomerAccount !== "boolean") {
63049
+ return inCustomerAccount.failure;
63050
+ }
63051
+ if (inCustomerAccount) {
63052
+ return ok({
63053
+ planKey,
63054
+ inCustomerAccount: true,
63055
+ selectable: customerAccountTiers(tiers).map((t) => ({ id: t.id, name: t.name, isFree: t.isFree, instanceType: t.awsInstanceType, storageGb: t.storageGb })),
63056
+ mustAsk: true,
63057
+ note: "This environment runs in the organisation's own cloud account, on its own AWS bill. Syntica charges nothing for the size, and the plan does not limit it. Ask the user which size to use."
63058
+ });
63059
+ }
62972
63060
  return ok({
62973
63061
  planKey,
63062
+ inCustomerAccount: false,
62974
63063
  // Mirrors deploy-service's selectableTiers: the free tier belongs to the
62975
63064
  // free plan's single dev instance and is not offered to a paying org.
62976
63065
  selectable: tiers.filter((t) => isPayg ? !t.isFree : t.isFree).map((t) => ({ id: t.id, name: t.name, isFree: t.isFree, instanceType: t.awsInstanceType, storageGb: t.storageGb })),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syntica/mcp",
3
- "version": "2.3.0",
3
+ "version": "2.3.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.3.0",
11
+ "version": "2.3.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.3.0",
4
+ "version": "2.3.1",
5
5
  "author": {
6
6
  "name": "Syntica",
7
7
  "email": "support@syntica.io",