@deepseek-ai/dsh-web 0.0.1-rc.1 → 0.0.1-rc.3

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 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/web/web/README.md
5
- README.md: 2acb5022a83c08c33a26be626a93b7355c07a0ed
6
- README.zh.md: b77b0a897082dba01e10be3f7b0ca3b3f0260a9f
5
+ README.md: 8dfc7f032e25e40207bb3880777b814e67175a20
6
+ README.zh.md: 3354037bfcd77ca2b1a07da710b565065baf543b
package/README.md CHANGED
@@ -2,16 +2,16 @@
2
2
 
3
3
  English | [中文](README.zh.md)
4
4
 
5
- The **`WebService`** (`ctx.web`) defines WHAT web access the harness has — search the web, fetch a URL — over multiple providers, without binding the model contract to one vendor's API shape.
5
+ The **`WebRuntime`** (`ctx.web`) defines WHAT web access the harness has — search the web, fetch a URL — over multiple providers, without binding the model contract to one vendor's API shape.
6
6
 
7
- This package owns the Service Definition role of the web capability. Unlike bash/fs it spans two operations (search and fetch) on one seam, with potentially multiple providers each:
7
+ This package owns the Service Definition role of the web capability. Unlike shell/fs it spans two operations (search and fetch) on one seam, with potentially multiple providers each:
8
8
 
9
9
  | Package | Role |
10
10
  |---|---|
11
11
  | `@deepseek-ai/dsh-web` (this) | Service Definition: the service, provider registries, selection policy, request/result vocabulary, the `WebError` taxonomy |
12
12
  | `@deepseek-ai/dsh-web-search-exa` | Search provider: Exa |
13
13
  | `@deepseek-ai/dsh-web-search-perplexity` | Search provider: Perplexity |
14
- | `@deepseek-ai/dsh-web-fetch-local` | Fetch provider: anonymous public HTTP(S) |
14
+ | `@deepseek-ai/dsh-web-fetch-http` | Fetch provider: anonymous public HTTP(S) |
15
15
  | `@deepseek-ai/dsh-tool-web` | Consumer: the model-facing `web_search` / `web_fetch` tool schemas over `ctx.web` |
16
16
 
17
17
  Search and fetch share no request schema and no business logic, but they are deliberately one seam: `ctx.web` is a single web-access middle layer with one provider-selection policy owner, one abort/error vocabulary, and one product-facing "how this harness reaches the web" config surface. The `Search`/`Fetch` method pairs are deliberately parallel.
@@ -39,7 +39,7 @@ Selection never depends on registration, config, or HMR order. A capability has
39
39
  | no id, no usable provider | `WEB_PROVIDER_UNAVAILABLE` |
40
40
  | no id, multiple usable providers | `WEB_PROVIDER_AMBIGUOUS` |
41
41
 
42
- The failure branches throw `WebError`, whose structured code (plus message detail — the missing id, the ambiguous candidate set) is the surface callers route on. A provider's own `available()` is a cheap local check (credential presence, parseable config) that feeds this execution-time selection and **must not make network calls**; `dsh-tool-web` never calls it — the tool executes through `ctx.web.search()`/`fetch()` and routes on the thrown codes, so provider selection has one owner.
42
+ The failure branches throw `WebError`, whose structured code (plus message detail — the missing id, the ambiguous candidate set) is the direct callers route on. A provider's own `available()` is a cheap local check (credential presence, parseable config) that feeds this execution-time selection and **must not make network calls**; `dsh-tool-web` never calls it — the tool executes through `ctx.web.search()`/`fetch()` and routes on the thrown codes, so provider selection has one owner.
43
43
 
44
44
  ## Vocabulary
45
45
 
package/README.zh.md CHANGED
@@ -2,16 +2,16 @@
2
2
 
3
3
  [English](README.md) | 中文
4
4
 
5
- **`WebService`**(`ctx.web`)定义 harness 具备哪些 web 访问能力(搜索 web、抓取 URL),并通过多个提供方实现,不把模型约定绑定到某个厂商的 API 形状。
5
+ **`WebRuntime`**(`ctx.web`)定义 harness 具备哪些 web 访问能力(搜索 web、抓取 URL),并通过多个提供方实现,不把模型约定绑定到某个厂商的 API 形状。
6
6
 
