aiwg
Version:
Deployment tool and support utility for AI context. Copies agents, skills, commands, rules, and behaviors into the paths each AI platform reads (Claude Code, Codex, Copilot, Cursor, Warp, OpenClaw, and 6 more) so one source of truth works across 10 platfo
73 lines • 2.76 kB
TypeScript
/**
* Artifact Query Engine
*
* Searches the artifact index by keyword, type, phase, tags, and path pattern.
* Returns ranked results in human-readable or JSON format.
*
* @implements #416
* @source @src/artifacts/types.ts
* @tests @test/unit/artifacts/query-engine.test.ts
*/
import type { QueryParams, GraphType } from './types.js';
export interface QueryOptions {
json?: boolean;
graph?: GraphType;
}
/**
* Query the artifact index
*/
export declare function queryIndex(cwd: string, params: QueryParams, options?: QueryOptions): Promise<void>;
/**
* Discovery query — capability search across AIWG artifact kinds.
*
* Tuned for "agent looking for the right skill / agent / command / rule"
* use case. Defaults the type filter to AIWG artifact kinds, prefers the
* `framework` graph (where deployed source lives), and outputs in a
* token-tight format that names the top trigger phrase responsible for
* each match.
*
* @implements #1214
*/
export interface DiscoverParams {
/** Search phrase (the user's capability description) */
phrase: string;
/** Restrict to specific types — defaults to skill/agent/command/rule */
typeFilter?: string[];
/** Max results (default 10) */
limit?: number;
/** JSON output mode */
json?: boolean;
/** Override default graph (defaults to `framework`, falls back to `project`) */
graph?: GraphType;
}
export declare function discoverCapability(cwd: string, params: DiscoverParams): Promise<void>;
export interface ShowParams {
/** Skill name (e.g. `intake-wizard`), title, or artifact path */
name: string;
/** Restrict to specific types — defaults to skill/agent/command/rule */
typeFilter?: string[];
/** Emit a JSON envelope (path + content) instead of raw file text */
json?: boolean;
/** Override default graph (defaults to `framework`, falls back to `project`) */
graph?: GraphType;
/** When ambiguous, pick the first match instead of erroring */
first?: boolean;
}
/**
* Read and emit the full text of a specific artifact (typically a
* SKILL.md). Consumers don't need to know where AIWG stores skills —
* they pass the skill name and the CLI reads the file from the indexed
* location.
*
* Lookup order:
* 1. Exact path match against any indexed entry's stored path
* 2. Basename match (e.g. `intake-wizard` matches an entry whose
* directory basename is `intake-wizard`)
* 3. Title match (case-insensitive)
* 4. Corpus fallback under AIWG_ROOT (#1221)
*
* On ambiguity, lists all matches and exits with code 2 unless
* `--first` is supplied.
*/
export declare function showArtifact(cwd: string, params: ShowParams): Promise<void>;
//# sourceMappingURL=query-engine.d.ts.map