@vapi-network/cli 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/brand.d.ts +14 -11
- 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/dist/version.d.ts +1 -1
- package/package.json +1 -1
package/dist/brand.d.ts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
export declare const MARK_STEP_MS = 70;
|
|
2
2
|
export declare const WORDMARK = "vAPI Network";
|
|
3
|
-
|
|
3
|
+
export declare const WELCOME = "Welcome to the vAPI Network";
|
|
4
|
+
export declare const TAGLINE: readonly ["The trusted network where agents and humans do business.", "Search APIs, pay per call, keep receipts. More coming soon."];
|
|
5
|
+
/** Design-token colours; `ink` renders in the terminal's foreground, like the black mark on paper. */
|
|
4
6
|
export declare const MARK_PALETTE: {
|
|
5
|
-
readonly orange: "#
|
|
6
|
-
readonly pink: "#
|
|
7
|
-
readonly lime: "#
|
|
8
|
-
readonly cyan: "#
|
|
9
|
-
readonly blue: "#
|
|
10
|
-
readonly purple: "#
|
|
7
|
+
readonly orange: "#ff7300";
|
|
8
|
+
readonly pink: "#ff337c";
|
|
9
|
+
readonly lime: "#c3ff3d";
|
|
10
|
+
readonly cyan: "#97efff";
|
|
11
|
+
readonly blue: "#0041eb";
|
|
12
|
+
readonly purple: "#8a37fb";
|
|
11
13
|
readonly ink: null;
|
|
12
14
|
};
|
|
13
15
|
export type MarkColorName = keyof typeof MARK_PALETTE;
|
|
@@ -21,7 +23,7 @@ export type MarkBlock = {
|
|
|
21
23
|
};
|
|
22
24
|
export declare const MARK_BLOCKS: readonly MarkBlock[];
|
|
23
25
|
export type MarkRenderOptions = {
|
|
24
|
-
/** Emit
|
|
26
|
+
/** Emit ANSI colour. Defaults to false so output stays pipe-safe. */
|
|
25
27
|
color?: boolean;
|
|
26
28
|
};
|
|
27
29
|
export type BannerOptions = MarkRenderOptions & {
|
|
@@ -43,10 +45,11 @@ export declare function markColorEnabled(environment?: AnimationEnvironment): bo
|
|
|
43
45
|
export declare function shouldAnimateMark(environment?: AnimationEnvironment): boolean;
|
|
44
46
|
/**
|
|
45
47
|
* Every reveal step of the mark, oldest first. Pure: the last frame is the
|
|
46
|
-
* complete mark and each frame is exactly `MARK_ROWS` lines
|
|
48
|
+
* complete mark and each frame is exactly `MARK_ROWS` lines of `MARK_COLUMNS`
|
|
49
|
+
* visible cells.
|
|
47
50
|
*/
|
|
48
51
|
export declare function renderMarkFrames(options?: MarkRenderOptions): string[];
|
|
49
|
-
/** The
|
|
52
|
+
/** The framed welcome banner: the mark on the left, the welcome text on the right. */
|
|
50
53
|
export declare function renderBanner(options: BannerOptions): string;
|
|
51
|
-
/** Reveal the mark in place, then
|
|
54
|
+
/** Reveal the mark in place inside the frame, then leave the finished banner on screen. */
|
|
52
55
|
export declare function animateBanner(options: AnimateBannerOptions): Promise<void>;
|
package/dist/cli.js
CHANGED
|
@@ -46673,7 +46673,7 @@ function csvCell(value) {
|
|
|
46673
46673
|
import { mkdir as mkdir6, writeFile as writeFile4 } from "node:fs/promises";
|
|
46674
46674
|
import { arch, platform, release } from "node:os";
|
|
46675
46675
|
import { join as join2 } from "node:path";
|
|
46676
|
-
var VAPI_CLIENT_VERSION = "0.2.
|
|
46676
|
+
var VAPI_CLIENT_VERSION = "0.2.1";
|
|
46677
46677
|
async function createSupportReport(options) {
|
|
46678
46678
|
const message = options.message.trim();
|
|
46679
46679
|
if (!message) throw new Error("Support report message must not be empty.");
|
|
@@ -48805,22 +48805,32 @@ function asRecord(value) {
|
|
|
48805
48805
|
|
|
48806
48806
|
// src/brand.ts
|
|
48807
48807
|
var MARK_SOURCE_WIDTH = 743;
|
|
48808
|
-
var
|
|
48809
|
-
var
|
|
48810
|
-
var
|
|
48808
|
+
var MARK_SOURCE_HEIGHT = 659;
|
|
48809
|
+
var MARK_SOURCE_ROW_HEIGHT = 217;
|
|
48810
|
+
var MARK_COLUMNS = 28;
|
|
48811
|
+
var MARK_ROWS = 12;
|
|
48812
|
+
var PLAIN_BLOCK = "\u2588";
|
|
48811
48813
|
var MARK_STEP_MS = 70;
|
|
48812
48814
|
var WORDMARK = "vAPI Network";
|
|
48813
|
-
var
|
|
48814
|
-
var
|
|
48815
|
-
|
|
48816
|
-
|
|
48815
|
+
var WELCOME = "Welcome to the vAPI Network";
|
|
48816
|
+
var TAGLINE = [
|
|
48817
|
+
"The trusted network where agents and humans do business.",
|
|
48818
|
+
"Search APIs, pay per call, keep receipts. More coming soon."
|
|
48819
|
+
];
|
|
48820
|
+
var ESC = "\x1B";
|
|
48821
|
+
var RESET = `${ESC}[0m`;
|
|
48822
|
+
var REVERSE = `${ESC}[7m`;
|
|
48823
|
+
var BOLD = `${ESC}[1m`;
|
|
48824
|
+
var DIM = `${ESC}[2m`;
|
|
48825
|
+
var HIDE_CURSOR = `${ESC}[?25l`;
|
|
48826
|
+
var SHOW_CURSOR = `${ESC}[?25h`;
|
|
48817
48827
|
var MARK_PALETTE = {
|
|
48818
|
-
orange: "#
|
|
48819
|
-
pink: "#
|
|
48820
|
-
lime: "#
|
|
48821
|
-
cyan: "#
|
|
48822
|
-
blue: "#
|
|
48823
|
-
purple: "#
|
|
48828
|
+
orange: "#ff7300",
|
|
48829
|
+
pink: "#ff337c",
|
|
48830
|
+
lime: "#c3ff3d",
|
|
48831
|
+
cyan: "#97efff",
|
|
48832
|
+
blue: "#0041eb",
|
|
48833
|
+
purple: "#8a37fb",
|
|
48824
48834
|
ink: null
|
|
48825
48835
|
};
|
|
48826
48836
|
var MARK_BLOCKS = [
|
|
@@ -48858,36 +48868,64 @@ function renderMarkFrames(options = {}) {
|
|
|
48858
48868
|
}
|
|
48859
48869
|
function renderBanner(options) {
|
|
48860
48870
|
const frames = renderMarkFrames(options);
|
|
48861
|
-
return
|
|
48871
|
+
return renderBox(frames[frames.length - 1], options).join("\n");
|
|
48862
48872
|
}
|
|
48863
48873
|
async function animateBanner(options) {
|
|
48864
48874
|
const frames = renderMarkFrames({ color: options.color !== false });
|
|
48865
48875
|
const sleep = options.sleep ?? defaultSleep;
|
|
48866
48876
|
const stepMs = options.stepMs ?? MARK_STEP_MS;
|
|
48877
|
+
const boxes = frames.map((frame) => renderBox(frame, options));
|
|
48878
|
+
const height = boxes[0].length;
|
|
48867
48879
|
options.write(HIDE_CURSOR);
|
|
48868
48880
|
try {
|
|
48869
|
-
for (const [index2,
|
|
48870
|
-
if (index2 > 0) options.write(
|
|
48871
|
-
options.write(
|
|
48872
|
-
|
|
48873
|
-
|
|
48874
|
-
);
|
|
48875
|
-
if (index2 < frames.length - 1) await sleep(stepMs);
|
|
48881
|
+
for (const [index2, box] of boxes.entries()) {
|
|
48882
|
+
if (index2 > 0) options.write(`${ESC}[${height}A`);
|
|
48883
|
+
options.write(box.map((line) => `\r${ESC}[2K${line}
|
|
48884
|
+
`).join(""));
|
|
48885
|
+
if (index2 < boxes.length - 1) await sleep(stepMs);
|
|
48876
48886
|
}
|
|
48877
48887
|
} finally {
|
|
48878
48888
|
options.write(SHOW_CURSOR);
|
|
48879
48889
|
}
|
|
48880
|
-
|
|
48881
|
-
|
|
48882
|
-
options.
|
|
48883
|
-
|
|
48890
|
+
}
|
|
48891
|
+
function renderBox(frame, options) {
|
|
48892
|
+
const color = options.color === true;
|
|
48893
|
+
const text = [
|
|
48894
|
+
{ value: WELCOME, style: BOLD },
|
|
48895
|
+
{ value: "", style: "" },
|
|
48896
|
+
...TAGLINE.map((line) => ({ value: line, style: "" })),
|
|
48897
|
+
{ value: "", style: "" },
|
|
48898
|
+
{ value: `${WORDMARK} v${options.version}`, style: DIM }
|
|
48899
|
+
];
|
|
48900
|
+
const textWidth = Math.max(...text.map((line) => line.value.length));
|
|
48901
|
+
const gap = 3;
|
|
48902
|
+
const inner = 2 + MARK_COLUMNS + gap + textWidth + 2;
|
|
48903
|
+
const markLines = frame.split("\n");
|
|
48904
|
+
const textTop = Math.floor((MARK_ROWS - text.length) / 2);
|
|
48905
|
+
const lines = [];
|
|
48906
|
+
lines.push(`\u256D${"\u2500".repeat(inner)}\u256E`);
|
|
48907
|
+
lines.push(`\u2502${" ".repeat(inner)}\u2502`);
|
|
48908
|
+
for (let row = 0; row < MARK_ROWS; row += 1) {
|
|
48909
|
+
const mark = markLines[row] ?? "";
|
|
48910
|
+
const markPad = " ".repeat(Math.max(0, MARK_COLUMNS - visibleLength(mark)));
|
|
48911
|
+
const entry = text[row - textTop];
|
|
48912
|
+
const raw = entry?.value ?? "";
|
|
48913
|
+
const styled = color && entry && entry.style && raw ? `${entry.style}${raw}${RESET}` : raw;
|
|
48914
|
+
const textPad = " ".repeat(textWidth - raw.length);
|
|
48915
|
+
lines.push(`\u2502 ${mark}${markPad}${" ".repeat(gap)}${styled}${textPad} \u2502`);
|
|
48916
|
+
}
|
|
48917
|
+
lines.push(`\u2502${" ".repeat(inner)}\u2502`);
|
|
48918
|
+
lines.push(`\u2570${"\u2500".repeat(inner)}\u256F`);
|
|
48919
|
+
return lines;
|
|
48884
48920
|
}
|
|
48885
48921
|
function renderFrame(blocks, color) {
|
|
48886
48922
|
const rows = [];
|
|
48887
48923
|
for (let row = 0; row < MARK_ROWS; row += 1) {
|
|
48924
|
+
const sourceY = row * MARK_SOURCE_HEIGHT / MARK_ROWS;
|
|
48925
|
+
const band = Math.min(2, Math.floor(sourceY / MARK_SOURCE_ROW_HEIGHT));
|
|
48888
48926
|
rows.push(
|
|
48889
48927
|
renderRow(
|
|
48890
|
-
blocks.filter((block) => block.row ===
|
|
48928
|
+
blocks.filter((block) => block.row === band),
|
|
48891
48929
|
color
|
|
48892
48930
|
)
|
|
48893
48931
|
);
|
|
@@ -48905,11 +48943,10 @@ function renderRow(blocks, color) {
|
|
|
48905
48943
|
column = start;
|
|
48906
48944
|
}
|
|
48907
48945
|
const width = scaleWidth(block.width);
|
|
48908
|
-
|
|
48909
|
-
line += color ? `${ansiPrefix(block.color)}${glyphs}${RESET}` : glyphs;
|
|
48946
|
+
line += color ? `${cellPrefix(block.color)}${" ".repeat(width)}${RESET}` : PLAIN_BLOCK.repeat(width);
|
|
48910
48947
|
column += width;
|
|
48911
48948
|
}
|
|
48912
|
-
return line;
|
|
48949
|
+
return line + " ".repeat(Math.max(0, MARK_COLUMNS - column));
|
|
48913
48950
|
}
|
|
48914
48951
|
function scaleColumn(x) {
|
|
48915
48952
|
return Math.round(x * MARK_COLUMNS / MARK_SOURCE_WIDTH);
|
|
@@ -48917,11 +48954,14 @@ function scaleColumn(x) {
|
|
|
48917
48954
|
function scaleWidth(width) {
|
|
48918
48955
|
return Math.max(1, Math.round(width * MARK_COLUMNS / MARK_SOURCE_WIDTH));
|
|
48919
48956
|
}
|
|
48920
|
-
function
|
|
48957
|
+
function cellPrefix(color) {
|
|
48921
48958
|
const hex3 = MARK_PALETTE[color];
|
|
48922
|
-
if (hex3 === null) return
|
|
48959
|
+
if (hex3 === null) return REVERSE;
|
|
48923
48960
|
const value = Number.parseInt(hex3.slice(1), 16);
|
|
48924
|
-
return
|
|
48961
|
+
return `${ESC}[48;2;${value >> 16 & 255};${value >> 8 & 255};${value & 255}m`;
|
|
48962
|
+
}
|
|
48963
|
+
function visibleLength(line) {
|
|
48964
|
+
return line.replace(new RegExp(`${ESC}\\[[0-9;?]*[A-Za-z]`, "g"), "").length;
|
|
48925
48965
|
}
|
|
48926
48966
|
function defaultSleep(milliseconds) {
|
|
48927
48967
|
return new Promise((resolve) => {
|
|
@@ -48930,7 +48970,7 @@ function defaultSleep(milliseconds) {
|
|
|
48930
48970
|
}
|
|
48931
48971
|
|
|
48932
48972
|
// src/version.ts
|
|
48933
|
-
var CLI_VERSION = "0.2.
|
|
48973
|
+
var CLI_VERSION = "0.2.1";
|
|
48934
48974
|
|
|
48935
48975
|
// src/cli.ts
|
|
48936
48976
|
var HELP_HEADING = "vAPI Network";
|