zihin-paperclip-adapter
v0.1.0
Published
Paperclip external adapter — invoke hosted Zihin agents via @zihin/agent-client (invokeAgent/streamAgent).
Downloads
175
Maintainers
Readme
zihin-paperclip-adapter
Paperclip external adapter that invokes hosted Zihin
agents. It runs an agent on Zihin's side (tools, memory, governance) over the shared
@zihin/agent-client core and maps the result
back to Paperclip's adapter contract.
Adapter type: zihin.
Install
In Paperclip: Settings → Adapters → Install from npm → zihin-paperclip-adapter.
Or via the API:
curl -X POST http://localhost:3102/api/adapters \
-H "Content-Type: application/json" \
-d '{"packageName": "zihin-paperclip-adapter"}'Configure
| Field | Description |
|-------|-------------|
| API Key | zhn_live_* / zhn_test_* from Settings → API Keys (the tenant is embedded). |
| Agent | The agent to invoke — populated from your tenant. |
| Base URL | Defaults to https://llm.zihin.ai. Override only for a private deployment. |
| Allow custom base URL | Off by default — enable only to target a host outside the Zihin domain whitelist. |
| Timeout (ms) | Max total time for the call. |
testEnvironment() validates the connection by listing your agents.
How it works
On each run the adapter renders the Paperclip context into a message, calls streamAgent (streaming
deltas to the Paperclip transcript via onLog), and consolidates the final result into an
AdapterExecutionResult — summary, model, usage, costUsd, and sessionParams.session_id for
conversation continuity. Errors surface Zihin's sanitized message and a requestId for support.
The agent runs the full react loop under your tenant's RBAC, quota and audit — see the Agent Client SDK.
License
MIT
