agent-zero/plugins
frdel 80518f22a6 Squashed commit of the following:
commit 5193ef7501
Author: frdel <38891707+frdel@users.noreply.github.com>
Date:   Tue Mar 31 09:47:02 2026 +0200

    refactor: change default mode from dedicated to self-chat and reorder UI settings

    - Change default mode to self-chat across all modules
    - Update README to reflect self-chat as primary mode with security warning
    - Move session/media storage from usr/whatsapp to tmp/whatsapp
    - Reorder config UI: move Mode above Allowed Numbers
    - Add warning banner when allowed_numbers is empty in self-chat mode
    - Move Bridge Port and Poll Interval to bottom of settings
    - Update mode descriptions to clarify self-chat handles both self

commit 9fece911b5
Author: frdel <38891707+frdel@users.noreply.github.com>
Date:   Tue Mar 31 09:20:35 2026 +0200

    refactor: centralize WhatsApp storage paths and improve bridge dependency handling

    - Add storage_paths.py helper for consistent session/media/runtime paths
    - Replace hardcoded usr/whatsapp paths across all modules
    - Fix bridge lock to be event-loop-aware (recreate per loop)
    - Add automatic dependency reinstall on startup failures
    - Track bridge startup output for better error diagnostics
    - Add dependency state tracking with package.json hash validation
    - Implement force reinstall when node_modules appears

commit bc511d221d
Author: linuztx <linuztx@gmail.com>
Date:   Tue Mar 31 09:07:46 2026 +0800

    fix: stop poll loop immediately when Node.js is not installed

commit a9554e132f
Author: linuztx <linuztx@gmail.com>
Date:   Tue Mar 31 08:49:15 2026 +0800

    fix: auto-reinstall corrupt node_modules and stop poll loop after repeated bridge failures

    _ensure_npm_install now verifies key package exists, not just
    node_modules dir. Wipes and reinstalls if corrupt.

    Poll loop stops after 5 consecutive bridge start failures instead
    of spamming errors and making A0 unusable.

commit 61fa1bf487
Author: linuztx <linuztx@gmail.com>
Date:   Tue Mar 31 08:38:51 2026 +0800

    fix: move allowed_numbers filtering from JS bridge to Python handler

    The JS bridge used LIDs (internal WhatsApp identifiers) for sender
    matching which never matched actual phone numbers. Moved filtering
    to Python handler.py where config is read fresh each poll cycle.

    - Add senderNumber (resolved phone) to bridge message payload
    - Filter in poll_messages() with normalized number comparison
    - Remove --allowed-numbers CLI arg and JS-side filtering
    - Fix ensure_bridge_http_up not recording _bridge_config
    - Fix falsy empty-dict check in bridge restart detection

commit 64ee177897
Author: linuztx <linuztx@gmail.com>
Date:   Sat Mar 28 23:34:23 2026 +0800

    refactor: move email agent instructions to system prompt and update prompt labels

commit 0f53b41d80
Author: linuztx <linuztx@gmail.com>
Date:   Sat Mar 28 10:59:44 2026 +0800

    Add node_modules to gitignore

commit eb6a4d3ad2
Author: linuztx <linuztx@gmail.com>
Date:   Sat Mar 28 10:53:59 2026 +0800

    Add WhatsApp plugin thumbnail

commit 39bed4f538
Author: linuztx <linuztx@gmail.com>
Date:   Sat Mar 28 10:51:47 2026 +0800

    refactor: rename allowed_users to allowed_numbers across plugin

commit e4991b6e6e
Author: linuztx <linuztx@gmail.com>
Date:   Fri Mar 27 21:58:29 2026 +0800

    improve: move agent instructions from per-message to system prompt

commit 4f1be15fa7
Author: linuztx <linuztx@gmail.com>
Date:   Fri Mar 27 21:00:25 2026 +0800

    improve: add macOS port kill support and bridge process destructor cleanup

