Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
341786a
test(projects): pin the chat projects store and managed folders (red)
OAraLabs Nov 14, 2026
87f1614
test(projects): label-only filing (red)
OAraLabs Nov 14, 2026
4c7dcfa
feat(projects): the chat projects store and managed folders
OAraLabs Nov 14, 2026
d5a482b
test(projects): bindings name the project that set them (red)
OAraLabs Nov 14, 2026
571aefe
fix(projects): a binding names the project that set it; only that pro…
OAraLabs Nov 14, 2026
a5dde48
test(projects): store review cases (red)
OAraLabs Nov 14, 2026
d179072
fix(projects): savepoint writes on the shared connection; a hand-set …
OAraLabs Nov 14, 2026
ce01f52
fix(projects): project names are scrubbed; the uniqueness key is a hash
OAraLabs Nov 14, 2026
43a69f1
test(projects): pin the chat projects routes on the real app (red)
OAraLabs Nov 14, 2026
180d86e
feat(projects): chat projects routes, filing, session rows, the proje…
OAraLabs Nov 14, 2026
3f01ffd
test(projects): the desktop's suggestion smoke cases, plus the daemon…
OAraLabs Nov 14, 2026
de10b93
test(projects): the suggestions route (red)
OAraLabs Nov 14, 2026
40a9f88
feat(projects): suggestions from tool calls, with the desktop's rules…
OAraLabs Nov 14, 2026
1e094a6
test(projects): routes review cases (red)
OAraLabs Nov 14, 2026
a5ede1b
fix(projects): folder checks by identity, root checked before it is m…
OAraLabs Nov 14, 2026
75d30a7
Merge branch 'feat/chat-projects-routes' into feat/chat-projects-sugg…
OAraLabs Nov 14, 2026
93428df
test(projects): suggestions review cases (red)
OAraLabs Nov 14, 2026
d19fbe2
fix(projects): unfiled counts what clients see; root ancestors resolv…
OAraLabs Nov 14, 2026
df3a045
Merge branch 'feat/chat-projects-routes' into feat/chat-projects-sugg…
OAraLabs Nov 14, 2026
d6ea032
fix(projects): known folders match on path boundaries; suggestions ca…
OAraLabs Nov 14, 2026
24e8abd
fix(projects): a --flag=path still finds a project folder (review low)
OAraLabs Nov 14, 2026
43db720
test(projects): instructions and reference files (red)
OAraLabs Nov 14, 2026
94d3266
feat(projects): instructions and reference files, and the prompt's re…
OAraLabs Nov 14, 2026
066f7b6
fix(projects): one save wins, reads capped, effective matches the loa…
OAraLabs Nov 14, 2026
47f2b85
fix(projects): effective reads at most the cap; a stalled upload time…
OAraLabs Nov 14, 2026
1189c55
fix(projects): file names are normalised to NFC; a missed rev never f…
OAraLabs Nov 14, 2026
c5b394e
Merge remote-tracking branch 'origin/main' into feat/chat-projects-store
OAraLabs Nov 14, 2026
a1f279c
Merge remote-tracking branch 'origin/main' into feat/chat-projects-store
OAraLabs Nov 14, 2026
e5bbe24
test(parity): rebaseline expected files for the chat-projects tables
OAraLabs Nov 14, 2026
673f58c
Merge remote-tracking branch 'origin/main' into feat/chat-projects-store
OAraLabs Nov 14, 2026
7fd80a0
fix(projects): document projects.root in the template and read it wit…
OAraLabs Nov 14, 2026
137994a
docs(reference): regenerate after merging main
OAraLabs Nov 14, 2026
ef6fb96
Merge remote-tracking branch 'origin/main' into feat/chat-projects-store
OAraLabs Nov 14, 2026
95705e7
Merge remote-tracking branch 'origin/feat/chat-projects-store' into f…
OAraLabs Nov 15, 2026
119ed0a
Merge remote-tracking branch 'origin/main' into feat/chat-projects-ro…
OAraLabs Nov 15, 2026
b50444c
Merge remote-tracking branch 'origin/main' into feat/chat-projects-ro…
OAraLabs Nov 15, 2026
36c6eb4
Merge remote-tracking branch 'origin/main' into feat/chat-projects-ro…
OAraLabs Nov 15, 2026
52dbf8c
Merge remote-tracking branch 'origin/main' into feat/chat-projects-ro…
OAraLabs Nov 15, 2026
ac2cd11
Merge remote-tracking branch 'origin/main' into feat/chat-projects-ro…
OAraLabs Nov 15, 2026
3a8416a
Merge remote-tracking branch 'origin/feat/chat-projects-routes' into …
OAraLabs Nov 15, 2026
fc6c42a
Merge remote-tracking branch 'origin/main' into feat/chat-projects-su…
OAraLabs Nov 15, 2026
9bb822e
docs(reference): regenerate after merging main
OAraLabs Nov 15, 2026
edeaa91
Merge remote-tracking branch 'origin/feat/chat-projects-suggestions' …
OAraLabs Nov 15, 2026
3c57faa
Merge remote-tracking branch 'origin/main' into feat/chat-projects-files
OAraLabs Nov 15, 2026
f1316e5
docs(reference): regenerate after merging main
OAraLabs Nov 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Notable changes in each release, newest first. Releases before 0.9.7 are describ

