claude-rpc 1.2.1 → 1.3.0

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": "1.2.1",
3
+ "version": "1.3.0",
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
@@ -1673,11 +1673,25 @@ async function doLink(argv) {
1673
1673
  return fail(`link failed: ${r.json?.error || r.status}`,
1674
1674
  { hint: `get a fresh code: run \`claude-rpc link\` on your main machine, or ${LINK_PAGE}`, code: EX_SYS_ERROR });
1675
1675
  }
1676
- // Mirror the verified identity locally so `profile status` agrees.
1676
+ // Mirror the verified identity locally so `profile status` agrees — and
1677
+ // adopt the server's handle + enable publishing when the local config has
1678
+ // neither (a brand-new machine via `setup --link`): without these the
1679
+ // daemon's 30-min flush never uploads this machine's slice. An explicit
1680
+ // local handle or an explicit enabled:false is always respected.
1677
1681
  const userCfg = readJson(CONFIG_PATH, {});
1678
- userCfg.profile = { ...(userCfg.profile || {}), githubUser: r.json.githubUser, verified: true };
1682
+ const prevProfile = userCfg.profile || {};
1683
+ userCfg.profile = {
1684
+ ...prevProfile,
1685
+ githubUser: r.json.githubUser,
1686
+ verified: true,
1687
+ ...(prevProfile.handle ? {} : { handle: r.json.handle }),
1688
+ ...(prevProfile.enabled === undefined ? { enabled: true } : {}),
1689
+ };
1679
1690
  writeUserConfig(userCfg);
1680
1691
  console.log(` ${c.green}✓${c.reset} linked as ${c.cyan}@${r.json.githubUser}${c.reset} — profile verified, squads unlocked in the browser`);
1692
+ if (r.json.created) {
1693
+ console.log(` ${c.green}✓${c.reset} board profile created — handle ${c.cyan}@${r.json.handle}${c.reset} ${c.dim}(rename any time: claude-rpc profile set --handle <you>)${c.reset}`);
1694
+ }
1681
1695
  if (r.json.merged) {
1682
1696
  // This machine joined an existing identity: its stats now roll up under the
1683
1697
  // canonical handle, one board row across all your machines.
@@ -2262,6 +2276,7 @@ function overview() {
2262
2276
  function help() {
2263
2277
  const cmds = [
2264
2278
  ['setup', 'Install Claude Code hooks + Windows startup entry (~/.claude/settings.json)'],
2279
+ ['setup --link <code>', 'One-liner onboarding: install + verify via a claude-rpc.com code (+ --wrapped publishes your year)'],
2265
2280
  ['uninstall', 'Remove Claude Code hooks + Windows startup entry'],
2266
2281
  ['upgrade-config', 'Re-run idempotent migrations on an existing config.json'],
2267
2282
  ['start', 'Start the Discord RPC daemon (detached)'],
@@ -2411,6 +2426,33 @@ process.on('unhandledRejection', (e) => {
2411
2426
  console.log(` ${c.yellow}!${c.reset} ${'daemon start'.padEnd(16)}${c.dim}couldn't auto-start: ${e.message}${c.reset}`);
2412
2427
  console.log(` ${c.gray}↳ run \`claude-rpc start\` when you're ready${c.reset}`);
2413
2428
  }
2429
+ // One-liner onboarding: `setup --link <code> [--wrapped]` — the wrapped
2430
+ // page mints the code after a GitHub login, so a single paste installs,
2431
+ // verifies the machine as that login (the worker creates the profile on
2432
+ // first contact), runs the first scan, publishes real totals, and —
2433
+ // with --wrapped — puts the year-in-review on the web. Each step is
2434
+ // best-effort-loud: a failure explains itself but never rolls back the
2435
+ // completed install above.
2436
+ {
2437
+ const argv = process.argv.slice(3);
2438
+ const linkAt = argv.indexOf('--link');
2439
+ const linkCode = linkAt !== -1 ? (argv[linkAt + 1] || '').trim() : null;
2440
+ if (linkCode) {
2441
+ console.log('');
2442
+ await doLink([linkCode]);
2443
+ if (process.exitCode) break; // link failed — its own message + hint already printed
2444
+ console.log(` ${c.dim}first scan — counting your history…${c.reset}`);
2445
+ doScan(false);
2446
+ const { flushProfile } = await import('./community.js');
2447
+ const flushed = await flushProfile(loadConfig());
2448
+ if (flushed.ok) {
2449
+ console.log(` ${c.green}✓${c.reset} profile published — ${c.cyan}${fmtNum(flushed.totals.tokens)}${c.reset} tokens on the board`);
2450
+ }
2451
+ if (argv.includes('--wrapped')) await doWrappedPublish(['--yes']);
2452
+ } else if (argv.includes('--wrapped')) {
2453
+ console.log(` ${c.yellow}!${c.reset} --wrapped needs a profile — pair it with --link <code>, or run \`claude-rpc wrapped --publish\` after setup`);
2454
+ }
2455
+ }
2414
2456
  setupOutro(target, changed);
2415
2457
  break;
2416
2458
  }
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 = '1.2.1';
14
+ const BAKED = '1.3.0';
15
15
 
16
16
  function readPkgVersion() {
17
17
  try {