commit f5349753d7
Author: linuztx <linuztx@gmail.com>
Date:   Fri Mar 27 17:09:56 2026 +0800

    improve: remove redundant bridge_manager from execute, rely on poll loop finally

commit 9d9dd4bd7f
Author: linuztx <linuztx@gmail.com>
Date:   Fri Mar 27 14:41:14 2026 +0800

    fix: stop bridge and poll loop when plugin is disabled or toggled off

commit 66b0a7d3e0
Author: linuztx <linuztx@gmail.com>
Date:   Fri Mar 27 11:05:58 2026 +0800

    improve: fix allowed users input, auto-strip + prefix, log ignored messages

commit 938e7b9312
Author: linuztx <linuztx@gmail.com>
Date:   Thu Mar 26 23:26:42 2026 +0800

    improve: add line break to allowed users description

commit 4ef64b9121
Author: linuztx <linuztx@gmail.com>
Date:   Thu Mar 26 22:44:55 2026 +0800

    feat: convert markdown to WhatsApp formatting before sending replies

commit f549b49f44
Author: linuztx <linuztx@gmail.com>
Date:   Thu Mar 26 22:34:56 2026 +0800

    improve: add progress update instructions to system context prompt

commit 66e5d51dcf
Author: linuztx <linuztx@gmail.com>
Date:   Thu Mar 26 22:23:32 2026 +0800

    fix: stop typing indicator on agent error or generation failure

commit 3dd01cd04c
Author: linuztx <linuztx@gmail.com>
Date:   Thu Mar 26 18:31:38 2026 +0800

    improve: persistent typing indicator with poll-based refresh

commit 8d0ec86f15
Author: linuztx <linuztx@gmail.com>
Date:   Thu Mar 26 17:11:25 2026 +0800

    Update README.md

commit e664673c1c
Author: linuztx <linuztx@gmail.com>
Date:   Thu Mar 26 16:05:44 2026 +0800

    feat: add agent prefix to self-chat replies for visual distinction

commit 18c5716d10
Author: linuztx <linuztx@gmail.com>
Date:   Thu Mar 26 15:43:01 2026 +0800

    fix: clear typing indicator after sending reply in self-chat mode

commit 7c653c9d56
Author: linuztx <linuztx@gmail.com>
Date:   Thu Mar 26 14:43:06 2026 +0800

    improve: merge WhatsApp Link and Disconnect into single Account field

commit 57c95e6f13
Author: linuztx <linuztx@gmail.com>
Date:   Thu Mar 26 14:11:05 2026 +0800

    feat: add disconnect account option to switch WhatsApp accounts

commit c62695356e
Author: linuztx <linuztx@gmail.com>
Date:   Thu Mar 26 14:00:00 2026 +0800

    improve: move mode description inline and reorder Allow Group after Allowed Users

commit 18a56ea446
Author: linuztx <linuztx@gmail.com>
Date:   Thu Mar 26 13:44:17 2026 +0800

    fix: remove duplicate typing indicator before sending reply

commit 44c90a118f
Author: linuztx <linuztx@gmail.com>
Date:   Thu Mar 26 13:30:06 2026 +0800

    improve: remove sender number from DM prompt

commit 64fe7d0302
Author: linuztx <linuztx@gmail.com>
Date:   Thu Mar 26 13:17:29 2026 +0800

    fix: handle documentWithCaptionMessage wrapper for captioned documents

commit 00b6657185
Author: linuztx <linuztx@gmail.com>
Date:   Thu Mar 26 13:06:40 2026 +0800

    feat: add attachment reader/writer with RFC and download all media types

commit 8041c085d2
Author: linuztx <linuztx@gmail.com>
Date:   Thu Mar 26 11:45:17 2026 +0800

    improve: update group prompt and reply instructions

commit 71a6eb7557
Author: linuztx <linuztx@gmail.com>
Date:   Thu Mar 26 11:26:36 2026 +0800

    feat: reply to specific messages in group chats with quote

commit 6bf63eb9c6
Author: linuztx <linuztx@gmail.com>
Date:   Thu Mar 26 09:57:34 2026 +0800

    feat: detect replies to bot messages in group chats

