@lifeaitools/clauth 1.9.3 → 1.16.9
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/.clauth-skill/SKILL.md +80 -22
- package/README.md +85 -42
- package/cli/api.js +47 -36
- package/cli/assets/codevelop/launcher-active.cmd.template +20 -20
- package/cli/assets/codevelop/launcher-static.cmd.template +7 -7
- package/cli/assets/codevelop/windows-terminal.profiles.json +48 -48
- package/cli/assets/watchdog.ps1 +42 -42
- package/cli/commands/agent-cron.js +396 -0
- package/cli/commands/agent-pool.js +1745 -0
- package/cli/commands/codevelop.js +1190 -1190
- package/cli/commands/doctor.js +302 -302
- package/cli/commands/install.js +10 -10
- package/cli/commands/invite.js +175 -175
- package/cli/commands/join.js +179 -179
- package/cli/commands/npm.js +182 -182
- package/cli/commands/scrub.js +205 -109
- package/cli/commands/scrub.test.js +115 -0
- package/cli/commands/serve.js +11716 -10780
- package/cli/commands/watchdog.js +209 -209
- package/cli/conf-path.js +21 -21
- package/cli/index.js +1089 -1085
- package/cli/lib/fs-git.js +282 -282
- package/cli/recovery.js +101 -101
- package/cli/studio-debug.js +487 -424
- package/cli/watchdog-registry.js +209 -209
- package/cli/watchdog-registry.test.js +89 -89
- package/install.ps1 +21 -21
- package/package.json +65 -62
- package/scripts/postinstall.js +164 -164
- package/supabase/migrations/001_clauth_schema.sql +12 -12
- package/supabase/migrations/003_clauth_config.sql +13 -13
- package/supabase/migrations/003_machine_enrollments.sql +39 -39
package/.clauth-skill/SKILL.md
CHANGED
|
@@ -11,23 +11,47 @@ Hardware-bound credential vault for the LIFEAI stack. Your machine is the second
|
|
|
11
11
|
|
|
12
12
|
## How Claude Interfaces with clauth
|
|
13
13
|
|
|
14
|
-
> **CRITICAL:**
|
|
14
|
+
> **CRITICAL:** Agents should use the local daemon for credential discovery and
|
|
15
|
+
> exact secret retrieval. Do not ask the user for the vault password just to get
|
|
16
|
+
> a key, do not use interactive prompts, and do not walk every service.
|
|
15
17
|
|
|
16
|
-
### Method 1 —
|
|
18
|
+
### Method 1 — Local daemon (preferred for agents)
|
|
17
19
|
|
|
18
|
-
|
|
20
|
+
Discover services without reading secrets:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
curl -s http://127.0.0.1:52437/ping
|
|
24
|
+
curl -s http://127.0.0.1:52437/knowledge
|
|
25
|
+
curl -s http://127.0.0.1:52437/list-services
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Retrieve exactly one credential only when the next command needs it:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
curl -s http://127.0.0.1:52437/v/<service>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
`/knowledge` is safe to cache for a session: it returns service metadata and
|
|
35
|
+
`has_key`, but no raw secrets and no Vault secret names. `/status` uses the same
|
|
36
|
+
short metadata cache and can be forced with `?refresh=1`.
|
|
37
|
+
|
|
38
|
+
### Method 2 — CLI with `--pw` flag (admin/setup only)
|
|
39
|
+
|
|
40
|
+
All clauth commands accept `-p` / `--pw <password>` to skip the interactive
|
|
41
|
+
password prompt. Use this for local admin/setup tasks, not routine agent secret
|
|
42
|
+
retrieval:
|
|
19
43
|
|
|
20
44
|
```bash
|
|
21
45
|
clauth status -p "YourPassword"
|
|
22
|
-
clauth get github -p "YourPassword"
|
|
23
46
|
clauth test -p "YourPassword"
|
|
24
47
|
clauth enable github -p "YourPassword"
|
|
25
48
|
clauth write key github -p "YourPassword" # still prompts for the key value
|
|
26
49
|
```
|
|
27
50
|
|
|
28
|
-
### Method
|
|
51
|
+
### Method 3 — Direct API calls (implementation/debugging only)
|
|
29
52
|
|
|
30
|
-
Call the auth-vault Edge Function directly
|
|
53
|
+
Call the auth-vault Edge Function directly only when debugging clauth internals.
|
|
54
|
+
Normal agents should not bypass the daemon metadata cache.
|
|
31
55
|
|
|
32
56
|
**Base URL:** `https://<project-ref>.supabase.co/functions/v1/auth-vault`
|
|
33
57
|
**Auth header:** `Authorization: Bearer <supabase-anon-key>`
|
|
@@ -75,10 +99,10 @@ All auth routes require: `machine_hash`, `token`, `timestamp`, `password`.
|
|
|
75
99
|
|
|
76
100
|
### Password Handling
|
|
77
101
|
|
|
78
|
-
-
|
|
79
|
-
-
|
|
102
|
+
- Do not ask the user for their clauth password for routine credential lookup
|
|
103
|
+
- Use the unlocked local daemon whenever possible
|
|
80
104
|
- Never log or echo the password
|
|
81
|
-
- If the
|
|
105
|
+
- If the daemon is locked, ask the user to unlock `http://127.0.0.1:52437`
|
|
82
106
|
|
|
83
107
|
---
|
|
84
108
|
|
|
@@ -141,12 +165,14 @@ See `references/keys-guide.md` for where to find every credential.
|
|
|
141
165
|
```
|
|
142
166
|
clauth install [--ref R] [--pat P] First-time: provision Supabase + install skill
|
|
143
167
|
clauth setup [--admin-token T] [-p P] Register this machine
|
|
144
|
-
clauth status [-p P] All services + state
|
|
145
|
-
clauth test [-p P] Verify HMAC connection
|
|
146
|
-
clauth list [-p P] Service names
|
|
147
|
-
clauth search <query> [-p P] Search names
|
|
148
|
-
|
|
149
|
-
|
|
168
|
+
clauth status [-p P] All services + state
|
|
169
|
+
clauth test [-p P] Verify HMAC connection
|
|
170
|
+
clauth list [-p P] Service names
|
|
171
|
+
clauth search <query> [-p P] Search names and metadata
|
|
172
|
+
clauth search <query> --addresses [-p P]
|
|
173
|
+
Also search redacted address hints (may read multiple secrets)
|
|
174
|
+
|
|
175
|
+
clauth write key <service> [-p P] Store a credential
|
|
150
176
|
clauth write pw [-p P] Change password
|
|
151
177
|
clauth enable <svc|all> [-p P] Activate service
|
|
152
178
|
clauth disable <svc|all> [-p P] Suspend service
|
|
@@ -175,32 +201,64 @@ Service type `fileserver` — mount configuration for fs tools (UI-only config).
|
|
|
175
201
|
|
|
176
202
|
---
|
|
177
203
|
|
|
178
|
-
##
|
|
204
|
+
## Daemon Metadata Cache
|
|
205
|
+
|
|
206
|
+
When discovering service names, do not retrieve secrets. Use the daemon metadata
|
|
207
|
+
cache:
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
curl -s http://127.0.0.1:52437/knowledge
|
|
211
|
+
curl -s http://127.0.0.1:52437/list-services
|
|
212
|
+
```
|
|
179
213
|
|
|
180
|
-
|
|
214
|
+
`/knowledge` is agent-safe: it returns service metadata and `has_key`, but no
|
|
215
|
+
raw secrets and no Vault secret names. Fetch `GET /v/<service>` only for the one
|
|
216
|
+
exact credential needed by the next command. Never walk every service and never
|
|
217
|
+
bulk-fetch all secrets.
|
|
218
|
+
|
|
219
|
+
## MCP Server (v1.16.9+)
|
|
220
|
+
|
|
221
|
+
clauth runs as an MCP server with five namespaced paths and safe
|
|
222
|
+
credential-discovery tools:
|
|
181
223
|
|
|
182
224
|
| Path | Namespace | Tools |
|
|
183
225
|
|------|-----------|-------|
|
|
184
|
-
| `/clauth` | `clauth_*` |
|
|
226
|
+
| `/clauth` | `clauth_*` + runtime helpers | 23 default live tools, including `clauth_knowledge` |
|
|
185
227
|
| `/gws` | `gws_*` | 6 Google Workspace tools |
|
|
186
|
-
| `/fs` | `fs_*` |
|
|
187
|
-
| `/
|
|
228
|
+
| `/fs` | `fs_*` | 20 filesystem and git-safe file tools |
|
|
229
|
+
| `/chitchat` | `chitchat_*` | 7 collaboration relay tools |
|
|
230
|
+
| `/codevelop` | `codevelop_*` | 7 peer development tools |
|
|
231
|
+
| `/mcp` | all | 63 tools combined |
|
|
232
|
+
|
|
233
|
+
The default live `/clauth` surface includes credential tools plus
|
|
234
|
+
`call_agent`, `monkey_dispatch`, `handoff_start`, `terminal_*`, and `channel_*`.
|
|
235
|
+
Admin write tools are gated by write-mode.
|
|
188
236
|
|
|
189
237
|
### claude.ai Connector URLs (noauth mode)
|
|
190
238
|
- `https://clauth.regendevcorp.com/clauth` — credential tools
|
|
191
239
|
- `https://clauth.regendevcorp.com/gws` — Google Workspace
|
|
240
|
+
- `https://clauth.regendevcorp.com/chitchat` — collaboration relay tools
|
|
241
|
+
- `https://clauth.regendevcorp.com/codevelop` — peer development tools
|
|
192
242
|
- `https://fs.regendevcorp.com/fs` — filesystem tools
|
|
193
243
|
|
|
194
244
|
Noauth mode: fresh domains that return 404 on OAuth endpoints. claude.ai connects directly (Anthropic OAuth proxy bug workaround).
|
|
195
245
|
|
|
246
|
+
Use `clauth_knowledge` or `clauth_status` for discovery. Use `clauth_get` only
|
|
247
|
+
for one exact secret. `clauth_search` is metadata-only by default; pass
|
|
248
|
+
`addresses: true` only when redacted address hints are intentionally needed.
|
|
249
|
+
`clauth_inject` is guarded against accidental bulk vault sweeps.
|
|
250
|
+
|
|
196
251
|
### FS Tools
|
|
197
|
-
`fs_read` `fs_write` `
|
|
252
|
+
`fs_read` `fs_write` `fs_stat` `fs_append` `fs_write_chunk` `fs_ingest_url`
|
|
253
|
+
`fs_import_git_files` `fs_list` `fs_grep` `fs_glob` `fs_delete` `fs_mkdir`
|
|
254
|
+
`fs_edit` `fs_move` `fs_copy` `fs_mounts` `fs_repo_status` `fs_use_branch`
|
|
255
|
+
`fs_commit` `fs_diff`
|
|
198
256
|
|
|
199
257
|
Path-jail security: all paths resolved against mount root. Permission flags (r/w/d) per mount. Uses `@vscode/ripgrep` for grep, `fast-glob` for glob.
|
|
200
258
|
|
|
201
259
|
### Testing
|
|
202
260
|
```bash
|
|
203
|
-
node test-tools.mjs #
|
|
261
|
+
node test-tools.mjs # MCP tool execution smoke tests
|
|
204
262
|
```
|
|
205
263
|
|
|
206
264
|
---
|
package/README.md
CHANGED
|
@@ -27,37 +27,37 @@ At the end it prints a **bootstrap token** — save it for the next step.
|
|
|
27
27
|
|
|
28
28
|
---
|
|
29
29
|
|
|
30
|
-
## After Install — Register Your Machine
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
clauth setup
|
|
34
|
-
```
|
|
30
|
+
## After Install — Register Your Machine
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
clauth setup
|
|
34
|
+
```
|
|
35
35
|
|
|
36
36
|
Prompts for: machine label, password, bootstrap token (from `clauth install`).
|
|
37
37
|
|
|
38
|
-
Then verify:
|
|
39
|
-
```bash
|
|
40
|
-
clauth test # → PASS
|
|
41
|
-
clauth status # → 12 services, all NO KEY
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
### Add A New Computer
|
|
45
|
-
|
|
46
|
-
On an old computer where clauth is already registered:
|
|
47
|
-
|
|
48
|
-
```bash
|
|
49
|
-
clauth enroll --label "Dave-New-Laptop"
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
This creates a one-time enrollment code tied to the same `install_id` and writes
|
|
53
|
-
a one-time PowerShell setup script. Move that script to the new computer and run
|
|
54
|
-
it. The script installs clauth, enrolls the computer, installs startup, then
|
|
55
|
-
deletes itself. Setup defaults the machine label to the computer name and only
|
|
56
|
-
asks you to set the new computer's local clauth password.
|
|
57
|
-
|
|
58
|
-
The enrollment code does not copy repo credentials into the script. It lets the
|
|
59
|
-
new hardware-bound `machine_hash` join the shared Supabase Vault once. After the
|
|
60
|
-
code is redeemed, it cannot be used again.
|
|
38
|
+
Then verify:
|
|
39
|
+
```bash
|
|
40
|
+
clauth test # → PASS
|
|
41
|
+
clauth status # → 12 services, all NO KEY
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Add A New Computer
|
|
45
|
+
|
|
46
|
+
On an old computer where clauth is already registered:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
clauth enroll --label "Dave-New-Laptop"
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
This creates a one-time enrollment code tied to the same `install_id` and writes
|
|
53
|
+
a one-time PowerShell setup script. Move that script to the new computer and run
|
|
54
|
+
it. The script installs clauth, enrolls the computer, installs startup, then
|
|
55
|
+
deletes itself. Setup defaults the machine label to the computer name and only
|
|
56
|
+
asks you to set the new computer's local clauth password.
|
|
57
|
+
|
|
58
|
+
The enrollment code does not copy repo credentials into the script. It lets the
|
|
59
|
+
new hardware-bound `machine_hash` join the shared Supabase Vault once. After the
|
|
60
|
+
code is redeemed, it cannot be used again.
|
|
61
61
|
|
|
62
62
|
---
|
|
63
63
|
|
|
@@ -88,11 +88,13 @@ clauth get github
|
|
|
88
88
|
## Command Reference
|
|
89
89
|
|
|
90
90
|
```
|
|
91
|
-
clauth install Provision Supabase + install Claude skill
|
|
92
|
-
clauth setup Register this machine with the vault
|
|
93
|
-
clauth enroll Create one-time code to add another computer
|
|
94
|
-
clauth status All services + state
|
|
95
|
-
clauth search <query> Find services by name, project, description, or
|
|
91
|
+
clauth install Provision Supabase + install Claude skill
|
|
92
|
+
clauth setup Register this machine with the vault
|
|
93
|
+
clauth enroll Create one-time code to add another computer
|
|
94
|
+
clauth status All services + state
|
|
95
|
+
clauth search <query> Find services by name, project, description, or type
|
|
96
|
+
clauth search <query> --addresses
|
|
97
|
+
Also search redacted address hints (may read multiple secrets)
|
|
96
98
|
clauth test Verify connection
|
|
97
99
|
|
|
98
100
|
clauth write key <service> Store a credential
|
|
@@ -136,7 +138,7 @@ Nothing stored locally. Password never persisted. Machine hash is one-way only.
|
|
|
136
138
|
clauth runs as an HTTP daemon on `http://127.0.0.1:52437`. The daemon provides:
|
|
137
139
|
|
|
138
140
|
- **Web UI** — unlock vault, manage services, configure mounts
|
|
139
|
-
- **REST API** — `GET /
|
|
141
|
+
- **REST API** — `GET /knowledge`, `GET /status`, `GET /v/<service>`, `GET /ping`, `POST /restart`, `GET /shutdown`
|
|
140
142
|
- **MCP server** — Model Context Protocol for Claude Code and claude.ai
|
|
141
143
|
- **Cloudflare Tunnel** — exposes MCP endpoints publicly for claude.ai connectors
|
|
142
144
|
|
|
@@ -144,32 +146,71 @@ Start: `clauth serve start` (starts locked, auto-opens browser for unlock).
|
|
|
144
146
|
|
|
145
147
|
Full daemon operations reference: see `regen-root/.claude/rules/clauth.md`.
|
|
146
148
|
|
|
149
|
+
### Safe Metadata Cache
|
|
150
|
+
|
|
151
|
+
Agents and scripts must discover services through metadata endpoints, not by
|
|
152
|
+
walking every secret endpoint. The daemon caches service metadata for 30 seconds:
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
curl -s http://127.0.0.1:52437/knowledge # sanitized, agent-safe metadata
|
|
156
|
+
curl -s http://127.0.0.1:52437/list-services # names only
|
|
157
|
+
curl -s http://127.0.0.1:52437/status # full daemon metadata, cached
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
`/knowledge` returns service names, labels, key types, enabled state, project,
|
|
161
|
+
description, timestamps, and `has_key`. It never returns raw secrets or Vault
|
|
162
|
+
secret names. Use `GET /v/<service>` only for the one exact secret needed by the
|
|
163
|
+
next command. Do not bulk-fetch every service.
|
|
164
|
+
|
|
147
165
|
---
|
|
148
166
|
|
|
149
|
-
## MCP Server —
|
|
167
|
+
## MCP Server — 5 Namespaces, 63 Tools
|
|
150
168
|
|
|
151
169
|
clauth is the single MCP interface for all local tools. One process, namespaced paths:
|
|
152
170
|
|
|
153
171
|
| Path | Namespace | Tools | Description |
|
|
154
172
|
|------|-----------|-------|-------------|
|
|
155
|
-
| `/clauth` | `clauth_*` |
|
|
173
|
+
| `/clauth` | `clauth_*` + runtime helpers | 23 | Credential vault operations, safe metadata cache, and agent runtime helpers |
|
|
156
174
|
| `/gws` | `gws_*` | 6 | Google Workspace (Gmail, Calendar, Drive) |
|
|
157
|
-
| `/fs` | `fs_*` |
|
|
158
|
-
| `/
|
|
175
|
+
| `/fs` | `fs_*` | 20 | Filesystem plus guarded git/local-branch tools |
|
|
176
|
+
| `/chitchat` | `chitchat_*` | 7 | Collaboration relay sessions |
|
|
177
|
+
| `/codevelop` | `codevelop_*` | 7 | Peer development sessions |
|
|
178
|
+
| `/mcp` | all | 63 | All namespaces combined (Claude Code) |
|
|
179
|
+
|
|
180
|
+
The default live `/clauth` surface includes 13 credential tools plus
|
|
181
|
+
`call_agent`, `monkey_dispatch`, `handoff_start`, `terminal_*`, and `channel_*`
|
|
182
|
+
runtime helpers. Admin write tools such as enable/disable/project/token actions
|
|
183
|
+
are gated by write-mode.
|
|
184
|
+
|
|
185
|
+
### clauth MCP Usage
|
|
186
|
+
|
|
187
|
+
Use `clauth_knowledge` or `clauth_status` for discovery. They use cached
|
|
188
|
+
metadata and never retrieve raw secrets. `clauth_search` is metadata-only by
|
|
189
|
+
default; pass `addresses: true` only when you intentionally need redacted address
|
|
190
|
+
hints from connstrings/fileserver/oauth secrets. `clauth_get` is for one exact
|
|
191
|
+
secret. `clauth_inject` refuses more than five services unless `allow_many: true`
|
|
192
|
+
is explicitly supplied, to prevent accidental rate-limit lockouts from bulk
|
|
193
|
+
secret sweeps.
|
|
159
194
|
|
|
160
195
|
### FS Tools
|
|
161
196
|
|
|
162
|
-
|
|
163
|
-
- `fs_read`, `fs_write`, `fs_stat`, `fs_append`, `fs_write_chunk`, `fs_ingest_url`, `fs_import_git_files`, `fs_list`, `fs_grep`, `fs_glob`, `fs_delete`, `fs_mkdir`, `fs_mounts`
|
|
197
|
+
20 filesystem tools with path-jail security:
|
|
198
|
+
- `fs_read`, `fs_write`, `fs_stat`, `fs_append`, `fs_write_chunk`, `fs_ingest_url`, `fs_import_git_files`, `fs_list`, `fs_grep`, `fs_glob`, `fs_delete`, `fs_mkdir`, `fs_edit`, `fs_move`, `fs_copy`, `fs_mounts`, `fs_repo_status`, `fs_use_branch`, `fs_commit`, `fs_diff`
|
|
164
199
|
- Uses `node:fs/promises` (async), `@vscode/ripgrep` (shipped binary), `fast-glob`
|
|
165
200
|
- Permission flags per mount: `r` (read), `w` (write), `d` (delete)
|
|
166
201
|
- Mount config stored as "fileserver" service type in vault — only configurable through web UI
|
|
167
202
|
- Large writes should use `fs_write_chunk`; cloud-to-local transfer should use `fs_ingest_url`; guarded appends should pass `expected_sha256` from `fs_stat`
|
|
168
203
|
- Durable new files authored by Claude.ai in GitHub should use `fs_import_git_files` so the local dirty monorepo fetches and restores only named paths without `git pull`
|
|
169
204
|
|
|
205
|
+
### Collaboration Tools
|
|
206
|
+
|
|
207
|
+
Chitchat tools: `chitchat_start`, `chitchat_list`, `chitchat_send`, `chitchat_recv`, `chitchat_reply`, `chitchat_poll`, `chitchat_stop`
|
|
208
|
+
|
|
209
|
+
Codevelop tools: `codevelop_start`, `codevelop_join`, `codevelop_send`, `codevelop_poll`, `codevelop_status`, `codevelop_stream`, `codevelop_stop`
|
|
210
|
+
|
|
170
211
|
### GWS Tools
|
|
171
212
|
|
|
172
|
-
6 Google Workspace tools: `gws_gmail_list`, `gws_gmail_read`, `gws_gmail_send`, `
|
|
213
|
+
6 Google Workspace tools: `gws_run`, `gws_gmail_list`, `gws_gmail_read`, `gws_gmail_send`, `gws_calendar_list`, `gws_drive_list`
|
|
173
214
|
- Calls `gws` CLI via `execSync` with `shell: 'bash'` (fixes Windows cmd.exe JSON quoting)
|
|
174
215
|
|
|
175
216
|
---
|
|
@@ -196,6 +237,8 @@ Full OAuth 2.1 protocol implementation is present for future use when Anthropic
|
|
|
196
237
|
|-----------|-----|
|
|
197
238
|
| clauth | `https://clauth.regendevcorp.com/clauth` |
|
|
198
239
|
| gws | `https://clauth.regendevcorp.com/gws` |
|
|
240
|
+
| chitchat | `https://clauth.regendevcorp.com/chitchat` |
|
|
241
|
+
| codevelop | `https://clauth.regendevcorp.com/codevelop` |
|
|
199
242
|
| fs | `https://fs.regendevcorp.com/fs` |
|
|
200
243
|
|
|
201
244
|
---
|
|
@@ -210,7 +253,7 @@ Full OAuth 2.1 protocol implementation is present for future use when Anthropic
|
|
|
210
253
|
## Testing
|
|
211
254
|
|
|
212
255
|
```bash
|
|
213
|
-
node test-tools.mjs #
|
|
256
|
+
node test-tools.mjs # MCP tool execution smoke tests
|
|
214
257
|
```
|
|
215
258
|
|
|
216
259
|
Tests actual MCP tool calls (not just OAuth + listing).
|
package/cli/api.js
CHANGED
|
@@ -27,6 +27,16 @@ export function getAnonKey() {
|
|
|
27
27
|
// ============================================================
|
|
28
28
|
// Core POST helper
|
|
29
29
|
// ============================================================
|
|
30
|
+
// Bound every vault round-trip with a wall-clock timeout. Without this, a TCP
|
|
31
|
+
// stall (DNS black-hole, half-open socket — NOT a clean 4xx) hangs the caller
|
|
32
|
+
// forever. Callers that treat persistence as best-effort (e.g. the call_agent
|
|
33
|
+
// scratchpad mirror) rely on this resolving to an error rather than blocking.
|
|
34
|
+
// Override via CLAUTH_VAULT_TIMEOUT_MS; default 8s.
|
|
35
|
+
const VAULT_FETCH_TIMEOUT_MS = (() => {
|
|
36
|
+
const n = Number(process.env.CLAUTH_VAULT_TIMEOUT_MS);
|
|
37
|
+
return Number.isFinite(n) && n > 0 ? n : 8000;
|
|
38
|
+
})();
|
|
39
|
+
|
|
30
40
|
async function post(route, body) {
|
|
31
41
|
const url = `${getBaseUrl()}/${route}`;
|
|
32
42
|
const anonKey = getAnonKey();
|
|
@@ -37,7 +47,8 @@ async function post(route, body) {
|
|
|
37
47
|
"Content-Type": "application/json",
|
|
38
48
|
"Authorization": `Bearer ${anonKey}`
|
|
39
49
|
},
|
|
40
|
-
body: JSON.stringify(body)
|
|
50
|
+
body: JSON.stringify(body),
|
|
51
|
+
signal: AbortSignal.timeout(VAULT_FETCH_TIMEOUT_MS)
|
|
41
52
|
});
|
|
42
53
|
|
|
43
54
|
const data = await res.json();
|
|
@@ -102,38 +113,38 @@ export async function test(password, machineHash, token, timestamp) {
|
|
|
102
113
|
return authPost("test", password, machineHash, token, timestamp);
|
|
103
114
|
}
|
|
104
115
|
|
|
105
|
-
export async function changePassword(password, machineHash, token, timestamp, newSeedHash) {
|
|
106
|
-
return authPost("change-password", password, machineHash, token, timestamp, { new_hmac_seed_hash: newSeedHash });
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
export async function createEnrollment(password, machineHash, token, timestamp, label, ttlMinutes, installId) {
|
|
110
|
-
const extra = {};
|
|
111
|
-
if (label) extra.label = label;
|
|
112
|
-
if (ttlMinutes) extra.ttl_minutes = ttlMinutes;
|
|
113
|
-
if (installId) extra.install_id = installId;
|
|
114
|
-
return authPost("create-enrollment", password, machineHash, token, timestamp, extra);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
export async function registerMachine(machineHash, seedHash, label, adminToken, extras = {}) {
|
|
118
|
-
return post("register-machine", {
|
|
119
|
-
machine_hash: machineHash,
|
|
120
|
-
hmac_seed_hash: seedHash,
|
|
121
|
-
label,
|
|
122
|
-
admin_token: adminToken,
|
|
123
|
-
...extras
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export async function redeemEnrollment(machineHash, seedHash, label, enrollmentCode) {
|
|
128
|
-
return post("redeem-enrollment", {
|
|
129
|
-
machine_hash: machineHash,
|
|
130
|
-
hmac_seed_hash: seedHash,
|
|
131
|
-
label,
|
|
132
|
-
enrollment_code: enrollmentCode
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
export default {
|
|
137
|
-
retrieve, write, enable, addService, updateService, removeService, revoke,
|
|
138
|
-
status, test, createEnrollment, registerMachine, redeemEnrollment, getBaseUrl, getAnonKey
|
|
139
|
-
};
|
|
116
|
+
export async function changePassword(password, machineHash, token, timestamp, newSeedHash) {
|
|
117
|
+
return authPost("change-password", password, machineHash, token, timestamp, { new_hmac_seed_hash: newSeedHash });
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export async function createEnrollment(password, machineHash, token, timestamp, label, ttlMinutes, installId) {
|
|
121
|
+
const extra = {};
|
|
122
|
+
if (label) extra.label = label;
|
|
123
|
+
if (ttlMinutes) extra.ttl_minutes = ttlMinutes;
|
|
124
|
+
if (installId) extra.install_id = installId;
|
|
125
|
+
return authPost("create-enrollment", password, machineHash, token, timestamp, extra);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export async function registerMachine(machineHash, seedHash, label, adminToken, extras = {}) {
|
|
129
|
+
return post("register-machine", {
|
|
130
|
+
machine_hash: machineHash,
|
|
131
|
+
hmac_seed_hash: seedHash,
|
|
132
|
+
label,
|
|
133
|
+
admin_token: adminToken,
|
|
134
|
+
...extras
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export async function redeemEnrollment(machineHash, seedHash, label, enrollmentCode) {
|
|
139
|
+
return post("redeem-enrollment", {
|
|
140
|
+
machine_hash: machineHash,
|
|
141
|
+
hmac_seed_hash: seedHash,
|
|
142
|
+
label,
|
|
143
|
+
enrollment_code: enrollmentCode
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export default {
|
|
148
|
+
retrieve, write, enable, addService, updateService, removeService, revoke,
|
|
149
|
+
status, test, createEnrollment, registerMachine, redeemEnrollment, getBaseUrl, getAnonKey
|
|
150
|
+
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
@echo off
|
|
2
|
-
setlocal
|
|
3
|
-
set "CODEVELOP_SESSION=${SESSION_ID}"
|
|
4
|
-
set "CODEVELOP_PEER=${PEER}"
|
|
5
|
-
set "CODEVELOP_TARGET=${TARGET_PEER}"
|
|
6
|
-
set "CODEVELOP_BASE_URL=${BASE_URL}"
|
|
7
|
-
set "CODEVELOP_MANIFEST=${MANIFEST}"
|
|
8
|
-
set "CODEVELOP_CONTEXT=${CONTEXT_FILE}"
|
|
9
|
-
set "CELL_ROLE=codevelop-${PEER}"
|
|
10
|
-
cd /d "${CWD}"
|
|
11
|
-
if /i "%~1"=="--print-only" (
|
|
12
|
-
echo command: ${PRINT_COMMAND}
|
|
13
|
-
exit /b 0
|
|
14
|
-
)
|
|
15
|
-
echo Co-develop ${PEER} ready. Session ${SESSION_ID}. Listening for collaboration.
|
|
16
|
-
echo Context: ${CONTEXT_FILE}
|
|
17
|
-
node "${CLAUTH_CLI}" codevelop check-partner --repo "${REPO}" --peer ${PEER}
|
|
18
|
-
${COMMAND}
|
|
19
|
-
set EXITCODE=%ERRORLEVEL%
|
|
20
|
-
endlocal & exit /b %EXITCODE%
|
|
1
|
+
@echo off
|
|
2
|
+
setlocal
|
|
3
|
+
set "CODEVELOP_SESSION=${SESSION_ID}"
|
|
4
|
+
set "CODEVELOP_PEER=${PEER}"
|
|
5
|
+
set "CODEVELOP_TARGET=${TARGET_PEER}"
|
|
6
|
+
set "CODEVELOP_BASE_URL=${BASE_URL}"
|
|
7
|
+
set "CODEVELOP_MANIFEST=${MANIFEST}"
|
|
8
|
+
set "CODEVELOP_CONTEXT=${CONTEXT_FILE}"
|
|
9
|
+
set "CELL_ROLE=codevelop-${PEER}"
|
|
10
|
+
cd /d "${CWD}"
|
|
11
|
+
if /i "%~1"=="--print-only" (
|
|
12
|
+
echo command: ${PRINT_COMMAND}
|
|
13
|
+
exit /b 0
|
|
14
|
+
)
|
|
15
|
+
echo Co-develop ${PEER} ready. Session ${SESSION_ID}. Listening for collaboration.
|
|
16
|
+
echo Context: ${CONTEXT_FILE}
|
|
17
|
+
node "${CLAUTH_CLI}" codevelop check-partner --repo "${REPO}" --peer ${PEER}
|
|
18
|
+
${COMMAND}
|
|
19
|
+
set EXITCODE=%ERRORLEVEL%
|
|
20
|
+
endlocal & exit /b %EXITCODE%
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
@echo off
|
|
2
|
-
if not exist "${ACTIVE_LAUNCHER}" (
|
|
3
|
-
echo No active co-develop launcher has been written.
|
|
4
|
-
echo Run: clauth codevelop start --repo "${REPO}" --port ${PORT} --start-isolated-clauth
|
|
5
|
-
exit /b 1
|
|
6
|
-
)
|
|
7
|
-
call "${ACTIVE_LAUNCHER}" %*
|
|
1
|
+
@echo off
|
|
2
|
+
if not exist "${ACTIVE_LAUNCHER}" (
|
|
3
|
+
echo No active co-develop launcher has been written.
|
|
4
|
+
echo Run: clauth codevelop start --repo "${REPO}" --port ${PORT} --start-isolated-clauth
|
|
5
|
+
exit /b 1
|
|
6
|
+
)
|
|
7
|
+
call "${ACTIVE_LAUNCHER}" %*
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
{
|
|
2
|
-
"profiles": [
|
|
3
|
-
{
|
|
4
|
-
"name": "Co Develop Claude",
|
|
5
|
-
"guid": "{a2f8548f-82e6-44b4-bdbb-d934e8881f01}",
|
|
6
|
-
"commandline": "cmd.exe /k \"${CLAUTH_APPDATA}\\codevelop-claude.cmd\"",
|
|
7
|
-
"startingDirectory": "${REPO}",
|
|
8
|
-
"environment": {
|
|
9
|
-
"CELL_ROLE": "codevelop-claude"
|
|
10
|
-
},
|
|
11
|
-
"icon": "🔴",
|
|
12
|
-
"tabColor": "#B91C1C",
|
|
13
|
-
"colorScheme": "Dimidium"
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"name": "Co Develop Codex",
|
|
17
|
-
"guid": "{31a52b07-6efd-4b3d-96dd-ded73488140a}",
|
|
18
|
-
"commandline": "cmd.exe /k \"${CLAUTH_APPDATA}\\codevelop-codex.cmd\"",
|
|
19
|
-
"startingDirectory": "${REPO}",
|
|
20
|
-
"environment": {
|
|
21
|
-
"CELL_ROLE": "codevelop-codex"
|
|
22
|
-
},
|
|
23
|
-
"icon": "🧬",
|
|
24
|
-
"tabColor": "#0F766E",
|
|
25
|
-
"colorScheme": "Dimidium"
|
|
26
|
-
}
|
|
27
|
-
],
|
|
28
|
-
"layout": {
|
|
29
|
-
"wtArgs": [
|
|
30
|
-
"-w",
|
|
31
|
-
"new",
|
|
32
|
-
"new-tab",
|
|
33
|
-
"--profile",
|
|
34
|
-
"Co Develop Claude",
|
|
35
|
-
"--title",
|
|
36
|
-
"Co Develop Claude",
|
|
37
|
-
";",
|
|
38
|
-
"split-pane",
|
|
39
|
-
"-V",
|
|
40
|
-
"--size",
|
|
41
|
-
"0.50",
|
|
42
|
-
"--profile",
|
|
43
|
-
"Co Develop Codex",
|
|
44
|
-
"--title",
|
|
45
|
-
"Co Develop Codex"
|
|
46
|
-
]
|
|
47
|
-
}
|
|
48
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"profiles": [
|
|
3
|
+
{
|
|
4
|
+
"name": "Co Develop Claude",
|
|
5
|
+
"guid": "{a2f8548f-82e6-44b4-bdbb-d934e8881f01}",
|
|
6
|
+
"commandline": "cmd.exe /k \"${CLAUTH_APPDATA}\\codevelop-claude.cmd\"",
|
|
7
|
+
"startingDirectory": "${REPO}",
|
|
8
|
+
"environment": {
|
|
9
|
+
"CELL_ROLE": "codevelop-claude"
|
|
10
|
+
},
|
|
11
|
+
"icon": "🔴",
|
|
12
|
+
"tabColor": "#B91C1C",
|
|
13
|
+
"colorScheme": "Dimidium"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"name": "Co Develop Codex",
|
|
17
|
+
"guid": "{31a52b07-6efd-4b3d-96dd-ded73488140a}",
|
|
18
|
+
"commandline": "cmd.exe /k \"${CLAUTH_APPDATA}\\codevelop-codex.cmd\"",
|
|
19
|
+
"startingDirectory": "${REPO}",
|
|
20
|
+
"environment": {
|
|
21
|
+
"CELL_ROLE": "codevelop-codex"
|
|
22
|
+
},
|
|
23
|
+
"icon": "🧬",
|
|
24
|
+
"tabColor": "#0F766E",
|
|
25
|
+
"colorScheme": "Dimidium"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"layout": {
|
|
29
|
+
"wtArgs": [
|
|
30
|
+
"-w",
|
|
31
|
+
"new",
|
|
32
|
+
"new-tab",
|
|
33
|
+
"--profile",
|
|
34
|
+
"Co Develop Claude",
|
|
35
|
+
"--title",
|
|
36
|
+
"Co Develop Claude",
|
|
37
|
+
";",
|
|
38
|
+
"split-pane",
|
|
39
|
+
"-V",
|
|
40
|
+
"--size",
|
|
41
|
+
"0.50",
|
|
42
|
+
"--profile",
|
|
43
|
+
"Co Develop Codex",
|
|
44
|
+
"--title",
|
|
45
|
+
"Co Develop Codex"
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
}
|