snow-ai 0.6.51 → 0.6.52

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/bundle/cli.mjs CHANGED
@@ -90502,8 +90502,8 @@ async function* createStreamingResponse(options3, abortSignal, onRetry) {
90502
90502
  tools: convertToolsForResponses(options3.tools),
90503
90503
  tool_choice: options3.tool_choice,
90504
90504
  parallel_tool_calls: true,
90505
- // 只有当 reasoning 启用时才添加 reasoning 字段
90506
- ...configuredReasoning && {
90505
+ // 只有当 reasoning 启用且未禁用思考功能时才添加 reasoning 字段
90506
+ ...configuredReasoning && !options3.disableThinking && {
90507
90507
  reasoning: configuredReasoning
90508
90508
  },
90509
90509
  store: false,
@@ -90949,7 +90949,7 @@ async function* createStreamingGeminiCompletion(options3, abortSignal, onRetry)
90949
90949
  contents,
90950
90950
  systemInstruction: systemInstruction ? { parts: systemInstruction.map((text3) => ({ text: text3 })) } : void 0
90951
90951
  };
90952
- if ((_a21 = config4.geminiThinking) == null ? void 0 : _a21.enabled) {
90952
+ if (((_a21 = config4.geminiThinking) == null ? void 0 : _a21.enabled) && !options3.disableThinking) {
90953
90953
  requestBody.generationConfig = {
90954
90954
  thinkingConfig: {
90955
90955
  thinkingBudget: config4.geminiThinking.budget
@@ -92023,7 +92023,9 @@ var init_codebaseReviewAgent = __esm({
92023
92023
  model: this.modelName,
92024
92024
  messages,
92025
92025
  tools: [this.REVIEW_TOOL],
92026
- includeBuiltinSystemPrompt: false
92026
+ includeBuiltinSystemPrompt: false,
92027
+ disableThinking: true
92028
+ // Agents 不使用思考功能
92027
92029
  }, abortSignal);
92028
92030
  break;
92029
92031
  case "responses":
@@ -92032,7 +92034,9 @@ var init_codebaseReviewAgent = __esm({
92032
92034
  messages,
92033
92035
  tools: [this.REVIEW_TOOL],
92034
92036
  stream: true,
92035
- includeBuiltinSystemPrompt: false
92037
+ includeBuiltinSystemPrompt: false,
92038
+ disableThinking: true
92039
+ // Agents 不使用思考功能
92036
92040
  }, abortSignal);
92037
92041
  break;
92038
92042
  case "chat":
@@ -92042,7 +92046,9 @@ var init_codebaseReviewAgent = __esm({
92042
92046
  messages,
92043
92047
  tools: [this.REVIEW_TOOL],
92044
92048
  stream: true,
92045
- includeBuiltinSystemPrompt: false
92049
+ includeBuiltinSystemPrompt: false,
92050
+ disableThinking: true
92051
+ // Agents 不使用思考功能
92046
92052
  }, abortSignal);
92047
92053
  break;
92048
92054
  }
@@ -92789,8 +92795,10 @@ var init_summaryAgent = __esm({
92789
92795
  streamGenerator = createStreamingGeminiCompletion({
92790
92796
  model: this.modelName,
92791
92797
  messages,
92792
- includeBuiltinSystemPrompt: false
92798
+ includeBuiltinSystemPrompt: false,
92793
92799
  // 不需要内置系统提示词
92800
+ disableThinking: true
92801
+ // Agents 不使用思考功能
92794
92802
  }, abortSignal);
92795
92803
  break;
92796
92804
  case "responses":
@@ -92798,8 +92806,10 @@ var init_summaryAgent = __esm({
92798
92806
  model: this.modelName,
92799
92807
  messages,
92800
92808
  stream: true,
92801
- includeBuiltinSystemPrompt: false
92809
+ includeBuiltinSystemPrompt: false,
92802
92810
  // 不需要内置系统提示词
92811
+ disableThinking: true
92812
+ // Agents 不使用思考功能
92803
92813
  }, abortSignal);
92804
92814
  break;
92805
92815
  case "chat":
@@ -92808,8 +92818,10 @@ var init_summaryAgent = __esm({
92808
92818
  model: this.modelName,
92809
92819
  messages,
92810
92820
  stream: true,
92811
- includeBuiltinSystemPrompt: false
92821
+ includeBuiltinSystemPrompt: false,
92812
92822
  // 不需要内置系统提示词
92823
+ disableThinking: true
92824
+ // Agents 不使用思考功能
92813
92825
  }, abortSignal);
92814
92826
  break;
92815
92827
  }
@@ -354651,8 +354663,10 @@ var init_aceCodeSearch = __esm({
354651
354663
  }
354652
354664
  /**
354653
354665
  * Strategy 1: Use git grep for fast searching in Git repositories
354666
+ * Enhanced with timeout protection to prevent hanging
354654
354667
  */
354655
354668
  async gitGrepSearch(pattern, fileGlob, maxResults = 100, isRegex = true) {
354669
+ const timeoutMs = 15e3;
354656
354670
  return new Promise((resolve12, reject2) => {
354657
354671
  const args2 = ["grep", "--untracked", "-n", "--ignore-case"];
354658
354672
  if (isRegex) {
@@ -354662,7 +354676,7 @@ var init_aceCodeSearch = __esm({
354662
354676
  }
354663
354677
  args2.push(pattern);
354664
354678
  if (fileGlob) {
354665
- let gitGlob = fileGlob.replace(/\\/g, "/");
354679
+ let gitGlob = fileGlob.replace(/\\\\/g, "/");
354666
354680
  gitGlob = gitGlob.replace(/\*\*/g, "*");
354667
354681
  const expandedGlobs = expandGlobBraces(gitGlob);
354668
354682
  args2.push("--", ...expandedGlobs);
@@ -354674,21 +354688,38 @@ var init_aceCodeSearch = __esm({
354674
354688
  processManager.register(child);
354675
354689
  const stdoutChunks = [];
354676
354690
  const stderrChunks = [];
354691
+ let isCompleted = false;
354692
+ const timeoutId = setTimeout(() => {
354693
+ if (!isCompleted) {
354694
+ isCompleted = true;
354695
+ child.kill("SIGTERM");
354696
+ logger.warn(`git grep timed out after ${timeoutMs}ms, killing process`);
354697
+ reject2(new Error(`git grep timed out after ${timeoutMs}ms`));
354698
+ }
354699
+ }, timeoutMs);
354677
354700
  child.stdout.on("data", (chunk2) => stdoutChunks.push(chunk2));
354678
354701
  child.stderr.on("data", (chunk2) => stderrChunks.push(chunk2));
354679
354702
  child.on("error", (err) => {
354680
- reject2(new Error(`Failed to start git grep: ${err.message}`));
354703
+ if (!isCompleted) {
354704
+ isCompleted = true;
354705
+ clearTimeout(timeoutId);
354706
+ reject2(new Error(`Failed to start git grep: ${err.message}`));
354707
+ }
354681
354708
  });
354682
354709
  child.on("close", (code2) => {
354683
- const stdoutData = Buffer.concat(stdoutChunks).toString("utf8");
354684
- const stderrData = Buffer.concat(stderrChunks).toString("utf8").trim();
354685
- if (code2 === 0) {
354686
- const results = parseGrepOutput(stdoutData, this.basePath);
354687
- resolve12(results.slice(0, maxResults));
354688
- } else if (code2 === 1) {
354689
- resolve12([]);
354690
- } else {
354691
- reject2(new Error(`git grep exited with code ${code2}: ${stderrData}`));
354710
+ if (!isCompleted) {
354711
+ isCompleted = true;
354712
+ clearTimeout(timeoutId);
354713
+ const stdoutData = Buffer.concat(stdoutChunks).toString("utf8");
354714
+ const stderrData = Buffer.concat(stderrChunks).toString("utf8").trim();
354715
+ if (code2 === 0) {
354716
+ const results = parseGrepOutput(stdoutData, this.basePath);
354717
+ resolve12(results.slice(0, maxResults));
354718
+ } else if (code2 === 1) {
354719
+ resolve12([]);
354720
+ } else {
354721
+ reject2(new Error(`git grep exited with code ${code2}: ${stderrData}`));
354722
+ }
354692
354723
  }
354693
354724
  });
354694
354725
  });
@@ -354699,10 +354730,9 @@ var init_aceCodeSearch = __esm({
354699
354730
  */
354700
354731
  async systemGrepSearch(pattern, fileGlob, maxResults = 100, grepCommand = "grep") {
354701
354732
  const isRipgrep = grepCommand === "rg";
354702
- const isWindows4 = process.platform === "win32";
354703
- const timeoutMs = isWindows4 && isRipgrep ? 1e4 : 15e3;
354733
+ const timeoutMs = 15e3;
354704
354734
  return new Promise((resolve12, reject2) => {
354705
- const args2 = isRipgrep ? ["-n", "-i", "--no-heading", pattern] : ["-r", "-n", "-H", "-E", "-i"];
354735
+ const args2 = isRipgrep ? ["-n", "-i", "--no-heading"] : ["-r", "-n", "-H", "-E", "-i"];
354706
354736
  const excludeDirs = [
354707
354737
  "node_modules",
354708
354738
  ".git",
@@ -354728,11 +354758,12 @@ var init_aceCodeSearch = __esm({
354728
354758
  const expandedGlobs = expandGlobBraces(normalizedGlob);
354729
354759
  expandedGlobs.forEach((glob) => args2.push(`--include=${glob}`));
354730
354760
  }
354731
- args2.push(pattern, ".");
354732
354761
  }
354762
+ args2.push(pattern, ".");
354733
354763
  const child = spawn4(grepCommand, args2, {
354734
354764
  cwd: this.basePath,
354735
- windowsHide: true
354765
+ windowsHide: true,
354766
+ stdio: ["ignore", "pipe", "pipe"]
354736
354767
  });
354737
354768
  processManager.register(child);
354738
354769
  const stdoutChunks = [];
@@ -354992,21 +355023,20 @@ var init_aceCodeSearch = __esm({
354992
355023
  } catch (error40) {
354993
355024
  }
354994
355025
  }
354995
- const isWindows4 = process.platform === "win32";
354996
- if (grepAvailable) {
355026
+ if (rgAvailable) {
354997
355027
  try {
354998
- const results2 = await this.systemGrepSearch(pattern, fileGlob, maxResults, "grep");
355028
+ const results2 = await this.systemGrepSearch(pattern, fileGlob, maxResults, "rg");
354999
355029
  return await this.sortResultsByRecency(results2);
355000
355030
  } catch (error40) {
355001
- logger.info("System grep failed, trying next strategy");
355031
+ logger.info("Ripgrep failed, trying next strategy");
355002
355032
  }
355003
355033
  }
355004
- if (rgAvailable && !isWindows4) {
355034
+ if (grepAvailable) {
355005
355035
  try {
355006
- const results2 = await this.systemGrepSearch(pattern, fileGlob, maxResults, "rg");
355036
+ const results2 = await this.systemGrepSearch(pattern, fileGlob, maxResults, "grep");
355007
355037
  return await this.sortResultsByRecency(results2);
355008
355038
  } catch (error40) {
355009
- logger.info("Ripgrep failed, falling back to JavaScript search");
355039
+ logger.info("System grep failed, falling back to JavaScript search");
355010
355040
  }
355011
355041
  }
355012
355042
  logger.info("Using JavaScript fallback for text search");
@@ -426786,8 +426816,10 @@ var init_compactAgent = __esm({
426786
426816
  streamGenerator = createStreamingGeminiCompletion({
426787
426817
  model: this.modelName,
426788
426818
  messages,
426789
- includeBuiltinSystemPrompt: false
426819
+ includeBuiltinSystemPrompt: false,
426790
426820
  // 不需要内置系统提示词
426821
+ disableThinking: true
426822
+ // Agents 不使用思考功能
426791
426823
  }, abortSignal);
426792
426824
  break;
426793
426825
  case "responses":
@@ -426795,8 +426827,10 @@ var init_compactAgent = __esm({
426795
426827
  model: this.modelName,
426796
426828
  messages,
426797
426829
  stream: true,
426798
- includeBuiltinSystemPrompt: false
426830
+ includeBuiltinSystemPrompt: false,
426799
426831
  // 不需要内置系统提示词
426832
+ disableThinking: true
426833
+ // Agents 不使用思考功能
426800
426834
  }, abortSignal);
426801
426835
  break;
426802
426836
  case "chat":
@@ -426805,8 +426839,10 @@ var init_compactAgent = __esm({
426805
426839
  model: this.modelName,
426806
426840
  messages,
426807
426841
  stream: true,
426808
- includeBuiltinSystemPrompt: false
426842
+ includeBuiltinSystemPrompt: false,
426809
426843
  // 不需要内置系统提示词
426844
+ disableThinking: true
426845
+ // Agents 不使用思考功能
426810
426846
  }, abortSignal);
426811
426847
  break;
426812
426848
  }
@@ -443392,7 +443428,7 @@ var init_LSPServerRegistry = __esm({
443392
443428
  }
443393
443429
  try {
443394
443430
  const { command } = config4;
443395
- const testCommand = process.platform === "win32" ? `where ${command}` : `which ${command}`;
443431
+ const testCommand = process.platform === "win32" ? `where.exe ${command}` : `which ${command}`;
443396
443432
  await execAsync(testCommand);
443397
443433
  this.installedServers.set(language, true);
443398
443434
  return true;
@@ -461979,7 +462015,7 @@ function ConfigScreen({ onBack, onSave, inlineMode = false }) {
461979
462015
  setManualInputValue("");
461980
462016
  } else if (key.backspace || key.delete) {
461981
462017
  setManualInputValue((prev) => prev.slice(0, -1));
461982
- } else if (input2 && input2.match(/[a-zA-Z0-9-_./:]/)) {
462018
+ } else if (input2) {
461983
462019
  setManualInputValue((prev) => prev + stripFocusArtifacts(input2));
461984
462020
  }
461985
462021
  return;
@@ -569776,7 +569812,7 @@ var init_ModelsPanel = __esm({
569776
569812
  setManualInputValue((prev) => prev.slice(0, -1));
569777
569813
  return;
569778
569814
  }
569779
- if (input2 && /[a-zA-Z0-9-_./:]/.test(input2)) {
569815
+ if (input2) {
569780
569816
  setManualInputValue((prev) => prev + input2);
569781
569817
  }
569782
569818
  return;
@@ -573508,7 +573544,13 @@ ${injectedSummary}`
573508
573544
  if (onUserInteractionNeeded) {
573509
573545
  const response = await onUserInteractionNeeded(error40.question, error40.options, error40.multiSelect);
573510
573546
  if (response.cancelled) {
573511
- throw new Error("User cancelled the interaction");
573547
+ result2 = {
573548
+ tool_call_id: toolCall.id,
573549
+ role: "tool",
573550
+ content: "Error: User cancelled the question interaction",
573551
+ messageStatus: "error"
573552
+ };
573553
+ return result2;
573512
573554
  }
573513
573555
  const answerText = response.customInput ? `${Array.isArray(response.selected) ? response.selected.join(", ") : response.selected}: ${response.customInput}` : Array.isArray(response.selected) ? response.selected.join(", ") : response.selected;
573514
573556
  result2 = {
@@ -580212,7 +580254,6 @@ function useChatLogic(props) {
580212
580254
  if (streamingState.abortController) {
580213
580255
  streamingState.abortController.abort();
580214
580256
  }
580215
- setMessages((prev) => prev.filter((msg) => !msg.toolPending));
580216
580257
  setPendingMessages([]);
580217
580258
  return;
580218
580259
  }
@@ -599788,7 +599829,7 @@ var require_package3 = __commonJS({
599788
599829
  "package.json"(exports2, module2) {
599789
599830
  module2.exports = {
599790
599831
  name: "snow-ai",
599791
- version: "0.6.51",
599832
+ version: "0.6.52",
599792
599833
  description: "Agentic coding in your terminal",
599793
599834
  license: "MIT",
599794
599835
  bin: {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snow-ai",
3
- "version": "0.6.51",
3
+ "version": "0.6.52",
4
4
  "description": "Agentic coding in your terminal",
5
5
  "license": "MIT",
6
6
  "bin": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snow-ai",
3
- "version": "0.6.51",
3
+ "version": "0.6.52",
4
4
  "description": "Agentic coding in your terminal",
5
5
  "license": "MIT",
6
6
  "bin": {