// Protocol command/type constants. Mirrors the subset of // android/app/src/main/java/net/awan/pipelines/data/protocol/Message.kt and // internal/protocol/*.go used by this spike, so renames cannot drift silently. export const Protocol = Object.freeze({ PING: "ping", PONG: "pong", ERROR: "error", LIST: "list_pipelines", PIPELINE_LIST: "pipelines", GET_PIPELINE: "get_pipeline", PIPELINE: "pipeline", LIST_RUNS: "list_runs", RUNS: "runs", GET_RUN: "get_run", RUN: "run", SUCCESS_END: "#success", FAILURE_END: "#failure", }); export function isTerminal(target) { return target === Protocol.SUCCESS_END || target === Protocol.FAILURE_END; } /** Mirrors protocol.ResolveTarget: preserve the # shorthand as an explicit terminal. */ export function resolveTarget(outcome, target) { if (target !== "#") return target; return outcome === "error" ? Protocol.FAILURE_END : Protocol.SUCCESS_END; }