/** * [WHO]: AgentDirContext interface, defaultAgentDirContext(), agentDirContextOf(), validateAgentId() * [FROM]: Depends on config.ts (getAgentDir) * [TO]: Consumed by core/persona, core/session, core/soul-integration, core/mcp, extensions, future --agent flag * [HERE]: core/agent-dir/agent-dir-context.ts - multi-agent directory abstraction */ /** * Regex for a valid agent . * ASCII slug: lowercase alphanumeric start, then [a-z0-9._-], max 64 chars. * Design doc §4.1. */ export declare const AGENT_ID_RE: RegExp; /** * Validate an agent id. Returns the id if valid, throws otherwise. */ export declare function validateAgentId(id: string): string; export interface AgentOriginMetadata { type: "local" | "cloud-adopted" | "imported"; asgard?: { templateId: string; templateVersion: string; originUrl: string; externalId: string; lastSyncedAt: string; }; } /** * Represents the resolved filesystem context for one agent. * * - `id` : machine-readable slug (directory name, route key, Asgard externalId) * - `path`: absolute path to the agent's data directory * - `origin`: optional metadata if adopted from cloud (future, §4.2) */ export interface AgentDirContext { /** Slug id, [a-z0-9._-]{1,64}; matches the directory name. Immutable once created. */ readonly id: string; /** Absolute path; trusted to exist or be creatable. */ readonly path: string; /** Optional — if the agent was adopted from cloud, the origin metadata. */ readonly origin?: AgentOriginMetadata; } /** * Build the default context for the legacy single-agent path. * This is the fallback when no `--agent` flag is provided. * Resolves to whatever `getAgentDir()` returns today (~/.catui/agents/default). */ export declare function defaultAgentDirContext(): AgentDirContext; /** * Build an AgentDirContext for a specific agent id + resolved path. * Throws if the id fails validation. */ export declare function agentDirContextOf(id: string, path: string, origin?: AgentOriginMetadata): AgentDirContext; /** * Load AgentDirContext from an agent directory (loads agent.json if it exists). */ export declare function loadAgentDirContext(id: string): AgentDirContext; /** * Save AgentDirContext to agent.json. */ export declare function saveAgentDirContext(ctx: AgentDirContext): void;