@qwen-code/qwen-code 0.18.0-preview.2 → 0.18.1
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/loop/SKILL.md +2 -1
- package/bundled/qc-helper/docs/_meta.ts +1 -0
- package/bundled/qc-helper/docs/configuration/auth.md +1 -1
- package/bundled/qc-helper/docs/configuration/model-providers.md +12 -5
- package/bundled/qc-helper/docs/configuration/settings.md +33 -32
- package/bundled/qc-helper/docs/features/approval-mode.md +10 -14
- package/bundled/qc-helper/docs/features/commands.md +33 -11
- package/bundled/qc-helper/docs/features/dual-output.md +37 -3
- package/bundled/qc-helper/docs/features/followup-suggestions.md +2 -2
- package/bundled/qc-helper/docs/features/skills.md +29 -3
- package/bundled/qc-helper/docs/features/sub-agents.md +34 -12
- package/bundled/qc-helper/docs/qwen-serve-deploy-local.md +221 -0
- package/bundled/qc-helper/docs/qwen-serve.md +246 -28
- package/chunks/{agent-QB7TZ4HW.js → agent-XT7NHZ5H.js} +25 -24
- package/chunks/agent-headless-LNRE63ZL.js +51 -0
- package/chunks/{anthropicContentGenerator-M45EVVRM.js → anthropicContentGenerator-DCI26OQF.js} +7 -7
- package/chunks/{askUserQuestion-WM2KHM3K.js → askUserQuestion-ITYUTWLR.js} +45 -3
- package/chunks/{ca-BARBRL6N.js → ca-RK4QPLIX.js} +18 -1
- package/chunks/{chunk-CWV3SJZS.js → chunk-3NRO6NHX.js} +2 -2
- package/chunks/{chunk-BNESGOSJ.js → chunk-55ZMG67I.js} +1 -1
- package/chunks/{chunk-QCG6KPNM.js → chunk-6T7Y7USE.js} +18017 -11621
- package/chunks/{chunk-CNHFPN7T.js → chunk-7KPZFE5A.js} +1 -1
- package/chunks/{chunk-2ZTWI7KH.js → chunk-A2ZIEEGJ.js} +30 -22
- package/chunks/{chunk-JUGRPQAB.js → chunk-B4ZF2KSI.js} +1 -1
- package/chunks/chunk-BJ5HQ23U.js +178 -0
- package/chunks/{chunk-HXJE7VOG.js → chunk-BXYRCW2C.js} +1074 -144
- package/chunks/{chunk-ICOI4E4S.js → chunk-CPVI5J2L.js} +101 -23
- package/chunks/{chunk-HV3ZZ7G4.js → chunk-DHZREJTG.js} +2 -2
- package/chunks/{chunk-GX7VH5JQ.js → chunk-FIQECJTQ.js} +1 -1
- package/chunks/{chunk-SZOEIL6S.js → chunk-H6BD2ELD.js} +1 -0
- package/chunks/{chunk-JXAZUMDW.js → chunk-HA2UEYZP.js} +7 -4
- package/chunks/{chunk-USE2VQ5P.js → chunk-HED55F43.js} +26 -1
- package/chunks/{chunk-PAEBHDIO.js → chunk-HQUWWSSP.js} +1 -1
- package/chunks/{chunk-MVIVIPCU.js → chunk-IDYDPBBN.js} +361 -583
- package/chunks/{chunk-JVQOQ3OU.js → chunk-IQHSD7K5.js} +1 -1
- package/chunks/{chunk-NW5QBUYO.js → chunk-IS7UA4W3.js} +14 -14
- package/chunks/{chunk-UAMOBVVW.js → chunk-LXYWINWF.js} +1 -1
- package/chunks/{chunk-P4J26VDS.js → chunk-LYRSMKLS.js} +2 -2
- package/chunks/{chunk-Y7R6H6FT.js → chunk-LYSND7KR.js} +9 -4
- package/chunks/{chunk-LR62TEET.js → chunk-NNIYWQIS.js} +1 -1
- package/chunks/chunk-OMX7CUOE.js +356 -0
- package/chunks/{chunk-CNSMKPK6.js → chunk-QILTEBWS.js} +1 -1
- package/chunks/chunk-QQDPRDVW.js +25 -0
- package/chunks/{chunk-ZK4AMNIU.js → chunk-RON7LFNH.js} +1294 -314
- package/chunks/chunk-SFRV6BGY.js +243 -0
- package/chunks/{chunk-AVW55ZCO.js → chunk-WJ3SND6W.js} +37 -16
- package/chunks/{chunk-HGJPQK33.js → chunk-WPTCDQN6.js} +188 -534
- package/chunks/{chunk-7YKXFA3D.js → chunk-XZTNBSMW.js} +11 -11
- package/chunks/{chunk-C6WMLUNB.js → chunk-Y7KMDUEP.js} +1 -1
- package/chunks/{chunk-WFVXF3OM.js → chunk-Z2Z3GUXZ.js} +1 -0
- package/chunks/{chunk-KC6ZMJ5X.js → chunk-ZMIBJS45.js} +1 -1
- package/chunks/chunk-ZOFNJQNJ.js +607 -0
- package/chunks/computer-use-4YX3JGBV.js +2052 -0
- package/chunks/contextCommand-KS2H7MW5.js +53 -0
- package/chunks/cron-create-CAPUKK7I.js +184 -0
- package/chunks/{cron-delete-ZGUXWBTG.js → cron-delete-G3KAR26Q.js} +28 -5
- package/chunks/{cron-list-QNNZGMN3.js → cron-list-ZA4ZIUS5.js} +40 -7
- package/chunks/{de-YGKK2BC4.js → de-FGPM4KW5.js} +18 -1
- package/chunks/{devtools-IXE4UP72.js → devtools-FM6GJPYG.js} +1 -1
- package/chunks/{dist-ZMQ4TXD5.js → dist-7YWFWOCJ.js} +2 -2
- package/chunks/{dist-R2SXPG74.js → dist-VEGFONCF.js} +2 -2
- package/chunks/{dist-TE5QKMGR.js → dist-X4EXN7W6.js} +1 -1
- package/chunks/{dist-BXDUQ2QY.js → dist-YLS6NI7H.js} +1 -1
- package/chunks/{edit-6UBTS2J5.js → edit-2ARPEO4B.js} +26 -25
- package/chunks/{en-HSQQNQUB.js → en-VP6XPGEC.js} +9 -2
- package/chunks/{enter-worktree-NN7LIXCM.js → enter-worktree-IXNXNAW5.js} +25 -24
- package/chunks/enterPlanMode-TAKAGAYP.js +159 -0
- package/chunks/{exit-worktree-GGSS5KIE.js → exit-worktree-LHTRV7ML.js} +25 -24
- package/chunks/exitPlanMode-MK5UAITL.js +743 -0
- package/chunks/{fr-JXBKPJKQ.js → fr-ATYBVCLT.js} +18 -1
- package/chunks/{geminiContentGenerator-I4H2NLJG.js → geminiContentGenerator-HFJIGO77.js} +7 -7
- package/chunks/{getMachineId-bsd-F7GNPTER.js → getMachineId-bsd-4CASPIU4.js} +1 -1
- package/chunks/{getMachineId-darwin-T73DJL27.js → getMachineId-darwin-HPQPEMZR.js} +1 -1
- package/chunks/{getMachineId-linux-MKQTFPQM.js → getMachineId-linux-AUARKYHL.js} +1 -1
- package/chunks/{getMachineId-unsupported-MUR5KOQE.js → getMachineId-unsupported-S32ZDA2T.js} +1 -1
- package/chunks/{getMachineId-win-CDYFC6ZM.js → getMachineId-win-4EFLHYIJ.js} +1 -1
- package/chunks/{glob-OLCX57MD.js → glob-I2USLUSC.js} +25 -24
- package/chunks/{grep-7HXIMDOW.js → grep-WBIF7THR.js} +37 -30
- package/chunks/{ja-TGPZSP2B.js → ja-W2QEA2OI.js} +18 -1
- package/chunks/{keychain-token-storage-LB46DAEK.js → keychain-token-storage-QSTRHKKL.js} +3 -3
- package/chunks/{ls-6PEZUK6O.js → ls-2R5RHLX5.js} +4 -4
- package/chunks/{lsp-JZSJOVT7.js → lsp-XKH6ZIAN.js} +3 -3
- package/chunks/{monitor-SQO7MVAV.js → monitor-WU7UFATU.js} +25 -24
- package/chunks/{notebook-edit-72L3EBAL.js → notebook-edit-KUHYPXEM.js} +26 -25
- package/chunks/{openaiContentGenerator-FTR7CDWF.js → openaiContentGenerator-5PLHYJQL.js} +15 -15
- package/chunks/{pt-TIBG6BIO.js → pt-ZKEWJFBW.js} +18 -1
- package/chunks/{qwenContentGenerator-U5UFQ566.js → qwenContentGenerator-TSKW73KY.js} +27 -26
- package/chunks/{qwenOAuth2-EFSECGHF.js → qwenOAuth2-KK433U33.js} +6 -5
- package/chunks/{read-file-UA64EEQC.js → read-file-VIPF2PS6.js} +11 -11
- package/chunks/ripGrep-XLIZTYE7.js +49 -0
- package/chunks/{ru-JBCHCK4L.js → ru-VEKTPJ74.js} +18 -1
- package/chunks/{scheduler-VBASHOCA.js → scheduler-O66SLJGU.js} +25 -24
- package/chunks/{send-message-OYJZ5TPG.js → send-message-CTME7DXD.js} +3 -3
- package/chunks/{serve-A7E2OJDR.js → serve-BWOLYT62.js} +13164 -3840
- package/chunks/{shell-3NFOT6F5.js → shell-XE7UYKOO.js} +25 -24
- package/chunks/{skill-RA5YUREY.js → skill-RZWM6XMC.js} +64 -113
- package/chunks/{src-NFCMARMT.js → src-L5P7K4MH.js} +176 -44
- package/chunks/{syntheticOutput-DETQ2YM6.js → syntheticOutput-ZJGSU7OQ.js} +4 -4
- package/chunks/{task-create-Y3ZKTJIG.js → task-create-EE6JEM7G.js} +8 -7
- package/chunks/{task-list-ONXJ3I3A.js → task-list-EESYAC65.js} +7 -6
- package/chunks/{task-stop-UHDC4N5B.js → task-stop-XZVCFFYY.js} +3 -3
- package/chunks/{task-update-TCNOU3P5.js → task-update-EIO4HNE3.js} +21 -9
- package/chunks/{team-create-6SR4OVRG.js → team-create-R2H7Y3SG.js} +28 -26
- package/chunks/{team-delete-EJ4U4DDP.js → team-delete-A7LXPGV7.js} +9 -6
- package/chunks/{todoWrite-TEYDRS5L.js → todoWrite-VRKSGAWM.js} +5 -5
- package/chunks/{tool-search-OD435A3X.js → tool-search-USSQMTMS.js} +11 -11
- package/chunks/{web-fetch-6W67H5PO.js → web-fetch-GHAZUA54.js} +5 -5
- package/chunks/workflow-5LNNLNUR.js +1414 -0
- package/chunks/{write-file-475L5OPP.js → write-file-2I7HP24C.js} +26 -25
- package/chunks/{zh-VCLWO26Y.js → zh-OIXDDQHB.js} +10 -3
- package/chunks/{zh-TW-G3HFHVVT.js → zh-TW-6YFNCKTA.js} +10 -3
- package/cli-entry.js +19 -0
- package/cli.js +11064 -6628
- 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 +20 -2
- package/locales/de.js +21 -2
- package/locales/en.js +13 -4
- package/locales/fr.js +22 -2
- package/locales/ja.js +22 -2
- package/locales/pt.js +21 -2
- package/locales/ru.js +20 -2
- package/locales/zh-TW.js +11 -4
- package/locales/zh.js +11 -4
- package/package.json +5 -3
- package/chunks/agent-headless-APVHH7QM.js +0 -50
- package/chunks/chunk-AJIR24J2.js +0 -59
- package/chunks/chunk-SKBPNJEW.js +0 -45
- package/chunks/chunk-XBFVXFB2.js +0 -216
- package/chunks/computer-use-B7VIUI7F.js +0 -825
- package/chunks/contextCommand-63RZ3O5R.js +0 -52
- package/chunks/cron-create-FI5LJVUS.js +0 -140
- package/chunks/exitPlanMode-H323NHB2.js +0 -235
- package/chunks/ripGrep-WSYCWZVK.js +0 -48
- package/chunks/workflow-62DHH4EO.js +0 -708
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
import {
|
|
4
4
|
createDebugLogger
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-HA2UEYZP.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,7 +2,7 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
import {
|
|
4
4
|
createTask
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-ZOFNJQNJ.js";
|
|
6
6
|
import {
|
|
7
7
|
resolveActiveTeamName
|
|
8
8
|
} from "./chunk-LD2XBG6Z.js";
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
BaseToolInvocation,
|
|
12
12
|
ToolDisplayNames,
|
|
13
13
|
ToolNames
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-A2ZIEEGJ.js";
|
|
15
15
|
import {
|
|
16
16
|
init_esbuild_shims
|
|
17
17
|
} from "./chunk-A4BMJM77.js";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
init_esm,
|
|
5
5
|
isSpanContextValid,
|
|
6
6
|
trace
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-Z2Z3GUXZ.js";
|
|
8
8
|
import {
|
|
9
9
|
init_esbuild_shims
|
|
10
10
|
} from "./chunk-A4BMJM77.js";
|
|
@@ -640,6 +640,9 @@ var Storage = class _Storage {
|
|
|
640
640
|
const targetDir = path2.join(tempDir, hash);
|
|
641
641
|
return targetDir;
|
|
642
642
|
}
|
|
643
|
+
getToolResultsDir() {
|
|
644
|
+
return path2.join(this.getProjectTempDir(), "tool-results");
|
|
645
|
+
}
|
|
643
646
|
ensureProjectTempDirExists() {
|
|
644
647
|
fs2.mkdirSync(this.getProjectTempDir(), { recursive: true });
|
|
645
648
|
}
|
|
@@ -810,9 +813,9 @@ var globalSession = null;
|
|
|
810
813
|
var sessionContext = new AsyncLocalStorage2();
|
|
811
814
|
function isDebugLogFileEnabled() {
|
|
812
815
|
const value = process.env["QWEN_DEBUG_LOG_FILE"];
|
|
813
|
-
if (!value) return
|
|
816
|
+
if (!value) return false;
|
|
814
817
|
const normalized = value.trim().toLowerCase();
|
|
815
|
-
return !["0", "false", "off", "no"].includes(normalized);
|
|
818
|
+
return !["", "0", "false", "off", "no"].includes(normalized);
|
|
816
819
|
}
|
|
817
820
|
__name(isDebugLogFileEnabled, "isDebugLogFileEnabled");
|
|
818
821
|
function getActiveSession() {
|
|
@@ -963,8 +966,8 @@ export {
|
|
|
963
966
|
Storage,
|
|
964
967
|
updateSymlink,
|
|
965
968
|
setSessionContext,
|
|
966
|
-
getSessionContext,
|
|
967
969
|
getCurrentSessionId,
|
|
970
|
+
getActiveSpanTraceContext,
|
|
968
971
|
getTraceContext,
|
|
969
972
|
formatTraceparent,
|
|
970
973
|
setShellTracePropagation,
|
|
@@ -692,6 +692,27 @@ var ChannelBase = class {
|
|
|
692
692
|
}
|
|
693
693
|
}
|
|
694
694
|
const sessionId = await this.router.resolve(this.name, envelope.senderId, envelope.chatId, envelope.threadId, this.config.cwd);
|
|
695
|
+
if (envelope.text.startsWith("!")) {
|
|
696
|
+
const cmd = envelope.text.slice(1).trim();
|
|
697
|
+
const bridgeShellCommand = this.bridge["shellCommand"];
|
|
698
|
+
if (cmd && typeof bridgeShellCommand === "function") {
|
|
699
|
+
try {
|
|
700
|
+
const result2 = await bridgeShellCommand(sessionId, cmd);
|
|
701
|
+
const longestRun = Math.max(0, ...Array.from((result2.output || "").matchAll(/`+/g), (m) => m[0].length));
|
|
702
|
+
const fence = "`".repeat(Math.max(3, longestRun + 1));
|
|
703
|
+
const output = result2.output ? `${fence}
|
|
704
|
+
${result2.output}
|
|
705
|
+
${fence}` : "(no output)";
|
|
706
|
+
const exitLine = result2.exitCode !== null && result2.exitCode !== 0 ? `
|
|
707
|
+
Exit code: ${result2.exitCode}` : "";
|
|
708
|
+
await this.sendMessage(envelope.chatId, `$ ${cmd}
|
|
709
|
+
${output}${exitLine}`);
|
|
710
|
+
} catch (error) {
|
|
711
|
+
await this.sendMessage(envelope.chatId, `Shell command failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
712
|
+
}
|
|
713
|
+
return;
|
|
714
|
+
}
|
|
715
|
+
}
|
|
695
716
|
let promptText = envelope.text;
|
|
696
717
|
if (envelope.referencedText) {
|
|
697
718
|
promptText = `[Replying to: "${envelope.referencedText}"]
|
|
@@ -856,7 +877,11 @@ var AcpBridge = class extends EventEmitter {
|
|
|
856
877
|
}
|
|
857
878
|
async start() {
|
|
858
879
|
const { cliEntryPath, cwd } = this.options;
|
|
859
|
-
const args = [
|
|
880
|
+
const args = [
|
|
881
|
+
...process.execArgv.filter((a) => !/^--inspect(-brk)?($|=)/.test(a)),
|
|
882
|
+
cliEntryPath,
|
|
883
|
+
"--acp"
|
|
884
|
+
];
|
|
860
885
|
if (this.options.model) {
|
|
861
886
|
args.push("--model", this.options.model);
|
|
862
887
|
}
|