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: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

Every release of FormDesign, newest first. Versions follow semver; tags read `v*.*.*`.

## 0.92.0 · 2026-11-20

- Preferences > Agents has a field for where Codex, Cursor and Antigravity are, beside the one for Claude Code. FormDesign looks there first when it starts the program, and the path is kept with the agent choices, which only the app window can change. A path changed by hand outside the app is not used.
- Your agent choices and the Claude Code path you set in an earlier version stay as they were after the update.
- The three browser demos are rebuilt with this version.

## 0.91.0 · 2026-11-20

- On Windows the desktop app's engine ends with the app however the app ends, and it opens no console window of its own. To see the engine in a console window, build it with `FORMDESIGN_ENGINE_WINDOWED=0`.
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.91.0" src="https://img.shields.io/badge/version-0.91.0-eef0f4?style=flat-square">
<img alt="version 0.92.0" src="https://img.shields.io/badge/version-0.92.0-eef0f4?style=flat-square">
<img alt="Rust" src="https://img.shields.io/badge/rust-layout%20core-B7410E?style=flat-square&logo=rust&logoColor=white">
<img alt="TypeScript and Python" src="https://img.shields.io/badge/typescript%20%2B%20python-engine%20and%20window-3178c6?style=flat-square">
<img alt="macOS, Windows and Linux" src="https://img.shields.io/badge/macOS%20%C2%B7%20Windows%20%C2%B7%20Linux-native-2f7bf5?style=flat-square">
Expand Down
11 changes: 9 additions & 2 deletions backend/HASHOUT_LOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

Living log for the engine service. Source files stay comment-free; what they would have said lives here, indexed. Read it before editing `backend/`.

