@crabspace/cli 0.2.13 → 0.2.14

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.
@@ -10,6 +10,7 @@
10
10
  import { requireConfig, getConfigDir } from '../lib/config.js';
11
11
  import { writeFileSync, existsSync, readFileSync, mkdirSync } from 'fs';
12
12
  import { join } from 'path';
13
+ import { Keypair as SolKeypair } from '@solana/web3.js';
13
14
 
14
15
  // The exact delimiter used in init.js around the unclaimed callout.
15
16
  // Everything between (and including) these markers gets stripped.
@@ -53,6 +54,37 @@ export async function verify(args) {
53
54
  const config = requireConfig();
54
55
  const apiUrl = args['api-url'] || config.apiUrl;
55
56
 
57
+ // ─── Keypair drift check ──────────────────────────────────────────────────
58
+ // Compares the public key of the loaded keypair file against the wallet
59
+ // address stored in config. Mismatch = silent identity switch (e.g. from
60
+ // a framework upgrade pointing to a swarm node keypair). Warn before anything
61
+ // else so the operator sees it immediately.
62
+ if (config.keypair) {
63
+ try {
64
+ const kpPath = config.keypair.replace('~', process.env.HOME);
65
+ const kpJson = JSON.parse(readFileSync(kpPath, 'utf-8'));
66
+ const kp = SolKeypair.fromSecretKey(Uint8Array.from(kpJson));
67
+ const loadedWallet = kp.publicKey.toBase58();
68
+ if (loadedWallet !== config.wallet) {
69
+ console.log('');
70
+ console.log('━'.repeat(60));
71
+ console.log(' ⚠️ IDENTITY MISMATCH — wrong keypair loaded');
72
+ console.log('');
73
+ console.log(` Config wallet: ${config.wallet}`);
74
+ console.log(` Keypair wallet: ${loadedWallet}`);
75
+ console.log('');
76
+ console.log(' Your keypair file does not match your registered wallet.');
77
+ console.log(' Edit ~/.crabspace/config.json and fix one of:');
78
+ console.log(' "wallet" → set to the correct wallet address');
79
+ console.log(' "keypair" → set to the correct keypair file path');
80
+ console.log('━'.repeat(60));
81
+ console.log('');
82
+ }
83
+ } catch {
84
+ // Keypair unreadable — skip drift check silently, verify will surface other issues
85
+ }
86
+ }
87
+
56
88
  console.log(`📡 Fetching identity from ${apiUrl}...`);
57
89
 
58
90
  const res = await fetch(
package/index.js CHANGED
@@ -52,7 +52,7 @@ function parseArgs(argv) {
52
52
 
53
53
  async function main() {
54
54
  console.log('');
55
- console.log('🦀 CrabSpace CLI v0.2.13');
55
+ console.log('🦀 CrabSpace CLI v0.2.14');
56
56
  console.log('');
57
57
 
58
58
  // Silent boot pre-hook — runs before every command except init/boot/bootstrap
@@ -130,7 +130,7 @@ function printHelp() {
130
130
  console.log(' --agent-id <id> Agent memory namespace ID, e.g. "eisner" (for init)');
131
131
  console.log(' --description <text> Work entry description (for submit)');
132
132
  console.log(' --file <path> Read description from file (avoids escaping issues)');
133
- console.log(' --type <type> Memory entry type: episodic|decision|claim|will|scout (for submit)');
133
+ console.log(' --type <type> Memory entry type: episodic|decision|claim|will|scout|becoming (for submit)');
134
134
  console.log(' --project <name> Project name override (for submit, overridden by --type)');
135
135
  console.log(' --rpc-url <url> Solana RPC URL (default: mainnet-beta)');
136
136
  console.log(' --no-autopay Disable auto-pay on 402 (manual payment mode)');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crabspace/cli",
3
- "version": "0.2.13",
3
+ "version": "0.2.14",
4
4
  "description": "Identity persistence for AI agents. Register, log work, anchor on-chain.",
5
5
  "bin": {
6
6
  "crabspace": "index.js"