import { z } from "zod"; import { type ClaudeOptions, type Skill } from "./skills.js"; /** File names looked up in a linked directory, in order. */ export declare const PROJECT_FILE_NAMES: readonly ["skillhook.yaml", "skillhook.yml"]; export declare const PROJECT_SCHEMA_URL = "https://raw.githubusercontent.com/MeterApp/skillhook/main/schema/skillhook.yaml.schema.json"; /** * One hook = the `skillhook:` block of a SKILL.md plus what runs: exactly one of `run` (a shell command), * `skill` (a SKILL.md directory in the project) or `prompt` (inline instructions for the agent runner). */ export declare const HookSchema: z.ZodObject<{ runner: z.ZodOptional>; account: z.ZodOptional]>>; model: z.ZodOptional; effort: z.ZodOptional; cwd: z.ZodOptional; timeout_seconds: z.ZodOptional; auth: z.ZodOptional; allow_ips: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"bearer">; secret_env: z.ZodOptional; header: z.ZodOptional; allow_query_token: z.ZodOptional; allow_ips: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"basic">; secret_env: z.ZodOptional; allow_ips: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"hmac">; secret_env: z.ZodOptional; header: z.ZodOptional; prefix: z.ZodOptional; encoding: z.ZodOptional>; algorithm: z.ZodOptional>; delivery_id_header: z.ZodOptional; timestamp_header: z.ZodOptional; tolerance_seconds: z.ZodOptional; allow_ips: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"github">; secret_env: z.ZodOptional; allow_ips: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"sentry">; secret_env: z.ZodOptional; allow_ips: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"linear">; secret_env: z.ZodOptional; allow_ips: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"standard-webhooks">; secret_env: z.ZodOptional; tolerance_seconds: z.ZodOptional; allow_ips: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"granola">; secret_env: z.ZodOptional; tolerance_seconds: z.ZodOptional; allow_ips: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"svix">; secret_env: z.ZodOptional; tolerance_seconds: z.ZodOptional; allow_ips: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"stripe">; secret_env: z.ZodOptional; tolerance_seconds: z.ZodOptional; allow_ips: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"slack">; secret_env: z.ZodOptional; tolerance_seconds: z.ZodOptional; allow_ips: z.ZodOptional>; }, z.core.$strict>], "type">>; when: z.ZodOptional; header: z.ZodOptional; query: z.ZodOptional; equals: z.ZodOptional; not_equals: z.ZodOptional; in: z.ZodOptional>; matches: z.ZodOptional; exists: z.ZodOptional; contains: z.ZodOptional; }, z.core.$strict>>>; env: z.ZodOptional>; concurrency: z.ZodOptional; serialize_cwd: z.ZodOptional; dedupe: z.ZodOptional; header: z.ZodOptional; in_flight: z.ZodOptional; }, z.core.$strict>>; claude: z.ZodOptional>; allowed_tools: z.ZodOptional>; disallowed_tools: z.ZodOptional>; add_dirs: z.ZodOptional>; max_budget_usd: z.ZodOptional; append_system_prompt: z.ZodOptional; args: z.ZodOptional>; config_dir: z.ZodOptional; mcp_servers: z.ZodOptional>; command: z.ZodOptional; args: z.ZodOptional>; env: z.ZodOptional>; url: z.ZodOptional; headers: z.ZodOptional>; }, z.core.$strict>>>; strict_mcp: z.ZodOptional; }, z.core.$strict>>; codex: z.ZodOptional>; network_access: z.ZodOptional; profile: z.ZodOptional; add_dirs: z.ZodOptional>; args: z.ZodOptional>; }, z.core.$strict>>; shell: z.ZodOptional]>; }, z.core.$strict>>; fallback: z.ZodOptional, z.ZodObject<{ runner: z.ZodEnum<{ claude: "claude"; codex: "codex"; shell: "shell"; }>; model: z.ZodOptional; effort: z.ZodOptional; account: z.ZodOptional; }, z.core.$strict>]>>; on: z.ZodOptional>>; }, z.core.$strict>>; retry: z.ZodOptional>>; backoff_seconds: z.ZodOptional; }, z.core.$strict>>; agent_api: z.ZodOptional>; human_wait_seconds: z.ZodOptional; response: z.ZodOptional>; schema: z.ZodOptional>; }, z.core.$strict>>; enabled: z.ZodOptional; schedule: z.ZodOptional, z.ZodObject<{ cron: z.ZodString; timezone: z.ZodOptional; catch_up: z.ZodOptional>; overlap: z.ZodOptional>; payload: z.ZodOptional>; }, z.core.$strict>]>>; webhook: z.ZodOptional; description: z.ZodOptional; skill: z.ZodOptional; run: z.ZodOptional]>>; prompt: z.ZodOptional; }, z.core.$strict>; export type Hook = z.infer; /** * A skill the repository owns, declared under `skills:` by name: where its SKILL.md directory (or the file itself) is, * relative to the repository, as a path or `{ path }`. The name must equal the SKILL.md's `name` (and so its directory's * name). Hooks refer to it as `skill: "@"`; the list is also what a repository publishes as its skills. */ export declare const ProjectSkillSchema: z.ZodUnion]>; export type ProjectSkillEntry = z.infer; export declare const ProjectFileSchema: z.ZodObject<{ $schema: z.ZodOptional; claude: z.ZodOptional>; allowed_tools: z.ZodOptional>; disallowed_tools: z.ZodOptional>; add_dirs: z.ZodOptional>; max_budget_usd: z.ZodOptional; append_system_prompt: z.ZodOptional; args: z.ZodOptional>; config_dir: z.ZodOptional; mcp_servers: z.ZodOptional>; command: z.ZodOptional; args: z.ZodOptional>; env: z.ZodOptional>; url: z.ZodOptional; headers: z.ZodOptional>; }, z.core.$strict>>>; strict_mcp: z.ZodOptional; }, z.core.$strict>>; skills: z.ZodOptional]>>>; hooks: z.ZodRecord>; account: z.ZodOptional]>>; model: z.ZodOptional; effort: z.ZodOptional; cwd: z.ZodOptional; timeout_seconds: z.ZodOptional; auth: z.ZodOptional; allow_ips: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"bearer">; secret_env: z.ZodOptional; header: z.ZodOptional; allow_query_token: z.ZodOptional; allow_ips: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"basic">; secret_env: z.ZodOptional; allow_ips: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"hmac">; secret_env: z.ZodOptional; header: z.ZodOptional; prefix: z.ZodOptional; encoding: z.ZodOptional>; algorithm: z.ZodOptional>; delivery_id_header: z.ZodOptional; timestamp_header: z.ZodOptional; tolerance_seconds: z.ZodOptional; allow_ips: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"github">; secret_env: z.ZodOptional; allow_ips: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"sentry">; secret_env: z.ZodOptional; allow_ips: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"linear">; secret_env: z.ZodOptional; allow_ips: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"standard-webhooks">; secret_env: z.ZodOptional; tolerance_seconds: z.ZodOptional; allow_ips: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"granola">; secret_env: z.ZodOptional; tolerance_seconds: z.ZodOptional; allow_ips: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"svix">; secret_env: z.ZodOptional; tolerance_seconds: z.ZodOptional; allow_ips: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"stripe">; secret_env: z.ZodOptional; tolerance_seconds: z.ZodOptional; allow_ips: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"slack">; secret_env: z.ZodOptional; tolerance_seconds: z.ZodOptional; allow_ips: z.ZodOptional>; }, z.core.$strict>], "type">>; when: z.ZodOptional; header: z.ZodOptional; query: z.ZodOptional; equals: z.ZodOptional; not_equals: z.ZodOptional; in: z.ZodOptional>; matches: z.ZodOptional; exists: z.ZodOptional; contains: z.ZodOptional; }, z.core.$strict>>>; env: z.ZodOptional>; concurrency: z.ZodOptional; serialize_cwd: z.ZodOptional; dedupe: z.ZodOptional; header: z.ZodOptional; in_flight: z.ZodOptional; }, z.core.$strict>>; claude: z.ZodOptional>; allowed_tools: z.ZodOptional>; disallowed_tools: z.ZodOptional>; add_dirs: z.ZodOptional>; max_budget_usd: z.ZodOptional; append_system_prompt: z.ZodOptional; args: z.ZodOptional>; config_dir: z.ZodOptional; mcp_servers: z.ZodOptional>; command: z.ZodOptional; args: z.ZodOptional>; env: z.ZodOptional>; url: z.ZodOptional; headers: z.ZodOptional>; }, z.core.$strict>>>; strict_mcp: z.ZodOptional; }, z.core.$strict>>; codex: z.ZodOptional>; network_access: z.ZodOptional; profile: z.ZodOptional; add_dirs: z.ZodOptional>; args: z.ZodOptional>; }, z.core.$strict>>; shell: z.ZodOptional]>; }, z.core.$strict>>; fallback: z.ZodOptional, z.ZodObject<{ runner: z.ZodEnum<{ claude: "claude"; codex: "codex"; shell: "shell"; }>; model: z.ZodOptional; effort: z.ZodOptional; account: z.ZodOptional; }, z.core.$strict>]>>; on: z.ZodOptional>>; }, z.core.$strict>>; retry: z.ZodOptional>>; backoff_seconds: z.ZodOptional; }, z.core.$strict>>; agent_api: z.ZodOptional>; human_wait_seconds: z.ZodOptional; response: z.ZodOptional>; schema: z.ZodOptional>; }, z.core.$strict>>; enabled: z.ZodOptional; schedule: z.ZodOptional, z.ZodObject<{ cron: z.ZodString; timezone: z.ZodOptional; catch_up: z.ZodOptional>; overlap: z.ZodOptional>; payload: z.ZodOptional>; }, z.core.$strict>]>>; webhook: z.ZodOptional; description: z.ZodOptional; skill: z.ZodOptional; run: z.ZodOptional]>>; prompt: z.ZodOptional; }, z.core.$strict>>; }, z.core.$strict>; export type ProjectFile = z.infer; /** The path a `skills:` entry names. */ export declare function projectSkillPath(entry: ProjectSkillEntry): string; /** The name a `skill: "@name"` reference points at, or undefined for a path. */ export declare function declaredSkillReference(skill: string): string | undefined; export interface ProjectRef { /** What the config or the user named: a directory, or the YAML file itself. */ entry: string; /** The project (repository) directory. */ dir: string; /** The skillhook.yaml (the first of PROJECT_FILE_NAMES that exists, else the default name). */ file: string; } /** A directory entry points at `skillhook.yaml` inside it; an entry ending in `.yaml`/`.yml` is the file itself. */ export declare function resolveProject(entry: string, base?: string): ProjectRef; /** A skill declared under `skills:`, resolved. */ export interface ProjectSkill { name: string; /** The SKILL.md directory. */ dir: string; file: string; /** The hooks that refer to it as `@name`. */ hooks: string[]; /** Set when the directory or its SKILL.md is missing, invalid or named otherwise; no hook can use it then. */ error?: string; } export interface LoadedProject extends ProjectRef { /** Set when the file is missing or invalid as a whole; `hooks` is then empty. */ error?: string; /** Hooks that compiled, as routable skills. */ hooks: Skill[]; /** Hooks that did not compile (bad name, missing SKILL.md, …); the name is not routable. A declared skill that does not load is listed as `@`. */ errors: { name: string; error: string; }[]; /** The skills the repository declares under `skills:`, in file order. */ skills: ProjectSkill[]; /** mtime of every file the project was compiled from; `SkillRegistry` reloads when one changes. */ stamps: Record; } export declare function parseProjectFile(text: string, file: string): ProjectFile; /** Reads and compiles a project; never throws (problems land in `error` / `errors`). */ export declare function loadProject(entry: string, base?: string): LoadedProject; /** True while none of the files a project was compiled from has changed. */ export declare function projectIsFresh(project: LoadedProject): boolean; /** * Turns a hook into the same `Skill` shape a SKILL.md produces, so the server, runners and CLI need no special case. * `cwd` defaults to the project directory (a relative `cwd` is resolved against it) rather than the skill directory. * `declared` maps the names under `skills:` to their directories, for `skill: "@name"` references. */ export declare function compileHook(project: ProjectRef, name: string, hook: Hook, projectClaude?: ClaudeOptions, declared?: Record): Skill; /** Starter `skillhook.yaml` for `skillhook projects init`. */ export declare function renderProjectTemplate(): string;