teamclaws 2.0.8 → 2.0.10
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 +25 -4
- package/dist/broker.js +1 -1
- package/dist/constants.js +1 -1
- package/dist/output.js +30 -0
- package/dist/pairing.js +9 -5
- package/dist/validation.js +20 -2
- package/package.json +1 -1
- package/skills/teamclaws-login/SKILL.md +3 -2
- package/skills/teamclaws-onboard/SKILL.md +3 -1
- package/skills/teamclaws-pair/SKILL.md +7 -5
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
|
|
@@ -119,7 +124,7 @@ request. Test a required-yield environment separately if automatic wakeup is
|
|
|
119
124
|
used. Local CLI tests establish process behavior, not automatic loading or
|
|
120
125
|
compliance in every agent environment.
|
|
121
126
|
|
|
122
|
-
`servers list` requests `GET /api/cli/v1/servers/?include_inventory=1&include_description=1&include_editable_metadata=1`. Updated
|
|
127
|
+
`servers list` requests `GET /api/cli/v1/servers/?include_inventory=1&include_description=1&include_editable_metadata=1&include_subscription=1`. Updated
|
|
123
128
|
brokers return `servers` and `workspace_count`: the count of all non-deleted
|
|
124
129
|
owned and eligible shared workspaces, including those without a hostname yet.
|
|
125
130
|
Individual server entries retain aliases, stable IDs, status and `pairing_ready`.
|
|
@@ -130,6 +135,21 @@ fallback display name) and `can_edit_metadata`. Older brokers may omit these.
|
|
|
130
135
|
Older brokers may omit the count; the CLI reports it as null and never infers
|
|
131
136
|
an empty account from an empty filtered list.
|
|
132
137
|
|
|
138
|
+
Subscription inventory (2026-11-04) adds optional `tier_name`, `is_free`, and
|
|
139
|
+
`free_expires_at` fields. Null values mean no subscription information or no
|
|
140
|
+
free expiration deadline, as applicable. The CLI displays the tier and free
|
|
141
|
+
deadline and starts warning seven days before free access expires, including
|
|
142
|
+
an expired warning at or after the deadline. JSON `servers_list` events include
|
|
143
|
+
the subscription fields and a `warnings` array with server ID, warning code,
|
|
144
|
+
deadline, and message. Warnings are evaluated when inventory is displayed;
|
|
145
|
+
there is no background polling.
|
|
146
|
+
|
|
147
|
+
`include_subscription=1` preserves compatibility with older clients whose list
|
|
148
|
+
validators reject extra fields. This compatibility opt-in can be retired when
|
|
149
|
+
support for those clients ends. This CLI accepts older responses without the
|
|
150
|
+
subscription fields and ignores unknown inventory and server-entry fields,
|
|
151
|
+
while continuing to validate every recognized field it consumes.
|
|
152
|
+
|
|
133
153
|
The `servers_list` event adds `workspace_count` and `discovery_state`:
|
|
134
154
|
`no_workspaces` only for a verified count of zero, `ready` when any listed
|
|
135
155
|
workspace is pairing-ready, `not_ready` when workspaces exist but none is ready,
|
|
@@ -281,7 +301,8 @@ to a specific request, so neither command checks for later conversation turns.
|
|
|
281
301
|
|
|
282
302
|
For authorized workspace administration, first check pairing status with
|
|
283
303
|
`teamclaws pair status <target> --json`. If `not_paired`, complete CLI login and pairing
|
|
284
|
-
|
|
304
|
+
for that workspace before using the shell, following browser approval only when
|
|
305
|
+
requested by the CLI. A linked AI provider or
|
|
285
306
|
TCChat conversation is not required for paired-shell access; remote chat is a
|
|
286
307
|
separate operation.
|
|
287
308
|
|
package/dist/broker.js
CHANGED
|
@@ -17,7 +17,7 @@ export class BrokerClient {
|
|
|
17
17
|
return normalizedDeviceName(this.deviceName());
|
|
18
18
|
}
|
|
19
19
|
async servers(signal) {
|
|
20
|
-
const url = `${API_BASE}servers/?include_inventory=1&include_description=1&include_editable_metadata=1`;
|
|
20
|
+
const url = `${API_BASE}servers/?include_inventory=1&include_description=1&include_editable_metadata=1&include_subscription=1`;
|
|
21
21
|
const response = await requestJson(this.fetcher, url, {
|
|
22
22
|
headers: await this.issuerHeaders("GET", url),
|
|
23
23
|
...(signal ? { signal } : {}),
|
package/dist/constants.js
CHANGED
package/dist/output.js
CHANGED
|
@@ -84,11 +84,33 @@ export class Output {
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
servers(servers, workspaceCount) {
|
|
87
|
+
const now = Date.now();
|
|
88
|
+
const warnings = servers.flatMap((server) => {
|
|
89
|
+
if (server.is_free !== true || !server.free_expires_at)
|
|
90
|
+
return [];
|
|
91
|
+
const remaining = Date.parse(server.free_expires_at) - now;
|
|
92
|
+
if (remaining > 7 * 24 * 60 * 60 * 1_000)
|
|
93
|
+
return [];
|
|
94
|
+
const expired = remaining <= 0;
|
|
95
|
+
return [
|
|
96
|
+
{
|
|
97
|
+
server_id: server.server_id,
|
|
98
|
+
code: expired
|
|
99
|
+
? "free_subscription_expired"
|
|
100
|
+
: "free_subscription_expiring",
|
|
101
|
+
free_expires_at: server.free_expires_at,
|
|
102
|
+
message: expired
|
|
103
|
+
? `Free access for ${server.alias} expired on ${server.free_expires_at}.`
|
|
104
|
+
: `Free access for ${server.alias} expires on ${server.free_expires_at} (within 7 days).`,
|
|
105
|
+
},
|
|
106
|
+
];
|
|
107
|
+
});
|
|
87
108
|
this.event({
|
|
88
109
|
schema_version: OUTPUT_SCHEMA_VERSION,
|
|
89
110
|
event: "servers_list",
|
|
90
111
|
status: "success",
|
|
91
112
|
servers,
|
|
113
|
+
warnings,
|
|
92
114
|
workspace_count: workspaceCount ?? null,
|
|
93
115
|
discovery_state: workspaceCount === 0
|
|
94
116
|
? "no_workspaces"
|
|
@@ -109,6 +131,14 @@ export class Output {
|
|
|
109
131
|
this.stdout.write(`${index + 1}. ${server.alias} — ${server.server_id} — ${server.workspace_url} — ${server.pairing_ready ? "ready to pair" : "not ready to pair"}\n`);
|
|
110
132
|
if (server.description)
|
|
111
133
|
this.stdout.write(` ${server.description}\n`);
|
|
134
|
+
if (server.tier_name)
|
|
135
|
+
this.stdout.write(` Tier: ${server.tier_name}\n`);
|
|
136
|
+
if (server.is_free === true) {
|
|
137
|
+
this.stdout.write(` Free access${server.free_expires_at ? `; expires ${server.free_expires_at}` : ""}\n`);
|
|
138
|
+
}
|
|
139
|
+
const warning = warnings.find((item) => item.server_id === server.server_id);
|
|
140
|
+
if (warning)
|
|
141
|
+
this.stdout.write(` Warning: ${warning.message}\n`);
|
|
112
142
|
});
|
|
113
143
|
}
|
|
114
144
|
}
|
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/dist/validation.js
CHANGED
|
@@ -342,7 +342,6 @@ export function parseServersResponse(value) {
|
|
|
342
342
|
exitCode: 9,
|
|
343
343
|
});
|
|
344
344
|
}
|
|
345
|
-
assertExactKeys(value, ["servers"], ["workspace_count"], "server list");
|
|
346
345
|
if (!Array.isArray(value.servers)) {
|
|
347
346
|
throw new TeamClawsError("invalid_response", "TeamClaws returned an invalid server list.", {
|
|
348
347
|
exitCode: 9,
|
|
@@ -359,7 +358,6 @@ export function parseServersResponse(value) {
|
|
|
359
358
|
exitCode: 9,
|
|
360
359
|
});
|
|
361
360
|
}
|
|
362
|
-
assertExactKeys(server, ["id", "alias", "workspace_url", "status", "pairing_ready"], ["description", "custom_alias", "can_edit_metadata"], "server");
|
|
363
361
|
if (typeof server.pairing_ready !== "boolean") {
|
|
364
362
|
throw new TeamClawsError("invalid_response", "TeamClaws returned an invalid server.", {
|
|
365
363
|
exitCode: 9,
|
|
@@ -376,8 +374,28 @@ export function parseServersResponse(value) {
|
|
|
376
374
|
typeof server.can_edit_metadata !== "boolean")) {
|
|
377
375
|
throw new TeamClawsError("invalid_response", "TeamClaws returned invalid server editing permissions.", { exitCode: 9 });
|
|
378
376
|
}
|
|
377
|
+
if (server.is_free !== undefined &&
|
|
378
|
+
server.is_free !== null &&
|
|
379
|
+
typeof server.is_free !== "boolean") {
|
|
380
|
+
throw new TeamClawsError("invalid_response", "TeamClaws returned an invalid free subscription status.", { exitCode: 9 });
|
|
381
|
+
}
|
|
379
382
|
return {
|
|
380
383
|
server_id: normalizeUuid(server.id),
|
|
384
|
+
...(server.tier_name !== undefined
|
|
385
|
+
? {
|
|
386
|
+
tier_name: server.tier_name === null
|
|
387
|
+
? null
|
|
388
|
+
: requireString(server.tier_name, "subscription tier", 200),
|
|
389
|
+
}
|
|
390
|
+
: {}),
|
|
391
|
+
...(server.is_free !== undefined ? { is_free: server.is_free } : {}),
|
|
392
|
+
...(server.free_expires_at !== undefined
|
|
393
|
+
? {
|
|
394
|
+
free_expires_at: server.free_expires_at === null
|
|
395
|
+
? null
|
|
396
|
+
: requireIsoDate(server.free_expires_at, "free subscription expiry"),
|
|
397
|
+
}
|
|
398
|
+
: {}),
|
|
381
399
|
alias: requireString(server.alias, "server alias", 200),
|
|
382
400
|
...(typeof server.description === "string"
|
|
383
401
|
? { description: server.description }
|
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
|
|