@radnine/claude-session-daemon 0.8.3 → 0.9.3
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/Dockerfile +5 -2
- package/README.md +17 -4
- package/package.json +1 -2
- package/src/claude-process.js +357 -104
- package/src/claude-usage.js +46 -0
- package/src/codex-process.js +1081 -0
- package/src/codex-translator.js +302 -0
- package/src/config.js +117 -7
- package/src/connections/action-cable-client.js +577 -54
- package/src/connections/base-connection.js +6 -4
- package/src/connections/command-receipts.js +38 -0
- package/src/daemon.js +351 -21
- package/src/fs-bridge.js +106 -0
- package/src/harness.js +131 -0
- package/src/index.js +17 -15
- package/src/permission-broker.js +236 -0
- package/src/persona-scanner.js +267 -1
- package/src/turn-tracker.js +146 -0
- package/hooks/permission-gate.sh +0 -40
- package/src/permission-server.js +0 -266
package/Dockerfile
CHANGED
|
@@ -19,10 +19,13 @@ COPY src/ ./src/
|
|
|
19
19
|
COPY docker-entrypoint.sh /usr/local/bin/
|
|
20
20
|
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
|
|
21
21
|
|
|
22
|
-
# Default environment for standalone Docker usage
|
|
22
|
+
# Default environment for standalone Docker usage.
|
|
23
|
+
# Standalone mode never attaches a permission broker, so an escalated prompt has
|
|
24
|
+
# nowhere to go and would be denied on the spot. The container is the boundary.
|
|
23
25
|
ENV CLAUDE_DAEMON_MODE=standalone \
|
|
24
26
|
CLAUDE_WORKING_DIR=/workspace \
|
|
25
|
-
CLAUDE_DAEMON_PORT=3001
|
|
27
|
+
CLAUDE_DAEMON_PORT=3001 \
|
|
28
|
+
CLAUDE_PERMISSION_MODE=bypassPermissions
|
|
26
29
|
|
|
27
30
|
EXPOSE 3001
|
|
28
31
|
|
package/README.md
CHANGED
|
@@ -43,7 +43,7 @@ services:
|
|
|
43
43
|
- CLAUDE_DAEMON_MODE=standalone
|
|
44
44
|
- CLAUDE_WORKING_DIR=/workspace
|
|
45
45
|
- CLAUDE_DAEMON_PORT=3001
|
|
46
|
-
-
|
|
46
|
+
- CLAUDE_PERMISSION_MODE=bypassPermissions
|
|
47
47
|
- CLAUDE_DISABLE_AUTH=true
|
|
48
48
|
stop_grace_period: 10s
|
|
49
49
|
restart: unless-stopped
|
|
@@ -219,14 +219,27 @@ In Docker mode, `CLAUDE_WORKING_DIR` should point to your mounted workspace (e.g
|
|
|
219
219
|
| Variable | Default | Description |
|
|
220
220
|
|---|---|---|
|
|
221
221
|
| `ANTHROPIC_API_KEY` | — | Required for Docker mode |
|
|
222
|
+
| `CLAUDE_DAEMON_MODE` | `standalone` | `standalone` runs its own WebSocket server. `actioncable` connects to a FlightDeck (Rails) server |
|
|
222
223
|
| `CLAUDE_WORKING_DIR` | `process.cwd()` | Project root for skills config and git context |
|
|
223
224
|
| `CLAUDE_DAEMON_PORT` | `3001` | WebSocket server port |
|
|
224
|
-
| `CLAUDE_AUTH_TOKEN` | random UUID | Shared secret for WebSocket auth (see above) |
|
|
225
|
-
| `
|
|
225
|
+
| `CLAUDE_AUTH_TOKEN` | random UUID | Shared secret for WebSocket auth (see above). Required in `actioncable` mode, where it is the pilot's token and the daemon exits without it. Never passed to chats (#482) |
|
|
226
|
+
| `CLAUDE_RAILS_URL` | `http://localhost:3000` | FlightDeck server URL. Set it for `actioncable` mode, because FlightDeck runs on `:3600`. `pilot-manager` sets it from `server_url` in its config, which `--server URL` saves |
|
|
227
|
+
| `CLAUDE_DAEMON_ID` | random UUID, new each start | Pilot ID sent to FlightDeck in `actioncable` mode. Must match the registered pilot. `pilot-manager` sets it |
|
|
228
|
+
| `CLAUDE_MAX_SESSIONS` | `15` | Max concurrent Claude sessions |
|
|
226
229
|
| `CLAUDE_LOG_LEVEL` | `info` | Log level (`debug`, `info`, `warn`, `error`) |
|
|
227
|
-
| `
|
|
230
|
+
| `CLAUDE_HEARTBEAT_INTERVAL` | `30` | Seconds between the daemon's health checks. In `actioncable` mode FlightDeck sets the heartbeat interval when the pilot registers (currently 30s) |
|
|
231
|
+
| `CLAUDE_CLEANUP_INTERVAL` | `300` | Seconds between sweeps that remove dead sessions and kill stale ones |
|
|
232
|
+
| `CLAUDE_STALE_SESSION_TIMEOUT` | `1800` | Seconds a running session can go without activity before the cleanup sweep kills it. `0` disables |
|
|
233
|
+
| `CLAUDE_STARTUP_TIMEOUT` | `5` | Parsed at startup, but no daemon code uses it yet |
|
|
234
|
+
| `CLAUDE_COMMAND` | `claude` | Claude CLI binary to spawn. Also used for `claude auth status` |
|
|
235
|
+
| `CLAUDE_EFFORT` | — | Machine default reasoning effort (`low`, `medium`, `high`, `xhigh`, `max`) that the daemon reports to FlightDeck. Overrides the `effort` key in `~/.claude/settings.json` |
|
|
236
|
+
| `CLAUDE_PERMISSION_MODE` | `auto` | Claude CLI permission mode: `auto`, `acceptEdits`, `manual`, `dontAsk`, `plan`, `bypassPermissions` |
|
|
237
|
+
| `CLAUDE_PERMISSION_TIMEOUT` | `600` | Seconds a permission prompt waits for an operator before auto-denying (1–86400) |
|
|
238
|
+
| `CLAUDE_SKIP_PERMISSIONS` | `false` | **Deprecated** — alias for `CLAUDE_PERMISSION_MODE=bypassPermissions` |
|
|
228
239
|
| `CLAUDE_DISABLE_AUTH` | `false` | Disable WebSocket auth (Docker only) |
|
|
229
240
|
|
|
241
|
+
Sessions inherit the daemon's environment, so Claude CLI variables such as `CLAUDE_CONFIG_DIR` and `CLAUDE_CODE_OAUTH_TOKEN` apply to every session. The daemon reads those two itself only to report which Claude account the pilot runs as.
|
|
242
|
+
|
|
230
243
|
**Addon-side variables** (set when starting Storybook):
|
|
231
244
|
|
|
232
245
|
| Variable | Default | Description |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@radnine/claude-session-daemon",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.3",
|
|
4
4
|
"description": "Node.js daemon for managing Claude CLI sessions",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"repository": {
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
},
|
|
15
15
|
"files": [
|
|
16
16
|
"src/**",
|
|
17
|
-
"hooks/**",
|
|
18
17
|
"LICENSE",
|
|
19
18
|
"Dockerfile",
|
|
20
19
|
"docker-entrypoint.sh",
|