@cubis/foundry 0.3.60 → 0.3.61

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/CHANGELOG.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  All notable changes to this project are documented in this file.
4
4
 
5
+ ## [0.3.61] - 2026-03-05
6
+
7
+ ### Fixed
8
+
9
+ - Extended MCP startup reliability fixes across all supported platforms:
10
+ - project/global Postman MCP runtime targets now prefer static Authorization headers when managed keys are available
11
+ - Stitch header generation now also supports managed static key injection for runtime startup reliability.
12
+ - Unified default managed credential aliases across install paths:
13
+ - Postman default env alias is now `POSTMAN_API_KEY_DEFAULT`
14
+ - Stitch default env alias is now `STITCH_API_KEY_DEFAULT`
15
+ - aligns non-wizard installs with wizard persistence behavior across platforms.
16
+
5
17
  ## [0.3.60] - 2026-03-05
6
18
 
7
19
  ### Fixed
package/dist/cli/core.js CHANGED
@@ -134,7 +134,7 @@ const CODEX_WORKFLOW_SKILL_PREFIX = "workflow-";
134
134
  const CODEX_AGENT_SKILL_PREFIX = "agent-";
135
135
  const TERMINAL_VERIFIER_PROVIDERS = ["codex", "gemini"];
136
136
  const DEFAULT_TERMINAL_VERIFIER = "codex";
