@qwen-code/qwen-code 0.18.1-nightly.20260616.a68b2e1e7 → 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 (65) 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/features/sub-agents.md +3 -3
  5. package/bundled/qc-helper/docs/qwen-serve.md +18 -7
  6. package/bundled/review/SKILL.md +10 -4
  7. package/bundled/simplify/SKILL.md +1 -1
  8. package/chunks/{agent-PXMT2XR5.js → agent-ZLVQLNIP.js} +5 -5
  9. package/chunks/{agent-headless-SY7VJUHV.js → agent-headless-H4ZT46GX.js} +5 -5
  10. package/chunks/{anthropicContentGenerator-DCI26OQF.js → anthropicContentGenerator-KLBHYGH6.js} +1 -1
  11. package/chunks/{askUserQuestion-NDNFGC35.js → askUserQuestion-QPZXR3UO.js} +1 -1
  12. package/chunks/{chunk-ABRZC6FA.js → chunk-BRU4Z5BG.js} +10 -5
  13. package/chunks/{chunk-JZFEL3RB.js → chunk-C64WAJOC.js} +1 -1
  14. package/chunks/{chunk-TSBXGR73.js → chunk-HISY5FYZ.js} +4 -4
  15. package/chunks/{chunk-A3OEZT2F.js → chunk-L6F7VZPZ.js} +6 -6
  16. package/chunks/{chunk-3NRO6NHX.js → chunk-MN5RAXVB.js} +3 -3
  17. package/chunks/{chunk-M5PJ5QAF.js → chunk-Q6WOQSR4.js} +2 -2
  18. package/chunks/{chunk-UOB6KPGG.js → chunk-R53CLQY7.js} +1 -1
  19. package/chunks/{chunk-26QELEL2.js → chunk-RTTAC5VW.js} +1 -1
  20. package/chunks/{chunk-H4ZDM3N6.js → chunk-UKLVRIWE.js} +1332 -1027
  21. package/chunks/{chunk-VXHYMZXW.js → chunk-VIEIRAK3.js} +1 -1
  22. package/chunks/{chunk-OT6JA3KQ.js → chunk-YJDVHAGL.js} +1 -1
  23. package/chunks/{chunk-6WPY6ES3.js → chunk-ZNUMXPNK.js} +565 -48
  24. package/chunks/{computer-use-7SEQDSHB.js → computer-use-SWC45S44.js} +5 -5
  25. package/chunks/{contextCommand-KM5OWV65.js → contextCommand-O5DLQUIZ.js} +7 -7
  26. package/chunks/{cron-create-7CXEAJ2K.js → cron-create-DQKRQMCP.js} +1 -1
  27. package/chunks/{cron-delete-2FQYYNQ6.js → cron-delete-DOFPHFTI.js} +1 -1
  28. package/chunks/{cron-list-QCAJ73XE.js → cron-list-RCVOO3CB.js} +1 -1
  29. package/chunks/{dist-PF2IYSMD.js → dist-UH7CYT7F.js} +1 -1
  30. package/chunks/{edit-BMUKPLA7.js → edit-J7M33W4D.js} +6 -6
  31. package/chunks/{enter-worktree-LXJ5WJ5A.js → enter-worktree-RCCPIOG6.js} +5 -5
  32. package/chunks/{enterPlanMode-QWRZ54ZF.js → enterPlanMode-EC7HWVXV.js} +5 -5
  33. package/chunks/{exit-worktree-5HTQPNZO.js → exit-worktree-V3OVN22U.js} +5 -5
  34. package/chunks/{exitPlanMode-5WQAXNDA.js → exitPlanMode-P3F5VTWX.js} +7 -6
  35. package/chunks/{geminiContentGenerator-CAKHT5YE.js → geminiContentGenerator-E2LZQIFZ.js} +1 -1
  36. package/chunks/{glob-5DN6NSCD.js → glob-ENPPHN24.js} +5 -5
  37. package/chunks/{grep-BJILOLCD.js → grep-RXZMZKHV.js} +5 -5
  38. package/chunks/{ls-XVGXRYWD.js → ls-TRD77UTS.js} +1 -1
  39. package/chunks/{lsp-S6SHPULC.js → lsp-2VFWQPZS.js} +1 -1
  40. package/chunks/{monitor-SUEMSRN3.js → monitor-YYWM7RUX.js} +5 -5
  41. package/chunks/{notebook-edit-6F6Z5P6U.js → notebook-edit-L6OODJTK.js} +6 -6
  42. package/chunks/{openaiContentGenerator-DO27LL6O.js → openaiContentGenerator-BPRGR5FJ.js} +5 -5
  43. package/chunks/{qwenContentGenerator-DQLGLQSH.js → qwenContentGenerator-ENMXX47B.js} +7 -7
  44. package/chunks/{read-file-3TBLYTOQ.js → read-file-3VASWJKO.js} +3 -3
  45. package/chunks/{ripGrep-3INYT3QV.js → ripGrep-67IQWCR7.js} +5 -5
  46. package/chunks/{scheduler-23KQW6CX.js → scheduler-TAPJOQHX.js} +5 -5
  47. package/chunks/{send-message-SMNR5DBG.js → send-message-QZOC5GA2.js} +1 -1
  48. package/chunks/{serve-Y5E4LKUI.js → serve-CQF2R7SG.js} +709 -26
  49. package/chunks/{shell-4H6XQXVY.js → shell-ZLBFZ75G.js} +5 -5
  50. package/chunks/{skill-SE6FECZR.js → skill-BZ2NCCJN.js} +3 -3
  51. package/chunks/{src-76DUBH3A.js → src-ASRB3EO3.js} +11 -5
  52. package/chunks/{syntheticOutput-KMNF7YG6.js → syntheticOutput-WJSUK4SZ.js} +2 -2
  53. package/chunks/{task-create-LIJHK75G.js → task-create-GGSC27HO.js} +2 -2
  54. package/chunks/{task-list-S4GNSILM.js → task-list-EDHHHSK4.js} +1 -1
  55. package/chunks/{task-stop-3GBRYJHM.js → task-stop-WR5PDVZY.js} +1 -1
  56. package/chunks/{task-update-F3UTVJMS.js → task-update-UR7NUHBV.js} +2 -2
  57. package/chunks/{team-create-Q5DTDDH4.js → team-create-NXTYUYLE.js} +5 -5
  58. package/chunks/{team-delete-54434EB7.js → team-delete-FC33URJK.js} +1 -1
  59. package/chunks/{todoWrite-4ENGSBUX.js → todoWrite-GO2ME7ZV.js} +1 -1
  60. package/chunks/{tool-search-ABZMSDTU.js → tool-search-GYO3ZDMH.js} +3 -3
  61. package/chunks/{web-fetch-RHZMF3MP.js → web-fetch-NLLATYIL.js} +2 -2
  62. package/chunks/{workflow-NEMDQB75.js → workflow-KZLZUDHE.js} +249 -24
  63. package/chunks/{write-file-VAEHZPSL.js → write-file-AUXVL5D2.js} +6 -6
  64. package/cli.js +545 -184
  65. 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-ABRZC6FA.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-TSBXGR73.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-UOB6KPGG.js";
121
+ } from "./chunks/chunk-R53CLQY7.js";
121
122
  import {
122
123
  noteInteraction
123
124
  } from "./chunks/chunk-MRO43B25.js";
@@ -137,6 +138,7 @@ import {
137
138
  DISPLAY_MODE,
138
139
  EXTENSIONS_CONFIG_FILENAME,
139
140
  ExtensionManager,
141
+ FORK_SUBAGENT_TYPE,
140
142
  FileDiscoveryService,
141
143
  FileSearchFactory,
142
144
  GitWorktreeService,
@@ -340,13 +342,13 @@ import {
340
342
  writeRuntimeStatus,
341
343
  writeWorktreeSession,
342
344
  writeWorktreeSessionMarker
343
- } from "./chunks/chunk-H4ZDM3N6.js";
345
+ } from "./chunks/chunk-UKLVRIWE.js";
344
346
  import {
345
347
  external_exports
346
348
  } from "./chunks/chunk-K5PGHDBN.js";
347
349
  import {
348
350
  runSideQuery
349
- } from "./chunks/chunk-VXHYMZXW.js";
351
+ } from "./chunks/chunk-VIEIRAK3.js";
350
352
  import "./chunks/chunk-O4PICXES.js";
351
353
  import "./chunks/chunk-TW522KN6.js";
352
354
  import "./chunks/chunk-BJ5HQ23U.js";
@@ -416,7 +418,7 @@ import {
416
418
  stripRuntimeSnapshotPrefix,
417
419
  uiTelemetryService,
418
420
  withInteractionSpan
419
- } from "./chunks/chunk-A3OEZT2F.js";
421
+ } from "./chunks/chunk-L6F7VZPZ.js";
420
422
  import "./chunks/chunk-3PJXIDKI.js";
421
423
  import "./chunks/chunk-UWCTAVOD.js";
