@theholocron/cli 5.0.0-alpha.182 → 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 CHANGED
@@ -2410,6 +2410,7 @@ async function runDeployFromFiles(input) {
2410
2410
  * errors → `whoami()` (org reachability) or `describe()`
2411
2411
  * logs → `whoami()` (dataset reachability) or `describe()`
2412
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"
2413
2414
  * others → just "loaded" (no smoke endpoint defined yet)
2414
2415
  *
2415
2416
  * Output is plain text via a passed-in `print` function so tests can
@@ -2435,15 +2436,13 @@ async function runDoctor(input) {
2435
2436
  const cardinality = CARDINALITY[key];
2436
2437
  const entry = config.providers[key];
2437
2438
  const providers = entry?.cardinality === "many" ? entry.tuples.map((t) => t.provider) : entry?.cardinality === "single" ? [entry.tuple.provider] : [];
2438
- if (cardinality === "many") loader.get(key).forEach((_impl, idx) => {
2439
- rows.push({
2440
- capability: key,
2441
- provider: providers[idx] ?? "?",
2442
- status: "skip",
2443
- message: "loaded (no smoke check defined for this capability)"
2444
- });
2445
- });
2446
- 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 {
2447
2446
  const impl = loader.get(key);
2448
2447
  const row = await smokeCheck(key, providers[0] ?? "?", impl);
2449
2448
  rows.push(row);
@@ -2499,11 +2498,11 @@ async function smokeCheck(key, provider, impl) {
2499
2498
  }
2500
2499
  /** Vendor response bodies land in the terminal — cap their length so one
2501
2500
  * oversized error can't flood the report, and strip control characters
2502
- * (newlines included) so a crafted body can't forge extra report lines
2503
- * 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. */
2504
2503
  const MAX_DETAIL_LENGTH = 200;
2505
2504
  function sanitizeDetail(text) {
2506
- 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();
2507
2506
  return stripped.length > MAX_DETAIL_LENGTH ? `${stripped.slice(0, MAX_DETAIL_LENGTH)}…` : stripped;
2508
2507
  }
2509
2508
  /**
@@ -2582,6 +2581,12 @@ async function runSmokeCheck(key, provider, impl) {
2582
2581
  }
2583
2582
  return mk(key, provider, "skip", "loaded (no smoke check defined for this capability)");
2584
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
+ }
2585
2590
  case "wiki": {
2586
2591
  const wiki = impl;
2587
2592
  if (wiki.whoami) {