@trlc/super-memory 1.0.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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +78 -0
  3. package/dist/index.js +450 -0
  4. package/package.json +42 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 The Red Lobster Cartel
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,78 @@
1
+ # šŸ¦ž Super Memory CLI
2
+
3
+ **Never forget a conversation again.**
4
+
5
+ AI-powered persistent memory with cloud sync. Works with OpenClaw and any LLM workflow.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm install -g @redlobstercartel/super-memory
11
+ ```
12
+
13
+ ## Quick Start
14
+
15
+ ```bash
16
+ # Initialize with your license key
17
+ super-memory init --license=XXXX-XXXX-XXXX-XXXX
18
+
19
+ # Save a memory
20
+ super-memory save "Fixed CORS by adding proxy middleware" --category=problem
21
+
22
+ # Search your memories
23
+ super-memory search "cors error"
24
+
25
+ # Sync across devices
26
+ super-memory sync
27
+
28
+ # Check status
29
+ super-memory status
30
+ ```
31
+
32
+ ## Commands
33
+
34
+ | Command | Description |
35
+ |---------|-------------|
36
+ | `init` | Initialize with license key |
37
+ | `save` | Save a memory to cloud |
38
+ | `search` | Search memories semantically |
39
+ | `sync` | Sync with cloud storage |
40
+ | `status` | Show license and stats |
41
+
42
+ ## Categories
43
+
44
+ | Category | Emoji | Use For |
45
+ |----------|-------|---------|
46
+ | `gotcha` | šŸ”“ | Traps, pitfalls to avoid |
47
+ | `problem` | 🟔 | Problems and their fixes |
48
+ | `decision` | 🟤 | Important decisions made |
49
+ | `discovery` | 🟣 | New learnings, insights |
50
+
51
+ ## Pricing
52
+
53
+ | Plan | Price |
54
+ |------|-------|
55
+ | Monthly | $19/month |
56
+ | Lifetime | $190 one-time |
57
+
58
+ Both plans include unlimited memories and cloud sync.
59
+
60
+ ## OpenClaw Integration
61
+
62
+ Super Memory is designed to work with OpenClaw. After installing, you can use:
63
+
64
+ ```
65
+ @super-memory save "your memory" --category=discovery
66
+ @super-memory search "query"
67
+ @super-memory sync
68
+ ```
69
+
70
+ ## Links
71
+
72
+ - 🌐 Website: https://theredlobstercartel.com/super-memory
73
+ - šŸ“§ Support: support@theredlobstercartel.com
74
+ - 🐦 Twitter: @RedLobsterCartel
75
+
76
+ ---
77
+
78
+ *šŸ¦ž The Red Lobster Cartel - Never forget a conversation again.*
package/dist/index.js ADDED
@@ -0,0 +1,450 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Super Memory CLI
4
+ * The Red Lobster Cartel šŸ¦ž
5
+ *
6
+ * Commands:
7
+ * super-memory init --license=XXXX-XXXX-XXXX-XXXX
8
+ * super-memory save "Your memory content" --category=discovery
9
+ * super-memory search "query term"
10
+ * super-memory sync
11
+ * super-memory status
12
+ */
13
+ import { execSync } from 'child_process';
14
+ import { existsSync, mkdirSync, writeFileSync, readFileSync, appendFileSync } from 'fs';
15
+ import { homedir } from 'os';
16
+ import { join } from 'path';
17
+ import readline from 'readline';
18
+ const CONVEX_URL = 'https://clear-lemming-473.convex.cloud';
19
+ const VERSION = '1.0.0';
20
+ // Paths
21
+ const getBaseDir = () => join(homedir(), '.openclaw', 'workspace');
22
+ const getMemoryDir = () => join(getBaseDir(), 'memory');
23
+ const getConfigDir = () => join(getBaseDir(), '.super-memory');
24
+ const getConfigPath = () => join(getConfigDir(), 'config.json');
25
+ // Load config
26
+ function loadConfig() {
27
+ const configPath = getConfigPath();
28
+ if (!existsSync(configPath)) {
29
+ return null;
30
+ }
31
+ try {
32
+ return JSON.parse(readFileSync(configPath, 'utf-8'));
33
+ }
34
+ catch {
35
+ return null;
36
+ }
37
+ }
38
+ // Save config
39
+ function saveConfig(config) {
40
+ const configDir = getConfigDir();
41
+ if (!existsSync(configDir)) {
42
+ mkdirSync(configDir, { recursive: true });
43
+ }
44
+ writeFileSync(getConfigPath(), JSON.stringify(config, null, 2));
45
+ }
46
+ // Generate device ID
47
+ function generateDeviceId() {
48
+ try {
49
+ const hostname = execSync('hostname', { encoding: 'utf-8' }).trim();
50
+ const user = execSync('whoami', { encoding: 'utf-8' }).trim();
51
+ return Buffer.from(`${hostname}-${user}`).toString('base64').slice(0, 16);
52
+ }
53
+ catch {
54
+ return 'unknown-device';
55
+ }
56
+ }
57
+ // Validate license key format
58
+ function isValidLicenseKey(key) {
59
+ return /^[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}$/.test(key);
60
+ }
61
+ // Convex API call
62
+ async function convexCall(functionName, args) {
63
+ const response = await fetch(`${CONVEX_URL}/api/mutation`, {
64
+ method: 'POST',
65
+ headers: { 'Content-Type': 'application/json' },
66
+ body: JSON.stringify({
67
+ path: functionName,
68
+ args: args,
69
+ }),
70
+ });
71
+ if (!response.ok) {
72
+ throw new Error(`API call failed: ${response.status}`);
73
+ }
74
+ const result = await response.json();
75
+ if (result.status === 'error') {
76
+ throw new Error(result.errorMessage || 'Unknown error');
77
+ }
78
+ return result.value;
79
+ }
80
+ // Convex query call
81
+ async function convexQuery(functionName, args) {
82
+ const response = await fetch(`${CONVEX_URL}/api/query`, {
83
+ method: 'POST',
84
+ headers: { 'Content-Type': 'application/json' },
85
+ body: JSON.stringify({
86
+ path: functionName,
87
+ args: args,
88
+ }),
89
+ });
90
+ if (!response.ok) {
91
+ throw new Error(`API call failed: ${response.status}`);
92
+ }
93
+ const result = await response.json();
94
+ if (result.status === 'error') {
95
+ throw new Error(result.errorMessage || 'Unknown error');
96
+ }
97
+ return result.value;
98
+ }
99
+ // COMMAND: init
100
+ async function cmdInit(args) {
101
+ console.log(`
102
+ šŸ¦ž ============================================
103
+ SUPER MEMORY by The Red Lobster Cartel
104
+ Never forget a conversation again
105
+ ============================================
106
+ `);
107
+ // Get license key
108
+ let licenseKey = args.find(arg => arg.startsWith('--license='))?.split('=')[1];
109
+ if (!licenseKey) {
110
+ const rl = readline.createInterface({
111
+ input: process.stdin,
112
+ output: process.stdout
113
+ });
114
+ licenseKey = await new Promise((resolve) => {
115
+ rl.question('šŸ“ Enter your license key (XXXX-XXXX-XXXX-XXXX): ', (answer) => {
116
+ rl.close();
117
+ resolve(answer.trim().toUpperCase());
118
+ });
119
+ });
120
+ }
121
+ if (!isValidLicenseKey(licenseKey)) {
122
+ console.error('āŒ Invalid license key format');
123
+ process.exit(1);
124
+ }
125
+ console.log('\nšŸ” Validating license...');
126
+ const deviceId = generateDeviceId();
127
+ try {
128
+ const validation = await convexCall('license:validate', {
129
+ licenseKey,
130
+ deviceId,
131
+ deviceName: `${process.platform}-${process.arch}`,
132
+ ipAddress: 'cli',
133
+ });
134
+ if (!validation.valid) {
135
+ console.error(`āŒ License validation failed: ${validation.error}`);
136
+ process.exit(1);
137
+ }
138
+ console.log(`āœ… License valid!`);
139
+ console.log(`šŸ“¦ Plan: ${validation.plan === 'monthly' ? 'Monthly ($19/month)' : 'Lifetime ($190 one-time)'}`);
140
+ if (validation.expiresAt) {
141
+ console.log(`ā° Expires: ${new Date(validation.expiresAt).toLocaleDateString()}`);
142
+ }
143
+ // Setup directories
144
+ console.log('\nšŸ“ Setting up directories...');
145
+ const memoryDir = getMemoryDir();
146
+ const configDir = getConfigDir();
147
+ if (!existsSync(memoryDir)) {
148
+ mkdirSync(memoryDir, { recursive: true });
149
+ }
150
+ if (!existsSync(configDir)) {
151
+ mkdirSync(configDir, { recursive: true });
152
+ }
153
+ // Save config
154
+ const config = {
155
+ licenseKey,
156
+ deviceId,
157
+ plan: validation.plan,
158
+ installedAt: new Date().toISOString(),
159
+ version: VERSION,
160
+ lastSyncVersion: 0,
161
+ };
162
+ saveConfig(config);
163
+ // Create initial files
164
+ const today = new Date().toISOString().split('T')[0];
165
+ const indexPath = join(memoryDir, 'MEMORY_INDEX.md');
166
+ if (!existsSync(indexPath)) {
167
+ writeFileSync(indexPath, `# 🧠 MEMORY INDEX - Super Memory
168
+
169
+ **Installed:** ${today}
170
+ **Plan:** ${validation.plan}
171
+
172
+ ---
173
+
174
+ ## šŸ”“ Gotchas
175
+
176
+ | # | Title | Date |
177
+ |---|-------|------|
178
+
179
+ ## 🟔 Problem-Fix
180
+
181
+ | # | Title | Date |
182
+ |---|-------|------|
183
+
184
+ ## 🟤 Decisions
185
+
186
+ | # | Title | Date |
187
+ |---|-------|------|
188
+
189
+ ## 🟣 Discoveries
190
+
191
+ | # | Title | Date |
192
+ |---|-------|------|
193
+
194
+ ---
195
+
196
+ *Powered by The Red Lobster Cartel šŸ¦ž*
197
+ `);
198
+ }
199
+ console.log(`
200
+ šŸŽ‰ ============================================
201
+ INSTALLATION COMPLETE!
202
+ ============================================
203
+
204
+ āœ… License: ${licenseKey}
205
+ āœ… Plan: ${validation.plan}
206
+ āœ… Directory: ${memoryDir}
207
+
208
+ šŸš€ Commands:
209
+ super-memory save "memory" --category=discovery
210
+ super-memory search "query"
211
+ super-memory sync
212
+ super-memory status
213
+
214
+ šŸ¦ž Welcome to The Red Lobster Cartel!
215
+ `);
216
+ }
217
+ catch (error) {
218
+ console.error(`āŒ Error: ${error.message}`);
219
+ process.exit(1);
220
+ }
221
+ }
222
+ // COMMAND: save
223
+ async function cmdSave(args) {
224
+ const config = loadConfig();
225
+ if (!config) {
226
+ console.error('āŒ Not initialized. Run: super-memory init --license=YOUR_KEY');
227
+ process.exit(1);
228
+ }
229
+ // Parse content and category
230
+ const content = args.find(arg => !arg.startsWith('--'));
231
+ const categoryArg = args.find(arg => arg.startsWith('--category='))?.split('=')[1];
232
+ const category = categoryArg || 'discovery';
233
+ if (!content) {
234
+ console.error('āŒ Usage: super-memory save "Your memory content" --category=discovery');
235
+ process.exit(1);
236
+ }
237
+ const validCategories = ['gotcha', 'problem', 'decision', 'discovery'];
238
+ if (!validCategories.includes(category)) {
239
+ console.error(`āŒ Invalid category. Use: ${validCategories.join(', ')}`);
240
+ process.exit(1);
241
+ }
242
+ console.log('šŸ’¾ Saving memory...');
243
+ // Save locally first
244
+ const memoryDir = getMemoryDir();
245
+ const today = new Date().toISOString().split('T')[0];
246
+ const dailyPath = join(memoryDir, `${today}.md`);
247
+ const emoji = { gotcha: 'šŸ”“', problem: '🟔', decision: '🟤', discovery: '🟣' };
248
+ const entry = `\n${emoji[category]} [${category.toUpperCase()}] ${content}\n`;
249
+ if (existsSync(dailyPath)) {
250
+ appendFileSync(dailyPath, entry);
251
+ }
252
+ else {
253
+ writeFileSync(dailyPath, `# Memory Log - ${today}\n${entry}`);
254
+ }
255
+ console.log('āœ… Saved locally');
256
+ // Sync to cloud
257
+ try {
258
+ const result = await convexCall('sync:push', {
259
+ licenseKey: config.licenseKey,
260
+ deviceId: config.deviceId,
261
+ memories: [{
262
+ content,
263
+ category,
264
+ layer: 3,
265
+ source: `${today}.md`,
266
+ }],
267
+ });
268
+ if (result.success) {
269
+ config.lastSyncVersion = result.newVersion;
270
+ saveConfig(config);
271
+ console.log(`ā˜ļø Synced to cloud (v${result.newVersion})`);
272
+ }
273
+ }
274
+ catch (error) {
275
+ console.warn(`āš ļø Cloud sync failed: ${error.message}`);
276
+ }
277
+ console.log(`\n${emoji[category]} Memory saved: "${content.substring(0, 50)}${content.length > 50 ? '...' : ''}"`);
278
+ }
279
+ // COMMAND: search
280
+ async function cmdSearch(args) {
281
+ const config = loadConfig();
282
+ if (!config) {
283
+ console.error('āŒ Not initialized. Run: super-memory init --license=YOUR_KEY');
284
+ process.exit(1);
285
+ }
286
+ const query = args.find(arg => !arg.startsWith('--'));
287
+ if (!query) {
288
+ console.error('āŒ Usage: super-memory search "your query"');
289
+ process.exit(1);
290
+ }
291
+ console.log(`šŸ” Searching for: "${query}"\n`);
292
+ try {
293
+ const results = await convexQuery('sync:search', {
294
+ licenseKey: config.licenseKey,
295
+ query,
296
+ limit: 10,
297
+ });
298
+ if (results.length === 0) {
299
+ console.log('No matches found.');
300
+ return;
301
+ }
302
+ const emoji = { gotcha: 'šŸ”“', problem: '🟔', decision: '🟤', discovery: '🟣' };
303
+ console.log(`Found ${results.length} memories:\n`);
304
+ for (const r of results) {
305
+ console.log(`${emoji[r.category] || 'šŸ“'} [${r.similarity}%] ${r.content.substring(0, 100)}${r.content.length > 100 ? '...' : ''}`);
306
+ console.log(` Source: ${r.source} | ${new Date(r.createdAt).toLocaleDateString()}\n`);
307
+ }
308
+ }
309
+ catch (error) {
310
+ console.error(`āŒ Search failed: ${error.message}`);
311
+ }
312
+ }
313
+ // COMMAND: sync
314
+ async function cmdSync(args) {
315
+ const config = loadConfig();
316
+ if (!config) {
317
+ console.error('āŒ Not initialized. Run: super-memory init --license=YOUR_KEY');
318
+ process.exit(1);
319
+ }
320
+ console.log('šŸ”„ Syncing with cloud...\n');
321
+ try {
322
+ const result = await convexCall('sync:pull', {
323
+ licenseKey: config.licenseKey,
324
+ deviceId: config.deviceId,
325
+ lastSyncVersion: config.lastSyncVersion,
326
+ });
327
+ console.log(`šŸ“„ Pulled ${result.memories.length} new memories`);
328
+ console.log(`šŸ“Š Current version: ${result.latestVersion}`);
329
+ config.lastSyncVersion = result.latestVersion;
330
+ saveConfig(config);
331
+ console.log('\nāœ… Sync complete!');
332
+ }
333
+ catch (error) {
334
+ console.error(`āŒ Sync failed: ${error.message}`);
335
+ }
336
+ }
337
+ // COMMAND: status
338
+ async function cmdStatus(args) {
339
+ const config = loadConfig();
340
+ if (!config) {
341
+ console.error('āŒ Not initialized. Run: super-memory init --license=YOUR_KEY');
342
+ process.exit(1);
343
+ }
344
+ console.log(`
345
+ šŸ¦ž Super Memory Status
346
+ ======================
347
+ `);
348
+ console.log(`šŸ“‹ License: ${config.licenseKey}`);
349
+ console.log(`šŸ“¦ Plan: ${config.plan}`);
350
+ console.log(`šŸ–„ļø Device: ${config.deviceId}`);
351
+ console.log(`šŸ“… Installed: ${config.installedAt}`);
352
+ console.log(`šŸ”¢ Version: ${config.version}`);
353
+ console.log(`šŸ“Š Last Sync Version: ${config.lastSyncVersion}`);
354
+ try {
355
+ const stats = await convexQuery('license:getStats', {
356
+ licenseKey: config.licenseKey,
357
+ });
358
+ console.log(`\nā˜ļø Cloud Stats:`);
359
+ console.log(` Total Memories: ${stats.totalMemories}`);
360
+ console.log(` šŸ”“ Gotchas: ${stats.memoriesByCategory.gotcha}`);
361
+ console.log(` 🟔 Problems: ${stats.memoriesByCategory.problem}`);
362
+ console.log(` 🟤 Decisions: ${stats.memoriesByCategory.decision}`);
363
+ console.log(` 🟣 Discoveries: ${stats.memoriesByCategory.discovery}`);
364
+ console.log(` Devices: ${stats.totalDevices}`);
365
+ if (stats.lastSyncAt) {
366
+ console.log(` Last Sync: ${new Date(stats.lastSyncAt).toLocaleString()}`);
367
+ }
368
+ }
369
+ catch (error) {
370
+ console.warn(`\nāš ļø Could not fetch cloud stats: ${error.message}`);
371
+ }
372
+ }
373
+ // COMMAND: help
374
+ function cmdHelp() {
375
+ console.log(`
376
+ šŸ¦ž Super Memory CLI v${VERSION}
377
+ The Red Lobster Cartel
378
+
379
+ COMMANDS:
380
+ init Initialize with license key
381
+ --license=XXXX-XXXX-XXXX-XXXX
382
+
383
+ save <content> Save a memory
384
+ --category=gotcha|problem|decision|discovery
385
+
386
+ search <query> Search memories
387
+ --limit=10
388
+
389
+ sync Sync with cloud
390
+
391
+ status Show status and stats
392
+
393
+ help Show this help
394
+
395
+ EXAMPLES:
396
+ super-memory init --license=ABCD-1234-EFGH-5678
397
+ super-memory save "Fixed CORS with proxy config" --category=problem
398
+ super-memory search "cors error"
399
+ super-memory sync
400
+ super-memory status
401
+
402
+ WEBSITE: https://theredlobstercartel.com/super-memory
403
+ SUPPORT: support@theredlobstercartel.com
404
+ `);
405
+ }
406
+ // Main
407
+ async function main() {
408
+ const args = process.argv.slice(2);
409
+ const command = args[0]?.toLowerCase();
410
+ const cmdArgs = args.slice(1);
411
+ switch (command) {
412
+ case 'init':
413
+ await cmdInit(cmdArgs);
414
+ break;
415
+ case 'save':
416
+ await cmdSave(cmdArgs);
417
+ break;
418
+ case 'search':
419
+ await cmdSearch(cmdArgs);
420
+ break;
421
+ case 'sync':
422
+ await cmdSync(cmdArgs);
423
+ break;
424
+ case 'status':
425
+ await cmdStatus(cmdArgs);
426
+ break;
427
+ case 'help':
428
+ case '--help':
429
+ case '-h':
430
+ cmdHelp();
431
+ break;
432
+ case '--version':
433
+ case '-v':
434
+ console.log(`Super Memory CLI v${VERSION}`);
435
+ break;
436
+ default:
437
+ if (!command) {
438
+ cmdHelp();
439
+ }
440
+ else {
441
+ console.error(`Unknown command: ${command}`);
442
+ console.log('Run "super-memory help" for usage.');
443
+ process.exit(1);
444
+ }
445
+ }
446
+ }
447
+ main().catch((error) => {
448
+ console.error(`Fatal error: ${error.message}`);
449
+ process.exit(1);
450
+ });
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@trlc/super-memory",
3
+ "version": "1.0.0",
4
+ "description": "Super Memory CLI - AI-powered persistent memory by The Red Lobster Cartel",
5
+ "main": "dist/index.js",
6
+ "bin": {
7
+ "super-memory": "dist/index.js"
8
+ },
9
+ "type": "module",
10
+ "scripts": {
11
+ "build": "tsc",
12
+ "prepublishOnly": "npm run build",
13
+ "test": "node dist/index.js --help"
14
+ },
15
+ "keywords": [
16
+ "ai",
17
+ "memory",
18
+ "openclaw",
19
+ "persistent",
20
+ "context",
21
+ "llm",
22
+ "agent"
23
+ ],
24
+ "author": "The Red Lobster Cartel",
25
+ "license": "MIT",
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "https://github.com/theredlobstercartel/super-memory-saas.git",
29
+ "directory": "cli"
30
+ },
31
+ "homepage": "https://theredlobstercartel.com/super-memory",
32
+ "engines": {
33
+ "node": ">=18"
34
+ },
35
+ "dependencies": {
36
+ "convex": "^1.17.4"
37
+ },
38
+ "devDependencies": {
39
+ "@types/node": "^22.0.0",
40
+ "typescript": "^5.7.0"
41
+ }
42
+ }