@hua-labs/tap 0.6.0 → 0.6.1

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 (4) hide show
  1. package/AI_GUIDE.md +120 -15
  2. package/CHANGELOG.md +19 -5
  3. package/README.md +138 -268
  4. package/package.json +2 -3
package/AI_GUIDE.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # @hua-labs/tap AI Guide
2
2
 
3
3
  This guide is for AI operators using the public `@hua-labs/tap` package without
4
- access to HUA's private monorepo notes.
4
+ project-private runbooks.
5
5
 
6
6
  ## Release Boundary
7
7
 
@@ -13,16 +13,80 @@ Keep these boundaries explicit:
13
13
 
14
14
  - Inbox, projection, uplink, and review files are durable evidence.
15
15
  - Receiver/promoter delivery is the portable CLI/TUI/headless backbone.
16
- - Codex App / Desktop live delivery is strict-gated by runtime health and route
17
- freshness.
16
+ - Codex App / Desktop live delivery must not be reported as live-ready unless
17
+ runtime health and route freshness are both explicitly present.
18
18
  - `tap reviews register` is explicit; automatic registration from every writer
19
19
  path is a later follow-up.
20
20
  - Profile packs are data-only validation inputs in `0.6.x`; tap does not run
21
21
  commands from a pack.
22
+ - Gemini CLI support is legacy/deprecated. Antigravity CLI is not a bundled
23
+ adapter in `0.6.x`; model it as a custom profile-pack surface until a
24
+ dedicated adapter exists.
25
+
26
+ ## Operator Rules
27
+
28
+ AI operators must not claim live model delivery from file evidence alone.
29
+
30
+ Before reporting live readiness:
31
+
32
+ 1. Check setup state with `tap doctor --setup`.
33
+ 2. Check runtime state with `tap status`.
34
+ 3. Check delivery boundaries with `tap comms-doctor`.
35
+ 4. Treat inbox, projection, uplink, and review files as evidence only, not
36
+ proof of live model execution.
37
+ 5. Do not use broad role aliases as assignment targets unless a reviewed role
38
+ map resolves them to a concrete agent.
39
+
40
+ ## Do Not Claim
41
+
42
+ Do not claim that an agent received, read, or acted on a message unless the
43
+ relevant runtime surface reports live readiness or there is explicit returned
44
+ runtime evidence.
45
+
46
+ Durable inbox, projection, uplink, and review files may prove that tap wrote or
47
+ observed evidence. They do not prove live model execution by themselves.
48
+
49
+ ## Concepts
50
+
51
+ - **Runtime**: an AI tool or environment tap can connect to, such as Claude or
52
+ Codex.
53
+ - **Agent**: a concrete named participant, such as `agent-a`, that sends or
54
+ receives messages.
55
+ - **Surface**: the runtime interface being inspected, such as `codex-cli`,
56
+ `codex-app`, or a custom profile-pack surface.
57
+ - **Bridge**: a live adapter process used by runtimes that need one, such as
58
+ Codex app-server sessions.
59
+ - **Comms directory**: the shared file-backed message store used for inboxes,
60
+ reviews, handoffs, and evidence.
61
+ - **Profile**: a setup target that describes which runtime surface tap should
62
+ inspect or prepare.
63
+ - **Profile pack**: a data-only input that extends setup validation for custom
64
+ environments.
65
+
66
+ ## Command Relationship
67
+
68
+ Most users should start with `tap setup`.
69
+
70
+ - `setup`: inspect or apply guarded first-run MCP/setup changes.
71
+ - `doctor --setup`: verify the setup path and explain warnings.
72
+ - `init`: only create or reset the shared comms directory and tap state.
73
+ - `add`: add a runtime instance and patch that runtime's config.
74
+ - `ready`: prepare or verify a concrete agent on a runtime surface.
75
+ - `status`: summarize installed runtime state.
76
+ - `comms-doctor`: explain delivery and readiness by surface.
77
+ - `flow-doctor`: inspect one receiver/promoter lane without process mutation.
78
+
79
+ Use `setup` before `init` unless you specifically need manual comms directory
80
+ creation. Use `ready` after `add` when you want a named agent lane to be
81
+ discoverable and diagnosable.
22
82
 
23
83
  ## First-Run Path
24
84
 
25
- Run from a git repository:
85
+ This path separates setup inspection, guarded setup mutation, runtime instance
86
+ registration, and concrete agent readiness.
87
+
88
+ Run from an existing git repository. In a new test directory, initialize one
89
+ first:
26
90
 
