Reference apps
Journal and Scratchpad ship in the image and are built exactly the way yours will be. Read them when the docs run out.
Journal
Dictate entries, type notes, search by words or dates, export to Markdown. One service, a plain JavaScript window, and a Dioxus (Rust to WASM) version of the same window.
app.json 13 service actions and the “journal” capture intent
core/ journal-core: entry model, file format, dates, search. Pure logic, no IO
store/ journal-store: the service daemon (Rust)
ui/ index.html, app.js, style.css, Capture.qml (the dictation panel)
ui-view/ journal-ui: the Dioxus viewer
tests/ node tests that run the whole UI against a fake window.purpose Data
An entry is {id, created_at, title, body, tags[], source, duration_secs?}. It is one Markdown file with a small header, under data/entries/YYYY/. Every write is temp file, fsync, rename, so a crash leaves the old file or the new one. Files are 0600 and symlinks are never followed.
Actions
| Action | Does |
|---|---|
journal.start | Returns the live draft from the last 10 minutes, or begins a new one. |
journal.append | Adds a dictated segment. A repeated client_id is ignored. |
journal.end / journal.discard | Save with an automatic title, or delete the draft. |
journal.create / update / delete / get | Typed notes and edits. |
journal.list / counts / search / related | Browse by filter, tag, words or date phrases like “oct 5”, “yesterday”. |
journal.export | Returns {filename, markdown}. |
Drafts are never listed, counted or searched. An unsaved draft is removed after 24 hours. Entry text is never logged. Search by meaning is not built yet; today it matches words and dates.
Scratchpad
A rich-text editor whose file format is RTF. Opens text/rtf files, takes notes by voice, recovers after a crash.
You say Action Effect “new note” scratchpad.newQueues a new document. “open scratchpad” scratchpad.openOpens a file, or the open dialog. “take a note” start then append then endDictation becomes Note <date> <time>.rtf.
- Files: the window has no file access. Everything goes through the service, and the sandbox grants only
rw:~/Documents, ro:~/Downloads and ro:~/Desktop. - Safety: paths with
.., hidden folders or symlinks are refused. Writes are atomic and refuse to overwrite a file that changed since it was opened, unless the person agrees. - Autosave keeps a recovery copy in the app's data folder after 1.5 seconds of quiet. After a crash the editor offers to restore it.
Both apps live in apps/ of the PurposeOS repository. Run their tests with node --test apps/scratchpad/tests/*.test.js and cargo test in each app folder.