Commit Graph

114 Commits

Author SHA1 Message Date
Adrià Arrufat
0338bf71af refactor: simplify mcp communication and tool dispatching 2026-05-11 08:57:36 +02:00
Adrià Arrufat
10f7478099 refactor: unify tool arg parsing and simplify string formatting 2026-05-10 17:07:57 +02:00
Adrià Arrufat
e7d6597e08 refactor: unify URL handling and clean up agent logic 2026-05-10 00:04:51 +02:00
Adrià Arrufat
a5e7ec16be agent: unify interactive prompts and tool execution 2026-05-09 20:40:38 +02:00
Adrià Arrufat
1de98efbc4 agent: simplify model string ownership 2026-05-09 20:27:16 +02:00
Adrià Arrufat
5284abc3e7 agent: consolidate listModels logic into Agent.zig 2026-05-09 20:18:27 +02:00
Adrià Arrufat
938795ec8d agent: add --pick-model for interactive selection 2026-05-09 20:11:52 +02:00
Adrià Arrufat
16b83f5093 agent: add provider auto-detection and --no-llm flag 2026-05-09 19:52:42 +02:00
Adrià Arrufat
2b4e69b517 refactor: improve recorder and spinner state management
Moves recording state into Recorder and uses a tagged union for Spinner
state. Introduces TurnInput to simplify Agent turn processing.
2026-05-09 18:05:52 +02:00
Adrià Arrufat
5b5e42cbaa refactor: optimize string building and unify text extraction 2026-05-09 17:47:28 +02:00
Adrià Arrufat
372c0a12a2 agent: simplify logic and cleanup comments 2026-05-08 08:23:19 +02:00
Adrià Arrufat
622d408d03 mcp: add verification to script_step 2026-05-07 20:18:37 +02:00
Adrià Arrufat
c6ccd83ac4 mcp: add pandascript recording and self-healing tools
Adds tools to record sessions and heal scripts over MCP. Refactors
shared logic to `script.zig` and adds a TTY spinner for the agent.
2026-05-07 20:11:40 +02:00
Adrià Arrufat
7bf69a9a34 agent: remove integrated mcp server
Removes the `--mcp` flag and the internal `task` tool from the agent.
Users should use `lightpanda mcp` for external agent integrations.
2026-05-07 17:12:46 +02:00
Adrià Arrufat
16e61e342e terminal: simplify spinner access and organize ansi codes 2026-05-07 16:38:11 +02:00
Adrià Arrufat
a254e4041a agent: refine verbosity levels and tool output UI 2026-05-07 16:11:28 +02:00
Adrià Arrufat
54d873e007 agent: add proactive login and silence tool errors 2026-05-07 15:51:18 +02:00
Adrià Arrufat
598a3b984b agent: add status spinner for AI turns
Adds a visual spinner to the REPL to indicate agent activity (thinking
or tool execution). Refactors terminal output to prevent interleaving
with spinner frames.
2026-05-07 15:25:26 +02:00
Adrià Arrufat
8e9e82b478 cli: support short flags and hide tool results in REPL 2026-05-07 14:22:26 +02:00
Adrià Arrufat
0de602695f refactor: rename buildJson to stringifyJson and clean up logic
- Rename `Command.buildJson` to `stringifyJson` for clarity.
- Flatten tool call recording loop in `Agent.zig` to reduce nesting.
- Extract `parseValue` helper in `tools.zig` to reduce duplication.
- Optimize `substituteEnvVars` by skipping redundant string scans.
2026-05-07 11:00:33 +02:00
Adrià Arrufat
02ae92d619 agent: remove unused code and add recorder guard 2026-05-07 10:34:14 +02:00
Adrià Arrufat
7fb0251fff agent: simplify verification and provider checks
Removes pre-state tracking and click verification from the agent.
Consolidates provider requirement validation logic and optimizes
`applyReplacements` by pre-calculating memory capacity.
2026-05-07 10:04:35 +02:00
Adrià Arrufat
bf172bd811 refactor: consolidate browser tool helpers and optimize logic
- Extract `awaitQueuedNavigation` and `mapActionError` in `tools.zig`.
- Optimize `substituteEnvVars` using `indexOfScalarPos` to reduce copies.
- Switch to `parseFromSliceLeaky` for tool arguments parsing.
- Improve error handling in `Agent.zig` self-healing and `Recorder.zig`.
- Simplify `callEval` by adding `evalScript` helper.
2026-05-07 09:52:43 +02:00
Adrià Arrufat
5bcf90a8f9 perf: optimize terminal json parsing and env var substitution
- Skip JSON parsing in Terminal for non-JSON tool results to avoid unnecessary allocations.
- Simplify `$LP_` environment variable detection in tools.
- Update documentation comments in Agent for clarity.
2026-05-07 09:41:47 +02:00
Adrià Arrufat
87d0bc95dc agent: modularize script runner and simplify terminal state 2026-05-07 09:35:08 +02:00
Adrià Arrufat
92a0f0e290 refactor: reorder tool arguments and optimize env substitution
- Reorder `arena` and `session` arguments in tool functions.
- Optimize `substituteEnvVars` to only process `$LP_` prefixes.
- Use stack buffer for backup paths in `Agent.zig`.
- Clean up `formatActionResult` implementation.
2026-05-07 09:25:36 +02:00
Adrià Arrufat
1dc4262478 terminal: pretty-print tool results in REPL 2026-05-07 08:46:49 +02:00
Adrià Arrufat
93d08a486b agent: add --verbosity flag to control stderr output 2026-05-07 08:15:51 +02:00
Adrià Arrufat
1be0efece6 agent: update /help syntax to show optional argument 2026-05-06 19:26:38 +02:00
Adrià Arrufat
71616046fb terminal: add slash command hints and help completions
Adds argument syntax hints (e.g. <req> [opt]) for slash commands in the
REPL and implements tab completion for /help command arguments.
2026-05-06 15:28:57 +02:00
Adrià Arrufat
32b3fb08fb agent: reduce allocations and reuse buffers 2026-05-05 11:22:12 +02:00
Adrià Arrufat
431e3d6a84 tools: use error unions for tool args and script replacements 2026-05-05 11:14:02 +02:00
Adrià Arrufat
749719fa66 agent: pass attachments explicitly to message processing 2026-05-05 11:04:10 +02:00
Adrià Arrufat
532dd593da agent: move tool ownership to ToolExecutor 2026-05-05 10:40:31 +02:00
Adrià Arrufat
f84d830ff6 agent: use enum tag for eval tool name 2026-05-05 10:36:46 +02:00
Adrià Arrufat
b3cd77b4b4 agent: unify LLM turn execution into runTurn 2026-05-05 09:44:56 +02:00
Adrià Arrufat
0f2aa3c273 agent: simplify JSON parsing in extractEvalScript 2026-05-05 09:31:57 +02:00
Adrià Arrufat
f0a859514c agent: extract synthesis prompt and clean up comments 2026-05-05 09:13:03 +02:00
Adrià Arrufat
d5f9f12de8 agent: use zenai for provider defaults and api keys 2026-05-05 08:40:34 +02:00
Adrià Arrufat
976d188820 agent: use dupeMessages from zenai library 2026-05-05 08:33:43 +02:00
Adrià Arrufat
80075efd6b agent: centralize session and node registry resets 2026-05-05 08:16:01 +02:00
Adrià Arrufat
c0491bd69e agent: clean up and optimize code
- Fix typo in REPL info message.
- Optimize Recorder to avoid unnecessary allocations.
- Simplify field type detection in SlashCommand using stringToEnum.
- Remove unused yellow ANSI constant in Terminal.
- Shorten log message in McpServer.
2026-05-04 10:51:41 +02:00
Adrià Arrufat
03d883b263 agent: improve script healing atomicity and error handling 2026-05-04 10:41:46 +02:00
Adrià Arrufat
804b596d5b agent: block navigation and eval during self-heal
Restricts self-heal turns to only allow page-local commands. Commands
like `goto` and `eval_js` are now ignored to prevent the model from
navigating away or executing arbitrary scripts during healing.
2026-05-04 10:21:31 +02:00
Adrià Arrufat
fba00e33cc agent: ensure atomic message pruning 2026-05-04 10:14:27 +02:00
Adrià Arrufat
eb14783af7 agent: rename Pandascript to PandaScript and .panda to .lp 2026-04-30 17:29:36 +02:00
Adrià Arrufat
300fdfb34c agent: add MCP server mode with task tool 2026-04-30 17:11:48 +02:00
Adrià Arrufat
7aef08f28b agent: replace QUIT command with /quit slash command 2026-04-30 16:22:19 +02:00
Adrià Arrufat
ec8d53d684 agent: rename exit to quit and remove command aliases 2026-04-30 16:06:05 +02:00
Adrià Arrufat
44311c20aa agent: add REPL completion hint 2026-04-30 15:57:22 +02:00