instar 0.28.8 → 0.28.9
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 +61 -1
- package/dist/commands/server.js.map +1 -1
- package/dist/messaging/slack/SlackAdapter.d.ts +17 -0
- package/dist/messaging/slack/SlackAdapter.d.ts.map +1 -1
- package/dist/messaging/slack/SlackAdapter.js +179 -4
- package/dist/messaging/slack/SlackAdapter.js.map +1 -1
- package/dist/messaging/slack/SocketModeClient.d.ts +3 -0
- package/dist/messaging/slack/SocketModeClient.d.ts.map +1 -1
- package/dist/messaging/slack/SocketModeClient.js +51 -9
- package/dist/messaging/slack/SocketModeClient.js.map +1 -1
- package/dist/monitoring/SessionWatchdog.d.ts +18 -0
- package/dist/monitoring/SessionWatchdog.d.ts.map +1 -1
- package/dist/monitoring/SessionWatchdog.js +61 -0
- package/dist/monitoring/SessionWatchdog.js.map +1 -1
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +6 -6
- package/upgrades/{0.28.8.md → 0.28.6.md} +1 -1
- package/upgrades/0.28.9.md +17 -0
- package/upgrades/NEXT.md +0 -35
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA2PH,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AA6zCD,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;AA2PH,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AA6zCD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAmlItE;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
|
@@ -3751,7 +3751,33 @@ export async function startServer(options) {
|
|
|
3751
3751
|
}
|
|
3752
3752
|
}, 10_000);
|
|
3753
3753
|
});
|
|
3754
|
-
console.log(pc.green(' Compaction auto-resume wired to triage orchestrator'));
|
|
3754
|
+
console.log(pc.green(' Compaction auto-resume wired to triage orchestrator (PreCompact event)'));
|
|
3755
|
+
}
|
|
3756
|
+
// Watchdog compaction-idle polling — fallback for when PreCompact events
|
|
3757
|
+
// don't fire (Claude Code doesn't reliably emit them). The watchdog polls
|
|
3758
|
+
// every 30s and detects sessions that compacted + are idle at a prompt.
|
|
3759
|
+
if (watchdog && triageOrchestrator) {
|
|
3760
|
+
const _triageOrch2 = triageOrchestrator;
|
|
3761
|
+
watchdog.on('compaction-idle', (sessionName) => {
|
|
3762
|
+
// Check Telegram topics
|
|
3763
|
+
if (telegram) {
|
|
3764
|
+
const topicId = telegram.getTopicForSession(sessionName);
|
|
3765
|
+
if (topicId) {
|
|
3766
|
+
const history = telegram.getTopicHistory(topicId, 5);
|
|
3767
|
+
const lastMsg = history[history.length - 1];
|
|
3768
|
+
if (lastMsg?.fromUser) {
|
|
3769
|
+
console.log(`[CompactionResume] Watchdog detected compaction-idle, topic ${topicId} has unanswered message — activating triage`);
|
|
3770
|
+
_triageOrch2.activate(topicId, sessionName, 'watchdog', lastMsg.text, Date.now()).catch(err => {
|
|
3771
|
+
console.warn(`[CompactionResume] Triage activation failed for topic ${topicId}:`, err);
|
|
3772
|
+
});
|
|
3773
|
+
return;
|
|
3774
|
+
}
|
|
3775
|
+
}
|
|
3776
|
+
}
|
|
3777
|
+
// Note: Slack compaction-resume is handled separately below (after
|
|
3778
|
+
// slackChannelToSyntheticId is defined) to avoid TDZ reference errors.
|
|
3779
|
+
});
|
|
3780
|
+
console.log(pc.green(' Compaction auto-resume wired to watchdog polling (fallback)'));
|
|
3755
3781
|
}
|
|
3756
3782
|
// Subagent Tracker — monitors subagent lifecycle via hook events
|
|
3757
3783
|
const { SubagentTracker } = await import('../monitoring/SubagentTracker.js');
|
|
@@ -3870,6 +3896,40 @@ export async function startServer(options) {
|
|
|
3870
3896
|
slackChannelToSyntheticId(channelId);
|
|
3871
3897
|
}
|
|
3872
3898
|
}
|
|
3899
|
+
// Slack compaction-resume wiring — needs slackChannelToSyntheticId which is now defined
|
|
3900
|
+
if (watchdog && triageOrchestrator && _slackAdapter) {
|
|
3901
|
+
const _triageOrch3 = triageOrchestrator;
|
|
3902
|
+
const _slack = _slackAdapter;
|
|
3903
|
+
watchdog.on('compaction-idle', (sessionName) => {
|
|
3904
|
+
const channelId = _slack.getChannelForSession(sessionName);
|
|
3905
|
+
if (!channelId)
|
|
3906
|
+
return;
|
|
3907
|
+
const syntheticId = slackChannelToSyntheticId(channelId);
|
|
3908
|
+
// Read from the Slack messages JSONL log (local, no API call)
|
|
3909
|
+
const slackLogPath = path.join(config.stateDir, 'slack-messages.jsonl');
|
|
3910
|
+
try {
|
|
3911
|
+
const content = fs.readFileSync(slackLogPath, 'utf-8');
|
|
3912
|
+
const lines = content.trim().split('\n').slice(-10);
|
|
3913
|
+
for (let i = lines.length - 1; i >= 0; i--) {
|
|
3914
|
+
try {
|
|
3915
|
+
const msg = JSON.parse(lines[i]);
|
|
3916
|
+
if (msg.channelId === channelId) {
|
|
3917
|
+
if (msg.fromUser) {
|
|
3918
|
+
console.log(`[CompactionResume] Watchdog detected compaction-idle, Slack channel ${channelId} has unanswered message — activating triage`);
|
|
3919
|
+
_triageOrch3.activate(syntheticId, sessionName, 'watchdog', msg.text || 'message after compaction', Date.now()).catch(err => {
|
|
3920
|
+
console.warn(`[CompactionResume] Triage activation failed for Slack channel ${channelId}:`, err);
|
|
3921
|
+
});
|
|
3922
|
+
}
|
|
3923
|
+
break; // Only check the most recent message for this channel
|
|
3924
|
+
}
|
|
3925
|
+
}
|
|
3926
|
+
catch { /* skip malformed line */ }
|
|
3927
|
+
}
|
|
3928
|
+
}
|
|
3929
|
+
catch { /* log file doesn't exist — no Slack messages */ }
|
|
3930
|
+
});
|
|
3931
|
+
console.log(pc.green(' Compaction auto-resume wired to watchdog for Slack channels'));
|
|
3932
|
+
}
|
|
3873
3933
|
let presenceProxy;
|
|
3874
3934
|
if (sharedIntelligence && telegram) {
|
|
3875
3935
|
try {
|