@qwen-code/qwen-code 0.18.0-preview.2 → 0.18.1-nightly.20260616.a68b2e1e7

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 (145) hide show
  1. package/bundled/loop/SKILL.md +2 -1
  2. package/bundled/qc-helper/docs/_meta.ts +1 -0
  3. package/bundled/qc-helper/docs/common-workflow.md +4 -4
  4. package/bundled/qc-helper/docs/configuration/auth.md +1 -1
  5. package/bundled/qc-helper/docs/configuration/model-providers.md +13 -6
  6. package/bundled/qc-helper/docs/configuration/settings.md +90 -89
  7. package/bundled/qc-helper/docs/features/approval-mode.md +10 -14
  8. package/bundled/qc-helper/docs/features/commands.md +33 -11
  9. package/bundled/qc-helper/docs/features/dual-output.md +37 -3
  10. package/bundled/qc-helper/docs/features/followup-suggestions.md +2 -2
  11. package/bundled/qc-helper/docs/features/skills.md +29 -3
  12. package/bundled/qc-helper/docs/features/sub-agents.md +34 -12
  13. package/bundled/qc-helper/docs/qwen-serve-deploy-local.md +221 -0
  14. package/bundled/qc-helper/docs/qwen-serve.md +250 -31
  15. package/bundled/qc-helper/docs/reference/keyboard-shortcuts.md +30 -30
  16. package/chunks/{agent-QB7TZ4HW.js → agent-PXMT2XR5.js} +25 -24
  17. package/chunks/agent-headless-SY7VJUHV.js +51 -0
  18. package/chunks/{anthropicContentGenerator-M45EVVRM.js → anthropicContentGenerator-DCI26OQF.js} +7 -7
  19. package/chunks/{askUserQuestion-WM2KHM3K.js → askUserQuestion-NDNFGC35.js} +45 -3
  20. package/chunks/{ca-BARBRL6N.js → ca-RK4QPLIX.js} +18 -1
  21. package/chunks/{chunk-CNSMKPK6.js → chunk-26QELEL2.js} +1 -1
  22. package/chunks/{chunk-CWV3SJZS.js → chunk-3NRO6NHX.js} +2 -2
  23. package/chunks/{chunk-BNESGOSJ.js → chunk-55ZMG67I.js} +1 -1
  24. package/chunks/{chunk-2ZTWI7KH.js → chunk-6WPY6ES3.js} +62 -22
  25. package/chunks/{chunk-ZK4AMNIU.js → chunk-A3OEZT2F.js} +1294 -314
  26. package/chunks/{chunk-HXJE7VOG.js → chunk-ABRZC6FA.js} +1074 -144
  27. package/chunks/{chunk-JUGRPQAB.js → chunk-B4ZF2KSI.js} +1 -1
  28. package/chunks/chunk-BJ5HQ23U.js +178 -0
  29. package/chunks/{chunk-ICOI4E4S.js → chunk-CPVI5J2L.js} +101 -23
  30. package/chunks/{chunk-GX7VH5JQ.js → chunk-FIQECJTQ.js} +1 -1
  31. package/chunks/{chunk-QCG6KPNM.js → chunk-H4ZDM3N6.js} +18039 -11622
  32. package/chunks/{chunk-SZOEIL6S.js → chunk-H6BD2ELD.js} +1 -0
  33. package/chunks/{chunk-JXAZUMDW.js → chunk-HA2UEYZP.js} +7 -4
  34. package/chunks/{chunk-MVIVIPCU.js → chunk-IDYDPBBN.js} +361 -583
  35. package/chunks/{chunk-JVQOQ3OU.js → chunk-IQHSD7K5.js} +1 -1
  36. package/chunks/{chunk-CNHFPN7T.js → chunk-JZFEL3RB.js} +1 -1
  37. package/chunks/{chunk-UAMOBVVW.js → chunk-LXYWINWF.js} +1 -1
  38. package/chunks/{chunk-P4J26VDS.js → chunk-LYRSMKLS.js} +2 -2
  39. package/chunks/{chunk-Y7R6H6FT.js → chunk-LYSND7KR.js} +9 -4
  40. package/chunks/{chunk-AVW55ZCO.js → chunk-M5PJ5QAF.js} +37 -16
  41. package/chunks/{chunk-LR62TEET.js → chunk-NNIYWQIS.js} +1 -1
  42. package/chunks/chunk-OMX7CUOE.js +356 -0
  43. package/chunks/{chunk-HV3ZZ7G4.js → chunk-OT6JA3KQ.js} +2 -2
  44. package/chunks/{chunk-C6WMLUNB.js → chunk-QP4R5FTG.js} +1 -1
  45. package/chunks/chunk-QQDPRDVW.js +25 -0
  46. package/chunks/chunk-SFRV6BGY.js +243 -0
  47. package/chunks/{chunk-NW5QBUYO.js → chunk-TSBXGR73.js} +14 -14
  48. package/chunks/{chunk-7YKXFA3D.js → chunk-UOB6KPGG.js} +11 -11
  49. package/chunks/{chunk-USE2VQ5P.js → chunk-VU6A2OBJ.js} +41 -6
  50. package/chunks/{chunk-PAEBHDIO.js → chunk-VXHYMZXW.js} +1 -1
  51. package/chunks/{chunk-HGJPQK33.js → chunk-WPTCDQN6.js} +188 -534
  52. package/chunks/{chunk-WFVXF3OM.js → chunk-Z2Z3GUXZ.js} +1 -0
  53. package/chunks/{chunk-KC6ZMJ5X.js → chunk-ZMIBJS45.js} +1 -1
  54. package/chunks/chunk-ZOFNJQNJ.js +607 -0
  55. package/chunks/computer-use-7SEQDSHB.js +2052 -0
  56. package/chunks/contextCommand-KM5OWV65.js +53 -0
  57. package/chunks/cron-create-7CXEAJ2K.js +184 -0
  58. package/chunks/{cron-delete-ZGUXWBTG.js → cron-delete-2FQYYNQ6.js} +28 -5
  59. package/chunks/{cron-list-QNNZGMN3.js → cron-list-QCAJ73XE.js} +40 -7
  60. package/chunks/{de-YGKK2BC4.js → de-FGPM4KW5.js} +18 -1
  61. package/chunks/{devtools-IXE4UP72.js → devtools-FM6GJPYG.js} +1 -1
  62. package/chunks/{dist-R2SXPG74.js → dist-2UCAYOX7.js} +2 -2
  63. package/chunks/{dist-TE5QKMGR.js → dist-33LHH26D.js} +1 -1
  64. package/chunks/{dist-BXDUQ2QY.js → dist-KF43SZZV.js} +1 -1
  65. package/chunks/{dist-ZMQ4TXD5.js → dist-PF2IYSMD.js} +2 -2
  66. package/chunks/{edit-6UBTS2J5.js → edit-BMUKPLA7.js} +27 -28
  67. package/chunks/{en-HSQQNQUB.js → en-VP6XPGEC.js} +9 -2
  68. package/chunks/{enter-worktree-NN7LIXCM.js → enter-worktree-LXJ5WJ5A.js} +25 -24
  69. package/chunks/enterPlanMode-QWRZ54ZF.js +159 -0
  70. package/chunks/{exit-worktree-GGSS5KIE.js → exit-worktree-5HTQPNZO.js} +25 -24
  71. package/chunks/exitPlanMode-5WQAXNDA.js +743 -0
  72. package/chunks/{fr-JXBKPJKQ.js → fr-ATYBVCLT.js} +18 -1
  73. package/chunks/{geminiContentGenerator-I4H2NLJG.js → geminiContentGenerator-CAKHT5YE.js} +7 -7
  74. package/chunks/{getMachineId-bsd-F7GNPTER.js → getMachineId-bsd-4CASPIU4.js} +1 -1
  75. package/chunks/{getMachineId-darwin-T73DJL27.js → getMachineId-darwin-HPQPEMZR.js} +1 -1
  76. package/chunks/{getMachineId-linux-MKQTFPQM.js → getMachineId-linux-AUARKYHL.js} +1 -1
  77. package/chunks/{getMachineId-unsupported-MUR5KOQE.js → getMachineId-unsupported-S32ZDA2T.js} +1 -1
  78. package/chunks/{getMachineId-win-CDYFC6ZM.js → getMachineId-win-4EFLHYIJ.js} +1 -1
  79. package/chunks/{glob-OLCX57MD.js → glob-5DN6NSCD.js} +25 -24
  80. package/chunks/{grep-7HXIMDOW.js → grep-BJILOLCD.js} +37 -30
  81. package/chunks/{ja-TGPZSP2B.js → ja-W2QEA2OI.js} +18 -1
  82. package/chunks/{keychain-token-storage-LB46DAEK.js → keychain-token-storage-QSTRHKKL.js} +3 -3
  83. package/chunks/{ls-6PEZUK6O.js → ls-XVGXRYWD.js} +4 -4
  84. package/chunks/{lsp-JZSJOVT7.js → lsp-S6SHPULC.js} +3 -3
  85. package/chunks/{monitor-SQO7MVAV.js → monitor-SUEMSRN3.js} +25 -24
  86. package/chunks/{notebook-edit-72L3EBAL.js → notebook-edit-6F6Z5P6U.js} +26 -25
  87. package/chunks/{openaiContentGenerator-FTR7CDWF.js → openaiContentGenerator-DO27LL6O.js} +15 -15
  88. package/chunks/{pt-TIBG6BIO.js → pt-ZKEWJFBW.js} +18 -1
  89. package/chunks/{qwenContentGenerator-U5UFQ566.js → qwenContentGenerator-DQLGLQSH.js} +27 -26
  90. package/chunks/{qwenOAuth2-EFSECGHF.js → qwenOAuth2-KK433U33.js} +6 -5
  91. package/chunks/{read-file-UA64EEQC.js → read-file-3TBLYTOQ.js} +11 -11
  92. package/chunks/ripGrep-3INYT3QV.js +49 -0
  93. package/chunks/{ru-JBCHCK4L.js → ru-VEKTPJ74.js} +18 -1
  94. package/chunks/{scheduler-VBASHOCA.js → scheduler-23KQW6CX.js} +25 -24
  95. package/chunks/{send-message-OYJZ5TPG.js → send-message-SMNR5DBG.js} +3 -3
  96. package/chunks/{serve-A7E2OJDR.js → serve-Y5E4LKUI.js} +13164 -3840
  97. package/chunks/{shell-3NFOT6F5.js → shell-4H6XQXVY.js} +25 -24
  98. package/chunks/{skill-RA5YUREY.js → skill-SE6FECZR.js} +64 -113
  99. package/chunks/{src-NFCMARMT.js → src-76DUBH3A.js} +176 -44
  100. package/chunks/{syntheticOutput-DETQ2YM6.js → syntheticOutput-KMNF7YG6.js} +4 -4
  101. package/chunks/{task-create-Y3ZKTJIG.js → task-create-LIJHK75G.js} +8 -7
  102. package/chunks/{task-list-ONXJ3I3A.js → task-list-S4GNSILM.js} +7 -6
  103. package/chunks/{task-stop-UHDC4N5B.js → task-stop-3GBRYJHM.js} +3 -3
  104. package/chunks/{task-update-TCNOU3P5.js → task-update-F3UTVJMS.js} +21 -9
  105. package/chunks/{team-create-6SR4OVRG.js → team-create-Q5DTDDH4.js} +28 -26
  106. package/chunks/{team-delete-EJ4U4DDP.js → team-delete-54434EB7.js} +9 -6
  107. package/chunks/{todoWrite-TEYDRS5L.js → todoWrite-4ENGSBUX.js} +5 -5
  108. package/chunks/{tool-search-OD435A3X.js → tool-search-ABZMSDTU.js} +11 -11
  109. package/chunks/{web-fetch-6W67H5PO.js → web-fetch-RHZMF3MP.js} +5 -5
  110. package/chunks/workflow-NEMDQB75.js +1414 -0
  111. package/chunks/{write-file-475L5OPP.js → write-file-VAEHZPSL.js} +26 -25
  112. package/chunks/{zh-VCLWO26Y.js → zh-OIXDDQHB.js} +10 -3
  113. package/chunks/{zh-TW-G3HFHVVT.js → zh-TW-6YFNCKTA.js} +10 -3
  114. package/cli-entry.js +19 -0
  115. package/cli.js +11155 -6656
  116. package/examples/starter/QWEN.md +30 -0
  117. package/examples/starter/README.md +59 -0
  118. package/examples/starter/agents/diary.md +86 -0
  119. package/examples/starter/commands/writing/polish.md +13 -0
  120. package/examples/starter/example.ts +64 -0
  121. package/examples/starter/package.json +18 -0
  122. package/examples/starter/qwen-extension.json +12 -0
  123. package/examples/starter/skills/synonyms/SKILL.md +48 -0
  124. package/examples/starter/tsconfig.json +13 -0
  125. package/fzfWorker.js +1083 -0
  126. package/locales/ca.js +20 -2
  127. package/locales/de.js +21 -2
  128. package/locales/en.js +13 -4
  129. package/locales/fr.js +22 -2
  130. package/locales/ja.js +22 -2
  131. package/locales/pt.js +21 -2
  132. package/locales/ru.js +20 -2
  133. package/locales/zh-TW.js +11 -4
  134. package/locales/zh.js +11 -4
  135. package/package.json +5 -3
  136. package/chunks/agent-headless-APVHH7QM.js +0 -50
  137. package/chunks/chunk-AJIR24J2.js +0 -59
  138. package/chunks/chunk-SKBPNJEW.js +0 -45
  139. package/chunks/chunk-XBFVXFB2.js +0 -216
  140. package/chunks/computer-use-B7VIUI7F.js +0 -825
  141. package/chunks/contextCommand-63RZ3O5R.js +0 -52
  142. package/chunks/cron-create-FI5LJVUS.js +0 -140
  143. package/chunks/exitPlanMode-H323NHB2.js +0 -235
  144. package/chunks/ripGrep-WSYCWZVK.js +0 -48
  145. package/chunks/workflow-62DHH4EO.js +0 -708
