Skip to content

v0.2.0

@nshkrdotcom nshkrdotcom tagged this 08 Feb 03:04
Typed management models:
- Add ThreadSummary, PermissionRule, MCPServer structs in
  management_types.ex with enforced keys and full typespecs
- ThreadSummary parsed from CLI table output via regex with
  visibility atom coercion and message count integers
- PermissionRule and MCPServer parsed from CLI --json output
  via Jason with reduce_while error propagation

List API changes:
- threads_list/1 now returns {:ok, [%ThreadSummary{}]} by parsing
  the columnar CLI table, dropping header and separator lines
- permissions_list/1 now passes --json to CLI and returns
  {:ok, [%PermissionRule{}]} with typed fields
- mcp_list/1 now always requests --json and returns
  {:ok, [%MCPServer{}]} with normalized command/args/url fields
- All three list functions accept keyword opts with zero-arity
  wrappers preserved via defaults

Raw output accessors:
- Add threads_list_raw/1, permissions_list_raw/1, mcp_list_raw/1
  returning plain CLI string output for callers that need it
- Delegate through AmpSdk facade with specs

Parsing infrastructure:
- Thread table parser handles empty output, "no " prefixed lines,
  Unicode separator detection, and header row stripping
- JSON list parsers share decode_json_list/2 pattern with
  parse_error wrapping for non-list JSON and decode failures
- MCP parser normalizes optional string fields and args lists
  with atom/string key fallback via fetch/2

Tests:
- Add management_typed_test.exs with CLI stub outputting fixture
  data for threads table parsing, permissions JSON, MCP JSON,
  raw output preservation, and parse_error paths
- Update management_options_test mcp_list to supply JSON fixture
- Update live_test threads_list assertion for struct returns
- Update modules_test with new list/list_raw arity exports

Docs:
- Update CHANGELOG, README, guides, and examples to use typed
  list APIs as primary path with raw variants documented
- Bump version to 0.2.0 in mix.exs, README, getting-started
Assets 2
Loading