Split out of #640 at review request: a translation PR is the wrong place for a process-handling change.
## What
When the direct child exits while a captured reader is still unfinished — a descendant holding a pipe, or output still being drained — `run_command_with_output` waits for the readers under the same deadline. On timeout the error said `<program> didn't finish within N seconds`, although the child had finished. It now says `<program> exited, but its output was still being captured at the N second deadline`, which names the shared deadline and does not claim the pipe is still open (`20026ee`).
In `inherited_pipe_tests`, an attempt whose direct child hit its own deadline before the holder filled both pipes proves nothing about inherited pipes, so the test retries it with a longer deadline, as it already did for an attempt that never reached the marker. The retry ceiling is a named `MAX_DEADLINE`.
## Testing
Run locally on Linux x86_64: `cargo test -p artcraft-launcher-native inherited_pipe_tests` passes (1 passed, 2 ignored fixtures), `cargo clippy -p artcraft-launcher-native --all-targets --locked -- -D warnings` is clean, and `cargo fmt --all -- --check` is clean. The wasm check was not run because this crate is not part of the web build. Hosted CI is left to run.
* feat(install): download one app at a time, in screen order
Downloads running side by side split the connection and each one crawls.
Apps now take turns: a download asked for while another is running waits
(shown as "Waiting for another download…", cancellable), and waiting
downloads start in the order the apps are listed on screen, following the
current sort. A download already finished on an earlier try skips the line,
and the next download starts as soon as the previous one is verified, while
that app installs.
- native: new `downloads::Downloads` queue (`install::DOWNLOADS`)
- protocol: `JobPhase::Queued`, `Command::DownloadOrder`
- ui: sends the sorted app order when it changes; new string in every catalog
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* feat(install): queue apps hidden by a filter or search in suite order
Only the apps on screen are sent as the download order; the queue puts any
other waiting app after them, in suite order, instead of by its place in the
current sort. Tests cover a hidden app, a search, and the queue's fallback.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* feat(install): let users choose how many downloads run at once
A "Simultaneous downloads" setting (1 to 4, default 1) in Settings > Updates,
sent in BackendOptions next to prereleases. The download queue counts running
downloads against it instead of allowing one: raising it starts waiting
downloads at once, lowering it lets running ones finish. Settings saved before
it existed allow one.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(install): take a place in the download line when a job starts
Jobs joined the line only on reaching their download, so with nothing
downloading the first to get there started, even below others on screen: an
Update all batch started in suite order. start_job now takes the job's place
(Downloads::join) before its thread runs, and places not yet at their download
count when choosing who goes next. A place dropped before its turn (the job
failed, was stopped or found its file already downloaded) leaves the line.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* docs(install): document the functions the download queue touches
CodeRabbit's docstring coverage check was at 38% of the functions in the diff.
Doc comments on the queue, its tests, and the backend and UI functions that
changed. No code changes.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
* test(install): give the platform-gated test jobs a place in line
Two Job literals in tests that only build on Linux and Windows
(a_downgrade_refuses_anything_but_an_msi_over_an_msi_install and
a_mac_downgrade_goes_ahead_without_a_package_to_put_back) were missing the new
place field, so the native tests didn't compile there.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
* fix(install): give the Windows MSI test a place in line, align the queued wording
The Windows-only integration test built a Job without the new place
field. The compact launcher-update row said "Waiting for other installs…"
for a queued download; it now matches the detail row.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
* feat(install): let users turn the download limit off
"No limit" in Settings → Updates lets every download run at once, as the
launcher did before. The default stays at one.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
* fix(install): keep the download queue building after the rebase onto main
Main grew new Job fields, two more UI catalogs (zh-TW, ka) and a settings
test that picked the nearest combo box. The test Job literal and both
catalogs get what the queue added, and the test now finds the install-format
chooser by its label, since the downloads dropdown sits closer to it.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MS5Qb6riBMzoujge5GuGZF
* fix(install): join the whole batch to the download line before any worker starts
An "Update all" started each worker right after joining the line, so the
first worker could take a free slot before a row above it had joined.
install_all now prepares every job first and starts the workers after.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MS5Qb6riBMzoujge5GuGZF
* test(install): check the batch path itself takes every place before a worker starts
The test called prepare_job directly, so putting install_all back to
starting each job as it is prepared would still have passed. The backend
now runs workers through a spawn function a test can replace; the test
holds the workers and checks, at each start, that all apps are in line.
Reverting install_all makes it fail.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MS5Qb6riBMzoujge5GuGZF
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: launcher-403-review <review@local>
The launcher treated any `mcpServers.ArtCraft` key as its own: Add replaced
it, and Remove or turning agents off deleted it from every client. Now an
entry is ours only when it starts craft-ai-mcp with exactly `--stdio` and no
environment. Any other ArtCraft entry is never replaced (Add reports it) or
removed, and Settings no longer shows it as added.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The launcher writes, reads and removes ArtCraft/mcp/apps.json through
`craft-ai-agents` (storytold/craft-ai-integrations#197), the same crate the
gateway reads it with and every Craft app checks the switch with, instead
of its own copy of the format.
- Every app is started as plain `<app>-cli mcp`: by the suite's rule that
command works in the open window when the app runs and accepts agents, and
headless otherwise. The per-app argument table (`--live` for PhotoCraft,
`--headless` for VectorCraft) and reading each CLI's `--help` to see
whether it takes them are gone.
- Gateway and craft-ai-agents pinned to the head of #197 (35e0352).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- install_gateway returned an identical copy before setting its mode, so a
copy that had lost its execute bit was reused and clients couldn't start
it. The mode is now checked on both paths (Unix). Test extended: a 0644
copy with the right bytes comes back executable (fails without the fix;
run in Linux).
- packaging/linux/test-package-metadata.sh builds packages from a fake
release folder; it now has a craft-ai-mcp fixture too, since the packages
install the gateway beside the launcher.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The entry in a client's configuration (and in the copied JSON, VS Code and
Codex formats) is `ArtCraft`, which clients show as the integration's
name, instead of `craft-apps`.
- Right after Add, a client the launcher can restart (Claude Desktop on
Windows and macOS) gets a note on why it must restart (it loads MCP
servers only when it starts; restarting closes it, including a reply in
progress) and a Restart button (`Command::McpRestartClient`). On Windows
only Claude Desktop's processes are stopped, picked by install folder
(Store package or classic install), never `claude.exe` by name, which is
also Claude Code's CLI; it is started again through its Start menu entry.
On macOS it quits through AppleScript and `open -a Claude` starts it.
- Three strings in all twelve catalogs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The note says what the switch does: while it is on, MCP clients reach every
installed Craft app through one entry; while it is off, no agent reaches
them and the entries added here are removed.
- Quick install: Add / Remove per client found here, with a note to restart
the client.
- Other clients: copy the configuration as JSON (`mcpServers`: Claude
Desktop, Cursor, LM Studio, Windsurf and most others), for VS Code
(`servers`, `type: stdio`) or for Codex (TOML `[mcp_servers.craft-apps]`),
naming the gateway copy clients start (`McpAgents::gateway`). The formats
live in `artcraft_launcher_core::mcp_config`, with `SERVER_KEY`.
- Nine strings, translated in all twelve catalogs; the old note is gone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Current Windows versions of Claude Desktop keep their data in
%LOCALAPPDATA%\Claude-Data\<install> and leave a .user-data-left.* marker in
the Store package folder they moved out of. The launcher wrote its entry into
that abandoned config, so Claude never saw it. Claude-Data now comes first,
then %APPDATA%\Claude, then a package folder without the marker.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Windows redirects a packaged app's %APPDATA% into its package, so the
Microsoft Store install of Claude Desktop reads
%LOCALAPPDATA%\Packages\Claude_<id>\LocalCache\Roaming\Claude and never
sees %APPDATA%\Claude: Settings showed it as not installed. The launcher
now uses the package's folder when only the Store install is there.
- Settings no longer has an Experimental features box: AI-MCP and
AI-MODELS are turned on in ArtCraft/flags.toml or with CRAFT_FLAGS, not by
a switch. SetFlag, Event::Flags and FlagState go, with the box's strings
in every catalog. The AI agents box still shows only while AI-MCP is on.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The app list gave every app plain `mcp`, so the gateway reached PhotoCraft
only headless. PhotoCraft now gets `mcp --live` (the open window, through
the connection it publishes, storytold/photocraft#13396) and VectorCraft
`mcp --headless` (its plain `mcp` attaches to a control port with no token
yet). Each is used only when that install's `mcp --help` names the
argument, so an older release still gets plain `mcp` instead of a usage
error.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Local services box from #1296 managed one LM Studio/Bionic entry per app
and an HTTP bridge on port 12345 that craft-ai-mcp no longer serves. Both are
replaced by the gateway: one craft-ai-mcp entry per MCP client.
Removed: local_mcp.rs, the McpSetService/McpSetBridge commands, the
McpService/McpBridge state, the Local services box and its strings. Kept, in
agents.rs: detecting the installed apps and their CLIs (InstalledApp) and
finding craft-ai-mcp beside the launcher (ARTCRAFT_LAUNCHER_GATEWAY_PATH for
development). Event::Mcp carries the AI agents state only.
update reports the format it looked for when a release has no file for
the copy. The new test calls it with an empty release for every kind of
copy and checks that the format matches the one installs_from looks for,
so a change to craft-update's choice of format fails the test.
- the gateway copy is compared byte for byte when the sizes match; a shipped
build with an older timestamp still replaces it
- MCP commands and every publication of the MCP state share one lock, so a
state read before a command can't arrive after it
- turning AI-MCP off cleans up first and writes the flag only then; a failed
cleanup leaves the flag on and the controls to retry
- ng-mcp.json: an entry added since the load is kept (only ids named as
removed go), a `servers` that is not a list is never replaced, and entries of
apps that are no longer installed are listed so they can be switched off
- the bridge switch and port are disabled until the saved state is known, so
a click can't overwrite a saved port with the default
Settings gets an Experimental features box with a switch per feature flag
from craft-flags (storytold/craft-libs#1118): AI-MCP and AI-MODELS, off by
default, shared with every Craft app through ArtCraft/flags.toml. A flag set
by CRAFT_FLAGS shows as such and can't be switched.
The AI agents box shows only while AI-MCP is on; the backend refuses to turn
agents on or add a client without it, and turning AI-MCP off turns agents off
and removes the client entries.
craft-flags is pinned to the head of storytold/craft-libs#1119 until it merges.
- Changes to the app list and the gateway copy run under one lock, and a
refresh checks again that agents are on, so detection can't bring the list
back after it was turned off.
- Clients get a copy of craft-ai-mcp in ArtCraft/mcp/bin, refreshed when the
shipped one changes, never a path inside an AppImage mount, a Flatpak sandbox
or a folder an update replaces.
- MCP commands run on a worker thread, one at a time, with one detection per
command: detection can run flatpak queries for seconds on Linux.
- Saving ng-mcp.json keeps entries it can't read where they were, and fields
of managed entries it doesn't know; only entries removed on purpose go.
- Without the gateway, agents that are on can still be turned off and their
entries removed; only turning on and Add need it.
Settings gets an "AI agents" box. "Let AI agents use Craft apps" writes the
installed apps and their CLIs into ArtCraft/mcp/apps.json, the list the
craft-ai-mcp gateway reads (storytold/craft-ai-integrations#197). Each MCP
client found on this machine (Claude Desktop, Claude Code, Cursor, LM Studio)
gets an Add / Remove button for one entry, `craft-apps` -> `craft-ai-mcp
--stdio`, through which the agent reaches every app.
Turning the switch off removes the list and every entry the launcher added.
A client configuration that does not parse is never overwritten, and other
servers and keys in it are kept. While agents are on, the app list is
refreshed whenever Settings asks for the MCP state, so a newly installed app
is reachable too. Without craft-ai-mcp beside the launcher, the box says so
and offers no switch.
Refs storytold/craft-ai-integrations#195
* Load and verify the signed website catalog with bundled fallback
* Preserve signed fixture bytes across platforms and fix web lint
* Document the opt-in live catalog integration check
The launcher's self-update downloads the release file of the format the
running copy was installed from, and stops when the release has none. A
copy run outside the macOS app bundle updates from a .tar.gz, and the
launcher's macOS releases (v0.17.0 to v0.19.0) ship only the .dmg. Such a
copy was still offered "Update and restart", which then failed.
self_update::installs_from looks for that file with craft-update's own
pick_asset, as the update does. The backend reports self-update as
available, and starts one, only when the release has the file; otherwise
the update dialog and banner offer the download. The doc comment on
Capabilities::self_update states the new condition.
Detection stores the bare app name when it cannot find an MSI app's exe. Open checked it
with exists(), which looks in the launcher's working folder (its install folder). With the
apps in a custom folder beside the launcher a folder of that name is there, so the name
reached spawn and failed with "program not found" instead of the reinstall message.
Refs #1008, storytold/wordcraft#4831
- save_servers now refuses to overwrite a present-but-malformed ng-mcp.json
instead of clobbering it (prevents lossy writes).
- enable/disable/remove_service only manage stdio entries; a same-named entry
of another connection type is left alone and we fall back to the deterministic id.
- Save failures are surfaced via a new Event::McpError shown as an error toast,
so a failed toggle is never silent.
- Settings now explain that the bridge port applies when the toggle flips.
Adds tests for the malformed-config refusal and the non-stdio name guard.
Upstream main added the mac_bundle_name field to the CraftApp struct; add it
to the local_mcp test fixture so the crate compiles. Also apply rustfmt to
files whose formatting drifted after rebasing onto main (use-statement
wrapping, method-chain reflow, struct-variant collapse). No logic changes.
Gated on ARTCRAFT_LAUNCHER_VERIFY_MCP (dev-box only, never CI), this loads the
real ng-mcp.json and asserts that WordCraft/PdfCraft stdio entries and the Craft AI
bridge are recognized by display name and reported as enabled at port 12345. Guards
against regressions to the name-based matching so existing UUID-id entries keep being
managed in place rather than duplicated.
The user's ng-mcp.json already contains Craft app + bridge entries created under
UUID ids (by an earlier launcher version). Matching only on the deterministic
craft-ai-mcp-* ids would create duplicates instead of managing those working
entries in place. Now every managed entry is matched by display name first, with
the deterministic id as a creation-only fallback:
- local_mcp: new find_by_name() helper; enable_service/disable_service/remove_service
now take &LocalService and match by display name (disable/remove fall back to the
deterministic id). Bridge functions use find_bridge(), which matches the
deterministic bridge id or a streamableHttp entry named "Craft AI". bridge_entry
is renamed to "Craft AI" so it lines up with existing entries. New public helpers
service_enabled / bridge_port_current / bridge_enabled (with parse_port) let the
backend report current state; enable_bridge refreshes the URL in place.
- backend: mcp_state reports each app's on/off state via service_enabled(name) and
the bridge's port/enabled via bridge_port_current/bridge_enabled, so UUID entries
show as already present. McpSetService now passes the detected LocalService to
both enable and disable.
- tests: cover name-based management for apps and the bridge (id preserved, command/
URL refreshed, no duplicate created), plus port parsing and enabled reporting.
Detect installed Craft apps and the unified craft-ai-mcp bridge, and let the
user toggle each on/off as an MCP server in LM Studio / Bionic's ng-mcp.json.
Plumbing:
- core/protocol: Command::McpState | McpSetService { service_id, enabled } |
McpSetBridge { port, enabled }; Event::Mcp { services, bridge } plus the
McpService / McpBridge types (Default-derived).
- native/backend: mcp_state(&Shared) reads the manifest + a fresh detection
snapshot and ng-mcp.json to report which apps have usable CLIs (with their
current on/off state) and whether the bridge binary is present (found?
version?). Emits Event::Mcp after every detection pass and after each change.
- native/local_mcp: BRIDGE_ID now public; candidate_bridge_paths collapsed to a
let-chain (clippy).
UI (egui):
- app.rs: LauncherUi holds mcp_services / mcp_bridge / bridge_port (+ the once-
synced flag) and handles Event::Mcp.
- dialogs.rs: opening Settings requests Command::McpState once; the request is
reset when no dialog is on screen so reopening re-fetches fresh state.
- settings_dialog.rs: new "Local services" panel (only where manage_apps). A
collapsible "Craft apps" section lists each installed app as a toggle with
its CLI path shown in muted text; the unified bridge row has an editable,
accessible-labelled port field and a toggle that applies the current port.
i18n: translations for every new literal across all complete catalogs (ru, zh-CN,
zh-TW, de, fr, pt-BR, es, cs, pl, hu, ja, ka).
All tests pass; clippy clean of denied lints.
Locate the unified craft-ai-mcp bridge binary (via ARTCRAFT_LAUNCHER_BRIDGE_PATH
override or derived install locations), version-check it, and register a single
streamableHttp entry at http://127.0.0.1:12345/mcp in ng-mcp.json.
This links the launcher (Branch B) to the unified HTTP bridge crate (Branch A /
PR #154): one 'Enable Local Services' toggle can expose all Craft AI tools over a
single endpoint instead of per-app stdio rows, with per-app stdio as fallback.
- locate_bridge/first_existing/candidate_bridge_paths: pure, testable path lookup
(no unsafe env mutation in tests)
- bridge_version: delegates to the launcher's existing PE-version reader on Windows
- bridge_entry/enable_bridge/disable_bridge/remove_bridge: manage the single entry
- tests cover shape, port, enable/disable/remove lifecycle, and first_existing
Adds a native module that reuses the existing app detection to find every
Craft App on this machine (reading each MSI InstallLocation, never a
hardcoded folder), derives each app's stdio CLI path, and writes stdio
server entries into LM Studio/Bionic's ng-mcp.json. Config path is derived
from the user profile and overridable via ARTCRAFT_LAUNCHER_MCP_CONFIG for
tests. Entries are added/disabled/removed atomically, preserving other top-
level keys. Unit tests cover CLI derivation, round-trip, and toggle behavior;
a gated Windows test verifies real detection on a machine with the suite
installed.
When the waiting side could not open the elevated session's process for 10 seconds, the
session could still be running, but the batch ended with an error and released the
installer queue, so the next job could start beside it and stop with error 1618.
The queue now stays taken until the session's process ends, or until the session has
written its results and removed its process id, up to 4 hours.
The batch session's elevated copy took a package's path and checksum from a manifest
in the launcher's downloads folder, which any process of the user can write. The UAC
prompt names the launcher's publisher, so a manifest written by such a process could
get any MSI installed under that prompt.
The elevated copy now checks each held package's Authenticode signature against its
own, as the self-update helper does, and reports no exit code without running Windows
Installer when they differ. The launcher's side sends a package from another publisher
to install by itself under its own prompt, as SolidCraft and ArtCraft Studio do now.
The elevated copy also resolves the package's path before holding it and refuses a
symbolic link, so the path it checks is the one it installs, and it writes its
process id only to a new file.
Two review findings on the one-prompt session:
- The results file is bound to its session by a random token, written as
the file's first line and carried in the held manifest; a leftover or
planted file in the downloads folder can no longer pass for a
session's report. The session's name is only taken once its results
and process-id files are free too.
- The waiting side falls back to one-by-one installs only when the
elevated session is shown to be over (its process waited out, or its
process id gone). A session that was launched but cannot be seen to
finish - a slow antivirus start-up, a process that will not open -
now reports an error per app instead of racing a second installer.
The Linux gate never compiles this test, and Windows clippy stops at the
first hard error, so the field came to light only once the errors before
it were fixed.
Clippy on Windows (never compiled on the Linux gate) asked for two
things: run_msi now keeps to its caller's module, the visibility its
Package argument already has, and the session's cleanup-on-error uses
inspect_err, which is what removing a pid file on the way out is.
A job whose run_install ends before the installer is reached (a
repository-managed Flatpak, a missing release, the overwrite question, a
paused download) dropped its batch's gather without leaving it, so the
rest of the batch waited out the full ten-minute cap before their shared
prompt. The backend now holds the place with the same BatchPlace guard
install_at uses, so every way out of a job gives the place back.