@twsxtd/hapi-openclaw
v0.1.8
Published
Native OpenClaw plugin that bridges HAPI to the OpenClaw Gateway route surface.
Downloads
554
Readme
@twsxtd/hapi-openclaw
Native OpenClaw plugin adapter for HAPI integration work.
This package installs as an OpenClaw native plugin and exposes the HAPI-facing /hapi/* route surface from inside the OpenClaw Gateway. V1 now creates or resumes real OpenClaw sessions, starts real embedded-agent runs, and forwards real assistant transcript messages back into HAPI. Approval bridging is still deferred.
What it does:
- exposes
/hapi/healthand/hapi/channel/*throughapi.registerHttpRoute(...) - enforces plugin-managed bearer auth
- signs callback events back to HAPI
- derives deterministic OpenClaw session keys from HAPI namespace + user key
- starts real OpenClaw embedded-agent runs for
send-message - bridges assistant transcript text updates into HAPI
message/statecallbacks - returns
501for approval endpoints until the real approval bridge lands - records real transcript-update payloads to plugin state when
prototypeCaptureSessionKeyis configured
Plugin config lives under plugins.entries.hapi-openclaw.config in OpenClaw config:
hapiBaseUrlbase URL for HAPI hub callbackssharedSecretshared secret used for HAPI bearer auth and callback signingnamespaceoptional callback namespace override, defaultdefaultprototypeCaptureSessionKeyoptional session key whose transcript updates should be captured for real-runtime inspectionprototypeCaptureFileNameoptional JSONL file name under plugin state, defaulttranscript-capture.jsonl
Install from npm:
openclaw plugins install @twsxtd/hapi-openclaw
openclaw gateway restartPublish from this repo:
cd openclaw-plugin
npm publish --access publicLocal packaging smoke test:
cd openclaw-plugin
npm pack --dry-runExample OpenClaw config:
{
"plugins": {
"entries": {
"hapi-openclaw": {
"enabled": true,
"config": {
"hapiBaseUrl": "http://127.0.0.1:3006",
"sharedSecret": "test-secret",
"namespace": "default",
"prototypeCaptureSessionKey": "agent:main:hapi-openclaw:default:debug-user"
}
}
}
}
}Current milestone note:
- HAPI official mode should point
OPENCLAW_PLUGIN_BASE_URLat the OpenClaw Gateway base URL - the plugin route surface is native now
ensure-default-conversationandsend-messageuse the real OpenClaw runtime now- assistant replies in HAPI come from real OpenClaw transcript updates, not mock text
- approval request / approve / deny bridging is still not implemented in this milestone
