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.
Files changed (274) hide show
  1. package/LICENSE +7 -19
  2. package/README.md +1 -1
  3. package/dist/a2a/client.js +1 -252
  4. package/dist/a2a/discovery.js +1 -115
  5. package/dist/a2a/index.js +1 -8
  6. package/dist/a2a/types.js +1 -42
  7. package/dist/adapters/anthropic.js +1 -117
  8. package/dist/chunking/chunker.js +1 -163
  9. package/dist/claude/sync.d.ts +8 -2
  10. package/dist/claude/sync.js +1 -298
  11. package/dist/cli/commands/add.js +1 -80
  12. package/dist/cli/commands/claude-sync.d.ts +3 -3
  13. package/dist/cli/commands/claude-sync.js +1 -70
  14. package/dist/cli/commands/cleanup.js +1 -83
  15. package/dist/cli/commands/config.js +1 -79
  16. package/dist/cli/commands/edit.js +1 -69
  17. package/dist/cli/commands/embed.js +1 -92
  18. package/dist/cli/commands/extract.js +1 -103
  19. package/dist/cli/commands/health.js +1 -105
  20. package/dist/cli/commands/list.js +1 -46
  21. package/dist/cli/commands/migrate-chunks.js +1 -205
  22. package/dist/cli/commands/migrate-file-refs.js +1 -183
  23. package/dist/cli/commands/proficiency.js +1 -146
  24. package/dist/cli/commands/rm.js +1 -64
  25. package/dist/cli/commands/search.js +1 -90
  26. package/dist/cli/commands/setup-wizard.js +1 -387
  27. package/dist/cli/commands/setup.js +1 -170
  28. package/dist/cli/commands/skill.js +1 -151
  29. package/dist/cli/commands/status.js +1 -70
  30. package/dist/cli/commands/sync.js +1 -202
  31. package/dist/cli/commands/team.js +1 -142
  32. package/dist/cli/index.js +1 -87
  33. package/dist/config/manager.js +1 -372
  34. package/dist/db/database.d.ts +36 -0
  35. package/dist/db/database.js +1 -1400
  36. package/dist/embedding/e5-provider.js +1 -147
  37. package/dist/embedding/index.js +1 -34
  38. package/dist/embedding/local-provider.js +1 -157
  39. package/dist/embedding/openai-provider.js +1 -92
  40. package/dist/embedding/quantization.js +1 -89
  41. package/dist/extraction/dedup-manager.js +1 -161
  42. package/dist/extraction/emotion-filter.js +1 -33
  43. package/dist/extraction/extractor.d.ts +0 -3
  44. package/dist/extraction/extractor.js +1 -648
  45. package/dist/extraction/file-reference.js +1 -77
  46. package/dist/extraction/filter.js +1 -86
  47. package/dist/extraction/scorer.js +1 -142
  48. package/dist/extraction/similarity.js +1 -85
  49. package/dist/hooks/client-factory.js +1 -44
  50. package/dist/hooks/post-tool-use.js +1 -518
  51. package/dist/hooks/pre-compact.js +1 -209
  52. package/dist/hooks/session-end.js +1 -633
  53. package/dist/hooks/session-start.js +1 -549
  54. package/dist/hooks/shared.js +1 -110
  55. package/dist/hooks/stop.d.ts +21 -0
  56. package/dist/hooks/stop.js +1 -0
  57. package/dist/hooks/user-prompt-submit.js +1 -316
  58. package/dist/i18n/index.js +1 -2
  59. package/dist/i18n/messages.js +1 -150
  60. package/dist/index.d.ts +1 -1
  61. package/dist/index.js +1 -43
  62. package/dist/lifecycle/cleanup-scheduler.js +1 -137
  63. package/dist/lifecycle/cleanup.d.ts +1 -0
  64. package/dist/lifecycle/cleanup.js +1 -116
  65. package/dist/lifecycle/consolidation.d.ts +22 -0
  66. package/dist/lifecycle/consolidation.js +1 -0
  67. package/dist/lifecycle/index.d.ts +2 -0
  68. package/dist/lifecycle/index.js +1 -13
  69. package/dist/lifecycle/injection-flush.d.ts +24 -0
  70. package/dist/lifecycle/injection-flush.js +1 -0
  71. package/dist/lifecycle/quality-scorer.d.ts +5 -6
  72. package/dist/lifecycle/quality-scorer.js +1 -46
  73. package/dist/lifecycle/tiering.js +1 -246
  74. package/dist/llm/client.js +1 -226
  75. package/dist/llm/index.js +1 -5
  76. package/dist/proficiency/actr-engine.js +1 -106
  77. package/dist/proficiency/detection.js +1 -77
  78. package/dist/proficiency/index.js +1 -9
  79. package/dist/proficiency/tracker.js +1 -173
  80. package/dist/proficiency/types.js +1 -8
  81. package/dist/providers/adapters.js +1 -140
  82. package/dist/providers/detector.js +1 -57
  83. package/dist/search/adaptive-router.js +1 -93
  84. package/dist/search/index.js +1 -9
  85. package/dist/search/ranker.js +1 -171
  86. package/dist/search/reranker.js +1 -155
  87. package/dist/session/parser.js +1 -130
  88. package/dist/skill/evaluator.js +1 -509
  89. package/dist/skill/index.js +1 -7
  90. package/dist/skill/types.js +1 -7
  91. package/dist/sync/client.d.ts +7 -0
  92. package/dist/sync/client.js +1 -597
  93. package/dist/sync/encryption.js +1 -203
  94. package/dist/sync/index.js +1 -12
  95. package/dist/sync/queue.js +1 -214
  96. package/dist/sync/scheduler.js +1 -140
  97. package/dist/sync/synchronizer.js +1 -241
  98. package/dist/sync/team-synchronizer.js +1 -204
  99. package/dist/sync/vector-clock.js +1 -70
  100. package/dist/types/index.d.ts +13 -1
  101. package/dist/types/index.js +1 -132
  102. package/dist/utils/keychain.js +1 -170
  103. package/dist/utils/logger.js +1 -128
  104. package/package.json +15 -10
  105. package/dist/a2a/client.d.ts.map +0 -1
  106. package/dist/a2a/client.js.map +0 -1
  107. package/dist/a2a/discovery.d.ts.map +0 -1
  108. package/dist/a2a/discovery.js.map +0 -1
  109. package/dist/a2a/index.d.ts.map +0 -1
  110. package/dist/a2a/index.js.map +0 -1
  111. package/dist/a2a/types.d.ts.map +0 -1
  112. package/dist/a2a/types.js.map +0 -1
  113. package/dist/adapters/anthropic.d.ts.map +0 -1
  114. package/dist/adapters/anthropic.js.map +0 -1
  115. package/dist/chunking/chunker.d.ts.map +0 -1
  116. package/dist/chunking/chunker.js.map +0 -1
  117. package/dist/claude/sync.d.ts.map +0 -1
  118. package/dist/claude/sync.js.map +0 -1
  119. package/dist/cli/commands/add.d.ts.map +0 -1
  120. package/dist/cli/commands/add.js.map +0 -1
  121. package/dist/cli/commands/claude-sync.d.ts.map +0 -1
  122. package/dist/cli/commands/claude-sync.js.map +0 -1
  123. package/dist/cli/commands/cleanup.d.ts.map +0 -1
  124. package/dist/cli/commands/cleanup.js.map +0 -1
  125. package/dist/cli/commands/config.d.ts.map +0 -1
  126. package/dist/cli/commands/config.js.map +0 -1
  127. package/dist/cli/commands/edit.d.ts.map +0 -1
  128. package/dist/cli/commands/edit.js.map +0 -1
  129. package/dist/cli/commands/embed.d.ts.map +0 -1
  130. package/dist/cli/commands/embed.js.map +0 -1
  131. package/dist/cli/commands/extract.d.ts.map +0 -1
  132. package/dist/cli/commands/extract.js.map +0 -1
  133. package/dist/cli/commands/health.d.ts.map +0 -1
  134. package/dist/cli/commands/health.js.map +0 -1
  135. package/dist/cli/commands/list.d.ts.map +0 -1
  136. package/dist/cli/commands/list.js.map +0 -1
  137. package/dist/cli/commands/migrate-chunks.d.ts.map +0 -1
  138. package/dist/cli/commands/migrate-chunks.js.map +0 -1
  139. package/dist/cli/commands/migrate-file-refs.d.ts.map +0 -1
  140. package/dist/cli/commands/migrate-file-refs.js.map +0 -1
  141. package/dist/cli/commands/proficiency.d.ts.map +0 -1
  142. package/dist/cli/commands/proficiency.js.map +0 -1
  143. package/dist/cli/commands/rm.d.ts.map +0 -1
  144. package/dist/cli/commands/rm.js.map +0 -1
  145. package/dist/cli/commands/search.d.ts.map +0 -1
  146. package/dist/cli/commands/search.js.map +0 -1
  147. package/dist/cli/commands/setup-wizard.d.ts.map +0 -1
  148. package/dist/cli/commands/setup-wizard.js.map +0 -1
  149. package/dist/cli/commands/setup.d.ts.map +0 -1
  150. package/dist/cli/commands/setup.js.map +0 -1
  151. package/dist/cli/commands/skill.d.ts.map +0 -1
  152. package/dist/cli/commands/skill.js.map +0 -1
  153. package/dist/cli/commands/status.d.ts.map +0 -1
  154. package/dist/cli/commands/status.js.map +0 -1
  155. package/dist/cli/commands/sync.d.ts.map +0 -1
  156. package/dist/cli/commands/sync.js.map +0 -1
  157. package/dist/cli/commands/team.d.ts.map +0 -1
  158. package/dist/cli/commands/team.js.map +0 -1
  159. package/dist/cli/index.d.ts.map +0 -1
  160. package/dist/cli/index.js.map +0 -1
  161. package/dist/config/manager.d.ts.map +0 -1
  162. package/dist/config/manager.js.map +0 -1
  163. package/dist/db/database.d.ts.map +0 -1
  164. package/dist/db/database.js.map +0 -1
  165. package/dist/embedding/e5-provider.d.ts.map +0 -1
  166. package/dist/embedding/e5-provider.js.map +0 -1
  167. package/dist/embedding/index.d.ts.map +0 -1
  168. package/dist/embedding/index.js.map +0 -1
  169. package/dist/embedding/local-provider.d.ts.map +0 -1
  170. package/dist/embedding/local-provider.js.map +0 -1
  171. package/dist/embedding/openai-provider.d.ts.map +0 -1
  172. package/dist/embedding/openai-provider.js.map +0 -1
  173. package/dist/embedding/quantization.d.ts.map +0 -1
  174. package/dist/embedding/quantization.js.map +0 -1
  175. package/dist/extraction/dedup-manager.d.ts.map +0 -1
  176. package/dist/extraction/dedup-manager.js.map +0 -1
  177. package/dist/extraction/emotion-filter.d.ts.map +0 -1
  178. package/dist/extraction/emotion-filter.js.map +0 -1
  179. package/dist/extraction/extractor.d.ts.map +0 -1
  180. package/dist/extraction/extractor.js.map +0 -1
  181. package/dist/extraction/file-reference.d.ts.map +0 -1
  182. package/dist/extraction/file-reference.js.map +0 -1
  183. package/dist/extraction/filter.d.ts.map +0 -1
  184. package/dist/extraction/filter.js.map +0 -1
  185. package/dist/extraction/scorer.d.ts.map +0 -1
  186. package/dist/extraction/scorer.js.map +0 -1
  187. package/dist/extraction/similarity.d.ts.map +0 -1
  188. package/dist/extraction/similarity.js.map +0 -1
  189. package/dist/hooks/client-factory.d.ts.map +0 -1
  190. package/dist/hooks/client-factory.js.map +0 -1
  191. package/dist/hooks/post-tool-use.d.ts.map +0 -1
  192. package/dist/hooks/post-tool-use.js.map +0 -1
  193. package/dist/hooks/pre-compact.d.ts.map +0 -1
  194. package/dist/hooks/pre-compact.js.map +0 -1
  195. package/dist/hooks/session-end.d.ts.map +0 -1
  196. package/dist/hooks/session-end.js.map +0 -1
  197. package/dist/hooks/session-start.d.ts.map +0 -1
  198. package/dist/hooks/session-start.js.map +0 -1
  199. package/dist/hooks/shared.d.ts.map +0 -1
  200. package/dist/hooks/shared.js.map +0 -1
  201. package/dist/hooks/user-prompt-submit.d.ts.map +0 -1
  202. package/dist/hooks/user-prompt-submit.js.map +0 -1
  203. package/dist/i18n/index.d.ts.map +0 -1
  204. package/dist/i18n/index.js.map +0 -1
  205. package/dist/i18n/messages.d.ts.map +0 -1
  206. package/dist/i18n/messages.js.map +0 -1
  207. package/dist/index.d.ts.map +0 -1
  208. package/dist/index.js.map +0 -1
  209. package/dist/lifecycle/cleanup-scheduler.d.ts.map +0 -1
  210. package/dist/lifecycle/cleanup-scheduler.js.map +0 -1
  211. package/dist/lifecycle/cleanup.d.ts.map +0 -1
  212. package/dist/lifecycle/cleanup.js.map +0 -1
  213. package/dist/lifecycle/index.d.ts.map +0 -1
  214. package/dist/lifecycle/index.js.map +0 -1
  215. package/dist/lifecycle/quality-scorer.d.ts.map +0 -1
  216. package/dist/lifecycle/quality-scorer.js.map +0 -1
  217. package/dist/lifecycle/tiering.d.ts.map +0 -1
  218. package/dist/lifecycle/tiering.js.map +0 -1
  219. package/dist/llm/client.d.ts.map +0 -1
  220. package/dist/llm/client.js.map +0 -1
  221. package/dist/llm/index.d.ts.map +0 -1
  222. package/dist/llm/index.js.map +0 -1
  223. package/dist/proficiency/actr-engine.d.ts.map +0 -1
  224. package/dist/proficiency/actr-engine.js.map +0 -1
  225. package/dist/proficiency/detection.d.ts.map +0 -1
  226. package/dist/proficiency/detection.js.map +0 -1
  227. package/dist/proficiency/index.d.ts.map +0 -1
  228. package/dist/proficiency/index.js.map +0 -1
  229. package/dist/proficiency/tracker.d.ts.map +0 -1
  230. package/dist/proficiency/tracker.js.map +0 -1
  231. package/dist/proficiency/types.d.ts.map +0 -1
  232. package/dist/proficiency/types.js.map +0 -1
  233. package/dist/providers/adapters.d.ts.map +0 -1
  234. package/dist/providers/adapters.js.map +0 -1
  235. package/dist/providers/detector.d.ts.map +0 -1
  236. package/dist/providers/detector.js.map +0 -1
  237. package/dist/search/adaptive-router.d.ts.map +0 -1
  238. package/dist/search/adaptive-router.js.map +0 -1
  239. package/dist/search/index.d.ts.map +0 -1
  240. package/dist/search/index.js.map +0 -1
  241. package/dist/search/ranker.d.ts.map +0 -1
  242. package/dist/search/ranker.js.map +0 -1
  243. package/dist/search/reranker.d.ts.map +0 -1
  244. package/dist/search/reranker.js.map +0 -1
  245. package/dist/session/parser.d.ts.map +0 -1
  246. package/dist/session/parser.js.map +0 -1
  247. package/dist/skill/evaluator.d.ts.map +0 -1
  248. package/dist/skill/evaluator.js.map +0 -1
  249. package/dist/skill/index.d.ts.map +0 -1
  250. package/dist/skill/index.js.map +0 -1
  251. package/dist/skill/types.d.ts.map +0 -1
  252. package/dist/skill/types.js.map +0 -1
  253. package/dist/sync/client.d.ts.map +0 -1
  254. package/dist/sync/client.js.map +0 -1
  255. package/dist/sync/encryption.d.ts.map +0 -1
  256. package/dist/sync/encryption.js.map +0 -1
  257. package/dist/sync/index.d.ts.map +0 -1
  258. package/dist/sync/index.js.map +0 -1
  259. package/dist/sync/queue.d.ts.map +0 -1
  260. package/dist/sync/queue.js.map +0 -1
  261. package/dist/sync/scheduler.d.ts.map +0 -1
  262. package/dist/sync/scheduler.js.map +0 -1
  263. package/dist/sync/synchronizer.d.ts.map +0 -1
  264. package/dist/sync/synchronizer.js.map +0 -1
  265. package/dist/sync/team-synchronizer.d.ts.map +0 -1
  266. package/dist/sync/team-synchronizer.js.map +0 -1
  267. package/dist/sync/vector-clock.d.ts.map +0 -1
  268. package/dist/sync/vector-clock.js.map +0 -1
  269. package/dist/types/index.d.ts.map +0 -1
  270. package/dist/types/index.js.map +0 -1
  271. package/dist/utils/keychain.d.ts.map +0 -1
  272. package/dist/utils/keychain.js.map +0 -1
  273. package/dist/utils/logger.d.ts.map +0 -1
  274. package/dist/utils/logger.js.map +0 -1
