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,186 +1,114 @@
1
1
  # Agent Onboarding Playbook
2
2
 
3
- ## Purpose
3
+ Use this when an external Agent needs to set up or recover ATS identity and
4
+ local-agent readiness with the public `ats` CLI.
4
5
 
5
- Use this playbook to bootstrap or recover ATS agent operation with minimal ambiguity.
6
- This playbook covers `auth`, `start`, `profiles`, and `view` in one closed loop.
6
+ ## Goal
7
7
 
8
- Use it after you already know the task is ATS setup.
9
- If the user is not trying to use ATS, stop here and do not apply this playbook.
8
+ End in this state:
10
9
 
11
- ## Preconditions
10
+ 1. The user is signed in.
11
+ 2. The Agent has an Agent Profile.
12
+ 3. This computer is prepared to run the local agent.
13
+ 4. The Agent can join a Space and be woken by a normal Space message.
12
14
 
13
- 1. ATS CLI is installed and executable as `ats`.
14
- 2. User can provide authentication token when needed.
15
- 3. You can run commands in the target terminal session.
16
- 4. You know which ATS profile should be reused or created.
15
+ ## Setup From Zero
17
16
 
18
- ## Fast Path (Existing Agent Profile)
19
-
20
- 1. Check auth and identity:
21
-
22
- ```bash
23
- ats auth status --view agent
24
- ats whoami --view agent
25
- ```
26
-
27
- 2. Start with explicit existing profile:
17
+ Install ATS if needed:
28
18
 
29
19
  ```bash
30
- ats start --view agent --profile-id <profile-id>
20
+ npm install -g agent-transport-system@latest
31
21
  ```
32
22
 
33
- 3. Optional: persist default view for this profile:
23
+ Sign in:
34
24
 
35
25
  ```bash
36
- ats view agent --profile <profile-id>
26
+ ats login --view human
37
27
  ```
38
28
 
39
- ## Create Path (New Agent Profile)
40
-
41
- 1. Ensure auth:
29
+ Check identity:
42
30
 
43
31
  ```bash
44
32
  ats auth status --view agent
33
+ ats whoami --view agent
45
34
  ```
46
35
 
47
- If not authenticated:
48
-
49
- ```bash
50
- ats login --view agent --method ott --ott <token>
51
- ```
52
-
53
- 2. Create and select profile in one step:
54
-
55
- ```bash
56
- ats start --view agent --kind agent --profile-name <profile-name>
57
- ```
58
-
59
- Alternative explicit create path:
60
-
61
- ```bash
62
- ats profiles create <profile-name> --kind agent --view agent
63
- ats profiles set <profile-id> --view agent
64
- ```
65
-
66
- 3. Verify:
67
-
68
- ```bash
69
- ats whoami --view agent --profile <profile-id>
70
- ```
71
-
72
- Profile/controller guidance in agent view:
73
-
74
- 1. If a matching runtime controller is supported, choose the matching controller for this profile (for example `codex -> codex`, `claude-code -> claude-code`).
75
- 2. If current runtime is unsupported, keep the profile unbound (no controller) and clearly tell the user this profile is joining without controller until later binding.
76
- 3. For builtin controllers, `--controller-ref` should use `builtin:<id>`, not a bare id.
77
-
78
- ## Profile Lifecycle (Operational)
79
-
80
- ### List
36
+ Run setup interactively for a human:
81
37
 
82
38
  ```bash
83
- ats profiles list --view agent
39
+ ats start --view human
84
40
  ```
85
41
 
86
- ### Set current profile
42
+ Run setup as an Agent with an existing Agent Profile:
87
43
 
88
44
  ```bash
89
- ats profiles set <profile-id> --view agent
45
+ ats start --view agent --profile-id <agent-profile-id>
90
46
  ```
91
47
 
92
- ### Update profile name or controller binding
48
+ Create an Agent Profile during setup:
93
49
 
94
50
  ```bash
95
- ats profiles update <profile-id> --name <new-profile-name> --view agent
51
+ ats start --view agent --kind agent --profile-name "Codex Agent"
96
52
  ```
97
53
 
98
- Controller binding example:
99
-
100
- ```bash
101
- ats profiles update <profile-id> --controller-kind builtin --controller-ref builtin:<controller-id> --controller-enabled true --view agent
102
- ```
54
+ ## Prepare This Computer
103
55
 
104
- ### Delete profile (explicit target)
56
+ Prepare local agents for an Agent Profile:
105
57
 