7
- 本包承担 web 能力的 Service Definition 角色。与 bash/fs 不同,它在一个 seam 上跨越搜索与抓取两种操作,每种操作都可能有多个提供方:
7
+ 本包承担 web 能力的 Service Definition 角色。与 shell/fs 不同,它在一个 seam 上跨越搜索与抓取两种操作,每种操作都可能有多个提供方:
8
8
 
9
9
  | 包 | 职责 |
10
10
  |---|---|
11
11
  | `@deepseek-ai/dsh-web`(本包) | Service Definition:服务、提供方注册表、选择策略、请求/结果词汇、`WebError` 分类体系 |
12
12
  | `@deepseek-ai/dsh-web-search-exa` | 搜索提供方:Exa |
13
13
  | `@deepseek-ai/dsh-web-search-perplexity` | 搜索提供方:Perplexity |
14
- | `@deepseek-ai/dsh-web-fetch-local` | 抓取提供方:匿名公共 HTTP(S) |
14
+ | `@deepseek-ai/dsh-web-fetch-http` | 抓取提供方:匿名公共 HTTP(S) |
15
15
  | `@deepseek-ai/dsh-tool-web` | Consumer:面向模型的 `web_search`/`web_fetch` 工具 schema,构建于 `ctx.web` 之上 |
16
16
 
17
17
  搜索与抓取没有共享请求 schema 或业务逻辑,但有意共用一个 seam:`ctx.web` 是单一 web 访问中间层,拥有一项提供方选择策略、一套中止/错误词汇和一个面向产品的「该 harness 如何访问 web」配置接口。成对的 `Search`/`Fetch` 方法保持并行是有意为之。
@@ -28,7 +28,7 @@
28
28
 
29
29
  ## 选择
30
30
 
31
- 选择绝不依赖注册、配置或热模块替换(HMR)顺序。能力要么具有显式提供方 id(配置 `searchProvider`/`fetchProvider`,或由环境变量 `$DSH_WEB_SEARCH_PROVIDER`/`$DSH_WEB_FETCH_PROVIDER` 提供相同字段),要么在恰好只注册一个可用提供方时自动选择。`search()`/`fetch()` 会在执行时解析提供方:
31
+ 选择绝不依赖注册、配置或 HMR(热模块替换)顺序。能力要么具有显式提供方 id(配置 `searchProvider`/`fetchProvider`,或由环境变量 `$DSH_WEB_SEARCH_PROVIDER`/`$DSH_WEB_FETCH_PROVIDER` 提供相同字段),要么在恰好只注册一个可用提供方时自动选择。`search()`/`fetch()` 会在执行时解析提供方:
32
32
 
33
33
  | 情况 | 执行 |
34
34
  |---|---|
package/lib/index.js CHANGED
@@ -38,7 +38,7 @@ var WebError = class extends HarnessError {};
38
38
  * - No id configured, multiple usable providers → `WEB_PROVIDER_AMBIGUOUS`.
39
39
  * - No id configured, no usable provider → `WEB_PROVIDER_UNAVAILABLE`.
40
40
  */
