@hienlh/ppm 0.9.43 → 0.9.44

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hienlh/ppm",
3
- "version": "0.9.43",
3
+ "version": "0.9.44",
4
4
  "description": "Personal Project Manager — mobile-first web IDE with AI assistance",
5
5
  "author": "hienlh",
6
6
  "license": "MIT",
@@ -41,6 +41,9 @@ class PPMBotService {
41
41
  /** Chat IDs that just received identity onboarding prompt */
42
42
  private identityPending = new Set<string>();
43
43
 
44
+ /** Chat IDs where we've already checked for identity (once per session) */
45
+ private hasCheckedIdentity = new Set<string>();
46
+
44
47
  /** Message count per session for periodic memory save */
45
48
  private messageCount = new Map<string, number>();
46
49
 
@@ -92,6 +95,7 @@ class PPMBotService {
92
95
  this.processing.clear();
93
96
  this.messageQueue.clear();
94
97
  this.identityPending.clear();
98
+ this.hasCheckedIdentity.clear();
95
99
  this.messageCount.clear();
96
100
 
97
101
  console.log("[ppmbot] Stopped");
@@ -514,11 +518,19 @@ class PPMBotService {
514
518
  },
515
519
  );
516
520
 
517
- // Capture identity if onboarding was just shown
521
+ // Capture identity: save when onboarding was shown OR when no identity exists
522
+ // (handles server restarts losing the in-memory flag)
518
523
  if (this.identityPending.has(chatId)) {
519
524
  this.identityPending.delete(chatId);
520
525
  this.memory.saveOne("_global", `User identity: ${text}`, "preference", session.sessionId);
521
526
  console.log("[ppmbot] Saved identity memory from onboarding");
527
+ } else if (!this.hasCheckedIdentity.has(chatId)) {
528
+ this.hasCheckedIdentity.add(chatId);
529
+ const globalMems = this.memory.getSummary("_global", 50);
530
+ if (!globalMems.some((m) => m.category === "preference" && /identity/i.test(m.content))) {
531
+ this.memory.saveOne("_global", `User identity: ${text}`, "preference", session.sessionId);
532
+ console.log("[ppmbot] Saved identity memory (first message, no identity found)");
533
+ }
522
534
  }
523
535
 
524
536
  // Periodic memory extraction — fire-and-forget every N messages