@kinkai.cloud/vibecheck 0.1.4 → 0.1.6
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 +16 -9
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -15418,27 +15418,31 @@ async function main(argv) {
|
|
|
15418
15418
|
authorization: `Bearer ${cred.token}`,
|
|
15419
15419
|
"content-type": "application/json"
|
|
15420
15420
|
};
|
|
15421
|
-
|
|
15422
|
-
method: "POST",
|
|
15423
|
-
headers,
|
|
15424
|
-
body: JSON.stringify({ url: url2 })
|
|
15425
|
-
});
|
|
15421
|
+
console.warn("Gerando GrafoScan\u2026");
|
|
15426
15422
|
const grafo = await extrairGrafo(raiz);
|
|
15427
15423
|
const avancado = scanEhAvancado(grafo);
|
|
15428
15424
|
if (!avancado) {
|
|
15429
15425
|
console.warn(
|
|
15430
15426
|
"Sem grafo extra\xEDvel (nem graphify, nem JS/TS). O HTTP roda, mas isto n\xE3o \xE9 scan avan\xE7ado."
|
|
15431
15427
|
);
|
|
15428
|
+
} else {
|
|
15429
|
+
console.warn(
|
|
15430
|
+
`GrafoScan pronto \xB7 ${String(grafo?.nos.length ?? 0)} n\xF3s \xB7 ${String(grafo?.arestas.length ?? 0)} arestas`
|
|
15431
|
+
);
|
|
15432
15432
|
}
|
|
15433
|
-
const criado = await
|
|
15433
|
+
const criado = await fetch(`${base}/api/cli/scan`, {
|
|
15434
|
+
method: "POST",
|
|
15435
|
+
headers,
|
|
15436
|
+
body: JSON.stringify({
|
|
15437
|
+
url: url2,
|
|
15438
|
+
...grafo === null ? {} : { graph: grafo }
|
|
15439
|
+
})
|
|
15440
|
+
});
|
|
15434
15441
|
const corpo = await criado.json();
|
|
15435
15442
|
if (!criado.ok || corpo.scanId === void 0) {
|
|
15436
15443
|
console.error(corpo.error ?? "n\xE3o foi poss\xEDvel abrir o scan");
|
|
15437
15444
|
return 1;
|
|
15438
15445
|
}
|
|
15439
|
-
const live = corpo.liveUrl ?? `${base}/avancado/${corpo.scanId}`;
|
|
15440
|
-
console.warn(live);
|
|
15441
|
-
if (deveAbrirNavegador({ ci, noWait })) await abrirBrowser(live);
|
|
15442
15446
|
if (avancado && grafo !== null) {
|
|
15443
15447
|
const put = await fetch(`${base}/api/cli/scan/${corpo.scanId}/graph`, {
|
|
15444
15448
|
method: "PUT",
|
|
@@ -15447,6 +15451,9 @@ async function main(argv) {
|
|
|
15447
15451
|
});
|
|
15448
15452
|
if (!put.ok) console.warn("grafo rejeitado pelo servidor \u2014 scan segue s\xF3 HTTP");
|
|
15449
15453
|
}
|
|
15454
|
+
const live = corpo.liveUrl ?? `${base}/avancado/${corpo.scanId}`;
|
|
15455
|
+
console.warn(live);
|
|
15456
|
+
if (deveAbrirNavegador({ ci, noWait })) await abrirBrowser(live);
|
|
15450
15457
|
if (noWait) return 0;
|
|
15451
15458
|
return acompanhar(live, corpo.scanId, corpo.shareToken ?? "");
|
|
15452
15459
|
}
|