@hoox-sh/hoox-cli 0.11.4 → 0.11.5
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 +101 -67
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -34824,6 +34824,22 @@ async function runInfraChecks(cf) {
|
|
|
34824
34824
|
});
|
|
34825
34825
|
return { name: "Infrastructure", checks: checks3 };
|
|
34826
34826
|
}
|
|
34827
|
+
function parseRemoteSecretNames(raw) {
|
|
34828
|
+
try {
|
|
34829
|
+
const parsed = JSON.parse(raw);
|
|
34830
|
+
if (!Array.isArray(parsed))
|
|
34831
|
+
return null;
|
|
34832
|
+
const names = new Set;
|
|
34833
|
+
for (const item of parsed) {
|
|
34834
|
+
if (item && typeof item === "object" && typeof item.name === "string") {
|
|
34835
|
+
names.add(item.name);
|
|
34836
|
+
}
|
|
34837
|
+
}
|
|
34838
|
+
return names;
|
|
34839
|
+
} catch {
|
|
34840
|
+
return null;
|
|
34841
|
+
}
|
|
34842
|
+
}
|
|
34827
34843
|
async function runSecretsChecks(secretsService, configService, cf) {
|
|
34828
34844
|
const checks3 = [];
|
|
34829
34845
|
const enabledWorkers = configService.listEnabledWorkers();
|
|
@@ -34832,11 +34848,11 @@ async function runSecretsChecks(secretsService, configService, cf) {
|
|
|
34832
34848
|
for (const workerName of enabledWorkers) {
|
|
34833
34849
|
const result = await secretsService.checkLocalSecrets(workerName);
|
|
34834
34850
|
if (result.missing.length > 0) {
|
|
34835
|
-
errors4.push(`Worker "${workerName}" missing secrets: ${result.missing.join(", ")}`);
|
|
34851
|
+
errors4.push(`Worker "${workerName}" missing secrets: ${result.missing.join(", ")}. ` + `Fix: hoox setup --skip-db --skip-dashboard (mesh keys) or ` + `hoox secrets set ${workerName} <NAME>`);
|
|
34836
34852
|
}
|
|
34837
34853
|
for (const secret of result.secrets) {
|
|
34838
|
-
if (secret.set && secret.source) {
|
|
34839
|
-
warnings.push(`Worker "${workerName}": ${secret.name} is
|
|
34854
|
+
if (!secret.set && secret.source) {
|
|
34855
|
+
warnings.push(`Worker "${workerName}": ${secret.name} is present in ${secret.source} but empty/placeholder`);
|
|
34840
34856
|
}
|
|
34841
34857
|
}
|
|
34842
34858
|
}
|
|
@@ -34849,14 +34865,22 @@ async function runSecretsChecks(secretsService, configService, cf) {
|
|
|
34849
34865
|
const remoteErrors = [];
|
|
34850
34866
|
const remoteWarnings = [];
|
|
34851
34867
|
for (const workerName of enabledWorkers) {
|
|
34852
|
-
const
|
|
34853
|
-
if (
|
|
34868
|
+
const expected = secretsService.listSecrets(workerName);
|
|
34869
|
+
if (expected.length === 0)
|
|
34854
34870
|
continue;
|
|
34855
34871
|
const result = await cf.secretList(workerName);
|
|
34856
34872
|
if (!result.ok) {
|
|
34857
34873
|
remoteErrors.push(`Worker "${workerName}": ${result.error}`);
|
|
34858
|
-
|
|
34859
|
-
|
|
34874
|
+
continue;
|
|
34875
|
+
}
|
|
34876
|
+
const remoteNames = parseRemoteSecretNames(result.value);
|
|
34877
|
+
if (!remoteNames) {
|
|
34878
|
+
remoteWarnings.push(`Worker "${workerName}": could not parse remote secret list (raw length ${result.value.length})`);
|
|
34879
|
+
continue;
|
|
34880
|
+
}
|
|
34881
|
+
const missingRemote = expected.filter((n3) => !remoteNames.has(n3));
|
|
34882
|
+
if (missingRemote.length > 0) {
|
|
34883
|
+
remoteErrors.push(`Worker "${workerName}" missing on Cloudflare: ${missingRemote.join(", ")}. ` + `Fix: hoox secrets sync ${workerName}`);
|
|
34860
34884
|
}
|
|
34861
34885
|
}
|
|
34862
34886
|
checks3.push({
|
|
@@ -41273,68 +41297,78 @@ function findCliVersion() {
|
|
|
41273
41297
|
}
|
|
41274
41298
|
var VERSION = findCliVersion();
|
|
41275
41299
|
var DISCLAIMER2 = "DISCLAIMER: Trading cryptocurrencies involves substantial risk of loss. Use at your own risk.";
|
|
41276
|
-
var
|
|
41277
|
-
|
|
41278
|
-
"| | | |/ _ \\ / _ \\ \\/ / ",
|
|
41279
|
-
"| |_| | (_) | (_) > < ",
|
|
41280
|
-
" \\___/ \\___/ \\___/_/\\_\\ "
|
|
41281
|
-
];
|
|
41282
|
-
var WORD_W = WORDMARK[0].length;
|
|
41283
|
-
function colorWordmark(phase, mode) {
|
|
41284
|
-
return WORDMARK.map((line, row) => {
|
|
41285
|
-
if (mode === "assemble") {
|
|
41286
|
-
const local = Math.max(0, Math.min(1, phase));
|
|
41287
|
-
const cut = Math.floor(local * line.length);
|
|
41288
|
-
let out = "";
|
|
41289
|
-
for (let col = 0;col < line.length; col++) {
|
|
41290
|
-
const ch = line[col];
|
|
41291
|
-
if (ch === " ") {
|
|
41292
|
-
out += " ";
|
|
41293
|
-
continue;
|
|
41294
|
-
}
|
|
41295
|
-
if (col > cut)
|
|
41296
|
-
out += ZINC_FAINT("\xB7");
|
|
41297
|
-
else if (local < 0.85)
|
|
41298
|
-
out += ZINC(ch);
|
|
41299
|
-
else
|
|
41300
|
-
out += theme.heading(ch);
|
|
41301
|
-
}
|
|
41302
|
-
return out;
|
|
41303
|
-
}
|
|
41304
|
-
if (mode === "pulse") {
|
|
41305
|
-
let out = "";
|
|
41306
|
-
for (let col = 0;col < line.length; col++) {
|
|
41307
|
-
const ch = line[col];
|
|
41308
|
-
if (ch === " ") {
|
|
41309
|
-
out += " ";
|
|
41310
|
-
continue;
|
|
41311
|
-
}
|
|
41312
|
-
const t2 = (phase * 1.5 + col * 0.05 + row * 0.06) % 1;
|
|
41313
|
-
if (t2 < 0.12)
|
|
41314
|
-
out += AMBER(ch);
|
|
41315
|
-
else if (t2 < 0.25)
|
|
41316
|
-
out += ORANGE(ch);
|
|
41317
|
-
else if (t2 < 0.4)
|
|
41318
|
-
out += INDIGO_SOFT(ch);
|
|
41319
|
-
else
|
|
41320
|
-
out += INDIGO.bold(ch);
|
|
41321
|
-
}
|
|
41322
|
-
return out;
|
|
41323
|
-
}
|
|
41324
|
-
return theme.heading(line);
|
|
41325
|
-
});
|
|
41326
|
-
}
|
|
41300
|
+
var LETTERS = ["H", "O", "O", "X"];
|
|
41301
|
+
var RULE_W = 38;
|
|
41327
41302
|
var PAD = " ";
|
|
41303
|
+
function colorDiamond(phase, mode) {
|
|
41304
|
+
if (mode === "assemble") {
|
|
41305
|
+
if (phase < 0.05)
|
|
41306
|
+
return " ";
|
|
41307
|
+
if (phase < 0.2)
|
|
41308
|
+
return ZINC_FAINT("\u25C6");
|
|
41309
|
+
return AMBER("\u25C6");
|
|
41310
|
+
}
|
|
41311
|
+
if (mode === "pulse") {
|
|
41312
|
+
const t2 = phase * 2 % 1;
|
|
41313
|
+
return t2 < 0.5 ? AMBER("\u25C6") : ORANGE("\u25C6");
|
|
41314
|
+
}
|
|
41315
|
+
return AMBER("\u25C6");
|
|
41316
|
+
}
|
|
41317
|
+
function colorLetter(letter, index, phase, mode) {
|
|
41318
|
+
if (mode === "assemble") {
|
|
41319
|
+
const start = 0.12;
|
|
41320
|
+
const span = 0.88;
|
|
41321
|
+
const letterPhase = (phase - start) / span;
|
|
41322
|
+
const revealAt = index / LETTERS.length;
|
|
41323
|
+
if (letterPhase < revealAt)
|
|
41324
|
+
return " ";
|
|
41325
|
+
if (letterPhase < revealAt + 0.12)
|
|
41326
|
+
return ZINC(letter);
|
|
41327
|
+
return INDIGO.bold(letter);
|
|
41328
|
+
}
|
|
41329
|
+
if (mode === "pulse") {
|
|
41330
|
+
const t2 = (phase * 1.4 + index * 0.18) % 1;
|
|
41331
|
+
if (t2 < 0.15)
|
|
41332
|
+
return INDIGO_SOFT(letter);
|
|
41333
|
+
if (t2 < 0.3)
|
|
41334
|
+
return AMBER(letter);
|
|
41335
|
+
return INDIGO.bold(letter);
|
|
41336
|
+
}
|
|
41337
|
+
return INDIGO.bold(letter);
|
|
41338
|
+
}
|
|
41339
|
+
function colorDot(afterLetterIndex, phase, mode) {
|
|
41340
|
+
if (mode === "assemble") {
|
|
41341
|
+
const start = 0.12;
|
|
41342
|
+
const span = 0.88;
|
|
41343
|
+
const letterPhase = (phase - start) / span;
|
|
41344
|
+
const revealAt = (afterLetterIndex + 1) / LETTERS.length;
|
|
41345
|
+
if (letterPhase < revealAt - 0.02)
|
|
41346
|
+
return " ";
|
|
41347
|
+
return ZINC_FAINT("\xB7");
|
|
41348
|
+
}
|
|
41349
|
+
return ZINC_FAINT("\xB7");
|
|
41350
|
+
}
|
|
41351
|
+
function composeTitleLine(phase, mode) {
|
|
41352
|
+
const diamond = colorDiamond(phase, mode);
|
|
41353
|
+
const parts = [diamond, " "];
|
|
41354
|
+
for (let i2 = 0;i2 < LETTERS.length; i2++) {
|
|
41355
|
+
parts.push(colorLetter(LETTERS[i2], i2, phase, mode));
|
|
41356
|
+
if (i2 < LETTERS.length - 1) {
|
|
41357
|
+
parts.push(" ");
|
|
41358
|
+
parts.push(colorDot(i2, phase, mode));
|
|
41359
|
+
parts.push(" ");
|
|
41360
|
+
}
|
|
41361
|
+
}
|
|
41362
|
+
return PAD + parts.join("");
|
|
41363
|
+
}
|
|
41364
|
+
function composeMetaLine() {
|
|
41365
|
+
return PAD + ZINC_SOFT(TAGLINE) + " " + ZINC_FAINT("\xB7") + " " + INDIGO_SOFT(`v${VERSION}`);
|
|
41366
|
+
}
|
|
41328
41367
|
function composeFrame(phase, mode) {
|
|
41329
|
-
const
|
|
41330
|
-
const
|
|
41331
|
-
const
|
|
41332
|
-
|
|
41333
|
-
const metaInner = ZINC_SOFT(TAGLINE) + " " + ZINC_FAINT("\xB7") + " " + INDIGO_SOFT(`v${VERSION}`);
|
|
41334
|
-
const metaVis = stripAnsi(metaInner).length;
|
|
41335
|
-
const metaPad = Math.max(0, Math.floor((contentW - metaVis) / 2));
|
|
41336
|
-
const meta3 = PAD + " ".repeat(metaPad) + metaInner;
|
|
41337
|
-
return [rule, ...body, rule, meta3].join(`
|
|
41368
|
+
const title = composeTitleLine(phase, mode);
|
|
41369
|
+
const rule = PAD + ZINC_SOFT("\xB7") + " " + ZINC_FAINT("\u2500".repeat(RULE_W - 2));
|
|
41370
|
+
const meta3 = composeMetaLine();
|
|
41371
|
+
return [title, rule, meta3].join(`
|
|
41338
41372
|
`);
|
|
41339
41373
|
}
|
|
41340
41374
|
function canAnimate() {
|