commit-whisper 1.0.6 → 1.0.7

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.
Files changed (2) hide show
  1. package/dist/index.js +17 -12
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1185,7 +1185,8 @@ function quoteArg(value) {
1185
1185
  if (value !== "" && /^[A-Za-z0-9_./:@%+=-]+$/.test(value)) {
1186
1186
  return value;
1187
1187
  }
1188
- return `'${value.replace(/'/g, "'\\''")}'`;
1188
+ const escaped = value.replaceAll("'", String.raw`'\''`);
1189
+ return `'${escaped}'`;
1189
1190
  }
1190
1191
  function interpretLimit(raw) {
1191
1192
  const trimmed = raw.trim();
@@ -1821,10 +1822,10 @@ function pad(n, width) {
1821
1822
  // src/analyze/groups/a-cadence.ts
1822
1823
  var DORMANT_GAP_SECONDS = 14 * 24 * 3600;
1823
1824
  function minOf(values) {
1824
- return values.reduce((m, v) => v < m ? v : m, values[0]);
1825
+ return values.reduce((m, v) => Math.min(v, m), values[0]);
1825
1826
  }
1826
1827
  function maxOf(values) {
1827
- return values.reduce((m, v) => v > m ? v : m, values[0]);
1828
+ return values.reduce((m, v) => Math.max(v, m), values[0]);
1828
1829
  }
1829
1830
  var VOLUME = { id: "a-commit-volume", group: "A", title: "Commit volume over time" };
1830
1831
  var CADENCE = { id: "a-commit-cadence", group: "A", title: "Commit frequency / cadence" };
@@ -2199,10 +2200,10 @@ function wordCount(text) {
2199
2200
  return trimmed === "" ? 0 : trimmed.split(/\s+/).length;
2200
2201
  }
2201
2202
  function minOf2(values) {
2202
- return values.length === 0 ? 0 : values.reduce((m, v) => v < m ? v : m, values[0]);
2203
+ return values.length === 0 ? 0 : values.reduce((m, v) => Math.min(v, m), values[0]);
2203
2204
  }
2204
2205
  function maxOf3(values) {
2205
- return values.length === 0 ? 0 : values.reduce((m, v) => v > m ? v : m, values[0]);
2206
+ return values.length === 0 ? 0 : values.reduce((m, v) => Math.max(v, m), values[0]);
2206
2207
  }
2207
2208
  function sharePct(part, total) {
2208
2209
  return total === 0 ? 0 : round(part / total * 100);
@@ -5111,23 +5112,27 @@ async function runPipeline(config, deps = {}) {
5111
5112
  const outcome = await narrateOutcome(config, narrateConfig, analysis, narrate, preflightReason);
5112
5113
  const report = reportFromOutcome(analysis, outcome);
5113
5114
  const targets = planOutputs(config.outputFormats, config.outputPath);
5115
+ const htmlFilePath = await emitOutputs(report, targets, { writeStdout: writeStdout2, writeFile: writeFile3, ui: ui2 });
5116
+ if (autoOpen && htmlFilePath !== void 0) {
5117
+ await tryOpen(openBrowser, htmlFilePath, ui2);
5118
+ }
5119
+ return report.degraded ? ExitCode.Degraded : ExitCode.Success;
5120
+ }
5121
+ async function emitOutputs(report, targets, io) {
5114
5122
  let htmlFilePath;
5115
5123
  for (const target of targets) {
5116
5124
  const text = renderOne(report, target);
5117
5125
  if (target.destination.kind === "stdout") {
5118
- writeStdout2(text.endsWith("\n") ? text : `${text}
5126
+ io.writeStdout(text.endsWith("\n") ? text : `${text}
5119
5127
  `);
5120
5128
  } else {
5121
- await writeOne(writeFile3, target.destination.path, text, target.format, ui2);
5129
+ await writeOne(io.writeFile, target.destination.path, text, target.format, io.ui);
5122
5130
  if (target.format === "html") {
5123
5131
  htmlFilePath = target.destination.path;
5124
5132
  }
5125
5133
  }
5126
5134
  }
5127
- if (autoOpen && htmlFilePath !== void 0) {
5128
- await tryOpen(openBrowser, htmlFilePath, ui2);
5129
- }
5130
- return report.degraded ? ExitCode.Degraded : ExitCode.Success;
5135
+ return htmlFilePath;
5131
5136
  }
5132
5137
  function renderOne(report, target) {
5133
5138
  try {
@@ -5237,7 +5242,7 @@ function formatShowConfig(config, secrets) {
5237
5242
  }
5238
5243
 
5239
5244
  // src/cli/version.ts
5240
- var VERSION = "1.0.6";
5245
+ var VERSION = "1.0.7";
5241
5246
 
5242
5247
  // src/cli/cli.ts
5243
5248
  var PROVIDERS3 = ["ollama", "openai", "gemini", "anthropic", "openai-compatible"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "commit-whisper",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "Deterministic git history analysis with a grounded, BYOK AI narrative — terminal-native CLI.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",