| 1 | # Forge runtime plugins (M0) |
| 2 | |
| 3 | This folder is the **optional dev drop zone** for plugin DLLs. At runtime Forge loads assemblies from: |
| 4 | |
| 5 | 1. `FORGE_PLUGINS_PATH` (if set), else |
| 6 | 2. `{app}/plugins/` (created on build/publish for standard bundle plugins) |
| 7 | |
| 8 | ## Dev workflow |
| 9 | |
| 10 | ```bash |
| 11 | dotnet build |
| 12 | dotnet run --project src/AgentForge |
| 13 | ``` |
| 14 | |
| 15 | Built-in plugins (`AgentForge.Plugin.*.dll`) are copied into `src/AgentForge/bin/Debug/net10.0/plugins/` automatically. |
| 16 | |
| 17 | ### Hot reload (dev) |
| 18 | |
| 19 | With `dotnet run` in Development, **`Forge:WatchPlugins` is on** (`appsettings.Development.json`). After you rebuild a plugin DLL, Forge detects the change under `plugins/` and schedules a **process restart** (see [FORGE-ADR-0023](../design/FORGE-ADR-0023-plugin-folder-and-hot-reload.md)). |
| 20 | |
| 21 | Override: |
| 22 | |
| 23 | ```bash |
| 24 | set FORGE_WATCH_PLUGINS=false # disable |
| 25 | set FORGE_WATCH_PLUGINS=true # enable outside Development |
| 26 | ``` |
| 27 | |
| 28 | Manual reload: `POST /api/v1/admin/plugins/reload?mode=restart|hot` (bootstrap token). |
| 29 | |
| 30 | To test a custom plugin locally, copy your DLL here **or** set: |
| 31 | |
| 32 | ```bash |
| 33 | set FORGE_PLUGINS_PATH=D:\path\to\plugins |
| 34 | ``` |
| 35 | |
| 36 | Add an entry to [`forge.plugins.toml`](../forge.plugins.toml) (`[plugins.{id}]` with `assembly`; tier is declared on `IForgePlugin`) and list the plugin id in your active bundle. |
| 37 | |
| 38 | For dev-only **auto discovery** (load all `AgentForge.Plugin.*.dll` in the folder), set `[plugins] discovery = "auto"`, `FORGE_PLUGIN_DISCOVERY=auto`, or use the AgentForge launch profile (Development defaults to auto). AMS `-Showcase` deploy sets `FORGE_PLUGIN_DISCOVERY=auto` on the host. See [FORGE-ADR-0030](../design/FORGE-ADR-0030-plugin-host-discovery-v1.md). |
| 39 | |
| 40 | ## Git |
| 41 | |
| 42 | `*.dll` and `*.pdb` in this folder are gitignored. Do not commit binaries. |
| 43 | |
| 44 | See [FORGE-ADR-0023](../design/FORGE-ADR-0023-plugin-folder-and-hot-reload.md) for hot-reload phases. |
| 45 | |