Commit Graph
7 Commits
Author SHA1 Message Date
9prodhi 7dcd8eaedb Merge branch 'feat/profile-dir-dispatch' into feat/cli-automation-primitives
# Conflicts:
#	tests/integration.rs
2026-11-23 08:33:07 -06:00
9prodhi 862f056bc8 Merge branch 'feat/upload' into feat/cli-automation-primitives 2026-11-23 08:31:18 -06:00
9prodhiandClaude Opus 5.5 ba10b3a898 feat(cli): add persistent profile directories and external subcommands
`launch --profile-dir <abs path>` runs an instance on a persistent
profile instead of a temporary one: the directory is created or
tightened to 0700, refused if relative or already used by another
instance in the daemon, kept on stop/shutdown, and shown in `list`.
Temporary profiles behave exactly as before.

Unknown subcommands now dispatch git-style: `camoufox <name> ...` runs
`camoufox-<name>` from PATH with the arguments passed through,
CAMOUFOX_SOCKET set to the resolved daemon socket, and its exit status
propagated. Built-in names always win; when no such executable exists
the clap error and exit code 2 are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 08:31:12 -06:00
9prodhiandClaude Opus 5.5 f12a796d8a feat(cli): add file uploads with frame and shadow scoping
Add an `upload` command that sets the files of an <input type="file">
selected by CSS selector, reusing the existing selector pipeline so
`--frame` (repeatable, nested iframes) and `a >>> b` shadow piercing work
as they do for fill/click. Paths are resolved to absolute on the client
and validated by the daemon (missing, directory, non-regular, multiple
files without the `multiple` attribute) before the page is touched.
Hidden inputs are supported. Exposed as InstanceManager::upload, a daemon
IPC request and a CLI command; plain mode prints the uploaded file names.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 08:18:58 -06:00
9prodhiandClaude Opus 5.5 aa7f937725 feat(cli): add stable error kinds to daemon responses
Error responses now carry a machine-readable `kind` next to the
unchanged `error` message, so programmatic clients can branch on error
type without parsing text. A single classifier maps messages to a fixed
snake_case set (selector_not_found, timeout, dialog_open, frame_detached,
frame_not_found, not_iframe, shadow_root, navigation,
instance_not_found, page_not_found, invalid_argument, io, daemon, other).
Plain-mode stderr, message text and exit codes are unchanged; success
responses never include `kind`; older responses without it still parse.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 08:18:58 -06:00
9prodhiandClaude Opus 5.5 c6cd4595f7 fix(config): find the browser where current Camoufox installs it
The CLI daemon, integration tests and web_browse example each resolved the
browser as $CAMOUFOX_BIN, else ~/.cache/camoufox/camoufox. Current Camoufox
(`python -m camoufox fetch`) installs to
~/.cache/camoufox/browsers/<repo>/<version>/camoufox and records the active
one in ~/.cache/camoufox/config.json, so a fresh install failed with
"failed to spawn browser ... No such file or directory" unless the path was
passed by hand.

Add camoufox::config::default_executable(), mirroring the Python package's
lookup, and use it from all three places:

1. $CAMOUFOX_BIN, if set and non-empty
2. active_version from <cache>/config.json, if its executable exists
3. the newest browsers/<repo>/<version>/camoufox (natural version order)
4. the legacy <cache>/camoufox, returned even if missing

<cache> honours an absolute $XDG_CACHE_HOME, else $HOME/.cache/camoufox.
An empty CAMOUFOX_BIN is now treated as unset.

Docs (README, CLI and library references, tutorial, how-to), CHANGELOG and
the camoufox-browse skill note are updated; plugin bumped to 1.1.1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 21:34:15 -06:00
9prodhiandClaude Opus 5.5 02b2f8fe60 docs: Diataxis documentation suite, verified against the code
Adds docs/ guides by type and makes README the entry point:
- tutorial: docs/tutorial-getting-started.md
- how-to: CLI daemon, iframes and shadow DOM, downloads and dialogs,
  library usage
- reference: docs/reference-cli.md (all 33 subcommands, built from the
  release binary's --help, with JSON samples from real runs and the
  {"ok","data"} envelope) and docs/reference-library-api.md
- explanation: docs/explanation-architecture.md

Repairs stale claims in README.md, docs/UNDERSTANDING.md and
docs/PROTOCOL.md (pipe/fd setup, concurrency model, unsafe scope, frame
buffer cap, readiness sentinels, navigate/evaluate return types, trusted
vs synthetic input, downloads --wait semantics, socket security on
Linux vs other platforms). Adds TODOS.md with verified follow-ups.

Written by agy (gemini-3.8-flash-high) via the gstack document-generate
skill; audited twice against the source by Fable 5.2 (41 semantic
findings fixed) and by a docs-vs-code name check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YQU84X3UzxGaxqrADxbkoE
2026-11-21 17:03:19 -06:00