cascade-ai 0.52.0 → 0.53.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.
@@ -224247,7 +224247,7 @@ function reconcilePrice(model, live) {
224247
224247
  }
224248
224248
 
224249
224249
  // src/constants.ts
224250
- var CASCADE_VERSION = "0.52.0";
224250
+ var CASCADE_VERSION = "0.53.0";
224251
224251
  var CASCADE_CONFIG_DIR = ".cascade";
224252
224252
  var CASCADE_MD_FILE = "CASCADE.md";
224253
224253
  var CASCADE_IGNORE_FILE = ".cascadeignore";
@@ -233085,22 +233085,23 @@ var OpenAIProvider = class extends BaseProvider {
233085
233085
 
233086
233086
  // src/providers/azure.ts
233087
233087
  var DEFAULT_AZURE_API_VERSION = "2024-12-01-preview";
233088
+ var AZURE_BASE_MODEL_RULES = [
233089
+ [/gpt-?5\.5/, "gpt-5.5"],
233090
+ [/gpt-?5\.4.*mini/, "gpt-5.4-mini"],
233091
+ [/gpt-?5\.4/, "gpt-5.4"],
233092
+ [/gpt-?5.*nano/, "gpt-5-nano"],
233093
+ [/gpt-?5.*mini/, "gpt-5-mini"],
233094
+ [/gpt-?5/, "gpt-5"],
233095
+ [/gpt-?4\.1-nano/, "gpt-4.1-nano"],
233096
+ [/gpt-?4\.1-mini/, "gpt-4.1-mini"],
233097
+ [/gpt-?4\.1/, "gpt-4.1"],
233098
+ [/gpt-?4o-mini/, "gpt-4o-mini"],
233099
+ [/gpt-?4o/, "gpt-4o"]
233100
+ ];
233101
+ var AZURE_BASE_MODELS = AZURE_BASE_MODEL_RULES.map(([, id]) => id);
233088
233102
  function inferAzureBaseModel(deploymentName) {
233089
233103
  const n8 = deploymentName.toLowerCase();
233090
- const rules = [
233091
- [/gpt-?5\.5/, "gpt-5.5"],
233092
- [/gpt-?5\.4.*mini/, "gpt-5.4-mini"],
233093
- [/gpt-?5\.4/, "gpt-5.4"],
233094
- [/gpt-?5.*nano/, "gpt-5-nano"],
233095
- [/gpt-?5.*mini/, "gpt-5-mini"],
233096
- [/gpt-?5/, "gpt-5"],
233097
- [/gpt-?4\.1-nano/, "gpt-4.1-nano"],
233098
- [/gpt-?4\.1-mini/, "gpt-4.1-mini"],
233099
- [/gpt-?4\.1/, "gpt-4.1"],
233100
- [/gpt-?4o-mini/, "gpt-4o-mini"],
233101
- [/gpt-?4o/, "gpt-4o"]
233102
- ];
233103
- for (const [re3, base] of rules) if (re3.test(n8)) return base;
233104
+ for (const [re3, base] of AZURE_BASE_MODEL_RULES) if (re3.test(n8)) return base;
233104
233105
  return null;
233105
233106
  }
233106
233107
  function azureModelForDeployment(cfg) {
@@ -235059,11 +235060,11 @@ function mcpToolsToGeminiTool(mcpTools, config2 = {}) {
235059
235060
  const functionDeclarations = [];
235060
235061
  const toolNames = /* @__PURE__ */ new Set();
235061
235062
  for (const mcpTool of mcpTools) {
235062
- const mcpToolName = mcpTool.name;
235063
- if (toolNames.has(mcpToolName)) {
235064
- throw new Error(`Duplicate function name ${mcpToolName} found in MCP tools. Please ensure function names are unique.`);
235063
+ const mcpToolName2 = mcpTool.name;
235064
+ if (toolNames.has(mcpToolName2)) {
235065
+ throw new Error(`Duplicate function name ${mcpToolName2} found in MCP tools. Please ensure function names are unique.`);
235065
235066
  }
235066
- toolNames.add(mcpToolName);
235067
+ toolNames.add(mcpToolName2);
235067
235068
  const geminiTool = mcpToGeminiTool(mcpTool, config2);
235068
235069
  if (geminiTool.functionDeclarations) {
235069
235070
  functionDeclarations.push(...geminiTool.functionDeclarations);
@@ -244710,11 +244711,11 @@ var McpCallableTool = class _McpCallableTool {
244710
244711
  _d = false;
244711
244712
  const mcpTool = _c;
244712
244713
  mcpTools.push(mcpTool);
244713
- const mcpToolName = mcpTool.name;
244714
- if (functionMap[mcpToolName]) {
244715
- throw new Error(`Duplicate function name ${mcpToolName} found in MCP tools. Please ensure function names are unique.`);
244714
+ const mcpToolName2 = mcpTool.name;
244715
+ if (functionMap[mcpToolName2]) {
244716
+ throw new Error(`Duplicate function name ${mcpToolName2} found in MCP tools. Please ensure function names are unique.`);
244716
244717
  }
244717
- functionMap[mcpToolName] = mcpClient;
244718
+ functionMap[mcpToolName2] = mcpClient;
244718
244719
  }
244719
244720
  } catch (e_1_1) {
244720
244721
  e_1 = { error: e_1_1 };
@@ -286141,6 +286142,20 @@ ${text}`;
286141
286142
  }
286142
286143
  };
286143
286144
 
286145
+ // src/tools/tool-name.ts
286146
+ var MCP_TOOL_PREFIX = "mcp__";
286147
+ function sanitizeToolNameSegment(segment) {
286148
+ const cleaned = segment.replace(/[^a-zA-Z0-9-]+/g, "_");
286149
+ let start = 0;
286150
+ let end = cleaned.length;
286151
+ while (start < end && cleaned[start] === "_") start++;
286152
+ while (end > start && cleaned[end - 1] === "_") end--;
286153
+ return cleaned.slice(start, end) || "_";
286154
+ }
286155
+ function mcpToolName(serverName, toolName) {
286156
+ return `${MCP_TOOL_PREFIX}${sanitizeToolNameSegment(serverName)}__${sanitizeToolNameSegment(toolName)}`;
286157
+ }
286158
+
286144
286159
  // src/tools/mcp.ts
286145
286160
  var McpToolWrapper = class extends BaseTool {
286146
286161
  name;
@@ -286154,7 +286169,7 @@ var McpToolWrapper = class extends BaseTool {
286154
286169
  this.mcpClient = mcpClient;
286155
286170
  this.serverName = serverName;
286156
286171
  this.toolName = toolName;
286157
- this.name = `mcp::${serverName}::${toolName}`;
286172
+ this.name = mcpToolName(serverName, toolName);
286158
286173
  this.description = `[MCP:${serverName}] ${description}`;
286159
286174
  this.inputSchema = inputSchema;
286160
286175
  }
@@ -308886,6 +308901,7 @@ object-assign/index.js:
308886
308901
  (*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) *)
308887
308902
  */
308888
308903
 
308904
+ exports.AZURE_BASE_MODELS = AZURE_BASE_MODELS;
308889
308905
  exports.AZURE_BASE_URL_TEMPLATE = AZURE_BASE_URL_TEMPLATE;
308890
308906
  exports.AuditLogger = AuditLogger;
308891
308907
  exports.CASCADE_AUDIT_FILE = CASCADE_AUDIT_FILE;
package/dist/index.cjs CHANGED
@@ -1891,7 +1891,7 @@ function reconcilePrice(model, live) {
1891
1891
  }
1892
1892
 
1893
1893
  // src/constants.ts
1894
- var CASCADE_VERSION = "0.52.0";
1894
+ var CASCADE_VERSION = "0.53.0";
1895
1895
  var CASCADE_CONFIG_DIR = ".cascade";
1896
1896
  var CASCADE_MD_FILE = "CASCADE.md";
1897
1897
  var CASCADE_IGNORE_FILE = ".cascadeignore";
@@ -2856,22 +2856,23 @@ var OpenAIProvider = class extends BaseProvider {
2856
2856
 
2857
2857
  // src/providers/azure.ts
2858
2858
  var DEFAULT_AZURE_API_VERSION = "2024-12-01-preview";
2859
+ var AZURE_BASE_MODEL_RULES = [
2860
+ [/gpt-?5\.5/, "gpt-5.5"],
2861
+ [/gpt-?5\.4.*mini/, "gpt-5.4-mini"],
2862
+ [/gpt-?5\.4/, "gpt-5.4"],
2863
+ [/gpt-?5.*nano/, "gpt-5-nano"],
2864
+ [/gpt-?5.*mini/, "gpt-5-mini"],
2865
+ [/gpt-?5/, "gpt-5"],
2866
+ [/gpt-?4\.1-nano/, "gpt-4.1-nano"],
2867
+ [/gpt-?4\.1-mini/, "gpt-4.1-mini"],
2868
+ [/gpt-?4\.1/, "gpt-4.1"],
2869
+ [/gpt-?4o-mini/, "gpt-4o-mini"],
2870
+ [/gpt-?4o/, "gpt-4o"]
2871
+ ];
2872
+ var AZURE_BASE_MODELS = AZURE_BASE_MODEL_RULES.map(([, id]) => id);
2859
2873
  function inferAzureBaseModel(deploymentName) {
2860
2874
  const n = deploymentName.toLowerCase();
2861
- const rules = [
2862
- [/gpt-?5\.5/, "gpt-5.5"],
2863
- [/gpt-?5\.4.*mini/, "gpt-5.4-mini"],
2864
- [/gpt-?5\.4/, "gpt-5.4"],
2865
- [/gpt-?5.*nano/, "gpt-5-nano"],
2866
- [/gpt-?5.*mini/, "gpt-5-mini"],
2867
- [/gpt-?5/, "gpt-5"],
2868
- [/gpt-?4\.1-nano/, "gpt-4.1-nano"],
2869
- [/gpt-?4\.1-mini/, "gpt-4.1-mini"],
2870
- [/gpt-?4\.1/, "gpt-4.1"],
2871
- [/gpt-?4o-mini/, "gpt-4o-mini"],
2872
- [/gpt-?4o/, "gpt-4o"]
2873
- ];
2874
- for (const [re, base] of rules) if (re.test(n)) return base;
2875
+ for (const [re, base] of AZURE_BASE_MODEL_RULES) if (re.test(n)) return base;
2875
2876
  return null;
2876
2877
  }
2877
2878
  function azureModelForDeployment(cfg) {
@@ -10993,6 +10994,20 @@ ${text}`;
10993
10994
  }
10994
10995
  };
10995
10996
 
10997
+ // src/tools/tool-name.ts
10998
+ var MCP_TOOL_PREFIX = "mcp__";
10999
+ function sanitizeToolNameSegment(segment) {
11000
+ const cleaned = segment.replace(/[^a-zA-Z0-9-]+/g, "_");
11001
+ let start = 0;
11002
+ let end = cleaned.length;
11003
+ while (start < end && cleaned[start] === "_") start++;
11004
+ while (end > start && cleaned[end - 1] === "_") end--;
11005
+ return cleaned.slice(start, end) || "_";
11006
+ }
11007
+ function mcpToolName(serverName, toolName) {
11008
+ return `${MCP_TOOL_PREFIX}${sanitizeToolNameSegment(serverName)}__${sanitizeToolNameSegment(toolName)}`;
11009
+ }
11010
+
10996
11011
  // src/tools/mcp.ts
10997
11012
  var McpToolWrapper = class extends BaseTool {
10998
11013
  name;
@@ -11006,7 +11021,7 @@ var McpToolWrapper = class extends BaseTool {
11006
11021
  this.mcpClient = mcpClient;
11007
11022
  this.serverName = serverName;
11008
11023
  this.toolName = toolName;
11009
- this.name = `mcp::${serverName}::${toolName}`;
11024
+ this.name = mcpToolName(serverName, toolName);
11010
11025
  this.description = `[MCP:${serverName}] ${description}`;
11011
11026
  this.inputSchema = inputSchema;
11012
11027
  }
@@ -19139,6 +19154,7 @@ function applySyncBundle(bundle, config) {
19139
19154
  return next;
19140
19155
  }
19141
19156
 
19157
+ exports.AZURE_BASE_MODELS = AZURE_BASE_MODELS;
19142
19158
  exports.AZURE_BASE_URL_TEMPLATE = AZURE_BASE_URL_TEMPLATE;
19143
19159
  exports.AuditLogger = AuditLogger;
19144
19160
  exports.CASCADE_AUDIT_FILE = CASCADE_AUDIT_FILE;