commit b4492e0759
Author: linuztx <linuztx@gmail.com>
Date:   Thu Mar 26 09:20:27 2026 +0800

    improve: resolve group names and sender LIDs in bridge messages

commit 14e673f165
Author: linuztx <linuztx@gmail.com>
Date:   Thu Mar 26 04:44:50 2026 +0800

    feat: add allow_group toggle to respond only when mentioned in group chats

commit 40f4884319
Author: linuztx <linuztx@gmail.com>
Date:   Thu Mar 26 03:20:02 2026 +0800

    refactor: rename mode value from bot to dedicated

commit 50af7c2bde
Author: linuztx <linuztx@gmail.com>
Date:   Thu Mar 26 02:34:51 2026 +0800

    fix: kill orphaned bridge process on port before starting new one

commit 45b21c093a
Author: linuztx <linuztx@gmail.com>
Date:   Thu Mar 26 02:07:45 2026 +0800

    improve: auto-restart bridge when config changes

commit a12183ba6e
Author: linuztx <linuztx@gmail.com>
Date:   Thu Mar 26 01:39:55 2026 +0800

    feat: add bot and self-chat mode selection for WhatsApp bridge

commit bb8961ab73
Author: linuztx <linuztx@gmail.com>
Date:   Thu Mar 26 00:56:56 2026 +0800

    improve: send typing indicator immediately on message receive

commit 84c12b0c23
Author: linuztx <linuztx@gmail.com>
Date:   Thu Mar 26 00:29:04 2026 +0800

    feat: add WhatsApp integration plugin with Baileys bridge and QR pairing
2026-03-31 09:47:25 +02:00
..
_browser_agent browser_agent: --no-sandbox flag; OpenRouter/sanitize helpers 2026-03-25 21:18:28 +01:00
_chat_branching refactor(chat_branching): ID-based log ↔ history linking for precise branch trimming 2026-03-24 03:04:09 -07:00
_chat_compaction fix: add thumbnail to chat compaction plugin 2026-03-26 17:15:59 -03:00
_code_execution refactor(chat_branching): ID-based log ↔ history linking for precise branch trimming 2026-03-24 03:04:09 -07:00
_email_integration Squashed commit of the following: 2026-03-31 09:47:25 +02:00
_error_retry refactor(chat_branching): ID-based log ↔ history linking for precise branch trimming 2026-03-24 03:04:09 -07:00
_infection_check refactor(chat_branching): ID-based log ↔ history linking for precise branch trimming 2026-03-24 03:04:09 -07:00
_memory Remove memory quick action extension, increase header icons dropdown shadow 2026-03-24 19:37:33 +01:00
_model_config Squashed commit of the following: 2026-03-30 17:19:33 +02:00
_onboarding onboarding thumbnail 2026-03-30 09:43:05 +02:00
_plugin_installer Sanitize print logs; refactor popular plugin logic 2026-03-30 11:50:59 +02:00
_plugin_scan Remove scan queue and enable parallel plugin scans 2026-03-28 18:52:17 +01:00
_plugin_validator plugins: update docs and skills for extensible refactor 2026-03-23 03:42:10 +01:00
_promptinclude refactor: replace PathSpec "gitignore" pattern type with "gitwildmatch" 2026-03-22 21:50:13 +01:00
_telegram_integration Squashed commit of the following: 2026-03-31 09:47:25 +02:00
_text_editor Merge pull request #1293 from linuztx/refactor-split-system-prompt 2026-03-22 17:00:07 +01:00
_whatsapp_integration Squashed commit of the following: 2026-03-31 09:47:25 +02:00
README.md plugins: update docs and skills for extensible refactor 2026-03-23 03:42:10 +01:00

Agent Zero - Core Plugins

This directory contains the system-level plugins bundled with Agent Zero.

Directory Structure

  • plugins/: Core system plugins. Reserved for framework updates — do not place custom plugins here.
  • usr/plugins/: The correct location for all user-developed and custom plugins. This directory is gitignored.

