@mcoda/agents 0.1.4 → 0.1.8
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/CHANGELOG.md +1 -1
- package/README.md +29 -3
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -1,9 +1,35 @@
|
|
|
1
1
|
# @mcoda/agents
|
|
2
2
|
|
|
3
|
-
Agent registry and
|
|
3
|
+
Agent registry, adapter wiring, and invocation helpers for mcoda.
|
|
4
4
|
|
|
5
|
-
##
|
|
6
|
-
|
|
5
|
+
## Install
|
|
6
|
+
- Requires Node.js >= 20.
|
|
7
|
+
- Install: `npm i @mcoda/agents`
|
|
8
|
+
|
|
9
|
+
## What it provides
|
|
10
|
+
- AgentService for resolving agents, prompts, capabilities, and secrets.
|
|
11
|
+
- Adapter interfaces (AgentAdapter, InvocationRequest/InvocationResult).
|
|
12
|
+
- Built-in adapters for OpenAI, Codex, Gemini, Ollama, Zhipu, local models, and QA.
|
|
13
|
+
|
|
14
|
+
## Example
|
|
15
|
+
```ts
|
|
16
|
+
import { AgentService } from "@mcoda/agents";
|
|
17
|
+
|
|
18
|
+
const service = await AgentService.create();
|
|
19
|
+
const agent = await service.resolveAgent("codex");
|
|
20
|
+
const adapter = await service.getAdapter(agent);
|
|
21
|
+
const result = await adapter.invoke?.({ input: "Summarize this repo." });
|
|
22
|
+
|
|
23
|
+
if (result) {
|
|
24
|
+
console.log(result.output);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
await service.close();
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Notes
|
|
31
|
+
- Primarily used by the mcoda CLI; APIs may evolve.
|
|
32
|
+
- Set `MCODA_STREAM_IO=1` to emit adapter I/O lines to stderr.
|
|
7
33
|
|
|
8
34
|
## License
|
|
9
35
|
MIT - see `LICENSE`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mcoda/agents",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "Agent registry and capabilities for mcoda.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -13,11 +13,6 @@
|
|
|
13
13
|
"CHANGELOG.md",
|
|
14
14
|
"LICENSE"
|
|
15
15
|
],
|
|
16
|
-
"scripts": {
|
|
17
|
-
"build": "tsc -p tsconfig.json",
|
|
18
|
-
"lint": "echo \"lint not configured\"",
|
|
19
|
-
"test": "pnpm run build && node ../../scripts/run-node-tests.js dist"
|
|
20
|
-
},
|
|
21
16
|
"engines": {
|
|
22
17
|
"node": ">=20"
|
|
23
18
|
},
|
|
@@ -35,7 +30,12 @@
|
|
|
35
30
|
"access": "public"
|
|
36
31
|
},
|
|
37
32
|
"dependencies": {
|
|
38
|
-
"@mcoda/
|
|
39
|
-
"@mcoda/
|
|
33
|
+
"@mcoda/db": "0.1.8",
|
|
34
|
+
"@mcoda/shared": "0.1.8"
|
|
35
|
+
},
|
|
36
|
+
"scripts": {
|
|
37
|
+
"build": "tsc -p tsconfig.json",
|
|
38
|
+
"lint": "echo \"lint not configured\"",
|
|
39
|
+
"test": "pnpm run build && node ../../scripts/run-node-tests.js dist"
|
|
40
40
|
}
|
|
41
|
-
}
|
|
41
|
+
}
|