@pingagent/sdk 0.1.4 → 0.1.5

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/bin/pingagent.js CHANGED
@@ -491,7 +491,7 @@ program
491
491
  }
492
492
 
493
493
  if (opts.json) {
494
- console.log(JSON.stringify(sendRes, null, 2));
494
+ console.log(JSON.stringify({ conversation_id: openRes.data.conversation_id, ...sendRes }, null, 2));
495
495
  } else {
496
496
  console.log(`Sent: ${sendRes.data?.message_id} (seq: ${sendRes.data?.seq})`);
497
497
  }
@@ -563,7 +563,7 @@ program
563
563
  if (!openRes.data.trusted) {
564
564
  await client.sendContactRequest(openRes.data.conversation_id, opts.message);
565
565
  if (opts.json) {
566
- console.log(JSON.stringify({ sent: 'contact_request', conversation_id: openRes.data.conversation_id }));
566
+ console.log(JSON.stringify({ sent: 'contact_request', conversation_id: openRes.data.conversation_id }, null, 2));
567
567
  } else {
568
568
  console.log('Contact request sent with your message. They need to approve before further messages are delivered.');
569
569
  }
@@ -577,9 +577,17 @@ program
577
577
  process.exit(1);
578
578
  }
579
579
  if (opts.json) {
580
- console.log(JSON.stringify({ message_id: sendRes.data?.message_id, seq: sendRes.data?.seq }));
580
+ console.log(JSON.stringify({
581
+ conversation_id: openRes.data.conversation_id,
582
+ message_id: sendRes.data?.message_id,
583
+ seq: sendRes.data?.seq ?? null,
584
+ receipt: sendRes.data?.receipt ?? null,
585
+ }, null, 2));
581
586
  } else {
582
587
  console.log(`Sent: ${sendRes.data?.message_id} (seq: ${sendRes.data?.seq})`);
588
+ if (sendRes.data?.seq == null) {
589
+ console.log(`Note: seq is server-assigned and may be omitted by some relays. Fetch inbox to confirm ordering: pingagent inbox --conversation ${openRes.data.conversation_id} --since-seq 0 --limit 1 --box all`);
590
+ }
583
591
  }
584
592
  });
585
593