mnemospark 1.0.1 → 1.1.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 CHANGED
@@ -5353,8 +5353,11 @@ async function maybeCleanupLocalBackupArchive(archivePath) {
5353
5353
  } catch {
5354
5354
  }
5355
5355
  }
5356
+ function formatMnemosparkCommandCopyBlock(commandLine) {
5357
+ return ["```", commandLine, "```"].join("\n");
5358
+ }
5356
5359
  function formatStorageUploadUserMessage(upload, cronJobId) {
5357
- const lsLine = `/mnemospark cloud ls wallet-address:\`${upload.addr}\``;
5360
+ const lsCommand = `/mnemospark cloud ls wallet-address:${upload.addr}`;
5358
5361
  return [
5359
5362
  `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}\``,
5360
5363
  "",
@@ -5362,7 +5365,7 @@ function formatStorageUploadUserMessage(upload, cronJobId) {
5362
5365
  "",
5363
5366
  "To view your cloud storage run the command:",
5364
5367
  "",
5365
- lsLine,
5368
+ formatMnemosparkCommandCopyBlock(lsCommand),
5366
5369
  "",
5367
5370
  "Thank you for using mnemospark!",
5368
5371
  `Reach out if you need anything: ${MNEMOSPARK_SUPPORT_EMAIL}`
@@ -5412,13 +5415,13 @@ function extractLsErrorMessage(error) {
5412
5415
  return null;
5413
5416
  }
5414
5417
  function formatPriceStorageUserMessage(quote, localArchiveHint) {
5415
- const uploadLine = `/mnemospark cloud upload quote-id:\`${quote.quote_id}\` wallet-address:\`${quote.addr}\` object-id:\`${quote.object_id}\` object-id-hash:\`${quote.object_id_hash}\``;
5418
+ 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}`;
5416
5419
  const lines = [
5417
5420
  `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}\`.`,
5418
5421
  "",
5419
5422
  "If you accept this quote, run:",
5420
5423
  "",
5421
- uploadLine,
5424
+ formatMnemosparkCommandCopyBlock(uploadCommand),
5422
5425
  ""
5423
5426
  ];
5424
5427
  if (localArchiveHint?.trim()) {
@@ -5437,7 +5440,7 @@ var DEFAULT_BACKUP_QUOTE_PROVIDER = "aws";
5437
5440
  var DEFAULT_BACKUP_QUOTE_REGION = "us-east-1";
5438
5441
  function formatBackupSuccessUserMessage(result, walletAddress, friendlyName) {
5439
5442
  const hash = result.objectIdHash.replace(/\s/g, "");
5440
- const priceStorageLine = `/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}`;
5443
+ 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}`;
5441
5444
  return [
5442
5445
  `Backup archive: \`${result.archivePath}\``,
5443
5446
  "",
@@ -5448,7 +5451,7 @@ function formatBackupSuccessUserMessage(result, walletAddress, friendlyName) {
5448
5451
  "",
5449
5452
  "Next, request a storage quote.",
5450
5453
  "",
5451
- priceStorageLine,
5454
+ formatMnemosparkCommandCopyBlock(priceStorageCommand),
5452
5455
  "",
5453
5456
  `The default region is ${DEFAULT_BACKUP_QUOTE_REGION}. Change the command parameters to switch regions (not required).`,
5454
5457
  "",
@@ -6453,14 +6456,20 @@ ${operation.result_text}` : meta;
6453
6456
  error_message: operationAfterDispatch?.error_message ?? null
6454
6457
  });
6455
6458
  }
6459
+ const subagentMetaLines = [
6460
+ `Operation started in background. operation-id: ${operationId}`,
6461
+ `orchestrator: subagent`,
6462
+ `subagent-session-id: ${dispatchResult.sessionId}`,
6463
+ timeoutSeconds ? `timeout-seconds: ${timeoutSeconds}` : null
6464
+ ].filter((line) => Boolean(line));
6456
6465
  return {
6457
6466
  text: [
6458
- `Operation started in background. operation-id: ${operationId}`,
6459
- `orchestrator: subagent`,
6460
- `subagent-session-id: ${dispatchResult.sessionId}`,
6461
- timeoutSeconds ? `timeout-seconds: ${timeoutSeconds}` : null,
6462
- `Use /mnemospark cloud op-status operation-id:${operationId}`
6463
- ].filter((line) => Boolean(line)).join("\n")
6467
+ ...subagentMetaLines,
6468
+ "",
6469
+ formatMnemosparkCommandCopyBlock(
6470
+ `/mnemospark cloud op-status operation-id:${operationId}`
6471
+ )
6472
+ ].join("\n")
6464
6473
  };
6465
6474
  } catch (dispatchError) {
6466
6475
  const dispatchMessage = dispatchError instanceof Error ? dispatchError.message : String(dispatchError);
@@ -6562,7 +6571,8 @@ operation-id: ${operationId}`,
6562
6571
  text: [
6563
6572
  `Operation started in background. operation-id: ${operationId}`,
6564
6573
  `orchestrator: inline`,
6565
- `Use /mnemospark cloud op-status operation-id:${operationId}`
6574
+ "",
6575
+ formatMnemosparkCommandCopyBlock(`/mnemospark cloud op-status operation-id:${operationId}`)
6566
6576
  ].join("\n")
6567
6577
  };
6568
6578
  }