import type { ScopeEntry, SkillEntry } from '../../common'; import type { SkillLoadResult } from '../../common/entries/skill.entry'; import type { SkillInstance } from '../skill.instance'; /** * Get all skills visible under MCP that the SEP-2640 transport binding * should surface (skills whose `visibility` allows MCP). */ export declare function getSepVisibleSkills(scope: ScopeEntry): SkillEntry[]; /** * Look up a skill by its effective `` (joined by `/`). * * Falls back to lookup-by-name when no skill matches the full path — * supporting clients that pass `skill://my-skill/SKILL.md` for skills * registered without an explicit `metadata.skillPath`. */ export declare function findSkillByPath(scope: ScopeEntry, skillPath: string): SkillEntry | undefined; /** * Load a skill addressed by its ``, asserting MCP visibility. */ export declare function findAndLoadSkillByPath(scope: ScopeEntry, skillPath: string): Promise<{ loadResult: SkillLoadResult; instance: SkillInstance; }>; /** * Result of reading a skill sub-file. Mirrors the MCP * `TextResourceContents` / `BlobResourceContents` split: text resources * carry decoded UTF-8 string content, binary resources carry base64- * encoded bytes that the resource handler emits via `blob`. */ export type SkillFileReadResult = { kind: 'text'; content: string; mimeType: string; } | { kind: 'blob'; blob: string; mimeType: string; }; /** * Read an arbitrary file inside a skill directory by URI-relative path. * * Resolution order: * 1. **In-memory resolved references / examples** — for inline * (filesystem-agnostic) skills the SkillContent carries the bundled * body inline; we serve from there first. This satisfies SEP-2640's * "skills MUST function correctly without a local filesystem" * requirement. * 2. **Filesystem under the skill's base directory** — for file-backed * skills with declared `resources.{references,examples,scripts,assets}` * directories or top-level files like `LICENSE`. Path-traversal is * blocked via prefix check + explicit `.` / `..` segment rejection. * * Returns either a text or blob result depending on the MIME type, so * binary assets (images, archives) are not corrupted by UTF-8 decoding. */ export declare function readSkillFileByPath(instance: SkillInstance, filePath: string): Promise; //# sourceMappingURL=sep-2640.resource-helpers.d.ts.map