@lifeaitools/clauth 1.30.23 → 1.30.25

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 (49) hide show
  1. package/.clauth-skill/SKILL.md +306 -275
  2. package/.clauth-skill/references/operator-guide.md +175 -148
  3. package/README.md +363 -315
  4. package/cli/api.classify.test.js +75 -75
  5. package/cli/assets/codevelop/launcher-active.cmd.template +20 -20
  6. package/cli/assets/codevelop/launcher-static.cmd.template +7 -7
  7. package/cli/assets/codevelop/windows-terminal.profiles.json +48 -48
  8. package/cli/assets/watchdog.ps1 +42 -42
  9. package/cli/commands/agent-cron.js +396 -396
  10. package/cli/commands/agent-pool.js +1962 -1962
  11. package/cli/commands/codevelop.js +1190 -1190
  12. package/cli/commands/doctor.js +302 -302
  13. package/cli/commands/install.js +10 -10
  14. package/cli/commands/invite.js +175 -175
  15. package/cli/commands/join.js +179 -179
  16. package/cli/commands/npm.js +182 -182
  17. package/cli/commands/ops-install.js +211 -0
  18. package/cli/commands/ops.js +69 -0
  19. package/cli/commands/scrub.js +327 -327
  20. package/cli/commands/scrub.test.js +115 -115
  21. package/cli/commands/serve.js +381 -98
  22. package/cli/commands/watchdog.js +209 -209
  23. package/cli/conf-path.js +21 -21
  24. package/cli/enrollment-script.js +82 -82
  25. package/cli/fingerprint.js +143 -143
  26. package/cli/index.js +1073 -1053
  27. package/cli/lib/fs-git.js +282 -282
  28. package/cli/ops/coolify-adapter.js +80 -0
  29. package/cli/ops/deployment-adapter.js +63 -0
  30. package/cli/ops/job-store.js +116 -0
  31. package/cli/ops/operation-policy.js +51 -0
  32. package/cli/ops/pm2-adapter.js +128 -0
  33. package/cli/ops/serialized-executor.js +9 -0
  34. package/cli/recovery.js +101 -101
  35. package/cli/studio-debug.js +1095 -1095
  36. package/cli/supervisor-registry.js +594 -589
  37. package/cli/supervisor-registry.test.js +397 -397
  38. package/cli/supervisor-ui.test.js +5 -83
  39. package/cli/watchdog-registry.js +237 -209
  40. package/cli/watchdog-registry.test.js +112 -89
  41. package/install.ps1 +21 -21
  42. package/package.json +4 -2
  43. package/scripts/bin/bootstrap-linux +0 -0
  44. package/scripts/bin/bootstrap-macos +0 -0
  45. package/scripts/bin/bootstrap-win.exe +0 -0
  46. package/supabase/migrations/001_clauth_schema.sql +12 -12
  47. package/supabase/migrations/003_clauth_config.sql +13 -13
  48. package/supabase/migrations/003_machine_enrollments.sql +39 -39
  49. package/cli/served-script-syntax.test.mjs +0 -54