41
- var WebService = class extends Service {
41
+ var WebRuntime = class extends Service {
42
42
  /**
43
43
  * Provider selection config. Operational env overrides feed the SAME fields:
44
44
  * `$DSH_WEB_SEARCH_PROVIDER` / `$DSH_WEB_FETCH_PROVIDER` are equivalent to
@@ -140,4 +140,4 @@ function capSources(result, maxResults) {
140
140
  };
141
141
  }
142
142
  //#endregion
143
- export { WebError, WebService, WebService as default };
143
+ export { WebError, WebRuntime, WebRuntime as default };
@@ -12,7 +12,7 @@ export { WebError, } from './types.ts';
12
12
  export type { WebFetchBody, WebFetchProvider, WebFetchRequest, WebFetchResult, WebSearchProvider, WebSearchRequest, WebSearchResult, WebSearchSource, } from './types.ts';
13
13
  declare module '@deepseek-ai/cordis' {
14
14
  interface Context {
15
- web: WebService;
15
+ web: WebRuntime;
16
16
  }
17
17
  }
18
18
  /**
@@ -21,7 +21,7 @@ declare module '@deepseek-ai/cordis' {
21
21
  * provider auto-selects). Operational overrides such as environment variables
22
22
  * must feed these same fields rather than introduce a hidden priority chain.
23
23
  */
24
- export interface WebServiceConfig {
24
+ export interface WebRuntimeConfig {
25
25
  /** Explicit search provider id. Omitted = auto-select when exactly one usable. */
26
26
  readonly searchProvider?: string;
27
27
  /** Explicit fetch provider id. Omitted = auto-select when exactly one usable. */
@@ -39,18 +39,18 @@ export interface WebServiceConfig {
39
39
  * - No id configured, multiple usable providers → `WEB_PROVIDER_AMBIGUOUS`.
40
40
  * - No id configured, no usable provider → `WEB_PROVIDER_UNAVAILABLE`.
41
41
  */
42
- export declare class WebService extends Service {
42
+ export declare class WebRuntime extends Service {
43
43
  /**
44
44
  * Provider selection config. Operational env overrides feed the SAME fields:
45
45
  * `$DSH_WEB_SEARCH_PROVIDER` / `$DSH_WEB_FETCH_PROVIDER` are equivalent to
46
46
  * `searchProvider` / `fetchProvider` and are NOT a hidden priority chain.
47
47
  */
48
- static Config: z<WebServiceConfig>;
48
+ static Config: z<WebRuntimeConfig>;
49
49
  private searchProviders;
50
50
  private fetchProviders;
51
51
  private readonly searchProviderId;
52
52
  private readonly fetchProviderId;
53
- constructor(ctx: Context, config?: WebServiceConfig);
53
+ constructor(ctx: Context, config?: WebRuntimeConfig);
54
54
  /**
55
55
  * Register a search provider. Throws {@link WebError} `WEB_DUPLICATE_PROVIDER`
56
56
  * if its id is already registered for search. Returns a disposer; disposed
@@ -88,5 +88,5 @@ export declare class WebService extends Service {
88
88
  */
89
89
  fetch(request: WebFetchRequest, signal?: AbortSignal): Promise<WebFetchResult>;
90
90
  }
91
- export default WebService;
91
+ export default WebRuntime;
92
92
  //# sourceMappingURL=index.d.ts.map
@@ -25,7 +25,7 @@ export interface WebSearchRequest {
25
25
  * Normalized search outcome. `content` is optional provider-generated answer
26
26
  * text or summary (Exa and DeepSeek return none; Perplexity returns a
27
27
  * generated answer).
28
- * `sources[]` is the portable citation surface. `truncated` is set by the seam
28
+ * `sources[]` is the portable citation shape. `truncated` is set by the seam
29
29
  * when it cut `sources[]` down to `maxResults`.
30
30
  */
31
31
  export interface WebSearchResult {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-web",
3
3
  "description": "Abstract web access capability seam (ctx.web) for the DeepSeek Harness — search/fetch provider registry, registration-order-independent selection, request/result vocabulary, and the WebError taxonomy",
4
- "version": "0.0.1-rc.1",
4
+ "version": "0.0.1-rc.3",
5
5
  "publishConfig": {
6
6
  "access": "restricted"
7
7
  },
@@ -32,16 +32,16 @@
32
32
  ],
33
33
  "license": "BSD-3-Clause",
34
34
  "peerDependencies": {
35
- "@deepseek-ai/dsh-invariants": "^0.0.1-rc.1",
36
- "@deepseek-ai/dsh-llm": "^0.0.1-rc.1",
37
- "@deepseek-ai/cordis": "^4.0.1-rc.1"
35
+ "@deepseek-ai/dsh-llm": "^0.0.1-rc.3",
36
+ "@deepseek-ai/cordis": "^4.0.1-rc.1",
37
+ "@deepseek-ai/dsh-invariants": "^0.0.1-rc.3"
38
38
  },
39
39
  "dependencies": {
40
40
  "@deepseek-ai/schemastery": "^3.18.1-rc.1"
41
41
  },
42
42
  "devDependencies": {
43
- "@deepseek-ai/dsh-invariants": "^0.0.1-rc.1",
44
- "@deepseek-ai/dsh-llm": "^0.0.1-rc.1",
43
+ "@deepseek-ai/dsh-invariants": "^0.0.1-rc.3",
44
+ "@deepseek-ai/dsh-llm": "^0.0.1-rc.3",
45
45
  "@deepseek-ai/cordis": "^4.0.1-rc.1"
46
46
  }
47
47
  }