Commit Graph

26 Commits

Author SHA1 Message Date
Adrià Arrufat
a3eeec0b26 agent: use global tools and simplify meta commands
- Initialize tools once globally instead of allocating per-agent.
- Refactor meta commands to use an enum for cleaner dispatch.
- Remove unused `findSchemaCanonical` and simplify command parsing.
2026-05-21 23:24:21 +02:00
Adrià Arrufat
13ebb9e802 agent: simplify command, schema, and repl logic
- Remove `input_schema_raw` from `SchemaInfo` and use `parameters` directly
- Simplify JSON field extraction in `Verifier` to avoid `parseArgs`
- Refactor REPL command splitting and environment substitution
- Clean up and condense comments across the codebase
2026-05-21 22:39:58 +02:00
Adrià Arrufat
8cf431b771 agent: remove ToolExecutor abstraction
Inlines the browser, session, and node registry management directly
into Agent. Updates CommandRunner to use Session and Registry directly,
and calls browser_tools.call without the ToolExecutor wrapper.
2026-05-21 22:02:27 +02:00
Adrià Arrufat
d16f8a032e script: support triple-quoted strings and optimize lookups
- Add support for triple-quoted strings (''' and """) in the tokenizer
  and quote stripper.
- Avoid allocations in `stripQuotes` by returning slices.
- Optimize schema lookups using O(1) enum-based canonical resolution.
- Skip env var substitution if "$LP_" is not present in the string.
2026-05-21 21:33:05 +02:00
Adrià Arrufat
7f60d73338 use global schemas and enum-based tool matching
- Use `SlashCommand.globalSchemas()` instead of passing schemas around.
- Use `browser_tools.Action` enums for tool matching in Agent and Verifier.
- Optimize string substitution and quote stripping with early exits.
2026-05-21 21:08:02 +02:00
Adrià Arrufat
459893f414 script: unify PandaScript to slash commands
Unifies PandaScript syntax by replacing uppercase keywords with slash
commands (e.g., `/goto`, `/click`, `/fill`). Refactors the `Command`
representation to use a generic tool call structure backed by schemas.

BREAKING CHANGE: Uppercase PandaScript keywords (GOTO, CLICK, TYPE, etc.)
are no longer supported. All scripts must use slash commands.
2026-05-21 20:38:21 +02:00
Adrià Arrufat
74ba2fb6bd agent: reuse ToolExecutor.buildTools in SlashCommand tests 2026-05-19 12:03:50 +02:00
Adrià Arrufat
2ca26c8bbf agent: simplify slash command test helpers 2026-05-19 11:51:33 +02:00
Adrià Arrufat
373920841c agent: add /verbosity slash command 2026-05-15 10:51:21 +02:00
Adrià Arrufat
b2454a9190 chore: add license headers to source files 2026-05-13 13:20:36 +02:00
Adrià Arrufat
f35c4219c9 refactor: improve error handling and rename Self to Agent
- Replace `unreachable` with explicit error returns in Agent and Executor.
- Add `EvalResult.err` helper in `tools.zig` to simplify error paths.
- Improve error propagation in `SlashCommand` and `Recorder`.
- Rename `Self` to `Agent` for better clarity in function signatures.
2026-05-13 13:15:44 +02:00
Adrià Arrufat
11fb6a3f6e agent: improve slash command parsing and spinner logic
- Use `SlashCommand.splitNameRest` for cleaner command handling.
- Centralize `max_hint_slots` constant and add assertions.
- Refactor `Spinner` thread management and rendering code.
2026-05-12 11:58:24 +02:00
Adrià Arrufat
619e99d803 repl: add progressive argument hints for commands 2026-05-12 10:57:27 +02:00
Adrià Arrufat
82f6b4c002 terminal: improve repl completion and highlighting 2026-05-11 17:52:49 +02:00
Adrià Arrufat
98b082ddc1 terminal: improve REPL prompt, completion, and highlighting
- Cache environment variable names to improve completion performance.
- Refactor terminal styles into constants.
- Move `isAllUpper` to `string.zig` and `meta_names` to `SlashCommand.zig`.
- Align quoted string scanning logic with the slash command parser.
2026-05-11 17:52:49 +02:00
Adrià Arrufat
b5777ce35c agent: support listing LP_* variables in getEnv 2026-05-11 12:34:36 +02:00
Adrià Arrufat
aae699e3b5 refactor: simplify MCP tool results and optimize slash command
Consolidates MCP tool listing and result sending. Optimizes buffer
allocation in SlashCommand.stripQuotes.
2026-05-10 17:22:33 +02:00
Adrià Arrufat
02ae92d619 agent: remove unused code and add recorder guard 2026-05-07 10:34:14 +02:00
Adrià Arrufat
c7c6d08f18 terminal: improve slash command hint logic 2026-05-06 19:22:20 +02:00
Adrià Arrufat
845ef6ac3b terminal: use bitmask to track used slash command fields 2026-05-06 19:11:23 +02:00
Adrià Arrufat
b8ebe6fa11 terminal: improve slash command completion and hinting 2026-05-06 17:59:47 +02:00
Adrià Arrufat
9690164514 terminal: add tab-completion for slash command keys 2026-05-06 16:39:21 +02:00
Adrià Arrufat
248c04239d agent: dynamic slash command hints and improved parsing 2026-05-06 15:52:31 +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
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
a6059c77f9 agent: add slash commands for manual tool execution 2026-04-28 18:51:52 +02:00