@qwen-code/qwen-code 0.18.0 → 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.
Files changed (111) hide show
  1. package/bundled/loop/SKILL.md +2 -1
  2. package/bundled/qc-helper/docs/configuration/auth.md +1 -1
  3. package/bundled/qc-helper/docs/configuration/model-providers.md +12 -5
  4. package/bundled/qc-helper/docs/configuration/settings.md +30 -27
  5. package/bundled/qc-helper/docs/features/dual-output.md +37 -3
  6. package/bundled/qc-helper/docs/features/skills.md +29 -3
  7. package/bundled/qc-helper/docs/features/sub-agents.md +2 -1
  8. package/bundled/qc-helper/docs/qwen-serve.md +26 -18
  9. package/chunks/{agent-LOTJK6AH.js → agent-XT7NHZ5H.js} +21 -20
  10. package/chunks/{agent-headless-TU3EPMYU.js → agent-headless-LNRE63ZL.js} +21 -20
  11. package/chunks/{anthropicContentGenerator-2HBRNQ3B.js → anthropicContentGenerator-DCI26OQF.js} +4 -4
  12. package/chunks/{askUserQuestion-OGCMIBQM.js → askUserQuestion-ITYUTWLR.js} +2 -2
  13. package/chunks/{ca-BARBRL6N.js → ca-RK4QPLIX.js} +18 -1
  14. package/chunks/{chunk-ZTZ4DDQE.js → chunk-3NRO6NHX.js} +2 -2
  15. package/chunks/{chunk-IWAYOW5Q.js → chunk-6T7Y7USE.js} +6566 -4195
  16. package/chunks/{chunk-MFBBBTNY.js → chunk-7KPZFE5A.js} +1 -1
  17. package/chunks/{chunk-XV4HCEVI.js → chunk-A2ZIEEGJ.js} +9 -22
  18. package/chunks/{chunk-A7B4ISQP.js → chunk-B4ZF2KSI.js} +1 -1
  19. package/chunks/chunk-BJ5HQ23U.js +178 -0
  20. package/chunks/{chunk-LBP46COL.js → chunk-BXYRCW2C.js} +83 -15
  21. package/chunks/{chunk-OHEGWO4L.js → chunk-CPVI5J2L.js} +1 -1
  22. package/chunks/{chunk-R7ODSGTK.js → chunk-DHZREJTG.js} +2 -2
  23. package/chunks/{chunk-SEGYWKIH.js → chunk-FIQECJTQ.js} +1 -1
  24. package/chunks/{chunk-HR7SV7AY.js → chunk-HA2UEYZP.js} +6 -2
  25. package/chunks/{chunk-JTQAQBTV.js → chunk-HED55F43.js} +5 -1
  26. package/chunks/{chunk-HLPLOD42.js → chunk-HQUWWSSP.js} +1 -1
  27. package/chunks/{chunk-2Y5SYSD3.js → chunk-IDYDPBBN.js} +3 -3
  28. package/chunks/{chunk-3HTIVKZE.js → chunk-IQHSD7K5.js} +1 -1
  29. package/chunks/{chunk-LEJ42GNY.js → chunk-IS7UA4W3.js} +6 -6
  30. package/chunks/{chunk-B7HXHOHU.js → chunk-LXYWINWF.js} +1 -1
  31. package/chunks/{chunk-IDX6COTE.js → chunk-LYRSMKLS.js} +2 -2
  32. package/chunks/{chunk-M6VTDSVR.js → chunk-LYSND7KR.js} +9 -4
  33. package/chunks/{chunk-EYENRK4D.js → chunk-NNIYWQIS.js} +1 -1
  34. package/chunks/chunk-OMX7CUOE.js +356 -0
  35. package/chunks/{chunk-BIVG75CP.js → chunk-QILTEBWS.js} +1 -1
  36. package/chunks/{chunk-6YIUGZTC.js → chunk-RON7LFNH.js} +281 -132
  37. package/chunks/{chunk-3DHXZ6EV.js → chunk-SFRV6BGY.js} +6 -4
  38. package/chunks/{chunk-7BCMOPIM.js → chunk-WJ3SND6W.js} +31 -12
  39. package/chunks/{chunk-J5MDQKJL.js → chunk-WPTCDQN6.js} +2 -347
  40. package/chunks/{chunk-PL3MVCWD.js → chunk-XZTNBSMW.js} +11 -11
  41. package/chunks/{chunk-72LDN5PP.js → chunk-Y7KMDUEP.js} +1 -1
  42. package/chunks/{chunk-SNGELLWX.js → chunk-ZMIBJS45.js} +1 -1
  43. package/chunks/{chunk-XBY7E2FX.js → chunk-ZOFNJQNJ.js} +6 -4
  44. package/chunks/computer-use-4YX3JGBV.js +2052 -0
  45. package/chunks/{contextCommand-K347QT6O.js → contextCommand-KS2H7MW5.js} +23 -22
  46. package/chunks/cron-create-CAPUKK7I.js +184 -0
  47. package/chunks/{cron-delete-WKWSJZQA.js → cron-delete-G3KAR26Q.js} +27 -4
  48. package/chunks/{cron-list-B52XEXAZ.js → cron-list-ZA4ZIUS5.js} +39 -6
  49. package/chunks/{de-YGKK2BC4.js → de-FGPM4KW5.js} +18 -1
  50. package/chunks/{dist-KAZ3SEBX.js → dist-7YWFWOCJ.js} +1 -1
  51. package/chunks/{dist-4LXD6L6X.js → dist-VEGFONCF.js} +2 -2
  52. package/chunks/{dist-H6ONXVLG.js → dist-X4EXN7W6.js} +1 -1
  53. package/chunks/{dist-PK7DFCAW.js → dist-YLS6NI7H.js} +1 -1
  54. package/chunks/{edit-KU4PJGEX.js → edit-2ARPEO4B.js} +22 -21
  55. package/chunks/{en-DHGYHIHX.js → en-VP6XPGEC.js} +5 -2
  56. package/chunks/{enter-worktree-PPYIDCWI.js → enter-worktree-IXNXNAW5.js} +21 -20
  57. package/chunks/{enterPlanMode-5CZDMCB4.js → enterPlanMode-TAKAGAYP.js} +21 -20
  58. package/chunks/{exit-worktree-UY3CGHKC.js → exit-worktree-LHTRV7ML.js} +21 -20
  59. package/chunks/{exitPlanMode-3DN4QNSG.js → exitPlanMode-MK5UAITL.js} +71 -31
  60. package/chunks/{fr-JXBKPJKQ.js → fr-ATYBVCLT.js} +18 -1
  61. package/chunks/{geminiContentGenerator-7A6I2RWB.js → geminiContentGenerator-HFJIGO77.js} +4 -4
  62. package/chunks/{glob-OFNQSS52.js → glob-I2USLUSC.js} +21 -20
  63. package/chunks/{grep-6J2MSUM5.js → grep-WBIF7THR.js} +30 -26
  64. package/chunks/{ja-TGPZSP2B.js → ja-W2QEA2OI.js} +18 -1
  65. package/chunks/{keychain-token-storage-6IU6ORQN.js → keychain-token-storage-QSTRHKKL.js} +2 -2
  66. package/chunks/{ls-V3O6A5PT.js → ls-2R5RHLX5.js} +3 -3
  67. package/chunks/{lsp-G2OCIFUA.js → lsp-XKH6ZIAN.js} +2 -2
  68. package/chunks/{monitor-FKLHV423.js → monitor-WU7UFATU.js} +21 -20
  69. package/chunks/{notebook-edit-KTBYFKWG.js → notebook-edit-KUHYPXEM.js} +22 -21
  70. package/chunks/{openaiContentGenerator-L5KSWQY7.js → openaiContentGenerator-5PLHYJQL.js} +11 -11
  71. package/chunks/{pt-TIBG6BIO.js → pt-ZKEWJFBW.js} +18 -1
  72. package/chunks/{qwenContentGenerator-PYOXLMBW.js → qwenContentGenerator-TSKW73KY.js} +23 -22
  73. package/chunks/{qwenOAuth2-2KCKWDCF.js → qwenOAuth2-KK433U33.js} +4 -4
  74. package/chunks/{read-file-JQVRK4NU.js → read-file-VIPF2PS6.js} +8 -8
  75. package/chunks/{ripGrep-2L4LPNAJ.js → ripGrep-XLIZTYE7.js} +21 -20
  76. package/chunks/{ru-JBCHCK4L.js → ru-VEKTPJ74.js} +18 -1
  77. package/chunks/{scheduler-FGNXY4JQ.js → scheduler-O66SLJGU.js} +21 -20
  78. package/chunks/{send-message-SZFWNOCL.js → send-message-CTME7DXD.js} +2 -2
  79. package/chunks/{serve-N2IBLA3G.js → serve-BWOLYT62.js} +998 -278
  80. package/chunks/{shell-PTEG6UX4.js → shell-XE7UYKOO.js} +21 -20
  81. package/chunks/{skill-X4NTK4NH.js → skill-RZWM6XMC.js} +10 -10
  82. package/chunks/{src-GLLQ3R5W.js → src-L5P7K4MH.js} +42 -26
  83. package/chunks/{syntheticOutput-IKAY5F6X.js → syntheticOutput-ZJGSU7OQ.js} +3 -3
  84. package/chunks/{task-create-MQICOJFV.js → task-create-EE6JEM7G.js} +7 -6
  85. package/chunks/{task-list-RIHJCH32.js → task-list-EESYAC65.js} +6 -5
  86. package/chunks/{task-stop-FWZRFANS.js → task-stop-XZVCFFYY.js} +2 -2
  87. package/chunks/{task-update-2LHPXOYM.js → task-update-EIO4HNE3.js} +7 -6
  88. package/chunks/{team-create-2E4PF4KN.js → team-create-R2H7Y3SG.js} +21 -20
  89. package/chunks/{team-delete-DAUDQS4J.js → team-delete-A7LXPGV7.js} +6 -5
  90. package/chunks/{todoWrite-HTUACZES.js → todoWrite-VRKSGAWM.js} +4 -4
  91. package/chunks/{tool-search-KTVULRES.js → tool-search-USSQMTMS.js} +8 -8
  92. package/chunks/{web-fetch-CZ7LLKPE.js → web-fetch-GHAZUA54.js} +4 -4
  93. package/chunks/{workflow-L2ZUUDT2.js → workflow-5LNNLNUR.js} +503 -49
  94. package/chunks/{write-file-ZEB2JDYH.js → write-file-2I7HP24C.js} +22 -21
  95. package/chunks/{zh-7H5OQC4I.js → zh-OIXDDQHB.js} +5 -2
  96. package/chunks/{zh-TW-P4IDHD3M.js → zh-TW-6YFNCKTA.js} +5 -2
  97. package/cli-entry.js +19 -0
  98. package/cli.js +6547 -4938
  99. package/locales/ca.js +20 -2
  100. package/locales/de.js +21 -2
  101. package/locales/en.js +7 -4
  102. package/locales/fr.js +22 -2
  103. package/locales/ja.js +22 -2
  104. package/locales/pt.js +21 -2
  105. package/locales/ru.js +20 -2
  106. package/locales/zh-TW.js +6 -4
  107. package/locales/zh.js +6 -4
  108. package/package.json +4 -3
  109. package/chunks/chunk-SKBPNJEW.js +0 -45
  110. package/chunks/computer-use-3RH2DOM6.js +0 -825
  111. package/chunks/cron-create-YJL3KFWI.js +0 -140
