import { type ConsoleAgentCreateInput, type ConsoleAgentCreateResult } from "./console-auth.js"; import Relay, { type AgentImageRecipe, type ContactCardItem } from "@relaymessenger/sdk"; import type { ConfigContext, RelayConfig, ResolvedAuth } from "./config.js"; /** Injected SDK and persistence boundaries keep command logic independently testable. */ export interface AgentDependencies { read: () => Promise; preflight: () => Promise; update: (change: (config: RelayConfig) => T) => Promise; provision: (input: ConsoleAgentCreateInput, options: { apiURL: string; }) => Promise; client: (token: string, apiURL: string) => Pick; auth: (profile?: string) => Promise; deleteConsole?: (handle: string, apiURL: string, agentToken: string) => Promise; env: NodeJS.ProcessEnv; } export declare const agentDependencies: (context?: ConfigContext, fetch?: typeof globalThis.fetch) => AgentDependencies; /** * The developer-facing agent record. The API's ContactCardItem is the shape * every Relay contact shares (a person or an agent), so it carries `kind`, * `last_name` and `is_active`; a CLI record is always one active agent, so it * shows only what a developer uses: the Handle, the display name and the image. * Whitelisted fields only: never serialize an SDK response containing the secret. */ export interface AgentRecord { handle: string; display_name: string; image_url: string | null; } export declare const agentRecord: (card: Pick) => AgentRecord; /** * An agent's own card always has a Handle; only a shared person's card loses * it, after that person deletes their account. */ export declare const cardHandle: (card: Pick) => string; export interface CreateAgentInput { profile?: string; apiURL?: string; handle?: string; firstName?: string; subtitle?: string; description?: string; imageURL?: string; imageRecipe?: AgentImageRecipe; /** Save the new profile as the last connected agent, in the same config write. */ makeDefault?: boolean; } /** The handle a person asked for, checked before anything is created or asked. */ export declare const validateHandle: (handle: string) => string; /** The name a person asked for, trimmed and checked the same way. */ export declare const validateFirstName: (name: string) => string; export declare function createAgent(input: CreateAgentInput, deps: AgentDependencies): Promise<{ handle: string; display_name: string; image_url: string | null; profile: string; share_url: string; api_url: string; token: "stored"; }>; export declare function listAgents(deps: AgentDependencies, onFailure?: (error: Error) => void): Promise<{ agents: ({ handle: string; display_name: string; image_url: string | null; profile: string; api_url: string; token: "stored"; error?: never; code?: never; next_step?: never; } | { profile: string; api_url: string; token: "stored"; error: string; code: string; next_step: string; })[]; }>; export declare function selectAgentAuth(handle: string, profile: string | undefined, deps: AgentDependencies): Promise; export declare function deleteAgent(handle: string, profile: string | undefined, deps: AgentDependencies): Promise<{ ok: boolean; handle: string; profile: string; token: string; }>; //# sourceMappingURL=agents.d.ts.map