@bamdra/bamdra-user-bind 0.1.9 → 0.1.11
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/README.md
CHANGED
|
@@ -1,81 +1,95 @@
|
|
|
1
1
|
# bamdra-user-bind
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+

|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
The identity and living profile layer for the Bamdra suite.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
It can run independently, and it is also auto-provisioned by `bamdra-openclaw-memory`.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
- stores bindings and profiles in a local SQLite store
|
|
11
|
-
- exports human-readable backup files for inspection and recovery
|
|
12
|
-
- injects resolved identity into runtime context for downstream memory plugins
|
|
13
|
-
- blocks normal agents from reading other users' private data
|
|
14
|
-
- exposes separate admin tools for natural-language query, edit, merge, issue review, and resync workflows
|
|
9
|
+
Install directly:
|
|
15
10
|
|
|
16
|
-
|
|
11
|
+
```bash
|
|
12
|
+
openclaw plugins install @bamdra/bamdra-user-bind
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Release package:
|
|
16
|
+
|
|
17
|
+
- GitHub Releases: https://github.com/bamdra/bamdra-user-bind/releases
|
|
18
|
+
- You can also build a local release bundle with `pnpm package:release`
|
|
19
|
+
|
|
20
|
+
[中文文档](./README.zh-CN.md)
|
|
21
|
+
|
|
22
|
+
## What it does
|
|
23
|
+
|
|
24
|
+
`bamdra-user-bind` turns raw channel sender IDs into a stable user boundary.
|
|
25
|
+
|
|
26
|
+
It also becomes the user's evolving profile layer, including:
|
|
27
|
+
|
|
28
|
+
- `userId`-scoped preferred address
|
|
29
|
+
- timezone
|
|
30
|
+
- tone preferences
|
|
31
|
+
- role
|
|
32
|
+
- long-lived user notes
|
|
17
33
|
|
|
18
|
-
|
|
34
|
+
## Profile Policy
|
|
19
35
|
|
|
20
|
-
-
|
|
21
|
-
|
|
22
|
-
-
|
|
23
|
-
|
|
24
|
-
-
|
|
25
|
-
[package.json](/Users/wood/workspace/macmini-openclaw/openclaw-enhanced/bamdra-user-bind/package.json)
|
|
36
|
+
- `userId` is the primary key for personalization
|
|
37
|
+
- preferred address should live in the bound profile, not in scattered workspace `USER.md` files
|
|
38
|
+
- workspace `USER.md` should stay minimal and only keep environment facts
|
|
39
|
+
- if the current turn explicitly asks for a different address, follow the current turn
|
|
40
|
+
- admin tools are for repair, merge, audit, and sync, not for blind bulk rewriting
|
|
26
41
|
|
|
27
|
-
|
|
42
|
+
## Why it matters
|
|
28
43
|
|
|
29
|
-
|
|
44
|
+
Without an identity layer:
|
|
30
45
|
|
|
31
|
-
-
|
|
46
|
+
- the same person can fragment across channels or sessions
|
|
47
|
+
- memory can attach to the wrong boundary
|
|
48
|
+
- personalization becomes fragile
|
|
49
|
+
|
|
50
|
+
With it:
|
|
51
|
+
|
|
52
|
+
- user-aware memory becomes stable
|
|
53
|
+
- personalization survives new sessions
|
|
54
|
+
- the assistant can gradually adapt to the user's style and working habits
|
|
55
|
+
|
|
56
|
+
## Storage model
|
|
57
|
+
|
|
58
|
+
- primary store:
|
|
32
59
|
`~/.openclaw/data/bamdra-user-bind/profiles.sqlite`
|
|
33
|
-
- editable
|
|
60
|
+
- editable Markdown mirrors:
|
|
34
61
|
`~/.openclaw/data/bamdra-user-bind/profiles/private/{userId}.md`
|
|
35
62
|
- export directory:
|
|
36
63
|
`~/.openclaw/data/bamdra-user-bind/exports/`
|
|
37
64
|
|
|
38
|
-
The
|
|
39
|
-
|
|
40
|
-
The Markdown mirror root is configurable through `profileMarkdownRoot`.
|
|
65
|
+
The SQLite store is the controlled source of truth.
|
|
41
66
|
|
|
42
|
-
|
|
67
|
+
The Markdown mirror is for humans, so profiles stay editable like a living per-user guide instead of becoming a hidden black box.
|
|
43
68
|
|
|
44
|
-
|
|
69
|
+
## Best practice
|
|
45
70
|
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
71
|
+
- keep SQLite local
|
|
72
|
+
- keep profile mirrors private
|
|
73
|
+
- let humans edit the mirror gradually
|
|
74
|
+
- use admin tools only for audit, merge, repair, and maintenance
|
|
75
|
+
- when updating how someone is addressed, update the bound profile for that `userId` first
|
|
49
76
|
|
|
50
|
-
|
|
77
|
+
## Architecture
|
|
51
78
|
|
|
52
|
-
|
|
79
|
+

|
|
53
80
|
|
|
54
|
-
|
|
55
|
-
- cross-user reads are denied by implementation, not by prompt wording alone
|
|
56
|
-
- admin actions are separated into dedicated tools
|
|
57
|
-
- audit records are written for admin reads, edits, merges, syncs, and rejected access attempts
|
|
81
|
+
## What it unlocks
|
|
58
82
|
|
|
59
|
-
|
|
83
|
+
With `bamdra-openclaw-memory`:
|
|
60
84
|
|
|
61
|
-
-
|
|
62
|
-
can run independently as a user identity plugin
|
|
63
|
-
- auto companion:
|
|
64
|
-
`bamdra-openclaw-memory` can auto-provision it during npm-based install bootstrap
|
|
65
|
-
- optional companion:
|
|
66
|
-
`bamdra-memory-vector`
|
|
85
|
+
- memory becomes user-aware instead of session-only
|
|
67
86
|
|
|
68
|
-
|
|
87
|
+
With `bamdra-memory-vector`:
|
|
69
88
|
|
|
70
|
-
|
|
89
|
+
- private notes stay private while still influencing local recall
|
|
71
90
|
|
|
72
|
-
|
|
73
|
-
- `bamdra-user-bind-admin`
|
|
91
|
+
## Repository
|
|
74
92
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
```bash
|
|
80
|
-
pnpm run bundle
|
|
81
|
-
```
|
|
93
|
+
- [GitHub organization](https://github.com/bamdra)
|
|
94
|
+
- [Repository](https://github.com/bamdra/bamdra-user-bind)
|
|
95
|
+
- [Releases](https://github.com/bamdra/bamdra-user-bind/releases)
|
package/README.zh-CN.md
CHANGED
|
@@ -1,79 +1,95 @@
|
|
|
1
1
|
# bamdra-user-bind
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
Bamdra 套件中的身份与“活画像”层。
|
|
6
|
+
|
|
7
|
+
它可以独立运行,也会被 `bamdra-openclaw-memory` 自动补齐。
|
|
8
|
+
|
|
9
|
+
单独安装:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
openclaw plugins install @bamdra/bamdra-user-bind
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
发布包下载:
|
|
16
|
+
|
|
17
|
+
- GitHub Releases: https://github.com/bamdra/bamdra-user-bind/releases
|
|
18
|
+
- 本地也可以执行 `pnpm package:release` 生成独立发布包
|
|
19
|
+
|
|
20
|
+
[English README](./README.md)
|
|
4
21
|
|
|
5
22
|
## 它做什么
|
|
6
23
|
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
- 把身份解析结果注入运行时上下文,供下游记忆插件使用
|
|
11
|
-
- 普通 agent 无法读取其他用户的私有资料
|
|
12
|
-
- 管理员工具支持自然语言查询、编辑、合并、巡检与重同步
|
|
24
|
+
`bamdra-user-bind` 会把渠道里的原始 sender ID 转成稳定用户边界。
|
|
25
|
+
|
|
26
|
+
同时,它也会逐渐成为用户持续演化的画像层,包括:
|
|
13
27
|
|
|
14
|
-
|
|
28
|
+
- userid 级别的默认称呼
|
|
29
|
+
- 时区
|
|
30
|
+
- 语气偏好
|
|
31
|
+
- 角色
|
|
32
|
+
- 长期用户备注
|
|
15
33
|
|
|
16
|
-
|
|
34
|
+
## 画像策略
|
|
17
35
|
|
|
18
|
-
-
|
|
19
|
-
|
|
20
|
-
-
|
|
21
|
-
|
|
22
|
-
-
|
|
23
|
-
[package.json](/Users/wood/workspace/macmini-openclaw/openclaw-enhanced/bamdra-user-bind/package.json)
|
|
36
|
+
- `userId` 是画像的主键
|
|
37
|
+
- 默认称呼应当写入该 `userId` 的画像,而不是散落在各个工作区 `USER.md`
|
|
38
|
+
- `USER.md` 只保留运行环境事实,不负责称呼
|
|
39
|
+
- 当当前会话显式要求不同称呼时,以当前会话为准
|
|
40
|
+
- 管理员只做修复、合并、审计和同步,不做批量越权改写
|
|
24
41
|
|
|
25
|
-
|
|
42
|
+
## 为什么重要
|
|
26
43
|
|
|
27
|
-
|
|
44
|
+
没有身份层时:
|
|
28
45
|
|
|
29
|
-
-
|
|
46
|
+
- 同一个人可能在不同渠道或会话里碎片化
|
|
47
|
+
- 记忆可能挂错边界
|
|
48
|
+
- 个性化很难稳定
|
|
49
|
+
|
|
50
|
+
有了它之后:
|
|
51
|
+
|
|
52
|
+
- user-aware 记忆会稳定下来
|
|
53
|
+
- 个性化会跨 session 持续存在
|
|
54
|
+
- 智能体会逐步适应用户的风格和习惯
|
|
55
|
+
|
|
56
|
+
## 存储模型
|
|
57
|
+
|
|
58
|
+
- 主存储:
|
|
30
59
|
`~/.openclaw/data/bamdra-user-bind/profiles.sqlite`
|
|
31
|
-
-
|
|
60
|
+
- 可编辑 Markdown 镜像:
|
|
32
61
|
`~/.openclaw/data/bamdra-user-bind/profiles/private/{userId}.md`
|
|
33
62
|
- 导出目录:
|
|
34
63
|
`~/.openclaw/data/bamdra-user-bind/exports/`
|
|
35
64
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
`profileMarkdownRoot` 可以改成你自己的目录,例如 Obsidian 仓库中的私有画像目录。
|
|
65
|
+
SQLite 是受控主源。
|
|
39
66
|
|
|
40
|
-
|
|
67
|
+
Markdown 镜像则是给人编辑的,让用户画像更像一份活的 per-user 指南,而不是一个无法触达的黑盒。
|
|
41
68
|
|
|
42
|
-
|
|
69
|
+
## 最佳实践
|
|
43
70
|
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
71
|
+
- SQLite 留在本地
|
|
72
|
+
- 画像镜像保持私有
|
|
73
|
+
- 让人逐步维护画像镜像
|
|
74
|
+
- 管理员能力只用于审计、合并、修复和维护
|
|
75
|
+
- 当你要改称呼时,优先改 `userId` 对应画像,不要去改 workspace 的 `USER.md`
|
|
47
76
|
|
|
48
|
-
|
|
77
|
+
## 架构图
|
|
49
78
|
|
|
50
|
-
|
|
79
|
+

|
|
51
80
|
|
|
52
|
-
|
|
53
|
-
- 跨用户访问由实现层直接拒绝,不依赖 prompt 约束
|
|
54
|
-
- 管理员动作通过专用工具执行
|
|
55
|
-
- 管理员查询、编辑、合并、同步与拒绝访问都会留下审计记录
|
|
81
|
+
## 它能解锁什么
|
|
56
82
|
|
|
57
|
-
|
|
83
|
+
与 `bamdra-openclaw-memory` 组合时:
|
|
58
84
|
|
|
59
|
-
-
|
|
60
|
-
本身就可以作为身份插件使用
|
|
61
|
-
- 自动配套:
|
|
62
|
-
通过 npm 安装 `bamdra-openclaw-memory` 时,主插件可以在 bootstrap 过程中自动补齐它
|
|
63
|
-
- 可选配套:
|
|
64
|
-
`bamdra-memory-vector`
|
|
85
|
+
- 记忆会从 session-only 变成真正的 user-aware
|
|
65
86
|
|
|
66
|
-
|
|
87
|
+
与 `bamdra-memory-vector` 组合时:
|
|
67
88
|
|
|
68
|
-
|
|
89
|
+
- 私有笔记既能保持私有,又能影响本地召回
|
|
69
90
|
|
|
70
|
-
|
|
71
|
-
- `bamdra-user-bind-admin`
|
|
91
|
+
## 仓库地址
|
|
72
92
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
```bash
|
|
78
|
-
pnpm run bundle
|
|
79
|
-
```
|
|
93
|
+
- [GitHub 首页](https://github.com/bamdra)
|
|
94
|
+
- [仓库地址](https://github.com/bamdra/bamdra-user-bind)
|
|
95
|
+
- [Releases](https://github.com/bamdra/bamdra-user-bind/releases)
|
package/openclaw.plugin.json
CHANGED
|
@@ -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.
|
|
6
|
+
"version": "0.1.10",
|
|
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.
|
|
3
|
+
"version": "0.1.11",
|
|
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",
|
|
@@ -34,7 +34,8 @@
|
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
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);\"",
|
|
37
|
-
"prepublishOnly": "pnpm run bundle"
|
|
37
|
+
"prepublishOnly": "pnpm run bundle",
|
|
38
|
+
"package:release": "node ./scripts/package-release.mjs"
|
|
38
39
|
},
|
|
39
40
|
"openclaw": {
|
|
40
41
|
"id": "bamdra-user-bind",
|
|
@@ -12,7 +12,7 @@ Its purpose is operational: inspect user bindings, repair incorrect profile fiel
|
|
|
12
12
|
## Allowed Jobs
|
|
13
13
|
|
|
14
14
|
- query a specific user profile or binding by `userId`
|
|
15
|
-
- correct nickname, role, timezone, preferences, or
|
|
15
|
+
- correct nickname, role, timezone, preferences, personality fields, or preferred address
|
|
16
16
|
- merge duplicate user records
|
|
17
17
|
- inspect sync failures and identity resolution issues
|
|
18
18
|
- request a resync for a known user
|
|
@@ -31,6 +31,7 @@ Use the admin tools in natural language:
|
|
|
31
31
|
|
|
32
32
|
- “查询 user:u_123 的画像和绑定关系”
|
|
33
33
|
- “把 user:u_123 的称呼改成老板,时区改成 Asia/Shanghai”
|
|
34
|
+
- “把 user:u_123 的默认称呼改成丰哥”
|
|
34
35
|
- “合并 user:u_old 到 user:u_new”
|
|
35
36
|
- “列出最近的绑定失败问题”
|
|
36
37
|
|
|
@@ -24,12 +24,15 @@ The runtime profile comes from `bamdra-user-bind`.
|
|
|
24
24
|
|
|
25
25
|
Humans can edit the Markdown mirror for the current user, and the plugin will sync that into the controlled store. Treat the bound profile as more authoritative than guesswork.
|
|
26
26
|
|
|
27
|
+
Keep per-user address preferences in the bound profile instead of `USER.md`. `USER.md` should stay minimal and only carry environment facts that are not identity-specific.
|
|
28
|
+
|
|
27
29
|
## Behavior Rules
|
|
28
30
|
|
|
29
31
|
- personalize naturally when the stored profile clearly helps
|
|
30
32
|
- use the stored nickname if the user has not asked for a different form of address in the current turn
|
|
31
33
|
- respect the stored timezone for scheduling, reminders, dates, and time-sensitive explanations
|
|
32
34
|
- prefer the stored tone/style preferences when shaping responses
|
|
35
|
+
- if the profile contains a preferred address, treat it as the default greeting and do not duplicate it in workspace-level `USER.md`
|
|
33
36
|
- if the current turn conflicts with the stored profile, follow the current turn
|
|
34
37
|
- do not invent profile traits that are not present
|
|
35
38
|
|