@boxcrew/cli 0.1.0 → 0.1.2

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.
Files changed (2) hide show
  1. package/dist/index.js +9 -13
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -65,23 +65,19 @@ async function browserLogin(frontendUrl) {
65
65
  return new Promise((resolve, reject) => {
66
66
  const server = createServer((req, res) => {
67
67
  const url = new URL(req.url || "/", `http://localhost`);
68
+ res.setHeader("Access-Control-Allow-Origin", "*");
69
+ res.setHeader("Access-Control-Allow-Methods", "GET, OPTIONS");
70
+ if (req.method === "OPTIONS") {
71
+ res.writeHead(204);
72
+ res.end();
73
+ return;
74
+ }
68
75
  if (url.pathname === "/callback") {
69
76
  const key = url.searchParams.get("key");
70
77
  if (key && key.startsWith("bxk_")) {
71
78
  config.set("apiKey", key);
72
- res.writeHead(200, { "Content-Type": "text/html" });
73
- res.end(`
74
- <!DOCTYPE html>
75
- <html>
76
- <head><title>BoxCrew CLI</title></head>
77
- <body style="font-family: system-ui, sans-serif; display: flex; justify-content: center; align-items: center; min-height: 100vh; margin: 0; background: #0a0a0a; color: #fafafa;">
78
- <div style="text-align: center;">
79
- <h2>Authenticated!</h2>
80
- <p>You can close this tab and return to your terminal.</p>
81
- </div>
82
- </body>
83
- </html>
84
- `);
79
+ res.writeHead(200, { "Content-Type": "text/plain" });
80
+ res.end("ok");
85
81
  console.log("\nAuthenticated successfully! Credentials stored.");
86
82
  console.log(`API URL: ${config.get("apiUrl")}`);
87
83
  server.close();
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@boxcrew/cli",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "BoxCrew CLI — manage your agents from the terminal",
5
5
  "type": "module",
6
6
  "bin": {
7
- "bx": "./dist/index.js"
7
+ "bx": "dist/index.js"
8
8
  },
9
9
  "scripts": {
10
10
  "build": "tsup src/index.ts --format esm --dts --clean",