@karmaniverous/jeeves-server-openclaw 0.1.1 → 0.2.1

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/dist/index.js CHANGED
@@ -160,7 +160,7 @@ function registerServerTools(api, baseUrl) {
160
160
  },
161
161
  buildRequest: (params) => {
162
162
  const p = normalizePath(params);
163
- return ['/api/directory/' + p];
163
+ return ['/api/path/' + p];
164
164
  },
165
165
  },
166
166
  {
@@ -186,13 +186,14 @@ function registerServerTools(api, baseUrl) {
186
186
  },
187
187
  buildRequest: (params) => {
188
188
  const p = normalizePath(params);
189
- const qs = [];
190
- if (params.expiryDays !== undefined)
191
- qs.push('exp=' + String(params.expiryDays));
189
+ const body = { path: '/' + p };
190
+ if (params.expiryDays !== undefined) {
191
+ const ms = Date.now() + params.expiryDays * 86400000;
192
+ body.expiry = String(ms);
193
+ }
192
194
  if (params.depth !== undefined)
193
- qs.push('d=' + String(params.depth));
194
- const query = qs.length > 0 ? '?' + qs.join('&') : '';
195
- return ['/api/share/' + p + query];
195
+ body.depth = params.depth;
196
+ return ['/api/share', 'POST', body];
196
197
  },
197
198
  },
