minara 0.1.2 → 0.1.4

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/dist/api/chat.js CHANGED
@@ -11,7 +11,9 @@ export async function sendChatStream(token, dto) {
11
11
  'Content-Type': 'application/json',
12
12
  'Accept': 'text/event-stream',
13
13
  'Authorization': `Bearer ${token}`,
14
- 'origin': 'https://minara.ai',
14
+ 'Origin': 'https://minara.ai',
15
+ 'Referer': 'https://minara.ai/',
16
+ 'User-Agent': 'Minara-CLI/1.0',
15
17
  },
16
18
  body: JSON.stringify(dto),
17
19
  });
@@ -22,6 +22,9 @@ async function requestImpl(path, opts, isRetry) {
22
22
  const headers = {
23
23
  'Content-Type': 'application/json',
24
24
  'Accept': 'application/json',
25
+ 'Origin': 'https://minara.ai',
26
+ 'Referer': 'https://minara.ai/',
27
+ 'User-Agent': 'Minara-CLI/1.0',
25
28
  ...extraHeaders,
26
29
  };
27
30
  if (token) {
@@ -42,7 +42,7 @@ export async function attemptReAuth() {
42
42
  console.log(chalk.dim(`Sending verification code to ${email}…`));
43
43
  }
44
44
  // ── Send code ───────────────────────────────────────────────────────
45
- const codeRes = await sendEmailCode({ email, platform: 'cli' });
45
+ const codeRes = await sendEmailCode({ email, platform: 'web' });
46
46
  if (!codeRes.success) {
47
47
  console.error(chalk.red('✖'), `Failed to send code: ${codeRes.error?.message ?? 'Unknown error'}`);
48
48
  return null;
@@ -57,8 +57,8 @@ export async function attemptReAuth() {
57
57
  const verifyRes = await verifyEmailCode({
58
58
  email,
59
59
  code,
60
- channel: 'cli',
61
- deviceType: 'cli',
60
+ channel: 'web',
61
+ deviceType: 'desktop',
62
62
  });
63
63
  if (!verifyRes.success || !verifyRes.data) {
64
64
  console.error(chalk.red('✖'), `Verification failed: ${verifyRes.error?.message ?? 'Invalid code'}`);
@@ -13,7 +13,7 @@ async function loginWithEmail(emailOpt) {
13
13
  validate: (v) => (v.includes('@') ? true : 'Please enter a valid email'),
14
14
  });
15
15
  const spin = spinner('Sending verification code…');
16
- const codeRes = await sendEmailCode({ email, platform: 'cli' });
16
+ const codeRes = await sendEmailCode({ email, platform: 'web' });
17
17
  spin.stop();
18
18
  if (!codeRes.success) {
19
19
  error(codeRes.error?.message ?? 'Failed to send verification code');
@@ -25,7 +25,7 @@ async function loginWithEmail(emailOpt) {
25
25
  validate: (v) => (v.length > 0 ? true : 'Code is required'),
26
26
  });
27
27
  const spin2 = spinner('Verifying…');
28
- const verifyRes = await verifyEmailCode({ email, code, channel: 'cli', deviceType: 'cli' });
28
+ const verifyRes = await verifyEmailCode({ email, code, channel: 'web', deviceType: 'desktop' });
29
29
  spin2.stop();
30
30
  const user = unwrapApi(verifyRes, 'Verification failed');
31
31
  const token = user.access_token;
package/dist/index.js CHANGED
@@ -1,7 +1,10 @@
1
1
  #!/usr/bin/env node
2
+ import { createRequire } from 'node:module';
2
3
  import { Command } from 'commander';
3
4
  import chalk from 'chalk';
4
5
  import { loginCommand } from './commands/login.js';
6
+ const require = createRequire(import.meta.url);
7
+ const { version } = require('../package.json');
5
8
  import { logoutCommand } from './commands/logout.js';
6
9
  import { accountCommand } from './commands/account.js';
7
10
  import { assetsCommand } from './commands/assets.js';
@@ -18,7 +21,7 @@ import { configCommand } from './commands/config.js';
18
21
  const program = new Command();
19
22
  program
20
23
  .name('minara')
21
- .version('0.1.0')
24
+ .version(version)
22
25
  .description(chalk.bold('Minara CLI') +
23
26
  ' — Your AI-powered digital finance assistant in the terminal.\n\n' +
24
27
  ' Login, swap, trade perps, copy-trade, and chat with Minara AI.');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "minara",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "CLI client for Minara.ai — login, trade, deposit/withdraw, chat and more from your terminal.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",