Documentation

For detailed guides on how to create, extend, or configure plugins, refer to:

What a Plugin Can Provide

Plugins are automatically discovered based on the presence of a plugin.yaml file. Each plugin can contribute:

  • Backend: API handlers, tools, helpers, named lifecycle extensions, and implicit @extensible hooks under extensions/python/_functions/...
  • Frontend: HTML/JS UI contributions via core extension breakpoints
  • Settings: Isolated configuration scoped per-project and per-agent profile
  • Activation: Global and scoped ON/OFF rules via .toggle-1 and .toggle-0 files, including advanced per-scope switching in the WebUI
  • Agent profiles: Plugin-distributed subagent definitions under agents/<profile>/agent.yaml

Backend extension layouts:

  • extensions/python/<point>/ for named lifecycle hooks
  • extensions/python/_functions/<module>/<qualname>/<start|end>/ for implicit @extensible hooks

Do not use the retired flattened extensions/python/<module>_<qualname>_<start|end>/ form.

Plugin Manifest

Every plugin requires a plugin.yaml at its root:

name: my_plugin              # required for community plugins
title: My Plugin
description: What this plugin does.
version: 1.0.0
settings_sections:
  - agent
per_project_config: false
per_agent_config: false
always_enabled: false

Plugin Script (execute.py)

Plugins can include an optional execute.py at the plugin root for user-triggered operations such as setup, post-install steps, maintenance, repairs, migrations, or resource refreshes. Users trigger it from the Plugin List UI.

Guidelines:

  • Treat it as a manual plugin script, not as the primary way to use the plugin
  • Prefer making it safe to rerun, or detect state and explain why a rerun is not appropriate
  • Return 0 on success and print progress messages for user feedback
  • Use hooks.py instead when the behavior is framework-internal or should happen automatically

Runtime Hooks (hooks.py)

Plugins can also include an optional hooks.py at the plugin root. The framework loads it on demand and can call exported hook functions by name through helpers.plugins.call_plugin_hook(...).

  • hooks.py runs inside the Agent Zero framework runtime and Python environment.
  • Use it for framework-internal work such as install hooks, cache preparation, registration, or filesystem setup.
  • If it runs sys.executable -m pip install ..., packages are installed into the same Python environment that runs Agent Zero.
  • If you need to install into the separate agent runtime or into the system environment, explicitly target that environment from a subprocess by selecting the correct interpreter, virtualenv, or package manager.

In Docker, hooks.py normally affects /opt/venv-a0; the agent execution runtime is /opt/venv.

Plugin Index & Community Sharing

The Plugin Index at https://github.com/agent0ai/a0-plugins is the community-maintained registry of plugins available to all Agent Zero users.

To share a plugin with the community:

  1. Create a standalone GitHub repository with the plugin contents at the repo root. The runtime plugin.yaml must include a name field matching the intended index folder name. Add a LICENSE file at the repo root (required for Plugin Index listings so users have explicit terms of use).
  2. Fork https://github.com/agent0ai/a0-plugins and add a folder plugins/<your_plugin_name>/ containing a separate index manifest named index.yaml (not plugin.yaml):
title: My Plugin
description: What this plugin does.
github: https://github.com/yourname/your-plugin-repo
tags:
  - tools

Optional additional fields: screenshots (up to 5 image URLs).

  1. Open a Pull Request. CI validates the submission; a maintainer reviews and merges.

Note: The index index.yaml is a different file with a different schema from the runtime plugin.yaml. Folder names use ^[a-z0-9_]+$ (underscores, no hyphens) and must match the name field in the remote plugin.yaml exactly.

Plugin Hub

Agent Zero now includes a built-in Plugin Hub flow through the always-enabled Plugin Installer plugin. From the Plugins dialog, users can either open the Browse tab or click Install, which opens the installer modal on its own Browse tab.

The Plugin Hub surfaces Plugin Index entries directly in the UI and lets users search, filter, inspect, and install community plugins without leaving Agent Zero.