nairon-bench 0.0.32 → 0.0.34

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 +21 -16
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -14707,15 +14707,13 @@ async function collectGitCommits(projectDir, since, until) {
14707
14707
  if (!await git.checkIsRepo()) {
14708
14708
  return [];
14709
14709
  }
14710
- const log = await git.log({
14711
- "--since": since.toISOString(),
14712
- "--until": until.toISOString(),
14713
- "--stat": null,
14714
- "--name-only": null
14715
- });
14710
+ const log = await git.log([
14711
+ `--since=${since.toISOString()}`,
14712
+ `--until=${until.toISOString()}`,
14713
+ "--stat"
14714
+ ]);
14716
14715
  return log.all.map((entry) => {
14717
14716
  const diff = entry.diff;
14718
- const message = entry.message.toLowerCase();
14719
14717
  const isAIAssisted = detectAIAssistedCommit(entry.message);
14720
14718
  return {
14721
14719
  hash: entry.hash,
@@ -14959,13 +14957,25 @@ function collectOpenCodeSessions2(openCodeDir, since, until) {
14959
14957
  } catch {}
14960
14958
  }
14961
14959
  }
14960
+ const msgTokens = msgData.tokens || {};
14961
+ const msgInputTokens = msgTokens.input || 0;
14962
+ const msgOutputTokens = (msgTokens.output || 0) + (msgTokens.reasoning || 0);
14963
+ const msgTotalTokens = msgInputTokens + msgOutputTokens;
14962
14964
  if (msgData.role === "user" && messageText.trim()) {
14963
14965
  const prompt2 = analyzePrompt(messageText, sessionId, prompts.length, msgTime);
14964
14966
  prompts.push(prompt2);
14967
+ const userTokens = msgInputTokens || Math.ceil(messageText.length / 4);
14968
+ inputTokens += userTokens;
14969
+ totalTokens += userTokens;
14965
14970
  }
14966
- if (msgData.role === "assistant" && messageText.trim()) {
14967
- const response = analyzeResponse(messageText, sessionId, responses.length, prompts[prompts.length - 1]?.id ?? "", msgTime);
14968
- responses.push(response);
14971
+ if (msgData.role === "assistant") {
14972
+ if (messageText.trim()) {
14973
+ const response = analyzeResponse(messageText, sessionId, responses.length, prompts[prompts.length - 1]?.id ?? "", msgTime);
14974
+ responses.push(response);
14975
+ }
14976
+ inputTokens += msgInputTokens;
14977
+ outputTokens += msgOutputTokens;
14978
+ totalTokens += msgTotalTokens;
14969
14979
  if (messageText.includes("Write ") || messageText.includes("Created ")) {
14970
14980
  const fileMatches = messageText.match(/(?:Write|Created|Updated)\s+(\S+\.\w+)/g);
14971
14981
  if (fileMatches) {
@@ -14977,11 +14987,6 @@ function collectOpenCodeSessions2(openCodeDir, since, until) {
14977
14987
  }
14978
14988
  }
14979
14989
  }
14980
- if (msgData.usage) {
14981
- totalTokens += msgData.usage.totalTokens || 0;
14982
- inputTokens += msgData.usage.inputTokens || 0;
14983
- outputTokens += msgData.usage.outputTokens || 0;
14984
- }
14985
14990
  } catch {}
14986
14991
  }
14987
14992
  }
@@ -23049,7 +23054,7 @@ var setupCommand = defineCommand2({
23049
23054
  // package.json
23050
23055
  var package_default = {
23051
23056
  name: "nairon-bench",
23052
- version: "0.0.32",
23057
+ version: "0.0.34",
23053
23058
  description: "AI workflow benchmarking CLI",
23054
23059
  type: "module",
23055
23060
  bin: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nairon-bench",
3
- "version": "0.0.32",
3
+ "version": "0.0.34",
4
4
  "description": "AI workflow benchmarking CLI",
5
5
  "type": "module",
6
6
  "bin": {