description: "Immutable append-only lists for projection state, with bounded append copying, insertion-order iteration, and Zod checkpoint validation."
English | 中文
dsh-chunked-list lets callers append values while retaining earlier list versions without copying the whole collection. Callers can iterate every value in insertion order and validate JSON checkpoints with their own value schema. The subagent catalog uses it for immutable projection state.
Use this list when an append-only collection needs immutable versions and JSON-compatible storage. An empty list is undefined; appending returns a new head without modifying existing nodes. The list shares stored values by reference, so callers must treat them as immutable.
import { appendChunkedList, iterateChunkedList } from '@deepseek-ai/dsh-chunked-list'
const first = appendChunkedList(undefined, 'first')
const second = appendChunkedList(first, 'second')
console.log([...iterateChunkedList(second)])
The example produces ['first', 'second']; first still contains only its original value. chunkedListSchema(valueSchema) validates JSON checkpoints and rejects unknown fields, invalid values, and empty or oversized chunks. Use .optional() on the schema when the containing field also permits an empty list. See the source contracts for the operations.
None, as this collection registers nothing model-facing.
Nothing here enters a model request, so provider cache reuse is unaffected.