# Open-format K1 Chatend 0.8.3
`kcode-k1-chat-chatend` owns append-only ordering and correlated tool lifecycles over canonical values from compatible `kcode-k1-chat-boxes` 0.2.1. The dependency uses an ordinary compatible range rather than an exact pin. Chatend reexports those values and familiar open-string conventions, including distinct `Agent Response` and `Agent Message` types.
A round alternates generating and boundary phases. Starting or flushing a boundary promises the next BoxID for an `Agent Response`. A stage always appends that response, including empty text, then provider-generated `Agent Message` and Tool Call values in provider order. Active external arrivals remain unnumbered until a boundary flush, Done, or abort; they cannot take the promised response ID. Done appends its response before queued arrivals. Abort preserves queued arrivals without fabricating a response. Recovery is idle and requires contiguous IDs.
`append_preflight` is the sole idle batch append. It atomically appends ordered System Messages and typed Tool Calls without opening a round, returns the calls with their canonical BoxIDs, and rejects active rounds or duplicate ToolCallIds. It does not execute tools or decide when inference starts.
A Tool Message must reference an earlier call and its exact Call BoxID, use the next one-based message index, and precede the unique terminal Result. Tool Message v1 and additive Named Tool Message v2 share that metadata and lifecycle path; named messages retain their caller-supplied visible type and exact body. Tool Result v1 and v2 share the same correlation and uniqueness rules. Recognized malformed metadata, duplicate calls or results, wrong origins, message-index gaps, and messages after a Result fail transactionally. Unknown conventions and historical `Agent Message` values remain inert and unchanged.
This package does not own KTO durability, context visibility, inference scheduling, providers, persistence, migration, deployment, or process restart.