/** A tool the skill can call, normalized across MCP / OpenAI function / OpenAPI action shapes. */ export interface NormalizedTool { /** Tool id, e.g. `run_command`. Stable across every target. */ name: string; /** One-line human description. Reused as OpenAPI summary / openai.yaml comment / hint justification. */ description: string; /** JSON Schema for the arguments object. Empty object => no parameters. */ inputSchema: Record; /** OpenAI Apps submission hints. Default to a safe read-only posture when omitted. */ readOnlyHint?: boolean; destructiveHint?: boolean; openWorldHint?: boolean; } /** A file that ships alongside the skill body: a reference doc or an executable script. */ export interface KnowledgeFile { /** Path relative to the skill package root, e.g. `references/api.md` or `scripts/run.py`. */ path: string; role: 'reference' | 'script'; content: string; } /** The shared IR every adapter consumes. */ export interface SkillIR { name: string; description: string; /** Markdown body of SKILL.md (everything after the frontmatter). */ instructions: string; knowledgeFiles: KnowledgeFile[]; /** One-line statement of the skill's primary job; defaults to `name` if not derivable. */ primaryCapability: string; tools: NormalizedTool[]; /** Optional model hint carried through to the Claude emitter's frontmatter. */ model?: string; } interface Frontmatter { fields: Record; body: string; } /** * Parse a `---`-delimited YAML-ish frontmatter block without a YAML dependency. Only flat * `key: value` pairs are supported, which is all a SKILL.md header uses. */ export declare function parseFrontmatter(src: string): Frontmatter; export interface BuildIROptions { /** Normalized tool specs for the skill (from an MCP surface, a tools.json, etc.). */ tools?: NormalizedTool[]; /** Override the derived primary capability. */ primaryCapability?: string; } /** * Derive a SkillIR from an existing Fragment-emitted skill directory. * * Expects `/SKILL.md` with `name` + `description` frontmatter. `scripts/` and * `references/` (if present) become knowledgeFiles. Tools are supplied via opts (or a sibling * `tools.json`) since a plain skill folder does not declare them. */ export declare function buildIRFromSkill(skillDir: string, opts?: BuildIROptions): SkillIR; /** Load a serialized IR (`skill.ir.json`) straight from disk. */ export declare function loadIR(irPath: string): SkillIR; /** Apply safe default OpenAI hints: read-only, non-destructive, closed-world unless stated. */ export declare function withHintDefaults(tool: NormalizedTool): Required>; export {}; //# sourceMappingURL=ir.d.ts.map