@oked/openclaw 0.6.23 → 0.6.25
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 +45 -10
- package/assets/icon.png +0 -0
- package/dist/index.d.ts +10 -4
- package/dist/index.js +16 -31
- package/dist/script-excerpt.d.ts +17 -0
- package/dist/script-excerpt.js +89 -0
- package/openclaw.plugin.json +12 -7
- package/package.json +23 -8
package/README.md
CHANGED
|
@@ -3,26 +3,32 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/@oked/openclaw)
|
|
4
4
|
[](./LICENSE)
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
OKed pauses risky OpenClaw actions, like `rm -rf`, force-push, destructive SQL, and production deploys, until you approve them in Telegram or on the [web dashboard](https://oked.ai/dashboard). Reads and other ordinary actions just run. OKed is free during beta, and every decision gets a signed receipt. The iPhone app is coming soon.
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
A `before_tool_call` hook runs for every tool the host reports (built-in or registered by a skill) and classifies it. Calls at `review` and `high_stakes` wait until you decide. A denial returns `{ block: true, blockReason }`.
|
|
9
|
+
|
|
10
|
+
OpenClaw 2026.5.4 or newer is required. That release treats the returned denial as a veto and shows the reason to the agent. An earlier host ignored the return and ran the tool. The declared floor is `>=2026.5.4` on `peerDependencies.openclaw`, `engines.openclaw`, `openclaw.compat.pluginApi`, and `openclaw.install.minHostVersion`. `openclaw.compat.minGatewayVersion` and `openclaw.build.openclawVersion` are `2026.5.4` (2026.5.4 and newer).
|
|
9
11
|
|
|
10
12
|
## Install
|
|
11
13
|
|
|
14
|
+
Install from npm:
|
|
15
|
+
|
|
12
16
|
```bash
|
|
13
|
-
|
|
14
|
-
oked-openclaw init
|
|
17
|
+
openclaw plugins install npm:@oked/openclaw
|
|
15
18
|
```
|
|
16
19
|
|
|
17
|
-
|
|
20
|
+
Once the package is listed on ClawHub, `openclaw plugins install @oked/openclaw` installs it from there.
|
|
18
21
|
|
|
19
|
-
|
|
22
|
+
Pair this machine with [`@oked/openclaw-cli`](../openclaw-cli). The CLI needs the `openclaw` command on your PATH. It pairs this device (or reuses an existing API key), sets `minTier` (a terminal prompt when none is set), writes the entry into `~/.openclaw/openclaw.json`, and offers to restart the gateway.
|
|
20
23
|
|
|
21
24
|
```bash
|
|
22
|
-
|
|
25
|
+
npm install -g @oked/openclaw-cli
|
|
26
|
+
oked-openclaw init
|
|
23
27
|
```
|
|
24
28
|
|
|
25
|
-
|
|
29
|
+
If this package is not already installed, and there is no local checkout, `oked-openclaw init` tries `openclaw plugins install @oked/openclaw` (ClawHub). If that fails, it retries `openclaw plugins install npm:@oked/openclaw`. A checkout or a global npm copy is still linked with `openclaw plugins install --link`.
|
|
30
|
+
|
|
31
|
+
To wire the config by hand after the plugin install, edit `~/.openclaw/openclaw.json`:
|
|
26
32
|
|
|
27
33
|
```json
|
|
28
34
|
{
|
|
@@ -43,7 +49,7 @@ Restart the OpenClaw gateway after a manual edit. [Sign up](https://oked.ai/sign
|
|
|
43
49
|
|
|
44
50
|
## Configuration
|
|
45
51
|
|
|
46
|
-
Keys live under `plugins.entries.oked`. The plugin manifest sets `additionalProperties: false`, so unknown keys are rejected. `OKED_STRICT_FAIL_CLOSED` is read from the environment, not from this object.
|
|
52
|
+
Keys live under `plugins.entries.oked`. The plugin manifest sets `additionalProperties: false`, so unknown keys are rejected. `OKED_STRICT_FAIL_CLOSED` is read from the environment, not from this object. `OKED_SEND_SCRIPT_CONTENT` is the environment form of `sendScriptContent`. A boolean in this object wins when both are set.
|
|
47
53
|
|
|
48
54
|
| Key | Type | Default | Description |
|
|
49
55
|
|---|---|---|---|
|
|
@@ -52,6 +58,7 @@ Keys live under `plugins.entries.oked`. The plugin manifest sets `additionalProp
|
|
|
52
58
|
| `alwaysApprove` | `string[]` | `[]` | Tool names that are always `high_stakes`, whatever the classifier says. |
|
|
53
59
|
| `alwaysAllow` | `string[]` | `[]` | Tool names that are always `safe`. Use sparingly. |
|
|
54
60
|
| `timeoutMs` | `number` | `630000` | Per-approval wait, in milliseconds (10.5 minutes, so the backend's 10 minute expiry answers first). Minimum `1000`, maximum `1800000`. |
|
|
61
|
+
| `sendScriptContent` | `boolean` | `true` | Attach the first 4,096 bytes of a recognized local script so you can see what will run. Set `false` to omit it. Env `OKED_SEND_SCRIPT_CONTENT=0` (or `false`) does the same when this key is absent. |
|
|
55
62
|
|
|
56
63
|
## What gets gated
|
|
57
64
|
|
|
@@ -64,9 +71,37 @@ Names are matched against OpenClaw skill conventions, then unknown names default
|
|
|
64
71
|
|
|
65
72
|
`warning` is logged by the SDK classifier and does not block, even if you set `minTier` below `review`.
|
|
66
73
|
|
|
74
|
+
## What OKed sends
|
|
75
|
+
|
|
76
|
+
Each approval is one JSON request. These fields are in the body:
|
|
77
|
+
|
|
78
|
+
| Field | Contents |
|
|
79
|
+
|---|---|
|
|
80
|
+
| `action` | Tool name, for example `bash` or `deploy_site`. |
|
|
81
|
+
| `description` | One-line summary built from the tool arguments. |
|
|
82
|
+
| `tier` | `review` or `high_stakes`. |
|
|
83
|
+
| `nonce` | A new id for this request, so an old receipt cannot approve a later call. |
|
|
84
|
+
| `client` | This package and version, for example `@oked/openclaw@0.6.25`. |
|
|
85
|
+
| `metadata.tool_input` | The full tool arguments. |
|
|
86
|
+
| `metadata.cwd` | Working directory of the OpenClaw process. |
|
|
87
|
+
| `metadata.source` | `openclaw`. |
|
|
88
|
+
|
|
89
|
+
`metadata.session_id` is included when OpenClaw provides a session id. If there is no session id, the session key is sent under that same field. If neither is present, the field is omitted. The `Authorization` header carries your API key (`Bearer`).
|
|
90
|
+
|
|
91
|
+
For `bash`, `shell`, and `exec`, `metadata.tool_input` can also include:
|
|
92
|
+
|
|
93
|
+
- `_file_size_bytes`: size in bytes of an `rm`, `trash`, `trash-put`, or `rmdir` target, when that path exists.
|
|
94
|
+
- `_script_body`: the first 4,096 bytes of a local script named by the command, so you can see what will run before you approve. The file is read for `python` (including `python3` and `python3.x`), `node`, `ruby`, `perl`, `deno run`, and `bun run`, when the path ends in `.py`, `.js`, `.mjs`, `.ts`, `.rb`, or `.pl`. A shell script invoked as `bash foo.sh` or `sh foo.sh` stays in the command string only.
|
|
95
|
+
|
|
96
|
+
The excerpt is redacted before it is sent. On each line, an assignment whose name is or contains the word `key`, `token`, `secret`, or `password` (including `API_KEY`, `apiKey`, and `DB_PASSWORD`) has the value replaced with `[REDACTED]`. AWS access key ids (`AKIA` or `ASIA` plus 16 characters) and `Bearer` tokens are replaced the same way. A PEM private key block is replaced with `[REDACTED]`. This is a best-effort pass. A secret written in an unusual shape can remain in the excerpt, and the command string is sent as the agent wrote it.
|
|
97
|
+
|
|
98
|
+
The signed receipt is bound to the action, description, tool input (including any excerpt), source, and nonce.
|
|
99
|
+
|
|
100
|
+
To stop sending the excerpt, set `sendScriptContent` to `false` or export `OKED_SEND_SCRIPT_CONTENT=0`. The default is to send it.
|
|
101
|
+
|
|
67
102
|
## Degraded-mode behavior
|
|
68
103
|
|
|
69
|
-
Explicit denials, invalid API keys, a missing API key, receipts that do not verify, and unexpected plugin errors deny the tool call. If the
|
|
104
|
+
Explicit denials, invalid API keys, a missing API key, receipts that do not verify, and unexpected plugin errors deny the tool call. If OKed cannot be reached, the default is to deny `high_stakes` and allow lower tiers, so a short outage does not stop every workflow. Set `OKED_STRICT_FAIL_CLOSED=1` (or `true`) to deny every sensitive action during an outage. That is the recommended setting when these actions should stay blocked until you can decide.
|
|
70
105
|
|
|
71
106
|
## Development
|
|
72
107
|
|
package/assets/icon.png
ADDED
|
Binary file
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @oked/openclaw. OKed plugin for OpenClaw.
|
|
3
3
|
*
|
|
4
|
-
* Registers a `before_tool_call` hook that runs for
|
|
4
|
+
* Registers a `before_tool_call` hook that runs for every tool the agent
|
|
5
5
|
* invokes (built-in or skill-registered). For tool calls classified as
|
|
6
6
|
* sensitive, the hook freezes the agent and asks for a human approval via
|
|
7
|
-
* the OKed
|
|
7
|
+
* Telegram or the OKed dashboard. The agent only proceeds on Approve;
|
|
8
8
|
* any other outcome blocks the call.
|
|
9
9
|
*
|
|
10
10
|
* Failure semantics: fail safe always. If the OKed backend is unreachable,
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
* Plugin config (set in openclaw.json under plugins.entries.oked):
|
|
15
15
|
* {
|
|
16
16
|
* "apiKey": "ok_...", // OKed API key (or OKED_API_KEY env)
|
|
17
|
-
* "backendUrl": "https://...", // optional override
|
|
18
17
|
* "alwaysApprove": ["custom_tool"], // additional names to require approval for
|
|
19
18
|
* "alwaysAllow": ["safe_tool"], // names to never gate
|
|
20
|
-
* "minTier": "review"
|
|
19
|
+
* "minTier": "review", // minimum tier to require approval (default: "review")
|
|
20
|
+
* "sendScriptContent": true // false omits local script excerpts (or OKED_SEND_SCRIPT_CONTENT=0)
|
|
21
21
|
* }
|
|
22
22
|
*/
|
|
23
23
|
import { type RiskTier } from "@oked/sdk";
|
|
@@ -34,6 +34,12 @@ interface OkedPluginConfig extends ClassifyOptions {
|
|
|
34
34
|
* single outage does not mass-abort the agent. high_stakes always denies.
|
|
35
35
|
*/
|
|
36
36
|
strictFailClosed?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* When false, do not attach the local script excerpt (`_script_body`).
|
|
39
|
+
* Default true. Env `OKED_SEND_SCRIPT_CONTENT=0` is the same opt-out when
|
|
40
|
+
* this key is absent. A boolean here wins over the env var.
|
|
41
|
+
*/
|
|
42
|
+
sendScriptContent?: boolean;
|
|
37
43
|
}
|
|
38
44
|
interface BeforeToolCallEvent {
|
|
39
45
|
toolName: string;
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @oked/openclaw. OKed plugin for OpenClaw.
|
|
3
3
|
*
|
|
4
|
-
* Registers a `before_tool_call` hook that runs for
|
|
4
|
+
* Registers a `before_tool_call` hook that runs for every tool the agent
|
|
5
5
|
* invokes (built-in or skill-registered). For tool calls classified as
|
|
6
6
|
* sensitive, the hook freezes the agent and asks for a human approval via
|
|
7
|
-
* the OKed
|
|
7
|
+
* Telegram or the OKed dashboard. The agent only proceeds on Approve;
|
|
8
8
|
* any other outcome blocks the call.
|
|
9
9
|
*
|
|
10
10
|
* Failure semantics: fail safe always. If the OKed backend is unreachable,
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
* Plugin config (set in openclaw.json under plugins.entries.oked):
|
|
15
15
|
* {
|
|
16
16
|
* "apiKey": "ok_...", // OKed API key (or OKED_API_KEY env)
|
|
17
|
-
* "backendUrl": "https://...", // optional override
|
|
18
17
|
* "alwaysApprove": ["custom_tool"], // additional names to require approval for
|
|
19
18
|
* "alwaysAllow": ["safe_tool"], // names to never gate
|
|
20
|
-
* "minTier": "review"
|
|
19
|
+
* "minTier": "review", // minimum tier to require approval (default: "review")
|
|
20
|
+
* "sendScriptContent": true // false omits local script excerpts (or OKED_SEND_SCRIPT_CONTENT=0)
|
|
21
21
|
* }
|
|
22
22
|
*/
|
|
23
23
|
import * as fs from "node:fs";
|
|
@@ -26,29 +26,7 @@ import * as path from "node:path";
|
|
|
26
26
|
import { fileURLToPath } from "node:url";
|
|
27
27
|
import { OKedClient, describe as describeAction, degradedDecision, OKedAuthError, OKedBackendUnreachableError, OKedReceiptError, TIER_ORDER, } from "@oked/sdk";
|
|
28
28
|
import { classifyOpenClawTool } from "./classify-openclaw.js";
|
|
29
|
-
|
|
30
|
-
function tryReadScriptFile(command) {
|
|
31
|
-
// Match: python3 script.py, node script.js, ruby script.rb, etc.
|
|
32
|
-
// Skip -c/-e flags (handled by findSqlInCommand inline path).
|
|
33
|
-
const m = command.trim().match(/\b(?:python\d?(?:\.\d+)?|node|ruby|perl|deno\s+run|bun\s+run)\s+(?:-[^\s]+\s+)*(['"]?)([^\s'"]+\.(?:py|js|mjs|ts|rb|pl))\1/);
|
|
34
|
-
if (!m)
|
|
35
|
-
return undefined;
|
|
36
|
-
let target = m[2];
|
|
37
|
-
if (target.startsWith("~/"))
|
|
38
|
-
target = path.join(os.homedir(), target.slice(2));
|
|
39
|
-
else if (!path.isAbsolute(target))
|
|
40
|
-
target = path.resolve(target);
|
|
41
|
-
try {
|
|
42
|
-
const fd = fs.openSync(target, "r");
|
|
43
|
-
const buf = Buffer.alloc(MAX_SCRIPT_READ);
|
|
44
|
-
const bytesRead = fs.readSync(fd, buf, 0, MAX_SCRIPT_READ, 0);
|
|
45
|
-
fs.closeSync(fd);
|
|
46
|
-
return buf.toString("utf8", 0, bytesRead);
|
|
47
|
-
}
|
|
48
|
-
catch {
|
|
49
|
-
return undefined;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
29
|
+
import { redactScriptExcerpt, resolveSendScriptContent, tryReadScriptFile } from "./script-excerpt.js";
|
|
52
30
|
function tryStatRmTarget(command) {
|
|
53
31
|
const m = command.trim().match(/\b(?:rm|trash|trash-put|rmdir)\s+(?:-[^\s]+\s+)*(['"]?)([^\s'"]+)\1/);
|
|
54
32
|
if (!m)
|
|
@@ -100,10 +78,11 @@ const CLIENT_ID = (() => {
|
|
|
100
78
|
}
|
|
101
79
|
})();
|
|
102
80
|
const PLUGIN_ID = "oked";
|
|
81
|
+
const LISTING_DESCRIPTION = "Pauses risky OpenClaw actions, like rm -rf, force-push, destructive SQL and prod deploys, until you approve them in Telegram or on the OKed web dashboard. Everything else just runs. Every decision gets a signed receipt.";
|
|
103
82
|
const plugin = {
|
|
104
83
|
id: PLUGIN_ID,
|
|
105
84
|
name: "OKed Approvals",
|
|
106
|
-
description:
|
|
85
|
+
description: LISTING_DESCRIPTION,
|
|
107
86
|
register(api) {
|
|
108
87
|
const cfg = api.pluginConfig ?? {};
|
|
109
88
|
const log = api.logger;
|
|
@@ -187,9 +166,15 @@ const plugin = {
|
|
|
187
166
|
const sizeBytes = tryStatRmTarget(cmd);
|
|
188
167
|
if (sizeBytes !== undefined)
|
|
189
168
|
enrichedParams = { ...params, _file_size_bytes: sizeBytes };
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
169
|
+
// First 4,096 bytes of a recognized local script, after redaction,
|
|
170
|
+
// so the approver can see what will run. Opt out with
|
|
171
|
+
// sendScriptContent: false or OKED_SEND_SCRIPT_CONTENT=0.
|
|
172
|
+
if (resolveSendScriptContent(cfg.sendScriptContent)) {
|
|
173
|
+
const scriptBody = tryReadScriptFile(cmd);
|
|
174
|
+
if (scriptBody !== undefined) {
|
|
175
|
+
enrichedParams = { ...enrichedParams, _script_body: redactScriptExcerpt(scriptBody) };
|
|
176
|
+
}
|
|
177
|
+
}
|
|
193
178
|
}
|
|
194
179
|
}
|
|
195
180
|
// Compute the outcome first; only throw/return AFTER the try/catch so a
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Local script excerpt attached to an OpenClaw approval.
|
|
3
|
+
*
|
|
4
|
+
* For a recognized interpreter command, the first 4,096 bytes of the named
|
|
5
|
+
* file are included so the approver can see what will run. Obvious secrets
|
|
6
|
+
* in that excerpt are redacted first. This is a best-effort pass.
|
|
7
|
+
*/
|
|
8
|
+
export declare const MAX_SCRIPT_READ = 4096;
|
|
9
|
+
/** Replace obvious secrets. The command string itself is not passed through here. */
|
|
10
|
+
export declare function redactScriptExcerpt(text: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* Whether the approval should include `_script_body`.
|
|
13
|
+
* Plugin config wins. Otherwise `OKED_SEND_SCRIPT_CONTENT=0` or `false` turns
|
|
14
|
+
* it off. Anything else, including an unset variable, leaves the default on.
|
|
15
|
+
*/
|
|
16
|
+
export declare function resolveSendScriptContent(configValue?: boolean): boolean;
|
|
17
|
+
export declare function tryReadScriptFile(command: string): string | undefined;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Local script excerpt attached to an OpenClaw approval.
|
|
3
|
+
*
|
|
4
|
+
* For a recognized interpreter command, the first 4,096 bytes of the named
|
|
5
|
+
* file are included so the approver can see what will run. Obvious secrets
|
|
6
|
+
* in that excerpt are redacted first. This is a best-effort pass.
|
|
7
|
+
*/
|
|
8
|
+
import * as fs from "node:fs";
|
|
9
|
+
import * as os from "node:os";
|
|
10
|
+
import * as path from "node:path";
|
|
11
|
+
export const MAX_SCRIPT_READ = 4096;
|
|
12
|
+
const SENSITIVE_WORDS = new Set(["password", "passwd", "pwd", "secret", "token", "key"]);
|
|
13
|
+
const ASSIGN = /^(\s*(?:export\s+)?)((?:const|let|var)\s+)?(['"]?)([A-Za-z_][A-Za-z0-9_.-]*)\3(\s*[=:]\s*)(.*)$/;
|
|
14
|
+
const PEM = /-----BEGIN [A-Z ]*PRIVATE KEY-----[\s\S]*?(?:-----END [A-Z ]*PRIVATE KEY-----|$)/g;
|
|
15
|
+
function nameWords(name) {
|
|
16
|
+
return name
|
|
17
|
+
.replace(/([a-z0-9])([A-Z])/g, "$1 $2")
|
|
18
|
+
.split(/[_\-.]+/)
|
|
19
|
+
.flatMap((part) => part.split(/\s+/))
|
|
20
|
+
.filter((part) => part.length > 0)
|
|
21
|
+
.map((part) => part.toLowerCase());
|
|
22
|
+
}
|
|
23
|
+
function isSensitiveName(name) {
|
|
24
|
+
return nameWords(name).some((word) => SENSITIVE_WORDS.has(word));
|
|
25
|
+
}
|
|
26
|
+
function redactAssignmentAndTokens(line) {
|
|
27
|
+
const assigned = line.replace(ASSIGN, (full, prefix, decl, quote, name, sep) => {
|
|
28
|
+
if (!isSensitiveName(name))
|
|
29
|
+
return full;
|
|
30
|
+
return `${prefix}${decl ?? ""}${quote}${name}${quote}${sep}[REDACTED]`;
|
|
31
|
+
});
|
|
32
|
+
return assigned
|
|
33
|
+
.replace(/\b(?:AKIA|ASIA)[0-9A-Z]{16}\b/g, "[REDACTED]")
|
|
34
|
+
.replace(/\b(Bearer\s+)[A-Za-z0-9._~+/-]{8,}/gi, "$1[REDACTED]");
|
|
35
|
+
}
|
|
36
|
+
/** Replace obvious secrets. The command string itself is not passed through here. */
|
|
37
|
+
export function redactScriptExcerpt(text) {
|
|
38
|
+
const withoutKeys = text.replace(PEM, "[REDACTED]");
|
|
39
|
+
return withoutKeys
|
|
40
|
+
.split(/\r?\n/)
|
|
41
|
+
.map((line) => {
|
|
42
|
+
const comment = line.match(/^(\s*(?:\/\/|#)\s*)(.*)$/);
|
|
43
|
+
if (!comment)
|
|
44
|
+
return redactAssignmentAndTokens(line);
|
|
45
|
+
return `${comment[1]}${redactAssignmentAndTokens(comment[2] ?? "")}`;
|
|
46
|
+
})
|
|
47
|
+
.join("\n");
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Whether the approval should include `_script_body`.
|
|
51
|
+
* Plugin config wins. Otherwise `OKED_SEND_SCRIPT_CONTENT=0` or `false` turns
|
|
52
|
+
* it off. Anything else, including an unset variable, leaves the default on.
|
|
53
|
+
*/
|
|
54
|
+
export function resolveSendScriptContent(configValue) {
|
|
55
|
+
if (typeof configValue === "boolean")
|
|
56
|
+
return configValue;
|
|
57
|
+
const raw = process.env.OKED_SEND_SCRIPT_CONTENT;
|
|
58
|
+
if (raw === undefined)
|
|
59
|
+
return true;
|
|
60
|
+
const value = raw.trim().toLowerCase();
|
|
61
|
+
if (value === "0" || value === "false" || value === "no" || value === "off")
|
|
62
|
+
return false;
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
export function tryReadScriptFile(command) {
|
|
66
|
+
// python3 script.py, node script.js, ruby script.rb, and the same for
|
|
67
|
+
// perl, deno run, and bun run. Skip -c/-e (those bodies are already in
|
|
68
|
+
// the command string). Shell scripts such as `bash foo.sh` are not read.
|
|
69
|
+
const m = command.trim().match(/\b(?:python\d?(?:\.\d+)?|node|ruby|perl|deno\s+run|bun\s+run)\s+(?:-[^\s]+\s+)*(['"]?)([^\s'"]+\.(?:py|js|mjs|ts|rb|pl))\1/);
|
|
70
|
+
if (!m)
|
|
71
|
+
return undefined;
|
|
72
|
+
let target = m[2];
|
|
73
|
+
if (!target)
|
|
74
|
+
return undefined;
|
|
75
|
+
if (target.startsWith("~/"))
|
|
76
|
+
target = path.join(os.homedir(), target.slice(2));
|
|
77
|
+
else if (!path.isAbsolute(target))
|
|
78
|
+
target = path.resolve(target);
|
|
79
|
+
try {
|
|
80
|
+
const fd = fs.openSync(target, "r");
|
|
81
|
+
const buf = Buffer.alloc(MAX_SCRIPT_READ);
|
|
82
|
+
const bytesRead = fs.readSync(fd, buf, 0, MAX_SCRIPT_READ, 0);
|
|
83
|
+
fs.closeSync(fd);
|
|
84
|
+
return buf.toString("utf8", 0, bytesRead);
|
|
85
|
+
}
|
|
86
|
+
catch {
|
|
87
|
+
return undefined;
|
|
88
|
+
}
|
|
89
|
+
}
|
package/openclaw.plugin.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "oked",
|
|
3
3
|
"name": "OKed",
|
|
4
|
-
"description": "
|
|
4
|
+
"description": "Pauses risky OpenClaw actions, like rm -rf, force-push, destructive SQL and prod deploys, until you approve them in Telegram or on the OKed web dashboard. Everything else just runs. Every decision gets a signed receipt.",
|
|
5
|
+
"categories": ["security"],
|
|
5
6
|
"activation": {
|
|
6
7
|
"onStartup": true
|
|
7
8
|
},
|
|
@@ -35,6 +36,10 @@
|
|
|
35
36
|
"type": "integer",
|
|
36
37
|
"minimum": 1000,
|
|
37
38
|
"maximum": 1800000
|
|
39
|
+
},
|
|
40
|
+
"sendScriptContent": {
|
|
41
|
+
"type": "boolean",
|
|
42
|
+
"default": true
|
|
38
43
|
}
|
|
39
44
|
}
|
|
40
45
|
},
|
|
@@ -46,12 +51,8 @@
|
|
|
46
51
|
"apiKey": {
|
|
47
52
|
"label": "OKed API Key",
|
|
48
53
|
"placeholder": "ok_...",
|
|
49
|
-
"help": "Your OKed API key from https://app.oked.ai/dashboard."
|
|
50
|
-
|
|
51
|
-
"backendUrl": {
|
|
52
|
-
"label": "Backend URL",
|
|
53
|
-
"placeholder": "https://api.oked.ai",
|
|
54
|
-
"help": "Override the OKed backend URL. Default is the hosted backend."
|
|
54
|
+
"help": "Your OKed API key from https://app.oked.ai/dashboard.",
|
|
55
|
+
"sensitive": true
|
|
55
56
|
},
|
|
56
57
|
"minTier": {
|
|
57
58
|
"label": "Minimum Approval Tier",
|
|
@@ -68,6 +69,10 @@
|
|
|
68
69
|
"timeoutMs": {
|
|
69
70
|
"label": "Approval Timeout (ms)",
|
|
70
71
|
"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)."
|
|
72
|
+
},
|
|
73
|
+
"sendScriptContent": {
|
|
74
|
+
"label": "Send script excerpt",
|
|
75
|
+
"help": "When a shell command runs a local Python, Node, Ruby, Perl, Deno, or Bun script, include the first 4096 bytes in the approval so you can see what will run. Set false to omit it. OKED_SEND_SCRIPT_CONTENT=0 does the same when this is unset."
|
|
71
76
|
}
|
|
72
77
|
}
|
|
73
78
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oked/openclaw",
|
|
3
|
-
"version": "0.6.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.6.25",
|
|
4
|
+
"description": "Pauses risky OpenClaw actions, like rm -rf, force-push, destructive SQL and prod deploys, until you approve them in Telegram or on the OKed web dashboard. Everything else just runs. Every decision gets a signed receipt.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -14,22 +14,36 @@
|
|
|
14
14
|
"files": [
|
|
15
15
|
"dist",
|
|
16
16
|
"openclaw.plugin.json",
|
|
17
|
-
"README.md"
|
|
17
|
+
"README.md",
|
|
18
|
+
"assets"
|
|
18
19
|
],
|
|
19
20
|
"scripts": {
|
|
20
21
|
"prebuild": "npm run build --workspace=@oked/sdk",
|
|
21
22
|
"build": "tsc",
|
|
22
23
|
"dev": "tsc --watch",
|
|
23
|
-
"test": "npm run build && node src/smoke.test.mjs",
|
|
24
|
+
"test": "npm run build && node src/clawhub-metadata.test.mjs && node src/script-excerpt.test.mjs && node src/smoke.test.mjs",
|
|
24
25
|
"prepublishOnly": "npm run build"
|
|
25
26
|
},
|
|
26
27
|
"openclaw": {
|
|
27
28
|
"extensions": [
|
|
28
29
|
"./dist/index.js"
|
|
29
|
-
]
|
|
30
|
+
],
|
|
31
|
+
"compat": {
|
|
32
|
+
"pluginApi": ">=2026.5.4",
|
|
33
|
+
"minGatewayVersion": "2026.5.4"
|
|
34
|
+
},
|
|
35
|
+
"build": {
|
|
36
|
+
"openclawVersion": "2026.5.4"
|
|
37
|
+
},
|
|
38
|
+
"install": {
|
|
39
|
+
"clawhubSpec": "@oked/openclaw",
|
|
40
|
+
"npmSpec": "@oked/openclaw",
|
|
41
|
+
"defaultChoice": "clawhub",
|
|
42
|
+
"minHostVersion": ">=2026.5.4"
|
|
43
|
+
}
|
|
30
44
|
},
|
|
31
45
|
"peerDependencies": {
|
|
32
|
-
"openclaw": ">=2026.4
|
|
46
|
+
"openclaw": ">=2026.5.4"
|
|
33
47
|
},
|
|
34
48
|
"peerDependenciesMeta": {
|
|
35
49
|
"openclaw": {
|
|
@@ -37,7 +51,7 @@
|
|
|
37
51
|
}
|
|
38
52
|
},
|
|
39
53
|
"dependencies": {
|
|
40
|
-
"@oked/sdk": "0.6.
|
|
54
|
+
"@oked/sdk": "0.6.25"
|
|
41
55
|
},
|
|
42
56
|
"devDependencies": {
|
|
43
57
|
"@types/node": "^26.6.5",
|
|
@@ -62,7 +76,8 @@
|
|
|
62
76
|
"homepage": "https://github.com/oked-ai/oked-sdk/tree/main/packages/openclaw#readme",
|
|
63
77
|
"license": "Apache-2.0",
|
|
64
78
|
"engines": {
|
|
65
|
-
"node": ">=18"
|
|
79
|
+
"node": ">=18",
|
|
80
|
+
"openclaw": ">=2026.5.4"
|
|
66
81
|
},
|
|
67
82
|
"publishConfig": {
|
|
68
83
|
"access": "public"
|