mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
B5: one create path — behavioral quad activation, backfill, menu collapse, legacy dialog deletion (#1667)
Signed-off-by: Wes <wesbillman@users.noreply.github.com> Co-authored-by: Brain <21994759fc7a6fa6b965551d35cfd7897d262f2495467f2d78694ddcfa6a5c7e@sprout-oss.stage.blox.sqprod.co>
This commit is contained in:
@@ -2,6 +2,7 @@ import { invokeTauri } from "@/shared/api/tauri";
|
||||
import type {
|
||||
AgentPersona,
|
||||
CreatePersonaInput,
|
||||
RespondToMode,
|
||||
UpdatePersonaInput,
|
||||
} from "@/shared/api/types";
|
||||
|
||||
@@ -64,6 +65,10 @@ export type RawPersona = {
|
||||
is_active?: boolean;
|
||||
source_team?: string | null;
|
||||
env_vars?: Record<string, string>;
|
||||
respond_to?: string | null;
|
||||
respond_to_allowlist?: string[];
|
||||
mcp_toolsets?: string | null;
|
||||
parallelism?: number | null;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
};
|
||||
@@ -82,6 +87,10 @@ export function fromRawPersona(persona: RawPersona): AgentPersona {
|
||||
isActive: persona.is_active ?? true,
|
||||
sourceTeam: persona.source_team ?? null,
|
||||
envVars: persona.env_vars ?? {},
|
||||
respondTo: (persona.respond_to as RespondToMode | undefined) ?? null,
|
||||
respondToAllowlist: persona.respond_to_allowlist ?? [],
|
||||
mcpToolsets: persona.mcp_toolsets ?? null,
|
||||
parallelism: persona.parallelism ?? null,
|
||||
createdAt: persona.created_at,
|
||||
updatedAt: persona.updated_at,
|
||||
};
|
||||
@@ -105,6 +114,7 @@ export async function createPersona(
|
||||
provider: input.provider,
|
||||
namePool: input.namePool ?? [],
|
||||
envVars: input.envVars ?? {},
|
||||
behavior: input.behavior,
|
||||
},
|
||||
}),
|
||||
);
|
||||
@@ -128,6 +138,8 @@ export async function updatePersona(
|
||||
// tells the backend "don't touch the stored env vars" so editing
|
||||
// unrelated fields can't silently wipe saved credentials.
|
||||
envVars: input.envVars,
|
||||
// Same absent-vs-present contract as envVars for the behavioral quad.
|
||||
behavior: input.behavior,
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
||||
@@ -718,10 +718,27 @@ export type AgentPersona = {
|
||||
/** Environment variables injected for agents created from this persona.
|
||||
* Layered as: desktop parent env < persona envVars < agent envVars. */
|
||||
envVars: Record<string, string>;
|
||||
/** NIP-AP behavioral defaults (wire shape). Null/empty = unset. */
|
||||
respondTo: RespondToMode | null;
|
||||
respondToAllowlist: string[];
|
||||
mcpToolsets: string | null;
|
||||
parallelism: number | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* NIP-AP behavioral quad for a definition, sent as one group: absent = don't
|
||||
* touch the stored quad (legacy callers), present = replace all four as a
|
||||
* unit. Mirrors `PersonaBehaviorRequest`.
|
||||
*/
|
||||
export type PersonaBehaviorInput = {
|
||||
respondTo?: RespondToMode;
|
||||
respondToAllowlist?: string[];
|
||||
mcpToolsets?: string;
|
||||
parallelism?: number;
|
||||
};
|
||||
|
||||
export type CreatePersonaInput = {
|
||||
displayName: string;
|
||||
avatarUrl?: string;
|
||||
@@ -731,6 +748,7 @@ export type CreatePersonaInput = {
|
||||
provider?: string;
|
||||
namePool?: string[];
|
||||
envVars?: Record<string, string>;
|
||||
behavior?: PersonaBehaviorInput;
|
||||
};
|
||||
|
||||
export type UpdatePersonaInput = {
|
||||
@@ -743,6 +761,7 @@ export type UpdatePersonaInput = {
|
||||
provider?: string;
|
||||
namePool?: string[];
|
||||
envVars?: Record<string, string>;
|
||||
behavior?: PersonaBehaviorInput;
|
||||
};
|
||||
|
||||
// ── Team types ────────────────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user