/** * Team Norms Module * * Loads team-level norms/SOPs from the team's norms directory. * These norms originate from template application — when a template * is applied, its norms/*.md files are copied into the team directory. * * Priority 9.5: after DomainSOP (9), before lower-priority modules. * Compactable: yes — can be truncated under token pressure. * * @module services/ai/prompt-modules/team-norms */ import type { PromptModule, ModuleConfig } from './prompt-module.interface.js'; /** * TeamNormsModule loads all markdown norm files from the team's norms directory * and injects them as team-level SOPs into the agent prompt. * * The norms directory path comes from `config.teamNormsPath`, which is set * during template application when a template has a `norms/` directory. * * @example * ```typescript * const mod = new TeamNormsModule(); * mod.shouldInclude({ teamNormsPath: '/home/user/.crewly/teams/abc/norms' }); * const content = await mod.build(config); * ``` */ export declare class TeamNormsModule implements PromptModule { name: string; priority: number; maxTokens: number; compactable: boolean; /** * Include this module only when a teamNormsPath is configured and the directory exists. * * @param config - Module configuration * @returns True if team norms directory exists and contains files */ shouldInclude(config: ModuleConfig): boolean; /** * Build the team norms prompt section by loading relevant .md files from * the norms directory. * * Selection is a two-stage pipeline designed to keep the marketing team's * 50+ SOP files from blowing the prompt budget: * * 1. **Filter**: parse each file's YAML frontmatter, skip `deprecated: true` * and skip files whose `appliesTo` does not include the agent's role. * 2. **Rank + cap**: sort survivors by descending `priority` (default 0), * then alphabetically for stable ordering, then keep at most * `MAX_NORM_FILES`. * * Frontmatter is stripped from the emitted content — agents see the SOP * body, not the routing metadata. * * @param config - Module configuration with teamNormsPath and role * @returns Formatted markdown section with the applicable norms */ build(config: ModuleConfig): Promise; } //# sourceMappingURL=team-norms.module.d.ts.map