openpencil/crates
Kayshen-X e51600f068 feat(mcp): set_active_axis_value tool — second write
Second MCP write tool, completing the variable + theme write
surface. Mirrors `cycle_active_axis_value` (which the
VariablesPanel chip click drives) but PINS the value rather than
cycles — LLM clients use it when they want to land on a specific
axis state ("switch to dark mode") instead of stepping through
options ("flip to whatever's next").

`crates/openpencil-shell-core/src/mcp/tools.rs`:
  - `SetActiveAxisValue { axes: BTreeMap<String, Vec<String>> }`
    snapshot. Mirrors `var_table.themes` keyed by axis name.
  - `set_active_axis_value_snapshot(doc)` factory.
  - `McpTool::call` validates:
      - Both `axis` and `value` args present
        (`MissingArgument` on omission).
      - Axis exists in the themes table (`ToolFailed`).
      - Value is in `themes[axis].values` (`InvalidArgument`,
        error message lists allowed values).
  - Returns `OkWithCommand(SetActiveAxisValue { axis, value })`.
    The McpCommand variant has existed since the write arch
    landed (0f09671a); `Document::apply_mcp_command` already
    routes it to `var_table.active_theme.insert`.
  - Re-validates at apply time so a stale snapshot can't slip
    an unauthorized value through (host applier rejects with
    `false`, which the stdio path demotes to Internal).

Tests (5 added, 319 shell-core total):
  - `set_active_axis_value_validates_args_and_returns_command`
    — happy path; OkWithCommand variant + correct payload.
  - `set_active_axis_value_errors_on_missing_args` — both args
    required, message names the missing one.
  - `set_active_axis_value_errors_on_unknown_axis` — ToolFailed
    + error names the axis.
  - `set_active_axis_value_errors_on_value_not_in_axis` —
    InvalidArgument; error message lists every allowed value.
  - `apply_mcp_command_routes_set_active_axis_value` —
    end-to-end happy path + the stale-state rejection branch
    (invalid value at apply time returns `false`).

MCP write tool surface now:
  - set_variable_color  (Color hex through var_table)
  - set_active_axis_value (theme axis through active_theme map)
  - insert_node, update_node_position, etc. land later — each
    extends `McpCommand` + the existing applier pattern.
2026-05-14 20:26:55 +08:00
..
anthropic-agent-sdk chore(crates): move vendored SDKs into workspace as forkable crates 2026-05-14 16:49:17 +08:00
copilot-sdk chore(crates): move vendored SDKs into workspace as forkable crates 2026-05-14 16:49:17 +08:00
openpencil-app feat(openpencil-app): skeleton crate (Stage F entry placeholder) 2026-05-03 22:05:00 +08:00
openpencil-desktop refactor(desktop): extract rotate-cursor builder into cursor_icon.rs 2026-05-14 17:38:16 +08:00
openpencil-shell-core feat(mcp): set_active_axis_value tool — second write 2026-05-14 20:26:55 +08:00
openpencil-shell-native feat(themes): axis chip click cycles to the next theme value 2026-05-14 19:39:37 +08:00
openpencil-shell-web feat(shell): export dialog + multi-format raster (PNG/JPEG/WEBP) + Property-panel preview 2026-05-14 14:02:52 +08:00
pen-codegen chore(workspace): cargo-deny 0.18 activation (Phase 1 Task 1.8 Step 6) 2026-05-03 23:05:00 +08:00
pen-core chore(workspace): cargo-deny 0.18 activation (Phase 1 Task 1.8 Step 6) 2026-05-03 23:05:00 +08:00
pen-engine chore(workspace): cargo-deny 0.18 activation (Phase 1 Task 1.8 Step 6) 2026-05-03 23:05:00 +08:00
pen-figma chore(workspace): cargo-deny 0.18 activation (Phase 1 Task 1.8 Step 6) 2026-05-03 23:05:00 +08:00
pen-types feat(pen-types): skeleton crate (bucket A) 2026-05-03 22:35:00 +08:00
wasm-libc-shim style(shell): cargo fmt --all (rustfmt-clean) 2026-05-10 18:47:33 +08:00
CLAUDE.md feat(shell): canonical .op loader + jian-core layout + visual fidelity pass 2026-05-14 09:26:08 +08:00