27
91
  ```bash
28
92
  git init
@@ -40,15 +104,31 @@ Avoid broad role words such as `codex`, `reviewer`, `implementer`,
40
104
  `implementation`, and `tower` as assignment targets unless a reviewed role map
41
105
  makes them unambiguous.
42
106
 
107
+ ## Permissions And Safety
108
+
109
+ Safe mode reduces destructive local file operations. It is not a
110
+ network-isolated mode.
111
+
112
+ - Claude safe mode adds deny rules for destructive shell operations.
113
+ - Codex safe mode uses `workspace-write` sandboxing with trusted project paths,
114
+ writable roots, and network access.
115
+ - Full mode removes more guardrails and should only be used on trusted local
116
+ machines.
117
+
118
+ tap setup does not read credentials. It writes only reviewed tap-managed setup
119
+ artifacts, and it fails closed before mutating ambiguous user-managed MCP
120
+ entries.
121
+
43
122
  ## Expected Fresh-Install Results
44
123
 
45
- - `tap setup --apply --json` should return setup evidence without starting
46
- receiver, projection, uplink, app-server, or remote-panel processes.
124
+ - `tap setup --apply --json` should return setup evidence only. It should not
125
+ start receiver, projection, uplink, bridge, app-server, headless runner, or
126
+ remote-panel processes.
47
127
  - `tap status --json` may show zero installed instances until `tap add` runs.
48
128
  - `tap ready --surface codex-cli --agent agent-a --apply --json` should publish
49
129
  readiness for the concrete `agent-a` lane.
50
130
  - `tap comms-doctor --all-known --json` should diagnose locally installed or
51
- observed agents. Bundled operator profile surfaces require explicit
131
+ observed agents. Bundled compatibility profile surfaces require explicit
52
132
  `--include-profile-pack`.
53
133
  - In an auth-free container or fresh desktop, app/live delivery can remain
54
134
  blocked while inbox/receiver evidence is healthy.
@@ -63,8 +143,15 @@ npx @hua-labs/tap setup --profile codex-cli --profile-pack ./tap-profile-pack.js
63
143
  npx @hua-labs/tap doctor --setup --profile codex-cli --profile-pack ./tap-profile-pack.json --json
64
144
  ```
65
145
 
66
- If you are using `npx` without a local install, create `tap-profile-pack.json`
67
- from the example shape below or install the package as a dev dependency first.
146
+ When using `npx` without a local install, the example file under
147
+ `node_modules/@hua-labs/tap/...` may not exist in the current repo. In that
148
+ case, copy the minimal shape below or install the package locally as a dev
149
+ dependency first.
150
+
151
+ `--profile-pack <path>` validates a user-provided data file for `setup` and
152
+ `doctor --setup`. `--include-profile-pack` is different: it asks
153
+ `comms-doctor --all-known` to include bundled compatibility profile surfaces in
154
+ its diagnostic target list.
68
155
 
69
156
  Profile-pack paths are not auto-corrected because each operator may keep the
70
157
  repo, comms directory, state directory, and runtime surfaces in different
@@ -78,6 +165,16 @@ places. Use paths that are valid on the machine where the command runs:
78
165
  If the pack is invalid, `tap setup --apply` blocks before writing setup
79
166
  artifacts. Repair the reported JSON path, or rerun without `--profile-pack`.
80
167
 
168
+ ## Custom And Deprecated Runtime Surfaces
169
+
170
+ Gemini CLI remains in the package for legacy compatibility. New first-run
171
+ docs should not use Gemini as a default runtime.
172
+
173
+ If your workflow has moved to Antigravity CLI or another runtime, do not copy
174
+ Gemini commands blindly. Use a profile pack to describe the local surface,
175
+ paths, capabilities, and reviewed commands. In `0.6.x`, tap validates that data
176
+ but does not execute profile-pack commands.
177
+
81
178
  ## Minimal Generic Profile Pack
82
179
 
