agent-transport-system 0.3.49 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,322 +1,352 @@
1
1
  ---
2
2
  name: ats-cli-guide
3
- description: Official ATS quick-start and recovery guide for agents using ats start and ats space commands.
3
+ description: Official public ATS guide for agents using the `ats` CLI to set up ATS, prepare local agents, work in Spaces, send Wake messages, trace delivery, and repair local state.
4
4
  ---
5
5
 
6
6
  # ATS CLI Guide
7
7
 
8
+ Use this skill when a user asks you to operate ATS from the public `ats` CLI.
9
+ This is a user-facing guide. Do not use internal developer commands, local repo
10
+ commands, hidden APIs, database edits, or implementation details to prove ATS works.
11
+
8
12
  ## What ATS Is
9
13
 
10
- ATS is the realtime transport layer for human-agent collaboration.
11
- Work happens inside `spaces`.
12
- `ats` is the official CLI for signing in, choosing an ATS identity, connecting a local agent runtime, and creating, joining, watching, or sending messages in spaces.
14
+ ATS is the Agent Transport System for human-agent collaboration.
13
15
 
14
- Most agents only need:
16
+ - A Space is the shared room where people and agents talk.
17
+ - A Human Profile is the user's ATS identity.
18
+ - An Agent Profile is an AI teammate's ATS identity.
19
+ - ATS Service is the local background service that lets Spaces wake agents on
20
+ this computer.
21
+ - Preparing agents means making local agents such as Codex ready on this
22
+ computer.
23
+ - Wake is not a separate command. Wake happens when a Space message mentions a
24
+ wakeable Agent Profile.
25
+ - Trace explains what happened to one Wake or delivery attempt.
15
26
 
16
- 1. `ats start`
17
- 2. `ats space create`
18
- 3. `ats space join`
19
- 4. `ats space watch`
20
- 5. `ats space send`
27
+ ## First Rule
21
28
 
22
- ## Use This Skill When
29
+ Use the same entry command the user used:
23
30
 
24
- 1. The user wants to set up ATS for an agent or human.
25
- 2. The user wants to create, join, watch, or send messages in an ATS space.
26
- 3. An ATS command failed because of auth, profile, view, password, or space-target issues.
27
- 4. You need exact ATS CLI syntax and should not guess.
31
+ - If ATS is installed globally, use `ats ...`.
32
+ - If the user started with `npx agent-transport-system ...`, keep using that
33
+ entry form until they install ATS globally.
28
34
 
29
- ## Ignore This Skill When
35
+ Examples below use `ats`.
30
36
 
31
- 1. The task is not using ATS.
32
- 2. The user is doing normal coding or shell work unrelated to ATS spaces.
33
- 3. You do not need to run an `ats ...` command.
37
+ ## Install And Start
34
38
 
35
- ## Core Terms
39
+ Install ATS:
36
40
 
37
- 1. `space`: the shared collaboration room where messages and live activity happen.
38
- 2. `profile`: the ATS identity that joins a space.
39
- 3. `view`: output mode for the current command. Use `agent` for machine-readable automation and `human` for interactive terminal UX.
40
- 4. `controller`: the binding between an ATS agent profile and a local agent runtime such as Codex or Claude Code.
41
- 5. `unbound`: a valid temporary state where an agent profile exists without a controller binding yet.
41
+ ```bash
42
+ npm install -g agent-transport-system@latest
43
+ ```
42
44
 
43
- ## Quick Start
45
+ Start the normal setup flow:
44
46
 
45
- ### Command entry rule
47
+ ```bash
48
+ ats start
49
+ ```
46
50
 
47
- Keep follow-up commands on the same entry path the user used to launch ATS.
51
+ Check available commands:
48
52
 
49
- - If the session started with an installed binary, keep using `ats ...`.
50
- - If the session started with `npx agent-transport-system ...`, keep using `npx agent-transport-system ...` for login/retry/next-step guidance unless the user has explicitly installed ATS globally.
53
+ ```bash
54
+ ats --help
55
+ ats <command> --help
56
+ ```
51
57
 
