instar 1.3.297 → 1.3.299

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;AA4SH,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAqxDD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAglRtE;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;AA4SH,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAqxDD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAkmRtE;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"}
@@ -2175,7 +2175,13 @@ export async function startServer(options) {
2175
2175
  // detector still runs and falls back to the JSONL append.
2176
2176
  let stopHeartbeat;
2177
2177
  try {
2178
- stopHeartbeat = startHeartbeat(config.projectDir);
2178
+ // The reRegister callback closes the registry lost-update race: if an
2179
+ // old server generation's shutdown deleted our fresh registration
2180
+ // (back-to-back update restarts), the next heartbeat notices the
2181
+ // missing entry and resurrects it instead of silently no-oping forever.
2182
+ stopHeartbeat = startHeartbeat(config.projectDir, undefined, () => {
2183
+ registerAgent(config.projectDir, config.projectName, config.port);
2184
+ });
2179
2185
  }
2180
2186
  catch (err) {
2181
2187
  // Registry heartbeat is non-critical — server should run without it.
@@ -4366,6 +4372,14 @@ export async function startServer(options) {
4366
4372
  });
4367
4373
  });
4368
4374
  }
4375
+ sessionManager.on('injectionReplyDetected', (info) => {
4376
+ if (!telegram)
4377
+ return;
4378
+ console.log(`[injectionReplyDetected] Surfacing Gemini final pane reply from "${info.sessionName}" to topic ${info.topicId}`);
4379
+ telegram.sendToTopic(info.topicId, info.text).catch((err) => {
4380
+ console.error(`[injectionReplyDetected] Failed to send reply for topic ${info.topicId}:`, err.message);
4381
+ });
4382
+ });
4369
4383
  if (scheduler) {
4370
4384
  sessionManager.on('sessionComplete', (session) => {
4371
4385
  scheduler.processQueue();
@@ -10211,8 +10225,12 @@ export async function startServer(options) {
10211
10225
  stopHeartbeat?.();
10212
10226
  }
10213
10227
  catch { /* non-critical during shutdown */ }
10228
+ // pid-guarded: only remove OUR OWN registration. An unguarded
10229
+ // unregister-by-path here deletes the successor generation's fresh
10230
+ // entry during back-to-back update restarts (registry lost-update
10231
+ // race) — the agent then vanishes from the registry until restart.
10214
10232
  try {
10215
- unregisterAgent(config.projectDir);
10233
+ unregisterAgent(config.projectDir, { onlyIfPid: process.pid });
10216
10234
  }
10217
10235
  catch { /* ELOCKED is non-critical during shutdown */ }
10218
10236
  scheduler?.stop();