kcode-k1-ktool-docs 0.1.2

Exact-name K1 Ktool contract metadata lookup
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# KtoolDocs consumer contract

The crate exposes exactly these public operations:

```rust
pub fn ktool_docs(arguments: &str) -> Result<String, String>
pub fn is_known_ktool(name: &str) -> bool
```

`ktool_docs` arguments must be JSON for an object containing exactly one field, `name`, whose value is a nonempty string. Missing, additional, duplicate, nonstring, or empty fields, nonobject values, and malformed JSON return `Err("invalid KtoolDocs arguments")`. The name is used without trimming and is matched exactly and case-sensitively. An unrecognized name returns `Err("unknown Ktool")` without echoing input or offering discovery information.

A successful lookup returns compact JSON with fields in this order: `name` (string), `latest_version` (string), `docs` (string), `deprecated` (boolean), and `replacement` (string or null). The 19 active catalog entries use contract version `1.0.0`, are not deprecated, and have null replacements. `is_known_ktool` uses the same exact, case-sensitive catalog and performs no parsing or I/O.

The recognized names are `KtoolDocs`, `CurrentTime`, `KmapCreateNode`, `KmapOpenNode`, `KmapUpdateNode`, `KmapPenalizeNodes`, `KmapConnectNodes`, `SendMessage`, `WebSearch`, `SetLaunchNode`, `ListContacts`, `ListGroups`, `GetGroup`, `RustCodeCreate`, `RustCodeDocs`, `RustCodeOpen`, `RustCodeOverwrite`, `RustCodeCheck`, and `RustCodePublish`.

The operation is a stateless compiled-metadata lookup: it does not list, search, suggest, authorize, register, inspect a filesystem or Kmap, use a network, or prove that a named tool is live. Lookup is linear in the small compiled catalog and response length and performs no I/O.