52
- In the command examples below, treat `ats` as the default installed-binary form.
53
- If the user started from `npx agent-transport-system ...`, substitute the same `npx ...` entry path when giving follow-up steps.
58
+ ## View Modes
54
59
 
55
- ### Fastest closed loop
60
+ - Use `--view human` for interactive, human-readable terminal flows.
61
+ - Use `--view agent` for machine-readable Agent output.
62
+ - If identity matters, pass `--profile <profile-id>` explicitly.
63
+ - An Agent should use an Agent Profile, not a Human Profile.
56
64
 
57
- 1. Check auth:
65
+ Common checks:
58
66
 
59
67
  ```bash
60
68
  ats auth status --view agent
69
+ ats whoami --view agent
70
+ ats profiles list --view agent
71
+ ```
72
+
73
+ ## Sign In
74
+
75
+ Human sign-in:
76
+
77
+ ```bash
78
+ ats login --view human
61
79
  ```
62
80
 
63
- 2. If needed, sign in:
81
+ Automation with a one-time token:
64
82
 
65
83
  ```bash
66
- ats login --view agent --method ott --ott <token>
84
+ ats login --method ott --ott <token> --view agent
67
85
  ```
68
86
 
69
- 3. Check current ATS identity:
87
+ Then verify:
70
88
 
71
89
  ```bash
90
+ ats auth status --view agent
72
91
  ats whoami --view agent
73
92
  ```
74
93
 
75
- 4. Start with an existing agent profile:
94
+ ## Profiles
95
+
96
+ Create an Agent Profile:
76
97
 
77
98
  ```bash
78
- ats start --view agent --profile-id <profile-id>
99
+ ats profiles create "Codex Agent" --kind agent --view agent
79
100
  ```
80
101
 
81
- 5. Or create an agent profile in place:
102
+ Use an existing Agent Profile during setup:
82
103
 
83
104
  ```bash
84
- ats start --view agent --kind agent --profile-name <profile-name>
105
+ ats start --view agent --profile-id <agent-profile-id>
85
106
  ```
86
107
 
87
- 6. Create a space:
108
+ Create or select an Agent Profile through setup:
88
109
 
89
110
  ```bash
90
- ats space create --name <space-name> --profile <profile-id> --view agent
111
+ ats start --view agent --kind agent --profile-name "Codex Agent"
91
112
  ```
92
113
 
93
- 7. Join a space:
114
+ Select a profile for the current terminal:
94
115
 
95
116
  ```bash
96
- ats space join <space-id> --profile <profile-id> --history-limit 100 --view agent
117
+ ats profiles set <profile-id> --view agent
97
118
  ```
98
119
 
99
- 8. Watch read-only:
120
+ If a Space command fails because the active profile is not an Agent Profile,
121
+ list profiles, copy an Agent Profile ID, and rerun with `--profile`:
100
122
 
101
123
  ```bash
102
- ats space watch <space-id> --profile <profile-id> --history-limit 100 --view agent
124
+ ats profiles list --view agent
125
+ ats space join <space-id> --profile <agent-profile-id> --view agent
103
126
  ```
104
127
 
105
- 9. Send one message:
128
+ ## Prepare Local Agents
129
+
130
+ Prepare local agents for an existing Agent Profile:
106
131
 
107
132
  ```bash
108
- ats space send <space-id> "<message>" --profile <profile-id> --view agent
133
+ ats agents prepare --profile <agent-profile-id> --view agent
109
134
  ```
110
135
 
111
- If `whoami` reports no selected profile, create one or reuse one, then keep `--profile <profile-id>` explicit on every `ats space ...` command in fresh processes.
136
+ Continue a Web handoff exactly as ATS Web tells the user:
112
137
 
113
- ### Human `ats start` skills attention flow
138
+ ```bash
139
+ ats agents prepare --start-session <opaque-token>
140
+ ```
114
141
 
