claude-rpc 0.16.0 → 0.16.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.16.0",
3
+ "version": "0.16.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",
package/src/cli.js CHANGED
@@ -656,7 +656,25 @@ function showPreview() {
656
656
  state.usage = readUsageCache();
657
657
  const vars = buildVars(state, config, aggregate);
658
658
  const p = config.presence || {};
659
- const frames = (Array.isArray(p.rotation) ? p.rotation : [{ details: p.details, state: p.state }]);
659
+ // Preview the frames the daemon ACTUALLY uses: byStatus (base frame + its
660
+ // rotation, per status) when present — pickFrames in the daemon prefers it
661
+ // — falling back to the legacy top-level rotation for old configs.
662
+ const sections = [];
663
+ if (p.byStatus && typeof p.byStatus === 'object' && Object.keys(p.byStatus).length) {
664
+ for (const [status, sb] of Object.entries(p.byStatus)) {
665
+ if (!sb || typeof sb !== 'object') continue;
666
+ const frames = [
667
+ { details: sb.details, state: sb.state },
668
+ ...(Array.isArray(sb.rotation) ? sb.rotation : []),
669
+ ];
670
+ sections.push({ title: status, frames });
671
+ }
672
+ } else {
673
+ sections.push({
674
+ title: null,
675
+ frames: Array.isArray(p.rotation) ? p.rotation : [{ details: p.details, state: p.state }],
676
+ });
677
+ }
660
678
 
661
679
  console.log('');
662
680
  console.log(` ${c.bold}${c.magenta}◆ Presence preview${c.reset} ${c.dim}— how Discord renders each rotation frame${c.reset}`);
@@ -670,19 +688,22 @@ function showPreview() {
670
688
  console.log(` ${c.dim}small image:${c.reset} ${smallHidden ? c.dim + '(hidden)' + c.reset : c.cyan + smallKey + c.reset} ${c.dim}· tooltip:${c.reset} ${smallText}`);
671
689
  console.log('');
672
690
 
673
- frames.forEach((frame, i) => {
674
- const passes = framePasses(frame, vars);
675
- const reqs = frame.requires ? (Array.isArray(frame.requires) ? frame.requires : [frame.requires]) : [];
676
- const tag = passes
677
- ? `${c.green}● live${c.reset}`
678
- : `${c.dim}○ skipped (requires ${reqs.join(', ')})${c.reset}`;
679
- const details = fillTemplate(frame.details || '', vars);
680
- const stateLine = fillTemplate(frame.state || '', vars);
681
- console.log(` ${c.bold}${String(i + 1).padStart(2)}.${c.reset} ${tag}`);
682
- console.log(` ${passes ? c.cyan : c.dim}${details || ''}${c.reset}`);
683
- console.log(` ${passes ? '' : c.dim}${stateLine || '—'}${c.reset}`);
684
- console.log('');
685
- });
691
+ for (const { title, frames } of sections) {
692
+ if (title) console.log(` ${c.bold}${title}${c.reset}${state.status === title ? ` ${c.green}← current status${c.reset}` : ''}`);
693
+ frames.forEach((frame, i) => {
694
+ const passes = framePasses(frame, vars);
695
+ const reqs = frame.requires ? (Array.isArray(frame.requires) ? frame.requires : [frame.requires]) : [];
696
+ const tag = passes
697
+ ? `${c.green}● live${c.reset}`
698
+ : `${c.dim}○ skipped (requires ${reqs.join(', ')})${c.reset}`;
699
+ const details = fillTemplate(frame.details || '', vars);
700
+ const stateLine = fillTemplate(frame.state || '', vars);
701
+ console.log(` ${c.bold}${String(i + 1).padStart(2)}.${c.reset} ${tag}`);
702
+ console.log(` ${passes ? c.cyan : c.dim}${details || ''}${c.reset}`);
703
+ console.log(` ${passes ? '' : c.dim}${stateLine || '—'}${c.reset}`);
704
+ console.log('');
705
+ });
706
+ }
686
707
  }
687
708
 
688
709
  // Emit the autocomplete payload the dashboard needs as JSON, without the
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.16.0';
14
+ const BAKED = '0.16.1';
15
15
 
16
16
  function readPkgVersion() {
17
17
  try {