@deepseek-ai/dsh-web 0.2.1-rc.3 → 0.2.2-alpha.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 +15 -12
- package/README.md +16 -4
- package/README.zh.md +16 -4
- package/lib/index.js +49 -3
- package/lib/types/index.d.ts +22 -0
- package/lib/types/types.d.ts +21 -2
- package/locale/de.json +6 -0
- package/locale/es.json +6 -0
- package/locale/fr.json +6 -0
- package/locale/ja.json +6 -0
- package/locale/pt.json +6 -0
- package/locale/ru.json +6 -0
- package/package.json +6 -6
package/README.i18n.yaml
CHANGED
|
@@ -27,8 +27,11 @@
|
|
|
27
27
|
en: 713944abf68263cd
|
|
28
28
|
zh: c428cb53b8708e99
|
|
29
29
|
/deepseek-ai-dsh-web/use-this-package/provider-selection:
|
|
30
|
-
en:
|
|
31
|
-
zh:
|
|
30
|
+
en: ae79ba193456b380
|
|
31
|
+
zh: dfc1003554d88aa3
|
|
32
|
+
/deepseek-ai-dsh-web/use-this-package/search-and-fetch-readiness:
|
|
33
|
+
en: 30fec45dfb417eed
|
|
34
|
+
zh: 253f887aeb3deeea
|
|
32
35
|
/deepseek-ai-dsh-web/use-this-package/failures-and-recovery:
|
|
33
36
|
en: d8d09ed3839f6474
|
|
34
37
|
zh: 7164d902f333592a
|
|
@@ -39,26 +42,26 @@
|
|
|
39
42
|
en: c4d5437cfb1e2157
|
|
40
43
|
zh: 411b1b398de73426
|
|
41
44
|
/deepseek-ai-dsh-web/understand-the-implementation/source-map:
|
|
42
|
-
en:
|
|
43
|
-
zh:
|
|
45
|
+
en: 1b59d389c50ddf21
|
|
46
|
+
zh: 1f571b07350e3dbe
|
|
44
47
|
/deepseek-ai-dsh-web/understand-the-implementation/data-model:
|
|
45
48
|
en: 300340ff8465a03e
|
|
46
49
|
zh: 34ab66eb6969dc94
|
|
47
50
|
/deepseek-ai-dsh-web/understand-the-implementation/selection-flow:
|
|
48
|
-
en:
|
|
49
|
-
zh:
|
|
51
|
+
en: d5cd4851d81892e6
|
|
52
|
+
zh: 18266b0bc8b1d1ae
|
|
50
53
|
/deepseek-ai-dsh-web/further-exploration:
|
|
51
|
-
en:
|
|
52
|
-
zh:
|
|
54
|
+
en: 65bba2a79c267230
|
|
55
|
+
zh: a0782630bd093bf1
|
|
53
56
|
/deepseek-ai-dsh-web/model-experience:
|
|
54
|
-
en:
|
|
55
|
-
zh:
|
|
57
|
+
en: cbc7053cba173085
|
|
58
|
+
zh: 73828c1f1ec82d50
|
|
56
59
|
/deepseek-ai-dsh-web/model-experience/kv-cache-effect:
|
|
57
60
|
en: 40294c1c31b74824
|
|
58
61
|
zh: d75d48f485447a74
|
|
59
62
|
/deepseek-ai-dsh-web/known-limitations-and-deferred-work:
|
|
60
|
-
en:
|
|
61
|
-
zh:
|
|
63
|
+
en: 5d6031e60a6242af
|
|
64
|
+
zh: 1869764b4e486895
|
|
62
65
|
/deepseek-ai-dsh-web/known-limitations-and-deferred-work/dev-note:
|
|
63
66
|
en: 7f775cc79dbce94b
|
|
64
67
|
zh: 12b8f68f9e7c48ca
|
package/README.md
CHANGED
|
@@ -77,6 +77,17 @@ Each call resolves its provider at execution time, and registration or load orde
|
|
|
77
77
|
|
|
78
78
|
A provider's availability is a cheap local check — for example whether its API key is present — and never makes network calls, so selection stays fast and deterministic.
|
|
79
79
|
|
|
80
|
+
<a id="search-readiness"></a>
|
|
81
|
+
### Search and fetch readiness
|
|
82
|
+
|
|
83
|
+
`searchReady(llmProvider?)` and `fetchReady(llmProvider?)` ask the provider that `search()` or `fetch()` would select whether an operation made for a model request on that chat route has a credential to send; [`dsh-tool-web`](../tool-web/README.md#search-readiness) uses the answers to decide whether each model step admits `web_search` and `web_fetch`. A provider answers through its optional `ready(llmProvider)`, a configuration-only check that must not make network calls; a provider without it counts as ready. When selection fails, the readiness method answers true, because the operation reports that failure as a structured `WebError`. Readiness never changes which provider is selected.
|
|
84
|
+
|
|
85
|
+
```text
|
|
86
|
+
// false only when the selected provider cannot authenticate this route's operations:
|
|
87
|
+
const searchOffered = await ctx.web.searchReady('deepseek-official')
|
|
88
|
+
const fetchOffered = await ctx.web.fetchReady('deepseek-official')
|
|
89
|
+
```
|
|
90
|
+
|
|
80
91
|
### Failures and recovery
|
|
81
92
|
|
|
82
93
|
Failures throw `WebError` with a stable, machine-routable code; the message adds detail such as the missing provider id or the ambiguous candidate set. Callers route on the code and decide how to degrade. To change which backend a call uses, reconfigure the pinned id, mount or unmount providers, or fix the provider's configuration so its availability check passes.
|
|
@@ -103,7 +114,7 @@ The package is built on one deliberate separation:
|
|
|
103
114
|
|
|
104
115
|
| File | Role |
|
|
105
116
|
|---|---|
|
|
106
|
-
| [`src/index.ts`](src/index.ts) | Plugin entry: the `WebRuntime` service, both provider registries,
|
|
117
|
+
| [`src/index.ts`](src/index.ts) | Plugin entry: the `WebRuntime` service, both provider registries, execution-time selection, and per-route readiness |
|
|
107
118
|
| [`src/types.ts`](src/types.ts) | Vocabulary: request/result types, the closed `WebFetchBody` union, and the `WebError` taxonomy |
|
|
108
119
|
|
|
109
120
|
### Data model
|
|
@@ -112,7 +123,7 @@ The request and result types define the normalized vocabulary callers build on
|
|
|
112
123
|
|
|
113
124
|
### Selection flow
|
|
114
125
|
|
|
115
|
-
At call time the service resolves the provider — configured id first, then the unique usable provider — and throws the matching `WebError` when no clear winner exists. A search result then passes through `capSources`, which truncates `sources[]` to `maxResults` and flags `truncated`. Registration is effect-based: providers register with the calling fiber and unregister when it disposes, and a duplicate id within a capability kind is rejected at registration.
|
|
126
|
+
At call time the service resolves the provider — configured id first, then the unique usable provider — and throws the matching `WebError` when no clear winner exists. A search result then passes through `capSources`, which truncates `sources[]` to `maxResults` and flags `truncated`. `searchReady()` and `fetchReady()` resolve the same provider as the matching operation, answer true when resolution throws, and otherwise return the provider's `ready()` answer, or true when it has none. Registration is effect-based: providers register with the calling fiber and unregister when it disposes, and a duplicate id within a capability kind is rejected at registration.
|
|
116
127
|
|
|
117
128
|
</details>
|
|
118
129
|
|
|
@@ -129,13 +140,14 @@ Read these pages when the package-level contract is not enough. They move from t
|
|
|
129
140
|
- [dsh-web-fetch-http](../web-fetch-http/README.md) — the shipped anonymous HTTP(S) fetch backend.
|
|
130
141
|
- [Generated configuration catalog](../../../docs/config-catalog.md#deepseek-aidsh-web) — every accepted config field and its source declaration.
|
|
131
142
|
- [Web capability seam decision](../../../.agents/notes/implemented/architecture/2026-06-24-web-capability-seam.md) — why search and fetch share one provider-selection service.
|
|
143
|
+
- [Search readiness decision](../../../.agents/notes/implemented/architecture/2026-09-27-web-search-offered-by-provider-readiness.md) — why the seam answers per-route search and fetch readiness for `dsh-tool-web`.
|
|
132
144
|
|
|
133
145
|
-----
|
|
134
146
|
|
|
135
147
|
<a id="model-experience"></a>
|
|
136
148
|
## Model Experience
|
|
137
149
|
|
|
138
|
-
Indirectly, through `dsh-tool-web`, which renders the seam's normalized search results and fetch bodies to the model while this service contributes no prompt or schema.
|
|
150
|
+
Indirectly, through `dsh-tool-web`, which renders the seam's normalized search results and fetch bodies to the model and does not admit `web_search` or `web_fetch` to model steps for which `searchReady()` or `fetchReady()` answers false, while this service contributes no prompt or schema.
|
|
139
151
|
|
|
140
152
|
#### KV Cache effect
|
|
141
153
|
|
|
@@ -148,7 +160,7 @@ No direct invalidation; the named consumer owns any request-prefix changes.
|
|
|
148
160
|
|
|
149
161
|
These limits define when the service is incomplete on its own. They are current package constraints.
|
|
150
162
|
|
|
151
|
-
- **No observation surface** — there is no provider-change event and no capability-status query;
|
|
163
|
+
- **No observation surface** — there is no provider-change event and no capability-status query; `searchReady()` and `fetchReady()` report only the selected provider's credential readiness and answer true when selection fails. Availability is observable only by running a search or fetch and routing the thrown code, and the no-provider failure is the generic `WEB_PROVIDER_UNAVAILABLE` with no per-provider reason enumeration ([Agent Note](../../../.agents/notes/archived/simplification/2026-07-04-drop-unconsumed-web-observation-surface.md)).
|
|
152
164
|
- **Search requests carry only `query` and `maxResults`** — provider-neutral controls (recency, domain filters, regional hints, search depth) are deferred until the backends can honor them ([seam Agent Note](../../../.agents/notes/implemented/architecture/2026-06-24-web-capability-seam.md)).
|
|
153
165
|
- **`WebFetchBody` has no `pdf` arm** — text-extractable PDF support is named deferred work; the closed union makes adding it a compile-enforced change across the web packages.
|
|
154
166
|
- **Provider-backed page extraction is out of scope of `fetch()`** — a Firecrawl/Tavily-style `web_extract` capability is deferred rather than widening the fetch operation.
|
package/README.zh.md
CHANGED
|
@@ -77,6 +77,17 @@ const page = await ctx.web.fetch({ url: 'https://example.com' })
|
|
|
77
77
|
|
|
78
78
|
提供方的可用性是一项廉价的局部检查——例如其 API 密钥是否存在——并且从不发起网络调用,因此选择保持快速且确定。
|
|
79
79
|
|
|
80
|
+
<a id="search-readiness"></a>
|
|
81
|
+
### 搜索与抓取就绪
|
|
82
|
+
|
|
83
|
+
`searchReady(llmProvider?)` 与 `fetchReady(llmProvider?)` 询问 `search()` 或 `fetch()` 会选中的提供方:为该对话路由上的模型请求发起的操作是否有可发送的凭据;[`dsh-tool-web`](../tool-web/README.zh.md#search-readiness) 据此决定每个模型步骤是否准入 `web_search` 与 `web_fetch`。提供方通过可选的 `ready(llmProvider)` 回答,它是只检查配置的判断,禁止发起网络调用;未实现它的提供方视为就绪。选择失败时就绪方法回答 true,因为对应操作会把该失败报告为结构化 `WebError`。就绪判断从不改变选中哪个提供方。
|
|
84
|
+
|
|
85
|
+
```text
|
|
86
|
+
// false only when the selected provider cannot authenticate this route's operations:
|
|
87
|
+
const searchOffered = await ctx.web.searchReady('deepseek-official')
|
|
88
|
+
const fetchOffered = await ctx.web.fetchReady('deepseek-official')
|
|
89
|
+
```
|
|
90
|
+
|
|
80
91
|
### 失败与恢复
|
|
81
92
|
|
|
82
93
|
失败抛出 `WebError`,携带稳定、可按机器路由的 code;消息补充细节,例如缺失的提供方 id 或歧义候选集合。调用方按 code 路由并决定如何降级。要改变一次调用使用的后端,请重新配置固定的 id、挂载或卸载提供方,或修正提供方配置使其可用性检查通过。
|
|
@@ -103,7 +114,7 @@ const page = await ctx.web.fetch({ url: 'https://example.com' })
|
|
|
103
114
|
|
|
104
115
|
| 文件 | 职责 |
|
|
105
116
|
|---|---|
|
|
106
|
-
| [`src/index.ts`](src/index.ts) | 插件入口:`WebRuntime`
|
|
117
|
+
| [`src/index.ts`](src/index.ts) | 插件入口:`WebRuntime` 服务、两个提供方注册表、执行时选择与按路由的就绪判断 |
|
|
107
118
|
| [`src/types.ts`](src/types.ts) | 词汇:请求/结果类型、封闭的 `WebFetchBody` 联合与 `WebError` 分类体系 |
|
|
108
119
|
|
|
109
120
|
### 数据模型
|
|
@@ -112,7 +123,7 @@ const page = await ctx.web.fetch({ url: 'https://example.com' })
|
|
|
112
123
|
|
|
113
124
|
### 选择流程
|
|
114
125
|
|
|
115
|
-
执行时,服务先按配置 id、再按唯一可用提供方解析提供方,没有明确赢家时抛出对应的 `WebError`。搜索结果随后经过 `capSources`:把 `sources[]` 截断到 `maxResults` 并标记 `truncated
|
|
126
|
+
执行时,服务先按配置 id、再按唯一可用提供方解析提供方,没有明确赢家时抛出对应的 `WebError`。搜索结果随后经过 `capSources`:把 `sources[]` 截断到 `maxResults` 并标记 `truncated`。`searchReady()` 与 `fetchReady()` 解析与对应操作相同的提供方,解析抛错时回答 true,否则返回该提供方 `ready()` 的回答,提供方没有 `ready()` 时回答 true。注册基于 effect:提供方随调用 fiber 注册,fiber 释放时注销;同一能力类型下重复的 id 会在注册时被拒绝。
|
|
116
127
|
|
|
117
128
|
</details>
|
|
118
129
|
|
|
@@ -129,13 +140,14 @@ const page = await ctx.web.fetch({ url: 'https://example.com' })
|
|
|
129
140
|
- [dsh-web-fetch-http](../web-fetch-http/README.zh.md)——已交付的匿名 HTTP(S) 抓取后端。
|
|
130
141
|
- [生成配置目录](../../../docs/config-catalog.zh.md#deepseek-aidsh-web)——每个受支持配置字段及其源声明。
|
|
131
142
|
- [web 能力 seam 决策](../../../.agents/notes/implemented/architecture/2026-06-24-web-capability-seam.zh.md)——搜索与抓取为何共用一项提供方选择服务。
|
|
143
|
+
- [搜索就绪决策](../../../.agents/notes/implemented/architecture/2026-09-27-web-search-offered-by-provider-readiness.zh.md)——seam 为何为 `dsh-tool-web` 按路由回答搜索与抓取就绪。
|
|
132
144
|
|
|
133
145
|
-----
|
|
134
146
|
|
|
135
147
|
<a id="model-experience"></a>
|
|
136
148
|
## 模型体验
|
|
137
149
|
|
|
138
|
-
间接地,通过 `dsh-tool-web`:该工具把 seam
|
|
150
|
+
间接地,通过 `dsh-tool-web`:该工具把 seam 规范化的搜索结果与抓取正文渲染给模型,并且不让 `searchReady()` 或 `fetchReady()` 回答 false 的模型步骤准入 `web_search` 或 `web_fetch`,而本服务不贡献任何提示词或 schema。
|
|
139
151
|
|
|
140
152
|
#### KV Cache 影响
|
|
141
153
|
|
|
@@ -148,7 +160,7 @@ const page = await ctx.web.fetch({ url: 'https://example.com' })
|
|
|
148
160
|
|
|
149
161
|
这些限制说明本服务单独使用时在哪些方面不完整。它们是当前包约束。
|
|
150
162
|
|
|
151
|
-
-
|
|
163
|
+
- **没有观测接口**:没有提供方变更事件或能力状态查询;`searchReady()` 与 `fetchReady()` 只报告选中提供方的凭据就绪状态,选择失败时回答 true。可用性只能通过执行搜索或抓取并按抛出的 code 路由来观测,无提供方失败是通用的 `WEB_PROVIDER_UNAVAILABLE`,不枚举逐提供方原因(见 [Agent Note](../../../.agents/notes/archived/simplification/2026-07-04-drop-unconsumed-web-observation-surface.md))。
|
|
152
164
|
- **搜索请求只携带 `query` 与 `maxResults`**:提供方无关的控制项(新近程度、域名过滤条件、区域提示、搜索深度)暂缓至后端都能诚实支持时(见 [seam Agent Note](../../../.agents/notes/implemented/architecture/2026-06-24-web-capability-seam.zh.md))。
|
|
153
165
|
- **`WebFetchBody` 没有 `pdf` 分支**:可提取文本的 PDF 支持属于明确的延期工作;封闭联合会使新增该分支成为跨 web 包、由编译强制执行的变更。
|
|
154
166
|
- **提供方支持的页面提取不属于 `fetch()` 范围**:Firecrawl/Tavily 风格的 `web_extract` 能力延期,而不会扩展抓取操作。
|
package/lib/index.js
CHANGED
|
@@ -97,11 +97,26 @@ var WebRuntime = class extends Service {
|
|
|
97
97
|
* @returns the provider's results, capped to `request.maxResults`.
|
|
98
98
|
*/
|
|
99
99
|
async search(request, signal) {
|
|
100
|
+
return capSources(await this.selectSearchProvider().search(request, signal), request.maxResults);
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Whether the provider `search()` would select can authenticate a search made for a
|
|
104
|
+
* model request on the `llmProvider` chat route. Asks only that provider's `ready()`;
|
|
105
|
+
* one without `ready()` counts as ready. Makes no network calls. A selection failure
|
|
106
|
+
* answers true, because `search()` reports that failure as a structured `WebError`.
|
|
107
|
+
* @param llmProvider - the provider route id of the model request, when known.
|
|
108
|
+
* @returns false only when the selected provider reports that it cannot authenticate.
|
|
109
|
+
*/
|
|
110
|
+
async searchReady(llmProvider) {
|
|
111
|
+
return await selectedProviderReady(() => this.selectSearchProvider(), llmProvider);
|
|
112
|
+
}
|
|
113
|
+
/** Select the search provider with the rules above, throwing the matching {@link WebError}. */
|
|
114
|
+
selectSearchProvider() {
|
|
100
115
|
const configuredId = this.config.searchProvider.get() ?? this.searchProviderEnv;
|
|
101
|
-
return
|
|
116
|
+
return resolveProvider({
|
|
102
117
|
providers: this.searchProviders,
|
|
103
118
|
...configuredId !== void 0 ? { configuredId } : {}
|
|
104
|
-
})
|
|
119
|
+
});
|
|
105
120
|
}
|
|
106
121
|
/**
|
|
107
122
|
* Retrieve one URL through the selected provider. Resolves the provider at
|
|
@@ -112,13 +127,44 @@ var WebRuntime = class extends Service {
|
|
|
112
127
|
* @returns the retrieval outcome; non-2xx responses resolve descriptively.
|
|
113
128
|
*/
|
|
114
129
|
async fetch(request, signal) {
|
|
130
|
+
return await this.selectFetchProvider().fetch(request, signal);
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Whether the provider `fetch()` would select can authenticate a fetch made for a
|
|
134
|
+
* model request on the `llmProvider` chat route. Asks only that provider's `ready()`;
|
|
135
|
+
* one without `ready()` counts as ready. Makes no network calls. A selection failure
|
|
136
|
+
* answers true, because `fetch()` reports that failure as a structured `WebError`.
|
|
137
|
+
* @param llmProvider - the provider route id of the model request, when known.
|
|
138
|
+
* @returns false only when the selected provider reports that it cannot authenticate.
|
|
139
|
+
*/
|
|
140
|
+
async fetchReady(llmProvider) {
|
|
141
|
+
return await selectedProviderReady(() => this.selectFetchProvider(), llmProvider);
|
|
142
|
+
}
|
|
143
|
+
/** Select the fetch provider with the rules above, throwing the matching {@link WebError}. */
|
|
144
|
+
selectFetchProvider() {
|
|
115
145
|
const configuredId = this.config.fetchProvider.get() ?? this.fetchProviderEnv;
|
|
116
146
|
return resolveProvider({
|
|
117
147
|
providers: this.fetchProviders,
|
|
118
148
|
...configuredId !== void 0 ? { configuredId } : {}
|
|
119
|
-
})
|
|
149
|
+
});
|
|
120
150
|
}
|
|
121
151
|
};
|
|
152
|
+
/**
|
|
153
|
+
* Ask the provider an operation selects whether it can authenticate for one chat route.
|
|
154
|
+
* @param select - the operation's selection; throws its {@link WebError} when no provider qualifies.
|
|
155
|
+
* @param llmProvider - the provider route id of the model request, when known.
|
|
156
|
+
* @returns the provider's answer; true when it has no `ready()` or selection fails, because the
|
|
157
|
+
* operation reports that failure itself.
|
|
158
|
+
*/
|
|
159
|
+
async function selectedProviderReady(select, llmProvider) {
|
|
160
|
+
let provider;
|
|
161
|
+
try {
|
|
162
|
+
provider = select();
|
|
163
|
+
} catch (_selectionFailure) {
|
|
164
|
+
return true;
|
|
165
|
+
}
|
|
166
|
+
return await provider.ready?.(llmProvider) ?? true;
|
|
167
|
+
}
|
|
122
168
|
/** Resolve the selected provider or throw the matching {@link WebError}. */
|
|
123
169
|
function resolveProvider(selection) {
|
|
124
170
|
const { configuredId, providers } = selection;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -87,6 +87,17 @@ export declare class WebRuntime extends Service {
|
|
|
87
87
|
* @returns the provider's results, capped to `request.maxResults`.
|
|
88
88
|
*/
|
|
89
89
|
search(request: WebSearchRequest, signal?: AbortSignal): Promise<WebSearchResult>;
|
|
90
|
+
/**
|
|
91
|
+
* Whether the provider `search()` would select can authenticate a search made for a
|
|
92
|
+
* model request on the `llmProvider` chat route. Asks only that provider's `ready()`;
|
|
93
|
+
* one without `ready()` counts as ready. Makes no network calls. A selection failure
|
|
94
|
+
* answers true, because `search()` reports that failure as a structured `WebError`.
|
|
95
|
+
* @param llmProvider - the provider route id of the model request, when known.
|
|
96
|
+
* @returns false only when the selected provider reports that it cannot authenticate.
|
|
97
|
+
*/
|
|
98
|
+
searchReady(llmProvider?: string): Promise<boolean>;
|
|
99
|
+
/** Select the search provider with the rules above, throwing the matching {@link WebError}. */
|
|
100
|
+
private selectSearchProvider;
|
|
90
101
|
/**
|
|
91
102
|
* Retrieve one URL through the selected provider. Resolves the provider at
|
|
92
103
|
* call time with the selection rules above; throws {@link WebError} when the
|
|
@@ -96,6 +107,17 @@ export declare class WebRuntime extends Service {
|
|
|
96
107
|
* @returns the retrieval outcome; non-2xx responses resolve descriptively.
|
|
97
108
|
*/
|
|
98
109
|
fetch(request: WebFetchRequest, signal?: AbortSignal): Promise<WebFetchResult>;
|
|
110
|
+
/**
|
|
111
|
+
* Whether the provider `fetch()` would select can authenticate a fetch made for a
|
|
112
|
+
* model request on the `llmProvider` chat route. Asks only that provider's `ready()`;
|
|
113
|
+
* one without `ready()` counts as ready. Makes no network calls. A selection failure
|
|
114
|
+
* answers true, because `fetch()` reports that failure as a structured `WebError`.
|
|
115
|
+
* @param llmProvider - the provider route id of the model request, when known.
|
|
116
|
+
* @returns false only when the selected provider reports that it cannot authenticate.
|
|
117
|
+
*/
|
|
118
|
+
fetchReady(llmProvider?: string): Promise<boolean>;
|
|
119
|
+
/** Select the fetch provider with the rules above, throwing the matching {@link WebError}. */
|
|
120
|
+
private selectFetchProvider;
|
|
99
121
|
}
|
|
100
122
|
export default WebRuntime;
|
|
101
123
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/types/types.d.ts
CHANGED
|
@@ -38,15 +38,18 @@ export interface WebSearchResult {
|
|
|
38
38
|
readonly truncated: boolean;
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
|
-
* One citeable source. A source always has a URL; `title`, `snippet`,
|
|
42
|
-
* `publishedAt` are optional because not every provider returns them — forcing
|
|
41
|
+
* One citeable source. A source always has a URL; `title`, `snippet`, `summary`,
|
|
42
|
+
* and `publishedAt` are optional because not every provider returns them — forcing
|
|
43
43
|
* adapters to invent them would make the seam lie (Perplexity citations may be
|
|
44
44
|
* URL-only). `dsh-tool-web` renders `title ?? hostname(url)` for display.
|
|
45
45
|
*/
|
|
46
46
|
export interface WebSearchSource {
|
|
47
47
|
readonly url: string;
|
|
48
48
|
readonly title?: string;
|
|
49
|
+
/** Short excerpt suited to display. */
|
|
49
50
|
readonly snippet?: string;
|
|
51
|
+
/** Longer excerpt suited to model reading; consumers bound its length. */
|
|
52
|
+
readonly summary?: string;
|
|
50
53
|
/** Publication/crawl timestamp as a provider-supplied ISO-8601 string. */
|
|
51
54
|
readonly publishedAt?: string;
|
|
52
55
|
}
|
|
@@ -99,6 +102,14 @@ export interface WebSearchProvider {
|
|
|
99
102
|
readonly id: string;
|
|
100
103
|
/** Cheap local usability check; must not make network calls. */
|
|
101
104
|
available(): boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Whether a search made for a model request on the `llmProvider` chat route has a
|
|
107
|
+
* credential to send. Checks configuration only and must not make network calls.
|
|
108
|
+
* Omitted = ready.
|
|
109
|
+
* @param llmProvider - the provider route id of the model request, when known.
|
|
110
|
+
* @returns false when that request's searches could not authenticate.
|
|
111
|
+
*/
|
|
112
|
+
ready?(llmProvider: string | undefined): Promise<boolean>;
|
|
102
113
|
/** Run one search; honor `signal` for cancellation. */
|
|
103
114
|
search(request: WebSearchRequest, signal?: AbortSignal): Promise<WebSearchResult>;
|
|
104
115
|
}
|
|
@@ -110,6 +121,14 @@ export interface WebFetchProvider {
|
|
|
110
121
|
readonly id: string;
|
|
111
122
|
/** Cheap local usability check; must not make network calls. */
|
|
112
123
|
available(): boolean;
|
|
124
|
+
/**
|
|
125
|
+
* Whether a fetch made for a model request on the `llmProvider` chat route has a
|
|
126
|
+
* credential to send. Checks configuration only and must not make network calls.
|
|
127
|
+
* Omitted = ready.
|
|
128
|
+
* @param llmProvider - the provider route id of the model request, when known.
|
|
129
|
+
* @returns false when that request's fetches could not authenticate.
|
|
130
|
+
*/
|
|
131
|
+
ready?(llmProvider: string | undefined): Promise<boolean>;
|
|
113
132
|
/** Retrieve one URL; honor `signal` for cancellation. */
|
|
114
133
|
fetch(request: WebFetchRequest, signal?: AbortSignal): Promise<WebFetchResult>;
|
|
115
134
|
}
|
package/locale/de.json
ADDED
package/locale/es.json
ADDED
package/locale/fr.json
ADDED
package/locale/ja.json
ADDED
package/locale/pt.json
ADDED
package/locale/ru.json
ADDED
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.2.
|
|
4
|
+
"version": "0.2.2-alpha.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -29,14 +29,14 @@
|
|
|
29
29
|
],
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@deepseek-ai/dsh-llm": "0.2.
|
|
33
|
-
"@deepseek-ai/cordis": "~4.0.
|
|
32
|
+
"@deepseek-ai/dsh-llm": "0.2.2-alpha.2",
|
|
33
|
+
"@deepseek-ai/cordis": "~4.0.6-alpha.1"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@deepseek-ai/schemastery": "~3.18.
|
|
36
|
+
"@deepseek-ai/schemastery": "~3.18.6-alpha.1"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@deepseek-ai/dsh-llm": "0.2.
|
|
40
|
-
"@deepseek-ai/cordis": "~4.0.
|
|
39
|
+
"@deepseek-ai/dsh-llm": "0.2.2-alpha.2",
|
|
40
|
+
"@deepseek-ai/cordis": "~4.0.6-alpha.1"
|
|
41
41
|
}
|
|
42
42
|
}
|