@qwen-code/qwen-code 0.15.12-preview.3 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/bundled/qc-helper/docs/configuration/settings.md +59 -61
  2. package/bundled/qc-helper/docs/features/_meta.ts +2 -0
  3. package/bundled/qc-helper/docs/features/approval-mode.md +119 -2
  4. package/bundled/qc-helper/docs/features/auto-mode.md +263 -0
  5. package/bundled/qc-helper/docs/features/commands.md +11 -10
  6. package/bundled/qc-helper/docs/features/skills.md +3 -0
  7. package/bundled/qc-helper/docs/features/structured-output.md +309 -0
  8. package/bundled/qc-helper/docs/features/sub-agents.md +47 -5
  9. package/bundled/qc-helper/docs/qwen-serve.md +134 -10
  10. package/bundled/review/SKILL.md +12 -3
  11. package/chunks/{agent-LIAWUWAO.js → agent-K6OWOMBN.js} +15 -17
  12. package/chunks/{anthropicContentGenerator-4QE6LTVV.js → anthropicContentGenerator-RQJNXJIY.js} +7 -4
  13. package/chunks/{askUserQuestion-QFSCBTUO.js → askUserQuestion-PQPMPNM3.js} +2 -2
  14. package/chunks/{ca-S3XJMT6P.js → ca-UZ7BANMN.js} +3 -3
  15. package/chunks/{chunk-AJSOD5IR.js → chunk-3T4ZT63H.js} +8833 -3600
  16. package/chunks/{chunk-B7ZL7HUA.js → chunk-4AOCVI6J.js} +2 -1
  17. package/chunks/{chunk-AOJ3BBY7.js → chunk-4J63U5QO.js} +17 -349
  18. package/chunks/{chunk-AEJ2DKLP.js → chunk-C6WMLUNB.js} +1 -1
  19. package/chunks/{chunk-JMZQICAL.js → chunk-CAVZVZX6.js} +2 -2
  20. package/chunks/{chunk-CAWKL3UC.js → chunk-CSWBPY3P.js} +2 -2
  21. package/chunks/{chunk-G27O2LD2.js → chunk-D5NTAHYL.js} +1 -1
  22. package/chunks/{chunk-BXNCPI75.js → chunk-DMIMF3CG.js} +2 -2
  23. package/chunks/{chunk-OCC4MZRS.js → chunk-F23NCRJ2.js} +1 -1
  24. package/chunks/{chunk-5QQ5FGTU.js → chunk-G7YTSRES.js} +1 -1
  25. package/chunks/{chunk-SQNQIOD5.js → chunk-GGNTZ2NH.js} +92 -21
  26. package/chunks/{chunk-FKVKVE6N.js → chunk-KXZ4TJB4.js} +1 -1
  27. package/chunks/chunk-L34E6AGL.js +19126 -0
  28. package/chunks/{chunk-CBVB66WY.js → chunk-L5E26RN6.js} +2 -2
  29. package/chunks/{chunk-UXW7MYAW.js → chunk-MAY32HXD.js} +376 -1
  30. package/chunks/{chunk-GC5RXNL2.js → chunk-NOAHME6A.js} +115 -23
  31. package/chunks/{chunk-CM2IESUE.js → chunk-PR4T27R7.js} +1 -1
  32. package/chunks/{chunk-FYMSCRHM.js → chunk-PVVL5Q3W.js} +32 -1
  33. package/chunks/{chunk-YHEAJFCI.js → chunk-USE2VQ5P.js} +3 -0
  34. package/chunks/chunk-VMOAQVBP.js +379 -0
  35. package/chunks/{chunk-XLQ4E5PS.js → chunk-WCZWAKFG.js} +795 -142
  36. package/chunks/{chunk-GJXIKCKL.js → chunk-XP27SJMH.js} +76 -5
  37. package/chunks/{chunk-TPGOGCWM.js → chunk-YJLGXDQJ.js} +1 -1
  38. package/chunks/{contextCommand-SVLAZMQL.js → contextCommand-7CPNXBLO.js} +17 -19
  39. package/chunks/{cron-create-WUTD5ZTH.js → cron-create-IGYXQVG4.js} +28 -2
  40. package/chunks/{cron-delete-N3UQYCRA.js → cron-delete-ETKIZCWT.js} +2 -2
  41. package/chunks/{cron-list-Z6RJJ4YH.js → cron-list-BVCUSWRU.js} +2 -2
  42. package/chunks/{de-MNR4SMAI.js → de-V4IE2OOZ.js} +3 -3
  43. package/chunks/{dist-RRYNPBOE.js → dist-4L54HRX2.js} +2 -2
  44. package/chunks/{dist-WP4AH3VK.js → dist-BXDUQ2QY.js} +1 -1
  45. package/chunks/{dist-M6GFCZ7S.js → dist-MN2PDDPR.js} +1 -1
  46. package/chunks/{edit-VNAZBIZR.js → edit-CBM5NDVK.js} +28 -18
  47. package/chunks/{en-NRN4QBAT.js → en-HGJ2SPLM.js} +5 -3
  48. package/chunks/{enter-worktree-FOF5YZIV.js → enter-worktree-XABKPLO6.js} +41 -17
  49. package/chunks/{exit-worktree-Y6QVAO3C.js → exit-worktree-56MN2PCL.js} +41 -17
  50. package/chunks/{exitPlanMode-QZKO7GH7.js → exitPlanMode-YDNPCSCJ.js} +15 -17
  51. package/chunks/{fr-OFJFHLCR.js → fr-CJULI7ZX.js} +3 -3
  52. package/chunks/{geminiContentGenerator-DYHZPKJX.js → geminiContentGenerator-ZGPNBFDS.js} +3 -3
  53. package/chunks/{glob-G7XATELV.js → glob-ZHA35VO5.js} +15 -17
  54. package/chunks/{grep-4SETMY47.js → grep-RV6V6T52.js} +15 -17
  55. package/chunks/{ja-V6OQ6VL7.js → ja-L7CHRQEW.js} +3 -3
  56. package/chunks/{keychain-token-storage-DMFP5IJM.js → keychain-token-storage-335UOLJ6.js} +2 -2
  57. package/chunks/{ls-SUILOZZB.js → ls-7HD6XG3V.js} +3 -3
  58. package/chunks/{lsp-6TQBWVMZ.js → lsp-ZZSFCIWD.js} +2 -2
  59. package/chunks/{monitor-JTLJBJ7H.js → monitor-5G2OBGE5.js} +27 -17
  60. package/chunks/notebook-edit-XUBTCT6L.js +756 -0
  61. package/chunks/{openaiContentGenerator-3H7XOZBW.js → openaiContentGenerator-POYAZQ6I.js} +12 -11
  62. package/chunks/{pt-ZLE6SA4A.js → pt-M6JULLEQ.js} +3 -3
  63. package/chunks/{qwenContentGenerator-FAU3QPYO.js → qwenContentGenerator-2E4H56DK.js} +17 -19
  64. package/chunks/{qwenOAuth2-JSQ7EPR3.js → qwenOAuth2-EEJGROP7.js} +9 -3
  65. package/chunks/{read-file-WWUQVNCZ.js → read-file-3JIOOXFT.js} +7 -8
  66. package/chunks/{ripGrep-WCOAIWL6.js → ripGrep-LEI3L6PM.js} +15 -17
  67. package/chunks/{ru-A4OHIUNN.js → ru-QILM4HBC.js} +3 -3
  68. package/chunks/{send-message-Q2JRAC3J.js → send-message-ULK4MQXJ.js} +23 -2
  69. package/chunks/{serve-VJEEEXA6.js → serve-CFVRMD4W.js} +8500 -1663
  70. package/chunks/{shell-IAOKGIJ6.js → shell-3B5DZ437.js} +15 -17
  71. package/chunks/{skill-NHW6222K.js → skill-STSZUBXR.js} +23 -10
  72. package/chunks/{src-OWV5HVQQ.js → src-ROFXAPEP.js} +211 -19
  73. package/chunks/{syntheticOutput-S4DRGMQM.js → syntheticOutput-IS2X5OZ2.js} +3 -3
  74. package/chunks/{task-stop-7THHVAQS.js → task-stop-7QSJGSSP.js} +2 -2
  75. package/chunks/{todoWrite-WKUGUTPX.js → todoWrite-7CVACFUX.js} +3 -3
  76. package/chunks/{tool-search-MSJ6SXLI.js → tool-search-ARWOD3GD.js} +7 -8
  77. package/chunks/{web-fetch-OZE6ZQUF.js → web-fetch-ENQ2I5JA.js} +7 -4
  78. package/chunks/{write-file-RKCENFZ5.js → write-file-6MRT7TEW.js} +25 -18
  79. package/chunks/{zh-RN3JULHO.js → zh-PWL2NKY3.js} +5 -3
  80. package/chunks/{zh-TW-XZEHEV5S.js → zh-TW-S3YGWICZ.js} +5 -3
  81. package/cli.js +58070 -75930
  82. package/locales/ca.js +4 -5
  83. package/locales/de.js +4 -5
  84. package/locales/en.js +8 -5
  85. package/locales/fr.js +4 -5
  86. package/locales/ja.js +4 -5
  87. package/locales/pt.js +4 -5
  88. package/locales/ru.js +4 -5
  89. package/locales/zh-TW.js +6 -4
  90. package/locales/zh.js +6 -4
  91. package/package.json +2 -2
  92. package/chunks/chunk-5P5XGNYH.js +0 -93
  93. package/chunks/chunk-SYCJMSIJ.js +0 -82
  94. package/chunks/chunk-Y6Z2O3WR.js +0 -33
