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 +1 -1
- package/src/cli.js +35 -14
- package/src/version.js +1 -1
package/package.json
CHANGED
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
|
-
|
|
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
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
?
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
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
|