@qwen-code/qwen-code 0.17.1 → 0.18.0-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 (120) hide show
  1. package/README.md +4 -6
  2. package/bundled/qc-helper/SKILL.md +30 -24
  3. package/bundled/qc-helper/docs/features/auto-mode.md +54 -9
  4. package/bundled/qc-helper/docs/features/commands.md +11 -11
  5. package/bundled/qc-helper/docs/features/markdown-rendering.md +21 -1
  6. package/bundled/qc-helper/docs/overview.md +4 -4
  7. package/bundled/qc-helper/docs/quickstart.md +4 -4
  8. package/bundled/qc-helper/docs/support/Uninstall.md +19 -1
  9. package/bundled/qc-helper/docs/support/troubleshooting.md +2 -1
  10. package/chunks/{agent-ZJHHICAC.js → agent-SXS4NQWS.js} +18 -22
  11. package/chunks/{anthropicContentGenerator-M45RXZVS.js → anthropicContentGenerator-4QBVSFSJ.js} +5 -5
  12. package/chunks/{askUserQuestion-TGRD7FNQ.js → askUserQuestion-NOOLRWCJ.js} +5 -7
  13. package/chunks/{ca-6RSCDYUS.js → ca-WRHFBIDH.js} +38 -3
  14. package/chunks/{chunk-SOGUPKP6.js → chunk-5RNZ2QKF.js} +3 -5
  15. package/chunks/{chunk-2KEXT6RB.js → chunk-6KH2Q7XN.js} +91245 -78527
  16. package/chunks/{chunk-GVWPJCXU.js → chunk-6VFG3EUJ.js} +1 -1
  17. package/chunks/{chunk-NQ3E7YLD.js → chunk-AVLOK27J.js} +42 -8
  18. package/chunks/{chunk-JBSYXHJF.js → chunk-BBTV54KB.js} +2 -2
  19. package/chunks/{chunk-3BJBCG2K.js → chunk-C6WMLUNB.js} +1 -1
  20. package/chunks/{chunk-TDZCEIK6.js → chunk-D46KOV3C.js} +1 -1
  21. package/chunks/{chunk-NJJER6E2.js → chunk-ERREX2ES.js} +10 -6
  22. package/chunks/{chunk-HX3JRTWL.js → chunk-F5ORN4YO.js} +1 -1
  23. package/chunks/{chunk-C5CUHYSM.js → chunk-F6FLCHCS.js} +895 -490
  24. package/chunks/{chunk-JKUAX6UT.js → chunk-G763GDO6.js} +125 -12
  25. package/chunks/{chunk-OIL7KDWV.js → chunk-GBEPNWYB.js} +1 -1
  26. package/chunks/{chunk-G4K6P5KN.js → chunk-JMLIPZUU.js} +3 -3
  27. package/chunks/{chunk-OJFMTECH.js → chunk-JSYEZAYV.js} +2 -2
  28. package/chunks/{chunk-AKBFRR6J.js → chunk-K5PGHDBN.js} +132 -112
  29. package/chunks/{chunk-5JBZM7FZ.js → chunk-KOA52UTF.js} +6 -6
  30. package/chunks/{chunk-QVJ33ZBG.js → chunk-MVX64PNU.js} +1 -1
  31. package/chunks/{chunk-PLYRQYKC.js → chunk-NQZ33PWX.js} +11 -11
  32. package/chunks/{chunk-EY6BDW7Y.js → chunk-PLYZAP4W.js} +45 -9
  33. package/chunks/{chunk-ACBGEKB7.js → chunk-R5PDRHEF.js} +2 -1
  34. package/chunks/{chunk-6O244QKR.js → chunk-SCHRFI7O.js} +1 -1
  35. package/chunks/{chunk-GJHMAWS7.js → chunk-SHUT5MQY.js} +1 -1
  36. package/chunks/{chunk-RQW7WUJR.js → chunk-UABFCMPA.js} +34 -6
  37. package/chunks/{chunk-33RDTIU6.js → chunk-UFC57OYT.js} +3 -5
  38. package/chunks/{chunk-NP3ICQCN.js → chunk-USE2VQ5P.js} +1 -1
  39. package/chunks/{chunk-QWSRH265.js → chunk-WFVXF3OM.js} +776 -776
  40. package/chunks/{chunk-X2474BTT.js → chunk-ZW7GBCRE.js} +147 -10
  41. package/chunks/{computer-use-NAHQPV2L.js → computer-use-CT6MU6P3.js} +51 -18
  42. package/chunks/contextCommand-YODJQYIV.js +46 -0
  43. package/chunks/{cron-create-V3UK2SJN.js → cron-create-PIPMXQN4.js} +5 -7
  44. package/chunks/{cron-delete-MANALPCP.js → cron-delete-6Y5XIDMS.js} +5 -7
  45. package/chunks/{cron-list-UDIYK3B3.js → cron-list-A4WNRUWZ.js} +5 -7
  46. package/chunks/{de-APURNJ3I.js → de-M5RPB2NB.js} +38 -3
  47. package/chunks/{dist-XTTPOFAH.js → dist-BXDUQ2QY.js} +3 -4
  48. package/chunks/{dist-AHZNZWRI.js → dist-R2SXPG74.js} +4 -5
  49. package/chunks/{dist-ATAKC63R.js → dist-TE5QKMGR.js} +3 -4
  50. package/chunks/{dist-6RUZ2JD6.js → dist-ZMQ4TXD5.js} +3 -4
  51. package/chunks/{edit-JWXCQ4KK.js → edit-A4YK7AIB.js} +22 -27
  52. package/chunks/{en-FYO57HJW.js → en-UMYKQAZE.js} +46 -3
  53. package/chunks/{enter-worktree-G4CJXPT4.js → enter-worktree-VNEQINLC.js} +20 -25
  54. package/chunks/{exit-worktree-MYZ2FGU2.js → exit-worktree-AVSMXC33.js} +20 -25
  55. package/chunks/{exitPlanMode-ELJ6FSMU.js → exitPlanMode-5SQYVROD.js} +20 -25
  56. package/chunks/{fr-32YHQZIS.js → fr-MPYXXXPW.js} +38 -3
  57. package/chunks/{geminiContentGenerator-3LR7MKCQ.js → geminiContentGenerator-CR2WGARL.js} +5 -5
  58. package/chunks/{getMachineId-bsd-GS3V2GK7.js → getMachineId-bsd-F7GNPTER.js} +1 -1
  59. package/chunks/{getMachineId-darwin-ZQB4Q7EW.js → getMachineId-darwin-T73DJL27.js} +1 -1
  60. package/chunks/{getMachineId-linux-JQ4NN4DN.js → getMachineId-linux-MKQTFPQM.js} +1 -1
  61. package/chunks/{getMachineId-unsupported-U7H4V4HJ.js → getMachineId-unsupported-MUR5KOQE.js} +1 -1
  62. package/chunks/{getMachineId-win-VHUZGBQ3.js → getMachineId-win-CDYFC6ZM.js} +1 -1
  63. package/chunks/{glob-CANUAUTC.js → glob-5V32KOG5.js} +20 -25
  64. package/chunks/{grep-WZWNJRDX.js → grep-PUTEPBR4.js} +20 -25
  65. package/chunks/{ja-PEUXN4XT.js → ja-NFZ32AB3.js} +38 -3
  66. package/chunks/{keychain-token-storage-3552ENXE.js → keychain-token-storage-UHGOCDD6.js} +3 -3
  67. package/chunks/{ls-T4SVZWR6.js → ls-34DLNYCD.js} +6 -8
  68. package/chunks/{lsp-U4ZQLNIS.js → lsp-NCDEHH3V.js} +5 -7
  69. package/chunks/{monitor-CCKNOUFG.js → monitor-EJBR5VCR.js} +20 -25
  70. package/chunks/{notebook-edit-XDUY5Q4I.js → notebook-edit-DZHGPP2L.js} +21 -26
  71. package/chunks/{openaiContentGenerator-N3O3MYIT.js → openaiContentGenerator-4QNV3CHM.js} +12 -14
  72. package/chunks/{pt-2INS7YVC.js → pt-BR43FRBA.js} +38 -3
  73. package/chunks/{qwenContentGenerator-DEOIWKVH.js → qwenContentGenerator-3XOCEMQO.js} +20 -24
  74. package/chunks/{qwenOAuth2-LKXG7XVO.js → qwenOAuth2-KRJT35QH.js} +5 -5
  75. package/chunks/{read-file-BRNXGILN.js → read-file-VZ2SQQIX.js} +9 -11
  76. package/chunks/ripGrep-SBIZCPOL.js +42 -0
  77. package/chunks/{ru-6CQ5HNHB.js → ru-DQCW2KHD.js} +38 -3
  78. package/chunks/{scheduler-SSFABMN5.js → scheduler-H32DZVDV.js} +18 -22
  79. package/chunks/{send-message-GFYV7WLL.js → send-message-YYF56TS7.js} +5 -7
  80. package/chunks/{serve-B5O72CRN.js → serve-56G4B5W6.js} +21 -25
  81. package/chunks/{shell-SGYNBVMK.js → shell-Q77KNP4N.js} +18 -22
  82. package/chunks/{skill-V7Y6DOFB.js → skill-CLWFJYBG.js} +88 -25
  83. package/chunks/{src-OKFFQGXB.js → src-47L2LUOU.js} +90 -33
  84. package/chunks/{syntheticOutput-DM43O6TY.js → syntheticOutput-T5SWX3YF.js} +4 -5
  85. package/chunks/{task-stop-WKP5OB3V.js → task-stop-3VHAQMYM.js} +5 -7
  86. package/chunks/{todoWrite-GHL6DCLP.js → todoWrite-EAGJGKO5.js} +7 -9
  87. package/chunks/{tool-search-7MHT3HGM.js → tool-search-Q75AYDTP.js} +27 -15
  88. package/chunks/{web-fetch-SZIV74ZX.js → web-fetch-SS6IKK6N.js} +7 -9
  89. package/chunks/{write-file-ARS2Z6BJ.js → write-file-RENGC25N.js} +23 -28
  90. package/chunks/{zh-ZHZCMIRG.js → zh-6VFXOAR5.js} +49 -3
  91. package/chunks/{zh-TW-SSL3ATVZ.js → zh-TW-IQZ4AD5M.js} +45 -3
  92. package/cli.js +8153 -4156
  93. package/examples/agent/agents/diary.md +86 -0
  94. package/examples/agent/qwen-extension.json +4 -0
  95. package/examples/commands/commands/fs/grep-code.md +3 -0
  96. package/examples/commands/qwen-extension.json +4 -0
  97. package/examples/context/QWEN.md +8 -0
  98. package/examples/context/qwen-extension.json +4 -0
  99. package/examples/mcp-server/example.ts +60 -0
  100. package/examples/mcp-server/package.json +18 -0
  101. package/examples/mcp-server/qwen-extension.json +11 -0
  102. package/examples/mcp-server/tsconfig.json +13 -0
  103. package/examples/skills/qwen-extension.json +4 -0
  104. package/examples/skills/skills/synonyms/SKILL.md +48 -0
  105. package/locales/ca.js +64 -4
  106. package/locales/de.js +63 -4
  107. package/locales/en.js +75 -4
  108. package/locales/fr.js +65 -4
  109. package/locales/ja.js +61 -4
  110. package/locales/pt.js +64 -4
  111. package/locales/ru.js +62 -4
  112. package/locales/zh-TW.js +70 -4
  113. package/locales/zh.js +74 -4
  114. package/package.json +3 -2
  115. package/chunks/chunk-24YKA2DA.js +0 -233
  116. package/chunks/chunk-6RQTH7UQ.js +0 -115
  117. package/chunks/chunk-7TQVELRB.js +0 -10412
  118. package/chunks/chunk-W57YDFU5.js +0 -41
  119. package/chunks/contextCommand-7KJT3UJS.js +0 -50
  120. package/chunks/ripGrep-ZRY5PKUZ.js +0 -46
