"use strict";var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(e,r)=>{for(var t in r)__defProp(e,t,{get:r[t],enumerable:!0})},__copyProps=(r,t,o,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let e of __getOwnPropNames(t))__hasOwnProp.call(r,e)||e===o||__defProp(r,e,{get:()=>t[e],enumerable:!(s=__getOwnPropDesc(t,e))||s.enumerable});return r},__toESM=(e,r,t)=>(t=null!=e?__create(__getProtoOf(e)):{},__copyProps(!r&&e&&e.__esModule?t:__defProp(t,"default",{value:e,enumerable:!0}),e)),__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),build_status_exports={},fs=(__export(build_status_exports,{handler:()=>handler,method:()=>method,path:()=>path}),module.exports=__toCommonJS(build_status_exports),__toESM(require("fs"))),CORS_HEADERS={"Access-Control-Allow-Origin":"*"},jsonHeaders=(e={})=>({"Content-Type":"application/json",...CORS_HEADERS,...e}),sendJson=(e,r,t,o={})=>{e.sendResponse(r,jsonHeaders(o),JSON.stringify(t))},sendError=(e,r,t)=>{sendJson(e,r,{success:!1,error:t})},sendInternalError=(e,r,t)=>{console.error(`[CPL-Server] Error in ${r}:`,t),sendError(e,500,"Internal server error")},method="GET",path=/^\/cpl\/build-status$/,BUILD_STATUS_FILE="/tmp/cpl-build-status.json",readBuildStatus=()=>{try{if(fs.existsSync(BUILD_STATUS_FILE))return JSON.parse(fs.readFileSync(BUILD_STATUS_FILE,"utf-8"))}catch{}return{phase:"idle",message:"Server is running",startedAt:""}},handler=(e,r,t)=>{try{var o=readBuildStatus();sendJson(t,200,o,{"Cache-Control":"no-cache"})}catch(s){sendInternalError(t,"build-status handler",s)}};