mnemospark 1.2.1 → 1.2.2
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 +24 -12
- package/dist/cli.js +88 -19
- package/dist/cli.js.map +1 -1
- package/dist/index.js +88 -19
- package/dist/index.js.map +1 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/skills/mnemospark/SKILL.md +4 -2
- package/skills/mnemospark/references/commands.md +1 -1
- package/scripts/README.md +0 -55
- package/scripts/install-aws-cli.sh +0 -28
- package/scripts/install-jq.sh +0 -13
- package/scripts/install-pnpm.sh +0 -20
- package/scripts/reinstall.sh +0 -102
- package/scripts/uninstall.sh +0 -67
- package/scripts/verify-dev-tools.sh +0 -56
package/dist/index.js
CHANGED
|
@@ -4184,7 +4184,8 @@ var priceStorageSchema = {
|
|
|
4184
4184
|
args: [
|
|
4185
4185
|
{ name: "wallet-address", aliases: ["wallet"], required: true },
|
|
4186
4186
|
{ name: "object-id", aliases: ["object"], required: true },
|
|
4187
|
-
|
|
4187
|
+
// Optional: omit when the object exists in local SQLite after backup; CLI resolves sha256 from state.db.
|
|
4188
|
+
{ name: "object-id-hash", aliases: ["hash"] },
|
|
4188
4189
|
{ name: "gb", required: true },
|
|
4189
4190
|
{ name: "provider", required: true },
|
|
4190
4191
|
{ name: "region", required: true }
|
|
@@ -4276,7 +4277,7 @@ var TAR_OVERHEAD_BYTES = 10 * 1024 * 1024;
|
|
|
4276
4277
|
var QUOTE_VALIDITY_USER_NOTE = "Quotes are valid for one hour. Please run price-storage again if you need a new quote.";
|
|
4277
4278
|
var MNEMOSPARK_SUPPORT_EMAIL = "pluggedin@mnemospark.ai";
|
|
4278
4279
|
var CLOUD_HELP_FOOTER_STATE = "Local state: mnemospark records quotes, objects, payments, cron jobs, friendly names, and operation metadata in ~/.openclaw/mnemospark/state.db (SQLite). For troubleshooting and correlation, commands and the HTTP proxy append structured JSON lines to ~/.openclaw/mnemospark/events.jsonl. Monthly storage billing jobs are listed in ~/.openclaw/cron/jobs.json for OpenClaw scheduling.";
|
|
4279
|
-
var REQUIRED_PRICE_STORAGE = "wallet-address:, object-id:, object-id-hash
|
|
4280
|
+
var REQUIRED_PRICE_STORAGE = "wallet-address:, object-id:, gb:, provider:, region: (object-id-hash: optional if the object exists in local SQLite after backup)";
|
|
4280
4281
|
var REQUIRED_UPLOAD = "quote-id:, wallet-address:, object-id:, object-id-hash:";
|
|
4281
4282
|
var REQUIRED_BACKUP = "<file|directory> and name:<friendly-name>";
|
|
4282
4283
|
var REQUIRED_PAYMENT_SETTLE = "wallet-address: and (quote-id: | renewal:true with object-key:)";
|
|
@@ -4306,10 +4307,10 @@ var CLOUD_HELP_TEXT = [
|
|
|
4306
4307
|
" Purpose: create a local tar+gzip archive under ~/.openclaw/mnemospark/backup (filename from sanitized friendly name) and record metadata in SQLite for later price-storage and upload.",
|
|
4307
4308
|
" Required: " + REQUIRED_BACKUP,
|
|
4308
4309
|
"",
|
|
4309
|
-
"\u2022 `/mnemospark cloud price-storage wallet-address:<addr> object-id:<id> object-id-hash:<hash> gb:<gb> provider:aws region:us-east-1`",
|
|
4310
|
-
" Purpose: request a storage quote before upload (defaults shown; override `provider:` / `region:` for other regions).",
|
|
4310
|
+
"\u2022 `/mnemospark cloud price-storage wallet-address:<addr> object-id:<id> [object-id-hash:<hash>] gb:<gb> provider:aws region:us-east-1`",
|
|
4311
|
+
" Purpose: request a storage quote before upload (defaults shown; override `provider:` / `region:` for other regions). Omit `object-id-hash:` when the object is already in local SQLite (e.g. after backup); mnemospark reads sha256 from ~/.openclaw/mnemospark/state.db.",
|
|
4311
4312
|
" Required: " + REQUIRED_PRICE_STORAGE,
|
|
4312
|
-
" Shorter: `wallet:\u2026 object:\u2026 hash:\u2026 gb:\u2026 provider:\u2026 region:\u2026`",
|
|
4313
|
+
" Shorter: `wallet:\u2026 object:\u2026 [hash:\u2026] gb:\u2026 provider:\u2026 region:\u2026`",
|
|
4313
4314
|
"",
|
|
4314
4315
|
"\u2022 `/mnemospark cloud upload quote-id:<quote-id> wallet-address:<addr> object-id:<id> object-id-hash:<hash> [name:<friendly-name>] [async:true] [orchestrator:<inline|subagent>] [timeout-seconds:<n>]`",
|
|
4315
4316
|
" Purpose: upload an encrypted object using a valid quote-id.",
|
|
@@ -4520,6 +4521,41 @@ function stripAsyncControlFlags(args) {
|
|
|
4520
4521
|
function mergeArgParseWarnings(a, b) {
|
|
4521
4522
|
return [...a, ...b];
|
|
4522
4523
|
}
|
|
4524
|
+
async function resolvePriceStorageHashFromDatastore(datastore, partial) {
|
|
4525
|
+
await datastore.ensureReady();
|
|
4526
|
+
const row = await datastore.findObjectById(partial.object_id.trim());
|
|
4527
|
+
const wallet = partial.wallet_address.trim().toLowerCase();
|
|
4528
|
+
if (!row) {
|
|
4529
|
+
return {
|
|
4530
|
+
ok: false,
|
|
4531
|
+
message: "Cannot resolve object-id-hash: no object found in local SQLite for this object-id. Run backup first, or pass --object-id-hash explicitly."
|
|
4532
|
+
};
|
|
4533
|
+
}
|
|
4534
|
+
if (row.wallet_address.trim().toLowerCase() !== wallet) {
|
|
4535
|
+
return {
|
|
4536
|
+
ok: false,
|
|
4537
|
+
message: "Cannot resolve object-id-hash: wallet-address does not match the object record in ~/.openclaw/mnemospark/state.db."
|
|
4538
|
+
};
|
|
4539
|
+
}
|
|
4540
|
+
const sha = row.sha256?.trim();
|
|
4541
|
+
if (!sha) {
|
|
4542
|
+
return {
|
|
4543
|
+
ok: false,
|
|
4544
|
+
message: "Cannot resolve object-id-hash: local object record has no sha256 yet. Run backup first, or pass --object-id-hash explicitly."
|
|
4545
|
+
};
|
|
4546
|
+
}
|
|
4547
|
+
return {
|
|
4548
|
+
ok: true,
|
|
4549
|
+
request: {
|
|
4550
|
+
wallet_address: partial.wallet_address.trim(),
|
|
4551
|
+
object_id: partial.object_id.trim(),
|
|
4552
|
+
object_id_hash: sha.replace(/\s/g, ""),
|
|
4553
|
+
gb: partial.gb,
|
|
4554
|
+
provider: partial.provider.trim(),
|
|
4555
|
+
region: partial.region.trim()
|
|
4556
|
+
}
|
|
4557
|
+
};
|
|
4558
|
+
}
|
|
4523
4559
|
function parseCloudArgs(args) {
|
|
4524
4560
|
const trimmed = args?.trim() ?? "";
|
|
4525
4561
|
if (!trimmed) {
|
|
@@ -4589,18 +4625,38 @@ function parseCloudArgs(args) {
|
|
|
4589
4625
|
}
|
|
4590
4626
|
const flags = valuesToStringRecord(parsed.values);
|
|
4591
4627
|
const gb = Number.parseFloat(flags.gb ?? "");
|
|
4592
|
-
const
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
|
|
4596
|
-
|
|
4597
|
-
|
|
4598
|
-
region: flags.region
|
|
4599
|
-
});
|
|
4600
|
-
if (!request) {
|
|
4628
|
+
const hashRaw = flags["object-id-hash"]?.trim();
|
|
4629
|
+
const walletAddress = flags["wallet-address"]?.trim();
|
|
4630
|
+
const objectId = flags["object-id"]?.trim();
|
|
4631
|
+
const provider = flags.provider?.trim();
|
|
4632
|
+
const region = flags.region?.trim();
|
|
4633
|
+
if (!walletAddress || !objectId || !provider || !region || !Number.isFinite(gb)) {
|
|
4601
4634
|
return { mode: "price-storage-invalid" };
|
|
4602
4635
|
}
|
|
4603
|
-
|
|
4636
|
+
if (hashRaw) {
|
|
4637
|
+
const request = parsePriceStorageQuoteRequest({
|
|
4638
|
+
wallet_address: walletAddress,
|
|
4639
|
+
object_id: objectId,
|
|
4640
|
+
object_id_hash: hashRaw,
|
|
4641
|
+
gb,
|
|
4642
|
+
provider,
|
|
4643
|
+
region
|
|
4644
|
+
});
|
|
4645
|
+
if (!request) {
|
|
4646
|
+
return { mode: "price-storage-invalid" };
|
|
4647
|
+
}
|
|
4648
|
+
return { mode: "price-storage", priceStorageRequest: request };
|
|
4649
|
+
}
|
|
4650
|
+
return {
|
|
4651
|
+
mode: "price-storage-resolve-hash",
|
|
4652
|
+
priceStoragePartial: {
|
|
4653
|
+
wallet_address: walletAddress,
|
|
4654
|
+
object_id: objectId,
|
|
4655
|
+
gb,
|
|
4656
|
+
provider,
|
|
4657
|
+
region
|
|
4658
|
+
}
|
|
4659
|
+
};
|
|
4604
4660
|
}
|
|
4605
4661
|
if (subcommand === "upload") {
|
|
4606
4662
|
const parsed = parseCommandArgs(rest, uploadSchema);
|
|
@@ -6737,10 +6793,23 @@ operation-id: ${operationId}`,
|
|
|
6737
6793
|
};
|
|
6738
6794
|
}
|
|
6739
6795
|
}
|
|
6740
|
-
if (parsed.mode === "price-storage") {
|
|
6796
|
+
if (parsed.mode === "price-storage" || parsed.mode === "price-storage-resolve-hash") {
|
|
6797
|
+
let priceStorageRequest;
|
|
6798
|
+
if (parsed.mode === "price-storage-resolve-hash") {
|
|
6799
|
+
const resolved = await resolvePriceStorageHashFromDatastore(
|
|
6800
|
+
datastore,
|
|
6801
|
+
parsed.priceStoragePartial
|
|
6802
|
+
);
|
|
6803
|
+
if (!resolved.ok) {
|
|
6804
|
+
return { text: resolved.message, isError: true };
|
|
6805
|
+
}
|
|
6806
|
+
priceStorageRequest = resolved.request;
|
|
6807
|
+
} else {
|
|
6808
|
+
priceStorageRequest = parsed.priceStorageRequest;
|
|
6809
|
+
}
|
|
6741
6810
|
const correlation = buildRequestCorrelation();
|
|
6742
6811
|
try {
|
|
6743
|
-
const quote = await requestPriceStorageQuote(
|
|
6812
|
+
const quote = await requestPriceStorageQuote(priceStorageRequest, {
|
|
6744
6813
|
...options.proxyQuoteOptions,
|
|
6745
6814
|
correlation
|
|
6746
6815
|
});
|
|
@@ -6798,8 +6867,8 @@ operation-id: ${operationId}`,
|
|
|
6798
6867
|
{
|
|
6799
6868
|
operation_id: correlation.operationId,
|
|
6800
6869
|
trace_id: correlation.traceId,
|
|
6801
|
-
wallet_address:
|
|
6802
|
-
object_id:
|
|
6870
|
+
wallet_address: priceStorageRequest.wallet_address,
|
|
6871
|
+
object_id: priceStorageRequest.object_id,
|
|
6803
6872
|
status: "failed"
|
|
6804
6873
|
},
|
|
6805
6874
|
mnemosparkHomeDir
|