openclaw-plugin-people-memory 0.0.0-stage → 0.0.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.
@@ -0,0 +1,142 @@
1
+ {
2
+ "id": "people",
3
+ "name": "People Memory",
4
+ "description": "Workspace-scoped people and group memory backed by SQLite.",
5
+ "version": "0.0.2",
6
+ "skills": [
7
+ "skills/people-identifier"
8
+ ],
9
+ "activation": {
10
+ "onStartup": true,
11
+ "onCapabilities": [
12
+ "hook"
13
+ ]
14
+ },
15
+ "configSchema": {
16
+ "type": "object",
17
+ "additionalProperties": false,
18
+ "properties": {
19
+ "dataDir": {
20
+ "type": "string",
21
+ "default": "{stateDir}/plugins/people/{workspaceKey}",
22
+ "description": "Data directory template. Defaults to {stateDir}/plugins/people/{workspaceKey} (state dir per workspace, like plugins/<id>). Supports {stateDir}, {workspace}, {workspaceKey}, {agentDir}, {agentId}, {home}."
23
+ },
24
+ "workspaceDataDirs": {
25
+ "type": "object",
26
+ "additionalProperties": {
27
+ "type": "string"
28
+ },
29
+ "default": {},
30
+ "description": "Per-workspace data directory overrides, keyed by absolute workspace path."
31
+ },
32
+ "databaseFile": {
33
+ "type": "string",
34
+ "default": "people.db"
35
+ },
36
+ "injectContext": {
37
+ "type": "boolean",
38
+ "default": true
39
+ },
40
+ "injectGroupMemory": {
41
+ "type": "boolean",
42
+ "default": true
43
+ },
44
+ "injectMaxChars": {
45
+ "type": "number",
46
+ "default": 1200
47
+ },
48
+ "disabledAgents": {
49
+ "type": "array",
50
+ "items": {
51
+ "type": "string"
52
+ },
53
+ "default": []
54
+ },
55
+ "capture": {
56
+ "type": "boolean",
57
+ "default": true
58
+ },
59
+ "captureGroups": {
60
+ "type": "boolean",
61
+ "default": true
62
+ },
63
+ "captureSkipSenders": {
64
+ "type": "array",
65
+ "items": {
66
+ "type": "string"
67
+ },
68
+ "description": "Sender ids (regex, case-insensitive) that never become people. Defaults to system/cron auto-rows like bncr-history-system."
69
+ },
70
+ "importLegacy": {
71
+ "type": "boolean",
72
+ "default": true
73
+ },
74
+ "platformTemplate": {
75
+ "type": "string",
76
+ "default": "{channel}/{account}",
77
+ "description": "Platform label template. {channel} and {account} are filled when available."
78
+ },
79
+ "platformOverrides": {
80
+ "type": "object",
81
+ "additionalProperties": {
82
+ "type": "string"
83
+ },
84
+ "default": {},
85
+ "description": "Per-channel platform templates, for example {\"telegram\":\"telegram\"}."
86
+ },
87
+ "multiAccountChannels": {
88
+ "type": "array",
89
+ "items": {
90
+ "type": "string"
91
+ },
92
+ "default": [
93
+ "bncr"
94
+ ],
95
+ "description": "Multi-backend channel names (e.g. bncr): account keys require a backend segment such as bncr/tgBot. Bare channel writes are deferred or merged into a backend row; bare rows are flagged and cleaned by health/repair."
96
+ },
97
+ "debug": {
98
+ "type": "boolean",
99
+ "default": false
100
+ },
101
+ "senderFamilies": {
102
+ "type": "array",
103
+ "items": {
104
+ "type": "array",
105
+ "items": {
106
+ "type": "string"
107
+ },
108
+ "minItems": 2
109
+ },
110
+ "default": [
111
+ [
112
+ "bncr/GewePlus",
113
+ "bncr/GolemPlus"
114
+ ]
115
+ ],
116
+ "description": "Platform label pairs whose sender ids share one space (GewePlus + GolemPlus are two accesses of the same WeChat platform). Same-sender rows in a family auto-bind to one person; there is no alias concept."
117
+ }
118
+ }
119
+ },
120
+ "contracts": {
121
+ "tools": [
122
+ "people_status",
123
+ "people_lookup",
124
+ "people_remember",
125
+ "people_name",
126
+ "people_note",
127
+ "people_bind",
128
+ "people_forget",
129
+ "people_validate",
130
+ "people_scan_mark",
131
+ "people_bootstrap",
132
+ "people_backup",
133
+ "people_health",
134
+ "people_cycle",
135
+ "people_search",
136
+ "people_dimension",
137
+ "people_merge",
138
+ "people_merge_account",
139
+ "people_unbind"
140
+ ]
141
+ }
142
+ }
package/package.json CHANGED
@@ -1,6 +1,69 @@
1
1
  {
2
2
  "name": "openclaw-plugin-people-memory",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.0.2",
4
+ "type": "module",
5
+ "private": false,
6
+ "description": "Workspace-scoped people and group memory for OpenClaw agents, backed by SQLite.",
7
+ "author": "xmoxmo",
8
+ "license": "MIT",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/xmoxmo/openclaw-plugin-people-memory.git"
12
+ },
13
+ "homepage": "https://github.com/xmoxmo/openclaw-plugin-people-memory#readme",
14
+ "bugs": {
15
+ "url": "https://github.com/xmoxmo/openclaw-plugin-people-memory/issues"
16
+ },
17
+ "publishConfig": {
18
+ "access": "public"
19
+ },
20
+ "keywords": [
21
+ "openclaw",
22
+ "openclaw-plugin",
23
+ "people",
24
+ "memory",
25
+ "identity",
26
+ "sqlite",
27
+ "bncr"
28
+ ],
29
+ "engines": {
30
+ "node": ">=22.5.0"
31
+ },
32
+ "files": [
33
+ "dist",
34
+ "openclaw.plugin.json",
35
+ "README.md",
36
+ "DESIGN.md",
37
+ "LICENSE",
38
+ "assets/**",
39
+ "skills",
40
+ "automation/README.md",
41
+ "automation/cycle.template.md"
42
+ ],
43
+ "scripts": {
44
+ "build": "tsc -p tsconfig.json",
45
+ "typecheck": "tsc -p tsconfig.json --noEmit",
46
+ "test": "node --test tests/*.test.mjs",
47
+ "check": "npm run build && npm test"
48
+ },
49
+ "peerDependencies": {
50
+ "openclaw": ">=2026.8.1"
51
+ },
52
+ "devDependencies": {
53
+ "@types/node": "^24.0.0",
54
+ "typescript": "^7.0.2"
55
+ },
56
+ "openclaw": {
57
+ "extensions": [
58
+ "./dist/index.js"
59
+ ],
60
+ "compat": {
61
+ "pluginApi": ">=2026.8.1",
62
+ "minGatewayVersion": "2026.8.1"
63
+ },
64
+ "build": {
65
+ "openclawVersion": "2026.10.9",
66
+ "pluginSdkVersion": "2026.10.9"
67
+ }
68
+ }
69
+ }
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: people-identifier
3
+ description: "自动识人:people 插件每轮注入 <people_context> 画像与群记忆;用 people_* 工具记称呼、事实和群事件。触发词:我的画像、看看我的画像、我是谁、识人、记住我。"
4
+ ---
5
+
6
+ # People Identifier — 自动识人
7
+
8
+ 本技能是 people 插件的配套提示词。插件负责存储与注入,本技能负责告诉 agent 怎么用。
9
+
10
+ ## 适用范围
11
+
12
+ - 插件读取的是**通用入站元信息**:发送者 id、显示昵称、群标题、是否群聊。任何能提供这些的频道都能用,不绑定平台。
13
+ - 平台标签由 `channel + accountId` 生成:普通频道用频道名;BNCR 一条接入带多个后端,accountId 是后端(`bncr/GewePlus`、`bncr/tgBot` 等)。
14
+ - 同族自动归并只针对 GewePlus 与 GolemPlus(两者 senderid 空间一致);别的频道没有这种同 id 双接入,本来就不需要归并。bot 识别靠群 botNames + `current_role=bot`,是通用逻辑。
15
+ - 频道不提供昵称/群标题时,插件用 `inbound_claim` 被动补录,仍能建档。
16
+
17
+ ## 数据从哪来
18
+
19
+ - 插件按工作区定位 `<workspace>/people/people.db`,同一 workspaceDir 的 agent 共用一份,不同工作区互不可见。
20
+ - 每轮消息前自动建档、同步平台昵称与群标题,并注入 `<people_context>`。
21
+ - 旧 JSON 只作归档,不再读写。
22
+
23
+ ## 每轮怎么做
24
+
25
+ 1. 直接用注入的卡片,不向用户复述卡片内容或流程。
26
+ 2. 本人说「叫我X」→ `people_name { call_name: "X" }`。
27
+ 3. 本人第一人称明确说出事实(所在地、身份、偏好、关系、近期计划)→ `people_remember { content, dimension }`。
28
+ 4. 群规、里程碑、接口或功能变更 → `people_note { summary, category }`。
29
+ 5. 查详细画像 → `people_lookup`;查群 → `people_lookup { group: "<chat_id>" }`。
30
+
31
+ 称呼优先级:call_name → confirmed_name → 平台昵称。称呼不脑补,不用 traits.basic_name 顶替。
32
+
33
+ ## 查画像
34
+
35
+ 1. `people_lookup`(不带参数)取当前发送者画像。
36
+ 2. 返回插件生成的卡片;无记录 → 「你暂时还没有画像记录,多聊聊就有了」。
37
+ 3. 只能查自己的画像,拒绝查别人。
38
+ 4. 即使本人要求查别人,也尽量私信回复,不在群聊贴完整画像。
39
+ 5. 禁止主动发布他人画像。
40
+
41
+ ## 画像整理归并
42
+
43
+ 1. `people_lookup` 查看现有 traits 与 impressions。
44
+ 2. 按维度把 impressions 归并成精炼描述。
45
+ 3. `people_remember { dimension, mode: "replace", content }` 写回;replace 只更新 traits,不追加印象。
46
+ 4. `people_forget { scope: "impressions", match }` 删除被替代的原文,避免误删 traits。
47
+ 5. impressions 收敛在 1-3 条。
48
+ 6. 展示沿用插件卡片:称呼、初次见面、最近、各维度,只显示非空字段。
49
+
50
+ ## 禁止
51
+
52
+ - 直接读写 `people/` 下的 JSON 或 `people.db`。
53
+ - 跑 `merge-platform-accounts`、`people-put`、`call-name` 这类旧工具。
54
+ - 主动绑定人物;只有 owner 明确要求才 `people_bind`。
55
+ - 把扫描流程、插件同步、cron 简报、工具报错写成群记忆或人物事实。
56
+
57
+ ## Failure / Escalation
58
+
59
+ - `people_lookup` 报账号或群歧义(同 chat 多个后端行)→ 按提示改用精确 key `platform:chat_id`,不要猜。
60
+ - 写入报「只允许查自己 / 需要 owner」→ 说明权限边界,不绕过。
61
+ - 插件未加载或工具不存在 → 提示检查 `plugins.entries.people.enabled` 与沙箱 `alsoAllow`,不要改数据库。
62
+ - 发现裸平台行、重复账号、孤儿成员等异常 → 交给周期任务的 `people_cycle` / `people_validate { fix: true }` 处理,不手工改库。
63
+