@oked/openclaw 0.4.0 → 0.5.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 CHANGED
@@ -56,7 +56,7 @@ All keys go under `plugins.entries.oked`:
56
56
  | `minTier` | `"review" \| "high_stakes"` | `"review"` | Minimum risk tier that triggers approval. Set to `"high_stakes"` to only gate the most dangerous calls. `warning` is informational only and does not block. |
57
57
  | `alwaysApprove` | `string[]` | `[]` | Tool names to always require approval for, regardless of classifier. |
58
58
  | `alwaysAllow` | `string[]` | `[]` | Tool names to never gate. Use sparingly. |
59
- | `timeoutMs` | `number` | `600000` | Per-approval timeout in ms (10 minutes). Max `1800000`. |
59
+ | `timeoutMs` | `number` | `630000` | Per-approval timeout in ms (10.5 minutes, just above the backend's 10 minute expiry). Max `1800000`. |
60
60
 
61
61
  ## What gets gated
62
62
 
package/dist/index.js CHANGED
@@ -23,7 +23,8 @@
23
23
  import * as fs from "node:fs";
24
24
  import * as os from "node:os";
25
25
  import * as path from "node:path";
26
- import { OKedClient, describe as describeAction, degradedDecision, OKedAuthError, OKedBackendUnreachableError, TIER_ORDER, } from "@oked/sdk";
26
+ import { fileURLToPath } from "node:url";
27
+ import { OKedClient, describe as describeAction, degradedDecision, OKedAuthError, OKedBackendUnreachableError, OKedReceiptError, TIER_ORDER, } from "@oked/sdk";
27
28
  import { classifyOpenClawTool } from "./classify-openclaw.js";
28
29
  const MAX_SCRIPT_READ = 4096;
29
30
  function tryReadScriptFile(command) {
@@ -87,6 +88,17 @@ export class OkedDeniedError extends Error {
87
88
  this.blockReason = reason;
88
89
  }
89
90
  }
91
+ // This package's version, read from its package.json at runtime (dist/*.js
92
+ // sits one dir below it) so receipts name the exact client that asked.
93
+ const CLIENT_ID = (() => {
94
+ try {
95
+ const pkgPath = path.join(path.dirname(fileURLToPath(import.meta.url)), "..", "package.json");
96
+ return `@oked/openclaw@${JSON.parse(fs.readFileSync(pkgPath, "utf-8")).version}`;
97
+ }
98
+ catch {
99
+ return "@oked/openclaw";
100
+ }
101
+ })();
90
102
  const PLUGIN_ID = "oked";
91
103
  const plugin = {
92
104
  id: PLUGIN_ID,
@@ -102,6 +114,8 @@ const plugin = {
102
114
  ...(cfg.strictFailClosed !== undefined
103
115
  ? { strictFailClosed: cfg.strictFailClosed }
104
116
  : {}),
117
+ client: CLIENT_ID,
118
+ source: "openclaw",
105
119
  });
106
120
  if (!oked.apiKey) {
107
121
  log?.warn?.(`[oked] no apiKey configured. Plugin will fail-safe DENY every sensitive tool call. ` +
@@ -208,7 +222,14 @@ const plugin = {
208
222
  }
209
223
  }
210
224
  catch (err) {
211
- if (err instanceof OKedAuthError) {
225
+ if (err instanceof OKedReceiptError) {
226
+ // A decision we cannot prove is not a decision - always deny.
227
+ log?.error?.(`[oked] approval receipt for ${toolName} did not verify: ${err.problems.join(", ")}.`);
228
+ outcome =
229
+ `OKed: the approval receipt did not verify (${err.problems.join(", ")}), so this action is denied. ` +
230
+ `Do NOT retry. Stop and report this to the user.`;
231
+ }
232
+ else if (err instanceof OKedAuthError) {
212
233
  // Auth misconfig is not an outage - always deny.
213
234
  log?.error?.(`[oked] invalid API key for ${toolName}.`);
214
235
  outcome =
@@ -67,7 +67,7 @@
67
67
  },
68
68
  "timeoutMs": {
69
69
  "label": "Approval Timeout (ms)",
70
- "help": "How long to wait for a human decision before the action is denied. Defaults to the SDK's value of 600000 (10 minutes); max 1800000 (30 minutes)."
70
+ "help": "How long to wait for a human decision before the action is denied. Defaults to the SDK's value of 630000 (10.5 minutes, just above the backend's 10 minute expiry); max 1800000 (30 minutes)."
71
71
  }
72
72
  }
73
73
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oked/openclaw",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "OKed plugin for OpenClaw. Gates skill and tool calls behind a human approval push to your phone.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -37,7 +37,7 @@
37
37
  }
38
38
  },
39
39
  "dependencies": {
40
- "@oked/sdk": "0.4.0"
40
+ "@oked/sdk": "0.5.0"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/node": "^22.13.10",