@emesoft/tokenhub 0.8.2 → 0.8.3

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/tokenhub.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { readFileSync } from "node:fs";
3
3
  import { adminConfigPath, removeAdminConfig } from "../lib/admin.js";
4
- import { showBanner } from "../lib/banner.js";
4
+ import { isInteractive, showBanner } from "../lib/banner.js";
5
5
  import { parseDashboardArgs, runDashboard } from "../lib/dashboard.js";
6
6
  import { runOverlayInstall } from "../lib/overlay.js";
7
7
  import { promptTenant, runConnect, TENANT_DOMAIN } from "../lib/pair.js";
@@ -53,6 +53,9 @@ async function main(argv) {
53
53
  }
54
54
  const file = settingsPath();
55
55
  if (command === "connect") {
56
+ if (isInteractive()) {
57
+ await showBanner({ showActions: false });
58
+ }
56
59
  const controller = new AbortController();
57
60
  process.once("SIGINT", () => controller.abort());
58
61
  let poolUrl = arg;
package/lib/banner.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export interface BannerOptions {
2
2
  stream?: NodeJS.WriteStream;
3
3
  animate?: boolean;
4
+ showActions?: boolean;
4
5
  }
5
6
 
6
7
  export function isInteractive(stream?: NodeJS.WriteStream): boolean;
package/lib/banner.js CHANGED
@@ -6,7 +6,6 @@ const TOKEN_COLOR = "\x1b[38;5;39;1m"; // Electric cyan bold
6
6
  const HUB_COLOR = "\x1b[38;5;208;1m"; // TokenHub warm amber/clay bold
7
7
  const CYAN = "\x1b[38;5;39m";
8
8
  const MUTED = "\x1b[38;5;244m";
9
- const GREEN = "\x1b[38;5;114m";
10
9
  const RESET = "\x1b[0m";
11
10
  const BOLD = "\x1b[1m";
12
11
 
@@ -25,15 +24,15 @@ export const LOGO_PARTS = [
25
24
  },
26
25
  {
27
26
  token: " ██║ ██║ ██║██╔═██╗ ██╔══╝ ██║╚██╗██║",
28
- hub: "██╔══██║██║ ██║██╔═══╝ ",
27
+ hub: "██╔══██║██║ ██║██╔══██╗",
29
28
  },
30
29
  {
31
30
  token: " ██║ ╚██████╔╝██║ ██╗███████╗██║ ╚████║",
32
- hub: "██║ ██║╚██████╔╝██║ ",
31
+ hub: "██║ ██║╚██████╔╝██████╔╝",
33
32
  },
34
33
  {
35
34
  token: " ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═══╝",
36
- hub: "╚═╝ ╚═╝ ╚═════╝ ╚═╝ ",
35
+ hub: "╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ",
37
36
  },
38
37
  ];
39
38
 
@@ -72,9 +71,10 @@ export function isInteractive(stream = process.stdout) {
72
71
  * @param {object} [options]
73
72
  * @param {NodeJS.WriteStream} [options.stream]
74
73
  * @param {boolean} [options.animate]
74
+ * @param {boolean} [options.showActions]
75
75
  * @returns {Promise<void>}
76
76
  */
77
- export async function showBanner({ stream = process.stdout, animate } = {}) {
77
+ export async function showBanner({ stream = process.stdout, animate, showActions = true } = {}) {
78
78
  const interactive = animate ?? isInteractive(stream);
79
79
  const color = !process.env.NO_COLOR && (interactive || Boolean(stream?.isTTY));
80
80
 
@@ -91,8 +91,10 @@ export async function showBanner({ stream = process.stdout, animate } = {}) {
91
91
  stream.write("\n");
92
92
  stream.write(color ? `${CYAN}${SUBTITLE}${RESET}\n` : `${SUBTITLE}\n`);
93
93
  stream.write(color ? `${MUTED}${DIVIDER}${RESET}\n` : `${DIVIDER}\n`);
94
- for (const action of ACTIONS) {
95
- stream.write(color ? `${action}\n` : `${action.replace(/\x1b\[[0-9;]*m/g, "")}\n`);
94
+ if (showActions) {
95
+ for (const action of ACTIONS) {
96
+ stream.write(color ? `${action}\n` : `${action.replace(/\x1b\[[0-9;]*m/g, "")}\n`);
97
+ }
96
98
  }
97
99
  stream.write("\n");
98
100
  return;
@@ -103,12 +105,6 @@ export async function showBanner({ stream = process.stdout, animate } = {}) {
103
105
 
104
106
  // Draw the logo lines progressively with a smooth typewriter scan
105
107
  for (const row of LOGO_PARTS) {
106
- const tokenPart = `${TOKEN_COLOR}${row.token}`;
107
- const hubPart = `${HUB_COLOR}${row.hub}${RESET}\n`;
108
-
109
- // Progressive character scan per line
110
- const fullLine = `${tokenPart}${hubPart}`;
111
- // Split into 4 chunks per line for high-tech sweep effect
112
108
  const chunkSize = 16;
113
109
  let idx = 0;
114
110
  while (idx < row.token.length) {
@@ -146,12 +142,13 @@ export async function showBanner({ stream = process.stdout, animate } = {}) {
146
142
  await sleep(8);
147
143
  }
148
144
  stream.write(`${RESET}\n`);
149
- await sleep(40);
150
145
 
151
- // Quick actions lines
152
- for (const action of ACTIONS) {
153
- stream.write(`${action}\n`);
146
+ if (showActions) {
154
147
  await sleep(40);
148
+ for (const action of ACTIONS) {
149
+ stream.write(`${action}\n`);
150
+ await sleep(40);
151
+ }
155
152
  }
156
153
 
157
154
  stream.write("\n");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emesoft/tokenhub",
3
- "version": "0.8.2",
3
+ "version": "0.8.3",
4
4
  "description": "Connect Claude Code to a TokenHub pool in one command, and track your spend from the terminal",
5
5
  "keywords": [
6
6
  "claude",