@@ -1,275 +1,306 @@
1
- ---
2
- name: clauth
3
- description: Install, configure, and operate clauth — the LIFEAI hardware-bound credential vault. Triggers on "install clauth", "set up my keys", "clauth install", "store my credentials", "set up the vault", or any mention of clauth or managing LIFEAI service credentials. When triggered for install, check GitHub MCP first, clone LIFEAI/clauth, and run the installer. Also handles ongoing clauth commands: status, get, write, enable, disable, add service, revoke.
4
- ---
5
-
6
- # clauth — LIFEAI Credential Vault
7
-
8
- Hardware-bound credential vault for the LIFEAI stack. Your machine is the second factor. Keys live in Supabase Vault (AES-256).
9
-
10
- ---
11
-
12
- ## How Claude Interfaces with clauth
13
-
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.
17
-
18
- ### Method 1 — Local daemon (preferred for agents)
19
-
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:
43
-
44
- ```bash
45
- clauth status -p "YourPassword"
46
- clauth test -p "YourPassword"
47
- clauth enable github -p "YourPassword"
48
- clauth write key github -p "YourPassword" # still prompts for the key value
49
- ```
50
-
51
- ### Method 3 — Direct API calls (implementation/debugging only)
52
-
53
- Call the auth-vault Edge Function directly only when debugging clauth internals.
54
- Normal agents should not bypass the daemon metadata cache.
55
-
56
- **Base URL:** `https://<project-ref>.supabase.co/functions/v1/auth-vault`
57
- **Auth header:** `Authorization: Bearer <supabase-anon-key>`
58
- **Method:** POST (all routes)
59
- **Content-Type:** `application/json`
60
-
61
- #### HMAC Token Derivation (must match server)
62
-
63
- ```js
64
- import { createHmac, createHash, execSync } from "crypto";
65
-
66
- // 1. Get machine hash (same as fingerprint.js)
67
- // Windows:
68
- const uuid = execSync("wmic csproduct get uuid /format:value", { encoding: "utf8" })
69
- .match(/UUID=([A-F0-9-]+)/i)?.[1]?.trim();
70
- const machineGuid = execSync(
71
- "reg query HKLM\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",
72
- { encoding: "utf8" }
73
- ).match(/MachineGuid\s+REG_SZ\s+([a-f0-9-]+)/i)?.[1]?.trim();
74
- const machineHash = createHash("sha256").update(`${uuid}:${machineGuid}`).digest("hex");
75
-
76
- // 2. Derive HMAC token
77
- const windowMs = 5 * 60 * 1000;
78
- const window = Math.floor(Date.now() / windowMs);
79
- const message = `${machineHash}:${window}`;
80
- const token = createHmac("sha256", password).update(message).digest("hex");
81
- const timestamp = window * windowMs;
82
- ```
83
-
84
- #### API Routes
85
-
86
- | Route | Body fields | Returns |
87
- |-------|-------------|---------|
88
- | `POST /status` | `machine_hash, token, timestamp, password` | `{ services: [...] }` |
89
- | `POST /test` | `machine_hash, token, timestamp, password` | `{ ok: true }` |
90
- | `POST /retrieve` | `+ service` | `{ value: "..." }` |
91
- | `POST /write` | `+ service, value` | `{ ok: true }` |
92
- | `POST /enable` | `+ service, enabled: bool` | `{ ok: true }` |
93
- | `POST /add` | `+ name, label, key_type, description` | `{ ok: true }` |
94
- | `POST /remove` | `+ service, confirm: true` | `{ ok: true }` |
95
- | `POST /revoke` | `+ service, confirm: true` | `{ ok: true }` |
96
- | `POST /register-machine` | `machine_hash, hmac_seed_hash, label, admin_token` | `{ ok: true }` |
97
-
98
- All auth routes require: `machine_hash`, `token`, `timestamp`, `password`.
99
-
100
- ### Password Handling
101
-
102
- - Do not ask the user for their clauth password for routine credential lookup
103
- - Use the unlocked local daemon whenever possible
104
- - Never log or echo the password
105
- - If the daemon is locked, ask the user to unlock `http://127.0.0.1:52437`
106
-
107
- ---
108
-
109
- ## When someone says "install clauth"
110
-
111
- ### Step 1 — Install from npm
112
-
113
- ```bash
114
- npm install -g @lifeaitools/clauth
115
- ```
116
-
117
- If already installed, update:
118
- ```bash
119
- npm update -g @lifeaitools/clauth
120
- ```
121
-
122
- ### Step 2 — Run the installer
123
-
124
- Use CLI flags to avoid interactive prompts:
125
-
126
- ```bash
127
- clauth install --ref <supabase-project-ref> --pat <personal-access-token>
128
- ```
129
-
130
- **Project ref** — last part of the Supabase project URL:
131
- `https://supabase.com/dashboard/project/` **`uvojezuorjgqzmhhgluu`**
132
-
133
- **Personal Access Token (PAT):**
134
- `https://supabase.com/dashboard/account/tokens` → Generate new token
135
- *(NOT the anon key or service_role — this is your account-level token)*
136
-
137
- The installer provisions everything and prints a **bootstrap token** — save it.
138
-
139
- ### Step 3 — Setup this machine
140
-
141
- ```bash
142
- clauth setup --admin-token <bootstrap-token> -p <password>
143
- ```
144
-
145
- Then verify:
146
- ```bash
147
- clauth test -p <password>
148
- clauth status -p <password>
149
- ```
150
-
151
- ### Step 4 — Write your first key
152
-
153
- ```bash
154
- clauth write key github -p <password> # prompts for value
155
- clauth enable github -p <password>
156
- clauth get github -p <password>
157
- ```
158
-
159
- See `references/keys-guide.md` for where to find every credential.
160
-
161
- ---
162
-
163
- ## Command reference
164
-
165
- ```
166
- clauth install [--ref R] [--pat P] First-time: provision Supabase + install skill
167
- clauth setup [--admin-token T] [-p P] Register this machine
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
176
- clauth write pw [-p P] Change password
177
- clauth enable <svc|all> [-p P] Activate service
178
- clauth disable <svc|all> [-p P] Suspend service
179
- clauth get <service> [-p P] Retrieve a key
180
-
181
- clauth add service <n> [-p P] Register new service
182
- clauth remove service <n> [-p P] Remove service
183
- clauth revoke <svc|all> [-p P] Delete key (destructive)
184
-
185
- clauth scrub Scrub active transcript (most recent .jsonl)
186
- clauth scrub <file> Scrub a specific file
187
- clauth scrub all Scrub all transcripts in ~/.claude/projects/
188
- clauth scrub all --force Rescrub everything (ignore markers)
189
-
190
- clauth uninstall --ref R --pat P Full teardown (DB, Edge Fn, secrets, skill, config)
191
- clauth uninstall --ref R --pat P --yes Skip confirmation
192
- ```
193
-
194
- ## Services
195
-
196
- `github` `supabase-anon` `supabase-service` `supabase-db`
197
- `vercel` `namecheap` `neo4j` `anthropic`
198
- `r2` `r2-bucket` `cloudflare` `rocketreach`
199
-
200
- Service type `fileserver` — mount configuration for fs tools (UI-only config).
201
-
202
- ---
203
-
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
- ```
213
-
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:
223
-
224
- | Path | Namespace | Tools |
225
- |------|-----------|-------|
226
- | `/clauth` | `clauth_*` + runtime helpers | 23 default live tools, including `clauth_knowledge` |
227
- | `/gws` | `gws_*` | 6 Google Workspace tools |
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.
236
-
237
- ### claude.ai Connector URLs (noauth mode)
238
- - `https://clauth.regendevcorp.com/clauth` — credential tools
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
242
- - `https://fs.regendevcorp.com/fs` filesystem tools
243
-
244
- Noauth mode: fresh domains that return 404 on OAuth endpoints. claude.ai connects directly (Anthropic OAuth proxy bug workaround).
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
-
251
- ### FS Tools
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`
256
-
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.
258
-
259
- ### Testing
260
- ```bash
261
- node test-tools.mjs # MCP tool execution smoke tests
262
- ```
263
-
264
- ---
265
-
266
- ## Troubleshooting
267
-
268
- | Error | Fix |
269
- |-------|-----|
270
- | `machine_not_found` | Run `clauth setup` |
271
- | `timestamp_expired` | Sync system clock |
272
- | `invalid_token` | Wrong password |
273
- | `service_disabled` | `clauth enable <service> -p <password>` |
274
- | `no_key_stored` | `clauth write key <service> -p <password>` |
275
- | ANSI garbage output | You piped stdin use `-p` flag instead |
1
+ ---
2
+ name: clauth
3
+ description: Install, configure, and operate clauth — the LIFEAI hardware-bound credential vault. Triggers on "install clauth", "set up my keys", "clauth install", "store my credentials", "set up the vault", or any mention of clauth or managing LIFEAI service credentials. When triggered for install, check GitHub MCP first, clone LIFEAI/clauth, and run the installer. Also handles ongoing clauth commands: status, get, write, enable, disable, add service, revoke.
4
+ ---
5
+
6
+ # clauth — LIFEAI Credential Vault
7
+
8
+ Hardware-bound credential vault for the LIFEAI stack. Your machine is the second factor. Keys live in Supabase Vault (AES-256).
9
+
10
+ ---
11
+
12
+ ## How Claude Interfaces with clauth
13
+
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.
17
+
18
+ ### Method 1 — Local daemon (preferred for agents)
19
+
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:
43
+
44
+ ```bash
45
+ clauth status -p "YourPassword"
46
+ clauth test -p "YourPassword"
47
+ clauth enable github -p "YourPassword"
48
+ clauth write key github -p "YourPassword" # still prompts for the key value
49
+ ```
50
+
51
+ ### Method 3 — Direct API calls (implementation/debugging only)
52
+
53
+ Call the auth-vault Edge Function directly only when debugging clauth internals.
54
+ Normal agents should not bypass the daemon metadata cache.
55
+
56
+ **Base URL:** `https://<project-ref>.supabase.co/functions/v1/auth-vault`
57
+ **Auth header:** `Authorization: Bearer <supabase-anon-key>`
58
+ **Method:** POST (all routes)
59
+ **Content-Type:** `application/json`
60
+
61
+ #### HMAC Token Derivation (must match server)
62
+
63
+ ```js
64
+ import { createHmac, createHash, execSync } from "crypto";
65
+
66
+ // 1. Get machine hash (same as fingerprint.js)
67
+ // Windows:
68
+ const uuid = execSync("wmic csproduct get uuid /format:value", { encoding: "utf8" })
69
+ .match(/UUID=([A-F0-9-]+)/i)?.[1]?.trim();
70
+ const machineGuid = execSync(
71
+ "reg query HKLM\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",
72
+ { encoding: "utf8" }
73
+ ).match(/MachineGuid\s+REG_SZ\s+([a-f0-9-]+)/i)?.[1]?.trim();
74
+ const machineHash = createHash("sha256").update(`${uuid}:${machineGuid}`).digest("hex");
75
+
76
+ // 2. Derive HMAC token
77
+ const windowMs = 5 * 60 * 1000;
78
+ const window = Math.floor(Date.now() / windowMs);
79
+ const message = `${machineHash}:${window}`;
80
+ const token = createHmac("sha256", password).update(message).digest("hex");
81
+ const timestamp = window * windowMs;
82
+ ```
83
+
84
+ #### API Routes
85
+
86
+ | Route | Body fields | Returns |
87
+ |-------|-------------|---------|
88
+ | `POST /status` | `machine_hash, token, timestamp, password` | `{ services: [...] }` |
89
+ | `POST /test` | `machine_hash, token, timestamp, password` | `{ ok: true }` |
90
+ | `POST /retrieve` | `+ service` | `{ value: "..." }` |
91
+ | `POST /write` | `+ service, value` | `{ ok: true }` |
92
+ | `POST /enable` | `+ service, enabled: bool` | `{ ok: true }` |
93
+ | `POST /add` | `+ name, label, key_type, description` | `{ ok: true }` |
94
+ | `POST /remove` | `+ service, confirm: true` | `{ ok: true }` |
95
+ | `POST /revoke` | `+ service, confirm: true` | `{ ok: true }` |
96
+ | `POST /register-machine` | `machine_hash, hmac_seed_hash, label, admin_token` | `{ ok: true }` |
97
+
98
+ All auth routes require: `machine_hash`, `token`, `timestamp`, `password`.
99
+
100
+ ### Password Handling
101
+
102
+ - Do not ask the user for their clauth password for routine credential lookup
103
+ - Use the unlocked local daemon whenever possible
104
+ - Never log or echo the password
105
+ - If the daemon is locked, ask the user to unlock `http://127.0.0.1:52437`
106
+
107
+ ---
108
+
109
+ ## When someone says "install clauth"
110
+
111
+ ### Step 1 — Install from npm
112
+
113
+ ```bash
114
+ npm install -g @lifeaitools/clauth
115
+ ```
116
+
117
+ If already installed, update:
118
+ ```bash
119
+ npm update -g @lifeaitools/clauth
120
+ ```
121
+
122
+ ### Step 2 — Run the installer
123
+
124
+ Use CLI flags to avoid interactive prompts:
125
+
126
+ ```bash
127
+ clauth install --ref <supabase-project-ref> --pat <personal-access-token>
128
+ ```
129
+
130
+ **Project ref** — last part of the Supabase project URL:
131
+ `https://supabase.com/dashboard/project/` **`uvojezuorjgqzmhhgluu`**
132
+
133
+ **Personal Access Token (PAT):**
134
+ `https://supabase.com/dashboard/account/tokens` → Generate new token
135
+ *(NOT the anon key or service_role — this is your account-level token)*
136
+
137
+ The installer provisions everything and prints a **bootstrap token** — save it.
138
+
139
+ ### Step 3 — Setup this machine
140
+
141
+ ```bash
142
+ clauth setup --admin-token <bootstrap-token> -p <password>
143
+ ```
144
+
145
+ Then verify:
146
+ ```bash
147
+ clauth test -p <password>
148
+ clauth status -p <password>
149
+ ```
150
+
151
+ ### Step 4 — Write your first key
152
+
153
+ ```bash
154
+ clauth write key github -p <password> # prompts for value
155
+ clauth enable github -p <password>
156
+ clauth get github -p <password>
157
+ ```
158
+
159
+ See `references/keys-guide.md` for where to find every credential.
160
+
161
+ ---
162
+
163
+ ## Command reference
164
+
165
+ ```
166
+ clauth install [--ref R] [--pat P] First-time: provision Supabase + install skill
167
+ clauth setup [--admin-token T] [-p P] Register this machine
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
176
+ clauth write pw [-p P] Change password
177
+ clauth enable <svc|all> [-p P] Activate service
178
+ clauth disable <svc|all> [-p P] Suspend service
179
+ clauth get <service> [-p P] Retrieve a key
180
+
181
+ clauth add service <n> [-p P] Register new service
182
+ clauth remove service <n> [-p P] Remove service
183
+ clauth revoke <svc|all> [-p P] Delete key (destructive)
184
+
185
+ clauth scrub Scrub active transcript (most recent .jsonl)
186
+ clauth scrub <file> Scrub a specific file
187
+ clauth scrub all Scrub all transcripts in ~/.claude/projects/
188
+ clauth scrub all --force Rescrub everything (ignore markers)
189
+
190
+ clauth uninstall --ref R --pat P Full teardown (DB, Edge Fn, secrets, skill, config)
191
+ clauth uninstall --ref R --pat P --yes Skip confirmation
192
+ ```
193
+
194
+ ## Services
195
+
196
+ `github` `supabase-anon` `supabase-service` `supabase-db`
197
+ `vercel` `namecheap` `neo4j` `anthropic`
198
+ `r2` `r2-bucket` `cloudflare` `rocketreach`
199
+
200
+ Service type `fileserver` — mount configuration for fs tools (UI-only config).
201
+
202
+ ---
203
+
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
+ ```
213
+
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
+ ## Managed PM2 Operations Control Plane
220
+
221
+ For LIFEAI development hosts, manage an approved PM2 application through the
222
+ bearer-authenticated clauth operations control plane. Do **not** invoke PM2
223
+ directly from an agent, dashboard, or deployment script. The policy file is the
224
+ allowlist: it names permitted applications, operations, deployment definitions,
225
+ and whether host-wide actions are available.
226
+
227
+ Install or validate the local controller with its explicit policy file:
228
+
229
+ ```bash
230
+ # Linux
231
+ clauth ops install --config /etc/clauth/ops-control-plane.json --dry-run
232
+ clauth ops install --config /etc/clauth/ops-control-plane.json
233
+
234
+ # Windows PowerShell
235
+ clauth ops install --config C:\ProgramData\clauth\ops-control-plane.json --dry-run
236
+ clauth ops install --config C:\ProgramData\clauth\ops-control-plane.json
237
+ ```
238
+
239
+ The live install replaces only the installer-owned `clauth-deployment` PM2
240
+ process, verifies its loopback `/health` response, and checks that an unauthenticated
241
+ catalog request is rejected. It retrieves its bearer only from the local clauth
242
+ service; never paste, print, or place that bearer in a policy file.
243
+
244
+ Use `clauth ops catalog` or the corresponding scoped MCP operations tools for
245
+ approved process inspection and lifecycle actions. Before a production promotion,
246
+ retain the job receipt and verify the selected application's health route. A
247
+ passing install proves controller setup; it does not by itself prove an arbitrary
248
+ application deployment.
249
+
250
+ ## MCP Server (v1.16.9+)
251
+
252
+ clauth runs as an MCP server with five namespaced paths and safe
253
+ credential-discovery tools:
254
+
255
+ | Path | Namespace | Tools |
256
+ |------|-----------|-------|
257
+ | `/clauth` | `clauth_*` + runtime helpers | 23 default live tools, including `clauth_knowledge` |
258
+ | `/gws` | `gws_*` | 6 Google Workspace tools |
259
+ | `/fs` | `fs_*` | 20 filesystem and git-safe file tools |
260
+ | `/chitchat` | `chitchat_*` | 7 collaboration relay tools |
261
+ | `/codevelop` | `codevelop_*` | 7 peer development tools |
262
+ | `/mcp` | all | 63 tools combined |
263
+
264
+ The default live `/clauth` surface includes credential tools plus
265
+ `call_agent`, `monkey_dispatch`, `handoff_start`, `terminal_*`, and `channel_*`.
266
+ Admin write tools are gated by write-mode.
267
+
268
+ ### claude.ai Connector URLs (noauth mode)
269
+ - `https://clauth.regendevcorp.com/clauth` — credential tools
270
+ - `https://clauth.regendevcorp.com/gws` Google Workspace
271
+ - `https://clauth.regendevcorp.com/chitchat` collaboration relay tools
272
+ - `https://clauth.regendevcorp.com/codevelop` peer development tools
273
+ - `https://fs.regendevcorp.com/fs` filesystem tools
274
+
275
+ Noauth mode: fresh domains that return 404 on OAuth endpoints. claude.ai connects directly (Anthropic OAuth proxy bug workaround).
276
+
277
+ Use `clauth_knowledge` or `clauth_status` for discovery. Use `clauth_get` only
278
+ for one exact secret. `clauth_search` is metadata-only by default; pass
279
+ `addresses: true` only when redacted address hints are intentionally needed.
280
+ `clauth_inject` is guarded against accidental bulk vault sweeps.
281
+
282
+ ### FS Tools
283
+ `fs_read` `fs_write` `fs_stat` `fs_append` `fs_write_chunk` `fs_ingest_url`
284
+ `fs_import_git_files` `fs_list` `fs_grep` `fs_glob` `fs_delete` `fs_mkdir`
285
+ `fs_edit` `fs_move` `fs_copy` `fs_mounts` `fs_repo_status` `fs_use_branch`
286
+ `fs_commit` `fs_diff`
287
+
288
+ 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.
289
+
290
+ ### Testing
291
+ ```bash
292
+ node test-tools.mjs # MCP tool execution smoke tests
293
+ ```
294
+
295
+ ---
296
+
297
+ ## Troubleshooting
298
+
299
+ | Error | Fix |
300
+ |-------|-----|
301
+ | `machine_not_found` | Run `clauth setup` |
302
+ | `timestamp_expired` | Sync system clock |
303
+ | `invalid_token` | Wrong password |
304
+ | `service_disabled` | `clauth enable <service> -p <password>` |
305
+ | `no_key_stored` | `clauth write key <service> -p <password>` |
306
+ | ANSI garbage output | You piped stdin — use `-p` flag instead |