Lines 105-180javascript
105 const entryPath = path3.join(rootPath, entry.name);
106 if (entry.isDirectory()) {
107 return listFilesByExtensions(entryPath, extensions);
109 return entry.isFile() && extensions.some((ext) => entry.name.endsWith(ext)) ? [entryPath] : [];
111 return files.flat().sort();
113async function countDirectoryEntries(candidatePath) {
115 const info = await stat(candidatePath);
116 if (!info.isDirectory()) {
117 if (candidatePath.endsWith(".jsonl")) {
118 const text = await readFile(candidatePath, "utf8");
119 return text.split("\n").filter(Boolean).length;
121 if (candidatePath.endsWith(".json")) {
124 if (candidatePath.endsWith(".db")) {
126 const { DatabaseSync } = await import("node:sqlite");
127 const db = new DatabaseSync(candidatePath, { readOnly: true });
MediumDynamic Require
Package source references dynamic require/import behavior.
bin/vibetime.mjsView on unpkg · L125 129 const result = db.prepare(
130 "SELECT count(*) as cnt FROM session WHERE time_created IS NOT NULL"
132 return result?.cnt || 0;
142 const files = await listFilesByExtensions(candidatePath, [".jsonl", ".json"]);
145 if (error.code === "ENOENT") {
151var GENERATED_MARKER, LEGACY_GENERATED_MARKER;
155 GENERATED_MARKER = "Generated by vibetime.";
156 LEGACY_GENERATED_MARKER = "Generated by codetime.";
161import { spawn as spawn2, spawnSync } from "node:child_process";
162import { mkdir as mkdir5, open, rm, stat as stat13, writeFile as writeFile4 } from "node:fs/promises";
163import os9 from "node:os";
164import path22 from "node:path";
165import { fileURLToPath } from "node:url";
167// ../shared/src/index.ts
168import { createHash } from "node:crypto";
169var AGENT_TIME_SCHEMA_VERSION = "2026-04-29";
170var TELEMETRY_EVENT_TYPES = [
173 "session.status_changed",