@qwen-code/qwen-code 0.18.1-preview.0 → 0.18.1-preview.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.
Files changed (63) hide show
  1. package/README.md +2 -1
  2. package/bundled/qc-helper/docs/features/channels/feishu.md +16 -0
  3. package/bundled/qc-helper/docs/features/mcp.md +1 -1
  4. package/bundled/qc-helper/docs/qwen-serve.md +18 -7
  5. package/bundled/review/SKILL.md +7 -3
  6. package/chunks/{agent-WK5GYOPC.js → agent-ZLVQLNIP.js} +5 -5
  7. package/chunks/{agent-headless-KZJALDQF.js → agent-headless-H4ZT46GX.js} +5 -5
  8. package/chunks/{anthropicContentGenerator-DCI26OQF.js → anthropicContentGenerator-KLBHYGH6.js} +1 -1
  9. package/chunks/{askUserQuestion-NDNFGC35.js → askUserQuestion-QPZXR3UO.js} +1 -1
  10. package/chunks/{chunk-27STU35P.js → chunk-BRU4Z5BG.js} +10 -5
  11. package/chunks/{chunk-JZFEL3RB.js → chunk-C64WAJOC.js} +1 -1
  12. package/chunks/{chunk-DYCU43TE.js → chunk-HISY5FYZ.js} +4 -4
  13. package/chunks/{chunk-E322ZT4P.js → chunk-L6F7VZPZ.js} +6 -6
  14. package/chunks/{chunk-3NRO6NHX.js → chunk-MN5RAXVB.js} +3 -3
  15. package/chunks/{chunk-RLFLJVHU.js → chunk-Q6WOQSR4.js} +2 -2
  16. package/chunks/{chunk-BW7CMDF3.js → chunk-R53CLQY7.js} +1 -1
  17. package/chunks/{chunk-26QELEL2.js → chunk-RTTAC5VW.js} +1 -1
  18. package/chunks/{chunk-Q3NN2XUW.js → chunk-UKLVRIWE.js} +1253 -1007
  19. package/chunks/{chunk-VXHYMZXW.js → chunk-VIEIRAK3.js} +1 -1
  20. package/chunks/{chunk-OT6JA3KQ.js → chunk-YJDVHAGL.js} +1 -1
  21. package/chunks/{chunk-6WPY6ES3.js → chunk-ZNUMXPNK.js} +565 -48
  22. package/chunks/{computer-use-4ELNIZMF.js → computer-use-SWC45S44.js} +5 -5
  23. package/chunks/{contextCommand-E2V26QGD.js → contextCommand-O5DLQUIZ.js} +7 -7
  24. package/chunks/{cron-create-7CXEAJ2K.js → cron-create-DQKRQMCP.js} +1 -1
  25. package/chunks/{cron-delete-2FQYYNQ6.js → cron-delete-DOFPHFTI.js} +1 -1
  26. package/chunks/{cron-list-QCAJ73XE.js → cron-list-RCVOO3CB.js} +1 -1
  27. package/chunks/{dist-PF2IYSMD.js → dist-UH7CYT7F.js} +1 -1
  28. package/chunks/{edit-IC3ECG44.js → edit-J7M33W4D.js} +6 -6
  29. package/chunks/{enter-worktree-ETQWM7BB.js → enter-worktree-RCCPIOG6.js} +5 -5
  30. package/chunks/{enterPlanMode-VL3F45RF.js → enterPlanMode-EC7HWVXV.js} +5 -5
  31. package/chunks/{exit-worktree-F5BJXBFB.js → exit-worktree-V3OVN22U.js} +5 -5
  32. package/chunks/{exitPlanMode-VOC7G5FJ.js → exitPlanMode-P3F5VTWX.js} +7 -6
  33. package/chunks/{geminiContentGenerator-7D2QZ5FE.js → geminiContentGenerator-E2LZQIFZ.js} +1 -1
  34. package/chunks/{glob-XTABUPPR.js → glob-ENPPHN24.js} +5 -5
  35. package/chunks/{grep-MRCXYH2N.js → grep-RXZMZKHV.js} +5 -5
  36. package/chunks/{ls-XVGXRYWD.js → ls-TRD77UTS.js} +1 -1
  37. package/chunks/{lsp-S6SHPULC.js → lsp-2VFWQPZS.js} +1 -1
  38. package/chunks/{monitor-LNRRNJJB.js → monitor-YYWM7RUX.js} +5 -5
  39. package/chunks/{notebook-edit-IS3UYVGM.js → notebook-edit-L6OODJTK.js} +6 -6
  40. package/chunks/{openaiContentGenerator-P772OZ6K.js → openaiContentGenerator-BPRGR5FJ.js} +5 -5
  41. package/chunks/{qwenContentGenerator-Y6YGZRHH.js → qwenContentGenerator-ENMXX47B.js} +7 -7
  42. package/chunks/{read-file-2JIJ646W.js → read-file-3VASWJKO.js} +3 -3
  43. package/chunks/{ripGrep-Z74CN4MW.js → ripGrep-67IQWCR7.js} +5 -5
  44. package/chunks/{scheduler-KFG4TT3A.js → scheduler-TAPJOQHX.js} +5 -5
  45. package/chunks/{send-message-SMNR5DBG.js → send-message-QZOC5GA2.js} +1 -1
  46. package/chunks/{serve-XDZAE3KF.js → serve-CQF2R7SG.js} +709 -26
  47. package/chunks/{shell-BTAJJJHO.js → shell-ZLBFZ75G.js} +5 -5
  48. package/chunks/{skill-LSM726DP.js → skill-BZ2NCCJN.js} +3 -3
  49. package/chunks/{src-JMUZP4A4.js → src-ASRB3EO3.js} +9 -5
  50. package/chunks/{syntheticOutput-KMNF7YG6.js → syntheticOutput-WJSUK4SZ.js} +2 -2
  51. package/chunks/{task-create-LIJHK75G.js → task-create-GGSC27HO.js} +2 -2
  52. package/chunks/{task-list-S4GNSILM.js → task-list-EDHHHSK4.js} +1 -1
  53. package/chunks/{task-stop-3GBRYJHM.js → task-stop-WR5PDVZY.js} +1 -1
  54. package/chunks/{task-update-F3UTVJMS.js → task-update-UR7NUHBV.js} +2 -2
  55. package/chunks/{team-create-S5ZBN464.js → team-create-NXTYUYLE.js} +5 -5
  56. package/chunks/{team-delete-54434EB7.js → team-delete-FC33URJK.js} +1 -1
  57. package/chunks/{todoWrite-4ENGSBUX.js → todoWrite-GO2ME7ZV.js} +1 -1
  58. package/chunks/{tool-search-NUOEJ4LF.js → tool-search-GYO3ZDMH.js} +3 -3
  59. package/chunks/{web-fetch-RHZMF3MP.js → web-fetch-NLLATYIL.js} +2 -2
  60. package/chunks/{workflow-ZI3ZXNU6.js → workflow-KZLZUDHE.js} +249 -24
  61. package/chunks/{write-file-MHQLLZWY.js → write-file-AUXVL5D2.js} +6 -6
  62. package/cli.js +543 -184
  63. package/package.json +2 -2
package/cli.js CHANGED
@@ -23,6 +23,7 @@ import {
23
23
  ENV_CORRUPTED_PATH,
24
24
  ENV_WAS_RECOVERED,
25
25
  IDLE_HOOK_EVENTS,
26
+ MID_TURN_QUEUE_DRAIN_METHOD,
26
27
  NOT_CURRENTLY_GENERATING_CANCEL_MESSAGE,
27
28
  OUTPUT_LANGUAGE_AUTO,
28
29
  SERVE_CONTROL_EXT_METHODS,
@@ -91,7 +92,7 @@ import {
91
92
  updateOutputLanguageFile,
92
93
  validateCustomTheme,
93
94
  writeOutputLanguageAndRegisterPath
94
- } from "./chunks/chunk-27STU35P.js";
95
+ } from "./chunks/chunk-BRU4Z5BG.js";
95
96
  import {
96
97
  AgentSideConnection,
97
98
  PROTOCOL_VERSION,
@@ -104,7 +105,7 @@ import {
104
105
  formatContextUsageText,
105
106
  isTerminalGoalStatusKind,
106
107
  require_react
107
- } from "./chunks/chunk-DYCU43TE.js";
108
+ } from "./chunks/chunk-HISY5FYZ.js";
108
109
  import {
109
110
  SUPPORTED_LANGUAGES,
110
111
  clearScreen,
@@ -117,7 +118,7 @@ import {
117
118
  ta,
118
119
  writeStderrLine,
119
120
  writeStdoutLine
120
- } from "./chunks/chunk-BW7CMDF3.js";
121
+ } from "./chunks/chunk-R53CLQY7.js";
121
122
  import {
122
123
  noteInteraction
123
124
  } from "./chunks/chunk-MRO43B25.js";
@@ -341,13 +342,13 @@ import {
341
342
  writeRuntimeStatus,
342
343
  writeWorktreeSession,
343
344
  writeWorktreeSessionMarker
344
- } from "./chunks/chunk-Q3NN2XUW.js";
345
+ } from "./chunks/chunk-UKLVRIWE.js";
345
346
  import {
346
347
  external_exports
347
348
  } from "./chunks/chunk-K5PGHDBN.js";
348
349
  import {
349
350
  runSideQuery
350
- } from "./chunks/chunk-VXHYMZXW.js";
351
+ } from "./chunks/chunk-VIEIRAK3.js";
351
352
  import "./chunks/chunk-O4PICXES.js";
352
353
  import "./chunks/chunk-TW522KN6.js";
353
354
  import "./chunks/chunk-BJ5HQ23U.js";
@@ -417,7 +418,7 @@ import {
417
418
  stripRuntimeSnapshotPrefix,
418
419
  uiTelemetryService,
419
420
  withInteractionSpan
420
- } from "./chunks/chunk-E322ZT4P.js";
421
+ } from "./chunks/chunk-L6F7VZPZ.js";
421
422
  import "./chunks/chunk-3PJXIDKI.js";
422
423
  import "./chunks/chunk-UWCTAVOD.js";
