polygram 0.10.0-rc.29 → 0.10.0-rc.30

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://anthropic.com/claude-code/plugin.schema.json",
3
3
  "name": "polygram",
4
- "version": "0.10.0-rc.29",
4
+ "version": "0.10.0-rc.30",
5
5
  "description": "Telegram integration for Claude Code that preserves the OpenClaw per-chat session model. Migration target for OpenClaw users. Multi-bot, multi-chat, per-topic isolation; SQLite transcripts; inline-keyboard approvals. Bundles /polygram:status|logs|pair-code|approvals admin commands plus history (transcript queries) and polygram-send (out-of-turn IPC sends with file-upload validation) skills.",
6
6
  "keywords": [
7
7
  "telegram",
@@ -79,6 +79,15 @@ const CALLBACK_TO_EVENT = {
79
79
  // silent until the stale-turn sweep caught it turnTimeoutMs later.
80
80
  // The handler logs the failure and clears the ✍ on the failed msgId.
81
81
  onInjectFail: 'inject-fail',
82
+ // 0.10.0: tmux backend turn-phase predicate (observer-only Commit 1
83
+ // of the patience-model unification — see docs/0.10.0-tmux-patience-
84
+ // model-solution.md). TmuxProcess emits `phase-change` on every
85
+ // TurnPhase transition; polygram persists it as `turn-phase-change`
86
+ // in the events DB so the soak can verify the predicate's
87
+ // trajectory against real workloads before Commits 2-3 start
88
+ // consuming turn.phase for control flow. SDK backend never emits
89
+ // this — predicate is tmux-specific.
90
+ onPhaseChange: 'phase-change',
82
91
  };
83
92
 
84
93
  class ProcessManager {
@@ -295,6 +295,32 @@ function createSdkCallbacks({
295
295
  // is not left looking at a "noted, working on it" signal for a
296
296
  // message that never reached the agent. tmux-only — the SDK
297
297
  // backend's injectUserMessage never emits inject-fail.
298
+ // 0.10.0 Commit 1 (observer-only): turn-phase predicate
299
+ // transition. tmux backend only — see lib/process/turn-phase.js
300
+ // and lib/process/tmux-process.js#_setPhase. Persisted as
301
+ // `turn-phase-change` so the soak can verify the predicate
302
+ // trajectory against real workloads before Commits 2-3 start
303
+ // consuming turn.phase. Fires often (10-50 per turn typical, more
304
+ // on heavy tool use); the payload is intentionally compact.
305
+ onPhaseChange: (sessionKey, payload /* , entry */) => {
306
+ try {
307
+ logEvent('turn-phase-change', {
308
+ chat_id: getChatIdFromKey(sessionKey),
309
+ session_key: sessionKey,
310
+ turn_id: payload?.turnId ?? null,
311
+ msg_id: payload?.msgId ?? null,
312
+ kind: payload?.kind ?? null, // primary | autosteer
313
+ prev: payload?.prev,
314
+ next: payload?.next,
315
+ reason: payload?.reason, // e.g. jsonl:tool-use:Agent
316
+ ts: payload?.ts ?? null,
317
+ backend: payload?.backend || 'tmux',
318
+ });
319
+ } catch (err) {
320
+ logger.error?.(`[${botName}] phase-change handler: ${err.message}`);
321
+ }
322
+ },
323
+
298
324
  onInjectFail: (sessionKey, payload /* , entry */) => {
299
325
  try {
300
326
  const msgId = payload?.msgId;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polygram",
3
- "version": "0.10.0-rc.29",
3
+ "version": "0.10.0-rc.30",
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": {