@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
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
import {
|
|
4
4
|
STRUCTURED_OUTPUT_REDACTED_ARGS,
|
|
5
5
|
SyntheticOutputTool
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-KQJMQJPI.js";
|
|
7
|
+
import "./chunk-D3RHSPAS.js";
|
|
8
|
+
import "./chunk-HR7SV7AY.js";
|
|
9
|
+
import "./chunk-Z2Z3GUXZ.js";
|
|
10
10
|
import "./chunk-A4BMJM77.js";
|
|
11
11
|
import "./chunk-J2S4EL5Y.js";
|
|
12
12
|
export {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Force strict mode and setup for ESM
|
|
2
|
+
"use strict";
|
|
3
|
+
import {
|
|
4
|
+
TaskCreateTool,
|
|
5
|
+
truncateForConfirmation
|
|
6
|
+
} from "./chunk-YOGAOMYB.js";
|
|
7
|
+
import "./chunk-XBY7E2FX.js";
|
|
8
|
+
import "./chunk-J5MDQKJL.js";
|
|
9
|
+
import "./chunk-LD2XBG6Z.js";
|
|
10
|
+
import "./chunk-D3RHSPAS.js";
|
|
11
|
+
import "./chunk-B7HXHOHU.js";
|
|
12
|
+
import "./chunk-HR7SV7AY.js";
|
|
13
|
+
import "./chunk-Z2Z3GUXZ.js";
|
|
14
|
+
import "./chunk-A4BMJM77.js";
|
|
15
|
+
import "./chunk-J2S4EL5Y.js";
|
|
16
|
+
export {
|
|
17
|
+
TaskCreateTool,
|
|
18
|
+
truncateForConfirmation
|
|
19
|
+
};
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
// Force strict mode and setup for ESM
|
|
2
|
+
"use strict";
|
|
3
|
+
import {
|
|
4
|
+
listTasks
|
|
5
|
+
} from "./chunk-XBY7E2FX.js";
|
|
6
|
+
import "./chunk-J5MDQKJL.js";
|
|
7
|
+
import {
|
|
8
|
+
getTeamName,
|
|
9
|
+
resolveActiveTeamName
|
|
10
|
+
} from "./chunk-LD2XBG6Z.js";
|
|
11
|
+
import {
|
|
12
|
+
BaseDeclarativeTool,
|
|
13
|
+
BaseToolInvocation,
|
|
14
|
+
ToolDisplayNames,
|
|
15
|
+
ToolNames
|
|
16
|
+
} from "./chunk-D3RHSPAS.js";
|
|
17
|
+
import "./chunk-B7HXHOHU.js";
|
|
18
|
+
import "./chunk-HR7SV7AY.js";
|
|
19
|
+
import "./chunk-Z2Z3GUXZ.js";
|
|
20
|
+
import {
|
|
21
|
+
init_esbuild_shims
|
|
22
|
+
} from "./chunk-A4BMJM77.js";
|
|
23
|
+
import {
|
|
24
|
+
__name
|
|
25
|
+
} from "./chunk-J2S4EL5Y.js";
|
|
26
|
+
|
|
27
|
+
// packages/core/src/tools/task-list.ts
|
|
28
|
+
init_esbuild_shims();
|
|
29
|
+
var TaskListInvocation = class extends BaseToolInvocation {
|
|
30
|
+
constructor(config, params) {
|
|
31
|
+
super(params);
|
|
32
|
+
this.config = config;
|
|
33
|
+
}
|
|
34
|
+
static {
|
|
35
|
+
__name(this, "TaskListInvocation");
|
|
36
|
+
}
|
|
37
|
+
getDescription() {
|
|
38
|
+
const filters = [];
|
|
39
|
+
if (this.params.status) {
|
|
40
|
+
filters.push(`status=${this.params.status}`);
|
|
41
|
+
}
|
|
42
|
+
if (this.params.owner) {
|
|
43
|
+
filters.push(`owner=${this.params.owner}`);
|
|
44
|
+
}
|
|
45
|
+
if (this.params.blockedBy) {
|
|
46
|
+
filters.push(`blockedBy=${this.params.blockedBy}`);
|
|
47
|
+
}
|
|
48
|
+
return filters.length > 0 ? `List tasks (${filters.join(", ")})` : "List all tasks";
|
|
49
|
+
}
|
|
50
|
+
async execute() {
|
|
51
|
+
const teamName = resolveActiveTeamName(
|
|
52
|
+
this.config.getTeamContext()?.teamName
|
|
53
|
+
);
|
|
54
|
+
if (!teamName) {
|
|
55
|
+
const msg = "No active team. Create a team first.";
|
|
56
|
+
return {
|
|
57
|
+
llmContent: msg,
|
|
58
|
+
returnDisplay: msg,
|
|
59
|
+
error: { message: msg }
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
const tasks = await listTasks(teamName, {
|
|
63
|
+
status: this.params.status,
|
|
64
|
+
owner: this.params.owner,
|
|
65
|
+
blockedBy: this.params.blockedBy
|
|
66
|
+
});
|
|
67
|
+
if (tasks.length === 0) {
|
|
68
|
+
const llmContent2 = "No tasks found.";
|
|
69
|
+
return { llmContent: llmContent2, returnDisplay: llmContent2 };
|
|
70
|
+
}
|
|
71
|
+
const lines = tasks.map(
|
|
72
|
+
(t) => `#${t.id} [${t.status}]` + (t.owner ? ` @${t.owner}` : "") + ` \u2014 ${t.subject}`
|
|
73
|
+
);
|
|
74
|
+
const manager = this.config.getTeamManager();
|
|
75
|
+
if (manager && !getTeamName()) {
|
|
76
|
+
try {
|
|
77
|
+
const msgs = await manager.getLeaderMessages();
|
|
78
|
+
if (msgs.length > 0) {
|
|
79
|
+
lines.push("");
|
|
80
|
+
lines.push("--- Teammate messages ---");
|
|
81
|
+
for (const wrapped of manager.formatLeaderEnvelope(msgs)) {
|
|
82
|
+
lines.push(wrapped);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
} catch {
|
|
86
|
+
}
|
|
87
|
+
if (manager.hasActiveTeammates()) {
|
|
88
|
+
lines.push("");
|
|
89
|
+
lines.push(
|
|
90
|
+
"NOTE: Teammates are still working. Their results will be delivered as messages \u2014 do NOT call task_list again to check. End your turn and wait for teammate messages."
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
const llmContent = lines.join("\n");
|
|
95
|
+
const display = {
|
|
96
|
+
type: "task_list",
|
|
97
|
+
tasks: tasks.map((t) => ({
|
|
98
|
+
id: t.id,
|
|
99
|
+
subject: t.subject,
|
|
100
|
+
status: t.status,
|
|
101
|
+
owner: t.owner
|
|
102
|
+
}))
|
|
103
|
+
};
|
|
104
|
+
return { llmContent, returnDisplay: display };
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
var TaskListTool = class _TaskListTool extends BaseDeclarativeTool {
|
|
108
|
+
constructor(config) {
|
|
109
|
+
super(
|
|
110
|
+
_TaskListTool.Name,
|
|
111
|
+
ToolDisplayNames.TASK_LIST,
|
|
112
|
+
"List tasks in the team task list. All filter parameters are optional.",
|
|
113
|
+
"read" /* Read */,
|
|
114
|
+
{
|
|
115
|
+
type: "object",
|
|
116
|
+
properties: {
|
|
117
|
+
status: {
|
|
118
|
+
type: "string",
|
|
119
|
+
enum: ["pending", "in_progress", "completed"],
|
|
120
|
+
description: "Filter by task status."
|
|
121
|
+
},
|
|
122
|
+
owner: {
|
|
123
|
+
type: "string",
|
|
124
|
+
description: "Filter by owner agent name."
|
|
125
|
+
},
|
|
126
|
+
blockedBy: {
|
|
127
|
+
type: "string",
|
|
128
|
+
description: "Filter for tasks blocked by this task ID."
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
additionalProperties: false
|
|
132
|
+
}
|
|
133
|
+
);
|
|
134
|
+
this.config = config;
|
|
135
|
+
}
|
|
136
|
+
static {
|
|
137
|
+
__name(this, "TaskListTool");
|
|
138
|
+
}
|
|
139
|
+
static Name = ToolNames.TASK_LIST;
|
|
140
|
+
createInvocation(params) {
|
|
141
|
+
return new TaskListInvocation(this.config, params);
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
export {
|
|
145
|
+
TaskListTool
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
148
|
+
* @license
|
|
149
|
+
* Copyright 2025 Qwen
|
|
150
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
151
|
+
*/
|
|
@@ -5,9 +5,9 @@ import {
|
|
|
5
5
|
BaseToolInvocation,
|
|
6
6
|
ToolDisplayNames,
|
|
7
7
|
ToolNames
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-D3RHSPAS.js";
|
|
9
|
+
import "./chunk-HR7SV7AY.js";
|
|
10
|
+
import "./chunk-Z2Z3GUXZ.js";
|
|
11
11
|
import {
|
|
12
12
|
init_esbuild_shims
|
|
13
13
|
} from "./chunk-A4BMJM77.js";
|
|
@@ -0,0 +1,408 @@
|
|
|
1
|
+
// Force strict mode and setup for ESM
|
|
2
|
+
"use strict";
|
|
3
|
+
import {
|
|
4
|
+
truncateForConfirmation
|
|
5
|
+
} from "./chunk-YOGAOMYB.js";
|
|
6
|
+
import {
|
|
7
|
+
RECIPROCAL_CALLER,
|
|
8
|
+
TaskOwnershipError,
|
|
9
|
+
assertValidTaskId,
|
|
10
|
+
deleteTask,
|
|
11
|
+
getTask,
|
|
12
|
+
listTasks,
|
|
13
|
+
updateTask
|
|
14
|
+
} from "./chunk-XBY7E2FX.js";
|
|
15
|
+
import "./chunk-J5MDQKJL.js";
|
|
16
|
+
import {
|
|
17
|
+
getAgentName,
|
|
18
|
+
isTeammate,
|
|
19
|
+
resolveActiveTeamName
|
|
20
|
+
} from "./chunk-LD2XBG6Z.js";
|
|
21
|
+
import {
|
|
22
|
+
BaseDeclarativeTool,
|
|
23
|
+
BaseToolInvocation,
|
|
24
|
+
ToolDisplayNames,
|
|
25
|
+
ToolNames
|
|
26
|
+
} from "./chunk-D3RHSPAS.js";
|
|
27
|
+
import "./chunk-B7HXHOHU.js";
|
|
28
|
+
import "./chunk-HR7SV7AY.js";
|
|
29
|
+
import "./chunk-Z2Z3GUXZ.js";
|
|
30
|
+
import {
|
|
31
|
+
init_esbuild_shims
|
|
32
|
+
} from "./chunk-A4BMJM77.js";
|
|
33
|
+
import {
|
|
34
|
+
__name
|
|
35
|
+
} from "./chunk-J2S4EL5Y.js";
|
|
36
|
+
|
|
37
|
+
// packages/core/src/tools/task-update.ts
|
|
38
|
+
init_esbuild_shims();
|
|
39
|
+
async function findDependencyCycle(teamName, taskId, addBlocks, addBlockedBy) {
|
|
40
|
+
const tasks = await listTasks(teamName);
|
|
41
|
+
const adjacency = /* @__PURE__ */ new Map();
|
|
42
|
+
const edge = /* @__PURE__ */ __name((from, to) => {
|
|
43
|
+
let set = adjacency.get(from);
|
|
44
|
+
if (!set) {
|
|
45
|
+
set = /* @__PURE__ */ new Set();
|
|
46
|
+
adjacency.set(from, set);
|
|
47
|
+
}
|
|
48
|
+
set.add(to);
|
|
49
|
+
}, "edge");
|
|
50
|
+
for (const task of tasks) {
|
|
51
|
+
for (const id of task.blocks) edge(task.id, id);
|
|
52
|
+
for (const id of task.blockedBy) edge(id, task.id);
|
|
53
|
+
}
|
|
54
|
+
for (const id of addBlocks) edge(taskId, id);
|
|
55
|
+
for (const id of addBlockedBy) edge(id, taskId);
|
|
56
|
+
const path = [];
|
|
57
|
+
const visited = /* @__PURE__ */ new Set();
|
|
58
|
+
const walk = /* @__PURE__ */ __name((node) => {
|
|
59
|
+
path.push(node);
|
|
60
|
+
for (const next of adjacency.get(node) ?? []) {
|
|
61
|
+
if (next === taskId) return [...path, taskId];
|
|
62
|
+
if (visited.has(next)) continue;
|
|
63
|
+
visited.add(next);
|
|
64
|
+
const found = walk(next);
|
|
65
|
+
if (found) return found;
|
|
66
|
+
}
|
|
67
|
+
path.pop();
|
|
68
|
+
return null;
|
|
69
|
+
}, "walk");
|
|
70
|
+
visited.add(taskId);
|
|
71
|
+
return walk(taskId);
|
|
72
|
+
}
|
|
73
|
+
__name(findDependencyCycle, "findDependencyCycle");
|
|
74
|
+
var TaskUpdateInvocation = class extends BaseToolInvocation {
|
|
75
|
+
constructor(config, params) {
|
|
76
|
+
super(params);
|
|
77
|
+
this.config = config;
|
|
78
|
+
}
|
|
79
|
+
static {
|
|
80
|
+
__name(this, "TaskUpdateInvocation");
|
|
81
|
+
}
|
|
82
|
+
getDescription() {
|
|
83
|
+
const parts = [`Task #${this.params.taskId}`];
|
|
84
|
+
if (this.params.status) {
|
|
85
|
+
parts.push(`\u2192 ${this.params.status}`);
|
|
86
|
+
}
|
|
87
|
+
if (this.params.owner) {
|
|
88
|
+
parts.push(`owner: ${this.params.owner}`);
|
|
89
|
+
}
|
|
90
|
+
return parts.join(" ");
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Mutating a task's `subject`/`description` rewrites the prompt an idle
|
|
94
|
+
* teammate will auto-claim and execute with full tool access — the same
|
|
95
|
+
* privileged-sink shape as `send_message` and `task_create`. The base
|
|
96
|
+
* default `'allow'` short-circuits the classifier in AUTO mode, so
|
|
97
|
+
* override to `'ask'` to keep that injection path under the classifier /
|
|
98
|
+
* human-in-the-loop.
|
|
99
|
+
*/
|
|
100
|
+
async getDefaultPermission() {
|
|
101
|
+
return "ask";
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Surface the rewritten instruction text at approval time: an updated
|
|
105
|
+
* `description` is what a claiming teammate will execute, so the
|
|
106
|
+
* dialog must show it — getDescription()'s one-liner only carries
|
|
107
|
+
* status/owner. See task-create.ts for the same rationale.
|
|
108
|
+
*/
|
|
109
|
+
getConfirmationDetails(_abortSignal) {
|
|
110
|
+
const lines = [this.getDescription()];
|
|
111
|
+
if (this.params.subject !== void 0) {
|
|
112
|
+
lines.push(`subject: ${this.params.subject}`);
|
|
113
|
+
}
|
|
114
|
+
if (this.params.addBlocks?.length) {
|
|
115
|
+
lines.push(`blocks: ${this.params.addBlocks.join(", ")}`);
|
|
116
|
+
}
|
|
117
|
+
if (this.params.addBlockedBy?.length) {
|
|
118
|
+
lines.push(`blocked by: ${this.params.addBlockedBy.join(", ")}`);
|
|
119
|
+
}
|
|
120
|
+
if (this.params.description !== void 0) {
|
|
121
|
+
lines.push("", truncateForConfirmation(this.params.description));
|
|
122
|
+
}
|
|
123
|
+
const details = {
|
|
124
|
+
type: "info",
|
|
125
|
+
title: "Confirm TaskUpdate",
|
|
126
|
+
prompt: lines.join("\n"),
|
|
127
|
+
onConfirm: /* @__PURE__ */ __name(async () => {
|
|
128
|
+
}, "onConfirm")
|
|
129
|
+
};
|
|
130
|
+
return Promise.resolve(details);
|
|
131
|
+
}
|
|
132
|
+
async execute() {
|
|
133
|
+
const teamName = resolveActiveTeamName(
|
|
134
|
+
this.config.getTeamContext()?.teamName
|
|
135
|
+
);
|
|
136
|
+
if (!teamName) {
|
|
137
|
+
const msg = "No active team. Create a team first.";
|
|
138
|
+
return {
|
|
139
|
+
llmContent: msg,
|
|
140
|
+
returnDisplay: msg,
|
|
141
|
+
error: { message: msg }
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
const { taskId } = this.params;
|
|
145
|
+
try {
|
|
146
|
+
assertValidTaskId(taskId);
|
|
147
|
+
for (const id of this.params.addBlocks ?? []) {
|
|
148
|
+
assertValidTaskId(id);
|
|
149
|
+
}
|
|
150
|
+
for (const id of this.params.addBlockedBy ?? []) {
|
|
151
|
+
assertValidTaskId(id);
|
|
152
|
+
}
|
|
153
|
+
} catch (err) {
|
|
154
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
155
|
+
return {
|
|
156
|
+
llmContent: msg,
|
|
157
|
+
returnDisplay: msg,
|
|
158
|
+
error: { message: msg }
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
const teammateCallerName = isTeammate() ? getAgentName() : void 0;
|
|
162
|
+
if (this.params.status === "deleted") {
|
|
163
|
+
let ok;
|
|
164
|
+
try {
|
|
165
|
+
ok = await deleteTask(
|
|
166
|
+
teamName,
|
|
167
|
+
taskId,
|
|
168
|
+
teammateCallerName !== void 0 ? { callerName: teammateCallerName } : void 0
|
|
169
|
+
);
|
|
170
|
+
} catch (err) {
|
|
171
|
+
if (err instanceof TaskOwnershipError) {
|
|
172
|
+
return {
|
|
173
|
+
llmContent: err.message,
|
|
174
|
+
returnDisplay: err.message,
|
|
175
|
+
error: { message: err.message }
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
throw err;
|
|
179
|
+
}
|
|
180
|
+
if (!ok) {
|
|
181
|
+
const msg2 = `Task #${taskId} not found.`;
|
|
182
|
+
return {
|
|
183
|
+
llmContent: msg2,
|
|
184
|
+
returnDisplay: msg2,
|
|
185
|
+
error: { message: msg2 }
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
const msg = `Task #${taskId} deleted.`;
|
|
189
|
+
return { llmContent: msg, returnDisplay: msg };
|
|
190
|
+
}
|
|
191
|
+
if (this.params.addBlocks?.includes(taskId) || this.params.addBlockedBy?.includes(taskId)) {
|
|
192
|
+
const msg = `Cannot update task #${taskId}: a task cannot block or be blocked by itself.`;
|
|
193
|
+
return {
|
|
194
|
+
llmContent: msg,
|
|
195
|
+
returnDisplay: msg,
|
|
196
|
+
error: { message: msg }
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
const referencedIds = /* @__PURE__ */ new Set();
|
|
200
|
+
for (const id of this.params.addBlocks ?? []) {
|
|
201
|
+
if (id !== taskId) referencedIds.add(id);
|
|
202
|
+
}
|
|
203
|
+
for (const id of this.params.addBlockedBy ?? []) {
|
|
204
|
+
if (id !== taskId) referencedIds.add(id);
|
|
205
|
+
}
|
|
206
|
+
if (referencedIds.size > 0) {
|
|
207
|
+
const missing = [];
|
|
208
|
+
await Promise.all(
|
|
209
|
+
Array.from(referencedIds).map(async (id) => {
|
|
210
|
+
const t = await getTask(teamName, id);
|
|
211
|
+
if (!t) missing.push(id);
|
|
212
|
+
})
|
|
213
|
+
);
|
|
214
|
+
if (missing.length > 0) {
|
|
215
|
+
const ids = missing.sort().map((id) => `#${id}`).join(", ");
|
|
216
|
+
const msg = `Cannot update task #${taskId}: referenced task${missing.length === 1 ? "" : "s"} ${ids} not found.`;
|
|
217
|
+
return {
|
|
218
|
+
llmContent: msg,
|
|
219
|
+
returnDisplay: msg,
|
|
220
|
+
error: { message: msg }
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
const cycle = await findDependencyCycle(
|
|
224
|
+
teamName,
|
|
225
|
+
taskId,
|
|
226
|
+
this.params.addBlocks ?? [],
|
|
227
|
+
this.params.addBlockedBy ?? []
|
|
228
|
+
);
|
|
229
|
+
if (cycle) {
|
|
230
|
+
const msg = `Cannot update task #${taskId}: this would create a dependency cycle (${cycle.map((id) => `#${id}`).join(" \u2192 ")}).`;
|
|
231
|
+
return {
|
|
232
|
+
llmContent: msg,
|
|
233
|
+
returnDisplay: msg,
|
|
234
|
+
error: { message: msg }
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
const autoOwner = this.params.status === "in_progress" && this.params.owner === void 0 ? getAgentName() : void 0;
|
|
239
|
+
if (this.params.status === "in_progress" && !this.params.owner && !autoOwner) {
|
|
240
|
+
const msg = `Cannot move task #${taskId} to in_progress without an owner. Specify the "owner" parameter.`;
|
|
241
|
+
return {
|
|
242
|
+
llmContent: msg,
|
|
243
|
+
returnDisplay: msg,
|
|
244
|
+
error: { message: msg }
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
let task;
|
|
248
|
+
try {
|
|
249
|
+
task = await updateTask(
|
|
250
|
+
teamName,
|
|
251
|
+
taskId,
|
|
252
|
+
{
|
|
253
|
+
status: this.params.status,
|
|
254
|
+
owner: this.params.owner ?? autoOwner,
|
|
255
|
+
subject: this.params.subject,
|
|
256
|
+
description: this.params.description,
|
|
257
|
+
activeForm: this.params.activeForm,
|
|
258
|
+
metadata: this.params.metadata,
|
|
259
|
+
addBlocks: this.params.addBlocks,
|
|
260
|
+
addBlockedBy: this.params.addBlockedBy
|
|
261
|
+
},
|
|
262
|
+
teammateCallerName !== void 0 ? { callerName: teammateCallerName } : void 0
|
|
263
|
+
);
|
|
264
|
+
} catch (err) {
|
|
265
|
+
if (err instanceof TaskOwnershipError) {
|
|
266
|
+
return {
|
|
267
|
+
llmContent: err.message,
|
|
268
|
+
returnDisplay: err.message,
|
|
269
|
+
error: { message: err.message }
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
throw err;
|
|
273
|
+
}
|
|
274
|
+
if (!task) {
|
|
275
|
+
const msg = `Task #${taskId} not found.`;
|
|
276
|
+
return {
|
|
277
|
+
llmContent: msg,
|
|
278
|
+
returnDisplay: msg,
|
|
279
|
+
error: { message: msg }
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
const reciprocalUpdates = [];
|
|
283
|
+
if (this.params.addBlocks?.length && this.params.status !== "completed") {
|
|
284
|
+
for (const blockedId of this.params.addBlocks) {
|
|
285
|
+
if (blockedId === taskId) continue;
|
|
286
|
+
reciprocalUpdates.push(
|
|
287
|
+
updateTask(
|
|
288
|
+
teamName,
|
|
289
|
+
blockedId,
|
|
290
|
+
{ addBlockedBy: [taskId] },
|
|
291
|
+
{ callerName: RECIPROCAL_CALLER }
|
|
292
|
+
)
|
|
293
|
+
);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
if (this.params.addBlockedBy?.length) {
|
|
297
|
+
for (const blockerId of this.params.addBlockedBy) {
|
|
298
|
+
if (blockerId === taskId) continue;
|
|
299
|
+
reciprocalUpdates.push(
|
|
300
|
+
updateTask(
|
|
301
|
+
teamName,
|
|
302
|
+
blockerId,
|
|
303
|
+
{ addBlocks: [taskId] },
|
|
304
|
+
{ callerName: RECIPROCAL_CALLER }
|
|
305
|
+
)
|
|
306
|
+
);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
if (reciprocalUpdates.length > 0) {
|
|
310
|
+
await Promise.all(reciprocalUpdates);
|
|
311
|
+
}
|
|
312
|
+
const llmContent = `Task #${taskId} updated (status: ${task.status}` + (task.owner ? `, owner: ${task.owner}` : "") + ").";
|
|
313
|
+
return { llmContent, returnDisplay: llmContent };
|
|
314
|
+
}
|
|
315
|
+
};
|
|
316
|
+
var TaskUpdateTool = class _TaskUpdateTool extends BaseDeclarativeTool {
|
|
317
|
+
constructor(config) {
|
|
318
|
+
super(
|
|
319
|
+
_TaskUpdateTool.Name,
|
|
320
|
+
ToolDisplayNames.TASK_UPDATE,
|
|
321
|
+
'Update an existing task. Can change status, owner, subject, description, and blocking relationships. Set status to "deleted" to remove a task. Setting status to "in_progress" auto-assigns you as owner if no owner is set.',
|
|
322
|
+
"other" /* Other */,
|
|
323
|
+
{
|
|
324
|
+
type: "object",
|
|
325
|
+
properties: {
|
|
326
|
+
taskId: {
|
|
327
|
+
type: "string",
|
|
328
|
+
description: "ID of the task to update."
|
|
329
|
+
},
|
|
330
|
+
status: {
|
|
331
|
+
type: "string",
|
|
332
|
+
enum: ["pending", "in_progress", "completed", "deleted"],
|
|
333
|
+
description: "New task status."
|
|
334
|
+
},
|
|
335
|
+
owner: {
|
|
336
|
+
type: "string",
|
|
337
|
+
description: "New owner agent name. Set to empty string to unassign."
|
|
338
|
+
},
|
|
339
|
+
subject: {
|
|
340
|
+
type: "string",
|
|
341
|
+
maxLength: 200,
|
|
342
|
+
description: "Updated task title."
|
|
343
|
+
},
|
|
344
|
+
description: {
|
|
345
|
+
type: "string",
|
|
346
|
+
maxLength: 1e4,
|
|
347
|
+
description: "Updated task description."
|
|
348
|
+
},
|
|
349
|
+
activeForm: {
|
|
350
|
+
type: "string",
|
|
351
|
+
maxLength: 200,
|
|
352
|
+
description: "Present tense label for UI."
|
|
353
|
+
},
|
|
354
|
+
metadata: {
|
|
355
|
+
type: "object",
|
|
356
|
+
description: "Metadata to merge. Set a key to null to delete it."
|
|
357
|
+
},
|
|
358
|
+
addBlocks: {
|
|
359
|
+
type: "array",
|
|
360
|
+
items: { type: "string" },
|
|
361
|
+
description: "Task IDs that this task blocks."
|
|
362
|
+
},
|
|
363
|
+
addBlockedBy: {
|
|
364
|
+
type: "array",
|
|
365
|
+
items: { type: "string" },
|
|
366
|
+
description: "Task IDs that block this task."
|
|
367
|
+
}
|
|
368
|
+
},
|
|
369
|
+
required: ["taskId"],
|
|
370
|
+
additionalProperties: false
|
|
371
|
+
}
|
|
372
|
+
);
|
|
373
|
+
this.config = config;
|
|
374
|
+
}
|
|
375
|
+
static {
|
|
376
|
+
__name(this, "TaskUpdateTool");
|
|
377
|
+
}
|
|
378
|
+
static Name = ToolNames.TASK_UPDATE;
|
|
379
|
+
createInvocation(params) {
|
|
380
|
+
return new TaskUpdateInvocation(this.config, params);
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* Forward the mutating fields to the classifier. Without this the
|
|
384
|
+
* base `''` sentinel projects to `task_update({})` and the AUTO
|
|
385
|
+
* classifier rules on an empty call — the rewritten instruction
|
|
386
|
+
* text and ownership/edge changes that `'ask'` exists to inspect
|
|
387
|
+
* would be invisible to it. See task-create.ts / send-message.ts.
|
|
388
|
+
*/
|
|
389
|
+
toAutoClassifierInput(params) {
|
|
390
|
+
return {
|
|
391
|
+
taskId: params.taskId,
|
|
392
|
+
status: params.status,
|
|
393
|
+
owner: params.owner,
|
|
394
|
+
subject: params.subject,
|
|
395
|
+
description: params.description,
|
|
396
|
+
addBlocks: params.addBlocks,
|
|
397
|
+
addBlockedBy: params.addBlockedBy
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
};
|
|
401
|
+
export {
|
|
402
|
+
TaskUpdateTool
|
|
403
|
+
};
|
|
404
|
+
/**
|
|
405
|
+
* @license
|
|
406
|
+
* Copyright 2025 Qwen
|
|
407
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
408
|
+
*/
|