@@ -1,42 +1,40 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
3
  import {
4
+ applySkillAllowedTools,
4
5
  buildSkillLlmContent,
5
6
  escapeXml,
6
7
  registerSkillHooks
7
- } from "./chunk-EY6BDW7Y.js";
8
- import "./chunk-RQW7WUJR.js";
8
+ } from "./chunk-PLYZAP4W.js";
9
+ import "./chunk-UABFCMPA.js";
9
10
  import {
10
11
  SkillLaunchEvent,
11
12
  logSkillLaunch
12
- } from "./chunk-C5CUHYSM.js";
13
+ } from "./chunk-F6FLCHCS.js";
13
14
  import "./chunk-3PJXIDKI.js";
14
15
  import "./chunk-UWCTAVOD.js";
15
- import "./chunk-W57YDFU5.js";
16
16
  import "./chunk-OFEVLU4C.js";
17
- import "./chunk-NQ3E7YLD.js";
18
- import "./chunk-OJFMTECH.js";
19
- import "./chunk-SOGUPKP6.js";
17
+ import "./chunk-AVLOK27J.js";
18
+ import "./chunk-JSYEZAYV.js";
19
+ import "./chunk-5RNZ2QKF.js";
20
20
  import {
21
+ BaseDeclarativeTool,
22
+ BaseToolInvocation,
21
23
  ToolDisplayNames,
22
24
  ToolNames
23
- } from "./chunk-6RQTH7UQ.js";
24
- import {
25
- BaseDeclarativeTool,
26
- BaseToolInvocation
27
- } from "./chunk-JKUAX6UT.js";
28
- import "./chunk-HX3JRTWL.js";
29
- import "./chunk-TDZCEIK6.js";
25
+ } from "./chunk-G763GDO6.js";
26
+ import "./chunk-F5ORN4YO.js";
27
+ import "./chunk-D46KOV3C.js";
30
28
  import "./chunk-BNESGOSJ.js";
