diff --git a/.docs/wiki/API-and-agents.md b/.docs/wiki/API-and-agents.md index 342bec7..2f260b9 100644 --- a/.docs/wiki/API-and-agents.md +++ b/.docs/wiki/API-and-agents.md @@ -89,7 +89,12 @@ The first call opens a page in form.md asking which workspaces the agent may use ### What a read-only credential can do -The credential decides what an agent may do; there is no separate question in the window. A read-only token or OAuth grant can read and search pages, databases, comments and agent runs, build a context pack and search or review the knowledge bank (it cannot record or confirm knowledge), and every request that changes something is refused with `403 read_only`. `tools/list` shows it only the tools that announce themselves as read-only, plus `window_command_run`, which stays listed because the window also offers commands that change nothing, such as opening a page or switching a view. That tool is announced as able to change the workspace, and a read-only credential is refused any window command that the window marks as changing it. `extension_command` is a write tool, so a read-only credential does not see it and cannot call it. A read and write credential sees every tool. +The credential decides what an agent may do; there is no separate question in the window. + +- **Read-only.** A read-only token or OAuth grant can read and search pages, databases, comments and agent runs, build a context pack and search or review the knowledge bank (it cannot record or confirm knowledge), and every request that changes something is refused with `403 read_only`. +- **What a read-only credential is shown.** `tools/list` shows it only the tools that announce themselves as read-only, plus `window_command_run`, which stays listed because the window also offers commands that change nothing, such as opening a page or switching a view. That tool is announced as able to change the workspace, and a read-only credential is refused any window command that the window marks as changing it. +- **Extensions.** `extension_command` is a write tool, so a read-only credential does not see it and cannot call it. +- **Read and write.** A read and write credential sees every tool. `agents/manifest.json` in the repository lists each tool and which of them are read-only; `./form-md agents manifest` writes it from the server's own tool list and `./form-md agents manifest --check` fails when it is out of date. @@ -103,7 +108,11 @@ Below the snippets, **Connected apps** lists every agent you allowed, with its w 2. Access is decided by the policy gate for every credential kind; a route never checks the token type itself, except through `RequireSession`, `RequireAdmin` or `RequireOwner` for routes that must not be reachable by tokens. 3. A new MCP tool that changes anything is marked `Write`. The server then adds the `run_id` and `idempotency_key` arguments to its schema and handles both, and the tool records its changes in the agent run so **Undo this run** can reverse them. 4. Rate limits and audience checks live in `internal/auth/service.go` middleware; do not add per-route limits for tokens elsewhere. -5. An agent's edits merge with what a person is typing. `insert_blocks` and the REST Markdown writes in `append`, `prepend` and `after` mode apply to the server's copy of the page as CRDT transactions, the same way another person's keystrokes do, so both changes survive and every open editor receives them live. `replace_block` swaps one block and `replace_page_content` (and the `replace` mode) swaps the whole body, which is why both are marked destructive. For tokens and OAuth clients (not the person's own browser) the server refuses with `409 person_editing` a replace or delete of a block that holds a person's cursor, and a whole-body replace while anyone has the page's editor focused; each open editor reports the ids of the blocks around its cursor in its awareness state as `blocks`, and clears them when it loses focus. Agents should prefer inserts on pages people may have open. Pictures an agent writes as `![alt](https://...)` are fetched by the server through its guarded fetcher right after the write, stored as page files and swapped in, so public pages and exports show them; a picture that cannot be fetched stays a link. +5. An agent's edits merge with what a person is typing. + - **Inserts merge.** `insert_blocks` and the REST Markdown writes in `append`, `prepend` and `after` mode apply to the server's copy of the page as CRDT transactions, the same way another person's keystrokes do, so both changes survive and every open editor receives them live. + - **Replaces are destructive.** `replace_block` swaps one block and `replace_page_content` (and the `replace` mode) swaps the whole body, which is why both are marked destructive. + - **A person typing is protected.** For tokens and OAuth clients (not the person's own browser) the server refuses with `409 person_editing` a replace or delete of a block that holds a person's cursor, and a whole-body replace while anyone has the page's editor focused; each open editor reports the ids of the blocks around its cursor in its awareness state as `blocks`, and clears them when it loses focus. Agents should prefer inserts on pages people may have open. + - **Pictures.** Pictures an agent writes as `![alt](https://...)` are fetched by the server through its guarded fetcher right after the write, stored as page files and swapped in, so public pages and exports show them; a picture that cannot be fetched stays a link. 6. Before a task an agent calls `context_pack`; knowledge it learns goes in with `knowledge_record`. Numbers for both come from the `contextual-compression` skill's `policy.json`, never from constants in the code. See [[Context-and-knowledge]]. ## Related diff --git a/.docs/wiki/Data-views.md b/.docs/wiki/Data-views.md index d8fe9c1..8fb7b6b 100644 --- a/.docs/wiki/Data-views.md +++ b/.docs/wiki/Data-views.md @@ -65,7 +65,9 @@ Rows are nodes and relation properties are links. Settings: colour by a select o ## Dashboards -Widgets sit on a four-column grid and are small (one column), medium (two) or full width; on narrow screens they stack. With rights to change the view's design, drag a widget by its grip to move it, or focus the grip and press the left and right (or up and down) arrow keys; focus stays on the grip and a screen reader hears the new position. Move earlier and Move later are also in each widget's menu then. **Add a KPI** adds a number widget with a trend: pick a date property and day, week or month, and the card shows the value, a sparkline of the last 24 buckets and the change of the last bucket against the one before. +- **Sizes.** Widgets sit on a four-column grid and are small (one column), medium (two) or full width; on narrow screens they stack. +- **Moving a widget.** With rights to change the view's design, drag a widget by its grip to move it, or focus the grip and press the left and right (or up and down) arrow keys; focus stays on the grip and a screen reader hears the new position. Move earlier and Move later are also in each widget's menu then. +- **KPI cards.** **Add a KPI** adds a number widget with a trend: pick a date property and day, week or month, and the card shows the value, a sparkline of the last 24 buckets and the change of the last bucket against the one before. ## Boards @@ -91,7 +93,16 @@ The table renders only the rows near the viewport and asks the server for each w `POST /api/collections/{id}/chart` takes `{"chart": {...}, "view_id": "...", "search": "...", "pick": {"x": "...", "series": "..."}, "date_range": {...}}`. The chart object has `kind`, `x` and `series` groupings (`prop`, `by`, `step`), `fn`, `prop`, `target`, `window`, `scale`, `filter`, `limit` and the style flags. A `pick` answers with `picked`, the ids of up to 500 rows behind that mark, instead of values. A `dots` chart answers with `points` (`id`, `title`, `group`, `value`). Calendar charts return up to 1,100 days. -`date_range`, on `POST /api/collections/{id}/query` and `/chart`, narrows the answer to rows whose date falls in a range: `{"prop": "", "within": "today"}` with any Is within option (`today`, `past_7_days` and `past_30_days` are rolling whole days ending today, in the viewer's time zone), or `{"prop": "...", "from": "YYYY-MM-DD", "to": "YYYY-MM-DD"}` with both days included. It is ANDed with the view's filter, so it can only narrow what the view shows. The property must be a date, created time or edited time property of that database, `within` and `from`/`to` cannot be mixed, the days must be real dates and `from` must not be after `to`; anything else answers `400 bad_date_range`. The database toolbar's Date range control keeps each viewer's choice per view in the browser (`formmd.daterange.`) and sends it with every rows and chart request of that view. +`date_range`, on `POST /api/collections/{id}/query` and `/chart`, narrows the answer to rows whose date falls in a range: + +- `{"prop": "", "within": "today"}` with any Is within option (`today`, `past_7_days` and `past_30_days` are rolling whole days ending today, in the viewer's time zone), or +- `{"prop": "...", "from": "YYYY-MM-DD", "to": "YYYY-MM-DD"}` with both days included. + +It is ANDed with the view's filter, so it can only narrow what the view shows. + +**Rules.** The property must be a date, created time or edited time property of that database, `within` and `from`/`to` cannot be mixed, the days must be real dates and `from` must not be after `to`; anything else answers `400 bad_date_range`. + +**In the window.** The database toolbar's Date range control keeps each viewer's choice per view in the browser (`formmd.daterange.`) and sends it with every rows and chart request of that view. ## The contract @@ -101,11 +112,21 @@ The table renders only the rows near the viewport and asks the server for each w ## Templates that show every view -Since v0.45.0 Home leads with **Data & charts**: 15 featured templates (Sales dashboard, Website analytics, Project portfolio, Finance overview, Survey results, Inventory and stock levels, Team capacity, Customer map, Fitness tracker, Habit heatmap, Knowledge graph, Formula and rollup playground, Content library, Quarterly report, Diagram gallery) that between them use all 13 chart kinds and all 13 views, with real rows dated relative to the day they are added so calendars, heatmaps and timelines are never empty. **Example projects** follows: 14 projects, each a home page with inline dashboards, sub-pages and related databases. Both are built by `internal/templates/build.go`, which creates the page tree first and then fills `{{db:KEY}}` and `{{page:KEY}}` placeholders, relations given by row title, and relative dates. The catalogue is checked when the server starts, so a template that points at a missing database or option does not ship. +- **Data & charts.** Since v0.45.0 Home leads with **Data & charts**: 15 featured templates (Sales dashboard, Website analytics, Project portfolio, Finance overview, Survey results, Inventory and stock levels, Team capacity, Customer map, Fitness tracker, Habit heatmap, Knowledge graph, Formula and rollup playground, Content library, Quarterly report, Diagram gallery) that between them use all 13 chart kinds and all 13 views, with real rows dated relative to the day they are added so calendars, heatmaps and timelines are never empty. +- **Example projects.** **Example projects** follows: 14 projects, each a home page with inline dashboards, sub-pages and related databases. +- **How they are built.** Both are built by `internal/templates/build.go`, which creates the page tree first and then fills `{{db:KEY}}` and `{{page:KEY}}` placeholders, relations given by row title, and relative dates. +- **Checked at start.** The catalogue is checked when the server starts, so a template that points at a missing database or option does not ship. ## Forms and responses -A form view (and its public link) lists questions, each bound to one property of the database. `internal/collection/forms.go` validates a submission exactly as before: required questions, per-type normalising, select options and conditional questions. Since v0.47.0 the validated answers are stored as one response record on the new row (`collection_rows.response`: form id, form version, answers by question id, submitted time) and the row's own `vals` stay empty. The answer columns are computed from the record when a row is read (`effectiveVals` in `internal/collection/response.go`, applied where the snapshot is built and where the write paths read values), so views, filters, sorts, formulas, exports, the API and search see the same values as before. A cell a person edits is kept in the row's own `vals` as an override and wins over the computed value; clearing a computed cell keeps a null override. Rows made before v0.47.0 keep their stored values and need no migration. The page title still names the row from the title answer. +A form view (and its public link) lists questions, each bound to one property of the database. + +- **Checking a submission.** `internal/collection/forms.go` validates a submission exactly as before: required questions, per-type normalising, select options and conditional questions. +- **Where the answers go.** Since v0.47.0 the validated answers are stored as one response record on the new row (`collection_rows.response`: form id, form version, answers by question id, submitted time) and the row's own `vals` stay empty. +- **How they show up as columns.** The answer columns are computed from the record when a row is read (`effectiveVals` in `internal/collection/response.go`, applied where the snapshot is built and where the write paths read values), so views, filters, sorts, formulas, exports, the API and search see the same values as before. +- **When a person edits a cell.** A cell a person edits is kept in the row's own `vals` as an override and wins over the computed value; clearing a computed cell keeps a null override. +- **Older rows.** Rows made before v0.47.0 keep their stored values and need no migration. +- **The row's title.** The page title still names the row from the title answer. Automations on a form use their own trigger, **When a response is received**. The event carries the response record, and the trigger's condition is judged against the answers as submitted, not against stored properties. A **When a page is added** automation on a database with a form view was carried over to this trigger by migration 0031, with **Also when a page is added by hand** ticked so it keeps running for rows added by hand. Rows made by a form do not raise the plain row-added event for automations. diff --git a/.docs/wiki/Home.md b/.docs/wiki/Home.md index c952c1f..bf9201d 100644 --- a/.docs/wiki/Home.md +++ b/.docs/wiki/Home.md @@ -1,68 +1,140 @@ # form.md Wiki -form.md is a self-hosted workspace where people and AI agents write documents, run databases and edit together in realtime. It ships as one static Go binary (`form-md`) with the TypeScript web client embedded, and it keeps everything in one data directory: a SQLite database (`form-md.db`), the uploaded files and a few small key files. There is no separate database server, cache or object store. The server holds the collaborative document itself, so an agent writing through MCP or the REST API merges with what a person is typing. This wiki is for the people who install and run an instance and for the people who change its code. +form.md is a self-hosted workspace where people and AI agents write documents, run databases and edit together in realtime. -**Current version:** v0.61.1 (releases built by formcompiler and the update check and installer reading its form.md-updates release; v0.61.1 lets an account that has no password, such as the desktop app's owner, set its first one without being asked for a current one, and adds [[Self-hosting]], [[Auth0]] and the `deploy/gcp` scripts; v0.61.0 brought a desktop app whose window signs in with a key the server makes at each start and accepts only once, so a sign-in from outside the app's window is refused, and third-party notices that a build writes exactly as they are kept, the demo media and the extension kit included; v0.60.0 brought a desktop app on Windows in which nothing the server starts (Claude Code and the other agents, the tunnel, the server's own clean-up) opens a console window, with `FORMMD_ENGINE_WINDOWED=0` to open one with the server's output for a single start, and the views and publish demos rebuilt with the app's current styles; v0.59.0 brought the offline demo rebuilt with the app's current styles, AMOLED Black and the shared terminal panel's included, and the Form family's token names available in form.md's stylesheets so shared pieces can use them, with every colour, size and theme of form.md as it was; v0.58.0 brought a desktop app on Windows whose server always ends with it, however the app ends, a start that fails shown in a dialog with what the server last printed, its exit code and where the log is, and a wait of at most 90 seconds for the server to start; on macOS a server that has stopped but was not yet cleaned up no longer counts as still running; `./form-md claude` and `./form-md agents install` finding Claude Code the way the app does, `agents install` naming Antigravity, Antigravity in Connected apps, and the terminal panel's guide saying that Codex, Cursor and Antigravity each get a button when they are installed; v0.57.0 brought a cleaner start and stop for the desktop app, on Windows most of all: a server left behind by an app that is gone is replaced at the next start where it used to block it, a second start on the same data folder is refused with a sentence that says form.md is already running there, the server stops within a few seconds once the app that started it is gone, and a start that fails shows its message before the loading window closes; and a folder of its own for every Antigravity tab, so two tabs open at once no longer take each other's access; v0.56.0 brought Antigravity (Google's `agy` program) as a fourth agent beside Claude Code, Codex and Cursor's agent, with a tab of its own in the terminal panel, and one way of finding all four programs however form.md was started, which says where it looked when a program is missing and what the program printed when it does not start; v0.55.0 brought the terminal panel as the one every Form app shares: it has a row or a column of its own in the window, so it no longer lies over the page, and a button in its head moves it between the bottom and the right; Codex and Cursor's agent opening in tabs of their own beside Claude Code's, with a More agents menu and a short guide the first time the panel opens; the panel's side, size and front tab remembered, a height set in an earlier version kept; the same keys as before (`Mod+J`, `Mod+Alt+J`, `Mod+Alt+K`), and with the cursor anywhere in the panel no other key reaching the page behind it; a Restart button in the panel's head where a double-click on a tab restarted it; From Claude Code as a command in Find a command where it was a button in Chat; and a page that asks the server nothing about the panel while it is closed; v0.54.0 brought a token of its own for every Claude Code tab in the terminal panel, so Account settings, API tokens lists one "Claude Code tab in form.md" row per open tab where it listed one shared row, and closing a tab ends its token, while Chat keeps its single "Claude Code in form.md" token; a terminal that attaches only from the page the server itself served; AMOLED Black, a true-black dark theme for OLED screens, in Preferences; `./form-md agents install` registering Claude Code with a header that names `FORMMD_MCP_TOKEN` and no longer contains it; `window_command_run` and `extension_command` announced to agents as tools that can change the workspace, with `extension_command` no longer listed to a read-only credential; `agents/manifest.json`, the list of what form.md offers agents, written by `./form-md agents manifest` and checked by `--check`; server routes that open Codex and Cursor's agent in a terminal tab with a token each and report which of the three programs are installed, ahead of the window's own buttons for them; and the editor's live sync connecting again through the Vite dev server; v0.53.0 brought a date range on database views (All dates, Today, Last 7 days, Last 30 days or a custom start and end date), kept per viewer and view in the browser and sent with every rows and chart request as `date_range`, which the server ANDs with the view's saved filter, plus Today, Last 7 days and Last 30 days as Is within filter options, and a view tab strip that stays inside the database with a count button listing the views scrolled out of sight; v0.52.2 builds the container image again, its interface build carrying the demo builds it packs; v0.52.1 opens a page the browser has cached as editable from the first frame, so the mode button no longer shows Viewing before Editing; v0.52.0 brought header alignment as a page style, the page header on the left by default, centred or on the right per page or for the workspace, and fixed the page top bar's Edited label arriving after the mode button; v0.51.0 brought the three demos inside the app: a Demos section on Home, a Demos group in the Help menu, the native Help menu and Find a command, and demo.editor, demo.views and demo.publish for agents, each opening the demo's own build in a sandboxed frame over the window that never reads or writes your pages, with the demos' credited media shipped in the binary; v0.50.1 brought the extension refusal for a manifest's API in the same words every Form app uses; v0.50.0 brought Form extensions: form.md loads the extensions FormPortal installs and form.ext runs, each in a sandboxed frame with its own consent, from an Extensions menu, an Extensions panel and the command palette, with document.apply as one undo step and extensions_list and extension_command for agents; v0.49.3 brought two more offline demos, demos/views for the database views on a real dataset of US crewed spaceflight and demos/publish for writing, comments, page history, publishing and export on the whole window, each credited in its own CREDITS.md, and a link row between the three demos; v0.49.2 brought the desktop app's splash as the Form family's rounded card with a progress bar, square corners gone on macOS, and a main window that appears whole once its first content is drawn; v0.49.1 brought real public-domain and freely licensed media in the offline demo, a notebook of Galileo, NASA and Pexels material with a real exoplanet database, all credited in demo/CREDITS.md; v0.49.0 brought an offline browser demo in demo/ that opens from demo/index.html with no server; v0.48.0 brought the README in the Form family template (#5), merged with main, and the unified app icon; v0.47.8 brought the About tab and the installers naming NodeAgentc, Inc. as the publisher with the Apache-2.0 licence; v0.47.7 brought Linux packages that recommend GStreamer's plugins and an AppImage that carries them, so the meeting recorder works on a fresh install; v0.47.6 brought a container image built with Go 1.26.9, as go.mod states, and line endings fixed for Windows checkouts, CRLF for the .bat scripts and LF for everything else; v0.47.5 brought a first paint that waits for the whole page shell, so the sidebar, the top bar and Home no longer jump while they load, and a CI check that loads the window under throttling; v0.47.4 brought a Go test suite that checks the desktop key, the origin guard, the sync socket, live editing by two clients and an agent, migrations, Markdown round trips, viewer and share-link limits, and the version sites; v0.47.3 brought a desktop release build that keeps its symbols, since macOS builds fail on a stripped binary; v0.47.2 brought a web client with no known vulnerable dependency: DOMPurify 3.4.17 and markdown-it 15.0.3; v0.47.1 names the copyright holder, NodeAgentc, Inc., and shows by nodemode.ai in Admin settings, About; v0.47.0 stores each form submission as one response record with computed columns and adds the response-received automation trigger; v0.46.3 brought third-party notices that cover every platform's Go modules, KaTeX's fonts under the OFL and the Linux AppImage's LGPL libraries; v0.46.2 brought the Mirrored block under its own name in every language; v0.46.0 brought Home leads with your own material, recent pages and templates, with Data & charts in a Templates side panel you can close, Example projects below the templates, the page aligned to the left, dropdowns that show every item and every scrollbar hidden; v0.45.3 brought the app icon as the owner chose it, the white .MD in a white outline, with its clean edge; v0.45.2 brought the app icon's light outer rim removed at every size; v0.45.1 brought the new app icon: the owner's glass # with the F in front, a pointer and a .MD tag, in the app, the favicon and the desktop splash; v0.45.0 brought Data & charts first on Home: 15 featured templates covering every chart kind and database view, and 14 example projects already filled in, each a home page with dashboards, sub-pages and related databases, for 90 templates in eleven categories; v0.44.0 brought a page-first layout with Home at /home, 61 templates in nine categories with a previewing gallery, search filters and sorts, Find a command, find and replace, rebindable shortcuts, and Preferences with dark and light theme profiles, accent, density and high contrast; v0.43.0 brought form.md as a desktop app for macOS, Linux and Windows, built by ./build_app or build_app.bat, with the server inside it and the owner signed in; v0.42.1 brought the build no longer stops when Go keeps its licence outside GOROOT, as Homebrew Go 1.27 does; v0.42.0 brought made for everyday people: a plain home with recent pages, simpler sharing, publishing, sign-in and settings, tables you can find and fill, phone-sized controls; formlit's icons throughout and the three-star sparkle retired; a Claude Code panel and chat that work like formlit's, with an ask bar and Ctrl/Cmd+J; v0.41.0 brought answers that can draw on the web, uploaded PDFs searchable by their text, boards and galleries kept on published pages, Mermaid drawn in its dark theme, the slash menu, format bar and cursors inside synced blocks, long-press drag in the page tree, a Graph tab in the library, webhook page events carrying the page, import sources named by file format; v0.40.0 brought page-tree import checked against twelve real Markdown and CSV page exports from public open-source test corpora and six defects fixed: links under folders starting with #, database links, ids left in titles, attached zips imported twice, videos reported as skipped, image alt text; v0.39.4 brought terminal styles kept inside the terminal pane, closing the v0.39.0 review list; v0.39.3 brought a sign-out that lands while a connection is opening now closes it too; v0.39.2 brought one sibling lookup at a time, an in-app agent token that recovers from a revoke without a restart, a bounded formula pattern cache; v0.39.1 brought an OAuth grant whose access token runs out without a refresh closes its live connections within a minute; v0.39.0 brought a release review: Go 1.26.9 and x/net v0.61.0 with no reachable vulnerabilities, offline database changes kept per account, expired sessions closing their live connections, sibling answers checked before agents see them; v0.38.1 brought starter hints as callouts and offline deletes checked across a server restart; v0.38.0 brought database changes made while the server was down are sent as soon as it is back, without a reload; v0.37.0 brought database views that really open offline, checked with the server stopped, which the v0.32.0 and v0.33.0 versions did not; v0.36.0 brought dashboard widgets moved with the arrow keys and a graph row list for screen readers; v0.35.0 brought pickers loaded on first use and a 260 KB start budget the build enforces; v0.34.0 brought a lighter start: one translation chunk per language and the library loaded on demand; v0.33.0 brought board, gallery, calendar, timeline, map and chart views of kept and recent databases open offline without having been opened first, maps included; v0.32.0 brought those views offline as last seen, and terminal colours following a system theme switch; v0.31.0 brought terminals drawn correctly under the security policy, a panel that opens with its terminal, restart in place, a chat tab without the empty-state error; v0.30.0 brought revoking one token, session or OAuth grant closing its live streams, editing sockets and terminal attachments; v0.29.0 brought context packs that name formlit or formvis when they fit the task, and the family-routing sub-skill; v0.28.0 brought the form family bridge: a public descriptor and tools that tell agents when formlit or formvis fits a task; v0.27.0 brought faster bulk row tools for agents; v0.26.0 brought rows added offline; v0.25.0 brought saved styles, offline row deletes, bulk row updates nearly three times faster; v0.24.0 brought annotation marks in Markdown and PDF, uploaded fonts in HTML exports, a list view that loads as you scroll; v0.23.0 brought editable single annotation marks, uploaded fonts on published pages, a windowed timeline; v0.22.0 brought offline database edits kept and sent later, page styles on public pages and exports, the slash setting in account settings; v0.21.0 brought a phone block toolbar, renaming and removing fonts, agents kept out of the block a person is typing in; v0.20.0 brought Phase 16 audit fixes: pictures from agents imported on the server, block alignment on public pages, a server-side default for command safety; v0.19.0 brought offline by default with larger databases, phone-width fixes, described window commands; v0.18.0 brought the board block and creative embeds; v0.17.0 brought custom fonts and typewriter scrolling; v0.16.0 brought image annotations and block alignment; v0.15.0 brought page styles, focus mode and word counts; v0.14.0 brought the terminal, Claude Code and its chat inside the app, window commands for agents, 26 languages; v0.13.0 brought context packs and agent connections, v0.12.0 the visual data views, v0.11.0 encryption, ACME, operations commands, offline start and the installer) · **Stack:** Go 1.26, pure-Go SQLite, vanilla TypeScript and Vite, ProseMirror and Yjs · **Team:** one owner (nodemode-ai) +This wiki is for the people who install and run an instance and for the people who change its code. + +## At a glance + +**Current version:** v0.61.1 · every version is on [[Releases]] + +| | | +|---|---| +| **What it is** | One static Go binary (`form-md`) with the TypeScript web client embedded | +| **Where your data lives** | One data directory: a SQLite database (`form-md.db`), the uploaded files and a few small key files. There is no separate database server, cache or object store | +| **People and agents together** | The server holds the collaborative document itself, so an agent writing through MCP or the REST API merges with what a person is typing | +| **Stack** | Go 1.26, pure-Go SQLite, vanilla TypeScript and Vite, ProseMirror and Yjs | +| **Team** | one owner (nodemode-ai) | +| **Releases** | Built by formcompiler; the update check and the installer read its form.md-updates release | + +## Where to go + +### Get it running + +- Put an instance on a server: [[Install]] +- Your own copy on your own domain for a small team, start to finish: [[Self-hosting]] +- Every environment variable and the settings they seed: [[Configuration]] + +### Keep it safe and reachable + +- Encrypt the data directory at rest: [[Encryption]] +- HTTPS with your own certificate, built-in ACME, or a reverse proxy: [[TLS-and-ACME]] +- Reach the server through Cloudflare without opening a port: [[Tunnel]] +- Sign people in through Auth0: [[Auth0]] +- Sending mail through SMTP, Gmail or Microsoft 365: [[Mail]] +- Back up and restore: [[Backup-and-restore]] +- Health checks, the data directory, logs, updates, memory, fail2ban and upgrades: [[Operations]] + +### Use it + +- Charts, heatmaps, the graph view, dashboards and boards: [[Data-views]] +- What works without a connection, and the installable app: [[Offline]] +- REST API, tokens, OAuth, rate limits and connecting agents: [[API-and-agents]] +- Context packs and the knowledge bank for agents: [[Context-and-knowledge]] +- The terminal and Claude Code inside the app: [[Terminal-and-Claude-Code]] +- The other Form apps on the same computer: [[Form-family]] +- Extensions: [[Extensions]] + +### Change it + +- Repo layout, dev loop and conventions: [[Development]] +- Branches, commits and releases: `BRANCHING.md` at the repo root +- What each version brought: [[Releases]] + +## What's new + +- **v0.61.1** lets an account that has no password, such as the desktop app's owner, set its first one without being asked for a current one, and adds [[Self-hosting]], [[Auth0]] and the `deploy/gcp` scripts. +- **v0.61.0** brought a desktop app whose window signs in with a key the server makes at each start and accepts only once, so a sign-in from outside the app's window is refused, and third-party notices that a build writes exactly as they are kept, the demo media and the extension kit included. + +Everything before that, version by version: [[Releases]]. ## Status at a glance +How to read the State column: + +| Word | Meaning | +|---|---| +| Stable | Built, in use, and not expected to change shape | +| Working | Built and checked the way the row says | +| **in testing** | Works against a stand-in or a test service, not yet against the real one | +| **not yet run**, **not yet tried** | Written, and not exercised where the row says | + +### The core + | Area | State | |---|---| | Server, storage, accounts, workspaces, editor, databases, search, sharing | Stable, built through Phases 1 to 10 | | REST API with `/api/docs` and OAuth, MCP endpoint | Stable · see [[API-and-agents]] | -| Charts, heatmaps, the graph view, KPI dashboards and kanban upgrades | Working since v0.12.0 · see [[Data-views]] | -| Context packs, the knowledge bank, `form-md mcp`, Claude Code, Codex and Cursor connections | Working since v0.13.0; the client configs are checked by parsing, not yet inside each app · see [[Context-and-knowledge]] | -| Terminal, Claude Code and its chat in the app, window commands for agents, `form-md cli` | Working since v0.14.0; checked with a real Claude Code turn, not yet under browser throttling · see [[Terminal-and-Claude-Code]] | +| Interface and mail in 26 languages | Since v0.14.0; es-MX and fr-CA want a native read | +| Automated tests | None in the tree by design; CI runs format, vet, type check, a build and a smoke run · see [[Development]] | + +### Writing and pages + +| Area | State | +|---|---| | Page styles with a workspace default, focus mode, word counts | Working since v0.15.0; checked in Chrome under CPU and network throttling | | Image annotations, per-block alignment | Working since v0.16.0; checked in Chrome under CPU and network throttling | | Custom workspace fonts, typewriter scrolling | Working since v0.17.0; checked in Chrome under CPU and network throttling | | Board block, five creative embed providers, pictures on fresh public pages | Working since v0.18.0; checked in Chrome under CPU and network throttling | +| Phone block toolbar, renaming and removing uploaded fonts, the person_editing guard for agent replaces | Working since v0.21.0; checked in Chrome under CPU throttling · see [[API-and-agents]] | +| Picking, moving, recolouring and deleting single annotation marks, uploaded fonts on published pages, timeline windowing | Working since v0.23.0; checked in Chrome under CPU throttling | +| Annotation marks in Markdown and PDF exports, uploaded fonts in HTML exports, the list view loading as you scroll | Working since v0.24.0; checked in Chrome and by rasterizing the PDF | +| Saved styles, offline row deletes, faster bulk row updates (template lookup) | Working since v0.25.0; checked in Chrome and timed against v0.24.0 | + +### Databases and views + +| Area | State | +|---|---| +| Charts, heatmaps, the graph view, KPI dashboards and kanban upgrades | Working since v0.12.0 · see [[Data-views]] | +| Bulk row tools for agents about twice as fast again (six times faster than v0.24.0 for updates) | Since v0.27.0; timed against v0.26.0 · see [[Data-views]] | + +### Offline + +| Area | State | +|---|---| +| Recent pages kept offline, 1000-row offline databases, phone-width top bar and code blocks, described window commands | Working since v0.19.0; checked in Chrome · see [[Offline]] and [[Data-views]] | +| Offline cell edits kept and sent later, page styles on public pages and HTML exports, the slash setting in account settings | Working since v0.22.0; checked in Chrome · see [[Offline]] | +| Rows added offline, with client-made ids the server accepts | Working since v0.26.0; sent after a server restart without a reload since v0.38.0, checked with the server process stopped and restarted · see [[Offline]] | | Board, gallery, calendar, timeline, map, graph, chart, dashboard and feed views of kept, recent and opened databases offline; heatmaps as last opened | Working since v0.37.0, checked with the server process stopped; the v0.32.0 and v0.33.0 versions did not work with the server really down · see [[Offline]] | +| Offline start from the service worker, installable app | Working, **in testing**; the installed app not yet tried on a phone · see [[Offline]] | + +### Agents and the terminal + +| Area | State | +|---|---| +| Context packs, the knowledge bank, `form-md mcp`, Claude Code, Codex and Cursor connections | Working since v0.13.0; the client configs are checked by parsing, not yet inside each app · see [[Context-and-knowledge]] | +| Terminal, Claude Code and its chat in the app, window commands for agents, `form-md cli` | Working since v0.14.0; checked with a real Claude Code turn, not yet under browser throttling · see [[Terminal-and-Claude-Code]] | | Terminal and Claude Code panel checked under throttling: correct terminal cells, no empty first open, restart in place | Since v0.31.0; checked in Chrome at CPU 4x and 500 kbps · see [[Terminal-and-Claude-Code]] | | Per-credential revoke: a signed-out session, deleted token or revoked OAuth grant loses its streams, sockets and terminals at once | Working since v0.30.0; checked in Chrome and over OAuth, and against v0.29.0 · see [[API-and-agents]] | -| Form family note in context packs, `family-routing` sub-skill, family numbers in `policy.json` | Since v0.29.0; checked against stubs of the two apps' endpoints · see [[Form-family]] | | Form family descriptor, `family_list` and `family_route` for formlit and formvis | Since v0.28.0; checked against stubs of the two apps' endpoints, not the apps themselves · see [[Form-family]] | -| Bulk row tools for agents about twice as fast again (six times faster than v0.24.0 for updates) | Since v0.27.0; timed against v0.26.0 · see [[Data-views]] | -| Rows added offline, with client-made ids the server accepts | Working since v0.26.0; sent after a server restart without a reload since v0.38.0, checked with the server process stopped and restarted · see [[Offline]] | -| Saved styles, offline row deletes, faster bulk row updates (template lookup) | Working since v0.25.0; checked in Chrome and timed against v0.24.0 | -| Annotation marks in Markdown and PDF exports, uploaded fonts in HTML exports, the list view loading as you scroll | Working since v0.24.0; checked in Chrome and by rasterizing the PDF | -| Picking, moving, recolouring and deleting single annotation marks, uploaded fonts on published pages, timeline windowing | Working since v0.23.0; checked in Chrome under CPU throttling | -| Offline cell edits kept and sent later, page styles on public pages and HTML exports, the slash setting in account settings | Working since v0.22.0; checked in Chrome · see [[Offline]] | -| Phone block toolbar, renaming and removing uploaded fonts, the person_editing guard for agent replaces | Working since v0.21.0; checked in Chrome under CPU throttling · see [[API-and-agents]] | -| Recent pages kept offline, 1000-row offline databases, phone-width top bar and code blocks, described window commands | Working since v0.19.0; checked in Chrome · see [[Offline]] and [[Data-views]] | -| Interface and mail in 26 languages | Since v0.14.0; es-MX and fr-CA want a native read | +| Form family note in context packs, `family-routing` sub-skill, family numbers in `policy.json` | Since v0.29.0; checked against stubs of the two apps' endpoints · see [[Form-family]] | +| AI providers | Verified against a local stand-in, not yet against live provider keys | + +### Running an instance + +| Area | State | +|---|---| | At-rest encryption, `form-md encrypt` | Working since v0.11.0, independently audited · see [[Encryption]] | -| Built-in ACME certificates | Working, **in testing**: checked against a test CA (Pebble), not yet against Let's Encrypt production · see [[TLS-and-ACME]] | | `backup`, `restore`, `doctor`, `admin reset-owner` | Working since v0.11.0 · see [[Backup-and-restore]] and [[Operations]] | -| Offline start from the service worker, installable app | Working, **in testing**; the installed app not yet tried on a phone · see [[Offline]] | +| Automatic HTTPS from Instance settings, browser backup download, update check | Working since v0.11.0 · see [[TLS-and-ACME]], [[Backup-and-restore]], [[Operations]] | +| The first password of an account that has none (the desktop owner, accounts made by single sign-on) | Working since v0.61.1; checked against the built server, the Profile tab not yet looked at in a browser · see [[Install]] | +| Built-in ACME certificates | Working, **in testing**: checked against a test CA (Pebble), not yet against Let's Encrypt production · see [[TLS-and-ACME]] | | Cloudflare tunnel | Working, **in testing** against a stand-in, not yet against real Cloudflare · see [[Tunnel]] | | Gmail and Microsoft 365 sending | Working, **in testing** against a stub provider, not yet against Google or Microsoft · see [[Mail]] | -| Automatic HTTPS from Instance settings, browser backup download, update check | Working since v0.11.0 · see [[TLS-and-ACME]], [[Backup-and-restore]], [[Operations]] | | `install.sh`, systemd unit, container image, releases through formcompiler | Written and tried locally (the image built and answered `/healthz`), **not yet exercised by a formcompiler release** · see [[Install]] | | SAML and SCIM | Tested against a local identity provider only, not yet against Okta, Entra or Google Workspace | | Hosting on Google Cloud with `deploy/gcp`, Auth0 through OpenID Connect | The scripts are syntax-checked, **not yet run** on a new project; Auth0 **not yet tried** against a tenant · see [[Self-hosting]] and [[Auth0]] | -| The first password of an account that has none (the desktop owner, accounts made by single sign-on) | Working since v0.61.1; checked against the built server, the Profile tab not yet looked at in a browser · see [[Install]] | -| AI providers | Verified against a local stand-in, not yet against live provider keys | | Windows scripts (`*.bat`) | Written, **not yet run** on a Windows host | -| Automated tests | None in the tree by design; CI runs format, vet, type check, a build and a smoke run · see [[Development]] | - -## Where to go - -- Put an instance on a server: [[Install]] -- Your own copy on your own domain for a small team, start to finish: [[Self-hosting]] -- Sign people in through Auth0: [[Auth0]] -- Every environment variable and the settings they seed: [[Configuration]] -- Encrypt the data directory at rest: [[Encryption]] -- HTTPS with your own certificate, built-in ACME, or a reverse proxy: [[TLS-and-ACME]] -- Reach the server through Cloudflare without opening a port: [[Tunnel]] -- Sending mail through SMTP, Gmail or Microsoft 365: [[Mail]] -- Back up and restore: [[Backup-and-restore]] -- Health checks, the data directory, logs, updates, memory, fail2ban and upgrades: [[Operations]] -- Charts, heatmaps, the graph view, dashboards and boards: [[Data-views]] -- What works without a connection, and the installable app: [[Offline]] -- REST API, tokens, OAuth, rate limits and connecting agents: [[API-and-agents]] -- Repo layout, dev loop and conventions: [[Development]] -- Branches, commits and releases: `BRANCHING.md` at the repo root ## Editing this wiki diff --git a/.docs/wiki/Install.md b/.docs/wiki/Install.md index d1a3381..7208901 100644 --- a/.docs/wiki/Install.md +++ b/.docs/wiki/Install.md @@ -8,7 +8,16 @@ Since v0.43.0 each release also carries the desktop app: `form.md_X.Y.Z_aarch64. The app is a window around the same `form-md` binary. It starts the server on this computer when it opens and stops it when you quit, signs you in as the owner without a password screen, and keeps your data in `~/form.md` (start the app with `FORMMD_DATA` set to use another folder). The server listens on `127.0.0.1:8750` so agents and `form-md mcp` find it at the usual address, or on another free port when 8750 is taken. It never listens beyond this computer; to share a workspace with other people, run the server on its own as below ([[Self-hosting]] walks through a hosted instance on your own domain). -The owner the app creates has the name of your operating system account, the email `owner@localhost` and no password: the window is signed in by the app itself. A browser opened at `http://127.0.0.1:8750` is not signed in and asks for an email and password, and there is no initial password to type. Set one in the app first: Settings, Profile, Password, where the Current password box reads "No password set yet" and is not asked for the first time. Then sign in from the browser with `owner@localhost` (or the address you changed it to) and that password. Changing the email asks for the password, so set the password first. Since v0.61.1; in earlier versions the first password could not be set from the app. There, close the app and run the server binary's `form-md admin reset-owner` with `FORMMD_DATA` set to the app's data folder: it prints a new password for the owner ([[Operations]]). +### Opening the app's workspace in a browser + +The owner the app creates has the name of your operating system account, the email `owner@localhost` and no password: the window is signed in by the app itself. A browser opened at `http://127.0.0.1:8750` is not signed in and asks for an email and password, and there is no initial password to type. + +1. Set one in the app first: Settings, Profile, Password, where the Current password box reads "No password set yet" and is not asked for the first time. +2. Then sign in from the browser with `owner@localhost` (or the address you changed it to) and that password. + +Changing the email asks for the password, so set the password first. + +Since v0.61.1; in earlier versions the first password could not be set from the app. There, close the app and run the server binary's `form-md admin reset-owner` with `FORMMD_DATA` set to the app's data folder: it prints a new password for the owner ([[Operations]]). A macOS build downloaded from a release is unsigned unless formcompiler, which builds the releases, signed it with the Apple identity it holds: allow it once under System Settings, Privacy and Security, Open Anyway. diff --git a/.docs/wiki/Offline.md b/.docs/wiki/Offline.md index 70bbeee..9f2de63 100644 --- a/.docs/wiki/Offline.md +++ b/.docs/wiki/Offline.md @@ -1,6 +1,10 @@ # Offline -form.md opens without a connection to the server. A service worker keeps the built client and a copy of the signed-in app shell, and page bodies live in the browser's IndexedDB as the same CRDT documents the server holds, so pages saved on the device open, show their text and accept typing while the server is unreachable, including after the browser was closed and reopened offline (the device remembers whether you may edit each page). Text edits merge into the server's copy when the connection comes back. Databases opened or kept on the device open with up to 1000 rows in every view, the row pages among them open with their properties and body, and rows added, edited or deleted offline are queued in the browser and sent when the server is back. Everything else (schema and view changes, ad-hoc filters and further rows, search, comments, the inbox, uploads, AI and settings) needs the server. +form.md opens without a connection to the server. + +- **Pages.** A service worker keeps the built client and a copy of the signed-in app shell, and page bodies live in the browser's IndexedDB as the same CRDT documents the server holds, so pages saved on the device open, show their text and accept typing while the server is unreachable, including after the browser was closed and reopened offline (the device remembers whether you may edit each page). Text edits merge into the server's copy when the connection comes back. +- **Databases.** Databases opened or kept on the device open with up to 1000 rows in every view, the row pages among them open with their properties and body, and rows added, edited or deleted offline are queued in the browser and sent when the server is back. +- **What still needs the server.** Everything else (schema and view changes, ad-hoc filters and further rows, search, comments, the inbox, uploads, AI and settings) needs the server. ## Layout @@ -27,13 +31,23 @@ form.md opens without a connection to the server. A service worker keeps the bui ## Keeping pages on the device -Every page you open is kept in IndexedDB on that device, and every database you open while the service worker controls the tab is kept in the worker's API cache (`formmd-api`: the reads `GET /api/pages/`, `GET /api/collections/` and `GET /api/rows/`). To keep pages you have not opened, use the page menu item **Available offline** (shown for document and database pages you can view, not for database rows, in browsers with service workers). It keeps that page and all of its subpages synced into IndexedDB, the first view of each database among them in the API cache together with the row pages in its first window (their details and bodies), and the pictures and files those pages show in the file cache, now, shows how many were saved, and re-syncs them about 30 seconds after each start while online. Choosing it again stops keeping them. +- **What you open is kept.** Every page you open is kept in IndexedDB on that device, and every database you open while the service worker controls the tab is kept in the worker's API cache (`formmd-api`: the reads `GET /api/pages/`, `GET /api/collections/` and `GET /api/rows/`). +- **Keeping pages you have not opened.** To keep pages you have not opened, use the page menu item **Available offline** (shown for document and database pages you can view, not for database rows, in browsers with service workers). +- **What Available offline keeps.** It keeps that page and all of its subpages synced into IndexedDB, the first view of each database among them in the API cache together with the row pages in its first window (their details and bodies), and the pictures and files those pages show in the file cache, now, shows how many were saved, and re-syncs them about 30 seconds after each start while online. +- **Turning it off.** Choosing it again stops keeping them. A kept database keeps up to 1000 rows: the worker caches `GET /api/collections/?view=&rows=1000` for every table and list view, answers an offline read of that database from that copy first, and the row pages of the first 1000 rows are synced. Without any marking, the 20 pages and databases this account opened most recently (on any device, from `GET /api/recent`) are kept the same way at each start. The command **Keep recent pages offline** (`offline.recent`) turns that off or on again for this browser. -Other views ask the server with `POST /api/collections//query`, `/chart` or `/feed`, which the browser cache cannot hold as such. The worker keeps each successful first-page answer (no search text, offset 0) under a key made from the collection path and a SHA-256 of the request body, and answers the same request from it only when the network fails. A canonical `/query` answer (no group or lane paging, tree, ad-hoc filter, row ids, sort override or date range) is also kept under a key for its view, and any plain request for that view (one without group or lane paging, tree, ad-hoc filter or row ids) falls back to it when its exact request was never made (another calendar month, say); `/chart` and `/feed` answers are only ever served for the exact request, so a dashboard widget never gets another widget's numbers and clicking a chart mark offline never shows the chart's totals as its rows. +Other views ask the server with `POST /api/collections//query`, `/chart` or `/feed`, which the browser cache cannot hold as such. + +- **Exact answers.** The worker keeps each successful first-page answer (no search text, offset 0) under a key made from the collection path and a SHA-256 of the request body, and answers the same request from it only when the network fails. +- **A fallback per view.** A canonical `/query` answer (no group or lane paging, tree, ad-hoc filter, row ids, sort override or date range) is also kept under a key for its view, and any plain request for that view (one without group or lane paging, tree, ad-hoc filter or row ids) falls back to it when its exact request was never made (another calendar month, say); +- **Charts and feeds never borrow.** `/chart` and `/feed` answers are only ever served for the exact request, so a dashboard widget never gets another widget's numbers and clicking a chart mark offline never shows the chart's totals as its rows. -The keeper asks the worker to fetch these itself (the `offline-query` message, like the row and page reads), so it works even before the worker controls the page, and the worker claims open pages when it activates. For kept and recent databases at the keeper's pass, and for any database opened while online (about two seconds after opening, once per session, unless **Keep recent pages offline** is off), it keeps the database and asks once for every board, gallery, calendar, timeline, map, graph, chart and feed view and every dashboard widget (with its sparkline). A heatmap's request depends on the day and is kept when the heatmap is opened online. The map's land outline (`/maps/world-110m.json`) is in `/offline.json` and cached with the built assets. +- **Who fetches.** The keeper asks the worker to fetch these itself (the `offline-query` message, like the row and page reads), so it works even before the worker controls the page, and the worker claims open pages when it activates. +- **Which views.** For kept and recent databases at the keeper's pass, and for any database opened while online (about two seconds after opening, once per session, unless **Keep recent pages offline** is off), it keeps the database and asks once for every board, gallery, calendar, timeline, map, graph, chart and feed view and every dashboard widget (with its sparkline). +- **Heatmaps.** A heatmap's request depends on the day and is kept when the heatmap is opened online. +- **The map.** The map's land outline (`/maps/world-110m.json`) is in `/offline.json` and cached with the built assets. Queued database changes are sent when the browser comes back online, when the app's live connection to the server is re-established (a server restart or a dropped link, where the browser itself never went offline), and at start. @@ -64,7 +78,11 @@ In the installed window, a **Sync now** button appears in the top bar. It reconn ## Sign-out -Signing out deletes the cached shell, the API cache, the file cache and every IndexedDB document database the app created (names starting `formmd-doc-`), so the next person on that browser starts clean. Database changes still queued are kept in `localStorage` under the account's id, so they are never sent under anyone else's session and are sent when that account signs in again on this browser. When a different account starts the app than the one that last used it, the app deletes the same caches and databases before it loads. When the server answers that the session has ended (expired or revoked), the app deletes the shell, API and file caches before it goes to the sign-in page. The asset cache holds only the public client build and is kept. +- **What is deleted.** Signing out deletes the cached shell, the API cache, the file cache and every IndexedDB document database the app created (names starting `formmd-doc-`), so the next person on that browser starts clean. +- **Changes not yet sent.** Database changes still queued are kept in `localStorage` under the account's id, so they are never sent under anyone else's session and are sent when that account signs in again on this browser. +- **Another account on the same browser.** When a different account starts the app than the one that last used it, the app deletes the same caches and databases before it loads. +- **A session that ended.** When the server answers that the session has ended (expired or revoked), the app deletes the shell, API and file caches before it goes to the sign-in page. +- **What is kept.** The asset cache holds only the public client build and is kept. ## For operators diff --git a/.docs/wiki/Releases.md b/.docs/wiki/Releases.md new file mode 100644 index 0000000..b32f19f --- /dev/null +++ b/.docs/wiki/Releases.md @@ -0,0 +1,119 @@ +# Releases + +What each version of form.md brought, newest first. One row per version; the wording is the project's own record of that release. + +- **Current version:** v0.61.1 +- **Where releases come from:** Releases built by formcompiler and the update check and installer reading its form.md-updates release. +- **Downloads:** the README's Download section, and [[Install]] for servers. +- **How a release is cut:** `BRANCHING.md` at the repo root. + +## v0.60 and later + +| Version | What it brought | +|---|---| +| v0.61.1 | Lets an account that has no password, such as the desktop app's owner, set its first one without being asked for a current one, and adds [[Self-hosting]], [[Auth0]] and the `deploy/gcp` scripts | +| v0.61.0 | A desktop app whose window signs in with a key the server makes at each start and accepts only once, so a sign-in from outside the app's window is refused, and third-party notices that a build writes exactly as they are kept, the demo media and the extension kit included | +| v0.60.0 | A desktop app on Windows in which nothing the server starts (Claude Code and the other agents, the tunnel, the server's own clean-up) opens a console window, with `FORMMD_ENGINE_WINDOWED=0` to open one with the server's output for a single start, and the views and publish demos rebuilt with the app's current styles | + +## v0.50 to v0.59 + +| Version | What it brought | +|---|---| +| v0.59.0 | The offline demo rebuilt with the app's current styles, AMOLED Black and the shared terminal panel's included, and the Form family's token names available in form.md's stylesheets so shared pieces can use them, with every colour, size and theme of form.md as it was | +| v0.58.0 | A desktop app on Windows whose server always ends with it, however the app ends, a start that fails shown in a dialog with what the server last printed, its exit code and where the log is, and a wait of at most 90 seconds for the server to start; on macOS a server that has stopped but was not yet cleaned up no longer counts as still running; `./form-md claude` and `./form-md agents install` finding Claude Code the way the app does, `agents install` naming Antigravity, Antigravity in Connected apps, and the terminal panel's guide saying that Codex, Cursor and Antigravity each get a button when they are installed | +| v0.57.0 | A cleaner start and stop for the desktop app, on Windows most of all: a server left behind by an app that is gone is replaced at the next start where it used to block it, a second start on the same data folder is refused with a sentence that says form.md is already running there, the server stops within a few seconds once the app that started it is gone, and a start that fails shows its message before the loading window closes; and a folder of its own for every Antigravity tab, so two tabs open at once no longer take each other's access | +| v0.56.0 | Antigravity (Google's `agy` program) as a fourth agent beside Claude Code, Codex and Cursor's agent, with a tab of its own in the terminal panel, and one way of finding all four programs however form.md was started, which says where it looked when a program is missing and what the program printed when it does not start | +| v0.55.0 | The terminal panel as the one every Form app shares: it has a row or a column of its own in the window, so it no longer lies over the page, and a button in its head moves it between the bottom and the right; Codex and Cursor's agent opening in tabs of their own beside Claude Code's, with a More agents menu and a short guide the first time the panel opens; the panel's side, size and front tab remembered, a height set in an earlier version kept; the same keys as before (`Mod+J`, `Mod+Alt+J`, `Mod+Alt+K`), and with the cursor anywhere in the panel no other key reaching the page behind it; a Restart button in the panel's head where a double-click on a tab restarted it; From Claude Code as a command in Find a command where it was a button in Chat; and a page that asks the server nothing about the panel while it is closed | +| v0.54.0 | A token of its own for every Claude Code tab in the terminal panel, so Account settings, API tokens lists one "Claude Code tab in form.md" row per open tab where it listed one shared row, and closing a tab ends its token, while Chat keeps its single "Claude Code in form.md" token; a terminal that attaches only from the page the server itself served; AMOLED Black, a true-black dark theme for OLED screens, in Preferences; `./form-md agents install` registering Claude Code with a header that names `FORMMD_MCP_TOKEN` and no longer contains it; `window_command_run` and `extension_command` announced to agents as tools that can change the workspace, with `extension_command` no longer listed to a read-only credential; `agents/manifest.json`, the list of what form.md offers agents, written by `./form-md agents manifest` and checked by `--check`; server routes that open Codex and Cursor's agent in a terminal tab with a token each and report which of the three programs are installed, ahead of the window's own buttons for them; and the editor's live sync connecting again through the Vite dev server | +| v0.53.0 | A date range on database views (All dates, Today, Last 7 days, Last 30 days or a custom start and end date), kept per viewer and view in the browser and sent with every rows and chart request as `date_range`, which the server ANDs with the view's saved filter, plus Today, Last 7 days and Last 30 days as Is within filter options, and a view tab strip that stays inside the database with a count button listing the views scrolled out of sight | +| v0.52.2 | Builds the container image again, its interface build carrying the demo builds it packs | +| v0.52.1 | Opens a page the browser has cached as editable from the first frame, so the mode button no longer shows Viewing before Editing | +| v0.52.0 | Header alignment as a page style, the page header on the left by default, centred or on the right per page or for the workspace, and fixed the page top bar's Edited label arriving after the mode button | +| v0.51.0 | The three demos inside the app: a Demos section on Home, a Demos group in the Help menu, the native Help menu and Find a command, and demo.editor, demo.views and demo.publish for agents, each opening the demo's own build in a sandboxed frame over the window that never reads or writes your pages, with the demos' credited media shipped in the binary | +| v0.50.1 | The extension refusal for a manifest's API in the same words every Form app uses | +| v0.50.0 | Form extensions: form.md loads the extensions FormPortal installs and form.ext runs, each in a sandboxed frame with its own consent, from an Extensions menu, an Extensions panel and the command palette, with document.apply as one undo step and extensions_list and extension_command for agents | + +## v0.40 to v0.49 + +| Version | What it brought | +|---|---| +| v0.49.3 | Two more offline demos, demos/views for the database views on a real dataset of US crewed spaceflight and demos/publish for writing, comments, page history, publishing and export on the whole window, each credited in its own CREDITS.md, and a link row between the three demos | +| v0.49.2 | The desktop app's splash as the Form family's rounded card with a progress bar, square corners gone on macOS, and a main window that appears whole once its first content is drawn | +| v0.49.1 | Real public-domain and freely licensed media in the offline demo, a notebook of Galileo, NASA and Pexels material with a real exoplanet database, all credited in demo/CREDITS.md | +| v0.49.0 | An offline browser demo in demo/ that opens from demo/index.html with no server | +| v0.48.0 | The README in the Form family template (#5), merged with main, and the unified app icon | +| v0.47.8 | The About tab and the installers naming NodeAgentc, Inc. as the publisher with the Apache-2.0 licence | +| v0.47.7 | Linux packages that recommend GStreamer's plugins and an AppImage that carries them, so the meeting recorder works on a fresh install | +| v0.47.6 | A container image built with Go 1.26.9, as go.mod states, and line endings fixed for Windows checkouts, CRLF for the .bat scripts and LF for everything else | +| v0.47.5 | A first paint that waits for the whole page shell, so the sidebar, the top bar and Home no longer jump while they load, and a CI check that loads the window under throttling | +| v0.47.4 | A Go test suite that checks the desktop key, the origin guard, the sync socket, live editing by two clients and an agent, migrations, Markdown round trips, viewer and share-link limits, and the version sites | +| v0.47.3 | A desktop release build that keeps its symbols, since macOS builds fail on a stripped binary | +| v0.47.2 | A web client with no known vulnerable dependency: DOMPurify 3.4.17 and markdown-it 15.0.3 | +| v0.47.1 | Names the copyright holder, NodeAgentc, Inc., and shows by nodemode.ai in Admin settings, About | +| v0.47.0 | Stores each form submission as one response record with computed columns and adds the response-received automation trigger | +| v0.46.3 | Third-party notices that cover every platform's Go modules, KaTeX's fonts under the OFL and the Linux AppImage's LGPL libraries | +| v0.46.2 | The Mirrored block under its own name in every language | +| v0.46.0 | Home leads with your own material, recent pages and templates, with Data & charts in a Templates side panel you can close, Example projects below the templates, the page aligned to the left, dropdowns that show every item and every scrollbar hidden | +| v0.45.3 | The app icon as the owner chose it, the white .MD in a white outline, with its clean edge | +| v0.45.2 | The app icon's light outer rim removed at every size | +| v0.45.1 | The new app icon: the owner's glass # with the F in front, a pointer and a .MD tag, in the app, the favicon and the desktop splash | +| v0.45.0 | Data & charts first on Home: 15 featured templates covering every chart kind and database view, and 14 example projects already filled in, each a home page with dashboards, sub-pages and related databases, for 90 templates in eleven categories | +| v0.44.0 | A page-first layout with Home at /home, 61 templates in nine categories with a previewing gallery, search filters and sorts, Find a command, find and replace, rebindable shortcuts, and Preferences with dark and light theme profiles, accent, density and high contrast | +| v0.43.0 | Form.md as a desktop app for macOS, Linux and Windows, built by ./build_app or build_app.bat, with the server inside it and the owner signed in | +| v0.42.1 | The build no longer stops when Go keeps its licence outside GOROOT, as Homebrew Go 1.27 does | +| v0.42.0 | Made for everyday people: a plain home with recent pages, simpler sharing, publishing, sign-in and settings, tables you can find and fill, phone-sized controls; formlit's icons throughout and the three-star sparkle retired; a Claude Code panel and chat that work like formlit's, with an ask bar and Ctrl/Cmd+J | +| v0.41.0 | Answers that can draw on the web, uploaded PDFs searchable by their text, boards and galleries kept on published pages, Mermaid drawn in its dark theme, the slash menu, format bar and cursors inside synced blocks, long-press drag in the page tree, a Graph tab in the library, webhook page events carrying the page, import sources named by file format | +| v0.40.0 | Page-tree import checked against twelve real Markdown and CSV page exports from public open-source test corpora and six defects fixed: links under folders starting with #, database links, ids left in titles, attached zips imported twice, videos reported as skipped, image alt text | + +## v0.30 to v0.39 + +| Version | What it brought | +|---|---| +| v0.39.4 | Terminal styles kept inside the terminal pane, closing the v0.39.0 review list | +| v0.39.3 | A sign-out that lands while a connection is opening now closes it too | +| v0.39.2 | One sibling lookup at a time, an in-app agent token that recovers from a revoke without a restart, a bounded formula pattern cache | +| v0.39.1 | An OAuth grant whose access token runs out without a refresh closes its live connections within a minute | +| v0.39.0 | A release review: Go 1.26.9 and x/net v0.61.0 with no reachable vulnerabilities, offline database changes kept per account, expired sessions closing their live connections, sibling answers checked before agents see them | +| v0.38.1 | Starter hints as callouts and offline deletes checked across a server restart | +| v0.38.0 | Database changes made while the server was down are sent as soon as it is back, without a reload | +| v0.37.0 | Database views that really open offline, checked with the server stopped, which the v0.32.0 and v0.33.0 versions did not | +| v0.36.0 | Dashboard widgets moved with the arrow keys and a graph row list for screen readers | +| v0.35.0 | Pickers loaded on first use and a 260 KB start budget the build enforces | +| v0.34.0 | A lighter start: one translation chunk per language and the library loaded on demand | +| v0.33.0 | Board, gallery, calendar, timeline, map and chart views of kept and recent databases open offline without having been opened first, maps included | +| v0.32.0 | Those views offline as last seen, and terminal colours following a system theme switch | +| v0.31.0 | Terminals drawn correctly under the security policy, a panel that opens with its terminal, restart in place, a chat tab without the empty-state error | +| v0.30.0 | Revoking one token, session or OAuth grant closing its live streams, editing sockets and terminal attachments | + +## v0.20 to v0.29 + +| Version | What it brought | +|---|---| +| v0.29.0 | Context packs that name formlit or formvis when they fit the task, and the family-routing sub-skill | +| v0.28.0 | The form family bridge: a public descriptor and tools that tell agents when formlit or formvis fits a task | +| v0.27.0 | Faster bulk row tools for agents | +| v0.26.0 | Rows added offline | +| v0.25.0 | Saved styles, offline row deletes, bulk row updates nearly three times faster | +| v0.24.0 | Annotation marks in Markdown and PDF, uploaded fonts in HTML exports, a list view that loads as you scroll | +| v0.23.0 | Editable single annotation marks, uploaded fonts on published pages, a windowed timeline | +| v0.22.0 | Offline database edits kept and sent later, page styles on public pages and exports, the slash setting in account settings | +| v0.21.0 | A phone block toolbar, renaming and removing fonts, agents kept out of the block a person is typing in | +| v0.20.0 | Phase 16 audit fixes: pictures from agents imported on the server, block alignment on public pages, a server-side default for command safety | + +## v0.11 to v0.19 + +| Version | What it brought | +|---|---| +| v0.19.0 | Offline by default with larger databases, phone-width fixes, described window commands | +| v0.18.0 | The board block and creative embeds | +| v0.17.0 | Custom fonts and typewriter scrolling | +| v0.16.0 | Image annotations and block alignment | +| v0.15.0 | Page styles, focus mode and word counts | +| v0.14.0 | The terminal, Claude Code and its chat inside the app, window commands for agents, 26 languages | +| v0.13.0 | Context packs and agent connections | +| v0.12.0 | The visual data views | +| v0.11.0 | Encryption, ACME, operations commands, offline start and the installer | + +## Related + +[[Home]] · [[Install]] · [[Development]] diff --git a/.docs/wiki/Terminal-and-Claude-Code.md b/.docs/wiki/Terminal-and-Claude-Code.md index 43046ce..e0f3064 100644 --- a/.docs/wiki/Terminal-and-Claude-Code.md +++ b/.docs/wiki/Terminal-and-Claude-Code.md @@ -4,7 +4,13 @@ Since v0.14.0 form.md has a panel with terminals, Claude Code and a Claude Code ## Who can use it -The instance owner, signed in, on a form.md that listens on this computer (`127.0.0.1`, the default for `./form-md` and the desktop case). A terminal is a shell as the user the server runs as, so on a server it is off unless you set `FORMMD_TERMINAL=on`; `FORMMD_TERMINAL=off` turns it off even locally. Agent tokens never reach it. A terminal also attaches only from a page the server itself served (the page's origin must be the request's own host, or `tauri.localhost` for the desktop window), so a page served from another port on the same computer is refused. A terminal tab is attached through the browser session that opened it: signing that session out (here, from another device in **Account settings, Sessions**, or by an admin) detaches it at once, while the shell keeps running for your other sessions. Windows servers report that the terminal needs macOS or Linux. +The instance owner, signed in, on a form.md that listens on this computer (`127.0.0.1`, the default for `./form-md` and the desktop case). + +- **On a server it is off.** A terminal is a shell as the user the server runs as, so on a server it is off unless you set `FORMMD_TERMINAL=on`; `FORMMD_TERMINAL=off` turns it off even locally. +- **Agents cannot reach it.** Agent tokens never reach it. +- **Only from the app's own page.** A terminal also attaches only from a page the server itself served (the page's origin must be the request's own host, or `tauri.localhost` for the desktop window), so a page served from another port on the same computer is refused. +- **Tied to your session.** A terminal tab is attached through the browser session that opened it: signing that session out (here, from another device in **Account settings, Sessions**, or by an admin) detaches it at once, while the shell keeps running for your other sessions. +- **Not on Windows servers.** Windows servers report that the terminal needs macOS or Linux. ## The panel @@ -20,7 +26,22 @@ The More agents menu opens Codex, Cursor's agent and Antigravity (Google's `agy` ## Claude Code -Claude Code must be installed and signed in once (`claude` in any terminal). form.md looks for each of the four programs (Claude Code, Codex, Cursor and Antigravity) in the same order: at its override variable (`FORMMD_CLAUDE_BIN`, `FORMMD_CODEX_BIN`, `FORMMD_CURSOR_BIN`, `FORMMD_ANTIGRAVITY_BIN`), on the PATH form.md was started with, in the usual install folders, then on your shell's own PATH, which it reads once. A program that is found but does not start is reported with the error it printed, and one that is not found with the places that were looked in. Each tab starts in the data directory's `agent/` folder with this form.md's MCP endpoint attached through a token of its own, listed as "Claude Code tab in form.md" in your account's API tokens while the tab is open. Closing the tab ends its token, and revoking it there cuts that tab off. Chat uses one token named "Claude Code in form.md"; revoke it and the next chat turn gets a new token of the same name. +Claude Code must be installed and signed in once (`claude` in any terminal). + +**How form.md finds the programs.** form.md looks for each of the four programs (Claude Code, Codex, Cursor and Antigravity) in the same order: + +1. at its override variable (`FORMMD_CLAUDE_BIN`, `FORMMD_CODEX_BIN`, `FORMMD_CURSOR_BIN`, `FORMMD_ANTIGRAVITY_BIN`), +2. on the PATH form.md was started with, +3. in the usual install folders, +4. then on your shell's own PATH, which it reads once. + +A program that is found but does not start is reported with the error it printed, and one that is not found with the places that were looked in. + +**Tokens.** + +- Each tab starts in the data directory's `agent/` folder with this form.md's MCP endpoint attached through a token of its own, listed as "Claude Code tab in form.md" in your account's API tokens while the tab is open. +- Closing the tab ends its token, and revoking it there cuts that tab off. +- Chat uses one token named "Claude Code in form.md"; revoke it and the next chat turn gets a new token of the same name. The chat runs the same Claude Code non-interactively and shows its answer, every form.md tool it calls and the memory it uses. **Open in Claude Code** continues the conversation in a terminal tab; the **From Claude Code** command, in Find a command, brings a tab's conversation into the chat. diff --git a/.docs/wiki/_Sidebar.md b/.docs/wiki/_Sidebar.md index 2bc3938..db35e1b 100644 --- a/.docs/wiki/_Sidebar.md +++ b/.docs/wiki/_Sidebar.md @@ -3,6 +3,7 @@ - [[Home]] - [[Install]] - [[Configuration]] +- [[Releases]] **Running an instance**