@deepseek-ai/dsh-llm 0.0.1-rc.1 → 0.0.1-rc.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.i18n.yaml +1 -1
- package/README.md +2 -2
- package/lib/index.js +3 -3
- package/lib/types/attribution.d.ts +1 -1
- package/lib/types/attribution.js +1 -2
- package/lib/types/index.d.ts +2 -12
- package/lib/types/index.js +2 -2
- package/lib/types/types.d.ts +16 -2
- package/package.json +9 -9
package/README.i18n.yaml
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
3
|
# after editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write packages/llm/llm/README.md
|
|
5
|
-
README.md:
|
|
5
|
+
README.md: a5aa3155c57ae30d58ced3c79a3db903c675fd7e
|
|
6
6
|
README.zh.md: 17a0fd92b48db3ea5122ac2f1c1ed6e116e6d6e0
|
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ Provider-neutral LLM vocabulary and abstract service. This package defines the c
|
|
|
6
6
|
|
|
7
7
|
## Service: `LlmService` (ctx key: `llm`)
|
|
8
8
|
|
|
9
|
-
An adapter registry plus a single streaming call
|
|
9
|
+
An adapter registry plus a single streaming call API, interceptable via a waterfall event.
|
|
10
10
|
|
|
11
11
|
### Public API
|
|
12
12
|
|
|
@@ -73,7 +73,7 @@ Every adapter that puts a credential in an HTTP header judges it the same way be
|
|
|
73
73
|
- `BlockAssembler` — incrementally assembles raw chunks into complete content blocks and can create an identified, frozen assistant message from them. The agent loop feeds it raw chunks (logging them for replay) while reading the assembled blocks for history.
|
|
74
74
|
- `HarnessError` — base class for the harness error taxonomy: a stable `code` string (distinct from the human `message`) plus `cause` chaining. Lives here, in the leaf package every other imports, so a single base is shared without a new dependency edge. Per-package errors (`LlmError`, `ToolArgsError`, `InvariantError`, …) extend it. `isHarnessError(value)` narrows at process boundaries.
|
|
75
75
|
- `LlmError` — extends `HarnessError`; its stable `code` string (`NO_ADAPTER`, `DUPLICATE_ADAPTER`, and adapter codes like `AUTH`/`RATE_LIMIT`) matches its frozen serializable `failure.code`. The payload may also retain validated status, `Retry-After`, and branded provider request id facts; policy remains outside the error.
|
|
76
|
-
- `errorChain(value)` — renders a thrown value with its full `cause` chain and AggregateError members for diagnostic
|
|
76
|
+
- `errorChain(value)` — renders a thrown value with its full `cause` chain and AggregateError members for diagnostic outputs (UI notices, logger lines, durable `turn/end` messages), so transport wrappers like undici's `TypeError: fetch failed` surface the underlying `ECONNREFUSED`/DNS/TLS detail instead of masking it. Rendering only — route on `code`, never by parsing the result.
|
|
77
77
|
- `CONTEXT_WINDOW_EXCEEDED_CODE` — the provider-neutral code both DeepSeek adapters use when a request exceeds the model context window, regardless of thrown-HTTP versus in-band finish delivery. `isContextWindowExceededError(detail)` is their shared conservative classifier for OpenAI-compatible provider detail.
|
|
78
78
|
- `QUOTA_EXCEEDED_CODE` — the non-transient provider-neutral code for exhausted account quota, balance, credits, budget, or usage limits. `isQuotaExceededError(detail)` keeps those failures distinct from request-rate limits.
|
|
79
79
|
- `EMPTY_RESPONSE_CODE` — the provider-neutral code both adapters use for a degenerate provider completion: a terminal `stop` that carried no content blocks at all. Classified as an error finish (not a successful empty message) because the attempt produced nothing durable; `dsh-llm-retry` retries it by default.
|
package/lib/index.js
CHANGED
|
@@ -578,7 +578,7 @@ const { version } = createRequire(import.meta.url)("../package.json");
|
|
|
578
578
|
const APP_IDENTITY = {
|
|
579
579
|
product: "deepseek-harness",
|
|
580
580
|
version,
|
|
581
|
-
url: "https://github.com/deepseek-ai/deepseek-harness
|
|
581
|
+
url: "https://github.com/deepseek-ai/deepseek-harness"
|
|
582
582
|
};
|
|
583
583
|
/**
|
|
584
584
|
* The standard `User-Agent` value: `product/version (+url)`. The
|
|
@@ -788,7 +788,7 @@ var BlockAssembler = class {
|
|
|
788
788
|
//#region lib/types/index.js
|
|
789
789
|
/**
|
|
790
790
|
* LLM service: adapter registry with a waterfall-interceptable streaming call
|
|
791
|
-
*
|
|
791
|
+
* API. Exports the `LlmService` default, the abstract `LlmAdapter` for
|
|
792
792
|
* provider backends, and `BlockAssembler` for chunk assembly.
|
|
793
793
|
*
|
|
794
794
|
* @module @deepseek-ai/dsh-llm
|
|
@@ -898,7 +898,7 @@ var LlmAdapter = class {
|
|
|
898
898
|
};
|
|
899
899
|
/**
|
|
900
900
|
* The abstract `llm` service: an adapter registry plus a streaming model-call
|
|
901
|
-
*
|
|
901
|
+
* API, interceptable via the `llm/stream` waterfall.
|
|
902
902
|
*/
|
|
903
903
|
var LlmService = class extends Service {
|
|
904
904
|
adapters = /* @__PURE__ */ new Map();
|
|
@@ -18,7 +18,7 @@ export interface AppIdentity {
|
|
|
18
18
|
product: string;
|
|
19
19
|
/** Product version; sourced from package metadata, never hand-copied. */
|
|
20
20
|
version: string;
|
|
21
|
-
/**
|
|
21
|
+
/** Repository home URL of the app, used as the `User-Agent` comment. */
|
|
22
22
|
url: string;
|
|
23
23
|
}
|
|
24
24
|
/**
|
package/lib/types/attribution.js
CHANGED
|
@@ -21,8 +21,7 @@ const { version } = createRequire(import.meta.url)('../package.json');
|
|
|
21
21
|
export const APP_IDENTITY = {
|
|
22
22
|
product: 'deepseek-harness',
|
|
23
23
|
version,
|
|
24
|
-
|
|
25
|
-
url: 'https://github.com/deepseek-ai/deepseek-harness-sdk',
|
|
24
|
+
url: 'https://github.com/deepseek-ai/deepseek-harness',
|
|
26
25
|
};
|
|
27
26
|
/**
|
|
28
27
|
* The standard `User-Agent` value: `product/version (+url)`. The
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* LLM service: adapter registry with a waterfall-interceptable streaming call
|
|
3
|
-
*
|
|
3
|
+
* API. Exports the `LlmService` default, the abstract `LlmAdapter` for
|
|
4
4
|
* provider backends, and `BlockAssembler` for chunk assembly.
|
|
5
5
|
*
|
|
6
6
|
* @module @deepseek-ai/dsh-llm
|
|
@@ -41,16 +41,6 @@ declare module '@deepseek-ai/cordis' {
|
|
|
41
41
|
* @mode waterfall
|
|
42
42
|
*/
|
|
43
43
|
'llm/stream'(this: LlmService, options: GenerateOptions, next: () => AsyncIterable<StreamChunk>): AsyncIterable<StreamChunk>;
|
|
44
|
-
/**
|
|
45
|
-
* The provider topology changed: an adapter registered or unregistered
|
|
46
|
-
* routes, or the configurable-provider directory gained or lost entries.
|
|
47
|
-
* This is a payload-free registry notification fired at each commit point
|
|
48
|
-
* (including registration disposal); consumers re-read `listProviders()`,
|
|
49
|
-
* `listModels()`, or `listConfigurableProviders()` for the new state.
|
|
50
|
-
* Observer failures are contained and cannot veto the registry mutation.
|
|
51
|
-
* @mode emit
|
|
52
|
-
*/
|
|
53
|
-
'llm/adapters-updated'(): void;
|
|
54
44
|
}
|
|
55
45
|
}
|
|
56
46
|
/** Structured provider facts and cause accepted by {@link LlmError}. */
|
|
@@ -203,7 +193,7 @@ export interface DirectoryRegistrationHandle {
|
|
|
203
193
|
}
|
|
204
194
|
/**
|
|
205
195
|
* The abstract `llm` service: an adapter registry plus a streaming model-call
|
|
206
|
-
*
|
|
196
|
+
* API, interceptable via the `llm/stream` waterfall.
|
|
207
197
|
*/
|
|
208
198
|
export declare class LlmService extends Service {
|
|
209
199
|
private adapters;
|
package/lib/types/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* LLM service: adapter registry with a waterfall-interceptable streaming call
|
|
3
|
-
*
|
|
3
|
+
* API. Exports the `LlmService` default, the abstract `LlmAdapter` for
|
|
4
4
|
* provider backends, and `BlockAssembler` for chunk assembly.
|
|
5
5
|
*
|
|
6
6
|
* @module @deepseek-ai/dsh-llm
|
|
@@ -143,7 +143,7 @@ export class LlmAdapter {
|
|
|
143
143
|
}
|
|
144
144
|
/**
|
|
145
145
|
* The abstract `llm` service: an adapter registry plus a streaming model-call
|
|
146
|
-
*
|
|
146
|
+
* API, interceptable via the `llm/stream` waterfall.
|
|
147
147
|
*/
|
|
148
148
|
export class LlmService extends Service {
|
|
149
149
|
adapters = new Map();
|
package/lib/types/types.d.ts
CHANGED
|
@@ -7,6 +7,20 @@ import type { Branded } from '@deepseek-ai/dsh-brand';
|
|
|
7
7
|
import type { ImageAttachmentRef } from '@deepseek-ai/dsh-attachment';
|
|
8
8
|
import type { CallId, ProviderRequestId, ReasoningEffortId } from './brand.ts';
|
|
9
9
|
import type { Message } from './message.ts';
|
|
10
|
+
declare module '@deepseek-ai/cordis' {
|
|
11
|
+
interface Events {
|
|
12
|
+
/**
|
|
13
|
+
* The provider topology changed: an adapter registered or unregistered
|
|
14
|
+
* routes, or the configurable-provider directory gained or lost entries.
|
|
15
|
+
* This payload-free registry notification fires at each commit point
|
|
16
|
+
* (including registration disposal); consumers re-read `listProviders()`,
|
|
17
|
+
* `listModels()`, or `listConfigurableProviders()` for the new state.
|
|
18
|
+
* Observer failures are contained and cannot veto the registry mutation.
|
|
19
|
+
* @mode emit
|
|
20
|
+
*/
|
|
21
|
+
'llm/adapters-updated'(): void;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
10
24
|
export type { AssistantMessage, AssistantProvenance, Message, MessageSource, MessageSourceMap, ModelMessageSource, ToolMessageSource, ToolResultMessage, UserMessage, } from './message.ts';
|
|
11
25
|
/** Serializable provider or transport failure facts; policy decides whether they are retryable. */
|
|
12
26
|
export interface LlmFailure {
|
|
@@ -321,8 +335,8 @@ export interface GenerateOptions {
|
|
|
321
335
|
stop?: string[];
|
|
322
336
|
signal?: AbortSignal;
|
|
323
337
|
/**
|
|
324
|
-
* Session identity stamped by the loop for
|
|
325
|
-
*
|
|
338
|
+
* Session identity stamped by the loop for request routing. Replay uses it
|
|
339
|
+
* to separate cursors; adapters may map it to model-hidden transport metadata.
|
|
326
340
|
*/
|
|
327
341
|
sessionId?: Branded<'SessionId'>;
|
|
328
342
|
/**
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-llm",
|
|
3
3
|
"description": "Provider-neutral LLM service interface for the DeepSeek Harness",
|
|
4
|
-
"version": "0.0.1-rc.
|
|
4
|
+
"version": "0.0.1-rc.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "restricted"
|
|
7
7
|
},
|
|
@@ -45,20 +45,20 @@
|
|
|
45
45
|
],
|
|
46
46
|
"license": "BSD-3-Clause",
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@deepseek-ai/dsh-attachment": "^0.0.1-rc.
|
|
49
|
-
"@deepseek-ai/dsh-brand": "^0.0.1-rc.
|
|
50
|
-
"@deepseek-ai/dsh-invariants": "^0.0.1-rc.
|
|
51
|
-
"@deepseek-ai/dsh-timeout": "^0.0.1-rc.
|
|
48
|
+
"@deepseek-ai/dsh-attachment": "^0.0.1-rc.2",
|
|
49
|
+
"@deepseek-ai/dsh-brand": "^0.0.1-rc.2",
|
|
50
|
+
"@deepseek-ai/dsh-invariants": "^0.0.1-rc.2",
|
|
51
|
+
"@deepseek-ai/dsh-timeout": "^0.0.1-rc.2",
|
|
52
52
|
"@deepseek-ai/cordis": "^4.0.1-rc.1"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@deepseek-ai/schemastery": "^3.18.1-rc.1"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@deepseek-ai/dsh-attachment": "^0.0.1-rc.
|
|
59
|
-
"@deepseek-ai/dsh-brand": "^0.0.1-rc.
|
|
60
|
-
"@deepseek-ai/dsh-
|
|
61
|
-
"@deepseek-ai/dsh-
|
|
58
|
+
"@deepseek-ai/dsh-attachment": "^0.0.1-rc.2",
|
|
59
|
+
"@deepseek-ai/dsh-brand": "^0.0.1-rc.2",
|
|
60
|
+
"@deepseek-ai/dsh-timeout": "^0.0.1-rc.2",
|
|
61
|
+
"@deepseek-ai/dsh-invariants": "^0.0.1-rc.2",
|
|
62
62
|
"@deepseek-ai/cordis": "^4.0.1-rc.1"
|
|
63
63
|
}
|
|
64
64
|
}
|