Commit Graph

30 Commits

Author SHA1 Message Date
Adrià Arrufat
9a8ad8951f agent: rename missing tool calls to semanticTree and eval 2026-04-09 17:08:35 +02:00
Adrià Arrufat
a1ef413a9a Terminal: add command completion and hints 2026-04-09 17:02:31 +02:00
Adrià Arrufat
61fd69eaae agent: improve script recording logic and formatting 2026-04-09 16:51:54 +02:00
Adrià Arrufat
286976a7c7 browser: centralize tool definitions 2026-04-09 16:07:05 +02:00
Adrià Arrufat
d2a4d388b1 agent: consolidate findNodeIdByText tests 2026-04-08 19:29:54 +02:00
Adrià Arrufat
ad13eb76e2 agent: improve element lookup in CommandExecutor
Replaces heuristic string search with JSON parsing and case-insensitive
matching across multiple fields. Adds unit tests for verification.
2026-04-08 19:21:07 +02:00
Adrià Arrufat
ffb38f268b agent: add --self-heal flag to control self-healing 2026-04-08 18:15:34 +02:00
Adrià Arrufat
8d3d3a2c67 agent: improve command parsing and selector reliability
- Support single quotes in commands for nested CSS selectors.
- Mask password values in interactive element output.
- Update system prompt and recorder for better reproducibility.
- Try CSS selectors first in click actions.
2026-04-08 18:10:04 +02:00
Adrià Arrufat
c242e324f3 browser: auto-resolve env vars in fill tool 2026-04-08 17:17:23 +02:00
Adrià Arrufat
b8ae185cad tools: support CSS selectors for click and fill actions 2026-04-08 16:56:10 +02:00
Adrià Arrufat
796a17ff81 agent: update default AI models 2026-04-08 16:35:10 +02:00
Adrià Arrufat
3cc46f10e2 agent: remove unused allocator from findNodeIdByText 2026-04-08 11:00:00 +02:00
Adrià Arrufat
91264c4995 agent: use zenai.provider.Client directly 2026-04-08 10:34:34 +02:00
Adrià Arrufat
a147f91acc agent: add explicit type to url variable 2026-04-08 08:37:52 +02:00
Adrià Arrufat
bfe223c8ad agent: simplify client init and tool execution 2026-04-08 08:33:08 +02:00
Adrià Arrufat
1aca921327 agent: use Command union for recording 2026-04-08 08:20:06 +02:00
Adrià Arrufat
fa14b0865c agent: use runTools for tool execution loop 2026-04-07 10:13:43 +02:00
Adrià Arrufat
adabc24897 agent: add ollama provider and base-url support 2026-04-07 08:55:33 +02:00
Adrià Arrufat
3fde7fb6b5 Config: remove --api-key CLI flag 2026-04-07 08:34:15 +02:00
Adrià Arrufat
048cb46950 Refactor: extract shared tool execution layer from MCP and agent
Both MCP tools.zig and agent ToolExecutor.zig duplicated the same 20 tool
handlers. This extracts the shared logic into src/browser/tools.zig so new
tools only need to be added once. Reduces total code by ~620 lines while
keeping all 465 tests passing.
2026-04-07 08:05:36 +02:00
Adrià Arrufat
9a442ac5f1 agent: add new browser interaction tools
Adds hover, press, selectOption, setChecked, and findElement tools.
Increases backendNodeId search window in CommandExecutor to 500.
2026-04-07 07:46:40 +02:00
Adrià Arrufat
1f75ce1778 agent: add unit tests for Command, CommandExecutor, and Recorder 2026-04-04 08:28:56 +02:00
Adrià Arrufat
7aabda9392 agent: add recorder, self-healing, env substitution, and security fixes
- Add Recorder for recording REPL sessions to .panda files, with
  --no-record flag and positional file arg support. Skips read-only
  commands (WAIT, TREE, MARKDOWN) per spec.
- Record resolved LLM tool calls as Pandascript commands so the
  generated artifact is deterministic.
- Add self-healing in --run mode: on command failure, prompt the LLM
  with the # INTENT context to resolve an alternative.
- Add LOGIN and ACCEPT_COOKIES high-level commands (LLM-resolved).
- Add multi-line EVAL """...""" support via ScriptIterator.
- Add $VAR_NAME environment variable substitution in command arguments.
- Escape JS strings in execType/execExtract to prevent injection.
- Sanitize output file paths in EXTRACT to prevent path traversal.
2026-04-04 08:14:48 +02:00
Adrià Arrufat
e29f33642c agent: add --run command for deterministic script replay 2026-04-04 07:56:10 +02:00
Adrià Arrufat
d94effb237 agent: improve tool call detection and logging 2026-04-04 07:56:10 +02:00
Adrià Arrufat
3b1ef66b51 agent: add markdown command 2026-04-04 07:56:10 +02:00
Adrià Arrufat
15c0a7be83 agent: add manual command support to REPL
Adds a parser and executor for manual commands like GOTO and CLICK.
Unrecognized input continues to be processed by the AI.
2026-04-04 07:56:10 +02:00
Adrià Arrufat
a5d3d686b8 agent: use arena allocators for messages and tools 2026-04-04 07:56:10 +02:00
Adrià Arrufat
20c31a3f71 agent: remove bold formatting from prompt 2026-04-04 07:56:10 +02:00
Adrià Arrufat
a81a24229b Add interactive agent mode with LLM-powered web browsing
Introduces `lightpanda agent` command that provides a REPL where users
can chat with an AI that uses the browser's tools (goto, markdown, click,
fill, etc.) to browse the web. Uses zenai for multi-provider LLM support
(Anthropic, OpenAI, Gemini) and linenoise v2 for terminal line editing.
2026-04-04 07:56:10 +02:00