UNPKG

@code-yeongyu/senpi

Version:

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

29 lines • 1.28 kB
const NOT_TASK_PARENT = "task_parent_required: only the connection that owns this task child may pause or resume it for a run"; export async function runPauseForRun(session, command, taskParent) { if (!taskParent) return { ok: false, error: NOT_TASK_PARENT }; const result = await session.pauseForRun(command); if ("refused" in result) return { ok: false, error: "wrong_parent: this child is paused for another parent session" }; return { ok: true, data: { held: true, childSeq: result.childSeq } }; } export async function runResumeForRun(session, command, taskParent) { if (!taskParent) return { ok: false, error: NOT_TASK_PARENT }; const result = await session.resumeForRun(command); if (!result.released) { if (result.reason === "wrong_parent") { return { ok: false, error: "wrong_parent: this child is paused for another parent session" }; } return { ok: true, data: { released: false, reason: result.reason } }; } return { ok: true, data: { released: true, otherHoldLive: result.otherHoldLive, ...(result.turnId === undefined ? {} : { turnId: result.turnId }), }, }; } //# sourceMappingURL=run-hold-commands.js.map