mnemospark 1.0.1 → 1.2.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/dist/cli.js +44 -21
- package/dist/cli.js.map +1 -1
- package/dist/index.js +44 -21
- package/dist/index.js.map +1 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/skills/mnemospark/SKILL.md +72 -24
package/dist/index.js
CHANGED
|
@@ -3014,6 +3014,15 @@ var USER_AGENT = `mnemospark/${VERSION}`;
|
|
|
3014
3014
|
import { existsSync, readFileSync } from "fs";
|
|
3015
3015
|
import { privateKeyToAccount as privateKeyToAccount6 } from "viem/accounts";
|
|
3016
3016
|
|
|
3017
|
+
// src/cloud-help-onboarding.ts
|
|
3018
|
+
var CLOUD_ONBOARDING_BLOCK_LINES = [
|
|
3019
|
+
"",
|
|
3020
|
+
"Start here to securely upload a file and we'll guide you along the way. Copy the line below and replace <file|directory> with the file or directory you'd like to save to the cloud and replace <friendly-name> with an easy to remember name.",
|
|
3021
|
+
"",
|
|
3022
|
+
"`/mnemospark cloud backup <file|directory> name:<friendly-name> async:true`",
|
|
3023
|
+
""
|
|
3024
|
+
];
|
|
3025
|
+
|
|
3017
3026
|
// src/cloud-command.ts
|
|
3018
3027
|
import { spawn } from "child_process";
|
|
3019
3028
|
import {
|
|
@@ -4261,7 +4270,7 @@ function expandTilde(path) {
|
|
|
4261
4270
|
}
|
|
4262
4271
|
var CLOUD_HELP_TEXT = [
|
|
4263
4272
|
"\u2601\uFE0F **mnemospark - Wallet and go.** \u{1F499}",
|
|
4264
|
-
|
|
4273
|
+
...CLOUD_ONBOARDING_BLOCK_LINES,
|
|
4265
4274
|
"**Syntax:** use `/mnemospark cloud \u2026`. Prefer `key:value` for arguments; `key=value` and `--key value` are also accepted. Optional verbose markers: `cloud:true`, `price-storage:true`, etc. Aliases: `wallet:` \u2192 wallet-address, `object:` \u2192 object-id, `quote:` \u2192 quote-id, `hash:` \u2192 object-id-hash.",
|
|
4266
4275
|
"",
|
|
4267
4276
|
"**Cloud Commands**",
|
|
@@ -5398,8 +5407,11 @@ async function maybeCleanupLocalBackupArchive(archivePath) {
|
|
|
5398
5407
|
} catch {
|
|
5399
5408
|
}
|
|
5400
5409
|
}
|
|
5410
|
+
function formatMnemosparkCommandCopyBlock(commandLine) {
|
|
5411
|
+
return ["```", commandLine, "```"].join("\n");
|
|
5412
|
+
}
|
|
5401
5413
|
function formatStorageUploadUserMessage(upload, cronJobId) {
|
|
5402
|
-
const
|
|
5414
|
+
const lsCommand = `/mnemospark cloud ls wallet-address:${upload.addr}`;
|
|
5403
5415
|
return [
|
|
5404
5416
|
`Your file \`${upload.object_id}\` with key \`${upload.object_key}\` has been stored using \`${upload.provider}\` in folder \`${upload.bucket_name}\` in region \`${upload.location}\``,
|
|
5405
5417
|
"",
|
|
@@ -5407,7 +5419,7 @@ function formatStorageUploadUserMessage(upload, cronJobId) {
|
|
|
5407
5419
|
"",
|
|
5408
5420
|
"To view your cloud storage run the command:",
|
|
5409
5421
|
"",
|
|
5410
|
-
|
|
5422
|
+
formatMnemosparkCommandCopyBlock(lsCommand),
|
|
5411
5423
|
"",
|
|
5412
5424
|
"Thank you for using mnemospark!",
|
|
5413
5425
|
`Reach out if you need anything: ${MNEMOSPARK_SUPPORT_EMAIL}`
|
|
@@ -5457,13 +5469,13 @@ function extractLsErrorMessage(error) {
|
|
|
5457
5469
|
return null;
|
|
5458
5470
|
}
|
|
5459
5471
|
function formatPriceStorageUserMessage(quote, localArchiveHint) {
|
|
5460
|
-
const
|
|
5472
|
+
const uploadCommand = `/mnemospark cloud upload quote-id:${quote.quote_id} wallet-address:${quote.addr} object-id:${quote.object_id} object-id-hash:${quote.object_id_hash}`;
|
|
5461
5473
|
const lines = [
|
|
5462
5474
|
`Your storage quote \`${quote.quote_id}\`: storage price \`$${quote.storage_price}\` for file \`${quote.object_id}\` with file size \`${quote.object_size_gb}\` in \`${quote.provider}\` \`${quote.location}\`.`,
|
|
5463
5475
|
"",
|
|
5464
5476
|
"If you accept this quote, run:",
|
|
5465
5477
|
"",
|
|
5466
|
-
|
|
5478
|
+
formatMnemosparkCommandCopyBlock(uploadCommand),
|
|
5467
5479
|
""
|
|
5468
5480
|
];
|
|
5469
5481
|
if (localArchiveHint?.trim()) {
|
|
@@ -5482,7 +5494,7 @@ var DEFAULT_BACKUP_QUOTE_PROVIDER = "aws";
|
|
|
5482
5494
|
var DEFAULT_BACKUP_QUOTE_REGION = "us-east-1";
|
|
5483
5495
|
function formatBackupSuccessUserMessage(result, walletAddress, friendlyName) {
|
|
5484
5496
|
const hash = result.objectIdHash.replace(/\s/g, "");
|
|
5485
|
-
const
|
|
5497
|
+
const priceStorageCommand = `/mnemospark cloud price-storage wallet-address:${walletAddress} object-id:${result.objectId} object-id-hash:${hash} gb:${result.objectSizeGb} provider:${DEFAULT_BACKUP_QUOTE_PROVIDER} region:${DEFAULT_BACKUP_QUOTE_REGION}`;
|
|
5486
5498
|
return [
|
|
5487
5499
|
`Backup archive: \`${result.archivePath}\``,
|
|
5488
5500
|
"",
|
|
@@ -5493,7 +5505,7 @@ function formatBackupSuccessUserMessage(result, walletAddress, friendlyName) {
|
|
|
5493
5505
|
"",
|
|
5494
5506
|
"Next, request a storage quote.",
|
|
5495
5507
|
"",
|
|
5496
|
-
|
|
5508
|
+
formatMnemosparkCommandCopyBlock(priceStorageCommand),
|
|
5497
5509
|
"",
|
|
5498
5510
|
`The default region is ${DEFAULT_BACKUP_QUOTE_REGION}. Change the command parameters to switch regions (not required).`,
|
|
5499
5511
|
"",
|
|
@@ -6498,14 +6510,20 @@ ${operation.result_text}` : meta;
|
|
|
6498
6510
|
error_message: operationAfterDispatch?.error_message ?? null
|
|
6499
6511
|
});
|
|
6500
6512
|
}
|
|
6513
|
+
const subagentMetaLines = [
|
|
6514
|
+
`Operation started in background. operation-id: ${operationId}`,
|
|
6515
|
+
`orchestrator: subagent`,
|
|
6516
|
+
`subagent-session-id: ${dispatchResult.sessionId}`,
|
|
6517
|
+
timeoutSeconds ? `timeout-seconds: ${timeoutSeconds}` : null
|
|
6518
|
+
].filter((line) => Boolean(line));
|
|
6501
6519
|
return {
|
|
6502
6520
|
text: [
|
|
6503
|
-
|
|
6504
|
-
|
|
6505
|
-
|
|
6506
|
-
|
|
6507
|
-
|
|
6508
|
-
].
|
|
6521
|
+
...subagentMetaLines,
|
|
6522
|
+
"",
|
|
6523
|
+
formatMnemosparkCommandCopyBlock(
|
|
6524
|
+
`/mnemospark cloud op-status operation-id:${operationId}`
|
|
6525
|
+
)
|
|
6526
|
+
].join("\n")
|
|
6509
6527
|
};
|
|
6510
6528
|
} catch (dispatchError) {
|
|
6511
6529
|
const dispatchMessage = dispatchError instanceof Error ? dispatchError.message : String(dispatchError);
|
|
@@ -6607,7 +6625,8 @@ operation-id: ${operationId}`,
|
|
|
6607
6625
|
text: [
|
|
6608
6626
|
`Operation started in background. operation-id: ${operationId}`,
|
|
6609
6627
|
`orchestrator: inline`,
|
|
6610
|
-
|
|
6628
|
+
"",
|
|
6629
|
+
formatMnemosparkCommandCopyBlock(`/mnemospark cloud op-status operation-id:${operationId}`)
|
|
6611
6630
|
].join("\n")
|
|
6612
6631
|
};
|
|
6613
6632
|
}
|
|
@@ -7349,17 +7368,21 @@ operation-id: ${operationId}`,
|
|
|
7349
7368
|
// src/mnemospark-handler.ts
|
|
7350
7369
|
var MNEMOSPARK_ROOT_HELP_TEXT = [
|
|
7351
7370
|
"\u2601\uFE0F **mnemospark - Wallet and go.** \u{1F499}",
|
|
7371
|
+
...CLOUD_ONBOARDING_BLOCK_LINES,
|
|
7372
|
+
"To view the full help menu use these commands:",
|
|
7352
7373
|
"",
|
|
7353
|
-
"**
|
|
7354
|
-
"Arguments may use `key:value`, `key=value`, or `--key value`. Optional verbose markers: `cloud:true`, `price-storage:true`, etc. (same as bare words).",
|
|
7355
|
-
"Aliases include `wallet:` \u2192 wallet-address, `object:` \u2192 object-id, `quote:` \u2192 quote-id (see `/mnemospark cloud help`).",
|
|
7356
|
-
"",
|
|
7357
|
-
"**Cloud storage** \u2014 full reference:",
|
|
7374
|
+
"**Cloud storage**",
|
|
7358
7375
|
"\u2022 `/mnemospark cloud help`",
|
|
7359
7376
|
"",
|
|
7360
|
-
"**Wallet
|
|
7377
|
+
"**Wallet status and funding link:**",
|
|
7361
7378
|
"\u2022 `/mnemospark wallet`",
|
|
7362
|
-
"\u2022 `/mnemospark wallet help`
|
|
7379
|
+
"\u2022 `/mnemospark wallet help`",
|
|
7380
|
+
"",
|
|
7381
|
+
"**Let your agent run mnemospark for you:**",
|
|
7382
|
+
"",
|
|
7383
|
+
"mnemospark installs as an OpenClaw extension under `~/.openclaw/extensions/mnemospark/`. Point your agent at the bundled skill:",
|
|
7384
|
+
"",
|
|
7385
|
+
"Install the mnemospark skill available at `~/.openclaw/extensions/mnemospark/skills/mnemospark/SKILL.md`"
|
|
7363
7386
|
].join("\n");
|
|
7364
7387
|
var MNEMOSPARK_WALLET_HELP_TEXT = (address) => [
|
|
7365
7388
|
"\u2601\uFE0F **mnemospark Wallet**",
|