polygram 0.10.0-rc.4 → 0.10.0-rc.6
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.6",
|
|
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",
|
|
@@ -40,6 +40,7 @@ const { LogTail } = require('../tmux/log-tail');
|
|
|
40
40
|
const { sessionLogPath, pipeToParser } = require('../tmux/session-log-parser');
|
|
41
41
|
const { computeCostUsd } = require('../model-costs');
|
|
42
42
|
const { getTopicConfig } = require('../session-key');
|
|
43
|
+
const { POLYGRAM_DISPLAY_HINT } = require('../telegram/display-hint');
|
|
43
44
|
|
|
44
45
|
// Context window per model. All Claude 4.x models are 200k. If
|
|
45
46
|
// Anthropic ships a model with a different window, promote this to
|
|
@@ -62,16 +63,26 @@ const STREAMING_HINT_RE = /esc to interrupt/;
|
|
|
62
63
|
//
|
|
63
64
|
// ⏺ Bash(rm foo.txt)
|
|
64
65
|
// ⎿ Do you want to do this?
|
|
65
|
-
//
|
|
66
|
+
// ❯ 1. Yes
|
|
66
67
|
// 2. Yes, allow always for similar commands
|
|
67
68
|
// 3. No, and tell Claude what to do differently
|
|
68
69
|
//
|
|
70
|
+
// The TUI renders a `❯` selection cursor inline before the
|
|
71
|
+
// highlighted option (always option 1 at first paint). Earlier
|
|
72
|
+
// rc.1-rc.4 regex assumed no inline cursor and silently failed to
|
|
73
|
+
// match every approval-gated tool call in production, hanging the
|
|
74
|
+
// session in the TUI until orphan-sweep killed it (see
|
|
75
|
+
// tests/tmux-process-approval.test.js inline-cursor regression).
|
|
76
|
+
//
|
|
69
77
|
// SECURITY (audit H1 fix): require BOTH the question text AND a
|
|
70
78
|
// following numbered menu line ("1. ...") so a malicious assistant
|
|
71
79
|
// message text like "Do you want to proceed?" can't trigger a fake
|
|
72
80
|
// approval card by itself. The menu is part of the TUI's pause
|
|
73
81
|
// state; the assistant can't render it without actually being paused.
|
|
74
|
-
|
|
82
|
+
// The optional `❯` cursor in [^\S\n]*(?:❯[^\S\n]+)?1\. is still
|
|
83
|
+
// bounded to the line containing `1.`, so the security property
|
|
84
|
+
// holds — only a real menu line satisfies it.
|
|
85
|
+
const APPROVAL_PROMPT_RE = /Do you want to (?:proceed|do this|continue)\??[\s\S]{0,400}?(?:^|\n)[^\S\n]*(?:❯[^\S\n]+)?1\.\s+/im;
|
|
75
86
|
// Pull the tool name + raw arg snippet from the line preceding the
|
|
76
87
|
// approval prompt. Capture-pane preserves the ⏺ marker.
|
|
77
88
|
const TOOL_INVOCATION_RE = /⏺\s+([A-Za-z_]\w*)\s*\((.*?)\)\s*$/m;
|
|
@@ -223,6 +234,15 @@ class TmuxProcess extends Process {
|
|
|
223
234
|
}
|
|
224
235
|
args.push('--debug-file', this.debugLogPath);
|
|
225
236
|
if (agent) args.push('--agent', agent);
|
|
237
|
+
// Cross-backend parity: SDK appends polygram's Telegram display
|
|
238
|
+
// hint to every agent's systemPrompt (lib/sdk/build-options.js).
|
|
239
|
+
// Without this, the spawned claude session has no idea it's
|
|
240
|
+
// replying through a Telegram bot — shumorobot 2026-05-15 caught
|
|
241
|
+
// the model emitting shell-style canned strings ("No response
|
|
242
|
+
// requested.") as actual Telegram replies for that reason.
|
|
243
|
+
// `--append-system-prompt` is preserved by claude CLI in
|
|
244
|
+
// addition to (not in place of) the agent's own prompt.
|
|
245
|
+
args.push('--append-system-prompt', POLYGRAM_DISPLAY_HINT);
|
|
226
246
|
|
|
227
247
|
// R2-F8: spawn errors must fail loud, not silent-catch.
|
|
228
248
|
await this.runner.spawn({
|
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.6",
|
|
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": {
|