Sync all pending local changes.

This commit captures the current working tree state as requested, including code, docs, dependency, and lockfile updates present in this repository.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Raven Scott
2026-06-02 09:24:06 -04:00
co-authored by Cursor
parent 48e8b70d98
commit 0c73d63c78
2 changed files with 26 additions and 6 deletions
+2
View File
@@ -6,6 +6,8 @@ Application facade: one `PearcordPlatform` class that wires identity, database,
**Phase 661 (v0.8.640):** Added explicit `pearcord-dm-voice` dependency declaration to keep attached/headless agentctl runtimes stable when resolving local `file:` modules in Bare environments.
**Phase 410 hardening (v0.8.641):** Added cached pin snapshots in `view()` (`_pinListCacheKey/_pinListCacheGen` + `_invalidatePinListCache`) and broadened reaction snapshot cache reuse beyond light polls to reduce duplicate startup list scans.
**Phase 659 (v0.8.638):** DM scheduled messages slice — `sendMessage` parses `/schedule` and `/sendlater` in DM mode; queue APIs `createDmScheduledMessage`, `listDmScheduledMessages`, `cancelDmScheduledMessage`, `sendNowDmScheduledMessage`, plus due runner `runDueDmScheduledMessages()` and local timer flush. See [DM_SCHEDULED_MESSAGES.md](../../docs/DM_SCHEDULED_MESSAGES.md).
**Phase 658 (v0.8.638):** DM thread parity closure — `archiveThread` supports `dm_thread` channels in DM mode; `exportDmThreadP2PAudit()` reports DM thread topic safety (`pearcord:dm-thread:*`, no central URL). See [DM_THREADS.md](../../docs/DM_THREADS.md).
+24 -6
View File
@@ -487,6 +487,9 @@ class PearcordPlatform extends EventEmitter {
this._reactionListCacheKey = ''
this._reactionListCache = null
this._reactionListCacheGen = 0
this._pinListCacheKey = ''
this._pinListCache = null
this._pinListCacheGen = 0
this._lastReplicationCompact = null
this._memberPageBurstTimestamps = []
this._guildMeshBoundedByGuild = new Map()
@@ -754,6 +757,12 @@ class PearcordPlatform extends EventEmitter {
this._reactionListCache = null
}
_invalidatePinListCache () {
this._pinListCacheGen = (this._pinListCacheGen || 0) + 1
this._pinListCacheKey = ''
this._pinListCache = null
}
_logMeshChurn (action, extra = {}) {
const guildId = extra.guildId || this.guild?.guild?.id
if (!guildId) return
@@ -8031,7 +8040,7 @@ class PearcordPlatform extends EventEmitter {
channelId: pin.channelId,
messageId: pin.messageId
})
if (!existing || (Number(pin.pinnedAt) || 0) >= (Number(existing.pinnedAt) || 0)) {
if (!existing || (Number(pin.pinnedAt) || 0) > (Number(existing.pinnedAt) || 0)) {
await this.db.insert(COLLECTIONS.PINS, {
channelId: pin.channelId,
messageId: pin.messageId,
@@ -8039,6 +8048,7 @@ class PearcordPlatform extends EventEmitter {
pinnedBy: pin.pinnedBy,
pinnedAt: coerceSyncUint(pin.pinnedAt, Date.now())
})
this._invalidatePinListCache()
}
}
let added = 0
@@ -19322,6 +19332,7 @@ class PearcordPlatform extends EventEmitter {
removed: true
}
if (this.dm?.gossipPin) this.dm.gossipPin(payload)
this._invalidatePinListCache()
this.emit('pin', payload)
span.end({
channelId: this.activeChannelId,
@@ -19426,6 +19437,7 @@ class PearcordPlatform extends EventEmitter {
}
await this.db.insert(COLLECTIONS.PINS, pin)
this.guild.gossipPin(pin)
this._invalidatePinListCache()
this.emit('pin', pin)
const pinRows = await this.db.find(COLLECTIONS.PINS, { channelId: pin.channelId })
span.end({
@@ -19477,6 +19489,7 @@ class PearcordPlatform extends EventEmitter {
await this.db.insert(COLLECTIONS.PINS, pin)
}
if (this.dm?.gossipPin) this.dm.gossipPin(pin)
this._invalidatePinListCache()
this.emit('pin', pin)
const pinRows = this.dm?.listPins
? await this.dm.listPins(pin.channelId)
@@ -19521,6 +19534,7 @@ class PearcordPlatform extends EventEmitter {
messageId
})
const pinRows = await this.db.find(COLLECTIONS.PINS, { channelId: this.activeChannelId })
this._invalidatePinListCache()
this.emit('pin', { channelId: this.activeChannelId, messageId, removed: true })
span.end({
channelId: this.activeChannelId,
@@ -20045,7 +20059,6 @@ class PearcordPlatform extends EventEmitter {
this.mode === 'dm' ? DM_GUILD_ID : this.guild?.guild?.id || null
const cacheKey = `${reactionGuildId || ''}:${this.activeChannelId || ''}:${this._reactionListCacheGen}`
if (
light &&
this._reactionListCacheKey === cacheKey &&
this._reactionListCache?.reactions
) {
@@ -20117,10 +20130,15 @@ class PearcordPlatform extends EventEmitter {
if (mem.nickname) mentionNames.add(mem.nickname)
}
if (this.activeChannelId && (guild || this.mode === 'dm')) {
pins = await this._channelPins(
this.activeChannelId,
guild?.id || DM_GUILD_ID
)
const pinGuildId = guild?.id || DM_GUILD_ID
const pinCacheKey = `${pinGuildId}:${this.activeChannelId || ''}:${this._pinListCacheGen || 0}`
if (this._pinListCacheKey === pinCacheKey && Array.isArray(this._pinListCache?.pins)) {
pins = this._pinListCache.pins
} else {
pins = await this._channelPins(this.activeChannelId, pinGuildId)
this._pinListCacheKey = pinCacheKey
this._pinListCache = { pins }
}
}
const channelSettings = {}
const mentionAlerts = {}