@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
|
@@ -7,43 +7,43 @@ import {
|
|
|
7
7
|
buildLongRunningForegroundHint,
|
|
8
8
|
detectBlockedSleepPattern,
|
|
9
9
|
parseNumstat
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-IWAYOW5Q.js";
|
|
11
11
|
import "./chunk-K5PGHDBN.js";
|
|
12
12
|
import "./chunk-SKBPNJEW.js";
|
|
13
|
+
import "./chunk-HLPLOD42.js";
|
|
13
14
|
import "./chunk-O4PICXES.js";
|
|
14
15
|
import "./chunk-TW522KN6.js";
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-3DHXZ6EV.js";
|
|
17
|
+
import "./chunk-XBY7E2FX.js";
|
|
18
|
+
import "./chunk-J5MDQKJL.js";
|
|
18
19
|
import "./chunk-MLZQVCF3.js";
|
|
19
|
-
import "./chunk-PAEBHDIO.js";
|
|
20
20
|
import "./chunk-LD2XBG6Z.js";
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-OHEGWO4L.js";
|
|
22
|
+
import "./chunk-SNGELLWX.js";
|
|
23
23
|
import "./chunk-77WXWU44.js";
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-ZK4AMNIU.js";
|
|
24
|
+
import "./chunk-A7B4ISQP.js";
|
|
25
|
+
import "./chunk-6YIUGZTC.js";
|
|
27
26
|
import "./chunk-3PJXIDKI.js";
|
|
28
27
|
import "./chunk-UWCTAVOD.js";
|
|
29
28
|
import "./chunk-OFEVLU4C.js";
|
|
30
|
-
import "./chunk-
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-
|
|
33
|
-
import "./chunk-
|
|
34
|
-
import "./chunk-
|
|
35
|
-
import "./chunk-
|
|
36
|
-
import "./chunk-
|
|
37
|
-
import "./chunk-
|
|
38
|
-
import "./chunk-
|
|
39
|
-
import "./chunk-
|
|
40
|
-
import "./chunk-
|
|
29
|
+
import "./chunk-3HTIVKZE.js";
|
|
30
|
+
import "./chunk-IDX6COTE.js";
|
|
31
|
+
import "./chunk-BIVG75CP.js";
|
|
32
|
+
import "./chunk-XV4HCEVI.js";
|
|
33
|
+
import "./chunk-2Y5SYSD3.js";
|
|
34
|
+
import "./chunk-SEGYWKIH.js";
|
|
35
|
+
import "./chunk-64WXLC72.js";
|
|
36
|
+
import "./chunk-B7HXHOHU.js";
|
|
37
|
+
import "./chunk-EYENRK4D.js";
|
|
38
|
+
import "./chunk-M6VTDSVR.js";
|
|
39
|
+
import "./chunk-55ZMG67I.js";
|
|
40
|
+
import "./chunk-H6BD2ELD.js";
|
|
41
41
|
import "./chunk-5IFG2VC4.js";
|
|
42
|
-
import "./chunk-
|
|
42
|
+
import "./chunk-HR7SV7AY.js";
|
|
43
43
|
import "./chunk-ZERZSAZL.js";
|
|
44
44
|
import "./chunk-QN5NZ3UQ.js";
|
|
45
45
|
import "./chunk-BR4QREVK.js";
|
|
46
|
-
import "./chunk-
|
|
46
|
+
import "./chunk-Z2Z3GUXZ.js";
|
|
47
47
|
import "./chunk-A4BMJM77.js";
|
|
48
48
|
import "./chunk-J2S4EL5Y.js";
|
|
49
49
|
export {
|
|
@@ -3,38 +3,38 @@
|
|
|
3
3
|
import {
|
|
4
4
|
applySkillAllowedTools,
|
|
5
5
|
buildSkillLlmContent,
|
|
6
|
-
|
|
6
|
+
collectAvailableSkillEntries,
|
|
7
7
|
registerSkillHooks
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-OHEGWO4L.js";
|
|
9
|
+
import "./chunk-SNGELLWX.js";
|
|
10
10
|
import {
|
|
11
11
|
SkillLaunchEvent,
|
|
12
12
|
logSkillLaunch
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-6YIUGZTC.js";
|
|
14
14
|
import "./chunk-3PJXIDKI.js";
|
|
15
15
|
import "./chunk-UWCTAVOD.js";
|
|
16
16
|
import "./chunk-OFEVLU4C.js";
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-3HTIVKZE.js";
|
|
18
|
+
import "./chunk-IDX6COTE.js";
|
|
19
|
+
import "./chunk-BIVG75CP.js";
|
|
20
20
|
import {
|
|
21
21
|
BaseDeclarativeTool,
|
|
22
22
|
BaseToolInvocation,
|
|
23
23
|
ToolDisplayNames,
|
|
24
24
|
ToolNames
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import "./chunk-
|
|
29
|
-
import "./chunk-
|
|
25
|
+
} from "./chunk-XV4HCEVI.js";
|
|
26
|
+
import "./chunk-B7HXHOHU.js";
|
|
27
|
+
import "./chunk-M6VTDSVR.js";
|
|
28
|
+
import "./chunk-55ZMG67I.js";
|
|
29
|
+
import "./chunk-H6BD2ELD.js";
|
|
30
30
|
import "./chunk-5IFG2VC4.js";
|
|
31
31
|
import {
|
|
32
32
|
createDebugLogger
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-HR7SV7AY.js";
|
|
34
34
|
import "./chunk-ZERZSAZL.js";
|
|
35
35
|
import "./chunk-QN5NZ3UQ.js";
|
|
36
36
|
import "./chunk-BR4QREVK.js";
|
|
37
|
-
import "./chunk-
|
|
37
|
+
import "./chunk-Z2Z3GUXZ.js";
|
|
38
38
|
import {
|
|
39
39
|
init_esbuild_shims
|
|
40
40
|
} from "./chunk-A4BMJM77.js";
|
|
@@ -46,6 +46,31 @@ import {
|
|
|
46
46
|
init_esbuild_shims();
|
|
47
47
|
import path from "path";
|
|
48
48
|
var debugLogger = createDebugLogger("SKILL");
|
|
49
|
+
var SKILL_TOOL_DESCRIPTION = `Execute a skill within the main conversation
|
|
50
|
+
|
|
51
|
+
<skills_instructions>
|
|
52
|
+
When users ask you to perform tasks, check if any of the available skills can help complete the task more effectively. Skills provide specialized capabilities and domain knowledge.
|
|
53
|
+
|
|
54
|
+
How to invoke:
|
|
55
|
+
- Use this tool with the skill name only (no arguments)
|
|
56
|
+
- Examples:
|
|
57
|
+
- \`skill: "pdf"\` - invoke the pdf skill
|
|
58
|
+
- \`skill: "xlsx"\` - invoke the xlsx skill
|
|
59
|
+
- \`skill: "ms-office-suite:pdf"\` - invoke using fully qualified name
|
|
60
|
+
- \`skill: "mcp-prompt", args: "topic"\` - invoke a model-invocable command with arguments
|
|
61
|
+
|
|
62
|
+
Important:
|
|
63
|
+
- Available skills are listed in <system-reminder> messages in the conversation; only use skills listed there.
|
|
64
|
+
- When a skill is relevant, you must invoke this tool IMMEDIATELY as your first action
|
|
65
|
+
- NEVER just announce or mention a skill in your text response without actually calling this tool
|
|
66
|
+
- This is a BLOCKING REQUIREMENT: invoke the relevant Skill tool BEFORE generating any other response about the task
|
|
67
|
+
- Do not invoke a skill that is already running
|
|
68
|
+
- Do not use this tool for built-in CLI commands (like /help, /clear, etc.)
|
|
69
|
+
- When executing scripts or loading referenced files, ALWAYS resolve absolute paths from skill's base directory. Examples:
|
|
70
|
+
- \`bash scripts/init.sh\` -> \`bash /path/to/skill/scripts/init.sh\`
|
|
71
|
+
- \`python scripts/helper.py\` -> \`python /path/to/skill/scripts/helper.py\`
|
|
72
|
+
- \`reference.md\` -> \`/path/to/skill/reference.md\`
|
|
73
|
+
</skills_instructions>`;
|
|
49
74
|
var SkillTool = class _SkillTool extends BaseDeclarativeTool {
|
|
50
75
|
constructor(config) {
|
|
51
76
|
const initialSchema = {
|
|
@@ -67,8 +92,8 @@ var SkillTool = class _SkillTool extends BaseDeclarativeTool {
|
|
|
67
92
|
super(
|
|
68
93
|
_SkillTool.Name,
|
|
69
94
|
ToolDisplayNames.SKILL,
|
|
70
|
-
|
|
71
|
-
//
|
|
95
|
+
SKILL_TOOL_DESCRIPTION,
|
|
96
|
+
// Static; live skill list is injected via system-reminders.
|
|
72
97
|
"read" /* Read */,
|
|
73
98
|
initialSchema,
|
|
74
99
|
false,
|
|
@@ -105,115 +130,41 @@ var SkillTool = class _SkillTool extends BaseDeclarativeTool {
|
|
|
105
130
|
// SkillTool instances (subagents share the parent's SkillManager) can
|
|
106
131
|
// detach their listener at teardown — without this the SkillManager
|
|
107
132
|
// accumulates listeners across subagent lifetimes, and each path
|
|
108
|
-
// activation would serialize through every stale listener's
|
|
109
|
-
// refreshSkills / setTools round-trip.
|
|
133
|
+
// activation would serialize through every stale listener's refreshSkills run.
|
|
110
134
|
removeChangeListener;
|
|
111
135
|
/**
|
|
112
|
-
*
|
|
113
|
-
*
|
|
136
|
+
* Refreshes the in-memory runtime sets — `availableSkills`,
|
|
137
|
+
* `pendingConditionalSkillNames`, `modelInvocableCommands` — that back
|
|
138
|
+
* `validateToolParams` / `execute`. Invoked on construction and whenever the
|
|
139
|
+
* SkillManager fires a change (skill-file edit, conditional activation, config
|
|
140
|
+
* toggle, or MCP-prompt provider change).
|
|
141
|
+
*
|
|
142
|
+
* It deliberately does NOT mutate the tool declaration or call
|
|
143
|
+
* `geminiClient.setTools()`. The Skill tool's description is static
|
|
144
|
+
* (`SKILL_TOOL_DESCRIPTION`), so the skill set no longer affects the tools
|
|
145
|
+
* block — and the tools block is the front of the tools → system → messages
|
|
146
|
+
* prompt-cache prefix, where any byte change invalidates the whole cached
|
|
147
|
+
* prefix. These runtime sets are in-memory only and never serialized into a
|
|
148
|
+
* request, so refreshing them is prompt-cache-neutral. The model's view of the
|
|
149
|
+
* available skills comes from the `<available_skills>` snapshot in the startup
|
|
150
|
+
* prelude plus per-turn `<system-reminder>` deltas.
|
|
114
151
|
*/
|
|
115
152
|
async refreshSkills() {
|
|
116
153
|
try {
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
this.availableSkills = allSkills.filter(
|
|
121
|
-
(s) => !s.disableModelInvocation && this.skillManager.isSkillActive(s) && !isDisabled(s.name)
|
|
154
|
+
const collected = await collectAvailableSkillEntries(
|
|
155
|
+
this.skillManager,
|
|
156
|
+
this.config
|
|
122
157
|
);
|
|
123
|
-
this.
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
).map((s) => s.name)
|
|
127
|
-
);
|
|
128
|
-
const provider = this.config.getModelInvocableCommandsProvider();
|
|
129
|
-
const allCommands = provider ? provider() : [];
|
|
130
|
-
const fileBasedSkillNames = new Set(
|
|
131
|
-
allSkills.filter((s) => !s.disableModelInvocation && !isDisabled(s.name)).map((s) => s.name)
|
|
132
|
-
);
|
|
133
|
-
this.modelInvocableCommands = allCommands.filter(
|
|
134
|
-
(cmd) => !fileBasedSkillNames.has(cmd.name)
|
|
135
|
-
);
|
|
136
|
-
this.updateDescriptionAndSchema();
|
|
158
|
+
this.availableSkills = collected.availableSkills;
|
|
159
|
+
this.pendingConditionalSkillNames = collected.pendingConditionalSkillNames;
|
|
160
|
+
this.modelInvocableCommands = collected.modelInvocableCommands;
|
|
137
161
|
} catch (error) {
|
|
138
162
|
debugLogger.warn("Failed to load skills for Skills tool:", error);
|
|
139
163
|
this.availableSkills = [];
|
|
140
164
|
this.pendingConditionalSkillNames = /* @__PURE__ */ new Set();
|
|
141
165
|
this.modelInvocableCommands = [];
|
|
142
|
-
this.updateDescriptionAndSchema();
|
|
143
|
-
} finally {
|
|
144
|
-
const geminiClient = this.config.getGeminiClient();
|
|
145
|
-
if (geminiClient) {
|
|
146
|
-
await geminiClient.setTools();
|
|
147
|
-
}
|
|
148
166
|
}
|
|
149
167
|
}
|
|
150
|
-
/**
|
|
151
|
-
* Updates the tool's description and schema based on available skills and
|
|
152
|
-
* model-invocable commands (e.g. bundled skills, file commands, MCP prompts).
|
|
153
|
-
*/
|
|
154
|
-
updateDescriptionAndSchema() {
|
|
155
|
-
const allSkillEntries = [];
|
|
156
|
-
for (const skill of this.availableSkills) {
|
|
157
|
-
const descText = `${escapeXml(skill.description)}${skill.whenToUse ? ` \u2014 ${escapeXml(skill.whenToUse)}` : ""} (${skill.level})`;
|
|
158
|
-
allSkillEntries.push(`<skill>
|
|
159
|
-
<name>
|
|
160
|
-
${escapeXml(skill.name)}
|
|
161
|
-
</name>
|
|
162
|
-
<description>
|
|
163
|
-
${descText}
|
|
164
|
-
</description>
|
|
165
|
-
<location>
|
|
166
|
-
${skill.level}
|
|
167
|
-
</location>
|
|
168
|
-
</skill>`);
|
|
169
|
-
}
|
|
170
|
-
for (const cmd of this.modelInvocableCommands) {
|
|
171
|
-
allSkillEntries.push(`<skill>
|
|
172
|
-
<name>
|
|
173
|
-
${escapeXml(cmd.name)}
|
|
174
|
-
</name>
|
|
175
|
-
<description>
|
|
176
|
-
${escapeXml(cmd.description)}
|
|
177
|
-
</description>
|
|
178
|
-
</skill>`);
|
|
179
|
-
}
|
|
180
|
-
let skillDescriptions = "";
|
|
181
|
-
if (allSkillEntries.length === 0) {
|
|
182
|
-
skillDescriptions = "No skills are currently configured. Skills can be created by adding directories with SKILL.md files to .qwen/skills/ or ~/.qwen/skills/.";
|
|
183
|
-
} else {
|
|
184
|
-
skillDescriptions = allSkillEntries.join("\n");
|
|
185
|
-
}
|
|
186
|
-
const baseDescription = `Execute a skill within the main conversation
|
|
187
|
-
|
|
188
|
-
<skills_instructions>
|
|
189
|
-
When users ask you to perform tasks, check if any of the available skills below can help complete the task more effectively. Skills provide specialized capabilities and domain knowledge.
|
|
190
|
-
|
|
191
|
-
How to invoke:
|
|
192
|
-
- Use this tool with the skill name only (no arguments)
|
|
193
|
-
- Examples:
|
|
194
|
-
- \`skill: "pdf"\` - invoke the pdf skill
|
|
195
|
-
- \`skill: "xlsx"\` - invoke the xlsx skill
|
|
196
|
-
- \`skill: "ms-office-suite:pdf"\` - invoke using fully qualified name
|
|
197
|
-
- \`skill: "mcp-prompt", args: "topic"\` - invoke a model-invocable command with arguments
|
|
198
|
-
|
|
199
|
-
Important:
|
|
200
|
-
- When a skill is relevant, you must invoke this tool IMMEDIATELY as your first action
|
|
201
|
-
- NEVER just announce or mention a skill in your text response without actually calling this tool
|
|
202
|
-
- This is a BLOCKING REQUIREMENT: invoke the relevant Skill tool BEFORE generating any other response about the task
|
|
203
|
-
- Only use skills listed in <available_skills> below
|
|
204
|
-
- Do not invoke a skill that is already running
|
|
205
|
-
- Do not use this tool for built-in CLI commands (like /help, /clear, etc.)
|
|
206
|
-
- When executing scripts or loading referenced files, ALWAYS resolve absolute paths from skill's base directory. Examples:
|
|
207
|
-
- \`bash scripts/init.sh\` -> \`bash /path/to/skill/scripts/init.sh\`
|
|
208
|
-
- \`python scripts/helper.py\` -> \`python /path/to/skill/scripts/helper.py\`
|
|
209
|
-
- \`reference.md\` -> \`/path/to/skill/reference.md\`
|
|
210
|
-
</skills_instructions>
|
|
211
|
-
|
|
212
|
-
<available_skills>
|
|
213
|
-
${skillDescriptions}
|
|
214
|
-
</available_skills>`;
|
|
215
|
-
this.description = baseDescription;
|
|
216
|
-
}
|
|
217
168
|
validateToolParams(params) {
|
|
218
169
|
if (!params.skill || typeof params.skill !== "string" || params.skill.trim() === "") {
|
|
219
170
|
return 'Parameter "skill" must be a non-empty string.';
|
|
@@ -282,7 +233,7 @@ ${skillDescriptions}
|
|
|
282
233
|
* SkillManager would accumulate one stale listener per subagent
|
|
283
234
|
* lifetime — and `notifyChangeListeners` is now `await`-ed
|
|
284
235
|
* sequentially, so each path activation would serialize through every
|
|
285
|
-
* accumulated listener's refreshSkills
|
|
236
|
+
* accumulated listener's refreshSkills run.
|
|
286
237
|
*/
|
|
287
238
|
dispose() {
|
|
288
239
|
this.removeChangeListener();
|