31
29
  import "./chunk-SZOEIL6S.js";
32
30
  import "./chunk-5IFG2VC4.js";
33
31
  import {
34
32
  createDebugLogger
35
- } from "./chunk-ACBGEKB7.js";
33
+ } from "./chunk-R5PDRHEF.js";
36
34
  import "./chunk-ZERZSAZL.js";
37
35
  import "./chunk-QN5NZ3UQ.js";
38
36
  import "./chunk-BR4QREVK.js";
39
- import "./chunk-QWSRH265.js";
37
+ import "./chunk-WFVXF3OM.js";
40
38
  import {
41
39
  init_esbuild_shims
42
40
  } from "./chunk-A4BMJM77.js";
@@ -55,7 +53,11 @@ var SkillTool = class _SkillTool extends BaseDeclarativeTool {
55
53
  properties: {
56
54
  skill: {
57
55
  type: "string",
58
- description: 'The skill name (no arguments). E.g., "pdf" or "xlsx"'
56
+ description: 'The skill or command name. E.g., "pdf" or "xlsx"'
57
+ },
58
+ args: {
59
+ type: "string",
60
+ description: "Optional arguments for model-invocable slash commands."
59
61
  }
60
62
  },
61
63
  required: ["skill"],
@@ -113,18 +115,20 @@ var SkillTool = class _SkillTool extends BaseDeclarativeTool {
113
115
  async refreshSkills() {
114
116
  try {
115
117
  const allSkills = await this.skillManager.listSkills();
118
+ const disabledNames = this.config.getDisabledSkillNames();
119
+ const isDisabled = /* @__PURE__ */ __name((name) => disabledNames.has(name.toLowerCase()), "isDisabled");
116
120
  this.availableSkills = allSkills.filter(
117
- (s) => !s.disableModelInvocation && this.skillManager.isSkillActive(s)
121
+ (s) => !s.disableModelInvocation && this.skillManager.isSkillActive(s) && !isDisabled(s.name)
118
122
  );
119
123
  this.pendingConditionalSkillNames = new Set(
120
124
  allSkills.filter(
121
- (s) => !s.disableModelInvocation && s.paths && s.paths.length > 0 && !this.skillManager.isSkillActive(s)
125
+ (s) => !s.disableModelInvocation && s.paths && s.paths.length > 0 && !this.skillManager.isSkillActive(s) && !isDisabled(s.name)
122
126
  ).map((s) => s.name)
123
127
  );
124
128
  const provider = this.config.getModelInvocableCommandsProvider();
125
129
  const allCommands = provider ? provider() : [];
126
130
  const fileBasedSkillNames = new Set(
127
- allSkills.filter((s) => !s.disableModelInvocation).map((s) => s.name)
131
+ allSkills.filter((s) => !s.disableModelInvocation && !isDisabled(s.name)).map((s) => s.name)
128
132
  );
129
133
  this.modelInvocableCommands = allCommands.filter(
130
134
  (cmd) => !fileBasedSkillNames.has(cmd.name)
@@ -190,6 +194,7 @@ How to invoke:
190
194
  - \`skill: "pdf"\` - invoke the pdf skill
191
195
  - \`skill: "xlsx"\` - invoke the xlsx skill
192
196
  - \`skill: "ms-office-suite:pdf"\` - invoke using fully qualified name
197
+ - \`skill: "mcp-prompt", args: "topic"\` - invoke a model-invocable command with arguments
193
198
 
194
199
  Important:
195
200
  - When a skill is relevant, you must invoke this tool IMMEDIATELY as your first action
@@ -213,6 +218,9 @@ ${skillDescriptions}
213
218
  if (!params.skill || typeof params.skill !== "string" || params.skill.trim() === "") {
214
219
  return 'Parameter "skill" must be a non-empty string.';
215
220
  }
221
+ if (params.args !== void 0 && typeof params.args !== "string") {
222
+ return 'Parameter "args" must be a string when provided.';
223
+ }
216
224
  const skillExists = this.availableSkills.some(
217
225
  (skill) => skill.name === params.skill
218
226
  );
@@ -221,6 +229,9 @@ ${skillDescriptions}
221
229
  (cmd) => cmd.name === params.skill
222
230
  );
223
231
  if (commandExists) return null;
232
+ if (this.config.getDisabledSkillNames().has(params.skill.toLowerCase())) {
233
+ return `Skill "${params.skill}" is disabled. Re-enable it via /skills or remove it from skills.disabled.`;
234
+ }
224
235
  if (this.pendingConditionalSkillNames.has(params.skill)) {
225
236
  return `Skill "${params.skill}" is gated by path-based activation (paths: frontmatter) and is not yet available. Access a file matching its paths patterns first to activate it.`;
226
237
  }
@@ -243,7 +254,7 @@ ${skillDescriptions}
243
254
  );
244
255
  }
245
256
  toAutoClassifierInput(params) {
246
- return { skill: params.skill };
257
+ return params.args === void 0 ? { skill: params.skill } : { skill: params.skill, args: params.args };
247
258
  }
248
259
  getAvailableSkillNames() {
249
260
  return this.availableSkills.map((skill) => skill.name);
@@ -295,7 +306,7 @@ var SkillToolInvocation = class extends BaseToolInvocation {
295
306
  this.promptId = promptId;
296
307
  }
297
308
  getDescription() {
298
- return `Use skill: "${this.params.skill}"`;
309
+ return this.params.args === void 0 ? `Use skill: "${this.params.skill}"` : `Use skill: "${this.params.skill}" with args: "${formatArgsForDescription(this.params.args)}"`;
299
310
  }
300
311
  /**
301
312
  * Skills load user-defined code that runs with the agent's tool
@@ -309,21 +320,64 @@ var SkillToolInvocation = class extends BaseToolInvocation {
309
320
  return "ask";
310
321
  }
311
322
  async execute(_signal, _updateOutput) {
323
+ const disabled = this.config.getDisabledSkillNames().has(this.params.skill.toLowerCase());
324
+ if (disabled) {
325
+ if (this.commandExecutor) {
326
+ try {
327
+ const content = await this.commandExecutor(
328
+ this.params.skill,
329
+ this.params.args ?? ""
330
+ );
331
+ if (content && typeof content === "object" && "error" in content) {
332
+ return {
333
+ llmContent: content.error,
334
+ returnDisplay: content.error
335
+ };
336
+ }
337
+ if (typeof content === "string") {
338
+ return {
339
+ llmContent: [{ text: content }],
340
+ returnDisplay: `Delegated to command: ${this.params.skill}`
341
+ };
342
+ }
343
+ } catch {
344
+ }
345
+ }
346
+ logSkillLaunch(
347
+ this.config,
348
+ new SkillLaunchEvent(this.params.skill, false, this.promptId)
349
+ );
350
+ const msg = `Skill "${this.params.skill}" is disabled. Re-enable it via /skills or remove it from skills.disabled.`;
351
+ return { llmContent: msg, returnDisplay: msg };
352
+ }
312
353
  try {
313
354
  const skill = await this.skillManager.loadSkillForRuntime(
314
355
  this.params.skill
315
356
  );
316
357
  if (!skill) {
317
358
  if (this.commandExecutor) {
318
- const content = await this.commandExecutor(this.params.skill);
319
- if (content !== null) {
359
+ const commandResult = await this.commandExecutor(
360
+ this.params.skill,
361
+ this.params.args ?? ""
362
+ );
363
+ if (commandResult && typeof commandResult === "object" && "error" in commandResult) {
364
+ logSkillLaunch(
365
+ this.config,
366
+ new SkillLaunchEvent(this.params.skill, false, this.promptId)
367
+ );
368
+ return {
369
+ llmContent: commandResult.error,
370
+ returnDisplay: commandResult.error
371
+ };
372
+ }
373
+ if (typeof commandResult === "string") {
320
374
  logSkillLaunch(
321
375
  this.config,
322
376
  new SkillLaunchEvent(this.params.skill, true, this.promptId)
323
377
  );
324
378
  this.onSkillLoaded(this.params.skill);
325
379
  return {
326
- llmContent: [{ text: content }],
380
+ llmContent: [{ text: commandResult }],
327
381
  returnDisplay: `Executed command: ${this.params.skill}`
328
382
  };
329
383
  }
@@ -352,6 +406,10 @@ ${errorMessages.join("\n")}` : "";
352
406
  new SkillLaunchEvent(this.params.skill, true, this.promptId)
353
407
  );
354
408
  this.onSkillLoaded(this.params.skill);
409
+ applySkillAllowedTools(
410
+ this.config.getPermissionManager(),
411
+ skill.allowedTools
412
+ );
355
413
  debugLogger.debug("Skill hooks check:", {
356
414
  hasHooks: !!skill.hooks,
357
415
  hooksKeys: skill.hooks ? Object.keys(skill.hooks) : [],
@@ -407,6 +465,11 @@ ${errorMessages.join("\n")}` : "";
407
465
  }
408
466
  }
409
467
  };
468
+ function formatArgsForDescription(args) {
469
+ const escapeMarkdown = /* @__PURE__ */ __name((value) => value.replace(/([\\`*_{}[\]()#+\-.!|>])/g, "\\$1"), "escapeMarkdown");
470
+ return args.length > 120 ? `${escapeMarkdown(args.slice(0, 117))}...` : escapeMarkdown(args);
471
+ }
472
+ __name(formatArgsForDescription, "formatArgsForDescription");
410
473
  export {
411
474
  SkillTool,
412
475
  buildSkillLlmContent