## Unreleased

- Chat projects: a project's standing instructions and reference files can be managed over REST (owner only). `GET|PUT /api/chat-projects/{id}/instructions` reads and writes the folder's `PROMETHEUS.md` itself, with a revision so a stale save is refused with the current text, capped at the loader's 12,000 characters, never through a link, and refusing to silently shadow another convention file (`effective` shows what the loader reads). `GET|PUT|DELETE /api/chat-projects/{id}/files/{name}` manage `reference/`: single-segment names, up to 20 MB each and 200 files, links never listed, served or replaced. A conversation in the project sees the reference file names in its prompt, labelled as data, never their contents.
- Chat projects: `GET /api/chat-project-suggestions` (owner only) suggests a project for each recent unfiled conversation from the folders its tool calls touched, with the desktop's rules (at least 3 such calls, one folder with 60% of them, no tie), held to the desktop's own test cases. A path inside a chat project's folder suggests that project, and `project` names the existing project a suggestion would file into. Machine conversations and chat-only devices' conversations are left out. A suggestion is only offered: filing stays explicit.
- Chat projects: projects you file conversations in now live on the daemon, so every device sees the same ones. A project is a named folder (made under `projects.root`, default `~/prometheus-projects`, or one you already have); a conversation filed in it works in that folder. New routes: `GET|POST /api/chat-projects`, `GET|PUT|DELETE /api/chat-projects/{id}` and `PUT /api/sessions/{id}/project`; session rows carry `chat_project_id`, and `POST /api/sessions` can start a conversation in a project. The owner does everything; a chat-only device sees only the projects its own conversations are in, as a name, and cannot create, rename, delete or file. Filing never replaces a folder you chose by hand unless asked, and `keep_workspace` files as a label only. Deleting a project never deletes a file. The `subscribed` ack lists `projects` in `server_capabilities`, and owner sockets get a `chat_project_changed` frame on every change.
- Speech: an app can now have a reply read aloud by the voice box behind Prometheus, phrase by phrase, so the phone starts speaking before the reply has finished. New routes: `GET /api/speech` (what works now), `POST /api/speech/transcribe` (audio in, text out), `GET /api/sessions/{session_id}/speech` (the session's reply as an NDJSON stream of spoken phrases) and `POST /api/speech/speak` (any text, the same way). The owner and chat-only devices may use them with chat's limits: a device hears only its own sessions, a revoked token's streams end at once, and streams are capped per caller. The `subscribed` ack lists `speech` in `server_capabilities` when a voice box is set up; an app that does not see it keeps its own voice. When the box is down the app is told why and where the unspoken text starts, and reads the rest with its own voice; the daemon's own voice engines are not used for this. Nothing new to configure. The bridge hands every frame to registered observers (one small hook in `ws_server.py`).
Expand Down
18 changes: 18 additions & 0 deletions docs/guide/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,24 @@ The code lives only in the daemon's memory, as a digest; a restart ends it. Noth
| POST | `/api/chat/interrupt` | Stop the running agent turn in a session — the chat Stop button. `{"session_id": ...}`; idempotent (`stopped: false` when nothing is running). Completed rounds persist, a mid-generation partial is kept as an assistant turn, and every client sees the broadcast `chat_done{interrupted:true}`. HTTP twin of the WS `interrupt` frame |
| POST | `/api/chat` | Send a chat message and wait for the reply. Body: `{"session_id": "my-session", "content": "..."}` (the field is `content`, not `message`). The turn runs in session `web:<session_id>`, starts from the same system prompt as `/api/chat/send` (memory files included), and returns `{"text", "turns", "usage", "served_by"}` when it ends. `served_by` names the model that answered (the fallback, when one took the turn) and is left out when no model answered. Optional `mcp_headers` (`{"<server>": {"Authorization": "Bearer ..."}}`) gives a named HTTP MCP server extra headers for this turn's calls only; see [Per-turn MCP headers](#per-turn-mcp-headers). `503` when the daemon hasn't wired the WebSocket bridge |

### Chat projects

A chat project is a named folder on this Prometheus's computer with standing instructions (`PROMETHEUS.md`) and reference files; a conversation filed in it works in that folder. Projects belong to one instance. The `subscribed` ack lists `projects` in `server_capabilities`; `404` from `GET /api/chat-projects` means this daemon has none. Design: [docs/design/chat-projects.md](../design/chat-projects.md). Errors are `{"error", "kind"}`.

| Method | Path | Purpose |
|---|---|---|
| GET | `/api/chat-projects` | The owner: `{"role": "owner", "rev", "projects": [...]}`. A chat-only device: `{"role": "chat_only", "projects": [{"id", "name", "sessions"}]}`, only projects its own conversations are in |
| POST | `/api/chat-projects` | Owner. `{"name", "folder"?, "import_key"?}`: `201` created, or `200` with `created: false` (same import key, or same name with no different folder). No `folder` makes one under `projects.root`. `400 bad_folder`, `409 name_taken` / `folder_in_use` |
| GET, PUT, DELETE | `/api/chat-projects/{id}` | Owner (a chat-only device may GET a project its conversations are in). Rename with `{"name"}`; delete unfiles and deletes no file |
| PUT | `/api/sessions/{session_id}/project` | Owner. `{"chat_project_id": "<id>" \| null, "keep_workspace"?, "replace_workspace"?, "device_session"?}`. Binds the conversation to the folder unless `keep_workspace` (a label only). `409 workspace_set`, `409 device_session`, `400 machine_session`, `404 unknown_session` / `unknown_project` |
| GET | `/api/chat-project-suggestions` | Owner. `{"suggestions": {"<session_id>": {"key", "label", "share", "calls", "project"}}, "rev"}` for recent unfiled conversations |
| GET, PUT | `/api/chat-projects/{id}/instructions` | Owner. GET: `{"content", "rev", "max_chars", "effective"}` (`effective`: what the loader reads, with `truncated`, `omitted`, `shadowed_by`, `symlink`). PUT `{"content", "base_rev", "shadow_ok"?}` → `{"ok", "rev"}`. `409 conflict` (with the current `content` and `rev`), `409 would_shadow` (with `files`), `409 not_a_file`, `409 folder_missing`, `409 too_large` (file over 1 MB), `400 too_long`. Bytes that are not UTF-8 read as U+FFFD, so saving back what was read rewrites them |
| GET | `/api/chat-projects/{id}/files` | Owner. `{"files": [{"name", "size", "mtime", "mime"}]}` |
| PUT | `/api/chat-projects/{id}/files/{name}` | Owner. **The raw file bytes as the body** (not base64, not multipart), up to 20 MB; `?replace=true` overwrites. `409 exists`, `409 too_many` (200), `413 too_large`, `400 bad_name`. Names are normalised to NFC |
| GET, DELETE | `/api/chat-projects/{id}/files/{name}` | Owner. The bytes (`attachment`, `no-store`; markup is served as `application/octet-stream`) / `{"ok": true}`. `404 unknown_file`, `400 bad_name` |

`GET /api/sessions` rows carry `chat_project_id`; `POST /api/sessions` accepts it (owner only). Owner sockets get `chat_project_changed` (`rev`, `project_id`, `change`, `session_id`) on every change made through these routes; an edit the agent makes with its file tools sends none.

### Speech — a reply read aloud

Through the voice box Prometheus already uses (`stt.url` / `tts.url`, or one approved by its address). The owner and chat-only devices may call all four, with chat's limits; a device hears only its own sessions. The `subscribed` ack lists `speech` in `server_capabilities` when a voice box is set up. Design: [docs/design/speech-route.md](../design/speech-route.md).
Expand Down
5 changes: 4 additions & 1 deletion docs/reference/routes.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ app. For what each one is *for*, see the curated
[API guide](../guide/api.md) — this file is the complete list, that
one is the explanation.

## Daemon app — 141 paths
## Daemon app — 144 paths

| Path | Methods |
|---|---|
Expand All @@ -29,6 +29,9 @@ one is the explanation.
| `/api/chat-project-suggestions` | GET |
| `/api/chat-projects` | GET, POST |
| `/api/chat-projects/{project_id}` | DELETE, GET, PUT |
| `/api/chat-projects/{project_id}/files` | GET |
| `/api/chat-projects/{project_id}/files/{name}` | DELETE, GET, PUT |
| `/api/chat-projects/{project_id}/instructions` | GET, PUT |
| `/api/chat/interrupt` | POST |
| `/api/chat/send` | POST |
| `/api/code` | POST |
Expand Down
33 changes: 32 additions & 1 deletion src/prometheus/context/prompt_assembler.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,13 +273,44 @@ def project_files_section(config: dict, cwd: str | Path) -> str | None:
# repo's AGENTS.md, which conflated the two documents.
del bootstrap_cfg # the registry gate lives in build_runtime_system_prompt
registry_file = Path(get_config_dir()) / "AGENTS.md"
return load_project_files_prompt(
section = load_project_files_prompt(
str(cwd),
max_chars_per_file=max_chars,
max_total_chars=max_total_chars,
stack=stack_project_files,
exclude_paths=(registry_file,),
)
# A chat project's folder (docs/design/chat-projects.md 7): the names of its reference files, as data.
reference = _chat_project_reference(cwd)
if reference:
section = f"{section}\n\n{reference}" if section else reference
return section


def _chat_project_reference(cwd: str | Path) -> str:
"""The reference-file note when *cwd* is a chat project's folder, else ``""``. A read-only look-up; any failure is
``""`` (a prompt is never refused for want of it)."""
import sqlite3

from prometheus.config import paths

try:
db = paths.get_lcm_db_path()
if not Path(db).exists():
return ""
folder = str(Path(cwd).resolve())
conn = sqlite3.connect(f"file:{db}?mode=ro", uri=True)
try:
row = conn.execute("SELECT 1 FROM chat_projects WHERE folder = ?", (folder,)).fetchone()
finally:
conn.close()
except Exception: # noqa: BLE001 - no store, no table, a locked file: no note
return ""
if row is None:
return ""
from prometheus.projects.content import reference_section

return reference_section(folder)


def build_runtime_system_prompt(
Expand Down
Loading
Loading