claude-rpc 0.9.0 → 0.9.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": "claude-rpc",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "description": "Discord Rich Presence for Claude Code — live model, project, tokens, and lifetime stats driven by Claude Code's hook system.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -21,12 +21,14 @@ export const DEFAULT_CONFIG = {
21
21
  // when Claude isn't open, the Discord presence should disappear quickly.
22
22
  // The SessionEnd hook short-circuits this — see hook.js + format.applyIdle.
23
23
  staleSessionMin: 5,
24
- // When the Claude Code session is still open but its transcript has gone
25
- // quiet (you paused, stepped away briefly), show 'idle' rather than
26
- // clearing the card. Only an authoritative SessionEnd or the full
27
- // staleSessionMin dormancy window drops to stale. Set false to restore the
28
- // old behavior (clear ~90-120s after the last transcript write).
29
- idleWhenOpen: true,
24
+ // Closing the terminal kills Claude Code without firing its SessionEnd hook,
25
+ // so the daemon can't tell "closed" from "paused" it only sees the
26
+ // transcript stop. Default false: clear the card ~90-120s after the
27
+ // transcript goes quiet, so a closed terminal doesn't leave a stale card up.
28
+ // Set true to instead linger as 'idle' until staleSessionMin (keeps the card
29
+ // up through short pauses, at the cost of a closed terminal showing idle for
30
+ // up to staleSessionMin minutes before clearing).
31
+ idleWhenOpen: false,
30
32
  // When true, the daemon CLEARS Discord activity entirely once the state
31
33
  // goes stale — your profile shows nothing instead of an "Away" frame.
32
34
  hideWhenStale: true,
package/src/format.js CHANGED
@@ -736,12 +736,13 @@ export function applyIdle(state, cfg = {}) {
736
736
  const idleMs = (cfg.idleThresholdSec || 60) * 1000;
737
737
  const staleMs = Math.max(60_000, (cfg.staleSessionMin || 5) * 60 * 1000);
738
738
  const notificationMs = (cfg.notificationWindowSec || 8) * 1000;
739
- // When the Claude Code session is still open (no authoritative SessionEnd)
740
- // but its transcript has gone quiet, prefer 'idle' over clearing the card.
741
- // Only an explicit close (claudeClosed) or the staleMs dormancy backstop
742
- // drops us to stale. Default on; set idleWhenOpen:false to restore the old
743
- // aggressive ~90-120s clear when no transcript is being written.
744
- const idleWhenOpen = cfg.idleWhenOpen !== false;
739
+ // Closing the terminal kills Claude Code without firing SessionEnd, so the
740
+ // only passive "is it gone?" signal is "no transcript is being written".
741
+ // DEFAULT (false): clear the card within ~90-120s of the transcript going
742
+ // quiet a closed terminal shouldn't leave a card up for 5 minutes. Opt in
743
+ // with idleWhenOpen:true to instead linger as 'idle' until the staleMs
744
+ // backstop (keeps the card up through short pauses with the terminal open).
745
+ const idleWhenOpen = cfg.idleWhenOpen === true;
745
746
 
746
747
  // Authoritative close signal from the SessionEnd hook — trust it instead
747
748
  // of waiting on staleSessionMin. Any other hook clears the flag, so a
package/src/version.js CHANGED
@@ -11,7 +11,7 @@ import { readFileSync } from 'node:fs';
11
11
  import { join } from 'node:path';
12
12
  import { ROOT } from './paths.js';
13
13
 
14
- const BAKED = '0.9.0';
14
+ const BAKED = '0.9.1';
15
15
 
16
16
  function readPkgVersion() {
17
17
  try {