198
199
  {
@@ -216,7 +217,7 @@ function registerServerTools(api, baseUrl) {
216
217
  buildRequest: (params) => {
217
218
  const p = normalizePath(params);
218
219
  const fmt = String(params.format);
219
- return ['/export/' + p + '.' + fmt];
220
+ return ['/api/export/' + p + '?format=' + fmt];
220
221
  },
221
222
  },
222
223
  {
@@ -23,17 +23,18 @@ To convert a Windows file path to a browse path:
23
23
 
24
24
  ## Sharing
25
25
 
26
- - **Insiders** authenticate via Google OAuth — bare URLs work for them
26
+ - **Insiders** authenticate via Google OAuth or key-based auth — bare URLs work for them
27
27
  - **Outsiders** need HMAC share links — use `server_share` to generate them
28
28
  - Share links have configurable expiry (default 30 days)
29
29
  - Directory shares support depth control for recursive access
30
+ - An `outsiderPolicy` can constrain which paths are eligible for outsider sharing
30
31
 
31
32
  ## Export
32
33
 
33
34
  Available formats depend on file type and server capabilities:
34
35
  - **Markdown files:** PDF (requires Chrome), DOCX
35
- - **Mermaid diagrams:** SVG, PNG, PDF
36
- - **PlantUML diagrams:** Formats depend on server configuration
36
+ - **Mermaid diagrams:** SVG, PNG, PDF (Mermaid CLI is bundled)
37
+ - **PlantUML diagrams:** Formats depend on server configuration (jar downloaded automatically via postinstall)
37
38
  - **Directories:** ZIP (insider-only)
38
39
 
39
40
  Use `server_link_info` first to check which formats are available for a path.
@@ -51,8 +52,8 @@ Run `server_status` to check:
51
52
  ### Prerequisites
52
53
 
53
54
  - **Node.js 20+** and npm
54
- - **Java 8+** (optional, for local PlantUML rendering)
55
- - **Chrome/Chromium** (optional, for PDF export)
55
+ - **Java 8+** (optional, for local PlantUML rendering — jar downloaded automatically)
56
+ - **Chrome/Chromium** (required for PDF export)
56
57
  - **NSSM** (Windows) or **systemd** (Linux) for service management
57
58
  - **Caddy** (recommended) or nginx for reverse proxy with automatic TLS
58
59
 
@@ -64,49 +65,105 @@ npm install -g @karmaniverous/jeeves-server
64
65
 
65
66
  ### 2. Create config
66
67
 
67
- Create `jeeves-server.config.json` in the server's working directory:
68
+ Create `jeeves-server.config.json` (or any cosmiconfig-supported format) in the server's working directory:
68
69
 
69
70
  ```json
70
71
  {
71
72
  "port": 1934,
72
- "roots": {
73
- "data": "/path/to/data"
73
+ "chromePath": "/usr/bin/chromium-browser",
74
+ "auth": {
75
+ "modes": ["keys", "google"],
76
+ "google": {
77
+ "clientId": "${GOOGLE_CLIENT_ID}",
78
+ "clientSecret": "${GOOGLE_CLIENT_SECRET}"
79
+ },
80
+ "sessionSecret": "${SESSION_SECRET}"
81
+ },
82
+ "scopes": {
83
+ "public-docs": {
84
+ "allow": ["/d/docs/*"]
85
+ }
86
+ },
87
+ "insiders": {
88
+ "you@example.com": {},
89
+ "contractor@example.com": { "scopes": "public-docs" }
74
90
  },
75
91
  "keys": {
76
92
  "_internal": "random-hex-seed-for-puppeteer",
77
- "_plugin": "random-hex-seed-for-openclaw-plugin"
93
+ "_plugin": "random-hex-seed-for-openclaw-plugin",
94
+ "primary": "random-hex-seed-for-api-access"
78
95
  },
79
- "insiders": [
80
- { "email": "you@example.com" }
81
- ],
82
- "google": {
83
- "clientId": "${GOOGLE_CLIENT_ID}",
84
- "clientSecret": "${GOOGLE_CLIENT_SECRET}"
96
+ "watcherUrl": "http://127.0.0.1:1936",
97
+ "runnerUrl": "http://127.0.0.1:1937"
98
+ }
99
+ ```
100
+
101
+ **Key fields:**
102
+ - `chromePath` — **required**, path to Chrome/Chromium executable
103
+ - `auth.modes` — **required**, array of `"keys"` and/or `"google"`
104
+ - `scopes` — named scope definitions (allow/deny), referenced by name from insiders and keys
105
+ - `insiders` — map of email → `{ scopes?, allow?, deny? }`
106
+ - `keys._internal` — required for PDF/DOCX export (Puppeteer auth)
107
+ - `keys._plugin` — required for OpenClaw plugin auth
108
+ - `outsiderPolicy` — optional global constraints on outsider sharing (can reference a named scope)
109
+
110
+ ### Named Scope Composition
111
+
112
+ Define reusable scope policies at the top level, then reference them by name:
113
+
114
+ ```json
115
+ {
116
+ "scopes": {
117
+ "standard": { "allow": ["/**"], "deny": ["/secrets/**"] },
118
+ "no-vc": { "deny": ["/projects/vc/**"] },
119
+ "no-private": { "deny": ["/projects/jill/**"] }
85
120
  },
86
- "sessionSecret": "${SESSION_SECRET}",
87
- "watcherUrl": "http://127.0.0.1:1936"
121
+ "insiders": {
122
+ "dev@example.com": { "scopes": ["standard", "no-vc"] },
123
+ "jill@example.com": {
124
+ "scopes": ["standard", "no-private"],
125
+ "allow": ["/projects/jill/**"]
126
+ }
127
+ }
88
128
  }
89
129
  ```
90
130
 
131
+ **Composition rules:**
132
+ - Multiple named scopes are **unioned** — all `allow` and `deny` patterns merge
133
+ - Explicit `allow`/`deny` on the insider or key entry act as **overrides** with highest precedence:
134
+ 1. Explicit `deny` → **DENIED** (overrides named allow)
135
+ 2. Explicit `allow` → **ALLOWED** (overrides named deny)
136
+ 3. Standard named scope `allow AND NOT deny`
137
+
138
+ This lets you compose broad policies (e.g. `no-private`) and surgically override them for specific users (e.g. Jill gets access to her own project).
139
+
140
+ Environment variable substitution is supported: `${VAR_NAME}` in string values.
141
+
142
+ Generate key seeds with:
143
+ ```bash
144
+ node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
145
+ ```
146
+
91
147
  ### 3. Validate config
92
148
 
93
149
  ```bash
94
- jeeves-server config validate
95
- jeeves-server config show
150
+ jeeves-server config validate [--config <path>]
151
+ jeeves-server config show [--config <path>]
96
152
  ```
97
153
 
98
154
  ### 4. Register as system service
99
155
 
100
156
  **Windows (NSSM):**
101
157
  ```bash
102
- jeeves-server service install
158
+ jeeves-server service install [--config <path>]
103
159
  jeeves-server service start
104
160
  ```
105
161
 
106
162
  **Linux (systemd):**
107
163
  ```bash
108
- sudo jeeves-server service install
109
- sudo jeeves-server service start
164
+ jeeves-server service install [--config <path>]
165
+ sudo systemctl enable jeeves-server
166
+ sudo systemctl start jeeves-server
110
167
  ```
111
168
 
112
169
  ### 5. Configure Caddy reverse proxy
@@ -127,9 +184,9 @@ Caddy handles TLS certificate provisioning automatically. Ensure DNS A/AAAA reco
127
184
  npx @karmaniverous/jeeves-server-openclaw install
128
185
  ```
129
186
 
130
- Configure the plugin in `openclaw.json` with `apiUrl` and `pluginKey` (matching the `_plugin` key seed from server config).
187
+ Configure the plugin in `openclaw.json` with `apiUrl` and `pluginKey` (matching the `_plugin` key seed from server config).
131
188
 
132
- **Important:** Add `"jeeves-server-openclaw"` to the `tools.allow` array in `openclaw.json` so the agent can use the plugin's tools.
189
+ **Note:** The installer handles plugin registration in `openclaw.json` automatically. If using `openclaw plugins install` instead (when available), you may need to manually add the plugin entry to `plugins.entries` in `openclaw.json` with `apiUrl` and `pluginKey` config values.
133
190
 
134
191
  Restart the gateway to load the plugin.
135
192
 
@@ -2,7 +2,7 @@
2
2
  "id": "jeeves-server-openclaw",
3
3
  "name": "Jeeves Server",
4
4
  "description": "File browsing, document sharing, export, and event gateway tools for jeeves-server.",
5
- "version": "0.1.1",
5
+ "version": "0.2.1",
6
6
  "skills": [
7
7
  "dist/skills/jeeves-server"
8
8
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@karmaniverous/jeeves-server-openclaw",
3
- "version": "0.1.1",
3
+ "version": "0.2.1",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {