@axiom-lattice/cli-a2a 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +34 -32
- package/CHANGELOG.md +20 -0
- package/README.md +85 -2
- package/__tests__/opencode-executor.test.ts +631 -31
- package/__tests__/session-store-path.test.ts +40 -0
- package/dist/{chunk-NQIDRU47.mjs → chunk-54SKDK3D.mjs} +78 -32
- package/dist/chunk-54SKDK3D.mjs.map +1 -0
- package/dist/chunk-BSNQOP2W.mjs +350 -0
- package/dist/chunk-BSNQOP2W.mjs.map +1 -0
- package/dist/chunk-DRFFQJII.mjs +195 -0
- package/dist/chunk-DRFFQJII.mjs.map +1 -0
- package/dist/chunk-URJDRXJW.mjs +378 -0
- package/dist/chunk-URJDRXJW.mjs.map +1 -0
- package/dist/{chunk-G7AGL2QA.mjs → chunk-WZB7FBSX.mjs} +23 -5
- package/dist/chunk-WZB7FBSX.mjs.map +1 -0
- package/dist/{chunk-LXL47XMZ.mjs → chunk-YGUPSPZO.mjs} +9 -1
- package/dist/chunk-YGUPSPZO.mjs.map +1 -0
- package/dist/{chunk-35NFMGMS.mjs → chunk-ZP3JNJQJ.mjs} +3 -3
- package/dist/chunk-ZP3JNJQJ.mjs.map +1 -0
- package/dist/cli.js +769 -156
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +7 -6
- package/dist/cli.mjs.map +1 -1
- package/dist/executor-LLE5VEFJ.mjs +12 -0
- package/dist/executor-LO7P3KUW.mjs +12 -0
- package/dist/{executor-RVBGAWUF.mjs → executor-OOLGGXHS.mjs} +4 -3
- package/dist/{executors-QIIKBUMJ.mjs → executors-AQHOPGSR.mjs} +2 -2
- package/dist/index.d.mts +92 -21
- package/dist/index.d.ts +92 -21
- package/dist/index.js +731 -123
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -7
- package/package.json +10 -3
- package/runtime/cli-path.cjs +3 -0
- package/runtime/cli-path.d.ts +1 -0
- package/runtime/cli-path.mjs +5 -0
- package/src/config/defaults.ts +3 -1
- package/src/config/types.ts +8 -3
- package/src/executors/claude/client.ts +44 -14
- package/src/executors/claude/executor.ts +65 -30
- package/src/executors/codex/client.ts +239 -16
- package/src/executors/codex/executor.ts +70 -37
- package/src/executors/events.ts +15 -1
- package/src/executors/index.ts +13 -6
- package/src/executors/opencode/client.ts +192 -18
- package/src/executors/opencode/executor.ts +65 -30
- package/src/index.ts +8 -0
- package/src/local-state.ts +53 -0
- package/src/server/agent-card.ts +1 -0
- package/src/server/index.ts +22 -7
- package/src/session-store.ts +262 -0
- package/dist/chunk-35NFMGMS.mjs.map +0 -1
- package/dist/chunk-G7AGL2QA.mjs.map +0 -1
- package/dist/chunk-LXL47XMZ.mjs.map +0 -1
- package/dist/chunk-NQIDRU47.mjs.map +0 -1
- package/dist/chunk-VSZ3DACI.mjs +0 -179
- package/dist/chunk-VSZ3DACI.mjs.map +0 -1
- package/dist/chunk-WNCDOYZS.mjs +0 -187
- package/dist/chunk-WNCDOYZS.mjs.map +0 -1
- package/dist/executor-OWPVDUXH.mjs +0 -11
- package/dist/executor-XWHWUVQ3.mjs +0 -11
- /package/dist/{executor-OWPVDUXH.mjs.map → executor-LLE5VEFJ.mjs.map} +0 -0
- /package/dist/{executor-RVBGAWUF.mjs.map → executor-LO7P3KUW.mjs.map} +0 -0
- /package/dist/{executor-XWHWUVQ3.mjs.map → executor-OOLGGXHS.mjs.map} +0 -0
- /package/dist/{executors-QIIKBUMJ.mjs.map → executors-AQHOPGSR.mjs.map} +0 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @axiom-lattice/cli-a2a@0.1.
|
|
2
|
+
> @axiom-lattice/cli-a2a@0.1.6 build /home/runner/work/agentic/agentic/packages/cli-a2a
|
|
3
3
|
> tsup src/index.ts src/cli.ts --format cjs,esm --dts --clean --sourcemap
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/cli.ts, src/index.ts
|
|
@@ -9,43 +9,45 @@
|
|
|
9
9
|
[34mCLI[39m Cleaning output folder
|
|
10
10
|
[34mCJS[39m Build start
|
|
11
11
|
[34mESM[39m Build start
|
|
12
|
-
[
|
|
13
|
-
[
|
|
14
|
-
[
|
|
15
|
-
[
|
|
16
|
-
[
|
|
17
|
-
[32mESM[39m [1mdist/
|
|
18
|
-
[32mESM[39m [1mdist/
|
|
19
|
-
[32mESM[39m [1mdist/
|
|
20
|
-
[32mESM[39m [1mdist/
|
|
21
|
-
[32mESM[39m [1mdist/
|
|
22
|
-
[32mESM[39m [1mdist/
|
|
23
|
-
[32mESM[39m [1mdist/chunk-
|
|
12
|
+
[32mCJS[39m [1mdist/cli.js [22m[32m80.46 KB[39m
|
|
13
|
+
[32mCJS[39m [1mdist/index.js [22m[32m54.18 KB[39m
|
|
14
|
+
[32mCJS[39m [1mdist/cli.js.map [22m[32m144.21 KB[39m
|
|
15
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m107.36 KB[39m
|
|
16
|
+
[32mCJS[39m ⚡️ Build success in 649ms
|
|
17
|
+
[32mESM[39m [1mdist/cli.mjs [22m[32m11.33 KB[39m
|
|
18
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m1005.00 B[39m
|
|
19
|
+
[32mESM[39m [1mdist/chunk-WZB7FBSX.mjs [22m[32m10.98 KB[39m
|
|
20
|
+
[32mESM[39m [1mdist/executors-AQHOPGSR.mjs [22m[32m251.00 B[39m
|
|
21
|
+
[32mESM[39m [1mdist/chunk-ZP3JNJQJ.mjs [22m[32m724.00 B[39m
|
|
22
|
+
[32mESM[39m [1mdist/executor-OOLGGXHS.mjs [22m[32m281.00 B[39m
|
|
23
|
+
[32mESM[39m [1mdist/chunk-BSNQOP2W.mjs [22m[32m12.17 KB[39m
|
|
24
|
+
[32mESM[39m [1mdist/executor-LLE5VEFJ.mjs [22m[32m269.00 B[39m
|
|
25
|
+
[32mESM[39m [1mdist/chunk-URJDRXJW.mjs [22m[32m12.67 KB[39m
|
|
26
|
+
[32mESM[39m [1mdist/executor-LO7P3KUW.mjs [22m[32m273.00 B[39m
|
|
27
|
+
[32mESM[39m [1mdist/chunk-54SKDK3D.mjs [22m[32m7.81 KB[39m
|
|
28
|
+
[32mESM[39m [1mdist/chunk-YGUPSPZO.mjs [22m[32m1.12 KB[39m
|
|
29
|
+
[32mESM[39m [1mdist/chunk-DRFFQJII.mjs [22m[32m5.62 KB[39m
|
|
24
30
|
[32mESM[39m [1mdist/bridge-7ZUDKCZT.mjs [22m[32m8.09 KB[39m
|
|
25
31
|
[32mESM[39m [1mdist/chunk-VZEH3EPJ.mjs [22m[32m1.49 KB[39m
|
|
26
32
|
[32mESM[39m [1mdist/cli.mjs.map [22m[32m20.54 KB[39m
|
|
27
33
|
[32mESM[39m [1mdist/index.mjs.map [22m[32m71.00 B[39m
|
|
28
|
-
[32mESM[39m [1mdist/chunk-
|
|
29
|
-
[32mESM[39m [1mdist/executors-
|
|
30
|
-
[32mESM[39m [1mdist/chunk-
|
|
31
|
-
[32mESM[39m [1mdist/executor-
|
|
32
|
-
[32mESM[39m [1mdist/chunk-
|
|
33
|
-
[32mESM[39m [1mdist/executor-
|
|
34
|
-
[32mESM[39m [1mdist/chunk-
|
|
35
|
-
[32mESM[39m [1mdist/executor-
|
|
36
|
-
[32mESM[39m [1mdist/chunk-
|
|
37
|
-
[32mESM[39m [1mdist/chunk-
|
|
34
|
+
[32mESM[39m [1mdist/chunk-WZB7FBSX.mjs.map [22m[32m20.01 KB[39m
|
|
35
|
+
[32mESM[39m [1mdist/executors-AQHOPGSR.mjs.map [22m[32m71.00 B[39m
|
|
36
|
+
[32mESM[39m [1mdist/chunk-ZP3JNJQJ.mjs.map [22m[32m2.46 KB[39m
|
|
37
|
+
[32mESM[39m [1mdist/executor-OOLGGXHS.mjs.map [22m[32m71.00 B[39m
|
|
38
|
+
[32mESM[39m [1mdist/chunk-BSNQOP2W.mjs.map [22m[32m23.76 KB[39m
|
|
39
|
+
[32mESM[39m [1mdist/executor-LLE5VEFJ.mjs.map [22m[32m71.00 B[39m
|
|
40
|
+
[32mESM[39m [1mdist/chunk-URJDRXJW.mjs.map [22m[32m25.03 KB[39m
|
|
41
|
+
[32mESM[39m [1mdist/executor-LO7P3KUW.mjs.map [22m[32m71.00 B[39m
|
|
42
|
+
[32mESM[39m [1mdist/chunk-54SKDK3D.mjs.map [22m[32m15.69 KB[39m
|
|
43
|
+
[32mESM[39m [1mdist/chunk-YGUPSPZO.mjs.map [22m[32m4.16 KB[39m
|
|
44
|
+
[32mESM[39m [1mdist/chunk-DRFFQJII.mjs.map [22m[32m11.36 KB[39m
|
|
38
45
|
[32mESM[39m [1mdist/bridge-7ZUDKCZT.mjs.map [22m[32m16.70 KB[39m
|
|
39
46
|
[32mESM[39m [1mdist/chunk-VZEH3EPJ.mjs.map [22m[32m3.18 KB[39m
|
|
40
|
-
[32mESM[39m ⚡️ Build success in
|
|
41
|
-
[32mCJS[39m [1mdist/cli.js [22m[32m56.81 KB[39m
|
|
42
|
-
[32mCJS[39m [1mdist/index.js [22m[32m32.87 KB[39m
|
|
43
|
-
[32mCJS[39m [1mdist/cli.js.map [22m[32m104.01 KB[39m
|
|
44
|
-
[32mCJS[39m [1mdist/index.js.map [22m[32m67.18 KB[39m
|
|
45
|
-
[32mCJS[39m ⚡️ Build success in 232ms
|
|
47
|
+
[32mESM[39m ⚡️ Build success in 664ms
|
|
46
48
|
[34mDTS[39m Build start
|
|
47
|
-
[32mDTS[39m ⚡️ Build success in
|
|
49
|
+
[32mDTS[39m ⚡️ Build success in 17931ms
|
|
48
50
|
[32mDTS[39m [1mdist/cli.d.ts [22m[32m20.00 B[39m
|
|
49
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[
|
|
51
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m12.14 KB[39m
|
|
50
52
|
[32mDTS[39m [1mdist/cli.d.mts [22m[32m20.00 B[39m
|
|
51
|
-
[32mDTS[39m [1mdist/index.d.mts [22m[
|
|
53
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m12.14 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @axiom-lattice/cli-a2a
|
|
2
2
|
|
|
3
|
+
## 0.1.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 3a124ab: **BREAKING**: Remove `LocalA2ATemplateStore` from store lattice, replacing it with static template config.
|
|
8
|
+
|
|
9
|
+
- Deleted `LocalA2ATemplateStoreProtocol` and all implementations (InMemory, PostgreSQL, SQLite)
|
|
10
|
+
- Removed `localA2ATemplate` entry from `StoreTypeMap` and store lattice default registrations
|
|
11
|
+
- Removed obsolete PostgreSQL Local A2A template migration source; existing database tables are not dropped
|
|
12
|
+
- Removed `LocalA2ATemplateEntry`, `CreateLocalA2ATemplateRequest`, `UpdateLocalA2ATemplateRequest` types
|
|
13
|
+
- `client.assistants.localA2A.templates` now only supports `.list()` (returns `LocalA2ATemplateDefinition[]`)
|
|
14
|
+
- Templates are now defined in `packages/gateway/src/config/local-a2a-templates.ts`
|
|
15
|
+
- Gateway resolves the managed CLI through the installed `@axiom-lattice/cli-a2a/cli-path` export and declares the CLI package as a runtime dependency
|
|
16
|
+
- Templates no longer contain port or agentCardUrl; those are user-supplied at creation time
|
|
17
|
+
- `CreateAssistantModal` appends the Agent Card URL port to template commands as `--port <port>` when the template does not already declare a port
|
|
18
|
+
- CLI session files are isolated by provider and server port when no explicit store path is configured
|
|
19
|
+
|
|
20
|
+
- Updated dependencies [3a124ab]
|
|
21
|
+
- @axiom-lattice/protocols@3.0.0
|
|
22
|
+
|
|
3
23
|
## 0.1.5
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -164,10 +164,15 @@ import {
|
|
|
164
164
|
resolveConfig,
|
|
165
165
|
registerExecutor,
|
|
166
166
|
createOpenCodeExecutor,
|
|
167
|
+
createCodexExecutor,
|
|
168
|
+
createClaudeExecutor,
|
|
169
|
+
SessionBindingStore,
|
|
167
170
|
} from '@axiom-lattice/cli-a2a';
|
|
168
171
|
|
|
169
172
|
// Register executors
|
|
170
173
|
registerExecutor('opencode', createOpenCodeExecutor);
|
|
174
|
+
registerExecutor('codex', createCodexExecutor);
|
|
175
|
+
registerExecutor('claude', createClaudeExecutor);
|
|
171
176
|
|
|
172
177
|
// Load config
|
|
173
178
|
const config = resolveConfig('agent-config.json');
|
|
@@ -182,6 +187,76 @@ process.on('SIGINT', async () => {
|
|
|
182
187
|
});
|
|
183
188
|
```
|
|
184
189
|
|
|
190
|
+
## Multi-Turn Conversations
|
|
191
|
+
|
|
192
|
+
The A2A protocol uses `contextId` to group messages into a single conversation.
|
|
193
|
+
`cli-a2a` maps each `contextId` to an underlying CLI session, enabling multi-turn
|
|
194
|
+
continuity across all three providers:
|
|
195
|
+
|
|
196
|
+
| Provider | New Session | Resume Session | Session ID Source |
|
|
197
|
+
|----------|-------------|----------------|-------------------|
|
|
198
|
+
| Codex | `codex exec --json <prompt>` | `codex exec resume <thread_id> <prompt>` | `thread_id` from JSONL `thread.started` event |
|
|
199
|
+
| Claude Code | `claude -p --session-id <uuid> <prompt>` | `claude -p --resume <uuid> <prompt>` | Generated UUID |
|
|
200
|
+
| OpenCode | `opencode run --format json <prompt>` | `opencode run --session <sessionID> <prompt>` | `sessionID` from JSON events |
|
|
201
|
+
|
|
202
|
+
**How it works:**
|
|
203
|
+
1. The A2A client sends a message with a `contextId`
|
|
204
|
+
2. `cli-a2a` looks up the `contextId` in the SessionBindingStore
|
|
205
|
+
3. If found: uses the provider's resume command to continue the CLI session
|
|
206
|
+
4. If not found: creates a new CLI session and saves the binding
|
|
207
|
+
5. Subsequent messages with the same `contextId` reuse the same CLI session
|
|
208
|
+
|
|
209
|
+
History is maintained by the underlying CLI tool — no prompt concatenation needed.
|
|
210
|
+
|
|
211
|
+
### Session Persistence
|
|
212
|
+
|
|
213
|
+
Bindings are persisted to disk so that `cli-a2a` restarts preserve conversations:
|
|
214
|
+
|
|
215
|
+
- **Default path**: `~/Library/Application Support/axiom-lattice/cli-a2a/sessions.json`
|
|
216
|
+
- **Format**: JSON array of `{ provider, contextId, sessionId, ... }`
|
|
217
|
+
- **TTL**: 24 hours by default (configurable via `session.ttl`)
|
|
218
|
+
- **Cleanup**: Expired bindings removed on load and periodically (every 1h)
|
|
219
|
+
|
|
220
|
+
To disable persistence:
|
|
221
|
+
```json
|
|
222
|
+
{
|
|
223
|
+
"session": {
|
|
224
|
+
"persist": false
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
To disable session reuse entirely (each request creates a new session):
|
|
230
|
+
```json
|
|
231
|
+
{
|
|
232
|
+
"session": {
|
|
233
|
+
"reuseByContext": false
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
### Session Config
|
|
239
|
+
|
|
240
|
+
```json
|
|
241
|
+
{
|
|
242
|
+
"session": {
|
|
243
|
+
"reuseByContext": true,
|
|
244
|
+
"persist": true,
|
|
245
|
+
"storePath": "~/custom/path/sessions.json",
|
|
246
|
+
"ttl": 86400000,
|
|
247
|
+
"cleanupInterval": 3600000
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
| Field | Default | Description |
|
|
253
|
+
|-------|---------|-------------|
|
|
254
|
+
| `reuseByContext` | `true` | Map `contextId` to CLI session for multi-turn |
|
|
255
|
+
| `persist` | `true` | Save bindings to disk across restarts |
|
|
256
|
+
| `storePath` | `~/Library/Application Support/axiom-lattice/cli-a2a/sessions.json` | Custom binding store path |
|
|
257
|
+
| `ttl` | `86400000` (24h) | Session TTL in milliseconds |
|
|
258
|
+
| `cleanupInterval` | `3600000` (1h) | Cleanup interval in milliseconds |
|
|
259
|
+
|
|
185
260
|
## Architecture
|
|
186
261
|
|
|
187
262
|
```
|
|
@@ -199,6 +274,11 @@ process.on('SIGINT', async () => {
|
|
|
199
274
|
│ │ │ Executor │ │ Executor│ │ Executor │ ││
|
|
200
275
|
│ │ └─────┬──────┘ └────┬────┘ └───────┬──────────┘ ││
|
|
201
276
|
│ └────────┼─────────────┼──────────────┼────────────┘│
|
|
277
|
+
│ │ │ │ │
|
|
278
|
+
│ ┌────────▼─────────────▼──────────────▼────────────┐│
|
|
279
|
+
│ │ SessionBindingStore ││
|
|
280
|
+
│ │ contextId → CLI sessionId + file persistence ││
|
|
281
|
+
│ └──────────────────────────────────────────────────┘│
|
|
202
282
|
└───────────┼─────────────┼──────────────┼─────────────┘
|
|
203
283
|
│ HTTP │ spawn │ spawn
|
|
204
284
|
┌───────▼────────┐ ┌──▼───────┐ ┌───▼────────────┐
|
|
@@ -281,8 +361,11 @@ npx @axiom-lattice/cli-a2a --provider opencode -d /proj/backend --port 3002 &
|
|
|
281
361
|
| `resolveConfig(path?, overrides?)` | Merge config layers |
|
|
282
362
|
| `loadConfigFile(path)` | Read and parse a JSON config file |
|
|
283
363
|
| `registerExecutor(provider, factory)` | Register an executor factory |
|
|
284
|
-
| `createOpenCodeExecutor(config)` | Create an OpenCode executor |
|
|
285
|
-
| `
|
|
364
|
+
| `createOpenCodeExecutor(config, store)` | Create an OpenCode executor |
|
|
365
|
+
| `createCodexExecutor(config, store)` | Create a Codex executor |
|
|
366
|
+
| `createClaudeExecutor(config, store)` | Create a Claude executor |
|
|
367
|
+
| `SessionBindingStore` | `contextId → sessionId` persistence |
|
|
368
|
+
| `generateContextId()` | Generate a new UUID contextId |
|
|
286
369
|
| `logger`, `LogLevel` | Structured logger |
|
|
287
370
|
|
|
288
371
|
## License
|