@mmmbuto/qwen-code-termux 0.16.1-termux → 0.18.0-termux
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/README.md +79 -109
- package/bundled/new-app/SKILL.md +22 -0
- package/bundled/qc-helper/SKILL.md +29 -24
- package/bundled/qc-helper/docs/_meta.ts +1 -0
- package/bundled/qc-helper/docs/configuration/_meta.ts +0 -3
- package/bundled/qc-helper/docs/configuration/settings.md +37 -31
- package/bundled/qc-helper/docs/configuration/themes.md +39 -0
- package/bundled/qc-helper/docs/features/_meta.ts +1 -3
- package/bundled/qc-helper/docs/features/approval-mode.md +35 -35
- package/bundled/qc-helper/docs/features/auto-mode.md +54 -9
- package/bundled/qc-helper/docs/features/channels/_meta.ts +1 -0
- package/bundled/qc-helper/docs/features/channels/feishu.md +170 -0
- package/bundled/qc-helper/docs/features/commands.md +115 -35
- package/bundled/qc-helper/docs/features/followup-suggestions.md +2 -2
- package/bundled/qc-helper/docs/features/headless.md +32 -0
- package/bundled/qc-helper/docs/features/markdown-rendering.md +21 -1
- package/bundled/qc-helper/docs/features/memory.md +22 -5
- package/bundled/qc-helper/docs/features/scheduled-tasks.md +1 -1
- package/bundled/qc-helper/docs/features/status-line.md +168 -32
- package/bundled/qc-helper/docs/features/sub-agents.md +60 -0
- package/bundled/qc-helper/docs/features/worktree.md +345 -0
- package/bundled/qc-helper/docs/overview.md +4 -4
- package/bundled/qc-helper/docs/quickstart.md +4 -4
- package/bundled/qc-helper/docs/qwen-serve-deploy-local.md +221 -0
- package/bundled/qc-helper/docs/qwen-serve.md +234 -24
- package/bundled/qc-helper/docs/reference/keyboard-shortcuts.md +16 -0
- package/bundled/qc-helper/docs/support/Uninstall.md +19 -1
- package/bundled/qc-helper/docs/support/troubleshooting.md +2 -1
- package/bundled/simplify/SKILL.md +123 -0
- package/chunks/agent-IDS4HMOX.js +56 -0
- package/chunks/agent-headless-5Q2EUSPS.js +50 -0
- package/chunks/{anthropicContentGenerator-SSGKR6DO.js → anthropicContentGenerator-2HBRNQ3B.js} +52 -9
- package/chunks/{askUserQuestion-PJWUUXKN.js → askUserQuestion-75TDJVK2.js} +45 -3
- package/chunks/{ca-UZ7BANMN.js → ca-BARBRL6N.js} +89 -5
- package/chunks/{chunk-GGNTZ2NH.js → chunk-2Y5SYSD3.js} +368 -597
- package/chunks/{chunk-2LA2TREA.js → chunk-3AA2DK35.js} +1448 -207
- package/chunks/{chunk-I2V5WXHJ.js → chunk-3AUHFMSK.js} +80 -38
- package/chunks/chunk-3DHXZ6EV.js +241 -0
- package/chunks/{chunk-PR4T27R7.js → chunk-3HTIVKZE.js} +42 -8
- package/chunks/chunk-3HX5LZ6R.js +1798 -0
- package/chunks/chunk-3PJXIDKI.js +2517 -0
- package/chunks/{chunk-MYAKAFEC.js → chunk-55ZMG67I.js} +7451 -3517
- package/chunks/{chunk-66CXYE4B.js → chunk-5IFG2VC4.js} +293 -242
- package/chunks/chunk-64WXLC72.js +98 -0
- package/chunks/{chunk-C6WMLUNB.js → chunk-72LDN5PP.js} +1 -1
- package/chunks/{chunk-F23NCRJ2.js → chunk-A7B4ISQP.js} +1 -1
- package/chunks/chunk-B7HXHOHU.js +393 -0
- package/chunks/{chunk-XEGHDASV.js → chunk-D3RHSPAS.js} +435 -540
- package/chunks/{chunk-XKS5KBFJ.js → chunk-EYENRK4D.js} +694 -384
- package/chunks/chunk-H6BD2ELD.js +36 -0
- package/chunks/{chunk-XP27SJMH.js → chunk-HR7SV7AY.js} +79 -48
- package/chunks/{chunk-D5NTAHYL.js → chunk-IDX6COTE.js} +7 -2
- package/chunks/{chunk-SHT4VJWU.js → chunk-IWKSG2AR.js} +2 -2
- package/chunks/chunk-J37FGIOA.js +1623 -0
- package/chunks/chunk-J5MDQKJL.js +2230 -0
- package/chunks/{chunk-USE2VQ5P.js → chunk-JTQAQBTV.js} +21 -0
- package/chunks/{chunk-NCTLV2NB.js → chunk-KQJMQJPI.js} +1 -1
- package/chunks/{chunk-5FBA5XC2.js → chunk-KRIHGKNA.js} +1 -1
- package/chunks/chunk-LD2XBG6Z.js +102 -0
- package/chunks/{chunk-MAY32HXD.js → chunk-M6VTDSVR.js} +3 -1
- package/chunks/chunk-MRO43B25.js +30 -0
- package/chunks/{chunk-N4WOREMD.js → chunk-NVFMZBX2.js} +43 -3
- package/chunks/chunk-OHEGWO4L.js +264 -0
- package/chunks/{chunk-K6O2NBMF.js → chunk-OQ7NJIY7.js} +4604 -6397
- package/chunks/chunk-QQDPRDVW.js +25 -0
- package/chunks/{chunk-KXZ4TJB4.js → chunk-SEGYWKIH.js} +1 -1
- package/chunks/chunk-SKBPNJEW.js +45 -0
- package/chunks/{chunk-4AOCVI6J.js → chunk-SNGELLWX.js} +52 -6
- package/chunks/{chunk-3OCRHZA3.js → chunk-TD4OPI4T.js} +56742 -44104
- package/chunks/{chunk-DQ4QTG7E.js → chunk-VV4F63BD.js} +11 -11
- package/chunks/chunk-XBY7E2FX.js +605 -0
- package/chunks/{chunk-JKMBWLFB.js → chunk-YILFYI5W.js} +48 -26
- package/chunks/chunk-YOGAOMYB.js +159 -0
- package/chunks/{chunk-QWSRH265.js → chunk-Z2Z3GUXZ.js} +777 -776
- package/chunks/{chunk-SDHRQFOS.js → chunk-ZTZ4DDQE.js} +2 -2
- package/chunks/computer-use-W2TYQNEE.js +825 -0
- package/chunks/contextCommand-6FGX3A7J.js +52 -0
- package/chunks/{cron-create-3ZBBN7WB.js → cron-create-APL5LU6I.js} +3 -3
- package/chunks/{cron-delete-NAGKKIIG.js → cron-delete-4SBJSCN4.js} +3 -3
- package/chunks/{cron-list-PAGRXNAI.js → cron-list-2AMGOMVO.js} +3 -3
- package/chunks/{de-V4IE2OOZ.js → de-YGKK2BC4.js} +89 -5
- package/chunks/{devtools-TWVXEJQB.js → devtools-FM6GJPYG.js} +2 -1
- package/chunks/{dist-4L54HRX2.js → dist-4LXD6L6X.js} +24 -5
- package/chunks/dist-H6ONXVLG.js +94146 -0
- package/chunks/{dist-XKWIWPWQ.js → dist-KAZ3SEBX.js} +1083 -3856
- package/chunks/{dist-BXDUQ2QY.js → dist-PK7DFCAW.js} +1 -1
- package/chunks/{edit-NVO3FOAK.js → edit-ZCEZC264.js} +30 -22
- package/chunks/{en-HGJ2SPLM.js → en-DHGYHIHX.js} +127 -6
- package/chunks/{enter-worktree-UEBG4WFC.js → enter-worktree-BBHCFCHG.js} +30 -20
- package/chunks/enterPlanMode-3M6KTD3B.js +158 -0
- package/chunks/{exit-worktree-UZ3MAQZN.js → exit-worktree-73YPIEQO.js} +27 -19
- package/chunks/exitPlanMode-TYZM6BAE.js +703 -0
- package/chunks/{fr-CJULI7ZX.js → fr-JXBKPJKQ.js} +89 -5
- package/chunks/{geminiContentGenerator-3UZFXGNT.js → geminiContentGenerator-7N2V3VW2.js} +8 -6
- package/chunks/{getMachineId-bsd-JXOSIJV2.js → getMachineId-bsd-4CASPIU4.js} +4 -4
- package/chunks/{getMachineId-darwin-TE4QRR42.js → getMachineId-darwin-HPQPEMZR.js} +4 -4
- package/chunks/{getMachineId-linux-S3OL52XK.js → getMachineId-linux-AUARKYHL.js} +3 -3
- package/chunks/{getMachineId-unsupported-DWUSBAPX.js → getMachineId-unsupported-S32ZDA2T.js} +3 -3
- package/chunks/{getMachineId-win-AAC5P3AP.js → getMachineId-win-4EFLHYIJ.js} +4 -4
- package/chunks/{glob-KNHSFFFG.js → glob-5XBCPQ2A.js} +27 -19
- package/chunks/{grep-LACWDZW4.js → grep-VIUU3A7X.js} +30 -19
- package/chunks/{ja-L7CHRQEW.js → ja-TGPZSP2B.js} +89 -5
- package/chunks/{keychain-token-storage-335UOLJ6.js → keychain-token-storage-6IU6ORQN.js} +3 -3
- package/chunks/{ls-AGXQOKSG.js → ls-JRGYIGLY.js} +4 -4
- package/chunks/{lsp-UDMUHNPA.js → lsp-SHMKFOAC.js} +3 -3
- package/chunks/{monitor-ETKWPJEH.js → monitor-6R4LIJL5.js} +40 -25
- package/chunks/{multipart-parser-3QWGTLK3.js → multipart-parser-AJ4WASWR.js} +2 -2
- package/chunks/{notebook-edit-QJJLPNYT.js → notebook-edit-5E7ULDVQ.js} +28 -20
- package/chunks/{openaiContentGenerator-CNNN424U.js → openaiContentGenerator-ZVHFKM3O.js} +17 -14
- package/chunks/{pt-M6JULLEQ.js → pt-TIBG6BIO.js} +89 -5
- package/chunks/{qwenContentGenerator-BOLCGK3R.js → qwenContentGenerator-B2VTVSPJ.js} +31 -23
- package/chunks/{qwenOAuth2-EEJGROP7.js → qwenOAuth2-2KCKWDCF.js} +6 -4
- package/chunks/read-file-GIT7BCDR.js +27 -0
- package/chunks/ripGrep-MWKFVYMS.js +48 -0
- package/chunks/{ru-QILM4HBC.js → ru-JBCHCK4L.js} +89 -5
- package/chunks/scheduler-5VOOYGBH.js +308 -0
- package/chunks/send-message-4QNWQJF4.js +244 -0
- package/chunks/{serve-OLSI7WSR.js → serve-MN6HZBWN.js} +14262 -7414
- package/chunks/shell-NQZQGFM2.js +56 -0
- package/chunks/{skill-D6YRHTTI.js → skill-WCFW4644.js} +145 -119
- package/chunks/{src-TMOD5X6F.js → src-7XL4G4DC.js} +88 -46
- package/chunks/{src-4QH4FZ6I.js → src-IHA6DTUV.js} +452 -62
- package/chunks/{syntheticOutput-5PVFDDJ4.js → syntheticOutput-YTYS2ZMQ.js} +4 -4
- package/chunks/task-create-MPORPYN6.js +19 -0
- package/chunks/task-list-R2YDYPZT.js +151 -0
- package/chunks/{task-stop-AJKPSR6R.js → task-stop-SYWJYBCM.js} +3 -3
- package/chunks/task-update-E4NSLKMQ.js +408 -0
- package/chunks/team-create-7R7KA5IP.js +314 -0
- package/chunks/team-delete-25OIWUPN.js +116 -0
- package/chunks/{todoWrite-VLAUG4CA.js → todoWrite-4YHMIF4X.js} +16 -5
- package/chunks/{tool-search-MZGHUUKD.js → tool-search-YBRVZCLI.js} +29 -11
- package/chunks/{tts-notification-K3X7X7MN.js → tts-notification-7SOEMQK4.js} +5 -4
- package/chunks/{web-fetch-OILB464A.js → web-fetch-MFIRHIHI.js} +5 -5
- package/chunks/workflow-5RIKVCIE.js +960 -0
- package/chunks/{write-file-BIQAA57V.js → write-file-DMQTJZOM.js} +32 -24
- package/chunks/{zh-PWL2NKY3.js → zh-7H5OQC4I.js} +135 -11
- package/chunks/{zh-TW-S3YGWICZ.js → zh-TW-P4IDHD3M.js} +128 -11
- package/cli.js +45402 -20570
- package/examples/agent/agents/diary.md +86 -0
- package/examples/agent/qwen-extension.json +5 -0
- package/examples/commands/commands/fs/grep-code.md +3 -0
- package/examples/commands/qwen-extension.json +5 -0
- package/examples/context/QWEN.md +8 -0
- package/examples/context/qwen-extension.json +5 -0
- package/examples/mcp-server/example.ts +60 -0
- package/examples/mcp-server/package.json +18 -0
- package/examples/mcp-server/qwen-extension.json +12 -0
- package/examples/mcp-server/tsconfig.json +13 -0
- package/examples/skills/qwen-extension.json +5 -0
- package/examples/skills/skills/synonyms/SKILL.md +48 -0
- 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/ca.js +118 -5
- package/locales/de.js +117 -5
- package/locales/en.js +169 -7
- package/locales/fr.js +119 -5
- package/locales/ja.js +114 -5
- package/locales/pt.js +117 -5
- package/locales/ru.js +116 -5
- package/locales/zh-TW.js +161 -12
- package/locales/zh.js +169 -12
- package/package.json +4 -2
- package/scripts/postinstall.cjs +2 -1
- package/bundled/qc-helper/docs/features/checkpointing.md +0 -77
- package/chunks/agent-7ZN3CRHR.js +0 -48
- package/chunks/chunk-6PCB2DEF.js +0 -434
- package/chunks/chunk-EM6ETG2K.js +0 -60
- package/chunks/chunk-G7YTSRES.js +0 -150
- package/chunks/contextCommand-7IBASARL.js +0 -44
- package/chunks/exitPlanMode-PZAMWIRW.js +0 -227
- package/chunks/multipart-parser-IXGBIOIN.js +0 -384
- package/chunks/read-file-CCUEUFG2.js +0 -24
- package/chunks/ripGrep-TADOH2HK.js +0 -40
- package/chunks/send-message-YL44UZFC.js +0 -151
- package/chunks/shell-7KKKC5G7.js +0 -48
- package/chunks/src-IPWIHNMI.js +0 -1406
- package/chunks/undici-F6ZOXSS5.js +0 -8
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// Force strict mode and setup for ESM
|
|
2
|
+
"use strict";
|
|
3
|
+
import {
|
|
4
|
+
OUTPUT_UPDATE_INTERVAL_MS,
|
|
5
|
+
ShellTool,
|
|
6
|
+
ShellToolInvocation,
|
|
7
|
+
buildLongRunningForegroundHint,
|
|
8
|
+
detectBlockedSleepPattern,
|
|
9
|
+
parseNumstat
|
|
10
|
+
} from "./chunk-TD4OPI4T.js";
|
|
11
|
+
import "./chunk-K5PGHDBN.js";
|
|
12
|
+
import "./chunk-XBY7E2FX.js";
|
|
13
|
+
import "./chunk-SKBPNJEW.js";
|
|
14
|
+
import "./chunk-NVFMZBX2.js";
|
|
15
|
+
import "./chunk-O4PICXES.js";
|
|
16
|
+
import "./chunk-TW522KN6.js";
|
|
17
|
+
import "./chunk-3DHXZ6EV.js";
|
|
18
|
+
import "./chunk-J5MDQKJL.js";
|
|
19
|
+
import "./chunk-MLZQVCF3.js";
|
|
20
|
+
import "./chunk-LD2XBG6Z.js";
|
|
21
|
+
import "./chunk-OHEGWO4L.js";
|
|
22
|
+
import "./chunk-SNGELLWX.js";
|
|
23
|
+
import "./chunk-77WXWU44.js";
|
|
24
|
+
import "./chunk-A7B4ISQP.js";
|
|
25
|
+
import "./chunk-OQ7NJIY7.js";
|
|
26
|
+
import "./chunk-3PJXIDKI.js";
|
|
27
|
+
import "./chunk-UWCTAVOD.js";
|
|
28
|
+
import "./chunk-OFEVLU4C.js";
|
|
29
|
+
import "./chunk-3HTIVKZE.js";
|
|
30
|
+
import "./chunk-IDX6COTE.js";
|
|
31
|
+
import "./chunk-KQJMQJPI.js";
|
|
32
|
+
import "./chunk-D3RHSPAS.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
|
+
import "./chunk-5IFG2VC4.js";
|
|
42
|
+
import "./chunk-HR7SV7AY.js";
|
|
43
|
+
import "./chunk-ZERZSAZL.js";
|
|
44
|
+
import "./chunk-QN5NZ3UQ.js";
|
|
45
|
+
import "./chunk-BR4QREVK.js";
|
|
46
|
+
import "./chunk-Z2Z3GUXZ.js";
|
|
47
|
+
import "./chunk-A4BMJM77.js";
|
|
48
|
+
import "./chunk-J2S4EL5Y.js";
|
|
49
|
+
export {
|
|
50
|
+
OUTPUT_UPDATE_INTERVAL_MS,
|
|
51
|
+
ShellTool,
|
|
52
|
+
ShellToolInvocation,
|
|
53
|
+
buildLongRunningForegroundHint,
|
|
54
|
+
detectBlockedSleepPattern,
|
|
55
|
+
parseNumstat
|
|
56
|
+
};
|
|
@@ -1,36 +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
|
+
collectAvailableSkillEntries,
|
|
6
7
|
registerSkillHooks
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-OHEGWO4L.js";
|
|
9
|
+
import "./chunk-SNGELLWX.js";
|
|
9
10
|
import {
|
|
10
11
|
SkillLaunchEvent,
|
|
11
12
|
logSkillLaunch
|
|
12
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-OQ7NJIY7.js";
|
|
14
|
+
import "./chunk-3PJXIDKI.js";
|
|
13
15
|
import "./chunk-UWCTAVOD.js";
|
|
14
16
|
import "./chunk-OFEVLU4C.js";
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-MYAKAFEC.js";
|
|
19
|
-
import "./chunk-66CXYE4B.js";
|
|
20
|
-
import "./chunk-NCTLV2NB.js";
|
|
17
|
+
import "./chunk-3HTIVKZE.js";
|
|
18
|
+
import "./chunk-IDX6COTE.js";
|
|
19
|
+
import "./chunk-KQJMQJPI.js";
|
|
21
20
|
import {
|
|
22
21
|
BaseDeclarativeTool,
|
|
23
22
|
BaseToolInvocation,
|
|
24
23
|
ToolDisplayNames,
|
|
25
24
|
ToolNames
|
|
26
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-D3RHSPAS.js";
|
|
26
|
+
import "./chunk-B7HXHOHU.js";
|
|
27
|
+
import "./chunk-M6VTDSVR.js";
|
|
28
|
+
import "./chunk-55ZMG67I.js";
|
|
29
|
+
import "./chunk-H6BD2ELD.js";
|
|
30
|
+
import "./chunk-5IFG2VC4.js";
|
|
27
31
|
import {
|
|
28
32
|
createDebugLogger
|
|
29
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-HR7SV7AY.js";
|
|
30
34
|
import "./chunk-ZERZSAZL.js";
|
|
31
35
|
import "./chunk-QN5NZ3UQ.js";
|
|
32
36
|
import "./chunk-BR4QREVK.js";
|
|
33
|
-
import "./chunk-
|
|
37
|
+
import "./chunk-Z2Z3GUXZ.js";
|
|
34
38
|
import {
|
|
35
39
|
init_esbuild_shims
|
|
36
40
|
} from "./chunk-A4BMJM77.js";
|
|
@@ -42,6 +46,31 @@ import {
|
|
|
42
46
|
init_esbuild_shims();
|
|
43
47
|
import path from "path";
|
|
44
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>`;
|
|
45
74
|
var SkillTool = class _SkillTool extends BaseDeclarativeTool {
|
|
46
75
|
constructor(config) {
|
|
47
76
|
const initialSchema = {
|
|
@@ -49,7 +78,11 @@ var SkillTool = class _SkillTool extends BaseDeclarativeTool {
|
|
|
49
78
|
properties: {
|
|
50
79
|
skill: {
|
|
51
80
|
type: "string",
|
|
52
|
-
description: 'The skill
|
|
81
|
+
description: 'The skill or command name. E.g., "pdf" or "xlsx"'
|
|
82
|
+
},
|
|
83
|
+
args: {
|
|
84
|
+
type: "string",
|
|
85
|
+
description: "Optional arguments for model-invocable slash commands."
|
|
53
86
|
}
|
|
54
87
|
},
|
|
55
88
|
required: ["skill"],
|
|
@@ -59,8 +92,8 @@ var SkillTool = class _SkillTool extends BaseDeclarativeTool {
|
|
|
59
92
|
super(
|
|
60
93
|
_SkillTool.Name,
|
|
61
94
|
ToolDisplayNames.SKILL,
|
|
62
|
-
|
|
63
|
-
//
|
|
95
|
+
SKILL_TOOL_DESCRIPTION,
|
|
96
|
+
// Static; live skill list is injected via system-reminders.
|
|
64
97
|
"read" /* Read */,
|
|
65
98
|
initialSchema,
|
|
66
99
|
false,
|
|
@@ -97,116 +130,48 @@ var SkillTool = class _SkillTool extends BaseDeclarativeTool {
|
|
|
97
130
|
// SkillTool instances (subagents share the parent's SkillManager) can
|
|
98
131
|
// detach their listener at teardown — without this the SkillManager
|
|
99
132
|
// accumulates listeners across subagent lifetimes, and each path
|
|
100
|
-
// activation would serialize through every stale listener's
|
|
101
|
-
// refreshSkills / setTools round-trip.
|
|
133
|
+
// activation would serialize through every stale listener's refreshSkills run.
|
|
102
134
|
removeChangeListener;
|
|
103
135
|
/**
|
|
104
|
-
*
|
|
105
|
-
*
|
|
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.
|
|
106
151
|
*/
|
|
107
152
|
async refreshSkills() {
|
|
108
153
|
try {
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
);
|
|
113
|
-
this.pendingConditionalSkillNames = new Set(
|
|
114
|
-
allSkills.filter(
|
|
115
|
-
(s) => !s.disableModelInvocation && s.paths && s.paths.length > 0 && !this.skillManager.isSkillActive(s)
|
|
116
|
-
).map((s) => s.name)
|
|
117
|
-
);
|
|
118
|
-
const provider = this.config.getModelInvocableCommandsProvider();
|
|
119
|
-
const allCommands = provider ? provider() : [];
|
|
120
|
-
const fileBasedSkillNames = new Set(
|
|
121
|
-
allSkills.filter((s) => !s.disableModelInvocation).map((s) => s.name)
|
|
154
|
+
const collected = await collectAvailableSkillEntries(
|
|
155
|
+
this.skillManager,
|
|
156
|
+
this.config
|
|
122
157
|
);
|
|
123
|
-
this.
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
this.updateDescriptionAndSchema();
|
|
158
|
+
this.availableSkills = collected.availableSkills;
|
|
159
|
+
this.pendingConditionalSkillNames = collected.pendingConditionalSkillNames;
|
|
160
|
+
this.modelInvocableCommands = collected.modelInvocableCommands;
|
|
127
161
|
} catch (error) {
|
|
128
162
|
debugLogger.warn("Failed to load skills for Skills tool:", error);
|
|
129
163
|
this.availableSkills = [];
|
|
130
164
|
this.pendingConditionalSkillNames = /* @__PURE__ */ new Set();
|
|
131
165
|
this.modelInvocableCommands = [];
|
|
132
|
-
this.updateDescriptionAndSchema();
|
|
133
|
-
} finally {
|
|
134
|
-
const geminiClient = this.config.getGeminiClient();
|
|
135
|
-
if (geminiClient) {
|
|
136
|
-
await geminiClient.setTools();
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
/**
|
|
141
|
-
* Updates the tool's description and schema based on available skills and
|
|
142
|
-
* model-invocable commands (e.g. bundled skills, file commands, MCP prompts).
|
|
143
|
-
*/
|
|
144
|
-
updateDescriptionAndSchema() {
|
|
145
|
-
const allSkillEntries = [];
|
|
146
|
-
for (const skill of this.availableSkills) {
|
|
147
|
-
const descText = `${escapeXml(skill.description)}${skill.whenToUse ? ` \u2014 ${escapeXml(skill.whenToUse)}` : ""} (${skill.level})`;
|
|
148
|
-
allSkillEntries.push(`<skill>
|
|
149
|
-
<name>
|
|
150
|
-
${escapeXml(skill.name)}
|
|
151
|
-
</name>
|
|
152
|
-
<description>
|
|
153
|
-
${descText}
|
|
154
|
-
</description>
|
|
155
|
-
<location>
|
|
156
|
-
${skill.level}
|
|
157
|
-
</location>
|
|
158
|
-
</skill>`);
|
|
159
|
-
}
|
|
160
|
-
for (const cmd of this.modelInvocableCommands) {
|
|
161
|
-
allSkillEntries.push(`<skill>
|
|
162
|
-
<name>
|
|
163
|
-
${escapeXml(cmd.name)}
|
|
164
|
-
</name>
|
|
165
|
-
<description>
|
|
166
|
-
${escapeXml(cmd.description)}
|
|
167
|
-
</description>
|
|
168
|
-
</skill>`);
|
|
169
166
|
}
|
|
170
|
-
let skillDescriptions = "";
|
|
171
|
-
if (allSkillEntries.length === 0) {
|
|
172
|
-
skillDescriptions = "No skills are currently configured. Skills can be created by adding directories with SKILL.md files to .qwen/skills/ or ~/.qwen/skills/.";
|
|
173
|
-
} else {
|
|
174
|
-
skillDescriptions = allSkillEntries.join("\n");
|
|
175
|
-
}
|
|
176
|
-
const baseDescription = `Execute a skill within the main conversation
|
|
177
|
-
|
|
178
|
-
<skills_instructions>
|
|
179
|
-
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.
|
|
180
|
-
|
|
181
|
-
How to invoke:
|
|
182
|
-
- Use this tool with the skill name only (no arguments)
|
|
183
|
-
- Examples:
|
|
184
|
-
- \`skill: "pdf"\` - invoke the pdf skill
|
|
185
|
-
- \`skill: "xlsx"\` - invoke the xlsx skill
|
|
186
|
-
- \`skill: "ms-office-suite:pdf"\` - invoke using fully qualified name
|
|
187
|
-
|
|
188
|
-
Important:
|
|
189
|
-
- When a skill is relevant, you must invoke this tool IMMEDIATELY as your first action
|
|
190
|
-
- NEVER just announce or mention a skill in your text response without actually calling this tool
|
|
191
|
-
- This is a BLOCKING REQUIREMENT: invoke the relevant Skill tool BEFORE generating any other response about the task
|
|
192
|
-
- Only use skills listed in <available_skills> below
|
|
193
|
-
- Do not invoke a skill that is already running
|
|
194
|
-
- Do not use this tool for built-in CLI commands (like /help, /clear, etc.)
|
|
195
|
-
- When executing scripts or loading referenced files, ALWAYS resolve absolute paths from skill's base directory. Examples:
|
|
196
|
-
- \`bash scripts/init.sh\` -> \`bash /path/to/skill/scripts/init.sh\`
|
|
197
|
-
- \`python scripts/helper.py\` -> \`python /path/to/skill/scripts/helper.py\`
|
|
198
|
-
- \`reference.md\` -> \`/path/to/skill/reference.md\`
|
|
199
|
-
</skills_instructions>
|
|
200
|
-
|
|
201
|
-
<available_skills>
|
|
202
|
-
${skillDescriptions}
|
|
203
|
-
</available_skills>`;
|
|
204
|
-
this.description = baseDescription;
|
|
205
167
|
}
|
|
206
168
|
validateToolParams(params) {
|
|
207
169
|
if (!params.skill || typeof params.skill !== "string" || params.skill.trim() === "") {
|
|
208
170
|
return 'Parameter "skill" must be a non-empty string.';
|
|
209
171
|
}
|
|
172
|
+
if (params.args !== void 0 && typeof params.args !== "string") {
|
|
173
|
+
return 'Parameter "args" must be a string when provided.';
|
|
174
|
+
}
|
|
210
175
|
const skillExists = this.availableSkills.some(
|
|
211
176
|
(skill) => skill.name === params.skill
|
|
212
177
|
);
|
|
@@ -215,6 +180,9 @@ ${skillDescriptions}
|
|
|
215
180
|
(cmd) => cmd.name === params.skill
|
|
216
181
|
);
|
|
217
182
|
if (commandExists) return null;
|
|
183
|
+
if (this.config.getDisabledSkillNames().has(params.skill.toLowerCase())) {
|
|
184
|
+
return `Skill "${params.skill}" is disabled. Re-enable it via /skills or remove it from skills.disabled.`;
|
|
185
|
+
}
|
|
218
186
|
if (this.pendingConditionalSkillNames.has(params.skill)) {
|
|
219
187
|
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.`;
|
|
220
188
|
}
|
|
@@ -237,7 +205,7 @@ ${skillDescriptions}
|
|
|
237
205
|
);
|
|
238
206
|
}
|
|
239
207
|
toAutoClassifierInput(params) {
|
|
240
|
-
return { skill: params.skill };
|
|
208
|
+
return params.args === void 0 ? { skill: params.skill } : { skill: params.skill, args: params.args };
|
|
241
209
|
}
|
|
242
210
|
getAvailableSkillNames() {
|
|
243
211
|
return this.availableSkills.map((skill) => skill.name);
|
|
@@ -265,7 +233,7 @@ ${skillDescriptions}
|
|
|
265
233
|
* SkillManager would accumulate one stale listener per subagent
|
|
266
234
|
* lifetime — and `notifyChangeListeners` is now `await`-ed
|
|
267
235
|
* sequentially, so each path activation would serialize through every
|
|
268
|
-
* accumulated listener's refreshSkills
|
|
236
|
+
* accumulated listener's refreshSkills run.
|
|
269
237
|
*/
|
|
270
238
|
dispose() {
|
|
271
239
|
this.removeChangeListener();
|
|
@@ -282,8 +250,14 @@ var SkillToolInvocation = class extends BaseToolInvocation {
|
|
|
282
250
|
static {
|
|
283
251
|
__name(this, "SkillToolInvocation");
|
|
284
252
|
}
|
|
253
|
+
// Populated by scheduler via setPromptId; empty = direct/non-scheduled
|
|
254
|
+
// call, filter `prompt_id != ''` downstream. See design doc §4.1.1.
|
|
255
|
+
promptId = "";
|
|
256
|
+
setPromptId(promptId) {
|
|
257
|
+
this.promptId = promptId;
|
|
258
|
+
}
|
|
285
259
|
getDescription() {
|
|
286
|
-
return `Use skill: "${this.params.skill}"`;
|
|
260
|
+
return this.params.args === void 0 ? `Use skill: "${this.params.skill}"` : `Use skill: "${this.params.skill}" with args: "${formatArgsForDescription(this.params.args)}"`;
|
|
287
261
|
}
|
|
288
262
|
/**
|
|
289
263
|
* Skills load user-defined code that runs with the agent's tool
|
|
@@ -297,28 +271,71 @@ var SkillToolInvocation = class extends BaseToolInvocation {
|
|
|
297
271
|
return "ask";
|
|
298
272
|
}
|
|
299
273
|
async execute(_signal, _updateOutput) {
|
|
274
|
+
const disabled = this.config.getDisabledSkillNames().has(this.params.skill.toLowerCase());
|
|
275
|
+
if (disabled) {
|
|
276
|
+
if (this.commandExecutor) {
|
|
277
|
+
try {
|
|
278
|
+
const content = await this.commandExecutor(
|
|
279
|
+
this.params.skill,
|
|
280
|
+
this.params.args ?? ""
|
|
281
|
+
);
|
|
282
|
+
if (content && typeof content === "object" && "error" in content) {
|
|
283
|
+
return {
|
|
284
|
+
llmContent: content.error,
|
|
285
|
+
returnDisplay: content.error
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
if (typeof content === "string") {
|
|
289
|
+
return {
|
|
290
|
+
llmContent: [{ text: content }],
|
|
291
|
+
returnDisplay: `Delegated to command: ${this.params.skill}`
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
} catch {
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
logSkillLaunch(
|
|
298
|
+
this.config,
|
|
299
|
+
new SkillLaunchEvent(this.params.skill, false, this.promptId)
|
|
300
|
+
);
|
|
301
|
+
const msg = `Skill "${this.params.skill}" is disabled. Re-enable it via /skills or remove it from skills.disabled.`;
|
|
302
|
+
return { llmContent: msg, returnDisplay: msg };
|
|
303
|
+
}
|
|
300
304
|
try {
|
|
301
305
|
const skill = await this.skillManager.loadSkillForRuntime(
|
|
302
306
|
this.params.skill
|
|
303
307
|
);
|
|
304
308
|
if (!skill) {
|
|
305
309
|
if (this.commandExecutor) {
|
|
306
|
-
const
|
|
307
|
-
|
|
310
|
+
const commandResult = await this.commandExecutor(
|
|
311
|
+
this.params.skill,
|
|
312
|
+
this.params.args ?? ""
|
|
313
|
+
);
|
|
314
|
+
if (commandResult && typeof commandResult === "object" && "error" in commandResult) {
|
|
308
315
|
logSkillLaunch(
|
|
309
316
|
this.config,
|
|
310
|
-
new SkillLaunchEvent(this.params.skill,
|
|
317
|
+
new SkillLaunchEvent(this.params.skill, false, this.promptId)
|
|
318
|
+
);
|
|
319
|
+
return {
|
|
320
|
+
llmContent: commandResult.error,
|
|
321
|
+
returnDisplay: commandResult.error
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
if (typeof commandResult === "string") {
|
|
325
|
+
logSkillLaunch(
|
|
326
|
+
this.config,
|
|
327
|
+
new SkillLaunchEvent(this.params.skill, true, this.promptId)
|
|
311
328
|
);
|
|
312
329
|
this.onSkillLoaded(this.params.skill);
|
|
313
330
|
return {
|
|
314
|
-
llmContent: [{ text:
|
|
331
|
+
llmContent: [{ text: commandResult }],
|
|
315
332
|
returnDisplay: `Executed command: ${this.params.skill}`
|
|
316
333
|
};
|
|
317
334
|
}
|
|
318
335
|
}
|
|
319
336
|
logSkillLaunch(
|
|
320
337
|
this.config,
|
|
321
|
-
new SkillLaunchEvent(this.params.skill, false)
|
|
338
|
+
new SkillLaunchEvent(this.params.skill, false, this.promptId)
|
|
322
339
|
);
|
|
323
340
|
const parseErrors = this.skillManager.getParseErrors();
|
|
324
341
|
const errorMessages = [];
|
|
@@ -337,9 +354,13 @@ ${errorMessages.join("\n")}` : "";
|
|
|
337
354
|
}
|
|
338
355
|
logSkillLaunch(
|
|
339
356
|
this.config,
|
|
340
|
-
new SkillLaunchEvent(this.params.skill, true)
|
|
357
|
+
new SkillLaunchEvent(this.params.skill, true, this.promptId)
|
|
341
358
|
);
|
|
342
359
|
this.onSkillLoaded(this.params.skill);
|
|
360
|
+
applySkillAllowedTools(
|
|
361
|
+
this.config.getPermissionManager(),
|
|
362
|
+
skill.allowedTools
|
|
363
|
+
);
|
|
343
364
|
debugLogger.debug("Skill hooks check:", {
|
|
344
365
|
hasHooks: !!skill.hooks,
|
|
345
366
|
hooksKeys: skill.hooks ? Object.keys(skill.hooks) : [],
|
|
@@ -386,7 +407,7 @@ ${errorMessages.join("\n")}` : "";
|
|
|
386
407
|
debugLogger.error(`[SkillsTool] Error using skill: ${errorMessage}`);
|
|
387
408
|
logSkillLaunch(
|
|
388
409
|
this.config,
|
|
389
|
-
new SkillLaunchEvent(this.params.skill, false)
|
|
410
|
+
new SkillLaunchEvent(this.params.skill, false, this.promptId)
|
|
390
411
|
);
|
|
391
412
|
return {
|
|
392
413
|
llmContent: `Failed to load skill "${this.params.skill}": ${errorMessage}`,
|
|
@@ -395,6 +416,11 @@ ${errorMessages.join("\n")}` : "";
|
|
|
395
416
|
}
|
|
396
417
|
}
|
|
397
418
|
};
|
|
419
|
+
function formatArgsForDescription(args) {
|
|
420
|
+
const escapeMarkdown = /* @__PURE__ */ __name((value) => value.replace(/([\\`*_{}[\]()#+\-.!|>])/g, "\\$1"), "escapeMarkdown");
|
|
421
|
+
return args.length > 120 ? `${escapeMarkdown(args.slice(0, 117))}...` : escapeMarkdown(args);
|
|
422
|
+
}
|
|
423
|
+
__name(formatArgsForDescription, "formatArgsForDescription");
|
|
398
424
|
export {
|
|
399
425
|
SkillTool,
|
|
400
426
|
buildSkillLlmContent
|