@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
31 lines • 1.73 kB
TypeScript
/**
* `read_user_skill_file` / `write_user_skill_file` (omo-desktop-app#7981): read and edit the file of a user-global
* skill the engine lists for the session (one under the agent dir's skills root or `~/.agents/skills`), by name, on
* this machine or from another device of the account through the same verb.
*
* Containment: the listed file must lie inside a user skills root, taken relative to that root's real path and
* resolved segment by segment with `lstat`, so a skill reached through a link, a `..` path or one that lives elsewhere
* is refused (`user_skill_file_not_allowed`).
*
* A write from this device's own connection is pre-trusted and commits at once; a write from another device
* commits only after this device approves it (`user-skill-approval.ts`, duty ruling on #7981).
*/
import type { AgentSession } from "../../core/agent-session.ts";
import { type ProjectWriteRefusal } from "./project-write-gate.ts";
import type { RpcRemoteOrigin } from "./remote-origin.ts";
export interface RpcUserSkillFile {
skill: string;
path: string;
exists: boolean;
content: string | null;
etag: string | null;
/** Set when the write's audit line could not be written; the write's own outcome is unchanged. */
auditError?: string;
}
export type UserSkillFileResult = {
ok: true;
data: RpcUserSkillFile;
} | ProjectWriteRefusal;
export declare function readUserSkillFile(session: AgentSession, skill: unknown): Promise<UserSkillFileResult>;
export declare function writeUserSkillFile(session: AgentSession, skill: unknown, content: unknown, ifEtag: unknown, origin: RpcRemoteOrigin | undefined): Promise<UserSkillFileResult>;
//# sourceMappingURL=user-skill-commands.d.ts.map