@bamdra/bamdra-user-bind 0.1.11 → 0.1.13

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.
@@ -3,10 +3,13 @@
3
3
  "type": "tool",
4
4
  "name": "Bamdra User Bind",
5
5
  "description": "Identity resolution, user profile binding, and admin profile tools for OpenClaw channels.",
6
- "version": "0.1.0",
6
+ "version": "0.1.13",
7
7
  "main": "./index.js",
8
+ "skills": [
9
+ "./skills"
10
+ ],
8
11
  "configSchema": {
9
12
  "type": "object",
10
13
  "additionalProperties": true
11
14
  }
12
- }
15
+ }
package/dist/package.json CHANGED
@@ -1,12 +1,41 @@
1
1
  {
2
2
  "name": "@bamdra/bamdra-user-bind",
3
- "version": "0.1.0",
4
- "private": true,
3
+ "version": "0.1.13",
4
+ "description": "Identity resolution, user profile binding, and admin-safe profile tools for OpenClaw channels.",
5
+ "license": "MIT",
6
+ "homepage": "https://www.bamdra.com",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/bamdra/bamdra-user-bind.git"
10
+ },
11
+ "bugs": {
12
+ "url": "https://github.com/bamdra/bamdra-user-bind/issues"
13
+ },
5
14
  "type": "commonjs",
6
15
  "main": "./index.js",
7
16
  "types": "./dist/index.d.ts",
17
+ "files": [
18
+ "dist",
19
+ "skills",
20
+ "openclaw.plugin.json",
21
+ "README.md",
22
+ "LICENSE"
23
+ ],
24
+ "keywords": [
25
+ "openclaw",
26
+ "openclaw-plugin",
27
+ "identity",
28
+ "user-profile",
29
+ "feishu",
30
+ "memory"
31
+ ],
32
+ "engines": {
33
+ "node": ">=22"
34
+ },
8
35
  "scripts": {
9
- "bundle": "node ../../scripts/run-local-bin.mjs tsup && node ../../scripts/prepare-plugin-dist.mjs bamdra-user-bind"
36
+ "bundle": "node ../bamdra-openclaw-memory/scripts/run-local-bin.mjs tsup && node -e \"const fs=require('node:fs');const path='./dist/index.js';const text=fs.readFileSync(path,'utf8').replace(/require\\\\(\\\"sqlite\\\"\\\\)/g,'require(\\\"node:sqlite\\\")');fs.writeFileSync(path,text);\" && node ./scripts/prepare-plugin-dist.mjs",
37
+ "prepublishOnly": "pnpm run bundle",
38
+ "package:release": "node ./scripts/package-release.mjs"
10
39
  },
11
40
  "openclaw": {
12
41
  "id": "bamdra-user-bind",
@@ -22,8 +51,11 @@
22
51
  "default": "./dist/index.js"
23
52
  }
24
53
  },
54
+ "publishConfig": {
55
+ "access": "public"
56
+ },
25
57
  "dependencies": {},
26
58
  "devDependencies": {
27
59
  "@types/node": "^24.5.2"
28
60
  }
29
- }
61
+ }
@@ -3,7 +3,7 @@
3
3
  "type": "tool",
4
4
  "name": "Bamdra User Bind",
5
5
  "description": "Identity resolution, user profile binding, and admin profile tools for OpenClaw channels.",
6
- "version": "0.1.10",
6
+ "version": "0.1.13",
7
7
  "main": "./dist/index.js",
8
8
  "skills": ["./skills"],
9
9
  "configSchema": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bamdra/bamdra-user-bind",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
4
  "description": "Identity resolution, user profile binding, and admin-safe profile tools for OpenClaw channels.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://www.bamdra.com",
@@ -33,7 +33,7 @@
33
33
  "node": ">=22"
34
34
  },
35
35
  "scripts": {
36
- "bundle": "node ../bamdra-openclaw-memory/scripts/run-local-bin.mjs tsup && node -e \"const fs=require('node:fs');const path='./dist/index.js';const text=fs.readFileSync(path,'utf8').replace(/require\\\\(\\\"sqlite\\\"\\\\)/g,'require(\\\"node:sqlite\\\")');fs.writeFileSync(path,text);\"",
36
+ "bundle": "node ../bamdra-openclaw-memory/scripts/run-local-bin.mjs tsup && node -e \"const fs=require('node:fs');const path='./dist/index.js';const text=fs.readFileSync(path,'utf8').replace(/require\\\\(\\\"sqlite\\\"\\\\)/g,'require(\\\"node:sqlite\\\")');fs.writeFileSync(path,text);\" && node ./scripts/prepare-plugin-dist.mjs",
37
37
  "prepublishOnly": "pnpm run bundle",
38
38
  "package:release": "node ./scripts/package-release.mjs"
39
39
  },
