whale-memory-core 0.10.1 → 0.10.2

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/lib/waking.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export function buildWakingBlock(dataDir: string, chatKey: string, opts?: { now?: Date; allowGroup?: boolean }): string
2
2
  export function consumeWaking(dataDir: string, chatKey: string, opts?: { now?: Date; allowGroup?: boolean }): boolean
3
- export function leaveNote(dataDir: string, text: string): { at: string; day: string; text: string }
3
+ export function leaveNote(dataDir: string, text: string): { at: string; day: string; text: string }
4
+ export function isPrivateKey(chatKey: string): boolean
package/lib/waking.js CHANGED
@@ -16,6 +16,11 @@ function mayShow(key, allowGroup) {
16
16
  return Boolean(key) && (allowGroup || PRIVATE_KEY.test(key))
17
17
  }
18
18
 
19
+ // 给宿主用的同一个判断:注入记忆前先问它,别自己写"不是群就行"
20
+ export function isPrivateKey(chatKey) {
21
+ return mayShow(String(chatKey || '').trim(), false)
22
+ }
23
+
19
24
  // 只读:算出「今天该给她看什么」,不写任何文件
20
25
  // 调用方确认真的把这段注入了,再调 consumeWaking 记「已展示」
21
26
  // 安全默认:没有 chatKey、或不是认得出的一对一会话(未显式 allowGroup)→ 返回空
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whale-memory-core",
3
- "version": "0.10.1",
3
+ "version": "0.10.2",
4
4
  "description": "Self-layer autobiographical memory core: then / later, append-only. Vault, evidence and consolidation live in the QQ Agent plugin.",
5
5
  "type": "module",
6
6
  "main": "./index.js",