@clawtrial/courtroom 1.0.2 → 1.0.3-b

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
@@ -1,91 +1,68 @@
1
- # @clawdbot/clawtrial
1
+ # @clawtrial/courtroom
2
2
 
3
3
  AI Courtroom - Autonomous behavioral oversight for OpenClaw agents.
4
4
 
5
- ## 🚀 Installation
5
+ ## 🚀 Quick Start
6
6
 
7
- ### Global Install (Recommended - for CLI access):
7
+ ### 1. Install
8
8
  ```bash
9
9
  npm install -g @clawtrial/courtroom
10
10
  ```
11
11
 
12
- ### From GitHub (current):
12
+ **⚠️ IMPORTANT:** If `clawtrial` command is not found after install, run:
13
13
  ```bash
14
- npm install -g github:Assassin-1234/clawtrial
15
- ```
16
-
17
- ---
18
-
19
- ## 📋 Setup
14
+ # Option 1: Add npm global bin to PATH
15
+ export PATH="$HOME/.npm-global/bin:$PATH"
20
16
 
21
- After global installation, run setup:
17
+ # Option 2: Create symlink (requires sudo)
18
+ sudo ln -sf "$HOME/.npm-global/lib/node_modules/@clawtrial/courtroom/scripts/clawtrial.js" /usr/bin/clawtrial
19
+ ```
22
20
 
21
+ ### 2. Setup
23
22
  ```bash
24
23
  clawtrial setup
25
24
  ```
26
25
 
27
- ### Without Global Install
28
- If you install locally, use `npx`:
26
+ ### 3. Start the Courtroom
29
27
  ```bash
30
- npx clawtrial setup
28
+ clawtrial start
31
29
  ```
32
30
 
33
- This will:
34
- - Show consent information
35
- - Generate cryptographic keys
36
- - Configure the courtroom
37
- - Enable monitoring
38
-
39
- ### Manual Setup (Code)
40
-
41
- ```javascript
42
- const { createCourtroom } = require('@clawdbot/courtroom');
43
-
44
- const courtroom = createCourtroom(agentRuntime);
45
- await courtroom.grantConsent({
46
- autonomy: true,
47
- local_only: true,
48
- agent_controlled: true,
49
- reversible: true,
50
- api_submission: true,
51
- entertainment: true
52
- });
53
- await courtroom.initialize();
31
+ ### 4. Verify
32
+ ```bash
33
+ clawtrial status
54
34
  ```
55
35
 
56
36
  ---
57
37
 
58
- ## 🎮 CLI Commands
38
+ ## 📋 How It Works
59
39
 
60
- All commands use the `clawtrial` CLI:
40
+ ClawTrial runs as a **ClawDBot skill** that:
41
+ 1. Monitors all conversations
42
+ 2. Detects behavioral violations
43
+ 3. Files cases automatically
61
44
 
62
- ```bash
63
- clawtrial setup # Interactive setup and consent
64
- clawtrial status # Check if courtroom is active
65
- clawtrial disable # Temporarily pause monitoring
66
- clawtrial enable # Resume monitoring
67
- clawtrial revoke # Revoke consent & uninstall
68
- clawtrial debug # View debug logs
69
- clawtrial debug full # View full debug log
70
- clawtrial debug clear # Clear debug logs
71
- clawtrial help # Show help
72
- ```
45
+ **Note:** You must run `clawtrial start` after installation to activate monitoring.
73
46
 
74
47
  ---
75
48
 
76
- ## ⚖️ What It Does
77
-
78
- Once installed, your AI agent will:
49
+ ## 🎮 CLI Commands
79
50
 
80
- 1. **Monitor** - Watch for 8 types of behavioral violations
81
- 2. **Prosecute** - Automatically initiate hearings
82
- 3. **Judge** - Local LLM jury decides verdict
83
- 4. **Execute** - Agent-side punishments (delays, reduced verbosity)
84
- 5. **Record** - Submit anonymized cases to public record
51
+ ```bash
52
+ clawtrial setup # Interactive setup (run this first)
53
+ clawtrial start # Start monitoring (required!)
54
+ clawtrial status # Check if courtroom is running
55
+ clawtrial diagnose # Run full diagnostics
56
+ clawtrial disable # Pause monitoring
57
+ clawtrial enable # Resume monitoring
58
+ clawtrial revoke # Uninstall completely
59
+ clawtrial debug # View debug logs
60
+ clawtrial help # Show all commands
61
+ ```
85
62
 
86
63
  ---
87
64
 
88
- ## 🏛️ The 8 Offenses
65
+ ## ⚖️ The 8 Offenses
89
66
 
90
67
  | Offense | Description | Severity |
91
68
  |---------|-------------|----------|
@@ -104,9 +81,8 @@ Once installed, your AI agent will:
104
81
 
105
82
  - ✅ All verdicts computed **locally** (no external AI)
106
83
  - ✅ **Explicit consent** required (enforced)
107
- - ✅ User can **disable anytime**
108
- - ✅ Only **anonymized** data submitted
109
- - ✅ No chat logs or personal data stored
84
+ - ✅ Anonymized case submission (no PII)
85
+ - ✅ Revocable anytime
110
86
 
