release: v2.37.0
This commit is contained in:
+1
-54
@@ -94,13 +94,9 @@ export class SidebarChatProvider implements vscode.WebviewViewProvider, BridgeIn
|
||||
await this._sendBrainProfiles();
|
||||
await this._sendSessionList();
|
||||
await this._sendModels();
|
||||
await this._sendConfig();
|
||||
await this._sendChronicleProjects();
|
||||
await this._restoreActiveSessionIntoView();
|
||||
break;
|
||||
case 'toggleMultiAgent':
|
||||
await vscode.workspace.getConfiguration('g1nation').update('multiAgentEnabled', data.value, vscode.ConfigurationTarget.Global);
|
||||
break;
|
||||
case 'getModels':
|
||||
await this._sendModels();
|
||||
break;
|
||||
@@ -489,17 +485,6 @@ export class SidebarChatProvider implements vscode.WebviewViewProvider, BridgeIn
|
||||
await this._context.globalState.update('chat_sessions', sessions.slice(0, 50));
|
||||
}
|
||||
|
||||
private async _sendConfig() {
|
||||
if (!this._view) return;
|
||||
const config = getConfig();
|
||||
this._view.webview.postMessage({
|
||||
type: 'configUpdate',
|
||||
value: {
|
||||
multiAgentEnabled: config.multiAgentEnabled
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private async _sendBrainStatus() {
|
||||
if (!this._view) return;
|
||||
const activeBrain = getActiveBrainProfile();
|
||||
@@ -2562,10 +2547,8 @@ export class SidebarChatProvider implements vscode.WebviewViewProvider, BridgeIn
|
||||
<div class="header-actions">
|
||||
<button class="icon-btn" id="newChatBtn" data-tooltip="New Chat">New</button>
|
||||
<button class="icon-btn" id="saveWikiRawBtn" data-tooltip="Save Wiki Raw">Wiki</button>
|
||||
<button class="icon-btn active" id="designerGuardBtn" data-tooltip="Chronicle Guard Mode: Auto">Guard</button>
|
||||
<button class="icon-btn active" id="brainTraceBtn" data-tooltip="Second Brain Trace Mode">Trace</button>
|
||||
<button class="icon-btn" id="brainTraceDebugBtn" data-tooltip="Second Brain Debug JSON">Dbg</button>
|
||||
<button class="icon-btn" id="multiAgentBtn" data-tooltip="Multi-Agent Mode">MA</button>
|
||||
<button class="icon-btn" id="internetBtn" data-tooltip="Internet Access">Web</button>
|
||||
<button class="icon-btn" id="historyBtn" data-tooltip="View History">Log</button>
|
||||
<button class="icon-btn" id="settingsBtn" data-tooltip="Settings">Set</button>
|
||||
@@ -2697,7 +2680,7 @@ export class SidebarChatProvider implements vscode.WebviewViewProvider, BridgeIn
|
||||
|
||||
function saveUiState() {
|
||||
const current = vscode.getState() || {};
|
||||
vscode.setState({ ...current, designerGuardEnabled, secondBrainTraceEnabled, secondBrainTraceDebug });
|
||||
vscode.setState({ ...current, secondBrainTraceEnabled, secondBrainTraceDebug });
|
||||
}
|
||||
|
||||
function renderHistory(history) {
|
||||
@@ -2838,23 +2821,16 @@ export class SidebarChatProvider implements vscode.WebviewViewProvider, BridgeIn
|
||||
|
||||
let streamBody = null;
|
||||
let internetEnabled = false;
|
||||
let designerGuardEnabled = true;
|
||||
let secondBrainTraceEnabled = true;
|
||||
let secondBrainTraceDebug = false;
|
||||
let pendingFiles = [];
|
||||
let editMode = false;
|
||||
if (previousState && typeof previousState.designerGuardEnabled === 'boolean') {
|
||||
designerGuardEnabled = previousState.designerGuardEnabled;
|
||||
}
|
||||
if (previousState && typeof previousState.secondBrainTraceEnabled === 'boolean') {
|
||||
secondBrainTraceEnabled = previousState.secondBrainTraceEnabled;
|
||||
}
|
||||
if (previousState && typeof previousState.secondBrainTraceDebug === 'boolean') {
|
||||
secondBrainTraceDebug = previousState.secondBrainTraceDebug;
|
||||
}
|
||||
const initialGuardBtn = document.getElementById('designerGuardBtn');
|
||||
initialGuardBtn.classList.toggle('active', designerGuardEnabled);
|
||||
initialGuardBtn.setAttribute('data-tooltip', designerGuardEnabled ? 'Chronicle Guard Mode: On' : 'Chronicle Guard Mode: Off');
|
||||
const initialTraceBtn = document.getElementById('brainTraceBtn');
|
||||
initialTraceBtn.classList.toggle('active', secondBrainTraceEnabled);
|
||||
initialTraceBtn.setAttribute('data-tooltip', secondBrainTraceEnabled ? 'Second Brain Trace Mode: On' : 'Second Brain Trace Mode: Off');
|
||||
@@ -3215,7 +3191,6 @@ export class SidebarChatProvider implements vscode.WebviewViewProvider, BridgeIn
|
||||
agentFile: agentSel.value === 'none' ? undefined : agentSel.value,
|
||||
brainProfileId: brainSel.value && brainSel.value !== 'new' ? brainSel.value : undefined,
|
||||
negativePrompt: negativePrompt.value.trim() || undefined,
|
||||
designerGuard: designerGuardEnabled,
|
||||
secondBrainTrace: secondBrainTraceEnabled,
|
||||
secondBrainTraceDebug
|
||||
});
|
||||
@@ -3263,13 +3238,6 @@ export class SidebarChatProvider implements vscode.WebviewViewProvider, BridgeIn
|
||||
document.getElementById('internetBtn').onclick = () => {
|
||||
internetEnabled = !internetEnabled; document.getElementById('internetBtn').classList.toggle('active', internetEnabled);
|
||||
};
|
||||
document.getElementById('designerGuardBtn').onclick = () => {
|
||||
designerGuardEnabled = !designerGuardEnabled;
|
||||
const btn = document.getElementById('designerGuardBtn');
|
||||
btn.classList.toggle('active', designerGuardEnabled);
|
||||
btn.setAttribute('data-tooltip', designerGuardEnabled ? 'Chronicle Guard Mode: On' : 'Chronicle Guard Mode: Off');
|
||||
saveUiState();
|
||||
};
|
||||
document.getElementById('brainTraceBtn').onclick = () => {
|
||||
secondBrainTraceEnabled = !secondBrainTraceEnabled;
|
||||
const btn = document.getElementById('brainTraceBtn');
|
||||
@@ -3285,18 +3253,6 @@ export class SidebarChatProvider implements vscode.WebviewViewProvider, BridgeIn
|
||||
saveUiState();
|
||||
};
|
||||
|
||||
let multiAgentEnabled = false;
|
||||
const setMultiAgentUi = (enabled) => {
|
||||
multiAgentEnabled = enabled;
|
||||
const btn = document.getElementById('multiAgentBtn');
|
||||
btn.classList.toggle('active', enabled);
|
||||
btn.setAttribute('data-tooltip', enabled ? 'Multi-Agent Mode: On' : 'Multi-Agent Mode: Off');
|
||||
};
|
||||
document.getElementById('multiAgentBtn').onclick = () => {
|
||||
setMultiAgentUi(!multiAgentEnabled);
|
||||
vscode.postMessage({ type: 'toggleMultiAgent', value: multiAgentEnabled });
|
||||
};
|
||||
|
||||
const syncBrain = () => { Sound.play(550, 'sine', 0.1); vscode.postMessage({ type: 'syncBrain' }); };
|
||||
document.getElementById('brainBtn').onclick = syncBrain;
|
||||
saveWikiRawBtn.onclick = () => vscode.postMessage({ type: 'saveWikiRaw' });
|
||||
@@ -3350,15 +3306,6 @@ export class SidebarChatProvider implements vscode.WebviewViewProvider, BridgeIn
|
||||
}
|
||||
};
|
||||
|
||||
// Handle initial state and state updates from extension
|
||||
window.addEventListener('message', e => {
|
||||
const msg = e.data;
|
||||
if (msg.type === 'configUpdate') {
|
||||
setMultiAgentUi(!!msg.value.multiAgentEnabled);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
agentSel.onchange = () => {
|
||||
if (agentSel.value !== 'none') {
|
||||
vscode.postMessage({ type: 'getAgentContent', path: agentSel.value });
|
||||
|
||||
Reference in New Issue
Block a user