import type { SkillToolAuditEvent, SkillToolResult } from "./baseToolAdapter.js";
export type SkillBasePermission = "skill:read" | "skill:write" | "filesystem:read" | "filesystem:write";
export type SkillBaseBoundary = "input" | "scope" | "permission" | "governance" | "provider" | "contract" | "resource";
export type SkillBaseGuard = {
    accepted?: boolean;
    allowed?: boolean;
    reason?: string;
};
export type SkillBaseContext = {
    runtimeId?: string;
    sessionId?: string;
    invocationId?: string;
    dryRun?: boolean;
    workspaceRoot?: string;
    guard?: SkillBaseGuard;
    allowedRoots?: readonly string[];
    allowedSkillIds?: readonly string[];
    grantedPermissions?: readonly SkillBasePermission[];
    auditMetadata?: Readonly<Record<string, unknown>>;
};
export type SkillFilesystemProvider = {
    readText?(request: {
        path: string;
        encoding?: string;
        maxBytes?: number;
    }): Promise<{
        content: string;
        truncated: boolean;
    }>;
    writeText?(request: {
        path: string;
        content: string;
        encoding?: string;
    }): Promise<{
        bytesWritten: number;
    }>;
    deletePath?(request: {
        path: string;
        recursive?: boolean;
    }): Promise<{
        deleted: boolean;
    }>;
    list?(request: {
        path: string;
        maxEntries?: number;
        depth?: number;
        includeGlobs?: readonly string[];
        excludeGlobs?: readonly string[];
    }): Promise<{
        entries: readonly string[];
    }>;
};
export type SkillRipgrepProvider = {
    ripgrep(request: {
        command: readonly string[];
        query: string;
        directoryPath: string;
        fileGlob?: string;
        maxMatches: number;
        literal: boolean;
        caseSensitive: boolean;
        includeHidden: boolean;
        multiline: boolean;
        contextLines: number;
        context?: Readonly<Record<string, unknown>>;
    }): Promise<{
        exitCode: number;
        matches: readonly {
            path: string;
            line: number;
            column?: number;
            text: string;
        }[];
        stderr?: string;
    }>;
};
export type SkillFrontmatter = {
    name: string;
    description: string;
    metadata?: Readonly<Record<string, unknown>>;
};
export type SkillResourceIndex = {
    root: string;
    entries: readonly string[];
    truncated: boolean;
};
export declare const skillNamePattern: RegExp;
export declare function isRecord(value: unknown): value is Record<string, unknown>;
export declare function stringValue(value: unknown): string | undefined;
export declare function booleanValue(value: unknown): boolean | undefined;
export declare function integerValue(value: unknown): number | undefined;
export declare function stringArrayValue(value: unknown): readonly string[] | undefined;
export declare function dryRunEnabled(context: SkillBaseContext | undefined): boolean;
export declare function normalizeRoot(root: string): string;
export declare function unsafePath(value: string): boolean;
export declare function joinPath(root: string, ...segments: readonly string[]): string;
export declare function relativeSkillPath(path: string): boolean;
export declare function isSafeSkillName(skillId: string): boolean;
export declare function isSafeSkillDirectoryName(skillName: string): boolean;
export declare function isInsideAllowedRoots(targetPath: string, allowedRoots: readonly string[] | undefined): boolean;
export declare function isAllowedSkillId(skillId: string | undefined, allowedSkillIds: readonly string[] | undefined): boolean;
export declare function affirmativeGuard(context: SkillBaseContext | undefined): boolean;
export declare function createAuditEvent(toolId: string, type: string, context: SkillBaseContext | undefined, targetRef?: string, metadata?: Readonly<Record<string, unknown>>): SkillToolAuditEvent;
export declare function failure<Output, Code extends string>(toolId: string, code: Code, message: string, boundary: SkillBaseBoundary, context: SkillBaseContext | undefined, targetRef?: string): SkillToolResult<Output, Code>;
export declare function ensureRealExecutionAllowed<Output, Code extends string>(toolId: string, context: SkillBaseContext | undefined, targetRef: string | undefined): SkillToolResult<Output, Code> | undefined;
export declare function ensurePermissions<Output, Code extends string>(toolId: string, required: readonly SkillBasePermission[], context: SkillBaseContext | undefined, targetRef?: string): SkillToolResult<Output, Code> | undefined;
export declare function parseSkillFrontmatter(content: string, fallbackName: string): SkillFrontmatter;
export declare function listSkillResources(provider: SkillFilesystemProvider | undefined, skillRoot: string, maxEntries?: number): Promise<SkillResourceIndex>;
export declare function buildSkillMarkdown(name: string, description: string, purpose: string, tags: readonly string[]): string;
export declare function sourcePreview(content: string, limit?: number): string;
