@theholocron/cli 5.0.0-alpha.181 → 5.0.0-alpha.183
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.mjs +26 -12
- package/dist/cli.mjs.map +1 -1
- package/dist/plugin/capabilities.d.mts +21 -0
- package/package.json +3 -3
package/dist/cli.mjs
CHANGED
|
@@ -2409,6 +2409,8 @@ async function runDeployFromFiles(input) {
|
|
|
2409
2409
|
* auth → `whoami()` (required on every provider)
|
|
2410
2410
|
* errors → `whoami()` (org reachability) or `describe()`
|
|
2411
2411
|
* logs → `whoami()` (dataset reachability) or `describe()`
|
|
2412
|
+
* wiki → `whoami()` (token presence only — not a live check, see holocron#1079)
|
|
2413
|
+
* notifications → `whoami()` when the provider provisions (bot token + server access); otherwise just "loaded"
|
|
2412
2414
|
* others → just "loaded" (no smoke endpoint defined yet)
|
|
2413
2415
|
*
|
|
2414
2416
|
* Output is plain text via a passed-in `print` function so tests can
|
|
@@ -2434,15 +2436,13 @@ async function runDoctor(input) {
|
|
|
2434
2436
|
const cardinality = CARDINALITY[key];
|
|
2435
2437
|
const entry = config.providers[key];
|
|
2436
2438
|
const providers = entry?.cardinality === "many" ? entry.tuples.map((t) => t.provider) : entry?.cardinality === "single" ? [entry.tuple.provider] : [];
|
|
2437
|
-
if (cardinality === "many")
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
});
|
|
2445
|
-
else {
|
|
2439
|
+
if (cardinality === "many") {
|
|
2440
|
+
const impls = loader.get(key);
|
|
2441
|
+
for (const [idx, impl] of impls.entries()) {
|
|
2442
|
+
const name = impl.providerName ?? providers[idx];
|
|
2443
|
+
rows.push(await smokeCheck(key, name, impl));
|
|
2444
|
+
}
|
|
2445
|
+
} else {
|
|
2446
2446
|
const impl = loader.get(key);
|
|
2447
2447
|
const row = await smokeCheck(key, providers[0] ?? "?", impl);
|
|
2448
2448
|
rows.push(row);
|
|
@@ -2498,11 +2498,11 @@ async function smokeCheck(key, provider, impl) {
|
|
|
2498
2498
|
}
|
|
2499
2499
|
/** Vendor response bodies land in the terminal — cap their length so one
|
|
2500
2500
|
* oversized error can't flood the report, and strip control characters
|
|
2501
|
-
* (newlines
|
|
2502
|
-
* or inject terminal escape sequences. */
|
|
2501
|
+
* (newlines and the C1 range, whose 0x9b is an 8-bit CSI) so a crafted body
|
|
2502
|
+
* can't forge extra report lines or inject terminal escape sequences. */
|
|
2503
2503
|
const MAX_DETAIL_LENGTH = 200;
|
|
2504
2504
|
function sanitizeDetail(text) {
|
|
2505
|
-
const stripped = text.replace(/[\x00-\x1f\x7f]/g, " ").replace(/\s+/g, " ").trim();
|
|
2505
|
+
const stripped = text.replace(/[\x00-\x1f\x7f-\x9f]/g, " ").replace(/\s+/g, " ").trim();
|
|
2506
2506
|
return stripped.length > MAX_DETAIL_LENGTH ? `${stripped.slice(0, MAX_DETAIL_LENGTH)}…` : stripped;
|
|
2507
2507
|
}
|
|
2508
2508
|
/**
|
|
@@ -2581,6 +2581,20 @@ async function runSmokeCheck(key, provider, impl) {
|
|
|
2581
2581
|
}
|
|
2582
2582
|
return mk(key, provider, "skip", "loaded (no smoke check defined for this capability)");
|
|
2583
2583
|
}
|
|
2584
|
+
case "notifications": {
|
|
2585
|
+
const notifications = impl;
|
|
2586
|
+
const who = notifications.whoami ? await notifications.whoami() : null;
|
|
2587
|
+
if (who) return mk(key, provider, "ok", `server: ${sanitizeDetail(who.target)}`);
|
|
2588
|
+
return mk(key, provider, "skip", "loaded (no smoke check defined for this capability)");
|
|
2589
|
+
}
|
|
2590
|
+
case "wiki": {
|
|
2591
|
+
const wiki = impl;
|
|
2592
|
+
if (wiki.whoami) {
|
|
2593
|
+
const who = await wiki.whoami();
|
|
2594
|
+
return mk(key, provider, who.ok ? "ok" : "fail", who.ok ? "token configured" : "token not configured");
|
|
2595
|
+
}
|
|
2596
|
+
return mk(key, provider, "skip", "loaded (no smoke check defined for this capability)");
|
|
2597
|
+
}
|
|
2584
2598
|
default: return mk(key, provider, "skip", "loaded (no smoke check defined for this capability)");
|
|
2585
2599
|
}
|
|
2586
2600
|
}
|