instar 1.2.80 → 1.2.81

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;AA0QH,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAiqDD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAmjMtE;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;AA0QH,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAiqDD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAgkMtE;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"}
@@ -6272,10 +6272,13 @@ export async function startServer(options) {
6272
6272
  salienceGate,
6273
6273
  messageStore,
6274
6274
  localAgent: config.projectName,
6275
- injectIntoSession: (sessionName, text) => {
6275
+ injectIntoSession: async (sessionName, text) => {
6276
+ // Confirm the inject actually submitted (not left stuck at the prompt
6277
+ // by the paste-end race). A bare dispatch returning true is the A2 bug:
6278
+ // a stalled inject must NOT count as delivered, so the Telegram fallback
6279
+ // surfaces the reply instead.
6276
6280
  try {
6277
- sessionManager.injectPasteNotification(sessionName, text);
6278
- return true;
6281
+ return await sessionManager.injectPasteNotificationConfirmed(sessionName, text);
6279
6282
  }
6280
6283
  catch {
6281
6284
  return false;
@@ -6707,8 +6710,17 @@ export async function startServer(options) {
6707
6710
  }
6708
6711
  }
6709
6712
  }
6710
- // Phase 2b: Route to warm listener if available and appropriate
6711
- if (listenerManager && listenerManager.shouldUseListener(trustLevel, textContent.length)) {
6713
+ // Phase 2b: Route to warm listener if available and appropriate.
6714
+ // EXCEPT topic-bound replies: a reply on a thread bound to a Telegram
6715
+ // topic must reach handleInboundMessage → TopicLinkageHandler so it
6716
+ // surfaces in the bound topic. The listener inbox is a side-channel
6717
+ // that never surfaces to the topic — routing a topic-bound reply there
6718
+ // is exactly the relay-path leak (A1-relay) that makes the reply vanish
6719
+ // for the user even though transport succeeded. (The pipe-spawn branch
6720
+ // above is already excluded for topic-bound threads via its
6721
+ // `!threadResumeMap.get(...)` guard, now that get() no longer nulls them.)
6722
+ const isTopicBoundReply = !!msg.threadId && threadResumeMap.get(msg.threadId)?.originTopicId !== undefined;
6723
+ if (listenerManager && listenerManager.shouldUseListener(trustLevel, textContent.length) && !isTopicBoundReply) {
6712
6724
  listenerManager.writeToInbox({ from: senderFingerprint, senderName, trustLevel, threadId: msg.threadId ?? getSyntheticThreadId(senderFingerprint), text: textContent });
6713
6725
  console.log(`[relay] Routed to listener inbox from ${senderName} (trust: ${trustLevel})`);
6714
6726
  return;