aicq-chat-plugin 3.0.1 → 3.1.0
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/index.js +16 -17
- package/openclaw.plugin.json +4 -1
- package/package.json +4 -1
- package/public/index.html +4 -0
package/index.js
CHANGED
|
@@ -161,25 +161,24 @@ function register() {
|
|
|
161
161
|
async function activate(config) {
|
|
162
162
|
await ensureInitialized();
|
|
163
163
|
|
|
164
|
-
//
|
|
164
|
+
// Channel mode: do NOT auto-create a default agent identity.
|
|
165
|
+
// Agent identities are created on-demand via channel.lifecycle.onAccountCreate
|
|
166
|
+
// which is triggered when OpenClaw assigns an agent to this channel.
|
|
167
|
+
// The resolveAccount method also handles auto-creation if needed.
|
|
165
168
|
const agents = _identity.listAgents();
|
|
166
|
-
let currentAgentId;
|
|
167
|
-
if (agents.length === 0) {
|
|
168
|
-
const defaultAgent = _identity.createAgent('agent-' + Date.now(), '默认Agent');
|
|
169
|
-
currentAgentId = defaultAgent.agent_id;
|
|
170
|
-
console.log('[AICQ Channel] Created default agent:', currentAgentId);
|
|
171
|
-
} else {
|
|
172
|
-
currentAgentId = agents[0].agent_id;
|
|
173
|
-
}
|
|
169
|
+
let currentAgentId = agents.length > 0 ? agents[0].agent_id : null;
|
|
174
170
|
|
|
175
|
-
//
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
171
|
+
// Only connect to AICQ server if we have an existing agent
|
|
172
|
+
if (currentAgentId) {
|
|
173
|
+
try {
|
|
174
|
+
await _serverClient.start(currentAgentId);
|
|
175
|
+
await syncFriendsFromServer(currentAgentId);
|
|
176
|
+
await syncGroupsFromServer(currentAgentId);
|
|
177
|
+
} catch (e) {
|
|
178
|
+
console.error('[AICQ Channel] Initial server connection failed:', e.message);
|
|
179
|
+
}
|
|
180
|
+
} else {
|
|
181
|
+
console.log('[AICQ Channel] No existing agent — will connect when an agent is assigned via channel.lifecycle.onAccountCreate');
|
|
183
182
|
}
|
|
184
183
|
|
|
185
184
|
return {
|
package/openclaw.plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"kind": "channel",
|
|
3
3
|
"id": "aicq-chat",
|
|
4
4
|
"name": "AICQ Encrypted Chat",
|
|
5
|
-
"version": "3.0
|
|
5
|
+
"version": "3.1.0",
|
|
6
6
|
"description": "End-to-end encrypted chat channel via AICQ protocol — in-process Channel plugin",
|
|
7
7
|
"entry": "index.js",
|
|
8
8
|
"activation": {
|
|
@@ -14,8 +14,11 @@
|
|
|
14
14
|
],
|
|
15
15
|
"channelConfigs": {
|
|
16
16
|
"aicq-chat": {
|
|
17
|
+
"label": "AICQ Encrypted Chat",
|
|
18
|
+
"icon": "🔐",
|
|
17
19
|
"accounts": {
|
|
18
20
|
"type": "object",
|
|
21
|
+
"additionalProperties": false,
|
|
19
22
|
"properties": {
|
|
20
23
|
"accountId": {
|
|
21
24
|
"type": "string",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aicq-chat-plugin",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "AICQ End-to-end Encrypted Chat Channel Plugin for OpenClaw — In-process Channel architecture with friend management, group chat, file transfer, and AI agent communication",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -61,6 +61,9 @@
|
|
|
61
61
|
"node": ">=18.0.0"
|
|
62
62
|
},
|
|
63
63
|
"openclaw": {
|
|
64
|
+
"extensions": [
|
|
65
|
+
"./index.js"
|
|
66
|
+
],
|
|
64
67
|
"channel": {
|
|
65
68
|
"id": "aicq-chat",
|
|
66
69
|
"label": "AICQ Encrypted Chat",
|
package/public/index.html
CHANGED
|
@@ -178,6 +178,10 @@ body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Noto Sans S
|
|
|
178
178
|
</button>
|
|
179
179
|
</div>
|
|
180
180
|
<div class="list-section">
|
|
181
|
+
<div style="padding:8px 12px;font-size:11px;color:#8B6914;background:rgba(212,151,59,0.08);border-bottom:1px solid rgba(212,151,59,0.2);display:flex;align-items:flex-start;gap:6px">
|
|
182
|
+
<span style="flex-shrink:0">⚠️</span>
|
|
183
|
+
<span>若连续30天没有登录,好友关系和主人关系将被清理,到时候需重新绑定主人和添加好友。</span>
|
|
184
|
+
</div>
|
|
181
185
|
<h4>好友</h4>
|
|
182
186
|
<div id="friendsList"></div>
|
|
183
187
|
<h4>群聊</h4>
|