archbyte 0.2.0 → 0.2.1

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/bin/archbyte.js CHANGED
@@ -27,7 +27,7 @@ const program = new Command();
27
27
  program
28
28
  .name('archbyte')
29
29
  .description('ArchByte - See what agents build. As they build it.')
30
- .version('0.2.0')
30
+ .version('0.2.1')
31
31
  .addHelpText('after', `
32
32
  Quick start:
33
33
  $ archbyte login Sign in
package/dist/cli/auth.js CHANGED
@@ -51,8 +51,8 @@ export async function handleLogin(provider) {
51
51
  console.error(chalk.red(`Login failed: ${err instanceof Error ? err.message : "Unknown error"}`));
52
52
  console.log();
53
53
  console.log(chalk.gray("You can also log in manually:"));
54
- console.log(chalk.gray(` 1. Visit ${API_BASE.replace("api.", "")}/auth`));
55
- console.log(chalk.gray(" 2. Copy your token"));
54
+ console.log(chalk.gray(" 1. Visit https://archbyte.heartbyte.io"));
55
+ console.log(chalk.gray(" 2. Sign in and copy your token from the dashboard"));
56
56
  console.log(chalk.gray(" 3. Run: archbyte login --token <your-token>"));
57
57
  process.exit(1);
58
58
  }
@@ -326,7 +326,11 @@ function startOAuthFlow(provider = "github") {
326
326
  const server = http.createServer(async (req, res) => {
327
327
  const url = new URL(req.url ?? "/", `http://localhost:${CLI_CALLBACK_PORT}`);
328
328
  if (url.pathname === "/callback") {
329
- const token = url.searchParams.get("token");
329
+ // Extract token from raw query string, not URLSearchParams
330
+ // (URLSearchParams decodes '+' as space per x-www-form-urlencoded, corrupting JWT signatures)
331
+ const rawQuery = (req.url ?? "").split("?")[1] ?? "";
332
+ const tokenMatch = rawQuery.match(/(?:^|&)token=([^&]+)/);
333
+ const token = tokenMatch ? decodeURIComponent(tokenMatch[1]) : null;
330
334
  if (!token) {
331
335
  res.writeHead(400, { "Content-Type": "text/html" });
332
336
  res.end("<h1>Login failed</h1><p>No token received. Close this window and try again.</p>");
@@ -342,7 +346,8 @@ function startOAuthFlow(provider = "github") {
342
346
  headers: { Authorization: `Bearer ${token}` },
343
347
  });
344
348
  if (!meRes.ok) {
345
- reject(new Error("Failed to fetch user info"));
349
+ const errBody = await meRes.text().catch(() => "");
350
+ reject(new Error(`Failed to fetch user info (${meRes.status}: ${errBody})`));
346
351
  return;
347
352
  }
348
353
  const { user } = (await meRes.json());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "archbyte",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "ArchByte - See what agents build. As they build it.",
5
5
  "type": "module",
6
6
  "bin": {