@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.
package/README.md CHANGED
@@ -1,340 +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
- ## Scope — what clauth is, and is not
8
-
9
- clauth has exactly two jobs: it is the **credential vault** and the **SSH/box
10
- entry point** for the LIFEAI stack. Every other capability documented below —
11
- filesystem tools, collab relay, TinTin agent-session setup — exists in
12
- service of those two jobs: vaulting secrets and getting an authenticated
13
- session onto a machine.
14
-
15
- **clauth is not, and must never become:**
16
- - a message broker or pub/sub relay between apps or agents
17
- - a job queue (create/status/kill/dispatch semantics for long-running work)
18
- - a backend for another application's UI
19
-
20
- A feature that needs durable state, ownership/lifecycle semantics, or
21
- app-shaped query patterns belongs in that app's own datastore — not bolted
22
- onto the vault daemon. This boundary has been tested and held twice in one
23
- short stretch: a proposal to build a message-board feature inside clauth was
24
- rejected outright, and an existing thin dispatch proxy (job
25
- create/status/kill routed through clauth) is being extracted to its own
26
- backing store, leaving clauth to do only authentication and secret delivery
27
- on that path. If a new clauth feature proposal looks like either of those,
28
- it almost certainly belongs somewhere else.
29
-
30
- ---
31
-
32
- ## Install
33
-
34
- ```bash
35
- npm install -g @lifeaitools/clauth
36
- ```
37
-
38
- Then provision your Supabase project:
39
-
40
- ```bash
41
- clauth install
42
- ```
43
-
44
- That's it. `clauth install` handles everything:
45
- - Creates all database tables
46
- - Deploys the `auth-vault` Edge Function
47
- - Generates HMAC salt + bootstrap token
48
- - Tests the connection end-to-end
49
- - Installs the Claude skill
50
-
51
- At the end it prints a **bootstrap token** — save it for the next step.
52
-
53
- ---
54
-
55
- ## After Install Register Your Machine
56
-
57
- ```bash
58
- clauth setup
59
- ```
60
-
61
- Prompts for: machine label, password, bootstrap token (from `clauth install`).
62
-
63
- Then verify:
64
- ```bash
65
- clauth test # → PASS
66
- clauth status # 12 services, all NO KEY
67
- ```
68
-
69
- ### Add A New Computer
70
-
71
- On an old computer where clauth is already registered:
72
-
73
- ```bash
74
- clauth enroll --label "Dave-New-Laptop"
75
- ```
76
-
77
- This creates a one-time enrollment code tied to the same `install_id` and writes
78
- a one-time PowerShell setup script. Move that script to the new computer and run
79
- it. The script installs clauth, enrolls the computer, installs startup, then
80
- deletes itself. Setup defaults the machine label to the computer name and only
81
- asks you to set the new computer's local clauth password.
82
-
83
- The enrollment code does not copy repo credentials into the script. It lets the
84
- new hardware-bound `machine_hash` join the shared Supabase Vault once. After the
85
- code is redeemed, it cannot be used again.
86
-
87
- ---
88
-
89
- ## What clauth install asks for
90
-
91
- Two things from Supabase:
92
-
93
- **1. Project ref** the last segment of your Supabase project URL:
94
- `https://supabase.com/dashboard/project/` **`your-ref-here`**
95
-
96
- **2. Personal Access Token (PAT)**:
97
- `https://supabase.com/dashboard/account/tokens` Generate new token
98
-
99
- > This is **not** your anon key or service_role key — it is your account-level token.
100
-
101
- ---
102
-
103
- ## Writing Your First Key
104
-
105
- ```bash
106
- clauth write key github # prompts for value
107
- clauth enable github
108
- clauth get github
109
- ```
110
-
111
- ---
112
-
113
- ## Command Reference
114
-
115
- ```
116
- clauth install Provision Supabase + install Claude skill
117
- clauth setup Register this machine with the vault
118
- clauth enroll Create one-time code to add another computer
119
- clauth status All services + state
120
- clauth search <query> Find services by name, project, description, or type
121
- clauth search <query> --addresses
122
- Also search redacted address hints (may read multiple secrets)
123
- clauth test Verify connection
124
-
125
- clauth write key <service> Store a credential
126
- clauth write pw Change password
127
- clauth enable <svc|all> Activate service
128
- clauth disable <svc|all> Suspend service
129
- clauth get <service> Retrieve a key
130
- clauth npm whoami Verify npm token without PowerShell secret plumbing
131
- clauth npm sync-github-secret LIFEAI/rdc-skills
132
- Update GitHub NPM_TOKEN from clauth
133
-
134
- clauth add service <n> Register new service
135
- clauth remove service <n> Remove service
136
- clauth revoke <svc|all> Delete key (destructive)
137
- ```
138
-
139
- ## Built-in Services
140
-
141
- `github` `supabase-anon` `supabase-service` `supabase-db`
142
- `vercel` `namecheap` `neo4j` `anthropic`
143
- `r2` `r2-bucket` `cloudflare` `rocketreach`
144
-
145
- ---
146
-
147
- ## How It Works
148
-
149
- ```
150
- Machine fingerprint (BIOS UUID + OS install ID)
151
- + Your clauth password
152
- HMAC-SHA256 token + 5-min timestamp window
153
- → Supabase Edge Function validates
154
- → Returns AES-256 encrypted key from Vault
155
- ```
156
-
157
- Nothing stored locally. Password never persisted. Machine hash is one-way only.
158
-
159
- ---
160
-
161
- ## Daemon Mode (`clauth serve`)
162
-
163
- clauth runs as an HTTP daemon on `http://127.0.0.1:52437`. The daemon provides:
164
-
165
- - **Web UI** unlock vault, manage services, configure mounts
166
- - **REST API** — `GET /knowledge`, `GET /status`, `GET /v/<service>`, `GET /ping`, `POST /restart`, `GET /shutdown`
167
- - **MCP server** Model Context Protocol for Claude Code and claude.ai
168
- - **Cloudflare Tunnel** exposes MCP endpoints publicly for claude.ai connectors
169
-
170
- Start: `clauth serve start` (starts locked, auto-opens browser for unlock).
171
-
172
- Full daemon operations reference: see `regen-root/.claude/rules/clauth.md`.
173
-
174
- ### Safe Metadata Cache
175
-
176
- Agents and scripts must discover services through metadata endpoints, not by
177
- walking every secret endpoint. The daemon caches service metadata for 30 seconds:
178
-
179
- ```bash
180
- curl -s http://127.0.0.1:52437/knowledge # sanitized, agent-safe metadata
181
- curl -s http://127.0.0.1:52437/list-services # names only
182
- curl -s http://127.0.0.1:52437/status # full daemon metadata, cached
183
- ```
184
-
185
- `/knowledge` returns service names, labels, key types, enabled state, project,
186
- description, timestamps, and `has_key`. It never returns raw secrets or Vault
187
- secret names. Use `GET /v/<service>` only for the one exact secret needed by the
188
- next command. Do not bulk-fetch every service.
189
-
190
- ---
191
-
192
- ## MCP Server — 5 Namespaces, 63 Tools
193
-
194
- clauth is the single MCP interface for all local tools. One process, namespaced paths:
195
-
196
- | Path | Namespace | Tools | Description |
197
- |------|-----------|-------|-------------|
198
- | `/clauth` | `clauth_*` + runtime helpers | 23 | Credential vault operations, safe metadata cache, and agent runtime helpers |
199
- | `/gws` | `gws_*` | 6 | Google Workspace (Gmail, Calendar, Drive) |
200
- | `/fs` | `fs_*` | 20 | Filesystem plus guarded git/local-branch tools |
201
- | `/chitchat` | `chitchat_*` | 7 | Collaboration relay sessions |
202
- | `/codevelop` | `codevelop_*` | 7 | Peer development sessions |
203
- | `/mcp` | all | 63 | All namespaces combined (Claude Code) |
204
-
205
- The default live `/clauth` surface includes 13 credential tools plus
206
- `call_agent`, `monkey_dispatch`, `handoff_start`, `terminal_*`, and `channel_*`
207
- runtime helpers. Admin write tools such as enable/disable/project/token actions
208
- are gated by write-mode.
209
-
210
- ### TinTin Agent Setup
211
-
212
- clauth owns the local TinTin settings and isolated agent setup contract used by
213
- app sidebars and the standalone TinTin console.
214
-
215
- | Method | Route | Purpose |
216
- | --- | --- | --- |
217
- | `GET` | `/tintin/settings` | Read persisted TinTin app/agent/sidebar/dispatch/co-develop settings. |
218
- | `PUT` | `/tintin/settings` | Save TinTin app/agent/sidebar/dispatch/co-develop settings. |
219
- | `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. |
220
- | `POST` | `/tintin/agent-sessions` | Create or reuse an isolated agent cwd, normally a git worktree. |
221
-
222
- The agent-session response includes the requested agent/runtime/model, repo
223
- root, isolated `cwd`, worktree path, branch, launch mode, and launch command.
224
- This route prepares the proper Codex/Claude isolation path; separate supervisor
225
- code is still responsible for long-running process parking and wake/resume.
226
-
227
- ### clauth MCP Usage
228
-
229
- Use `clauth_knowledge` or `clauth_status` for discovery. They use cached
230
- metadata and never retrieve raw secrets. `clauth_search` is metadata-only by
231
- default; pass `addresses: true` only when you intentionally need redacted address
232
- hints from connstrings/fileserver/oauth secrets. `clauth_get` is for one exact
233
- secret. `clauth_inject` refuses more than five services unless `allow_many: true`
234
- is explicitly supplied, to prevent accidental rate-limit lockouts from bulk
235
- secret sweeps.
236
-
237
- ### FS Tools
238
-
239
- 20 filesystem tools with path-jail security:
240
- - `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`
241
- - Uses `node:fs/promises` (async), `@vscode/ripgrep` (shipped binary), `fast-glob`
242
- - Permission flags per mount: `r` (read), `w` (write), `d` (delete)
243
- - Mount config stored as "fileserver" service type in vault only configurable through web UI
244
- - 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`
245
- - 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`
246
-
247
- ### Collaboration Tools
248
-
249
- Chitchat tools: `chitchat_start`, `chitchat_list`, `chitchat_send`, `chitchat_recv`, `chitchat_reply`, `chitchat_poll`, `chitchat_stop`
250
-
251
- Codevelop tools: `codevelop_start`, `codevelop_join`, `codevelop_send`, `codevelop_poll`, `codevelop_status`, `codevelop_stream`, `codevelop_stop`
252
-
253
- ### GWS Tools
254
-
255
- 6 Google Workspace tools: `gws_run`, `gws_gmail_list`, `gws_gmail_read`, `gws_gmail_send`, `gws_calendar_list`, `gws_drive_list`
256
- - Calls `gws` CLI via `execSync` with `shell: 'bash'` (fixes Windows cmd.exe JSON quoting)
257
-
258
- ---
259
-
260
- ## claude.ai Integration
261
-
262
- ### Noauth Mode (v1.5.38)
263
-
264
- 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.
265
-
266
- **Workaround:** Noauth hosts fresh domains where OAuth endpoints return 404. claude.ai connects directly (tunnel URL is the shared secret).
267
-
268
- ### OAuth 2.1 (v1.5.36-37)
269
-
270
- Full OAuth 2.1 protocol implementation is present for future use when Anthropic fixes the bug:
271
- - 401 gate with `WWW-Authenticate` header
272
- - Dynamic client registration (public client, no secret)
273
- - Mandatory PKCE S256
274
- - `Cache-Control: no-store`
275
-
276
- ### Connector URLs
277
-
278
- | Connector | URL |
279
- |-----------|-----|
280
- | clauth | `https://clauth.regendevcorp.com/clauth` |
281
- | gws | `https://clauth.regendevcorp.com/gws` |
282
- | chitchat | `https://clauth.regendevcorp.com/chitchat` |
283
- | codevelop | `https://clauth.regendevcorp.com/codevelop` |
284
- | fs | `https://fs.regendevcorp.com/fs` |
285
-
286
- ---
287
-
288
- ## Dependencies (notable)
289
-
290
- - `@vscode/ripgrep` — shipped ripgrep binary for `fs_grep`
291
- - `fast-glob` pattern matching for `fs_glob`
292
-
293
- ---
294
-
295
- ## Testing
296
-
297
- ```bash
298
- node test-tools.mjs # MCP tool execution smoke tests
299
- ```
300
-
301
- Tests actual MCP tool calls (not just OAuth + listing).
302
-
303
- ---
304
-
305
- ## Releasing a New Version (maintainers)
306
-
307
- Publishing is **manual** — there is no auto-publish. The GitHub Actions
308
- `publish.yml` workflow was removed on 2026-04-27 (commit `08b7751`); trusted
309
- publishing via OIDC was tried first (`b2bf08b`→`41d2d92`) and dropped. clauth is
310
- a **private** repo and GitHub Actions bill for minutes on private repos, so we
311
- don't run them here (reserve Actions for *public* repos, where they're free).
312
-
313
- ```bash
314
- # 1. Bump version in package.json
315
- # 2. Commit + tag + push
316
- git add -A && git commit -m "feat(...): description (vX.Y.Z)"
317
- git tag vX.Y.Z
318
- git push && git push --tags
319
-
320
- # 3. Publish manually with the vault npm token
321
- clauth npm set-local # writes ~/.npmrc auth from the vault 'npm' service
322
- npm publish --access public
323
-
324
- # 4. Verify on the registry (direct check bypasses npm's local cache)
325
- curl -s https://registry.npmjs.org/@lifeaitools/clauth \
326
- | python -c "import sys,json;print(json.load(sys.stdin)['dist-tags'])"
327
-
328
- # 5. Update the running daemon
329
- curl -s -X POST http://127.0.0.1:52437/restart # picks up new code, stays unlocked
330
- ```
331
-
332
- **The tag push does NOT publish anything** you must run step 3. A version bump
333
- that is committed+tagged but never `npm publish`ed leaves the registry stale
334
- (symptom: `npm view` still shows the old version after a push).
335
-
336
- ---
337
-
338
- > Life before Profits. LIFEAI / PRT
339
- >
340
- > [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)