@twsxtd/hapi-openclaw 0.1.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/README.md +68 -0
- package/dist/index.js +2106 -0
- package/openclaw.plugin.json +60 -0
- package/package.json +48 -0
package/README.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# @twsxtd/hapi-openclaw
|
|
2
|
+
|
|
3
|
+
Native OpenClaw plugin adapter for HAPI integration work.
|
|
4
|
+
|
|
5
|
+
This package now installs as an OpenClaw native plugin and exposes the HAPI-facing `/hapi/*` route surface from inside the OpenClaw Gateway. The command runtime is still mock-backed for now, but the package can already capture real OpenClaw transcript update payloads through a native plugin service.
|
|
6
|
+
|
|
7
|
+
What it does:
|
|
8
|
+
|
|
9
|
+
- exposes `/hapi/health` and `/hapi/channel/*` through `api.registerHttpRoute(...)`
|
|
10
|
+
- enforces plugin-managed bearer auth
|
|
11
|
+
- signs callback events back to HAPI
|
|
12
|
+
- emits deterministic mock assistant and approval events for now
|
|
13
|
+
- records real transcript-update payloads to plugin state when `prototypeCaptureSessionKey` is configured
|
|
14
|
+
|
|
15
|
+
Plugin config lives under `plugins.entries.hapi-openclaw.config` in OpenClaw config:
|
|
16
|
+
|
|
17
|
+
- `hapiBaseUrl` base URL for HAPI hub callbacks
|
|
18
|
+
- `sharedSecret` shared secret used for HAPI bearer auth and callback signing
|
|
19
|
+
- `namespace` optional callback namespace override, default `default`
|
|
20
|
+
- `prototypeCaptureSessionKey` optional session key whose transcript updates should be captured for real-runtime inspection
|
|
21
|
+
- `prototypeCaptureFileName` optional JSONL file name under plugin state, default `transcript-capture.jsonl`
|
|
22
|
+
|
|
23
|
+
Install from npm:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
openclaw plugins install @twsxtd/hapi-openclaw
|
|
27
|
+
openclaw gateway restart
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Publish from this repo:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
cd openclaw-plugin
|
|
34
|
+
npm publish --access public
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Local packaging smoke test:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
cd openclaw-plugin
|
|
41
|
+
npm pack --dry-run
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Example OpenClaw config:
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"plugins": {
|
|
49
|
+
"entries": {
|
|
50
|
+
"hapi-openclaw": {
|
|
51
|
+
"enabled": true,
|
|
52
|
+
"config": {
|
|
53
|
+
"hapiBaseUrl": "http://127.0.0.1:3006",
|
|
54
|
+
"sharedSecret": "test-secret",
|
|
55
|
+
"namespace": "default",
|
|
56
|
+
"prototypeCaptureSessionKey": "hapi-openclaw:default:debug-user"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Current milestone note:
|
|
65
|
+
|
|
66
|
+
- HAPI official mode should point `OPENCLAW_PLUGIN_BASE_URL` at the OpenClaw Gateway base URL
|
|
67
|
+
- the plugin route surface is native now
|
|
68
|
+
- the real OpenClaw run/approval adapter is still not implemented; command behavior is still backed by the mock runtime
|