polygram 0.10.0-rc.25 → 0.10.0-rc.26

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.25",
4
+ "version": "0.10.0-rc.26",
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",
@@ -98,7 +98,8 @@
98
98
  "cwd": "/Users/you/admin-agent",
99
99
  "requireMention": true,
100
100
  "isolateTopics": true,
101
- "_comment_topics": "rc.48: each topic entry is EITHER a string (legacy: just a label) OR an object with optional fields {name, agent, cwd, model, effort, permissionMode}. Object form lets a topic override chat-level config. Per-topic permissionMode overrides chat-level — typical use: scope one topic to permissionMode:'default' (so settings.json gates apply) while the rest of the chat stays on bypassPermissions. Object form requires isolateTopics: true (each topic gets its own SDK Query); polygram emits a startup warning otherwise.",
101
+ "_comment_topics": "rc.48: each topic entry is EITHER a string (legacy: just a label) OR an object with optional fields {name, agent, cwd, model, effort, permissionMode, isolateUserConfig}. Object form lets a topic override chat-level config. Per-topic permissionMode overrides chat-level — typical use: scope one topic to permissionMode:'default' (so settings.json gates apply) while the rest of the chat stays on bypassPermissions. Object form requires isolateTopics: true (each topic gets its own SDK Query); polygram emits a startup warning otherwise.",
102
+ "_comment_isolateUserConfig": "0.10.0, tmux backend only: isolateUserConfig:true spawns the topic's claude TUI cut off from the user-level ~/.claude config — passes --strict-mcp-config (zero MCP servers load) and --setting-sources project,local (drops ~/.claude/settings.json; the spawn cwd's own .claude/settings.json still loads). Use it when a topic's agent would otherwise inherit slow user-global MCP servers whose cold-start (tens of seconds) wedges the TUI before it can accept a prompt. Settable at chat OR topic level (topic wins). Default false.",
102
103
  "topics": {
103
104
  "100": "Customer A",
104
105
  "200": {
@@ -107,7 +108,8 @@
107
108
  "cwd": "/Users/you/customer-b-projects",
108
109
  "model": "opus",
109
110
  "effort": "high",
110
- "permissionMode": "default"
111
+ "permissionMode": "default",
112
+ "isolateUserConfig": true
111
113
  }
112
114
  }
113
115
  },
@@ -347,7 +347,7 @@ class TmuxProcess extends Process {
347
347
  *
348
348
  * @param {object} ctx
349
349
  * @param {string|null} [ctx.existingSessionId] — for --resume
350
- * @param {object} [ctx.chatConfig={}] — supplies model, effort, cwd, agent, permissionMode
350
+ * @param {object} [ctx.chatConfig={}] — supplies model, effort, cwd, agent, permissionMode, isolateUserConfig
351
351
  * @param {string} [ctx.model] — override (rare; e.g. tests)
352
352
  * @param {string} [ctx.effort] — override
353
353
  * @param {string} [ctx.cwd] — override
@@ -378,6 +378,21 @@ class TmuxProcess extends Process {
378
378
  const cwd = ctx.cwd || topicConfig.cwd || chatConfig.cwd;
379
379
  const agent = topicConfig.agent || chatConfig.agent;
380
380
  const permissionMode = topicConfig.permissionMode || chatConfig.permissionMode || 'acceptEdits';
381
+ // `isolateUserConfig` (topic- or chat-level, topic wins — same
382
+ // merge path as agent/cwd/permissionMode). When true, the spawned
383
+ // claude TUI is cut off from the user-level `~/.claude` config:
384
+ // no user-level MCP servers, plugins, or settings load. Decided
385
+ // fix for the Music topic incident — the music-curation agent was
386
+ // pulling in user-global MCP servers (serena ~27.5 s, peekaboo
387
+ // ~9 s, context7) and the ~45 s MCP cold-start left the TUI
388
+ // accepting a pasted prompt but dropping the submitted Enter, so
389
+ // polygram's paste never submitted and the turn failed (broke the
390
+ // Music topic 5+ times). Default OFF — every other topic is
391
+ // unaffected unless it explicitly opts in.
392
+ const isolateUserConfig =
393
+ topicConfig.isolateUserConfig != null
394
+ ? topicConfig.isolateUserConfig === true
395
+ : chatConfig.isolateUserConfig === true;
381
396
 
382
397
  // Pre-allocate the sessionId via --session-id flag (v9 finding).
383
398
  // claude accepts a valid UUID and uses it as THE session ID for the
@@ -400,6 +415,25 @@ class TmuxProcess extends Process {
400
415
  }
401
416
  args.push('--debug-file', this.debugLogPath);
402
417
  if (agent) args.push('--agent', agent);
418
+ // isolateUserConfig: cut the spawned TUI off from `~/.claude`.
419
+ // --strict-mcp-config — claude CLI v2.1.142: "Only use MCP
420
+ // servers from --mcp-config, ignoring all other MCP
421
+ // configurations." Passed ALONE (no --mcp-config) → zero MCP
422
+ // servers load. Hard guarantee that no plugin-provided OR
423
+ // directly-registered MCP server (serena/peekaboo/context7)
424
+ // starts, so there is no ~45 s cold-start window.
425
+ // --setting-sources project,local — load only project + local
426
+ // settings, NOT `user`. Drops `~/.claude/settings.json`
427
+ // (user-level plugins/skills/settings) while the spawn cwd's
428
+ // own `.claude/settings.json` still loads — so the rekordbox
429
+ // project's WebFetch allowlist + dontAsk mode still apply.
430
+ // No --mcp-config needed: the music-curation plugin ships NO MCP
431
+ // server (its .claude-plugin/plugin.json declares no `mcpServers`;
432
+ // it is all-Bash), so --strict-mcp-config alone is clean.
433
+ if (isolateUserConfig) {
434
+ args.push('--strict-mcp-config');
435
+ args.push('--setting-sources', 'project,local');
436
+ }
403
437
  // Cross-backend parity: SDK appends polygram's Telegram display
404
438
  // hint to every agent's systemPrompt (lib/sdk/build-options.js).
405
439
  // Without this, the spawned claude session has no idea it's
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polygram",
3
- "version": "0.10.0-rc.25",
3
+ "version": "0.10.0-rc.26",
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": {