/** * [WHO]: AgentMetadata interface, loadAgentMetadata(), saveAgentMetadata(), ensureAgentMetadata() * [FROM]: Depends on agent-dir-context.ts, node:fs, node:path * [TO]: Consumed by main.ts, future Gateway integration * [HERE]: core/agent-dir/agent-metadata.ts - agent.json (machine-readable metadata) * * Design doc: docs/multi-agent-fs-design.md ยง4.2 */ import type { AgentDirContext } from "./agent-dir-context.js"; export interface AgentAsgardMetadata { templateId: string; templateVersion: string; originUrl: string; externalId: string; lastSyncedAt: string; } export interface AgentMetadata { version: string; /** Slug id, [a-z0-9._-]{1,64}; matches the directory name. Immutable. */ id: string; /** Human-readable name; can contain Chinese/emoji. */ displayName: string; /** Human-readable description. */ description?: string; createdAt: string; updatedAt: string; origin: { type: "local" | "cloud-adopted" | "imported"; asgard?: AgentAsgardMetadata; }; tags: string[]; engine: string; extensions: Record; } export declare const CURRENT_METADATA_VERSION = "1.0.0"; /** * Load agent.json from the agent directory. * Returns undefined if the file does not exist or is invalid. */ export declare function loadAgentMetadata(agentDir: string): AgentMetadata | undefined; /** * Save agent.json to the agent directory. */ export declare function saveAgentMetadata(agentDir: string, metadata: AgentMetadata): void; /** * Ensure agent.json exists. If not, creates a default one based on context. */ export declare function ensureAgentMetadata(ctx: AgentDirContext): AgentMetadata;