/** * Agent scaffold — persona.cant / manifest.json / team-config generation. * * Extracted from `cleo agent create` (packages/cleo). Contains all role-based * template helpers and the directory-creation logic. CLI remains a thin wrapper * that calls `scaffoldAgent` and emits the LAFS envelope. * * @module agents/scaffold * @epic T9833 * @task T10062 */ /** Valid agent roles for template generation. */ export type AgentRole = 'orchestrator' | 'lead' | 'worker' | 'docs-worker'; /** Parameters accepted by {@link scaffoldAgent}. */ export interface ScaffoldAgentParams { name: string; role: string; /** Defaults to role-inferred value when omitted. */ tier?: string; team?: string; domain?: string; parent?: string; /** * Install into the global XDG-data agents tier instead of the project tree. */ global?: boolean; /** Whether to create `expertise/mental-model-seed.md` and seed BRAIN. */ seedBrain?: boolean; /** * Absolute project root — required when `global` is false. * Used to resolve `.cleo/cant/agents/`. */ projectRoot?: string; /** * CLEO directory name inside the project root (default: `.cleo`). */ cleoDirName?: string; /** Sub-directory under `.cleo` for CANT agent definitions. */ cantAgentsSubdir?: string; } /** Result of a successful scaffold operation. */ export interface ScaffoldAgentResult { agent: string; role: string; tier: string; directory: string; scope: 'global' | 'project'; files: string[]; registered: false; brainSeeded: boolean; } /** * Scaffold a new agent package on disk. * * Creates the agent directory, `persona.cant`, `manifest.json`, an optional * `team-config.cant`, and an optional mental-model seed. Does NOT register * the agent in the SignalDock registry — the CLI handler handles that as a * best-effort step. * * @param params - Scaffold parameters * @returns Metadata about the created files * @throws {Error} When the directory already exists or validation fails */ export declare function scaffoldAgent(params: ScaffoldAgentParams): ScaffoldAgentResult; /** @throws {Error} when role is not in {@link VALID_ROLES}. */ export declare function validateRole(role: string): void; /** @throws {Error} when tier is not in `['low', 'mid', 'high']`. */ export declare function validateTier(tier: string): void; /** @throws {Error} when name is not kebab-case. */ export declare function validateName(name: string): void; /** * Infer the default tier from the agent role. * * - `orchestrator` → `high` * - everything else → `mid` */ export declare function inferTierFromRole(role: string): string; interface PersonaParams { name: string; role: string; tier: string; team?: string; domain?: string; parent?: string; } interface ManifestParams { name: string; role: string; tier: string; domain?: string; } /** * Generate `persona.cant` content from role-based templates. * * @see packages/cleo-os/starter-bundle/agents/ — canonical format reference */ export declare function generatePersonaCant(params: PersonaParams): string; /** Generate `persona.cant` for the `orchestrator` role. */ export declare function generateOrchestratorPersona(name: string, tier: string, team?: string, parent?: string): string; /** Generate `persona.cant` for the `lead` role. */ export declare function generateLeadPersona(name: string, tier: string, team?: string, domain?: string, parent?: string): string; /** Generate `persona.cant` for the `worker` role. */ export declare function generateWorkerPersona(name: string, tier: string, team?: string, domain?: string, parent?: string): string; /** Generate `persona.cant` for the `docs-worker` role. */ export declare function generateDocsWorkerPersona(name: string, tier: string, team?: string, domain?: string, parent?: string): string; /** * Derive file write globs from a domain description string. * * Maps common domain keywords to appropriate file glob patterns. * Falls back to the project-wide defaults when no domain is specified. */ export declare function deriveWriteGlobs(domain?: string): string[]; /** * Generate a `manifest.json` object conforming to CANTZ-PACKAGE-STANDARD.md §2.3. */ export declare function generateManifest(params: ManifestParams): Record; /** * Generate a `team-config.cant` fragment declaring the agent's team membership. */ export declare function generateTeamConfig(name: string, role: string, team: string): string; /** * Generate a mental-model seed markdown file for BRAIN seeding. */ export declare function generateMentalModelSeed(name: string, role: string, domain?: string): string; export {}; //# sourceMappingURL=scaffold.d.ts.map