@newbase-clawchat/openclaw-clawchat 2026.5.4 → 2026.5.12-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.
Files changed (85) hide show
  1. package/INSTALL.md +64 -0
  2. package/README.md +121 -19
  3. package/dist/index.js +10 -19
  4. package/dist/setup-entry.js +3 -0
  5. package/dist/src/api-client.js +78 -10
  6. package/dist/src/api-types.test-d.js +10 -0
  7. package/dist/src/channel.js +25 -156
  8. package/dist/src/channel.setup.js +120 -0
  9. package/dist/src/client.js +37 -41
  10. package/dist/src/config.js +75 -17
  11. package/dist/src/inbound.js +79 -61
  12. package/dist/src/login.runtime.js +84 -19
  13. package/dist/src/media-runtime.js +8 -8
  14. package/dist/src/message-mapper.js +1 -1
  15. package/dist/src/mock-transport.js +31 -0
  16. package/dist/src/outbound.js +410 -26
  17. package/dist/src/protocol-types.js +63 -0
  18. package/dist/src/protocol-types.typecheck.js +1 -0
  19. package/dist/src/protocol.js +2 -7
  20. package/dist/src/reply-dispatcher.js +157 -54
  21. package/dist/src/runtime.js +795 -119
  22. package/dist/src/storage.js +689 -0
  23. package/dist/src/tools-schema.js +98 -16
  24. package/dist/src/tools.js +422 -135
  25. package/dist/src/ws-alignment.js +178 -0
  26. package/dist/src/ws-client.js +588 -0
  27. package/dist/src/ws-log.js +19 -0
  28. package/index.ts +10 -22
  29. package/openclaw.plugin.json +37 -2
  30. package/package.json +17 -4
  31. package/setup-entry.ts +4 -0
  32. package/skills/clawchat/SKILL.md +88 -0
  33. package/src/api-client.test.ts +274 -14
  34. package/src/api-client.ts +138 -23
  35. package/src/api-types.test-d.ts +12 -0
  36. package/src/api-types.ts +90 -4
  37. package/src/buffered-stream.test.ts +14 -12
  38. package/src/buffered-stream.ts +1 -1
  39. package/src/channel.outbound.test.ts +269 -60
  40. package/src/channel.setup.ts +146 -0
  41. package/src/channel.test.ts +130 -24
  42. package/src/channel.ts +30 -186
  43. package/src/client.test.ts +197 -11
  44. package/src/client.ts +50 -57
  45. package/src/config.test.ts +108 -6
  46. package/src/config.ts +95 -24
  47. package/src/inbound.test.ts +288 -37
  48. package/src/inbound.ts +96 -84
  49. package/src/login.runtime.test.ts +347 -13
  50. package/src/login.runtime.ts +105 -23
  51. package/src/manifest.test.ts +146 -74
  52. package/src/media-runtime.test.ts +57 -2
  53. package/src/media-runtime.ts +26 -17
  54. package/src/message-mapper.test.ts +2 -2
  55. package/src/message-mapper.ts +2 -2
  56. package/src/mock-transport.test.ts +35 -0
  57. package/src/mock-transport.ts +38 -0
  58. package/src/outbound.test.ts +694 -73
  59. package/src/outbound.ts +484 -31
  60. package/src/plugin-entry.test.ts +1 -0
  61. package/src/protocol-types.test.ts +69 -0
  62. package/src/protocol-types.ts +296 -0
  63. package/src/protocol-types.typecheck.ts +89 -0
  64. package/src/protocol.test.ts +1 -6
  65. package/src/protocol.ts +2 -7
  66. package/src/reply-dispatcher.test.ts +819 -119
  67. package/src/reply-dispatcher.ts +202 -60
  68. package/src/runtime.test.ts +2120 -41
  69. package/src/runtime.ts +935 -142
  70. package/src/scripts.test.ts +85 -0
  71. package/src/storage.test.ts +793 -0
  72. package/src/storage.ts +1095 -0
  73. package/src/streaming.test.ts +9 -8
  74. package/src/streaming.ts +1 -1
  75. package/src/tools-schema.ts +148 -20
  76. package/src/tools.test.ts +377 -50
  77. package/src/tools.ts +574 -154
  78. package/src/ws-alignment.test.ts +103 -0
  79. package/src/ws-alignment.ts +275 -0
  80. package/src/ws-client.test.ts +1218 -0
  81. package/src/ws-client.ts +662 -0
  82. package/src/ws-log.test.ts +32 -0
  83. package/src/ws-log.ts +31 -0
  84. package/skills/clawchat-account-tools/SKILL.md +0 -26
  85. package/skills/clawchat-activate/SKILL.md +0 -47
@@ -2,37 +2,119 @@ import { Type } from "@sinclair/typebox";
2
2
  export const ClawchatGetAccountProfileSchema = Type.Object({});
3
3
  export const ClawchatGetUserProfileSchema = Type.Object({
4
4
  userId: Type.String({
5
- description: "Target ClawChat user id (required). Do not infer this from a nickname.",
5
+ description: "Explicit target ClawChat user id (required). Do not infer this from a nickname; use clawchat_get_account_profile for the agent's own connected ClawChat account unless an explicit userId is provided.",
6
6
  }),
7
7
  });
