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/marketplace-core.mjs
1// Zloud Marketplace catalog + parameter validation (pure). Shared by the control plane and the QA suite.2// "verified" is NEVER set here: it is derived at runtime from recorded successful deployments (see /api/cloud/apps GET).3// Deployable kinds are the ones the agent can run WITHOUT root: "static" (agent-served files), "node" (inline Node script), "git-node" (git clone + npm).4// Everything else is catalogued with its requirements but is not deployable yet (needs Docker/root) and says so.5export const PORT_RANGE = { min: 20000, max: 29999 };6const common = { rollback: "automatic: a release that fails its health check is stopped and the previous healthy release is restarted", storage: "per-app directory under the agent home (releases kept: 3)" };7export const TEMPLATES = [8 { id: "static-site", name: "Static Website", kind: "static", version: "1.0.0", deployable: true, summary: "Serve HTML/CSS/JS files from your own VPS.", requires: [], resources: { cpu: "0.05", memMb: 64, diskMb: 50 }, ports: ["http (auto-allocated 20000–29999)"], secrets: [], health: "GET / returns < 500 within 10 s", ...common,9 params: [{ key: "title", label: "Page title", type: "string", max: 80, default: "Hello from Zloud" }, { key: "html", label: "index.html body", type: "text", max: 20000, default: "<h1>Hello from Zloud</h1>" }] },10 { id: "node-app", name: "Node.js", kind: "node", version: "1.0.0", deployable: true, summary: "Run a Node.js HTTP server (server.js) with environment variables.", requires: ["node>=18"], resources: { cpu: "0.25", memMb: 256, diskMb: 200 }, ports: ["http (auto-allocated; passed as $PORT)"], secrets: ["optional env vars (stored encrypted-at-rest is NOT implemented: use only non-critical values)"], health: "GET / returns < 500 within 10 s", ...common,11 params: [{ key: "code", label: "server.js (must listen on process.env.PORT)", type: "text", max: 50000, required: true, default: "require('http').createServer((q,s)=>s.end('Hello from Zloud Node')).listen(process.env.PORT,'0.0.0.0')" }, { key: "env", label: "Environment (KEY=value per line)", type: "env", max: 20 }] },12 { id: "git-node", name: "Git repository (Node.js)", kind: "git-node", version: "1.0.0", deployable: true, summary: "Clone an https Git repository, run npm install, then npm start.", requires: ["node>=18", "git", "npm"], resources: { cpu: "0.5", memMb: 512, diskMb: 1000 }, ports: ["http (auto-allocated; passed as $PORT)"], secrets: ["optional env vars"], health: "GET / returns < 500 within 30 s", ...common,13 params: [{ key: "repo", label: "HTTPS Git URL", type: "https-url", max: 300, required: true }, { key: "ref", label: "Branch or tag", type: "ref", max: 100, default: "main" }, { key: "env", label: "Environment", type: "env", max: 20 }] },14 ...[["nginx", "Nginx", "Docker or root package install"], ["nextjs", "Next.js", "Node build step (use Git repository template for now)"], ["postgresql", "PostgreSQL", "Docker or root package install, persistent volume"], ["redis", "Redis", "Docker or root package install"], ["opencode", "OpenCode", "provider credentials + isolated runtime"], ["wordpress", "WordPress", "PHP + MySQL (Docker Compose)"], ["docker-compose", "Docker Compose", "Docker on the target VPS"]]15 .map(([id, name, why]) => ({ id, name, kind: "unsupported", version: "-", deployable: false, summary: `${name}: catalogued, not deployable yet.`, requires: [why], resources: {}, ports: [], secrets: [], health: "-", rollback: "-", storage: "-", params: [] })),16];17export const template = id => TEMPLATES.find(t => t.id === id);18const NAME = /^[a-z0-9][a-z0-9-]{1,38}[a-z0-9]$/;19export const validName = n => NAME.test(String(n ?? ""));20const ENVKEY = /^[A-Z_][A-Z0-9_]{0,40}$/; const RESERVED = new Set(["PORT", "PATH", "HOME", "LD_PRELOAD", "LD_LIBRARY_PATH", "NODE_OPTIONS", "SHELL", "USER"]);21/** Returns { ok, params } with normalised params or { ok:false, error }. */22export function validateParams(t, raw) {23 if (!t) return { ok: false, error: "unknown template" }; if (!t.deployable) return { ok: false, error: `${t.name} is not deployable yet (${t.requires.join("; ")})` };24 const src = raw && typeof raw === "object" ? raw : {}; const out = {};25 for (const p of t.params) {26 let v = src[p.key]; if (v == null || v === "") v = p.default; if (v == null || v === "") { if (p.required) return { ok: false, error: `${p.label} is required` }; continue; }27 if (p.type === "env") { const lines = String(v).split(/\r?\n/).map(s => s.trim()).filter(Boolean); if (lines.length > p.max) return { ok: false, error: `at most ${p.max} environment lines` }; const env = {}; for (const l of lines) { const i = l.indexOf("="); const k = l.slice(0, i); if (i < 1 || !ENVKEY.test(k) || RESERVED.has(k)) return { ok: false, error: `invalid or reserved environment name: ${k.slice(0, 30)}` }; env[k] = l.slice(i + 1).slice(0, 500); } out[p.key] = env; continue; }28 v = String(v); if (v.length > p.max) return { ok: false, error: `${p.label} is too long (max ${p.max})` };29 if (p.type === "https-url") { let u; try { u = new URL(v); } catch { return { ok: false, error: "repository must be a valid URL" }; } if (u.protocol !== "https:" || u.username || u.password) return { ok: false, error: "repository must be an https URL without credentials" }; }30 if (p.type === "ref" && !/^[A-Za-z0-9._\/-]{1,100}$/.test(v)) return { ok: false, error: "invalid branch or tag" };31 out[p.key] = v;32 }33 return { ok: true, params: out };34}35/** Dependency check against what the agent reported ({node:"v22.1.0", git:true, npm:true, docker:false}). */36export function missingDeps(t, caps) {37 const miss = []; for (const r of t.requires ?? []) { const m = /^node>=(\d+)$/.exec(r); if (m) { const v = parseInt(String(caps?.node ?? "").replace(/^v/, "")); if (!(v >= +m[1])) miss.push(r); } else if (r === "git" || r === "npm" || r === "docker") { if (!caps?.[r]) miss.push(r); } }38 return miss;39}40export const pickPort = used => { const u = new Set(used); for (let p = PORT_RANGE.min; p <= PORT_RANGE.max; p++) if (!u.has(p)) return p; return null; };41
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 0eebc42 on master.
Approval requests
None pending.