qqeasonchen opened a new pull request, #5409: URL: https://github.com/apache/eventmesh/pull/5409
Follow-up to #5408 (discussion in #5407): turn `AgentTool` into a real repo-standard SPI extension point, so custom agent tools deploy as plugin jars exactly like storage/connector plugins. ## What this adds - **`@EventMeshSPI` on `AgentTool`** + a new `AGENT_TOOL` entry in `EventMeshExtensionType`. Implementations register via a `META-INF/eventmesh/org.apache.eventmesh.agent.tool.AgentTool` service file (`mytool=com.example.MyTool`) — the same convention as every other EventMesh plugin. - **`ToolRegistry.registerSpi(name)`** — resolves an implementation by SPI name through `EventMeshExtensionFactory` (singleton semantics, classpath + plugin-jar loaders), then registers it like any other tool. - **`-Dagent.tools.spi=<name,...>`** in `AgentApplication` — enables SPI tools alongside the connector-backed tools from #5408. - **`plugin/agent/` classpath convention** — `start-agent.sh` puts every jar under `plugin/agent/` on the agent classpath (mirrors `plugin/connector/` in the connector runtime). - **Docs** — SPI deployment walkthrough in `docs/feature/agent-tools.md` + config-table entry + `agent.properties` key doc. ## User-facing workflow (after this PR) ```properties # 1. implement AgentTool in your jar # 2. ship META-INF/eventmesh/org.apache.eventmesh.agent.tool.AgentTool: # risk-check=com.example.RiskCheckTool # 3. drop the jar into plugin/agent/ # 4. enable: AGENT_TOOLS_SPI=risk-check ``` ## Tests - `AgentToolSpiTest.registerSpiResolvesThroughTheFactory` — resolves `echo-test` through the **real** `EventMeshExtensionFactory` using a test service file + `EchoTestTool`, invokes it end-to-end - `AgentToolSpiTest.registerSpiRejectsUnknownName` — unknown SPI name throws `IllegalArgumentException` - Full agent suite re-run: 11/11 green (9 from #5408 + 2 new) - Checkstyle clean on all changed files ## Notes - `eventmesh-agent` gains a compile dep on `eventmesh-spi` (the factory module) — it is already transitively present via `eventmesh-sdk-java`; this makes it explicit. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
