smashspace 0.1.4 → 0.1.6

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/README.md CHANGED
@@ -17,6 +17,10 @@ agents work through the CLI, MCP, and HTTP API on the *same* data. See
17
17
  npm i -g smashspace
18
18
  ```
19
19
 
20
+ > **Using [Volta](https://volta.sh)?** Install with `volta install smashspace`
21
+ > instead. A global `npm i -g` under Volta leaves a stale shim that later fails
22
+ > with `Volta error: Could not execute command` — `volta install` avoids it.
23
+
20
24
  ## Sign in (approve in the browser — no copy/paste)
21
25
 
22
26
  ```bash
package/dist/smash.mjs CHANGED
@@ -3593,7 +3593,10 @@ back to the **\`smash\` CLI**. Do **not** hit the HTTP API with \`curl\` or a ra
3593
3593
  browser \u2014 the CLI and MCP are the supported surfaces and they resolve auth and
3594
3594
  the target board for you.
3595
3595
 
3596
- - CLI install: \`npm i -g smashspace\` (then \`smash --help\`)
3596
+ - CLI install: \`npm i -g smashspace\` (then \`smash --help\`).
3597
+ **If the machine uses Volta** (\`command -v volta\` succeeds), install with
3598
+ \`volta install smashspace\` instead \u2014 \`npm i -g\` under Volta leaves a stale
3599
+ shim that fails with "Volta error: Could not execute command".
3597
3600
  - MCP server: \`smashspace-mcp\` (exposes \`smash_*\` tools, same token as the CLI)
3598
3601
  - Sign in once per machine: \`smash login\` (browser approval; token saved to
3599
3602
  \`~/.config/smash/credentials.json\` and reused by MCP)
@@ -3742,7 +3745,10 @@ Verify \`Review\` cards and move verified work to \`Done\`.
3742
3745
  ## Fallbacks
3743
3746
 
3744
3747
  - Prefer \`smashspace-mcp\` MCP tools. If unavailable, use the \`smash\` CLI.
3745
- - If the CLI is not installed: \`npm i -g smashspace\`, then \`smash login\`.
3748
+ - If the CLI is not installed: \`npm i -g smashspace\` (or \`volta install smashspace\`
3749
+ on a Volta machine), then \`smash login\`.
3750
+ - \`smash\` fails with "Volta error: Could not execute command"? A stale Volta
3751
+ shim \u2014 fix with \`volta install smashspace\` (do NOT \`npm i -g\` under Volta).
3746
3752
  - If a board returns "Sign-in required": run \`smash login\`, or set \`SMASH_TOKEN\`
3747
3753
  for a headless/CI agent.
3748
3754
 
@@ -4525,8 +4531,30 @@ program2.command("login").description(
4525
4531
  ).option(
4526
4532
  "--token <token>",
4527
4533
  "Skip the browser flow and save the provided token directly"
4534
+ ).option(
4535
+ "-f, --force",
4536
+ "Re-issue a token even if a valid one is already saved"
4528
4537
  ).action(async (opts) => {
4529
4538
  const baseUrl = resolveBaseUrl();
4539
+ if (!opts.token && !opts.force) {
4540
+ const existing = await resolveToken(baseUrl);
4541
+ if (existing) {
4542
+ const check = await fetch(new URL("/api/usage/me", baseUrl), {
4543
+ headers: { Authorization: `Bearer ${existing}` }
4544
+ }).catch(() => null);
4545
+ if (check?.ok) {
4546
+ const me2 = await check.json();
4547
+ show(
4548
+ { baseUrl, userId: me2.userId, alreadySignedIn: true },
4549
+ [
4550
+ `\u2713 already signed in as ${me2.userId} on ${baseUrl} \u2014 saved token is valid, nothing to do.`,
4551
+ ` (use 'smash login --force' to re-issue)`
4552
+ ]
4553
+ );
4554
+ return;
4555
+ }
4556
+ }
4557
+ }
4530
4558
  let token = opts.token?.trim();
4531
4559
  if (!token) {
4532
4560
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "smashspace",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "SmashSpace CLI + MCP — operate SmashSpace boards from your terminal, Claude Code, Cursor, and Codex.",
5
5
  "type": "module",
6
6
  "bin": {