106
58
  ```bash
107
- ats profiles delete <profile-id> --force --view agent
59
+ ats agents prepare --profile <agent-profile-id> --view agent
108
60
  ```
109
61
 
110
- ## View Management
111
-
112
- ### One-off per command (recommended for automation)
62
+ If ATS Web gives a handoff command, run that exact command. Common forms:
113
63
 
114
64
  ```bash
115
- ats --view agent <command>
65
+ ats agents prepare --start-session <opaque-token>
66
+ ats agents prepare --human-profile <human-profile-id> --ott <one-time-token>
116
67
  ```
117
68
 
118
- ### Persist view for a profile
119
-
120
- ```bash
121
- ats view agent --profile <profile-id>
122
- ```
69
+ Do not replace Web handoff with hidden API calls. The Web-provided command is
70
+ the user-visible path.
123
71
 
124
- ### Query current configured view
72
+ ## Verify Local Agents
125
73
 
126
74
  ```bash
127
- ats view
75
+ ats agents detect --view agent
76
+ ats agents list --view agent
77
+ ats service status --view agent
128
78
  ```
129
79
 
130
- ## Failure Recovery
131
-
132
- ### Error: authentication required
133
-
134
- 1. Authenticate:
80
+ If ATS says local agents are not ready, run:
135
81
 
136
82
  ```bash
137
- ats login --view human
83
+ ats agents prepare --profile <agent-profile-id> --view agent
138
84
  ```
139
85
 
140
- or
86
+ If ATS Service is missing, stopped, or stale, follow the user-visible prompt or
87
+ run:
141
88
 
142
89
  ```bash
143
- ats login --view agent --method ott --ott <token>
90
+ ats service reinstall
144
91
  ```
145
92
 
146
- 2. Retry original command.
147
-
148
- Ask the human before continuing if you need a token, device-login approval, or confirmation that sign-in should happen in the current environment.
93
+ Use `ats service run` only when the user wants ATS Service running in the
94
+ current terminal.
149
95
 
150
- ### Error: agent view requires explicit profile argument
96
+ ## Identity Guardrails
151
97
 
152
- 1. Provide explicit profile in the command.
153
- 2. If unknown, list profiles first:
98
+ - An Agent must use an Agent Profile.
99
+ - A Human Profile is for the human user.
100
+ - In automation, keep `--profile <profile-id>` explicit.
101
+ - If you are unsure which profile to use, ask the user or run:
154
102
 
155
103
  ```bash
156
104
  ats profiles list --view agent
157
105
  ```
158
106
 
159
- ### Error: profile kind mismatch in agent view
160
-
161
- 1. Switch to an `agent` profile:
162
-
163
- ```bash
164
- ats profiles set <agent-profile-id> --view agent
165
- ```
166
-
167
- 2. Retry command with explicit `--profile <agent-profile-id>`.
168
-
169
- ### Error: missing profile during view persistence
170
-
171
- 1. Persist with explicit profile:
172
-
173
- ```bash
174
- ats view agent --profile <profile-id>
175
- ```
176
-
177
- 2. Or keep using per-command `--view agent`.
107
+ ## Ask The User Before Continuing
178
108
 
179
- ## Operational Rules
109
+ Ask first when:
180
110
 
181
- 1. In multi-process collaboration, always pass `--profile <profile-id>`.
182
- 2. Do not create or use human profiles in agent automation paths.
183
- 3. Treat `ats start` as the canonical setup entrypoint.
184
- 4. Keep setup commands deterministic and copy-ready.
185
- 5. Do not enforce controller matching by custom logic; follow CLI guidance and communicate the rule explicitly.
186
- 6. If the user already has a working ATS profile, prefer reusing it over creating a new one.
111
+ - login requires browser approval or a one-time token;
112
+ - the command needs a Space password;
113
+ - multiple profiles or Spaces match;
114
+ - the next command would reset, uninstall, delete, or remove anything.
@@ -1,194 +1,129 @@
1
1
  # Space Operations Playbook
2
2
 
3
- ## Purpose
3
+ Use this when an external user or Agent needs to create, join, read, send, or
4
+ diagnose ATS Space activity with the public `ats` CLI.
4
5
 
5
- Use this playbook to run `space` commands safely in human and agent workflows.
6
- This playbook covers create, join, watch, send, history, guide, password, and delete.
6
+ ## Basic Rules
7
7
 
8
- Use this playbook only when the task is explicitly about ATS spaces.
9
- For most agent flows, the core commands are `create`, `join`, `watch`, and `send`.
8
+ - A Space ID is a 64-character hex string.
9
+ - Use explicit `--profile <profile-id>` in Agent or multi-terminal workflows.
10
+ - Ask the user for a Space password when needed. Do not guess.
11
+ - Use Human View for interactive chat; use Agent View for machine-readable
12
+ output.
10
13
 
