@lifeaitools/clauth 1.30.24 → 1.30.26

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.
@@ -1,14 +1,14 @@
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
-
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
12
  ## How Claude Interfaces with clauth
13
13
 
14
14
  > **CRITICAL:** Agents should use the local daemon for credential discovery and
@@ -52,119 +52,119 @@ clauth write key github -p "YourPassword" # still prompts for the key value
52
52
 
53
53
  Call the auth-vault Edge Function directly only when debugging clauth internals.
54
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
-
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
100
  ### Password Handling
101
101
 
102
102
  - Do not ask the user for their clauth password for routine credential lookup
103
103
  - Use the unlocked local daemon whenever possible
104
104
  - Never log or echo the password
105
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
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
168
  clauth status [-p P] All services + state
169
169
  clauth test [-p P] Verify HMAC connection
170
170
  clauth list [-p P] Service names
@@ -173,34 +173,34 @@ clauth search <query> --addresses [-p P]
173
173
  Also search redacted address hints (may read multiple secrets)
174
174
 
175
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
-
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
204
  ## Daemon Metadata Cache
205
205
 
206
206
  When discovering service names, do not retrieve secrets. Use the daemon metadata
@@ -216,6 +216,37 @@ raw secrets and no Vault secret names. Fetch `GET /v/<service>` only for the one
216
216
  exact credential needed by the next command. Never walk every service and never
217
217
  bulk-fetch all secrets.
218
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
+
219
250
  ## MCP Server (v1.16.9+)
220
251
 
221
252
  clauth runs as an MCP server with five namespaced paths and safe
@@ -233,43 +264,43 @@ credential-discovery tools:
233
264
  The default live `/clauth` surface includes credential tools plus
234
265
  `call_agent`, `monkey_dispatch`, `handoff_start`, `terminal_*`, and `channel_*`.
235
266
  Admin write tools are gated by write-mode.
236
-
237
- ### claude.ai Connector URLs (noauth mode)
267
+
268
+ ### claude.ai Connector URLs (noauth mode)
238
269
  - `https://clauth.regendevcorp.com/clauth` — credential tools
239
270
  - `https://clauth.regendevcorp.com/gws` — Google Workspace
240
271
  - `https://clauth.regendevcorp.com/chitchat` — collaboration relay tools
241
272
  - `https://clauth.regendevcorp.com/codevelop` — peer development tools
242
273
  - `https://fs.regendevcorp.com/fs` — filesystem tools
243
-
274
+
244
275
  Noauth mode: fresh domains that return 404 on OAuth endpoints. claude.ai connects directly (Anthropic OAuth proxy bug workaround).
245
276
 
246
277
  Use `clauth_knowledge` or `clauth_status` for discovery. Use `clauth_get` only
247
278
  for one exact secret. `clauth_search` is metadata-only by default; pass
248
279
  `addresses: true` only when redacted address hints are intentionally needed.
249
280
  `clauth_inject` is guarded against accidental bulk vault sweeps.
250
-
281
+
251
282
  ### FS Tools
252
283
  `fs_read` `fs_write` `fs_stat` `fs_append` `fs_write_chunk` `fs_ingest_url`
253
284
  `fs_import_git_files` `fs_list` `fs_grep` `fs_glob` `fs_delete` `fs_mkdir`
254
285
  `fs_edit` `fs_move` `fs_copy` `fs_mounts` `fs_repo_status` `fs_use_branch`
255
286
  `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
-
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
+
259
290
  ### Testing
260
291
  ```bash
261
292
  node test-tools.mjs # MCP tool execution smoke tests
262
293
  ```
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 |
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 |