instar 0.28.14 → 0.28.15

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 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA2PH,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AA6zCD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAomItE;AAED,wBAAsB,UAAU,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAsDzE;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAuD5E"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA2PH,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAs0CD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA2nItE;AAED,wBAAsB,UAAU,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAsDzE;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAuD5E"}
@@ -568,26 +568,34 @@ function wireTelegramCallbacks(telegram, sessionManager, state, quotaTracker, ac
568
568
  return sessionManager.isSessionAlive(sessionName);
569
569
  };
570
570
  // Stall verification — check if session has recent output activity
571
- telegram.onIsSessionActive = async (sessionName) => {
571
+ // Shared activity patterns for detecting Claude Code session output
572
+ const sessionActivePatterns = [
573
+ /\bRead\b|\bWrite\b|\bEdit\b|\bBash\b|\bGrep\b|\bGlob\b|\bAgent\b|\bSkill\b|\bWebFetch\b|\bWebSearch\b/, // Tool names
574
+ /⠋|⠙|⠹|⠸|⠼|⠴|⠦|⠧|⠇|⠏/, // Spinner characters
575
+ /\d+\s*tokens?/i, // Token counts
576
+ /Sent \d+ chars/, // Telegram/Slack reply confirmation
577
+ /Wandering|Thinking|thought for/i, // Claude thinking indicators
578
+ /Searching for \d+ pattern/i, // Search activity
579
+ /ctrl\+[a-z] to/i, // Interactive prompt hints
580
+ /\+ .*\(thought for/, // Tool execution with thinking
581
+ /mcp__/, // MCP tool calls
582
+ /●|○|◉/, // Progress indicators
583
+ ];
584
+ /** Check if a session is actively producing output */
585
+ const isSessionActiveCheck = async (sessionName) => {
572
586
  const output = sessionManager.captureOutput(sessionName, 20);
573
587
  if (!output)
574
588
  return false;
575
589
  const lines = output.trim().split('\n').slice(-15);
576
- // Look for signs of Claude Code activity in recent output
577
- const activePatterns = [
578
- /\bRead\b|\bWrite\b|\bEdit\b|\bBash\b|\bGrep\b|\bGlob\b/, // Tool names
579
- /⠋|⠙|⠹|⠸|⠼|⠴|⠦|⠧|⠇|⠏/, // Spinner characters
580
- /\d+\s*tokens?/i, // Token counts
581
- /Sent \d+ chars/, // Telegram reply confirmation
582
- ];
583
590
  for (const line of lines) {
584
- for (const pattern of activePatterns) {
591
+ for (const pattern of sessionActivePatterns) {
585
592
  if (pattern.test(line))
586
593
  return true;
587
594
  }
588
595
  }
589
596
  return false;
590
597
  };
598
+ telegram.onIsSessionActive = isSessionActiveCheck;
591
599
  // /switch-account — swap active Claude Code account
592
600
  if (accountSwitcher) {
593
601
  telegram.onSwitchAccountRequest = async (target, replyTopicId) => {
@@ -2737,6 +2745,31 @@ export async function startServer(options) {
2737
2745
  slackAdapter.onIsSessionAlive = (tmuxSession) => {
2738
2746
  return sessionManager.isSessionAlive(tmuxSession);
2739
2747
  };
2748
+ slackAdapter.onIsSessionActive = async (sessionName) => {
2749
+ const output = sessionManager.captureOutput(sessionName, 20);
2750
+ if (!output)
2751
+ return false;
2752
+ const lines = output.trim().split('\n').slice(-15);
2753
+ const activePatterns = [
2754
+ /\bRead\b|\bWrite\b|\bEdit\b|\bBash\b|\bGrep\b|\bGlob\b|\bAgent\b|\bSkill\b|\bWebFetch\b|\bWebSearch\b/,
2755
+ /⠋|⠙|⠹|⠸|⠼|⠴|⠦|⠧|⠇|⠏/,
2756
+ /\d+\s*tokens?/i,
2757
+ /Sent \d+ chars/,
2758
+ /Wandering|Thinking|thought for/i,
2759
+ /Searching for \d+ pattern/i,
2760
+ /ctrl\+[a-z] to/i,
2761
+ /\+ .*\(thought for/,
2762
+ /mcp__/,
2763
+ /●|○|◉/,
2764
+ ];
2765
+ for (const line of lines) {
2766
+ for (const pattern of activePatterns) {
2767
+ if (pattern.test(line))
2768
+ return true;
2769
+ }
2770
+ }
2771
+ return false;
2772
+ };
2740
2773
  // Wire prompt response callback — inject button presses into sessions
2741
2774
  slackAdapter.onPromptResponse = (channelId, promptId, value) => {
2742
2775
  // Look up which session is bound to this channel