Commit Graph

25 Commits

Author SHA1 Message Date
Adrià Arrufat
a5fd70f5dd refactor: improve tool execution and terminal formatting
- Standardize `fill` tool to use `value` instead of `text`.
- Add formatted output methods (`printInfoFmt`, `printErrorFmt`) to `Terminal`.
- Improve error handling in `ToolExecutor` and `browser/tools` by using error unions.
- Deduplicate `minify` utility and remove redundant code comments.
- Refactor tool dispatch to use `Action` enum tags instead of hardcoded strings.
2026-04-10 14:54:51 +02:00
Adrià Arrufat
d1b429655f tools: add selector support for hover, select, and check actions 2026-04-10 14:15:55 +02:00
Adrià Arrufat
d0c36f7e3e terminal: add persistent REPL history
Persists REPL history to .lp-history, except in script mode.
2026-04-10 11:59:55 +02:00
Adrià Arrufat
81413d9291 agent: add scroll command and improve script reliability
Adds the SCROLL command and ensures WAIT actions are recorded.
Refactors TYPE to use the fill tool, adds self-heal retries, and
propagates agent failures to the process exit code.
2026-04-10 11:45:14 +02:00
Adrià Arrufat
7aa11c7006 agent: update CLI args and refactor code 2026-04-09 17:51:56 +02:00
Adrià Arrufat
61fd69eaae agent: improve script recording logic and formatting 2026-04-09 16:51:54 +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
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
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
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