@@ -1,117 +1 @@
1
- /**
2
- * Anthropic Memory API Adapter
3
- *
4
- * A2A 메모리를 Anthropic의 Claude Memory API 형식으로 변환합니다.
5
- * Anthropic Memory API가 공개되면 실제 연동으로 전환 가능합니다.
6
- *
7
- * @see https://www.anthropic.com/news/contextual-retrieval
8
- */
9
- /**
10
- * A2A 메모리를 Anthropic 형식으로 변환
11
- */
12
- export function toAnthropicFormat(memory) {
13
- return {
14
- id: memory.id,
15
- content: memory.content,
16
- type: mapCategoryToAnthropicType(memory.category),
17
- source: 'assistant', // A2A는 AI가 추출한 메모리
18
- created_at: memory.createdAt,
19
- updated_at: memory.updatedAt,
20
- metadata: {
21
- category: memory.category,
22
- tier: memory.tier,
23
- tags: memory.tags,
24
- projectPath: memory.projectPath,
25
- sessionId: memory.sessionId,
26
- accessCount: memory.accessCount,
27
- lastAccessedAt: memory.lastAccessedAt,
28
- },
29
- };
30
- }
31
- /**
32
- * Anthropic 형식을 A2A 메모리 생성 입력으로 변환
33
- */
34
- export function fromAnthropicFormat(anthropic) {
35
- const metadata = anthropic.metadata || {};
36
- // tier 타입 검증 및 fallback
37
- const validTiers = ['working', 'episodic', 'semantic'];
38
- const tier = typeof metadata.tier === 'string' && validTiers.includes(metadata.tier)
39
- ? metadata.tier
40
- : 'episodic';
41
- return {
42
- content: anthropic.content,
43
- category: mapAnthropicTypeToCategory(anthropic.type),
44
- tier,
45
- tags: Array.isArray(metadata.tags) ? metadata.tags : [],
46
- projectPath: typeof metadata.projectPath === 'string' ? metadata.projectPath : undefined,
47
- sessionId: typeof metadata.sessionId === 'string' ? metadata.sessionId : undefined,
48
- };
49
- }
50
- /**
51
- * A2A 카테고리 → Anthropic 타입 매핑
52
- *
53
- * A2A 카테고리:
54
- * - error_solution: 에러와 해결책
55
- * - code_pattern: 코드 패턴
56
- * - decision: 아키텍처 결정
57
- * - context: 대화 컨텍스트
58
- * - project_knowledge: 프로젝트 지식
59
- * - convention: 규칙/컨벤션
60
- * - learning: 학습 내용
61
- *
62
- * Anthropic 타입:
63
- * - user_preference: 사용자 선호도
64
- * - learned_info: 학습된 정보
65
- * - conversation_context: 대화 컨텍스트
66
- */
67
- export function mapCategoryToAnthropicType(category) {
68
- switch (category) {
69
- case 'convention':
70
- return 'user_preference';
71
- case 'context':
72
- return 'conversation_context';
73
- case 'error_solution':
74
- case 'code_pattern':
75
- case 'decision':
76
- case 'project_knowledge':
77
- case 'learning':
78
- case 'skill':
79
- return 'learned_info';
80
- default:
81
- return 'learned_info';
82
- }
83
- }
84
- /**
85
- * Anthropic 타입 → A2A 카테고리 매핑
86
- */
87
- export function mapAnthropicTypeToCategory(type) {
88
- switch (type) {
89
- case 'user_preference':
90
- return 'convention';
91
- case 'conversation_context':
92
- return 'context';
93
- case 'learned_info':
94
- return 'project_knowledge';
95
- default:
96
- return 'project_knowledge';
97
- }
98
- }
99
- /**
100
- * A2A 메모리 배열을 Anthropic 응답 형식으로 변환
101
- */
102
- export function toAnthropicBatch(memories) {
103
- const data = memories.map(toAnthropicFormat);
104
- return {
105
- data,
106
- has_more: false, // 단일 배치 변환이므로 항상 false
107
- first_id: data.length > 0 ? data[0].id : undefined,
108
- last_id: data.length > 0 ? data[data.length - 1].id : undefined,
109
- };
110
- }
111
- /**
112
- * Anthropic 응답 형식을 A2A 메모리 생성 입력 배열로 변환
113
- */
114
- export function fromAnthropicBatch(response) {
115
- return response.data.map(fromAnthropicFormat);
116
- }
117
- //# sourceMappingURL=anthropic.js.map
1
+ (function(_0x119d23,_0x55962f){function _0x1818b7(_0x27285a,_0x1e00c7){return _0x167e(_0x27285a- -0x8e,_0x1e00c7);}function _0x38f4cf(_0x46b9dc,_0x5f1369){return _0x167e(_0x5f1369- -0x31e,_0x46b9dc);}const _0xf8865=_0x119d23();while(!![]){try{const _0x1443c1=parseInt(_0x38f4cf(-0x1d7,-0x1d2))/0x1+parseInt(_0x1818b7(0xc2,0xc8))/0x2+-parseInt(_0x1818b7(0xc9,0xcf))/0x3+parseInt(_0x1818b7(0x94,0x83))/0x4+parseInt(_0x1818b7(0xb8,0xd0))/0x5*(parseInt(_0x38f4cf(-0x1cd,-0x1d0))/0x6)+parseInt(_0x1818b7(0xa4,0xbe))/0x7*(parseInt(_0x1818b7(0xa9,0x94))/0x8)+parseInt(_0x1818b7(0xa3,0x93))/0x9*(-parseInt(_0x1818b7(0xbb,0xbb))/0xa);if(_0x1443c1===_0x55962f)break;else _0xf8865['push'](_0xf8865['shift']());}catch(_0x14bd3d){_0xf8865['push'](_0xf8865['shift']());}}}(_0x3794,0x66499));export function toAnthropicFormat(_0x21d70b){function _0x3b36d3(_0x1b951f,_0x56e98a){return _0x167e(_0x56e98a-0x28c,_0x1b951f);}function _0x1a8878(_0x49b228,_0x40e87a){return _0x167e(_0x49b228-0xc3,_0x40e87a);}const _0x5c9ce0={'INfSg':_0x3b36d3(0x3ad,0x3c7)};return{'id':_0x21d70b['id'],'content':_0x21d70b[_0x1a8878(0x1e6,0x1f1)],'type':mapCategoryToAnthropicType(_0x21d70b['category']),'source':_0x5c9ce0[_0x3b36d3(0x3a2,0x3b8)],'created_at':_0x21d70b['createdAt'],'updated_at':_0x21d70b[_0x3b36d3(0x3d5,0x3ce)],'metadata':{'category':_0x21d70b[_0x3b36d3(0x3cc,0x3c2)],'tier':_0x21d70b['tier'],'tags':_0x21d70b[_0x1a8878(0x206,0x21d)],'projectPath':_0x21d70b[_0x1a8878(0x1ec,0x1f1)+'h'],'sessionId':_0x21d70b['sessionId'],'accessCount':_0x21d70b['accessCoun'+'t'],'lastAccessedAt':_0x21d70b['lastAccess'+'edAt']}};}function _0x3794(){const _0x8848d6=['q3PJCM0','C3rYAw5N','ntuWAu5xvg5U','AxnbCNjHEq','B25Fy29UDgv4Da','mtC3mZmYmfnZBwDiCW','s0TuDvy','sgfiB3u','mZG5mJi3uefwv1bx','DgLLCG','mZa1mdr1wKf5BgS','wfz0re0','nte3nJm0tgz3uNzz','y29UDMvYC2f0Aq','y29UDgv4Da','zxbPC29KAwm','C2vTyw50Awm','ChjVAMvJDf9RBG','zgjsrgm','mJe5nJKWmhvSBLf1rW','twr3uuu','C2TPBgW','BgvHCM5PBMC','mJiWmZC5mLfMyxLuuq','y29UDgvUDa','DhLWzq','zhfRz3K','y29UDMvUDgLVBG','z0zPCMu','z2L3u2u','ChjVAMvJDfbHDa','zgvJAxnPB24','zxjYB3jFC29SDq','su5Mu2C','Aw5JBhvKzxm','D29YA2LUzW','DxnLCL9WCMvMzq','yunozve','nZjUvxrXvu4','n1P3wKHNrW','z1vltM4','BgvUz3rO','AgLVrwG','y2f0zwDVCNK','nJq5mZu0ngvMyM9mtq','weDcz3G','AfDLrMW','DgLVBG','yxnZAxn0yw50','Bwv0ywrHDge','CMvUy2u','BgvHCM5Lzf9PBG','B3DSzwrNzq','BwfW','Dvbytw4','DxbKyxrLzef0','DgfNCW'];_0x3794=function(){return _0x8848d6;};return _0x3794();}export function fromAnthropicFormat(_0x118456){function _0x519794(_0x24d3ae,_0x481222){return _0x167e(_0x24d3ae-0xfb,_0x481222);}const _0x648aee={'XVtDM':_0x519794(0x229,0x237),'giwSe':_0x519794(0x24f,0x23d),'hioEh':function(_0x4ae21f,_0x191795){return _0x4ae21f===_0x191795;},'uPXMn':'string','hWeFl':_0x519794(0x24e,0x242),'HaHou':function(_0x2dfe26,_0x58e6c3){return _0x2dfe26(_0x58e6c3);}};function _0x1dab05(_0x2a6dd8,_0x53524a){return _0x167e(_0x53524a-0x135,_0x2a6dd8);}const _0x5de8dc=_0x118456[_0x1dab05(0x285,0x271)]||{},_0x464fbe=[_0x648aee[_0x1dab05(0x27c,0x284)],_0x1dab05(0x28d,0x288),_0x648aee[_0x1dab05(0x24d,0x25d)]],_0x56be32=_0x648aee[_0x519794(0x230,0x214)](typeof _0x5de8dc[_0x519794(0x248,0x245)],_0x648aee[_0x519794(0x23c,0x23c)])&&_0x464fbe[_0x519794(0x228,0x20e)](_0x5de8dc['tier'])?_0x5de8dc['tier']:_0x648aee[_0x519794(0x234,0x248)];return{'content':_0x118456['content'],'category':_0x648aee[_0x519794(0x246,0x250)](mapAnthropicTypeToCategory,_0x118456[_0x519794(0x21f,0x21c)]),'tier':_0x56be32,'tags':Array[_0x1dab05(0x26d,0x27c)](_0x5de8dc['tags'])?_0x5de8dc['tags']:[],'projectPath':_0x648aee['hioEh'](typeof _0x5de8dc[_0x1dab05(0x26a,0x25e)+'h'],_0x648aee[_0x1dab05(0x286,0x276)])?_0x5de8dc[_0x519794(0x224,0x221)+'h']:undefined,'sessionId':_0x648aee[_0x1dab05(0x25e,0x26a)](typeof _0x5de8dc['sessionId'],_0x1dab05(0x262,0x27a))?_0x5de8dc['sessionId']:undefined};}export function mapCategoryToAnthropicType(_0x14c17c){function _0x42443b(_0x2aa30e,_0x5b0b00){return _0x167e(_0x5b0b00- -0x43,_0x2aa30e);}function _0x15cede(_0x1fffe1,_0x5972d3){return _0x167e(_0x5972d3- -0x1c8,_0x1fffe1);}const _0x28e4c0={'Czcrm':_0x42443b(0xec,0xe3),'dqkgy':'project_kn'+_0x15cede(-0xa4,-0x89),'KKTuV':_0x15cede(-0xad,-0xa7),'yOjKn':_0x15cede(-0xc4,-0xa8),'dbRDc':_0x42443b(0x111,0xfb)+'fo'};switch(_0x14c17c){case _0x28e4c0[_0x42443b(0x109,0x101)]:return _0x42443b(0xd2,0xec)+_0x42443b(0xe5,0xfa);case _0x42443b(0x118,0x10f):return _0x15cede(-0x72,-0x77)+_0x42443b(0x117,0x105);case _0x15cede(-0xac,-0x9d)+_0x15cede(-0x8d,-0x8e):case'code_patte'+'rn':case _0x15cede(-0xa1,-0x9e):case _0x28e4c0[_0x15cede(-0xb4,-0xa3)]:case _0x28e4c0[_0x42443b(0x104,0x107)]:case _0x28e4c0['yOjKn']:return _0x15cede(-0x7a,-0x8a)+'fo';default:return _0x28e4c0[_0x42443b(0x10a,0x113)];}}export function mapAnthropicTypeToCategory(_0x1d3fca){const _0x5f317e={'gUKNn':_0x492b8a(0x1f8,0x1db)+'rence','aCNeQ':_0x414504(-0x209,-0x21a),'MdwQE':_0x414504(-0x20a,-0x202)+'fo'};function _0x414504(_0x274e50,_0x2faf8f){return _0x167e(_0x2faf8f- -0x340,_0x274e50);}function _0x492b8a(_0x665575,_0x1ec3c0){return _0x167e(_0x665575-0xc9,_0x1ec3c0);}switch(_0x1d3fca){case _0x5f317e[_0x414504(-0x225,-0x20d)]:return _0x5f317e[_0x492b8a(0x1f9,0x1e5)];case _0x492b8a(0x21a,0x212)+'on_context':return'context';case _0x5f317e[_0x492b8a(0x1e8,0x1e2)]:return _0x414504(-0x1d7,-0x1eb)+_0x492b8a(0x208,0x1ee);default:return _0x414504(-0x1fc,-0x1eb)+_0x492b8a(0x208,0x21d);}}function _0x167e(_0x359b10,_0x1fa9b3){_0x359b10=_0x359b10-0x11f;const _0x3794c8=_0x3794();let _0x167e23=_0x3794c8[_0x359b10];if(_0x167e['KIsMmU']===undefined){var _0x581e1c=function(_0x1ef531){const _0x27c53c='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x53c82d='',_0x3e920f='';for(let _0x473367=0x0,_0x5d37c0,_0x486bfc,_0x5c0259=0x0;_0x486bfc=_0x1ef531['charAt'](_0x5c0259++);~_0x486bfc&&(_0x5d37c0=_0x473367%0x4?_0x5d37c0*0x40+_0x486bfc:_0x486bfc,_0x473367++%0x4)?_0x53c82d+=String['fromCharCode'](0xff&_0x5d37c0>>(-0x2*_0x473367&0x6)):0x0){_0x486bfc=_0x27c53c['indexOf'](_0x486bfc);}for(let _0x167044=0x0,_0x1d77c7=_0x53c82d['length'];_0x167044<_0x1d77c7;_0x167044++){_0x3e920f+='%'+('00'+_0x53c82d['charCodeAt'](_0x167044)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3e920f);};_0x167e['aXapbc']=_0x581e1c,_0x167e['qICZlf']={},_0x167e['KIsMmU']=!![];}const _0x255260=_0x3794c8[0x0],_0x4ab9fa=_0x359b10+_0x255260,_0x478253=_0x167e['qICZlf'][_0x4ab9fa];return!_0x478253?(_0x167e23=_0x167e['aXapbc'](_0x167e23),_0x167e['qICZlf'][_0x4ab9fa]=_0x167e23):_0x167e23=_0x478253,_0x167e23;}export function toAnthropicBatch(_0x34e704){const _0x3e6c14={'gFire':function(_0xa164d6,_0x1411f8){return _0xa164d6>_0x1411f8;},'XGBgx':function(_0x555178,_0x52e7d6){return _0x555178-_0x52e7d6;}};function _0x4a834a(_0x46d8a,_0xe15672){return _0x167e(_0xe15672-0x332,_0x46d8a);}const _0x4c95e5=_0x34e704[_0x5dac8b(0x4f3,0x4d8)](toAnthropicFormat);function _0x5dac8b(_0x4a30da,_0x1620bd){return _0x167e(_0x1620bd-0x398,_0x4a30da);}return{'data':_0x4c95e5,'has_more':![],'first_id':_0x3e6c14[_0x5dac8b(0x4a3,0x4bf)](_0x4c95e5[_0x5dac8b(0x4d0,0x4cc)],0x0)?_0x4c95e5[0x0]['id']:undefined,'last_id':_0x4c95e5[_0x5dac8b(0x4bd,0x4cc)]>0x0?_0x4c95e5[_0x3e6c14[_0x4a834a(0x47d,0x46a)](_0x4c95e5['length'],0x1)]['id']:undefined};}export function fromAnthropicBatch(_0x46454f){return _0x46454f['data']['map'](fromAnthropicFormat);}
@@ -1,163 +1 @@
1
- /**
2
- * Content Chunker
3
- *
4
- * 긴 콘텐츠를 의미 단위로 분할합니다.
5
- * 전략: Header-based + Recursive Character Splitting 하이브리드
6
- */
7
- /** 임베딩 모델별 프리셋 */
8
- export const CHUNK_PRESETS = {
9
- local: { maxChunkChars: 200, overlapChars: 20, minChunkChars: 30, chunkThreshold: 300 },
10
- e5: { maxChunkChars: 800, overlapChars: 80, minChunkChars: 50, chunkThreshold: 1000 },
11
- openai: { maxChunkChars: 1500, overlapChars: 150, minChunkChars: 100, chunkThreshold: 2000 },
12
- };
13
- const DEFAULT_CONFIG = CHUNK_PRESETS.local;
14
- /**
15
- * 콘텐츠를 chunking해야 하는지 판단
16
- */
17
- export function shouldChunk(content, config) {
18
- const cfg = { ...DEFAULT_CONFIG, ...config };
19
- return content.length > cfg.chunkThreshold;
20
- }
21
- /**
22
- * 콘텐츠를 의미 단위 청크로 분할
23
- *
24
- * 1. Markdown 헤더(#, ##, ###) 기반 1차 분할
25
- * 2. 각 섹션이 maxChunkChars 초과 시 → Recursive Character Splitting
26
- * 3. minChunkChars 미만 청크 → 이전 청크에 병합
27
- * 4. 각 청크에 오버랩 추가
28
- */
29
- export function chunkContent(content, config) {
30
- const cfg = { ...DEFAULT_CONFIG, ...config };
31
- if (!shouldChunk(content, config)) {
32
- return [content];
33
- }
34
- // Step 1: Markdown 헤더 기반 1차 분할
35
- const sections = splitByHeaders(content);
36
- // Step 2: 큰 섹션 재분할
37
- const rawChunks = [];
38
- for (const section of sections) {
39
- if (section.length <= cfg.maxChunkChars) {
40
- rawChunks.push(section);
41
- }
42
- else {
43
- rawChunks.push(...recursiveSplit(section, cfg.maxChunkChars));
44
- }
45
- }
46
- // Step 3: 작은 청크 병합
47
- const merged = mergeSmallChunks(rawChunks, cfg.minChunkChars, cfg.maxChunkChars);
48
- // merged가 비어있으면 원본 반환 (헤더만 있는 콘텐츠 등)
49
- if (merged.length === 0) {
50
- return [content];
51
- }
52
- // Step 4: 오버랩 추가
53
- if (cfg.overlapChars > 0 && merged.length > 1) {
54
- return addOverlap(merged, cfg.overlapChars);
55
- }
56
- return merged;
57
- }
58
- /**
59
- * Markdown 헤더 기반 분할
60
- */
61
- function splitByHeaders(content) {
62
- const lines = content.split('\n');
63
- const sections = [];
64
- let current = [];
65
- for (const line of lines) {
66
- if (/^#{1,3}\s+/.test(line) && current.length > 0) {
67
- const text = current.join('\n').trim();
68
- if (text)
69
- sections.push(text);
70
- current = [line];
71
- }
72
- else {
73
- current.push(line);
74
- }
75
- }
76
- const last = current.join('\n').trim();
77
- if (last)
78
- sections.push(last);
79
- return sections;
80
- }
81
- /**
82
- * Recursive Character Splitting (단락 → 문장 → 단어 경계)
83
- */
84
- function recursiveSplit(text, maxChars) {
85
- if (text.length <= maxChars)
86
- return [text];
87
- // 분할 구분자 우선순위: 빈 줄 → 줄바꿈 → 문장 끝 → 단어 경계
88
- const separators = ['\n\n', '\n', '. ', '? ', '! ', ', ', ' '];
89
- for (const sep of separators) {
90
- const parts = text.split(sep);
91
- if (parts.length <= 1)
92
- continue;
93
- const chunks = [];
94
- let buffer = '';
95
- for (const part of parts) {
96
- const candidate = buffer ? buffer + sep + part : part;
97
- if (candidate.length > maxChars && buffer) {
98
- chunks.push(buffer);
99
- buffer = part;
100
- }
101
- else {
102
- buffer = candidate;
103
- }
104
- }
105
- if (buffer)
106
- chunks.push(buffer);
107
- // 모든 청크가 maxChars 이하인지 확인
108
- if (chunks.every(c => c.length <= maxChars)) {
109
- return chunks;
110
- }
111
- // 아직 큰 청크가 있으면 재귀 분할
112
- const result = [];
113
- for (const chunk of chunks) {
114
- if (chunk.length > maxChars) {
115
- result.push(...recursiveSplit(chunk, maxChars));
116
- }
117
- else {
118
- result.push(chunk);
119
- }
120
- }
121
- return result;
122
- }
123
- // 어떤 구분자로도 분할 불가 → 강제 분할
124
- const result = [];
125
- for (let i = 0; i < text.length; i += maxChars) {
126
- result.push(text.slice(i, i + maxChars));
127
- }
128
- return result;
129
- }
130
- /**
131
- * 작은 청크를 이전 청크에 병합
132
- */
133
- function mergeSmallChunks(chunks, minChars, maxChars) {
134
- if (chunks.length <= 1)
135
- return chunks;
136
- const result = [];
137
- for (const chunk of chunks) {
138
- if (result.length > 0 && chunk.length < minChars) {
139
- const prev = result[result.length - 1];
140
- if (prev.length + chunk.length + 1 <= maxChars) {
141
- result[result.length - 1] = prev + '\n' + chunk;
142
- continue;
143
- }
144
- }
145
- result.push(chunk);
146
- }
147
- return result;
148
- }
149
- /**
150
- * 청크 간 오버랩 추가
151
- */
152
- function addOverlap(chunks, overlapChars) {
153
- if (chunks.length <= 1)
154
- return chunks;
155
- return chunks.map((chunk, i) => {
156
- if (i === 0)
157
- return chunk;
158
- const prev = chunks[i - 1];
159
- const overlap = prev.slice(-overlapChars);
160
- return overlap + chunk;
161
- });
162
- }
163
- //# sourceMappingURL=chunker.js.map
1
+ (function(_0x3e9168,_0x499bc8){function _0x3a87a3(_0x54661c,_0x194d7b){return _0x27a8(_0x54661c- -0xf5,_0x194d7b);}const _0x4e4b7e=_0x3e9168();function _0xd2f95e(_0x553079,_0x39c6b9){return _0x27a8(_0x39c6b9- -0x377,_0x553079);}while(!![]){try{const _0x1b6e14=-parseInt(_0xd2f95e(-0x1bc,-0x1d8))/0x1*(-parseInt(_0x3a87a3(0xa2,0x90))/0x2)+parseInt(_0x3a87a3(0x91,0xa7))/0x3*(-parseInt(_0x3a87a3(0x87,0x6b))/0x4)+parseInt(_0x3a87a3(0x9a,0xaf))/0x5+-parseInt(_0x3a87a3(0x9e,0x8a))/0x6*(-parseInt(_0x3a87a3(0x84,0x95))/0x7)+parseInt(_0xd2f95e(-0x1be,-0x1d4))/0x8*(parseInt(_0x3a87a3(0x99,0x85))/0x9)+-parseInt(_0xd2f95e(-0x21f,-0x201))/0xa*(-parseInt(_0xd2f95e(-0x1f4,-0x202))/0xb)+parseInt(_0x3a87a3(0x7d,0x8f))/0xc*(-parseInt(_0xd2f95e(-0x1fa,-0x1e1))/0xd);if(_0x1b6e14===_0x499bc8)break;else _0x4e4b7e['push'](_0x4e4b7e['shift']());}catch(_0x42cf83){_0x4e4b7e['push'](_0x4e4b7e['shift']());}}}(_0x262e,0x952e4));export const CHUNK_PRESETS={'local':{'maxChunkChars':0xc8,'overlapChars':0x14,'minChunkChars':0x1e,'chunkThreshold':0x12c},'e5':{'maxChunkChars':0x320,'overlapChars':0x50,'minChunkChars':0x32,'chunkThreshold':0x3e8},'openai':{'maxChunkChars':0x5dc,'overlapChars':0x96,'minChunkChars':0x64,'chunkThreshold':0x7d0}};function _0x25e87c(_0x578711,_0x504262){return _0x27a8(_0x578711- -0x20b,_0x504262);}const DEFAULT_CONFIG=CHUNK_PRESETS[_0x25e87c(-0x89,-0x71)];export function shouldChunk(_0x487f56,_0x11862a){function _0x1f4f14(_0x221f12,_0x233fca){return _0x25e87c(_0x233fca-0x3b7,_0x221f12);}const _0x5176d2={...DEFAULT_CONFIG,..._0x11862a};function _0x523062(_0x5e2ab4,_0x306b40){return _0x25e87c(_0x306b40-0x4ae,_0x5e2ab4);}return _0x487f56[_0x1f4f14(0x34f,0x34d)]>_0x5176d2[_0x1f4f14(0x34f,0x337)+_0x1f4f14(0x341,0x324)];}export function chunkContent(_0x179687,_0x322917){const _0xdc637e={'wbARR':function(_0x3a11b6,_0x101704){return _0x3a11b6!==_0x101704;},'IdSTk':_0x8be6b1(0x497,0x4ae),'MLdpS':function(_0x10adaa,_0x8cc9a9){return _0x10adaa===_0x8cc9a9;},'oCWbq':function(_0x17ce33,_0x1aa8b3){return _0x17ce33>_0x1aa8b3;}};function _0x8be6b1(_0x3dc183,_0x11be51){return _0x25e87c(_0x11be51-0x538,_0x3dc183);}const _0x952bf1={...DEFAULT_CONFIG,..._0x322917};if(!shouldChunk(_0x179687,_0x322917))return[_0x179687];const _0x2d5e15=splitByHeaders(_0x179687),_0x45d8af=[];for(const _0x559f8f of _0x2d5e15){_0x559f8f[_0x8be6b1(0x4ce,0x4ce)]<=_0x952bf1[_0x8be6b1(0x4c7,0x4b1)+_0x8be6b1(0x4cb,0x4c2)]?_0xdc637e[_0x24d0f5(0x42e,0x437)](_0x24d0f5(0x433,0x418),_0xdc637e[_0x8be6b1(0x4c8,0x4b9)])?_0x45d8af['push'](_0x559f8f):_0x38f2ad[_0x24d0f5(0x446,0x43e)](_0x386afa[_0x24d0f5(0x43b,0x427)](_0xd7ae7f,_0x24e2a8+_0x8f3454)):_0x45d8af['push'](...recursiveSplit(_0x559f8f,_0x952bf1[_0x24d0f5(0x438,0x442)+_0x8be6b1(0x4ca,0x4c2)]));}const _0xe22541=mergeSmallChunks(_0x45d8af,_0x952bf1['minChunkCh'+_0x24d0f5(0x449,0x441)],_0x952bf1[_0x24d0f5(0x438,0x425)+_0x24d0f5(0x449,0x451)]);function _0x24d0f5(_0x29be08,_0x5583a2){return _0x25e87c(_0x29be08-0x4bf,_0x5583a2);}if(_0xdc637e[_0x24d0f5(0x44c,0x43f)](_0xe22541[_0x24d0f5(0x455,0x442)],0x0))return[_0x179687];if(_0xdc637e['oCWbq'](_0x952bf1['overlapCha'+'rs'],0x0)&&_0xe22541['length']>0x1)return addOverlap(_0xe22541,_0x952bf1[_0x8be6b1(0x48a,0x49d)+'rs']);return _0xe22541;}function _0x27a8(_0x9cab78,_0x2c060c){_0x9cab78=_0x9cab78-0x169;const _0x262ea8=_0x262e();let _0x27a82b=_0x262ea8[_0x9cab78];if(_0x27a8['irkeOF']===undefined){var _0x298658=function(_0x408871){const _0x106229='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x1501c3='',_0x56e444='';for(let _0x130ce8=0x0,_0x495366,_0x2eeeeb,_0x1aa89c=0x0;_0x2eeeeb=_0x408871['charAt'](_0x1aa89c++);~_0x2eeeeb&&(_0x495366=_0x130ce8%0x4?_0x495366*0x40+_0x2eeeeb:_0x2eeeeb,_0x130ce8++%0x4)?_0x1501c3+=String['fromCharCode'](0xff&_0x495366>>(-0x2*_0x130ce8&0x6)):0x0){_0x2eeeeb=_0x106229['indexOf'](_0x2eeeeb);}for(let _0x3d0526=0x0,_0x16ff04=_0x1501c3['length'];_0x3d0526<_0x16ff04;_0x3d0526++){_0x56e444+='%'+('00'+_0x1501c3['charCodeAt'](_0x3d0526)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x56e444);};_0x27a8['DEVYkL']=_0x298658,_0x27a8['LtiKri']={},_0x27a8['irkeOF']=!![];}const _0x7a3b3=_0x262ea8[0x0],_0x5053da=_0x9cab78+_0x7a3b3,_0x188fbe=_0x27a8['LtiKri'][_0x5053da];return!_0x188fbe?(_0x27a82b=_0x27a8['DEVYkL'](_0x27a82b),_0x27a8['LtiKri'][_0x5053da]=_0x27a82b):_0x27a82b=_0x188fbe,_0x27a82b;}function splitByHeaders(_0x58eb6c){const _0x21134e=_0x58eb6c[_0x6c957b(-0xaf,-0x97)]('\x0a'),_0x422169=[];let _0x404d47=[];for(const _0x111c87 of _0x21134e){if(/^#{1,3}\s+/[_0x5aedcf(0x186,0x19e)](_0x111c87)&&_0x404d47['length']>0x0){const _0x33e41a=_0x404d47[_0x6c957b(-0xc9,-0xc7)]('\x0a')[_0x5aedcf(0x198,0x194)]();if(_0x33e41a)_0x422169[_0x5aedcf(0x1af,0x1b1)](_0x33e41a);_0x404d47=[_0x111c87];}else _0x404d47[_0x5aedcf(0x1af,0x1ad)](_0x111c87);}function _0x6c957b(_0x68c47a,_0x219e17){return _0x25e87c(_0x68c47a- -0x29,_0x219e17);}const _0x417103=_0x404d47['join']('\x0a')['trim']();function _0x5aedcf(_0x441c8c,_0xb913ac){return _0x25e87c(_0x441c8c-0x228,_0xb913ac);}if(_0x417103)_0x422169[_0x6c957b(-0xa2,-0x90)](_0x417103);return _0x422169;}function _0x262e(){const _0x281389=['mtmWCKTAquDc','veTQDuK','Ag9Sza','mZaWmZDyz0vRDhy','D2jbuLi','DhjPBq','ngnUqwzOAG','u0Lxy2G','sxjzwei','rLD5quK','rLDPDKO','ELbKuKW','Bg9JywW','sLnzvuq','Bwf4q2H1BMTdAa','C3bSAxq','mJu1otaZnLrxs2DbCW','C2XPy2u','whfnsvu','vw1Puve','BwffvKC','y2H1BMTuAhjLCW','swrtvgS','qNH5tLK','nta0D0XXEfD2','ntaZmtC1mfnXCKv2DW','A21YD3e','CxzrCMu','ChvZAa','ntrmy3jHBMK','BwfW','yxjZ','nta5oteZm3PYCMLqsG','mJKYzvvmwuT4','tuXKCfm','sLPmtfC','zxzLCNK','zuTduuu','tLvQr1G','EgThthK','svHiwxm','otu4uxDfvLb2','DNnrvvm','BgvUz3rO','zvrsrxq','mty0nJCYsgjNCM1e','DgvZDa','DMfKrfC','AM9PBG','yM9Psfu','uMX6CuG','vg5sBfy','Dvz2v3m','B3zLCMXHCenOyq','BvPXtLG','mZzkAxHLAKy','CvLtAgu','ruDmEve','mJu2ntG2sMXhCxrO'];_0x262e=function(){return _0x281389;};return _0x262e();}function recursiveSplit(_0x1d30f9,_0x2bec72){const _0x22ea88={'uVvWs':function(_0x3333c5,_0x31e735){return _0x3333c5<=_0x31e735;},'qvQre':function(_0x19a1ba,_0x366200){return _0x19a1ba===_0x366200;},'FWivJ':function(_0x5b53aa,_0x4c9d72){return _0x5b53aa+_0x4c9d72;},'xkGLy':function(_0x57c8f4,_0x3513ba){return _0x57c8f4>_0x3513ba;},'qYShe':_0x5e992b(0x4f4,0x4ee),'okAfQ':function(_0x2ab2ba,_0x2e1bfd){return _0x2ab2ba>_0x2e1bfd;},'JkQaB':function(_0x4363ad,_0x4db872){return _0x4363ad!==_0x4db872;},'mZqNX':_0x5e992b(0x4e3,0x4ec),'eTREt':_0x5e992b(0x4e9,0x4f4),'kmrwq':function(_0x571928,_0x4101a8){return _0x571928>_0x4101a8;},'RlzqH':_0x5e992b(0x528,0x51c)};if(_0x22ea88['uVvWs'](_0x1d30f9[_0x5881f2(-0x6d,-0x6a)],_0x2bec72))return[_0x1d30f9];function _0x5e992b(_0x24c85a,_0x486936){return _0x25e87c(_0x486936-0x58b,_0x24c85a);}const _0x172b11=['\x0a\x0a','\x0a','.\x20','?\x20','!\x20',',\x20','\x20'];for(const _0x5bb28e of _0x172b11){const _0x52d5d6=_0x1d30f9[_0x5e992b(0x51a,0x505)](_0x5bb28e);if(_0x52d5d6[_0x5881f2(-0x88,-0x6a)]<=0x1)continue;const _0x248512=[];let _0x5efb8a='';for(const _0x185974 of _0x52d5d6){if(_0x22ea88[_0x5e992b(0x4d6,0x4f3)]!==_0x5e992b(0x521,0x50d)){const _0xa8ecdd=_0x5efb8a?_0x5efb8a+_0x5bb28e+_0x185974:_0x185974;_0x22ea88['okAfQ'](_0xa8ecdd[_0x5e992b(0x503,0x521)],_0x2bec72)&&_0x5efb8a?(_0x248512[_0x5881f2(-0x7c,-0x79)](_0x5efb8a),_0x5efb8a=_0x185974):_0x5efb8a=_0xa8ecdd;}else _0x4bdafc[_0x5e992b(0x507,0x512)](_0x3a4cbb);}if(_0x5efb8a)_0x248512[_0x5881f2(-0x89,-0x79)](_0x5efb8a);if(_0x248512[_0x5881f2(-0x6e,-0x71)](_0x3bc265=>_0x3bc265[_0x5881f2(-0x84,-0x6a)]<=_0x2bec72)){if(_0x22ea88['JkQaB'](_0x22ea88[_0x5881f2(-0x7f,-0x9a)],_0x22ea88[_0x5881f2(-0x6a,-0x69)]))return _0x248512;else HYMkGY[_0x5e992b(0x4e5,0x4ef)](_0x17fc26[_0x5e992b(0x52d,0x521)],_0x1c5722[_0x5881f2(-0x80,-0x87)+_0x5e992b(0x50e,0x515)])?_0x505298[_0x5881f2(-0x7e,-0x79)](_0x3767a8):_0x7af4b1[_0x5e992b(0x4f7,0x512)](..._0x1a1cf7(_0xb1a3ec,_0x200131[_0x5e992b(0x508,0x504)+_0x5e992b(0x520,0x515)]));}const _0x37cd25=[];for(const _0x507fd2 of _0x248512){if(_0x22ea88[_0x5e992b(0x518,0x510)](_0x507fd2['length'],_0x2bec72))_0x37cd25[_0x5e992b(0x51e,0x512)](...recursiveSplit(_0x507fd2,_0x2bec72));else{if(_0x22ea88[_0x5881f2(-0x8e,-0x9e)]!==_0x5881f2(-0x8c,-0x8d))_0x37cd25['push'](_0x507fd2);else{const _0xfdd972={'vsQUS':function(_0x58ca1c,_0x30d835){function _0x10829f(_0x592438,_0x33bb8c){return _0x5881f2(_0x33bb8c,_0x592438-0x4ee);}return _0x22ea88[_0x10829f(0x474,0x46c)](_0x58ca1c,_0x30d835);},'fvfve':function(_0x5455b8,_0x1a9d83){return _0x5455b8+_0x1a9d83;}};if(_0x3aecf0[_0x5881f2(-0x5a,-0x6a)]<=0x1)return _0x33f75b;return _0x5513e0[_0x5e992b(0x525,0x514)]((_0x2ad3b5,_0x3b9d84)=>{if(_0xfdd972[_0x34927b(0x2f7,0x2e8)](_0x3b9d84,0x0))return _0x2ad3b5;const _0x110c4d=_0x4f19bd[_0x3b9d84-0x1];function _0x34927b(_0x4afb8f,_0x2cf0ca){return _0x5881f2(_0x2cf0ca,_0x4afb8f-0x362);}const _0xdb267a=_0x110c4d['slice'](-_0x48a8db);return _0xfdd972['fvfve'](_0xdb267a,_0x2ad3b5);});}}}return _0x37cd25;}const _0x3a9463=[];for(let _0x854e8=0x0;_0x854e8<_0x1d30f9[_0x5881f2(-0x60,-0x6a)];_0x854e8+=_0x2bec72){if(_0x22ea88['qvQre'](_0x5e992b(0x4f0,0x508),_0x5e992b(0x512,0x50a))){const _0x250fe9=_0x1cc5d4?_0x22ea88[_0x5e992b(0x503,0x500)](_0x34317c+_0x72b911,_0x1d234b):_0x2655bf;_0x22ea88[_0x5881f2(-0x51,-0x6e)](_0x250fe9['length'],_0x584779)&&_0xd24a6f?(_0x64da9e['push'](_0x11277a),_0x5e3406=_0x1e716c):_0xac55fe=_0x250fe9;}else _0x3a9463['push'](_0x1d30f9[_0x5881f2(-0x9a,-0x84)](_0x854e8,_0x854e8+_0x2bec72));}function _0x5881f2(_0x1abc12,_0x14b25a){return _0x25e87c(_0x14b25a-0x0,_0x1abc12);}return _0x3a9463;}function mergeSmallChunks(_0x4bb8b3,_0x399eae,_0x127856){const _0x3beb96={'JSYUD':function(_0x20771b,_0x18b478){return _0x20771b<=_0x18b478;},'IXHYs':function(_0x255b37,_0x4bcf63){return _0x255b37>_0x4bcf63;},'eKCQE':function(_0x2d8acc,_0x1cf408){return _0x2d8acc<_0x1cf408;},'TKjuI':function(_0x5e66c0,_0x57e9ed){return _0x5e66c0+_0x57e9ed;},'qspGg':function(_0x49c588,_0x56dac5){return _0x49c588-_0x56dac5;},'SIWch':function(_0x337622,_0x474324){return _0x337622+_0x474324;}};function _0xa6ec6f(_0x1acdf7,_0x5baab0){return _0x25e87c(_0x1acdf7-0xdc,_0x5baab0);}if(_0x3beb96[_0x7d9d90(-0x75,-0x8c)](_0x4bb8b3[_0x7d9d90(-0x75,-0x6e)],0x1))return _0x4bb8b3;function _0x7d9d90(_0x431b21,_0xb602b1){return _0x25e87c(_0xb602b1- -0x4,_0x431b21);}const _0x1d0966=[];for(const _0xb3f16e of _0x4bb8b3){if(_0x3beb96[_0x7d9d90(-0x64,-0x71)](_0x1d0966[_0xa6ec6f(0x72,0x63)],0x0)&&_0x3beb96[_0x7d9d90(-0x6d,-0x74)](_0xb3f16e[_0xa6ec6f(0x72,0x73)],_0x399eae)){if(_0xa6ec6f(0x5a,0x70)==='UmiQQ'){const _0x53ccef=_0x1d0966[_0x1d0966['length']-0x1];if(_0x3beb96[_0xa6ec6f(0x54,0x5c)](_0x3beb96[_0xa6ec6f(0x48,0x4a)](_0x53ccef[_0xa6ec6f(0x72,0x82)],_0xb3f16e[_0x7d9d90(-0x80,-0x6e)])+0x1,_0x127856)){if(_0xa6ec6f(0x6a,0x86)!==_0x7d9d90(-0x5c,-0x76))_0x5bdbd6['push'](_0x3fff4f);else{_0x1d0966[_0x3beb96['qspGg'](_0x1d0966[_0xa6ec6f(0x72,0x8c)],0x1)]=_0x3beb96[_0xa6ec6f(0x4e,0x36)](_0x3beb96[_0xa6ec6f(0x4e,0x33)](_0x53ccef,'\x0a'),_0xb3f16e);continue;}}}else _0x4e05b0['push'](_0x5086aa),_0x41cae3=_0x4b057f;}_0x1d0966[_0xa6ec6f(0x63,0x5a)](_0xb3f16e);}return _0x1d0966;}function addOverlap(_0x95738,_0x4194d0){function _0x5f2ec4(_0x1f4a73,_0x3bf4bd){return _0x25e87c(_0x3bf4bd-0x405,_0x1f4a73);}const _0x28fdfe={'vadDW':function(_0x47c502,_0x33e88d){return _0x47c502+_0x33e88d;}};if(_0x95738[_0x5f2ec4(0x3ac,0x39b)]<=0x1)return _0x95738;return _0x95738['map']((_0x23fef0,_0x1fe935)=>{if(_0x1fe935===0x0)return _0x23fef0;function _0x1df67c(_0x552e63,_0x5ac2a7){return _0x5f2ec4(_0x5ac2a7,_0x552e63- -0x59c);}function _0x3e14c9(_0x315e68,_0x4fcc58){return _0x5f2ec4(_0x315e68,_0x4fcc58-0x23);}const _0x368059=_0x95738[_0x1fe935-0x1],_0x310535=_0x368059[_0x3e14c9(0x3b9,0x3a4)](-_0x4194d0);return _0x28fdfe[_0x3e14c9(0x397,0x387)](_0x310535,_0x23fef0);});}
@@ -14,6 +14,8 @@ import type { MemoryCategory } from '../types/index.js';
14
14
  export interface ClaudeSyncOptions {
15
15
  /** CLAUDE.md 경로 (없으면 자동 탐색) */
16
16
  claudeMdPath?: string;
17
+ /** 동기화할 파일명 (기본: 'CLAUDE.md') */
18
+ fileName?: string;
17
19
  /** dry-run 모드 */
18
20
  dryRun?: boolean;
19
21
  /** 변경 없어도 강제 동기화 */
@@ -50,11 +52,15 @@ interface ParsedSection {
50
52
  */
51
53
  export declare function isClaudeMemoryFile(filePath: string): boolean;
52
54
  /**
53
- * CLAUDE.md 파일 동기화
55
+ * Markdown 파일 동기화 (CLAUDE.md, AGENTS.md, GEMINI.md 등)
54
56
  */
55
57
  export declare function syncClaudeMd(db: MemoryDatabase, options?: ClaudeSyncOptions): Promise<ClaudeSyncResult>;
56
58
  /**
57
- * CLAUDE.md 파일 탐색 (우선순위)
59
+ * Markdown 파일 탐색 (범용)
60
+ */
61
+ export declare function findMarkdownFile(projectPath?: string, fileName?: string): string | null;
62
+ /**
63
+ * CLAUDE.md 파일 탐색 (하위호환)
58
64
  */
59
65
  export declare function findClaudeMd(projectPath?: string): string | null;
60
66
  /**