UNPKG

@code-yeongyu/senpi

Version:

Coding agent CLI with read, bash, edit, write tools and session management

29 lines • 1.56 kB
/** * `read_project_skill_file` / `write_project_skill_file` (senpi#6485): read and edit the file of a skill the engine * lists for the session, so a remote client edits skills like a local one. * * Only a listed skill's own file is reachable, and only while it lies inside the session folder: its path is taken * relative to the folder and resolved segment by segment with `lstat`, so a skill reached through a folder link or a * file link that leaves the folder (or a skill that lives elsewhere, like a global one) is refused. Reading runs * nothing, so trust does not gate it; a write names the version it replaces and passes `project-write-gate.ts`. */ import type { AgentSession } from "../../core/agent-session.ts"; import { type ProjectWriteRefusal } from "./project-write-gate.ts"; export interface RpcProjectSkillFile { cwd: string; skill: string; /** The folder-relative path of the skill's file. */ path: string; exists: boolean; content: string | null; /** Opaque version of the stored bytes; compare it, never parse it. */ etag: string | null; projectTrusted: boolean; } export type ProjectSkillFileResult = { ok: true; data: RpcProjectSkillFile; } | ProjectWriteRefusal; export declare function readProjectSkillFile(session: AgentSession, skill: unknown): Promise<ProjectSkillFileResult>; export declare function writeProjectSkillFile(session: AgentSession, skill: unknown, content: unknown, ifEtag: unknown): Promise<ProjectSkillFileResult>; //# sourceMappingURL=project-skill-commands.d.ts.map