@yhong91/vibetime 0.1.59 → 0.1.60

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 +15 -4
  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.59" : "0.1.1";
2050
+ var PACKAGE_VERSION = true ? "0.1.60" : "0.1.1";
2051
2051
  var GENERATED_MARKER = "Generated by vibetime.";
2052
2052
  var DEFAULT_API_URL = "http://121.196.224.82:3001";
2053
2053
  var DEFAULT_BACKFILL_BATCH_SIZE = 50;
@@ -2065,8 +2065,15 @@ function parseJsonLine(line) {
2065
2065
  }
2066
2066
  }
2067
2067
  function timestampFrom(value) {
2068
- if (typeof value === "string" && !Number.isNaN(Date.parse(value))) {
2069
- return value;
2068
+ if (typeof value === "string") {
2069
+ const trimmed = value.trim();
2070
+ if (/^\d+(\.\d+)?$/.test(trimmed)) {
2071
+ return timestampFrom(Number(trimmed));
2072
+ }
2073
+ if (!Number.isNaN(Date.parse(trimmed))) {
2074
+ return trimmed;
2075
+ }
2076
+ return void 0;
2070
2077
  }
2071
2078
  if (typeof value !== "number" || !Number.isFinite(value)) {
2072
2079
  return void 0;
@@ -6441,10 +6448,14 @@ function cursorCloudEventFromDashboard(event) {
6441
6448
  if (tokensInput <= 0 && tokensOutput <= 0 && tokensCacheReadInput <= 0 && tokensCacheCreationInput <= 0) {
6442
6449
  return void 0;
6443
6450
  }
6451
+ const ts = timestampFrom(event.timestamp);
6452
+ if (!ts) {
6453
+ return void 0;
6454
+ }
6444
6455
  return {
6445
6456
  conversationId,
6446
6457
  model: stringField(event, "model") || void 0,
6447
- ts: timestampFrom(event.timestamp) || (/* @__PURE__ */ new Date(0)).toISOString(),
6458
+ ts,
6448
6459
  tokensInput,
6449
6460
  tokensOutput,
6450
6461
  tokensCacheReadInput,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@yhong91/vibetime",
3
3
  "type": "module",
4
- "version": "0.1.59",
4
+ "version": "0.1.60",
5
5
  "description": "vibetime CLI — install AI-agent hooks (Claude Code, Codex, OpenCode, Pi, Cursor) and report activity to vibetime.",
6
6
  "license": "MIT",
7
7
  "publishConfig": {