meksus 0.6.0 → 0.6.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meksus",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "M.E.K.S.U.S. CLI: see what your AI coding agents (Claude Code) and builds are doing, live, and get Discord alerts when they fail or need you. Status only: code, prompts and output never leave your machine.",
5
5
  "keywords": [
6
6
  "meksus",
package/src/hooks.mjs CHANGED
@@ -26,6 +26,16 @@ export function sessionKey(agent, id) {
26
26
  return createHash("sha256").update(`${agent}:${id}`).digest("hex").slice(0, 32); // never the raw id
27
27
  }
28
28
 
29
+ /** Where Claude Code runs, from the CLAUDE_CODE_ENTRYPOINT it sets for hooks: "cli" is the terminal (the only
30
+ * surface that runs the status line, so the only one with live plan limits); IDE panels and the SDK aren't. */
31
+ export function surfaceOf(entrypoint = process.env.CLAUDE_CODE_ENTRYPOINT) {
32
+ if (typeof entrypoint !== "string" || !entrypoint) return null;
33
+ if (entrypoint === "cli") return "terminal";
34
+ if (/vscode|jetbrains|cursor|windsurf|zed|ide|desktop/i.test(entrypoint)) return "ide";
35
+ if (/^sdk|headless|print/i.test(entrypoint)) return "sdk";
36
+ return "other";
37
+ }
38
+
29
39
  /** Maps one Claude Code hook payload to a status line (or null to ignore). Exported for tests. */
30
40
  export function toStatus(input, now = new Date(), agent = "claude-code") {
31
41
  const name = input?.hook_event_name;
@@ -41,6 +51,7 @@ export function toStatus(input, now = new Date(), agent = "claude-code") {
41
51
  at: now.toISOString(),
42
52
  // Token usage is read from Claude Code's transcript format; Codex reports its model name instead.
43
53
  transcript: agent === "claude-code" && typeof input.transcript_path === "string" ? input.transcript_path : null,
54
+ ...(agent === "claude-code" && surfaceOf() ? { surface: surfaceOf() } : {}),
44
55
  ...(agent === "codex" && typeof input.model === "string" && /^[a-z0-9][a-z0-9.\-]{0,62}$/.test(input.model) ? { model: input.model } : {}),
45
56
  };
46
57
  switch (name) {
package/src/spool.mjs CHANGED
@@ -74,6 +74,7 @@ export function aggregate(events) {
74
74
  if (e.transcript) cur.transcript = e.transcript;
75
75
  if (e.turn) cur.turn = e.turn;
76
76
  if (e.model) cur.model = e.model; // Codex names its model in every hook call
77
+ if (e.surface) cur.surface = e.surface; // terminal / ide / sdk (Claude Code's entrypoint)
77
78
  if (e.started_at && e.started_at < cur.started_at) cur.started_at = e.started_at;
78
79
  if (typeof e.task === "string") {
79
80
  Object.assign(cur, { task: e.task, task_source: e.task_source, task_done: e.task_done ?? 0, task_total: e.task_total ?? 0, task_at: e.at });