feat: eval prints its origin URL, type --focused, AGENT_BROWSER_HUMANIZE bogus warn
- eval now prints `eval @ <url>` to stderr (stdout stays the raw value) so an agent can catch tab drift — e.g. a logged-in fetch that hit the wrong origin — before trusting the result. Mitigates the issue #2/#3 P0 safety concern. (eval already returned the origin; the default output just never surfaced it.) - `type --focused <text>`: type into the currently-focused element with no selector, for custom widgets that move focus to a hidden input (issue #2 P3). - AGENT_BROWSER_HUMANIZE set to an unrecognized value now warns once (like the --humanize flag) instead of being silently ignored (Hermes #3).
This commit is contained in:
+10
-1
@@ -403,9 +403,18 @@ fn parse_command_inner(args: &[String], flags: &Flags) -> Result<Value, ParseErr
|
||||
Ok(json!({ "id": id, "action": "fill", "selector": sel, "value": rest[1..].join(" ") }))
|
||||
}
|
||||
"type" => {
|
||||
// `type --focused <text>` types into whatever element currently has
|
||||
// focus (no selector) — for custom widgets that move focus to a hidden
|
||||
// input after you open them.
|
||||
if rest.first() == Some(&"--focused") {
|
||||
return Ok(json!({
|
||||
"id": id, "action": "type", "focused": true,
|
||||
"text": rest[1..].join(" "),
|
||||
}));
|
||||
}
|
||||
let sel = rest.first().ok_or_else(|| ParseError::MissingArguments {
|
||||
context: "type".to_string(),
|
||||
usage: "type <selector> <text>",
|
||||
usage: "type <selector> <text> (or: type --focused <text>)",
|
||||
})?;
|
||||
Ok(json!({ "id": id, "action": "type", "selector": sel, "text": rest[1..].join(" ") }))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user