k2f_sdk 0.1.0

K2F agent Document/Editor SDK
docs.rs failed to build k2f_sdk-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.

k2f_sdk

Agent-facing Rust SDK for building and editing .K2F documents.

  • Document — create semantic trees, compile locks, save packages, export PDF
  • Editor — open packages, edit by stable node id, diff/outline, suggestions
  • Markdown bridgemarkdown_to_k2f / k2f_to_markdown
  • Signing — Ed25519 key generation and sign

License: Apache-2.0

Quick example

use k2f_sdk::{Document, Editor, PageSize, Theme};

let mut doc = Document::new("Report", PageSize::A4, Theme::parse("report").unwrap());
doc.add_heading("root.title", "Quarterly update", 1)?;
doc.add_body("root.body", "Revenue increased.")?;
let bytes = doc.save_bytes()?;

let mut editor = Editor::open(&bytes)?;
editor.replace_text("root.body", "Revenue increased sharply.")?;
let updated = editor.save_bytes()?;

Agent authoring profile

Agents should follow the dialect in instructions/agent_v0.md (also exposed as k2f_sdk::SYSTEM_PROMPT).

Public format contract: k2f-v0.1.md.

Install

cargo add k2f_sdk
# CLI: cargo install k2f