Repository navigation
Commit f1803cd
Mark Pollack
Framework integrations: an @AcpAgent in process with configuration only
An application that drives its own agent set up an InMemoryTransportPair, an
agent transport bean, a client and its initialization order, the agent's close
and a stdio default by hand, in every framework. Now one property does it, in
Spring Boot, Micronaut and Quarkus:
spring.acp.agent.transport.type=in-process
acp.agent.transport.type=in-process
quarkus.acp.agent.transport.type=in-process
P1, the in-process type (AcpTransportType.IN_PROCESS, written in-process):
the integration serves the @AcpAgent bean on one side of a pair, one per
application, and the application's client on the other. A client transport
configured as well fails the startup. Shared rules are in acp-integration
(AcpInProcess).
P2, the client: AcpSyncClient and AcpAsyncClient on the pair's client side,
with the client properties, initialized right after the agent starts, closed
on shutdown. New handler beans, AcpSessionUpdateHandler (every bean gets every
update) and AcpPermissionHandler (at most one), apply to every client the
integrations build and may block. Without a permission handler, requests are
refused: the agent's reject option, else cancelled.
P3, discovery: @AcpAgent alone makes a class a bean. Spring Boot scans the
auto-configuration packages (AcpAgentScanAutoConfiguration); Micronaut maps
@AcpAgent to @singleton at compile time with the new acp-micronaut-processor
on the annotation processor path; Quarkus already did. acp-annotations keeps
no framework dependency.
P4, lifecycle: shutdown-on-transport-end applies to stdio only
(AcpAgentSettings.shutsDownWhenEnded), and an AutoCloseable agent bean is
closed once the agent has stopped, on every transport.
The deprecated acp-test InMemoryTransportPair is removed. Breaking changes are
listed in the CHANGELOG. Each framework has an acceptance test of an application
whose agent carries only @AcpAgent: initialize, a prompt with streamed updates,
a permission request answered by a handler bean, a clean shutdown that closes
the agent once (Micronaut's in a new, unpublished acp-micronaut-integration-tests
module).1 parent 6c2faee commit f1803cd
85 files changed
Lines changed: 2788 additions & 159 deletions
File tree
- acp-integration
- src
- main/java/com/agentclientprotocol/sdk/integration
- test/java/com/agentclientprotocol/sdk/integration
- acp-micronaut-integration-tests
- src
- main
- java/com/agentclientprotocol/sdk/micronaut/it
- resources
- test/java/com/agentclientprotocol/sdk/micronaut/it
- acp-micronaut-processor
- src
- main
- java/com/agentclientprotocol/sdk/micronaut/processor
- resources/META-INF/services
- test/java/com/agentclientprotocol/sdk/micronaut/processor
- acp-micronaut
- src
- main/java/com/agentclientprotocol/sdk/micronaut
- agent
- client
- inprocess
- test/java/com/agentclientprotocol/sdk/micronaut
- agent
- client
- acp-quarkus-deployment/src
- main/java/com/agentclientprotocol/sdk/quarkus/deployment
- test/java/com/agentclientprotocol/sdk/quarkus/deployment/inprocess
- acp-quarkus
- src
- main/java/com/agentclientprotocol/sdk/quarkus
- runtime
- test/java/com/agentclientprotocol/sdk/quarkus/runtime
- acp-spring-boot-autoconfigure
- src
- main
- java/com/agentclientprotocol/sdk/spring/boot/autoconfigure
- agent
- client
- resources/META-INF/spring
- test/java/com/agentclientprotocol/sdk/spring/boot/autoconfigure
- agent
- inprocess
- acp-test
- src/main/java/com/agentclientprotocol/sdk/test
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
12 | 34 | | |
13 | 35 | | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
19 | 39 | | |
20 | 40 | | |
21 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
22 | 63 | | |
23 | 64 | | |
24 | 65 | | |
25 | 66 | | |
26 | 67 | | |
27 | | - | |
28 | | - | |
| 68 | + | |
29 | 69 | | |
30 | 70 | | |
31 | 71 | | |
32 | 72 | | |
33 | | - | |
| 73 | + | |
34 | 74 | | |
35 | | - | |
36 | | - | |
37 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
38 | 78 | | |
39 | 79 | | |
40 | 80 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
487 | 487 | | |
488 | 488 | | |
489 | 489 | | |
| 490 | + | |
490 | 491 | | |
491 | 492 | | |
492 | 493 | | |
493 | 494 | | |
494 | 495 | | |
495 | 496 | | |
496 | 497 | | |
497 | | - | |
| 498 | + | |
498 | 499 | | |
499 | 500 | | |
500 | 501 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
86 | | - | |
| 85 | + | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
107 | 113 | | |
108 | 114 | | |
109 | 115 | | |
110 | 116 | | |
111 | 117 | | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
116 | 124 | | |
117 | 125 | | |
118 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
33 | | - | |
| 35 | + | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
| |||
53 | 55 | | |
54 | 56 | | |
55 | 57 | | |
56 | | - | |
57 | | - | |
| 58 | + | |
| 59 | + | |
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
| |||
146 | 148 | | |
147 | 149 | | |
148 | 150 | | |
149 | | - | |
| 151 | + | |
| 152 | + | |
150 | 153 | | |
151 | 154 | | |
152 | | - | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
153 | 179 | | |
154 | 180 | | |
155 | 181 | | |
| |||
350 | 376 | | |
351 | 377 | | |
352 | 378 | | |
353 | | - | |
354 | | - | |
355 | | - | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
356 | 382 | | |
357 | 383 | | |
358 | 384 | | |
| |||
363 | 389 | | |
364 | 390 | | |
365 | 391 | | |
366 | | - | |
| 392 | + | |
| 393 | + | |
367 | 394 | | |
368 | 395 | | |
369 | 396 | | |
| |||
0 commit comments