@qwen-code/qwen-code 0.18.0-preview.1 → 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/SKILL.md +1 -2
- package/bundled/qc-helper/docs/_meta.ts +1 -0
- package/bundled/qc-helper/docs/configuration/settings.md +20 -24
- package/bundled/qc-helper/docs/features/_meta.ts +0 -3
- package/bundled/qc-helper/docs/features/approval-mode.md +10 -14
- package/bundled/qc-helper/docs/features/commands.md +47 -23
- package/bundled/qc-helper/docs/features/followup-suggestions.md +2 -2
- package/bundled/qc-helper/docs/features/scheduled-tasks.md +1 -1
- package/bundled/qc-helper/docs/features/sub-agents.md +60 -0
- 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-SXS4NQWS.js → agent-LOTJK6AH.js} +25 -19
- package/chunks/agent-headless-TU3EPMYU.js +50 -0
- package/chunks/{anthropicContentGenerator-4QBVSFSJ.js → anthropicContentGenerator-2HBRNQ3B.js} +7 -7
- package/chunks/{askUserQuestion-NOOLRWCJ.js → askUserQuestion-OGCMIBQM.js} +45 -3
- package/chunks/{ca-WRHFBIDH.js → ca-BARBRL6N.js} +48 -1
- package/chunks/{chunk-JMLIPZUU.js → chunk-2Y5SYSD3.js} +361 -583
- package/chunks/chunk-3DHXZ6EV.js +241 -0
- package/chunks/{chunk-AVLOK27J.js → chunk-3HTIVKZE.js} +1 -1
- package/chunks/{chunk-BNESGOSJ.js → chunk-55ZMG67I.js} +1 -1
- package/chunks/chunk-64WXLC72.js +98 -0
- package/chunks/{chunk-F6FLCHCS.js → chunk-6YIUGZTC.js} +1069 -211
- package/chunks/{chunk-C6WMLUNB.js → chunk-72LDN5PP.js} +1 -1
- package/chunks/{chunk-ERREX2ES.js → chunk-7BCMOPIM.js} +64 -24
- package/chunks/{chunk-6VFG3EUJ.js → chunk-A7B4ISQP.js} +1 -1
- package/chunks/{chunk-F5ORN4YO.js → chunk-B7HXHOHU.js} +1 -1
- package/chunks/{chunk-5RNZ2QKF.js → chunk-BIVG75CP.js} +1 -1
- package/chunks/{chunk-MVX64PNU.js → chunk-EYENRK4D.js} +1 -1
- package/chunks/{chunk-SZOEIL6S.js → chunk-H6BD2ELD.js} +1 -0
- package/chunks/{chunk-SCHRFI7O.js → chunk-HLPLOD42.js} +1 -1
- package/chunks/{chunk-R5PDRHEF.js → chunk-HR7SV7AY.js} +68 -47
- package/chunks/{chunk-JSYEZAYV.js → chunk-IDX6COTE.js} +2 -2
- package/chunks/{chunk-6KH2Q7XN.js → chunk-IWAYOW5Q.js} +17482 -11669
- package/chunks/chunk-J5MDQKJL.js +2230 -0
- package/chunks/{chunk-USE2VQ5P.js → chunk-JTQAQBTV.js} +21 -0
- package/chunks/{chunk-ZW7GBCRE.js → chunk-LBP46COL.js} +1014 -163
- package/chunks/chunk-LD2XBG6Z.js +102 -0
- package/chunks/{chunk-KOA52UTF.js → chunk-LEJ42GNY.js} +14 -14
- package/chunks/{chunk-D46KOV3C.js → chunk-M6VTDSVR.js} +1 -1
- package/chunks/{chunk-SHUT5MQY.js → chunk-MFBBBTNY.js} +1 -1
- package/chunks/{chunk-PLYZAP4W.js → chunk-OHEGWO4L.js} +101 -23
- package/chunks/{chunk-NQZ33PWX.js → chunk-PL3MVCWD.js} +11 -11
- package/chunks/chunk-QQDPRDVW.js +25 -0
- package/chunks/chunk-R7ODSGTK.js +159 -0
- package/chunks/{chunk-GBEPNWYB.js → chunk-SEGYWKIH.js} +1 -1
- package/chunks/chunk-SKBPNJEW.js +45 -0
- package/chunks/{chunk-UABFCMPA.js → chunk-SNGELLWX.js} +3 -1
- package/chunks/chunk-XBY7E2FX.js +605 -0
- package/chunks/{chunk-G763GDO6.js → chunk-XV4HCEVI.js} +36 -3
- package/chunks/{chunk-WFVXF3OM.js → chunk-Z2Z3GUXZ.js} +1 -0
- package/chunks/{chunk-BBTV54KB.js → chunk-ZTZ4DDQE.js} +2 -2
- package/chunks/{computer-use-CT6MU6P3.js → computer-use-3RH2DOM6.js} +25 -19
- package/chunks/contextCommand-K347QT6O.js +52 -0
- package/chunks/{cron-create-PIPMXQN4.js → cron-create-YJL3KFWI.js} +3 -3
- package/chunks/{cron-delete-6Y5XIDMS.js → cron-delete-WKWSJZQA.js} +3 -3
- package/chunks/{cron-list-A4WNRUWZ.js → cron-list-B52XEXAZ.js} +3 -3
- package/chunks/{de-M5RPB2NB.js → de-YGKK2BC4.js} +48 -1
- 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-A4YK7AIB.js → edit-KU4PJGEX.js} +26 -20
- package/chunks/{en-UMYKQAZE.js → en-DHGYHIHX.js} +77 -2
- package/chunks/{enter-worktree-VNEQINLC.js → enter-worktree-PPYIDCWI.js} +25 -19
- package/chunks/enterPlanMode-5CZDMCB4.js +158 -0
- package/chunks/{exit-worktree-AVSMXC33.js → exit-worktree-UY3CGHKC.js} +25 -19
- package/chunks/exitPlanMode-3DN4QNSG.js +703 -0
- package/chunks/{fr-MPYXXXPW.js → fr-JXBKPJKQ.js} +48 -1
- package/chunks/{geminiContentGenerator-CR2WGARL.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-5V32KOG5.js → glob-OFNQSS52.js} +25 -19
- package/chunks/{grep-PUTEPBR4.js → grep-6J2MSUM5.js} +28 -19
- package/chunks/{ja-NFZ32AB3.js → ja-TGPZSP2B.js} +48 -1
- package/chunks/{keychain-token-storage-UHGOCDD6.js → keychain-token-storage-6IU6ORQN.js} +3 -3
- package/chunks/{ls-34DLNYCD.js → ls-V3O6A5PT.js} +4 -4
- package/chunks/{lsp-NCDEHH3V.js → lsp-G2OCIFUA.js} +3 -3
- package/chunks/{monitor-EJBR5VCR.js → monitor-FKLHV423.js} +25 -19
- package/chunks/{notebook-edit-DZHGPP2L.js → notebook-edit-KTBYFKWG.js} +26 -20
- package/chunks/{openaiContentGenerator-4QNV3CHM.js → openaiContentGenerator-L5KSWQY7.js} +15 -14
- package/chunks/{pt-BR43FRBA.js → pt-TIBG6BIO.js} +48 -1
- package/chunks/{qwenContentGenerator-3XOCEMQO.js → qwenContentGenerator-PYOXLMBW.js} +27 -21
- package/chunks/{qwenOAuth2-KRJT35QH.js → qwenOAuth2-2KCKWDCF.js} +6 -5
- package/chunks/{read-file-VZ2SQQIX.js → read-file-JQVRK4NU.js} +11 -11
- package/chunks/ripGrep-2L4LPNAJ.js +48 -0
- package/chunks/{ru-DQCW2KHD.js → ru-JBCHCK4L.js} +48 -1
- package/chunks/{scheduler-H32DZVDV.js → scheduler-FGNXY4JQ.js} +25 -19
- package/chunks/send-message-SZFWNOCL.js +244 -0
- package/chunks/{serve-56G4B5W6.js → serve-N2IBLA3G.js} +13592 -4979
- package/chunks/{shell-Q77KNP4N.js → shell-PTEG6UX4.js} +25 -19
- package/chunks/{skill-CLWFJYBG.js → skill-X4NTK4NH.js} +64 -113
- package/chunks/{src-47L2LUOU.js → src-GLLQ3R5W.js} +307 -32
- package/chunks/{syntheticOutput-T5SWX3YF.js → syntheticOutput-IKAY5F6X.js} +4 -4
- package/chunks/task-create-MQICOJFV.js +19 -0
- package/chunks/task-list-RIHJCH32.js +151 -0
- package/chunks/{task-stop-3VHAQMYM.js → task-stop-FWZRFANS.js} +3 -3
- package/chunks/task-update-2LHPXOYM.js +408 -0
- package/chunks/team-create-2E4PF4KN.js +314 -0
- package/chunks/team-delete-DAUDQS4J.js +116 -0
- package/chunks/{todoWrite-EAGJGKO5.js → todoWrite-HTUACZES.js} +5 -5
- package/chunks/{tool-search-Q75AYDTP.js → tool-search-KTVULRES.js} +11 -11
- package/chunks/{web-fetch-SS6IKK6N.js → web-fetch-CZ7LLKPE.js} +5 -5
- package/chunks/workflow-L2ZUUDT2.js +960 -0
- package/chunks/{write-file-RENGC25N.js → write-file-ZEB2JDYH.js} +26 -20
- package/chunks/{zh-6VFXOAR5.js → zh-7H5OQC4I.js} +82 -7
- package/chunks/{zh-TW-IQZ4AD5M.js → zh-TW-P4IDHD3M.js} +79 -7
- package/cli.js +11248 -5119
- package/examples/agent/qwen-extension.json +1 -0
- package/examples/commands/qwen-extension.json +1 -0
- package/examples/context/qwen-extension.json +1 -0
- package/examples/mcp-server/qwen-extension.json +1 -0
- package/examples/skills/qwen-extension.json +1 -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 +51 -0
- package/locales/de.js +51 -0
- package/locales/en.js +89 -2
- package/locales/fr.js +53 -2
- package/locales/ja.js +52 -2
- package/locales/pt.js +52 -2
- package/locales/ru.js +53 -2
- package/locales/zh-TW.js +90 -11
- package/locales/zh.js +94 -11
- package/package.json +3 -2
- package/bundled/qc-helper/docs/features/checkpointing.md +0 -77
- package/chunks/contextCommand-YODJQYIV.js +0 -46
- package/chunks/exitPlanMode-5SQYVROD.js +0 -229
- package/chunks/ripGrep-SBIZCPOL.js +0 -42
- package/chunks/send-message-YYF56TS7.js +0 -151
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
// Force strict mode and setup for ESM
|
|
2
|
+
"use strict";
|
|
3
|
+
import {
|
|
4
|
+
init_esbuild_shims
|
|
5
|
+
} from "./chunk-A4BMJM77.js";
|
|
6
|
+
import {
|
|
7
|
+
__name
|
|
8
|
+
} from "./chunk-J2S4EL5Y.js";
|
|
9
|
+
|
|
10
|
+
// packages/core/src/agents/team/identity.ts
|
|
11
|
+
init_esbuild_shims();
|
|
12
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
13
|
+
var teammateIdentityStore = new AsyncLocalStorage();
|
|
14
|
+
function getTeammateContext() {
|
|
15
|
+
return teammateIdentityStore.getStore();
|
|
16
|
+
}
|
|
17
|
+
__name(getTeammateContext, "getTeammateContext");
|
|
18
|
+
function isInProcessTeammate() {
|
|
19
|
+
return teammateIdentityStore.getStore() !== void 0;
|
|
20
|
+
}
|
|
21
|
+
__name(isInProcessTeammate, "isInProcessTeammate");
|
|
22
|
+
function getAgentName() {
|
|
23
|
+
return teammateIdentityStore.getStore()?.agentName;
|
|
24
|
+
}
|
|
25
|
+
__name(getAgentName, "getAgentName");
|
|
26
|
+
function getTeamName() {
|
|
27
|
+
return teammateIdentityStore.getStore()?.teamName;
|
|
28
|
+
}
|
|
29
|
+
__name(getTeamName, "getTeamName");
|
|
30
|
+
function resolveActiveTeamName(fallback) {
|
|
31
|
+
return getTeamName() ?? fallback;
|
|
32
|
+
}
|
|
33
|
+
__name(resolveActiveTeamName, "resolveActiveTeamName");
|
|
34
|
+
var isTeammate = isInProcessTeammate;
|
|
35
|
+
function isTeamLead() {
|
|
36
|
+
return teammateIdentityStore.getStore()?.isTeamLead ?? false;
|
|
37
|
+
}
|
|
38
|
+
__name(isTeamLead, "isTeamLead");
|
|
39
|
+
function getTeammateColor() {
|
|
40
|
+
return teammateIdentityStore.getStore()?.color;
|
|
41
|
+
}
|
|
42
|
+
__name(getTeammateColor, "getTeammateColor");
|
|
43
|
+
function runWithTeammateIdentity(identity, fn) {
|
|
44
|
+
return teammateIdentityStore.run(identity, fn);
|
|
45
|
+
}
|
|
46
|
+
__name(runWithTeammateIdentity, "runWithTeammateIdentity");
|
|
47
|
+
|
|
48
|
+
// packages/core/src/agents/team/types.ts
|
|
49
|
+
init_esbuild_shims();
|
|
50
|
+
var MAX_TEAMMATES = 10;
|
|
51
|
+
var LEADER_NAME = "leader";
|
|
52
|
+
var TEAMS_DIR = "teams";
|
|
53
|
+
var TASKS_DIR = "tasks";
|
|
54
|
+
var TEAM_CONFIG_FILENAME = "config.json";
|
|
55
|
+
var INBOXES_DIR = "inboxes";
|
|
56
|
+
var TEAMMATE_COLORS = [
|
|
57
|
+
"#FF6B6B",
|
|
58
|
+
// red
|
|
59
|
+
"#4ECDC4",
|
|
60
|
+
// teal
|
|
61
|
+
"#45B7D1",
|
|
62
|
+
// blue
|
|
63
|
+
"#FFA07A",
|
|
64
|
+
// salmon
|
|
65
|
+
"#98D8C8",
|
|
66
|
+
// mint
|
|
67
|
+
"#DDA0DD",
|
|
68
|
+
// plum
|
|
69
|
+
"#F0E68C",
|
|
70
|
+
// khaki
|
|
71
|
+
"#87CEEB",
|
|
72
|
+
// sky blue
|
|
73
|
+
"#FFB347",
|
|
74
|
+
// orange
|
|
75
|
+
"#B0E0E6"
|
|
76
|
+
// powder blue
|
|
77
|
+
];
|
|
78
|
+
|
|
79
|
+
export {
|
|
80
|
+
teammateIdentityStore,
|
|
81
|
+
getTeammateContext,
|
|
82
|
+
isInProcessTeammate,
|
|
83
|
+
getAgentName,
|
|
84
|
+
getTeamName,
|
|
85
|
+
resolveActiveTeamName,
|
|
86
|
+
isTeammate,
|
|
87
|
+
isTeamLead,
|
|
88
|
+
getTeammateColor,
|
|
89
|
+
runWithTeammateIdentity,
|
|
90
|
+
MAX_TEAMMATES,
|
|
91
|
+
LEADER_NAME,
|
|
92
|
+
TEAMS_DIR,
|
|
93
|
+
TASKS_DIR,
|
|
94
|
+
TEAM_CONFIG_FILENAME,
|
|
95
|
+
INBOXES_DIR,
|
|
96
|
+
TEAMMATE_COLORS
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* @license
|
|
100
|
+
* Copyright 2025 Qwen
|
|
101
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
102
|
+
*/
|
|
@@ -2,24 +2,24 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
import {
|
|
4
4
|
t
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-PL3MVCWD.js";
|
|
6
6
|
import {
|
|
7
7
|
computeThresholds,
|
|
8
8
|
getCoreSystemPrompt
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-IWAYOW5Q.js";
|
|
10
10
|
import {
|
|
11
11
|
buildSkillLlmContent
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-OHEGWO4L.js";
|
|
13
13
|
import {
|
|
14
14
|
DiscoveredMCPTool,
|
|
15
15
|
uiTelemetryService
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-6YIUGZTC.js";
|
|
17
17
|
import {
|
|
18
18
|
ToolNames
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-XV4HCEVI.js";
|
|
20
20
|
import {
|
|
21
21
|
DEFAULT_TOKEN_LIMIT
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-M6VTDSVR.js";
|
|
23
23
|
import {
|
|
24
24
|
init_esbuild_shims
|
|
25
25
|
} from "./chunk-A4BMJM77.js";
|
|
@@ -752,7 +752,7 @@ function fmtTokens(tokens) {
|
|
|
752
752
|
}
|
|
753
753
|
__name(fmtTokens, "fmtTokens");
|
|
754
754
|
function fmtCategoryRow(label, tokens, contextWindowSize, indent = " ") {
|
|
755
|
-
const percentage = (tokens / contextWindowSize * 100).toFixed(1);
|
|
755
|
+
const percentage = contextWindowSize > 0 ? (tokens / contextWindowSize * 100).toFixed(1) : "0.0";
|
|
756
756
|
const right = `${fmtTokens(tokens)} tokens (${percentage}%)`;
|
|
757
757
|
const leftPart = `${indent}${label}`;
|
|
758
758
|
const totalWidth = 56;
|
|
@@ -899,7 +899,8 @@ var contextCommand = {
|
|
|
899
899
|
kind: "built-in" /* BUILT_IN */,
|
|
900
900
|
supportedModes: ["interactive", "non_interactive", "acp"],
|
|
901
901
|
action: /* @__PURE__ */ __name(async (context, args) => {
|
|
902
|
-
const
|
|
902
|
+
const normalizedArgs = args?.trim().toLowerCase();
|
|
903
|
+
const showDetails = normalizedArgs === "detail" || normalizedArgs === "-d";
|
|
903
904
|
const executionMode = context.executionMode ?? "interactive";
|
|
904
905
|
const { config } = context.services;
|
|
905
906
|
if (!config) {
|
|
@@ -923,13 +924,12 @@ var contextCommand = {
|
|
|
923
924
|
if (executionMode === "interactive") {
|
|
924
925
|
context.ui.addItem(contextUsageItem, Date.now());
|
|
925
926
|
return;
|
|
926
|
-
} else {
|
|
927
|
-
return {
|
|
928
|
-
type: "message",
|
|
929
|
-
messageType: "info",
|
|
930
|
-
content: formatContextUsageText(contextUsageItem)
|
|
931
|
-
};
|
|
932
927
|
}
|
|
928
|
+
return {
|
|
929
|
+
type: "message",
|
|
930
|
+
messageType: "info",
|
|
931
|
+
content: formatContextUsageText(contextUsageItem)
|
|
932
|
+
};
|
|
933
933
|
}, "action"),
|
|
934
934
|
subCommands: [
|
|
935
935
|
{
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
import {
|
|
4
4
|
createDebugLogger
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-HR7SV7AY.js";
|
|
6
6
|
import {
|
|
7
7
|
init_esbuild_shims
|
|
8
8
|
} from "./chunk-A4BMJM77.js";
|
|
@@ -10,6 +10,9 @@ import {
|
|
|
10
10
|
__name
|
|
11
11
|
} from "./chunk-J2S4EL5Y.js";
|
|
12
12
|
|
|
13
|
+
// packages/core/src/tools/skill-utils.ts
|
|
14
|
+
init_esbuild_shims();
|
|
15
|
+
|
|
13
16
|
// packages/core/src/utils/xml.ts
|
|
14
17
|
init_esbuild_shims();
|
|
15
18
|
function escapeXml(text) {
|
|
@@ -85,6 +88,99 @@ function escapeSystemReminderTags(text) {
|
|
|
85
88
|
}
|
|
86
89
|
__name(escapeSystemReminderTags, "escapeSystemReminderTags");
|
|
87
90
|
|
|
91
|
+
// packages/core/src/tools/skill-utils.ts
|
|
92
|
+
function buildSkillLlmContent(baseDir, body) {
|
|
93
|
+
return `Base directory for this skill: ${baseDir}
|
|
94
|
+
Important: ALWAYS resolve absolute paths from this base directory when working with skills.
|
|
95
|
+
|
|
96
|
+
${body}
|
|
97
|
+
`;
|
|
98
|
+
}
|
|
99
|
+
__name(buildSkillLlmContent, "buildSkillLlmContent");
|
|
100
|
+
async function collectAvailableSkillEntries(skillManager, config) {
|
|
101
|
+
const allSkills = await skillManager.listSkills();
|
|
102
|
+
const disabledNames = config.getDisabledSkillNames();
|
|
103
|
+
const isDisabled = /* @__PURE__ */ __name((name) => disabledNames.has(name.toLowerCase()), "isDisabled");
|
|
104
|
+
const availableSkills = allSkills.filter(
|
|
105
|
+
(s) => !s.disableModelInvocation && skillManager.isSkillActive(s) && !isDisabled(s.name)
|
|
106
|
+
);
|
|
107
|
+
const pendingConditionalSkillNames = new Set(
|
|
108
|
+
allSkills.filter(
|
|
109
|
+
(s) => !s.disableModelInvocation && s.paths && s.paths.length > 0 && !skillManager.isSkillActive(s) && !isDisabled(s.name)
|
|
110
|
+
).map((s) => s.name)
|
|
111
|
+
);
|
|
112
|
+
const provider = config.getModelInvocableCommandsProvider();
|
|
113
|
+
const allCommands = provider ? provider() : [];
|
|
114
|
+
const fileBasedSkillNames = new Set(
|
|
115
|
+
allSkills.filter((s) => !s.disableModelInvocation && !isDisabled(s.name)).map((s) => s.name)
|
|
116
|
+
);
|
|
117
|
+
const modelInvocableCommands = allCommands.filter(
|
|
118
|
+
(cmd) => !fileBasedSkillNames.has(cmd.name)
|
|
119
|
+
);
|
|
120
|
+
const entries = [
|
|
121
|
+
...availableSkills.map((s) => ({
|
|
122
|
+
name: s.name,
|
|
123
|
+
description: s.description,
|
|
124
|
+
whenToUse: s.whenToUse,
|
|
125
|
+
level: s.level
|
|
126
|
+
})),
|
|
127
|
+
...modelInvocableCommands.map((c) => ({
|
|
128
|
+
name: c.name,
|
|
129
|
+
description: c.description
|
|
130
|
+
}))
|
|
131
|
+
];
|
|
132
|
+
return {
|
|
133
|
+
availableSkills,
|
|
134
|
+
pendingConditionalSkillNames,
|
|
135
|
+
modelInvocableCommands,
|
|
136
|
+
entries
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
__name(collectAvailableSkillEntries, "collectAvailableSkillEntries");
|
|
140
|
+
function compareSkillEntries(a, b) {
|
|
141
|
+
const aGroup = a.level !== void 0 ? 0 : 1;
|
|
142
|
+
const bGroup = b.level !== void 0 ? 0 : 1;
|
|
143
|
+
if (aGroup !== bGroup) return aGroup - bGroup;
|
|
144
|
+
return a.name.localeCompare(b.name);
|
|
145
|
+
}
|
|
146
|
+
__name(compareSkillEntries, "compareSkillEntries");
|
|
147
|
+
function renderAvailableSkillsBlock(entries) {
|
|
148
|
+
return [...entries].sort(compareSkillEntries).map((entry) => {
|
|
149
|
+
if (entry.level !== void 0) {
|
|
150
|
+
const descText = `${escapeXml(entry.description)}${entry.whenToUse ? ` \u2014 ${escapeXml(entry.whenToUse)}` : ""} (${entry.level})`;
|
|
151
|
+
return `<skill>
|
|
152
|
+
<name>
|
|
153
|
+
${escapeXml(entry.name)}
|
|
154
|
+
</name>
|
|
155
|
+
<description>
|
|
156
|
+
${descText}
|
|
157
|
+
</description>
|
|
158
|
+
<location>
|
|
159
|
+
${entry.level}
|
|
160
|
+
</location>
|
|
161
|
+
</skill>`;
|
|
162
|
+
}
|
|
163
|
+
return `<skill>
|
|
164
|
+
<name>
|
|
165
|
+
${escapeXml(entry.name)}
|
|
166
|
+
</name>
|
|
167
|
+
<description>
|
|
168
|
+
${escapeXml(entry.description)}
|
|
169
|
+
</description>
|
|
170
|
+
</skill>`;
|
|
171
|
+
}).join("\n");
|
|
172
|
+
}
|
|
173
|
+
__name(renderAvailableSkillsBlock, "renderAvailableSkillsBlock");
|
|
174
|
+
function applySkillAllowedTools(permissionManager, allowedTools) {
|
|
175
|
+
if (!permissionManager || !allowedTools?.length) {
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
for (const rule of allowedTools) {
|
|
179
|
+
permissionManager.addSessionAllowRule(rule);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
__name(applySkillAllowedTools, "applySkillAllowedTools");
|
|
183
|
+
|
|
88
184
|
// packages/core/src/hooks/registerSkillHooks.ts
|
|
89
185
|
init_esbuild_shims();
|
|
90
186
|
var debugLogger = createDebugLogger("SKILL_HOOKS");
|
|
@@ -147,32 +243,14 @@ function prepareHookConfig(hook, skillRoot) {
|
|
|
147
243
|
}
|
|
148
244
|
__name(prepareHookConfig, "prepareHookConfig");
|
|
149
245
|
|
|
150
|
-
// packages/core/src/tools/skill-utils.ts
|
|
151
|
-
init_esbuild_shims();
|
|
152
|
-
function buildSkillLlmContent(baseDir, body) {
|
|
153
|
-
return `Base directory for this skill: ${baseDir}
|
|
154
|
-
Important: ALWAYS resolve absolute paths from this base directory when working with skills.
|
|
155
|
-
|
|
156
|
-
${body}
|
|
157
|
-
`;
|
|
158
|
-
}
|
|
159
|
-
__name(buildSkillLlmContent, "buildSkillLlmContent");
|
|
160
|
-
function applySkillAllowedTools(permissionManager, allowedTools) {
|
|
161
|
-
if (!permissionManager || !allowedTools?.length) {
|
|
162
|
-
return;
|
|
163
|
-
}
|
|
164
|
-
for (const rule of allowedTools) {
|
|
165
|
-
permissionManager.addSessionAllowRule(rule);
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
__name(applySkillAllowedTools, "applySkillAllowedTools");
|
|
169
|
-
|
|
170
246
|
export {
|
|
171
247
|
escapeXml,
|
|
172
248
|
escapeSystemReminderTags,
|
|
173
|
-
registerSkillHooks,
|
|
174
249
|
buildSkillLlmContent,
|
|
175
|
-
|
|
250
|
+
collectAvailableSkillEntries,
|
|
251
|
+
renderAvailableSkillsBlock,
|
|
252
|
+
applySkillAllowedTools,
|
|
253
|
+
registerSkillHooks
|
|
176
254
|
};
|
|
177
255
|
/**
|
|
178
256
|
* @license
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
import {
|
|
4
4
|
resolveBundleDir
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-IWAYOW5Q.js";
|
|
6
6
|
import {
|
|
7
7
|
Storage
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-HR7SV7AY.js";
|
|
9
9
|
import {
|
|
10
10
|
init_esbuild_shims
|
|
11
11
|
} from "./chunk-A4BMJM77.js";
|
|
@@ -169,15 +169,15 @@ init_esbuild_shims();
|
|
|
169
169
|
|
|
170
170
|
// import("./locales/**/*.js") in packages/cli/src/i18n/index.ts
|
|
171
171
|
var globImport_locales_js = __glob({
|
|
172
|
-
"./locales/ca.js": () => import("./ca-
|
|
173
|
-
"./locales/de.js": () => import("./de-
|
|
174
|
-
"./locales/en.js": () => import("./en-
|
|
175
|
-
"./locales/fr.js": () => import("./fr-
|
|
176
|
-
"./locales/ja.js": () => import("./ja-
|
|
177
|
-
"./locales/pt.js": () => import("./pt-
|
|
178
|
-
"./locales/ru.js": () => import("./ru-
|
|
179
|
-
"./locales/zh-TW.js": () => import("./zh-TW-
|
|
180
|
-
"./locales/zh.js": () => import("./zh-
|
|
172
|
+
"./locales/ca.js": () => import("./ca-BARBRL6N.js"),
|
|
173
|
+
"./locales/de.js": () => import("./de-YGKK2BC4.js"),
|
|
174
|
+
"./locales/en.js": () => import("./en-DHGYHIHX.js"),
|
|
175
|
+
"./locales/fr.js": () => import("./fr-JXBKPJKQ.js"),
|
|
176
|
+
"./locales/ja.js": () => import("./ja-TGPZSP2B.js"),
|
|
177
|
+
"./locales/pt.js": () => import("./pt-TIBG6BIO.js"),
|
|
178
|
+
"./locales/ru.js": () => import("./ru-JBCHCK4L.js"),
|
|
179
|
+
"./locales/zh-TW.js": () => import("./zh-TW-P4IDHD3M.js"),
|
|
180
|
+
"./locales/zh.js": () => import("./zh-7H5OQC4I.js")
|
|
181
181
|
});
|
|
182
182
|
|
|
183
183
|
// packages/cli/src/i18n/index.ts
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Force strict mode and setup for ESM
|
|
2
|
+
"use strict";
|
|
3
|
+
import {
|
|
4
|
+
init_esbuild_shims
|
|
5
|
+
} from "./chunk-A4BMJM77.js";
|
|
6
|
+
|
|
7
|
+
// packages/core/src/plan-gate/types.ts
|
|
8
|
+
init_esbuild_shims();
|
|
9
|
+
var CAPPED_REVIEW_LIMIT = 5;
|
|
10
|
+
var MAX_AGENT_RETRIES = 3;
|
|
11
|
+
var CAP_ESCALATION_LABELS = {
|
|
12
|
+
CONTINUE: "Continue editing plan",
|
|
13
|
+
APPROVE: "Approve execution"
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
CAPPED_REVIEW_LIMIT,
|
|
18
|
+
MAX_AGENT_RETRIES,
|
|
19
|
+
CAP_ESCALATION_LABELS
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* @license
|
|
23
|
+
* Copyright 2025 Qwen
|
|
24
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
25
|
+
*/
|
|
@@ -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-XV4HCEVI.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
|
+
*/
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// Force strict mode and setup for ESM
|
|
2
|
+
"use strict";
|
|
3
|
+
import {
|
|
4
|
+
init_esbuild_shims
|
|
5
|
+
} from "./chunk-A4BMJM77.js";
|
|
6
|
+
import {
|
|
7
|
+
__name
|
|
8
|
+
} from "./chunk-J2S4EL5Y.js";
|
|
9
|
+
|
|
10
|
+
// packages/core/src/agents/runtime/agent-types.ts
|
|
11
|
+
init_esbuild_shims();
|
|
12
|
+
var AgentTerminateMode = /* @__PURE__ */ ((AgentTerminateMode2) => {
|
|
13
|
+
AgentTerminateMode2["ERROR"] = "ERROR";
|
|
14
|
+
AgentTerminateMode2["TIMEOUT"] = "TIMEOUT";
|
|
15
|
+
AgentTerminateMode2["GOAL"] = "GOAL";
|
|
16
|
+
AgentTerminateMode2["MAX_TURNS"] = "MAX_TURNS";
|
|
17
|
+
AgentTerminateMode2["CANCELLED"] = "CANCELLED";
|
|
18
|
+
AgentTerminateMode2["SHUTDOWN"] = "SHUTDOWN";
|
|
19
|
+
return AgentTerminateMode2;
|
|
20
|
+
})(AgentTerminateMode || {});
|
|
21
|
+
var AgentStatus = /* @__PURE__ */ ((AgentStatus2) => {
|
|
22
|
+
AgentStatus2["INITIALIZING"] = "initializing";
|
|
23
|
+
AgentStatus2["RUNNING"] = "running";
|
|
24
|
+
AgentStatus2["IDLE"] = "idle";
|
|
25
|
+
AgentStatus2["COMPLETED"] = "completed";
|
|
26
|
+
AgentStatus2["FAILED"] = "failed";
|
|
27
|
+
AgentStatus2["CANCELLED"] = "cancelled";
|
|
28
|
+
return AgentStatus2;
|
|
29
|
+
})(AgentStatus || {});
|
|
30
|
+
var isTerminalStatus = /* @__PURE__ */ __name((s) => s === "completed" /* COMPLETED */ || s === "failed" /* FAILED */ || s === "cancelled" /* CANCELLED */, "isTerminalStatus");
|
|
31
|
+
var isSuccessStatus = /* @__PURE__ */ __name((s) => s === "idle" /* IDLE */ || s === "completed" /* COMPLETED */, "isSuccessStatus");
|
|
32
|
+
var isSettledStatus = /* @__PURE__ */ __name((s) => s === "idle" /* IDLE */ || isTerminalStatus(s), "isSettledStatus");
|
|
33
|
+
|
|
34
|
+
export {
|
|
35
|
+
AgentTerminateMode,
|
|
36
|
+
AgentStatus,
|
|
37
|
+
isTerminalStatus,
|
|
38
|
+
isSuccessStatus,
|
|
39
|
+
isSettledStatus
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* @license
|
|
43
|
+
* Copyright 2025 Qwen
|
|
44
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
45
|
+
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
import {
|
|
4
4
|
createDebugLogger
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-HR7SV7AY.js";
|
|
6
6
|
import {
|
|
7
7
|
init_esbuild_shims
|
|
8
8
|
} from "./chunk-A4BMJM77.js";
|
|
@@ -108,6 +108,7 @@ var DefaultHookOutput = class {
|
|
|
108
108
|
stopReason;
|
|
109
109
|
suppressOutput;
|
|
110
110
|
systemMessage;
|
|
111
|
+
terminalSequence;
|
|
111
112
|
decision;
|
|
112
113
|
reason;
|
|
113
114
|
hookSpecificOutput;
|
|
@@ -116,6 +117,7 @@ var DefaultHookOutput = class {
|
|
|
116
117
|
this.stopReason = data.stopReason;
|
|
117
118
|
this.suppressOutput = data.suppressOutput;
|
|
118
119
|
this.systemMessage = data.systemMessage;
|
|
120
|
+
this.terminalSequence = data.terminalSequence;
|
|
119
121
|
this.decision = data.decision;
|
|
120
122
|
this.reason = data.reason;
|
|
121
123
|
this.hookSpecificOutput = data.hookSpecificOutput;
|