@deepseek-ai/dsh-llm-pi-ai 0.1.6-alpha.2 → 0.1.7-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 +2 -2
- package/README.md +12 -9
- package/README.zh.md +11 -8
- package/lib/index.js +84 -184
- package/lib/types/catalog.d.ts +1 -1
- package/lib/types/config.d.ts +134 -3
- package/lib/types/discovery.d.ts +1 -1
- package/lib/types/index.d.ts +1 -57
- package/lib/types/replay.d.ts +3 -3
- package/package.json +30 -24
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-pi-ai/README.md
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: 7b1708b957202369382d8a93b2bbcefd31565f67
|
|
6
|
+
README.zh.md: ed780ad235b1d8df2b821be6a0595ecd8b8e951b
|
package/README.md
CHANGED
|
@@ -27,6 +27,8 @@ English | [中文](README.zh.md)
|
|
|
27
27
|
|
|
28
28
|
Mount this plugin when a composition routes model requests through pi-ai's provider catalogs or through gateways that pi-ai's installed catalog does not describe. The `providers` dictionary is the whole configuration surface: each key is the provider route name a request selects with `GenerateOptions.provider`.
|
|
29
29
|
|
|
30
|
+
The adapter accepts the LLM service's [request-only user inputs](../llm/README.md#use-this-package) alongside durable history. User identity and attribution do not enter pi-ai content; assistant replay metadata and tool-call correlation remain attached to durable messages.
|
|
31
|
+
|
|
30
32
|
### When to choose it
|
|
31
33
|
|
|
32
34
|
Choose this adapter when the same composition serves several providers, when a route needs pi-ai's catalog defaults with a few fields corrected, or when a hand-declared gateway must be reached through its own endpoint and protocol. Choose `dsh-llm-deepseek` for the direct DeepSeek route when the deployment needs no other provider. Both adapters can be mounted together because their route names do not collide; registering a route another adapter already owns fails plugin loading.
|
|
@@ -104,17 +106,17 @@ For self-hosted Chat Completions endpoints, `thinkingTokenBudgetField` selects t
|
|
|
104
106
|
|
|
105
107
|
### Change configuration at runtime
|
|
106
108
|
|
|
107
|
-
|
|
109
|
+
Each operation captures the current `providers` Config reference. New or changed provider profiles are validated before form persistence; unchanged catalog failures remain editable. Route-set or retry-policy changes update registration atomically, preserving previous routes if another adapter owns a requested route.
|
|
108
110
|
|
|
109
111
|
### Discover models from endpoints
|
|
110
112
|
|
|
111
|
-
The plugin answers "which models can this provider serve?" for a route a configuration surface is editing or drafting. A route the installed catalog ships is answered from that catalog with no network call, preserving its `input` array as discovery `inputModalities`; only a route the catalog does not describe is interrogated over the wire. `openai-completions` and `openai-responses` use `GET {baseURL}/models` with bearer auth, while `anthropic-messages` uses native `GET /v1/models?limit=1000` semantics with `x-api-key` and `anthropic-version`; its listing URL accepts the API root with or without a trailing `/v1` because gateway documentation publishes both spellings, and only that listing URL normalizes the segment, so model requests receive the configured `baseURL` unchanged. A named configured route supplies its stored credential and profile `headers` inside the Host, so deployment headers configured through `
|
|
113
|
+
The plugin answers "which models can this provider serve?" for a route a configuration surface is editing or drafting. A route the installed catalog ships is answered from that catalog with no network call, preserving its `input` array as discovery `inputModalities`; only a route the catalog does not describe is interrogated over the wire. `openai-completions` and `openai-responses` use `GET {baseURL}/models` with bearer auth, while `anthropic-messages` uses native `GET /v1/models?limit=1000` semantics with `x-api-key` and `anthropic-version`; its listing URL accepts the API root with or without a trailing `/v1` because gateway documentation publishes both spellings, and only that listing URL normalizes the segment, so model requests receive the configured `baseURL` unchanged. A named configured route supplies its stored credential and profile `headers` inside the Host, so deployment headers configured through `cordis.patch.yml` or Cordis config reach model discovery without becoming discovery-request or Models-page fields; a key typed into the form still wins over the stored credential. The parser accepts either the standard `data` array or an enriched `models` map, normalizing each candidate's id, display name, context window, and output-token cap; Anthropic's `max_input_tokens` and `max_tokens` feed the same capacity fields, a map key remains the request id even when its entry names a different canonical id, primitive-valued map properties are ignored, and a missing display name falls back to that request id. The reply is candidate metadata a surface may offer for adoption — nothing is stored, and `cordis.patch.yml` remains the only thing that decides what a route serves.
|
|
112
114
|
|
|
113
115
|
### Failures and recovery
|
|
114
116
|
|
|
115
117
|
A route pi-ai does not ship needs `api`, `baseURL`, and a non-empty `models` list; an unserviceable profile is refused where it is written, naming the route and model. Failures carry stable codes: a credential that cannot be used fails with `INVALID_CREDENTIAL` naming the route and reference, a route whose `apiKeyEnv` reference resolves to nothing fails with `MISSING_CREDENTIAL`, an unconfigured model fails with `UNKNOWN_MODEL`, and terminal provider failures distinguish `QUOTA` from transient `RATE_LIMIT`. `GenerateOptions.stop` is rejected with `UNSUPPORTED_OPTION` because pi-ai's common streaming UI cannot guarantee it across providers.
|
|
116
118
|
|
|
117
|
-
|
|
119
|
+
Config updates strictly validate changed providers. Initial loading retains stored catalog failures as editable provider diagnostics; unchanged failed providers do not block edits elsewhere. Serviceable models remain selectable, and unresolved models fail before network I/O. Repairing or deleting the offending configuration clears its diagnostic.
|
|
118
120
|
|
|
119
121
|
Changing `displayName`, `apiKeyEnv`, or `baseURL` without resolving the provider's model errors still rejects the save. For example, renaming an OpenRouter route whose model `111` needs an `api` cannot be saved on its own: repair or remove that model in the same editor draft, then save the complete provider configuration. Intermediate repairs remain in the draft until the whole provider validates; other providers can be saved independently.
|
|
120
122
|
|
|
@@ -136,7 +138,7 @@ The adapter is built on immutable snapshots and per-operation resolution. Each o
|
|
|
136
138
|
|
|
137
139
|
| File | Role |
|
|
138
140
|
|---|---|
|
|
139
|
-
| [`src/index.ts`](src/index.ts) |
|
|
141
|
+
| [`src/index.ts`](src/index.ts) | Config snapshots, directory and route registration |
|
|
140
142
|
| [`src/auth.ts`](src/auth.ts) | The credential store and ambient auth context over the harness credential plane |
|
|
141
143
|
| [`src/login.ts`](src/login.ts) | Authorization flows for the installed providers that ship a login |
|
|
142
144
|
| [`src/config.ts`](src/config.ts) | Profile schema, resolution, and serviceability checks |
|
|
@@ -150,11 +152,11 @@ The adapter is built on immutable snapshots and per-operation resolution. Each o
|
|
|
150
152
|
|
|
151
153
|
### Registration and directory
|
|
152
154
|
|
|
153
|
-
The plugin declares every installed catalog provider it can authenticate in the configurable-provider directory, joined with every route the current profiles declare, so configuration surfaces can offer the full catalog before any route exists. Each entry carries `declared` — whether pi-ai ships nothing under that key — because only the adapter can distinguish a hand-declared route from a narrowed catalog route. Route registration is atomic: a candidate set that collides with another adapter leaves the previous routes serving. A bare mount with zero routes is the dormant posture: nothing registers until
|
|
155
|
+
The plugin declares every installed catalog provider it can authenticate in the configurable-provider directory, joined with every route the current profiles declare, so configuration surfaces can offer the full catalog before any route exists. Each entry carries `declared` — whether pi-ai ships nothing under that key — because only the adapter can distinguish a hand-declared route from a narrowed catalog route. Route registration is atomic: a candidate set that collides with another adapter leaves the previous routes serving. A bare mount with zero routes is the dormant posture: nothing registers until the Config supplies profiles, and routes drop when it empties.
|
|
154
156
|
|
|
155
157
|
### Replay and vocabulary
|
|
156
158
|
|
|
157
|
-
Successful assistant responses store a versioned, lossless-JSON replay state beside the provider and model that produced them — response-level facts plus one per-block entry per streamed block. At request time, `LlmRuntime` passes replay state only when the same adapter instance owns both routes; the adapter validates it and restores native response ids, provider signatures, and optional `providerThinkingLevel` effort metadata, keeping absent effort metadata absent. Replay validates the requested model identity against the assistant source and separately restores an Anthropic response model when the provider resolved an alias or fallback.
|
|
159
|
+
Successful assistant responses store a versioned, lossless-JSON replay state beside the provider and model that produced them — response-level facts plus one per-block entry per streamed block. At request time, `LlmRuntime` passes replay state only when the same adapter instance owns both routes; the adapter validates it and restores native response ids, provider signatures, and optional `providerThinkingLevel` effort metadata, keeping absent effort metadata absent. Replay validates the requested model identity against the assistant source and separately restores an Anthropic response model when the provider resolved an alias or fallback. Absent or unusable replay state degrades to provider-neutral content while preserving the assistant source’s required provider and model. pi-ai tool-call arguments are parsed objects, so the adapter parses input and re-stringifies output to the harness raw-JSON convention; pi-ai in-stream error events map to terminal `finish` chunks.
|
|
158
160
|
|
|
159
161
|
</details>
|
|
160
162
|
|
|
@@ -215,10 +217,10 @@ These limits define where the adapter stops and future work begins. They are cur
|
|
|
215
217
|
- **`maxRequestImageBytes` counts base64 image payload only** — text, tools, descriptors, and JSON structure ride outside the bound, so it must sit below the gateway's request-body cap with headroom.
|
|
216
218
|
- **A sign-in lives only in the process that started it** — an authorization attempt is not durable, so reloading the page mid-login abandons it and the human starts over. Signing out is `deleteRecord` on the stored record, which forgets it locally without telling the issuer.
|
|
217
219
|
- **Provider-native discovery answers through this plugin's ambient context** — a route naming no credential defers to the catalog provider's own resolution, which asks for environment values (`AZURE_OPENAI_API_KEY`, `AWS_PROFILE`, and each provider's own set) and for local credential files. Both questions are answered here: the credential seam is consulted before the process environment, and file existence is checked against the host process's filesystem with `~` expanded. What it cannot do is *read* a credential file's contents — a provider that parses `~/.aws/credentials` itself does so directly, outside the seam.
|
|
218
|
-
- **
|
|
219
|
-
- **
|
|
220
|
+
- **Reset restores inherited configuration** — resetting a route supplied by a lower profile layer restores that route.
|
|
221
|
+
- **Complete Config replacement can remove inherited dictionary entries** — a field reset instead restores its inherited value.
|
|
220
222
|
- **`headers` can carry a credential the redactor never sees** — profile resolution rejects names and values Fetch cannot represent, but the dict remains plain strings; store credentials as `apiKeyEnv` references.
|
|
221
|
-
- **
|
|
223
|
+
- **Discovery does not change configured models** — adopt discovery results explicitly into the route configuration.
|
|
222
224
|
- **Anthropic discovery reads at most 1,000 models** — the request uses the API's maximum page size but does not traverse `has_more`; entries beyond the first page must be added by hand.
|
|
223
225
|
- **One wire protocol per route** — a mixed-protocol catalog route cannot host a model of the other protocol; splitting the provider across two route keys is the workaround.
|
|
224
226
|
- **A modality declaration is not verified** — a model declaring `image` its gateway does not serve is refused by the provider after prompt admission. The durable image remains in history and the same misdeclared model can fail again; switching to a text-only model remains possible because the shared LLM runtime projects image references into stable text for that request.
|
|
@@ -227,6 +229,7 @@ These limits define where the adapter stops and future work begins. They are cur
|
|
|
227
229
|
- **Only a leading in-history `system` message becomes pi-ai's `systemPrompt`** — pi-ai has one system slot, so a later `system` message, or a leading one when `GenerateOptions.system` is also set, folds into a `user` message at its position; provider-specific placement of the prompt follows pi-ai rather than a harness-owned wire override. Images in system or assistant history, including the leading system message, fail with `UNSUPPORTED_CONTENT` on both conversion paths.
|
|
228
230
|
- **Provider HTTP status is unavailable** — pi-ai error events do not expose a stable HTTP status across providers.
|
|
229
231
|
- **Retry policy is provider-owned, not an SDK retry** — pi-ai SDK retries stay disabled so durable agent steps and `llm/retry` events own every visible attempt, and direct `ctx.llm.stream()` calls remain single-attempt.
|
|
232
|
+
- **Streamed tool-call arguments are parsed once, when the call ends** — the installed pi-ai carries [`patches/@earendil-works__pi-ai@0.85.1.patch`](../../../patches/@earendil-works__pi-ai@0.85.1.patch), which removes the per-delta re-parse of the whole accumulated argument JSON in every stream adapter (upstream [earendil-works/pi#9265](https://github.com/earendil-works/pi/issues/9265)); unpatched, a multi-megabyte argument stream costs O(n²) CPU on the event loop and stalls every session in the process. Until `toolcall_end`, a pi-ai partial's tool-call `arguments` stays `{}`; this adapter reads only the delta strings and the finalized arguments. Re-apply or retire the patch on every pi-ai upgrade.
|
|
230
233
|
|
|
231
234
|
<a id="dev-note"></a>
|
|
232
235
|
### Dev Note
|
package/README.zh.md
CHANGED
|
@@ -27,6 +27,8 @@ kind: "package-reference"
|
|
|
27
27
|
|
|
28
28
|
当组合需要通过 pi-ai 的提供方目录、或通过 pi-ai 已安装目录未描述的网关路由模型请求时挂载本插件。`providers` 字典就是整个配置面:每个键都是请求用 `GenerateOptions.provider` 选择的提供方路由名。
|
|
29
29
|
|
|
30
|
+
适配器接受 LLM 服务的[仅供请求使用的 user 输入](../llm/README.zh.md#use-this-package),并可将其与持久历史混用。user 身份与来源不会进入 pi-ai 内容;assistant 回放元数据和工具调用关联仍由持久消息携带。
|
|
31
|
+
|
|
30
32
|
### 何时选择
|
|
31
33
|
|
|
32
34
|
当同一组合服务多个提供方、某条路由需要 pi-ai 目录默认值并修正少数字段、或必须通过自有端点与协议到达手工声明网关时,选择本适配器。当部署不需要其他提供方时,选择 `dsh-llm-deepseek` 直连 DeepSeek 路由。两个适配器可以同时挂载,因为它们的路由名不冲突;注册其他适配器已拥有的路由会导致插件加载失败。
|
|
@@ -104,17 +106,17 @@ profile 的 `models` 列表会替换而非扩展路由的已安装目录;每
|
|
|
104
106
|
|
|
105
107
|
### 运行时更改配置
|
|
106
108
|
|
|
107
|
-
|
|
109
|
+
每次操作捕获当前 `providers` Config 引用。新增或修改的 provider 配置在表单持久化前验证;未更改的目录故障仍可编辑。路由集合或重试策略变化时原子更新注册;如果其他适配器已拥有所请求的路由,则保留先前路由。
|
|
108
110
|
|
|
109
111
|
### 从端点发现模型
|
|
110
112
|
|
|
111
|
-
插件会回答「该提供方可以提供哪些模型?」,供配置界面正在编辑或起草的路由使用。已安装目录提供的路由直接由目录回答,不发网络请求,并将其 `input` 数组保留为发现结果的 `inputModalities`;只有目录未描述的路由才会经网络询问。`openai-completions` 与 `openai-responses` 使用带 bearer 鉴权的 `GET {baseURL}/models`,`anthropic-messages` 则以 `x-api-key` 和 `anthropic-version` 使用原生 `GET /v1/models?limit=1000` 语义;其列表 URL 接受带或不带末尾 `/v1` 的 API 根地址,因为网关文档两种写法都会发布,且只有该列表 URL 会归一化这一段,模型请求收到的仍是配置原样的 `baseURL`。已配置且具名的路由会在 Host 内部提供已存凭据与 profile `headers`,因此通过 `
|
|
113
|
+
插件会回答「该提供方可以提供哪些模型?」,供配置界面正在编辑或起草的路由使用。已安装目录提供的路由直接由目录回答,不发网络请求,并将其 `input` 数组保留为发现结果的 `inputModalities`;只有目录未描述的路由才会经网络询问。`openai-completions` 与 `openai-responses` 使用带 bearer 鉴权的 `GET {baseURL}/models`,`anthropic-messages` 则以 `x-api-key` 和 `anthropic-version` 使用原生 `GET /v1/models?limit=1000` 语义;其列表 URL 接受带或不带末尾 `/v1` 的 API 根地址,因为网关文档两种写法都会发布,且只有该列表 URL 会归一化这一段,模型请求收到的仍是配置原样的 `baseURL`。已配置且具名的路由会在 Host 内部提供已存凭据与 profile `headers`,因此通过 `cordis.patch.yml` 或 Cordis 配置设置的部署标头可以到达模型发现请求,但不会成为发现请求或 Models 页面的字段;表单中新键入的密钥仍优先于已存凭据。解析器接受标准 `data` 数组或富信息 `models` 对象,并归一化每个候选的 id、显示名、上下文窗口与最大输出 token 数;Anthropic 的 `max_input_tokens` 与 `max_tokens` 会进入相同容量字段,即使对象条目点名了另一个规范 id,对象键仍是请求 id,原始类型的对象属性会被忽略,缺失的显示名则回退到该请求 id。回答是界面可以提供给用户采纳的候选元数据——不存储任何内容,`cordis.patch.yml` 仍然是决定路由服务内容的唯一事实。
|
|
112
114
|
|
|
113
115
|
### 失败与恢复
|
|
114
116
|
|
|
115
117
|
pi-ai 不提供的路由需要 `api`、`baseURL` 与非空 `models` 列表;无法服务的 profile 会在写入处被拒绝,并点名路由与模型。失败携带稳定 code:无法使用的凭据以 `INVALID_CREDENTIAL` 失败并点名路由与引用,`apiKeyEnv` 引用解析为空的路由以 `MISSING_CREDENTIAL` 失败,未配置模型以 `UNKNOWN_MODEL` 失败,终止性提供方失败则区分 `QUOTA` 与暂时性 `RATE_LIMIT`。`GenerateOptions.stop` 以 `UNSUPPORTED_OPTION` 被拒绝,因为 pi-ai 的通用流式 UI 无法跨提供方保证它。
|
|
116
118
|
|
|
117
|
-
|
|
119
|
+
Config 更新严格验证发生变化的 provider。初始加载将已存储的目录故障保留为可编辑的 provider 诊断;未更改的故障 provider 不阻止其他编辑。可用模型仍可选择,无法解析的模型在网络 I/O 前失败。修复或删除问题配置会清除其诊断。
|
|
118
120
|
|
|
119
121
|
只修改 `displayName`、`apiKeyEnv` 或 `baseURL` 而未解决提供方的模型配置错误时,保存仍会被拒绝。例如,OpenRouter 路由的模型 `111` 缺少 `api` 时,不能单独保存路由名称的修改:需要在同一份编辑草稿中修复或删除该模型,再保存完整的提供方配置。中间修复状态保留在草稿中,直到整条提供方配置通过校验;其他提供方可以独立保存。
|
|
120
122
|
|
|
@@ -136,7 +138,7 @@ Settings 写入会在合并组合层与用户层后严格校验每个新增或
|
|
|
136
138
|
|
|
137
139
|
| 文件 | 职责 |
|
|
138
140
|
|---|---|
|
|
139
|
-
| [`src/index.ts`](src/index.ts) |
|
|
141
|
+
| [`src/index.ts`](src/index.ts) | Config 快照、目录及路由注册 |
|
|
140
142
|
| [`src/auth.ts`](src/auth.ts) | 覆盖 harness 凭据平面的凭据存储与 ambient auth context |
|
|
141
143
|
| [`src/login.ts`](src/login.ts) | 面向提供登录的已安装提供方的授权流程 |
|
|
142
144
|
| [`src/config.ts`](src/config.ts) | Profile schema、解析与可服务性校验 |
|
|
@@ -154,7 +156,7 @@ Settings 写入会在合并组合层与用户层后严格校验每个新增或
|
|
|
154
156
|
|
|
155
157
|
### 回放与词汇
|
|
156
158
|
|
|
157
|
-
成功 assistant 响应会存储带版本的、无损 JSON 回放状态,与产生它们的提供方和模型放在一起——响应级事实加每个流式块一条逐块条目。请求时,`LlmRuntime` 仅当同一适配器实例拥有两条路由时才传递回放状态;适配器校验它并恢复原生响应 id、提供方签名与可选的 `providerThinkingLevel` effort 元数据,缺失的 effort 元数据仍保持缺失。回放会对照 assistant 来源校验请求模型身份,并在提供方解析别名或回退时单独恢复 Anthropic
|
|
159
|
+
成功 assistant 响应会存储带版本的、无损 JSON 回放状态,与产生它们的提供方和模型放在一起——响应级事实加每个流式块一条逐块条目。请求时,`LlmRuntime` 仅当同一适配器实例拥有两条路由时才传递回放状态;适配器校验它并恢复原生响应 id、提供方签名与可选的 `providerThinkingLevel` effort 元数据,缺失的 effort 元数据仍保持缺失。回放会对照 assistant 来源校验请求模型身份,并在提供方解析别名或回退时单独恢复 Anthropic 响应模型。回放状态缺失或无法使用时会降级为提供方无关内容,并保留 assistant 来源中必需的提供方和模型。pi-ai 工具调用参数是解析后的对象,因此适配器解析输入并重新字符串化输出,以符合 harness 原始 JSON 约定;pi-ai 流内错误事件映射为终止 `finish` 分片。
|
|
158
160
|
|
|
159
161
|
</details>
|
|
160
162
|
|
|
@@ -215,10 +217,10 @@ pi-ai 事件变成 harness 的推理、文本、工具调用、用量与 finish
|
|
|
215
217
|
- **`maxRequestImageBytes` 只计算 base64 图片载荷**,文本、工具、描述符与 JSON 结构在该上限之外,因此它必须留有余量地低于网关请求体上限。
|
|
216
218
|
- **登录只存在于发起它的进程中**——授权尝试不持久,因此登录中途刷新页面会放弃它,用户需要重新开始。退出登录是对已存储记录执行 `deleteRecord`,只在本地忘记它,不会告知签发方。
|
|
217
219
|
- **提供方原生发现经本插件的 ambient context 回答**——不点名凭据的路由交由目录提供方自身解析,它会询问环境值(`AZURE_OPENAI_API_KEY`、`AWS_PROFILE` 及各提供方自有集合)与本地凭据文件。两个问题都在这里得到回答:凭据 seam 先于进程环境被查询,文件存在性则针对宿主进程的文件系统以 `~` 展开后检查。它做不到的是*读取*凭据文件内容——自行解析 `~/.aws/credentials` 的提供方会直接读取,不经该 seam。
|
|
218
|
-
-
|
|
219
|
-
-
|
|
220
|
+
- **重置恢复继承配置**——重置下层 profile 提供的路由会恢复该路由。
|
|
221
|
+
- **完整替换 Config 可以移除继承的字典条目**——字段重置则恢复其继承值。
|
|
220
222
|
- **`headers` 可以携带 redactor 永远看不到的凭据**——profile 解析会拒绝 Fetch 无法表示的名称与值,但该字典仍是纯字符串;以 `apiKeyEnv` 引用存储凭据。
|
|
221
|
-
-
|
|
223
|
+
- **发现操作不更改已配置模型**——需显式将发现结果采纳到路由配置中。
|
|
222
224
|
- **Anthropic 模型发现最多读取 1,000 个模型**——请求使用 API 的最大页大小,但不会遍历 `has_more`;第一页之外的条目需要手工添加。
|
|
223
225
|
- **每条路由一种协议格式**——混合协议目录路由无法承载另一协议格式的模型;把提供方拆到两个路由键是变通办法。
|
|
224
226
|
- **模态声明不受校验**——声明 `image` 而其网关不支持的模型会在提示词准入后被提供方拒绝。持久图片仍留在历史中,同一误声明模型可能再次失败;切换到纯文本模型仍然可行,因为共享 LLM 运行时会针对该请求把图片引用投影为稳定文本。
|
|
@@ -227,6 +229,7 @@ pi-ai 事件变成 harness 的推理、文本、工具调用、用量与 finish
|
|
|
227
229
|
- **只有历史中首条 `system` 消息会成为 pi-ai 的 `systemPrompt`**——pi-ai 只有一个系统槽位,因此后续的 `system` 消息,或在同时设置了 `GenerateOptions.system` 时的首条消息,会在原位置折叠为 `user` 消息;系统提示词的提供方专属放置遵循 pi-ai,而非 harness 自有的协议覆盖。system 或 assistant 历史中的图片(包括首条系统消息中的图片)在两条转换路径上都会以 `UNSUPPORTED_CONTENT` 失败。
|
|
228
230
|
- **提供方 HTTP 状态不可用**——pi-ai 错误事件不跨提供方暴露稳定 HTTP 状态。
|
|
229
231
|
- **重试策略由提供方自有,而非 SDK 重试**——pi-ai SDK 重试保持禁用,因此持久 agent(智能体)步骤与 `llm/retry` 事件拥有每个可见尝试,直接 `ctx.llm.stream()` 调用仍是单次尝试。
|
|
232
|
+
- **流式工具调用参数只在调用结束时解析一次**——安装的 pi-ai 带有 [`patches/@earendil-works__pi-ai@0.85.1.patch`](../../../patches/@earendil-works__pi-ai@0.85.1.patch),它移除了每个流适配器中对整段累计参数 JSON 的逐 delta 重新解析(上游 [earendil-works/pi#9265](https://github.com/earendil-works/pi/issues/9265));未打补丁时,数 MB 的参数流会在事件循环上消耗 O(n²) CPU,并使进程内所有会话停滞。在 `toolcall_end` 之前,pi-ai partial 的工具调用 `arguments` 保持为 `{}`;本适配器只读取 delta 字符串与最终参数。每次升级 pi-ai 时都要重新应用或撤销该补丁。
|
|
230
233
|
|
|
231
234
|
<a id="dev-note"></a>
|
|
232
235
|
### 开发备注
|
package/lib/index.js
CHANGED
|
@@ -142,7 +142,7 @@ function readReplayState(value) {
|
|
|
142
142
|
}
|
|
143
143
|
/** Convert provider-neutral blocks without trusting them as same-model replay. */
|
|
144
144
|
function foreignAssistant(message) {
|
|
145
|
-
const source = message.source
|
|
145
|
+
const source = message.source;
|
|
146
146
|
const content = [];
|
|
147
147
|
for (const block of message.content) switch (block.type) {
|
|
148
148
|
case "text":
|
|
@@ -172,8 +172,8 @@ function foreignAssistant(message) {
|
|
|
172
172
|
role: "assistant",
|
|
173
173
|
content,
|
|
174
174
|
api: "dsh-foreign",
|
|
175
|
-
provider: source
|
|
176
|
-
model: source
|
|
175
|
+
provider: source.provider,
|
|
176
|
+
model: source.model,
|
|
177
177
|
usage: emptyPiUsage(),
|
|
178
178
|
stopReason: content.some((piece) => piece.type === "toolCall") ? "toolUse" : "stop",
|
|
179
179
|
timestamp: 0
|
|
@@ -232,14 +232,14 @@ function replayedAssistant(message, source, rawState) {
|
|
|
232
232
|
* another adapter's kind, another version, a malformed value, or metadata that
|
|
233
233
|
* no longer matches the content — therefore degrades the one message to
|
|
234
234
|
* provider-neutral history instead of failing the request.
|
|
235
|
-
* @param message - assistant content with
|
|
235
|
+
* @param message - model-produced assistant content with provider, model, and optional adapter-owned replay metadata.
|
|
236
236
|
* @param onDegrade - called with the diagnostic reason when an unusable replay
|
|
237
237
|
* state falls back to provider-neutral conversion.
|
|
238
238
|
* @returns a native pi-ai assistant message reconstructed from durable content.
|
|
239
239
|
*/
|
|
240
240
|
function toPiAssistant(message, onDegrade) {
|
|
241
241
|
const source = message.source;
|
|
242
|
-
if (source.
|
|
242
|
+
if (source.replayState === void 0) return foreignAssistant(message);
|
|
243
243
|
try {
|
|
244
244
|
return replayedAssistant(message, source, source.replayState);
|
|
245
245
|
} catch (error) {
|
|
@@ -257,7 +257,7 @@ function toPiAssistant(message, onDegrade) {
|
|
|
257
257
|
* catalog supplies defaults keyed by model id, and a profile's own model
|
|
258
258
|
* entries override them field by field, so a route naming a catalog provider
|
|
259
259
|
* stays configuration-free while a route pi-ai has never heard of is fully
|
|
260
|
-
* describable from `
|
|
260
|
+
* describable from `cordis.patch.yml`.
|
|
261
261
|
*
|
|
262
262
|
* Strict resolution rejects unserviceable models before settings writes.
|
|
263
263
|
* Deferred resolution retains their diagnostics so stored catalog drift does
|
|
@@ -903,20 +903,6 @@ function buildProvider(spec) {
|
|
|
903
903
|
}
|
|
904
904
|
//#endregion
|
|
905
905
|
//#region lib/types/config.js
|
|
906
|
-
/**
|
|
907
|
-
* Configuration schema and provider-profile validation for the pi-ai adapter.
|
|
908
|
-
* Profiles are a dict keyed by provider route, so the composition base and a
|
|
909
|
-
* user-settings layer merge per provider and the route set is structural.
|
|
910
|
-
*
|
|
911
|
-
* A route key is not required to name an installed pi-ai provider. When it does,
|
|
912
|
-
* that provider's endpoint, protocol, display name, and model catalog are the
|
|
913
|
-
* profile's defaults and the profile overrides them field by field; when it does
|
|
914
|
-
* not, the profile is the whole provider declaration. Stored reads retain
|
|
915
|
-
* catalog diagnostics beside serviceable models; writes validate every changed
|
|
916
|
-
* provider before persistence. Self-contained profile constraints apply to both.
|
|
917
|
-
*
|
|
918
|
-
* @module dsh-llm-pi-ai/config
|
|
919
|
-
*/
|
|
920
906
|
/** Default maximum idle interval while an adapter stream read is outstanding. */
|
|
921
907
|
const DEFAULT_STREAM_IDLE_TIMEOUT_MS = 3e5;
|
|
922
908
|
/**
|
|
@@ -1058,7 +1044,7 @@ const profile = z.object({
|
|
|
1058
1044
|
retryPolicy: RetryPolicySchema
|
|
1059
1045
|
});
|
|
1060
1046
|
/** Runtime schema for {@link Config}. */
|
|
1061
|
-
const Config = z.object({ providers: z.dict(profile).default({}) });
|
|
1047
|
+
const Config = z.object({ providers: z.dict(profile).default({}).volatile() });
|
|
1062
1048
|
/**
|
|
1063
1049
|
* Reject new or changed provider profiles that cannot be served. Unchanged
|
|
1064
1050
|
* stored profiles may need repair after a catalog upgrade and do not block
|
|
@@ -1173,15 +1159,29 @@ function resolveProfiles(providers, validation = "strict") {
|
|
|
1173
1159
|
function flattenText(message) {
|
|
1174
1160
|
return message.content.filter((block) => block.type === "text").map((block) => block.text).join("");
|
|
1175
1161
|
}
|
|
1176
|
-
/**
|
|
1177
|
-
function
|
|
1178
|
-
return
|
|
1162
|
+
/** Recover the pi-ai toolResult message for one harness tool-role message. */
|
|
1163
|
+
function toolResultOf(message, toolNames, content) {
|
|
1164
|
+
return {
|
|
1165
|
+
role: "toolResult",
|
|
1166
|
+
toolCallId: message.toolCallId,
|
|
1167
|
+
toolName: toolNames.get(message.toolCallId) ?? "unknown",
|
|
1168
|
+
content: typeof content === "string" ? [{
|
|
1169
|
+
type: "text",
|
|
1170
|
+
text: content || "(no output)"
|
|
1171
|
+
}] : content,
|
|
1172
|
+
isError: message.isError ?? false,
|
|
1173
|
+
timestamp: 0
|
|
1174
|
+
};
|
|
1179
1175
|
}
|
|
1180
|
-
/** Reject
|
|
1181
|
-
function
|
|
1182
|
-
for (const message of messages)
|
|
1176
|
+
/** Reject unsupported roles, tool-change blocks, and image roles before replay or image offloading. */
|
|
1177
|
+
function assertSupportedHistory(messages) {
|
|
1178
|
+
for (const message of messages) {
|
|
1179
|
+
if (message.role === "developer") throw new LlmError("Developer messages are not supported yet", "UNSUPPORTED_CONTENT");
|
|
1180
|
+
if (message.content.some((block) => block.type === "tool-addition" || block.type === "tool-removal")) throw new LlmError("Tool-change blocks require developer role", "UNSUPPORTED_CONTENT");
|
|
1181
|
+
if (message.role !== "user" && message.role !== "tool" && contentHasImage(message.content)) throw new LlmError(`pi-ai cannot represent an image in an in-history ${message.role} message`, "UNSUPPORTED_CONTENT");
|
|
1182
|
+
}
|
|
1183
1183
|
}
|
|
1184
|
-
|
|
1184
|
+
function userContent(blocks, requestImages, resolveImageAccess) {
|
|
1185
1185
|
const content = [];
|
|
1186
1186
|
for (const block of blocks) switch (block.type) {
|
|
1187
1187
|
case "text":
|
|
@@ -1203,17 +1203,6 @@ async function userContent(blocks, requestImages, resolveImageAccess) {
|
|
|
1203
1203
|
});
|
|
1204
1204
|
break;
|
|
1205
1205
|
}
|
|
1206
|
-
case "tool-result":
|
|
1207
|
-
{
|
|
1208
|
-
const nested = await userContent(block.content, requestImages, resolveImageAccess);
|
|
1209
|
-
if (typeof nested === "string") {
|
|
1210
|
-
if (nested.length > 0) content.push({
|
|
1211
|
-
type: "text",
|
|
1212
|
-
text: nested
|
|
1213
|
-
});
|
|
1214
|
-
} else content.push(...nested);
|
|
1215
|
-
}
|
|
1216
|
-
break;
|
|
1217
1206
|
default: break;
|
|
1218
1207
|
}
|
|
1219
1208
|
if (content.every((block) => block.type === "text")) return content.map((block) => block.text).join("");
|
|
@@ -1222,7 +1211,7 @@ async function userContent(blocks, requestImages, resolveImageAccess) {
|
|
|
1222
1211
|
function collectImageRefs(blocks, refs) {
|
|
1223
1212
|
for (const block of blocks) if (block.type === "image") {
|
|
1224
1213
|
if (block.offloaded !== true) refs.set(block.attachment.attachmentId, block.attachment);
|
|
1225
|
-
}
|
|
1214
|
+
}
|
|
1226
1215
|
}
|
|
1227
1216
|
async function prepareRequestImages(messages, attachments, budget, signal) {
|
|
1228
1217
|
const refs = /* @__PURE__ */ new Map();
|
|
@@ -1234,6 +1223,7 @@ async function prepareRequestImages(messages, attachments, budget, signal) {
|
|
|
1234
1223
|
return versions;
|
|
1235
1224
|
}
|
|
1236
1225
|
function toolsOf(options) {
|
|
1226
|
+
if (options.tools?.some((tool) => tool.deferLoading === true)) throw new LlmError("Deferred tool loading is not supported yet", "UNSUPPORTED_CONTENT");
|
|
1237
1227
|
return options.tools?.map((tool) => ({
|
|
1238
1228
|
name: tool.name,
|
|
1239
1229
|
description: tool.description,
|
|
@@ -1277,41 +1267,37 @@ function appendAssistant(message, messages, toolNames, onReplayDegrade) {
|
|
|
1277
1267
|
for (const block of assistant.content) if (block.type === "toolCall") toolNames.set(brandString(block.id), block.name);
|
|
1278
1268
|
messages.push(assistant);
|
|
1279
1269
|
}
|
|
1270
|
+
/** Append the system and assistant roles both context builders treat identically; true when consumed. */
|
|
1271
|
+
function appendSystemOrAssistant(message, messages, toolNames, onReplayDegrade) {
|
|
1272
|
+
if (message.role === "system") {
|
|
1273
|
+
messages.push({
|
|
1274
|
+
role: "user",
|
|
1275
|
+
content: flattenText(message),
|
|
1276
|
+
timestamp: 0
|
|
1277
|
+
});
|
|
1278
|
+
return true;
|
|
1279
|
+
}
|
|
1280
|
+
if (message.role === "assistant") {
|
|
1281
|
+
appendAssistant(message, messages, toolNames, onReplayDegrade);
|
|
1282
|
+
return true;
|
|
1283
|
+
}
|
|
1284
|
+
return false;
|
|
1285
|
+
}
|
|
1280
1286
|
function textOnlyContext(options, onReplayDegrade) {
|
|
1281
|
-
|
|
1287
|
+
assertSupportedHistory(options.messages);
|
|
1282
1288
|
const split = splitSystemPrompt(options);
|
|
1283
1289
|
const toolNames = /* @__PURE__ */ new Map();
|
|
1284
1290
|
const messages = [];
|
|
1285
1291
|
for (const message of split.messages) {
|
|
1286
1292
|
if (contentHasImage(message.content)) throw new LlmError("pi-ai image conversion requires the durable attachment service", "UNSUPPORTED_CONTENT");
|
|
1287
|
-
if (message
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
content: flattenText(message),
|
|
1291
|
-
timestamp: 0
|
|
1292
|
-
});
|
|
1293
|
-
continue;
|
|
1294
|
-
}
|
|
1295
|
-
if (message.role === "assistant") {
|
|
1296
|
-
appendAssistant(message, messages, toolNames, onReplayDegrade);
|
|
1293
|
+
if (appendSystemOrAssistant(message, messages, toolNames, onReplayDegrade)) continue;
|
|
1294
|
+
if (message.role === "tool") {
|
|
1295
|
+
messages.push(toolResultOf(message, toolNames, flattenText(message)));
|
|
1297
1296
|
continue;
|
|
1298
1297
|
}
|
|
1299
|
-
|
|
1300
|
-
const results = message.content.filter((block) => block.type === "tool-result");
|
|
1301
|
-
if (text.length > 0 || results.length === 0) messages.push({
|
|
1298
|
+
messages.push({
|
|
1302
1299
|
role: "user",
|
|
1303
|
-
content:
|
|
1304
|
-
timestamp: 0
|
|
1305
|
-
});
|
|
1306
|
-
for (const result of results) messages.push({
|
|
1307
|
-
role: "toolResult",
|
|
1308
|
-
toolCallId: result.toolCallId,
|
|
1309
|
-
toolName: toolNames.get(result.toolCallId) ?? "unknown",
|
|
1310
|
-
content: [{
|
|
1311
|
-
type: "text",
|
|
1312
|
-
text: toolResultText(result.content) || "(no output)"
|
|
1313
|
-
}],
|
|
1314
|
-
isError: result.isError ?? false,
|
|
1300
|
+
content: flattenText(message),
|
|
1315
1301
|
timestamp: 0
|
|
1316
1302
|
});
|
|
1317
1303
|
}
|
|
@@ -1333,7 +1319,7 @@ async function toPiContextWithImages(options, images, onReplayDegrade) {
|
|
|
1333
1319
|
maxPixels: 4194304,
|
|
1334
1320
|
maxBytes: 1048576
|
|
1335
1321
|
};
|
|
1336
|
-
|
|
1322
|
+
assertSupportedHistory(options.messages);
|
|
1337
1323
|
const split = splitSystemPrompt(options);
|
|
1338
1324
|
const requestImages = await prepareRequestImages(split.messages, attachments, requestImagePolicy, options.signal);
|
|
1339
1325
|
if (maxRequestImageBytes !== void 0) {
|
|
@@ -1347,39 +1333,17 @@ async function toPiContextWithImages(options, images, onReplayDegrade) {
|
|
|
1347
1333
|
const toolNames = /* @__PURE__ */ new Map();
|
|
1348
1334
|
const messages = [];
|
|
1349
1335
|
for (const message of exactMessages) {
|
|
1350
|
-
if (message
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
content: flattenText(message),
|
|
1354
|
-
timestamp: 0
|
|
1355
|
-
});
|
|
1356
|
-
continue;
|
|
1357
|
-
}
|
|
1358
|
-
if (message.role === "assistant") {
|
|
1359
|
-
appendAssistant(message, messages, toolNames, onReplayDegrade);
|
|
1336
|
+
if (appendSystemOrAssistant(message, messages, toolNames, onReplayDegrade)) continue;
|
|
1337
|
+
if (message.role === "tool") {
|
|
1338
|
+
messages.push(toolResultOf(message, toolNames, userContent(message.content, requestImages, resolveImageAccess)));
|
|
1360
1339
|
continue;
|
|
1361
1340
|
}
|
|
1362
|
-
const content =
|
|
1363
|
-
|
|
1364
|
-
if (content.length > 0 || results.length === 0) messages.push({
|
|
1341
|
+
const content = userContent(message.content, requestImages, resolveImageAccess);
|
|
1342
|
+
messages.push({
|
|
1365
1343
|
role: "user",
|
|
1366
1344
|
content,
|
|
1367
1345
|
timestamp: 0
|
|
1368
1346
|
});
|
|
1369
|
-
for (const result of results) {
|
|
1370
|
-
const resultContent = await userContent(result.content, requestImages, resolveImageAccess);
|
|
1371
|
-
messages.push({
|
|
1372
|
-
role: "toolResult",
|
|
1373
|
-
toolCallId: result.toolCallId,
|
|
1374
|
-
toolName: toolNames.get(result.toolCallId) ?? "unknown",
|
|
1375
|
-
content: typeof resultContent === "string" ? [{
|
|
1376
|
-
type: "text",
|
|
1377
|
-
text: resultContent || "(no output)"
|
|
1378
|
-
}] : resultContent,
|
|
1379
|
-
isError: result.isError ?? false,
|
|
1380
|
-
timestamp: 0
|
|
1381
|
-
});
|
|
1382
|
-
}
|
|
1383
1347
|
}
|
|
1384
1348
|
return piContext(split.systemPrompt, options, messages);
|
|
1385
1349
|
}
|
|
@@ -2149,7 +2113,7 @@ function authContextFrom(ctx) {
|
|
|
2149
2113
|
*
|
|
2150
2114
|
* Neither path is a catalog refresh. Nothing here is stored: the request
|
|
2151
2115
|
* carries a draft the user is still editing, and the reply is candidate
|
|
2152
|
-
* metadata the surface offers for adoption. `
|
|
2116
|
+
* metadata the surface offers for adoption. `cordis.patch.yml` remains the only
|
|
2153
2117
|
* thing that decides what a route serves.
|
|
2154
2118
|
*
|
|
2155
2119
|
* OpenAI-compatible and Anthropic Messages protocols are interrogated through
|
|
@@ -2519,62 +2483,6 @@ function registerPiAiFlows(ctx, auth) {
|
|
|
2519
2483
|
}
|
|
2520
2484
|
//#endregion
|
|
2521
2485
|
//#region lib/types/index.js
|
|
2522
|
-
/**
|
|
2523
|
-
* Generic pi-ai-backed LLM adapter plugin. One plugin instance owns a dict of
|
|
2524
|
-
* provider routes; a route naming an installed pi-ai provider inherits that
|
|
2525
|
-
* provider's endpoint, protocol, and model catalog as defaults, and a route
|
|
2526
|
-
* pi-ai does not ship is declared outright. Profile facts resolve per request
|
|
2527
|
-
* over the optional `llm-pi-ai` user-settings section and the optional
|
|
2528
|
-
* credential seam, so a changed key, endpoint, model, or knob reaches the next
|
|
2529
|
-
* request without a restart; a changed *route set* (or a route's
|
|
2530
|
-
* registration-captured retry policy) re-registers the same adapter instance
|
|
2531
|
-
* in place.
|
|
2532
|
-
*
|
|
2533
|
-
* ```yaml
|
|
2534
|
-
* - id: llm
|
|
2535
|
-
* name: '@deepseek-ai/dsh-llm-pi-ai'
|
|
2536
|
-
* config:
|
|
2537
|
-
* providers:
|
|
2538
|
-
* # Catalog route: everything but the credential comes from pi-ai.
|
|
2539
|
-
* openai:
|
|
2540
|
-
* apiKeyEnv: OPENAI_API_KEY
|
|
2541
|
-
* retryPolicy:
|
|
2542
|
-
* mode: normal
|
|
2543
|
-
* maxRetries: 2
|
|
2544
|
-
* # Catalog route with the catalog narrowed and one capacity corrected.
|
|
2545
|
-
* anthropic:
|
|
2546
|
-
* apiKeyEnv: ANTHROPIC_API_KEY
|
|
2547
|
-
* models:
|
|
2548
|
-
* - id: claude-sonnet-4-5
|
|
2549
|
-
* contextWindow: 200000
|
|
2550
|
-
* # Hand-declared route: pi-ai ships nothing under this key.
|
|
2551
|
-
* acme-gateway:
|
|
2552
|
-
* displayName: Acme Gateway
|
|
2553
|
-
* apiKeyEnv: ACME_GATEWAY_API_KEY
|
|
2554
|
-
* api: openai-completions
|
|
2555
|
-
* baseURL: https://gateway.acme.example/v1
|
|
2556
|
-
* # Reasoning dialect for a URL pi-ai cannot recognize.
|
|
2557
|
-
* compat:
|
|
2558
|
-
* thinkingFormat: deepseek
|
|
2559
|
-
* models:
|
|
2560
|
-
* - id: acme-large
|
|
2561
|
-
* name: Acme Large
|
|
2562
|
-
* contextWindow: 65536
|
|
2563
|
-
* maxTokens: 4096
|
|
2564
|
-
* - id: acme-think
|
|
2565
|
-
* name: Acme Think
|
|
2566
|
-
* contextWindow: 262144
|
|
2567
|
-
* maxTokens: 32768
|
|
2568
|
-
* # key = selectable level, value = wire spelling; only off may
|
|
2569
|
-
* # leave the value empty (supported, send nothing).
|
|
2570
|
-
* reasoningEfforts:
|
|
2571
|
-
* off:
|
|
2572
|
-
* high: high
|
|
2573
|
-
* max: ultra
|
|
2574
|
-
* ```
|
|
2575
|
-
*
|
|
2576
|
-
* @module @deepseek-ai/dsh-llm-pi-ai
|
|
2577
|
-
*/
|
|
2578
2486
|
const name = "llm-pi-ai";
|
|
2579
2487
|
const inject = ["llm"];
|
|
2580
2488
|
const NS = "llm-pi-ai";
|
|
@@ -2598,14 +2506,14 @@ function registrationFacts(profiles) {
|
|
|
2598
2506
|
* @param profiles - the currently resolved provider profiles.
|
|
2599
2507
|
* @returns the directory entries in catalog order, declared routes last.
|
|
2600
2508
|
*/
|
|
2601
|
-
function directoryEntries(profiles) {
|
|
2509
|
+
function directoryEntries(profiles, settingsNs) {
|
|
2602
2510
|
const catalog = new Set(catalogProviderIds());
|
|
2603
2511
|
const entries = /* @__PURE__ */ new Map();
|
|
2604
2512
|
const declare = (provider, displayName, error) => {
|
|
2605
2513
|
entries.set(provider, {
|
|
2606
2514
|
provider,
|
|
2607
2515
|
displayName,
|
|
2608
|
-
settingsNs
|
|
2516
|
+
settingsNs,
|
|
2609
2517
|
settingsPath: ["providers", provider],
|
|
2610
2518
|
declared: !catalog.has(provider),
|
|
2611
2519
|
...error === void 0 ? {} : { error }
|
|
@@ -2617,7 +2525,10 @@ function directoryEntries(profiles) {
|
|
|
2617
2525
|
}
|
|
2618
2526
|
/** Register one generic pi-ai adapter for all configured provider routes. */
|
|
2619
2527
|
function apply(ctx, config) {
|
|
2620
|
-
|
|
2528
|
+
ctx.inject(["settings"], (child) => {
|
|
2529
|
+
child.effect(() => child.settings.configure({ auto: false }, ctx.fiber));
|
|
2530
|
+
});
|
|
2531
|
+
const settingsNs = ctx.fiber.entry?.options.id ?? NS;
|
|
2621
2532
|
let lastRaw;
|
|
2622
2533
|
let memoized;
|
|
2623
2534
|
/**
|
|
@@ -2630,14 +2541,21 @@ function apply(ctx, config) {
|
|
|
2630
2541
|
* Scalar configuration errors still reject resolution.
|
|
2631
2542
|
*/
|
|
2632
2543
|
const profiles = () => {
|
|
2633
|
-
const raw =
|
|
2544
|
+
const raw = config.providers.get();
|
|
2634
2545
|
if (raw === lastRaw && memoized !== void 0) return memoized;
|
|
2635
|
-
const next = resolveProfiles(raw
|
|
2546
|
+
const next = resolveProfiles(structuredClone(raw), "deferred");
|
|
2636
2547
|
lastRaw = raw;
|
|
2637
2548
|
memoized = next;
|
|
2638
2549
|
return next;
|
|
2639
2550
|
};
|
|
2640
2551
|
profiles();
|
|
2552
|
+
ctx.on("internal/config", function(_raw, next) {
|
|
2553
|
+
const raw = next();
|
|
2554
|
+
if (this !== ctx.fiber) return raw;
|
|
2555
|
+
const candidate = Config(raw);
|
|
2556
|
+
assertServiceable({ providers: structuredClone(candidate.providers.get()) }, { providers: structuredClone(config.providers.get()) });
|
|
2557
|
+
return raw;
|
|
2558
|
+
});
|
|
2641
2559
|
const resolveApiKey = async (provider, profile) => {
|
|
2642
2560
|
const ref = profile.apiKeyEnv;
|
|
2643
2561
|
if (ref === void 0) return void 0;
|
|
@@ -2666,7 +2584,7 @@ function apply(ctx, config) {
|
|
|
2666
2584
|
let directory;
|
|
2667
2585
|
let directoryFacts;
|
|
2668
2586
|
const ensureDirectory = () => {
|
|
2669
|
-
const entries = directoryEntries(profiles());
|
|
2587
|
+
const entries = directoryEntries(profiles(), settingsNs);
|
|
2670
2588
|
if (deepEqualJson(entries, directoryFacts)) return;
|
|
2671
2589
|
if (directory === void 0) directory = ctx.llm.registerConfigurableProviders(entries);
|
|
2672
2590
|
else directory.replace(entries);
|
|
@@ -2683,7 +2601,7 @@ function apply(ctx, config) {
|
|
|
2683
2601
|
resolveApiKey: () => resolveApiKey(provider, profile)
|
|
2684
2602
|
};
|
|
2685
2603
|
};
|
|
2686
|
-
ctx.llm.registerModelDiscovery(
|
|
2604
|
+
ctx.llm.registerModelDiscovery(settingsNs, (request, signal) => discoverModels({
|
|
2687
2605
|
...request,
|
|
2688
2606
|
...signal === void 0 ? {} : { signal }
|
|
2689
2607
|
}, () => storedDiscoveryProfile(request.provider)));
|
|
@@ -2703,32 +2621,14 @@ function apply(ctx, config) {
|
|
|
2703
2621
|
registeredFacts = facts;
|
|
2704
2622
|
};
|
|
2705
2623
|
ensureRegistrationFacts();
|
|
2706
|
-
ctx.
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
current = source;
|
|
2715
|
-
},
|
|
2716
|
-
onChange: () => {
|
|
2717
|
-
try {
|
|
2718
|
-
ensureRegistrationFacts();
|
|
2719
|
-
} catch (error) {
|
|
2720
|
-
ctx.logger.error("llm-pi-ai: keeping the previously registered routes after a refused update");
|
|
2721
|
-
ctx.logger.error(error);
|
|
2722
|
-
}
|
|
2723
|
-
try {
|
|
2724
|
-
ensureDirectory();
|
|
2725
|
-
} catch (error) {
|
|
2726
|
-
ctx.logger.error("llm-pi-ai: keeping the previous configurable-provider directory after a refused update");
|
|
2727
|
-
ctx.logger.error(error);
|
|
2728
|
-
}
|
|
2729
|
-
}
|
|
2730
|
-
});
|
|
2731
|
-
registering = false;
|
|
2624
|
+
ctx.on("loader/volatile-update", () => {
|
|
2625
|
+
try {
|
|
2626
|
+
ensureRegistrationFacts();
|
|
2627
|
+
ensureDirectory();
|
|
2628
|
+
} catch (error) {
|
|
2629
|
+
ctx.logger.error("llm-pi-ai: configuration conflicts with an existing provider route");
|
|
2630
|
+
ctx.logger.error(error);
|
|
2631
|
+
}
|
|
2732
2632
|
});
|
|
2733
2633
|
}
|
|
2734
2634
|
//#endregion
|
package/lib/types/catalog.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* catalog supplies defaults keyed by model id, and a profile's own model
|
|
4
4
|
* entries override them field by field, so a route naming a catalog provider
|
|
5
5
|
* stays configuration-free while a route pi-ai has never heard of is fully
|
|
6
|
-
* describable from `
|
|
6
|
+
* describable from `cordis.patch.yml`.
|
|
7
7
|
*
|
|
8
8
|
* Strict resolution rejects unserviceable models before settings writes.
|
|
9
9
|
* Deferred resolution retains their diagnostics so stored catalog drift does
|
package/lib/types/config.d.ts
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
*
|
|
13
13
|
* @module dsh-llm-pi-ai/config
|
|
14
14
|
*/
|
|
15
|
+
import type { Volatile } from '@deepseek-ai/cordis';
|
|
15
16
|
import type { CacheRetention, ModelThinkingLevel, Provider, ThinkingBudgets, Transport } from '@earendil-works/pi-ai';
|
|
16
17
|
import z from '@deepseek-ai/schemastery';
|
|
17
18
|
import type { CredentialRef } from '@deepseek-ai/dsh-credentials';
|
|
@@ -183,10 +184,140 @@ export interface Config {
|
|
|
183
184
|
* the dormant settings-driven posture: the adapter mounts with no routes
|
|
184
185
|
* and registers them the moment a settings section supplies profiles.
|
|
185
186
|
*/
|
|
186
|
-
providers
|
|
187
|
+
providers: Volatile<Record<string, PiAiProviderProfile>>;
|
|
187
188
|
}
|
|
189
|
+
/** Plain options accepted by the provider resolver. */
|
|
190
|
+
export type Options = {
|
|
191
|
+
[K in keyof Config]?: Config[K] extends Volatile<infer T> ? T : never;
|
|
192
|
+
};
|
|
188
193
|
/** Runtime schema for {@link Config}. */
|
|
189
|
-
export declare const Config: z<
|
|
194
|
+
export declare const Config: z<Schemastery.ObjectS<NoInfer<{
|
|
195
|
+
providers: z<NoInfer<import("@deepseek-ai/cosmokit").Dict<{
|
|
196
|
+
apiKeyEnv?: string | null;
|
|
197
|
+
displayName?: string | null;
|
|
198
|
+
api?: string | null;
|
|
199
|
+
baseURL?: string | null;
|
|
200
|
+
models?: PiAiModelProfile[] | null;
|
|
201
|
+
modelOverrides?: import("@deepseek-ai/cosmokit").Dict<PiAiModelOverride, string> | null;
|
|
202
|
+
compat?: PiAiCompatProfile | null;
|
|
203
|
+
defaultContextWindow?: number | null;
|
|
204
|
+
defaultMaxTokens?: number | null;
|
|
205
|
+
defaultInput?: ("text" | "image")[] | null;
|
|
206
|
+
headers?: import("@deepseek-ai/cosmokit").Dict<string, string> | null;
|
|
207
|
+
reasoning?: "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | null;
|
|
208
|
+
thinkingBudgets?: ({
|
|
209
|
+
minimal?: number | null;
|
|
210
|
+
low?: number | null;
|
|
211
|
+
medium?: number | null;
|
|
212
|
+
high?: number | null;
|
|
213
|
+
} & import("@deepseek-ai/cosmokit").Dict) | null;
|
|
214
|
+
cacheRetention?: "none" | "short" | "long" | null;
|
|
215
|
+
transport?: "auto" | "sse" | "websocket" | "websocket-cached" | null;
|
|
216
|
+
timeoutMs?: number | null;
|
|
217
|
+
websocketConnectTimeoutMs?: number | null;
|
|
218
|
+
streamIdleTimeoutMs?: number | null;
|
|
219
|
+
maxRequestImageBytes?: number | null;
|
|
220
|
+
requestImagePixelBudget?: number | null;
|
|
221
|
+
requestImageMaxBytes?: number | null;
|
|
222
|
+
retryPolicy?: RetryPolicyConfig | null;
|
|
223
|
+
} & import("@deepseek-ai/cosmokit").Dict, string>>, NoInfer<import("@deepseek-ai/cosmokit").Dict<Schemastery.ObjectT<NoInfer<{
|
|
224
|
+
apiKeyEnv: z<string, string, "plain">;
|
|
225
|
+
displayName: z<string, string, "plain">;
|
|
226
|
+
api: z<string, string, "plain">;
|
|
227
|
+
baseURL: z<string, string, "plain">;
|
|
228
|
+
models: z<PiAiModelProfile[], PiAiModelProfile[], "plain">;
|
|
229
|
+
modelOverrides: z<import("@deepseek-ai/cosmokit").Dict<PiAiModelOverride, string>, import("@deepseek-ai/cosmokit").Dict<PiAiModelOverride, string>, "plain">;
|
|
230
|
+
compat: z<PiAiCompatProfile>;
|
|
231
|
+
defaultContextWindow: z<number, number, "defined">;
|
|
232
|
+
defaultMaxTokens: z<number, number, "defined">;
|
|
233
|
+
defaultInput: z<("text" | "image")[], ("text" | "image")[], "defined">;
|
|
234
|
+
headers: z<import("@deepseek-ai/cosmokit").Dict<string, string>, import("@deepseek-ai/cosmokit").Dict<string, string>, "plain">;
|
|
235
|
+
reasoning: z<"off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max", "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max", "plain">;
|
|
236
|
+
thinkingBudgets: z<Schemastery.ObjectS<NoInfer<{
|
|
237
|
+
minimal: z<number, number, "plain">;
|
|
238
|
+
low: z<number, number, "plain">;
|
|
239
|
+
medium: z<number, number, "plain">;
|
|
240
|
+
high: z<number, number, "plain">;
|
|
241
|
+
}>>, Schemastery.ObjectT<NoInfer<{
|
|
242
|
+
minimal: z<number, number, "plain">;
|
|
243
|
+
low: z<number, number, "plain">;
|
|
244
|
+
medium: z<number, number, "plain">;
|
|
245
|
+
high: z<number, number, "plain">;
|
|
246
|
+
}>>, "plain">;
|
|
247
|
+
cacheRetention: z<"none" | "short" | "long", "none" | "short" | "long", "plain">;
|
|
248
|
+
transport: z<"auto" | "sse" | "websocket" | "websocket-cached", "auto" | "sse" | "websocket" | "websocket-cached", "plain">;
|
|
249
|
+
timeoutMs: z<number, number, "plain">;
|
|
250
|
+
websocketConnectTimeoutMs: z<number, number, "plain">;
|
|
251
|
+
streamIdleTimeoutMs: z<number, number, "defined">;
|
|
252
|
+
maxRequestImageBytes: z<number, number, "defined">;
|
|
253
|
+
requestImagePixelBudget: z<number, number, "defined">;
|
|
254
|
+
requestImageMaxBytes: z<number, number, "defined">;
|
|
255
|
+
retryPolicy: z<RetryPolicyConfig>;
|
|
256
|
+
}>>, string>>, "volatile-defined">;
|
|
257
|
+
}>>, Schemastery.ObjectT<NoInfer<{
|
|
258
|
+
providers: z<NoInfer<import("@deepseek-ai/cosmokit").Dict<{
|
|
259
|
+
apiKeyEnv?: string | null;
|
|
260
|
+
displayName?: string | null;
|
|
261
|
+
api?: string | null;
|
|
262
|
+
baseURL?: string | null;
|
|
263
|
+
models?: PiAiModelProfile[] | null;
|
|
264
|
+
modelOverrides?: import("@deepseek-ai/cosmokit").Dict<PiAiModelOverride, string> | null;
|
|
265
|
+
compat?: PiAiCompatProfile | null;
|
|
266
|
+
defaultContextWindow?: number | null;
|
|
267
|
+
defaultMaxTokens?: number | null;
|
|
268
|
+
defaultInput?: ("text" | "image")[] | null;
|
|
269
|
+
headers?: import("@deepseek-ai/cosmokit").Dict<string, string> | null;
|
|
270
|
+
reasoning?: "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | null;
|
|
271
|
+
thinkingBudgets?: ({
|
|
272
|
+
minimal?: number | null;
|
|
273
|
+
low?: number | null;
|
|
274
|
+
medium?: number | null;
|
|
275
|
+
high?: number | null;
|
|
276
|
+
} & import("@deepseek-ai/cosmokit").Dict) | null;
|
|
277
|
+
cacheRetention?: "none" | "short" | "long" | null;
|
|
278
|
+
transport?: "auto" | "sse" | "websocket" | "websocket-cached" | null;
|
|
279
|
+
timeoutMs?: number | null;
|
|
280
|
+
websocketConnectTimeoutMs?: number | null;
|
|
281
|
+
streamIdleTimeoutMs?: number | null;
|
|
282
|
+
maxRequestImageBytes?: number | null;
|
|
283
|
+
requestImagePixelBudget?: number | null;
|
|
284
|
+
requestImageMaxBytes?: number | null;
|
|
285
|
+
retryPolicy?: RetryPolicyConfig | null;
|
|
286
|
+
} & import("@deepseek-ai/cosmokit").Dict, string>>, NoInfer<import("@deepseek-ai/cosmokit").Dict<Schemastery.ObjectT<NoInfer<{
|
|
287
|
+
apiKeyEnv: z<string, string, "plain">;
|
|
288
|
+
displayName: z<string, string, "plain">;
|
|
289
|
+
api: z<string, string, "plain">;
|
|
290
|
+
baseURL: z<string, string, "plain">;
|
|
291
|
+
models: z<PiAiModelProfile[], PiAiModelProfile[], "plain">;
|
|
292
|
+
modelOverrides: z<import("@deepseek-ai/cosmokit").Dict<PiAiModelOverride, string>, import("@deepseek-ai/cosmokit").Dict<PiAiModelOverride, string>, "plain">;
|
|
293
|
+
compat: z<PiAiCompatProfile>;
|
|
294
|
+
defaultContextWindow: z<number, number, "defined">;
|
|
295
|
+
defaultMaxTokens: z<number, number, "defined">;
|
|
296
|
+
defaultInput: z<("text" | "image")[], ("text" | "image")[], "defined">;
|
|
297
|
+
headers: z<import("@deepseek-ai/cosmokit").Dict<string, string>, import("@deepseek-ai/cosmokit").Dict<string, string>, "plain">;
|
|
298
|
+
reasoning: z<"off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max", "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max", "plain">;
|
|
299
|
+
thinkingBudgets: z<Schemastery.ObjectS<NoInfer<{
|
|
300
|
+
minimal: z<number, number, "plain">;
|
|
301
|
+
low: z<number, number, "plain">;
|
|
302
|
+
medium: z<number, number, "plain">;
|
|
303
|
+
high: z<number, number, "plain">;
|
|
304
|
+
}>>, Schemastery.ObjectT<NoInfer<{
|
|
305
|
+
minimal: z<number, number, "plain">;
|
|
306
|
+
low: z<number, number, "plain">;
|
|
307
|
+
medium: z<number, number, "plain">;
|
|
308
|
+
high: z<number, number, "plain">;
|
|
309
|
+
}>>, "plain">;
|
|
310
|
+
cacheRetention: z<"none" | "short" | "long", "none" | "short" | "long", "plain">;
|
|
311
|
+
transport: z<"auto" | "sse" | "websocket" | "websocket-cached", "auto" | "sse" | "websocket" | "websocket-cached", "plain">;
|
|
312
|
+
timeoutMs: z<number, number, "plain">;
|
|
313
|
+
websocketConnectTimeoutMs: z<number, number, "plain">;
|
|
314
|
+
streamIdleTimeoutMs: z<number, number, "defined">;
|
|
315
|
+
maxRequestImageBytes: z<number, number, "defined">;
|
|
316
|
+
requestImagePixelBudget: z<number, number, "defined">;
|
|
317
|
+
requestImageMaxBytes: z<number, number, "defined">;
|
|
318
|
+
retryPolicy: z<RetryPolicyConfig>;
|
|
319
|
+
}>>, string>>, "volatile-defined">;
|
|
320
|
+
}>>, "plain">;
|
|
190
321
|
/**
|
|
191
322
|
* Reject new or changed provider profiles that cannot be served. Unchanged
|
|
192
323
|
* stored profiles may need repair after a catalog upgrade and do not block
|
|
@@ -195,7 +326,7 @@ export declare const Config: z<Config>;
|
|
|
195
326
|
* @param previous - current resolved section; omission checks every provider.
|
|
196
327
|
* @throws Error naming the route and configuration entry that cannot be served.
|
|
197
328
|
*/
|
|
198
|
-
export declare function assertServiceable(config:
|
|
329
|
+
export declare function assertServiceable(config: Options, previous?: Options): void;
|
|
199
330
|
/**
|
|
200
331
|
* Resolve scalar defaults and materialize each route's serviceable models.
|
|
201
332
|
* Deferred catalog validation retains diagnostics without deleting configured
|
package/lib/types/discovery.d.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*
|
|
11
11
|
* Neither path is a catalog refresh. Nothing here is stored: the request
|
|
12
12
|
* carries a draft the user is still editing, and the reply is candidate
|
|
13
|
-
* metadata the surface offers for adoption. `
|
|
13
|
+
* metadata the surface offers for adoption. `cordis.patch.yml` remains the only
|
|
14
14
|
* thing that decides what a route serves.
|
|
15
15
|
*
|
|
16
16
|
* OpenAI-compatible and Anthropic Messages protocols are interrogated through
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,65 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generic pi-ai-backed LLM adapter plugin. One plugin instance owns a dict of
|
|
3
|
-
* provider routes; a route naming an installed pi-ai provider inherits that
|
|
4
|
-
* provider's endpoint, protocol, and model catalog as defaults, and a route
|
|
5
|
-
* pi-ai does not ship is declared outright. Profile facts resolve per request
|
|
6
|
-
* over the optional `llm-pi-ai` user-settings section and the optional
|
|
7
|
-
* credential seam, so a changed key, endpoint, model, or knob reaches the next
|
|
8
|
-
* request without a restart; a changed *route set* (or a route's
|
|
9
|
-
* registration-captured retry policy) re-registers the same adapter instance
|
|
10
|
-
* in place.
|
|
11
|
-
*
|
|
12
|
-
* ```yaml
|
|
13
|
-
* - id: llm
|
|
14
|
-
* name: '@deepseek-ai/dsh-llm-pi-ai'
|
|
15
|
-
* config:
|
|
16
|
-
* providers:
|
|
17
|
-
* # Catalog route: everything but the credential comes from pi-ai.
|
|
18
|
-
* openai:
|
|
19
|
-
* apiKeyEnv: OPENAI_API_KEY
|
|
20
|
-
* retryPolicy:
|
|
21
|
-
* mode: normal
|
|
22
|
-
* maxRetries: 2
|
|
23
|
-
* # Catalog route with the catalog narrowed and one capacity corrected.
|
|
24
|
-
* anthropic:
|
|
25
|
-
* apiKeyEnv: ANTHROPIC_API_KEY
|
|
26
|
-
* models:
|
|
27
|
-
* - id: claude-sonnet-4-5
|
|
28
|
-
* contextWindow: 200000
|
|
29
|
-
* # Hand-declared route: pi-ai ships nothing under this key.
|
|
30
|
-
* acme-gateway:
|
|
31
|
-
* displayName: Acme Gateway
|
|
32
|
-
* apiKeyEnv: ACME_GATEWAY_API_KEY
|
|
33
|
-
* api: openai-completions
|
|
34
|
-
* baseURL: https://gateway.acme.example/v1
|
|
35
|
-
* # Reasoning dialect for a URL pi-ai cannot recognize.
|
|
36
|
-
* compat:
|
|
37
|
-
* thinkingFormat: deepseek
|
|
38
|
-
* models:
|
|
39
|
-
* - id: acme-large
|
|
40
|
-
* name: Acme Large
|
|
41
|
-
* contextWindow: 65536
|
|
42
|
-
* maxTokens: 4096
|
|
43
|
-
* - id: acme-think
|
|
44
|
-
* name: Acme Think
|
|
45
|
-
* contextWindow: 262144
|
|
46
|
-
* maxTokens: 32768
|
|
47
|
-
* # key = selectable level, value = wire spelling; only off may
|
|
48
|
-
* # leave the value empty (supported, send nothing).
|
|
49
|
-
* reasoningEfforts:
|
|
50
|
-
* off:
|
|
51
|
-
* high: high
|
|
52
|
-
* max: ultra
|
|
53
|
-
* ```
|
|
54
|
-
*
|
|
55
|
-
* @module @deepseek-ai/dsh-llm-pi-ai
|
|
56
|
-
*/
|
|
57
1
|
import type { Context } from '@deepseek-ai/cordis';
|
|
58
2
|
import { Config } from './config.ts';
|
|
59
3
|
export { PiAiAdapter } from './adapter.ts';
|
|
60
4
|
export type { PiAiAdapterOptions } from './adapter.ts';
|
|
61
5
|
export { Config } from './config.ts';
|
|
62
|
-
export type { PiAiCompatProfile, PiAiModality, PiAiModelOverride, PiAiModelProfile, PiAiProviderProfile, PiAiReasoningEfforts, PiAiThinkingFormat, ResolvedPiAiProviderProfile, } from './config.ts';
|
|
6
|
+
export type { Options, PiAiCompatProfile, PiAiModality, PiAiModelOverride, PiAiModelProfile, PiAiProviderProfile, PiAiReasoningEfforts, PiAiThinkingFormat, ResolvedPiAiProviderProfile, } from './config.ts';
|
|
63
7
|
export { recordKeyFor } from './auth.ts';
|
|
64
8
|
export { supportedProtocols } from './provider.ts';
|
|
65
9
|
export declare const name = "llm-pi-ai";
|
package/lib/types/replay.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @module dsh-llm-pi-ai/replay
|
|
9
9
|
*/
|
|
10
|
-
import type {
|
|
10
|
+
import type { AssistantMessage as HarnessAssistantMessage, ReplayEnvelope } from '@deepseek-ai/dsh-llm';
|
|
11
11
|
import type { Api, AssistantMessage } from '@earendil-works/pi-ai';
|
|
12
12
|
/** Per-block half of the pi-ai replay envelope, one entry per content block. */
|
|
13
13
|
export type PiAiReplayBlock = {
|
|
@@ -54,10 +54,10 @@ export declare function toPiReplayState(message: AssistantMessage, requestedMode
|
|
|
54
54
|
* another adapter's kind, another version, a malformed value, or metadata that
|
|
55
55
|
* no longer matches the content — therefore degrades the one message to
|
|
56
56
|
* provider-neutral history instead of failing the request.
|
|
57
|
-
* @param message - assistant content with
|
|
57
|
+
* @param message - model-produced assistant content with provider, model, and optional adapter-owned replay metadata.
|
|
58
58
|
* @param onDegrade - called with the diagnostic reason when an unusable replay
|
|
59
59
|
* state falls back to provider-neutral conversion.
|
|
60
60
|
* @returns a native pi-ai assistant message reconstructed from durable content.
|
|
61
61
|
*/
|
|
62
|
-
export declare function toPiAssistant(message:
|
|
62
|
+
export declare function toPiAssistant(message: HarnessAssistantMessage, onDegrade?: (reason: string) => void): AssistantMessage;
|
|
63
63
|
//# sourceMappingURL=replay.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-llm-pi-ai",
|
|
3
3
|
"description": "pi-ai-backed DeepSeek adapter for the DeepSeek Harness LLM seam (design-verification twin of dsh-llm-deepseek)",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.7-alpha.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -27,33 +27,39 @@
|
|
|
27
27
|
],
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@deepseek-ai/cordis": "
|
|
31
|
-
"@deepseek-ai/dsh-attachment": "
|
|
32
|
-
"@deepseek-ai/dsh-authorization": "
|
|
33
|
-
"@deepseek-ai/dsh-credentials": "
|
|
34
|
-
"@deepseek-ai/dsh-
|
|
35
|
-
"@deepseek-ai/dsh-
|
|
36
|
-
"@deepseek-ai/dsh-
|
|
37
|
-
"@deepseek-ai/dsh-
|
|
38
|
-
"@deepseek-ai/
|
|
30
|
+
"@deepseek-ai/cordis": "~4.0.4",
|
|
31
|
+
"@deepseek-ai/dsh-attachment": "0.1.7-alpha.2",
|
|
32
|
+
"@deepseek-ai/dsh-authorization": "0.1.7-alpha.2",
|
|
33
|
+
"@deepseek-ai/dsh-credentials": "0.1.7-alpha.2",
|
|
34
|
+
"@deepseek-ai/dsh-fs": "0.1.7-alpha.2",
|
|
35
|
+
"@deepseek-ai/dsh-launch-environment": "0.1.7-alpha.2",
|
|
36
|
+
"@deepseek-ai/dsh-llm": "0.1.7-alpha.2",
|
|
37
|
+
"@deepseek-ai/dsh-timeout": "0.1.7-alpha.2",
|
|
38
|
+
"@deepseek-ai/cordis-plugin-loader": "~1.0.5"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@earendil-works/pi-ai": "^0.85.1",
|
|
42
|
-
"@deepseek-ai/dsh-
|
|
43
|
-
"@deepseek-ai/dsh-
|
|
44
|
-
"@deepseek-ai/schemastery": "
|
|
42
|
+
"@deepseek-ai/dsh-util-values": "0.1.7-alpha.2",
|
|
43
|
+
"@deepseek-ai/dsh-brand": "0.1.7-alpha.2",
|
|
44
|
+
"@deepseek-ai/schemastery": "~3.18.4"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@deepseek-ai/
|
|
48
|
-
"@deepseek-ai/dsh-
|
|
49
|
-
"@deepseek-ai/
|
|
50
|
-
"@deepseek-ai/dsh-credentials": "
|
|
51
|
-
"@deepseek-ai/dsh-
|
|
52
|
-
"@deepseek-ai/dsh-
|
|
53
|
-
"@deepseek-ai/dsh-llm": "
|
|
54
|
-
"@deepseek-ai/dsh-
|
|
55
|
-
"@deepseek-ai/dsh-
|
|
56
|
-
"@deepseek-ai/dsh-
|
|
57
|
-
"@deepseek-ai/
|
|
47
|
+
"@deepseek-ai/dsh-attachment": "0.1.7-alpha.2",
|
|
48
|
+
"@deepseek-ai/dsh-authorization": "0.1.7-alpha.2",
|
|
49
|
+
"@deepseek-ai/cordis": "~4.0.4",
|
|
50
|
+
"@deepseek-ai/dsh-credentials": "0.1.7-alpha.2",
|
|
51
|
+
"@deepseek-ai/dsh-launch-environment": "0.1.7-alpha.2",
|
|
52
|
+
"@deepseek-ai/dsh-llm": "0.1.7-alpha.2",
|
|
53
|
+
"@deepseek-ai/dsh-llm-deepseek": "0.1.7-alpha.2",
|
|
54
|
+
"@deepseek-ai/dsh-fs": "0.1.7-alpha.2",
|
|
55
|
+
"@deepseek-ai/dsh-timeout": "0.1.7-alpha.2",
|
|
56
|
+
"@deepseek-ai/dsh-http-proxy": "0.1.7-alpha.2",
|
|
57
|
+
"@deepseek-ai/cordis-plugin-loader": "~1.0.5",
|
|
58
|
+
"@deepseek-ai/dsh-settings": "0.1.7-alpha.2"
|
|
59
|
+
},
|
|
60
|
+
"peerDependenciesMeta": {
|
|
61
|
+
"@deepseek-ai/cordis-plugin-loader": {
|
|
62
|
+
"optional": true
|
|
63
|
+
}
|
|
58
64
|
}
|
|
59
65
|
}
|