Current build version: v0.91.0
Last updated: 2026-11-20 · the Windows engine is frozen with no console window · a leftover engine that has ended but was not collected counts as gone on macOS; 2026-11-19 · the desktop engine keeps a log, holds a lock on its data folder, leaves when its app has gone and serves nothing when started alone · the family's finder 1.0.1 for the four agent programs · an Antigravity tab and agents install antigravity · the tests find only stand-in agent programs · the engine starts with no output streams · only the app window can change what agents may do, open a terminal or answer an approval; the stored agent choices are sealed; the command line is an agent like any other; agents/manifest.json says what the app offers agents; the use_tool description says 41 layout tools; the engine side of the shared dock's contract; 2026-11-13 · no engine change in 0.87.0 (version string only; the demo covers and browser demo pages are in the frontend log); a recent document's first-page thumbnail; three demos built on demand by Make; counts --check fails if a sparkle icon returns; the desktop extension, attach mode and the plugin manifest; 2026-11-11 · engine commands run in the active document; Save to a folder that cannot be made answers 422; a tools/call name that is not a string gets a JSON-RPC error; PNG and JPEG export count pages from 1; the in-app token reaches Claude Code in a private file; 2026-11-10 · Claude chat keeps only the screenshots its messages still show; Claude chat history is found under a non-ASCII agent folder; a prompt that starts with "-" reaches Claude Code as a prompt; text with a non-ASCII style name is placed; bad input to open, pack edits, make, tabs and media answers 4xx; LibreOffice gets a well-formed profile URL; links found in contact and footer text keep their query strings; fixed-layout EPUB marks every animated page as scripted; images from different sources with the same name stay distinct; book operations run one at a time; malformed agent, plug-in, package and book input gets an error message; Edit Original opens only image, vector and PDF files; counts --check reads only the MCP tool count; Windows Node check and install --lite; clean.bat --all removes each folder on its own; build_frontend.bat restores its caller's folder; agents install codex writes valid TOML on Windows; the MCP stdio bridge runs under Python 3.9; every window socket request gets an answer; a Claude Code launch is quoted for the login shell that runs it; a failed thumbnail leaves no document open; a video's poster file is used only when it is a real image; only the window installs, enables and removes plug-ins; PDF, DXF and PDF comment imports run off the event loop; one-column CSV files are read; a bad or empty zip becomes an intake warning; a wrong-shaped template spec answers problems; phone photos are measured and placed upright; a long paste reaches the terminal whole; intake and PDF reading by agents no longer freeze the engine; review comments posted at the same time all stay; a failing tool or a malformed MCP request gets a JSON-RPC answer; names without Latin letters get their own file; downloads with non-Latin names arrive; an engine on a fallback port tells everyone its real port; non-Latin names save on Windows; save_document asks before overwriting the file it will really write; an uploaded file name cannot leave the pack folder; a website export never deletes files it did not write; published sites and placed assets run sandboxed; a plug-in's fetch checks every redirect hop; document text stays inside a published page's JSON-LD block; run_commands asks for approval wherever run_command does; a template is saved only inside the template library; only the in-app token makes a client the in-app Claude Code; 2026-10-31 · .js, .mjs and .css keep their types on Windows; formdesign-core links the C runtime statically on Windows; 2026-10-30 · the Windows desktop build stops on a failed bundle step; 2026-10-26 · fixes the test suite found (FB-045 to FB-049); 2026-10-25 · LocalGuard; 2026-10-23 · full fonts for the Reserved Font Name families; the ICC profile in the frozen engine
Current build version: v0.92.0
Last updated: 2026-11-20 · a stored path for Codex, Cursor and Antigravity under the agents seal · the Windows engine is frozen with no console window · a leftover engine that has ended but was not collected counts as gone on macOS; 2026-11-19 · the desktop engine keeps a log, holds a lock on its data folder, leaves when its app has gone and serves nothing when started alone · the family's finder 1.0.1 for the four agent programs · an Antigravity tab and agents install antigravity · the tests find only stand-in agent programs · the engine starts with no output streams · only the app window can change what agents may do, open a terminal or answer an approval; the stored agent choices are sealed; the command line is an agent like any other; agents/manifest.json says what the app offers agents; the use_tool description says 41 layout tools; the engine side of the shared dock's contract; 2026-11-13 · no engine change in 0.87.0 (version string only; the demo covers and browser demo pages are in the frontend log); a recent document's first-page thumbnail; three demos built on demand by Make; counts --check fails if a sparkle icon returns; the desktop extension, attach mode and the plugin manifest; 2026-11-11 · engine commands run in the active document; Save to a folder that cannot be made answers 422; a tools/call name that is not a string gets a JSON-RPC error; PNG and JPEG export count pages from 1; the in-app token reaches Claude Code in a private file; 2026-11-10 · Claude chat keeps only the screenshots its messages still show; Claude chat history is found under a non-ASCII agent folder; a prompt that starts with "-" reaches Claude Code as a prompt; text with a non-ASCII style name is placed; bad input to open, pack edits, make, tabs and media answers 4xx; LibreOffice gets a well-formed profile URL; links found in contact and footer text keep their query strings; fixed-layout EPUB marks every animated page as scripted; images from different sources with the same name stay distinct; book operations run one at a time; malformed agent, plug-in, package and book input gets an error message; Edit Original opens only image, vector and PDF files; counts --check reads only the MCP tool count; Windows Node check and install --lite; clean.bat --all removes each folder on its own; build_frontend.bat restores its caller's folder; agents install codex writes valid TOML on Windows; the MCP stdio bridge runs under Python 3.9; every window socket request gets an answer; a Claude Code launch is quoted for the login shell that runs it; a failed thumbnail leaves no document open; a video's poster file is used only when it is a real image; only the window installs, enables and removes plug-ins; PDF, DXF and PDF comment imports run off the event loop; one-column CSV files are read; a bad or empty zip becomes an intake warning; a wrong-shaped template spec answers problems; phone photos are measured and placed upright; a long paste reaches the terminal whole; intake and PDF reading by agents no longer freeze the engine; review comments posted at the same time all stay; a failing tool or a malformed MCP request gets a JSON-RPC answer; names without Latin letters get their own file; downloads with non-Latin names arrive; an engine on a fallback port tells everyone its real port; non-Latin names save on Windows; save_document asks before overwriting the file it will really write; an uploaded file name cannot leave the pack folder; a website export never deletes files it did not write; published sites and placed assets run sandboxed; a plug-in's fetch checks every redirect hop; document text stays inside a published page's JSON-LD block; run_commands asks for approval wherever run_command does; a template is saved only inside the template library; only the in-app token makes a client the in-app Claude Code; 2026-10-31 · .js, .mjs and .css keep their types on Windows; formdesign-core links the C runtime statically on Windows; 2026-10-30 · the Windows desktop build stops on a failed bundle step; 2026-10-26 · fixes the test suite found (FB-045 to FB-049); 2026-10-25 · LocalGuard; 2026-10-23 · full fonts for the Reserved Font Name families; the ICC profile in the frozen engine

