mirror of
https://github.com/storytold/craft-anything.git
synced 2026-11-19 14:00:52 +01:00
Addresses #1178 (which also consolidates #1277). ## The problem The website study a build starts with opens a fresh private browser, so a web app behind a login is studied as its sign-in or landing page, and the builder then builds a sign-in page. ## What this adds - **`web_site_sign_in { url }`** opens a visible browser window on the site. The person signs in there themselves and closes the window. The browser's profile is then saved in Craft Anything's own folder, keyed by the site's host and port. Craft Anything never sees or stores a password and still never reads cookie or storage values. - **`web_site_open`** uses a saved sign-in for that exact host and port when there is one, by copying it into the usual temporary profile (headless as before, deleted afterwards). `signed_in: false` forces the private profile; `signed_in: true` with nothing saved is a clear error naming the sign-in tool. Nothing else about the private path changes. - **`web_site_sign_out { url }`** forgets a saved sign-in. - **A check right after saving.** The sign-in tool reopens the site headless exactly as a later study will, and reports whether it still looks like a sign-in page, plus a screenshot kept in the site's owner-only folder (path, hash and size are returned, not the picture, so the person's account screen is not sent to an agent). - **Typed facts through to the builder.** `signed_in`, `signed_in_site` and `sign_in_page` are in the open result, the capture result and `capture.json`. The website briefs tell the builder the capture is the signed-in view only when it is signed in and does not look like a sign-in page. A not-signed-in capture with a password field says how to sign in; a signed-in one says the sign-in may have ended. - The check phase opens the built site with `signed_in: false`. Because a study already starts with `web_site_open`, a normal build of that site is signed in after one `web_site_sign_in`, with no new build option. ## Decisions for maintainers These are policy calls I made so the change is usable; each is small to reverse. 1. **Clean room allows the two tools** (two lines in `clean_room.rs`). Reasoning: the person signing in as themselves and looking at pages is watching from outside, as a user would; `visitor_view()` strips exactly what it did before. 2. **A saved sign-in is used by default** for later opens of that site, until `web_site_sign_out`. Saving it is treated as the consent, and the tool text and evidence say so. The alternative is opt-in per study, which needs an option in the Make screen and `rebuild`. 3. **Restricted MCP mode refuses both tools even with `--allow-web`**, since sign-in opens a window on the person's desktop. 4. The saved profile sits on disk (owner-only on Unix; on Windows it relies on the per-user config folder). On Linux it is launched with the basic password store so the visible and headless launches can read the same cookies. The tool text says that anyone who can open the person's files could use the sign-in. ## Trade-offs and limits - Needs a desktop: on a computer with no display the tool refuses at once with what to do instead. - Sites that tie a sign-in to the browser, or expire it quickly, will capture signed out; the check after saving and the `sign_in_page` field say so. - Session-only cookies are kept by setting the profile to continue where it left off; restored tabs are not copied. - The saved profile can also hold single sign-on providers' sign-ins made in that window. It is used only when that exact host and port is opened. - Screenshots and page text of a signed-in study contain the person's own account data; the evidence says so. Result URLs drop the query and fragment when a sign-in is used. - Not in this PR (roadmap lines added under R2.9): a Make-screen button, showing the person the study's first screenshots to confirm before the builder starts, attaching to the person's running browser, refreshing a saved sign-in from a capture, and a live run on a real site and with the Snap browser. ## What was verified Run locally on Linux (x86-64), on the branch before its final rebase onto `main` (the rebase was clean; after it: `cargo fmt --all --check`, `cargo xtask layers`, `locks`, `secrets`, `tools --check`, `i18n-coverage` pass): - `cargo test -p craft-anything-engine` (583 passed, 12 ignored), `-p craft-anything-mcp` (22), `-p craft-anything-ai` (580, 3 ignored). - `cargo clippy -p <crate> --all-targets -- -D warnings` for engine, mcp and ai. - **Live, with Chromium 157 under a virtual display against a local test site** (the new `#[ignore]` tests in `site_sign_in/tests.rs`; a helper plays the person over the browser's own debugging port and closes the window): - a sign-in made in the visible window is seen by a later headless open and capture, including an HttpOnly cookie and a session-only cookie (removing the continue-where-you-left-off setting makes that assertion fail, so the setting is what keeps it); - `signed_in: false` and a signed-out site show the signed-out page with the private-profile limitation; - a site that forgets the cookie is reported as still a sign-in page by the check after saving; - two overlapping signed-in opens both work and leave the saved sign-in byte-identical; - the timeout path stops the browser, keeps what was saved and leaves no process behind; - with no display the tool refuses immediately. - The two existing live website tests still pass. **Not verified:** a real third-party site; a confined Snap or Flatpak browser (reasoned from the existing profile-location code, not run); Windows and macOS behaviour, including the browser-exit signal (the profile lock going away) and cookie decryption there; the workspace-wide `cargo xtask ci` steps and `--features wasm-plugins` (not enough disk locally, so CI is the first run of those); how the egui app shows the new tools. An independent review pass was done before opening; its findings (copying only after the browser has exited, not treating one slow probe as a closed window, a whole-or-nothing replacement of the saved profile, reserved Windows names in site keys, owner-only permissions) are fixed in the later commits.
15 KiB
15 KiB
Tools
Generated by cargo xtask tools. Do not edit by hand.
305 engine tools in 17 toolsets. Each is an MCP tool, a CLI command (craft-anything-cli <id with dashes>) and a tool the agent can call. The AI and setup layers add their own on top (rebuild_*, assets_key_*, ai_models_list, ai_model_set, setup_*); craft-anything-cli commands lists them all. OpenCode model and thinking selection describes the AI model tools.
Essentials (core, 36)
core_target_open: Opencore_target_close: Closecore_session_show: Session statuscore_targets_list: List open targetscore_target_select: Switch targetcore_evidence_show: Evidence so farcore_evidence_export: Export evidencecore_evidence_import: Import evidencecore_unknowns_show: Open questionscore_unknown_add: Record an open questioncore_unknown_edit: Update an open questioncore_unknown_verify: Check an answercore_archive_show: Inventory an archive or app bundlecore_archive_extract: Extract an archivecore_archives_compare: Compare two artifactscore_person_ask: Ask the personcore_action_approve: Approve an agent actionassets_image_generate: Generate a pictureassets_model_generate: Generate a 3D modelcore_investigation_show: Investigation so farcore_brief_write: Write the briefcore_plan_update: Update the plancore_hypothesis_record: Record a hypothesiscore_hypothesis_update: Update a hypothesiscore_finding_record: Record a findingcore_finding_edit: Update a findingcore_handoff_write: Write the handoffcore_journal_read: Read the journalcore_report_save: Save a reportcore_report_write: Write a readable reportcore_overview_show: Overviewnative_function_study: Function dossiercore_feature_find: Trace a featurecore_target_triage: What is this?core_evidence_browse: Page through evidencecore_text_read: Read a text file
Programs (native code) (native, 55)
native_cursor_show: Where am Inative_functions_list: List functionsnative_sections_list: List segmentsnative_strings_browse: List stringsnative_named_addresses_list: List namesnative_open_documents_list: List documentsnative_bookmarks_show: List bookmarksnative_functions_search: Search functionsnative_strings_find: Search stringsnative_bytes_show: Read bytesnative_address_offset_show: Address to file offsetnative_xrefs_list: Cross-referencesnative_name_show: Name at addressnative_comment_read: Read commentnative_inline_comment_read: Read inline commentnative_function_show: Function infonative_function_disassemble: Function assemblynative_function_callees_list: What it callsnative_function_callers_list: Who calls itnative_function_references_list: Function referencesnative_function_pseudocode: Decompilenative_function_address_show: Function addressnative_function_instructions_list: Function instructionsnative_function_find: Which function is this innative_instruction_show: Inspect instructionnative_call_site_resolve: Resolve a callnative_data_show: Inspect datanative_name_set: Name an addressnative_names_set: Name many addressesnative_comment_write: Write commentnative_inline_comment_write: Write inline commentnative_bookmark_add: Bookmarknative_bookmark_remove: Remove bookmarknative_function_label: Annotate functionnative_cursor_address_show: Cursor addressnative_cursor_function_show: Cursor functionnative_document_show: Current documentnative_cursor_goto: Go to addressnative_cursor_forward: Next addressnative_cursor_back: Previous addressnative_call_graph_show: Call graphnative_call_path_find: Call pathnative_functions_decompile: Decompile manynative_name_xrefs_list: References to a namenative_api_show: API boundarynative_value_flow_show: Value flownative_dos_image_show: DOS load imagenative_address_show: What's at this addressnative_bytes_find: Search for bytesapp_builds_line_up: Match functions between two buildsnative_source_folder_write: Write pseudo-C to a foldernative_objdump_run: objdump outputnative_rizin_command_run: Rizin commandnative_cutter_sessions_list: List shared Cutter sessionsnative_cutter_command_run: Cutter command
Apple apps (apple, 14)
apple_objc_classes_list: Objective-C classesapple_objc_protocols_list: Objective-C protocolsapple_swift_types_list: Swift typesapple_dispatch_show: Dispatch metadataapple_ui_action_trace: Trace a UI actionapple_macho_show: Mach-O structureapple_signature_show: Code signatureapple_plist_show: Property listapple_slices_list: Architecturesapple_swift_symbols_demangle: Demangle Swift symbolsapple_nib_decode: Interface Builder documentsapple_archive_decode: Keyed archiveapple_assets_list: Asset catalogapple_dylibs_resolve: Library resolution
File formats (formats, 36)
web_recording_show: Inspect a network recordingnative_pe_resources_list: Windows resourcesnative_layout_show: Binary layoutnative_crash_show: Crash dumpnative_go_binary_show: Go program detailsformats_wasm_module_show: WebAssembly moduleformats_evm_interface_show: Smart contract interfaceformats_sbpf_show: Solana program (sBPF)formats_sbpf_disassemble: Disassemble sBPF codefirmware_regions_list: Firmware regionsfirmware_image_extract: Extract firmwarecore_packed_files_list: Files packed inside a filecore_packed_files_unpack: Take out packed filesformats_bytecode_show: Compiled Python filegame_archives_list: List a game's archivesgame_pak_list: List an Unreal pakgame_iostore_list: List an Unreal IoStore containergame_unity_list: List a Unity assets filegame_unity_bundle_list: List a Unity bundlegame_unity_asset_export: Take an asset out of a Unity gamegame_unreal_texture_export: Take a texture out of an Unreal gamegame_pak_extract: Take files out of an Unreal pakgame_unity_code_names_show: Read a Unity game's IL2CPP metadataapp_folder_explain: Work out what an installed app is built onnative_rust_binary_show: Rust program detailsnative_library_calls_list: What a program importsnative_offered_symbols_list: What a program exportsnative_publisher_show: Who signed this Windows programformats_ai_weights_show: AI model fileformats_wasm_compare: Compare WebAssembly interfacespackets_capture_show: Packet capture overviewpackets_fields_show: Packet fieldsengines_tshark_check: Wireshark tools checkpackets_inventory_show: Capture inventoriesradio_recording_decode: Decode a radio recordingradio_decoders_list: List radio decoders
.NET apps (managed, 8)
managed_assembly_show: .NET assembly overviewmanaged_members_list: .NET types and methodsmanaged_native_calls_list: .NET native callsmanaged_assemblies_compare: Compare two .NET buildsmanaged_native_calls_verify: Check .NET native callsmanaged_reconstruction_check: Check decompiled C#managed_app_graph_build: .NET application graphmanaged_ilspy_decompile: ILSpy decompile
Android apps (android, 14)
android_package_show: Android app packageandroid_classes_find: Find Android classesandroid_class_show: Android classandroid_method_show: Android method bytecodeandroid_class_users_find: Who uses this Android class?android_resources_read: Android resourcesandroid_components_list: Android app componentsengines_apktool_check: Is Apktool available?android_flutter_identify: Identify a Flutter buildandroid_dart_snapshot_show: Inspect a Dart AOT snapshotengines_jeb_check: Check the JEB connectionandroid_jeb_open: Open a file in JEBandroid_jeb_units_browse: List JEB unitsandroid_jeb_decompile: Decompile with JEB
Java programs (java, 6)
java_archive_show: Java archive overviewjava_classes_find: Find Java classesjava_class_show: Java classjava_method_show: Java method bytecode and pseudo-Javajava_class_users_find: Who uses this Java class?java_vineflower_decompile: Decompile Java with Vineflower
Connected phone (adb, 24)
engines_adb_check: Is adb available?adb_devices_find: Connected devicesadb_device_show: Device detailsadb_apps_list: Installed appsadb_log_read: Device logadb_app_show: App details on deviceadb_running_processes_list: Running processesadb_folder_list: Device folderadb_device_features_list: Device featuresadb_system_services_list: System servicesadb_display_show: Display infoadb_window_show: Window / focus infoadb_setting_get: Read a settingadb_apps_find: Find an appadb_app_download: Copy an app off the phoneadb_file_download: Copy a file off the phoneadb_screenshot_take: Screenshotadb_bugreport_save: Bug reportadb_file_upload: Copy a file to the phoneadb_app_install: Install an appadb_app_remove: Remove an appadb_app_launch: Launch an appadb_activity_open: Start an activityadb_app_force_stop: Force-stop an app
Websites (browser, 24)
web_browser_connect: Connect to a browserweb_pages_list: List browser pagesweb_page_show: Inspect a web pageweb_page_js_analyze: Analyse a page's JavaScriptweb_page_watch: Watch a page over timeweb_mcp_tools_list: Find in-page MCP toolsweb_page_screenshot_take: Screenshot a pageweb_snapshots_compare: Compare two page capturesweb_pixels_compare: Compare two screenshotsweb_walkthrough_record: Run a scripted web sessionweb_walkthrough_check: Check a scripted web sessionweb_site_open: Open a websiteweb_site_capture: Capture a website for rebuildingweb_page_states_capture: Capture menus, dialogs and tabsweb_site_close: Close the websiteweb_site_sign_in: Sign in to a websiteweb_site_sign_out: Forget a website sign-inweb_standin_build: Build a stand-in backendweb_standin_start: Start a stand-in backendweb_standin_stop: Stop a stand-in backendweb_standin_show: See what a stand-in was askedweb_coverage_measure: Measure which code ranweb_listeners_list: List a node's event listenersweb_modules_trace: Map a page's module graph
Electron and JavaScript (javascript, 11)
js_app_map: Analyse a JavaScript appjs_runtime_code_match: Match static code to what ranweb_scripts_save: Export captured scriptsjs_source_locate: Find the original source linejs_sources_restore: Recover readable sourcesjs_electron_pages_list: List Electron pagesjs_electron_page_show: Inspect an Electron pagejs_electron_walkthrough_record: Run a scripted Electron sessionjs_runtimes_list: List JS runtime targetsjs_runtime_watch: Observe a JS runtimejs_electron_fuses_show: Electron fuses
Running programs (runtime, 14)
native_window_capture: Picture a program's windowruntime_walkthrough_record: Run and watch a programruntime_captures_compare: Compare two runsruntime_ui_read: Read an app's screenruntime_ui_walkthrough_record: Drive an app's screenapple_calls_observe: Watch a Mac app's callsnative_gdb_session_begin: Start a GDB sessionnative_gdb_command_run: GDB commandnative_gdb_session_show: GDB session statusnative_gdb_session_end: Close a GDB sessionnative_rizin_session_begin: Start a Rizin debug sessionnative_rizin_session_command_run: Rizin debug commandnative_rizin_session_show: Rizin debug session statusnative_rizin_session_end: Close a Rizin debug session
Frida instrumentation (frida, 9)
frida_devices_find: Frida devicesfrida_targets_list: Frida processesfrida_session_begin: Start a Frida sessionfrida_script_run: Run a Frida scriptfrida_session_continue: Resume a Frida sessionfrida_script_forget: Unload a Frida scriptfrida_session_show: Frida session statusfrida_session_end: Close a Frida sessionfrida_instrument_run: One-shot instrumentation
Comparing and rebuilding (application, 17)
app_feature_follow: Trace a featurejs_function_explain: Explain a functionapp_graphs_compare: Compare two app versionsjs_exports_compare: Compare module exportsapp_source_import: Import a source folderjs_source_bundle_compare: Line up source with the bundleapp_ledger_build: Build a rebuild ledgerapp_coverage_evaluate: How complete is the rebuildandroid_app_graph_build: Map an Android appapple_app_graph_build: Map an Apple appharmony_app_graph_build: Map a HarmonyOS appapp_function_versions_compare: Compare two functionscore_evidence_exports_compare: Compare two evidence bundlesapp_changes_summarize: Summarise what changedapp_call_path_find: Find a call pathapp_runtime_correlate: Line up code and behaviourapp_rebuild_claim_check: Check a rebuild claim
Databases (database, 1)
db_sqlite_show: SQLite database contents
Projects (projects, 21)
project_list: List projectsproject_show: Show a projectproject_inbox_answer: Answer a project's questionproject_play: Play a project's resultproject_preview: Preview a project's websiteproject_open_folder: Open a project's folderproject_rename: Rename a projectproject_plan_fold: Fold a project's planproject_duplicate: Duplicate a projectproject_delete: Delete a projectproject_questions_set: Choose what the builder's questions getproject_approvals_set: Choose what the builder's approvals getproject_build_finish: Call the build doneproject_assets_budget: Set a project's asset budgetproject_assets_allow: Let a project generate assetsproject_pin_create: Pin a project's buildproject_pins_list: List pinned buildsproject_pin_open: Open a pinned buildproject_pin_stop: Stop a pinned buildproject_pin_rename: Rename a pinned buildproject_pin_delete: Remove a pinned build
Engines and settings (setup, 9)
engines_list: List enginesengines_install: Install an enginesettings_show: Show settingssettings_set: Change a settingplugins_list: List pluginsplugins_refresh: Refresh pluginsplugins_add: Add a pluginplugins_remove: Remove a pluginengines_app_open: Open an engine's app
Building (build, 6)
build_files_list: List project filesbuild_file_read: Read a project filebuild_file_write: Write a project filebuild_file_edit: Edit a project filebuild_checklist: Update the checklistbuild_command_run: Run a build command