422
424
  import {
@@ -430,13 +432,13 @@ import {
430
432
  isAnyAutoMemPath
431
433
  } from "./chunks/chunk-IQHSD7K5.js";
432
434
  import "./chunks/chunk-LYRSMKLS.js";
433
- import "./chunks/chunk-26QELEL2.js";
435
+ import "./chunks/chunk-RTTAC5VW.js";
434
436
  import {
435
437
  SchemaValidator,
436
438
  ToolConfirmationOutcome,
437
439
  ToolDisplayNames,
438
440
  ToolNames
439
- } from "./chunks/chunk-6WPY6ES3.js";
441
+ } from "./chunks/chunk-ZNUMXPNK.js";
440
442
  import {
441
443
  clearCachedCredentialFile,
442
444
  openBrowserSecurely,
@@ -11232,7 +11234,7 @@ var require_supports_color = __commonJS({
11232
11234
  "node_modules/chalk/node_modules/supports-color/index.js"(exports, module) {
11233
11235
  "use strict";
11234
11236
  init_esbuild_shims();
11235
- var os33 = __require("os");
11237
+ var os32 = __require("os");
11236
11238
  var tty4 = __require("tty");
11237
11239
  var hasFlag3 = require_has_flag();
11238
11240
  var { env: env5 } = process;
@@ -11281,7 +11283,7 @@ var require_supports_color = __commonJS({
11281
11283
  return min;
11282
11284
  }
11283
11285
  if (process.platform === "win32") {
11284
- const osRelease = os33.release().split(".");
11286
+ const osRelease = os32.release().split(".");
11285
11287
  if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
11286
11288
  return Number(osRelease[2]) >= 14931 ? 3 : 2;
11287
11289
  }
@@ -32580,7 +32582,7 @@ var require_supports_color2 = __commonJS({
32580
32582
  "node_modules/ink-link/node_modules/supports-color/index.js"(exports, module) {
32581
32583
  "use strict";
32582
32584
  init_esbuild_shims();
32583
- var os33 = __require("os");
32585
+ var os32 = __require("os");
32584
32586
  var tty4 = __require("tty");
32585
32587
  var hasFlag3 = require_has_flag();
32586
32588
  var { env: env5 } = process;
@@ -32629,7 +32631,7 @@ var require_supports_color2 = __commonJS({
32629
32631
  return min;
32630
32632
  }
32631
32633
  if (process.platform === "win32") {
32632
- const osRelease = os33.release().split(".");
32634
+ const osRelease = os32.release().split(".");
32633
32635
  if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
32634
32636
  return Number(osRelease[2]) >= 14931 ? 3 : 2;
32635
32637
  }
@@ -36808,9 +36810,9 @@ var require_defaults = __commonJS({
36808
36810
  "node_modules/@pnpm/npm-conf/lib/defaults.js"(exports) {
36809
36811
  "use strict";
36810
36812
  init_esbuild_shims();
36811
- var os33 = __require("os");
36813
+ var os32 = __require("os");
36812
36814
  var path60 = __require("path");
36813
- var temp = os33.tmpdir();
36815
+ var temp = os32.tmpdir();
36814
36816
  var uidOrPid = process.getuid ? process.getuid() : process.pid;
36815
36817
  var hasUnicode = /* @__PURE__ */ __name(() => true, "hasUnicode");
36816
36818
  var isWindows4 = process.platform === "win32";
@@ -36821,7 +36823,7 @@ var require_defaults = __commonJS({
36821
36823
  var umask = {
36822
36824
  fromString: /* @__PURE__ */ __name(() => process.umask(), "fromString")
36823
36825
  };
36824
- var home = os33.homedir();
36826
+ var home = os32.homedir();
36825
36827
  if (home) {
36826
36828
  process.env.HOME = home;
36827
36829
  } else {
@@ -49241,7 +49243,7 @@ var measure_element_default = measureElement;
49241
49243
  // packages/cli/src/gemini.tsx
49242
49244
  var import_react233 = __toESM(require_react(), 1);
49243
49245
  import dns from "node:dns";
49244
- import os32 from "node:os";
49246
+ import os31 from "node:os";
49245
49247
  import path59, { basename as basename13 } from "node:path";
49246
49248
  import v83 from "node:v8";
49247
49249
 
@@ -56778,7 +56780,7 @@ function ensureBuiltins() {
56778
56780
  const [telegram, weixin, dingtalk, feishu] = await Promise.all([
56779
56781
  import("./chunks/dist-KF43SZZV.js"),
56780
56782
  import("./chunks/dist-2UCAYOX7.js"),
56781
- import("./chunks/dist-PF2IYSMD.js"),
56783
+ import("./chunks/dist-UH7CYT7F.js"),
56782
56784
  import("./chunks/dist-33LHH26D.js")
56783
56785
  ]);
56784
56786
  for (const mod of [telegram, weixin, dingtalk, feishu]) {
@@ -59187,7 +59189,7 @@ var serveCommand = {
59187
59189
  process.exit(1);
59188
59190
  }
59189
59191
  }
59190
- const { runQwenServe } = await import("./chunks/serve-Y5E4LKUI.js");
59192
+ const { runQwenServe } = await import("./chunks/serve-CQF2R7SG.js");
59191
59193
  try {
59192
59194
  await runQwenServe({
59193
59195
  port: argv.port,
@@ -64928,6 +64930,147 @@ var tasksCommand = {
64928
64930
  }, "action")
64929
64931
  };
64930
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
+
64931
65074
  // packages/cli/src/ui/commands/agentsCommand.ts
64932
65075
  init_esbuild_shims();
64933
65076
  var agentsCommand = {
@@ -67500,13 +67643,18 @@ init_esbuild_shims();
67500
67643
  // packages/cli/src/ui/utils/backgroundWorkUtils.ts
67501
67644
  init_esbuild_shims();
67502
67645
  function hasBlockingBackgroundWork(config) {
67503
- 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();
67504
67651
  }
67505
67652
  __name(hasBlockingBackgroundWork, "hasBlockingBackgroundWork");
67506
67653
  function resetBackgroundStateForSessionSwitch(config) {
67507
67654
  config.getBackgroundTaskRegistry().reset();
67508
67655
  config.getMonitorRegistry().reset();
67509
67656
  config.getBackgroundShellRegistry().reset();
67657
+ config.getWorkflowRunRegistry().reset();
67510
67658
  }
67511
67659
  __name(resetBackgroundStateForSessionSwitch, "resetBackgroundStateForSessionSwitch");
67512
67660
 
@@ -69783,7 +69931,6 @@ __name(rollbackStandaloneUpdate, "rollbackStandaloneUpdate");
69783
69931
  // packages/cli/src/utils/installationInfo.ts
69784
69932
  init_esbuild_shims();
69785
69933
  import * as fs16 from "node:fs";
69786
- import * as os14 from "node:os";
69787
69934
  import * as path18 from "node:path";
69788
69935
  import * as childProcess from "node:child_process";
69789
69936
  var debugLogger14 = createDebugLogger("INSTALLATION_INFO");
@@ -69896,27 +70043,11 @@ function getInstallationInfo(projectRoot, isAutoUpdateEnabled) {
69896
70043
  npmPrefixWritable = true;
69897
70044
  } catch {
69898
70045
  }
69899
- if (!npmPrefixWritable && isAutoUpdateEnabled) {
69900
- const installRoot = process.env["HOME"] || os14.homedir();
69901
- if (!installRoot || installRoot === "/") {
69902
- return {
69903
- packageManager: "npm" /* NPM */,
69904
- isGlobal: true,
69905
- updateMessage: "Update requires sudo. Run: sudo npm install -g @qwen-code/qwen-code@latest"
69906
- };
69907
- }
69908
- const fallbackStandaloneDir = path18.join(
69909
- installRoot,
69910
- ".local",
69911
- "lib",
69912
- "qwen-code"
69913
- );
70046
+ if (!npmPrefixWritable) {
69914
70047
  return {
69915
70048
  packageManager: "npm" /* NPM */,
69916
70049
  isGlobal: true,
69917
- isStandalone: true,
69918
- standaloneDir: fallbackStandaloneDir,
69919
- 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"
69920
70051
  };
69921
70052
  }
69922
70053
  const updateCommand2 = "npm install -g @qwen-code/qwen-code@latest";
@@ -71729,7 +71860,7 @@ async function extractMetadata(conversation, config) {
71729
71860
  const gitBranch = firstRecord?.gitBranch;
71730
71861
  let gitRepo;
71731
71862
  if (cwd5) {
71732
- const { getGitRepoName } = await import("./chunks/src-76DUBH3A.js");
71863
+ const { getGitRepoName } = await import("./chunks/src-ASRB3EO3.js");
71733
71864
  gitRepo = getGitRepoName(cwd5);
71734
71865
  }
71735
71866
  let model;
@@ -72995,6 +73126,7 @@ var forkCommand = {
72995
73126
  const params = {
72996
73127
  description: deriveForkDescription(directive),
72997
73128
  prompt: directive,
73129
+ subagent_type: FORK_SUBAGENT_TYPE,
72998
73130
  run_in_background: true
72999
73131
  };
73000
73132
  let result;
@@ -74344,7 +74476,7 @@ init_esbuild_shims();
74344
74476
  init_esbuild_shims();
74345
74477
  var import_strip_json_comments4 = __toESM(require_strip_json_comments(), 1);
74346
74478
  import * as fs18 from "node:fs";
74347
- import * as os15 from "node:os";
74479
+ import * as os14 from "node:os";
74348
74480
  import * as path21 from "node:path";
74349
74481
  function isRecord(value) {
74350
74482
  return !!value && typeof value === "object" && !Array.isArray(value);
@@ -74430,11 +74562,11 @@ function getClaudeProjectSettings(projects, cwd5) {
74430
74562
  return void 0;
74431
74563
  }
74432
74564
  __name(getClaudeProjectSettings, "getClaudeProjectSettings");
74433
- function getClaudeCodeConfigPath(homeDir = os15.homedir()) {
74565
+ function getClaudeCodeConfigPath(homeDir = os14.homedir()) {
74434
74566
  return path21.join(homeDir, ".claude.json");
74435
74567
  }
74436
74568
  __name(getClaudeCodeConfigPath, "getClaudeCodeConfigPath");
74437
- function getClaudeDesktopConfigPath(homeDir = os15.homedir(), platform5 = process.platform, env5 = process.env) {
74569
+ function getClaudeDesktopConfigPath(homeDir = os14.homedir(), platform5 = process.platform, env5 = process.env) {
74438
74570
  if (platform5 === "win32") {
74439
74571
  const appData = env5["APPDATA"] ?? path21.win32.join(homeDir, "AppData", "Roaming");
74440
74572
  return path21.win32.join(appData, "Claude", "claude_desktop_config.json");
@@ -74600,7 +74732,7 @@ function loadClaudeDesktopMcpServers(homeDir, platform5, env5) {
74600
74732
  }
74601
74733
  __name(loadClaudeDesktopMcpServers, "loadClaudeDesktopMcpServers");
74602
74734
  function loadClaudeMcpSources(options) {
74603
- const homeDir = options.homeDir ?? os15.homedir();
74735
+ const homeDir = options.homeDir ?? os14.homedir();
74604
74736
  const cwd5 = options.cwd ?? process.cwd();
74605
74737
  const platform5 = options.platform ?? process.platform;
74606
74738
  const env5 = options.env ?? process.env;
@@ -76863,7 +76995,7 @@ init_esbuild_shims();
76863
76995
  // packages/cli/src/ui/utils/terminalSetup.ts
76864
76996
  init_esbuild_shims();
76865
76997
  import { promises as fs21 } from "node:fs";
76866
- import * as os16 from "node:os";
76998
+ import * as os15 from "node:os";
76867
76999
  import * as path26 from "node:path";
76868
77000
  import { exec as exec3 } from "node:child_process";
76869
77001
  import { promisify } from "node:util";
@@ -76982,7 +77114,7 @@ async function detectTerminal2() {
76982
77114
  if (termProgram === "vscode" || process.env["VSCODE_GIT_IPC_HANDLE"]) {
76983
77115
  return "vscode";
76984
77116
  }
76985
- if (os16.platform() !== "win32") {
77117
+ if (os15.platform() !== "win32") {
76986
77118
  try {
76987
77119
  const { stdout } = await execAsync("ps -o comm= -p $PPID");
76988
77120
  const parentName = stdout.trim();
@@ -77012,10 +77144,10 @@ async function backupFile(filePath) {
77012
77144
  }
77013
77145
  __name(backupFile, "backupFile");
77014
77146
  function getVSCodeStyleConfigDir(appName) {
77015
- const platform5 = os16.platform();
77147
+ const platform5 = os15.platform();
77016
77148
  if (platform5 === "darwin") {
77017
77149
  return path26.join(
77018
- os16.homedir(),
77150
+ os15.homedir(),
77019
77151
  "Library",
77020
77152
  "Application Support",
77021
77153
  appName,
@@ -77027,7 +77159,7 @@ function getVSCodeStyleConfigDir(appName) {
77027
77159
  }
77028
77160
  return path26.join(process.env["APPDATA"], appName, "User");
77029
77161
  } else {
77030
- return path26.join(os16.homedir(), ".config", appName, "User");
77162
+ return path26.join(os15.homedir(), ".config", appName, "User");
77031
77163
  }
77032
77164
  }
77033
77165
  __name(getVSCodeStyleConfigDir, "getVSCodeStyleConfigDir");
@@ -79279,6 +79411,12 @@ var BuiltinCommandLoader = class {
79279
79411
  aboutCommand,
79280
79412
  agentsCommand,
79281
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,
79282
79420
  arenaCommand,
79283
79421
  approvalModeCommand,
79284
79422
  authCommand2,
@@ -83921,7 +84059,7 @@ var SystemController = class extends BaseController {
83921
84059
  throw new Error("Request aborted");
83922
84060
  }
83923
84061
  try {
83924
- const mod = await import("./chunks/contextCommand-KM5OWV65.js");
84062
+ const mod = await import("./chunks/contextCommand-O5DLQUIZ.js");
83925
84063
  if (signal.aborted) {
83926
84064
  throw new Error("Request aborted");
83927
84065
  }
@@ -87772,6 +87910,22 @@ __name(loadLowlight, "loadLowlight");
87772
87910
  // packages/cli/src/ui/utils/CodeColorizer.tsx
87773
87911
  var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1);
87774
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");
87775
87929
  function renderHastNode(node, theme2, inheritedColor) {
87776
87930
  if (node.type === "text") {
87777
87931
  const color2 = inheritedColor || theme2.defaultColor;
@@ -87817,6 +87971,9 @@ function highlightAndRenderLine(line, language, theme2, lowlight) {
87817
87971
  if (!lowlight) {
87818
87972
  return line;
87819
87973
  }
87974
+ if (!language && looksLikeDiagramOrArt(line)) {
87975
+ return line;
87976
+ }
87820
87977
  try {
87821
87978
  const getHighlightedLine = /* @__PURE__ */ __name(() => !language || !lowlight.registered(language) ? lowlight.highlightAuto(line) : lowlight.highlight(language, line), "getHighlightedLine");
87822
87979
  const renderedNode = renderHastNode(getHighlightedLine(), theme2, void 0);
@@ -90776,7 +90933,7 @@ __name(renderMermaidVisual, "renderMermaidVisual");
90776
90933
  init_esbuild_shims();
90777
90934
  import crypto2 from "node:crypto";
90778
90935
  import fs27 from "node:fs";
90779
- import os17 from "node:os";
90936
+ import os16 from "node:os";
90780
90937
  import path35 from "node:path";
90781
90938
  import { spawn as spawn4, spawnSync } from "node:child_process";
90782
90939
  var CACHE_LIMIT = 40;
@@ -91340,7 +91497,7 @@ function isExecutable(filePath) {
91340
91497
  __name(isExecutable, "isExecutable");
91341
91498
  async function renderPngWithMmdcAsync(source, mmdc, env5, signal) {
91342
91499
  const tempDir = await fs27.promises.mkdtemp(
91343
- path35.join(os17.tmpdir(), "qwen-mermaid-")
91500
+ path35.join(os16.tmpdir(), "qwen-mermaid-")
91344
91501
  );
91345
91502
  const inputPath = path35.join(tempDir, "diagram.mmd");
91346
91503
  const outputPath = path35.join(tempDir, "diagram.png");
@@ -91437,7 +91594,7 @@ function getMermaidCellAspectRatio(env5) {
91437
91594
  __name(getMermaidCellAspectRatio, "getMermaidCellAspectRatio");
91438
91595
  async function renderPngWithChafaAsync(png, widthCells, rows, chafa, env5, signal) {
91439
91596
  const tempDir = await fs27.promises.mkdtemp(
91440
- path35.join(os17.tmpdir(), "qwen-mermaid-")
91597
+ path35.join(os16.tmpdir(), "qwen-mermaid-")
91441
91598
  );
91442
91599
  const imagePath = path35.join(tempDir, "diagram.png");
91443
91600
  try {
@@ -92666,39 +92823,143 @@ var AssistantMessageContent = /* @__PURE__ */ __name(({
92666
92823
  sourceCopyIndexOffsets
92667
92824
  }
92668
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");
92669
92882
  var ThinkMessage = /* @__PURE__ */ __name(({
92670
92883
  text,
92671
92884
  isPending,
92885
+ expanded = false,
92672
92886
  availableTerminalHeight,
92673
- contentWidth
92674
- }) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
92675
- PrefixedMarkdownMessage,
92676
- {
92677
- text,
92678
- prefix: "\u2726",
92679
- prefixColor: theme.text.secondary,
92680
- isPending,
92681
- availableTerminalHeight,
92682
- contentWidth,
92683
- 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
+ ] });
92684
92914
  }
92685
- ), "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");
92686
92930
  var ThinkMessageContent = /* @__PURE__ */ __name(({
92687
92931
  text,
92688
92932
  isPending,
92933
+ expanded = false,
92689
92934
  availableTerminalHeight,
92690
92935
  contentWidth
92691
- }) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
92692
- ContinuationMarkdownMessage,
92693
- {
92694
- text,
92695
- isPending,
92696
- availableTerminalHeight,
92697
- contentWidth,
92698
- basePrefix: "\u2726",
92699
- 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 }) });
92700
92951
  }
92701
- ), "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");
92702
92963
 
92703
92964
  // packages/cli/src/ui/components/messages/ToolGroupMessage.tsx
92704
92965
  init_esbuild_shims();
@@ -93120,7 +93381,7 @@ init_esbuild_shims();
93120
93381
  var import_react58 = __toESM(require_react(), 1);
93121
93382
  import { spawnSync as spawnSync2 } from "node:child_process";
93122
93383
  import fs28 from "node:fs";
93123
- import os18 from "node:os";
93384
+ import os17 from "node:os";
93124
93385
  import pathMod from "node:path";
93125
93386
 
93126
93387
  // packages/cli/src/ui/components/shared/vim-buffer-actions.ts
@@ -95472,7 +95733,7 @@ function useTextBuffer({
95472
95733
  let tmpDir;
95473
95734
  let filePath;
95474
95735
  try {
95475
- tmpDir = fs28.mkdtempSync(pathMod.join(os18.tmpdir(), "qwen-edit-"));
95736
+ tmpDir = fs28.mkdtempSync(pathMod.join(os17.tmpdir(), "qwen-edit-"));
95476
95737
  filePath = pathMod.join(tmpDir, "buffer.txt");
95477
95738
  } catch (err) {
95478
95739
  debugLogger39.error(
@@ -101216,20 +101477,23 @@ var HistoryItemDisplayComponent = /* @__PURE__ */ __name(({
101216
101477
  sourceCopyIndexOffsets
101217
101478
  }
101218
101479
  ),
101219
- !compactMode && itemForDisplay.type === "gemini_thought" && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
101480
+ itemForDisplay.type === "gemini_thought" && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
101220
101481
  ThinkMessage,
101221
101482
  {
101222
101483
  text: itemForDisplay.text.trimEnd(),
101223
101484
  isPending,
101485
+ expanded: false,
101224
101486
  availableTerminalHeight: availableTerminalHeightGemini ?? availableTerminalHeight,
101225
- contentWidth
101487
+ contentWidth,
101488
+ durationMs: itemForDisplay.durationMs
101226
101489
  }
101227
101490
  ),
101228
- !compactMode && itemForDisplay.type === "gemini_thought_content" && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
101491
+ itemForDisplay.type === "gemini_thought_content" && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
101229
101492
  ThinkMessageContent,
101230
101493
  {
101231
101494
  text: itemForDisplay.text.trimEnd(),
101232
101495
  isPending,
101496
+ expanded: false,
101233
101497
  availableTerminalHeight: availableTerminalHeightGemini ?? availableTerminalHeight,
101234
101498
  contentWidth
101235
101499
  }
@@ -108010,7 +108274,7 @@ __name(TrustDialog, "TrustDialog");
108010
108274
  init_esbuild_shims();
108011
108275
  var import_react108 = __toESM(require_react(), 1);
108012
108276
  import * as fs31 from "node:fs";
108013
- import * as os19 from "node:os";
108277
+ import * as os18 from "node:os";
108014
108278
  import * as nodePath2 from "node:path";
108015
108279
  var import_jsx_runtime86 = __toESM(require_jsx_runtime(), 1);
108016
108280
  function getPermScopeItems() {
@@ -108125,7 +108389,7 @@ function PermissionsDialog({
108125
108389
  const dirCompletions = (0, import_react108.useMemo)(() => {
108126
108390
  const trimmed = newDirInput.trim();
108127
108391
  if (!trimmed) return [];
108128
- const expanded = trimmed.startsWith("~") ? trimmed.replace(/^~/, os19.homedir()) : trimmed;
108392
+ const expanded = trimmed.startsWith("~") ? trimmed.replace(/^~/, os18.homedir()) : trimmed;
108129
108393
  const endsWithSep = expanded.endsWith("/") || expanded.endsWith(nodePath2.sep);
108130
108394
  const searchDir = endsWithSep ? expanded : nodePath2.dirname(expanded);
108131
108395
  const prefix = endsWithSep ? "" : nodePath2.basename(expanded);
@@ -108199,7 +108463,7 @@ function PermissionsDialog({
108199
108463
  const handleAddDirSubmit = (0, import_react108.useCallback)(() => {
108200
108464
  const trimmed = newDirInput.trim();
108201
108465
  if (!trimmed) return;
108202
- const expanded = trimmed.startsWith("~") ? trimmed.replace(/^~/, os19.homedir()) : trimmed;
108466
+ const expanded = trimmed.startsWith("~") ? trimmed.replace(/^~/, os18.homedir()) : trimmed;
108203
108467
  const absoluteExpanded = nodePath2.isAbsolute(expanded) ? expanded : nodePath2.resolve(expanded);
108204
108468
  if (!fs31.existsSync(absoluteExpanded)) {
108205
108469
  setDirInputError(t("Directory does not exist."));
@@ -108867,7 +109131,9 @@ function ModelDialog({
108867
109131
  const availableModelEntries = (0, import_react109.useMemo)(() => {
108868
109132
  const allModels = config ? config.getAllConfiguredModels() : [];
108869
109133
  const runtimeModels = allModels.filter((m) => m.isRuntimeModel);
108870
- 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
+ );
108871
109137
  const modelsByAuthTypeMap = /* @__PURE__ */ new Map();
108872
109138
  for (const model of registryModels) {
108873
109139
  const authType2 = model.authType;
@@ -108902,7 +109168,7 @@ function ModelDialog({
108902
109168
  }
108903
109169
  }
108904
109170
  return result;
108905
- }, [config]);
109171
+ }, [authType, config]);
108906
109172
  const MODEL_OPTIONS = (0, import_react109.useMemo)(
108907
109173
  () => availableModelEntries.map(
108908
109174
  ({ authType: t2, model, isRuntime, snapshotId }) => {
@@ -117889,7 +118155,7 @@ function convertToHistoryItems(conversation, config) {
117889
118155
  }
117890
118156
  case "assistant": {
117891
118157
  const parts = record.message?.parts;
117892
- const thoughtText = !config || !config.getContentGenerator().useSummarizedThinking() ? extractThoughtTextFromParts(parts) : "";
118158
+ const thoughtText = !config ? extractThoughtTextFromParts(parts) : "";
117893
118159
  const text = extractTextFromParts(parts);
117894
118160
  const functionCalls = extractFunctionCalls(parts);
117895
118161
  if (thoughtText) {
@@ -119366,7 +119632,7 @@ __name(emptyMessage, "emptyMessage");
119366
119632
  init_esbuild_shims();
119367
119633
  var import_react146 = __toESM(require_react(), 1);
119368
119634
  import fs32 from "node:fs/promises";
119369
- import os20 from "node:os";
119635
+ import os19 from "node:os";
119370
119636
  import path39 from "node:path";
119371
119637
  import { spawnSync as spawnSync4 } from "node:child_process";
119372
119638
  var import_jsx_runtime144 = __toESM(require_jsx_runtime(), 1);
@@ -119418,7 +119684,7 @@ async function ensureFileExists(filePath) {
119418
119684
  }
119419
119685
  __name(ensureFileExists, "ensureFileExists");
119420
119686
  function formatDisplayPath(filePath) {
119421
- const home = os20.homedir();
119687
+ const home = os19.homedir();
119422
119688
  if (filePath.startsWith(home)) {
119423
119689
  return `~${filePath.slice(home.length)}`;
119424
119690
  }
@@ -119753,6 +120019,8 @@ function entryId(entry) {
119753
120019
  return entry.shellId;
119754
120020
  case "monitor":
119755
120021
  return entry.monitorId;
120022
+ case "workflow":
120023
+ return entry.runId;
119756
120024
  case "dream":
119757
120025
  return entry.dreamId;
119758
120026
  default: {
@@ -119771,6 +120039,7 @@ function useBackgroundTaskView(config) {
119771
120039
  const agentRegistry = config.getBackgroundTaskRegistry();
119772
120040
  const shellRegistry = config.getBackgroundShellRegistry();
119773
120041
  const monitorRegistry = config.getMonitorRegistry();
120042
+ const workflowRegistry = config.getWorkflowRunRegistry();
119774
120043
  const memoryManager = config.getMemoryManager();
119775
120044
  const projectRoot = config.getProjectRoot();
119776
120045
  let lastDreamSig = "";
@@ -119779,6 +120048,7 @@ function useBackgroundTaskView(config) {
119779
120048
  const agentEntries = [...agentRegistry.getAll()];
119780
120049
  const shellEntries = [...shellRegistry.getAll()];
119781
120050
  const monitorEntries = [...monitorRegistry.getAll()];
120051
+ const workflowEntries = [...workflowRegistry.list()];
119782
120052
  const allDreams = dreamSnapshot ?? memoryManager.listTasksByType("dream", projectRoot);
119783
120053
  const runningDreams = allDreams.filter((t2) => t2.status === "running");
119784
120054
  const terminalDreams = allDreams.filter(
@@ -119811,6 +120081,7 @@ function useBackgroundTaskView(config) {
119811
120081
  ...agentEntries,
119812
120082
  ...shellEntries,
119813
120083
  ...monitorEntries,
120084
+ ...workflowEntries,
119814
120085
  ...dreamEntries
119815
120086
  ].sort((a, b) => {
119816
120087
  const aActive = isActive(a);
@@ -119827,6 +120098,7 @@ function useBackgroundTaskView(config) {
119827
120098
  agentRegistry.setStatusChangeCallback(refreshFromRegistry);
119828
120099
  shellRegistry.setStatusChangeCallback(refreshFromRegistry);
119829
120100
  monitorRegistry.setStatusChangeCallback(refreshFromRegistry);
120101
+ workflowRegistry.setStatusChangeCallback(refreshFromRegistry);
119830
120102
  agentRegistry.setApprovalChangeCallback(refreshFromRegistry);
119831
120103
  const memoryListener = /* @__PURE__ */ __name(() => {
119832
120104
  const dreams = memoryManager.listTasksByType("dream", projectRoot);
@@ -119841,6 +120113,7 @@ function useBackgroundTaskView(config) {
119841
120113
  agentRegistry.setStatusChangeCallback(void 0);
119842
120114
  shellRegistry.setStatusChangeCallback(void 0);
119843
120115
  monitorRegistry.setStatusChangeCallback(void 0);
120116
+ workflowRegistry.setStatusChangeCallback(void 0);
119844
120117
  agentRegistry.setApprovalChangeCallback(void 0);
119845
120118
  unsubscribeMemory();
119846
120119
  };
@@ -119975,6 +120248,9 @@ function BackgroundTaskViewProvider({
119975
120248
  }
119976
120249
  break;
119977
120250
  }
120251
+ case "workflow":
120252
+ config.getWorkflowRunRegistry().cancel(target.runId, Date.now());
120253
+ break;
119978
120254
  default: {
119979
120255
  const _exhaustive = target;
119980
120256
  throw new Error(
@@ -120151,6 +120427,12 @@ function rowLabel(entry) {
120151
120427
  return `${SHELL_ROW_PREFIX} ${entry.command}`;
120152
120428
  case "monitor":
120153
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
+ }
120154
120436
  case "dream":
120155
120437
  return formatDreamRowLabel(entry);
120156
120438
  default: {
@@ -120265,6 +120547,15 @@ var DetailBody = /* @__PURE__ */ __name(({ entry, maxHeight, maxWidth }) => {
120265
120547
  maxWidth
120266
120548
  }
120267
120549
  );
120550
+ case "workflow":
120551
+ return /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
120552
+ WorkflowDetailBody,
120553
+ {
120554
+ entry,
120555
+ maxHeight,
120556
+ maxWidth
120557
+ }
120558
+ );
120268
120559
  case "dream":
120269
120560
  return /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
120270
120561
  DreamDetailBody,
@@ -120523,6 +120814,69 @@ var MonitorDetailBody = /* @__PURE__ */ __name(({ entry, maxHeight, maxWidth })
120523
120814
  }
120524
120815
  );
120525
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");
120526
120880
  var BackgroundTasksDialog = /* @__PURE__ */ __name(({
120527
120881
  availableTerminalHeight,
120528
120882
  terminalWidth
@@ -121345,7 +121699,6 @@ var LoadingIndicator = /* @__PURE__ */ __name(({
121345
121699
  currentLoadingPhrase,
121346
121700
  elapsedTime,
121347
121701
  rightContent,
121348
- thought,
121349
121702
  candidatesTokens,
121350
121703
  streamingCharsRef,
121351
121704
  isStreaming,
@@ -121362,7 +121715,7 @@ var LoadingIndicator = /* @__PURE__ */ __name(({
121362
121715
  if (streamingState === "idle" /* Idle */) {
121363
121716
  return null;
121364
121717
  }
121365
- const primaryText = thought?.subject || currentLoadingPhrase;
121718
+ const primaryText = currentLoadingPhrase;
121366
121719
  const streamingTokens = streamingCharsRef ? Math.round(animatedChars / 4) : 0;
121367
121720
  const outputTokens = (candidatesTokens ?? 0) + streamingTokens;
121368
121721
  const showTokens = !isNarrow && outputTokens > 0;
@@ -125083,6 +125436,7 @@ var KIND_NAMES = {
125083
125436
  agent: { singular: "local agent", plural: "local agents" },
125084
125437
  shell: { singular: "shell", plural: "shells" },
125085
125438
  monitor: { singular: "monitor", plural: "monitors" },
125439
+ workflow: { singular: "workflow", plural: "workflows" },
125086
125440
  dream: { singular: "dream", plural: "dreams" }
125087
125441
  };
125088
125442
  function hasPendingApproval(entries) {
@@ -125107,12 +125461,13 @@ function getPillLabel(entries) {
125107
125461
  }
125108
125462
  __name(getPillLabel, "getPillLabel");
125109
125463
  function groupAndFormat(entries) {
125110
- const counts = { agent: 0, shell: 0, monitor: 0, dream: 0 };
125464
+ const counts = { agent: 0, shell: 0, monitor: 0, workflow: 0, dream: 0 };
125111
125465
  for (const e of entries) counts[e.kind]++;
125112
125466
  const parts = [];
125113
125467
  if (counts.shell > 0) parts.push(formatCount("shell", counts.shell));
125114
125468
  if (counts.agent > 0) parts.push(formatCount("agent", counts.agent));
125115
125469
  if (counts.monitor > 0) parts.push(formatCount("monitor", counts.monitor));
125470
+ if (counts.workflow > 0) parts.push(formatCount("workflow", counts.workflow));
125116
125471
  if (counts.dream > 0) parts.push(formatCount("dream", counts.dream));
125117
125472
  return parts.join(", ");
125118
125473
  }
@@ -126021,7 +126376,6 @@ var Composer = /* @__PURE__ */ __name(() => {
126021
126376
  !uiState.embeddedShellFocused && !suppressBottomLoadingIndicator && /* @__PURE__ */ (0, import_jsx_runtime164.jsx)(
126022
126377
  LoadingIndicator,
126023
126378
  {
126024
- thought: uiState.streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */ || config.getAccessibility()?.enableLoadingPhrases === false ? void 0 : uiState.thought,
126025
126379
  currentLoadingPhrase: config.getAccessibility()?.enableLoadingPhrases === false ? void 0 : uiState.currentLoadingPhrase,
126026
126380
  elapsedTime: uiState.elapsedTime,
126027
126381
  candidatesTokens: agentTokens,
@@ -127471,12 +127825,12 @@ import process38 from "node:process";
127471
127825
  init_esbuild_shims();
127472
127826
  var import_react184 = __toESM(require_react(), 1);
127473
127827
  import process25 from "node:process";
127474
- import os21 from "node:os";
127828
+ import os20 from "node:os";
127475
127829
  import v82 from "v8";
127476
127830
  var debugLogger61 = createDebugLogger("MEMORY_MONITOR");
127477
127831
  var MEMORY_WARNING_THRESHOLD = Math.min(
127478
127832
  7 * 1024 * 1024 * 1024,
127479
- Math.floor(os21.totalmem() * 0.85)
127833
+ Math.floor(os20.totalmem() * 0.85)
127480
127834
  );
127481
127835
  var MEMORY_UI_COMPACT_THRESHOLD = /* @__PURE__ */ __name(() => Math.floor(v82.getHeapStatistics().heap_size_limit * 0.65), "MEMORY_UI_COMPACT_THRESHOLD");
127482
127836
  var MEMORY_CHECK_INTERVAL = 60 * 1e3;
@@ -129188,7 +129542,7 @@ init_esbuild_shims();
129188
129542
  var import_react198 = __toESM(require_react(), 1);
129189
129543
  import crypto4 from "node:crypto";
129190
129544
  import path42 from "node:path";
129191
- import os22 from "node:os";
129545
+ import os21 from "node:os";
129192
129546
  import fs36 from "node:fs";
129193
129547
  var OUTPUT_UPDATE_INTERVAL_MS = 1e3;
129194
129548
  var MAX_OUTPUT_LENGTH = 1e4;
@@ -129226,14 +129580,14 @@ var useShellCommandProcessor = /* @__PURE__ */ __name((addItemToHistory, setPend
129226
129580
  { type: "user_shell", text: rawQuery },
129227
129581
  userMessageTimestamp
129228
129582
  );
129229
- const isWindows4 = os22.platform() === "win32";
129583
+ const isWindows4 = os21.platform() === "win32";
129230
129584
  const targetDir = config.getTargetDir();
129231
129585
  let commandToExecute = rawQuery;
129232
129586
  let pwdFilePath;
129233
129587
  if (!isWindows4) {
129234
129588
  let command2 = rawQuery.trim();
129235
129589
  const pwdFileName = `shell_pwd_${crypto4.randomBytes(6).toString("hex")}.tmp`;
129236
- pwdFilePath = path42.join(os22.tmpdir(), pwdFileName);
129590
+ pwdFilePath = path42.join(os21.tmpdir(), pwdFileName);
129237
129591
  if (!command2.endsWith(";") && !command2.endsWith("&")) {
129238
129592
  command2 += ";";
129239
129593
  }
@@ -129909,6 +130263,8 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
129909
130263
  }, [history]);
129910
130264
  const summaryAbortRefsRef = (0, import_react202.useRef)(/* @__PURE__ */ new Set());
129911
130265
  const [pendingHistoryItem, pendingHistoryItemRef, setPendingHistoryItem] = useStateAndRef(null);
130266
+ const [pendingThoughtItem, pendingThoughtItemRef, setPendingThoughtItem] = useStateAndRef(null);
130267
+ const thoughtStartTimeRef = (0, import_react202.useRef)(null);
129912
130268
  const [
129913
130269
  pendingRetryErrorItem,
129914
130270
  pendingRetryErrorItemRef,
@@ -130321,7 +130677,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
130321
130677
  [setThought]
130322
130678
  );
130323
130679
  const handleThoughtEvent = (0, import_react202.useCallback)(
130324
- (eventValue, currentThoughtBuffer, userMessageTimestamp) => {
130680
+ (eventValue, currentThoughtBuffer) => {
130325
130681
  if (turnCancelledRef.current) {
130326
130682
  return "";
130327
130683
  }
@@ -130329,56 +130685,41 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
130329
130685
  if (!thoughtText) {
130330
130686
  return currentThoughtBuffer;
130331
130687
  }
130332
- let newThoughtBuffer = currentThoughtBuffer + thoughtText;
130333
- if (debugLogger66.isEnabled()) {
130334
- debugLogger66.debug(
130335
- `[THOUGHT_BUFFER] Buffer growing: current=${currentThoughtBuffer.length}, incoming=${thoughtText.length}, total=${newThoughtBuffer.length}`
130336
- );
130688
+ const newThoughtBuffer = currentThoughtBuffer + thoughtText;
130689
+ if (newThoughtBuffer.trim().length === 0) {
130690
+ return newThoughtBuffer;
130337
130691
  }
130338
- const pendingType = pendingHistoryItemRef.current?.type;
130339
- const isPendingThought = pendingType === "gemini_thought" || pendingType === "gemini_thought_content";
130340
- let thoughtToMerge = eventValue;
130341
- if (!isPendingThought) {
130342
- if (newThoughtBuffer.trim().length === 0) {
130343
- return newThoughtBuffer;
130344
- }
130345
- if (pendingHistoryItemRef.current) {
130346
- addItem(pendingHistoryItemRef.current, userMessageTimestamp);
130347
- }
130348
- newThoughtBuffer = stripLeadingBlankLines(newThoughtBuffer);
130349
- thoughtToMerge = {
130350
- ...eventValue,
130351
- description: newThoughtBuffer
130352
- };
130353
- 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();
130354
130696
  }
130355
- const splitPoint = findLastSafeSplitPoint(newThoughtBuffer);
130356
- const nextPendingType = isPendingThought && pendingType === "gemini_thought_content" ? "gemini_thought_content" : "gemini_thought";
130357
- if (splitPoint === newThoughtBuffer.length) {
130358
- setPendingHistoryItem({
130359
- type: nextPendingType,
130360
- text: newThoughtBuffer
130361
- });
130362
- } else {
130363
- const beforeText = newThoughtBuffer.substring(0, splitPoint);
130364
- const afterText = newThoughtBuffer.substring(splitPoint);
130365
- addItem(
130366
- {
130367
- type: nextPendingType,
130368
- text: beforeText
130369
- },
130370
- userMessageTimestamp
130371
- );
130372
- setPendingHistoryItem({
130373
- type: "gemini_thought_content",
130374
- text: afterText
130375
- });
130376
- 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);
130377
130718
  }
130378
- mergeThought(thoughtToMerge);
130379
- return newThoughtBuffer;
130719
+ setPendingThoughtItem(null);
130720
+ thoughtStartTimeRef.current = null;
130380
130721
  },
130381
- [addItem, pendingHistoryItemRef, setPendingHistoryItem, mergeThought]
130722
+ [addItem, pendingThoughtItemRef, setPendingThoughtItem]
130382
130723
  );
130383
130724
  const handleUserCancelledEvent = (0, import_react202.useCallback)(
130384
130725
  (userMessageTimestamp) => {
@@ -130386,6 +130727,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
130386
130727
  return;
130387
130728
  }
130388
130729
  lastPromptErroredRef.current = false;
130730
+ commitPendingThought(userMessageTimestamp);
130389
130731
  if (pendingHistoryItemRef.current) {
130390
130732
  if (pendingHistoryItemRef.current.type === "tool_group") {
130391
130733
  const updatedTools = pendingHistoryItemRef.current.tools.map(
@@ -130411,6 +130753,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
130411
130753
  },
130412
130754
  [
130413
130755
  addItem,
130756
+ commitPendingThought,
130414
130757
  pendingHistoryItemRef,
130415
130758
  setPendingHistoryItem,
130416
130759
  setThought,
@@ -130420,6 +130763,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
130420
130763
  const handleErrorEvent = (0, import_react202.useCallback)(
130421
130764
  (eventValue, userMessageTimestamp) => {
130422
130765
  lastPromptErroredRef.current = true;
130766
+ commitPendingThought(userMessageTimestamp);
130423
130767
  if (pendingHistoryItemRef.current) {
130424
130768
  addItem(pendingHistoryItemRef.current, userMessageTimestamp);
130425
130769
  setPendingHistoryItem(null);
@@ -130450,6 +130794,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
130450
130794
  },
130451
130795
  [
130452
130796
  addItem,
130797
+ commitPendingThought,
130453
130798
  pendingHistoryItemRef,
130454
130799
  setPendingHistoryItem,
130455
130800
  setPendingRetryErrorItem,
@@ -130700,11 +131045,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
130700
131045
  description: `${mergedThought.description ?? ""}${queuedThought.value.description ?? ""}`
130701
131046
  };
130702
131047
  }
130703
- thoughtBuffer = handleThoughtEvent(
130704
- mergedThought,
130705
- thoughtBuffer,
130706
- userMessageTimestamp
130707
- );
131048
+ thoughtBuffer = handleThoughtEvent(mergedThought, thoughtBuffer);
130708
131049
  }
130709
131050
  }, "flushBufferedStreamEvents");
130710
131051
  const scheduleBufferedStreamFlush = /* @__PURE__ */ __name(() => {
@@ -130731,11 +131072,20 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
130731
131072
  }
130732
131073
  break;
130733
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);
130734
131081
  bufferedEvents.push({ kind: "content", value: event.value });
130735
131082
  scheduleBufferedStreamFlush();
130736
131083
  break;
130737
131084
  case "tool_call_request" /* ToolCallRequest */:
130738
131085
  flushBufferedStreamEvents();
131086
+ commitPendingThought(userMessageTimestamp);
131087
+ thoughtBuffer = "";
131088
+ setThought((prev) => prev ? null : prev);
130739
131089
  toolCallRequests.push(event.value);
130740
131090
  try {
130741
131091
  const argsJson = JSON.stringify(event.value.args);
@@ -130770,6 +131120,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
130770
131120
  break;
130771
131121
  case "finished" /* Finished */:
130772
131122
  flushBufferedStreamEvents();
131123
+ commitPendingThought(userMessageTimestamp);
130773
131124
  handleFinishedEvent(
130774
131125
  event,
130775
131126
  userMessageTimestamp
@@ -130780,6 +131131,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
130780
131131
  }
130781
131132
  geminiMessageBuffer = "";
130782
131133
  thoughtBuffer = "";
131134
+ setThought(null);
130783
131135
  break;
130784
131136
  case "citation" /* Citation */:
130785
131137
  flushBufferedStreamEvents();
@@ -130795,8 +131147,10 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
130795
131147
  if (pendingHistoryItemRef.current) {
130796
131148
  setPendingHistoryItem(null);
130797
131149
  }
130798
- geminiMessageBuffer = "";
131150
+ commitPendingThought(userMessageTimestamp);
130799
131151
  thoughtBuffer = "";
131152
+ setThought(null);
131153
+ geminiMessageBuffer = "";
130800
131154
  } else {
130801
131155
  flushBufferedStreamEvents();
130802
131156
  }
@@ -130843,6 +131197,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
130843
131197
  }
130844
131198
  } finally {
130845
131199
  flushBufferedStreamEvents();
131200
+ commitPendingThought(userMessageTimestamp);
130846
131201
  discardBufferedStreamEvents();
130847
131202
  flushBufferedStreamEventsRef.current.delete(flushBufferedStreamEvents);
130848
131203
  }
@@ -130866,7 +131221,9 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
130866
131221
  startRetryCountdown,
130867
131222
  clearRetryCountdown,
130868
131223
  setThought,
131224
+ commitPendingThought,
130869
131225
  pendingHistoryItemRef,
131226
+ pendingThoughtItemRef,
130870
131227
  setPendingHistoryItem,
130871
131228
  handleUserPromptSubmitBlockedEvent,
130872
131229
  handleStopHookLoopEvent,
@@ -130953,6 +131310,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
130953
131310
  );
130954
131311
  }
130955
131312
  setThought(null);
131313
+ setPendingThoughtItem(null);
130956
131314
  }
130957
131315
  if (submitType === "retry" /* Retry */) {
130958
131316
  logUserRetry(config, new UserRetryEvent(prompt_id));
@@ -131074,6 +131432,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
131074
131432
  pendingRetryCountdownItemRef,
131075
131433
  pendingRetryErrorItemRef,
131076
131434
  setPendingRetryErrorItem,
131435
+ setPendingThoughtItem,
131077
131436
  dualOutput
131078
131437
  ]
131079
131438
  );
@@ -131316,12 +131675,15 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
131316
131675
  );
131317
131676
  const pendingHistoryItems = (0, import_react202.useMemo)(
131318
131677
  () => [
131678
+ // Reasoning renders above the streaming answer.
131679
+ pendingThoughtItem,
131319
131680
  pendingHistoryItem,
131320
131681
  pendingRetryErrorItem,
131321
131682
  pendingRetryCountdownItem,
131322
131683
  pendingToolCallGroupDisplay
131323
131684
  ].filter((i) => i !== void 0 && i !== null),
131324
131685
  [
131686
+ pendingThoughtItem,
131325
131687
  pendingHistoryItem,
131326
131688
  pendingRetryErrorItem,
131327
131689
  pendingRetryCountdownItem,
@@ -133756,13 +134118,13 @@ import { format as format3 } from "node:util";
133756
134118
  init_esbuild_shims();
133757
134119
  var import_graceful_fs = __toESM(require_graceful_fs(), 1);
133758
134120
  import path49 from "node:path";
133759
- import os25 from "node:os";
134121
+ import os24 from "node:os";
133760
134122
 
133761
134123
  // node_modules/xdg-basedir/index.js
133762
134124
  init_esbuild_shims();
133763
- import os23 from "os";
134125
+ import os22 from "os";
133764
134126
  import path46 from "path";
133765
- var homeDirectory = os23.homedir();
134127
+ var homeDirectory = os22.homedir();
133766
134128
  var { env: env3 } = process;
133767
134129
  var xdgData = env3.XDG_DATA_HOME || (homeDirectory ? path46.join(homeDirectory, ".local", "share") : void 0);
133768
134130
  var xdgConfig = env3.XDG_CONFIG_HOME || (homeDirectory ? path46.join(homeDirectory, ".config") : void 0);
@@ -133997,14 +134359,14 @@ var dist_default6 = FS;
133997
134359
 
133998
134360
  // node_modules/atomically/dist/constants.js
133999
134361
  init_esbuild_shims();
134000
- import os24 from "node:os";
134362
+ import os23 from "node:os";
134001
134363
  import process30 from "node:process";
134002
134364
  var DEFAULT_ENCODING = "utf8";
134003
134365
  var DEFAULT_FILE_MODE = 438;
134004
134366
  var DEFAULT_FOLDER_MODE = 511;
134005
134367
  var DEFAULT_WRITE_OPTIONS = {};
134006
- var DEFAULT_USER_UID = os24.userInfo().uid;
134007
- var DEFAULT_USER_GID = os24.userInfo().gid;
134368
+ var DEFAULT_USER_UID = os23.userInfo().uid;
134369
+ var DEFAULT_USER_GID = os23.userInfo().gid;
134008
134370
  var DEFAULT_TIMEOUT_SYNC = 1e3;
134009
134371
  var IS_POSIX = !!process30.getuid;
134010
134372
  var IS_USER_ROOT2 = process30.getuid ? !process30.getuid() : false;
@@ -134457,7 +134819,7 @@ __name(hasProperty, "hasProperty");
134457
134819
  // node_modules/configstore/index.js
134458
134820
  function getConfigDirectory(id, globalConfigPath) {
134459
134821
  const pathPrefix = globalConfigPath ? path49.join(id, "config.json") : path49.join("configstore", `${id}.json`);
134460
- 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);
134461
134823
  return path49.join(configDirectory, pathPrefix);
134462
134824
  }
134463
134825
  __name(getConfigDirectory, "getConfigDirectory");
@@ -134736,7 +135098,7 @@ var ansi_styles_default5 = ansiStyles5;
134736
135098
  // node_modules/update-notifier/node_modules/chalk/source/vendor/supports-color/index.js
134737
135099
  init_esbuild_shims();
134738
135100
  import process33 from "node:process";
134739
- import os26 from "node:os";
135101
+ import os25 from "node:os";
134740
135102
  import tty3 from "node:tty";
134741
135103
  function hasFlag2(flag, argv = globalThis.Deno ? globalThis.Deno.args : process33.argv) {
134742
135104
  const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
@@ -134804,7 +135166,7 @@ function _supportsColor2(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
134804
135166
  return min;
134805
135167
  }
134806
135168
  if (process33.platform === "win32") {
134807
- const osRelease = os26.release().split(".");
135169
+ const osRelease = os25.release().split(".");
134808
135170
  if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
134809
135171
  return Number(osRelease[2]) >= 14931 ? 3 : 2;
134810
135172
  }
@@ -135801,7 +136163,7 @@ init_esbuild_shims();
135801
136163
  var import_ini = __toESM(require_ini3(), 1);
135802
136164
  import process35 from "node:process";
135803
136165
  import path50 from "node:path";
135804
- import os27 from "node:os";
136166
+ import os26 from "node:os";
135805
136167
  import fs41 from "node:fs";
135806
136168
  var isWindows3 = process35.platform === "win32";
135807
136169
  var readRc = /* @__PURE__ */ __name((filePath) => {
@@ -135836,7 +136198,7 @@ var getNpmPrefix = /* @__PURE__ */ __name(() => {
135836
136198
  if (envPrefix) {
135837
136199
  return envPrefix;
135838
136200
  }
135839
- const homePrefix = readRc(path50.join(os27.homedir(), ".npmrc"));
136201
+ const homePrefix = readRc(path50.join(os26.homedir(), ".npmrc"));
135840
136202
  if (homePrefix) {
135841
136203
  return homePrefix;
135842
136204
  }
@@ -135867,11 +136229,11 @@ var getYarnPrefix = /* @__PURE__ */ __name(() => {
135867
136229
  if (windowsPrefix) {
135868
136230
  return windowsPrefix;
135869
136231
  }
135870
- const configPrefix = path50.join(os27.homedir(), ".config/yarn");
136232
+ const configPrefix = path50.join(os26.homedir(), ".config/yarn");
135871
136233
  if (fs41.existsSync(configPrefix)) {
135872
136234
  return configPrefix;
135873
136235
  }
135874
- const homePrefix = path50.join(os27.homedir(), ".yarn-config");
136236
+ const homePrefix = path50.join(os26.homedir(), ".yarn-config");
135875
136237
  if (fs41.existsSync(homePrefix)) {
135876
136238
  return homePrefix;
135877
136239
  }
@@ -137004,7 +137366,7 @@ import { spawn as spawn6 } from "node:child_process";
137004
137366
  var spawnWrapper = spawn6;
137005
137367
 
137006
137368
  // packages/cli/src/utils/handleAutoUpdate.ts
137007
- import os28 from "node:os";
137369
+ import os27 from "node:os";
137008
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.";
137009
137371
  var UPDATE_FAILED_MESSAGE = "Automatic update failed. Please try updating manually.";
137010
137372
  function handleAutoUpdate(info, settings, projectRoot, spawnFn = spawnWrapper) {
@@ -137043,7 +137405,7 @@ ${installationInfo.updateMessage}`;
137043
137405
  "@latest",
137044
137406
  isNightly ? "@nightly" : `@${info.update.latest}`
137045
137407
  );
137046
- const isWindows4 = os28.platform() === "win32";
137408
+ const isWindows4 = os27.platform() === "win32";
137047
137409
  const shell = isWindows4 ? "cmd.exe" : "bash";
137048
137410
  const shellArgs = isWindows4 ? ["/c", updateCommand2] : ["-c", updateCommand2];
137049
137411
  const updateProcess = spawnFn(shell, shellArgs, { stdio: "pipe" });
@@ -140890,7 +141252,7 @@ __name(relaunchAppInChildProcess, "relaunchAppInChildProcess");
140890
141252
  init_esbuild_shims();
140891
141253
  var import_shell_quote = __toESM(require_shell_quote(), 1);
140892
141254
  import { exec as exec7, execSync as execSync5, spawn as spawn8 } from "node:child_process";
140893
- import os29 from "node:os";
141255
+ import os28 from "node:os";
140894
141256
  import path56 from "node:path";
140895
141257
  import fs46 from "node:fs";
140896
141258
  import { fileURLToPath as fileURLToPath4 } from "node:url";
@@ -140898,7 +141260,7 @@ import { promisify as promisify3 } from "node:util";
140898
141260
  import { randomBytes } from "node:crypto";
140899
141261
  var execAsync2 = promisify3(exec7);
140900
141262
  function getContainerPath(hostPath) {
140901
- if (os29.platform() !== "win32") {
141263
+ if (os28.platform() !== "win32") {
140902
141264
  return hostPath;
140903
141265
  }
140904
141266
  const withForwardSlashes = hostPath.replace(/\\/g, "/");
@@ -140935,7 +141297,7 @@ async function shouldUseCurrentUserInSandbox() {
140935
141297
  if (envVar === "0" || envVar === "false") {
140936
141298
  return false;
140937
141299
  }
140938
- if (os29.platform() === "linux") {
141300
+ if (os28.platform() === "linux") {
140939
141301
  const debugEnv = [process.env["DEBUG"], process.env["DEBUG_MODE"]].some(
140940
141302
  (v) => v === "true" || v === "1"
140941
141303
  );
@@ -140960,7 +141322,7 @@ function ports() {
140960
141322
  }
140961
141323
  __name(ports, "ports");
140962
141324
  function entrypoint(workdir, cliArgs) {
140963
- const isWindows4 = os29.platform() === "win32";
141325
+ const isWindows4 = os28.platform() === "win32";
140964
141326
  const containerWorkdir = getContainerPath(workdir);
140965
141327
  const shellCmds = [];
140966
141328
  const pathSeparator = isWindows4 ? ";" : ":";
@@ -141043,9 +141405,9 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
141043
141405
  "-D",
141044
141406
  `TARGET_DIR=${fs46.realpathSync(process.cwd())}`,
141045
141407
  "-D",
141046
- `TMP_DIR=${fs46.realpathSync(os29.tmpdir())}`,
141408
+ `TMP_DIR=${fs46.realpathSync(os28.tmpdir())}`,
141047
141409
  "-D",
141048
- `HOME_DIR=${fs46.realpathSync(os29.homedir())}`,
141410
+ `HOME_DIR=${fs46.realpathSync(os28.homedir())}`,
141049
141411
  "-D",
141050
141412
  `CACHE_DIR=${fs46.realpathSync(execSync5(`getconf DARWIN_USER_CACHE_DIR`).toString().trim())}`,
141051
141413
  "-D",
@@ -141241,8 +141603,8 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
141241
141603
  if (!runtimeSameAsUserSettings) {
141242
141604
  args.push("--env", `QWEN_RUNTIME_DIR=${runtimeBaseDirContainerPath}`);
141243
141605
  }
141244
- args.push("--volume", `${os29.tmpdir()}:${getContainerPath(os29.tmpdir())}`);
141245
- 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");
141246
141608
  if (fs46.existsSync(gcloudConfigDir)) {
141247
141609
  args.push(
141248
141610
  "--volume",
@@ -141453,7 +141815,7 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
141453
141815
  }
141454
141816
  args.push("--env", `SANDBOX=${containerName}`);
141455
141817
  if (config.command === "podman") {
141456
- const emptyAuthFilePath = path56.join(os29.tmpdir(), "empty_auth.json");
141818
+ const emptyAuthFilePath = path56.join(os28.tmpdir(), "empty_auth.json");
141457
141819
  fs46.writeFileSync(emptyAuthFilePath, "{}", "utf-8");
141458
141820
  args.push("--authfile", emptyAuthFilePath);
141459
141821
  }
@@ -141465,7 +141827,7 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
141465
141827
  const uid = execSync5("id -u").toString().trim();
141466
141828
  const gid = execSync5("id -g").toString().trim();
141467
141829
  const username = "qwen";
141468
- const homeDir = getContainerPath(os29.homedir());
141830
+ const homeDir = getContainerPath(os28.homedir());
141469
141831
  const setupUserCommands = [
141470
141832
  // Use -f with groupadd to avoid errors if the group already exists.
141471
141833
  `groupadd -f -g ${gid} ${username}`,
@@ -141477,7 +141839,7 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
141477
141839
  const suCommand = `su -p ${username} -c '${escapedOriginalCommand}'`;
141478
141840
  finalEntrypoint[2] = `${setupUserCommands} && ${suCommand}`;
141479
141841
  userFlag = `--user ${uid}:${gid}`;
141480
- args.push("--env", `HOME=${os29.homedir()}`);
141842
+ args.push("--env", `HOME=${os28.homedir()}`);
141481
141843
  } else if (isIntegrationTest) {
141482
141844
  args.push("--user", "root");
141483
141845
  userFlag = "--user root";
@@ -141488,7 +141850,7 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
141488
141850
  let sandboxProcess = void 0;
141489
141851
  if (proxyCommand) {
141490
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}`;
141491
- const isWindows4 = os29.platform() === "win32";
141853
+ const isWindows4 = os28.platform() === "win32";
141492
141854
  const proxyShell = isWindows4 ? "cmd.exe" : "bash";
141493
141855
  const proxyShellArgs = isWindows4 ? ["/c", proxyContainerCommand] : ["-c", proxyContainerCommand];
141494
141856
  proxyProcess = spawn8(proxyShell, proxyShellArgs, {
@@ -141654,9 +142016,9 @@ __name(ensureSandboxImageIsPresent, "ensureSandboxImageIsPresent");
141654
142016
  // packages/cli/src/utils/startupWarnings.ts
141655
142017
  init_esbuild_shims();
141656
142018
  import fs47 from "node:fs/promises";
141657
- import os30 from "node:os";
142019
+ import os29 from "node:os";
141658
142020
  import { join as pathJoin } from "node:path";
141659
- var warningsFilePath = pathJoin(os30.tmpdir(), "qwen-code-warnings.txt");
142021
+ var warningsFilePath = pathJoin(os29.tmpdir(), "qwen-code-warnings.txt");
141660
142022
  async function getStartupWarnings() {
141661
142023
  try {
141662
142024
  await fs47.access(warningsFilePath);
@@ -141680,7 +142042,7 @@ __name(getStartupWarnings, "getStartupWarnings");
141680
142042
  // packages/cli/src/utils/userStartupWarnings.ts
141681
142043
  init_esbuild_shims();
141682
142044
  import fs48 from "node:fs/promises";
141683
- import * as os31 from "node:os";
142045
+ import * as os30 from "node:os";
141684
142046
  import path57 from "node:path";
141685
142047
  var homeDirectoryCheck = {
141686
142048
  id: "home-directory",
@@ -141688,7 +142050,7 @@ var homeDirectoryCheck = {
141688
142050
  try {
141689
142051
  const [workspaceRealPath, homeRealPath] = await Promise.all([
141690
142052
  fs48.realpath(options.workspaceRoot),
141691
- fs48.realpath(os31.homedir())
142053
+ fs48.realpath(os30.homedir())
141692
142054
  ]);
141693
142055
  if (workspaceRealPath === homeRealPath) {
141694
142056
  return "You are running Qwen Code in your home directory. It is recommended to run in a project-specific directory.";
@@ -143711,7 +144073,6 @@ function maskApiKeyForDisplay(apiKey) {
143711
144073
  return `${trimmed.slice(0, 3)}...${trimmed.slice(-4)}`;
143712
144074
  }
143713
144075
  __name(maskApiKeyForDisplay, "maskApiKeyForDisplay");
143714
- var MID_TURN_QUEUE_DRAIN_METHOD = "craft/drainMidTurnQueue";
143715
144076
  var MID_TURN_QUEUE_DRAIN_TIMEOUT_MS = 2e3;
143716
144077
  var MID_TURN_QUEUE_DRAIN_MAX_TIMEOUT_STRIKES = 3;
143717
144078
  var MidTurnDrainTimeoutError = class extends Error {
@@ -148247,7 +148608,7 @@ var QwenAgent = class {
148247
148608
  async initialize(args) {
148248
148609
  this.clientCapabilities = args.clientCapabilities;
148249
148610
  const authMethods = buildAuthMethods();
148250
- const version = "0.18.1-nightly.20260616.a68b2e1e7";
148611
+ const version = "0.18.1-preview.1";
148251
148612
  return {
148252
148613
  protocolVersion: PROTOCOL_VERSION,
148253
148614
  agentInfo: {
@@ -151830,7 +152191,7 @@ function validateDnsResolutionOrder(order) {
151830
152191
  }
151831
152192
  __name(validateDnsResolutionOrder, "validateDnsResolutionOrder");
151832
152193
  function getNodeMemoryArgs(isDebugMode3) {
151833
- const totalMemoryMB = os32.totalmem() / (1024 * 1024);
152194
+ const totalMemoryMB = os31.totalmem() / (1024 * 1024);
151834
152195
  const heapStats = v83.getHeapStatistics();
151835
152196
  const currentMaxOldSpaceSizeMb = Math.floor(
151836
152197
  heapStats.heap_size_limit / 1024 / 1024
@@ -152332,7 +152693,7 @@ ${finalArgs[promptIndex + 1]}`;
152332
152693
  process.exit(0);
152333
152694
  }
152334
152695
  if (config.isInteractive()) {
152335
- void import("./chunks/scheduler-23KQW6CX.js").then((m) => m.startBackgroundHousekeeping(config, settings)).catch((err) => {
152696
+ void import("./chunks/scheduler-TAPJOQHX.js").then((m) => m.startBackgroundHousekeeping(config, settings)).catch((err) => {
152336
152697
  debugLogger80.warn("failed to start background housekeeping:", err);
152337
152698
  });
152338
152699
  }