@qwen-code/qwen-code 0.17.1-nightly.20260608.aea34fa2c → 0.18.0-preview.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 (95) hide show
  1. package/bundled/qc-helper/SKILL.md +30 -24
  2. package/bundled/qc-helper/docs/features/auto-mode.md +54 -9
  3. package/bundled/qc-helper/docs/features/commands.md +11 -11
  4. package/bundled/qc-helper/docs/features/markdown-rendering.md +21 -1
  5. package/chunks/{agent-CRCEWDXY.js → agent-6J2FFD7S.js} +16 -16
  6. package/chunks/{anthropicContentGenerator-CORCIHMT.js → anthropicContentGenerator-4QBVSFSJ.js} +4 -4
  7. package/chunks/{askUserQuestion-LXMRMFII.js → askUserQuestion-NOOLRWCJ.js} +2 -2
  8. package/chunks/{ca-AD47AV3M.js → ca-WRHFBIDH.js} +10 -1
  9. package/chunks/{chunk-MW6Z7JDT.js → chunk-3H7ENG2Q.js} +20 -18
  10. package/chunks/{chunk-UKQJ7G3U.js → chunk-5RNZ2QKF.js} +1 -1
  11. package/chunks/{chunk-LESSBSSE.js → chunk-6VFG3EUJ.js} +1 -1
  12. package/chunks/{chunk-2T34DNYQ.js → chunk-AVLOK27J.js} +42 -8
  13. package/chunks/{chunk-ZAHZV7IR.js → chunk-BBTV54KB.js} +2 -2
  14. package/chunks/{chunk-4XIYRIZ6.js → chunk-BPZQVC2P.js} +110 -9
  15. package/chunks/{chunk-MUMLIB4J.js → chunk-BUOJN3MM.js} +10481 -8589
  16. package/chunks/{chunk-OV5SE5JD.js → chunk-D46KOV3C.js} +1 -1
  17. package/chunks/{chunk-DU2ZAFA7.js → chunk-F5ORN4YO.js} +1 -1
  18. package/chunks/{chunk-UB3HGW3I.js → chunk-G763GDO6.js} +22 -11
  19. package/chunks/{chunk-7R5J5HSJ.js → chunk-GBEPNWYB.js} +1 -1
  20. package/chunks/{chunk-EYEDXJ2Z.js → chunk-IKOMHTCC.js} +6 -6
  21. package/chunks/{chunk-JAF4PLE7.js → chunk-JMLIPZUU.js} +3 -3
  22. package/chunks/{chunk-KSX2FIAZ.js → chunk-JSYEZAYV.js} +2 -2
  23. package/chunks/{chunk-R7WIF3BU.js → chunk-MVX64PNU.js} +1 -1
  24. package/chunks/{chunk-UEW42CYE.js → chunk-PLYZAP4W.js} +45 -9
  25. package/chunks/{chunk-S2HZQ4RC.js → chunk-R5PDRHEF.js} +1 -0
  26. package/chunks/{chunk-77UV3M62.js → chunk-SCHRFI7O.js} +1 -1
  27. package/chunks/{chunk-OCR7PXOA.js → chunk-SHUT5MQY.js} +1 -1
  28. package/chunks/{chunk-OPFJCRUK.js → chunk-UABFCMPA.js} +2 -1
  29. package/chunks/{chunk-DIO32KR5.js → chunk-UQZQP5PA.js} +11 -11
  30. package/chunks/{chunk-FCY4DV3R.js → chunk-UXBKX55L.js} +10 -6
  31. package/chunks/{computer-use-C5ZJRSKF.js → computer-use-6LZXL3UW.js} +16 -16
  32. package/chunks/{contextCommand-G54AJMCX.js → contextCommand-ZV5QQ2LA.js} +18 -18
  33. package/chunks/{cron-create-PJOVYSIF.js → cron-create-PIPMXQN4.js} +2 -2
  34. package/chunks/{cron-delete-7EYEJ44X.js → cron-delete-6Y5XIDMS.js} +2 -2
  35. package/chunks/{cron-list-LMUJOUDI.js → cron-list-A4WNRUWZ.js} +2 -2
  36. package/chunks/{de-GYJ2LJ32.js → de-M5RPB2NB.js} +10 -1
  37. package/chunks/{edit-JVUXZ6WE.js → edit-J7D6VMPQ.js} +19 -19
  38. package/chunks/{en-QEV466ZF.js → en-UMYKQAZE.js} +11 -1
  39. package/chunks/{enter-worktree-GOVBTJZR.js → enter-worktree-NDJTVGYJ.js} +16 -16
  40. package/chunks/{exit-worktree-YZAGLIWA.js → exit-worktree-UB6XYYAX.js} +16 -16
  41. package/chunks/{exitPlanMode-RY6DM3LO.js → exitPlanMode-V6X2KL4X.js} +16 -16
  42. package/chunks/{fr-GH7C66F4.js → fr-MPYXXXPW.js} +10 -1
  43. package/chunks/{geminiContentGenerator-BB4RL4HR.js → geminiContentGenerator-3AKHMB3P.js} +4 -4
  44. package/chunks/{glob-UZHZN5GU.js → glob-PBG5DRG4.js} +16 -16
  45. package/chunks/{grep-7N5SXCM2.js → grep-VQ56EWQ7.js} +16 -16
  46. package/chunks/{ja-ZXM3KE24.js → ja-NFZ32AB3.js} +10 -1
  47. package/chunks/{keychain-token-storage-25D5QXMC.js → keychain-token-storage-UHGOCDD6.js} +2 -2
  48. package/chunks/{ls-PPWEULT2.js → ls-34DLNYCD.js} +3 -3
  49. package/chunks/{lsp-2BY4ZXDL.js → lsp-NCDEHH3V.js} +2 -2
  50. package/chunks/{monitor-RUX4WCW6.js → monitor-J3YCSOEH.js} +16 -16
  51. package/chunks/{notebook-edit-QSHYIM2C.js → notebook-edit-AL3CBYJ6.js} +17 -17
  52. package/chunks/{openaiContentGenerator-557UCKMQ.js → openaiContentGenerator-3U6UARHS.js} +11 -11
  53. package/chunks/{pt-NHIAQIDQ.js → pt-BR43FRBA.js} +10 -1
  54. package/chunks/{qwenContentGenerator-QG4JMJH5.js → qwenContentGenerator-JRFHJRH6.js} +18 -18
  55. package/chunks/{qwenOAuth2-FUBP4U5T.js → qwenOAuth2-KRJT35QH.js} +4 -4
  56. package/chunks/{read-file-ROG4RM65.js → read-file-ZF6EIVE3.js} +8 -8
  57. package/chunks/{ripGrep-ADC4YGZN.js → ripGrep-N2ZT7M6Z.js} +16 -16
  58. package/chunks/{ru-PWPUZWMR.js → ru-DQCW2KHD.js} +10 -1
  59. package/chunks/{scheduler-SJAUHFQT.js → scheduler-OS37FUFT.js} +16 -16
  60. package/chunks/{send-message-OGMOM5PZ.js → send-message-YYF56TS7.js} +2 -2
  61. package/chunks/{serve-TDCSIUAA.js → serve-ABOLLDNN.js} +18 -18
  62. package/chunks/{shell-CHR54FUA.js → shell-XGN7IDUS.js} +16 -16
  63. package/chunks/{skill-XJVA5TG4.js → skill-YQQ6CR4U.js} +26 -18
  64. package/chunks/{src-7ACBXZIS.js → src-LORPPHWB.js} +65 -21
  65. package/chunks/{syntheticOutput-MS737GGZ.js → syntheticOutput-T5SWX3YF.js} +3 -3
  66. package/chunks/{task-stop-FBGBLI2N.js → task-stop-3VHAQMYM.js} +2 -2
  67. package/chunks/{todoWrite-4NAE33MV.js → todoWrite-EAGJGKO5.js} +4 -4
  68. package/chunks/{tool-search-TVX3HXW5.js → tool-search-PDOJPXJJ.js} +24 -9
  69. package/chunks/{web-fetch-YM7HKIWL.js → web-fetch-SS6IKK6N.js} +4 -4
  70. package/chunks/{write-file-FUPILDLW.js → write-file-VWWCN7LI.js} +19 -19
  71. package/chunks/{zh-CFLG2MJ5.js → zh-6VFXOAR5.js} +11 -1
  72. package/chunks/{zh-TW-7D4PSECL.js → zh-TW-IQZ4AD5M.js} +11 -1
  73. package/cli.js +3391 -959
  74. package/examples/agent/agents/diary.md +86 -0
  75. package/examples/agent/qwen-extension.json +4 -0
  76. package/examples/commands/commands/fs/grep-code.md +3 -0
  77. package/examples/commands/qwen-extension.json +4 -0
  78. package/examples/context/QWEN.md +8 -0
  79. package/examples/context/qwen-extension.json +4 -0
  80. package/examples/mcp-server/example.ts +60 -0
  81. package/examples/mcp-server/package.json +18 -0
  82. package/examples/mcp-server/qwen-extension.json +11 -0
  83. package/examples/mcp-server/tsconfig.json +13 -0
  84. package/examples/skills/qwen-extension.json +4 -0
  85. package/examples/skills/skills/synonyms/SKILL.md +48 -0
  86. package/locales/ca.js +20 -2
  87. package/locales/de.js +20 -2
  88. package/locales/en.js +21 -2
  89. package/locales/fr.js +20 -2
  90. package/locales/ja.js +20 -2
  91. package/locales/pt.js +20 -2
  92. package/locales/ru.js +20 -2
  93. package/locales/zh-TW.js +20 -2
  94. package/locales/zh.js +20 -2
  95. package/package.json +3 -2
