embertime 0.1.2 → 0.1.3
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/.claude-plugin/plugin.json +1 -1
- package/README.md +2 -1
- package/cli.mjs +1 -1
- package/ember-hook.mjs +10 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,7 +5,8 @@ Cursor Agent** with one command. Your time shows up on
|
|
|
5
5
|
[Ember](https://ember-dev.vercel.app) as a yearly heatmap, language stats and a
|
|
6
6
|
developer leaderboard.
|
|
7
7
|
|
|
8
|
-
Ember records **when** and **in which project** you code.
|
|
8
|
+
Ember records **when** and **in which project** you write code. Only writing counts:
|
|
9
|
+
an editor or agent that is just open adds no time. It never sends your
|
|
9
10
|
code, file contents, file paths or AI prompts.
|
|
10
11
|
|
|
11
12
|
## Setup
|
package/cli.mjs
CHANGED
|
@@ -128,7 +128,7 @@ async function setup(o) {
|
|
|
128
128
|
results.push([e.name, r.status === 0 ? 'extension installed (restart the editor)' : `install failed: ${why}`, r.status === 0]);
|
|
129
129
|
}
|
|
130
130
|
if (editors.length === 0) {
|
|
131
|
-
results.push(['Editors', 'none found. In VS Code, Cursor or Windsurf, open Extensions and install
|
|
131
|
+
results.push(['Editors', 'none found. In VS Code, Cursor or Windsurf, open Extensions, search "embertime" and install it']);
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
|
package/ember-hook.mjs
CHANGED
|
@@ -21,7 +21,7 @@ import path from 'node:path';
|
|
|
21
21
|
import crypto from 'node:crypto';
|
|
22
22
|
import { fileURLToPath } from 'node:url';
|
|
23
23
|
|
|
24
|
-
export const VERSION = '0.1.
|
|
24
|
+
export const VERSION = '0.1.3';
|
|
25
25
|
export const AGENTS = ['claude-code', 'codex', 'cursor-agent'];
|
|
26
26
|
|
|
27
27
|
/** Events whose heartbeats are throttled: they fire on every tool call or file edit. */
|
|
@@ -759,6 +759,15 @@ export async function runHook({ argv = [], env = process.env, stdinText = '' } =
|
|
|
759
759
|
const payload = parsePayload(stdinText);
|
|
760
760
|
const event = typeof payload.hook_event_name === 'string' ? payload.hook_event_name : '';
|
|
761
761
|
const hb = buildHeartbeat(payload, { agent, env });
|
|
762
|
+
const { apiUrl, apiKey } = loadConfig(home, env);
|
|
763
|
+
|
|
764
|
+
// Only an agent changing a file counts as coding. Opening a session,
|
|
765
|
+
// sending a prompt or reading files does not; those events just deliver
|
|
766
|
+
// anything still queued.
|
|
767
|
+
if (!hb.is_write) {
|
|
768
|
+
await flushQueue(home, { apiUrl, apiKey });
|
|
769
|
+
return { status: 'not-writing' };
|
|
770
|
+
}
|
|
762
771
|
|
|
763
772
|
const state = readState(home);
|
|
764
773
|
if (shouldThrottle(state, hb, event)) return { status: 'throttled' };
|
|
@@ -766,7 +775,6 @@ export async function runHook({ argv = [], env = process.env, stdinText = '' } =
|
|
|
766
775
|
writeState(home, state);
|
|
767
776
|
|
|
768
777
|
appendToQueue(home, hb);
|
|
769
|
-
const { apiUrl, apiKey } = loadConfig(home, env);
|
|
770
778
|
return await flushQueue(home, { apiUrl, apiKey });
|
|
771
779
|
} catch (e) {
|
|
772
780
|
log(home, 'error', `hook failed: ${e?.stack || e}`);
|
package/package.json
CHANGED