instar 1.2.80 → 1.2.82

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.
Files changed (40) hide show
  1. package/dist/commands/server.d.ts.map +1 -1
  2. package/dist/commands/server.js +28 -15
  3. package/dist/commands/server.js.map +1 -1
  4. package/dist/core/PostUpdateMigrator.d.ts +7 -0
  5. package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
  6. package/dist/core/PostUpdateMigrator.js +59 -75
  7. package/dist/core/PostUpdateMigrator.js.map +1 -1
  8. package/dist/core/SessionManager.d.ts +14 -1
  9. package/dist/core/SessionManager.d.ts.map +1 -1
  10. package/dist/core/SessionManager.js +41 -1
  11. package/dist/core/SessionManager.js.map +1 -1
  12. package/dist/messaging/MessageRouter.d.ts +8 -0
  13. package/dist/messaging/MessageRouter.d.ts.map +1 -1
  14. package/dist/messaging/MessageRouter.js +37 -0
  15. package/dist/messaging/MessageRouter.js.map +1 -1
  16. package/dist/scaffold/templates.d.ts.map +1 -1
  17. package/dist/scaffold/templates.js +15 -0
  18. package/dist/scaffold/templates.js.map +1 -1
  19. package/dist/server/routes.d.ts.map +1 -1
  20. package/dist/server/routes.js +115 -0
  21. package/dist/server/routes.js.map +1 -1
  22. package/dist/threadline/CollaborationSurfacer.d.ts +67 -18
  23. package/dist/threadline/CollaborationSurfacer.d.ts.map +1 -1
  24. package/dist/threadline/CollaborationSurfacer.js +132 -37
  25. package/dist/threadline/CollaborationSurfacer.js.map +1 -1
  26. package/dist/threadline/ThreadResumeMap.d.ts.map +1 -1
  27. package/dist/threadline/ThreadResumeMap.js +10 -2
  28. package/dist/threadline/ThreadResumeMap.js.map +1 -1
  29. package/dist/threadline/TopicLinkageHandler.d.ts +7 -2
  30. package/dist/threadline/TopicLinkageHandler.d.ts.map +1 -1
  31. package/dist/threadline/TopicLinkageHandler.js +33 -18
  32. package/dist/threadline/TopicLinkageHandler.js.map +1 -1
  33. package/package.json +1 -1
  34. package/src/data/builtin-manifest.json +62 -62
  35. package/src/scaffold/templates.ts +15 -0
  36. package/upgrades/1.2.81.md +40 -0
  37. package/upgrades/1.2.82.md +26 -0
  38. package/upgrades/side-effects/1.2.81.md +127 -0
  39. package/upgrades/side-effects/threadline-notification-routing.md +46 -0
  40. package/upgrades/side-effects/threadline-reply-surfacing.md +68 -0
@@ -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,CAikMtE;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;
@@ -6629,16 +6632,17 @@ export async function startServer(options) {
6629
6632
  });
6630
6633
  if (decision.suppress) {
6631
6634
  console.log(`[relay] warrants-reply gate suppressed reply (${decision.verdict.signal}) for ${senderName} thread ${gateThreadId.slice(0, 8)}`);
6632
- // On budget exhaustion, escalate ONE attention item — never silently drop.
6633
- if (decision.verdict.budgetExhausted && telegram) {
6634
- telegram.createAttentionItem({
6635
- id: `threadline-loop-${gateThreadId.slice(0, 12)}`,
6636
- title: `Threadline conversation loop wound down (${senderName})`,
6637
- summary: `Stopped auto-replying to an agent-to-agent thread that kept going with no new content.`,
6638
- description: `An agent-to-agent thread with ${senderName} kept exchanging messages with no new content, so I stopped auto-replying to keep it from looping. Thread ${gateThreadId.slice(0, 8)}. Let me know if you want me to re-engage.`,
6639
- category: 'threadline-loop-gate',
6640
- priority: 'LOW',
6641
- }).catch(escErr => console.warn(`[relay] loop-gate attention escalation failed: ${escErr instanceof Error ? escErr.message : escErr}`));
6635
+ // On budget exhaustion, surface ONE status notice — never silently
6636
+ // drop. CMT-519: route it to the SILENT Threadline hub (not a
6637
+ // per-event attention topic, not the parent topic the operator is
6638
+ // working in). This is housekeeping, not a user task.
6639
+ if (decision.verdict.budgetExhausted && collaborationSurfacer) {
6640
+ void collaborationSurfacer.notify({
6641
+ threadId: gateThreadId,
6642
+ title: 'Conversation loop paused',
6643
+ body: `Stopped auto-replying to a thread with ${senderName} that kept going with no new content (thread ${gateThreadId.slice(0, 8)}). Say "re-engage" in this topic if you want me to pick it back up.`,
6644
+ peerName: senderName,
6645
+ }).catch(escErr => console.warn(`[relay] loop-gate hub notice failed: ${escErr instanceof Error ? escErr.message : escErr}`));
6642
6646
  }
6643
6647
  return; // short-circuit ALL three routing branches
6644
6648
  }
@@ -6707,8 +6711,17 @@ export async function startServer(options) {
6707
6711
  }
6708
6712
  }
6709
6713
  }
6710
- // Phase 2b: Route to warm listener if available and appropriate
6711
- if (listenerManager && listenerManager.shouldUseListener(trustLevel, textContent.length)) {
6714
+ // Phase 2b: Route to warm listener if available and appropriate.
6715
+ // EXCEPT topic-bound replies: a reply on a thread bound to a Telegram
6716
+ // topic must reach handleInboundMessage → TopicLinkageHandler so it
6717
+ // surfaces in the bound topic. The listener inbox is a side-channel
6718
+ // that never surfaces to the topic — routing a topic-bound reply there
6719
+ // is exactly the relay-path leak (A1-relay) that makes the reply vanish
6720
+ // for the user even though transport succeeded. (The pipe-spawn branch
6721
+ // above is already excluded for topic-bound threads via its
6722
+ // `!threadResumeMap.get(...)` guard, now that get() no longer nulls them.)
6723
+ const isTopicBoundReply = !!msg.threadId && threadResumeMap.get(msg.threadId)?.originTopicId !== undefined;
6724
+ if (listenerManager && listenerManager.shouldUseListener(trustLevel, textContent.length) && !isTopicBoundReply) {
6712
6725
  listenerManager.writeToInbox({ from: senderFingerprint, senderName, trustLevel, threadId: msg.threadId ?? getSyntheticThreadId(senderFingerprint), text: textContent });
6713
6726
  console.log(`[relay] Routed to listener inbox from ${senderName} (trust: ${trustLevel})`);
6714
6727
  return;