KeepLost/harniverse--packages-attachment-attachment ↗★ 1

@deepseek-ai/dsh-attachment

持久不可变附件存储接缝,校验并原子提交图片字节。 定义附件存储抽象并返回引用,适合需要持久保存会话图片的集成场景。

套件
@deepseek-ai/dsh-attachment
相容性
待驗證
Harness 依賴範圍
workspace:^
Cordis 依賴範圍
workspace:^
版本
0.1.0-rc.5
授權
BSD-3-Clause
最近更新
2026年9月25日

同名套件的其他儲存庫

安裝

此插件尚未提供可驗證的 bundle,或相容性檢查未通過。請先閱讀倉庫說明。 閱讀完整 README ↗

@deepseek-ai/dsh-attachment

English | 中文

The durable attachment seam. ctx.attachments validates and atomically commits immutable image bytes, then returns a serializable ImageAttachmentRef; consumers never persist browser paths, object URLs, provider URLs, or base64 in session events.

Unsent composer images remain browser-owned temporary drafts. admitEncodedImages decodes canonical base64 command envelopes and sends them through saveImages; the batch operation applies this deployment's count, aggregate-byte, media-type, and per-image validation before its first durable write, then returns references in submission order. validateImage runs the same per-image admission policy without persisting, saveImage commits each accepted image before any model-visible session event is published, and readImage verifies the content-addressed object against its logged metadata. Callers may cancel readImage; implementations observe cancellation around backend and verification work and preserve it instead of translating it into a storage failure.

readImageRequest is an additive provider operation for a bounded, transient model-request version. Its policy controls total pixels and encoded bytes; the derived version carries a separate ImageVariantId and never changes the durable reference, source bytes, or Session event. Providers that do not implement request projection reject with ATTACHMENT_PROJECTION_UNSUPPORTED, so existing attachment consumers keep their original behavior.

Model Experience

Indirectly, through the role-neutral core ImageBlock and provider adapters that resolve its durable reference.

KV Cache effect

Adding an image changes the provider request and therefore invalidates the affected request suffix.

Known Limitations and Deferred Work

  • Version one accepts PNG, JPEG, WebP, and GIF only.
  • Retention and garbage collection are deferred because resumed and forked sessions may share immutable objects.
  • Generic files, audio, video, and persistent unsent drafts require separate lifecycle and provider contracts.