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
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# FormRef changelog

## v0.45.0 · 2026-11-20

You can tell FormRef where Codex, Cursor and Antigravity are, the way you already could for Claude Code.

- The Agent settings have a program field for Codex, Cursor and Antigravity under the Claude Code one. A path you give there is the first place FormRef looks for that program; left empty, FormRef finds the program on its own as before. The labels are in every language.
- These paths are kept with the same protection as the Claude Code path and the outside-agents switch: only the FormRef window can change them, and if the settings file is changed by hand, all four paths are ignored and outside agents are turned off until you set them again in the window.
- Updating from 0.44.0 keeps your outside-agents choice and your Claude Code path as they were.
- When Codex, Cursor or Antigravity is not found, the message now also says you can give its path in the Agent panel.
- On macOS, the app's two keyboard shortcuts are set up once; nothing changes in how they work.

## v0.44.0 · 2026-11-20

The app's own part of the Windows start and stop work: the engine ends with the app however the app ends, and a start that fails says why on every system before the app closes.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</p>

<p align="center">
<img alt="version 0.44.0" src="https://img.shields.io/badge/version-v0.44.0-eef0f4?style=flat-square">
<img alt="version 0.45.0" src="https://img.shields.io/badge/version-v0.45.0-eef0f4?style=flat-square">
<img alt="Rust engine" src="https://img.shields.io/badge/Rust%20engine-b7410e?style=flat-square&logo=rust&logoColor=white">
<img alt="TypeScript and FastAPI" src="https://img.shields.io/badge/TypeScript%20%2B%20FastAPI-3178c6?style=flat-square&logo=typescript&logoColor=white">
<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">
Expand Down
10 changes: 10 additions & 0 deletions backend/HASHOUT_LOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,16 @@ Run here on Linux with `PROC` pointed at a folder that does not exist: the new t

The owner's decision for the family: a Windows engine is packaged with no console window, as FormWeb's is. `freeze_engine.bat` gives PyInstaller `--noconsole` unless `FORMREF_ENGINE_WINDOWED=0`. The entry already replaces missing streams (the guard at its top), so the engine and `--selfcheck` run with no console. A window program's words reach no console, so the script sends the self-check's output to `build\selfcheck.txt`, types it and stops on its exit code. `freeze_engine` builds on Linux and macOS only and is unchanged. Checked by reading; no Windows build has shown it.

## After v0.44.0 · A stored path for Codex, Cursor and Antigravity, sealed like Claude Code's

- refers-to: `app/core/seal.py` :: `PATHS`, `LATER`, `SEALED`, `digest`, `loosened`, `effective`; `app/agent/service.py` :: `DEFAULTS`, `Agents.save`; `app/agent/claude_code.py` :: `SETTINGS`, `OTHERWISE`; `tests/test_seal.py`; `tests/test_agent_programs.py`; `tests/test_agent_guards.py`

The Agent panel kept a path for Claude Code (`claude_bin`) that the finder tries first, under the settings seal and written only by the window. Codex, Cursor and Antigravity now have the same: `codex_bin`, `cursor_bin` and `antigravity_bin` in `agent.json`, in `SEALED`, refused to an outside agent like every agent setting, and handed to `agent_lookup.find` as the setting for their program. A hand edit of any of them reads as all four paths empty, outside agents off and `seal_broken`. Their sentence when not found now ends "or give its path in the Agent panel", as Claude Code's did.

The update from 0.44.0 was proved before the change was built on, with real files: 0.44.0's backend (7bbf5f2, a scratch copy) wrote `agent.json` with outside agents on and a Claude Code path, its seal made with a key kept in a file-backed stand-in keyring; this backend then read the same folder with the same key: `seal` `ok`, outside agents on, the Claude Code path kept and given to the finder, the three new paths empty; a later write of the first message and then of a Codex path signed again with all of it kept. No migration is needed because `digest` leaves a new path out of the sealed text while it is empty (`LATER`), so a file sealed over `outside_agents` and `claude_bin` alone still matches. Going back to 0.44.0 after a new path was set reads as a broken seal (outside agents off): the safe direction. `test_a_choice_sealed_by_0_44_0_stays_whole_and_keeps_the_claude_code_path` writes a file of 0.44.0's shape with 0.44.0's formula and checks the same.

