@molecule/api-ai-deepseek 1.1.0 → 1.1.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/README.md +5 -3
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/provider.d.ts +1 -1
- package/dist/provider.d.ts.map +1 -1
- package/dist/provider.js +152 -24
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
|
|
|
3
3
|
Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
|
|
4
4
|
Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
|
|
5
5
|
To change this document, edit the module-level JSDoc in src/index.ts.
|
|
6
|
-
Generated: 2026-10-
|
|
6
|
+
Generated: 2026-10-27T11:22:37.877Z
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
# @molecule/api-ai-deepseek
|
|
@@ -225,8 +225,10 @@ malformed tool schema) gets its own non-retryable message distinct from the gene
|
|
|
225
225
|
**A stream that opens and then produces nothing is bounded, not waited on.** DeepSeek answers
|
|
226
226
|
200 and then keeps a stalled prefill alive with `: keep-alive` comments, so no HTTP status is
|
|
227
227
|
ever wrong and a byte-level idle timeout never sees the stall. `chat()` therefore bounds the
|
|
228
|
-
wait for the first CONTENT event (45 s, `MOL_DEEPSEEK_FIRST_TOKEN_TIMEOUT_MS`)
|
|
229
|
-
|
|
228
|
+
wait for the first CONTENT event (45 s, `MOL_DEEPSEEK_FIRST_TOKEN_TIMEOUT_MS`) — a window that
|
|
229
|
+
starts when the request is sent, so it also bounds an attempt whose response HEADERS never
|
|
230
|
+
arrive — and asks once more with a fresh stream; after the reply has started it bounds the
|
|
231
|
+
silence between chunks
|
|
230
232
|
instead (60 s, `MOL_DEEPSEEK_STREAM_SILENCE_TIMEOUT_MS`) and surfaces an error event, keeping
|
|
231
233
|
the partial reply. Hosts observe both through the `onStreamStall` callback.
|
|
232
234
|
|
package/dist/index.d.ts
CHANGED
|
@@ -34,8 +34,10 @@
|
|
|
34
34
|
* **A stream that opens and then produces nothing is bounded, not waited on.** DeepSeek answers
|
|
35
35
|
* 200 and then keeps a stalled prefill alive with `: keep-alive` comments, so no HTTP status is
|
|
36
36
|
* ever wrong and a byte-level idle timeout never sees the stall. `chat()` therefore bounds the
|
|
37
|
-
* wait for the first CONTENT event (45 s, `MOL_DEEPSEEK_FIRST_TOKEN_TIMEOUT_MS`)
|
|
38
|
-
*
|
|
37
|
+
* wait for the first CONTENT event (45 s, `MOL_DEEPSEEK_FIRST_TOKEN_TIMEOUT_MS`) — a window that
|
|
38
|
+
* starts when the request is sent, so it also bounds an attempt whose response HEADERS never
|
|
39
|
+
* arrive — and asks once more with a fresh stream; after the reply has started it bounds the
|
|
40
|
+
* silence between chunks
|
|
39
41
|
* instead (60 s, `MOL_DEEPSEEK_STREAM_SILENCE_TIMEOUT_MS`) and surfaces an error event, keeping
|
|
40
42
|
* the partial reply. Hosts observe both through the `onStreamStall` callback.
|
|
41
43
|
*
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAE1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAMlD;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,UAUrB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -34,8 +34,10 @@
|
|
|
34
34
|
* **A stream that opens and then produces nothing is bounded, not waited on.** DeepSeek answers
|
|
35
35
|
* 200 and then keeps a stalled prefill alive with `: keep-alive` comments, so no HTTP status is
|
|
36
36
|
* ever wrong and a byte-level idle timeout never sees the stall. `chat()` therefore bounds the
|
|
37
|
-
* wait for the first CONTENT event (45 s, `MOL_DEEPSEEK_FIRST_TOKEN_TIMEOUT_MS`)
|
|
38
|
-
*
|
|
37
|
+
* wait for the first CONTENT event (45 s, `MOL_DEEPSEEK_FIRST_TOKEN_TIMEOUT_MS`) — a window that
|
|
38
|
+
* starts when the request is sent, so it also bounds an attempt whose response HEADERS never
|
|
39
|
+
* arrive — and asks once more with a fresh stream; after the reply has started it bounds the
|
|
40
|
+
* silence between chunks
|
|
39
41
|
* instead (60 s, `MOL_DEEPSEEK_STREAM_SILENCE_TIMEOUT_MS`) and surfaces an error event, keeping
|
|
40
42
|
* the partial reply. Hosts observe both through the `onStreamStall` callback.
|
|
41
43
|
*
|
package/dist/provider.d.ts
CHANGED
|
@@ -66,7 +66,7 @@ declare class DeepseekAIProviderImpl implements AIProvider {
|
|
|
66
66
|
* them in one loop made each one's attempt count depend on the other's.
|
|
67
67
|
*
|
|
68
68
|
* @param args - The request body, headers, upstream model and abort signal.
|
|
69
|
-
* @returns The
|
|
69
|
+
* @returns The response and the final dispatch send time (deliberate backoff excluded).
|
|
70
70
|
*/
|
|
71
71
|
private requestWithRateLimitRetries;
|
|
72
72
|
/**
|
package/dist/provider.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,KAAK,EACV,UAAU,EAIV,SAAS,EAET,UAAU,EAEV,cAAc,EACd,uBAAuB,EAGxB,MAAM,kBAAkB,CAAA;AASzB,OAAO,cAAc,CAAA;AAErB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,KAAK,EACV,UAAU,EAIV,SAAS,EAET,UAAU,EAEV,cAAc,EACd,uBAAuB,EAGxB,MAAM,kBAAkB,CAAA;AASzB,OAAO,cAAc,CAAA;AAErB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AA2IhD,8DAA8D;AAC9D,eAAO,MAAM,8BAA8B,QAAS,CAAA;AA8MpD;;;;GAIG;AACH,cAAM,sBAAuB,YAAW,UAAU;IAChD,QAAQ,CAAC,IAAI,cAAa;IAC1B,OAAO,CAAC,MAAM,CAAQ;IACtB,OAAO,CAAC,YAAY,CAAQ;IAC5B,OAAO,CAAC,SAAS,CAAQ;IACzB,OAAO,CAAC,OAAO,CAAQ;IACvB,OAAO,CAAC,eAAe,CAAQ;IAC/B,OAAO,CAAC,QAAQ,CAAwB;IACxC,OAAO,CAAC,WAAW,CAAC,CAAqB;IACzC,OAAO,CAAC,aAAa,CAAC,CAAuB;IAC7C,OAAO,CAAC,mBAAmB,CAAQ;IACnC,OAAO,CAAC,sBAAsB,CAAQ;gBAE1B,MAAM,GAAE,cAAmB;IAwBvC;;;;;OAKG;IACI,IAAI,CAAC,MAAM,EAAE,UAAU,GAAG,aAAa,CAAC,SAAS,CAAC;IA4TzD;;;;;;;;;;;;;;;;;;OAkBG;IACH,wBAAwB,CAAC,KAAK,EAAE,cAAc,GAAG,uBAAuB;IAQxE;;;;;;;;;OASG;YACW,2BAA2B;IAiIzC;;;;;;;OAOG;IACH,OAAO,CAAC,iBAAiB;IA2BzB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,OAAO,CAAC,cAAc;IA8FtB;;;;;OAKG;IACH,OAAO,CAAC,WAAW;IAWnB;;;;;OAKG;IACH,OAAO,CAAE,yBAAyB;IA+ElC;;;;;;;OAOG;IACH,OAAO,CAAC,UAAU;IAUlB;;;;;;;;;;;;OAYG;YACY,sBAAsB;IA2GrC;;;;;;;;;;OAUG;IACH,OAAO,CAAE,eAAe;CAwOzB;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,+BAAyB,CAAA;AAExD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,MAAM,CAAC,EAAE,cAAc,GAAG,UAAU,CAElE"}
|
package/dist/provider.js
CHANGED
|
@@ -30,6 +30,33 @@ import './secrets.js';
|
|
|
30
30
|
function budgetToEffort(budgetTokens) {
|
|
31
31
|
return budgetTokens >= 12_000 ? 'max' : 'high';
|
|
32
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Read the upstream's explanation from a rejected response body: its error
|
|
35
|
+
* `type` (or `code`) and `message`, the message bounded to 500 characters.
|
|
36
|
+
*
|
|
37
|
+
* @param text - The rejected response's body text.
|
|
38
|
+
* @returns The upstream error, or `undefined` when the body carried neither field.
|
|
39
|
+
*/
|
|
40
|
+
function parseUpstreamError(text) {
|
|
41
|
+
let error;
|
|
42
|
+
try {
|
|
43
|
+
error = JSON.parse(text)?.error;
|
|
44
|
+
}
|
|
45
|
+
catch (_error) {
|
|
46
|
+
// Not JSON (a proxy's error page, plain text): a short body is the message itself.
|
|
47
|
+
const trimmed = text.trim();
|
|
48
|
+
return trimmed && trimmed.length <= 500 ? { message: trimmed } : undefined;
|
|
49
|
+
}
|
|
50
|
+
const type = typeof error?.type === 'string'
|
|
51
|
+
? error.type
|
|
52
|
+
: typeof error?.code === 'string'
|
|
53
|
+
? error.code
|
|
54
|
+
: undefined;
|
|
55
|
+
const message = typeof error?.message === 'string' ? error.message.slice(0, 500) : undefined;
|
|
56
|
+
if (!type && !message)
|
|
57
|
+
return undefined;
|
|
58
|
+
return { ...(type ? { type } : {}), ...(message ? { message } : {}) };
|
|
59
|
+
}
|
|
33
60
|
/** How long a stream may wait for its first content event. */
|
|
34
61
|
export const DEFAULT_FIRST_TOKEN_TIMEOUT_MS = 45_000;
|
|
35
62
|
/** How long a stream that HAS started may go without a single byte. */
|
|
@@ -198,6 +225,22 @@ function isContentEvent(event) {
|
|
|
198
225
|
event.type === 'tool_use_start' ||
|
|
199
226
|
event.type === 'tool_input_delta');
|
|
200
227
|
}
|
|
228
|
+
/**
|
|
229
|
+
* The first-token window expired before response HEADERS arrived.
|
|
230
|
+
*
|
|
231
|
+
* Module-private: the only consumer is this provider's own stall loop, which
|
|
232
|
+
* reports it in the existing `before_content` shape and asks once more. It is
|
|
233
|
+
* never thrown for a caller cancellation — a caller abort (or the whole-attempt
|
|
234
|
+
* ceiling) outranks the window and is re-thrown untouched.
|
|
235
|
+
*/
|
|
236
|
+
class FirstTokenHeaderTimeoutError extends Error {
|
|
237
|
+
boundMs;
|
|
238
|
+
constructor(boundMs) {
|
|
239
|
+
super(`DeepSeek sent no response headers within ${boundMs} ms`);
|
|
240
|
+
this.boundMs = boundMs;
|
|
241
|
+
this.name = 'FirstTokenHeaderTimeoutError';
|
|
242
|
+
}
|
|
243
|
+
}
|
|
201
244
|
/**
|
|
202
245
|
* DeepSeek AI provider that implements the `AIProvider` interface using
|
|
203
246
|
* DeepSeek's OpenAI-compatible Chat Completions API with support for streaming,
|
|
@@ -368,14 +411,51 @@ class DeepseekAIProviderImpl {
|
|
|
368
411
|
// present, still wins over it (both abort this one controller).
|
|
369
412
|
const ceiling = setTimeout(() => controller.abort(), DEFAULT_TIMEOUT_MS);
|
|
370
413
|
ceiling.unref?.();
|
|
371
|
-
const signal = controller.signal;
|
|
372
414
|
try {
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
415
|
+
let response;
|
|
416
|
+
let requestSentAt = 0;
|
|
417
|
+
// Set when the dispatch's retry loop already read the rejected 429/503
|
|
418
|
+
// body; the `!response.ok` path reuses it instead of a second read.
|
|
419
|
+
let rejectedBody;
|
|
420
|
+
try {
|
|
421
|
+
const dispatched = await this.requestWithRateLimitRetries({
|
|
422
|
+
body,
|
|
423
|
+
headers,
|
|
424
|
+
model,
|
|
425
|
+
controller,
|
|
426
|
+
// The first-token window covers an attempt that never receives
|
|
427
|
+
// response HEADERS too, not only one that receives them and then
|
|
428
|
+
// sends no content: a window that started at the headers left the
|
|
429
|
+
// whole pre-header phase to the five-minute attempt ceiling alone.
|
|
430
|
+
// Passing it only while streaming keeps the non-streaming path —
|
|
431
|
+
// which has no first token to wait for — on that ceiling.
|
|
432
|
+
...(params.stream === false ? {} : { firstTokenTimeoutMs }),
|
|
433
|
+
});
|
|
434
|
+
response = dispatched.response;
|
|
435
|
+
requestSentAt = dispatched.sentAt;
|
|
436
|
+
rejectedBody = dispatched.rejectedBody;
|
|
437
|
+
}
|
|
438
|
+
catch (error) {
|
|
439
|
+
if (!(error instanceof FirstTokenHeaderTimeoutError) || params.signal?.aborted)
|
|
440
|
+
throw error;
|
|
441
|
+
// Nothing reached the consumer, so the same once-only re-ask a
|
|
442
|
+
// post-header stall gets is safe here too — reported in the
|
|
443
|
+
// established `before_content` shape, so hosts and analytics see one
|
|
444
|
+
// kind of stall either way.
|
|
445
|
+
const willRetry = stalledAttempt < MAX_STALL_RETRIES;
|
|
446
|
+
this.reportStreamStall(model, {
|
|
447
|
+
stallMs: error.boundMs,
|
|
448
|
+
attempt: stalledAttempt + 1,
|
|
449
|
+
willRetry,
|
|
450
|
+
streamedChars: 0,
|
|
451
|
+
keepAlives: 0,
|
|
452
|
+
phase: 'before_content',
|
|
453
|
+
});
|
|
454
|
+
if (willRetry)
|
|
455
|
+
continue;
|
|
456
|
+
yield { type: 'error', message: t('ai.error.apiError'), errorKey: 'ai.error.apiError' };
|
|
457
|
+
return;
|
|
458
|
+
}
|
|
379
459
|
// Whatever the transport exposes about this call. DeepSeek's edge
|
|
380
460
|
// answers with `x-ds-trace-id`; other OpenAI-compatible hosts use
|
|
381
461
|
// `x-request-id`. Recorded rather than read for control flow: it is the
|
|
@@ -387,7 +467,9 @@ class DeepseekAIProviderImpl {
|
|
|
387
467
|
if (traceId)
|
|
388
468
|
call.meta.traceId = traceId;
|
|
389
469
|
if (!response.ok) {
|
|
390
|
-
|
|
470
|
+
// A 429/503 body was already read by the retry loop inside the
|
|
471
|
+
// dispatch; a body reads only once, so reuse that text.
|
|
472
|
+
const errorBody = rejectedBody ?? (await response.text());
|
|
391
473
|
let detail = `HTTP ${response.status}`;
|
|
392
474
|
try {
|
|
393
475
|
const parsed = JSON.parse(errorBody);
|
|
@@ -467,14 +549,17 @@ class DeepseekAIProviderImpl {
|
|
|
467
549
|
controller.abort();
|
|
468
550
|
}, ms);
|
|
469
551
|
};
|
|
470
|
-
|
|
552
|
+
// Headers and content share this dispatch's existing first-token window.
|
|
553
|
+
// A 429/503 retry has its own send time; deliberate backoff is excluded.
|
|
554
|
+
armBound(Math.max(0, firstTokenTimeoutMs - (Date.now() - requestSentAt)), 'before_content');
|
|
555
|
+
bounds.windowStartedAt = requestSentAt;
|
|
471
556
|
try {
|
|
472
557
|
yield* this.parseStreamingResponse(response, state, { silenceMs: this.streamSilenceTimeoutMs, arm: armBound }, call);
|
|
473
558
|
}
|
|
474
559
|
catch (error) {
|
|
475
560
|
// Only a bound expiry is this provider's to absorb — anything else
|
|
476
561
|
// (the caller aborting, a socket failure) belongs to the caller.
|
|
477
|
-
if (!bounds.expired)
|
|
562
|
+
if (!bounds.expired || params.signal?.aborted)
|
|
478
563
|
throw error;
|
|
479
564
|
const stall = {
|
|
480
565
|
stallMs: Date.now() - bounds.windowStartedAt,
|
|
@@ -543,21 +628,59 @@ class DeepseekAIProviderImpl {
|
|
|
543
628
|
* them in one loop made each one's attempt count depend on the other's.
|
|
544
629
|
*
|
|
545
630
|
* @param args - The request body, headers, upstream model and abort signal.
|
|
546
|
-
* @returns The
|
|
631
|
+
* @returns The response and the final dispatch send time (deliberate backoff excluded).
|
|
547
632
|
*/
|
|
548
633
|
async requestWithRateLimitRetries(args) {
|
|
549
|
-
const { body, headers, model,
|
|
634
|
+
const { body, headers, model, controller, firstTokenTimeoutMs } = args;
|
|
635
|
+
const signal = controller.signal;
|
|
550
636
|
// Retry with exponential backoff for rate limits (429) and overloaded (503)
|
|
551
637
|
const MAX_RETRIES = 3;
|
|
552
638
|
let response = null;
|
|
639
|
+
let sentAt = 0;
|
|
640
|
+
// The rejected body already read by this loop, when the final attempt ended
|
|
641
|
+
// on a 429/503: a body reads only once, so the caller must reuse this text
|
|
642
|
+
// instead of asking the response for it a second time (which throws).
|
|
643
|
+
let rejectedBody;
|
|
553
644
|
for (let attempt = 0; attempt <= MAX_RETRIES; attempt++) {
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
645
|
+
// Reset per attempt: only THIS attempt's rejection has been read.
|
|
646
|
+
rejectedBody = undefined;
|
|
647
|
+
// Bound THIS dispatch, not the retry loop: a deliberate backoff sleep is
|
|
648
|
+
// this provider's own wait, so no window is running while it is spent.
|
|
649
|
+
let headerDeadline = null;
|
|
650
|
+
sentAt = Date.now();
|
|
651
|
+
if (firstTokenTimeoutMs !== undefined) {
|
|
652
|
+
headerDeadline = setTimeout(() => controller.abort(new FirstTokenHeaderTimeoutError(firstTokenTimeoutMs)), firstTokenTimeoutMs);
|
|
653
|
+
headerDeadline.unref?.();
|
|
654
|
+
}
|
|
655
|
+
try {
|
|
656
|
+
response = await fetch(`${this.baseUrl}${this.completionsPath}`, {
|
|
657
|
+
method: 'POST',
|
|
658
|
+
headers,
|
|
659
|
+
body: JSON.stringify(body),
|
|
660
|
+
signal,
|
|
661
|
+
});
|
|
662
|
+
}
|
|
663
|
+
finally {
|
|
664
|
+
// Release the header timer when fetch settles. The successful SSE reader
|
|
665
|
+
// uses the remaining window; a rate-limit retry starts a new dispatch.
|
|
666
|
+
if (headerDeadline)
|
|
667
|
+
clearTimeout(headerDeadline);
|
|
668
|
+
}
|
|
560
669
|
if (response.status === 429 || response.status === 503) {
|
|
670
|
+
// Read the body once: an unread body pins its connection, and only the
|
|
671
|
+
// body says what the upstream actually refused the request for.
|
|
672
|
+
try {
|
|
673
|
+
rejectedBody = await response.text();
|
|
674
|
+
}
|
|
675
|
+
catch (error) {
|
|
676
|
+
// Caller cancellation still ends the request; any other read failure
|
|
677
|
+
// only loses the reason, so the body counts as read and the retry
|
|
678
|
+
// policy goes on (the same guard the moonshot bond applies).
|
|
679
|
+
signal.throwIfAborted();
|
|
680
|
+
logger.debug('DeepSeek rejected response body could not be read', { error });
|
|
681
|
+
rejectedBody = '';
|
|
682
|
+
}
|
|
683
|
+
const upstreamError = parseUpstreamError(rejectedBody);
|
|
561
684
|
const willRetry = attempt < MAX_RETRIES;
|
|
562
685
|
// Retry-After is equally-valid as delta-seconds or an HTTP-date;
|
|
563
686
|
// parseInt on the date form yields NaN, degrading the backoff to a
|
|
@@ -581,6 +704,7 @@ class DeepseekAIProviderImpl {
|
|
|
581
704
|
willRetry,
|
|
582
705
|
retryInMs: delayMs,
|
|
583
706
|
...(hasRetryAfter ? { retryAfterSeconds: parsedRetryAfterSeconds } : {}),
|
|
707
|
+
...(upstreamError ? { upstreamError } : {}),
|
|
584
708
|
});
|
|
585
709
|
}
|
|
586
710
|
catch (error) {
|
|
@@ -592,22 +716,26 @@ class DeepseekAIProviderImpl {
|
|
|
592
716
|
status: response.status,
|
|
593
717
|
attempt: attempt + 1,
|
|
594
718
|
delayMs,
|
|
719
|
+
...(upstreamError ? { upstreamError } : {}),
|
|
595
720
|
});
|
|
721
|
+
// A host may cancel inside onRateLimit, before a backoff listener exists.
|
|
722
|
+
signal.throwIfAborted();
|
|
596
723
|
await new Promise((resolve) => {
|
|
597
|
-
const
|
|
598
|
-
signal.addEventListener('abort', () => {
|
|
724
|
+
const finish = () => {
|
|
599
725
|
clearTimeout(timer);
|
|
726
|
+
signal.removeEventListener('abort', finish);
|
|
600
727
|
resolve();
|
|
601
|
-
}
|
|
728
|
+
};
|
|
729
|
+
const timer = setTimeout(finish, delayMs);
|
|
730
|
+
signal.addEventListener('abort', finish, { once: true });
|
|
602
731
|
});
|
|
603
|
-
|
|
604
|
-
break;
|
|
732
|
+
signal.throwIfAborted();
|
|
605
733
|
continue;
|
|
606
734
|
}
|
|
607
735
|
}
|
|
608
736
|
break;
|
|
609
737
|
}
|
|
610
|
-
return response;
|
|
738
|
+
return { response: response, sentAt, ...(rejectedBody !== undefined ? { rejectedBody } : {}) };
|
|
611
739
|
}
|
|
612
740
|
/**
|
|
613
741
|
* Record one stalled attempt: a warn line always, plus the host's
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/api-ai-deepseek",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "DeepSeek AI provider for molecule.dev",
|
|
5
5
|
"homepage": "https://www.molecule.dev/packages/api-ai-deepseek",
|
|
6
6
|
"type": "module",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"directory": "packages/api/bonds/ai/deepseek"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@molecule/api-ai": "1.
|
|
37
|
-
"@molecule/api-bond": "1.0.
|
|
36
|
+
"@molecule/api-ai": "1.5.0",
|
|
37
|
+
"@molecule/api-bond": "1.0.4",
|
|
38
38
|
"@types/node": "26.6.5",
|
|
39
39
|
"typescript": "6.0.3",
|
|
40
40
|
"vitest": "4.1.12"
|