Skip to content

agent

Functions

  • agent.add_skill_dirs(dirs) — Register additional skill roots: directories whose immediate subdirectories each hold a SKILL.md. Calls accumulate, and these take precedence over skills found under the prompts directory.
  • agent.add_skill_files(paths) — Register individual SKILL.md files to load as skills. Calls accumulate, and these take precedence over discovered skill roots.
  • agent.append_system_prompt(text) — Set text appended after the base system prompt. The last call wins; takes precedence over ~/.config/wallah/APPEND_SYSTEM.md but not --append-system/--append-system-file.
  • agent.configure_compaction(settings) — Set the context-compaction policy. The last call wins.
  • agent.configure_startup_banner(settings) — Set the startup-banner policy. The last call wins.
  • agent.configure_webfetch(settings) — Set the webfetch policy (SSRF allowances, size cap, timeout). The last call wins.
  • agent.on(name, handler) — Register a handler for a host event (e.g. discover_providers).
  • agent.set_prompts_dir(dir) — Set the directory searched for per-project AGENTS.md prompt files. The last call wins; takes precedence over ~/.config/wallah/prompts.
  • agent.set_system_prompt(system) — Override the base system prompt. The last call wins; takes precedence over ~/.config/wallah/SYSTEM.md but not --system/--system-file.
  • agent.show_confirmation(prompt, options) -> string — Ask the user to choose one of options (e.g. from a tool_call handler, to gate a sensitive call on approval), pausing this Lua call until they answer. Shows an overlay in the TUI; fails with an error when no interactive TUI is running to show it, or options is empty.