deepcode-ai 1.2.29 → 1.2.31

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
@@ -2352,6 +2352,11 @@ function resolveModelExecutionProfile(provider, model) {
2352
2352
  const miniMaxFamily = normalized2.includes("minimax");
2353
2353
  const deepSeekFamily = normalized2.includes("deepseek");
2354
2354
  const reasonerFamily = matchesAny(normalized2, ["reasoner", "thinking"]);
2355
+ const llamaFamily = normalized2.includes("llama");
2356
+ const mistralFamily = matchesAny(normalized2, ["mistral", "mixtral", "devstral", "codestral"]);
2357
+ const phiFamily = normalized2.includes("phi");
2358
+ const yiFamily = matchesAny(normalized2, ["yi-", "/yi"]);
2359
+ const gemmaFamily = normalized2.includes("gemma");
2355
2360
  if (provider === "anthropic") {
2356
2361
  return {
2357
2362
  toolSchemaMode: "full",
@@ -2394,8 +2399,36 @@ function resolveModelExecutionProfile(provider, model) {
2394
2399
  toolCallStrategy: "native-with-xml-fallback"
2395
2400
  };
2396
2401
  }
2402
+ if (llamaFamily || mistralFamily) {
2403
+ return {
2404
+ toolSchemaMode: "compact",
2405
+ supportsRequiredToolChoice: false,
2406
+ toolCallStrategy: "native"
2407
+ };
2408
+ }
2409
+ if (phiFamily || yiFamily || gemmaFamily) {
2410
+ return {
2411
+ toolSchemaMode: "compact",
2412
+ supportsRequiredToolChoice: false,
2413
+ toolCallStrategy: "native-with-xml-fallback"
2414
+ };
2415
+ }
2416
+ if (provider === "ollama") {
2417
+ return {
2418
+ toolSchemaMode: "compact",
2419
+ supportsRequiredToolChoice: false,
2420
+ toolCallStrategy: "native-with-xml-fallback"
2421
+ };
2422
+ }
2423
+ if (provider === "groq") {
2424
+ return {
2425
+ toolSchemaMode: "compact",
2426
+ supportsRequiredToolChoice: false,
2427
+ toolCallStrategy: "native"
2428
+ };
2429
+ }
2397
2430
  return {
2398
- toolSchemaMode: provider === "openrouter" || provider === "opencode" ? "compact" : "full",
2431
+ toolSchemaMode: "compact",
2399
2432
  supportsRequiredToolChoice: false,
2400
2433
  toolCallStrategy: "native"
2401
2434
  };
@@ -2762,14 +2795,14 @@ var XmlToolCallStreamFilter = class {
2762
2795
  }
2763
2796
  };
2764
2797
  function compactToolDescription(description, schemaMode) {
2765
- const maxLength = schemaMode === "full" ? 240 : schemaMode === "compact" ? 140 : 96;
2798
+ const maxLength = schemaMode === "full" ? 240 : schemaMode === "compact" ? 140 : 120;
2766
2799
  if (description.length <= maxLength) {
2767
2800
  return description;
2768
2801
  }
2769
2802
  return `${description.slice(0, maxLength - 3).trimEnd()}...`;
2770
2803
  }
2771
2804
  function simplifyToolSchema(schema, schemaMode) {
2772
- const normalized2 = sanitizeSchemaNode(schema, schemaMode, 0);
2805
+ const normalized2 = sanitizeSchemaNode(schema, schemaMode);
2773
2806
  if (normalized2 && typeof normalized2 === "object" && !Array.isArray(normalized2)) {
2774
2807
  return normalized2;
2775
2808
  }
@@ -2819,9 +2852,9 @@ function truncateToolOutput(output, maxLength = MAX_TOOL_OUTPUT_LENGTH) {
2819
2852
 
2820
2853
  ${end}`;
2821
2854
  }
2822
- function sanitizeSchemaNode(value, schemaMode, depth) {
2855
+ function sanitizeSchemaNode(value, schemaMode) {
2823
2856
  if (Array.isArray(value)) {
2824
- return value.map((item) => sanitizeSchemaNode(item, schemaMode, depth + 1)).filter((item) => item !== void 0);
2857
+ return value.map((item) => sanitizeSchemaNode(item, schemaMode)).filter((item) => item !== void 0);
2825
2858
  }
2826
2859
  if (!value || typeof value !== "object") {
2827
2860
  return value;
@@ -2829,10 +2862,10 @@ function sanitizeSchemaNode(value, schemaMode, depth) {
2829
2862
  const input = value;
2830
2863
  const next = {};
2831
2864
  for (const [key, child] of Object.entries(input)) {
2832
- if (shouldDropSchemaKey(key, schemaMode, depth)) {
2865
+ if (shouldDropSchemaKey(key, schemaMode)) {
2833
2866
  continue;
2834
2867
  }
2835
- const normalizedChild = sanitizeSchemaNode(child, schemaMode, depth + 1);
2868
+ const normalizedChild = sanitizeSchemaNode(child, schemaMode);
2836
2869
  if (normalizedChild !== void 0) {
2837
2870
  next[key] = normalizedChild;
2838
2871
  }
@@ -2850,16 +2883,13 @@ function sanitizeSchemaNode(value, schemaMode, depth) {
2850
2883
  }
2851
2884
  return next;
2852
2885
  }
2853
- function shouldDropSchemaKey(key, schemaMode, depth) {
2886
+ function shouldDropSchemaKey(key, schemaMode) {
2854
2887
  if (key === "$schema" || key === "definitions" || key === "$defs") {
2855
2888
  return true;
2856
2889
  }
2857
2890
  if (schemaMode !== "full" && (key === "title" || key === "default" || key === "examples" || key === "example" || key === "deprecated")) {
2858
2891
  return true;
2859
2892
  }
2860
- if (schemaMode === "minimal" && key === "description" && depth > 0) {
2861
- return true;
2862
- }
2863
2893
  return false;
2864
2894
  }
2865
2895
  function extractFallbackToolCalls(assistantText, allowedToolNames) {
@@ -11505,7 +11535,7 @@ function parseVersion(version) {
11505
11535
  if (!match) return null;
11506
11536
  return [Number(match[1]), Number(match[2]), Number(match[3])];
11507
11537
  }
11508
- var VERSION = "1.2.29".length > 0 ? "1.2.29" : "0.0.0-dev";
11538
+ var VERSION = "1.2.31".length > 0 ? "1.2.31" : "0.0.0-dev";
11509
11539
  async function updateCommand() {
11510
11540
  writeStdoutLine(`Current version: ${VERSION}`);
11511
11541
  const update = await checkForUpdate(VERSION, { force: true });