@@ -2,7 +2,7 @@
2
2
  "use strict";
3
3
  import {
4
4
  createDebugLogger
5
- } from "./chunk-HR7SV7AY.js";
5
+ } from "./chunk-HA2UEYZP.js";
6
6
  import {
7
7
  init_esbuild_shims
8
8
  } from "./chunk-A4BMJM77.js";
@@ -467,10 +467,15 @@ var PATTERNS = [
467
467
  // -------------------
468
468
  // Zhipu GLM
469
469
  // -------------------
470
- [/^glm-5/, 202752],
471
- // GLM-5: exact vendor limit
470
+ // 1M context is the forward default for new GLM releases (GLM-5.2+, GLM-6.x,
471
+ // and beyond) so they need no future code change. Confirmed 200K families
472
+ // (GLM-5 / 5.0 / 5.1, GLM-4.x and older) are pinned explicitly first.
473
+ [/^glm-5(\.[01])?(-|$)/, 202752],
474
+ // GLM-5 / 5.0 / 5.1: 200K
475
+ [/^glm-(?:[5-9]|\d{2,})/, LIMITS["1m"]],
476
+ // GLM-5.2+, 6.x..9.x, 10.x+: 1M
472
477
  [/^glm-/, 202752],
473
- // GLM fallback: 128K
478
+ // GLM <=4.x / non-numeric fallback: 200K
474
479
  // -------------------
475
480
  // MiniMax
476
481
  // -------------------
@@ -2,7 +2,7 @@
2
2
  "use strict";
3
3
  import {
4
4
  createDebugLogger
5
- } from "./chunk-HR7SV7AY.js";
5
+ } from "./chunk-HA2UEYZP.js";
6
6
  import {
7
7
  init_esbuild_shims
8
8
  } from "./chunk-A4BMJM77.js";
