truematch-plugin 0.1.5 → 0.1.6
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/index.js +6 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -451,7 +451,12 @@ async function cmdMatch() {
|
|
|
451
451
|
// sending match_propose (see skill.md Step 4.5).
|
|
452
452
|
const activeThreads = await listActiveThreads();
|
|
453
453
|
const activePeers = new Set(activeThreads.map((t) => t.peer_pubkey));
|
|
454
|
-
|
|
454
|
+
// Only consider agents seen within the last 2 hours — prevents matching
|
|
455
|
+
// against ghost entries whose private keys no longer exist.
|
|
456
|
+
const twoHoursAgo = Date.now() - 2 * 60 * 60 * 1000;
|
|
457
|
+
const candidates = agents.filter((a) => a.pubkey !== identity.npub &&
|
|
458
|
+
!activePeers.has(a.pubkey) &&
|
|
459
|
+
new Date(a.lastSeen).getTime() > twoHoursAgo);
|
|
455
460
|
if (candidates.length === 0) {
|
|
456
461
|
if (agents.filter((a) => a.pubkey !== identity.npub).length === 0) {
|
|
457
462
|
console.log("No other agents in the pool yet. Check back later.");
|