melony 0.1.12 → 0.1.14
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 +5 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# melony
|
|
2
2
|
|
|
3
3
|
Melony Core is a small **event-streaming runtime** for AI agents with first-class **Server‑Driven UI (SDUI)**.
|
|
4
4
|
|
|
@@ -11,7 +11,7 @@ You write a `brain` (decides what to do) and `actions` (do work and stream event
|
|
|
11
11
|
## Installation
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
npm install
|
|
14
|
+
npm install melony zod
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
## 60-second usage
|
|
@@ -19,7 +19,7 @@ npm install @melony/core zod
|
|
|
19
19
|
### 1) Define an agent runtime
|
|
20
20
|
|
|
21
21
|
```ts
|
|
22
|
-
import { melony, action, ui } from "
|
|
22
|
+
import { melony, action, ui } from "melony";
|
|
23
23
|
import { z } from "zod";
|
|
24
24
|
|
|
25
25
|
export const assistant = melony({
|
|
@@ -61,7 +61,7 @@ export const assistant = melony({
|
|
|
61
61
|
|
|
62
62
|
```ts
|
|
63
63
|
import { Hono } from "hono";
|
|
64
|
-
import { handle } from "
|
|
64
|
+
import { handle } from "melony/adapters/hono";
|
|
65
65
|
import { assistant } from "./assistant";
|
|
66
66
|
|
|
67
67
|
const app = new Hono();
|
|
@@ -71,7 +71,7 @@ app.post("/api/chat", handle(assistant));
|
|
|
71
71
|
### 3) Stream from the client
|
|
72
72
|
|
|
73
73
|
```ts
|
|
74
|
-
import { MelonyClient, createHttpTransport } from "
|
|
74
|
+
import { MelonyClient, createHttpTransport } from "melony/client";
|
|
75
75
|
|
|
76
76
|
const client = new MelonyClient(createHttpTransport("/api/chat"));
|
|
77
77
|
|