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
2 changes: 1 addition & 1 deletion .agents/skills/formpdf-harness/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: "Does PDF work with formpdf through its MCP server. Use whenever th
license: Apache-2.0
metadata:
author: formpdf
version: "0.64.0"
version: "0.65.0"
---

# formpdf harness
Expand Down
4 changes: 2 additions & 2 deletions .agents/skills/formpdf-harness/references/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ Generated from the window's command catalogue (151 commands) by `./formpdf agent
| `demo-pages` | Demo: Pages and search | Opens the pages and search demo, a 53 page illustrated Alice in Wonderland, as a new unsaved PDF in the View tab. | Use when the person wants to try reading, searching, organizing or page numbers on a sample. |
| `demo-protect` | Demo: Redact, compare, convert | Opens the redact, compare and convert demo, a season report with contacts and hidden data, as a new unsaved PDF in the Protect tab. | Use when the person wants to try redaction, removing hidden information or a password on a sample. |
| `demo-sign` | Demo: Annotate, fill and sign | Opens the annotate, fill and sign demo, a half filled loan form with four comments, as a new unsaved PDF in Fill Forms and Sign. | Use when the person wants to try comments, form filling, signatures or stamps on a sample. |
| `pdf-agents` | Agents and MCP… | Shows how to connect Claude Code, Codex or Cursor to formpdf. | Use when the person wants an agent to work in formpdf. |
| `pdf-agents` | Agents and MCP… | Shows how to connect Claude Code, Codex, Cursor or Antigravity to formpdf. | Use when the person wants an agent to work in formpdf. |
| `pdf-custom-title-bar` | Custom Title Bar | Custom Title Bar | |
| `pdf-help` | formpdf Help | Opens formpdf Help. | Use when the person asks how something works. |
| `pdf-menus-in-window` | Menus in Window | Menus in Window | |
Expand All @@ -130,7 +130,7 @@ Generated from the window's command catalogue (151 commands) by `./formpdf agent

| Id | Name | Does | Use when |
| --- | --- | --- | --- |
| `home-agents` | Agents and MCP… | Shows how to connect Claude Code, Codex or Cursor to formpdf. | Use when the person wants an agent to work in formpdf. |
| `home-agents` | Agents and MCP… | Shows how to connect Claude Code, Codex, Cursor or Antigravity to formpdf. | Use when the person wants an agent to work in formpdf. |
| `home-batch` | Batch: run an action on many PDFs | Runs one action or action list on many PDFs, writing new files. | Use when the same change is needed on a folder of PDFs. |
| `home-help` | formpdf Help | Opens formpdf Help. | Use when the person asks how something works. |
| `home-merge` | Merge PDFs… | Combines several PDFs into one. | Use to join PDFs. |
Expand Down
2 changes: 1 addition & 1 deletion .agents/skills/formpdf-skillset/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: "Guides development of the formpdf codebase: its FastAPI engine, va
license: Apache-2.0
metadata:
author: formpdf
version: "0.64.0"
version: "0.65.0"
---

# formpdf skillset
Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/formpdf-harness/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: "Does PDF work with formpdf through its MCP server. Use whenever th
license: Apache-2.0
metadata:
author: formpdf
version: "0.64.0"
version: "0.65.0"
---

# formpdf harness
Expand Down
4 changes: 2 additions & 2 deletions .claude/skills/formpdf-harness/references/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ Generated from the window's command catalogue (151 commands) by `./formpdf agent
| `demo-pages` | Demo: Pages and search | Opens the pages and search demo, a 53 page illustrated Alice in Wonderland, as a new unsaved PDF in the View tab. | Use when the person wants to try reading, searching, organizing or page numbers on a sample. |
| `demo-protect` | Demo: Redact, compare, convert | Opens the redact, compare and convert demo, a season report with contacts and hidden data, as a new unsaved PDF in the Protect tab. | Use when the person wants to try redaction, removing hidden information or a password on a sample. |
| `demo-sign` | Demo: Annotate, fill and sign | Opens the annotate, fill and sign demo, a half filled loan form with four comments, as a new unsaved PDF in Fill Forms and Sign. | Use when the person wants to try comments, form filling, signatures or stamps on a sample. |
| `pdf-agents` | Agents and MCP… | Shows how to connect Claude Code, Codex or Cursor to formpdf. | Use when the person wants an agent to work in formpdf. |
| `pdf-agents` | Agents and MCP… | Shows how to connect Claude Code, Codex, Cursor or Antigravity to formpdf. | Use when the person wants an agent to work in formpdf. |
| `pdf-custom-title-bar` | Custom Title Bar | Custom Title Bar | |
| `pdf-help` | formpdf Help | Opens formpdf Help. | Use when the person asks how something works. |
| `pdf-menus-in-window` | Menus in Window | Menus in Window | |
Expand All @@ -130,7 +130,7 @@ Generated from the window's command catalogue (151 commands) by `./formpdf agent