@@ -0,0 +1,356 @@
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
+ // node_modules/async-mutex/index.mjs
11
+ init_esbuild_shims();
12
+ var E_TIMEOUT = new Error("timeout while waiting for mutex to become available");
13
+ var E_ALREADY_LOCKED = new Error("mutex already locked");
14
+ var E_CANCELED = new Error("request for lock canceled");
15
+ var __awaiter$2 = function(thisArg, _arguments, P, generator) {
16
+ function adopt(value) {
17
+ return value instanceof P ? value : new P(function(resolve) {
18
+ resolve(value);
19
+ });
20
+ }
21
+ __name(adopt, "adopt");
22
+ return new (P || (P = Promise))(function(resolve, reject) {
23
+ function fulfilled(value) {
24
+ try {
25
+ step(generator.next(value));
26
+ } catch (e) {
27
+ reject(e);
28
+ }
29
+ }
30
+ __name(fulfilled, "fulfilled");
31
+ function rejected(value) {
32
+ try {
33
+ step(generator["throw"](value));
34
+ } catch (e) {
35
+ reject(e);
36
+ }
37
+ }
38
+ __name(rejected, "rejected");
39
+ function step(result) {
40
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
41
+ }
42
+ __name(step, "step");
43
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
44
+ });
45
+ };
46
+ var Semaphore = class {
47
+ static {
48
+ __name(this, "Semaphore");
49
+ }
50
+ constructor(_value, _cancelError = E_CANCELED) {
51
+ this._value = _value;
52
+ this._cancelError = _cancelError;
53
+ this._queue = [];
54
+ this._weightedWaiters = [];
55
+ }
56
+ acquire(weight = 1, priority = 0) {
57
+ if (weight <= 0)
58
+ throw new Error(`invalid weight ${weight}: must be positive`);
59
+ return new Promise((resolve, reject) => {
60
+ const task = { resolve, reject, weight, priority };
61
+ const i = findIndexFromEnd(this._queue, (other) => priority <= other.priority);
62
+ if (i === -1 && weight <= this._value) {
63
+ this._dispatchItem(task);
64
+ } else {
65
+ this._queue.splice(i + 1, 0, task);
66
+ }
67
+ });
68
+ }
69
+ runExclusive(callback_1) {
70
+ return __awaiter$2(this, arguments, void 0, function* (callback, weight = 1, priority = 0) {
71
+ const [value, release] = yield this.acquire(weight, priority);
72
+ try {
73
+ return yield callback(value);
74
+ } finally {
75
+ release();
76
+ }
77
+ });
78
+ }
79
+ waitForUnlock(weight = 1, priority = 0) {
80
+ if (weight <= 0)
81
+ throw new Error(`invalid weight ${weight}: must be positive`);
82
+ if (this._couldLockImmediately(weight, priority)) {
83
+ return Promise.resolve();
84
+ } else {
85
+ return new Promise((resolve) => {
86
+ if (!this._weightedWaiters[weight - 1])
87
+ this._weightedWaiters[weight - 1] = [];
88
+ insertSorted(this._weightedWaiters[weight - 1], { resolve, priority });
89
+ });
90
+ }
91
+ }
92
+ isLocked() {
93
+ return this._value <= 0;
94
+ }
95
+ getValue() {
96
+ return this._value;
97
+ }
98
+ setValue(value) {
99
+ this._value = value;
100
+ this._dispatchQueue();
101
+ }
102
+ release(weight = 1) {
103
+ if (weight <= 0)
104
+ throw new Error(`invalid weight ${weight}: must be positive`);
105
+ this._value += weight;
106
+ this._dispatchQueue();
107
+ }
108
+ cancel() {
109
+ this._queue.forEach((entry) => entry.reject(this._cancelError));
110
+ this._queue = [];
111
+ }
112
+ _dispatchQueue() {
113
+ this._drainUnlockWaiters();
114
+ while (this._queue.length > 0 && this._queue[0].weight <= this._value) {
115
+ this._dispatchItem(this._queue.shift());
116
+ this._drainUnlockWaiters();
117
+ }
118
+ }
119
+ _dispatchItem(item) {
120
+ const previousValue = this._value;
121
+ this._value -= item.weight;
122
+ item.resolve([previousValue, this._newReleaser(item.weight)]);
123
+ }
124
+ _newReleaser(weight) {
125
+ let called = false;
126
+ return () => {
127
+ if (called)
128
+ return;
129
+ called = true;
130
+ this.release(weight);
131
+ };
132
+ }
133
+ _drainUnlockWaiters() {
134
+ if (this._queue.length === 0) {
135
+ for (let weight = this._value; weight > 0; weight--) {
136
+ const waiters = this._weightedWaiters[weight - 1];
137
+ if (!waiters)
138
+ continue;
139
+ waiters.forEach((waiter) => waiter.resolve());
140
+ this._weightedWaiters[weight - 1] = [];
141
+ }
142
+ } else {
143
+ const queuedPriority = this._queue[0].priority;
144
+ for (let weight = this._value; weight > 0; weight--) {
145
+ const waiters = this._weightedWaiters[weight - 1];
146
+ if (!waiters)
147
+ continue;
148
+ const i = waiters.findIndex((waiter) => waiter.priority <= queuedPriority);
149
+ (i === -1 ? waiters : waiters.splice(0, i)).forEach((waiter) => waiter.resolve());
150
+ }
151
+ }
152
+ }
153
+ _couldLockImmediately(weight, priority) {
154
+ return (this._queue.length === 0 || this._queue[0].priority < priority) && weight <= this._value;
155
+ }
156
+ };
157
+ function insertSorted(a, v) {
158
+ const i = findIndexFromEnd(a, (other) => v.priority <= other.priority);
159
+ a.splice(i + 1, 0, v);
160
+ }
161
+ __name(insertSorted, "insertSorted");
162
+ function findIndexFromEnd(a, predicate) {
163
+ for (let i = a.length - 1; i >= 0; i--) {
164
+ if (predicate(a[i])) {
165
+ return i;
166
+ }
167
+ }
168
+ return -1;
169
+ }
170
+ __name(findIndexFromEnd, "findIndexFromEnd");
171
+ var __awaiter$1 = function(thisArg, _arguments, P, generator) {
172
+ function adopt(value) {
173
+ return value instanceof P ? value : new P(function(resolve) {
174
+ resolve(value);
175
+ });
176
+ }
177
+ __name(adopt, "adopt");
178
+ return new (P || (P = Promise))(function(resolve, reject) {
179
+ function fulfilled(value) {
180
+ try {
181
+ step(generator.next(value));
182
+ } catch (e) {
183
+ reject(e);
184
+ }
185
+ }
186
+ __name(fulfilled, "fulfilled");
187
+ function rejected(value) {
188
+ try {
189
+ step(generator["throw"](value));
190
+ } catch (e) {
191
+ reject(e);
192
+ }
193
+ }
194
+ __name(rejected, "rejected");
195
+ function step(result) {
196
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
197
+ }
198
+ __name(step, "step");
199
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
200
+ });
201
+ };
202
+ var Mutex = class {
203
+ static {
204
+ __name(this, "Mutex");
205
+ }
206
+ constructor(cancelError) {
207
+ this._semaphore = new Semaphore(1, cancelError);
208
+ }
209
+ acquire() {
210
+ return __awaiter$1(this, arguments, void 0, function* (priority = 0) {
211
+ const [, releaser] = yield this._semaphore.acquire(1, priority);
212
+ return releaser;
213
+ });
214
+ }
215
+ runExclusive(callback, priority = 0) {
216
+ return this._semaphore.runExclusive(() => callback(), 1, priority);
217
+ }
218
+ isLocked() {
219
+ return this._semaphore.isLocked();
220
+ }
221
+ waitForUnlock(priority = 0) {
222
+ return this._semaphore.waitForUnlock(1, priority);
223
+ }
224
+ release() {
225
+ if (this._semaphore.isLocked())
226
+ this._semaphore.release();
227
+ }
228
+ cancel() {
229
+ return this._semaphore.cancel();
230
+ }
231
+ };
232
+ var __awaiter = function(thisArg, _arguments, P, generator) {
233
+ function adopt(value) {
234
+ return value instanceof P ? value : new P(function(resolve) {
235
+ resolve(value);
236
+ });
237
+ }
238
+ __name(adopt, "adopt");
239
+ return new (P || (P = Promise))(function(resolve, reject) {
240
+ function fulfilled(value) {
241
+ try {
242
+ step(generator.next(value));
243
+ } catch (e) {
244
+ reject(e);
245
+ }
246
+ }
247
+ __name(fulfilled, "fulfilled");
248
+ function rejected(value) {
249
+ try {
250
+ step(generator["throw"](value));
251
+ } catch (e) {
252
+ reject(e);
253
+ }
254
+ }
255
+ __name(rejected, "rejected");
256
+ function step(result) {
257
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
258
+ }
259
+ __name(step, "step");
260
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
261
+ });
262
+ };
263
+ function withTimeout(sync, timeout, timeoutError = E_TIMEOUT) {
264
+ return {
265
+ acquire: /* @__PURE__ */ __name((weightOrPriority, priority) => {
266
+ let weight;
267
+ if (isSemaphore(sync)) {
268
+ weight = weightOrPriority;
269
+ } else {
270
+ weight = void 0;
271
+ priority = weightOrPriority;
272
+ }
273
+ if (weight !== void 0 && weight <= 0) {
274
+ throw new Error(`invalid weight ${weight}: must be positive`);
275
+ }
276
+ return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
277
+ let isTimeout = false;
278
+ const handle = setTimeout(() => {
279
+ isTimeout = true;
280
+ reject(timeoutError);
281
+ }, timeout);
282
+ try {
283
+ const ticket = yield isSemaphore(sync) ? sync.acquire(weight, priority) : sync.acquire(priority);
284
+ if (isTimeout) {
285
+ const release = Array.isArray(ticket) ? ticket[1] : ticket;
286
+ release();
287
+ } else {
288
+ clearTimeout(handle);
289
+ resolve(ticket);
290
+ }
291
+ } catch (e) {
292
+ if (!isTimeout) {
293
+ clearTimeout(handle);
294
+ reject(e);
295
+ }
296
+ }
297
+ }));
298
+ }, "acquire"),
299
+ runExclusive(callback, weight, priority) {
300
+ return __awaiter(this, void 0, void 0, function* () {
301
+ let release = /* @__PURE__ */ __name(() => void 0, "release");
302
+ try {
303
+ const ticket = yield this.acquire(weight, priority);
304
+ if (Array.isArray(ticket)) {
305
+ release = ticket[1];
306
+ return yield callback(ticket[0]);
307
+ } else {
308
+ release = ticket;
309
+ return yield callback();
310
+ }
311
+ } finally {
312
+ release();
313
+ }
314
+ });
315
+ },
316
+ release(weight) {
317
+ sync.release(weight);
318
+ },
319
+ cancel() {
320
+ return sync.cancel();
321
+ },
322
+ waitForUnlock: /* @__PURE__ */ __name((weightOrPriority, priority) => {
323
+ let weight;
324
+ if (isSemaphore(sync)) {
325
+ weight = weightOrPriority;
326
+ } else {
327
+ weight = void 0;
328
+ priority = weightOrPriority;
329
+ }
330
+ if (weight !== void 0 && weight <= 0) {
331
+ throw new Error(`invalid weight ${weight}: must be positive`);
332
+ }
333
+ return new Promise((resolve, reject) => {
334
+ const handle = setTimeout(() => reject(timeoutError), timeout);
335
+ (isSemaphore(sync) ? sync.waitForUnlock(weight, priority) : sync.waitForUnlock(priority)).then(() => {
336
+ clearTimeout(handle);
337
+ resolve();
338
+ });
339
+ });
340
+ }, "waitForUnlock"),
341
+ isLocked: /* @__PURE__ */ __name(() => sync.isLocked(), "isLocked"),
342
+ getValue: /* @__PURE__ */ __name(() => sync.getValue(), "getValue"),
343
+ setValue: /* @__PURE__ */ __name((value) => sync.setValue(value), "setValue")
344
+ };
345
+ }
346
+ __name(withTimeout, "withTimeout");
347
+ function isSemaphore(sync) {
348
+ return sync.getValue !== void 0;
349
+ }
350
+ __name(isSemaphore, "isSemaphore");
351
+
352
+ export {
353
+ E_TIMEOUT,
354
+ Mutex,
355
+ withTimeout
356
+ };
@@ -5,7 +5,7 @@ import {
5
5
  BaseToolInvocation,
6
6
  ToolDisplayNames,
7
7
  ToolNames
8
- } from "./chunk-XV4HCEVI.js";
8
+ } from "./chunk-A2ZIEEGJ.js";
9
9
  import {
10
10
  init_esbuild_shims
11
11
  } from "./chunk-A4BMJM77.js";