Skip to content

feat(console,src-tauri): local "Config folder" setting (studio#128) - #130

Merged
brettchien merged 1 commit into
mainfrom
feat/config-folder-setting-128
Aug 29, 2026
Merged

feat(console,src-tauri): local "Config folder" setting (studio#128)#130
brettchien merged 1 commit into
mainfrom
feat/config-folder-setting-128

Conversation

@brettchien

Copy link
Copy Markdown
Contributor

Summary

Item 8 of #128's runbook. Adds a "Config folder" field to the Debug drawer's Config tab — a user-picked local directory (native folder picker via tauri-plugin-dialog) that later work will mirror each agent's generated config.toml into (<folder>/<agent-name>/config.toml, alongside the existing S3 upload — unchanged) and that the "view an agent's config" screen (separate follow-up, also #128) will read from directly, no S3 round-trip.

This slice is just the setting itself — plugin registration + capability grant + picker UI. Wiring the wizard/view-screen to actually use it lands with those pieces.

Change

  • src-tauri: tauri-plugin-dialog = "2" dependency + .plugin(tauri_plugin_dialog::init()) registration + dialog:allow-open capability grant in capabilities/default.json (had no dialog permission at all before this — would have been a silent runtime failure without it).
  • console: new "Config folder" section in the Config tab (index.html), wired in main.ts via invoke("plugin:dialog|open", { options: { directory: true } }) — checked the plugin's actual TypeScript source for the exact invoke command name, options shape, and return type (string | null for directory: true without multiple) rather than guessing. Persisted like the existing theme/log-level settings (localStorage), not Tauri's hidden app-config-dir — this setting points at other local files, so hiding it in the app-config-dir would just be indirection for no reason.

Verification

  • npm run typecheck clean, npm test 106/106 passing, npm run build succeeds.
  • Rust side not locally compiled — same pre-existing aws-sdk-ec2/no-macOS-libs limitation as every other Rust change this week.
  • Not visually/interactively checked in a running app — worth a quick look once merged, particularly whether the native folder picker actually opens (the capability grant is new ground for this app).

Ref #128.

🤖 Generated with Claude Code

Adds a "Config folder" field to the Debug drawer's Config tab — a
user-picked local directory (native folder picker via tauri-plugin-dialog)
that later work will mirror each agent's generated config.toml into
(<folder>/<agent-name>/config.toml, alongside the existing S3 upload
provision_agent/provision_agent_k8s already do — unchanged) and that the
"view an agent's config" screen (also studio#128, separate follow-up) will
read from directly, no S3 round-trip.

This slice is just the setting itself: plugin registration + capability
grant (dialog:allow-open — the app's capabilities/default.json had no
dialog permission at all before this) + picker UI, persisted like the
existing theme/log-level settings (localStorage), not Tauri's hidden
app-config-dir — this setting points at other local files, so storing it
in the hidden config dir would just be an extra layer of indirection.
Wiring the wizard/view-screen to actually use it lands with those pieces.

Verification: npm run typecheck clean, npm test 106/106 passing, npm run
build succeeds. Rust side (plugin registration, Cargo.toml) not locally
compiled — same pre-existing limitation as every other Rust change this
week; tauri-plugin-dialog's exact API (invoke command name
"plugin:dialog|open", options shape, return type for directory+non-multiple
mode) was checked against the plugin's actual TypeScript source before
using it, not guessed.

Ref #128.
@brettchien
brettchien merged commit 2701c8f into main Aug 29, 2026
2 checks passed
@brettchien
brettchien deleted the feat/config-folder-setting-128 branch August 29, 2026 08:31
brettchien added a commit that referenced this pull request Aug 29, 2026
…ly (studio#128) (#134)

Last item on #128's runbook. New Debug drawer tab, next to the existing
Activity/MCP/Config ones — lists agent names under the local "Config
folder" (#130) that have a config.toml, and shows the selected one's
content read-only.

Deliberately local-filesystem-only, no S3 (Brett: "forget about s3 now"):
list_local_agent_configs/read_local_agent_config are plain std::fs calls
in src-tauri, no sidecar/MCP tool involved at all, unlike everything else
added this batch — the local folder is Studio's own mirror the New Fleet
wizard writes alongside its S3 upload (still to be wired — the wizard
itself doesn't write here yet, this PR is just the read side), not a
read-through to the S3 source of truth. Whatever an admin agent (or the
wizard, once wired) writes into the same folder shows up on the next
Refresh / tab switch — reading a directory needs no separate sync
mechanism.

Agent names render via DOM construction (createElement + textContent),
not innerHTML string concatenation — they come from local directory
listings, not worth trusting as HTML even though the risk is low (Studio
itself controls what gets written there today).

Verification: npm run typecheck clean, npm test 100/100 passing, npm run
build succeeds. Rust side not locally compiled — same pre-existing
limitation as every other Rust change this week, though this one is lower
risk than most (plain std::fs, no new dependency, no capability grant
needed — custom commands aren't plugin-gated the way tauri-plugin-dialog
was in #130).

Ref #128 — this closes out the runbook's item list (the wizard→folder
write side is a natural follow-up once someone needs it, not blocking).
brettchien added a commit that referenced this pull request Aug 29, 2026
…35) (#136)

Closes the gap #134 flagged: the wizard generated config.toml server-side
but never wrote it into the operator's local Config folder (#130), so the
"Agent configs" view (#134) had nothing to show until something else
populated the folder by hand.

Brett's explicit ordering: "Wizard should write to local first, write to
s3 if needed." That ordering can only actually be guaranteed inside the
sidecar (oab-mcp) — provision_agent/provision_agent_k8s are what do the S3
upload, so writing the local copy there, before the upload, is a real
sequencing guarantee. Having the console write a local copy *after*
receiving the tool's response back would mean S3 had already happened
first no matter what, the opposite of what was asked — and was the
implementation this session's own earlier #135 write-up had assumed by
default, corrected here after asking Brett directly rather than guessing.

- studio-cp: new write_local_agent_config() — <folder>/<name>/config.toml,
  written from generate_agent_config()'s raw output *before*
  inject_pre_seed_hook mutates a copy for the S3/bundle path (the S3 zip
  URI hook injects is meaningless for a local reference copy). Both
  provision_agent and provision_agent_k8s gained a
  local_config_folder: Option<&str> parameter; write happens unconditionally
  whenever the caller passes one, hard-fails the whole deploy on a write
  error (folder set = a real requirement, not best-effort) rather than
  silently proceeding without the copy it promised.
- oab-mcp: deploy_provision_agent's schema gained local_config_folder
  (optional).
- src-tauri: bridge command threads the new param through.
- console: deploy.ts reads the same oab-studio.configFolder localStorage
  key the Config-folder setting (#130) already uses and sends it along.

This also resolves the mechanism question #135's own write-up had left
open (send config_toml back to console vs. have the sidecar write
directly) — the ordering requirement settles it: only the sidecar-writes
approach can guarantee local-before-S3, so no config.toml text (which
could contain secret *references*, if not raw values) needs to cross the
Tauri IPC bridge back to the console at all.

Ref #135.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant