import type { AgentTool } from "@caupulican/pi-agent-core"; import { type Static, Type } from "typebox"; import type { ToolDefinition } from "../extensions/types.ts"; import { type Skill } from "../skills.ts"; export declare const DEFAULT_BOUNDED_SKILL_AUDIT_LIMITS: Readonly<{ maxSkills: 256; maxComparisonPairs: 32768; maxDraftFieldChars: 16384; }>; export declare const DEFAULT_WORKER_SKILL_AUDIT_MAX_SKILLS: 256; export declare const DEFAULT_WORKER_SKILL_AUDIT_MAX_COMPARISON_PAIRS: 32768; export declare const DEFAULT_WORKER_SKILL_AUDIT_MAX_DRAFT_FIELD_CHARS: 16384; /** * Tokenize text by lowercasing, removing non-alphanumeric chars (except hyphens and colons), * splitting on whitespace, and filtering out short tokens and stopwords. */ export declare function tokenize(text: string): string[]; /** * Calculate Jaccard similarity between two token sets. * Jaccard(A, B) = |A ∩ B| / |A ∪ B| */ export declare function jaccard(a: string[], b: string[]): number; export interface SkillSummary { name: string; description: string; path: string; scope: string; keywords: string[]; } export interface SkillAuditReport { generatedAt: string; skills: SkillSummary[]; nearDuplicates: Array<{ a: string; b: string; similarity: number; reason: string; }>; compartmentWarnings: Array<{ skill: string; path: string; reason: string; }>; nameCollisions: Array<{ name: string; paths: string[]; }>; truncated?: boolean; recommendations?: string[]; } export interface SkillAuditRunOptions { signal?: AbortSignal; /** Maximum number of host-provided skills considered by a bounded worker audit. */ maxSkills?: number; /** Maximum number of pair comparisons performed by a bounded worker audit. */ maxComparisonPairs?: number; /** Maximum characters accepted in each draft field before any discovery or comparison work. */ maxDraftFieldChars?: number; } /** * Audit existing skills for overlap and compare against a draft skill. */ export declare function runSkillAudit(cwd: string, draftSkill?: { name?: string; description?: string; body?: string; }, providedSkills?: readonly Skill[], redactPath?: (path: string) => string, runOptions?: SkillAuditRunOptions): SkillAuditReport; declare const skillAuditSchema: Type.TObject<{ draftName: Type.TOptional; draftDescription: Type.TOptional; draftBody: Type.TOptional; }>; export type SkillAuditInput = Static; export interface SkillAuditToolDetails { reportPath?: string; } export interface SkillAuditToolOptions { /** Host-owned metadata source. Omitted uses the foreground global discovery path. */ getSkills?: () => readonly Skill[]; /** Redacts host paths in the structured report before they can reach a worker. */ redactPath?: (path: string) => string; /** Optional host-enforced bounds used by worker adapters; foreground callers remain unbounded. */ maxSkills?: number; maxComparisonPairs?: number; maxDraftFieldChars?: number; } export declare function createSkillAuditToolDefinition(cwd: string, _options?: SkillAuditToolOptions): ToolDefinition; export declare function createSkillAuditTool(cwd: string, options?: SkillAuditToolOptions): AgentTool; export {}; //# sourceMappingURL=skill-audit.d.ts.map