haansi 0.1.15 → 0.1.16

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/haansi.js +5 -6
  2. package/package.json +1 -1
package/dist/haansi.js CHANGED
@@ -39,7 +39,7 @@ var require_package = __commonJS({
39
39
  "package.json"(exports2, module2) {
40
40
  module2.exports = {
41
41
  name: "haansi",
42
- version: "0.1.15",
42
+ version: "0.1.16",
43
43
  description: "Haansi CLI - Session collector and MCP server for Claude Code",
44
44
  bin: {
45
45
  haansi: "./dist/haansi.js"
@@ -83,7 +83,6 @@ function sleep(ms) {
83
83
  }
84
84
  async function authLogin() {
85
85
  const apiUrl = process.env.HAANSI_API_URL ?? DEFAULT_API_URL;
86
- const appUrl = process.env.HAANSI_APP_URL ?? DEFAULT_APP_URL;
87
86
  console.log("Haansi CLI \u2014 Browser Login\n");
88
87
  const initiateRes = await fetch(`${apiUrl}/api/v1/auth/extension/initiate`, {
89
88
  method: "POST",
@@ -95,8 +94,9 @@ async function authLogin() {
95
94
  `Failed to start auth session (${initiateRes.status}): ${body.slice(0, 200)}`
96
95
  );
97
96
  }
98
- const { session_id } = await initiateRes.json();
99
- const authUrl = `${appUrl}/auth/cli?session_id=${session_id}`;
97
+ const { session_id, auth_url: vsCodeAuthUrl } = await initiateRes.json();
98
+ const frontendOrigin = new URL(vsCodeAuthUrl).origin;
99
+ const authUrl = `${frontendOrigin}/auth/cli?session_id=${session_id}`;
100
100
  const opened = openBrowser(authUrl);
101
101
  if (opened) {
102
102
  console.log("A browser window has been opened for you to log in.");
@@ -171,7 +171,7 @@ Authenticated successfully${orgName ? ` (${orgName})` : ""}!`);
171
171
  "Run `haansi collect` to upload sessions or `haansi setup-mcp` to configure Claude Code."
172
172
  );
173
173
  }
174
- var import_node_child_process, import_node_fs, import_node_path, import_node_os, DEFAULT_API_URL, DEFAULT_APP_URL, HAANSI_DIR, CREDENTIALS_FILE, POLL_INTERVAL_MS, TIMEOUT_MS;
174
+ var import_node_child_process, import_node_fs, import_node_path, import_node_os, DEFAULT_API_URL, HAANSI_DIR, CREDENTIALS_FILE, POLL_INTERVAL_MS, TIMEOUT_MS;
175
175
  var init_auth_login = __esm({
176
176
  "src/commands/auth-login.ts"() {
177
177
  "use strict";
@@ -180,7 +180,6 @@ var init_auth_login = __esm({
180
180
  import_node_path = require("node:path");
181
181
  import_node_os = require("node:os");
182
182
  DEFAULT_API_URL = "https://api.haansi.co";
183
- DEFAULT_APP_URL = "https://app.haansi.co";
184
183
  HAANSI_DIR = (0, import_node_path.join)((0, import_node_os.homedir)(), ".haansi");
185
184
  CREDENTIALS_FILE = (0, import_node_path.join)(HAANSI_DIR, "credentials.json");
186
185
  POLL_INTERVAL_MS = 2e3;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "haansi",
3
- "version": "0.1.15",
3
+ "version": "0.1.16",
4
4
  "description": "Haansi CLI - Session collector and MCP server for Claude Code",
5
5
  "bin": {
6
6
  "haansi": "./dist/haansi.js"