nairon-bench 0.0.33 → 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 -21
  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,18 +14957,25 @@ function collectOpenCodeSessions2(openCodeDir, since, until) {
14959
14957
  } catch {}
14960
14958
  }
14961
14959
  }
14962
- const estimatedMsgTokens = Math.ceil(messageText.length / 4);
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;
14963
14964
  if (msgData.role === "user" && messageText.trim()) {
14964
14965
  const prompt2 = analyzePrompt(messageText, sessionId, prompts.length, msgTime);
14965
14966
  prompts.push(prompt2);
14966
- inputTokens += estimatedMsgTokens;
14967
- totalTokens += estimatedMsgTokens;
14967
+ const userTokens = msgInputTokens || Math.ceil(messageText.length / 4);
14968
+ inputTokens += userTokens;
14969
+ totalTokens += userTokens;
14968
14970
  }
14969
- if (msgData.role === "assistant" && messageText.trim()) {
14970
- const response = analyzeResponse(messageText, sessionId, responses.length, prompts[prompts.length - 1]?.id ?? "", msgTime);
14971
- responses.push(response);
14972
- outputTokens += estimatedMsgTokens;
14973
- totalTokens += estimatedMsgTokens;
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;
14974
14979
  if (messageText.includes("Write ") || messageText.includes("Created ")) {
14975
14980
  const fileMatches = messageText.match(/(?:Write|Created|Updated)\s+(\S+\.\w+)/g);
14976
14981
  if (fileMatches) {
@@ -14982,11 +14987,6 @@ function collectOpenCodeSessions2(openCodeDir, since, until) {
14982
14987
  }
14983
14988
  }
14984
14989
  }
14985
- if (msgData.usage) {
14986
- totalTokens += msgData.usage.totalTokens || 0;
14987
- inputTokens += msgData.usage.inputTokens || 0;
14988
- outputTokens += msgData.usage.outputTokens || 0;
14989
- }
14990
14990
  } catch {}
14991
14991
  }
14992
14992
  }
@@ -23054,7 +23054,7 @@ var setupCommand = defineCommand2({
23054
23054
  // package.json
23055
23055
  var package_default = {
23056
23056
  name: "nairon-bench",
23057
- version: "0.0.33",
23057
+ version: "0.0.34",
23058
23058
  description: "AI workflow benchmarking CLI",
23059
23059
  type: "module",
23060
23060
  bin: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nairon-bench",
3
- "version": "0.0.33",
3
+ "version": "0.0.34",
4
4
  "description": "AI workflow benchmarking CLI",
5
5
  "type": "module",
6
6
  "bin": {