@dashclaw/openclaw-plugin 1.6.2 → 1.6.4
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 +246 -217
- package/dist/index.js +272 -19
- package/dist/liveness-probe.d.ts +79 -0
- package/dist/liveness-probe.js +185 -0
- package/openclaw.plugin.json +2 -2
- package/package.json +80 -80
- package/src/HOOK.md +9 -5
- package/src/dashclaw.d.ts +4 -2
- package/src/index.ts +351 -56
- package/src/liveness-probe.ts +232 -0
package/package.json
CHANGED
|
@@ -1,80 +1,80 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@dashclaw/openclaw-plugin",
|
|
3
|
-
"version": "1.6.
|
|
4
|
-
"description": "DashClaw
|
|
5
|
-
"main": "./dist/index.js",
|
|
6
|
-
"types": "./dist/index.d.ts",
|
|
7
|
-
"type": "module",
|
|
8
|
-
"license": "MIT",
|
|
9
|
-
"author": "DashClaw",
|
|
10
|
-
"keywords": [
|
|
11
|
-
"openclaw",
|
|
12
|
-
"openclaw-plugin",
|
|
13
|
-
"dashclaw",
|
|
14
|
-
"governance",
|
|
15
|
-
"ai-safety",
|
|
16
|
-
"hitl",
|
|
17
|
-
"approval"
|
|
18
|
-
],
|
|
19
|
-
"repository": {
|
|
20
|
-
"type": "git",
|
|
21
|
-
"url": "git+https://github.com/ucsandman/DashClaw.git",
|
|
22
|
-
"directory": "packages/openclaw-plugin"
|
|
23
|
-
},
|
|
24
|
-
"homepage": "https://github.com/ucsandman/DashClaw/tree/main/packages/openclaw-plugin#readme",
|
|
25
|
-
"files": [
|
|
26
|
-
"dist/",
|
|
27
|
-
"src/",
|
|
28
|
-
"openclaw.plugin.json",
|
|
29
|
-
"README.md",
|
|
30
|
-
"LICENSE"
|
|
31
|
-
],
|
|
32
|
-
"openclaw": {
|
|
33
|
-
"extensions": [
|
|
34
|
-
"./dist/index.js"
|
|
35
|
-
],
|
|
36
|
-
"hooks": [
|
|
37
|
-
"./dist/index.js"
|
|
38
|
-
],
|
|
39
|
-
"compat": {
|
|
40
|
-
"pluginApi": ">=2026.4.15",
|
|
41
|
-
"minGatewayVersion": "2026.4.15"
|
|
42
|
-
},
|
|
43
|
-
"build": {
|
|
44
|
-
"openclawVersion": "2026.4.15",
|
|
45
|
-
"pluginSdkVersion": "2026.4.15"
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
"scripts": {
|
|
49
|
-
"build": "tsc",
|
|
50
|
-
"typecheck": "tsc --noEmit",
|
|
51
|
-
"prepack": "npm run build"
|
|
52
|
-
},
|
|
53
|
-
"dependencies": {
|
|
54
|
-
"dashclaw": "^5.0.0"
|
|
55
|
-
},
|
|
56
|
-
"peerDependencies": {
|
|
57
|
-
"openclaw": "^2026.4.15"
|
|
58
|
-
},
|
|
59
|
-
"peerDependenciesMeta": {
|
|
60
|
-
"openclaw": {
|
|
61
|
-
"optional": false
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
"devDependencies": {
|
|
65
|
-
"@types/node": "^20.11.0",
|
|
66
|
-
"typescript": "^5.4.0"
|
|
67
|
-
},
|
|
68
|
-
"overrides": {
|
|
69
|
-
"axios": "^1.16.0",
|
|
70
|
-
"tar": "^7.5.22",
|
|
71
|
-
"protobufjs": "^7.6.5",
|
|
72
|
-
"gaxios": {
|
|
73
|
-
"uuid": "^11.1.1"
|
|
74
|
-
},
|
|
75
|
-
"brace-expansion": "^5.0.8",
|
|
76
|
-
"@hono/node-server": "^
|
|
77
|
-
"fast-uri": "^3.1.4",
|
|
78
|
-
"hono": "^4.12.
|
|
79
|
-
}
|
|
80
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@dashclaw/openclaw-plugin",
|
|
3
|
+
"version": "1.6.4",
|
|
4
|
+
"description": "DashClaw policy checks, remote approvals, and execution claims at OpenClaw's supported tool hook boundary.",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"author": "DashClaw",
|
|
10
|
+
"keywords": [
|
|
11
|
+
"openclaw",
|
|
12
|
+
"openclaw-plugin",
|
|
13
|
+
"dashclaw",
|
|
14
|
+
"governance",
|
|
15
|
+
"ai-safety",
|
|
16
|
+
"hitl",
|
|
17
|
+
"approval"
|
|
18
|
+
],
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/ucsandman/DashClaw.git",
|
|
22
|
+
"directory": "packages/openclaw-plugin"
|
|
23
|
+
},
|
|
24
|
+
"homepage": "https://github.com/ucsandman/DashClaw/tree/main/packages/openclaw-plugin#readme",
|
|
25
|
+
"files": [
|
|
26
|
+
"dist/",
|
|
27
|
+
"src/",
|
|
28
|
+
"openclaw.plugin.json",
|
|
29
|
+
"README.md",
|
|
30
|
+
"LICENSE"
|
|
31
|
+
],
|
|
32
|
+
"openclaw": {
|
|
33
|
+
"extensions": [
|
|
34
|
+
"./dist/index.js"
|
|
35
|
+
],
|
|
36
|
+
"hooks": [
|
|
37
|
+
"./dist/index.js"
|
|
38
|
+
],
|
|
39
|
+
"compat": {
|
|
40
|
+
"pluginApi": ">=2026.4.15",
|
|
41
|
+
"minGatewayVersion": "2026.4.15"
|
|
42
|
+
},
|
|
43
|
+
"build": {
|
|
44
|
+
"openclawVersion": "2026.4.15",
|
|
45
|
+
"pluginSdkVersion": "2026.4.15"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"scripts": {
|
|
49
|
+
"build": "tsc",
|
|
50
|
+
"typecheck": "tsc --noEmit",
|
|
51
|
+
"prepack": "npm run build"
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"dashclaw": "^5.0.0"
|
|
55
|
+
},
|
|
56
|
+
"peerDependencies": {
|
|
57
|
+
"openclaw": "^2026.4.15"
|
|
58
|
+
},
|
|
59
|
+
"peerDependenciesMeta": {
|
|
60
|
+
"openclaw": {
|
|
61
|
+
"optional": false
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"devDependencies": {
|
|
65
|
+
"@types/node": "^20.11.0",
|
|
66
|
+
"typescript": "^5.4.0"
|
|
67
|
+
},
|
|
68
|
+
"overrides": {
|
|
69
|
+
"axios": "^1.16.0",
|
|
70
|
+
"tar": "^7.5.22",
|
|
71
|
+
"protobufjs": "^7.6.5",
|
|
72
|
+
"gaxios": {
|
|
73
|
+
"uuid": "^11.1.1"
|
|
74
|
+
},
|
|
75
|
+
"brace-expansion": "^5.0.8",
|
|
76
|
+
"@hono/node-server": "^1.19.15",
|
|
77
|
+
"fast-uri": "^3.1.4",
|
|
78
|
+
"hono": "^4.12.34"
|
|
79
|
+
}
|
|
80
|
+
}
|
package/src/HOOK.md
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: dashclaw-governance
|
|
3
|
-
description: Policy
|
|
4
|
-
version: 1.
|
|
3
|
+
description: Policy checks, remote approvals, and execution claims at OpenClaw's supported tool hook boundary.
|
|
4
|
+
version: 1.6.4
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# DashClaw Governance Hook
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Governs tool calls delivered to OpenClaw's installed `before_tool_call` hook through a five-step loop. Calls outside that host hook are outside this enforcement boundary:
|
|
10
10
|
|
|
11
11
|
1. **Guard** — `before_tool_call` sends the tool name, risk score, and a 500-character parameter summary to DashClaw `/api/guard`. Policies decide `allow`, `warn`, `block`, or `require_approval`.
|
|
12
12
|
2. **Record** — On `allow`/`warn`/`require_approval`, the hook opens a governance record via `/api/actions`. The server is authoritative — it may upgrade an `allow` decision to `pending_approval` for capabilities that require human review.
|
|
13
13
|
3. **Wait** — For `pending_approval` actions, the hook calls `waitForApproval(action_id)` using the **action_records ID from step 2**, not the `guard_decisions` ID from step 1. Operators approve from the DashClaw dashboard, CLI, or mobile PWA. The wait is bounded by `approvalWaitMs` (default 60s — under Codex's ~90s per-tool-call RPC watchdog); on timeout the call blocks with a retry hint while the approval stays open ~300s server-side, so approving late and retrying the same call still works.
|
|
14
|
-
4. **
|
|
14
|
+
4. **Claim** — When the guard advertises execution-claim protocol 1, the hook claims the exact action once immediately before returning control to the host. A lost, rejected, or malformed claim blocks the call and is never retried automatically. Servers that do not advertise claims retain the existing policy and approval flow during the staged rollout. Set `DASHCLAW_REQUIRE_EXECUTION_CLAIMS=1` after the server upgrade to reject legacy responses.
|
|
15
|
+
5. **Outcome** — `after_tool_call` records `completed` or `failed` with the error message, giving DashClaw a full intent → policy → outcome trail.
|
|
15
16
|
|
|
16
17
|
On the first tool call of a run the plugin also opens a DashClaw **Agent Session** (`POST /api/sessions`), and closes it (`PATCH /api/sessions/:id` → `status: completed`) on `agent_end`, so each OpenClaw run appears under the Agent Sessions feature. Session calls are fully fail-safe — a session error never blocks a tool call or the run.
|
|
17
18
|
|
|
@@ -27,13 +28,16 @@ The plugin accepts three interchangeable configuration shapes — pick whichever
|
|
|
27
28
|
|
|
28
29
|
Precedence is `plugin config > env vars`. If env vars are set before the gateway starts, the plugin config can omit URL and API key entirely.
|
|
29
30
|
|
|
30
|
-
See the `configSchema` section in `openclaw.plugin.json` for the full list of optional fields (`agentId`, `failClosed`, `riskScoreDefault`, `highRiskTools`, `approvalWaitMs`).
|
|
31
|
+
See the `configSchema` section in `openclaw.plugin.json` for the full list of optional fields (`agentId`, `failClosed`, `riskScoreDefault`, `highRiskTools`, `approvalWaitMs`). `DASHCLAW_REQUIRE_EXECUTION_CLAIMS=1` is an environment-only rollout pin: enable it after the server supports protocol 1 to reject legacy responses that omit claim negotiation.
|
|
31
32
|
|
|
32
33
|
## Failure modes
|
|
33
34
|
|
|
34
35
|
- If `createAction` fails and `failClosed=true` (default), the tool call is blocked with a clear reason.
|
|
35
36
|
- If `failClosed=false`, the tool call proceeds ungoverned with a warning in the console.
|
|
36
37
|
- If the guard verdict is `block`, no action record is opened — the tool call is hard-stopped and no governance row is created.
|
|
38
|
+
- A server that omits both claim fields retains the legacy guard and approval flow unless strict mode is set. Partial, malformed, or unknown claim advertisements always block.
|
|
39
|
+
- A lost, rejected, or malformed protocol-1 claim acknowledgement blocks the call and is never retried automatically.
|
|
40
|
+
- If the tool runs but outcome recording fails, completion is unknown. Reconcile the external system before retrying the effect.
|
|
37
41
|
|
|
38
42
|
## See also
|
|
39
43
|
|
package/src/dashclaw.d.ts
CHANGED
|
@@ -15,8 +15,10 @@ declare module 'dashclaw' {
|
|
|
15
15
|
export interface GuardDecision {
|
|
16
16
|
decision: 'allow' | 'block' | 'warn' | 'require_approval';
|
|
17
17
|
action_id: string;
|
|
18
|
-
reason?: string;
|
|
19
|
-
signals?: string[];
|
|
18
|
+
reason?: string;
|
|
19
|
+
signals?: string[];
|
|
20
|
+
execution_claim_required?: boolean;
|
|
21
|
+
claim_protocol?: number;
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
export interface ActionRecord {
|