import type { ExecutionArtifact } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/artifact_pb";
/**
 * Result of detecting whether an execution artifact is a pushable skill package.
 *
 * Uses a discriminated union on the `detected` field — identical pattern
 * to {@link StigmerResourceDetection} — so consumers can narrow with a
 * simple `if (result.detected)` check.
 *
 * Skill detection is a **parallel** path to YAML resource detection:
 *
 * - **YAML detection** (`detectStigmerResource`): Agents, MCP Servers — applied via `apply()`
 * - **Package detection** (`detectSkillPackage`): Skill packages (directory with SKILL.md) — pushed via `pushFromExecutionArtifact()`
 */
export type SkillPackageDetection = {
    /** Discriminant — `false` when no skill package was detected. */
    readonly detected: false;
} | {
    /** Discriminant — always `true` when a skill package was detected. */
    readonly detected: true;
    /** Skill name extracted from SKILL.md YAML frontmatter. */
    readonly skillName: string;
    /** Optional description from SKILL.md frontmatter. */
    readonly skillDescription: string | undefined;
    /** Number of files in the package archive. */
    readonly fileCount: number;
    /** Relative file paths within the archive (from `ExecutionArtifact.entries`). */
    readonly entries: readonly string[];
};
/**
 * Checks whether an execution artifact is a skill package (directory
 * artifact whose archive contains `SKILL.md`).
 *
 * This is a pure, synchronous check that requires no network call — it
 * inspects the `entries` field populated by the agent runner at ZIP
 * creation time.
 *
 * Returns `false` for:
 * - FILE artifacts (regardless of name)
 * - DIRECTORY artifacts without `entries` (older artifacts before this field was added)
 * - DIRECTORY artifacts whose entries do not include `SKILL.md`
 *
 * @param artifact - Artifact from `execution.status.artifacts`.
 *
 * @example
 * ```ts
 * if (isSkillPackage(artifact)) {
 *   // Show "Push Skill" CTA
 * }
 * ```
 */
export declare function isSkillPackage(artifact: ExecutionArtifact): boolean;
/**
 * Detects a skill package and extracts metadata from its SKILL.md content.
 *
 * Call this after fetching the SKILL.md content from the ZIP via
 * `useArtifactContent(executionId, storageKey, "SKILL.md")`. The function
 * parses the YAML frontmatter to extract `name` and `description`.
 *
 * **Resilient by design** — any parse failure, missing field, or unexpected
 * structure returns `{ detected: false }`. This function never throws.
 *
 * @param artifact - The execution artifact (must be a DIRECTORY with SKILL.md in entries).
 * @param skillMdContent - Raw text content of SKILL.md fetched from the archive.
 * @returns A discriminated union with skill metadata when detection succeeds.
 *
 * @example
 * ```ts
 * const { content } = useArtifactContent(executionId, storageKey, "SKILL.md");
 * const detection = detectSkillPackage(artifact, content);
 *
 * if (detection.detected) {
 *   console.log(`Skill: ${detection.skillName} (${detection.fileCount} files)`);
 * }
 * ```
 *
 * @see {@link isSkillPackage} for the lightweight check (no content needed)
 * @see {@link useDetectSkillPackage} for the React hook that automates the full flow
 */
export declare function detectSkillPackage(artifact: ExecutionArtifact, skillMdContent: string): SkillPackageDetection;
//# sourceMappingURL=detect-skill-package.d.ts.map