vapi-network 0.2.0 → 0.2.1
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/cli.js +74 -34
- package/dist/cli.js.map +1 -1
- package/dist/index.js +74 -34
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -47022,7 +47022,7 @@ function csvCell(value) {
|
|
|
47022
47022
|
import { mkdir as mkdir6, writeFile as writeFile4 } from "node:fs/promises";
|
|
47023
47023
|
import { arch, platform, release } from "node:os";
|
|
47024
47024
|
import { join as join2 } from "node:path";
|
|
47025
|
-
var VAPI_CLIENT_VERSION = "0.2.
|
|
47025
|
+
var VAPI_CLIENT_VERSION = "0.2.1";
|
|
47026
47026
|
async function createSupportReport(options) {
|
|
47027
47027
|
const message = options.message.trim();
|
|
47028
47028
|
if (!message) throw new Error("Support report message must not be empty.");
|
|
@@ -49629,22 +49629,32 @@ function asRecord2(value) {
|
|
|
49629
49629
|
|
|
49630
49630
|
// ../cli/src/brand.ts
|
|
49631
49631
|
var MARK_SOURCE_WIDTH = 743;
|
|
49632
|
-
var
|
|
49633
|
-
var
|
|
49634
|
-
var
|
|
49632
|
+
var MARK_SOURCE_HEIGHT = 659;
|
|
49633
|
+
var MARK_SOURCE_ROW_HEIGHT = 217;
|
|
49634
|
+
var MARK_COLUMNS = 28;
|
|
49635
|
+
var MARK_ROWS = 12;
|
|
49636
|
+
var PLAIN_BLOCK = "\u2588";
|
|
49635
49637
|
var MARK_STEP_MS = 70;
|
|
49636
49638
|
var WORDMARK = "vAPI Network";
|
|
49637
|
-
var
|
|
49638
|
-
var
|
|
49639
|
-
|
|
49640
|
-
|
|
49639
|
+
var WELCOME = "Welcome to the vAPI Network";
|
|
49640
|
+
var TAGLINE = [
|
|
49641
|
+
"The trusted network where agents and humans do business.",
|
|
49642
|
+
"Search APIs, pay per call, keep receipts. More coming soon."
|
|
49643
|
+
];
|
|
49644
|
+
var ESC = "\x1B";
|
|
49645
|
+
var RESET = `${ESC}[0m`;
|
|
49646
|
+
var REVERSE = `${ESC}[7m`;
|
|
49647
|
+
var BOLD = `${ESC}[1m`;
|
|
49648
|
+
var DIM = `${ESC}[2m`;
|
|
49649
|
+
var HIDE_CURSOR = `${ESC}[?25l`;
|
|
49650
|
+
var SHOW_CURSOR = `${ESC}[?25h`;
|
|
49641
49651
|
var MARK_PALETTE = {
|
|
49642
|
-
orange: "#
|
|
49643
|
-
pink: "#
|
|
49644
|
-
lime: "#
|
|
49645
|
-
cyan: "#
|
|
49646
|
-
blue: "#
|
|
49647
|
-
purple: "#
|
|
49652
|
+
orange: "#ff7300",
|
|
49653
|
+
pink: "#ff337c",
|
|
49654
|
+
lime: "#c3ff3d",
|
|
49655
|
+
cyan: "#97efff",
|
|
49656
|
+
blue: "#0041eb",
|
|
49657
|
+
purple: "#8a37fb",
|
|
49648
49658
|
ink: null
|
|
49649
49659
|
};
|
|
49650
49660
|
var MARK_BLOCKS = [
|
|
@@ -49682,36 +49692,64 @@ function renderMarkFrames(options = {}) {
|
|
|
49682
49692
|
}
|
|
49683
49693
|
function renderBanner(options) {
|
|
49684
49694
|
const frames = renderMarkFrames(options);
|
|
49685
|
-
return
|
|
49695
|
+
return renderBox(frames[frames.length - 1], options).join("\n");
|
|
49686
49696
|
}
|
|
49687
49697
|
async function animateBanner(options) {
|
|
49688
49698
|
const frames = renderMarkFrames({ color: options.color !== false });
|
|
49689
49699
|
const sleep = options.sleep ?? defaultSleep;
|
|
49690
49700
|
const stepMs = options.stepMs ?? MARK_STEP_MS;
|
|
49701
|
+
const boxes = frames.map((frame) => renderBox(frame, options));
|
|
49702
|
+
const height = boxes[0].length;
|
|
49691
49703
|
options.write(HIDE_CURSOR);
|
|
49692
49704
|
try {
|
|
49693
|
-
for (const [index2,
|
|
49694
|
-
if (index2 > 0) options.write(
|
|
49695
|
-
options.write(
|
|
49696
|
-
|
|
49697
|
-
|
|
49698
|
-
);
|
|
49699
|
-
if (index2 < frames.length - 1) await sleep(stepMs);
|
|
49705
|
+
for (const [index2, box] of boxes.entries()) {
|
|
49706
|
+
if (index2 > 0) options.write(`${ESC}[${height}A`);
|
|
49707
|
+
options.write(box.map((line) => `\r${ESC}[2K${line}
|
|
49708
|
+
`).join(""));
|
|
49709
|
+
if (index2 < boxes.length - 1) await sleep(stepMs);
|
|
49700
49710
|
}
|
|
49701
49711
|
} finally {
|
|
49702
49712
|
options.write(SHOW_CURSOR);
|
|
49703
49713
|
}
|
|
49704
|
-
|
|
49705
|
-
|
|
49706
|
-
options.
|
|
49707
|
-
|
|
49714
|
+
}
|
|
49715
|
+
function renderBox(frame, options) {
|
|
49716
|
+
const color = options.color === true;
|
|
49717
|
+
const text = [
|
|
49718
|
+
{ value: WELCOME, style: BOLD },
|
|
49719
|
+
{ value: "", style: "" },
|
|
49720
|
+
...TAGLINE.map((line) => ({ value: line, style: "" })),
|
|
49721
|
+
{ value: "", style: "" },
|
|
49722
|
+
{ value: `${WORDMARK} v${options.version}`, style: DIM }
|
|
49723
|
+
];
|
|
49724
|
+
const textWidth = Math.max(...text.map((line) => line.value.length));
|
|
49725
|
+
const gap = 3;
|
|
49726
|
+
const inner = 2 + MARK_COLUMNS + gap + textWidth + 2;
|
|
49727
|
+
const markLines = frame.split("\n");
|
|
49728
|
+
const textTop = Math.floor((MARK_ROWS - text.length) / 2);
|
|
49729
|
+
const lines = [];
|
|
49730
|
+
lines.push(`\u256D${"\u2500".repeat(inner)}\u256E`);
|
|
49731
|
+
lines.push(`\u2502${" ".repeat(inner)}\u2502`);
|
|
49732
|
+
for (let row = 0; row < MARK_ROWS; row += 1) {
|
|
49733
|
+
const mark = markLines[row] ?? "";
|
|
49734
|
+
const markPad = " ".repeat(Math.max(0, MARK_COLUMNS - visibleLength(mark)));
|
|
49735
|
+
const entry = text[row - textTop];
|
|
49736
|
+
const raw = entry?.value ?? "";
|
|
49737
|
+
const styled = color && entry && entry.style && raw ? `${entry.style}${raw}${RESET}` : raw;
|
|
49738
|
+
const textPad = " ".repeat(textWidth - raw.length);
|
|
49739
|
+
lines.push(`\u2502 ${mark}${markPad}${" ".repeat(gap)}${styled}${textPad} \u2502`);
|
|
49740
|
+
}
|
|
49741
|
+
lines.push(`\u2502${" ".repeat(inner)}\u2502`);
|
|
49742
|
+
lines.push(`\u2570${"\u2500".repeat(inner)}\u256F`);
|
|
49743
|
+
return lines;
|
|
49708
49744
|
}
|
|
49709
49745
|
function renderFrame(blocks, color) {
|
|
49710
49746
|
const rows = [];
|
|
49711
49747
|
for (let row = 0; row < MARK_ROWS; row += 1) {
|
|
49748
|
+
const sourceY = row * MARK_SOURCE_HEIGHT / MARK_ROWS;
|
|
49749
|
+
const band = Math.min(2, Math.floor(sourceY / MARK_SOURCE_ROW_HEIGHT));
|
|
49712
49750
|
rows.push(
|
|
49713
49751
|
renderRow(
|
|
49714
|
-
blocks.filter((block) => block.row ===
|
|
49752
|
+
blocks.filter((block) => block.row === band),
|
|
49715
49753
|
color
|
|
49716
49754
|
)
|
|
49717
49755
|
);
|
|
@@ -49729,11 +49767,10 @@ function renderRow(blocks, color) {
|
|
|
49729
49767
|
column = start;
|
|
49730
49768
|
}
|
|
49731
49769
|
const width = scaleWidth(block.width);
|
|
49732
|
-
|
|
49733
|
-
line += color ? `${ansiPrefix(block.color)}${glyphs}${RESET}` : glyphs;
|
|
49770
|
+
line += color ? `${cellPrefix(block.color)}${" ".repeat(width)}${RESET}` : PLAIN_BLOCK.repeat(width);
|
|
49734
49771
|
column += width;
|
|
49735
49772
|
}
|
|
49736
|
-
return line;
|
|
49773
|
+
return line + " ".repeat(Math.max(0, MARK_COLUMNS - column));
|
|
49737
49774
|
}
|
|
49738
49775
|
function scaleColumn(x) {
|
|
49739
49776
|
return Math.round(x * MARK_COLUMNS / MARK_SOURCE_WIDTH);
|
|
@@ -49741,11 +49778,14 @@ function scaleColumn(x) {
|
|
|
49741
49778
|
function scaleWidth(width) {
|
|
49742
49779
|
return Math.max(1, Math.round(width * MARK_COLUMNS / MARK_SOURCE_WIDTH));
|
|
49743
49780
|
}
|
|
49744
|
-
function
|
|
49781
|
+
function cellPrefix(color) {
|
|
49745
49782
|
const hex3 = MARK_PALETTE[color];
|
|
49746
|
-
if (hex3 === null) return
|
|
49783
|
+
if (hex3 === null) return REVERSE;
|
|
49747
49784
|
const value = Number.parseInt(hex3.slice(1), 16);
|
|
49748
|
-
return
|
|
49785
|
+
return `${ESC}[48;2;${value >> 16 & 255};${value >> 8 & 255};${value & 255}m`;
|
|
49786
|
+
}
|
|
49787
|
+
function visibleLength(line) {
|
|
49788
|
+
return line.replace(new RegExp(`${ESC}\\[[0-9;?]*[A-Za-z]`, "g"), "").length;
|
|
49749
49789
|
}
|
|
49750
49790
|
function defaultSleep(milliseconds) {
|
|
49751
49791
|
return new Promise((resolve2) => {
|
|
@@ -49754,7 +49794,7 @@ function defaultSleep(milliseconds) {
|
|
|
49754
49794
|
}
|
|
49755
49795
|
|
|
49756
49796
|
// ../cli/src/version.ts
|
|
49757
|
-
var CLI_VERSION = "0.2.
|
|
49797
|
+
var CLI_VERSION = "0.2.1";
|
|
49758
49798
|
|
|
49759
49799
|
// ../cli/src/cli.ts
|
|
49760
49800
|
var HELP_HEADING = "vAPI Network";
|