mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
feat(desktop): GUI for agent respond-to gate (owner-only / anyone / allowlist) (#557)
This commit is contained in:
@@ -226,6 +226,10 @@ export type RawManagedAgent = {
|
||||
start_on_app_launch: boolean;
|
||||
backend: ManagedAgentBackend;
|
||||
backend_agent_id: string | null;
|
||||
// Optional: pre-feature mock fixtures may omit these. Mapped to
|
||||
// `"owner-only"` / `[]` in `fromRawManagedAgent`.
|
||||
respond_to?: ManagedAgent["respondTo"];
|
||||
respond_to_allowlist?: string[];
|
||||
};
|
||||
|
||||
type RawCreateManagedAgentResponse = {
|
||||
@@ -833,6 +837,10 @@ export function fromRawManagedAgent(agent: RawManagedAgent): ManagedAgent {
|
||||
startOnAppLaunch: agent.start_on_app_launch,
|
||||
backend: agent.backend,
|
||||
backendAgentId: agent.backend_agent_id,
|
||||
// Fallbacks for pre-feature mocks/fixtures that don't carry these fields.
|
||||
// Real agent records always include them (defaulted server-side).
|
||||
respondTo: agent.respond_to ?? "owner-only",
|
||||
respondToAllowlist: agent.respond_to_allowlist ?? [],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -945,6 +953,8 @@ export async function createManagedAgent(input: CreateManagedAgentInput) {
|
||||
spawnAfterCreate: input.spawnAfterCreate,
|
||||
startOnAppLaunch: input.startOnAppLaunch,
|
||||
backend: input.backend,
|
||||
respondTo: input.respondTo,
|
||||
respondToAllowlist: input.respondToAllowlist,
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
@@ -290,8 +290,22 @@ export type ManagedAgent = {
|
||||
startOnAppLaunch: boolean;
|
||||
backend: ManagedAgentBackend;
|
||||
backendAgentId: string | null;
|
||||
/** Who the agent should respond to. Maps to `sprout-acp --respond-to`. */
|
||||
respondTo: RespondToMode;
|
||||
/**
|
||||
* Normalized 64-char lowercase hex pubkeys. Used only when `respondTo` is
|
||||
* `"allowlist"`. Preserved across mode toggles.
|
||||
*/
|
||||
respondToAllowlist: string[];
|
||||
};
|
||||
|
||||
/**
|
||||
* Inbound author gate mode. Mirrors `sprout-acp`'s `--respond-to` CLI flag.
|
||||
* `"nobody"` is supported by the harness but not surfaced through this API —
|
||||
* it's a heartbeat-only mode without a meaningful GUI use case.
|
||||
*/
|
||||
export type RespondToMode = "owner-only" | "allowlist" | "anyone";
|
||||
|
||||
export type BackendProviderCandidate = {
|
||||
id: string;
|
||||
binaryPath: string;
|
||||
@@ -324,6 +338,13 @@ export type CreateManagedAgentInput = {
|
||||
spawnAfterCreate?: boolean;
|
||||
startOnAppLaunch?: boolean;
|
||||
backend?: ManagedAgentBackend;
|
||||
/** Inbound author gate mode. Omitted = `"owner-only"` (server default). */
|
||||
respondTo?: RespondToMode;
|
||||
/**
|
||||
* Hex pubkeys to allow when `respondTo === "allowlist"`. Validated &
|
||||
* normalized server-side (must be 64 hex chars each).
|
||||
*/
|
||||
respondToAllowlist?: string[];
|
||||
};
|
||||
|
||||
export type CreateManagedAgentResponse = {
|
||||
@@ -389,6 +410,13 @@ export type UpdateManagedAgentInput = {
|
||||
agentCommand?: string;
|
||||
agentArgs?: string[];
|
||||
mcpCommand?: string;
|
||||
/** Absent = don't touch. Present = set the mode. */
|
||||
respondTo?: RespondToMode;
|
||||
/**
|
||||
* Absent = don't touch. Present = replace the allowlist with this list
|
||||
* (validated & normalized server-side).
|
||||
*/
|
||||
respondToAllowlist?: string[];
|
||||
};
|
||||
export type AgentPersona = {
|
||||
id: string;
|
||||
|
||||
Reference in New Issue
Block a user