mirror of
https://github.com/block/buzz.git
synced 2026-10-29 21:41:33 +00:00
Merges the two agent edit dialogs (AgentInstanceEditDialog, AgentDefinitionDialog) into a single AgentEditMergedDialog that every edit entry point — the agents library, the profile panel, owner review, and the requestOpenEditAgent event path — reaches through AgentEditDialog. AgentInstanceEditDialog is deleted, AgentDialog's instance-edit arm is removed, and the editPersonaDialogState export is gone. One canonical form model: seedAgentFormModel builds an AgentFormModel from the edit context and owns every editable field; emitAgentFormDiff routes each changed field to its owning layer via the single FIELD_OWNERS map, which also drives per-field editability and the catalog-publish dirty signal. Save coordinator settles from observed state: definition → instance → policy writes, each followed by a store refetch — a write that threw after landing on disk counts as persisted, and a submitted behavior group (respondTo / respondToAllowlist / parallelism) settles as the full-replacement unit the backend writes, so a clear the backend failed to apply cannot false-succeed. Definition and instance runtime state are independent; definition behavior fields (access, allowlist, parallelism) are first-class with an unset respondTo shown as owner-only; team-managed definitions are read-only with a notice while instance-owned fields stay editable. Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>