+34
| export declare const c: { | ||
| reset: string; | ||
| bold: string; | ||
| dim: string; | ||
| green: string; | ||
| yellow: string; | ||
| blue: string; | ||
| magenta: string; | ||
| cyan: string; | ||
| red: string; | ||
| gray: string; | ||
| white: string; | ||
| bgGreen: string; | ||
| bgRed: string; | ||
| bgYellow: string; | ||
| }; | ||
| export declare const BRAND: string; | ||
| export declare const ARROW: string; | ||
| export declare const DOT: string; | ||
| export declare const CHECK: string; | ||
| export declare const CROSS: string; | ||
| export declare const INFO: string; | ||
| export declare const WARN: string; | ||
| export declare function label(text: string): string; | ||
| export declare function url(text: string): string; | ||
| export declare function dim(text: string): string; | ||
| export declare function statusBadge(status: number): string; | ||
| export declare function printBanner(): void; | ||
| export interface Spin { | ||
| message(text: string): void; | ||
| /** Stop and print a final line. `failed` renders the error glyph. */ | ||
| stop(text: string, failed?: boolean): void; | ||
| } | ||
| export declare function spinner(text: string): Promise<Spin>; |
+77
| /** | ||
| * Shared terminal UI helpers for every interactive (non --json) code path. | ||
| * | ||
| * Color support is decided once by picocolors: a real TTY gets ANSI codes, | ||
| * pipes/CI/NO_COLOR get plain text. The `c` map keeps the historical | ||
| * `${c.bold}text${c.reset}` interpolation style working across the codebase | ||
| * while inheriting that detection - when colors are off, every code is an | ||
| * empty string. | ||
| * | ||
| * Never import this from protocol paths (--json output, the MCP server, | ||
| * the daemon worker): their stdout is machine-read and must stay unstyled. | ||
| */ | ||
| import pc from 'picocolors'; | ||
| const on = pc.isColorSupported; | ||
| const code = (s) => (on ? s : ''); | ||
| export const c = { | ||
| reset: code('\x1b[0m'), | ||
| bold: code('\x1b[1m'), | ||
| dim: code('\x1b[2m'), | ||
| green: code('\x1b[32m'), | ||
| yellow: code('\x1b[33m'), | ||
| blue: code('\x1b[34m'), | ||
| magenta: code('\x1b[35m'), | ||
| cyan: code('\x1b[36m'), | ||
| red: code('\x1b[31m'), | ||
| gray: code('\x1b[90m'), | ||
| white: code('\x1b[97m'), | ||
| bgGreen: code('\x1b[42m'), | ||
| bgRed: code('\x1b[41m'), | ||
| bgYellow: code('\x1b[43m'), | ||
| }; | ||
| export const BRAND = pc.bold(pc.green('otterkit')); | ||
| export const ARROW = pc.gray('→'); | ||
| export const DOT = pc.gray('·'); | ||
| export const CHECK = pc.green('✓'); | ||
| export const CROSS = pc.red('✗'); | ||
| export const INFO = pc.blue('ℹ'); | ||
| export const WARN = pc.yellow('⚠'); | ||
| export function label(text) { | ||
| return pc.gray(text); | ||
| } | ||
| export function url(text) { | ||
| return pc.cyan(pc.bold(text)); | ||
| } | ||
| export function dim(text) { | ||
| return pc.gray(text); | ||
| } | ||
| export function statusBadge(status) { | ||
| if (status < 300) | ||
| return pc.green(String(status)); | ||
| if (status < 400) | ||
| return pc.cyan(String(status)); | ||
| if (status < 500) | ||
| return pc.yellow(String(status)); | ||
| return pc.red(String(status)); | ||
| } | ||
| export function printBanner() { | ||
| console.log(''); | ||
| console.log(` ${BRAND} ${dim('- instant tunnels & webhooks')}`); | ||
| console.log(''); | ||
| } | ||
| export async function spinner(text) { | ||
| if (!process.stdout.isTTY || process.env.CI) { | ||
| console.log(` ${dim(text)}`); | ||
| return { | ||
| message: t => console.log(` ${dim(t)}`), | ||
| stop: (t, failed) => console.log(` ${failed ? CROSS : CHECK} ${t}`), | ||
| }; | ||
| } | ||
| const { spinner: clackSpinner } = await import('@clack/prompts'); | ||
| const s = clackSpinner({ indicator: 'dots' }); | ||
| s.start(text); | ||
| return { | ||
| message: t => s.message(t), | ||
| stop: (t, failed) => (failed ? s.error(t) : s.stop(t)), | ||
| }; | ||
| } |
+1
-12
@@ -90,14 +90,3 @@ /** | ||
| } | ||
| /* ── CLI printing (mirrors index.ts styling) ── */ | ||
| const c = { | ||
| reset: '\x1b[0m', | ||
| bold: '\x1b[1m', | ||
| yellow: '\x1b[33m', | ||
| red: '\x1b[31m', | ||
| green: '\x1b[32m', | ||
| gray: '\x1b[90m', | ||
| white: '\x1b[37m', | ||
| }; | ||
| const CROSS = `${c.red}✗${c.reset}`; | ||
| const dim = (s) => `${c.gray}${s}${c.reset}`; | ||
| import { c, CROSS, dim } from './ui.js'; | ||
| /** `otterkit requests <subdomain>` - print stored history. */ | ||
@@ -104,0 +93,0 @@ export async function printHistory(subdomain, opts) { |
+1
-12
@@ -43,14 +43,3 @@ /** | ||
| } | ||
| /* ── ANSI helpers (kept local; mirrors index.ts) ── */ | ||
| const c = { | ||
| reset: '\x1b[0m', | ||
| bold: '\x1b[1m', | ||
| green: '\x1b[32m', | ||
| cyan: '\x1b[36m', | ||
| red: '\x1b[31m', | ||
| gray: '\x1b[90m', | ||
| }; | ||
| const CHECK = `${c.green}✓${c.reset}`; | ||
| const CROSS = `${c.red}✗${c.reset}`; | ||
| const dim = (s) => `${c.gray}${s}${c.reset}`; | ||
| import { c, CHECK, CROSS, dim } from './ui.js'; | ||
| async function api(path, body, token) { | ||
@@ -57,0 +46,0 @@ const resp = await fetch(`${API_SERVER}${path}`, { |
+3
-1
| { | ||
| "name": "otterkit", | ||
| "version": "0.45.0", | ||
| "version": "0.46.0", | ||
| "description": "OtterKit CLI - provision and connect tunnels for AI agents", | ||
@@ -40,4 +40,6 @@ "mcpName": "io.github.useotterkit/otterkit", | ||
| "dependencies": { | ||
| "@clack/prompts": "^1.7.0", | ||
| "@modelcontextprotocol/sdk": "^1.29.0", | ||
| "commander": "^13.0.0", | ||
| "picocolors": "^1.1.1", | ||
| "smol-toml": "^1.3.1", | ||
@@ -44,0 +46,0 @@ "ws": "^8.18.0", |
Sorry, the diff of this file is too big to display
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
302505
0.57%52
4%7005
0.83%7
40%31
3.33%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added