kcode-k1-chat-codex-codec 0.5.0

Native Codex call wrapper validator and structured K1 provider-call codec
Documentation
1
2
3
4
5
6
7
8
9
10
11
# kcode-k1-chat-codex-codec 0.5.0

Concrete K1/Codex codec consumed by `kcode-k1-chat-thread-main-actor` under K1-CHAT-TOOL-ENVELOPE-001 r2.

## Public contract

`Codec` implements `kcode_k1_codex_adapter::BoxCodec`. Text history remains `BoxValue::History`. A native `call_ktool` call must carry its argument wrapper as a JSON string with exactly `name` (a string) and `arguments` (an object). It becomes `BoxValue::Call(Ok(kcode_k1_chat_chatend::ProviderCall))`: `tool` is the inner action name, `tool_version` is `1.0.0`, and `arguments` is the parsed object.

The codec accepts no wrapper extensions, no non-object inner arguments, and no inner `tool` property. The provider-native call ID is transport-private and is not represented in the provider call. Parsed object order is retained for later canonical envelope rendering. This crate neither assigns `cN` IDs nor builds visible Call boxes; Chatend owns assignment and chat-box renders visible envelopes.

`project` renders a `ChatBox` as `[Box <one-based ID> | <box type>]\n<contents>`. It preserves literal visible type and content, including future types, and omits hidden fields. Calls have no model text.