/** * peaks skill search — service-layer primitive for S0 of the * 4.0.0-beta.5 peaks-solo dispatcher release. * * * This service is the single source of truth for skill pool retrieval * and is reused by the `peaks skill search` CLI. It is intentionally * pure (synchronous frontmatter parse + substring scoring) so the * dispatcher (`peaks-solo`, S1) can call it without paying for any * async I/O during the triage decision flow. * * v1 scope (locked, see plan §"Match rules (v1)"): * - --query: case-insensitive substring match on description + triggers * - --tag: case-insensitive exact match on `metadata.tags` * - --domain: exact match on `metadata.domain` (locked enum) * - All three compose with AND; at least one filter is required * - No match → `[]` (not error, not null) * - --limit truncates to the top N by matchScore desc * * Out of v1 scope (deferred, see plan §"Goal"): fuzzy / FTS5 / semantic * matching, ML-based ranking, pagination, i18n, caching. */ import { z } from 'zod'; import { skillsDir } from 'peaks-loop-shared/paths'; export declare const SkillSearchInputSchema: z.ZodObject<{ query: z.ZodOptional; tag: z.ZodOptional; domain: z.ZodOptional>; limit: z.ZodOptional>; includeInternal: z.ZodOptional>; }, z.core.$strip>; export type SkillSearchInput = z.input; export declare const SkillSearchResultSchema: z.ZodObject<{ name: z.ZodString; description: z.ZodString; triggers: z.ZodArray; tags: z.ZodArray; domain: z.ZodString; matchScore: z.ZodNumber; }, z.core.$strip>; export type SkillSearchResult = z.infer; /** * Search the in-tree skill pool. Validates `input` against * `SkillSearchInputSchema`; the schema's refine rejects empty input * with a ZodError, which is the contract test U-7 / I-3 rely on. * * @param input One of `query | tag | domain` is required. * All provided filters compose with AND. * @returns Matching skills sorted by matchScore desc, name asc. * Empty array (not error, not null) when nothing matches. */ export declare function searchSkills(rawInput: SkillSearchInput): Promise; export { skillsDir as __skillsDirForTests };