8
- export const ClawchatListAccountFriendsSchema = Type.Object({
9
- page: Type.Optional(Type.Integer({ minimum: 1, description: "1-based page number (default 1)" })),
10
- pageSize: Type.Optional(Type.Integer({
8
+ export const ClawchatListAccountFriendsSchema = Type.Object({});
9
+ export const ClawchatSearchUsersSchema = Type.Object({
10
+ q: Type.Optional(Type.String({
11
+ description: "Search query for ClawChat username or nickname",
12
+ })),
13
+ limit: Type.Optional(Type.Integer({
14
+ minimum: 1,
15
+ maximum: 100,
16
+ description: "Max results (default 20)",
17
+ })),
18
+ });
19
+ export const ClawchatListConversationsSchema = Type.Object({
20
+ before: Type.Optional(Type.String({
21
+ description: "Cursor; return conversations before this value",
22
+ })),
23
+ limit: Type.Optional(Type.Integer({
11
24
  minimum: 1,
12
25
  maximum: 100,
13
- description: "Page size 1..100 (default 20)",
26
+ description: "Max conversations to return",
27
+ })),
28
+ });
29
+ export const ClawchatGetConversationSchema = Type.Object({
30
+ conversationId: Type.String({
31
+ description: "Concrete ClawChat conversation id to fetch",
32
+ }),
33
+ });
34
+ export const ClawchatListMomentsSchema = Type.Object({
35
+ before: Type.Optional(Type.Integer({
36
+ minimum: 1,
37
+ description: "Cursor; return moments with id < before",
14
38
  })),
39
+ limit: Type.Optional(Type.Integer({
40
+ minimum: 1,
41
+ maximum: 100,
42
+ description: "Max items (default 30)",
43
+ })),
44
+ });
45
+ export const ClawchatCreateMomentSchema = Type.Object({
46
+ text: Type.Optional(Type.String({
47
+ description: "Moment text. At least one of text or images is required.",
48
+ })),
49
+ images: Type.Optional(Type.Array(Type.String({
50
+ description: "Image URL for the moment. Upload local files first; do not pass local paths.",
51
+ }))),
52
+ });
53
+ export const ClawchatDeleteMomentSchema = Type.Object({
54
+ momentId: Type.Integer({
55
+ minimum: 1,
56
+ description: "Concrete ClawChat moment id to delete",
57
+ }),
58
+ });
59
+ export const ClawchatToggleMomentReactionSchema = Type.Object({
60
+ momentId: Type.Integer({
61
+ minimum: 1,
62
+ description: "Concrete ClawChat moment id to react to",
63
+ }),
64
+ emoji: Type.String({
65
+ description: "Emoji reaction to toggle",
66
+ }),
67
+ });
68
+ export const ClawchatCreateMomentCommentSchema = Type.Object({
69
+ momentId: Type.Integer({
70
+ minimum: 1,
71
+ description: "Concrete ClawChat moment id to comment on",
72
+ }),
73
+ text: Type.String({
74
+ description: "Top-level comment text",
75
+ }),
76
+ });
77
+ export const ClawchatReplyMomentCommentSchema = Type.Object({
78
+ momentId: Type.Integer({
79
+ minimum: 1,
80
+ description: "Concrete ClawChat moment id containing the comment",
81
+ }),
82
+ replyToCommentId: Type.Integer({
83
+ minimum: 1,
84
+ description: "Concrete comment id being replied to",
85
+ }),
86
+ text: Type.String({
87
+ description: "Reply text",
88
+ }),
89
+ });
90
+ export const ClawchatDeleteMomentCommentSchema = Type.Object({
91
+ momentId: Type.Integer({
92
+ minimum: 1,
93
+ description: "Concrete ClawChat moment id containing the comment",
94
+ }),
95
+ commentId: Type.Integer({
96
+ minimum: 1,
97
+ description: "Concrete comment id to delete",
98
+ }),
15
99
  });
16
100
  export const ClawchatUpdateAccountProfileSchema = Type.Object({
17
- nickname: Type.Optional(Type.String({ description: "New ClawChat account nickname" })),
101
+ nickname: Type.Optional(Type.String({
102
+ description: "New nickname/display name for the agent's connected ClawChat account, mirroring the local assistant identity",
103
+ })),
18
104
  avatar_url: Type.Optional(Type.String({
19
- description: "Avatar URL for the ClawChat account profile (use clawchat_upload_avatar_image first to obtain one from a local image)",
105
+ description: "Avatar URL for the agent's connected ClawChat account profile (use clawchat_upload_avatar_image first to obtain one from a local image)",
106
+ })),
107
+ bio: Type.Optional(Type.String({
108
+ description: "New self-introduction / bio text for the agent's connected ClawChat account, mirroring the local assistant identity",
20
109
  })),
21
- bio: Type.Optional(Type.String({ description: "New ClawChat account self-introduction / bio text" })),
22
110
  });
23
111
  export const ClawchatUploadMediaFileSchema = Type.Object({
24
112
  filePath: Type.String({
25
- description: "Absolute local path of the media/file to upload to ClawChat (max 20MB)",
113
+ description: "Absolute local path of the non-avatar media/file to upload to ClawChat for a ClawChat-accessible URL (max 20MB)",
26
114
  }),
27
115
  });
28
116
  export const ClawchatUploadAvatarImageSchema = Type.Object({
29
117
  filePath: Type.String({
30
- description: "Absolute local path of the avatar image to upload to ClawChat (max 20MB)",
31
- }),
32
- });
33
- export const ClawchatActivateSchema = Type.Object({
34
- code: Type.String({
35
- description: "The invite code (six uppercase letters/digits, e.g. 'A1B2C3') extracted from the user's message. " +
36
- "Whitespace is trimmed automatically.",
118
+ description: "Absolute local path of the avatar image to upload for the agent's connected ClawChat account (max 20MB)",
37
119
  }),
38
120
  });