ccclub 0.2.39 → 0.2.40
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.
- package/dist/index.js +10 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -18,8 +18,8 @@ import { randomBytes } from "crypto";
|
|
|
18
18
|
import { execSync } from "child_process";
|
|
19
19
|
|
|
20
20
|
// ../shared/dist/constants.js
|
|
21
|
-
var
|
|
22
|
-
var BLOCK_DURATION_MS =
|
|
21
|
+
var BLOCK_DURATION_MIN = 30;
|
|
22
|
+
var BLOCK_DURATION_MS = BLOCK_DURATION_MIN * 60 * 1e3;
|
|
23
23
|
var DEFAULT_API_URL = "https://ccclub.dev";
|
|
24
24
|
var CLAUDE_PROJECTS_DIR = ".claude/projects";
|
|
25
25
|
var CCCLUB_CONFIG_DIR = ".ccclub";
|
|
@@ -282,16 +282,17 @@ async function collectUsageEntries() {
|
|
|
282
282
|
}
|
|
283
283
|
|
|
284
284
|
// src/aggregator.ts
|
|
285
|
-
function
|
|
285
|
+
function floorToBlock(date) {
|
|
286
286
|
const floored = new Date(date);
|
|
287
|
-
floored.
|
|
287
|
+
const min = floored.getUTCMinutes();
|
|
288
|
+
floored.setUTCMinutes(min - min % 30, 0, 0);
|
|
288
289
|
return floored;
|
|
289
290
|
}
|
|
290
291
|
function aggregateToBlocks(entries, humanTurns = []) {
|
|
291
292
|
if (entries.length === 0) return [];
|
|
292
293
|
const humanTurnMs = humanTurns.map((t) => new Date(t).getTime());
|
|
293
294
|
const blocks = [];
|
|
294
|
-
let blockStart =
|
|
295
|
+
let blockStart = floorToBlock(new Date(entries[0].timestamp));
|
|
295
296
|
let blockEnd = new Date(blockStart.getTime() + BLOCK_DURATION_MS);
|
|
296
297
|
let currentBlock = [];
|
|
297
298
|
let humanIdx = 0;
|
|
@@ -364,7 +365,7 @@ function aggregateToBlocks(entries, humanTurns = []) {
|
|
|
364
365
|
}
|
|
365
366
|
|
|
366
367
|
// src/commands/sync.ts
|
|
367
|
-
var SYNC_FORMAT_VERSION = "
|
|
368
|
+
var SYNC_FORMAT_VERSION = "6";
|
|
368
369
|
function getSyncVersionPath() {
|
|
369
370
|
return join4(homedir4(), CCCLUB_CONFIG_DIR, "sync-version");
|
|
370
371
|
}
|
|
@@ -854,7 +855,7 @@ async function printActivity(apiUrl, code, range) {
|
|
|
854
855
|
if (active.length === 0) return;
|
|
855
856
|
const startMs = new Date(data.start).getTime();
|
|
856
857
|
const endMs = new Date(data.end).getTime();
|
|
857
|
-
const bucketCount = range === "24h" ?
|
|
858
|
+
const bucketCount = range === "24h" ? 48 : range === "7d" ? 28 : 30;
|
|
858
859
|
const bucketMs = (endMs - startMs) / bucketCount;
|
|
859
860
|
const allBuckets = [];
|
|
860
861
|
for (const user of active) {
|
|
@@ -986,7 +987,7 @@ async function profileCommand(options) {
|
|
|
986
987
|
import chalk7 from "chalk";
|
|
987
988
|
async function showDataCommand() {
|
|
988
989
|
console.log(chalk7.bold("\n What CCClub uploads:\n"));
|
|
989
|
-
console.log(chalk7.dim(" Only aggregated
|
|
990
|
+
console.log(chalk7.dim(" Only aggregated 30-minute block summaries. No conversation content,"));
|
|
990
991
|
console.log(chalk7.dim(" no file paths, no project names, no session details.\n"));
|
|
991
992
|
const { entries, humanTurns } = await collectUsageEntries();
|
|
992
993
|
const blocks = aggregateToBlocks(entries, humanTurns);
|
|
@@ -1081,7 +1082,7 @@ async function hookCommand() {
|
|
|
1081
1082
|
}
|
|
1082
1083
|
|
|
1083
1084
|
// src/index.ts
|
|
1084
|
-
var VERSION = "0.2.
|
|
1085
|
+
var VERSION = "0.2.40";
|
|
1085
1086
|
startUpdateCheck(VERSION);
|
|
1086
1087
|
var program = new Command();
|
|
1087
1088
|
program.name("ccclub").description("CCClub - Compare Claude Code usage with friends").version(VERSION);
|