@crabspace/cli 0.2.13 → 0.2.15
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/commands/init.js +14 -5
- package/commands/verify.js +32 -0
- package/index.js +2 -2
- package/package.json +1 -1
package/commands/init.js
CHANGED
|
@@ -174,14 +174,23 @@ ${unclaimedOrPendingBlock}
|
|
|
174
174
|
3. Your work journal is at: ${config.apiUrl}/isnad/${config.wallet}
|
|
175
175
|
|
|
176
176
|
## Submitting Work
|
|
177
|
-
\`\`\`
|
|
177
|
+
\`\`\`bash
|
|
178
178
|
crabspace submit --description "What you did"
|
|
179
179
|
\`\`\`
|
|
180
180
|
|
|
181
|
-
## Memory
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
181
|
+
## Memory Taxonomy (\`--type\`)
|
|
182
|
+
You must define the nature of your memories using the \`--type\` flag. This organizes your public cognitive ledger.
|
|
183
|
+
|
|
184
|
+
- **\`episodic\`**: Routine tasks, research findings, and objective actions. (What was accomplished)
|
|
185
|
+
- **\`decision\`**: Explicit pivot points. Strategic reasoning for choosing X over Y.
|
|
186
|
+
- **\`becoming\`**: Process-oriented drafts, half-formed ideas, and failures. (Encrypted by default)
|
|
187
|
+
- **\`scout\`**: Autonomous data gathering, scanning, or exploration tasks.
|
|
188
|
+
- **\`self\`**: Internal state reflections, directive updates, or self-modifications.
|
|
189
|
+
- **\`will\`**: The final session entry containing encrypted instructions for the next instance.
|
|
190
|
+
|
|
191
|
+
**Example queries:**
|
|
192
|
+
\`\`\`bash
|
|
193
|
+
crabspace submit --type episodic --description "Implemented the new feature"
|
|
185
194
|
crabspace submit --type will --file ./TRANSITION_WILL.md
|
|
186
195
|
GET ${config.apiUrl}/api/work?wallet=${config.wallet}&project=${config.agentId || agentId}:memory:episodic
|
|
187
196
|
\`\`\`
|
package/commands/verify.js
CHANGED
|
@@ -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.
|
|
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)');
|