@adecore/agent-contracts 0.17.0-beta.1 → 0.17.0-beta.2
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/LICENSE +1 -1
- package/README.md +27 -8
- package/package.json +1 -1
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,20 +1,39 @@
|
|
|
1
1
|
# @adecore/agent-contracts
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@adecore/agent-contracts)
|
|
4
|
+
[](https://adecore.dev/agent-contracts/)
|
|
5
|
+
|
|
6
|
+
The Zod schemas and TypeScript types an agent chat host and its clients share: the frames on the wire, the requests and events, a chat and its items, providers, models, accounts, tasks, worktrees and usage. It opens no connection and starts no process, so a browser, a preload and a backend can all import it.
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
bun add @adecore/agent-contracts
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Use
|
|
4
15
|
|
|
5
16
|
```ts
|
|
6
17
|
import { AGENT_REQUEST_SCHEMAS, parseRequest } from '@adecore/agent-contracts';
|
|
7
|
-
import type { FramePort } from '@adecore/agent-contracts/port';
|
|
8
18
|
|
|
9
|
-
const
|
|
19
|
+
const frame = parseRequest(incoming);
|
|
20
|
+
if (frame.ok && frame.value.type === 'chat.send') {
|
|
21
|
+
const payload = AGENT_REQUEST_SCHEMAS['chat.send'].payload.parse(frame.value.payload);
|
|
22
|
+
}
|
|
10
23
|
```
|
|
11
24
|
|
|
12
|
-
|
|
25
|
+
The root exports everything. Each group also has a subpath of its own: `agent`, `chat`, `envelope`, `ids`, `model`, `port`, `protocol`, `provider-accounts`, `task`, `text`, `usage` and `worktree`.
|
|
13
26
|
|
|
14
|
-
|
|
27
|
+
## Documentation
|
|
15
28
|
|
|
16
|
-
|
|
29
|
+
| Page | What it covers |
|
|
30
|
+
|---|---|
|
|
31
|
+
| [Overview](https://adecore.dev/agent-contracts/) | Install, a first check and the entry points |
|
|
32
|
+
| [Protocol](https://adecore.dev/agent-contracts/protocol) | Frames, the request and event tables, replay and adding requests |
|
|
33
|
+
| [Conversation](https://adecore.dev/agent-contracts/conversation) | A chat's info and items, attachments, approvals, bookmarks and forks |
|
|
34
|
+
| [Providers and accounts](https://adecore.dev/agent-contracts/providers-and-accounts) | Agent kinds, model catalogs, capabilities, runtime modes and accounts |
|
|
35
|
+
| [Tasks and usage](https://adecore.dev/agent-contracts/tasks-and-usage) | Tasks, worktrees, token totals, summaries and plan limits |
|
|
17
36
|
|
|
18
|
-
|
|
37
|
+
## License
|
|
19
38
|
|
|
20
|
-
|
|
39
|
+
FSL-1.1-MIT. See [LICENSE](./LICENSE).
|