@hua-labs/tap 0.5.2 → 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.
- package/AI_GUIDE.md +270 -0
- package/CHANGELOG.md +81 -0
- package/README.md +189 -133
- package/dist/bridges/codex-app-server-auth-gateway.mjs +16 -1
- package/dist/bridges/codex-app-server-auth-gateway.mjs.map +1 -1
- package/dist/bridges/codex-app-server-bridge.d.mts +105 -12
- package/dist/bridges/codex-app-server-bridge.mjs +3149 -251
- package/dist/bridges/codex-app-server-bridge.mjs.map +1 -1
- package/dist/bridges/codex-bridge-runner.d.mts +4 -1
- package/dist/bridges/codex-bridge-runner.mjs +512 -58
- package/dist/bridges/codex-bridge-runner.mjs.map +1 -1
- package/dist/bridges/codex-remote-ipc-relay.d.mts +1 -0
- package/dist/bridges/codex-remote-ipc-relay.mjs +1912 -0
- package/dist/bridges/codex-remote-ipc-relay.mjs.map +1 -0
- package/dist/bridges/gemini-ide-companion-runner.mjs.map +1 -1
- package/dist/cli.mjs +30818 -8324
- package/dist/cli.mjs.map +1 -1
- package/dist/codex-a2a/index.d.mts +2 -0
- package/dist/codex-a2a/index.mjs +416 -0
- package/dist/codex-a2a/index.mjs.map +1 -0
- package/dist/codex-health/index.d.mts +76 -0
- package/dist/codex-health/index.mjs +153 -0
- package/dist/codex-health/index.mjs.map +1 -0
- package/dist/codex-ipc/index.d.mts +2 -0
- package/dist/codex-ipc/index.mjs +1834 -0
- package/dist/codex-ipc/index.mjs.map +1 -0
- package/dist/index-D4Khz2Mh.d.mts +206 -0
- package/dist/index-DMToLyGd.d.mts +256 -0
- package/dist/index.d.mts +763 -8
- package/dist/index.mjs +11586 -3438
- package/dist/index.mjs.map +1 -1
- package/dist/mcp-server.mjs +8838 -811
- package/dist/mcp-server.mjs.map +1 -1
- package/dist/types-FWvKrFUt.d.mts +43 -0
- package/examples/01-logic-battle-known-broken.md +46 -0
- package/examples/02-cross-model-review-root-cause.md +37 -0
- package/examples/03-convergence-pattern.md +42 -0
- package/examples/04-tower-broadcast.md +41 -0
- package/examples/05-self-awareness-paradox.md +49 -0
- package/examples/06-session-resurrection.md +37 -0
- package/examples/07-ghost-agent.md +31 -0
- package/examples/08-naming-creates-identity.md +36 -0
- package/examples/09-ceo-as-middleware.md +52 -0
- package/examples/10-files-as-interface.md +67 -0
- package/examples/README.md +34 -0
- package/examples/tap-profile-pack.example.json +71 -0
- package/package.json +22 -5
package/AI_GUIDE.md
ADDED
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
# @hua-labs/tap AI Guide
|
|
2
|
+
|
|
3
|
+
This guide is for AI operators using the public `@hua-labs/tap` package without
|
|
4
|
+
project-private runbooks.
|
|
5
|
+
|
|
6
|
+
## Release Boundary
|
|
7
|
+
|
|
8
|
+
`0.6.x` is an advanced operator preview. It helps AI runtimes produce durable
|
|
9
|
+
communication evidence and inspect setup state, but it does not guarantee live
|
|
10
|
+
model execution in every app surface.
|
|
11
|
+
|
|
12
|
+
Keep these boundaries explicit:
|
|
13
|
+
|
|
14
|
+
- Inbox, projection, uplink, and review files are durable evidence.
|
|
15
|
+
- Receiver/promoter delivery is the portable CLI/TUI/headless backbone.
|
|
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
|
+
- `tap reviews register` is explicit; automatic registration from every writer
|
|
19
|
+
path is a later follow-up.
|
|
20
|
+
- Profile packs are data-only validation inputs in `0.6.x`; tap does not run
|
|
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.
|
|
82
|
+
|
|
83
|
+
## First-Run Path
|
|
84
|
+
|
|
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:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
git init
|
|
93
|
+
npx @hua-labs/tap setup --profile codex-cli --dry-run --json
|
|
94
|
+
npx @hua-labs/tap setup --profile codex-cli --apply --json
|
|
95
|
+
npx @hua-labs/tap doctor --setup --profile codex-cli --json
|
|
96
|
+
npx @hua-labs/tap status --json
|
|
97
|
+
npx @hua-labs/tap add codex --name agent-a
|
|
98
|
+
npx @hua-labs/tap ready --surface codex-cli --agent agent-a --apply --json
|
|
99
|
+
npx @hua-labs/tap comms-doctor --all-known --json
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Use concrete agent names such as `agent-a`, `operator-a`, or `diagnostic-a`.
|
|
103
|
+
Avoid broad role words such as `codex`, `reviewer`, `implementer`,
|
|
104
|
+
`implementation`, and `tower` as assignment targets unless a reviewed role map
|
|
105
|
+
makes them unambiguous.
|
|
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
|
+
|
|
122
|
+
## Expected Fresh-Install Results
|
|
123
|
+
|
|
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.
|
|
127
|
+
- `tap status --json` may show zero installed instances until `tap add` runs.
|
|
128
|
+
- `tap ready --surface codex-cli --agent agent-a --apply --json` should publish
|
|
129
|
+
readiness for the concrete `agent-a` lane.
|
|
130
|
+
- `tap comms-doctor --all-known --json` should diagnose locally installed or
|
|
131
|
+
observed agents. Bundled compatibility profile surfaces require explicit
|
|
132
|
+
`--include-profile-pack`.
|
|
133
|
+
- In an auth-free container or fresh desktop, app/live delivery can remain
|
|
134
|
+
blocked while inbox/receiver evidence is healthy.
|
|
135
|
+
|
|
136
|
+
## Profile Pack Template
|
|
137
|
+
|
|
138
|
+
A generic example is shipped with the package:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
cp node_modules/@hua-labs/tap/examples/tap-profile-pack.example.json ./tap-profile-pack.json
|
|
142
|
+
npx @hua-labs/tap setup --profile codex-cli --profile-pack ./tap-profile-pack.json --json
|
|
143
|
+
npx @hua-labs/tap doctor --setup --profile codex-cli --profile-pack ./tap-profile-pack.json --json
|
|
144
|
+
```
|
|
145
|
+
|
|
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.
|
|
155
|
+
|
|
156
|
+
Profile-pack paths are not auto-corrected because each operator may keep the
|
|
157
|
+
repo, comms directory, state directory, and runtime surfaces in different
|
|
158
|
+
places. Use paths that are valid on the machine where the command runs:
|
|
159
|
+
|
|
160
|
+
- `paths.repoRoot`: the repository where tap commands run;
|
|
161
|
+
- `paths.commsDir`: the durable comms directory for inbox/projection/evidence;
|
|
162
|
+
- command snippets: reviewed operator hints only; tap validates them but does
|
|
163
|
+
not execute them in `0.6.x`.
|
|
164
|
+
|
|
165
|
+
If the pack is invalid, `tap setup --apply` blocks before writing setup
|
|
166
|
+
artifacts. Repair the reported JSON path, or rerun without `--profile-pack`.
|
|
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
|
+
|
|
178
|
+
## Minimal Generic Profile Pack
|
|
179
|
+
|
|
180
|
+
```json
|
|
181
|
+
{
|
|
182
|
+
"schemaVersion": "tap-profile-pack.v0",
|
|
183
|
+
"packId": "local.public.example",
|
|
184
|
+
"label": "Local public profile pack example",
|
|
185
|
+
"profiles": [
|
|
186
|
+
{
|
|
187
|
+
"id": "local-agent-a-cli",
|
|
188
|
+
"label": "Local Agent A CLI",
|
|
189
|
+
"agent": "agent-a",
|
|
190
|
+
"runtimeSurface": "codex-cli",
|
|
191
|
+
"paths": {
|
|
192
|
+
"repoRoot": ".",
|
|
193
|
+
"commsDir": "./tap-comms"
|
|
194
|
+
},
|
|
195
|
+
"capabilities": {
|
|
196
|
+
"ready": true,
|
|
197
|
+
"status": true,
|
|
198
|
+
"apply": false
|
|
199
|
+
},
|
|
200
|
+
"status": {
|
|
201
|
+
"kind": "codex-cli"
|
|
202
|
+
},
|
|
203
|
+
"ready": {
|
|
204
|
+
"surface": "codex-cli",
|
|
205
|
+
"commandRef": "ready-check"
|
|
206
|
+
},
|
|
207
|
+
"commands": {
|
|
208
|
+
"ready-check": {
|
|
209
|
+
"shell": "npx @hua-labs/tap ready --surface codex-cli --agent agent-a --json",
|
|
210
|
+
"risk": "read-only",
|
|
211
|
+
"reviewRequired": true,
|
|
212
|
+
"defaultEnabled": false
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
]
|
|
217
|
+
}
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
## Troubleshooting
|
|
221
|
+
|
|
222
|
+
### `tap doctor --setup` reports `.mcp.json` cwd warning
|
|
223
|
+
|
|
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.
|
|
233
|
+
|
|
234
|
+
### `tap comms-doctor --all-known` shows app/live blockers
|
|
235
|
+
|
|
236
|
+
That can be expected on a fresh auth-free machine. Check whether inbox and
|
|
237
|
+
receiver evidence are healthy before claiming live delivery is broken. App live
|
|
238
|
+
delivery needs runtime health and route freshness that package setup cannot
|
|
239
|
+
invent.
|
|
240
|
+
|
|
241
|
+
### Profile-pack validation passes but nothing starts
|
|
242
|
+
|
|
243
|
+
That is expected in `0.6.x`. Profile packs are data-only. Commands in a pack
|
|
244
|
+
must be reviewed manually and remain `defaultEnabled: false`.
|
|
245
|
+
|
|
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.
|
|
250
|
+
|
|
251
|
+
Treat it as a compatibility profile, not a public default. Some legacy helper
|
|
252
|
+
surfaces remain discoverable for operators who already own those local runbooks,
|
|
253
|
+
paths, and process managers. For a new install, use neutral concrete agents
|
|
254
|
+
such as `agent-a`, or provide a reviewed local profile pack. Do not copy a
|
|
255
|
+
profile command unless you own every path, host, and process name it references.
|
|
256
|
+
|
|
257
|
+
### Profile-pack paths are wrong after moving machines
|
|
258
|
+
|
|
259
|
+
Edit the pack for the current machine. Prefer repo-relative paths when the
|
|
260
|
+
comms directory is inside the repo, and absolute paths when the comms directory
|
|
261
|
+
is shared outside the repo. Do not copy another machine's host paths blindly.
|
|
262
|
+
|
|
263
|
+
### Source package says `0.6.x` but npm shows an older version
|
|
264
|
+
|
|
265
|
+
Treat `package.json` version and public npm registry state separately. Verify
|
|
266
|
+
the registry with:
|
|
267
|
+
|
|
268
|
+
```bash
|
|
269
|
+
npm view @hua-labs/tap version time.modified --json
|
|
270
|
+
```
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# @hua-labs/tap
|
|
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
|
+
|
|
17
|
+
## 0.6.0
|
|
18
|
+
|
|
19
|
+
### Minor Changes
|
|
20
|
+
|
|
21
|
+
- Ship the tap 0.6 advanced operator preview.
|
|
22
|
+
- Make `tap setup` and `tap doctor --setup` the first-run path for public
|
|
23
|
+
profiles (`codex-cli`, `codex-app`, and `claude-channel`), with dry-run-first
|
|
24
|
+
reports, guarded tap-managed `.mcp.json` apply behavior, and data-only
|
|
25
|
+
profile-pack validation.
|
|
26
|
+
- Position receiver/promoter delivery as the portable CLI/TUI/headless
|
|
27
|
+
backbone. Receiver promotion is idle-only for live turn start; active targets
|
|
28
|
+
leave queued/blocked evidence instead of silently steering or passing through.
|
|
29
|
+
- Add surface-first diagnostics across setup, status, comms-doctor, flow-doctor,
|
|
30
|
+
and review registration so AI operators can distinguish durable inbox
|
|
31
|
+
evidence, receiver/promoter delivery, return-uplink evidence, and experimental
|
|
32
|
+
live App delivery.
|
|
33
|
+
- Persist displayed-notification dedupe with receiver-scoped marker files so
|
|
34
|
+
restarts do not replay already displayed inbox items while broadcasts can
|
|
35
|
+
still be shown once per receiving runtime.
|
|
36
|
+
- Register formal review outcomes through the explicit
|
|
37
|
+
`tap reviews register` stream, including provenance-only handling for review
|
|
38
|
+
requests and stale review-meta chatter.
|
|
39
|
+
- Guard broad role aliases such as `codex`, `reviewer`, `implementer`,
|
|
40
|
+
`implementation`, and `tower` when multiple candidates exist. Release
|
|
41
|
+
coordination should use concrete agents or reviewed structured targets.
|
|
42
|
+
|
|
43
|
+
### Preview Boundaries
|
|
44
|
+
|
|
45
|
+
- `0.6.0` is an advanced operator preview, not a universal one-click runtime
|
|
46
|
+
installer.
|
|
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
|
|
51
|
+
compatibility. Portable first-run docs use explicit neutral agents and
|
|
52
|
+
profiles instead of relying on those helper defaults.
|
|
53
|
+
- Codex App consent-drive / IPC remains experimental and strict-gated. A
|
|
54
|
+
conversation id or route tuple alone is not authority for live injection.
|
|
55
|
+
- Durable inbox, projection, uplink, and review files are evidence records; they
|
|
56
|
+
are not proof that a target runtime executed work.
|
|
57
|
+
- Automatic registration from every tap reply/review writer remains a follow-up.
|
|
58
|
+
Use explicit `tap reviews register` for the 0.6 preview evidence stream.
|
|
59
|
+
- Archive-audit commands remain available for compatibility, but they are not
|
|
60
|
+
part of the first-run release story.
|
|
61
|
+
|
|
62
|
+
## 0.5.2
|
|
63
|
+
|
|
64
|
+
### Patch Changes
|
|
65
|
+
|
|
66
|
+
- Fix doctor onboarding false failures and remove DEP0190 shell deprecation warnings.
|
|
67
|
+
- doctor: empty inbox treated as warning instead of failure on fresh setup
|
|
68
|
+
- doctor: recognize npx package launcher as valid MCP entry
|
|
69
|
+
- runtime: remove shell: true from command probes to eliminate Node 24 DEP0190 warnings
|
|
70
|
+
- README: add git init to Quick Start
|
|
71
|
+
|
|
72
|
+
## 0.5.1
|
|
73
|
+
|
|
74
|
+
### Patch Changes
|
|
75
|
+
|
|
76
|
+
- c931481: Trust-layer repair and delivery hardening.
|
|
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
|
|
78
|
+
- rebind attached TUI identity from runtime heartbeat and agent-name files instead of relying on one-shot session env injection
|
|
79
|
+
- align bridge status, runtime heartbeat, and presence surfaces so `tap status`, bridge state, and plugin-visible presence report the same runtime truth
|
|
80
|
+
- deduplicate bridge-dispatched broadcast notifications
|
|
81
|
+
- rate-limit peer DM auto-replies to stop acknowledgement loops from flooding the inbox
|