osborn 0.9.189 → 0.9.190
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/index.js +25 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -29,7 +29,7 @@ import { createGunzip } from 'node:zlib';
|
|
|
29
29
|
const __filename = fileURLToPath(import.meta.url);
|
|
30
30
|
const __dirname = dirname(__filename);
|
|
31
31
|
import { createPatch } from 'diff';
|
|
32
|
-
import { loadConfig, getMcpServers, getEnabledMcpServerNames, getVoiceMode, getDirectConfig, listAllClaudeSessions, invalidateSessionListCache, getMostRecentSessionId, sessionExists, getSessionSummary, getConversationHistory, ensureSessionWorkspace, getMcpServerStatusList, buildMcpServersForKeys, listWorkspaceArtifacts } from './config.js';
|
|
32
|
+
import { loadConfig, getMcpServers, getEnabledMcpServerNames, getVoiceMode, getDirectConfig, listSessions, listAllClaudeSessions, invalidateSessionListCache, getMostRecentSessionId, sessionExists, getSessionSummary, getConversationHistory, ensureSessionWorkspace, getMcpServerStatusList, buildMcpServersForKeys, listWorkspaceArtifacts } from './config.js';
|
|
33
33
|
import { createSTT, createTTS, DIRECT_MODE_STT, DIRECT_MODE_TTS } from './voice-io.js';
|
|
34
34
|
import { createClaudeLLM, NAMED_AGENTS, applyTurbo } from './claude-llm.js';
|
|
35
35
|
import { clearPipelineFastBrainSession, prewarmBM25Index } from './pipeline-fastbrain.js';
|
|
@@ -4553,11 +4553,32 @@ async function main() {
|
|
|
4553
4553
|
console.log('💓 Sending agent_ready signal...');
|
|
4554
4554
|
let readySent = false;
|
|
4555
4555
|
// (realtime provider removed)
|
|
4556
|
-
// Session list state — populated
|
|
4556
|
+
// Session list state — populated in two tiers (fast then full)
|
|
4557
4557
|
let sessionsForFrontend = [];
|
|
4558
4558
|
let recentSessionId = null;
|
|
4559
4559
|
let hasRecentSession = false;
|
|
4560
4560
|
let sessionsLoaded = false;
|
|
4561
|
+
// Tier 1: fast scan — current project only, ~5ms
|
|
4562
|
+
// Gives the frontend enough to show "Resume last session?" immediately.
|
|
4563
|
+
try {
|
|
4564
|
+
const recentSessions = await listSessions(workingDir);
|
|
4565
|
+
if (recentSessions.length > 0) {
|
|
4566
|
+
const top = recentSessions[0];
|
|
4567
|
+
recentSessionId = top.sessionId;
|
|
4568
|
+
hasRecentSession = true;
|
|
4569
|
+
sessionsForFrontend = [{
|
|
4570
|
+
sessionId: top.sessionId,
|
|
4571
|
+
projectSlug: top.projectPath,
|
|
4572
|
+
projectPath: top.projectPath,
|
|
4573
|
+
cwd: top.projectPath,
|
|
4574
|
+
timestamp: top.timestamp.toISOString(),
|
|
4575
|
+
lastMessage: top.lastMessage,
|
|
4576
|
+
messageCount: top.messageCount,
|
|
4577
|
+
fileSize: 0,
|
|
4578
|
+
}];
|
|
4579
|
+
}
|
|
4580
|
+
}
|
|
4581
|
+
catch { }
|
|
4561
4582
|
const sendReady = async () => {
|
|
4562
4583
|
if (readySent)
|
|
4563
4584
|
return;
|
|
@@ -4580,13 +4601,13 @@ async function main() {
|
|
|
4580
4601
|
});
|
|
4581
4602
|
};
|
|
4582
4603
|
const readyInterval = setInterval(sendReady, 2000);
|
|
4583
|
-
// Fire immediately
|
|
4604
|
+
// Fire immediately with the fast-scanned recent session (sessionsLoaded still false)
|
|
4584
4605
|
await sendReady();
|
|
4585
4606
|
setTimeout(() => {
|
|
4586
4607
|
clearInterval(readyInterval);
|
|
4587
4608
|
console.log('✅ agent_ready retries complete');
|
|
4588
4609
|
}, 20000);
|
|
4589
|
-
//
|
|
4610
|
+
// Tier 2: full cross-project scan in background — no blocking
|
|
4590
4611
|
listAllClaudeSessions().then(allSessions => {
|
|
4591
4612
|
recentSessionId = allSessions.length > 0 ? allSessions[0].sessionId : null;
|
|
4592
4613
|
hasRecentSession = allSessions.length > 0;
|