@@ -336,8 +336,8 @@ __name(sanitizeCwd, "sanitizeCwd");
336
336
  function isSubpath(parentPath, childPath) {
337
337
  const isWindows = os.platform() === "win32";
338
338
  const pathModule = isWindows ? path.win32 : path;
339
- const relative = pathModule.relative(parentPath, childPath);
340
- return !relative.startsWith(`..${pathModule.sep}`) && relative !== ".." && !pathModule.isAbsolute(relative);
339
+ const relative2 = pathModule.relative(parentPath, childPath);
340
+ return !relative2.startsWith(`..${pathModule.sep}`) && relative2 !== ".." && !pathModule.isAbsolute(relative2);
341
341
  }
342
342
  __name(isSubpath, "isSubpath");
343
343
  function isSubpaths(parentPath, childPath) {
@@ -443,6 +443,17 @@ var Storage = class _Storage {
443
443
  }
444
444
  return resolved;
445
445
  }
446
+ /**
447
+ * Sanitizes a session id for use as a plan filename.
448
+ *
449
+ * Plan files are keyed by session id, but the raw id is public SDK input.
450
+ * Strip directory separators and Windows-invalid filename characters so a
451
+ * hostile value cannot escape the plans directory.
452
+ */
453
+ static sanitizePlanSessionId(sessionId) {
454
+ const safeName = path2.basename(sessionId.replace(/\\/g, "/")).replace(/^\.+/g, "_").replace(/[<>:"|?*\x00-\x1F]/g, "_");
455
+ return safeName || "_";
456
+ }
446
457
  static resolveRuntimeBaseDir(dir, cwd) {
447
458
  if (!dir) {
448
459
  return null;
@@ -531,11 +542,71 @@ var Storage = class _Storage {
531
542
  static getGlobalIdeDir() {
532
543
  return path2.join(_Storage.getGlobalQwenDir(), IDE_DIR_NAME);
533
544
  }
534
- static getPlansDir() {
545
+ /**
546
+ * Resolves pathToResolve by realpathing its deepest existing ancestor and
547
+ * appending the not-yet-created remainder.
548
+ */
549
+ static resolvePathThroughExistingAncestor(pathToResolve) {
550
+ let candidate = pathToResolve;
551
+ while (true) {
552
+ try {
553
+ const realCandidate = fs2.realpathSync(candidate);
554
+ const remainder = path2.relative(candidate, pathToResolve);
555
+ return path2.join(realCandidate, remainder);
556
+ } catch (err) {
557
+ if (err.code !== "ENOENT") {
558
+ throw err;
559
+ }
560
+ const parent = path2.dirname(candidate);
561
+ if (parent === candidate) {
562
+ return pathToResolve;
563
+ }
564
+ candidate = parent;
565
+ }
566
+ }
567
+ }
568
+ /**
569
+ * Checks whether {@link childPath} resides within {@link parentPath},
570
+ * resolving symbolic links to prevent traversal bypass attacks.
571
+ */
572
+ static isPathWithinDirectory(childPath, parentPath) {
573
+ const realParent = _Storage.resolvePathThroughExistingAncestor(parentPath);
574
+ const realChild = _Storage.resolvePathThroughExistingAncestor(childPath);
575
+ const relativePath = path2.relative(realParent, realChild);
576
+ return relativePath === "" || !relativePath.startsWith("..") && !path2.isAbsolute(relativePath);
577
+ }
578
+ static assertPathWithinDirectory(childPath, parentPath, errorMessage) {
579
+ if (!_Storage.isPathWithinDirectory(childPath, parentPath)) {
580
+ throw new FatalConfigError(errorMessage);
581
+ }
582
+ }
583
+ static getPlansDir(projectRoot, plansDirectory) {
584
+ const configuredPlansDirectory = plansDirectory?.trim();
585
+ if (configuredPlansDirectory) {
586
+ if (!projectRoot) {
587
+ throw new FatalConfigError(
588
+ "projectRoot is required when plansDirectory is configured."
589
+ );
590
+ }
591
+ const resolvedProjectRoot = path2.resolve(projectRoot);
592
+ const resolvedPlansDirectory = _Storage.resolvePath(
593
+ configuredPlansDirectory,
594
+ resolvedProjectRoot
595
+ );
596
+ _Storage.assertPathWithinDirectory(
597
+ resolvedPlansDirectory,
598
+ resolvedProjectRoot,
599
+ `plansDirectory must resolve within the project root.`
600
+ );
601
+ return resolvedPlansDirectory;
602
+ }
535
603
  return path2.join(_Storage.getGlobalQwenDir(), PLANS_DIR_NAME);
536
604
  }
537
- static getPlanFilePath(sessionId) {
538
- return path2.join(_Storage.getPlansDir(), `${sessionId}.md`);
605
+ static getPlanFilePath(sessionId, projectRoot, plansDirectory) {
606
+ return path2.join(
607
+ _Storage.getPlansDir(projectRoot, plansDirectory),
608
+ `${_Storage.sanitizePlanSessionId(sessionId)}.md`
609
+ );
539
610
  }
540
611
  static getGlobalBinDir() {
541
612
  return path2.join(_Storage.getGlobalQwenDir(), BIN_DIR_NAME);
@@ -5,7 +5,7 @@ import {
5
5
  BaseToolInvocation,
6
6
  ToolDisplayNames,
7
7
  ToolNames
8
- } from "./chunk-FYMSCRHM.js";
8
+ } from "./chunk-PVVL5Q3W.js";
9
9
  import {
10
10
  init_esbuild_shims
11
11
  } from "./chunk-A4BMJM77.js";
@@ -4,34 +4,32 @@ import {
4
4
  collectContextData,
5
5
  contextCommand,
6
6
  formatContextUsageText
7
- } from "./chunk-AOJ3BBY7.js";
8
- import "./chunk-Y6Z2O3WR.js";
9
- import "./chunk-AJSOD5IR.js";
10
- import "./chunk-5P5XGNYH.js";
7
+ } from "./chunk-4J63U5QO.js";
8
+ import "./chunk-VMOAQVBP.js";
9
+ import "./chunk-3T4ZT63H.js";
11
10
  import "./chunk-K5PGHDBN.js";
12
11
  import "./chunk-O4PICXES.js";
13
12
  import "./chunk-TW522KN6.js";
14
13
  import "./chunk-MLZQVCF3.js";
15
- import "./chunk-JMZQICAL.js";
16
- import "./chunk-5QQ5FGTU.js";
17
- import "./chunk-B7ZL7HUA.js";
14
+ import "./chunk-CAVZVZX6.js";
15
+ import "./chunk-G7YTSRES.js";
16
+ import "./chunk-4AOCVI6J.js";
18
17
  import "./chunk-77WXWU44.js";
19
- import "./chunk-OCC4MZRS.js";
20
- import "./chunk-CAWKL3UC.js";
21
- import "./chunk-XLQ4E5PS.js";
22
- import "./chunk-SYCJMSIJ.js";
18
+ import "./chunk-F23NCRJ2.js";
19
+ import "./chunk-CSWBPY3P.js";
20
+ import "./chunk-WCZWAKFG.js";
23
21
  import "./chunk-UWCTAVOD.js";
24
22
  import "./chunk-OFEVLU4C.js";
25
- import "./chunk-CM2IESUE.js";
26
- import "./chunk-UXW7MYAW.js";
27
- import "./chunk-G27O2LD2.js";
23
+ import "./chunk-PR4T27R7.js";
24
+ import "./chunk-MAY32HXD.js";
25
+ import "./chunk-D5NTAHYL.js";
28
26
  import "./chunk-T4VD6OJ4.js";
29
27
  import "./chunk-RDYWTWEM.js";
30
- import "./chunk-TPGOGCWM.js";
31
- import "./chunk-FYMSCRHM.js";
32
- import "./chunk-SQNQIOD5.js";
33
- import "./chunk-FKVKVE6N.js";
34
- import "./chunk-GJXIKCKL.js";
28
+ import "./chunk-YJLGXDQJ.js";
29
+ import "./chunk-PVVL5Q3W.js";
30
+ import "./chunk-GGNTZ2NH.js";
31
+ import "./chunk-KXZ4TJB4.js";
32
+ import "./chunk-XP27SJMH.js";
35
33
  import "./chunk-E7E2MFYM.js";
36
34
  import "./chunk-ZERZSAZL.js";
37
35
  import "./chunk-QN5NZ3UQ.js";
@@ -11,8 +11,8 @@ import {
11
11
  BaseToolInvocation,
12
12
  ToolDisplayNames,
13
13
  ToolNames
14
- } from "./chunk-FYMSCRHM.js";
15
- import "./chunk-GJXIKCKL.js";
14
+ } from "./chunk-PVVL5Q3W.js";
15
+ import "./chunk-XP27SJMH.js";
16
16
  import "./chunk-QWSRH265.js";
17
17
  import {
18
18
  init_esbuild_shims
@@ -34,6 +34,17 @@ var CronCreateInvocation = class extends BaseToolInvocation {
34
34
  getDescription() {
35
35
  return `${this.params.cron}: ${this.params.prompt}`;
36
36
  }
37
+ /**
38
+ * The scheduled prompt fires against the agent at cron-trigger time
39
+ * and executes with full tool access. The CronCreateTool's L3 default
40
+ * must NOT be 'allow', because AUTO mode short-circuits at L4 when
41
+ * `finalPermission === 'allow'` — the classifier never runs and an
42
+ * arbitrary scheduled prompt is silently approved. `'ask'` routes
43
+ * the call through the classifier (or manual approval in DEFAULT).
44
+ */
45
+ async getDefaultPermission() {
46
+ return "ask";
47
+ }
37
48
  async execute() {
38
49
  const scheduler = this.config.getCronScheduler();
39
50
  const recurring = this.params.recurring !== false;
@@ -108,6 +119,21 @@ var CronCreateTool = class _CronCreateTool extends BaseDeclarativeTool {
108
119
  createInvocation(params) {
109
120
  return new CronCreateInvocation(this.config, params);
110
121
  }
122
+ /**
123
+ * Forward the prompt and cadence to the classifier. The scheduled
124
+ * prompt will be enqueued and executed against the agent at fire-time,
125
+ * so it must go through the same scrutiny as a direct command. Without
126
+ * this override the default projection returns `''` and the classifier
127
+ * sees `cron_create({})` — blind to what the agent will be asked to
128
+ * do in 8 hours.
129
+ */
130
+ toAutoClassifierInput(params) {
131
+ return {
132
+ cron: params.cron,
133
+ prompt: params.prompt,
134
+ recurring: params.recurring ?? true
135
+ };
136
+ }
111
137
  };
112
138
  export {
113
139
  CronCreateTool
@@ -5,8 +5,8 @@ import {
5
5
  BaseToolInvocation,
6
6
  ToolDisplayNames,
7
7
  ToolNames
8
- } from "./chunk-FYMSCRHM.js";
9
- import "./chunk-GJXIKCKL.js";
8
+ } from "./chunk-PVVL5Q3W.js";
9
+ import "./chunk-XP27SJMH.js";
10
10
  import "./chunk-QWSRH265.js";
11
11
  import {
12
12
  init_esbuild_shims
@@ -8,8 +8,8 @@ import {
8
8
  BaseToolInvocation,
9
9
  ToolDisplayNames,
10
10
  ToolNames
11
- } from "./chunk-FYMSCRHM.js";
12
- import "./chunk-GJXIKCKL.js";
11
+ } from "./chunk-PVVL5Q3W.js";
12
+ import "./chunk-XP27SJMH.js";
13
13
  import "./chunk-QWSRH265.js";
14
14
  import {
15
15
  init_esbuild_shims
@@ -125,7 +125,7 @@ var de_default = {
125
125
  "Compresses the context by replacing it with a summary.": "Komprimiert den Kontext durch Ersetzen mit einer Zusammenfassung.",
126
126
  "open full Qwen Code documentation in your browser": "Vollst\xE4ndige Qwen Code Dokumentation im Browser \xF6ffnen",
127
127
  "Configuration not available.": "Konfiguration nicht verf\xFCgbar.",
128
- "Configure authentication information for login": "Authentifizierungsinformationen f\xFCr die Anmeldung konfigurieren",
128
+ "Connect an LLM provider": "LLM-Anbieter verbinden",
129
129
  "Copy the last result or code snippet to clipboard": "Letztes Ergebnis oder Codeausschnitt in die Zwischenablage kopieren",
130
130
  // ============================================================================
131
131
  // Commands - Agents
@@ -782,8 +782,8 @@ var de_default = {
782
782
  "Continue previous conversation": "Vorheriges Gespr\xE4ch fortsetzen",
783
783
  "\u{1F44B} Welcome back! (Last updated: {{timeAgo}})": "\u{1F44B} Willkommen zur\xFCck! (Zuletzt aktualisiert: {{timeAgo}})",
784
784
  "\u{1F3AF} Overall Goal:": "\u{1F3AF} Gesamtziel:",
785
- "Select Authentication Method": "Authentifizierungsmethode ausw\xE4hlen",
786
- "You must select an auth method to proceed. Press Ctrl+C again to exit.": "Sie m\xFCssen eine Authentifizierungsmethode w\xE4hlen, um fortzufahren. Dr\xFCcken Sie erneut Ctrl+C zum Beenden.",
785
+ "Connect a Provider": "Anbieter verbinden",
786
+ "You must connect a provider to proceed. Press Ctrl+C again to exit.": "Sie m\xFCssen einen Anbieter verbinden, um fortzufahren. Dr\xFCcken Sie erneut Ctrl+C zum Beenden.",
787
787
  "Terms of Services and Privacy Notice": "Nutzungsbedingungen und Datenschutzhinweis",
788
788
  "Qwen OAuth": "Qwen OAuth",
789
789
  "Discontinued \u2014 switch to Coding Plan or API Key": "Eingestellt \u2014 wechseln Sie zu Coding Plan oder API Key",
@@ -11,10 +11,10 @@ import {
11
11
  sendMessage,
12
12
  sendTyping,
13
13
  uploadToCdn
14
- } from "./chunk-AEJ2DKLP.js";
14
+ } from "./chunk-C6WMLUNB.js";
15
15
  import {
16
16
  ChannelBase
17
- } from "./chunk-YHEAJFCI.js";
17
+ } from "./chunk-USE2VQ5P.js";
18
18
  import "./chunk-UFC57OYT.js";
19
19
  import "./chunk-K5PGHDBN.js";
20
20
  import {
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-KQIKOTQJ.js";
7
7
  import {
8
8
  ChannelBase
9
- } from "./chunk-YHEAJFCI.js";
9
+ } from "./chunk-USE2VQ5P.js";
10
10
  import "./chunk-UFC57OYT.js";
11
11
  import "./chunk-K5PGHDBN.js";
12
12
  import {
@@ -8,7 +8,7 @@ import {
8
8
  } from "./chunk-7RYW5LQV.js";
9
9
  import {
10
10
  ChannelBase
11
- } from "./chunk-YHEAJFCI.js";
11
+ } from "./chunk-USE2VQ5P.js";
12
12
  import "./chunk-UFC57OYT.js";
13
13
  import "./chunk-K5PGHDBN.js";
14
14
  import {
@@ -3,7 +3,7 @@
3
3
  import {
4
4
  StructuredToolError,
5
5
  checkPriorRead
6
- } from "./chunk-CBVB66WY.js";
6
+ } from "./chunk-L5E26RN6.js";
7
7
  import {
8
8
  CommitAttributionService,
9
9
  DEFAULT_DIFF_OPTIONS,
@@ -13,18 +13,17 @@ import {
13
13
  getDiffStat,
14
14
  needsUtf8Bom,
15
15
  safeLiteralReplace
16
- } from "./chunk-AJSOD5IR.js";
17
- import "./chunk-5P5XGNYH.js";
16
+ } from "./chunk-3T4ZT63H.js";
18
17
  import "./chunk-K5PGHDBN.js";
19
18
  import "./chunk-O4PICXES.js";
20
19
  import "./chunk-TW522KN6.js";
21
20
  import "./chunk-MLZQVCF3.js";
22
- import "./chunk-JMZQICAL.js";
23
- import "./chunk-5QQ5FGTU.js";
24
- import "./chunk-B7ZL7HUA.js";
21
+ import "./chunk-CAVZVZX6.js";
22
+ import "./chunk-G7YTSRES.js";
23
+ import "./chunk-4AOCVI6J.js";
25
24
  import "./chunk-77WXWU44.js";
26
- import "./chunk-OCC4MZRS.js";
27
- import "./chunk-CAWKL3UC.js";
25
+ import "./chunk-F23NCRJ2.js";
26
+ import "./chunk-CSWBPY3P.js";
28
27
  import {
29
28
  FileOperationEvent,
30
29
  ReadFileTool,
@@ -32,32 +31,31 @@ import {
32
31
  getLanguageFromFilePath,
33
32
  getSpecificMimeType,
34
33
  logFileOperation
35
- } from "./chunk-XLQ4E5PS.js";
36
- import "./chunk-SYCJMSIJ.js";
34
+ } from "./chunk-WCZWAKFG.js";
37
35
  import "./chunk-UWCTAVOD.js";
38
36
  import "./chunk-OFEVLU4C.js";
39
37
  import {
40
38
  isAutoMemPath
41
- } from "./chunk-CM2IESUE.js";
42
- import "./chunk-UXW7MYAW.js";
43
- import "./chunk-G27O2LD2.js";
39
+ } from "./chunk-PR4T27R7.js";
40
+ import "./chunk-MAY32HXD.js";
41
+ import "./chunk-D5NTAHYL.js";
44
42
  import "./chunk-T4VD6OJ4.js";
45
43
  import "./chunk-RDYWTWEM.js";
46
- import "./chunk-TPGOGCWM.js";
44
+ import "./chunk-YJLGXDQJ.js";
47
45
  import {
48
46
  BaseDeclarativeTool,
49
47
  ToolDisplayNames,
50
48
  ToolNames
51
- } from "./chunk-FYMSCRHM.js";
52
- import "./chunk-SQNQIOD5.js";
53
- import "./chunk-FKVKVE6N.js";
49
+ } from "./chunk-PVVL5Q3W.js";
50
+ import "./chunk-GGNTZ2NH.js";
51
+ import "./chunk-KXZ4TJB4.js";
54
52
  import {
55
53
  createDebugLogger,
56
54
  isNodeError,
57
55
  makeRelative,
58
56
  shortenPath,
59
57
  unescapePath
60
- } from "./chunk-GJXIKCKL.js";
58
+ } from "./chunk-XP27SJMH.js";
61
59
  import "./chunk-E7E2MFYM.js";
62
60
  import "./chunk-ZERZSAZL.js";
63
61
  import "./chunk-QN5NZ3UQ.js";
@@ -884,6 +882,18 @@ Expectation for required parameters:
884
882
  createInvocation(params) {
885
883
  return new EditToolInvocation(this.config, params);
886
884
  }
885
+ toAutoClassifierInput(params) {
886
+ const oldStr = params.old_string ?? "";
887
+ const newStr = params.new_string ?? "";
888
+ return {
889
+ file_path: params.file_path,
890
+ old_string_preview: oldStr.slice(0, 300),
891
+ new_string_preview: newStr.slice(0, 300),
892
+ old_string_truncated: oldStr.length > 300,
893
+ new_string_truncated: newStr.length > 300,
894
+ lines_changed: (newStr.match(/\n/g)?.length ?? 0) - (oldStr.match(/\n/g)?.length ?? 0)
895
+ };
896
+ }
887
897
  getModifyContext(_) {
888
898
  return {
889
899
  getFilePath: /* @__PURE__ */ __name((params) => params.file_path, "getFilePath"),
@@ -74,6 +74,7 @@ var en_default = {
74
74
  "docs/keyboard-shortcuts.md": "docs/keyboard-shortcuts.md",
75
75
  "for help on Qwen Code": "for help on Qwen Code",
76
76
  "show version info": "show version info",
77
+ "show paths for current session files and logs": "show paths for current session files and logs",
77
78
  "submit a bug report": "submit a bug report",
78
79
  Status: "Status",
79
80
  // ============================================================================
@@ -148,7 +149,7 @@ var en_default = {
148
149
  "Compresses the context by replacing it with a summary.": "Compresses the context by replacing it with a summary.",
149
150
  "open full Qwen Code documentation in your browser": "open full Qwen Code documentation in your browser",
150
151
  "Configuration not available.": "Configuration not available.",
151
- "Configure authentication information for login": "Configure authentication information for login",
152
+ "Connect an LLM provider": "Connect an LLM provider",
152
153
  "Copy the last result or code snippet to clipboard": "Copy the last result or code snippet to clipboard",
153
154
  "Show working-tree change stats versus HEAD": "Show working-tree change stats versus HEAD",
154
155
  "Could not determine current working directory.": "Could not determine current working directory.",
@@ -876,8 +877,8 @@ var en_default = {
876
877
  "Continue previous conversation": "Continue previous conversation",
877
878
  "\u{1F44B} Welcome back! (Last updated: {{timeAgo}})": "\u{1F44B} Welcome back! (Last updated: {{timeAgo}})",
878
879
  "\u{1F3AF} Overall Goal:": "\u{1F3AF} Overall Goal:",
879
- "Select Authentication Method": "Select Authentication Method",
880
- "You must select an auth method to proceed. Press Ctrl+C again to exit.": "You must select an auth method to proceed. Press Ctrl+C again to exit.",
880
+ "Connect a Provider": "Connect a Provider",
881
+ "You must connect a provider to proceed. Press Ctrl+C again to exit.": "You must connect a provider to proceed. Press Ctrl+C again to exit.",
881
882
  "Terms of Services and Privacy Notice": "Terms of Services and Privacy Notice",
882
883
  "Qwen OAuth": "Qwen OAuth",
883
884
  "Discontinued \u2014 switch to Coding Plan or API Key": "Discontinued \u2014 switch to Coding Plan or API Key",
@@ -1456,6 +1457,7 @@ var en_default = {
1456
1457
  "Set up Qwen Code's status line UI": "Set up Qwen Code's status line UI",
1457
1458
  // === Core: added from PR #3328 ===
1458
1459
  "Open the memory manager.": "Open the memory manager.",
1460
+ "Show current process memory diagnostics": "Show current process memory diagnostics",
1459
1461
  "Save a durable memory to the memory system.": "Save a durable memory to the memory system.",
1460
1462
  "Ask a quick side question without affecting the main conversation": "Ask a quick side question without affecting the main conversation",
1461
1463
  "Manage Arena sessions": "Manage Arena sessions",
@@ -2,40 +2,39 @@
2
2
  "use strict";
3
3
  import {
4
4
  GitWorktreeService,
5
+ writeWorktreeSession,
5
6
  writeWorktreeSessionMarker
6
- } from "./chunk-AJSOD5IR.js";
7
- import "./chunk-5P5XGNYH.js";
7
+ } from "./chunk-3T4ZT63H.js";
8
8
  import "./chunk-K5PGHDBN.js";
9
9
  import "./chunk-O4PICXES.js";
10
10
  import "./chunk-TW522KN6.js";
11
11
  import "./chunk-MLZQVCF3.js";
12
- import "./chunk-JMZQICAL.js";
13
- import "./chunk-5QQ5FGTU.js";
14
- import "./chunk-B7ZL7HUA.js";
12
+ import "./chunk-CAVZVZX6.js";
13
+ import "./chunk-G7YTSRES.js";
14
+ import "./chunk-4AOCVI6J.js";
15
15
  import "./chunk-77WXWU44.js";
16
- import "./chunk-OCC4MZRS.js";
17
- import "./chunk-CAWKL3UC.js";
18
- import "./chunk-XLQ4E5PS.js";
19
- import "./chunk-SYCJMSIJ.js";
16
+ import "./chunk-F23NCRJ2.js";
17
+ import "./chunk-CSWBPY3P.js";
18
+ import "./chunk-WCZWAKFG.js";
20
19
  import "./chunk-UWCTAVOD.js";
21
20
  import "./chunk-OFEVLU4C.js";
22
- import "./chunk-CM2IESUE.js";
23
- import "./chunk-UXW7MYAW.js";
24
- import "./chunk-G27O2LD2.js";
21
+ import "./chunk-PR4T27R7.js";
22
+ import "./chunk-MAY32HXD.js";
23
+ import "./chunk-D5NTAHYL.js";
25
24
  import "./chunk-T4VD6OJ4.js";
26
25
  import "./chunk-RDYWTWEM.js";
27
- import "./chunk-TPGOGCWM.js";
26
+ import "./chunk-YJLGXDQJ.js";
28
27
  import {
29
28
  BaseDeclarativeTool,
30
29
  BaseToolInvocation,
31
30
  ToolDisplayNames,
32
31
  ToolNames
33
- } from "./chunk-FYMSCRHM.js";
34
- import "./chunk-SQNQIOD5.js";
35
- import "./chunk-FKVKVE6N.js";
32
+ } from "./chunk-PVVL5Q3W.js";
33
+ import "./chunk-GGNTZ2NH.js";
34
+ import "./chunk-KXZ4TJB4.js";
36
35
  import {
37
36
  createDebugLogger
38
- } from "./chunk-GJXIKCKL.js";
37
+ } from "./chunk-XP27SJMH.js";
39
38
  import "./chunk-E7E2MFYM.js";
40
39
  import "./chunk-ZERZSAZL.js";
41
40
  import "./chunk-QN5NZ3UQ.js";
@@ -116,6 +115,14 @@ var EnterWorktreeInvocation = class extends BaseToolInvocation {
116
115
  `enter_worktree: getCurrentBranch failed at ${projectRoot}: ${error}`
117
116
  );
118
117
  }
118
+ let originalHeadCommit = "";
119
+ try {
120
+ originalHeadCommit = await service.getCurrentCommitHash();
121
+ } catch (error) {
122
+ debugLogger.warn(
123
+ `enter_worktree: getCurrentCommitHash failed at ${projectRoot}: ${error}`
124
+ );
125
+ }
119
126
  const result = await service.createUserWorktree(slug, baseBranch);
120
127
  if (!result.success || !result.worktree) {
121
128
  const reason = result.error ?? "Failed to create worktree.";
@@ -132,6 +139,23 @@ var EnterWorktreeInvocation = class extends BaseToolInvocation {
132
139
  `enter_worktree: failed to write session marker at ${result.worktree.path}: ${error}`
133
140
  );
134
141
  }
142
+ try {
143
+ await writeWorktreeSession(
144
+ this.config.getSessionService().getWorktreeSessionPath(this.config.getSessionId()),
145
+ {
146
+ slug,
147
+ worktreePath: result.worktree.path,
148
+ worktreeBranch: result.worktree.branch,
149
+ originalCwd: projectRoot,
150
+ originalBranch: baseBranch ?? "HEAD",
151
+ originalHeadCommit
152
+ }
153
+ );
154
+ } catch (error) {
155
+ debugLogger.warn(
156
+ `enter_worktree: failed to write WorktreeSession sidecar: ${error}`
157
+ );
158
+ }
135
159
  const output = {
136
160
  worktreePath: result.worktree.path,
137
161
  worktreeBranch: result.worktree.branch,
@@ -2,42 +2,42 @@
2
2
  "use strict";
3
3
  import {
4
4
  GitWorktreeService,
5
+ clearWorktreeSession,
6
+ readWorktreeSession,
5
7
  readWorktreeSessionMarker,
6
8
  worktreeBranchForSlug
7
- } from "./chunk-AJSOD5IR.js";
8
- import "./chunk-5P5XGNYH.js";
9
+ } from "./chunk-3T4ZT63H.js";
9
10
  import "./chunk-K5PGHDBN.js";
10
11
  import "./chunk-O4PICXES.js";
11
12
  import "./chunk-TW522KN6.js";
12
13
  import "./chunk-MLZQVCF3.js";
13
- import "./chunk-JMZQICAL.js";
14
- import "./chunk-5QQ5FGTU.js";
15
- import "./chunk-B7ZL7HUA.js";
14
+ import "./chunk-CAVZVZX6.js";
15
+ import "./chunk-G7YTSRES.js";
16
+ import "./chunk-4AOCVI6J.js";
16
17
  import "./chunk-77WXWU44.js";
17
- import "./chunk-OCC4MZRS.js";
18
- import "./chunk-CAWKL3UC.js";
19
- import "./chunk-XLQ4E5PS.js";
20
- import "./chunk-SYCJMSIJ.js";
18
+ import "./chunk-F23NCRJ2.js";
19
+ import "./chunk-CSWBPY3P.js";
20
+ import "./chunk-WCZWAKFG.js";
21
21
  import "./chunk-UWCTAVOD.js";
22
22
  import "./chunk-OFEVLU4C.js";
23
- import "./chunk-CM2IESUE.js";
24
- import "./chunk-UXW7MYAW.js";
25
- import "./chunk-G27O2LD2.js";
23
+ import "./chunk-PR4T27R7.js";
24
+ import "./chunk-MAY32HXD.js";
25
+ import "./chunk-D5NTAHYL.js";
26
26
  import "./chunk-T4VD6OJ4.js";
27
27
  import "./chunk-RDYWTWEM.js";
28
- import "./chunk-TPGOGCWM.js";
28
+ import "./chunk-YJLGXDQJ.js";
29
29
  import {
30
30
  BaseDeclarativeTool,
31
31
  BaseToolInvocation,
32
32
  ToolDisplayNames,
33
33
  ToolNames
34
- } from "./chunk-FYMSCRHM.js";
35
- import "./chunk-SQNQIOD5.js";
36
- import "./chunk-FKVKVE6N.js";
34
+ } from "./chunk-PVVL5Q3W.js";
35
+ import "./chunk-GGNTZ2NH.js";
36
+ import "./chunk-KXZ4TJB4.js";
37
37
  import {
38
38
  createDebugLogger,
39
39
  isNodeError
40
- } from "./chunk-GJXIKCKL.js";
40
+ } from "./chunk-XP27SJMH.js";
41
41
  import "./chunk-E7E2MFYM.js";
42
42
  import "./chunk-ZERZSAZL.js";
43
43
  import "./chunk-QN5NZ3UQ.js";
@@ -206,6 +206,7 @@ var ExitWorktreeInvocation = class extends BaseToolInvocation {
206
206
  return errorResult(result.error ?? "Failed to remove worktree.");
207
207
  }
208
208
  if (result.branchPreserved) {
209
+ await this.maybeClearWorktreeSession();
209
210
  const output2 = {
210
211
  action: "remove",
211
212
  worktreePath,
@@ -220,6 +221,7 @@ var ExitWorktreeInvocation = class extends BaseToolInvocation {
220
221
  debugLogger.debug(
221
222
  `Removed user worktree: ${worktreePath} (branch=${branch})`
222
223
  );
224
+ await this.maybeClearWorktreeSession();
223
225
  const output = {
224
226
  action: "remove",
225
227
  worktreePath,
@@ -231,6 +233,28 @@ var ExitWorktreeInvocation = class extends BaseToolInvocation {
231
233
  returnDisplay: `Removed worktree **${this.params.name}** (branch \`${branch}\`)`
232
234
  };
233
235
  }
236
+ /**
237
+ * Clears the WorktreeSession sidecar file iff its `slug` matches the
238
+ * worktree being exited. We skip the clear when the sidecar names a
239
+ * different slug because the user might have multiple worktrees on
240
+ * disk while the sidecar tracks only one — wiping it on every exit
241
+ * would orphan the currently-tracked worktree from the CLI's view.
242
+ *
243
+ * Best-effort: failures are logged, never raised.
244
+ */
245
+ async maybeClearWorktreeSession() {
246
+ try {
247
+ const sessionPath = this.config.getSessionService().getWorktreeSessionPath(this.config.getSessionId());
248
+ const existing = await readWorktreeSession(sessionPath);
249
+ if (existing && existing.slug === this.params.name) {
250
+ await clearWorktreeSession(sessionPath);
251
+ }
252
+ } catch (error) {
253
+ debugLogger.warn(
254
+ `exit_worktree: failed to clear WorktreeSession sidecar: ${error}`
255
+ );
256
+ }
257
+ }
234
258
  };
235
259
  function errorResult(message) {
236
260
  return {