@@ -30,7 +30,7 @@ Use the admin tools in natural language:
30
30
  ## Good Requests
31
31
 
32
32
  - “查询 user:u_123 的画像和绑定关系”
33
- - “把 user:u_123 的称呼改成老板,时区改成 Asia/Shanghai
33
+ - “把 user:u_123 的称呼改成老板,时区改成 Europe/Berlin
34
34
  - “把 user:u_123 的默认称呼改成丰哥”
35
35
  - “合并 user:u_old 到 user:u_new”
36
36
  - “列出最近的绑定失败问题”
@@ -42,3 +42,5 @@ Use the admin tools in natural language:
42
42
  - if a request is ambiguous, narrow it before making changes
43
43
  - remember that every admin action is auditable
44
44
  - do not expose unrelated users when answering a narrow admin query
45
+ - do not use admin tools as a shortcut for answering the current user's own profile or address preference
46
+ - if the issue is that the current session cannot resolve the user, repair the binding first, then let the normal self-profile flow continue
@@ -28,6 +28,7 @@ Keep per-user address preferences in the bound profile instead of `USER.md`. `US
28
28
 
29
29
  ## Behavior Rules
30
30
 
31
+ - before replying, quietly fetch the current bound profile and use it as a soft personalization hint rather than announcing the lookup
31
32
  - personalize naturally when the stored profile clearly helps
32
33
  - use the stored nickname if the user has not asked for a different form of address in the current turn
33
34
  - respect the stored timezone for scheduling, reminders, dates, and time-sensitive explanations
@@ -35,6 +36,90 @@ Keep per-user address preferences in the bound profile instead of `USER.md`. `US
35
36
  - if the profile contains a preferred address, treat it as the default greeting and do not duplicate it in workspace-level `USER.md`
36
37
  - if the current turn conflicts with the stored profile, follow the current turn
37
38
  - do not invent profile traits that are not present
