fix(retrieval): resolved 'synonyms is not iterable' by using Map and Array.isArray v2.68.0

This commit is contained in:
g1nation
2026-05-05 10:39:34 +09:00
parent 177c10ee63
commit 55c8e1c9dd
3 changed files with 25 additions and 25 deletions
+2 -2
View File
@@ -1,12 +1,12 @@
{ {
"name": "g1nation", "name": "g1nation",
"version": "2.64.1", "version": "2.68.0",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "g1nation", "name": "g1nation",
"version": "2.64.1", "version": "2.68.0",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"marked": "^18.0.2" "marked": "^18.0.2"
+1 -1
View File
@@ -2,7 +2,7 @@
"name": "astra", "name": "astra",
"displayName": "Astra", "displayName": "Astra",
"description": "The personal intelligence layer for Antigravity and VS Code. A private cognitive partner for deep project context, memory, and proactive strategic decision-making.", "description": "The personal intelligence layer for Antigravity and VS Code. A private cognitive partner for deep project context, memory, and proactive strategic decision-making.",
"version": "2.67.0", "version": "2.68.0",
"publisher": "g1nation", "publisher": "g1nation",
"license": "MIT", "license": "MIT",
"icon": "assets/icon.png", "icon": "assets/icon.png",
+22 -22
View File
@@ -44,31 +44,31 @@ export function tokenize(text: string): string[] {
* 동의어/관련어 확장을 수행합니다. * 동의어/관련어 확장을 수행합니다.
*/ */
export function expandQuery(tokens: string[]): string[] { export function expandQuery(tokens: string[]): string[] {
const synonymMap: Record<string, string[]> = { const synonymMap = new Map<string, string[]>([
'성능': ['performance', 'optimization', '최적화', 'speed'], ['성능', ['performance', 'optimization', '최적화', 'speed']],
'performance': ['성능', '최적화', 'optimization', 'speed'], ['performance', ['성능', '최적화', 'optimization', 'speed']],
'아키텍처': ['architecture', '구조', 'structure', 'design'], ['아키텍처', ['architecture', '구조', 'structure', 'design']],
'architecture': ['아키텍처', '구조', 'structure', 'design'], ['architecture', ['아키텍처', '구조', 'structure', 'design']],
'메모리': ['memory', '기억', 'cache', 'storage'], ['메모리', ['memory', '기억', 'cache', 'storage']],
'memory': ['메모리', '기억', 'cache', 'storage'], ['memory', ['메모리', '기억', 'cache', 'storage']],
'버그': ['bug', 'error', '오류', 'issue', 'defect'], ['버그', ['bug', 'error', '오류', 'issue', 'defect']],
'bug': ['버그', 'error', '오류', 'issue'], ['bug', ['버그', 'error', '오류', 'issue']],
'설계': ['design', '아키텍처', 'architecture', 'pattern'], ['설계', ['design', '아키텍처', 'architecture', 'pattern']],
'design': ['설계', '아키텍처', 'architecture', 'pattern'], ['design', ['설계', '아키텍처', 'architecture', 'pattern']],
'배포': ['deploy', 'deployment', 'release', 'ci', 'cd'], ['배포', ['deploy', 'deployment', 'release', 'ci', 'cd']],
'deploy': ['배포', 'deployment', 'release'], ['deploy', ['배포', 'deployment', 'release']],
'테스트': ['test', 'testing', 'spec', 'jest', 'mocha'], ['테스트', ['test', 'testing', 'spec', 'jest', 'mocha']],
'test': ['테스트', 'testing', 'spec'], ['test', ['테스트', 'testing', 'spec']],
'프로젝트': ['project', '프로그램', 'repo', 'repository'], ['프로젝트', ['project', '프로그램', 'repo', 'repository']],
'project': ['프로젝트', '프로그램', 'repo'], ['project', ['프로젝트', '프로그램', 'repo']],
'방향': ['direction', '전략', 'strategy', '목표', 'goal'], ['방향', ['direction', '전략', 'strategy', '목표', 'goal']],
'direction': ['방향', '전략', 'strategy', '목표'] ['direction', ['방향', '전략', 'strategy', '목표']]
}; ]);
const expanded = new Set(tokens); const expanded = new Set(tokens);
for (const token of tokens) { for (const token of tokens) {
const synonyms = synonymMap[token]; const synonyms = synonymMap.get(token);
if (synonyms) { if (Array.isArray(synonyms)) {
for (const syn of synonyms) { for (const syn of synonyms) {
expanded.add(syn); expanded.add(syn);
} }