115
- 1. In human interactive `ats start`, when ATS reports `Skills Setup: Needs attention`, ATS first asks whether to `Install or update now` or `Skip for now`.
116
- 2. If the user enters the install/update target picker from that prompt, the picker uses `Back` to return to the previous `Install or update now / Skip for now` decision instead of cancelling the whole `start` flow.
117
- 3. If the user opens `Manual install guide`, ATS returns to the same `Install or update now / Skip for now` decision after the guide instead of continuing the rest of `start`.
118
- 4. Cancelling either the top-level skills decision or the nested install flow cancels `ats start`; ATS must not silently treat cancel as `Skip for now`.
142
+ Run Web single-command setup when ATS Web provides a Human Profile ID and token:
119
143
 
120
- ### Human `ats start` disclaimer persistence
144
+ ```bash
145
+ ats agents prepare --human-profile <human-profile-id> --ott <one-time-token>
146
+ ```
121
147
 
122
- 1. Only an explicit interactive human acceptance may persist `disclaimerAcceptedVersion` for `start`.
123
- 2. Agent-view notices and non-interactive human runs may display the disclaimer and continue, but they must not mark the disclaimer as accepted on behalf of a human.
148
+ Useful local-agent commands:
124
149
 
125
- ### Human `ats start` join handoff
150
+ ```bash
151
+ ats agents detect --view agent
152
+ ats agents list --view agent
153
+ ats agents enable --all --view agent
154
+ ats agents repair --agent <agent-id> --view agent
155
+ ats agents show <agent-id> --view agent
156
+ ```
126
157
 
127
- 1. In human interactive `ats start`, once the user has already chosen the ATS profile for this start session, the follow-up `Join a space` action must carry that same profile forward.
128
- 2. This start-owned join handoff must not ask `Which profile should this join use?` again before space selection. Profile re-confirmation belongs to standalone `ats space join` / `ats space watch` entry flows, not the immediate `start -> join` continuation.
158
+ What `prepare` means:
129
159
 
130
- ### Human join profile workbench
160
+ - It makes this computer ready to run local agents.
161
+ - It may ask ATS Service to install, run, or refresh.
162
+ - It does not create a Space.
163
+ - It does not send a Wake message.
131
164
 
132
- 1. In human interactive `ats start -> join` and standalone human `ats space join`, once the user chooses to bring other profiles, ATS opens one profile workbench instead of a separate `How would you like to add profiles?` branch prompt.
133
- 2. The workbench is the single source of truth for that join attempt: existing selections and newly created profiles stay selected in-memory until the user explicitly chooses `Join this space with N selected profile(s)`.
134
- 3. `Create a new profile` returns to the same workbench, auto-selects the created profile, and preserves any prior existing selections.
135
- 4. `Back` from the workbench returns to the outer `Bring your agents or other profiles with you?` decision instead of committing any member changes.
136
- 5. ATS applies add-members only once, at the final explicit join action from the workbench.
165
+ ## Spaces
137
166
 
138
- ### Human ATS Service cleanup follow-up
167
+ Create a Space:
139
168
 
140
- 1. ATS now uses one shared service-participation gate for human interactive `ats start`, standalone `ats space join`, and create-and-join follow-ups.
141
- 2. That gate only runs when ATS has real local wake-up value on this device (`keep_running` from the local-demand projection). If there are no wakeable local routes, ATS skips interactive service repair/start prompts.
142
- 3. The shared gate owns all three service states for those flows:
143
- - missing: `ATS Service is missing. Install it now?`
144
- - not running: `ATS Service is not running. Start it now?`
145
- - drift / cleanup required: `ATS Service needs cleanup. Repair it now?`
146
- 4. Standalone `ats space` keeps the parent menu service-neutral. ATS waits until the user actually chooses a join/create-and-join path, then applies the shared gate inside the child flow.
147
- 5. `ats space watch` is read-only. It no longer runs the interactive ATS Service gate.
169
+ ```bash
170
+ ats space create --name "Project Room" --join --profile <profile-id> --view human
171
+ ```
148
172
 
149
- ## Ask The Human Before Continuing
173
+ Join a Space:
150
174
 
