clay-server 2.17.0-beta.1 → 2.17.0-beta.2
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 +20 -7
- package/bin/cli.js +3 -0
- package/lib/public/sw.js +4 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
[](https://www.npmjs.com/package/clay-server) [](https://www.npmjs.com/package/clay-server) [](https://github.com/chadbyte/clay) [](https://github.com/chadbyte/clay/blob/main/LICENSE)
|
|
10
10
|
|
|
11
|
-
Clay gives Claude Code a browser UI that runs on any device. Use it from your phone, run it on macOS, Windows, or Linux. Invite teammates, manage multiple projects from one sidebar, and get push notifications when Claude needs you. Built on the official Claude Agent SDK, not a terminal parser. Your machine is the server. No cloud relay in between, no extra network surface.
|
|
11
|
+
Clay gives Claude Code a browser UI that runs on any device. Use it from your phone, run it on macOS, Windows, or Linux. Invite teammates, manage multiple projects from one sidebar, and get push notifications when Claude needs you. HTTPS and push notifications work out of the box with zero config. Built on the official Claude Agent SDK, not a terminal parser. Your machine is the server. No cloud relay in between, no extra network surface.
|
|
12
12
|
|
|
13
13
|
---
|
|
14
14
|
|
|
@@ -98,7 +98,7 @@ Take it further with Ralph Loop, an autonomous coding loop built into Clay. The
|
|
|
98
98
|
|
|
99
99
|
Your data flows directly from your machine to the Anthropic API, exactly as it does when you use the CLI. Clay adds a browser layer on top, not a middleman.
|
|
100
100
|
|
|
101
|
-
PIN authentication
|
|
101
|
+
HTTPS is enabled by default with a builtin certificate. PIN authentication and per-project/session permissions are built in. For local network use, this is sufficient. For remote access, we recommend a VPN like Tailscale.
|
|
102
102
|
|
|
103
103
|
---
|
|
104
104
|
|
|
@@ -166,20 +166,32 @@ Yes. Create as many as you need. A code reviewer, a writing partner, a project m
|
|
|
166
166
|
|
|
167
167
|
---
|
|
168
168
|
|
|
169
|
-
## HTTPS
|
|
169
|
+
## HTTPS
|
|
170
170
|
|
|
171
|
-
|
|
171
|
+
HTTPS is enabled by default using a builtin wildcard certificate for `*.d.clay.studio`. No setup required. Your browser connects to a URL like:
|
|
172
172
|
|
|
173
|
-
|
|
173
|
+
```
|
|
174
|
+
https://192-168-1-50.d.clay.studio:2633
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
The domain resolves to your local IP. All traffic stays on your network. See [clay-dns](clay-dns/) for details on how this works.
|
|
178
|
+
|
|
179
|
+
Push notifications require HTTPS, so they work out of the box with this setup. Install Clay as a PWA on your device to receive them.
|
|
180
|
+
|
|
181
|
+
<details>
|
|
182
|
+
<summary><strong>Alternative: local certificate with mkcert</strong></summary>
|
|
183
|
+
|
|
184
|
+
If you prefer to use a locally generated certificate (e.g. air-gapped environments where DNS is unavailable):
|
|
174
185
|
|
|
175
186
|
```bash
|
|
176
187
|
brew install mkcert
|
|
177
188
|
mkcert -install
|
|
189
|
+
npx clay-server --local-cert
|
|
178
190
|
```
|
|
179
191
|
|
|
180
|
-
|
|
192
|
+
This generates a self-signed certificate trusted by your machine. The setup wizard will guide you through installing the CA on other devices.
|
|
181
193
|
|
|
182
|
-
|
|
194
|
+
</details>
|
|
183
195
|
|
|
184
196
|
---
|
|
185
197
|
|
|
@@ -192,6 +204,7 @@ npx clay-server --yes # Skip interactive prompts (use defaults)
|
|
|
192
204
|
npx clay-server -y --pin 123456
|
|
193
205
|
# Non-interactive + PIN (for scripts/CI)
|
|
194
206
|
npx clay-server --no-https # Disable HTTPS
|
|
207
|
+
npx clay-server --local-cert # Use local certificate (mkcert) instead of builtin
|
|
195
208
|
npx clay-server --no-update # Skip update check
|
|
196
209
|
npx clay-server --debug # Enable debug panel
|
|
197
210
|
npx clay-server --add . # Add current directory to running daemon
|
package/bin/cli.js
CHANGED
|
@@ -1595,6 +1595,7 @@ async function forkDaemon(mode, keepAwake, extraProjects, addCwd, wantOsUsers) {
|
|
|
1595
1595
|
: protocol + "://" + ip + ":" + config.port;
|
|
1596
1596
|
console.log(" " + sym.done + " Daemon started (PID " + config.pid + ")");
|
|
1597
1597
|
console.log(" " + sym.done + " " + url);
|
|
1598
|
+
if (config.builtinCert) console.log(" " + sym.done + " d.clay.studio is only used for HTTPS certificates. All traffic stays on your local network. https://github.com/chadbyte/clay/tree/main/clay-dns");
|
|
1598
1599
|
console.log(" " + sym.done + " Headless mode — exiting CLI");
|
|
1599
1600
|
process.exit(0);
|
|
1600
1601
|
return;
|
|
@@ -1951,6 +1952,7 @@ function showMainMenu(config, ip) {
|
|
|
1951
1952
|
function afterQr() {
|
|
1952
1953
|
// Status line
|
|
1953
1954
|
log(" " + a.dim + "clay" + a.reset + " " + a.dim + "v" + currentVersion + a.reset + a.dim + " — " + url + a.reset);
|
|
1955
|
+
if (config.builtinCert) log(" " + a.dim + "d.clay.studio is only used for HTTPS certificates. All traffic stays on your local network. https://github.com/chadbyte/clay/tree/main/clay-dns" + a.reset);
|
|
1954
1956
|
var parts = [];
|
|
1955
1957
|
parts.push(a.bold + projs.length + a.reset + a.dim + (projs.length === 1 ? " project" : " projects"));
|
|
1956
1958
|
parts.push(a.reset + a.bold + totalSessions + a.reset + a.dim + (totalSessions === 1 ? " session" : " sessions"));
|
|
@@ -2725,6 +2727,7 @@ var currentVersion = require("../package.json").version;
|
|
|
2725
2727
|
: protocol + "://" + ip + ":" + config.port;
|
|
2726
2728
|
console.log(" " + sym.done + " Daemon already running (PID " + config.pid + ")");
|
|
2727
2729
|
console.log(" " + sym.done + " " + url);
|
|
2730
|
+
if (config.builtinCert) console.log(" " + sym.done + " d.clay.studio is only used for HTTPS certificates. All traffic stays on your local network. https://github.com/chadbyte/clay/tree/main/clay-dns");
|
|
2728
2731
|
process.exit(0);
|
|
2729
2732
|
return;
|
|
2730
2733
|
}
|
package/lib/public/sw.js
CHANGED
|
@@ -38,8 +38,11 @@ self.addEventListener("fetch", function (event) {
|
|
|
38
38
|
// Only handle GET requests
|
|
39
39
|
if (request.method !== "GET") return;
|
|
40
40
|
|
|
41
|
-
// Skip
|
|
41
|
+
// Skip cross-origin requests (external images, fonts, etc.)
|
|
42
42
|
var url = new URL(request.url);
|
|
43
|
+
if (url.origin !== self.location.origin) return;
|
|
44
|
+
|
|
45
|
+
// Skip WebSocket upgrade requests and API/data endpoints
|
|
43
46
|
if (url.pathname.indexOf("/ws") !== -1) return;
|
|
44
47
|
if (url.pathname.indexOf("/api/") !== -1) return;
|
|
45
48
|
|