39
+ - if the current open id fails to match a bound user, first try the identity refresh and channel resolution path to recover the real uid before treating the profile as missing
40
+ - remember that one real user may correspond to multiple open ids across apps or accounts; prefer repairing the binding over creating parallel personas
41
+ - if the identity is recovered but the profile is sparse, create only a lightweight default profile and continue naturally
42
+ - when a lightweight default profile is in use, ask at most one or two brief, human questions such as how to address the user or what communication style they prefer
43
+ - phrase onboarding naturally, for example as a first-time acquaintance check, not as a database form or a profile interrogation
44
+ - once the user gives a stable preference like preferred address or collaboration style, update their bound profile immediately instead of leaving it in `USER.md`
45
+
46
+ ## Tool Actions
47
+
48
+ Use the profile tools as an action loop, not as a passive reference.
49
+
50
+ 1. Before replying, call `bamdra_user_bind_get_my_profile`.
51
+ 2. If current identity looks missing or stale, call `bamdra_user_bind_refresh_my_binding` first, then read the profile again.
52
+ 3. If the user clearly reveals stable profile information in the current turn, first do a semantic interpretation of what belongs in the user's profile, then call `bamdra_user_bind_update_my_profile` in the same turn.
53
+ 4. After a successful update, reply naturally as if you have already absorbed the preference. Do not say that you "might" remember it later.
54
+
55
+ When the user reveals stable profile information, do not stop at "我记住了" in prose. Actually write it back through the tool.
56
+
57
+ Do not surface internal profile-write failures in the user-facing reply unless the user explicitly asks about the profile system itself. Avoid lines like "系统画像更新遇到了一点技术问题". If the write path needs repair in the background, keep the reply natural and continue serving the user.
58
+
59
+ ## Semantic Extraction Rule
60
+
61
+ Do not rely on phrase matching or a tiny list of trigger sentences.
62
+
63
+ Use model judgment to read the user's natural language and decide whether the message contains stable profile traits that should persist beyond the current turn.
64
+
65
+ Think in terms of profile slots, not keywords:
66
+
67
+ - how the user prefers to be addressed
68
+ - how the user prefers answers to be structured
69
+ - tone and communication style
70
+ - role, responsibility, or identity in the collaboration
71
+ - timezone or durable location context
72
+ - durable dislikes, boundaries, or collaboration constraints
73
+ - long-lived private notes that help future cooperation
74
+
75
+ The same user intent may appear in many surface forms. Treat all of these as equivalent if they carry the same stable meaning:
76
+
77
+ - direct statements
78
+ - soft suggestions
79
+ - casual side remarks
80
+ - corrections to how you addressed them
81
+ - "by the way" comments
82
+ - complaints about prior reply style
83
+ - self-descriptions embedded inside a larger request
84
+
85
+ Extract semantically. Do not wait for the user to say exactly "remember this" or "update my profile".
86
+
87
+ If a message contains both a task request and profile information, do both:
88
+
89
+ - first update the profile with the stable traits you inferred
90
+ - then continue handling the user's actual task
91
+
92
+ Field mapping for `bamdra_user_bind_update_my_profile`:
93
+
94
+ - preferred form of address -> `nickname`
95
+ - communication style or formatting preference -> `preferences`
96
+ - personality or tone preference -> `personality`
97
+ - role or identity in collaboration -> `role`
98
+ - timezone -> `timezone`
99
+ - durable private notes worth remembering -> `notes`
100
+
101
+ When mapping, summarize the stable meaning instead of copying noisy raw text when helpful.
102
+
103
+ Examples of semantic normalization:
104
+
105
+ - "以后别整那么官腔" -> `personality` or `preferences`, not raw transcript dumping
106
+ - "我比较喜欢你先说判断,再展开原因" -> `preferences`
107
+ - "我是这个项目最后拍板的人" -> `role`
108
+ - "别老叫我老师,直接叫我名字就行" -> `nickname` or `notes`, depending on what is clearest
109
+ - "我不喜欢太长铺垫" -> `preferences` or `notes`
110
+
111
+ Examples:
112
+
113
+ - "以后叫我阿丰" -> call `bamdra_user_bind_update_my_profile` with `nickname: "阿丰"`
114
+ - "你先给结论,再展开" -> call `bamdra_user_bind_update_my_profile` with `preferences: "偏好先给结论,再展开"`
115
+ - "说话直接一点,但别太冲" -> call `bamdra_user_bind_update_my_profile` with `personality: "偏好直接、克制、不生硬"`
116
+ - "我常驻 Berlin" -> call `bamdra_user_bind_update_my_profile` with `timezone: "Europe/Berlin"`
117
+ - "我是这个项目的负责人" -> call `bamdra_user_bind_update_my_profile` with `role: "项目负责人"`
118
+
119
+ If one user message contains both service intent and stable profile facts, do both in the same turn:
120
+
121
+ - first update the profile
122
+ - then continue handling the actual request
38
123
 
39
124
  ## Privacy Rules
40
125
 
@@ -42,6 +127,7 @@ Keep per-user address preferences in the bound profile instead of `USER.md`. `US
42
127
  - do not describe the private profile store unless the user asks
43
128
  - do not treat profile storage as a global contact directory
44
129
  - do not ask for profile data that already exists in the bound profile unless it is stale or clearly insufficient
130
+ - do not force explicit profile talk when the information can stay implicit in the response style
45
131
 
46
132
  ## Updating Profile Information
47
133
 
@@ -50,12 +136,22 @@ When the user clearly provides a stable preference or asks to remember how to wo
50
136
  Good examples:
51
137
 
52
138
  - “以后叫我老板”
53
- - “我在 Asia/Shanghai 时区”
139
+ - “我在 Europe/Berlin 时区”
54
140
  - “我偏好幽默一点,但别太浮夸”
55
141
  - “我更喜欢先给结论,再展开”
142
+ - “应该叫我阿丰,不用太正式”
143
+ - “第一次配合的话,你可以先简短一点”
144
+ - “别太像客服,直接一点”
145
+ - “我是这个项目的负责人”
146
+ - “我不喜欢很长的铺垫”
56
147
 
57
148
  Do not update the profile for transient moods, one-off formatting requests, or unstable short-term details.
58
149
 
150
+ Use this stability test:
151
+
152
+ - if it is likely to still help in later conversations, it probably belongs in the profile
153
+ - if it only matters for this single reply, it probably does not
154
+
59
155
  ## Storage Boundary
60
156
 
61
157
  Treat profile-style facts as private-by-default.