osborn 0.9.249 → 0.9.250
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 +34 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5920,6 +5920,40 @@ async function main() {
|
|
|
5920
5920
|
}
|
|
5921
5921
|
}
|
|
5922
5922
|
}
|
|
5923
|
+
else if (data.type === 'stop_background_session') {
|
|
5924
|
+
// Close/kill a background slot: abort its subprocess + drop it from the registry.
|
|
5925
|
+
// Never touches the focused voice session (currentLLM). Keyed by full sessionId or
|
|
5926
|
+
// an 8-char prefix (the frontend row id may be either).
|
|
5927
|
+
const sid = data.sessionId;
|
|
5928
|
+
let key;
|
|
5929
|
+
if (sid) {
|
|
5930
|
+
if (slots.has(sid))
|
|
5931
|
+
key = sid;
|
|
5932
|
+
else
|
|
5933
|
+
key = [...slots.keys()].find(k => k === sid || k.startsWith(sid) || sid.startsWith(k));
|
|
5934
|
+
}
|
|
5935
|
+
if (!key) {
|
|
5936
|
+
await sendToFrontend({ type: 'background_session_error', slotId: sid ?? null, error: 'No matching background instance to stop' });
|
|
5937
|
+
}
|
|
5938
|
+
else {
|
|
5939
|
+
const slot = slots.get(key);
|
|
5940
|
+
try {
|
|
5941
|
+
slot.llm.abortQuery?.();
|
|
5942
|
+
slot.llm.abortAgent?.();
|
|
5943
|
+
}
|
|
5944
|
+
catch { }
|
|
5945
|
+
slots.delete(key);
|
|
5946
|
+
console.log(`🗑️ Stopped background slot ${key.substring(0, 8)}`);
|
|
5947
|
+
await sendToFrontend({ type: 'background_session_stopped', slotId: key });
|
|
5948
|
+
// Authoritative refresh so the panel drops the row.
|
|
5949
|
+
const focusedId2 = currentLLM?.sessionId || currentResumeSessionId || null;
|
|
5950
|
+
const focusedEntry2 = currentLLM ? [{ id: focusedId2 || '(pending)', isFocused: true, workingDir, hasSession: currentLLM.hasSession?.() ?? false }] : [];
|
|
5951
|
+
const bgEntries2 = [...slots.values()].map(s => ({ id: s.id, isFocused: s.isFocused, workingDir: s.workingDir, hasSession: s.llm.hasSession?.() ?? false }));
|
|
5952
|
+
await sendToFrontend({ type: 'slots_list', slots: [...focusedEntry2, ...bgEntries2] });
|
|
5953
|
+
// If that was the last background agent and no host anchor, let the room idle-exit.
|
|
5954
|
+
armAloneTimer();
|
|
5955
|
+
}
|
|
5956
|
+
}
|
|
5923
5957
|
else if (data.type === 'list_slots') {
|
|
5924
5958
|
// Return all live slots: the focused session + every background slot.
|
|
5925
5959
|
const focusedId = currentLLM?.sessionId || currentResumeSessionId || null;
|