kcode-k1-chat-chatend 0.8.2

Append-only open-format ChatBox state transitions for K1 chat
Documentation
1
2
3
4
5
6
7
8
9
10
11
# Open-format K1 Chatend 0.8.2

`kcode-k1-chat-chatend` owns append-only ordering and correlated tool lifecycles over canonical values from `kcode-k1-chat-boxes` 0.2.0. It 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 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.