83
180
  ```json
@@ -124,10 +221,15 @@ artifacts. Repair the reported JSON path, or rerun without `--profile-pack`.
124
221
 
125
222
  ### `tap doctor --setup` reports `.mcp.json` cwd warning
126
223
 
127
- Rerun current `tap setup --profile codex-cli --apply --json`. The reviewed
128
- setup apply path writes guarded tap-managed `.mcp.json` entries with a `cwd`
129
- field. If an existing user-managed MCP entry is ambiguous, tap fails closed
130
- instead of overwriting it.
224
+ Rerun the current package version:
225
+
226
+ ```bash
227
+ npx @hua-labs/tap setup --profile codex-cli --apply --json
228
+ ```
229
+
230
+ The reviewed setup apply path writes guarded tap-managed `.mcp.json` entries
231
+ with a `cwd` field. If an existing user-managed MCP entry is ambiguous, tap
232
+ fails closed instead of overwriting it.
131
233
 
132
234
  ### `tap comms-doctor --all-known` shows app/live blockers
133
235
 
@@ -141,7 +243,10 @@ invent.
141
243
  That is expected in `0.6.x`. Profile packs are data-only. Commands in a pack
142
244
  must be reviewed manually and remain `defaultEnabled: false`.
143
245
 
144
- ### A command lists a bundled operator profile you do not recognize
246
+ ### A command lists a bundled compatibility profile you do not recognize
247
+
248
+ Some packages may expose compatibility profiles for existing operator
249
+ environments. These are discoverable metadata, not recommended public defaults.
145
250
 
146
251
  Treat it as a compatibility profile, not a public default. Some legacy helper
147
252
  surfaces remain discoverable for operators who already own those local runbooks,
@@ -155,7 +260,7 @@ Edit the pack for the current machine. Prefer repo-relative paths when the
155
260
  comms directory is inside the repo, and absolute paths when the comms directory
156
261
  is shared outside the repo. Do not copy another machine's host paths blindly.
157
262
 
158
- ### Source package says `0.6.0` but npm shows an older version
263
+ ### Source package says `0.6.x` but npm shows an older version
159
264
 
160
265
  Treat `package.json` version and public npm registry state separately. Verify
161
266
  the registry with:
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @hua-labs/tap
2
2
 
3
+ ## 0.6.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Restructure the npm README for first-run clarity: shorter quick start, early
8
+ preview boundary, explicit `ready` section, setup/init/add/ready relationship,
9
+ concise concepts, and npm badges.
10
+ - Move advanced AX and operator-safety details into `AI_GUIDE.md`, including
11
+ "do not claim" live-delivery rules, profile-pack flag distinctions, safer
12
+ `git init` guidance, setup mutation boundaries, and troubleshooting notes.
13
+ - Mark Gemini CLI support as legacy/deprecated in public docs. Antigravity CLI
14
+ should be modeled as a custom profile-pack surface until a dedicated adapter
15
+ exists.
16
+
3
17
  ## 0.6.0
4
18
 
5
19
  ### Minor Changes
@@ -30,10 +44,10 @@
30
44
 
31
45
  - `0.6.0` is an advanced operator preview, not a universal one-click runtime
32
46
  installer.
33
- - HUA machine topology, tmux sessions, one-character agent names, mission
34
- governance, and private profile packs are examples or profile-pack inputs;
35
- they are not public defaults.
36
- - Some advanced/HUA helper surfaces still expose existing named profiles for
47
+ - Host-specific topology, local process managers, custom agent names,
48
+ governance docs, and external profile packs are examples or profile-pack
49
+ inputs; they are not public defaults.
50
+ - Some advanced helper surfaces still expose existing named profiles for
37
51
  compatibility. Portable first-run docs use explicit neutral agents and
38
52
  profiles instead of relying on those helper defaults.
39
53
  - Codex App consent-drive / IPC remains experimental and strict-gated. A
@@ -59,7 +73,7 @@
59
73
 
60
74
  ### Patch Changes
61
75
 
62
- - c931481: Gen 25 trust-layer repair and delivery hardening.
76
+ - c931481: Trust-layer repair and delivery hardening.
63
77
  - split shared state (`TAP_STATE_DIR`) from per-bridge runtime state (`TAP_RUNTIME_STATE_DIR`) so headless restarts and later attached TUI sessions keep the correct identity
64
78
  - rebind attached TUI identity from runtime heartbeat and agent-name files instead of relying on one-shot session env injection
65
79
  - align bridge status, runtime heartbeat, and presence surfaces so `tap status`, bridge state, and plugin-visible presence report the same runtime truth
package/README.md CHANGED
@@ -1,48 +1,83 @@
1
1
  # @hua-labs/tap
2
2
 
3
- Zero-dependency CLI for cross-model AI agent communication setup.
3
+ [![npm version](https://img.shields.io/npm/v/@hua-labs/tap.svg)](https://www.npmjs.com/package/@hua-labs/tap)
4
+ [![npm downloads](https://img.shields.io/npm/dm/@hua-labs/tap.svg)](https://www.npmjs.com/package/@hua-labs/tap)
5
+ [![license](https://img.shields.io/npm/l/@hua-labs/tap.svg)](https://github.com/HUA-Labs/tap/blob/main/LICENSE)
4
6
 
5
- tap connects Claude, Codex, and other agent runtimes through a shared
6
- file-backed communication layer, with setup reports that keep runtime surfaces,
7
- durable evidence, and optional live adapters separate.
7
+ `@hua-labs/tap` is a lightweight CLI that lets multiple AI agent runtimes, such
8
+ as Claude and Codex, exchange messages through a shared file-backed
9
+ communication directory.
10
+
11
+ It focuses on safe setup, durable delivery evidence, and runtime-specific
12
+ diagnostics without requiring a central daemon for every runtime.
13
+
14
+ ## Preview Status
15
+
16
+ `0.6.x` is an advanced operator preview.
17
+
18
+ - Public defaults use neutral concrete agents such as `agent-a` and `agent-b`.
19
+ - `setup` is dry-run-first and only applies reviewed tap-managed changes.
20
+ - Profile packs are data-only validation inputs; tap does not run commands from
21
+ a profile pack in `0.6.x`.
22
+ - Codex App / Desktop live delivery is experimental and strict-gated by runtime
23
+ health and route freshness.
24
+ - Gemini CLI support is legacy/deprecated in this release line. If your
25
+ workflow has moved to Antigravity CLI, treat it as a custom profile-pack
26
+ surface until tap ships a dedicated adapter.
27
+
28
+ For detailed AI-operator troubleshooting, concepts, and advanced runtime notes,
29
+ read [AI_GUIDE.md](./AI_GUIDE.md). AI operators should read it before claiming
30
+ live delivery or runtime readiness.
8
31
 
9
32
  ## Requirements
10
33
 
11
- - **Node.js 22.6.0** — tap uses the global `WebSocket` API (stable in Node 22+). Node 20 and earlier are not supported; run with `fnm use 22` or `nvm use 22`.
34
+ - Node.js `>=22.6.0`
35
+ - A git repository for setup-managed MCP config
12
36
 
13
37
  ## Quick Start
14
38
 
15
- > `npx @hua-labs/tap` ships a bundled managed MCP server entry and runs that bundled `.mjs` with `node`. `bun` is only required when tap falls back to repo-local TypeScript sources during monorepo or local-dev workflows.
39
+ Run inside an existing git repository. For a new test directory only:
16
40
 
17
41
  ```bash