Tests changed for the new behaviour, not loosened: the missing-program test now expects every program's sentence to name the Agent panel, the found-program test expects Codex's `looked` to start with "your setting (empty)", and the guard test also sends the three new paths from an outside agent (403 each).

## v0.39.2 · PDF export and SVG pictures without a system library, and six smaller fixes

- refers-to: `app/core/pdf_draw.py` (new) :: render, svg_page, Fonts, serialized; `app/core/exports.py` :: pdf_export, png_export, svg_export; `app/core/doc_export.py` :: pdf; `app/core/media.py` :: svg_png; `app/core/pdf_pages.py` :: page_items, pdf_text; `app/core/endpoints.py` :: route, heads, path_data, polyline; `app/agent/runners.py` :: places, find; `app/agent/service.py` :: available; `app/core/templates.py` :: save_template; `app/routers/demos.py` (new) :: open_demo; `formref_engine.py` :: sweep_stale_unpacks; `freeze_engine`, `freeze_engine.bat`; `requirements.txt`, `requirements_macos.txt`
Expand Down
4 changes: 2 additions & 2 deletions backend/app/agent/claude_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
from .service import agents

OVERRIDES = {"claude": ("FORMREF_CLAUDE_BIN",), "codex": ("FORMREF_CODEX_BIN",), "cursor": ("FORMREF_CURSOR_BIN",), "antigravity": ("FORMREF_ANTIGRAVITY_BIN",)}
SETTINGS = {"claude": "claude_bin"}
OTHERWISE = {"claude": "give its path in the Agent panel"}
SETTINGS = {"claude": "claude_bin", "codex": "codex_bin", "cursor": "cursor_bin", "antigravity": "antigravity_bin"}
OTHERWISE = {kind: "give its path in the Agent panel" for kind in SETTINGS}
NOTE =("You are Claude Code running in the terminal dock inside FormRef, the reference board app open on this computer. "
"Work on boards with the formref_tab MCP server's tools: start with list_boards or get_board to learn ids, "
"and use get_board_image to look at the board before and after a change. They act on the board open in the window, "
Expand Down
4 changes: 2 additions & 2 deletions backend/app/agent/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from . import agent_lookup, runners

API_URL = os.environ.get("FORMREF_API_URL", "http://127.0.0.1:8320").rstrip("/")
DEFAULTS = {"runner": "claude", "ollama_url": "http://127.0.0.1:11434", "ollama_model": "", "outside_agents": False, "model": "", "confirm_changes": True, "claude_folder": "", "claude_bin": "", "claude_first_message": ""}
DEFAULTS = {"runner": "claude", "ollama_url": "http://127.0.0.1:11434", "ollama_model": "", "outside_agents": False, "model": "", "confirm_changes": True, "claude_folder": "", "claude_bin": "", "claude_first_message": "", "codex_bin": "", "cursor_bin": "", "antigravity_bin": ""}
MAX_STEPS = 12
SNAPSHOT_KEYS = ("items", "connections", "settings", "title", "background")
BULK = 10
Expand Down Expand Up @@ -129,7 +129,7 @@ def save(self, patch: dict) -> dict:
raise ValueError(f"{key} must be true or false.")
if key == "runner" and value not in ("claude", "codex", "cursor", "ollama"):
raise ValueError("runner must be claude, codex, cursor or ollama.")
if key in ("ollama_url", "ollama_model", "model", "claude_folder", "claude_bin", "claude_first_message") and not isinstance(value, str):
if key in ("ollama_url", "ollama_model", "model", "claude_folder", "claude_first_message") + seal.PATHS and not isinstance(value, str):
raise ValueError(f"{key} must be text.")
if key == "ollama_url" and not loopback_url(value):
raise ValueError("ollama_url must be a loopback address.")
Expand Down
2 changes: 1 addition & 1 deletion backend/app/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from pathlib import Path

ROOT = Path(getattr(sys, "_MEIPASS", "")).resolve() if getattr(sys, "frozen", False) else Path(__file__).resolve().parents[3]
VERSION = "0.44.0"
VERSION = "0.45.0"

@dataclass(frozen=True)
class Settings:
Expand Down
10 changes: 6 additions & 4 deletions backend/app/core/seal.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
SERVICE = "FormRef"
ACCOUNT = "settings-seal"
FIELD = "seal"
SEALED = ("outside_agents", "claude_bin")
PATHS = ("claude_bin", "codex_bin", "cursor_bin", "antigravity_bin")
LATER = ("codex_bin", "cursor_bin", "antigravity_bin")
SEALED = ("outside_agents",) + PATHS
_CACHE: dict = {"tried": False, "available": False, "key": None}


Expand Down Expand Up @@ -39,12 +41,12 @@ def available() -> bool:


def digest(values: dict, key: bytes) -> str:
body = json.dumps({k: values.get(k) for k in SEALED}, sort_keys=True, separators=(",", ":"), ensure_ascii=False)
body = json.dumps({k: values.get(k) for k in SEALED if k not in LATER or values.get(k)}, sort_keys=True, separators=(",", ":"), ensure_ascii=False)
return hmac.new(key, body.encode("utf-8"), hashlib.sha256).hexdigest()


def loosened(values: dict) -> bool:
return values.get("outside_agents") is True or bool(str(values.get("claude_bin") or "").strip())
return values.get("outside_agents") is True or any(str(values.get(k) or "").strip() for k in PATHS)


def effective(stored: dict) -> dict:
Expand All @@ -57,7 +59,7 @@ def effective(stored: dict) -> dict:
return {**out, "seal": "ok", "seal_broken": False}
if not loosened(stored):
return {**out, "seal": "unsealed", "seal_broken": False}
out.update(outside_agents=False, claude_bin="")
out.update(outside_agents=False, **{k: "" for k in PATHS})
return {**out, "seal": "broken", "seal_broken": True}


Expand Down
2 changes: 1 addition & 1 deletion backend/tests/test_agent_guards.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def test_a_hand_edited_ollama_address_is_not_used(client, reset_agents):

def test_an_outside_agent_cannot_change_any_agent_setting(client, bare, reset_agents):
client.post("/api/agent/settings", json={"outside_agents": True})
for patch in ({"confirm_changes": False}, {"outside_agents": False}, {"claude_bin": "/tmp/x"}, {"runner": "ollama"}):
for patch in ({"confirm_changes": False}, {"outside_agents": False}, {"claude_bin": "/tmp/x"}, {"codex_bin": "/tmp/x"}, {"cursor_bin": "/tmp/x"}, {"antigravity_bin": "/tmp/x"}, {"runner": "ollama"}):
r = bare.post("/api/agent/settings", json=patch, headers={"x-formref-client": "outside"})
assert r.status_code == 403, patch
shown = client.get("/api/agent/settings").json()
Expand Down
6 changes: 3 additions & 3 deletions backend/tests/test_agent_programs.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ def test_the_status_names_each_missing_program_with_its_install_line(client, not
assert found[kind]["install"] and "\n" not in found[kind]["install"]
assert found[kind]["finding"] == "missing" and found[kind]["how"] == "" and len(found[kind]["looked"]) >= 3
assert found[kind]["said"].startswith(f"{found[kind]['title']} was not found. Looked in: ") and found[kind]["install"] in found[kind]["said"]
assert found["claude"]["looked"][0] == "your setting (empty)" and found["claude"]["said"].endswith(", or give its path in the Agent panel.")
assert "your setting" not in found["codex"]["said"] and "Agent panel" not in found["codex"]["said"]
for kind in found:
assert found[kind]["looked"][0] == "your setting (empty)" and found[kind]["said"].endswith(", or give its path in the Agent panel."), kind


@pytest.mark.skipif(os.name == "nt", reason="the stand-ins are shell scripts")
def test_the_status_finds_each_program_with_its_version(client, stand_ins):
found = client.get("/api/agent/status?fresh=1").json()
assert found["codex"] == {"installed": True, "path": str(stand_ins / "codex"), "version": "0.99.1", "finding": "runs", "how": "path", "looked": [], "error": "",
assert found["codex"] == {"installed": True, "path": str(stand_ins / "codex"), "version": "0.99.1", "finding": "runs", "how": "path", "looked": ["your setting (empty)"], "error": "",
"said": f"Codex is at {stand_ins / 'codex'} (the engine's PATH).", "signedIn": None, "install": found["codex"]["install"], "title": "Codex"}
assert found["cursor"]["path"] == str(stand_ins / "cursor-agent") and found["cursor"]["version"] == "0.99.1"
assert found["antigravity"]["path"] == str(stand_ins / "agy") and found["antigravity"]["finding"] == "runs" and found["antigravity"]["signedIn"] is None
Expand Down
45 changes: 45 additions & 0 deletions backend/tests/test_seal.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,51 @@ def test_a_hand_edit_of_the_stored_choice_is_caught(client, keychain):
assert shown["seal"] == "broken" and shown["seal_broken"] is True


@pytest.mark.parametrize("key", ["codex_bin", "cursor_bin", "antigravity_bin"])
def test_the_other_programs_paths_are_sealed_given_to_the_finder_first_and_a_hand_edit_is_caught(client, keychain, tmp_path, key):
from app.agent import claude_code

kind = key.removesuffix("_bin")
program = tmp_path / kind
program.write_text("#!/bin/sh\n")
program.chmod(0o755)
r = client.post("/api/agent/settings", json={key: str(program)}, headers=window_headers())
assert r.json()["seal"] == "ok" and r.json()[key] == str(program)
assert claude_code.setting(kind) == str(program)
found = claude_code.located(kind, fresh=True)
assert found.path == str(program) and found.how == "setting"
_hand_edit(**{key: "/tmp/not-" + kind})
shown = client.get("/api/agent/settings").json()
assert shown[key] == "" and shown["claude_bin"] == "" and shown["seal"] == "broken"
assert claude_code.setting(kind) == ""


def test_a_choice_sealed_by_0_44_0_stays_whole_and_keeps_the_claude_code_path(client, keychain, tmp_path):
import hashlib
import hmac

from app.agent import claude_code
from app.agent.service import agents
from app.core import seal

program = tmp_path / "claude"
program.write_text("#!/bin/sh\n")
program.chmod(0o755)
key = seal._load(True)
old = {"runner": "claude", "ollama_url": "http://127.0.0.1:11434", "ollama_model": "", "outside_agents": True, "model": "", "confirm_changes": True, "claude_folder": "", "claude_bin": str(program), "claude_first_message": ""}
body = json.dumps({k: old[k] for k in ("outside_agents", "claude_bin")}, sort_keys=True, separators=(",", ":"), ensure_ascii=False)
agents.path.parent.mkdir(parents=True, exist_ok=True)
agents.path.write_text(json.dumps({**old, "seal": hmac.new(key, body.encode("utf-8"), hashlib.sha256).hexdigest()}, indent=1), encoding="utf-8")
shown = client.get("/api/agent/settings").json()
assert shown["seal"] == "ok" and shown["seal_broken"] is False
assert shown["outside_agents"] is True and shown["claude_bin"] == str(program) and claude_code.setting("claude") == str(program)
assert [shown[k] for k in ("codex_bin", "cursor_bin", "antigravity_bin")] == ["", "", ""]
client.post("/api/agent/settings", json={"claude_first_message": "hello"})
client.post("/api/agent/settings", json={"codex_bin": str(program)})
shown = client.get("/api/agent/settings").json()
assert shown["seal"] == "ok" and shown["outside_agents"] is True and shown["claude_bin"] == str(program) and shown["codex_bin"] == str(program)


def test_the_window_can_confirm_after_a_broken_seal(client, keychain):
client.post("/api/agent/settings", json={"outside_agents": False})
_hand_edit(outside_agents=True)
Expand Down
2 changes: 1 addition & 1 deletion clipper/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "FormRef Clipper",
"version": "0.44.0",
"version": "0.45.0",
"description": "Save images, selected text, links and pages to the FormRef board running on your computer.",
"author": "nodemode-ai",
"icons": { "16": "icons/icon-16.png", "32": "icons/icon-32.png", "48": "icons/icon-48.png", "128": "icons/icon-128.png" },
Expand Down
9 changes: 9 additions & 0 deletions frontend/HASHOUT_LOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- [Unreleased · Two engine messages in every table](#unreleased--two-engine-messages-in-every-table)
- [Unreleased · The terminal panel is the family's shared dock, module 2.1.0](#unreleased--the-terminal-panel-is-the-familys-shared-dock-module-210)
- [Unreleased · The outside-agents switch names all four programs](#unreleased--the-outside-agents-switch-names-all-four-programs)
- [After v0.44.0 · A program field for Codex, Cursor and Antigravity](#after-v0440--a-program-field-for-codex-cursor-and-antigravity)
- [Unreleased · The shared dock at module 2.2.1](#unreleased--the-shared-dock-at-module-221)
- [After v0.41.0 · The shared dock at module 2.2.0, and Antigravity as the fourth agent tab](#after-v0410--the-shared-dock-at-module-220-and-antigravity-as-the-fourth-agent-tab)
- [v0.39.2 · Connections, text cards, the tag cloud, tabs, Preferences at 390 px, the demo's first open and 59 untranslated strings](#v0392--connections-text-cards-the-tag-cloud-tabs-preferences-at-390-px-the-demos-first-open-and-59-untranslated-strings)
Expand Down Expand Up @@ -157,6 +158,14 @@ Seen in headless Chrome at 1440 by 900 against an engine from source with stand-

The one sentence in the window that lists the agent programs, the outside-agents switch in the Agent settings, now reads "Claude Code, Codex, Cursor, Antigravity or any MCP client". It is the lookup key of the tables, so the key and its 23 translations changed together, each with Antigravity put after Cursor in that table's own list form (a comma, or 、 in Japanese and Chinese). No native speaker has read them. The tables also hold "An AI agent connected to FormRef from outside the app (such as Claude Code, Codex or Cursor)...", but no code shows it (it is one of the 40 unused keys `i18n_check.py` reports), so it was left as it was. `i18n_check.py --strict` exits 0 before and after, missing 0 and unused 40 in every complete table.

## After v0.44.0 · A program field for Codex, Cursor and Antigravity

- refers-to: `index.html` :: `#agent-codex-bin`, `#agent-cursor-bin`, `#agent-antigravity-bin`; `src/ui/panels/agent.ts` :: `AgentSettings`, `claudeFields`; `src/lib/i18n/tables/*.json` (the 23 complete tables, six keys)
- kind: rationale
- logged: v0.45.0 · 2026-11-20

The Agent settings show a program field for Codex, Cursor and Antigravity under the Claude Code one, each saved on change like it and read back the same way (they join `claudeFields`, so no new handler). The engine keeps them under the same seal as the Claude Code path and gives each to the finder first (`../backend/HASHOUT_LOG.md`, "A stored path for Codex, Cursor and Antigravity"). The placeholders name the file the finder looks for first: `codex`, `cursor-agent`, `agy`. Six keys in the 23 complete tables, modelled on each table's Claude Code field; es-MX and fr-CA are partial tables and fall back to English as they do for the Claude Code label. No native speaker has read them. `i18n_check.py --strict` exits 0, missing 0 and unused 40 in every complete table, as before.

## Unreleased · The shared dock at module 2.2.1

- refers-to: `src/dock/` (every file copied unchanged from formvis commit 23b01889); ../backend/tests/test_dock_manifest.py; ../NOTICE.md
Expand Down
Loading
Loading