instar 0.25.3 → 0.25.5

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;AA0PH,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAsnCD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAikHtE;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;AA0PH,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAkoCD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAslHtE;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"}
@@ -426,6 +426,17 @@ async function spawnSessionForTopic(sessionManager, telegram, sessionName, topic
426
426
  bootstrapMessage = `[telegram:${topicId}] ${msg}`;
427
427
  }
428
428
  }
429
+ // Large bootstrap messages (e.g. CONTINUATION context with full thread history)
430
+ // can exceed tmux send-keys limits. Write to a temp file and inject a reference,
431
+ // same pattern as injectTelegramMessage's FILE_THRESHOLD.
432
+ const BOOTSTRAP_FILE_THRESHOLD = 500;
433
+ if (bootstrapMessage.length > BOOTSTRAP_FILE_THRESHOLD) {
434
+ const bootstrapFilename = `bootstrap-${topicId}-${Date.now()}-${Math.random().toString(36).slice(2, 10)}.txt`;
435
+ const bootstrapFilepath = path.join(tmpDir, bootstrapFilename);
436
+ fs.writeFileSync(bootstrapFilepath, bootstrapMessage);
437
+ console.log(`[spawnSessionForTopic] Bootstrap message too large (${bootstrapMessage.length} chars), wrote to ${bootstrapFilepath}`);
438
+ bootstrapMessage = `[IMPORTANT: Read ${bootstrapFilepath} — it contains your full session context, conversation history, and the user's latest message. You MUST read this file before responding.]`;
439
+ }
429
440
  // Check for a resume UUID from a previously-killed session on this topic.
430
441
  // TopicResumeMap is authoritative — it saved the UUID for this specific topic at kill time
431
442
  // or via the refresh heartbeat. Skip LLM validation (which was failing due to JSONL sampling
@@ -2515,10 +2526,15 @@ export async function startServer(options) {
2515
2526
  clearTimeout(timer);
2516
2527
  }
2517
2528
  };
2518
- // Start stall detection timer
2529
+ // Wire intelligence provider for LLM-gated stall confirmation
2530
+ if (sharedIntelligence) {
2531
+ slackAdapter.intelligence = sharedIntelligence;
2532
+ }
2533
+ // Start stall detection timer (with promise tracking)
2519
2534
  const stallTimeout = slackConfig.config.stallTimeoutMinutes ?? 5;
2535
+ const promiseTimeout = slackConfig.config.promiseTimeoutMinutes ?? 10;
2520
2536
  if (stallTimeout > 0) {
2521
- slackAdapter.startStallDetection(stallTimeout * 60 * 1000);
2537
+ slackAdapter.startStallDetection(stallTimeout * 60 * 1000, promiseTimeout * 60 * 1000);
2522
2538
  }
2523
2539
  // Wire session management callbacks for slash commands
2524
2540
  slackAdapter.onInterruptSession = async (sessionName) => {
@@ -2559,7 +2575,7 @@ export async function startServer(options) {
2559
2575
  sessionManager.sendKey(sessionName, value);
2560
2576
  console.log(`[slack] Prompt response injected: session="${sessionName}" key="${value}"`);
2561
2577
  };
2562
- // Standby commands will be wired after PresenceProxy is initialized (below)
2578
+ // Standby commands and triage status will be wired after PresenceProxy/TriageOrchestrator (below)
2563
2579
  }
2564
2580
  catch (err) {
2565
2581
  const reason = err instanceof Error ? err.message : String(err);
@@ -3662,6 +3678,21 @@ export async function startServer(options) {
3662
3678
  const syntheticId = slackChannelToSyntheticId(channelId);
3663
3679
  return presenceProxy.handleCommand(syntheticId, command, parseInt(userId, 10) || 0);
3664
3680
  };
3681
+ // Wire triage status for Slack !triage command
3682
+ if (triageOrchestrator) {
3683
+ _slackAdapter.onGetTriageStatus = (channelId) => {
3684
+ const syntheticId = slackChannelToSyntheticId(channelId);
3685
+ const ts = triageOrchestrator.getTriageState(syntheticId);
3686
+ if (!ts)
3687
+ return null;
3688
+ return {
3689
+ active: true,
3690
+ classification: ts.classification,
3691
+ checkCount: ts.checkCount,
3692
+ lastCheck: new Date(ts.lastCheckAt).toISOString(),
3693
+ };
3694
+ };
3695
+ }
3665
3696
  }
3666
3697
  console.log(pc.green(' Presence Proxy enabled (🔭 [Standby])'));
3667
3698
  }