bluekiwi 0.3.7 → 0.3.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.
@@ -14,24 +14,41 @@ export async function acceptCommand(token, opts) {
14
14
  }
15
15
  const invite = (await validateRes.json());
16
16
  console.log(pc.green(`✓ Invited as ${invite.email} (${invite.role})`));
17
- const answers = opts.username && opts.password
18
- ? { username: opts.username, password: opts.password }
19
- : await prompts([
20
- { type: "text", name: "username", message: "Choose a username" },
21
- { type: "password", name: "password", message: "Set a password" },
22
- ]);
23
- console.log(pc.cyan("→ Creating account..."));
17
+ // If account already exists (e.g. signed up via web), only need password to re-link
18
+ const answers = invite.already_accepted
19
+ ? opts.password
20
+ ? { username: "", password: opts.password }
21
+ : await prompts([
22
+ {
23
+ type: "password",
24
+ name: "password",
25
+ message: "Enter your existing password to link this CLI",
26
+ },
27
+ ])
28
+ : opts.username && opts.password
29
+ ? { username: opts.username, password: opts.password }
30
+ : await prompts([
31
+ { type: "text", name: "username", message: "Choose a username" },
32
+ { type: "password", name: "password", message: "Set a password" },
33
+ ]);
34
+ console.log(pc.cyan(invite.already_accepted
35
+ ? "→ Linking account..."
36
+ : "→ Creating account..."));
24
37
  const acceptRes = await fetch(`${opts.server}/api/invites/accept/${token}`, {
25
38
  method: "POST",
26
39
  headers: { "Content-Type": "application/json" },
27
- body: JSON.stringify(answers),
40
+ body: JSON.stringify(invite.already_accepted
41
+ ? { password: answers.password }
42
+ : answers),
28
43
  });
29
44
  if (!acceptRes.ok) {
30
45
  console.error(pc.red(`Accept failed: ${await acceptRes.text()}`));
31
46
  process.exit(1);
32
47
  }
33
48
  const result = (await acceptRes.json());
34
- console.log(pc.green(`✓ Account created: ${result.user.username}`));
49
+ console.log(pc.green(invite.already_accepted
50
+ ? `✓ Linked to account: ${result.user.username}`
51
+ : `✓ Account created: ${result.user.username}`));
35
52
  const client = new BlueKiwiClient(opts.server, result.api_key);
36
53
  await client.request("GET", "/api/workflows");
37
54
  // Skip runtime installation in non-interactive (CI/script) mode
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bluekiwi",
3
- "version": "0.3.7",
3
+ "version": "0.3.9",
4
4
  "description": "BlueKiwi CLI — install MCP client and skills into your agent runtime",
5
5
  "license": "MIT",
6
6
  "repository": {