keryx 0.19.1 → 0.19.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/README.md +31 -0
- package/initializers/swagger.ts +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -88,6 +88,10 @@ That's it. The agent can now discover all your actions as tools, authenticate vi
|
|
|
88
88
|
- **Strongly-typed frontend integration** — `ActionResponse<MyAction>` gives the frontend type-safe API responses, no code generation needed
|
|
89
89
|
- **Drizzle ORM** with auto-migrations (replacing the old `ah-sequelize-plugin`)
|
|
90
90
|
- **Companion Vite + React frontend** as a separate application (replacing `ah-next-plugin`)
|
|
91
|
+
- **Streaming responses** — SSE and chunked binary streaming via `StreamingResponse`, with per-transport behavior (HTTP, WebSocket, MCP)
|
|
92
|
+
- **Pagination helpers** — `paginationInputs()` Zod mixin + `paginate()` utility for standardized paginated responses
|
|
93
|
+
- **Database transactions** — `withTransaction()` and `TransactionMiddleware` for automatic commit/rollback across action execution
|
|
94
|
+
- **Redis caching patterns** — cache-aside and response-level cache middleware using the built-in ioredis connection
|
|
91
95
|
|
|
92
96
|
### Why Bun?
|
|
93
97
|
|
|
@@ -213,6 +217,31 @@ OAuth 2.1 with PKCE is used for authentication — MCP clients go through a brow
|
|
|
213
217
|
|
|
214
218
|
A parent task can distribute work across many child jobs using `api.actions.fanOut()` for parallel processing. Results are collected automatically in Redis. See the [Tasks guide](https://keryxjs.com/guide/tasks) for full API and examples.
|
|
215
219
|
|
|
220
|
+
### Streaming Responses
|
|
221
|
+
|
|
222
|
+
Actions can stream data by returning a `StreamingResponse`. The framework handles SSE, chunked binary, and cross-transport behavior automatically:
|
|
223
|
+
|
|
224
|
+
```ts
|
|
225
|
+
async run(params: { prompt: string }) {
|
|
226
|
+
const sse = StreamingResponse.sse();
|
|
227
|
+
|
|
228
|
+
(async () => {
|
|
229
|
+
try {
|
|
230
|
+
for await (const token of callLLM(params.prompt)) {
|
|
231
|
+
sse.send(token, { event: "token" });
|
|
232
|
+
}
|
|
233
|
+
sse.close();
|
|
234
|
+
} catch (e) {
|
|
235
|
+
sse.sendError(String(e));
|
|
236
|
+
}
|
|
237
|
+
})();
|
|
238
|
+
|
|
239
|
+
return sse;
|
|
240
|
+
}
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
Over HTTP this is native SSE; over WebSocket each chunk becomes an incremental message; over MCP chunks are forwarded as logging messages. See the [Streaming guide](https://keryxjs.com/guide/streaming) for full details.
|
|
244
|
+
|
|
216
245
|
## Coming from ActionHero?
|
|
217
246
|
|
|
218
247
|
Keryx keeps the core ideas but rewrites everything on Bun with first-class MCP support. The biggest changes: unified controllers (actions = tasks = CLI commands = MCP tools), separate frontend/backend applications, Drizzle ORM, and MCP as a first-class transport.
|
|
@@ -228,6 +257,8 @@ Each application has its own `Dockerfile`, and a `docker-compose.yml` runs them
|
|
|
228
257
|
Full docs at [keryxjs.com](https://keryxjs.com), including:
|
|
229
258
|
- [Getting Started](https://keryxjs.com/guide/)
|
|
230
259
|
- [Actions Guide](https://keryxjs.com/guide/actions)
|
|
260
|
+
- [Streaming](https://keryxjs.com/guide/streaming)
|
|
261
|
+
- [Caching](https://keryxjs.com/guide/caching)
|
|
231
262
|
- [API Reference](https://keryxjs.com/reference/actions)
|
|
232
263
|
|
|
233
264
|
<p align="center">
|
package/initializers/swagger.ts
CHANGED
|
@@ -202,8 +202,8 @@ export class SwaggerInitializer extends Initializer {
|
|
|
202
202
|
try {
|
|
203
203
|
const cached = await cacheFileHandle.json();
|
|
204
204
|
if (cached.hash === hash) {
|
|
205
|
-
logger.
|
|
206
|
-
`Loaded ${Object.keys(cached.responseSchemas).length} response schemas from cache`,
|
|
205
|
+
logger.debug(
|
|
206
|
+
`Loaded ${Object.keys(cached.responseSchemas).length} OpenAPI response schemas from cache`,
|
|
207
207
|
);
|
|
208
208
|
return { responseSchemas: cached.responseSchemas };
|
|
209
209
|
}
|