Commit 76ae278
Mark Pollack
Add annotation-based agent API (Phase 5A)
New modules:
- acp-annotations: Zero-dependency annotation definitions (@AcpAgent, @initialize, @newSession, @prompt, @sessionid, @SessionState)
- acp-agent-support: Reflection-based runtime for annotation processing
Key components:
- ArgumentResolver pattern with caching (Spring MVC-style)
- ReturnValueHandler pattern for flexible return types
- InterceptorChain with proper lifecycle tracking
- AcpAgentSupport bootstrap class
Features:
- String return auto-converts to PromptResponse.text()
- void return auto-converts to PromptResponse.endTurn()
- Flexible parameter injection (request, context, capabilities)
Validated by BuilderVsAnnotationComparisonTest showing:
- 40% boilerplate reduction for basic lifecycle
- 50% reduction for file operations
- 60% reduction for terminal execution1 parent e034359 commit 76ae278
File tree
33 files changed
+3111
-0
lines changed- acp-agent-support
- src
- main/java/com/agentclientprotocol/sdk/agent/support
- handler
- interceptor
- resolver
- test/java/com/agentclientprotocol/sdk/agent/support
- acp-annotations
- src/main/java/com/agentclientprotocol/sdk/annotation
33 files changed
+3111
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
0 commit comments