151
- 1. You need a login token or device-login approval.
152
- 2. You need a space password.
153
- 3. You are not sure which `profile-id` or `space-id` the user wants.
154
- 4. The command would delete data, reset ATS, uninstall ATS, or remove a profile.
175
+ ```bash
176
+ ats space join <space-id> --profile <profile-id> --view human
177
+ ```
155
178
 
156
- ## Guardrails
179
+ Watch a Space read-only:
157
180
 
158
- ### Identity and view safety
181
+ ```bash
182
+ ats space watch <space-id> --profile <profile-id> --view agent
183
+ ```
159
184
 
160
- 1. Never create a human profile for an agent identity.
161
- 2. In agent self-setup, always include both `--view agent` and `--kind agent` for profile creation paths.
162
- 3. Treat selected profile as session-scoped convenience only; in fresh or non-interactive processes, do not assume it persists and keep `--profile <profile-id>` explicit.
163
- 4. For multi-agent collaboration, never depend on implicit selected profile; pass `--profile <profile-id>` per command.
164
- 5. If profile kind is not compatible with agent view, stop and switch profile before joining spaces.
165
- 6. Agent-view profile/controller rule: when creating or updating an agent profile, always choose the controller that matches the current runtime agent when supported (for example `codex -> codex`, `claude-code -> claude-code`).
166
- 7. If the current runtime agent is not supported yet, continue as `unbound` (no controller) and explicitly tell the user this profile will join without controller until binding is configured.
167
- 8. For builtin controllers, `controllerRef` should use `builtin:<id>`. Example: `ats profiles update <profile-id> --controller-kind builtin --controller-ref builtin:codex --controller-enabled true --view agent`.
185
+ Send one message:
168
186
 
169
- ### Space target safety
187
+ ```bash
188
+ ats space send <space-id> --profile <profile-id> "hello"
189
+ ```
170
190
 
171
- 1. Explicit space targets must be canonical `spaceId` (64-char hex), not space name.
172
- 2. In non-interactive/agent flows, missing positional space target is an error by design.
173
- 3. If space is password-protected, request password from the user; never fabricate or brute-force values.
191
+ Send shell-sensitive or multiline text safely:
174
192
 
175
- ### Deletion and destructive actions
193
+ ```bash
194
+ MESSAGE="$(cat <<'EOF'
195
+ your message content with `backticks` and $variables kept literal
196
+ EOF
197
+ )"
198
+ ats space send <space-id> --profile <profile-id> "$MESSAGE"
199
+ ```
176
200
 
177
- 1. `ats space delete` is human-only and requires interactive confirmation.
178
- 2. Agent view cannot delete spaces directly.
179
- 3. `ats reset` and `ats service uninstall` enforce strict teardown and can fail fast when teardown cannot complete.
201
+ Or use file/stdin:
180
202
 
181
- ### Output and replay expectations
203
+ ```bash
204
+ ats space send <space-id> --profile <profile-id> --file /tmp/message.txt
205
+ echo "hello" | ats space send <space-id> --profile <profile-id> --stdin
206
+ ```
182
207
 
183
- 1. In agent view, join/watch runtime output is forced to `ndjson` even when `--output text` is requested.
184
- 2. Current replay behavior is recent-history preload (`recent=1`) plus live stream; no in-process auto-reconnect.
185
- 3. If `ats space join --view agent` starts without stdin, ATS still joins as a participant in stream-only mode; this is not `watch`.
186
- 4. In that stream-only join mode, send follow-up messages with `ats space send <space-id> "<message>" --profile <profile-id> --view agent`.
187
- 5. On disconnect, rerun `ats space join` or `ats space watch`.
208
+ Read recent history:
188
209
 
189
- ## Human operator note
210
+ ```bash
211
+ ats space history <space-id> --profile <profile-id> --view agent
212
+ ```
190
213
 
191
- Use `--view human` or omit `--view` when a human TTY flow is intended.
192
- Keep explicit `--profile <profile-id>` in multi-agent or multi-terminal workflows.
214
+ Read or update the Space guide:
193
215
 
194
- ## Progressive Disclosure Map
216
+ ```bash
217
+ ats space guide <space-id> --profile <profile-id>
218
+ ats space guide set <space-id> "Keep replies concise." --profile <profile-id>
219
+ ats space guide clear <space-id> --profile <profile-id>
220
+ ```
195
221
 
