Versions in this module Expand all Collapse all v0 v0.32.3 Jun 18, 2026 Changes in this version + var ErrManifestMismatch = errors.New("contextasm: context manifest mismatch") + func AssembleContext(segs []Segment) (prompt string, stablePrefixHash string) + func HashBytes(b []byte) string + func HashString(s string) string + func HashTokenIDs(tokens []int) string + func NewManifestMismatchError(reason string) error + type CacheClass int + const ClassRepoMap + const ClassTaskPinned + const ClassVolatile + func (c CacheClass) MoreEvictableThan(other CacheClass) bool + func (c CacheClass) Tag() string + type ContextManifest struct + AddBOS bool + Backend string + BackendVersion string + ModelDigest string + ProfileID string + PromptFormat string + PromptTemplateDigest string + RuntimeDigest string + Segments []ManifestSegment + StableByteHash string + StableBytes int + StableTokenHash string + TotalBytes int + VolatileTokenHash string + func AssembleManifest(segs []Segment, id ManifestIdentity) (prompt string, manifest ContextManifest) + func (m ContextManifest) CompatibleRuntime(next ContextManifest) (bool, string) + func (m ContextManifest) Digest() string + func (m ContextManifest) IsZero() bool + func (m ContextManifest) ValidateSplitTokenization(stableText, suffixText string, stableTokens, suffixTokens []int, ...) error + func (m ContextManifest) WithStableTokenHash(tokenHash string) ContextManifest + func (m ContextManifest) WithStableTokenization(stableText string, tokens []int, tokenize TokenizeFunc, addBOS bool) (ContextManifest, error) + func (m ContextManifest) WithVolatileTokenization(stable ContextManifest, prefixTokens int, suffixText string, tokens []int, ...) (ContextManifest, error) + type ManifestIdentity struct + AddBOS bool + Backend string + BackendVersion string + ModelDigest string + ProfileID string + PromptFormat string + PromptTemplateDigest string + RuntimeDigest string + type ManifestMismatchError struct + Reason string + func (e *ManifestMismatchError) Error() string + func (e *ManifestMismatchError) Is(target error) bool + type ManifestSegment struct + ByteEnd int + ByteHash string + ByteStart int + CacheClass string + Invalidation string + Kind string + Stable bool + TokenEnd int + TokenHash string + TokenStart int + ToolCallID string + ToolCallsJSON string + type Segment struct + Content string + Kind SegmentKind + type SegmentKind int + const KindDiff + const KindPinned + const KindRepoMap + const KindRepoRules + const KindSystem + const KindTerminal + const KindTools + const KindUserTurn + func (k SegmentKind) CacheClass() CacheClass + func (k SegmentKind) Tag() string + type TokenizeFunc func(text string, addSpecial bool) ([]int, error)