import type { OnCapAction } from "../bot/author-budget.js"; /** * v0.6 §2.2 — Organization Layer Specialization (`agent-profile.yaml`). * * 25 specialist SKILL.md files stay immutable in the workspace; org-level * tone, priorities, and budget caps live in `/agent-profile.yaml` as a * thin modifier (typically ~50 lines). * * Three-tier inheritance (P2 #11 — cross-org user defaults): * 1. workspace bundle defaults (shipped, lowest priority) * 2. user global (`~/.solosquad/agent-profile-defaults.yaml`) * 3. org agent-profile (`//agent-profile.yaml`) * * Same-keyed values: narrower scope wins (org > user > workspace). * * Budget invariant (security — §2.2 ¶3): agent-level overrides may only * *tighten* the parent defaults (smaller daily/weekly cap). A wider override * is rejected — we emit a warning and fall back to the parent value so a * single agent cannot escape the cross-agent ceiling. */ export declare const AGENT_PROFILE_SCHEMA_VERSION = 1; export interface AgentBudget { daily_usd?: number; weekly_usd?: number; per_call_usd?: number; on_cap_action?: OnCapAction; } /** * Per-agent modifier — emission-side fields are intentionally loose * (`tone`, `priorities`, `voice`, `ban_phrases`, …) so org authors can add * new fields without a parser bump. Unknown keys flow through to the * spawn-assembler as raw yaml. */ export interface AgentSection { tone?: string; priorities?: string[]; excluded_recommendations?: string[]; voice?: string; ban_phrases?: string[]; emphasis?: string; decision_frame?: string; budget?: AgentBudget; /** Free-form pass-through for forward compatibility. */ [extra: string]: unknown; } export interface AgentProfileYaml { schema_version?: number; defaults?: AgentSection; /** Per-agent sections keyed by SKILL `name`. */ [agentName: string]: AgentSection | number | undefined; } export interface AgentProfileMerged { defaults: AgentSection; agents: Record; warnings: string[]; /** Effective schema_version after merge — for diagnostics. */ schemaVersion: number; } export interface LoadAgentProfileOpts { workspace: string; orgSlug: string; /** Override the user-global defaults path for tests. */ userDefaultsPath?: string; /** Override the workspace bundle defaults path for tests. */ workspaceDefaultsPath?: string; } /** * Merge two profiles (child overrides parent). Budget caps in the child are * *only* accepted if they are equal or narrower than the parent — looser * caps are dropped and a warning is collected. */ export declare function mergeProfiles(parent: AgentProfileMerged, child: AgentProfileYaml | undefined, childLabel: string): AgentProfileMerged; /** Path to the user-global defaults file (cross-org cap inheritance). */ export declare function userGlobalDefaultsPath(): string; /** Path to the org agent-profile.yaml. */ export declare function orgAgentProfilePath(workspace: string, orgSlug: string): string; /** Path to the bundled workspace defaults (ships in `.solosquad/`). */ export declare function workspaceBundleDefaultsPath(workspace: string): string; /** * Load and merge in the 3-tier inheritance order. * * Missing files are graceful — a workspace with *no* agent-profile yields an * empty merged profile (defaults-only). schema_version is validated only * when at least one source file declares it; absence yields a warning (not * a refusal) so existing v0.5 workspaces don't break. */ export declare function loadAgentProfile(opts: LoadAgentProfileOpts): AgentProfileMerged; /** Resolve the effective budget for a specific agent (defaults + agent override). */ export declare function resolveAgentBudget(profile: AgentProfileMerged, agentName: string): AgentBudget | undefined;