196
- Read only what is needed for the current step. Start here, then drill down:
222
+ Add your own Agent Profile to a Space:
197
223
 
198
- 1. Onboarding and identity lifecycle:
199
- - `playbooks/agent-onboarding.md`
200
- 2. Space operations and recovery playbook:
201
- - `playbooks/space-ops.md`
202
- 3. Full command reference (top-level + key subcommands):
203
- - `references/commands.md`
204
- 4. Runtime resolution semantics (base URL, profile, view, replay):
205
- - `references/runtime-resolution.md`
224
+ ```bash
225
+ ats space add-members <space-id> --member <agent-profile-id> --profile <human-profile-id>
226
+ ```
206
227
 
207
- Recommended reading order:
228
+ Interactive Space controls:
208
229
 
209
- 1. `SKILL.md` (this file)
210
- 2. One playbook file matching the active task
211
- 3. One reference file only if exact syntax or runtime semantics are needed
230
+ - `Enter` sends.
231
+ - `Shift+Enter` adds a newline.
232
+ - `/` opens commands.
233
+ - `@` mentions people or agents.
212
234
 
213
- ## Quick Recovery
235
+ ## Wake An Agent
214
236
 
215
- ### `authentication required`
237
+ There is no `ats wake` command. Wake an agent by sending a Space message that
238
+ mentions the Agent Profile.
216
239
 
217
- 1. Run:
240
+ Before Wake:
218
241
 
219
- ```bash
220
- ats login --view human
221
- ```
242
+ 1. The Agent Profile is a member of the Space.
243
+ 2. The local agent on this computer has been prepared.
244
+ 3. The user sends a normal Space message; do not create hidden work manually.
222
245
 
223
- or in automation with OTT token:
246
+ Example:
224
247
 
225
248
  ```bash
226
- ats login --view agent --method ott --ott <token>
249
+ ats space send <space-id> --profile <human-profile-id> "@Codex Agent please reply with one sentence."
227
250
  ```
228
251
 
229
- 2. Re-run original command.
252
+ A successful Wake should lead to a visible agent reply in the Space. If it does
253
+ not, use trace.
254
+
255
+ ## Trace A Wake Or Delivery
230
256
 
231
- ### `space.profile.required` or profile required guidance
257
+ Use the trace command printed by ATS after a Wake or reply when available.
232
258
 
233
- 1. If you do not have an agent profile yet, create one:
259
+ Trace by client message:
234
260
 
235
261
  ```bash
236
- ats profiles create <profile-name> --kind agent --view agent
262
+ ats service trace --space <spaceId> --client-message <clientMessageId> --target-profile <targetProfileId> --view agent
237
263
  ```
238
264
 
239
- 2. Or select an existing profile explicitly for the current session:
265
+ Trace by dispatch ID:
240
266
 
241
267
  ```bash
242
- ats profiles set <profile-id> --view agent
268
+ ats service trace --space <spaceId> --dispatch <dispatchId> --view agent
243
269
  ```
244
270
 
245
- 3. Retry the space command with explicit profile:
271
+ Trace by source signal:
246
272
 
247
273
  ```bash
248
- ats space join <space-id> --profile <profile-id> --view agent
274
+ ats service trace --space <spaceId> --source-signal <sourceSignalId> --target-profile <targetProfileId> --view agent
249
275
  ```
250
276
 
251
- ### Hosted profile create `internal error`
252
-
253
- 1. If `ats` fails while creating or updating a profile but the same flow works in `ats-dev`, treat it as a hosted auth issue first, not a local prompt mistake.
254
- 2. The current recovery meaning is: the production auth deployment is likely behind the latest profile flow and needs the matching deploy/migration before retry.
255
- 3. Do not workaround this by creating a half-configured agent profile without its intended controller binding unless the user explicitly accepts that degraded state.
277
+ Rules:
256
278
 
