@mapick/cost-firewall 0.2.7 → 0.2.9
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 +35 -34
- package/dist/index.js +1 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,11 +12,13 @@ AI Call Firewall — real-time monitoring, budget control, automatic circuit bre
|
|
|
12
12
|
## Install
|
|
13
13
|
|
|
14
14
|
**Install script:**
|
|
15
|
+
|
|
15
16
|
```bash
|
|
16
|
-
curl -fsSL https://raw.githubusercontent.com/mapick-ai/cost-firewall/
|
|
17
|
+
curl -fsSL https://raw.githubusercontent.com/mapick-ai/cost-firewall/v0.2.9/install.sh | bash
|
|
17
18
|
```
|
|
18
19
|
|
|
19
20
|
**Manual:**
|
|
21
|
+
|
|
20
22
|
```bash
|
|
21
23
|
openclaw plugins update mapick-firewall || openclaw plugins install @mapick/cost-firewall --force --pin
|
|
22
24
|
openclaw plugins enable mapick-firewall
|
|
@@ -30,17 +32,17 @@ Dashboard: **http://localhost:18789/mapick/dashboard**
|
|
|
30
32
|
|
|
31
33
|
## Commands
|
|
32
34
|
|
|
33
|
-
| CLI
|
|
34
|
-
|
|
35
|
-
| `openclaw firewall status`
|
|
36
|
-
| `openclaw firewall stop`
|
|
37
|
-
| `openclaw firewall resume`
|
|
38
|
-
| `openclaw firewall mode observe`
|
|
39
|
-
| `openclaw firewall mode protect`
|
|
40
|
-
| `openclaw firewall budget set 50000` | Set daily token limit to 50K
|
|
41
|
-
| `openclaw firewall budget reset`
|
|
42
|
-
| `openclaw firewall log --last 20`
|
|
43
|
-
| `openclaw firewall reset <source>`
|
|
35
|
+
| CLI | Action |
|
|
36
|
+
| ------------------------------------ | ------------------------------------------ |
|
|
37
|
+
| `openclaw firewall status` | View status (mode, tokens, blocked, limit) |
|
|
38
|
+
| `openclaw firewall stop` | 🛑 Emergency stop — block all AI calls |
|
|
39
|
+
| `openclaw firewall resume` | ▶️ Resume after stop |
|
|
40
|
+
| `openclaw firewall mode observe` | Observe mode — record only, no blocking |
|
|
41
|
+
| `openclaw firewall mode protect` | Protect mode — enable all breaker rules |
|
|
42
|
+
| `openclaw firewall budget set 50000` | Set daily token limit to 50K |
|
|
43
|
+
| `openclaw firewall budget reset` | Remove daily token limit |
|
|
44
|
+
| `openclaw firewall log --last 20` | Show last 20 events |
|
|
45
|
+
| `openclaw firewall reset <source>` | Reset a source from cooldown |
|
|
44
46
|
|
|
45
47
|
In OpenClaw chat: `/firewall status`, `/firewall stop`, `/firewall resume`, `/firewall log`
|
|
46
48
|
|
|
@@ -62,12 +64,12 @@ In OpenClaw chat: `/firewall status`, `/firewall stop`, `/firewall resume`, `/fi
|
|
|
62
64
|
"tokenVelocityThreshold": 100000,
|
|
63
65
|
"tokenVelocityWindowSec": 60,
|
|
64
66
|
"callFrequencyThreshold": 30,
|
|
65
|
-
"callFrequencyWindowSec": 60
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
67
|
+
"callFrequencyWindowSec": 60,
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
},
|
|
71
73
|
}
|
|
72
74
|
```
|
|
73
75
|
|
|
@@ -77,22 +79,22 @@ In OpenClaw chat: `/firewall status`, `/firewall stop`, `/firewall resume`, `/fi
|
|
|
77
79
|
|
|
78
80
|
Firewall has two modes: **Observe** (record, don't block) and **Protect** (active blocking).
|
|
79
81
|
|
|
80
|
-
| Rule
|
|
81
|
-
|
|
82
|
-
| Emergency Stop
|
|
83
|
-
| Daily Token Limit
|
|
84
|
-
| Consecutive Failures | N failures in a row
|
|
85
|
-
| Token Velocity
|
|
86
|
-
| Call Frequency
|
|
82
|
+
| Rule | Trigger | Effect |
|
|
83
|
+
| -------------------- | ------------------------ | ------------------------- |
|
|
84
|
+
| Emergency Stop | `openclaw firewall stop` | Block all calls |
|
|
85
|
+
| Daily Token Limit | Today's tokens ≥ limit | Block all calls |
|
|
86
|
+
| Consecutive Failures | N failures in a row | Block source for cooldown |
|
|
87
|
+
| Token Velocity | N tokens in W seconds | Block source for cooldown |
|
|
88
|
+
| Call Frequency | N calls in W seconds | Block source for cooldown |
|
|
87
89
|
|
|
88
90
|
### Defaults
|
|
89
91
|
|
|
90
|
-
| Rule
|
|
91
|
-
|
|
92
|
-
| Consecutive Failures | 3
|
|
93
|
-
| Token Velocity
|
|
94
|
-
| Call Frequency
|
|
95
|
-
| Daily Token Limit
|
|
92
|
+
| Rule | Threshold | Window | Cooldown |
|
|
93
|
+
| -------------------- | ---------------- | ------ | -------- |
|
|
94
|
+
| Consecutive Failures | 3 | — | 30s |
|
|
95
|
+
| Token Velocity | 100K tokens | 60s | 30s |
|
|
96
|
+
| Call Frequency | 30 calls | 60s | 30s |
|
|
97
|
+
| Daily Token Limit | None (unlimited) | — | — |
|
|
96
98
|
|
|
97
99
|
---
|
|
98
100
|
|
|
@@ -116,11 +118,10 @@ openclaw gateway restart
|
|
|
116
118
|
# 5. Verify it works
|
|
117
119
|
openclaw firewall status
|
|
118
120
|
|
|
119
|
-
# 6. Optional: set a daily token budget
|
|
120
|
-
openclaw firewall budget set 500000
|
|
121
121
|
```
|
|
122
122
|
|
|
123
123
|
After installation, verify:
|
|
124
|
+
|
|
124
125
|
- [ ] `openclaw plugins list` shows `mapick-firewall` (enabled)
|
|
125
126
|
- [ ] `openclaw firewall status` returns valid JSON
|
|
126
127
|
- [ ] Dashboard accessible at http://localhost:18789/mapick/dashboard
|
|
@@ -168,4 +169,4 @@ MIT
|
|
|
168
169
|
|
|
169
170
|
---
|
|
170
171
|
|
|
171
|
-
|
|
172
|
+
_Made by [Mapick AI](https://github.com/mapick-ai) — because AI agents shouldn't break the bank._
|
package/dist/index.js
CHANGED
|
@@ -13,7 +13,7 @@ import { detectConfigRisks } from "./config-warn.js";
|
|
|
13
13
|
export default {
|
|
14
14
|
id: PLUGIN_ID,
|
|
15
15
|
name: PLUGIN_NAME,
|
|
16
|
-
version: "0.2.
|
|
16
|
+
version: "0.2.9",
|
|
17
17
|
register(api) {
|
|
18
18
|
const config = api.config?.plugins?.entries?.[PLUGIN_ID]?.config ?? {};
|
|
19
19
|
const state = new FirewallState(config);
|
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mapick/cost-firewall",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.9",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "AI Call Firewall — real-time monitoring, budget control, automatic circuit breaker for LLM agents (Claude Code, Aider, OpenClaw, Cursor)",
|
|
6
6
|
"keywords": [
|