squad-openclaw 2026.2.2001 → 2026.2.2002

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.
Files changed (3) hide show
  1. package/README.md +21 -3
  2. package/dist/index.js +43 -0
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -10,7 +10,7 @@ OpenClaw gateway plugin for [Squad](https://squad.ceo) — provides entity regis
10
10
  | `fs_read`, `fs_write`, `fs_list`, `fs_delete`, `fs_rename`, `fs_mkdir` | Remote filesystem access for browser clients (subject to security restrictions below) |
11
11
  | `sql_query` | Restricted SQLite query tool — `sqlite3` only, scoped to `~/.openclaw/squad-ceo-data/` |
12
12
  | `squad.version.check`, `squad.version.update` | Plugin version management and self-update |
13
- | `tools.invoke` | RPC-based tool invocation for relay mode (WebSocket) |
13
+ | `tools.invoke` | RPC-based tool invocation for relay mode — **only invokes this plugin's own tools**, each with its own security restrictions (see below) |
14
14
  | Cloud relay client | **Disabled by default (opt-in).** Connects outbound to `relay.squad.ceo` for remote browser access |
15
15
 
16
16
  ## Security Model
@@ -112,13 +112,31 @@ Browser ──[connect request]──> relay.squad.ceo ──[relay.forward]─
112
112
 
113
113
  The relay server only sees the outer `relay.forward` envelope. It **never** receives the modified request containing the token. The token injection happens entirely within the relay-client process, and the modified message is sent over a **local loopback** connection to the gateway. A compromised relay server cannot intercept the operator token because it never traverses the relay — it only exists on the `localhost:18789` path.
114
114
 
115
+ ## Remote Tool Invocation (`tools.invoke`)
116
+
117
+ The `tools.invoke` gateway method allows the browser to call plugin tools over WebSocket (used in relay mode where there is no HTTP path). This is **not** a generic RPC gateway — it is scoped exclusively to the tools registered by **this plugin**:
118
+
119
+ | Tool | What it can access | Restrictions |
120
+ |---|---|---|
121
+ | `fs_read`, `fs_write`, `fs_list`, `fs_delete`, `fs_rename`, `fs_mkdir` | `~/.openclaw/` only | All 4 security layers apply (blocked dirs, blocked files, redaction, allowed roots, write protection) |
122
+ | `sql_query` | `~/.openclaw/squad-ceo-data/*.db` only | sqlite3 only, no shell, no command injection (see below) |
123
+ | `entity_list`, `entity_search`, `entity_sync` | In-memory entity index | Read-only metadata (names, types, paths) |
124
+ | `squad.version.check`, `squad.version.update` | npm registry | Read-only check + controlled `npm install` |
125
+
126
+ It **cannot** invoke gateway core tools (`exec`, `bash`, `read`, `write`, `web_fetch`, etc.) — only the tools this plugin registers via `api.registerTool()`. Every invoked tool enforces its own security restrictions independently — `tools.invoke` is just a transport layer, not a privilege escalation.
127
+
128
+ **Authentication chain for relay access:** Browser JWT → relay claim token → operator-approved device pairing → operator auth token (localhost only). All four must be valid for a `tools.invoke` call to reach the gateway.
129
+
115
130
  ## SQL Query Tool
116
131
 
132
+ > **`sql_query` can only access the plugin's own application data** in `~/.openclaw/squad-ceo-data/`. It cannot read or modify any other files on the system — not system databases, not user documents, not gateway configuration.
133
+
117
134
  The `sql_query` tool provides restricted SQLite access:
118
135
 
119
- - **Path restriction:** Database files must be within `~/.openclaw/squad-ceo-data/`
136
+ - **Path restriction:** Database files must be within `~/.openclaw/squad-ceo-data/` — the plugin's own data directory containing entity registries and application state. Paths outside this directory are rejected before any query is executed.
120
137
  - **No shell:** Uses `execFile` (not `exec`) — arguments are passed as an argv array, preventing command injection
121
- - **No arbitrary commands:** Only `sqlite3` is executed
138
+ - **No arbitrary commands:** Only `sqlite3` is executed — no other binary can be invoked through this tool
139
+ - **Data scope:** The databases in `squad-ceo-data/` contain only Squad application data (entity metadata, search indexes, user preferences). No credentials, tokens, or gateway configuration is stored in these databases.
122
140
 
123
141
  ## Build Transparency
124
142
 
package/dist/index.js CHANGED
@@ -1918,6 +1918,49 @@ function squadAppPlugin(api) {
1918
1918
  }
1919
1919
  }
1920
1920
  );
1921
+ api.registerGatewayMethod(
1922
+ "tools.list",
1923
+ async ({ respond }) => {
1924
+ const coreTools = [
1925
+ "exec",
1926
+ "bash",
1927
+ "process",
1928
+ "read",
1929
+ "write",
1930
+ "edit",
1931
+ "apply_patch",
1932
+ "web_search",
1933
+ "web_fetch",
1934
+ "browser",
1935
+ "canvas",
1936
+ "nodes",
1937
+ "image",
1938
+ "message",
1939
+ "cron",
1940
+ "gateway",
1941
+ "sessions_list",
1942
+ "sessions_history",
1943
+ "sessions_send",
1944
+ "sessions_spawn",
1945
+ "session_status",
1946
+ "agents_list",
1947
+ "memory_search"
1948
+ ];
1949
+ const groups = [
1950
+ "group:fs",
1951
+ "group:runtime",
1952
+ "group:sessions",
1953
+ "group:memory",
1954
+ "group:web",
1955
+ "group:ui",
1956
+ "group:automation",
1957
+ "group:messaging",
1958
+ "group:nodes"
1959
+ ];
1960
+ const pluginTools = Array.from(toolExecutors.keys());
1961
+ respond(true, { tools: [...coreTools, ...groups, ...pluginTools] });
1962
+ }
1963
+ );
1921
1964
  const relayEnabled = api.pluginConfig?.["relay.enabled"] ?? false;
1922
1965
  if (relayEnabled) {
1923
1966
  const relayUrl = api.pluginConfig?.["relay.url"] || "wss://relay.squad.ceo";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "squad-openclaw",
3
- "version": "2026.2.2001",
3
+ "version": "2026.2.2002",
4
4
  "description": "Entity registry, filesystem tools, and version management plugin for OpenClaw gateway",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",