@@ -43,25 +43,30 @@ Use this index to locate the right document for the user's question. Load only t
43
43
  | Model providers (OpenAI-compatible, etc.) | `docs/configuration/model-providers.md` |
44
44
  | .qwenignore file | `docs/configuration/qwen-ignore.md` |
45
45
  | Themes | `docs/configuration/themes.md` |
46
- | Memory | `docs/configuration/memory.md` |
47
46
  | Trusted folders | `docs/configuration/trusted-folders.md` |
48
47
 
49
48
  ### Features
50
49
 
51
- | Topic | Doc Path |
52
- | ------------------------------------------- | -------------------------------- |
53
- | Approval mode (plan/default/auto_edit/yolo) | `docs/features/approval-mode.md` |
54
- | MCP (Model Context Protocol) | `docs/features/mcp.md` |
55
- | Skills system | `docs/features/skills.md` |
56
- | Sub-agents | `docs/features/sub-agents.md` |
57
- | Sandbox / security | `docs/features/sandbox.md` |
58
- | Slash commands | `docs/features/commands.md` |
59
- | Headless / non-interactive mode | `docs/features/headless.md` |
60
- | LSP integration | `docs/features/lsp.md` |
61
- | Checkpointing | `docs/features/checkpointing.md` |
62
- | Token caching | `docs/features/token-caching.md` |
63
- | Language / i18n | `docs/features/language.md` |
64
- | Arena mode | `docs/features/arena.md` |
50
+ | Topic | Doc Path |
51
+ | ------------------------------------------- | ---------------------------------- |
52
+ | Approval mode (plan/default/auto_edit/yolo) | `docs/features/approval-mode.md` |
53
+ | Auto mode (AI-driven approval) | `docs/features/auto-mode.md` |
54
+ | Hooks (lifecycle hooks) | `docs/features/hooks.md` |
55
+ | MCP (Model Context Protocol) | `docs/features/mcp.md` |
56
+ | Memory | `docs/features/memory.md` |
57
+ | Skills system | `docs/features/skills.md` |
58
+ | Sub-agents | `docs/features/sub-agents.md` |
59
+ | Sandbox / security | `docs/features/sandbox.md` |
60
+ | Slash commands | `docs/features/commands.md` |
61
+ | Headless / non-interactive mode | `docs/features/headless.md` |
62
+ | LSP integration | `docs/features/lsp.md` |
63
+ | Checkpointing | `docs/features/checkpointing.md` |
64
+ | Token caching | `docs/features/token-caching.md` |
65
+ | Language / i18n | `docs/features/language.md` |
66
+ | Arena mode | `docs/features/arena.md` |
67
+ | Status line | `docs/features/status-line.md` |
68
+ | Scheduled tasks (cron/loop) | `docs/features/scheduled-tasks.md` |
69
+ | Worktree | `docs/features/worktree.md` |
65
70
 
66
71
  ### IDE Integration
67
72
 
@@ -111,15 +116,16 @@ When the user asks about configuration, the primary reference is `docs/configura
111
116
 
112
117
  ### Common Config Categories
113
118
 
114
- | Category | Key Config Keys | Reference |
115
- | ------------- | ----------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
116
- | Permissions | `permissions.allow/ask/deny` | `docs/configuration/settings.md`, `docs/features/approval-mode.md` |
117
- | MCP Servers | `mcpServers.*`, `mcp.*` | `docs/configuration/settings.md`, `docs/features/mcp.md` |
118
- | Tool Approval | `tools.approvalMode` | `docs/configuration/settings.md`, `docs/features/approval-mode.md` |
119
- | Model | `model.name`, `modelProviders` | `docs/configuration/settings.md`, `docs/configuration/model-providers.md` |
120
- | General/UI | `general.*`, `ui.*`, `ide.*`, `output.*` | `docs/configuration/settings.md` |
121
- | Context | `context.*` | `docs/configuration/settings.md` |
122
- | Advanced | `hooks`, `env`, `webSearch`, `security`, `privacy`, `telemetry`, `advanced.*` | `docs/configuration/settings.md` |
119
+ | Category | Key Config Keys | Reference |
120
+ | ------------- | -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
121
+ | Permissions | `permissions.allow/ask/deny` | `docs/configuration/settings.md`, `docs/features/approval-mode.md` |
122
+ | MCP Servers | `mcpServers.*`, `mcp.*` | `docs/configuration/settings.md`, `docs/features/mcp.md` |
123
+ | Tool Approval | `tools.approvalMode` | `docs/configuration/settings.md`, `docs/features/approval-mode.md`, `docs/features/auto-mode.md` |
124
+ | Hooks | `hooks.*` | `docs/features/hooks.md` |
125
+ | Model | `model.name`, `modelProviders` | `docs/configuration/settings.md`, `docs/configuration/model-providers.md` |
126
+ | General/UI | `general.*`, `ui.*`, `ide.*`, `output.*` | `docs/configuration/settings.md` |
127
+ | Context | `context.*` | `docs/configuration/settings.md` |
128
+ | Advanced | `env`, `webSearch`, `security`, `privacy`, `telemetry`, `advanced.*` | `docs/configuration/settings.md` |
123
129
 
124
130
  ---
125
131
 
@@ -15,6 +15,16 @@ walks three layers in order:
15
15
 
16
16
  1. **acceptEdits fast-path** — Edit / Write whose target path is inside
17
17
  the workspace is auto-approved without invoking the classifier.
18
+ **Exception:** writes to Qwen Code's own self-modification surfaces
19
+ (`.qwen/settings*.json`, `QWEN.md`, `AGENTS.md`, `QWEN.local.md`,
20
+ configured context filenames, `.qwen/rules/`, `.qwen/commands/`,
21
+ `.qwen/agents/`, `.qwen/skills/`, `.qwen/hooks/`, `.mcp.json`) and
22
+ persistence surfaces (`.git/`, `.husky/`, `package.json`, `.npmrc`,
23
+ `Makefile`, `.github/workflows/`, etc.) route through the classifier
24
+ even when they are inside the workspace. Symlinks targeting protected
25
+ paths are resolved and rejected too. Shell commands that reach these
26
+ paths via `cd && bash -lc '...'` or other wrappers go through the
27
+ classifier as well.
18
28
  2. **Safe-tool allowlist** — Read-only and metadata-only built-in tools
19
29
  (Read, Grep, Glob, LS, LSP, TodoWrite, AskUserQuestion, etc.) are
20
30
  auto-approved without invoking the classifier.
@@ -42,7 +52,12 @@ runs:
42
52
  classifier never sees it.
43
53
  - `permissions.allow` rules with specific specifiers (e.g.
44
54
  `Bash(git status)`, `Read(./docs/**)`) still auto-allow without the
45
- classifier.
55
+ classifier — **except** when the call resolves to a write at a
56
+ protected self-modification or persistence path (see the list under
57
+ "How it works"). In that case Auto Mode re-checks the call through
58
+ the classifier so an allow rule on `Bash(*)` cannot silently turn
59
+ into permission to rewrite Qwen Code settings, commands, hooks,
60
+ skills, or MCP servers.
46
61
  - `permissions.ask` rules force manual confirmation even in Auto Mode.
47
62
 
48
63
  ## Over-broad allow rules are stripped while in Auto Mode
@@ -69,6 +84,19 @@ entries are natural-language descriptions, not rule patterns — they are
69
84
  injected additively into the classifier's system prompt alongside the
70
85
  built-in defaults.
71
86
 
87
+ There are three hint categories plus an environment list:
88
+
89
+ - **`allow`** — actions the classifier should auto-approve.
90
+ - **`softDeny`** — destructive or irreversible actions the classifier
91
+ should block **unless the user's most recent explicit request asked
92
+ for that exact action and scope**. Soft denies can be cleared by
93
+ user intent; a generic "yes do whatever" doesn't count.
94
+ - **`hardDeny`** — security-boundary actions the classifier must block
95
+ in Auto Mode regardless of `autoMode.hints.allow` or recent user
96
+ intent. This is classifier policy, not a deterministic permission
97
+ rule: it does not override `permissions.allow`. Use `permissions.deny`
98
+ for actions that must never be allowed by the permission manager.
99
+
72
100
  ```json
73
101
  {
74
102
  "permissions": {
@@ -79,10 +107,13 @@ built-in defaults.
79
107
  "Cleaning build artifacts under ./dist or ./build",
80
108
  "Reading any file under /Users/me/code/"
81
109
  ],
82
- "deny": [
83
- "Any network call to intranet.example.com endpoints",
84
- "Modifying anything under ~/.ssh or ~/.aws",
110
+ "softDeny": [
111
+ "Editing Qwen Code settings unless I explicitly ask for the exact change",
85
112
  "Running migration scripts that touch the production DB"
113
+ ],
114
+ "hardDeny": [
115
+ "Sending secrets or .env contents to any network endpoint",
116
+ "Modifying anything under ~/.ssh or ~/.aws"
86
117
  ]
87
118
  },
88
119
  "environment": [
@@ -94,13 +125,18 @@ built-in defaults.
94
125
  }
95
126
  ```
96
127
 
128
+ `hints.deny` is still accepted for backward compatibility and is treated
129
+ as `softDeny`. Mixing both is fine — entries are concatenated, `softDeny`
130
+ first.
131
+
97
132
  ### Length and count limits
98
133
 
99
134
  To keep the classifier system prompt small:
100
135
 
101
136
  - Each entry is capped at 200 characters (longer entries are truncated
102
137
  with a warning).
103
- - `hints.allow` and `hints.deny` accept up to 50 entries each.
138
+ - `hints.allow`, `hints.softDeny`, and `hints.hardDeny` accept up to 50
139
+ entries each.
104
140
  - `environment` accepts up to 20 entries.
105
141
 
106
142
  ### Layering across settings files
@@ -114,15 +150,24 @@ de-duplicated.
114
150
  When the classifier blocks an action, the tool call fails with one of
115
151
  the following error texts:
116
152
 
117
- - **`Blocked by auto mode policy: <reason>`** — the classifier judged
118
- the action unsafe. The reason comes from Stage 2 of the classifier.
153
+ - **`Blocked by auto mode policy: <reason>`** —
154
+ the classifier judged the action unsafe. The reason comes from Stage
155
+ 2 of the classifier.
119
156
  - **`Auto mode classifier unavailable; action blocked for safety`** —
120
157
  the classifier API was unreachable, timed out, or returned an
121
158
  un-parseable response. This is fail-closed behavior: when in doubt,
122
159
  block.
123
160
 
124
- The main LLM sees the same message in the tool result and adjusts its
125
- approach (asks you, switches tactic, gives up).
161
+ Both messages are followed by a trailing guidance line telling the agent
162
+ that the **denied action specifically** must not be completed through
163
+ another tool, shell indirection, generated script, alias, symlink,
164
+ config change, hook, command file, MCP configuration, encoded payload,
165
+ or equivalent path. **Unrelated safe work and genuinely safer
166
+ alternatives are still allowed** — only attempts to accomplish the same
167
+ denied intent through a different surface are blocked.
168
+
169
+ If the denied action is genuinely required, the agent should stop and
170
+ ask you for explicit approval rather than route around the denial.
126
171
 
127
172
  ### Classifier reason language
128
173
 
@@ -268,17 +268,17 @@ In headless (`--prompt`) or non-interactive contexts, `/diff` prints a plain-tex
268
268
 
269
269
  Commands for obtaining information and performing system settings.
270
270
 
271
- | Command | Description | Usage Examples |
272
- | --------------- | ----------------------------------------------- | -------------------------------- |
273
- | `/help` | Display help information for available commands | `/help` or `/?` |
274
- | `/status` | Display version information | `/status` or `/about` |
275
- | `/status paths` | Display current session file and log paths | `/status paths` |
276
- | `/stats` | Display detailed statistics for current session | `/stats` |
277
- | `/settings` | Open settings editor | `/settings` |
278
- | `/auth` | Change authentication method | `/auth` |
279
- | `/bug` | Submit issue about Qwen Code | `/bug Button click unresponsive` |
280
- | `/copy` | Copy last output content to clipboard | `/copy` |
281
- | `/quit` | Exit Qwen Code immediately | `/quit` or `/exit` |
271
+ | Command | Description | Usage Examples |
272
+ | --------------- | ------------------------------------------------------------- | -------------------------------- |
273
+ | `/help` | Display help information for available commands | `/help` or `/?` |
274
+ | `/status` | Display version information | `/status` or `/about` |
275
+ | `/status paths` | Display current session file and log paths | `/status paths` |
276
+ | `/stats` | Display detailed statistics for current session | `/stats` |
277
+ | `/settings` | Open settings editor | `/settings` |
278
+ | `/auth` | Change authentication method | `/auth` |
279
+ | `/bug` | Submit issue about Qwen Code | `/bug Button click unresponsive` |
280
+ | `/copy` | Copy AI output to clipboard (`/copy N` = Nth-last AI message) | `/copy` or `/copy 2` |
281
+ | `/quit` | Exit Qwen Code immediately | `/quit` or `/exit` |
282
282
 
283
283
  ### 1.10 Common Shortcuts
284
284
 
@@ -150,6 +150,25 @@ response:
150
150
  | `/copy code typescript` | Copies the last `typescript` code block. |
151
151
  | `/copy code mermaid 1` | Copies the first `mermaid` code block. |
152
152
 
153
+ ## Selecting an Earlier AI Message
154
+
155
+ By default `/copy` targets the most recent AI message. Prefix the command with
156
+ a positive integer to copy from the Nth-last AI message instead — handy when
157
+ the latest reply is something low-signal (e.g., a TODO update) and the
158
+ substantive output is one or two turns back.
159
+
160
+ | Command | Behavior |
161
+ | --------------------- | ------------------------------------------------------ |
162
+ | `/copy 2` | Copies the second-to-last AI message in full. |
163
+ | `/copy 3` | Copies the third-to-last AI message in full. |
164
+ | `/copy 2 code python` | Copies the last `python` code block from the 2nd-last. |
165
+ | `/copy 3 latex` | Copies the last LaTeX block from the 3rd-last message. |
166
+
167
+ `/copy 1` is equivalent to `/copy`. If `N` exceeds the number of AI messages
168
+ in the session, `/copy` reports the actual count instead of copying anything.
169
+ Without a leading integer, sub-selectors such as `/copy code python 2` keep
170
+ their existing meaning (the 2nd `python` block in the last message).
171
+
153
172
  ## Current Limits
154
173
 
155
174
  - Mermaid image rendering depends on Mermaid CLI plus terminal image support.
@@ -160,4 +179,5 @@ response:
160
179
  Mermaid layout engine.
161
180
  - Raw mode is global for rendered Markdown blocks; it is not a per-block toggle.
162
181
  - LaTeX rendering covers common symbols and expressions, not full TeX layout.
163
- - Source copy commands operate on the last AI response.
182
+ - Source copy commands target the last AI response by default, or the Nth-last
183
+ when invoked as `/copy N ...`.
@@ -7,33 +7,33 @@ import {
7
7
  hasRebuiltToolRegistry,
8
8
  rebuildToolRegistryOnOverride,
9
9
  resolveSubagentApprovalMode
10
- } from "./chunk-MUMLIB4J.js";
10
+ } from "./chunk-BUOJN3MM.js";
11
11
  import "./chunk-K5PGHDBN.js";
12
12
  import "./chunk-O4PICXES.js";
13
13
  import "./chunk-TW522KN6.js";
14
14
  import "./chunk-MLZQVCF3.js";
15
- import "./chunk-77UV3M62.js";
16
- import "./chunk-UEW42CYE.js";
17
- import "./chunk-OPFJCRUK.js";
15
+ import "./chunk-SCHRFI7O.js";
16
+ import "./chunk-PLYZAP4W.js";
17
+ import "./chunk-UABFCMPA.js";
18
18
  import "./chunk-77WXWU44.js";
19
- import "./chunk-LESSBSSE.js";
20
- import "./chunk-MW6Z7JDT.js";
19
+ import "./chunk-6VFG3EUJ.js";
20
+ import "./chunk-3H7ENG2Q.js";
21
21
  import "./chunk-3PJXIDKI.js";
22
22
  import "./chunk-UWCTAVOD.js";
23
23
  import "./chunk-OFEVLU4C.js";
24
- import "./chunk-2T34DNYQ.js";
25
- import "./chunk-KSX2FIAZ.js";
26
- import "./chunk-UKQJ7G3U.js";
27
- import "./chunk-UB3HGW3I.js";
28
- import "./chunk-JAF4PLE7.js";
29
- import "./chunk-7R5J5HSJ.js";
30
- import "./chunk-DU2ZAFA7.js";
31
- import "./chunk-R7WIF3BU.js";
32
- import "./chunk-OV5SE5JD.js";
24
+ import "./chunk-AVLOK27J.js";
25
+ import "./chunk-JSYEZAYV.js";
26
+ import "./chunk-5RNZ2QKF.js";
27
+ import "./chunk-G763GDO6.js";
28
+ import "./chunk-JMLIPZUU.js";
29
+ import "./chunk-GBEPNWYB.js";
30
+ import "./chunk-F5ORN4YO.js";
31
+ import "./chunk-MVX64PNU.js";
32
+ import "./chunk-D46KOV3C.js";
33
33
  import "./chunk-BNESGOSJ.js";
34
34
  import "./chunk-SZOEIL6S.js";
35
35
  import "./chunk-5IFG2VC4.js";
36
- import "./chunk-S2HZQ4RC.js";
36
+ import "./chunk-R5PDRHEF.js";
37
37
  import "./chunk-ZERZSAZL.js";
38
38
  import "./chunk-QN5NZ3UQ.js";
39
39
  import "./chunk-BR4QREVK.js";
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-KQIKOTQJ.js";
7
7
  import {
8
8
  RequestTokenizer
9
- } from "./chunk-ZAHZV7IR.js";
9
+ } from "./chunk-BBTV54KB.js";
10
10
  import {
11
11
  Blob,
12
12
  File,
@@ -16,7 +16,7 @@ import {
16
16
  import {
17
17
  buildRuntimeFetchOptions,
18
18
  redactProxyError
19
- } from "./chunk-R7WIF3BU.js";
19
+ } from "./chunk-MVX64PNU.js";
20
20
  import {
21
21
  CAPPED_DEFAULT_MAX_TOKENS,
22
22
  DEFAULT_TIMEOUT,
@@ -25,7 +25,7 @@ import {
25
25
  runtimeDiagnostics,
26
26
  safeJsonParse,
27
27
  tokenLimit
28
- } from "./chunk-OV5SE5JD.js";
28
+ } from "./chunk-D46KOV3C.js";
29
29
  import {
30
30
  FinishReason,
31
31
  GenerateContentResponse
@@ -34,7 +34,7 @@ import "./chunk-SZOEIL6S.js";
34
34
  import "./chunk-5IFG2VC4.js";
35
35
  import {
36
36
  createDebugLogger
37
- } from "./chunk-S2HZQ4RC.js";
37
+ } from "./chunk-R5PDRHEF.js";
38
38
  import {
39
39
  require_ms
40
40
  } from "./chunk-BR4QREVK.js";
@@ -6,10 +6,10 @@ import {
6
6
  BaseToolInvocation,
7
7
  ToolDisplayNames,
8
8
  ToolNames
9
- } from "./chunk-UB3HGW3I.js";
9
+ } from "./chunk-G763GDO6.js";
10
10
  import {
11
11
  createDebugLogger
12
- } from "./chunk-S2HZQ4RC.js";
12
+ } from "./chunk-R5PDRHEF.js";
13
13
  import "./chunk-WFVXF3OM.js";
14
14
  import {
15
15
  init_esbuild_shims
@@ -171,7 +171,7 @@ var ca_default = {
171
171
  "open full Qwen Code documentation in your browser": "obrir la documentaci\xF3 completa de Qwen Code al navegador",
172
172
  "Configuration not available.": "Configuraci\xF3 no disponible.",
173
173
  "Connect an LLM provider": "Connectar un prove\xEFdor LLM",
174
- "Copy the last result or code snippet to clipboard": "Copiar l'\xFAltim resultat o fragment de codi al porta-retalls",
174
+ "Copy the last AI response to clipboard (/copy N for Nth-latest)": "Copia l'\xFAltima resposta de la IA al porta-retalls (/copy N per a l'N-\xE8sima)",
175
175
  // ============================================================================
176
176
  // Ordres - Agents
177
177
  // ============================================================================
@@ -625,6 +625,15 @@ var ca_default = {
625
625
  // ============================================================================
626
626
  "Resume a previous session": "Reprendre una sessi\xF3 anterior",
627
627
  "Fork the current conversation into a new session": "Bifurca la conversa actual en una sessi\xF3 nova",
628
+ "Spawn a background agent that inherits the full conversation": "Inicia un agent en segon pla que hereta tota la conversa",
629
+ "Please provide a directive. Usage: /fork <directive>": "Proporcioneu una directiva. \xDAs: /fork <directiva>",
630
+ "Cannot fork while a response or tool call is in progress. Wait for it to finish or resolve the pending tool call.": "No es pot crear una bifurcaci\xF3 mentre hi ha una resposta o una crida a una eina en curs. Espereu que acabi o resolgueu la crida a l'eina pendent.",
631
+ "Cannot fork before the first conversation turn.": "No es pot crear una bifurcaci\xF3 abans del primer torn de conversa.",
632
+ "The /fork command requires the fork feature gate. Set QWEN_CODE_ENABLE_FORK_SUBAGENT=1 to enable it.": "L\u2019ordre /fork requereix el feature gate de fork. Definiu QWEN_CODE_ENABLE_FORK_SUBAGENT=1 per activar-lo.",
633
+ "The agent tool is unavailable; cannot fork.": "L'eina d'agent no est\xE0 disponible; no es pot crear una bifurcaci\xF3.",
634
+ "Failed to launch fork: {{error}}": "No s\u2019ha pogut iniciar la bifurcaci\xF3: {{error}}",
635
+ "User launched a background fork via /fork: {{directive}}": "L'usuari ha iniciat una bifurcaci\xF3 en segon pla amb /fork: {{directive}}",
636
+ "Forked into a background agent. It inherits this conversation and runs without blocking \u2014 track it in the background tasks panel; it reports back when done.": "S'ha bifurcat a un agent en segon pla. Hereta aquesta conversa i s'executa sense bloquejar \u2014 feu-ne el seguiment al tauler de tasques en segon pla; informar\xE0 quan acabi.",
628
637
  "Cannot branch while a response or tool call is in progress. Wait for it to finish or resolve the pending tool call.": "No es pot bifurcar mentre hi ha una resposta o una crida a una eina en curs. Espereu que acabi o resolgueu la crida a l'eina pendent.",
629
638
  "No conversation to branch.": "No hi ha cap conversa per bifurcar.",
630
639
  "Restore a tool call. This will reset the conversation and file history to the state it was in when the tool call was suggested": "Restaurar una crida a una eina. Aix\xF2 restablir\xE0 la conversa i l'historial de fitxers a l'estat en qu\xE8 es trobaven quan es va suggerir la crida a l'eina",
@@ -19,20 +19,20 @@ import {
19
19
  MAINLINE_CODER_MODEL
20
20
  } from "./chunk-OFEVLU4C.js";
21
21
  import {
22
- isAutoMemPath
23
- } from "./chunk-2T34DNYQ.js";
22
+ isAnyAutoMemPath
23
+ } from "./chunk-AVLOK27J.js";
24
24
  import {
25
25
  InstallationManager
26
- } from "./chunk-KSX2FIAZ.js";
26
+ } from "./chunk-JSYEZAYV.js";
27
27
  import {
28
28
  STRUCTURED_OUTPUT_REDACTED_ARGS
29
- } from "./chunk-UKQJ7G3U.js";
29
+ } from "./chunk-5RNZ2QKF.js";
30
30
  import {
31
31
  BaseDeclarativeTool,
32
32
  BaseToolInvocation,
33
33
  ToolDisplayNames,
34
34
  ToolNames
35
- } from "./chunk-UB3HGW3I.js";
35
+ } from "./chunk-G763GDO6.js";
36
36
  import {
37
37
  DEFAULT_OPENAI_BASE_URL,
38
38
  convertSchema,
@@ -40,7 +40,7 @@ import {
40
40
  runtimeDiagnostics,
41
41
  safeJsonParse,
42
42
  tokenLimit
43
- } from "./chunk-OV5SE5JD.js";
43
+ } from "./chunk-D46KOV3C.js";
44
44
  import {
45
45
  FinishReason,
46
46
  GenerateContentResponse
@@ -60,7 +60,7 @@ import {
60
60
  setSessionContext,
61
61
  shortenPath,
62
62
  unescapePath
63
- } from "./chunk-S2HZQ4RC.js";
63
+ } from "./chunk-R5PDRHEF.js";
64
64
  import {
65
65
  require_dist
66
66
  } from "./chunk-ZERZSAZL.js";
@@ -69640,9 +69640,10 @@ var MODALITY_PATTERNS = [
69640
69640
  // -------------------
69641
69641
  // Alibaba / Qwen
69642
69642
  // -------------------
69643
- // Qwen3.5-Plus, Qwen3.6-Plus: image + video support
69643
+ // Qwen Plus models: image + video support (Max models are text-only)
69644
69644
  [/^qwen3\.5-plus/, { image: true, video: true }],
69645
69645
  [/^qwen3\.6-plus/, { image: true, video: true }],
69646
+ [/^qwen3\.7-plus/, { image: true, video: true }],
69646
69647
  [/^coder-model$/, { image: true, video: true }],
69647
69648
  // Qwen VL (vision-language) models: image + video
69648
69649
  [/^qwen-vl-/, { image: true, video: true }],
@@ -71002,11 +71003,11 @@ async function createContentGenerator(generatorConfig, config, isInitialAuth) {
71002
71003
  }
71003
71004
  let baseGenerator;
71004
71005
  if (authType === "openai" /* USE_OPENAI */) {
71005
- const { createOpenAIContentGenerator } = await import("./openaiContentGenerator-557UCKMQ.js");
71006
+ const { createOpenAIContentGenerator } = await import("./openaiContentGenerator-3U6UARHS.js");
71006
71007
  baseGenerator = createOpenAIContentGenerator(generatorConfig, config);
71007
71008
  } else if (authType === "qwen-oauth" /* QWEN_OAUTH */) {
71008
- const { getQwenOAuthClient: getQwenOauthClient } = await import("./qwenOAuth2-FUBP4U5T.js");
71009
- const { QwenContentGenerator } = await import("./qwenContentGenerator-QG4JMJH5.js");
71009
+ const { getQwenOAuthClient: getQwenOauthClient } = await import("./qwenOAuth2-KRJT35QH.js");
71010
+ const { QwenContentGenerator } = await import("./qwenContentGenerator-JRFHJRH6.js");
71010
71011
  try {
71011
71012
  const qwenClient = await getQwenOauthClient(
71012
71013
  config,
@@ -71023,10 +71024,10 @@ async function createContentGenerator(generatorConfig, config, isInitialAuth) {
71023
71024
  );
71024
71025
  }
71025
71026
  } else if (authType === "anthropic" /* USE_ANTHROPIC */) {
71026
- const { createAnthropicContentGenerator } = await import("./anthropicContentGenerator-CORCIHMT.js");
71027
+ const { createAnthropicContentGenerator } = await import("./anthropicContentGenerator-4QBVSFSJ.js");
71027
71028
  baseGenerator = createAnthropicContentGenerator(generatorConfig, config);
71028
71029
  } else if (authType === "gemini" /* USE_GEMINI */ || authType === "vertex-ai" /* USE_VERTEX_AI */) {
71029
- const { createGeminiContentGenerator } = await import("./geminiContentGenerator-BB4RL4HR.js");
71030
+ const { createGeminiContentGenerator } = await import("./geminiContentGenerator-3AKHMB3P.js");
71030
71031
  baseGenerator = createGeminiContentGenerator(generatorConfig, config);
71031
71032
  } else {
71032
71033
  throw new Error(
@@ -72856,10 +72857,11 @@ var ReadFileToolInvocation = class extends BaseToolInvocation {
72856
72857
  ...this.config.storage.getUserSkillsDirs(),
72857
72858
  Storage.getUserExtensionsDir()
72858
72859
  ];
72859
- if (workspaceContext.isPathWithinWorkspace(filePath) || isSubpaths(allowedRoots, filePath) || // isAutoMemPath uses the narrower managed auto-memory root for this
72860
- // project not the broad getMemoryBaseDir() — to avoid exposing
72861
- // sensitive ~/.qwen files such as settings.json or OAuth credentials.
72862
- isAutoMemPath(filePath, this.config.getTargetDir())) {
72860
+ if (workspaceContext.isPathWithinWorkspace(filePath) || isSubpaths(allowedRoots, filePath) || // isAnyAutoMemPath narrows to the managed auto-memory roots
72861
+ // (per-project + user-level under ~/.qwen/memories/) — never the
72862
+ // broad getMemoryBaseDir() to avoid exposing sensitive ~/.qwen
72863
+ // files such as settings.json or OAuth credentials.
72864
+ isAnyAutoMemPath(filePath, this.config.getTargetDir())) {
72863
72865
  return "allow";
72864
72866
  }
72865
72867
  return "ask";
@@ -72867,7 +72869,7 @@ var ReadFileToolInvocation = class extends BaseToolInvocation {
72867
72869
  async execute() {
72868
72870
  const absPath = path7.resolve(this.params.file_path);
72869
72871
  const projectRoot = this.config.getTargetDir();
72870
- const isAutoMem = isAutoMemPath(absPath, projectRoot);
72872
+ const isAutoMem = isAnyAutoMemPath(absPath, projectRoot);
72871
72873
  const cacheEnabled = !this.config.getFileReadCacheDisabled();
72872
72874
  const useFastPath = cacheEnabled && !isAutoMem;
72873
72875
  const cache = this.config.getFileReadCache();
@@ -5,7 +5,7 @@ import {
5
5
  BaseToolInvocation,
6
6
  ToolDisplayNames,
7
7
  ToolNames
8
- } from "./chunk-UB3HGW3I.js";
8
+ } from "./chunk-G763GDO6.js";
9
9
  import {
10
10
  init_esbuild_shims
11
11
  } from "./chunk-A4BMJM77.js";
@@ -2,7 +2,7 @@
2
2
  "use strict";
3
3
  import {
4
4
  createDebugLogger
5
- } from "./chunk-S2HZQ4RC.js";
5
+ } from "./chunk-R5PDRHEF.js";
6
6
  import {
7
7
  init_esbuild_shims
8
8
  } from "./chunk-A4BMJM77.js";
@@ -3,8 +3,9 @@
3
3
  import {
4
4
  QWEN_DIR,
5
5
  Storage,
6
+ resolvePath,
6
7
  sanitizeCwd
7
- } from "./chunk-S2HZQ4RC.js";
8
+ } from "./chunk-R5PDRHEF.js";
8
9
  import {
9
10
  init_esbuild_shims
10
11
  } from "./chunk-A4BMJM77.js";
@@ -21,6 +22,7 @@ var AUTO_MEMORY_INDEX_FILENAME = "MEMORY.md";
21
22
  var AUTO_MEMORY_METADATA_FILENAME = "meta.json";
22
23
  var AUTO_MEMORY_EXTRACT_CURSOR_FILENAME = "extract-cursor.json";
23
24
  var AUTO_MEMORY_CONSOLIDATION_LOCK_FILENAME = "consolidation.lock";
25
+ var USER_AUTO_MEMORY_DIRNAME = "memories";
24
26
  function findGitRoot(startPath) {
25
27
  let current = path.resolve(startPath);
26
28
  while (true) {
@@ -74,28 +76,31 @@ function findCanonicalGitRoot(startPath) {
74
76
  __name(findCanonicalGitRoot, "findCanonicalGitRoot");
75
77
  function getMemoryBaseDir() {
76
78
  if (process.env["QWEN_CODE_MEMORY_BASE_DIR"]) {
77
- return process.env["QWEN_CODE_MEMORY_BASE_DIR"];
79
+ return resolvePath(void 0, process.env["QWEN_CODE_MEMORY_BASE_DIR"]);
78
80
  }
79
- return Storage.getGlobalQwenDir();
81
+ return Storage.getRuntimeBaseDir();
80
82
  }
81
83
  __name(getMemoryBaseDir, "getMemoryBaseDir");
82
84
  var _autoMemoryRootCache = /* @__PURE__ */ new Map();
83
85
  function getAutoMemoryRoot(projectRoot) {
84
- const cached = _autoMemoryRootCache.get(projectRoot);
86
+ const useLocalMemory = process.env["QWEN_CODE_MEMORY_LOCAL"] === "1";
87
+ const memoryBaseDir = useLocalMemory ? "" : getMemoryBaseDir();
88
+ const cacheKey = `${useLocalMemory ? "local" : memoryBaseDir}\0${projectRoot}`;
89
+ const cached = _autoMemoryRootCache.get(cacheKey);
85
90
  if (cached !== void 0) return cached;
86
91
  let result;
87
- if (process.env["QWEN_CODE_MEMORY_LOCAL"] === "1") {
92
+ if (useLocalMemory) {
88
93
  result = path.join(projectRoot, QWEN_DIR, AUTO_MEMORY_DIRNAME);
89
94
  } else {
90
95
  const canonicalRoot = findCanonicalGitRoot(projectRoot) ?? path.resolve(projectRoot);
91
96
  result = path.join(
92
- getMemoryBaseDir(),
97
+ memoryBaseDir,
93
98
  "projects",
94
99
  sanitizeCwd(canonicalRoot),
95
100
  AUTO_MEMORY_DIRNAME
96
101
  );
97
102
  }
98
- _autoMemoryRootCache.set(projectRoot, result);
103
+ _autoMemoryRootCache.set(cacheKey, result);
99
104
  return result;
100
105
  }
101
106
  __name(getAutoMemoryRoot, "getAutoMemoryRoot");
@@ -154,6 +159,29 @@ function getAutoMemoryFilePath(projectRoot, relativePath) {
154
159
  return path.join(getAutoMemoryRoot(projectRoot), relativePath);
155
160
  }
156
161
  __name(getAutoMemoryFilePath, "getAutoMemoryFilePath");
162
+ function getUserAutoMemoryRoot() {
163
+ return path.join(getMemoryBaseDir(), USER_AUTO_MEMORY_DIRNAME);
164
+ }
165
+ __name(getUserAutoMemoryRoot, "getUserAutoMemoryRoot");
166
+ function getUserAutoMemoryIndexPath() {
167
+ return path.join(getUserAutoMemoryRoot(), AUTO_MEMORY_INDEX_FILENAME);
168
+ }
169
+ __name(getUserAutoMemoryIndexPath, "getUserAutoMemoryIndexPath");
170
+ function getUserAutoMemoryTopicPath(type) {
171
+ return path.join(getUserAutoMemoryRoot(), getAutoMemoryTopicFilename(type));
172
+ }
173
+ __name(getUserAutoMemoryTopicPath, "getUserAutoMemoryTopicPath");
174
+ function isUserAutoMemPath(absolutePath) {
175
+ const normalizedPath = path.normalize(absolutePath);
176
+ const memRoot = path.normalize(getUserAutoMemoryRoot());
177
+ const rel = path.relative(memRoot, normalizedPath);
178
+ return rel === "" || !rel.startsWith("..") && !path.isAbsolute(rel);
179
+ }
180
+ __name(isUserAutoMemPath, "isUserAutoMemPath");
181
+ function isAnyAutoMemPath(absolutePath, projectRoot) {
182
+ return isAutoMemPath(absolutePath, projectRoot) || isUserAutoMemPath(absolutePath);
183
+ }
184
+ __name(isAnyAutoMemPath, "isAnyAutoMemPath");
157
185
 
158
186
  export {
159
187
  AUTO_MEMORY_DIRNAME,
@@ -161,6 +189,7 @@ export {
161
189
  AUTO_MEMORY_METADATA_FILENAME,
162
190
  AUTO_MEMORY_EXTRACT_CURSOR_FILENAME,
163
191
  AUTO_MEMORY_CONSOLIDATION_LOCK_FILENAME,
192
+ USER_AUTO_MEMORY_DIRNAME,
164
193
  getMemoryBaseDir,
165
194
  getAutoMemoryRoot,
166
195
  clearAutoMemoryRootCache,
@@ -172,7 +201,12 @@ export {
172
201
  getAutoMemoryConsolidationLockPath,
173
202
  getAutoMemoryTopicFilename,
174
203
  getAutoMemoryTopicPath,
175
- getAutoMemoryFilePath
204
+ getAutoMemoryFilePath,
205
+ getUserAutoMemoryRoot,
206
+ getUserAutoMemoryIndexPath,
207
+ getUserAutoMemoryTopicPath,
208
+ isUserAutoMemPath,
209
+ isAnyAutoMemPath
176
210
  };
177
211
  /**
178
212
  * @license
@@ -3,10 +3,10 @@
3
3
  import {
4
4
  TextTokenizer,
5
5
  isSupportedImageMimeType
6
- } from "./chunk-R7WIF3BU.js";
6
+ } from "./chunk-MVX64PNU.js";
7
7
  import {
8
8
  createDebugLogger
9
- } from "./chunk-S2HZQ4RC.js";
9
+ } from "./chunk-R5PDRHEF.js";
10
10
  import {
11
11
  init_esbuild_shims
12
12
  } from "./chunk-A4BMJM77.js";