---

Expand Down Expand Up @@ -1137,3 +1137,10 @@ The family bans the sparkle icon. `sparkle_problems` reads the tracked window, e
- logged: v0.86.0 · 2026-11-13

`./formdesign mcpb check|build DIR` checks the manifest and builds `formdesign-VERSION.mcpb` with the version read from `frontend/src/version.ts`; the `0.0.0` in `setup/mcpb/manifest.json` is a placeholder and is not a version site. The extension runs `mcp_stdio.py --attach`, which never starts the engine: while the engine is down it answers `initialize` with a single ping tool, and it sends `notifications/tools/list_changed` once the engine answers. `.claude-plugin/plugin.json` names the MCP server and the two use skills, and `agents sync` mirrors the skillset skill to `.agents/skills`. `.claude/settings.json` carries the family attribution block (empty commit and pr text, no session link) so Claude Code adds no attribution lines in this repo.

### app/services/agents.py, app/services/claude_code.py · a stored path for Codex, Cursor and Antigravity under the agents seal
- refers-to: app/services/agents.py :: PATHS, LATER, _sealed, choice, commit; app/services/claude_code.py :: PATHS, FIELDS, write_bins, prefs, save_prefs, setting; tests/test_seal.py
- kind: rationale
- logged: v0.92.0 · 2026-11-20

