@bamdra/bamdra-user-bind 0.1.5 → 0.1.7
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/dist/index.js
CHANGED
|
@@ -1156,14 +1156,17 @@ function parseIdentityContext(context) {
|
|
|
1156
1156
|
const message = findNestedRecord(record, ["message"], ["event", "message"], ["payload", "message"]);
|
|
1157
1157
|
const session = findNestedRecord(record, ["session"], ["context", "session"]);
|
|
1158
1158
|
const channel = findNestedRecord(record, ["channel"], ["message", "channel"], ["event", "channel"], ["payload", "channel"]);
|
|
1159
|
-
const
|
|
1159
|
+
const metadata = findNestedRecord(record, ["metadata"]);
|
|
1160
|
+
const input = findNestedRecord(record, ["input"]);
|
|
1161
|
+
const conversation = findNestedRecord(record, ["conversation"]);
|
|
1162
|
+
const metadataText = asNullableString(record.text) ?? asNullableString(message.text) ?? asNullableString(record.content) ?? asNullableString(metadata.text) ?? asNullableString(input.text) ?? asNullableString(findNestedValue(record, ["message", "content", "text"]));
|
|
1160
1163
|
const conversationInfo = metadataText ? extractTaggedJsonBlock(metadataText, "Conversation info (untrusted metadata)") : null;
|
|
1161
1164
|
const senderInfo = metadataText ? extractTaggedJsonBlock(metadataText, "Sender (untrusted metadata)") : null;
|
|
1162
1165
|
const senderIdFromText = metadataText ? extractRegexValue(metadataText, /"sender_id"\s*:\s*"([^"]+)"/) : null;
|
|
1163
1166
|
const senderNameFromText = metadataText ? extractRegexValue(metadataText, /"sender"\s*:\s*"([^"]+)"/) : null;
|
|
1164
1167
|
const senderNameFromMessageLine = metadataText ? extractRegexValue(metadataText, /\]\s*([^\n::]{1,40})\s*[::]/) : null;
|
|
1165
|
-
const sessionId = asNullableString(record.
|
|
1166
|
-
const channelType = asNullableString(record.channelType) ?? asNullableString(channel.type) ?? asNullableString(record.provider) ?? asNullableString(conversationInfo?.provider) ?? inferChannelTypeFromSessionId(sessionId);
|
|
1168
|
+
const sessionId = asNullableString(record.sessionKey) ?? asNullableString(record.sessionId) ?? asNullableString(session.id) ?? asNullableString(conversation.id) ?? asNullableString(metadata.sessionId) ?? asNullableString(input.sessionId) ?? asNullableString(input.session?.id) ?? asNullableString(record.context?.sessionId) ?? asNullableString(conversationInfo?.session_id) ?? asNullableString(conversationInfo?.message_id);
|
|
1169
|
+
const channelType = asNullableString(record.channelType) ?? asNullableString(channel.type) ?? asNullableString(metadata.channelType) ?? asNullableString(conversation?.provider) ?? asNullableString(record.provider) ?? asNullableString(conversationInfo?.provider) ?? inferChannelTypeFromSessionId(sessionId);
|
|
1167
1170
|
const openId = asNullableString(sender.id) ?? asNullableString(sender.open_id) ?? asNullableString(sender.openId) ?? asNullableString(sender.user_id) ?? asNullableString(senderInfo?.id) ?? asNullableString(conversationInfo?.sender_id) ?? senderIdFromText ?? extractOpenIdFromSessionId(sessionId);
|
|
1168
1171
|
const senderName = asNullableString(sender.name) ?? asNullableString(sender.display_name) ?? asNullableString(senderInfo?.name) ?? asNullableString(conversationInfo?.sender) ?? senderNameFromText ?? senderNameFromMessageLine;
|
|
1169
1172
|
return {
|
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.7",
|
|
7
7
|
"main": "./dist/index.js",
|
|
8
8
|
"skills": ["./skills"],
|
|
9
9
|
"configSchema": {
|
package/package.json
CHANGED
|
@@ -52,3 +52,18 @@ Good examples:
|
|
|
52
52
|
- “我更喜欢先给结论,再展开”
|
|
53
53
|
|
|
54
54
|
Do not update the profile for transient moods, one-off formatting requests, or unstable short-term details.
|
|
55
|
+
|
|
56
|
+
## Storage Boundary
|
|
57
|
+
|
|
58
|
+
Treat profile-style facts as private-by-default.
|
|
59
|
+
|
|
60
|
+
These should stay in the current user's profile or user-scoped memory, not `shared` memory:
|
|
61
|
+
|
|
62
|
+
- 称呼方式
|
|
63
|
+
- 时区
|
|
64
|
+
- 对话风格偏好
|
|
65
|
+
- 角色和职责
|
|
66
|
+
- 宠物、家庭、个人背景
|
|
67
|
+
- 当前主要工作和长期个人目标
|
|
68
|
+
|
|
69
|
+
Only treat a statement as shared if the user clearly frames it as a team rule, a reusable public fact, or something that should apply beyond themselves.
|