a2a-memory 0.11.5 → 0.12.0
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/LICENSE +7 -19
- package/README.md +1 -1
- package/dist/a2a/client.js +1 -252
- package/dist/a2a/discovery.js +1 -115
- package/dist/a2a/index.js +1 -8
- package/dist/a2a/types.js +1 -42
- package/dist/adapters/anthropic.js +1 -117
- package/dist/chunking/chunker.js +1 -163
- package/dist/claude/sync.d.ts +8 -2
- package/dist/claude/sync.js +1 -298
- package/dist/cli/commands/add.js +1 -80
- package/dist/cli/commands/claude-sync.d.ts +3 -3
- package/dist/cli/commands/claude-sync.js +1 -70
- package/dist/cli/commands/cleanup.js +1 -83
- package/dist/cli/commands/config.js +1 -79
- package/dist/cli/commands/edit.js +1 -69
- package/dist/cli/commands/embed.js +1 -92
- package/dist/cli/commands/extract.js +1 -103
- package/dist/cli/commands/health.js +1 -105
- package/dist/cli/commands/list.js +1 -46
- package/dist/cli/commands/migrate-chunks.js +1 -205
- package/dist/cli/commands/migrate-file-refs.js +1 -183
- package/dist/cli/commands/proficiency.js +1 -146
- package/dist/cli/commands/rm.js +1 -64
- package/dist/cli/commands/search.js +1 -90
- package/dist/cli/commands/setup-wizard.js +1 -387
- package/dist/cli/commands/setup.js +1 -170
- package/dist/cli/commands/skill.js +1 -151
- package/dist/cli/commands/status.js +1 -70
- package/dist/cli/commands/sync.js +1 -202
- package/dist/cli/commands/team.js +1 -142
- package/dist/cli/index.js +1 -87
- package/dist/config/manager.js +1 -372
- package/dist/db/database.d.ts +36 -0
- package/dist/db/database.js +1 -1400
- package/dist/embedding/e5-provider.js +1 -147
- package/dist/embedding/index.js +1 -34
- package/dist/embedding/local-provider.js +1 -157
- package/dist/embedding/openai-provider.js +1 -92
- package/dist/embedding/quantization.js +1 -89
- package/dist/extraction/dedup-manager.js +1 -161
- package/dist/extraction/emotion-filter.js +1 -33
- package/dist/extraction/extractor.d.ts +0 -3
- package/dist/extraction/extractor.js +1 -648
- package/dist/extraction/file-reference.js +1 -77
- package/dist/extraction/filter.js +1 -86
- package/dist/extraction/scorer.js +1 -142
- package/dist/extraction/similarity.js +1 -85
- package/dist/hooks/client-factory.js +1 -44
- package/dist/hooks/post-tool-use.js +1 -518
- package/dist/hooks/pre-compact.js +1 -209
- package/dist/hooks/session-end.js +1 -633
- package/dist/hooks/session-start.js +1 -549
- package/dist/hooks/shared.js +1 -110
- package/dist/hooks/stop.d.ts +21 -0
- package/dist/hooks/stop.js +1 -0
- package/dist/hooks/user-prompt-submit.js +1 -316
- package/dist/i18n/index.js +1 -2
- package/dist/i18n/messages.js +1 -150
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -43
- package/dist/lifecycle/cleanup-scheduler.js +1 -137
- package/dist/lifecycle/cleanup.d.ts +1 -0
- package/dist/lifecycle/cleanup.js +1 -116
- package/dist/lifecycle/consolidation.d.ts +22 -0
- package/dist/lifecycle/consolidation.js +1 -0
- package/dist/lifecycle/index.d.ts +2 -0
- package/dist/lifecycle/index.js +1 -13
- package/dist/lifecycle/injection-flush.d.ts +24 -0
- package/dist/lifecycle/injection-flush.js +1 -0
- package/dist/lifecycle/quality-scorer.d.ts +5 -6
- package/dist/lifecycle/quality-scorer.js +1 -46
- package/dist/lifecycle/tiering.js +1 -246
- package/dist/llm/client.js +1 -226
- package/dist/llm/index.js +1 -5
- package/dist/proficiency/actr-engine.js +1 -106
- package/dist/proficiency/detection.js +1 -77
- package/dist/proficiency/index.js +1 -9
- package/dist/proficiency/tracker.js +1 -173
- package/dist/proficiency/types.js +1 -8
- package/dist/providers/adapters.js +1 -140
- package/dist/providers/detector.js +1 -57
- package/dist/search/adaptive-router.js +1 -93
- package/dist/search/index.js +1 -9
- package/dist/search/ranker.js +1 -171
- package/dist/search/reranker.js +1 -155
- package/dist/session/parser.js +1 -130
- package/dist/skill/evaluator.js +1 -509
- package/dist/skill/index.js +1 -7
- package/dist/skill/types.js +1 -7
- package/dist/sync/client.d.ts +7 -0
- package/dist/sync/client.js +1 -597
- package/dist/sync/encryption.js +1 -203
- package/dist/sync/index.js +1 -12
- package/dist/sync/queue.js +1 -214
- package/dist/sync/scheduler.js +1 -140
- package/dist/sync/synchronizer.js +1 -241
- package/dist/sync/team-synchronizer.js +1 -204
- package/dist/sync/vector-clock.js +1 -70
- package/dist/types/index.d.ts +13 -1
- package/dist/types/index.js +1 -132
- package/dist/utils/keychain.js +1 -170
- package/dist/utils/logger.js +1 -128
- package/package.json +15 -10
- package/dist/a2a/client.d.ts.map +0 -1
- package/dist/a2a/client.js.map +0 -1
- package/dist/a2a/discovery.d.ts.map +0 -1
- package/dist/a2a/discovery.js.map +0 -1
- package/dist/a2a/index.d.ts.map +0 -1
- package/dist/a2a/index.js.map +0 -1
- package/dist/a2a/types.d.ts.map +0 -1
- package/dist/a2a/types.js.map +0 -1
- package/dist/adapters/anthropic.d.ts.map +0 -1
- package/dist/adapters/anthropic.js.map +0 -1
- package/dist/chunking/chunker.d.ts.map +0 -1
- package/dist/chunking/chunker.js.map +0 -1
- package/dist/claude/sync.d.ts.map +0 -1
- package/dist/claude/sync.js.map +0 -1
- package/dist/cli/commands/add.d.ts.map +0 -1
- package/dist/cli/commands/add.js.map +0 -1
- package/dist/cli/commands/claude-sync.d.ts.map +0 -1
- package/dist/cli/commands/claude-sync.js.map +0 -1
- package/dist/cli/commands/cleanup.d.ts.map +0 -1
- package/dist/cli/commands/cleanup.js.map +0 -1
- package/dist/cli/commands/config.d.ts.map +0 -1
- package/dist/cli/commands/config.js.map +0 -1
- package/dist/cli/commands/edit.d.ts.map +0 -1
- package/dist/cli/commands/edit.js.map +0 -1
- package/dist/cli/commands/embed.d.ts.map +0 -1
- package/dist/cli/commands/embed.js.map +0 -1
- package/dist/cli/commands/extract.d.ts.map +0 -1
- package/dist/cli/commands/extract.js.map +0 -1
- package/dist/cli/commands/health.d.ts.map +0 -1
- package/dist/cli/commands/health.js.map +0 -1
- package/dist/cli/commands/list.d.ts.map +0 -1
- package/dist/cli/commands/list.js.map +0 -1
- package/dist/cli/commands/migrate-chunks.d.ts.map +0 -1
- package/dist/cli/commands/migrate-chunks.js.map +0 -1
- package/dist/cli/commands/migrate-file-refs.d.ts.map +0 -1
- package/dist/cli/commands/migrate-file-refs.js.map +0 -1
- package/dist/cli/commands/proficiency.d.ts.map +0 -1
- package/dist/cli/commands/proficiency.js.map +0 -1
- package/dist/cli/commands/rm.d.ts.map +0 -1
- package/dist/cli/commands/rm.js.map +0 -1
- package/dist/cli/commands/search.d.ts.map +0 -1
- package/dist/cli/commands/search.js.map +0 -1
- package/dist/cli/commands/setup-wizard.d.ts.map +0 -1
- package/dist/cli/commands/setup-wizard.js.map +0 -1
- package/dist/cli/commands/setup.d.ts.map +0 -1
- package/dist/cli/commands/setup.js.map +0 -1
- package/dist/cli/commands/skill.d.ts.map +0 -1
- package/dist/cli/commands/skill.js.map +0 -1
- package/dist/cli/commands/status.d.ts.map +0 -1
- package/dist/cli/commands/status.js.map +0 -1
- package/dist/cli/commands/sync.d.ts.map +0 -1
- package/dist/cli/commands/sync.js.map +0 -1
- package/dist/cli/commands/team.d.ts.map +0 -1
- package/dist/cli/commands/team.js.map +0 -1
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/index.js.map +0 -1
- package/dist/config/manager.d.ts.map +0 -1
- package/dist/config/manager.js.map +0 -1
- package/dist/db/database.d.ts.map +0 -1
- package/dist/db/database.js.map +0 -1
- package/dist/embedding/e5-provider.d.ts.map +0 -1
- package/dist/embedding/e5-provider.js.map +0 -1
- package/dist/embedding/index.d.ts.map +0 -1
- package/dist/embedding/index.js.map +0 -1
- package/dist/embedding/local-provider.d.ts.map +0 -1
- package/dist/embedding/local-provider.js.map +0 -1
- package/dist/embedding/openai-provider.d.ts.map +0 -1
- package/dist/embedding/openai-provider.js.map +0 -1
- package/dist/embedding/quantization.d.ts.map +0 -1
- package/dist/embedding/quantization.js.map +0 -1
- package/dist/extraction/dedup-manager.d.ts.map +0 -1
- package/dist/extraction/dedup-manager.js.map +0 -1
- package/dist/extraction/emotion-filter.d.ts.map +0 -1
- package/dist/extraction/emotion-filter.js.map +0 -1
- package/dist/extraction/extractor.d.ts.map +0 -1
- package/dist/extraction/extractor.js.map +0 -1
- package/dist/extraction/file-reference.d.ts.map +0 -1
- package/dist/extraction/file-reference.js.map +0 -1
- package/dist/extraction/filter.d.ts.map +0 -1
- package/dist/extraction/filter.js.map +0 -1
- package/dist/extraction/scorer.d.ts.map +0 -1
- package/dist/extraction/scorer.js.map +0 -1
- package/dist/extraction/similarity.d.ts.map +0 -1
- package/dist/extraction/similarity.js.map +0 -1
- package/dist/hooks/client-factory.d.ts.map +0 -1
- package/dist/hooks/client-factory.js.map +0 -1
- package/dist/hooks/post-tool-use.d.ts.map +0 -1
- package/dist/hooks/post-tool-use.js.map +0 -1
- package/dist/hooks/pre-compact.d.ts.map +0 -1
- package/dist/hooks/pre-compact.js.map +0 -1
- package/dist/hooks/session-end.d.ts.map +0 -1
- package/dist/hooks/session-end.js.map +0 -1
- package/dist/hooks/session-start.d.ts.map +0 -1
- package/dist/hooks/session-start.js.map +0 -1
- package/dist/hooks/shared.d.ts.map +0 -1
- package/dist/hooks/shared.js.map +0 -1
- package/dist/hooks/user-prompt-submit.d.ts.map +0 -1
- package/dist/hooks/user-prompt-submit.js.map +0 -1
- package/dist/i18n/index.d.ts.map +0 -1
- package/dist/i18n/index.js.map +0 -1
- package/dist/i18n/messages.d.ts.map +0 -1
- package/dist/i18n/messages.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lifecycle/cleanup-scheduler.d.ts.map +0 -1
- package/dist/lifecycle/cleanup-scheduler.js.map +0 -1
- package/dist/lifecycle/cleanup.d.ts.map +0 -1
- package/dist/lifecycle/cleanup.js.map +0 -1
- package/dist/lifecycle/index.d.ts.map +0 -1
- package/dist/lifecycle/index.js.map +0 -1
- package/dist/lifecycle/quality-scorer.d.ts.map +0 -1
- package/dist/lifecycle/quality-scorer.js.map +0 -1
- package/dist/lifecycle/tiering.d.ts.map +0 -1
- package/dist/lifecycle/tiering.js.map +0 -1
- package/dist/llm/client.d.ts.map +0 -1
- package/dist/llm/client.js.map +0 -1
- package/dist/llm/index.d.ts.map +0 -1
- package/dist/llm/index.js.map +0 -1
- package/dist/proficiency/actr-engine.d.ts.map +0 -1
- package/dist/proficiency/actr-engine.js.map +0 -1
- package/dist/proficiency/detection.d.ts.map +0 -1
- package/dist/proficiency/detection.js.map +0 -1
- package/dist/proficiency/index.d.ts.map +0 -1
- package/dist/proficiency/index.js.map +0 -1
- package/dist/proficiency/tracker.d.ts.map +0 -1
- package/dist/proficiency/tracker.js.map +0 -1
- package/dist/proficiency/types.d.ts.map +0 -1
- package/dist/proficiency/types.js.map +0 -1
- package/dist/providers/adapters.d.ts.map +0 -1
- package/dist/providers/adapters.js.map +0 -1
- package/dist/providers/detector.d.ts.map +0 -1
- package/dist/providers/detector.js.map +0 -1
- package/dist/search/adaptive-router.d.ts.map +0 -1
- package/dist/search/adaptive-router.js.map +0 -1
- package/dist/search/index.d.ts.map +0 -1
- package/dist/search/index.js.map +0 -1
- package/dist/search/ranker.d.ts.map +0 -1
- package/dist/search/ranker.js.map +0 -1
- package/dist/search/reranker.d.ts.map +0 -1
- package/dist/search/reranker.js.map +0 -1
- package/dist/session/parser.d.ts.map +0 -1
- package/dist/session/parser.js.map +0 -1
- package/dist/skill/evaluator.d.ts.map +0 -1
- package/dist/skill/evaluator.js.map +0 -1
- package/dist/skill/index.d.ts.map +0 -1
- package/dist/skill/index.js.map +0 -1
- package/dist/skill/types.d.ts.map +0 -1
- package/dist/skill/types.js.map +0 -1
- package/dist/sync/client.d.ts.map +0 -1
- package/dist/sync/client.js.map +0 -1
- package/dist/sync/encryption.d.ts.map +0 -1
- package/dist/sync/encryption.js.map +0 -1
- package/dist/sync/index.d.ts.map +0 -1
- package/dist/sync/index.js.map +0 -1
- package/dist/sync/queue.d.ts.map +0 -1
- package/dist/sync/queue.js.map +0 -1
- package/dist/sync/scheduler.d.ts.map +0 -1
- package/dist/sync/scheduler.js.map +0 -1
- package/dist/sync/synchronizer.d.ts.map +0 -1
- package/dist/sync/synchronizer.js.map +0 -1
- package/dist/sync/team-synchronizer.d.ts.map +0 -1
- package/dist/sync/team-synchronizer.js.map +0 -1
- package/dist/sync/vector-clock.d.ts.map +0 -1
- package/dist/sync/vector-clock.js.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js.map +0 -1
- package/dist/utils/keychain.d.ts.map +0 -1
- package/dist/utils/keychain.js.map +0 -1
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js.map +0 -1
package/dist/hooks/shared.js
CHANGED
|
@@ -1,110 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Hook 공유 유틸리티
|
|
3
|
-
* 프로세스 내 DB 싱글톤으로 중복 초기화 방지
|
|
4
|
-
*/
|
|
5
|
-
import { MemoryDatabase } from '../db/database.js';
|
|
6
|
-
let _sharedDb = null;
|
|
7
|
-
let _sharedDbPath = null;
|
|
8
|
-
/**
|
|
9
|
-
* 프로세스 내 DB 싱글톤 조회/생성
|
|
10
|
-
*/
|
|
11
|
-
export function getSharedDb(dbPath) {
|
|
12
|
-
if (_sharedDb && _sharedDbPath === dbPath) {
|
|
13
|
-
return _sharedDb;
|
|
14
|
-
}
|
|
15
|
-
if (_sharedDb) {
|
|
16
|
-
try {
|
|
17
|
-
_sharedDb.close();
|
|
18
|
-
}
|
|
19
|
-
catch { /* ignore */ }
|
|
20
|
-
}
|
|
21
|
-
_sharedDb = new MemoryDatabase(dbPath);
|
|
22
|
-
_sharedDbPath = dbPath;
|
|
23
|
-
_sharedDb.initialize();
|
|
24
|
-
return _sharedDb;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* DB 종료 (프로세스 종료 시 호출)
|
|
28
|
-
*/
|
|
29
|
-
export function closeSharedDb() {
|
|
30
|
-
if (_sharedDb) {
|
|
31
|
-
try {
|
|
32
|
-
_sharedDb.close();
|
|
33
|
-
}
|
|
34
|
-
catch { /* ignore */ }
|
|
35
|
-
_sharedDb = null;
|
|
36
|
-
_sharedDbPath = null;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* 테스트용 리셋
|
|
41
|
-
*/
|
|
42
|
-
export function resetSharedDb() {
|
|
43
|
-
_sharedDb = null;
|
|
44
|
-
_sharedDbPath = null;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Claude Code stdin 입력을 내부 camelCase 형식으로 변환
|
|
48
|
-
*
|
|
49
|
-
* Claude Code는 snake_case로 전송:
|
|
50
|
-
* session_id, hook_event_name, tool_name, tool_input, tool_response, cwd, transcript_path
|
|
51
|
-
* Plugin 내부는 camelCase 사용:
|
|
52
|
-
* sessionId, hookName, toolName, toolInput, toolResult, projectPath, cwd
|
|
53
|
-
*/
|
|
54
|
-
export function normalizeHookInput(raw) {
|
|
55
|
-
return {
|
|
56
|
-
// 공통 필드
|
|
57
|
-
hookName: raw.hook_event_name ?? raw.hookName,
|
|
58
|
-
sessionId: raw.session_id ?? raw.sessionId,
|
|
59
|
-
projectPath: raw.cwd ?? raw.projectPath,
|
|
60
|
-
cwd: raw.cwd ?? raw.projectPath,
|
|
61
|
-
transcriptPath: raw.transcript_path ?? raw.transcriptPath,
|
|
62
|
-
// PostToolUse 전용
|
|
63
|
-
toolName: raw.tool_name ?? raw.toolName,
|
|
64
|
-
toolInput: raw.tool_input ?? raw.toolInput ?? {},
|
|
65
|
-
toolResult: typeof (raw.tool_response ?? raw.toolResult) === 'object'
|
|
66
|
-
? JSON.stringify(raw.tool_response ?? raw.toolResult)
|
|
67
|
-
: String(raw.tool_response ?? raw.toolResult ?? ''),
|
|
68
|
-
// SessionEnd 전용
|
|
69
|
-
capturedMemoryIds: raw.capturedMemoryIds ?? [],
|
|
70
|
-
modifiedFiles: raw.modifiedFiles ?? [],
|
|
71
|
-
// UserPromptSubmit 전용
|
|
72
|
-
userPrompt: raw.user_prompt ?? raw.userPrompt ?? '',
|
|
73
|
-
// PreCompact 전용
|
|
74
|
-
transcript: raw.transcript ?? '',
|
|
75
|
-
// 원본 데이터 보존 (디버깅용)
|
|
76
|
-
_raw: raw,
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* 프롬프트 텍스트에서 검색 키워드 추출
|
|
81
|
-
* - 불용어 제거
|
|
82
|
-
* - 의미 있는 토큰만 반환
|
|
83
|
-
* - 최대 8개 키워드
|
|
84
|
-
*/
|
|
85
|
-
const STOP_WORDS = new Set([
|
|
86
|
-
'the', 'a', 'an', 'is', 'are', 'was', 'were', 'be', 'been', 'being',
|
|
87
|
-
'have', 'has', 'had', 'do', 'does', 'did', 'will', 'would', 'shall', 'should',
|
|
88
|
-
'may', 'might', 'must', 'can', 'could', 'to', 'of', 'in', 'for', 'on', 'with',
|
|
89
|
-
'at', 'by', 'from', 'as', 'into', 'through', 'during', 'before', 'after',
|
|
90
|
-
'and', 'but', 'or', 'nor', 'not', 'so', 'yet', 'both', 'either', 'neither',
|
|
91
|
-
'this', 'that', 'these', 'those', 'it', 'its', 'my', 'your', 'his', 'her',
|
|
92
|
-
'our', 'their', 'what', 'which', 'who', 'whom', 'whose',
|
|
93
|
-
'i', 'me', 'we', 'us', 'you', 'he', 'she', 'they', 'them',
|
|
94
|
-
// 한국어 불용어
|
|
95
|
-
'이', '그', '저', '것', '수', '등', '및', '중', '더', '때', '좀',
|
|
96
|
-
'해줘', '해주세요', '알려줘', '알려주세요', '해', '하고', '하는', '하면',
|
|
97
|
-
]);
|
|
98
|
-
export function extractSearchKeywords(prompt) {
|
|
99
|
-
// 코드 블록 제거
|
|
100
|
-
const cleaned = prompt.replace(/```[\s\S]*?```/g, '').replace(/`[^`]+`/g, '');
|
|
101
|
-
// 토큰 분리 (영문+한국어 혼합)
|
|
102
|
-
const tokens = cleaned
|
|
103
|
-
.split(/[\s,.!?;:()[\]{}"'<>]+/)
|
|
104
|
-
.map(t => t.trim())
|
|
105
|
-
.filter(t => t.length > 1 && !STOP_WORDS.has(t.toLowerCase()) && !/^\d+$/.test(t));
|
|
106
|
-
// 중복 제거 + 최대 8개
|
|
107
|
-
const unique = [...new Set(tokens)];
|
|
108
|
-
return unique.slice(0, 8).join(' ');
|
|
109
|
-
}
|
|
110
|
-
//# sourceMappingURL=shared.js.map
|
|
1
|
+
function _0x97cd(){const _0x423dfc=['yMvLBG','B1nmCeO','BNnL','BM90','AgvY','AxrZ','AM9PBG','Dg9VBf9YzxnWBW','x25HBwu','Ag9VA05HBwu','BgvZ','Dg9VBf9Uyw1L','BgvUz3rO','CMvWBgfJzq','zMLSDgvY','yNv0','Ew91CG','D2HPy2G','yxjL','ndmYotG3m3jerfDPsW','y3DK','A0PnBNe','y291Bgq','DgHVC2u','DgHLBq','DhjHBNnJCMLWDa','Ewv0','Dg9mB3DLCKnHCW','D291Bgq','mLPRuhbYBq','mtq3mfjPrKnAtq','Ew91','B3vY','D2HVC2u','Dg9VBe5HBwu','wNvqyum','C2vZC2LVBKLK','zNjVBq','yw5K','ntq2r2DQC3LR','mtCZndbnr2X3EMS','y2fU','zM9Y','mtK2mZKYmfPJyNvOuq','Aw5PDgLHBgL6zq','mJe2mJnZsLLrvLm','quTrEfG','BMvPDgHLCG','tvfItKm','mJaWnJi0mwTUsNPTEG','C3bSAxq','C2XPy2u','DgHYB3vNAa','ugf0Aa','yM90Aa','B2jQzwn0','x3bHDgG','D2HHDa','DgHLC2u','C2HHBgW','AgfZ','vxfbuw0','yMvPBMC','Bw9KAwzPzwrgAq','7jwm66cK7ksy','DgHLAxi','DgHLEq','mZbRrwDxyMO','D2LSBa','Dg9VBeLUChv0','C2vZC2LVBL9Pza','BwfW','ChjVAMvJDfbHDa','nZKYntm5qKjLuLvq','Ag9VA19LDMvUDa','mtm4nZC1me15zKjlyW','D2HV','Dg9VBfjLC3vSDa','DhjPBq','zg9LCW','zgLK','y2XVC2u','7jwm66cK7ko87is47jQu','Dg9VBf9PBNb1Da','DgHPCW','y2fWDhvYzwrnzq'];_0x97cd=function(){return _0x423dfc;};return _0x97cd();}(function(_0x432e37,_0x468508){function _0x3cf43d(_0x5c726b,_0x5cb7de){return _0x17c4(_0x5cb7de-0xc1,_0x5c726b);}const _0x1ed57b=_0x432e37();function _0x4163b4(_0x1364e3,_0x3cf052){return _0x17c4(_0x1364e3-0x184,_0x3cf052);}while(!![]){try{const _0x29695b=-parseInt(_0x4163b4(0x316,0x317))/0x1+-parseInt(_0x4163b4(0x33e,0x35d))/0x2*(-parseInt(_0x3cf43d(0x240,0x239))/0x3)+parseInt(_0x3cf43d(0x275,0x286))/0x4*(parseInt(_0x3cf43d(0x28c,0x27c))/0x5)+parseInt(_0x4163b4(0x348,0x370))/0x6*(parseInt(_0x4163b4(0x34e,0x35b))/0x7)+parseInt(_0x3cf43d(0x2a2,0x289))/0x8+-parseInt(_0x4163b4(0x334,0x325))/0x9+-parseInt(_0x3cf43d(0x249,0x24b))/0xa*(-parseInt(_0x3cf43d(0x238,0x251))/0xb);if(_0x29695b===_0x468508)break;else _0x1ed57b['push'](_0x1ed57b['shift']());}catch(_0x18f4a1){_0x1ed57b['push'](_0x1ed57b['shift']());}}}(_0x97cd,0xc77e6));import{MemoryDatabase}from'../db/database.js';let _sharedDb=null,_sharedDbPath=null;export function getSharedDb(_0x14013e){if(_sharedDb&&_sharedDbPath===_0x14013e)return _sharedDb;if(_sharedDb)try{_sharedDb[_0x5e88c5(0x31c,0x2f5)]();}catch{}_sharedDb=new MemoryDatabase(_0x14013e);function _0x31686e(_0x2a28bd,_0x103d61){return _0x17c4(_0x103d61-0x35f,_0x2a28bd);}function _0x5e88c5(_0x1fa26b,_0x530e5a){return _0x17c4(_0x530e5a-0x15d,_0x1fa26b);}return _sharedDbPath=_0x14013e,_sharedDb[_0x31686e(0x549,0x528)](),_sharedDb;}export function closeSharedDb(){const _0x456f54={'MQbNC':_0x4e7675(0x4e5,0x4be),'AKQxX':_0xf5d5cb(0x9c,0xbb)};function _0x4e7675(_0x3f624f,_0x12fe27){return _0x17c4(_0x12fe27-0x33a,_0x3f624f);}function _0xf5d5cb(_0xb51377,_0x29e2d7){return _0x17c4(_0xb51377- -0x102,_0x29e2d7);}if(_sharedDb){if('UqAQm'===_0x456f54[_0x4e7675(0x514,0x507)]){try{if(_0x456f54[_0x4e7675(0x528,0x505)]!==_0x4e7675(0x4d0,0x4d8)){const _0x362595=_0x291063[_0xf5d5cb(0xa8,0x95)](/```[\s\S]*?```/g,'')['replace'](/`[^`]+`/g,''),_0x242177=_0x362595[_0xf5d5cb(0x77,0x9a)](/[\s,.!?;:()[\]{}"'<>]+/)[_0x4e7675(0x4e4,0x4c8)](_0x4a96c1=>_0x4a96c1['trim']())[_0x4e7675(0x4d0,0x4e5)](_0x28c470=>_0x28c470[_0xf5d5cb(0xa7,0x8c)]>0x1&&!_0x1a9adb[_0x4e7675(0x4ac,0x4bd)](_0x28c470[_0x4e7675(0x4ca,0x4f2)+'e']())&&!/^\d+$/['test'](_0x28c470)),_0x4224d6=[...new _0x5c352d(_0x242177)];return _0x4224d6[_0x4e7675(0x4d4,0x4b4)](0x0,0x8)[_0xf5d5cb(0xa1,0x7a)]('\x20');}else _sharedDb[_0x4e7675(0x4dd,0x4d2)]();}catch{}_sharedDb=null,_sharedDbPath=null;}else{try{_0x4e8529['close']();}catch{}_0x1a2878=null,_0x5eac23=null;}}}export function resetSharedDb(){_sharedDb=null,_sharedDbPath=null;}export function normalizeHookInput(_0xf4972a){function _0x191278(_0x45a37a,_0x1e4354){return _0x17c4(_0x1e4354- -0x262,_0x45a37a);}const _0xa5db20={'kJMnq':_0x191278(-0xcf,-0xe4),'ZuPaC':function(_0x4e0044,_0x2ab92b){return _0x4e0044(_0x2ab92b);}};function _0x52f12e(_0x54a564,_0x249102){return _0x17c4(_0x249102-0x3e1,_0x54a564);}return{'hookName':_0xf4972a[_0x191278(-0xb2,-0xd1)+_0x52f12e(0x596,0x586)]??_0xf4972a[_0x52f12e(0x55e,0x587)],'sessionId':_0xf4972a[_0x52f12e(0x558,0x56e)]??_0xf4972a[_0x191278(-0x85,-0xa1)],'projectPath':_0xf4972a[_0x191278(-0x8c,-0xb1)]??_0xf4972a[_0x52f12e(0x556,0x570)+'h'],'cwd':_0xf4972a[_0x191278(-0x9c,-0xb1)]??_0xf4972a[_0x191278(-0xc9,-0xd3)+'h'],'transcriptPath':_0xf4972a[_0x52f12e(0x5a7,0x597)+_0x52f12e(0x57c,0x560)]??_0xf4972a[_0x191278(-0xa7,-0xac)+_0x52f12e(0x571,0x55d)],'toolName':_0xf4972a[_0x52f12e(0x590,0x589)]??_0xf4972a[_0x52f12e(0x5b9,0x5a0)],'toolInput':_0xf4972a[_0x52f12e(0x55b,0x57b)]??_0xf4972a[_0x191278(-0xc1,-0xd6)]??{},'toolResult':typeof(_0xf4972a['tool_respo'+_0x52f12e(0x58f,0x580)]??_0xf4972a[_0x52f12e(0x556,0x575)])===_0xa5db20[_0x191278(-0xac,-0xb0)]?JSON['stringify'](_0xf4972a[_0x191278(-0xc1,-0xbe)+_0x191278(-0xd9,-0xc3)]??_0xf4972a[_0x191278(-0xaa,-0xce)]):_0xa5db20[_0x191278(-0xc8,-0xa2)](String,_0xf4972a['tool_respo'+_0x191278(-0x9d,-0xc3)]??_0xf4972a[_0x191278(-0xdf,-0xce)]??''),'capturedMemoryIds':_0xf4972a[_0x191278(-0x9e,-0xc6)+'moryIds']??[],'modifiedFiles':_0xf4972a[_0x52f12e(0x584,0x567)+_0x52f12e(0x56e,0x588)]??[],'userPrompt':_0xf4972a['user_promp'+'t']??_0xf4972a['userPrompt']??'','transcript':_0xf4972a['transcript']??'','_raw':_0xf4972a};}function _0x42fb82(_0x49843a,_0x3a4036){return _0x17c4(_0x3a4036- -0x1e1,_0x49843a);}function _0x17c4(_0x1fa573,_0x19f7e6){_0x1fa573=_0x1fa573-0x178;const _0x97cda1=_0x97cd();let _0x17c416=_0x97cda1[_0x1fa573];if(_0x17c4['KgHisk']===undefined){var _0x1555d6=function(_0xf49a08){const _0x2a58fd='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0xbab4b5='',_0x10b055='';for(let _0x4d3269=0x0,_0x4ed6b9,_0x4e71f2,_0x2add84=0x0;_0x4e71f2=_0xf49a08['charAt'](_0x2add84++);~_0x4e71f2&&(_0x4ed6b9=_0x4d3269%0x4?_0x4ed6b9*0x40+_0x4e71f2:_0x4e71f2,_0x4d3269++%0x4)?_0xbab4b5+=String['fromCharCode'](0xff&_0x4ed6b9>>(-0x2*_0x4d3269&0x6)):0x0){_0x4e71f2=_0x2a58fd['indexOf'](_0x4e71f2);}for(let _0x98f99e=0x0,_0x6edf43=_0xbab4b5['length'];_0x98f99e<_0x6edf43;_0x98f99e++){_0x10b055+='%'+('00'+_0xbab4b5['charCodeAt'](_0x98f99e)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x10b055);};_0x17c4['alYgDp']=_0x1555d6,_0x17c4['YzEUBf']={},_0x17c4['KgHisk']=!![];}const _0x80ac0e=_0x97cda1[0x0],_0x52d057=_0x1fa573+_0x80ac0e,_0x19e031=_0x17c4['YzEUBf'][_0x52d057];return!_0x19e031?(_0x17c416=_0x17c4['alYgDp'](_0x17c416),_0x17c4['YzEUBf'][_0x52d057]=_0x17c416):_0x17c416=_0x19e031,_0x17c416;}const STOP_WORDS=new Set(['the','a','an','is',_0x42fb82(-0x5d,-0x32),'was','were','be',_0x42fb82(-0x46,-0x44),_0x277479(0x62,0x49),'have','has','had','do',_0x277479(0x73,0x69),_0x42fb82(-0x5d,-0x4a),_0x42fb82(-0x38,-0x56),_0x277479(0x96,0x6f),_0x277479(0x5f,0x76),'should','may','might','must',_0x277479(0xa3,0x79),_0x277479(0x90,0x84),'to','of','in',_0x42fb82(0x4,-0x1a),'on','with','at','by',_0x42fb82(-0x47,-0x1f),'as','into',_0x277479(0x58,0x49),'during','before','after',_0x42fb82(-0x45,-0x1e),_0x277479(0x89,0x82),'or','nor',_0x42fb82(-0x51,-0x41),'so',_0x277479(0x94,0xb8),_0x42fb82(-0x67,-0x64),'either',_0x277479(0xa9,0xcb),_0x277479(0x78,0x63),'that',_0x277479(0x5e,0x7f),_0x42fb82(-0x2c,-0x2d),'it',_0x42fb82(-0x5e,-0x3f),'my',_0x42fb82(-0xe,-0x34),'his',_0x42fb82(-0x24,-0x40),_0x277479(0x9a,0xb0),_0x277479(0x65,0x4f),_0x42fb82(-0x75,-0x61),_0x42fb82(-0x39,-0x33),_0x277479(0x70,0x4c),'whom',_0x277479(0x9b,0xa0),'i','me','we','us',_0x277479(0x99,0x88),'he','she',_0x42fb82(-0x61,-0x58),_0x277479(0x92,0x87),'이','그','저','것','수','등','및','중','더','때','좀','해줘','해주세요',_0x42fb82(-0x43,-0x5a),_0x277479(0x76,0x6c),'해','하고','하는','하면']);function _0x277479(_0x47b1b2,_0x48c37c){return _0x17c4(_0x47b1b2- -0x123,_0x48c37c);}export function extractSearchKeywords(_0xa9dff3){function _0x1926ed(_0x19f5d4,_0xb6c3b6){return _0x42fb82(_0x19f5d4,_0xb6c3b6-0x586);}const _0x3ee964=_0xa9dff3['replace'](/```[\s\S]*?```/g,'')[_0x4feaa8(0x2c4,0x2e8)](/`[^`]+`/g,''),_0x5cec84=_0x3ee964[_0x1926ed(0x52e,0x51e)](/[\s,.!?;:()[\]{}"'<>]+/)[_0x4feaa8(0x2a8,0x2b7)](_0x257394=>_0x257394[_0x4feaa8(0x2af,0x2d8)]())[_0x1926ed(0x563,0x550)](_0x32f2c4=>_0x32f2c4[_0x1926ed(0x56c,0x54e)]>0x1&&!STOP_WORDS[_0x1926ed(0x505,0x528)](_0x32f2c4[_0x1926ed(0x54a,0x55d)+'e']())&&!/^\d+$/['test'](_0x32f2c4));function _0x4feaa8(_0x26bc73,_0x389e79){return _0x42fb82(_0x389e79,_0x26bc73-0x2fb);}const _0x46a3c9=[...new Set(_0x5cec84)];return _0x46a3c9['slice'](0x0,0x8)[_0x1926ed(0x51e,0x548)]('\x20');}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stop Hook
|
|
3
|
+
*
|
|
4
|
+
* Claude Code가 응답 생성을 완료하고 다음 프롬프트를 기다릴 때마다 발동합니다.
|
|
5
|
+
* SessionEnd가 자주 발동하지 않는 현실(2026-04-20 측정치 13%)을 보완하여
|
|
6
|
+
* injection effectiveness를 실시간으로 집계합니다.
|
|
7
|
+
*
|
|
8
|
+
* 제약:
|
|
9
|
+
* - 매 응답마다 실행되므로 지연 최소화 (목표 < 200ms)
|
|
10
|
+
* - 네트워크 호출 금지 (DB UPDATE만)
|
|
11
|
+
* - 1초 safety timeout
|
|
12
|
+
*/
|
|
13
|
+
interface StopContext {
|
|
14
|
+
sessionId?: string;
|
|
15
|
+
projectPath?: string;
|
|
16
|
+
cwd?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function handleStop(context: StopContext): Promise<void>;
|
|
19
|
+
export declare function main(): Promise<void>;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=stop.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x127207,_0x18c1d7){function _0x46c530(_0x478f03,_0x48241d){return _0x3927(_0x48241d-0x196,_0x478f03);}const _0x4fcfe5=_0x127207();function _0x11488e(_0x40369b,_0x5daf74){return _0x3927(_0x40369b-0x361,_0x5daf74);}while(!![]){try{const _0x25601d=-parseInt(_0x11488e(0x54a,0x544))/0x1*(-parseInt(_0x11488e(0x532,0x541))/0x2)+-parseInt(_0x11488e(0x537,0x527))/0x3*(parseInt(_0x11488e(0x53f,0x533))/0x4)+-parseInt(_0x11488e(0x53c,0x532))/0x5+-parseInt(_0x46c530(0x342,0x353))/0x6*(parseInt(_0x46c530(0x36c,0x35c))/0x7)+-parseInt(_0x46c530(0x34a,0x357))/0x8*(-parseInt(_0x46c530(0x37b,0x370))/0x9)+-parseInt(_0x46c530(0x351,0x363))/0xa*(-parseInt(_0x11488e(0x521,0x536))/0xb)+-parseInt(_0x11488e(0x535,0x532))/0xc*(-parseInt(_0x46c530(0x380,0x36d))/0xd);if(_0x25601d===_0x18c1d7)break;else _0x4fcfe5['push'](_0x4fcfe5['shift']());}catch(_0x6328){_0x4fcfe5['push'](_0x4fcfe5['shift']());}}}(_0x2d11,0xd088f));import{getSharedDb,closeSharedDb,normalizeHookInput}from'./shared.js';import{ConfigManager}from'../config/manager.js';import{createLogger}from'../utils/logger.js';function _0x3927(_0x5f1159,_0x3137ce){_0x5f1159=_0x5f1159-0x1bc;const _0x2d11dc=_0x2d11();let _0x392727=_0x2d11dc[_0x5f1159];if(_0x3927['oPvwBA']===undefined){var _0x2d1ca6=function(_0x350095){const _0x1a536f='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0xefd810='',_0x56ee5f='';for(let _0x17e3a8=0x0,_0x5502f3,_0x315ab6,_0x10c8a9=0x0;_0x315ab6=_0x350095['charAt'](_0x10c8a9++);~_0x315ab6&&(_0x5502f3=_0x17e3a8%0x4?_0x5502f3*0x40+_0x315ab6:_0x315ab6,_0x17e3a8++%0x4)?_0xefd810+=String['fromCharCode'](0xff&_0x5502f3>>(-0x2*_0x17e3a8&0x6)):0x0){_0x315ab6=_0x1a536f['indexOf'](_0x315ab6);}for(let _0x2e04c9=0x0,_0x11d53d=_0xefd810['length'];_0x2e04c9<_0x11d53d;_0x2e04c9++){_0x56ee5f+='%'+('00'+_0xefd810['charCodeAt'](_0x2e04c9)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x56ee5f);};_0x3927['JfiPAt']=_0x2d1ca6,_0x3927['TmNMNN']={},_0x3927['oPvwBA']=!![];}const _0x1f0020=_0x2d11dc[0x0],_0x37b784=_0x5f1159+_0x1f0020,_0xeed39b=_0x3927['TmNMNN'][_0x37b784];return!_0xeed39b?(_0x392727=_0x3927['JfiPAt'](_0x392727),_0x3927['TmNMNN'][_0x37b784]=_0x392727):_0x392727=_0xeed39b,_0x392727;}function _0x2786a0(_0x44c3c0,_0x28aaa4){return _0x3927(_0x28aaa4-0x8f,_0x44c3c0);}import{flushInjectionEffectiveness}from'../lifecycle/injection-flush.js';function _0x2d11(){const _0x159d0c=['BML4Dgm','veH1wem','C2vZC2LVBKLK','Cgf0Aa','zw5KC1DPDgG','wuPTvMu','rfnZseG','ndfmsfbSsxm','Bg9Nz2LUzW','mJrdANPbueK','swqSihnRAxbWAq','zMX1C2GGkhn0BW','mZG1nJi3EwfiB3LI','mJy0Afnktgjq','Aw5MBW','Dw5Yzwy','D3jPDgu','yxjNDG','ote1mJe1rMLVywPT','zxjYB3i','v3PSs2m','tvvJEKO','sw5Qzwn0Aw9Uia','r2DlCg8','q0fVsfu','mtKWyuHZB2HY','Dg9tDhjPBMC','ChvZAa','CgfYC2u','mZaXndjeugDRv00','C3rKB3v0','C3jcAuq','ntq3ntzqvhLwtM8','CevouMq','oxfgBuj6CG','mJq4m3jsCgTUwG','DxbKyxrLza','zMfPBgvK','mZe3mZq5t1ryzvDT','mJeZnJeZmfzTwKL3zq','sNfYtMm','C3rKAw4','mJaXotCWmgvnqvL5BW','zxHPDa','y29Uy2f0','qu5SvgG'];_0x2d11=function(){return _0x159d0c;};return _0x2d11();}export async function handleStop(_0x129417){function _0x53342e(_0x2be352,_0x746c52){return _0x3927(_0x746c52-0x2a5,_0x2be352);}function _0x320ead(_0x25e527,_0x2eed71){return _0x3927(_0x25e527- -0x33,_0x2eed71);}const _0x35ac10={'Uaznw':'No\x20session'+_0x320ead(0x18b,0x176)+'ng','THuXC':function(_0x5dc03b,_0x378a1b){return _0x5dc03b(_0x378a1b);},'GgKpo':function(_0x4b61c7,_0x4ad4f5,_0x4d687b,_0x5effa1){return _0x4b61c7(_0x4ad4f5,_0x4d687b,_0x5effa1);},'juuMz':function(_0x58b57b,_0x2301ff){return _0x58b57b>_0x2301ff;},'MUczJ':_0x53342e(0x485,0x48c),'ZGyJH':function(_0x726164,_0x2210a8){return _0x726164!==_0x2210a8;},'WLbUA':_0x53342e(0x473,0x486),'xajnY':'dZTIW','nixtc':function(_0x107cc1,_0x2f9ae8){return _0x107cc1>_0x2f9ae8;},'WInBh':'Injection\x20'+_0x53342e(0x471,0x464)+'p)','pENRd':'Stop\x20hook\x20'+_0x53342e(0x47e,0x47e)},_0x581914=new ConfigManager()['load'](),_0x532690=createLogger('Stop',_0x581914[_0x320ead(0x189,0x172)]);try{if(_0x35ac10[_0x53342e(0x45a,0x46e)]!==_0x53342e(0x479,0x48c)){if(!_0x5bb3ca[_0x53342e(0x476,0x489)]){_0x69e7fa[_0x320ead(0x18f,0x1a4)](_0x35ac10['Uaznw']);return;}const _0x50bf9d=_0x35ac10[_0x320ead(0x1b0,0x19c)](_0x4fe026,_0x138031['db'][_0x53342e(0x474,0x48a)]),_0x3108d3=_0x35ac10[_0x53342e(0x469,0x470)](_0x4a9e39,_0x50bf9d,_0x1263cd[_0x320ead(0x1b1,0x1a1)],_0x209ef9);_0x35ac10['juuMz'](_0x3108d3[_0x320ead(0x1a5,0x1b9)],0x0)&&_0x52c190['info'](_0x53342e(0x45b,0x46f)+_0x320ead(0x18c,0x18b)+'p)',{'updated':_0x3108d3['updated']});}else{if(!_0x129417[_0x320ead(0x1b1,0x19e)]){if(_0x35ac10['ZGyJH'](_0x35ac10['WLbUA'],_0x35ac10['xajnY'])){_0x532690[_0x320ead(0x18f,0x19b)](_0x35ac10['Uaznw']);return;}else _0x5dd1b7(),_0x42a8a2[_0x53342e(0x496,0x484)](0x0);}const _0x4452a8=_0x35ac10[_0x320ead(0x1b0,0x1a6)](getSharedDb,_0x581914['db'][_0x320ead(0x1b2,0x1bc)]),_0x2adebb=flushInjectionEffectiveness(_0x4452a8,_0x129417[_0x53342e(0x481,0x489)],_0x532690);_0x35ac10[_0x53342e(0x48e,0x487)](_0x2adebb[_0x53342e(0x486,0x47d)],0x0)&&_0x532690[_0x53342e(0x47a,0x467)](_0x35ac10['WInBh'],{'updated':_0x2adebb['updated']});}}catch(_0x3c5b31){_0x532690[_0x53342e(0x463,0x46c)](_0x35ac10[_0x53342e(0x470,0x47a)],_0x3c5b31 instanceof Error?_0x3c5b31:new Error(String(_0x3c5b31)));}finally{_0x532690['flush']();}}function _0x15e0f1(_0x3686b9,_0x4d0f3f){return _0x3927(_0x4d0f3f- -0x3a6,_0x3686b9);}const HOOK_TIMEOUT_MS=0x3e8;export async function main(){function _0x2a16d5(_0x58b811,_0x2f2b40){return _0x3927(_0x2f2b40- -0x3c0,_0x58b811);}const _0x1dde96={'CAoHU':function(_0x581a54,_0x5d612b){return _0x581a54!==_0x5d612b;},'DSsHH':_0xaa8a4e(0x3e2,0x3e0),'WzlKc':function(_0x3d5dff){return _0x3d5dff();},'srBiD':function(_0x497974,_0x569f20){return _0x497974(_0x569f20);},'YmBtl':function(_0xf23443){return _0xf23443();}},_0x528941=[];for await(const _0x22b6b9 of process[_0xaa8a4e(0x3e8,0x3e1)]){_0x528941[_0xaa8a4e(0x3d5,0x3d3)](_0x22b6b9);}function _0xaa8a4e(_0x124dd9,_0x296c9c){return _0x3927(_0x296c9c-0x204,_0x124dd9);}const _0x43dd03=Buffer[_0xaa8a4e(0x3d5,0x3e4)](_0x528941)[_0x2a16d5(-0x1e8,-0x1f2)]('utf-8')['trim']();process[_0xaa8a4e(0x3c8,0x3d6)][_0xaa8a4e(0x3b4,0x3c8)]('{\x22ok\x22:true'+'}\x0a');!_0x43dd03&&(_0x1dde96['WzlKc'](closeSharedDb),process[_0x2a16d5(-0x1d5,-0x1e1)](0x0));const _0x4ab5b6=setTimeout(()=>{function _0x140e34(_0xe32816,_0x128b56){return _0xaa8a4e(_0xe32816,_0x128b56-0x146);}function _0x26b6fb(_0x54e6f1,_0x5dd69b){return _0xaa8a4e(_0x5dd69b,_0x54e6f1- -0x25a);}_0x1dde96[_0x140e34(0x503,0x516)](_0x1dde96[_0x140e34(0x52f,0x532)],_0x140e34(0x52d,0x526))?_0x35fc5c['flush']():(_0x1dde96[_0x140e34(0x510,0x512)](closeSharedDb),process[_0x26b6fb(0x189,0x198)](0x0));},HOOK_TIMEOUT_MS);_0x4ab5b6[_0x2a16d5(-0x1f1,-0x1fd)]();try{const _0x28255d=JSON[_0xaa8a4e(0x3d9,0x3d4)](_0x43dd03),_0x8ca6a2=normalizeHookInput(_0x28255d);await _0x1dde96[_0xaa8a4e(0x3ee,0x3d7)](handleStop,_0x8ca6a2);}catch{}finally{_0x1dde96['YmBtl'](closeSharedDb),process[_0x2a16d5(-0x1de,-0x1e1)](0x0);}}const isMainModule=process['argv'][0x1]?.[_0x2786a0(0x27b,0x275)]('stop.js')||process[_0x2786a0(0x242,0x254)][0x1]?.['endsWith']('stop.ts');isMainModule&&main();
|
|
@@ -1,316 +1 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* UserPromptSubmit Hook
|
|
3
|
-
*
|
|
4
|
-
* 사용자가 프롬프트를 제출할 때마다 실행됩니다.
|
|
5
|
-
* 프롬프트 기반 실시간 메모리 검색 + 주입으로
|
|
6
|
-
* 세션 중 축적된 메모리를 즉시 활용합니다.
|
|
7
|
-
*
|
|
8
|
-
* 성능 타겟: p50 < 30ms, p99 < 100ms
|
|
9
|
-
*/
|
|
10
|
-
import { getSharedDb, closeSharedDb, normalizeHookInput, extractSearchKeywords } from './shared.js';
|
|
11
|
-
import { ConfigManager } from '../config/manager.js';
|
|
12
|
-
import { createLogger } from '../utils/logger.js';
|
|
13
|
-
import { hasEmotionalContent } from '../extraction/emotion-filter.js';
|
|
14
|
-
import { AdaptiveRouter } from '../search/adaptive-router.js';
|
|
15
|
-
import { HybridRanker } from '../search/ranker.js';
|
|
16
|
-
class QueryCache {
|
|
17
|
-
cache = new Map();
|
|
18
|
-
maxSize;
|
|
19
|
-
ttlMs;
|
|
20
|
-
constructor(maxSize, ttlSeconds) {
|
|
21
|
-
this.maxSize = maxSize;
|
|
22
|
-
this.ttlMs = ttlSeconds * 1000;
|
|
23
|
-
}
|
|
24
|
-
get(key) {
|
|
25
|
-
const entry = this.cache.get(key);
|
|
26
|
-
if (!entry)
|
|
27
|
-
return null;
|
|
28
|
-
if (Date.now() - entry.timestamp > this.ttlMs) {
|
|
29
|
-
this.cache.delete(key);
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
// LRU: 재삽입으로 순서 갱신
|
|
33
|
-
this.cache.delete(key);
|
|
34
|
-
this.cache.set(key, entry);
|
|
35
|
-
return entry.result;
|
|
36
|
-
}
|
|
37
|
-
set(key, result) {
|
|
38
|
-
// 용량 초과 시 가장 오래된 항목 제거
|
|
39
|
-
if (this.cache.size >= this.maxSize) {
|
|
40
|
-
const oldest = this.cache.keys().next().value;
|
|
41
|
-
if (oldest !== undefined) {
|
|
42
|
-
this.cache.delete(oldest);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
this.cache.set(key, { result, timestamp: Date.now() });
|
|
46
|
-
}
|
|
47
|
-
clear() {
|
|
48
|
-
this.cache.clear();
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
// 프로세스 내 싱글톤 캐시 (Hook 프로세스 수명 = 1회 실행이지만, 테스트에서 재사용)
|
|
52
|
-
let _queryCache = null;
|
|
53
|
-
function getQueryCache(config) {
|
|
54
|
-
if (!_queryCache) {
|
|
55
|
-
_queryCache = new QueryCache(config.cacheSize, config.cacheTTLSeconds);
|
|
56
|
-
}
|
|
57
|
-
return _queryCache;
|
|
58
|
-
}
|
|
59
|
-
/** 테스트용 캐시 리셋 */
|
|
60
|
-
export function resetQueryCache() {
|
|
61
|
-
_queryCache = null;
|
|
62
|
-
}
|
|
63
|
-
// ============================================================
|
|
64
|
-
// Memory Formatting
|
|
65
|
-
// ============================================================
|
|
66
|
-
/** 카테고리 축약 레이블 */
|
|
67
|
-
const CATEGORY_SHORT = {
|
|
68
|
-
error_solution: 'error_solution',
|
|
69
|
-
code_pattern: 'code_pattern',
|
|
70
|
-
decision: 'decision',
|
|
71
|
-
context: 'context',
|
|
72
|
-
convention: 'convention',
|
|
73
|
-
skill: 'skill',
|
|
74
|
-
learning: 'learning',
|
|
75
|
-
project_knowledge: 'project_knowledge',
|
|
76
|
-
};
|
|
77
|
-
/**
|
|
78
|
-
* 메모리를 compact 형식으로 포맷
|
|
79
|
-
* 토큰 예산 내에서 최대한 많은 메모리 포함
|
|
80
|
-
*/
|
|
81
|
-
function formatRealtimeOutput(memories, maxTokens) {
|
|
82
|
-
if (memories.length === 0)
|
|
83
|
-
return '';
|
|
84
|
-
const lines = ['<!-- A2A Realtime Context -->'];
|
|
85
|
-
let estimatedTokens = 10; // 헤더/푸터 오버헤드
|
|
86
|
-
for (const { memory } of memories) {
|
|
87
|
-
const cat = CATEGORY_SHORT[memory.category] || memory.category;
|
|
88
|
-
// 한 줄 요약 (최대 200자)
|
|
89
|
-
const content = memory.content.split('\n').filter(l => l.trim()).join(' ').slice(0, 200);
|
|
90
|
-
const line = `- [${cat}] ${content}`;
|
|
91
|
-
// 토큰 추정: ~4 chars per token
|
|
92
|
-
const lineTokens = Math.ceil(line.length / 4);
|
|
93
|
-
if (estimatedTokens + lineTokens > maxTokens)
|
|
94
|
-
break;
|
|
95
|
-
lines.push(line);
|
|
96
|
-
estimatedTokens += lineTokens;
|
|
97
|
-
}
|
|
98
|
-
if (lines.length <= 1)
|
|
99
|
-
return ''; // 헤더만 있으면 빈 문자열
|
|
100
|
-
lines.push('');
|
|
101
|
-
lines.push('\u{1F4A1} `a2a-memory search <query>` for details.');
|
|
102
|
-
lines.push('<!-- /A2A Realtime Context -->');
|
|
103
|
-
return lines.join('\n');
|
|
104
|
-
}
|
|
105
|
-
// ============================================================
|
|
106
|
-
// Core Logic
|
|
107
|
-
// ============================================================
|
|
108
|
-
export async function handleUserPromptSubmit(context) {
|
|
109
|
-
const config = new ConfigManager().load();
|
|
110
|
-
const logger = createLogger('UserPromptSubmit', config.logging);
|
|
111
|
-
const startTime = performance.now();
|
|
112
|
-
const realtimeConfig = config.realtimeInject ?? {
|
|
113
|
-
enabled: true,
|
|
114
|
-
maxMemories: 3,
|
|
115
|
-
maxTokens: 1000,
|
|
116
|
-
cacheSize: 20,
|
|
117
|
-
cacheTTLSeconds: 60,
|
|
118
|
-
timeoutMs: 100,
|
|
119
|
-
};
|
|
120
|
-
if (!realtimeConfig.enabled) {
|
|
121
|
-
logger.info('Realtime inject disabled');
|
|
122
|
-
logger.flush();
|
|
123
|
-
return '';
|
|
124
|
-
}
|
|
125
|
-
// 짧은 프롬프트는 스킵 (인사, 단답 등)
|
|
126
|
-
const prompt = context.userPrompt?.trim() || '';
|
|
127
|
-
if (prompt.length < 5) {
|
|
128
|
-
logger.debug('Prompt too short, skipping');
|
|
129
|
-
logger.flush();
|
|
130
|
-
return '';
|
|
131
|
-
}
|
|
132
|
-
// 키워드 추출
|
|
133
|
-
const rawKeywords = extractSearchKeywords(prompt);
|
|
134
|
-
if (!rawKeywords || rawKeywords.trim().length < 2) {
|
|
135
|
-
logger.debug('No meaningful keywords extracted');
|
|
136
|
-
logger.flush();
|
|
137
|
-
return '';
|
|
138
|
-
}
|
|
139
|
-
// FTS5 OR 쿼리로 변환 (implicit AND 대신)
|
|
140
|
-
// "SQLite bind error" → "SQLite OR bind OR error"
|
|
141
|
-
const keywords = rawKeywords.split(/\s+/).filter(k => k.length > 1).join(' OR ');
|
|
142
|
-
// AdaptiveRouter로 쿼리 복잡도 분류 (<1ms, 규칙 기반)
|
|
143
|
-
const router = new AdaptiveRouter();
|
|
144
|
-
const routing = router.classify(prompt);
|
|
145
|
-
// 캐시 확인 (routing complexity 포함)
|
|
146
|
-
const cache = getQueryCache(realtimeConfig);
|
|
147
|
-
const cacheKey = `${routing.complexity}:${keywords}`;
|
|
148
|
-
const cached = cache.get(cacheKey);
|
|
149
|
-
if (cached !== null) {
|
|
150
|
-
logger.info('Cache hit', { keywords, durationMs: Math.round(performance.now() - startTime) });
|
|
151
|
-
logger.flush();
|
|
152
|
-
return cached;
|
|
153
|
-
}
|
|
154
|
-
try {
|
|
155
|
-
const db = getSharedDb(config.db.path);
|
|
156
|
-
const limit = realtimeConfig.maxMemories;
|
|
157
|
-
// FTS 전용 빠른 경로 (임베딩 계산 없이)
|
|
158
|
-
let ftsResults = [];
|
|
159
|
-
try {
|
|
160
|
-
ftsResults = db.searchByFTS(keywords, limit * 2); // 오버페치 → 필터링
|
|
161
|
-
}
|
|
162
|
-
catch {
|
|
163
|
-
// FTS 쿼리 실패 시 (특수문자 등)
|
|
164
|
-
ftsResults = [];
|
|
165
|
-
}
|
|
166
|
-
// semantic/complex 쿼리 + 임베딩 활성 시 벡터 검색 추가 (p50 < 30ms 유지 우선)
|
|
167
|
-
let results;
|
|
168
|
-
if (routing.useVector && config.embedding?.enabled) {
|
|
169
|
-
try {
|
|
170
|
-
const { createEmbeddingProvider } = await import('../embedding/index.js');
|
|
171
|
-
const provider = createEmbeddingProvider(config.embedding, config.llm);
|
|
172
|
-
const queryEmbedding = await Promise.resolve(provider.embed(prompt));
|
|
173
|
-
const vectorResults = db.searchByVector(queryEmbedding, limit * 2);
|
|
174
|
-
// HybridRanker로 FTS + Vector 결합 (Reranker는 성능 제약으로 사용 안 함)
|
|
175
|
-
const ranker = new HybridRanker({ categoryBoost: true, tierBoost: true });
|
|
176
|
-
const ranked = ranker.rank(ftsResults, vectorResults);
|
|
177
|
-
results = ranked.slice(0, limit * 2).map(r => ({
|
|
178
|
-
memory: r.memory,
|
|
179
|
-
score: r.score,
|
|
180
|
-
matchType: 'hybrid',
|
|
181
|
-
}));
|
|
182
|
-
logger.debug('Hybrid search in UserPromptSubmit', { count: results.length });
|
|
183
|
-
}
|
|
184
|
-
catch {
|
|
185
|
-
// 임베딩 실패 시 FTS 결과로 폴백
|
|
186
|
-
results = ftsResults;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
else {
|
|
190
|
-
results = ftsResults;
|
|
191
|
-
}
|
|
192
|
-
// 프로젝트 경로 필터링 (같은 프로젝트 우선)
|
|
193
|
-
const projectResults = results.filter(r => r.memory.projectPath === context.projectPath);
|
|
194
|
-
const otherResults = results.filter(r => r.memory.projectPath !== context.projectPath);
|
|
195
|
-
// 같은 프로젝트 우선, 부족하면 타 프로젝트 보충
|
|
196
|
-
const rawCombined = [...projectResults, ...otherResults];
|
|
197
|
-
// Parent 중복 제거: 같은 Parent의 Children은 최고 점수 1개만 유지 (2-pass)
|
|
198
|
-
const bestByParent = new Map();
|
|
199
|
-
const deduped = [];
|
|
200
|
-
for (const item of rawCombined) {
|
|
201
|
-
if (!item.memory.parentId) {
|
|
202
|
-
deduped.push(item);
|
|
203
|
-
}
|
|
204
|
-
else {
|
|
205
|
-
const existing = bestByParent.get(item.memory.parentId);
|
|
206
|
-
if (!existing || item.score > existing.score) {
|
|
207
|
-
bestByParent.set(item.memory.parentId, item);
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
deduped.push(...bestByParent.values());
|
|
212
|
-
// 점수 내림차순 재정렬
|
|
213
|
-
deduped.sort((a, b) => b.score - a.score);
|
|
214
|
-
const combined = deduped.slice(0, limit);
|
|
215
|
-
if (combined.length === 0) {
|
|
216
|
-
const output = '';
|
|
217
|
-
cache.set(cacheKey, output);
|
|
218
|
-
logger.info('No results', { keywords, durationMs: Math.round(performance.now() - startTime) });
|
|
219
|
-
logger.flush();
|
|
220
|
-
return output;
|
|
221
|
-
}
|
|
222
|
-
// 접근 추적
|
|
223
|
-
for (const { memory } of combined) {
|
|
224
|
-
try {
|
|
225
|
-
db.recordAccess(memory.id);
|
|
226
|
-
}
|
|
227
|
-
catch {
|
|
228
|
-
// 접근 추적 실패 무시
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
const output = formatRealtimeOutput(combined, realtimeConfig.maxTokens);
|
|
232
|
-
cache.set(cacheKey, output);
|
|
233
|
-
// 주입 효과 기록 (fire-and-forget, < 5ms)
|
|
234
|
-
if (combined.length > 0) {
|
|
235
|
-
try {
|
|
236
|
-
const keywords = combined.flatMap(({ memory }) => memory.content.toLowerCase().split(/\s+/).filter(w => w.length > 3).slice(0, 5));
|
|
237
|
-
db.recordInjection({
|
|
238
|
-
sessionId: context.sessionId,
|
|
239
|
-
hookType: 'user_prompt_submit',
|
|
240
|
-
injectedMemoryIds: combined.map(({ memory }) => memory.id),
|
|
241
|
-
injectedKeywords: [...new Set(keywords)].slice(0, 20),
|
|
242
|
-
totalInjected: combined.length,
|
|
243
|
-
});
|
|
244
|
-
}
|
|
245
|
-
catch {
|
|
246
|
-
// 효과 기록 실패는 비치명적
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
// 감정 프롬프트 버퍼링 (비차단, 네트워크 없음)
|
|
250
|
-
if (config.emotionTracking?.enabled && hasEmotionalContent(prompt)) {
|
|
251
|
-
try {
|
|
252
|
-
db.bufferEmotionMessage(prompt.slice(0, 500));
|
|
253
|
-
}
|
|
254
|
-
catch {
|
|
255
|
-
// 버퍼링 실패는 비치명적
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
logger.info('Hook completed', {
|
|
259
|
-
keywords,
|
|
260
|
-
count: combined.length,
|
|
261
|
-
durationMs: Math.round(performance.now() - startTime),
|
|
262
|
-
});
|
|
263
|
-
logger.flush();
|
|
264
|
-
return output;
|
|
265
|
-
}
|
|
266
|
-
catch (err) {
|
|
267
|
-
logger.error('Search failed', err instanceof Error ? err : new Error(String(err)), { keywords });
|
|
268
|
-
logger.flush();
|
|
269
|
-
return '';
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
// ============================================================
|
|
273
|
-
// CLI Entrypoint
|
|
274
|
-
// ============================================================
|
|
275
|
-
/** 전체 Hook 안전 타임아웃 (ms) */
|
|
276
|
-
const HOOK_TIMEOUT_MS = 5_000; // UserPromptSubmit은 더 짧은 타임아웃
|
|
277
|
-
export async function main() {
|
|
278
|
-
const chunks = [];
|
|
279
|
-
for await (const chunk of process.stdin) {
|
|
280
|
-
chunks.push(chunk);
|
|
281
|
-
}
|
|
282
|
-
const input = Buffer.concat(chunks).toString('utf-8').trim();
|
|
283
|
-
if (!input) {
|
|
284
|
-
closeSharedDb();
|
|
285
|
-
process.exit(0);
|
|
286
|
-
}
|
|
287
|
-
// 안전 타임아웃
|
|
288
|
-
const safetyTimer = setTimeout(() => {
|
|
289
|
-
console.error(`[a2a] UserPromptSubmit safety timeout (${HOOK_TIMEOUT_MS}ms)`);
|
|
290
|
-
closeSharedDb();
|
|
291
|
-
process.exit(0);
|
|
292
|
-
}, HOOK_TIMEOUT_MS);
|
|
293
|
-
safetyTimer.unref();
|
|
294
|
-
try {
|
|
295
|
-
const raw = JSON.parse(input);
|
|
296
|
-
const context = normalizeHookInput(raw);
|
|
297
|
-
const output = await handleUserPromptSubmit(context);
|
|
298
|
-
if (output) {
|
|
299
|
-
process.stdout.write(output);
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
catch (err) {
|
|
303
|
-
console.error('[a2a] UserPromptSubmit error:', err instanceof Error ? err.message : err);
|
|
304
|
-
}
|
|
305
|
-
finally {
|
|
306
|
-
closeSharedDb();
|
|
307
|
-
process.exit(0);
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
// 직접 실행 시에만 main() 호출
|
|
311
|
-
const isMainModule = process.argv[1]?.endsWith('user-prompt-submit.js') ||
|
|
312
|
-
process.argv[1]?.endsWith('user-prompt-submit.ts');
|
|
313
|
-
if (isMainModule) {
|
|
314
|
-
main();
|
|
315
|
-
}
|
|
316
|
-
//# sourceMappingURL=user-prompt-submit.js.map
|
|
1
|
+
(function(_0xd93a3e,_0x5019c8){function _0x380626(_0x381912,_0x32bf65){return _0x43d9(_0x381912-0x34b,_0x32bf65);}function _0x37dac5(_0x1b31c4,_0x2ec125){return _0x43d9(_0x1b31c4- -0x350,_0x2ec125);}const _0x17ab51=_0xd93a3e();while(!![]){try{const _0x39d102=parseInt(_0x380626(0x3fa,0x452))/0x1*(parseInt(_0x37dac5(-0x2c8,-0x295))/0x2)+parseInt(_0x37dac5(-0x242,-0x24f))/0x3+-parseInt(_0x380626(0x3d6,0x407))/0x4*(parseInt(_0x380626(0x40b,0x415))/0x5)+-parseInt(_0x380626(0x45f,0x4b3))/0x6*(-parseInt(_0x37dac5(-0x284,-0x296))/0x7)+-parseInt(_0x380626(0x433,0x410))/0x8+-parseInt(_0x380626(0x3e3,0x3be))/0x9+parseInt(_0x37dac5(-0x2b6,-0x307))/0xa;if(_0x39d102===_0x5019c8)break;else _0x17ab51['push'](_0x17ab51['shift']());}catch(_0x1e08d4){_0x17ab51['push'](_0x17ab51['shift']());}}}(_0x2017,0x32a60));import{getSharedDb,closeSharedDb,normalizeHookInput,extractSearchKeywords}from'./shared.js';import{ConfigManager}from'../config/manager.js';import{createLogger}from'../utils/logger.js';import{hasEmotionalContent}from'../extraction/emotion-filter.js';import{AdaptiveRouter}from'../search/adaptive-router.js';import{HybridRanker}from'../search/ranker.js';class QueryCache{[_0x11f226(-0x2f8,-0x2b5)]=new Map();[_0x11f226(-0x331,-0x2e1)];[_0x11f226(-0x304,-0x315)];constructor(_0x1d6176,_0x3269d5){function _0x3dd41c(_0x551fed,_0x368949){return _0x11f226(_0x368949-0x363,_0x551fed);}function _0x1b67cc(_0x19d9ac,_0x4e06bb){return _0x11f226(_0x4e06bb-0x3c6,_0x19d9ac);}this[_0x3dd41c(0x3b,0x32)]=_0x1d6176,this[_0x3dd41c(0x15,0x5f)]=_0x3269d5*0x3e8;}[_0x3ed9f7(0x30e,0x31e)](_0x3a7d0a){const _0x5b61de={'TQlet':function(_0x4220dd,_0xb72720){return _0x4220dd>_0xb72720;}},_0x52dd09=this['cache'][_0x5d867a(0x158,0x1ad)](_0x3a7d0a);if(!_0x52dd09)return null;if(_0x5b61de[_0x239a87(0x2e0,0x32f)](Date[_0x239a87(0x348,0x33a)]()-_0x52dd09[_0x5d867a(0x112,0x145)],this[_0x239a87(0x3d0,0x379)]))return this[_0x5d867a(0x159,0x135)]['delete'](_0x3a7d0a),null;function _0x5d867a(_0x3f3831,_0x13b267){return _0x11f226(_0x3f3831-0x451,_0x13b267);}this[_0x239a87(0x376,0x385)][_0x239a87(0x34d,0x38a)](_0x3a7d0a),this['cache']['set'](_0x3a7d0a,_0x52dd09);function _0x239a87(_0x2c5938,_0x2e3a8a){return _0x11f226(_0x2e3a8a-0x67d,_0x2c5938);}return _0x52dd09[_0x239a87(0x32c,0x346)];}['set'](_0x3d6d82,_0x2af868){function _0x518374(_0x5a6d43,_0x1a6ad8){return _0x11f226(_0x1a6ad8-0x1a5,_0x5a6d43);}function _0x5d8536(_0x3bf12f,_0x393811){return _0x11f226(_0x3bf12f-0x669,_0x393811);}const _0x54e104={'hbwNG':function(_0x3d4073,_0x3af67c){return _0x3d4073>=_0x3af67c;}};if(_0x54e104[_0x5d8536(0x382,0x3cc)](this[_0x5d8536(0x371,0x3ba)][_0x5d8536(0x390,0x3a4)],this[_0x518374(-0x18f,-0x18c)])){const _0x49c4e0=this[_0x518374(-0x178,-0x153)][_0x5d8536(0x39d,0x3e9)]()[_0x518374(-0x1cc,-0x1b8)]()[_0x5d8536(0x32f,0x372)];_0x49c4e0!==undefined&&this['cache']['delete'](_0x49c4e0);}this['cache'][_0x518374(-0x181,-0x17e)](_0x3d6d82,{'result':_0x2af868,'timestamp':Date[_0x518374(-0x18c,-0x19e)]()});}['clear'](){function _0x7ddb63(_0x4cff6f,_0x1d5f3c){return _0x3ed9f7(_0x4cff6f- -0x21,_0x1d5f3c);}function _0x1d0086(_0xc7c097,_0x43b5cd){return _0x3ed9f7(_0x43b5cd- -0x1f5,_0xc7c097);}this[_0x7ddb63(0x2ee,0x2ea)][_0x1d0086(0x141,0x157)]();}}function _0x43d9(_0x1655ff,_0x13c25b){_0x1655ff=_0x1655ff-0x72;const _0x201723=_0x2017();let _0x43d9f4=_0x201723[_0x1655ff];if(_0x43d9['aIcjpA']===undefined){var _0xb2ae56=function(_0x41d7a2){const _0xeccf82='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x16342d='',_0x5e3f01='';for(let _0x5acf79=0x0,_0x27c6b1,_0x5b8539,_0x2b42c8=0x0;_0x5b8539=_0x41d7a2['charAt'](_0x2b42c8++);~_0x5b8539&&(_0x27c6b1=_0x5acf79%0x4?_0x27c6b1*0x40+_0x5b8539:_0x5b8539,_0x5acf79++%0x4)?_0x16342d+=String['fromCharCode'](0xff&_0x27c6b1>>(-0x2*_0x5acf79&0x6)):0x0){_0x5b8539=_0xeccf82['indexOf'](_0x5b8539);}for(let _0x359f1f=0x0,_0x55ad1d=_0x16342d['length'];_0x359f1f<_0x55ad1d;_0x359f1f++){_0x5e3f01+='%'+('00'+_0x16342d['charCodeAt'](_0x359f1f)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x5e3f01);};_0x43d9['FUYDAe']=_0xb2ae56,_0x43d9['UyfGQE']={},_0x43d9['aIcjpA']=!![];}const _0x3c792a=_0x201723[0x0],_0x4d6b27=_0x1655ff+_0x3c792a,_0x52f71b=_0x43d9['UyfGQE'][_0x4d6b27];return!_0x52f71b?(_0x43d9f4=_0x43d9['FUYDAe'](_0x43d9f4),_0x43d9['UyfGQE'][_0x4d6b27]=_0x43d9f4):_0x43d9f4=_0x52f71b,_0x43d9f4;}let _queryCache=null;function getQueryCache(_0x2cf5cf){function _0x2f7b46(_0x485236,_0x326d74){return _0x3ed9f7(_0x485236- -0xed,_0x326d74);}const _0x44ff62={'JJdfG':function(_0x36a1cf){return _0x36a1cf();},'WBxLH':function(_0x101237,_0x20ea26){return _0x101237===_0x20ea26;},'BmBws':'WvurD'};function _0x2cd6c7(_0x1174f5,_0x380894){return _0x3ed9f7(_0x380894- -0x41d,_0x1174f5);}return!_queryCache&&(_0x44ff62['WBxLH'](_0x44ff62[_0x2cd6c7(-0x155,-0x15f)],_0x44ff62[_0x2cd6c7(-0x1a8,-0x15f)])?_queryCache=new QueryCache(_0x2cf5cf[_0x2cd6c7(-0xcb,-0xd0)],_0x2cf5cf[_0x2f7b46(0x1f9,0x22a)+_0x2f7b46(0x1fc,0x1aa)]):(_0x44ff62['JJdfG'](_0x18bc19),_0x2abbc7[_0x2cd6c7(-0x119,-0x153)](0x0))),_queryCache;}export function resetQueryCache(){_queryCache=null;}const CATEGORY_SHORT={'error_solution':_0x11f226(-0x2b3,-0x2b4)+_0x3ed9f7(0x328,0x2fa),'code_pattern':_0x11f226(-0x2ce,-0x2d5)+'rn','decision':_0x11f226(-0x328,-0x320),'context':_0x3ed9f7(0x352,0x387),'convention':'convention','skill':_0x3ed9f7(0x2bd,0x308),'rule':_0x11f226(-0x359,-0x36b),'learning':_0x3ed9f7(0x2d1,0x2c7),'project_knowledge':'project_kn'+_0x3ed9f7(0x2f7,0x300)};function formatRealtimeOutput(_0x58b0b1,_0x5031c3){const _0x1419ee={'zENMZ':_0x107a0b(0x31a,0x34c)+'ealtime\x20Co'+_0x409ecd(0x28f,0x272),'fyJLH':function(_0x474e78,_0x473883){return _0x474e78+_0x473883;},'GUJxr':function(_0x34f0db,_0x1e3b4d){return _0x34f0db<=_0x1e3b4d;}};function _0x409ecd(_0x8603c7,_0x535674){return _0x3ed9f7(_0x535674- -0xba,_0x8603c7);}if(_0x58b0b1['length']===0x0)return'';const _0x3dc463=[_0x1419ee['zENMZ']];let _0x563a2b=0xa;for(const {memory:_0x5e3552}of _0x58b0b1){const _0x3e8d86=CATEGORY_SHORT[_0x5e3552['category']]||_0x5e3552[_0x409ecd(0x1d8,0x1fe)],_0x445933=_0x5e3552['content'][_0x409ecd(0x2a3,0x276)]('\x0a')[_0x409ecd(0x1ca,0x21d)](_0x45a4dc=>_0x45a4dc[_0x107a0b(0x348,0x2fc)]())['join']('\x20')['slice'](0x0,0xc8),_0x4d313b=_0x107a0b(0x2fd,0x2bf)+_0x3e8d86+']\x20'+_0x445933,_0x3d3d9a=Math[_0x409ecd(0x202,0x1ed)](_0x4d313b[_0x409ecd(0x21a,0x235)]/0x4);if(_0x1419ee[_0x409ecd(0x253,0x295)](_0x563a2b,_0x3d3d9a)>_0x5031c3)break;_0x3dc463[_0x107a0b(0x339,0x2e8)](_0x4d313b),_0x563a2b+=_0x3d3d9a;}function _0x107a0b(_0x2b009a,_0x19d970){return _0x3ed9f7(_0x2b009a-0x46,_0x19d970);}if(_0x1419ee[_0x107a0b(0x322,0x30b)](_0x3dc463[_0x107a0b(0x335,0x31f)],0x1))return'';return _0x3dc463['push'](''),_0x3dc463[_0x107a0b(0x339,0x31d)]('💡\x20`a2a-mem'+_0x107a0b(0x33f,0x34c)+_0x409ecd(0x1fb,0x1f3)+_0x409ecd(0x1fe,0x241)+'s.'),_0x3dc463[_0x107a0b(0x339,0x34f)](_0x409ecd(0x20c,0x209)+_0x107a0b(0x399,0x38e)+'ontext\x20-->'),_0x3dc463[_0x409ecd(0x204,0x234)]('\x0a');}export async function handleUserPromptSubmit(_0x14ab86){const _0x1cf2dc={'EjWkw':_0x4f6c4f(-0x141,-0x183)+'nject\x20disa'+_0x4f6c4f(-0x101,-0x102),'FmwVN':function(_0x4d0d03,_0x438b9c){return _0x4d0d03*_0x438b9c;},'QElRp':function(_0xa35237,_0x4b167e){return _0xa35237<_0x4b167e;},'ILIom':function(_0x8b9d2f,_0x21694b){return _0x8b9d2f(_0x21694b);},'WfMYv':'No\x20meaning'+'ful\x20keywor'+_0x4d3b52(0x3af,0x3aa)+'ed','grSex':_0x4f6c4f(-0xe7,-0xc2),'erlqn':function(_0x5cf843,_0x4555ed){return _0x5cf843!==_0x4555ed;},'lYUsy':function(_0x1d9ac8,_0x127f5e){return _0x1d9ac8-_0x127f5e;},'YyVPI':_0x4f6c4f(-0x13d,-0x168),'jSaMw':_0x4f6c4f(-0xc6,-0x9a),'WaiSm':function(_0x14f713,_0x34448c){return _0x14f713*_0x34448c;},'MqpFt':_0x4d3b52(0x372,0x3bc),'DhaRj':function(_0x3304ec,_0xd3911f){return _0x3304ec!==_0xd3911f;},'HCWaM':_0x4d3b52(0x368,0x38b),'uIjUj':function(_0x3b6469,_0x47c942,_0x5a6343){return _0x3b6469(_0x47c942,_0x5a6343);},'pahLL':_0x4f6c4f(-0xf1,-0xe3)+_0x4f6c4f(-0x112,-0x162)+_0x4d3b52(0x3ad,0x3b4)+_0x4d3b52(0x397,0x36f),'GsOOS':function(_0x343480,_0x4c9a5b){return _0x343480!==_0x4c9a5b;},'misrm':_0x4d3b52(0x38a,0x3a4),'ttiOe':_0x4f6c4f(-0xfd,-0xec),'UVfIz':function(_0x30ee87,_0x16a0dc){return _0x30ee87>_0x16a0dc;},'Vvttm':function(_0x1722d5,_0x14b5b9){return _0x1722d5===_0x14b5b9;},'ySWQP':_0x4d3b52(0x32c,0x374),'kKmay':_0x4d3b52(0x352,0x316),'yHfNC':function(_0x2553d4,_0x5a7130){return _0x2553d4===_0x5a7130;},'ClrFp':function(_0x43dbbe,_0x5e6ea2,_0x133525){return _0x43dbbe(_0x5e6ea2,_0x133525);},'GYvUL':'user_promp'+_0x4f6c4f(-0x13c,-0x175),'gvqZI':_0x4f6c4f(-0x10e,-0x12c)+_0x4f6c4f(-0xd9,-0xdd),'RDXep':function(_0x5c492a,_0x31b17f){return _0x5c492a-_0x31b17f;},'hTUXp':_0x4d3b52(0x326,0x37a),'NaaBI':_0x4d3b52(0x38d,0x3a0),'EuBXJ':function(_0x8c7642,_0x10fbf0){return _0x8c7642 instanceof _0x10fbf0;}},_0x32da33=new ConfigManager()['load'](),_0x25a838=createLogger('UserPrompt'+_0x4d3b52(0x370,0x37f),_0x32da33[_0x4d3b52(0x3b5,0x377)]),_0x2c0e44=performance['now'](),_0x1aa8ec=_0x32da33[_0x4f6c4f(-0x14b,-0x10e)+'ject']??{'enabled':!![],'maxMemories':0x3,'maxTokens':0x3e8,'cacheSize':0x14,'cacheTTLSeconds':0x3c,'timeoutMs':0x64};if(!_0x1aa8ec[_0x4f6c4f(-0xf5,-0x112)])return _0x25a838['info'](_0x1cf2dc['EjWkw']),_0x25a838[_0x4f6c4f(-0x117,-0x13d)](),'';function _0x4f6c4f(_0x541af5,_0x180b81){return _0x11f226(_0x541af5-0x1f1,_0x180b81);}const _0x55955f=_0x14ab86[_0x4f6c4f(-0x162,-0x158)]?.['trim']()||'';if(_0x1cf2dc[_0x4d3b52(0x307,0x356)](_0x55955f['length'],0x5))return _0x25a838[_0x4d3b52(0x33b,0x360)](_0x4d3b52(0x379,0x34b)+'\x20short,\x20sk'+'ipping'),_0x25a838['flush'](),'';const _0x32c7dc=_0x1cf2dc['ILIom'](extractSearchKeywords,_0x55955f);if(!_0x32c7dc||_0x32c7dc[_0x4d3b52(0x33e,0x370)]()[_0x4f6c4f(-0x127,-0x118)]<0x2)return _0x25a838[_0x4f6c4f(-0x124,-0x136)](_0x1cf2dc[_0x4d3b52(0x330,0x36a)]),_0x25a838[_0x4f6c4f(-0x117,-0x144)](),'';const _0x2cc72d=_0x32c7dc[_0x4d3b52(0x34e,0x39e)](/\s+/)[_0x4d3b52(0x2fe,0x345)](_0x44419f=>_0x44419f[_0x4f6c4f(-0x127,-0xea)]>0x1)[_0x4f6c4f(-0x128,-0x167)](_0x1cf2dc[_0x4f6c4f(-0x138,-0x175)]),_0xf84d43=new AdaptiveRouter(),_0x4057ee=_0xf84d43['classify'](_0x55955f),_0x24ed1a=_0x1cf2dc[_0x4d3b52(0x39d,0x350)](getQueryCache,_0x1aa8ec),_0x40b873=_0x4057ee[_0x4f6c4f(-0xe1,-0x91)]+':'+_0x2cc72d,_0x169f2c=_0x24ed1a[_0x4d3b52(0x343,0x37c)](_0x40b873);function _0x4d3b52(_0xf799b6,_0x2f71f4){return _0x11f226(_0x2f71f4-0x675,_0xf799b6);}if(_0x1cf2dc[_0x4d3b52(0x34a,0x397)](_0x169f2c,null))return _0x25a838['info']('Cache\x20hit',{'keywords':_0x2cc72d,'durationMs':Math[_0x4f6c4f(-0xcc,-0x9b)](_0x1cf2dc[_0x4f6c4f(-0x131,-0x131)](performance[_0x4d3b52(0x2de,0x332)](),_0x2c0e44))}),_0x25a838[_0x4d3b52(0x335,0x36d)](),_0x169f2c;try{if(_0x1cf2dc[_0x4f6c4f(-0x126,-0x118)]!==_0x1cf2dc['jSaMw']){const _0x20f4dd=getSharedDb(_0x32da33['db'][_0x4d3b52(0x386,0x381)]),_0x4d92f4=_0x1aa8ec[_0x4f6c4f(-0xcd,-0xa4)+'s'];let _0x2b06aa=[];try{_0x2b06aa=_0x20f4dd[_0x4f6c4f(-0x160,-0x14c)+'S'](_0x2cc72d,_0x1cf2dc[_0x4d3b52(0x3c3,0x399)](_0x4d92f4,0x2));}catch{'wZTyu'!==_0x1cf2dc[_0x4f6c4f(-0xcf,-0xaf)]?_0x4ee38f=[]:_0x2b06aa=[];}let _0x26d9ff;if(_0x4057ee[_0x4d3b52(0x303,0x35a)]&&_0x32da33['embedding']?.['enabled']){if(_0x1cf2dc['DhaRj'](_0x1cf2dc[_0x4d3b52(0x388,0x3b2)],_0x4d3b52(0x384,0x334)))try{const {createEmbeddingProvider:_0x20230d}=await import(_0x4d3b52(0x390,0x359)+_0x4d3b52(0x36f,0x333)+'s'),_0x47d13c=_0x1cf2dc[_0x4d3b52(0x3b0,0x3a8)](_0x20230d,_0x32da33[_0x4d3b52(0x376,0x3a1)],_0x32da33[_0x4f6c4f(-0x147,-0x188)]),_0x5f146f=await Promise[_0x4d3b52(0x36b,0x38d)](_0x47d13c[_0x4f6c4f(-0xf4,-0xe7)](_0x55955f)),_0x504a2e=_0x20f4dd['searchByVe'+'ctor'](_0x5f146f,_0x4d92f4*0x2),_0x1cd879=new HybridRanker({'categoryBoost':!![],'tierBoost':!![]}),_0x2c4ab0=_0x1cd879[_0x4f6c4f(-0x109,-0x157)](_0x2b06aa,_0x504a2e);_0x26d9ff=_0x2c4ab0[_0x4f6c4f(-0xfb,-0xb4)](0x0,_0x1cf2dc[_0x4d3b52(0x36e,0x3a2)](_0x4d92f4,0x2))['map'](_0x513b10=>({'memory':_0x513b10[_0x4f6c4f(-0x165,-0x183)],'score':_0x513b10[_0x4d3b52(0x360,0x31a)],'matchType':'hybrid'})),_0x25a838[_0x4d3b52(0x362,0x360)](_0x1cf2dc[_0x4d3b52(0x3ab,0x384)],{'count':_0x26d9ff[_0x4d3b52(0x357,0x35d)]});}catch{_0x26d9ff=_0x2b06aa;}else return _0x538655[_0x4d3b52(0x33d,0x379)](_0x1cf2dc[_0x4d3b52(0x346,0x328)]),_0x1efc79[_0x4f6c4f(-0x117,-0xe9)](),'';}else{if(_0x1cf2dc[_0x4d3b52(0x31f,0x363)](_0x1cf2dc[_0x4f6c4f(-0xec,-0x12c)],_0x4d3b52(0x377,0x3a5)))_0x26d9ff=_0x2b06aa;else try{_0x347a1b[_0x4d3b52(0x361,0x385)+'ss'](_0x156a08['id']);}catch{}}const _0x5a7077=_0x26d9ff[_0x4f6c4f(-0x13f,-0xe9)](_0x583d76=>_0x583d76[_0x4f6c4f(-0x165,-0x118)][_0x4f6c4f(-0x143,-0x12b)+'h']===_0x14ab86[_0x4f6c4f(-0x143,-0x166)+'h']),_0x236a4c=_0x26d9ff[_0x4d3b52(0x359,0x345)](_0x1bca8e=>_0x1bca8e[_0x4d3b52(0x2ed,0x31f)][_0x4d3b52(0x347,0x341)+'h']!==_0x14ab86[_0x4f6c4f(-0x143,-0xf2)+'h']),_0x27a770=[..._0x5a7077,..._0x236a4c],_0x34ed58=new Map(),_0x99d507=[];for(const _0x20ac2 of _0x27a770){if(!_0x20ac2[_0x4d3b52(0x300,0x31f)][_0x4d3b52(0x370,0x319)]){if(_0x1cf2dc[_0x4d3b52(0x392,0x363)](_0x1cf2dc[_0x4f6c4f(-0xfe,-0xf6)],_0x4f6c4f(-0xfd,-0x10a))){const _0x1b662b=this[_0x4d3b52(0x378,0x37d)][_0x4f6c4f(-0xdb,-0x113)]()[_0x4f6c4f(-0x16c,-0x195)]()[_0x4f6c4f(-0x149,-0x1a0)];_0x1b662b!==_0x456bd6&&this[_0x4f6c4f(-0x107,-0xbb)][_0x4f6c4f(-0x102,-0xcd)](_0x1b662b);}else _0x99d507[_0x4d3b52(0x33f,0x361)](_0x20ac2);}else{const _0x4943aa=_0x34ed58[_0x4f6c4f(-0x108,-0x15e)](_0x20ac2[_0x4d3b52(0x347,0x31f)][_0x4d3b52(0x2ef,0x319)]);(!_0x4943aa||_0x1cf2dc['UVfIz'](_0x20ac2[_0x4f6c4f(-0x16a,-0x176)],_0x4943aa[_0x4f6c4f(-0x16a,-0x1a7)]))&&(_0x1cf2dc[_0x4f6c4f(-0xf0,-0xf8)](_0x1cf2dc[_0x4f6c4f(-0x154,-0x136)],_0x1cf2dc['kKmay'])?(this[_0x4d3b52(0x397,0x344)]=_0x5acf79,this[_0x4d3b52(0x35f,0x371)]=uDnWQU[_0x4f6c4f(-0xe2,-0x91)](_0x27c6b1,0x3e8)):_0x34ed58[_0x4f6c4f(-0x132,-0x116)](_0x20ac2[_0x4f6c4f(-0x165,-0x13d)][_0x4f6c4f(-0x16b,-0x185)],_0x20ac2));}}_0x99d507[_0x4f6c4f(-0x123,-0x10c)](..._0x34ed58[_0x4f6c4f(-0xde,-0x10a)]()),_0x99d507[_0x4f6c4f(-0x161,-0x15f)]((_0x5cd7e6,_0x35da4b)=>_0x35da4b['score']-_0x5cd7e6[_0x4f6c4f(-0x16a,-0x179)]);const _0x17418d=_0x99d507[_0x4d3b52(0x3ae,0x389)](0x0,_0x4d92f4);if(_0x1cf2dc[_0x4f6c4f(-0xf3,-0x123)](_0x17418d[_0x4d3b52(0x37a,0x35d)],0x0)){const _0x2460fb='';return _0x24ed1a[_0x4d3b52(0x36c,0x352)](_0x40b873,_0x2460fb),_0x25a838[_0x4f6c4f(-0x10b,-0x129)](_0x4d3b52(0x3d5,0x380),{'keywords':_0x2cc72d,'durationMs':Math[_0x4f6c4f(-0xcc,-0xac)](_0x1cf2dc[_0x4f6c4f(-0x131,-0x10e)](performance[_0x4d3b52(0x38a,0x332)](),_0x2c0e44))}),_0x25a838['flush'](),_0x2460fb;}for(const {memory:_0xb7c146}of _0x17418d){try{_0x20f4dd[_0x4d3b52(0x382,0x385)+'ss'](_0xb7c146['id']);}catch{}}const _0x3eab5a=_0x1cf2dc[_0x4d3b52(0x317,0x317)](formatRealtimeOutput,_0x17418d,_0x1aa8ec[_0x4f6c4f(-0x13e,-0x113)]);_0x24ed1a[_0x4f6c4f(-0x132,-0x145)](_0x40b873,_0x3eab5a);if(_0x17418d[_0x4d3b52(0x335,0x35d)]>0x0)try{if(_0x1cf2dc[_0x4f6c4f(-0xf0,-0x11a)](_0x4d3b52(0x345,0x38c),'ocjgm'))_0x9c12d0=_0x5cb7c3;else{const _0x1076c1=_0x17418d['flatMap'](({memory:_0x177dc0})=>_0x177dc0[_0x4f6c4f(-0x12c,-0x144)][_0x4d3b52(0x39c,0x395)+'e']()[_0x4f6c4f(-0xe6,-0x12b)](/\s+/)['filter'](_0x4f8fe5=>_0x4f8fe5[_0x4d3b52(0x371,0x35d)]>0x3)[_0x4f6c4f(-0xfb,-0x135)](0x0,0x5));_0x20f4dd['recordInje'+'ction']({'sessionId':_0x14ab86[_0x4f6c4f(-0xfc,-0xe2)],'hookType':_0x1cf2dc[_0x4f6c4f(-0xd8,-0xbf)],'injectedMemoryIds':_0x17418d[_0x4d3b52(0x36e,0x36c)](({memory:_0x2b708d})=>_0x2b708d['id']),'injectedKeywords':[...new Set(_0x1076c1)][_0x4d3b52(0x336,0x389)](0x0,0x14),'totalInjected':_0x17418d['length']});}}catch{}if(_0x32da33[_0x4d3b52(0x320,0x349)+_0x4f6c4f(-0x120,-0xdd)]?.['enabled']&&hasEmotionalContent(_0x55955f))try{_0x20f4dd[_0x4f6c4f(-0x164,-0x123)+_0x4f6c4f(-0x119,-0x14f)](_0x55955f['slice'](0x0,0x1f4));}catch{}return _0x25a838['info'](_0x1cf2dc[_0x4d3b52(0x361,0x32f)],{'keywords':_0x2cc72d,'count':_0x17418d[_0x4d3b52(0x348,0x35d)],'durationMs':Math[_0x4f6c4f(-0xcc,-0x81)](_0x1cf2dc[_0x4d3b52(0x3ad,0x39f)](performance[_0x4d3b52(0x38a,0x332)](),_0x2c0e44))}),_0x25a838[_0x4d3b52(0x32e,0x36d)](),_0x3eab5a;}else _0x5a7614['stdout'][_0x4f6c4f(-0xe9,-0xe7)](_0x249720);}catch(_0x513c7b){if(_0x1cf2dc[_0x4f6c4f(-0xf0,-0x127)](_0x1cf2dc[_0x4f6c4f(-0x11c,-0x170)],_0x1cf2dc[_0x4f6c4f(-0xc5,-0xc0)]))this[_0x4f6c4f(-0x107,-0x15b)][_0x4f6c4f(-0xca,-0x10a)]();else return _0x25a838[_0x4f6c4f(-0x10c,-0x137)](_0x4d3b52(0x33e,0x32e)+_0x4f6c4f(-0x163,-0x1a0),_0x1cf2dc[_0x4f6c4f(-0xf2,-0x116)](_0x513c7b,Error)?_0x513c7b:new Error(String(_0x513c7b)),{'keywords':_0x2cc72d}),_0x25a838['flush'](),'';}}const HOOK_TIMEOUT_MS=0x1388;function _0x11f226(_0x3ab9de,_0x4ece1b){return _0x43d9(_0x3ab9de- -0x3d3,_0x4ece1b);}function _0x2017(){const _0x4a7868=['y2TPBMC','B3DSzwrNzq','yxjNDG','B3j5ihnLyxjJAa','Afrvwha','zM9YigrLDgfPBa','v2znwxy','Aw9UtwvZC2fNzq','BwfW','zMX1C2G','mtK2seDYt3fN','BwL0','DhjPBq','DhrStxm','CMnOigLUifvZzq','yxrXt3G','DxrbsKC','Dw5Yzwy','sg9VAYbJB21WBa','Bg9Nz2LUzW','zxjYB3i','Aw5MBW','yM5jyKW','CMfUAW','z2v0','y2fJAgu','rg1xAee','u3vIBwL0','tM8GCMvZDwX0CW','Cgf0Aa','zgvSzxrL','yMXLza','CgfOteW','CMvJB3jKqwnJzq','DhrPt2u','Bg1sBu8','C2vZC2LVBKLK','C2XPy2u','mtC3odeYmgzqzuXuvq','EMzswhm','uwjss0C','CMvZB2X2zq','Agj3tKC','zw5HyMXLza','zw1Izwq','EuHMtKm','rxvcweO','shLICMLKihnLyq','vNz0Dg0','Dg9mB3DLCKnHCW','DgLVBG','zxjSCw4','BwLZCM0','v2fPu20','BNrLEhqGls0+','D3jPDgu','C2L6zq','ie9sia','C3bSAxq','uKryzxa','DeL3sMq','zw1IzwrKAw5N','rM13vK4','y29TCgXLEgL0Eq','q21huwW','Axf4z1i','DMfSDwvZ','y29Kzv9Wyxr0zq','DuLQvwO','A2v5CW','zhmGzxH0CMfJDa','zxrLza','r1L2vuW','uhjVBxb0u3vIBq','AxqGC2fMzxr5ia','AxqGzxjYB3i6','ntuWndiYqvfWEhLo','wNf2suO','senxyu0','zw5KC1DPDgG','CLbYB21WDfn1yG','txfWrNq','ndCXodrKzvLxCfK','Bwf4twvTB3jPzq','CM91BMq','CLnnt1O','y2XLyxi','y2fJAgvtAxPL','D1PuExu','zNLkteG','EgTowhO','tMfHqKK','y29UDgv4Da','uMvHBhrPBwuGqW','zxjYB3jFC29SDq','CuTmDeW','BxmP','y2vPBa','q3jds0y','q2XYrNa','BMv4Da','CgfYzw50swq','C2nVCMu','idXXDwvYEt5Gia','CNvSzq','quHOzNO','Dg9tDhjPBMC','BwvTB3j5','yNvMzMvYrw1VDa','BgvK','DxnLCLbYB21WDa','C29YDa','C2vHCMnOqNLgva','lsbB','y2f0zwDVCNK','vffSzxq','rwPxA3C','rxnWtLK','mMvHzgDYBq','C2TPBgW','qM1cD3m','ohPPA3jMBq','u2vHCMnOigzHAq','z3zXwKK','Evnxuva','pceTlsaVqtjbia','BM93','BMCVAw5KzxGUAG','u3bwtMu','DxnLCI1WCM9TCa','DgLTzxn0yw1W','z0PvA1y','zxHPDa','CMvHBhrPBwvjBG','mta2nte3n3jzq1jHwa','DMfSDwu','nJC5mtmWwM9zsMDd','BgXT','CMvZDwX0','BgvHCM5PBMC','C3rKB3v0','ChjVAMvJDfbHDa','pceTlsbbmKeGuG','uMvHBhrPBwuGAq','Bwf4u2L6zq','zMLSDgvY','Bwf4vg9Rzw5Z','u1Lcrfu','Df9ZDwjTAxq','zw1VDgLVBLrYyq','r1vkEhi','uhjVBxb0ihrVBW','z3jtzxG','zgvJAxnPB24','C3rKAw4','w2eYyv0GvxnLCG','suXjB20','mJuXmJaXrfjWvePO','C2v0','BfLvC3K','y2fJAgvuveXtzq','CgfYC2u','uuvSuNa','y29Uzhm','y29UDgvUDa','lI4Vzw1IzwrKAq','DxnLvMvJDg9Y','DxrMltG','AM9PBG','BgvUz3rO','wxLwueK','vxLzs2O','zgvIDwC','ChvZAa','ndm2nZy1t2Xjs3n6','r3npt1m'];_0x2017=function(){return _0x4a7868;};return _0x2017();}export async function main(){const _0x51b6bf={'AHhfz':function(_0x79f704){return _0x79f704();},'rSMOZ':_0x60fd32(0x1fd,0x238),'UyYKj':function(_0x5f28f2,_0x235672){return _0x5f28f2===_0x235672;},'gJUkV':function(_0x49fd77,_0x47d6f2,_0x4fcef7){return _0x49fd77(_0x47d6f2,_0x4fcef7);},'EspNY':_0x60fd32(0x2aa,0x28e),'DmWhA':function(_0x589bd5,_0x1eb0e7){return _0x589bd5 instanceof _0x1eb0e7;},'meWkR':function(_0x8dc1dd){return _0x8dc1dd();}};function _0x60fd32(_0x4faff4,_0x3817c3){return _0x3ed9f7(_0x3817c3- -0xb5,_0x4faff4);}const _0x48c504=[];for await(const _0x4122ac of process[_0x163929(-0x18b,-0x152)]){_0x48c504[_0x163929(-0x161,-0x13f)](_0x4122ac);}const _0x4b5e66=Buffer['concat'](_0x48c504)[_0x60fd32(0x24f,0x1fb)](_0x51b6bf[_0x163929(-0xa5,-0xe7)])[_0x60fd32(0x290,0x24d)]();if(!_0x4b5e66){if(_0x51b6bf[_0x163929(-0x109,-0x141)](_0x60fd32(0x22c,0x250),_0x60fd32(0x2b1,0x2a0)))try{_0x5d305c['bufferEmot'+_0x60fd32(0x257,0x248)](_0x4dea98[_0x60fd32(0x227,0x266)](0x0,0x1f4));}catch{}else _0x51b6bf[_0x163929(-0x137,-0x183)](closeSharedDb),process[_0x60fd32(0x226,0x215)](0x0);}const _0x1c0eca=_0x51b6bf[_0x163929(-0x1b0,-0x169)](setTimeout,()=>{console[_0x5750b9(-0x12e,-0x183)](_0x46ed76(-0x20b,-0x1c1)+_0x5750b9(-0x14f,-0x14e)+_0x5750b9(-0x1a4,-0x14d)+'timeout\x20('+HOOK_TIMEOUT_MS+_0x46ed76(-0x246,-0x25a));function _0x5750b9(_0x51d82e,_0x5224fb){return _0x163929(_0x51d82e,_0x5224fb- -0x5b);}_0x51b6bf[_0x5750b9(-0x1e8,-0x1de)](closeSharedDb);function _0x46ed76(_0x223e73,_0x35bbf1){return _0x163929(_0x35bbf1,_0x223e73- -0xba);}process[_0x5750b9(-0x1eb,-0x1c3)](0x0);},HOOK_TIMEOUT_MS);_0x1c0eca[_0x163929(-0x119,-0x12b)]();function _0x163929(_0x14d907,_0xd66c6f){return _0x3ed9f7(_0xd66c6f- -0x432,_0x14d907);}try{const _0x1025de=JSON[_0x60fd32(0x1f4,0x232)](_0x4b5e66),_0x43c21e=normalizeHookInput(_0x1025de),_0x12f240=await handleUserPromptSubmit(_0x43c21e);_0x12f240&&process[_0x60fd32(0x274,0x21d)]['write'](_0x12f240);}catch(_0x48ead8){_0x51b6bf[_0x163929(-0x17d,-0x177)]===_0x163929(-0x10d,-0xef)?console[_0x163929(-0x10d,-0x128)]('[a2a]\x20User'+_0x60fd32(0x26a,0x28a)+_0x60fd32(0x23a,0x28c),_0x51b6bf[_0x60fd32(0x23d,0x25b)](_0x48ead8,Error)?_0x48ead8['message']:_0x48ead8):this['cache'][_0x163929(-0xe3,-0x11e)](_0xe15701);}finally{_0x51b6bf['meWkR'](closeSharedDb),process['exit'](0x0);}}const isMainModule=process[_0x3ed9f7(0x2f8,0x32b)][0x1]?.[_0x3ed9f7(0x345,0x315)](_0x3ed9f7(0x2c7,0x295)+'t-submit.j'+'s')||process[_0x11f226(-0x30f,-0x34d)][0x1]?.['endsWith'](_0x3ed9f7(0x2c7,0x2cd)+'t-submit.t'+'s');function _0x3ed9f7(_0x19ac0d,_0x480da1){return _0x43d9(_0x19ac0d-0x234,_0x480da1);}isMainModule&&main();
|
package/dist/i18n/index.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
function _0x13eb(){var _0x4199f0=['ogvrBgTvtW','nZm1odC3oenPvgHJtq','mZeYnKLQAu9UBW','mJiXntKXn0f0tgrADG','mJnSr2vgyvK','mtbdAvHIwKi','mtaWmJK0mtfXqw12sgG','mtKZodq4mfrpD2nMqW','ndmWnJmWnxzdAMDksq','odq5nwjcChz3tW','mte4mte0BLvtvvLh'];_0x13eb=function(){return _0x4199f0;};return _0x13eb();}(function(_0x39ffa7,_0x3c0be7){function _0x56fe7d(_0x450eb9,_0x589271){return _0x411a(_0x450eb9-0x29f,_0x589271);}function _0x276469(_0x8ac6ab,_0x2b9c43){return _0x411a(_0x2b9c43- -0x45,_0x8ac6ab);}var _0x2689d0=_0x39ffa7();while(!![]){try{var _0x5af547=-parseInt(_0x276469(0x6c,0x68))/0x1*(-parseInt(_0x276469(0x65,0x63))/0x2)+-parseInt(_0x276469(0x6e,0x6c))/0x3+-parseInt(_0x56fe7d(0x34f,0x34a))/0x4+parseInt(_0x276469(0x6e,0x6d))/0x5*(parseInt(_0x56fe7d(0x34a,0x349))/0x6)+parseInt(_0x56fe7d(0x34e,0x349))/0x7*(parseInt(_0x276469(0x5f,0x64))/0x8)+-parseInt(_0x56fe7d(0x349,0x345))/0x9+-parseInt(_0x56fe7d(0x34d,0x353))/0xa*(parseInt(_0x276469(0x68,0x67))/0xb);if(_0x5af547===_0x3c0be7)break;else _0x2689d0['push'](_0x2689d0['shift']());}catch(_0x52ecd2){_0x2689d0['push'](_0x2689d0['shift']());}}}(_0x13eb,0xb3f5f));function _0x411a(_0x17adb5,_0x47a431){_0x17adb5=_0x17adb5-0xa8;var _0x13eba9=_0x13eb();var _0x411a91=_0x13eba9[_0x17adb5];if(_0x411a['DLWkMP']===undefined){var _0x29e021=function(_0x9da476){var _0x363874='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x4383a8='',_0x5b9e41='';for(var _0x143b5f=0x0,_0x2003e3,_0x4c5101,_0x5e06c0=0x0;_0x4c5101=_0x9da476['charAt'](_0x5e06c0++);~_0x4c5101&&(_0x2003e3=_0x143b5f%0x4?_0x2003e3*0x40+_0x4c5101:_0x4c5101,_0x143b5f++%0x4)?_0x4383a8+=String['fromCharCode'](0xff&_0x2003e3>>(-0x2*_0x143b5f&0x6)):0x0){_0x4c5101=_0x363874['indexOf'](_0x4c5101);}for(var _0x153ea9=0x0,_0x49289a=_0x4383a8['length'];_0x153ea9<_0x49289a;_0x153ea9++){_0x5b9e41+='%'+('00'+_0x4383a8['charCodeAt'](_0x153ea9)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x5b9e41);};_0x411a['uzjNwg']=_0x29e021,_0x411a['htfSNy']={},_0x411a['DLWkMP']=!![];}var _0x231973=_0x13eba9[0x0],_0x3bbdee=_0x17adb5+_0x231973,_0x2ca0ac=_0x411a['htfSNy'][_0x3bbdee];return!_0x2ca0ac?(_0x411a91=_0x411a['uzjNwg'](_0x411a91),_0x411a['htfSNy'][_0x3bbdee]=_0x411a91):_0x411a91=_0x2ca0ac,_0x411a91;}export{t,setLocale,getLocale,detectLocale,getMessages}from'./messages.js';
|