[Feature] Add a keyboard action — some search boxes have no submit button and require Enter
Feature Description / 功能描述
Problem
Some search boxes have no submit button — the only way to trigger the search/submit is pressing Enter in the field. The agent can't do that.
input_text sets the value and fires an input event, but never dispatches keydown / keyup, so on these pages the text goes in and the search never runs. There is no alternative: there's no button to click, and select_dropdown_option only works on a native <select>. send_keys is still a @todo in packages/core/src/tools/index.ts, and none of the current tools (click / input_text / select_dropdown_option / scroll / execute_javascript) can produce a keystroke.
Example
An Element Plus search input with no submit button next to it:
<input class="el-input__inner" type="text" autocomplete="off"
placeholder="账号">The agent types the query, the value appears, and then it has no way to confirm it — the dropdown/search is triggered by Enter only. It usually ends up retrying input_text or reporting success on a page that never changed.
Note the prompt already tells the model to "press enter ... for completion" (system_prompt.md), so it tries to use a capability that doesn't exist.
Suggestion
Add a keyboard tool, e.g. press_key(index, key), with Enter at minimum (Escape, Tab and arrow keys would be useful too). It would also need to be added to the extension's PAGE_CONTROL action whitelist, otherwise the extension build rejects it.
The only workaround today is execute_javascript with a manually dispatched KeyboardEvent, which pushes framework-specific event details onto the LLM and doesn't generalize.
Before submitting
- I will be polite and respectful. / 我会保持礼貌与尊重。
- I have read the CODE_OF_CONDUCT.md and CONTRIBUTING.md. / 我已阅读行为准则。
- I have searched existing issues and this is not a duplicate.
Source: alibaba/page-agent