@bamdra/bamdra-user-bind 0.1.9 → 0.1.10

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,68 @@
1
1
  # bamdra-user-bind
2
2
 
3
- `bamdra-user-bind` is the identity and profile binding plugin for the Bamdra OpenClaw suite.
3
+ The identity and living profile layer for the Bamdra suite.
4
4
 
5
- It resolves channel-facing sender identifiers into a stable user boundary, stores user profile data locally, supports Feishu-oriented identity resolution, and exposes admin-safe tooling for querying and editing profile records.
5
+ It can run independently, and it is also auto-provisioned by `bamdra-openclaw-memory`.
6
6
 
7
- ## What It Does
7
+ [中文文档](./README.zh-CN.md)
8
8
 
9
- - resolves `channel + sender.id` into a stable `userId`
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
+ ## What it does
15
10
 
16
- ## Open Source Contents
11
+ `bamdra-user-bind` turns raw channel sender IDs into a stable user boundary.
17
12
 
18
- This repository already contains the actual plugin source code for the current open-source version.
13
+ It also becomes the user's evolving profile layer, including:
19
14
 
20
- - source entrypoint:
21
- [src/index.ts](/Users/wood/workspace/macmini-openclaw/openclaw-enhanced/bamdra-user-bind/src/index.ts)
22
- - plugin manifest:
23
- [openclaw.plugin.json](/Users/wood/workspace/macmini-openclaw/openclaw-enhanced/bamdra-user-bind/openclaw.plugin.json)
24
- - package metadata:
25
- [package.json](/Users/wood/workspace/macmini-openclaw/openclaw-enhanced/bamdra-user-bind/package.json)
15
+ - preferred address
16
+ - timezone
17
+ - tone preferences
18
+ - role
19
+ - long-lived user notes
26
20
 
27
- The file count is intentionally small because this first public version is shipped as a compact plugin rather than a multi-package codebase.
21
+ ## Why it matters
28
22
 
29
- ## Current Storage Model
23
+ Without an identity layer:
30
24
 
31
- - runtime primary store:
32
- `~/.openclaw/data/bamdra-user-bind/profiles.sqlite`
33
- - editable per-user Markdown mirror:
34
- `~/.openclaw/data/bamdra-user-bind/profiles/private/{userId}.md`
35
- - export directory:
36
- `~/.openclaw/data/bamdra-user-bind/exports/`
37
-
38
- The runtime queries the SQLite store as the controlled source of truth. The Markdown mirror exists so humans can edit a per-user profile the way they would edit a `USER.md`-style file, without turning the whole directory into an unrestricted agent-readable knowledge base.
25
+ - the same person can fragment across channels or sessions
26
+ - memory can attach to the wrong boundary
27
+ - personalization becomes fragile
39
28
 
40
- The Markdown mirror root is configurable through `profileMarkdownRoot`.
29
+ With it:
41
30
 
42
- ## Default Profile Starter
31
+ - user-aware memory becomes stable
32
+ - personalization survives new sessions
33
+ - the assistant can gradually adapt to the user's style and working habits
43
34
 
44
- New profile mirrors start with a practical template, including example defaults such as:
35
+ ## Storage model
45
36
 
46
- - preferred address: `老板`
47
- - timezone: `Asia/Shanghai`
48
- - preference: `幽默诙谐的对话风格,但是不过分`
37
+ - primary store:
38
+ `~/.openclaw/data/bamdra-user-bind/profiles.sqlite`
39
+ - editable Markdown mirrors:
40
+ `~/.openclaw/data/bamdra-user-bind/profiles/private/{userId}.md`
41
+ - export directory:
42
+ `~/.openclaw/data/bamdra-user-bind/exports/`
49
43
 
50
- Users can edit that Markdown directly and the plugin will sync the changes back into the controlled store.
44
+ The SQLite store is the controlled source of truth.
51
45
 
52
- ## Security Boundary
46
+ The Markdown mirror is for humans, so profiles stay editable like a living per-user guide instead of becoming a hidden black box.
53
47
 
54
- - normal agents can only read the current resolved user
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
48
+ ## Best practice
58
49
 
59
- ## Relationship To Other Repositories
50
+ - keep SQLite local
51
+ - keep profile mirrors private
52
+ - let humans edit the mirror gradually
53
+ - use admin tools only for audit, merge, repair, and maintenance
60
54
 
