From 8b753b3243917adaa4650f132966ddfae3a60a6e Mon Sep 17 00:00:00 2001 From: "Orca (ecs-claude)" Date: Thu, 13 Aug 2026 23:24:03 +0800 Subject: [PATCH] =?UTF-8?q?feat(studio):=20edit=20fleets.toml=20in-app=20?= =?UTF-8?q?=E2=80=94=20CodeMirror=20TOML=20editor=20(ADR=20#19=20C)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The edit half of the config panel: the operator edits the raw fleets.toml in a CodeMirror TOML editor and saves; the change validates, persists, and hot-reloads without a restart. Completes declare(edit) → switch → observe → reconcile. - studio-cp: `read_bindings_text` / `write_bindings_atomic` (temp+rename) / `save_bindings_text` — validate the text parses BEFORE writing (a bad edit never lands on disk) and store bytes verbatim, so comments/layout survive with no format-preserving lib. Unit tests: round-trip, reject-invalid-without-write, missing-file-is-empty. - oab-mcp: `fleet_config` now also returns the raw `text`; new write tool `fleet_config_write { text }` validates + writes + hot-reloads (bindings moved behind an RwLock; the per-cluster resolved-config memo is cleared on write). Catalog is 10 tools. - src-tauri: `fleet_config_write` bridge command. - console: CodeMirror 6 TOML editor (StreamLanguage + legacy TOML mode) mounted imperatively in a section separate from the re-rendered panel, so switching fleets never wipes an open edit. "Edit config" opens it; Save calls the write tool and surfaces a parse error inline; Cancel discards. 1 new render test. Slice C of the config panel, stacked on the A+B view/switch slice. Editing is raw-text (operator chose a TOML editor over a structured form). Co-Authored-By: Claude Opus 4.8 --- console/index.html | 11 +++ console/package-lock.json | 160 ++++++++++++++++++++++++++++++++++++ console/package.json | 7 ++ console/src/fixtures.ts | 15 ++++ console/src/main.ts | 78 +++++++++++++++++- console/src/render.test.ts | 13 ++- console/src/render.ts | 1 + console/src/source.ts | 11 +++ console/src/styles.css | 71 ++++++++++++++++ console/src/types.ts | 3 + crates/oab-mcp/src/main.rs | 98 +++++++++++++++++----- crates/studio-cp/src/lib.rs | 81 ++++++++++++++++++ src-tauri/src/lib.rs | 25 ++++++ 13 files changed, 552 insertions(+), 22 deletions(-) diff --git a/console/index.html b/console/index.html index ad8254e..84f4aba 100644 --- a/console/index.html +++ b/console/index.html @@ -19,6 +19,17 @@
+