securewithtrace 0.5.0 → 0.6.0
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/index.js +17 -114
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3566,120 +3566,21 @@ function createAuthCommand() {
|
|
|
3566
3566
|
|
|
3567
3567
|
// src/banner.ts
|
|
3568
3568
|
var ESC = "\x1B";
|
|
3569
|
-
var CURSOR_HIDE = `${ESC}[?25l`;
|
|
3570
|
-
var CURSOR_SHOW = `${ESC}[?25h`;
|
|
3571
|
-
function cursorUp(n) {
|
|
3572
|
-
return n > 0 ? `${ESC}[${n}A` : "";
|
|
3573
|
-
}
|
|
3574
3569
|
var RESET = `${ESC}[0m`;
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
function buildGrid() {
|
|
3589
|
-
const rows = [];
|
|
3590
|
-
for (let r = 0; r < ROWS; r++) {
|
|
3591
|
-
const parts = [];
|
|
3592
|
-
for (let i = 0; i < LETTER_ORDER.length; i++) {
|
|
3593
|
-
const letter = LETTER_ORDER[i];
|
|
3594
|
-
const def = LETTERS[letter];
|
|
3595
|
-
if (def) {
|
|
3596
|
-
parts.push(def[r] ?? "");
|
|
3597
|
-
}
|
|
3598
|
-
if (i < LETTER_ORDER.length - 1) {
|
|
3599
|
-
parts.push(LETTER_GAP);
|
|
3600
|
-
}
|
|
3601
|
-
}
|
|
3602
|
-
rows.push(parts.join(""));
|
|
3603
|
-
}
|
|
3604
|
-
return rows;
|
|
3605
|
-
}
|
|
3606
|
-
var SWEEP_CHARS = [" ", "\u2591", "\u2592", "\u2593", "\u2588"];
|
|
3607
|
-
var PALETTE = [
|
|
3608
|
-
{ r: 80, g: 200, b: 200 },
|
|
3609
|
-
// bright teal
|
|
3610
|
-
{ r: 90, g: 210, b: 210 },
|
|
3611
|
-
{ r: 70, g: 190, b: 195 },
|
|
3612
|
-
{ r: 100, g: 220, b: 215 },
|
|
3613
|
-
{ r: 85, g: 205, b: 205 },
|
|
3614
|
-
{ r: 75, g: 195, b: 200 },
|
|
3615
|
-
{ r: 95, g: 215, b: 210 }
|
|
3616
|
-
];
|
|
3617
|
-
function renderFrame(grid, revealCol, sweepPhase) {
|
|
3618
|
-
const lines = [];
|
|
3619
|
-
for (let r = 0; r < grid.length; r++) {
|
|
3620
|
-
const row = grid[r] ?? "";
|
|
3621
|
-
let line = "";
|
|
3622
|
-
const color = PALETTE[r % PALETTE.length] ?? { r: 80, g: 200, b: 200 };
|
|
3623
|
-
line += rgb(color.r, color.g, color.b);
|
|
3624
|
-
for (let c21 = 0; c21 < row.length; c21++) {
|
|
3625
|
-
const ch = row[c21];
|
|
3626
|
-
if (ch === " " || ch === void 0) {
|
|
3627
|
-
line += " ";
|
|
3628
|
-
continue;
|
|
3629
|
-
}
|
|
3630
|
-
if (c21 < revealCol) {
|
|
3631
|
-
line += "\u2588";
|
|
3632
|
-
} else if (c21 < revealCol + 4) {
|
|
3633
|
-
const distFromEdge = c21 - revealCol;
|
|
3634
|
-
const phaseIdx = Math.max(0, sweepPhase - distFromEdge);
|
|
3635
|
-
line += SWEEP_CHARS[Math.min(phaseIdx, SWEEP_CHARS.length - 1)] ?? " ";
|
|
3636
|
-
} else {
|
|
3637
|
-
line += " ";
|
|
3638
|
-
}
|
|
3639
|
-
}
|
|
3640
|
-
line += RESET;
|
|
3641
|
-
lines.push(line);
|
|
3642
|
-
}
|
|
3643
|
-
return lines.join("\n");
|
|
3644
|
-
}
|
|
3645
|
-
function sleep2(ms) {
|
|
3646
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
3647
|
-
}
|
|
3648
|
-
async function showBanner() {
|
|
3649
|
-
const grid = buildGrid();
|
|
3650
|
-
const totalCols = Math.max(...grid.map((r) => r.length));
|
|
3651
|
-
if (!process.stdout.isTTY) {
|
|
3652
|
-
printStaticBanner(grid);
|
|
3653
|
-
return;
|
|
3654
|
-
}
|
|
3655
|
-
process.stdout.write(CURSOR_HIDE);
|
|
3656
|
-
const emptyFrame = grid.map(() => "").join("\n");
|
|
3657
|
-
process.stdout.write(`${emptyFrame}
|
|
3570
|
+
var CYAN_BOLD = `${ESC}[1;36m`;
|
|
3571
|
+
var DIM = `${ESC}[2m`;
|
|
3572
|
+
var BANNER = `
|
|
3573
|
+
\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557
|
|
3574
|
+
\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D
|
|
3575
|
+
\u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2557
|
|
3576
|
+
\u2588\u2588\u2551 \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2554\u2550\u2550\u255D
|
|
3577
|
+
\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557
|
|
3578
|
+
\u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D
|
|
3579
|
+
`;
|
|
3580
|
+
function showBanner() {
|
|
3581
|
+
console.log(`${CYAN_BOLD}${BANNER}${RESET}`);
|
|
3582
|
+
console.log(`${DIM} Continuous security vulnerability intelligence${RESET}
|
|
3658
3583
|
`);
|
|
3659
|
-
const sweepWidth = 4;
|
|
3660
|
-
const totalSteps = totalCols + sweepWidth + SWEEP_CHARS.length;
|
|
3661
|
-
for (let step = 0; step <= totalSteps; step++) {
|
|
3662
|
-
const revealCol = Math.max(0, step - SWEEP_CHARS.length);
|
|
3663
|
-
const sweepPhase = Math.min(step, SWEEP_CHARS.length);
|
|
3664
|
-
const frame = renderFrame(grid, revealCol, sweepPhase);
|
|
3665
|
-
process.stdout.write(`${cursorUp(grid.length)}\r`);
|
|
3666
|
-
process.stdout.write(`${frame}
|
|
3667
|
-
`);
|
|
3668
|
-
await sleep2(12);
|
|
3669
|
-
}
|
|
3670
|
-
process.stdout.write(CURSOR_SHOW);
|
|
3671
|
-
}
|
|
3672
|
-
function printStaticBanner(grid) {
|
|
3673
|
-
for (let r = 0; r < grid.length; r++) {
|
|
3674
|
-
const row = grid[r] ?? "";
|
|
3675
|
-
const color = PALETTE[r % PALETTE.length] ?? { r: 80, g: 200, b: 200 };
|
|
3676
|
-
let line = rgb(color.r, color.g, color.b);
|
|
3677
|
-
for (const ch of row) {
|
|
3678
|
-
line += ch === "#" ? "\u2588" : " ";
|
|
3679
|
-
}
|
|
3680
|
-
line += RESET;
|
|
3681
|
-
console.log(line);
|
|
3682
|
-
}
|
|
3683
3584
|
}
|
|
3684
3585
|
|
|
3685
3586
|
// src/repo/commands.ts
|
|
@@ -23251,6 +23152,8 @@ var VulnerabilityFilterRequestSchema = external_exports.object({
|
|
|
23251
23152
|
conditions: external_exports.array(FilterConditionSchema).default([])
|
|
23252
23153
|
}).optional(),
|
|
23253
23154
|
dateRange: DateRangeFilterSchema.optional(),
|
|
23155
|
+
/** Free-text keyword search across vulnerability title and description (case-insensitive). */
|
|
23156
|
+
search: external_exports.string().max(500).optional(),
|
|
23254
23157
|
/** When true, only return vulnerabilities found on the repository default branch (or with no branch set). */
|
|
23255
23158
|
defaultBranchOnly: external_exports.boolean().default(false).optional(),
|
|
23256
23159
|
page: external_exports.number().int().min(1).default(1).optional(),
|
|
@@ -24343,8 +24246,8 @@ function createVulnerabilitiesCommand() {
|
|
|
24343
24246
|
// src/index.ts
|
|
24344
24247
|
var program2 = new Command();
|
|
24345
24248
|
program2.name("tracecli").description("Trace CLI").version("0.0.1");
|
|
24346
|
-
program2.action(
|
|
24347
|
-
|
|
24249
|
+
program2.action(() => {
|
|
24250
|
+
showBanner();
|
|
24348
24251
|
program2.outputHelp();
|
|
24349
24252
|
});
|
|
24350
24253
|
program2.command("echo").description("Echo a message back to the terminal").argument("<message...>", "message to echo").action((messageParts) => {
|