61
- - standalone:
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`
55
+ ## What it unlocks
67
56
 
68
- ## Bundled Skills
57
+ With `bamdra-openclaw-memory`:
69
58
 
70
- This package now ships standalone skills under `skills/`:
59
+ - memory becomes user-aware instead of session-only
71
60
 
72
- - `bamdra-user-bind-profile`
73
- - `bamdra-user-bind-admin`
61
+ With `bamdra-memory-vector`:
74
62
 
75
- When installed into OpenClaw, bootstrap can materialize these into `~/.openclaw/skills/` and attach them automatically.
63
+ - private notes stay private while still influencing local recall
76
64
 
77
- ## Build
65
+ ## Repository
78
66
 
79
- ```bash
80
- pnpm run bundle
81
- ```
67
+ - [GitHub organization](https://github.com/bamdra)
68
+ - [Repository](https://github.com/bamdra/bamdra-user-bind)
package/README.zh-CN.md CHANGED
@@ -1,79 +1,68 @@
1
1
  # bamdra-user-bind
2
2
 
3
- `bamdra-user-bind` 是 Bamdra OpenClaw 套件中的身份与画像绑定插件,但它本身也可以独立运行。
3
+ Bamdra 套件中的身份与“活画像”层。
4
4
 
5
- ## 它做什么
5
+ 它可以独立运行,也会被 `bamdra-openclaw-memory` 自动补齐。
6
6
 
7
- - 把 `channel + sender.id` 解析成稳定的 `userId`
8
- - 在本地 SQLite 中保存绑定关系和用户画像
9
- - 导出可读备份文件,方便排查和恢复
10
- - 把身份解析结果注入运行时上下文,供下游记忆插件使用
11
- - 普通 agent 无法读取其他用户的私有资料
12
- - 管理员工具支持自然语言查询、编辑、合并、巡检与重同步
7
+ [English README](./README.md)
13
8
 
14
- ## 开源内容说明
9
+ ## 它做什么
15
10
 
16
- 当前开源版的实际源码已经包含在这个仓库里。
11
+ `bamdra-user-bind` 会把渠道里的原始 sender ID 转成稳定用户边界。
17
12
 
18
- - 源码入口:
19
- [src/index.ts](/Users/wood/workspace/macmini-openclaw/openclaw-enhanced/bamdra-user-bind/src/index.ts)
20
- - 插件清单:
21
- [openclaw.plugin.json](/Users/wood/workspace/macmini-openclaw/openclaw-enhanced/bamdra-user-bind/openclaw.plugin.json)
22
- - 包元数据:
23
- [package.json](/Users/wood/workspace/macmini-openclaw/openclaw-enhanced/bamdra-user-bind/package.json)
13
+ 同时,它也会逐渐成为用户持续演化的画像层,包括:
24
14
 
25
- 文件数量目前比较少,是因为首个公开版本采用了紧凑单入口插件的形式,而不是多包拆分结构。
15
+ - 应该怎么称呼
16
+ - 时区
17
+ - 语气偏好
18
+ - 角色
19
+ - 长期用户备注
26
20
 
27
- ## 当前存储模型
21
+ ## 为什么重要
28
22
 
29
- - 运行时主存储:
30
- `~/.openclaw/data/bamdra-user-bind/profiles.sqlite`
31
- - 可编辑的用户画像 Markdown 镜像:
32
- `~/.openclaw/data/bamdra-user-bind/profiles/private/{userId}.md`
33
- - 导出目录:
34
- `~/.openclaw/data/bamdra-user-bind/exports/`
23
+ 没有身份层时:
35
24
 
36
- 运行时只查询 SQLite 主库,Markdown 镜像是给人维护的用户画像层,导出文件则用于备份和人工查看。
25
+ - 同一个人可能在不同渠道或会话里碎片化
26
+ - 记忆可能挂错边界
27
+ - 个性化很难稳定
37
28
 
38
- `profileMarkdownRoot` 可以改成你自己的目录,例如 Obsidian 仓库中的私有画像目录。
29
+ 有了它之后:
39
30
 
40
- ## 默认画像模板
31
+ - user-aware 记忆会稳定下来
32
+ - 个性化会跨 session 持续存在
33
+ - 智能体会逐步适应用户的风格和习惯
41
34
 
42
- 新画像文件会带一个起步模板,默认示例包括:
35
+ ## 存储模型
43
36
 
44
- - 建议称呼:`老板`
45
- - 时区:`Asia/Shanghai`
46
- - 偏好:`幽默诙谐的对话风格,但是不过分`
37
+ - 主存储:
38
+ `~/.openclaw/data/bamdra-user-bind/profiles.sqlite`
39
+ - 可编辑 Markdown 镜像:
40
+ `~/.openclaw/data/bamdra-user-bind/profiles/private/{userId}.md`
41
+ - 导出目录:
42
+ `~/.openclaw/data/bamdra-user-bind/exports/`
47
43
 
48
- 用户可以直接编辑这份 Markdown,插件会把改动同步回受控存储。
44
+ SQLite 是受控主源。
49
45
 
50
- ## 安全边界
46
+ Markdown 镜像则是给人编辑的,让用户画像更像一份活的 per-user 指南,而不是一个无法触达的黑盒。
51
47
 
52
- - 普通 agent 只能读取当前用户
53
- - 跨用户访问由实现层直接拒绝,不依赖 prompt 约束
54
- - 管理员动作通过专用工具执行
55
- - 管理员查询、编辑、合并、同步与拒绝访问都会留下审计记录
48
+ ## 最佳实践
56
49
 
57
- ## 与其他仓库的关系
50
+ - SQLite 留在本地
51
+ - 画像镜像保持私有
52
+ - 让人逐步维护画像镜像
53
+ - 管理员能力只用于审计、合并、修复和维护
58
54
 
59
- - 独立运行:
60
- 本身就可以作为身份插件使用
61
- - 自动配套:
62
- 通过 npm 安装 `bamdra-openclaw-memory` 时,主插件可以在 bootstrap 过程中自动补齐它
63
- - 可选配套:
64
- `bamdra-memory-vector`
55
+ ## 它能解锁什么
65
56
 
66
- ## 随包 Skill
57
+ `bamdra-openclaw-memory` 组合时:
67
58
 
68
- 这个包会附带独立 skill:
59
+ - 记忆会从 session-only 变成真正的 user-aware
69
60
 
70
- - `bamdra-user-bind-profile`
71
- - `bamdra-user-bind-admin`
61
+ `bamdra-memory-vector` 组合时:
72
62
 
73
- 安装到 OpenClaw 后,bootstrap 可以把它们复制到 `~/.openclaw/skills/` 并自动挂到合适的 agent。
63
+ - 私有笔记既能保持私有,又能影响本地召回
74
64
 
75
- ## 构建
65
+ ## 仓库地址
76
66
 
77
- ```bash
78
- pnpm run bundle
79
- ```
67
+ - [GitHub 首页](https://github.com/bamdra)
68
+ - [仓库地址](https://github.com/bamdra/bamdra-user-bind)
@@ -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.9",
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.9",
3
+ "version": "0.1.10",
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",