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 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 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). **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._reactionListCacheKey = ''
this._reactionListCache = null this._reactionListCache = null
this._reactionListCacheGen = 0 this._reactionListCacheGen = 0
this._pinListCacheKey = ''
this._pinListCache = null
this._pinListCacheGen = 0
this._lastReplicationCompact = null this._lastReplicationCompact = null
this._memberPageBurstTimestamps = [] this._memberPageBurstTimestamps = []
this._guildMeshBoundedByGuild = new Map() this._guildMeshBoundedByGuild = new Map()
@@ -754,6 +757,12 @@ class PearcordPlatform extends EventEmitter {
this._reactionListCache = null this._reactionListCache = null
} }
_invalidatePinListCache () {
this._pinListCacheGen = (this._pinListCacheGen || 0) + 1
this._pinListCacheKey = ''
this._pinListCache = null
}
_logMeshChurn (action, extra = {}) { _logMeshChurn (action, extra = {}) {
const guildId = extra.guildId || this.guild?.guild?.id const guildId = extra.guildId || this.guild?.guild?.id
if (!guildId) return if (!guildId) return
@@ -8031,7 +8040,7 @@ class PearcordPlatform extends EventEmitter {
channelId: pin.channelId, channelId: pin.channelId,
messageId: pin.messageId 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, { await this.db.insert(COLLECTIONS.PINS, {
channelId: pin.channelId, channelId: pin.channelId,
messageId: pin.messageId, messageId: pin.messageId,
@@ -8039,6 +8048,7 @@ class PearcordPlatform extends EventEmitter {
pinnedBy: pin.pinnedBy, pinnedBy: pin.pinnedBy,
pinnedAt: coerceSyncUint(pin.pinnedAt, Date.now()) pinnedAt: coerceSyncUint(pin.pinnedAt, Date.now())
}) })
this._invalidatePinListCache()
} }
} }
let added = 0 let added = 0
@@ -19322,6 +19332,7 @@ class PearcordPlatform extends EventEmitter {
removed: true removed: true
} }
if (this.dm?.gossipPin) this.dm.gossipPin(payload) if (this.dm?.gossipPin) this.dm.gossipPin(payload)
this._invalidatePinListCache()
this.emit('pin', payload) this.emit('pin', payload)
span.end({ span.end({
channelId: this.activeChannelId, channelId: this.activeChannelId,
@@ -19426,6 +19437,7 @@ class PearcordPlatform extends EventEmitter {
} }
await this.db.insert(COLLECTIONS.PINS, pin) await this.db.insert(COLLECTIONS.PINS, pin)
this.guild.gossipPin(pin) this.guild.gossipPin(pin)
this._invalidatePinListCache()
this.emit('pin', pin) this.emit('pin', pin)
const pinRows = await this.db.find(COLLECTIONS.PINS, { channelId: pin.channelId }) const pinRows = await this.db.find(COLLECTIONS.PINS, { channelId: pin.channelId })
span.end({ span.end({
@@ -19477,6 +19489,7 @@ class PearcordPlatform extends EventEmitter {
await this.db.insert(COLLECTIONS.PINS, pin) await this.db.insert(COLLECTIONS.PINS, pin)
} }
if (this.dm?.gossipPin) this.dm.gossipPin(pin) if (this.dm?.gossipPin) this.dm.gossipPin(pin)
this._invalidatePinListCache()
this.emit('pin', pin) this.emit('pin', pin)
const pinRows = this.dm?.listPins const pinRows = this.dm?.listPins
? await this.dm.listPins(pin.channelId) ? await this.dm.listPins(pin.channelId)
@@ -19521,6 +19534,7 @@ class PearcordPlatform extends EventEmitter {
messageId messageId
}) })
const pinRows = await this.db.find(COLLECTIONS.PINS, { channelId: this.activeChannelId }) const pinRows = await this.db.find(COLLECTIONS.PINS, { channelId: this.activeChannelId })
this._invalidatePinListCache()
this.emit('pin', { channelId: this.activeChannelId, messageId, removed: true }) this.emit('pin', { channelId: this.activeChannelId, messageId, removed: true })
span.end({ span.end({
channelId: this.activeChannelId, channelId: this.activeChannelId,
@@ -20045,7 +20059,6 @@ class PearcordPlatform extends EventEmitter {
this.mode === 'dm' ? DM_GUILD_ID : this.guild?.guild?.id || null this.mode === 'dm' ? DM_GUILD_ID : this.guild?.guild?.id || null
const cacheKey = `${reactionGuildId || ''}:${this.activeChannelId || ''}:${this._reactionListCacheGen}` const cacheKey = `${reactionGuildId || ''}:${this.activeChannelId || ''}:${this._reactionListCacheGen}`
if ( if (
light &&
this._reactionListCacheKey === cacheKey && this._reactionListCacheKey === cacheKey &&
this._reactionListCache?.reactions this._reactionListCache?.reactions
) { ) {
@@ -20117,10 +20130,15 @@ class PearcordPlatform extends EventEmitter {
if (mem.nickname) mentionNames.add(mem.nickname) if (mem.nickname) mentionNames.add(mem.nickname)
} }
if (this.activeChannelId && (guild || this.mode === 'dm')) { if (this.activeChannelId && (guild || this.mode === 'dm')) {
pins = await this._channelPins( const pinGuildId = guild?.id || DM_GUILD_ID
this.activeChannelId, const pinCacheKey = `${pinGuildId}:${this.activeChannelId || ''}:${this._pinListCacheGen || 0}`
guild?.id || DM_GUILD_ID 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 channelSettings = {}
const mentionAlerts = {} const mentionAlerts = {}