@x1a0f3n9/dsh-attachment 0.1.5-alpha.2 → 0.1.5-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.i18n.yaml +2 -2
- package/README.md +2 -2
- package/README.zh.md +8 -8
- package/package.json +3 -3
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/attachment/attachment/README.md
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: 35fde71833fa13b26662244cfa68cec17b90b663
|
|
6
|
+
README.zh.md: b0e98d1e4a0c35082a8eef23f69659f47916d3f7
|
package/README.md
CHANGED
|
@@ -94,7 +94,7 @@ The service family runs one admission-and-storage flow: every entry point enforc
|
|
|
94
94
|
|
|
95
95
|
For the full service contract and payload types, read the subsystem reference; for the storage that backs this capability, read the local backend.
|
|
96
96
|
|
|
97
|
-
- [Attachment subsystem reference](../../../docs/subsystems/attachment.md) — service contract, payload types, and the `ctx.attachments`
|
|
97
|
+
- [Attachment subsystem reference](../../../docs/subsystems/attachment.md) — service contract, payload types, and the `ctx.attachments` Cordis surface.
|
|
98
98
|
- [Local filesystem backend](../attachment-local/README.md) — where your attached images are stored on this machine.
|
|
99
99
|
- [Capability seams](../../../docs/capability-seams.md) — how this capability family is split into roles.
|
|
100
100
|
|
|
@@ -114,7 +114,7 @@ Adding an image changes the provider request and therefore invalidates the affec
|
|
|
114
114
|
<a id="known-limitations-and-deferred-work"></a>
|
|
115
115
|
|
|
116
116
|
|
|
117
|
-
These limits describe what
|
|
117
|
+
These limits describe what attachments can and cannot do; they are current package constraints, not a task backlog.
|
|
118
118
|
|
|
119
119
|
- **Raster image limits apply to images only** — PNG, JPEG, WebP, and GIF are accepted as images under deployment limits; every other file is stored verbatim with no type or size limit, and audio and video have no dedicated handling yet.
|
|
120
120
|
- **Attachments are never deleted** — stored images and files are retained indefinitely; nothing removes them automatically.
|
package/README.zh.md
CHANGED
|
@@ -41,7 +41,7 @@ kind: "package-reference"
|
|
|
41
41
|
|
|
42
42
|
### 把附件传给命令
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
声明接受附件的命令会按选择顺序接收图片与通用文件。不接受附件的命令会返回错误,并保留输入区的草稿与附件卡。
|
|
45
45
|
|
|
46
46
|
### 在整个会话中复用图片
|
|
47
47
|
|
|
@@ -65,14 +65,14 @@ kind: "package-reference"
|
|
|
65
65
|
|
|
66
66
|
- **事件前完成规范化与持久化。** 每个源图都会在批次按序发布前完成准备与校验,因此会话日志绝不会引用部分完成或规范化失败的对象。
|
|
67
67
|
- **不可变且保留策略中立。** 对象一经发布即不可变;恢复和 fork 后的会话可能共享它们,因此引用感知的垃圾回收被推迟,而不是与任何单个会话的删除绑定。
|
|
68
|
-
- **读取时校验。**
|
|
68
|
+
- **读取时校验。** 读取在返回前把字节和元数据与记录的引用比对,请求投影还会完整解码缓存字节,因此缺失、损坏或被替换的对象不会通过校验。
|
|
69
69
|
- **角色无关的图片块。** `dsh-llm` 中的 `ImageBlock` 内容块携带 `ImageAttachmentRef`;提供方适配器以显式像素与字节预算把引用解析为确定性请求版本,执行文件系统则可以把不可变宿主对象映射为模型可读的进程路径。
|
|
70
70
|
- **按错误码路由。** `AttachmentError` 重新实现 `HarnessError` 的结构而不是继承它,因为基类位于 `dsh-llm`,而后者依赖本包;消费方用 `isAttachmentError` 识别错误并按 `code` 路由,绝不依赖原型链。
|
|
71
|
-
- **文件原样,图片规范化。**`saveFile` 提交已有字节数组,`saveFileStream` 以背压和取消语义提交有界分块,`readFileStream` 校验并返回有界分块,`fileHostPath` 定位存储对象供按需读取投影;两种文件写入路径都不设准入限制。图片路径保留其独立的规范化、限额与请求版本流水线。`dsh-llm` 中的 `FileBlock` 内容块承载 `FileAttachmentRef
|
|
71
|
+
- **文件原样,图片规范化。**`saveFile` 提交已有字节数组,`saveFileStream` 以背压和取消语义提交有界分块,`readFileStream` 校验并返回有界分块,`fileHostPath` 定位存储对象供按需读取投影;两种文件写入路径都不设准入限制。图片路径保留其独立的规范化、限额与请求版本流水线。`dsh-llm` 中的 `FileBlock` 内容块承载 `FileAttachmentRef`,请求组装会为每条路由将其投影为确定性的句柄文本。
|
|
72
72
|
|
|
73
73
|
### 服务操作
|
|
74
74
|
|
|
75
|
-
服务族运行同一条准入与存储流程:每个入口都强制执行源批次限制与规范 base64,在发布任何成员前准备提供方无关的规范化附件,再按输入顺序持久提交而不产生部分结果。Host
|
|
75
|
+
服务族运行同一条准入与存储流程:每个入口都强制执行源批次限制与规范 base64,在发布任何成员前准备提供方无关的规范化附件,再按输入顺序持久提交而不产生部分结果。Host 提示词消费方把有序文本、编码图片和已经解析的文件引用交给 `ctx.attachments.admitPromptContent()`;该方法持久化图片,并让文件引用原样通过。编码协议适配器调用 `ctx.attachments.admitEncodedFile()`,由该方法检查规范 base64 后委托给 `saveFile`;适配器通过 `ctx.attachments.isAttachmentError()` 识别附件错误。通用文件调用方可以用 `saveFile` 提交已有字节,或用 `saveFileStream` 提交有界异步字节源;两者返回相同的持久引用,`readFileStream` 则在有界读取过程中校验摘要与长度。`readImageRequest` 派生确定性的路由尺寸变体,其身份包含附件 id、变换版本、像素与字节预算及编码参数。纯函数导出 `requestImageDimensions` 会按总像素预算计算每个投影保持宽高比的尺寸,使提供方与请求定价共享同一套几何计算。`imageHostPath` 只向需要把该位置映射到执行环境的受信任同进程消费方暴露实现拥有的宿主位置。调用方组合有序批次,而实现负责管理压缩并发、缓存与 singleflight。读取、流式写入和投影保留调用方的取消语义。失败带有稳定且机器可读的错误码,运行时即可识别可由调用方修正的准入子集,让每个协议适配器映射自己的词汇;各操作的确切约定见 [`src/index.ts`](src/index.ts) 与 [`src/error.ts`](src/error.ts)。
|
|
76
76
|
|
|
77
77
|
### 源码地图
|
|
78
78
|
|
|
@@ -83,7 +83,7 @@ kind: "package-reference"
|
|
|
83
83
|
| [`src/admission.ts`](src/admission.ts) | 对编码图片和文件上传强制执行规范 base64 并委托存储 |
|
|
84
84
|
| [`src/error.ts`](src/error.ts) | `AttachmentError` 类与 `isImageAdmissionError` 运行时子集 |
|
|
85
85
|
| [`src/brand.ts`](src/brand.ts) | `AttachmentId` 带类型标记的不透明标识符 |
|
|
86
|
-
| — |
|
|
86
|
+
| — | 不发布运行时不变式伴生入口;这个无状态 seam 承载类型,实现则负责强制执行不可变存储检查。 |
|
|
87
87
|
|
|
88
88
|
</details>
|
|
89
89
|
|
|
@@ -94,7 +94,7 @@ kind: "package-reference"
|
|
|
94
94
|
|
|
95
95
|
完整的服务约定与载荷类型请看子系统参考;支撑这一能力的存储请看本地后端。
|
|
96
96
|
|
|
97
|
-
- [附件子系统参考](../../../docs/subsystems/attachment.zh.md)——服务约定、载荷类型与 `ctx.attachments` 的
|
|
97
|
+
- [附件子系统参考](../../../docs/subsystems/attachment.zh.md)——服务约定、载荷类型与 `ctx.attachments` 的 Cordis 接口面。
|
|
98
98
|
- [本地文件系统后端](../attachment-local/README.zh.md)——你的附加图片在本机上的存储位置。
|
|
99
99
|
- [能力 seam](../../../docs/capability-seams.zh.md)——本能力家族如何拆分为多个角色。
|
|
100
100
|
|
|
@@ -103,7 +103,7 @@ kind: "package-reference"
|
|
|
103
103
|
<a id="model-experience"></a>
|
|
104
104
|
## 模型体验
|
|
105
105
|
|
|
106
|
-
该包通过提供方适配器间接影响模型;适配器会把每个持久图片引用解析为确切请求版本,并在图片旁发送稳定附件 id
|
|
106
|
+
该包通过提供方适配器间接影响模型;适配器会把每个持久图片引用解析为确切请求版本,并在图片旁发送稳定附件 id 与实际尺寸。执行文件系统可以映射已存对象时,描述符还会包含只读进程路径,以及可写副本使用的匹配扩展名。通用文件的字节永远不会到达提供方:每条路由都收到一行确定性的句柄文本,指出文件名、字节数、摘要前缀,以及供文件工具读取的只读保存路径。
|
|
107
107
|
|
|
108
108
|
#### KV Cache 影响
|
|
109
109
|
|
|
@@ -134,6 +134,6 @@ kind: "package-reference"
|
|
|
134
134
|
|
|
135
135
|
#### 未来:音频、视频与助手侧输出
|
|
136
136
|
|
|
137
|
-
|
|
137
|
+
音频与视频需要原样文件路径之外的专门生命周期与提供方约定;角色无关的 `ImageBlock` 也为助手侧图片输出保留向前兼容空间——当前生产适配器声明只输出文本,因此只有用户内容携带图片。两个方向都尚未决定。
|
|
138
138
|
|
|
139
139
|
</details>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@x1a0f3n9/dsh-attachment",
|
|
3
3
|
"description": "Durable immutable attachment storage seam for the DeepSeek Harness",
|
|
4
|
-
"version": "0.1.5-
|
|
4
|
+
"version": "0.1.5-rc.3",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
],
|
|
33
33
|
"license": "MIT",
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@x1a0f3n9/dsh-brand": "^0.1.5-
|
|
35
|
+
"@x1a0f3n9/dsh-brand": "^0.1.5-rc.3",
|
|
36
36
|
"@deepseek-ai/cordis": "^4.0.2"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@x1a0f3n9/dsh-brand": "^0.1.5-
|
|
39
|
+
"@x1a0f3n9/dsh-brand": "^0.1.5-rc.3",
|
|
40
40
|
"@deepseek-ai/cordis": "^4.0.2"
|
|
41
41
|
}
|
|
42
42
|
}
|