teamclaws 2.0.8 → 2.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -55,12 +55,16 @@ the existing paired shell. Status-only requests do not start onboarding.
|
|
|
55
55
|
|
|
56
56
|
Before any browser authorization, the agent explains the process: sign this
|
|
57
57
|
computer's CLI into the user's TeamClaws account through the browser, choose a
|
|
58
|
-
workspace and
|
|
58
|
+
workspace and pair with that server, then choose useful
|
|
59
59
|
work and set up its environment on the server. It explains the purpose and access
|
|
60
60
|
of each approval before presenting a link, adapting to steps already completed.
|
|
61
61
|
The conversation starts with that context rather than an unexplained request to
|
|
62
62
|
click an authorization link.
|
|
63
63
|
|
|
64
|
+
Pairing completes automatically when TeamClawsDeploy confirms the account owns
|
|
65
|
+
the workspace or is a superuser in its access group. Browser approval is shown
|
|
66
|
+
only when the target reports that approval is pending.
|
|
67
|
+
|
|
64
68
|
Agents keep their turn and the original login/pairing process alive while the
|
|
65
69
|
user approves in the browser, monitor its output, and continue automatically
|
|
66
70
|
after terminal success. No "I approved" message is needed. An execution
|
|
@@ -89,7 +93,8 @@ Existing event names and schema version remain unchanged. The
|
|
|
89
93
|
login keeps running. Signed-out `auth_status` includes the non-executing
|
|
90
94
|
`login_command: "teamclaws login --json"`; status never starts device authorization.
|
|
91
95
|
|
|
92
|
-
`pairing_browser_required` supplies the safe approval
|
|
96
|
+
When approval is pending, `pairing_browser_required` supplies the safe approval
|
|
97
|
+
URL and public `user_code`. Automatic pairing emits no browser approval event.
|
|
93
98
|
Some hosts include a validated `agent_action` with the legacy type
|
|
94
99
|
`deliver_and_stop`. The agent displays its approval message and continues
|
|
95
100
|
monitoring the original process; that field does not end the agent's turn. The
|
|
@@ -281,7 +286,8 @@ to a specific request, so neither command checks for later conversation turns.
|
|
|
281
286
|
|
|
282
287
|
For authorized workspace administration, first check pairing status with
|
|
283
288
|
`teamclaws pair status <target> --json`. If `not_paired`, complete CLI login and pairing
|
|
284
|
-
|
|
289
|
+
for that workspace before using the shell, following browser approval only when
|
|
290
|
+
requested by the CLI. A linked AI provider or
|
|
285
291
|
TCChat conversation is not required for paired-shell access; remote chat is a
|
|
286
292
|
separate operation.
|
|
287
293
|
|
package/dist/constants.js
CHANGED
package/dist/pairing.js
CHANGED
|
@@ -76,12 +76,9 @@ export class PairingClient {
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
async complete(pending, deviceName, noOpen, signal) {
|
|
79
|
-
this.output.pairingBrowser(pending.verification_uri_complete, pending.user_code, pending.agent_action);
|
|
80
|
-
if (!noOpen)
|
|
81
|
-
await this.openBrowser(pending.verification_uri_complete);
|
|
82
79
|
let credential;
|
|
83
80
|
try {
|
|
84
|
-
credential = await this.poll(pending, signal);
|
|
81
|
+
credential = await this.poll(pending, noOpen, signal);
|
|
85
82
|
const grant = await this.authorization.requireGrant();
|
|
86
83
|
if (credential.pairing_id !== credential.device_id ||
|
|
87
84
|
credential.origin !== pending.target.origin ||
|
|
@@ -142,9 +139,10 @@ export class PairingClient {
|
|
|
142
139
|
void credential;
|
|
143
140
|
}
|
|
144
141
|
}
|
|
145
|
-
async poll(pending, signal) {
|
|
142
|
+
async poll(pending, noOpen, signal) {
|
|
146
143
|
const deadline = this.now() + pending.expires_in * 1_000;
|
|
147
144
|
let intervalSeconds = pending.interval;
|
|
145
|
+
let approvalShown = false;
|
|
148
146
|
const pollUrl = directTargetUrl(pending.target, pending.target.token_poll_path);
|
|
149
147
|
while (this.now() < deadline) {
|
|
150
148
|
if (signal?.aborted)
|
|
@@ -158,6 +156,12 @@ export class PairingClient {
|
|
|
158
156
|
if (response.status >= 200 && response.status < 300) {
|
|
159
157
|
if (response.status === 202) {
|
|
160
158
|
intervalSeconds = pendingInterval(response, intervalSeconds);
|
|
159
|
+
if (!approvalShown) {
|
|
160
|
+
this.output.pairingBrowser(pending.verification_uri_complete, pending.user_code, pending.agent_action);
|
|
161
|
+
approvalShown = true;
|
|
162
|
+
if (!noOpen)
|
|
163
|
+
await this.openBrowser(pending.verification_uri_complete);
|
|
164
|
+
}
|
|
161
165
|
await this.wait(intervalSeconds * 1_000, signal);
|
|
162
166
|
continue;
|
|
163
167
|
}
|
package/package.json
CHANGED
|
@@ -11,8 +11,9 @@ A status-only request runs only `teamclaws auth status --json` and stops.
|
|
|
11
11
|
|
|
12
12
|
Before starting browser login, explain that the user will sign this computer's
|
|
13
13
|
TeamClaws command-line client into their TeamClaws account through the browser.
|
|
14
|
-
This connects the client to their account; workspace selection and
|
|
15
|
-
|
|
14
|
+
This connects the client to their account; workspace selection and pairing come
|
|
15
|
+
next when they are connecting a workspace. Pairing may complete automatically;
|
|
16
|
+
show browser approval only if the CLI requests it. If onboarding
|
|
16
17
|
already explained the process, use a short transition into this step. Give the
|
|
17
18
|
approval link with that context, never as an unexplained authorization request.
|
|
18
19
|
|
|
@@ -22,7 +22,9 @@ user's work and any steps already completed:
|
|
|
22
22
|
1. First, we'll sign this computer into your TeamClaws account using your browser.
|
|
23
23
|
This lets the TeamClaws command-line client here connect to your account.
|
|
24
24
|
2. Next, you'll choose a workspace, and we'll pair this computer with that server.
|
|
25
|
-
|
|
25
|
+
Pairing completes automatically when TeamClawsDeploy confirms you own the
|
|
26
|
+
workspace or are a superuser in its access group. Follow browser approval
|
|
27
|
+
only if the CLI requests it. Pairing gives this computer
|
|
26
28
|
access to run commands and work with files on the workspace.
|
|
27
29
|
3. Then we'll find the best work to move there and set up a clean environment for
|
|
28
30
|
it, separate from your laptop. That could be a complete job, an agent, a service
|
|
@@ -56,7 +56,7 @@ teamclaws pair <stable-server-identifier> --json
|
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
Use `--no-open` only when automatic browser opening is undesirable. The
|
|
59
|
-
`pairing_browser_required` event
|
|
59
|
+
`pairing_browser_required` event provides the safe approval address when approval is needed.
|
|
60
60
|
|
|
61
61
|
When no selected stable identifier is known, run `teamclaws servers list --json`,
|
|
62
62
|
show each server's display name (`alias`), returned `description`, and readiness,
|
|
@@ -71,11 +71,13 @@ workspaces; use the onboarding skill's discovery rules.
|
|
|
71
71
|
|
|
72
72
|
## Wait for approval and continue automatically
|
|
73
73
|
|
|
74
|
-
Before starting the command, explain that
|
|
75
|
-
|
|
74
|
+
Before starting the command, explain that pairing connects this computer with
|
|
75
|
+
the selected workspace. TeamClawsDeploy authorizes automatic pairing for its
|
|
76
|
+
owner or a superuser in the workspace's access group. Follow browser approval
|
|
77
|
+
only if the CLI requests it. Name that workspace and explain that the
|
|
76
78
|
connection gives this computer access to run commands and work with its files.
|
|
77
79
|
Connect the step to the user's intended work, and say you'll keep waiting and
|
|
78
|
-
continue automatically after
|
|
80
|
+
continue automatically after pairing. Use a short transition if onboarding
|
|
79
81
|
already introduced the process; the approval link should never arrive without
|
|
80
82
|
an explanation of what the user is authorizing.
|
|
81
83
|
|
|
@@ -145,7 +147,7 @@ teamclaws pair status <stable-server-identifier-or-canonical-workspace-address>
|
|
|
145
147
|
```
|
|
146
148
|
|
|
147
149
|
If it reports `not_paired`, follow the login and pairing flow above for that
|
|
148
|
-
selected workspace;
|
|
150
|
+
selected workspace; follow browser approval only if `pairing_browser_required` is emitted. Do not use
|
|
149
151
|
another workspace's pairing or bypass approval. After `paired` is verified,
|
|
150
152
|
authorized host commands can use the existing paired shell:
|
|
151
153
|
|