Reopening the same raw bytes with another architecture or entry point replaces the open target instead of silently keeping the first settings and caches. Fixes#305.
Triage of a bare .class file says it is a compiled Java class and recommends the java toolset (java_class_show, java_classes_find) instead of calling it an unrecognised format. Fixes#348.
Only an OpenAI-compatible server on this computer or its network (loopback, private and link-local addresses, bare and .local/.lan/.home.arpa/.internal names) or reached over ssh counts as a local model; a remote gateway gets the cloud context budget and its price. Fixes#374.
On Windows the app starts only DX12 by default, since starting Vulkan crashed on some Intel drivers before any window opened; WGPU_BACKEND still picks others. Fixes#394.
Claude's effort goes up to xhigh and max. A model without a level gets the nearest one below it. The level is chosen in Settings → AI or with craft-anything-cli ai effort, and over SSH it reaches the other computer. R2.9.
Maki can be added as a coding agent: over ACP (maki acp, with the backend's model after it) or one message at a time with its own adapter (maki -p), which switches its writing tools off outside a build. R2.2.
A .text section that runs past the end of the file is decoded as far as the bytes go, with a text_truncated limitation and partial coverage. Fixes#306.
The HTML scanner skipped only `<script>` bodies whose type mentioned "json" or "template". Import maps (`importmap`), speculation rules (`speculationrules`) and data blocks such as `text/html` became JavaScript modules in app maps: an import map was reported as a broken script, and an inert HTML template could add made-up fetch endpoints.
A `<script>` now counts as a script only when the page runs it as code: no type, `module`, or a JavaScript MIME type (parameters such as `; charset=…` are ignored), plus `text/babel` and `text/jsx`, which in-browser Babel runs. Other types are left out, both inline and with `src`.
**Verified:** a new scanner test. Five non-JavaScript types (inline and with `src`) give no scripts; six JavaScript spellings, including a mixed-case type and one with a charset, give one each. `cargo test -p craft-anything-js` (41) and `-p craft-anything-analysis` (85), clippy and fmt pass.
**Not run:** `cargo xtask wasm`. The change is pure string logic in an existing function.
Fixes#285
`app_changes_summarize` decided whether each comparison found changes. For records with `counts` it added added + removed + changed, which left out moves. So an archive or folder comparison whose only difference was a moved file (reported `identical: false`, `moved: 1`) counted as unchanged ("0 of 1 comparisons found changes").
A record's own `identical` verdict now decides when it has one, and moves count otherwise. Archive `counts.changed` keeps its meaning (content-edited files).
**Verified:** a new test of the verdict: a move-only comparison is changed (with and without `identical`), and an identical one is not. The engine's compare tests, clippy and fmt pass.
Fixes#286
`core_archives_compare` matched moves by content through a map from hash to one new path. Two identical old files missing on the new side both "moved" to that one path, so a removal went unreported. With two renamed copies, one copy was reused and the other was reported as added.
Each new-only file is now a move destination at most once. Old files are paired with distinct new copies of the same content, and the rest are removed or added. Every file on each side is accounted for once.
**Verified:** a new test with the reporter's fixtures. Two old copies and one new copy give 1 move and 1 removal; two and two give 2 moves to different paths, with no additions or removals. The existing comparison test still passes. `cargo test -p craft-anything-analysis` (86), the engine's artifact tests, clippy and fmt pass.
Fixes#283
`runtime_captures_compare` compared the filesystem dimension by the set of changed paths only. A run that deleted a watched file and a run that created the same file both "changed" that path, so they matched, and the comparison said the two runs were the same.
Each path is now compared together with how it changed (created, deleted or modified). Two deletions of the same file still match, and different paths still differ.
**Verified:** a new test of the filesystem comparison covering deleted vs created (changed), deleted vs deleted (unchanged), different paths (changed), and an `unchanged` effect against none (unchanged). The engine's process-tool tests, clippy and fmt pass.
Fixes#300
OpenAI-style APIs report `prompt_tokens` including the cached part (`prompt_tokens_details.cached_tokens`). We stored the whole `prompt_tokens` as `input_tokens` and the cached part again as `cache_read_tokens`. The context budget and the cost meter add the two, so cached tokens counted twice: a 100,000-token prompt with 65,536 cached read as 165,536, crossing the 150k budget and summarising early, and it was charged both rates.
`input_tokens` is now `prompt_tokens` minus the cached tokens, as Anthropic reports it, so every consumer counts each token once.
**Verified:** a new stream test with the reporter's numbers (100,000 prompt, 65,536 cached, 10 output): input 34,464, cache reads 65,536. `cargo test -p craft-anything-ai` (186), clippy and fmt pass.
Fixes#252
`enable_toolset` reports `visible_tools`, the number of tools now on the connection's list. It counted every tool in the enabled toolsets, but in Clean room `tools/list` leaves out the tools Clean room refuses. So enabling all toolsets said 299 while 86 were listed.
The count and the list now use one check (`listed`): a tool's toolset is shown and, in Clean room, Clean room runs it. Deep mode counts are unchanged, and the two meta-tools are still left out of the count.
**Verified:** a new MCP test in a Clean room session enables all toolsets and checks the count against the tools Clean room runs. It fails without the fix (299 against 86). `cargo test -p craft-anything-mcp` (16), clippy and fmt pass.
Fixes#263
Selecting a macOS app folder is recognised as an app bundle (its root-relative Contents/Info.plist), and nested XPC services appear as services and xpc-service graph nodes.
Fixes#282
The builder's approval check refused dev servers before looking at the safe build list. `npx vite build` is on that list, but it also starts with `npx vite` (a dev server), so it was refused as one, whatever the mode or Auto setting.
A listed build is no longer read as a dev server: `npx vite build` and `cd app && npx vite build` are allowed, while `npx vite` and `npx vite --host …` are still refused. A command in watch mode (`--watch`) is now refused with the same hint, since it never exits either. That includes a listed build such as `npx vite build --watch`. The safe-list match moved into one helper used by both checks.
**Verified:** new cases in the approval tests (three spellings of the build allowed; two server forms and a watch build refused). The engine's approval tests, clippy and fmt pass.
Fixes#291
`craft-anything-cli capabilities` lists each tool with `available`, `needs_target` and `reason`. To show target tools as usable before anything is open, it marked every target tool available and dropped its reason. That also covered tools Clean room refuses, so in Clean room `native_function_pseudocode` read as available with no reason, though the engine refuses it.
Only the "nothing is open yet" refusal is waived now. A target tool the mode refuses keeps `available: false` and its Clean room reason, with `needs_target: true` as before. In Deep mode nothing changes.
**Verified:** a new CLI test runs `capabilities` in Clean room (the tool is unavailable with a reason) and with `--deep` (available, no reason). `cargo test -p craft-anything-cli` and clippy pass.
Fixes#249
When an ACP agent answered `initialize` with an error (for example, not signed in) and kept running, the error was shown and the turn ended. But the agent's session was never started, and nothing started it later. The next message was queued for a session that never came, so the chat stayed busy. Stop cleared the queue without ending the turn, so every later message was refused as "still working".
- A message sent when the start has failed and nothing is under way now starts the handshake again (`initialize`, then the session). Another failure is reported and ends that message's turn like the first.
- Stop now ends the turn of a message still waiting for the session.
**Verified:** a new test of the protocol core: after a failed `initialize`, the next message sends `initialize` again, a second failure ends its turn, and Stop ends a waiting message. A late answer then sends no prompt. `cargo test -p craft-anything-ai` (184), clippy and fmt pass.
**Not verified:** a live run against an agent that refuses `initialize`.
Fixes#271
`core_action_approve` answers a coding agent's permission prompt with `{"behavior":"allow","updatedInput":…}`, echoing the action's input. For a large action, such as a ~96 KiB `Write` under Claude Code's 80 KB response budget, the MCP server replaced that answer with an `over_limit` error, so the decision was lost.
Approval answers are now exempt from the response budget. They are protocol messages, not result data, and their size comes from the input the client itself sent. Every other result is limited as before.
**Verified:** a new MCP test with a 300-byte budget and an allowed `Read` carrying a 4 KiB field: the answer is a single text block with `isError: false` and the full allow decision. `cargo test -p craft-anything-mcp` (16), clippy and fmt pass.
**Not verified:** whether Claude Code applies its own output-token limit to permission-prompt answers. If it does, a very large action still can't be approved through it, but the decision is no longer replaced on our side.
Fixes#253
The engine had its own `write_atomic` (used for `craft.json`, the inbox, reports and session files). Its temp file was named by process only, so two threads saving the same file at once wrote into one temp file. One rename then found it gone ("craft.json: No such file or directory"), and the file could end up with two versions mixed ("trailing characters").
The engine now uses the platform crate's `write_atomic`, which already gave each write its own temp file and kept the file's permissions. It also gains the engine's short retry when Windows briefly can't replace a file another program holds open. There is one atomic writer now; docs/pitfalls.md says so.
**Verified:**
- A new engine test: four threads each save one file 50 times and read it back. Every save succeeds, every read is one whole version, and no temp files are left. It fails against the old engine writer (checked) and passes now.
- The existing "file held open for a moment" test still passes.
- `cargo test -p craft-anything-engine` (397), the platform fs tests, clippy on both crates and fmt.
**Not covered:** two saves that overlap can still each start from what was on disk, so the later one wins for fields that aren't the person's (the person's fields are kept, as before). That's separate from the write itself.
Fixes#273
`AiHub` read the `[ai]` settings with a fallback: when they couldn't be parsed (for example, a price override missing `output_per_mtok`), they counted as empty. Adding a backend, choosing a role, renaming a model, turning a backend on or off or removing one then saved that empty configuration plus the one change over the person's backends, roles, fallbacks and prices.
Every change now reads the `[ai]` section strictly (`config_to_change`). If it can't be read, the change stops with the existing BadSettings error ("The [ai] settings couldn't be read: … Fix or remove the [ai] section in config.toml") and nothing is saved. Adding a backend reads the settings before storing its key, so a refused add stores no key either. Displaying the configuration still falls back as before.
**Verified:** a new test with two backends, a chosen builder and a broken price override. Adding a backend, clearing a role, turning one off and removing one all fail with BadSettings; the settings file stays byte for byte the same, and the refused add stored no key. `cargo test -p craft-anything-ai` (184), clippy and fmt pass.
Fixes#261
The fallback key file (`ai-keys.toml`, used when there's no keychain) was read leniently: a file that couldn't be read or parsed counted as empty. The next save then wrote back only the new key, so a stray quote or a bad byte cost every other key in it, while the save reported success.
Saving and deleting a key now read the file strictly. A missing file is still empty. A file that can't be read, isn't UTF-8 or isn't valid TOML stops the save with "Couldn't read the key file …: <why>" and "Fix or move that file (it was left untouched)". Reading a key (`get`) is lenient as before. After a keychain save, the stale-copy cleanup skips a file it can't read instead of replacing it.
**Verified:** a new test with the reporter's two cases (an unclosed quote, and a trailing invalid byte): the set and the delete both fail and the file stays byte for byte the same; a valid file keeps its other key after a save. `cargo test -p craft-anything-ai keys`, clippy and fmt pass.
Fixes#262
`android_package_show`'s summary, shown in CLI help and the MCP tool list, said "signatures are not verified". The tool does verify them: v2/v3 signatures over the signed data with a recomputed content digest, and v1 PKCS#7 with the per-file digests. Its own `verification_scope` limitation says so. The summary now says signatures and content digests are verified, but not whether the certificate is one you trust.
**Verified:** text only. `cargo xtask tools` leaves docs/tools.md unchanged, and fmt passes.
Fixes#247
An inline `<script>` becomes a module of its own (`index.html#inline-0`). Its summary took its hash from the input file with the same path, and there is no such file, so the hash was always empty. Comparing two maps then read "both empty" as "the same", and an edited inline script counted as unchanged.
- **Inline scripts now get the hash of their own code.**
- **Maps saved before this have no hash for them.** Where either side lacks a hash, the comparison now checks the module's structure fingerprint, size and strings instead.
**Verified:** a new test with a page whose inline script changes from `console.log("A")` to `("B")`:
- the inline module and the page are reported changed, and a map compared with itself has two unchanged modules;
- the same holds for maps with the inline hashes blanked, as saved before this fix.
`cargo test -p craft-anything-analysis` (80), the engine's app tests (31), clippy and fmt pass.
Fixes#236
Pi rejects an empty `mcp.json`, so setup marks Pi as "empty is invalid". The check also ran when the file didn't exist yet: its absent text read as empty, the plan was blocked ("the file is empty, and this app requires valid JSON"), and `setup --all-detected --yes` stopped with it.
A missing file now starts from `{}` and is created with our `mcpServers` entry. An existing empty file is still refused. The preview of a new file shows only the added lines.
**Verified:** a new setup test where Pi's folder exists without `mcp.json`: the plan isn't blocked, apply writes a valid file with our entry, and an empty file is still blocked. `cargo test -p craft-anything-setup` (24), clippy, fmt.
Fixes#238
`ver=<ver>` was read by the shell as a redirection, so pasting the block failed before it downloaded anything. It now has a real version to change, and a note on PATH.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>