Commit graph

2 commits

Author SHA1 Message Date
184b0a786a port message, option, and error types
- Errors: single enum mirroring the Python SDK's exception hierarchy
  (CliNotFound, CliConnection, Process, JsonDecode, MessageParse). Each
  Python class becomes a variant; the Process variant carries exit code +
  optional captured stderr.

- Options: ClaudeAgentOptions as a plain struct with a builder. Covers the
  full subprocess-arg surface (system_prompt with String / PresetAppend /
  File forms, tools / allowed / disallowed, permission_mode, model and
  fallback, cwd / cli_path / settings, env, extra_args, effort, output_format,
  mcp_servers, fork_session, include_partial_messages, etc.). Deferred
  fields documented inline.

- Messages: ContentBlock enum (Text / Thinking / ToolUse / ToolResult /
  ServerToolUse / ServerToolResult / Unknown) with serde tag dispatch and
  an Unknown fallthrough for forward compatibility. Top-level Message enum
  uses a hand-written Deserialize that dispatches on the "type" tag so
  unrecognised top-level frames land in Message::Unknown with the raw JSON
  preserved (matches the Python SDK's "skip unknown" behaviour, but lets
  Rust callers introspect).

Unit tests cover roundtrip for the common shapes (assistant text +
thinking + tool_use, user with both string and structured content, result,
system, unknown top-level).
2026-05-14 08:03:24 -07:00
6af8273f98 scaffold the crate
Initial layout for an async Rust port of the Python claude-agent-sdk. Sets
up Cargo.toml on 2024 edition, MIT LICENSE matching the upstream Python SDK's
text with the Sulkta Coop copyright appended, a workspace .gitignore, and a
README laying out the v0.1 scope and the Python -> Rust mapping table.

No source modules yet — those land in the following commits.
2026-05-14 08:03:11 -07:00