@yhong91/vibetime 0.1.45 → 0.1.46

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/bin/vibetime.mjs +24 -2
  2. package/package.json +1 -1
package/bin/vibetime.mjs CHANGED
@@ -2047,7 +2047,7 @@ function claudeStyleFileMetrics(tool, input) {
2047
2047
  }
2048
2048
 
2049
2049
  // src/lib/constants.ts
2050
- var PACKAGE_VERSION = true ? "0.1.45" : "0.1.1";
2050
+ var PACKAGE_VERSION = true ? "0.1.46" : "0.1.1";
2051
2051
  var DEFAULT_API_URL = "http://121.196.224.82:3001";
2052
2052
  var DEFAULT_BACKFILL_BATCH_SIZE = 50;
2053
2053
  var DEFAULT_BACKFILL_BATCH_BYTES = 800 * 1024;
@@ -6949,6 +6949,7 @@ async function parseOpenCodeSessionFile(dbPath, options) {
6949
6949
  }
6950
6950
  const filePath = stringField(stateInput, "file_path") || stringField(stateInput, "filePath");
6951
6951
  if (filePath) {
6952
+ const lineStats = opencodeLineStats(tool, state, stateInput);
6952
6953
  events.push(baseOpenCodeEvent({
6953
6954
  ts: msToIso(endMs || completedTs || createdTs),
6954
6955
  type: toolFileActivityType(tool),
@@ -6963,8 +6964,10 @@ async function parseOpenCodeSessionFile(dbPath, options) {
6963
6964
  fileActivities: [{
6964
6965
  ts: msToIso(endMs || completedTs || createdTs),
6965
6966
  path: filePath,
6966
- operation: operationForTool(tool)
6967
+ operation: operationForTool(tool),
6968
+ ...lineStats
6967
6969
  }],
6970
+ metrics: lineStats.linesAdded || lineStats.linesRemoved ? lineStats : void 0,
6968
6971
  refs: stringRefs({ sourceId: callId })
6969
6972
  }, assistantAgent));
6970
6973
  }
@@ -7087,6 +7090,25 @@ function baseOpenCodeEvent(event, agentName) {
7087
7090
  ...event
7088
7091
  };
7089
7092
  }
7093
+ function opencodeLineStats(tool, state, input) {
7094
+ const diff = stringField(objectField(state, "metadata"), "diff");
7095
+ if (diff) {
7096
+ return diffStats(diff);
7097
+ }
7098
+ const normalized = tool.toLowerCase();
7099
+ if (normalized === "write") {
7100
+ return { linesAdded: countTextLines(stringField(input, "content")) };
7101
+ }
7102
+ if (normalized === "edit" || normalized === "multiedit" || normalized === "patch") {
7103
+ const newString = stringField(input, "newString") || stringField(input, "new_string");
7104
+ const oldString = stringField(input, "oldString") || stringField(input, "old_string");
7105
+ return {
7106
+ linesAdded: countTextLines(newString),
7107
+ linesRemoved: countTextLines(oldString)
7108
+ };
7109
+ }
7110
+ return {};
7111
+ }
7090
7112
  function opencodeUsageFromInfo(info) {
7091
7113
  const tokensObj = objectField(info, "tokens");
7092
7114
  if (!tokensObj) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@yhong91/vibetime",
3
3
  "type": "module",
4
- "version": "0.1.45",
4
+ "version": "0.1.46",
5
5
  "description": "vibetime CLI — install AI-agent hooks (Claude Code, Codex, OpenCode, Pi) and report activity to vibetime.",
6
6
  "license": "MIT",
7
7
  "publishConfig": {