polygram 0.10.0-rc.1 → 0.10.0-rc.3
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.
|
|
4
|
+
"version": "0.10.0-rc.3",
|
|
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",
|
|
@@ -39,6 +39,7 @@ const { Process, UnsupportedOperationError } = require('./process');
|
|
|
39
39
|
const { LogTail } = require('../tmux/log-tail');
|
|
40
40
|
const { sessionLogPath, pipeToParser } = require('../tmux/session-log-parser');
|
|
41
41
|
const { computeCostUsd } = require('../model-costs');
|
|
42
|
+
const { getTopicConfig } = require('../session-key');
|
|
42
43
|
|
|
43
44
|
// Context window per model. All Claude 4.x models are 200k. If
|
|
44
45
|
// Anthropic ships a model with a different window, promote this to
|
|
@@ -180,10 +181,19 @@ class TmuxProcess extends Process {
|
|
|
180
181
|
|
|
181
182
|
this._spawning = (async () => {
|
|
182
183
|
const chatConfig = ctx.chatConfig || {};
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
184
|
+
// Topic-level config overrides chat-level (mirrors SDK's
|
|
185
|
+
// buildSdkOptions). Without this, a chat with per-topic
|
|
186
|
+
// `agent`/`cwd`/`model`/`effort` overrides would silently spawn
|
|
187
|
+
// claude with chat-level defaults — production bug surfaced in
|
|
188
|
+
// 0.10.0-rc.1: Music topic's music-curation agent + rekordbox
|
|
189
|
+
// cwd were ignored; TUI spawned with the chat-level shumabit
|
|
190
|
+
// agent and didn't signal ready in 30s.
|
|
191
|
+
const topicConfig = getTopicConfig(chatConfig, ctx.threadId);
|
|
192
|
+
const model = ctx.model || topicConfig.model || chatConfig.model;
|
|
193
|
+
const effort = ctx.effort || topicConfig.effort || chatConfig.effort;
|
|
194
|
+
const cwd = ctx.cwd || topicConfig.cwd || chatConfig.cwd;
|
|
195
|
+
const agent = topicConfig.agent || chatConfig.agent;
|
|
196
|
+
const permissionMode = topicConfig.permissionMode || chatConfig.permissionMode || 'acceptEdits';
|
|
187
197
|
|
|
188
198
|
// Pre-allocate the sessionId via --session-id flag (v9 finding).
|
|
189
199
|
// claude accepts a valid UUID and uses it as THE session ID for the
|
|
@@ -205,7 +215,7 @@ class TmuxProcess extends Process {
|
|
|
205
215
|
args.push('--dangerously-skip-permissions');
|
|
206
216
|
}
|
|
207
217
|
args.push('--debug-file', this.debugLogPath);
|
|
208
|
-
if (
|
|
218
|
+
if (agent) args.push('--agent', agent);
|
|
209
219
|
|
|
210
220
|
// R2-F8: spawn errors must fail loud, not silent-catch.
|
|
211
221
|
await this.runner.spawn({
|
package/lib/tmux/tmux-runner.js
CHANGED
|
@@ -173,13 +173,16 @@ function createTmuxRunner({ logger = console, runFn = run } = {}) {
|
|
|
173
173
|
stderr: err.stderr,
|
|
174
174
|
});
|
|
175
175
|
}
|
|
176
|
-
//
|
|
177
|
-
//
|
|
178
|
-
//
|
|
176
|
+
// Try to widen the detached pane so claude TUI has room to render
|
|
177
|
+
// long lines. `resize-window` is the supported way; older
|
|
178
|
+
// attempts used a non-existent `pane-width` option that always
|
|
179
|
+
// errored (tmux 3.x: pane-width is a format variable, not a
|
|
180
|
+
// settable option). capture-pane -J in captureWide() handles
|
|
181
|
+
// any remaining wrap artifacts.
|
|
179
182
|
try {
|
|
180
|
-
await runFn('tmux', ['
|
|
183
|
+
await runFn('tmux', ['resize-window', '-t', name, '-x', String(paneWidth)]);
|
|
181
184
|
} catch (err) {
|
|
182
|
-
logger.
|
|
185
|
+
logger.debug?.(`[tmux-runner] resize-window failed for ${name}: ${err.message} (capture-pane -J handles wrap)`);
|
|
183
186
|
}
|
|
184
187
|
return name;
|
|
185
188
|
}
|
|
@@ -200,10 +203,19 @@ function createTmuxRunner({ logger = console, runFn = run } = {}) {
|
|
|
200
203
|
* 2. \n → MULTILINE_SEPARATOR (F-spike-3)
|
|
201
204
|
* 3. set-buffer + paste-buffer (atomic; bracketed-paste-aware
|
|
202
205
|
* in modern claude TUI versions)
|
|
206
|
+
* 4. brief drain delay so a subsequent send-keys (e.g. Enter) is
|
|
207
|
+
* processed as a key event by the TUI, NOT consumed as part of
|
|
208
|
+
* the paste's bracketed-paste content.
|
|
203
209
|
*
|
|
204
|
-
*
|
|
205
|
-
*
|
|
206
|
-
*
|
|
210
|
+
* INCIDENT (0.10.0-rc.2): without the drain delay, send-keys Enter
|
|
211
|
+
* fired immediately after paste-buffer was being swallowed by
|
|
212
|
+
* claude TUI's bracketed-paste handler — the paste sat in the input
|
|
213
|
+
* area unsubmitted. Manual `tmux send-keys ... Enter` unstuck it.
|
|
214
|
+
* 80ms is enough on macOS tmux 3.6a for the close-bracket ESC[201~
|
|
215
|
+
* to land before any subsequent key arrives.
|
|
216
|
+
*
|
|
217
|
+
* NO Enter is sent here. Caller follows up with
|
|
218
|
+
* `sendControl(name, 'Enter')` when they want to submit.
|
|
207
219
|
*/
|
|
208
220
|
async function pasteText(name, text) {
|
|
209
221
|
const sanitized = sanitize(text);
|
|
@@ -218,6 +230,8 @@ function createTmuxRunner({ logger = console, runFn = run } = {}) {
|
|
|
218
230
|
await runFn('tmux', ['delete-buffer', '-b', bufName]).catch(() => {});
|
|
219
231
|
throw err;
|
|
220
232
|
}
|
|
233
|
+
// Drain delay — see incident note above.
|
|
234
|
+
await new Promise((r) => setTimeout(r, 80));
|
|
221
235
|
return { sanitized, oneLine, stripped: text.length - sanitized.length };
|
|
222
236
|
}
|
|
223
237
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "polygram",
|
|
3
|
-
"version": "0.10.0-rc.
|
|
3
|
+
"version": "0.10.0-rc.3",
|
|
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": {
|