18
- # 1. Start in a git repo
19
42
  git init
43
+ ```
44
+
45
+ Then inspect and apply setup:
20
46
 
21
- # 2. Generate a dry-run setup report for your runtime surface
47
+ ```bash
48
+ # 1. Inspect setup changes first
22
49
  npx @hua-labs/tap setup --profile codex-cli --dry-run --json
23
50
 
24
- # 3. Apply only reviewed setup-safe changes
51
+ # 2. Apply only reviewed setup-safe changes
25
52
  npx @hua-labs/tap setup --profile codex-cli --apply --json
26
53
 
27
- # 4. Re-check setup readiness and surface status
54
+ # 3. Check setup readiness
28
55
  npx @hua-labs/tap doctor --setup --profile codex-cli --json
29
56
  npx @hua-labs/tap status --json
57
+ ```
58
+
59
+ To add and verify a concrete runtime lane later:
30
60
 
31
- # 5. Add a concrete runtime only when you are ready to patch that runtime
61
+ ```bash
32
62
  npx @hua-labs/tap add codex --name agent-a
33
63
  npx @hua-labs/tap ready --surface codex-cli --agent agent-a --apply --json
34
-
35
- # 6. Diagnose delivery separately from setup
36
64
  npx @hua-labs/tap comms-doctor --all-known --json
37
65
  ```
38
66
 
39
- `tap setup` is dry-run by default. The current reviewed apply path creates
40
- tap-owned directories, an initial tap state file, and guarded tap-managed repo
41
- `.mcp.json` entries. It does not start receiver, projection, uplink, bridge,
42
- app-server, headless runner, or remote panel processes, and it does not publish
43
- presence, repair route tuples, send messages, or read credentials.
67
+ ## What Setup Changes
68
+
69
+ `tap setup` is dry-run by default. With `--apply`, the reviewed public setup
70
+ path creates tap-owned directories, an initial tap state file, and guarded
71
+ tap-managed repo `.mcp.json` entries.
72
+
73
+ It does **not** start receiver, projection, uplink, bridge, app-server,
74
+ headless runner, or remote panel processes. It does not publish presence,
75
+ repair route tuples, send messages, or read credentials.
76
+
77
+ Most users should start with `setup`. Use `init` only when you want to manually
78
+ create or reset the shared communication directory and local tap state.
44
79
 
45
- Supported public setup profiles:
80
+ ## Supported Public Setup Profiles
46
81
 
47
82
  | Profile | Use when |
48
83
  | ---------------- | ----------------------------------------------------------------------- |
@@ -50,104 +85,56 @@ Supported public setup profiles:
50
85
  | `codex-app` | Codex App/Desktop route readiness should be inspected read-only. |
51
86
  | `claude-channel` | Claude/channel readiness should be inspected read-only. |
52
87
 
53
- HUA-specific machine names, paths, tmux sessions, one-character Korean agent
54
- names, and private profile packs are examples, not package defaults.
55
-
56
- For the `0.6.x` preview, release-facing commands use neutral agents such as
57
- `agent-a` and `agent-b`. HUA profiles and paths can be supplied through a
58
- reviewed profile pack or HUA runbook, but they are not package defaults.
59
-
60
- ## Commands
88
+ ## Common Commands
61
89
 
62
90
  ### `setup`
63
91
 
64
- Generate a dry-run-first setup report for public tap deployment.
92
+ Inspect and optionally apply first-run public deployment changes.
65
93
 
66
94
  ```bash
67
95
  npx @hua-labs/tap setup --profile codex-cli --dry-run --json
68
96
  npx @hua-labs/tap setup --profile codex-cli --apply --json
69
- TAP_AGENT=agent-a
70
- npx @hua-labs/tap setup --profile codex-app --agent "$TAP_AGENT" --json
71
- npx @hua-labs/tap setup --profile claude-channel --agent "$TAP_AGENT" --json
72
97
  npx @hua-labs/tap setup --profile codex-cli --profile-pack ./tap-profile-pack.json --json
73
98
  ```
74
99
 
75
- `--apply` is intentionally narrow: create reviewed tap-owned directories, an
76
- initial tap state file, and guarded tap-managed repo `.mcp.json` changes only.
77
- User-managed or ambiguous MCP entries fail closed before mutation.
100
+ tap refuses to mutate user-managed or ambiguous MCP entries.
78
101
 
79
- Profile packs are data-only validation inputs in `0.6.x`; tap reports their
80
- shape and blocks invalid packs before setup mutation, but it does not execute
81
- pack commands. A generic example is shipped at
82
- `examples/tap-profile-pack.example.json`.
102
+ ### `ready`
83
103
 
84
- ### `init`
104
+ Prepare or verify a concrete agent on a runtime surface.
85
105
 
86
- Initialize the comms directory and `.tap-comms/` state.
106
+ ```bash
107
+ npx @hua-labs/tap ready --surface codex-cli --agent agent-a --json
108
+ npx @hua-labs/tap ready --surface codex-cli --agent agent-a --apply --json
109
+ ```
110
+
111
+ By default, `ready` reports the current or planned readiness state. With
112
+ `--apply`, it applies reviewed readiness changes for the selected surface and
113
+ agent.
114
+
115
+ ### `init`
87
116
 
88
- By default, the comms directory is created inside the current repo at `./tap-comms`.
117
+ Create or reset the shared comms directory and `.tap-comms/` state.
89
118
 
90
119
  ```bash
