@emblemvault/agentwallet 1.0.0 ā 1.0.1
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 +45 -0
- package/auth.js +2 -2
- package/conversation.js +5 -5
- package/enhanced-hustle.js +10 -10
- package/package.json +1 -1
- package/reset-conversation.js +6 -6
- package/resume-conversation.js +15 -15
package/README.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# @emblemvault/agentwallet
|
|
2
|
+
|
|
3
|
+
CLI for EmblemVault's Hustle AI - autonomous crypto wallet management across 7 blockchains.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g @emblemvault/agentwallet
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Commands
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# Chat with Hustle AI
|
|
15
|
+
emblem-hustle -p "your-password-16-chars-min" -m "What are my wallet addresses?"
|
|
16
|
+
|
|
17
|
+
# Resume with conversation context
|
|
18
|
+
emblem-resume -p "your-password" -m "Follow-up question"
|
|
19
|
+
|
|
20
|
+
# Reset conversation history
|
|
21
|
+
emblem-reset
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Authentication
|
|
25
|
+
|
|
26
|
+
**Login and signup are the same action.**
|
|
27
|
+
|
|
28
|
+
| Scenario | What Happens |
|
|
29
|
+
|----------|--------------|
|
|
30
|
+
| First time with a password | Creates a new vault with unique addresses |
|
|
31
|
+
| Same password again | Returns the same vault (deterministic) |
|
|
32
|
+
| Different password | Creates a completely different vault |
|
|
33
|
+
|
|
34
|
+
- Password must be 16+ characters
|
|
35
|
+
- No recovery if lost (treat it like a private key)
|
|
36
|
+
|
|
37
|
+
## Supported Chains
|
|
38
|
+
|
|
39
|
+
Solana, Ethereum, Base, BSC, Polygon, Hedera, Bitcoin
|
|
40
|
+
|
|
41
|
+
## Links
|
|
42
|
+
|
|
43
|
+
- [EmblemVault](https://emblemvault.ai)
|
|
44
|
+
- [Hustle AI](https://agenthustle.ai)
|
|
45
|
+
- [OpenClaw Skill](https://github.com/EmblemCompany/EmblemAi-AgentWallet)
|
package/auth.js
CHANGED
|
@@ -21,7 +21,7 @@ export class EmblemAuth {
|
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
const data = await response.json();
|
|
24
|
-
|
|
24
|
+
|
|
25
25
|
if (!data.success) {
|
|
26
26
|
throw new Error('Authentication failed');
|
|
27
27
|
}
|
|
@@ -35,4 +35,4 @@ export class EmblemAuth {
|
|
|
35
35
|
throw new Error(`Auth error: ${error.message}`);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
}
|
|
38
|
+
}
|
package/conversation.js
CHANGED
|
@@ -25,14 +25,14 @@ export class ConversationManager {
|
|
|
25
25
|
|
|
26
26
|
async saveConversation(conversation) {
|
|
27
27
|
conversation.lastUpdated = new Date().toISOString();
|
|
28
|
-
|
|
28
|
+
|
|
29
29
|
// Trim conversation if too long
|
|
30
30
|
if (conversation.messages.length > this.maxHistoryLength) {
|
|
31
31
|
conversation.messages = conversation.messages.slice(-this.maxHistoryLength);
|
|
32
32
|
}
|
|
33
|
-
|
|
33
|
+
|
|
34
34
|
await fs.writeFile(
|
|
35
|
-
this.conversationFile,
|
|
35
|
+
this.conversationFile,
|
|
36
36
|
JSON.stringify(conversation, null, 2),
|
|
37
37
|
'utf8'
|
|
38
38
|
);
|
|
@@ -63,7 +63,7 @@ export class ConversationManager {
|
|
|
63
63
|
const backup = `conversation-backup-${Date.now()}.json`;
|
|
64
64
|
await fs.copyFile(this.conversationFile, backup);
|
|
65
65
|
}
|
|
66
|
-
|
|
66
|
+
|
|
67
67
|
// Delete current conversation
|
|
68
68
|
try {
|
|
69
69
|
await fs.unlink(this.conversationFile);
|
|
@@ -80,4 +80,4 @@ export class ConversationManager {
|
|
|
80
80
|
return false;
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
}
|
|
83
|
+
}
|
package/enhanced-hustle.js
CHANGED
|
@@ -16,15 +16,15 @@ class EnhancedHustle {
|
|
|
16
16
|
try {
|
|
17
17
|
console.log('š Authenticating...');
|
|
18
18
|
const authData = await this.auth.authenticate(password);
|
|
19
|
-
|
|
19
|
+
|
|
20
20
|
console.log(`š± VaultId: ${authData.vaultId}`);
|
|
21
|
-
|
|
21
|
+
|
|
22
22
|
console.log('š¾ Loading conversation history...');
|
|
23
23
|
let conversation = await this.conversation.loadConversation();
|
|
24
|
-
|
|
24
|
+
|
|
25
25
|
// Add user message to history
|
|
26
26
|
conversation = this.conversation.addUserMessage(conversation, message);
|
|
27
|
-
|
|
27
|
+
|
|
28
28
|
console.log('š Querying Hustle AI...');
|
|
29
29
|
const response = await fetch(this.chatEndpoint, {
|
|
30
30
|
method: 'POST',
|
|
@@ -47,11 +47,11 @@ class EnhancedHustle {
|
|
|
47
47
|
|
|
48
48
|
console.log('š” Processing response stream...');
|
|
49
49
|
const responseText = await response.text();
|
|
50
|
-
|
|
50
|
+
|
|
51
51
|
// Parse SSE response - extract content from 0: lines
|
|
52
52
|
const contentChunks = [];
|
|
53
53
|
const lines = responseText.split('\n');
|
|
54
|
-
|
|
54
|
+
|
|
55
55
|
for (const line of lines) {
|
|
56
56
|
if (line.startsWith('0:"')) {
|
|
57
57
|
// Remove 0:" prefix and trailing "
|
|
@@ -63,14 +63,14 @@ class EnhancedHustle {
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
const fullResponse = contentChunks.join('');
|
|
66
|
-
|
|
66
|
+
|
|
67
67
|
if (fullResponse.trim()) {
|
|
68
68
|
// Add assistant response to history
|
|
69
69
|
conversation = this.conversation.addAssistantMessage(conversation, fullResponse);
|
|
70
|
-
|
|
70
|
+
|
|
71
71
|
// Save updated conversation
|
|
72
72
|
await this.conversation.saveConversation(conversation);
|
|
73
|
-
|
|
73
|
+
|
|
74
74
|
console.log('\nš¤ Hustle AI Response:');
|
|
75
75
|
console.log('ā'.repeat(50));
|
|
76
76
|
console.log(fullResponse);
|
|
@@ -99,4 +99,4 @@ program
|
|
|
99
99
|
const options = program.opts();
|
|
100
100
|
const hustle = new EnhancedHustle();
|
|
101
101
|
|
|
102
|
-
hustle.queryHustle(options.password, options.message);
|
|
102
|
+
hustle.queryHustle(options.password, options.message);
|
package/package.json
CHANGED
package/reset-conversation.js
CHANGED
|
@@ -10,9 +10,9 @@ class ConversationReset {
|
|
|
10
10
|
async resetConversation() {
|
|
11
11
|
try {
|
|
12
12
|
console.log('š Checking for existing conversation...');
|
|
13
|
-
|
|
13
|
+
|
|
14
14
|
const exists = await this.conversation.conversationExists();
|
|
15
|
-
|
|
15
|
+
|
|
16
16
|
if (!exists) {
|
|
17
17
|
console.log('ā¹ļø No conversation history found. Nothing to reset.');
|
|
18
18
|
return;
|
|
@@ -23,15 +23,15 @@ class ConversationReset {
|
|
|
23
23
|
console.log(`š Found conversation with ${currentConversation.totalExchanges} exchanges`);
|
|
24
24
|
console.log(`š
Created: ${currentConversation.created}`);
|
|
25
25
|
console.log(`š
Last updated: ${currentConversation.lastUpdated}`);
|
|
26
|
-
|
|
26
|
+
|
|
27
27
|
// Reset conversation (creates backup)
|
|
28
28
|
console.log('\nš¾ Creating backup and resetting...');
|
|
29
29
|
await this.conversation.resetConversation();
|
|
30
|
-
|
|
30
|
+
|
|
31
31
|
console.log('ā
Conversation reset complete!');
|
|
32
32
|
console.log('š¦ Previous conversation backed up');
|
|
33
33
|
console.log('š Ready for fresh conversation');
|
|
34
|
-
|
|
34
|
+
|
|
35
35
|
} catch (error) {
|
|
36
36
|
console.error('ā Reset failed:', error.message);
|
|
37
37
|
process.exit(1);
|
|
@@ -41,4 +41,4 @@ class ConversationReset {
|
|
|
41
41
|
|
|
42
42
|
// Execute reset
|
|
43
43
|
const reset = new ConversationReset();
|
|
44
|
-
reset.resetConversation();
|
|
44
|
+
reset.resetConversation();
|
package/resume-conversation.js
CHANGED
|
@@ -15,25 +15,25 @@ class ResumeHustle {
|
|
|
15
15
|
async resumeConversation(password, message) {
|
|
16
16
|
try {
|
|
17
17
|
console.log('š Resuming conversation...');
|
|
18
|
-
|
|
18
|
+
|
|
19
19
|
// Load existing conversation
|
|
20
20
|
const conversationData = await this.conversation.loadConversation();
|
|
21
|
-
|
|
21
|
+
|
|
22
22
|
if (conversationData.messages.length === 0) {
|
|
23
23
|
console.log('ā ļø No existing conversation found. Starting fresh.');
|
|
24
24
|
} else {
|
|
25
25
|
console.log(`š Found ${conversationData.totalExchanges} previous exchanges`);
|
|
26
26
|
console.log(`š
Last updated: ${conversationData.lastUpdated}`);
|
|
27
|
-
|
|
27
|
+
|
|
28
28
|
// Show last few exchanges for context
|
|
29
29
|
const recentMessages = conversationData.messages.slice(-4);
|
|
30
30
|
console.log('\nš Recent conversation context:');
|
|
31
31
|
console.log('ā'.repeat(50));
|
|
32
|
-
|
|
32
|
+
|
|
33
33
|
for (const msg of recentMessages) {
|
|
34
34
|
const role = msg.role === 'user' ? 'š¤ User' : 'š¤ Assistant';
|
|
35
|
-
const preview = msg.content.length > 100
|
|
36
|
-
? msg.content.substring(0, 100) + '...'
|
|
35
|
+
const preview = msg.content.length > 100
|
|
36
|
+
? msg.content.substring(0, 100) + '...'
|
|
37
37
|
: msg.content;
|
|
38
38
|
console.log(`${role}: ${preview}`);
|
|
39
39
|
}
|
|
@@ -43,12 +43,12 @@ class ResumeHustle {
|
|
|
43
43
|
// Continue conversation with new message
|
|
44
44
|
console.log('\nš Authenticating...');
|
|
45
45
|
const authData = await this.auth.authenticate(password);
|
|
46
|
-
|
|
46
|
+
|
|
47
47
|
console.log(`š± VaultId: ${authData.vaultId}`);
|
|
48
|
-
|
|
48
|
+
|
|
49
49
|
// Add new user message
|
|
50
50
|
const updatedConversation = this.conversation.addUserMessage(conversationData, message);
|
|
51
|
-
|
|
51
|
+
|
|
52
52
|
console.log('š Sending to Hustle AI...');
|
|
53
53
|
const response = await fetch(this.chatEndpoint, {
|
|
54
54
|
method: 'POST',
|
|
@@ -71,11 +71,11 @@ class ResumeHustle {
|
|
|
71
71
|
|
|
72
72
|
console.log('š” Processing response...');
|
|
73
73
|
const responseText = await response.text();
|
|
74
|
-
|
|
74
|
+
|
|
75
75
|
// Parse SSE response
|
|
76
76
|
const contentChunks = [];
|
|
77
77
|
const lines = responseText.split('\n');
|
|
78
|
-
|
|
78
|
+
|
|
79
79
|
for (const line of lines) {
|
|
80
80
|
if (line.startsWith('0:"')) {
|
|
81
81
|
let content = line.slice(3, -1);
|
|
@@ -85,14 +85,14 @@ class ResumeHustle {
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
const fullResponse = contentChunks.join('');
|
|
88
|
-
|
|
88
|
+
|
|
89
89
|
if (fullResponse.trim()) {
|
|
90
90
|
// Add assistant response
|
|
91
91
|
const finalConversation = this.conversation.addAssistantMessage(updatedConversation, fullResponse);
|
|
92
|
-
|
|
92
|
+
|
|
93
93
|
// Save updated conversation
|
|
94
94
|
await this.conversation.saveConversation(finalConversation);
|
|
95
|
-
|
|
95
|
+
|
|
96
96
|
console.log('\nš¤ Hustle AI Response:');
|
|
97
97
|
console.log('ā'.repeat(50));
|
|
98
98
|
console.log(fullResponse);
|
|
@@ -121,4 +121,4 @@ program
|
|
|
121
121
|
const options = program.opts();
|
|
122
122
|
const resumeHustle = new ResumeHustle();
|
|
123
123
|
|
|
124
|
-
resumeHustle.resumeConversation(options.password, options.message);
|
|
124
|
+
resumeHustle.resumeConversation(options.password, options.message);
|