Skip to content

HTTP routes

Generated from the route constants and dispatchers in the server’s route groups (packages/web/src/server/thread-routes.ts, packages/web/src/server/prompt-routes.ts, packages/web/src/server/project-routes.ts, packages/web/src/server/permission-routes.ts, packages/web/src/server/settings-routes.ts, packages/web/src/server/literal-routes.ts, packages/web/src/server/models-routes.ts), with handler contracts from server/follow.ts, server/bundle-route.ts, and server/logs-route.ts.

Every /api/threads/:threadId… route also reads the X-Enso-Project header (#395): a page names a new thread’s project with it, and an id that is no registered project is a 400 before the route runs.

Parser limitation: discovery recognizes top-level const *_ROUTE = /…/, const *_ROUTE = threadRoute(…), const *_ROUTE = promptRoute() and const *_ROUTE = new RegExp(…) declarations — the call open at the end of its line, or whole on one — (only threadRoute derives its path; every other form states it in its metadata) plus direct request.method branches using url === … or url.startsWith(…). Statuses, input shapes, classes, acquisition, and self-logging are intentionally explicit checked metadata rather than inferred behavior.

Method Rendered path Handler / factory Input shape Success Named error statuses Class Builds / acquires? Logs itself? Source
GET /api/about createAboutRoute → about none 200 EnsoBundleAbout JSON 403 untrusted origin observation no no packages/web/src/server/literal-routes.ts:220
packages/web/src/server/bundle-route.ts:186
POST /api/logs respondToBrowserLogs → receiveBrowserLogs body: EnsoBrowserLogBatch 204 empty 400 malformed batch; 403 untrusted origin; 413 body too large; 500 body-read failure browser-log-ingest no no packages/web/src/server/literal-routes.ts:247
packages/web/src/server/logs-route.ts:29
GET /api/logs/bundle* createBundleRoute → bundle query: optional thread id/prefix 200 Markdown attachment 400 malformed thread filter; 403 untrusted origin observation no no packages/web/src/server/literal-routes.ts:232
packages/web/src/server/bundle-route.ts:115
GET /api/logs/stats createLogStatsRoute → stats none 200 EnsoDayStats JSON 403 untrusted origin observation no no packages/web/src/server/literal-routes.ts:241
packages/web/src/server/logs-stats-route.ts:59
GET /api/logs/tail* followLogTail query: optional level, thread id/prefix, process, since duration, from byte offset with the day it belongs to 200 SSE stream of EnsoLogTailFrame; a read the server cannot do ends it with an error event 400 unknown level, malformed thread filter, malformed since or from; 403 untrusted origin observation no no packages/web/src/server/literal-routes.ts:236
packages/web/src/server/logs-tail-route.ts:152
GET /api/mode respondWithFreshThreadMode none 200 permission-mode JSON 403 untrusted origin static no no packages/web/src/server/literal-routes.ts:199
GET /api/models/settings answerSection → readSection none 200 EnsoModelsSettings JSON (#904) — the models section of the user’s config.json (favorites, hidden providers, roles, default effort, presets; {} when absent) and the file’s path; read fresh, user-only 403 untrusted origin; 422 the user’s config is unreadable, or the server reads none observation no no packages/web/src/server/models-routes.ts:493
PUT /api/models/settings respondToSectionWrite → writeSection body: EnsoModelsConfig — the whole section 200 EnsoModelsSettings JSON — the section as read back from the user’s config.json, every other section kept, the whole file validated with parseEnsoConfig and written to a temporary file renamed over, in the file’s own mode (0600 when there was none) 400 malformed body (a role named other than lower-case letters, digits and -); 403 untrusted origin; 413 body too large; 422 the file is unreadable and is never overwritten, or the server reads no config; 500 handler failure control no yes packages/web/src/server/models-routes.ts:495
GET /api/permissions answerWithEtag → readPermissionPolicy none 200 EnsoPermissionPolicyRead JSON (#474) — ok with the whole file as written, or unreadable with why (missing, not JSON, not an object: the engine runs such a file as an EMPTY policy); both with its path, the engine’s review-log directory and Enso’s default policy, and an ETag header (the sha256 of the file’s bytes) when there is a file 403 untrusted origin; 500 handler failure observation no no packages/web/src/server/permission-routes.ts:135
PUT /api/permissions respondToPolicyWrite → writePermissionPolicy headers: exactly one precondition — If-Match: <ETag> (the version read), If-Match: * (whatever is there) or If-None-Match: * (no file); body: EnsoPermissionPolicyWrite — { file }, the whole file 200 EnsoPermissionPolicyRead JSON with its new ETag — the file as written: Enso’s ** put first where a mode needs it (#499), validated against the engine’s own schema, written to a temporary file and renamed over, its modification time moved so every running session reloads it at its next call 400 malformed body, or both headers, a list, or a weak tag; 403 untrusted origin; 412 the file changed on disk since it was read; 413 body too large; 422 EnsoPermissionPolicyRefusal JSON — the engine would not run it, each problem at its place; nothing written; 428 no precondition; 500 handler failure control no yes packages/web/src/server/permission-routes.ts:145
POST /api/permissions/reset respondToPolicyReset → resetPermissionPolicy header: If-Match: <ETag> or If-Match: *, or If-None-Match: * when there is no file; no body 200 EnsoPermissionPolicyReset JSON — Enso’s default policy in force, and backup, the replaced file’s copy at the first free permissions.json.bak[.N] (absent when there was no file) 400 both headers, a list, or a weak tag; 403 untrusted origin; 412 the file changed on disk since it was read; 428 no precondition; 500 handler failure control no yes packages/web/src/server/permission-routes.ts:149
GET /api/projects respondWithProjects none 200 EnsoProject[] JSON — the launch project first, then the registered ones 403 untrusted origin observation no no packages/web/src/server/project-routes.ts:245
POST /api/projects respondToProjectRegistration → ProjectRegistry.register body: EnsoProjectRegistration — an absolute path strictly under a root the ENSO_HOME config declares (projects.roots), optional title (the name the rail and the project page show) 201 EnsoProject JSON when registered; 200 when the directory already is a project 400 malformed body; 403 untrusted origin; 413 body too large; 422 refused, with the reason — not absolute, missing, not a directory, a root itself, outside every root (resolved through symlinks), or inside a hidden directory; 500 handler failure control no yes packages/web/src/server/project-routes.ts:249
DELETE /api/projects/:projectId respondToProjectRemoval → ProjectRegistry.remove path: projectId (sixteen hex digits) 204 empty — the registration is forgotten; its sessions stay on disk and are served again if the directory is registered again 403 untrusted origin; 404 no registered project with that id; 409 the launch project, or a thread in the project is running control no yes packages/web/src/server/project-routes.ts:31
GET /api/projects/:projectId/config-approval createProjectSettingsRoute.review → reviewProjectConfig path: projectId (sixteen hex digits) 200 EnsoProjectConfigReview JSON — each of the project’s own tier files that is there or approved, local first: its state against the version approved (approved, changed, removed, unapproved), its SHA-256 now, the unified diff from the approved version to it, and why it can’t be approved as it is (#753); read whatever the trust, applying nothing 403 untrusted origin; 404 no registered project with that id; 422 a server started without the user config; 500 handler failure observation no no packages/web/src/server/project-routes.ts:57
PUT /api/projects/:projectId/config-approval respondToProjectConfigApproval → createProjectSettingsRoute.approve → approveProjectTier path: projectId; body: EnsoProjectConfigApproval — the tier and the file’s SHA-256 as reviewed, null approving its removal 200 EnsoProjectConfigReview JSON as it now stands — the file as reviewed is the version that applies, kept in ENSO_HOME/projects/<id>/config-approvals.json (#753) 400 malformed body, or one that is not an approval; 403 untrusted origin; 404 no registered project with that id; 409 the file changed after it was reviewed — nothing approved; 413 body too large; 422 the file can’t be approved as it is (a link, a FIFO, over 64 KiB, not a config Enso reads), the project’s directory is gone, or a server started without the user config; 500 handler failure control no yes packages/web/src/server/project-routes.ts:58
GET /api/projects/:projectId/settings respondWithProjectSettings → createProjectSettingsRoute.read → resolveProjectThreadSettings path: projectId (sixteen hex digits) 200 EnsoProjectSettings JSON — each threads key (tree mode, files to copy, setup commands) with the tier it resolves from, as approved (#753), whether the project is trusted (its own tiers are read only then), the file behind each tier, and the project’s tiers whose approved text no longer reads (#754) 403 untrusted origin; 404 no registered project with that id; 422 a server started without the user config; 500 handler failure observation no no packages/web/src/server/project-routes.ts:36
PUT /api/projects/:projectId/settings respondToProjectSettingsWrite → createProjectSettingsRoute.write → writeProjectThreadSettings path: projectId; body: EnsoProjectSettingsUpdate — the tier (shared, the project’s committed .enso/config.json, or local, its gitignored .enso/config.local.json) and the threads keys to set, null removing one 200 EnsoProjectSettings JSON as the settings now resolve; the tier’s file keeps every other key, written as 2-space JSON (#754), and is approved as written (#753) 400 malformed body, or one that is not an update; 403 untrusted origin; 404 no registered project with that id; 409 the tier’s file is not the version approved — changed, gone or never approved — so a save over it would approve it unseen (#753); 413 body too large; 422 the tier’s file is there and unreadable (never overwritten), the project’s directory is gone, or a server started without the user config; 500 handler failure control no yes packages/web/src/server/project-routes.ts:37
PUT /api/projects/:projectId/title respondToProjectRetitle → ProjectRegistry.retitle path: projectId (sixteen hex digits); body: EnsoProjectTitleUpdate — { "title": "…" }, not blank 200 EnsoProject JSON as it is now listed — the title, trimmed, stored in ENSO_HOME/projects.json (the launch project’s too, as an entry for its path); the folder, its path and the id are untouched (#939) 400 malformed body, a blank title, or one that is not exactly { title }; 403 untrusted origin; 404 no registered project with that id; 413 body too large; 500 handler failure control no yes packages/web/src/server/project-routes.ts:45
GET /api/projects/:projectId/trust createProjectTrustRoute.read → projectTrusted, readProjectTierFiles path: projectId (sixteen hex digits) — a registered project; no path is ever taken 200 EnsoProjectTrust JSON — whether a new thread or tree reads the project’s own files (pi’s trust.json, as a session is built), and each of its tier files that is there, local first, with the setup commands it declares as written, or why it was not read (a link, not a regular file, over 64 KiB, not a config Enso reads); read for display, trusted or not (#873) 403 untrusted origin; 404 no registered project with that id; 500 handler failure observation no no packages/web/src/server/project-routes.ts:42
PUT /api/projects/:projectId/trust createProjectTrustRoute.write → saveProjectTrust path: projectId; body: EnsoProjectTrustUpdate — { "trusted": true } trusts, false revokes 200 EnsoProjectTrust JSON as it now stands — saved in pi’s trust.json under the project’s path, the store a thread’s Trust project answer writes; a revoke is an explicit false, never a deletion, so no trusted ancestor shows through, and retires the project’s live threads that are not running, so each is rebuilt under it at its next prompt. A grant reaches each thread when it is next built (#873) 400 malformed body, or one that is not exactly { trusted }; 403 untrusted origin; 404 no registered project with that id; 409 a revoke while a thread in the project is running; 413 body too large; 500 handler failure control no yes packages/web/src/server/project-routes.ts:43
GET /api/projects/browse* respondWithBrowse → ProjectRegistry.browse query: optional path — a directory inside a declared root; absent, the roots themselves 200 EnsoDirectoryListing JSON — the directories under it that are inside a root and not hidden (symlinks resolved), which already are projects, and whether this one may be added — with the reason when it may not 403 untrusted origin; 422 refused, with the reason — not absolute, missing, not a directory, outside every root, or inside a hidden directory observation no no packages/web/src/server/project-routes.ts:253
GET /api/prompts respondWithPrompts → PromptLibrary.list none 200 EnsoLibraryPromptListing JSON — the library’s prompts by name without their bodies, each with its bytes and estimated tokens, and every .md file it refused, with the reason naming it 403 untrusted origin; 404 a server started without a library; 500 handler failure observation no no packages/web/src/server/prompt-routes.ts:302
DELETE /api/prompts/:id respondToPromptRemoval → PromptLibrary.remove path: id; header: If-Match: <ETag> (the version read) or If-Match: * 204 empty — the file is gone; a thread that ran it keeps the text its log recorded 400 If-None-Match, a list, or a weak tag; 403 untrusted origin; 404 no such file, or a server started without a library; 412 the file changed on disk since it was read; 428 no If-Match; 500 handler failure control no yes packages/web/src/server/prompt-routes.ts:49
GET /api/prompts/:id respondWithPrompt → PromptLibrary.read path: id — the file name under ENSO_HOME/prompts without .md, lowercase words joined by hyphens 200 EnsoLibraryPrompt JSON — its frontmatter fields, its body, the file’s bytes and the body’s estimated tokens — with an ETag header, the sha256 of the file’s bytes, which a later replace or delete of this version names 403 untrusted origin; 404 no such file, or a server started without a library; 422 the file is refused, with the reason naming it — unreadable, not UTF-8, no frontmatter, an unknown key, no name, a category that is not system, append or session; 500 handler failure observation no no packages/web/src/server/prompt-routes.ts:47
PUT /api/prompts/:id respondToPromptWrite → PromptLibrary.write path: id; headers: exactly one precondition — If-None-Match: * (create: no file of that name), If-Match: <ETag> (replace the version read), If-Match: * (replace whatever is there); body: EnsoLibraryPromptWrite — name, description, category (system, append or session) and the markdown body 200 EnsoLibraryPrompt JSON with its new ETag — the file as read back after it was written whole (staged, then linked into place for a create, renamed over for a replace) 400 malformed body, or both headers, a list, or a weak tag; 403 untrusted origin; 404 a server started without a library; 412 the precondition does not hold, with the reason naming the file — it already exists (a refused file included), changed on disk since it was read, or is gone; 413 body too large; 428 no precondition — never an unconditional write; 500 the file does not read back, or a disk failure control no yes packages/web/src/server/prompt-routes.ts:48
GET /api/providers listing → HostProviders.list none 200 EnsoProvidersListing JSON (#904) — the providers set up or registered by an extension (logged in or not, how — never with what — their models, hidden or not), the ones that can be added, and the Settings login running 403 untrusted origin; 500 handler failure observation no no packages/web/src/server/models-routes.ts:497
GET /api/providers/login dispatchModelsRoute none 200 EnsoProviderLogin JSON — the latest Settings login; 204 when there has been none 403 untrusted origin observation no no packages/web/src/server/models-routes.ts:509
POST /api/providers/login respondToLogin → HostProviders.logIn body: EnsoProviderLoginRequest — provider, authType, and for an API key the apiKey, said once 200 EnsoProviderLogin JSON once the login settles or asks its first question; an API key goes to pi’s credential store and is repeated by no answer, refusal or log record 400 malformed body, refused in our words (never the parser’s); 403 untrusted origin; 409 a Settings login is running; 422 unknown provider or way in, or a key no key looks like (not stored); 500 handler failure control no yes packages/web/src/server/models-routes.ts:507
POST /api/providers/login/answer respondToAnswer body: EnsoProviderLoginAnswer — questionId, value 200 EnsoProviderLogin JSON once the login settles or asks again 400 malformed body; 403 untrusted origin; 409 no login asks that question; 500 handler failure control no yes packages/web/src/server/models-routes.ts:511
POST /api/providers/login/cancel dispatchModelsRoute none 200 EnsoProviderLogin JSON once the login has ended 403 untrusted origin; 409 no login; 500 handler failure control no yes packages/web/src/server/models-routes.ts:513
POST /api/providers/logout respondToLogout → HostProviders.logOut body: EnsoProviderLogoutRequest — provider 200 EnsoProvidersListing JSON after pi removed the stored credential 400 malformed body; 403 untrusted origin; 422 pi stores no credential for it (the environment’s is not pi’s to remove); 500 handler failure control no yes packages/web/src/server/models-routes.ts:499
GET /api/run-states followRunStates → ThreadRegistry.watchRunStates none 200 SSE stream of EnsoRunStatesFrame (#911): run-states, every thread the server holds with its busy and waiting, then a run-state each time a thread is built, a run takes it, releases it or the thread is dropped — how a page hears a run it has not opened end 403 untrusted origin observation no no packages/web/src/server/literal-routes.ts:211
packages/web/src/server/run-states-route.ts:20
GET /api/settings/projects respondToConfigSection → readProjectsSettings none 200 EnsoProjectsSettingsRead JSON (#934) — ok with the user’s config.json projects and threads as written, or unreadable with why (every consumer fails closed on such a file); both with the file’s path, pi’s settings.json path and its defaultProjectTrust (ask when unset), and an ETag header when there is a file 403 untrusted origin; 404 a server started without ENSO_HOME; 500 handler failure observation no no packages/web/src/server/settings-routes.ts:192
PUT /api/settings/projects respondToConfigSection → writeProjectsSettings headers: exactly one precondition — If-Match: <ETag>, If-Match: * or If-None-Match: * (no file); body: EnsoProjectsSettingsWrite — { projects?, threads }, each section whole (no projects: no roots fence) 200 EnsoProjectsSettingsRead JSON with its new ETag — every other key of config.json kept, empty lists dropped, the whole file validated with parseEnsoConfig and written to a temporary file renamed over; threads is read at each new tree and project page, projects.roots at the server’s next start 400 malformed body, or both headers, a list, or a weak tag; 403 untrusted origin; 404 no ENSO_HOME; 412 the file changed on disk since it was read; 413 body too large; 422 the file is unreadable now, a root or a project’s own mode is keyed by a path neither absolute nor ~/, or the result would be unreadable — nothing written; 428 no precondition; 500 handler failure control no yes packages/web/src/server/settings-routes.ts:193
PUT /api/settings/projects/trust respondToSideWrite → writeDefaultProjectTrust body: EnsoDefaultProjectTrustState — { defaultProjectTrust }: ask, always or never 200 EnsoDefaultProjectTrustState JSON, the value read back — pi’s defaultProjectTrust in the agent dir’s settings.json, written by pi’s own settings writer with every other key kept; read at each new thread and project page 400 malformed body; 403 untrusted origin; 404 no ENSO_HOME; 413 body too large; 422 pi’s settings file unreadable or not written; 500 handler failure control no yes packages/web/src/server/settings-routes.ts:194
GET /api/settings/security respondToConfigSection → readSecuritySettings none 200 EnsoSecuritySettingsRead JSON (#933) — ok with the user’s config.json security section as written, or unreadable with why (every consumer fails closed on such a file); both with the file’s path, the secrets file’s path and judgeKeySet — whether TYPESAFE_API_KEY is set, never its value — and an ETag header when there is a file 403 untrusted origin; 404 a server started without ENSO_HOME; 500 handler failure observation no no packages/web/src/server/settings-routes.ts:176
PUT /api/settings/security respondToConfigSection → writeSecuritySettings headers: exactly one precondition — If-Match: <ETag>, If-Match: * or If-None-Match: * (no file); body: EnsoSecuritySettingsWrite — { security }, the whole section 200 EnsoSecuritySettingsRead JSON with its new ETag — every other key of config.json kept, empty objects dropped, the whole file validated with parseEnsoConfig and written to a temporary file renamed over; read by the guard at each new session’s start 400 malformed body, or both headers, a list, or a weak tag; 403 untrusted origin; 404 no ENSO_HOME; 412 the file changed on disk since it was read; 413 body too large; 422 the file is unreadable now, or the result would be — nothing written; 428 no precondition; 500 handler failure control no yes packages/web/src/server/settings-routes.ts:177
PUT /api/settings/security/judge-key respondToSideWrite → writeJudgeKey body: EnsoJudgeKeyWrite — { value }, the key, or null to remove it 200 EnsoJudgeKeyState JSON — only whether a key is set; ENSO_HOME/secrets.env rewritten 0600 with every other line kept, the key never logged or answered; read by the jev judge at its next call 400 malformed body; 403 untrusted origin; 404 no ENSO_HOME; 413 body too large; 422 not one token (spaces, quotes or #); 500 handler failure control no yes packages/web/src/server/settings-routes.ts:178
GET /api/stored-threads respondWithStoredThreads none 200 EnsoStoredThread[] JSON 403 untrusted origin; 500 handler failure observation no no packages/web/src/server/literal-routes.ts:207
GET /api/threads respondWithThreads none 200 EnsoThreadSummary[] JSON 403 untrusted origin observation no no packages/web/src/server/literal-routes.ts:203
DELETE /api/threads/:threadId respondToDelete → deleteThreadAt → AgentHost.deleteThread path: threadId; query: ?force=1 or none — no other; header: If-Match: "<sha256 hex of the work's words>" with ?force=1, the work the page showed (PR #572 review); no body. Deletes the thread (#571): the project’s pre-#573 snapshot stores migrated first, then its tree through the inventory, its snapshot store, and the project’s object store collected — what only this thread’s snapshots reached goes, its forks’ histories stay (#573) — then every session file under the id. The live session is retired only once the inventory has passed, and the id is refused for the server’s lifetime after 204 empty — the session file, the tree (worktree, its registration and enso/<thread-id> branch, or the copy) and the store are gone 400 malformed thread id, or an If-Match that is no strong sha256 tag; 403 untrusted origin; 404 no session file in a served project, or a query other than ?force=1; 409 a run holds the thread, or a move, a restore or another delete does, or the project’s snapshot stores are being migrated or collected (#573); 422 the tree holds work — untracked, modified or unsnapshotted files, or commits on its branch no other ref reaches — named in the text: deleted with ?force=1 only when If-Match confirms those very words, so work gained since is named again, never taken unseen; 500 a removal failed, the project’s snapshot stores cannot be migrated, or a fork’s store that could not be migrated still reads this store’s objects (#573), named in the text control no yes packages/web/src/server/thread-routes.ts:41
packages/web/src/server/follow.ts:1153
GET /api/threads/:threadId respondWithThread path: threadId 200 JSON 400 malformed thread id; 403 untrusted origin; 404 no live session observation no no packages/web/src/server/thread-routes.ts:36
POST /api/threads/:threadId/abort respondToAbort → abortThread path: threadId; no body 200 EnsoAbortReceipt JSON 400 malformed thread id; 403 untrusted origin; 404 no live session; 409 nothing running control no yes packages/web/src/server/thread-routes.ts:96
packages/web/src/server/follow.ts:1224
GET /api/threads/:threadId/changes respondWithThreadChanges path: threadId 200 EnsoThreadChanges JSON — git’s state in the thread’s cwd and every file that differs from its last-push baseline (#452): unpushed commits, staged and unstaged edits, deletions, renames and untracked files, each with its unified diff unless binary or too large; truncated past 500 files. A thread whose tree is a copy (#650) answers its copy’s files changed since the copy was made, read from its snapshot store, with copy naming the project and base. A diff git cannot produce, or a copy’s store that cannot be read, reads as unavailable. Read-only, no fetch 400 malformed thread id; 403 untrusted origin; 404 no session, or its project is no longer served; 500 handler failure observation no no packages/web/src/server/thread-routes.ts:66
GET /api/threads/:threadId/changes/file respondWithChangedFile path: threadId; query: path (the file now, from the repository root), optional oldPath (a rename or copy’s path at the baseline) 200 EnsoThreadChangedFile JSON (#461) — one changed file whole, both sides: oldText at the baseline commit (a rename’s at oldPath; a copy’s at its base, from its store) read as stored, so no textconv or filter runs, and newText in the work tree, never through a symbolic link and only for a file the changes would list (an ignored one is not read). Each side is text, none, too-large past 512 KiB with its bytes, binary, or unavailable with why. What the Diff view expands the unchanged lines between hunks from, and highlights. Read-only 400 malformed thread id, no path, or a path (either) that is not a file under the repository’s scope — absolute, with an empty, . or .. segment, or outside the project’s directory (#456); 403 untrusted origin; 404 no session, or its project is no longer served; 409 git could not answer, or the cwd is in no repository and the tree is no copy; 500 handler failure observation no no packages/web/src/server/thread-routes.ts:72
POST /api/threads/:threadId/command respondToHostCommand → runHostCommand path: threadId; body: EnsoHostCommandRun — model with provider/id, thinking with a level, login with provider/authType, logout with a provider, compact with nothing; a view row (context, fork) is the page’s to do, never run 204 empty for a setting (the change arrives on the follow as model); 202 empty for a flow or action (login, logout, compact) — started, its questions and progress arrive on the follow as dialogs and notify lines 400 malformed id/body; 403 untrusted origin; 409 thread busy; 413 body too large; 422 unknown command, model or level, a provider without credentials, or a view (/context, /fork) the page does itself; 500 handler failure control yes yes packages/web/src/server/thread-routes.ts:100
GET /api/threads/:threadId/commands respondWithThreadCommands path: threadId 200 EnsoThreadCommands JSON — source says live, remembered or none 400 malformed thread id; 403 untrusted origin observation no no packages/web/src/server/thread-routes.ts:52
POST /api/threads/:threadId/configure respondToConfigure → configureThread path: threadId; body: EnsoSessionConfiguration — optional systemPrompt (a prompt reference — a user prompt’s id, or project:<id> for the project’s own, #470 — system or append, or null for pi’s default; absent leaves the session’s as it is), model (provider/id), thinking (a level that model supports) and mode; or role (#904) in place of model and thinking — resolved from the user’s models section against the models on offer, applied as the model step, then recorded as an enso-model-role entry; applied in that order under one lease, a value equal to the current one left alone 204 empty — every step applied (the changes arrive on the follow as model and permission-mode) 400 malformed id/body; 403 untrusted origin; 409 thread busy; 413 body too large; 422 JSON EnsoConfigurationRefusal — the step that refused (systemPrompt, model, thinking, mode) and the reason, the steps before it applied — a system prompt is refused by name when its reference names no library prompt, a project prompt’s project is not trusted by the thread, its file is missing, unreadable or unparseable, a session prompt, or empty, or the session already sent a request (before it, a new choice — pi’s default included — replaces the last); 500 handler failure control yes yes packages/web/src/server/thread-routes.ts:102
GET /api/threads/:threadId/context respondWithThreadContext path: threadId 200 EnsoThreadContext JSON — pi’s branch, request by request, and its context meter 400 malformed thread id; 403 untrusted origin; 404 no session; 500 handler failure observation no no packages/web/src/server/thread-routes.ts:56
GET /api/threads/:threadId/context/:request respondWithContextRequest path: threadId, request (a turn number or next) 200 EnsoContextRequestDetail JSON — one request’s context, element by element 400 malformed thread id; 403 untrusted origin; 404 no session or no such turn; 500 handler failure observation no no packages/web/src/server/thread-routes.ts:58
POST /api/threads/:threadId/continue respondToContinue → continueThread → ThreadRuntime.continueRun path: threadId; no body 202 empty — the torn tail is continued from the stored state with no new user message; the run arrives on the follow and its settled releases the thread 400 malformed thread id; 403 untrusted origin; 404 no thread under that id, live or stored; 409 thread busy; 422 nothing to continue — the thread does not end on an unanswered prompt, an unfinished tool call, or tool results with no reply, or this pi build has no run lifecycle to continue in; 500 handler failure control yes yes packages/web/src/server/thread-routes.ts:137
packages/web/src/server/follow.ts:458
GET /api/threads/:threadId/delete-preview respondWithDeletePreview → AgentHost.previewThreadDelete path: threadId 200 EnsoThreadDeletePreview JSON — the tree a delete would remove (or null) and its size on disk (#578; at least, past a 5 s cap), the work in it a delete is refused for (the inventory’s words), and the forks whose histories keep this one’s snapshots (#571); nothing is deleted and no snapshot taken — the inventory’s scratch staging leaves loose objects in the store 400 malformed thread id; 403 untrusted origin; 404 no session file in a served project; 410 a deleted thread; 500 handler failure observation no no packages/web/src/server/thread-routes.ts:43
POST /api/threads/:threadId/dialog respondToDialog → answerThreadDialog path: threadId; body: DialogAnswer 204 empty 400 malformed id/body; 403 untrusted origin; 404 no live question; 413 body too large; 422 answer refused; 500 handler failure control no yes packages/web/src/server/thread-routes.ts:95
packages/web/src/server/follow.ts:536
GET /api/threads/:threadId/eval respondWithThreadEval path: threadId 200 EnsoSessionEval JSON — the mechanical timeline and scorecard (#441): the branch’s events off pi’s entries, the queued prompts and interrupts off the day files the branch spans 400 malformed thread id; 403 untrusted origin; 404 no session; 500 handler failure observation no no packages/web/src/server/thread-routes.ts:62
GET /api/threads/:threadId/events respondWithThreadEvents path: threadId 200 EnsoThreadEvents JSON 400 malformed thread id; 403 untrusted origin; 404 no live session observation no no packages/web/src/server/thread-routes.ts:45
GET /api/threads/:threadId/follow followThread path: threadId 200 SSE stream 400 malformed thread id; 403 untrusted origin; 500 handler failure observation no no packages/web/src/server/thread-routes.ts:93
packages/web/src/server/follow.ts:210
POST /api/threads/:threadId/fork respondToFork → forkThreadAt → AgentHost.forkThread path: threadId; body: EnsoForkRequest — entryId, the pi entry id of one of the thread’s user messages; the fork is pi’s /fork at position before, taken from the session file 200 EnsoForkReceipt JSON — the new thread id (its session file names the source as parentSession) and the forked message’s text, for the new composer 400 malformed id/body, or an entry that is no user message; 403 untrusted origin; 404 no session file in a served project, or no such entry; 409 thread busy; 413 body too large; 500 handler failure control no yes packages/web/src/server/thread-routes.ts:131
packages/web/src/server/follow.ts:1022
GET /api/threads/:threadId/git respondWithThreadGit path: threadId 200 EnsoThreadGit JSON — the thread’s cwd and git’s state there (#453): repository, branch, upstream, the last-push baseline and the rule that chose it, ahead/behind, and changed files by where they sit; not-a-repository or unavailable with git’s reason otherwise. Read-only, no fetch 400 malformed thread id; 403 untrusted origin; 404 no session, or its project is no longer served; 500 handler failure observation no no packages/web/src/server/thread-routes.ts:64
GET /api/threads/:threadId/history respondWithThreadHistory path: threadId; query: optional before — a message id on the branch 200 EnsoThreadHistory JSON — one page of the branch (#739): its last 200 messages, or with ?before=<messageId> the 200 before that message, and earlier saying how many messages and prompts come before the page (the first prompt’s text with them); the other fields are the whole branch’s 400 malformed thread id; 403 untrusted origin, or a session stored in a directory that is no project here (named, #378); 404 no session — an id nobody has used, which a page starts; 409 before names a message the branch no longer holds (a compaction rewrote it); 410 a deleted thread (#571) — this server deleted it — never started again; 500 handler failure observation no no packages/web/src/server/thread-routes.ts:50
GET /api/threads/:threadId/incidents respondWithThreadIncidents path: threadId; query: optional windowCalls, highAtSignals, highAtKinds, incidentAtSignals — the server’s thresholds otherwise 200 EnsoThreadIncidents JSON (#468) — each incident’s record with the custom entries it rests on as stored, and the branch replayed under the thresholds used: same, would open, would miss. What bun run incidents reads 400 malformed thread id, or a query naming no threshold or no whole number from 1; 403 untrusted origin; 404 no session; 500 handler failure observation no no packages/web/src/server/thread-routes.ts:151
POST /api/threads/:threadId/incidents/:incidentId/resolve respondToIncidentResolution → resolveThreadIncident → ThreadRuntime.resolveIncident path: threadId, incidentId (a UUID); body: EnsoIncidentResolution — classification, outcome, and restricted families only for resume-with-restrictions 204 empty — the enso-incident-resolved record is appended and the live guard applies it at once; the record arrives on the follow as a custom entry 400 malformed id/body; 403 untrusted origin; 404 no thread under that id, live or stored; 409 thread busy; 413 body too large; 422 the resolution is refused, with the reason — no such incident, a later one supersedes it, the thread was already ended, or restricted does not fit the outcome; 500 handler failure control yes yes packages/web/src/server/thread-routes.ts:145
packages/web/src/server/follow.ts:650
GET /api/threads/:threadId/judge-cases respondWithThreadJudgeCases path: threadId 200 EnsoThreadJudgeCases JSON (#469) — each call the command judge would be asked about (core’s selection under the server’s thresholds), why it is in scope, and the REDACTED state a backend would be sent. Sends nothing. What bun run judge reads 400 malformed thread id; 403 untrusted origin; 404 no session; 500 handler failure observation no no packages/web/src/server/thread-routes.ts:91
GET /api/threads/:threadId/manifest respondWithThreadManifest path: threadId 200 EnsoForkPoint JSON — identity, then run conditions, off pi’s branch 400 malformed thread id; 403 untrusted origin; 404 no session; 500 handler failure observation no no packages/web/src/server/thread-routes.ts:60
POST /api/threads/:threadId/mode respondToModeChange → changeThreadMode path: threadId; body: EnsoPermissionModeChange 204 empty; the change arrives on the follow as permission-mode 400 malformed id/body; 403 untrusted origin; 409 a restore or delete holds the thread; 413 body too large; 422 mode not offered; 500 handler failure control yes yes packages/web/src/server/thread-routes.ts:98
packages/web/src/server/follow.ts:575
POST /api/threads/:threadId/name respondToRename → renameThreadAt → AgentHost.renameThread path: threadId; body: EnsoThreadRenameRequest — name, not blank, at most 120 characters, trimmed. Names the thread (#670) with pi’s own session_info entry — what pi’s /name writes — appended to the live session or the stored file; the stored listing and the history carry it as name, and the first prompt stays the title of a thread with none. Held as a restore is, so a name never lands between a run’s messages 204 empty — the name is recorded 400 malformed id/body; 403 untrusted origin; 404 no such thread (before anything is built); 409 thread busy; 413 body too large; 500 handler failure control yes yes packages/web/src/server/thread-routes.ts:139
packages/web/src/server/follow.ts:1127
POST /api/threads/:threadId/permissions/check respondToPermissionCheck → HostedThread.checkPermission path: threadId; body: EnsoPermissionCheckRequest — a surface and a value 200 EnsoPermissionVerdict JSON (#474, #881) — the thread’s verdict in its mode now, layer by layer: the guards’ answer first (guard: refused with its rule and reason, which decides in every mode, passed, or not checked and why), then the permission engine’s decision, the pattern that won and where that rule came from (global, the user’s file; agent, the mode’s preset); nothing runs and nothing is recorded 400 malformed id/body; 403 untrusted origin; 409 the engine published no service for the session; 413 body too large; 500 handler failure observation yes no packages/web/src/server/thread-routes.ts:107
GET /api/threads/:threadId/project-prompts respondWithProjectPrompts → projectPromptListing path: threadId 200 EnsoProjectPromptLibrary JSON (#470) — listed: the project’s own prompts (<project>/.enso/prompts) without their bodies and every file refused, when the thread trusts the project (none when the directory does not exist); untrusted: only the directory, nothing read. A thread no run built answers as its build would: pi’s trust.json, a stored thread’s own record, or the default 400 malformed thread id; 403 untrusted origin; 409 the project a new thread is claimed for is gone, or a stored thread is in a directory that is no project here; 500 handler failure observation no no packages/web/src/server/thread-routes.ts:122
GET /api/threads/:threadId/project-prompts/:id respondWithProjectPrompt → PromptLibrary.read path: threadId, id — the file name under <project>/.enso/prompts without .md 200 EnsoLibraryPrompt JSON with its ETag (#470) — one project prompt, read-only: no route writes or deletes one, as the project’s files are committed and shared 400 malformed thread id; 403 untrusted origin, or the thread does not trust its project — the file is not read, and the reason names the directory; 404 no such file; 409 as the listing’s; 422 the file is refused, with the reason naming it; 500 handler failure observation no no packages/web/src/server/thread-routes.ts:127
POST /api/threads/:threadId/prompt respondToPrompt → promptThread path: threadId; body: EnsoPromptBody 202 EnsoPromptReceipt JSON 400 malformed id/body or unavailable command; 403 untrusted origin; 409 the thread was taken and released again while the prompt waited on its build (rare; #444); 413 body too large; 500 handler failure control yes yes packages/web/src/server/thread-routes.ts:94
packages/web/src/server/follow.ts:358
GET /api/threads/:threadId/prompt-runs respondWithThreadPromptRuns → AgentHost.threadPromptRuns path: threadId 200 EnsoThreadPromptRuns JSON (#553) — the Diff Viewer’s steps: the thread’s own prompt runs (a prompt and everything that ran under it, up to the next prompt; a fork’s inherited prompts are counted in prompt, not listed), each with the snapshot its run began with (start) and the one the next prompt’s run began with (end) — taken, failed, unrecorded (before #551), pending (no later prompt yet) or unavailable (a commit the store lacks) — idle when both hold one tree, restored when a restore ran in its span; and baseline, the tree’s base snapshot (a fork’s inherited one, with its source) or a checkout thread’s first snapshot. Off the branch and the store’s objects; the live tree is never read. Read-only 400 malformed thread id; 403 untrusted origin; 404 no session; 500 handler failure observation no no packages/web/src/server/thread-routes.ts:74
GET /api/threads/:threadId/prompt-runs/changes respondWithPromptRunChanges → AgentHost.readPromptRunChanges path: threadId; query: from, to — two snapshot commits the thread’s prompt runs record 200 EnsoPromptRunChanges JSON (#553) — every file that differs between two of the thread’s snapshots, compared in its store (never the live tree), each with its unified diff unless binary or too large; truncated past 500 files. Read-only: nothing in the store, the tree or the session is written 400 malformed thread id, or from/to missing or not a snapshot hash (lowercase hex, 40 or 64 digits); 403 untrusted origin; 404 no session; 409 a snapshot the thread’s prompt runs do not record, no snapshot store on this host, or two snapshots git cannot compare (git’s words); 500 handler failure observation no no packages/web/src/server/thread-routes.ts:79
GET /api/threads/:threadId/prompt-runs/file respondWithPromptRunFile → AgentHost.readPromptRunFileTexts path: threadId; query: from, to — two snapshot commits the thread’s prompt runs record; path; optional oldPath (a rename or copy’s path at from) 200 EnsoThreadChangedFile JSON (#553) — one file whole at two of the thread’s snapshots: oldText at from (a rename’s at oldPath), newText at to, both read from the store as stored; a side no file has at its snapshot is none, one git cannot read unavailable with git’s words. What the Diff Viewer expands the unchanged lines between hunks from. Read-only 400 malformed thread id, from/to missing or not a snapshot hash, or a malformed path (either: empty, .., an empty segment, a NUL); 403 untrusted origin; 404 no session; 409 a snapshot the thread’s prompt runs do not record, or no snapshot store on this host; 500 handler failure observation no no packages/web/src/server/thread-routes.ts:84
POST /api/threads/:threadId/restore respondToRestore → restoreThreadAt → AgentHost.restoreThreadAt path: threadId; body: EnsoRestoreRequest — entryId, a user message on the thread’s branch; the thread’s tree is put back to the snapshot its run began with (#551), the conversation untouched. The thread is held for the whole restore, as a run holds it, and the host admits no run meanwhile 200 { hash, safety } JSON — the snapshot restored, and the snapshot of the files it replaced, recorded on the thread as enso-tree-restored 400 malformed id/body; 403 untrusted origin; 404 no such thread (before anything is built) or entry; 409 thread busy, the thread on no tree, no snapshot at that entry, or the restore refused; 413 body too large; 500 handler failure control yes yes packages/web/src/server/thread-routes.ts:133
packages/web/src/server/follow.ts:1096
POST /api/threads/:threadId/restore/undo respondToRestoreUndo → undoLastRestore → AgentHost.undoLastRestore path: threadId; body: EnsoRestoreUndoRequest — safety, the snapshot the restore kept. The thread’s tree back to its newest enso-tree-restored record’s safety (#565), only when it is that one — itself a restore, recorded with a safety of its own, so a second undo puts the first restore back. Held as a restore is 200 { hash, safety } JSON — the snapshot put back, and the snapshot of the files it replaced 400 malformed id/body; 403 untrusted origin; 404 no such thread (before anything is built); 409 thread busy, the thread on no tree, no restore to undo, a later restore since (the safety is not the newest restore’s), or the restore refused; 413 body too large; 500 handler failure control yes yes packages/web/src/server/thread-routes.ts:135
packages/web/src/server/follow.ts:1111
GET /api/threads/:threadId/stats respondWithThreadStats path: threadId 200 EnsoThreadStats JSON — pi’s session for the numbers, the log’s day files for the times 400 malformed thread id; 403 untrusted origin; 404 no session; 500 handler failure observation no no packages/web/src/server/thread-routes.ts:54
GET /api/threads/:threadId/system-prompt respondWithSystemPromptPreview → HostedThread.previewSystemPrompt path: threadId; query: optional prompt — a prompt reference (system or append): a user prompt’s id, or project:<id> for the project’s own (#470, the colon unencoded); absent is pi’s default 200 EnsoSystemPromptPreview JSON — pi’s rendering of the next request’s system prompt with that prompt, section by section (who wrote each: the library or pi), the tool definitions sent beside it, and the total the Context tab prices a first request made with it at; the thread’s own choice is untouched 400 malformed thread id; 403 untrusted origin; 404 a prompt named on a server without a library; 409 thread running; 422 the prompt is refused, with the reason naming it — missing, unreadable, not UTF-8 or unparseable, a session prompt, empty, or a project prompt the thread does not trust its project for; 500 pi’s rendering does not split back into its sections (the prompt’s own text is matched whole, so it cannot cause this), or handler failure observation yes no packages/web/src/server/thread-routes.ts:115
POST /api/threads/:threadId/system-prompt respondWithDraftPreview → HostedThread.previewSystemPrompt path: threadId; body: EnsoSystemPromptDraft — an unsaved prompt’s mode (system or append), text and name 200 EnsoSystemPromptPreview JSON — the same preview a saved prompt gets, for the editor’s breakdown while it types; nothing is recorded 400 malformed id/body; 403 untrusted origin; 409 thread running; 413 body too large; 500 pi’s rendering does not split back into its sections (the draft’s text is matched whole, so it cannot cause this), or handler failure observation yes no packages/web/src/server/thread-routes.ts:129
GET /api/threads/:threadId/tree respondWithThreadPages path: threadId 200 EnsoThreadPages JSON (#619) — the directory the thread works in (its tree, #551), the HTML files at its top two levels, at most 50 (truncated past them; .git and node_modules are not walked), and, once there is a page, previewOrigin: the thread’s preview, an origin of its own (#713) — a loopback listener started on that first read, serving the tree at /, GET and HEAD only, to a loopback Host only, files at most 10 MiB, typed by extension, nosniff, no-referrer, no-store, nothing outside the tree (.. or a symlink is a 404). Read-only 400 malformed thread id; 403 untrusted origin; 404 no session, or its project is no longer served; 500 handler failure observation no no packages/web/src/server/thread-routes.ts:89
GET /api/trees respondWithTrees → AgentHost.listTrees none 200 EnsoTreesListing JSON (#578) — per project this server serves a thread of: each thread tree on disk (the thread whose branch records it, or null for a tree directory no thread records), its kind, branch, size (measured; partial — at least, cut short by the listing’s time cap or an unreadable directory; unreadable — never 0) and the work it holds in the delete inventory’s words; and the project’s snapshot object store’s size. Reads only 403 untrusted origin; 500 handler failure observation no no packages/web/src/server/literal-routes.ts:216

Detected 49 regex route constants and 31 literal dispatcher routes; metadata is exhaustive for both sets.