423
424
  import {
@@ -431,13 +432,13 @@ import {
431
432
  isAnyAutoMemPath
432
433
  } from "./chunks/chunk-IQHSD7K5.js";
433
434
  import "./chunks/chunk-LYRSMKLS.js";
434
- import "./chunks/chunk-26QELEL2.js";
435
+ import "./chunks/chunk-RTTAC5VW.js";
435
436
  import {
436
437
  SchemaValidator,
437
438
  ToolConfirmationOutcome,
438
439
  ToolDisplayNames,
439
440
  ToolNames
440
- } from "./chunks/chunk-6WPY6ES3.js";
441
+ } from "./chunks/chunk-ZNUMXPNK.js";
441
442
  import {
442
443
  clearCachedCredentialFile,
443
444
  openBrowserSecurely,
@@ -11233,7 +11234,7 @@ var require_supports_color = __commonJS({
11233
11234
  "node_modules/chalk/node_modules/supports-color/index.js"(exports, module) {
11234
11235
  "use strict";
11235
11236
  init_esbuild_shims();
11236
- var os33 = __require("os");
11237
+ var os32 = __require("os");
11237
11238
  var tty4 = __require("tty");
11238
11239
  var hasFlag3 = require_has_flag();
11239
11240
  var { env: env5 } = process;
@@ -11282,7 +11283,7 @@ var require_supports_color = __commonJS({
11282
11283
  return min;
11283
11284
  }
11284
11285
  if (process.platform === "win32") {
11285
- const osRelease = os33.release().split(".");
11286
+ const osRelease = os32.release().split(".");
11286
11287
  if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
11287
11288
  return Number(osRelease[2]) >= 14931 ? 3 : 2;
11288
11289
  }
@@ -32581,7 +32582,7 @@ var require_supports_color2 = __commonJS({
32581
32582
  "node_modules/ink-link/node_modules/supports-color/index.js"(exports, module) {
32582
32583
  "use strict";
32583
32584
  init_esbuild_shims();
32584
- var os33 = __require("os");
32585
+ var os32 = __require("os");
32585
32586
  var tty4 = __require("tty");
32586
32587
  var hasFlag3 = require_has_flag();
32587
32588
  var { env: env5 } = process;
@@ -32630,7 +32631,7 @@ var require_supports_color2 = __commonJS({
32630
32631
  return min;
32631
32632
  }
32632
32633
  if (process.platform === "win32") {
32633
- const osRelease = os33.release().split(".");
32634
+ const osRelease = os32.release().split(".");
32634
32635
  if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
32635
32636
  return Number(osRelease[2]) >= 14931 ? 3 : 2;
32636
32637
  }
@@ -36809,9 +36810,9 @@ var require_defaults = __commonJS({
36809
36810
  "node_modules/@pnpm/npm-conf/lib/defaults.js"(exports) {
36810
36811
  "use strict";
36811
36812
  init_esbuild_shims();
36812
- var os33 = __require("os");
36813
+ var os32 = __require("os");
36813
36814
  var path60 = __require("path");
36814
- var temp = os33.tmpdir();
36815
+ var temp = os32.tmpdir();
36815
36816
  var uidOrPid = process.getuid ? process.getuid() : process.pid;
36816
36817
  var hasUnicode = /* @__PURE__ */ __name(() => true, "hasUnicode");
36817
36818
  var isWindows4 = process.platform === "win32";
@@ -36822,7 +36823,7 @@ var require_defaults = __commonJS({
36822
36823
  var umask = {
36823
36824
  fromString: /* @__PURE__ */ __name(() => process.umask(), "fromString")
36824
36825
  };
36825
- var home = os33.homedir();
36826
+ var home = os32.homedir();
36826
36827
  if (home) {
36827
36828
  process.env.HOME = home;
36828
36829
  } else {
@@ -49242,7 +49243,7 @@ var measure_element_default = measureElement;
49242
49243
  // packages/cli/src/gemini.tsx
49243
49244
  var import_react233 = __toESM(require_react(), 1);
49244
49245
  import dns from "node:dns";
49245
- import os32 from "node:os";
49246
+ import os31 from "node:os";
49246
49247
  import path59, { basename as basename13 } from "node:path";
49247
49248
  import v83 from "node:v8";
49248
49249
 
@@ -56779,7 +56780,7 @@ function ensureBuiltins() {
56779
56780
  const [telegram, weixin, dingtalk, feishu] = await Promise.all([
56780
56781
  import("./chunks/dist-KF43SZZV.js"),
56781
56782
  import("./chunks/dist-2UCAYOX7.js"),
56782
- import("./chunks/dist-PF2IYSMD.js"),
56783
+ import("./chunks/dist-UH7CYT7F.js"),
56783
56784
  import("./chunks/dist-33LHH26D.js")
56784
56785
  ]);
56785
56786
  for (const mod of [telegram, weixin, dingtalk, feishu]) {
@@ -59188,7 +59189,7 @@ var serveCommand = {
59188
59189
  process.exit(1);
59189
59190
  }
59190
59191
  }
59191
- const { runQwenServe } = await import("./chunks/serve-XDZAE3KF.js");
59192
+ const { runQwenServe } = await import("./chunks/serve-CQF2R7SG.js");
59192
59193
  try {
59193
59194
  await runQwenServe({
59194
59195
  port: argv.port,
@@ -64929,6 +64930,147 @@ var tasksCommand = {
64929
64930
  }, "action")
64930
64931
  };
64931
64932
 
64933
+ // packages/cli/src/ui/commands/workflowsCommand.ts
64934
+ init_esbuild_shims();
64935
+ function rowLine(entry, now) {
64936
+ const endTime = entry.endTime ?? now;
64937
+ const runtime = formatDuration(endTime - entry.startTime, {
64938
+ hideTrailingZeros: true
64939
+ });
64940
+ const label = entry.meta?.name ?? entry.runId;
64941
+ const phase = entry.currentPhase ? ` \xB7 ${entry.currentPhase}` : "";
64942
+ const counts = entry.agentsDispatched > 0 ? ` \xB7 ${entry.agentsCompleted}/${entry.agentsDispatched} agents` : "";
64943
+ const phaseCount = entry.phases.length > 0 ? ` \xB7 ${entry.phases.length} ${entry.phases.length === 1 ? "phase" : "phases"}` : "";
64944
+ const errorTail = entry.status === "failed" && entry.error ? ` \u2014 ${entry.error.slice(0, 80)}` : "";
64945
+ return ` ${entry.runId.padEnd(20)} ${entry.status.padEnd(10)} ${runtime.padStart(8)} ${label}${phase}${counts}${phaseCount}${errorTail}`;
64946
+ }
64947
+ __name(rowLine, "rowLine");
64948
+ function detailLines(entry, now) {
64949
+ const lines = [];
64950
+ const endTime = entry.endTime ?? now;
64951
+ const runtime = formatDuration(endTime - entry.startTime, {
64952
+ hideTrailingZeros: true
64953
+ });
64954
+ lines.push(`Workflow ${entry.runId}`);
64955
+ if (entry.meta?.name) {
64956
+ lines.push(` name : ${entry.meta.name}`);
64957
+ }
64958
+ if (entry.meta?.description) {
64959
+ lines.push(` description : ${entry.meta.description}`);
64960
+ }
64961
+ if (entry.meta?.whenToUse) {
64962
+ lines.push(` whenToUse : ${entry.meta.whenToUse}`);
64963
+ }
64964
+ lines.push(` status : ${entry.status}`);
64965
+ lines.push(` runtime : ${runtime}`);
64966
+ if (entry.currentPhase) {
64967
+ lines.push(` currentPhase: ${entry.currentPhase}`);
64968
+ }
64969
+ lines.push(
64970
+ ` agents : ${entry.agentsCompleted}/${entry.agentsDispatched}`
64971
+ );
64972
+ if (entry.error) {
64973
+ lines.push(` error : ${entry.error}`);
64974
+ }
64975
+ if (entry.phases.length > 0) {
64976
+ lines.push("");
64977
+ lines.push(` Phases (${entry.phases.length})`);
64978
+ for (const phase of entry.phases) {
64979
+ lines.push(` \xB7 ${phase}`);
64980
+ }
64981
+ }
64982
+ if (entry.recentLogs.length > 0) {
64983
+ lines.push("");
64984
+ lines.push(` Logs (last ${entry.recentLogs.length})`);
64985
+ for (const line of entry.recentLogs) {
64986
+ lines.push(` ${line}`);
64987
+ }
64988
+ }
64989
+ return lines;
64990
+ }
64991
+ __name(detailLines, "detailLines");
64992
+ var workflowsCommand = {
64993
+ name: "workflows",
64994
+ get description() {
64995
+ return t(
64996
+ "List active and completed workflow runs (text dump \u2014 interactive dialog opens via the footer pill)"
64997
+ );
64998
+ },
64999
+ get argumentHint() {
65000
+ return t("[runId]");
65001
+ },
65002
+ kind: "built-in" /* BUILT_IN */,
65003
+ // Same triple-mode coverage as `/tasks`: the dialog is richer in
65004
+ // interactive mode but headless / acp consumers need the text dump
65005
+ // as their only inspection path.
65006
+ supportedModes: ["interactive", "non_interactive", "acp"],
65007
+ action: /* @__PURE__ */ __name(async (context, args) => {
65008
+ const { config } = context.services;
65009
+ if (!config) {
65010
+ return {
65011
+ type: "message",
65012
+ messageType: "error",
65013
+ content: "Config not available."
65014
+ };
65015
+ }
65016
+ const registry2 = config.getWorkflowRunRegistry();
65017
+ const allEntries = registry2.list();
65018
+ const trimmedArgs = (args ?? "").trim();
65019
+ if (trimmedArgs.length > 0) {
65020
+ const target = registry2.get(trimmedArgs);
65021
+ if (!target) {
65022
+ return {
65023
+ type: "message",
65024
+ messageType: "error",
65025
+ content: `Unknown workflow runId: ${trimmedArgs}`
65026
+ };
65027
+ }
65028
+ return {
65029
+ type: "message",
65030
+ messageType: "info",
65031
+ content: detailLines(target, Date.now()).join("\n")
65032
+ };
65033
+ }
65034
+ if (allEntries.length === 0) {
65035
+ return {
65036
+ type: "message",
65037
+ messageType: "info",
65038
+ content: "No workflow runs recorded yet."
65039
+ };
65040
+ }
65041
+ const now = Date.now();
65042
+ const running = allEntries.filter((e) => e.status === "running").sort((a, b) => a.startTime - b.startTime);
65043
+ const terminal = allEntries.filter((e) => e.status !== "running").sort((a, b) => (b.endTime ?? 0) - (a.endTime ?? 0));
65044
+ const lines = [];
65045
+ if (context.executionMode === "interactive") {
65046
+ lines.push(
65047
+ t(
65048
+ "Tip: use `/workflows <runId>` for the per-run detail view (name, description, phase tree, recent logs)."
65049
+ ),
65050
+ ""
65051
+ );
65052
+ }
65053
+ lines.push(
65054
+ `Workflow runs (${allEntries.length} total \xB7 ${running.length} running)`,
65055
+ ""
65056
+ );
65057
+ if (running.length > 0) {
65058
+ lines.push("Active");
65059
+ for (const entry of running) lines.push(rowLine(entry, now));
65060
+ lines.push("");
65061
+ }
65062
+ if (terminal.length > 0) {
65063
+ lines.push("Recent");
65064
+ for (const entry of terminal) lines.push(rowLine(entry, now));
65065
+ }
65066
+ return {
65067
+ type: "message",
65068
+ messageType: "info",
65069
+ content: lines.join("\n")
65070
+ };
65071
+ }, "action")
65072
+ };
65073
+
64932
65074
  // packages/cli/src/ui/commands/agentsCommand.ts
64933
65075
  init_esbuild_shims();
64934
65076
  var agentsCommand = {
@@ -67501,13 +67643,18 @@ init_esbuild_shims();
67501
67643
  // packages/cli/src/ui/utils/backgroundWorkUtils.ts
67502
67644
  init_esbuild_shims();
67503
67645
  function hasBlockingBackgroundWork(config) {
67504
- return config.getBackgroundTaskRegistry().hasUnfinalizedTasks() || config.getMonitorRegistry().getRunning().length > 0 || config.getBackgroundShellRegistry().hasRunningEntries();
67646
+ return config.getBackgroundTaskRegistry().hasUnfinalizedTasks() || config.getMonitorRegistry().getRunning().length > 0 || config.getBackgroundShellRegistry().hasRunningEntries() || // R7 (wenshao): the WorkflowRunRegistry is a 4th sibling that the
67647
+ // earlier P4b commit forgot to wire here. Without this OR clause,
67648
+ // /clear and session-resume happily ran while a workflow was
67649
+ // mid-run, orphaning the dispatch loop.
67650
+ config.getWorkflowRunRegistry().hasRunningEntries();
67505
67651
  }
67506
67652
  __name(hasBlockingBackgroundWork, "hasBlockingBackgroundWork");
67507
67653
  function resetBackgroundStateForSessionSwitch(config) {
67508
67654
  config.getBackgroundTaskRegistry().reset();
67509
67655
  config.getMonitorRegistry().reset();
67510
67656
  config.getBackgroundShellRegistry().reset();
67657
+ config.getWorkflowRunRegistry().reset();
67511
67658
  }
67512
67659
  __name(resetBackgroundStateForSessionSwitch, "resetBackgroundStateForSessionSwitch");
67513
67660
 
@@ -69784,7 +69931,6 @@ __name(rollbackStandaloneUpdate, "rollbackStandaloneUpdate");
69784
69931
  // packages/cli/src/utils/installationInfo.ts
69785
69932
  init_esbuild_shims();
69786
69933
  import * as fs16 from "node:fs";
69787
- import * as os14 from "node:os";
69788
69934
  import * as path18 from "node:path";
69789
69935
  import * as childProcess from "node:child_process";
69790
69936
  var debugLogger14 = createDebugLogger("INSTALLATION_INFO");
@@ -69897,27 +70043,11 @@ function getInstallationInfo(projectRoot, isAutoUpdateEnabled) {
69897
70043
  npmPrefixWritable = true;
69898
70044
  } catch {
69899
70045
  }
69900
- if (!npmPrefixWritable && isAutoUpdateEnabled) {
69901
- const installRoot = process.env["HOME"] || os14.homedir();
69902
- if (!installRoot || installRoot === "/") {
69903
- return {
69904
- packageManager: "npm" /* NPM */,
69905
- isGlobal: true,
69906
- updateMessage: "Update requires sudo. Run: sudo npm install -g @qwen-code/qwen-code@latest"
69907
- };
69908
- }
69909
- const fallbackStandaloneDir = path18.join(
69910
- installRoot,
69911
- ".local",
69912
- "lib",
69913
- "qwen-code"
69914
- );
70046
+ if (!npmPrefixWritable) {
69915
70047
  return {
69916
70048
  packageManager: "npm" /* NPM */,
69917
70049
  isGlobal: true,
69918
- isStandalone: true,
69919
- standaloneDir: fallbackStandaloneDir,
69920
- updateMessage: "npm install requires sudo. Migrating to standalone installer for automatic updates."
70050
+ updateMessage: "Update requires sudo. Please run: sudo npm install -g @qwen-code/qwen-code@latest"
69921
70051
  };
69922
70052
  }
69923
70053
  const updateCommand2 = "npm install -g @qwen-code/qwen-code@latest";
@@ -71730,7 +71860,7 @@ async function extractMetadata(conversation, config) {
71730
71860
  const gitBranch = firstRecord?.gitBranch;
71731
71861
  let gitRepo;
71732
71862
  if (cwd5) {
71733
- const { getGitRepoName } = await import("./chunks/src-JMUZP4A4.js");
71863
+ const { getGitRepoName } = await import("./chunks/src-ASRB3EO3.js");
71734
71864
  gitRepo = getGitRepoName(cwd5);
71735
71865
  }
71736
71866
  let model;
@@ -74346,7 +74476,7 @@ init_esbuild_shims();
74346
74476
  init_esbuild_shims();
74347
74477
  var import_strip_json_comments4 = __toESM(require_strip_json_comments(), 1);
74348
74478
  import * as fs18 from "node:fs";
74349
- import * as os15 from "node:os";
74479
+ import * as os14 from "node:os";
74350
74480
  import * as path21 from "node:path";
74351
74481
  function isRecord(value) {
74352
74482
  return !!value && typeof value === "object" && !Array.isArray(value);
@@ -74432,11 +74562,11 @@ function getClaudeProjectSettings(projects, cwd5) {
74432
74562
  return void 0;
74433
74563
  }
74434
74564
  __name(getClaudeProjectSettings, "getClaudeProjectSettings");
74435
- function getClaudeCodeConfigPath(homeDir = os15.homedir()) {
74565
+ function getClaudeCodeConfigPath(homeDir = os14.homedir()) {
74436
74566
  return path21.join(homeDir, ".claude.json");
74437
74567
  }
74438
74568
  __name(getClaudeCodeConfigPath, "getClaudeCodeConfigPath");
74439
- function getClaudeDesktopConfigPath(homeDir = os15.homedir(), platform5 = process.platform, env5 = process.env) {
74569
+ function getClaudeDesktopConfigPath(homeDir = os14.homedir(), platform5 = process.platform, env5 = process.env) {
74440
74570
  if (platform5 === "win32") {
74441
74571
  const appData = env5["APPDATA"] ?? path21.win32.join(homeDir, "AppData", "Roaming");
74442
74572
  return path21.win32.join(appData, "Claude", "claude_desktop_config.json");
@@ -74602,7 +74732,7 @@ function loadClaudeDesktopMcpServers(homeDir, platform5, env5) {
74602
74732
  }
74603
74733
  __name(loadClaudeDesktopMcpServers, "loadClaudeDesktopMcpServers");
74604
74734
  function loadClaudeMcpSources(options) {
74605
- const homeDir = options.homeDir ?? os15.homedir();
74735
+ const homeDir = options.homeDir ?? os14.homedir();
74606
74736
  const cwd5 = options.cwd ?? process.cwd();
74607
74737
  const platform5 = options.platform ?? process.platform;
74608
74738
  const env5 = options.env ?? process.env;
@@ -76865,7 +76995,7 @@ init_esbuild_shims();
76865
76995
  // packages/cli/src/ui/utils/terminalSetup.ts
76866
76996
  init_esbuild_shims();
76867
76997
  import { promises as fs21 } from "node:fs";
76868
- import * as os16 from "node:os";
76998
+ import * as os15 from "node:os";
76869
76999
  import * as path26 from "node:path";
76870
77000
  import { exec as exec3 } from "node:child_process";
76871
77001
  import { promisify } from "node:util";
@@ -76984,7 +77114,7 @@ async function detectTerminal2() {
76984
77114
  if (termProgram === "vscode" || process.env["VSCODE_GIT_IPC_HANDLE"]) {
76985
77115
  return "vscode";
76986
77116
  }
76987
- if (os16.platform() !== "win32") {
77117
+ if (os15.platform() !== "win32") {
76988
77118
  try {
76989
77119
  const { stdout } = await execAsync("ps -o comm= -p $PPID");
76990
77120
  const parentName = stdout.trim();
@@ -77014,10 +77144,10 @@ async function backupFile(filePath) {
77014
77144
  }
77015
77145
  __name(backupFile, "backupFile");
77016
77146
  function getVSCodeStyleConfigDir(appName) {
77017
- const platform5 = os16.platform();
77147
+ const platform5 = os15.platform();
77018
77148
  if (platform5 === "darwin") {
77019
77149
  return path26.join(
77020
- os16.homedir(),
77150
+ os15.homedir(),
77021
77151
  "Library",
77022
77152
  "Application Support",
77023
77153
  appName,
@@ -77029,7 +77159,7 @@ function getVSCodeStyleConfigDir(appName) {
77029
77159
  }
77030
77160
  return path26.join(process.env["APPDATA"], appName, "User");
77031
77161
  } else {
77032
- return path26.join(os16.homedir(), ".config", appName, "User");
77162
+ return path26.join(os15.homedir(), ".config", appName, "User");
77033
77163
  }
77034
77164
  }
77035
77165
  __name(getVSCodeStyleConfigDir, "getVSCodeStyleConfigDir");
@@ -79281,6 +79411,12 @@ var BuiltinCommandLoader = class {
79281
79411
  aboutCommand,
79282
79412
  agentsCommand,
79283
79413
  tasksCommand,
79414
+ // Gated behind isWorkflowsEnabled — feature flag honors
79415
+ // QWEN_CODE_ENABLE_WORKFLOWS (opt-in) and QWEN_CODE_DISABLE_WORKFLOWS
79416
+ // (kill switch). When the flag is off the command vanishes entirely
79417
+ // from typeahead and help, matching the established convention for
79418
+ // experimental builtins.
79419
+ this.config?.isWorkflowsEnabled() ? workflowsCommand : null,
79284
79420
  arenaCommand,
79285
79421
  approvalModeCommand,
79286
79422
  authCommand2,
@@ -83923,7 +84059,7 @@ var SystemController = class extends BaseController {
83923
84059
  throw new Error("Request aborted");
83924
84060
  }
83925
84061
  try {
83926
- const mod = await import("./chunks/contextCommand-E2V26QGD.js");
84062
+ const mod = await import("./chunks/contextCommand-O5DLQUIZ.js");
83927
84063
  if (signal.aborted) {
83928
84064
  throw new Error("Request aborted");
83929
84065
  }
@@ -87774,6 +87910,22 @@ __name(loadLowlight, "loadLowlight");
87774
87910
  // packages/cli/src/ui/utils/CodeColorizer.tsx
87775
87911
  var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1);
87776
87912
  var debugLogger37 = createDebugLogger("CODE_COLORIZER");
87913
+ var STRUCTURAL_BOX_RE = /[│├└┌┐┘┬┴┼]/;
87914
+ var CJK_RE = /[\u4E00-\u9FFF\u3400-\u4DBF]/g;
87915
+ function looksLikeDiagramOrArt(line) {
87916
+ const trimmed = line.trim();
87917
+ if (trimmed.length === 0) return false;
87918
+ if (STRUCTURAL_BOX_RE.test(trimmed)) {
87919
+ return true;
87920
+ }
87921
+ const cjkMatches = trimmed.match(CJK_RE) || [];
87922
+ const totalChars = trimmed.replace(/\s/g, "").length;
87923
+ if (totalChars > 0 && cjkMatches.length / totalChars > 0.3) {
87924
+ return true;
87925
+ }
87926
+ return false;
87927
+ }
87928
+ __name(looksLikeDiagramOrArt, "looksLikeDiagramOrArt");
87777
87929
  function renderHastNode(node, theme2, inheritedColor) {
87778
87930
  if (node.type === "text") {
87779
87931
  const color2 = inheritedColor || theme2.defaultColor;
@@ -87819,6 +87971,9 @@ function highlightAndRenderLine(line, language, theme2, lowlight) {
87819
87971
  if (!lowlight) {
87820
87972
  return line;
87821
87973
  }
87974
+ if (!language && looksLikeDiagramOrArt(line)) {
87975
+ return line;
87976
+ }
87822
87977
  try {
87823
87978
  const getHighlightedLine = /* @__PURE__ */ __name(() => !language || !lowlight.registered(language) ? lowlight.highlightAuto(line) : lowlight.highlight(language, line), "getHighlightedLine");
87824
87979
  const renderedNode = renderHastNode(getHighlightedLine(), theme2, void 0);
@@ -90778,7 +90933,7 @@ __name(renderMermaidVisual, "renderMermaidVisual");
90778
90933
  init_esbuild_shims();
90779
90934
  import crypto2 from "node:crypto";
90780
90935
  import fs27 from "node:fs";
90781
- import os17 from "node:os";
90936
+ import os16 from "node:os";
90782
90937
  import path35 from "node:path";
90783
90938
  import { spawn as spawn4, spawnSync } from "node:child_process";
90784
90939
  var CACHE_LIMIT = 40;
@@ -91342,7 +91497,7 @@ function isExecutable(filePath) {
91342
91497
  __name(isExecutable, "isExecutable");
91343
91498
  async function renderPngWithMmdcAsync(source, mmdc, env5, signal) {
91344
91499
  const tempDir = await fs27.promises.mkdtemp(
91345
- path35.join(os17.tmpdir(), "qwen-mermaid-")
91500
+ path35.join(os16.tmpdir(), "qwen-mermaid-")
91346
91501
  );
91347
91502
  const inputPath = path35.join(tempDir, "diagram.mmd");
91348
91503
  const outputPath = path35.join(tempDir, "diagram.png");
@@ -91439,7 +91594,7 @@ function getMermaidCellAspectRatio(env5) {
91439
91594
  __name(getMermaidCellAspectRatio, "getMermaidCellAspectRatio");
91440
91595
  async function renderPngWithChafaAsync(png, widthCells, rows, chafa, env5, signal) {
91441
91596
  const tempDir = await fs27.promises.mkdtemp(
91442
- path35.join(os17.tmpdir(), "qwen-mermaid-")
91597
+ path35.join(os16.tmpdir(), "qwen-mermaid-")
91443
91598
  );
91444
91599
  const imagePath = path35.join(tempDir, "diagram.png");
91445
91600
  try {
@@ -92668,39 +92823,143 @@ var AssistantMessageContent = /* @__PURE__ */ __name(({
92668
92823
  sourceCopyIndexOffsets
92669
92824
  }
92670
92825
  ), "AssistantMessageContent");
92826
+ var MAX_STREAMING_THINKING_VISUAL_LINES = 4;
92827
+ function wrapToVisualLines(text, width) {
92828
+ if (width <= 0) {
92829
+ return [""];
92830
+ }
92831
+ const visualLines = [];
92832
+ for (const logicalLine of text.split("\n")) {
92833
+ if (logicalLine === "") {
92834
+ visualLines.push("");
92835
+ continue;
92836
+ }
92837
+ let currentLine = "";
92838
+ let currentWidth = 0;
92839
+ for (const char of logicalLine) {
92840
+ const charWidth = getCachedStringWidth(char);
92841
+ if (currentWidth + charWidth > width && currentWidth > 0) {
92842
+ visualLines.push(currentLine);
92843
+ currentLine = "";
92844
+ currentWidth = 0;
92845
+ }
92846
+ currentLine += char;
92847
+ currentWidth += charWidth;
92848
+ }
92849
+ if (currentLine) {
92850
+ visualLines.push(currentLine);
92851
+ }
92852
+ }
92853
+ if (visualLines.length === 0) {
92854
+ visualLines.push("");
92855
+ }
92856
+ return visualLines;
92857
+ }
92858
+ __name(wrapToVisualLines, "wrapToVisualLines");
92859
+ function tailVisualLines(text, width, maxLines) {
92860
+ const charBudget = maxLines * width * 2;
92861
+ let sliceStart = Math.max(0, text.length - charBudget);
92862
+ if (sliceStart > 0) {
92863
+ const nl = text.indexOf("\n", sliceStart);
92864
+ if (nl !== -1 && nl < text.length - 1) {
92865
+ sliceStart = nl + 1;
92866
+ }
92867
+ }
92868
+ const lines = wrapToVisualLines(text.slice(sliceStart), width);
92869
+ return lines.slice(-maxLines).join("\n");
92870
+ }
92871
+ __name(tailVisualLines, "tailVisualLines");
92872
+ function formatDuration2(ms) {
92873
+ const totalSeconds = Math.round(ms / 1e3);
92874
+ if (totalSeconds < 60) {
92875
+ return `${totalSeconds}s`;
92876
+ }
92877
+ const minutes = Math.floor(totalSeconds / 60);
92878
+ const seconds = totalSeconds % 60;
92879
+ return seconds > 0 ? `${minutes}m ${seconds}s` : `${minutes}m`;
92880
+ }
92881
+ __name(formatDuration2, "formatDuration");
92671
92882
  var ThinkMessage = /* @__PURE__ */ __name(({
92672
92883
  text,
92673
92884
  isPending,
92885
+ expanded = false,
92674
92886
  availableTerminalHeight,
92675
- contentWidth
92676
- }) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
92677
- PrefixedMarkdownMessage,
92678
- {
92679
- text,
92680
- prefix: "\u2726",
92681
- prefixColor: theme.text.secondary,
92682
- isPending,
92683
- availableTerminalHeight,
92684
- contentWidth,
92685
- textColor: theme.text.secondary
92887
+ contentWidth,
92888
+ durationMs
92889
+ }) => {
92890
+ const durationSuffix = durationMs != null ? ` ${formatDuration2(durationMs)}` : "";
92891
+ if (!isPending && !expanded) {
92892
+ const label = durationMs != null ? `${t("Thought for")} ${formatDuration2(durationMs)}` : t("Thinking");
92893
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text, { dimColor: true, italic: true, children: label });
92894
+ }
92895
+ if (isPending) {
92896
+ const innerWidth = Math.max(contentWidth - 2, 20);
92897
+ const maxLines = availableTerminalHeight != null ? Math.max(
92898
+ 1,
92899
+ Math.min(
92900
+ MAX_STREAMING_THINKING_VISUAL_LINES,
92901
+ Math.floor(availableTerminalHeight / 3)
92902
+ )
92903
+ ) : MAX_STREAMING_THINKING_VISUAL_LINES;
92904
+ const display = tailVisualLines(text, innerWidth, maxLines);
92905
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Box_default, { flexDirection: "column", children: [
92906
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Text, { dimColor: true, italic: true, children: [
92907
+ "\u27E1 ",
92908
+ t("Thinking"),
92909
+ "\u2026",
92910
+ durationSuffix
92911
+ ] }),
92912
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Box_default, { paddingLeft: 2, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text, { dimColor: true, wrap: "truncate", children: display }) })
92913
+ ] });
92686
92914
  }
92687
- ), "ThinkMessage");
92915
+ const expandedLabel = durationMs != null ? `${t("Thought for")} ${formatDuration2(durationMs)}` : `${t("Thinking")}\u2026`;
92916
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Box_default, { flexDirection: "column", children: [
92917
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text, { dimColor: true, italic: true, children: expandedLabel }),
92918
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Box_default, { paddingLeft: 2, flexDirection: "column", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
92919
+ MarkdownDisplay,
92920
+ {
92921
+ text,
92922
+ isPending: false,
92923
+ availableTerminalHeight,
92924
+ contentWidth: contentWidth - 2,
92925
+ textColor: theme.text.secondary
92926
+ }
92927
+ ) })
92928
+ ] });
92929
+ }, "ThinkMessage");
92688
92930
  var ThinkMessageContent = /* @__PURE__ */ __name(({
92689
92931
  text,
92690
92932
  isPending,
92933
+ expanded = false,
92691
92934
  availableTerminalHeight,
92692
92935
  contentWidth
92693
- }) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
92694
- ContinuationMarkdownMessage,
92695
- {
92696
- text,
92697
- isPending,
92698
- availableTerminalHeight,
92699
- contentWidth,
92700
- basePrefix: "\u2726",
92701
- textColor: theme.text.secondary
92936
+ }) => {
92937
+ if (!isPending && !expanded) {
92938
+ return null;
92939
+ }
92940
+ if (isPending) {
92941
+ const innerWidth = Math.max(contentWidth - 2, 20);
92942
+ const maxLines = availableTerminalHeight != null ? Math.max(
92943
+ 1,
92944
+ Math.min(
92945
+ MAX_STREAMING_THINKING_VISUAL_LINES,
92946
+ Math.floor(availableTerminalHeight / 3)
92947
+ )
92948
+ ) : MAX_STREAMING_THINKING_VISUAL_LINES;
92949
+ const display = tailVisualLines(text, innerWidth, maxLines);
92950
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Box_default, { paddingLeft: 2, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text, { dimColor: true, wrap: "truncate", children: display }) });
92702
92951
  }
92703
- ), "ThinkMessageContent");
92952
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Box_default, { paddingLeft: 2, flexDirection: "column", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
92953
+ MarkdownDisplay,
92954
+ {
92955
+ text,
92956
+ isPending: false,
92957
+ availableTerminalHeight,
92958
+ contentWidth: contentWidth - 2,
92959
+ textColor: theme.text.secondary
92960
+ }
92961
+ ) });
92962
+ }, "ThinkMessageContent");
92704
92963
 
92705
92964
  // packages/cli/src/ui/components/messages/ToolGroupMessage.tsx
92706
92965
  init_esbuild_shims();
@@ -93122,7 +93381,7 @@ init_esbuild_shims();
93122
93381
  var import_react58 = __toESM(require_react(), 1);
93123
93382
  import { spawnSync as spawnSync2 } from "node:child_process";
93124
93383
  import fs28 from "node:fs";
93125
- import os18 from "node:os";
93384
+ import os17 from "node:os";
93126
93385
  import pathMod from "node:path";
93127
93386
 
93128
93387
  // packages/cli/src/ui/components/shared/vim-buffer-actions.ts
@@ -95474,7 +95733,7 @@ function useTextBuffer({
95474
95733
  let tmpDir;
95475
95734
  let filePath;
95476
95735
  try {
95477
- tmpDir = fs28.mkdtempSync(pathMod.join(os18.tmpdir(), "qwen-edit-"));
95736
+ tmpDir = fs28.mkdtempSync(pathMod.join(os17.tmpdir(), "qwen-edit-"));
95478
95737
  filePath = pathMod.join(tmpDir, "buffer.txt");
95479
95738
  } catch (err) {
95480
95739
  debugLogger39.error(
@@ -101218,20 +101477,23 @@ var HistoryItemDisplayComponent = /* @__PURE__ */ __name(({
101218
101477
  sourceCopyIndexOffsets
101219
101478
  }
101220
101479
  ),
101221
- !compactMode && itemForDisplay.type === "gemini_thought" && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
101480
+ itemForDisplay.type === "gemini_thought" && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
101222
101481
  ThinkMessage,
101223
101482
  {
101224
101483
  text: itemForDisplay.text.trimEnd(),
101225
101484
  isPending,
101485
+ expanded: false,
101226
101486
  availableTerminalHeight: availableTerminalHeightGemini ?? availableTerminalHeight,
101227
- contentWidth
101487
+ contentWidth,
101488
+ durationMs: itemForDisplay.durationMs
101228
101489
  }
101229
101490
  ),
101230
- !compactMode && itemForDisplay.type === "gemini_thought_content" && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
101491
+ itemForDisplay.type === "gemini_thought_content" && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
101231
101492
  ThinkMessageContent,
101232
101493
  {
101233
101494
  text: itemForDisplay.text.trimEnd(),
101234
101495
  isPending,
101496
+ expanded: false,
101235
101497
  availableTerminalHeight: availableTerminalHeightGemini ?? availableTerminalHeight,
101236
101498
  contentWidth
101237
101499
  }
@@ -108012,7 +108274,7 @@ __name(TrustDialog, "TrustDialog");
108012
108274
  init_esbuild_shims();
108013
108275
  var import_react108 = __toESM(require_react(), 1);
108014
108276
  import * as fs31 from "node:fs";
108015
- import * as os19 from "node:os";
108277
+ import * as os18 from "node:os";
108016
108278
  import * as nodePath2 from "node:path";
108017
108279
  var import_jsx_runtime86 = __toESM(require_jsx_runtime(), 1);
108018
108280
  function getPermScopeItems() {
@@ -108127,7 +108389,7 @@ function PermissionsDialog({
108127
108389
  const dirCompletions = (0, import_react108.useMemo)(() => {
108128
108390
  const trimmed = newDirInput.trim();
108129
108391
  if (!trimmed) return [];
108130
- const expanded = trimmed.startsWith("~") ? trimmed.replace(/^~/, os19.homedir()) : trimmed;
108392
+ const expanded = trimmed.startsWith("~") ? trimmed.replace(/^~/, os18.homedir()) : trimmed;
108131
108393
  const endsWithSep = expanded.endsWith("/") || expanded.endsWith(nodePath2.sep);
108132
108394
  const searchDir = endsWithSep ? expanded : nodePath2.dirname(expanded);
108133
108395
  const prefix = endsWithSep ? "" : nodePath2.basename(expanded);
@@ -108201,7 +108463,7 @@ function PermissionsDialog({
108201
108463
  const handleAddDirSubmit = (0, import_react108.useCallback)(() => {
108202
108464
  const trimmed = newDirInput.trim();
108203
108465
  if (!trimmed) return;
108204
- const expanded = trimmed.startsWith("~") ? trimmed.replace(/^~/, os19.homedir()) : trimmed;
108466
+ const expanded = trimmed.startsWith("~") ? trimmed.replace(/^~/, os18.homedir()) : trimmed;
108205
108467
  const absoluteExpanded = nodePath2.isAbsolute(expanded) ? expanded : nodePath2.resolve(expanded);
108206
108468
  if (!fs31.existsSync(absoluteExpanded)) {
108207
108469
  setDirInputError(t("Directory does not exist."));
@@ -108869,7 +109131,9 @@ function ModelDialog({
108869
109131
  const availableModelEntries = (0, import_react109.useMemo)(() => {
108870
109132
  const allModels = config ? config.getAllConfiguredModels() : [];
108871
109133
  const runtimeModels = allModels.filter((m) => m.isRuntimeModel);
108872
- const registryModels = allModels.filter((m) => !m.isRuntimeModel);
109134
+ const registryModels = allModels.filter(
109135
+ (m) => !m.isRuntimeModel && (m.authType !== "qwen-oauth" /* QWEN_OAUTH */ || authType === "qwen-oauth" /* QWEN_OAUTH */)
109136
+ );
108873
109137
  const modelsByAuthTypeMap = /* @__PURE__ */ new Map();
108874
109138
  for (const model of registryModels) {
108875
109139
  const authType2 = model.authType;
@@ -108904,7 +109168,7 @@ function ModelDialog({
108904
109168
  }
108905
109169
  }
108906
109170
  return result;
108907
- }, [config]);
109171
+ }, [authType, config]);
108908
109172
  const MODEL_OPTIONS = (0, import_react109.useMemo)(
108909
109173
  () => availableModelEntries.map(
108910
109174
  ({ authType: t2, model, isRuntime, snapshotId }) => {
@@ -117891,7 +118155,7 @@ function convertToHistoryItems(conversation, config) {
117891
118155
  }
117892
118156
  case "assistant": {
117893
118157
  const parts = record.message?.parts;
117894
- const thoughtText = !config || !config.getContentGenerator().useSummarizedThinking() ? extractThoughtTextFromParts(parts) : "";
118158
+ const thoughtText = !config ? extractThoughtTextFromParts(parts) : "";
117895
118159
  const text = extractTextFromParts(parts);
117896
118160
  const functionCalls = extractFunctionCalls(parts);
117897
118161
  if (thoughtText) {
@@ -119368,7 +119632,7 @@ __name(emptyMessage, "emptyMessage");
119368
119632
  init_esbuild_shims();
119369
119633
  var import_react146 = __toESM(require_react(), 1);
119370
119634
  import fs32 from "node:fs/promises";
119371
- import os20 from "node:os";
119635
+ import os19 from "node:os";
119372
119636
  import path39 from "node:path";
119373
119637
  import { spawnSync as spawnSync4 } from "node:child_process";
119374
119638
  var import_jsx_runtime144 = __toESM(require_jsx_runtime(), 1);
@@ -119420,7 +119684,7 @@ async function ensureFileExists(filePath) {
119420
119684
  }
119421
119685
  __name(ensureFileExists, "ensureFileExists");
119422
119686
  function formatDisplayPath(filePath) {
119423
- const home = os20.homedir();
119687
+ const home = os19.homedir();
119424
119688
  if (filePath.startsWith(home)) {
119425
119689
  return `~${filePath.slice(home.length)}`;
119426
119690
  }
@@ -119755,6 +120019,8 @@ function entryId(entry) {
119755
120019
  return entry.shellId;
119756
120020
  case "monitor":
119757
120021
  return entry.monitorId;
120022
+ case "workflow":
120023
+ return entry.runId;
119758
120024
  case "dream":
119759
120025
  return entry.dreamId;
119760
120026
  default: {
@@ -119773,6 +120039,7 @@ function useBackgroundTaskView(config) {
119773
120039
  const agentRegistry = config.getBackgroundTaskRegistry();
119774
120040
  const shellRegistry = config.getBackgroundShellRegistry();
119775
120041
  const monitorRegistry = config.getMonitorRegistry();
120042
+ const workflowRegistry = config.getWorkflowRunRegistry();
119776
120043
  const memoryManager = config.getMemoryManager();
119777
120044
  const projectRoot = config.getProjectRoot();
119778
120045
  let lastDreamSig = "";
@@ -119781,6 +120048,7 @@ function useBackgroundTaskView(config) {
119781
120048
  const agentEntries = [...agentRegistry.getAll()];
119782
120049
  const shellEntries = [...shellRegistry.getAll()];
119783
120050
  const monitorEntries = [...monitorRegistry.getAll()];
120051
+ const workflowEntries = [...workflowRegistry.list()];
119784
120052
  const allDreams = dreamSnapshot ?? memoryManager.listTasksByType("dream", projectRoot);
119785
120053
  const runningDreams = allDreams.filter((t2) => t2.status === "running");
119786
120054
  const terminalDreams = allDreams.filter(
@@ -119813,6 +120081,7 @@ function useBackgroundTaskView(config) {
119813
120081
  ...agentEntries,
119814
120082
  ...shellEntries,
119815
120083
  ...monitorEntries,
120084
+ ...workflowEntries,
119816
120085
  ...dreamEntries
119817
120086
  ].sort((a, b) => {
119818
120087
  const aActive = isActive(a);
@@ -119829,6 +120098,7 @@ function useBackgroundTaskView(config) {
119829
120098
  agentRegistry.setStatusChangeCallback(refreshFromRegistry);
119830
120099
  shellRegistry.setStatusChangeCallback(refreshFromRegistry);
119831
120100
  monitorRegistry.setStatusChangeCallback(refreshFromRegistry);
120101
+ workflowRegistry.setStatusChangeCallback(refreshFromRegistry);
119832
120102
  agentRegistry.setApprovalChangeCallback(refreshFromRegistry);
119833
120103
  const memoryListener = /* @__PURE__ */ __name(() => {
119834
120104
  const dreams = memoryManager.listTasksByType("dream", projectRoot);
@@ -119843,6 +120113,7 @@ function useBackgroundTaskView(config) {
119843
120113
  agentRegistry.setStatusChangeCallback(void 0);
119844
120114
  shellRegistry.setStatusChangeCallback(void 0);
119845
120115
  monitorRegistry.setStatusChangeCallback(void 0);
120116
+ workflowRegistry.setStatusChangeCallback(void 0);
119846
120117
  agentRegistry.setApprovalChangeCallback(void 0);
119847
120118
  unsubscribeMemory();
119848
120119
  };
@@ -119977,6 +120248,9 @@ function BackgroundTaskViewProvider({
119977
120248
  }
119978
120249
  break;
119979
120250
  }
120251
+ case "workflow":
120252
+ config.getWorkflowRunRegistry().cancel(target.runId, Date.now());
120253
+ break;
119980
120254
  default: {
119981
120255
  const _exhaustive = target;
119982
120256
  throw new Error(
@@ -120153,6 +120427,12 @@ function rowLabel(entry) {
120153
120427
  return `${SHELL_ROW_PREFIX} ${entry.command}`;
120154
120428
  case "monitor":
120155
120429
  return `[monitor] ${entry.description}`;
120430
+ case "workflow": {
120431
+ const label = entry.meta?.name ?? entry.runId;
120432
+ const phase = entry.currentPhase ? ` \xB7 ${entry.currentPhase}` : "";
120433
+ const counts = entry.agentsDispatched > 0 ? ` (${entry.agentsCompleted}/${entry.agentsDispatched})` : "";
120434
+ return `[workflow] ${label}${phase}${counts}`;
120435
+ }
120156
120436
  case "dream":
120157
120437
  return formatDreamRowLabel(entry);
120158
120438
  default: {
@@ -120267,6 +120547,15 @@ var DetailBody = /* @__PURE__ */ __name(({ entry, maxHeight, maxWidth }) => {
120267
120547
  maxWidth
120268
120548
  }
120269
120549
  );
120550
+ case "workflow":
120551
+ return /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
120552
+ WorkflowDetailBody,
120553
+ {
120554
+ entry,
120555
+ maxHeight,
120556
+ maxWidth
120557
+ }
120558
+ );
120270
120559
  case "dream":
120271
120560
  return /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
120272
120561
  DreamDetailBody,
@@ -120525,6 +120814,69 @@ var MonitorDetailBody = /* @__PURE__ */ __name(({ entry, maxHeight, maxWidth })
120525
120814
  }
120526
120815
  );
120527
120816
  }, "MonitorDetailBody");
120817
+ var MAX_VISIBLE_PHASES = 20;
120818
+ var MAX_VISIBLE_LOG_LINES = 10;
120819
+ var WorkflowDetailBody = /* @__PURE__ */ __name(({ entry, maxHeight, maxWidth }) => {
120820
+ const title = `${t("Workflow")} \u203A ${entry.meta?.name ?? entry.runId}`;
120821
+ const terminal = terminalStatusPresentation(entry.status);
120822
+ const dimSubtitleParts = [elapsedFor(entry)];
120823
+ if (entry.agentsDispatched > 0) {
120824
+ dimSubtitleParts.push(
120825
+ `${entry.agentsCompleted}/${entry.agentsDispatched} ${t("agents")}`
120826
+ );
120827
+ }
120828
+ dimSubtitleParts.push(
120829
+ `${entry.phases.length} ${entry.phases.length === 1 ? t("phase") : t("phases")}`
120830
+ );
120831
+ const phaseOverflow = Math.max(0, entry.phases.length - MAX_VISIBLE_PHASES);
120832
+ const visiblePhases = entry.phases.slice(-MAX_VISIBLE_PHASES);
120833
+ const logOverflow = Math.max(
120834
+ 0,
120835
+ entry.recentLogs.length - MAX_VISIBLE_LOG_LINES
120836
+ );
120837
+ const visibleLogs = entry.recentLogs.slice(-MAX_VISIBLE_LOG_LINES);
120838
+ const hasError = Boolean(entry.error);
120839
+ return /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)(
120840
+ MaxSizedBox,
120841
+ {
120842
+ maxHeight,
120843
+ maxWidth,
120844
+ overflowDirection: "bottom",
120845
+ children: [
120846
+ /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(Text, { bold: true, color: theme.text.accent, children: title }) }),
120847
+ /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)(Box_default, { children: [
120848
+ terminal && /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(Text, { color: terminal.color, children: `${terminal.icon} ${statusVerb(entry.status)} \xB7 ` }),
120849
+ /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(Text, { color: theme.text.secondary, children: dimSubtitleParts.join(" \xB7 ") })
120850
+ ] }),
120851
+ entry.meta?.description && /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)(import_react149.Fragment, { children: [
120852
+ /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(Box_default, {}),
120853
+ /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(Text, { wrap: "wrap", children: entry.meta.description }) })
120854
+ ] }),
120855
+ /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(Box_default, {}),
120856
+ /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(Text, { bold: true, dimColor: true, children: t("Phases") }) }),
120857
+ entry.phases.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(Text, { dimColor: true, children: t("(no phase recorded yet)") }) }) : /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)(import_react149.Fragment, { children: [
120858
+ phaseOverflow > 0 && /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(Text, { dimColor: true, children: `+${phaseOverflow} ${t("more above")}` }) }),
120859
+ visiblePhases.map((phaseTitle, i) => {
120860
+ const isCurrent = entry.status === "running" && i === visiblePhases.length - 1 && entry.currentPhase === phaseTitle;
120861
+ const marker = isCurrent ? "\u25B8" : "\xB7";
120862
+ return /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(Text, { color: isCurrent ? theme.status.success : void 0, children: ` ${marker} ${phaseTitle}` }) }, `${phaseTitle}-${i}`);
120863
+ })
120864
+ ] }),
120865
+ entry.recentLogs.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)(import_react149.Fragment, { children: [
120866
+ /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(Box_default, {}),
120867
+ /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(Text, { bold: true, dimColor: true, children: t("Logs") }) }),
120868
+ logOverflow > 0 && /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(Text, { dimColor: true, children: `+${logOverflow} ${t("more above")}` }) }),
120869
+ visibleLogs.map((line, i) => /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(Text, { wrap: "truncate-end", dimColor: true, children: line }) }, `log-${i}`))
120870
+ ] }),
120871
+ hasError && /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)(import_react149.Fragment, { children: [
120872
+ /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(Box_default, {}),
120873
+ /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(Text, { bold: true, color: theme.status.error, children: t("Error") }) }),
120874
+ /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(Text, { color: theme.status.error, wrap: "wrap", children: entry.error }) })
120875
+ ] })
120876
+ ]
120877
+ }
120878
+ );
120879
+ }, "WorkflowDetailBody");
120528
120880
  var BackgroundTasksDialog = /* @__PURE__ */ __name(({
120529
120881
  availableTerminalHeight,
120530
120882
  terminalWidth
@@ -121347,7 +121699,6 @@ var LoadingIndicator = /* @__PURE__ */ __name(({
121347
121699
  currentLoadingPhrase,
121348
121700
  elapsedTime,
121349
121701
  rightContent,
121350
- thought,
121351
121702
  candidatesTokens,
121352
121703
  streamingCharsRef,
121353
121704
  isStreaming,
@@ -121364,7 +121715,7 @@ var LoadingIndicator = /* @__PURE__ */ __name(({
121364
121715
  if (streamingState === "idle" /* Idle */) {
121365
121716
  return null;
121366
121717
  }
121367
- const primaryText = thought?.subject || currentLoadingPhrase;
121718
+ const primaryText = currentLoadingPhrase;
121368
121719
  const streamingTokens = streamingCharsRef ? Math.round(animatedChars / 4) : 0;
121369
121720
  const outputTokens = (candidatesTokens ?? 0) + streamingTokens;
121370
121721
  const showTokens = !isNarrow && outputTokens > 0;
@@ -125085,6 +125436,7 @@ var KIND_NAMES = {
125085
125436
  agent: { singular: "local agent", plural: "local agents" },
125086
125437
  shell: { singular: "shell", plural: "shells" },
125087
125438
  monitor: { singular: "monitor", plural: "monitors" },
125439
+ workflow: { singular: "workflow", plural: "workflows" },
125088
125440
  dream: { singular: "dream", plural: "dreams" }
125089
125441
  };
125090
125442
  function hasPendingApproval(entries) {
@@ -125109,12 +125461,13 @@ function getPillLabel(entries) {
125109
125461
  }
125110
125462
  __name(getPillLabel, "getPillLabel");
125111
125463
  function groupAndFormat(entries) {
125112
- const counts = { agent: 0, shell: 0, monitor: 0, dream: 0 };
125464
+ const counts = { agent: 0, shell: 0, monitor: 0, workflow: 0, dream: 0 };
125113
125465
  for (const e of entries) counts[e.kind]++;
125114
125466
  const parts = [];
125115
125467
  if (counts.shell > 0) parts.push(formatCount("shell", counts.shell));
125116
125468
  if (counts.agent > 0) parts.push(formatCount("agent", counts.agent));
125117
125469
  if (counts.monitor > 0) parts.push(formatCount("monitor", counts.monitor));
125470
+ if (counts.workflow > 0) parts.push(formatCount("workflow", counts.workflow));
125118
125471
  if (counts.dream > 0) parts.push(formatCount("dream", counts.dream));
125119
125472
  return parts.join(", ");
125120
125473
  }
@@ -126023,7 +126376,6 @@ var Composer = /* @__PURE__ */ __name(() => {
126023
126376
  !uiState.embeddedShellFocused && !suppressBottomLoadingIndicator && /* @__PURE__ */ (0, import_jsx_runtime164.jsx)(
126024
126377
  LoadingIndicator,
126025
126378
  {
126026
- thought: uiState.streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */ || config.getAccessibility()?.enableLoadingPhrases === false ? void 0 : uiState.thought,
126027
126379
  currentLoadingPhrase: config.getAccessibility()?.enableLoadingPhrases === false ? void 0 : uiState.currentLoadingPhrase,
126028
126380
  elapsedTime: uiState.elapsedTime,
126029
126381
  candidatesTokens: agentTokens,
@@ -127473,12 +127825,12 @@ import process38 from "node:process";
127473
127825
  init_esbuild_shims();
127474
127826
  var import_react184 = __toESM(require_react(), 1);
127475
127827
  import process25 from "node:process";
127476
- import os21 from "node:os";
127828
+ import os20 from "node:os";
127477
127829
  import v82 from "v8";
127478
127830
  var debugLogger61 = createDebugLogger("MEMORY_MONITOR");
127479
127831
  var MEMORY_WARNING_THRESHOLD = Math.min(
127480
127832
  7 * 1024 * 1024 * 1024,
127481
- Math.floor(os21.totalmem() * 0.85)
127833
+ Math.floor(os20.totalmem() * 0.85)
127482
127834
  );
127483
127835
  var MEMORY_UI_COMPACT_THRESHOLD = /* @__PURE__ */ __name(() => Math.floor(v82.getHeapStatistics().heap_size_limit * 0.65), "MEMORY_UI_COMPACT_THRESHOLD");
127484
127836
  var MEMORY_CHECK_INTERVAL = 60 * 1e3;
@@ -129190,7 +129542,7 @@ init_esbuild_shims();
129190
129542
  var import_react198 = __toESM(require_react(), 1);
129191
129543
  import crypto4 from "node:crypto";
129192
129544
  import path42 from "node:path";
129193
- import os22 from "node:os";
129545
+ import os21 from "node:os";
129194
129546
  import fs36 from "node:fs";
129195
129547
  var OUTPUT_UPDATE_INTERVAL_MS = 1e3;
129196
129548
  var MAX_OUTPUT_LENGTH = 1e4;
@@ -129228,14 +129580,14 @@ var useShellCommandProcessor = /* @__PURE__ */ __name((addItemToHistory, setPend
129228
129580
  { type: "user_shell", text: rawQuery },
129229
129581
  userMessageTimestamp
129230
129582
  );
129231
- const isWindows4 = os22.platform() === "win32";
129583
+ const isWindows4 = os21.platform() === "win32";
129232
129584
  const targetDir = config.getTargetDir();
129233
129585
  let commandToExecute = rawQuery;
129234
129586
  let pwdFilePath;
129235
129587
  if (!isWindows4) {
129236
129588
  let command2 = rawQuery.trim();
129237
129589
  const pwdFileName = `shell_pwd_${crypto4.randomBytes(6).toString("hex")}.tmp`;
129238
- pwdFilePath = path42.join(os22.tmpdir(), pwdFileName);
129590
+ pwdFilePath = path42.join(os21.tmpdir(), pwdFileName);
129239
129591
  if (!command2.endsWith(";") && !command2.endsWith("&")) {
129240
129592
  command2 += ";";
129241
129593
  }
@@ -129911,6 +130263,8 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
129911
130263
  }, [history]);
129912
130264
  const summaryAbortRefsRef = (0, import_react202.useRef)(/* @__PURE__ */ new Set());
129913
130265
  const [pendingHistoryItem, pendingHistoryItemRef, setPendingHistoryItem] = useStateAndRef(null);
130266
+ const [pendingThoughtItem, pendingThoughtItemRef, setPendingThoughtItem] = useStateAndRef(null);
130267
+ const thoughtStartTimeRef = (0, import_react202.useRef)(null);
129914
130268
  const [
129915
130269
  pendingRetryErrorItem,
129916
130270
  pendingRetryErrorItemRef,
@@ -130323,7 +130677,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
130323
130677
  [setThought]
130324
130678
  );
130325
130679
  const handleThoughtEvent = (0, import_react202.useCallback)(
130326
- (eventValue, currentThoughtBuffer, userMessageTimestamp) => {
130680
+ (eventValue, currentThoughtBuffer) => {
130327
130681
  if (turnCancelledRef.current) {
130328
130682
  return "";
130329
130683
  }
@@ -130331,56 +130685,41 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
130331
130685
  if (!thoughtText) {
130332
130686
  return currentThoughtBuffer;
130333
130687
  }
130334
- let newThoughtBuffer = currentThoughtBuffer + thoughtText;
130335
- if (debugLogger66.isEnabled()) {
130336
- debugLogger66.debug(
130337
- `[THOUGHT_BUFFER] Buffer growing: current=${currentThoughtBuffer.length}, incoming=${thoughtText.length}, total=${newThoughtBuffer.length}`
130338
- );
130688
+ const newThoughtBuffer = currentThoughtBuffer + thoughtText;
130689
+ if (newThoughtBuffer.trim().length === 0) {
130690
+ return newThoughtBuffer;
130339
130691
  }
130340
- const pendingType = pendingHistoryItemRef.current?.type;
130341
- const isPendingThought = pendingType === "gemini_thought" || pendingType === "gemini_thought_content";
130342
- let thoughtToMerge = eventValue;
130343
- if (!isPendingThought) {
130344
- if (newThoughtBuffer.trim().length === 0) {
130345
- return newThoughtBuffer;
130346
- }
130347
- if (pendingHistoryItemRef.current) {
130348
- addItem(pendingHistoryItemRef.current, userMessageTimestamp);
130349
- }
130350
- newThoughtBuffer = stripLeadingBlankLines(newThoughtBuffer);
130351
- thoughtToMerge = {
130352
- ...eventValue,
130353
- description: newThoughtBuffer
130354
- };
130355
- setPendingHistoryItem({ type: "gemini_thought", text: "" });
130692
+ const startingNewThought = currentThoughtBuffer.trim().length === 0;
130693
+ const description = startingNewThought ? stripLeadingBlankLines(newThoughtBuffer) : thoughtText;
130694
+ if (startingNewThought) {
130695
+ thoughtStartTimeRef.current = Date.now();
130356
130696
  }
130357
- const splitPoint = findLastSafeSplitPoint(newThoughtBuffer);
130358
- const nextPendingType = isPendingThought && pendingType === "gemini_thought_content" ? "gemini_thought_content" : "gemini_thought";
130359
- if (splitPoint === newThoughtBuffer.length) {
130360
- setPendingHistoryItem({
130361
- type: nextPendingType,
130362
- text: newThoughtBuffer
130363
- });
130364
- } else {
130365
- const beforeText = newThoughtBuffer.substring(0, splitPoint);
130366
- const afterText = newThoughtBuffer.substring(splitPoint);
130367
- addItem(
130368
- {
130369
- type: nextPendingType,
130370
- text: beforeText
130371
- },
130372
- userMessageTimestamp
130373
- );
130374
- setPendingHistoryItem({
130375
- type: "gemini_thought_content",
130376
- text: afterText
130377
- });
130378
- newThoughtBuffer = afterText;
130697
+ mergeThought({
130698
+ ...eventValue,
130699
+ description
130700
+ });
130701
+ setPendingThoughtItem({
130702
+ type: "gemini_thought",
130703
+ text: stripLeadingBlankLines(newThoughtBuffer),
130704
+ durationMs: thoughtStartTimeRef.current ? Date.now() - thoughtStartTimeRef.current : 0
130705
+ });
130706
+ return startingNewThought ? description : newThoughtBuffer;
130707
+ },
130708
+ [mergeThought, setPendingThoughtItem]
130709
+ );
130710
+ const commitPendingThought = (0, import_react202.useCallback)(
130711
+ (userMessageTimestamp) => {
130712
+ if (pendingThoughtItemRef.current) {
130713
+ const item = { ...pendingThoughtItemRef.current };
130714
+ if (item.type === "gemini_thought" && thoughtStartTimeRef.current) {
130715
+ item.durationMs = Date.now() - thoughtStartTimeRef.current;
130716
+ }
130717
+ addItem(item, userMessageTimestamp);
130379
130718
  }
130380
- mergeThought(thoughtToMerge);
130381
- return newThoughtBuffer;
130719
+ setPendingThoughtItem(null);
130720
+ thoughtStartTimeRef.current = null;
130382
130721
  },
130383
- [addItem, pendingHistoryItemRef, setPendingHistoryItem, mergeThought]
130722
+ [addItem, pendingThoughtItemRef, setPendingThoughtItem]
130384
130723
  );
130385
130724
  const handleUserCancelledEvent = (0, import_react202.useCallback)(
130386
130725
  (userMessageTimestamp) => {
@@ -130388,6 +130727,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
130388
130727
  return;
130389
130728
  }
130390
130729
  lastPromptErroredRef.current = false;
130730
+ commitPendingThought(userMessageTimestamp);
130391
130731
  if (pendingHistoryItemRef.current) {
130392
130732
  if (pendingHistoryItemRef.current.type === "tool_group") {
130393
130733
  const updatedTools = pendingHistoryItemRef.current.tools.map(
@@ -130413,6 +130753,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
130413
130753
  },
130414
130754
  [
130415
130755
  addItem,
130756
+ commitPendingThought,
130416
130757
  pendingHistoryItemRef,
130417
130758
  setPendingHistoryItem,
130418
130759
  setThought,
@@ -130422,6 +130763,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
130422
130763
  const handleErrorEvent = (0, import_react202.useCallback)(
130423
130764
  (eventValue, userMessageTimestamp) => {
130424
130765
  lastPromptErroredRef.current = true;
130766
+ commitPendingThought(userMessageTimestamp);
130425
130767
  if (pendingHistoryItemRef.current) {
130426
130768
  addItem(pendingHistoryItemRef.current, userMessageTimestamp);
130427
130769
  setPendingHistoryItem(null);
@@ -130452,6 +130794,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
130452
130794
  },
130453
130795
  [
130454
130796
  addItem,
130797
+ commitPendingThought,
130455
130798
  pendingHistoryItemRef,
130456
130799
  setPendingHistoryItem,
130457
130800
  setPendingRetryErrorItem,
@@ -130702,11 +131045,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
130702
131045
  description: `${mergedThought.description ?? ""}${queuedThought.value.description ?? ""}`
130703
131046
  };
130704
131047
  }
130705
- thoughtBuffer = handleThoughtEvent(
130706
- mergedThought,
130707
- thoughtBuffer,
130708
- userMessageTimestamp
130709
- );
131048
+ thoughtBuffer = handleThoughtEvent(mergedThought, thoughtBuffer);
130710
131049
  }
130711
131050
  }, "flushBufferedStreamEvents");
130712
131051
  const scheduleBufferedStreamFlush = /* @__PURE__ */ __name(() => {
@@ -130733,11 +131072,20 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
130733
131072
  }
130734
131073
  break;
130735
131074
  case "content" /* Content */:
131075
+ if (pendingThoughtItemRef.current || bufferedEvents.some((e) => e.kind === "thought")) {
131076
+ flushBufferedStreamEvents();
131077
+ commitPendingThought(userMessageTimestamp);
131078
+ thoughtBuffer = "";
131079
+ }
131080
+ setThought((prev) => prev ? null : prev);
130736
131081
  bufferedEvents.push({ kind: "content", value: event.value });
130737
131082
  scheduleBufferedStreamFlush();
130738
131083
  break;
130739
131084
  case "tool_call_request" /* ToolCallRequest */:
130740
131085
  flushBufferedStreamEvents();
131086
+ commitPendingThought(userMessageTimestamp);
131087
+ thoughtBuffer = "";
131088
+ setThought((prev) => prev ? null : prev);
130741
131089
  toolCallRequests.push(event.value);
130742
131090
  try {
130743
131091
  const argsJson = JSON.stringify(event.value.args);
@@ -130772,6 +131120,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
130772
131120
  break;
130773
131121
  case "finished" /* Finished */:
130774
131122
  flushBufferedStreamEvents();
131123
+ commitPendingThought(userMessageTimestamp);
130775
131124
  handleFinishedEvent(
130776
131125
  event,
130777
131126
  userMessageTimestamp
@@ -130782,6 +131131,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
130782
131131
  }
130783
131132
  geminiMessageBuffer = "";
130784
131133
  thoughtBuffer = "";
131134
+ setThought(null);
130785
131135
  break;
130786
131136
  case "citation" /* Citation */:
130787
131137
  flushBufferedStreamEvents();
@@ -130797,8 +131147,10 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
130797
131147
  if (pendingHistoryItemRef.current) {
130798
131148
  setPendingHistoryItem(null);
130799
131149
  }
130800
- geminiMessageBuffer = "";
131150
+ commitPendingThought(userMessageTimestamp);
130801
131151
  thoughtBuffer = "";
131152
+ setThought(null);
131153
+ geminiMessageBuffer = "";
130802
131154
  } else {
130803
131155
  flushBufferedStreamEvents();
130804
131156
  }
@@ -130845,6 +131197,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
130845
131197
  }
130846
131198
  } finally {
130847
131199
  flushBufferedStreamEvents();
131200
+ commitPendingThought(userMessageTimestamp);
130848
131201
  discardBufferedStreamEvents();
130849
131202
  flushBufferedStreamEventsRef.current.delete(flushBufferedStreamEvents);
130850
131203
  }
@@ -130868,7 +131221,9 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
130868
131221
  startRetryCountdown,
130869
131222
  clearRetryCountdown,
130870
131223
  setThought,
131224
+ commitPendingThought,
130871
131225
  pendingHistoryItemRef,
131226
+ pendingThoughtItemRef,
130872
131227
  setPendingHistoryItem,
130873
131228
  handleUserPromptSubmitBlockedEvent,
130874
131229
  handleStopHookLoopEvent,
@@ -130955,6 +131310,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
130955
131310
  );
130956
131311
  }
130957
131312
  setThought(null);
131313
+ setPendingThoughtItem(null);
130958
131314
  }
130959
131315
  if (submitType === "retry" /* Retry */) {
130960
131316
  logUserRetry(config, new UserRetryEvent(prompt_id));
@@ -131076,6 +131432,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
131076
131432
  pendingRetryCountdownItemRef,
131077
131433
  pendingRetryErrorItemRef,
131078
131434
  setPendingRetryErrorItem,
131435
+ setPendingThoughtItem,
131079
131436
  dualOutput
131080
131437
  ]
131081
131438
  );
@@ -131318,12 +131675,15 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
131318
131675
  );
131319
131676
  const pendingHistoryItems = (0, import_react202.useMemo)(
131320
131677
  () => [
131678
+ // Reasoning renders above the streaming answer.
131679
+ pendingThoughtItem,
131321
131680
  pendingHistoryItem,
131322
131681
  pendingRetryErrorItem,
131323
131682
  pendingRetryCountdownItem,
131324
131683
  pendingToolCallGroupDisplay
131325
131684
  ].filter((i) => i !== void 0 && i !== null),
131326
131685
  [
131686
+ pendingThoughtItem,
131327
131687
  pendingHistoryItem,
131328
131688
  pendingRetryErrorItem,
131329
131689
  pendingRetryCountdownItem,
@@ -133758,13 +134118,13 @@ import { format as format3 } from "node:util";
133758
134118
  init_esbuild_shims();
133759
134119
  var import_graceful_fs = __toESM(require_graceful_fs(), 1);
133760
134120
  import path49 from "node:path";
133761
- import os25 from "node:os";
134121
+ import os24 from "node:os";
133762
134122
 
133763
134123
  // node_modules/xdg-basedir/index.js
133764
134124
  init_esbuild_shims();
133765
- import os23 from "os";
134125
+ import os22 from "os";
133766
134126
  import path46 from "path";
133767
- var homeDirectory = os23.homedir();
134127
+ var homeDirectory = os22.homedir();
133768
134128
  var { env: env3 } = process;
133769
134129
  var xdgData = env3.XDG_DATA_HOME || (homeDirectory ? path46.join(homeDirectory, ".local", "share") : void 0);
133770
134130
  var xdgConfig = env3.XDG_CONFIG_HOME || (homeDirectory ? path46.join(homeDirectory, ".config") : void 0);
@@ -133999,14 +134359,14 @@ var dist_default6 = FS;
133999
134359
 
134000
134360
  // node_modules/atomically/dist/constants.js
134001
134361
  init_esbuild_shims();
134002
- import os24 from "node:os";
134362
+ import os23 from "node:os";
134003
134363
  import process30 from "node:process";
134004
134364
  var DEFAULT_ENCODING = "utf8";
134005
134365
  var DEFAULT_FILE_MODE = 438;
134006
134366
  var DEFAULT_FOLDER_MODE = 511;
134007
134367
  var DEFAULT_WRITE_OPTIONS = {};
134008
- var DEFAULT_USER_UID = os24.userInfo().uid;
134009
- var DEFAULT_USER_GID = os24.userInfo().gid;
134368
+ var DEFAULT_USER_UID = os23.userInfo().uid;
134369
+ var DEFAULT_USER_GID = os23.userInfo().gid;
134010
134370
  var DEFAULT_TIMEOUT_SYNC = 1e3;
134011
134371
  var IS_POSIX = !!process30.getuid;
134012
134372
  var IS_USER_ROOT2 = process30.getuid ? !process30.getuid() : false;
@@ -134459,7 +134819,7 @@ __name(hasProperty, "hasProperty");
134459
134819
  // node_modules/configstore/index.js
134460
134820
  function getConfigDirectory(id, globalConfigPath) {
134461
134821
  const pathPrefix = globalConfigPath ? path49.join(id, "config.json") : path49.join("configstore", `${id}.json`);
134462
- const configDirectory = xdgConfig ?? import_graceful_fs.default.mkdtempSync(import_graceful_fs.default.realpathSync(os25.tmpdir()) + path49.sep);
134822
+ const configDirectory = xdgConfig ?? import_graceful_fs.default.mkdtempSync(import_graceful_fs.default.realpathSync(os24.tmpdir()) + path49.sep);
134463
134823
  return path49.join(configDirectory, pathPrefix);
134464
134824
  }
134465
134825
  __name(getConfigDirectory, "getConfigDirectory");
@@ -134738,7 +135098,7 @@ var ansi_styles_default5 = ansiStyles5;
134738
135098
  // node_modules/update-notifier/node_modules/chalk/source/vendor/supports-color/index.js
134739
135099
  init_esbuild_shims();
134740
135100
  import process33 from "node:process";
134741
- import os26 from "node:os";
135101
+ import os25 from "node:os";
134742
135102
  import tty3 from "node:tty";
134743
135103
  function hasFlag2(flag, argv = globalThis.Deno ? globalThis.Deno.args : process33.argv) {
134744
135104
  const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
@@ -134806,7 +135166,7 @@ function _supportsColor2(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
134806
135166
  return min;
134807
135167
  }
134808
135168
  if (process33.platform === "win32") {
134809
- const osRelease = os26.release().split(".");
135169
+ const osRelease = os25.release().split(".");
134810
135170
  if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
134811
135171
  return Number(osRelease[2]) >= 14931 ? 3 : 2;
134812
135172
  }
@@ -135803,7 +136163,7 @@ init_esbuild_shims();
135803
136163
  var import_ini = __toESM(require_ini3(), 1);
135804
136164
  import process35 from "node:process";
135805
136165
  import path50 from "node:path";
135806
- import os27 from "node:os";
136166
+ import os26 from "node:os";
135807
136167
  import fs41 from "node:fs";
135808
136168
  var isWindows3 = process35.platform === "win32";
135809
136169
  var readRc = /* @__PURE__ */ __name((filePath) => {
@@ -135838,7 +136198,7 @@ var getNpmPrefix = /* @__PURE__ */ __name(() => {
135838
136198
  if (envPrefix) {
135839
136199
  return envPrefix;
135840
136200
  }
135841
- const homePrefix = readRc(path50.join(os27.homedir(), ".npmrc"));
136201
+ const homePrefix = readRc(path50.join(os26.homedir(), ".npmrc"));
135842
136202
  if (homePrefix) {
135843
136203
  return homePrefix;
135844
136204
  }
@@ -135869,11 +136229,11 @@ var getYarnPrefix = /* @__PURE__ */ __name(() => {
135869
136229
  if (windowsPrefix) {
135870
136230
  return windowsPrefix;
135871
136231
  }
135872
- const configPrefix = path50.join(os27.homedir(), ".config/yarn");
136232
+ const configPrefix = path50.join(os26.homedir(), ".config/yarn");
135873
136233
  if (fs41.existsSync(configPrefix)) {
135874
136234
  return configPrefix;
135875
136235
  }
135876
- const homePrefix = path50.join(os27.homedir(), ".yarn-config");
136236
+ const homePrefix = path50.join(os26.homedir(), ".yarn-config");
135877
136237
  if (fs41.existsSync(homePrefix)) {
135878
136238
  return homePrefix;
135879
136239
  }
@@ -137006,7 +137366,7 @@ import { spawn as spawn6 } from "node:child_process";
137006
137366
  var spawnWrapper = spawn6;
137007
137367
 
137008
137368
  // packages/cli/src/utils/handleAutoUpdate.ts
137009
- import os28 from "node:os";
137369
+ import os27 from "node:os";
137010
137370
  var UPDATE_SUCCESS_MESSAGE = "Update successful! Please restart Qwen Code to use the new version. Switching model providers before restarting may not work correctly.";
137011
137371
  var UPDATE_FAILED_MESSAGE = "Automatic update failed. Please try updating manually.";
137012
137372
  function handleAutoUpdate(info, settings, projectRoot, spawnFn = spawnWrapper) {
@@ -137045,7 +137405,7 @@ ${installationInfo.updateMessage}`;
137045
137405
  "@latest",
137046
137406
  isNightly ? "@nightly" : `@${info.update.latest}`
137047
137407
  );
137048
- const isWindows4 = os28.platform() === "win32";
137408
+ const isWindows4 = os27.platform() === "win32";
137049
137409
  const shell = isWindows4 ? "cmd.exe" : "bash";
137050
137410
  const shellArgs = isWindows4 ? ["/c", updateCommand2] : ["-c", updateCommand2];
137051
137411
  const updateProcess = spawnFn(shell, shellArgs, { stdio: "pipe" });
@@ -140892,7 +141252,7 @@ __name(relaunchAppInChildProcess, "relaunchAppInChildProcess");
140892
141252
  init_esbuild_shims();
140893
141253
  var import_shell_quote = __toESM(require_shell_quote(), 1);
140894
141254
  import { exec as exec7, execSync as execSync5, spawn as spawn8 } from "node:child_process";
140895
- import os29 from "node:os";
141255
+ import os28 from "node:os";
140896
141256
  import path56 from "node:path";
140897
141257
  import fs46 from "node:fs";
140898
141258
  import { fileURLToPath as fileURLToPath4 } from "node:url";
@@ -140900,7 +141260,7 @@ import { promisify as promisify3 } from "node:util";
140900
141260
  import { randomBytes } from "node:crypto";
140901
141261
  var execAsync2 = promisify3(exec7);
140902
141262
  function getContainerPath(hostPath) {
140903
- if (os29.platform() !== "win32") {
141263
+ if (os28.platform() !== "win32") {
140904
141264
  return hostPath;
140905
141265
  }
140906
141266
  const withForwardSlashes = hostPath.replace(/\\/g, "/");
@@ -140937,7 +141297,7 @@ async function shouldUseCurrentUserInSandbox() {
140937
141297
  if (envVar === "0" || envVar === "false") {
140938
141298
  return false;
140939
141299
  }
140940
- if (os29.platform() === "linux") {
141300
+ if (os28.platform() === "linux") {
140941
141301
  const debugEnv = [process.env["DEBUG"], process.env["DEBUG_MODE"]].some(
140942
141302
  (v) => v === "true" || v === "1"
140943
141303
  );
@@ -140962,7 +141322,7 @@ function ports() {
140962
141322
  }
140963
141323
  __name(ports, "ports");
140964
141324
  function entrypoint(workdir, cliArgs) {
140965
- const isWindows4 = os29.platform() === "win32";
141325
+ const isWindows4 = os28.platform() === "win32";
140966
141326
  const containerWorkdir = getContainerPath(workdir);
140967
141327
  const shellCmds = [];
140968
141328
  const pathSeparator = isWindows4 ? ";" : ":";
@@ -141045,9 +141405,9 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
141045
141405
  "-D",
141046
141406
  `TARGET_DIR=${fs46.realpathSync(process.cwd())}`,
141047
141407
  "-D",
141048
- `TMP_DIR=${fs46.realpathSync(os29.tmpdir())}`,
141408
+ `TMP_DIR=${fs46.realpathSync(os28.tmpdir())}`,
141049
141409
  "-D",
141050
- `HOME_DIR=${fs46.realpathSync(os29.homedir())}`,
141410
+ `HOME_DIR=${fs46.realpathSync(os28.homedir())}`,
141051
141411
  "-D",
141052
141412
  `CACHE_DIR=${fs46.realpathSync(execSync5(`getconf DARWIN_USER_CACHE_DIR`).toString().trim())}`,
141053
141413
  "-D",
@@ -141243,8 +141603,8 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
141243
141603
  if (!runtimeSameAsUserSettings) {
141244
141604
  args.push("--env", `QWEN_RUNTIME_DIR=${runtimeBaseDirContainerPath}`);
141245
141605
  }
141246
- args.push("--volume", `${os29.tmpdir()}:${getContainerPath(os29.tmpdir())}`);
141247
- const gcloudConfigDir = path56.join(os29.homedir(), ".config", "gcloud");
141606
+ args.push("--volume", `${os28.tmpdir()}:${getContainerPath(os28.tmpdir())}`);
141607
+ const gcloudConfigDir = path56.join(os28.homedir(), ".config", "gcloud");
141248
141608
  if (fs46.existsSync(gcloudConfigDir)) {
141249
141609
  args.push(
141250
141610
  "--volume",
@@ -141455,7 +141815,7 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
141455
141815
  }
141456
141816
  args.push("--env", `SANDBOX=${containerName}`);
141457
141817
  if (config.command === "podman") {
141458
- const emptyAuthFilePath = path56.join(os29.tmpdir(), "empty_auth.json");
141818
+ const emptyAuthFilePath = path56.join(os28.tmpdir(), "empty_auth.json");
141459
141819
  fs46.writeFileSync(emptyAuthFilePath, "{}", "utf-8");
141460
141820
  args.push("--authfile", emptyAuthFilePath);
141461
141821
  }
@@ -141467,7 +141827,7 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
141467
141827
  const uid = execSync5("id -u").toString().trim();
141468
141828
  const gid = execSync5("id -g").toString().trim();
141469
141829
  const username = "qwen";
141470
- const homeDir = getContainerPath(os29.homedir());
141830
+ const homeDir = getContainerPath(os28.homedir());
141471
141831
  const setupUserCommands = [
141472
141832
  // Use -f with groupadd to avoid errors if the group already exists.
141473
141833
  `groupadd -f -g ${gid} ${username}`,
@@ -141479,7 +141839,7 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
141479
141839
  const suCommand = `su -p ${username} -c '${escapedOriginalCommand}'`;
141480
141840
  finalEntrypoint[2] = `${setupUserCommands} && ${suCommand}`;
141481
141841
  userFlag = `--user ${uid}:${gid}`;
141482
- args.push("--env", `HOME=${os29.homedir()}`);
141842
+ args.push("--env", `HOME=${os28.homedir()}`);
141483
141843
  } else if (isIntegrationTest) {
141484
141844
  args.push("--user", "root");
141485
141845
  userFlag = "--user root";
@@ -141490,7 +141850,7 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
141490
141850
  let sandboxProcess = void 0;
141491
141851
  if (proxyCommand) {
141492
141852
  const proxyContainerCommand = `${config.command} run --rm --init ${userFlag} --name ${SANDBOX_PROXY_NAME} --network ${SANDBOX_PROXY_NAME} -p 8877:8877 -v ${process.cwd()}:${workdir} --workdir ${workdir} ${image2} ${proxyCommand}`;
141493
- const isWindows4 = os29.platform() === "win32";
141853
+ const isWindows4 = os28.platform() === "win32";
141494
141854
  const proxyShell = isWindows4 ? "cmd.exe" : "bash";
141495
141855
  const proxyShellArgs = isWindows4 ? ["/c", proxyContainerCommand] : ["-c", proxyContainerCommand];
141496
141856
  proxyProcess = spawn8(proxyShell, proxyShellArgs, {
@@ -141656,9 +142016,9 @@ __name(ensureSandboxImageIsPresent, "ensureSandboxImageIsPresent");
141656
142016
  // packages/cli/src/utils/startupWarnings.ts
141657
142017
  init_esbuild_shims();
141658
142018
  import fs47 from "node:fs/promises";
141659
- import os30 from "node:os";
142019
+ import os29 from "node:os";
141660
142020
  import { join as pathJoin } from "node:path";
141661
- var warningsFilePath = pathJoin(os30.tmpdir(), "qwen-code-warnings.txt");
142021
+ var warningsFilePath = pathJoin(os29.tmpdir(), "qwen-code-warnings.txt");
141662
142022
  async function getStartupWarnings() {
141663
142023
  try {
141664
142024
  await fs47.access(warningsFilePath);
@@ -141682,7 +142042,7 @@ __name(getStartupWarnings, "getStartupWarnings");
141682
142042
  // packages/cli/src/utils/userStartupWarnings.ts
141683
142043
  init_esbuild_shims();
141684
142044
  import fs48 from "node:fs/promises";
141685
- import * as os31 from "node:os";
142045
+ import * as os30 from "node:os";
141686
142046
  import path57 from "node:path";
141687
142047
  var homeDirectoryCheck = {
141688
142048
  id: "home-directory",
@@ -141690,7 +142050,7 @@ var homeDirectoryCheck = {
141690
142050
  try {
141691
142051
  const [workspaceRealPath, homeRealPath] = await Promise.all([
141692
142052
  fs48.realpath(options.workspaceRoot),
141693
- fs48.realpath(os31.homedir())
142053
+ fs48.realpath(os30.homedir())
141694
142054
  ]);
141695
142055
  if (workspaceRealPath === homeRealPath) {
141696
142056
  return "You are running Qwen Code in your home directory. It is recommended to run in a project-specific directory.";
@@ -143713,7 +144073,6 @@ function maskApiKeyForDisplay(apiKey) {
143713
144073
  return `${trimmed.slice(0, 3)}...${trimmed.slice(-4)}`;
143714
144074
  }
143715
144075
  __name(maskApiKeyForDisplay, "maskApiKeyForDisplay");
143716
- var MID_TURN_QUEUE_DRAIN_METHOD = "craft/drainMidTurnQueue";
143717
144076
  var MID_TURN_QUEUE_DRAIN_TIMEOUT_MS = 2e3;
143718
144077
  var MID_TURN_QUEUE_DRAIN_MAX_TIMEOUT_STRIKES = 3;
143719
144078
  var MidTurnDrainTimeoutError = class extends Error {
@@ -148249,7 +148608,7 @@ var QwenAgent = class {
148249
148608
  async initialize(args) {
148250
148609
  this.clientCapabilities = args.clientCapabilities;
148251
148610
  const authMethods = buildAuthMethods();
148252
- const version = "0.18.1-preview.0";
148611
+ const version = "0.18.1-preview.1";
148253
148612
  return {
148254
148613
  protocolVersion: PROTOCOL_VERSION,
148255
148614
  agentInfo: {
@@ -151832,7 +152191,7 @@ function validateDnsResolutionOrder(order) {
151832
152191
  }
151833
152192
  __name(validateDnsResolutionOrder, "validateDnsResolutionOrder");
151834
152193
  function getNodeMemoryArgs(isDebugMode3) {
151835
- const totalMemoryMB = os32.totalmem() / (1024 * 1024);
152194
+ const totalMemoryMB = os31.totalmem() / (1024 * 1024);
151836
152195
  const heapStats = v83.getHeapStatistics();
151837
152196
  const currentMaxOldSpaceSizeMb = Math.floor(
151838
152197
  heapStats.heap_size_limit / 1024 / 1024
@@ -152334,7 +152693,7 @@ ${finalArgs[promptIndex + 1]}`;
152334
152693
  process.exit(0);
152335
152694
  }
152336
152695
  if (config.isInteractive()) {
152337
- void import("./chunks/scheduler-KFG4TT3A.js").then((m) => m.startBackgroundHousekeeping(config, settings)).catch((err) => {
152696
+ void import("./chunks/scheduler-TAPJOQHX.js").then((m) => m.startBackgroundHousekeeping(config, settings)).catch((err) => {
152338
152697
  debugLogger80.warn("failed to start background housekeeping:", err);
152339
152698
  });
152340
152699
  }