@pnds/pond 1.10.0 → 1.10.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/package.json +3 -3
- package/src/gateway.ts +16 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnds/pond",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.1",
|
|
4
4
|
"description": "OpenClaw channel plugin for Pond IM",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"openclaw.plugin.json"
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@pnds/
|
|
19
|
-
"@pnds/
|
|
18
|
+
"@pnds/sdk": "1.10.1",
|
|
19
|
+
"@pnds/cli": "1.10.1"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@types/node": "^22.0.0",
|
package/src/gateway.ts
CHANGED
|
@@ -672,18 +672,22 @@ export const pondGateway: ChannelGatewayAdapter<ResolvedPondAccount> = {
|
|
|
672
672
|
const count = await fetchAllChats(client, config.org_id, chatInfoMap);
|
|
673
673
|
log?.info(`pond[${ctx.accountId}]: WebSocket connected, ${count} chats cached`);
|
|
674
674
|
|
|
675
|
-
// Create AgentSession on first hello (session lives across dispatches)
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
675
|
+
// Create AgentSession on first hello (session lives across dispatches).
|
|
676
|
+
// On WS reconnect, preserve the existing session — only create if none exists.
|
|
677
|
+
const existingState = getPondAccountState(ctx.accountId);
|
|
678
|
+
let activeSessionId: string | undefined = existingState?.activeSessionId;
|
|
679
|
+
if (!activeSessionId) {
|
|
680
|
+
try {
|
|
681
|
+
const session = await client.createAgentSession(config.org_id, agentUserId, {
|
|
682
|
+
runtime_type: "openclaw",
|
|
683
|
+
runtime_key: orchestratorKey,
|
|
684
|
+
runtime_ref: { hostname: os.hostname(), pid: process.pid },
|
|
685
|
+
});
|
|
686
|
+
activeSessionId = session.id;
|
|
687
|
+
log?.info(`pond[${ctx.accountId}]: created agent session ${session.id}`);
|
|
688
|
+
} catch (err) {
|
|
689
|
+
log?.warn(`pond[${ctx.accountId}]: failed to create agent session: ${String(err)}`);
|
|
690
|
+
}
|
|
687
691
|
}
|
|
688
692
|
|
|
689
693
|
setPondAccountState(ctx.accountId, {
|