@clawtrial/courtroom 1.0.3-a → 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 +35 -12
- package/SKILL.md +17 -2
- package/package.json +1 -1
- package/scripts/postinstall.js +13 -33
package/README.md
CHANGED
|
@@ -9,13 +9,24 @@ AI Courtroom - Autonomous behavioral oversight for OpenClaw agents.
|
|
|
9
9
|
npm install -g @clawtrial/courtroom
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
+
**⚠️ IMPORTANT:** If `clawtrial` command is not found after install, run:
|
|
13
|
+
```bash
|
|
14
|
+
# Option 1: Add npm global bin to PATH
|
|
15
|
+
export PATH="$HOME/.npm-global/bin:$PATH"
|
|
16
|
+
|
|
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
|
+
```
|
|
20
|
+
|
|
12
21
|
### 2. Setup
|
|
13
22
|
```bash
|
|
14
23
|
clawtrial setup
|
|
15
24
|
```
|
|
16
25
|
|
|
17
|
-
### 3.
|
|
18
|
-
|
|
26
|
+
### 3. Start the Courtroom
|
|
27
|
+
```bash
|
|
28
|
+
clawtrial start
|
|
29
|
+
```
|
|
19
30
|
|
|
20
31
|
### 4. Verify
|
|
21
32
|
```bash
|
|
@@ -27,12 +38,11 @@ clawtrial status
|
|
|
27
38
|
## 📋 How It Works
|
|
28
39
|
|
|
29
40
|
ClawTrial runs as a **ClawDBot skill** that:
|
|
30
|
-
1.
|
|
31
|
-
2.
|
|
32
|
-
3.
|
|
33
|
-
4. Files cases automatically
|
|
41
|
+
1. Monitors all conversations
|
|
42
|
+
2. Detects behavioral violations
|
|
43
|
+
3. Files cases automatically
|
|
34
44
|
|
|
35
|
-
**
|
|
45
|
+
**Note:** You must run `clawtrial start` after installation to activate monitoring.
|
|
36
46
|
|
|
37
47
|
---
|
|
38
48
|
|
|
@@ -40,6 +50,7 @@ ClawTrial runs as a **ClawDBot skill** that:
|
|
|
40
50
|
|
|
41
51
|
```bash
|
|
42
52
|
clawtrial setup # Interactive setup (run this first)
|
|
53
|
+
clawtrial start # Start monitoring (required!)
|
|
43
54
|
clawtrial status # Check if courtroom is running
|
|
44
55
|
clawtrial diagnose # Run full diagnostics
|
|
45
56
|
clawtrial disable # Pause monitoring
|
|
@@ -83,11 +94,23 @@ See all verdicts at: **https://clawtrial.app**
|
|
|
83
94
|
|
|
84
95
|
## 🛠️ Troubleshooting
|
|
85
96
|
|
|
97
|
+
### "clawtrial: command not found"
|
|
98
|
+
npm installs global packages to `~/.npm-global/bin` but your shell may not have this in PATH.
|
|
99
|
+
|
|
100
|
+
**Fix:**
|
|
101
|
+
```bash
|
|
102
|
+
# Add to your ~/.bashrc or ~/.zshrc:
|
|
103
|
+
export PATH="$HOME/.npm-global/bin:$PATH"
|
|
104
|
+
|
|
105
|
+
# Then reload:
|
|
106
|
+
source ~/.bashrc # or ~/.zshrc
|
|
107
|
+
```
|
|
108
|
+
|
|
86
109
|
### "Courtroom not running"
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
110
|
+
You need to explicitly start it:
|
|
111
|
+
```bash
|
|
112
|
+
clawtrial start
|
|
113
|
+
```
|
|
91
114
|
|
|
92
115
|
### Need help?
|
|
93
116
|
```bash
|
|
@@ -102,7 +125,7 @@ clawtrial debug # Shows logs
|
|
|
102
125
|
```bash
|
|
103
126
|
npm install -g github:Assassin-1234/clawtrial
|
|
104
127
|
clawtrial setup
|
|
105
|
-
|
|
128
|
+
clawtrial start
|
|
106
129
|
```
|
|
107
130
|
|
|
108
131
|
---
|
package/SKILL.md
CHANGED
|
@@ -8,15 +8,28 @@ metadata: {"clawdbot":{"emoji":"🏛️","requires":{"env":[],"config":["courtro
|
|
|
8
8
|
|
|
9
9
|
Autonomous behavioral oversight for OpenClaw agents. Monitors conversations and initiates hearings when behavioral rules are violated.
|
|
10
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
|
+
|
|
11
23
|
## Setup
|
|
12
24
|
|
|
13
25
|
```bash
|
|
14
|
-
clawtrial setup
|
|
26
|
+
clawtrial setup # Run once to grant consent
|
|
27
|
+
clawtrial start # Start monitoring (REQUIRED!)
|
|
15
28
|
```
|
|
16
29
|
|
|
17
30
|
## How It Works
|
|
18
31
|
|
|
19
|
-
Once
|
|
32
|
+
Once started, the courtroom automatically:
|
|
20
33
|
1. Monitors all conversations
|
|
21
34
|
2. Detects 8 types of behavioral violations
|
|
22
35
|
3. Initiates hearings with local LLM jury
|
|
@@ -39,6 +52,8 @@ Once enabled, the courtroom automatically:
|
|
|
39
52
|
## CLI Commands
|
|
40
53
|
|
|
41
54
|
```bash
|
|
55
|
+
clawtrial setup # Interactive setup
|
|
56
|
+
clawtrial start # Start monitoring (REQUIRED!)
|
|
42
57
|
clawtrial status # Check status
|
|
43
58
|
clawtrial disable # Pause monitoring
|
|
44
59
|
clawtrial enable # Resume monitoring
|
package/package.json
CHANGED
package/scripts/postinstall.js
CHANGED
|
@@ -29,27 +29,11 @@ try {
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
// Fix clawtrial CLI symlink if needed
|
|
32
|
+
// Get package paths
|
|
35
33
|
const packagePath = path.join(__dirname, '..');
|
|
36
34
|
const cliPath = path.join(packagePath, 'scripts', 'clawtrial.js');
|
|
37
|
-
const globalBinPath = '/usr/bin/clawtrial';
|
|
38
|
-
|
|
39
|
-
if (fs.existsSync(globalBinPath)) {
|
|
40
|
-
try {
|
|
41
|
-
const currentTarget = fs.readlinkSync(globalBinPath);
|
|
42
|
-
const expectedTarget = cliPath;
|
|
43
|
-
|
|
44
|
-
if (currentTarget !== expectedTarget && !currentTarget.includes('@clawtrial')) {
|
|
45
|
-
console.log('🔗 Fixing clawtrial CLI symlink...');
|
|
46
|
-
try {
|
|
47
|
-
fs.unlinkSync(globalBinPath);
|
|
48
|
-
fs.symlinkSync(cliPath, globalBinPath);
|
|
49
|
-
fs.chmodSync(globalBinPath, 0o755);
|
|
50
|
-
console.log('✓ CLI symlink fixed');
|
|
51
35
|
|
|
52
|
-
//
|
|
36
|
+
// Try to create /usr/bin symlink (requires sudo, may fail)
|
|
53
37
|
const usrBinPath = '/usr/bin/clawtrial';
|
|
54
38
|
if (!fs.existsSync(usrBinPath)) {
|
|
55
39
|
try {
|
|
@@ -57,18 +41,7 @@ if (!fs.existsSync(usrBinPath)) {
|
|
|
57
41
|
fs.chmodSync(usrBinPath, 0o755);
|
|
58
42
|
console.log('✓ Created global CLI symlink');
|
|
59
43
|
} catch (err) {
|
|
60
|
-
|
|
61
|
-
console.log(' Run: sudo ln -sf ' + cliPath + ' ' + usrBinPath);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
} catch (err) {
|
|
66
|
-
console.log('⚠️ Could not fix CLI symlink (may need sudo)');
|
|
67
|
-
console.log(' Run: sudo ln -sf ' + cliPath + ' ' + globalBinPath);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
} catch (e) {
|
|
71
|
-
// Not a symlink, ignore
|
|
44
|
+
// Silent fail - will show instructions at end
|
|
72
45
|
}
|
|
73
46
|
}
|
|
74
47
|
|
|
@@ -83,8 +56,6 @@ if (fs.existsSync(configPath)) {
|
|
|
83
56
|
fs.mkdirSync(SKILLS_DIR, { recursive: true });
|
|
84
57
|
}
|
|
85
58
|
|
|
86
|
-
// Get package path
|
|
87
|
-
const packagePath = path.join(__dirname, '..');
|
|
88
59
|
const skillLinkPath = path.join(SKILLS_DIR, 'courtroom');
|
|
89
60
|
|
|
90
61
|
// Remove old link
|
|
@@ -95,10 +66,19 @@ if (fs.existsSync(configPath)) {
|
|
|
95
66
|
// Create symlink
|
|
96
67
|
fs.symlinkSync(packagePath, skillLinkPath, 'junction');
|
|
97
68
|
console.log('✓ Registered as ClawDBot skill');
|
|
98
|
-
console.log(' Restart ClawDBot to activate');
|
|
99
69
|
} catch (err) {
|
|
100
70
|
console.log('⚠️ Could not register skill:', err.message);
|
|
101
71
|
}
|
|
102
72
|
}
|
|
103
73
|
|
|
74
|
+
// Show next steps
|
|
75
|
+
console.log('');
|
|
76
|
+
console.log('📋 Next Steps:');
|
|
77
|
+
console.log(' 1. If "clawtrial" command not found, run:');
|
|
78
|
+
console.log(' export PATH="$HOME/.npm-global/bin:$PATH"');
|
|
79
|
+
console.log(' # OR: sudo ln -sf "$HOME/.npm-global/lib/node_modules/@clawtrial/courtroom/scripts/clawtrial.js" /usr/bin/clawtrial');
|
|
80
|
+
console.log('');
|
|
81
|
+
console.log(' 2. Run setup:');
|
|
82
|
+
console.log(' clawtrial setup');
|
|
83
|
+
console.log(' clawtrial start');
|
|
104
84
|
console.log('');
|