@qwen-code/qwen-code 0.18.0-preview.1 → 0.18.0-preview.2
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/configuration/settings.md +17 -19
- package/bundled/qc-helper/docs/features/_meta.ts +0 -3
- package/bundled/qc-helper/docs/features/commands.md +14 -12
- package/bundled/qc-helper/docs/features/scheduled-tasks.md +1 -1
- package/bundled/qc-helper/docs/features/sub-agents.md +39 -0
- package/chunks/{agent-SXS4NQWS.js → agent-QB7TZ4HW.js} +22 -16
- package/chunks/agent-headless-APVHH7QM.js +50 -0
- package/chunks/{anthropicContentGenerator-4QBVSFSJ.js → anthropicContentGenerator-M45EVVRM.js} +4 -4
- package/chunks/{askUserQuestion-NOOLRWCJ.js → askUserQuestion-WM2KHM3K.js} +2 -2
- package/chunks/{ca-WRHFBIDH.js → ca-BARBRL6N.js} +48 -1
- package/chunks/{chunk-G763GDO6.js → chunk-2ZTWI7KH.js} +15 -3
- package/chunks/chunk-64WXLC72.js +98 -0
- package/chunks/{chunk-NQZ33PWX.js → chunk-7YKXFA3D.js} +11 -11
- package/chunks/chunk-AJIR24J2.js +59 -0
- package/chunks/{chunk-ERREX2ES.js → chunk-AVW55ZCO.js} +61 -23
- package/chunks/{chunk-SHUT5MQY.js → chunk-CNHFPN7T.js} +1 -1
- package/chunks/{chunk-5RNZ2QKF.js → chunk-CNSMKPK6.js} +1 -1
- package/chunks/{chunk-BBTV54KB.js → chunk-CWV3SJZS.js} +2 -2
- package/chunks/{chunk-GBEPNWYB.js → chunk-GX7VH5JQ.js} +1 -1
- package/chunks/chunk-HGJPQK33.js +2231 -0
- package/chunks/chunk-HV3ZZ7G4.js +159 -0
- package/chunks/{chunk-ZW7GBCRE.js → chunk-HXJE7VOG.js} +20 -31
- package/chunks/{chunk-PLYZAP4W.js → chunk-ICOI4E4S.js} +1 -1
- package/chunks/{chunk-6VFG3EUJ.js → chunk-JUGRPQAB.js} +1 -1
- package/chunks/{chunk-AVLOK27J.js → chunk-JVQOQ3OU.js} +1 -1
- package/chunks/{chunk-R5PDRHEF.js → chunk-JXAZUMDW.js} +67 -45
- package/chunks/{chunk-UABFCMPA.js → chunk-KC6ZMJ5X.js} +3 -1
- package/chunks/chunk-LD2XBG6Z.js +102 -0
- package/chunks/{chunk-MVX64PNU.js → chunk-LR62TEET.js} +1 -1
- package/chunks/{chunk-JMLIPZUU.js → chunk-MVIVIPCU.js} +3 -3
- package/chunks/{chunk-KOA52UTF.js → chunk-NW5QBUYO.js} +6 -6
- package/chunks/{chunk-JSYEZAYV.js → chunk-P4J26VDS.js} +2 -2
- package/chunks/{chunk-SCHRFI7O.js → chunk-PAEBHDIO.js} +1 -1
- package/chunks/{chunk-6KH2Q7XN.js → chunk-QCG6KPNM.js} +3685 -1897
- package/chunks/chunk-SKBPNJEW.js +45 -0
- package/chunks/{chunk-F5ORN4YO.js → chunk-UAMOBVVW.js} +1 -1
- package/chunks/chunk-XBFVXFB2.js +216 -0
- package/chunks/{chunk-D46KOV3C.js → chunk-Y7R6H6FT.js} +1 -1
- package/chunks/{chunk-F6FLCHCS.js → chunk-ZK4AMNIU.js} +39 -12
- package/chunks/{computer-use-CT6MU6P3.js → computer-use-B7VIUI7F.js} +22 -16
- package/chunks/contextCommand-63RZ3O5R.js +52 -0
- package/chunks/{cron-create-PIPMXQN4.js → cron-create-FI5LJVUS.js} +2 -2
- package/chunks/{cron-delete-6Y5XIDMS.js → cron-delete-ZGUXWBTG.js} +2 -2
- package/chunks/{cron-list-A4WNRUWZ.js → cron-list-QNNZGMN3.js} +2 -2
- package/chunks/{de-M5RPB2NB.js → de-YGKK2BC4.js} +48 -1
- package/chunks/{edit-A4YK7AIB.js → edit-6UBTS2J5.js} +23 -17
- package/chunks/{en-UMYKQAZE.js → en-HSQQNQUB.js} +73 -2
- package/chunks/{enter-worktree-VNEQINLC.js → enter-worktree-NN7LIXCM.js} +22 -16
- package/chunks/{exit-worktree-AVSMXC33.js → exit-worktree-GGSS5KIE.js} +22 -16
- package/chunks/{exitPlanMode-5SQYVROD.js → exitPlanMode-H323NHB2.js} +22 -16
- package/chunks/{fr-MPYXXXPW.js → fr-JXBKPJKQ.js} +48 -1
- package/chunks/{geminiContentGenerator-CR2WGARL.js → geminiContentGenerator-I4H2NLJG.js} +4 -4
- package/chunks/{glob-5V32KOG5.js → glob-OLCX57MD.js} +22 -16
- package/chunks/{grep-PUTEPBR4.js → grep-7HXIMDOW.js} +22 -16
- package/chunks/{ja-NFZ32AB3.js → ja-TGPZSP2B.js} +48 -1
- package/chunks/{keychain-token-storage-UHGOCDD6.js → keychain-token-storage-LB46DAEK.js} +2 -2
- package/chunks/{ls-34DLNYCD.js → ls-6PEZUK6O.js} +3 -3
- package/chunks/{lsp-NCDEHH3V.js → lsp-JZSJOVT7.js} +2 -2
- package/chunks/{monitor-EJBR5VCR.js → monitor-SQO7MVAV.js} +22 -16
- package/chunks/{notebook-edit-DZHGPP2L.js → notebook-edit-72L3EBAL.js} +23 -17
- package/chunks/{openaiContentGenerator-4QNV3CHM.js → openaiContentGenerator-FTR7CDWF.js} +12 -11
- package/chunks/{pt-BR43FRBA.js → pt-TIBG6BIO.js} +48 -1
- package/chunks/{qwenContentGenerator-3XOCEMQO.js → qwenContentGenerator-U5UFQ566.js} +24 -18
- package/chunks/{qwenOAuth2-KRJT35QH.js → qwenOAuth2-EFSECGHF.js} +4 -4
- package/chunks/{read-file-VZ2SQQIX.js → read-file-UA64EEQC.js} +8 -8
- package/chunks/{ripGrep-SBIZCPOL.js → ripGrep-WSYCWZVK.js} +22 -16
- package/chunks/{ru-DQCW2KHD.js → ru-JBCHCK4L.js} +48 -1
- package/chunks/{scheduler-H32DZVDV.js → scheduler-VBASHOCA.js} +22 -16
- package/chunks/send-message-OYJZ5TPG.js +244 -0
- package/chunks/{serve-56G4B5W6.js → serve-A7E2OJDR.js} +45 -36
- package/chunks/{shell-Q77KNP4N.js → shell-3NFOT6F5.js} +22 -16
- package/chunks/{skill-CLWFJYBG.js → skill-RA5YUREY.js} +10 -10
- package/chunks/{src-47L2LUOU.js → src-NFCMARMT.js} +182 -23
- package/chunks/{syntheticOutput-T5SWX3YF.js → syntheticOutput-DETQ2YM6.js} +3 -3
- package/chunks/task-create-Y3ZKTJIG.js +19 -0
- package/chunks/task-list-ONXJ3I3A.js +151 -0
- package/chunks/{task-stop-3VHAQMYM.js → task-stop-UHDC4N5B.js} +2 -2
- package/chunks/task-update-TCNOU3P5.js +397 -0
- package/chunks/team-create-6SR4OVRG.js +313 -0
- package/chunks/team-delete-EJ4U4DDP.js +114 -0
- package/chunks/{todoWrite-EAGJGKO5.js → todoWrite-TEYDRS5L.js} +4 -4
- package/chunks/{tool-search-Q75AYDTP.js → tool-search-OD435A3X.js} +8 -8
- package/chunks/{web-fetch-SS6IKK6N.js → web-fetch-6W67H5PO.js} +4 -4
- package/chunks/workflow-62DHH4EO.js +708 -0
- package/chunks/{write-file-RENGC25N.js → write-file-475L5OPP.js} +23 -17
- package/chunks/{zh-TW-IQZ4AD5M.js → zh-TW-G3HFHVVT.js} +74 -6
- package/chunks/{zh-6VFXOAR5.js → zh-VCLWO26Y.js} +77 -6
- package/cli.js +6417 -3115
- 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/locales/ca.js +51 -0
- package/locales/de.js +51 -0
- package/locales/en.js +83 -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 +85 -11
- package/locales/zh.js +89 -11
- package/package.json +2 -2
- package/bundled/qc-helper/docs/features/checkpointing.md +0 -77
- package/chunks/contextCommand-YODJQYIV.js +0 -46
- package/chunks/send-message-YYF56TS7.js +0 -151
|
@@ -0,0 +1,98 @@
|
|
|
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/utils/abortController.ts
|
|
11
|
+
init_esbuild_shims();
|
|
12
|
+
import { setMaxListeners } from "node:events";
|
|
13
|
+
var DEFAULT_MAX_LISTENERS = 50;
|
|
14
|
+
function createAbortController(maxListeners = DEFAULT_MAX_LISTENERS) {
|
|
15
|
+
const controller = new AbortController();
|
|
16
|
+
setMaxListeners(maxListeners, controller.signal);
|
|
17
|
+
return controller;
|
|
18
|
+
}
|
|
19
|
+
__name(createAbortController, "createAbortController");
|
|
20
|
+
function asSignal(parent) {
|
|
21
|
+
if (!parent) return void 0;
|
|
22
|
+
return parent instanceof AbortController ? parent.signal : parent;
|
|
23
|
+
}
|
|
24
|
+
__name(asSignal, "asSignal");
|
|
25
|
+
function createChildAbortController(parent, maxListeners) {
|
|
26
|
+
const child = createAbortController(maxListeners);
|
|
27
|
+
const parentSignal = asSignal(parent);
|
|
28
|
+
if (!parentSignal) return child;
|
|
29
|
+
if (parentSignal.aborted) {
|
|
30
|
+
child.abort(parentSignal.reason);
|
|
31
|
+
return child;
|
|
32
|
+
}
|
|
33
|
+
const weakParent = new WeakRef(parentSignal);
|
|
34
|
+
const handler = /* @__PURE__ */ __name(() => {
|
|
35
|
+
child.abort(weakParent.deref()?.reason);
|
|
36
|
+
}, "handler");
|
|
37
|
+
parentSignal.addEventListener("abort", handler, { once: true });
|
|
38
|
+
child.signal.addEventListener(
|
|
39
|
+
"abort",
|
|
40
|
+
() => {
|
|
41
|
+
weakParent.deref()?.removeEventListener("abort", handler);
|
|
42
|
+
},
|
|
43
|
+
{ once: true }
|
|
44
|
+
);
|
|
45
|
+
return child;
|
|
46
|
+
}
|
|
47
|
+
__name(createChildAbortController, "createChildAbortController");
|
|
48
|
+
function combineAbortSignals(signals, options) {
|
|
49
|
+
const controller = createAbortController(options?.maxListeners);
|
|
50
|
+
const alreadyAborted = signals.find((s) => s?.aborted);
|
|
51
|
+
if (alreadyAborted) {
|
|
52
|
+
controller.abort(alreadyAborted.reason);
|
|
53
|
+
return { signal: controller.signal, cleanup: /* @__PURE__ */ __name(() => {
|
|
54
|
+
}, "cleanup") };
|
|
55
|
+
}
|
|
56
|
+
const cleanups = [];
|
|
57
|
+
for (const sourceSignal of signals) {
|
|
58
|
+
if (!sourceSignal) continue;
|
|
59
|
+
if (sourceSignal.aborted) {
|
|
60
|
+
controller.abort(sourceSignal.reason);
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
const handler = /* @__PURE__ */ __name(() => controller.abort(sourceSignal.reason), "handler");
|
|
64
|
+
sourceSignal.addEventListener("abort", handler, { once: true });
|
|
65
|
+
cleanups.push(() => sourceSignal.removeEventListener("abort", handler));
|
|
66
|
+
}
|
|
67
|
+
const timeoutMs = options?.timeoutMs;
|
|
68
|
+
if (timeoutMs !== void 0 && timeoutMs > 0 && !controller.signal.aborted) {
|
|
69
|
+
const timeoutId = setTimeout(() => {
|
|
70
|
+
controller.abort(new DOMException("Operation timed out", "TimeoutError"));
|
|
71
|
+
}, timeoutMs);
|
|
72
|
+
cleanups.push(() => clearTimeout(timeoutId));
|
|
73
|
+
}
|
|
74
|
+
let done = false;
|
|
75
|
+
const cleanup = /* @__PURE__ */ __name(() => {
|
|
76
|
+
if (done) return;
|
|
77
|
+
done = true;
|
|
78
|
+
for (const fn of cleanups) fn();
|
|
79
|
+
}, "cleanup");
|
|
80
|
+
if (controller.signal.aborted) {
|
|
81
|
+
cleanup();
|
|
82
|
+
} else {
|
|
83
|
+
controller.signal.addEventListener("abort", cleanup, { once: true });
|
|
84
|
+
}
|
|
85
|
+
return { signal: controller.signal, cleanup };
|
|
86
|
+
}
|
|
87
|
+
__name(combineAbortSignals, "combineAbortSignals");
|
|
88
|
+
|
|
89
|
+
export {
|
|
90
|
+
createAbortController,
|
|
91
|
+
createChildAbortController,
|
|
92
|
+
combineAbortSignals
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* @license
|
|
96
|
+
* Copyright 2025 Qwen
|
|
97
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
98
|
+
*/
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
import {
|
|
4
4
|
resolveBundleDir
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-QCG6KPNM.js";
|
|
6
6
|
import {
|
|
7
7
|
Storage
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-JXAZUMDW.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-HSQQNQUB.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-G3HFHVVT.js"),
|
|
180
|
+
"./locales/zh.js": () => import("./zh-VCLWO26Y.js")
|
|
181
181
|
});
|
|
182
182
|
|
|
183
183
|
// packages/cli/src/i18n/index.ts
|
|
@@ -0,0 +1,59 @@
|
|
|
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/leaderPermissionBridge.ts
|
|
11
|
+
init_esbuild_shims();
|
|
12
|
+
var leaderCallbacks = null;
|
|
13
|
+
function registerLeader(callbacks) {
|
|
14
|
+
leaderCallbacks = callbacks;
|
|
15
|
+
}
|
|
16
|
+
__name(registerLeader, "registerLeader");
|
|
17
|
+
function getLeader() {
|
|
18
|
+
return leaderCallbacks;
|
|
19
|
+
}
|
|
20
|
+
__name(getLeader, "getLeader");
|
|
21
|
+
function unregisterLeader() {
|
|
22
|
+
leaderCallbacks = null;
|
|
23
|
+
}
|
|
24
|
+
__name(unregisterLeader, "unregisterLeader");
|
|
25
|
+
function forwardApproval(teammateName, teammateColor, details) {
|
|
26
|
+
if (!leaderCallbacks) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
leaderCallbacks.enqueueApproval({
|
|
30
|
+
teammateName,
|
|
31
|
+
teammateColor,
|
|
32
|
+
details
|
|
33
|
+
});
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
__name(forwardApproval, "forwardApproval");
|
|
37
|
+
function wrapConfirmWithBadge(original, teammateName, respond, _teammateColor) {
|
|
38
|
+
return {
|
|
39
|
+
...original,
|
|
40
|
+
title: `[${teammateName}] ${original.title}`,
|
|
41
|
+
onConfirm: /* @__PURE__ */ __name(async (outcome, payload) => {
|
|
42
|
+
await respond(outcome, payload);
|
|
43
|
+
}, "onConfirm")
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
__name(wrapConfirmWithBadge, "wrapConfirmWithBadge");
|
|
47
|
+
|
|
48
|
+
export {
|
|
49
|
+
registerLeader,
|
|
50
|
+
getLeader,
|
|
51
|
+
unregisterLeader,
|
|
52
|
+
forwardApproval,
|
|
53
|
+
wrapConfirmWithBadge
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* @license
|
|
57
|
+
* Copyright 2025 Qwen
|
|
58
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
59
|
+
*/
|
|
@@ -2,16 +2,19 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
import {
|
|
4
4
|
RequestTokenizer
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-CWV3SJZS.js";
|
|
6
|
+
import {
|
|
7
|
+
createChildAbortController
|
|
8
|
+
} from "./chunk-64WXLC72.js";
|
|
6
9
|
import {
|
|
7
10
|
OpenAIContentConverter,
|
|
8
11
|
TaggedThinkingParser,
|
|
9
12
|
openaiRequestCaptureContext
|
|
10
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-ZK4AMNIU.js";
|
|
11
14
|
import {
|
|
12
15
|
buildRuntimeFetchOptions,
|
|
13
16
|
redactProxyError
|
|
14
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-LR62TEET.js";
|
|
15
18
|
import {
|
|
16
19
|
CAPPED_DEFAULT_MAX_TOKENS,
|
|
17
20
|
DASHSCOPE_PROXY_BASE_URL,
|
|
@@ -22,14 +25,14 @@ import {
|
|
|
22
25
|
runtimeDiagnostics,
|
|
23
26
|
safeJsonParse,
|
|
24
27
|
tokenLimit
|
|
25
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-Y7R6H6FT.js";
|
|
26
29
|
import {
|
|
27
30
|
GenerateContentResponse
|
|
28
31
|
} from "./chunk-BNESGOSJ.js";
|
|
29
32
|
import {
|
|
30
33
|
createDebugLogger,
|
|
31
34
|
isAbortError
|
|
32
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-JXAZUMDW.js";
|
|
33
36
|
import {
|
|
34
37
|
init_esbuild_shims
|
|
35
38
|
} from "./chunk-A4BMJM77.js";
|
|
@@ -7944,17 +7947,23 @@ var ContentGenerationPipeline = class {
|
|
|
7944
7947
|
userPromptId,
|
|
7945
7948
|
false,
|
|
7946
7949
|
async (openaiRequest, context) => {
|
|
7947
|
-
const
|
|
7948
|
-
|
|
7949
|
-
|
|
7950
|
-
|
|
7951
|
-
|
|
7952
|
-
|
|
7953
|
-
|
|
7954
|
-
|
|
7955
|
-
|
|
7956
|
-
|
|
7957
|
-
|
|
7950
|
+
const parentSignal = request.config?.abortSignal;
|
|
7951
|
+
const perRequestAc = parentSignal ? createChildAbortController(parentSignal) : void 0;
|
|
7952
|
+
try {
|
|
7953
|
+
const openaiResponse = await this.client.chat.completions.create(
|
|
7954
|
+
openaiRequest,
|
|
7955
|
+
{
|
|
7956
|
+
signal: perRequestAc?.signal
|
|
7957
|
+
}
|
|
7958
|
+
);
|
|
7959
|
+
const geminiResponse = OpenAIContentConverter.convertOpenAIResponseToGemini(
|
|
7960
|
+
openaiResponse,
|
|
7961
|
+
context
|
|
7962
|
+
);
|
|
7963
|
+
return geminiResponse;
|
|
7964
|
+
} finally {
|
|
7965
|
+
perRequestAc?.abort();
|
|
7966
|
+
}
|
|
7958
7967
|
}
|
|
7959
7968
|
);
|
|
7960
7969
|
}
|
|
@@ -7964,13 +7973,35 @@ var ContentGenerationPipeline = class {
|
|
|
7964
7973
|
userPromptId,
|
|
7965
7974
|
true,
|
|
7966
7975
|
async (openaiRequest, context) => {
|
|
7967
|
-
const
|
|
7968
|
-
|
|
7969
|
-
|
|
7970
|
-
|
|
7971
|
-
|
|
7976
|
+
const parentSignal = request.config?.abortSignal;
|
|
7977
|
+
const perRequestAc = parentSignal ? createChildAbortController(parentSignal) : void 0;
|
|
7978
|
+
let stream;
|
|
7979
|
+
try {
|
|
7980
|
+
stream = await this.client.chat.completions.create(openaiRequest, {
|
|
7981
|
+
signal: perRequestAc?.signal
|
|
7982
|
+
});
|
|
7983
|
+
} catch (e) {
|
|
7984
|
+
perRequestAc?.abort();
|
|
7985
|
+
throw e;
|
|
7986
|
+
}
|
|
7987
|
+
if (!perRequestAc) {
|
|
7988
|
+
return this.processStreamWithLogging(stream, context, request);
|
|
7989
|
+
}
|
|
7990
|
+
const ac = perRequestAc;
|
|
7991
|
+
const innerStream = this.processStreamWithLogging(
|
|
7992
|
+
stream,
|
|
7993
|
+
context,
|
|
7994
|
+
request
|
|
7972
7995
|
);
|
|
7973
|
-
|
|
7996
|
+
async function* drainThenCleanup() {
|
|
7997
|
+
try {
|
|
7998
|
+
yield* innerStream;
|
|
7999
|
+
} finally {
|
|
8000
|
+
ac.abort();
|
|
8001
|
+
}
|
|
8002
|
+
}
|
|
8003
|
+
__name(drainThenCleanup, "drainThenCleanup");
|
|
8004
|
+
return drainThenCleanup();
|
|
7974
8005
|
}
|
|
7975
8006
|
);
|
|
7976
8007
|
}
|
|
@@ -8219,7 +8250,14 @@ var ContentGenerationPipeline = class {
|
|
|
8219
8250
|
model: effectiveModel,
|
|
8220
8251
|
modalities: this.contentGeneratorConfig.modalities ?? {},
|
|
8221
8252
|
startTime: Date.now(),
|
|
8222
|
-
splitToolMedia: providerOverrides.splitToolMedia ?? this.contentGeneratorConfig.splitToolMedia ??
|
|
8253
|
+
splitToolMedia: providerOverrides.splitToolMedia ?? this.contentGeneratorConfig.splitToolMedia ?? // Default true: the OpenAI Chat Completions spec only permits text on
|
|
8254
|
+
// `role: "tool"` messages, so tool-returned media (e.g. an image read
|
|
8255
|
+
// by read_file) embedded there is silently dropped or rejected by
|
|
8256
|
+
// strict providers (doubao / new-api / LM Studio) and the model never
|
|
8257
|
+
// sees it (QwenLM/qwen-code#4876). Splitting it into a follow-up user
|
|
8258
|
+
// message is spec-compliant and safe for permissive providers too.
|
|
8259
|
+
// Opt out via generationConfig.splitToolMedia = false.
|
|
8260
|
+
true,
|
|
8223
8261
|
...toolCallParser ? { toolCallParser } : {},
|
|
8224
8262
|
...responseParsingOptions ? { responseParsingOptions } : {},
|
|
8225
8263
|
...taggedThinkingParser ? { taggedThinkingParser } : {}
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
import {
|
|
4
4
|
TextTokenizer,
|
|
5
5
|
isSupportedImageMimeType
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-LR62TEET.js";
|
|
7
7
|
import {
|
|
8
8
|
createDebugLogger
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-JXAZUMDW.js";
|
|
10
10
|
import {
|
|
11
11
|
init_esbuild_shims
|
|
12
12
|
} from "./chunk-A4BMJM77.js";
|