interface PromptSectionContext { readonly systemPrompt: string; readonly taskPrompt?: string; readonly iteration: number; readonly model: string; } interface PromptSectionProvider { name: string; order?: number; provide(ctx: PromptSectionContext): string | null | undefined; } type AgentDefinitionScope = "project" | "user" | "plugin" | "built-in"; interface AgentDefinitionShadowRef { name: string; scope: AgentDefinitionScope; path: string; } interface AgentToolPolicy { mode?: "inherit" | "none" | "readOnly" | "default" | "fullAccess"; allow?: string[]; deny?: string[]; } type AgentDefinitionIsolation = "none" | "worktree"; interface AgentDefinitionMetadata { name: string; scope: AgentDefinitionScope; path: string; description?: string; model?: string; color?: string; memory?: string; isolation?: AgentDefinitionIsolation; tags: string[]; skills: string[]; hooks: string[]; active: boolean; shadowedBy?: AgentDefinitionShadowRef; toolPolicy?: AgentToolPolicy; } interface AgentDefinition extends AgentDefinitionMetadata { prompt: string; } interface AgentDefinitionIssue { path: string; scope: AgentDefinitionScope; message: string; } interface AgentDefinitionScanResult { definitions: AgentDefinition[]; issues: AgentDefinitionIssue[]; searchPaths: { user?: string; project: string[]; plugin: string[]; builtIn: string[]; }; } interface AgentDefinitionLoaderOptions { cwd?: string; agentHome?: string; userDir?: string; projectDirs?: string[]; pluginDirs?: string[]; builtInDirs?: string[]; includeUser?: boolean; includeProject?: boolean; includePlugins?: boolean; includeBuiltIns?: boolean; } declare function getUserAgentDefinitionsDir(agentHome?: string): string; declare function getProjectAgentDefinitionDirs(cwd?: string): string[]; declare function getProjectAgentDefinitionsDir(cwd?: string): string; declare function isValidAgentDefinitionName(name: string): boolean; declare function validateAgentDefinition(definition: Pick): string[]; declare function scanAgentDefinitions(cwd?: string, options?: AgentDefinitionLoaderOptions): AgentDefinitionScanResult; declare function resolveAgentDefinition(name: string, cwd?: string, options?: AgentDefinitionLoaderOptions): { definition: AgentDefinition | null; scan: AgentDefinitionScanResult; }; declare class AgentDefinitionLoader { private readonly options; constructor(options?: AgentDefinitionLoaderOptions); scan(cwd?: string): AgentDefinitionScanResult; } declare class AgentDefinitionResolver { private readonly loader; constructor(loader?: AgentDefinitionLoader); resolve(name: string, cwd?: string): { definition: AgentDefinition | null; scan: AgentDefinitionScanResult; }; } declare function resolveAgentToolPolicy(definition: Pick, parentPolicy?: AgentToolPolicy): AgentToolPolicy; declare function createAgentDefinitionPromptSection(definition: AgentDefinition): PromptSectionProvider; declare function toAgentDefinitionMetadata(definition: AgentDefinition): AgentDefinitionMetadata; declare function renderAgentDefinitions(definitions: AgentDefinition[], issues: AgentDefinitionIssue[]): string; declare function renderAgentDefinition(definition: AgentDefinition): string; declare function createAgentDefinitionFile(input: { name: string; scope: Extract; cwd?: string; agentHome?: string; description?: string; model?: string; color?: string; memory?: string; isolation?: AgentDefinitionIsolation; skills?: string[]; hooks?: string[]; toolPolicy?: AgentToolPolicy; prompt?: string; force?: boolean; }): string; type PermissionProfileName = "default" | "read-only" | "trusted-dev"; declare const XENO_AGENT_PROFILE_SCHEMA_VERSION: 2; type AgentProfileKind = "primary" | "subagent" | "service"; type AgentProfileCollaborationMode = "chat" | "plan" | "execute" | "review"; type AgentProfileMemoryScope = "none" | "session" | "project" | "user"; type AgentProfileSoulMode = "disabled" | "read" | "learn"; type AgentProfileIsolation = AgentDefinitionIsolation | "container"; declare const AGENT_PROFILE_EXTERNAL_ACTIONS: readonly [ "publish", "deploy", "push", "send", "purchase", "sign", "file-legal", "change-infrastructure" ]; type AgentProfileExternalAction = (typeof AGENT_PROFILE_EXTERNAL_ACTIONS)[number]; type AgentProfileActionDecision = "allow" | "ask" | "deny"; type AgentProfileEvidenceKind = "sources" | "file-references" | "tests" | "typecheck" | "build" | "diff" | "deployment-proof" | "human-review"; interface AgentProfileSkillPolicy { preload: string[]; allow?: string[]; deny: string[]; } interface AgentProfileExternalActionPolicy { default: AgentProfileActionDecision; overrides?: Partial>; requireCurrentTurnApproval: AgentProfileExternalAction[]; } interface AgentProfileCapabilities { tools: AgentToolPolicy; skills: AgentProfileSkillPolicy; hooks: string[]; mcpServers?: string[]; delegatedAgents?: string[]; permissionProfile: PermissionProfileName; externalActions: AgentProfileExternalActionPolicy; } interface AgentProfileMemoryPolicy { scope: AgentProfileMemoryScope; role: string; soul: AgentProfileSoulMode; } interface AgentProfileExecutionPolicy { defaultMode: AgentProfileCollaborationMode; allowedModes: AgentProfileCollaborationMode[]; isolation: AgentProfileIsolation; allowBackground: boolean; planForComplexTasks: boolean; defaultDryRun: boolean; maxTurns?: number; } interface AgentProfileCompletionPolicy { evidence: AgentProfileEvidenceKind[]; requirePrimarySources: boolean; requireCurrentInformation: boolean; requireHumanReview: boolean; stopConditions: string[]; } interface AgentProfilePresentation { label: string; color: string; glyph: string; } interface AgentProfileV2 { schemaVersion: typeof XENO_AGENT_PROFILE_SCHEMA_VERSION; id: string; version: string; displayName: string; description: string; kind: AgentProfileKind; prompt: string; model?: { preferred?: string; effort?: "low" | "medium" | "high"; }; capabilities: AgentProfileCapabilities; memory: AgentProfileMemoryPolicy; execution: AgentProfileExecutionPolicy; completion: AgentProfileCompletionPolicy; presentation: AgentProfilePresentation; tags: string[]; } interface AgentProfileCapabilityBoundary { source: string; tools?: AgentToolPolicy; skills?: { allow?: string[]; deny?: string[]; }; hooks?: { allow?: string[]; require?: string[]; }; mcpServers?: { allow?: string[]; deny?: string[]; }; delegatedAgents?: { allow?: string[]; deny?: string[]; }; permissionProfile?: PermissionProfileName; externalActions?: { default?: AgentProfileActionDecision; overrides?: Partial>; requireCurrentTurnApproval?: AgentProfileExternalAction[]; }; maximumMemoryScope?: AgentProfileMemoryScope; maximumSoulMode?: AgentProfileSoulMode; requiredIsolation?: AgentProfileIsolation; } interface CompileAgentProfileOptions { boundaries?: AgentProfileCapabilityBoundary[]; } interface CompiledAgentProfile { schemaVersion: typeof XENO_AGENT_PROFILE_SCHEMA_VERSION; profile: AgentProfileV2; fingerprint: string; boundarySources: string[]; capabilities: AgentProfileCapabilities; memory: AgentProfileMemoryPolicy; execution: AgentProfileExecutionPolicy; completion: AgentProfileCompletionPolicy; promptSection: PromptSectionProvider; } declare class AgentProfileValidationError extends Error { constructor(message: string); } declare function compileAgentProfile(sourceProfile: AgentProfileV2, options?: CompileAgentProfileOptions): CompiledAgentProfile; declare function listBuiltInAgentProfiles(): AgentProfileV2[]; declare function resolveBuiltInAgentProfile(id: string): AgentProfileV2 | null; declare function agentProfileFromDefinition(definition: AgentDefinition): AgentProfileV2; declare function agentDefinitionFromProfile(profile: AgentProfileV2): AgentDefinition; declare function resolveAgentProfile(input: { name: string; definition?: AgentDefinition | null; boundaries?: AgentProfileCapabilityBoundary[]; }): CompiledAgentProfile | null; export { AGENT_PROFILE_EXTERNAL_ACTIONS, type AgentDefinition, type AgentDefinitionIsolation, type AgentDefinitionIssue, AgentDefinitionLoader, type AgentDefinitionLoaderOptions, type AgentDefinitionMetadata, AgentDefinitionResolver, type AgentDefinitionScanResult, type AgentDefinitionScope, type AgentDefinitionShadowRef, type AgentProfileActionDecision, type AgentProfileCapabilities, type AgentProfileCapabilityBoundary, type AgentProfileCollaborationMode, type AgentProfileCompletionPolicy, type AgentProfileEvidenceKind, type AgentProfileExecutionPolicy, type AgentProfileExternalAction, type AgentProfileExternalActionPolicy, type AgentProfileIsolation, type AgentProfileKind, type AgentProfileMemoryPolicy, type AgentProfileMemoryScope, type AgentProfilePresentation, type AgentProfileSkillPolicy, type AgentProfileSoulMode, type AgentProfileV2, AgentProfileValidationError, type AgentToolPolicy, type CompileAgentProfileOptions, type CompiledAgentProfile, XENO_AGENT_PROFILE_SCHEMA_VERSION, agentDefinitionFromProfile, agentProfileFromDefinition, compileAgentProfile, createAgentDefinitionFile, createAgentDefinitionPromptSection, getProjectAgentDefinitionDirs, getProjectAgentDefinitionsDir, getUserAgentDefinitionsDir, isValidAgentDefinitionName, listBuiltInAgentProfiles, renderAgentDefinition, renderAgentDefinitions, resolveAgentDefinition, resolveAgentProfile, resolveAgentToolPolicy, resolveBuiltInAgentProfile, scanAgentDefinitions, toAgentDefinitionMetadata, validateAgentDefinition };