| Id | Name | Does | Use when |
| --- | --- | --- | --- |
| `home-agents` | Agents and MCP… | Shows how to connect Claude Code, Codex or Cursor to formpdf. | Use when the person wants an agent to work in formpdf. |
| `home-agents` | Agents and MCP… | Shows how to connect Claude Code, Codex, Cursor or Antigravity to formpdf. | Use when the person wants an agent to work in formpdf. |
| `home-batch` | Batch: run an action on many PDFs | Runs one action or action list on many PDFs, writing new files. | Use when the same change is needed on a folder of PDFs. |
| `home-help` | formpdf Help | Opens formpdf Help. | Use when the person asks how something works. |
| `home-merge` | Merge PDFs… | Combines several PDFs into one. | Use to join PDFs. |
Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/formpdf-skillset/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: "Guides development of the formpdf codebase: its FastAPI engine, va
license: Apache-2.0
metadata:
author: formpdf
version: "0.64.0"
version: "0.65.0"
---

# formpdf skillset
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.64.0" src="https://img.shields.io/badge/version-0.64.0-eef0f4?style=flat-square">
<img alt="version 0.65.0" src="https://img.shields.io/badge/version-0.65.0-eef0f4?style=flat-square">
<img alt="Python" src="https://img.shields.io/badge/python-3.12%2B-3776ab?style=flat-square&logo=python&logoColor=white">
<img alt="TypeScript" src="https://img.shields.io/badge/typescript-vite-3178c6?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">
Expand Down
20 changes: 20 additions & 0 deletions backend/HASHOUT_LOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -891,3 +891,23 @@ The owner's decision for the family: a Windows engine is packaged with no consol
With no console a Windows program can start with no standard streams; `formpdf_engine.py` puts the null device in place of a missing `sys.stdout` or `sys.stderr` (entry 131's wave), so `--selfcheck` still runs. Seen here: `formpdf_engine.py --selfcheck` with standard output and error closed exits 0. In `freeze_backend.bat` the self-check after the build counts by its exit code; its printed line may not show there with no console.

Checked: `bash -n setup/freeze_backend`; the `.bat` by reading (`if not "%FORMPDF_ENGINE_WINDOWED%"=="0"` is true when the variable is unset). No Windows build has shown it.

## 134. A place for Codex, Cursor and Antigravity, sealed like Claude Code's, and a choice sealed by 0.64.0 still reads whole · _v0.65.0, logged 2026-11-20 (core/seal.py PATHS, LATER, SEALED, digest, loosened, effective; routers/system.py set_settings; services/claude_code.py SETTINGS; tests/test_seal.py)

kind: change · logged: v0.65.0 · 2026-11-20

FormPDF kept a place for Claude Code (`claudeBin`) inside the sealed agent choice, given to the finder first. Codex, Cursor and Antigravity now have the same: `codexBin`, `cursorBin` and `antigravityBin` are taken by `POST /api/settings` (window key required, trimmed, at most 2000 characters), sealed with the agent choice, and handed to the finder first through `claude_code.SETTINGS`, so a program that is not found tells the person to give its path in Preferences, Agents, as Claude Code's already did. 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 the sealed keys; adding three keys to that body would have changed the digest of every file sealed by 0.64.0 and made each one read as broken after the update, which takes agent access back to Ask and empties the Claude Code place. So the three new keys enter the body only when they hold a value (`LATER`); a file with none of them hashes exactly as 0.64.0 hashed it. Once the window writes one of them, the file is sealed in the new shape. This is FormLit's way (wave 8). Proved before the change with real files: origin/main's backend (0.64.0, `git archive`) 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 window write of `codexBin` after that was sealed and read back as `ok`. `test_a_choice_sealed_by_0_64_0_reads_whole_after_the_update` writes a file of 0.64.0's shape with 0.64.0's digest formula and checks the same, through later writes; the parametrized test checks each new place: sealed, given to the finder first (found with how `setting`), and a hand edit caught.

Ran: `tests/test_seal.py`, `tests/test_dock_contract.py`, `tests/test_window_key.py` 53 passed.

## 135. Antigravity tab folders left by a start that ended badly are swept at the next start · _v0.65.0, logged 2026-11-20 (services/agent_programs.py sweep_antigravity_folders; main.py lifespan; tests/test_dock_contract.py)

kind: fix · logged: v0.65.0 · 2026-11-20

Entry 129's folders go when their tab closes. When the engine ends without closing its tabs (killed, or gone because its shell went: entries 131 and 132), each Antigravity tab's folder under `agent-tabs/antigravity` stayed, with a `formpdf_tab` entry whose token died with that engine. The engine's start now sweeps them, before it serves. Only folders FormPDF made are touched: a direct child of `agent-tabs/antigravity` named as `antigravity_folder` names them (12 lowercase hex characters), a real folder and not a link, whose `.agents` folder and `mcp_config.json` are not links either; and only when no terminal tab of kind `antigravity` has that folder as its own. For each: leftover `mcp_config.json.part-*` files of an interrupted write go, the `formpdf_tab` entry goes, the file goes if no server is left, then the emptied `.agents` folder and the folder itself. A folder that holds anything else stays, as at close, with only the dead entry gone. Any error leaves that folder as it was; an error of the sweep never stops the start.

Seen: the test opens a real tab with the stand-in `agy` beside five folders (one the app made with an entry and a half-written part file, one the app made and empty, one the app made holding a person's file, one with a name FormPDF does not use, one a link to a folder elsewhere): the two the app made are swept; the open tab's folder and file are byte for byte as they were; the person's file stays with the entry gone; the other two are untouched; a second sweep finds nothing. And at a real start: two leftover folders made with the app's functions in a scratch data folder, then `uvicorn app.main:app` started and stopped in one script: after the start the empty one was gone and the one holding `notes.txt` held only that.

Ran: `tests/test_dock_contract.py` 14 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.64.0"
__version__ = "0.65.0"
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 = "FormPDF"
ACCOUNT = "settings-seal"
FIELD = "seal"
SEALED = ("outsideAgents", "agentsAllowed", "claudeBin")
PATHS = ("claudeBin", "codexBin", "cursorBin", "antigravityBin")
LATER = ("codexBin", "cursorBin", "antigravityBin")
SEALED = ("outsideAgents", "agentsAllowed") + 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("outsideAgents") == "allowed" or bool(values.get("agentsAllowed")) or bool(str(values.get("claudeBin") or "").strip())
return values.get("outsideAgents") == "allowed" or bool(values.get("agentsAllowed")) 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", "sealBroken": False}
if not loosened(stored):
return {**out, "seal": "unsealed", "sealBroken": False}
out.update(outsideAgents="blocked" if stored.get("outsideAgents") == "blocked" else "ask", agentsAllowed=False, claudeBin="")
out.update(outsideAgents="blocked" if stored.get("outsideAgents") == "blocked" else "ask", agentsAllowed=False, **{k: "" for k in PATHS})
return {**out, "seal": "broken", "sealBroken": True}


Expand Down
6 changes: 6 additions & 0 deletions backend/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ async def lifespan(_: FastAPI):
except OSError:
pass
_write_discovery()
from app.services import agent_programs

try:
agent_programs.sweep_antigravity_folders()
except OSError:
pass
loop = asyncio.get_running_loop()
events.bind(loop)
terminal.bind(loop)
Expand Down
4 changes: 2 additions & 2 deletions backend/app/routers/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@ def get_settings() -> dict:
@router.post("/settings")
def set_settings(patch: dict, request: Request) -> dict:
window_key.require(request)
allowed = {k: v for k, v in patch.items() if k in {"agentsAllowed", "outsideAgents", "claudeBin", "claudeFolder", "claudeFirstMessage", "author", "units", "spellLang", "timestampUrl", "formScripts", "language"}}
allowed = {k: v for k, v in patch.items() if k in {"agentsAllowed", "outsideAgents", "claudeBin", "codexBin", "cursorBin", "antigravityBin", "claudeFolder", "claudeFirstMessage", "author", "units", "spellLang", "timestampUrl", "formScripts", "language"}}
if "outsideAgents" in allowed:
if allowed["outsideAgents"] not in ("ask", "allowed", "blocked"):
raise HTTPException(400, "Agent access is ask, allowed or blocked")
allowed["agentsAllowed"] = allowed["outsideAgents"] == "allowed"
for key in ("claudeBin", "claudeFolder", "claudeFirstMessage"):
for key in ("claudeBin", "codexBin", "cursorBin", "antigravityBin", "claudeFolder", "claudeFirstMessage"):
if key in allowed:
allowed[key] = str(allowed[key] or "").strip()[:2000]
if "language" in allowed:
Expand Down
40 changes: 40 additions & 0 deletions backend/app/services/agent_programs.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,46 @@ def antigravity_folder_gone(folder: Path, token: str) -> None:
return


def sweep_antigravity_folders() -> list[str]:
root = config.data_dir() / "agent-tabs" / "antigravity"
owned = {os.path.normcase(os.path.abspath(s.cwd)) for s in list(terminal.SESSIONS.values()) if s.kind == "antigravity"}
try:
found = sorted(root.iterdir()) if root.is_dir() and not root.is_symlink() else []
except OSError:
return []
swept = []
for folder in found:
if len(folder.name) != 12 or any(c not in "0123456789abcdef" for c in folder.name) or folder.is_symlink() or not folder.is_dir():
continue
if os.path.normcase(os.path.abspath(folder)) in owned:
continue
path = antigravity_file(folder)
try:
if path.parent.is_symlink() or path.is_symlink():
continue
for part in path.parent.glob(path.name + ".part-*") if path.parent.is_dir() else []:
if part.is_file() and not part.is_symlink():
part.unlink()
data = _servers(path)
if "formpdf_tab" in data.get("mcpServers", {}):
del data["mcpServers"]["formpdf_tab"]
_replace(path, data)
if path.exists() and data == {"mcpServers": {}}:
path.unlink()
except (OSError, ValueError, TypeError):
continue
for emptied in (path.parent, folder):
try:
emptied.rmdir()
except FileNotFoundError:
continue
except OSError:
break
if not folder.exists():
swept.append(folder.name)
return swept


def open_tab(kind: str, cols: int | None = None, rows: int | None = None, fresh: bool = False) -> dict:
p = PROGRAMS[kind]
running = next((s for s in terminal.SESSIONS.values() if s.kind == kind and s.alive), None)
Expand Down
2 changes: 1 addition & 1 deletion backend/app/services/ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
DEFAULTS = {"anthropic": {"model": "claude-sonnet-5-5", "base": "https://api.anthropic.com"},
"openai": {"model": "gpt-4.1-mini", "base": "https://api.openai.com/v1", "imageModel": "gpt-image-1"},
"local": {"model": "llama3.1", "base": "http://127.0.0.1:11434/v1", "imageBase": "http://127.0.0.1:7860"}}
LABEL = {"off": "Off", "agent": "Your agent (Claude Code, Codex or Cursor)", "anthropic": "Anthropic", "openai": "OpenAI", "local": "A model on this computer"}
LABEL = {"off": "Off", "agent": "Your agent (Claude Code, Codex, Cursor or Antigravity)", "anthropic": "Anthropic", "openai": "OpenAI", "local": "A model on this computer"}
BUDGET = 150_000
TIMEOUT = 180
MAX_SLIDES = 30
Expand Down
2 changes: 1 addition & 1 deletion backend/app/services/claude_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
TOKENS: dict[str, Path | None] = {}
LABELS: dict[str, str] = {}
OVERRIDES = {"claude": ("FORMPDF_CLAUDE_BIN",), "codex": ("FORMPDF_CODEX_BIN",), "cursor": ("FORMPDF_CURSOR_BIN",), "antigravity": ("FORMPDF_ANTIGRAVITY_BIN",)}
SETTINGS = {"claude": "claudeBin"}
SETTINGS = {"claude": "claudeBin", "codex": "codexBin", "cursor": "cursorBin", "antigravity": "antigravityBin"}
OTHERWISE = "give its path in Preferences, Agents"
NOTE = ("You are Claude Code running in the agent dock inside formpdf, the PDF editor open on this computer. "
"Work on PDFs with the formpdf MCP server's tools: start with get_context, open_pdf to show a file, the pdf tool for the job, "
Expand Down
Loading
Loading