@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
|
@@ -2,23 +2,24 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
import {
|
|
4
4
|
t
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-VV4F63BD.js";
|
|
6
6
|
import {
|
|
7
|
+
computeThresholds,
|
|
7
8
|
getCoreSystemPrompt
|
|
8
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-TD4OPI4T.js";
|
|
9
10
|
import {
|
|
10
11
|
buildSkillLlmContent
|
|
11
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-OHEGWO4L.js";
|
|
12
13
|
import {
|
|
13
14
|
DiscoveredMCPTool,
|
|
14
15
|
uiTelemetryService
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import {
|
|
17
|
-
DEFAULT_TOKEN_LIMIT
|
|
18
|
-
} from "./chunk-MAY32HXD.js";
|
|
16
|
+
} from "./chunk-OQ7NJIY7.js";
|
|
19
17
|
import {
|
|
20
18
|
ToolNames
|
|
21
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-D3RHSPAS.js";
|
|
20
|
+
import {
|
|
21
|
+
DEFAULT_TOKEN_LIMIT
|
|
22
|
+
} from "./chunk-M6VTDSVR.js";
|
|
22
23
|
import {
|
|
23
24
|
init_esbuild_shims
|
|
24
25
|
} from "./chunk-A4BMJM77.js";
|
|
@@ -519,7 +520,13 @@ function isTerminalGoalStatusKind(kind) {
|
|
|
519
520
|
__name(isTerminalGoalStatusKind, "isTerminalGoalStatusKind");
|
|
520
521
|
|
|
521
522
|
// packages/cli/src/ui/commands/contextCommand.ts
|
|
522
|
-
|
|
523
|
+
function currentTier(tokens, thresholds) {
|
|
524
|
+
if (tokens >= thresholds.hard) return "hard";
|
|
525
|
+
if (tokens >= thresholds.auto) return "auto";
|
|
526
|
+
if (tokens >= thresholds.warn) return "warn";
|
|
527
|
+
return "safe";
|
|
528
|
+
}
|
|
529
|
+
__name(currentTier, "currentTier");
|
|
523
530
|
function estimateTokens(text) {
|
|
524
531
|
if (!text || text.length === 0) return 0;
|
|
525
532
|
let asciiChars = 0;
|
|
@@ -567,12 +574,15 @@ async function collectContextData(config, showDetails) {
|
|
|
567
574
|
const systemPromptTokens = estimateTokens(systemPromptText);
|
|
568
575
|
const toolRegistry = config.getToolRegistry();
|
|
569
576
|
const allTools = toolRegistry ? toolRegistry.getAllTools() : [];
|
|
570
|
-
const toolDeclarations = toolRegistry ? toolRegistry.getFunctionDeclarations(
|
|
577
|
+
const toolDeclarations = toolRegistry ? toolRegistry.getFunctionDeclarations() : [];
|
|
571
578
|
const toolsJsonStr = JSON.stringify(toolDeclarations);
|
|
572
579
|
const allToolsTokens = estimateTokens(toolsJsonStr);
|
|
573
580
|
const builtinTools = [];
|
|
574
581
|
const mcpTools = [];
|
|
575
582
|
for (const tool of allTools) {
|
|
583
|
+
if (tool.shouldDefer && !tool.alwaysLoad && !toolRegistry?.isDeferredToolRevealed(tool.name)) {
|
|
584
|
+
continue;
|
|
585
|
+
}
|
|
576
586
|
const toolJsonStr = JSON.stringify(tool.schema);
|
|
577
587
|
const tokens = estimateTokens(toolJsonStr);
|
|
578
588
|
if (tool instanceof DiscoveredMCPTool) {
|
|
@@ -625,8 +635,11 @@ ${skill.level}
|
|
|
625
635
|
};
|
|
626
636
|
});
|
|
627
637
|
const skillsTokens = skillToolDefinitionTokens + loadedBodiesTokens;
|
|
628
|
-
const
|
|
629
|
-
const autocompactBuffer =
|
|
638
|
+
const thresholds = computeThresholds(contextWindowSize);
|
|
639
|
+
const autocompactBuffer = Math.max(
|
|
640
|
+
0,
|
|
641
|
+
Math.round(contextWindowSize - thresholds.auto)
|
|
642
|
+
);
|
|
630
643
|
const rawOverhead = systemPromptTokens + allToolsTokens + memoryFilesTokens + loadedBodiesTokens;
|
|
631
644
|
const isEstimated = apiTotalTokens === 0;
|
|
632
645
|
const mcpToolsTotalTokens = mcpTools.reduce(
|
|
@@ -703,6 +716,7 @@ ${skill.level}
|
|
|
703
716
|
bodyTokens: item.bodyTokens ? Math.round(item.bodyTokens * overheadScale) : void 0
|
|
704
717
|
})) : skills;
|
|
705
718
|
}
|
|
719
|
+
const tierTokens = isEstimated ? rawOverhead : apiTotalTokens;
|
|
706
720
|
const breakdown = {
|
|
707
721
|
systemPrompt: displaySystemPrompt,
|
|
708
722
|
builtinTools: displayBuiltinTools,
|
|
@@ -711,7 +725,9 @@ ${skill.level}
|
|
|
711
725
|
skills: displaySkills,
|
|
712
726
|
messages: messagesTokens,
|
|
713
727
|
freeSpace,
|
|
714
|
-
autocompactBuffer
|
|
728
|
+
autocompactBuffer,
|
|
729
|
+
thresholds,
|
|
730
|
+
currentTier: currentTier(tierTokens, thresholds)
|
|
715
731
|
};
|
|
716
732
|
return {
|
|
717
733
|
type: "context_usage" /* CONTEXT_USAGE */,
|
|
@@ -736,7 +752,7 @@ function fmtTokens(tokens) {
|
|
|
736
752
|
}
|
|
737
753
|
__name(fmtTokens, "fmtTokens");
|
|
738
754
|
function fmtCategoryRow(label, tokens, contextWindowSize, indent = " ") {
|
|
739
|
-
const percentage = (tokens / contextWindowSize * 100).toFixed(1);
|
|
755
|
+
const percentage = contextWindowSize > 0 ? (tokens / contextWindowSize * 100).toFixed(1) : "0.0";
|
|
740
756
|
const right = `${fmtTokens(tokens)} tokens (${percentage}%)`;
|
|
741
757
|
const leftPart = `${indent}${label}`;
|
|
742
758
|
const totalWidth = 56;
|
|
@@ -744,6 +760,10 @@ function fmtCategoryRow(label, tokens, contextWindowSize, indent = " ") {
|
|
|
744
760
|
return `${leftPart}${" ".repeat(dots)}${right}`;
|
|
745
761
|
}
|
|
746
762
|
__name(fmtCategoryRow, "fmtCategoryRow");
|
|
763
|
+
function formatNum(n) {
|
|
764
|
+
return Math.round(n).toLocaleString("en-US");
|
|
765
|
+
}
|
|
766
|
+
__name(formatNum, "formatNum");
|
|
747
767
|
function formatContextUsageText(data) {
|
|
748
768
|
const {
|
|
749
769
|
modelName,
|
|
@@ -775,13 +795,15 @@ function formatContextUsageText(data) {
|
|
|
775
795
|
lines.push("");
|
|
776
796
|
lines.push(fmtCategoryRow("Used", totalTokens, contextWindowSize));
|
|
777
797
|
lines.push(fmtCategoryRow("Free", breakdown.freeSpace, contextWindowSize));
|
|
798
|
+
lines.push("");
|
|
799
|
+
lines.push("**Compaction thresholds**");
|
|
778
800
|
lines.push(
|
|
779
|
-
|
|
780
|
-
"Autocompact buffer",
|
|
781
|
-
breakdown.autocompactBuffer,
|
|
782
|
-
contextWindowSize
|
|
783
|
-
)
|
|
801
|
+
` Effective window: ${formatNum(breakdown.thresholds.effectiveWindow)} (window \u2212 ${formatNum(contextWindowSize - breakdown.thresholds.effectiveWindow)} reserve)`
|
|
784
802
|
);
|
|
803
|
+
lines.push(` Warn threshold: ${formatNum(breakdown.thresholds.warn)}`);
|
|
804
|
+
lines.push(` Auto threshold: ${formatNum(breakdown.thresholds.auto)}`);
|
|
805
|
+
lines.push(` Hard threshold: ${formatNum(breakdown.thresholds.hard)}`);
|
|
806
|
+
lines.push(` Current tier: ${breakdown.currentTier}`);
|
|
785
807
|
lines.push("");
|
|
786
808
|
lines.push("**Usage by category**");
|
|
787
809
|
}
|
|
@@ -877,7 +899,8 @@ var contextCommand = {
|
|
|
877
899
|
kind: "built-in" /* BUILT_IN */,
|
|
878
900
|
supportedModes: ["interactive", "non_interactive", "acp"],
|
|
879
901
|
action: /* @__PURE__ */ __name(async (context, args) => {
|
|
880
|
-
const
|
|
902
|
+
const normalizedArgs = args?.trim().toLowerCase();
|
|
903
|
+
const showDetails = normalizedArgs === "detail" || normalizedArgs === "-d";
|
|
881
904
|
const executionMode = context.executionMode ?? "interactive";
|
|
882
905
|
const { config } = context.services;
|
|
883
906
|
if (!config) {
|
|
@@ -901,13 +924,12 @@ var contextCommand = {
|
|
|
901
924
|
if (executionMode === "interactive") {
|
|
902
925
|
context.ui.addItem(contextUsageItem, Date.now());
|
|
903
926
|
return;
|
|
904
|
-
} else {
|
|
905
|
-
return {
|
|
906
|
-
type: "message",
|
|
907
|
-
messageType: "info",
|
|
908
|
-
content: formatContextUsageText(contextUsageItem)
|
|
909
|
-
};
|
|
910
927
|
}
|
|
928
|
+
return {
|
|
929
|
+
type: "message",
|
|
930
|
+
messageType: "info",
|
|
931
|
+
content: formatContextUsageText(contextUsageItem)
|
|
932
|
+
};
|
|
911
933
|
}, "action"),
|
|
912
934
|
subCommands: [
|
|
913
935
|
{
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
// Force strict mode and setup for ESM
|
|
2
|
+
"use strict";
|
|
3
|
+
import {
|
|
4
|
+
createTask
|
|
5
|
+
} from "./chunk-XBY7E2FX.js";
|
|
6
|
+
import {
|
|
7
|
+
resolveActiveTeamName
|
|
8
|
+
} from "./chunk-LD2XBG6Z.js";
|
|
9
|
+
import {
|
|
10
|
+
BaseDeclarativeTool,
|
|
11
|
+
BaseToolInvocation,
|
|
12
|
+
ToolDisplayNames,
|
|
13
|
+
ToolNames
|
|
14
|
+
} from "./chunk-D3RHSPAS.js";
|
|
15
|
+
import {
|
|
16
|
+
init_esbuild_shims
|
|
17
|
+
} from "./chunk-A4BMJM77.js";
|
|
18
|
+
import {
|
|
19
|
+
__name
|
|
20
|
+
} from "./chunk-J2S4EL5Y.js";
|
|
21
|
+
|
|
22
|
+
// packages/core/src/tools/task-create.ts
|
|
23
|
+
init_esbuild_shims();
|
|
24
|
+
var CONFIRMATION_DESCRIPTION_LIMIT = 2e3;
|
|
25
|
+
function truncateForConfirmation(text) {
|
|
26
|
+
if (text.length <= CONFIRMATION_DESCRIPTION_LIMIT) return text;
|
|
27
|
+
return `${text.slice(0, CONFIRMATION_DESCRIPTION_LIMIT)}
|
|
28
|
+
\u2026 (${text.length - CONFIRMATION_DESCRIPTION_LIMIT} more characters)`;
|
|
29
|
+
}
|
|
30
|
+
__name(truncateForConfirmation, "truncateForConfirmation");
|
|
31
|
+
var TaskCreateInvocation = class extends BaseToolInvocation {
|
|
32
|
+
constructor(config, params) {
|
|
33
|
+
super(params);
|
|
34
|
+
this.config = config;
|
|
35
|
+
}
|
|
36
|
+
static {
|
|
37
|
+
__name(this, "TaskCreateInvocation");
|
|
38
|
+
}
|
|
39
|
+
getDescription() {
|
|
40
|
+
return `Create task: ${this.params.subject}`;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* A task's `description` becomes the prompt an idle teammate auto-claims
|
|
44
|
+
* and executes with full tool access — the same privileged-sink shape as
|
|
45
|
+
* `send_message`, where free-form text turns into a new instruction for
|
|
46
|
+
* another agent. The base default `'allow'` short-circuits the classifier
|
|
47
|
+
* in AUTO mode, so override to `'ask'` to keep that injection path under
|
|
48
|
+
* the classifier / human-in-the-loop.
|
|
49
|
+
*/
|
|
50
|
+
async getDefaultPermission() {
|
|
51
|
+
return "ask";
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Unlike the one-line getDescription() used for transcript rendering,
|
|
55
|
+
* the confirmation prompt must show the instruction text itself: the
|
|
56
|
+
* `description` is what an idle teammate will auto-claim and execute
|
|
57
|
+
* with full tool access, so it is exactly what the human is approving.
|
|
58
|
+
*/
|
|
59
|
+
getConfirmationDetails(_abortSignal) {
|
|
60
|
+
const details = {
|
|
61
|
+
type: "info",
|
|
62
|
+
title: "Confirm TaskCreate",
|
|
63
|
+
prompt: `Create task: ${this.params.subject}
|
|
64
|
+
|
|
65
|
+
` + truncateForConfirmation(this.params.description),
|
|
66
|
+
onConfirm: /* @__PURE__ */ __name(async () => {
|
|
67
|
+
}, "onConfirm")
|
|
68
|
+
};
|
|
69
|
+
return Promise.resolve(details);
|
|
70
|
+
}
|
|
71
|
+
async execute() {
|
|
72
|
+
const teamName = resolveActiveTeamName(
|
|
73
|
+
this.config.getTeamContext()?.teamName
|
|
74
|
+
);
|
|
75
|
+
if (!teamName) {
|
|
76
|
+
const msg = "No active team. Create a team first.";
|
|
77
|
+
return {
|
|
78
|
+
llmContent: msg,
|
|
79
|
+
returnDisplay: msg,
|
|
80
|
+
error: { message: msg }
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
const task = await createTask(teamName, {
|
|
84
|
+
subject: this.params.subject,
|
|
85
|
+
description: this.params.description,
|
|
86
|
+
activeForm: this.params.activeForm,
|
|
87
|
+
metadata: this.params.metadata
|
|
88
|
+
});
|
|
89
|
+
const llmContent = `Task #${task.id} created: "${task.subject}"`;
|
|
90
|
+
return { llmContent, returnDisplay: llmContent };
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
var TaskCreateTool = class _TaskCreateTool extends BaseDeclarativeTool {
|
|
94
|
+
constructor(config) {
|
|
95
|
+
super(
|
|
96
|
+
_TaskCreateTool.Name,
|
|
97
|
+
ToolDisplayNames.TASK_CREATE,
|
|
98
|
+
"Create a new task in the team task list. Tasks are automatically assigned to idle teammates.",
|
|
99
|
+
"other" /* Other */,
|
|
100
|
+
{
|
|
101
|
+
type: "object",
|
|
102
|
+
properties: {
|
|
103
|
+
subject: {
|
|
104
|
+
type: "string",
|
|
105
|
+
description: "Short title for the task.",
|
|
106
|
+
maxLength: 200
|
|
107
|
+
},
|
|
108
|
+
description: {
|
|
109
|
+
type: "string",
|
|
110
|
+
description: "Detailed description of the task.",
|
|
111
|
+
maxLength: 1e4
|
|
112
|
+
},
|
|
113
|
+
activeForm: {
|
|
114
|
+
type: "string",
|
|
115
|
+
maxLength: 200,
|
|
116
|
+
description: 'Present tense label for UI (e.g., "Running tests").'
|
|
117
|
+
},
|
|
118
|
+
metadata: {
|
|
119
|
+
type: "object",
|
|
120
|
+
description: "Optional arbitrary metadata."
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
required: ["subject", "description"],
|
|
124
|
+
additionalProperties: false
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
this.config = config;
|
|
128
|
+
}
|
|
129
|
+
static {
|
|
130
|
+
__name(this, "TaskCreateTool");
|
|
131
|
+
}
|
|
132
|
+
static Name = ToolNames.TASK_CREATE;
|
|
133
|
+
createInvocation(params) {
|
|
134
|
+
return new TaskCreateInvocation(this.config, params);
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Forward the task content to the classifier. The base sentinel `''`
|
|
138
|
+
* projects to an empty args object, so without this override the AUTO
|
|
139
|
+
* classifier rules on `task_create({})` — the injected payload that
|
|
140
|
+
* `getDefaultPermission() === 'ask'` exists to inspect would be
|
|
141
|
+
* invisible to it. Mirrors `send_message`'s projection.
|
|
142
|
+
*/
|
|
143
|
+
toAutoClassifierInput(params) {
|
|
144
|
+
return {
|
|
145
|
+
subject: params.subject,
|
|
146
|
+
description: params.description
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
export {
|
|
152
|
+
truncateForConfirmation,
|
|
153
|
+
TaskCreateTool
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* @license
|
|
157
|
+
* Copyright 2025 Qwen
|
|
158
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
159
|
+
*/
|