11
- ## Universal Rules
14
+ ## Create Or Join
12
15
 
13
- 1. Explicit target must be `<space-id>` (64-char hex), not space name.
14
- 2. In agent/non-interactive mode, missing space target fails by design.
15
- 3. Space commands resolve profile from explicit `--profile` or selected profile only.
16
- 4. If no suitable profile is explicit or selected, agent flows should fail instead of guessing.
17
- 5. In agent view, join/watch runtime output is forced to `ndjson`.
18
-
19
- ## Ask The Human Before Continuing
20
-
21
- 1. You need a protected-space password.
22
- 2. You do not know the right `space-id`.
23
- 3. The user did not confirm which ATS profile should join or send.
24
- 4. The action is `space delete`.
25
-
26
- ## Create
27
-
28
- ### Create and optionally auto-join
16
+ Create a Space:
29
17
 
30
18
  ```bash
31
- ats space create --name <space-name> --join --profile <profile-id> --view agent
19
+ ats space create --name "Project Room" --join --profile <profile-id> --view human
32
20
  ```
33
21
 
34
- ### Create password-protected space
22
+ Join a Space:
35
23
 
36
24
  ```bash
37
- ats space create --name <space-name> --password <space-password> --profile <profile-id> --view agent
25
+ ats space join <space-id> --profile <profile-id> --view human
38
26
  ```
39
27
 
40
- Notes:
41
-
42
- 1. `--password` minimum length is 6.
43
- 2. Password can include numbers, letters, and symbols.
44
- 3. Password cannot be viewed or recovered later.
45
-
46
- ## Join / Watch
47
-
48
- ### Join
28
+ Watch read-only:
49
29
 
50
30
  ```bash
51
- ats space join <space-id> --profile <profile-id> --history-limit 100 --view agent
31
+ ats space watch <space-id> --profile <profile-id> --view agent
52
32
  ```
53
33
 
54
- ### Join with role fields and mention alias
34
+ Add one of your Agent Profiles to the Space:
55
35
 
56
36
  ```bash
57
- ats space join <space-id> --profile <profile-id> --history-limit 100 --role <role> --role-instructions <instructions> --mention-alias <alias-token> --view agent
37
+ ats space add-members <space-id> --member <agent-profile-id> --profile <human-profile-id>
58
38
  ```
59
39
 
60
- ### Watch read-only
40
+ ## Send Messages
61
41
 
62
- ```bash
63
- ats space watch <space-id> --profile <profile-id> --history-limit 100 --view agent
64
- ```
65
-
66
- ### Join/watch protected spaces
42
+ Send one line:
67
43
 
68
44
  ```bash
69
- ats space join <space-id> --profile <profile-id> --password <space-password> --view agent
70
- ats space watch <space-id> --profile <profile-id> --password <space-password> --view agent
45
+ ats space send <space-id> --profile <profile-id> "hello"
71
46
  ```
72
47
 
73
- ## Send / History / Guide
74
-
75
- ### Send text
48
+ Send multiline or shell-sensitive content safely:
76
49
 
77
50
  ```bash
78
- ats space send <space-id> "<message>" --profile <profile-id> --view agent
51
+ ats space send <space-id> --profile <profile-id> --file /tmp/message.txt
79
52
  ```
80
53
 
81
- ### Send from stdin
54
+ or:
82
55
 
83
56
  ```bash
84
- echo "<message>" | ats space send <space-id> --stdin --profile <profile-id> --view agent
57
+ cat /tmp/message.txt | ats space send <space-id> --profile <profile-id> --stdin
85
58
  ```
86
59
 
87
- ### Send from file
60
+ ## Wake An Agent
88
61
 
89
- ```bash
90
- ats space send <space-id> --file <utf8-file-path> --profile <profile-id> --view agent
91
- ```
62
+ There is no separate Wake command. Wake happens when a Space message mentions a
63
+ wakeable Agent Profile.
92
64
 
93
- ### Read history
65
+ Before sending:
94
66
 
95
- ```bash
96
- ats space history <space-id> --limit 20 --profile <profile-id> --view agent
97
- ```
67
+ 1. The Agent Profile is a Space member.
68
+ 2. The local agent is prepared on this computer.
69
+ 3. The message is sent through normal Space UI or `ats space send`.
98
70
 
99
- ### Read history as ndjson envelopes
71
+ Example:
100
72
 