91
120
  npx @hua-labs/tap init
92
121
  npx @hua-labs/tap init --comms-dir /path/to/comms
93
- npx @hua-labs/tap init --permissions safe # default: deny destructive ops
94
- npx @hua-labs/tap init --permissions full # no restrictions (use with caution)
95
- npx @hua-labs/tap init --force # re-initialize
122
+ npx @hua-labs/tap init --permissions safe
123
+ npx @hua-labs/tap init --permissions full
96
124
  ```
97
125
 
98
126
  ### `add <runtime>`
99
127
 
100
- Add a runtime. Probes config, plans patches, applies, and verifies.
128
+ Add a runtime instance and patch the runtime config when verification allows it.
101
129
 
102
130
  ```bash
103
131
  npx @hua-labs/tap add claude
104
- npx @hua-labs/tap add codex
105
- npx @hua-labs/tap add gemini
106
- npx @hua-labs/tap add claude --force # re-install
107
- npx @hua-labs/tap add codex --name agent-a --port 4520 # explicit port
108
- npx @hua-labs/tap add codex --name agent-b # portMap lookup, else auto-assign
109
- ```
110
-
111
- For Codex app-server instances, `--name agent-a` is the concrete agent identity
112
- used by `tap ready --agent agent-a`; the managed instance id remains
113
- `codex-agent-a`.
114
-
115
- Codex instances bind to an app-server port. Resolution order:
116
-
117
- 1. `--port <n>` — explicit override.
118
- 2. `portMap[<instanceId>]` from `tap-config.json` / `tap-config.local.json` when the
119
- entry is free (no state claim, TCP-available on loopback).
120
- 3. Auto-assign — scan from 4501 upward for the first free port.
121
-
122
- `portMap` is a hint, not a hard requirement: a missing entry or a conflict
123
- silently drops through to auto-assign. Convention:
124
-
125
- | Port | Instance | Role |
126
- | ---- | --------------- | ------------------ |
127
- | 4510 | `codex-agent-a` | Agent A |
128
- | 4511 | `codex-agent-b` | Agent B |
129
- | 4512 | `codex-agent-c` | Agent C |
130
- | 4520 | `codex-agent-d` | Agent D |
131
- | 4530 | `codex-probe` | Diagnostic / probe |
132
-
133
- ```json
134
- {
135
- "portMap": {
136
- "codex-agent-a": 4510,
137
- "codex-agent-b": 4511,
138
- "codex-agent-d": 4520
139
- }
140
- }
132
+ npx @hua-labs/tap add codex --name agent-a
133
+ npx @hua-labs/tap add codex --name agent-b --port 4520
141
134
  ```
142
135
 
143
- ### `remove <runtime>`
144
-
145
- Remove a runtime and rollback config changes.
146
-
147
- ```bash
148
- npx @hua-labs/tap remove claude
149
- npx @hua-labs/tap remove codex
150
- ```
136
+ `gemini` remains accepted for legacy compatibility, but new first-run docs do
137
+ not recommend it as a default runtime.
151
138
 
152
139
  ### `status`
153
140
 
@@ -158,87 +145,57 @@ npx @hua-labs/tap status
158
145
  npx @hua-labs/tap status --json
159
146
  ```
160
147
 
161
- Output shows three status levels:
162
-
163
- - **installed** — config written but not verified
164
- - **configured** — config written and verified
165
- - **active** — runtime is running and connected
166
-
167
148
  ### `doctor`
168
149
 
169
- Diagnose config drift, bridge health, managed MCP wiring, and runtime state.
170
- Use `--setup` for setup/config/warm-up readiness. Use the plain doctor for
171
- broader infrastructure checks.
150
+ Diagnose setup, config drift, bridge health, managed MCP wiring, and runtime
151
+ state.
172
152
 
173
153
  ```bash
174
154
  npx @hua-labs/tap doctor
175
- npx @hua-labs/tap doctor --fix
176
155
  npx @hua-labs/tap doctor --setup --profile codex-cli --json
177
- npx @hua-labs/tap doctor --setup --profile codex-cli --profile-pack ./tap-profile-pack.json --json
178
156
  ```
179
157
 
180
- `tap doctor --setup --apply` reuses the same guarded setup apply plan as
181
- `tap setup --apply`. It does not run the broad infrastructure fixer.
182
-
183
158
  ### `comms-doctor`
184
159
 
185
- Explain delivery by runtime surface. Use this when you need to separate live
186
- delivery, durable inbox evidence, receiver/promoter paths, MCP/channel
187
- visibility, and fallback evidence.
160
+ Explain delivery by runtime surface, including local inbox evidence and live
161
+ adapter readiness.
188
162
 
