@otakumesi/heph 0.0.1 → 0.0.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 +69 -0
- package/package.json +4 -4
package/README.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Heph
|
|
2
|
+
|
|
3
|
+
Heph is under active pre-release development. APIs and package structure may
|
|
4
|
+
change while the runtime is tested in real applications.
|
|
5
|
+
|
|
6
|
+
Heph is a TypeScript runtime for durable web agents built for Hono-based
|
|
7
|
+
application servers. It gives your server the pieces around an agent loop:
|
|
8
|
+
sessions, runs, tools, event logs, approvals, queues, and HTTP/SSE APIs.
|
|
9
|
+
|
|
10
|
+
Heph does not replace a model client or an in-memory agent loop. Hono can expose
|
|
11
|
+
the HTTP/SSE surface, `pi-agent-core` can decide when to call tools, and Heph
|
|
12
|
+
records and controls the durable runtime path around that execution.
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
pnpm add @otakumesi/heph hono zod
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Entrypoints
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
import { AgentSpec, Tool, createHeph } from "@otakumesi/heph";
|
|
24
|
+
import { createHephRouter } from "@otakumesi/heph/hono";
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Other adapter entrypoints:
|
|
28
|
+
|
|
29
|
+
- `@otakumesi/heph/hono`
|
|
30
|
+
- `@otakumesi/heph/sqlite`
|
|
31
|
+
- `@otakumesi/heph/worker`
|
|
32
|
+
- `@otakumesi/heph/mcp`
|
|
33
|
+
- `@otakumesi/heph/skills`
|
|
34
|
+
|
|
35
|
+
## What Heph Provides
|
|
36
|
+
|
|
37
|
+
- Durable `AgentSession` and `Run` state
|
|
38
|
+
- Run-scoped `ToolManifest` snapshots
|
|
39
|
+
- Tool lifecycle events: `tool.started`, `tool.completed`, `tool.failed`
|
|
40
|
+
- HTTP APIs for creating agents, appending messages, reading runs, and reading events
|
|
41
|
+
- SSE replay from the persisted EventLog
|
|
42
|
+
- Auth context propagation into tools
|
|
43
|
+
- Approval, cancellation, and deferred-result hooks
|
|
44
|
+
- Queue-based execution so web routes can enqueue long-running agent work
|
|
45
|
+
- Hono routing helpers, SQLite stores, worker helpers, and CLI adapters
|
|
46
|
+
|
|
47
|
+
## Tool Bridge
|
|
48
|
+
|
|
49
|
+
Call Heph from your agent-loop tool implementation:
|
|
50
|
+
|
|
51
|
+
```ts
|
|
52
|
+
const toolCall = await ctx.tools.tryCall({
|
|
53
|
+
toolId: "addNumbers",
|
|
54
|
+
input: params
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
if (!toolCall.ok) {
|
|
58
|
+
throw new Error(toolCall.error.message);
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
`ctx.tools.tryCall()` records `tool.failed` and returns the failure so an agent
|
|
63
|
+
loop can notify the model and continue. `ctx.tools.call()` is the stricter API:
|
|
64
|
+
it throws on tool failure, which is useful when the whole Run should fail.
|
|
65
|
+
|
|
66
|
+
## Documentation
|
|
67
|
+
|
|
68
|
+
- Repository: https://github.com/otakumesi/heph
|
|
69
|
+
- Minimal tutorial: https://github.com/otakumesi/heph/blob/main/docs/tutorials/minimal-tool-agent.md
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@otakumesi/heph",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "Forge stateful AI agents in your Hono app.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -54,10 +54,10 @@
|
|
|
54
54
|
"typescript": "^5.9.3",
|
|
55
55
|
"vitest": "^4.0.14",
|
|
56
56
|
"@heph/cli": "0.0.1",
|
|
57
|
-
"@heph/core": "0.0.1",
|
|
58
|
-
"@heph/worker": "0.0.1",
|
|
59
57
|
"@heph/server-hono": "0.0.1",
|
|
60
|
-
"@heph/
|
|
58
|
+
"@heph/worker": "0.0.1",
|
|
59
|
+
"@heph/sqlite": "0.0.1",
|
|
60
|
+
"@heph/core": "0.0.1"
|
|
61
61
|
},
|
|
62
62
|
"scripts": {
|
|
63
63
|
"build": "tsdown",
|