@qwen-code/qwen-code 0.18.0-preview.2 → 0.18.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.
- package/bundled/qc-helper/docs/_meta.ts +1 -0
- package/bundled/qc-helper/docs/configuration/settings.md +3 -5
- package/bundled/qc-helper/docs/features/approval-mode.md +10 -14
- package/bundled/qc-helper/docs/features/commands.md +33 -11
- package/bundled/qc-helper/docs/features/followup-suggestions.md +2 -2
- package/bundled/qc-helper/docs/features/sub-agents.md +32 -11
- package/bundled/qc-helper/docs/qwen-serve-deploy-local.md +221 -0
- package/bundled/qc-helper/docs/qwen-serve.md +234 -24
- package/chunks/{agent-QB7TZ4HW.js → agent-LOTJK6AH.js} +23 -23
- package/chunks/{agent-headless-APVHH7QM.js → agent-headless-TU3EPMYU.js} +23 -23
- package/chunks/{anthropicContentGenerator-M45EVVRM.js → anthropicContentGenerator-2HBRNQ3B.js} +7 -7
- package/chunks/{askUserQuestion-WM2KHM3K.js → askUserQuestion-OGCMIBQM.js} +45 -3
- package/chunks/{chunk-MVIVIPCU.js → chunk-2Y5SYSD3.js} +361 -583
- package/chunks/chunk-3DHXZ6EV.js +241 -0
- package/chunks/{chunk-JVQOQ3OU.js → chunk-3HTIVKZE.js} +1 -1
- package/chunks/{chunk-BNESGOSJ.js → chunk-55ZMG67I.js} +1 -1
- package/chunks/{chunk-ZK4AMNIU.js → chunk-6YIUGZTC.js} +1041 -210
- package/chunks/{chunk-C6WMLUNB.js → chunk-72LDN5PP.js} +1 -1
- package/chunks/{chunk-AVW55ZCO.js → chunk-7BCMOPIM.js} +11 -9
- package/chunks/{chunk-JUGRPQAB.js → chunk-A7B4ISQP.js} +1 -1
- package/chunks/{chunk-UAMOBVVW.js → chunk-B7HXHOHU.js} +1 -1
- package/chunks/{chunk-CNSMKPK6.js → chunk-BIVG75CP.js} +1 -1
- package/chunks/{chunk-LR62TEET.js → chunk-EYENRK4D.js} +1 -1
- package/chunks/{chunk-SZOEIL6S.js → chunk-H6BD2ELD.js} +1 -0
- package/chunks/{chunk-PAEBHDIO.js → chunk-HLPLOD42.js} +1 -1
- package/chunks/{chunk-JXAZUMDW.js → chunk-HR7SV7AY.js} +1 -2
- package/chunks/{chunk-P4J26VDS.js → chunk-IDX6COTE.js} +2 -2
- package/chunks/{chunk-QCG6KPNM.js → chunk-IWAYOW5Q.js} +14760 -10735
- package/chunks/{chunk-HGJPQK33.js → chunk-J5MDQKJL.js} +518 -519
- package/chunks/{chunk-USE2VQ5P.js → chunk-JTQAQBTV.js} +21 -0
- package/chunks/{chunk-HXJE7VOG.js → chunk-LBP46COL.js} +1001 -139
- package/chunks/{chunk-NW5QBUYO.js → chunk-LEJ42GNY.js} +14 -14
- package/chunks/{chunk-Y7R6H6FT.js → chunk-M6VTDSVR.js} +1 -1
- package/chunks/{chunk-CNHFPN7T.js → chunk-MFBBBTNY.js} +1 -1
- package/chunks/{chunk-ICOI4E4S.js → chunk-OHEGWO4L.js} +101 -23
- package/chunks/{chunk-7YKXFA3D.js → chunk-PL3MVCWD.js} +5 -5
- package/chunks/chunk-QQDPRDVW.js +25 -0
- package/chunks/{chunk-HV3ZZ7G4.js → chunk-R7ODSGTK.js} +2 -2
- package/chunks/{chunk-GX7VH5JQ.js → chunk-SEGYWKIH.js} +1 -1
- package/chunks/{chunk-KC6ZMJ5X.js → chunk-SNGELLWX.js} +1 -1
- package/chunks/chunk-XBY7E2FX.js +605 -0
- package/chunks/{chunk-2ZTWI7KH.js → chunk-XV4HCEVI.js} +22 -1
- package/chunks/{chunk-WFVXF3OM.js → chunk-Z2Z3GUXZ.js} +1 -0
- package/chunks/{chunk-CWV3SJZS.js → chunk-ZTZ4DDQE.js} +2 -2
- package/chunks/{computer-use-B7VIUI7F.js → computer-use-3RH2DOM6.js} +23 -23
- package/chunks/contextCommand-K347QT6O.js +52 -0
- package/chunks/{cron-create-FI5LJVUS.js → cron-create-YJL3KFWI.js} +3 -3
- package/chunks/{cron-delete-ZGUXWBTG.js → cron-delete-WKWSJZQA.js} +3 -3
- package/chunks/{cron-list-QNNZGMN3.js → cron-list-B52XEXAZ.js} +3 -3
- package/chunks/{devtools-IXE4UP72.js → devtools-FM6GJPYG.js} +1 -1
- package/chunks/{dist-R2SXPG74.js → dist-4LXD6L6X.js} +2 -2
- package/chunks/{dist-TE5QKMGR.js → dist-H6ONXVLG.js} +1 -1
- package/chunks/{dist-ZMQ4TXD5.js → dist-KAZ3SEBX.js} +2 -2
- package/chunks/{dist-BXDUQ2QY.js → dist-PK7DFCAW.js} +1 -1
- package/chunks/{edit-6UBTS2J5.js → edit-KU4PJGEX.js} +24 -24
- package/chunks/{en-HSQQNQUB.js → en-DHGYHIHX.js} +4 -0
- package/chunks/{enter-worktree-NN7LIXCM.js → enter-worktree-PPYIDCWI.js} +23 -23
- package/chunks/enterPlanMode-5CZDMCB4.js +158 -0
- package/chunks/{exit-worktree-GGSS5KIE.js → exit-worktree-UY3CGHKC.js} +23 -23
- package/chunks/exitPlanMode-3DN4QNSG.js +703 -0
- package/chunks/{geminiContentGenerator-I4H2NLJG.js → geminiContentGenerator-7A6I2RWB.js} +7 -7
- package/chunks/{getMachineId-bsd-F7GNPTER.js → getMachineId-bsd-4CASPIU4.js} +1 -1
- package/chunks/{getMachineId-darwin-T73DJL27.js → getMachineId-darwin-HPQPEMZR.js} +1 -1
- package/chunks/{getMachineId-linux-MKQTFPQM.js → getMachineId-linux-AUARKYHL.js} +1 -1
- package/chunks/{getMachineId-unsupported-MUR5KOQE.js → getMachineId-unsupported-S32ZDA2T.js} +1 -1
- package/chunks/{getMachineId-win-CDYFC6ZM.js → getMachineId-win-4EFLHYIJ.js} +1 -1
- package/chunks/{glob-OLCX57MD.js → glob-OFNQSS52.js} +23 -23
- package/chunks/{grep-7HXIMDOW.js → grep-6J2MSUM5.js} +26 -23
- package/chunks/{keychain-token-storage-LB46DAEK.js → keychain-token-storage-6IU6ORQN.js} +3 -3
- package/chunks/{ls-6PEZUK6O.js → ls-V3O6A5PT.js} +4 -4
- package/chunks/{lsp-JZSJOVT7.js → lsp-G2OCIFUA.js} +3 -3
- package/chunks/{monitor-SQO7MVAV.js → monitor-FKLHV423.js} +23 -23
- package/chunks/{notebook-edit-72L3EBAL.js → notebook-edit-KTBYFKWG.js} +24 -24
- package/chunks/{openaiContentGenerator-FTR7CDWF.js → openaiContentGenerator-L5KSWQY7.js} +15 -15
- package/chunks/{qwenContentGenerator-U5UFQ566.js → qwenContentGenerator-PYOXLMBW.js} +25 -25
- package/chunks/{qwenOAuth2-EFSECGHF.js → qwenOAuth2-2KCKWDCF.js} +6 -5
- package/chunks/{read-file-UA64EEQC.js → read-file-JQVRK4NU.js} +11 -11
- package/chunks/{ripGrep-WSYCWZVK.js → ripGrep-2L4LPNAJ.js} +23 -23
- package/chunks/{scheduler-VBASHOCA.js → scheduler-FGNXY4JQ.js} +23 -23
- package/chunks/{send-message-OYJZ5TPG.js → send-message-SZFWNOCL.js} +3 -3
- package/chunks/{serve-A7E2OJDR.js → serve-N2IBLA3G.js} +13581 -4977
- package/chunks/{shell-3NFOT6F5.js → shell-PTEG6UX4.js} +23 -23
- package/chunks/{skill-RA5YUREY.js → skill-X4NTK4NH.js} +64 -113
- package/chunks/{src-NFCMARMT.js → src-GLLQ3R5W.js} +154 -38
- package/chunks/{syntheticOutput-DETQ2YM6.js → syntheticOutput-IKAY5F6X.js} +4 -4
- package/chunks/{task-create-Y3ZKTJIG.js → task-create-MQICOJFV.js} +7 -7
- package/chunks/{task-list-ONXJ3I3A.js → task-list-RIHJCH32.js} +6 -6
- package/chunks/{task-stop-UHDC4N5B.js → task-stop-FWZRFANS.js} +3 -3
- package/chunks/{task-update-TCNOU3P5.js → task-update-2LHPXOYM.js} +20 -9
- package/chunks/{team-create-6SR4OVRG.js → team-create-2E4PF4KN.js} +26 -25
- package/chunks/{team-delete-EJ4U4DDP.js → team-delete-DAUDQS4J.js} +8 -6
- package/chunks/{todoWrite-TEYDRS5L.js → todoWrite-HTUACZES.js} +5 -5
- package/chunks/{tool-search-OD435A3X.js → tool-search-KTVULRES.js} +11 -11
- package/chunks/{web-fetch-6W67H5PO.js → web-fetch-CZ7LLKPE.js} +5 -5
- package/chunks/{workflow-62DHH4EO.js → workflow-L2ZUUDT2.js} +268 -16
- package/chunks/{write-file-475L5OPP.js → write-file-ZEB2JDYH.js} +24 -24
- package/chunks/{zh-VCLWO26Y.js → zh-7H5OQC4I.js} +5 -1
- package/chunks/{zh-TW-G3HFHVVT.js → zh-TW-P4IDHD3M.js} +5 -1
- package/cli.js +5955 -3128
- package/examples/starter/QWEN.md +30 -0
- package/examples/starter/README.md +59 -0
- package/examples/starter/agents/diary.md +86 -0
- package/examples/starter/commands/writing/polish.md +13 -0
- package/examples/starter/example.ts +64 -0
- package/examples/starter/package.json +18 -0
- package/examples/starter/qwen-extension.json +12 -0
- package/examples/starter/skills/synonyms/SKILL.md +48 -0
- package/examples/starter/tsconfig.json +13 -0
- package/fzfWorker.js +1083 -0
- package/locales/en.js +6 -0
- package/locales/zh-TW.js +5 -0
- package/locales/zh.js +5 -0
- package/package.json +3 -2
- package/chunks/chunk-AJIR24J2.js +0 -59
- package/chunks/chunk-XBFVXFB2.js +0 -216
- package/chunks/contextCommand-63RZ3O5R.js +0 -52
- package/chunks/exitPlanMode-H323NHB2.js +0 -235
package/locales/en.js
CHANGED
|
@@ -115,6 +115,8 @@ export default {
|
|
|
115
115
|
'List available Qwen Code tools. Usage: /tools [desc]',
|
|
116
116
|
'Open the skills panel (browse, search, toggle, pick).':
|
|
117
117
|
'Open the skills panel (browse, search, toggle, pick).',
|
|
118
|
+
'Move this session to a new working directory':
|
|
119
|
+
'Move this session to a new working directory',
|
|
118
120
|
// SkillsManagerDialog (the panel `/skills` opens)
|
|
119
121
|
'Manage Skills': 'Manage Skills',
|
|
120
122
|
'Skills configuration saved.': 'Skills configuration saved.',
|
|
@@ -224,6 +226,8 @@ export default {
|
|
|
224
226
|
'Clear conversation history and free up context',
|
|
225
227
|
'Compresses the context by replacing it with a summary.':
|
|
226
228
|
'Compresses the context by replacing it with a summary.',
|
|
229
|
+
'Fast context compression without AI. Strips old tool outputs and thinking parts.':
|
|
230
|
+
'Fast context compression without AI. Strips old tool outputs and thinking parts.',
|
|
227
231
|
'open full Qwen Code documentation in your browser':
|
|
228
232
|
'open full Qwen Code documentation in your browser',
|
|
229
233
|
'Configuration not available.': 'Configuration not available.',
|
|
@@ -620,6 +624,7 @@ export default {
|
|
|
620
624
|
'The name of the extension to update.',
|
|
621
625
|
'Either an extension name or --all must be provided':
|
|
622
626
|
'Either an extension name or --all must be provided',
|
|
627
|
+
'List installed extensions': 'List installed extensions',
|
|
623
628
|
'Lists installed extensions.': 'Lists installed extensions.',
|
|
624
629
|
'Path:': 'Path:',
|
|
625
630
|
'Source:': 'Source:',
|
|
@@ -2025,6 +2030,7 @@ export default {
|
|
|
2025
2030
|
'Loading suggestions...': 'Loading suggestions...',
|
|
2026
2031
|
'Show per-item context usage breakdown.':
|
|
2027
2032
|
'Show per-item context usage breakdown.',
|
|
2033
|
+
'No compression needed.': 'No compression needed.',
|
|
2028
2034
|
|
|
2029
2035
|
// ============================================================================
|
|
2030
2036
|
// Stats
|
package/locales/zh-TW.js
CHANGED
|
@@ -100,6 +100,7 @@ export default {
|
|
|
100
100
|
'列出可用的 Qwen Code 工具。用法:/tools [desc]',
|
|
101
101
|
'Open the skills panel (browse, search, toggle, pick).':
|
|
102
102
|
'開啟技能面板(瀏覽、搜尋、啟停、選擇)。',
|
|
103
|
+
'Move this session to a new working directory': '將此會話移動到新的工作目錄',
|
|
103
104
|
'Manage Skills': '管理技能',
|
|
104
105
|
'Skills configuration saved.': '技能設定已儲存。',
|
|
105
106
|
'Skills configuration saved, but refresh failed: {{error}}. Restart to ensure the new state is applied.':
|
|
@@ -202,6 +203,8 @@ export default {
|
|
|
202
203
|
'Clear conversation history and free up context': '清除對話歷史並釋放上下文',
|
|
203
204
|
'Compresses the context by replacing it with a summary.':
|
|
204
205
|
'通過摘要替換來壓縮上下文',
|
|
206
|
+
'Fast context compression without AI. Strips old tool outputs and thinking parts.':
|
|
207
|
+
'無需 AI 的快速上下文壓縮。清理舊工具輸出並剝離思考過程。',
|
|
205
208
|
'open full Qwen Code documentation in your browser':
|
|
206
209
|
'在瀏覽器中打開完整的 Qwen Code 文檔',
|
|
207
210
|
'Configuration not available.': '配置不可用',
|
|
@@ -545,6 +548,7 @@ export default {
|
|
|
545
548
|
'The name of the extension to update.': '要更新的擴展名稱。',
|
|
546
549
|
'Either an extension name or --all must be provided':
|
|
547
550
|
'必須提供擴展名稱或 --all',
|
|
551
|
+
'List installed extensions': '列出已安裝的擴展',
|
|
548
552
|
'Lists installed extensions.': '列出已安裝的擴展。',
|
|
549
553
|
'Path:': '路徑:',
|
|
550
554
|
'Source:': '來源:',
|
|
@@ -1726,4 +1730,5 @@ export default {
|
|
|
1726
1730
|
// === Same-as-English optimization ===
|
|
1727
1731
|
' (not in model registry)': '(不在模型註冊表中)',
|
|
1728
1732
|
'start server': '啟動伺服器',
|
|
1733
|
+
'No compression needed.': '無需壓縮。',
|
|
1729
1734
|
};
|
package/locales/zh.js
CHANGED
|
@@ -111,6 +111,7 @@ export default {
|
|
|
111
111
|
'列出可用的 Qwen Code 工具。用法:/tools [desc]',
|
|
112
112
|
'Open the skills panel (browse, search, toggle, pick).':
|
|
113
113
|
'打开技能面板(浏览、搜索、启停、选择)。',
|
|
114
|
+
'Move this session to a new working directory': '将此会话移动到新的工作目录',
|
|
114
115
|
// SkillsManagerDialog (`/skills` 弹出的面板)
|
|
115
116
|
'Manage Skills': '管理技能',
|
|
116
117
|
'Skills configuration saved.': '技能配置已保存。',
|
|
@@ -217,6 +218,8 @@ export default {
|
|
|
217
218
|
'Clear conversation history and free up context': '清除对话历史并释放上下文',
|
|
218
219
|
'Compresses the context by replacing it with a summary.':
|
|
219
220
|
'通过摘要替换来压缩上下文',
|
|
221
|
+
'Fast context compression without AI. Strips old tool outputs and thinking parts.':
|
|
222
|
+
'无需 AI 的快速上下文压缩。清理旧工具输出并剥离思考过程。',
|
|
220
223
|
'open full Qwen Code documentation in your browser':
|
|
221
224
|
'在浏览器中打开完整的 Qwen Code 文档',
|
|
222
225
|
'Configuration not available.': '配置不可用',
|
|
@@ -587,6 +590,7 @@ export default {
|
|
|
587
590
|
'The name of the extension to update.': '要更新的扩展名称。',
|
|
588
591
|
'Either an extension name or --all must be provided':
|
|
589
592
|
'必须提供扩展名称或 --all',
|
|
593
|
+
'List installed extensions': '列出已安装的扩展',
|
|
590
594
|
'Lists installed extensions.': '列出已安装的扩展。',
|
|
591
595
|
'Path:': '路径:',
|
|
592
596
|
'Source:': '来源:',
|
|
@@ -1926,4 +1930,5 @@ export default {
|
|
|
1926
1930
|
'中国 (China)': '中国',
|
|
1927
1931
|
'中国 (China) - 阿里云百炼': '中国 - 阿里云百炼',
|
|
1928
1932
|
'阿里云百炼 (aliyun.com)': '阿里云百炼(aliyun.com)',
|
|
1933
|
+
'No compression needed.': '无需压缩。',
|
|
1929
1934
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qwen-code/qwen-code",
|
|
3
|
-
"version": "0.18.0
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"description": "Qwen Code - AI-powered coding assistant",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
},
|
|
14
14
|
"files": [
|
|
15
15
|
"cli.js",
|
|
16
|
+
"fzfWorker.js",
|
|
16
17
|
"chunks",
|
|
17
18
|
"vendor",
|
|
18
19
|
"*.sb",
|
|
@@ -23,7 +24,7 @@
|
|
|
23
24
|
"bundled"
|
|
24
25
|
],
|
|
25
26
|
"config": {
|
|
26
|
-
"sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.18.0
|
|
27
|
+
"sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.18.0"
|
|
27
28
|
},
|
|
28
29
|
"dependencies": {},
|
|
29
30
|
"optionalDependencies": {
|
package/chunks/chunk-AJIR24J2.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
// Force strict mode and setup for ESM
|
|
2
|
-
"use strict";
|
|
3
|
-
import {
|
|
4
|
-
init_esbuild_shims
|
|
5
|
-
} from "./chunk-A4BMJM77.js";
|
|
6
|
-
import {
|
|
7
|
-
__name
|
|
8
|
-
} from "./chunk-J2S4EL5Y.js";
|
|
9
|
-
|
|
10
|
-
// packages/core/src/agents/team/leaderPermissionBridge.ts
|
|
11
|
-
init_esbuild_shims();
|
|
12
|
-
var leaderCallbacks = null;
|
|
13
|
-
function registerLeader(callbacks) {
|
|
14
|
-
leaderCallbacks = callbacks;
|
|
15
|
-
}
|
|
16
|
-
__name(registerLeader, "registerLeader");
|
|
17
|
-
function getLeader() {
|
|
18
|
-
return leaderCallbacks;
|
|
19
|
-
}
|
|
20
|
-
__name(getLeader, "getLeader");
|
|
21
|
-
function unregisterLeader() {
|
|
22
|
-
leaderCallbacks = null;
|
|
23
|
-
}
|
|
24
|
-
__name(unregisterLeader, "unregisterLeader");
|
|
25
|
-
function forwardApproval(teammateName, teammateColor, details) {
|
|
26
|
-
if (!leaderCallbacks) {
|
|
27
|
-
return false;
|
|
28
|
-
}
|
|
29
|
-
leaderCallbacks.enqueueApproval({
|
|
30
|
-
teammateName,
|
|
31
|
-
teammateColor,
|
|
32
|
-
details
|
|
33
|
-
});
|
|
34
|
-
return true;
|
|
35
|
-
}
|
|
36
|
-
__name(forwardApproval, "forwardApproval");
|
|
37
|
-
function wrapConfirmWithBadge(original, teammateName, respond, _teammateColor) {
|
|
38
|
-
return {
|
|
39
|
-
...original,
|
|
40
|
-
title: `[${teammateName}] ${original.title}`,
|
|
41
|
-
onConfirm: /* @__PURE__ */ __name(async (outcome, payload) => {
|
|
42
|
-
await respond(outcome, payload);
|
|
43
|
-
}, "onConfirm")
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
__name(wrapConfirmWithBadge, "wrapConfirmWithBadge");
|
|
47
|
-
|
|
48
|
-
export {
|
|
49
|
-
registerLeader,
|
|
50
|
-
getLeader,
|
|
51
|
-
unregisterLeader,
|
|
52
|
-
forwardApproval,
|
|
53
|
-
wrapConfirmWithBadge
|
|
54
|
-
};
|
|
55
|
-
/**
|
|
56
|
-
* @license
|
|
57
|
-
* Copyright 2025 Qwen
|
|
58
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
59
|
-
*/
|
package/chunks/chunk-XBFVXFB2.js
DELETED
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
// Force strict mode and setup for ESM
|
|
2
|
-
"use strict";
|
|
3
|
-
import {
|
|
4
|
-
INBOXES_DIR,
|
|
5
|
-
LEADER_NAME,
|
|
6
|
-
TASKS_DIR,
|
|
7
|
-
TEAMMATE_COLORS,
|
|
8
|
-
TEAMS_DIR,
|
|
9
|
-
TEAM_CONFIG_FILENAME
|
|
10
|
-
} from "./chunk-LD2XBG6Z.js";
|
|
11
|
-
import {
|
|
12
|
-
atomicWriteJSON
|
|
13
|
-
} from "./chunk-UAMOBVVW.js";
|
|
14
|
-
import {
|
|
15
|
-
Storage,
|
|
16
|
-
isNodeError
|
|
17
|
-
} from "./chunk-JXAZUMDW.js";
|
|
18
|
-
import {
|
|
19
|
-
init_esbuild_shims
|
|
20
|
-
} from "./chunk-A4BMJM77.js";
|
|
21
|
-
import {
|
|
22
|
-
__name
|
|
23
|
-
} from "./chunk-J2S4EL5Y.js";
|
|
24
|
-
|
|
25
|
-
// packages/core/src/agents/team/teamHelpers.ts
|
|
26
|
-
init_esbuild_shims();
|
|
27
|
-
import * as fs from "node:fs/promises";
|
|
28
|
-
import * as path from "node:path";
|
|
29
|
-
function getTeamsRootDir() {
|
|
30
|
-
return path.join(Storage.getGlobalQwenDir(), TEAMS_DIR);
|
|
31
|
-
}
|
|
32
|
-
__name(getTeamsRootDir, "getTeamsRootDir");
|
|
33
|
-
function getTeamDir(teamName) {
|
|
34
|
-
return path.join(getTeamsRootDir(), teamName);
|
|
35
|
-
}
|
|
36
|
-
__name(getTeamDir, "getTeamDir");
|
|
37
|
-
function getTeamFilePath(teamName) {
|
|
38
|
-
return path.join(getTeamDir(teamName), TEAM_CONFIG_FILENAME);
|
|
39
|
-
}
|
|
40
|
-
__name(getTeamFilePath, "getTeamFilePath");
|
|
41
|
-
function getInboxesDir(teamName) {
|
|
42
|
-
return path.join(getTeamDir(teamName), INBOXES_DIR);
|
|
43
|
-
}
|
|
44
|
-
__name(getInboxesDir, "getInboxesDir");
|
|
45
|
-
function getTasksDir(teamName) {
|
|
46
|
-
return path.join(Storage.getGlobalQwenDir(), TASKS_DIR, teamName);
|
|
47
|
-
}
|
|
48
|
-
__name(getTasksDir, "getTasksDir");
|
|
49
|
-
function sanitizeName(name) {
|
|
50
|
-
return name.toLowerCase().replace(/[^a-z0-9-]/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
51
|
-
}
|
|
52
|
-
__name(sanitizeName, "sanitizeName");
|
|
53
|
-
function formatAgentId(name, teamName) {
|
|
54
|
-
return `${sanitizeName(name)}@${sanitizeName(teamName)}`;
|
|
55
|
-
}
|
|
56
|
-
__name(formatAgentId, "formatAgentId");
|
|
57
|
-
function generateUniqueTeammateName(baseName, existingMembers) {
|
|
58
|
-
const sanitized = sanitizeName(baseName);
|
|
59
|
-
if (!sanitized) {
|
|
60
|
-
throw new Error(
|
|
61
|
-
`Teammate name "${baseName}" sanitizes to an empty string. Choose a name with at least one alphanumeric character.`
|
|
62
|
-
);
|
|
63
|
-
}
|
|
64
|
-
if (sanitized === LEADER_NAME) {
|
|
65
|
-
throw new Error(
|
|
66
|
-
`"${LEADER_NAME}" is reserved for the team leader. Choose a different teammate name.`
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
const existingNames = new Set(existingMembers.map((m) => m.name));
|
|
70
|
-
if (existingNames.has(sanitized)) {
|
|
71
|
-
const existingList = [...existingNames].join(", ") || "<none>";
|
|
72
|
-
throw new Error(
|
|
73
|
-
`A teammate named "${sanitized}" already exists in this team (existing: ${existingList}). Choose a different name.`
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
return sanitized;
|
|
77
|
-
}
|
|
78
|
-
__name(generateUniqueTeammateName, "generateUniqueTeammateName");
|
|
79
|
-
function assignTeammateColor(existingMembers) {
|
|
80
|
-
const usedColors = new Set(
|
|
81
|
-
existingMembers.map((m) => m.color).filter((c) => c !== void 0)
|
|
82
|
-
);
|
|
83
|
-
for (const color of TEAMMATE_COLORS) {
|
|
84
|
-
if (!usedColors.has(color)) {
|
|
85
|
-
return color;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
return TEAMMATE_COLORS[existingMembers.length % TEAMMATE_COLORS.length];
|
|
89
|
-
}
|
|
90
|
-
__name(assignTeammateColor, "assignTeammateColor");
|
|
91
|
-
function clearTeammateColors(members) {
|
|
92
|
-
return members.map((m) => {
|
|
93
|
-
const { color: _, ...rest } = m;
|
|
94
|
-
return rest;
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
__name(clearTeammateColors, "clearTeammateColors");
|
|
98
|
-
function setMemberActive(members, agentId, isActive) {
|
|
99
|
-
return members.map((m) => m.agentId === agentId ? { ...m, isActive } : m);
|
|
100
|
-
}
|
|
101
|
-
__name(setMemberActive, "setMemberActive");
|
|
102
|
-
function findMemberById(members, agentId) {
|
|
103
|
-
return members.find((m) => m.agentId === agentId);
|
|
104
|
-
}
|
|
105
|
-
__name(findMemberById, "findMemberById");
|
|
106
|
-
function findMemberByName(members, name) {
|
|
107
|
-
const sanitized = sanitizeName(name);
|
|
108
|
-
return members.find((m) => m.name === sanitized);
|
|
109
|
-
}
|
|
110
|
-
__name(findMemberByName, "findMemberByName");
|
|
111
|
-
async function readTeamFile(teamName) {
|
|
112
|
-
const filePath = getTeamFilePath(teamName);
|
|
113
|
-
try {
|
|
114
|
-
const raw = await fs.readFile(filePath, "utf-8");
|
|
115
|
-
return JSON.parse(raw);
|
|
116
|
-
} catch (err) {
|
|
117
|
-
if (isNodeError(err) && err.code === "ENOENT") {
|
|
118
|
-
return void 0;
|
|
119
|
-
}
|
|
120
|
-
throw err;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
__name(readTeamFile, "readTeamFile");
|
|
124
|
-
async function writeTeamFile(teamName, teamFile) {
|
|
125
|
-
const filePath = getTeamFilePath(teamName);
|
|
126
|
-
await fs.mkdir(path.dirname(filePath), { recursive: true });
|
|
127
|
-
await atomicWriteJSON(filePath, teamFile);
|
|
128
|
-
}
|
|
129
|
-
__name(writeTeamFile, "writeTeamFile");
|
|
130
|
-
async function createTeamFile(teamName, teamFile) {
|
|
131
|
-
const filePath = getTeamFilePath(teamName);
|
|
132
|
-
await fs.mkdir(path.dirname(filePath), { recursive: true });
|
|
133
|
-
await fs.writeFile(filePath, JSON.stringify(teamFile, null, 2) + "\n", {
|
|
134
|
-
encoding: "utf-8",
|
|
135
|
-
flag: "wx"
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
__name(createTeamFile, "createTeamFile");
|
|
139
|
-
function isPidAlive(pid) {
|
|
140
|
-
try {
|
|
141
|
-
process.kill(pid, 0);
|
|
142
|
-
return true;
|
|
143
|
-
} catch (err) {
|
|
144
|
-
return isNodeError(err) && err.code === "EPERM";
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
__name(isPidAlive, "isPidAlive");
|
|
148
|
-
async function tryReclaimStaleTeam(teamName) {
|
|
149
|
-
let existing;
|
|
150
|
-
try {
|
|
151
|
-
existing = await readTeamFile(teamName);
|
|
152
|
-
} catch {
|
|
153
|
-
return false;
|
|
154
|
-
}
|
|
155
|
-
if (!existing) {
|
|
156
|
-
await deleteTeamDirs(teamName);
|
|
157
|
-
return true;
|
|
158
|
-
}
|
|
159
|
-
if (typeof existing.leadPid !== "number" || existing.leadPid <= 0) {
|
|
160
|
-
return false;
|
|
161
|
-
}
|
|
162
|
-
if (existing.leadPid !== process.pid && isPidAlive(existing.leadPid)) {
|
|
163
|
-
return false;
|
|
164
|
-
}
|
|
165
|
-
await deleteTeamDirs(teamName);
|
|
166
|
-
return true;
|
|
167
|
-
}
|
|
168
|
-
__name(tryReclaimStaleTeam, "tryReclaimStaleTeam");
|
|
169
|
-
async function deleteTeamDirs(teamName) {
|
|
170
|
-
const teamDir = getTeamDir(teamName);
|
|
171
|
-
const tasksDir = getTasksDir(teamName);
|
|
172
|
-
await Promise.allSettled([
|
|
173
|
-
fs.rm(teamDir, { recursive: true, force: true }),
|
|
174
|
-
fs.rm(tasksDir, { recursive: true, force: true })
|
|
175
|
-
]);
|
|
176
|
-
}
|
|
177
|
-
__name(deleteTeamDirs, "deleteTeamDirs");
|
|
178
|
-
async function listTeamNames() {
|
|
179
|
-
const teamsRoot = getTeamsRootDir();
|
|
180
|
-
try {
|
|
181
|
-
const entries = await fs.readdir(teamsRoot, {
|
|
182
|
-
withFileTypes: true
|
|
183
|
-
});
|
|
184
|
-
return entries.filter((e) => e.isDirectory()).map((e) => e.name);
|
|
185
|
-
} catch {
|
|
186
|
-
return [];
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
__name(listTeamNames, "listTeamNames");
|
|
190
|
-
|
|
191
|
-
export {
|
|
192
|
-
getTeamsRootDir,
|
|
193
|
-
getTeamDir,
|
|
194
|
-
getTeamFilePath,
|
|
195
|
-
getInboxesDir,
|
|
196
|
-
getTasksDir,
|
|
197
|
-
sanitizeName,
|
|
198
|
-
formatAgentId,
|
|
199
|
-
generateUniqueTeammateName,
|
|
200
|
-
assignTeammateColor,
|
|
201
|
-
clearTeammateColors,
|
|
202
|
-
setMemberActive,
|
|
203
|
-
findMemberById,
|
|
204
|
-
findMemberByName,
|
|
205
|
-
readTeamFile,
|
|
206
|
-
writeTeamFile,
|
|
207
|
-
createTeamFile,
|
|
208
|
-
tryReclaimStaleTeam,
|
|
209
|
-
deleteTeamDirs,
|
|
210
|
-
listTeamNames
|
|
211
|
-
};
|
|
212
|
-
/**
|
|
213
|
-
* @license
|
|
214
|
-
* Copyright 2025 Qwen
|
|
215
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
216
|
-
*/
|
|
@@ -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,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
|
-
*/
|