instar 1.3.66 → 1.3.68
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.
- package/dist/commands/server.d.ts.map +1 -1
- package/dist/commands/server.js +34 -5
- package/dist/commands/server.js.map +1 -1
- package/dist/core/SessionManager.d.ts +21 -0
- package/dist/core/SessionManager.d.ts.map +1 -1
- package/dist/core/SessionManager.js +48 -1
- package/dist/core/SessionManager.js.map +1 -1
- package/dist/core/SleepWakeDetector.d.ts +13 -0
- package/dist/core/SleepWakeDetector.d.ts.map +1 -1
- package/dist/core/SleepWakeDetector.js +26 -0
- package/dist/core/SleepWakeDetector.js.map +1 -1
- package/dist/messaging/TelegramAdapter.d.ts +12 -0
- package/dist/messaging/TelegramAdapter.d.ts.map +1 -1
- package/dist/messaging/TelegramAdapter.js +29 -0
- package/dist/messaging/TelegramAdapter.js.map +1 -1
- package/dist/monitoring/OrphanProcessReaper.d.ts +11 -0
- package/dist/monitoring/OrphanProcessReaper.d.ts.map +1 -1
- package/dist/monitoring/OrphanProcessReaper.js +63 -7
- package/dist/monitoring/OrphanProcessReaper.js.map +1 -1
- package/dist/monitoring/QuotaManager.d.ts.map +1 -1
- package/dist/monitoring/QuotaManager.js +59 -0
- package/dist/monitoring/QuotaManager.js.map +1 -1
- package/dist/monitoring/SessionMigrator.d.ts +37 -0
- package/dist/monitoring/SessionMigrator.d.ts.map +1 -1
- package/dist/monitoring/SessionMigrator.js +49 -1
- package/dist/monitoring/SessionMigrator.js.map +1 -1
- package/dist/monitoring/SessionRecovery.d.ts +31 -2
- package/dist/monitoring/SessionRecovery.d.ts.map +1 -1
- package/dist/monitoring/SessionRecovery.js +46 -4
- package/dist/monitoring/SessionRecovery.js.map +1 -1
- package/dist/monitoring/SessionWatchdog.d.ts +0 -1
- package/dist/monitoring/SessionWatchdog.d.ts.map +1 -1
- package/dist/monitoring/SessionWatchdog.js +36 -12
- package/dist/monitoring/SessionWatchdog.js.map +1 -1
- package/dist/scheduler/JobScheduler.d.ts +16 -2
- package/dist/scheduler/JobScheduler.d.ts.map +1 -1
- package/dist/scheduler/JobScheduler.js +50 -5
- package/dist/scheduler/JobScheduler.js.map +1 -1
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +5 -5
- package/upgrades/1.3.65.md +97 -0
- package/upgrades/1.3.67.md +164 -0
- package/upgrades/1.3.68.md +71 -0
- package/upgrades/side-effects/unified-session-lifecycle-robustness.md +191 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAiSH,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAksDD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAiSH,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAksDD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA6/NtE;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"}
|
package/dist/commands/server.js
CHANGED
|
@@ -2998,6 +2998,19 @@ export async function startServer(options) {
|
|
|
2998
2998
|
telegram.intelligence = sharedIntelligence ?? null;
|
|
2999
2999
|
await telegram.start();
|
|
3000
3000
|
console.log(pc.green(` Telegram connected (stall alerts: ${sharedIntelligence ? 'LLM-gated' : 'timer-only'})`));
|
|
3001
|
+
// UNIFIED-SESSION-LIFECYCLE bonus — session label follows topic rename.
|
|
3002
|
+
// When the user renames a Telegram forum topic, update the bound
|
|
3003
|
+
// session's display `name` ONLY (never tmuxSession or id). Fire-and-
|
|
3004
|
+
// forget; rename-display is non-critical.
|
|
3005
|
+
telegram.setTopicRenamedHandler((topicId, newName) => {
|
|
3006
|
+
const tmuxSession = telegram?.getSessionForTopic(topicId);
|
|
3007
|
+
if (!tmuxSession)
|
|
3008
|
+
return;
|
|
3009
|
+
const renamed = sessionManager.renameSessionByTmux(tmuxSession, newName);
|
|
3010
|
+
if (renamed) {
|
|
3011
|
+
console.log(`[session-rename] Updated bound session "${tmuxSession}" display name → "${newName}" (topic ${topicId})`);
|
|
3012
|
+
}
|
|
3013
|
+
});
|
|
3001
3014
|
// Threadline → Telegram bridge — mirrors inbound/outbound threadline
|
|
3002
3015
|
// messages into per-thread Telegram topics. Default-OFF; the relay
|
|
3003
3016
|
// handler below and the threadline_send tool consult bridge.mirror*
|
|
@@ -4487,11 +4500,19 @@ export async function startServer(options) {
|
|
|
4487
4500
|
return null;
|
|
4488
4501
|
}
|
|
4489
4502
|
},
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
|
|
4503
|
+
// UNIFIED-SESSION-LIFECYCLE §P0 #8: route the kill-to-respawn through
|
|
4504
|
+
// the ReapAuthority with disposition:'recovery-bounce' (silent §P3
|
|
4505
|
+
// notifier — a bounce is not a disappearance) and bypassRecoveryFlag
|
|
4506
|
+
// (the recovery's own in-flight flag would otherwise refuse its own
|
|
4507
|
+
// kill via the KEEP-guard).
|
|
4508
|
+
killSession: async (name) => {
|
|
4509
|
+
const session = sessionManager.listRunningSessions().find((s) => s.tmuxSession === name);
|
|
4493
4510
|
if (session) {
|
|
4494
|
-
sessionManager.
|
|
4511
|
+
await sessionManager.terminateSession(session.id, 'session-recovery', {
|
|
4512
|
+
disposition: 'recovery-bounce',
|
|
4513
|
+
finalStatus: 'killed',
|
|
4514
|
+
bypassRecoveryFlag: true,
|
|
4515
|
+
});
|
|
4495
4516
|
return;
|
|
4496
4517
|
}
|
|
4497
4518
|
// Fallback: direct tmux kill for untracked sessions
|
|
@@ -4503,6 +4524,8 @@ export async function startServer(options) {
|
|
|
4503
4524
|
}
|
|
4504
4525
|
catch { /* may already be dead */ }
|
|
4505
4526
|
},
|
|
4527
|
+
// P1/P2 cross-check dep — see SessionRecovery.killForRecovery().
|
|
4528
|
+
hasActiveProcesses: (name) => sessionManager.hasActiveProcesses(name),
|
|
4506
4529
|
respawnSession: async (topicId, _sessionName, recoveryPrompt) => {
|
|
4507
4530
|
// Check Slack first (synthetic IDs are negative)
|
|
4508
4531
|
const slackChId = slackProxyChannelMap.get(topicId);
|
|
@@ -6148,6 +6171,12 @@ export async function startServer(options) {
|
|
|
6148
6171
|
// Start SleepWakeDetector (re-validate sessions on wake)
|
|
6149
6172
|
const { SleepWakeDetector } = await import('../core/SleepWakeDetector.js');
|
|
6150
6173
|
const sleepWakeDetector = new SleepWakeDetector();
|
|
6174
|
+
// §P0 #9 (SE-8): give the scheduler's wake-reaper a cumulative-sleep view
|
|
6175
|
+
// (not the single last sleep event) so a job that spanned multiple sleeps
|
|
6176
|
+
// isn't reaped early.
|
|
6177
|
+
if (scheduler) {
|
|
6178
|
+
scheduler.setCumulativeSleepProvider((a, b) => sleepWakeDetector.getCumulativeSleepMsBetween(a, b));
|
|
6179
|
+
}
|
|
6151
6180
|
sleepWakeDetector.on('wake', async (event) => {
|
|
6152
6181
|
console.log(`[SleepWake] Wake detected after ~${event.sleepDurationSeconds}s sleep`);
|
|
6153
6182
|
// Checkpoint SQLite WAL files to flush stale locks from pre-sleep connections
|
|
@@ -6225,7 +6254,7 @@ export async function startServer(options) {
|
|
|
6225
6254
|
let reapResult = { reaped: [], skipped: 0 };
|
|
6226
6255
|
try {
|
|
6227
6256
|
if (scheduler) {
|
|
6228
|
-
reapResult = scheduler.reapStuckRuns(event);
|
|
6257
|
+
reapResult = await scheduler.reapStuckRuns(event);
|
|
6229
6258
|
}
|
|
6230
6259
|
}
|
|
6231
6260
|
catch (err) {
|