@clawling/clawchat-plugin-openclaw 2026.8.4-2 → 2026.8.5-1
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/src/friend-request-turn.js +83 -0
- package/dist/src/skill-update.js +11 -3
- package/package.json +1 -1
- package/skills/manifest.json +3 -3
- package/src/skill-update.ts +11 -3
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Synthetic reasoning-turn builder for `friend.request` notify.signal events.
|
|
3
|
+
*
|
|
4
|
+
* When the server fires a `friend.request` signal the runtime dispatches one
|
|
5
|
+
* deduped synthetic `message.send` envelope so the agent can reason about the
|
|
6
|
+
* pending request. The prompt text varies by the current "friend.add" permission
|
|
7
|
+
* policy state: a deny policy yields a decline/inform prompt; ask or allow
|
|
8
|
+
* yields a prompt that instructs the agent to review the request via the
|
|
9
|
+
* `clawchat_list_friend_requests` tool.
|
|
10
|
+
*/
|
|
11
|
+
import { EVENT } from "./protocol-types.js";
|
|
12
|
+
/**
|
|
13
|
+
* Returns canned prompt text for a friend-request reasoning turn based on the
|
|
14
|
+
* current "friend.add" permission policy state.
|
|
15
|
+
*
|
|
16
|
+
* - `deny` → inform the agent it should decline; no accept instruction.
|
|
17
|
+
* - `ask` / `allow` → instruct the agent to review the pending request.
|
|
18
|
+
*
|
|
19
|
+
* The requester's user id is embedded so the agent does not go looking up the
|
|
20
|
+
* synthetic sender ("clawchat-friend-request" is not a real user).
|
|
21
|
+
*/
|
|
22
|
+
export function friendRequestPromptFor(state, requesterUserId) {
|
|
23
|
+
const arrived = requesterUserId
|
|
24
|
+
? `A new friend request has arrived from user ${requesterUserId}.`
|
|
25
|
+
: "A new friend request has arrived.";
|
|
26
|
+
if (state === "deny") {
|
|
27
|
+
return [
|
|
28
|
+
arrived,
|
|
29
|
+
"Your current friend-add policy is set to deny.",
|
|
30
|
+
"Do not add this contact.",
|
|
31
|
+
"You may inform the requester that you cannot add them at this time.",
|
|
32
|
+
].join(" ");
|
|
33
|
+
}
|
|
34
|
+
return [
|
|
35
|
+
arrived,
|
|
36
|
+
"Please review the pending request by calling `clawchat_list_friend_requests`",
|
|
37
|
+
"and decide whether to accept it.",
|
|
38
|
+
].join(" ");
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Builds a synthetic `message.send` envelope that triggers one agent reasoning
|
|
42
|
+
* turn for a pending friend request. The envelope shape mirrors the
|
|
43
|
+
* activation-bootstrap envelope; it targets the owner's direct conversation so
|
|
44
|
+
* the agent has context about who it is reasoning for.
|
|
45
|
+
*/
|
|
46
|
+
export function buildFriendRequestEnvelope(params) {
|
|
47
|
+
const { account, state, entityId, ownerConversationId } = params;
|
|
48
|
+
const text = friendRequestPromptFor(state, entityId);
|
|
49
|
+
const now = Date.now();
|
|
50
|
+
// Fall back to ownerUserId only when no activation conversation is recorded:
|
|
51
|
+
// the turn still runs (the agent can act via tools, e.g. accept the request),
|
|
52
|
+
// but its in-chat replies will not be deliverable until activation records
|
|
53
|
+
// the owner conversation.
|
|
54
|
+
return {
|
|
55
|
+
version: "2",
|
|
56
|
+
event: EVENT.MESSAGE_SEND,
|
|
57
|
+
trace_id: `clawchat-plugin-openclaw-friend-request-${entityId}-${now}`,
|
|
58
|
+
emitted_at: now,
|
|
59
|
+
chat_id: ownerConversationId ?? account.ownerUserId,
|
|
60
|
+
chat_type: "direct",
|
|
61
|
+
to: { id: account.userId, type: "direct" },
|
|
62
|
+
sender: {
|
|
63
|
+
id: "clawchat-friend-request",
|
|
64
|
+
type: "direct",
|
|
65
|
+
nick_name: "ClawChat",
|
|
66
|
+
},
|
|
67
|
+
payload: {
|
|
68
|
+
message_id: `clawchat-plugin-openclaw-friend-request-${entityId}-${now}`,
|
|
69
|
+
message_mode: "normal",
|
|
70
|
+
message: {
|
|
71
|
+
body: { fragments: [{ kind: "text", text }] },
|
|
72
|
+
context: { mentions: [], reply: null },
|
|
73
|
+
streaming: {
|
|
74
|
+
status: "static",
|
|
75
|
+
sequence: 0,
|
|
76
|
+
mutation_policy: "sealed",
|
|
77
|
+
started_at: null,
|
|
78
|
+
completed_at: null,
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
}
|
package/dist/src/skill-update.js
CHANGED
|
@@ -55,10 +55,18 @@ import { fileURLToPath } from "node:url";
|
|
|
55
55
|
*/
|
|
56
56
|
export const OFFICIAL_SKILLS_BASE = "https://raw.githubusercontent.com/clawling/clawchat-plugin-install-cli";
|
|
57
57
|
/**
|
|
58
|
-
* Default git ref for the skills tree
|
|
59
|
-
*
|
|
58
|
+
* Default git ref for the skills tree — an immutable `skills-vX.Y.Z` tag, not
|
|
59
|
+
* the moving `main`. Nothing supplies a target version today (the trigger
|
|
60
|
+
* signal is content-free), so this constant is the ref every fetch uses: on
|
|
61
|
+
* `main` a released plugin would follow whatever landed in the skills tree
|
|
62
|
+
* since, and convergence compares raw bytes, so an in-progress edit is enough
|
|
63
|
+
* to prompt the owner for an "update".
|
|
64
|
+
*
|
|
65
|
+
* Moving the pin is a deliberate release: publish the new `skills-vX.Y.Z` tag
|
|
66
|
+
* in the install-cli repo, bump this constant, ship it. `liveware-sample.ts`
|
|
67
|
+
* imports the same ref, so the `livewares` tree at that tag is pinned too.
|
|
60
68
|
*/
|
|
61
|
-
export const DEFAULT_SKILLS_REF = "
|
|
69
|
+
export const DEFAULT_SKILLS_REF = "skills-v1.6.0";
|
|
62
70
|
/** Refuse to treat an absurdly large response as a skill file (defence in depth). */
|
|
63
71
|
export const MAX_SKILL_BYTES = 256 * 1024;
|
|
64
72
|
/** This adapter's host target inside `skills/manifest.json`. */
|
package/package.json
CHANGED
package/skills/manifest.json
CHANGED
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
},
|
|
30
30
|
"hermes": {
|
|
31
31
|
"clawchat-core": {
|
|
32
|
-
"version": "1.
|
|
32
|
+
"version": "1.7.0",
|
|
33
33
|
"path": "hermes/clawchat-core/SKILL.md",
|
|
34
|
-
"sha256": "
|
|
35
|
-
"bytes":
|
|
34
|
+
"sha256": "ea5118a99ddad7c9ce9c1437a4e33fbd76f45572998bb1722a70f4aa5e0e76aa",
|
|
35
|
+
"bytes": 17557
|
|
36
36
|
},
|
|
37
37
|
"clawchat-liveware": {
|
|
38
38
|
"version": "1.1.0",
|
package/src/skill-update.ts
CHANGED
|
@@ -60,10 +60,18 @@ export const OFFICIAL_SKILLS_BASE =
|
|
|
60
60
|
"https://raw.githubusercontent.com/clawling/clawchat-plugin-install-cli";
|
|
61
61
|
|
|
62
62
|
/**
|
|
63
|
-
* Default git ref for the skills tree
|
|
64
|
-
*
|
|
63
|
+
* Default git ref for the skills tree — an immutable `skills-vX.Y.Z` tag, not
|
|
64
|
+
* the moving `main`. Nothing supplies a target version today (the trigger
|
|
65
|
+
* signal is content-free), so this constant is the ref every fetch uses: on
|
|
66
|
+
* `main` a released plugin would follow whatever landed in the skills tree
|
|
67
|
+
* since, and convergence compares raw bytes, so an in-progress edit is enough
|
|
68
|
+
* to prompt the owner for an "update".
|
|
69
|
+
*
|
|
70
|
+
* Moving the pin is a deliberate release: publish the new `skills-vX.Y.Z` tag
|
|
71
|
+
* in the install-cli repo, bump this constant, ship it. `liveware-sample.ts`
|
|
72
|
+
* imports the same ref, so the `livewares` tree at that tag is pinned too.
|
|
65
73
|
*/
|
|
66
|
-
export const DEFAULT_SKILLS_REF = "
|
|
74
|
+
export const DEFAULT_SKILLS_REF = "skills-v1.6.0";
|
|
67
75
|
|
|
68
76
|
/** Refuse to treat an absurdly large response as a skill file (defence in depth). */
|
|
69
77
|
export const MAX_SKILL_BYTES = 256 * 1024;
|