kcode-k1-chat-thread-web-code-errors 0.1.0

Pure model-facing error outputs for K1 Chat Web-code tasks
Documentation
1
2
3
4
5
6
7
8
9
# kcode-k1-chat-thread-web-code-errors

This crate provides three pure error-output constructors:

- `service_error(tool_call_id, operation, service_error)` maps each `ServiceFailure` variant to its stable code: `state`, `authorization`, `workspace_denied`, `source_unavailable`, `language_required`, `language_mismatch`, `foreign_handle`, `stale_source`, `invalid_document`, `check_failed`, `source_preservation`, `public_release_denied`, `publication`, or `dependency`.
- `error(tool_call_id, operation, code, message, source_object)` constructs an error `WebCodeOutput` with the supplied code, message, and optional source object.
- `simple_error(tool_call_id, operation, code)` constructs an error using `code` and its underscore-to-space text.

The constructors have no service effects. Output construction performs linear allocation relative to the produced text and metadata.