kcode-k1-chat-box 0.1.1

Immutable K1 chat boxes and current tool envelopes
Documentation
1
2
3
4
5
6
7
8
9
10
11
# K1 Chat Box 0.1.1

`kcode-k1-chat-box` owns the immutable five-field open `ChatBox` value and the current K1 tool Call and Result envelopes. A box preserves its `id`, `type`, `contents`, `hidden_type`, and `hidden_contents` strings exactly unless this crate constructs it.

Owners write hidden types `k1.tool-call/1.0.0` and `k1.tool-result/1.0.0`. Parsing recognizes the corresponding owned box type for any valid supported major-1 hidden-envelope SemVer. It requires and validates all 1.0 fields and ignores unknown optional JSON fields. A valid unsupported major version remains opaque, a malformed version after an owned hidden-type prefix fails closed, and unrelated box and hidden types remain opaque.

Owner-written hidden JSON is compact and deterministic. Calls contain `callId`, `tool`, `toolVersion`, and `arguments`; results contain `callId`, `originatingCallBoxId`, `tool`, `toolVersion`, `status`, and `data`, in that order. Arguments and data remain structured JSON values.

`ToolCallId` renders as `c1`, `c2`, and so on. Zero, leading zeroes, and overflow are invalid. A call's visible content is `Call ID: cN\nArgs: <JSON>` with `tool` first and exactly one ASCII space after every JSON colon and comma outside strings. Results use `ResultView` for one-line success, multiline success, or safe one-line error text.

This clean-slate package reads no legacy envelope, nonce, or sequence format and performs no migration. It owns no transcript ordering, scheduling, execution, persistence, correlation policy, or generic protocol registry.