189
163
  ```bash
190
164
  npx @hua-labs/tap comms-doctor --all-known --json
191
- TAP_AGENT=agent-b
192
- npx @hua-labs/tap comms-doctor --agent "$TAP_AGENT" --plan-send --json
165
+ npx @hua-labs/tap comms-doctor --agent agent-a --plan-send --json
193
166
  ```
194
167
 
195
168
  ### `flow-doctor`
196
169
 
197
- Diagnose one receiver/promoter lane without mutating process state. Use this
198
- when an agent appears present but the operator needs one report for identity,
199
- receiver dry-run, return-uplink evidence, central presence freshness,
200
- active-turn queue state, and stale presence cleanup candidates.
170
+ Diagnose one receiver/promoter lane without mutating process state.
201
171
 
202
172
  ```bash
203
- TAP_AGENT=agent-a
204
- npx @hua-labs/tap flow-doctor --agent "$TAP_AGENT" --json
205
- npx @hua-labs/tap flow-doctor --agent "$TAP_AGENT" --presence-source-comms-dir ./tap-comms --presence-target-comms-dir ./tap-comms --json
173
+ npx @hua-labs/tap flow-doctor --agent agent-a --json
206
174
  ```
207
175
 
208
- `flow-doctor` is read-only by default. Its only reviewed cleanup mutation is
209
- `--apply-stale-presence-cleanup`, which archives stale non-lane presence
210
- records with a manifest and prunes matching stale heartbeat entries. It never
211
- publishes stale presence, restarts processes, changes route tuples, or deletes
212
- inbox/archive evidence.
176
+ `flow-doctor` is read-only by default. Its reviewed cleanup mode only archives
177
+ stale non-lane presence records with a manifest and prunes matching stale
178
+ heartbeat entries.
213
179
 
214
180
  ### `reviews register`
215
181
 
216
- Register formal review outcomes into the review evidence stream. Use this when
217
- review results should be discoverable outside the ordinary inbox flow.
182
+ Register formal review outcomes into a discoverable review evidence stream.
218
183
 
219
184
  ```bash
220
185
  npx @hua-labs/tap reviews register --source ./tap-comms --dry-run --json
221
186
  ```
222
187
 
223
- The explicit registration path is part of the `0.6.x` preview boundary.
224
- Automatic registration from every tap reply/review writer path is a future
225
- follow-up, so release notes should name the explicit command as the current
226
- workaround.
227
-
228
188
  ### `serve`
229
189
 
230
- Start the tap-comms MCP server (stdio). Convenience command for running the MCP server locally.
190
+ Start the bundled tap MCP server on stdio.
231
191
 
232
192
  ```bash
233
193
  npx @hua-labs/tap serve
234
- npx @hua-labs/tap serve --comms-dir /path/to/comms
235
194
  ```
236
195
 
237
- For npm installs, `serve` runs the bundled `mcp-server.mjs` entry with `node`. In monorepos or local checkouts, tap may fall back to repo-local `.ts` sources, which still require `bun`.
238
-
239
196
  ### `bridge start|stop|restart`
240
197
 
241
- Manage the Codex app-server bridge lifecycle.
198
+ Manage Codex app-server bridge lifecycle.
242
199
 
243
200
  ```bash
244
201
  npx @hua-labs/tap bridge start codex --agent-name agent-c
@@ -246,163 +203,76 @@ npx @hua-labs/tap bridge stop codex --keep-server
246
203
  npx @hua-labs/tap bridge restart codex
247
204
  ```
248
205
 
249
- `bridge stop --keep-server` leaves the managed app-server running and preserves its metadata in instance state so the next `bridge start` or `bridge restart` can reuse the existing session instead of forcing a fresh app-server.
250
-
251
- ## Supported Runtimes
252
-
253
- | Runtime | Config | Bridge | Mode |
254
- | ------- | ----------------------- | ---------------------- | ------------------ |
255
- | Claude | `.mcp.json` | native-push (fs.watch) | No daemon needed |
256
- | Codex | `~/.codex/config.toml` | WebSocket bridge | Daemon per session |
257
- | Gemini | `.gemini/settings.json` | polling | No daemon needed |
258
-
259
- ## `--json` Flag
260
-
261
- All commands support `--json` for machine-readable output. Returns a single JSON object to stdout with no human log noise.
262
-
263
- ```bash
264
- npx @hua-labs/tap status --json
265
- ```
266
-
267
- ```json
268
- {
269
- "ok": true,
270
- "command": "status",
271
- "code": "TAP_STATUS_OK",
272
- "message": "2 runtime(s) installed",
273
- "warnings": [],
274
- "data": {
275
- "version": "0.x.y",
276
- "commsDir": "/path/to/comms",
277
- "runtimes": {
278
- "claude": { "status": "active", "bridgeMode": "native-push" },
279
- "codex": { "status": "configured", "bridgeMode": "app-server" }
280
- }
281
- }
282
- }
283
- ```
284
-
285
- Error codes use `TAP_*` prefix: `TAP_ADD_OK`, `TAP_NO_OP`, `TAP_PATCH_FAILED`, etc.
286
-
287
- Exit codes: `0` = ok, `1` = error.
206
+ ## Core Concepts
207
+
208
+ - **Runtime**: an AI tool or environment tap can connect to, such as Claude or
209
+ Codex.
210
+ - **Agent**: a named participant, such as `agent-a`, that sends or receives
211
+ messages.
212
+ - **Surface**: a specific runtime interface, such as `codex-cli` or
213
+ `codex-app`.
214
+ - **Comms directory**: the shared file-backed message store for inboxes,
215
+ reviews, handoffs, and evidence.
216
+ - **Profile**: a setup target that describes which runtime surface tap should
217
+ inspect or prepare.
218
+ - **Profile pack**: a data-only input for validating custom operator
219
+ environments.
288
220
 
