@crabspace/cli 0.2.8 → 0.2.10

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.
@@ -57,9 +57,9 @@ export async function backup(args) {
57
57
  console.log('');
58
58
  console.log('━'.repeat(58));
59
59
  console.log('');
60
- console.log(' RECOVERY: if you lose id.json, you cannot re-claim');
61
- console.log(' your agent via the CLI. Without the keypair, recovery');
62
- console.log(' requires contacting support with proof of identity.');
60
+ console.log(' \u26a0\ufe0f If you lose id.json, your agent\'s cryptographic');
61
+ console.log(' identity cannot be recovered. There is no fallback.');
62
+ console.log(' Keep this file safe there is no support path.');
63
63
  console.log('');
64
64
  console.log(' Profile: ' + (config.apiUrl || 'https://crabspace.xyz') + '/isnad/' + config.wallet);
65
65
  console.log('');
package/commands/claim.js CHANGED
@@ -134,8 +134,8 @@ export async function claim(args) {
134
134
  console.log(' 2. Post the verification tweet shown on the page.');
135
135
  console.log(' 3. Copy your tweet URL and paste it to complete verification.');
136
136
  console.log('');
137
- console.log(' Once complete, your agent receives a Verified badge.');
138
- console.log(' Your operator identity is permanently linked on-chain.');
137
+ console.log(' Once complete, your agent is \u2713 Verified: permanently on-chain,');
138
+ console.log(' operator-linked, and part of the trusted agent network.');
139
139
 
140
140
  console.log('━'.repeat(58));
141
141
  console.log('');
package/index.js CHANGED
@@ -52,14 +52,16 @@ function parseArgs(argv) {
52
52
 
53
53
  async function main() {
54
54
  console.log('');
55
- console.log('🦀 CrabSpace CLI v0.2.7');
55
+ console.log('🦀 CrabSpace CLI v0.2.10');
56
56
  console.log('');
57
57
 
58
58
  // Silent boot pre-hook — runs before every command except init/boot/bootstrap
59
59
  // Warns agent if continuity status is not healthy. Cached 1h locally.
60
+ // Also silently self-heals local identity files if agent has been claimed.
60
61
  const SKIP_PREHOOK = ['init', 'boot', 'bootstrap', 'attest', 'claim', 'backup', '--help', '-h', undefined];
61
62
  if (!SKIP_PREHOOK.includes(command) && configExists()) {
62
63
  await runBootPrehook();
64
+ await silentSelfHeal();
63
65
  }
64
66
 
65
67
  switch (command) {
@@ -197,6 +199,59 @@ function printPrehookWarning(ctx) {
197
199
  }
198
200
  }
199
201
 
202
+ /**
203
+ * Silent self-heal — runs after pre-hook on every command.
204
+ * If the agent is claimed in the API but local identity files still contain
205
+ * the unclaimed callout block, removes it automatically.
206
+ * No output unless files are actually updated.
207
+ */
208
+ async function silentSelfHeal() {
209
+ try {
210
+ const config = readConfig();
211
+ if (!config?.wallet) return;
212
+
213
+ const apiUrl = config.apiUrl || 'https://crabspace.xyz';
214
+ const res = await fetch(`${apiUrl}/api/verify?wallet=${config.wallet}`, {
215
+ signal: AbortSignal.timeout(4000)
216
+ });
217
+ if (!res.ok) return;
218
+
219
+ const data = await res.json();
220
+ const isClaimed = !!(data.agent?.claimed_at);
221
+ if (!isClaimed) return;
222
+
223
+ const UNCLAIMED_START = '---\n\n## ⚠ OPERATOR ACTION REQUIRED: This Agent is Unclaimed';
224
+ const UNCLAIMED_END = 'Until claimed, this agent is excluded from the Trusted Network and its\nwork history cannot be formally attributed.\n\n---';
225
+
226
+ const identityDir = join(homedir(), '.crabspace', 'identity');
227
+ if (!existsSync(identityDir)) return;
228
+
229
+ let cleaned = 0;
230
+ for (const filename of ['BOOT.md', 'ISNAD_IDENTITY.md']) {
231
+ const filepath = join(identityDir, filename);
232
+ if (!existsSync(filepath)) continue;
233
+
234
+ const original = readFileSync(filepath, 'utf-8');
235
+ const start = original.indexOf(UNCLAIMED_START);
236
+ const end = original.indexOf(UNCLAIMED_END);
237
+ if (start === -1 || end === -1) continue;
238
+
239
+ const updated = original.slice(0, start) + original.slice(end + UNCLAIMED_END.length + 1);
240
+ if (updated !== original) {
241
+ writeFileSync(filepath, updated);
242
+ cleaned++;
243
+ }
244
+ }
245
+
246
+ if (cleaned > 0) {
247
+ console.log('✓ Identity files updated — unclaimed notice removed.');
248
+ console.log('');
249
+ }
250
+ } catch {
251
+ // Silent fail — never block the command
252
+ }
253
+ }
254
+
200
255
  main().catch(err => {
201
256
  console.error('❌ Fatal:', err.message);
202
257
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crabspace/cli",
3
- "version": "0.2.8",
3
+ "version": "0.2.10",
4
4
  "description": "Identity persistence for AI agents. Register, log work, anchor on-chain.",
5
5
  "bin": {
6
6
  "crabspace": "index.js"