@decantr/cli 1.11.0 → 2.1.1

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/README.md CHANGED
@@ -115,6 +115,8 @@ decantr studio --port 4319 --host 127.0.0.1
115
115
 
116
116
  Studio is for local triage, not Decantr admin telemetry. The tabs cover Overview, Routes, Drift, Findings, Remediation, CI, and Packs without uploading source code, prompts, file paths, or project data.
117
117
 
118
+ If the project has explicitly enabled Decantr CLI telemetry, `new --telemetry`, `init --telemetry`, `check --telemetry`, `health`, and `studio` emit only aggregate product-activation metadata such as lifecycle command outcome, status, score, finding counts, CI failure outcome, Studio usage, and remediation prompt requests. They never upload the health report, finding evidence, local paths, route names, source code, or prompt text.
119
+
118
120
  ## Content Health
119
121
 
120
122
  `decantr content-health` is the local supply-chain observability command for registry content repositories such as `decantr-content`. It is separate from Project Health: Project Health checks an end-user app against its Decantr contract, while Content Health checks published content inputs before they flow into the hosted registry.
package/dist/bin.js CHANGED
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import "./chunk-5RODH77L.js";
3
- import "./chunk-USOO77A5.js";
4
- import "./chunk-DI2PLOJ6.js";
2
+ import "./chunk-GOX5EJ56.js";
3
+ import "./chunk-WDA4SHIQ.js";
4
+ import "./chunk-JYEEXSUX.js";
@@ -1,6 +1,11 @@
1
1
  import {
2
2
  collectCheckIssues
3
- } from "./chunk-RSDCWAHD.js";
3
+ } from "./chunk-LLQCXOHK.js";
4
+ import {
5
+ sendProjectHealthCiFailedTelemetry,
6
+ sendProjectHealthPromptTelemetry,
7
+ sendProjectHealthReportTelemetry
8
+ } from "./chunk-JYEEXSUX.js";
4
9
 
5
10
  // src/commands/health.ts
6
11
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
@@ -62,7 +67,7 @@ function normalizeCliPackageSpecifier(version) {
62
67
  const versionToken = value.startsWith("@decantr/cli@") ? value.slice("@decantr/cli@".length) : value;
63
68
  if (!/^[A-Za-z0-9._~^*-]+$/.test(versionToken)) {
64
69
  throw new Error(
65
- "Invalid --cli-version value. Use a package version or dist-tag such as latest, 1.10.0, or next."
70
+ "Invalid --cli-version value. Use a package version or dist-tag such as latest, 2.0.0, or next."
66
71
  );
67
72
  }
68
73
  return `@decantr/cli@${versionToken}`;
@@ -531,9 +536,22 @@ async function cmdHealth(projectRoot = process.cwd(), options = {}) {
531
536
  }
532
537
  return;
533
538
  }
539
+ const startedAt = Date.now();
534
540
  const report = await createProjectHealthReport(projectRoot);
535
541
  if (options.promptId) {
536
542
  const finding = report.findings.find((entry) => entry.id === options.promptId);
543
+ await sendProjectHealthReportTelemetry({
544
+ ci: options.ci ?? false,
545
+ durationMs: Date.now() - startedAt,
546
+ projectRoot,
547
+ report
548
+ });
549
+ await sendProjectHealthPromptTelemetry({
550
+ ci: options.ci ?? false,
551
+ finding,
552
+ projectRoot,
553
+ report
554
+ });
537
555
  if (!finding) {
538
556
  console.error(`${RED}No health finding found for id: ${options.promptId}${RESET}`);
539
557
  process.exitCode = 1;
@@ -543,6 +561,7 @@ async function cmdHealth(projectRoot = process.cwd(), options = {}) {
543
561
  return;
544
562
  }
545
563
  const format = resolveFormat(options);
564
+ const failOn = options.failOn ?? "error";
546
565
  const payload = format === "json" ? formatProjectHealthJson(report) : format === "markdown" ? formatProjectHealthMarkdown(report) : formatProjectHealthText(report);
547
566
  if (options.output) {
548
567
  writeFileSync(options.output, payload, "utf-8");
@@ -552,7 +571,27 @@ async function cmdHealth(projectRoot = process.cwd(), options = {}) {
552
571
  } else {
553
572
  process.stdout.write(payload);
554
573
  }
555
- if (options.ci && shouldFailHealth(report, options.failOn ?? "error")) {
574
+ await sendProjectHealthReportTelemetry({
575
+ ci: options.ci ?? false,
576
+ durationMs: Date.now() - startedAt,
577
+ failOn,
578
+ format,
579
+ outputWritten: Boolean(options.output),
580
+ projectRoot,
581
+ report
582
+ });
583
+ if (options.ci && shouldFailHealth(report, failOn)) {
584
+ if (failOn !== "none") {
585
+ await sendProjectHealthCiFailedTelemetry({
586
+ ci: true,
587
+ durationMs: Date.now() - startedAt,
588
+ failOn,
589
+ format,
590
+ outputWritten: Boolean(options.output),
591
+ projectRoot,
592
+ report
593
+ });
594
+ }
556
595
  process.exitCode = 1;
557
596
  }
558
597
  }