Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
with an MCP server so an agent can draft a deck from your material. Local-first, no account.</p>

<p align="center">
<img alt="version 0.43.0" src="https://img.shields.io/badge/version-0.43.0-eef0f4?style=flat-square">
<img alt="version 0.45.0" src="https://img.shields.io/badge/version-0.45.0-eef0f4?style=flat-square">
<img alt="TypeScript and Vite" src="https://img.shields.io/badge/TypeScript-Vite-3178c6?style=flat-square&logo=typescript&logoColor=white">
<img alt="Python and FastAPI" src="https://img.shields.io/badge/Python-FastAPI-009688?style=flat-square">
<img alt="macOS, Windows, Linux" src="https://img.shields.io/badge/macOS%20%C2%B7%20Windows%20%C2%B7%20Linux-native-2f7bf5?style=flat-square">
<img alt="License: Apache-2.0" src="https://img.shields.io/badge/license-Apache--2.0-3a3a3a?style=flat-square">
<img alt="Status: active development" src="https://img.shields.io/badge/status-active%20development-d69e2e?style=flat-square">
<img alt="Status: released" src="https://img.shields.io/badge/status-released-d69e2e?style=flat-square">
</p>

<p align="center">
Expand Down Expand Up @@ -138,7 +138,7 @@ cd formdeck
`./formdeck desktop dev` opens the desktop window instead. On Windows use `formdeck.bat install` and `formdeck.bat`. The engine listens on `127.0.0.1:8197` (MCP at `/mcp`); `FORMDECK_DATA_DIR` moves the data folder from `~/formdeck`.

> [!IMPORTANT]
> **Status:** active development. Sharing beyond your network needs a relay you run yourself, the 25 translations are machine made and not yet reviewed, and a phone or tablet cannot reach the engine yet. See [`docs/PARITY.md`](docs/PARITY.md).
> **Status:** released. FormDeck is built and bundled for macOS, Windows and Linux and has been tested on all three. Sharing beyond your network needs a relay you run yourself, the 25 translations are machine made and not yet reviewed, and a phone or tablet cannot reach the engine yet. See [`docs/PARITY.md`](docs/PARITY.md).

**Contributing:** branch from `main`, keep changes to source here, and leave packaging and releases to FormCompiler. See [`CONTRIBUTING.md`](CONTRIBUTING.md), [`CODE_OF_CONDUCT.md`](CODE_OF_CONDUCT.md), [`.docs/BRANCHING.md`](.docs/BRANCHING.md) and [`AGENTS.md`](AGENTS.md). Report security issues privately as [`SECURITY.md`](SECURITY.md) describes.

Expand Down
12 changes: 12 additions & 0 deletions backend/HASHOUT_LOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -881,3 +881,15 @@ Entry 143 named what was still missing. This is it, after FormVis's shell, becau
The owner's decision for every app: a Windows engine is packaged with no console window, as FormWeb's is. formdeck's freeze scripts had no switch, so both now give PyInstaller `--noconsole` on Windows (the `.bat` always, the bash script when `fd_os` says windows, as under Git Bash), and `FORMDECK_ENGINE_WINDOWED=0` leaves it out, for a build whose engine should keep its console while a fault is looked into. Builds for macOS and Linux are unchanged.

The engine still tells the shell its address and window key: the shell starts it with pipes for its output, and a windowed program writes to the pipes it is given. When it is started with none (from the Explorer, or `--selfcheck` from a prompt), `formdeck_engine.py` already replaces a missing `sys.stdout` and `sys.stderr` with the null device (wave 4), so `--selfcheck` still runs and its exit code still decides the build. Checked with `bash -n` and by reading the `.bat`; no Windows build has shown it.

## 147. The test of entry 144 holds on every system · _v0.44.0 (tests/test_startup.py)

