UNPKG

@code-yeongyu/senpi

Version:

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

28 lines • 1.23 kB
import { APP_NAME } from "../config.js"; export class SessionHeldError extends Error { constructor(sessionFile, holders) { const who = holders.map((h) => (h.cwd ? `pid ${h.pid} in ${h.cwd}` : `pid ${h.pid}`)).join("; "); super(`This session is open in another ${APP_NAME} process (${who}). Quit it there, then try again.`); this.code = "ESESSIONHELD"; this.name = "SessionHeldError"; this.sessionFile = sessionFile; this.holders = holders; } } export class SessionMovingError extends Error { constructor(sessionFile, moverPid) { const who = moverPid === undefined ? "another process" : `another process (pid ${moverPid})`; super(`Session ${sessionFile} is being moved by ${who}. Try again in a moment.`); this.code = "ESESSIONMOVING"; this.name = "SessionMovingError"; this.moverPid = moverPid; } } export class SessionMovedError extends Error { constructor(sessionFile) { super(`Session ${sessionFile} no longer exists: another process moved it. Resume it from its new location.`); this.code = "ESESSIONMOVED"; this.name = "SessionMovedError"; } } //# sourceMappingURL=session-hold-errors.js.map