chore: v2.2.73 — ASTRA-DEBUG 로그 레벨 + webview CSP font-src 보강
- ASTRA-DEBUG 정상 흐름 로그를 console.error → logInfo/console.log 로 강등 (chatHandlers, extension, slashRouter): DevTools에 ERR로 찍히던 오탐 제거 - sidebar webview에 명시적 CSP meta 추가 + font-src에 data: 허용 (sidebar.html, sidebarProvider._getHtml): VS Code outer iframe이 codicon.ttf를 data:font/ttf 로 inject하면서 기본 CSP에 막혀 매 prompt 마다 violation 경고가 찍히던 문제 해소 - 누적된 LM Studio / agent / 컨텍스트 매니저 / 테스트 갱신 동반 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -223,3 +223,71 @@ export function mergeContinuationParts(prev: string, next: string): string {
|
||||
|
||||
/** Rough token count of a string — re-exported helper so callers don't need contextManager directly. */
|
||||
export const countTokens = estimateTokens;
|
||||
|
||||
/**
|
||||
* ── Plain-text 출력 위생 ──────────────────────────────────────────────
|
||||
* 사용자가 마크다운 렌더 없이 깔끔한 한국어 plain text 답변을 원함.
|
||||
* 모델/페르소나가 학습된 습관으로 `##`, `**`, `> `, `* ` 등을 섞어 내보내면 화면에 그대로 노출되므로,
|
||||
* 최종 답변 직전 한 번 더 마커를 벗겨낸다.
|
||||
*
|
||||
* 보존:
|
||||
* - 코드 블록 (```fence``` 사이 본문은 손대지 않음)
|
||||
* - 인라인 코드 `code` (백틱 유지)
|
||||
* - 숫자 목록 `1. ` `1) ` 같은 자연 표기
|
||||
* - 줄 시작 대시 `- ` (자연스러운 plain text bullet)
|
||||
*
|
||||
* 제거 / 변환:
|
||||
* - 줄 시작 `#`,`##`,`###`,... `[space]` → 헤더 마커 제거 (라벨 텍스트는 유지)
|
||||
* - `**bold**` / `__bold__` → bold (강조 마커만 제거)
|
||||
* - 단일 `*텍스트*` 강조 → 텍스트 (단, `* ` 불릿 / 곱셈/와일드카드 패턴은 보존)
|
||||
* - 줄 시작 `> ` blockquote 마커 → 제거
|
||||
* - 줄 시작 `* ` 불릿 → `- ` 로 정규화 (asterisk 가 강조로 오인되는 일을 줄임)
|
||||
* - 헤더 줄에 붙어 있던 trailing colon/space 정리
|
||||
*/
|
||||
export function stripMarkdownFormatting(text: string): string {
|
||||
if (!text) return '';
|
||||
// 1. 코드 블록은 통째로 보호. fenced(```...```) 만 보호하고 본문 내부는 어떤 치환도 적용 안 함.
|
||||
const fenceParts: string[] = [];
|
||||
let src = String(text).replace(/```[\s\S]*?```/g, (m) => {
|
||||
fenceParts.push(m);
|
||||
return ` | ||||