polygram 0.18.1 → 0.18.2

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.18.1",
4
+ "version": "0.18.2",
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",
@@ -63,13 +63,39 @@ const TABLES_AND_HEADERS_SECTION_PLAIN = [
63
63
  const TABLES_AND_HEADERS_SECTION_RICH = [
64
64
  '### Rich formatting is available in this chat',
65
65
  '',
66
- 'This chat has rich-text rendering enabled. Real Telegram markdown tables, headings (`#`/`##`/etc.), task lists, and collapsible `<details>` blocks now render as an actual structured message, not flattened text — use them when they make an answer clearer or easier to scan (a comparison, a set of steps, a key/value summary, a checklist tracking progress). No character-width budget applies to tables here; write a normal markdown table.',
66
+ 'This chat has rich-text rendering enabled. Real Telegram markdown tables, headings (`#`/`##`/etc.), task lists, collapsible `<details>` blocks, blockquotes (`>`), and dividers (`---`) now render as an actual structured message, not flattened text. No character-width budget applies to tables here; write a normal markdown table.',
67
67
  '',
68
- '**Task lists for progress:** `- [ ] pending step` / `- [x] done step` renders as a real checkbox list the natural way to show multi-step progress as it happens.',
68
+ '**Use the real construct instead of faking it with bold text and emoji.** In plain-mode chats you had to fake structure with **bold** pseudo-headers, emoji bullets (✅ ❓ 🕓, •, etc.), and plain-text separator lines, because headings and checkboxes rendered as flattened text there. That workaround is unnecessary here and looks worse than the real thing. When you catch yourself about to write a bold pseudo-heading or an emoji-bulleted list, use the actual construct instead:',
69
+ '',
70
+ '- A named group of items (e.g. "ready to apply" / "needs your input" / "deferred") → a real heading (`## Ready to apply`), not `**Ready to apply:**`.',
71
+ '- A list of items each with a yes/no/pending state (approve this? confirm that?) → a real task list (`- [ ] item`), not `• item` with an emoji glued on.',
72
+ '- A comparison or key/value summary → a real markdown table.',
73
+ '- A quoted aside, caveat, or callout you want visually set apart → a real blockquote (`> like this`), not a bold prefix.',
74
+ '- A visual break between distinct sections of a long reply → a real divider (`---` on its own line), the same way you already reach for it, but now it renders as a divider instead of literal dashes.',
75
+ '- Verbose supporting detail (a diff, a log, raw output) you want available but not front-and-center → `<details><summary>Label</summary>...</details>`.',
76
+ '',
77
+ 'Worked example — triaging a batch of items into groups, each item with its own state:',
78
+ '',
79
+ '```',
80
+ '## Ready to apply',
81
+ '',
82
+ '- [ ] Merge the two lists into one (#18)',
83
+ '- [ ] Fix the delivery-time wording (#4)',
84
+ '',
85
+ '## Need your input',
86
+ '',
87
+ '- [ ] Hemming service — confirm we can offer it (#11)',
88
+ '',
89
+ '## Deferred to v2',
90
+ '',
91
+ '- [ ] Size-guide page (#16)',
92
+ '```',
93
+ '',
94
+ '**Task lists for progress:** `- [ ] pending step` / `- [x] done step` renders as a real checkbox list — the natural way to show multi-step progress, a batch of items awaiting confirmation, or anything else with a per-item done/pending state.',
69
95
  '',
70
96
  '**Collapsible detail:** wrap verbose logs/diffs/output you want available but not front-and-center in `<details><summary>Label</summary>...</details>`.',
71
97
  '',
72
- 'Not every reply needs this — plain prose is still right for a normal conversational answer. Reach for structure when the CONTENT is structured, not by default.',
98
+ 'Not every reply needs this — plain prose is still right for a normal conversational answer with no distinct items or sections. Reach for structure when the CONTENT is structured, not by default.',
73
99
  '',
74
100
  '### Other Telegram quirks',
75
101
  '',
@@ -3,9 +3,10 @@
3
3
  *
4
4
  * Companion to format.js's markdown→HTML pipeline, not a replacement:
5
5
  * this only runs when needsRichRendering() finds a construct (task list,
6
- * table, <details>, heading) that the plain HTML pipeline can't express
7
- * natively, AND the chat has opted in (config.richText). Everything else
8
- * stays on the existing toTelegramHtml() path.
6
+ * table, <details>, heading, blockquote, divider) that the plain HTML
7
+ * pipeline can't express natively, AND the chat has opted in
8
+ * (config.richText). Everything else stays on the existing
9
+ * toTelegramHtml() path.
9
10
  *
10
11
  * Block text fields carry plain strings only. Inline bold, italic, and
11
12
  * links are flattened rather than mapped to an unverified nested schema.
@@ -61,6 +62,8 @@ const TASK_ITEM_RE = /^[ \t]{0,3}[-*+][ \t]+\[[ xX]\][ \t]+/m;
61
62
  const TABLE_ROW_RE = /^[ \t]{0,3}\|?[ \t]*:?-{2,}:?[ \t]*\|/m;
62
63
  const DETAILS_RE = /<details[ \t>]/i;
63
64
  const HEADING_RE = /^#{1,6}[ \t]+\S/m;
65
+ const BLOCKQUOTE_RE = /^[ \t]{0,3}>[ \t]?\S/m;
66
+ const DIVIDER_RE = /^[ \t]{0,3}(-{3,}|\*{3,}|_{3,})[ \t]*$/m;
64
67
  const FENCE_LINE_RE = /^[ \t]{0,3}(`{3,}|~{3,})/;
65
68
 
66
69
  // Code-fence content renders literally, so heading, checklist, and table
@@ -109,7 +112,9 @@ function needsRichRendering(markdown) {
109
112
  return TASK_ITEM_RE.test(scoped)
110
113
  || TABLE_ROW_RE.test(scoped)
111
114
  || DETAILS_RE.test(scoped)
112
- || HEADING_RE.test(scoped);
115
+ || HEADING_RE.test(scoped)
116
+ || BLOCKQUOTE_RE.test(scoped)
117
+ || DIVIDER_RE.test(scoped);
113
118
  }
114
119
 
115
120
  // ─── marked instance for block-level tokenization ────────────────────
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polygram",
3
- "version": "0.18.1",
3
+ "version": "0.18.2",
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": {