@mastra/hono 1.7.6-alpha.6 → 1.7.6-alpha.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/README.md +7 -40
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ Hono server adapter for Mastra, enabling you to run Mastra with the [Hono](https
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install @mastra/hono
|
|
8
|
+
npm install @mastra/hono
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
@@ -23,47 +23,14 @@ await server.init();
|
|
|
23
23
|
export default app;
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
##
|
|
26
|
+
## Documentation
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
- [Hono adapter reference](https://mastra.ai/reference/server/hono-adapter)
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
// Routes added after init() have access to Mastra context
|
|
32
|
-
app.get('/health', c => {
|
|
33
|
-
const mastraInstance = c.get('mastra');
|
|
34
|
-
const agents = Object.keys(mastraInstance.listAgents());
|
|
35
|
-
return c.json({ status: 'ok', agents });
|
|
36
|
-
});
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
## Configuration Options
|
|
40
|
-
|
|
41
|
-
```typescript
|
|
42
|
-
const server = new MastraServer({
|
|
43
|
-
app,
|
|
44
|
-
mastra,
|
|
45
|
-
prefix: '/api/v2', // Route prefix
|
|
46
|
-
openapiPath: '/openapi.json', // OpenAPI spec endpoint
|
|
47
|
-
bodyLimitOptions: {
|
|
48
|
-
maxSize: 10 * 1024 * 1024, // 10MB
|
|
49
|
-
onError: err => ({ error: 'Payload too large' }),
|
|
50
|
-
},
|
|
51
|
-
streamOptions: { redact: true }, // Redact sensitive data from streams
|
|
52
|
-
});
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
## Context Variables
|
|
56
|
-
|
|
57
|
-
Access these in route handlers via `c.get()`:
|
|
30
|
+
## Changelog
|
|
58
31
|
|
|
59
|
-
|
|
60
|
-
| ---------------- | --------------------------- |
|
|
61
|
-
| `mastra` | Mastra instance |
|
|
62
|
-
| `requestContext` | Request context map |
|
|
63
|
-
| `abortSignal` | Request cancellation signal |
|
|
64
|
-
| `tools` | Available tools |
|
|
32
|
+
See the [package changelog](https://github.com/mastra-ai/mastra/blob/main/server-adapters/hono/CHANGELOG.md) for version history and release notes.
|
|
65
33
|
|
|
66
|
-
##
|
|
34
|
+
## Support
|
|
67
35
|
|
|
68
|
-
|
|
69
|
-
- [Hono Documentation](https://hono.dev)
|
|
36
|
+
We have an [open community Discord](https://discord.gg/mastra-ai). Come and say hello and let us know if you have any questions or need any help getting things running.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/hono",
|
|
3
|
-
"version": "1.7.6-alpha.
|
|
3
|
+
"version": "1.7.6-alpha.8",
|
|
4
4
|
"description": "Mastra Hono adapter for the server",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"@hono/node-ws": "^1.3.0",
|
|
24
24
|
"fetch-to-node": "^2.1.0",
|
|
25
25
|
"ws": "^8.21.0",
|
|
26
|
-
"@mastra/server": "1.64.0-alpha.
|
|
26
|
+
"@mastra/server": "1.64.0-alpha.8"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@ai-sdk/openai": "^2.0.115",
|
|
@@ -37,14 +37,14 @@
|
|
|
37
37
|
"typescript": "^7.0.2",
|
|
38
38
|
"vitest": "4.1.10",
|
|
39
39
|
"zod": "^4.4.3",
|
|
40
|
-
"@internal/storage-test-utils": "0.0.125",
|
|
41
40
|
"@internal/types-builder": "0.0.104",
|
|
42
|
-
"@internal/
|
|
43
|
-
"@mastra/
|
|
41
|
+
"@internal/storage-test-utils": "0.0.125",
|
|
42
|
+
"@mastra/libsql": "1.22.3-alpha.3",
|
|
44
43
|
"@internal/server-adapter-test-utils": "0.0.29",
|
|
45
|
-
"@mastra/
|
|
46
|
-
"@
|
|
47
|
-
"@mastra/
|
|
44
|
+
"@mastra/memory": "1.28.2-alpha.3",
|
|
45
|
+
"@internal/lint": "0.0.129",
|
|
46
|
+
"@mastra/core": "1.64.0-alpha.8",
|
|
47
|
+
"@mastra/observability": "1.17.5-alpha.2"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"@mastra/core": ">=1.50.0-0 <2.0.0-0",
|