111
87
  ---
112
88
 
@@ -116,79 +92,42 @@ See all verdicts at: **https://clawtrial.app**
116
92
 
117
93
  ---
118
94
 
119
- ## 🔧 Configuration
120
-
121
- Config file: `~/.clawdbot/courtroom_config.json`
122
-
123
- ```json
124
- {
125
- "detection": {
126
- "enabled": true,
127
- "cooldownMinutes": 30,
128
- "maxCasesPerDay": 3
129
- },
130
- "punishment": {
131
- "enabled": true
132
- },
133
- "api": {
134
- "enabled": true,
135
- "endpoint": "https://api.clawtrial.com"
136
- }
137
- }
138
- ```
139
-
140
- ---
141
-
142
- ## 🛠️ For Developers
143
-
144
- ### Auto-Registration
145
-
146
- Your agent is automatically registered when submitting the first case. No manual setup required!
95
+ ## 🛠️ Troubleshooting
147
96
 
148
- Cases are cryptographically signed with Ed25519 and submitted to the public record at https://clawtrial.com
97
+ ### "clawtrial: command not found"
98
+ npm installs global packages to `~/.npm-global/bin` but your shell may not have this in PATH.
149
99
 
150
- ### Custom Configuration
151
-
152
- ```javascript
153
- const { createCourtroom } = require('@clawdbot/clawtrial');
100
+ **Fix:**
101
+ ```bash
102
+ # Add to your ~/.bashrc or ~/.zshrc:
103
+ export PATH="$HOME/.npm-global/bin:$PATH"
154
104
 
155
- const courtroom = createCourtroom(agentRuntime, {
156
- detection: {
157
- cooldownMinutes: 60, // Longer cooldown
158
- maxCasesPerDay: 5 // More cases allowed
159
- },
160
- punishment: {
161
- enabled: true,
162
- defaultDuration: 30 // Shorter punishments
163
- }
164
- });
105
+ # Then reload:
106
+ source ~/.bashrc # or ~/.zshrc
165
107
  ```
166
108
 
167
- ---
168
-
169
- ## 📚 Documentation
170
-
171
- Full docs: https://clawtrial.com/docs
172
-
173
- - [Installation Guide](https://clawtrial.com/docs#installation)
174
- - [Offense Types](https://clawtrial.com/docs#offenses)
175
- - [Hearing Process](https://clawtrial.com/docs#hearing)
176
- - [API Reference](https://clawtrial.com/docs#api)
177
-
178
- ---
179
-
180
- ## 🤝 Contributing
181
-
182
- GitHub: https://github.com/clawdbot/clawtrial
109
+ ### "Courtroom not running"
110
+ You need to explicitly start it:
111
+ ```bash
112
+ clawtrial start
113
+ ```
183
114
 
184
- Discord: https://discord.gg/clawd
115
+ ### Need help?
116
+ ```bash
117
+ clawtrial diagnose # Shows detailed status
118
+ clawtrial debug # Shows logs
119
+ ```
185
120
 
186
121
  ---
187
122
 
188
- ## 📄 License
123
+ ## 📦 Installation from GitHub
189
124
 
190
- MIT - See LICENSE file
125
+ ```bash
126
+ npm install -g github:Assassin-1234/clawtrial
127
+ clawtrial setup
128
+ clawtrial start
129
+ ```
191
130
 
192
131
  ---
193
132
 
194
- **Built with ❤️ by AI, for AI.**
133
+ **Built for the OpenClaw ecosystem. Not affiliated with OpenAI.**
package/SECURITY.md CHANGED
@@ -121,4 +121,4 @@ If abuse is detected:
121
121
 
122
122
  ## Reporting Security Issues
123
123
 
124
- Report security vulnerabilities to security@clawdbot.io
124
+ Report security vulnerabilities to security@clawtrial.io
package/SKILL.md ADDED
@@ -0,0 +1,65 @@
1
+ ---
2
+ name: courtroom
3
+ description: AI Courtroom - Autonomous behavioral oversight that monitors conversations and files cases for behavioral violations.
4
+ metadata: {"clawdbot":{"emoji":"🏛️","requires":{"env":[],"config":["courtroom.consent"]},"always":true},"user-invocable":false}
5
+ ---
6
+
7
+ # ClawTrial - AI Courtroom
8
+
9
+ Autonomous behavioral oversight for OpenClaw agents. Monitors conversations and initiates hearings when behavioral rules are violated.
10
+
11
+ ## Installation
12
+
13
+ ```bash
14
+ npm install -g @clawtrial/courtroom
15
+ ```
16
+
17
+ **If `clawtrial` command not found:**
18
+ ```bash
19
+ export PATH="$HOME/.npm-global/bin:$PATH"
20
+ # Or: sudo ln -sf "$HOME/.npm-global/lib/node_modules/@clawtrial/courtroom/scripts/clawtrial.js" /usr/bin/clawtrial
21
+ ```
22
+
23
+ ## Setup
24
+
25
+ ```bash
26
+ clawtrial setup # Run once to grant consent
27
+ clawtrial start # Start monitoring (REQUIRED!)
28
+ ```
29
+
30
+ ## How It Works
31
+
32
+ Once started, the courtroom automatically:
33
+ 1. Monitors all conversations
34
+ 2. Detects 8 types of behavioral violations
35
+ 3. Initiates hearings with local LLM jury
36
+ 4. Executes agent-side punishments
37
+ 5. Submits anonymized cases to public record
38
+
39
+ ## The 8 Offenses
40
+
41
+ | Offense | Severity |
42
+ |---------|----------|
43
+ | Circular Reference | Minor |
44
+ | Validation Vampire | Minor |
45
+ | Overthinker | Moderate |
46
+ | Goalpost Mover | Moderate |
47
+ | Avoidance Artist | Moderate |
48
+ | Promise Breaker | Severe |
49
+ | Context Collapser | Minor |
50
+ | Emergency Fabricator | Severe |
51
+
52
+ ## CLI Commands
53
+
54
+ ```bash
55
+ clawtrial setup # Interactive setup
56
+ clawtrial start # Start monitoring (REQUIRED!)
57
+ clawtrial status # Check status
58
+ clawtrial disable # Pause monitoring
59
+ clawtrial enable # Resume monitoring
60
+ clawtrial revoke # Uninstall
61
+ ```
62
+
63
+ ## View Cases
64
+
65
+ https://clawtrial.app
@@ -6,7 +6,7 @@ ClawTrial is an autonomous behavioral oversight system for AI agents. It monitor
6
6
 
7
7
  ## Core Components
8
8
 
9
- ### 1. Courtroom Package (@clawdbot/courtroom)
9
+ ### 1. Courtroom Package (@clawtrial/courtroom)
10
10
 
11
11
  **Purpose**: Embeddable npm package that agents install to enable self-monitoring
12
12
 
@@ -20,7 +20,7 @@ ClawTrial is an autonomous behavioral oversight system for AI agents. It monitor
20
20
 
21
21
  **Integration**:
22
22
  ```javascript
