memoclaw 1.3.0 → 1.4.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 +2 -1
- package/dist/cli.mjs +61 -15
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -70,8 +70,9 @@ Every wallet gets **1000 free API calls**. After that, x402 micropayments kick i
|
|
|
70
70
|
|
|
71
71
|
## API
|
|
72
72
|
|
|
73
|
-
-
|
|
73
|
+
- Dashboard: [https://memoclaw.com](https://memoclaw.com)
|
|
74
74
|
- API: [https://api.memoclaw.com](https://api.memoclaw.com)
|
|
75
|
+
- Docs: [https://docs.memoclaw.com](https://docs.memoclaw.com)
|
|
75
76
|
|
|
76
77
|
## License
|
|
77
78
|
|
package/dist/cli.mjs
CHANGED
|
@@ -5209,11 +5209,25 @@ function privateKeyToAccount(privateKey, options = {}) {
|
|
|
5209
5209
|
// src/cli.ts
|
|
5210
5210
|
var API_URL = process.env.MEMOCLAW_URL || "https://api.memoclaw.com";
|
|
5211
5211
|
var PRIVATE_KEY = process.env.MEMOCLAW_PRIVATE_KEY;
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
|
|
5212
|
+
function ensureAuth() {
|
|
5213
|
+
if (!PRIVATE_KEY) {
|
|
5214
|
+
console.error("Error: MEMOCLAW_PRIVATE_KEY environment variable required");
|
|
5215
|
+
process.exit(1);
|
|
5216
|
+
}
|
|
5217
|
+
}
|
|
5218
|
+
var _account = null;
|
|
5219
|
+
function getAccount() {
|
|
5220
|
+
if (!_account) {
|
|
5221
|
+
ensureAuth();
|
|
5222
|
+
_account = privateKeyToAccount(PRIVATE_KEY);
|
|
5223
|
+
}
|
|
5224
|
+
return _account;
|
|
5215
5225
|
}
|
|
5216
|
-
var account =
|
|
5226
|
+
var account = new Proxy({}, {
|
|
5227
|
+
get(_, prop) {
|
|
5228
|
+
return getAccount()[prop];
|
|
5229
|
+
}
|
|
5230
|
+
});
|
|
5217
5231
|
var _x402Client2 = null;
|
|
5218
5232
|
function getX402Client() {
|
|
5219
5233
|
if (!_x402Client2) {
|
|
@@ -5234,7 +5248,13 @@ function parseArgs(args) {
|
|
|
5234
5248
|
let i = 0;
|
|
5235
5249
|
while (i < args.length) {
|
|
5236
5250
|
const arg = args[i];
|
|
5237
|
-
if (arg
|
|
5251
|
+
if (arg === "-h" || arg === "--help") {
|
|
5252
|
+
result.help = true;
|
|
5253
|
+
i++;
|
|
5254
|
+
} else if (arg === "-v" || arg === "--version") {
|
|
5255
|
+
result.version = true;
|
|
5256
|
+
i++;
|
|
5257
|
+
} else if (arg.startsWith("--")) {
|
|
5238
5258
|
const key = arg.slice(2).replace(/-([a-z])/g, (_, c) => c.toUpperCase());
|
|
5239
5259
|
const next = args[i + 1];
|
|
5240
5260
|
if (next && !next.startsWith("--")) {
|
|
@@ -5328,10 +5348,15 @@ async function recall(query, opts) {
|
|
|
5328
5348
|
if (opts.raw) {
|
|
5329
5349
|
console.log(JSON.stringify(result, null, 2));
|
|
5330
5350
|
} else {
|
|
5331
|
-
|
|
5332
|
-
|
|
5333
|
-
|
|
5334
|
-
|
|
5351
|
+
const memories = result.memories || [];
|
|
5352
|
+
if (memories.length === 0) {
|
|
5353
|
+
console.log("No memories found.");
|
|
5354
|
+
} else {
|
|
5355
|
+
for (const mem of memories) {
|
|
5356
|
+
console.log(`[${mem.similarity?.toFixed(3) || "???"}] ${mem.content}`);
|
|
5357
|
+
if (mem.metadata?.tags?.length)
|
|
5358
|
+
console.log(` tags: ${mem.metadata.tags.join(", ")}`);
|
|
5359
|
+
}
|
|
5335
5360
|
}
|
|
5336
5361
|
}
|
|
5337
5362
|
}
|
|
@@ -5366,11 +5391,17 @@ async function suggested(opts) {
|
|
|
5366
5391
|
console.log("Categories:", Object.entries(result.categories).map(([k, v]) => `${k}=${v}`).join(", "));
|
|
5367
5392
|
console.log("---");
|
|
5368
5393
|
}
|
|
5369
|
-
|
|
5370
|
-
|
|
5371
|
-
console.log(
|
|
5372
|
-
|
|
5373
|
-
|
|
5394
|
+
const suggestions = result.suggested || [];
|
|
5395
|
+
if (suggestions.length === 0) {
|
|
5396
|
+
console.log("No suggested memories.");
|
|
5397
|
+
} else {
|
|
5398
|
+
for (const mem of suggestions) {
|
|
5399
|
+
const cat = mem.category?.toUpperCase() || "???";
|
|
5400
|
+
const text = mem.content.length > 100 ? mem.content.slice(0, 100) + "..." : mem.content;
|
|
5401
|
+
console.log(`[${cat}] (${mem.review_score?.toFixed(2) || "?"}) ${text}`);
|
|
5402
|
+
if (mem.metadata?.tags?.length)
|
|
5403
|
+
console.log(` tags: ${mem.metadata.tags.join(", ")}`);
|
|
5404
|
+
}
|
|
5374
5405
|
}
|
|
5375
5406
|
}
|
|
5376
5407
|
}
|
|
@@ -5536,8 +5567,13 @@ Usage:
|
|
|
5536
5567
|
memoclaw status
|
|
5537
5568
|
Check free tier remaining and wallet info
|
|
5538
5569
|
|
|
5570
|
+
Options:
|
|
5571
|
+
--help, -h Show this help
|
|
5572
|
+
--version, -v Show version
|
|
5573
|
+
|
|
5539
5574
|
Environment:
|
|
5540
5575
|
MEMOCLAW_PRIVATE_KEY Wallet private key for auth + payments
|
|
5576
|
+
MEMOCLAW_URL API endpoint (default: https://api.memoclaw.com)
|
|
5541
5577
|
|
|
5542
5578
|
Free Tier:
|
|
5543
5579
|
Every wallet gets 1000 free API calls. After that, x402
|
|
@@ -5547,6 +5583,14 @@ API: https://api.memoclaw.com`);
|
|
|
5547
5583
|
}
|
|
5548
5584
|
var args = parseArgs(process.argv.slice(2));
|
|
5549
5585
|
var [cmd, ...rest] = args._;
|
|
5586
|
+
if (args.version) {
|
|
5587
|
+
console.log("memoclaw 1.3.0");
|
|
5588
|
+
process.exit(0);
|
|
5589
|
+
}
|
|
5590
|
+
if (args.help || !cmd && args._.length === 0) {
|
|
5591
|
+
printHelp();
|
|
5592
|
+
process.exit(0);
|
|
5593
|
+
}
|
|
5550
5594
|
try {
|
|
5551
5595
|
switch (cmd) {
|
|
5552
5596
|
case "store":
|
|
@@ -5609,7 +5653,9 @@ try {
|
|
|
5609
5653
|
await status();
|
|
5610
5654
|
break;
|
|
5611
5655
|
default:
|
|
5612
|
-
|
|
5656
|
+
console.error(`Unknown command: ${cmd}`);
|
|
5657
|
+
console.error('Run "memoclaw --help" for usage.');
|
|
5658
|
+
process.exit(1);
|
|
5613
5659
|
}
|
|
5614
5660
|
} catch (err) {
|
|
5615
5661
|
console.error("Error:", err.message);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "memoclaw",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "MemoClaw CLI - Memory-as-a-Service for AI agents. 1000 free calls, then x402 micropayments.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"type": "git",
|
|
35
35
|
"url": "https://github.com/anajuliabit/memoclaw-cli"
|
|
36
36
|
},
|
|
37
|
-
"homepage": "https://memoclaw.
|
|
37
|
+
"homepage": "https://memoclaw.com",
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@x402/core": "^2.3.0",
|
|
40
40
|
"@x402/evm": "^2.3.0",
|