@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
package/README.md CHANGED
@@ -1,315 +1,363 @@
1
- # @lifeaitools/clauth
2
-
3
- Hardware-bound credential vault for the LIFEAI stack. Your machine is the second factor. Keys live in Supabase Vault (AES-256). Nothing sensitive ever touches a config file.
4
-
5
- ---
6
-
7
- ## Install
8
-
9
- ```bash
10
- npm install -g @lifeaitools/clauth
11
- ```
12
-
13
- Then provision your Supabase project:
14
-
15
- ```bash
16
- clauth install
17
- ```
18
-
19
- That's it. `clauth install` handles everything:
20
- - Creates all database tables
21
- - Deploys the `auth-vault` Edge Function
22
- - Generates HMAC salt + bootstrap token
23
- - Tests the connection end-to-end
24
- - Installs the Claude skill
25
-
26
- At the end it prints a **bootstrap token** — save it for the next step.
27
-
28
- ---
29
-
30
- ## After Install — Register Your Machine
31
-
32
- ```bash
33
- clauth setup
34
- ```
35
-
36
- Prompts for: machine label, password, bootstrap token (from `clauth install`).
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.
61
-
62
- ---
63
-
64
- ## What clauth install asks for
65
-
66
- Two things from Supabase:
67
-
68
- **1. Project ref** — the last segment of your Supabase project URL:
69
- `https://supabase.com/dashboard/project/` **`your-ref-here`**
70
-
71
- **2. Personal Access Token (PAT)**:
72
- `https://supabase.com/dashboard/account/tokens` → Generate new token
73
-
74
- > This is **not** your anon key or service_role key — it is your account-level token.
75
-
76
- ---
77
-
78
- ## Writing Your First Key
79
-
80
- ```bash
81
- clauth write key github # prompts for value
82
- clauth enable github
83
- clauth get github
84
- ```
85
-
86
- ---
87
-
88
- ## Command Reference
89
-
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 type
96
- clauth search <query> --addresses
97
- Also search redacted address hints (may read multiple secrets)
98
- clauth test Verify connection
99
-
100
- clauth write key <service> Store a credential
101
- clauth write pw Change password
102
- clauth enable <svc|all> Activate service
103
- clauth disable <svc|all> Suspend service
104
- clauth get <service> Retrieve a key
105
- clauth npm whoami Verify npm token without PowerShell secret plumbing
106
- clauth npm sync-github-secret LIFEAI/rdc-skills
107
- Update GitHub NPM_TOKEN from clauth
108
-
109
- clauth add service <n> Register new service
110
- clauth remove service <n> Remove service
111
- clauth revoke <svc|all> Delete key (destructive)
112
- ```
113
-
114
- ## Built-in Services
115
-
116
- `github` `supabase-anon` `supabase-service` `supabase-db`
117
- `vercel` `namecheap` `neo4j` `anthropic`
118
- `r2` `r2-bucket` `cloudflare` `rocketreach`
119
-
120
- ---
121
-
122
- ## How It Works
123
-
124
- ```
125
- Machine fingerprint (BIOS UUID + OS install ID)
126
- + Your clauth password
127
- → HMAC-SHA256 token + 5-min timestamp window
128
- → Supabase Edge Function validates
129
- → Returns AES-256 encrypted key from Vault
130
- ```
131
-
132
- Nothing stored locally. Password never persisted. Machine hash is one-way only.
133
-
134
- ---
135
-
136
- ## Daemon Mode (`clauth serve`)
137
-
138
- clauth runs as an HTTP daemon on `http://127.0.0.1:52437`. The daemon provides:
139
-
140
- - **Web UI** — unlock vault, manage services, configure mounts
141
- - **REST API** — `GET /knowledge`, `GET /status`, `GET /v/<service>`, `GET /ping`, `POST /restart`, `GET /shutdown`
142
- - **MCP server** — Model Context Protocol for Claude Code and claude.ai
143
- - **Cloudflare Tunnel** — exposes MCP endpoints publicly for claude.ai connectors
144
-
145
- Start: `clauth serve start` (starts locked, auto-opens browser for unlock).
146
-
147
- Full daemon operations reference: see `regen-root/.claude/rules/clauth.md`.
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
-
165
- ---
166
-
167
- ## MCP Server 5 Namespaces, 63 Tools
168
-
169
- clauth is the single MCP interface for all local tools. One process, namespaced paths:
170
-
171
- | Path | Namespace | Tools | Description |
172
- |------|-----------|-------|-------------|
173
- | `/clauth` | `clauth_*` + runtime helpers | 23 | Credential vault operations, safe metadata cache, and agent runtime helpers |
174
- | `/gws` | `gws_*` | 6 | Google Workspace (Gmail, Calendar, Drive) |
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
- ### TinTin Agent Setup
186
-
187
- clauth owns the local TinTin settings and isolated agent setup contract used by
188
- app sidebars and the standalone TinTin console.
189
-
190
- | Method | Route | Purpose |
191
- | --- | --- | --- |
192
- | `GET` | `/tintin/settings` | Read persisted TinTin app/agent/sidebar/dispatch/co-develop settings. |
193
- | `PUT` | `/tintin/settings` | Save TinTin app/agent/sidebar/dispatch/co-develop settings. |
194
- | `GET` | `/tintin/settings/ui` | Browser settings page for operators, with sections for Agent Setup, Agent Defaults, Sidebar Apps, Blackboard Dispatch, Co-develop Relay, and stored agent sessions. |
195
- | `POST` | `/tintin/agent-sessions` | Create or reuse an isolated agent cwd, normally a git worktree. |
196
-
197
- The agent-session response includes the requested agent/runtime/model, repo
198
- root, isolated `cwd`, worktree path, branch, launch mode, and launch command.
199
- This route prepares the proper Codex/Claude isolation path; separate supervisor
200
- code is still responsible for long-running process parking and wake/resume.
201
-
202
- ### clauth MCP Usage
203
-
204
- Use `clauth_knowledge` or `clauth_status` for discovery. They use cached
205
- metadata and never retrieve raw secrets. `clauth_search` is metadata-only by
206
- default; pass `addresses: true` only when you intentionally need redacted address
207
- hints from connstrings/fileserver/oauth secrets. `clauth_get` is for one exact
208
- secret. `clauth_inject` refuses more than five services unless `allow_many: true`
209
- is explicitly supplied, to prevent accidental rate-limit lockouts from bulk
210
- secret sweeps.
211
-
212
- ### FS Tools
213
-
214
- 20 filesystem tools with path-jail security:
215
- - `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`
216
- - Uses `node:fs/promises` (async), `@vscode/ripgrep` (shipped binary), `fast-glob`
217
- - Permission flags per mount: `r` (read), `w` (write), `d` (delete)
218
- - Mount config stored as "fileserver" service type in vault — only configurable through web UI
219
- - 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`
220
- - 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`
221
-
222
- ### Collaboration Tools
223
-
224
- Chitchat tools: `chitchat_start`, `chitchat_list`, `chitchat_send`, `chitchat_recv`, `chitchat_reply`, `chitchat_poll`, `chitchat_stop`
225
-
226
- Codevelop tools: `codevelop_start`, `codevelop_join`, `codevelop_send`, `codevelop_poll`, `codevelop_status`, `codevelop_stream`, `codevelop_stop`
227
-
228
- ### GWS Tools
229
-
230
- 6 Google Workspace tools: `gws_run`, `gws_gmail_list`, `gws_gmail_read`, `gws_gmail_send`, `gws_calendar_list`, `gws_drive_list`
231
- - Calls `gws` CLI via `execSync` with `shell: 'bash'` (fixes Windows cmd.exe JSON quoting)
232
-
233
- ---
234
-
235
- ## claude.ai Integration
236
-
237
- ### Noauth Mode (v1.5.38)
238
-
239
- claude.ai's OAuth proxy has a confirmed bug ([anthropics/claude-code#46140](https://github.com/anthropics/claude-code/issues/46140), [anthropics/claude-ai-mcp#136](https://github.com/anthropics/claude-ai-mcp/issues/136)): it completes the token exchange but never sends the authenticated request.
240
-
241
- **Workaround:** Noauth hosts fresh domains where OAuth endpoints return 404. claude.ai connects directly (tunnel URL is the shared secret).
242
-
243
- ### OAuth 2.1 (v1.5.36-37)
244
-
245
- Full OAuth 2.1 protocol implementation is present for future use when Anthropic fixes the bug:
246
- - 401 gate with `WWW-Authenticate` header
247
- - Dynamic client registration (public client, no secret)
248
- - Mandatory PKCE S256
249
- - `Cache-Control: no-store`
250
-
251
- ### Connector URLs
252
-
253
- | Connector | URL |
254
- |-----------|-----|
255
- | clauth | `https://clauth.regendevcorp.com/clauth` |
256
- | gws | `https://clauth.regendevcorp.com/gws` |
257
- | chitchat | `https://clauth.regendevcorp.com/chitchat` |
258
- | codevelop | `https://clauth.regendevcorp.com/codevelop` |
259
- | fs | `https://fs.regendevcorp.com/fs` |
260
-
261
- ---
262
-
263
- ## Dependencies (notable)
264
-
265
- - `@vscode/ripgrep` shipped ripgrep binary for `fs_grep`
266
- - `fast-glob`pattern matching for `fs_glob`
267
-
268
- ---
269
-
270
- ## Testing
271
-
272
- ```bash
273
- node test-tools.mjs # MCP tool execution smoke tests
274
- ```
275
-
276
- Tests actual MCP tool calls (not just OAuth + listing).
277
-
278
- ---
279
-
280
- ## Releasing a New Version (maintainers)
281
-
282
- Publishing is **manual** — there is no auto-publish. The GitHub Actions
283
- `publish.yml` workflow was removed on 2026-04-27 (commit `08b7751`); trusted
284
- publishing via OIDC was tried first (`b2bf08b`→`41d2d92`) and dropped. clauth is
285
- a **private** repo and GitHub Actions bill for minutes on private repos, so we
286
- don't run them here (reserve Actions for *public* repos, where they're free).
287
-
288
- ```bash
289
- # 1. Bump version in package.json
290
- # 2. Commit + tag + push
291
- git add -A && git commit -m "feat(...): description (vX.Y.Z)"
292
- git tag vX.Y.Z
293
- git push && git push --tags
294
-
295
- # 3. Publish manually with the vault npm token
296
- clauth npm set-local # writes ~/.npmrc auth from the vault 'npm' service
297
- npm publish --access public
298
-
299
- # 4. Verify on the registry (direct check — bypasses npm's local cache)
300
- curl -s https://registry.npmjs.org/@lifeaitools/clauth \
301
- | python -c "import sys,json;print(json.load(sys.stdin)['dist-tags'])"
302
-
303
- # 5. Update the running daemon
304
- curl -s -X POST http://127.0.0.1:52437/restart # picks up new code, stays unlocked
305
- ```
306
-
307
- **The tag push does NOT publish anything** — you must run step 3. A version bump
308
- that is committed+tagged but never `npm publish`ed leaves the registry stale
309
- (symptom: `npm view` still shows the old version after a push).
310
-
311
- ---
312
-
313
- > Life before Profits. LIFEAI / PRT
314
- >
315
- > ☕ [Support this project](https://github.com/sponsors/DaveLadouceur)
1
+ # @lifeaitools/clauth
2
+
3
+ Hardware-bound credential vault for the LIFEAI stack. Your machine is the second factor. Keys live in Supabase Vault (AES-256). Nothing sensitive ever touches a config file.
4
+
5
+ ---
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install -g @lifeaitools/clauth
11
+ ```
12
+
13
+ Then provision your Supabase project:
14
+
15
+ ```bash
16
+ clauth install
17
+ ```
18
+
19
+ That's it. `clauth install` handles everything:
20
+ - Creates all database tables
21
+ - Deploys the `auth-vault` Edge Function
22
+ - Generates HMAC salt + bootstrap token
23
+ - Tests the connection end-to-end
24
+ - Installs the Claude skill
25
+
26
+ At the end it prints a **bootstrap token** — save it for the next step.
27
+
28
+ ---
29
+
30
+ ## After Install — Register Your Machine
31
+
32
+ ```bash
33
+ clauth setup
34
+ ```
35
+
36
+ Prompts for: machine label, password, bootstrap token (from `clauth install`).
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.
61
+
62
+ ---
63
+
64
+ ## What clauth install asks for
65
+
66
+ Two things from Supabase:
67
+
68
+ **1. Project ref** — the last segment of your Supabase project URL:
69
+ `https://supabase.com/dashboard/project/` **`your-ref-here`**
70
+
71
+ **2. Personal Access Token (PAT)**:
72
+ `https://supabase.com/dashboard/account/tokens` → Generate new token
73
+
74
+ > This is **not** your anon key or service_role key — it is your account-level token.
75
+
76
+ ---
77
+
78
+ ## Writing Your First Key
79
+
80
+ ```bash
81
+ clauth write key github # prompts for value
82
+ clauth enable github
83
+ clauth get github
84
+ ```
85
+
86
+ ---
87
+
88
+ ## Command Reference
89
+
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 type
96
+ clauth search <query> --addresses
97
+ Also search redacted address hints (may read multiple secrets)
98
+ clauth test Verify connection
99
+
100
+ clauth write key <service> Store a credential
101
+ clauth write pw Change password
102
+ clauth enable <svc|all> Activate service
103
+ clauth disable <svc|all> Suspend service
104
+ clauth get <service> Retrieve a key
105
+ clauth npm whoami Verify npm token without PowerShell secret plumbing
106
+ clauth npm sync-github-secret LIFEAI/rdc-skills
107
+ Update GitHub NPM_TOKEN from clauth
108
+
109
+ clauth add service <n> Register new service
110
+ clauth remove service <n> Remove service
111
+ clauth revoke <svc|all> Delete key (destructive)
112
+ ```
113
+
114
+ ## Built-in Services
115
+
116
+ `github` `supabase-anon` `supabase-service` `supabase-db`
117
+ `vercel` `namecheap` `neo4j` `anthropic`
118
+ `r2` `r2-bucket` `cloudflare` `rocketreach`
119
+
120
+ ---
121
+
122
+ ## How It Works
123
+
124
+ ```
125
+ Machine fingerprint (BIOS UUID + OS install ID)
126
+ + Your clauth password
127
+ → HMAC-SHA256 token + 5-min timestamp window
128
+ → Supabase Edge Function validates
129
+ → Returns AES-256 encrypted key from Vault
130
+ ```
131
+
132
+ Nothing stored locally. Password never persisted. Machine hash is one-way only.
133
+
134
+ ---
135
+
136
+ ## Daemon Mode (`clauth serve`)
137
+
138
+ clauth runs as an HTTP daemon on `http://127.0.0.1:52437`. The daemon provides:
139
+
140
+ - **Web UI** — unlock vault, manage services, configure mounts
141
+ - **REST API** — `GET /knowledge`, `GET /status`, `GET /v/<service>`, `GET /ping`, `POST /restart`, `GET /shutdown`
142
+ - **MCP server** — Model Context Protocol for Claude Code and claude.ai
143
+ - **Cloudflare Tunnel** — exposes MCP endpoints publicly for claude.ai connectors
144
+
145
+ Start: `clauth serve start` (starts locked, auto-opens browser for unlock).
146
+
147
+ Full daemon operations reference: see `regen-root/.claude/rules/clauth.md`.
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
+
165
+ ### PM2 deployment control-plane installer
166
+
167
+ On a managed host, store the allowed PM2 targets and deployment definitions in a
168
+ server-side JSON file, then install or update the supervised endpoint:
169
+
170
+ ```bash
171
+ # Linux
172
+ clauth ops install --config /etc/clauth/ops-control-plane.json
173
+
174
+ # Windows PowerShell
175
+ clauth ops install --config C:\ProgramData\clauth\ops-control-plane.json
176
+ ```
177
+
178
+ The installer is idempotent on Linux and Windows: it creates or updates the
179
+ `clauth-deployment` PM2 process, probes its loopback health endpoint, and proves
180
+ that the operations catalog refuses requests without a bearer token. It does not
181
+ store or print a bearer token. Use `--dry-run` to validate the policy file before
182
+ changing PM2.
183
+
184
+ The policy is an explicit application allowlist; keep `allow_host_wide` false
185
+ unless a host-wide administrative operation has been deliberately approved. A
186
+ minimal local policy looks like:
187
+
188
+ ```json
189
+ {
190
+ "port": 53141,
191
+ "pm2_name": "clauth-deployment",
192
+ "operations": {
193
+ "agent_enabled": ["restart", "reload"],
194
+ "agent_applications": {
195
+ "restart": ["codeflow-mcp"],
196
+ "reload": ["codeflow-mcp"]
197
+ },
198
+ "allow_host_wide": false
199
+ }
200
+ }
201
+ ```
202
+
203
+ Verify the policy before installation, then verify the loopback service without
204
+ ever placing a bearer in a shell command:
205
+
206
+ ```bash
207
+ clauth ops install --config <policy-path> --dry-run
208
+ clauth ops install --config <policy-path>
209
+ curl -i http://127.0.0.1:<port>/health
210
+ curl -i http://127.0.0.1:<port>/v1/ops/catalog # must return 401 without a bearer
211
+ ```
212
+
213
+ ---
214
+
215
+ ## MCP Server 5 Namespaces, 63 Tools
216
+
217
+ clauth is the single MCP interface for all local tools. One process, namespaced paths:
218
+
219
+ | Path | Namespace | Tools | Description |
220
+ |------|-----------|-------|-------------|
221
+ | `/clauth` | `clauth_*` + runtime helpers | 23 | Credential vault operations, safe metadata cache, and agent runtime helpers |
222
+ | `/gws` | `gws_*` | 6 | Google Workspace (Gmail, Calendar, Drive) |
223
+ | `/fs` | `fs_*` | 20 | Filesystem plus guarded git/local-branch tools |
224
+ | `/chitchat` | `chitchat_*` | 7 | Collaboration relay sessions |
225
+ | `/codevelop` | `codevelop_*` | 7 | Peer development sessions |
226
+ | `/mcp` | all | 63 | All namespaces combined (Claude Code) |
227
+
228
+ The default live `/clauth` surface includes 13 credential tools plus
229
+ `call_agent`, `monkey_dispatch`, `handoff_start`, `terminal_*`, and `channel_*`
230
+ runtime helpers. Admin write tools such as enable/disable/project/token actions
231
+ are gated by write-mode.
232
+
233
+ ### TinTin Agent Setup
234
+
235
+ clauth owns the local TinTin settings and isolated agent setup contract used by
236
+ app sidebars and the standalone TinTin console.
237
+
238
+ | Method | Route | Purpose |
239
+ | --- | --- | --- |
240
+ | `GET` | `/tintin/settings` | Read persisted TinTin app/agent/sidebar/dispatch/co-develop settings. |
241
+ | `PUT` | `/tintin/settings` | Save TinTin app/agent/sidebar/dispatch/co-develop settings. |
242
+ | `GET` | `/tintin/settings/ui` | Browser settings page for operators, with sections for Agent Setup, Agent Defaults, Sidebar Apps, Blackboard Dispatch, Co-develop Relay, and stored agent sessions. |
243
+ | `POST` | `/tintin/agent-sessions` | Create or reuse an isolated agent cwd, normally a git worktree. |
244
+
245
+ The agent-session response includes the requested agent/runtime/model, repo
246
+ root, isolated `cwd`, worktree path, branch, launch mode, and launch command.
247
+ This route prepares the proper Codex/Claude isolation path; separate supervisor
248
+ code is still responsible for long-running process parking and wake/resume.
249
+
250
+ ### clauth MCP Usage
251
+
252
+ Use `clauth_knowledge` or `clauth_status` for discovery. They use cached
253
+ metadata and never retrieve raw secrets. `clauth_search` is metadata-only by
254
+ default; pass `addresses: true` only when you intentionally need redacted address
255
+ hints from connstrings/fileserver/oauth secrets. `clauth_get` is for one exact
256
+ secret. `clauth_inject` refuses more than five services unless `allow_many: true`
257
+ is explicitly supplied, to prevent accidental rate-limit lockouts from bulk
258
+ secret sweeps.
259
+
260
+ ### FS Tools
261
+
262
+ 20 filesystem tools with path-jail security:
263
+ - `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`
264
+ - Uses `node:fs/promises` (async), `@vscode/ripgrep` (shipped binary), `fast-glob`
265
+ - Permission flags per mount: `r` (read), `w` (write), `d` (delete)
266
+ - Mount config stored as "fileserver" service type in vault only configurable through web UI
267
+ - 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`
268
+ - 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`
269
+
270
+ ### Collaboration Tools
271
+
272
+ Chitchat tools: `chitchat_start`, `chitchat_list`, `chitchat_send`, `chitchat_recv`, `chitchat_reply`, `chitchat_poll`, `chitchat_stop`
273
+
274
+ Codevelop tools: `codevelop_start`, `codevelop_join`, `codevelop_send`, `codevelop_poll`, `codevelop_status`, `codevelop_stream`, `codevelop_stop`
275
+
276
+ ### GWS Tools
277
+
278
+ 6 Google Workspace tools: `gws_run`, `gws_gmail_list`, `gws_gmail_read`, `gws_gmail_send`, `gws_calendar_list`, `gws_drive_list`
279
+ - Calls `gws` CLI via `execSync` with `shell: 'bash'` (fixes Windows cmd.exe JSON quoting)
280
+
281
+ ---
282
+
283
+ ## claude.ai Integration
284
+
285
+ ### Noauth Mode (v1.5.38)
286
+
287
+ claude.ai's OAuth proxy has a confirmed bug ([anthropics/claude-code#46140](https://github.com/anthropics/claude-code/issues/46140), [anthropics/claude-ai-mcp#136](https://github.com/anthropics/claude-ai-mcp/issues/136)): it completes the token exchange but never sends the authenticated request.
288
+
289
+ **Workaround:** Noauth hosts — fresh domains where OAuth endpoints return 404. claude.ai connects directly (tunnel URL is the shared secret).
290
+
291
+ ### OAuth 2.1 (v1.5.36-37)
292
+
293
+ Full OAuth 2.1 protocol implementation is present for future use when Anthropic fixes the bug:
294
+ - 401 gate with `WWW-Authenticate` header
295
+ - Dynamic client registration (public client, no secret)
296
+ - Mandatory PKCE S256
297
+ - `Cache-Control: no-store`
298
+
299
+ ### Connector URLs
300
+
301
+ | Connector | URL |
302
+ |-----------|-----|
303
+ | clauth | `https://clauth.regendevcorp.com/clauth` |
304
+ | gws | `https://clauth.regendevcorp.com/gws` |
305
+ | chitchat | `https://clauth.regendevcorp.com/chitchat` |
306
+ | codevelop | `https://clauth.regendevcorp.com/codevelop` |
307
+ | fs | `https://fs.regendevcorp.com/fs` |
308
+
309
+ ---
310
+
311
+ ## Dependencies (notable)
312
+
313
+ - `@vscode/ripgrep` shipped ripgrep binary for `fs_grep`
314
+ - `fast-glob` — pattern matching for `fs_glob`
315
+
316
+ ---
317
+
318
+ ## Testing
319
+
320
+ ```bash
321
+ node test-tools.mjs # MCP tool execution smoke tests
322
+ ```
323
+
324
+ Tests actual MCP tool calls (not just OAuth + listing).
325
+
326
+ ---
327
+
328
+ ## Releasing a New Version (maintainers)
329
+
330
+ Publishing is **manual** — there is no auto-publish. The GitHub Actions
331
+ `publish.yml` workflow was removed on 2026-04-27 (commit `08b7751`); trusted
332
+ publishing via OIDC was tried first (`b2bf08b`→`41d2d92`) and dropped. clauth is
333
+ a **private** repo and GitHub Actions bill for minutes on private repos, so we
334
+ don't run them here (reserve Actions for *public* repos, where they're free).
335
+
336
+ ```bash
337
+ # 1. Bump version in package.json
338
+ # 2. Commit + tag + push
339
+ git add -A && git commit -m "feat(...): description (vX.Y.Z)"
340
+ git tag vX.Y.Z
341
+ git push && git push --tags
342
+
343
+ # 3. Publish manually with the vault npm token
344
+ clauth npm set-local # writes ~/.npmrc auth from the vault 'npm' service
345
+ npm publish --access public
346
+
347
+ # 4. Verify on the registry (direct check — bypasses npm's local cache)
348
+ curl -s https://registry.npmjs.org/@lifeaitools/clauth \
349
+ | python -c "import sys,json;print(json.load(sys.stdin)['dist-tags'])"
350
+
351
+ # 5. Update the running daemon
352
+ curl -s -X POST http://127.0.0.1:52437/restart # picks up new code, stays unlocked
353
+ ```
354
+
355
+ **The tag push does NOT publish anything** — you must run step 3. A version bump
356
+ that is committed+tagged but never `npm publish`ed leaves the registry stale
357
+ (symptom: `npm view` still shows the old version after a push).
358
+
359
+ ---
360
+
361
+ > Life before Profits. — LIFEAI / PRT
362
+ >
363
+ > ☕ [Support this project](https://github.com/sponsors/DaveLadouceur)