@deepseek-ai/dsh-sdk-protocol 0.1.1-rc.2 → 0.1.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 +2 -2
- package/README.md +97 -10
- package/README.zh.md +98 -11
- package/lib/types/index.d.ts +1 -1
- package/lib/types/types.d.ts +14 -2
- package/package.json +11 -11
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/sdk/protocol/README.md
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: 0bfdcc09c9d7835e7e1276d654c3563b705c16cd
|
|
6
|
+
README.zh.md: 84759bf945400d7541226e0ade8d600f6f4c62ab
|
package/README.md
CHANGED
|
@@ -1,18 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "The SDK wire protocol for client and server implementers: the newline-delimited JSON-RPC transport and the named request, result, and notification types spoken between a Harness runtime and its SDK clients."
|
|
3
|
+
kind: "package-library"
|
|
4
|
+
---
|
|
5
|
+
|
|
1
6
|
# @deepseek-ai/dsh-sdk-protocol
|
|
2
7
|
|
|
3
8
|
English | [中文](README.zh.md)
|
|
4
9
|
|
|
5
|
-
|
|
10
|
+
## Summary
|
|
11
|
+
|
|
12
|
+
`dsh-sdk-protocol` lets a DeepSeek Harness runtime and its SDK clients exchange JSON-RPC 2.0 messages over newline-delimited byte streams: one transport class plus the named request, result, and notification types both wire ends speak. The serving side is the [`dsh-sdk-jsonrpc-server`](../server/README.md) plugin; the clients are the TypeScript [`dsh-sdk-client`](../client/README.md) and the [Python SDK](../../../python/README.md), which mirrors these shapes without importing them. Use this package when you implement or debug a wire end: framing rules, method names, payload types, and error semantics all live here. It is a pure library — no plugin, no configuration, no registrations.
|
|
13
|
+
|
|
14
|
+
## Table of Contents
|
|
15
|
+
|
|
16
|
+
- [Use this package](#use-this-package)
|
|
17
|
+
- [Understand the implementation](#understand-the-implementation)
|
|
18
|
+
- [Further Exploration](#further-exploration)
|
|
19
|
+
- [Model Experience](#model-experience)
|
|
20
|
+
- [Known Limitations and Deferred Work](#known-limitations-and-deferred-work)
|
|
21
|
+
- [Dev Note](#dev-note)
|
|
6
22
|
|
|
7
|
-
|
|
23
|
+
-----
|
|
8
24
|
|
|
9
|
-
|
|
25
|
+
<a id="use-this-package"></a>
|
|
26
|
+
## Use this package
|
|
10
27
|
|
|
11
|
-
|
|
28
|
+
Use this package when you build or debug an SDK wire end — the serving plugin, a client library, or custom tooling that speaks the SDK protocol. It gives you one transport for JSON-RPC 2.0 over caller-owned byte streams and the typed shapes for every SDK method and notification.
|
|
12
29
|
|
|
13
|
-
|
|
30
|
+
### Framing and transport
|
|
14
31
|
|
|
15
|
-
|
|
32
|
+
Wire one JSON-RPC 2.0 message per `\n`-terminated line over byte streams you own. A frame with both `id` and `method` is a request, `id` alone is a response, and `method` alone is a notification; malformed lines are ignored. Requests with no registered handler answer `-32601`, handler failures answer `-32603`, and error responses reject the pending request with `JsonRpcResponseError`, which preserves the wire `code` and optional `data`. `start()` attaches stream listeners and `close()` detaches them and rejects pending requests without destroying the streams.
|
|
33
|
+
|
|
34
|
+
### The SDK methods
|
|
35
|
+
|
|
36
|
+
Both wire ends share one method set: three client-to-server requests and four server-to-client notifications.
|
|
37
|
+
|
|
38
|
+
| Direction | Method | Payload types |
|
|
16
39
|
|---|---|---|
|
|
17
40
|
| client→server | `initialize` | `InitializeParams` → `InitializeResult` |
|
|
18
41
|
| client→server | `session/prompt` | `SessionPromptParams` → `SessionPromptResult` (durable enqueue receipt) |
|
|
@@ -22,11 +45,60 @@ The shared wire protocol for the DeepSeek Harness SDK runtime: one newline-delim
|
|
|
22
45
|
| server→client | `subagent.started` | `SubagentStartedNotification` |
|
|
23
46
|
| server→client | `subagent.finished` | `SubagentFinishedNotification` (in-process runs only) |
|
|
24
47
|
|
|
25
|
-
`HarnessSdkRequestMap` and `HarnessSdkNotificationMap` index these by method name
|
|
48
|
+
`HarnessSdkRequestMap` and `HarnessSdkNotificationMap` index these shapes by method name; the package root exports them together with the transport.
|
|
49
|
+
|
|
50
|
+
### Payload semantics
|
|
51
|
+
|
|
52
|
+
`SessionPromptResult.messageId` identifies the queued user message; it does not identify a later assistant message, turn ending, or prompt result. `SdkPromptContentBlock` accepts ordinary durable content plus `SdkEncodedImageBlock { type: "image", data, mimeType }`; the server converts encoded images to durable references before enqueue. `InitializeParams.reasoningEffort` is an optional non-empty adapter-owned identifier for the selected provider/model route; omission preserves that model's default. `InitializeParams.maxTokens` is an optional positive safe integer that caps each conversation-model output for SDK-created agents and their in-process descendants; omission lets the selected adapter's exact-model default apply. The server resolves the exact route during initialization and rejects `session/prompt` until that handshake succeeds, so a missing adapter, unavailable model, or unsupported effort cannot fall back to constructor defaults. `SubagentFinishedNotification.lastAssistantMessage` carries the child's last non-empty assistant message, or its accumulated assistant text when no such message exists; the field is absent when the child produced neither. `serverInfo.name` stays the wire-stable `deepseek-harness-sdk-runtime`. Notification payloads depend on `SessionEvent` (`dsh-session`), `ContentBlock` (`dsh-llm`), and `SubagentStopReason` (`dsh-subagent`), so the session vocabulary is part of the wire contract.
|
|
53
|
+
|
|
54
|
+
-----
|
|
55
|
+
|
|
56
|
+
<a id="understand-the-implementation"></a>
|
|
57
|
+
## Understand the implementation
|
|
58
|
+
|
|
59
|
+
<details>
|
|
60
|
+
<summary>Implementation internals — click to expand</summary>
|
|
61
|
+
|
|
62
|
+
This section explains the design behind the wire library; the observable behavior is fully covered in [Use this package](#use-this-package).
|
|
63
|
+
|
|
64
|
+
### Design concept
|
|
65
|
+
|
|
66
|
+
The package is built on one separation: a single newline-delimited transport class shared by both wire ends, and named types that index the protocol methods. The package root is the only import surface — source modules are not exported as deep imports. It is a pure library with no plugin, config, or registration; the serving plugin and the clients own all behavior around it.
|
|
67
|
+
|
|
68
|
+
### Source map
|
|
26
69
|
|
|
70
|
+
| File | Role |
|
|
71
|
+
|---|---|
|
|
72
|
+
| [`src/transport.ts`](src/transport.ts) | `JsonRpcLineTransport`: line framing, request/response/notification dispatch, error mapping, pending-request bookkeeping |
|
|
73
|
+
| [`src/types.ts`](src/types.ts) | Named request/result and notification payload types, indexed by method |
|
|
74
|
+
| [`src/index.ts`](src/index.ts) | Consumer interface: the transport and the named wire types |
|
|
75
|
+
| [`src/invariant.ts`](src/invariant.ts) | Invariant companion (no runtime invariant — a pure wire library owns no event stream) |
|
|
76
|
+
|
|
77
|
+
### Frame dispatch
|
|
78
|
+
|
|
79
|
+
Incoming lines are parsed one at a time: a frame with `id` and `method` is answered through the request handler (or `-32601`), a frame with `id` alone resolves the matching pending request (an error frame rejects it with `JsonRpcResponseError`), and a frame with `method` alone is handed to the notification handler. `start()` attaches the input listeners; `close()` detaches them and fails every pending request without destroying the streams.
|
|
80
|
+
|
|
81
|
+
</details>
|
|
82
|
+
|
|
83
|
+
-----
|
|
84
|
+
|
|
85
|
+
<a id="further-exploration"></a>
|
|
86
|
+
## Further Exploration
|
|
87
|
+
|
|
88
|
+
Read these pages when the wire contract is not enough. They move from the serving plugin to the clients and the runnable application.
|
|
89
|
+
|
|
90
|
+
- [JSON-RPC serving plugin](../server/README.md) — the runtime plugin that serves this protocol over stdio.
|
|
91
|
+
- [TypeScript SDK client](../client/README.md) — the client that drives this protocol.
|
|
92
|
+
- [Python SDK](../../../python/README.md) — the Python counterpart that mirrors these shapes.
|
|
93
|
+
- [SDK application bundle](../../bundle/sdk-app/README.md) — the `dsh --profile sdk` application that boots the server.
|
|
94
|
+
- [TypeScript SDK and SDK subagent backend decision](../../../.agents/notes/implemented/feature/2026-07-27-typescript-sdk-and-sdk-subagent-backend.md) — the client contract this protocol serves.
|
|
95
|
+
|
|
96
|
+
-----
|
|
97
|
+
|
|
98
|
+
<a id="model-experience"></a>
|
|
27
99
|
## Model Experience
|
|
28
100
|
|
|
29
|
-
None, as this
|
|
101
|
+
None, as this is a client-facing wire library; the runtime plugins behind the serving entry own all model-facing behavior.
|
|
30
102
|
|
|
31
103
|
#### KV Cache effect
|
|
32
104
|
|
|
@@ -34,6 +106,21 @@ None; this package neither assembles nor sends a provider request.
|
|
|
34
106
|
|
|
35
107
|
## Known Limitations and Deferred Work
|
|
36
108
|
|
|
109
|
+
<a id="known-limitations-and-deferred-work"></a>
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
These limits define what the protocol does not cover or promise. They are current package constraints, not a comparison with other wire formats or a task backlog.
|
|
113
|
+
|
|
37
114
|
- **No protocol-version negotiation** — the handshake carries only `serverInfo.version` (`0.0.1`, unvalidated by clients); pre-release stance, no compatibility promise.
|
|
38
|
-
- **No cancel or session-close methods** — a client abandons a turn by closing the runtime process; see the [
|
|
39
|
-
- **Server→client requests are dead capability** — the transport supports them, but the server never sends one; the Python SDK's responder surface exists for future approval flows.
|
|
115
|
+
- **No cancel or session-close methods** — a client abandons a turn by closing the runtime process; see the [JSON-RPC serving plugin](../server/README.md).
|
|
116
|
+
- **Server→client requests are a dead capability** — the transport supports them, but the server never sends one; the Python SDK's responder surface exists for future approval flows.
|
|
117
|
+
|
|
118
|
+
<a id="dev-note"></a>
|
|
119
|
+
### Dev Note
|
|
120
|
+
|
|
121
|
+
<details>
|
|
122
|
+
<summary>Working context for maintainers — click to expand</summary>
|
|
123
|
+
|
|
124
|
+
This Dev Note is working context for maintainers and is explicitly non-authoritative — shipped behavior and limits live in the sections above and in the code. This protocol's shapes are mirrored (not imported) by the Python SDK, so changing a method, payload, or the wire-stable `serverInfo.name` here requires updating the Python counterpart and the TypeScript client in the same change. No other unresolved design questions are recorded.
|
|
125
|
+
|
|
126
|
+
</details>
|
package/README.zh.md
CHANGED
|
@@ -1,39 +1,126 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "面向客户端与服务端实现者的 SDK 协议格式说明:Harness 运行时与其 SDK 客户端之间使用的按换行分帧 JSON-RPC 传输,以及具名的请求、结果与通知类型。"
|
|
3
|
+
kind: "package-library"
|
|
4
|
+
---
|
|
5
|
+
|
|
1
6
|
# @deepseek-ai/dsh-sdk-protocol
|
|
2
7
|
|
|
3
8
|
[English](README.md) | 中文
|
|
4
9
|
|
|
5
|
-
|
|
10
|
+
## 概述
|
|
11
|
+
|
|
12
|
+
`dsh-sdk-protocol` 让 DeepSeek Harness 运行时与其 SDK 客户端通过按换行分帧的字节流交换 JSON-RPC 2.0 消息:一个传输类,加上协议两端共同使用的具名请求、结果与通知类型。服务端是 [`dsh-sdk-jsonrpc-server`](../server/README.zh.md) 插件;客户端是 TypeScript 的 [`dsh-sdk-client`](../client/README.zh.md) 与 [Python SDK](../../../python/README.zh.md)(后者复现这些结构但不导入它们)。当你实现或调试协议某一端时使用本包:分帧规则、方法名、载荷类型与错误语义都在这里。它是纯库——无插件、无配置、无注册。
|
|
13
|
+
|
|
14
|
+
## 目录
|
|
15
|
+
|
|
16
|
+
- [使用本包](#use-this-package)
|
|
17
|
+
- [理解实现](#understand-the-implementation)
|
|
18
|
+
- [进一步探索](#further-exploration)
|
|
19
|
+
- [模型体验](#model-experience)
|
|
20
|
+
- [已知限制与延期工作](#known-limitations-and-deferred-work)
|
|
21
|
+
- [开发备注](#dev-note)
|
|
6
22
|
|
|
7
|
-
|
|
23
|
+
-----
|
|
8
24
|
|
|
9
|
-
|
|
25
|
+
<a id="use-this-package"></a>
|
|
26
|
+
## 使用本包
|
|
10
27
|
|
|
11
|
-
|
|
28
|
+
当你构建或调试 SDK 协议端——服务插件、客户端库或说该协议的自定义工具——时使用本包。它为你提供一个在调用方持有的字节流上承载 JSON-RPC 2.0 的传输,以及每个 SDK 方法与通知的类型化结构。
|
|
12
29
|
|
|
13
|
-
|
|
30
|
+
### 分帧与传输
|
|
14
31
|
|
|
15
|
-
|
|
32
|
+
在你拥有的字节流上,每个 `\n` 结尾的行承载一条 JSON-RPC 2.0 消息。同时带 `id` 与 `method` 的帧是请求,仅 `id` 是响应,仅 `method` 是通知;格式错误的行会被忽略。没有注册处理器的请求应答 `-32601`,处理器失败应答 `-32603`,错误响应会以 `JsonRpcResponseError` 拒绝挂起的请求,并保留协议中的 `code` 与可选 `data`。`start()` 挂接流监听器,`close()` 移除监听器并拒绝挂起请求,但不销毁流。
|
|
33
|
+
|
|
34
|
+
### SDK 方法
|
|
35
|
+
|
|
36
|
+
两个协议端共享同一套方法:三个客户端到服务端请求与四个服务端到客户端通知。
|
|
37
|
+
|
|
38
|
+
| 方向 | 方法 | 载荷类型 |
|
|
16
39
|
|---|---|---|
|
|
17
40
|
| client→server | `initialize` | `InitializeParams` → `InitializeResult` |
|
|
18
41
|
| client→server | `session/prompt` | `SessionPromptParams` → `SessionPromptResult`(持久入队回执) |
|
|
19
42
|
| client→server | `shutdown` | 无参数 → `{}` |
|
|
20
43
|
| server→client | `session.event` | `SessionEventNotification`(运行时内每个会话,不过滤) |
|
|
21
|
-
| server→client | `session.status` | `SessionStatusNotification`(整个 agent
|
|
44
|
+
| server→client | `session.status` | `SessionStatusNotification`(整个 agent 的 `running`/`idle` 转换) |
|
|
22
45
|
| server→client | `subagent.started` | `SubagentStartedNotification` |
|
|
23
46
|
| server→client | `subagent.finished` | `SubagentFinishedNotification`(仅进程内运行) |
|
|
24
47
|
|
|
25
|
-
`HarnessSdkRequestMap` 与 `HarnessSdkNotificationMap`
|
|
48
|
+
`HarnessSdkRequestMap` 与 `HarnessSdkNotificationMap` 按方法名索引这些结构;包根与传输一起导出它们。
|
|
49
|
+
|
|
50
|
+
### 载荷语义
|
|
51
|
+
|
|
52
|
+
`SessionPromptResult.messageId` 标识已排队的用户消息;它不标识后续的助手消息、轮次结束或提示词结果。`SdkPromptContentBlock` 接受普通持久内容以及 `SdkEncodedImageBlock { type: "image", data, mimeType }`;服务器在入队前把编码图像转换为持久引用。`InitializeParams.reasoningEffort` 是所选提供方/模型路由可选的非空适配器自有标识符;省略时保留该模型的默认值。`InitializeParams.maxTokens` 是可选的正安全整数,用于限制 SDK 创建的 agent 及其进程内后代的每次对话模型输出;省略时应用所选适配器的确切模型默认值。服务器会在初始化期间解析确切路由,并在握手成功前拒绝 `session/prompt`,因此缺少适配器、模型不可用或推理强度不受支持时,不会回退到构造期默认值。`SubagentFinishedNotification.lastAssistantMessage` 携带子 agent 最后一条非空 assistant 消息;若不存在这类消息,则携带其累积的 assistant 文本;子 agent 两种输出均未产生时,该字段缺省。`serverInfo.name` 的协议值固定为 `deepseek-harness-sdk-runtime`。通知载荷依赖 `SessionEvent`(`dsh-session`)、`ContentBlock`(`dsh-llm`)与 `SubagentStopReason`(`dsh-subagent`),因此会话词汇是协议格式约定的一部分。
|
|
53
|
+
|
|
54
|
+
-----
|
|
55
|
+
|
|
56
|
+
<a id="understand-the-implementation"></a>
|
|
57
|
+
## 理解实现
|
|
58
|
+
|
|
59
|
+
<details>
|
|
60
|
+
<summary>实现细节——点击展开</summary>
|
|
61
|
+
|
|
62
|
+
本节解释协议库背后的设计;可观察行为已在[使用本包](#use-this-package)中完整说明。
|
|
63
|
+
|
|
64
|
+
### 设计理念
|
|
65
|
+
|
|
66
|
+
本包建立在一个分离之上:两个协议端共用一个按换行分帧的传输类,以及按方法索引协议类型的具名类型。包根是唯一的导入面——源模块不支持深层导入。它是没有插件、配置或注册的纯库;服务插件与客户端负责其周围的一切行为。
|
|
67
|
+
|
|
68
|
+
### 源码地图
|
|
26
69
|
|
|
70
|
+
| 文件 | 职责 |
|
|
71
|
+
|---|---|
|
|
72
|
+
| [`src/transport.ts`](src/transport.ts) | `JsonRpcLineTransport`:行分帧、请求/响应/通知分发、错误映射、挂起请求记账 |
|
|
73
|
+
| [`src/types.ts`](src/types.ts) | 具名请求/结果与通知载荷类型,按方法索引 |
|
|
74
|
+
| [`src/index.ts`](src/index.ts) | 消费方接口:传输与具名协议类型 |
|
|
75
|
+
| [`src/invariant.ts`](src/invariant.ts) | 不变式配套插件(无运行时不变式——纯协议库不持有事件流) |
|
|
76
|
+
|
|
77
|
+
### 帧分发
|
|
78
|
+
|
|
79
|
+
入站行逐条解析:带 `id` 与 `method` 的帧通过请求处理器应答(或应答 `-32601`),仅 `id` 的帧结算匹配的挂起请求(错误帧以 `JsonRpcResponseError` 拒绝它),仅 `method` 的帧交给通知处理器。`start()` 挂接输入监听器;`close()` 移除它们并在不销毁流的情况下失败所有挂起请求。
|
|
80
|
+
|
|
81
|
+
</details>
|
|
82
|
+
|
|
83
|
+
-----
|
|
84
|
+
|
|
85
|
+
<a id="further-exploration"></a>
|
|
86
|
+
## 进一步探索
|
|
87
|
+
|
|
88
|
+
当协议约定不够用时阅读以下页面。它们从服务插件进入客户端与可运行应用。
|
|
89
|
+
|
|
90
|
+
- [JSON-RPC 服务插件](../server/README.zh.md) — 通过 stdio 服务该协议的运行时插件。
|
|
91
|
+
- [TypeScript SDK 客户端](../client/README.zh.md) — 驱动该协议的客户端。
|
|
92
|
+
- [Python SDK](../../../python/README.zh.md) — 复现这些结构的 Python 对侧实现。
|
|
93
|
+
- [SDK 应用组合包](../../bundle/sdk-app/README.zh.md) — 启动服务器的 `dsh --profile sdk` 应用。
|
|
94
|
+
- [TypeScript SDK 与 SDK subagent 后端决策](../../../.agents/notes/implemented/feature/2026-07-27-typescript-sdk-and-sdk-subagent-backend.zh.md) — 该协议所服务的客户端约定。
|
|
95
|
+
|
|
96
|
+
-----
|
|
97
|
+
|
|
98
|
+
<a id="model-experience"></a>
|
|
27
99
|
## 模型体验
|
|
28
100
|
|
|
29
|
-
|
|
101
|
+
无,因为这是面向客户端的协议库;模型可见行为归对外服务入口后方的运行时插件所有。
|
|
30
102
|
|
|
31
103
|
#### KV Cache 影响
|
|
32
104
|
|
|
33
105
|
无;此包既不组装也不发送提供方请求。
|
|
34
106
|
|
|
35
|
-
##
|
|
107
|
+
## 已知限制与延期工作
|
|
108
|
+
|
|
109
|
+
<a id="known-limitations-and-deferred-work"></a>
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
这些限制说明协议未覆盖或未承诺的内容。它们是当前包约束,不是与其他协议格式的对比或任务积压。
|
|
36
113
|
|
|
37
114
|
- **无协议版本协商**——握手只携带 `serverInfo.version`(`0.0.1`,客户端不校验);处于预发布阶段,无兼容承诺。
|
|
38
|
-
- **无取消与会话关闭方法**——客户端放弃轮次的方式是关闭运行时进程;见 [
|
|
115
|
+
- **无取消与会话关闭方法**——客户端放弃轮次的方式是关闭运行时进程;见 [JSON-RPC 服务插件](../server/README.zh.md)。
|
|
39
116
|
- **server→client 请求是未使用的功能**——传输层支持,但服务器从不发送;Python SDK 的应答接口为未来审批流程预留。
|
|
117
|
+
|
|
118
|
+
<a id="dev-note"></a>
|
|
119
|
+
### 开发备注
|
|
120
|
+
|
|
121
|
+
<details>
|
|
122
|
+
<summary>维护者的工作上下文——点击展开</summary>
|
|
123
|
+
|
|
124
|
+
本开发备注是维护者的工作上下文,明确不具权威性——已交付的行为与限制见上文各节与代码。本协议的各个结构由 Python SDK 复现(而非导入),因此在这里更改方法、载荷或协议稳定值 `serverInfo.name` 时,必须在同一次变更中更新 Python 对侧与 TypeScript 客户端。没有记录其他未解决的开放设计问题。
|
|
125
|
+
|
|
126
|
+
</details>
|
package/lib/types/index.d.ts
CHANGED
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
*/
|
|
10
10
|
export { JsonRpcLineTransport, JsonRpcResponseError } from './transport.ts';
|
|
11
11
|
export type { JsonRpcTransportPeer } from './transport.ts';
|
|
12
|
-
export type { HarnessSdkNotificationMap, HarnessSdkRequestMap, InitializeParams, InitializeResult, SdkRunStatus, SessionEventNotification, SessionStatusNotification, SessionPromptParams, SessionPromptResult, SubagentFinishedNotification, SubagentStartedNotification, } from './types.ts';
|
|
12
|
+
export type { HarnessSdkNotificationMap, HarnessSdkRequestMap, InitializeParams, InitializeResult, SdkEncodedImageBlock, SdkPromptContentBlock, SdkRunStatus, SessionEventNotification, SessionStatusNotification, SessionPromptParams, SessionPromptResult, SubagentFinishedNotification, SubagentStartedNotification, } from './types.ts';
|
|
13
13
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/types/types.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @module @deepseek-ai/dsh-sdk-protocol/types
|
|
9
9
|
*/
|
|
10
|
-
import type { ContentBlock } from '@deepseek-ai/dsh-llm';
|
|
10
|
+
import type { ContentBlock, ReasoningEffortId } from '@deepseek-ai/dsh-llm';
|
|
11
11
|
import type { SessionEvent } from '@deepseek-ai/dsh-session';
|
|
12
12
|
import type { SubagentStopReason } from '@deepseek-ai/dsh-subagent';
|
|
13
13
|
/** Parameters for the process-wide SDK handshake. */
|
|
@@ -18,6 +18,8 @@ export interface InitializeParams {
|
|
|
18
18
|
provider: string;
|
|
19
19
|
/** Model name every SDK-created agent runs on (the server may mount a fallback adapter; see `HarnessSdkJsonRpcServer.initialize`). */
|
|
20
20
|
model: string;
|
|
21
|
+
/** Optional adapter-owned reasoning effort for the selected provider/model route. */
|
|
22
|
+
reasoningEffort?: ReasoningEffortId;
|
|
21
23
|
/** Optional positive output-token cap inherited by SDK-created agents and their in-process descendants. */
|
|
22
24
|
maxTokens?: number;
|
|
23
25
|
}
|
|
@@ -34,8 +36,18 @@ export interface SessionPromptParams {
|
|
|
34
36
|
/** The SDK-side session id; an unknown id lazily creates the agent+session pair. */
|
|
35
37
|
sessionId: string;
|
|
36
38
|
/** The prompt content blocks, sent verbatim as the user message. */
|
|
37
|
-
contentBlocks:
|
|
39
|
+
contentBlocks: SdkPromptContentBlock[];
|
|
38
40
|
}
|
|
41
|
+
/** Inline raster input admitted into the runtime's durable attachment store. */
|
|
42
|
+
export interface SdkEncodedImageBlock {
|
|
43
|
+
type: 'image';
|
|
44
|
+
/** Canonical base64-encoded raster bytes. */
|
|
45
|
+
data: string;
|
|
46
|
+
/** Declared raster MIME type, verified during admission. */
|
|
47
|
+
mimeType: 'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif';
|
|
48
|
+
}
|
|
49
|
+
/** SDK prompt input: ordinary durable blocks plus inline images awaiting admission. */
|
|
50
|
+
export type SdkPromptContentBlock = ContentBlock | SdkEncodedImageBlock;
|
|
39
51
|
/** Durable enqueue receipt for one prompt. */
|
|
40
52
|
export interface SessionPromptResult {
|
|
41
53
|
/** Identity of the queued user message. */
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-sdk-protocol",
|
|
3
3
|
"description": "Shared wire protocol for the DeepSeek Harness SDK runtime: the newline-delimited JSON-RPC stdio transport and the named request, result, and notification types spoken between the runtime server and SDK clients",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.2-alpha.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -31,17 +31,17 @@
|
|
|
31
31
|
],
|
|
32
32
|
"license": "MIT",
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"@deepseek-ai/dsh-invariants": "^0.1.
|
|
35
|
-
"@deepseek-ai/dsh-session": "^0.1.
|
|
36
|
-
"@deepseek-ai/dsh-
|
|
37
|
-
"@deepseek-ai/
|
|
38
|
-
"@deepseek-ai/
|
|
34
|
+
"@deepseek-ai/dsh-invariants": "^0.1.2-alpha.2",
|
|
35
|
+
"@deepseek-ai/dsh-session": "^0.1.2-alpha.2",
|
|
36
|
+
"@deepseek-ai/dsh-subagent": "^0.1.2-alpha.2",
|
|
37
|
+
"@deepseek-ai/cordis": "^4.0.2",
|
|
38
|
+
"@deepseek-ai/dsh-llm": "^0.1.2-alpha.2"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@deepseek-ai/dsh-invariants": "^0.1.
|
|
42
|
-
"@deepseek-ai/dsh-llm": "^0.1.
|
|
43
|
-
"@deepseek-ai/dsh-session": "^0.1.
|
|
44
|
-
"@deepseek-ai/dsh-subagent": "^0.1.
|
|
45
|
-
"@deepseek-ai/cordis": "^4.0.
|
|
41
|
+
"@deepseek-ai/dsh-invariants": "^0.1.2-alpha.2",
|
|
42
|
+
"@deepseek-ai/dsh-llm": "^0.1.2-alpha.2",
|
|
43
|
+
"@deepseek-ai/dsh-session": "^0.1.2-alpha.2",
|
|
44
|
+
"@deepseek-ai/dsh-subagent": "^0.1.2-alpha.2",
|
|
45
|
+
"@deepseek-ai/cordis": "^4.0.2"
|
|
46
46
|
}
|
|
47
47
|
}
|