@@ -1,52 +0,0 @@
1
- // Force strict mode and setup for ESM
2
- "use strict";
3
- import {
4
- collectContextData,
5
- contextCommand,
6
- formatContextUsageText
7
- } from "./chunk-NW5QBUYO.js";
8
- import "./chunk-7YKXFA3D.js";
9
- import "./chunk-QCG6KPNM.js";
10
- import "./chunk-K5PGHDBN.js";
11
- import "./chunk-SKBPNJEW.js";
12
- import "./chunk-O4PICXES.js";
13
- import "./chunk-TW522KN6.js";
14
- import "./chunk-AJIR24J2.js";
15
- import "./chunk-HGJPQK33.js";
16
- import "./chunk-XBFVXFB2.js";
17
- import "./chunk-MLZQVCF3.js";
18
- import "./chunk-PAEBHDIO.js";
19
- import "./chunk-LD2XBG6Z.js";
20
- import "./chunk-ICOI4E4S.js";
21
- import "./chunk-KC6ZMJ5X.js";
22
- import "./chunk-77WXWU44.js";
23
- import "./chunk-JUGRPQAB.js";
24
- import "./chunk-64WXLC72.js";
25
- import "./chunk-ZK4AMNIU.js";
26
- import "./chunk-3PJXIDKI.js";
27
- import "./chunk-UWCTAVOD.js";
28
- import "./chunk-OFEVLU4C.js";
29
- import "./chunk-JVQOQ3OU.js";
30
- import "./chunk-P4J26VDS.js";
31
- import "./chunk-CNSMKPK6.js";
32
- import "./chunk-2ZTWI7KH.js";
33
- import "./chunk-MVIVIPCU.js";
34
- import "./chunk-GX7VH5JQ.js";
35
- import "./chunk-UAMOBVVW.js";
36
- import "./chunk-LR62TEET.js";
37
- import "./chunk-Y7R6H6FT.js";
38
- import "./chunk-BNESGOSJ.js";
39
- import "./chunk-SZOEIL6S.js";
40
- import "./chunk-5IFG2VC4.js";
41
- import "./chunk-JXAZUMDW.js";
42
- import "./chunk-ZERZSAZL.js";
43
- import "./chunk-QN5NZ3UQ.js";
44
- import "./chunk-BR4QREVK.js";
45
- import "./chunk-WFVXF3OM.js";
46
- import "./chunk-A4BMJM77.js";
47
- import "./chunk-J2S4EL5Y.js";
48
- export {
49
- collectContextData,
50
- contextCommand,
51
- formatContextUsageText
52
- };
@@ -1,140 +0,0 @@
1
- // Force strict mode and setup for ESM
2
- "use strict";
3
- import {
4
- parseCron
5
- } from "./chunk-O4PICXES.js";
6
- import {
7
- humanReadableCron
8
- } from "./chunk-TW522KN6.js";
9
- import {
10
- BaseDeclarativeTool,
11
- BaseToolInvocation,
12
- ToolDisplayNames,
13
- ToolNames
14
- } from "./chunk-2ZTWI7KH.js";
15
- import "./chunk-JXAZUMDW.js";
16
- import "./chunk-WFVXF3OM.js";
17
- import {
18
- init_esbuild_shims
19
- } from "./chunk-A4BMJM77.js";
20
- import {
21
- __name
22
- } from "./chunk-J2S4EL5Y.js";
23
-
24
- // packages/core/src/tools/cron-create.ts
25
- init_esbuild_shims();
26
- var CronCreateInvocation = class extends BaseToolInvocation {
27
- constructor(config, params) {
28
- super(params);
29
- this.config = config;
30
- }
31
- static {
32
- __name(this, "CronCreateInvocation");
33
- }
34
- getDescription() {
35
- return `${this.params.cron}: ${this.params.prompt}`;
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
- }
48
- async execute() {
49
- const scheduler = this.config.getCronScheduler();
50
- const recurring = this.params.recurring !== false;
51
- try {
52
- parseCron(this.params.cron);
53
- const job = scheduler.create(
54
- this.params.cron,
55
- this.params.prompt,
56
- recurring
57
- );
58
- const display = humanReadableCron(job.cronExpr);
59
- const returnDisplay = `Scheduled ${job.id} (${display})`;
60
- let llmContent;
61
- if (recurring) {
62
- llmContent = `Scheduled recurring job ${job.id} (${job.cronExpr}). Session-only (not written to disk, dies when Qwen Code exits). Auto-expires after 3 days. Use CronDelete to cancel sooner.`;
63
- } else {
64
- llmContent = `Scheduled one-shot task ${job.id} (${job.cronExpr}). Session-only (not written to disk, dies when Qwen Code exits). It will fire once then auto-delete.`;
65
- }
66
- return { llmContent, returnDisplay };
67
- } catch (error) {
68
- const message = error instanceof Error ? error.message : String(error);
69
- return {
70
- llmContent: `Error creating cron job: ${message}`,
71
- returnDisplay: message,
72
- error: { message }
73
- };
74
- }
75
- }
76
- };
77
- var CronCreateTool = class _CronCreateTool extends BaseDeclarativeTool {
78
- constructor(config) {
79
- super(
80
- _CronCreateTool.Name,
81
- ToolDisplayNames.CRON_CREATE,
82
- 'Schedule a prompt to be enqueued at a future time. Use for both recurring schedules and one-shot reminders.\n\nUses standard 5-field cron in the user\'s local timezone: minute hour day-of-month month day-of-week. "0 9 * * *" means 9am local \u2014 no timezone conversion needed.\n\n## One-shot tasks (recurring: false)\n\nFor "remind me at X" or "at <time>, do Y" requests \u2014 fire once then auto-delete.\nPin minute/hour/day-of-month/month to specific values:\n "remind me at 2:30pm today to check the deploy" \u2192 cron: "30 14 <today_dom> <today_month> *", recurring: false\n "tomorrow morning, run the smoke test" \u2192 cron: "57 8 <tomorrow_dom> <tomorrow_month> *", recurring: false\n\n## Recurring jobs (recurring: true, the default)\n\nFor "every N minutes" / "every hour" / "weekdays at 9am" requests:\n "*/5 * * * *" (every 5 min), "0 * * * *" (hourly), "0 9 * * 1-5" (weekdays at 9am local)\n\n## Avoid the :00 and :30 minute marks when the task allows it\n\nEvery user who asks for "9am" gets `0 9`, and every user who asks for "hourly" gets `0 *` \u2014 which means requests from across the planet land on the API at the same instant. When the user\'s request is approximate, pick a minute that is NOT 0 or 30:\n "every morning around 9" \u2192 "57 8 * * *" or "3 9 * * *" (not "0 9 * * *")\n "hourly" \u2192 "7 * * * *" (not "0 * * * *")\n "in an hour or so, remind me to..." \u2192 pick whatever minute you land on, don\'t round\n\nOnly use minute 0 or 30 when the user names that exact time and clearly means it ("at 9:00 sharp", "at half past", coordinating with a meeting). When in doubt, nudge a few minutes early or late \u2014 the user will not notice, and the fleet will.\n\n## Session-only\n\nJobs live only in this Qwen Code session \u2014 nothing is written to disk, and the job is gone when Qwen Code exits.\n\n## Runtime behavior\n\nJobs only fire while the REPL is idle (not mid-query). The scheduler adds a small deterministic jitter on top of whatever you pick: recurring tasks fire up to 10% of their period late (max 15 min); one-shot tasks landing on :00 or :30 fire up to 90 s early. Picking an off-minute is still the bigger lever.\n\nRecurring tasks auto-expire after 3 days \u2014 they fire one final time, then are deleted. This bounds session lifetime. Tell the user about the 3-day limit when scheduling recurring jobs.\n\nReturns a job ID you can pass to CronDelete.',
83
- "other" /* Other */,
84
- {
85
- type: "object",
86
- properties: {
87
- cron: {
88
- type: "string",
89
- description: 'Standard 5-field cron expression in local time: "M H DoM Mon DoW" (e.g. "*/5 * * * *" = every 5 minutes, "30 14 28 2 *" = Feb 28 at 2:30pm local once).'
90
- },
91
- prompt: {
92
- type: "string",
93
- description: "The prompt to enqueue at each fire time."
94
- },
95
- recurring: {
96
- type: "boolean",
97
- description: 'true (default) = fire on every cron match until deleted or auto-expired after 3 days. false = fire once at the next match, then auto-delete. Use false for "remind me at X" one-shot requests with pinned minute/hour/dom/month.'
98
- }
99
- },
100
- required: ["cron", "prompt"],
101
- additionalProperties: false
102
- },
103
- true,
104
- // isOutputMarkdown
105
- false,
106
- // canUpdateOutput
107
- true,
108
- // shouldDefer — scheduling is infrequent
109
- false,
110
- // alwaysLoad
111
- "cron schedule reminder recurring timer"
112
- );
113
- this.config = config;
114
- }
115
- static {
116
- __name(this, "CronCreateTool");
117
- }
118
- static Name = ToolNames.CRON_CREATE;
119
- createInvocation(params) {
120
- return new CronCreateInvocation(this.config, params);
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
- }
137
- };
138
- export {
139
- CronCreateTool
140
- };
@@ -1,235 +0,0 @@
1
- // Force strict mode and setup for ESM
2
- "use strict";
3
- import "./chunk-QCG6KPNM.js";
4
- import "./chunk-K5PGHDBN.js";
5
- import "./chunk-SKBPNJEW.js";
6
- import "./chunk-O4PICXES.js";
7
- import "./chunk-TW522KN6.js";
8
- import "./chunk-AJIR24J2.js";
9
- import "./chunk-HGJPQK33.js";
10
- import "./chunk-XBFVXFB2.js";
11
- import "./chunk-MLZQVCF3.js";
12
- import "./chunk-PAEBHDIO.js";
13
- import "./chunk-LD2XBG6Z.js";
14
- import "./chunk-ICOI4E4S.js";
15
- import "./chunk-KC6ZMJ5X.js";
16
- import "./chunk-77WXWU44.js";
17
- import "./chunk-JUGRPQAB.js";
18
- import "./chunk-64WXLC72.js";
19
- import "./chunk-ZK4AMNIU.js";
20
- import "./chunk-3PJXIDKI.js";
21
- import "./chunk-UWCTAVOD.js";
22
- import "./chunk-OFEVLU4C.js";
23
- import "./chunk-JVQOQ3OU.js";
24
- import "./chunk-P4J26VDS.js";
25
- import "./chunk-CNSMKPK6.js";
26
- import {
27
- BaseDeclarativeTool,
28
- BaseToolInvocation,
29
- ToolDisplayNames,
30
- ToolNames
31
- } from "./chunk-2ZTWI7KH.js";
32
- import "./chunk-MVIVIPCU.js";
33
- import "./chunk-GX7VH5JQ.js";
34
- import "./chunk-UAMOBVVW.js";
35
- import "./chunk-LR62TEET.js";
36
- import "./chunk-Y7R6H6FT.js";
37
- import "./chunk-BNESGOSJ.js";
38
- import "./chunk-SZOEIL6S.js";
39
- import "./chunk-5IFG2VC4.js";
40
- import {
41
- createDebugLogger
42
- } from "./chunk-JXAZUMDW.js";
43
- import "./chunk-ZERZSAZL.js";
44
- import "./chunk-QN5NZ3UQ.js";
45
- import "./chunk-BR4QREVK.js";
46
- import "./chunk-WFVXF3OM.js";
47
- import {
48
- init_esbuild_shims
49
- } from "./chunk-A4BMJM77.js";
50
- import {
51
- __name
52
- } from "./chunk-J2S4EL5Y.js";
53
-
54
- // packages/core/src/tools/exitPlanMode.ts
55
- init_esbuild_shims();
56
- var debugLogger = createDebugLogger("EXIT_PLAN_MODE");
57
- var exitPlanModeToolDescription = `Use this tool when you are in plan mode and have finished presenting your plan and are ready to code. This will prompt the user to exit plan mode.
58
-
59
- ## When to Use This Tool
60
- IMPORTANT: Only use this tool when the task requires planning the implementation steps of a task that requires writing code. For research tasks where you're gathering information, searching files, reading files or in general trying to understand the codebase - do NOT use this tool.
61
-
62
- ## Before Using This Tool
63
- Ensure your plan is complete and unambiguous:
64
- - If you have unresolved questions about requirements or approach, use AskUserQuestion first (in earlier phases)
65
- - Once your plan is finalized, use THIS tool to request approval
66
-
67
- **Important:** Do NOT use AskUserQuestion to ask "Is this plan okay?" or "Should I proceed?" - that's exactly what THIS tool does. ExitPlanMode inherently requests user approval of your plan.
68
-
69
- ## Examples
70
- 1. Initial task: "Search for and understand the implementation of vim mode in the codebase" - Do not use the exit plan mode tool because you are not planning the implementation steps of a task.
71
- 2. Initial task: "Help me implement yank mode for vim" - Use the exit plan mode tool after you have finished planning the implementation steps of the task.
72
- 3. Initial task: "Add a new feature to handle user authentication" - If unsure about auth method (OAuth, JWT, etc.), use AskUserQuestion first, then use exit plan mode tool after clarifying the approach.
73
- `;
74
- var exitPlanModeToolSchemaData = {
75
- name: "exit_plan_mode",
76
- description: exitPlanModeToolDescription,
77
- parametersJsonSchema: {
78
- type: "object",
79
- properties: {
80
- plan: {
81
- type: "string",
82
- description: "The plan you came up with, that you want to run by the user for approval. Supports markdown. The plan should be pretty concise."
83
- }
84
- },
85
- required: ["plan"],
86
- additionalProperties: false,
87
- $schema: "http://json-schema.org/draft-07/schema#"
88
- }
89
- };
90
- var ExitPlanModeToolInvocation = class extends BaseToolInvocation {
91
- constructor(config, params) {
92
- super(params);
93
- this.config = config;
94
- }
95
- static {
96
- __name(this, "ExitPlanModeToolInvocation");
97
- }
98
- wasApproved = false;
99
- getDescription() {
100
- return "Plan:";
101
- }
102
- /**
103
- * Plan mode exit always requires user confirmation.
104
- */
105
- async getDefaultPermission() {
106
- return "ask";
107
- }
108
- async getConfirmationDetails(_abortSignal) {
109
- const prePlanMode = this.config.getPrePlanMode();
110
- const details = {
111
- type: "plan",
112
- title: "Would you like to proceed?",
113
- plan: this.params.plan,
114
- prePlanMode,
115
- onConfirm: /* @__PURE__ */ __name(async (outcome) => {
116
- switch (outcome) {
117
- case "restore_previous" /* RestorePrevious */:
118
- this.wasApproved = true;
119
- this.setApprovalModeSafely(prePlanMode);
120
- break;
121
- case "proceed_always" /* ProceedAlways */:
122
- this.wasApproved = true;
123
- this.setApprovalModeSafely("auto-edit" /* AUTO_EDIT */);
124
- break;
125
- case "proceed_once" /* ProceedOnce */:
126
- this.wasApproved = true;
127
- this.setApprovalModeSafely("default" /* DEFAULT */);
128
- break;
129
- case "cancel" /* Cancel */:
130
- this.wasApproved = false;
131
- this.setApprovalModeSafely("plan" /* PLAN */);
132
- break;
133
- default:
134
- this.wasApproved = true;
135
- this.setApprovalModeSafely("default" /* DEFAULT */);
136
- break;
137
- }
138
- }, "onConfirm")
139
- };
140
- return details;
141
- }
142
- setApprovalModeSafely(mode) {
143
- try {
144
- this.config.setApprovalMode(mode);
145
- } catch (error) {
146
- const errorMessage = error instanceof Error ? error.message : String(error);
147
- debugLogger.error(
148
- `[ExitPlanModeTool] Failed to set approval mode to "${mode}": ${errorMessage}`
149
- );
150
- }
151
- }
152
- async execute(_signal) {
153
- const { plan } = this.params;
154
- try {
155
- const isYolo = this.config.getApprovalMode() === "yolo" /* YOLO */;
156
- const effectivelyApproved = this.wasApproved || isYolo;
157
- if (!effectivelyApproved) {
158
- const rejectionMessage = "Plan execution was not approved. Remaining in plan mode.";
159
- return {
160
- llmContent: rejectionMessage,
161
- returnDisplay: rejectionMessage
162
- };
163
- }
164
- try {
165
- this.config.savePlan(plan);
166
- } catch (error) {
167
- debugLogger.warn(
168
- `[ExitPlanModeTool] Failed to save plan to disk: ${error instanceof Error ? error.message : String(error)}`
169
- );
170
- }
171
- const llmMessage = `User has approved your plan. You can now start coding. Start with updating your todo list if applicable.`;
172
- const displayMessage = "User approved the plan.";
173
- return {
174
- llmContent: llmMessage,
175
- returnDisplay: {
176
- type: "plan_summary",
177
- message: displayMessage,
178
- plan
179
- }
180
- };
181
- } catch (error) {
182
- const errorMessage = error instanceof Error ? error.message : String(error);
183
- debugLogger.error(
184
- `[ExitPlanModeTool] Error executing exit_plan_mode: ${errorMessage}`
185
- );
186
- const errorLlmContent = `Failed to present plan: ${errorMessage}`;
187
- return {
188
- llmContent: errorLlmContent,
189
- returnDisplay: `Error presenting plan: ${errorMessage}`
190
- };
191
- }
192
- }
193
- };
194
- var ExitPlanModeTool = class _ExitPlanModeTool extends BaseDeclarativeTool {
195
- constructor(config) {
196
- super(
197
- _ExitPlanModeTool.Name,
198
- ToolDisplayNames.EXIT_PLAN_MODE,
199
- exitPlanModeToolDescription,
200
- "think" /* Think */,
201
- exitPlanModeToolSchemaData.parametersJsonSchema,
202
- true,
203
- // isOutputMarkdown
204
- false,
205
- // canUpdateOutput
206
- true,
207
- // shouldDefer — only used when leaving plan mode
208
- false,
209
- // alwaysLoad
210
- "plan mode exit approve"
211
- );
212
- this.config = config;
213
- }
214
- static {
215
- __name(this, "ExitPlanModeTool");
216
- }
217
- static Name = ToolNames.EXIT_PLAN_MODE;
218
- validateToolParams(params) {
219
- if (!params.plan || typeof params.plan !== "string" || params.plan.trim() === "") {
220
- return 'Parameter "plan" must be a non-empty string.';
221
- }
222
- return null;
223
- }
224
- createInvocation(params) {
225
- return new ExitPlanModeToolInvocation(this.config, params);
226
- }
227
- };
228
- export {
229
- ExitPlanModeTool
230
- };
231
- /**
232
- * @license
233
- * Copyright 2025 Qwen
234
- * SPDX-License-Identifier: Apache-2.0
235
- */
@@ -1,48 +0,0 @@
1
- // Force strict mode and setup for ESM
2
- "use strict";
3
- import {
4
- RipGrepTool,
5
- _resetRipGrepCachesForTest
6
- } from "./chunk-QCG6KPNM.js";
7
- import "./chunk-K5PGHDBN.js";
8
- import "./chunk-SKBPNJEW.js";
9
- import "./chunk-O4PICXES.js";
10
- import "./chunk-TW522KN6.js";
11
- import "./chunk-AJIR24J2.js";
12
- import "./chunk-HGJPQK33.js";
13
- import "./chunk-XBFVXFB2.js";
14
- import "./chunk-MLZQVCF3.js";
15
- import "./chunk-PAEBHDIO.js";
16
- import "./chunk-LD2XBG6Z.js";
17
- import "./chunk-ICOI4E4S.js";
18
- import "./chunk-KC6ZMJ5X.js";
19
- import "./chunk-77WXWU44.js";
20
- import "./chunk-JUGRPQAB.js";
21
- import "./chunk-64WXLC72.js";
22
- import "./chunk-ZK4AMNIU.js";
23
- import "./chunk-3PJXIDKI.js";
24
- import "./chunk-UWCTAVOD.js";
25
- import "./chunk-OFEVLU4C.js";
26
- import "./chunk-JVQOQ3OU.js";
27
- import "./chunk-P4J26VDS.js";
28
- import "./chunk-CNSMKPK6.js";
29
- import "./chunk-2ZTWI7KH.js";
30
- import "./chunk-MVIVIPCU.js";
31
- import "./chunk-GX7VH5JQ.js";
32
- import "./chunk-UAMOBVVW.js";
33
- import "./chunk-LR62TEET.js";
34
- import "./chunk-Y7R6H6FT.js";
35
- import "./chunk-BNESGOSJ.js";
36
- import "./chunk-SZOEIL6S.js";
37
- import "./chunk-5IFG2VC4.js";
38
- import "./chunk-JXAZUMDW.js";
39
- import "./chunk-ZERZSAZL.js";
40
- import "./chunk-QN5NZ3UQ.js";
41
- import "./chunk-BR4QREVK.js";
42
- import "./chunk-WFVXF3OM.js";
43
- import "./chunk-A4BMJM77.js";
44
- import "./chunk-J2S4EL5Y.js";
45
- export {
46
- RipGrepTool,
47
- _resetRipGrepCachesForTest
48
- };