137
- const POSTMAN_API_KEY_ENV_VAR = "POSTMAN_API_KEY";
137
+ const POSTMAN_API_KEY_ENV_VAR = "POSTMAN_API_KEY_DEFAULT";
138
138
  const POSTMAN_MODE_TO_URL = Object.freeze({
139
139
  minimal: "https://mcp.postman.com/minimal",
140
140
  code: "https://mcp.postman.com/code",
@@ -151,7 +151,7 @@ const FOUNDRY_MCP_SERVER_ID = "cubis-foundry";
151
151
  const FOUNDRY_MCP_COMMAND = "cbx";
152
152
  const STITCH_SKILL_ID = "stitch";
153
153
  const STITCH_MCP_SERVER_ID = "StitchMCP";
154
- const STITCH_API_KEY_ENV_VAR = "STITCH_API_KEY";
154
+ const STITCH_API_KEY_ENV_VAR = "STITCH_API_KEY_DEFAULT";
155
155
  const STITCH_MCP_URL = "https://stitch.googleapis.com/mcp";
156
156
  const POSTMAN_WORKSPACE_MANUAL_CHOICE = "__postman_workspace_manual__";
157
157
  const CBX_CONFIG_FILENAME = "cbx_config.json";
@@ -3601,24 +3601,32 @@ function resolvePostmanMcpDefinitionPath({ platform, scope, cwd = process.cwd(),
3601
3601
  function resolveStitchMcpDefinitionPath({ scope, cwd = process.cwd() }) {
3602
3602
  return path.join(resolveMcpRootPath({ scope, cwd }), "antigravity", "stitch.json");
3603
3603
  }
3604
- function buildPostmanAuthHeader({ apiKeyEnvVar = POSTMAN_API_KEY_ENV_VAR }) {
3604
+ function buildPostmanAuthHeader({ apiKeyEnvVar = POSTMAN_API_KEY_ENV_VAR, apiKey = null, }) {
3605
+ const normalizedApiKey = normalizePostmanApiKey(apiKey);
3606
+ if (normalizedApiKey) {
3607
+ return `Bearer ${normalizedApiKey}`;
3608
+ }
3605
3609
  return `Bearer \${${apiKeyEnvVar}}`;
3606
3610
  }
3607
- function buildStitchApiHeader({ apiKeyEnvVar = STITCH_API_KEY_ENV_VAR }) {
3611
+ function buildStitchApiHeader({ apiKeyEnvVar = STITCH_API_KEY_ENV_VAR, apiKey = null, }) {
3612
+ const normalizedApiKey = normalizePostmanApiKey(apiKey);
3613
+ if (normalizedApiKey) {
3614
+ return `X-Goog-Api-Key: ${normalizedApiKey}`;
3615
+ }
3608
3616
  return `X-Goog-Api-Key: \${${apiKeyEnvVar}}`;
3609
3617
  }
3610
- function buildPostmanMcpDefinition({ apiKeyEnvVar = POSTMAN_API_KEY_ENV_VAR, mcpUrl = POSTMAN_MCP_URL, }) {
3618
+ function buildPostmanMcpDefinition({ apiKeyEnvVar = POSTMAN_API_KEY_ENV_VAR, apiKey = null, mcpUrl = POSTMAN_MCP_URL, }) {
3611
3619
  return {
3612
3620
  schemaVersion: 1,
3613
3621
  server: POSTMAN_SKILL_ID,
3614
3622
  transport: "http",
3615
3623
  url: mcpUrl,
3616
3624
  headers: {
3617
- Authorization: buildPostmanAuthHeader({ apiKeyEnvVar }),
3625
+ Authorization: buildPostmanAuthHeader({ apiKeyEnvVar, apiKey }),
3618
3626
  },
3619
3627
  };
3620
3628
  }
3621
- function buildStitchMcpDefinition({ apiKeyEnvVar = STITCH_API_KEY_ENV_VAR, mcpUrl = STITCH_MCP_URL, }) {
3629
+ function buildStitchMcpDefinition({ apiKeyEnvVar = STITCH_API_KEY_ENV_VAR, apiKey = null, mcpUrl = STITCH_MCP_URL, }) {
3622
3630
  return {
3623
3631
  schemaVersion: 1,
3624
3632
  server: STITCH_MCP_SERVER_ID,
@@ -3629,17 +3637,17 @@ function buildStitchMcpDefinition({ apiKeyEnvVar = STITCH_API_KEY_ENV_VAR, mcpUr
3629
3637
  "mcp-remote",
3630
3638
  mcpUrl,
3631
3639
  "--header",
3632
- buildStitchApiHeader({ apiKeyEnvVar }),
3640
+ buildStitchApiHeader({ apiKeyEnvVar, apiKey }),
3633
3641
  ],
3634
3642
  env: {},
3635
3643
  };
3636
3644
  }
3637
- function buildVsCodePostmanServer({ apiKeyEnvVar = POSTMAN_API_KEY_ENV_VAR, mcpUrl = POSTMAN_MCP_URL, }) {
3645
+ function buildVsCodePostmanServer({ apiKeyEnvVar = POSTMAN_API_KEY_ENV_VAR, apiKey = null, mcpUrl = POSTMAN_MCP_URL, }) {
3638
3646
  return {
3639
3647
  type: "sse",
3640
3648
  url: mcpUrl,
3641
3649
  headers: {
3642
- Authorization: buildPostmanAuthHeader({ apiKeyEnvVar }),
3650
+ Authorization: buildPostmanAuthHeader({ apiKeyEnvVar, apiKey }),
3643
3651
  },
3644
3652
  };
3645
3653
  }
@@ -3657,12 +3665,12 @@ function buildVsCodeFoundryServer({ scope = "auto" } = {}) {
3657
3665
  env: {},
3658
3666
  };
3659
3667
  }
3660
- function buildCopilotCliPostmanServer({ apiKeyEnvVar = POSTMAN_API_KEY_ENV_VAR, mcpUrl = POSTMAN_MCP_URL, }) {
3668
+ function buildCopilotCliPostmanServer({ apiKeyEnvVar = POSTMAN_API_KEY_ENV_VAR, apiKey = null, mcpUrl = POSTMAN_MCP_URL, }) {
3661
3669
  return {
3662
3670
  type: "http",
3663
3671
  url: mcpUrl,
3664
3672
  headers: {
3665
- Authorization: buildPostmanAuthHeader({ apiKeyEnvVar }),
3673
+ Authorization: buildPostmanAuthHeader({ apiKeyEnvVar, apiKey }),
3666
3674
  },
3667
3675
  tools: ["*"],
3668
3676
  };
@@ -3676,11 +3684,11 @@ function buildCopilotCliFoundryServer({ scope = "auto" } = {}) {
3676
3684
  tools: ["*"],
3677
3685
  };
3678
3686
  }
3679
- function buildGeminiPostmanServer({ apiKeyEnvVar = POSTMAN_API_KEY_ENV_VAR, mcpUrl = POSTMAN_MCP_URL, }) {
3687
+ function buildGeminiPostmanServer({ apiKeyEnvVar = POSTMAN_API_KEY_ENV_VAR, apiKey = null, mcpUrl = POSTMAN_MCP_URL, }) {
3680
3688
  return {
3681
3689
  httpUrl: mcpUrl,
3682
3690
  headers: {
3683
- Authorization: buildPostmanAuthHeader({ apiKeyEnvVar }),
3691
+ Authorization: buildPostmanAuthHeader({ apiKeyEnvVar, apiKey }),
3684
3692
  },
3685
3693
  };
3686
3694
  }
@@ -3691,7 +3699,7 @@ function buildGeminiFoundryServer({ scope = "auto" } = {}) {
3691
3699
  env: {},
3692
3700
  };
3693
3701
  }
3694
- function buildGeminiStitchServer({ apiKeyEnvVar = STITCH_API_KEY_ENV_VAR, mcpUrl = STITCH_MCP_URL, }) {
3702
+ function buildGeminiStitchServer({ apiKeyEnvVar = STITCH_API_KEY_ENV_VAR, apiKey = null, mcpUrl = STITCH_MCP_URL, }) {
3695
3703
  return {
3696
3704
  command: "npx",
3697
3705
  args: [
@@ -3699,7 +3707,7 @@ function buildGeminiStitchServer({ apiKeyEnvVar = STITCH_API_KEY_ENV_VAR, mcpUrl
3699
3707
  "mcp-remote",
3700
3708
  mcpUrl,
3701
3709
  "--header",
3702
- buildStitchApiHeader({ apiKeyEnvVar }),
3710
+ buildStitchApiHeader({ apiKeyEnvVar, apiKey }),
3703
3711
  ],
3704
3712
  env: {},
3705
3713
  };
@@ -4113,6 +4121,8 @@ async function applyPostmanMcpForPlatform({ platform, mcpScope, apiKeyEnvVar, mc
4113
4121
  const workspaceRoot = findWorkspaceRoot(cwd);
4114
4122
  const warnings = [];
4115
4123
  const foundryScope = mcpScope === "global" ? "global" : "project";
4124
+ const resolvedPostmanApiKey = normalizePostmanApiKey(process.env[apiKeyEnvVar || POSTMAN_API_KEY_ENV_VAR]);
4125
+ const resolvedStitchApiKey = normalizePostmanApiKey(process.env[stitchApiKeyEnvVar || STITCH_API_KEY_ENV_VAR]);
4116
4126
  if (platform === "antigravity") {
4117
4127
  const settingsPath = mcpScope === "global"
4118
4128
  ? path.join(os.homedir(), ".gemini", "settings.json")
@@ -4129,6 +4139,7 @@ async function applyPostmanMcpForPlatform({ platform, mcpScope, apiKeyEnvVar, mc
4129
4139
  if (includePostmanMcp) {
4130
4140
  mcpServers[POSTMAN_SKILL_ID] = buildGeminiPostmanServer({
4131
4141
  apiKeyEnvVar,
4142
+ apiKey: resolvedPostmanApiKey,
4132
4143
  mcpUrl,
4133
4144
  });
4134
4145
  }
@@ -4143,6 +4154,7 @@ async function applyPostmanMcpForPlatform({ platform, mcpScope, apiKeyEnvVar, mc
4143
4154
  if (includeStitchMcp) {
4144
4155
  mcpServers[STITCH_MCP_SERVER_ID] = buildGeminiStitchServer({
4145
4156
  apiKeyEnvVar: stitchApiKeyEnvVar,
4157
+ apiKey: resolvedStitchApiKey,
4146
4158
  mcpUrl: stitchMcpUrl,
4147
4159
  });
4148
4160
  }
@@ -4176,6 +4188,7 @@ async function applyPostmanMcpForPlatform({ platform, mcpScope, apiKeyEnvVar, mc
4176
4188
  if (includePostmanMcp) {
4177
4189
  mcpServers[POSTMAN_SKILL_ID] = buildCopilotCliPostmanServer({
4178
4190
  apiKeyEnvVar,
4191
+ apiKey: resolvedPostmanApiKey,
4179
4192
  mcpUrl,
4180
4193
  });
4181
4194
  }
@@ -4198,6 +4211,7 @@ async function applyPostmanMcpForPlatform({ platform, mcpScope, apiKeyEnvVar, mc
4198
4211
  if (includePostmanMcp) {
4199
4212
  servers[POSTMAN_SKILL_ID] = buildVsCodePostmanServer({
4200
4213
  apiKeyEnvVar,
4214
+ apiKey: resolvedPostmanApiKey,
4201
4215
  mcpUrl,
4202
4216
  });
4203
4217
  }
@@ -4237,6 +4251,7 @@ async function applyPostmanMcpForPlatform({ platform, mcpScope, apiKeyEnvVar, mc
4237
4251
  if (includePostmanMcp) {
4238
4252
  servers[POSTMAN_SKILL_ID] = buildVsCodePostmanServer({
4239
4253
  apiKeyEnvVar,
4254
+ apiKey: resolvedPostmanApiKey,
4240
4255
  mcpUrl,
4241
4256
  });
4242
4257
  }
@@ -4713,6 +4728,7 @@ async function configurePostmanInstallArtifacts({ platform, scope, profilePaths,
4713
4728
  });
4714
4729
  const mcpDefinitionContent = `${JSON.stringify(buildPostmanMcpDefinition({
4715
4730
  apiKeyEnvVar: effectiveApiKeyEnvVar,
4731
+ apiKey: envApiKey,
4716
4732
  mcpUrl: effectiveMcpUrl,
4717
4733
  }), null, 2)}\n`;
4718
4734
  mcpDefinitionResult = await writeGeneratedArtifact({
@@ -4730,6 +4746,7 @@ async function configurePostmanInstallArtifacts({ platform, scope, profilePaths,
4730
4746
  });
4731
4747
  const stitchMcpDefinitionContent = `${JSON.stringify(buildStitchMcpDefinition({
4732
4748
  apiKeyEnvVar: effectiveStitchApiKeyEnvVar,
4749
+ apiKey: envStitchApiKey,
4733
4750
  mcpUrl: effectiveStitchMcpUrl,
4734
4751
  }), null, 2)}\n`;
4735
4752
  stitchMcpDefinitionResult = await writeGeneratedArtifact({
@@ -4844,6 +4861,8 @@ async function applyPostmanConfigArtifacts({ platform, mcpScope, configValue, dr
4844
4861
  const stitchEnabled = Boolean(stitchState);
4845
4862
  const stitchApiKeyEnvVar = normalizePostmanApiKey(stitchState?.apiKeyEnvVar) || STITCH_API_KEY_ENV_VAR;
4846
4863
  const stitchMcpUrl = stitchState?.mcpUrl || STITCH_MCP_URL;
4864
+ const resolvedPostmanApiKey = normalizePostmanApiKey(process.env[postmanApiKeyEnvVar]);
4865
+ const resolvedStitchApiKey = normalizePostmanApiKey(process.env[stitchApiKeyEnvVar]);
4847
4866
  const mcpDefinitionPath = resolvePostmanMcpDefinitionPath({
4848
4867
  platform,
4849
4868
  scope: mcpScope,
@@ -4851,6 +4870,7 @@ async function applyPostmanConfigArtifacts({ platform, mcpScope, configValue, dr
4851
4870
  });
4852
4871
  const mcpDefinitionContent = `${JSON.stringify(buildPostmanMcpDefinition({
4853
4872
  apiKeyEnvVar: postmanApiKeyEnvVar,
4873
+ apiKey: resolvedPostmanApiKey,
4854
4874
  mcpUrl: postmanMcpUrl,
4855
4875
  }), null, 2)}\n`;
4856
4876
  const mcpDefinitionResult = await writeGeneratedArtifact({
@@ -4867,6 +4887,7 @@ async function applyPostmanConfigArtifacts({ platform, mcpScope, configValue, dr
4867
4887
  });
4868
4888
  const stitchMcpDefinitionContent = `${JSON.stringify(buildStitchMcpDefinition({
4869
4889
  apiKeyEnvVar: stitchApiKeyEnvVar,
4890
+ apiKey: resolvedStitchApiKey,
4870
4891
  mcpUrl: stitchMcpUrl,
4871
4892
  }), null, 2)}\n`;
4872
4893
  stitchMcpDefinitionResult = await writeGeneratedArtifact({