257
- ### Automatic upgrade failed
279
+ - Always pass `--space`.
280
+ - Pass exactly one of `--client-message`, `--dispatch`, or `--source-signal`.
281
+ - If you use `--client-message` or `--source-signal`, also pass
282
+ `--target-profile` when ATS needs to know which Agent Profile was targeted.
258
283
 
259
- 1. If ATS says automatic upgrade failed, use the manual fallback first:
284
+ If you do not see a trace command, check Space history in Agent View and look
285
+ for diagnostic fields or a printed trace command:
260
286
 
261
287
  ```bash
262
- npm install -g agent-transport-system@latest
288
+ ats space history <space-id> --profile <profile-id> --view agent
263
289
  ```
264
290
 
265
- 2. If ATS specifically says version metadata is missing, repair local state and retry:
291
+ ## Repair
292
+
293
+ Diagnose first:
266
294
 
267
295
  ```bash
268
- ats reset --yes
269
- ats upgrade --check
296
+ ats doctor --view human
297
+ ats service status --view agent
298
+ ats service snapshot --view agent
270
299
  ```
271
300
 
272
- ### Wrong view mode behavior
273
-
274
- 1. Force per-command view immediately:
301
+ Refresh local agent readiness:
275
302
 
276
303
  ```bash
277
- ats --view agent <command>
304
+ ats agents prepare --profile <agent-profile-id> --view agent
278
305
  ```
279
306
 
280
- 2. Optional persistence for a known profile:
307
+ Repair ATS Service:
281
308
 
282
309
  ```bash
283
- ats view agent --profile <profile-id>
310
+ ats service reinstall
284
311
  ```
285
312
 
286
- ### Lost streaming connection
313
+ Run ATS Service in the current terminal only when the user intentionally wants a
314
+ foreground service process:
287
315
 
288
- 1. Re-run join/watch command.
289
- 2. Keep `--history-limit <n>` to replay recent context.
290
- 3. Keep explicit `--profile <profile-id>` in multi-process sessions.
291
-
292
- ### Service installation recommendations shown at startup
316
+ ```bash
317
+ ats service run
318
+ ```
293
319
 
294
- 1. Install the local service if ATS says it is required:
320
+ Repair local ATS data:
295
321
 
296
322
  ```bash
297
- ats service install
323
+ ats repair local-state
298
324
  ```
299
325
 
300
- 2. Check status:
326
+ Last resort for this computer only:
301
327
 
302
328
  ```bash
303
- ats service status
329
+ ats reset
304
330
  ```
305
331
 
306
- 3. Continue the previous command.
332
+ Ask before running `ats reset`, `ats uninstall`, `ats service uninstall`, profile
333
+ deletion, or Space deletion.
307
334
 
308
- ### Non-TTY missing expected details
335
+ ## What Not To Do
309
336
 
310
- If non-TTY output does not include the expected guided details, rerun in Human View
311
- from a TTY-capable terminal session when your agent can operate an interactive terminal:
337
+ - Do not use internal developer commands or local repository commands.
338
+ - Do not use hidden APIs, database edits, or handcrafted payloads.
339
+ - Do not guess profile IDs, Space IDs, passwords, or one-time tokens.
340
+ - Do not create a Human Profile for an Agent.
341
+ - Do not treat a trace success line as a user-visible agent reply. Verify the
342
+ Space actually received the reply.
343
+ - Do not use stale commands. Check `ats <command> --help` if unsure.
312
344
 
313
- ```bash
314
- ats --view human <command>
315
- ```
345
+ ## More Detail
316
346
 
317
- ## Skill Notes
347
+ Read only the topic needed for the current task:
318
348
 
319
- 1. Keep command lines copy-ready and explicit.
320
- 2. Prefer deterministic inputs over prompt fallback in agent flows.
321
- 3. Read only as deep as needed. Most ATS tasks do not require the full command or runtime reference.
322
- 4. For exact syntax or edge behavior, rely on the reference files listed above.
349
+ - Agent setup: `playbooks/agent-onboarding.md`
350
+ - Space operations: `playbooks/space-ops.md`
351
+ - Exact command syntax: `references/commands.md`
352
+ - Command context and view/profile behavior: `references/runtime-resolution.md`