@ag-ui/proto 0.0.34 → 0.0.35
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/README.md +53 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# @ag-ui/proto
|
|
2
|
+
|
|
3
|
+
Protocol Buffer encoding/decoding for **Agent-User Interaction (AG-UI) Protocol** events.
|
|
4
|
+
|
|
5
|
+
`@ag-ui/proto` provides high-performance binary serialization of AG-UI events using Protocol Buffers. It includes generated TypeScript definitions and utilities for converting between AG-UI's JSON event format and compact binary representation.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @ag-ui/proto
|
|
11
|
+
pnpm add @ag-ui/proto
|
|
12
|
+
yarn add @ag-ui/proto
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Features
|
|
16
|
+
|
|
17
|
+
- ⚡ **High performance** – Binary protobuf encoding for minimal bandwidth usage
|
|
18
|
+
- 🔄 **Round-trip safety** – Lossless conversion between JSON and binary formats
|
|
19
|
+
- 📋 **Generated types** – Auto-generated TypeScript definitions from `.proto` schemas
|
|
20
|
+
- 🔧 **Length-prefixed** – Standard 4-byte length headers for streaming protocols
|
|
21
|
+
|
|
22
|
+
## Quick example
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
import { encode, decode, AGUI_MEDIA_TYPE } from "@ag-ui/proto";
|
|
26
|
+
import { EventType } from "@ag-ui/core";
|
|
27
|
+
|
|
28
|
+
const event = {
|
|
29
|
+
type: EventType.TEXT_MESSAGE_START,
|
|
30
|
+
messageId: "msg_123",
|
|
31
|
+
role: "assistant",
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
// Encode to binary protobuf format
|
|
35
|
+
const encoded = encode(event);
|
|
36
|
+
|
|
37
|
+
// Decode back to AG-UI event
|
|
38
|
+
const decoded = decode(encoded);
|
|
39
|
+
console.log(decoded); // Original event object
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Documentation
|
|
43
|
+
|
|
44
|
+
- Concepts & architecture: [`docs/concepts`](https://docs.ag-ui.com/concepts/architecture)
|
|
45
|
+
- Full API reference: [`docs/sdk/js/proto`](https://docs.ag-ui.com/sdk/js/proto)
|
|
46
|
+
|
|
47
|
+
## Contributing
|
|
48
|
+
|
|
49
|
+
Bug reports and pull requests are welcome! Please read our [contributing guide](https://docs.ag-ui.com/development/contributing) first.
|
|
50
|
+
|
|
51
|
+
## License
|
|
52
|
+
|
|
53
|
+
MIT © 2025 AG-UI Protocol Contributors
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ag-ui/proto",
|
|
3
3
|
"author": "Markus Ecker <markus.ecker@gmail.com>",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.35",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@bufbuild/protobuf": "^2.2.5",
|
|
14
|
-
"@ag-ui/core": "0.0.
|
|
14
|
+
"@ag-ui/core": "0.0.35"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@jest/globals": "^29.7.0",
|