@workscribe/cli 1.15.3 → 1.15.4
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 +18 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -282,6 +282,10 @@ function getLastEvent() {
|
|
|
282
282
|
const stmt = db.prepare("SELECT * FROM events ORDER BY id DESC LIMIT 1");
|
|
283
283
|
return stmt.get();
|
|
284
284
|
}
|
|
285
|
+
function getLastEventForCwd(cwd) {
|
|
286
|
+
const db = getDb();
|
|
287
|
+
return db.prepare("SELECT * FROM events WHERE cwd = $cwd ORDER BY id DESC LIMIT 1").get({ cwd });
|
|
288
|
+
}
|
|
285
289
|
function getEventsForDate(date) {
|
|
286
290
|
const db = getDb();
|
|
287
291
|
const stmt = db.prepare(`
|
|
@@ -1360,11 +1364,12 @@ var init_filter = __esm({
|
|
|
1360
1364
|
});
|
|
1361
1365
|
|
|
1362
1366
|
// src/capture/ide.ts
|
|
1363
|
-
var IDE_DEDUP_WINDOW_MS;
|
|
1367
|
+
var IDE_DEDUP_WINDOW_MS, TASK_RUN_DEDUP_WINDOW_MS;
|
|
1364
1368
|
var init_ide = __esm({
|
|
1365
1369
|
"src/capture/ide.ts"() {
|
|
1366
1370
|
"use strict";
|
|
1367
1371
|
IDE_DEDUP_WINDOW_MS = 3e4;
|
|
1372
|
+
TASK_RUN_DEDUP_WINDOW_MS = 5e3;
|
|
1368
1373
|
}
|
|
1369
1374
|
});
|
|
1370
1375
|
|
|
@@ -1381,6 +1386,13 @@ function captureCommand(opts) {
|
|
|
1381
1386
|
if (Date.now() - lastTime < IDE_DEDUP_WINDOW_MS) return;
|
|
1382
1387
|
}
|
|
1383
1388
|
}
|
|
1389
|
+
if (opts.type === "task_run") {
|
|
1390
|
+
const lastForCwd = getLastEventForCwd(cwd);
|
|
1391
|
+
if (lastForCwd && !lastForCwd.source) {
|
|
1392
|
+
const lastTime = new Date(lastForCwd.captured_at).getTime();
|
|
1393
|
+
if (Date.now() - lastTime < TASK_RUN_DEDUP_WINDOW_MS) return;
|
|
1394
|
+
}
|
|
1395
|
+
}
|
|
1384
1396
|
const command2 = opts.command ?? opts.file ?? opts.type;
|
|
1385
1397
|
const nameOverride2 = config.projects?.[cwd] ?? null;
|
|
1386
1398
|
const { repoName: repoName2, branch: branch2 } = getGitContext(cwd, nameOverride2, config.git.qualifyRepoName);
|
|
@@ -4133,7 +4145,7 @@ function registerBugReport(program) {
|
|
|
4133
4145
|
const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
4134
4146
|
const reportPath = import_path17.default.join(WORKSCRIBE_DIR, `bug-report-${timestamp}.txt`);
|
|
4135
4147
|
const systemInfo = [
|
|
4136
|
-
`Workscribe version : ${"1.15.
|
|
4148
|
+
`Workscribe version : ${"1.15.4"}`,
|
|
4137
4149
|
`Node.js version : ${process.version}`,
|
|
4138
4150
|
`Platform : ${process.platform}`,
|
|
4139
4151
|
`Architecture : ${process.arch}`,
|
|
@@ -4164,7 +4176,7 @@ function registerBugReport(program) {
|
|
|
4164
4176
|
process.exit(1);
|
|
4165
4177
|
}
|
|
4166
4178
|
const params = new URLSearchParams({
|
|
4167
|
-
title: `Bug report \u2014 workscribe ${"1.15.
|
|
4179
|
+
title: `Bug report \u2014 workscribe ${"1.15.4"}`,
|
|
4168
4180
|
body: `<!-- Attach ${import_path17.default.basename(reportPath)} or paste the relevant sections below -->
|
|
4169
4181
|
|
|
4170
4182
|
**Describe the issue:**
|
|
@@ -4364,7 +4376,7 @@ function isNewer(latest, current) {
|
|
|
4364
4376
|
return latestPatch > currentPatch;
|
|
4365
4377
|
}
|
|
4366
4378
|
function checkForUpdate() {
|
|
4367
|
-
const current = "1.15.
|
|
4379
|
+
const current = "1.15.4";
|
|
4368
4380
|
const cache = readCache();
|
|
4369
4381
|
if (cache && isNewer(cache.latestVersion, current)) {
|
|
4370
4382
|
process.stderr.write(
|
|
@@ -4387,7 +4399,7 @@ function checkForUpdate() {
|
|
|
4387
4399
|
function buildTelemetryPayload(config) {
|
|
4388
4400
|
return {
|
|
4389
4401
|
installId: config.telemetry.installId,
|
|
4390
|
-
cliVersion: "1.15.
|
|
4402
|
+
cliVersion: "1.15.4",
|
|
4391
4403
|
platform: import_os10.default.platform(),
|
|
4392
4404
|
nodeVersion: process.version
|
|
4393
4405
|
};
|
|
@@ -4462,7 +4474,7 @@ var require_main = __commonJS({
|
|
|
4462
4474
|
pingTelemetry();
|
|
4463
4475
|
}
|
|
4464
4476
|
var program = new import_commander.Command();
|
|
4465
|
-
program.name("workscribe").description("Automatic developer work journal").version("1.15.
|
|
4477
|
+
program.name("workscribe").description("Automatic developer work journal").version("1.15.4");
|
|
4466
4478
|
registerCapture(program);
|
|
4467
4479
|
registerHook(program);
|
|
4468
4480
|
registerInit(program);
|