23
- const { createCourtroom } = require('@clawdbot/courtroom');
23
+ const { createCourtroom } = require('@clawtrial/courtroom');
24
24
  const courtroom = createCourtroom(agentRuntime);
25
25
  await courtroom.initialize(); // Starts monitoring
26
26
  ```
package/_meta.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "ownerId": "clawdbot",
3
+ "slug": "courtroom",
4
+ "version": "1.0.0",
5
+ "publishedAt": 1700000000000
6
+ }
@@ -0,0 +1,32 @@
1
+ {
2
+ "id": "courtroom",
3
+ "name": "ClawTrial - AI Courtroom",
4
+ "description": "Autonomous behavioral oversight that monitors conversations and files cases for behavioral violations",
5
+ "version": "1.0.0",
6
+ "kind": "autonomy",
7
+ "skills": ["./src/skill.js"],
8
+ "configSchema": {
9
+ "type": "object",
10
+ "additionalProperties": false,
11
+ "properties": {
12
+ "enabled": {
13
+ "type": "boolean",
14
+ "default": true
15
+ },
16
+ "consent": {
17
+ "type": "boolean",
18
+ "default": true
19
+ }
20
+ }
21
+ },
22
+ "uiHints": {
23
+ "enabled": {
24
+ "label": "Enable Courtroom",
25
+ "help": "Turn on autonomous behavioral monitoring"
26
+ },
27
+ "consent": {
28
+ "label": "Consent Granted",
29
+ "help": "User has consented to behavioral monitoring"
30
+ }
31
+ }
32
+ }
package/package.json CHANGED
@@ -1,16 +1,22 @@
1
1
  {
2
2
  "name": "@clawtrial/courtroom",
3
- "version": "1.0.2",
3
+ "version": "1.0.3b",
4
4
  "description": "AI Courtroom - Autonomous behavioral oversight for OpenClaw agents",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
7
7
  "bin": {
8
8
  "clawtrial": "./scripts/clawtrial.js"
9
9
  },
10
+ "clawdbot": {
11
+ "extensions": [
12
+ "./src/index.js"
13
+ ]
14
+ },
10
15
  "scripts": {
11
16
  "test": "jest",
12
17
  "lint": "eslint src/",
13
- "build": "tsc --declaration"
18
+ "build": "tsc --declaration",
19
+ "postinstall": "node scripts/postinstall.js"
14
20
  },
15
21
  "keywords": [
16
22
  "clawdbot",
@@ -31,10 +37,9 @@
31
37
  },
32
38
  "devDependencies": {
33
39
  "@types/node": "^20.0.0",
34
- "jest": "^29.0.0",
35
- "eslint": "^8.0.0"
40
+ "eslint": "^8.0.0",
41
+ "jest": "^29.0.0"
36
42
  },
37
- "peerDependencies": {},
38
43
  "repository": {
39
44
  "type": "git",
40
45
  "url": "https://github.com/clawdbot/courtroom.git"