feat(telegram): add Telegram support and unify config schema - #2
Merged
Conversation
node-llama-cpp (QMD dependency) requires native compilation tools. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The translate-preview skill failed to capture CSS on sites that SSR with localhost URLs (e.g. Next.js on Vercel). The fetch-based CSS inlining silently failed and removed all <link rel="stylesheet"> tags, producing unstyled preview HTML. CSS capture: - Primary: extract CSS from CSSOM (browser-loaded, URL-independent) - Fallback: rewrite localhost URLs to page origin before fetching - Absolutize relative url() in CSSOM CSS using each sheet's href - Remove localhost preload/prefetch links from saved HTML Block toggle (unify with twitter-render.js): - Wrap block pairs in .tp-block container with data-state attribute - Replace !important + body class + style.display hack with data-state driven CSS (no specificity conflicts with site CSS) - Simplify interaction script: 3-line tpToggle vs getComputedStyle hack CSP: revert PR#1's over-relaxation (http:, *, blob:) back to the https:-only policy from ffb8356. The localhost errors were ERR_CONNECTION_REFUSED, not CSP violations. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…onfig - Add @chat-adapter/telegram with long polling mode - Introduce unified `config.home` (channel + channelId) replacing per-channel `channels.*.homeChannel` fields - Add `config.notifications` for optional background job notifications - Setup wizard: stepTelegram with BotFather guide, stepHome with Telegram polling UX (retry/manual fallback), mandatory home selection - Remove stepNotifications from main wizard flow (still available via --step notifications) - Full Telegram support across all subsystems: chat-setup, chat-handlers (session ID, isHomeChannel, extractRawChannelId), reply (postToChannel), admin-server (post_message, list_channels), cron delivery, bootstrap greeting, context-builder markdown guidance, finalize notifications - Update SKILL.md templates to use 'home channel' terminology Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Upgrade all @chat-adapter/* and chat packages to ^4.20.0 - Replace heartbeat.notifications nested structure with flat heartbeat.desktop + top-level config.notifications - Use z.enum(['discord','slack','telegram']) for home/notifications channel field (type-safe validation) - Add legacy config auto-migration in io.ts (old homeChannel, old heartbeat.notifications, old notifications format) - Add telegram.mode, telegram.respondInChannels to schema - Add telegram to WorkspaceConfigSchema - Update finalize.ts to use unified config.notifications - Add telegram trigger to bootstrap.ts - Add telegram to ReactionPlatformBehavior - Fix Chat SDK 4.20 event.thread nullable in chat-handlers.ts - Rewrite stepHeartbeatNotifications() for new config format Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- D-1: shouldRespondInChannel() now includes telegram adapter (was returning false, making respondInChannels ineffective) - T-1: Replace notifications!.channel with ?.channel in catch handler - D-2: Remove misplaced Slack JSDoc above Telegram interfaces - R-3: Update comment to include Telegram in respondInChannels note Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extract migrateLegacyConfig() and write back to config.json on first load so old keys (homeChannel, heartbeat.notifications, old notifications format) are cleaned up permanently. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…onfig Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ng UX - notifyBackgroundJob falls back to config.home when notifications unset - deriveChannelSessionPrefix handles Telegram adapter - pollForTelegramChat uses AbortSignal.timeout to prevent hang - Telegram polling loop adds skip option for using other channel as home - Chat ID manual input validates numeric format - parseHomeValue guards against missing colon - migrateLegacyConfig preserves homeChannel from disabled platforms - printBanner shows Telegram connection status Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
QMD 1.1.6 added an exports field that only exposes ".", blocking Node.js ESM resolution of ./dist/store.js and ./dist/mcp.js imports used by serve.ts. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@chat-adapter/*+chatパッケージhome/notificationsをz.enumで型安全化、heartbeat.notificationsネスト廃止homeChannel, 旧heartbeat.notifications, 旧notifications形式を自動変換変更ファイル (25 files)
Core config
src/config/schema.ts—z.enum(['discord','slack','telegram'])for home/notifications,heartbeat.desktopflat field, telegram mode/respondInChannelssrc/config/io.ts— Legacy migration (pre-Zod parse), generic respondInChannels merge, telegram workspace configTelegram backend
src/channels/chat-setup.ts— Telegram adapter registration (polling mode)src/channels/chat-handlers.ts— telegram session ID, extractRawChannelId, isHomeChannel, Chat SDK 4.20 nullable fixsrc/channels/reply.ts— telegram postToChannel/encodeThreadIdsrc/channels/list-channels.ts— fetchTelegramChats, pollForTelegramChatsrc/channels/progress/platform-behavior.ts— telegram ReactionPlatformBehaviorsrc/mcp/admin-server.ts— telegram in list_channels/post_messageSetup wizard
src/cli/commands/setup.ts— stepTelegram, unified stepHome (mandatory, polling UX), collectSecrets, stepHeartbeatNotifications rewrite, printSummaryAgent
src/agent/bootstrap.ts— telegram triggersrc/agent/turn/finalize.ts— unified config.notificationssrc/agent/context-builder.ts— telegram channel context markdownOther
src/cli/commands/start.ts— telegram bootstrap greetingsrc/inngest/cron-scheduler.ts— config.home only (no legacy fallback)src/cron/types.ts,src/cron/cli.ts— telegram reply channelTest plan
bun run build— コンパイルエラーなしbun vitest run— 529 tests pass (config migration テスト含む)🤖 Generated with Claude Code