MINARA

Write a workspace file (sha256 OCC)

PUT /v1/workspace/files/:name — Atomically replace a workspace md file. `expected_sha256` is REQUIRED — pass the value returned by the previous GET (str

PUT /v1/workspace/files/:name

Atomically replace a workspace md file. expected_sha256 is REQUIRED — pass the value returned by the previous GET (string), or null to create a brand-new file. Mismatch returns 409 with the live sha so the UI can offer overwrite / reload. Body cap is 256 KB; oversize requests return 413.

MethodPUT
Path/v1/workspace/files/:name
AuthAuthorization: Bearer <token> required when GATEWAY_AUTH_TOKEN is set
Categoryworkspace

Request body

{ "content": "# SOUL.md - Minara\n...", "expected_sha256": "deadbeef..." }

Response body

{ "ok": true, "data": { "name": "SOUL.md", "sha256": "cafef00d...", "size": 2048, "mtime": 1714493000000 } }

Notes

Optimistic concurrency: the gateway compares expected_sha256 to the on-disk sha BEFORE writing. A miss yields 409. The atomic write goes through apps/agent/src/workspace/seed.ts::atomicWriteFile, which writes to a tempfile and renames into place, with a single-slot .bak backup written next to the target.

On this page