AI Engineering Workspace
PartialChat, files, terminal and preview in one place. Chat sessions run on a durable Postgres-backed queue (chat only: no tools or shell). Live models need an API key; the terminal is unavailable.
Project files
read-only- ..
- assets
- basic-languages
- editor
- language
- nls
- abap-D-t0cyap.js
- apex-CcIm7xu6.js
- azcli-BA0tQDCg.js
- bat-C397hTD6.js
- bicep-DF5aW17k.js
- cameligo-plsz8qhj.js
- clojure-Y2auQMzK.js
- coffee-Bu45yuWE.js
- cpp-CkKPQIni.js
- csharp-CX28MZyh.js
- csp-D8uWnyxW.js
- css-CaeNmE3S.js
- css.worker-C7XcYe5x.js
- cssMode-DpEkhVlW.js
- cypher-DVThT8BS.js
- dart-CmGfCvrO.js
- dockerfile-CZqqYdch.js
- ecl-30fUercY.js
- editor-CG9c2pE-.js
- editor.js
- elixir-O3PRlgxO.js
- flow9-DqtmStfK.js
- freemarker2-DTUDMAl2.js
- fsharp-BOMdg4U1.js
- go-D_hbi-Jt.js
- graphql-CKUU4kLG.js
- handlebars-qLqoXa-4.js
- hcl-DTaboeZW.js
- html-DTxBj26n.js
- html.worker-VIR_LTyv.js
- htmlMode-DFBg6CMj.js
- index-BVflv2uG.js
- index.js
- ini--YXggpAu.js
- java-CI4ZMsH9.js
- javascript-BiL3JN6i.js
- json.worker-DzWXGkG8.js
- jsonMode-Dz4r0pwo.js
- julia-BwzEvaQw.js
- kotlin-IUYPiTV8.js
- less-C0eDYdqa.js
- lexon-iON-Kj97.js
- liquid-lXEUQRVn.js
- loader.js
- lspLanguageFeatures-IeRAvoKK.js
- lua-DtygF91M.js
- m3-CsR4AuFi.js
- markdown-C_rD0bIw.js
- mdx-Dtr248s4.js
- mips-CiYP61RB.js
- monaco.contribution-BRs4bdz5.js
- monaco.contribution-ChoOM5Gg.js
- monaco.contribution-DbKqsbmO.js
- monaco.contribution-DKFaWvum.js
- msdax-C38-sJlp.js
- mysql-CdtbpvbG.js
- nls.messages-loader.js
- objective-c-CntZFaHX.js
- pascal-r6kuqfl_.js
- pascaligo-BiXoTmXh.js
- perl-DABw_TcH.js
- pgsql-me_jFXeX.js
- php-D_kh-9LK.js
- pla-VfZjczW0.js
- postiats-BBSzz8Pk.js
- powerquery-Dt-g_2cc.js
- powershell-B-7ap1zc.js
- protobuf-BmtuEB1A.js
- pug-BRpRNeEb.js
- python-Cma5OvNe.js
- qsharp-BzsFaUU9.js
- r-f8dDdrp4.js
- razor-C8pOqqry.js
- redis-fvZQY4PI.js
- redshift-45Et0LQi.js
- restructuredtext-C7UUFKFD.js
- ruby-CZO8zYTz.js
- rust-Bfetafyc.js
- sb-3GYllVck.js
- scala-foMgrKo1.js
- scheme-CHdMtr7p.js
- scss-C1cmLt9V.js
- shell-ClXCKCEW.js
- solidity-MZ6ExpPy.js
- sophia-DWkuSsPQ.js
- sparql-AUGFYSyk.js
- sql-32GpJSV2.js
- st-CuDFIVZ_.js
- swift-t-PfMj7W.js
- systemverilog-Ch4vA8Yt.js
- tcl-D74tq1nH.js
- toggleHighContrast-CmI6H2gJ.js
- ts.worker-Dp2_QI6H.js
- tsMode-DgC3tGu_.js
- twig-C6taOxMV.js
- typescript-PjDChiYw.js
- typespec-D-PIh9Xw.js
- vb-Dyb2648j.js
- wgsl-BhLXMOR0.js
- workers-B_Zs9c54.js
- xml-BgCkTIhY.js
- yaml-D0tu26m-.js
app/src/lib/proxy-core.mjs
1// Customer hosting: domain validation, DNS instructions, and the Caddyfile renderer (mirrors agent/zoo-cloud-agent.mjs; QA compares both outputs byte-for-byte).2// Proxy choice: Caddy — single static binary, automatic HTTPS (ACME HTTP-01/TLS-ALPN) with renewal built in, validate-then-reload via admin API, tiny config.3// Nginx would need certbot + cron; Traefik needs a provider/dynamic config layer. Caddy is the smallest managed surface for an unprivileged agent.4export const HOST_OK = /^(?=.{4,253}$)([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/;5export const PLATFORM_SUFFIXES = ["zoobd.com", "zloud.io", "gpt.com"]; // never customer-mappable (platform / third-party domains)6export function checkHostname(h) {7 const x = String(h ?? "").trim().toLowerCase().replace(/\.$/, ""); if (!HOST_OK.test(x)) return { ok: false, error: "enter a valid domain name such as app.example.com (no scheme, port, path or wildcard)" };8 if (/^\d+(\.\d+){3}$/.test(x) || x.endsWith(".local") || x.endsWith(".internal") || x.endsWith(".localhost")) return { ok: false, error: "IP addresses and internal names are not allowed" };9 if (PLATFORM_SUFFIXES.some(s => x === s || x.endsWith("." + s))) return { ok: false, error: "this domain belongs to the platform operator or a third party and cannot be connected" };10 return { ok: true, hostname: x };11}12export const isApex = h => h.split(".").length <= 2 || /\.(co|com|org|net|gov|ac)\.[a-z]{2}$/.test(h) && h.split(".").length <= 3;13export const verifyName = h => `_zloud-verify.${h}`;14/** DNS records the customer must create, derived from the real target node (public IP or hostname). */15export function dnsInstructions(hostname, token, target) {16 const rec = []; const isIp = /^(\d{1,3}\.){3}\d{1,3}$/.test(target ?? ""); const isV6 = /:/.test(target ?? "");17 if (!target) return { records: [], note: "The server has no public address recorded. Re-enroll the agent with --public-host <public IP or hostname>." };18 if (isIp) rec.push({ type: "A", name: hostname, value: target, purpose: "routes the domain to your server" }); else if (isV6) rec.push({ type: "AAAA", name: hostname, value: target, purpose: "routes the domain to your server" });19 else rec.push(isApex(hostname) ? { type: "A", name: hostname, value: `(the IP address of ${target})`, purpose: "an apex domain cannot be a CNAME; use the server's IP" } : { type: "CNAME", name: hostname, value: target, purpose: "routes the domain to your server" });20 rec.push({ type: "TXT", name: verifyName(hostname), value: token, purpose: "proves you control the domain" }); return { records: rec, note: "DNS changes can take minutes to hours. Ports 80 and 443 must be reachable on the server for certificate issuance." };21}22export function renderCaddyfile(sites, admin = "127.0.0.1:2019") {23 const out = [`{\n\tadmin ${admin}\n}\n`]; for (const s of sites) {24 if (!HOST_OK.test(s.hostname)) throw new Error(`invalid hostname ${String(s.hostname).slice(0, 60)}`);25 if (s.redirectTo) { if (!HOST_OK.test(s.redirectTo)) throw new Error("invalid redirect target"); out.push(`${s.hostname} {\n\tredir https://${s.redirectTo}{uri} permanent\n}\n`); continue; }26 if (!Number.isInteger(s.port) || s.port < 20000 || s.port > 29999) throw new Error("upstream port must be a managed application port (20000-29999)");27 out.push(`${s.hostname} {\n\tencode gzip\n\theader X-Content-Type-Options nosniff\n\treverse_proxy 127.0.0.1:${s.port}\n}\n`);28 } return out.join("\n");29}30/** Pure DNS evaluation: txt = TXT strings at _zloud-verify.<host>; a = A/AAAA answers for <host>; cname = CNAME answers. Ownership needs the TXT token; routing needs the target address. */31export function evaluateDns({ txt = [], a = [], cname = [] }, token, target, resolvedTarget = []) {32 const owned = txt.map(s => String(s).trim()).includes(token); const want = new Set([target, ...resolvedTarget].filter(Boolean));33 const routed = a.some(x => want.has(x)) || cname.map(c => String(c).replace(/\.$/, "").toLowerCase()).includes(String(target).toLowerCase());34 return { owned, routed, dns: owned ? (routed ? "ok" : a.length || cname.length ? "wrong-target" : "no-route-record") : "ownership-not-proven" };35}36
Conversation
PartialSign in to start AI sessions.
Task checklist
- Application shell deployed
- Persistent projects
- Agent runtime
- Sandboxed terminal
Execution activity
No agent sessions. Git HEAD 692573d on master.
Approval requests
None pending.