The last check of entry 144's test set `PROC` back to `/proc` and asked that `finished` answer false. That is only true where `/proc` exists: on macOS there is none, so `finished` would ask `ps`, see the holder that was not collected, and answer true, and the test would fail. The pull request workflow runs the suite on Linux only, so it never showed; the builds for macOS do not run it either, but the test must still be true there. The check now points `PROC` at the test's own folder, which exists on every system, and so asks what it meant to ask: where a process folder exists, `finished` never asks `ps` and answers false. FormCut's fix (its commit c2c2e221) carries no such check. Run on Linux: tests/test_startup.py, 16 passed. Not run on macOS.

## 148. A place for Codex, Cursor and Antigravity, sealed like Claude Code's, and a choice sealed by 0.43.0 still reads whole · _v0.45.0 (core/seal.py LATER, sealed, loosened, effective; core/config.py write_settings; routers/system.py set_settings; services/claude_code.py SETTINGS, setting; tests/test_seal.py)

formdeck kept a place for Claude Code (`claude.bin`) inside the sealed agent choice, given to the finder first. Codex, Cursor and Antigravity now have the same: `codexBin`, `cursorBin` and `antigravityBin` (the family finder's own names for them) are taken by `POST /api/settings` behind the window key as `claude` is (a string, trimmed, at most 4000 characters; anything else is stored as empty), sealed with the agent choice, and handed to the finder first through `claude_code.setting`, so a program that is not found now tells the person to give its path in Preferences, as Claude Code's did. A write of any of them re-signs the choice the same way a write of `claude` does. A hand edit of any of the four places reads as broken: every place is emptied and access goes back to Ask (or stays Blocked).

The update path. The seal is an HMAC over `sealed()`; adding three keys to that body would change the digest of every file sealed by 0.43.0 and 0.44.0 and make each read as broken after the update, which takes agent access back to Ask and empties the Claude Code place. So the three keys enter the body only when they hold a value (`LATER`), as `agentsBlocked` enters it only when true; a file with none of them hashes exactly as before. This is the way FormLit (wave 8) and FormPDF (wave 9) took. Proved before the change with real files: the 0.43.0 backend (`git archive` of origin/main; the seal code is the same in 0.44.0) wrote `settings.json` with agents allowed and a Claude Code place under a keyring stand-in kept in a file; this backend read it with the same key as `seal: ok`, the choice and the place kept, the three new places empty; a write of `codexBin` after that read back as `ok` with the choice and the Claude Code place kept. No migration is needed. `test_a_choice_sealed_by_0_43_0_reads_whole_after_the_update` writes a file of 0.43.0's shape with 0.43.0's digest formula and checks the same through later writes; the parametrized test checks each new place through the endpoint: sealed, given to the finder first (found with how `setting`), a value that is not a string stored as empty, and a hand edit caught.

Ran: tests/test_seal.py, tests/test_window_key.py, tests/test_dock_engine.py, tests/test_f3_mcp.py, 66 passed.
2 changes: 1 addition & 1 deletion backend/app/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.43.0"
__version__ = "0.45.0"
4 changes: 2 additions & 2 deletions backend/app/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ def write_settings(patch: dict) -> dict:
patch = {**patch, "agentsBlocked": True, "agentsAllowed": False}
elif patch.get("agentsAllowed"):
patch = {**patch, "agentsBlocked": False}
if "agentsAllowed" in patch or "agentsBlocked" in patch or "claude" in patch:
if any(k in patch for k in ("agentsAllowed", "agentsBlocked", "claude") + seal.LATER):
current = seal.effective(stored)
merged = seal.sign({**stored, **{k: current[k] for k in ("agentsAllowed", "claude") if k in current}, **patch})
merged = seal.sign({**stored, **{k: current[k] for k in ("agentsAllowed", "claude") + seal.LATER if k in current}, **patch})
else:
merged = {**stored, **patch}
tmp = settings_path().with_suffix(".tmp")
Expand Down
7 changes: 5 additions & 2 deletions backend/app/core/seal.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
SERVICE = "FormDeck"
ACCOUNT = "settings-seal"
FIELD = "seal"
LATER = ("codexBin", "cursorBin", "antigravityBin")
_CACHE: dict = {"tried": False, "available": False, "key": None}


Expand Down Expand Up @@ -41,7 +42,8 @@ def sealed(values: dict) -> dict:
claude = values.get("claude")
chosen = claude.get("bin") if isinstance(claude, dict) else ""
blocked = {"agentsBlocked": True} if values.get("agentsBlocked") is True else {}
return {"agentsAllowed": bool(values.get("agentsAllowed")), "claudeBin": str(chosen or "").strip(), **blocked}
later = {k: str(values.get(k) or "").strip() for k in LATER if str(values.get(k) or "").strip()}
return {"agentsAllowed": bool(values.get("agentsAllowed")), "claudeBin": str(chosen or "").strip(), **blocked, **later}


def digest(values: dict, key: bytes) -> str:
Expand All @@ -51,7 +53,7 @@ def digest(values: dict, key: bytes) -> str:

def loosened(values: dict) -> bool:
now = sealed(values)
return now["agentsAllowed"] or bool(now["claudeBin"])
return now["agentsAllowed"] or bool(now["claudeBin"]) or any(now.get(k) for k in LATER)


def effective(stored: dict) -> dict:
Expand All @@ -67,6 +69,7 @@ def effective(stored: dict) -> dict:
out["agentsAllowed"] = False
if isinstance(out.get("claude"), dict):
out["claude"] = {**out["claude"], "bin": ""}
out.update({k: "" for k in LATER})
return {**out, "seal": "broken", "sealBroken": True}


Expand Down
5 changes: 4 additions & 1 deletion backend/app/routers/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def get_settings(request: Request) -> dict:
def set_settings(patch: dict, request: Request) -> dict:
if ("agentsAllowed" in patch or "agentsBlocked" in patch) and not from_window(request.headers.get("origin"), request.headers.get("host", ""), config.cors_origins()):
raise HTTPException(403, "only formdeck's own window changes agent access")
allowed = {k: v for k, v in patch.items() if k in {"agentsAllowed", "agentsBlocked", "author", "defaultTemplate", "autosave", "units", "recent", "lastTemplate", "dictionary", "proofingLanguage", "chat", "captions", "stock", "aiImages", "addins", "claude", "keys", "defaultSize", "defaultFonts", "marquee", "pinned", "recentHidden", "ui", "posterSecondFrame", "agentLayoutIdeas", "crafterPlainThumbnails"} and (k not in ("claude", "keys", "defaultFonts") or isinstance(v, dict))}
allowed = {k: v for k, v in patch.items() if k in {"agentsAllowed", "agentsBlocked", "author", "defaultTemplate", "autosave", "units", "recent", "lastTemplate", "dictionary", "proofingLanguage", "chat", "captions", "stock", "aiImages", "addins", "claude", "codexBin", "cursorBin", "antigravityBin", "keys", "defaultSize", "defaultFonts", "marquee", "pinned", "recentHidden", "ui", "posterSecondFrame", "agentLayoutIdeas", "crafterPlainThumbnails"} and (k not in ("claude", "keys", "defaultFonts") or isinstance(v, dict))}
for key in ("pinned", "recentHidden"):
if key in allowed:
allowed[key] = [str(i)[:80] for i in allowed[key] if isinstance(i, str)][:500] if isinstance(allowed[key], list) else []
Expand All @@ -97,4 +97,7 @@ def set_settings(patch: dict, request: Request) -> dict:
allowed["keys"] = {str(cid)[:120]: [str(k)[:40] for k in combos][:4] for cid, combos in list(allowed["keys"].items())[:2000] if isinstance(combos, list)}
if "claude" in allowed:
allowed["claude"] = {f: str(allowed["claude"].get(f) or "").strip()[:4000] for f in ("bin", "folder", "firstMessage")}
for key in ("codexBin", "cursorBin", "antigravityBin"):
if key in allowed:
allowed[key] = str(allowed[key] or "").strip()[:4000] if isinstance(allowed[key], str) else ""
return config.write_settings(allowed)
9 changes: 8 additions & 1 deletion backend/app/services/claude_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

KEEP_ENV = agent_lookup.KEEP_ENV
OVERRIDES = {"claude": ("FORMDECK_CLAUDE_BIN",), "codex": ("FORMDECK_CODEX_BIN",), "cursor": ("FORMDECK_CURSOR_BIN",), "antigravity": ("FORMDECK_ANTIGRAVITY_BIN",)}
SETTINGS = {"codex": "codexBin", "cursor": "cursorBin", "antigravity": "antigravityBin"}
OTHERWISE = "give its path in Preferences"
SHELL_WAIT = 10.0
CHECK_WAIT = 15.0
Expand Down Expand Up @@ -41,7 +42,13 @@ def _pref(key: str) -> str:


def setting(kind: str) -> str | None:
return _pref("bin") if kind == "claude" else None
if kind == "claude":
return _pref("bin")
key = SETTINGS.get(kind)
if key is None:
return None
value = config.read_settings().get(key)
return value.strip() if isinstance(value, str) else ""


def otherwise(kind: str) -> str:
Expand Down
43 changes: 43 additions & 0 deletions backend/tests/test_seal.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,46 @@ def get_password(self, service, account):
assert config.read_settings()["seal"] == "unavailable"
finally:
seal.reset()


def test_a_choice_sealed_by_0_43_0_reads_whole_after_the_update(keychain):
import hashlib
import hmac

from app.core import config, seal
from app.services import claude_code

key = seal._load(True)
old = {"agentsAllowed": True, "claude": {"bin": "/opt/tools/claude", "folder": "", "firstMessage": ""}, "agentsBlocked": False}
body = json.dumps({"agentsAllowed": True, "claudeBin": "/opt/tools/claude"}, sort_keys=True, separators=(",", ":"), ensure_ascii=False)
config.settings_path().write_text(json.dumps({**old, "seal": hmac.new(key, body.encode("utf-8"), hashlib.sha256).hexdigest()}, indent=2), encoding="utf-8")
now = config.read_settings()
assert now["seal"] == "ok" and now["sealBroken"] is False
assert now["agentsAllowed"] is True and now["claude"]["bin"] == "/opt/tools/claude"
assert not any(now.get(k) for k in ("codexBin", "cursorBin", "antigravityBin"))
assert claude_code.setting("claude") == "/opt/tools/claude" and claude_code.setting("codex") == ""
config.write_settings({"author": "someone"})
assert config.read_settings()["seal"] == "ok"
config.write_settings({"codexBin": "/opt/tools/codex"})
now = config.read_settings()
assert now["seal"] == "ok" and now["agentsAllowed"] is True and now["claude"]["bin"] == "/opt/tools/claude" and now["codexBin"] == "/opt/tools/codex"


@pytest.mark.parametrize("key,kind", [("codexBin", "codex"), ("cursorBin", "cursor"), ("antigravityBin", "antigravity")])
def test_the_other_programs_places_are_sealed_and_given_to_the_finder_first(keychain, client, tmp_path, key, kind):
from app.core import config
from app.services import agent_lookup, claude_code

program = tmp_path / kind
program.write_text("#!/bin/sh\n")
program.chmod(0o755)
r = client.post("/api/settings", json={key: f" {program} "})
assert r.status_code == 200 and r.json()["seal"] == "ok" and r.json()[key] == str(program)
assert claude_code.setting(kind) == str(program)
found = agent_lookup.find(kind, setting=claude_code.setting(kind), fresh=True)
assert found.path == str(program) and found.how == "setting"
assert client.post("/api/settings", json={key: ["not", "a", "path"]}).json()[key] == ""
config.write_settings({"agentsAllowed": True, key: str(program)})
hand_edit(**{key: "/tmp/other-program"})
now = config.read_settings()
assert now["sealBroken"] is True and now[key] == "" and now["agentsAllowed"] is False
2 changes: 1 addition & 1 deletion backend/tests/test_startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def test_a_holder_that_has_ended_but_was_not_collected_counts_as_gone_where_ther
assert replaced == engine.pid
assert startup.alive(engine.pid) and startup.finished(engine.pid)
assert json.loads(path.read_text())["pid"] == os.getpid()
monkeypatch.setattr(startup, "PROC", "/proc")
monkeypatch.setattr(startup, "PROC", str(tmp_path))
assert startup.finished(engine.pid) is False
finally:
stop(engine, shell, mine)
Expand Down
12 changes: 12 additions & 0 deletions frontend/HASHOUT_LOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -1347,3 +1347,15 @@ Checked: `tsc --noEmit` clean. Not looked at in a browser, with or without a sta
Every file of `src/dock/` was copied unchanged from FormVis at 23b01889; three differ from 2.2.0: `MANIFEST.json` (the version and two hashes), `CONTRACT.md` (its version line and the 2.2.1 note) and `strings.ts`, where the guide's two sentences for a computer that has Claude Code (`tourInstalledBody`, `tourReadyBody`) now end: "Codex, Cursor and Antigravity each get a button of their own here when they are on this computer." formdeck's adapter needs no change, and formdeck carries no translations of the module's sentences, so there is nothing to translate again.

Checked: the `tsc --noEmit` and `vite build` of the gate. Not looked at in a browser.

## 223. Every sentence that names the agent programs names all four · _v0.44.0 (editor/inspector.ts; ui/home.ts; ui/chat-panel.ts; ui/dialogs-file.ts; automation/command-meta.ts; i18n keys parts 01, 03, 06, 07, 08 and every locale)

Ten sentences a person can see named Claude Code, Codex and Cursor only, though formdeck connects Antigravity the same way (the dock has its tab since entry 221, and `./formdeck agents install` writes its config): the inspector's note on agents, the Home list item, the agents command's help, the chat panel's first step, its empty line and its connected note, the start-from-material dialog's first step, the Plugins switch in Preferences, the install note in the agent setup dialog, and the About dialog's quick start. Each now names Claude Code, Codex, Cursor and Antigravity, in that order. The command help said "Claude" alone and now says "Claude Code" like the rest.

Nine of them are lookup keys of the language tables; the key and its entry in all 25 tables were changed together, one edit each, so a table never falls back to English for them. Each language keeps its own list form (the comma before the last item or not, `、` in Japanese and Chinese) and its own case endings for the names (Czech, Finnish, Hungarian, Turkish, Portuguese articles). No native speaker has read the new wording. The About dialog's sentence had no key before and has none now; it shows in English in every language, as it did.

Checked: every table still parses and has as many entries as before; in each of the 26 files per sentence the entry names Antigravity once; `python3 setup/i18n_tool.py check` gives the same 171 lines before and after (strings in the code that have no key yet, none of them these).

## 224. Preferences has a place for Codex, Cursor and Antigravity · _v0.45.0 (ui/dialogs-file.ts PreferencesDialog programFields; i18n keys part42 and every locale)

Preferences, Plugins had a Program field for Claude Code only. A group "Other Agent Programs" now follows the Claude Code group, with a field for Codex, Cursor and Antigravity in that order, each empty unless a path is given (the finder then looks for the program itself). A change is saved at once to `codexBin`, `cursorBin` or `antigravityBin`, which the engine seals with the agent choice (backend entry 148); the fields are filled from the settings when Preferences opens. The labels are the programs' names and are marked not to be translated; the group's name and the one placeholder are a new key part (42) with an entry in all 25 tables. No native speaker has read them.
4 changes: 2 additions & 2 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "formdeck",
"private": true,
"version": "0.43.0",
"version": "0.45.0",
"description": "formdeck · presentations and decks in the form family",
"license": "Apache-2.0",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/automation/command-meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ const ROWS: Record<string, Row> = {
'review-changes': ['Use when a slide needs changes before approval.'],
'review-draft': ['Use when a slide goes back to draft.'],
'intake': ['Use when you want a first draft built from your own files and notes.', 'v'],
'agents': ['Use when you want to connect Claude, Codex or Cursor to formdeck, or allow agents to edit.', 'v'],
'agents': ['Use when you want to connect Claude Code, Codex, Cursor or Antigravity to formdeck, or allow agents to edit.', 'v'],
'present-start': ['Use when you want to present from the first slide.', 'v'],
'present-current': ['Use when you want to present from the slide you are on.', 'v'],
'presenter-view': ['Use when you want notes, a timer and the next slide while you present.', 'v'],
Expand Down
Loading
Loading