You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- python/helpers/plugins.py: Plugin discovery and configuration logic.
97
104
- webui/js/AlpineStore.js: Store factory for reactive frontend state.
98
105
- python/helpers/api.py: Base class for all API endpoints.
106
+
- knowledge/main/about/: Agent self-knowledge files, indexed into the vector DB for runtime recall. Not user-facing docs - written for the agent's internal reference.
99
107
- docs/agents/AGENTS.components.md: Deep dive into the frontend component architecture.
100
108
- docs/agents/AGENTS.modals.md: Guide to the stacked modal system.
101
109
- docs/agents/AGENTS.plugins.md: Comprehensive guide to the full-stack plugin system.
@@ -128,11 +136,13 @@ Key Files:
128
136
- Location: Always develop new plugins in usr/plugins/.
129
137
- Manifest: Every plugin requires a plugin.yaml with name, description, version, and optionally settings_sections, per_project_config, per_agent_config, and always_enabled.
130
138
- Discovery: Conventions based on folder names (api/, tools/, webui/, extensions/).
139
+
- Plugin-local Python imports: Prefer `usr.plugins.<plugin_name>...` for code that lives under `usr/plugins/`. Avoid `sys.path` hacks and avoid symlink-dependent `plugins.<plugin_name>...` imports for community plugins.
131
140
- Runtime hooks: Plugins may also expose hooks in hooks.py, callable by the framework through helpers.plugins.call_plugin_hook(...).
132
141
- Hook runtime: hooks.py executes inside the Agent Zero framework Python environment, so sys.executable -m pip installs dependencies into that same framework runtime.
133
142
- Environment targeting: If a plugin needs packages or binaries for the separate agent execution runtime or system environment, it must explicitly switch environments in a subprocess by targeting the correct interpreter, virtualenv, or package manager.
134
143
- Settings: Use get_plugin_config(plugin_name, agent=agent) to retrieve settings. Plugins can expose a UI for settings via webui/config.html. Plugin settings modals instantiate a local context from $store.pluginSettingsPrototype; bind plugin fields to config.* and use context.* for modal-level state and actions. For plugins wrapping core settings, set context.saveMode = 'core' in x-init.
135
144
- Activation: Global and scoped activation rules are stored as .toggle-1 (ON) and .toggle-0 (OFF). Scoped rules are handled via the plugin "Switch" modal.
145
+
- Cleanup rule: Plugins should not permanently modify the system in ways that outlive the plugin. Deleting a plugin should not leave behind symlinks, unmanaged services, or stray files outside plugin-owned paths unless the user explicitly requested that behavior.
A detailed setup guide for Windows, macOS, and Linux with a video can be found in the Agent Zero Documentation at [this page](./docs/setup/installation.md).
from usr.plugins.my_plugin.helpers.runtime import do_work
56
+
import usr.plugins.my_plugin.helpers.state as state
57
+
```
58
+
59
+
Avoid (DON'T):
60
+
61
+
```python
62
+
# sys.path hacks
63
+
sys.path.insert(0, ...)
64
+
from helpers.runtime import do_work
65
+
66
+
# persistent symlink-based imports
67
+
from plugins.my_plugin.helpers.runtime import do_work
68
+
```
69
+
70
+
Why:
71
+
72
+
-`usr.plugins...` works without renaming `helpers/`
73
+
- it avoids `sys.path` mutation for plugin-local imports
74
+
- it avoids installation-time symlinks into `/a0/plugins/`
75
+
- it keeps plugin removal reversible, with no import wiring left behind
76
+
47
77
### plugin.yaml (runtime manifest)
48
78
49
-
This is the manifest file that lives inside your plugin directory and drives runtime behavior. It is distinct from the index manifest used when publishing to the Plugin Index (see Section 7).
79
+
This is the manifest file that lives inside your plugin directory and drives runtime behavior. It is distinct from the index manifest (`index.yaml`) used when publishing to the Plugin Index (see Section 7).
50
80
51
81
```yaml
82
+
name: my_plugin # required for community plugins (^[a-z0-9_]+$, must match dir name)
52
83
title: My Plugin
53
84
description: What this plugin does.
54
85
version: 1.0.0
@@ -61,6 +92,7 @@ always_enabled: false
61
92
```
62
93
63
94
Field reference:
95
+
- `name`: Plugin identifier. Required by CI when submitting to the Plugin Index. Must be `^[a-z0-9_]+$` and match the index folder name exactly.
64
96
- `title`: UI display name
65
97
- `description`: Short plugin summary
66
98
- `version`: Plugin version string
@@ -69,6 +101,16 @@ Field reference:
69
101
- `per_agent_config`: Enables agent-profile-scoped settings and toggle rules
70
102
- `always_enabled`: Forces ON and disables toggle controls in the UI (reserved for framework use)
71
103
104
+
### execute.py (plugin script)
105
+
106
+
Plugins can include an optional `execute.py` file at the plugin root for user-triggered work such as setup, post-install steps, maintenance, migrations, repair flows, or resource refreshes. It is started manually from the Plugins UI, never automatically, and should print progress while returning `0` on success.
107
+
108
+
Design guidance:
109
+
- use `execute.py` for manual operations the user may need to run again later
110
+
- prefer making it rerunnable or state-aware
111
+
- avoid placing framework-internal automatic behavior here; that belongs in `hooks.py` or lifecycle extensions
112
+
- do not make permanent system modifications that remain after plugin deletion unless the user explicitly asked for them and the plugin also provides a clear cleanup path
113
+
72
114
### hooks.py (framework runtime hooks)
73
115
74
116
Plugins can include an optional `hooks.py` file at the plugin root. Agent Zero loads this module on demand and calls exported functions by name through `helpers.plugins.call_plugin_hook(...)`.
@@ -77,6 +119,7 @@ Plugins can include an optional `hooks.py` file at the plugin root. Agent Zero l
77
119
- Use it for framework-internal operations such as install-time setup, plugin registration work, filesystem preparation, cache updates, or other tasks that need access to Agent Zero internals.
78
120
- Hook functions may be synchronous or async. Async hooks are awaited by the framework.
79
121
- Hook modules are cached until plugin caches are cleared, so changes may require a plugin refresh/reload cycle.
122
+
- Plugin hooks should be cleanup-safe. A plugin should not leave behind permanent system modifications, symlinks, files outside its owned paths, or background services that survive plugin removal unless that behavior is explicitly part of the user-facing contract.
80
123
81
124
Current example: the plugin installer calls `install()` from `hooks.py` after a plugin is copied into place.
82
125
@@ -191,12 +234,13 @@ embedding:
191
234
192
235
The **Plugin Index** is a community-maintained repository at https://github.com/agent0ai/a0-plugins that lists plugins available to the Agent Zero community. Plugins listed there can be discovered and installed by other users.
193
236
194
-
### Two Distinct plugin.yaml Files
237
+
### Two Distinct Manifest Files
195
238
196
-
There are two completely different `plugin.yaml` schemas used at different stages. They must not be confused:
239
+
There are two completely different manifest files used at different stages. They must not be confused:
197
240
198
-
**Runtime manifest** (inside your plugin repo/directory, drives Agent Zero behavior):
241
+
**Runtime manifest** (`plugin.yaml`, inside your plugin repo/directory — drives Agent Zero behavior):
199
242
```yaml
243
+
name: my_plugin # REQUIRED for index submission; must match index folder name
200
244
title: My Plugin
201
245
description: What this plugin does.
202
246
version: 1.0.0
@@ -207,17 +251,19 @@ per_agent_config: false
207
251
always_enabled: false
208
252
```
209
253
210
-
**Index manifest** (submitted to the `a0-plugins` repo under `plugins/<your-plugin-name>/`, drives discoverability only):
254
+
**Index manifest** (`index.yaml`, submitted to the `a0-plugins` repo under `plugins/<your_plugin_name>/` — drives discoverability only):
The index manifest contains only four fields (`title`, `description`, `github`, `tags`) and must not include runtime fields. The `github` field must point to the root of a GitHub repository that itself contains a runtime `plugin.yaml` at the repository root.
266
+
The index manifest is named `index.yaml` (not `plugin.yaml`). Required fields: `title`, `description`, `github`. Optional: `tags` (up to 5), `screenshots` (up to 5 URLs). The `github` field must point to the root of a GitHub repository that contains a runtime `plugin.yaml` at the repository root, and that `plugin.yaml` must include a `name` field matching the index folder name exactly.
221
267
222
268
### Repository Structure for Community Plugins
223
269
@@ -239,23 +285,31 @@ Users install it locally by cloning (or downloading) the repo contents into `/a0
239
285
240
286
### Submitting to the Plugin Index
241
287
242
-
1. Create a GitHub repository for your plugin with the runtime `plugin.yaml` at the repo root.
288
+
1. Create a GitHub repository for your plugin with the runtime `plugin.yaml` (including the `name` field) at the repo root.
243
289
2. Fork `https://github.com/agent0ai/a0-plugins`.
244
-
3. Create a folder `plugins/<your-plugin-name>/` containing only an index `plugin.yaml` (and optionally a square thumbnail image ≤ 20 KB).
290
+
3. Create a folder `plugins/<your_plugin_name>/` containing only an `index.yaml` (and optionally a square thumbnail image ≤ 20 KB).
245
291
4. Open a Pull Request with exactly one new plugin folder.
246
292
5. CI validates the submission automatically. A maintainer reviews and merges.
247
293
248
294
Index submission rules:
249
295
- One plugin per PR
250
-
- Folder name must be unique, stable, lowercase, kebab-case
- Folder name must exactly match the `name` field in your remote `plugin.yaml`
251
298
- Folders starting with `_` are reserved for internal use
252
-
- `github`must point to a public repo that contains `plugin.yaml` at its root
299
+
- `github`must point to a public repo that contains `plugin.yaml` at its root with a matching `name` field
253
300
- `title`max 50 characters, `description` max 500 characters
301
+
- `index.yaml`total max 2000 characters
254
302
- `tags`: optional, up to 5, use recommended tags from https://github.com/agent0ai/a0-plugins/blob/main/TAGS.md
303
+
- `screenshots`: optional, up to 5 full image URLs (png/jpg/webp, each ≤ 2 MB)
304
+
305
+
### Plugin Marketplace
306
+
307
+
The marketplace is provided by the always-enabled `_plugin_installer` plugin. Users can reach it from the **Plugins** dialog in two ways:
255
308
256
-
### Plugin Marketplace (Coming Soon)
309
+
- the **Browse** tab in `webui/components/plugins/list/plugin-list.html`
310
+
- the **Install** toolbar action injected by `plugins/_plugin_installer/extensions/webui/plugins-list-header-buttons/install-buttons.html`, which opens `plugins/_plugin_installer/webui/main.html` on its own **Browse** tab
257
311
258
-
A built-in **Plugin Marketplace** plugin (always active) will allow users to browse the Plugin Index and install or update community plugins directly from the Agent Zero UI. This section will be updated once the marketplace plugin is released.
312
+
Both routes surface Plugin Index entries inside Agent Zero. The marketplace supports search, filtering, sorting, and a detail view with README content and installation actions.
0 commit comments