Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
One-time setup that gathers your project's design context and saves it to CLAUDE.md for future sessions.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
scripts/live-status.mjs
1#!/usr/bin/env node2/**3* Print durable recovery status for Impeccable live sessions.4*/56import { createLiveSessionStore } from './live/session-store.mjs';7import { readLiveServerInfo } from './lib/impeccable-paths.mjs';8import { manualApplyResumeHint } from './live-resume.mjs';910function readServerInfo() {11return readLiveServerInfo(process.cwd())?.info || null;12}1314async function fetchServerStatus(info) {15if (!info) return null;16try {17const res = await fetch(`http://localhost:${info.port}/status?token=${info.token}`);18if (!res.ok) return null;19return await res.json();20} catch {21return null;22}23}2425export async function statusCli() {26const info = readServerInfo();27const server = await fetchServerStatus(info);28const store = createLiveSessionStore({ cwd: process.cwd() });29const activeSessions = store.listActiveSessions();30const manualApply = findPendingManualApply(server, activeSessions);31const payload = {32liveServer: server ? {33status: server.status,34port: server.port,35connectedClients: server.connectedClients,36agentPolling: server.agentPolling,37pendingEvents: server.pendingEvents,38} : null,39activeSessions: server?.activeSessions || activeSessions,40recoveryHint: manualApply41? manualApplyResumeHint(manualApply)42: server43? 'Run live-poll.mjs to continue pending work, or live-complete.mjs --id <session> after manual cleanup.'44: 'Start live-server.mjs to requeue pending durable events, then run live-poll.mjs.',45};46console.log(JSON.stringify(payload, null, 2));47}4849function findPendingManualApply(server, activeSessions) {50const fromServer = server?.pendingEvents?.find((event) => event?.type === 'manual_edit_apply');51if (fromServer) return fromServer;52const fromSession = activeSessions53?.map((session) => session.pendingEvent)54.find((event) => event?.type === 'manual_edit_apply');55return fromSession || null;56}5758const _running = process.argv[1];59if (_running?.endsWith('live-status.mjs') || _running?.endsWith('live-status.mjs/')) {60statusCli();61}62