DorkOS
ApiRoomsIdFiles

List one directory of a room's own files

GET
/api/rooms/{id}/files

Serves the room's git repo, as of the commit main points at — never the checkout on disk, so a half-written edit or a merge in flight is not something a reader can see, and .git is not a path anybody can name because it is not in the tree. commit says exactly which snapshot this listing is. path is a directory relative to the repo root and defaults to it; .., an absolute path, a backslash, a control character, a doubled slash and leading or trailing whitespace are all refused (400) before git is asked anything — the whitespace rule is a refusal rather than a repair, because a filename may legitimately end in a space and trimming the request would answer with a different file. The server never rewrites a path, so every path in a listing can be handed straight to the content route. Entries come back directories first, then files, each group in code-unit order — byte order rather than the machine's locale, so one room lists identically everywhere. Membership gates it exactly as reading the room's history does — a caller who is not on the roster gets the same 404 an unknown room gets, so a room id is never a capability, and an agent that IS a member may read, because a room's files are what its members are working on together. A member of a room that has no files of its own gets 409 ROOM_HAS_NO_REPO, and that question is asked strictly AFTER membership so that nobody can learn which rooms are project rooms by probing ids. Each entry carries the last commit that touched it — author, time and subject — from one bounded walk of the room's history, so a directory of five hundred files costs the same handful of git commands as a directory of five; an entry nobody touched inside that window answers lastCommit: null, which means "not known here" rather than "never changed". A symlink is listed as a symlink and is never followed. Everything here — filenames, commit subjects, author names — is written by the room's members: render it as untrusted text.

Path Parameters

id*string
Length1 <= length

Query Parameters

path?string

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/rooms/string/files"
{  "path": "string",  "commit": "string",  "entries": [    {      "name": "string",      "path": "string",      "kind": "file",      "size": 0,      "lastCommit": {        "sha": "string",        "author": "string",        "at": "string",        "subject": "string"      }    }  ]}