@crvouga/mockingbird-service-hermes 1.2.0 → 1.3.0
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/CHANGELOG.md +7 -1
- package/DISCOVERY.md +23 -0
- package/README.md +35 -16
- package/dist/chunk-AMUIT2BU.js +5518 -0
- package/dist/chunk-AMUIT2BU.js.map +7 -0
- package/dist/{chunk-CZFRUSRA.js → chunk-Y72MHOLI.js} +136 -25
- package/dist/chunk-Y72MHOLI.js.map +7 -0
- package/dist/cli.js +2 -2
- package/dist/index.d.ts +356 -44
- package/dist/index.js +1 -1
- package/dist/server.d.ts +695 -84
- package/dist/server.js +2 -2
- package/package.json +3 -2
- package/dist/chunk-CZFRUSRA.js.map +0 -7
- package/dist/chunk-OPQVERJU.js +0 -3727
- package/dist/chunk-OPQVERJU.js.map +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
# Changelog — @crvouga/mockingbird-service-hermes
|
|
2
2
|
|
|
3
|
-
## 1.
|
|
3
|
+
## 1.3.0 (2026-10-15)
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- unify the emulator control plane ([2068547](https://github.com/crvouga/mockingbird/commit/2068547bedde4e2e2331c1657c1a78120e84428b))
|
|
8
|
+
|
|
9
|
+
## 1.2.0 (2026-10-08)
|
|
4
10
|
|
|
5
11
|
### Features
|
|
6
12
|
|
package/DISCOVERY.md
CHANGED
|
@@ -34,6 +34,7 @@ repository; live parity is an additional oracle check, not a substitute for the
|
|
|
34
34
|
|
|
35
35
|
- `GET /__admin/health`
|
|
36
36
|
- `GET /__admin`
|
|
37
|
+
- `GET /__admin/controls`
|
|
37
38
|
- `GET /__admin/state`
|
|
38
39
|
- `GET /__admin/requests`
|
|
39
40
|
- `GET /__admin/metrics`
|
|
@@ -44,6 +45,28 @@ For HTTP services, use `x-mockingbird-namespace` (or the documented credential/p
|
|
|
44
45
|
parallel tests do not share state. Admin state, journal, metrics and fault-preset endpoints are
|
|
45
46
|
designed for assertions and diagnosis by consuming test suites.
|
|
46
47
|
|
|
48
|
+
## Admin controls
|
|
49
|
+
|
|
50
|
+
Every HTTP emulator takes the same controls, and each means the same thing at boot
|
|
51
|
+
(`createRuntime({ adminControls })`, `serve --admin-controls`), over `/__admin`, and in a request header:
|
|
52
|
+
|
|
53
|
+
| Control | Admin API | Request header | Interface |
|
|
54
|
+
| --- | --- | --- | --- |
|
|
55
|
+
| Isolate state by key | `GET /__admin/namespaces` | `x-mockingbird-namespace: <key>` | [Namespaces](https://mockingbird.chrisvouga.dev/docs/admin-controls/namespaces) |
|
|
56
|
+
| Reset to boot | `POST /__admin/reset` | `x-mockingbird-reset: true` | [Reset](https://mockingbird.chrisvouga.dev/docs/admin-controls/reset) |
|
|
57
|
+
| Snapshot and restore | `POST /__admin/snapshots`, `POST /__admin/snapshots/<id>/restore` | `x-mockingbird-snapshot: <name>`, `x-mockingbird-restore: <name>` | [Snapshot and restore](https://mockingbird.chrisvouga.dev/docs/admin-controls/snapshot-and-restore) |
|
|
58
|
+
| Move the clock | `POST /__admin/clock` | `x-mockingbird-time: <instant>`, `x-mockingbird-advance: <duration>` | [Clock](https://mockingbird.chrisvouga.dev/docs/admin-controls/clock) |
|
|
59
|
+
| Read or branch from old state | `GET /__admin/timeline` | `x-mockingbird-at: <checkpoint>`, `x-mockingbird-branch: <name>` | [Checkpoints and branches](https://mockingbird.chrisvouga.dev/docs/admin-controls/checkpoints-and-branches) |
|
|
60
|
+
| Inject a fault | `POST /__admin/faults` | `x-mockingbird-fault: <fault>` | [Faults](https://mockingbird.chrisvouga.dev/docs/admin-controls/faults) |
|
|
61
|
+
| Latency and timeouts | `PUT /__admin/latency` | `x-mockingbird-delay: <duration>`, `x-mockingbird-timeout: <duration>` | [Latency and timeouts](https://mockingbird.chrisvouga.dev/docs/admin-controls/latency-and-timeouts) |
|
|
62
|
+
| Replay from a seed | `PUT /__admin/controls` | `x-mockingbird-seed: <seed>` | [Seed and determinism](https://mockingbird.chrisvouga.dev/docs/admin-controls/seed-and-determinism) |
|
|
63
|
+
| See what happened | `GET /__admin/requests`, `GET /__admin/state` | | [Journal, metrics and state](https://mockingbird.chrisvouga.dev/docs/admin-controls/journal-and-state) |
|
|
64
|
+
|
|
65
|
+
`GET /__admin` lists every route and header with a one-line summary, and `GET /__admin/controls`
|
|
66
|
+
is the namespace's current control document. The same seed and the same requests give the same
|
|
67
|
+
bytes. Setting controls as an emulator starts is [Boot](https://mockingbird.chrisvouga.dev/docs/admin-controls/boot); every route and header is in
|
|
68
|
+
the [Reference](https://mockingbird.chrisvouga.dev/docs/admin-controls/reference). The full guide: <https://mockingbird.chrisvouga.dev/docs/admin-controls>.
|
|
69
|
+
|
|
47
70
|
## Report a mismatch or missing capability
|
|
48
71
|
|
|
49
72
|
Follow the [agent reporting contract](https://github.com/crvouga/mockingbird/blob/main/docs/REPORTING_ISSUES.md). Include package version,
|
package/README.md
CHANGED
|
@@ -17,19 +17,29 @@ bun add @crvouga/mockingbird-service-hermes
|
|
|
17
17
|
## Usage
|
|
18
18
|
|
|
19
19
|
```ts
|
|
20
|
-
import {
|
|
20
|
+
import { createServer } from "@crvouga/mockingbird-service-hermes/server"
|
|
21
|
+
|
|
22
|
+
// Test setup: the emulator on an ephemeral loopback port.
|
|
23
|
+
const server = await createServer({ seed: 42 })
|
|
21
24
|
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
+
// Application code: the peer HTTP client's base URL is server.url.
|
|
26
|
+
const baseUrl = server.url
|
|
27
|
+
const accepted = await fetch(`${baseUrl}/v1/runs`, {
|
|
28
|
+
method: "POST",
|
|
29
|
+
headers: { "content-type": "application/json" },
|
|
30
|
+
body: JSON.stringify({ input: "synthetic prompt" }),
|
|
31
|
+
})
|
|
32
|
+
console.log(await accepted.json()) // { run_id, status: "started", replayed: false }
|
|
33
|
+
await server.close()
|
|
25
34
|
```
|
|
26
35
|
|
|
27
36
|
Use the portable `HermesAPI` class for provider routes alone. `createRuntime`
|
|
28
37
|
adds health, namespaces, admin controls, faults, clock, metrics, metadata-only
|
|
29
38
|
request journal, and shared Timeline checkpoints. It needs no Hermes installation,
|
|
30
|
-
provider account, prompt data, API key, or local service.
|
|
39
|
+
provider account, prompt data, API key, or local service. Without a listener,
|
|
40
|
+
`createRuntime().fetch(request)` serves the same routes in-process.
|
|
31
41
|
|
|
32
|
-
|
|
42
|
+
The admin controls share the origin:
|
|
33
43
|
|
|
34
44
|
```ts
|
|
35
45
|
import { createServer } from "@crvouga/mockingbird-service-hermes/server"
|
|
@@ -94,22 +104,31 @@ The executable `mockingbird-hermes` provides `serve`.
|
|
|
94
104
|
## Script a run
|
|
95
105
|
|
|
96
106
|
```ts
|
|
97
|
-
import {
|
|
107
|
+
import { createServer } from "@crvouga/mockingbird-service-hermes/server"
|
|
98
108
|
|
|
99
|
-
const
|
|
100
|
-
const
|
|
109
|
+
const server = await createServer({ seed: 42 })
|
|
110
|
+
const baseUrl = server.url
|
|
111
|
+
const json = { "content-type": "application/json" }
|
|
112
|
+
|
|
113
|
+
// Application code: submit a run.
|
|
114
|
+
const accepted = await fetch(`${baseUrl}/v1/runs`, {
|
|
101
115
|
method: "POST",
|
|
102
|
-
headers:
|
|
116
|
+
headers: json,
|
|
103
117
|
body: JSON.stringify({ input: "synthetic prompt" }),
|
|
104
|
-
})
|
|
105
|
-
const { run_id } = await accepted.json()
|
|
106
|
-
|
|
118
|
+
})
|
|
119
|
+
const { run_id } = (await accepted.json()) as { run_id: string }
|
|
120
|
+
|
|
121
|
+
// Test control: script the outcome. No agent runs, so nothing moves until you do.
|
|
122
|
+
await fetch(`${baseUrl}/__admin/hermes/runs/${run_id}/observe`, {
|
|
107
123
|
method: "POST",
|
|
108
|
-
headers:
|
|
124
|
+
headers: json,
|
|
109
125
|
body: JSON.stringify({ status: "completed", output: "synthetic result" }),
|
|
110
|
-
})
|
|
111
|
-
|
|
126
|
+
})
|
|
127
|
+
|
|
128
|
+
// Application code: poll the run.
|
|
129
|
+
const status = await fetch(`${baseUrl}/v1/runs/${run_id}`)
|
|
112
130
|
console.log(await status.json())
|
|
131
|
+
await server.close()
|
|
113
132
|
```
|
|
114
133
|
|
|
115
134
|
Admission returns 202 `{ run_id, status: "started", replayed: false }`. The stored
|