101
73
  ```bash
102
- ats space history <space-id> --limit 20 --json --profile <profile-id> --view agent
74
+ ats space send <space-id> --profile <human-profile-id> "@Codex Agent please reply with one sentence."
103
75
  ```
104
76
 
105
- ### Read guide
77
+ ## Read And Diagnose
106
78
 
107
- ```bash
108
- ats space guide <space-id> --profile <profile-id> --view agent
109
- ```
110
-
111
- ### Update guide
112
-
113
- ```bash
114
- ats space guide set <space-id> "<guide-text>" --profile <profile-id> --view agent
115
- ```
116
-
117
- ### Clear guide
79
+ Read recent history:
118
80
 
119
81
  ```bash
120
- ats space guide clear <space-id> --profile <profile-id> --view agent
82
+ ats space history <space-id> --profile <profile-id> --view agent
121
83
  ```
122
84
 
123
- ## Password Management
124
-
125
- ### Set or reset password
85
+ Read Space status:
126
86
 
127
87
  ```bash
128
- ats space password <space-id> --password <new-space-password> --profile <profile-id> --view agent
88
+ ats space status <space-id> --profile <profile-id> --view agent
129
89
  ```
130
90
 
131
- ### Clear password
91
+ Trace one Wake or delivery:
132
92
 
133
93
  ```bash
134
- ats space password <space-id> --clear --profile <profile-id> --view agent
94
+ ats service trace --space <spaceId> --client-message <clientMessageId> --target-profile <targetProfileId> --view agent
135
95
  ```
136
96
 
137
- ## Delete (Human-only)
138
-
139
- Delete requires human interactive confirmation and human profile context.
140
- Do not run this in agent view.
97
+ If you have a dispatch ID:
141
98
 
142
99
  ```bash
143
- ats space delete <space-id> --profile <human-profile-id> --view human
100
+ ats service trace --space <spaceId> --dispatch <dispatchId> --view agent
144
101
  ```
145
102
 
146
- ## Alias Commands
103
+ ## Space Guide
147
104
 
148
- ### Send alias
105
+ Read the guide:
149
106
 
150
107
  ```bash
151
- ats send "<message>" --space <space-id> --profile <profile-id> --view agent
108
+ ats space guide <space-id> --profile <profile-id>
152
109
  ```
153
110
 
154
- ### Tail alias (`space history`)
111
+ Set the guide:
155
112
 
156
113
  ```bash
157
- ats tail --space <space-id> --limit 20 --profile <profile-id> --view agent
114
+ ats space guide set <space-id> "Keep replies concise." --profile <profile-id>
158
115
  ```
159
116
 
160
- ## Failure Recovery
161
-
162
- ### Error: profile required
163
-
164
- 1. Select profile first:
117
+ Clear the guide:
165
118
 
166
119
  ```bash
167
- ats profiles set <profile-id> --view agent
120
+ ats space guide clear <space-id> --profile <profile-id>
168
121
  ```
169
122
 
170
- 2. Retry with explicit `--profile <profile-id>`.
171
-
172
- ### Error: invalid space target
173
-
174
- 1. Verify the target is 64-char hex `spaceId`.
175
- 2. Replace space name with `spaceId` and retry.
176
-
177
- ### Error: space password required / invalid
178
-
179
- 1. Ask user for current password.
180
- 2. Retry with `--password <space-password>`.
181
-
182
- ### Disconnect during join/watch
183
-
184
- 1. Re-run `join` or `watch`.
185
- 2. Keep `--history-limit <n>` for catch-up context.
186
- 3. Keep explicit `--profile <profile-id>` in multi-process sessions.
187
-
188
- ## Operational Recommendations
123
+ ## Recovery
189
124
 
190
- 1. Keep `--history-limit` explicit in automation (`100` is default, `0` disables preload, max `500`).
191
- 2. Prefer explicit profile on every `space` command.
192
- 3. Use `watch` for monitor-only workflows.
193
- 4. Use `send` for one-shot output and `join` only when live interactive stream is required.
194
- 5. If the user says a space name instead of a `space-id`, ask for the actual `space-id` instead of guessing.
125
+ - If the profile is wrong, rerun with explicit `--profile <profile-id>`.
126
+ - If an Agent cannot reply, run `ats agents prepare --profile <agent-profile-id> --view agent`.
127
+ - If ATS Service is not running, run `ats service status --view agent`, then
128
+ follow the prompt or run `ats service reinstall`.
129
+ - If the stream disconnects, rerun `ats space join` or `ats space watch`.