polygram 0.6.9 → 0.6.11
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 +1 -1
- package/polygram.js +5 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "polygram",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.11",
|
|
4
4
|
"description": "Telegram daemon for Claude Code that preserves the OpenClaw per-chat session model. Migration path for OpenClaw users moving to Claude Code.",
|
|
5
5
|
"main": "lib/ipc-client.js",
|
|
6
6
|
"bin": {
|
package/polygram.js
CHANGED
|
@@ -201,12 +201,12 @@ function dbWrite(fn, context) {
|
|
|
201
201
|
}
|
|
202
202
|
|
|
203
203
|
// Convenience for the most common dbWrite pattern: log an event.
|
|
204
|
-
// Pre-0.6.9 every call site was logEvent(KIND, {...}),
|
|
204
|
+
// Pre-0.6.9 every call site was dbWrite(() => db.logEvent(KIND, {...}),
|
|
205
205
|
// `log ${KIND}`) — three repeated lines for one logical operation.
|
|
206
206
|
// This collapses them to logEvent(KIND, {...}). Same best-effort
|
|
207
207
|
// semantics; never throws.
|
|
208
208
|
function logEvent(kind, detail) {
|
|
209
|
-
logEvent(kind, detail), `log ${kind}`);
|
|
209
|
+
dbWrite(() => db.logEvent(kind, detail), `log ${kind}`);
|
|
210
210
|
}
|
|
211
211
|
|
|
212
212
|
function recordInbound(msg) {
|
|
@@ -1211,7 +1211,7 @@ async function handleConfigCallback(ctx) {
|
|
|
1211
1211
|
chat_id: chatId, thread_id: null, field: setting,
|
|
1212
1212
|
old_value: oldValue, new_value: value,
|
|
1213
1213
|
user: cmdUser, user_id: cmdUserId, source: 'inline-button',
|
|
1214
|
-
});
|
|
1214
|
+
}), `log ${setting} change`);
|
|
1215
1215
|
|
|
1216
1216
|
// Graceful respawn of the topic's session that the card is in. With
|
|
1217
1217
|
// isolateTopics=false sessionKey is the chat (one shared session). With
|
|
@@ -1387,7 +1387,7 @@ async function handleMessage(sessionKey, chatId, msg, bot) {
|
|
|
1387
1387
|
chat_id: chatId, thread_id: threadIdStr, field: 'model',
|
|
1388
1388
|
old_value: oldModel, new_value: newModel,
|
|
1389
1389
|
user: cmdUser, user_id: cmdUserId, source: 'command',
|
|
1390
|
-
});
|
|
1390
|
+
}), 'log model change');
|
|
1391
1391
|
const { anyActive } = requestRespawnForSession('model-change');
|
|
1392
1392
|
const ver = MODEL_VERSIONS[newModel] || newModel;
|
|
1393
1393
|
const suffix = anyActive ? ` — I'll switch when I finish` : '';
|
|
@@ -1407,7 +1407,7 @@ async function handleMessage(sessionKey, chatId, msg, bot) {
|
|
|
1407
1407
|
chat_id: chatId, thread_id: threadIdStr, field: 'effort',
|
|
1408
1408
|
old_value: oldEffort, new_value: newEffort,
|
|
1409
1409
|
user: cmdUser, user_id: cmdUserId, source: 'command',
|
|
1410
|
-
});
|
|
1410
|
+
}), 'log effort change');
|
|
1411
1411
|
const { anyActive } = requestRespawnForSession('effort-change');
|
|
1412
1412
|
const suffix = anyActive ? ` — I'll switch when I finish` : '';
|
|
1413
1413
|
await sendReply(`Effort → ${newEffort}${suffix}`);
|