feat(astra): 이메일 Settings 패널 섹션 (자동동기화 토글 + 지금 동기화 + 인덱스 상태)
Astra Settings 패널에 Email 섹션 추가 — autoSync 토글, 간격/범위/최대수 설정, '지금 동기화' 버튼(슬래시와 동일 syncEmails 코어), 인덱스 상태(건수/최신일) 표시. VSCode 설정 JSON 안 건드리고 패널에서 관리. 타입체크·빌드 통과. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -117,6 +117,46 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Email (Project Astra) -->
|
||||
<section class="section" data-section="email">
|
||||
<h2>이메일 (Project Astra)</h2>
|
||||
<p class="hint">Gmail 을 <strong>읽기 전용</strong>으로 수집해 로컬 인덱스에 저장하고, 채팅이 메일 근거(원문 링크 포함)로 답하게 합니다. 본문은 로컬을 벗어나지 않으며 합성은 로컬 LLM 만 사용합니다. (최초 1회 <code>gmail.readonly</code> 재인증 필요)</p>
|
||||
<div class="row">
|
||||
<label>인덱스 상태</label>
|
||||
<small id="emailStatus" class="hint">—</small>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label for="emailAutoSync">자동 동기화</label>
|
||||
<input id="emailAutoSync" type="checkbox" />
|
||||
<small class="hint">켜면 백그라운드에서 주기적으로 자동 수집합니다.</small>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label for="emailInterval">동기화 간격(분)</label>
|
||||
<div class="input-group narrow">
|
||||
<input id="emailInterval" type="number" min="5" max="1440" step="5" />
|
||||
<button data-save="email.interval">저장</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label for="emailDays">수집 범위(일)</label>
|
||||
<div class="input-group narrow">
|
||||
<input id="emailDays" type="number" min="1" max="365" step="1" />
|
||||
<button data-save="email.days">저장</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label for="emailMax">최대 메일 수</label>
|
||||
<div class="input-group narrow">
|
||||
<input id="emailMax" type="number" min="1" max="2000" step="50" />
|
||||
<button data-save="email.max">저장</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<button id="emailSyncNow">지금 동기화</button>
|
||||
<small id="emailSyncMsg" class="hint"></small>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Memory -->
|
||||
<section class="section" data-section="memory">
|
||||
<h2>메모리</h2>
|
||||
|
||||
@@ -34,6 +34,15 @@
|
||||
const dcMaxPages = $('dcMaxPages');
|
||||
const dcSynthTemp = $('dcSynthTemp');
|
||||
|
||||
// ---- Email (Project Astra) ----
|
||||
const emailStatus = $('emailStatus');
|
||||
const emailAutoSync = $('emailAutoSync');
|
||||
const emailInterval = $('emailInterval');
|
||||
const emailDays = $('emailDays');
|
||||
const emailMax = $('emailMax');
|
||||
const emailSyncNow = $('emailSyncNow');
|
||||
const emailSyncMsg = $('emailSyncMsg');
|
||||
|
||||
// ---- Memory ----
|
||||
const memEnabled = $('memEnabled');
|
||||
const memShort = $('memShort');
|
||||
@@ -153,6 +162,23 @@
|
||||
vscode.postMessage({ type: 'datacollect.update', synthesisTemperature: Number(dcSynthTemp.value) })
|
||||
);
|
||||
|
||||
// ---- Email listeners ----
|
||||
emailAutoSync.addEventListener('change', () =>
|
||||
vscode.postMessage({ type: 'email.update', autoSync: emailAutoSync.checked })
|
||||
);
|
||||
document.querySelector('[data-save="email.interval"]').addEventListener('click', () =>
|
||||
vscode.postMessage({ type: 'email.update', autoSyncIntervalMinutes: Number(emailInterval.value) })
|
||||
);
|
||||
document.querySelector('[data-save="email.days"]').addEventListener('click', () =>
|
||||
vscode.postMessage({ type: 'email.update', syncDays: Number(emailDays.value) })
|
||||
);
|
||||
document.querySelector('[data-save="email.max"]').addEventListener('click', () =>
|
||||
vscode.postMessage({ type: 'email.update', syncMaxMessages: Number(emailMax.value) })
|
||||
);
|
||||
emailSyncNow.addEventListener('click', () =>
|
||||
vscode.postMessage({ type: 'email.syncNow' })
|
||||
);
|
||||
|
||||
// ---- Memory listeners ----
|
||||
memEnabled.addEventListener('change', (e) =>
|
||||
vscode.postMessage({ type: 'memory.update', memoryEnabled: e.target.checked })
|
||||
@@ -409,6 +435,21 @@
|
||||
setIfNotFocused(dcSynthTemp, dc.synthesisTemperature);
|
||||
}
|
||||
|
||||
// ---- Email (Project Astra) ----
|
||||
const em = state.email;
|
||||
if (em) {
|
||||
if (document.activeElement !== emailAutoSync) emailAutoSync.checked = !!em.autoSync;
|
||||
setIfNotFocused(emailInterval, em.autoSyncIntervalMinutes);
|
||||
setIfNotFocused(emailDays, em.syncDays);
|
||||
setIfNotFocused(emailMax, em.syncMaxMessages);
|
||||
emailStatus.textContent = em.indexedCount > 0
|
||||
? `${em.indexedCount}건 저장됨${em.newestDate ? ` · 최신 ${em.newestDate}` : ''}`
|
||||
: '수집된 메일 없음 — "지금 동기화" 또는 /email-sync 실행';
|
||||
emailSyncMsg.textContent = em.lastSyncMessage || '';
|
||||
emailSyncNow.disabled = !!em.syncing;
|
||||
emailSyncNow.textContent = em.syncing ? '동기화 중…' : '지금 동기화';
|
||||
}
|
||||
|
||||
// ---- Memory ----
|
||||
const mem = state.memory;
|
||||
memEnabled.checked = !!mem.memoryEnabled;
|
||||
|
||||
Reference in New Issue
Block a user