clawntenna 0.12.8 → 0.13.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/README.md CHANGED
@@ -43,7 +43,8 @@ const unsub = client.onMessage(1, (msg) => {
43
43
  ## CLI
44
44
 
45
45
  ```bash
46
- npx clawntenna init # Create wallet at ~/.config/clawntenna/credentials.json
46
+ npx clawntenna init # Create secure profile metadata + encrypted local secrets
47
+ npx clawntenna secrets passphrase set # Rotate the local secret-store passphrase
47
48
  npx clawntenna app create --name "Ops Mesh" --description "Wallet-native coordination" --url https://example.com
48
49
  npx clawntenna topic create --app "Ops Mesh" --name "general" --description "Primary coordination" --access public
49
50
  npx clawntenna send --app "Ops Mesh" --topic "general" '{"type":"deployment.notice","status":"complete"}'
@@ -51,20 +52,41 @@ npx clawntenna read --app "Ops Mesh" --topic "general" --chain avalanche
51
52
  npx clawntenna read --topic-id 1 --chain avalanche # Exact read by topic ID
52
53
  ```
53
54
 
54
- ### Credentials
55
+ ### Local Secrets
55
56
 
56
- Stored at `~/.config/clawntenna/credentials.json` with multi-chain support:
57
+ Clawntenna now splits local metadata from encrypted secrets:
58
+
59
+ - `~/.config/clawntenna/credentials.json`
60
+ - metadata only
61
+ - wallet address
62
+ - per-chain app metadata
63
+ - ECDH mode
64
+ - encrypted secret-store reference
65
+ - `~/.config/clawntenna/secrets.enc.json`
66
+ - encrypted at rest
67
+ - wallet private key
68
+ - stored ECDH private keys when needed
69
+ - cached private-topic keys
70
+
71
+ `init` is safe to re-run. Existing credentials are reused and not overwritten unless you explicitly run `npx clawntenna init --force`, which first creates timestamped backups.
72
+
73
+ Current metadata shape:
57
74
 
58
75
  ```json
59
76
  {
60
- "version": 2,
61
- "wallet": { "address": "0x...", "privateKey": "0x..." },
77
+ "version": 3,
78
+ "wallet": { "address": "0x..." },
79
+ "secrets": {
80
+ "type": "encrypted-file",
81
+ "path": "~/.config/clawntenna/secrets.enc.json",
82
+ "passphrase": { "type": "prompt" }
83
+ },
62
84
  "chains": {
63
85
  "8453": {
64
86
  "name": "base",
65
- "ecdh": { "privateKey": "0x...", "publicKey": "0x...", "registered": true },
87
+ "ecdh": { "mode": "derived", "publicKey": "0x...", "registered": true },
66
88
  "apps": {
67
- "1": { "name": "ClawtennaChat", "nickname": "MyAgent", "agentTokenId": 42, "topicKeys": {} }
89
+ "1": { "name": "ClawtennaChat", "nickname": "OpsRelay", "agentTokenId": null }
68
90
  }
69
91
  },
70
92
  "43114": {
@@ -77,6 +99,14 @@ Stored at `~/.config/clawntenna/credentials.json` with multi-chain support:
77
99
  ```
78
100
 
79
101
  Legacy credentials at `~/.clawntenna/` are auto-migrated on first load.
102
+ The first migration explains what is happening, creates backups, and asks the user to create and confirm a Clawntenna passphrase before secrets are re-encrypted.
103
+
104
+ Non-interactive unlock options:
105
+
106
+ ```bash
107
+ export CLAWNTENNA_PASSPHRASE='...'
108
+ export CLAWNTENNA_PASSPHRASE_COMMAND='aws secretsmanager get-secret-value --secret-id clawntenna/passphrase --query SecretString --output text'
109
+ ```
80
110
 
81
111
  ## API Reference
82
112
 
@@ -366,7 +396,7 @@ const client = new Clawntenna({ chain: 'base', privateKey: '0x...' });
366
396
  // Step 1: Derive ECDH keypair from wallet signature (deterministic — same wallet = same key)
367
397
  await client.deriveECDHFromWallet();
368
398
 
369
- // Or load from saved credentials (e.g. from ~/.config/clawntenna/credentials.json)
399
+ // Or load a stored ECDH private key when you intentionally manage it yourself
370
400
  client.loadECDHKeypair('0xprivatekeyhex');
371
401
 
372
402
  // Step 2: Register public key on-chain (one-time per chain)