289
221
  ## Permissions
290
222
 
291
- `tap init` auto-configures runtime permissions.
223
+ Safe mode reduces destructive local file operations. It is not a
224
+ network-isolated mode.
292
225
 
293
- ### Safe mode (default)
226
+ - `safe` is the default.
227
+ - `full` enables less restricted local runtime settings and should only be used
228
+ on trusted machines.
294
229
 
295
- **Claude**: Adds deny rules to `.claude/settings.local.json` blocking destructive operations (force push, hard reset, rm -rf, etc.).
230
+ See [AI_GUIDE.md](./AI_GUIDE.md#permissions-and-safety) for details.
296
231
 
297
- **Codex**: Sets `workspace-write` sandbox, `full` network access, trusted project paths, and writable roots in `~/.codex/config.toml`.
232
+ ## JSON Output
298
233
 
299
- ### Full mode
234
+ Most operational commands support `--json` for machine-readable output.
300
235
 
301
236
  ```bash
302
- npx @hua-labs/tap init --permissions full
303
- ```
304
-
305
- **Claude**: Removes tap-managed deny rules. User-added rules preserved.
306
-
307
- **Codex**: Sets `danger-full-access` sandbox. Use on trusted local machines only.
308
-
309
- ## How It Works
310
-
311
- Agents communicate through a shared directory (`comms/`) using markdown files:
312
-
313
- ```
314
- comms/
315
- ├── inbox/ # Agent-to-agent messages
316
- ├── reviews/ # Code review results
317
- ├── findings/ # Out-of-scope discoveries
318
- ├── handoff/ # Session handoff documents
319
- ├── retros/ # Retrospectives
320
- └── archive/ # Archived messages
237
+ npx @hua-labs/tap status --json
321
238
  ```
322
239
 
323
- Each runtime has an adapter that:
324
-
325
- 1. **Probes** — finds config files, checks runtime installation
326
- 2. **Plans** — determines what patches to apply
327
- 3. **Applies** — backs up and patches config files
328
- 4. **Verifies** — confirms the runtime can read the config
240
+ Exit codes use `0` for ok and `1` for error. Error codes use the `TAP_*`
241
+ prefix.
329
242
 
330
- The adapter contract (`RuntimeAdapter`) is the extension point for adding new runtimes.
331
-
332
- ## Surface-First Delivery Model
333
-
334
- tap does not route by display name alone. It asks which runtime surface is
335
- available and what evidence exists:
336
-
337
- - CLI/TUI surfaces use durable inbox files plus receiver/promoter loops.
338
- - Claude/channel surfaces use channel readiness and durable inbox fallback.
339
- - Codex App consent-drive / IPC is an experimental live adapter and must see
340
- fresh explicit runtime health before it is treated as live-ready.
341
- - Inbox and projection files are durable evidence, not proof of live model
342
- execution.
243
+ ## Supported Runtimes
343
244
 
344
- Use `tap comms-doctor` to inspect these boundaries before claiming live
345
- delivery.
245
+ | Runtime | Status | Notes |
246
+ | ------- | ------------------------- | ------------------------------------------ |
247
+ | Claude | supported | Uses `.mcp.json` / channel-style delivery. |
248
+ | Codex | supported | Uses CLI, MCP, and app-server surfaces. |
249
+ | Gemini | legacy / deprecated | Kept for compatibility only. |
250
+ | Other | custom profile-pack input | Use data-only profile packs in `0.6.x`. |
346
251
 
347
- ## 0.6 Preview Boundary
252
+ Antigravity CLI is not a bundled adapter in `0.6.x`. Model it as a custom
253
+ profile-pack surface until a dedicated integration is released.
348
254
 
349
- `0.6.x` should be described as an advanced operator preview:
255
+ ## Examples
350
256
 
351
- - Public defaults use neutral profile ids and concrete agents.
352
- - Receiver/promoter plus durable inbox/projection/uplink evidence is the
353
- portable backbone for CLI/TUI/headless receive.
354
- - Codex App consent-drive / IPC remains experimental and strict-gated.
355
- - HUA machine topology, tmux sessions, one-character agent names, and
356
- mission/devlog governance are examples or profile-pack inputs.
357
- - Broad role aliases such as `codex`, `reviewer`, `implementer`,
358
- `implementation`, and `tower` are unsafe assignment targets unless a reviewed
359
- role mapping makes them unambiguous.
360
- - Archive-audit commands remain preserved, but they are not part of the
361
- first-run package story.
257
+ - Generic profile pack:
258
+ [`examples/tap-profile-pack.example.json`](./examples/tap-profile-pack.example.json)
259
+ - Narrative examples:
260
+ [`examples/`](./examples/)
362
261
 
363
- For AI-facing troubleshooting and first-run detail, read the package-local
364
- [AI Guide](./AI_GUIDE.md).
262
+ The narrative examples are real collaboration stories, not setup defaults.
365
263
 
366
264
  ## Recent Changes
367
265
 
368
- ### Config And Lifecycle
369
-
370
- - **Layered config resolution** — ConfigSource-based loading, instance config isolation, and runtime drift detection reduce cross-instance config bleed-through
371
- - **Managed lifecycle** — server lifecycle state, dual-session prevention, and health monitoring make bridge startup and recovery more predictable
372
- - **Repair path** — `tap doctor --fix` can now repair more managed config drift, including Codex MCP table mismatches
373
-
374
- ### Identity And Routing
375
-
376
- - **Permission mode + routing** — permission mode support, qualified name routing, and the name-claim protocol tighten runtime identity semantics
377
- - **Claim safety** — same-instance claim stealing is blocked while a live claim is still valid, while expired claims can still be reclaimed safely
378
-
379
- ### Bridge And Runtime Updates
380
-
381
- - **Bridge split and cleanup** — the legacy `bridge.ts` monolith was split into focused modules, then the old wrapper logic was removed
382
- - **Codex MCP defaults** — managed Codex installs now persist `[mcp_servers.tap] approval_mode = "auto"` and re-sync the runtime config hash when tap rewrites managed config
383
- - **Bundled MCP runtime** — bundled `.mjs` server entries now prefer `node`; repo-local TypeScript sources still use `bun`
384
- - **Hotfixes** — ESM `require()` breakage, temp file leaks in name claims, and claim-stealing edge cases were fixed during publish prep
385
-
386
- ### Trust Layer And Delivery
387
-
388
- - **Shared vs runtime state split** — `TAP_STATE_DIR` remains the shared source of truth while `TAP_RUNTIME_STATE_DIR` is reserved for per-bridge runtime files, so headless restarts and later TUI attaches keep the same identity contract
389
- - **Attached TUI rebind** — Codex TUI attach can now recover `agentId` and `agentName` from runtime heartbeat and agent-name files without relying on per-session env injection
390
- - **State surface alignment** — bridge status, runtime heartbeat, and presence now read from the same state surfaces, reducing mismatches between `tap status`, bridge state, and plugin-visible presence
391
- - **Broadcast dedupe** — bridge-dispatched notifications are deduplicated so one broadcast does not fan out twice
392
- - **Ack storm prevention** — peer DM auto-replies are rate-limited to stop acknowledgement loops from flooding the inbox
393
-
394
- ### Test Hardening
395
-
396
- - **CLI-path coverage** — integration tests now exercise the actual `bridge` and `up` command paths that patch Codex `approval_mode`
397
- - **Publish prep stabilization** — failing suites were fixed or quarantined so release-blocking regressions show up earlier in the main package tests
266
+ See [CHANGELOG.md](./CHANGELOG.md) for full release history.
398
267
 
399
- ## Migration Notes
268
+ Highlights in `0.6.x`:
400
269
 
401
- - **No hard breaking API change is intended in this release train**, but managed runtime defaults changed. Treat this as an operational migration, especially for Codex setups.
402
- - **Bundled MCP command changed for packaged installs** — if your managed `config.toml` still points bundled tap MCP entries at `bun`, rerun `npx @hua-labs/tap add codex --force` or `npx @hua-labs/tap doctor --fix` so bundled `.mjs` entries switch to `node`.
403
- - **Repo-local source workflows still use `bun`** local monorepo or source-checkout paths can still resolve to `.ts` server entries, so keep `bun` installed for development workflows.
404
- - **Codex approval mode should be `auto`** — managed Codex installs are expected to end up with `[mcp_servers.tap] approval_mode = "auto"`. `tap doctor --fix` will repair stale managed tables.
405
- - **Restart Codex bridges after upgrading** — managed bridge launches now export both `TAP_STATE_DIR` and `TAP_RUNTIME_STATE_DIR`; restart existing bridge processes so headless/runtime identity repair is active end-to-end.
270
+ - dry-run-first public setup profiles;
271
+ - `ready`, `comms-doctor`, and `flow-doctor` for surface-specific diagnostics;
272
+ - explicit `tap reviews register` evidence registration;
273
+ - profile-pack validation for custom environments;
274
+ - stricter broad-role and stale-presence guards;
275
+ - packaged AI operator guide and npm provenance publishing.
406
276
 
407
277
  ## License
408
278
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hua-labs/tap",
3
- "version": "0.6.0",
4
- "description": "Zero-dependency CLI for cross-model AI agent communication setup",
3
+ "version": "0.6.1",
4
+ "description": "Lightweight file-backed CLI for cross-model AI agent communication setup",
5
5
  "bin": {
6
6
  "tap": "bin/tap.mjs",
7
7
  "tap-comms": "bin/tap.mjs"
@@ -68,7 +68,6 @@
68
68
  "mcp",
69
69
  "claude",
70
70
  "codex",
71
- "gemini",
72
71
  "cli"
73
72
  ],
74
73
  "author": "HUA Labs",