@qwen-code/qwen-code 0.15.12-preview.3 → 0.16.0-preview.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/docs/configuration/settings.md +20 -24
- package/bundled/qc-helper/docs/qwen-serve.md +29 -10
- package/chunks/{agent-LIAWUWAO.js → agent-ZNQPH67I.js} +15 -15
- package/chunks/{anthropicContentGenerator-4QE6LTVV.js → anthropicContentGenerator-ICBDZ6R2.js} +4 -4
- package/chunks/{askUserQuestion-QFSCBTUO.js → askUserQuestion-WQILGUSQ.js} +2 -2
- package/chunks/{chunk-SQNQIOD5.js → chunk-2B7UBDY5.js} +2 -2
- package/chunks/chunk-3MBY4GKN.js +350 -0
- package/chunks/{chunk-GC5RXNL2.js → chunk-7QXHXMC6.js} +23 -7
- package/chunks/{chunk-XLQ4E5PS.js → chunk-C3LHPHN2.js} +11 -11
- package/chunks/{chunk-UXW7MYAW.js → chunk-CW44BRRA.js} +1 -1
- package/chunks/{chunk-G27O2LD2.js → chunk-D5NTAHYL.js} +1 -1
- package/chunks/{chunk-CBVB66WY.js → chunk-EDYSNFEM.js} +1 -1
- package/chunks/{chunk-OCC4MZRS.js → chunk-F23NCRJ2.js} +1 -1
- package/chunks/{chunk-FYMSCRHM.js → chunk-FZIUV27X.js} +1 -1
- package/chunks/{chunk-5QQ5FGTU.js → chunk-G7YTSRES.js} +1 -1
- package/chunks/{chunk-AOJ3BBY7.js → chunk-JHMX4QTD.js} +9 -9
- package/chunks/{chunk-TPGOGCWM.js → chunk-JYQUJ5DS.js} +1 -1
- package/chunks/{chunk-FKVKVE6N.js → chunk-KXZ4TJB4.js} +1 -1
- package/chunks/{chunk-AJSOD5IR.js → chunk-MNPZ2WO6.js} +535 -141
- package/chunks/{chunk-BXNCPI75.js → chunk-NAID3ZWF.js} +2 -2
- package/chunks/{chunk-JMZQICAL.js → chunk-PPHYLJSS.js} +1 -1
- package/chunks/{chunk-CM2IESUE.js → chunk-PR4T27R7.js} +1 -1
- package/chunks/{chunk-CAWKL3UC.js → chunk-VTPOO6GV.js} +1 -1
- package/chunks/{chunk-GJXIKCKL.js → chunk-XP27SJMH.js} +76 -5
- package/chunks/{chunk-B7ZL7HUA.js → chunk-XVHR7ATJ.js} +1 -1
- package/chunks/{contextCommand-SVLAZMQL.js → contextCommand-IGBCEXI4.js} +16 -16
- package/chunks/{cron-create-WUTD5ZTH.js → cron-create-AVI3Q267.js} +2 -2
- package/chunks/{cron-delete-N3UQYCRA.js → cron-delete-ZCEGDXXV.js} +2 -2
- package/chunks/{cron-list-Z6RJJ4YH.js → cron-list-VN653OK5.js} +2 -2
- package/chunks/{edit-VNAZBIZR.js → edit-74Q4AFHQ.js} +16 -16
- package/chunks/{en-NRN4QBAT.js → en-FIUWJSZR.js} +1 -0
- package/chunks/{enter-worktree-FOF5YZIV.js → enter-worktree-H72HXC7D.js} +15 -15
- package/chunks/{exit-worktree-Y6QVAO3C.js → exit-worktree-FGIQO3S3.js} +15 -15
- package/chunks/{exitPlanMode-QZKO7GH7.js → exitPlanMode-NBR2PK2D.js} +15 -15
- package/chunks/{geminiContentGenerator-DYHZPKJX.js → geminiContentGenerator-33RP4WKD.js} +3 -3
- package/chunks/{glob-G7XATELV.js → glob-WEE3CJL6.js} +15 -15
- package/chunks/{grep-4SETMY47.js → grep-DZKSBFZK.js} +15 -15
- package/chunks/{keychain-token-storage-DMFP5IJM.js → keychain-token-storage-335UOLJ6.js} +2 -2
- package/chunks/{ls-SUILOZZB.js → ls-6F3VSP6S.js} +3 -3
- package/chunks/{lsp-6TQBWVMZ.js → lsp-67Y7DJN5.js} +2 -2
- package/chunks/{monitor-JTLJBJ7H.js → monitor-EDZWEZVS.js} +15 -15
- package/chunks/{openaiContentGenerator-3H7XOZBW.js → openaiContentGenerator-5NQG3W64.js} +10 -10
- package/chunks/{qwenContentGenerator-FAU3QPYO.js → qwenContentGenerator-4DPUUS6R.js} +17 -17
- package/chunks/{qwenOAuth2-JSQ7EPR3.js → qwenOAuth2-JE7H47TE.js} +3 -3
- package/chunks/{read-file-WWUQVNCZ.js → read-file-CQOF7BQ2.js} +7 -7
- package/chunks/{ripGrep-WCOAIWL6.js → ripGrep-KR5LKGTI.js} +15 -15
- package/chunks/{send-message-Q2JRAC3J.js → send-message-GB4AQZNC.js} +2 -2
- package/chunks/{serve-VJEEEXA6.js → serve-GAD2PEST.js} +501 -286
- package/chunks/{shell-IAOKGIJ6.js → shell-E2HMCBGR.js} +15 -15
- package/chunks/{skill-NHW6222K.js → skill-KDZH6UZ6.js} +9 -9
- package/chunks/{src-OWV5HVQQ.js → src-LY4RU5AI.js} +17 -15
- package/chunks/{syntheticOutput-S4DRGMQM.js → syntheticOutput-HFL3DE7R.js} +3 -3
- package/chunks/{task-stop-7THHVAQS.js → task-stop-ZQF26RXS.js} +2 -2
- package/chunks/{todoWrite-WKUGUTPX.js → todoWrite-U4SC643O.js} +3 -3
- package/chunks/{tool-search-MSJ6SXLI.js → tool-search-U4XQVLFU.js} +7 -7
- package/chunks/{web-fetch-OZE6ZQUF.js → web-fetch-BRWZ4WSE.js} +4 -4
- package/chunks/{write-file-RKCENFZ5.js → write-file-NBLRMNGB.js} +16 -16
- package/chunks/{zh-TW-XZEHEV5S.js → zh-TW-552S24LR.js} +1 -0
- package/chunks/{zh-RN3JULHO.js → zh-V32QONGV.js} +1 -0
- package/cli.js +598 -59
- package/locales/en.js +2 -0
- package/locales/zh-TW.js +1 -0
- package/locales/zh.js +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,350 @@
|
|
|
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/cli/src/serve/eventBus.ts
|
|
11
|
+
init_esbuild_shims();
|
|
12
|
+
var EVENT_SCHEMA_VERSION = 1;
|
|
13
|
+
var DEFAULT_MAX_QUEUED = 256;
|
|
14
|
+
var DEFAULT_RING_SIZE = 8e3;
|
|
15
|
+
var WARN_THRESHOLD_RATIO = 0.75;
|
|
16
|
+
var WARN_RESET_RATIO = 0.375;
|
|
17
|
+
var DEFAULT_MAX_SUBSCRIBERS = 64;
|
|
18
|
+
var SubscriberLimitExceededError = class extends Error {
|
|
19
|
+
static {
|
|
20
|
+
__name(this, "SubscriberLimitExceededError");
|
|
21
|
+
}
|
|
22
|
+
limit;
|
|
23
|
+
constructor(limit) {
|
|
24
|
+
super(`EventBus subscriber limit reached (${limit})`);
|
|
25
|
+
this.name = "SubscriberLimitExceededError";
|
|
26
|
+
this.limit = limit;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
var EventBus = class {
|
|
30
|
+
constructor(ringSize = DEFAULT_RING_SIZE, maxSubscribers = DEFAULT_MAX_SUBSCRIBERS) {
|
|
31
|
+
this.ringSize = ringSize;
|
|
32
|
+
this.maxSubscribers = maxSubscribers;
|
|
33
|
+
}
|
|
34
|
+
static {
|
|
35
|
+
__name(this, "EventBus");
|
|
36
|
+
}
|
|
37
|
+
nextId = 1;
|
|
38
|
+
ring = [];
|
|
39
|
+
subs = /* @__PURE__ */ new Set();
|
|
40
|
+
closed = false;
|
|
41
|
+
/** Most recent id ever assigned by `publish`. 0 if no events published. */
|
|
42
|
+
get lastEventId() {
|
|
43
|
+
return this.nextId - 1;
|
|
44
|
+
}
|
|
45
|
+
/** Snapshot of the live subscriber count. */
|
|
46
|
+
get subscriberCount() {
|
|
47
|
+
return this.subs.size;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Publish an event to the bus. Returns the constructed `BridgeEvent`
|
|
51
|
+
* (with `id` + `v` assigned) on success, or `undefined` when the
|
|
52
|
+
* bus is closed.
|
|
53
|
+
*
|
|
54
|
+
* **Never throws** (BX9_p contract). Closing the bus mid-publish
|
|
55
|
+
* is the only abnormal path and is handled as a return-undefined
|
|
56
|
+
* no-op; subscriber-enqueue failures are caught internally and
|
|
57
|
+
* translated to per-subscriber eviction. Call sites can rely on
|
|
58
|
+
* this — the historical `try { publish(...) } catch {}` blocks in
|
|
59
|
+
* `httpAcpBridge.ts` are defense-in-depth, not load-bearing, and
|
|
60
|
+
* may be removed in a future cleanup pass without changing
|
|
61
|
+
* behavior. Don't add new try/catch wrappers around `publish()`.
|
|
62
|
+
*/
|
|
63
|
+
publish(input) {
|
|
64
|
+
if (this.closed) return void 0;
|
|
65
|
+
const event = {
|
|
66
|
+
id: this.nextId++,
|
|
67
|
+
v: EVENT_SCHEMA_VERSION,
|
|
68
|
+
...input
|
|
69
|
+
};
|
|
70
|
+
this.ring.push(event);
|
|
71
|
+
if (this.ring.length > this.ringSize) this.ring.shift();
|
|
72
|
+
for (const sub of Array.from(this.subs)) {
|
|
73
|
+
if (sub.evicted) continue;
|
|
74
|
+
if (!sub.queue.push(event)) {
|
|
75
|
+
sub.evicted = true;
|
|
76
|
+
const evictionFrame = {
|
|
77
|
+
v: EVENT_SCHEMA_VERSION,
|
|
78
|
+
type: "client_evicted",
|
|
79
|
+
data: { reason: "queue_overflow", droppedAfter: event.id }
|
|
80
|
+
};
|
|
81
|
+
sub.queue.forcePush(evictionFrame);
|
|
82
|
+
sub.queue.close();
|
|
83
|
+
sub.dispose();
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
const liveSize = sub.queue.size;
|
|
87
|
+
if (!sub.warned && liveSize >= sub.warnThreshold) {
|
|
88
|
+
sub.warned = true;
|
|
89
|
+
const warningFrame = {
|
|
90
|
+
v: EVENT_SCHEMA_VERSION,
|
|
91
|
+
type: "slow_client_warning",
|
|
92
|
+
data: {
|
|
93
|
+
queueSize: liveSize,
|
|
94
|
+
maxQueued: sub.maxQueued,
|
|
95
|
+
// `event.id` is always defined here — the just-published
|
|
96
|
+
// `event` is constructed at the top of `publish()` with
|
|
97
|
+
// `id: this.nextId++`. No `??` fallback needed.
|
|
98
|
+
lastEventId: event.id
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
sub.queue.forcePush(warningFrame);
|
|
102
|
+
} else if (sub.warned && liveSize <= sub.warnResetThreshold) {
|
|
103
|
+
sub.warned = false;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return event;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Note: registration is synchronous — by the time `subscribe()` returns,
|
|
110
|
+
* the subscriber is already attached and will receive any subsequent
|
|
111
|
+
* `publish()` even if the consumer hasn't started iterating yet. (A
|
|
112
|
+
* generator-style implementation would defer registration to the first
|
|
113
|
+
* `next()` call, which races with publishes that happen before the
|
|
114
|
+
* consumer's first await.)
|
|
115
|
+
*
|
|
116
|
+
* The returned iterator is NOT safe to drive from concurrent callers —
|
|
117
|
+
* two simultaneous `.next()` calls would race for the same event from
|
|
118
|
+
* the underlying queue. Daemon usage is sequential (`for await ... of`
|
|
119
|
+
* inside the SSE route), so this is safe in production. Callers that
|
|
120
|
+
* fan an iterator out to multiple consumers must serialize themselves.
|
|
121
|
+
*/
|
|
122
|
+
subscribe(opts = {}) {
|
|
123
|
+
if (this.closed) {
|
|
124
|
+
return emptyAsyncIterable();
|
|
125
|
+
}
|
|
126
|
+
if (this.subs.size >= this.maxSubscribers) {
|
|
127
|
+
throw new SubscriberLimitExceededError(this.maxSubscribers);
|
|
128
|
+
}
|
|
129
|
+
const maxQueued = opts.maxQueued ?? DEFAULT_MAX_QUEUED;
|
|
130
|
+
const queue = new BoundedAsyncQueue(maxQueued);
|
|
131
|
+
const sub = {
|
|
132
|
+
queue,
|
|
133
|
+
evicted: false,
|
|
134
|
+
maxQueued,
|
|
135
|
+
warnThreshold: WARN_THRESHOLD_RATIO * maxQueued,
|
|
136
|
+
warnResetThreshold: WARN_RESET_RATIO * maxQueued,
|
|
137
|
+
warned: false,
|
|
138
|
+
dispose: /* @__PURE__ */ __name(() => {
|
|
139
|
+
}, "dispose")
|
|
140
|
+
};
|
|
141
|
+
this.subs.add(sub);
|
|
142
|
+
if (opts.lastEventId !== void 0) {
|
|
143
|
+
for (const e of this.ring) {
|
|
144
|
+
if (e.id !== void 0 && e.id > opts.lastEventId) {
|
|
145
|
+
queue.forcePush(e);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
let disposed = false;
|
|
150
|
+
const dispose = /* @__PURE__ */ __name(() => {
|
|
151
|
+
if (disposed) return;
|
|
152
|
+
disposed = true;
|
|
153
|
+
this.subs.delete(sub);
|
|
154
|
+
opts.signal?.removeEventListener("abort", onAbort);
|
|
155
|
+
}, "dispose");
|
|
156
|
+
sub.dispose = dispose;
|
|
157
|
+
const onAbort = /* @__PURE__ */ __name(() => {
|
|
158
|
+
queue.close({ drain: false });
|
|
159
|
+
dispose();
|
|
160
|
+
}, "onAbort");
|
|
161
|
+
if (opts.signal) {
|
|
162
|
+
if (opts.signal.aborted) {
|
|
163
|
+
onAbort();
|
|
164
|
+
} else {
|
|
165
|
+
opts.signal.addEventListener("abort", onAbort, { once: true });
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return {
|
|
169
|
+
[Symbol.asyncIterator]: () => ({
|
|
170
|
+
async next() {
|
|
171
|
+
const r = await queue.next();
|
|
172
|
+
if (r.done) dispose();
|
|
173
|
+
return r;
|
|
174
|
+
},
|
|
175
|
+
async return() {
|
|
176
|
+
queue.close();
|
|
177
|
+
dispose();
|
|
178
|
+
return { value: void 0, done: true };
|
|
179
|
+
}
|
|
180
|
+
})
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
/** Close all live subscribers and prevent further `publish`/`subscribe`. */
|
|
184
|
+
close() {
|
|
185
|
+
if (this.closed) return;
|
|
186
|
+
this.closed = true;
|
|
187
|
+
for (const sub of this.subs) sub.queue.close();
|
|
188
|
+
this.subs.clear();
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
function emptyAsyncIterable() {
|
|
192
|
+
return {
|
|
193
|
+
[Symbol.asyncIterator]: () => ({
|
|
194
|
+
async next() {
|
|
195
|
+
return { value: void 0, done: true };
|
|
196
|
+
}
|
|
197
|
+
})
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
__name(emptyAsyncIterable, "emptyAsyncIterable");
|
|
201
|
+
var BoundedAsyncQueue = class {
|
|
202
|
+
constructor(maxSize) {
|
|
203
|
+
this.maxSize = maxSize;
|
|
204
|
+
}
|
|
205
|
+
static {
|
|
206
|
+
__name(this, "BoundedAsyncQueue");
|
|
207
|
+
}
|
|
208
|
+
buf = [];
|
|
209
|
+
resolvers = [];
|
|
210
|
+
closed = false;
|
|
211
|
+
/**
|
|
212
|
+
* O(1) snapshot of how many LIVE (non-forced) entries are in `buf`.
|
|
213
|
+
* Maintained directly by `push()`/`next()`: any time a forced entry
|
|
214
|
+
* is added or removed `liveCount` is untouched; any time a live entry
|
|
215
|
+
* is added or removed `liveCount` moves with it. Replaces the
|
|
216
|
+
* position-dependent `forcedInBuf` heuristic — `liveCount` is correct
|
|
217
|
+
* no matter where in the queue the forced entries are.
|
|
218
|
+
*/
|
|
219
|
+
liveCount = 0;
|
|
220
|
+
/**
|
|
221
|
+
* Number of LIVE (non-force-pushed) items currently waiting in the
|
|
222
|
+
* buffer. Backpressure decisions in `EventBus.publish()` (the
|
|
223
|
+
* `slow_client_warning` threshold) read this value.
|
|
224
|
+
*/
|
|
225
|
+
get size() {
|
|
226
|
+
return this.liveCount;
|
|
227
|
+
}
|
|
228
|
+
/** Returns true if accepted, false if dropped due to overflow. */
|
|
229
|
+
push(value) {
|
|
230
|
+
if (this.closed) return false;
|
|
231
|
+
const r = this.resolvers.shift();
|
|
232
|
+
if (r) {
|
|
233
|
+
r({ value, done: false });
|
|
234
|
+
return true;
|
|
235
|
+
}
|
|
236
|
+
if (this.liveCount >= this.maxSize) return false;
|
|
237
|
+
this.buf.push({ value, forced: false });
|
|
238
|
+
this.liveCount += 1;
|
|
239
|
+
return true;
|
|
240
|
+
}
|
|
241
|
+
/** Bypasses the size cap. Used for replay frames, eviction terminal,
|
|
242
|
+
* and slow-client warnings. */
|
|
243
|
+
forcePush(value) {
|
|
244
|
+
if (this.closed) return;
|
|
245
|
+
const r = this.resolvers.shift();
|
|
246
|
+
if (r) {
|
|
247
|
+
r({ value, done: false });
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
this.buf.push({ value, forced: true });
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Mark the queue closed. By default `next()` continues to drain
|
|
254
|
+
* any items already in `buf` before returning `done: true` —
|
|
255
|
+
* that's what the eviction path relies on (the synthetic
|
|
256
|
+
* `client_evicted` frame is force-pushed THEN close is called,
|
|
257
|
+
* and we want the consumer to see the terminal frame before the
|
|
258
|
+
* iterator unwinds).
|
|
259
|
+
*
|
|
260
|
+
* Pass `{ drain: false }` to drop buffered items immediately
|
|
261
|
+
* (the AbortSignal-driven unsubscribe path uses this — the
|
|
262
|
+
* subscribe docstring says abort should close the iterator
|
|
263
|
+
* promptly, but draining hundreds of queued events first
|
|
264
|
+
* contradicts that and adds post-abort work to the SSE route).
|
|
265
|
+
*/
|
|
266
|
+
close(opts = {}) {
|
|
267
|
+
if (this.closed) return;
|
|
268
|
+
this.closed = true;
|
|
269
|
+
if (opts.drain === false) {
|
|
270
|
+
this.buf.length = 0;
|
|
271
|
+
this.liveCount = 0;
|
|
272
|
+
}
|
|
273
|
+
while (this.resolvers.length > 0) {
|
|
274
|
+
this.resolvers.shift()({
|
|
275
|
+
value: void 0,
|
|
276
|
+
done: true
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
next() {
|
|
281
|
+
if (this.buf.length > 0) {
|
|
282
|
+
const entry = this.buf.shift();
|
|
283
|
+
if (!entry.forced) this.liveCount -= 1;
|
|
284
|
+
return Promise.resolve({ value: entry.value, done: false });
|
|
285
|
+
}
|
|
286
|
+
if (this.closed) {
|
|
287
|
+
return Promise.resolve({
|
|
288
|
+
value: void 0,
|
|
289
|
+
done: true
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
return new Promise((resolve) => this.resolvers.push(resolve));
|
|
293
|
+
}
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
// packages/cli/src/serve/status.ts
|
|
297
|
+
init_esbuild_shims();
|
|
298
|
+
var STATUS_SCHEMA_VERSION = 1;
|
|
299
|
+
var SERVE_STATUS_EXT_METHODS = {
|
|
300
|
+
workspaceMcp: "qwen/status/workspace/mcp",
|
|
301
|
+
workspaceSkills: "qwen/status/workspace/skills",
|
|
302
|
+
workspaceProviders: "qwen/status/workspace/providers",
|
|
303
|
+
sessionContext: "qwen/status/session/context",
|
|
304
|
+
sessionSupportedCommands: "qwen/status/session/supported_commands"
|
|
305
|
+
};
|
|
306
|
+
function createIdleWorkspaceMcpStatus(workspaceCwd) {
|
|
307
|
+
return {
|
|
308
|
+
v: STATUS_SCHEMA_VERSION,
|
|
309
|
+
workspaceCwd,
|
|
310
|
+
initialized: false,
|
|
311
|
+
discoveryState: "not_started",
|
|
312
|
+
servers: []
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
__name(createIdleWorkspaceMcpStatus, "createIdleWorkspaceMcpStatus");
|
|
316
|
+
function createIdleWorkspaceSkillsStatus(workspaceCwd) {
|
|
317
|
+
return {
|
|
318
|
+
v: STATUS_SCHEMA_VERSION,
|
|
319
|
+
workspaceCwd,
|
|
320
|
+
initialized: false,
|
|
321
|
+
skills: []
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
__name(createIdleWorkspaceSkillsStatus, "createIdleWorkspaceSkillsStatus");
|
|
325
|
+
function createIdleWorkspaceProvidersStatus(workspaceCwd) {
|
|
326
|
+
return {
|
|
327
|
+
v: STATUS_SCHEMA_VERSION,
|
|
328
|
+
workspaceCwd,
|
|
329
|
+
initialized: false,
|
|
330
|
+
providers: []
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
__name(createIdleWorkspaceProvidersStatus, "createIdleWorkspaceProvidersStatus");
|
|
334
|
+
|
|
335
|
+
export {
|
|
336
|
+
EVENT_SCHEMA_VERSION,
|
|
337
|
+
DEFAULT_RING_SIZE,
|
|
338
|
+
SubscriberLimitExceededError,
|
|
339
|
+
EventBus,
|
|
340
|
+
STATUS_SCHEMA_VERSION,
|
|
341
|
+
SERVE_STATUS_EXT_METHODS,
|
|
342
|
+
createIdleWorkspaceMcpStatus,
|
|
343
|
+
createIdleWorkspaceSkillsStatus,
|
|
344
|
+
createIdleWorkspaceProvidersStatus
|
|
345
|
+
};
|
|
346
|
+
/**
|
|
347
|
+
* @license
|
|
348
|
+
* Copyright 2025 Qwen Team
|
|
349
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
350
|
+
*/
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
import {
|
|
4
4
|
RequestTokenizer
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-NAID3ZWF.js";
|
|
6
6
|
import {
|
|
7
7
|
buildRuntimeFetchOptions,
|
|
8
8
|
redactProxyError
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-VTPOO6GV.js";
|
|
10
10
|
import {
|
|
11
11
|
OpenAIContentConverter,
|
|
12
12
|
TaggedThinkingParser,
|
|
13
13
|
openaiRequestCaptureContext
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-C3LHPHN2.js";
|
|
15
15
|
import {
|
|
16
16
|
CAPPED_DEFAULT_MAX_TOKENS,
|
|
17
17
|
DASHSCOPE_PROXY_BASE_URL,
|
|
@@ -21,14 +21,14 @@ import {
|
|
|
21
21
|
hasExplicitOutputLimit,
|
|
22
22
|
safeJsonParse,
|
|
23
23
|
tokenLimit
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-CW44BRRA.js";
|
|
25
25
|
import {
|
|
26
26
|
GenerateContentResponse
|
|
27
27
|
} from "./chunk-T4VD6OJ4.js";
|
|
28
28
|
import {
|
|
29
29
|
createDebugLogger,
|
|
30
30
|
isAbortError
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-XP27SJMH.js";
|
|
32
32
|
import {
|
|
33
33
|
init_esbuild_shims
|
|
34
34
|
} from "./chunk-A4BMJM77.js";
|
|
@@ -7050,6 +7050,16 @@ var DashScopeOpenAICompatibleProvider = class _DashScopeOpenAICompatibleProvider
|
|
|
7050
7050
|
constructor(contentGeneratorConfig, cliConfig) {
|
|
7051
7051
|
super(contentGeneratorConfig, cliConfig);
|
|
7052
7052
|
}
|
|
7053
|
+
/**
|
|
7054
|
+
* Determines whether to use the DashScope-compatible provider.
|
|
7055
|
+
* Covers dashscope.aliyuncs.com, dashscope-intl.aliyuncs.com,
|
|
7056
|
+
* internal Alibaba domains (*.alibaba-inc.com, *.aliyun-inc.com),
|
|
7057
|
+
* and proxy matches.
|
|
7058
|
+
*
|
|
7059
|
+
* Note: any *.alibaba-inc.com / *.aliyun-inc.com host is treated as a
|
|
7060
|
+
* DashScope-compatible endpoint by design. Keep this generic and avoid
|
|
7061
|
+
* embedding individual private gateway hostnames in provider detection.
|
|
7062
|
+
*/
|
|
7053
7063
|
static isDashScopeProvider(contentGeneratorConfig) {
|
|
7054
7064
|
const { authType, baseUrl } = contentGeneratorConfig;
|
|
7055
7065
|
if (authType === "qwen-oauth" /* QWEN_OAUTH */) return true;
|
|
@@ -7062,16 +7072,22 @@ var DashScopeOpenAICompatibleProvider = class _DashScopeOpenAICompatibleProvider
|
|
|
7062
7072
|
hostname = null;
|
|
7063
7073
|
}
|
|
7064
7074
|
const isDashscopeOrigin = hostname !== null && (hostname === "dashscope.aliyuncs.com" || hostname === "dashscope-intl.aliyuncs.com" || hostname.endsWith(".dashscope.aliyuncs.com") || hostname.endsWith(".dashscope-intl.aliyuncs.com"));
|
|
7075
|
+
const isInternalOrigin = hostname !== null && (hostname.endsWith(".alibaba-inc.com") || hostname.endsWith(".aliyun-inc.com"));
|
|
7065
7076
|
const normalizedProxyUrl = DASHSCOPE_PROXY_BASE_URL?.endsWith("/") ? DASHSCOPE_PROXY_BASE_URL.slice(0, -1) : DASHSCOPE_PROXY_BASE_URL;
|
|
7066
7077
|
const isProxyMatch = Boolean(
|
|
7067
7078
|
normalizedProxyUrl && normalizedBaseUrl.toLowerCase() === normalizedProxyUrl.toLowerCase()
|
|
7068
7079
|
);
|
|
7069
|
-
if (normalizedProxyUrl && !isDashscopeOrigin && !isProxyMatch) {
|
|
7080
|
+
if (normalizedProxyUrl && !isDashscopeOrigin && !isInternalOrigin && !isProxyMatch) {
|
|
7070
7081
|
debugLogger.debug(
|
|
7071
7082
|
`DASHSCOPE_PROXY_BASE_URL is configured but the request baseUrl does not match. DashScope headers/cache control will be skipped.`
|
|
7072
7083
|
);
|
|
7073
7084
|
}
|
|
7074
|
-
|
|
7085
|
+
if (isInternalOrigin) {
|
|
7086
|
+
debugLogger.debug(
|
|
7087
|
+
`DashScope provider activated via internal origin: ${hostname}`
|
|
7088
|
+
);
|
|
7089
|
+
}
|
|
7090
|
+
return isDashscopeOrigin || isInternalOrigin || isProxyMatch;
|
|
7075
7091
|
}
|
|
7076
7092
|
buildHeaders() {
|
|
7077
7093
|
const version = this.cliConfig.getCliVersion() || "unknown";
|
|
@@ -12,30 +12,30 @@ import {
|
|
|
12
12
|
} from "./chunk-OFEVLU4C.js";
|
|
13
13
|
import {
|
|
14
14
|
isAutoMemPath
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-PR4T27R7.js";
|
|
16
16
|
import {
|
|
17
17
|
DEFAULT_OPENAI_BASE_URL,
|
|
18
18
|
convertSchema,
|
|
19
19
|
normalize,
|
|
20
20
|
safeJsonParse,
|
|
21
21
|
tokenLimit
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-CW44BRRA.js";
|
|
23
23
|
import {
|
|
24
24
|
InstallationManager
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-D5NTAHYL.js";
|
|
26
26
|
import {
|
|
27
27
|
FinishReason,
|
|
28
28
|
GenerateContentResponse
|
|
29
29
|
} from "./chunk-T4VD6OJ4.js";
|
|
30
30
|
import {
|
|
31
31
|
STRUCTURED_OUTPUT_REDACTED_ARGS
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-JYQUJ5DS.js";
|
|
33
33
|
import {
|
|
34
34
|
BaseDeclarativeTool,
|
|
35
35
|
BaseToolInvocation,
|
|
36
36
|
ToolDisplayNames,
|
|
37
37
|
ToolNames
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-FZIUV27X.js";
|
|
39
39
|
import {
|
|
40
40
|
FatalConfigError,
|
|
41
41
|
Storage,
|
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
setSessionContext,
|
|
52
52
|
shortenPath,
|
|
53
53
|
unescapePath
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-XP27SJMH.js";
|
|
55
55
|
import {
|
|
56
56
|
require_dist
|
|
57
57
|
} from "./chunk-ZERZSAZL.js";
|
|
@@ -71675,11 +71675,11 @@ async function createContentGenerator(generatorConfig, config, isInitialAuth) {
|
|
|
71675
71675
|
}
|
|
71676
71676
|
let baseGenerator;
|
|
71677
71677
|
if (authType === "openai" /* USE_OPENAI */) {
|
|
71678
|
-
const { createOpenAIContentGenerator } = await import("./openaiContentGenerator-
|
|
71678
|
+
const { createOpenAIContentGenerator } = await import("./openaiContentGenerator-5NQG3W64.js");
|
|
71679
71679
|
baseGenerator = createOpenAIContentGenerator(generatorConfig, config);
|
|
71680
71680
|
} else if (authType === "qwen-oauth" /* QWEN_OAUTH */) {
|
|
71681
|
-
const { getQwenOAuthClient: getQwenOauthClient } = await import("./qwenOAuth2-
|
|
71682
|
-
const { QwenContentGenerator } = await import("./qwenContentGenerator-
|
|
71681
|
+
const { getQwenOAuthClient: getQwenOauthClient } = await import("./qwenOAuth2-JE7H47TE.js");
|
|
71682
|
+
const { QwenContentGenerator } = await import("./qwenContentGenerator-4DPUUS6R.js");
|
|
71683
71683
|
try {
|
|
71684
71684
|
const qwenClient = await getQwenOauthClient(
|
|
71685
71685
|
config,
|
|
@@ -71696,10 +71696,10 @@ async function createContentGenerator(generatorConfig, config, isInitialAuth) {
|
|
|
71696
71696
|
);
|
|
71697
71697
|
}
|
|
71698
71698
|
} else if (authType === "anthropic" /* USE_ANTHROPIC */) {
|
|
71699
|
-
const { createAnthropicContentGenerator } = await import("./anthropicContentGenerator-
|
|
71699
|
+
const { createAnthropicContentGenerator } = await import("./anthropicContentGenerator-ICBDZ6R2.js");
|
|
71700
71700
|
baseGenerator = createAnthropicContentGenerator(generatorConfig, config);
|
|
71701
71701
|
} else if (authType === "gemini" /* USE_GEMINI */ || authType === "vertex-ai" /* USE_VERTEX_AI */) {
|
|
71702
|
-
const { createGeminiContentGenerator } = await import("./geminiContentGenerator-
|
|
71702
|
+
const { createGeminiContentGenerator } = await import("./geminiContentGenerator-33RP4WKD.js");
|
|
71703
71703
|
baseGenerator = createGeminiContentGenerator(generatorConfig, config);
|
|
71704
71704
|
} else {
|
|
71705
71705
|
throw new Error(
|
|
@@ -6,23 +6,23 @@ import {
|
|
|
6
6
|
import {
|
|
7
7
|
getCoreSystemPrompt,
|
|
8
8
|
resolveBundleDir
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-MNPZ2WO6.js";
|
|
10
10
|
import {
|
|
11
11
|
buildSkillLlmContent
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-G7YTSRES.js";
|
|
13
13
|
import {
|
|
14
14
|
DiscoveredMCPTool,
|
|
15
15
|
uiTelemetryService
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-C3LHPHN2.js";
|
|
17
17
|
import {
|
|
18
18
|
DEFAULT_TOKEN_LIMIT
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-CW44BRRA.js";
|
|
20
20
|
import {
|
|
21
21
|
ToolNames
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-FZIUV27X.js";
|
|
23
23
|
import {
|
|
24
24
|
Storage
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-XP27SJMH.js";
|
|
26
26
|
import {
|
|
27
27
|
init_esbuild_shims
|
|
28
28
|
} from "./chunk-A4BMJM77.js";
|
|
@@ -1662,13 +1662,13 @@ init_esbuild_shims();
|
|
|
1662
1662
|
var globImport_locales_js = __glob({
|
|
1663
1663
|
"./locales/ca.js": () => import("./ca-S3XJMT6P.js"),
|
|
1664
1664
|
"./locales/de.js": () => import("./de-MNR4SMAI.js"),
|
|
1665
|
-
"./locales/en.js": () => import("./en-
|
|
1665
|
+
"./locales/en.js": () => import("./en-FIUWJSZR.js"),
|
|
1666
1666
|
"./locales/fr.js": () => import("./fr-OFJFHLCR.js"),
|
|
1667
1667
|
"./locales/ja.js": () => import("./ja-V6OQ6VL7.js"),
|
|
1668
1668
|
"./locales/pt.js": () => import("./pt-ZLE6SA4A.js"),
|
|
1669
1669
|
"./locales/ru.js": () => import("./ru-A4OHIUNN.js"),
|
|
1670
|
-
"./locales/zh-TW.js": () => import("./zh-TW-
|
|
1671
|
-
"./locales/zh.js": () => import("./zh-
|
|
1670
|
+
"./locales/zh-TW.js": () => import("./zh-TW-552S24LR.js"),
|
|
1671
|
+
"./locales/zh.js": () => import("./zh-V32QONGV.js")
|
|
1672
1672
|
});
|
|
1673
1673
|
|
|
1674
1674
|
// packages/cli/src/i18n/index.ts
|