Commit 871e6ce
authored
feat(studio-cp,oab-mcp,src-tauri): add deploy_provision_agent (studio#128) (#129)
* feat(studio-cp,oab-mcp,src-tauri): add deploy_provision_agent (studio#128)
New Fleet wizard direction (Brett, this thread): drop the compose-library
Template/Overlay model, replace with a vendor + chat-platform + ACP flow
that composes config.toml directly. Confirmed earlier (#128 investigation)
that provision_manifest/provision_k8s don't require a Bundle produced by
compose_named — a hand-built Bundle{image_tag, files} works identically.
This PR adds the backend capability only (all 3 layers: MCP tool, Tauri
bridge, studio-cp core) — purely additive, doesn't touch the existing
deploy_provision/compose-library path at all. Console wiring (replacing
the Template/Overlay UI with the new wizard) is a separate follow-up PR.
- studio-cp: provision_agent / provision_agent_k8s — near-duplicates of
provision_from_library[_k8s] from "resolve the bucket" onward (same
create-vs-redeploy branch, same pre_seed hook injection, same bundle
upload), except the Bundle's config.toml comes from the caller directly
instead of studio_compose::compose_named(library, template, overlay).
Deliberate duplication over a shared refactor, matching the tradeoff
provision_from_library_k8s's own doc comment already made for the same
reason (avoid risking the already-landed functions' shape).
- oab-mcp: new deploy_provision_agent tool (config_toml + image + name,
same provider/context/expected_principal/fleet/cluster args as
deploy_provision minus library/template/overlay), dispatches to the new
studio-cp functions. Tool-count test updated (17 -> 18).
- src-tauri: deploy_provision_agent bridge command, mirroring
deploy_provision's shape, registered in generate_handler!.
Ref #128.
* refactor(studio-cp,oab-mcp,src-tauri): move config.toml generation server-side
Brett's catch: this form's output is ultimately a config.toml for the
created agent, and that file can also be produced by an admin agent
calling the same tool directly (not through Studio's UI) — for those to
stay in sync, the actual TOML-rendering logic can't live in the console
(TypeScript), it has to be the single server-side source of truth both
callers go through.
deploy_provision_agent's config_toml:string param is replaced with
structured fields (api_key, chat_platform, chat_bot_token,
chat_channel_secret) — studio-cp's new generate_agent_config() renders the
actual text (the structured-input counterpart of oabctl create's
generate_config, generalized from Discord-only to discord/telegram/line).
Any caller sending the same fields — the wizard or a future admin agent —
gets byte-identical config.toml by construction, not by convention.
provision_agent_secrets() stores the secret-bearing fields in the same
oab/{namespace}/{name} Secrets Manager convention oabctl create already
uses for the Discord token — a separate secret from #127's ACP auth key,
since these feed config.toml's [secrets.refs]/${secrets.x} (openab's own
resolution, aws-sm:// only) while the ACP key is a container-level env var
injected via spec.secrets, a different delivery path entirely.
k8s deploys refuse a non-empty chat_platform rather than silently
deploying something broken: config.toml's secret resolution only
understands aws-sm://, and k8s_driver.rs's build_deployment injects no AWS
credentials into the pod at all (confirmed by reading it) — so a k8s pod
has no way to actually resolve that URI at runtime. ACP-only k8s deploys
are unaffected (already-working, different mechanism).
api_key is captured/stored but not yet wired into config.toml — which env
var a given vendor's CLI expects it under needs vendor-specific research
this round didn't do. Flagged in the tool schema and struct doc comment
rather than fabricating a config key nothing reads.
Ref #128.1 parent 0486ce8 commit 871e6ce
3 files changed
Lines changed: 503 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
168 | 190 | | |
169 | 191 | | |
170 | 192 | | |
| |||
399 | 421 | | |
400 | 422 | | |
401 | 423 | | |
| 424 | + | |
402 | 425 | | |
403 | 426 | | |
404 | 427 | | |
| |||
673 | 696 | | |
674 | 697 | | |
675 | 698 | | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
676 | 780 | | |
677 | 781 | | |
678 | 782 | | |
| |||
1005 | 1109 | | |
1006 | 1110 | | |
1007 | 1111 | | |
1008 | | - | |
| 1112 | + | |
1009 | 1113 | | |
1010 | 1114 | | |
1011 | 1115 | | |
1012 | 1116 | | |
1013 | 1117 | | |
1014 | 1118 | | |
1015 | 1119 | | |
| 1120 | + | |
1016 | 1121 | | |
1017 | 1122 | | |
1018 | 1123 | | |
| |||
0 commit comments