/** * Skill seeding for createAgent({ skills }) — portable core. * * A skill's canonical shape is a directory: `SKILL.md` plus optional support * files (scripts/, references/, ...). Callers pass either a path to such a * directory or an inline {@link AgentSkill} object. * * The platform stores `skills/{name}/SKILL.md` as a memory block labeled * `skills/{name}` (see letta-cloud `blockMarkdownPath.ts` / * `path_mapping.py`), so SKILL.md instructions ride the create-agent request * as a memory block. Support files have no block representation; they are * pushed to the agent's memory git repo after creation. * * This module is part of the portable client graph and must stay free of * Node imports. Directory loading and the git push live in `skill-node.ts`, * behind the package root, and are injected by the Node client. */ /** * A skill to seed into a new agent's memory filesystem at creation. * * The instructions become `skills/{name}/SKILL.md` in the agent's memory * repo (stored as the memory block labeled `skills/{name}`), so the agent * owns and can edit the skill like any other memory. Support `files` land * beside it (`skills/{name}/{path}`); they require the Cloud backend from * Node. */ export interface AgentSkill { /** Directory name: lowercase letters, digits, ".", "_", "-". */ name: string; /** * Trigger text: when the agent should load this skill. Rendered as the * SKILL.md frontmatter description and always visible to the agent. */ description: string; /** SKILL.md body (markdown, without frontmatter). */ instructions: string; /** * Optional support files, keyed by path relative to the skill directory * (e.g. "scripts/convert.sh"). Cloud backend from Node only. */ files?: Record; } /** * Skill item for createAgent(): a path to a skill directory containing * SKILL.md (Node runtimes only), or an inline {@link AgentSkill}. */ export type SkillItem = string | AgentSkill; /** Loads a skill directory from disk. Node-only; see skill-node.ts. */ export type SkillDirectoryLoader = (dirPath: string) => Promise; /** Pushes skill support files to an agent's memory git repo. Node-only. */ export type SkillFilesPusher = (target: { apiBaseUrl: string; apiKey: string; agentId: string; }, skills: AgentSkill[]) => Promise; /** Node-only skill capabilities injected by the package-root client. */ export interface SkillNodeSupport { loadSkillDirectory: SkillDirectoryLoader; pushSkillSupportFiles: SkillFilesPusher; } export declare function assertValidSkillName(name: string): void; /** * Minimal YAML frontmatter reader for SKILL.md: extracts `name` and * `description` (plain, quoted, or `>`/`>-` folded scalars) and returns the * body without the frontmatter fence. Anything unparsable is left in place. */ export declare function parseSkillMarkdown(content: string): { name?: string; description?: string; body: string; }; /** * Resolve every skill item to an AgentSkill. Directory paths need the * injected Node loader; without one (portable clients) they are rejected. */ export declare function resolveSkillItems(items: SkillItem[] | undefined, loadDirectory?: SkillDirectoryLoader): Promise; /** True when any resolved skill carries support files beyond SKILL.md. */ export declare function skillsHaveSupportFiles(skills: AgentSkill[]): boolean; /** Collect `skills/{name}/{relPath}` entries for every skill support file. */ export declare function skillSupportFileEntries(skills: AgentSkill[]): Array<{ path: string; data: Uint8Array; }>; //# sourceMappingURL=skill-loading.d.ts.map