import { z } from 'zod'; /** Hook definition */ interface HookEntry { matcher: string; command: string; timeout?: number; type?: 'command' | 'prompt'; prompt?: string; } interface Hooks { PreToolUse?: HookEntry[]; PostToolUse?: HookEntry[]; Notification?: HookEntry[]; UserPromptSubmit?: HookEntry[]; SubagentStart?: HookEntry[]; SubagentStop?: HookEntry[]; [key: string]: HookEntry[] | undefined; } interface BaseMcpServer { description?: string; type: string; env: Record; } /** Stdio MCP server configuration */ interface StdioMcpServer extends BaseMcpServer { command: string; args: string[]; } /** URL-based MCP server configuration (HTTP/SSE/streamable HTTP) */ interface UrlMcpServer extends BaseMcpServer { url: string; headers: Record; } /** MCP server configuration */ type McpServer = StdioMcpServer | UrlMcpServer; interface McpConfig { mcpServers: Record; } /** A parsed rule from .agentsmesh/rules/ (glob: *.md) */ interface CanonicalRule { /** Source file path (for error reporting) */ source: string; /** If true, this is the root/always-applied rule */ root: boolean; /** Which targets receive this rule. Empty = all */ targets: string[]; /** Human description for AI context */ description: string; /** Glob patterns for file scoping */ globs: string[]; /** Markdown body content */ body: string; /** Activation mode hint for tools that support it (e.g. Windsurf) */ trigger?: 'always_on' | 'model_decision' | 'glob' | 'manual'; /** * Codex CLI: `advisory` (default) → nested `AGENTS.md` / `AGENTS.override.md`. * `execution` → `.codex/rules/{slug}.rules` body must be Starlark (`prefix_rule`, …). * @see docs/agent-structures/codex-cli-project-level-advanced.md §6.2, §6.10 */ codexEmit?: 'advisory' | 'execution'; /** * Codex nested instruction filename: `override` → `AGENTS.override.md` (advisory only). */ codexInstructionVariant?: 'default' | 'override'; } /** A parsed command from .agentsmesh/commands/ (glob: *.md) */ interface CanonicalCommand { source: string; /** Command name (derived from filename) */ name: string; description: string; /** Tool permissions: ["Read", "Grep", "Bash(git diff)"] */ allowedTools: string[]; /** When true, also emit ~/.claude/output-styles/{name}.md in Claude global mode */ outputStyle?: boolean; body: string; } /** A parsed subagent from .agentsmesh/agents/ (glob: *.md) */ interface CanonicalAgent { source: string; name: string; description: string; /** Tools this agent can use */ tools: string[]; /** Tools explicitly denied */ disallowedTools: string[]; /** AI model preference */ model: string; /** Permission mode */ permissionMode: string; /** Max conversation turns */ maxTurns: number; /** MCP servers available to this agent */ mcpServers: string[]; /** Hooks specific to this agent */ hooks: Hooks; /** Skills available to this agent */ skills: string[]; /** Memory file path */ memory: string; /** System prompt (markdown body) */ body: string; /** When true, also emit ~/.claude/output-styles/{name}.md in Claude global mode */ outputStyle?: boolean; } /** Supporting file for a skill */ interface SkillSupportingFile { relativePath: string; absolutePath: string; /** File content (utf-8) for generation; empty if unreadable */ content: string; } /** A parsed skill from .agentsmesh/skills/{name}/SKILL.md */ interface CanonicalSkill { source: string; /** Skill name (derived from directory name) */ name: string; description: string; /** SKILL.md content */ body: string; /** Paths to supporting files (relative to skill dir) */ supportingFiles: SkillSupportingFile[]; } /** Permission allow/deny/ask lists */ interface Permissions { allow: string[]; deny: string[]; /** Present in parsed YAML; omitted in some legacy fixtures */ ask?: string[]; } /** Ignore patterns (gitignore syntax lines) */ type IgnorePatterns = string[]; /** All canonical files loaded from .agentsmesh/ */ interface CanonicalFiles { rules: CanonicalRule[]; commands: CanonicalCommand[]; agents: CanonicalAgent[]; skills: CanonicalSkill[]; mcp: McpConfig | null; permissions: Permissions | null; hooks: Hooks | null; ignore: IgnorePatterns; } /** Cherry-pick resource names within array features (extends.install + merge). */ declare const extendPickSchema: z.ZodObject<{ skills: z.ZodOptional>; commands: z.ZodOptional>; rules: z.ZodOptional>; agents: z.ZodOptional>; }, z.core.$strict>; type ExtendPick = z.infer; /** * Zod schema for `agentsmesh.yaml` config validation. * * Every field except `version` uses `.default(...)` so the runtime parser * substitutes a documented value when the user omits the key. The published * JSON Schema removes these from the top-level `required` array via * `stripRequiredFromDefaults()` in `src/schemas/schema-generator.ts`, so * editors don't complain about valid minimal configs (a `version: 1`-only * file is allowed). Runtime parser typing stays `T` (not `T | undefined`) — * the post-process fix lives at the publishing layer only. */ declare const configSchema: z.ZodObject<{ version: z.ZodLiteral<1>; targets: z.ZodDefault>>; features: z.ZodDefault>>; extends: z.ZodDefault; target: z.ZodOptional>; as: z.ZodOptional>; features: z.ZodArray>; path: z.ZodOptional; pick: z.ZodOptional>; commands: z.ZodOptional>; rules: z.ZodOptional>; agents: z.ZodOptional>; }, z.core.$strict>>; }, z.core.$strip>>>; overrides: z.ZodDefault>>; collaboration: z.ZodDefault>; lock_features: z.ZodDefault>; }, z.core.$strip>>; conversions: z.ZodOptional; global: z.ZodOptional; }, z.core.$strict>]>>; }, z.core.$loose>>; agents_to_skills: z.ZodOptional; global: z.ZodOptional; }, z.core.$strict>]>>; cline: z.ZodOptional; global: z.ZodOptional; }, z.core.$strict>]>>; 'codex-cli': z.ZodOptional; global: z.ZodOptional; }, z.core.$strict>]>>; windsurf: z.ZodOptional; global: z.ZodOptional; }, z.core.$strict>]>>; }, z.core.$loose>>; }, z.core.$strict>>; plugins: z.ZodDefault; strict: z.ZodOptional; }, z.core.$strict>>>; pluginTargets: z.ZodDefault>; }, z.core.$strip>; type ValidatedConfig = z.infer; export type { CanonicalAgent as C, ExtendPick as E, HookEntry as H, IgnorePatterns as I, McpConfig as M, Permissions as P, SkillSupportingFile as S, UrlMcpServer as U, ValidatedConfig as V, CanonicalCommand as a, CanonicalFiles as b, CanonicalRule as c, CanonicalSkill as d, Hooks as e, McpServer as f, StdioMcpServer as g };