mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
Add agent catalog modal (#1302)
Signed-off-by: Taylor Ho <taylorkmho@gmail.com> Co-authored-by: npub1223z34hd7vtwc6qj4s7flsxkj644nlre2nthu7lrrmkumhu3xddsrx9r6w <52a228d6edf316ec6812ac3c9fc0d696ab59fc7954d77e7be31eedcddf91335b@sprout-oss.stage.blox.sqprod.co> Co-authored-by: Taylor Ho <taylorkmho@gmail.com>
This commit is contained in:
co-authored by
npub1223z34hd7vtwc6qj4s7flsxkj644nlre2nthu7lrrmkumhu3xddsrx9r6w
Taylor Ho
parent
e70dd1a1e7
commit
228122fddc
@@ -0,0 +1,30 @@
|
||||
import assert from "node:assert/strict";
|
||||
import test from "node:test";
|
||||
|
||||
import { fromRawPersona } from "./tauriPersonas.ts";
|
||||
|
||||
function rawPersona(overrides = {}) {
|
||||
return {
|
||||
id: "persona-1",
|
||||
display_name: "Team Analyst",
|
||||
avatar_url: null,
|
||||
system_prompt: "You are Team Analyst.",
|
||||
runtime: null,
|
||||
model: null,
|
||||
provider: null,
|
||||
name_pool: [],
|
||||
is_builtin: false,
|
||||
is_active: true,
|
||||
source_team: null,
|
||||
env_vars: {},
|
||||
created_at: "2026-01-01T00:00:00.000Z",
|
||||
updated_at: "2026-01-01T00:00:00.000Z",
|
||||
...overrides,
|
||||
};
|
||||
}
|
||||
|
||||
test("fromRawPersona maps source_team to sourceTeam", () => {
|
||||
const persona = fromRawPersona(rawPersona({ source_team: "team-research" }));
|
||||
|
||||
assert.equal(persona.sourceTeam, "team-research");
|
||||
});
|
||||
@@ -51,7 +51,7 @@ export type ParsePersonaFilesResult = {
|
||||
skipped: SkippedFile[];
|
||||
};
|
||||
|
||||
type RawPersona = {
|
||||
export type RawPersona = {
|
||||
id: string;
|
||||
display_name: string;
|
||||
avatar_url: string | null;
|
||||
@@ -62,12 +62,13 @@ type RawPersona = {
|
||||
name_pool?: string[];
|
||||
is_builtin: boolean;
|
||||
is_active?: boolean;
|
||||
source_team?: string | null;
|
||||
env_vars?: Record<string, string>;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
};
|
||||
|
||||
function fromRawPersona(persona: RawPersona): AgentPersona {
|
||||
export function fromRawPersona(persona: RawPersona): AgentPersona {
|
||||
return {
|
||||
id: persona.id,
|
||||
displayName: persona.display_name,
|
||||
@@ -79,6 +80,7 @@ function fromRawPersona(persona: RawPersona): AgentPersona {
|
||||
namePool: persona.name_pool ?? [],
|
||||
isBuiltIn: persona.is_builtin,
|
||||
isActive: persona.is_active ?? true,
|
||||
sourceTeam: persona.source_team ?? null,
|
||||
envVars: persona.env_vars ?? {},
|
||||
createdAt: persona.created_at,
|
||||
updatedAt: persona.updated_at,
|
||||
|
||||
Reference in New Issue
Block a user