@limits/openclaw 0.0.1 → 0.0.2

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
@@ -23,6 +23,7 @@
23
23
  - [Security](#security-openclaw--limits)
24
24
  - [Development](#development)
25
25
  - [Migration from limits-enforcer](#migration-from-limits-enforcer)
26
+ - [Troubleshooting](#troubleshooting)
26
27
  - [License](#license)
27
28
 
28
29
  ---
@@ -46,6 +47,7 @@ Then register the plugin with OpenClaw:
46
47
  ```bash
47
48
  openclaw plugins install ./node_modules/@limits/openclaw
48
49
  openclaw plugins enable "@limits/openclaw"
50
+ openclaw gateway restart
49
51
  ```
50
52
 
51
53
  ---
@@ -59,6 +61,12 @@ openclaw plugins enable "@limits/openclaw"
59
61
  openclaw limits configure
60
62
  ```
61
63
 
64
+ If you see **`error: unknown command 'limits'`**, the OpenClaw CLI may not load plugin commands in your environment. Run the configure script directly (from a directory where the package is installed):
65
+
66
+ ```bash
67
+ node node_modules/@limits/openclaw/scripts/configure.js
68
+ ```
69
+
62
70
  Or set config manually:
63
71
 
64
72
  ```json
@@ -282,6 +290,34 @@ If you were using the plugin under the old name **limits-enforcer**, update your
282
290
 
283
291
  After renaming, reinstall the plugin and enable `"@limits/openclaw"`.
284
292
 
293
+ ---
294
+
295
+ ## Troubleshooting
296
+
297
+ - **Config warning "plugin id mismatch (manifest uses '@limits/openclaw', entry hints 'openclaw')"**
298
+ Some OpenClaw gateways install scoped packages under `extensions/openclaw` instead of `extensions/@limits/openclaw`. The gateway then infers the plugin id from the folder name (`openclaw`), which does not match the manifest id `@limits/openclaw`, so the plugin may not load and `openclaw limits configure` shows **unknown command 'limits'**.
299
+
300
+ **Workaround — install under the scoped path so the gateway matches the config entry:**
301
+ ```bash
302
+ # Create the scope directory and install the package there (adjust if you use npm -g or another path)
303
+ mkdir -p ~/.openclaw/extensions/@limits
304
+ cp -r ./node_modules/@limits/openclaw ~/.openclaw/extensions/@limits/
305
+
306
+ # Tell OpenClaw to load the plugin from that path
307
+ openclaw plugins install ~/.openclaw/extensions/@limits/openclaw
308
+ openclaw plugins enable "@limits/openclaw"
309
+ openclaw gateway restart
310
+ ```
311
+ Then run `openclaw limits configure`.
312
+
313
+ - **`error: unknown command 'limits'`**
314
+ The plugin did not load (often due to the id mismatch above). Use the workaround above, or run the configure wizard without the OpenClaw CLI:
315
+ ```bash
316
+ node node_modules/@limits/openclaw/scripts/configure.js
317
+ ```
318
+ Or from the plugin repo: `npm run configure`.
319
+
320
+
285
321
  ---
286
322
 
287
323
  ## License
package/package.json CHANGED
@@ -1,12 +1,25 @@
1
1
  {
2
2
  "name": "@limits/openclaw",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "Delegates policy enforcement to the Limits platform before and after every tool call. Optional policy-generator tools for creating/updating policies from natural language.",
5
- "keywords": ["openclaw", "limits", "policy", "enforcement", "agent", "guardrails", "ai-safety"],
5
+ "keywords": [
6
+ "openclaw",
7
+ "limits",
8
+ "policy",
9
+ "enforcement",
10
+ "agent",
11
+ "guardrails",
12
+ "ai-safety"
13
+ ],
6
14
  "author": "Limits",
7
15
  "license": "MIT",
8
- "repository": { "type": "git", "url": "git+https://github.com/limitsdev/limits-openclaw.git" },
9
- "bugs": { "url": "https://github.com/limitsdev/limits-openclaw/issues" },
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/limitsdev/limits-openclaw.git"
19
+ },
20
+ "bugs": {
21
+ "url": "https://github.com/limitsdev/limits-openclaw/issues"
22
+ },
10
23
  "homepage": "https://github.com/limitsdev/limits-openclaw#readme",
11
24
  "type": "module",
12
25
  "main": "./src/index.ts",
@@ -19,13 +32,22 @@
19
32
  "node": ">=18.0.0"
20
33
  },
21
34
  "openclaw": {
22
- "hooks": ["./"],
23
- "extensions": ["./"],
24
- "events": ["before_tool_call", "after_tool_call"]
35
+ "id": "@limits/openclaw",
36
+ "entry": "./src/index.ts",
37
+ "hooks": [
38
+ "./"
39
+ ],
40
+ "extensions": [
41
+ "./"
42
+ ],
43
+ "events": [
44
+ "before_tool_call",
45
+ "after_tool_call"
46
+ ]
25
47
  },
26
48
  "devDependencies": {
27
49
  "typescript": "^5.0.0",
28
50
  "@types/node": "^20.0.0",
29
51
  "vitest": "^2.0.0"
30
52
  }
31
- }
53
+ }
@@ -3,11 +3,16 @@
3
3
  * Interactive configure for @limits/openclaw plugin.
4
4
  * Writes to OpenClaw config via: openclaw config set plugins.entries["@limits/openclaw"].config.<key> <value>
5
5
  *
6
- * Run from plugin root: node scripts/configure.js
7
- * Or: npm run configure
6
+ * Use this script when "openclaw limits configure" fails with "unknown command 'limits'" or
7
+ * "plugin id mismatch (entry hints 'openclaw')". That usually means the plugin entry key in
8
+ * OpenClaw config is wrong — it must be exactly "@limits/openclaw". Fix with:
9
+ * openclaw plugins enable "@limits/openclaw"
10
+ * openclaw gateway restart
11
+ * Then "openclaw limits configure" should work. Until then, run this script from the plugin root.
8
12
  *
9
- * Prerequisite: openclaw plugins install <path> and openclaw plugins enable "@limits/openclaw"
13
+ * Run from plugin root: node scripts/configure.js or npm run configure
10
14
  * (so plugins.entries["@limits/openclaw"] exists).
15
+ * Prerequisite: openclaw plugins install <path> and openclaw plugins enable "@limits/openclaw"
11
16
  */
12
17
 
13
18
  import { createInterface } from "node:readline";
@@ -74,8 +79,8 @@ async function main() {
74
79
  const rl = createInterface({ input: process.stdin, output: process.stdout });
75
80
 
76
81
  console.log("\nConfigure @limits/openclaw plugin (writes to OpenClaw config via openclaw config set).");
77
- console.log("Prerequisite: openclaw plugins install <path> (or -l to link).");
78
- console.log("Tip: After linking, you can also run: openclaw limits configure\n");
82
+ console.log("Prerequisite: openclaw plugins install <path> and openclaw plugins enable \"@limits/openclaw\".");
83
+ console.log("If \"openclaw limits configure\" failed with \"unknown command 'limits'\", fix the plugin entry key then run: openclaw gateway restart\n");
79
84
 
80
85
  const apiToken = await ask(rl, "Organization API key (apiToken) — required for enforce and policy-generator tools", process.env.LIMITS_ENFORCER_API_TOKEN || "");
81
86
  const addSkillAnswer = await ask(rl, "Add limits-policy-generator skill to OpenClaw workspace?", "Y");