`claudeBin` was part of the sealed agent choice (`agents.json` holds the seal, `claude.json` the path). `codexBin`, `cursorBin` and `antigravityBin` now sit beside it in `claude.json`, under the same seal, written only through `/claude/prefs` (the window's guard), and `setting(kind)` hands each to the finder by the finder's own `setting` name, so the stored path is the first place looked. `_sealed` leaves the three new paths out of the sealed body while they are empty, so a choice sealed by 0.91.0 (body `enabled`, `policies`, `claudeBin`) reads as `ok` after the update with no migration. Proved before the change: 0.91.0's backend, in a scratch copy, wrote `agents.json` and `claude.json` with Codex allowed and a Claude Code path, through a file-backed stand-in keychain; this code read them as `ok`, kept the policy and the path, gave the path to the finder, left the three new paths empty, and stayed `ok` through two window writes. `test_a_choice_sealed_by_0_91_0_stays_whole_and_keeps_the_claude_code_path` writes the same shape with 0.91.0's formula. A hand edit of any of the four paths reads as empty and the seal as broken. A file sealed with a new path set reads as broken in 0.91.0 if the app is taken back to it; that is the safe side.
2 changes: 1 addition & 1 deletion backend/app/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.91.0"
__version__ = "0.92.0"
30 changes: 20 additions & 10 deletions backend/app/services/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,38 +69,48 @@ def _write(d: dict) -> None:
SETTINGS.write_text(json.dumps(d, indent=1))


PATHS = ("claudeBin", "codexBin", "cursorBin", "antigravityBin")
LATER = ("codexBin", "cursorBin", "antigravityBin")


def _loosened(vals: dict) -> bool:
return any(v == "allow" for k, v in vals["policies"].items() if k not in OWN_NAMES) or bool(str(vals["claudeBin"] or "").strip())
return any(v == "allow" for k, v in vals["policies"].items() if k not in OWN_NAMES) or any(str(vals[k] or "").strip() for k in PATHS)


def _sealed(vals: dict) -> dict:
return {k: v for k, v in vals.items() if k not in LATER or v}


def choice() -> dict:
from app.services import claude_code
d = _read()
policies = d.get("policies") if isinstance(d.get("policies"), dict) else {}
vals = {"enabled": bool(d.get("enabled", True)), "policies": dict(policies), "claudeBin": claude_code.raw_prefs().get("claudeBin", "")}
state = seal.check(vals, d.get("seal"))
raw = claude_code.raw_prefs()
vals = {"enabled": bool(d.get("enabled", True)), "policies": dict(policies), **{k: raw.get(k, "") for k in PATHS}}
state = seal.check(_sealed(vals), d.get("seal"))
broken = state in ("unsealed", "mismatch") and _loosened(vals)
if broken:
vals = {"enabled": vals["enabled"], "policies": {k: ("ask" if v == "allow" and k not in OWN_NAMES else v) for k, v in vals["policies"].items()}, "claudeBin": ""}
vals = {"enabled": vals["enabled"], "policies": {k: ("ask" if v == "allow" and k not in OWN_NAMES else v) for k, v in vals["policies"].items()}, **{k: "" for k in PATHS}}
return {**vals, "seal": "broken" if broken else state, "sealBroken": broken}


def commit(mutate=None, claude_bin: str | None = None) -> str:
def commit(mutate=None, bins: dict | None = None) -> dict:
eff = choice()
d = _read()
d["enabled"], d["policies"] = eff["enabled"], dict(eff["policies"])
if mutate is not None:
mutate(d)
bin_ = eff["claudeBin"] if claude_bin is None else claude_bin
paths = {k: str((eff if bins is None else bins).get(k) or "") for k in PATHS}
from app.services import claude_code
if claude_code.raw_prefs().get("claudeBin", "") != bin_ and claude_code.PREFS.exists():
claude_code.write_bin(bin_)
raw = claude_code.raw_prefs()
if any(raw.get(k, "") != paths[k] for k in PATHS) and claude_code.PREFS.exists():
claude_code.write_bins(paths)
d.pop("seal", None)
mark = seal.sign({"enabled": bool(d.get("enabled", True)), "policies": d.get("policies") or {}, "claudeBin": bin_})
mark = seal.sign(_sealed({"enabled": bool(d.get("enabled", True)), "policies": d.get("policies") or {}, **paths}))
if mark:
d["seal"] = mark
_write(d)
return bin_
return paths


def enabled() -> bool:
Expand Down
20 changes: 13 additions & 7 deletions backend/app/services/claude_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
TOKENS: dict[str, Path | None] = {}
KINDS: dict[str, str] = {}
TOKEN_VAR = "FORMDESIGN_INAPP_TOKEN"
FIELDS = ("claudeBin", "claudeFolder", "claudeFirstMessage")
PATHS = ("claudeBin", "codexBin", "cursorBin", "antigravityBin")
FIELDS = PATHS + ("claudeFolder", "claudeFirstMessage")
INSTALL = ("Claude Code is not installed: install it with npm install -g @anthropic-ai/claude-code (or from https://claude.com/claude-code), "
"run claude once in a terminal to sign in, then open it here again")
NOTE = ("You are Claude Code running inside FormDesign, the page layout and publishing app open on this computer. "
Expand All @@ -42,34 +43,38 @@ def raw_prefs() -> dict:
return {k: str(d.get(k) or "").strip() for k in FIELDS} if isinstance(d, dict) else {}


def write_bin(value: str) -> None:
def write_bins(values: dict) -> None:
try:
d = json.loads(PREFS.read_text())
except (OSError, ValueError):
d = {}
d = d if isinstance(d, dict) else {}
d["claudeBin"] = value
for k in PATHS:
if values.get(k) or d.get(k):
d[k] = values.get(k, "")
PREFS.write_text(json.dumps(d, indent=1))
_cache["value"] = None


def prefs() -> dict:
d = raw_prefs()
if d or PREFS.exists():
d["claudeBin"] = agents.choice()["claudeBin"]
c = agents.choice()
d.update({k: c[k] for k in PATHS})
return d


def save_prefs(body: dict) -> dict:
d = raw_prefs()
d["claudeBin"] = agents.choice()["claudeBin"]
c = agents.choice()
d.update({k: c[k] for k in PATHS})
for k in FIELDS:
if k in body and body[k] is not None and not isinstance(body[k], str):
raise ClaudeError(f"preference {k} must be text")
for k in FIELDS:
if k in body:
d[k] = (body[k] or "").strip()[:2000]
agents.commit(claude_bin=d.get("claudeBin", ""))
agents.commit(bins={k: d.get(k, "") for k in PATHS})
PREFS.parent.mkdir(parents=True, exist_ok=True)
PREFS.write_text(json.dumps(d, indent=1))
_cache["value"] = None
Expand All @@ -88,7 +93,8 @@ def child_env(path: str | None = None) -> dict[str, str]:


def setting(kind: str) -> str | None:
return prefs().get("claudeBin", "") if kind == "claude" else None
key = (agent_lookup.PROGRAMS.get(kind) or {}).get("setting")
return prefs().get(key, "") if key in PATHS else None


def located(kind: str, fresh: bool = False) -> agent_lookup.Found:
Expand Down
Loading
Loading