fourechelon
v0.3.0
Published
Official TypeScript SDK and CLI for the Four Echelon API: Four Cad extraction (STEP, IGES, DXF, PDF, SVG, draw.io; title blocks, BOMs, callouts) and Rowe spatial reasoning.
Maintainers
Readme
fourechelon
Official TypeScript SDK for the Four Echelon API: Four Cad extraction (STEP, IGES, DXF, PDF, SVG, draw.io) and Rowe spatial reasoning. Zero dependencies; works in Node 18+, Bun, Deno, browsers, and edge runtimes.
npm install fourechelonimport { FourEchelon } from "fourechelon";
const fe = new FourEchelon({ apiKey: process.env.FOUR_ECHELON_API_KEY! });
// A file becomes geometry an agent can reason over.
const scene = await fe.cad.extract({ file: "cabinet.drawio", targetContract: "both" });
console.log(scene.structure?.kind, scene.structure?.pages?.[0].relations);
// Ask Rowe about it.
const answer = await fe.responses.create({
input: { task_type: "understand", cad_scene: scene },
});
console.log(answer.output, answer.usage);fe.cad.extract({ file, fileName?, targetContract? })—fileis a path (Node), bytes, aBlob, or{ url }for a server-side download (use{ url }for files over ~4 MB).fe.cad.extractBatch([...]),fe.cad.getBatch(id),fe.cad.waitForBatch(id)— up to 32 files asynchronously.fe.responses.create({ model?, input })— anIdempotency-Keyis generated per call so retries never double-bill.fe.models.list()— pricing, tasks, andruntime_available.- Errors throw
FourEchelonErrorwithstatus,type,requestId, anddetails. - Retries 429/502/503/504 and network errors with backoff and honours
Retry-After.
Docs: https://fourechelon.com/docs/sdks · OpenAPI: https://fourechelon.com/openapi.json · MCP: https://fourechelon.com/docs/mcp
