caveat-cli 0.20.0 → 0.20.2

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 CHANGED
@@ -42,10 +42,12 @@ import {
42
42
  listRecent,
43
43
  listStale,
44
44
  loadConfig,
45
+ localHookDiagnostics,
45
46
  logHookQueryMiss,
46
47
  markHit,
47
48
  maybeSweepPendingDirs,
48
49
  nodeExecutableNames,
50
+ observeHookDiagnostic,
49
51
  observeRuntimeError,
50
52
  openDb,
51
53
  peekPendingRemindersDetailed,
@@ -82,7 +84,7 @@ import {
82
84
  writeDigestMarker,
83
85
  writeJevObservation,
84
86
  writeUserConfigPatch
85
- } from "./chunk-G52CLPRY.js";
87
+ } from "./chunk-JYXVT46B.js";
86
88
 
87
89
  // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/code.js
88
90
  var require_code = __commonJS({
@@ -8402,7 +8404,7 @@ function runStats(ctx) {
8402
8404
 
8403
8405
  // src/commands/serve.ts
8404
8406
  async function runServe(opts) {
8405
- const { startServer } = await import("./server-2D6JIHWY.js");
8407
+ const { startServer } = await import("./server-XI7ZOMPY.js");
8406
8408
  const { port, host } = startServer({ port: opts.port });
8407
8409
  process.stdout.write(`[caveat] web portal: http://${host}:${port}/
8408
8410
  `);
@@ -32942,13 +32944,14 @@ async function readStdin() {
32942
32944
  for await (const chunk of process.stdin) {
32943
32945
  chunks.push(typeof chunk === "string" ? Buffer.from(chunk) : chunk);
32944
32946
  }
32945
- return Buffer.concat(chunks).toString("utf-8");
32947
+ return Buffer.concat(chunks).toString("utf-8").replace(/^\uFEFF/, "");
32946
32948
  }
32947
32949
  function errorMessage4(err) {
32948
32950
  return err instanceof Error ? err.message : String(err);
32949
32951
  }
32950
32952
  function reportHookError(host, phase, err) {
32951
32953
  observeRuntimeError(host.errorCode, { version: CAVEAT_VERSION });
32954
+ observeHookDiagnostic(host.errorCode, phase, err, { version: CAVEAT_VERSION });
32952
32955
  process.stderr.write(`[${host.stderrTag}] ${phase}: ${errorMessage4(err)}
32953
32956
  `);
32954
32957
  try {
@@ -34776,6 +34779,7 @@ function runRuntimeErrors(action, value, opts = {}) {
34776
34779
  const runtime = { version: CAVEAT_VERSION };
34777
34780
  if (action === "snapshot") return runtimeErrorsSnapshot(opts.afterCursor ?? 0, opts.limit ?? 256, runtime);
34778
34781
  if (action === "diagnostics") return runtimeErrorsDiagnostics(runtime);
34782
+ if (action === "hook-details") return localHookDiagnostics(runtime);
34779
34783
  if (action === "report-status") return runtimeErrorReportStatus(runtime);
34780
34784
  if (action === "ack") return acknowledgeRuntimeErrors(parseCursor(value), runtime);
34781
34785
  if (action === "resolve") return setRuntimeErrorStatus(value ?? "", "resolved", runtime);
@@ -34871,7 +34875,7 @@ runtimeErrors.command("snapshot").requiredOption("--json", "emit JSON").option("
34871
34875
  process.stdout.write(`${JSON.stringify(runRuntimeErrors("snapshot", void 0, opts))}
34872
34876
  `);
34873
34877
  });
34874
- for (const action of ["diagnostics", "compact", "report-status"]) runtimeErrors.command(action).requiredOption("--json", "emit JSON").action(() => {
34878
+ for (const action of ["diagnostics", "compact", "report-status", "hook-details"]) runtimeErrors.command(action).requiredOption("--json", "emit JSON").action(() => {
34875
34879
  process.stdout.write(`${JSON.stringify(runRuntimeErrors(action))}
34876
34880
  `);
34877
34881
  });