@rcrsr/rill-agent-http 0.18.5 → 0.18.6
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 +43 -0
- package/package.json +3 -3
package/README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# @rcrsr/rill-agent-http
|
|
2
|
+
|
|
3
|
+
Hono-based HTTP harness for [`@rcrsr/rill-agent`](https://www.npmjs.com/package/@rcrsr/rill-agent). Wraps an `AgentRouter` in an HTTP server that exposes agent discovery and invocation endpoints.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @rcrsr/rill-agent @rcrsr/rill-agent-http
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { loadManifest, createRouter } from '@rcrsr/rill-agent';
|
|
15
|
+
import { httpHarness } from '@rcrsr/rill-agent-http';
|
|
16
|
+
|
|
17
|
+
const manifest = await loadManifest('./build');
|
|
18
|
+
const router = await createRouter(manifest, {
|
|
19
|
+
globalVars: { ANTHROPIC_API_KEY: process.env.ANTHROPIC_API_KEY ?? '' },
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const harness = httpHarness(router);
|
|
23
|
+
await harness.listen(3000);
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Routes
|
|
27
|
+
|
|
28
|
+
| Method | Path | Description |
|
|
29
|
+
|--------|------|-------------|
|
|
30
|
+
| `GET` | `/agents` | List agents (`describe()` output) |
|
|
31
|
+
| `POST` | `/agents/:name/run` | Invoke a named agent |
|
|
32
|
+
| `POST` | `/run` | Invoke the manifest's default agent |
|
|
33
|
+
|
|
34
|
+
Request bodies match `RunRequest` from `@rcrsr/rill-agent`: `{ params?, timeout? }`. Responses return `RunResponse`: `{ state, result, streamed? }`.
|
|
35
|
+
|
|
36
|
+
## API
|
|
37
|
+
|
|
38
|
+
- `httpHarness(router)` — returns a `HttpHarness` wrapping the given `AgentRouter`
|
|
39
|
+
- `HttpHarness` — `{ app, listen(port), close() }`
|
|
40
|
+
|
|
41
|
+
## License
|
|
42
|
+
|
|
43
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rcrsr/rill-agent-http",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.6",
|
|
4
4
|
"description": "rill agent HTTP harness — Hono-based HTTP server wrapping AgentRouter",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Andre Bremer",
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@hono/node-server": "^1.19.12",
|
|
16
16
|
"hono": "^4.12.10",
|
|
17
|
-
"@rcrsr/rill-agent": "~0.18.
|
|
17
|
+
"@rcrsr/rill-agent": "~0.18.6"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"dts-bundle-generator": "^9.5.1",
|
|
21
21
|
"tsup": "^8.5.0",
|
|
22
|
-
"@rcrsr/rill-agent-hono-kit": "^0.18.
|
|
22
|
+
"@rcrsr/rill-agent-hono-kit": "^0.18.6"
|
|
23
23
|
},
|
|
24
24
|
"files": [
|
|
25
25
|
"dist"
|