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- ..
- ai.ts
- apps.ts
- audit.ts
- auth.ts
- central-core.d.mts
- central-core.mjs
- central.ts
- cloud.ts
- config.ts
- crypto.ts
- db.ts
- design.ts
- engines.ts
- files.ts
- gates.ts
- gateway.ts
- marketplace-core.d.mts
- marketplace-core.mjs
- metrics.ts
- modules.ts
- motion.ts
- nexus-core.d.mts
- nexus-core.mjs
- oidc-core.d.mts
- oidc-core.mjs
- oidc.ts
- providers.ts
- proxy-core.d.mts
- proxy-core.mjs
- pwauth-core.d.mts
- pwauth-core.mjs
- requirements.ts
- rls.sql.d.mts
- rls.sql.mjs
- services-content.ts
- ssrf.ts
- status.ts
- tenant.ts
- tlsgate.ts
- workspace.ts
app/src/app/api/workspace/[project]/files/route.ts
1import { auditT, tenant } from "@/lib/tenant";2import { list, readText, remove, root, writeText, WsError } from "@/lib/workspace";3export const dynamic = "force-dynamic";4const fail = (e: unknown) => e instanceof WsError ? Response.json({ error: e.message }, { status: e.status }) : Response.json({ error: "internal error" }, { status: 500 });5type P = { params: Promise<{ project: string }> };6export async function GET(req: Request, { params }: P) {7 const g = await tenant("viewer"); if (g.res) return g.res; const ctx = g.ctx;8 try { const r = await root((await params).project, ctx.orgId); const u = new URL(req.url); const f = u.searchParams.get("file");9 return Response.json(f ? readText(r, f) : { entries: list(r, u.searchParams.get("dir") ?? "") }); } catch (e) { return fail(e); }10}11export async function PUT(req: Request, { params }: P) {12 const g = await tenant("developer", { write: true }); if (g.res) return g.res; const ctx = g.ctx;13 try { const { project } = await params; const r = await root(project, ctx.orgId); const b = await req.json().catch(() => ({}));14 if (typeof b.path !== "string" || typeof b.content !== "string") throw new WsError("path and content required"); writeText(r, b.path, b.content);15 await auditT(ctx, "workspace.write", `${project}/${b.path}`, { bytes: Buffer.byteLength(b.content) }); return Response.json({ ok: true }); } catch (e) { return fail(e); }16}17export async function DELETE(req: Request, { params }: P) {18 const g = await tenant("developer", { write: true }); if (g.res) return g.res; const ctx = g.ctx;19 try { const { project } = await params; const r = await root(project, ctx.orgId); const p = new URL(req.url).searchParams.get("path") ?? ""; remove(r, p);20 await auditT(ctx, "workspace.delete", `${project}/${p}`); return Response.json({ ok: true }); } catch (e) { return fail(e); }21}22
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.